upload tizen1.0 source
authorKim Kibum <kb0929.kim@samsung.com>
Sun, 29 Apr 2012 08:02:10 +0000 (17:02 +0900)
committerKim Kibum <kb0929.kim@samsung.com>
Sun, 29 Apr 2012 08:02:10 +0000 (17:02 +0900)
177 files changed:
Makefile
build-tools/README.txt
build-tools/bin/jslint [new file with mode: 0755]
build-tools/lib/jslint/LICENSE [new file with mode: 0644]
build-tools/lib/jslint/abbrev.js [new file with mode: 0644]
build-tools/lib/jslint/color.js [new file with mode: 0644]
build-tools/lib/jslint/jslint.js [new file with mode: 0644]
build-tools/lib/jslint/linter.js [new file with mode: 0644]
build-tools/lib/jslint/nodelint.js [new file with mode: 0644]
build-tools/lib/jslint/nopt.js [new file with mode: 0644]
build-tools/lib/jslint/nopt/LICENSE [new file with mode: 0644]
build-tools/lib/jslint/nopt/abbrev.js [new file with mode: 0644]
build-tools/lib/jslint/nopt/nopt.js [new file with mode: 0644]
build-tools/lib/jslint/reporter.js [new file with mode: 0644]
demos/tizen-gray/icon-tizen.png [new file with mode: 0644]
demos/tizen-gray/index.html
demos/tizen-gray/init.js
demos/tizen-gray/widgets/button/button.html
demos/tizen-gray/widgets/ctxpopup.html
demos/tizen-gray/widgets/ctxpopup.js [new file with mode: 0644]
demos/tizen-gray/widgets/datefield.html
demos/tizen-gray/widgets/grid/css/namecard.css [new file with mode: 0755]
demos/tizen-gray/widgets/grid/images/nba_76ers.jpg [new file with mode: 0755]
demos/tizen-gray/widgets/grid/images/nba_bobcats.jpg [new file with mode: 0755]
demos/tizen-gray/widgets/grid/images/nba_bucks.jpg [new file with mode: 0755]
demos/tizen-gray/widgets/grid/images/nba_bulls.jpg [new file with mode: 0755]
demos/tizen-gray/widgets/grid/images/nba_cavaliers.jpg [new file with mode: 0755]
demos/tizen-gray/widgets/grid/images/nba_celtics.jpg [new file with mode: 0755]
demos/tizen-gray/widgets/grid/images/nba_clippers.jpg [new file with mode: 0755]
demos/tizen-gray/widgets/grid/images/nba_griz.jpg [new file with mode: 0755]
demos/tizen-gray/widgets/grid/images/nba_hawks.jpg [new file with mode: 0755]
demos/tizen-gray/widgets/grid/images/nba_heats.jpg [new file with mode: 0755]
demos/tizen-gray/widgets/grid/images/nba_honets.jpg [new file with mode: 0755]
demos/tizen-gray/widgets/grid/images/nba_jazz.jpg [new file with mode: 0755]
demos/tizen-gray/widgets/grid/images/nba_kings.jpg [new file with mode: 0755]
demos/tizen-gray/widgets/grid/images/nba_knics.jpg [new file with mode: 0755]
demos/tizen-gray/widgets/grid/images/nba_lakers.jpg [new file with mode: 0755]
demos/tizen-gray/widgets/grid/images/nba_magics.jpg [new file with mode: 0755]
demos/tizen-gray/widgets/grid/images/nba_mavericks.jpg [new file with mode: 0755]
demos/tizen-gray/widgets/grid/images/nba_nets.jpg [new file with mode: 0755]
demos/tizen-gray/widgets/grid/images/nba_nuggets.jpg [new file with mode: 0755]
demos/tizen-gray/widgets/grid/images/nba_pacers.jpg [new file with mode: 0755]
demos/tizen-gray/widgets/grid/images/nba_pistons.jpg [new file with mode: 0755]
demos/tizen-gray/widgets/grid/images/nba_raptors.jpg [new file with mode: 0755]
demos/tizen-gray/widgets/grid/images/nba_rockets.jpg [new file with mode: 0755]
demos/tizen-gray/widgets/grid/images/nba_sonics.jpg [new file with mode: 0755]
demos/tizen-gray/widgets/grid/images/nba_spurs.jpg [new file with mode: 0755]
demos/tizen-gray/widgets/grid/images/nba_suns.jpg [new file with mode: 0755]
demos/tizen-gray/widgets/grid/images/nba_timberwolves.jpg [new file with mode: 0755]
demos/tizen-gray/widgets/grid/images/nba_trail.jpg [new file with mode: 0755]
demos/tizen-gray/widgets/grid/images/nba_warriors.jpg [new file with mode: 0755]
demos/tizen-gray/widgets/grid/images/nba_wizards.jpg [new file with mode: 0755]
demos/tizen-gray/widgets/grid/js/virtualgrid-db-demo.js [new file with mode: 0755]
demos/tizen-gray/widgets/grid/virtualgrid.html [new file with mode: 0755]
demos/tizen-gray/widgets/handler.html [new file with mode: 0755]
demos/tizen-gray/widgets/list/list-bubble.html
demos/tizen-gray/widgets/list/list-normal.html
demos/tizen-gray/widgets/list/virtuallist-normal.html
demos/tizen-gray/widgets/list/virtuallist-normal_3_1_14.html
demos/tizen-gray/widgets/list/virtuallist-normal_3_1_4.html
demos/tizen-gray/widgets/list/virtuallist-normal_3_1_6.html
demos/tizen-gray/widgets/list/virtuallist-normal_3_2_7.html
demos/tizen-gray/widgets/multibuttonentry-demo.js [new file with mode: 0755]
demos/tizen-gray/widgets/multimediaview/multimediaview.html [new file with mode: 0755]
demos/tizen-gray/widgets/multimediaview/multimediaview_audio.html [new file with mode: 0755]
demos/tizen-gray/widgets/multimediaview/multimediaview_video.html [new file with mode: 0755]
demos/tizen-gray/widgets/progressbar.js
demos/tizen-gray/widgets/searchbar.html
demos/tizen-gray/widgets/searchbar.js [new file with mode: 0755]
demos/tizen-gray/widgets/test/ctxpopup_1.png [new file with mode: 0755]
demos/tizen-gray/widgets/test/ctxpopup_2.png [new file with mode: 0755]
demos/tizen-gray/widgets/test/ctxpopup_3.png [new file with mode: 0755]
demos/tizen-gray/widgets/test/ctxpopup_4.png [new file with mode: 0755]
demos/tizen-gray/widgets/tickernoti-interval.html
libs/js/domready.js [deleted file]
libs/js/globalize/.gitignore [deleted file]
libs/js/jquery.ui.position.git+dfe75e1.js [deleted file]
libs/js/jquery.ui.position.git+dfe75e1.min.js [deleted file]
libs/js/underscore.js [deleted file]
libs/patch/.gitignore [deleted file]
libs/patch/0001-JQM-Fix-jqm-build-to-exclude-compressed-version-buil.patch
libs/patch/0002-JQM-Fix-bug-on-live-firing-of-custom-events.patch
libs/patch/0003-JQM-Don-t-draw-right-arrow-on-clickable-listitems-Fo.patch
libs/patch/0004-JQM-Change-button-design-to-meet-Tizen-GUI-Button-Ev.patch [deleted file]
libs/patch/0004-JQM-button-event-bug-fixed.patch [new file with mode: 0644]
libs/patch/0005-JQM-Change-button-design-to-meet-TIZEN-UI.patch [new file with mode: 0644]
libs/patch/0005-JQM-Change-header-footer-code-to-meet-Tizen-GUI.patch [deleted file]
libs/patch/0006-JQM-Change-header-footer-code-to-meet-TIZEN-UI.patch [new file with mode: 0644]
libs/patch/0007-JQM-Add-back-button-into-header-footer.patch [moved from libs/patch/0006-JQM-Add-back-button-into-header-footer.patch with 52% similarity]
libs/patch/0008-JQM-change-click-to-vclick-for-click-routing.patch [deleted file]
libs/patch/0008-JQM-checkbox-pressed-no-lable-support.patch [moved from libs/patch/0007-JQM-checkbox-pressed-no-lable-support.patch with 66% similarity]
libs/patch/0009-JQM-Resize-content-in-scrollview.patch [deleted file]
libs/patch/0009-JQM-remove-search-init-selector-and-functions.patch [new file with mode: 0644]
libs/patch/0010-JQM-change-input-s-type-on-fixed-header.patch [new file with mode: 0644]
libs/patch/0011-JQM-change-input-s-type-on-fixed-header.patch [deleted file]
libs/patch/0011-jQuery-Remove-layerX-layerY-events-which-is-deprecat.patch [new file with mode: 0644]
libs/patch/0012-JQM-delete-defaultFooter-size.patch [new file with mode: 0755]
packaging/web-ui-fw.spec [new file with mode: 0644]
src/loader/loader.js
src/template/index.html.in
src/themes/tizen/common/dayselector.less [deleted file]
src/themes/tizen/common/jquery.mobile.button.less
src/themes/tizen/common/jquery.mobile.core.less
src/themes/tizen/common/jquery.mobile.forms.textinput.less
src/themes/tizen/common/jquery.mobile.listview.less
src/themes/tizen/common/jquery.mobile.theme.less
src/themes/tizen/common/jquery.mobile.tizen.colorpalette.less
src/themes/tizen/common/jquery.mobile.tizen.colorpicker.less
src/themes/tizen/common/jquery.mobile.tizen.colorpickerbutton.less [moved from src/themes/tizen/common/jquery.mobile.tizen.colorpickerbutton.css with 80% similarity]
src/themes/tizen/common/jquery.mobile.tizen.colortitle.less
src/themes/tizen/common/jquery.mobile.tizen.ctxpopup.less
src/themes/tizen/common/jquery.mobile.tizen.dayselector.less
src/themes/tizen/common/jquery.mobile.tizen.hsvpicker.less
src/themes/tizen/common/jquery.mobile.tizen.less
src/themes/tizen/common/jquery.mobile.tizen.multibuttonentry.less [new file with mode: 0755]
src/themes/tizen/common/jquery.mobile.tizen.multimediaview.less [new file with mode: 0755]
src/themes/tizen/common/jquery.mobile.tizen.nocontents.less
src/themes/tizen/common/jquery.mobile.tizen.notification.less
src/themes/tizen/common/jquery.mobile.tizen.optionheader.less
src/themes/tizen/common/jquery.mobile.tizen.popupwindow.less
src/themes/tizen/common/jquery.mobile.tizen.progress.less
src/themes/tizen/common/jquery.mobile.tizen.progressbar.less
src/themes/tizen/common/jquery.mobile.tizen.scrollview.handler.less [new file with mode: 0755]
src/themes/tizen/common/jquery.mobile.tizen.scrollview.less [moved from src/themes/tizen/common/jquery.mobile.tizen.scrollview.css with 74% similarity]
src/themes/tizen/common/jquery.mobile.tizen.slider.less
src/themes/tizen/common/jquery.mobile.tizen.virtualgridview.less [new file with mode: 0755]
src/themes/tizen/tizen-gray/Makefile
src/themes/tizen/tizen-gray/color.less
src/themes/tizen/tizen-gray/images/00_button_fullscreen_off.png [new file with mode: 0755]
src/themes/tizen/tizen-gray/images/00_button_fullscreen_on.png [new file with mode: 0755]
src/themes/tizen/tizen-gray/images/00_scroll_bar_handler.png
src/themes/tizen/tizen-gray/images/00_scroll_bar_handler_hor.png
src/themes/tizen/tizen-gray/images/00_splitscreen_handler.png
src/themes/tizen/tizen-gray/images/00_splitscreen_handler_hor.png
src/themes/tizen/tizen-gray/images/ajax-loader.png [new file with mode: 0644]
src/widgets/000_widgetex/js/widgetex.js [changed mode: 0644->0755]
src/widgets/010_colorwidget/js/jquery.mobile.tizen.colorwidget.js
src/widgets/020_huegradient/js/jquery.mobile.tizen.huegradient.js
src/widgets/a_colorwidget/js/colorwidget.js [changed mode: 0644->0755]
src/widgets/autodividers/js/jquery.mobile.tizen.autodividers.js [moved from src/widgets/autodividers/js/autodividers.js with 52% similarity, mode: 0755]
src/widgets/circularview/js/jquery.mobile.tizen.circularview.js [changed mode: 0644->0755]
src/widgets/colorpalette/js/jquery.mobile.tizen.colorpalette.js
src/widgets/colorpicker/js/jquery.mobile.tizen.colorpicker.js
src/widgets/colorpickerbutton/js/jquery.mobile.tizen.colorpickerbutton.js
src/widgets/colortitle/js/jquery.mobile.tizen.colortitle.js
src/widgets/common/js/jquery.mobile.tizen.scrollview.js
src/widgets/controlbar/js/jquery.mobile.tizen.controlbar.js
src/widgets/datetimepicker/js/jquery.mobile.tizen.datetimepicker.js
src/widgets/datetimepicker/js/range.js
src/widgets/dayselector/js/jquery.mobile.tizen.dayselector.js
src/widgets/expandablelist/js/jquery.mobile.tizen.expandablelist.js
src/widgets/extendablelist/js/jquery.mobile.tizen.extendablelist.js
src/widgets/handler/js/jquery.tizen.scrollview.handler.js [new file with mode: 0755]
src/widgets/hsvpicker/js/jquery.mobile.tizen.hsvpicker.js
src/widgets/imageslider/js/jquery.mobile.tizen.imageslider.js [changed mode: 0644->0755]
src/widgets/layout-box/js/layout-box.js [changed mode: 0644->0755]
src/widgets/listviewcontrols/js/listviewcontrols.js [changed mode: 0644->0755]
src/widgets/multibuttonentry/js/jquery.mobile.tizen.multibuttonentry.js [new file with mode: 0755]
src/widgets/multimediaview/js/jquery.mobile.tizen.multimediaview.js [new file with mode: 0755]
src/widgets/nocontents/js/jquery.mobile.tizen.nocontents.js
src/widgets/notification/js/jquery.mobile.tizen.notification.js
src/widgets/optionheader/js/jquery.mobile.tizen.optionheader.js
src/widgets/pagecontrol/js/jquery.mobile.tizen.pagecontrol.js
src/widgets/pagelist/js/jquery.mobile.tizen.pagelist.js [new file with mode: 0755]
src/widgets/pagelist/js/pagelist.js [deleted file]
src/widgets/popupwindow/js/jquery.mobile.tizen.popupwindow.js
src/widgets/popupwindow_ctxpopup/js/jquery.mobile.tizen.ctxpopup.js [changed mode: 0644->0755]
src/widgets/progress/js/jquery.mobile.tizen.progress.js [changed mode: 0644->0755]
src/widgets/progressbar/js/jquery.mobile.tizen.progressbar.js [changed mode: 0644->0755]
src/widgets/searchbar/js/jquery.mobile.tizen.searchbar.js
src/widgets/shortcutscroll/js/jquery.mobile.tizen.shortcutscroll.js [changed mode: 0644->0755]
src/widgets/slider/js/jquery.mobile.tizen.slider.js
src/widgets/swipelist/js/jquery.mobile.tizen.swipelist.js
src/widgets/toggleswitch/js/jquery.mobile.tizen.toggleswitch.js [changed mode: 0644->0755]
src/widgets/triangle/js/jquery.mobile.tizen.triangle.js
src/widgets/virtualgrid/js/jquery.mobile.tizen.virtualgrid.js [new file with mode: 0755]
src/widgets/virtuallist/js/jquery.mobile.tizen.virtuallistview.js

index 1422fca..45f7d47 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -7,6 +7,8 @@ THEME_NAME = default
 
 PATH := $(CURDIR)/build-tools/bin:$(PATH)
 
+JSLINT_LEVEL = 1
+JSLINT = jslint --sloppy --eqeq --bitwise --forin --nomen --predef jQuery --color --plusplus --browser --jqmspace
 INLINE_PROTO = 1
 OUTPUT_ROOT = $(CURDIR)/build
 FRAMEWORK_ROOT = ${OUTPUT_ROOT}/${PROJECT_NAME}/${VERSION}
@@ -37,25 +39,20 @@ FW_MIN = $(subst .js,.min.js,$(FW_JS))
 FW_LIB_JS = ${JS_OUTPUT_ROOT}/${PROJECT_NAME}-libs.js
 FW_LIB_MIN = $(subst .js,.min.js,$(FW_LIB_JS))
 
-
-
 FW_JS_THEME = ${JS_OUTPUT_ROOT}/${PROJECT_NAME}-${THEME_NAME}-theme.js
 FW_CSS = ${CSS_OUTPUT_ROOT}/${PROJECT_NAME}-theme.css
 FW_LIBS_JS = ${JS_OUTPUT_ROOT}/${PROJECT_NAME}-libs.js
 FW_THEME_CSS_FILE = ${PROJECT_NAME}-theme.css
 FW_WIDGET_CSS_FILE = ${WIDGET_CSS_OUTPUT_ROOT}/${PROJECT_NAME}-widget.css
 
-LIBS_JS_FILES = underscore.js \
-                jlayout/jquery.sizes.js \
-                jlayout/jlayout.border.js \
-                jlayout/jlayout.grid.js \
-                jlayout/jlayout.flexgrid.js \
-                jlayout/jlayout.flow.js \
-                jlayout/jquery.jlayout.js \
-                               domready.js \
+LIBS_JS_FILES = jlayout/jquery.sizes.js \
+                               jlayout/jlayout.border.js \
+                               jlayout/jlayout.grid.js \
+                               jlayout/jlayout.flexgrid.js \
+                               jlayout/jlayout.flow.js \
+                               jlayout/jquery.jlayout.js \
                 $(NULL)
 
-JQUERY_MOBILE = submodules/jquery-mobile/compiled/jquery.mobile.js
 JQUERY_MOBILE_CSS = submodules/jquery-mobile/compiled/jquery.mobile.structure.css \
                     submodules/jquery-mobile/compiled/jquery.mobile.css \
                     $(NULL)
@@ -67,13 +64,11 @@ JQM_LIB_PATH = $(CURDIR)/libs/js/${JQM_VERSION}
 ifeq (${DEBUG},yes)
 LIBS_JS_FILES +=\
        jquery.mobile.js \
-    jquery.ui.position.git+dfe75e1.js \
     $(NULL)
 JQUERY = jquery-1.6.4.js
 else
 LIBS_JS_FILES +=\
        jquery.mobile.min.js \
-    jquery.ui.position.git+dfe75e1.min.js \
     $(NULL)
 JQUERY = jquery-1.6.4.min.js
 endif
@@ -90,23 +85,26 @@ LIBS_CSS_FILES +=\
 endif
 
 
-all: third_party widgets loader themes version_compat compress
+all: libs_prepare third_party widgets libs_cleanup loader themes version_compat compress
 
-
-jqm: init
-       # Building jQuery Mobile...
-       @@test -d ${JQM_LIB_PATH}.bak && rm -f ${JQM_LIB_PATH} && mv ${JQM_LIB_PATH}.bak ${JQM_LIB_PATH}; \
-       cp -a ${JQM_LIB_PATH} ${JQM_LIB_PATH}.bak; \
-       for f in `ls $(CURDIR)/libs/patch/*.patch`; do \
+libs_prepare:
+       # Prepare libs/ build...
+       @@test -d ${LIBS_DIR}.bak && rm -rf ${LIBS_DIR} && mv ${LIBS_DIR}.bak ${LIBS_DIR}; \
+       cp -a ${LIBS_DIR} ${LIBS_DIR}.bak
+       for f in `ls ${LIBS_DIR}/patch/*.patch`; do \
                cd $(CURDIR); \
                echo "Apply patch: $$f";  \
                cat $$f | patch -p1 -N; \
        done; \
-       cd ${JQM_LIB_PATH} && make all-but-min || exit 1; \
-       cp -f ${JQM_LIB_PATH}/compiled/*.js ${JQM_LIB_PATH}/../; \
-       rm -rf ${JQM_LIB_PATH}; mv ${JQM_LIB_PATH}.bak ${JQM_LIB_PATH};
 
+libs_cleanup:
+       # Cleanup libs/ directory...
+       @@rm -rf ${LIBS_DIR} && mv ${LIBS_DIR}.bak ${LIBS_DIR}
 
+jqm: init
+       # Building jQuery Mobile...
+       cd ${JQM_LIB_PATH} && make all-but-min || exit 1; \
+       cp -f ${JQM_LIB_PATH}/compiled/*.js ${JQM_LIB_PATH}/../; \
 
 third_party: init jqm
        # Building third party components...
@@ -131,15 +129,23 @@ widgets: init third_party
        @@ls -l ${WIDGETS_DIR} | grep '^d' | awk '{print $$NF;}' | \
            while read REPLY; do \
                echo "  # Building widget $$REPLY"; \
-                if test "x${INLINE_PROTO}x" = "x1x"; then \
-                  ./tools/inline-protos.sh ${WIDGETS_DIR}/$$REPLY >> ${WIDGETS_DIR}/$$REPLY/js/$$REPLY.js.compiled; \
-                  cat ${WIDGETS_DIR}/$$REPLY/js/$$REPLY.js.compiled >> ${FW_JS}; \
-                else \
-                 for f in `find ${WIDGETS_DIR}/$$REPLY -iname 'js/*.js' | sort`; do \
-                     echo "            $$f"; \
-                     cat $$f >> ${FW_JS}; \
-                 done; \
-                fi; \
+                       if test ${JSLINT_LEVEL} -ge 1; then \
+                               for FNAME in ${WIDGETS_DIR}/$$REPLY/js/*.js; do \
+                                       ${JSLINT} $$FNAME; \
+                                       if test ${JSLINT_LEVEL} -ge 2 -a $$? -ne 0; then \
+                                               exit 1; \
+                                       fi; \
+                               done; \
+                       fi; \
+                       if test "x${INLINE_PROTO}x" = "x1x"; then \
+                               ./tools/inline-protos.sh ${WIDGETS_DIR}/$$REPLY >> ${WIDGETS_DIR}/$$REPLY/js/$$REPLY.js.compiled; \
+                               cat ${WIDGETS_DIR}/$$REPLY/js/$$REPLY.js.compiled >> ${FW_JS}; \
+                       else \
+                               for f in `find ${WIDGETS_DIR}/$$REPLY -iname 'js/*.js' | sort`; do \
+                                       echo "          $$f"; \
+                                       cat $$f >> ${FW_JS}; \
+                               done; \
+            fi; \
                for f in `find ${WIDGETS_DIR}/$$REPLY -iname '*.js.theme' | sort`; do \
                    echo "              $$f"; \
                    cat $$f >> ${FW_JS_THEME}; \
@@ -279,4 +285,5 @@ init: clean
        @@mkdir -p ${CSS_OUTPUT_ROOT}
        @@mkdir -p ${CSS_IMAGES_OUTPUT_DIR}
        @@mkdir -p ${PROTOTYPE_HTML_OUTPUT_DIR}
+       @@test -h ${LATEST_ROOT} || ln -s ${FRAMEWORK_ROOT} ${LATEST_ROOT}
        @@rm -f docs/*.html
index 64e1a7a..31dc7c0 100644 (file)
@@ -12,3 +12,13 @@ Tizen Web UI Framework includes following tools used on build;
                * Add relative lib directory to work with UglifyJS libs (build-tools/bin/uglifyjs)
                * Change lib directory structure: lib/ to lib/uglifyjs/ (build-tools/bin/uglifyjs, build-tools/lib/uglify-js)
        * License: BSD License (build-tools/lib/uglifyjs/LICENSE)
+
+* node-jslint (http://github.com/reid/node-jslint)
+       * Version: 3/2/2012 Update (node-jslint: 0.1.6)
+       * Description: The JavaScript Code Quality Tool for Node.js
+       * Mods
+               * Change lib directory structure: lib/ to lib/jslint/ (build-tools/bin/jslint, build-tools/lib/jslint)
+       * License
+               * node-jslint: BSD License (build-tools/lib/jslint/LICENSE)
+               * jslint: Customized MIT License (build-tools/lib/jslint/jslint.js)
+               * nopt, abbrev: MIT License (build-tools/lib/jslint/nopt/LICENSE)
diff --git a/build-tools/bin/jslint b/build-tools/bin/jslint
new file mode 100755 (executable)
index 0000000..13aec28
--- /dev/null
@@ -0,0 +1,99 @@
+#!/usr/bin/env node
+/* original
+var linter = require("../lib/linter");
+var reporter = require("../lib/reporter");
+var nopt = require("nopt");
+var fs = require("fs");
+*/
+var linter = require("../lib/jslint/linter"),
+       reporter = require("../lib/jslint/reporter"),
+       nopt = require("../lib/jslint/nopt/nopt"),
+       fs = require("fs");
+
+function commandOptions() {
+    'use strict';
+    var flags = [
+            'anon', 'bitwise', 'browser', 'cap', 'continue', 'css',
+            'debug', 'devel', 'eqeq', 'es5', 'evil', 'forin', 'fragment',
+            'newcap', 'node', 'nomen', 'on', 'passfail', 'plusplus',
+            'properties', 'regexp', 'rhino', 'undef', 'unparam',
+            'sloppy', 'sub', 'vars', 'white', 'widget', 'windows',
+            'json', 'color', 'jqmspace'
+        ],
+        commandOpts = {
+            'indent' : Number,
+            'maxerr' : Number,
+            'maxlen' : Number,
+            'predef' : [String, Array]
+        };
+
+    flags.forEach(function (option) {
+        commandOpts[option] = Boolean;
+    });
+
+    return commandOpts;
+}
+
+var options = commandOptions();
+
+var parsed = nopt(options);
+
+function die(why) {
+    'use strict';
+    console.warn(why);
+    console.warn("Usage: " + process.argv[1] +
+        " [--" + Object.keys(options).join("] [--") +
+        "] [--] <scriptfile>...");
+    process.exit(1);
+}
+
+if (!parsed.argv.remain.length) {
+    die("No files specified.");
+}
+
+
+// If there are no more files to be processed, exit with the value 1
+// if any of the files contains any lint.
+var maybeExit = (function () {
+    'use strict';
+    var filesLeft = parsed.argv.remain.length,
+        ok = true;
+
+    return function (lint) {
+        filesLeft -= 1;
+        ok = lint.ok && ok;
+
+        if (filesLeft === 0) {
+            // This was the last file.
+            process.exit(ok ? 0 : 1);
+        }
+    };
+}());
+
+
+function lintFile(file) {
+    'use strict';
+    fs.readFile(file, function (err, data) {
+        if (err) {
+            throw err;
+        }
+
+        // Fix UTF8 with BOM
+        if (0xEF === data[0] && 0xBB === data[1] && 0xBF === data[2]) {
+            data = data.slice(3);
+        }
+
+        data = data.toString("utf8");
+        var lint = linter.lint(data, parsed);
+
+        if (parsed.json) {
+            console.log(JSON.stringify([file, lint.errors]));
+        } else {
+            reporter.report(file, lint, parsed.color);
+        }
+
+        maybeExit(lint);
+    });
+}
+
+parsed.argv.remain.forEach(lintFile);
diff --git a/build-tools/lib/jslint/LICENSE b/build-tools/lib/jslint/LICENSE
new file mode 100644 (file)
index 0000000..6132b5d
--- /dev/null
@@ -0,0 +1,39 @@
+Copyright 2011 Yahoo! Inc.
+All rights reserved.
+
+Redistribution and use of this software 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 Yahoo! Inc. nor the names of its
+  contributors may be used to endorse or promote products
+  derived from this software without specific prior
+  written permission of Yahoo! Inc.
+
+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.
+
+===
+
+This license applies to everything except JSLint.
+JSLint, located at lib/jslint.js, is copyright Douglas Crockford.
+JSLint is provided under a customized MIT license, which is
+included in the header of jslint.js.
diff --git a/build-tools/lib/jslint/abbrev.js b/build-tools/lib/jslint/abbrev.js
new file mode 100644 (file)
index 0000000..037de2d
--- /dev/null
@@ -0,0 +1,106 @@
+
+module.exports = exports = abbrev.abbrev = abbrev
+
+abbrev.monkeyPatch = monkeyPatch
+
+function monkeyPatch () {
+  Array.prototype.abbrev = function () { return abbrev(this) }
+  Object.prototype.abbrev = function () { return abbrev(Object.keys(this)) }
+}
+
+function abbrev (list) {
+  if (arguments.length !== 1 || !Array.isArray(list)) {
+    list = Array.prototype.slice.call(arguments, 0)
+  }
+  for (var i = 0, l = list.length, args = [] ; i < l ; i ++) {
+    args[i] = typeof list[i] === "string" ? list[i] : String(list[i])
+  }
+
+  // sort them lexicographically, so that they're next to their nearest kin
+  args = args.sort(lexSort)
+
+  // walk through each, seeing how much it has in common with the next and previous
+  var abbrevs = {}
+    , prev = ""
+  for (var i = 0, l = args.length ; i < l ; i ++) {
+    var current = args[i]
+      , next = args[i + 1] || ""
+      , nextMatches = true
+      , prevMatches = true
+    if (current === next) continue
+    for (var j = 0, cl = current.length ; j < cl ; j ++) {
+      var curChar = current.charAt(j)
+      nextMatches = nextMatches && curChar === next.charAt(j)
+      prevMatches = prevMatches && curChar === prev.charAt(j)
+      if (nextMatches || prevMatches) continue
+      else {
+        j ++
+        break
+      }
+    }
+    prev = current
+    if (j === cl) {
+      abbrevs[current] = current
+      continue
+    }
+    for (var a = current.substr(0, j) ; j <= cl ; j ++) {
+      abbrevs[a] = current
+      a += current.charAt(j)
+    }
+  }
+  return abbrevs
+}
+
+function lexSort (a, b) {
+  return a === b ? 0 : a > b ? 1 : -1
+}
+
+
+// tests
+if (module === require.main) {
+
+var assert = require("assert")
+  , sys
+sys = require("util")
+
+console.log("running tests")
+function test (list, expect) {
+  var actual = abbrev(list)
+  assert.deepEqual(actual, expect,
+    "abbrev("+sys.inspect(list)+") === " + sys.inspect(expect) + "\n"+
+    "actual: "+sys.inspect(actual))
+  actual = abbrev.apply(exports, list)
+  assert.deepEqual(abbrev.apply(exports, list), expect,
+    "abbrev("+list.map(JSON.stringify).join(",")+") === " + sys.inspect(expect) + "\n"+
+    "actual: "+sys.inspect(actual))
+}
+
+test([ "ruby", "ruby", "rules", "rules", "rules" ],
+{ rub: 'ruby'
+, ruby: 'ruby'
+, rul: 'rules'
+, rule: 'rules'
+, rules: 'rules'
+})
+test(["fool", "foom", "pool", "pope"],
+{ fool: 'fool'
+, foom: 'foom'
+, poo: 'pool'
+, pool: 'pool'
+, pop: 'pope'
+, pope: 'pope'
+})
+test(["a", "ab", "abc", "abcd", "abcde", "acde"],
+{ a: 'a'
+, ab: 'ab'
+, abc: 'abc'
+, abcd: 'abcd'
+, abcde: 'abcde'
+, ac: 'acde'
+, acd: 'acde'
+, acde: 'acde'
+})
+
+console.log("pass")
+
+}
diff --git a/build-tools/lib/jslint/color.js b/build-tools/lib/jslint/color.js
new file mode 100644 (file)
index 0000000..c226459
--- /dev/null
@@ -0,0 +1,20 @@
+function color(code, string) {
+    'use strict';
+    return "\x1b[" + code + "m" + string + "\x1b[0m";
+}
+
+function factory(code) {
+    'use strict';
+    return function (string) {
+        return color(code, string);
+    };
+}
+
+module.exports = {
+    bold : factory(1),
+    red : factory(31),
+    green : factory(32),
+    yellow : factory(33),
+    blue : factory(34),
+    grey : factory(90)
+};
diff --git a/build-tools/lib/jslint/jslint.js b/build-tools/lib/jslint/jslint.js
new file mode 100644 (file)
index 0000000..ab26bc8
--- /dev/null
@@ -0,0 +1,6402 @@
+// jslint.js
+// 2012-03-02
+
+// Copyright (c) 2002 Douglas Crockford  (www.JSLint.com)
+
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+
+// The Software shall be used for Good, not Evil.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+// SOFTWARE.
+
+// WARNING: JSLint will hurt your feelings.
+
+// JSLINT is a global function. It takes two parameters.
+
+//     var myResult = JSLINT(source, option);
+
+// The first parameter is either a string or an array of strings. If it is a
+// string, it will be split on '\n' or '\r'. If it is an array of strings, it
+// is assumed that each string represents one line. The source can be a
+// JavaScript text, or HTML text, or a JSON text, or a CSS text.
+
+// The second parameter is an optional object of options that control the
+// operation of JSLINT. Most of the options are booleans: They are all
+// optional and have a default value of false. One of the options, predef,
+// can be an array of names, which will be used to declare global variables,
+// or an object whose keys are used as global names, with a boolean value
+// that determines if they are assignable.
+
+// If it checks out, JSLINT returns true. Otherwise, it returns false.
+
+// If false, you can inspect JSLINT.errors to find out the problems.
+// JSLINT.errors is an array of objects containing these properties:
+
+//  {
+//      line      : The line (relative to 0) at which the lint was found
+//      character : The character (relative to 0) at which the lint was found
+//      reason    : The problem
+//      evidence  : The text line in which the problem occurred
+//      raw       : The raw message before the details were inserted
+//      a         : The first detail
+//      b         : The second detail
+//      c         : The third detail
+//      d         : The fourth detail
+//  }
+
+// If a stopping error was found, a null will be the last element of the
+// JSLINT.errors array. A stopping error means that JSLint was not confident
+// enough to continue. It does not necessarily mean that the error was
+// especially heinous.
+
+// You can request a Function Report, which shows all of the functions
+// and the parameters and vars that they use. This can be used to find
+// implied global variables and other problems. The report is in HTML and
+// can be inserted in an HTML <body>.
+
+//     var myReport = JSLINT.report(errors_only);
+
+// If errors_only is true, then the report will be limited to only errors.
+
+// You can request a data structure that contains JSLint's results.
+
+//     var myData = JSLINT.data();
+
+// It returns a structure with this form:
+
+//     {
+//         errors: [
+//             {
+//                 line: NUMBER,
+//                 character: NUMBER,
+//                 reason: STRING,
+//                 evidence: STRING
+//             }
+//         ],
+//         functions: [
+//             {
+//                 name: STRING,
+//                 line: NUMBER,
+//                 last: NUMBER,
+//                 params: [
+//                     {
+//                         string: STRING
+//                     }
+//                 ],
+//                 closure: [
+//                     STRING
+//                 ],
+//                 var: [
+//                     STRING
+//                 ],
+//                 exception: [
+//                     STRING
+//                 ],
+//                 outer: [
+//                     STRING
+//                 ],
+//                 unused: [
+//                     STRING
+//                 ],
+//                 undef: [
+//                     STRING
+//                 ],
+//                 global: [
+//                     STRING
+//                 ],
+//                 label: [
+//                     STRING
+//                 ]
+//             }
+//         ],
+//         globals: [
+//             STRING
+//         ],
+//         member: {
+//             STRING: NUMBER
+//         },
+//         urls: [
+//             STRING
+//         ],
+//         json: BOOLEAN
+//     }
+
+// Empty arrays will not be included.
+
+// You can obtain the parse tree that JSLint constructed while parsing. The
+// latest tree is kept in JSLINT.tree. A nice stringication can be produced
+// with
+
+//     JSON.stringify(JSLINT.tree, [
+//         'string',  'arity', 'name',  'first',
+//         'second', 'third', 'block', 'else'
+//     ], 4));
+
+// JSLint provides three directives. They look like slashstar comments, and
+// allow for setting options, declaring global variables, and establishing a
+// set of allowed property names.
+
+// These directives respect function scope.
+
+// The jslint directive is a special comment that can set one or more options.
+// The current option set is
+
+//     anon       true, if the space may be omitted in anonymous function declarations
+//     bitwise    true, if bitwise operators should be allowed
+//     browser    true, if the standard browser globals should be predefined
+//     cap        true, if upper case HTML should be allowed
+//     'continue' true, if the continuation statement should be tolerated
+//     css        true, if CSS workarounds should be tolerated
+//     debug      true, if debugger statements should be allowed
+//     devel      true, if logging should be allowed (console, alert, etc.)
+//     eqeq       true, if == should be allowed
+//     es5        true, if ES5 syntax should be allowed
+//     evil       true, if eval should be allowed
+//     forin      true, if for in statements need not filter
+//     fragment   true, if HTML fragments should be allowed
+//     indent     the indentation factor
+//     maxerr     the maximum number of errors to allow
+//     maxlen     the maximum length of a source line
+//     newcap     true, if constructor names capitalization is ignored
+//     node       true, if Node.js globals should be predefined
+//     nomen      true, if names may have dangling _
+//     on         true, if HTML event handlers should be allowed
+//     passfail   true, if the scan should stop on first error
+//     plusplus   true, if increment/decrement should be allowed
+//     properties true, if all property names must be declared with /*properties*/
+//     regexp     true, if the . should be allowed in regexp literals
+//     rhino      true, if the Rhino environment globals should be predefined
+//     undef      true, if variables can be declared out of order
+//     unparam    true, if unused parameters should be tolerated
+//     sloppy     true, if the 'use strict'; pragma is optional
+//     sub        true, if all forms of subscript notation are tolerated
+//     vars       true, if multiple var statements per function should be allowed
+//     white      true, if sloppy whitespace is tolerated
+//     widget     true  if the Yahoo Widgets globals should be predefined
+//     windows    true, if MS Windows-specific globals should be predefined
+
+// For example:
+
+/*jslint
+    evil: true, nomen: true, regexp: true
+*/
+
+// The properties directive declares an exclusive list of property names.
+// Any properties named in the program that are not in the list will
+// produce a warning.
+
+// For example:
+
+/*properties
+    '\b', '\t', '\n', '\f', '\r', '!=', '!==', '"', '%', '\'', '(arguments)',
+    '(begin)', '(breakage)', '(context)', '(error)', '(identifier)', '(line)',
+    '(loopage)', '(name)', '(params)', '(scope)', '(token)', '(vars)', '(verb)',
+    '*', '+', '-', '/', '<', '<=', '==', '===', '>', '>=', ADSAFE,
+    Array, Date, Function, Object, '\\', a, a_label, a_not_allowed,
+    a_not_defined, a_scope, abbr, acronym, address, adsafe, adsafe_a,
+    adsafe_autocomplete, adsafe_bad_id, adsafe_div, adsafe_fragment, adsafe_go,
+    adsafe_html, adsafe_id, adsafe_id_go, adsafe_lib, adsafe_lib_second,
+    adsafe_missing_id, adsafe_name_a, adsafe_placement, adsafe_prefix_a,
+    adsafe_script, adsafe_source, adsafe_subscript_a, adsafe_tag, all,
+    already_defined, and, anon, applet, apply, approved, area, arity, article,
+    aside, assign, assign_exception, assignment_function_expression, at,
+    attribute_case_a, audio, autocomplete, avoid_a, b, background,
+    'background-attachment', 'background-color', 'background-image',
+    'background-position', 'background-repeat', bad_assignment, bad_color_a,
+    bad_constructor, bad_entity, bad_html, bad_id_a, bad_in_a, bad_invocation,
+    bad_name_a, bad_new, bad_number, bad_operand, bad_style, bad_type, bad_url_a,
+    bad_wrap, base, bdo, big, bitwise, block, blockquote, body, border,
+    'border-bottom', 'border-bottom-color', 'border-bottom-left-radius',
+    'border-bottom-right-radius', 'border-bottom-style', 'border-bottom-width',
+    'border-collapse', 'border-color', 'border-left', 'border-left-color',
+    'border-left-style', 'border-left-width', 'border-radius', 'border-right',
+    'border-right-color', 'border-right-style', 'border-right-width',
+    'border-spacing', 'border-style', 'border-top', 'border-top-color',
+    'border-top-left-radius', 'border-top-right-radius', 'border-top-style',
+    'border-top-width', 'border-width', bottom, br, braille, browser, button, c,
+    call, canvas, cap, caption, 'caption-side', center, charAt, charCodeAt,
+    character, cite, clear, clip, closure, cm, code, col, colgroup, color,
+    combine_var, command, conditional_assignment, confusing_a, confusing_regexp,
+    constructor_name_a, content, continue, control_a, 'counter-increment',
+    'counter-reset', create, css, cursor, d, dangerous_comment, dangling_a, data,
+    datalist, dd, debug, del, deleted, details, devel, dfn, dialog, dir,
+    direction, display, disrupt, div, dl, dt, duplicate_a, edge, edition, else,
+    em, embed, embossed, empty, 'empty-cells', empty_block, empty_case,
+    empty_class, entityify, eqeq, errors, es5, eval, evidence, evil, ex,
+    exception, exec, expected_a, expected_a_at_b_c, expected_a_b,
+    expected_a_b_from_c_d, expected_at_a, expected_attribute_a,
+    expected_attribute_value_a, expected_class_a, expected_fraction_a,
+    expected_id_a, expected_identifier_a, expected_identifier_a_reserved,
+    expected_lang_a, expected_linear_a, expected_media_a, expected_name_a,
+    expected_nonstandard_style_attribute, expected_number_a, expected_operator_a,
+    expected_percent_a, expected_positive_a, expected_pseudo_a,
+    expected_selector_a, expected_small_a, expected_space_a_b, expected_string_a,
+    expected_style_attribute, expected_style_pattern, expected_tagname_a,
+    expected_type_a, f, fieldset, figure, filter, first, flag, float, floor,
+    font, 'font-family', 'font-size', 'font-size-adjust', 'font-stretch',
+    'font-style', 'font-variant', 'font-weight', footer, forEach, for_if, forin,
+    form, fragment, frame, frameset, from, fromCharCode, fud, funct, function,
+    function_block, function_eval, function_loop, function_statement,
+    function_strict, functions, global, globals, h1, h2, h3, h4, h5, h6,
+    handheld, hasOwnProperty, head, header, height, hgroup, hr,
+    'hta:application', html, html_confusion_a, html_handlers, i, id, identifier,
+    identifier_function, iframe, img, immed, implied_evil, in, indent, indexOf,
+    infix_in, init, input, ins, insecure_a, isAlpha, isArray, isDigit, isNaN,
+    join, jslint, json, kbd, keygen, keys, label, label_a_b, labeled, lang, lbp,
+    leading_decimal_a, led, left, legend, length, 'letter-spacing', li, lib,
+    line, 'line-height', link, 'list-style', 'list-style-image',
+    'list-style-position', 'list-style-type', map, margin, 'margin-bottom',
+    'margin-left', 'margin-right', 'margin-top', mark, 'marker-offset', match,
+    'max-height', 'max-width', maxerr, maxlen, member, menu, message, meta,
+    meter, 'min-height', 'min-width', missing_a, missing_a_after_b,
+    missing_option, missing_property, missing_space_a_b, missing_url,
+    missing_use_strict, mixed, mm, mode, move_invocation, move_var, n, name,
+    name_function, nav, nested_comment, newcap, node, noframes, nomen, noscript,
+    not, not_a_constructor, not_a_defined, not_a_function, not_a_label,
+    not_a_scope, not_greater, nud, number, object, octal_a, ol, on, opacity,
+    open, optgroup, option, outer, outline, 'outline-color', 'outline-style',
+    'outline-width', output, overflow, 'overflow-x', 'overflow-y', p, padding,
+    'padding-bottom', 'padding-left', 'padding-right', 'padding-top',
+    'page-break-after', 'page-break-before', param, parameter_a_get_b,
+    parameter_arguments_a, parameter_set_a, params, paren, parent, passfail, pc,
+    plusplus, pop, position, postscript, pre, predef, print, progress,
+    projection, properties, prototype, pt, push, px, q, quote, quotes, r, radix,
+    range, raw, read_only, reason, redefinition_a, regexp, replace, report,
+    reserved, reserved_a, rhino, right, rp, rt, ruby, safe, samp, scanned_a_b,
+    screen, script, search, second, section, select, shift, slash_equal, slice,
+    sloppy, small, sort, source, span, speech, split, src, statement_block,
+    stopping, strange_loop, strict, string, strong, style, styleproperty, sub,
+    subscript, substr, sup, supplant, t, table, 'table-layout', tag_a_in_b,
+    tbody, td, test, 'text-align', 'text-decoration', 'text-indent',
+    'text-shadow', 'text-transform', textarea, tfoot, th, thead, third, thru,
+    time, title, toLowerCase, toString, toUpperCase, token, too_long, too_many,
+    top, tr, trailing_decimal_a, tree, tt, tty, tv, type, u, ul, unclosed,
+    unclosed_comment, unclosed_regexp, undef, undefined, unescaped_a,
+    unexpected_a, unexpected_char_a_b, unexpected_comment, unexpected_else,
+    unexpected_property_a, unexpected_space_a_b, 'unicode-bidi',
+    unnecessary_initialize, unnecessary_use, unparam, unreachable_a_b,
+    unrecognized_style_attribute_a, unrecognized_tag_a, unsafe, unused, url,
+    urls, use_array, use_braces, use_charAt, use_object, use_or, use_param,
+    used_before_a, var, var_a_not, vars, 'vertical-align', video, visibility,
+    was, weird_assignment, weird_condition, weird_new, weird_program,
+    weird_relation, weird_ternary, white, 'white-space', widget, width, windows,
+    'word-spacing', 'word-wrap', wrap, wrap_immediate, wrap_regexp,
+    write_is_wrong, writeable, 'z-index'
+*/
+
+// The global directive is used to declare global variables that can
+// be accessed by the program. If a declaration is true, then the variable
+// is writeable. Otherwise, it is read-only.
+
+// We build the application inside a function so that we produce only a single
+// global variable. That function will be invoked immediately, and its return
+// value is the JSLINT function itself. That function is also an object that
+// can contain data and other functions.
+
+var JSLINT = (function () {
+    'use strict';
+
+    function array_to_object(array, value) {
+
+// Make an object from an array of keys and a common value.
+
+        var i, length = array.length, object = {};
+        for (i = 0; i < length; i += 1) {
+            object[array[i]] = value;
+        }
+        return object;
+    }
+
+
+    var adsafe_id,      // The widget's ADsafe id.
+        adsafe_may,     // The widget may load approved scripts.
+        adsafe_top,     // At the top of the widget script.
+        adsafe_went,    // ADSAFE.go has been called.
+        allowed_option = {
+            anon      : true,
+            bitwise   : true,
+            browser   : true,
+            cap       : true,
+            'continue': true,
+            css       : true,
+            debug     : true,
+            devel     : true,
+            eqeq      : true,
+            es5       : true,
+            evil      : true,
+            forin     : true,
+            fragment  : true,
+            indent    :   10,
+            maxerr    : 1000,
+            maxlen    :  256,
+            newcap    : true,
+            node      : true,
+            nomen     : true,
+            on        : true,
+            passfail  : true,
+            plusplus  : true,
+            properties: true,
+            regexp    : true,
+            rhino     : true,
+            undef     : true,
+            unparam   : true,
+            sloppy    : true,
+            sub       : true,
+            vars      : true,
+            white     : true,
+            jqmspace  : true,
+            widget    : true,
+            windows   : true
+        },
+        anonname,       // The guessed name for anonymous functions.
+        approved,       // ADsafe approved urls.
+
+// These are operators that should not be used with the ! operator.
+
+        bang = {
+            '<'  : true,
+            '<=' : true,
+            '==' : true,
+            '===': true,
+            '!==': true,
+            '!=' : true,
+            '>'  : true,
+            '>=' : true,
+            '+'  : true,
+            '-'  : true,
+            '*'  : true,
+            '/'  : true,
+            '%'  : true
+        },
+
+// These are property names that should not be permitted in the safe subset.
+
+        banned = array_to_object([
+            'arguments', 'callee', 'caller', 'constructor', 'eval', 'prototype',
+            'stack', 'unwatch', 'valueOf', 'watch'
+        ], true),
+        begin,          // The root token
+
+// browser contains a set of global names that are commonly provided by a
+// web browser environment.
+
+        browser = array_to_object([
+            'clearInterval', 'clearTimeout', 'document', 'event', 'frames',
+            'history', 'Image', 'localStorage', 'location', 'name', 'navigator',
+            'Option', 'parent', 'screen', 'sessionStorage', 'setInterval',
+            'setTimeout', 'Storage', 'window', 'XMLHttpRequest'
+        ], false),
+
+// bundle contains the text messages.
+
+        bundle = {
+            a_label: "'{a}' is a statement label.",
+            a_not_allowed: "'{a}' is not allowed.",
+            a_not_defined: "'{a}' is not defined.",
+            a_scope: "'{a}' used out of scope.",
+            adsafe_a: "ADsafe violation: '{a}'.",
+            adsafe_autocomplete: "ADsafe autocomplete violation.",
+            adsafe_bad_id: "ADSAFE violation: bad id.",
+            adsafe_div: "ADsafe violation: Wrap the widget in a div.",
+            adsafe_fragment: "ADSAFE: Use the fragment option.",
+            adsafe_go: "ADsafe violation: Misformed ADSAFE.go.",
+            adsafe_html: "Currently, ADsafe does not operate on whole HTML " +
+                "documents. It operates on <div> fragments and .js files.",
+            adsafe_id: "ADsafe violation: id does not match.",
+            adsafe_id_go: "ADsafe violation: Missing ADSAFE.id or ADSAFE.go.",
+            adsafe_lib: "ADsafe lib violation.",
+            adsafe_lib_second: "ADsafe: The second argument to lib must be a function.",
+            adsafe_missing_id: "ADSAFE violation: missing ID_.",
+            adsafe_name_a: "ADsafe name violation: '{a}'.",
+            adsafe_placement: "ADsafe script placement violation.",
+            adsafe_prefix_a: "ADsafe violation: An id must have a '{a}' prefix",
+            adsafe_script: "ADsafe script violation.",
+            adsafe_source: "ADsafe unapproved script source.",
+            adsafe_subscript_a: "ADsafe subscript '{a}'.",
+            adsafe_tag: "ADsafe violation: Disallowed tag '{a}'.",
+            already_defined: "'{a}' is already defined.",
+            and: "The '&&' subexpression should be wrapped in parens.",
+            assign_exception: "Do not assign to the exception parameter.",
+            assignment_function_expression: "Expected an assignment or " +
+                "function call and instead saw an expression.",
+            attribute_case_a: "Attribute '{a}' not all lower case.",
+            avoid_a: "Avoid '{a}'.",
+            bad_assignment: "Bad assignment.",
+            bad_color_a: "Bad hex color '{a}'.",
+            bad_constructor: "Bad constructor.",
+            bad_entity: "Bad entity.",
+            bad_html: "Bad HTML string",
+            bad_id_a: "Bad id: '{a}'.",
+            bad_in_a: "Bad for in variable '{a}'.",
+            bad_invocation: "Bad invocation.",
+            bad_name_a: "Bad name: '{a}'.",
+            bad_new: "Do not use 'new' for side effects.",
+            bad_number: "Bad number '{a}'.",
+            bad_operand: "Bad operand.",
+            bad_style: "Bad style.",
+            bad_type: "Bad type.",
+            bad_url_a: "Bad url '{a}'.",
+            bad_wrap: "Do not wrap function literals in parens unless they " +
+                "are to be immediately invoked.",
+            combine_var: "Combine this with the previous 'var' statement.",
+            conditional_assignment: "Expected a conditional expression and " +
+                "instead saw an assignment.",
+            confusing_a: "Confusing use of '{a}'.",
+            confusing_regexp: "Confusing regular expression.",
+            constructor_name_a: "A constructor name '{a}' should start with " +
+                "an uppercase letter.",
+            control_a: "Unexpected control character '{a}'.",
+            css: "A css file should begin with @charset 'UTF-8';",
+            dangling_a: "Unexpected dangling '_' in '{a}'.",
+            dangerous_comment: "Dangerous comment.",
+            deleted: "Only properties should be deleted.",
+            duplicate_a: "Duplicate '{a}'.",
+            empty_block: "Empty block.",
+            empty_case: "Empty case.",
+            empty_class: "Empty class.",
+            es5: "This is an ES5 feature.",
+            evil: "eval is evil.",
+            expected_a: "Expected '{a}'.",
+            expected_a_b: "Expected '{a}' and instead saw '{b}'.",
+            expected_a_b_from_c_d: "Expected '{a}' to match '{b}' from line " +
+                "{c} and instead saw '{d}'.",
+            expected_at_a: "Expected an at-rule, and instead saw @{a}.",
+            expected_a_at_b_c: "Expected '{a}' at column {b}, not column {c}.",
+            expected_attribute_a: "Expected an attribute, and instead saw [{a}].",
+            expected_attribute_value_a: "Expected an attribute value and " +
+                "instead saw '{a}'.",
+            expected_class_a: "Expected a class, and instead saw .{a}.",
+            expected_fraction_a: "Expected a number between 0 and 1 and " +
+                "instead saw '{a}'",
+            expected_id_a: "Expected an id, and instead saw #{a}.",
+            expected_identifier_a: "Expected an identifier and instead saw '{a}'.",
+            expected_identifier_a_reserved: "Expected an identifier and " +
+                "instead saw '{a}' (a reserved word).",
+            expected_linear_a: "Expected a linear unit and instead saw '{a}'.",
+            expected_lang_a: "Expected a lang code, and instead saw :{a}.",
+            expected_media_a: "Expected a CSS media type, and instead saw '{a}'.",
+            expected_name_a: "Expected a name and instead saw '{a}'.",
+            expected_nonstandard_style_attribute: "Expected a non-standard " +
+                "style attribute and instead saw '{a}'.",
+            expected_number_a: "Expected a number and instead saw '{a}'.",
+            expected_operator_a: "Expected an operator and instead saw '{a}'.",
+            expected_percent_a: "Expected a percentage and instead saw '{a}'",
+            expected_positive_a: "Expected a positive number and instead saw '{a}'",
+            expected_pseudo_a: "Expected a pseudo, and instead saw :{a}.",
+            expected_selector_a: "Expected a CSS selector, and instead saw {a}.",
+            expected_small_a: "Expected a small positive integer and instead saw '{a}'",
+            expected_space_a_b: "Expected exactly one space between '{a}' and '{b}'.",
+            expected_string_a: "Expected a string and instead saw {a}.",
+            expected_style_attribute: "Excepted a style attribute, and instead saw '{a}'.",
+            expected_style_pattern: "Expected a style pattern, and instead saw '{a}'.",
+            expected_tagname_a: "Expected a tagName, and instead saw {a}.",
+            expected_type_a: "Expected a type, and instead saw {a}.",
+            for_if: "The body of a for in should be wrapped in an if " +
+                "statement to filter unwanted properties from the prototype.",
+            function_block: "Function statements should not be placed in blocks. " +
+                "Use a function expression or move the statement to the top of " +
+                "the outer function.",
+            function_eval: "The Function constructor is eval.",
+            function_loop: "Don't make functions within a loop.",
+            function_statement: "Function statements are not invocable. " +
+                "Wrap the whole function invocation in parens.",
+            function_strict: "Use the function form of 'use strict'.",
+            html_confusion_a: "HTML confusion in regular expression '<{a}'.",
+            html_handlers: "Avoid HTML event handlers.",
+            identifier_function: "Expected an identifier in an assignment " +
+                "and instead saw a function invocation.",
+            implied_evil: "Implied eval is evil. Pass a function instead of a string.",
+            infix_in: "Unexpected 'in'. Compare with undefined, or use the " +
+                "hasOwnProperty method instead.",
+            insecure_a: "Insecure '{a}'.",
+            isNaN: "Use the isNaN function to compare with NaN.",
+            label_a_b: "Label '{a}' on '{b}' statement.",
+            lang: "lang is deprecated.",
+            leading_decimal_a: "A leading decimal point can be confused with a dot: '.{a}'.",
+            missing_a: "Missing '{a}'.",
+            missing_a_after_b: "Missing '{a}' after '{b}'.",
+            missing_option: "Missing option value.",
+            missing_property: "Missing property name.",
+            missing_space_a_b: "Missing space between '{a}' and '{b}'.",
+            missing_url: "Missing url.",
+            missing_use_strict: "Missing 'use strict' statement.",
+            mixed: "Mixed spaces and tabs.",
+            move_invocation: "Move the invocation into the parens that " +
+                "contain the function.",
+            move_var: "Move 'var' declarations to the top of the function.",
+            name_function: "Missing name in function statement.",
+            nested_comment: "Nested comment.",
+            not: "Nested not.",
+            not_a_constructor: "Do not use {a} as a constructor.",
+            not_a_defined: "'{a}' has not been fully defined yet.",
+            not_a_function: "'{a}' is not a function.",
+            not_a_label: "'{a}' is not a label.",
+            not_a_scope: "'{a}' is out of scope.",
+            not_greater: "'{a}' should not be greater than '{b}'.",
+            octal_a: "Don't use octal: '{a}'. Use '\\u....' instead.",
+            parameter_arguments_a: "Do not mutate parameter '{a}' when using 'arguments'.",
+            parameter_a_get_b: "Unexpected parameter '{a}' in get {b} function.",
+            parameter_set_a: "Expected parameter (value) in set {a} function.",
+            radix: "Missing radix parameter.",
+            read_only: "Read only.",
+            redefinition_a: "Redefinition of '{a}'.",
+            reserved_a: "Reserved name '{a}'.",
+            scanned_a_b: "{a} ({b}% scanned).",
+            slash_equal: "A regular expression literal can be confused with '/='.",
+            statement_block: "Expected to see a statement and instead saw a block.",
+            stopping: "Stopping. ",
+            strange_loop: "Strange loop.",
+            strict: "Strict violation.",
+            subscript: "['{a}'] is better written in dot notation.",
+            tag_a_in_b: "A '<{a}>' must be within '<{b}>'.",
+            too_long: "Line too long.",
+            too_many: "Too many errors.",
+            trailing_decimal_a: "A trailing decimal point can be confused " +
+                "with a dot: '.{a}'.",
+            type: "type is unnecessary.",
+            unclosed: "Unclosed string.",
+            unclosed_comment: "Unclosed comment.",
+            unclosed_regexp: "Unclosed regular expression.",
+            unescaped_a: "Unescaped '{a}'.",
+            unexpected_a: "Unexpected '{a}'.",
+            unexpected_char_a_b: "Unexpected character '{a}' in {b}.",
+            unexpected_comment: "Unexpected comment.",
+            unexpected_else: "Unexpected 'else' after 'return'.",
+            unexpected_property_a: "Unexpected /*property*/ '{a}'.",
+            unexpected_space_a_b: "Unexpected space between '{a}' and '{b}'.",
+            unnecessary_initialize: "It is not necessary to initialize '{a}' " +
+                "to 'undefined'.",
+            unnecessary_use: "Unnecessary 'use strict'.",
+            unreachable_a_b: "Unreachable '{a}' after '{b}'.",
+            unrecognized_style_attribute_a: "Unrecognized style attribute '{a}'.",
+            unrecognized_tag_a: "Unrecognized tag '<{a}>'.",
+            unsafe: "Unsafe character.",
+            url: "JavaScript URL.",
+            use_array: "Use the array literal notation [].",
+            use_braces: "Spaces are hard to count. Use {{a}}.",
+            use_charAt: "Use the charAt method.",
+            use_object: "Use the object literal notation {}.",
+            use_or: "Use the || operator.",
+            use_param: "Use a named parameter.",
+            used_before_a: "'{a}' was used before it was defined.",
+            var_a_not: "Variable {a} was not declared correctly.",
+            weird_assignment: "Weird assignment.",
+            weird_condition: "Weird condition.",
+            weird_new: "Weird construction. Delete 'new'.",
+            weird_program: "Weird program.",
+            weird_relation: "Weird relation.",
+            weird_ternary: "Weird ternary.",
+            wrap_immediate: "Wrap an immediate function invocation in parentheses " +
+                "to assist the reader in understanding that the expression " +
+                "is the result of a function, and not the function itself.",
+            wrap_regexp: "Wrap the /regexp/ literal in parens to " +
+                "disambiguate the slash operator.",
+            write_is_wrong: "document.write can be a form of eval."
+        },
+        comments_off,
+        css_attribute_data,
+        css_any,
+
+        css_colorData = array_to_object([
+            "aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige",
+            "bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown",
+            "burlywood", "cadetblue", "chartreuse", "chocolate", "coral",
+            "cornflowerblue", "cornsilk", "crimson", "cyan", "darkblue",
+            "darkcyan", "darkgoldenrod", "darkgray", "darkgreen", "darkkhaki",
+            "darkmagenta", "darkolivegreen", "darkorange", "darkorchid",
+            "darkred", "darksalmon", "darkseagreen", "darkslateblue",
+            "darkslategray", "darkturquoise", "darkviolet", "deeppink",
+            "deepskyblue", "dimgray", "dodgerblue", "firebrick", "floralwhite",
+            "forestgreen", "fuchsia", "gainsboro", "ghostwhite", "gold",
+            "goldenrod", "gray", "green", "greenyellow", "honeydew", "hotpink",
+            "indianred", "indigo", "ivory", "khaki", "lavender",
+            "lavenderblush", "lawngreen", "lemonchiffon", "lightblue",
+            "lightcoral", "lightcyan", "lightgoldenrodyellow", "lightgreen",
+            "lightpink", "lightsalmon", "lightseagreen", "lightskyblue",
+            "lightslategray", "lightsteelblue", "lightyellow", "lime",
+            "limegreen", "linen", "magenta", "maroon", "mediumaquamarine",
+            "mediumblue", "mediumorchid", "mediumpurple", "mediumseagreen",
+            "mediumslateblue", "mediumspringgreen", "mediumturquoise",
+            "mediumvioletred", "midnightblue", "mintcream", "mistyrose",
+            "moccasin", "navajowhite", "navy", "oldlace", "olive", "olivedrab",
+            "orange", "orangered", "orchid", "palegoldenrod", "palegreen",
+            "paleturquoise", "palevioletred", "papayawhip", "peachpuff",
+            "peru", "pink", "plum", "powderblue", "purple", "red", "rosybrown",
+            "royalblue", "saddlebrown", "salmon", "sandybrown", "seagreen",
+            "seashell", "sienna", "silver", "skyblue", "slateblue", "slategray",
+            "snow", "springgreen", "steelblue", "tan", "teal", "thistle",
+            "tomato", "turquoise", "violet", "wheat", "white", "whitesmoke",
+            "yellow", "yellowgreen",
+
+            "activeborder", "activecaption", "appworkspace", "background",
+            "buttonface", "buttonhighlight", "buttonshadow", "buttontext",
+            "captiontext", "graytext", "highlight", "highlighttext",
+            "inactiveborder", "inactivecaption", "inactivecaptiontext",
+            "infobackground", "infotext", "menu", "menutext", "scrollbar",
+            "threeddarkshadow", "threedface", "threedhighlight",
+            "threedlightshadow", "threedshadow", "window", "windowframe",
+            "windowtext"
+        ], true),
+
+        css_border_style,
+        css_break,
+
+        css_lengthData = {
+            '%': true,
+            'cm': true,
+            'em': true,
+            'ex': true,
+            'in': true,
+            'mm': true,
+            'pc': true,
+            'pt': true,
+            'px': true
+        },
+
+        css_media,
+        css_overflow,
+
+        descapes = {
+            'b': '\b',
+            't': '\t',
+            'n': '\n',
+            'f': '\f',
+            'r': '\r',
+            '"': '"',
+            '/': '/',
+            '\\': '\\'
+        },
+
+        devel = array_to_object([
+            'alert', 'confirm', 'console', 'Debug', 'opera', 'prompt', 'WSH'
+        ], false),
+        directive,
+        escapes = {
+            '\b': '\\b',
+            '\t': '\\t',
+            '\n': '\\n',
+            '\f': '\\f',
+            '\r': '\\r',
+            '\'': '\\\'',
+            '"' : '\\"',
+            '/' : '\\/',
+            '\\': '\\\\'
+        },
+
+        funct,          // The current function, including the labels used in
+                        // the function, as well as (breakage),
+                        // (context), (loopage), (name), (params), (token),
+                        // (vars), (verb)
+
+        functionicity = [
+            'closure', 'exception', 'global', 'label', 'outer', 'undef',
+            'unused', 'var'
+        ],
+
+        functions,      // All of the functions
+        global_funct,   // The global body
+        global_scope,   // The global scope
+        html_tag = {
+            a:        {},
+            abbr:     {},
+            acronym:  {},
+            address:  {},
+            applet:   {},
+            area:     {empty: true, parent: ' map '},
+            article:  {},
+            aside:    {},
+            audio:    {},
+            b:        {},
+            base:     {empty: true, parent: ' head '},
+            bdo:      {},
+            big:      {},
+            blockquote: {},
+            body:     {parent: ' html noframes '},
+            br:       {empty: true},
+            button:   {},
+            canvas:   {parent: ' body p div th td '},
+            caption:  {parent: ' table '},
+            center:   {},
+            cite:     {},
+            code:     {},
+            col:      {empty: true, parent: ' table colgroup '},
+            colgroup: {parent: ' table '},
+            command:  {parent: ' menu '},
+            datalist: {},
+            dd:       {parent: ' dl '},
+            del:      {},
+            details:  {},
+            dialog:   {},
+            dfn:      {},
+            dir:      {},
+            div:      {},
+            dl:       {},
+            dt:       {parent: ' dl '},
+            em:       {},
+            embed:    {},
+            fieldset: {},
+            figure:   {},
+            font:     {},
+            footer:   {},
+            form:     {},
+            frame:    {empty: true, parent: ' frameset '},
+            frameset: {parent: ' html frameset '},
+            h1:       {},
+            h2:       {},
+            h3:       {},
+            h4:       {},
+            h5:       {},
+            h6:       {},
+            head:     {parent: ' html '},
+            header:   {},
+            hgroup:   {},
+            hr:       {empty: true},
+            'hta:application':
+                      {empty: true, parent: ' head '},
+            html:     {parent: '*'},
+            i:        {},
+            iframe:   {},
+            img:      {empty: true},
+            input:    {empty: true},
+            ins:      {},
+            kbd:      {},
+            keygen:   {},
+            label:    {},
+            legend:   {parent: ' details fieldset figure '},
+            li:       {parent: ' dir menu ol ul '},
+            link:     {empty: true, parent: ' head '},
+            map:      {},
+            mark:     {},
+            menu:     {},
+            meta:     {empty: true, parent: ' head noframes noscript '},
+            meter:    {},
+            nav:      {},
+            noframes: {parent: ' html body '},
+            noscript: {parent: ' body head noframes '},
+            object:   {},
+            ol:       {},
+            optgroup: {parent: ' select '},
+            option:   {parent: ' optgroup select '},
+            output:   {},
+            p:        {},
+            param:    {empty: true, parent: ' applet object '},
+            pre:      {},
+            progress: {},
+            q:        {},
+            rp:       {},
+            rt:       {},
+            ruby:     {},
+            samp:     {},
+            script:   {empty: true, parent: ' body div frame head iframe p pre span '},
+            section:  {},
+            select:   {},
+            small:    {},
+            span:     {},
+            source:   {},
+            strong:   {},
+            style:    {parent: ' head ', empty: true},
+            sub:      {},
+            sup:      {},
+            table:    {},
+            tbody:    {parent: ' table '},
+            td:       {parent: ' tr '},
+            textarea: {},
+            tfoot:    {parent: ' table '},
+            th:       {parent: ' tr '},
+            thead:    {parent: ' table '},
+            time:     {},
+            title:    {parent: ' head '},
+            tr:       {parent: ' table tbody thead tfoot '},
+            tt:       {},
+            u:        {},
+            ul:       {},
+            'var':    {},
+            video:    {}
+        },
+
+        ids,            // HTML ids
+        in_block,
+        indent,
+        itself,         // JSLint itself
+        json_mode,
+        lex,            // the tokenizer
+        lines,
+        lookahead,
+        node = array_to_object([
+            'Buffer', 'clearInterval', 'clearTimeout', 'console', 'exports',
+            'global', 'module', 'process', 'querystring', 'require',
+            'setInterval', 'setTimeout', '__dirname', '__filename'
+        ], false),
+        node_js,
+        numbery = array_to_object(['indexOf', 'lastIndexOf', 'search'], true),
+        next_token,
+        option,
+        predefined,     // Global variables defined by option
+        prereg,
+        prev_token,
+        property,
+        regexp_flag = array_to_object(['g', 'i', 'm'], true),
+        return_this = function return_this() {
+            return this;
+        },
+        rhino = array_to_object([
+            'defineClass', 'deserialize', 'gc', 'help', 'load', 'loadClass',
+            'print', 'quit', 'readFile', 'readUrl', 'runCommand', 'seal',
+            'serialize', 'spawn', 'sync', 'toint32', 'version'
+        ], false),
+
+        scope,      // An object containing an object for each variable in scope
+        semicolon_coda = array_to_object([';', '"', '\'', ')'], true),
+        src,
+        stack,
+
+// standard contains the global names that are provided by the
+// ECMAScript standard.
+
+        standard = array_to_object([
+            'Array', 'Boolean', 'Date', 'decodeURI', 'decodeURIComponent',
+            'encodeURI', 'encodeURIComponent', 'Error', 'eval', 'EvalError',
+            'Function', 'isFinite', 'isNaN', 'JSON', 'Math', 'Number',
+            'Object', 'parseInt', 'parseFloat', 'RangeError', 'ReferenceError',
+            'RegExp', 'String', 'SyntaxError', 'TypeError', 'URIError'
+        ], false),
+
+        strict_mode,
+        syntax = {},
+        tab,
+        token,
+        urls,
+        var_mode,
+        warnings,
+
+// widget contains the global names which are provided to a Yahoo
+// (fna Konfabulator) widget.
+
+        widget = array_to_object([
+            'alert', 'animator', 'appleScript', 'beep', 'bytesToUIString',
+            'Canvas', 'chooseColor', 'chooseFile', 'chooseFolder',
+            'closeWidget', 'COM', 'convertPathToHFS', 'convertPathToPlatform',
+            'CustomAnimation', 'escape', 'FadeAnimation', 'filesystem', 'Flash',
+            'focusWidget', 'form', 'FormField', 'Frame', 'HotKey', 'Image',
+            'include', 'isApplicationRunning', 'iTunes', 'konfabulatorVersion',
+            'log', 'md5', 'MenuItem', 'MoveAnimation', 'openURL', 'play',
+            'Point', 'popupMenu', 'preferenceGroups', 'preferences', 'print',
+            'prompt', 'random', 'Rectangle', 'reloadWidget', 'ResizeAnimation',
+            'resolvePath', 'resumeUpdates', 'RotateAnimation', 'runCommand',
+            'runCommandInBg', 'saveAs', 'savePreferences', 'screen',
+            'ScrollBar', 'showWidgetPreferences', 'sleep', 'speak', 'Style',
+            'suppressUpdates', 'system', 'tellWidget', 'Text', 'TextArea',
+            'Timer', 'unescape', 'updateNow', 'URL', 'Web', 'widget', 'Window',
+            'XMLDOM', 'XMLHttpRequest', 'yahooCheckLogin', 'yahooLogin',
+            'yahooLogout'
+        ], true),
+
+        windows = array_to_object([
+            'ActiveXObject', 'CScript', 'Debug', 'Enumerator', 'System',
+            'VBArray', 'WScript', 'WSH'
+        ], false),
+
+//  xmode is used to adapt to the exceptions in html parsing.
+//  It can have these states:
+//      ''      .js script file
+//      'html'
+//      'outer'
+//      'script'
+//      'style'
+//      'scriptstring'
+//      'styleproperty'
+
+        xmode,
+        xquote,
+
+// Regular expressions. Some of these are stupidly long.
+
+// unsafe comment or string
+        ax = /@cc|<\/?|script|\]\s*\]|<\s*!|&lt/i,
+// carriage return, carriage return linefeed, or linefeed
+        crlfx = /\r\n?|\n/,
+// unsafe characters that are silently deleted by one or more browsers
+        cx = /[\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/,
+// query characters for ids
+        dx = /[\[\]\/\\"'*<>.&:(){}+=#]/,
+// html token
+        hx = /^\s*(['"=>\/&#]|<(?:\/|\!(?:--)?)?|[a-zA-Z][a-zA-Z0-9_\-:]*|[0-9]+|--)/,
+// identifier
+        ix = /^([a-zA-Z_$][a-zA-Z0-9_$]*)$/,
+// javascript url
+        jx = /^(?:javascript|jscript|ecmascript|vbscript|mocha|livescript)\s*:/i,
+// star slash
+        lx = /\*\/|\/\*/,
+// characters in strings that need escapement
+        nx = /[\u0000-\u001f'\\\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
+// outer html token
+        ox = /[>&]|<[\/!]?|--/,
+// attributes characters
+        qx = /[^a-zA-Z0-9+\-_\/. ]/,
+// style
+        sx = /^\s*([{}:#%.=,>+\[\]@()"';]|[*$\^~]=|[a-zA-Z_][a-zA-Z0-9_\-]*|[0-9]+|<\/|\/\*)/,
+        ssx = /^\s*([@#!"'};:\-%.=,+\[\]()*_]|[a-zA-Z][a-zA-Z0-9._\-]*|\/\*?|\d+(?:\.\d+)?|<\/)/,
+// token
+        tx = /^\s*([(){}\[\]\?.,:;'"~#@`]|={1,3}|\/(\*(jslint|properties|property|members?|globals?)?|=|\/)?|\*[\/=]?|\+(?:=|\++)?|-(?:=|-+)?|[\^%]=?|&[&=]?|\|[|=]?|>{1,3}=?|<(?:[\/=!]|\!(\[|--)?|<=?)?|\!={0,2}|[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+(?:[xX][0-9a-fA-F]+|\.[0-9]*)?(?:[eE][+\-]?[0-9]+)?)/,
+// url badness
+        ux = /&|\+|\u00AD|\.\.|\/\*|%[^;]|base64|url|expression|data|mailto|script/i,
+
+        rx = {
+            outer: hx,
+            html: hx,
+            style: sx,
+            styleproperty: ssx
+        };
+
+
+    function F() {}     // Used by Object.create
+
+// Provide critical ES5 functions to ES3.
+
+    if (typeof Array.prototype.filter !== 'function') {
+        Array.prototype.filter = function (f) {
+            var i, length = this.length, result = [], value;
+            for (i = 0; i < length; i += 1) {
+                try {
+                    value = this[i];
+                    if (f(value)) {
+                        result.push(value);
+                    }
+                } catch (ignore) {
+                }
+            }
+            return result;
+        };
+    }
+
+    if (typeof Array.prototype.forEach !== 'function') {
+        Array.prototype.forEach = function (f) {
+            var i, length = this.length;
+            for (i = 0; i < length; i += 1) {
+                try {
+                    f(this[i]);
+                } catch (ignore) {
+                }
+            }
+        };
+    }
+
+    if (typeof Array.isArray !== 'function') {
+        Array.isArray = function (o) {
+            return Object.prototype.toString.apply(o) === '[object Array]';
+        };
+    }
+
+    if (!Object.prototype.hasOwnProperty.call(Object, 'create')) {
+        Object.create = function (o) {
+            F.prototype = o;
+            return new F();
+        };
+    }
+
+    if (typeof Object.keys !== 'function') {
+        Object.keys = function (o) {
+            var array = [], key;
+            for (key in o) {
+                if (Object.prototype.hasOwnProperty.call(o, key)) {
+                    array.push(key);
+                }
+            }
+            return array;
+        };
+    }
+
+    if (typeof String.prototype.entityify !== 'function') {
+        String.prototype.entityify = function () {
+            return this
+                .replace(/&/g, '&amp;')
+                .replace(/</g, '&lt;')
+                .replace(/>/g, '&gt;');
+        };
+    }
+
+    if (typeof String.prototype.isAlpha !== 'function') {
+        String.prototype.isAlpha = function () {
+            return (this >= 'a' && this <= 'z\uffff') ||
+                (this >= 'A' && this <= 'Z\uffff');
+        };
+    }
+
+    if (typeof String.prototype.isDigit !== 'function') {
+        String.prototype.isDigit = function () {
+            return (this >= '0' && this <= '9');
+        };
+    }
+
+    if (typeof String.prototype.supplant !== 'function') {
+        String.prototype.supplant = function (o) {
+            return this.replace(/\{([^{}]*)\}/g, function (a, b) {
+                var replacement = o[b];
+                return typeof replacement === 'string' ||
+                    typeof replacement === 'number' ? replacement : a;
+            });
+        };
+    }
+
+
+    function sanitize(a) {
+
+//  Escapify a troublesome character.
+
+        return escapes[a] ||
+            '\\u' + ('0000' + a.charCodeAt().toString(16)).slice(-4);
+    }
+
+
+    function add_to_predefined(group) {
+        Object.keys(group).forEach(function (name) {
+            predefined[name] = group[name];
+        });
+    }
+
+
+    function assume() {
+        if (!option.safe) {
+            if (option.rhino) {
+                add_to_predefined(rhino);
+                option.rhino = false;
+            }
+            if (option.devel) {
+                add_to_predefined(devel);
+                option.devel = false;
+            }
+            if (option.browser) {
+                add_to_predefined(browser);
+                option.browser = false;
+            }
+            if (option.windows) {
+                add_to_predefined(windows);
+                option.windows = false;
+            }
+            if (option.node) {
+                add_to_predefined(node);
+                option.node = false;
+                node_js = true;
+            }
+            if (option.widget) {
+                add_to_predefined(widget);
+                option.widget = false;
+            }
+        }
+    }
+
+
+// Produce an error warning.
+
+    function artifact(tok) {
+        if (!tok) {
+            tok = next_token;
+        }
+        return tok.number || tok.string;
+    }
+
+    function quit(message, line, character) {
+        throw {
+            name: 'JSLintError',
+            line: line,
+            character: character,
+            message: bundle.scanned_a_b.supplant({
+                a: message,
+                b: Math.floor((line / lines.length) * 100)
+            })
+        };
+    }
+
+    function warn(message, offender, a, b, c, d) {
+        var character, line, warning;
+        offender = offender || next_token;  // ~~
+        line = offender.line || 0;
+        character = offender.from || 0;
+        warning = {
+            id: '(error)',
+            raw: bundle[message] || message,
+            evidence: lines[line - 1] || '',
+            line: line,
+            character: character,
+            a: a || (offender.id === '(number)'
+                ? String(offender.number)
+                : offender.string),
+            b: b,
+            c: c,
+            d: d
+        };
+        warning.reason = warning.raw.supplant(warning);
+        JSLINT.errors.push(warning);
+        if (option.passfail) {
+            quit(bundle.stopping, line, character);
+        }
+        warnings += 1;
+        if (warnings >= option.maxerr) {
+            quit(bundle.too_many, line, character);
+        }
+        return warning;
+    }
+
+    function warn_at(message, line, character, a, b, c, d) {
+        return warn(message, {
+            line: line,
+            from: character
+        }, a, b, c, d);
+    }
+
+    function stop(message, offender, a, b, c, d) {
+        var warning = warn(message, offender, a, b, c, d);
+        quit(bundle.stopping, warning.line, warning.character);
+    }
+
+    function stop_at(message, line, character, a, b, c, d) {
+        return stop(message, {
+            line: line,
+            from: character
+        }, a, b, c, d);
+    }
+
+    function expected_at(at) {
+        if (!option.white && next_token.from !== at) {
+            warn('expected_a_at_b_c', next_token, '', at,
+                next_token.from);
+        }
+    }
+
+    function aint(it, name, expected) {
+        if (it[name] !== expected) {
+            warn('expected_a_b', it, expected, it[name]);
+            return true;
+        }
+        return false;
+    }
+
+
+// lexical analysis and token construction
+
+    lex = (function lex() {
+        var character, c, from, length, line, pos, source_row;
+
+// Private lex methods
+
+        function next_line() {
+            var at;
+            if (line >= lines.length) {
+                return false;
+            }
+            character = 1;
+            source_row = lines[line];
+            line += 1;
+            at = source_row.search(/ \t/);
+            if (at >= 0) {
+                warn_at('mixed', line, at + 1);
+            }
+            source_row = source_row.replace(/\t/g, tab);
+            at = source_row.search(cx);
+            if (at >= 0) {
+                warn_at('unsafe', line, at);
+            }
+            if (option.maxlen && option.maxlen < source_row.length) {
+                warn_at('too_long', line, source_row.length);
+            }
+            return true;
+        }
+
+// Produce a token object.  The token inherits from a syntax symbol.
+
+        function it(type, value) {
+            var id, the_token;
+            if (type === '(string)' || type === '(range)') {
+                if (jx.test(value)) {
+                    warn_at('url', line, from);
+                }
+            }
+            the_token = Object.create(syntax[(
+                type === '(punctuator)' || (type === '(identifier)' &&
+                        Object.prototype.hasOwnProperty.call(syntax, value))
+                    ? value
+                    : type
+            )] || syntax['(error)']);
+            if (type === '(identifier)') {
+                the_token.identifier = true;
+                if (value === '__iterator__' || value === '__proto__') {
+                    stop_at('reserved_a', line, from, value);
+                } else if (!option.nomen &&
+                        (value.charAt(0) === '_' ||
+                        value.charAt(value.length - 1) === '_')) {
+                    warn_at('dangling_a', line, from, value);
+                }
+            }
+            if (type === '(number)') {
+                the_token.number = +value;
+            } else if (value !== undefined) {
+                the_token.string = String(value);
+            }
+            the_token.line = line;
+            the_token.from = from;
+            the_token.thru = character;
+            id = the_token.id;
+            prereg = id && (
+                ('(,=:[!&|?{};'.indexOf(id.charAt(id.length - 1)) >= 0) ||
+                id === 'return' || id === 'case'
+            );
+            return the_token;
+        }
+
+        function match(x) {
+            var exec = x.exec(source_row), first;
+            if (exec) {
+                length = exec[0].length;
+                first = exec[1];
+                c = first.charAt(0);
+                source_row = source_row.slice(length);
+                from = character + length - first.length;
+                character += length;
+                return first;
+            }
+        }
+
+        function string(x) {
+            var c, pos = 0, r = '', result;
+
+            function hex(n) {
+                var i = parseInt(source_row.substr(pos + 1, n), 16);
+                pos += n;
+                if (i >= 32 && i <= 126 &&
+                        i !== 34 && i !== 92 && i !== 39) {
+                    warn_at('unexpected_a', line, character, '\\');
+                }
+                character += n;
+                c = String.fromCharCode(i);
+            }
+
+            if (json_mode && x !== '"') {
+                warn_at('expected_a', line, character, '"');
+            }
+
+            if (xquote === x || (xmode === 'scriptstring' && !xquote)) {
+                return it('(punctuator)', x);
+            }
+
+            for (;;) {
+                while (pos >= source_row.length) {
+                    pos = 0;
+                    if (xmode !== 'html' || !next_line()) {
+                        stop_at('unclosed', line, from);
+                    }
+                }
+                c = source_row.charAt(pos);
+                if (c === x) {
+                    character += 1;
+                    source_row = source_row.slice(pos + 1);
+                    result = it('(string)', r);
+                    result.quote = x;
+                    return result;
+                }
+                if (c < ' ') {
+                    if (c === '\n' || c === '\r') {
+                        break;
+                    }
+                    warn_at('control_a', line, character + pos,
+                        source_row.slice(0, pos));
+                } else if (c === xquote) {
+                    warn_at('bad_html', line, character + pos);
+                } else if (c === '<') {
+                    if (option.safe && xmode === 'html') {
+                        warn_at('adsafe_a', line, character + pos, c);
+                    } else if (source_row.charAt(pos + 1) === '/' && (xmode || option.safe)) {
+                        warn_at('expected_a_b', line, character,
+                            '<\\/', '</');
+                    } else if (source_row.charAt(pos + 1) === '!' && (xmode || option.safe)) {
+                        warn_at('unexpected_a', line, character, '<!');
+                    }
+                } else if (c === '\\') {
+                    if (xmode === 'html') {
+                        if (option.safe) {
+                            warn_at('adsafe_a', line, character + pos, c);
+                        }
+                    } else if (xmode === 'styleproperty') {
+                        pos += 1;
+                        character += 1;
+                        c = source_row.charAt(pos);
+                        if (c !== x) {
+                            warn_at('unexpected_a', line, character, '\\');
+                        }
+                    } else {
+                        pos += 1;
+                        character += 1;
+                        c = source_row.charAt(pos);
+                        switch (c) {
+                        case '':
+                            if (!option.es5) {
+                                warn_at('es5', line, character);
+                            }
+                            next_line();
+                            pos = -1;
+                            break;
+                        case xquote:
+                            warn_at('bad_html', line, character + pos);
+                            break;
+                        case '\'':
+                            if (json_mode) {
+                                warn_at('unexpected_a', line, character, '\\\'');
+                            }
+                            break;
+                        case 'u':
+                            hex(4);
+                            break;
+                        case 'v':
+                            if (json_mode) {
+                                warn_at('unexpected_a', line, character, '\\v');
+                            }
+                            c = '\v';
+                            break;
+                        case 'x':
+                            if (json_mode) {
+                                warn_at('unexpected_a', line, character, '\\x');
+                            }
+                            hex(2);
+                            break;
+                        default:
+                            if (typeof descapes[c] !== 'string') {
+                                warn_at(c >= '0' && c <= '7' ? 'octal_a' : 'unexpected_a',
+                                    line, character, '\\' + c);
+                            } else {
+                                c = descapes[c];
+                            }
+                        }
+                    }
+                }
+                r += c;
+                character += 1;
+                pos += 1;
+            }
+        }
+
+        function number(snippet) {
+            var digit;
+            if (xmode !== 'style' && xmode !== 'styleproperty' &&
+                    source_row.charAt(0).isAlpha()) {
+                warn_at('expected_space_a_b',
+                    line, character, c, source_row.charAt(0));
+            }
+            if (c === '0') {
+                digit = snippet.charAt(1);
+                if (digit.isDigit()) {
+                    if (token.id !== '.' && xmode !== 'styleproperty') {
+                        warn_at('unexpected_a', line, character, snippet);
+                    }
+                } else if (json_mode && (digit === 'x' || digit === 'X')) {
+                    warn_at('unexpected_a', line, character, '0x');
+                }
+            }
+            if (snippet.slice(snippet.length - 1) === '.') {
+                warn_at('trailing_decimal_a', line, character, snippet);
+            }
+            if (xmode !== 'style') {
+                digit = +snippet;
+                if (!isFinite(digit)) {
+                    warn_at('bad_number', line, character, snippet);
+                }
+                snippet = digit;
+            }
+            return it('(number)', snippet);
+        }
+
+        function comment(snippet) {
+            if (comments_off || src || (xmode && xmode !== 'script' &&
+                    xmode !== 'style' && xmode !== 'styleproperty')) {
+                warn_at('unexpected_comment', line, character);
+            } else if (xmode === 'script' && /<\//i.test(source_row)) {
+                warn_at('unexpected_a', line, character, '<\/');
+            } else if (option.safe && ax.test(snippet)) {
+                warn_at('dangerous_comment', line, character);
+            }
+        }
+
+        function regexp() {
+            var b,
+                bit,
+                captures = 0,
+                depth = 0,
+                flag = '',
+                high,
+                letter,
+                length = 0,
+                low,
+                potential,
+                quote,
+                result;
+            for (;;) {
+                b = true;
+                c = source_row.charAt(length);
+                length += 1;
+                switch (c) {
+                case '':
+                    stop_at('unclosed_regexp', line, from);
+                    return;
+                case '/':
+                    if (depth > 0) {
+                        warn_at('unescaped_a', line, from + length, '/');
+                    }
+                    c = source_row.slice(0, length - 1);
+                    potential = Object.create(regexp_flag);
+                    for (;;) {
+                        letter = source_row.charAt(length);
+                        if (potential[letter] !== true) {
+                            break;
+                        }
+                        potential[letter] = false;
+                        length += 1;
+                        flag += letter;
+                    }
+                    if (source_row.charAt(length).isAlpha()) {
+                        stop_at('unexpected_a', line, from, source_row.charAt(length));
+                    }
+                    character += length;
+                    source_row = source_row.slice(length);
+                    quote = source_row.charAt(0);
+                    if (quote === '/' || quote === '*') {
+                        stop_at('confusing_regexp', line, from);
+                    }
+                    result = it('(regexp)', c);
+                    result.flag = flag;
+                    return result;
+                case '\\':
+                    c = source_row.charAt(length);
+                    if (c < ' ') {
+                        warn_at('control_a', line, from + length, String(c));
+                    } else if (c === '<') {
+                        warn_at(bundle.unexpected_a, line, from + length, '\\');
+                    }
+                    length += 1;
+                    break;
+                case '(':
+                    depth += 1;
+                    b = false;
+                    if (source_row.charAt(length) === '?') {
+                        length += 1;
+                        switch (source_row.charAt(length)) {
+                        case ':':
+                        case '=':
+                        case '!':
+                            length += 1;
+                            break;
+                        default:
+                            warn_at(bundle.expected_a_b, line, from + length,
+                                ':', source_row.charAt(length));
+                        }
+                    } else {
+                        captures += 1;
+                    }
+                    break;
+                case '|':
+                    b = false;
+                    break;
+                case ')':
+                    if (depth === 0) {
+                        warn_at('unescaped_a', line, from + length, ')');
+                    } else {
+                        depth -= 1;
+                    }
+                    break;
+                case ' ':
+                    pos = 1;
+                    while (source_row.charAt(length) === ' ') {
+                        length += 1;
+                        pos += 1;
+                    }
+                    if (pos > 1) {
+                        warn_at('use_braces', line, from + length, pos);
+                    }
+                    break;
+                case '[':
+                    c = source_row.charAt(length);
+                    if (c === '^') {
+                        length += 1;
+                        if (!option.regexp) {
+                            warn_at('insecure_a', line, from + length, c);
+                        } else if (source_row.charAt(length) === ']') {
+                            stop_at('unescaped_a', line, from + length, '^');
+                        }
+                    }
+                    bit = false;
+                    if (c === ']') {
+                        warn_at('empty_class', line, from + length - 1);
+                        bit = true;
+                    }
+klass:              do {
+                        c = source_row.charAt(length);
+                        length += 1;
+                        switch (c) {
+                        case '[':
+                        case '^':
+                            warn_at('unescaped_a', line, from + length, c);
+                            bit = true;
+                            break;
+                        case '-':
+                            if (bit) {
+                                bit = false;
+                            } else {
+                                warn_at('unescaped_a', line, from + length, '-');
+                                bit = true;
+                            }
+                            break;
+                        case ']':
+                            if (!bit) {
+                                warn_at('unescaped_a', line, from + length - 1, '-');
+                            }
+                            break klass;
+                        case '\\':
+                            c = source_row.charAt(length);
+                            if (c < ' ') {
+                                warn_at(bundle.control_a, line, from + length, String(c));
+                            } else if (c === '<') {
+                                warn_at(bundle.unexpected_a, line, from + length, '\\');
+                            }
+                            length += 1;
+                            bit = true;
+                            break;
+                        case '/':
+                            warn_at('unescaped_a', line, from + length - 1, '/');
+                            bit = true;
+                            break;
+                        case '<':
+                            if (xmode === 'script') {
+                                c = source_row.charAt(length);
+                                if (c === '!' || c === '/') {
+                                    warn_at(bundle.html_confusion_a, line,
+                                        from + length, c);
+                                }
+                            }
+                            bit = true;
+                            break;
+                        default:
+                            bit = true;
+                        }
+                    } while (c);
+                    break;
+                case '.':
+                    if (!option.regexp) {
+                        warn_at('insecure_a', line, from + length, c);
+                    }
+                    break;
+                case ']':
+                case '?':
+                case '{':
+                case '}':
+                case '+':
+                case '*':
+                    warn_at('unescaped_a', line, from + length, c);
+                    break;
+                case '<':
+                    if (xmode === 'script') {
+                        c = source_row.charAt(length);
+                        if (c === '!' || c === '/') {
+                            warn_at(bundle.html_confusion_a, line, from + length, c);
+                        }
+                    }
+                    break;
+                }
+                if (b) {
+                    switch (source_row.charAt(length)) {
+                    case '?':
+                    case '+':
+                    case '*':
+                        length += 1;
+                        if (source_row.charAt(length) === '?') {
+                            length += 1;
+                        }
+                        break;
+                    case '{':
+                        length += 1;
+                        c = source_row.charAt(length);
+                        if (c < '0' || c > '9') {
+                            warn_at(bundle.expected_number_a, line,
+                                from + length, c);
+                        }
+                        length += 1;
+                        low = +c;
+                        for (;;) {
+                            c = source_row.charAt(length);
+                            if (c < '0' || c > '9') {
+                                break;
+                            }
+                            length += 1;
+                            low = +c + (low * 10);
+                        }
+                        high = low;
+                        if (c === ',') {
+                            length += 1;
+                            high = Infinity;
+                            c = source_row.charAt(length);
+                            if (c >= '0' && c <= '9') {
+                                length += 1;
+                                high = +c;
+                                for (;;) {
+                                    c = source_row.charAt(length);
+                                    if (c < '0' || c > '9') {
+                                        break;
+                                    }
+                                    length += 1;
+                                    high = +c + (high * 10);
+                                }
+                            }
+                        }
+                        if (source_row.charAt(length) !== '}') {
+                            warn_at(bundle.expected_a_b, line, from + length,
+                                '}', c);
+                        } else {
+                            length += 1;
+                        }
+                        if (source_row.charAt(length) === '?') {
+                            length += 1;
+                        }
+                        if (low > high) {
+                            warn_at(bundle.not_greater, line, from + length,
+                                low, high);
+                        }
+                        break;
+                    }
+                }
+            }
+            c = source_row.slice(0, length - 1);
+            character += length;
+            source_row = source_row.slice(length);
+            return it('(regexp)', c);
+        }
+
+// Public lex methods
+
+        return {
+            init: function (source) {
+                if (typeof source === 'string') {
+                    lines = source.split(crlfx);
+                } else {
+                    lines = source;
+                }
+                line = 0;
+                next_line();
+                from = 1;
+            },
+
+            range: function (begin, end) {
+                var c, value = '';
+                from = character;
+                if (source_row.charAt(0) !== begin) {
+                    stop_at('expected_a_b', line, character, begin,
+                        source_row.charAt(0));
+                }
+                for (;;) {
+                    source_row = source_row.slice(1);
+                    character += 1;
+                    c = source_row.charAt(0);
+                    switch (c) {
+                    case '':
+                        stop_at('missing_a', line, character, c);
+                        break;
+                    case end:
+                        source_row = source_row.slice(1);
+                        character += 1;
+                        return it('(range)', value);
+                    case xquote:
+                    case '\\':
+                        warn_at('unexpected_a', line, character, c);
+                        break;
+                    }
+                    value += c;
+                }
+            },
+
+// token -- this is called by advance to get the next token.
+
+            token: function () {
+                var c, i, snippet;
+
+                for (;;) {
+                    while (!source_row) {
+                        if (!next_line()) {
+                            return it('(end)');
+                        }
+                    }
+                    while (xmode === 'outer') {
+                        i = source_row.search(ox);
+                        if (i === 0) {
+                            break;
+                        } else if (i > 0) {
+                            character += 1;
+                            source_row = source_row.slice(i);
+                            break;
+                        } else {
+                            if (!next_line()) {
+                                return it('(end)', '');
+                            }
+                        }
+                    }
+                    snippet = match(rx[xmode] || tx);
+                    if (!snippet) {
+                        if (source_row) {
+                            if (source_row.charAt(0) === ' ') {
+                                if (!option.white) {
+                                    warn_at('unexpected_a', line, character,
+                                        '(space)');
+                                }
+                                character += 1;
+                                source_row = '';
+                            } else {
+                                stop_at('unexpected_a', line, character,
+                                    source_row.charAt(0));
+                            }
+                        }
+                    } else {
+
+//      identifier
+
+                        c = snippet.charAt(0);
+                        if (c.isAlpha() || c === '_' || c === '$') {
+                            return it('(identifier)', snippet);
+                        }
+
+//      number
+
+                        if (c.isDigit()) {
+                            return number(snippet);
+                        }
+                        switch (snippet) {
+
+//      string
+
+                        case '"':
+                        case "'":
+                            return string(snippet);
+
+//      // comment
+
+                        case '//':
+                            comment(source_row);
+                            source_row = '';
+                            break;
+
+//      /* comment
+
+                        case '/*':
+                            for (;;) {
+                                i = source_row.search(lx);
+                                if (i >= 0) {
+                                    break;
+                                }
+                                comment(source_row);
+                                if (!next_line()) {
+                                    stop_at('unclosed_comment', line, character);
+                                }
+                            }
+                            comment(source_row.slice(0, i));
+                            character += i + 2;
+                            if (source_row.charAt(i) === '/') {
+                                stop_at('nested_comment', line, character);
+                            }
+                            source_row = source_row.slice(i + 2);
+                            break;
+
+                        case '':
+                            break;
+//      /
+                        case '/':
+                            if (token.id === '/=') {
+                                stop_at(
+                                    bundle.slash_equal,
+                                    line,
+                                    from
+                                );
+                            }
+                            return prereg
+                                ? regexp()
+                                : it('(punctuator)', snippet);
+
+//      punctuator
+
+                        case '<!--':
+                            length = line;
+//                            c = character;
+                            for (;;) {
+                                i = source_row.indexOf('--');
+                                if (i >= 0) {
+                                    break;
+                                }
+                                i = source_row.indexOf('<!');
+                                if (i >= 0) {
+                                    stop_at('nested_comment',
+                                        line, character + i);
+                                }
+                                if (!next_line()) {
+                                    stop_at('unclosed_comment', length, c);
+                                }
+                            }
+                            length = source_row.indexOf('<!');
+                            if (length >= 0 && length < i) {
+                                stop_at('nested_comment',
+                                    line, character + length);
+                            }
+                            character += i;
+                            if (source_row.charAt(i + 2) !== '>') {
+                                stop_at('expected_a', line, character, '-->');
+                            }
+                            character += 3;
+                            source_row = source_row.slice(i + 3);
+                            break;
+                        case '#':
+                            if (xmode === 'html' || xmode === 'styleproperty') {
+                                for (;;) {
+                                    c = source_row.charAt(0);
+                                    if ((c < '0' || c > '9') &&
+                                            (c < 'a' || c > 'f') &&
+                                            (c < 'A' || c > 'F')) {
+                                        break;
+                                    }
+                                    character += 1;
+                                    source_row = source_row.slice(1);
+                                    snippet += c;
+                                }
+                                if (snippet.length !== 4 && snippet.length !== 7) {
+                                    warn_at('bad_color_a', line,
+                                        from + length, snippet);
+                                }
+                                return it('(color)', snippet);
+                            }
+                            return it('(punctuator)', snippet);
+
+                        default:
+                            if (xmode === 'outer' && c === '&') {
+                                character += 1;
+                                source_row = source_row.slice(1);
+                                for (;;) {
+                                    c = source_row.charAt(0);
+                                    character += 1;
+                                    source_row = source_row.slice(1);
+                                    if (c === ';') {
+                                        break;
+                                    }
+                                    if (!((c >= '0' && c <= '9') ||
+                                            (c >= 'a' && c <= 'z') ||
+                                            c === '#')) {
+                                        stop_at('bad_entity', line, from + length,
+                                            character);
+                                    }
+                                }
+                                break;
+                            }
+                            return it('(punctuator)', snippet);
+                        }
+                    }
+                }
+            }
+        };
+    }());
+
+
+    function add_label(token, kind, name) {
+
+// Define the symbol in the current function in the current scope.
+
+        name = name || token.string;
+
+// Global variables cannot be created in the safe subset. If a global variable
+// already exists, do nothing. If it is predefined, define it.
+
+        if (funct === global_funct) {
+            if (option.safe) {
+                warn('adsafe_a', token, name);
+            }
+            if (typeof global_funct[name] !== 'string') {
+                token.writeable = typeof predefined[name] === 'boolean'
+                    ? predefined[name]
+                    : true;
+                token.funct = funct;
+                global_scope[name] = token;
+            }
+            if (kind === 'becoming') {
+                kind = 'var';
+            }
+
+// Ordinary variables.
+
+        } else {
+
+// Warn if the variable already exists.
+
+            if (typeof funct[name] === 'string') {
+                if (funct[name] === 'undef') {
+                    if (!option.undef) {
+                        warn('used_before_a', token, name);
+                    }
+                    kind = 'var';
+                } else {
+                    warn('already_defined', token, name);
+                }
+            } else {
+
+// Add the symbol to the current function.
+
+                token.funct = funct;
+                token.writeable = true;
+                scope[name] = token;
+            }
+        }
+        funct[name] = kind;
+    }
+
+
+    function peek(distance) {
+
+// Peek ahead to a future token. The distance is how far ahead to look. The
+// default is the next token.
+
+        var found, slot = 0;
+
+        distance = distance || 0;
+        while (slot <= distance) {
+            found = lookahead[slot];
+            if (!found) {
+                found = lookahead[slot] = lex.token();
+            }
+            slot += 1;
+        }
+        return found;
+    }
+
+
+    function advance(id, match) {
+
+// Produce the next token, also looking for programming errors.
+
+        if (indent) {
+
+// If indentation checking was requested, then inspect all of the line breakings.
+// The var statement is tricky because the names might be aligned or not. We
+// look at the first line break after the var to determine the programmer's
+// intention.
+
+            if (var_mode && next_token.line !== token.line) {
+                if ((var_mode !== indent || !next_token.edge) &&
+                        next_token.from === indent.at -
+                        (next_token.edge ? option.indent : 0)) {
+                    var dent = indent;
+                    for (;;) {
+                        dent.at -= option.indent;
+                        if (dent === var_mode) {
+                            break;
+                        }
+                        dent = dent.was;
+                    }
+                    dent.open = false;
+                }
+                var_mode = null;
+            }
+            if (next_token.id === '?' && indent.mode === ':' &&
+                    token.line !== next_token.line) {
+                indent.at -= option.indent;
+            }
+            if (indent.open) {
+
+// If the token is an edge.
+
+                if (next_token.edge) {
+                    if (next_token.edge === 'label') {
+                        expected_at(1);
+                    } else if (next_token.edge === 'case' || indent.mode === 'statement') {
+                        expected_at(indent.at - option.indent);
+                    } else if (indent.mode !== 'array' || next_token.line !== token.line) {
+                        expected_at(indent.at);
+                    }
+
+// If the token is not an edge, but is the first token on the line.
+
+                } else if (next_token.line !== token.line) {
+                    if (next_token.from < indent.at + (indent.mode ===
+                            'expression' ? 0 : option.indent)) {
+                        expected_at(indent.at + option.indent);
+                    }
+                    indent.wrap = true;
+                }
+            } else if (next_token.line !== token.line) {
+                if (next_token.edge) {
+                    expected_at(indent.at);
+                } else {
+                    indent.wrap = true;
+                    if (indent.mode === 'statement' || indent.mode === 'var') {
+                        expected_at(indent.at + option.indent);
+                    } else if (next_token.from < indent.at + (indent.mode ===
+                            'expression' ? 0 : option.indent)) {
+                        expected_at(indent.at + option.indent);
+                    }
+                }
+            }
+        }
+
+        switch (token.id) {
+        case '(number)':
+            if (next_token.id === '.') {
+                warn('trailing_decimal_a');
+            }
+            break;
+        case '-':
+            if (next_token.id === '-' || next_token.id === '--') {
+                warn('confusing_a');
+            }
+            break;
+        case '+':
+            if (next_token.id === '+' || next_token.id === '++') {
+                warn('confusing_a');
+            }
+            break;
+        }
+        if (token.id === '(string)' || token.identifier) {
+            anonname = token.string;
+        }
+
+        if (id && next_token.id !== id) {
+            if (match) {
+                warn('expected_a_b_from_c_d', next_token, id,
+                    match.id, match.line, artifact());
+            } else if (!next_token.identifier || next_token.string !== id) {
+                warn('expected_a_b', next_token, id, artifact());
+            }
+        }
+        prev_token = token;
+        token = next_token;
+        next_token = lookahead.shift() || lex.token();
+    }
+
+
+    function advance_identifier(string) {
+        if (next_token.identifier && next_token.string === string) {
+            advance();
+        } else {
+            warn('expected_a_b', next_token, string, artifact());
+        }
+    }
+
+
+    function do_safe() {
+        if (option.adsafe) {
+            option.safe = true;
+        }
+        if (option.safe) {
+            option.browser     =
+                option['continue'] =
+                option.css     =
+                option.debug   =
+                option.devel   =
+                option.evil    =
+                option.forin   =
+                option.newcap  =
+                option.nomen   =
+                option.on      =
+                option.rhino   =
+                option.sloppy  =
+                option.sub     =
+                option.undef   =
+                option.widget  =
+                option.windows = false;
+
+
+            delete predefined.Array;
+            delete predefined.Date;
+            delete predefined.Function;
+            delete predefined.Object;
+            delete predefined['eval'];
+
+            add_to_predefined({
+                ADSAFE: false,
+                lib: false
+            });
+        }
+    }
+
+
+    function do_globals() {
+        var name, writeable;
+        for (;;) {
+            if (next_token.id !== '(string)' && !next_token.identifier) {
+                return;
+            }
+            name = next_token.string;
+            advance();
+            writeable = false;
+            if (next_token.id === ':') {
+                advance(':');
+                switch (next_token.id) {
+                case 'true':
+                    writeable = predefined[name] !== false;
+                    advance('true');
+                    break;
+                case 'false':
+                    advance('false');
+                    break;
+                default:
+                    stop('unexpected_a');
+                }
+            }
+            predefined[name] = writeable;
+            if (next_token.id !== ',') {
+                return;
+            }
+            advance(',');
+        }
+    }
+
+
+    function do_jslint() {
+        var name, value;
+        while (next_token.id === '(string)' || next_token.identifier) {
+            name = next_token.string;
+            if (!allowed_option[name]) {
+                stop('unexpected_a');
+            }
+            advance();
+            if (next_token.id !== ':') {
+                stop('expected_a_b', next_token, ':', artifact());
+            }
+            advance(':');
+            if (typeof allowed_option[name] === 'number') {
+                value = next_token.number;
+                if (value > allowed_option[name] || value <= 0 ||
+                        Math.floor(value) !== value) {
+                    stop('expected_small_a');
+                }
+                option[name] = value;
+            } else {
+                if (next_token.id === 'true') {
+                    option[name] = true;
+                } else if (next_token.id === 'false') {
+                    option[name] = false;
+                } else {
+                    stop('unexpected_a');
+                }
+            }
+            advance();
+            if (next_token.id === ',') {
+                advance(',');
+            }
+        }
+        assume();
+    }
+
+
+    function do_properties() {
+        var name;
+        option.properties = true;
+        for (;;) {
+            if (next_token.id !== '(string)' && !next_token.identifier) {
+                return;
+            }
+            name = next_token.string;
+            advance();
+            if (next_token.id === ':') {
+                for (;;) {
+                    advance();
+                    if (next_token.id !== '(string)' && !next_token.identifier) {
+                        break;
+                    }
+                }
+            }
+            property[name] = 0;
+            if (next_token.id !== ',') {
+                return;
+            }
+            advance(',');
+        }
+    }
+
+
+    directive = function directive() {
+        var command = this.id,
+            old_comments_off = comments_off,
+            old_indent = indent;
+        comments_off = true;
+        indent = null;
+        if (next_token.line === token.line && next_token.from === token.thru) {
+            warn('missing_space_a_b', next_token, artifact(token), artifact());
+        }
+        if (lookahead.length > 0) {
+            warn('unexpected_a', this);
+        }
+        switch (command) {
+        case '/*properties':
+        case '/*property':
+        case '/*members':
+        case '/*member':
+            do_properties();
+            break;
+        case '/*jslint':
+            if (option.safe) {
+                warn('adsafe_a', this);
+            }
+            do_jslint();
+            break;
+        case '/*globals':
+        case '/*global':
+            if (option.safe) {
+                warn('adsafe_a', this);
+            }
+            do_globals();
+            break;
+        default:
+            stop('unexpected_a', this);
+        }
+        comments_off = old_comments_off;
+        advance('*/');
+        indent = old_indent;
+    };
+
+
+// Indentation intention
+
+    function edge(mode) {
+        next_token.edge = indent ? indent.open && (mode || 'edge') : '';
+    }
+
+
+    function step_in(mode) {
+        var open;
+        if (typeof mode === 'number') {
+            indent = {
+                at: +mode,
+                open: true,
+                was: indent
+            };
+        } else if (!indent) {
+            indent = {
+                at: 1,
+                mode: 'statement',
+                open: true
+            };
+        } else if (mode === 'statement') {
+            indent = {
+                at: indent.at,
+                open: true,
+                was: indent
+            };
+        } else {
+            open = mode === 'var' || next_token.line !== token.line;
+            indent = {
+                at: (open || mode === 'control'
+                    ? indent.at + option.indent
+                    : indent.at) + (indent.wrap ? option.indent : 0),
+                mode: mode,
+                open: open,
+                was: indent
+            };
+            if (mode === 'var' && open) {
+                var_mode = indent;
+            }
+        }
+    }
+
+    function step_out(id, symbol) {
+        if (id) {
+            if (indent && indent.open) {
+                indent.at -= option.indent;
+                edge();
+            }
+            advance(id, symbol);
+        }
+        if (indent) {
+            indent = indent.was;
+        }
+    }
+
+// Functions for conformance of whitespace.
+
+    function one_space(left, right) {
+        left = left || token;
+        right = right || next_token;
+        if (right.id !== '(end)' && !option.white &&
+                (token.line !== right.line ||
+                token.thru + 1 !== right.from)) {
+            warn('expected_space_a_b', right, artifact(token), artifact(right));
+        }
+    }
+
+    function one_space_only(left, right) {
+        left = left || token;
+        right = right || next_token;
+        if (right.id !== '(end)' && (left.line !== right.line ||
+                (!option.white && left.thru + 1 !== right.from))) {
+            warn('expected_space_a_b', right, artifact(left), artifact(right));
+        }
+    }
+
+    function no_space(left, right) {
+        if (option.jqmspace)
+            return;
+
+        left = left || token;
+        right = right || next_token;
+        if ((!option.white || xmode === 'styleproperty' || xmode === 'style') &&
+                left.thru !== right.from && left.line === right.line) {
+            warn('unexpected_space_a_b', right, artifact(left), artifact(right));
+        }
+    }
+
+    function no_space_only(left, right) {
+        if (option.jqmspace)
+            return;
+
+        left = left || token;
+        right = right || next_token;
+        if (right.id !== '(end)' && (left.line !== right.line ||
+                (!option.white && left.thru !== right.from))) {
+            warn('unexpected_space_a_b', right, artifact(left), artifact(right));
+        }
+    }
+
+    function spaces(left, right) {
+        if (!option.white) {
+            left = left || token;
+            right = right || next_token;
+            if (left.thru === right.from && left.line === right.line) {
+                warn('missing_space_a_b', right, artifact(left), artifact(right));
+            }
+        }
+    }
+
+    function comma() {
+        if (next_token.id !== ',') {
+            warn_at('expected_a_b', token.line, token.thru, ',', artifact());
+        } else {
+            if (!option.white) {
+                no_space_only();
+            }
+            advance(',');
+            spaces();
+        }
+    }
+
+
+    function semicolon() {
+        if (next_token.id !== ';') {
+            warn_at('expected_a_b', token.line, token.thru, ';', artifact());
+        } else {
+            if (!option.white) {
+                no_space_only();
+            }
+            advance(';');
+            if (semicolon_coda[next_token.id] !== true) {
+                spaces();
+            }
+        }
+    }
+
+    function use_strict() {
+        if (next_token.string === 'use strict') {
+            if (strict_mode) {
+                warn('unnecessary_use');
+            }
+            edge();
+            advance();
+            semicolon();
+            strict_mode = true;
+            option.newcap = false;
+            option.undef = false;
+            return true;
+        }
+        return false;
+    }
+
+
+    function are_similar(a, b) {
+        if (a === b) {
+            return true;
+        }
+        if (Array.isArray(a)) {
+            if (Array.isArray(b) && a.length === b.length) {
+                var i;
+                for (i = 0; i < a.length; i += 1) {
+                    if (!are_similar(a[i], b[i])) {
+                        return false;
+                    }
+                }
+                return true;
+            }
+            return false;
+        }
+        if (Array.isArray(b)) {
+            return false;
+        }
+        if (a.id === '(number)' && b.id === '(number)') {
+            return a.number === b.number;
+        }
+        if (a.arity === b.arity && a.string === b.string) {
+            switch (a.arity) {
+            case 'prefix':
+            case 'suffix':
+            case undefined:
+                return a.id === b.id && are_similar(a.first, b.first);
+            case 'infix':
+                return are_similar(a.first, b.first) &&
+                    are_similar(a.second, b.second);
+            case 'ternary':
+                return are_similar(a.first, b.first) &&
+                    are_similar(a.second, b.second) &&
+                    are_similar(a.third, b.third);
+            case 'function':
+            case 'regexp':
+                return false;
+            default:
+                return true;
+            }
+        } else {
+            if (a.id === '.' && b.id === '[' && b.arity === 'infix') {
+                return a.second.string === b.second.string && b.second.id === '(string)';
+            }
+            if (a.id === '[' && a.arity === 'infix' && b.id === '.') {
+                return a.second.string === b.second.string && a.second.id === '(string)';
+            }
+        }
+        return false;
+    }
+
+
+// This is the heart of JSLINT, the Pratt parser. In addition to parsing, it
+// is looking for ad hoc lint patterns. We add .fud to Pratt's model, which is
+// like .nud except that it is only used on the first token of a statement.
+// Having .fud makes it much easier to define statement-oriented languages like
+// JavaScript. I retained Pratt's nomenclature.
+
+// .nud     Null denotation
+// .fud     First null denotation
+// .led     Left denotation
+//  lbp     Left binding power
+//  rbp     Right binding power
+
+// They are elements of the parsing method called Top Down Operator Precedence.
+
+    function expression(rbp, initial) {
+
+// rbp is the right binding power.
+// initial indicates that this is the first expression of a statement.
+
+        var left;
+        if (next_token.id === '(end)') {
+            stop('unexpected_a', token, next_token.id);
+        }
+        advance();
+        if (option.safe && scope[token.string] &&
+                scope[token.string] === global_scope[token.string] &&
+                (next_token.id !== '(' && next_token.id !== '.')) {
+            warn('adsafe_a', token);
+        }
+        if (initial) {
+            anonname = 'anonymous';
+            funct['(verb)'] = token.string;
+        }
+        if (initial === true && token.fud) {
+            left = token.fud();
+        } else {
+            if (token.nud) {
+                left = token.nud();
+            } else {
+                if (next_token.id === '(number)' && token.id === '.') {
+                    warn('leading_decimal_a', token, artifact());
+                    advance();
+                    return token;
+                }
+                stop('expected_identifier_a', token, token.id);
+            }
+            while (rbp < next_token.lbp) {
+                advance();
+                if (token.led) {
+                    left = token.led(left);
+                } else {
+                    stop('expected_operator_a', token, token.id);
+                }
+            }
+        }
+        return left;
+    }
+
+
+// Functional constructors for making the symbols that will be inherited by
+// tokens.
+
+    function symbol(s, p) {
+        var x = syntax[s];
+        if (!x || typeof x !== 'object') {
+            syntax[s] = x = {
+                id: s,
+                lbp: p || 0,
+                string: s
+            };
+        }
+        return x;
+    }
+
+    function postscript(x) {
+        x.postscript = true;
+        return x;
+    }
+
+    function ultimate(s) {
+        var x = symbol(s, 0);
+        x.from = 1;
+        x.thru = 1;
+        x.line = 0;
+        x.edge = 'edge';
+        s.string = s;
+        return postscript(x);
+    }
+
+
+    function stmt(s, f) {
+        var x = symbol(s);
+        x.identifier = x.reserved = true;
+        x.fud = f;
+        return x;
+    }
+
+    function labeled_stmt(s, f) {
+        var x = stmt(s, f);
+        x.labeled = true;
+    }
+
+    function disrupt_stmt(s, f) {
+        var x = stmt(s, f);
+        x.disrupt = true;
+    }
+
+
+    function reserve_name(x) {
+        var c = x.id.charAt(0);
+        if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) {
+            x.identifier = x.reserved = true;
+        }
+        return x;
+    }
+
+
+    function prefix(s, f) {
+        var x = symbol(s, 150);
+        reserve_name(x);
+        x.nud = typeof f === 'function'
+            ? f
+            : function () {
+                if (s === 'typeof') {
+                    one_space();
+                } else {
+                    no_space_only();
+                }
+                this.first = expression(150);
+                this.arity = 'prefix';
+                if (this.id === '++' || this.id === '--') {
+                    if (!option.plusplus) {
+                        warn('unexpected_a', this);
+                    } else if ((!this.first.identifier || this.first.reserved) &&
+                            this.first.id !== '.' && this.first.id !== '[') {
+                        warn('bad_operand', this);
+                    }
+                }
+                return this;
+            };
+        return x;
+    }
+
+
+    function type(s, t, nud) {
+        var x = symbol(s);
+        x.arity = t;
+        if (nud) {
+            x.nud = nud;
+        }
+        return x;
+    }
+
+
+    function reserve(s, f) {
+        var x = symbol(s);
+        x.identifier = x.reserved = true;
+        if (typeof f === 'function') {
+            x.nud = f;
+        }
+        return x;
+    }
+
+
+    function constant(name) {
+        var x = reserve(name);
+        x.string = name;
+        x.nud = return_this;
+        return x;
+    }
+
+
+    function reservevar(s, v) {
+        return reserve(s, function () {
+            if (typeof v === 'function') {
+                v(this);
+            }
+            return this;
+        });
+    }
+
+
+    function infix(s, p, f, w) {
+        var x = symbol(s, p);
+        reserve_name(x);
+        x.led = function (left) {
+            this.arity = 'infix';
+            if (!w) {
+                spaces(prev_token, token);
+                spaces();
+            }
+            if (!option.bitwise && this.bitwise) {
+                warn('unexpected_a', this);
+            }
+            if (typeof f === 'function') {
+                return f(left, this);
+            }
+            this.first = left;
+            this.second = expression(p);
+            return this;
+        };
+        return x;
+    }
+
+    function expected_relation(node, message) {
+        if (node.assign) {
+            warn(message || bundle.conditional_assignment, node);
+        }
+        return node;
+    }
+
+    function expected_condition(node, message) {
+        switch (node.id) {
+        case '[':
+        case '-':
+            if (node.arity !== 'infix') {
+                warn(message || bundle.weird_condition, node);
+            }
+            break;
+        case 'false':
+        case 'function':
+        case 'Infinity':
+        case 'NaN':
+        case 'null':
+        case 'true':
+        case 'undefined':
+        case 'void':
+        case '(number)':
+        case '(regexp)':
+        case '(string)':
+        case '{':
+            warn(message || bundle.weird_condition, node);
+            break;
+        case '(':
+            if (node.first.id === '.' && numbery[node.first.second.string] === true) {
+                warn(message || bundle.weird_condition, node);
+            }
+            break;
+        }
+        return node;
+    }
+
+    function check_relation(node) {
+        switch (node.arity) {
+        case 'prefix':
+            switch (node.id) {
+            case '{':
+            case '[':
+                warn('unexpected_a', node);
+                break;
+            case '!':
+                warn('confusing_a', node);
+                break;
+            }
+            break;
+        case 'function':
+        case 'regexp':
+            warn('unexpected_a', node);
+            break;
+        default:
+            if (node.id  === 'NaN') {
+                warn('isNaN', node);
+            }
+        }
+        return node;
+    }
+
+
+    function relation(s, eqeq) {
+        return infix(s, 100, function (left, that) {
+            check_relation(left);
+            if (eqeq && !option.eqeq) {
+                warn('expected_a_b', that, eqeq, that.id);
+            }
+            var right = expression(100);
+            if (are_similar(left, right) ||
+                    ((left.id === '(string)' || left.id === '(number)') &&
+                    (right.id === '(string)' || right.id === '(number)'))) {
+                warn('weird_relation', that);
+            }
+            that.first = left;
+            that.second = check_relation(right);
+            return that;
+        });
+    }
+
+
+    function assignop(s, op) {
+        var x = infix(s, 20, function (left, that) {
+            var l;
+            that.first = left;
+            if (left.identifier) {
+                if (scope[left.string]) {
+                    if (scope[left.string].writeable === false) {
+                        warn('read_only', left);
+                    }
+                } else {
+                    stop('read_only');
+                }
+                if (funct['(params)']) {
+                    funct['(params)'].forEach(function (value) {
+                        if (value.string === left.string) {
+                            value.assign = true;
+                        }
+                    });
+                }
+            } else if (option.safe) {
+                l = left;
+                do {
+                    if (typeof predefined[l.string] === 'boolean') {
+                        warn('adsafe_a', l);
+                    }
+                    l = l.first;
+                } while (l);
+            }
+            if (left === syntax['function']) {
+                warn('identifier_function', token);
+            }
+            if (left.id === '.' || left.id === '[') {
+                if (!left.first || left.first.string === 'arguments') {
+                    warn('bad_assignment', that);
+                }
+            } else if (left.identifier) {
+                if (!left.reserved && funct[left.string] === 'exception') {
+                    warn('assign_exception', left);
+                }
+            } else {
+                warn('bad_assignment', that);
+            }
+            that.second = expression(19);
+            if (that.id === '=' && are_similar(that.first, that.second)) {
+                warn('weird_assignment', that);
+            }
+            return that;
+        });
+        x.assign = true;
+        if (op) {
+            if (syntax[op].bitwise) {
+                x.bitwise = true;
+            }
+        }
+        return x;
+    }
+
+
+    function bitwise(s, p) {
+        var x = infix(s, p, 'number');
+        x.bitwise = true;
+        return x;
+    }
+
+
+    function suffix(s) {
+        var x = symbol(s, 150);
+        x.led = function (left) {
+            no_space_only(prev_token, token);
+            if (!option.plusplus) {
+                warn('unexpected_a', this);
+            } else if ((!left.identifier || left.reserved) &&
+                    left.id !== '.' && left.id !== '[') {
+                warn('bad_operand', this);
+            }
+            this.first = left;
+            this.arity = 'suffix';
+            return this;
+        };
+        return x;
+    }
+
+
+    function optional_identifier() {
+        if (next_token.identifier) {
+            advance();
+            if (option.safe && banned[token.string]) {
+                warn('adsafe_a', token);
+            } else if (token.reserved && !option.es5) {
+                warn('expected_identifier_a_reserved', token);
+            }
+            return token.string;
+        }
+    }
+
+
+    function identifier() {
+        var i = optional_identifier();
+        if (!i) {
+            stop(token.id === 'function' && next_token.id === '('
+                ? 'name_function'
+                : 'expected_identifier_a');
+        }
+        return i;
+    }
+
+
+    function statement() {
+
+        var label, old_scope = scope, the_statement;
+
+// We don't like the empty statement.
+
+        if (next_token.id === ';') {
+            warn('unexpected_a');
+            semicolon();
+            return;
+        }
+
+// Is this a labeled statement?
+
+        if (next_token.identifier && !next_token.reserved && peek().id === ':') {
+            edge('label');
+            label = next_token;
+            advance();
+            advance(':');
+            scope = Object.create(old_scope);
+            add_label(label, 'label');
+            if (next_token.labeled !== true) {
+                warn('label_a_b', next_token, label.string, artifact());
+            } else if (jx.test(label.string + ':')) {
+                warn('url', label);
+            } else if (funct === global_funct) {
+                stop('unexpected_a', token);
+            }
+            next_token.label = label;
+        }
+
+// Parse the statement.
+
+        if (token.id !== 'else') {
+            edge();
+        }
+        step_in('statement');
+        the_statement = expression(0, true);
+        if (the_statement) {
+
+// Look for the final semicolon.
+
+            if (the_statement.arity === 'statement') {
+                if (the_statement.id === 'switch' ||
+                        (the_statement.block && the_statement.id !== 'do')) {
+                    spaces();
+                } else {
+                    semicolon();
+                }
+            } else {
+
+// If this is an expression statement, determine if it is acceptable.
+// We do not like
+//      new Blah();
+// statments. If it is to be used at all, new should only be used to make
+// objects, not side effects. The expression statements we do like do
+// assignment or invocation or delete.
+
+                if (the_statement.id === '(') {
+                    if (the_statement.first.id === 'new') {
+                        warn('bad_new');
+                    }
+                } else if (!the_statement.assign &&
+                        the_statement.id !== 'delete' &&
+                        the_statement.id !== '++' &&
+                        the_statement.id !== '--') {
+                    warn('assignment_function_expression', token);
+                }
+                semicolon();
+            }
+        }
+        step_out();
+        scope = old_scope;
+        return the_statement;
+    }
+
+
+    function statements() {
+        var array = [], disruptor, the_statement;
+
+// A disrupt statement may not be followed by any other statement.
+// If the last statement is disrupt, then the sequence is disrupt.
+
+        while (next_token.postscript !== true) {
+            if (next_token.id === ';') {
+                warn('unexpected_a', next_token);
+                semicolon();
+            } else {
+                if (next_token.string === 'use strict') {
+                    if ((!node_js && xmode !== 'script') || funct !== global_funct || array.length > 0) {
+                        warn('function_strict');
+                    }
+                    use_strict();
+                }
+                if (disruptor) {
+                    warn('unreachable_a_b', next_token, next_token.string,
+                        disruptor.string);
+                    disruptor = null;
+                }
+                the_statement = statement();
+                if (the_statement) {
+                    array.push(the_statement);
+                    if (the_statement.disrupt) {
+                        disruptor = the_statement;
+                        array.disrupt = true;
+                    }
+                }
+            }
+        }
+        return array;
+    }
+
+
+    function block(ordinary) {
+
+// array block is array sequence of statements wrapped in braces.
+// ordinary is false for function bodies and try blocks.
+// ordinary is true for if statements, while, etc.
+
+        var array,
+            curly = next_token,
+            old_in_block = in_block,
+            old_scope = scope,
+            old_strict_mode = strict_mode;
+
+        in_block = ordinary;
+        scope = Object.create(scope);
+        spaces();
+        if (next_token.id === '{') {
+            advance('{');
+            step_in();
+            if (!ordinary && !use_strict() && !old_strict_mode &&
+                    !option.sloppy && funct['(context)'] === global_funct) {
+                warn('missing_use_strict');
+            }
+            array = statements();
+            strict_mode = old_strict_mode;
+            step_out('}', curly);
+        } else if (!ordinary) {
+            stop('expected_a_b', next_token, '{', artifact());
+        } else {
+            warn('expected_a_b', next_token, '{', artifact());
+            array = [statement()];
+            array.disrupt = array[0].disrupt;
+        }
+        funct['(verb)'] = null;
+        scope = old_scope;
+        in_block = old_in_block;
+        if (ordinary && array.length === 0) {
+            warn('empty_block');
+        }
+        return array;
+    }
+
+
+    function tally_property(name) {
+        if (option.properties && typeof property[name] !== 'number') {
+            warn('unexpected_property_a', token, name);
+        }
+        if (typeof property[name] === 'number') {
+            property[name] += 1;
+        } else {
+            property[name] = 1;
+        }
+    }
+
+
+// ECMAScript parser
+
+    syntax['(identifier)'] = {
+        id: '(identifier)',
+        lbp: 0,
+        identifier: true,
+        nud: function () {
+            var name = this.string,
+                variable = scope[name],
+                site,
+                writeable;
+
+// If the variable is not in scope, then we may have an undeclared variable.
+// Check the predefined list. If it was predefined, create the global
+// variable.
+
+            if (typeof variable !== 'object') {
+                writeable = predefined[name];
+                if (typeof writeable === 'boolean') {
+                    global_scope[name] = variable = {
+                        string:    name,
+                        writeable: writeable,
+                        funct:     global_funct
+                    };
+                    global_funct[name] = 'var';
+
+// But if the variable is not in scope, and is not predefined, and if we are not
+// in the global scope, then we have an undefined variable error.
+
+                } else {
+                    if (!option.undef) {
+                        warn('used_before_a', token);
+                    }
+                    scope[name] = variable = {
+                        string: name,
+                        writeable: true,
+                        funct: funct
+                    };
+                    funct[name] = 'undef';
+                }
+
+            }
+            site = variable.funct;
+
+// The name is in scope and defined in the current function.
+
+            if (funct === site) {
+
+//      Change 'unused' to 'var', and reject labels.
+
+                switch (funct[name]) {
+                case 'becoming':
+                    warn('unexpected_a', token);
+                    funct[name] = 'var';
+                    break;
+                case 'unused':
+                    funct[name] = 'var';
+                    break;
+                case 'unparam':
+                    funct[name] = 'parameter';
+                    break;
+                case 'unction':
+                    funct[name] = 'function';
+                    break;
+                case 'label':
+                    warn('a_label', token, name);
+                    break;
+                }
+
+// If the name is already defined in the current
+// function, but not as outer, then there is a scope error.
+
+            } else {
+                switch (funct[name]) {
+                case 'closure':
+                case 'function':
+                case 'var':
+                case 'unused':
+                    warn('a_scope', token, name);
+                    break;
+                case 'label':
+                    warn('a_label', token, name);
+                    break;
+                case 'outer':
+                case 'global':
+                    break;
+                default:
+
+// If the name is defined in an outer function, make an outer entry, and if
+// it was unused, make it var.
+
+                    switch (site[name]) {
+                    case 'becoming':
+                    case 'closure':
+                    case 'function':
+                    case 'parameter':
+                    case 'unction':
+                    case 'unused':
+                    case 'var':
+                        site[name] = 'closure';
+                        funct[name] = site === global_funct
+                            ? 'global'
+                            : 'outer';
+                        break;
+                    case 'unparam':
+                        site[name] = 'parameter';
+                        funct[name] = 'outer';
+                        break;
+                    case 'undef':
+                        funct[name] = 'undef';
+                        break;
+                    case 'label':
+                        warn('a_label', token, name);
+                        break;
+                    }
+                }
+            }
+            return this;
+        },
+        led: function () {
+            stop('expected_operator_a');
+        }
+    };
+
+// Build the syntax table by declaring the syntactic elements.
+
+    type('(array)', 'array');
+    type('(color)', 'color');
+    type('(function)', 'function');
+    type('(number)', 'number', return_this);
+    type('(object)', 'object');
+    type('(string)', 'string', return_this);
+    type('(boolean)', 'boolean', return_this);
+    type('(range)', 'range');
+    type('(regexp)', 'regexp', return_this);
+
+    ultimate('(begin)');
+    ultimate('(end)');
+    ultimate('(error)');
+    postscript(symbol('</'));
+    symbol('<!');
+    symbol('<!--');
+    symbol('-->');
+    postscript(symbol('}'));
+    symbol(')');
+    symbol(']');
+    postscript(symbol('"'));
+    postscript(symbol('\''));
+    symbol(';');
+    symbol(':');
+    symbol(',');
+    symbol('#');
+    symbol('@');
+    symbol('*/');
+    postscript(reserve('case'));
+    reserve('catch');
+    postscript(reserve('default'));
+    reserve('else');
+    reserve('finally');
+
+    reservevar('arguments', function (x) {
+        if (strict_mode && funct === global_funct) {
+            warn('strict', x);
+        } else if (option.safe) {
+            warn('adsafe_a', x);
+        }
+        funct['(arguments)'] = true;
+    });
+    reservevar('eval', function (x) {
+        if (option.safe) {
+            warn('adsafe_a', x);
+        }
+    });
+    constant('false', 'boolean');
+    constant('Infinity', 'number');
+    constant('NaN', 'number');
+    constant('null', '');
+    reservevar('this', function (x) {
+        if (option.safe) {
+            warn('adsafe_a', x);
+        } else if (strict_mode && funct['(token)'].arity === 'statement' &&
+                funct['(name)'].charAt(0) > 'Z') {
+            warn('strict', x);
+        }
+    });
+    constant('true', 'boolean');
+    constant('undefined', '');
+
+    infix('?', 30, function (left, that) {
+        step_in('?');
+        that.first = expected_condition(expected_relation(left));
+        that.second = expression(0);
+        spaces();
+        step_out();
+        var colon = next_token;
+        advance(':');
+        step_in(':');
+        spaces();
+        that.third = expression(10);
+        that.arity = 'ternary';
+        if (are_similar(that.second, that.third)) {
+            warn('weird_ternary', colon);
+        } else if (are_similar(that.first, that.second)) {
+            warn('use_or', that);
+        }
+        step_out();
+        return that;
+    });
+
+    infix('||', 40, function (left, that) {
+        function paren_check(that) {
+            if (that.id === '&&' && !that.paren) {
+                warn('and', that);
+            }
+            return that;
+        }
+
+        that.first = paren_check(expected_condition(expected_relation(left)));
+        that.second = paren_check(expected_relation(expression(40)));
+        if (are_similar(that.first, that.second)) {
+            warn('weird_condition', that);
+        }
+        return that;
+    });
+
+    infix('&&', 50, function (left, that) {
+        that.first = expected_condition(expected_relation(left));
+        that.second = expected_relation(expression(50));
+        if (are_similar(that.first, that.second)) {
+            warn('weird_condition', that);
+        }
+        return that;
+    });
+
+    prefix('void', function () {
+        this.first = expression(0);
+        this.arity = 'prefix';
+        if (option.es5) {
+            warn('expected_a_b', this, 'undefined', 'void');
+        } else if (this.first.number !== 0) {
+            warn('expected_a_b', this.first, '0', artifact(this.first));
+        }
+        return this;
+    });
+
+    bitwise('|', 70);
+    bitwise('^', 80);
+    bitwise('&', 90);
+
+    relation('==', '===');
+    relation('===');
+    relation('!=', '!==');
+    relation('!==');
+    relation('<');
+    relation('>');
+    relation('<=');
+    relation('>=');
+
+    bitwise('<<', 120);
+    bitwise('>>', 120);
+    bitwise('>>>', 120);
+
+    infix('in', 120, function (left, that) {
+        warn('infix_in', that);
+        that.left = left;
+        that.right = expression(130);
+        return that;
+    });
+    infix('instanceof', 120);
+    infix('+', 130, function (left, that) {
+        if (left.id === '(number)') {
+            if (left.number === 0) {
+                warn('unexpected_a', left, '0');
+            }
+        } else if (left.id === '(string)') {
+            if (left.string === '') {
+                warn('expected_a_b', left, 'String', '\'\'');
+            }
+        }
+        var right = expression(130);
+        if (right.id === '(number)') {
+            if (right.number === 0) {
+                warn('unexpected_a', right, '0');
+            }
+        } else if (right.id === '(string)') {
+            if (right.string === '') {
+                warn('expected_a_b', right, 'String', '\'\'');
+            }
+        }
+        if (left.id === right.id) {
+            if (left.id === '(string)' || left.id === '(number)') {
+                if (left.id === '(string)') {
+                    left.string += right.string;
+                    if (jx.test(left.string)) {
+                        warn('url', left);
+                    }
+                } else {
+                    left.number += right.number;
+                }
+                left.thru = right.thru;
+                return left;
+            }
+        }
+        that.first = left;
+        that.second = right;
+        return that;
+    });
+    prefix('+', 'num');
+    prefix('+++', function () {
+        warn('confusing_a', token);
+        this.first = expression(150);
+        this.arity = 'prefix';
+        return this;
+    });
+    infix('+++', 130, function (left) {
+        warn('confusing_a', token);
+        this.first = left;
+        this.second = expression(130);
+        return this;
+    });
+    infix('-', 130, function (left, that) {
+        if ((left.id === '(number)' && left.number === 0) || left.id === '(string)') {
+            warn('unexpected_a', left);
+        }
+        var right = expression(130);
+        if ((right.id === '(number)' && right.number === 0) || right.id === '(string)') {
+            warn('unexpected_a', right);
+        }
+        if (left.id === right.id && left.id === '(number)') {
+            left.number -= right.number;
+            left.thru = right.thru;
+            return left;
+        }
+        that.first = left;
+        that.second = right;
+        return that;
+    });
+    prefix('-');
+    prefix('---', function () {
+        warn('confusing_a', token);
+        this.first = expression(150);
+        this.arity = 'prefix';
+        return this;
+    });
+    infix('---', 130, function (left) {
+        warn('confusing_a', token);
+        this.first = left;
+        this.second = expression(130);
+        return this;
+    });
+    infix('*', 140, function (left, that) {
+        if ((left.id === '(number)' && (left.number === 0 || left.number === 1)) || left.id === '(string)') {
+            warn('unexpected_a', left);
+        }
+        var right = expression(140);
+        if ((right.id === '(number)' && (right.number === 0 || right.number === 1)) || right.id === '(string)') {
+            warn('unexpected_a', right);
+        }
+        if (left.id === right.id && left.id === '(number)') {
+            left.number *= right.number;
+            left.thru = right.thru;
+            return left;
+        }
+        that.first = left;
+        that.second = right;
+        return that;
+    });
+    infix('/', 140, function (left, that) {
+        if ((left.id === '(number)' && left.number === 0) || left.id === '(string)') {
+            warn('unexpected_a', left);
+        }
+        var right = expression(140);
+        if ((right.id === '(number)' && (right.number === 0 || right.number === 1)) || right.id === '(string)') {
+            warn('unexpected_a', right);
+        }
+        if (left.id === right.id && left.id === '(number)') {
+            left.number /= right.number;
+            left.thru = right.thru;
+            return left;
+        }
+        that.first = left;
+        that.second = right;
+        return that;
+    });
+    infix('%', 140, function (left, that) {
+        if ((left.id === '(number)' && (left.number === 0 || left.number === 1)) || left.id === '(string)') {
+            warn('unexpected_a', left);
+        }
+        var right = expression(140);
+        if ((right.id === '(number)' && right.number === 0) || right.id === '(string)') {
+            warn('unexpected_a', right);
+        }
+        if (left.id === right.id && left.id === '(number)') {
+            left.number %= right.number;
+            left.thru = right.thru;
+            return left;
+        }
+        that.first = left;
+        that.second = right;
+        return that;
+    });
+
+    suffix('++');
+    prefix('++');
+
+    suffix('--');
+    prefix('--');
+    prefix('delete', function () {
+        one_space();
+        var p = expression(0);
+        if (!p || (p.id !== '.' && p.id !== '[')) {
+            warn('deleted');
+        }
+        this.first = p;
+        return this;
+    });
+
+
+    prefix('~', function () {
+        no_space_only();
+        if (!option.bitwise) {
+            warn('unexpected_a', this);
+        }
+        expression(150);
+        return this;
+    });
+    prefix('!', function () {
+        no_space_only();
+        this.first = expected_condition(expression(150));
+        this.arity = 'prefix';
+        if (bang[this.first.id] === true || this.first.assign) {
+            warn('confusing_a', this);
+        }
+        return this;
+    });
+    prefix('typeof', null);
+    prefix('new', function () {
+        one_space();
+        var c = expression(160), n, p, v;
+        this.first = c;
+        if (c.id !== 'function') {
+            if (c.identifier) {
+                switch (c.string) {
+                case 'Object':
+                    warn('use_object', token);
+                    break;
+                case 'Array':
+                    if (next_token.id === '(') {
+                        p = next_token;
+                        p.first = this;
+                        advance('(');
+                        if (next_token.id !== ')') {
+                            n = expression(0);
+                            p.second = [n];
+                            if (n.id !== '(number)' || next_token.id === ',') {
+                                warn('use_array', p);
+                            }
+                            while (next_token.id === ',') {
+                                advance(',');
+                                p.second.push(expression(0));
+                            }
+                        } else {
+                            warn('use_array', token);
+                        }
+                        advance(')', p);
+                        return p;
+                    }
+                    warn('use_array', token);
+                    break;
+                case 'Number':
+                case 'String':
+                case 'Boolean':
+                case 'Math':
+                case 'JSON':
+                    warn('not_a_constructor', c);
+                    break;
+                case 'Function':
+                    if (!option.evil) {
+                        warn('function_eval');
+                    }
+                    break;
+                case 'Date':
+                case 'RegExp':
+                case 'this':
+                    break;
+                default:
+                    if (c.id !== 'function') {
+                        v = c.string.charAt(0);
+                        if (!option.newcap && (v < 'A' || v > 'Z')) {
+                            warn('constructor_name_a', token);
+                        }
+                    }
+                }
+            } else {
+                if (c.id !== '.' && c.id !== '[' && c.id !== '(') {
+                    warn('bad_constructor', token);
+                }
+            }
+        } else {
+            warn('weird_new', this);
+        }
+        if (next_token.id !== '(') {
+            warn('missing_a', next_token, '()');
+        }
+        return this;
+    });
+
+    infix('(', 160, function (left, that) {
+        var p;
+        if (indent && indent.mode === 'expression') {
+            no_space(prev_token, token);
+        } else {
+            no_space_only(prev_token, token);
+        }
+        if (!left.immed && left.id === 'function') {
+            warn('wrap_immediate');
+        }
+        p = [];
+        if (left.identifier) {
+            if (left.string.match(/^[A-Z]([A-Z0-9_$]*[a-z][A-Za-z0-9_$]*)?$/)) {
+                if (left.string !== 'Number' && left.string !== 'String' &&
+                        left.string !== 'Boolean' && left.string !== 'Date') {
+                    if (left.string === 'Math' || left.string === 'JSON') {
+                        warn('not_a_function', left);
+                    } else if (left.string === 'Object') {
+                        warn('use_object', token);
+                    } else if (left.string === 'Array' || !option.newcap) {
+                        warn('missing_a', left, 'new');
+                    }
+                }
+            }
+        } else if (left.id === '.') {
+            if (option.safe && left.first.string === 'Math' &&
+                    left.second === 'random') {
+                warn('adsafe_a', left);
+            } else if (left.second.string === 'split' &&
+                    left.first.id === '(string)') {
+                warn('use_array', left.second);
+            }
+        }
+        step_in();
+        if (next_token.id !== ')') {
+            no_space();
+            for (;;) {
+                edge();
+                p.push(expression(10));
+                if (next_token.id !== ',') {
+                    break;
+                }
+                comma();
+            }
+        }
+        no_space();
+        step_out(')', that);
+        if (typeof left === 'object') {
+            if (left.string === 'parseInt' && p.length === 1) {
+                warn('radix', left);
+            }
+            if (!option.evil) {
+                if (left.string === 'eval' || left.string === 'Function' ||
+                        left.string === 'execScript') {
+                    warn('evil', left);
+                } else if (p[0] && p[0].id === '(string)' &&
+                        (left.string === 'setTimeout' ||
+                        left.string === 'setInterval')) {
+                    warn('implied_evil', left);
+                }
+            }
+            if (!left.identifier && left.id !== '.' && left.id !== '[' &&
+                    left.id !== '(' && left.id !== '&&' && left.id !== '||' &&
+                    left.id !== '?') {
+                warn('bad_invocation', left);
+            }
+        }
+        that.first = left;
+        that.second = p;
+        return that;
+    }, true);
+
+    prefix('(', function () {
+        step_in('expression');
+        no_space();
+        edge();
+        if (next_token.id === 'function') {
+            next_token.immed = true;
+        }
+        var value = expression(0);
+        value.paren = true;
+        no_space();
+        step_out(')', this);
+        if (value.id === 'function') {
+            switch (next_token.id) {
+            case '(':
+                warn('move_invocation');
+                break;
+            case '.':
+            case '[':
+                warn('unexpected_a');
+                break;
+            default:
+                warn('bad_wrap', this);
+            }
+        }
+        return value;
+    });
+
+    infix('.', 170, function (left, that) {
+        no_space(prev_token, token);
+        no_space();
+        var name = identifier();
+        if (typeof name === 'string') {
+            tally_property(name);
+        }
+        that.first = left;
+        that.second = token;
+        if (left && left.string === 'arguments' &&
+                (name === 'callee' || name === 'caller')) {
+            warn('avoid_a', left, 'arguments.' + name);
+        } else if (!option.evil && left && left.string === 'document' &&
+                (name === 'write' || name === 'writeln')) {
+            warn('write_is_wrong', left);
+        } else if (option.adsafe) {
+            if (!adsafe_top && left.string === 'ADSAFE') {
+                if (name === 'id' || name === 'lib') {
+                    warn('adsafe_a', that);
+                } else if (name === 'go') {
+                    if (xmode !== 'script') {
+                        warn('adsafe_a', that);
+                    } else if (adsafe_went || next_token.id !== '(' ||
+                            peek(0).id !== '(string)' ||
+                            peek(0).string !== adsafe_id ||
+                            peek(1).id !== ',') {
+                        stop('adsafe_a', that, 'go');
+                    }
+                    adsafe_went = true;
+                    adsafe_may = false;
+                }
+            }
+            adsafe_top = false;
+        }
+        if (!option.evil && (name === 'eval' || name === 'execScript')) {
+            warn('evil');
+        } else if (option.safe) {
+            for (;;) {
+                if (banned[name] === true) {
+                    warn('adsafe_a', token, name);
+                }
+                if (typeof predefined[left.string] !== 'boolean' ||    //// check for writeable
+                        next_token.id === '(') {
+                    break;
+                }
+                if (next_token.id !== '.') {
+                    warn('adsafe_a', that);
+                    break;
+                }
+                advance('.');
+                token.first = that;
+                token.second = name;
+                that = token;
+                name = identifier();
+                if (typeof name === 'string') {
+                    tally_property(name);
+                }
+            }
+        }
+        return that;
+    }, true);
+
+    infix('[', 170, function (left, that) {
+        var e, s;
+        no_space_only(prev_token, token);
+        no_space();
+        step_in();
+        edge();
+        e = expression(0);
+        switch (e.id) {
+        case '(number)':
+            if (e.id === '(number)' && left.id === 'arguments') {
+                warn('use_param', left);
+            }
+            break;
+        case '(string)':
+            if (option.safe && (banned[e.string] ||
+                    e.string.charAt(0) === '_' || e.string.slice(-1) === '_')) {
+                warn('adsafe_subscript_a', e);
+            } else if (!option.evil &&
+                    (e.string === 'eval' || e.string === 'execScript')) {
+                warn('evil', e);
+            } else if (!option.sub && ix.test(e.string)) {
+                s = syntax[e.string];
+                if (!s || !s.reserved) {
+                    warn('subscript', e);
+                }
+            }
+            tally_property(e.string);
+            break;
+        default:
+            if (option.safe) {
+                warn('adsafe_subscript_a', e);
+            }
+        }
+        step_out(']', that);
+        no_space(prev_token, token);
+        that.first = left;
+        that.second = e;
+        return that;
+    }, true);
+
+    prefix('[', function () {
+        this.arity = 'prefix';
+        this.first = [];
+        step_in('array');
+        while (next_token.id !== '(end)') {
+            while (next_token.id === ',') {
+                warn('unexpected_a', next_token);
+                advance(',');
+            }
+            if (next_token.id === ']') {
+                break;
+            }
+            indent.wrap = false;
+            edge();
+            this.first.push(expression(10));
+            if (next_token.id === ',') {
+                comma();
+                if (next_token.id === ']' && !option.es5) {
+                    warn('unexpected_a', token);
+                    break;
+                }
+            } else {
+                break;
+            }
+        }
+        step_out(']', this);
+        return this;
+    }, 170);
+
+
+    function property_name() {
+        var id = optional_identifier(true);
+        if (!id) {
+            if (next_token.id === '(string)') {
+                id = next_token.string;
+                if (option.safe) {
+                    if (banned[id]) {
+                        warn('adsafe_a');
+                    } else if (id.charAt(0) === '_' ||
+                            id.charAt(id.length - 1) === '_') {
+                        warn('dangling_a');
+                    }
+                }
+                advance();
+            } else if (next_token.id === '(number)') {
+                id = next_token.number.toString();
+                advance();
+            }
+        }
+        return id;
+    }
+
+
+    function function_params() {
+        var id, paren = next_token, params = [];
+        advance('(');
+        step_in();
+        no_space();
+        if (next_token.id === ')') {
+            no_space();
+            step_out(')', paren);
+            return params;
+        }
+        for (;;) {
+            edge();
+            id = identifier();
+            params.push(token);
+            add_label(token, option.unparam ? 'parameter' : 'unparam');
+            if (next_token.id === ',') {
+                comma();
+            } else {
+                no_space();
+                step_out(')', paren);
+                return params;
+            }
+        }
+    }
+
+
+
+    function do_function(func, name) {
+        var old_funct      = funct,
+            old_option     = option,
+            old_scope      = scope;
+        funct = {
+            '(name)'     : name || '\'' + (anonname || '').replace(nx, sanitize) + '\'',
+            '(line)'     : next_token.line,
+            '(context)'  : old_funct,
+            '(breakage)' : 0,
+            '(loopage)'  : 0,
+            '(scope)'    : scope,
+            '(token)'    : func
+        };
+        option = Object.create(old_option);
+        scope = Object.create(old_scope);
+        functions.push(funct);
+        func.name = name;
+        if (name) {
+            add_label(func, 'function', name);
+        }
+        func.writeable = false;
+        func.first = funct['(params)'] = function_params();
+        one_space();
+        func.block = block(false);
+        if (funct['(arguments)']) {
+            func.first.forEach(function (value) {
+                if (value.assign) {
+                    warn('parameter_arguments_a', value, value.string);
+                }
+            });
+        }
+        funct      = old_funct;
+        option     = old_option;
+        scope      = old_scope;
+    }
+
+
+    assignop('=');
+    assignop('+=', '+');
+    assignop('-=', '-');
+    assignop('*=', '*');
+    assignop('/=', '/').nud = function () {
+        stop('slash_equal');
+    };
+    assignop('%=', '%');
+    assignop('&=', '&');
+    assignop('|=', '|');
+    assignop('^=', '^');
+    assignop('<<=', '<<');
+    assignop('>>=', '>>');
+    assignop('>>>=', '>>>');
+
+
+    prefix('{', function () {
+        var get, i, j, name, p, set, seen = {};
+        this.arity = 'prefix';
+        this.first = [];
+        step_in();
+        while (next_token.id !== '}') {
+            indent.wrap = false;
+
+// JSLint recognizes the ES5 extension for get/set in object literals,
+// but requires that they be used in pairs.
+
+            edge();
+            if (next_token.string === 'get' && peek().id !== ':') {
+                if (!option.es5) {
+                    warn('es5');
+                }
+                get = next_token;
+                advance('get');
+                one_space_only();
+                name = next_token;
+                i = property_name();
+                if (!i) {
+                    stop('missing_property');
+                }
+                get.string = '';
+                do_function(get);
+                if (funct['(loopage)']) {
+                    warn('function_loop', get);
+                }
+                p = get.first;
+                if (p) {
+                    warn('parameter_a_get_b', p[0], p[0].string, i);
+                }
+                comma();
+                set = next_token;
+                spaces();
+                edge();
+                advance('set');
+                set.string = '';
+                one_space_only();
+                j = property_name();
+                if (i !== j) {
+                    stop('expected_a_b', token, i, j || next_token.string);
+                }
+                do_function(set);
+                if (set.block.length === 0) {
+                    warn('missing_a', token, 'throw');
+                }
+                p = set.first;
+                if (!p || p.length !== 1) {
+                    stop('parameter_set_a', set, 'value');
+                } else if (p[0].string !== 'value') {
+                    stop('expected_a_b', p[0], 'value', p[0].string);
+                }
+                name.first = [get, set];
+            } else {
+                name = next_token;
+                i = property_name();
+                if (typeof i !== 'string') {
+                    stop('missing_property');
+                }
+                advance(':');
+                spaces();
+                name.first = expression(10);
+            }
+            this.first.push(name);
+            if (seen[i] === true) {
+                warn('duplicate_a', next_token, i);
+            }
+            seen[i] = true;
+            tally_property(i);
+            if (next_token.id !== ',') {
+                break;
+            }
+            for (;;) {
+                comma();
+                if (next_token.id !== ',') {
+                    break;
+                }
+                warn('unexpected_a', next_token);
+            }
+            if (next_token.id === '}' && !option.es5) {
+                warn('unexpected_a', token);
+            }
+        }
+        step_out('}', this);
+        return this;
+    });
+
+    stmt('{', function () {
+        warn('statement_block');
+        this.arity = 'statement';
+        this.block = statements();
+        this.disrupt = this.block.disrupt;
+        advance('}', this);
+        return this;
+    });
+
+    stmt('/*global', directive);
+    stmt('/*globals', directive);
+    stmt('/*jslint', directive);
+    stmt('/*member', directive);
+    stmt('/*members', directive);
+    stmt('/*property', directive);
+    stmt('/*properties', directive);
+
+    stmt('var', function () {
+
+// JavaScript does not have block scope. It only has function scope. So,
+// declaring a variable in a block can have unexpected consequences.
+
+// var.first will contain an array, the array containing name tokens
+// and assignment tokens.
+
+        var assign, id, name;
+
+        if (funct['(vars)'] && !option.vars) {
+            warn('combine_var');
+        } else if (funct !== global_funct) {
+            funct['(vars)'] = true;
+        }
+        this.arity = 'statement';
+        this.first = [];
+        step_in('var');
+        for (;;) {
+            name = next_token;
+            id = identifier();
+            add_label(name, 'becoming');
+
+            if (next_token.id === '=') {
+                assign = next_token;
+                assign.first = name;
+                spaces();
+                advance('=');
+                spaces();
+                if (next_token.id === 'undefined') {
+                    warn('unnecessary_initialize', token, id);
+                }
+                if (peek(0).id === '=' && next_token.identifier) {
+                    stop('var_a_not');
+                }
+                assign.second = expression(0);
+                assign.arity = 'infix';
+                this.first.push(assign);
+            } else {
+                this.first.push(name);
+            }
+            if (funct[id] === 'becoming') {
+                funct[id] = 'unused';
+            }
+            if (next_token.id !== ',') {
+                break;
+            }
+            comma();
+            indent.wrap = false;
+            if (var_mode && next_token.line === token.line &&
+                    this.first.length === 1) {
+                var_mode = null;
+                indent.open = false;
+                indent.at -= option.indent;
+            }
+            spaces();
+            edge();
+        }
+        var_mode = null;
+        step_out();
+        return this;
+    });
+
+    stmt('function', function () {
+        one_space();
+        if (in_block) {
+            warn('function_block', token);
+        }
+        var name = next_token, id = identifier();
+        add_label(name, 'unction');
+        no_space();
+        this.arity = 'statement';
+        do_function(this, id);
+        if (next_token.id === '(' && next_token.line === token.line) {
+            stop('function_statement');
+        }
+        return this;
+    });
+
+    prefix('function', function () {
+        if (!option.anon) {
+            one_space();
+        }
+        var id = optional_identifier();
+        if (id) {
+            no_space();
+        } else {
+            id = '';
+        }
+        do_function(this, id);
+        if (funct['(loopage)']) {
+            warn('function_loop');
+        }
+        switch (next_token.id) {
+        case ';':
+        case '(':
+        case ')':
+        case ',':
+        case ']':
+        case '}':
+        case ':':
+            break;
+        case '.':
+            if (peek().string !== 'bind' || peek(1).id !== '(') {
+                warn('unexpected_a');
+            }
+            break;
+        default:
+            stop('unexpected_a');
+        }
+        this.arity = 'function';
+        return this;
+    });
+
+    stmt('if', function () {
+        var paren = next_token;
+        one_space();
+        advance('(');
+        step_in('control');
+        no_space();
+        edge();
+        this.arity = 'statement';
+        this.first = expected_condition(expected_relation(expression(0)));
+        no_space();
+        step_out(')', paren);
+        one_space();
+        this.block = block(true);
+        if (next_token.id === 'else') {
+            one_space();
+            advance('else');
+            one_space();
+            this['else'] = next_token.id === 'if' || next_token.id === 'switch'
+                ? statement(true)
+                : block(true);
+            if (this['else'].disrupt && this.block.disrupt) {
+                this.disrupt = true;
+            }
+        }
+        return this;
+    });
+
+    stmt('try', function () {
+
+// try.first    The catch variable
+// try.second   The catch clause
+// try.third    The finally clause
+// try.block    The try block
+
+        var exception_variable, old_scope, paren;
+        if (option.adsafe) {
+            warn('adsafe_a', this);
+        }
+        one_space();
+        this.arity = 'statement';
+        this.block = block(false);
+        if (next_token.id === 'catch') {
+            one_space();
+            advance('catch');
+            one_space();
+            paren = next_token;
+            advance('(');
+            step_in('control');
+            no_space();
+            edge();
+            old_scope = scope;
+            scope = Object.create(old_scope);
+            exception_variable = next_token.string;
+            this.first = exception_variable;
+            if (!next_token.identifier) {
+                warn('expected_identifier_a', next_token);
+            } else {
+                add_label(next_token, 'exception');
+            }
+            advance();
+            no_space();
+            step_out(')', paren);
+            one_space();
+            this.second = block(false);
+            scope = old_scope;
+        }
+        if (next_token.id === 'finally') {
+            one_space();
+            advance('finally');
+            one_space();
+            this.third = block(false);
+        } else if (!this.second) {
+            stop('expected_a_b', next_token, 'catch', artifact());
+        }
+        return this;
+    });
+
+    labeled_stmt('while', function () {
+        one_space();
+        var paren = next_token;
+        funct['(breakage)'] += 1;
+        funct['(loopage)'] += 1;
+        advance('(');
+        step_in('control');
+        no_space();
+        edge();
+        this.arity = 'statement';
+        this.first = expected_relation(expression(0));
+        if (this.first.id !== 'true') {
+            expected_condition(this.first, bundle.unexpected_a);
+        }
+        no_space();
+        step_out(')', paren);
+        one_space();
+        this.block = block(true);
+        if (this.block.disrupt) {
+            warn('strange_loop', prev_token);
+        }
+        funct['(breakage)'] -= 1;
+        funct['(loopage)'] -= 1;
+        return this;
+    });
+
+    reserve('with');
+
+    labeled_stmt('switch', function () {
+
+// switch.first         the switch expression
+// switch.second        the array of cases. A case is 'case' or 'default' token:
+//    case.first        the array of case expressions
+//    case.second       the array of statements
+// If all of the arrays of statements are disrupt, then the switch is disrupt.
+
+        var cases = [],
+            old_in_block = in_block,
+            particular,
+            the_case = next_token,
+            unbroken = true;
+
+        function find_duplicate_case(value) {
+            if (are_similar(particular, value)) {
+                warn('duplicate_a', value);
+            }
+        }
+
+        funct['(breakage)'] += 1;
+        one_space();
+        advance('(');
+        no_space();
+        step_in();
+        this.arity = 'statement';
+        this.first = expected_condition(expected_relation(expression(0)));
+        no_space();
+        step_out(')', the_case);
+        one_space();
+        advance('{');
+        step_in();
+        in_block = true;
+        this.second = [];
+        while (next_token.id === 'case') {
+            the_case = next_token;
+            cases.forEach(find_duplicate_case);
+            the_case.first = [];
+            the_case.arity = 'case';
+            spaces();
+            edge('case');
+            advance('case');
+            for (;;) {
+                one_space();
+                particular = expression(0);
+                cases.forEach(find_duplicate_case);
+                cases.push(particular);
+                the_case.first.push(particular);
+                if (particular.id === 'NaN') {
+                    warn('unexpected_a', particular);
+                }
+                no_space_only();
+                advance(':');
+                if (next_token.id !== 'case') {
+                    break;
+                }
+                spaces();
+                edge('case');
+                advance('case');
+            }
+            spaces();
+            the_case.second = statements();
+            if (the_case.second && the_case.second.length > 0) {
+                particular = the_case.second[the_case.second.length - 1];
+                if (particular.disrupt) {
+                    if (particular.id === 'break') {
+                        unbroken = false;
+                    }
+                } else {
+                    warn('missing_a_after_b', next_token, 'break', 'case');
+                }
+            } else {
+                warn('empty_case');
+            }
+            this.second.push(the_case);
+        }
+        if (this.second.length === 0) {
+            warn('missing_a', next_token, 'case');
+        }
+        if (next_token.id === 'default') {
+            spaces();
+            the_case = next_token;
+            the_case.arity = 'case';
+            edge('case');
+            advance('default');
+            no_space_only();
+            advance(':');
+            spaces();
+            the_case.second = statements();
+            if (the_case.second && the_case.second.length > 0) {
+                particular = the_case.second[the_case.second.length - 1];
+                if (unbroken && particular.disrupt && particular.id !== 'break') {
+                    this.disrupt = true;
+                }
+            }
+            this.second.push(the_case);
+        }
+        funct['(breakage)'] -= 1;
+        spaces();
+        step_out('}', this);
+        in_block = old_in_block;
+        return this;
+    });
+
+    stmt('debugger', function () {
+        if (!option.debug) {
+            warn('unexpected_a', this);
+        }
+        this.arity = 'statement';
+        return this;
+    });
+
+    labeled_stmt('do', function () {
+        funct['(breakage)'] += 1;
+        funct['(loopage)'] += 1;
+        one_space();
+        this.arity = 'statement';
+        this.block = block(true);
+        if (this.block.disrupt) {
+            warn('strange_loop', prev_token);
+        }
+        one_space();
+        advance('while');
+        var paren = next_token;
+        one_space();
+        advance('(');
+        step_in();
+        no_space();
+        edge();
+        this.first = expected_condition(expected_relation(expression(0)), bundle.unexpected_a);
+        no_space();
+        step_out(')', paren);
+        funct['(breakage)'] -= 1;
+        funct['(loopage)'] -= 1;
+        return this;
+    });
+
+    labeled_stmt('for', function () {
+
+        var blok, filter, ok = false, paren = next_token, value;
+        this.arity = 'statement';
+        funct['(breakage)'] += 1;
+        funct['(loopage)'] += 1;
+        advance('(');
+        if (next_token.id === ';') {
+            no_space();
+            advance(';');
+            no_space();
+            advance(';');
+            no_space();
+            advance(')');
+            blok = block(true);
+        } else {
+            step_in('control');
+            spaces(this, paren);
+            no_space();
+            if (next_token.id === 'var') {
+                stop('move_var');
+            }
+            edge();
+            if (peek(0).id === 'in') {
+                this.forin = true;
+                value = next_token;
+                switch (funct[value.string]) {
+                case 'unused':
+                    funct[value.string] = 'var';
+                    break;
+                case 'closure':
+                case 'var':
+                    break;
+                default:
+                    warn('bad_in_a', value);
+                }
+                advance();
+                advance('in');
+                this.first = value;
+                this.second = expression(20);
+                step_out(')', paren);
+                blok = block(true);
+                if (!option.forin) {
+                    if (blok.length === 1 && typeof blok[0] === 'object' &&
+                            blok[0].string === 'if' && !blok[0]['else']) {
+                        filter = blok[0].first;
+                        while (filter.id === '&&') {
+                            filter = filter.first;
+                        }
+                        switch (filter.id) {
+                        case '===':
+                        case '!==':
+                            ok = filter.first.id === '['
+                                ? filter.first.first.string === this.second.string &&
+                                    filter.first.second.string === this.first.string
+                                : filter.first.id === 'typeof' &&
+                                    filter.first.first.id === '[' &&
+                                    filter.first.first.first.string === this.second.string &&
+                                    filter.first.first.second.string === this.first.string;
+                            break;
+                        case '(':
+                            ok = filter.first.id === '.' && ((
+                                filter.first.first.string === this.second.string &&
+                                filter.first.second.string === 'hasOwnProperty' &&
+                                filter.second[0].string === this.first.string
+                            ) || (
+                                filter.first.first.string === 'ADSAFE' &&
+                                filter.first.second.string === 'has' &&
+                                filter.second[0].string === this.second.string &&
+                                filter.second[1].string === this.first.string
+                            ) || (
+                                filter.first.first.id === '.' &&
+                                filter.first.first.first.id === '.' &&
+                                filter.first.first.first.first.string === 'Object' &&
+                                filter.first.first.first.second.string === 'prototype' &&
+                                filter.first.first.second.string === 'hasOwnProperty' &&
+                                filter.first.second.string === 'call' &&
+                                filter.second[0].string === this.second.string &&
+                                filter.second[1].string === this.first.string
+                            ));
+                            break;
+                        }
+                    }
+                    if (!ok) {
+                        warn('for_if', this);
+                    }
+                }
+            } else {
+                edge();
+                this.first = [];
+                for (;;) {
+                    this.first.push(expression(0, 'for'));
+                    if (next_token.id !== ',') {
+                        break;
+                    }
+                    comma();
+                }
+                semicolon();
+                edge();
+                this.second = expected_relation(expression(0));
+                if (this.second.id !== 'true') {
+                    expected_condition(this.second, bundle.unexpected_a);
+                }
+                semicolon(token);
+                if (next_token.id === ';') {
+                    stop('expected_a_b', next_token, ')', ';');
+                }
+                this.third = [];
+                edge();
+                for (;;) {
+                    this.third.push(expression(0, 'for'));
+                    if (next_token.id !== ',') {
+                        break;
+                    }
+                    comma();
+                }
+                no_space();
+                step_out(')', paren);
+                one_space();
+                blok = block(true);
+            }
+        }
+        if (blok.disrupt) {
+            warn('strange_loop', prev_token);
+        }
+        this.block = blok;
+        funct['(breakage)'] -= 1;
+        funct['(loopage)'] -= 1;
+        return this;
+    });
+
+    disrupt_stmt('break', function () {
+        var label = next_token.string;
+        this.arity = 'statement';
+        if (funct['(breakage)'] === 0) {
+            warn('unexpected_a', this);
+        }
+        if (next_token.identifier && token.line === next_token.line) {
+            one_space_only();
+            if (funct[label] !== 'label') {
+                warn('not_a_label', next_token);
+            } else if (scope[label].funct !== funct) {
+                warn('not_a_scope', next_token);
+            }
+            this.first = next_token;
+            advance();
+        }
+        return this;
+    });
+
+    disrupt_stmt('continue', function () {
+        if (!option['continue']) {
+            warn('unexpected_a', this);
+        }
+        var label = next_token.string;
+        this.arity = 'statement';
+        if (funct['(breakage)'] === 0) {
+            warn('unexpected_a', this);
+        }
+        if (next_token.identifier && token.line === next_token.line) {
+            one_space_only();
+            if (funct[label] !== 'label') {
+                warn('not_a_label', next_token);
+            } else if (scope[label].funct !== funct) {
+                warn('not_a_scope', next_token);
+            }
+            this.first = next_token;
+            advance();
+        }
+        return this;
+    });
+
+    disrupt_stmt('return', function () {
+        if (funct === global_funct && xmode !== 'scriptstring') {
+            warn('unexpected_a', this);
+        }
+        this.arity = 'statement';
+        if (next_token.id !== ';' && next_token.line === token.line) {
+            one_space_only();
+            if (next_token.id === '/' || next_token.id === '(regexp)') {
+                warn('wrap_regexp');
+            }
+            this.first = expression(20);
+        }
+        if (peek(0).id === '}' && peek(1).id === 'else') {
+            warn('unexpected_else', this);
+        }
+        return this;
+    });
+
+    disrupt_stmt('throw', function () {
+        this.arity = 'statement';
+        one_space_only();
+        this.first = expression(20);
+        return this;
+    });
+
+
+//  Superfluous reserved words
+
+    reserve('class');
+    reserve('const');
+    reserve('enum');
+    reserve('export');
+    reserve('extends');
+    reserve('import');
+    reserve('super');
+
+// Harmony reserved words
+
+    reserve('implements');
+    reserve('interface');
+    reserve('let');
+    reserve('package');
+    reserve('private');
+    reserve('protected');
+    reserve('public');
+    reserve('static');
+    reserve('yield');
+
+
+// Parse JSON
+
+    function json_value() {
+
+        function json_object() {
+            var brace = next_token, object = {};
+            advance('{');
+            if (next_token.id !== '}') {
+                while (next_token.id !== '(end)') {
+                    while (next_token.id === ',') {
+                        warn('unexpected_a', next_token);
+                        advance(',');
+                    }
+                    if (next_token.id !== '(string)') {
+                        warn('expected_string_a');
+                    }
+                    if (object[next_token.string] === true) {
+                        warn('duplicate_a');
+                    } else if (next_token.string === '__proto__') {
+                        warn('dangling_a');
+                    } else {
+                        object[next_token.string] = true;
+                    }
+                    advance();
+                    advance(':');
+                    json_value();
+                    if (next_token.id !== ',') {
+                        break;
+                    }
+                    advance(',');
+                    if (next_token.id === '}') {
+                        warn('unexpected_a', token);
+                        break;
+                    }
+                }
+            }
+            advance('}', brace);
+        }
+
+        function json_array() {
+            var bracket = next_token;
+            advance('[');
+            if (next_token.id !== ']') {
+                while (next_token.id !== '(end)') {
+                    while (next_token.id === ',') {
+                        warn('unexpected_a', next_token);
+                        advance(',');
+                    }
+                    json_value();
+                    if (next_token.id !== ',') {
+                        break;
+                    }
+                    advance(',');
+                    if (next_token.id === ']') {
+                        warn('unexpected_a', token);
+                        break;
+                    }
+                }
+            }
+            advance(']', bracket);
+        }
+
+        switch (next_token.id) {
+        case '{':
+            json_object();
+            break;
+        case '[':
+            json_array();
+            break;
+        case 'true':
+        case 'false':
+        case 'null':
+        case '(number)':
+        case '(string)':
+            advance();
+            break;
+        case '-':
+            advance('-');
+            no_space_only();
+            advance('(number)');
+            break;
+        default:
+            stop('unexpected_a');
+        }
+    }
+
+
+// CSS parsing.
+
+    function css_name() {
+        if (next_token.identifier) {
+            advance();
+            return true;
+        }
+    }
+
+
+    function css_number() {
+        if (next_token.id === '-') {
+            advance('-');
+            no_space_only();
+        }
+        if (next_token.id === '(number)') {
+            advance('(number)');
+            return true;
+        }
+    }
+
+
+    function css_string() {
+        if (next_token.id === '(string)') {
+            advance();
+            return true;
+        }
+    }
+
+    function css_color() {
+        var i, number, paren, value;
+        if (next_token.identifier) {
+            value = next_token.string;
+            if (value === 'rgb' || value === 'rgba') {
+                advance();
+                paren = next_token;
+                advance('(');
+                for (i = 0; i < 3; i += 1) {
+                    if (i) {
+                        comma();
+                    }
+                    number = next_token.number;
+                    if (next_token.id !== '(number)' || number < 0) {
+                        warn('expected_positive_a', next_token);
+                        advance();
+                    } else {
+                        advance();
+                        if (next_token.id === '%') {
+                            advance('%');
+                            if (number > 100) {
+                                warn('expected_percent_a', token, number);
+                            }
+                        } else {
+                            if (number > 255) {
+                                warn('expected_small_a', token, number);
+                            }
+                        }
+                    }
+                }
+                if (value === 'rgba') {
+                    comma();
+                    number = next_token.number;
+                    if (next_token.id !== '(number)' || number < 0 || number > 1) {
+                        warn('expected_fraction_a', next_token);
+                    }
+                    advance();
+                    if (next_token.id === '%') {
+                        warn('unexpected_a');
+                        advance('%');
+                    }
+                }
+                advance(')', paren);
+                return true;
+            }
+            if (css_colorData[next_token.string] === true) {
+                advance();
+                return true;
+            }
+        } else if (next_token.id === '(color)') {
+            advance();
+            return true;
+        }
+        return false;
+    }
+
+
+    function css_length() {
+        if (next_token.id === '-') {
+            advance('-');
+            no_space_only();
+        }
+        if (next_token.id === '(number)') {
+            advance();
+            if (next_token.id !== '(string)' &&
+                    css_lengthData[next_token.string] === true) {
+                no_space_only();
+                advance();
+            } else if (+token.number !== 0) {
+                warn('expected_linear_a');
+            }
+            return true;
+        }
+        return false;
+    }
+
+
+    function css_line_height() {
+        if (next_token.id === '-') {
+            advance('-');
+            no_space_only();
+        }
+        if (next_token.id === '(number)') {
+            advance();
+            if (next_token.id !== '(string)' &&
+                    css_lengthData[next_token.string] === true) {
+                no_space_only();
+                advance();
+            }
+            return true;
+        }
+        return false;
+    }
+
+
+    function css_width() {
+        if (next_token.identifier) {
+            switch (next_token.string) {
+            case 'thin':
+            case 'medium':
+            case 'thick':
+                advance();
+                return true;
+            }
+        } else {
+            return css_length();
+        }
+    }
+
+
+    function css_margin() {
+        if (next_token.identifier) {
+            if (next_token.string === 'auto') {
+                advance();
+                return true;
+            }
+        } else {
+            return css_length();
+        }
+    }
+
+    function css_attr() {
+        if (next_token.identifier && next_token.string === 'attr') {
+            advance();
+            advance('(');
+            if (!next_token.identifier) {
+                warn('expected_name_a');
+            }
+            advance();
+            advance(')');
+            return true;
+        }
+        return false;
+    }
+
+
+    function css_comma_list() {
+        while (next_token.id !== ';') {
+            if (!css_name() && !css_string()) {
+                warn('expected_name_a');
+            }
+            if (next_token.id !== ',') {
+                return true;
+            }
+            comma();
+        }
+    }
+
+
+    function css_counter() {
+        if (next_token.identifier && next_token.string === 'counter') {
+            advance();
+            advance('(');
+            advance();
+            if (next_token.id === ',') {
+                comma();
+                if (next_token.id !== '(string)') {
+                    warn('expected_string_a');
+                }
+                advance();
+            }
+            advance(')');
+            return true;
+        }
+        if (next_token.identifier && next_token.string === 'counters') {
+            advance();
+            advance('(');
+            if (!next_token.identifier) {
+                warn('expected_name_a');
+            }
+            advance();
+            if (next_token.id === ',') {
+                comma();
+                if (next_token.id !== '(string)') {
+                    warn('expected_string_a');
+                }
+                advance();
+            }
+            if (next_token.id === ',') {
+                comma();
+                if (next_token.id !== '(string)') {
+                    warn('expected_string_a');
+                }
+                advance();
+            }
+            advance(')');
+            return true;
+        }
+        return false;
+    }
+
+
+    function css_radius() {
+        return css_length() && (next_token.id !== '(number)' || css_length());
+    }
+
+
+    function css_shape() {
+        var i;
+        if (next_token.identifier && next_token.string === 'rect') {
+            advance();
+            advance('(');
+            for (i = 0; i < 4; i += 1) {
+                if (!css_length()) {
+                    warn('expected_number_a');
+                    break;
+                }
+            }
+            advance(')');
+            return true;
+        }
+        return false;
+    }
+
+
+    function css_url() {
+        var c, url;
+        if (next_token.identifier && next_token.string === 'url') {
+            next_token = lex.range('(', ')');
+            url = next_token.string;
+            c = url.charAt(0);
+            if (c === '"' || c === '\'') {
+                if (url.slice(-1) !== c) {
+                    warn('bad_url_a');
+                } else {
+                    url = url.slice(1, -1);
+                    if (url.indexOf(c) >= 0) {
+                        warn('bad_url_a');
+                    }
+                }
+            }
+            if (!url) {
+                warn('missing_url');
+            }
+            if (ux.test(url)) {
+                stop('bad_url_a');
+            }
+            urls.push(url);
+            advance();
+            return true;
+        }
+        return false;
+    }
+
+
+    css_any = [css_url, function () {
+        for (;;) {
+            if (next_token.identifier) {
+                switch (next_token.string.toLowerCase()) {
+                case 'url':
+                    css_url();
+                    break;
+                case 'expression':
+                    warn('unexpected_a');
+                    advance();
+                    break;
+                default:
+                    advance();
+                }
+            } else {
+                if (next_token.id === ';' || next_token.id === '!'  ||
+                        next_token.id === '(end)' || next_token.id === '}') {
+                    return true;
+                }
+                advance();
+            }
+        }
+    }];
+
+
+    function font_face() {
+        advance_identifier('font-family');
+        advance(':');
+        if (!css_name() && !css_string()) {
+            stop('expected_name_a');
+        }
+        semicolon();
+        advance_identifier('src');
+        advance(':');
+        while (true) {
+            if (next_token.string === 'local') {
+                advance_identifier('local');
+                advance('(');
+                if (ux.test(next_token.string)) {
+                    stop('bad_url_a');
+                }
+
+                if (!css_name() && !css_string()) {
+                    stop('expected_name_a');
+                }
+                advance(')');
+            } else if (!css_url()) {
+                stop('expected_a_b', next_token, 'url', artifact());
+            }
+            if (next_token.id !== ',') {
+                break;
+            }
+            comma();
+        }
+        semicolon();
+    }
+
+
+    css_border_style = [
+        'none', 'dashed', 'dotted', 'double', 'groove',
+        'hidden', 'inset', 'outset', 'ridge', 'solid'
+    ];
+
+    css_break = [
+        'auto', 'always', 'avoid', 'left', 'right'
+    ];
+
+    css_media = {
+        'all': true,
+        'braille': true,
+        'embossed': true,
+        'handheld': true,
+        'print': true,
+        'projection': true,
+        'screen': true,
+        'speech': true,
+        'tty': true,
+        'tv': true
+    };
+
+    css_overflow = [
+        'auto', 'hidden', 'scroll', 'visible'
+    ];
+
+    css_attribute_data = {
+        background: [
+            true, 'background-attachment', 'background-color',
+            'background-image', 'background-position', 'background-repeat'
+        ],
+        'background-attachment': ['scroll', 'fixed'],
+        'background-color': ['transparent', css_color],
+        'background-image': ['none', css_url],
+        'background-position': [
+            2, [css_length, 'top', 'bottom', 'left', 'right', 'center']
+        ],
+        'background-repeat': [
+            'repeat', 'repeat-x', 'repeat-y', 'no-repeat'
+        ],
+        'border': [true, 'border-color', 'border-style', 'border-width'],
+        'border-bottom': [
+            true, 'border-bottom-color', 'border-bottom-style',
+            'border-bottom-width'
+        ],
+        'border-bottom-color': css_color,
+        'border-bottom-left-radius': css_radius,
+        'border-bottom-right-radius': css_radius,
+        'border-bottom-style': css_border_style,
+        'border-bottom-width': css_width,
+        'border-collapse': ['collapse', 'separate'],
+        'border-color': ['transparent', 4, css_color],
+        'border-left': [
+            true, 'border-left-color', 'border-left-style', 'border-left-width'
+        ],
+        'border-left-color': css_color,
+        'border-left-style': css_border_style,
+        'border-left-width': css_width,
+        'border-radius': function () {
+            function count(separator) {
+                var n = 1;
+                if (separator) {
+                    advance(separator);
+                }
+                if (!css_length()) {
+                    return false;
+                }
+                while (next_token.id === '(number)') {
+                    if (!css_length()) {
+                        return false;
+                    }
+                    n += 1;
+                }
+                if (n > 4) {
+                    warn('bad_style');
+                }
+                return true;
+            }
+
+            return count() && (next_token.id !== '/' || count('/'));
+        },
+        'border-right': [
+            true, 'border-right-color', 'border-right-style',
+            'border-right-width'
+        ],
+        'border-right-color': css_color,
+        'border-right-style': css_border_style,
+        'border-right-width': css_width,
+        'border-spacing': [2, css_length],
+        'border-style': [4, css_border_style],
+        'border-top': [
+            true, 'border-top-color', 'border-top-style', 'border-top-width'
+        ],
+        'border-top-color': css_color,
+        'border-top-left-radius': css_radius,
+        'border-top-right-radius': css_radius,
+        'border-top-style': css_border_style,
+        'border-top-width': css_width,
+        'border-width': [4, css_width],
+        bottom: [css_length, 'auto'],
+        'caption-side' : ['bottom', 'left', 'right', 'top'],
+        clear: ['both', 'left', 'none', 'right'],
+        clip: [css_shape, 'auto'],
+        color: css_color,
+        content: [
+            'open-quote', 'close-quote', 'no-open-quote', 'no-close-quote',
+            css_string, css_url, css_counter, css_attr
+        ],
+        'counter-increment': [
+            css_name, 'none'
+        ],
+        'counter-reset': [
+            css_name, 'none'
+        ],
+        cursor: [
+            css_url, 'auto', 'crosshair', 'default', 'e-resize', 'help', 'move',
+            'n-resize', 'ne-resize', 'nw-resize', 'pointer', 's-resize',
+            'se-resize', 'sw-resize', 'w-resize', 'text', 'wait'
+        ],
+        direction: ['ltr', 'rtl'],
+        display: [
+            'block', 'compact', 'inline', 'inline-block', 'inline-table',
+            'list-item', 'marker', 'none', 'run-in', 'table', 'table-caption',
+            'table-cell', 'table-column', 'table-column-group',
+            'table-footer-group', 'table-header-group', 'table-row',
+            'table-row-group'
+        ],
+        'empty-cells': ['show', 'hide'],
+        'float': ['left', 'none', 'right'],
+        font: [
+            'caption', 'icon', 'menu', 'message-box', 'small-caption',
+            'status-bar', true, 'font-size', 'font-style', 'font-weight',
+            'font-family'
+        ],
+        'font-family': css_comma_list,
+        'font-size': [
+            'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large',
+            'xx-large', 'larger', 'smaller', css_length
+        ],
+        'font-size-adjust': ['none', css_number],
+        'font-stretch': [
+            'normal', 'wider', 'narrower', 'ultra-condensed',
+            'extra-condensed', 'condensed', 'semi-condensed',
+            'semi-expanded', 'expanded', 'extra-expanded'
+        ],
+        'font-style': [
+            'normal', 'italic', 'oblique'
+        ],
+        'font-variant': [
+            'normal', 'small-caps'
+        ],
+        'font-weight': [
+            'normal', 'bold', 'bolder', 'lighter', css_number
+        ],
+        height: [css_length, 'auto'],
+        left: [css_length, 'auto'],
+        'letter-spacing': ['normal', css_length],
+        'line-height': ['normal', css_line_height],
+        'list-style': [
+            true, 'list-style-image', 'list-style-position', 'list-style-type'
+        ],
+        'list-style-image': ['none', css_url],
+        'list-style-position': ['inside', 'outside'],
+        'list-style-type': [
+            'circle', 'disc', 'square', 'decimal', 'decimal-leading-zero',
+            'lower-roman', 'upper-roman', 'lower-greek', 'lower-alpha',
+            'lower-latin', 'upper-alpha', 'upper-latin', 'hebrew', 'katakana',
+            'hiragana-iroha', 'katakana-oroha', 'none'
+        ],
+        margin: [4, css_margin],
+        'margin-bottom': css_margin,
+        'margin-left': css_margin,
+        'margin-right': css_margin,
+        'margin-top': css_margin,
+        'marker-offset': [css_length, 'auto'],
+        'max-height': [css_length, 'none'],
+        'max-width': [css_length, 'none'],
+        'min-height': css_length,
+        'min-width': css_length,
+        opacity: css_number,
+        outline: [true, 'outline-color', 'outline-style', 'outline-width'],
+        'outline-color': ['invert', css_color],
+        'outline-style': [
+            'dashed', 'dotted', 'double', 'groove', 'inset', 'none',
+            'outset', 'ridge', 'solid'
+        ],
+        'outline-width': css_width,
+        overflow: css_overflow,
+        'overflow-x': css_overflow,
+        'overflow-y': css_overflow,
+        padding: [4, css_length],
+        'padding-bottom': css_length,
+        'padding-left': css_length,
+        'padding-right': css_length,
+        'padding-top': css_length,
+        'page-break-after': css_break,
+        'page-break-before': css_break,
+        position: ['absolute', 'fixed', 'relative', 'static'],
+        quotes: [8, css_string],
+        right: [css_length, 'auto'],
+        'table-layout': ['auto', 'fixed'],
+        'text-align': ['center', 'justify', 'left', 'right'],
+        'text-decoration': [
+            'none', 'underline', 'overline', 'line-through', 'blink'
+        ],
+        'text-indent': css_length,
+        'text-shadow': ['none', 4, [css_color, css_length]],
+        'text-transform': ['capitalize', 'uppercase', 'lowercase', 'none'],
+        top: [css_length, 'auto'],
+        'unicode-bidi': ['normal', 'embed', 'bidi-override'],
+        'vertical-align': [
+            'baseline', 'bottom', 'sub', 'super', 'top', 'text-top', 'middle',
+            'text-bottom', css_length
+        ],
+        visibility: ['visible', 'hidden', 'collapse'],
+        'white-space': [
+            'normal', 'nowrap', 'pre', 'pre-line', 'pre-wrap', 'inherit'
+        ],
+        width: [css_length, 'auto'],
+        'word-spacing': ['normal', css_length],
+        'word-wrap': ['break-word', 'normal'],
+        'z-index': ['auto', css_number]
+    };
+
+    function style_attribute() {
+        var v;
+        while (next_token.id === '*' || next_token.id === '#' ||
+                next_token.string === '_') {
+            if (!option.css) {
+                warn('unexpected_a');
+            }
+            advance();
+        }
+        if (next_token.id === '-') {
+            if (!option.css) {
+                warn('unexpected_a');
+            }
+            advance('-');
+            if (!next_token.identifier) {
+                warn('expected_nonstandard_style_attribute');
+            }
+            advance();
+            return css_any;
+        }
+        if (!next_token.identifier) {
+            warn('expected_style_attribute');
+        } else {
+            if (Object.prototype.hasOwnProperty.call(css_attribute_data,
+                    next_token.string)) {
+                v = css_attribute_data[next_token.string];
+            } else {
+                v = css_any;
+                if (!option.css) {
+                    warn('unrecognized_style_attribute_a');
+                }
+            }
+        }
+        advance();
+        return v;
+    }
+
+
+    function style_value(v) {
+        var i = 0,
+            n,
+            once,
+            match,
+            round,
+            start = 0,
+            vi;
+        switch (typeof v) {
+        case 'function':
+            return v();
+        case 'string':
+            if (next_token.identifier && next_token.string === v) {
+                advance();
+                return true;
+            }
+            return false;
+        }
+        for (;;) {
+            if (i >= v.length) {
+                return false;
+            }
+            vi = v[i];
+            i += 1;
+            if (typeof vi === 'boolean') {
+                break;
+            } else if (typeof vi === 'number') {
+                n = vi;
+                vi = v[i];
+                i += 1;
+            } else {
+                n = 1;
+            }
+            match = false;
+            while (n > 0) {
+                if (style_value(vi)) {
+                    match = true;
+                    n -= 1;
+                } else {
+                    break;
+                }
+            }
+            if (match) {
+                return true;
+            }
+        }
+        start = i;
+        once = [];
+        for (;;) {
+            round = false;
+            for (i = start; i < v.length; i += 1) {
+                if (!once[i]) {
+                    if (style_value(css_attribute_data[v[i]])) {
+                        match = true;
+                        round = true;
+                        once[i] = true;
+                        break;
+                    }
+                }
+            }
+            if (!round) {
+                return match;
+            }
+        }
+    }
+
+    function style_child() {
+        if (next_token.id === '(number)') {
+            advance();
+            if (next_token.string === 'n' && next_token.identifier) {
+                no_space_only();
+                advance();
+                if (next_token.id === '+') {
+                    no_space_only();
+                    advance('+');
+                    no_space_only();
+                    advance('(number)');
+                }
+            }
+            return;
+        }
+        if (next_token.identifier &&
+                (next_token.string === 'odd' || next_token.string === 'even')) {
+            advance();
+            return;
+        }
+        warn('unexpected_a');
+    }
+
+    function substyle() {
+        var v;
+        for (;;) {
+            if (next_token.id === '}' || next_token.id === '(end)' ||
+                    (xquote && next_token.id === xquote)) {
+                return;
+            }
+            v = style_attribute();
+            advance(':');
+            if (next_token.identifier && next_token.string === 'inherit') {
+                advance();
+            } else {
+                if (!style_value(v)) {
+                    warn('unexpected_a');
+                    advance();
+                }
+            }
+            if (next_token.id === '!') {
+                advance('!');
+                no_space_only();
+                if (next_token.identifier && next_token.string === 'important') {
+                    advance();
+                } else {
+                    warn('expected_a_b',
+                        next_token, 'important', artifact());
+                }
+            }
+            if (next_token.id === '}' || next_token.id === xquote) {
+                warn('expected_a_b', next_token, ';', artifact());
+            } else {
+                semicolon();
+            }
+        }
+    }
+
+    function style_selector() {
+        if (next_token.identifier) {
+            if (!Object.prototype.hasOwnProperty.call(html_tag, option.cap
+                    ? next_token.string.toLowerCase()
+                    : next_token.string)) {
+                warn('expected_tagname_a');
+            }
+            advance();
+        } else {
+            switch (next_token.id) {
+            case '>':
+            case '+':
+                advance();
+                style_selector();
+                break;
+            case ':':
+                advance(':');
+                switch (next_token.string) {
+                case 'active':
+                case 'after':
+                case 'before':
+                case 'checked':
+                case 'disabled':
+                case 'empty':
+                case 'enabled':
+                case 'first-child':
+                case 'first-letter':
+                case 'first-line':
+                case 'first-of-type':
+                case 'focus':
+                case 'hover':
+                case 'last-child':
+                case 'last-of-type':
+                case 'link':
+                case 'only-of-type':
+                case 'root':
+                case 'target':
+                case 'visited':
+                    advance_identifier(next_token.string);
+                    break;
+                case 'lang':
+                    advance_identifier('lang');
+                    advance('(');
+                    if (!next_token.identifier) {
+                        warn('expected_lang_a');
+                    }
+                    advance(')');
+                    break;
+                case 'nth-child':
+                case 'nth-last-child':
+                case 'nth-last-of-type':
+                case 'nth-of-type':
+                    advance_identifier(next_token.string);
+                    advance('(');
+                    style_child();
+                    advance(')');
+                    break;
+                case 'not':
+                    advance_identifier('not');
+                    advance('(');
+                    if (next_token.id === ':' && peek(0).string === 'not') {
+                        warn('not');
+                    }
+                    style_selector();
+                    advance(')');
+                    break;
+                default:
+                    warn('expected_pseudo_a');
+                }
+                break;
+            case '#':
+                advance('#');
+                if (!next_token.identifier) {
+                    warn('expected_id_a');
+                }
+                advance();
+                break;
+            case '*':
+                advance('*');
+                break;
+            case '.':
+                advance('.');
+                if (!next_token.identifier) {
+                    warn('expected_class_a');
+                }
+                advance();
+                break;
+            case '[':
+                advance('[');
+                if (!next_token.identifier) {
+                    warn('expected_attribute_a');
+                }
+                advance();
+                if (next_token.id === '=' || next_token.string === '~=' ||
+                        next_token.string === '$=' ||
+                        next_token.string === '|=' ||
+                        next_token.id === '*=' ||
+                        next_token.id === '^=') {
+                    advance();
+                    if (next_token.id !== '(string)') {
+                        warn('expected_string_a');
+                    }
+                    advance();
+                }
+                advance(']');
+                break;
+            default:
+                stop('expected_selector_a');
+            }
+        }
+    }
+
+    function style_pattern() {
+        if (next_token.id === '{') {
+            warn('expected_style_pattern');
+        }
+        for (;;) {
+            style_selector();
+            if (next_token.id === '</' || next_token.id === '{' ||
+                    next_token.id === '}' || next_token.id === '(end)') {
+                return '';
+            }
+            if (next_token.id === ',') {
+                comma();
+            }
+        }
+    }
+
+    function style_list() {
+        while (next_token.id !== '}' && next_token.id !== '</' &&
+                next_token.id !== '(end)') {
+            style_pattern();
+            xmode = 'styleproperty';
+            if (next_token.id === ';') {
+                semicolon();
+            } else {
+                advance('{');
+                substyle();
+                xmode = 'style';
+                advance('}');
+            }
+        }
+    }
+
+    function styles() {
+        var i;
+        while (next_token.id === '@') {
+            i = peek();
+            advance('@');
+            switch (next_token.string) {
+            case 'import':
+                advance_identifier('import');
+                if (!css_url()) {
+                    warn('expected_a_b',
+                        next_token, 'url', artifact());
+                    advance();
+                }
+                semicolon();
+                break;
+            case 'media':
+                advance_identifier('media');
+                for (;;) {
+                    if (!next_token.identifier || css_media[next_token.string] !== true) {
+                        stop('expected_media_a');
+                    }
+                    advance();
+                    if (next_token.id !== ',') {
+                        break;
+                    }
+                    comma();
+                }
+                advance('{');
+                style_list();
+                advance('}');
+                break;
+            case 'font-face':
+                advance_identifier('font-face');
+                advance('{');
+                font_face();
+                advance('}');
+                break;
+            default:
+                stop('expected_at_a');
+            }
+        }
+        style_list();
+    }
+
+
+// Parse HTML
+
+    function do_begin(n) {
+        if (n !== 'html' && !option.fragment) {
+            if (n === 'div' && option.adsafe) {
+                stop('adsafe_fragment');
+            } else {
+                stop('expected_a_b', token, 'html', n);
+            }
+        }
+        if (option.adsafe) {
+            if (n === 'html') {
+                stop('adsafe_html', token);
+            }
+            if (option.fragment) {
+                if (n !== 'div') {
+                    stop('adsafe_div', token);
+                }
+            } else {
+                stop('adsafe_fragment', token);
+            }
+        }
+        option.browser = true;
+    }
+
+    function do_attribute(a, v) {
+        var u, x;
+        if (a === 'id') {
+            u = typeof v === 'string' ? v.toUpperCase() : '';
+            if (ids[u] === true) {
+                warn('duplicate_a', next_token, v);
+            }
+            if (!/^[A-Za-z][A-Za-z0-9._:\-]*$/.test(v)) {
+                warn('bad_id_a', next_token, v);
+            } else if (option.adsafe) {
+                if (adsafe_id) {
+                    if (v.slice(0, adsafe_id.length) !== adsafe_id) {
+                        warn('adsafe_prefix_a', next_token, adsafe_id);
+                    } else if (!/^[A-Z]+_[A-Z]+$/.test(v)) {
+                        warn('adsafe_bad_id');
+                    }
+                } else {
+                    adsafe_id = v;
+                    if (!/^[A-Z]+_$/.test(v)) {
+                        warn('adsafe_bad_id');
+                    }
+                }
+            }
+            x = v.search(dx);
+            if (x >= 0) {
+                warn('unexpected_char_a_b', token, v.charAt(x), a);
+            }
+            ids[u] = true;
+        } else if (a === 'class' || a === 'type' || a === 'name') {
+            x = v.search(qx);
+            if (x >= 0) {
+                warn('unexpected_char_a_b', token, v.charAt(x), a);
+            }
+            ids[u] = true;
+        } else if (a === 'href' || a === 'background' ||
+                a === 'content' || a === 'data' ||
+                a.indexOf('src') >= 0 || a.indexOf('url') >= 0) {
+            if (option.safe && ux.test(v)) {
+                stop('bad_url_a', next_token, v);
+            }
+            urls.push(v);
+        } else if (a === 'for') {
+            if (option.adsafe) {
+                if (adsafe_id) {
+                    if (v.slice(0, adsafe_id.length) !== adsafe_id) {
+                        warn('adsafe_prefix_a', next_token, adsafe_id);
+                    } else if (!/^[A-Z]+_[A-Z]+$/.test(v)) {
+                        warn('adsafe_bad_id');
+                    }
+                } else {
+                    warn('adsafe_bad_id');
+                }
+            }
+        } else if (a === 'name') {
+            if (option.adsafe && v.indexOf('_') >= 0) {
+                warn('adsafe_name_a', next_token, v);
+            }
+        }
+    }
+
+    function do_tag(name, attribute) {
+        var i, tag = html_tag[name], script, x;
+        src = false;
+        if (!tag) {
+            stop(
+                bundle.unrecognized_tag_a,
+                next_token,
+                name === name.toLowerCase()
+                    ? name
+                    : name + ' (capitalization error)'
+            );
+        }
+        if (stack.length > 0) {
+            if (name === 'html') {
+                stop('unexpected_a', token, name);
+            }
+            x = tag.parent;
+            if (x) {
+                if (x.indexOf(' ' + stack[stack.length - 1].name + ' ') < 0) {
+                    stop('tag_a_in_b', token, name, x);
+                }
+            } else if (!option.adsafe && !option.fragment) {
+                i = stack.length;
+                do {
+                    if (i <= 0) {
+                        stop('tag_a_in_b', token, name, 'body');
+                    }
+                    i -= 1;
+                } while (stack[i].name !== 'body');
+            }
+        }
+        switch (name) {
+        case 'div':
+            if (option.adsafe && stack.length === 1 && !adsafe_id) {
+                warn('adsafe_missing_id');
+            }
+            break;
+        case 'script':
+            xmode = 'script';
+            advance('>');
+            if (attribute.lang) {
+                warn('lang', token);
+            }
+            if (option.adsafe && stack.length !== 1) {
+                warn('adsafe_placement', token);
+            }
+            if (attribute.src) {
+                if (option.adsafe && (!adsafe_may || !approved[attribute.src])) {
+                    warn('adsafe_source', token);
+                }
+            } else {
+                step_in(next_token.from);
+                edge();
+                use_strict();
+                adsafe_top = true;
+                script = statements();
+
+// JSLint is also the static analyzer for ADsafe. See www.ADsafe.org.
+
+                if (option.adsafe) {
+                    if (adsafe_went) {
+                        stop('adsafe_script', token);
+                    }
+                    if (script.length !== 1 ||
+                            aint(script[0],             'id',     '(') ||
+                            aint(script[0].first,       'id',     '.') ||
+                            aint(script[0].first.first, 'string', 'ADSAFE') ||
+                            aint(script[0].second[0],   'string', adsafe_id)) {
+                        stop('adsafe_id_go');
+                    }
+                    switch (script[0].first.second.string) {
+                    case 'id':
+                        if (adsafe_may || adsafe_went ||
+                                script[0].second.length !== 1) {
+                            stop('adsafe_id', next_token);
+                        }
+                        adsafe_may = true;
+                        break;
+                    case 'go':
+                        if (adsafe_went) {
+                            stop('adsafe_go');
+                        }
+                        if (script[0].second.length !== 2 ||
+                                aint(script[0].second[1], 'id', 'function') ||
+                                !script[0].second[1].first ||
+                                aint(script[0].second[1].first[0], 'string', 'dom') ||
+                                script[0].second[1].first.length > 2 ||
+                                (script[0].second[1].first.length === 2 &&
+                                aint(script[0].second[1].first[1], 'string', 'lib'))) {
+                            stop('adsafe_go', next_token);
+                        }
+                        adsafe_went = true;
+                        break;
+                    default:
+                        stop('adsafe_id_go');
+                    }
+                }
+                indent = null;
+            }
+            xmode = 'html';
+            advance('</');
+            advance_identifier('script');
+            xmode = 'outer';
+            break;
+        case 'style':
+            xmode = 'style';
+            advance('>');
+            styles();
+            xmode = 'html';
+            advance('</');
+            advance_identifier('style');
+            break;
+        case 'input':
+            switch (attribute.type) {
+            case 'button':
+            case 'checkbox':
+            case 'radio':
+            case 'reset':
+            case 'submit':
+                break;
+            case 'file':
+            case 'hidden':
+            case 'image':
+            case 'password':
+            case 'text':
+                if (option.adsafe && attribute.autocomplete !== 'off') {
+                    warn('adsafe_autocomplete');
+                }
+                break;
+            default:
+                warn('bad_type');
+            }
+            break;
+        case 'applet':
+        case 'body':
+        case 'embed':
+        case 'frame':
+        case 'frameset':
+        case 'head':
+        case 'iframe':
+        case 'noembed':
+        case 'noframes':
+        case 'object':
+        case 'param':
+            if (option.adsafe) {
+                warn('adsafe_tag', next_token, name);
+            }
+            break;
+        }
+    }
+
+
+    function closetag(name) {
+        return '</' + name + '>';
+    }
+
+    function html() {
+        var attribute, attributes, is_empty, name, old_white = option.white,
+            quote, tag_name, tag, wmode;
+        xmode = 'html';
+        xquote = '';
+        stack = null;
+        for (;;) {
+            switch (next_token.string) {
+            case '<':
+                xmode = 'html';
+                advance('<');
+                attributes = {};
+                tag_name = next_token;
+                name = tag_name.string;
+                advance_identifier(name);
+                if (option.cap) {
+                    name = name.toLowerCase();
+                }
+                tag_name.name = name;
+                if (!stack) {
+                    stack = [];
+                    do_begin(name);
+                }
+                tag = html_tag[name];
+                if (typeof tag !== 'object') {
+                    stop('unrecognized_tag_a', tag_name, name);
+                }
+                is_empty = tag.empty;
+                tag_name.type = name;
+                for (;;) {
+                    if (next_token.id === '/') {
+                        advance('/');
+                        if (next_token.id !== '>') {
+                            warn('expected_a_b', next_token, '>', artifact());
+                        }
+                        break;
+                    }
+                    if (next_token.id && next_token.id.charAt(0) === '>') {
+                        break;
+                    }
+                    if (!next_token.identifier) {
+                        if (next_token.id === '(end)' || next_token.id === '(error)') {
+                            warn('expected_a_b', next_token, '>', artifact());
+                        }
+                        warn('bad_name_a');
+                    }
+                    option.white = false;
+                    spaces();
+                    attribute = next_token.string;
+                    option.white = old_white;
+                    advance();
+                    if (!option.cap && attribute !== attribute.toLowerCase()) {
+                        warn('attribute_case_a', token);
+                    }
+                    attribute = attribute.toLowerCase();
+                    xquote = '';
+                    if (Object.prototype.hasOwnProperty.call(attributes, attribute)) {
+                        warn('duplicate_a', token, attribute);
+                    }
+                    if (attribute.slice(0, 2) === 'on') {
+                        if (!option.on) {
+                            warn('html_handlers');
+                        }
+                        xmode = 'scriptstring';
+                        advance('=');
+                        quote = next_token.id;
+                        if (quote !== '"' && quote !== '\'') {
+                            stop('expected_a_b', next_token, '"', artifact());
+                        }
+                        xquote = quote;
+                        wmode = option.white;
+                        option.white = true;
+                        advance(quote);
+                        use_strict();
+                        statements();
+                        option.white = wmode;
+                        if (next_token.id !== quote) {
+                            stop('expected_a_b', next_token, quote, artifact());
+                        }
+                        xmode = 'html';
+                        xquote = '';
+                        advance(quote);
+                        tag = false;
+                    } else if (attribute === 'style') {
+                        xmode = 'scriptstring';
+                        advance('=');
+                        quote = next_token.id;
+                        if (quote !== '"' && quote !== '\'') {
+                            stop('expected_a_b', next_token, '"', artifact());
+                        }
+                        xmode = 'styleproperty';
+                        xquote = quote;
+                        advance(quote);
+                        substyle();
+                        xmode = 'html';
+                        xquote = '';
+                        advance(quote);
+                        tag = false;
+                    } else {
+                        if (next_token.id === '=') {
+                            advance('=');
+                            tag = next_token.string;
+                            if (!next_token.identifier &&
+                                    next_token.id !== '"' &&
+                                    next_token.id !== '\'' &&
+                                    next_token.id !== '(string)' &&
+                                    next_token.id !== '(string)' &&
+                                    next_token.id !== '(color)') {
+                                warn('expected_attribute_value_a', token, attribute);
+                            }
+                            advance();
+                        } else {
+                            tag = true;
+                        }
+                    }
+                    attributes[attribute] = tag;
+                    do_attribute(attribute, tag);
+                }
+                do_tag(name, attributes);
+                if (!is_empty) {
+                    stack.push(tag_name);
+                }
+                xmode = 'outer';
+                advance('>');
+                break;
+            case '</':
+                xmode = 'html';
+                advance('</');
+                if (!next_token.identifier) {
+                    warn('bad_name_a');
+                }
+                name = next_token.string;
+                if (option.cap) {
+                    name = name.toLowerCase();
+                }
+                advance();
+                if (!stack) {
+                    stop('unexpected_a', next_token, closetag(name));
+                }
+                tag_name = stack.pop();
+                if (!tag_name) {
+                    stop('unexpected_a', next_token, closetag(name));
+                }
+                if (tag_name.name !== name) {
+                    stop('expected_a_b',
+                        next_token, closetag(tag_name.name), closetag(name));
+                }
+                if (next_token.id !== '>') {
+                    stop('expected_a_b', next_token, '>', artifact());
+                }
+                xmode = 'outer';
+                advance('>');
+                break;
+            case '<!':
+                if (option.safe) {
+                    warn('adsafe_a');
+                }
+                xmode = 'html';
+                for (;;) {
+                    advance();
+                    if (next_token.id === '>' || next_token.id === '(end)') {
+                        break;
+                    }
+                    if (next_token.string.indexOf('--') >= 0) {
+                        stop('unexpected_a', next_token, '--');
+                    }
+                    if (next_token.string.indexOf('<') >= 0) {
+                        stop('unexpected_a', next_token, '<');
+                    }
+                    if (next_token.string.indexOf('>') >= 0) {
+                        stop('unexpected_a', next_token, '>');
+                    }
+                }
+                xmode = 'outer';
+                advance('>');
+                break;
+            case '(end)':
+                if (stack.length !== 0) {
+                    warn('missing_a', next_token, '</' + stack.pop().string + '>');
+                }
+                return;
+            default:
+                if (next_token.id === '(end)') {
+                    stop('missing_a', next_token,
+                        '</' + stack[stack.length - 1].string + '>');
+                } else {
+                    advance();
+                }
+            }
+            if (stack && stack.length === 0 && (option.adsafe ||
+                    !option.fragment || next_token.id === '(end)')) {
+                break;
+            }
+        }
+        if (next_token.id !== '(end)') {
+            stop('unexpected_a');
+        }
+    }
+
+
+// The actual JSLINT function itself.
+
+    itself = function JSLint(the_source, the_option) {
+
+        var i, predef, tree;
+        JSLINT.errors = [];
+        JSLINT.tree = '';
+        begin = prev_token = token = next_token =
+            Object.create(syntax['(begin)']);
+        predefined = {};
+        add_to_predefined(standard);
+        property = {};
+        if (the_option) {
+            option = Object.create(the_option);
+            predef = option.predef;
+            if (predef) {
+                if (Array.isArray(predef)) {
+                    for (i = 0; i < predef.length; i += 1) {
+                        predefined[predef[i]] = true;
+                    }
+                } else if (typeof predef === 'object') {
+                    add_to_predefined(predef);
+                }
+            }
+            do_safe();
+        } else {
+            option = {};
+        }
+        option.indent = +option.indent || 4;
+        option.maxerr = +option.maxerr || 50;
+        adsafe_id = '';
+        adsafe_may = adsafe_top = adsafe_went = false;
+        approved = {};
+        if (option.approved) {
+            for (i = 0; i < option.approved.length; i += 1) {
+                approved[option.approved[i]] = option.approved[i];
+            }
+        } else {
+            approved.test = 'test';
+        }
+        tab = '';
+        for (i = 0; i < option.indent; i += 1) {
+            tab += ' ';
+        }
+        global_scope = scope = {};
+        global_funct = funct = {
+            '(scope)': scope,
+            '(breakage)': 0,
+            '(loopage)': 0
+        };
+        functions = [funct];
+
+        comments_off = false;
+        ids = {};
+        in_block = false;
+        indent = null;
+        json_mode = false;
+        lookahead = [];
+        node_js = false;
+        prereg = true;
+        src = false;
+        stack = null;
+        strict_mode = false;
+        urls = [];
+        var_mode = null;
+        warnings = 0;
+        xmode = '';
+        lex.init(the_source);
+
+        assume();
+
+        try {
+            advance();
+            if (next_token.id === '(number)') {
+                stop('unexpected_a');
+            } else if (next_token.string.charAt(0) === '<') {
+                html();
+                if (option.adsafe && !adsafe_went) {
+                    warn('adsafe_go', this);
+                }
+            } else {
+                switch (next_token.id) {
+                case '{':
+                case '[':
+                    json_mode = true;
+                    json_value();
+                    break;
+                case '@':
+                case '*':
+                case '#':
+                case '.':
+                case ':':
+                    xmode = 'style';
+                    advance();
+                    if (token.id !== '@' || !next_token.identifier ||
+                            next_token.string !== 'charset' || token.line !== 1 ||
+                            token.from !== 1) {
+                        stop('css');
+                    }
+                    advance();
+                    if (next_token.id !== '(string)' &&
+                            next_token.string !== 'UTF-8') {
+                        stop('css');
+                    }
+                    advance();
+                    semicolon();
+                    styles();
+                    break;
+
+                default:
+                    if (option.adsafe && option.fragment) {
+                        stop('expected_a_b',
+                            next_token, '<div>', artifact());
+                    }
+
+// If the first token is a semicolon, ignore it. This is sometimes used when
+// files are intended to be appended to files that may be sloppy. A sloppy
+// file may be depending on semicolon insertion on its last line.
+
+                    step_in(1);
+                    if (next_token.id === ';' && !node_js) {
+                        semicolon();
+                    }
+                    adsafe_top = true;
+                    tree = statements();
+                    begin.first = tree;
+                    JSLINT.tree = begin;
+                    // infer_types(tree);
+                    if (option.adsafe && (tree.length !== 1 ||
+                            aint(tree[0], 'id', '(') ||
+                            aint(tree[0].first, 'id', '.') ||
+                            aint(tree[0].first.first, 'string', 'ADSAFE') ||
+                            aint(tree[0].first.second, 'string', 'lib') ||
+                            tree[0].second.length !== 2 ||
+                            tree[0].second[0].id !== '(string)' ||
+                            aint(tree[0].second[1], 'id', 'function'))) {
+                        stop('adsafe_lib');
+                    }
+                    if (tree.disrupt) {
+                        warn('weird_program', prev_token);
+                    }
+                }
+            }
+            indent = null;
+            advance('(end)');
+        } catch (e) {
+            if (e) {        // ~~
+                JSLINT.errors.push({
+                    reason    : e.message,
+                    line      : e.line || next_token.line,
+                    character : e.character || next_token.from
+                }, null);
+            }
+        }
+        return JSLINT.errors.length === 0;
+    };
+
+
+// Data summary.
+
+    itself.data = function () {
+        var data = {functions: []},
+            function_data,
+            globals,
+            i,
+            j,
+            kind,
+            members = [],
+            name,
+            the_function,
+            undef = [],
+            unused = [];
+        if (itself.errors.length) {
+            data.errors = itself.errors;
+        }
+
+        if (json_mode) {
+            data.json = true;
+        }
+
+        if (urls.length > 0) {
+            data.urls = urls;
+        }
+
+        globals = Object.keys(global_scope).filter(function (value) {
+            return value.charAt(0) !== '(' && typeof standard[value] !== 'boolean';
+        });
+        if (globals.length > 0) {
+            data.globals = globals;
+        }
+
+        for (i = 1; i < functions.length; i += 1) {
+            the_function = functions[i];
+            function_data = {};
+            for (j = 0; j < functionicity.length; j += 1) {
+                function_data[functionicity[j]] = [];
+            }
+            for (name in the_function) {
+                if (Object.prototype.hasOwnProperty.call(the_function, name)) {
+                    if (name.charAt(0) !== '(') {
+                        kind = the_function[name];
+                        if (kind === 'unction' || kind === 'unparam') {
+                            kind = 'unused';
+                        }
+                        if (Array.isArray(function_data[kind])) {
+                            function_data[kind].push(name);
+                            if (kind === 'unused') {
+                                unused.push({
+                                    name: name,
+                                    line: the_function['(line)'],
+                                    'function': the_function['(name)']
+                                });
+                            } else if (kind === 'undef') {
+                                undef.push({
+                                    name: name,
+                                    line: the_function['(line)'],
+                                    'function': the_function['(name)']
+                                });
+                            }
+                        }
+                    }
+                }
+            }
+            for (j = 0; j < functionicity.length; j += 1) {
+                if (function_data[functionicity[j]].length === 0) {
+                    delete function_data[functionicity[j]];
+                }
+            }
+            function_data.name = the_function['(name)'];
+            function_data.params = the_function['(params)'];
+            function_data.line = the_function['(line)'];
+            data.functions.push(function_data);
+        }
+
+        if (unused.length > 0) {
+            data.unused = unused;
+        }
+        if (undef.length > 0) {
+            data['undefined'] = undef;
+        }
+
+        members = [];
+        for (name in property) {
+            if (typeof property[name] === 'number') {
+                data.member = property;
+                break;
+            }
+        }
+
+        return data;
+    };
+
+
+    itself.report = function (errors_only) {
+        var data = itself.data(), err, evidence, i, italics, j, key, keys,
+            length, mem = '', name, names, not_first, output = [], snippets,
+            the_function, warning;
+
+        function detail(h, value) {
+            var comma_needed, singularity;
+            if (Array.isArray(value)) {
+                output.push('<div><i>' + h + '</i> ');
+                value.sort().forEach(function (item) {
+                    if (item !== singularity) {
+                        singularity = item;
+                        output.push((comma_needed ? ', ' : '') + singularity);
+                        comma_needed = true;
+                    }
+                });
+                output.push('</div>');
+            } else if (value) {
+                output.push('<div><i>' + h + '</i> ' + value + '</div>');
+            }
+        }
+
+        if (data.errors || data.unused || data['undefined']) {
+            err = true;
+            output.push('<div id=errors><i>Error:</i>');
+            if (data.errors) {
+                for (i = 0; i < data.errors.length; i += 1) {
+                    warning = data.errors[i];
+                    if (warning) {
+                        evidence = warning.evidence || '';
+                        output.push('<p>Problem' + (isFinite(warning.line)
+                            ? ' at line ' + String(warning.line) +
+                                ' character ' + String(warning.character)
+                            : '') +
+                            ': ' + warning.reason.entityify() +
+                            '</p><p class=evidence>' +
+                            (evidence && (evidence.length > 80
+                                ? evidence.slice(0, 77) + '...'
+                                : evidence).entityify()) + '</p>');
+                    }
+                }
+            }
+
+            if (data['undefined']) {
+                snippets = [];
+                for (i = 0; i < data['undefined'].length; i += 1) {
+                    snippets[i] = '<code><u>' + data['undefined'][i].name + '</u></code>&nbsp;<i>' +
+                        String(data['undefined'][i].line) + ' </i> <small>' +
+                        data['undefined'][i]['function'] + '</small>';
+                }
+                output.push('<p><i>Undefined variable:</i> ' + snippets.join(', ') + '</p>');
+            }
+            if (data.unused) {
+                snippets = [];
+                for (i = 0; i < data.unused.length; i += 1) {
+                    snippets[i] = '<code><u>' + data.unused[i].name + '</u></code>&nbsp;<i>' +
+                        String(data.unused[i].line) + ' </i> <small>' +
+                        data.unused[i]['function'] + '</small>';
+                }
+                output.push('<p><i>Unused variable:</i> ' + snippets.join(', ') + '</p>');
+            }
+            if (data.json) {
+                output.push('<p>JSON: bad.</p>');
+            }
+            output.push('</div>');
+        }
+
+        if (!errors_only) {
+
+            output.push('<br><div id=functions>');
+
+            if (data.urls) {
+                detail("URLs<br>", data.urls, '<br>');
+            }
+
+            if (xmode === 'style') {
+                output.push('<p>CSS.</p>');
+            } else if (data.json && !err) {
+                output.push('<p>JSON: good.</p>');
+            } else if (data.globals) {
+                output.push('<div><i>Global</i> ' +
+                    data.globals.sort().join(', ') + '</div>');
+            } else {
+                output.push('<div><i>No new global variables introduced.</i></div>');
+            }
+
+            for (i = 0; i < data.functions.length; i += 1) {
+                the_function = data.functions[i];
+                names = [];
+                if (the_function.params) {
+                    for (j = 0; j < the_function.params.length; j += 1) {
+                        names[j] = the_function.params[j].string;
+                    }
+                }
+                output.push('<br><div class=function><i>' +
+                    String(the_function.line) + '</i> ' +
+                    the_function.name.entityify() +
+                    '(' + names.join(', ') + ')</div>');
+                detail('<big><b>Undefined</b></big>', the_function['undefined']);
+                detail('<big><b>Unused</b></big>', the_function.unused);
+                detail('Closure', the_function.closure);
+                detail('Variable', the_function['var']);
+                detail('Exception', the_function.exception);
+                detail('Outer', the_function.outer);
+                detail('Global', the_function.global);
+                detail('Label', the_function.label);
+            }
+
+            if (data.member) {
+                keys = Object.keys(data.member);
+                if (keys.length) {
+                    keys = keys.sort();
+                    output.push('<br><pre id=properties>/*properties<br>');
+                    mem = '    ';
+                    italics = 0;
+                    j = 0;
+                    not_first = false;
+                    for (i = 0; i < keys.length; i += 1) {
+                        key = keys[i];
+                        if (data.member[key] > 0) {
+                            if (not_first) {
+                                mem += ', ';
+                            }
+                            name = ix.test(key)
+                                ? key
+                                : '\'' + key.entityify().replace(nx, sanitize) + '\'';
+                            length += name.length + 2;
+                            if (data.member[key] === 1) {
+                                name = '<i>' + name + '</i>';
+                                italics += 1;
+                                j = 1;
+                            }
+                            if (mem.length + name.length - (italics * 7) > 80) {
+                                output.push(mem + '<br>');
+                                mem = '    ';
+                                italics = j;
+                            }
+                            mem += name;
+                            j = 0;
+                            not_first = true;
+                        }
+                    }
+                    output.push(mem + '<br>*/</pre>');
+                }
+                output.push('</div>');
+            }
+        }
+        return output.join('');
+    };
+    itself.jslint = itself;
+
+    itself.edition = '2012-03-02';
+
+    return itself;
+}());
diff --git a/build-tools/lib/jslint/linter.js b/build-tools/lib/jslint/linter.js
new file mode 100644 (file)
index 0000000..1ba46e4
--- /dev/null
@@ -0,0 +1,45 @@
+/* original
+var JSLINT = require("../lib/nodelint");
+ */
+var JSLINT = require("./nodelint");
+
+function addDefaults(options) {
+    'use strict';
+    ['node', 'es5'].forEach(function (opt) {
+        if (!options.hasOwnProperty(opt)) {
+            options[opt] = true;
+        }
+    });
+    return options;
+}
+
+exports.lint = function (script, options) {
+    'use strict';
+    // remove shebang
+    /*jslint regexp: true*/
+    script = script.replace(/^\#\!.*/, "");
+
+    options = options || {};
+    delete options.argv;
+    options = addDefaults(options);
+
+    if (options.predef && !Array.isArray(options.predef)) {
+        options.predef = options.predef.split(',')
+            .filter(function (n) { return !!n; });
+    }
+
+    var ok = JSLINT(script, options),
+        result = {
+            ok: true,
+            errors: []
+        };
+
+    if (!ok) {
+        result = JSLINT.data();
+        result.ok = ok;
+    }
+
+    result.options = options;
+
+    return result;
+};
diff --git a/build-tools/lib/jslint/nodelint.js b/build-tools/lib/jslint/nodelint.js
new file mode 100644 (file)
index 0000000..a7bb701
--- /dev/null
@@ -0,0 +1,11 @@
+/*jslint
+    nomen: true
+ */
+var vm = require("vm");
+var fs = require("fs");
+
+var ctx = vm.createContext();
+
+vm.runInContext(fs.readFileSync(__dirname + "/jslint.js"), ctx);
+
+module.exports = ctx.JSLINT;
diff --git a/build-tools/lib/jslint/nopt.js b/build-tools/lib/jslint/nopt.js
new file mode 100644 (file)
index 0000000..6f77d04
--- /dev/null
@@ -0,0 +1,552 @@
+// info about each config option.
+
+var debug = process.env.DEBUG_NOPT || process.env.NOPT_DEBUG
+  ? function () { console.error.apply(console, arguments) }
+  : function () {}
+
+var url = require("url")
+  , path = require("path")
+  , Stream = require("stream").Stream
+  , abbrev = require("./abbrev")
+
+module.exports = exports = nopt
+exports.clean = clean
+
+exports.typeDefs =
+  { String  : { type: String,  validate: validateString  }
+  , Boolean : { type: Boolean, validate: validateBoolean }
+  , url     : { type: url,     validate: validateUrl     }
+  , Number  : { type: Number,  validate: validateNumber  }
+  , path    : { type: path,    validate: validatePath    }
+  , Stream  : { type: Stream,  validate: validateStream  }
+  , Date    : { type: Date,    validate: validateDate    }
+  }
+
+function nopt (types, shorthands, args, slice) {
+  args = args || process.argv
+  types = types || {}
+  shorthands = shorthands || {}
+  if (typeof slice !== "number") slice = 2
+
+  debug(types, shorthands, args, slice)
+
+  args = args.slice(slice)
+  var data = {}
+    , key
+    , remain = []
+    , cooked = args
+    , original = args.slice(0)
+
+  parse(args, data, remain, types, shorthands)
+  // now data is full
+  clean(data, types, exports.typeDefs)
+  data.argv = {remain:remain,cooked:cooked,original:original}
+  data.argv.toString = function () {
+    return this.original.map(JSON.stringify).join(" ")
+  }
+  return data
+}
+
+function clean (data, types, typeDefs) {
+  typeDefs = typeDefs || exports.typeDefs
+  var remove = {}
+    , typeDefault = [false, true, null, String, Number]
+
+  Object.keys(data).forEach(function (k) {
+    if (k === "argv") return
+    var val = data[k]
+      , isArray = Array.isArray(val)
+      , type = types[k]
+    if (!isArray) val = [val]
+    if (!type) type = typeDefault
+    if (type === Array) type = typeDefault.concat(Array)
+    if (!Array.isArray(type)) type = [type]
+
+    debug("val=%j", val)
+    debug("types=", type)
+    val = val.map(function (val) {
+      // if it's an unknown value, then parse false/true/null/numbers/dates
+      if (typeof val === "string") {
+        debug("string %j", val)
+        val = val.trim()
+        if ((val === "null" && ~type.indexOf(null))
+            || (val === "true" &&
+               (~type.indexOf(true) || ~type.indexOf(Boolean)))
+            || (val === "false" &&
+               (~type.indexOf(false) || ~type.indexOf(Boolean)))) {
+          val = JSON.parse(val)
+          debug("jsonable %j", val)
+        } else if (~type.indexOf(Number) && !isNaN(val)) {
+          debug("convert to number", val)
+          val = +val
+        } else if (~type.indexOf(Date) && !isNaN(Date.parse(val))) {
+          debug("convert to date", val)
+          val = new Date(val)
+        }
+      }
+
+      if (!types.hasOwnProperty(k)) {
+        return val
+      }
+
+      // allow `--no-blah` to set 'blah' to null if null is allowed
+      if (val === false && ~type.indexOf(null) &&
+          !(~type.indexOf(false) || ~type.indexOf(Boolean))) {
+        val = null
+      }
+
+      var d = {}
+      d[k] = val
+      debug("prevalidated val", d, val, types[k])
+      if (!validate(d, k, val, types[k], typeDefs)) {
+        if (exports.invalidHandler) {
+          exports.invalidHandler(k, val, types[k], data)
+        } else if (exports.invalidHandler !== false) {
+          debug("invalid: "+k+"="+val, types[k])
+        }
+        return remove
+      }
+      debug("validated val", d, val, types[k])
+      return d[k]
+    }).filter(function (val) { return val !== remove })
+
+    if (!val.length) delete data[k]
+    else if (isArray) {
+      debug(isArray, data[k], val)
+      data[k] = val
+    } else data[k] = val[0]
+
+    debug("k=%s val=%j", k, val, data[k])
+  })
+}
+
+function validateString (data, k, val) {
+  data[k] = String(val)
+}
+
+function validatePath (data, k, val) {
+  data[k] = path.resolve(String(val))
+  return true
+}
+
+function validateNumber (data, k, val) {
+  debug("validate Number %j %j %j", k, val, isNaN(val))
+  if (isNaN(val)) return false
+  data[k] = +val
+}
+
+function validateDate (data, k, val) {
+  debug("validate Date %j %j %j", k, val, Date.parse(val))
+  var s = Date.parse(val)
+  if (isNaN(s)) return false
+  data[k] = new Date(val)
+}
+
+function validateBoolean (data, k, val) {
+  if (val instanceof Boolean) val = val.valueOf()
+  else if (typeof val === "string") {
+    if (!isNaN(val)) val = !!(+val)
+    else if (val === "null" || val === "false") val = false
+    else val = true
+  } else val = !!val
+  data[k] = val
+}
+
+function validateUrl (data, k, val) {
+  val = url.parse(String(val))
+  if (!val.host) return false
+  data[k] = val.href
+}
+
+function validateStream (data, k, val) {
+  if (!(val instanceof Stream)) return false
+  data[k] = val
+}
+
+function validate (data, k, val, type, typeDefs) {
+  // arrays are lists of types.
+  if (Array.isArray(type)) {
+    for (var i = 0, l = type.length; i < l; i ++) {
+      if (type[i] === Array) continue
+      if (validate(data, k, val, type[i], typeDefs)) return true
+    }
+    delete data[k]
+    return false
+  }
+
+  // an array of anything?
+  if (type === Array) return true
+
+  // NaN is poisonous.  Means that something is not allowed.
+  if (type !== type) {
+    debug("Poison NaN", k, val, type)
+    delete data[k]
+    return false
+  }
+
+  // explicit list of values
+  if (val === type) {
+    debug("Explicitly allowed %j", val)
+    // if (isArray) (data[k] = data[k] || []).push(val)
+    // else data[k] = val
+    data[k] = val
+    return true
+  }
+
+  // now go through the list of typeDefs, validate against each one.
+  var ok = false
+    , types = Object.keys(typeDefs)
+  for (var i = 0, l = types.length; i < l; i ++) {
+    debug("test type %j %j %j", k, val, types[i])
+    var t = typeDefs[types[i]]
+    if (t && type === t.type) {
+      var d = {}
+      ok = false !== t.validate(d, k, val)
+      val = d[k]
+      if (ok) {
+        // if (isArray) (data[k] = data[k] || []).push(val)
+        // else data[k] = val
+        data[k] = val
+        break
+      }
+    }
+  }
+  debug("OK? %j (%j %j %j)", ok, k, val, types[i])
+
+  if (!ok) delete data[k]
+  return ok
+}
+
+function parse (args, data, remain, types, shorthands) {
+  debug("parse", args, data, remain)
+
+  var key = null
+    , abbrevs = abbrev(Object.keys(types))
+    , shortAbbr = abbrev(Object.keys(shorthands))
+
+  for (var i = 0; i < args.length; i ++) {
+    var arg = args[i]
+    debug("arg", arg)
+
+    if (arg.match(/^-{2,}$/)) {
+      // done with keys.
+      // the rest are args.
+      remain.push.apply(remain, args.slice(i + 1))
+      args[i] = "--"
+      break
+    }
+    if (arg.charAt(0) === "-") {
+      if (arg.indexOf("=") !== -1) {
+        var v = arg.split("=")
+        arg = v.shift()
+        v = v.join("=")
+        args.splice.apply(args, [i, 1].concat([arg, v]))
+      }
+      // see if it's a shorthand
+      // if so, splice and back up to re-parse it.
+      var shRes = resolveShort(arg, shorthands, shortAbbr, abbrevs)
+      debug("arg=%j shRes=%j", arg, shRes)
+      if (shRes) {
+        debug(arg, shRes)
+        args.splice.apply(args, [i, 1].concat(shRes))
+        if (arg !== shRes[0]) {
+          i --
+          continue
+        }
+      }
+      arg = arg.replace(/^-+/, "")
+      var no = false
+      while (arg.toLowerCase().indexOf("no-") === 0) {
+        no = !no
+        arg = arg.substr(3)
+      }
+
+      if (abbrevs[arg]) arg = abbrevs[arg]
+
+      var isArray = types[arg] === Array ||
+        Array.isArray(types[arg]) && types[arg].indexOf(Array) !== -1
+
+      var val
+        , la = args[i + 1]
+
+      var isBool = no ||
+        types[arg] === Boolean ||
+        Array.isArray(types[arg]) && types[arg].indexOf(Boolean) !== -1 ||
+        (la === "false" &&
+         (types[arg] === null ||
+          Array.isArray(types[arg]) && ~types[arg].indexOf(null)))
+
+      if (isBool) {
+        // just set and move along
+        val = !no
+        // however, also support --bool true or --bool false
+        if (la === "true" || la === "false") {
+          val = JSON.parse(la)
+          la = null
+          if (no) val = !val
+          i ++
+        }
+
+        // also support "foo":[Boolean, "bar"] and "--foo bar"
+        if (Array.isArray(types[arg]) && la) {
+          if (~types[arg].indexOf(la)) {
+            // an explicit type
+            val = la
+            i ++
+          } else if ( la === "null" && ~types[arg].indexOf(null) ) {
+            // null allowed
+            val = null
+            i ++
+          } else if ( !la.match(/^-{2,}[^-]/) &&
+                      !isNaN(la) &&
+                      ~types[arg].indexOf(Number) ) {
+            // number
+            val = +la
+            i ++
+          } else if ( !la.match(/^-[^-]/) && ~types[arg].indexOf(String) ) {
+            // string
+            val = la
+            i ++
+          }
+        }
+
+        if (isArray) (data[arg] = data[arg] || []).push(val)
+        else data[arg] = val
+
+        continue
+      }
+
+      if (la && la.match(/^-{2,}$/)) {
+        la = undefined
+        i --
+      }
+
+      val = la === undefined ? true : la
+      if (isArray) (data[arg] = data[arg] || []).push(val)
+      else data[arg] = val
+
+      i ++
+      continue
+    }
+    remain.push(arg)
+  }
+}
+
+function resolveShort (arg, shorthands, shortAbbr, abbrevs) {
+  // handle single-char shorthands glommed together, like
+  // npm ls -glp, but only if there is one dash, and only if
+  // all of the chars are single-char shorthands, and it's
+  // not a match to some other abbrev.
+  arg = arg.replace(/^-+/, '')
+  if (abbrevs[arg] && !shorthands[arg]) {
+    return null
+  }
+  if (shortAbbr[arg]) {
+    arg = shortAbbr[arg]
+  } else {
+    var singles = shorthands.___singles
+    if (!singles) {
+      singles = Object.keys(shorthands).filter(function (s) {
+        return s.length === 1
+      }).reduce(function (l,r) { l[r] = true ; return l }, {})
+      shorthands.___singles = singles
+    }
+    var chrs = arg.split("").filter(function (c) {
+      return singles[c]
+    })
+    if (chrs.join("") === arg) return chrs.map(function (c) {
+      return shorthands[c]
+    }).reduce(function (l, r) {
+      return l.concat(r)
+    }, [])
+  }
+
+  if (shorthands[arg] && !Array.isArray(shorthands[arg])) {
+    shorthands[arg] = shorthands[arg].split(/\s+/)
+  }
+  return shorthands[arg]
+}
+
+if (module === require.main) {
+var assert = require("assert")
+  , util = require("util")
+
+  , shorthands =
+    { s : ["--loglevel", "silent"]
+    , d : ["--loglevel", "info"]
+    , dd : ["--loglevel", "verbose"]
+    , ddd : ["--loglevel", "silly"]
+    , noreg : ["--no-registry"]
+    , reg : ["--registry"]
+    , "no-reg" : ["--no-registry"]
+    , silent : ["--loglevel", "silent"]
+    , verbose : ["--loglevel", "verbose"]
+    , h : ["--usage"]
+    , H : ["--usage"]
+    , "?" : ["--usage"]
+    , help : ["--usage"]
+    , v : ["--version"]
+    , f : ["--force"]
+    , desc : ["--description"]
+    , "no-desc" : ["--no-description"]
+    , "local" : ["--no-global"]
+    , l : ["--long"]
+    , p : ["--parseable"]
+    , porcelain : ["--parseable"]
+    , g : ["--global"]
+    }
+
+  , types =
+    { aoa: Array
+    , nullstream: [null, Stream]
+    , date: Date
+    , str: String
+    , browser : String
+    , cache : path
+    , color : ["always", Boolean]
+    , depth : Number
+    , description : Boolean
+    , dev : Boolean
+    , editor : path
+    , force : Boolean
+    , global : Boolean
+    , globalconfig : path
+    , group : [String, Number]
+    , gzipbin : String
+    , logfd : [Number, Stream]
+    , loglevel : ["silent","win","error","warn","info","verbose","silly"]
+    , long : Boolean
+    , "node-version" : [false, String]
+    , npaturl : url
+    , npat : Boolean
+    , "onload-script" : [false, String]
+    , outfd : [Number, Stream]
+    , parseable : Boolean
+    , pre: Boolean
+    , prefix: path
+    , proxy : url
+    , "rebuild-bundle" : Boolean
+    , registry : url
+    , searchopts : String
+    , searchexclude: [null, String]
+    , shell : path
+    , t: [Array, String]
+    , tag : String
+    , tar : String
+    , tmp : path
+    , "unsafe-perm" : Boolean
+    , usage : Boolean
+    , user : String
+    , username : String
+    , userconfig : path
+    , version : Boolean
+    , viewer: path
+    , _exit : Boolean
+    }
+
+; [["-v", {version:true}, []]
+  ,["---v", {version:true}, []]
+  ,["ls -s --no-reg connect -d",
+    {loglevel:"info",registry:null},["ls","connect"]]
+  ,["ls ---s foo",{loglevel:"silent"},["ls","foo"]]
+  ,["ls --registry blargle", {}, ["ls"]]
+  ,["--no-registry", {registry:null}, []]
+  ,["--no-color true", {color:false}, []]
+  ,["--no-color false", {color:true}, []]
+  ,["--no-color", {color:false}, []]
+  ,["--color false", {color:false}, []]
+  ,["--color --logfd 7", {logfd:7,color:true}, []]
+  ,["--color=true", {color:true}, []]
+  ,["--logfd=10", {logfd:10}, []]
+  ,["--tmp=/tmp -tar=gtar",{tmp:"/tmp",tar:"gtar"},[]]
+  ,["--tmp=tmp -tar=gtar",
+    {tmp:path.resolve(process.cwd(), "tmp"),tar:"gtar"},[]]
+  ,["--logfd x", {}, []]
+  ,["a -true -- -no-false", {true:true},["a","-no-false"]]
+  ,["a -no-false", {false:false},["a"]]
+  ,["a -no-no-true", {true:true}, ["a"]]
+  ,["a -no-no-no-false", {false:false}, ["a"]]
+  ,["---NO-no-No-no-no-no-nO-no-no"+
+    "-No-no-no-no-no-no-no-no-no"+
+    "-no-no-no-no-NO-NO-no-no-no-no-no-no"+
+    "-no-body-can-do-the-boogaloo-like-I-do"
+   ,{"body-can-do-the-boogaloo-like-I-do":false}, []]
+  ,["we are -no-strangers-to-love "+
+    "--you-know the-rules --and so-do-i "+
+    "---im-thinking-of=a-full-commitment "+
+    "--no-you-would-get-this-from-any-other-guy "+
+    "--no-gonna-give-you-up "+
+    "-no-gonna-let-you-down=true "+
+    "--no-no-gonna-run-around false "+
+    "--desert-you=false "+
+    "--make-you-cry false "+
+    "--no-tell-a-lie "+
+    "--no-no-and-hurt-you false"
+   ,{"strangers-to-love":false
+    ,"you-know":"the-rules"
+    ,"and":"so-do-i"
+    ,"you-would-get-this-from-any-other-guy":false
+    ,"gonna-give-you-up":false
+    ,"gonna-let-you-down":false
+    ,"gonna-run-around":false
+    ,"desert-you":false
+    ,"make-you-cry":false
+    ,"tell-a-lie":false
+    ,"and-hurt-you":false
+    },["we", "are"]]
+  ,["-t one -t two -t three"
+   ,{t: ["one", "two", "three"]}
+   ,[]]
+  ,["-t one -t null -t three four five null"
+   ,{t: ["one", "null", "three"]}
+   ,["four", "five", "null"]]
+  ,["-t foo"
+   ,{t:["foo"]}
+   ,[]]
+  ,["--no-t"
+   ,{t:["false"]}
+   ,[]]
+  ,["-no-no-t"
+   ,{t:["true"]}
+   ,[]]
+  ,["-aoa one -aoa null -aoa 100"
+   ,{aoa:["one", null, 100]}
+   ,[]]
+  ,["-str 100"
+   ,{str:"100"}
+   ,[]]
+  ,["--color always"
+   ,{color:"always"}
+   ,[]]
+  ,["--no-nullstream"
+   ,{nullstream:null}
+   ,[]]
+  ,["--nullstream false"
+   ,{nullstream:null}
+   ,[]]
+  ,["--notadate 2011-01-25"
+   ,{notadate: "2011-01-25"}
+   ,[]]
+  ,["--date 2011-01-25"
+   ,{date: new Date("2011-01-25")}
+   ,[]]
+  ].forEach(function (test) {
+    var argv = test[0].split(/\s+/)
+      , opts = test[1]
+      , rem = test[2]
+      , actual = nopt(types, shorthands, argv, 0)
+      , parsed = actual.argv
+    delete actual.argv
+    console.log(util.inspect(actual, false, 2, true), parsed.remain)
+    for (var i in opts) {
+      var e = JSON.stringify(opts[i])
+        , a = JSON.stringify(actual[i] === undefined ? null : actual[i])
+      if (e && typeof e === "object") {
+        assert.deepEqual(e, a)
+      } else {
+        assert.equal(e, a)
+      }
+    }
+    assert.deepEqual(rem, parsed.remain)
+  })
+}
diff --git a/build-tools/lib/jslint/nopt/LICENSE b/build-tools/lib/jslint/nopt/LICENSE
new file mode 100644 (file)
index 0000000..05a4010
--- /dev/null
@@ -0,0 +1,23 @@
+Copyright 2009, 2010, 2011 Isaac Z. Schlueter.
+All rights reserved.
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
diff --git a/build-tools/lib/jslint/nopt/abbrev.js b/build-tools/lib/jslint/nopt/abbrev.js
new file mode 100644 (file)
index 0000000..037de2d
--- /dev/null
@@ -0,0 +1,106 @@
+
+module.exports = exports = abbrev.abbrev = abbrev
+
+abbrev.monkeyPatch = monkeyPatch
+
+function monkeyPatch () {
+  Array.prototype.abbrev = function () { return abbrev(this) }
+  Object.prototype.abbrev = function () { return abbrev(Object.keys(this)) }
+}
+
+function abbrev (list) {
+  if (arguments.length !== 1 || !Array.isArray(list)) {
+    list = Array.prototype.slice.call(arguments, 0)
+  }
+  for (var i = 0, l = list.length, args = [] ; i < l ; i ++) {
+    args[i] = typeof list[i] === "string" ? list[i] : String(list[i])
+  }
+
+  // sort them lexicographically, so that they're next to their nearest kin
+  args = args.sort(lexSort)
+
+  // walk through each, seeing how much it has in common with the next and previous
+  var abbrevs = {}
+    , prev = ""
+  for (var i = 0, l = args.length ; i < l ; i ++) {
+    var current = args[i]
+      , next = args[i + 1] || ""
+      , nextMatches = true
+      , prevMatches = true
+    if (current === next) continue
+    for (var j = 0, cl = current.length ; j < cl ; j ++) {
+      var curChar = current.charAt(j)
+      nextMatches = nextMatches && curChar === next.charAt(j)
+      prevMatches = prevMatches && curChar === prev.charAt(j)
+      if (nextMatches || prevMatches) continue
+      else {
+        j ++
+        break
+      }
+    }
+    prev = current
+    if (j === cl) {
+      abbrevs[current] = current
+      continue
+    }
+    for (var a = current.substr(0, j) ; j <= cl ; j ++) {
+      abbrevs[a] = current
+      a += current.charAt(j)
+    }
+  }
+  return abbrevs
+}
+
+function lexSort (a, b) {
+  return a === b ? 0 : a > b ? 1 : -1
+}
+
+
+// tests
+if (module === require.main) {
+
+var assert = require("assert")
+  , sys
+sys = require("util")
+
+console.log("running tests")
+function test (list, expect) {
+  var actual = abbrev(list)
+  assert.deepEqual(actual, expect,
+    "abbrev("+sys.inspect(list)+") === " + sys.inspect(expect) + "\n"+
+    "actual: "+sys.inspect(actual))
+  actual = abbrev.apply(exports, list)
+  assert.deepEqual(abbrev.apply(exports, list), expect,
+    "abbrev("+list.map(JSON.stringify).join(",")+") === " + sys.inspect(expect) + "\n"+
+    "actual: "+sys.inspect(actual))
+}
+
+test([ "ruby", "ruby", "rules", "rules", "rules" ],
+{ rub: 'ruby'
+, ruby: 'ruby'
+, rul: 'rules'
+, rule: 'rules'
+, rules: 'rules'
+})
+test(["fool", "foom", "pool", "pope"],
+{ fool: 'fool'
+, foom: 'foom'
+, poo: 'pool'
+, pool: 'pool'
+, pop: 'pope'
+, pope: 'pope'
+})
+test(["a", "ab", "abc", "abcd", "abcde", "acde"],
+{ a: 'a'
+, ab: 'ab'
+, abc: 'abc'
+, abcd: 'abcd'
+, abcde: 'abcde'
+, ac: 'acde'
+, acd: 'acde'
+, acde: 'acde'
+})
+
+console.log("pass")
+
+}
diff --git a/build-tools/lib/jslint/nopt/nopt.js b/build-tools/lib/jslint/nopt/nopt.js
new file mode 100644 (file)
index 0000000..6f77d04
--- /dev/null
@@ -0,0 +1,552 @@
+// info about each config option.
+
+var debug = process.env.DEBUG_NOPT || process.env.NOPT_DEBUG
+  ? function () { console.error.apply(console, arguments) }
+  : function () {}
+
+var url = require("url")
+  , path = require("path")
+  , Stream = require("stream").Stream
+  , abbrev = require("./abbrev")
+
+module.exports = exports = nopt
+exports.clean = clean
+
+exports.typeDefs =
+  { String  : { type: String,  validate: validateString  }
+  , Boolean : { type: Boolean, validate: validateBoolean }
+  , url     : { type: url,     validate: validateUrl     }
+  , Number  : { type: Number,  validate: validateNumber  }
+  , path    : { type: path,    validate: validatePath    }
+  , Stream  : { type: Stream,  validate: validateStream  }
+  , Date    : { type: Date,    validate: validateDate    }
+  }
+
+function nopt (types, shorthands, args, slice) {
+  args = args || process.argv
+  types = types || {}
+  shorthands = shorthands || {}
+  if (typeof slice !== "number") slice = 2
+
+  debug(types, shorthands, args, slice)
+
+  args = args.slice(slice)
+  var data = {}
+    , key
+    , remain = []
+    , cooked = args
+    , original = args.slice(0)
+
+  parse(args, data, remain, types, shorthands)
+  // now data is full
+  clean(data, types, exports.typeDefs)
+  data.argv = {remain:remain,cooked:cooked,original:original}
+  data.argv.toString = function () {
+    return this.original.map(JSON.stringify).join(" ")
+  }
+  return data
+}
+
+function clean (data, types, typeDefs) {
+  typeDefs = typeDefs || exports.typeDefs
+  var remove = {}
+    , typeDefault = [false, true, null, String, Number]
+
+  Object.keys(data).forEach(function (k) {
+    if (k === "argv") return
+    var val = data[k]
+      , isArray = Array.isArray(val)
+      , type = types[k]
+    if (!isArray) val = [val]
+    if (!type) type = typeDefault
+    if (type === Array) type = typeDefault.concat(Array)
+    if (!Array.isArray(type)) type = [type]
+
+    debug("val=%j", val)
+    debug("types=", type)
+    val = val.map(function (val) {
+      // if it's an unknown value, then parse false/true/null/numbers/dates
+      if (typeof val === "string") {
+        debug("string %j", val)
+        val = val.trim()
+        if ((val === "null" && ~type.indexOf(null))
+            || (val === "true" &&
+               (~type.indexOf(true) || ~type.indexOf(Boolean)))
+            || (val === "false" &&
+               (~type.indexOf(false) || ~type.indexOf(Boolean)))) {
+          val = JSON.parse(val)
+          debug("jsonable %j", val)
+        } else if (~type.indexOf(Number) && !isNaN(val)) {
+          debug("convert to number", val)
+          val = +val
+        } else if (~type.indexOf(Date) && !isNaN(Date.parse(val))) {
+          debug("convert to date", val)
+          val = new Date(val)
+        }
+      }
+
+      if (!types.hasOwnProperty(k)) {
+        return val
+      }
+
+      // allow `--no-blah` to set 'blah' to null if null is allowed
+      if (val === false && ~type.indexOf(null) &&
+          !(~type.indexOf(false) || ~type.indexOf(Boolean))) {
+        val = null
+      }
+
+      var d = {}
+      d[k] = val
+      debug("prevalidated val", d, val, types[k])
+      if (!validate(d, k, val, types[k], typeDefs)) {
+        if (exports.invalidHandler) {
+          exports.invalidHandler(k, val, types[k], data)
+        } else if (exports.invalidHandler !== false) {
+          debug("invalid: "+k+"="+val, types[k])
+        }
+        return remove
+      }
+      debug("validated val", d, val, types[k])
+      return d[k]
+    }).filter(function (val) { return val !== remove })
+
+    if (!val.length) delete data[k]
+    else if (isArray) {
+      debug(isArray, data[k], val)
+      data[k] = val
+    } else data[k] = val[0]
+
+    debug("k=%s val=%j", k, val, data[k])
+  })
+}
+
+function validateString (data, k, val) {
+  data[k] = String(val)
+}
+
+function validatePath (data, k, val) {
+  data[k] = path.resolve(String(val))
+  return true
+}
+
+function validateNumber (data, k, val) {
+  debug("validate Number %j %j %j", k, val, isNaN(val))
+  if (isNaN(val)) return false
+  data[k] = +val
+}
+
+function validateDate (data, k, val) {
+  debug("validate Date %j %j %j", k, val, Date.parse(val))
+  var s = Date.parse(val)
+  if (isNaN(s)) return false
+  data[k] = new Date(val)
+}
+
+function validateBoolean (data, k, val) {
+  if (val instanceof Boolean) val = val.valueOf()
+  else if (typeof val === "string") {
+    if (!isNaN(val)) val = !!(+val)
+    else if (val === "null" || val === "false") val = false
+    else val = true
+  } else val = !!val
+  data[k] = val
+}
+
+function validateUrl (data, k, val) {
+  val = url.parse(String(val))
+  if (!val.host) return false
+  data[k] = val.href
+}
+
+function validateStream (data, k, val) {
+  if (!(val instanceof Stream)) return false
+  data[k] = val
+}
+
+function validate (data, k, val, type, typeDefs) {
+  // arrays are lists of types.
+  if (Array.isArray(type)) {
+    for (var i = 0, l = type.length; i < l; i ++) {
+      if (type[i] === Array) continue
+      if (validate(data, k, val, type[i], typeDefs)) return true
+    }
+    delete data[k]
+    return false
+  }
+
+  // an array of anything?
+  if (type === Array) return true
+
+  // NaN is poisonous.  Means that something is not allowed.
+  if (type !== type) {
+    debug("Poison NaN", k, val, type)
+    delete data[k]
+    return false
+  }
+
+  // explicit list of values
+  if (val === type) {
+    debug("Explicitly allowed %j", val)
+    // if (isArray) (data[k] = data[k] || []).push(val)
+    // else data[k] = val
+    data[k] = val
+    return true
+  }
+
+  // now go through the list of typeDefs, validate against each one.
+  var ok = false
+    , types = Object.keys(typeDefs)
+  for (var i = 0, l = types.length; i < l; i ++) {
+    debug("test type %j %j %j", k, val, types[i])
+    var t = typeDefs[types[i]]
+    if (t && type === t.type) {
+      var d = {}
+      ok = false !== t.validate(d, k, val)
+      val = d[k]
+      if (ok) {
+        // if (isArray) (data[k] = data[k] || []).push(val)
+        // else data[k] = val
+        data[k] = val
+        break
+      }
+    }
+  }
+  debug("OK? %j (%j %j %j)", ok, k, val, types[i])
+
+  if (!ok) delete data[k]
+  return ok
+}
+
+function parse (args, data, remain, types, shorthands) {
+  debug("parse", args, data, remain)
+
+  var key = null
+    , abbrevs = abbrev(Object.keys(types))
+    , shortAbbr = abbrev(Object.keys(shorthands))
+
+  for (var i = 0; i < args.length; i ++) {
+    var arg = args[i]
+    debug("arg", arg)
+
+    if (arg.match(/^-{2,}$/)) {
+      // done with keys.
+      // the rest are args.
+      remain.push.apply(remain, args.slice(i + 1))
+      args[i] = "--"
+      break
+    }
+    if (arg.charAt(0) === "-") {
+      if (arg.indexOf("=") !== -1) {
+        var v = arg.split("=")
+        arg = v.shift()
+        v = v.join("=")
+        args.splice.apply(args, [i, 1].concat([arg, v]))
+      }
+      // see if it's a shorthand
+      // if so, splice and back up to re-parse it.
+      var shRes = resolveShort(arg, shorthands, shortAbbr, abbrevs)
+      debug("arg=%j shRes=%j", arg, shRes)
+      if (shRes) {
+        debug(arg, shRes)
+        args.splice.apply(args, [i, 1].concat(shRes))
+        if (arg !== shRes[0]) {
+          i --
+          continue
+        }
+      }
+      arg = arg.replace(/^-+/, "")
+      var no = false
+      while (arg.toLowerCase().indexOf("no-") === 0) {
+        no = !no
+        arg = arg.substr(3)
+      }
+
+      if (abbrevs[arg]) arg = abbrevs[arg]
+
+      var isArray = types[arg] === Array ||
+        Array.isArray(types[arg]) && types[arg].indexOf(Array) !== -1
+
+      var val
+        , la = args[i + 1]
+
+      var isBool = no ||
+        types[arg] === Boolean ||
+        Array.isArray(types[arg]) && types[arg].indexOf(Boolean) !== -1 ||
+        (la === "false" &&
+         (types[arg] === null ||
+          Array.isArray(types[arg]) && ~types[arg].indexOf(null)))
+
+      if (isBool) {
+        // just set and move along
+        val = !no
+        // however, also support --bool true or --bool false
+        if (la === "true" || la === "false") {
+          val = JSON.parse(la)
+          la = null
+          if (no) val = !val
+          i ++
+        }
+
+        // also support "foo":[Boolean, "bar"] and "--foo bar"
+        if (Array.isArray(types[arg]) && la) {
+          if (~types[arg].indexOf(la)) {
+            // an explicit type
+            val = la
+            i ++
+          } else if ( la === "null" && ~types[arg].indexOf(null) ) {
+            // null allowed
+            val = null
+            i ++
+          } else if ( !la.match(/^-{2,}[^-]/) &&
+                      !isNaN(la) &&
+                      ~types[arg].indexOf(Number) ) {
+            // number
+            val = +la
+            i ++
+          } else if ( !la.match(/^-[^-]/) && ~types[arg].indexOf(String) ) {
+            // string
+            val = la
+            i ++
+          }
+        }
+
+        if (isArray) (data[arg] = data[arg] || []).push(val)
+        else data[arg] = val
+
+        continue
+      }
+
+      if (la && la.match(/^-{2,}$/)) {
+        la = undefined
+        i --
+      }
+
+      val = la === undefined ? true : la
+      if (isArray) (data[arg] = data[arg] || []).push(val)
+      else data[arg] = val
+
+      i ++
+      continue
+    }
+    remain.push(arg)
+  }
+}
+
+function resolveShort (arg, shorthands, shortAbbr, abbrevs) {
+  // handle single-char shorthands glommed together, like
+  // npm ls -glp, but only if there is one dash, and only if
+  // all of the chars are single-char shorthands, and it's
+  // not a match to some other abbrev.
+  arg = arg.replace(/^-+/, '')
+  if (abbrevs[arg] && !shorthands[arg]) {
+    return null
+  }
+  if (shortAbbr[arg]) {
+    arg = shortAbbr[arg]
+  } else {
+    var singles = shorthands.___singles
+    if (!singles) {
+      singles = Object.keys(shorthands).filter(function (s) {
+        return s.length === 1
+      }).reduce(function (l,r) { l[r] = true ; return l }, {})
+      shorthands.___singles = singles
+    }
+    var chrs = arg.split("").filter(function (c) {
+      return singles[c]
+    })
+    if (chrs.join("") === arg) return chrs.map(function (c) {
+      return shorthands[c]
+    }).reduce(function (l, r) {
+      return l.concat(r)
+    }, [])
+  }
+
+  if (shorthands[arg] && !Array.isArray(shorthands[arg])) {
+    shorthands[arg] = shorthands[arg].split(/\s+/)
+  }
+  return shorthands[arg]
+}
+
+if (module === require.main) {
+var assert = require("assert")
+  , util = require("util")
+
+  , shorthands =
+    { s : ["--loglevel", "silent"]
+    , d : ["--loglevel", "info"]
+    , dd : ["--loglevel", "verbose"]
+    , ddd : ["--loglevel", "silly"]
+    , noreg : ["--no-registry"]
+    , reg : ["--registry"]
+    , "no-reg" : ["--no-registry"]
+    , silent : ["--loglevel", "silent"]
+    , verbose : ["--loglevel", "verbose"]
+    , h : ["--usage"]
+    , H : ["--usage"]
+    , "?" : ["--usage"]
+    , help : ["--usage"]
+    , v : ["--version"]
+    , f : ["--force"]
+    , desc : ["--description"]
+    , "no-desc" : ["--no-description"]
+    , "local" : ["--no-global"]
+    , l : ["--long"]
+    , p : ["--parseable"]
+    , porcelain : ["--parseable"]
+    , g : ["--global"]
+    }
+
+  , types =
+    { aoa: Array
+    , nullstream: [null, Stream]
+    , date: Date
+    , str: String
+    , browser : String
+    , cache : path
+    , color : ["always", Boolean]
+    , depth : Number
+    , description : Boolean
+    , dev : Boolean
+    , editor : path
+    , force : Boolean
+    , global : Boolean
+    , globalconfig : path
+    , group : [String, Number]
+    , gzipbin : String
+    , logfd : [Number, Stream]
+    , loglevel : ["silent","win","error","warn","info","verbose","silly"]
+    , long : Boolean
+    , "node-version" : [false, String]
+    , npaturl : url
+    , npat : Boolean
+    , "onload-script" : [false, String]
+    , outfd : [Number, Stream]
+    , parseable : Boolean
+    , pre: Boolean
+    , prefix: path
+    , proxy : url
+    , "rebuild-bundle" : Boolean
+    , registry : url
+    , searchopts : String
+    , searchexclude: [null, String]
+    , shell : path
+    , t: [Array, String]
+    , tag : String
+    , tar : String
+    , tmp : path
+    , "unsafe-perm" : Boolean
+    , usage : Boolean
+    , user : String
+    , username : String
+    , userconfig : path
+    , version : Boolean
+    , viewer: path
+    , _exit : Boolean
+    }
+
+; [["-v", {version:true}, []]
+  ,["---v", {version:true}, []]
+  ,["ls -s --no-reg connect -d",
+    {loglevel:"info",registry:null},["ls","connect"]]
+  ,["ls ---s foo",{loglevel:"silent"},["ls","foo"]]
+  ,["ls --registry blargle", {}, ["ls"]]
+  ,["--no-registry", {registry:null}, []]
+  ,["--no-color true", {color:false}, []]
+  ,["--no-color false", {color:true}, []]
+  ,["--no-color", {color:false}, []]
+  ,["--color false", {color:false}, []]
+  ,["--color --logfd 7", {logfd:7,color:true}, []]
+  ,["--color=true", {color:true}, []]
+  ,["--logfd=10", {logfd:10}, []]
+  ,["--tmp=/tmp -tar=gtar",{tmp:"/tmp",tar:"gtar"},[]]
+  ,["--tmp=tmp -tar=gtar",
+    {tmp:path.resolve(process.cwd(), "tmp"),tar:"gtar"},[]]
+  ,["--logfd x", {}, []]
+  ,["a -true -- -no-false", {true:true},["a","-no-false"]]
+  ,["a -no-false", {false:false},["a"]]
+  ,["a -no-no-true", {true:true}, ["a"]]
+  ,["a -no-no-no-false", {false:false}, ["a"]]
+  ,["---NO-no-No-no-no-no-nO-no-no"+
+    "-No-no-no-no-no-no-no-no-no"+
+    "-no-no-no-no-NO-NO-no-no-no-no-no-no"+
+    "-no-body-can-do-the-boogaloo-like-I-do"
+   ,{"body-can-do-the-boogaloo-like-I-do":false}, []]
+  ,["we are -no-strangers-to-love "+
+    "--you-know the-rules --and so-do-i "+
+    "---im-thinking-of=a-full-commitment "+
+    "--no-you-would-get-this-from-any-other-guy "+
+    "--no-gonna-give-you-up "+
+    "-no-gonna-let-you-down=true "+
+    "--no-no-gonna-run-around false "+
+    "--desert-you=false "+
+    "--make-you-cry false "+
+    "--no-tell-a-lie "+
+    "--no-no-and-hurt-you false"
+   ,{"strangers-to-love":false
+    ,"you-know":"the-rules"
+    ,"and":"so-do-i"
+    ,"you-would-get-this-from-any-other-guy":false
+    ,"gonna-give-you-up":false
+    ,"gonna-let-you-down":false
+    ,"gonna-run-around":false
+    ,"desert-you":false
+    ,"make-you-cry":false
+    ,"tell-a-lie":false
+    ,"and-hurt-you":false
+    },["we", "are"]]
+  ,["-t one -t two -t three"
+   ,{t: ["one", "two", "three"]}
+   ,[]]
+  ,["-t one -t null -t three four five null"
+   ,{t: ["one", "null", "three"]}
+   ,["four", "five", "null"]]
+  ,["-t foo"
+   ,{t:["foo"]}
+   ,[]]
+  ,["--no-t"
+   ,{t:["false"]}
+   ,[]]
+  ,["-no-no-t"
+   ,{t:["true"]}
+   ,[]]
+  ,["-aoa one -aoa null -aoa 100"
+   ,{aoa:["one", null, 100]}
+   ,[]]
+  ,["-str 100"
+   ,{str:"100"}
+   ,[]]
+  ,["--color always"
+   ,{color:"always"}
+   ,[]]
+  ,["--no-nullstream"
+   ,{nullstream:null}
+   ,[]]
+  ,["--nullstream false"
+   ,{nullstream:null}
+   ,[]]
+  ,["--notadate 2011-01-25"
+   ,{notadate: "2011-01-25"}
+   ,[]]
+  ,["--date 2011-01-25"
+   ,{date: new Date("2011-01-25")}
+   ,[]]
+  ].forEach(function (test) {
+    var argv = test[0].split(/\s+/)
+      , opts = test[1]
+      , rem = test[2]
+      , actual = nopt(types, shorthands, argv, 0)
+      , parsed = actual.argv
+    delete actual.argv
+    console.log(util.inspect(actual, false, 2, true), parsed.remain)
+    for (var i in opts) {
+      var e = JSON.stringify(opts[i])
+        , a = JSON.stringify(actual[i] === undefined ? null : actual[i])
+      if (e && typeof e === "object") {
+        assert.deepEqual(e, a)
+      } else {
+        assert.equal(e, a)
+      }
+    }
+    assert.deepEqual(rem, parsed.remain)
+  })
+}
diff --git a/build-tools/lib/jslint/reporter.js b/build-tools/lib/jslint/reporter.js
new file mode 100644 (file)
index 0000000..f95c8bd
--- /dev/null
@@ -0,0 +1,41 @@
+/*jslint forin: true */
+
+var color = require("./color");
+var log = console.log;
+
+exports.report = function (file, lint, colorize) {
+    'use strict';
+
+    var options = [], key, value, line,
+        i, len, pad, e, fileMessage;
+
+    for (key in lint.options) {
+        value = lint.options[key];
+        options.push(key + ": " + value);
+    }
+
+    fileMessage = "\n" + ((colorize) ? color.bold(file) : file);
+
+    if (!lint.ok) {
+        log(fileMessage);
+        len = lint.errors.length;
+        for (i = 0; i < len; i += 1) {
+            pad = "#" + String(i + 1);
+            while (pad.length < 3) {
+                pad = ' ' + pad;
+            }
+            e = lint.errors[i];
+            if (e) {
+                line = ' // Line ' + e.line + ', Pos ' + e.character;
+
+                log(pad + ' ' + ((colorize) ? color.yellow(e.reason) : e.reason));
+                log('    ' + (e.evidence || '').replace(/^\s+|\s+$/, "") +
+                        ((colorize) ? color.grey(line) : line));
+            }
+        }
+    } else {
+        log(fileMessage + " is " + ((colorize) ? color.green('OK') : 'OK') + ".");
+    }
+
+    return lint.ok;
+};
diff --git a/demos/tizen-gray/icon-tizen.png b/demos/tizen-gray/icon-tizen.png
new file mode 100644 (file)
index 0000000..b63d902
Binary files /dev/null and b/demos/tizen-gray/icon-tizen.png differ
index 9a8be8a..fedf813 100755 (executable)
@@ -1,23 +1,32 @@
 <!DOCTYPE html>
 <html>
 <head>
+       <meta http-equiv="X-UA-Compatible" content="IE=9; IE=8" >
        <script src="../../build/tizen-web-ui-fw/0.1/js/jquery.js"></script>
        <script src="configure.js"></script>
        <script src="../../build/tizen-web-ui-fw/0.1/js/tizen-web-ui-fw-libs.min.js"></script>
        <script src="../../build/tizen-web-ui-fw/0.1/js/tizen-web-ui-fw.min.js"
-               data-framework-root="../../build/tizen-web-ui-fw"
-               data-framework-version="0.1"
-               data-framework-theme="tizen-gray">
+               data-framework-theme="tizen-gray"
+               data-framework-viewport-scale=false>
        </script>
        <script src="init.js"></script>
        <script src="widgets/checkbox/checkbox.js"></script>
        <script src="widgets/switch/switch.js"></script>
        <script src="widgets/radio/radio.js"></script>
        <script src="widgets/progressbar.js"></script>
+       <script src="widgets/ctxpopup.js"></script>
        <script src="widgets/popupwindow/popupwindow.js"></script>
        <script src="tips/generate-elements-dynamically.js"></script>
        <script src="widgets/pagecontrol/pagecontrol-demo.js"></script>
+       <script src="widgets/multibuttonentry-demo.js"></script>
        <link rel="stylesheet" href="custom.css" />
+       <title>Tizen UI</title>
+
+       <!-- for compatibility test -->
+       <meta name="apple-mobile-web-app-capable" content="yes" />
+       <meta name="apple-mobile-web-app-status-bar-style" content="black" />
+       <link rel="apple-touch-icon" href="icon-tizen.png" />
+       <link rel="stylesheet" href="./widgets/grid/css/namecard.css" />
 </head>
 
 <body>
@@ -27,6 +36,7 @@
                </div>
                <div data-role="content">
                        <p id="current_date"></p>
+                       <p id="html_font_size"></p>
                        <ul data-role="listview" data-icon="1line-textonly">
                                <li data-role="list-divider">Controls</li>
                                <li><a href="widgets/button/button.html">Button</a></li>
@@ -44,6 +54,8 @@
                                <li><a href="widgets/imageslider.html">ImageSlider</a></li>
                                <li><a href="widgets/pagecontrol/pagecontrol.html">PageControl</a></li>
                                <li><a href="widgets/selectioninfo.html">SelectionInfo</a></li>
+                               <li><a href="widgets/handler.html">Handler</a></li>
+                               <li><a href="#multibuttonentry">Multi-Button Entry</a></li>
                                <li data-role="list-divider">ControlBar</li>
                                <li><a href="#controlbar-demo">ControlBar</a></li>
 
@@ -52,8 +64,6 @@
                                <li><a href="widgets/auto-dividers.html">Auto-Dividers</a></li>
                                <li><a href="widgets/fast-scroll.html">Short cut scroll (aka fast-scroll)</a></li>
 
-                               <li data-role="list-divider">Dialogue Group</li>
-
                                <li data-role="list-divider">Navigation Bar</li>
                                <li><a href="widgets/segmentctrl.html">Segment Control</a></li>
                                <li><a href="#option-header-demo">Optional Header</a></li>
                                <li><a href="#no-contents-3">No Contents - Unnamed</a></li>
 
                                <li data-role="list-divider">Grid view</li>
-                               <li data-role="list-divider">Background text</li>
-                               <li data-role="list-divider">Page Indicator</li>
-                               <li data-role="list-divider">Landscape</li>
-                               <li data-role="list-divider">Spilit view</li>
-
-                               <li data-role="list-divider">Etc.</li>
-                               <li><a href="#widgets/label.html">Label</a></li>
+                               <li><a href="widgets/grid/virtualgrid.html">Virtual Grid</a></li>
+                               <li data-role="list-divider">Multimedia view</li>
+                               <li><a href="widgets/multimediaview/multimediaview.html">Multimedia view</a></li>
 
                                <li data-role="list-divider">Programming Tips</li>
                                <li><a href="tips/generate-elements-dynamically.html">Generate Elements by JS</a></li>
                        <h1>No Contents</h1>
                </div>
                <div data-role="content">
-                       <div data-role="nocontents" id="nocontents0" data-text1="Text Type" data-text2="Text Text Text" data-type="text"></div>
+                       <div data-role="nocontents" id="nocontents0" data-text1="Text Type" data-text2="Text" data-type="text"></div>
                </div> <!-- /content -->
        </div> <!-- /page -->
 
                        <h1>No Contents</h1>
                </div>
                <div data-role="content">
-                       <div data-role="nocontents" id="nocontents1" data-text1="Picture Type" data-text2="Text Text Text" data-type="picture"></div>
+                       <div data-role="nocontents" id="nocontents1" data-text1="Picture Type" data-text2="Text" data-type="picture"></div>
                </div> <!-- /content -->
        </div> <!-- /page -->
 
                        <h1>No Contents</h1>
                </div>
                <div data-role="content">
-                       <div data-role="nocontents" id="nocontents2" data-text1="Multimeida Type" data-text2="Text Text Text" data-type="multimedia"></div>
+                       <div data-role="nocontents" id="nocontents2" data-text1="Multimedia Type" data-text2="Text" data-type="multimedia"></div>
                </div> <!-- /content -->
        </div> <!-- /page -->
 
                        <h1>No Contents</h1>
                </div>
                <div data-role="content">
-                       <div data-role="nocontents" id="nocontents3" data-text1="Unknown Type"></div>
+                       <div data-role="nocontents" id="nocontents3" data-text1="Unnamed Type"></div>
                </div> <!-- /content -->
        </div> <!-- /page -->
 
                <div data-role="content">
                        <div class="content-primary">
                                <ul data-role="listview">
-                                       <li><a href="#normalstyle">Normal</a></li>
-                                       <li><a href="#expendedstyle">Expended</a></li>
+                                       <li><a href="#normalstyle">Normal style title</a></li>
+                                       <li><a href="#extendedstyle">Extended style title</a></li>
                                </ul>
                        </div><!--/content-primary -->
                </div>
 
        <div data-role="page" id="normalstyle" data-add-back-btn="true">
                <div data-role="header" data-position="fixed">
-                       <h1>Title Area</h1>
+                       <h1>Normal Title</h1>
                </div>
                <div data-role="content">
                        <div class="content-primary">
        <div data-role="page" id="normal1btn">
                <div data-role="header" data-position="fixed">
                        <a>Text1</a>
-                       <h1>Title Area</h1>
+                       <h1>Normal Title</h1>
                </div>
                <div data-role="content">
                        <div class="content-primary">
        <div data-role="page" id="normal2btn">
                <div data-role="header" data-position="fixed">
                        <a>Text1</a>
-                       <h1>Title Area</h1>
+                       <h1>Normal Title</h1>
                        <a>Text2</a>
                </div>
                <div data-role="content">
        <div data-role="page" id="normal3btn" data-add-back-btn="true">
                <div data-role="header" data-position="fixed">
                        <a>Text1</a>
-                       <h1>Title Area</h1>
+                       <h1>Normal Title</h1>
                        <a>Text2</a>
                        <a>Text3</a>
                </div>
                </div>
        </div>
 
-       <div data-role="page" id="expendedstyle"  data-add-back-btn="true">
+       <div data-role="page" id="extendedstyle"  data-add-back-btn="true">
                <div data-role="header" data-position="fixed">
-                       <h1>Title Extend</h1>
+                       <h1>Extended Title</h1>
                </div>
                <div data-role="content">
                        <div class="content-primary">
                                <ul data-role="listview">
-                                       <li><a href="#expendedstyle2btn">2 Button</a></li>
-                                       <li><a href="#expendedstyle3btn">3 Button</a></li>
-                                       <li><a href="#expendedstyle4btn">4 Button</a></li>
+                                       <li><a href="#extendedstyle2btn">2 Button</a></li>
+                                       <li><a href="#extendedstyle3btn">3 Button</a></li>
+                                       <li><a href="#extendedstyle4btn">4 Button</a></li>
                                        <li><a href="#footerExtendedStyle">Footer Extended Style</a></li>
                                </ul>
                        </div><!--/content-primary -->
                </div>
        </div>
 
-       <div data-role="page" id="expendedstyle2btn">
+       <div data-role="page" id="extendedstyle2btn">
                <div data-role="header" data-position="fixed">
                        <a>Text</a>
-                       <h1>Title Extend 2 Button </h1>
+                       <h1>Extended Title 2 Button </h1>
                        <a>Text</a>
                        <div data-role="fieldcontain">
                                <fieldset data-role="controlgroup" data-type="horizontal">
                <div data-role="content">
                        <div class="content-primary">
                                <ul data-role="listview">
-                                       <li><a href="#expendedstyle2btn">2 Button</a></li>
-                                       <li><a href="#expendedstyle3btn">3 Button</a></li>
+                                       <li><a href="#extendedstyle2btn">2 Button</a></li>
+                                       <li><a href="#extendedstyle3btn">3 Button</a></li>
                                </ul>
                        </div><!--/content-primary -->
                </div>
        </div>
 
-       <div data-role="page" id="expendedstyle3btn">
+       <div data-role="page" id="extendedstyle3btn">
                <div data-role="header" data-position="fixed">
                        <a>Text</a>
-                       <h1>Title Extend 3 Button </h1>
+                       <h1>Extended Title 3 Button </h1>
                        <a>Text</a>
                        <div data-role="fieldcontain">
                                <fieldset data-role="controlgroup" data-type="horizontal">
                <div data-role="content">
                        <div class="content-primary">
                                <ul data-role="listview">
-                                       <li><a href="#expendedstyle2btn">2 Button</a></li>
-                                       <li><a href="#expendedstyle3btn">3 Button</a></li>
+                                       <li><a href="#extendedstyle2btn">2 Button</a></li>
+                                       <li><a href="#extendedstyle3btn">3 Button</a></li>
                                </ul>
                        </div><!--/content-primary -->
                </div>
        </div>
 
-       <div data-role="page" id="expendedstyle4btn">
+       <div data-role="page" id="extendedstyle4btn">
                <div data-role="header" data-position="fixed">
-                       <h1>Title Extend 4 Button </h1>
+                       <h1>Extended Title 4 Button </h1>
                        <div data-role="fieldcontain">
                                <fieldset data-role="controlgroup" data-type="horizontal">
                                        <input type="radio" name="radio-view-8" data-icon="segment-titlestyle-segonly" id="segment71" value="on" checked="checked" />
                <div data-role="content">
                        <div class="content-primary">
                                <ul data-role="listview">
-                                       <li><a href="#expendedstyle2btn">2 Button</a></li>
-                                       <li><a href="#expendedstyle3btn">3 Button</a></li>
+                                       <li><a href="#extendedstyle2btn">2 Button</a></li>
+                                       <li><a href="#extendedstyle3btn">3 Button</a></li>
                                </ul>
                        </div><!--/content-primary -->
                </div>
 
        <div data-role="page" id="footerExtendedStyle">
                <div data-role="header" data-position="fixed">
-                       <h1>Footer extended style</h1>
+                       <h1>Extended Footer style</h1>
                </div>
                <div data-role="content">
                        <p> test page </p>
                        <a>Edit</a>
                </div>
        </div>
+
+       <div data-role="page" id="multibuttonentry">
+               <div data-role="header" >
+                       <h1>Multi-button Entry</h1>
+               </div>
+               <div data-role="content">
+                       <div data-role="multibuttonentry" data-listuri="addressbook"></div>
+                       <br>
+                       <ul data-role="listview">
+                               <li><a id='MBTaddItemTest'>Append Item</a></li>
+                               <li><a id='MBTremoveItemTest'>Remove first Item</a></li>
+                               <li><a id='MBTinputTextTest'>Input 'Hello'</a></li>
+                               <li><a id='MBTgetInputTextTest'>Get input text</a></li>
+                               <li><a id='MBTselectItemTest'>Select 1</a></li>
+                               <li><a id='MBTgetSelectedItemTest'>Selected item</a></li>
+                               <li><a id='MBTlengthTest'>Length</a></li>
+                               <li><a id='MBTfocusOutTest'>Grouping On</a></li>
+                               <li><a id='MBTfocusInTest'>Grouping Off</a></li>
+                               <li><a id='MBTremoveAllItemTest'>Remove All Item</a></li>
+                       </ul>
+               </div>
+       </div>
+       <div data-role="page"  id="addressbook" data-footer-Exist="false" >
+               <div data-role="header">
+                       <h1>Address Book</h1>
+                       <a id="cancelBtn" href="#multibuttonentry" data-role="button" class="ui-btn-right" >Cancel</a>
+               </div>
+               <div data-role="content" id="contentList">
+                       <ul data-role="listview">
+                               <li data-role="list-divider">A</li>
+                               <li><a href="#multibuttonentry">Adam Kinkaid</a></li>
+                               <li><a href="#multibuttonentry">Alex Wickerham</a></li>
+                               <li><a href="#multibuttonentry">Avery Johnson</a></li>
+                               <li data-role="list-divider">B</li>
+                               <li><a href="#multibuttonentry">Bob Cabot</a></li>
+                               <li data-role="list-divider">C</li>
+                               <li><a href="#multibuttonentry">Caleb Booth</a></li>
+                               <li><a href="#multibuttonentry">Christopher Adams</a></li>
+                               <li><a href="#multibuttonentry">Culver James</a></li>
+                               <li data-role="list-divider">D</li>
+                               <li><a href="#multibuttonentry">David Walsh</a></li>
+                               <li><a href="#multibuttonentry">Drake Alfred</a></li>
+                               <li data-role="list-divider">E</li>
+                               <li><a href="#multibuttonentry">Elizabeth Bacon</a></li>
+                               <li><a href="#multibuttonentry">Emery Parker</a></li>
+                               <li><a href="#multibuttonentry">Enid Voldon</a></li>
+                               <li data-role="list-divider">F</li>
+                               <li><a href="#multibuttonentry">Francis Wall</a></li>
+                               <li data-role="list-divider">G</li>
+                               <li><a href="#multibuttonentry">Graham Smith</a></li>
+                               <li><a href="#multibuttonentry">Greta Peete</a></li>
+                               <li data-role="list-divider">H</li>
+                               <li><a href="#multibuttonentry">Harvey Walls</a></li>
+                               <li data-role="list-divider">M</li>
+                               <li><a href="#multibuttonentry">Mike Farnsworth</a></li>
+                               <li><a href="#multibuttonentry">Murray Vanderbuilt</a></li>
+                               <li data-role="list-divider">N</li>
+                               <li><a href="#multibuttonentry">Nathan Williams</a></li>
+                               <li data-role="list-divider">P</li>
+                               <li><a href="#multibuttonentry">Paul Baker</a></li>
+                               <li><a href="#multibuttonentry">Pete Mason</a></li>
+                               <li data-role="list-divider">R</li>
+                               <li><a href="#multibuttonentry">Rod Tarker</a></li>
+                               <li data-role="list-divider">S</li>
+                               <li><a href="#multibuttonentry">Sawyer Wakefield</a></li>
+                       </ul>
+               </div> <!--/content -->
+       </div> <!--/page -->
 </body>
 </html>
index 34e6520..fa4a4d9 100755 (executable)
@@ -150,7 +150,7 @@ $( document ).bind("pagecreate", function () {
                $.getScript( "./virtuallist-db-demo.js", function ( data, textStatus ) {
                        $("ul").filter( function () {
                                return $( this ).data("role") == "extendablelist";
-                       }).addClass("vlLoadSuccess");
+                       }).addClass("elLoadSuccess");
 
                        $("#genlist-extendable-page").die();
                        $("ul.ui-extendable-list-container").extendablelist("create");
@@ -218,20 +218,10 @@ $( document ).bind("pagecreate", function () {
        });
 });
 
-$( document ).bind("pagecreate", function () {
-       var button = $('#calendarbutton');
-
-       button.bind('vclick', function ( e ) {
-               button.calendarpicker('open');
-               button.unbind('selectedDate').bind('selectedDate', function ( e,val ) {
-                       $('#selectedCalendarDate').attr('value',val);
-               });
-       });
-});
-
-domReady( function () {
+$(document).ready( function () {
        // add current datetime with browser language format
-       // NOTE: Globalize.* functions must be run after domReady.
+       // NOTE: Globalize.* functions must be run after docoument ready.
        $('#current_date').html(Globalize.culture().name + " -- " +
                                Globalize.format( new Date(), "F" ));
+       $('#html_font_size').html('html font size:' + $('html').css('font-size'));
 });
index a983bd9..b6d138f 100755 (executable)
@@ -28,9 +28,9 @@
                        <li class="ui-li-1line-btn2">List item 9<div  data-role="button" data-inline="true" data-icon="call" data-style="circle"></div></li>
                        <li class="ui-li-1line-btn2">List item 10<div  data-role="button" data-inline="true" data-icon="favorite" data-style="nobg"></div></li>
                        <li>List item 11<div  data-role="button" data-inline="true" data-icon="editminus" data-style="edit" 
-                               style="position: absolute; top: 0px; margin-top: 0px;"></div></li>
+                               style="position: absolute; top: 0px; margin-top: 0px; left:70%"></div></li>
                        <li>List item 12<div  data-role="button" data-inline="true" data-style="edit" 
-                               style="position: absolute; top: 0px; margin-top: 0px;">Delete</div></li>
+                               style="position: absolute; top: 0px; margin-top: 0px; left:70%">Delete</div></li>
                </ul>
        </div>
 </div>
index dd378d3..ab7b01a 100755 (executable)
        </div>
        <div class="content" data-role="content">
                <div>
-            <a href="#pop_icon_text" id="btn_icon_text" data-role="button" data-inline="true" data-rel="popupwindow">Icon+Text</a>
-                <div id="pop_icon_text" data-role="popupwindow" data-show-arrow="true">
-                    <ul data-role="listview">
-                        <li class="ui-li-1line-bigicon1">
-                            <a class="ui-btn-ctxpopup-close" href="#">
-                                <img class="ui-li-bigicon" src="test/nba_griz.jpg">
-                                <span class="ui-li-text-main">Eenie</span>
-                            </a>
-                        </li>
-                        <li class="ui-li-1line-bigicon1">
-                            <a class="ui-btn-ctxpopup-close" href="#">
-                                <img class="ui-li-bigicon" src="test/nba_magics.jpg">
-                                <span class="ui-li-text-main">Meenie</span>
-                            </a>
-                        </li>
-                        <li class="ui-li-1line-bigicon1">
-                            <a class="ui-btn-ctxpopup-close" href="#">
-                                <img class="ui-li-bigicon" src="test/nba_lakers.jpg">
-                                <span class="ui-li-text-main">Mynie</span>
-                            </a>
-                        </li>
-                        <li class="ui-li-1line-bigicon1">
-                            <a class="ui-btn-ctxpopup-close" href="#">
-                                <img class="ui-li-bigicon" src="test/nba_pacers.jpg">
-                                <span class="ui-li-text-main">Mo</span>
-                            </a>
-                        </li>
-                  </ul>
-                </div>
+<!-- target button -->
+<a href="#pop_js" id="btn_js" data-role="button" data-inline="true" data-rel="popupwindow">Touch me!</a>
+<!-- context popup -->
+<div id="pop_js" data-role="popupwindow" data-show-arrow="true">
+       <ul data-role="listview">
+               <li><a href="#" class="ui-btn-ctxpopup-close">Close</a></li>
+               <li><a href="#" class="ui-btn-ctxpopup-close" id="ctxpopup_update">Update Button Text</a></li>
+       </ul>
+</div>
+<br>
+<br>
 
-            <br>
-                       <br>
-            <a href="#pop_3_icons" id="btn_3_icons" data-role="button" data-inline="true" data-rel="popupwindow">3 Icons</a>
-                <div class="horizontal" id="pop_3_icons" data-role="popupwindow" data-show-arrow="true">
-                    <ul>
-                        <li class="icon"><a href="#" data-role="button" data-icon="call"></a></li>
-                        <li class="icon"><a href="#" data-role="button" data-icon="favorite"></a></li>
-                        <li class="text"><a href="#">Function</a></li>
-                   </ul>
-                </div>
-                       <br>
-                       <br>
-            <a href="#pop_6_icons" id="btn_6_icons" data-role="button" data-inline="true" data-rel="popupwindow">6 Icons-Grid</a>
-                <div class="horizontal" id="pop_6_icons" data-role="popupwindow" data-show-arrow="true">
-                    <table>
-                        <tr>
-                            <td class="icon">
-                                <a href="#" data-role="button" data-icon="call"></a>
-                            </td>
-                            <td class="icon">
-                                <a href="#" data-role="button" data-icon="favorite"></a>
-                            </td>
-                            <td class="text">
-                                <a href="#">Eeenie</a>
-                            </td>
-                        </tr>
-                        <tr>
-                            <td class="icon">
-                                <a href="#" data-role="button" data-icon="call"></a>
-                            </td>
-                            <td class="text">
-                                <a href="#">Mynie</a>
-                            </td>
-                            <td class="icon">
-                                <a href="#" data-role="button" data-icon="favorite"></a>
-                            </td>
-                        </tr>
-                    </table>
-                </div>
-                       <br>
-                       <br>
-                       <a href="#pop_copy_paste" id="btn_copy_paste" data-role="button" data-inline="true" data-rel="popupwindow">CopyPaste</a>
-                <div id="pop_copy_paste" class="horizontal" data-role="popupwindow" data-show-arrow="true">
-                    <ul>
-                        <li class='text'><a href="#">Copy</a></li>
-                        <li class='text'><a href="#">All</a></li>
-                        <li class='text'><a href="#">Paste</a></li>
-                    </ul>
-                </div>
-                       <br>
-                       <br>
-            <a href="#pop_text_only" id="btn_text_only" data-role="button" data-inline="true" data-rel="popupwindow">Text Only</a>
-                <div id="pop_text_only" data-role="popupwindow" data-show-arrow="true">
-                    <ul data-role="listview">
-                        <li><a href="http://www.naver.com">www.naver.com</a></li>
-                        <li><a href="http://www.naver.com">www.naver.com</a></li>
-                        <li><a href="http://www.samsung.com">www.samsung.com</a></li>
-                        <li><a href="http://www.apple.com">www.apple.com</a></li>
-                    </ul>
-                </div>
+<!-- target button -->
+<a href="#pop_icon_text" id="btn_icon_text" data-role="button" data-inline="true" data-rel="popupwindow">Icon+Text</a>
+<!-- context popup -->
+<div id="pop_icon_text" data-role="popupwindow" data-show-arrow="true">
+       <ul data-role="listview">
+               <li class="ui-li-1line-bigicon1">
+                       <a href="#">
+                               <img class="ui-li-bigicon" src="test/ctxpopup_1.png">
+                               <span class="ui-li-text-main">Eenie</span>
+                       </a>
+           </li>
+               <li class="ui-li-1line-bigicon1">
+                       <a href="#">
+                               <img class="ui-li-bigicon" src="test/ctxpopup_2.png">
+                               <span class="ui-li-text-main">Meenie</span>
+                       </a>
+               </li>
+               <li class="ui-li-1line-bigicon1">
+                       <a href="#">
+                               <img class="ui-li-bigicon" src="test/ctxpopup_3.png">
+                               <span class="ui-li-text-main">Mynie</span>
+                       </a>
+               </li>
+               <li class="ui-li-1line-bigicon1">
+                       <a href="#">
+                               <img class="ui-li-bigicon" src="test/ctxpopup_4.png">
+                               <span class="ui-li-text-main">Mo</span>
+                       </a>
+               </li>
+       </ul>
+</div>
+<br>
+<br>
 
-                       <br>
-                       <br>
-            <a href="#pop_buttons" id="btn_buttons" data-role="button" data-inline="true" data-rel="popupwindow">Buttons</a> 
-                <div id="pop_buttons" class="button" data-role="popupwindow" data-show-arrow="true">
-                    <div>
-                        <table>
-                            <tr><td><a href="#" data-role="button">Meenie</a></td><td><a href="#" data-role="button">Mynie</a></td><td><a href="#" data-role="button">Mo</a></td></tr>
-                            <tr><td><a href="#" data-role="button">Catch-a</a></td><td><a href="#" data-role="button">Tiger</a></td><td><a href="#" data-role="button">By-the</a></td></tr>
-                        </table>
-                    </div>
-                </div>
+<!-- target button -->
+<a href="#pop_3_icons" id="btn_3_icons" data-role="button" data-inline="true" data-rel="popupwindow">3 Icons</a>
+<!-- context popup -->
+<div class="horizontal" id="pop_3_icons" data-role="popupwindow" data-show-arrow="true">
+       <ul>
+               <li class="icon">
+                       <a href="#" data-role="button" data-icon="call"></a>
+               </li>
+               <li class="icon">
+                       <a href="#" data-role="button" data-icon="favorite"></a>
+               </li>
+               <li class="text">
+                       <a href="#">Function</a>
+               </li>
+   </ul>
+</div>
+<br>
+<br>
 
-                       <br>
-                       <br>
-                       <!-- 
-            <a href="#pop_time_picker" class="picker_btn" data-role="button" data-inline="true" data-rel="popupwindow">Time Picker</a>
-                <div class="picker" id="pop_time_picker" data-role="popupwindow" data-show-arrow="true">
-                    <ul>
-                        <li><a href="#">1</a></li>
-                        <li><a href="#">2</a></li>
-                        <li><a href="#">3</a></li>
-                        <li><a href="#">4</a></li>
-                        <li><a href="#">5</a></li>
-                        <li><a href="#">6</a></li>
-                        <li><a href="#">7</a></li>
-                        <li><a href="#">8</a></li>
-                        <li><a href="#">9</a></li>
-                        <li><a href="#">10</a></li>
-                        <li><a href="#">11</a></li>
-                        <li><a href="#">12</a></li>
-                        <li><a href="#">13</a></li>
-                        <li><a href="#">14</a></li>
-                        <li><a href="#">15</a></li>
-                        <li><a href="#">16</a></li>
-                        <li><a href="#">17</a></li>
-                        <li><a href="#">18</a></li>
-                        <li><a href="#">19</a></li>
-                        <li><a href="#">20</a></li>
-                        <li><a href="#">21</a></li>
-                        <li><a href="#">22</a></li>
-                        <li><a href="#">23</a></li>
-                        <li><a href="#">24</a></li>
-                        <li><a href="#">25</a></li>
-                        <li><a href="#">26</a></li>
-                        <li><a href="#">27</a></li>
-                        <li><a href="#">28</a></li>
-                        <li><a href="#">29</a></li>
-                        <li><a href="#">30</a></li>
-                        <li><a href="#">31</a></li>
-                        <li><a href="#">32</a></li>
-                        <li><a href="#">33</a></li>
-                        <li><a href="#">34</a></li>
-                        <li><a href="#">35</a></li>
-                        <li><a href="#">36</a></li>
-                        <li><a href="#">37</a></li>
-                        <li><a href="#">38</a></li>
-                        <li><a href="#">39</a></li>
-                        <li><a href="#">40</a></li>
-                        <li><a href="#">41</a></li>
-                        <li><a href="#">42</a></li>
-                        <li><a href="#">43</a></li>
-                        <li><a href="#">44</a></li>
-                        <li><a href="#">45</a></li>
-                        <li><a href="#">46</a></li>
-                        <li><a href="#">47</a></li>
-                        <li><a href="#">48</a></li>
-                        <li><a href="#">49</a></li>
-                        <li><a href="#">50</a></li>
-                        <li><a href="#">51</a></li>
-                        <li><a href="#">52</a></li>
-                        <li><a href="#">53</a></li>
-                        <li><a href="#">54</a></li>
-                        <li><a href="#">55</a></li>
-                        <li><a href="#">56</a></li>
-                        <li><a href="#">57</a></li>
-                        <li><a href="#">58</a></li>
-                        <li><a href="#">59</a></li>
-                        <li><a href="#">60</a></li>
+<!-- target button -->
+<a href="#pop_6_icons" id="btn_6_icons" data-role="button" data-inline="true" data-rel="popupwindow">6 Icons-Grid</a>
+<!-- context popup -->
+<div class="horizontal" id="pop_6_icons" data-role="popupwindow" data-show-arrow="true">
+       <table>
+               <tr>
+                       <td class="icon">
+                               <a href="#" data-role="button" data-icon="call"></a>
+                       </td>
+                       <td class="icon">
+                               <a href="#" data-role="button" data-icon="favorite"></a>
+                       </td>
+                       <td class="text">
+                               <a href="#">Eeenie</a>
+                       </td>
+               </tr>
+               <tr>
+                       <td class="icon">
+                               <a href="#" data-role="button" data-icon="call"></a>
+                       </td>
+                       <td class="text">
+                               <a href="#">Mynie</a>
+                       </td>
+                       <td class="icon">
+                               <a href="#" data-role="button" data-icon="favorite"></a>
+                       </td>
+               </tr>
+       </table>
+</div>
+<br>
+<br>
+
+<a href="#pop_copy_paste" id="btn_copy_paste" data-role="button" data-inline="true" data-rel="popupwindow">CopyPaste</a>
+
+<div id="pop_copy_paste" class="horizontal" data-role="popupwindow" data-show-arrow="true">
+       <ul>
+               <li class='text'>
+                       <a href="#">Copy</a>
+               </li>
+               <li class='text'>
+                       <a href="#">All</a>
+               </li>
+               <li class='text'>
+                       <a href="#">Paste</a>
+               </li>
+       </ul>
+</div>
+<br>
+<br>
+
+<a href="#pop_text_only" id="btn_text_only" data-role="button" data-inline="true" data-rel="popupwindow">Text Only</a>
+
+<div id="pop_text_only" data-role="popupwindow" data-show-arrow="true">
+       <ul data-role="listview">
+               <li>
+                       <a href="http://www.naver.com">www.naver.com</a>
+               </li>
+               <li>
+                       <a href="http://www.naver.com">www.naver.com</a>
+               </li>
+               <li>
+                       <a href="http://www.samsung.com">www.samsung.com</a>
+               </li>
+               <li>
+                       <a href="http://www.apple.com">www.apple.com</a>
+               </li>
+       </ul>
+</div>
+<br>
+<br>
+
+<!-- target button -->
+<a href="#pop_buttons" id="btn_buttons" data-role="button" data-inline="true" data-rel="popupwindow">Buttons</a>
+<!-- context popup -->
+<div id="pop_buttons" class="button" data-role="popupwindow" data-show-arrow="true">
+       <div>
+               <table>
+                       <tr>
+                               <td>
+                                       <a href="#" data-role="button">Meenie</a>
+                               </td>
+                               <td>
+                                       <a href="#" data-role="button">Mynie</a>
+                               </td>
+                               <td>
+                                       <a href="#" data-role="button">Mo</a>
+                               </td>
+                       </tr>
+                       <tr>
+                               <td>
+                                       <a href="#" data-role="button">Catch-a</a>
+                               </td>
+                               <td>
+                                       <a href="#" data-role="button">Tiger</a>
+                               </td>
+                               <td>
+                                       <a href="#" data-role="button">By-the</a>
+                               </td>
+                       </tr>
+               </table>
+       </div>
+</div>
 
-                    </ul>
-                </div>
-                       -->
         </div>
        </div> <!-- /content -->
 
diff --git a/demos/tizen-gray/widgets/ctxpopup.js b/demos/tizen-gray/widgets/ctxpopup.js
new file mode 100644 (file)
index 0000000..ee86683
--- /dev/null
@@ -0,0 +1,9 @@
+$("#pop_js").live("vclick", function ( e ) {
+       if ( $(e.target).is(".ui-btn-ctxpopup-close") ) {
+               $(this).popupwindow("close");
+       }
+       if ( $(e.target).is("#ctxpopup_update") ) {
+               $("#btn_js").text("Peekaboo!");
+               $("#btn_js").buttonMarkup("refresh");
+       }
+});
index cd707f9..53f08ac 100644 (file)
@@ -7,15 +7,15 @@
                        <li class="ui-li-2line-sub-main">
                                <span class="ui-li-text-main">
                                        <input type="datetime" name="demo-date" id="demo-date" 
-                                               data-format="MMM dd yyyy hh:mm tt"/>
-                               </span>
+                                               data-format="MMM dd yyyy hh:mm tt" data-val="Jun 30 2012" />
+                       </span>
                                <span class="ui-li-text-sub">
                                        Date/Time Picker(Custom) - <span id="selected-date1"><em>(select a date first)</em></span>
                                </span>
                        </li>
                        <li class="ui-li-2line-sub-main">
                                <span class="ui-li-text-main">
-                                       <input type="datetime" name="demo-date2" id="demo-date2"/>
+                                       <input type="datetime" name="demo-date2" id="demo-date2" />
                                </span>
                                <span class="ui-li-text-sub">
                                        Date/Time Picker - <span id="selected-date2"><em>(select a date first)</em></span>
@@ -31,7 +31,7 @@
                        </li>
                        <li class="ui-li-2line-sub-main">
                                <span class="ui-li-text-main">
-                                       <input type="time" name="demo-date4" id="demo-date4"/>
+                                       <input type="time" name="demo-date4" id="demo-date4" />
                                </span>
                                <span class="ui-li-text-sub">
                                        Time Picker - <span id="selected-date4"><em>(select a date first)</em></span>
diff --git a/demos/tizen-gray/widgets/grid/css/namecard.css b/demos/tizen-gray/widgets/grid/css/namecard.css
new file mode 100755 (executable)
index 0000000..4d88f2a
--- /dev/null
@@ -0,0 +1,46 @@
+.ui-demo-namecard {
+       display : inline-block;
+       width : 5.1rem;
+       height : 6.1rem;
+       margin-right: 0.4rem;
+       margin-left: 0.4rem;
+       margin-bottom: 1.5rem;
+}
+
+.ui-demo-namecard-pic {
+       float : left;
+       padding-top : 0.2rem;
+       padding-left : 0.2rem;
+       padding-bottom: 0rem;
+}
+
+.ui-demo-namecard-pic-img {
+       height : 5rem;
+       width : 5rem;
+}
+
+.ui-demo-namecard-contents {
+       float : left;
+       height : 1rem;
+       margin: 0rem;
+}
+
+.ui-demo-namecard-contents span {
+       font-style : italic;
+       color : #666;
+       border-bottom : 1px dashed;
+       margin-top: 0rem;
+}
+
+.ui-demo-namecard-contents span.name {
+       color : white;
+       font : normal 0.8rem Georgia, serif !important;
+
+       width: 5rem;
+       display: inline-block;
+       white-space : nowrap;
+       overflow : hidden !important;
+       text-overflow : ellipsis !important;
+       -o-text-overflow:ellipsis;
+       resize:horizontal;
+}
diff --git a/demos/tizen-gray/widgets/grid/images/nba_76ers.jpg b/demos/tizen-gray/widgets/grid/images/nba_76ers.jpg
new file mode 100755 (executable)
index 0000000..35db118
Binary files /dev/null and b/demos/tizen-gray/widgets/grid/images/nba_76ers.jpg differ
diff --git a/demos/tizen-gray/widgets/grid/images/nba_bobcats.jpg b/demos/tizen-gray/widgets/grid/images/nba_bobcats.jpg
new file mode 100755 (executable)
index 0000000..6572396
Binary files /dev/null and b/demos/tizen-gray/widgets/grid/images/nba_bobcats.jpg differ
diff --git a/demos/tizen-gray/widgets/grid/images/nba_bucks.jpg b/demos/tizen-gray/widgets/grid/images/nba_bucks.jpg
new file mode 100755 (executable)
index 0000000..8b420ae
Binary files /dev/null and b/demos/tizen-gray/widgets/grid/images/nba_bucks.jpg differ
diff --git a/demos/tizen-gray/widgets/grid/images/nba_bulls.jpg b/demos/tizen-gray/widgets/grid/images/nba_bulls.jpg
new file mode 100755 (executable)
index 0000000..8c131e1
Binary files /dev/null and b/demos/tizen-gray/widgets/grid/images/nba_bulls.jpg differ
diff --git a/demos/tizen-gray/widgets/grid/images/nba_cavaliers.jpg b/demos/tizen-gray/widgets/grid/images/nba_cavaliers.jpg
new file mode 100755 (executable)
index 0000000..2a66daa
Binary files /dev/null and b/demos/tizen-gray/widgets/grid/images/nba_cavaliers.jpg differ
diff --git a/demos/tizen-gray/widgets/grid/images/nba_celtics.jpg b/demos/tizen-gray/widgets/grid/images/nba_celtics.jpg
new file mode 100755 (executable)
index 0000000..363f65b
Binary files /dev/null and b/demos/tizen-gray/widgets/grid/images/nba_celtics.jpg differ
diff --git a/demos/tizen-gray/widgets/grid/images/nba_clippers.jpg b/demos/tizen-gray/widgets/grid/images/nba_clippers.jpg
new file mode 100755 (executable)
index 0000000..9b042b9
Binary files /dev/null and b/demos/tizen-gray/widgets/grid/images/nba_clippers.jpg differ
diff --git a/demos/tizen-gray/widgets/grid/images/nba_griz.jpg b/demos/tizen-gray/widgets/grid/images/nba_griz.jpg
new file mode 100755 (executable)
index 0000000..c521cc9
Binary files /dev/null and b/demos/tizen-gray/widgets/grid/images/nba_griz.jpg differ
diff --git a/demos/tizen-gray/widgets/grid/images/nba_hawks.jpg b/demos/tizen-gray/widgets/grid/images/nba_hawks.jpg
new file mode 100755 (executable)
index 0000000..208be2d
Binary files /dev/null and b/demos/tizen-gray/widgets/grid/images/nba_hawks.jpg differ
diff --git a/demos/tizen-gray/widgets/grid/images/nba_heats.jpg b/demos/tizen-gray/widgets/grid/images/nba_heats.jpg
new file mode 100755 (executable)
index 0000000..1c009d2
Binary files /dev/null and b/demos/tizen-gray/widgets/grid/images/nba_heats.jpg differ
diff --git a/demos/tizen-gray/widgets/grid/images/nba_honets.jpg b/demos/tizen-gray/widgets/grid/images/nba_honets.jpg
new file mode 100755 (executable)
index 0000000..b2aa7ee
Binary files /dev/null and b/demos/tizen-gray/widgets/grid/images/nba_honets.jpg differ
diff --git a/demos/tizen-gray/widgets/grid/images/nba_jazz.jpg b/demos/tizen-gray/widgets/grid/images/nba_jazz.jpg
new file mode 100755 (executable)
index 0000000..1f1d221
Binary files /dev/null and b/demos/tizen-gray/widgets/grid/images/nba_jazz.jpg differ
diff --git a/demos/tizen-gray/widgets/grid/images/nba_kings.jpg b/demos/tizen-gray/widgets/grid/images/nba_kings.jpg
new file mode 100755 (executable)
index 0000000..fc0e9f9
Binary files /dev/null and b/demos/tizen-gray/widgets/grid/images/nba_kings.jpg differ
diff --git a/demos/tizen-gray/widgets/grid/images/nba_knics.jpg b/demos/tizen-gray/widgets/grid/images/nba_knics.jpg
new file mode 100755 (executable)
index 0000000..70c8796
Binary files /dev/null and b/demos/tizen-gray/widgets/grid/images/nba_knics.jpg differ
diff --git a/demos/tizen-gray/widgets/grid/images/nba_lakers.jpg b/demos/tizen-gray/widgets/grid/images/nba_lakers.jpg
new file mode 100755 (executable)
index 0000000..cb291b1
Binary files /dev/null and b/demos/tizen-gray/widgets/grid/images/nba_lakers.jpg differ
diff --git a/demos/tizen-gray/widgets/grid/images/nba_magics.jpg b/demos/tizen-gray/widgets/grid/images/nba_magics.jpg
new file mode 100755 (executable)
index 0000000..290b930
Binary files /dev/null and b/demos/tizen-gray/widgets/grid/images/nba_magics.jpg differ
diff --git a/demos/tizen-gray/widgets/grid/images/nba_mavericks.jpg b/demos/tizen-gray/widgets/grid/images/nba_mavericks.jpg
new file mode 100755 (executable)
index 0000000..f8816a8
Binary files /dev/null and b/demos/tizen-gray/widgets/grid/images/nba_mavericks.jpg differ
diff --git a/demos/tizen-gray/widgets/grid/images/nba_nets.jpg b/demos/tizen-gray/widgets/grid/images/nba_nets.jpg
new file mode 100755 (executable)
index 0000000..3d2600c
Binary files /dev/null and b/demos/tizen-gray/widgets/grid/images/nba_nets.jpg differ
diff --git a/demos/tizen-gray/widgets/grid/images/nba_nuggets.jpg b/demos/tizen-gray/widgets/grid/images/nba_nuggets.jpg
new file mode 100755 (executable)
index 0000000..a01e78e
Binary files /dev/null and b/demos/tizen-gray/widgets/grid/images/nba_nuggets.jpg differ
diff --git a/demos/tizen-gray/widgets/grid/images/nba_pacers.jpg b/demos/tizen-gray/widgets/grid/images/nba_pacers.jpg
new file mode 100755 (executable)
index 0000000..be98506
Binary files /dev/null and b/demos/tizen-gray/widgets/grid/images/nba_pacers.jpg differ
diff --git a/demos/tizen-gray/widgets/grid/images/nba_pistons.jpg b/demos/tizen-gray/widgets/grid/images/nba_pistons.jpg
new file mode 100755 (executable)
index 0000000..f13c851
Binary files /dev/null and b/demos/tizen-gray/widgets/grid/images/nba_pistons.jpg differ
diff --git a/demos/tizen-gray/widgets/grid/images/nba_raptors.jpg b/demos/tizen-gray/widgets/grid/images/nba_raptors.jpg
new file mode 100755 (executable)
index 0000000..eb8d431
Binary files /dev/null and b/demos/tizen-gray/widgets/grid/images/nba_raptors.jpg differ
diff --git a/demos/tizen-gray/widgets/grid/images/nba_rockets.jpg b/demos/tizen-gray/widgets/grid/images/nba_rockets.jpg
new file mode 100755 (executable)
index 0000000..8cf2f17
Binary files /dev/null and b/demos/tizen-gray/widgets/grid/images/nba_rockets.jpg differ
diff --git a/demos/tizen-gray/widgets/grid/images/nba_sonics.jpg b/demos/tizen-gray/widgets/grid/images/nba_sonics.jpg
new file mode 100755 (executable)
index 0000000..2104e42
Binary files /dev/null and b/demos/tizen-gray/widgets/grid/images/nba_sonics.jpg differ
diff --git a/demos/tizen-gray/widgets/grid/images/nba_spurs.jpg b/demos/tizen-gray/widgets/grid/images/nba_spurs.jpg
new file mode 100755 (executable)
index 0000000..060002d
Binary files /dev/null and b/demos/tizen-gray/widgets/grid/images/nba_spurs.jpg differ
diff --git a/demos/tizen-gray/widgets/grid/images/nba_suns.jpg b/demos/tizen-gray/widgets/grid/images/nba_suns.jpg
new file mode 100755 (executable)
index 0000000..754769c
Binary files /dev/null and b/demos/tizen-gray/widgets/grid/images/nba_suns.jpg differ
diff --git a/demos/tizen-gray/widgets/grid/images/nba_timberwolves.jpg b/demos/tizen-gray/widgets/grid/images/nba_timberwolves.jpg
new file mode 100755 (executable)
index 0000000..79476a8
Binary files /dev/null and b/demos/tizen-gray/widgets/grid/images/nba_timberwolves.jpg differ
diff --git a/demos/tizen-gray/widgets/grid/images/nba_trail.jpg b/demos/tizen-gray/widgets/grid/images/nba_trail.jpg
new file mode 100755 (executable)
index 0000000..57168c9
Binary files /dev/null and b/demos/tizen-gray/widgets/grid/images/nba_trail.jpg differ
diff --git a/demos/tizen-gray/widgets/grid/images/nba_warriors.jpg b/demos/tizen-gray/widgets/grid/images/nba_warriors.jpg
new file mode 100755 (executable)
index 0000000..45440c4
Binary files /dev/null and b/demos/tizen-gray/widgets/grid/images/nba_warriors.jpg differ
diff --git a/demos/tizen-gray/widgets/grid/images/nba_wizards.jpg b/demos/tizen-gray/widgets/grid/images/nba_wizards.jpg
new file mode 100755 (executable)
index 0000000..e98a491
Binary files /dev/null and b/demos/tizen-gray/widgets/grid/images/nba_wizards.jpg differ
diff --git a/demos/tizen-gray/widgets/grid/js/virtualgrid-db-demo.js b/demos/tizen-gray/widgets/grid/js/virtualgrid-db-demo.js
new file mode 100755 (executable)
index 0000000..1aef95b
--- /dev/null
@@ -0,0 +1,5244 @@
+/*\r
+ * jQuery Mobile Framework : Dummy data for Virtuallist demo\r
+ * Copyright (c) Lee, Wongi (wongi11.lee@samsung.com)\r
+ * Dual licensed under the MIT or GPL Version 2 licenses.\r
+ * http://jquery.org/license\r
+ */\r
+\r
+/* Sample Data in JSON : NBA Player list more than 1,000. */\r
+var JSON_DATA = [{\r
+       NAME : "Abdelnaby, Alaa",\r
+       ACTIVE : "1990 - 1994",\r
+       FROM : "College - Duke",\r
+       TEAM_LOGO : "./images/nba_hawks.jpg"\r
+}, {\r
+       NAME : "Abdul-Aziz, Zaid",\r
+       ACTIVE : "1968 - 1977",\r
+       FROM : "College - Iowa State",\r
+       TEAM_LOGO : "./images/nba_suns.jpg"\r
+}, {\r
+       NAME : "Abdul-Jabbar, Kareem",\r
+       ACTIVE : "1969 - 1988",\r
+       FROM : "College - UCLA",\r
+       TEAM_LOGO : "./images/nba_clippers.jpg"\r
+}, {\r
+       NAME : "Abdul-Rauf, Mahmoud",\r
+       ACTIVE : "1990 - 2000",\r
+       FROM : "College - Louisiana State",\r
+       TEAM_LOGO : "./images/nba_hawks.jpg"\r
+}, {\r
+       NAME : "Abdul-Wahad, Tariq",\r
+       ACTIVE : "1997 - 2002",\r
+       FROM : "College - San Jose State",\r
+       TEAM_LOGO : "./images/nba_76ers.jpg"\r
+}, {\r
+       NAME : "Abdur-Rahim, Shareef",\r
+       ACTIVE : "2007 - 2007",\r
+       FROM : "College - California",\r
+       TEAM_LOGO : "./images/nba_knics.jpg"\r
+}, {\r
+       NAME : "Abernethy, Tom",\r
+       ACTIVE : "1976 - 1980",\r
+       FROM : "College - Indiana",\r
+       TEAM_LOGO : "./images/nba_griz.jpg"\r
+}, {\r
+       NAME : "Able, Forest Edward (Frosty)",\r
+       ACTIVE : "1956 - 1956",\r
+       FROM : "College - Western Kentucky; Louisville",\r
+       TEAM_LOGO : "./images/nba_nuggets.jpg"\r
+}, {\r
+       NAME : "Abramovic, John Jr. (Brooms)",\r
+       ACTIVE : "1946 - 1947",\r
+       FROM : "College - Salem (NC)",\r
+       TEAM_LOGO : "./images/nba_suns.jpg"\r
+}, {\r
+       NAME : "Acker, Alex",\r
+       ACTIVE : "2005 - 2008",\r
+       FROM : "College - Pepperdine",\r
+       TEAM_LOGO : "./images/nba_trail.jpg"\r
+}, {\r
+       NAME : "Ackerman, Donald D. (Buddy)",\r
+       ACTIVE : "1953 - 1953",\r
+       FROM : "College - Long Island University",\r
+       TEAM_LOGO : "./images/nba_lakers.jpg"\r
+}, {\r
+       NAME : "Acres, Mark",\r
+       ACTIVE : "1987 - 1992",\r
+       FROM : "College - Oral Roberts",\r
+       TEAM_LOGO : "./images/nba_knics.jpg"\r
+}, {\r
+       NAME : "Acton, Charles R. (Bud)",\r
+       ACTIVE : "1967 - 1967",\r
+       FROM : "College - Alma; Hillsdale",\r
+       TEAM_LOGO : "./images/nba_jazz.jpg"\r
+}, {\r
+       NAME : "Adams, Alvan",\r
+       ACTIVE : "1975 - 1987",\r
+       FROM : "College - Oklahoma",\r
+       TEAM_LOGO : "./images/nba_magics.jpg"\r
+}, {\r
+       NAME : "Adams, Donald L. (Don)",\r
+       ACTIVE : "1970 - 1976",\r
+       FROM : "College - Northwestern",\r
+       TEAM_LOGO : "./images/nba_celtics.jpg"\r
+}, {\r
+       NAME : "Adams, Hassan",\r
+       ACTIVE : "2006 - 2008",\r
+       FROM : "College - Arizona",\r
+       TEAM_LOGO : "./images/nba_cavaliers.jpg"\r
+}, {\r
+       NAME : "Adams, Michael",\r
+       ACTIVE : "1985 - 1995",\r
+       FROM : "College - Boston College",\r
+       TEAM_LOGO : "./images/nba_honets.jpg"\r
+}, {\r
+       NAME : "Addison, Rafael",\r
+       ACTIVE : "1986 - 1996",\r
+       FROM : "College - Syracuse",\r
+       TEAM_LOGO : "./images/nba_raptors.jpg"\r
+}, {\r
+       NAME : "Adelman, Rick",\r
+       ACTIVE : "1968 - 1974",\r
+       FROM : "College - Loyola Marymount",\r
+       TEAM_LOGO : "./images/nba_timberwolves.jpg"\r
+}, {\r
+       NAME : "Adrien, Jeff",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Connecticut",\r
+       TEAM_LOGO : "./images/nba_honets.jpg"\r
+}, {\r
+       NAME : "Afflalo, Arron",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - UCLA",\r
+       TEAM_LOGO : "./images/nba_lakers.jpg"\r
+}, {\r
+       NAME : "Ager, Maurice",\r
+       ACTIVE : "2007 - 2010",\r
+       FROM : "College - Michigan State",\r
+       TEAM_LOGO : "./images/nba_bucks.jpg"\r
+}, {\r
+       NAME : "Aguirre, Mark",\r
+       ACTIVE : "1981 - 1993",\r
+       FROM : "College - DePaul",\r
+       TEAM_LOGO : "./images/nba_pistons.jpg"\r
+}, {\r
+       NAME : "Ahearn, Blake",\r
+       ACTIVE : "2007 - 2008",\r
+       FROM : "College - Missouri State",\r
+       TEAM_LOGO : "./images/nba_bulls.jpg"\r
+}, {\r
+       NAME : "Ainge, Danny",\r
+       ACTIVE : "1981 - 1994",\r
+       FROM : "College - Brigham Young",\r
+       TEAM_LOGO : "./images/nba_kings.jpg"\r
+}, {\r
+       NAME : "Ajinca, Alexis",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "From - Saint Etienne, France",\r
+       TEAM_LOGO : "./images/nba_warriors.jpg"\r
+}, {\r
+       NAME : "Akin, Henry T.",\r
+       ACTIVE : "1966 - 1967",\r
+       FROM : "College - William Carey; Morehead State",\r
+       TEAM_LOGO : "./images/nba_nuggets.jpg"\r
+}, {\r
+       NAME : "Alabi, Solomon",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Florida State",\r
+       TEAM_LOGO : "./images/nba_trail.jpg"\r
+}, {\r
+       NAME : "Alarie, Mark",\r
+       ACTIVE : "1986 - 1990",\r
+       FROM : "College - Duke",\r
+       TEAM_LOGO : "./images/nba_cavaliers.jpg"\r
+}, {\r
+       NAME : "Alcorn, Gary R.",\r
+       ACTIVE : "1959 - 1960",\r
+       FROM : "College - Fresno City Coll. CA (J.C.); Fresno State",\r
+       TEAM_LOGO : "./images/nba_76ers.jpg"\r
+}, {\r
+       NAME : "Aldrich, Cole",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Kansas",\r
+       TEAM_LOGO : "./images/nba_clippers.jpg"\r
+}, {\r
+       NAME : "Aldridge, LaMarcus",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Texas",\r
+       TEAM_LOGO : "./images/nba_nuggets.jpg"\r
+}, {\r
+       NAME : "Aleksinas, Chuck",\r
+       ACTIVE : "1984 - 1984",\r
+       FROM : "College - Kentucky; Connecticut",\r
+       TEAM_LOGO : "./images/nba_pacers.jpg"\r
+}, {\r
+       NAME : "Alexander, Cory",\r
+       ACTIVE : "1995 - 2004",\r
+       FROM : "College - Virginia",\r
+       TEAM_LOGO : "./images/nba_honets.jpg"\r
+}, {\r
+       NAME : "Alexander, Courtney",\r
+       ACTIVE : "2000 - 2002",\r
+       FROM : "College - Fresno State",\r
+       TEAM_LOGO : "./images/nba_mavericks.jpg"\r
+}, {\r
+       NAME : "Alexander, Gary",\r
+       ACTIVE : "1993 - 1993",\r
+       FROM : "College - South Florida",\r
+       TEAM_LOGO : "./images/nba_bobcats.jpg"\r
+}, {\r
+       NAME : "Alexander, Joe",\r
+       ACTIVE : "2008 - 2009",\r
+       FROM : "College - West Virginia",\r
+       TEAM_LOGO : "./images/nba_mavericks.jpg"\r
+}, {\r
+       NAME : "Alexander, Victor",\r
+       ACTIVE : "1991 - 2001",\r
+       FROM : "College - Iowa State",\r
+       TEAM_LOGO : "./images/nba_magics.jpg"\r
+}, {\r
+       NAME : "Alford, Steve",\r
+       ACTIVE : "1987 - 1990",\r
+       FROM : "College - Indiana",\r
+       TEAM_LOGO : "./images/nba_spurs.jpg"\r
+}, {\r
+       NAME : "Allen, Jerome",\r
+       ACTIVE : "1995 - 1996",\r
+       FROM : "College - Pennsylvania",\r
+       TEAM_LOGO : "./images/nba_wizards.jpg"\r
+}, {\r
+       NAME : "Allen, Lucius",\r
+       ACTIVE : "1969 - 1978",\r
+       FROM : "College - UCLA",\r
+       TEAM_LOGO : "./images/nba_warriors.jpg"\r
+}, {\r
+       NAME : "Allen, Malik",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Villanova",\r
+       TEAM_LOGO : "./images/nba_lakers.jpg"\r
+}, {\r
+       NAME : "Allen, Randy",\r
+       ACTIVE : "1988 - 1989",\r
+       FROM : "College - Florida State",\r
+       TEAM_LOGO : "./images/nba_mavericks.jpg"\r
+}, {\r
+       NAME : "Allen, Ray",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Connecticut",\r
+       TEAM_LOGO : "./images/nba_mavericks.jpg"\r
+}, {\r
+       NAME : "Allen, Robert J. (Bob)",\r
+       ACTIVE : "1968 - 1968",\r
+       FROM : "College - Marshall",\r
+       TEAM_LOGO : "./images/nba_rockets.jpg"\r
+}, {\r
+       NAME : "Allen, Tony",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Oklahoma State",\r
+       TEAM_LOGO : "./images/nba_nuggets.jpg"\r
+}, {\r
+       NAME : "Allison, Odis Jr.",\r
+       ACTIVE : "1971 - 1971",\r
+       FROM : "College - Laney Coll. CA (J.C.); Nevada-Las Vegas",\r
+       TEAM_LOGO : "./images/nba_jazz.jpg"\r
+}, {\r
+       NAME : "Allred, Lance",\r
+       ACTIVE : "2007 - 2007",\r
+       FROM : "College - Weber State",\r
+       TEAM_LOGO : "./images/nba_celtics.jpg"\r
+}, {\r
+       NAME : "Allums, Darrell",\r
+       ACTIVE : "1980 - 1980",\r
+       FROM : "College - UCLA",\r
+       TEAM_LOGO : "./images/nba_hawks.jpg"\r
+}, {\r
+       NAME : "Almond, Morris",\r
+       ACTIVE : "2007 - 2008",\r
+       FROM : "College - Rice",\r
+       TEAM_LOGO : "./images/nba_bobcats.jpg"\r
+}, {\r
+       NAME : "Babbitt, Luke",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Nevada-Reno",\r
+       TEAM_LOGO : "./images/nba_76ers.jpg"\r
+}, {\r
+       NAME : "Babic, Milos",\r
+       ACTIVE : "1990 - 1991",\r
+       FROM : "College - Tennessee Tech",\r
+       TEAM_LOGO : "./images/nba_wizards.jpg"\r
+}, {\r
+       NAME : "Bach, John William (Johnny)",\r
+       ACTIVE : "1948 - 1948",\r
+       FROM : "College - Fordham; Rochester; Brown",\r
+       TEAM_LOGO : "./images/nba_76ers.jpg"\r
+}, {\r
+       NAME : "Baechtold, James E. (Jim)",\r
+       ACTIVE : "1952 - 1956",\r
+       FROM : "College - Eastern Kentucky",\r
+       TEAM_LOGO : "./images/nba_lakers.jpg"\r
+}, {\r
+       NAME : "Bagaric, Dalibor",\r
+       ACTIVE : "2000 - 2002",\r
+       FROM : "From - Croatia",\r
+       TEAM_LOGO : "./images/nba_cavaliers.jpg"\r
+}, {\r
+       NAME : "Bagley, John",\r
+       ACTIVE : "1982 - 1993",\r
+       FROM : "College - Boston College",\r
+       TEAM_LOGO : "./images/nba_pacers.jpg"\r
+}, {\r
+       NAME : "Bailey, Augustus (Gus)",\r
+       ACTIVE : "1974 - 1979",\r
+       FROM : "College - Texas-El Paso",\r
+       TEAM_LOGO : "./images/nba_hawks.jpg"\r
+}, {\r
+       NAME : "Bailey, Carl",\r
+       ACTIVE : "1981 - 1981",\r
+       FROM : "College - Tuskegee",\r
+       TEAM_LOGO : "./images/nba_kings.jpg"\r
+}, {\r
+       NAME : "Bailey, James",\r
+       ACTIVE : "1979 - 1987",\r
+       FROM : "College - Rutgers",\r
+       TEAM_LOGO : "./images/nba_mavericks.jpg"\r
+}, {\r
+       NAME : "Bailey, Thurl",\r
+       ACTIVE : "1983 - 1998",\r
+       FROM : "College - North Carolina State",\r
+       TEAM_LOGO : "./images/nba_heats.jpg"\r
+}, {\r
+       NAME : "Bailey, Toby",\r
+       ACTIVE : "1998 - 1999",\r
+       FROM : "College - UCLA ''98",\r
+       TEAM_LOGO : "./images/nba_jazz.jpg"\r
+}, {\r
+       NAME : "Baker, Mark",\r
+       ACTIVE : "1998 - 1998",\r
+       FROM : "College - Ohio State",\r
+       TEAM_LOGO : "./images/nba_lakers.jpg"\r
+}, {\r
+       NAME : "Baker, Maurice",\r
+       ACTIVE : "2004 - 2004",\r
+       FROM : "College - Oklahoma State '02",\r
+       TEAM_LOGO : "./images/nba_heats.jpg"\r
+}, {\r
+       NAME : "Baker, Norman Henry (Norm)",\r
+       ACTIVE : "1946 - 1946",\r
+       FROM : "College - No College",\r
+       TEAM_LOGO : "./images/nba_jazz.jpg"\r
+}, {\r
+       NAME : "Baker, Vin",\r
+       ACTIVE : "1993 - 2005",\r
+       FROM : "College - Hartford",\r
+       TEAM_LOGO : "./images/nba_knics.jpg"\r
+}, {\r
+       NAME : "Balkman, Renaldo",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - South Carolina",\r
+       TEAM_LOGO : "./images/nba_trail.jpg"\r
+}, {\r
+       NAME : "Ball, Cedric",\r
+       ACTIVE : "1990 - 1990",\r
+       FROM : "College - North Carolina-Charlotte",\r
+       TEAM_LOGO : "./images/nba_pacers.jpg"\r
+}, {\r
+       NAME : "Ballard, Greg",\r
+       ACTIVE : "1977 - 1988",\r
+       FROM : "College - Shasta Coll. CA (J.C.); Oregon",\r
+       TEAM_LOGO : "./images/nba_mavericks.jpg"\r
+}, {\r
+       NAME : "Baltimore, Herschel David (Herk)",\r
+       ACTIVE : "1946 - 1946",\r
+       FROM : "College - Penn State",\r
+       TEAM_LOGO : "./images/nba_spurs.jpg"\r
+}, {\r
+       NAME : "Banks, Gene",\r
+       ACTIVE : "1981 - 1986",\r
+       FROM : "College - Duke",\r
+       TEAM_LOGO : "./images/nba_raptors.jpg"\r
+}, {\r
+       NAME : "Banks, Marcus",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Nevada-Las Vegas",\r
+       TEAM_LOGO : "./images/nba_trail.jpg"\r
+}, {\r
+       NAME : "Bannister, Ken",\r
+       ACTIVE : "1984 - 1990",\r
+       FROM : "College - Trinidad State JC CO; Indiana State; Saint Augustine College",\r
+       TEAM_LOGO : "./images/nba_griz.jpg"\r
+}, {\r
+       NAME : "Bantom, Mike",\r
+       ACTIVE : "1973 - 1981",\r
+       FROM : "College - St. Joseph's (PA)",\r
+       TEAM_LOGO : "./images/nba_griz.jpg"\r
+}, {\r
+       NAME : "Barber, John",\r
+       ACTIVE : "1956 - 1956",\r
+       FROM : "College - Los Angeles State",\r
+       TEAM_LOGO : "./images/nba_nets.jpg"\r
+}, {\r
+       NAME : "Barbosa, Leandro",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "From - Sau Paulo, Brazil",\r
+       TEAM_LOGO : "./images/nba_jazz.jpg"\r
+}, {\r
+       NAME : "Bardo, Stephen",\r
+       ACTIVE : "1991 - 1995",\r
+       FROM : "College - Illinois",\r
+       TEAM_LOGO : "./images/nba_heats.jpg"\r
+}, {\r
+       NAME : "Barea, Jose",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Northeastern",\r
+       TEAM_LOGO : "./images/nba_warriors.jpg"\r
+}, {\r
+       NAME : "Bargnani, Andrea",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "From - Rome, Italy",\r
+       TEAM_LOGO : "./images/nba_hawks.jpg"\r
+}, {\r
+       NAME : "Barker, Clifford E. (Cliff)",\r
+       ACTIVE : "1949 - 1951",\r
+       FROM : "College - Kentucky",\r
+       TEAM_LOGO : "./images/nba_bobcats.jpg"\r
+}, {\r
+       NAME : "Barker, Thomas Kevin (Tom)",\r
+       ACTIVE : "1976 - 1978",\r
+       FROM : "College - Minnesota; Coll. of Southern Idaho (J.C.); Hawaii",\r
+       TEAM_LOGO : "./images/nba_cavaliers.jpg"\r
+}, {\r
+       NAME : "Barkley, Charles",\r
+       ACTIVE : "1984 - 1999",\r
+       FROM : "College - Auburn",\r
+       TEAM_LOGO : "./images/nba_celtics.jpg"\r
+}, {\r
+       NAME : "Barkley, Erick",\r
+       ACTIVE : "2000 - 2001",\r
+       FROM : "College - St. John''s '02",\r
+       TEAM_LOGO : "./images/nba_nets.jpg"\r
+}, {\r
+       NAME : "Barksdale, Don Angelo",\r
+       ACTIVE : "1951 - 1954",\r
+       FROM : "College - Coll. of Marin CA (J.C.); UCLA",\r
+       TEAM_LOGO : "./images/nba_bobcats.jpg"\r
+}, {\r
+       NAME : "Barnes, Harry J.",\r
+       ACTIVE : "1968 - 1968",\r
+       FROM : "College - Northeastern",\r
+       TEAM_LOGO : "./images/nba_nuggets.jpg"\r
+}, {\r
+       NAME : "Barnes, Marvin Jerome",\r
+       ACTIVE : "1976 - 1979",\r
+       FROM : "College - Providence",\r
+       TEAM_LOGO : "./images/nba_knics.jpg"\r
+}, {\r
+       NAME : "Barnes, Matt",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - UCLA",\r
+       TEAM_LOGO : "./images/nba_honets.jpg"\r
+}, {\r
+       NAME : "Barnes, V. James (Jim, Bad News)",\r
+       ACTIVE : "1964 - 1970",\r
+       FROM : "College - Cameron; Texas-El Paso",\r
+       TEAM_LOGO : "./images/nba_lakers.jpg"\r
+}, {\r
+       NAME : "Barnett, Dick",\r
+       ACTIVE : "1959 - 1973",\r
+       FROM : "College - Tennessee State",\r
+       TEAM_LOGO : "./images/nba_clippers.jpg"\r
+}, {\r
+       NAME : "Barnett, James Franklin (Jim)",\r
+       ACTIVE : "1966 - 1976",\r
+       FROM : "College - Oregon",\r
+       TEAM_LOGO : "./images/nba_celtics.jpg"\r
+}, {\r
+       NAME : "Barnhill, John Anthony (Rabbit)",\r
+       ACTIVE : "1962 - 1968",\r
+       FROM : "College - Tennessee State",\r
+       TEAM_LOGO : "./images/nba_nets.jpg"\r
+}, {\r
+       NAME : "Barnhill, Norton",\r
+       ACTIVE : "1976 - 1976",\r
+       FROM : "College - Washington State",\r
+       TEAM_LOGO : "./images/nba_nuggets.jpg"\r
+}, {\r
+       NAME : "Barnhorst, Leo A. (Barney)",\r
+       ACTIVE : "1949 - 1953",\r
+       FROM : "College - Notre Dame",\r
+       TEAM_LOGO : "./images/nba_bobcats.jpg"\r
+}, {\r
+       NAME : "Barr, John E.",\r
+       ACTIVE : "1946 - 1946",\r
+       FROM : "College - Penn State",\r
+       TEAM_LOGO : "./images/nba_mavericks.jpg"\r
+}, {\r
+       NAME : "Barr, Michael J. (Mike)",\r
+       ACTIVE : "1976 - 1976",\r
+       FROM : "College - Duquesne",\r
+       TEAM_LOGO : "./images/nba_wizards.jpg"\r
+}, {\r
+       NAME : "Barr, Thomas L. (Moe)",\r
+       ACTIVE : "1970 - 1970",\r
+       FROM : "College - Duquesne",\r
+       TEAM_LOGO : "./images/nba_kings.jpg"\r
+}, {\r
+       NAME : "Barrett, Andre",\r
+       ACTIVE : "2007 - 2007",\r
+       FROM : "College - Seton Hall",\r
+       TEAM_LOGO : "./images/nba_rockets.jpg"\r
+}, {\r
+       NAME : "Barrett, Ernie Drew",\r
+       ACTIVE : "1953 - 1955",\r
+       FROM : "College - Kansas State",\r
+       TEAM_LOGO : "./images/nba_nuggets.jpg"\r
+}, {\r
+       NAME : "Barron, Earl",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Memphis",\r
+       TEAM_LOGO : "./images/nba_knics.jpg"\r
+}, {\r
+       NAME : "Barros, Dana",\r
+       ACTIVE : "1989 - 2003",\r
+       FROM : "College - Boston College ''89",\r
+       TEAM_LOGO : "./images/nba_celtics.jpg"\r
+}, {\r
+       NAME : "Barry, Brent",\r
+       ACTIVE : "2007 - 2008",\r
+       FROM : "College - Oregon State",\r
+       TEAM_LOGO : "./images/nba_timberwolves.jpg"\r
+}, {\r
+       NAME : "Cabarkapa, Zarko",\r
+       ACTIVE : "2003 - 2005",\r
+       FROM : "From - Serbia & Montenegro",\r
+       TEAM_LOGO : "./images/nba_timberwolves.jpg"\r
+}, {\r
+       NAME : "Cable, Byrum William (Barney)",\r
+       ACTIVE : "1958 - 1963",\r
+       FROM : "College - Bradley",\r
+       TEAM_LOGO : "./images/nba_rockets.jpg"\r
+}, {\r
+       NAME : "Caffey, Jason",\r
+       ACTIVE : "1995 - 2002",\r
+       FROM : "College - Alabama ''95",\r
+       TEAM_LOGO : "./images/nba_sonics.jpg"\r
+}, {\r
+       NAME : "Cage, Michael",\r
+       ACTIVE : "1984 - 1999",\r
+       FROM : "College - San Diego State",\r
+       TEAM_LOGO : "./images/nba_cavaliers.jpg"\r
+}, {\r
+       NAME : "Calabrese, Gerald A. (Gerry)",\r
+       ACTIVE : "1950 - 1951",\r
+       FROM : "College - St. John's (N.Y.)",\r
+       TEAM_LOGO : "./images/nba_raptors.jpg"\r
+}, {\r
+       NAME : "Calderon, Jose",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "From - Villanueva de la Serena, Spain",\r
+       TEAM_LOGO : "./images/nba_bucks.jpg"\r
+}, {\r
+       NAME : "Caldwell, Adrian",\r
+       ACTIVE : "1989 - 1997",\r
+       FROM : "College - Navarro Coll. TX (J.C.); Southern Methodist; Lamar",\r
+       TEAM_LOGO : "./images/nba_pistons.jpg"\r
+}, {\r
+       NAME : "Caldwell, James W. Jr. (Jim)",\r
+       ACTIVE : "1967 - 1967",\r
+       FROM : "College - Georgia Tech",\r
+       TEAM_LOGO : "./images/nba_sonics.jpg"\r
+}, {\r
+       NAME : "Caldwell, Joe (Pogo)",\r
+       ACTIVE : "1964 - 1969",\r
+       FROM : "College - Arizona State",\r
+       TEAM_LOGO : "./images/nba_sonics.jpg"\r
+}, {\r
+       NAME : "Calhoun, David L. (Corky)",\r
+       ACTIVE : "1972 - 1979",\r
+       FROM : "College - Pennsylvania",\r
+       TEAM_LOGO : "./images/nba_clippers.jpg"\r
+}, {\r
+       NAME : "Calhoun, William C. (Bill)",\r
+       ACTIVE : "1948 - 1954",\r
+       FROM : "College - San Francisco City Coll. CA (J.C.)",\r
+       TEAM_LOGO : "./images/nba_rockets.jpg"\r
+}, {\r
+       NAME : "Calip, Demetrius",\r
+       ACTIVE : "1991 - 1991",\r
+       FROM : "College - Michigan",\r
+       TEAM_LOGO : "./images/nba_trail.jpg"\r
+}, {\r
+       NAME : "Callahan, Thomas Francis (Tom)",\r
+       ACTIVE : "1946 - 1946",\r
+       FROM : "College - Notre Dame; Rockhurst",\r
+       TEAM_LOGO : "./images/nba_lakers.jpg"\r
+}, {\r
+       NAME : "Calloway, Rick",\r
+       ACTIVE : "1990 - 1990",\r
+       FROM : "College - Indiana; Kansas",\r
+       TEAM_LOGO : "./images/nba_lakers.jpg"\r
+}, {\r
+       NAME : "Calverley, Ernest A. (Ernie)",\r
+       ACTIVE : "1946 - 1948",\r
+       FROM : "College - Rhode Island",\r
+       TEAM_LOGO : "./images/nba_nuggets.jpg"\r
+}, {\r
+       NAME : "Calvin, Mack",\r
+       ACTIVE : "1976 - 1980",\r
+       FROM : "College - Long Beach City Coll. CA (J.C.); USC",\r
+       TEAM_LOGO : "./images/nba_griz.jpg"\r
+}, {\r
+       NAME : "Cambridge, Dexter",\r
+       ACTIVE : "1992 - 1992",\r
+       FROM : "College - Lon Morris Coll. TX (J.C.); Texas",\r
+       TEAM_LOGO : "./images/nba_bucks.jpg"\r
+}, {\r
+       NAME : "Camby, Marcus",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Massachusetts",\r
+       TEAM_LOGO : "./images/nba_bulls.jpg"\r
+}, {\r
+       NAME : "Campbell, Elden",\r
+       ACTIVE : "1990 - 2004",\r
+       FROM : "College - Clemson",\r
+       TEAM_LOGO : "./images/nba_warriors.jpg"\r
+}, {\r
+       NAME : "Campbell, Tony",\r
+       ACTIVE : "1984 - 1994",\r
+       FROM : "College - Ohio State",\r
+       TEAM_LOGO : "./images/nba_nets.jpg"\r
+}, {\r
+       NAME : "Cannon, Lawrence T. (Larry)",\r
+       ACTIVE : "1973 - 1973",\r
+       FROM : "College - La Salle",\r
+       TEAM_LOGO : "./images/nba_kings.jpg"\r
+}, {\r
+       NAME : "Caracter, Derrick",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Texas-El Paso",\r
+       TEAM_LOGO : "./images/nba_rockets.jpg"\r
+}, {\r
+       NAME : "Cardinal, Brian",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Purdue",\r
+       TEAM_LOGO : "./images/nba_heats.jpg"\r
+}, {\r
+       NAME : "Carl, Howard Hershey (Howie)",\r
+       ACTIVE : "1961 - 1961",\r
+       FROM : "College - Illinois; DePaul",\r
+       TEAM_LOGO : "./images/nba_raptors.jpg"\r
+}, {\r
+       NAME : "Carlisle, Chester G. (Chet)",\r
+       ACTIVE : "1946 - 1946",\r
+       FROM : "College - California",\r
+       TEAM_LOGO : "./images/nba_cavaliers.jpg"\r
+}, {\r
+       NAME : "Carlisle, Geno",\r
+       ACTIVE : "2004 - 2004",\r
+       FROM : "College - California '99",\r
+       TEAM_LOGO : "./images/nba_heats.jpg"\r
+}, {\r
+       NAME : "Carlisle, Rick",\r
+       ACTIVE : "1984 - 1989",\r
+       FROM : "College - Maine; Virginia",\r
+       TEAM_LOGO : "./images/nba_mavericks.jpg"\r
+}, {\r
+       NAME : "Carlson, Alvin Harold",\r
+       ACTIVE : "1975 - 1975",\r
+       FROM : "College - USC; Oregon",\r
+       TEAM_LOGO : "./images/nba_bucks.jpg"\r
+}, {\r
+       NAME : "Carlson, Don Vernon (Swede)",\r
+       ACTIVE : "1946 - 1950",\r
+       FROM : "College - Minnesota",\r
+       TEAM_LOGO : "./images/nba_kings.jpg"\r
+}, {\r
+       NAME : "Carney, Robert Lee (Bob)",\r
+       ACTIVE : "1954 - 1954",\r
+       FROM : "College - Bradley",\r
+       TEAM_LOGO : "./images/nba_raptors.jpg"\r
+}, {\r
+       NAME : "Carney, Rodney",\r
+       ACTIVE : "2007 - 2010",\r
+       FROM : "College - Memphis",\r
+       TEAM_LOGO : "./images/nba_raptors.jpg"\r
+}, {\r
+       NAME : "Carpenter, Robert H. (Bob)",\r
+       ACTIVE : "1949 - 1950",\r
+       FROM : "College - Texas A&M-Commerce",\r
+       TEAM_LOGO : "./images/nba_knics.jpg"\r
+}, {\r
+       NAME : "Carr, Antoine",\r
+       ACTIVE : "1984 - 1999",\r
+       FROM : "College - Wichita State",\r
+       TEAM_LOGO : "./images/nba_kings.jpg"\r
+}, {\r
+       NAME : "Carr, Austin George",\r
+       ACTIVE : "1971 - 1980",\r
+       FROM : "College - Notre Dame",\r
+       TEAM_LOGO : "./images/nba_rockets.jpg"\r
+}, {\r
+       NAME : "Carr, Chris",\r
+       ACTIVE : "1995 - 2000",\r
+       FROM : "College - Southern Illinois",\r
+       TEAM_LOGO : "./images/nba_bucks.jpg"\r
+}, {\r
+       NAME : "Carr, Cory",\r
+       ACTIVE : "1998 - 1998",\r
+       FROM : "College - Texas Tech",\r
+       TEAM_LOGO : "./images/nba_hawks.jpg"\r
+}, {\r
+       NAME : "Carr, Kenny",\r
+       ACTIVE : "1977 - 1986",\r
+       FROM : "College - North Carolina State",\r
+       TEAM_LOGO : "./images/nba_rockets.jpg"\r
+}, {\r
+       NAME : "Carr, M.L.",\r
+       ACTIVE : "1976 - 1984",\r
+       FROM : "College - Guilford",\r
+       TEAM_LOGO : "./images/nba_heats.jpg"\r
+}, {\r
+       NAME : "Carrington, Robert Frederick (Bob)",\r
+       ACTIVE : "1977 - 1979",\r
+       FROM : "College - Boston College",\r
+       TEAM_LOGO : "./images/nba_76ers.jpg"\r
+}, {\r
+       NAME : "Carroll, DeMarre",\r
+       ACTIVE : "2009 - 2010",\r
+       FROM : "College - Missouri",\r
+       TEAM_LOGO : "./images/nba_magics.jpg"\r
+}, {\r
+       NAME : "Carroll, Joe Barry",\r
+       ACTIVE : "1980 - 1990",\r
+       FROM : "College - Purdue",\r
+       TEAM_LOGO : "./images/nba_trail.jpg"\r
+}, {\r
+       NAME : "Carroll, Matt",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Notre Dame",\r
+       TEAM_LOGO : "./images/nba_nets.jpg"\r
+}, {\r
+       NAME : "Carruth, Jimmy",\r
+       ACTIVE : "1996 - 1996",\r
+       FROM : "College - Virginia Tech",\r
+       TEAM_LOGO : "./images/nba_wizards.jpg"\r
+}, {\r
+       NAME : "Carter, Anthony",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Hawaii",\r
+       TEAM_LOGO : "./images/nba_kings.jpg"\r
+}, {\r
+       NAME : "Carter, Butch",\r
+       ACTIVE : "1980 - 1985",\r
+       FROM : "College - Indiana",\r
+       TEAM_LOGO : "./images/nba_nets.jpg"\r
+}, {\r
+       NAME : "Carter, Frederick James (Fred, Mad Dog)",\r
+       ACTIVE : "1969 - 1976",\r
+       FROM : "College - Mount St. Mary's",\r
+       TEAM_LOGO : "./images/nba_pistons.jpg"\r
+}, {\r
+       NAME : "Carter, George",\r
+       ACTIVE : "1967 - 1967",\r
+       FROM : "College - St. Bonaventure",\r
+       TEAM_LOGO : "./images/nba_clippers.jpg"\r
+}, {\r
+       NAME : "Carter, Howard",\r
+       ACTIVE : "1983 - 1984",\r
+       FROM : "College - Louisiana State",\r
+       TEAM_LOGO : "./images/nba_rockets.jpg"\r
+}, {\r
+       NAME : "Carter, John D. (Jake)",\r
+       ACTIVE : "1949 - 1949",\r
+       FROM : "College - Texas A&M-Commerce",\r
+       TEAM_LOGO : "./images/nba_heats.jpg"\r
+}, {\r
+       NAME : "Carter, Maurice",\r
+       ACTIVE : "2003 - 2003",\r
+       FROM : "College - Louisiana State ''99",\r
+       TEAM_LOGO : "./images/nba_magics.jpg"\r
+}, {\r
+       NAME : "D'Antoni, Michael Andrew (Mike)",\r
+       ACTIVE : "1973 - 1976",\r
+       FROM : "College - Marshall",\r
+       TEAM_LOGO : "./images/nba_jazz.jpg"\r
+}, {\r
+       NAME : "Dahler, Edward Jr. (Ed)",\r
+       ACTIVE : "1951 - 1951",\r
+       FROM : "College - Duquesne",\r
+       TEAM_LOGO : "./images/nba_trail.jpg"\r
+}, {\r
+       NAME : "Dailey, Quintin",\r
+       ACTIVE : "1982 - 1991",\r
+       FROM : "College - San Francisco",\r
+       TEAM_LOGO : "./images/nba_magics.jpg"\r
+}, {\r
+       NAME : "Dalembert, Samuel",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Seton Hall",\r
+       TEAM_LOGO : "./images/nba_honets.jpg"\r
+}, {\r
+       NAME : "Dallmar, Howard (Howie)",\r
+       ACTIVE : "1946 - 1948",\r
+       FROM : "College - Stanford; Pennsylvania",\r
+       TEAM_LOGO : "./images/nba_bulls.jpg"\r
+}, {\r
+       NAME : "Dampier, Erick",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Mississippi State",\r
+       TEAM_LOGO : "./images/nba_trail.jpg"\r
+}, {\r
+       NAME : "Dampier, Louie (Lou)",\r
+       ACTIVE : "1976 - 1978",\r
+       FROM : "College - Kentucky",\r
+       TEAM_LOGO : "./images/nba_rockets.jpg"\r
+}, {\r
+       NAME : "Dandridge, Robert L. Jr. (Bob)",\r
+       ACTIVE : "1969 - 1981",\r
+       FROM : "College - Norfolk State",\r
+       TEAM_LOGO : "./images/nba_jazz.jpg"\r
+}, {\r
+       NAME : "Daniels, Antonio",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Bowling Green",\r
+       TEAM_LOGO : "./images/nba_bobcats.jpg"\r
+}, {\r
+       NAME : "Daniels, Erik",\r
+       ACTIVE : "2004 - 2004",\r
+       FROM : "College - Kentucky",\r
+       TEAM_LOGO : "./images/nba_griz.jpg"\r
+}, {\r
+       NAME : "Daniels, Lloyd",\r
+       ACTIVE : "1992 - 1997",\r
+       FROM : "College - Mount San Antonio Coll. CA (J.C.)",\r
+       TEAM_LOGO : "./images/nba_nets.jpg"\r
+}, {\r
+       NAME : "Daniels, Marquis",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Auburn",\r
+       TEAM_LOGO : "./images/nba_76ers.jpg"\r
+}, {\r
+       NAME : "Daniels, Mel",\r
+       ACTIVE : "1976 - 1976",\r
+       FROM : "College - Burlington Co. Coll. NJ (J.C.); New Mexico",\r
+       TEAM_LOGO : "./images/nba_warriors.jpg"\r
+}, {\r
+       NAME : "Danilovic, Sasha",\r
+       ACTIVE : "1995 - 1996",\r
+       FROM : "College - Serbia",\r
+       TEAM_LOGO : "./images/nba_spurs.jpg"\r
+}, {\r
+       NAME : "Dantley, Adrian",\r
+       ACTIVE : "1976 - 1990",\r
+       FROM : "College - Notre Dame",\r
+       TEAM_LOGO : "./images/nba_jazz.jpg"\r
+}, {\r
+       NAME : "Darcey, Henry J. (Pete)",\r
+       ACTIVE : "1952 - 1952",\r
+       FROM : "College - Oklahoma State",\r
+       TEAM_LOGO : "./images/nba_bucks.jpg"\r
+}, {\r
+       NAME : "Darden, James W. (Jimmy)",\r
+       ACTIVE : "1949 - 1949",\r
+       FROM : "College - Wyoming; Denver",\r
+       TEAM_LOGO : "./images/nba_heats.jpg"\r
+}, {\r
+       NAME : "Dare, Yinka",\r
+       ACTIVE : "1994 - 1997",\r
+       FROM : "College - George Washington",\r
+       TEAM_LOGO : "./images/nba_clippers.jpg"\r
+}, {\r
+       NAME : "Dark, Jesse L.",\r
+       ACTIVE : "1974 - 1974",\r
+       FROM : "College - Virginia Commonwealth",\r
+       TEAM_LOGO : "./images/nba_heats.jpg"\r
+}, {\r
+       NAME : "Darrow, James K. (Jimmy)",\r
+       ACTIVE : "1961 - 1961",\r
+       FROM : "College - Bowling Green State",\r
+       TEAM_LOGO : "./images/nba_wizards.jpg"\r
+}, {\r
+       NAME : "Daugherty, Brad",\r
+       ACTIVE : "1986 - 1993",\r
+       FROM : "College - North Carolina",\r
+       TEAM_LOGO : "./images/nba_sonics.jpg"\r
+}, {\r
+       NAME : "David, Kornel",\r
+       ACTIVE : "1998 - 2000",\r
+       FROM : "College - Budapest AEH",\r
+       TEAM_LOGO : "./images/nba_bucks.jpg"\r
+}, {\r
+       NAME : "Davidson, Jermareo",\r
+       ACTIVE : "2007 - 2008",\r
+       FROM : "College - Alabama",\r
+       TEAM_LOGO : "./images/nba_pacers.jpg"\r
+}, {\r
+       NAME : "Davies, Robert Edris (Bob, Harrisburg Houdini)",\r
+       ACTIVE : "1948 - 1954",\r
+       FROM : "College - Franklin & Marshall; Seton Hall",\r
+       TEAM_LOGO : "./images/nba_bobcats.jpg"\r
+}, {\r
+       NAME : "Davis, Antonio",\r
+       ACTIVE : "1993 - 2005",\r
+       FROM : "College - Texas-El Paso",\r
+       TEAM_LOGO : "./images/nba_bulls.jpg"\r
+}, {\r
+       NAME : "Davis, Aubrey D.",\r
+       ACTIVE : "1946 - 1946",\r
+       FROM : "College - Oklahoma Baptist",\r
+       TEAM_LOGO : "./images/nba_trail.jpg"\r
+}, {\r
+       NAME : "Davis, Baron",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - UCLA",\r
+       TEAM_LOGO : "./images/nba_wizards.jpg"\r
+}, {\r
+       NAME : "Davis, Ben",\r
+       ACTIVE : "1996 - 1999",\r
+       FROM : "College - Arizona ''96",\r
+       TEAM_LOGO : "./images/nba_bucks.jpg"\r
+}, {\r
+       NAME : "Davis, Brad",\r
+       ACTIVE : "1977 - 1991",\r
+       FROM : "College - Maryland",\r
+       TEAM_LOGO : "./images/nba_jazz.jpg"\r
+}, {\r
+       NAME : "Davis, Brian",\r
+       ACTIVE : "1993 - 1993",\r
+       FROM : "College - Duke",\r
+       TEAM_LOGO : "./images/nba_cavaliers.jpg"\r
+}, {\r
+       NAME : "Davis, Charles Lawrence (Charlie)",\r
+       ACTIVE : "1971 - 1973",\r
+       FROM : "College - Wake Forest",\r
+       TEAM_LOGO : "./images/nba_magics.jpg"\r
+}, {\r
+       NAME : "Davis, Charlie E.",\r
+       ACTIVE : "1981 - 1989",\r
+       FROM : "College - Vanderbilt",\r
+       TEAM_LOGO : "./images/nba_jazz.jpg"\r
+}, {\r
+       NAME : "Davis, Dale",\r
+       ACTIVE : "1991 - 2006",\r
+       FROM : "College - Clemson",\r
+       TEAM_LOGO : "./images/nba_pacers.jpg"\r
+}, {\r
+       NAME : "Davis, Damon William (Monti)",\r
+       ACTIVE : "1980 - 1980",\r
+       FROM : "College - Tennessee State",\r
+       TEAM_LOGO : "./images/nba_timberwolves.jpg"\r
+}, {\r
+       NAME : "Davis, Dwight E. (Double D)",\r
+       ACTIVE : "1972 - 1976",\r
+       FROM : "College - Houston",\r
+       TEAM_LOGO : "./images/nba_bulls.jpg"\r
+}, {\r
+       NAME : "Davis, Ed",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - North Carolina",\r
+       TEAM_LOGO : "./images/nba_lakers.jpg"\r
+}, {\r
+       NAME : "Davis, Edward J. (Mickey)",\r
+       ACTIVE : "1972 - 1976",\r
+       FROM : "College - Duquesne",\r
+       TEAM_LOGO : "./images/nba_wizards.jpg"\r
+}, {\r
+       NAME : "Davis, Emanual",\r
+       ACTIVE : "1996 - 2002",\r
+       FROM : "College - Delaware State ''91",\r
+       TEAM_LOGO : "./images/nba_rockets.jpg"\r
+}, {\r
+       NAME : "Davis, Glen",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Louisiana State",\r
+       TEAM_LOGO : "./images/nba_lakers.jpg"\r
+}, {\r
+       NAME : "Davis, Harry A.",\r
+       ACTIVE : "1978 - 1979",\r
+       FROM : "College - Florida State",\r
+       TEAM_LOGO : "./images/nba_heats.jpg"\r
+}, {\r
+       NAME : "Davis, Hubert",\r
+       ACTIVE : "1992 - 2003",\r
+       FROM : "College - North Carolina ''92",\r
+       TEAM_LOGO : "./images/nba_nuggets.jpg"\r
+}, {\r
+       NAME : "Davis, James R. (Red)",\r
+       ACTIVE : "1955 - 1955",\r
+       FROM : "College - St. John's (N.Y.)",\r
+       TEAM_LOGO : "./images/nba_hawks.jpg"\r
+}, {\r
+       NAME : "Davis, James W. (Jim)",\r
+       ACTIVE : "1967 - 1974",\r
+       FROM : "College - Colorado",\r
+       TEAM_LOGO : "./images/nba_knics.jpg"\r
+}, {\r
+       NAME : "Davis, Johnny",\r
+       ACTIVE : "1976 - 1985",\r
+       FROM : "College - Dayton",\r
+       TEAM_LOGO : "./images/nba_trail.jpg"\r
+}, {\r
+       NAME : "Davis, Josh",\r
+       ACTIVE : "2003 - 2005",\r
+       FROM : "College - Wyoming",\r
+       TEAM_LOGO : "./images/nba_sonics.jpg"\r
+}, {\r
+       NAME : "Davis, Mark",\r
+       ACTIVE : "1988 - 1988",\r
+       FROM : "College - Old Dominion",\r
+       TEAM_LOGO : "./images/nba_sonics.jpg"\r
+}, {\r
+       NAME : "Davis, Mark",\r
+       ACTIVE : "1995 - 1999",\r
+       FROM : "College - Texas Tech",\r
+       TEAM_LOGO : "./images/nba_bucks.jpg"\r
+}, {\r
+       NAME : "Davis, Melvyn Jerome (Mel, Killer)",\r
+       ACTIVE : "1973 - 1976",\r
+       FROM : "College - St. John's (N.Y.)",\r
+       TEAM_LOGO : "./images/nba_timberwolves.jpg"\r
+}, {\r
+       NAME : "Davis, Michael",\r
+       ACTIVE : "1982 - 1982",\r
+       FROM : "College - Mercer Co. CC NJ; Maryland",\r
+       TEAM_LOGO : "./images/nba_spurs.jpg"\r
+}, {\r
+       NAME : "Davis, Michael A. (Mike, Crusher)",\r
+       ACTIVE : "1969 - 1972",\r
+       FROM : "College - Virginia Union",\r
+       TEAM_LOGO : "./images/nba_heats.jpg"\r
+}, {\r
+       NAME : "Eackles, Ledell",\r
+       ACTIVE : "1988 - 1997",\r
+       FROM : "College - San Jacinto Coll. TX (J.C.); New Orleans",\r
+       TEAM_LOGO : "./images/nba_mavericks.jpg"\r
+}, {\r
+       NAME : "Eakins, James Scott (Jim, Jimbo)",\r
+       ACTIVE : "1976 - 1977",\r
+       FROM : "College - Brigham Young",\r
+       TEAM_LOGO : "./images/nba_lakers.jpg"\r
+}, {\r
+       NAME : "Earl, Acie",\r
+       ACTIVE : "1993 - 1996",\r
+       FROM : "College - Iowa",\r
+       TEAM_LOGO : "./images/nba_bobcats.jpg"\r
+}, {\r
+       NAME : "Earle, Edwin (Ed)",\r
+       ACTIVE : "1953 - 1953",\r
+       FROM : "College - Loyola (Chicago)",\r
+       TEAM_LOGO : "./images/nba_pistons.jpg"\r
+}, {\r
+       NAME : "Eaton, Mark",\r
+       ACTIVE : "1982 - 1992",\r
+       FROM : "College - Cypress Coll. CA (J.C.); UCLA",\r
+       TEAM_LOGO : "./images/nba_timberwolves.jpg"\r
+}, {\r
+       NAME : "Eaves, Jerry",\r
+       ACTIVE : "1982 - 1986",\r
+       FROM : "College - Louisville",\r
+       TEAM_LOGO : "./images/nba_suns.jpg"\r
+}, {\r
+       NAME : "Ebanks, Devin",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - West Virginia",\r
+       TEAM_LOGO : "./images/nba_lakers.jpg"\r
+}, {\r
+       NAME : "Ebben, William Edward (Bill)",\r
+       ACTIVE : "1957 - 1957",\r
+       FROM : "College - Detroit",\r
+       TEAM_LOGO : "./images/nba_sonics.jpg"\r
+}, {\r
+       NAME : "Eberhard, Allen Dean (Al)",\r
+       ACTIVE : "1974 - 1977",\r
+       FROM : "College - Missouri",\r
+       TEAM_LOGO : "./images/nba_bobcats.jpg"\r
+}, {\r
+       NAME : "Ebi, Ndudi",\r
+       ACTIVE : "2003 - 2004",\r
+       FROM : "High School - Westbury Christian HS (TX)",\r
+       TEAM_LOGO : "./images/nba_mavericks.jpg"\r
+}, {\r
+       NAME : "Eddie, Patrick",\r
+       ACTIVE : "1991 - 1991",\r
+       FROM : "College - Arkansas State; Mississippi",\r
+       TEAM_LOGO : "./images/nba_griz.jpg"\r
+}, {\r
+       NAME : "Eddleman, Thomas Dwight (Dike)",\r
+       ACTIVE : "1949 - 1952",\r
+       FROM : "College - Illinois",\r
+       TEAM_LOGO : "./images/nba_clippers.jpg"\r
+}, {\r
+       NAME : "Edelin, Kenton Scott (Kent)",\r
+       ACTIVE : "1984 - 1984",\r
+       FROM : "College - Virginia",\r
+       TEAM_LOGO : "./images/nba_magics.jpg"\r
+}, {\r
+       NAME : "Edmonson, Keith",\r
+       ACTIVE : "1982 - 1983",\r
+       FROM : "College - Purdue",\r
+       TEAM_LOGO : "./images/nba_spurs.jpg"\r
+}, {\r
+       NAME : "Edney, Tyus",\r
+       ACTIVE : "1995 - 2000",\r
+       FROM : "College - UCLA",\r
+       TEAM_LOGO : "./images/nba_timberwolves.jpg"\r
+}, {\r
+       NAME : "Edwards, Bill",\r
+       ACTIVE : "1993 - 1993",\r
+       FROM : "College - Wright State",\r
+       TEAM_LOGO : "./images/nba_clippers.jpg"\r
+}, {\r
+       NAME : "Edwards, Blue",\r
+       ACTIVE : "1989 - 1998",\r
+       FROM : "College - Louisburg; East Carolina",\r
+       TEAM_LOGO : "./images/nba_kings.jpg"\r
+}, {\r
+       NAME : "Edwards, Corsley",\r
+       ACTIVE : "2004 - 2004",\r
+       FROM : "College - Central Connecticut State '02",\r
+       TEAM_LOGO : "./images/nba_rockets.jpg"\r
+}, {\r
+       NAME : "Edwards, Doug",\r
+       ACTIVE : "1993 - 1995",\r
+       FROM : "College - Florida State",\r
+       TEAM_LOGO : "./images/nba_griz.jpg"\r
+}, {\r
+       NAME : "Edwards, Franklin",\r
+       ACTIVE : "1981 - 1987",\r
+       FROM : "College - Cleveland State",\r
+       TEAM_LOGO : "./images/nba_timberwolves.jpg"\r
+}, {\r
+       NAME : "Edwards, James",\r
+       ACTIVE : "1977 - 1995",\r
+       FROM : "College - Washington",\r
+       TEAM_LOGO : "./images/nba_wizards.jpg"\r
+}, {\r
+       NAME : "Edwards, Jay",\r
+       ACTIVE : "1989 - 1989",\r
+       FROM : "College - Indiana",\r
+       TEAM_LOGO : "./images/nba_jazz.jpg"\r
+}, {\r
+       NAME : "Edwards, John",\r
+       ACTIVE : "2004 - 2005",\r
+       FROM : "College - Kent State",\r
+       TEAM_LOGO : "./images/nba_clippers.jpg"\r
+}, {\r
+       NAME : "Edwards, Kevin",\r
+       ACTIVE : "1988 - 2000",\r
+       FROM : "College - Lakeland CC OH; DePaul",\r
+       TEAM_LOGO : "./images/nba_warriors.jpg"\r
+}, {\r
+       NAME : "Egan, John Francis (Johnny)",\r
+       ACTIVE : "1961 - 1971",\r
+       FROM : "College - Providence",\r
+       TEAM_LOGO : "./images/nba_bobcats.jpg"\r
+}, {\r
+       NAME : "Eggleston, Lonnie J.",\r
+       ACTIVE : "1948 - 1948",\r
+       FROM : "College - Oklahoma State",\r
+       TEAM_LOGO : "./images/nba_suns.jpg"\r
+}, {\r
+       NAME : "Ehlers, Edwin S. (Eddie, Bulbs)",\r
+       ACTIVE : "1947 - 1948",\r
+       FROM : "College - Purdue",\r
+       TEAM_LOGO : "./images/nba_mavericks.jpg"\r
+}, {\r
+       NAME : "Ehlo, Craig",\r
+       ACTIVE : "1983 - 1996",\r
+       FROM : "College - Odessa Coll. TX (J.C.); Washington State",\r
+       TEAM_LOGO : "./images/nba_spurs.jpg"\r
+}, {\r
+       NAME : "Eichhorst, Richard A. (Dick)",\r
+       ACTIVE : "1961 - 1961",\r
+       FROM : "College - Southeast Missouri State",\r
+       TEAM_LOGO : "./images/nba_timberwolves.jpg"\r
+}, {\r
+       NAME : "Eisley, Howard",\r
+       ACTIVE : "1994 - 2005",\r
+       FROM : "College - Boston College",\r
+       TEAM_LOGO : "./images/nba_spurs.jpg"\r
+}, {\r
+       NAME : "Ekezie, Obinna",\r
+       ACTIVE : "1999 - 2004",\r
+       FROM : "College - Maryland",\r
+       TEAM_LOGO : "./images/nba_pacers.jpg"\r
+}, {\r
+       NAME : "El-Amin, Khalid",\r
+       ACTIVE : "2000 - 2000",\r
+       FROM : "College - Connecticut ''01",\r
+       TEAM_LOGO : "./images/nba_sonics.jpg"\r
+}, {\r
+       NAME : "Eliason, Donald Carlton (Don)",\r
+       ACTIVE : "1946 - 1946",\r
+       FROM : "College - Hamline",\r
+       TEAM_LOGO : "./images/nba_bucks.jpg"\r
+}, {\r
+       NAME : "Elie, Mario",\r
+       ACTIVE : "1990 - 2000",\r
+       FROM : "College - American International",\r
+       TEAM_LOGO : "./images/nba_trail.jpg"\r
+}, {\r
+       NAME : "Ellefson, E. Ray (Ray)",\r
+       ACTIVE : "1948 - 1950",\r
+       FROM : "College - Oklahoma State; Colorado; West Texas A&M",\r
+       TEAM_LOGO : "./images/nba_knics.jpg"\r
+}, {\r
+       NAME : "Ellington, Wayne",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - North Carolina",\r
+       TEAM_LOGO : "./images/nba_nuggets.jpg"\r
+}, {\r
+       NAME : "Elliott, Robert Alan (Bob)",\r
+       ACTIVE : "1978 - 1980",\r
+       FROM : "College - Arizona",\r
+       TEAM_LOGO : "./images/nba_raptors.jpg"\r
+}, {\r
+       NAME : "Elliott, Sean",\r
+       ACTIVE : "1989 - 2000",\r
+       FROM : "College - Arizona",\r
+       TEAM_LOGO : "./images/nba_lakers.jpg"\r
+}, {\r
+       NAME : "Ellis, Alexander (Boo)",\r
+       ACTIVE : "1958 - 1959",\r
+       FROM : "College - Niagara",\r
+       TEAM_LOGO : "./images/nba_clippers.jpg"\r
+}, {\r
+       NAME : "Ellis, Dale",\r
+       ACTIVE : "1983 - 1999",\r
+       FROM : "College - Tennessee",\r
+       TEAM_LOGO : "./images/nba_nets.jpg"\r
+}, {\r
+       NAME : "Ellis, Harold",\r
+       ACTIVE : "1993 - 1997",\r
+       FROM : "College - Morehouse",\r
+       TEAM_LOGO : "./images/nba_nuggets.jpg"\r
+}, {\r
+       NAME : "Ellis, Joe",\r
+       ACTIVE : "1966 - 1973",\r
+       FROM : "College - San Francisco",\r
+       TEAM_LOGO : "./images/nba_wizards.jpg"\r
+}, {\r
+       NAME : "Ellis, LaPhonso",\r
+       ACTIVE : "1992 - 2002",\r
+       FROM : "College - Notre Dame ''92",\r
+       TEAM_LOGO : "./images/nba_timberwolves.jpg"\r
+}, {\r
+       NAME : "Ellis, LeRon",\r
+       ACTIVE : "1991 - 1995",\r
+       FROM : "College - Kentucky; Syracuse",\r
+       TEAM_LOGO : "./images/nba_nuggets.jpg"\r
+}, {\r
+       NAME : "Ellis, Leroy",\r
+       ACTIVE : "1962 - 1975",\r
+       FROM : "College - St. John's (N.Y.)",\r
+       TEAM_LOGO : "./images/nba_clippers.jpg"\r
+}, {\r
+       NAME : "Ellis, Maurice H. (Bo)",\r
+       ACTIVE : "1977 - 1979",\r
+       FROM : "College - Marquette",\r
+       TEAM_LOGO : "./images/nba_celtics.jpg"\r
+}, {\r
+       NAME : "Ellis, Monta",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "High School - Lanier HS (Jackson, MS)",\r
+       TEAM_LOGO : "./images/nba_lakers.jpg"\r
+}, {\r
+       NAME : "Ellison, Pervis",\r
+       ACTIVE : "1989 - 2000",\r
+       FROM : "College - Louisville",\r
+       TEAM_LOGO : "./images/nba_pacers.jpg"\r
+}, {\r
+       NAME : "Elmore, Len",\r
+       ACTIVE : "1976 - 1983",\r
+       FROM : "College - Maryland",\r
+       TEAM_LOGO : "./images/nba_bulls.jpg"\r
+}, {\r
+       NAME : "Elson, Francisco",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - California",\r
+       TEAM_LOGO : "./images/nba_kings.jpg"\r
+}, {\r
+       NAME : "Fabel, Joseph (Joe)",\r
+       ACTIVE : "1946 - 1946",\r
+       FROM : "College - Pittsburgh",\r
+       TEAM_LOGO : "./images/nba_knics.jpg"\r
+}, {\r
+       NAME : "Fairchild, John Russell",\r
+       ACTIVE : "1965 - 1965",\r
+       FROM : "College - Palomar Coll. CA (J.C.); Brigham Young",\r
+       TEAM_LOGO : "./images/nba_trail.jpg"\r
+}, {\r
+       NAME : "Farbman, Philip M. (Phil)",\r
+       ACTIVE : "1948 - 1948",\r
+       FROM : "College - CCNY; Brooklyn College",\r
+       TEAM_LOGO : "./images/nba_pacers.jpg"\r
+}, {\r
+       NAME : "Farley, Richard L. (Dick)",\r
+       ACTIVE : "1954 - 1958",\r
+       FROM : "College - Indiana",\r
+       TEAM_LOGO : "./images/nba_pacers.jpg"\r
+}, {\r
+       NAME : "Farmar, Jordan",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - UCLA",\r
+       TEAM_LOGO : "./images/nba_raptors.jpg"\r
+}, {\r
+       NAME : "Farmer, Desmon",\r
+       ACTIVE : "2006 - 2008",\r
+       FROM : "College - USC",\r
+       TEAM_LOGO : "./images/nba_sonics.jpg"\r
+}, {\r
+       NAME : "Farmer, Don Michael (Mike)",\r
+       ACTIVE : "1958 - 1965",\r
+       FROM : "College - San Francisco",\r
+       TEAM_LOGO : "./images/nba_heats.jpg"\r
+}, {\r
+       NAME : "Farmer, Jim",\r
+       ACTIVE : "1987 - 1993",\r
+       FROM : "College - Alabama",\r
+       TEAM_LOGO : "./images/nba_warriors.jpg"\r
+}, {\r
+       NAME : "Farmer, Tony",\r
+       ACTIVE : "1997 - 1999",\r
+       FROM : "College - Nebraska",\r
+       TEAM_LOGO : "./images/nba_honets.jpg"\r
+}, {\r
+       NAME : "Faught, Robert Edward (Bob)",\r
+       ACTIVE : "1946 - 1946",\r
+       FROM : "College - Notre Dame",\r
+       TEAM_LOGO : "./images/nba_sonics.jpg"\r
+}, {\r
+       NAME : "Favors, Derrick",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Georgia Tech",\r
+       TEAM_LOGO : "./images/nba_sonics.jpg"\r
+}, {\r
+       NAME : "Fazekas, Nick",\r
+       ACTIVE : "2007 - 2007",\r
+       FROM : "College - Nevada-Reno",\r
+       TEAM_LOGO : "./images/nba_raptors.jpg"\r
+}, {\r
+       NAME : "Fedor, Samuel David (Dave)",\r
+       ACTIVE : "1962 - 1962",\r
+       FROM : "College - Florida State",\r
+       TEAM_LOGO : "./images/nba_clippers.jpg"\r
+}, {\r
+       NAME : "Feerick, Robert Joseph (Bob)",\r
+       ACTIVE : "1946 - 1949",\r
+       FROM : "College - Santa Clara",\r
+       TEAM_LOGO : "./images/nba_pistons.jpg"\r
+}, {\r
+       NAME : "Feher, Raymond G. (Butch)",\r
+       ACTIVE : "1976 - 1976",\r
+       FROM : "College - Vanderbilt",\r
+       TEAM_LOGO : "./images/nba_nets.jpg"\r
+}, {\r
+       NAME : "Feick, Jamie",\r
+       ACTIVE : "1996 - 2000",\r
+       FROM : "College - Michigan State ''96",\r
+       TEAM_LOGO : "./images/nba_rockets.jpg"\r
+}, {\r
+       NAME : "Feiereisel, Ronald E. (Ron)",\r
+       ACTIVE : "1955 - 1955",\r
+       FROM : "College - DePaul",\r
+       TEAM_LOGO : "./images/nba_timberwolves.jpg"\r
+}, {\r
+       NAME : "Feigenbaum, George",\r
+       ACTIVE : "1949 - 1952",\r
+       FROM : "College - Long Island University; Kentucky",\r
+       TEAM_LOGO : "./images/nba_76ers.jpg"\r
+}, {\r
+       NAME : "Feitl, Dave",\r
+       ACTIVE : "1986 - 1991",\r
+       FROM : "College - Texas-El Paso",\r
+       TEAM_LOGO : "./images/nba_cavaliers.jpg"\r
+}, {\r
+       NAME : "Felix, Noel",\r
+       ACTIVE : "2005 - 2005",\r
+       FROM : "College - Fresno State",\r
+       TEAM_LOGO : "./images/nba_hawks.jpg"\r
+}, {\r
+       NAME : "Felix, Ray",\r
+       ACTIVE : "1953 - 1961",\r
+       FROM : "College - Long Island University",\r
+       TEAM_LOGO : "./images/nba_clippers.jpg"\r
+}, {\r
+       NAME : "Felton, Raymond",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - North Carolina",\r
+       TEAM_LOGO : "./images/nba_kings.jpg"\r
+}, {\r
+       NAME : "Fendley, John Phillip (Jake)",\r
+       ACTIVE : "1951 - 1952",\r
+       FROM : "College - Northwestern",\r
+       TEAM_LOGO : "./images/nba_spurs.jpg"\r
+}, {\r
+       NAME : "Fenley, William Warren (Bill)",\r
+       ACTIVE : "1946 - 1946",\r
+       FROM : "College - Manhattan",\r
+       TEAM_LOGO : "./images/nba_bobcats.jpg"\r
+}, {\r
+       NAME : "Ferguson, Desmond",\r
+       ACTIVE : "2003 - 2003",\r
+       FROM : "College - Detroit",\r
+       TEAM_LOGO : "./images/nba_jazz.jpg"\r
+}, {\r
+       NAME : "Fernandez, Rudy",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "From - Palma de Mallorca, Spain",\r
+       TEAM_LOGO : "./images/nba_spurs.jpg"\r
+}, {\r
+       NAME : "Fernsten, Eric",\r
+       ACTIVE : "1975 - 1983",\r
+       FROM : "College - San Francisco",\r
+       TEAM_LOGO : "./images/nba_spurs.jpg"\r
+}, {\r
+       NAME : "Ferrari, Albert R. (Al)",\r
+       ACTIVE : "1955 - 1962",\r
+       FROM : "College - Michigan State",\r
+       TEAM_LOGO : "./images/nba_jazz.jpg"\r
+}, {\r
+       NAME : "Ferreira, Rolando",\r
+       ACTIVE : "1988 - 1988",\r
+       FROM : "College - Houston",\r
+       TEAM_LOGO : "./images/nba_jazz.jpg"\r
+}, {\r
+       NAME : "Ferrell, Duane",\r
+       ACTIVE : "1988 - 1998",\r
+       FROM : "College - Georgia Tech",\r
+       TEAM_LOGO : "./images/nba_cavaliers.jpg"\r
+}, {\r
+       NAME : "Ferrin, C. Arnold Jr. (Arnie)",\r
+       ACTIVE : "1948 - 1950",\r
+       FROM : "College - Utah",\r
+       TEAM_LOGO : "./images/nba_nets.jpg"\r
+}, {\r
+       NAME : "Ferry, Danny",\r
+       ACTIVE : "1990 - 2002",\r
+       FROM : "College - Duke ''89",\r
+       TEAM_LOGO : "./images/nba_raptors.jpg"\r
+}, {\r
+       NAME : "Ferry, Robert Dean (Bob)",\r
+       ACTIVE : "1959 - 1968",\r
+       FROM : "College - St. Louis",\r
+       TEAM_LOGO : "./images/nba_nuggets.jpg"\r
+}, {\r
+       NAME : "Fesenko, Kyrylo",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "From - Dnepropetrovsk, Ukraine",\r
+       TEAM_LOGO : "./images/nba_warriors.jpg"\r
+}, {\r
+       NAME : "Fields, Kenny",\r
+       ACTIVE : "1984 - 1987",\r
+       FROM : "College - UCLA",\r
+       TEAM_LOGO : "./images/nba_pacers.jpg"\r
+}, {\r
+       NAME : "Fields, Landry",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Stanford",\r
+       TEAM_LOGO : "./images/nba_knics.jpg"\r
+}, {\r
+       NAME : "Filipek, Ronald Stanley (Ron)",\r
+       ACTIVE : "1967 - 1967",\r
+       FROM : "College - Tennessee Tech",\r
+       TEAM_LOGO : "./images/nba_suns.jpg"\r
+}, {\r
+       NAME : "Fillmore, Gregory Paul (Greg)",\r
+       ACTIVE : "1970 - 1971",\r
+       FROM : "College - Iowa Central CC; Cheyney",\r
+       TEAM_LOGO : "./images/nba_bulls.jpg"\r
+}, {\r
+       NAME : "Finkel, Henry J. (Hank)",\r
+       ACTIVE : "1966 - 1974",\r
+       FROM : "College - St. Peter's; Dayton",\r
+       TEAM_LOGO : "./images/nba_celtics.jpg"\r
+}, {\r
+       NAME : "Finley, Michael",\r
+       ACTIVE : "2007 - 2009",\r
+       FROM : "College - Wisconsin",\r
+       TEAM_LOGO : "./images/nba_pistons.jpg"\r
+}, {\r
+       NAME : "Finn, Daniel Lawrence Jr. (Danny)",\r
+       ACTIVE : "1952 - 1954",\r
+       FROM : "College - St. John's (N.Y.)",\r
+       TEAM_LOGO : "./images/nba_knics.jpg"\r
+}, {\r
+       NAME : "Fish, Matt",\r
+       ACTIVE : "1994 - 1996",\r
+       FROM : "College - Wilmington",\r
+       TEAM_LOGO : "./images/nba_nets.jpg"\r
+}, {\r
+       NAME : "Fisher, Derek",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Arkansas-Little Rock",\r
+       TEAM_LOGO : "./images/nba_honets.jpg"\r
+}, {\r
+       NAME : "Fitch, Gerald",\r
+       ACTIVE : "2005 - 2005",\r
+       FROM : "College - Kentucky",\r
+       TEAM_LOGO : "./images/nba_raptors.jpg"\r
+}, {\r
+       NAME : "Fitzgerald, Richard (Dick)",\r
+       ACTIVE : "1946 - 1947",\r
+       FROM : "College - Seton Hall",\r
+       TEAM_LOGO : "./images/nba_knics.jpg"\r
+}, {\r
+       NAME : "Fitzgerald, Robert (Bob)",\r
+       ACTIVE : "1946 - 1948",\r
+       FROM : "College - Fordham",\r
+       TEAM_LOGO : "./images/nba_clippers.jpg"\r
+}, {\r
+       NAME : "Fizer, Marcus",\r
+       ACTIVE : "2000 - 2005",\r
+       FROM : "College - Iowa State",\r
+       TEAM_LOGO : "./images/nba_pacers.jpg"\r
+}, {\r
+       NAME : "Fleishman, Jerome (Jerry)",\r
+       ACTIVE : "1946 - 1952",\r
+       FROM : "College - N.Y.U.; Long Island University",\r
+       TEAM_LOGO : "./images/nba_celtics.jpg"\r
+}, {\r
+       NAME : "Fleming, Albert Jr. (Al)",\r
+       ACTIVE : "1977 - 1977",\r
+       FROM : "College - Arizona",\r
+       TEAM_LOGO : "./images/nba_heats.jpg"\r
+}, {\r
+       NAME : "Fleming, Edward R. (Ed)",\r
+       ACTIVE : "1955 - 1959",\r
+       FROM : "College - Niagara",\r
+       TEAM_LOGO : "./images/nba_timberwolves.jpg"\r
+}, {\r
+       NAME : "Gabor, William A. (Billy, The Human Projectile)",\r
+       ACTIVE : "1949 - 1954",\r
+       FROM : "College - Syracuse",\r
+       TEAM_LOGO : "./images/nba_cavaliers.jpg"\r
+}, {\r
+       NAME : "Gadzuric, Dan",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - UCLA",\r
+       TEAM_LOGO : "./images/nba_pistons.jpg"\r
+}, {\r
+       NAME : "Gai, Deng",\r
+       ACTIVE : "2005 - 2005",\r
+       FROM : "College - Fairfield",\r
+       TEAM_LOGO : "./images/nba_cavaliers.jpg"\r
+}, {\r
+       NAME : "Gainer, Elmer R.",\r
+       ACTIVE : "1947 - 1949",\r
+       FROM : "College - DePaul",\r
+       TEAM_LOGO : "./images/nba_pacers.jpg"\r
+}, {\r
+       NAME : "Gaines, Corey",\r
+       ACTIVE : "1988 - 1994",\r
+       FROM : "College - UCLA; Loyola Marymount",\r
+       TEAM_LOGO : "./images/nba_honets.jpg"\r
+}, {\r
+       NAME : "Gaines, Reece",\r
+       ACTIVE : "2003 - 2005",\r
+       FROM : "College - Louisville",\r
+       TEAM_LOGO : "./images/nba_bulls.jpg"\r
+}, {\r
+       NAME : "Gaines, Sundiata",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Georgia",\r
+       TEAM_LOGO : "./images/nba_bucks.jpg"\r
+}, {\r
+       NAME : "Gale, Mike",\r
+       ACTIVE : "1976 - 1981",\r
+       FROM : "College - Elizabeth City State",\r
+       TEAM_LOGO : "./images/nba_76ers.jpg"\r
+}, {\r
+       NAME : "Gallagher, Chad",\r
+       ACTIVE : "1993 - 1993",\r
+       FROM : "College - Creighton",\r
+       TEAM_LOGO : "./images/nba_nets.jpg"\r
+}, {\r
+       NAME : "Gallatin, Harry",\r
+       ACTIVE : "1948 - 1957",\r
+       FROM : "College - Northeast Missouri State",\r
+       TEAM_LOGO : "./images/nba_timberwolves.jpg"\r
+}, {\r
+       NAME : "Gallinari, Danilo",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "From - Milan, Italy",\r
+       TEAM_LOGO : "./images/nba_warriors.jpg"\r
+}, {\r
+       NAME : "Gambee, Dave",\r
+       ACTIVE : "1958 - 1969",\r
+       FROM : "College - Oregon State",\r
+       TEAM_LOGO : "./images/nba_honets.jpg"\r
+}, {\r
+       NAME : "Gamble, Kevin",\r
+       ACTIVE : "1987 - 1996",\r
+       FROM : "College - Lincoln Trail IL (J.C.); Iowa",\r
+       TEAM_LOGO : "./images/nba_bucks.jpg"\r
+}, {\r
+       NAME : "Gantt, Robert M. Jr. (Bob)",\r
+       ACTIVE : "1946 - 1946",\r
+       FROM : "College - Duke",\r
+       TEAM_LOGO : "./images/nba_bulls.jpg"\r
+}, {\r
+       NAME : "Garbajosa, Jorge",\r
+       ACTIVE : "2007 - 2007",\r
+       FROM : "From - Spain",\r
+       TEAM_LOGO : "./images/nba_mavericks.jpg"\r
+}, {\r
+       NAME : "Garces, Ruben",\r
+       ACTIVE : "2000 - 2000",\r
+       FROM : "College - Providence",\r
+       TEAM_LOGO : "./images/nba_rockets.jpg"\r
+}, {\r
+       NAME : "Garcia, Alex",\r
+       ACTIVE : "2003 - 2004",\r
+       FROM : "From - Brazil",\r
+       TEAM_LOGO : "./images/nba_bulls.jpg"\r
+}, {\r
+       NAME : "Garcia, Francisco",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Louisville",\r
+       TEAM_LOGO : "./images/nba_mavericks.jpg"\r
+}, {\r
+       NAME : "Gardner, Earl Baker (Red)",\r
+       ACTIVE : "1948 - 1948",\r
+       FROM : "College - Wabash; DePauw",\r
+       TEAM_LOGO : "./images/nba_bulls.jpg"\r
+}, {\r
+       NAME : "Gardner, Thomas",\r
+       ACTIVE : "2007 - 2008",\r
+       FROM : "College - Missouri",\r
+       TEAM_LOGO : "./images/nba_bulls.jpg"\r
+}, {\r
+       NAME : "Gardner, Vern B.",\r
+       ACTIVE : "1949 - 1951",\r
+       FROM : "College - Wyoming; Utah",\r
+       TEAM_LOGO : "./images/nba_suns.jpg"\r
+}, {\r
+       NAME : "Garfinkel, Jack (Dutch)",\r
+       ACTIVE : "1946 - 1948",\r
+       FROM : "College - St. John's (N.Y.)",\r
+       TEAM_LOGO : "./images/nba_knics.jpg"\r
+}, {\r
+       NAME : "Garland, Gary J.",\r
+       ACTIVE : "1979 - 1979",\r
+       FROM : "College - DePaul",\r
+       TEAM_LOGO : "./images/nba_sonics.jpg"\r
+}, {\r
+       NAME : "Garland, Winston",\r
+       ACTIVE : "1987 - 1994",\r
+       FROM : "College - Southeastern CC IA; Southwest Missouri State",\r
+       TEAM_LOGO : "./images/nba_warriors.jpg"\r
+}, {\r
+       NAME : "Garmaker, Richard Eugene (Dick)",\r
+       ACTIVE : "1955 - 1960",\r
+       FROM : "College - Hibbing CC MN; Minnesota",\r
+       TEAM_LOGO : "./images/nba_cavaliers.jpg"\r
+}, {\r
+       NAME : "Garner, Chris",\r
+       ACTIVE : "1997 - 2000",\r
+       FROM : "College - Memphis",\r
+       TEAM_LOGO : "./images/nba_celtics.jpg"\r
+}, {\r
+       NAME : "Garnett, Bill",\r
+       ACTIVE : "1982 - 1985",\r
+       FROM : "College - Wyoming",\r
+       TEAM_LOGO : "./images/nba_lakers.jpg"\r
+}, {\r
+       NAME : "Garnett, Kevin",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "High School - Farragut Academy HS (IL)",\r
+       TEAM_LOGO : "./images/nba_warriors.jpg"\r
+}, {\r
+       NAME : "Garnett, Marlon",\r
+       ACTIVE : "1998 - 1998",\r
+       FROM : "College - Santa Clara",\r
+       TEAM_LOGO : "./images/nba_heats.jpg"\r
+}, {\r
+       NAME : "Garrett, Calvin",\r
+       ACTIVE : "1980 - 1983",\r
+       FROM : "College - Austin Peay State; Oral Roberts",\r
+       TEAM_LOGO : "./images/nba_rockets.jpg"\r
+}, {\r
+       NAME : "Garrett, Dean",\r
+       ACTIVE : "1996 - 2001",\r
+       FROM : "College - Indiana",\r
+       TEAM_LOGO : "./images/nba_kings.jpg"\r
+}, {\r
+       NAME : "Garrett, Eldo (Dick)",\r
+       ACTIVE : "1969 - 1973",\r
+       FROM : "College - Southern Illinois",\r
+       TEAM_LOGO : "./images/nba_cavaliers.jpg"\r
+}, {\r
+       NAME : "Garrett, Rowland G.",\r
+       ACTIVE : "1972 - 1976",\r
+       FROM : "College - Florida State",\r
+       TEAM_LOGO : "./images/nba_hawks.jpg"\r
+}, {\r
+       NAME : "Garrick, Tom",\r
+       ACTIVE : "1988 - 1991",\r
+       FROM : "College - Rhode Island",\r
+       TEAM_LOGO : "./images/nba_bucks.jpg"\r
+}, {\r
+       NAME : "Garris, John",\r
+       ACTIVE : "1983 - 1983",\r
+       FROM : "College - Michigan; Boston College",\r
+       TEAM_LOGO : "./images/nba_griz.jpg"\r
+}, {\r
+       NAME : "Garris, Kiwane",\r
+       ACTIVE : "1997 - 1999",\r
+       FROM : "College - Illinois",\r
+       TEAM_LOGO : "./images/nba_celtics.jpg"\r
+}, {\r
+       NAME : "Garrity, Pat",\r
+       ACTIVE : "2007 - 2007",\r
+       FROM : "College - Notre Dame",\r
+       TEAM_LOGO : "./images/nba_warriors.jpg"\r
+}, {\r
+       NAME : "Garvin, James D. (Jim)",\r
+       ACTIVE : "1973 - 1973",\r
+       FROM : "College - Boston U.",\r
+       TEAM_LOGO : "./images/nba_suns.jpg"\r
+}, {\r
+       NAME : "Gasol, Marc",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "From - Barcelona, Spain",\r
+       TEAM_LOGO : "./images/nba_bucks.jpg"\r
+}, {\r
+       NAME : "Gasol, Pau",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "From - Barcelona, Spain",\r
+       TEAM_LOGO : "./images/nba_suns.jpg"\r
+}, {\r
+       NAME : "Gates, Ben Frank (Frank, Needle)",\r
+       ACTIVE : "1949 - 1949",\r
+       FROM : "College - Sam Houston State",\r
+       TEAM_LOGO : "./images/nba_wizards.jpg"\r
+}, {\r
+       NAME : "Gatling, Chris",\r
+       ACTIVE : "1991 - 2001",\r
+       FROM : "College - Pittsburgh; Old Dominion",\r
+       TEAM_LOGO : "./images/nba_warriors.jpg"\r
+}, {\r
+       NAME : "Gattison, Kenny",\r
+       ACTIVE : "1986 - 1995",\r
+       FROM : "College - Old Dominion",\r
+       TEAM_LOGO : "./images/nba_wizards.jpg"\r
+}, {\r
+       NAME : "Gay, Rudy",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Connecticut",\r
+       TEAM_LOGO : "./images/nba_bobcats.jpg"\r
+}, {\r
+       NAME : "Gayda, Edward C. (Ed)",\r
+       ACTIVE : "1950 - 1950",\r
+       FROM : "College - Washington State",\r
+       TEAM_LOGO : "./images/nba_mavericks.jpg"\r
+}, {\r
+       NAME : "Gaze, Andrew",\r
+       ACTIVE : "1993 - 1998",\r
+       FROM : "College - Seton Hall",\r
+       TEAM_LOGO : "./images/nba_warriors.jpg"\r
+}, {\r
+       NAME : "Geary, Reggie",\r
+       ACTIVE : "1996 - 1997",\r
+       FROM : "College - Arizona",\r
+       TEAM_LOGO : "./images/nba_heats.jpg"\r
+}, {\r
+       NAME : "Gee, Alonzo",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Alabama",\r
+       TEAM_LOGO : "./images/nba_nuggets.jpg"\r
+}, {\r
+       NAME : "Geiger, Matt",\r
+       ACTIVE : "1992 - 2001",\r
+       FROM : "College - Auburn; Georgia Tech",\r
+       TEAM_LOGO : "./images/nba_bucks.jpg"\r
+}, {\r
+       NAME : "Gelabale, Mickael",\r
+       ACTIVE : "2007 - 2007",\r
+       FROM : "From - France",\r
+       TEAM_LOGO : "./images/nba_rockets.jpg"\r
+}, {\r
+       NAME : "Hackett, Rudolph (Rudy)",\r
+       ACTIVE : "1976 - 1976",\r
+       FROM : "College - Syracuse",\r
+       TEAM_LOGO : "./images/nba_jazz.jpg"\r
+}, {\r
+       NAME : "Haddadi, Hamed",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "From - Ahvaz, Iran",\r
+       TEAM_LOGO : "./images/nba_cavaliers.jpg"\r
+}, {\r
+       NAME : "Haffner, Scott",\r
+       ACTIVE : "1989 - 1990",\r
+       FROM : "College - Illinois; Evansville",\r
+       TEAM_LOGO : "./images/nba_heats.jpg"\r
+}, {\r
+       NAME : "Hagan, Cliff",\r
+       ACTIVE : "1956 - 1965",\r
+       FROM : "College - Kentucky",\r
+       TEAM_LOGO : "./images/nba_cavaliers.jpg"\r
+}, {\r
+       NAME : "Hagan, Glenn Kassabin",\r
+       ACTIVE : "1981 - 1981",\r
+       FROM : "College - St. Bonaventure",\r
+       TEAM_LOGO : "./images/nba_pistons.jpg"\r
+}, {\r
+       NAME : "Hahn, Robert B. (Bob)",\r
+       ACTIVE : "1949 - 1949",\r
+       FROM : "College - North Carolina State",\r
+       TEAM_LOGO : "./images/nba_cavaliers.jpg"\r
+}, {\r
+       NAME : "Hairston, Alan Leroy (Al)",\r
+       ACTIVE : "1968 - 1969",\r
+       FROM : "College - St. Clair Co. CC MI; Bowling Green State",\r
+       TEAM_LOGO : "./images/nba_timberwolves.jpg"\r
+}, {\r
+       NAME : "Hairston, Happy",\r
+       ACTIVE : "1964 - 1974",\r
+       FROM : "College - N.Y.U.",\r
+       TEAM_LOGO : "./images/nba_magics.jpg"\r
+}, {\r
+       NAME : "Hairston, Lindsay (Spider)",\r
+       ACTIVE : "1975 - 1975",\r
+       FROM : "College - Michigan State",\r
+       TEAM_LOGO : "./images/nba_pistons.jpg"\r
+}, {\r
+       NAME : "Hairston, Malik",\r
+       ACTIVE : "2008 - 2009",\r
+       FROM : "College - Oregon",\r
+       TEAM_LOGO : "./images/nba_wizards.jpg"\r
+}, {\r
+       NAME : "Haislip, Marcus",\r
+       ACTIVE : "2002 - 2009",\r
+       FROM : "College - Tennessee",\r
+       TEAM_LOGO : "./images/nba_pistons.jpg"\r
+}, {\r
+       NAME : "Halbert, Charles P. (Chuck)",\r
+       ACTIVE : "1946 - 1950",\r
+       FROM : "College - West Texas A&M",\r
+       TEAM_LOGO : "./images/nba_bucks.jpg"\r
+}, {\r
+       NAME : "Halbrook, Harvey Wade (Swede)",\r
+       ACTIVE : "1960 - 1961",\r
+       FROM : "College - Oregon State",\r
+       TEAM_LOGO : "./images/nba_pacers.jpg"\r
+}, {\r
+       NAME : "Hale, William Bruce (Bruce)",\r
+       ACTIVE : "1948 - 1950",\r
+       FROM : "College - Santa Clara",\r
+       TEAM_LOGO : "./images/nba_bulls.jpg"\r
+}, {\r
+       NAME : "Haley, Jack",\r
+       ACTIVE : "1988 - 1997",\r
+       FROM : "College - Golden West Coll. CA (J.C.); UCLA",\r
+       TEAM_LOGO : "./images/nba_jazz.jpg"\r
+}, {\r
+       NAME : "Halimon, Shaler Jr.",\r
+       ACTIVE : "1968 - 1971",\r
+       FROM : "College - Imperial Valley Coll. CA (J.C.); Utah State",\r
+       TEAM_LOGO : "./images/nba_timberwolves.jpg"\r
+}, {\r
+       NAME : "Hall, Mike",\r
+       ACTIVE : "2006 - 2006",\r
+       FROM : "College - George Washington",\r
+       TEAM_LOGO : "./images/nba_hawks.jpg"\r
+}, {\r
+       NAME : "Halliburton, Jeffrey (Jeff)",\r
+       ACTIVE : "1971 - 1972",\r
+       FROM : "College - San Jacinto Coll. TX (J.C.); Drake",\r
+       TEAM_LOGO : "./images/nba_spurs.jpg"\r
+}, {\r
+       NAME : "Ham, Darvin",\r
+       ACTIVE : "1996 - 2004",\r
+       FROM : "College - Texas Tech",\r
+       TEAM_LOGO : "./images/nba_clippers.jpg"\r
+}, {\r
+       NAME : "Hamer, Steve",\r
+       ACTIVE : "1996 - 1996",\r
+       FROM : "College - Tennessee",\r
+       TEAM_LOGO : "./images/nba_kings.jpg"\r
+}, {\r
+       NAME : "Hamilton, Dale B.",\r
+       ACTIVE : "1949 - 1949",\r
+       FROM : "College - Franklin (Ind.)",\r
+       TEAM_LOGO : "./images/nba_jazz.jpg"\r
+}, {\r
+       NAME : "Hamilton, Dennis Eugene",\r
+       ACTIVE : "1967 - 1968",\r
+       FROM : "College - Arizona State",\r
+       TEAM_LOGO : "./images/nba_pistons.jpg"\r
+}, {\r
+       NAME : "Hamilton, Ralph Albert (Ham)",\r
+       ACTIVE : "1948 - 1948",\r
+       FROM : "College - Indiana",\r
+       TEAM_LOGO : "./images/nba_bobcats.jpg"\r
+}, {\r
+       NAME : "Hamilton, Richard",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Connecticut",\r
+       TEAM_LOGO : "./images/nba_bulls.jpg"\r
+}, {\r
+       NAME : "Hamilton, Roy Lee",\r
+       ACTIVE : "1979 - 1980",\r
+       FROM : "College - UCLA",\r
+       TEAM_LOGO : "./images/nba_timberwolves.jpg"\r
+}, {\r
+       NAME : "Hamilton, Steve Absher",\r
+       ACTIVE : "1958 - 1959",\r
+       FROM : "College - Purdue; Morehead State",\r
+       TEAM_LOGO : "./images/nba_magics.jpg"\r
+}, {\r
+       NAME : "Hamilton, Tang",\r
+       ACTIVE : "2001 - 2001",\r
+       FROM : "College - Mississippi State ''01",\r
+       TEAM_LOGO : "./images/nba_mavericks.jpg"\r
+}, {\r
+       NAME : "Hamilton, Thomas",\r
+       ACTIVE : "1995 - 1999",\r
+       FROM : "College - No College",\r
+       TEAM_LOGO : "./images/nba_wizards.jpg"\r
+}, {\r
+       NAME : "Hamilton, Zendon",\r
+       ACTIVE : "2000 - 2005",\r
+       FROM : "College - St. John's",\r
+       TEAM_LOGO : "./images/nba_bobcats.jpg"\r
+}, {\r
+       NAME : "Hammink, Geert",\r
+       ACTIVE : "1993 - 1995",\r
+       FROM : "College - Louisiana State",\r
+       TEAM_LOGO : "./images/nba_bucks.jpg"\r
+}, {\r
+       NAME : "Hammonds, Tom",\r
+       ACTIVE : "1989 - 2000",\r
+       FROM : "College - Georgia Tech",\r
+       TEAM_LOGO : "./images/nba_bobcats.jpg"\r
+}, {\r
+       NAME : "Hancock, Darrin",\r
+       ACTIVE : "1994 - 1996",\r
+       FROM : "College - Garden City CC KS; Kansas",\r
+       TEAM_LOGO : "./images/nba_suns.jpg"\r
+}, {\r
+       NAME : "Handlogten, Ben",\r
+       ACTIVE : "2003 - 2004",\r
+       FROM : "College - Western Michigan",\r
+       TEAM_LOGO : "./images/nba_honets.jpg"\r
+}, {\r
+       NAME : "Hankins, Cecil O.",\r
+       ACTIVE : "1946 - 1947",\r
+       FROM : "College - Oklahoma State",\r
+       TEAM_LOGO : "./images/nba_trail.jpg"\r
+}, {\r
+       NAME : "Hankinson, Phil",\r
+       ACTIVE : "1973 - 1974",\r
+       FROM : "College - Pennsylvania",\r
+       TEAM_LOGO : "./images/nba_sonics.jpg"\r
+}, {\r
+       NAME : "Hannum, Alexander Murray (Alex)",\r
+       ACTIVE : "1949 - 1956",\r
+       FROM : "College - USC",\r
+       TEAM_LOGO : "./images/nba_heats.jpg"\r
+}, {\r
+       NAME : "Hanrahan, Donald (Don)",\r
+       ACTIVE : "1952 - 1952",\r
+       FROM : "College - Loyola (Chicago)",\r
+       TEAM_LOGO : "./images/nba_bobcats.jpg"\r
+}, {\r
+       NAME : "Hans, Rollen F. (Rolly)",\r
+       ACTIVE : "1953 - 1954",\r
+       FROM : "College - Los Angeles City Coll. CA (J.C.); Long Island University",\r
+       TEAM_LOGO : "./images/nba_wizards.jpg"\r
+}, {\r
+       NAME : "Hansbrough, Tyler",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - North Carolina",\r
+       TEAM_LOGO : "./images/nba_pistons.jpg"\r
+}, {\r
+       NAME : "Hansen, Bob",\r
+       ACTIVE : "1983 - 1991",\r
+       FROM : "College - Iowa",\r
+       TEAM_LOGO : "./images/nba_honets.jpg"\r
+}, {\r
+       NAME : "Hansen, Glenn R.",\r
+       ACTIVE : "1975 - 1977",\r
+       FROM : "College - Utah State; Louisiana State",\r
+       TEAM_LOGO : "./images/nba_griz.jpg"\r
+}, {\r
+       NAME : "Hansen, Lars",\r
+       ACTIVE : "1978 - 1978",\r
+       FROM : "College - Washington",\r
+       TEAM_LOGO : "./images/nba_nets.jpg"\r
+}, {\r
+       NAME : "Hansen, Travis",\r
+       ACTIVE : "2003 - 2003",\r
+       FROM : "College - Brigham Young",\r
+       TEAM_LOGO : "./images/nba_suns.jpg"\r
+}, {\r
+       NAME : "Hanson, Reggie",\r
+       ACTIVE : "1997 - 1997",\r
+       FROM : "College - Kentucky",\r
+       TEAM_LOGO : "./images/nba_cavaliers.jpg"\r
+}, {\r
+       NAME : "Hanzlik, Bill",\r
+       ACTIVE : "1980 - 1989",\r
+       FROM : "College - Notre Dame",\r
+       TEAM_LOGO : "./images/nba_celtics.jpg"\r
+}, {\r
+       NAME : "Harangody, Luke",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Notre Dame",\r
+       TEAM_LOGO : "./images/nba_timberwolves.jpg"\r
+}, {\r
+       NAME : "Hardaway, Anfernee",\r
+       ACTIVE : "2007 - 2007",\r
+       FROM : "College - Memphis",\r
+       TEAM_LOGO : "./images/nba_76ers.jpg"\r
+}, {\r
+       NAME : "Hardaway, Tim",\r
+       ACTIVE : "1989 - 2002",\r
+       FROM : "College - Texas-El Paso ''89",\r
+       TEAM_LOGO : "./images/nba_suns.jpg"\r
+}, {\r
+       NAME : "Harden, James",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Arizona State",\r
+       TEAM_LOGO : "./images/nba_jazz.jpg"\r
+}, {\r
+       NAME : "Harding, Reginald (Reggie)",\r
+       ACTIVE : "1963 - 1967",\r
+       FROM : "College - No College",\r
+       TEAM_LOGO : "./images/nba_sonics.jpg"\r
+}, {\r
+       NAME : "Iavaroni, Marc",\r
+       ACTIVE : "1982 - 1988",\r
+       FROM : "College - Virginia",\r
+       TEAM_LOGO : "./images/nba_suns.jpg"\r
+}, {\r
+       NAME : "Ibaka, Serge",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "From - Brazzaville, Republic of Congo",\r
+       TEAM_LOGO : "./images/nba_honets.jpg"\r
+}, {\r
+       NAME : "Iguodala, Andre",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Arizona",\r
+       TEAM_LOGO : "./images/nba_nets.jpg"\r
+}, {\r
+       NAME : "Ilgauskas, Zydrunas",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "From - Kaunas, Lithuania",\r
+       TEAM_LOGO : "./images/nba_nets.jpg"\r
+}, {\r
+       NAME : "Ilic, Mile",\r
+       ACTIVE : "2006 - 2006",\r
+       FROM : "From - Serbia & Montenegro",\r
+       TEAM_LOGO : "./images/nba_hawks.jpg"\r
+}, {\r
+       NAME : "Ilunga-Mbenga, Didier",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "From - Kinshasa, DRC",\r
+       TEAM_LOGO : "./images/nba_clippers.jpg"\r
+}, {\r
+       NAME : "Ilyasova, Ersan",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "From - Eskisehir, Turkey",\r
+       TEAM_LOGO : "./images/nba_rockets.jpg"\r
+}, {\r
+       NAME : "Imhoff, Darrall Tucker (Big D)",\r
+       ACTIVE : "1960 - 1971",\r
+       FROM : "College - California",\r
+       TEAM_LOGO : "./images/nba_sonics.jpg"\r
+}, {\r
+       NAME : "Ingelsby, Tom",\r
+       ACTIVE : "1973 - 1973",\r
+       FROM : "College - Villanova",\r
+       TEAM_LOGO : "./images/nba_honets.jpg"\r
+}, {\r
+       NAME : "Ingram, Joel McCoy (McCoy)",\r
+       ACTIVE : "1957 - 1957",\r
+       FROM : "College - Jackson State",\r
+       TEAM_LOGO : "./images/nba_cavaliers.jpg"\r
+}, {\r
+       NAME : "Irvin, Byron",\r
+       ACTIVE : "1989 - 1992",\r
+       FROM : "College - Arkansas; Missouri",\r
+       TEAM_LOGO : "./images/nba_nets.jpg"\r
+}, {\r
+       NAME : "Issel, Dan",\r
+       ACTIVE : "1976 - 1984",\r
+       FROM : "College - Kentucky",\r
+       TEAM_LOGO : "./images/nba_knics.jpg"\r
+}, {\r
+       NAME : "Iuzzolino, Mike",\r
+       ACTIVE : "1991 - 1992",\r
+       FROM : "College - Penn State; St. Francis (PA)",\r
+       TEAM_LOGO : "./images/nba_heats.jpg"\r
+}, {\r
+       NAME : "Iverson, Allen",\r
+       ACTIVE : "2007 - 2009",\r
+       FROM : "College - Georgetown",\r
+       TEAM_LOGO : "./images/nba_knics.jpg"\r
+}, {\r
+       NAME : "Ivey, Royal",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Texas",\r
+       TEAM_LOGO : "./images/nba_jazz.jpg"\r
+}, {\r
+       NAME : "Jack, Jarrett",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Georgia Tech",\r
+       TEAM_LOGO : "./images/nba_bobcats.jpg"\r
+}, {\r
+       NAME : "Jackson, Alvin (Al)",\r
+       ACTIVE : "1967 - 1967",\r
+       FROM : "College - Wilberforce",\r
+       TEAM_LOGO : "./images/nba_trail.jpg"\r
+}, {\r
+       NAME : "Jackson, Anthony Eugene (Tony)",\r
+       ACTIVE : "1980 - 1980",\r
+       FROM : "College - Florida State",\r
+       TEAM_LOGO : "./images/nba_hawks.jpg"\r
+}, {\r
+       NAME : "Jackson, Bobby",\r
+       ACTIVE : "2007 - 2008",\r
+       FROM : "College - Minnesota",\r
+       TEAM_LOGO : "./images/nba_timberwolves.jpg"\r
+}, {\r
+       NAME : "Jackson, Cedric",\r
+       ACTIVE : "2009 - 2009",\r
+       FROM : "College - Cleveland State",\r
+       TEAM_LOGO : "./images/nba_lakers.jpg"\r
+}, {\r
+       NAME : "Jackson, Darnell",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Kansas",\r
+       TEAM_LOGO : "./images/nba_warriors.jpg"\r
+}, {\r
+       NAME : "Jackson, Gregory (Greg)",\r
+       ACTIVE : "1974 - 1974",\r
+       FROM : "College - Guilford",\r
+       TEAM_LOGO : "./images/nba_pacers.jpg"\r
+}, {\r
+       NAME : "Jackson, Jaren",\r
+       ACTIVE : "1989 - 2001",\r
+       FROM : "College - Georgetown",\r
+       TEAM_LOGO : "./images/nba_heats.jpg"\r
+}, {\r
+       NAME : "Jackson, Jermaine",\r
+       ACTIVE : "1999 - 2005",\r
+       FROM : "College - Detroit",\r
+       TEAM_LOGO : "./images/nba_trail.jpg"\r
+}, {\r
+       NAME : "Jackson, Jim",\r
+       ACTIVE : "1992 - 2005",\r
+       FROM : "College - Ohio State",\r
+       TEAM_LOGO : "./images/nba_pacers.jpg"\r
+}, {\r
+       NAME : "Jackson, Lucious B. (Luke)",\r
+       ACTIVE : "1964 - 1971",\r
+       FROM : "College - Quincy; Texas Southern; Texas-Pan American",\r
+       TEAM_LOGO : "./images/nba_mavericks.jpg"\r
+}, {\r
+       NAME : "Jackson, Luke",\r
+       ACTIVE : "2007 - 2007",\r
+       FROM : "College - Oregon",\r
+       TEAM_LOGO : "./images/nba_cavaliers.jpg"\r
+}, {\r
+       NAME : "Jackson, Marc",\r
+       ACTIVE : "2000 - 2006",\r
+       FROM : "College - Temple",\r
+       TEAM_LOGO : "./images/nba_pacers.jpg"\r
+}, {\r
+       NAME : "Jackson, Mark",\r
+       ACTIVE : "1987 - 2003",\r
+       FROM : "College - St. John''s (N.Y.) '87",\r
+       TEAM_LOGO : "./images/nba_bucks.jpg"\r
+}, {\r
+       NAME : "Jackson, Michael",\r
+       ACTIVE : "1987 - 1989",\r
+       FROM : "College - Georgetown",\r
+       TEAM_LOGO : "./images/nba_pacers.jpg"\r
+}, {\r
+       NAME : "Jackson, Myron",\r
+       ACTIVE : "1986 - 1986",\r
+       FROM : "College - Arkansas-Little Rock",\r
+       TEAM_LOGO : "./images/nba_honets.jpg"\r
+}, {\r
+       NAME : "Jackson, Philip D. (Phil, Action)",\r
+       ACTIVE : "1967 - 1979",\r
+       FROM : "College - North Dakota",\r
+       TEAM_LOGO : "./images/nba_trail.jpg"\r
+}, {\r
+       NAME : "Jackson, Ralph A. III",\r
+       ACTIVE : "1984 - 1984",\r
+       FROM : "College - UCLA",\r
+       TEAM_LOGO : "./images/nba_nets.jpg"\r
+}, {\r
+       NAME : "Jackson, Randell",\r
+       ACTIVE : "1998 - 1999",\r
+       FROM : "College - Florida State",\r
+       TEAM_LOGO : "./images/nba_pacers.jpg"\r
+}, {\r
+       NAME : "Jackson, Stanley",\r
+       ACTIVE : "1993 - 1993",\r
+       FROM : "College - Alabama-Birmingham",\r
+       TEAM_LOGO : "./images/nba_griz.jpg"\r
+}, {\r
+       NAME : "Jackson, Stephen",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "High School - Oak Hill Academy (Mouth of Wilson, VA)",\r
+       TEAM_LOGO : "./images/nba_jazz.jpg"\r
+}, {\r
+       NAME : "Jackson, Tracy",\r
+       ACTIVE : "1981 - 1983",\r
+       FROM : "College - Notre Dame",\r
+       TEAM_LOGO : "./images/nba_jazz.jpg"\r
+}, {\r
+       NAME : "Jackson, Wardell",\r
+       ACTIVE : "1974 - 1974",\r
+       FROM : "College - Ohio State",\r
+       TEAM_LOGO : "./images/nba_heats.jpg"\r
+}, {\r
+       NAME : "Jacobs, Winfred O. (Fred)",\r
+       ACTIVE : "1946 - 1946",\r
+       FROM : "College - Denver",\r
+       TEAM_LOGO : "./images/nba_bobcats.jpg"\r
+}, {\r
+       NAME : "Jacobsen, Casey",\r
+       ACTIVE : "2007 - 2007",\r
+       FROM : "College - Stanford",\r
+       TEAM_LOGO : "./images/nba_celtics.jpg"\r
+}, {\r
+       NAME : "Jacobson, Sam",\r
+       ACTIVE : "1998 - 2000",\r
+       FROM : "College - Minnesota",\r
+       TEAM_LOGO : "./images/nba_sonics.jpg"\r
+}, {\r
+       NAME : "Jamerson, Dave",\r
+       ACTIVE : "1990 - 1993",\r
+       FROM : "College - Ohio U.",\r
+       TEAM_LOGO : "./images/nba_cavaliers.jpg"\r
+}, {\r
+       NAME : "James, Aaron (A.J.)",\r
+       ACTIVE : "1974 - 1978",\r
+       FROM : "College - Grambling State",\r
+       TEAM_LOGO : "./images/nba_rockets.jpg"\r
+}, {\r
+       NAME : "James, Damion",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Texas",\r
+       TEAM_LOGO : "./images/nba_pistons.jpg"\r
+}, {\r
+       NAME : "James, Harold Gene (Gene, Goose)",\r
+       ACTIVE : "1948 - 1950",\r
+       FROM : "College - Marshall",\r
+       TEAM_LOGO : "./images/nba_pistons.jpg"\r
+}, {\r
+       NAME : "James, Henry",\r
+       ACTIVE : "1990 - 1997",\r
+       FROM : "College - South Plains Coll. TX (J.C.); St. Mary's (Tex.)",\r
+       TEAM_LOGO : "./images/nba_knics.jpg"\r
+}, {\r
+       NAME : "James, Jerome",\r
+       ACTIVE : "2007 - 2008",\r
+       FROM : "College - Florida A&M",\r
+       TEAM_LOGO : "./images/nba_bucks.jpg"\r
+}, {\r
+       NAME : "James, LeBron",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "High School - St. Vincent-St. Mary HS (OH)",\r
+       TEAM_LOGO : "./images/nba_honets.jpg"\r
+}, {\r
+       NAME : "James, Mike",\r
+       ACTIVE : "2007 - 2009",\r
+       FROM : "College - Duquesne",\r
+       TEAM_LOGO : "./images/nba_76ers.jpg"\r
+}, {\r
+       NAME : "James, Tim",\r
+       ACTIVE : "1999 - 2001",\r
+       FROM : "College - Miami (Fla.) ''99",\r
+       TEAM_LOGO : "./images/nba_bobcats.jpg"\r
+}, {\r
+       NAME : "Jamison, Antawn",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - North Carolina",\r
+       TEAM_LOGO : "./images/nba_heats.jpg"\r
+}, {\r
+       NAME : "Jamison, Harold",\r
+       ACTIVE : "1999 - 2001",\r
+       FROM : "College - Clemson ''99",\r
+       TEAM_LOGO : "./images/nba_cavaliers.jpg"\r
+}, {\r
+       NAME : "Janisch, John Albert",\r
+       ACTIVE : "1946 - 1947",\r
+       FROM : "College - Valparaiso",\r
+       TEAM_LOGO : "./images/nba_nets.jpg"\r
+}, {\r
+       NAME : "Janotta, Howard (Howie)",\r
+       ACTIVE : "1949 - 1949",\r
+       FROM : "College - Seton Hall",\r
+       TEAM_LOGO : "./images/nba_spurs.jpg"\r
+}, {\r
+       NAME : "Jaric, Marko",\r
+       ACTIVE : "2007 - 2008",\r
+       FROM : "From - Belgrade, Serbia",\r
+       TEAM_LOGO : "./images/nba_warriors.jpg"\r
+}, {\r
+       NAME : "Jaros, Anthony Joseph (Tony)",\r
+       ACTIVE : "1946 - 1950",\r
+       FROM : "College - Minnesota",\r
+       TEAM_LOGO : "./images/nba_celtics.jpg"\r
+}, {\r
+       NAME : "Jasikevicius, Sarunas",\r
+       ACTIVE : "2005 - 2006",\r
+       FROM : "College - Maryland",\r
+       TEAM_LOGO : "./images/nba_nets.jpg"\r
+}, {\r
+       NAME : "Jawai, Nathan",\r
+       ACTIVE : "2008 - 2009",\r
+       FROM : "From - Australia",\r
+       TEAM_LOGO : "./images/nba_wizards.jpg"\r
+}, {\r
+       NAME : "Jeannette, Harry Edward (Buddy)",\r
+       ACTIVE : "1947 - 1949",\r
+       FROM : "College - Washington & Jefferson",\r
+       TEAM_LOGO : "./images/nba_clippers.jpg"\r
+}, {\r
+       NAME : "Jeelani, Abdul Qadir (formerly Gary Cole)",\r
+       ACTIVE : "1979 - 1980",\r
+       FROM : "College - Wis.-Parkside",\r
+       TEAM_LOGO : "./images/nba_sonics.jpg"\r
+}, {\r
+       NAME : "Jefferies, Chris",\r
+       ACTIVE : "2002 - 2003",\r
+       FROM : "College - Fresno State ''03",\r
+       TEAM_LOGO : "./images/nba_knics.jpg"\r
+}, {\r
+       NAME : "Jeffers, Othyus",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Robert Morris (Ill.)",\r
+       TEAM_LOGO : "./images/nba_nuggets.jpg"\r
+}, {\r
+       NAME : "Jefferson, Al",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "High School - Prentiss HS (MS)",\r
+       TEAM_LOGO : "./images/nba_celtics.jpg"\r
+}, {\r
+       NAME : "Jefferson, Dontell",\r
+       ACTIVE : "2008 - 2008",\r
+       FROM : "College - Arkansas",\r
+       TEAM_LOGO : "./images/nba_honets.jpg"\r
+}, {\r
+       NAME : "Jefferson, Richard",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Arizona",\r
+       TEAM_LOGO : "./images/nba_kings.jpg"\r
+}, {\r
+       NAME : "Kachan, Edwin John (Whitey)",\r
+       ACTIVE : "1948 - 1948",\r
+       FROM : "College - DePaul",\r
+       TEAM_LOGO : "./images/nba_heats.jpg"\r
+}, {\r
+       NAME : "Kaftan, George A. (The Golden Greek)",\r
+       ACTIVE : "1948 - 1952",\r
+       FROM : "College - Holy Cross",\r
+       TEAM_LOGO : "./images/nba_suns.jpg"\r
+}, {\r
+       NAME : "Kalafat, Edward L. (Ed)",\r
+       ACTIVE : "1954 - 1956",\r
+       FROM : "College - Minnesota",\r
+       TEAM_LOGO : "./images/nba_pistons.jpg"\r
+}, {\r
+       NAME : "Kaman, Chris",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Central Michigan",\r
+       TEAM_LOGO : "./images/nba_76ers.jpg"\r
+}, {\r
+       NAME : "Kaplowitz, Ralph (Kappy)",\r
+       ACTIVE : "1946 - 1947",\r
+       FROM : "College - N.Y.U.",\r
+       TEAM_LOGO : "./images/nba_celtics.jpg"\r
+}, {\r
+       NAME : "Kapono, Jason",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - UCLA",\r
+       TEAM_LOGO : "./images/nba_clippers.jpg"\r
+}, {\r
+       NAME : "Kappen, Anthony George (Tony)",\r
+       ACTIVE : "1946 - 1946",\r
+       FROM : "College - No College",\r
+       TEAM_LOGO : "./images/nba_mavericks.jpg"\r
+}, {\r
+       NAME : "Karl, Coby",\r
+       ACTIVE : "2007 - 2009",\r
+       FROM : "College - Boise State",\r
+       TEAM_LOGO : "./images/nba_bulls.jpg"\r
+}, {\r
+       NAME : "Karl, George Matthew",\r
+       ACTIVE : "1976 - 1977",\r
+       FROM : "College - North Carolina",\r
+       TEAM_LOGO : "./images/nba_griz.jpg"\r
+}, {\r
+       NAME : "Kasid, Edward (Ed)",\r
+       ACTIVE : "1946 - 1946",\r
+       FROM : "College - No College",\r
+       TEAM_LOGO : "./images/nba_griz.jpg"\r
+}, {\r
+       NAME : "Kasun, Mario",\r
+       ACTIVE : "2004 - 2005",\r
+       FROM : "From - Croatia",\r
+       TEAM_LOGO : "./images/nba_cavaliers.jpg"\r
+}, {\r
+       NAME : "Katkaveck, Leo Frank",\r
+       ACTIVE : "1948 - 1949",\r
+       FROM : "College - North Carolina State",\r
+       TEAM_LOGO : "./images/nba_trail.jpg"\r
+}, {\r
+       NAME : "Kauffman, Robert (Bob, Horse)",\r
+       ACTIVE : "1968 - 1974",\r
+       FROM : "College - Guilford",\r
+       TEAM_LOGO : "./images/nba_suns.jpg"\r
+}, {\r
+       NAME : "Kautz, Wilbert (Wibs)",\r
+       ACTIVE : "1946 - 1946",\r
+       FROM : "College - Loyola (Chicago)",\r
+       TEAM_LOGO : "./images/nba_raptors.jpg"\r
+}, {\r
+       NAME : "Kea, Clarence Leroy",\r
+       ACTIVE : "1980 - 1981",\r
+       FROM : "College - Lamar",\r
+       TEAM_LOGO : "./images/nba_sonics.jpg"\r
+}, {\r
+       NAME : "Kearns, Michael Joseph",\r
+       ACTIVE : "1954 - 1954",\r
+       FROM : "College - Princeton",\r
+       TEAM_LOGO : "./images/nba_76ers.jpg"\r
+}, {\r
+       NAME : "Kearns, Thomas Francis Jr. (Tommy)",\r
+       ACTIVE : "1958 - 1958",\r
+       FROM : "College - North Carolina",\r
+       TEAM_LOGO : "./images/nba_pistons.jpg"\r
+}, {\r
+       NAME : "Keefe, Adam",\r
+       ACTIVE : "1992 - 2000",\r
+       FROM : "College - Stanford",\r
+       TEAM_LOGO : "./images/nba_raptors.jpg"\r
+}, {\r
+       NAME : "Keeling, Harold A.",\r
+       ACTIVE : "1985 - 1985",\r
+       FROM : "College - Santa Clara",\r
+       TEAM_LOGO : "./images/nba_cavaliers.jpg"\r
+}, {\r
+       NAME : "Keller, Kenneth W. (Ken)",\r
+       ACTIVE : "1946 - 1946",\r
+       FROM : "College - Vermont; St. John's (N.Y.)",\r
+       TEAM_LOGO : "./images/nba_jazz.jpg"\r
+}, {\r
+       NAME : "Kelley, Rich",\r
+       ACTIVE : "1975 - 1985",\r
+       FROM : "College - Stanford",\r
+       TEAM_LOGO : "./images/nba_pistons.jpg"\r
+}, {\r
+       NAME : "Kellogg, Clark",\r
+       ACTIVE : "1982 - 1986",\r
+       FROM : "College - Ohio State",\r
+       TEAM_LOGO : "./images/nba_pistons.jpg"\r
+}, {\r
+       NAME : "Kelly, Gerard Allan (Jerry)",\r
+       ACTIVE : "1946 - 1947",\r
+       FROM : "College - Marshall",\r
+       TEAM_LOGO : "./images/nba_bucks.jpg"\r
+}, {\r
+       NAME : "Kelly, Thomas Edward (Tom)",\r
+       ACTIVE : "1948 - 1948",\r
+       FROM : "College - N.Y.U.",\r
+       TEAM_LOGO : "./images/nba_bobcats.jpg"\r
+}, {\r
+       NAME : "Kelser, Greg",\r
+       ACTIVE : "1979 - 1984",\r
+       FROM : "College - Michigan State",\r
+       TEAM_LOGO : "./images/nba_bobcats.jpg"\r
+}, {\r
+       NAME : "Kelso, Ben",\r
+       ACTIVE : "1973 - 1973",\r
+       FROM : "College - Central Michigan",\r
+       TEAM_LOGO : "./images/nba_bobcats.jpg"\r
+}, {\r
+       NAME : "Kemp, Shawn",\r
+       ACTIVE : "1989 - 2002",\r
+       FROM : "High School - Concord HS (IN) ''87",\r
+       TEAM_LOGO : "./images/nba_spurs.jpg"\r
+}, {\r
+       NAME : "Kempton, Tim",\r
+       ACTIVE : "1986 - 1997",\r
+       FROM : "College - Notre Dame",\r
+       TEAM_LOGO : "./images/nba_cavaliers.jpg"\r
+}, {\r
+       NAME : "Kendrick, Frank Edward",\r
+       ACTIVE : "1974 - 1974",\r
+       FROM : "College - Purdue",\r
+       TEAM_LOGO : "./images/nba_spurs.jpg"\r
+}, {\r
+       NAME : "Kennedy, Eugene (Goo)",\r
+       ACTIVE : "1976 - 1976",\r
+       FROM : "College - Texas Christian",\r
+       TEAM_LOGO : "./images/nba_heats.jpg"\r
+}, {\r
+       NAME : "Kennedy, Joseph A. (Joe)",\r
+       ACTIVE : "1968 - 1969",\r
+       FROM : "College - Duke",\r
+       TEAM_LOGO : "./images/nba_knics.jpg"\r
+}, {\r
+       NAME : "Kennedy, William F. (Pickles)",\r
+       ACTIVE : "1960 - 1960",\r
+       FROM : "College - Temple",\r
+       TEAM_LOGO : "./images/nba_nets.jpg"\r
+}, {\r
+       NAME : "Kenon, Larry",\r
+       ACTIVE : "1976 - 1982",\r
+       FROM : "College - Amarillo Coll. TX (J.C.); Memphis",\r
+       TEAM_LOGO : "./images/nba_hawks.jpg"\r
+}, {\r
+       NAME : "Kenville, William McGill (Billy, The Kid)",\r
+       ACTIVE : "1953 - 1959",\r
+       FROM : "College - St. Bonaventure",\r
+       TEAM_LOGO : "./images/nba_sonics.jpg"\r
+}, {\r
+       NAME : "Kerner, Jonathan",\r
+       ACTIVE : "1998 - 1998",\r
+       FROM : "College - East Carolina ''97",\r
+       TEAM_LOGO : "./images/nba_raptors.jpg"\r
+}, {\r
+       NAME : "Kerr, Johnny",\r
+       ACTIVE : "1954 - 1965",\r
+       FROM : "College - Illinois",\r
+       TEAM_LOGO : "./images/nba_sonics.jpg"\r
+}, {\r
+       NAME : "Kerr, Steve",\r
+       ACTIVE : "1988 - 2002",\r
+       FROM : "College - Arizona ''88",\r
+       TEAM_LOGO : "./images/nba_celtics.jpg"\r
+}, {\r
+       NAME : "Kerris, John E. (Jack)",\r
+       ACTIVE : "1949 - 1952",\r
+       FROM : "College - Loyola (Chicago)",\r
+       TEAM_LOGO : "./images/nba_griz.jpg"\r
+}, {\r
+       NAME : "Kersey, Jerome",\r
+       ACTIVE : "1984 - 2000",\r
+       FROM : "College - Longwood",\r
+       TEAM_LOGO : "./images/nba_celtics.jpg"\r
+}, {\r
+       NAME : "Kessler, Alec",\r
+       ACTIVE : "1990 - 1993",\r
+       FROM : "College - Georgia",\r
+       TEAM_LOGO : "./images/nba_honets.jpg"\r
+}, {\r
+       NAME : "Ketner, Lari",\r
+       ACTIVE : "1999 - 2000",\r
+       FROM : "College - Massachusetts",\r
+       TEAM_LOGO : "./images/nba_pacers.jpg"\r
+}, {\r
+       NAME : "Keys, Randolph",\r
+       ACTIVE : "1988 - 1995",\r
+       FROM : "College - Southern Mississippi",\r
+       TEAM_LOGO : "./images/nba_griz.jpg"\r
+}, {\r
+       NAME : "Khryapa, Viktor",\r
+       ACTIVE : "2007 - 2007",\r
+       FROM : "From - Russia",\r
+       TEAM_LOGO : "./images/nba_honets.jpg"\r
+}, {\r
+       NAME : "Kidd, Jason",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - California",\r
+       TEAM_LOGO : "./images/nba_wizards.jpg"\r
+}, {\r
+       NAME : "Kidd, Warren",\r
+       ACTIVE : "1993 - 1993",\r
+       FROM : "College - Middle Tennessee State",\r
+       TEAM_LOGO : "./images/nba_nuggets.jpg"\r
+}, {\r
+       NAME : "Kiffin, Irvin A. Jr.",\r
+       ACTIVE : "1979 - 1979",\r
+       FROM : "College - Virginia Union; Oklahoma Baptist",\r
+       TEAM_LOGO : "./images/nba_hawks.jpg"\r
+}, {\r
+       NAME : "Kiley, John F. (Jack)",\r
+       ACTIVE : "1951 - 1952",\r
+       FROM : "College - Syracuse",\r
+       TEAM_LOGO : "./images/nba_honets.jpg"\r
+}, {\r
+       NAME : "Killum, Earnest (Ernie)",\r
+       ACTIVE : "1970 - 1970",\r
+       FROM : "College - Stetson",\r
+       TEAM_LOGO : "./images/nba_griz.jpg"\r
+}, {\r
+       NAME : "Kilpatrick, Carl",\r
+       ACTIVE : "1979 - 1979",\r
+       FROM : "College - Kilgore Coll. TX (J.C.); Louisiana-Monroe",\r
+       TEAM_LOGO : "./images/nba_knics.jpg"\r
+}, {\r
+       NAME : "Kimball, Toby",\r
+       ACTIVE : "1966 - 1974",\r
+       FROM : "College - Connecticut",\r
+       TEAM_LOGO : "./images/nba_timberwolves.jpg"\r
+}, {\r
+       NAME : "Lacey, Sam",\r
+       ACTIVE : "1970 - 1982",\r
+       FROM : "College - New Mexico State",\r
+       TEAM_LOGO : "./images/nba_suns.jpg"\r
+}, {\r
+       NAME : "LaCour, Fred",\r
+       ACTIVE : "1960 - 1962",\r
+       FROM : "College - San Francisco",\r
+       TEAM_LOGO : "./images/nba_trail.jpg"\r
+}, {\r
+       NAME : "Laettner, Christian",\r
+       ACTIVE : "1992 - 2004",\r
+       FROM : "College - Duke",\r
+       TEAM_LOGO : "./images/nba_hawks.jpg"\r
+}, {\r
+       NAME : "Lafayette, Oliver",\r
+       ACTIVE : "2009 - 2009",\r
+       FROM : "College - Houston",\r
+       TEAM_LOGO : "./images/nba_knics.jpg"\r
+}, {\r
+       NAME : "LaFrentz, Raef",\r
+       ACTIVE : "2007 - 2007",\r
+       FROM : "College - Kansas",\r
+       TEAM_LOGO : "./images/nba_pacers.jpg"\r
+}, {\r
+       NAME : "LaGarde, Thomas Joseph (Tom)",\r
+       ACTIVE : "1977 - 1984",\r
+       FROM : "College - North Carolina",\r
+       TEAM_LOGO : "./images/nba_heats.jpg"\r
+}, {\r
+       NAME : "Laimbeer, Bill",\r
+       ACTIVE : "1980 - 1993",\r
+       FROM : "College - Owens CC OH; Notre Dame",\r
+       TEAM_LOGO : "./images/nba_warriors.jpg"\r
+}, {\r
+       NAME : "Lalich, Peter T. (Pete)",\r
+       ACTIVE : "1946 - 1946",\r
+       FROM : "College - Ohio U.",\r
+       TEAM_LOGO : "./images/nba_warriors.jpg"\r
+}, {\r
+       NAME : "Lamar, Dwight (Bo)",\r
+       ACTIVE : "1976 - 1976",\r
+       FROM : "College - Louisiana-Lafayette",\r
+       TEAM_LOGO : "./images/nba_cavaliers.jpg"\r
+}, {\r
+       NAME : "Lambert, John Edward",\r
+       ACTIVE : "1975 - 1981",\r
+       FROM : "College - USC",\r
+       TEAM_LOGO : "./images/nba_warriors.jpg"\r
+}, {\r
+       NAME : "Lamp, Jeff",\r
+       ACTIVE : "1981 - 1988",\r
+       FROM : "College - Virginia",\r
+       TEAM_LOGO : "./images/nba_cavaliers.jpg"\r
+}, {\r
+       NAME : "Lampe, Maciej",\r
+       ACTIVE : "2003 - 2005",\r
+       FROM : "From - Poland",\r
+       TEAM_LOGO : "./images/nba_lakers.jpg"\r
+}, {\r
+       NAME : "Lampley, Jimmy",\r
+       ACTIVE : "1986 - 1986",\r
+       FROM : "College - Vanderbilt; Arkansas-Little Rock",\r
+       TEAM_LOGO : "./images/nba_nuggets.jpg"\r
+}, {\r
+       NAME : "Lampley, Sean",\r
+       ACTIVE : "2002 - 2003",\r
+       FROM : "College - California",\r
+       TEAM_LOGO : "./images/nba_magics.jpg"\r
+}, {\r
+       NAME : "Landry, Carl",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Purdue",\r
+       TEAM_LOGO : "./images/nba_cavaliers.jpg"\r
+}, {\r
+       NAME : "Landry, Marcus",\r
+       ACTIVE : "2009 - 2009",\r
+       FROM : "College - Wisconsin",\r
+       TEAM_LOGO : "./images/nba_clippers.jpg"\r
+}, {\r
+       NAME : "Landsberger, Mark",\r
+       ACTIVE : "1977 - 1983",\r
+       FROM : "College - Allan Hancock Coll. CA (J.C.); Minnesota; Arizona State",\r
+       TEAM_LOGO : "./images/nba_celtics.jpg"\r
+}, {\r
+       NAME : "Lane, Jerome",\r
+       ACTIVE : "1988 - 1992",\r
+       FROM : "College - Pittsburgh",\r
+       TEAM_LOGO : "./images/nba_knics.jpg"\r
+}, {\r
+       NAME : "Lang, Andrew",\r
+       ACTIVE : "1988 - 1999",\r
+       FROM : "College - Arkansas",\r
+       TEAM_LOGO : "./images/nba_spurs.jpg"\r
+}, {\r
+       NAME : "Lang, Antonio",\r
+       ACTIVE : "1994 - 1999",\r
+       FROM : "College - Duke",\r
+       TEAM_LOGO : "./images/nba_timberwolves.jpg"\r
+}, {\r
+       NAME : "Lang, James",\r
+       ACTIVE : "2006 - 2006",\r
+       FROM : "High School - Central Park Christian HS (AL)",\r
+       TEAM_LOGO : "./images/nba_hawks.jpg"\r
+}, {\r
+       NAME : "Langdon, Trajan",\r
+       ACTIVE : "1999 - 2001",\r
+       FROM : "College - Duke",\r
+       TEAM_LOGO : "./images/nba_bobcats.jpg"\r
+}, {\r
+       NAME : "Langford, Keith",\r
+       ACTIVE : "2007 - 2007",\r
+       FROM : "College - Kansas",\r
+       TEAM_LOGO : "./images/nba_sonics.jpg"\r
+}, {\r
+       NAME : "Langhi, Dan",\r
+       ACTIVE : "2000 - 2003",\r
+       FROM : "College - Vanderbilt ''00",\r
+       TEAM_LOGO : "./images/nba_cavaliers.jpg"\r
+}, {\r
+       NAME : "Lanier, Bob",\r
+       ACTIVE : "1970 - 1983",\r
+       FROM : "College - St. Bonaventure",\r
+       TEAM_LOGO : "./images/nba_clippers.jpg"\r
+}, {\r
+       NAME : "Lantz, Stuart Burrell (Stu)",\r
+       ACTIVE : "1968 - 1975",\r
+       FROM : "College - Nebraska",\r
+       TEAM_LOGO : "./images/nba_kings.jpg"\r
+}, {\r
+       NAME : "Larese, York Bruno",\r
+       ACTIVE : "1961 - 1961",\r
+       FROM : "College - North Carolina",\r
+       TEAM_LOGO : "./images/nba_trail.jpg"\r
+}, {\r
+       NAME : "LaRue, Rusty",\r
+       ACTIVE : "1997 - 2003",\r
+       FROM : "College - Wake Forest",\r
+       TEAM_LOGO : "./images/nba_76ers.jpg"\r
+}, {\r
+       NAME : "LaRusso, Rudolph A. (Rudy)",\r
+       ACTIVE : "1959 - 1968",\r
+       FROM : "College - Dartmouth",\r
+       TEAM_LOGO : "./images/nba_heats.jpg"\r
+}, {\r
+       NAME : "Laskowski, John",\r
+       ACTIVE : "1975 - 1976",\r
+       FROM : "College - Indiana",\r
+       TEAM_LOGO : "./images/nba_pacers.jpg"\r
+}, {\r
+       NAME : "Lasme, Stephane",\r
+       ACTIVE : "2007 - 2007",\r
+       FROM : "College - Massachusetts",\r
+       TEAM_LOGO : "./images/nba_trail.jpg"\r
+}, {\r
+       NAME : "Lattin, David (Dave, Big Daddy)",\r
+       ACTIVE : "1967 - 1968",\r
+       FROM : "College - Texas-El Paso",\r
+       TEAM_LOGO : "./images/nba_suns.jpg"\r
+}, {\r
+       NAME : "Lauderdale, Priest",\r
+       ACTIVE : "1996 - 1997",\r
+       FROM : "College - Central State (Ohio)",\r
+       TEAM_LOGO : "./images/nba_sonics.jpg"\r
+}, {\r
+       NAME : "Laurel, Richard",\r
+       ACTIVE : "1977 - 1977",\r
+       FROM : "College - Hofstra",\r
+       TEAM_LOGO : "./images/nba_bucks.jpg"\r
+}, {\r
+       NAME : "Lautenbach, Walter Henry (Walt)",\r
+       ACTIVE : "1949 - 1949",\r
+       FROM : "College - Wisconsin",\r
+       TEAM_LOGO : "./images/nba_warriors.jpg"\r
+}, {\r
+       NAME : "Lavelli, Anthony (Tony)",\r
+       ACTIVE : "1949 - 1950",\r
+       FROM : "College - Yale",\r
+       TEAM_LOGO : "./images/nba_hawks.jpg"\r
+}, {\r
+       NAME : "Lavoy, Robert William (Bob)",\r
+       ACTIVE : "1950 - 1953",\r
+       FROM : "College - Illinois; Western Kentucky",\r
+       TEAM_LOGO : "./images/nba_wizards.jpg"\r
+}, {\r
+       NAME : "Law, Acie",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Texas A&M",\r
+       TEAM_LOGO : "./images/nba_bulls.jpg"\r
+}, {\r
+       NAME : "Lawal, Gani",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Georgia Tech",\r
+       TEAM_LOGO : "./images/nba_celtics.jpg"\r
+}, {\r
+       NAME : "Lawrence, Edmund (Ed)",\r
+       ACTIVE : "1980 - 1980",\r
+       FROM : "College - McNeese State",\r
+       TEAM_LOGO : "./images/nba_bulls.jpg"\r
+}, {\r
+       NAME : "Lawson, Jason",\r
+       ACTIVE : "1997 - 1997",\r
+       FROM : "College - Villanova ''97",\r
+       TEAM_LOGO : "./images/nba_pistons.jpg"\r
+}, {\r
+       NAME : "Lawson, Ty",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - North Carolina",\r
+       TEAM_LOGO : "./images/nba_mavericks.jpg"\r
+}, {\r
+       NAME : "Layton, Dennis (Mo)",\r
+       ACTIVE : "1971 - 1977",\r
+       FROM : "College - Phoenix Coll. AZ (J.C.); USC",\r
+       TEAM_LOGO : "./images/nba_pistons.jpg"\r
+}, {\r
+       NAME : "Leaks, Emanuel (Manny)",\r
+       ACTIVE : "1972 - 1973",\r
+       FROM : "College - Niagara",\r
+       TEAM_LOGO : "./images/nba_cavaliers.jpg"\r
+}, {\r
+       NAME : "Lear, Harold C. Jr. (Hal, King)",\r
+       ACTIVE : "1956 - 1956",\r
+       FROM : "College - Temple",\r
+       TEAM_LOGO : "./images/nba_nuggets.jpg"\r
+}, {\r
+       NAME : "Leavell, Allen",\r
+       ACTIVE : "1979 - 1988",\r
+       FROM : "College - Oklahoma City",\r
+       TEAM_LOGO : "./images/nba_wizards.jpg"\r
+}, {\r
+       NAME : "Lebo, Jeff",\r
+       ACTIVE : "1989 - 1989",\r
+       FROM : "College - North Carolina",\r
+       TEAM_LOGO : "./images/nba_bucks.jpg"\r
+}, {\r
+       NAME : "Leckner, Eric",\r
+       ACTIVE : "1988 - 1996",\r
+       FROM : "College - Wyoming",\r
+       TEAM_LOGO : "./images/nba_bobcats.jpg"\r
+}, {\r
+       NAME : "Lee, Alfred (Butch)",\r
+       ACTIVE : "1978 - 1979",\r
+       FROM : "College - Marquette",\r
+       TEAM_LOGO : "./images/nba_wizards.jpg"\r
+}, {\r
+       NAME : "Lee, Clyde",\r
+       ACTIVE : "1966 - 1975",\r
+       FROM : "College - Vanderbilt",\r
+       TEAM_LOGO : "./images/nba_spurs.jpg"\r
+}, {\r
+       NAME : "Macaluso, Michael Emelius (Mike)",\r
+       ACTIVE : "1973 - 1973",\r
+       FROM : "College - Canisius",\r
+       TEAM_LOGO : "./images/nba_wizards.jpg"\r
+}, {\r
+       NAME : "Macauley, Ed",\r
+       ACTIVE : "1949 - 1958",\r
+       FROM : "College - St. Louis",\r
+       TEAM_LOGO : "./images/nba_magics.jpg"\r
+}, {\r
+       NAME : "MacCulloch, Todd",\r
+       ACTIVE : "1999 - 2002",\r
+       FROM : "College - Washington ''99",\r
+       TEAM_LOGO : "./images/nba_heats.jpg"\r
+}, {\r
+       NAME : "MacGilvray, Ronald (Ronnie)",\r
+       ACTIVE : "1954 - 1954",\r
+       FROM : "College - St. John's (N.Y.)",\r
+       TEAM_LOGO : "./images/nba_lakers.jpg"\r
+}, {\r
+       NAME : "Macijauskas, Arvydas",\r
+       ACTIVE : "2005 - 2005",\r
+       FROM : "From - Lithuania",\r
+       TEAM_LOGO : "./images/nba_spurs.jpg"\r
+}, {\r
+       NAME : "Mack, Oliver (Ollie)",\r
+       ACTIVE : "1979 - 1981",\r
+       FROM : "College - San Jacinto Coll. TX (J.C.); East Carolina",\r
+       TEAM_LOGO : "./images/nba_bobcats.jpg"\r
+}, {\r
+       NAME : "Mack, Sam",\r
+       ACTIVE : "1992 - 2001",\r
+       FROM : "College - Iowa State; Arizona State; Tyler JC TX; Houston",\r
+       TEAM_LOGO : "./images/nba_76ers.jpg"\r
+}, {\r
+       NAME : "Mackey, Malcolm",\r
+       ACTIVE : "1993 - 1993",\r
+       FROM : "College - Georgia Tech",\r
+       TEAM_LOGO : "./images/nba_magics.jpg"\r
+}, {\r
+       NAME : "Macklin, Rudy",\r
+       ACTIVE : "1981 - 1983",\r
+       FROM : "College - Louisiana State",\r
+       TEAM_LOGO : "./images/nba_celtics.jpg"\r
+}, {\r
+       NAME : "Macknowski, John Andrew (Johnny, Whitey)",\r
+       ACTIVE : "1949 - 1950",\r
+       FROM : "College - Seton Hall",\r
+       TEAM_LOGO : "./images/nba_bulls.jpg"\r
+}, {\r
+       NAME : "MacLean, Don",\r
+       ACTIVE : "1992 - 2000",\r
+       FROM : "College - UCLA",\r
+       TEAM_LOGO : "./images/nba_honets.jpg"\r
+}, {\r
+       NAME : "Macon, Mark",\r
+       ACTIVE : "1991 - 1998",\r
+       FROM : "College - Temple",\r
+       TEAM_LOGO : "./images/nba_timberwolves.jpg"\r
+}, {\r
+       NAME : "Macy, Kyle",\r
+       ACTIVE : "1980 - 1986",\r
+       FROM : "College - Purdue; Kentucky",\r
+       TEAM_LOGO : "./images/nba_pistons.jpg"\r
+}, {\r
+       NAME : "Maddox, Jack C.",\r
+       ACTIVE : "1948 - 1948",\r
+       FROM : "College - West Texas A&M",\r
+       TEAM_LOGO : "./images/nba_honets.jpg"\r
+}, {\r
+       NAME : "Maddox, Tito",\r
+       ACTIVE : "2002 - 2002",\r
+       FROM : "College - Fresno State ''04",\r
+       TEAM_LOGO : "./images/nba_warriors.jpg"\r
+}, {\r
+       NAME : "Madkins, Gerald",\r
+       ACTIVE : "1993 - 1997",\r
+       FROM : "College - UCLA",\r
+       TEAM_LOGO : "./images/nba_trail.jpg"\r
+}, {\r
+       NAME : "Madsen, Mark",\r
+       ACTIVE : "2007 - 2008",\r
+       FROM : "College - Stanford",\r
+       TEAM_LOGO : "./images/nba_nets.jpg"\r
+}, {\r
+       NAME : "Mager, Norman Clifford (Norm)",\r
+       ACTIVE : "1950 - 1950",\r
+       FROM : "College - St. John's (N.Y.); CCNY",\r
+       TEAM_LOGO : "./images/nba_jazz.jpg"\r
+}, {\r
+       NAME : "Maggette, Corey",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Duke",\r
+       TEAM_LOGO : "./images/nba_timberwolves.jpg"\r
+}, {\r
+       NAME : "Magley, Dave",\r
+       ACTIVE : "1982 - 1982",\r
+       FROM : "College - Kansas",\r
+       TEAM_LOGO : "./images/nba_wizards.jpg"\r
+}, {\r
+       NAME : "Magloire, Jamaal",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Kentucky",\r
+       TEAM_LOGO : "./images/nba_clippers.jpg"\r
+}, {\r
+       NAME : "Mahinmi, Ian",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "From - Rouen, France",\r
+       TEAM_LOGO : "./images/nba_cavaliers.jpg"\r
+}, {\r
+       NAME : "Mahnken, John E. (Long John; Stretch)",\r
+       ACTIVE : "1946 - 1952",\r
+       FROM : "College - Georgetown",\r
+       TEAM_LOGO : "./images/nba_warriors.jpg"\r
+}, {\r
+       NAME : "Mahoney, Francis H. (Mo)",\r
+       ACTIVE : "1952 - 1953",\r
+       FROM : "College - Brown",\r
+       TEAM_LOGO : "./images/nba_nets.jpg"\r
+}, {\r
+       NAME : "Mahorn, Rick",\r
+       ACTIVE : "1980 - 1998",\r
+       FROM : "College - Hampton",\r
+       TEAM_LOGO : "./images/nba_nets.jpg"\r
+}, {\r
+       NAME : "Majerle, Dan",\r
+       ACTIVE : "1988 - 2001",\r
+       FROM : "College - Central Michigan",\r
+       TEAM_LOGO : "./images/nba_raptors.jpg"\r
+}, {\r
+       NAME : "Major, Renaldo",\r
+       ACTIVE : "2006 - 2006",\r
+       FROM : "College - Fresno State",\r
+       TEAM_LOGO : "./images/nba_pistons.jpg"\r
+}, {\r
+       NAME : "Malamed, Lionel",\r
+       ACTIVE : "1948 - 1948",\r
+       FROM : "College - CCNY",\r
+       TEAM_LOGO : "./images/nba_knics.jpg"\r
+}, {\r
+       NAME : "Malone, Jeff",\r
+       ACTIVE : "1983 - 1995",\r
+       FROM : "College - Mississippi State",\r
+       TEAM_LOGO : "./images/nba_suns.jpg"\r
+}, {\r
+       NAME : "Malone, Karl",\r
+       ACTIVE : "1985 - 2003",\r
+       FROM : "College - Louisiana Tech ''86",\r
+       TEAM_LOGO : "./images/nba_hawks.jpg"\r
+}, {\r
+       NAME : "Malone, Moses",\r
+       ACTIVE : "1976 - 1994",\r
+       FROM : "College - No College",\r
+       TEAM_LOGO : "./images/nba_pacers.jpg"\r
+}, {\r
+       NAME : "Maloney, Matt",\r
+       ACTIVE : "1996 - 2002",\r
+       FROM : "College - Pennsylvania",\r
+       TEAM_LOGO : "./images/nba_celtics.jpg"\r
+}, {\r
+       NAME : "Malovic, Stephen L.",\r
+       ACTIVE : "1979 - 1979",\r
+       FROM : "College - USC; San Diego State",\r
+       TEAM_LOGO : "./images/nba_hawks.jpg"\r
+}, {\r
+       NAME : "Manakas, Theodore (Ted)",\r
+       ACTIVE : "1973 - 1973",\r
+       FROM : "College - Princeton",\r
+       TEAM_LOGO : "./images/nba_suns.jpg"\r
+}, {\r
+       NAME : "Mandic, John J.",\r
+       ACTIVE : "1948 - 1949",\r
+       FROM : "College - Oregon State",\r
+       TEAM_LOGO : "./images/nba_cavaliers.jpg"\r
+}, {\r
+       NAME : "Mangiapane, Francis E. (Frank)",\r
+       ACTIVE : "1946 - 1946",\r
+       FROM : "College - N.Y.U.",\r
+       TEAM_LOGO : "./images/nba_mavericks.jpg"\r
+}, {\r
+       NAME : "Manning, Danny",\r
+       ACTIVE : "1988 - 2002",\r
+       FROM : "College - Kansas ''88",\r
+       TEAM_LOGO : "./images/nba_nuggets.jpg"\r
+}, {\r
+       NAME : "Manning, Edward R. (Ed)",\r
+       ACTIVE : "1967 - 1970",\r
+       FROM : "College - Jackson State",\r
+       TEAM_LOGO : "./images/nba_bobcats.jpg"\r
+}, {\r
+       NAME : "Manning, Rich",\r
+       ACTIVE : "1995 - 1996",\r
+       FROM : "College - Syracuse; Washington",\r
+       TEAM_LOGO : "./images/nba_jazz.jpg"\r
+}, {\r
+       NAME : "Mannion, Pace",\r
+       ACTIVE : "1983 - 1988",\r
+       FROM : "College - Utah",\r
+       TEAM_LOGO : "./images/nba_suns.jpg"\r
+}, {\r
+       NAME : "Mantis, Nicholas (Nick)",\r
+       ACTIVE : "1959 - 1962",\r
+       FROM : "College - Northwestern",\r
+       TEAM_LOGO : "./images/nba_hawks.jpg"\r
+}, {\r
+       NAME : "Maravich, Pete",\r
+       ACTIVE : "1970 - 1979",\r
+       FROM : "College - Louisiana State",\r
+       TEAM_LOGO : "./images/nba_nuggets.jpg"\r
+}, {\r
+       NAME : "Maravich, Peter (Press)",\r
+       ACTIVE : "1946 - 1946",\r
+       FROM : "College - Davis & Elkins",\r
+       TEAM_LOGO : "./images/nba_clippers.jpg"\r
+}, {\r
+       NAME : "Marble, Roy",\r
+       ACTIVE : "1989 - 1993",\r
+       FROM : "College - Iowa",\r
+       TEAM_LOGO : "./images/nba_rockets.jpg"\r
+}, {\r
+       NAME : "Marbury, Stephon",\r
+       ACTIVE : "2007 - 2008",\r
+       FROM : "College - Georgia Tech",\r
+       TEAM_LOGO : "./images/nba_warriors.jpg"\r
+}, {\r
+       NAME : "Marciulionis, Sarunas",\r
+       ACTIVE : "1989 - 1996",\r
+       FROM : "College - Vilnius (Lithuania)",\r
+       TEAM_LOGO : "./images/nba_76ers.jpg"\r
+}, {\r
+       NAME : "Mariaschin, Saul George",\r
+       ACTIVE : "1947 - 1947",\r
+       FROM : "College - Bloomsburg; Syracuse; Harvard",\r
+       TEAM_LOGO : "./images/nba_spurs.jpg"\r
+}, {\r
+       NAME : "Marin, John Warren (Jack)",\r
+       ACTIVE : "1966 - 1976",\r
+       FROM : "College - Duke",\r
+       TEAM_LOGO : "./images/nba_bucks.jpg"\r
+}, {\r
+       NAME : "Marion, Shawn",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - UNLV",\r
+       TEAM_LOGO : "./images/nba_lakers.jpg"\r
+}, {\r
+       NAME : "Markota, Damir",\r
+       ACTIVE : "2006 - 2006",\r
+       FROM : "From - Croatia",\r
+       TEAM_LOGO : "./images/nba_bulls.jpg"\r
+}, {\r
+       NAME : "N'diaye, Mamadou",\r
+       ACTIVE : "2000 - 2004",\r
+       FROM : "College - Auburn",\r
+       TEAM_LOGO : "./images/nba_griz.jpg"\r
+}, {\r
+       NAME : "Naber, Robert E. (Bob)",\r
+       ACTIVE : "1952 - 1952",\r
+       FROM : "College - Louisville",\r
+       TEAM_LOGO : "./images/nba_cavaliers.jpg"\r
+}, {\r
+       NAME : "Nachamkin, Boris Alexander",\r
+       ACTIVE : "1954 - 1954",\r
+       FROM : "College - N.Y.U.",\r
+       TEAM_LOGO : "./images/nba_griz.jpg"\r
+}, {\r
+       NAME : "Nachbar, Bostjan",\r
+       ACTIVE : "2007 - 2007",\r
+       FROM : "From - Slovenia",\r
+       TEAM_LOGO : "./images/nba_pistons.jpg"\r
+}, {\r
+       NAME : "Nagel, Gerald R. (Jerry)",\r
+       ACTIVE : "1949 - 1949",\r
+       FROM : "College - Loyola (Chicago)",\r
+       TEAM_LOGO : "./images/nba_griz.jpg"\r
+}, {\r
+       NAME : "Nagy, Frederick Karl (Fritz)",\r
+       ACTIVE : "1948 - 1948",\r
+       FROM : "College - North Carolina; Akron",\r
+       TEAM_LOGO : "./images/nba_griz.jpg"\r
+}, {\r
+       NAME : "Nailon, Lee",\r
+       ACTIVE : "2000 - 2005",\r
+       FROM : "College - Texas Christian",\r
+       TEAM_LOGO : "./images/nba_nuggets.jpg"\r
+}, {\r
+       NAME : "Najera, Eduardo",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Oklahoma",\r
+       TEAM_LOGO : "./images/nba_sonics.jpg"\r
+}, {\r
+       NAME : "Nance, Larry",\r
+       ACTIVE : "1981 - 1993",\r
+       FROM : "College - Clemson",\r
+       TEAM_LOGO : "./images/nba_heats.jpg"\r
+}, {\r
+       NAME : "Napolitano, Paul Wally",\r
+       ACTIVE : "1948 - 1948",\r
+       FROM : "College - San Francisco",\r
+       TEAM_LOGO : "./images/nba_warriors.jpg"\r
+}, {\r
+       NAME : "Nash, Charles Francis (Cotton)",\r
+       ACTIVE : "1964 - 1964",\r
+       FROM : "College - Kentucky",\r
+       TEAM_LOGO : "./images/nba_pacers.jpg"\r
+}, {\r
+       NAME : "Nash, Robert Lee Jr. (Bob)",\r
+       ACTIVE : "1972 - 1978",\r
+       FROM : "College - San Jacinto Coll. TX (J.C.); Hawaii",\r
+       TEAM_LOGO : "./images/nba_heats.jpg"\r
+}, {\r
+       NAME : "Nash, Steve",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Santa Clara",\r
+       TEAM_LOGO : "./images/nba_sonics.jpg"\r
+}, {\r
+       NAME : "Nater, Swen",\r
+       ACTIVE : "1976 - 1983",\r
+       FROM : "College - Cypress Coll. CA (J.C.); UCLA",\r
+       TEAM_LOGO : "./images/nba_lakers.jpg"\r
+}, {\r
+       NAME : "Nathan, Howard",\r
+       ACTIVE : "1995 - 1995",\r
+       FROM : "College - Louisiana-Monroe",\r
+       TEAM_LOGO : "./images/nba_pistons.jpg"\r
+}, {\r
+       NAME : "Natt, Calvin",\r
+       ACTIVE : "1979 - 1989",\r
+       FROM : "College - Louisiana-Monroe",\r
+       TEAM_LOGO : "./images/nba_kings.jpg"\r
+}, {\r
+       NAME : "Natt, Kenny",\r
+       ACTIVE : "1980 - 1984",\r
+       FROM : "College - Louisiana-Monroe",\r
+       TEAM_LOGO : "./images/nba_sonics.jpg"\r
+}, {\r
+       NAME : "Naulls, Willie",\r
+       ACTIVE : "1956 - 1965",\r
+       FROM : "College - UCLA",\r
+       TEAM_LOGO : "./images/nba_suns.jpg"\r
+}, {\r
+       NAME : "Navarro, Juan Carlos",\r
+       ACTIVE : "2007 - 2007",\r
+       FROM : "From - Spain",\r
+       TEAM_LOGO : "./images/nba_76ers.jpg"\r
+}, {\r
+       NAME : "Ndiaye, Hamady",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Rutgers",\r
+       TEAM_LOGO : "./images/nba_spurs.jpg"\r
+}, {\r
+       NAME : "Ndiaye, Makhtar",\r
+       ACTIVE : "1998 - 1998",\r
+       FROM : "College - North Carolina",\r
+       TEAM_LOGO : "./images/nba_cavaliers.jpg"\r
+}, {\r
+       NAME : "Ndong, Boniface",\r
+       ACTIVE : "2005 - 2005",\r
+       FROM : "-",\r
+       TEAM_LOGO : "./images/nba_nets.jpg"\r
+}, {\r
+       NAME : "Neal, Craig",\r
+       ACTIVE : "1988 - 1990",\r
+       FROM : "College - Georgia Tech",\r
+       TEAM_LOGO : "./images/nba_rockets.jpg"\r
+}, {\r
+       NAME : "Neal, Gary",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Towson",\r
+       TEAM_LOGO : "./images/nba_bulls.jpg"\r
+}, {\r
+       NAME : "Neal, James Ellerbe (Jim)",\r
+       ACTIVE : "1953 - 1954",\r
+       FROM : "College - Wofford",\r
+       TEAM_LOGO : "./images/nba_kings.jpg"\r
+}, {\r
+       NAME : "Neal, Lloyd",\r
+       ACTIVE : "1972 - 1978",\r
+       FROM : "College - Tennessee State",\r
+       TEAM_LOGO : "./images/nba_sonics.jpg"\r
+}, {\r
+       NAME : "Nealy, Ed",\r
+       ACTIVE : "1982 - 1992",\r
+       FROM : "College - Kansas State",\r
+       TEAM_LOGO : "./images/nba_magics.jpg"\r
+}, {\r
+       NAME : "Negratti, Albert Edward (Al)",\r
+       ACTIVE : "1946 - 1946",\r
+       FROM : "College - Seton Hall",\r
+       TEAM_LOGO : "./images/nba_clippers.jpg"\r
+}, {\r
+       NAME : "Nelson, Barry G.",\r
+       ACTIVE : "1971 - 1971",\r
+       FROM : "College - Duquesne",\r
+       TEAM_LOGO : "./images/nba_bucks.jpg"\r
+}, {\r
+       NAME : "Nelson, DeMarcus",\r
+       ACTIVE : "2008 - 2008",\r
+       FROM : "College - Duke",\r
+       TEAM_LOGO : "./images/nba_suns.jpg"\r
+}, {\r
+       NAME : "Nelson, Donald Arvid (Don, Nellie)",\r
+       ACTIVE : "1962 - 1975",\r
+       FROM : "College - Iowa",\r
+       TEAM_LOGO : "./images/nba_pistons.jpg"\r
+}, {\r
+       NAME : "Nelson, Jameer",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Saint Joseph's",\r
+       TEAM_LOGO : "./images/nba_clippers.jpg"\r
+}, {\r
+       NAME : "Nelson, Louis (Louie, Sweets)",\r
+       ACTIVE : "1973 - 1977",\r
+       FROM : "College - Washington",\r
+       TEAM_LOGO : "./images/nba_wizards.jpg"\r
+}, {\r
+       NAME : "Nembhard, Ruben",\r
+       ACTIVE : "1996 - 1996",\r
+       FROM : "College - Weber State",\r
+       TEAM_LOGO : "./images/nba_bobcats.jpg"\r
+}, {\r
+       NAME : "Nene",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "From - Sao Carlos, Brazil",\r
+       TEAM_LOGO : "./images/nba_sonics.jpg"\r
+}, {\r
+       NAME : "Nesby, Tyrone",\r
+       ACTIVE : "1998 - 2001",\r
+       FROM : "College - Vincennes IN (J.C.); Nevada-Las Vegas",\r
+       TEAM_LOGO : "./images/nba_bucks.jpg"\r
+}, {\r
+       NAME : "Nessley, Martin",\r
+       ACTIVE : "1987 - 1987",\r
+       FROM : "College - Duke",\r
+       TEAM_LOGO : "./images/nba_bucks.jpg"\r
+}, {\r
+       NAME : "Nesterovic, Rasho",\r
+       ACTIVE : "2007 - 2009",\r
+       FROM : "From - Ljubljana, Slovenia",\r
+       TEAM_LOGO : "./images/nba_heats.jpg"\r
+}, {\r
+       NAME : "Neumann, Johnny",\r
+       ACTIVE : "1976 - 1977",\r
+       FROM : "College - Mississippi",\r
+       TEAM_LOGO : "./images/nba_hawks.jpg"\r
+}, {\r
+       NAME : "Neumann, Paul R.",\r
+       ACTIVE : "1961 - 1966",\r
+       FROM : "College - Stanford",\r
+       TEAM_LOGO : "./images/nba_wizards.jpg"\r
+}, {\r
+       NAME : "Nevitt, Chuck",\r
+       ACTIVE : "1982 - 1993",\r
+       FROM : "College - North Carolina State",\r
+       TEAM_LOGO : "./images/nba_bucks.jpg"\r
+}, {\r
+       NAME : "Newbern, Melvin",\r
+       ACTIVE : "1992 - 1992",\r
+       FROM : "College - Minnesota",\r
+       TEAM_LOGO : "./images/nba_nuggets.jpg"\r
+}, {\r
+       NAME : "Newbill, Ivano",\r
+       ACTIVE : "1994 - 1997",\r
+       FROM : "College - Georgia Tech",\r
+       TEAM_LOGO : "./images/nba_celtics.jpg"\r
+}, {\r
+       NAME : "Newble, Ira",\r
+       ACTIVE : "2007 - 2007",\r
+       FROM : "College - Miami (Ohio)",\r
+       TEAM_LOGO : "./images/nba_griz.jpg"\r
+}, {\r
+       NAME : "Newlin, Mike",\r
+       ACTIVE : "1971 - 1981",\r
+       FROM : "College - Utah",\r
+       TEAM_LOGO : "./images/nba_bulls.jpg"\r
+}, {\r
+       NAME : "Newman, Johnny",\r
+       ACTIVE : "1986 - 2001",\r
+       FROM : "College - Richmond",\r
+       TEAM_LOGO : "./images/nba_bulls.jpg"\r
+}, {\r
+       NAME : "Newmark, David L. (Dave)",\r
+       ACTIVE : "1968 - 1969",\r
+       FROM : "College - Columbia",\r
+       TEAM_LOGO : "./images/nba_bucks.jpg"\r
+}, {\r
+       NAME : "Nichols, Demetris",\r
+       ACTIVE : "2007 - 2008",\r
+       FROM : "College - Syracuse",\r
+       TEAM_LOGO : "./images/nba_lakers.jpg"\r
+}, {\r
+       NAME : "Nichols, Jack Edward",\r
+       ACTIVE : "1948 - 1957",\r
+       FROM : "College - Washington; USC",\r
+       TEAM_LOGO : "./images/nba_suns.jpg"\r
+}, {\r
+       NAME : "Nickerson, Gaylon",\r
+       ACTIVE : "1996 - 1996",\r
+       FROM : "College - Wichita State; Butler Co. CC PA; Kansas State; Northwestern O",\r
+       TEAM_LOGO : "./images/nba_raptors.jpg"\r
+}, {\r
+       NAME : "O'Bannon, Charles",\r
+       ACTIVE : "1997 - 1998",\r
+       FROM : "College - UCLA",\r
+       TEAM_LOGO : "./images/nba_kings.jpg"\r
+}, {\r
+       NAME : "O'Bannon, Ed",\r
+       ACTIVE : "1995 - 1996",\r
+       FROM : "College - UCLA",\r
+       TEAM_LOGO : "./images/nba_celtics.jpg"\r
+}, {\r
+       NAME : "O'Koren, Mike",\r
+       ACTIVE : "1980 - 1987",\r
+       FROM : "College - North Carolina",\r
+       TEAM_LOGO : "./images/nba_timberwolves.jpg"\r
+}, {\r
+       NAME : "O'Sullivan, Dan",\r
+       ACTIVE : "1990 - 1995",\r
+       FROM : "College - Fordham",\r
+       TEAM_LOGO : "./images/nba_pistons.jpg"\r
+}, {\r
+       NAME : "O'Boyle, John W.",\r
+       ACTIVE : "1952 - 1952",\r
+       FROM : "College - Modesto JC CA; Colorado State",\r
+       TEAM_LOGO : "./images/nba_nets.jpg"\r
+}, {\r
+       NAME : "O'Brien, Ralph E. (Buckshot)",\r
+       ACTIVE : "1951 - 1952",\r
+       FROM : "College - Butler",\r
+       TEAM_LOGO : "./images/nba_cavaliers.jpg"\r
+}, {\r
+       NAME : "O'Brien, Robert (Bob)",\r
+       ACTIVE : "1947 - 1948",\r
+       FROM : "College - Kansas; Pepperdine",\r
+       TEAM_LOGO : "./images/nba_celtics.jpg"\r
+}, {\r
+       NAME : "O'Bryant, Patrick",\r
+       ACTIVE : "2007 - 2009",\r
+       FROM : "College - Bradley",\r
+       TEAM_LOGO : "./images/nba_trail.jpg"\r
+}, {\r
+       NAME : "O'Connell, Dermott F. (Dermie)",\r
+       ACTIVE : "1948 - 1949",\r
+       FROM : "College - Holy Cross",\r
+       TEAM_LOGO : "./images/nba_warriors.jpg"\r
+}, {\r
+       NAME : "O'Donnell, Andrew J. (Andy)",\r
+       ACTIVE : "1949 - 1949",\r
+       FROM : "College - Loyola (Balt.)",\r
+       TEAM_LOGO : "./images/nba_trail.jpg"\r
+}, {\r
+       NAME : "O'Grady, Francis David (Buddy)",\r
+       ACTIVE : "1946 - 1948",\r
+       FROM : "College - Georgetown",\r
+       TEAM_LOGO : "./images/nba_sonics.jpg"\r
+}, {\r
+       NAME : "O'Keefe, Richard T. (Dick)",\r
+       ACTIVE : "1947 - 1950",\r
+       FROM : "College - Santa Clara",\r
+       TEAM_LOGO : "./images/nba_bobcats.jpg"\r
+}, {\r
+       NAME : "O'Keefe, Thomas V. (Tommy)",\r
+       ACTIVE : "1950 - 1950",\r
+       FROM : "College - Notre Dame; Georgetown",\r
+       TEAM_LOGO : "./images/nba_nets.jpg"\r
+}, {\r
+       NAME : "O'Malley, V. Grady (Grady)",\r
+       ACTIVE : "1969 - 1969",\r
+       FROM : "College - Manhattan",\r
+       TEAM_LOGO : "./images/nba_magics.jpg"\r
+}, {\r
+       NAME : "O'Neal, Jermaine",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "High School - Eau Claire HS (SC)",\r
+       TEAM_LOGO : "./images/nba_bulls.jpg"\r
+}, {\r
+       NAME : "O'Neal, Shaquille",\r
+       ACTIVE : "2007 - 2010",\r
+       FROM : "College - Louisiana State",\r
+       TEAM_LOGO : "./images/nba_nuggets.jpg"\r
+}, {\r
+       NAME : "O'Neill, Mike",\r
+       ACTIVE : "1952 - 1952",\r
+       FROM : "College - California",\r
+       TEAM_LOGO : "./images/nba_bobcats.jpg"\r
+}, {\r
+       NAME : "O'Shea, Kevin Christopher",\r
+       ACTIVE : "1950 - 1952",\r
+       FROM : "College - Notre Dame",\r
+       TEAM_LOGO : "./images/nba_spurs.jpg"\r
+}, {\r
+       NAME : "O'Shields, Garland L. (Mule)",\r
+       ACTIVE : "1946 - 1946",\r
+       FROM : "College - Spartanburg Tech SC (J.C.); Tennessee",\r
+       TEAM_LOGO : "./images/nba_wizards.jpg"\r
+}, {\r
+       NAME : "Oakley, Charles",\r
+       ACTIVE : "1985 - 2003",\r
+       FROM : "College - Virginia Union ''85",\r
+       TEAM_LOGO : "./images/nba_mavericks.jpg"\r
+}, {\r
+       NAME : "Oberto, Fabricio",\r
+       ACTIVE : "2007 - 2010",\r
+       FROM : "From - Las Varillas, Argentina",\r
+       TEAM_LOGO : "./images/nba_pistons.jpg"\r
+}, {\r
+       NAME : "Oden, Greg",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Ohio State",\r
+       TEAM_LOGO : "./images/nba_raptors.jpg"\r
+}, {\r
+       NAME : "Odom, Lamar",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Rhode Island",\r
+       TEAM_LOGO : "./images/nba_kings.jpg"\r
+}, {\r
+       NAME : "Ogden, Carlos (Bud)",\r
+       ACTIVE : "1969 - 1970",\r
+       FROM : "College - Santa Clara",\r
+       TEAM_LOGO : "./images/nba_spurs.jpg"\r
+}, {\r
+       NAME : "Ogden, Ralph",\r
+       ACTIVE : "1970 - 1970",\r
+       FROM : "College - Santa Clara",\r
+       TEAM_LOGO : "./images/nba_kings.jpg"\r
+}, {\r
+       NAME : "Ogg, Alan",\r
+       ACTIVE : "1990 - 1992",\r
+       FROM : "College - Alabama-Birmingham",\r
+       TEAM_LOGO : "./images/nba_bobcats.jpg"\r
+}, {\r
+       NAME : "Ohl, Donald Jay (Don)",\r
+       ACTIVE : "1960 - 1969",\r
+       FROM : "College - Illinois",\r
+       TEAM_LOGO : "./images/nba_heats.jpg"\r
+}, {\r
+       NAME : "Okafor, Emeka",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Connecticut",\r
+       TEAM_LOGO : "./images/nba_rockets.jpg"\r
+}, {\r
+       NAME : "Okur, Mehmet",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "From - Yalova, Turkey",\r
+       TEAM_LOGO : "./images/nba_nets.jpg"\r
+}, {\r
+       NAME : "Olajuwon, Hakeem",\r
+       ACTIVE : "1984 - 2001",\r
+       FROM : "College - Houston ''84",\r
+       TEAM_LOGO : "./images/nba_rockets.jpg"\r
+}, {\r
+       NAME : "Olberding, Mark",\r
+       ACTIVE : "1976 - 1986",\r
+       FROM : "College - Minnesota",\r
+       TEAM_LOGO : "./images/nba_bulls.jpg"\r
+}, {\r
+       NAME : "Oldham, Jawann",\r
+       ACTIVE : "1980 - 1990",\r
+       FROM : "College - Seattle",\r
+       TEAM_LOGO : "./images/nba_celtics.jpg"\r
+}, {\r
+       NAME : "Oldham, John O. (Johnny)",\r
+       ACTIVE : "1949 - 1950",\r
+       FROM : "College - Western Kentucky",\r
+       TEAM_LOGO : "./images/nba_griz.jpg"\r
+}, {\r
+       NAME : "Oleynick, Frank (Magic)",\r
+       ACTIVE : "1975 - 1976",\r
+       FROM : "College - Seattle",\r
+       TEAM_LOGO : "./images/nba_knics.jpg"\r
+}, {\r
+       NAME : "Olive, John",\r
+       ACTIVE : "1978 - 1979",\r
+       FROM : "College - Villanova",\r
+       TEAM_LOGO : "./images/nba_bulls.jpg"\r
+}, {\r
+       NAME : "Oliver, Brian",\r
+       ACTIVE : "1990 - 1997",\r
+       FROM : "College - Georgia Tech",\r
+       TEAM_LOGO : "./images/nba_celtics.jpg"\r
+}, {\r
+       NAME : "Oliver, Dean",\r
+       ACTIVE : "2001 - 2002",\r
+       FROM : "College - Iowa ''01",\r
+       TEAM_LOGO : "./images/nba_rockets.jpg"\r
+}, {\r
+       NAME : "Oliver, Jimmy",\r
+       ACTIVE : "1991 - 1998",\r
+       FROM : "College - Purdue",\r
+       TEAM_LOGO : "./images/nba_mavericks.jpg"\r
+}, {\r
+       NAME : "Ollie, Kevin",\r
+       ACTIVE : "2007 - 2009",\r
+       FROM : "College - Connecticut",\r
+       TEAM_LOGO : "./images/nba_raptors.jpg"\r
+}, {\r
+       NAME : "Ollrich, Gene W. (Moe)",\r
+       ACTIVE : "1949 - 1949",\r
+       FROM : "College - Drake",\r
+       TEAM_LOGO : "./images/nba_hawks.jpg"\r
+}, {\r
+       NAME : "Olowokandi, Michael",\r
+       ACTIVE : "1998 - 2006",\r
+       FROM : "College - U. of Pacific",\r
+       TEAM_LOGO : "./images/nba_hawks.jpg"\r
+}, {\r
+       NAME : "Olsen, Enoch Eli III (Bud)",\r
+       ACTIVE : "1962 - 1968",\r
+       FROM : "College - Louisville",\r
+       TEAM_LOGO : "./images/nba_knics.jpg"\r
+}, {\r
+       NAME : "Orms, Barry D.",\r
+       ACTIVE : "1968 - 1968",\r
+       FROM : "College - St. Louis",\r
+       TEAM_LOGO : "./images/nba_suns.jpg"\r
+}, {\r
+       NAME : "Orr, John M. (Johnny)",\r
+       ACTIVE : "1949 - 1949",\r
+       FROM : "College - Beloit; Illinois",\r
+       TEAM_LOGO : "./images/nba_nets.jpg"\r
+}, {\r
+       NAME : "Orr, Louis",\r
+       ACTIVE : "1980 - 1987",\r
+       FROM : "College - Syracuse",\r
+       TEAM_LOGO : "./images/nba_warriors.jpg"\r
+}, {\r
+       NAME : "Ortiz, Jose",\r
+       ACTIVE : "1988 - 1989",\r
+       FROM : "College - Oregon State",\r
+       TEAM_LOGO : "./images/nba_bobcats.jpg"\r
+}, {\r
+       NAME : "Osborne, Charles H. (Chuck)",\r
+       ACTIVE : "1961 - 1961",\r
+       FROM : "College - Western Kentucky",\r
+       TEAM_LOGO : "./images/nba_rockets.jpg"\r
+}, {\r
+       NAME : "Osterkorn, Walter Raymond (Wally)",\r
+       ACTIVE : "1951 - 1954",\r
+       FROM : "College - Illinois",\r
+       TEAM_LOGO : "./images/nba_magics.jpg"\r
+}, {\r
+       NAME : "Ostertag, Greg",\r
+       ACTIVE : "1995 - 2005",\r
+       FROM : "College - Kansas",\r
+       TEAM_LOGO : "./images/nba_bobcats.jpg"\r
+}, {\r
+       NAME : "Othick, Matt",\r
+       ACTIVE : "1992 - 1992",\r
+       FROM : "College - Arizona",\r
+       TEAM_LOGO : "./images/nba_jazz.jpg"\r
+}, {\r
+       NAME : "Pace, Joseph (Joe)",\r
+       ACTIVE : "1976 - 1977",\r
+       FROM : "College - Maryland East. Shore; Coppin State",\r
+       TEAM_LOGO : "./images/nba_warriors.jpg"\r
+}, {\r
+       NAME : "Pachulia, Zaza",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "From - Tbilisi, Georgia",\r
+       TEAM_LOGO : "./images/nba_clippers.jpg"\r
+}, {\r
+       NAME : "Pack, Robert",\r
+       ACTIVE : "1991 - 2003",\r
+       FROM : "College - USC",\r
+       TEAM_LOGO : "./images/nba_timberwolves.jpg"\r
+}, {\r
+       NAME : "Paddio, Gerald",\r
+       ACTIVE : "1990 - 1993",\r
+       FROM : "College - Seminole JC OK; Kilgore Coll. TX (J.C.); Nevada-Las Vegas",\r
+       TEAM_LOGO : "./images/nba_warriors.jpg"\r
+}, {\r
+       NAME : "Padgett, Scott",\r
+       ACTIVE : "1999 - 2006",\r
+       FROM : "College - Kentucky",\r
+       TEAM_LOGO : "./images/nba_timberwolves.jpg"\r
+}, {\r
+       NAME : "Paine, Frederick Vincent Jr. (Fred)",\r
+       ACTIVE : "1948 - 1948",\r
+       FROM : "College - Westminster (PA)",\r
+       TEAM_LOGO : "./images/nba_bucks.jpg"\r
+}, {\r
+       NAME : "Palacio, Milt",\r
+       ACTIVE : "1999 - 2005",\r
+       FROM : "College - Colorado State",\r
+       TEAM_LOGO : "./images/nba_bobcats.jpg"\r
+}, {\r
+       NAME : "Palazzi, Togo Anthony",\r
+       ACTIVE : "1954 - 1959",\r
+       FROM : "College - Holy Cross",\r
+       TEAM_LOGO : "./images/nba_spurs.jpg"\r
+}, {\r
+       NAME : "Palmer, James G. (Jim)",\r
+       ACTIVE : "1958 - 1960",\r
+       FROM : "College - Dayton",\r
+       TEAM_LOGO : "./images/nba_celtics.jpg"\r
+}, {\r
+       NAME : "Palmer, John S. (Bud)",\r
+       ACTIVE : "1946 - 1948",\r
+       FROM : "College - Princeton",\r
+       TEAM_LOGO : "./images/nba_nuggets.jpg"\r
+}, {\r
+       NAME : "Palmer, Walter",\r
+       ACTIVE : "1990 - 1992",\r
+       FROM : "College - Dartmouth",\r
+       TEAM_LOGO : "./images/nba_timberwolves.jpg"\r
+}, {\r
+       NAME : "Panko, Andy",\r
+       ACTIVE : "2000 - 2000",\r
+       FROM : "College - Lebanon Valley",\r
+       TEAM_LOGO : "./images/nba_lakers.jpg"\r
+}, {\r
+       NAME : "Pargo, Jannero",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Arkansas",\r
+       TEAM_LOGO : "./images/nba_wizards.jpg"\r
+}, {\r
+       NAME : "Parham, Estes Foster (Easy)",\r
+       ACTIVE : "1948 - 1950",\r
+       FROM : "College - Texas Wesleyan",\r
+       TEAM_LOGO : "./images/nba_nets.jpg"\r
+}, {\r
+       NAME : "Parish, Robert",\r
+       ACTIVE : "1976 - 1996",\r
+       FROM : "College - Centenary",\r
+       TEAM_LOGO : "./images/nba_magics.jpg"\r
+}, {\r
+       NAME : "Park, Medford R. (Med)",\r
+       ACTIVE : "1955 - 1959",\r
+       FROM : "College - Missouri",\r
+       TEAM_LOGO : "./images/nba_kings.jpg"\r
+}, {\r
+       NAME : "Parker, Anthony",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Bradley",\r
+       TEAM_LOGO : "./images/nba_magics.jpg"\r
+}, {\r
+       NAME : "Parker, Robert S. Jr. (Sonny)",\r
+       ACTIVE : "1976 - 1981",\r
+       FROM : "College - Mineral Area Coll. MO (J.C.); Texas A&M",\r
+       TEAM_LOGO : "./images/nba_sonics.jpg"\r
+}, {\r
+       NAME : "Parker, Smush",\r
+       ACTIVE : "2007 - 2007",\r
+       FROM : "College - Fordham",\r
+       TEAM_LOGO : "./images/nba_nets.jpg"\r
+}, {\r
+       NAME : "Parker, Tony",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "From - Paris, France",\r
+       TEAM_LOGO : "./images/nba_magics.jpg"\r
+}, {\r
+       NAME : "Parkinson, Jack Gordon",\r
+       ACTIVE : "1949 - 1949",\r
+       FROM : "College - Kentucky",\r
+       TEAM_LOGO : "./images/nba_mavericks.jpg"\r
+}, {\r
+       NAME : "Parks, Cherokee",\r
+       ACTIVE : "1995 - 2003",\r
+       FROM : "College - Duke ''95",\r
+       TEAM_LOGO : "./images/nba_pistons.jpg"\r
+}, {\r
+       NAME : "Parr, Jack",\r
+       ACTIVE : "1958 - 1958",\r
+       FROM : "College - Kansas State",\r
+       TEAM_LOGO : "./images/nba_trail.jpg"\r
+}, {\r
+       NAME : "Parrack, Doyle Kenneth",\r
+       ACTIVE : "1946 - 1946",\r
+       FROM : "College - Oklahoma State",\r
+       TEAM_LOGO : "./images/nba_wizards.jpg"\r
+}, {\r
+       NAME : "Parsley, Charles H. (Charlie)",\r
+       ACTIVE : "1949 - 1949",\r
+       FROM : "College - Western Kentucky",\r
+       TEAM_LOGO : "./images/nba_suns.jpg"\r
+}, {\r
+       NAME : "Paspalj, Zarko",\r
+       ACTIVE : "1989 - 1989",\r
+       FROM : "College - No College",\r
+       TEAM_LOGO : "./images/nba_jazz.jpg"\r
+}, {\r
+       NAME : "Passaglia, Martin Harold (Marty)",\r
+       ACTIVE : "1946 - 1948",\r
+       FROM : "College - Santa Clara",\r
+       TEAM_LOGO : "./images/nba_rockets.jpg"\r
+}, {\r
+       NAME : "Pastushok, George A.",\r
+       ACTIVE : "1946 - 1946",\r
+       FROM : "College - Manhattan; St. John's (N.Y.)",\r
+       TEAM_LOGO : "./images/nba_pistons.jpg"\r
+}, {\r
+       NAME : "Patrick, Myles",\r
+       ACTIVE : "1980 - 1980",\r
+       FROM : "College - Auburn",\r
+       TEAM_LOGO : "./images/nba_raptors.jpg"\r
+}, {\r
+       NAME : "Patrick, Stanley A. (Stan)",\r
+       ACTIVE : "1949 - 1949",\r
+       FROM : "College - Santa Clara; Illinois",\r
+       TEAM_LOGO : "./images/nba_sonics.jpg"\r
+}, {\r
+       NAME : "Patterson, Andrae",\r
+       ACTIVE : "1998 - 1999",\r
+       FROM : "College - Indiana",\r
+       TEAM_LOGO : "./images/nba_cavaliers.jpg"\r
+}, {\r
+       NAME : "Patterson, George",\r
+       ACTIVE : "1967 - 1967",\r
+       FROM : "College - Toledo",\r
+       TEAM_LOGO : "./images/nba_rockets.jpg"\r
+}, {\r
+       NAME : "Patterson, Patrick",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Kentucky",\r
+       TEAM_LOGO : "./images/nba_trail.jpg"\r
+}, {\r
+       NAME : "Patterson, Ruben",\r
+       ACTIVE : "2007 - 2007",\r
+       FROM : "College - Cincinnati",\r
+       TEAM_LOGO : "./images/nba_warriors.jpg"\r
+}, {\r
+       NAME : "Patterson, Steven J. (Steve)",\r
+       ACTIVE : "1971 - 1975",\r
+       FROM : "College - UCLA",\r
+       TEAM_LOGO : "./images/nba_knics.jpg"\r
+}, {\r
+       NAME : "Patterson, Tommie J. (Tommy)",\r
+       ACTIVE : "1972 - 1973",\r
+       FROM : "College - Ouachita Baptist",\r
+       TEAM_LOGO : "./images/nba_rockets.jpg"\r
+}, {\r
+       NAME : "Patterson, Worthington R. (Worthy)",\r
+       ACTIVE : "1957 - 1957",\r
+       FROM : "College - Connecticut",\r
+       TEAM_LOGO : "./images/nba_lakers.jpg"\r
+}, {\r
+       NAME : "Paul, Chris",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Wake Forest",\r
+       TEAM_LOGO : "./images/nba_sonics.jpg"\r
+}, {\r
+       NAME : "Paulk, Charles (Charlie)",\r
+       ACTIVE : "1968 - 1971",\r
+       FROM : "College - Tulsa; Northeastern State (Okla.)",\r
+       TEAM_LOGO : "./images/nba_warriors.jpg"\r
+}, {\r
+       NAME : "Paulson, Gerald Arthur (Jerry)",\r
+       ACTIVE : "1957 - 1957",\r
+       FROM : "College - Manhattan",\r
+       TEAM_LOGO : "./images/nba_heats.jpg"\r
+}, {\r
+       NAME : "Paultz, Billy",\r
+       ACTIVE : "1976 - 1984",\r
+       FROM : "College - Cameron; St. John's (N.Y.)",\r
+       TEAM_LOGO : "./images/nba_bucks.jpg"\r
+}, {\r
+       NAME : "Pavlovic, Aleksandar",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "From - Bar, Montenegro",\r
+       TEAM_LOGO : "./images/nba_rockets.jpg"\r
+}, {\r
+       NAME : "Paxson, James Edward Sr. (Jim)",\r
+       ACTIVE : "1956 - 1957",\r
+       FROM : "College - Dayton",\r
+       TEAM_LOGO : "./images/nba_jazz.jpg"\r
+}, {\r
+       NAME : "Paxson, Jim",\r
+       ACTIVE : "1979 - 1989",\r
+       FROM : "College - Dayton",\r
+       TEAM_LOGO : "./images/nba_pacers.jpg"\r
+}, {\r
+       NAME : "Paxson, John",\r
+       ACTIVE : "1983 - 1993",\r
+       FROM : "College - Notre Dame",\r
+       TEAM_LOGO : "./images/nba_hawks.jpg"\r
+}, {\r
+       NAME : "Payak, John Jr. (Johnny)",\r
+       ACTIVE : "1949 - 1952",\r
+       FROM : "College - Bowling Green State",\r
+       TEAM_LOGO : "./images/nba_hawks.jpg"\r
+}, {\r
+       NAME : "Payne, Kenny",\r
+       ACTIVE : "1989 - 1992",\r
+       FROM : "College - Louisville",\r
+       TEAM_LOGO : "./images/nba_raptors.jpg"\r
+}, {\r
+       NAME : "Payne, Tom",\r
+       ACTIVE : "1971 - 1971",\r
+       FROM : "College - Kentucky",\r
+       TEAM_LOGO : "./images/nba_knics.jpg"\r
+}, {\r
+       NAME : "Payton, Gary",\r
+       ACTIVE : "1990 - 2006",\r
+       FROM : "College - Oregon State",\r
+       TEAM_LOGO : "./images/nba_warriors.jpg"\r
+}, {\r
+       NAME : "Payton, Melvin E. (Mel)",\r
+       ACTIVE : "1951 - 1952",\r
+       FROM : "College - Tulane",\r
+       TEAM_LOGO : "./images/nba_bulls.jpg"\r
+}, {\r
+       NAME : "Quick, Robert L. (Bob)",\r
+       ACTIVE : "1968 - 1971",\r
+       FROM : "College - Xavier (Ohio)",\r
+       TEAM_LOGO : "./images/nba_rockets.jpg"\r
+}, {\r
+       NAME : "Quinn, Chris",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Notre Dame",\r
+       TEAM_LOGO : "./images/nba_jazz.jpg"\r
+}, {\r
+       NAME : "Quinnett, Brian",\r
+       ACTIVE : "1989 - 1991",\r
+       FROM : "College - Washington State",\r
+       TEAM_LOGO : "./images/nba_timberwolves.jpg"\r
+}, {\r
+       NAME : "Rackley, Luther Jr. (Luke)",\r
+       ACTIVE : "1969 - 1973",\r
+       FROM : "College - Xavier (Ohio)",\r
+       TEAM_LOGO : "./images/nba_76ers.jpg"\r
+}, {\r
+       NAME : "Rader, Howard (Howie)",\r
+       ACTIVE : "1948 - 1948",\r
+       FROM : "College - Long Island University",\r
+       TEAM_LOGO : "./images/nba_griz.jpg"\r
+}, {\r
+       NAME : "Radford, Mark",\r
+       ACTIVE : "1981 - 1982",\r
+       FROM : "College - Oregon State",\r
+       TEAM_LOGO : "./images/nba_bulls.jpg"\r
+}, {\r
+       NAME : "Radford, Wayne",\r
+       ACTIVE : "1978 - 1978",\r
+       FROM : "College - Indiana",\r
+       TEAM_LOGO : "./images/nba_sonics.jpg"\r
+}, {\r
+       NAME : "Radja, Dino",\r
+       ACTIVE : "1993 - 1996",\r
+       FROM : "College - Croatia",\r
+       TEAM_LOGO : "./images/nba_lakers.jpg"\r
+}, {\r
+       NAME : "Radmanovic, Vladimir",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "From - Belgrade, Serbia",\r
+       TEAM_LOGO : "./images/nba_bucks.jpg"\r
+}, {\r
+       NAME : "Radojevic, Aleksandar",\r
+       ACTIVE : "1999 - 2004",\r
+       FROM : "From - Serbia-Montenegro",\r
+       TEAM_LOGO : "./images/nba_celtics.jpg"\r
+}, {\r
+       NAME : "Radovich, Frank Raymond",\r
+       ACTIVE : "1961 - 1961",\r
+       FROM : "College - Indiana",\r
+       TEAM_LOGO : "./images/nba_griz.jpg"\r
+}, {\r
+       NAME : "Radovich, George Lewis (Moe)",\r
+       ACTIVE : "1952 - 1952",\r
+       FROM : "College - Wyoming",\r
+       TEAM_LOGO : "./images/nba_bulls.jpg"\r
+}, {\r
+       NAME : "Radziszewski, Raymond A. (Ray)",\r
+       ACTIVE : "1957 - 1957",\r
+       FROM : "College - St. Joseph's (PA)",\r
+       TEAM_LOGO : "./images/nba_rockets.jpg"\r
+}, {\r
+       NAME : "Ragelis, Raymond Ernest (Ray)",\r
+       ACTIVE : "1951 - 1951",\r
+       FROM : "College - Northwestern",\r
+       TEAM_LOGO : "./images/nba_wizards.jpg"\r
+}, {\r
+       NAME : "Raiken, Sherwin H.",\r
+       ACTIVE : "1952 - 1952",\r
+       FROM : "College - Villanova",\r
+       TEAM_LOGO : "./images/nba_warriors.jpg"\r
+}, {\r
+       NAME : "Rains, Ed",\r
+       ACTIVE : "1981 - 1982",\r
+       FROM : "College - South Alabama",\r
+       TEAM_LOGO : "./images/nba_bulls.jpg"\r
+}, {\r
+       NAME : "Rakocevic, Igor",\r
+       ACTIVE : "2002 - 2002",\r
+       FROM : "College - No College",\r
+       TEAM_LOGO : "./images/nba_bucks.jpg"\r
+}, {\r
+       NAME : "Rambis, Kurt",\r
+       ACTIVE : "1981 - 1994",\r
+       FROM : "College - Santa Clara",\r
+       TEAM_LOGO : "./images/nba_lakers.jpg"\r
+}, {\r
+       NAME : "Ramos, Peter",\r
+       ACTIVE : "2004 - 2004",\r
+       FROM : "From - Puerto Rico",\r
+       TEAM_LOGO : "./images/nba_hawks.jpg"\r
+}, {\r
+       NAME : "Ramsey, Calvin (Cal)",\r
+       ACTIVE : "1959 - 1960",\r
+       FROM : "College - N.Y.U.",\r
+       TEAM_LOGO : "./images/nba_trail.jpg"\r
+}, {\r
+       NAME : "Ramsey, Frank",\r
+       ACTIVE : "1954 - 1963",\r
+       FROM : "College - Kentucky",\r
+       TEAM_LOGO : "./images/nba_jazz.jpg"\r
+}, {\r
+       NAME : "Ramsey, Raymond Leroy (Ray)",\r
+       ACTIVE : "1948 - 1948",\r
+       FROM : "College - Bradley",\r
+       TEAM_LOGO : "./images/nba_magics.jpg"\r
+}, {\r
+       NAME : "Randall, Mark",\r
+       ACTIVE : "1991 - 1994",\r
+       FROM : "College - Kansas",\r
+       TEAM_LOGO : "./images/nba_timberwolves.jpg"\r
+}, {\r
+       NAME : "Randolph, Anthony",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Louisiana State",\r
+       TEAM_LOGO : "./images/nba_wizards.jpg"\r
+}, {\r
+       NAME : "Randolph, Shavlik",\r
+       ACTIVE : "2007 - 2009",\r
+       FROM : "College - Duke",\r
+       TEAM_LOGO : "./images/nba_raptors.jpg"\r
+}, {\r
+       NAME : "Randolph, Zach",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Michigan State",\r
+       TEAM_LOGO : "./images/nba_hawks.jpg"\r
+}, {\r
+       NAME : "Rank, Wallace Aliifua (Wally)",\r
+       ACTIVE : "1980 - 1980",\r
+       FROM : "College - San Jose State",\r
+       TEAM_LOGO : "./images/nba_jazz.jpg"\r
+}, {\r
+       NAME : "Ransey, Kelvin",\r
+       ACTIVE : "1980 - 1985",\r
+       FROM : "College - Ohio State",\r
+       TEAM_LOGO : "./images/nba_bulls.jpg"\r
+}, {\r
+       NAME : "Ranzino, Samuel Salvadore (Sam)",\r
+       ACTIVE : "1951 - 1951",\r
+       FROM : "College - North Carolina State",\r
+       TEAM_LOGO : "./images/nba_hawks.jpg"\r
+}, {\r
+       NAME : "Rasmussen, Blair",\r
+       ACTIVE : "1985 - 1992",\r
+       FROM : "College - Oregon",\r
+       TEAM_LOGO : "./images/nba_rockets.jpg"\r
+}, {\r
+       NAME : "Ratkovicz, George",\r
+       ACTIVE : "1949 - 1954",\r
+       FROM : "College - No College",\r
+       TEAM_LOGO : "./images/nba_clippers.jpg"\r
+}, {\r
+       NAME : "Ratleff, Ed",\r
+       ACTIVE : "1973 - 1977",\r
+       FROM : "College - Long Beach State",\r
+       TEAM_LOGO : "./images/nba_honets.jpg"\r
+}, {\r
+       NAME : "Ratliff, Michael D. (Mike)",\r
+       ACTIVE : "1972 - 1973",\r
+       FROM : "College - Wis.-Eau Claire",\r
+       TEAM_LOGO : "./images/nba_trail.jpg"\r
+}, {\r
+       NAME : "Ratliff, Theo",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Wyoming",\r
+       TEAM_LOGO : "./images/nba_spurs.jpg"\r
+}, {\r
+       NAME : "Rautins, Andy",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Syracuse",\r
+       TEAM_LOGO : "./images/nba_magics.jpg"\r
+}, {\r
+       NAME : "Rautins, Leo",\r
+       ACTIVE : "1983 - 1984",\r
+       FROM : "College - Minnesota; Syracuse",\r
+       TEAM_LOGO : "./images/nba_76ers.jpg"\r
+}, {\r
+       NAME : "Ray, Allan",\r
+       ACTIVE : "2006 - 2006",\r
+       FROM : "College - Villanova",\r
+       TEAM_LOGO : "./images/nba_pistons.jpg"\r
+}, {\r
+       NAME : "Ray, Clifford",\r
+       ACTIVE : "1971 - 1980",\r
+       FROM : "College - Oklahoma",\r
+       TEAM_LOGO : "./images/nba_suns.jpg"\r
+}, {\r
+       NAME : "Ray, Donald L. (Don, Duck)",\r
+       ACTIVE : "1949 - 1949",\r
+       FROM : "College - Western Kentucky",\r
+       TEAM_LOGO : "./images/nba_heats.jpg"\r
+}, {\r
+       NAME : "Ray, James E. (Jim)",\r
+       ACTIVE : "1956 - 1959",\r
+       FROM : "College - Toledo",\r
+       TEAM_LOGO : "./images/nba_lakers.jpg"\r
+}, {\r
+       NAME : "Ray, James Earl",\r
+       ACTIVE : "1980 - 1982",\r
+       FROM : "College - Jacksonville",\r
+       TEAM_LOGO : "./images/nba_bucks.jpg"\r
+}, {\r
+       NAME : "Raymond, Craig Milford",\r
+       ACTIVE : "1968 - 1968",\r
+       FROM : "College - Brigham Young",\r
+       TEAM_LOGO : "./images/nba_suns.jpg"\r
+}, {\r
+       NAME : "Rea, Connie Mack",\r
+       ACTIVE : "1953 - 1953",\r
+       FROM : "College - Centenary; Vanderbilt",\r
+       TEAM_LOGO : "./images/nba_76ers.jpg"\r
+}, {\r
+       NAME : "Reaves, Joe L.",\r
+       ACTIVE : "1973 - 1973",\r
+       FROM : "College - Bethel College (Tenn.)",\r
+       TEAM_LOGO : "./images/nba_pistons.jpg"\r
+}, {\r
+       NAME : "Rebraca, Zeljko",\r
+       ACTIVE : "2001 - 2005",\r
+       FROM : "From - Serbia & Montenegro",\r
+       TEAM_LOGO : "./images/nba_nuggets.jpg"\r
+}, {\r
+       NAME : "Recasner, Eldridge",\r
+       ACTIVE : "1994 - 2001",\r
+       FROM : "College - Washington",\r
+       TEAM_LOGO : "./images/nba_heats.jpg"\r
+}, {\r
+       NAME : "Redd, Michael",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Ohio State",\r
+       TEAM_LOGO : "./images/nba_bucks.jpg"\r
+}, {\r
+       NAME : "Reddout, Franklin P. (Frank)",\r
+       ACTIVE : "1953 - 1953",\r
+       FROM : "College - Syracuse",\r
+       TEAM_LOGO : "./images/nba_magics.jpg"\r
+}, {\r
+       NAME : "Redick, J.J.",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Duke",\r
+       TEAM_LOGO : "./images/nba_raptors.jpg"\r
+}, {\r
+       NAME : "Redmond, Marlon Bernard",\r
+       ACTIVE : "1978 - 1979",\r
+       FROM : "College - San Francisco",\r
+       TEAM_LOGO : "./images/nba_knics.jpg"\r
+}, {\r
+       NAME : "Reed, Hubert F. (Hub)",\r
+       ACTIVE : "1958 - 1964",\r
+       FROM : "College - Oklahoma City",\r
+       TEAM_LOGO : "./images/nba_bucks.jpg"\r
+}, {\r
+       NAME : "Reed, Justin",\r
+       ACTIVE : "2004 - 2006",\r
+       FROM : "College - Mississippi",\r
+       TEAM_LOGO : "./images/nba_bulls.jpg"\r
+}, {\r
+       NAME : "Reed, Ronald Lee (Ron)",\r
+       ACTIVE : "1965 - 1966",\r
+       FROM : "College - Notre Dame",\r
+       TEAM_LOGO : "./images/nba_nets.jpg"\r
+}, {\r
+       NAME : "Sabonis, Arvydas",\r
+       ACTIVE : "1995 - 2002",\r
+       FROM : "From - Lithuania",\r
+       TEAM_LOGO : "./images/nba_suns.jpg"\r
+}, {\r
+       NAME : "Sadowski, Edward Frank (Ed, Big Ed)",\r
+       ACTIVE : "1946 - 1949",\r
+       FROM : "College - Seton Hall",\r
+       TEAM_LOGO : "./images/nba_trail.jpg"\r
+}, {\r
+       NAME : "Sailors, Kenneth L. (Kenny)",\r
+       ACTIVE : "1946 - 1950",\r
+       FROM : "College - Wyoming",\r
+       TEAM_LOGO : "./images/nba_sonics.jpg"\r
+}, {\r
+       NAME : "Salley, John",\r
+       ACTIVE : "1986 - 1999",\r
+       FROM : "College - Georgia Tech",\r
+       TEAM_LOGO : "./images/nba_timberwolves.jpg"\r
+}, {\r
+       NAME : "Salmons, John",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Miami (Fla.)",\r
+       TEAM_LOGO : "./images/nba_spurs.jpg"\r
+}, {\r
+       NAME : "Salvadori, Kevin",\r
+       ACTIVE : "1996 - 1997",\r
+       FROM : "College - North Carolina",\r
+       TEAM_LOGO : "./images/nba_knics.jpg"\r
+}, {\r
+       NAME : "Samake, Soumaila",\r
+       ACTIVE : "2000 - 2002",\r
+       FROM : "From - Republic of Mali",\r
+       TEAM_LOGO : "./images/nba_pacers.jpg"\r
+}, {\r
+       NAME : "Samb, Cheikh",\r
+       ACTIVE : "2007 - 2008",\r
+       FROM : "From - Senegal",\r
+       TEAM_LOGO : "./images/nba_bulls.jpg"\r
+}, {\r
+       NAME : "Sampson, Jamal",\r
+       ACTIVE : "2002 - 2006",\r
+       FROM : "College - California",\r
+       TEAM_LOGO : "./images/nba_knics.jpg"\r
+}, {\r
+       NAME : "Sampson, Ralph",\r
+       ACTIVE : "1983 - 1991",\r
+       FROM : "College - Virginia",\r
+       TEAM_LOGO : "./images/nba_clippers.jpg"\r
+}, {\r
+       NAME : "Samuels, Samardo",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Louisville",\r
+       TEAM_LOGO : "./images/nba_nuggets.jpg"\r
+}, {\r
+       NAME : "Sanchez, Pepe",\r
+       ACTIVE : "2000 - 2002",\r
+       FROM : "College - Temple ''00",\r
+       TEAM_LOGO : "./images/nba_lakers.jpg"\r
+}, {\r
+       NAME : "Sanders, Frankie J. (Frankie J.)",\r
+       ACTIVE : "1978 - 1980",\r
+       FROM : "College - Southern University",\r
+       TEAM_LOGO : "./images/nba_nuggets.jpg"\r
+}, {\r
+       NAME : "Sanders, Jeff",\r
+       ACTIVE : "1989 - 1992",\r
+       FROM : "College - Georgia Southern",\r
+       TEAM_LOGO : "./images/nba_raptors.jpg"\r
+}, {\r
+       NAME : "Sanders, Larry",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Virginia Commonwealth",\r
+       TEAM_LOGO : "./images/nba_suns.jpg"\r
+}, {\r
+       NAME : "Sanders, Melvin",\r
+       ACTIVE : "2005 - 2005",\r
+       FROM : "College - Oklahoma State",\r
+       TEAM_LOGO : "./images/nba_trail.jpg"\r
+}, {\r
+       NAME : "Sanders, Mike",\r
+       ACTIVE : "1982 - 1992",\r
+       FROM : "College - UCLA",\r
+       TEAM_LOGO : "./images/nba_knics.jpg"\r
+}, {\r
+       NAME : "Sanders, Thomas Ernest (Satch)",\r
+       ACTIVE : "1960 - 1972",\r
+       FROM : "College - N.Y.U.",\r
+       TEAM_LOGO : "./images/nba_cavaliers.jpg"\r
+}, {\r
+       NAME : "Santiago, Daniel",\r
+       ACTIVE : "2000 - 2004",\r
+       FROM : "College - St. Vincent",\r
+       TEAM_LOGO : "./images/nba_warriors.jpg"\r
+}, {\r
+       NAME : "Santini, Robert (Bob)",\r
+       ACTIVE : "1955 - 1955",\r
+       FROM : "College - Iona",\r
+       TEAM_LOGO : "./images/nba_spurs.jpg"\r
+}, {\r
+       NAME : "Sappleton, Wayne B.",\r
+       ACTIVE : "1984 - 1984",\r
+       FROM : "College - Loyola (Chicago)",\r
+       TEAM_LOGO : "./images/nba_bobcats.jpg"\r
+}, {\r
+       NAME : "Sasser, Jason",\r
+       ACTIVE : "1996 - 1998",\r
+       FROM : "College - Texas Tech ''96",\r
+       TEAM_LOGO : "./images/nba_heats.jpg"\r
+}, {\r
+       NAME : "Sasser, Jeryl",\r
+       ACTIVE : "2001 - 2002",\r
+       FROM : "College - Southern Methodist ''01",\r
+       TEAM_LOGO : "./images/nba_trail.jpg"\r
+}, {\r
+       NAME : "Satterfield, Kenny",\r
+       ACTIVE : "2001 - 2002",\r
+       FROM : "College - Cincinnati ''03",\r
+       TEAM_LOGO : "./images/nba_raptors.jpg"\r
+}, {\r
+       NAME : "Saul, Frank Benjamin Jr. (Pep)",\r
+       ACTIVE : "1949 - 1954",\r
+       FROM : "College - Seton Hall",\r
+       TEAM_LOGO : "./images/nba_hawks.jpg"\r
+}, {\r
+       NAME : "Sauldsberry, Woodrow Jr. (Woody)",\r
+       ACTIVE : "1957 - 1965",\r
+       FROM : "College - Texas Southern",\r
+       TEAM_LOGO : "./images/nba_rockets.jpg"\r
+}, {\r
+       NAME : "Saunders, James Frederick (Fred)",\r
+       ACTIVE : "1974 - 1977",\r
+       FROM : "College - Syracuse",\r
+       TEAM_LOGO : "./images/nba_clippers.jpg"\r
+}, {\r
+       NAME : "Savage, Donald Joseph (Don)",\r
+       ACTIVE : "1951 - 1956",\r
+       FROM : "College - Le Moyne",\r
+       TEAM_LOGO : "./images/nba_timberwolves.jpg"\r
+}, {\r
+       NAME : "Savovic, Predrag",\r
+       ACTIVE : "2002 - 2002",\r
+       FROM : "College - Hawaii ''02",\r
+       TEAM_LOGO : "./images/nba_nuggets.jpg"\r
+}, {\r
+       NAME : "Sawyer, Alan Leigh",\r
+       ACTIVE : "1950 - 1950",\r
+       FROM : "College - UCLA",\r
+       TEAM_LOGO : "./images/nba_bobcats.jpg"\r
+}, {\r
+       NAME : "Scalabrine, Brian",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - USC",\r
+       TEAM_LOGO : "./images/nba_clippers.jpg"\r
+}, {\r
+       NAME : "Scales, Alex",\r
+       ACTIVE : "2005 - 2005",\r
+       FROM : "College - Oregon",\r
+       TEAM_LOGO : "./images/nba_pacers.jpg"\r
+}, {\r
+       NAME : "Scales, DeWayne",\r
+       ACTIVE : "1980 - 1983",\r
+       FROM : "College - Louisiana State",\r
+       TEAM_LOGO : "./images/nba_knics.jpg"\r
+}, {\r
+       NAME : "Schade, Frank",\r
+       ACTIVE : "1972 - 1972",\r
+       FROM : "College - Wis.-Eau Claire; Texas-El Paso",\r
+       TEAM_LOGO : "./images/nba_heats.jpg"\r
+}, {\r
+       NAME : "Schadler, Bernard R. (Ben)",\r
+       ACTIVE : "1947 - 1947",\r
+       FROM : "College - Northwestern",\r
+       TEAM_LOGO : "./images/nba_trail.jpg"\r
+}, {\r
+       NAME : "Schaefer, Herman H. (Herm)",\r
+       ACTIVE : "1948 - 1949",\r
+       FROM : "College - Indiana",\r
+       TEAM_LOGO : "./images/nba_celtics.jpg"\r
+}, {\r
+       NAME : "Schafer, Robert Thomas (Bob)",\r
+       ACTIVE : "1955 - 1955",\r
+       FROM : "College - Villanova",\r
+       TEAM_LOGO : "./images/nba_bucks.jpg"\r
+}, {\r
+       NAME : "Scharnus, Benedict Michael (Ben, Whitey)",\r
+       ACTIVE : "1946 - 1948",\r
+       FROM : "College - Seton Hall",\r
+       TEAM_LOGO : "./images/nba_trail.jpg"\r
+}, {\r
+       NAME : "Schatzman, Marvin J. (Marv)",\r
+       ACTIVE : "1949 - 1949",\r
+       FROM : "College - St. Louis",\r
+       TEAM_LOGO : "./images/nba_nuggets.jpg"\r
+}, {\r
+       NAME : "Schaus, Frederick Appleton (Fred)",\r
+       ACTIVE : "1949 - 1953",\r
+       FROM : "College - West Virginia",\r
+       TEAM_LOGO : "./images/nba_pacers.jpg"\r
+}, {\r
+       NAME : "Schayes, Danny",\r
+       ACTIVE : "1981 - 1998",\r
+       FROM : "College - Syracuse",\r
+       TEAM_LOGO : "./images/nba_spurs.jpg"\r
+}, {\r
+       NAME : "Schayes, Dolph",\r
+       ACTIVE : "1949 - 1963",\r
+       FROM : "College - N.Y.U.",\r
+       TEAM_LOGO : "./images/nba_pacers.jpg"\r
+}, {\r
+       NAME : "Schectman, Oscar B. (Ossie)",\r
+       ACTIVE : "1946 - 1946",\r
+       FROM : "College - Long Island University",\r
+       TEAM_LOGO : "./images/nba_clippers.jpg"\r
+}, {\r
+       NAME : "Scheffler, Steve",\r
+       ACTIVE : "1990 - 1996",\r
+       FROM : "College - Purdue",\r
+       TEAM_LOGO : "./images/nba_suns.jpg"\r
+}, {\r
+       NAME : "Scheffler, Thomas Mark (Tom)",\r
+       ACTIVE : "1984 - 1984",\r
+       FROM : "College - Purdue",\r
+       TEAM_LOGO : "./images/nba_rockets.jpg"\r
+}, {\r
+       NAME : "Schellhase, David Gene Jr. (Dave)",\r
+       ACTIVE : "1966 - 1967",\r
+       FROM : "College - Purdue",\r
+       TEAM_LOGO : "./images/nba_magics.jpg"\r
+}, {\r
+       NAME : "Schenscher, Luke",\r
+       ACTIVE : "2005 - 2006",\r
+       FROM : "College - Georgia Tech",\r
+       TEAM_LOGO : "./images/nba_pacers.jpg"\r
+}, {\r
+       NAME : "Scherer, Herbert Frederick (Herb)",\r
+       ACTIVE : "1950 - 1951",\r
+       FROM : "College - Long Island University",\r
+       TEAM_LOGO : "./images/nba_lakers.jpg"\r
+}, {\r
+       NAME : "Schintzius, Dwayne",\r
+       ACTIVE : "1990 - 1998",\r
+       FROM : "College - Florida",\r
+       TEAM_LOGO : "./images/nba_timberwolves.jpg"\r
+}, {\r
+       NAME : "Schlueter, Dale Wayne",\r
+       ACTIVE : "1968 - 1977",\r
+       FROM : "College - Colorado State",\r
+       TEAM_LOGO : "./images/nba_rockets.jpg"\r
+}, {\r
+       NAME : "Tabak, Zan",\r
+       ACTIVE : "1994 - 2000",\r
+       FROM : "College - No College",\r
+       TEAM_LOGO : "./images/nba_suns.jpg"\r
+}, {\r
+       NAME : "Tabuse, Yuta",\r
+       ACTIVE : "2004 - 2004",\r
+       FROM : "College - BYU-Hawaii",\r
+       TEAM_LOGO : "./images/nba_pistons.jpg"\r
+}, {\r
+       NAME : "Taft, Chris",\r
+       ACTIVE : "2005 - 2005",\r
+       FROM : "College - Pittsburgh",\r
+       TEAM_LOGO : "./images/nba_warriors.jpg"\r
+}, {\r
+       NAME : "Tannenbaum, Sidney (Sid)",\r
+       ACTIVE : "1947 - 1948",\r
+       FROM : "College - N.Y.U.",\r
+       TEAM_LOGO : "./images/nba_trail.jpg"\r
+}, {\r
+       NAME : "Tarlac, Dragan",\r
+       ACTIVE : "2000 - 2000",\r
+       FROM : "College - Olympiakos (Greece)",\r
+       TEAM_LOGO : "./images/nba_jazz.jpg"\r
+}, {\r
+       NAME : "Tarpley, Roy",\r
+       ACTIVE : "1986 - 1994",\r
+       FROM : "College - Michigan",\r
+       TEAM_LOGO : "./images/nba_pacers.jpg"\r
+}, {\r
+       NAME : "Tatum, William Earl (Earl)",\r
+       ACTIVE : "1976 - 1979",\r
+       FROM : "College - Marquette",\r
+       TEAM_LOGO : "./images/nba_knics.jpg"\r
+}, {\r
+       NAME : "Taylor, Anthony",\r
+       ACTIVE : "1988 - 1988",\r
+       FROM : "College - Oregon",\r
+       TEAM_LOGO : "./images/nba_griz.jpg"\r
+}, {\r
+       NAME : "Taylor, Brian Dw.",\r
+       ACTIVE : "1976 - 1981",\r
+       FROM : "College - Princeton",\r
+       TEAM_LOGO : "./images/nba_mavericks.jpg"\r
+}, {\r
+       NAME : "Taylor, Donell",\r
+       ACTIVE : "2005 - 2006",\r
+       FROM : "College - Alabama-Birmingham",\r
+       TEAM_LOGO : "./images/nba_spurs.jpg"\r
+}, {\r
+       NAME : "Taylor, Fredrick Ollie (Fred)",\r
+       ACTIVE : "1970 - 1971",\r
+       FROM : "College - Texas-Pan American",\r
+       TEAM_LOGO : "./images/nba_sonics.jpg"\r
+}, {\r
+       NAME : "Taylor, Jay",\r
+       ACTIVE : "1989 - 1989",\r
+       FROM : "College - Eastern Illinois",\r
+       TEAM_LOGO : "./images/nba_griz.jpg"\r
+}, {\r
+       NAME : "Taylor, Jeff",\r
+       ACTIVE : "1982 - 1986",\r
+       FROM : "College - Texas Tech",\r
+       TEAM_LOGO : "./images/nba_trail.jpg"\r
+}, {\r
+       NAME : "Taylor, Jermaine",\r
+       ACTIVE : "2009 - 2010",\r
+       FROM : "College - Central Florida",\r
+       TEAM_LOGO : "./images/nba_cavaliers.jpg"\r
+}, {\r
+       NAME : "Taylor, Johnny",\r
+       ACTIVE : "1997 - 1999",\r
+       FROM : "College - Knoxville; Indian Hills CC IA; Tennessee-Chattanooga",\r
+       TEAM_LOGO : "./images/nba_jazz.jpg"\r
+}, {\r
+       NAME : "Taylor, Leonard",\r
+       ACTIVE : "1989 - 1989",\r
+       FROM : "College - California",\r
+       TEAM_LOGO : "./images/nba_bucks.jpg"\r
+}, {\r
+       NAME : "Taylor, Maurice",\r
+       ACTIVE : "1997 - 2006",\r
+       FROM : "College - Michigan",\r
+       TEAM_LOGO : "./images/nba_bulls.jpg"\r
+}, {\r
+       NAME : "Taylor, Mike",\r
+       ACTIVE : "2008 - 2008",\r
+       FROM : "College - Iowa State",\r
+       TEAM_LOGO : "./images/nba_heats.jpg"\r
+}, {\r
+       NAME : "Taylor, Roland Morris (Fatty)",\r
+       ACTIVE : "1976 - 1976",\r
+       FROM : "College - Edison CC FL; La Salle",\r
+       TEAM_LOGO : "./images/nba_jazz.jpg"\r
+}, {\r
+       NAME : "Taylor, Vince",\r
+       ACTIVE : "1982 - 1982",\r
+       FROM : "College - Duke",\r
+       TEAM_LOGO : "./images/nba_sonics.jpg"\r
+}, {\r
+       NAME : "Teagle, Terry",\r
+       ACTIVE : "1982 - 1992",\r
+       FROM : "College - Baylor",\r
+       TEAM_LOGO : "./images/nba_clippers.jpg"\r
+}, {\r
+       NAME : "Teague, Jeff",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Wake Forest",\r
+       TEAM_LOGO : "./images/nba_mavericks.jpg"\r
+}, {\r
+       NAME : "Telfair, Sebastian",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "High School - Abraham Lincoln HS (Brooklyn, NY)",\r
+       TEAM_LOGO : "./images/nba_kings.jpg"\r
+}, {\r
+       NAME : "Temple, Garrett",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Louisiana State",\r
+       TEAM_LOGO : "./images/nba_wizards.jpg"\r
+}, {\r
+       NAME : "Terrell, Ira Edmondson",\r
+       ACTIVE : "1976 - 1978",\r
+       FROM : "College - Southern Methodist",\r
+       TEAM_LOGO : "./images/nba_suns.jpg"\r
+}, {\r
+       NAME : "Terry, Allen Charles (Chuck)",\r
+       ACTIVE : "1972 - 1976",\r
+       FROM : "College - Long Beach State",\r
+       TEAM_LOGO : "./images/nba_wizards.jpg"\r
+}, {\r
+       NAME : "Terry, Carlos",\r
+       ACTIVE : "1980 - 1982",\r
+       FROM : "College - Winston-Salem State",\r
+       TEAM_LOGO : "./images/nba_sonics.jpg"\r
+}, {\r
+       NAME : "Terry, Claude Lewis",\r
+       ACTIVE : "1976 - 1977",\r
+       FROM : "College - Stanford",\r
+       TEAM_LOGO : "./images/nba_timberwolves.jpg"\r
+}, {\r
+       NAME : "Terry, Jason",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Arizona",\r
+       TEAM_LOGO : "./images/nba_nets.jpg"\r
+}, {\r
+       NAME : "Thabeet, Hasheem",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Connecticut",\r
+       TEAM_LOGO : "./images/nba_bobcats.jpg"\r
+}, {\r
+       NAME : "Thacker, Thomas Porter (Tom, Tack)",\r
+       ACTIVE : "1963 - 1967",\r
+       FROM : "College - Cincinnati",\r
+       TEAM_LOGO : "./images/nba_clippers.jpg"\r
+}, {\r
+       NAME : "Theus, Reggie",\r
+       ACTIVE : "1978 - 1990",\r
+       FROM : "College - Nevada-Las Vegas",\r
+       TEAM_LOGO : "./images/nba_sonics.jpg"\r
+}, {\r
+       NAME : "Thibeaux, Peter C.",\r
+       ACTIVE : "1984 - 1985",\r
+       FROM : "College - St. Mary's (CA)",\r
+       TEAM_LOGO : "./images/nba_celtics.jpg"\r
+}, {\r
+       NAME : "Thieben, William Bernard (Bill)",\r
+       ACTIVE : "1956 - 1957",\r
+       FROM : "College - Hofstra",\r
+       TEAM_LOGO : "./images/nba_mavericks.jpg"\r
+}, {\r
+       NAME : "Thigpen, Justus",\r
+       ACTIVE : "1972 - 1973",\r
+       FROM : "College - Charles Stewart Mott CC MI; Weber State",\r
+       TEAM_LOGO : "./images/nba_griz.jpg"\r
+}, {\r
+       NAME : "Thirdkill, David",\r
+       ACTIVE : "1982 - 1986",\r
+       FROM : "College - Coll. of Southern Idaho (J.C.); Bradley",\r
+       TEAM_LOGO : "./images/nba_magics.jpg"\r
+}, {\r
+       NAME : "Thomas, Billy",\r
+       ACTIVE : "2007 - 2007",\r
+       FROM : "College - Kansas",\r
+       TEAM_LOGO : "./images/nba_clippers.jpg"\r
+}, {\r
+       NAME : "Thomas, Carl",\r
+       ACTIVE : "1991 - 1997",\r
+       FROM : "College - Eastern Michigan",\r
+       TEAM_LOGO : "./images/nba_bulls.jpg"\r
+}, {\r
+       NAME : "Thomas, Charles",\r
+       ACTIVE : "1991 - 1991",\r
+       FROM : "College - Eastern Michigan",\r
+       TEAM_LOGO : "./images/nba_heats.jpg"\r
+}, {\r
+       NAME : "Thomas, Etan",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Syracuse",\r
+       TEAM_LOGO : "./images/nba_nuggets.jpg"\r
+}, {\r
+       NAME : "Thomas, Irving",\r
+       ACTIVE : "1990 - 1990",\r
+       FROM : "College - Kentucky; Florida State",\r
+       TEAM_LOGO : "./images/nba_bulls.jpg"\r
+}, {\r
+       NAME : "Thomas, Isiah",\r
+       ACTIVE : "1981 - 1993",\r
+       FROM : "College - Indiana",\r
+       TEAM_LOGO : "./images/nba_76ers.jpg"\r
+}, {\r
+       NAME : "Thomas, Jamel",\r
+       ACTIVE : "1999 - 2000",\r
+       FROM : "College - Providence",\r
+       TEAM_LOGO : "./images/nba_kings.jpg"\r
+}, {\r
+       NAME : "Thomas, Jamel",\r
+       ACTIVE : "1999 - 2000",\r
+       FROM : "College - Providence",\r
+       TEAM_LOGO : "./images/nba_76ers.jpg"\r
+}, {\r
+       NAME : "Thomas, James",\r
+       ACTIVE : "2004 - 2005",\r
+       FROM : "College - Texas",\r
+       TEAM_LOGO : "./images/nba_bulls.jpg"\r
+}, {\r
+       NAME : "Thomas, Jim",\r
+       ACTIVE : "1983 - 1990",\r
+       FROM : "College - Indiana",\r
+       TEAM_LOGO : "./images/nba_sonics.jpg"\r
+}, {\r
+       NAME : "Thomas, John",\r
+       ACTIVE : "1997 - 2005",\r
+       FROM : "College - Minnesota",\r
+       TEAM_LOGO : "./images/nba_bobcats.jpg"\r
+}, {\r
+       NAME : "Thomas, Joseph Randle (Joe)",\r
+       ACTIVE : "1970 - 1970",\r
+       FROM : "College - Marquette",\r
+       TEAM_LOGO : "./images/nba_bulls.jpg"\r
+}, {\r
+       NAME : "Thomas, Kenny",\r
+       ACTIVE : "2007 - 2009",\r
+       FROM : "College - New Mexico",\r
+       TEAM_LOGO : "./images/nba_heats.jpg"\r
+}, {\r
+       NAME : "Thomas, Kurt",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Texas Christian",\r
+       TEAM_LOGO : "./images/nba_pistons.jpg"\r
+}, {\r
+       NAME : "Udoh, Ekpe",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Baylor",\r
+       TEAM_LOGO : "./images/nba_bulls.jpg"\r
+}, {\r
+       NAME : "Udoka, Ime",\r
+       ACTIVE : "2007 - 2010",\r
+       FROM : "College - Portland State",\r
+       TEAM_LOGO : "./images/nba_sonics.jpg"\r
+}, {\r
+       NAME : "Udrih, Beno",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "From - Sempeter, Slovenia",\r
+       TEAM_LOGO : "./images/nba_bucks.jpg"\r
+}, {\r
+       NAME : "Ukic, Roko",\r
+       ACTIVE : "2008 - 2009",\r
+       FROM : "From - Split, Croatia",\r
+       TEAM_LOGO : "./images/nba_jazz.jpg"\r
+}, {\r
+       NAME : "Unseld, Wes",\r
+       ACTIVE : "1968 - 1980",\r
+       FROM : "College - Louisville",\r
+       TEAM_LOGO : "./images/nba_kings.jpg"\r
+}, {\r
+       NAME : "Uplinger, Harold F. (Hal)",\r
+       ACTIVE : "1953 - 1953",\r
+       FROM : "College - Long Island University",\r
+       TEAM_LOGO : "./images/nba_suns.jpg"\r
+}, {\r
+       NAME : "Upshaw, Kelvin",\r
+       ACTIVE : "1988 - 1990",\r
+       FROM : "College - Northeastern State (Okla.); Utah",\r
+       TEAM_LOGO : "./images/nba_hawks.jpg"\r
+}, {\r
+       NAME : "Uzoh, Ben",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Tulsa",\r
+       TEAM_LOGO : "./images/nba_honets.jpg"\r
+}, {\r
+       NAME : "Valentine, Darnell",\r
+       ACTIVE : "1981 - 1990",\r
+       FROM : "College - Kansas",\r
+       TEAM_LOGO : "./images/nba_celtics.jpg"\r
+}, {\r
+       NAME : "Valentine, Ronnie L. (Ron)",\r
+       ACTIVE : "1980 - 1980",\r
+       FROM : "College - Old Dominion",\r
+       TEAM_LOGO : "./images/nba_griz.jpg"\r
+}, {\r
+       NAME : "Vallely, John Stephen",\r
+       ACTIVE : "1970 - 1971",\r
+       FROM : "College - Orange Coast Coll. CA (J.C.); UCLA",\r
+       TEAM_LOGO : "./images/nba_bulls.jpg"\r
+}, {\r
+       NAME : "Van Arsdale, Dick",\r
+       ACTIVE : "1965 - 1976",\r
+       FROM : "College - Indiana",\r
+       TEAM_LOGO : "./images/nba_spurs.jpg"\r
+}, {\r
+       NAME : "Van Arsdale, Thomas Arthur (Tom)",\r
+       ACTIVE : "1965 - 1976",\r
+       FROM : "College - Indiana",\r
+       TEAM_LOGO : "./images/nba_kings.jpg"\r
+}, {\r
+       NAME : "Van Breda Kolff, Jan",\r
+       ACTIVE : "1976 - 1982",\r
+       FROM : "College - Vanderbilt",\r
+       TEAM_LOGO : "./images/nba_timberwolves.jpg"\r
+}, {\r
+       NAME : "Van Breda Kolff, Willem H. (Butch)",\r
+       ACTIVE : "1946 - 1949",\r
+       FROM : "College - Princeton; N.Y.U.",\r
+       TEAM_LOGO : "./images/nba_griz.jpg"\r
+}, {\r
+       NAME : "Van Exel, Nick",\r
+       ACTIVE : "1993 - 2005",\r
+       FROM : "College - Cincinnati",\r
+       TEAM_LOGO : "./images/nba_lakers.jpg"\r
+}, {\r
+       NAME : "Van Horn, Keith",\r
+       ACTIVE : "1997 - 2005",\r
+       FROM : "College - Utah",\r
+       TEAM_LOGO : "./images/nba_suns.jpg"\r
+}, {\r
+       NAME : "Van Lier, Norm",\r
+       ACTIVE : "1969 - 1978",\r
+       FROM : "College - St. Francis (PA)",\r
+       TEAM_LOGO : "./images/nba_nets.jpg"\r
+}, {\r
+       NAME : "Vance, Ellis Eugene (Gene)",\r
+       ACTIVE : "1947 - 1951",\r
+       FROM : "College - Illinois",\r
+       TEAM_LOGO : "./images/nba_heats.jpg"\r
+}, {\r
+       NAME : "Vander Velden, Logan",\r
+       ACTIVE : "1995 - 1995",\r
+       FROM : "College - Wis.-Green Bay",\r
+       TEAM_LOGO : "./images/nba_suns.jpg"\r
+}, {\r
+       NAME : "Vandeweghe, Ernest Maurice Jr. (Ernie, Doc)",\r
+       ACTIVE : "1949 - 1955",\r
+       FROM : "College - Colgate",\r
+       TEAM_LOGO : "./images/nba_honets.jpg"\r
+}, {\r
+       NAME : "Vandeweghe, Kiki",\r
+       ACTIVE : "1980 - 1992",\r
+       FROM : "College - UCLA",\r
+       TEAM_LOGO : "./images/nba_bucks.jpg"\r
+}, {\r
+       NAME : "Vanos, Nick",\r
+       ACTIVE : "1985 - 1986",\r
+       FROM : "College - Santa Clara",\r
+       TEAM_LOGO : "./images/nba_76ers.jpg"\r
+}, {\r
+       NAME : "Vanterpool, David",\r
+       ACTIVE : "2000 - 2000",\r
+       FROM : "College - St. Bonaventure",\r
+       TEAM_LOGO : "./images/nba_sonics.jpg"\r
+}, {\r
+       NAME : "Varda, Ratko",\r
+       ACTIVE : "2001 - 2001",\r
+       FROM : "From - Serbia & Montenegro",\r
+       TEAM_LOGO : "./images/nba_timberwolves.jpg"\r
+}, {\r
+       NAME : "Varejao, Anderson",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "From - Santa Teresa, Brazil",\r
+       TEAM_LOGO : "./images/nba_sonics.jpg"\r
+}, {\r
+       NAME : "Vasquez, Greivis",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Maryland",\r
+       TEAM_LOGO : "./images/nba_kings.jpg"\r
+}, {\r
+       NAME : "Vaughn, Charles (Chico)",\r
+       ACTIVE : "1962 - 1966",\r
+       FROM : "College - Southern Illinois",\r
+       TEAM_LOGO : "./images/nba_bulls.jpg"\r
+}, {\r
+       NAME : "Vaughn, David",\r
+       ACTIVE : "1995 - 1998",\r
+       FROM : "College - Memphis",\r
+       TEAM_LOGO : "./images/nba_raptors.jpg"\r
+}, {\r
+       NAME : "Vaughn, Jacque",\r
+       ACTIVE : "2007 - 2008",\r
+       FROM : "College - Kansas",\r
+       TEAM_LOGO : "./images/nba_lakers.jpg"\r
+}, {\r
+       NAME : "Vaughn, Virgil V.",\r
+       ACTIVE : "1946 - 1946",\r
+       FROM : "College - Kentucky Wesleyan",\r
+       TEAM_LOGO : "./images/nba_wizards.jpg"\r
+}, {\r
+       NAME : "Vaught, Loy",\r
+       ACTIVE : "1990 - 2000",\r
+       FROM : "College - Michigan",\r
+       TEAM_LOGO : "./images/nba_kings.jpg"\r
+}, {\r
+       NAME : "Verga, Robert Bruce (Bob)",\r
+       ACTIVE : "1973 - 1973",\r
+       FROM : "College - Duke",\r
+       TEAM_LOGO : "./images/nba_bobcats.jpg"\r
+}, {\r
+       NAME : "Verhoeven, Peter",\r
+       ACTIVE : "1981 - 1986",\r
+       FROM : "College - Fresno State",\r
+       TEAM_LOGO : "./images/nba_pacers.jpg"\r
+}, {\r
+       NAME : "Vetra, Gundars",\r
+       ACTIVE : "1992 - 1992",\r
+       FROM : "College - No College",\r
+       TEAM_LOGO : "./images/nba_heats.jpg"\r
+}, {\r
+       NAME : "Vianna, Joao",\r
+       ACTIVE : "1991 - 1991",\r
+       FROM : "College - Travajara (Brazil)",\r
+       TEAM_LOGO : "./images/nba_bulls.jpg"\r
+}, {\r
+       NAME : "Villanueva, Charlie",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Connecticut",\r
+       TEAM_LOGO : "./images/nba_pistons.jpg"\r
+}, {\r
+       NAME : "Vincent, Jay",\r
+       ACTIVE : "1981 - 1989",\r
+       FROM : "College - Michigan State",\r
+       TEAM_LOGO : "./images/nba_kings.jpg"\r
+}, {\r
+       NAME : "Vincent, Sam",\r
+       ACTIVE : "1985 - 1991",\r
+       FROM : "College - Michigan State",\r
+       TEAM_LOGO : "./images/nba_hawks.jpg"\r
+}, {\r
+       NAME : "Vinicius, Marcus",\r
+       ACTIVE : "2007 - 2007",\r
+       FROM : "From - Brazil",\r
+       TEAM_LOGO : "./images/nba_knics.jpg"\r
+}, {\r
+       NAME : "Vinson, Fred",\r
+       ACTIVE : "1994 - 1999",\r
+       FROM : "College - Georgia Tech",\r
+       TEAM_LOGO : "./images/nba_pistons.jpg"\r
+}, {\r
+       NAME : "Voce, Gary",\r
+       ACTIVE : "1989 - 1989",\r
+       FROM : "College - Notre Dame",\r
+       TEAM_LOGO : "./images/nba_warriors.jpg"\r
+}, {\r
+       NAME : "Volker, Floyd W.",\r
+       ACTIVE : "1949 - 1949",\r
+       FROM : "College - Wyoming",\r
+       TEAM_LOGO : "./images/nba_sonics.jpg"\r
+}, {\r
+       NAME : "Volkov, Alexander",\r
+       ACTIVE : "1989 - 1991",\r
+       FROM : "College - Kiev Institute (Ukraine)",\r
+       TEAM_LOGO : "./images/nba_sonics.jpg"\r
+}, {\r
+       NAME : "Von Nieda, Stanley L. Jr. (Whitey)",\r
+       ACTIVE : "1949 - 1949",\r
+       FROM : "College - Penn State",\r
+       TEAM_LOGO : "./images/nba_bulls.jpg"\r
+}, {\r
+       NAME : "Voskuhl, Jake",\r
+       ACTIVE : "2007 - 2008",\r
+       FROM : "College - Connecticut",\r
+       TEAM_LOGO : "./images/nba_nets.jpg"\r
+}, {\r
+       NAME : "Vranes, Danny",\r
+       ACTIVE : "1981 - 1987",\r
+       FROM : "College - Utah",\r
+       TEAM_LOGO : "./images/nba_sonics.jpg"\r
+}, {\r
+       NAME : "Vranes, Slavko",\r
+       ACTIVE : "2003 - 2003",\r
+       FROM : "From - Serbia & Montenegro",\r
+       TEAM_LOGO : "./images/nba_knics.jpg"\r
+}, {\r
+       NAME : "Vrankovic, Stojko",\r
+       ACTIVE : "1990 - 1998",\r
+       FROM : "College - Croatia",\r
+       TEAM_LOGO : "./images/nba_celtics.jpg"\r
+}, {\r
+       NAME : "Vroman, Brett Grant",\r
+       ACTIVE : "1980 - 1980",\r
+       FROM : "College - UCLA; Nevada-Las Vegas",\r
+       TEAM_LOGO : "./images/nba_cavaliers.jpg"\r
+}, {\r
+       NAME : "Vroman, Jackson",\r
+       ACTIVE : "2004 - 2005",\r
+       FROM : "College - Iowa State",\r
+       TEAM_LOGO : "./images/nba_honets.jpg"\r
+}, {\r
+       NAME : "Vujacic, Sasha",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "From - Maribor, Slovenia",\r
+       TEAM_LOGO : "./images/nba_griz.jpg"\r
+}, {\r
+       NAME : "Wade, Dwyane",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Marquette",\r
+       TEAM_LOGO : "./images/nba_knics.jpg"\r
+}, {\r
+       NAME : "Wade, Mark",\r
+       ACTIVE : "1987 - 1989",\r
+       FROM : "College - El Camino Coll. CA (J.C.); Oklahoma; Nevada-Las Vegas",\r
+       TEAM_LOGO : "./images/nba_raptors.jpg"\r
+}, {\r
+       NAME : "Wafer, Von",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Florida State",\r
+       TEAM_LOGO : "./images/nba_honets.jpg"\r
+}, {\r
+       NAME : "Wager, Clinton B. (Clint)",\r
+       ACTIVE : "1949 - 1949",\r
+       FROM : "College - St. Mary's (Minn.)",\r
+       TEAM_LOGO : "./images/nba_rockets.jpg"\r
+}, {\r
+       NAME : "Wagner, Dajuan",\r
+       ACTIVE : "2002 - 2006",\r
+       FROM : "College - Memphis",\r
+       TEAM_LOGO : "./images/nba_wizards.jpg"\r
+}, {\r
+       NAME : "Wagner, Daniel Earnest (Danny)",\r
+       ACTIVE : "1949 - 1949",\r
+       FROM : "College - Schreiner Coll.; Texas",\r
+       TEAM_LOGO : "./images/nba_bulls.jpg"\r
+}, {\r
+       NAME : "Wagner, Milt",\r
+       ACTIVE : "1987 - 1990",\r
+       FROM : "College - Louisville",\r
+       TEAM_LOGO : "./images/nba_griz.jpg"\r
+}, {\r
+       NAME : "Waiters, Granville",\r
+       ACTIVE : "1983 - 1987",\r
+       FROM : "College - Ohio State",\r
+       TEAM_LOGO : "./images/nba_76ers.jpg"\r
+}, {\r
+       NAME : "Wakefield, Andre",\r
+       ACTIVE : "1978 - 1979",\r
+       FROM : "College - Coll. of Southern Idaho (J.C.); Loyola (Chicago)",\r
+       TEAM_LOGO : "./images/nba_clippers.jpg"\r
+}, {\r
+       NAME : "Walk, Neal",\r
+       ACTIVE : "1969 - 1976",\r
+       FROM : "College - Florida",\r
+       TEAM_LOGO : "./images/nba_mavericks.jpg"\r
+}, {\r
+       NAME : "Walker, Andrew Martin (Andy)",\r
+       ACTIVE : "1976 - 1976",\r
+       FROM : "College - Niagara",\r
+       TEAM_LOGO : "./images/nba_cavaliers.jpg"\r
+}, {\r
+       NAME : "Walker, Antoine",\r
+       ACTIVE : "2007 - 2007",\r
+       FROM : "College - Kentucky",\r
+       TEAM_LOGO : "./images/nba_magics.jpg"\r
+}, {\r
+       NAME : "Walker, Bill",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Kansas State",\r
+       TEAM_LOGO : "./images/nba_nuggets.jpg"\r
+}, {\r
+       NAME : "Walker, Brady W.",\r
+       ACTIVE : "1948 - 1951",\r
+       FROM : "College - Brigham Young",\r
+       TEAM_LOGO : "./images/nba_pistons.jpg"\r
+}, {\r
+       NAME : "Walker, Chet",\r
+       ACTIVE : "1962 - 1974",\r
+       FROM : "College - Bradley",\r
+       TEAM_LOGO : "./images/nba_mavericks.jpg"\r
+}, {\r
+       NAME : "Walker, Darrell",\r
+       ACTIVE : "1983 - 1992",\r
+       FROM : "College - Westark CC; Arkansas",\r
+       TEAM_LOGO : "./images/nba_celtics.jpg"\r
+}, {\r
+       NAME : "Walker, Foots",\r
+       ACTIVE : "1974 - 1983",\r
+       FROM : "College - Vincennes IN (J.C.); West Georgia",\r
+       TEAM_LOGO : "./images/nba_cavaliers.jpg"\r
+}, {\r
+       NAME : "Walker, Horace",\r
+       ACTIVE : "1961 - 1961",\r
+       FROM : "College - Michigan State",\r
+       TEAM_LOGO : "./images/nba_warriors.jpg"\r
+}, {\r
+       NAME : "Walker, James (Jimmy)",\r
+       ACTIVE : "1967 - 1975",\r
+       FROM : "College - Providence",\r
+       TEAM_LOGO : "./images/nba_mavericks.jpg"\r
+}, {\r
+       NAME : "Walker, Kenny",\r
+       ACTIVE : "1986 - 1994",\r
+       FROM : "College - Kentucky",\r
+       TEAM_LOGO : "./images/nba_76ers.jpg"\r
+}, {\r
+       NAME : "Walker, Phillip B. (Phil)",\r
+       ACTIVE : "1977 - 1977",\r
+       FROM : "College - Millersville",\r
+       TEAM_LOGO : "./images/nba_nuggets.jpg"\r
+}, {\r
+       NAME : "Walker, Samaki",\r
+       ACTIVE : "1996 - 2005",\r
+       FROM : "College - Louisville",\r
+       TEAM_LOGO : "./images/nba_pistons.jpg"\r
+}, {\r
+       NAME : "Walker, Wally",\r
+       ACTIVE : "1976 - 1983",\r
+       FROM : "College - Virginia",\r
+       TEAM_LOGO : "./images/nba_warriors.jpg"\r
+}, {\r
+       NAME : "Wall, John",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Kentucky",\r
+       TEAM_LOGO : "./images/nba_timberwolves.jpg"\r
+}, {\r
+       NAME : "Wallace, Ben",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Virginia Union",\r
+       TEAM_LOGO : "./images/nba_mavericks.jpg"\r
+}, {\r
+       NAME : "Wallace, Gerald",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Alabama",\r
+       TEAM_LOGO : "./images/nba_cavaliers.jpg"\r
+}, {\r
+       NAME : "Wallace, John",\r
+       ACTIVE : "1996 - 2003",\r
+       FROM : "College - Syracuse ''96",\r
+       TEAM_LOGO : "./images/nba_spurs.jpg"\r
+}, {\r
+       NAME : "Wallace, Michael John (Red)",\r
+       ACTIVE : "1946 - 1946",\r
+       FROM : "College - Scranton",\r
+       TEAM_LOGO : "./images/nba_honets.jpg"\r
+}, {\r
+       NAME : "Wallace, Rasheed",\r
+       ACTIVE : "2007 - 2009",\r
+       FROM : "College - North Carolina",\r
+       TEAM_LOGO : "./images/nba_cavaliers.jpg"\r
+}, {\r
+       NAME : "Waller, Dwight",\r
+       ACTIVE : "1968 - 1968",\r
+       FROM : "College - Tennessee State",\r
+       TEAM_LOGO : "./images/nba_pistons.jpg"\r
+}, {\r
+       NAME : "Waller, Jamie",\r
+       ACTIVE : "1987 - 1987",\r
+       FROM : "College - Virginia Union",\r
+       TEAM_LOGO : "./images/nba_rockets.jpg"\r
+}, {\r
+       NAME : "Walsh, James Patrick (Jim)",\r
+       ACTIVE : "1957 - 1957",\r
+       FROM : "College - Stanford",\r
+       TEAM_LOGO : "./images/nba_mavericks.jpg"\r
+}, {\r
+       NAME : "Walsh, Matt",\r
+       ACTIVE : "2005 - 2005",\r
+       FROM : "College - Florida",\r
+       TEAM_LOGO : "./images/nba_honets.jpg"\r
+}, {\r
+       NAME : "Walters, Rex",\r
+       ACTIVE : "1993 - 1999",\r
+       FROM : "College - De Anza Coll. CA (J.C.); Northwestern; Kansas",\r
+       TEAM_LOGO : "./images/nba_bobcats.jpg"\r
+}, {\r
+       NAME : "Walther, Paul P. (Lefty)",\r
+       ACTIVE : "1949 - 1954",\r
+       FROM : "College - Tennessee",\r
+       TEAM_LOGO : "./images/nba_bobcats.jpg"\r
+}, {\r
+       NAME : "Walthour, Isaac (Rabbit)",\r
+       ACTIVE : "1953 - 1953",\r
+       FROM : "College - No College",\r
+       TEAM_LOGO : "./images/nba_bucks.jpg"\r
+}, {\r
+       NAME : "Walton, Bill",\r
+       ACTIVE : "1974 - 1986",\r
+       FROM : "College - UCLA",\r
+       TEAM_LOGO : "./images/nba_heats.jpg"\r
+}, {\r
+       NAME : "Walton, Lloyd",\r
+       ACTIVE : "1976 - 1980",\r
+       FROM : "College - Moberly Area CC; Marquette",\r
+       TEAM_LOGO : "./images/nba_celtics.jpg"\r
+}, {\r
+       NAME : "Walton, Luke",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Arizona",\r
+       TEAM_LOGO : "./images/nba_timberwolves.jpg"\r
+}, {\r
+       NAME : "Wang Zhizhi",\r
+       ACTIVE : "2000 - 2004",\r
+       FROM : "From - China",\r
+       TEAM_LOGO : "./images/nba_warriors.jpg"\r
+}, {\r
+       NAME : "Wanzer, Robert Francis (Bobby)",\r
+       ACTIVE : "1948 - 1956",\r
+       FROM : "College - Colgate; Seton Hall",\r
+       TEAM_LOGO : "./images/nba_magics.jpg"\r
+}, {\r
+       NAME : "Warbington, Perry",\r
+       ACTIVE : "1974 - 1974",\r
+       FROM : "College - Lake City CC FL; Georgia Southern",\r
+       TEAM_LOGO : "./images/nba_cavaliers.jpg"\r
+}, {\r
+       NAME : "Ward, Charlie",\r
+       ACTIVE : "1994 - 2004",\r
+       FROM : "College - Florida State",\r
+       TEAM_LOGO : "./images/nba_sonics.jpg"\r
+}, {\r
+       NAME : "Ward, Gerald W. (Gerry)",\r
+       ACTIVE : "1963 - 1966",\r
+       FROM : "College - Boston College",\r
+       TEAM_LOGO : "./images/nba_hawks.jpg"\r
+}, {\r
+       NAME : "Ward, Henry Lorette",\r
+       ACTIVE : "1976 - 1976",\r
+       FROM : "College - Jackson State",\r
+       TEAM_LOGO : "./images/nba_cavaliers.jpg"\r
+}, {\r
+       NAME : "Ware, James Edward (Jim)",\r
+       ACTIVE : "1966 - 1967",\r
+       FROM : "College - Oklahoma City",\r
+       TEAM_LOGO : "./images/nba_magics.jpg"\r
+}, {\r
+       NAME : "Warley, Benjamin Vallintina (Ben)",\r
+       ACTIVE : "1962 - 1966",\r
+       FROM : "College - Tennessee State",\r
+       TEAM_LOGO : "./images/nba_rockets.jpg"\r
+}, {\r
+       NAME : "Warlick, Robert Lee (Bob)",\r
+       ACTIVE : "1965 - 1968",\r
+       FROM : "College - Pueblo CC CO; Pepperdine; Denver",\r
+       TEAM_LOGO : "./images/nba_nets.jpg"\r
+}, {\r
+       NAME : "Warner, Cornell",\r
+       ACTIVE : "1970 - 1976",\r
+       FROM : "College - Jackson State",\r
+       TEAM_LOGO : "./images/nba_trail.jpg"\r
+}, {\r
+       NAME : "Warren, John II (Johnny)",\r
+       ACTIVE : "1969 - 1973",\r
+       FROM : "College - St. John's (N.Y.)",\r
+       TEAM_LOGO : "./images/nba_hawks.jpg"\r
+}, {\r
+       NAME : "Yarbrough, Vincent",\r
+       ACTIVE : "2002 - 2002",\r
+       FROM : "College - Tennessee ''02",\r
+       TEAM_LOGO : "./images/nba_lakers.jpg"\r
+}, {\r
+       NAME : "Yardley, George",\r
+       ACTIVE : "1953 - 1959",\r
+       FROM : "College - Stanford",\r
+       TEAM_LOGO : "./images/nba_76ers.jpg"\r
+}, {\r
+       NAME : "Yates, Barry",\r
+       ACTIVE : "1971 - 1971",\r
+       FROM : "College - Nebraska; Maryland",\r
+       TEAM_LOGO : "./images/nba_pistons.jpg"\r
+}, {\r
+       NAME : "Yates, Wayne E.",\r
+       ACTIVE : "1961 - 1961",\r
+       FROM : "College - Memphis",\r
+       TEAM_LOGO : "./images/nba_76ers.jpg"\r
+}, {\r
+       NAME : "Yelverton, Charles W. (Charlie)",\r
+       ACTIVE : "1971 - 1971",\r
+       FROM : "College - Fordham",\r
+       TEAM_LOGO : "./images/nba_nuggets.jpg"\r
+}, {\r
+       NAME : "Yonakor, Richard Robert (Rich)",\r
+       ACTIVE : "1981 - 1981",\r
+       FROM : "College - North Carolina",\r
+       TEAM_LOGO : "./images/nba_timberwolves.jpg"\r
+}, {\r
+       NAME : "Young, Danny",\r
+       ACTIVE : "1984 - 1994",\r
+       FROM : "College - Wake Forest",\r
+       TEAM_LOGO : "./images/nba_warriors.jpg"\r
+}, {\r
+       NAME : "Young, Korleone",\r
+       ACTIVE : "1998 - 1998",\r
+       FROM : "College - No College",\r
+       TEAM_LOGO : "./images/nba_griz.jpg"\r
+}, {\r
+       NAME : "Young, Michael",\r
+       ACTIVE : "1984 - 1989",\r
+       FROM : "College - Houston",\r
+       TEAM_LOGO : "./images/nba_bucks.jpg"\r
+}, {\r
+       NAME : "Young, Nick",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - USC",\r
+       TEAM_LOGO : "./images/nba_bobcats.jpg"\r
+}, {\r
+       NAME : "Young, Perry",\r
+       ACTIVE : "1986 - 1986",\r
+       FROM : "College - Virginia Tech",\r
+       TEAM_LOGO : "./images/nba_sonics.jpg"\r
+}, {\r
+       NAME : "Young, Sam",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Pittsburgh",\r
+       TEAM_LOGO : "./images/nba_lakers.jpg"\r
+}, {\r
+       NAME : "Young, Thaddeus",\r
+       ACTIVE : "ACTIVE",\r
+       FROM : "College - Georgia Tech",\r
+       TEAM_LOGO : "./images/nba_lakers.jpg"\r
+}, {\r
+       NAME : "Young, Tim",\r
+       ACTIVE : "1999 - 1999",\r
+       FROM : "College - Stanford",\r
+       TEAM_LOGO : "./images/nba_lakers.jpg"\r
+}, {\r
+       NAME : "Yue, Sun",\r
+       ACTIVE : "2008 - 2008",\r
+       FROM : "From - China",\r
+       TEAM_LOGO : "./images/nba_wizards.jpg"\r
+}, {\r
+       NAME : "Zaslofsky, Max (Slats)",\r
+       ACTIVE : "1946 - 1955",\r
+       FROM : "College - Chicago; St. John's (N.Y.)",\r
+       TEAM_LOGO : "./images/nba_mavericks.jpg"\r
+}, {\r
+       NAME : "Zawoluk, Robert Michael (Zeke)",\r
+       ACTIVE : "1952 - 1954",\r
+       FROM : "College - St. John's (N.Y.)",\r
+       TEAM_LOGO : "./images/nba_bucks.jpg"\r
+}, {\r
+       NAME : "Zeller, David A. (Dave)",\r
+       ACTIVE : "1961 - 1961",\r
+       FROM : "College - Miami (Ohio)",\r
+       TEAM_LOGO : "./images/nba_trail.jpg"\r
+}, {\r
+       NAME : "Zeller, Gary Lynn",\r
+       ACTIVE : "1970 - 1971",\r
+       FROM : "College - Drake",\r
+       TEAM_LOGO : "./images/nba_raptors.jpg"\r
+}, {\r
+       NAME : "Zeller, Harry Raymond (Hank)",\r
+       ACTIVE : "1946 - 1946",\r
+       FROM : "College - Pittsburgh; Washington & Jefferson",\r
+       TEAM_LOGO : "./images/nba_warriors.jpg"\r
+}, {\r
+       NAME : "Zeno, Anthony Michael (Tony)",\r
+       ACTIVE : "1979 - 1979",\r
+       FROM : "College - Arizona State",\r
+       TEAM_LOGO : "./images/nba_pacers.jpg"\r
+}, {\r
+       NAME : "Zevenbergen, Phil",\r
+       ACTIVE : "1987 - 1987",\r
+       FROM : "College - Seattle Pacific; Edmonds CC WA; Washington",\r
+       TEAM_LOGO : "./images/nba_honets.jpg"\r
+}, {\r
+       NAME : "Zidek, George",\r
+       ACTIVE : "1995 - 1997",\r
+       FROM : "College - UCLA",\r
+       TEAM_LOGO : "./images/nba_sonics.jpg"\r
+}, {\r
+       NAME : "Zimmerman, Derrick",\r
+       ACTIVE : "2005 - 2005",\r
+       FROM : "College - Mississippi State",\r
+       TEAM_LOGO : "./images/nba_nuggets.jpg"\r
+}, {\r
+       NAME : "Zoet, Jim",\r
+       ACTIVE : "1982 - 1982",\r
+       FROM : "College - Kent State",\r
+       TEAM_LOGO : "./images/nba_suns.jpg"\r
+}, {\r
+       NAME : "Zopf, William Charles Jr. (Bill, Zip)",\r
+       ACTIVE : "1970 - 1970",\r
+       FROM : "College - Duquesne",\r
+       TEAM_LOGO : "./images/nba_hawks.jpg"\r
+}, {\r
+       NAME : "Zunic, Matthew (Matt, Mad Matt)",\r
+       ACTIVE : "1948 - 1948",\r
+       FROM : "College - George Washington",\r
+       TEAM_LOGO : "./images/nba_clippers.jpg"\r
+}];\r
diff --git a/demos/tizen-gray/widgets/grid/virtualgrid.html b/demos/tizen-gray/widgets/grid/virtualgrid.html
new file mode 100755 (executable)
index 0000000..f3c5570
--- /dev/null
@@ -0,0 +1,29 @@
+<div data-role="page" class="virtuallist_demo_page">\r
+       <div id="normal" data-role="header" data-position="inline">\r
+               <h1>Virtualgrid</h1>\r
+       </div>\r
+       <div data-role="content">\r
+               <script id="tizen-demo-namecard" type="text/x-jquery-tmpl">\r
+                       <div class="ui-demo-namecard">\r
+                       <div class="ui-demo-namecard-pic">\r
+                       <img class="ui-demo-namecard-pic-img" src="${TEAM_LOGO}"  />\r
+                       </div>\r
+                       <div class="ui-demo-namecard-contents">\r
+                       <span class="name ui-li-text-main">${NAME}</span>\r
+                       </div>\r
+                       </div>\r
+               </script>\r
+               <div id="virtualgrid-demo" data-role="virtualgrid" data-column="3" data-row="16" data-template="tizen-demo-namecard" data-dbtable="JSON_DATA"></div>\r
+       </div>\r
+       <script>\r
+               $( ".virtuallist_demo_page" ).live( "pagecreate", function() {\r
+                       $.getScript( "./js/virtualgrid-db-demo.js", function( data, textStatus ) {\r
+                               $( "div" ).filter( function() {\r
+                                       return $( this ).data( "role" ) == "virtualgrid";\r
+                               }).addClass( "vgLoadSuccess" );
+                               $( ".virtuallist_demo_page" ).die();\r
+                               $( ":jqmData(role='virtualgrid')" ).virtualgrid( "create" );\r
+                       });\r
+               });\r
+       </script>\r
+</div>\r
diff --git a/demos/tizen-gray/widgets/handler.html b/demos/tizen-gray/widgets/handler.html
new file mode 100755 (executable)
index 0000000..a96bd43
--- /dev/null
@@ -0,0 +1,118 @@
+<!DOCTYPE html>\r
+<div data-role="page">\r
+       <div data-role="header">\r
+               <h1>Handler Test</h1>\r
+       </div><!-- /header -->\r
+       <div data-role="content" data-scroll="y" data-handler="true">\r
+               <ul data-role="listview">\r
+                       <li data-role="list-divider">A</li>\r
+                       <li><a href="#">Adam Kinkaid</a></li>\r
+                       <li><a href="#">Alex Wickerham</a></li>\r
+                       <li><a href="#">Avery Johnson</a></li>\r
+                       <li data-role="list-divider">B</li>\r
+                       <li><a href="#">Bob Cabot</a></li>\r
+                       <li data-role="list-divider">C</li>\r
+                       <li><a href="#">Caleb Booth</a></li>\r
+                       <li><a href="#">Christopher Adams</a></li>\r
+                       <li><a href="#">Culver James</a></li>\r
+                       <li data-role="list-divider">D</li>\r
+                       <li><a href="#">David Walsh</a></li>\r
+                       <li><a href="#">Drake Alfred</a></li>\r
+                       <li data-role="list-divider">E</li>\r
+                       <li><a href="#">Elizabeth Bacon</a></li>\r
+                       <li><a href="#">Emery Parker</a></li>\r
+                       <li><a href="#">Enid Voldon</a></li>\r
+                       <li data-role="list-divider">F</li>\r
+                       <li><a href="#">Francis Wall</a></li>\r
+                       <li data-role="list-divider">G</li>\r
+                       <li><a href="#">Graham Smith</a></li>\r
+                       <li><a href="#">Greta Peete</a></li>\r
+                       <li data-role="list-divider">H</li>\r
+                       <li><a href="#">Harvey Walls</a></li>\r
+                       <li data-role="list-divider">M</li>\r
+                       <li><a href="#">Mike Farnsworth</a></li>\r
+                       <li><a href="#">Murray Vanderbuilt</a></li>\r
+                       <li data-role="list-divider">N</li>\r
+                       <li><a href="#">Nathan Williams</a></li>\r
+                       <li data-role="list-divider">P</li>\r
+                       <li><a href="#">Paul Baker</a></li>\r
+                       <li><a href="#">Pete Mason</a></li>\r
+                       <li data-role="list-divider">R</li>\r
+                       <li><a href="#">Rod Tarker</a></li>\r
+                       <li data-role="list-divider">S</li>\r
+                       <li><a href="#">Sawyer Wakefield</a></li>\r
+                       <li data-role="list-divider">A</li>\r
+                       <li><a href="#">Adam Kinkaid</a></li>\r
+                       <li><a href="#">Alex Wickerham</a></li>\r
+                       <li><a href="#">Avery Johnson</a></li>\r
+                       <li data-role="list-divider">B</li>\r
+                       <li><a href="#">Bob Cabot</a></li>\r
+                       <li data-role="list-divider">C</li>\r
+                       <li><a href="#">Caleb Booth</a></li>\r
+                       <li><a href="#">Christopher Adams</a></li>\r
+                       <li><a href="#">Culver James</a></li>\r
+                       <li data-role="list-divider">D</li>\r
+                       <li><a href="#">David Walsh</a></li>\r
+                       <li><a href="#">Drake Alfred</a></li>\r
+                       <li data-role="list-divider">E</li>\r
+                       <li><a href="#">Elizabeth Bacon</a></li>\r
+                       <li><a href="#">Emery Parker</a></li>\r
+                       <li><a href="#">Enid Voldon</a></li>\r
+                       <li data-role="list-divider">F</li>\r
+                       <li><a href="#">Francis Wall</a></li>\r
+                       <li data-role="list-divider">G</li>\r
+                       <li><a href="#">Graham Smith</a></li>\r
+                       <li><a href="#">Greta Peete</a></li>\r
+                       <li data-role="list-divider">H</li>\r
+                       <li><a href="#">Harvey Walls</a></li>\r
+                       <li data-role="list-divider">M</li>\r
+                       <li><a href="#">Mike Farnsworth</a></li>\r
+                       <li><a href="#">Murray Vanderbuilt</a></li>\r
+                       <li data-role="list-divider">N</li>\r
+                       <li><a href="#">Nathan Williams</a></li>\r
+                       <li data-role="list-divider">P</li>\r
+                       <li><a href="#">Paul Baker</a></li>\r
+                       <li><a href="#">Pete Mason</a></li>\r
+                       <li data-role="list-divider">R</li>\r
+                       <li><a href="#">Rod Tarker</a></li>\r
+                       <li data-role="list-divider">S</li>\r
+                       <li><a href="#">Sawyer Wakefield</a></li>\r
+                       <li data-role="list-divider">A</li>\r
+                       <li><a href="#">Adam Kinkaid</a></li>\r
+                       <li><a href="#">Alex Wickerham</a></li>\r
+                       <li><a href="#">Avery Johnson</a></li>\r
+                       <li data-role="list-divider">B</li>\r
+                       <li><a href="#">Bob Cabot</a></li>\r
+                       <li data-role="list-divider">C</li>\r
+                       <li><a href="#">Caleb Booth</a></li>\r
+                       <li><a href="#">Christopher Adams</a></li>\r
+                       <li><a href="#">Culver James</a></li>\r
+                       <li data-role="list-divider">D</li>\r
+                       <li><a href="#">David Walsh</a></li>\r
+                       <li><a href="#">Drake Alfred</a></li>\r
+                       <li data-role="list-divider">E</li>\r
+                       <li><a href="#">Elizabeth Bacon</a></li>\r
+                       <li><a href="#">Emery Parker</a></li>\r
+                       <li><a href="#">Enid Voldon</a></li>\r
+                       <li data-role="list-divider">F</li>\r
+                       <li><a href="#">Francis Wall</a></li>\r
+                       <li data-role="list-divider">G</li>\r
+                       <li><a href="#">Graham Smith</a></li>\r
+                       <li><a href="#">Greta Peete</a></li>\r
+                       <li data-role="list-divider">H</li>\r
+                       <li><a href="#">Harvey Walls</a></li>\r
+                       <li data-role="list-divider">M</li>\r
+                       <li><a href="#">Mike Farnsworth</a></li>\r
+                       <li><a href="#">Murray Vanderbuilt</a></li>\r
+                       <li data-role="list-divider">N</li>\r
+                       <li><a href="#">Nathan Williams</a></li>\r
+                       <li data-role="list-divider">P</li>\r
+                       <li><a href="#">Paul Baker</a></li>\r
+                       <li><a href="#">Pete Mason</a></li>\r
+                       <li data-role="list-divider">R</li>\r
+                       <li><a href="#">Rod Tarker</a></li>\r
+                       <li data-role="list-divider">S</li>\r
+                       <li><a href="#">Sawyer Wakefield</a></li>\r
+               </ul>\r
+       </div><!-- /content -->\r
+</div><!-- /page -->
\ No newline at end of file
index e6baefc..9fe3725 100644 (file)
                        <li class="ui-li-bubble-date">2010. 05. 20 (bubble date)</li>
                        <li class="ui-li-bubble-right">Sorry I'm late. (bubble right)<span class="ui-li-bubble-time">9:26 PM</span></li>
                        <li class="ui-li-bubble-left ui-li-bubble-sos">Don't worry... I'm free. You're gonna get sick. (bubble sos)<span class="ui-li-bubble-time">9:30 PM</span></li>
-                       <li class="ui-li-bubble-left"><span>Picture test asdjfkldsjaklf sda lfkjdsa f lasd fldsaf das jflds lfdsl jfklsda jlfjdslf jdskl jfklds fdas lf </span><img src="genlist-bubble-sample1.png" /><span class="ui-li-bubble-time">9:40 PM</span></li>
+                       <li class="ui-li-bubble-left"><p>Picture test</p><img src="list-bubble-sample1.png" /><span class="ui-li-bubble-time">9:40 PM</span></li>
                </ul>
-
-
-               
        </div>
 </div>
 
index bd98be4..545bfdc 100644 (file)
@@ -9,17 +9,10 @@
                        <span class="ui-li-text-main">1line</span>
                        </li>
 
-                       <li class="ui-li-1line">
-                       <span class="ui-li-text-main">1line (with link)</span>
-                       </li>
                        <li class="ui-li-1line-sub">
                        <span class="ui-li-text-main">1line-sub</span>
                        <span class="ui-li-text-sub">subtext</sub>
                        </li>
-                       <li class="ui-li-1line-sub">
-                               <span class="ui-li-text-main">1line-sub (with link)</span>
-                               <span class="ui-li-text-sub">subtext</span>
-                       </li>
                        <li class="ui-li-1line-setting">
                        <span class="ui-li-text-main">1line-setting</span>
                        <span class="ui-li-text-sub">Sub text</span>
index 8eeb2e5..06379f8 100755 (executable)
@@ -7,7 +7,7 @@
                                <li class="ui-li-1line"><span class="ui-li-text-main">${NAME}</span></li>
                        </script>
                        
-                       <ul id="virtuallist-normal_1line_ul" data-role="virtuallistview" data-template="tmp-1line" data-dbtable="JSON_DATA">
+                       <ul id="virtuallist-normal_1line_ul" data-role="virtuallistview" data-template="tmp-1line" data-dbtable="JSON_DATA" data-row="100">
                        </ul>
                </div>
        </div>
index 13f55f0..7d65ed1 100755 (executable)
@@ -12,7 +12,7 @@
                                <div data-role="button" data-inline="true" data-icon="plus" data-style="circle"></div>
                        </li>
                </script>
-               <ul id="virtuallist-normal_1line-bigicon5_ul" data-role="virtuallistview" data-template="tmp-1line-bigicon5" data-dbtable="JSON_DATA">
+               <ul id="virtuallist-normal_1line-bigicon5_ul" data-role="virtuallistview" data-template="tmp-1line-bigicon5" data-dbtable="JSON_DATA" data-row="100">
                </ul>
        </div>
 </div>
index fbd24a5..7ef26a4 100755 (executable)
@@ -9,7 +9,7 @@
                                        <div data-role="button" data-inline="true">${ACTIVE}</div>
                                </li>
                        </script>               
-                       <ul id="virtuallist-normal_1line-btn1_ul" data-role="virtuallistview" data-template="tmp-1line-btn1" data-dbtable="JSON_DATA">
+                       <ul id="virtuallist-normal_1line-btn1_ul" data-role="virtuallistview" data-template="tmp-1line-btn1" data-dbtable="JSON_DATA" data-row="100">
                        </ul>
                </div>
        </div>
index fc20c2c..cbde96c 100755 (executable)
@@ -10,7 +10,7 @@
                                <div data-role="toggleswitch"/></div>
                        </li>
                </script>
-               <ul id="virtuallist-normal_1line-toggle_ul" data-role="virtuallistview" data-template="tmp-1line-toggle" data-dbtable="JSON_DATA">
+               <ul id="virtuallist-normal_1line-toggle_ul" data-role="virtuallistview" data-template="tmp-1line-toggle" data-dbtable="JSON_DATA" data-row="100">
                </ul>
        </div>
 </div>
index d7512d7..f06d891 100755 (executable)
@@ -15,7 +15,7 @@
 
                        </script>
 
-               <ul id="virtuallist-normal_2line-star1_ul" data-role="virtuallistview" data-template="tmp-2line-star1" data-dbtable="JSON_DATA">
+               <ul id="virtuallist-normal_2line-star1_ul" data-role="virtuallistview" data-template="tmp-2line-star1" data-dbtable="JSON_DATA" data-row="100">
                </ul>
        </div>
 </div>
diff --git a/demos/tizen-gray/widgets/multibuttonentry-demo.js b/demos/tizen-gray/widgets/multibuttonentry-demo.js
new file mode 100755 (executable)
index 0000000..567d929
--- /dev/null
@@ -0,0 +1,63 @@
+( function ( $, window ) {\r
+       $( document ).ready( function () {\r
+               $( "#MBTaddItemTest" ).click( function () {\r
+                       $( ":jqmData(role='multibuttonentry')" ).multibuttonentry( "add", "additem" );\r
+               });\r
+\r
+               $( "#MBTremoveItemTest" ).click( function () {\r
+                       $( ":jqmData(role='multibuttonentry')" ).multibuttonentry( "remove", 0 );\r
+               });\r
+\r
+               $( "#MBTinputTextTest" ).click( function () {\r
+                       $( ":jqmData(role='multibuttonentry')" ).multibuttonentry( "inputText", "Hello~~~" );\r
+               });\r
+\r
+               $( "#MBTgetInputTextTest" ).click( function () {\r
+                       var input = $( ":jqmData(role='multibuttonentry')" ).multibuttonentry( "inputText" );\r
+                       window.alert( "input String : " + input );\r
+               });\r
+\r
+               $( "#MBTremoveAllItemTest" ).click( function () {\r
+                       $( ":jqmData(role='multibuttonentry')" ).multibuttonentry( "remove" );\r
+               });\r
+\r
+               $( "#MBTgetSelectedItemTest" ).click( function () {\r
+                       var content = $( ":jqmData(role='multibuttonentry')" ).multibuttonentry( "select" );\r
+                       window.alert( "Select content : " + content );\r
+               });\r
+\r
+               $( "#MBTselectItemTest" ).click( function () {\r
+                       $( ":jqmData(role='multibuttonentry')" ).multibuttonentry( "select", 0 );\r
+               });\r
+\r
+               $( "#MBTlengthTest" ).click( function () {\r
+                       var length = $( ":jqmData(role='multibuttonentry')" ).multibuttonentry( "length" );\r
+                       window.alert( "length : " + length );\r
+               });\r
+\r
+               $( "#MBTfocusInTest" ).click( function () {\r
+                       $( ":jqmData(role='multibuttonentry')" ).multibuttonentry( "focusIn", 0 );\r
+               });\r
+\r
+               $( "#MBTfocusOutTest" ).click( function () {\r
+                       $( ":jqmData(role='multibuttonentry')" ).multibuttonentry( "focusOut", 0 );\r
+               });\r
+\r
+               $( "#MBTdestoryTest" ).click( function () {\r
+                       $( ":jqmData(role='multibuttonentry')" ).multibuttonentry( "destory" );\r
+               });\r
+\r
+               $( "#contentList a" ).click( function () {\r
+                       var arg = $( this ).text();\r
+                       $( ":jqmData(role='multibuttonentry')" ).multibuttonentry( "add", arg );\r
+               });\r
+\r
+               $( "#cancelBtn" ).click( function () {\r
+                       $.mobile.changePage( "#multibuttonentry", {\r
+                               transition: "reverse slide",\r
+                               reverse: false,\r
+                               changeHash: false\r
+                       } );\r
+               });\r
+       });\r
+} ( jQuery, window ) );
\ No newline at end of file
diff --git a/demos/tizen-gray/widgets/multimediaview/multimediaview.html b/demos/tizen-gray/widgets/multimediaview/multimediaview.html
new file mode 100755 (executable)
index 0000000..0d0409b
--- /dev/null
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<div data-role="page" data-add-back-btn="true">
+       <div data-role="header" data-position="fixed">
+               <h1>Multimedia view</h1>
+       </div>
+       <div data-role="content">
+               <ul data-role="listview">
+                       <li><a href="multimediaview_video.html">VIDEO</a></li>
+                       <li><a href="multimediaview_audio.html">AUDIO</a></li>
+               </ul>
+       </div>
+</div>
\ No newline at end of file
diff --git a/demos/tizen-gray/widgets/multimediaview/multimediaview_audio.html b/demos/tizen-gray/widgets/multimediaview/multimediaview_audio.html
new file mode 100755 (executable)
index 0000000..ed1d333
--- /dev/null
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<div data-role="page" data-add-back-btn="true">
+       <div data-role="header" data-position="fixed">
+               <h1>Audio Test</h1>
+       </div>
+       <div data-role="content">
+               <audio data-controls="true" style="width:100%;">
+                       <source src="http://www.w3schools.com/html5/mov_bbb.mp4" type="audio/mp4" />
+                       <source src="http://www.w3schools.com/html5/mov_bbb.ogg" type="audio/ogg" />
+                       <p>Your browser does not support the audio tag.</p>
+               </audio>
+       </div>
+</div>
diff --git a/demos/tizen-gray/widgets/multimediaview/multimediaview_video.html b/demos/tizen-gray/widgets/multimediaview/multimediaview_video.html
new file mode 100755 (executable)
index 0000000..05fb102
--- /dev/null
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<div data-role="page" data-add-back-btn="true">
+       <div data-role="header" data-position="fixed">
+               <h1>Video Test</h1>
+       </div>
+       <div data-role="content">
+               <video data-controls="true" style="width:100%;">
+                       <source src="http://www.w3schools.com/html5/mov_bbb.mp4" type="video/mp4" />
+                       <source src="http://www.w3schools.com/html5/mov_bbb.ogg" type="video/ogg" />
+                       <source src="http://www.w3schools.com/html5/mov_bbb.webm" type="video/webm" />
+                       <p>Your browser does not support the video tag.</p>
+               </video>
+       </div>
+</div>
index 704dc4a..6055202 100644 (file)
@@ -1,63 +1,69 @@
-       $('#progressbar-demo').live('pageshow', function (e) {
+var progressbar_running;
 
-               // set progressbar value...
-               $('#progressbar').progressbar("option", "value", 37);
+$("#progressbar-demo").live("pageshow", function ( e ) {
 
-               // how to update progressbar..
-               $('#progressbarTest').bind('vclick', function (e) {
+       $("#progressbarTest").bind("vclick", function ( e ) {
+               progressbar_running = !progressbar_running;
 
-                       // request animation frame
-                       window.requestAnimFrame = (function(){
-                               return  window.requestAnimationFrame       ||
+               // request animation frame
+               window.requestAnimFrame = (function () {
+                       return window.requestAnimationFrame ||
                                window.webkitRequestAnimationFrame ||
-                               window.mozRequestAnimationFrame    ||
-                               window.oRequestAnimationFrame      ||
-                               window.msRequestAnimationFrame     ||
-                               function(animloop){
-                               return window.setTimeout(animloop, 1000 / 60);
+                               window.mozRequestAnimationFrame ||
+                               window.oRequestAnimationFrame ||
+                               window.msRequestAnimationFrame ||
+                               function (animloop) {
+                                       return window.setTimeout(animloop, 1000 / 60);
                                };
-                       })();
-                       window.cancelRequestAnimFrame = ( function() {
-                               return window.cancelAnimationFrame          ||
-                               window.webkitCancelRequestAnimationFrame    ||
-                               window.mozCancelRequestAnimationFrame       ||
-                               window.oCancelRequestAnimationFrame     ||
-                               window.msCancelRequestAnimationFrame        ||
-                               clearTimeout
-                       })();
-
-                       // to store the request
-                       var request;
-                       // progress value
-                       var i = 0;
-
-                       // start and run the animloop
-                       (function animloop(){
-                               $('#progressbar').progressbar("option", "value", i++);
-                               request = requestAnimFrame(animloop);
-                               if ( i > 100 )
-                                       cancelRequestAnimFrame(request);
-                       })();
-               });
-               $(this).find('#pending').progress({ running: true });
-               $(this).find('#progressing').progress({ running: true });
-
-               $('#pendingTest').bind('vclick', function (e) {
-                       var running = $('#pending').progress( "option", "running" );
-                       // start/stop progressing animation
-                       $('#pending').progress( "option", "running", !running );
-               });
-
-               $('#progressingTest').bind('vclick', function (e) {
-                       var running = $('#progressing').progress( "option", "running" );
-                       // start/stop progressing animation
-                       $('#progressing').progress( "option", "running", !running );
-               });
+               }());
+
+               window.cancelRequestAnimFrame = (function () {
+                       return window.cancelAnimationFrame ||
+                               window.webkitCancelRequestAnimationFrame ||
+                               window.mozCancelRequestAnimationFrame ||
+                               window.oCancelRequestAnimationFrame ||
+                               window.msCancelRequestAnimationFrame ||
+                               clearTimeout;
+               }());
+
+               var request,
+                       i = 0;
+
+               // start and run the animloop
+               (function animloop() {
+                       if ( !progressbar_running ) {
+                               cancelRequestAnimFrame( request );
+                               return;
+                       }
+
+                       $("#progressbar").progressbar( "option", "value", i++ );
+
+                       request = requestAnimFrame( animloop );
+
+                       if ( i > 100 ) {
+                               cancelRequestAnimFrame( request );
+                       }
+               }());
        });
 
-       $('#progressbar-demo').bind('pagehide', function (e) {
-               $(this).find('#pending').progress( "option", "running", false );
-               $(this).find('#progressing').progress( "option", "running", false );
+       $( this ).find("#pending").progress({ running: true });
+       $( this ).find("#progressing").progress({ running: true });
+
+       $("#pendingTest").bind("vclick", function ( e ) {
+               var running = $("#pending").progress( "option", "running" );
+               // start/stop progressing animation
+               $("#pending").progress( "option", "running", !running );
        });
 
+       $("#progressingTest").bind("vclick", function ( e ) {
+               var running = $("#progressing").progress( "option", "running" );
+               // start/stop progressing animation
+               $("#progressing").progress( "option", "running", !running );
+       });
+});
 
+$("#progressbar-demo").live("pagehide", function ( e ) {
+       progressbar_running = false;
+       $( this ).find("#pending").progress( { running: true } );
+       $( this ).find("#progressing").progress( { running: true } );
+});
index 9350e48..b1a1e47 100755 (executable)
@@ -1,5 +1,5 @@
 <!DOCTYPE html>
-<div data-role="page" data-add-back-btn="true" data-fit-page-to-window="true">
+<div data-role="page" data-add-back-btn="true" data-fit-page-to-window="true" id="searchbar-demo-page">
        <div data-role="header" data-position ="fixed" >
                <h1>Searchbar</h1>
         <div id="myoptionheader2" data-role="optionheader">            
             </div>
                        
         </div>
-               <input type="tizen-search" name="search" id="search1" value=""  />              
+               <input type="search" name="search" id="search1" value=""  />            
        </div><!-- /header -->
 
-       <div data-role="content">
-
-               <p>1 test</p>           
-               <p>2 test</p>
-               <p>3 test</p>
-               <p>4 test</p>
-               <p>5 test</p>   
-               <p>6 test</p>
-               <p>7 test</p>
-               <p>8 test</p>
-               <p>9 test</p>
-               <p>10 test</p>
-               <p>11 test</p>
-               <p>12 test</p>                                                                                                                                                                          
+       <div data-role="content" id="searchbar-content">
+               <p>Hairston</p>
+               <p>Hansbrough</p>
+               <p>Allred</p>
+               <p>Hanrahan</p>
+               <p>Egan</p>
+               <p>Dare</p>
+               <p>Edmonson</p>
+               <p>Calip</p>
+               <p>Baker</p>
+               <p>Fazekas</p>
+               <p>Garrity</p>
+               <p>Hansen</p>
+               <p>Feigenbaum</p>
+               <p>Fillmore</p>
+               <p>Darden</p>
+               <p>Davis</p>
+               <p>Fitzgerald</p>
+               <p>Carr</p>
+               <p>Danilovic</p>
+               <p>Dark</p>
+               <p>Alexander</p>
+               <p>Allen</p>
+               <p>Edwards</p>
+               <p>Garrett</p>
+               <p>Gardner</p>
+               <p>Carroll</p>
+               <p>Garner</p>
+               <p>Finn</p>
+               <p>Edelin</p>
+               <p>Gay</p>
+       </div>
                
-       </div> 
+       <script src="searchbar.js"></script>
 </div><!-- /page -->
 
diff --git a/demos/tizen-gray/widgets/searchbar.js b/demos/tizen-gray/widgets/searchbar.js
new file mode 100755 (executable)
index 0000000..c799739
--- /dev/null
@@ -0,0 +1,20 @@
+$( "#searchbar-demo-page" ).bind( "pageshow", function(){\r
+\r
+       \r
+       $( "#search1" ).bind( "input change", function(){\r
+               var regEx = "";\r
+               \r
+               regEx = ".*" + $( "#search1" ).val();\r
+               \r
+               $("#searchbar-content p").each(function(){\r
+                       if ( $( this ).text().search(new RegExp(regEx)) != -1) {\r
+                               $( this ).show();\r
+                       }\r
+                       else {\r
+                               $( this ).hide();                               \r
+                       }\r
+               });\r
+       });\r
+       \r
+       /*searchbar-content*/\r
+});
\ No newline at end of file
diff --git a/demos/tizen-gray/widgets/test/ctxpopup_1.png b/demos/tizen-gray/widgets/test/ctxpopup_1.png
new file mode 100755 (executable)
index 0000000..4ab53f2
Binary files /dev/null and b/demos/tizen-gray/widgets/test/ctxpopup_1.png differ
diff --git a/demos/tizen-gray/widgets/test/ctxpopup_2.png b/demos/tizen-gray/widgets/test/ctxpopup_2.png
new file mode 100755 (executable)
index 0000000..99946bb
Binary files /dev/null and b/demos/tizen-gray/widgets/test/ctxpopup_2.png differ
diff --git a/demos/tizen-gray/widgets/test/ctxpopup_3.png b/demos/tizen-gray/widgets/test/ctxpopup_3.png
new file mode 100755 (executable)
index 0000000..586e1f3
Binary files /dev/null and b/demos/tizen-gray/widgets/test/ctxpopup_3.png differ
diff --git a/demos/tizen-gray/widgets/test/ctxpopup_4.png b/demos/tizen-gray/widgets/test/ctxpopup_4.png
new file mode 100755 (executable)
index 0000000..234a611
Binary files /dev/null and b/demos/tizen-gray/widgets/test/ctxpopup_4.png differ
index 18b21c5..92a4c18 100644 (file)
@@ -1,6 +1,6 @@
 <!DOCTYPE html>
 <div data-role="page" data-add-back-btn="true">
-       <div data-role="notification" id="notification" data-type="ticker" data-text1="Ticker" data-text2="Will disappear after 3 seconds" data-param="write on parameter here" data-interval="3000"></div>
+       <div data-role="notification" id="notification" data-type="ticker" data-text1="Ticker" data-text2="Tickernoti" data-param="write on parameter here" data-interval="3000"></div>
        <div data-role="header" data-position="fixed">
                <h1>Notification</h1>
        </div>
diff --git a/libs/js/domready.js b/libs/js/domready.js
deleted file mode 100644 (file)
index 6a2fa35..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-// domready.js (https://github.com/ded/domready)
-// NB not minified, as it the minified version doesn't work
-// License: MIT license
-!function (context, doc) {
-  var fns = [], ol, fn, f = false,
-      testEl = doc.documentElement,
-      hack = testEl.doScroll,
-      domContentLoaded = 'DOMContentLoaded',
-      addEventListener = 'addEventListener',
-      onreadystatechange = 'onreadystatechange',
-      loaded = /^loade|c/.test(doc.readyState);
-
-  function flush(i) {
-    loaded = 1;
-    while (i = fns.shift()) { i() }
-  }
-  doc[addEventListener] && doc[addEventListener](domContentLoaded, fn = function () {
-    doc.removeEventListener(domContentLoaded, fn, f);
-    flush();
-  }, f);
-
-
-  hack && doc.attachEvent(onreadystatechange, (ol = function () {
-    if (/^c/.test(doc.readyState)) {
-      doc.detachEvent(onreadystatechange, ol);
-      flush();
-    }
-  }));
-
-  context['domReady'] = hack ?
-    function (fn) {
-      self != top ?
-        loaded ? fn() : fns.push(fn) :
-        function () {
-          try {
-            testEl.doScroll('left');
-          } catch (e) {
-            return setTimeout(function() { context['domReady'](fn) }, 50);
-          }
-          fn();
-        }()
-    } :
-    function (fn) {
-      loaded ? fn() : fns.push(fn);
-    };
-
-}(this, document);
-
diff --git a/libs/js/globalize/.gitignore b/libs/js/globalize/.gitignore
deleted file mode 100644 (file)
index a4f14d9..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-.project
-*~
-*.diff
-*.patch
-.DS_Store
-generator/bin
-generator/obj
diff --git a/libs/js/jquery.ui.position.git+dfe75e1.js b/libs/js/jquery.ui.position.git+dfe75e1.js
deleted file mode 100644 (file)
index 2a39535..0000000
+++ /dev/null
@@ -1,445 +0,0 @@
-/*
- * jQuery UI Position @ dfe75e1
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Position
- */
-(function( $, undefined ) {
-
-$.ui = $.ui || {};
-
-var rhorizontal = /left|center|right/,
-       rvertical = /top|center|bottom/,
-       roffset = /[+-]\d+%?/,
-       rposition = /^\w+/,
-       rpercent = /%$/,
-       center = "center",
-       _position = $.fn.position;
-
-$.position = {
-       scrollbarWidth: function() {
-               var w1, w2,
-                       div = $( "<div style='display:block;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>" ),
-                       innerDiv = div.children()[0];
-
-               $( "body" ).append( div );
-               w1 = innerDiv.offsetWidth;
-               div.css( "overflow", "scroll" );
-
-               w2 = innerDiv.offsetWidth;
-
-               if ( w1 === w2 ) {
-                       w2 = div[0].clientWidth;
-               }
-
-               div.remove();
-
-               return w1 - w2;
-       },
-       getScrollInfo: function(within) {
-               var notWindow = within[0] !== window,
-                       overflowX = notWindow ? within.css( "overflow-x" ) : "",
-                       overflowY = notWindow ? within.css( "overflow-y" ) : "",
-                       scrollbarWidth = overflowX === "auto" || overflowX === "scroll" ? $.position.scrollbarWidth() : 0,
-                       scrollbarHeight = overflowY === "auto" || overflowY === "scroll" ? $.position.scrollbarWidth() : 0;
-
-               return {
-                       height: within.height() < within[0].scrollHeight ? scrollbarHeight : 0,
-                       width: within.width() < within[0].scrollWidth ? scrollbarWidth : 0
-               };
-       }
-};
-
-$.fn.position = function( options ) {
-       if ( !options || !options.of ) {
-               return _position.apply( this, arguments );
-       }
-
-       // make a copy, we don't want to modify arguments
-       options = $.extend( {}, options );
-
-       var target = $( options.of ),
-               within  = $( options.within || window ),
-               targetElem = target[0],
-               collision = ( options.collision || "flip" ).split( " " ),
-               offsets = {},
-               atOffset,
-               targetWidth,
-               targetHeight,
-               basePosition;
-
-       if ( targetElem.nodeType === 9 ) {
-               targetWidth = target.width();
-               targetHeight = target.height();
-               basePosition = { top: 0, left: 0 };
-       } else if ( $.isWindow( targetElem ) ) {
-               targetWidth = target.width();
-               targetHeight = target.height();
-               basePosition = { top: target.scrollTop(), left: target.scrollLeft() };
-       } else if ( targetElem.preventDefault ) {
-               // force left top to allow flipping
-               options.at = "left top";
-               targetWidth = targetHeight = 0;
-               basePosition = { top: options.of.pageY, left: options.of.pageX };
-       } else {
-               targetWidth = target.outerWidth();
-               targetHeight = target.outerHeight();
-               basePosition = target.offset();
-       }
-
-       // force my and at to have valid horizontal and vertical positions
-       // if a value is missing or invalid, it will be converted to center
-       $.each( [ "my", "at" ], function() {
-               var pos = ( options[ this ] || "" ).split( " " ),
-                       horizontalOffset,
-                       verticalOffset;
-
-               if ( pos.length === 1) {
-                       pos = rhorizontal.test( pos[ 0 ] ) ?
-                               pos.concat( [ center ] ) :
-                               rvertical.test( pos[ 0 ] ) ?
-                                       [ center ].concat( pos ) :
-                                       [ center, center ];
-               }
-               pos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : center;
-               pos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : center;
-
-               // calculate offsets
-               horizontalOffset = roffset.exec( pos[ 0 ] );
-               verticalOffset = roffset.exec( pos[ 1 ] );
-               offsets[ this ] = [
-                       horizontalOffset ? horizontalOffset[ 0 ] : 0,
-                       verticalOffset ? verticalOffset[ 0 ] : 0
-               ];
-
-               // reduce to just the positions without the offsets
-               options[ this ] = [
-                       rposition.exec( pos[ 0 ] )[ 0 ],
-                       rposition.exec( pos[ 1 ] )[ 0 ]
-               ];
-       });
-
-       // normalize collision option
-       if ( collision.length === 1 ) {
-               collision[ 1 ] = collision[ 0 ];
-       }
-
-       if ( options.at[ 0 ] === "right" ) {
-               basePosition.left += targetWidth;
-       } else if ( options.at[ 0 ] === center ) {
-               basePosition.left += targetWidth / 2;
-       }
-
-       if ( options.at[ 1 ] === "bottom" ) {
-               basePosition.top += targetHeight;
-       } else if ( options.at[ 1 ] === center ) {
-               basePosition.top += targetHeight / 2;
-       }
-
-       atOffset = [
-               parseInt( offsets.at[ 0 ], 10 ) *
-                       ( rpercent.test( offsets.at[ 0 ] ) ? targetWidth / 100 : 1 ),
-               parseInt( offsets.at[ 1 ], 10 ) *
-                       ( rpercent.test( offsets.at[ 1 ] ) ? targetHeight / 100 : 1 )
-       ];
-       basePosition.left += atOffset[ 0 ];
-       basePosition.top += atOffset[ 1 ];
-
-       return this.each(function() {
-               var elem = $( this ),
-                       elemWidth = elem.outerWidth(),
-                       elemHeight = elem.outerHeight(),
-                       marginLeft = parseInt( $.curCSS( this, "marginLeft", true ) ) || 0,
-                       marginTop = parseInt( $.curCSS( this, "marginTop", true ) ) || 0,
-                       scrollInfo = $.position.getScrollInfo( within ),
-                       collisionWidth = elemWidth + marginLeft +
-                               ( parseInt( $.curCSS( this, "marginRight", true ) ) || 0 ) + scrollInfo.width,
-                       collisionHeight = elemHeight + marginTop +
-                               ( parseInt( $.curCSS( this, "marginBottom", true ) ) || 0 ) + scrollInfo.height,
-                       position = $.extend( {}, basePosition ),
-                       myOffset = [
-                               parseInt( offsets.my[ 0 ], 10 ) *
-                                       ( rpercent.test( offsets.my[ 0 ] ) ? elem.outerWidth() / 100 : 1 ),
-                               parseInt( offsets.my[ 1 ], 10 ) *
-                                       ( rpercent.test( offsets.my[ 1 ] ) ? elem.outerHeight() / 100 : 1 )
-                       ],
-                       collisionPosition;
-
-               if ( options.my[ 0 ] === "right" ) {
-                       position.left -= elemWidth;
-               } else if ( options.my[ 0 ] === center ) {
-                       position.left -= elemWidth / 2;
-               }
-
-               if ( options.my[ 1 ] === "bottom" ) {
-                       position.top -= elemHeight;
-               } else if ( options.my[ 1 ] === center ) {
-                       position.top -= elemHeight / 2;
-               }
-
-               position.left += myOffset[ 0 ];
-               position.top += myOffset[ 1 ];
-
-               collisionPosition = {
-                       marginLeft: marginLeft,
-                       marginTop: marginTop
-               };
-
-               $.each( [ "left", "top" ], function( i, dir ) {
-                       if ( $.ui.position[ collision[ i ] ] ) {
-                               $.ui.position[ collision[ i ] ][ dir ]( position, {
-                                       targetWidth: targetWidth,
-                                       targetHeight: targetHeight,
-                                       elemWidth: elemWidth,
-                                       elemHeight: elemHeight,
-                                       collisionPosition: collisionPosition,
-                                       collisionWidth: collisionWidth,
-                                       collisionHeight: collisionHeight,
-                                       offset: [ atOffset[ 0 ] + myOffset[ 0 ], atOffset [ 1 ] + myOffset[ 1 ] ],
-                                       my: options.my,
-                                       at: options.at,
-                                       within: within,
-                                       elem : elem
-                               });
-                       }
-               });
-
-               if ( $.fn.bgiframe ) {
-                       elem.bgiframe();
-               }
-               elem.offset( $.extend( position, { using: options.using } ) );
-       });
-};
-
-$.ui.position = {
-       fit: {
-               left: function( position, data ) {
-                       var within = data.within,
-                               win = $( window ),
-                               isWindow = $.isWindow( data.within[0] ),
-                               withinOffset = isWindow ? win.scrollLeft() : within.offset().left,
-                               outerWidth = isWindow ? win.width() : within.outerWidth(),
-                               collisionPosLeft = position.left - data.collisionPosition.marginLeft,
-                               overLeft = withinOffset - collisionPosLeft,
-                               overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset,
-                               newOverRight,
-                               newOverLeft;
-
-                       // element is wider than within
-                       if ( data.collisionWidth > outerWidth ) {
-                               // element is initially over the left side of within
-                               if ( overLeft > 0 && overRight <= 0 ) {
-                                       newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - withinOffset;
-                                       position.left += overLeft - newOverRight;
-                               // element is initially over right side of within
-                               } else if ( overRight > 0 && overLeft <= 0 ) {
-                                       position.left = withinOffset;
-                               // element is initially over both left and right sides of within
-                               } else {
-                                       if ( overLeft > overRight ) {
-                                               position.left = withinOffset + outerWidth - data.collisionWidth;
-                                       } else {
-                                               position.left = withinOffset;
-                                       }
-                               }
-                       // too far left -> align with left edge
-                       } else if ( overLeft > 0 ) {
-                               position.left += overLeft;
-                       // too far right -> align with right edge
-                       } else if ( overRight > 0 ) {
-                               position.left -= overRight;
-                       // adjust based on position and margin
-                       } else {
-                               position.left = Math.max( position.left - collisionPosLeft, position.left );
-                       }
-               },
-               top: function( position, data ) {
-                       var within = data.within,
-                               win = $( window ),
-                               isWindow = $.isWindow( data.within[0] ),
-                               withinOffset = isWindow ? win.scrollTop() : within.offset().top,
-                               outerHeight = isWindow ? win.height() : within.outerHeight(),
-                               collisionPosTop = position.top - data.collisionPosition.marginTop,
-                               overTop = withinOffset - collisionPosTop,
-                               overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset,
-                               newOverTop,
-                               newOverBottom;
-
-                       // element is taller than within
-                       if ( data.collisionHeight > outerHeight ) {
-                               // element is initially over the top of within
-                               if ( overTop > 0 && overBottom <= 0 ) {
-                                       newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - withinOffset;
-                                       position.top += overTop - newOverBottom;
-                               // element is initially over bottom of within
-                               } else if ( overBottom > 0 && overTop <= 0 ) {
-                                       position.top = withinOffset;
-                               // element is initially over both top and bottom of within
-                               } else {
-                                       if ( overTop > overBottom ) {
-                                               position.top = withinOffset + outerHeight - data.collisionHeight;
-                                       } else {
-                                               position.top = withinOffset;
-                                       }
-                               }
-                       // too far up -> align with top
-                       } else if ( overTop > 0 ) {
-                               position.top += overTop;
-                       // too far down -> align with bottom edge
-                       } else if ( overBottom > 0 ) {
-                               position.top -= overBottom;
-                       // adjust based on position and margin
-                       } else {
-                               position.top = Math.max( position.top - collisionPosTop, position.top );
-                       }
-               }
-       },
-       flip: {
-               left: function( position, data ) {
-                       if ( data.at[ 0 ] === center ) {
-                               return;
-                       }
-
-                       data.elem
-                               .removeClass( "ui-flipped-left ui-flipped-right" );
-
-                       var within = data.within,
-                               win = $( window ),
-                               isWindow = $.isWindow( data.within[0] ),
-                               withinOffset = ( isWindow ? 0 : within.offset().left ) + within.scrollLeft(),
-                               outerWidth = isWindow ? within.width() : within.outerWidth(),
-                               collisionPosLeft = position.left - data.collisionPosition.marginLeft,
-                               overLeft = collisionPosLeft - withinOffset,
-                               overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset,
-                               left = data.my[ 0 ] === "left",
-                               myOffset = data.my[ 0 ] === "left" ?
-                                       -data.elemWidth :
-                                       data.my[ 0 ] === "right" ?
-                                               data.elemWidth :
-                                               0,
-                               atOffset = data.at[ 0 ] === "left" ?
-                                       data.targetWidth :
-                                       -data.targetWidth,
-                               offset = -2 * data.offset[ 0 ],
-                               newOverRight,
-                               newOverLeft;
-
-                       if ( overLeft < 0 ) {
-                               newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - outerWidth - withinOffset;
-                               if ( newOverRight < 0 || newOverRight < Math.abs( overLeft ) ) {
-                                       data.elem
-                                               .addClass( "ui-flipped-right" );
-
-                                       position.left += myOffset + atOffset + offset;
-                               }
-                       }
-                       else if ( overRight > 0 ) {
-                               newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + atOffset + offset - withinOffset;
-                               if ( newOverLeft > 0 || Math.abs( newOverLeft ) < overRight ) {
-                                       data.elem
-                                               .addClass( "ui-flipped-left" );
-
-                                       position.left += myOffset + atOffset + offset;
-                               }
-                       }
-               },
-               top: function( position, data ) {
-                       if ( data.at[ 1 ] === center ) {
-                               return;
-                       }
-
-                       data.elem
-                               .removeClass( "ui-flipped-top ui-flipped-bottom" );
-
-                       var within = data.within,
-                               win = $( window ),
-                               isWindow = $.isWindow( data.within[0] ),
-                               withinOffset = ( isWindow ? 0 : within.offset().top ) + within.scrollTop(),
-                               outerHeight = isWindow ? within.height() : within.outerHeight(),
-                               collisionPosTop = position.top - data.collisionPosition.marginTop,
-                               overTop = collisionPosTop - withinOffset,
-                               overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset,
-                               top = data.my[ 1 ] === "top",
-                               myOffset = top ?
-                                       -data.elemHeight :
-                                       data.my[ 1 ] === "bottom" ?
-                                               data.elemHeight :
-                                               0,
-                               atOffset = data.at[ 1 ] === "top" ?
-                                       data.targetHeight :
-                                       -data.targetHeight,
-                               offset = -2 * data.offset[ 1 ],
-                               newOverTop,
-                               newOverBottom;
-                       if ( overTop < 0 ) {
-                               newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - outerHeight - withinOffset;
-                               if ( newOverBottom < 0 || newOverBottom < Math.abs( overTop ) ) {
-                                       data.elem
-                                               .addClass( "ui-flipped-bottom" );
-
-                                       position.top += myOffset + atOffset + offset;
-                               }
-                       }
-                       else if ( overBottom > 0 ) {
-                               newOverTop = position.top -  data.collisionPosition.marginTop + myOffset + atOffset + offset - withinOffset;
-                               if ( newOverTop > 0 || Math.abs( newOverTop ) < overBottom ) {
-                                       data.elem
-                                               .addClass( "ui-flipped-top" );
-
-                                       position.top += myOffset + atOffset + offset;
-                               }
-                       }
-               }
-       },
-       flipfit: {
-               left: function() {
-                       $.ui.position.flip.left.apply( this, arguments );
-                       $.ui.position.fit.left.apply( this, arguments );
-               },
-               top: function() {
-                       $.ui.position.flip.top.apply( this, arguments );
-                       $.ui.position.fit.top.apply( this, arguments );
-               }
-       }
-};
-
-// DEPRECATED
-if ( $.uiBackCompat !== false ) {
-       // offset option
-       (function( $ ) {
-               var _position = $.fn.position;
-               $.fn.position = function( options ) {
-                       if ( !options || !options.offset ) {
-                               return _position.call( this, options );
-                       }
-                       var offset = options.offset.split( " " ),
-                               at = options.at.split( " " );
-                       if ( offset.length === 1 ) {
-                               offset[ 1 ] = offset[ 0 ];
-                       }
-                       if ( /^\d/.test( offset[ 0 ] ) ) {
-                               offset[ 0 ] = "+" + offset[ 0 ];
-                       }
-                       if ( /^\d/.test( offset[ 1 ] ) ) {
-                               offset[ 1 ] = "+" + offset[ 1 ];
-                       }
-                       if ( at.length === 1 ) {
-                               if ( /left|center|right/.test( at[ 0 ] ) ) {
-                                       at[ 1 ] = "center";
-                               } else {
-                                       at[ 1 ] = at[ 0 ];
-                                       at[ 0 ] = "center";
-                               }
-                       }
-                       return _position.call( this, $.extend( options, {
-                               at: at[ 0 ] + offset[ 0 ] + " " + at[ 1 ] + offset[ 1 ],
-                               offset: undefined
-                       } ) );
-               }
-       }( jQuery ) );
-}
-
-}( jQuery ) );
diff --git a/libs/js/jquery.ui.position.git+dfe75e1.min.js b/libs/js/jquery.ui.position.git+dfe75e1.min.js
deleted file mode 100644 (file)
index 8e8f2ce..0000000
+++ /dev/null
@@ -1 +0,0 @@
-(function(a,b){a.ui=a.ui||{};var c=/left|center|right/,d=/top|center|bottom/,e=/[+-]\d+%?/,f=/^\w+/,g=/%$/,h="center",i=a.fn.position;a.position={scrollbarWidth:function(){var b,c,d=a("<div style='display:block;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),e=d.children()[0];a("body").append(d);b=e.offsetWidth;d.css("overflow","scroll");c=e.offsetWidth;if(b===c){c=d[0].clientWidth}d.remove();return b-c},getScrollInfo:function(b){var c=b[0]!==window,d=c?b.css("overflow-x"):"",e=c?b.css("overflow-y"):"",f=d==="auto"||d==="scroll"?a.position.scrollbarWidth():0,g=e==="auto"||e==="scroll"?a.position.scrollbarWidth():0;return{height:b.height()<b[0].scrollHeight?g:0,width:b.width()<b[0].scrollWidth?f:0}}};a.fn.position=function(b){if(!b||!b.of){return i.apply(this,arguments)}b=a.extend({},b);var j=a(b.of),k=a(b.within||window),l=j[0],m=(b.collision||"flip").split(" "),n={},o,p,q,r;if(l.nodeType===9){p=j.width();q=j.height();r={top:0,left:0}}else if(a.isWindow(l)){p=j.width();q=j.height();r={top:j.scrollTop(),left:j.scrollLeft()}}else if(l.preventDefault){b.at="left top";p=q=0;r={top:b.of.pageY,left:b.of.pageX}}else{p=j.outerWidth();q=j.outerHeight();r=j.offset()}a.each(["my","at"],function(){var a=(b[this]||"").split(" "),g,i;if(a.length===1){a=c.test(a[0])?a.concat([h]):d.test(a[0])?[h].concat(a):[h,h]}a[0]=c.test(a[0])?a[0]:h;a[1]=d.test(a[1])?a[1]:h;g=e.exec(a[0]);i=e.exec(a[1]);n[this]=[g?g[0]:0,i?i[0]:0];b[this]=[f.exec(a[0])[0],f.exec(a[1])[0]]});if(m.length===1){m[1]=m[0]}if(b.at[0]==="right"){r.left+=p}else if(b.at[0]===h){r.left+=p/2}if(b.at[1]==="bottom"){r.top+=q}else if(b.at[1]===h){r.top+=q/2}o=[parseInt(n.at[0],10)*(g.test(n.at[0])?p/100:1),parseInt(n.at[1],10)*(g.test(n.at[1])?q/100:1)];r.left+=o[0];r.top+=o[1];return this.each(function(){var c=a(this),d=c.outerWidth(),e=c.outerHeight(),f=parseInt(a.curCSS(this,"marginLeft",true))||0,i=parseInt(a.curCSS(this,"marginTop",true))||0,j=a.position.getScrollInfo(k),l=d+f+(parseInt(a.curCSS(this,"marginRight",true))||0)+j.width,s=e+i+(parseInt(a.curCSS(this,"marginBottom",true))||0)+j.height,t=a.extend({},r),u=[parseInt(n.my[0],10)*(g.test(n.my[0])?c.outerWidth()/100:1),parseInt(n.my[1],10)*(g.test(n.my[1])?c.outerHeight()/100:1)],v;if(b.my[0]==="right"){t.left-=d}else if(b.my[0]===h){t.left-=d/2}if(b.my[1]==="bottom"){t.top-=e}else if(b.my[1]===h){t.top-=e/2}t.left+=u[0];t.top+=u[1];v={marginLeft:f,marginTop:i};a.each(["left","top"],function(f,g){if(a.ui.position[m[f]]){a.ui.position[m[f]][g](t,{targetWidth:p,targetHeight:q,elemWidth:d,elemHeight:e,collisionPosition:v,collisionWidth:l,collisionHeight:s,offset:[o[0]+u[0],o[1]+u[1]],my:b.my,at:b.at,within:k,elem:c})}});if(a.fn.bgiframe){c.bgiframe()}c.offset(a.extend(t,{using:b.using}))})};a.ui.position={fit:{left:function(b,c){var d=c.within,e=a(window),f=a.isWindow(c.within[0]),g=f?e.scrollLeft():d.offset().left,h=f?e.width():d.outerWidth(),i=b.left-c.collisionPosition.marginLeft,j=g-i,k=i+c.collisionWidth-h-g,l,m;if(c.collisionWidth>h){if(j>0&&k<=0){l=b.left+j+c.collisionWidth-h-g;b.left+=j-l}else if(k>0&&j<=0){b.left=g}else{if(j>k){b.left=g+h-c.collisionWidth}else{b.left=g}}}else if(j>0){b.left+=j}else if(k>0){b.left-=k}else{b.left=Math.max(b.left-i,b.left)}},top:function(b,c){var d=c.within,e=a(window),f=a.isWindow(c.within[0]),g=f?e.scrollTop():d.offset().top,h=f?e.height():d.outerHeight(),i=b.top-c.collisionPosition.marginTop,j=g-i,k=i+c.collisionHeight-h-g,l,m;if(c.collisionHeight>h){if(j>0&&k<=0){m=b.top+j+c.collisionHeight-h-g;b.top+=j-m}else if(k>0&&j<=0){b.top=g}else{if(j>k){b.top=g+h-c.collisionHeight}else{b.top=g}}}else if(j>0){b.top+=j}else if(k>0){b.top-=k}else{b.top=Math.max(b.top-i,b.top)}}},flip:{left:function(b,c){if(c.at[0]===h){return}c.elem.removeClass("ui-flipped-left ui-flipped-right");var d=c.within,e=a(window),f=a.isWindow(c.within[0]),g=(f?0:d.offset().left)+d.scrollLeft(),i=f?d.width():d.outerWidth(),j=b.left-c.collisionPosition.marginLeft,k=j-g,l=j+c.collisionWidth-i-g,m=c.my[0]==="left",n=c.my[0]==="left"?-c.elemWidth:c.my[0]==="right"?c.elemWidth:0,o=c.at[0]==="left"?c.targetWidth:-c.targetWidth,p=-2*c.offset[0],q,r;if(k<0){q=b.left+n+o+p+c.collisionWidth-i-g;if(q<0||q<Math.abs(k)){c.elem.addClass("ui-flipped-right");b.left+=n+o+p}}else if(l>0){r=b.left-c.collisionPosition.marginLeft+n+o+p-g;if(r>0||Math.abs(r)<l){c.elem.addClass("ui-flipped-left");b.left+=n+o+p}}},top:function(b,c){if(c.at[1]===h){return}c.elem.removeClass("ui-flipped-top ui-flipped-bottom");var d=c.within,e=a(window),f=a.isWindow(c.within[0]),g=(f?0:d.offset().top)+d.scrollTop(),i=f?d.height():d.outerHeight(),j=b.top-c.collisionPosition.marginTop,k=j-g,l=j+c.collisionHeight-i-g,m=c.my[1]==="top",n=m?-c.elemHeight:c.my[1]==="bottom"?c.elemHeight:0,o=c.at[1]==="top"?c.targetHeight:-c.targetHeight,p=-2*c.offset[1],q,r;if(k<0){r=b.top+n+o+p+c.collisionHeight-i-g;if(r<0||r<Math.abs(k)){c.elem.addClass("ui-flipped-bottom");b.top+=n+o+p}}else if(l>0){q=b.top-c.collisionPosition.marginTop+n+o+p-g;if(q>0||Math.abs(q)<l){c.elem.addClass("ui-flipped-top");b.top+=n+o+p}}}},flipfit:{left:function(){a.ui.position.flip.left.apply(this,arguments);a.ui.position.fit.left.apply(this,arguments)},top:function(){a.ui.position.flip.top.apply(this,arguments);a.ui.position.fit.top.apply(this,arguments)}}};if(a.uiBackCompat!==false){(function(a){var c=a.fn.position;a.fn.position=function(d){if(!d||!d.offset){return c.call(this,d)}var e=d.offset.split(" "),f=d.at.split(" ");if(e.length===1){e[1]=e[0]}if(/^\d/.test(e[0])){e[0]="+"+e[0]}if(/^\d/.test(e[1])){e[1]="+"+e[1]}if(f.length===1){if(/left|center|right/.test(f[0])){f[1]="center"}else{f[1]=f[0];f[0]="center"}}return c.call(this,a.extend(d,{at:f[0]+e[0]+" "+f[1]+e[1],offset:b}))}})(jQuery)}})(jQuery)
diff --git a/libs/js/underscore.js b/libs/js/underscore.js
deleted file mode 100755 (executable)
index 51586fc..0000000
+++ /dev/null
@@ -1,840 +0,0 @@
-//     Underscore.js 1.1.7
-//     (c) 2011 Jeremy Ashkenas, DocumentCloud Inc.
-//     Underscore is freely distributable under the MIT license.
-//     Portions of Underscore are inspired or borrowed from Prototype,
-//     Oliver Steele's Functional, and John Resig's Micro-Templating.
-//     For all details and documentation:
-//     http://documentcloud.github.com/underscore
-
-(function() {
-
-  // Baseline setup
-  // --------------
-
-  // Establish the root object, `window` in the browser, or `global` on the server.
-  var root = this;
-
-  // Save the previous value of the `_` variable.
-  var previousUnderscore = root._;
-
-  // Establish the object that gets returned to break out of a loop iteration.
-  var breaker = {};
-
-  // Save bytes in the minified (but not gzipped) version:
-  var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;
-
-  // Create quick reference variables for speed access to core prototypes.
-  var slice            = ArrayProto.slice,
-      unshift          = ArrayProto.unshift,
-      toString         = ObjProto.toString,
-      hasOwnProperty   = ObjProto.hasOwnProperty;
-
-  // All **ECMAScript 5** native function implementations that we hope to use
-  // are declared here.
-  var
-    nativeForEach      = ArrayProto.forEach,
-    nativeMap          = ArrayProto.map,
-    nativeReduce       = ArrayProto.reduce,
-    nativeReduceRight  = ArrayProto.reduceRight,
-    nativeFilter       = ArrayProto.filter,
-    nativeEvery        = ArrayProto.every,
-    nativeSome         = ArrayProto.some,
-    nativeIndexOf      = ArrayProto.indexOf,
-    nativeLastIndexOf  = ArrayProto.lastIndexOf,
-    nativeIsArray      = Array.isArray,
-    nativeKeys         = Object.keys,
-    nativeBind         = FuncProto.bind;
-
-  // Create a safe reference to the Underscore object for use below.
-  var _ = function(obj) { return new wrapper(obj); };
-
-  // Export the Underscore object for **CommonJS**, with backwards-compatibility
-  // for the old `require()` API. If we're not in CommonJS, add `_` to the
-  // global object.
-  if (typeof module !== 'undefined' && module.exports) {
-    module.exports = _;
-    _._ = _;
-  } else {
-    // Exported as a string, for Closure Compiler "advanced" mode.
-    root['_'] = _;
-  }
-
-  // Current version.
-  _.VERSION = '1.1.7';
-
-  // Collection Functions
-  // --------------------
-
-  // The cornerstone, an `each` implementation, aka `forEach`.
-  // Handles objects with the built-in `forEach`, arrays, and raw objects.
-  // Delegates to **ECMAScript 5**'s native `forEach` if available.
-  var each = _.each = _.forEach = function(obj, iterator, context) {
-    if (obj == null) return;
-    if (nativeForEach && obj.forEach === nativeForEach) {
-      obj.forEach(iterator, context);
-    } else if (obj.length === +obj.length) {
-      for (var i = 0, l = obj.length; i < l; i++) {
-        if (i in obj && iterator.call(context, obj[i], i, obj) === breaker) return;
-      }
-    } else {
-      for (var key in obj) {
-        if (hasOwnProperty.call(obj, key)) {
-          if (iterator.call(context, obj[key], key, obj) === breaker) return;
-        }
-      }
-    }
-  };
-
-  // Return the results of applying the iterator to each element.
-  // Delegates to **ECMAScript 5**'s native `map` if available.
-  _.map = function(obj, iterator, context) {
-    var results = [];
-    if (obj == null) return results;
-    if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context);
-    each(obj, function(value, index, list) {
-      results[results.length] = iterator.call(context, value, index, list);
-    });
-    return results;
-  };
-
-  // **Reduce** builds up a single result from a list of values, aka `inject`,
-  // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available.
-  _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) {
-    var initial = memo !== void 0;
-    if (obj == null) obj = [];
-    if (nativeReduce && obj.reduce === nativeReduce) {
-      if (context) iterator = _.bind(iterator, context);
-      return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator);
-    }
-    each(obj, function(value, index, list) {
-      if (!initial) {
-        memo = value;
-        initial = true;
-      } else {
-        memo = iterator.call(context, memo, value, index, list);
-      }
-    });
-    if (!initial) throw new TypeError("Reduce of empty array with no initial value");
-    return memo;
-  };
-
-  // The right-associative version of reduce, also known as `foldr`.
-  // Delegates to **ECMAScript 5**'s native `reduceRight` if available.
-  _.reduceRight = _.foldr = function(obj, iterator, memo, context) {
-    if (obj == null) obj = [];
-    if (nativeReduceRight && obj.reduceRight === nativeReduceRight) {
-      if (context) iterator = _.bind(iterator, context);
-      return memo !== void 0 ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator);
-    }
-    var reversed = (_.isArray(obj) ? obj.slice() : _.toArray(obj)).reverse();
-    return _.reduce(reversed, iterator, memo, context);
-  };
-
-  // Return the first value which passes a truth test. Aliased as `detect`.
-  _.find = _.detect = function(obj, iterator, context) {
-    var result;
-    any(obj, function(value, index, list) {
-      if (iterator.call(context, value, index, list)) {
-        result = value;
-        return true;
-      }
-    });
-    return result;
-  };
-
-  // Return all the elements that pass a truth test.
-  // Delegates to **ECMAScript 5**'s native `filter` if available.
-  // Aliased as `select`.
-  _.filter = _.select = function(obj, iterator, context) {
-    var results = [];
-    if (obj == null) return results;
-    if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context);
-    each(obj, function(value, index, list) {
-      if (iterator.call(context, value, index, list)) results[results.length] = value;
-    });
-    return results;
-  };
-
-  // Return all the elements for which a truth test fails.
-  _.reject = function(obj, iterator, context) {
-    var results = [];
-    if (obj == null) return results;
-    each(obj, function(value, index, list) {
-      if (!iterator.call(context, value, index, list)) results[results.length] = value;
-    });
-    return results;
-  };
-
-  // Determine whether all of the elements match a truth test.
-  // Delegates to **ECMAScript 5**'s native `every` if available.
-  // Aliased as `all`.
-  _.every = _.all = function(obj, iterator, context) {
-    var result = true;
-    if (obj == null) return result;
-    if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context);
-    each(obj, function(value, index, list) {
-      if (!(result = result && iterator.call(context, value, index, list))) return breaker;
-    });
-    return result;
-  };
-
-  // Determine if at least one element in the object matches a truth test.
-  // Delegates to **ECMAScript 5**'s native `some` if available.
-  // Aliased as `any`.
-  var any = _.some = _.any = function(obj, iterator, context) {
-    iterator = iterator || _.identity;
-    var result = false;
-    if (obj == null) return result;
-    if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context);
-    each(obj, function(value, index, list) {
-      if (result |= iterator.call(context, value, index, list)) return breaker;
-    });
-    return !!result;
-  };
-
-  // Determine if a given value is included in the array or object using `===`.
-  // Aliased as `contains`.
-  _.include = _.contains = function(obj, target) {
-    var found = false;
-    if (obj == null) return found;
-    if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1;
-    any(obj, function(value) {
-      if (found = value === target) return true;
-    });
-    return found;
-  };
-
-  // Invoke a method (with arguments) on every item in a collection.
-  _.invoke = function(obj, method) {
-    var args = slice.call(arguments, 2);
-    return _.map(obj, function(value) {
-      return (method.call ? method || value : value[method]).apply(value, args);
-    });
-  };
-
-  // Convenience version of a common use case of `map`: fetching a property.
-  _.pluck = function(obj, key) {
-    return _.map(obj, function(value){ return value[key]; });
-  };
-
-  // Return the maximum element or (element-based computation).
-  _.max = function(obj, iterator, context) {
-    if (!iterator && _.isArray(obj)) return Math.max.apply(Math, obj);
-    var result = {computed : -Infinity};
-    each(obj, function(value, index, list) {
-      var computed = iterator ? iterator.call(context, value, index, list) : value;
-      computed >= result.computed && (result = {value : value, computed : computed});
-    });
-    return result.value;
-  };
-
-  // Return the minimum element (or element-based computation).
-  _.min = function(obj, iterator, context) {
-    if (!iterator && _.isArray(obj)) return Math.min.apply(Math, obj);
-    var result = {computed : Infinity};
-    each(obj, function(value, index, list) {
-      var computed = iterator ? iterator.call(context, value, index, list) : value;
-      computed < result.computed && (result = {value : value, computed : computed});
-    });
-    return result.value;
-  };
-
-  // Sort the object's values by a criterion produced by an iterator.
-  _.sortBy = function(obj, iterator, context) {
-    return _.pluck(_.map(obj, function(value, index, list) {
-      return {
-        value : value,
-        criteria : iterator.call(context, value, index, list)
-      };
-    }).sort(function(left, right) {
-      var a = left.criteria, b = right.criteria;
-      return a < b ? -1 : a > b ? 1 : 0;
-    }), 'value');
-  };
-
-  // Groups the object's values by a criterion produced by an iterator
-  _.groupBy = function(obj, iterator) {
-    var result = {};
-    each(obj, function(value, index) {
-      var key = iterator(value, index);
-      (result[key] || (result[key] = [])).push(value);
-    });
-    return result;
-  };
-
-  // Use a comparator function to figure out at what index an object should
-  // be inserted so as to maintain order. Uses binary search.
-  _.sortedIndex = function(array, obj, iterator) {
-    iterator || (iterator = _.identity);
-    var low = 0, high = array.length;
-    while (low < high) {
-      var mid = (low + high) >> 1;
-      iterator(array[mid]) < iterator(obj) ? low = mid + 1 : high = mid;
-    }
-    return low;
-  };
-
-  // Safely convert anything iterable into a real, live array.
-  _.toArray = function(iterable) {
-    if (!iterable)                return [];
-    if (iterable.toArray)         return iterable.toArray();
-    if (_.isArray(iterable))      return slice.call(iterable);
-    if (_.isArguments(iterable))  return slice.call(iterable);
-    return _.values(iterable);
-  };
-
-  // Return the number of elements in an object.
-  _.size = function(obj) {
-    return _.toArray(obj).length;
-  };
-
-  // Array Functions
-  // ---------------
-
-  // Get the first element of an array. Passing **n** will return the first N
-  // values in the array. Aliased as `head`. The **guard** check allows it to work
-  // with `_.map`.
-  _.first = _.head = function(array, n, guard) {
-    return (n != null) && !guard ? slice.call(array, 0, n) : array[0];
-  };
-
-  // Returns everything but the first entry of the array. Aliased as `tail`.
-  // Especially useful on the arguments object. Passing an **index** will return
-  // the rest of the values in the array from that index onward. The **guard**
-  // check allows it to work with `_.map`.
-  _.rest = _.tail = function(array, index, guard) {
-    return slice.call(array, (index == null) || guard ? 1 : index);
-  };
-
-  // Get the last element of an array.
-  _.last = function(array) {
-    return array[array.length - 1];
-  };
-
-  // Trim out all falsy values from an array.
-  _.compact = function(array) {
-    return _.filter(array, function(value){ return !!value; });
-  };
-
-  // Return a completely flattened version of an array.
-  _.flatten = function(array) {
-    return _.reduce(array, function(memo, value) {
-      if (_.isArray(value)) return memo.concat(_.flatten(value));
-      memo[memo.length] = value;
-      return memo;
-    }, []);
-  };
-
-  // Return a version of the array that does not contain the specified value(s).
-  _.without = function(array) {
-    return _.difference(array, slice.call(arguments, 1));
-  };
-
-  // Produce a duplicate-free version of the array. If the array has already
-  // been sorted, you have the option of using a faster algorithm.
-  // Aliased as `unique`.
-  _.uniq = _.unique = function(array, isSorted) {
-    return _.reduce(array, function(memo, el, i) {
-      if (0 == i || (isSorted === true ? _.last(memo) != el : !_.include(memo, el))) memo[memo.length] = el;
-      return memo;
-    }, []);
-  };
-
-  // Produce an array that contains the union: each distinct element from all of
-  // the passed-in arrays.
-  _.union = function() {
-    return _.uniq(_.flatten(arguments));
-  };
-
-  // Produce an array that contains every item shared between all the
-  // passed-in arrays. (Aliased as "intersect" for back-compat.)
-  _.intersection = _.intersect = function(array) {
-    var rest = slice.call(arguments, 1);
-    return _.filter(_.uniq(array), function(item) {
-      return _.every(rest, function(other) {
-        return _.indexOf(other, item) >= 0;
-      });
-    });
-  };
-
-  // Take the difference between one array and another.
-  // Only the elements present in just the first array will remain.
-  _.difference = function(array, other) {
-    return _.filter(array, function(value){ return !_.include(other, value); });
-  };
-
-  // Zip together multiple lists into a single array -- elements that share
-  // an index go together.
-  _.zip = function() {
-    var args = slice.call(arguments);
-    var length = _.max(_.pluck(args, 'length'));
-    var results = new Array(length);
-    for (var i = 0; i < length; i++) results[i] = _.pluck(args, "" + i);
-    return results;
-  };
-
-  // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**),
-  // we need this function. Return the position of the first occurrence of an
-  // item in an array, or -1 if the item is not included in the array.
-  // Delegates to **ECMAScript 5**'s native `indexOf` if available.
-  // If the array is large and already in sort order, pass `true`
-  // for **isSorted** to use binary search.
-  _.indexOf = function(array, item, isSorted) {
-    if (array == null) return -1;
-    var i, l;
-    if (isSorted) {
-      i = _.sortedIndex(array, item);
-      return array[i] === item ? i : -1;
-    }
-    if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item);
-    for (i = 0, l = array.length; i < l; i++) if (array[i] === item) return i;
-    return -1;
-  };
-
-
-  // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available.
-  _.lastIndexOf = function(array, item) {
-    if (array == null) return -1;
-    if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) return array.lastIndexOf(item);
-    var i = array.length;
-    while (i--) if (array[i] === item) return i;
-    return -1;
-  };
-
-  // Generate an integer Array containing an arithmetic progression. A port of
-  // the native Python `range()` function. See
-  // [the Python documentation](http://docs.python.org/library/functions.html#range).
-  _.range = function(start, stop, step) {
-    if (arguments.length <= 1) {
-      stop = start || 0;
-      start = 0;
-    }
-    step = arguments[2] || 1;
-
-    var len = Math.max(Math.ceil((stop - start) / step), 0);
-    var idx = 0;
-    var range = new Array(len);
-
-    while(idx < len) {
-      range[idx++] = start;
-      start += step;
-    }
-
-    return range;
-  };
-
-  // Function (ahem) Functions
-  // ------------------
-
-  // Create a function bound to a given object (assigning `this`, and arguments,
-  // optionally). Binding with arguments is also known as `curry`.
-  // Delegates to **ECMAScript 5**'s native `Function.bind` if available.
-  // We check for `func.bind` first, to fail fast when `func` is undefined.
-  _.bind = function(func, obj) {
-    if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));
-    var args = slice.call(arguments, 2);
-    return function() {
-      return func.apply(obj, args.concat(slice.call(arguments)));
-    };
-  };
-
-  // Bind all of an object's methods to that object. Useful for ensuring that
-  // all callbacks defined on an object belong to it.
-  _.bindAll = function(obj) {
-    var funcs = slice.call(arguments, 1);
-    if (funcs.length == 0) funcs = _.functions(obj);
-    each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); });
-    return obj;
-  };
-
-  // Memoize an expensive function by storing its results.
-  _.memoize = function(func, hasher) {
-    var memo = {};
-    hasher || (hasher = _.identity);
-    return function() {
-      var key = hasher.apply(this, arguments);
-      return hasOwnProperty.call(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments));
-    };
-  };
-
-  // Delays a function for the given number of milliseconds, and then calls
-  // it with the arguments supplied.
-  _.delay = function(func, wait) {
-    var args = slice.call(arguments, 2);
-    return setTimeout(function(){ return func.apply(func, args); }, wait);
-  };
-
-  // Defers a function, scheduling it to run after the current call stack has
-  // cleared.
-  _.defer = function(func) {
-    return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1)));
-  };
-
-  // Internal function used to implement `_.throttle` and `_.debounce`.
-  var limit = function(func, wait, debounce) {
-    var timeout;
-    return function() {
-      var context = this, args = arguments;
-      var throttler = function() {
-        timeout = null;
-        func.apply(context, args);
-      };
-      if (debounce) clearTimeout(timeout);
-      if (debounce || !timeout) timeout = setTimeout(throttler, wait);
-    };
-  };
-
-  // Returns a function, that, when invoked, will only be triggered at most once
-  // during a given window of time.
-  _.throttle = function(func, wait) {
-    return limit(func, wait, false);
-  };
-
-  // Returns a function, that, as long as it continues to be invoked, will not
-  // be triggered. The function will be called after it stops being called for
-  // N milliseconds.
-  _.debounce = function(func, wait) {
-    return limit(func, wait, true);
-  };
-
-  // Returns a function that will be executed at most one time, no matter how
-  // often you call it. Useful for lazy initialization.
-  _.once = function(func) {
-    var ran = false, memo;
-    return function() {
-      if (ran) return memo;
-      ran = true;
-      memo = func.apply(this, arguments);
-      return memo;
-    };
-  };
-
-  // Returns the first function passed as an argument to the second,
-  // allowing you to adjust arguments, run code before and after, and
-  // conditionally execute the original function.
-  _.wrap = function(func, wrapper) {
-    return function() {
-      var args = [func].concat(slice.call(arguments));
-      return wrapper.apply(this, args);
-    };
-  };
-
-  // Returns a function that is the composition of a list of functions, each
-  // consuming the return value of the function that follows.
-  _.compose = function() {
-    var funcs = slice.call(arguments);
-    return function() {
-      var args = slice.call(arguments);
-      for (var i = funcs.length - 1; i >= 0; i--) {
-        args = [funcs[i].apply(this, args)];
-      }
-      return args[0];
-    };
-  };
-
-  // Returns a function that will only be executed after being called N times.
-  _.after = function(times, func) {
-    return function() {
-      if (--times < 1) { return func.apply(this, arguments); }
-    };
-  };
-
-
-  // Object Functions
-  // ----------------
-
-  // Retrieve the names of an object's properties.
-  // Delegates to **ECMAScript 5**'s native `Object.keys`
-  _.keys = nativeKeys || function(obj) {
-    if (obj !== Object(obj)) throw new TypeError('Invalid object');
-    var keys = [];
-    for (var key in obj) if (hasOwnProperty.call(obj, key)) keys[keys.length] = key;
-    return keys;
-  };
-
-  // Retrieve the values of an object's properties.
-  _.values = function(obj) {
-    return _.map(obj, _.identity);
-  };
-
-  // Return a sorted list of the function names available on the object.
-  // Aliased as `methods`
-  _.functions = _.methods = function(obj) {
-    var names = [];
-    for (var key in obj) {
-      if (_.isFunction(obj[key])) names.push(key);
-    }
-    return names.sort();
-  };
-
-  // Extend a given object with all the properties in passed-in object(s).
-  _.extend = function(obj) {
-    each(slice.call(arguments, 1), function(source) {
-      for (var prop in source) {
-        if (source[prop] !== void 0) obj[prop] = source[prop];
-      }
-    });
-    return obj;
-  };
-
-  // Fill in a given object with default properties.
-  _.defaults = function(obj) {
-    each(slice.call(arguments, 1), function(source) {
-      for (var prop in source) {
-        if (obj[prop] == null) obj[prop] = source[prop];
-      }
-    });
-    return obj;
-  };
-
-  // Create a (shallow-cloned) duplicate of an object.
-  _.clone = function(obj) {
-    return _.isArray(obj) ? obj.slice() : _.extend({}, obj);
-  };
-
-  // Invokes interceptor with the obj, and then returns obj.
-  // The primary purpose of this method is to "tap into" a method chain, in
-  // order to perform operations on intermediate results within the chain.
-  _.tap = function(obj, interceptor) {
-    interceptor(obj);
-    return obj;
-  };
-
-  // Perform a deep comparison to check if two objects are equal.
-  _.isEqual = function(a, b) {
-    // Check object identity.
-    if (a === b) return true;
-    // Different types?
-    var atype = typeof(a), btype = typeof(b);
-    if (atype != btype) return false;
-    // Basic equality test (watch out for coercions).
-    if (a == b) return true;
-    // One is falsy and the other truthy.
-    if ((!a && b) || (a && !b)) return false;
-    // Unwrap any wrapped objects.
-    if (a._chain) a = a._wrapped;
-    if (b._chain) b = b._wrapped;
-    // One of them implements an isEqual()?
-    if (a.isEqual) return a.isEqual(b);
-    if (b.isEqual) return b.isEqual(a);
-    // Check dates' integer values.
-    if (_.isDate(a) && _.isDate(b)) return a.getTime() === b.getTime();
-    // Both are NaN?
-    if (_.isNaN(a) && _.isNaN(b)) return false;
-    // Compare regular expressions.
-    if (_.isRegExp(a) && _.isRegExp(b))
-      return a.source     === b.source &&
-             a.global     === b.global &&
-             a.ignoreCase === b.ignoreCase &&
-             a.multiline  === b.multiline;
-    // If a is not an object by this point, we can't handle it.
-    if (atype !== 'object') return false;
-    // Check for different array lengths before comparing contents.
-    if (a.length && (a.length !== b.length)) return false;
-    // Nothing else worked, deep compare the contents.
-    var aKeys = _.keys(a), bKeys = _.keys(b);
-    // Different object sizes?
-    if (aKeys.length != bKeys.length) return false;
-    // Recursive comparison of contents.
-    for (var key in a) if (!(key in b) || !_.isEqual(a[key], b[key])) return false;
-    return true;
-  };
-
-  // Is a given array or object empty?
-  _.isEmpty = function(obj) {
-    if (_.isArray(obj) || _.isString(obj)) return obj.length === 0;
-    for (var key in obj) if (hasOwnProperty.call(obj, key)) return false;
-    return true;
-  };
-
-  // Is a given value a DOM element?
-  _.isElement = function(obj) {
-    return !!(obj && obj.nodeType == 1);
-  };
-
-  // Is a given value an array?
-  // Delegates to ECMA5's native Array.isArray
-  _.isArray = nativeIsArray || function(obj) {
-    return toString.call(obj) === '[object Array]';
-  };
-
-  // Is a given variable an object?
-  _.isObject = function(obj) {
-    return obj === Object(obj);
-  };
-
-  // Is a given variable an arguments object?
-  _.isArguments = function(obj) {
-    return !!(obj && hasOwnProperty.call(obj, 'callee'));
-  };
-
-  // Is a given value a function?
-  _.isFunction = function(obj) {
-    return !!(obj && obj.constructor && obj.call && obj.apply);
-  };
-
-  // Is a given value a string?
-  _.isString = function(obj) {
-    return !!(obj === '' || (obj && obj.charCodeAt && obj.substr));
-  };
-
-  // Is a given value a number?
-  _.isNumber = function(obj) {
-    return !!(obj === 0 || (obj && obj.toExponential && obj.toFixed));
-  };
-
-  // Is the given value `NaN`? `NaN` happens to be the only value in JavaScript
-  // that does not equal itself.
-  _.isNaN = function(obj) {
-    return obj !== obj;
-  };
-
-  // Is a given value a boolean?
-  _.isBoolean = function(obj) {
-    return obj === true || obj === false;
-  };
-
-  // Is a given value a date?
-  _.isDate = function(obj) {
-    return !!(obj && obj.getTimezoneOffset && obj.setUTCFullYear);
-  };
-
-  // Is the given value a regular expression?
-  _.isRegExp = function(obj) {
-    return !!(obj && obj.test && obj.exec && (obj.ignoreCase || obj.ignoreCase === false));
-  };
-
-  // Is a given value equal to null?
-  _.isNull = function(obj) {
-    return obj === null;
-  };
-
-  // Is a given variable undefined?
-  _.isUndefined = function(obj) {
-    return obj === void 0;
-  };
-
-  // Utility Functions
-  // -----------------
-
-  // Run Underscore.js in *noConflict* mode, returning the `_` variable to its
-  // previous owner. Returns a reference to the Underscore object.
-  _.noConflict = function() {
-    root._ = previousUnderscore;
-    return this;
-  };
-
-  // Keep the identity function around for default iterators.
-  _.identity = function(value) {
-    return value;
-  };
-
-  // Run a function **n** times.
-  _.times = function (n, iterator, context) {
-    for (var i = 0; i < n; i++) iterator.call(context, i);
-  };
-
-  // Add your own custom functions to the Underscore object, ensuring that
-  // they're correctly added to the OOP wrapper as well.
-  _.mixin = function(obj) {
-    each(_.functions(obj), function(name){
-      addToWrapper(name, _[name] = obj[name]);
-    });
-  };
-
-  // Generate a unique integer id (unique within the entire client session).
-  // Useful for temporary DOM ids.
-  var idCounter = 0;
-  _.uniqueId = function(prefix) {
-    var id = idCounter++;
-    return prefix ? prefix + id : id;
-  };
-
-  // By default, Underscore uses ERB-style template delimiters, change the
-  // following template settings to use alternative delimiters.
-  _.templateSettings = {
-    evaluate    : /<%([\s\S]+?)%>/g,
-    interpolate : /<%=([\s\S]+?)%>/g
-  };
-
-  // JavaScript micro-templating, similar to John Resig's implementation.
-  // Underscore templating handles arbitrary delimiters, preserves whitespace,
-  // and correctly escapes quotes within interpolated code.
-  _.template = function(str, data) {
-    var c  = _.templateSettings;
-    var tmpl = 'var __p=[],print=function(){__p.push.apply(__p,arguments);};' +
-      'with(obj||{}){__p.push(\'' +
-      str.replace(/\\/g, '\\\\')
-         .replace(/'/g, "\\'")
-         .replace(c.interpolate, function(match, code) {
-           return "'," + code.replace(/\\'/g, "'") + ",'";
-         })
-         .replace(c.evaluate || null, function(match, code) {
-           return "');" + code.replace(/\\'/g, "'")
-                              .replace(/[\r\n\t]/g, ' ') + "__p.push('";
-         })
-         .replace(/\r/g, '\\r')
-         .replace(/\n/g, '\\n')
-         .replace(/\t/g, '\\t')
-         + "');}return __p.join('');";
-    var func = new Function('obj', tmpl);
-    return data ? func(data) : func;
-  };
-
-  // The OOP Wrapper
-  // ---------------
-
-  // If Underscore is called as a function, it returns a wrapped object that
-  // can be used OO-style. This wrapper holds altered versions of all the
-  // underscore functions. Wrapped objects may be chained.
-  var wrapper = function(obj) { this._wrapped = obj; };
-
-  // Expose `wrapper.prototype` as `_.prototype`
-  _.prototype = wrapper.prototype;
-
-  // Helper function to continue chaining intermediate results.
-  var result = function(obj, chain) {
-    return chain ? _(obj).chain() : obj;
-  };
-
-  // A method to easily add functions to the OOP wrapper.
-  var addToWrapper = function(name, func) {
-    wrapper.prototype[name] = function() {
-      var args = slice.call(arguments);
-      unshift.call(args, this._wrapped);
-      return result(func.apply(_, args), this._chain);
-    };
-  };
-
-  // Add all of the Underscore functions to the wrapper object.
-  _.mixin(_);
-
-  // Add all mutator Array functions to the wrapper.
-  each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
-    var method = ArrayProto[name];
-    wrapper.prototype[name] = function() {
-      method.apply(this._wrapped, arguments);
-      return result(this._wrapped, this._chain);
-    };
-  });
-
-  // Add all accessor Array functions to the wrapper.
-  each(['concat', 'join', 'slice'], function(name) {
-    var method = ArrayProto[name];
-    wrapper.prototype[name] = function() {
-      return result(method.apply(this._wrapped, arguments), this._chain);
-    };
-  });
-
-  // Start chaining a wrapped Underscore object.
-  wrapper.prototype.chain = function() {
-    this._chain = true;
-    return this;
-  };
-
-  // Extracts the result from a wrapped and chained object.
-  wrapper.prototype.value = function() {
-    return this._wrapped;
-  };
-
-})();
diff --git a/libs/patch/.gitignore b/libs/patch/.gitignore
deleted file mode 100644 (file)
index a6c7c28..0000000
+++ /dev/null
@@ -1 +0,0 @@
-*.js
index 95a5fad..3e0149e 100644 (file)
@@ -1,17 +1,18 @@
-From 58213e7b55e64ff22f29e46823714cb7bbbde841 Mon Sep 17 00:00:00 2001
-From: Youmin Ha <youmin.ha@samsung.com>
-Date: Wed, 15 Feb 2012 17:42:51 +0900
+From 18a19ed0ee31851c720fc6b83b50adea3d91a653 Mon Sep 17 00:00:00 2001
+From: Minkyu Kang <mk7.kang@samsung.com>
+Date: Tue, 28 Feb 2012 10:48:14 +0900
 Subject: [PATCH] JQM: Fix jqm build to exclude compressed version build
 
+Signed-off-by: Youmin Ha <youmin.ha@samsung.com>
 ---
- libs/js/jquery-mobile-1.0.1pre/Makefile |   22 ++++++++++++----------
- 1 files changed, 12 insertions(+), 10 deletions(-)
+ libs/js/jquery-mobile-1.0.1pre/Makefile |   16 +++++++++-------
+ 1 files changed, 9 insertions(+), 7 deletions(-)
 
 diff --git a/libs/js/jquery-mobile-1.0.1pre/Makefile b/libs/js/jquery-mobile-1.0.1pre/Makefile
-index 23541cd..5db7772 100644
+index 23541cd..08bf27b 100644
 --- a/libs/js/jquery-mobile-1.0.1pre/Makefile
 +++ b/libs/js/jquery-mobile-1.0.1pre/Makefile
-@@ -82,21 +82,22 @@ THEME = default
+@@ -82,6 +82,7 @@ THEME = default
  # When no build target is specified, all gets ran
  all: init css js zip notify
  
@@ -19,35 +20,31 @@ index 23541cd..5db7772 100644
  
  # Build and minify the CSS files
  css: init
-       # Build the CSS file with the theme included
+@@ -89,14 +90,14 @@ css: init
        @@cat js/jquery.mobile.intro.js | ${VER} > ${OUTPUT}/${NAME}.css
        @@cat ${CSSTHEMEFILES} ${CSSFILES} >> ${OUTPUT}/${NAME}.css
--      # ..... and then minify it
+       # ..... and then minify it
 -      @@echo ${VER_MIN} > ${OUTPUT}/${NAME}.min.css
 -      @@java -jar build/yuicompressor-2.4.6.jar --type css ${OUTPUT}/${NAME}.css >> ${OUTPUT}/${NAME}.min.css
-+      ## ..... and then minify it
 +      #@@echo ${VER_MIN} > ${OUTPUT}/${NAME}.min.css
 +      #@@java -jar build/yuicompressor-2.4.6.jar --type css ${OUTPUT}/${NAME}.css >> ${OUTPUT}/${NAME}.min.css
        # Build the CSS Structure-only file
        @@cat js/jquery.mobile.intro.js | ${VER} > ${OUTPUT}/${STRUCTURE}.css
        @@cat ${CSSFILES} >> ${OUTPUT}/${STRUCTURE}.css
--      # ..... and then minify it
+       # ..... and then minify it
 -      @@echo ${VER_MIN} > ${OUTPUT}/${STRUCTURE}.min.css
 -      @@java -jar build/yuicompressor-2.4.6.jar --type css ${OUTPUT}/${STRUCTURE}.css >> ${OUTPUT}/${STRUCTURE}.min.css
-+      ## ..... and then minify it
 +      #@@echo ${VER_MIN} > ${OUTPUT}/${STRUCTURE}.min.css
 +      #@@java -jar build/yuicompressor-2.4.6.jar --type css ${OUTPUT}/${STRUCTURE}.css >> ${OUTPUT}/${STRUCTURE}.min.css
        # ..... and then copy in the images
        @@cp -R css/themes/${THEME}/images ${OUTPUT}/
        # Css portion is complete.
-@@ -136,9 +137,9 @@ js: init
-       # Build the JavaScript file
+@@ -137,8 +138,8 @@ js: init
        @@cat js/jquery.mobile.intro.js | ${VER} > ${OUTPUT}/${NAME}.js
        @@cat ${JSFILES} >> ${OUTPUT}/${NAME}.js
--      # ..... and then minify it
+       # ..... and then minify it
 -      @@echo ${VER_MIN} > ${OUTPUT}/${NAME}.min.js
 -      @@java -jar build/google-compiler-20111003.jar --js ${OUTPUT}/${NAME}.js --warning_level QUIET >> ${OUTPUT}/${NAME}.min.js
-+      ## ..... and then minify it
 +      #@@echo ${VER_MIN} > ${OUTPUT}/${NAME}.min.js
 +      #@@java -jar build/google-compiler-20111003.jar --js ${OUTPUT}/${NAME}.js --warning_level QUIET >> ${OUTPUT}/${NAME}.min.js
        # -------------------------------------------------
@@ -61,5 +58,5 @@ index 23541cd..5db7772 100644
 +clean:
 +      @@rm -rf ${CURDIR}/compiled
 -- 
-1.7.4.1
+1.7.5.4
 
index eb0b08e..093e6ff 100644 (file)
@@ -1,30 +1,30 @@
-From 8a6605cac17177b38527a8a7d21b92e75de1e1fe Mon Sep 17 00:00:00 2001
-From: Youmin Ha <youmin.ha@samsung.com>
-Date: Wed, 15 Feb 2012 17:43:48 +0900
+From aee148944929c79484c59d2e70b63ffdd09e1dd0 Mon Sep 17 00:00:00 2001
+From: Minkyu Kang <mk7.kang@samsung.com>
+Date: Tue, 28 Feb 2012 10:59:29 +0900
 Subject: [PATCH] JQM: Fix bug on live firing of custom events
 
+Signed-off-by: Youmin Ha <youmin.ha@samsung.com>
 ---
- .../js/jquery.mobile.event.js                      |    7 +++++++
- 1 files changed, 7 insertions(+), 0 deletions(-)
+ .../js/jquery.mobile.event.js                      |    ++++++
+ 1 files changed, 6 insertions(+), 0 deletions(-)
 
 diff --git a/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.event.js b/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.event.js
-index 7b79b79..9a87f4a 100644
+index 7b79b79..408d2ba 100644
 --- a/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.event.js
 +++ b/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.event.js
-@@ -24,6 +24,13 @@ var supportTouch = $.support.touch,
+@@ -24,6 +24,12 @@ var supportTouch = $.support.touch,
  function triggerCustomEvent( obj, eventType, event ) {
        var originalType = event.type;
        event.type = eventType;
 +
-+      // NOTE : by Youmin Ha <youmin.ha@samsung.com>
-+      //     event.liveFired is already set by basic events e.g. vclick,
-+      //     which is fired already.
-+      //     To fire this custom event, event.liveFired must be cleared.
++      // event.liveFired is already set by basic events e.g. vclick,
++      // which is fired already.
++      // To fire this custom event, event.liveFired must be cleared.
 +      event.liveFired = undefined;
 +
        $.event.handle.call( obj, event );
        event.type = originalType;
  }
 -- 
-1.7.4.1
+1.7.5.4
 
index 8f1ad35..0d0b8b3 100644 (file)
@@ -1,26 +1,27 @@
-From b0ef5938298ad314cc3ea7ffd5afeb34b42c3bbb Mon Sep 17 00:00:00 2001
-From: Youmin Ha <youmin.ha@samsung.com>
-Date: Wed, 15 Feb 2012 17:47:08 +0900
-Subject: [PATCH] JQM: Don't draw right arrow on clickable listitems (For Tizen theme)
+From 6a249538e0f36ddcaa70dd8db43f5d4f189a82c7 Mon Sep 17 00:00:00 2001
+From: Minkyu Kang <mk7.kang@samsung.com>
+Date: Tue, 28 Feb 2012 11:09:31 +0900
+Subject: [PATCH] JQM: Don't draw right arrow on clickable listitems (For
+ Tizen theme)
 
+Signed-off-by: Lee Wongi <wongi11.lee@samsung.com>
+Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
 ---
- .../js/jquery.mobile.listview.js                   |    3 ++-
- 1 files changed, 2 insertions(+), 1 deletions(-)
+ .../js/jquery.mobile.listview.js                   |    1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
 
 diff --git a/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.listview.js b/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.listview.js
-index 58a2078..0f35aa3 100644
+index 58a2078..a290f9f 100644
 --- a/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.listview.js
 +++ b/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.listview.js
-@@ -183,7 +183,8 @@ $.widget( "mobile.listview", $.mobile.widget, {
-                                               shadow: false,
-                                               corners: false,
-                                               iconpos: "right",
--                                              icon: a.length > 1 || icon === false ? false : icon || "arrow-r",
-+                                              //icon: a.length > 1 || icon === false ? false : icon || "arrow-r",
-+                                              icon: false,
-                                               theme: itemTheme
-                                       });
+@@ -178,6 +178,7 @@ $.widget( "mobile.listview", $.mobile.widget, {
+                               if ( a.length ) {
+                                       icon = item.jqmData("icon");
  
++                                      icon = false;
+                                       item.buttonMarkup({
+                                               wrapperEls: "div",
+                                               shadow: false,
 -- 
-1.7.4.1
+1.7.5.4
 
diff --git a/libs/patch/0004-JQM-Change-button-design-to-meet-Tizen-GUI-Button-Ev.patch b/libs/patch/0004-JQM-Change-button-design-to-meet-Tizen-GUI-Button-Ev.patch
deleted file mode 100644 (file)
index f96c8ff..0000000
+++ /dev/null
@@ -1,252 +0,0 @@
-From 51799bf3c58cd972217fed6fb5453b7ca85cfb65 Mon Sep 17 00:00:00 2001
-From: Koeun Choi <koeun.choi@samsung.com>
-Date: Thu, 16 Feb 2012 16:37:08 +0900
-Subject: [PATCH] JQM : Change button design to meet Tizen GUI, Button Event bug fixed
-
----
- .../js/jquery.mobile.buttonMarkup.js               |  164 +++++++++++++++-----
- 1 files changed, 123 insertions(+), 41 deletions(-)
-
-diff --git a/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.buttonMarkup.js b/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.buttonMarkup.js
-index a08e611..d676ad8 100644
---- a/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.buttonMarkup.js
-+++ b/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.buttonMarkup.js
-@@ -2,6 +2,22 @@
- * "buttons" plugin - for making button-like links
- */
-+/**
-+ * Button Markup modified for TIZEN style.
-+ *
-+ * HTML Attributes:
-+ *
-+ *            data-role:      button
-+ *            data-style : circle, nobg, edit
-+ *
-+ *
-+ * Examples:
-+ *
-+ *    <div  data-role="button" data-inline="true" data-icon="send" data-style="circle"></div>
-+ *    <div  data-role="button" data-inline="true" data-icon="favorite" data-style="nobg">
-+ *    <div  data-role="button" data-inline="true" data-icon="editminus" data-style="edit"></div>
-+ */
-+
- ( function( $, undefined ) {
- $.fn.buttonMarkup = function( options ) {
-@@ -13,6 +29,7 @@ $.fn.buttonMarkup = function( options ) {
-                       o = $.extend( {}, $.fn.buttonMarkup.defaults, {
-                               icon:       options.icon       !== undefined ? options.icon       : el.jqmData( "icon" ),
-                               iconpos:    options.iconpos    !== undefined ? options.iconpos    : el.jqmData( "iconpos" ),
-+                              style:          el.jqmData( "style"),   /* style : default : block. Added "circle", "edit" and "nobg" */
-                               theme:      options.theme      !== undefined ? options.theme      : el.jqmData( "theme" ),
-                               inline:     options.inline     !== undefined ? options.inline     : el.jqmData( "inline" ),
-                               shadow:     options.shadow     !== undefined ? options.shadow     : el.jqmData( "shadow" ),
-@@ -30,8 +47,9 @@ $.fn.buttonMarkup = function( options ) {
-                       buttonText = document.createElement( o.wrapperEls ),
-                       buttonIcon = o.icon ? document.createElement( "span" ) : null;
--              if ( attachEvents ) {
--                      attachEvents();
-+              // Bug fix for jQM : When moving finger out of button after touching down button, button color MUST be returned.
-+              if ( attachTIZENEvents ) {
-+                      attachTIZENEvents();
-               }
-               // if not, try to find closest theme container
-@@ -54,6 +72,10 @@ $.fn.buttonMarkup = function( options ) {
-                       if ( o.iconshadow ) {
-                               iconClass += " ui-icon-shadow";
-                       }
-+
-+                      if ( $(el).text().length == 0 ) { /* No text */
-+                              buttonClass += " ui-btn-icon_only";
-+                      }
-               }
-               if ( o.iconpos ) {
-@@ -73,8 +95,51 @@ $.fn.buttonMarkup = function( options ) {
-                       buttonClass += " ui-shadow";
-               }
--              e.setAttribute( "data-" + $.mobile.ns + "theme", o.theme );
--              el.addClass( buttonClass );
-+              /* Set Button class for Icon BG */
-+              if ( o.style == "circle" ) {    /* Circle BG Button. */
-+                      /* style : no text, Icon only */
-+                      buttonClass += " ui-btn-corner-circle";
-+                      buttonClass += " ui-btn-icon_only";
-+              }
-+              else if ( o.style == "nobg" ){
-+                      /* style : no text, Icon only, no bg */
-+                      buttonClass += " ui-btn-icon-nobg";
-+                      buttonClass += " ui-btn-icon_only";
-+              }
-+              else if ( o.style == "edit" ){ /* Contact Edit style */
-+                      buttonClass += " ui-btn-edit";
-+              }
-+
-+              el.attr( "data-" + $.mobile.ns + "theme", o.theme )
-+                      .addClass( buttonClass );
-+
-+              /* Text Class for text positioning with icon. */
-+              textClass = "ui-btn-text";
-+
-+              if ( o.icon ) {
-+                      if ( $(el).text().length > 0 ) {
-+                              ( o.iconpos == "right" ? textClass += " ui-btn-text-padding-right" : textClass += " ui-btn-text-padding-left" );
-+                              innerClass += " ui-btn-hastxt";
-+                      }
-+                      else {
-+                              if ( o.style == "circle" ) { /* Circle BG Button. */
-+                                      /* style : no text, Icon only */
-+                                      innerClass += " ui-btn-corner-circle";
-+                              }
-+                              else if ( o.style == "nobg" ) {
-+                                      /* style : no text, Icon only, no bg */
-+                                      innerClass += " ui-btn-icon-nobg";
-+                              }
-+
-+                              /* Icon Only : No padding on button-inner. */
-+                              innerClass += " ui-btn-icon-only";
-+                      }
-+              }
-+              else {  /* Text Only */
-+                      if ( $(el).text().length > 0 ) {
-+                              innerClass += " ui-btn-hastxt";
-+                      }
-+              }
-               buttonInner.className = innerClass;
-               buttonInner.setAttribute("aria-hidden", "true");
-@@ -96,7 +161,7 @@ $.fn.buttonMarkup = function( options ) {
-               // TODO obviously it would be nice to pull this element out instead of
-               // retrieving it from the DOM again, but this change is much less obtrusive
-               // and 1.0 draws nigh
--              $.data( e, 'textWrapper', $( buttonText ) );
-+              el.data( 'textWrapper', $( buttonText ) );
-       }
-       return this;
-@@ -114,13 +179,7 @@ function closestEnabledButton( element ) {
-     var cname;
-     while ( element ) {
--              // Note that we check for typeof className below because the element we
--              // handed could be in an SVG DOM where className on SVG elements is defined to
--              // be of a different type (SVGAnimatedString). We only operate on HTML DOM
--              // elements, so we look for plain "string".
--
--        cname = ( typeof element.className === 'string' ) && element.className.split(' ');
--
-+        cname = element.className && element.className.split(' ');
-         if ( cname && $.inArray( "ui-btn", cname ) > -1 && $.inArray( "ui-disabled", cname ) < 0 ) {
-             break;
-         }
-@@ -130,51 +189,74 @@ function closestEnabledButton( element ) {
-     return element;
- }
--var attachEvents = function() {
-+// Attach tizen events...
-+var selectedButton = null;
-+var useScrollview = false;
-+var attachTIZENEvents = function() {
-       $( document ).bind( {
--              "vmousedown": function( event ) {
--                      var btn = closestEnabledButton( event.target ),
--                              $btn, theme;
--
--                      if ( btn ) {
--                              $btn = $( btn );
-+              // button click event comes this order : vmouseover -> vmousedown -> vmouseup -> vmouseout
-+              "vmouseover focus": function( event ) {
-+                      // console.log( event.type );
-+                      var $btn, theme;
-+                      // check if there is selected button... if so, make it to "btn-up" state. 
-+                      if ( selectedButton ) {
-+                              $btn = $( selectedButton );
-                               theme = $btn.attr( "data-" + $.mobile.ns + "theme" );
--                              $btn.removeClass( "ui-btn-up-" + theme ).addClass( "ui-btn-down-" + theme );
-+                              $btn.removeClass( "ui-btn-down-" + theme ).removeClass( "ui-btn-hover-" + theme )
-+                                      .addClass( "ui-btn-up-" + theme );
-                       }
--              },
--              "vmousecancel vmouseup": function( event ) {
--                      var btn = closestEnabledButton( event.target ),
--                              $btn, theme;
--                      if ( btn ) {
--                              $btn = $( btn );
-+                      // new button
-+                      selectedButton = closestEnabledButton( event.target );
-+                      if ( selectedButton ) {
-+                              $btn = $( selectedButton );
-                               theme = $btn.attr( "data-" + $.mobile.ns + "theme" );
--                              $btn.removeClass( "ui-btn-down-" + theme ).addClass( "ui-btn-up-" + theme );
-+                              $btn.removeClass( "ui-btn-up-" + theme ).addClass( "ui-btn-hover-" + theme );
-                       }
-               },
--              "vmouseover focus": function( event ) {
--                      var btn = closestEnabledButton( event.target ),
--                              $btn, theme;
--
--                      if ( btn ) {
--                              $btn = $( btn );
-+              "vmouseout blur": function( event ) {
-+                      // console.log( event.type );
-+                      var $btn, theme;
-+                      if ( selectedButton ) {
-+                              $btn = $( selectedButton );
-                               theme = $btn.attr( "data-" + $.mobile.ns + "theme" );
--                              $btn.removeClass( "ui-btn-up-" + theme ).addClass( "ui-btn-hover-" + theme );
-+                              $btn.removeClass( "ui-btn-hover-" + theme ).removeClass( "ui-btn-down-" + theme ).addClass( "ui-btn-up-" + theme );
-                       }
-               },
--              "vmouseout blur": function( event ) {
--                      var btn = closestEnabledButton( event.target ),
--                              $btn, theme;
-+              "vmousedown": function( event ) {
-+                      var $btn, theme;
--                      if ( btn ) {
--                              $btn = $( btn );
-+                      if ( !selectedButton ) {
-+                              selectedButton = closestEnabledButton( event.target );
-+                      }
-+
-+                      $btn = $( selectedButton );
-+                      theme = $btn.attr( "data-" + $.mobile.ns + "theme" );
-+                      $btn.removeClass( "ui-btn-up-" + theme ).addClass( "ui-btn-down-" + theme );
-+              },
-+              "vmousecancel vmouseup": function( event ) {
-+                      // console.log( event.type );
-+                      var $btn, theme;
-+                      if ( selectedButton ) {
-+                              $btn = $( selectedButton );
-                               theme = $btn.attr( "data-" + $.mobile.ns + "theme" );
--                              $btn.removeClass( "ui-btn-hover-" + theme  + " ui-btn-down-" + theme ).addClass( "ui-btn-up-" + theme );
-+                              $btn.removeClass( "ui-btn-down-" + theme ).addClass( "ui-btn-up-" + theme );
-+
-+                              if ( event.type === "vmousecancel" && useScrollview ) {
-+                                      event.preventDefault();
-+                              }
-+                              selectedButton = null;
-                       }
-+              },
-+              "scrollstart scrollview_scroll": function( event ) {
-+                      // console.log( event.type );
-+                      if ( event.type === "scrollview_scroll" )
-+                              useScrollview = true;
-+                      $(this).trigger("vmousecancel");
-               }
-       });
--      attachEvents = null;
-+      attachTIZENEvents = null;
- };
- //links in bars, or those with  data-role become buttons
--- 
-1.7.0.4
-
diff --git a/libs/patch/0004-JQM-button-event-bug-fixed.patch b/libs/patch/0004-JQM-button-event-bug-fixed.patch
new file mode 100644 (file)
index 0000000..861a5c2
--- /dev/null
@@ -0,0 +1,115 @@
+From 6734ec723c053c9c81949c146a5f3ea5a0fbfdc5 Mon Sep 17 00:00:00 2001
+From: Minkyu Kang <mk7.kang@samsung.com>
+Date: Tue, 28 Feb 2012 14:19:23 +0900
+Subject: [PATCH] JQM: button event bug fixed
+
+Signed-off-by: Koeun Choi <koeun.choi@samsung.com>
+Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
+---
+ .../js/jquery.mobile.buttonMarkup.js               |   74 +++++++++++++-------
+ 1 files changed, 49 insertions(+), 25 deletions(-)
+
+diff --git a/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.buttonMarkup.js b/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.buttonMarkup.js
+index a08e611..d192e37 100644
+--- a/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.buttonMarkup.js
++++ b/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.buttonMarkup.js
+@@ -130,47 +130,71 @@ function closestEnabledButton( element ) {
+     return element;
+ }
++// Bug fix: When moving finger out of button after touching down button, button color MUST be returned.
++// button click event comes this order : vmouseover -> vmousedown -> vmouseup -> vmouseout
++
++var selectedButton = null;
++var useScrollview = false;
++
+ var attachEvents = function() {
+       $( document ).bind( {
+-              "vmousedown": function( event ) {
+-                      var btn = closestEnabledButton( event.target ),
+-                              $btn, theme;
++              "vmouseover focus": function( event ) {
++                      var $btn, theme;
+-                      if ( btn ) {
+-                              $btn = $( btn );
++                      // check if there is selected button... if so, make it to "btn-up" state.
++                      if ( selectedButton ) {
++                              $btn = $( selectedButton );
+                               theme = $btn.attr( "data-" + $.mobile.ns + "theme" );
+-                              $btn.removeClass( "ui-btn-up-" + theme ).addClass( "ui-btn-down-" + theme );
++                              $btn.removeClass( "ui-btn-down-" + theme ).removeClass( "ui-btn-hover-" + theme )
++                                      .addClass( "ui-btn-up-" + theme );
+                       }
+-              },
+-              "vmousecancel vmouseup": function( event ) {
+-                      var btn = closestEnabledButton( event.target ),
+-                              $btn, theme;
+-                      if ( btn ) {
+-                              $btn = $( btn );
++                      selectedButton = closestEnabledButton( event.target );
++                      if ( selectedButton ) {
++                              $btn = $( selectedButton );
+                               theme = $btn.attr( "data-" + $.mobile.ns + "theme" );
+-                              $btn.removeClass( "ui-btn-down-" + theme ).addClass( "ui-btn-up-" + theme );
++                              $btn.removeClass( "ui-btn-up-" + theme ).addClass( "ui-btn-hover-" + theme );
+                       }
+               },
+-              "vmouseover focus": function( event ) {
+-                      var btn = closestEnabledButton( event.target ),
+-                              $btn, theme;
++              "vmouseout blur": function( event ) {
++                      var $btn, theme;
+-                      if ( btn ) {
+-                              $btn = $( btn );
++                      if ( selectedButton ) {
++                              $btn = $( selectedButton );
+                               theme = $btn.attr( "data-" + $.mobile.ns + "theme" );
+-                              $btn.removeClass( "ui-btn-up-" + theme ).addClass( "ui-btn-hover-" + theme );
++                              $btn.removeClass( "ui-btn-hover-" + theme ).removeClass( "ui-btn-down-" + theme ).addClass( "ui-btn-up-" + theme );
+                       }
+               },
+-              "vmouseout blur": function( event ) {
+-                      var btn = closestEnabledButton( event.target ),
+-                              $btn, theme;
++              "vmousedown": function( event ) {
++                      var $btn, theme;
++
++                      if ( !selectedButton ) {
++                              selectedButton = closestEnabledButton( event.target );
++                      }
+-                      if ( btn ) {
+-                              $btn = $( btn );
++                      $btn = $( selectedButton );
++                      theme = $btn.attr( "data-" + $.mobile.ns + "theme" );
++                      $btn.removeClass( "ui-btn-up-" + theme ).addClass( "ui-btn-down-" + theme );
++              },
++              "vmousecancel vmouseup": function( event ) {
++                      var $btn, theme;
++
++                      if ( selectedButton ) {
++                              $btn = $( selectedButton );
+                               theme = $btn.attr( "data-" + $.mobile.ns + "theme" );
+-                              $btn.removeClass( "ui-btn-hover-" + theme  + " ui-btn-down-" + theme ).addClass( "ui-btn-up-" + theme );
++                              $btn.removeClass( "ui-btn-down-" + theme ).addClass( "ui-btn-up-" + theme );
++
++                              if ( event.type === "vmousecancel" && useScrollview ) {
++                                      event.preventDefault();
++                              }
++                              selectedButton = null;
++                      }
++              },
++              "scrollstart scrollview_scroll": function( event ) {
++                      if ( event.type === "scrollview_scroll" ) {
++                              useScrollview = true;
+                       }
++                      $( this ).trigger("vmousecancel");
+               }
+       });
+-- 
+1.7.5.4
+
diff --git a/libs/patch/0005-JQM-Change-button-design-to-meet-TIZEN-UI.patch b/libs/patch/0005-JQM-Change-button-design-to-meet-TIZEN-UI.patch
new file mode 100644 (file)
index 0000000..2985bb0
--- /dev/null
@@ -0,0 +1,100 @@
+From 01ba67004fdeaa1c205935ffb3e6739a9005cc21 Mon Sep 17 00:00:00 2001
+From: Minkyu Kang <mk7.kang@samsung.com>
+Date: Wed, 29 Feb 2012 11:28:03 +0900
+Subject: [PATCH] JQM: Change button design to meet TIZEN UI
+
+Signed-off-by: Lee Wongi <wongi11.lee@samsung.com>
+Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
+---
+ .../js/jquery.mobile.buttonMarkup.js               |   61 +++++++++++++++++++-
+ 1 files changed, 58 insertions(+), 3 deletions(-)
+
+diff --git a/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.buttonMarkup.js b/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.buttonMarkup.js
+index d192e37..93485f1 100644
+--- a/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.buttonMarkup.js
++++ b/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.buttonMarkup.js
+@@ -2,6 +2,21 @@
+ * "buttons" plugin - for making button-like links
+ */
++/*
++ * Button Markup modified for TIZEN style.
++ *
++ * HTML Attributes:
++ *
++ *            data-role: button
++ *            data-style: circle, nobg, edit
++ *
++ * Examples:
++ *
++ *    <div data-role="button" data-inline="true" data-icon="send" data-style="circle"></div>
++ *    <div data-role="button" data-inline="true" data-icon="favorite" data-style="nobg">
++ *    <div data-role="button" data-inline="true" data-icon="editminus" data-style="edit"></div>
++ */
++
+ ( function( $, undefined ) {
+ $.fn.buttonMarkup = function( options ) {
+@@ -73,8 +88,48 @@ $.fn.buttonMarkup = function( options ) {
+                       buttonClass += " ui-shadow";
+               }
+-              e.setAttribute( "data-" + $.mobile.ns + "theme", o.theme );
+-              el.addClass( buttonClass );
++              /* TIZEN style markup */
++              buttonStyle = el.jqmData("style");
++
++              if ( buttonStyle == "circle" ) {
++                      /* style : no text, Icon only */
++                      buttonClass += " ui-btn-corner-circle";
++                      buttonClass += " ui-btn-icon_only";
++              } else if ( buttonStyle == "nobg" ) {
++                      /* style : no text, Icon only, no bg */
++                      buttonClass += " ui-btn-icon-nobg";
++                      buttonClass += " ui-btn-icon_only";
++              } else if ( buttonStyle == "edit" ) {
++                      buttonClass += " ui-btn-edit";
++              }
++
++              if ( o.icon ) {
++                      if ( $(el).text().length > 0 ) {
++                              o.iconpos == "right" ?
++                                      textClass += " ui-btn-text-padding-right" :
++                                      textClass += " ui-btn-text-padding-left";
++
++                              innerClass += " ui-btn-hastxt";
++                      } else {
++                              if ( buttonStyle == "circle" ) {
++                                      /* style : no text, Icon only */
++                                      innerClass += " ui-btn-corner-circle";
++                              } else if ( buttonStyle == "nobg" ) {
++                                      /* style : no text, Icon only, no bg */
++                                      innerClass += " ui-btn-icon-nobg";
++                              }
++
++                              buttonClass += " ui-btn-icon_only";
++                              innerClass += " ui-btn-icon-only";
++                      }
++              } else {
++                      if ( $(el).text().length > 0 ) {
++                              innerClass += " ui-btn-hastxt";
++                      }
++              }
++
++              el.attr( "data-" + $.mobile.ns + "theme", o.theme )
++                      .addClass( buttonClass );
+               buttonInner.className = innerClass;
+               buttonInner.setAttribute("aria-hidden", "true");
+@@ -96,7 +151,7 @@ $.fn.buttonMarkup = function( options ) {
+               // TODO obviously it would be nice to pull this element out instead of
+               // retrieving it from the DOM again, but this change is much less obtrusive
+               // and 1.0 draws nigh
+-              $.data( e, 'textWrapper', $( buttonText ) );
++              el.data( 'textWrapper', $( buttonText ) );
+       }
+       return this;
+-- 
+1.7.5.4
+
diff --git a/libs/patch/0005-JQM-Change-header-footer-code-to-meet-Tizen-GUI.patch b/libs/patch/0005-JQM-Change-header-footer-code-to-meet-Tizen-GUI.patch
deleted file mode 100644 (file)
index 1d49b36..0000000
+++ /dev/null
@@ -1,463 +0,0 @@
-From 372d8508f064dc0a28b44707baf4c0832e75e2ad Mon Sep 17 00:00:00 2001
-From: Minkyu Kang <mk7.kang@samsung.com>
-Date: Thu, 16 Feb 2012 18:00:47 +0900
-Subject: [PATCH 1/2] JQM: Change header/footer code to meet Tizen GUI
-
----
- .../js/jquery.mobile.fixHeaderFooter.js            |  364 ++++++++++++++++----
- 1 files changed, 299 insertions(+), 65 deletions(-)
-
-diff --git a/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.fixHeaderFooter.js b/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.fixHeaderFooter.js
-index 3bb5613..2aa10b5 100644
---- a/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.fixHeaderFooter.js
-+++ b/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.fixHeaderFooter.js
-@@ -1,5 +1,46 @@
--/*
--* "fixHeaderFooter" plugin - on-demand positioning for headers,footers
-+/**
-+* Header/Footer can be created using the 
-+* data-role="header", data-role="footer" attribute to an element.
-+*
-+* Every page in SLP theme have Header&Footer and default footer contains back button
-+* Framework automatically generate footer even though web developer does not define footer
-+* For more detail footer usage, refer Page(page.section.js) guideline
-+*
-+* Attribute:
-+*    data-position : default value is fixed, automatically generated footer has fixed position, 
-+                   in header, web dev. defines header fix or not.
-+* 
-+* Examples:
-+*         
-+*     HTML markup for creating header : 
-+*         <div data-role="header" data-position="fixed">
-+*             <h1>NBeat UI</h1>
-+*         </div>
-+*
-+*     HTML markup for creating 1 button title ( button is available 1~3 )
-+*         <div data-role="header" data-position="fixed">
-+*             <a>Text1</a>
-+*             <h1>Title Area</h1>                     
-+*         </div>
-+*
-+*     HTML markup for creating 2 button and groupControl title ( Groupcontrol is available 2~4 )
-+*     <div data-role="header" data-position="fixed">
-+*         <a>Text</a> 
-+*         <h1>Title Extend 2 Button </h1>
-+*         <a>Text</a>         
-+*         <div data-role="fieldcontain">
-+*             <fieldset data-role="controlgroup" data-type="horizontal">
-+*                 <input type="radio" name="radio-view-8" data-icon="segment-titlestyle-segonly" id="segment1" value="on" checked="checked" />
-+*                 <label for="segment1">All</label>
-+*                 <input type="radio" name="radio-view-8" data-icon="segment-titlestyle-segonly" id="segment2" value="off" />
-+*                 <label for="segment2">Call</label>
-+*             </fieldset>
-+*         </div>                      
-+*     </div>
-+*
-+*     HTML markup for creating footer
-+*         <div data-role="footer" data-position="fixed">
-+*         </div>
- */
- (function( $, undefined ) {
-@@ -50,7 +91,8 @@ $.mobile.fixedToolbars = (function() {
-               touchStopEvent = supportTouch ? "touchend" : "mouseup",
-               stateBefore = null,
-               scrollTriggered = false,
--              touchToggleEnabled = true;
-+              touchToggleEnabled = true,
-+              defaultFooterHeight = 114;
-       function showEventCallback( event ) {
-               // An event that affects the dimensions of the visual viewport has
-@@ -62,12 +104,36 @@ $.mobile.fixedToolbars = (function() {
-               //
-               // If we are in autoHideMode, we don't do anything because we know the scroll
-               // callbacks for the plugin will fire off a show when the scrolling has stopped.
-+
-+
-+              /* resize test : Jinhyuk    */
-+              var footer_filter;
-+              if( $( document ).find( ".ui-page-active" ).length ) 
-+                      footer_filter = $( document ).find( ".ui-page-active" ).find( ":jqmData(role='footer')" );              
-+              else 
-+                      footer_filter = $( document ).find( ":jqmData(role='footer')" ).eq( 0 );        
-+
-+              var footerNavbar = footer_filter.find(".ui-navbar");
-+
-+              if(footer_filter.height()< defaultFooterHeight)
-+                      footer_filter.css("height", defaultFooterHeight);
-+              footer_filter
-+                      .css("top",window.innerHeight  - footer_filter.height())
-+                      .show();        
-+              if(footerNavbar.jqmData("style") == "toolbar"){
-+                      footerNavbar
-+                              .css("width", window.innerWidth - footerNavbar.siblings(".ui-btn").width());            
-+              }                                       
-+              /* resize test : Jinhyuk    */
-+
-               if ( !autoHideMode && currentstate === "overlay" ) {
-                       if ( !delayTimer ) {
--                              $.mobile.fixedToolbars.hide( true );
-+                              /* Fixed header modify for theme-s : Jinhyuk */
-+                              if(!($( event.target).find( ":jqmData(role='header')" ).is(":jqmData(position='fixed')")&&
-+                              $( event.target).find( ":jqmData(role='header')" ).is(".ui-bar-s")))                            
-+                                      $.mobile.fixedToolbars.hide( true );
-                       }
--
--                      $.mobile.fixedToolbars.startShowTimer();
-+                      $.mobile.fixedToolbars.startShowTimer(); 
-               }
-       }
-@@ -107,31 +173,34 @@ $.mobile.fixedToolbars = (function() {
-               ( ( $document.scrollTop() === 0 ) ? $window : $document )
-                       .bind( "scrollstart", function( event ) {
--
--                              scrollTriggered = true;
--
--                              if ( stateBefore === null ) {
--                                      stateBefore = currentstate;
--                              }
--
--                              // We only enter autoHideMode if the headers/footers are in
--                              // an overlay state or the show timer was started. If the
--                              // show timer is set, clear it so the headers/footers don't
--                              // show up until after we're done scrolling.
--                              var isOverlayState = stateBefore == "overlay";
--
--                              autoHideMode = isOverlayState || !!delayTimer;
--
--                              if ( autoHideMode ) {
--                                      $.mobile.fixedToolbars.clearShowTimer();
--
--                                      if ( isOverlayState ) {
--                                              $.mobile.fixedToolbars.hide( true );
-+                              /* Fixed header modify for theme-s : Jinhyuk */
-+                              if(!$( event.target).find( ":jqmData(role='header')" ).is(":jqmData(position='fixed')"))
-+                              {
-+                                      scrollTriggered = true;
-+      
-+                                      if ( stateBefore === null ) {
-+                                              stateBefore = currentstate;
-                                       }
-+      
-+                                      // We only enter autoHideMode if the headers/footers are in
-+                                      // an overlay state or the show timer was started. If the
-+                                      // show timer is set, clear it so the headers/footers don't
-+                                      // show up until after we're done scrolling.
-+                                      var isOverlayState = stateBefore == "overlay";
-+      
-+                                      autoHideMode = isOverlayState || !!delayTimer;
-+      
-+                                      if ( autoHideMode ) {
-+                                              $.mobile.fixedToolbars.clearShowTimer();
-+      
-+                                              if ( isOverlayState ) {
-+                                                              $.mobile.fixedToolbars.hide( true );
-+                                              }
-+                                      }                       
-                               }
-                       })
--                      .bind( "scrollstop", function( event ) {
-+                      .bind( "scrollstop", function( event ) {
-                               if ( $( event.target ).closest( ignoreTargets ).length ) {
-                                       return;
-                               }
-@@ -145,40 +214,201 @@ $.mobile.fixedToolbars = (function() {
-                               stateBefore = null;
-                       });
--                      $window.bind( "resize updatelayout", showEventCallback );
-+                      $window.bind( "resize", showEventCallback );
-       });
-       // 1. Before page is shown, check for duplicate footer
-       // 2. After page is shown, append footer to new page
--      $( ".ui-page" )
--              .live( "pagebeforeshow", function( event, ui ) {
-+      $( ".ui-page" )  /* Fixed header modify for theme-s : Jinhyuk */
-+              .live( "pagebeforeshow", function( event, ui ) {                
-+                      var s_theme_header = $( event.target ).find( ":jqmData(role='header')" );
-+                      var s_theme_fieldcontain = s_theme_header.find( ":jqmData(role='fieldcontain')" );
-+                      var s_theme_content = $( event.target ).find( ".ui-content" );
-+                      var title_style = "normal";
-+                      if( s_theme_fieldcontain.length != 0 ) 
-+                              title_style = "extended";
-+                      
-+                      if( s_theme_header.jqmData("position") == "fixed" || s_theme_header.css("position") == "fixed" ){
-+                              s_theme_header
-+                                      .css( "position", "fixed" )
-+                                      .css( "top", "0px" );
-+                              if( s_theme_header.children().is(".ui-navbar") ) {
-+                                      s_theme_header.addClass( "ui-title-controlbar-height" );
-+                                      $( event.target ).find( ".ui-content" ).addClass( "ui-title-content-controlbar-height" );
-+                              } else
-+                                      $( event.target ).find( ".ui-content" ).addClass( "ui-title-content-" + title_style + "-height" );
-+                      }
-+
-+                      if( s_theme_header.children().is(".ui-option-header") ){
-+                              s_theme_content.removeClass( "ui-title-content-" + title_style + "-height" );
-+                              if( s_theme_header.children().is(".input-search-bar") ){
-+                                      s_theme_content.addClass( "ui-title-content-optionheader-search" );
-+                              } else{
-+                                      if( $.tizen.optionheader.prototype.options.collapseOnInit == true )
-+                                              s_theme_content.addClass( "ui-title-content-option-header-collapsed-1line-height" );
-+                                      else
-+                                              s_theme_content.addClass( "ui-title-content-option-header-expanded-1line-height" );
-+                              }
-+                      } else if( s_theme_header.find("input").jqmData("type") == "search" ){ /* In case searchbar in header : Jinhyuk */
-+                              s_theme_content
-+                                      .removeClass( "ui-title-content-" + title_style + "-height" )
-+                                      .addClass( "ui-title-content-search" );
-+                              }
-+
-+                              if(s_theme_header.children().is("a") || s_theme_header.children().find(".ui-radio").length != 0){
-+                                      if(title_style == "normal"){
-+                                              if(s_theme_header.children("a").length == 1 || s_theme_header.children("a").length == 2){}
-+                                      else if( s_theme_header.children("a").length == 3 ){
-+                                              s_theme_header.find( "a" ).eq( 1 )
-+                                                      .removeClass( "ui-btn-right" )
-+                                                      .addClass( "ui-title-normal-3btn" );
-+                                              s_theme_header.find( "a" ).eq( 2 )
-+                                                      .addClass( "ui-btn-right" );
-+                                      } else {/* Need to implement new layout */}
-+                              } else{
-+                                      var group_length = s_theme_fieldcontain.find( ".ui-radio" ).length;
-+
-+                                      s_theme_header.addClass( "ui-title-extended-height" );
-+                                      s_theme_fieldcontain.find( ".ui-controlgroup" ).addClass( "ui-title-extended-controlgroup" );
-+                                      s_theme_fieldcontain.find( ".ui-controlgroup" ).addClass( "ui-extended-controlgroup" );
-+                                      s_theme_fieldcontain.addClass( "ui-title-extended-segment-style" );
-+
-+                                      if( group_length == 2 || group_length == 3 || group_length == 4 )
-+                                              s_theme_fieldcontain.addClass( "ui-title-extended-controlgroup-" + group_length + "btn" );
-+                                      else { /* Need to implement new layout */}
-+                              }
-+                              s_theme_content.addClass( "ui-title-content-" + title_style + "-height" );
-+                      }
-+
-+                      /* resize footer : Jinhyuk    */
-+                      var footer_filter = $(document).find(":jqmData(role='footer')");
-+                      if( footer_filter.find(".ui-navbar").is(".ui-controlbar-s") ){
-+                              footer_filter
-+                                      .css( "top", window.innerHeight  - footer_filter.height() )
-+                                      .show();
-+                      }               
-+                      /* resize footer : Jinhyuk    */
-+                      if( footer_filter.children().find(".ui-radio").length != 0 ){
-+                              var footerGroup = footer_filter.find( ":jqmData(role='fieldcontain')" );
-+                              var groupLength = footerGroup.find( ".ui-radio" ).length;
-+                              footerGroup.find( ".ui-controlgroup" )
-+                                      .addClass( "ui-extended-controlgroup" )
-+                                      .addClass( "ui-footer-extended-controlgroup" )
-+                                      .css( "display", "inline" );
-+                                      /* Groupcontrol cannot initialize inline property at first page */
-+                              footerGroup.addClass( "ui-title-extended-controlgroup-" + groupLength + "btn" );                                
-+
-+                              footerButton = footer_filter.children( "a" );
-+                              footerButton.each(function(i){
-+                                      if( footerButton.eq(i).is(".ui-btn") && !footerButton.eq(i).is(".ui-btn-back") ){
-+                                              footerButton.eq( i )
-+                                                      .removeClass( "ui-btn-left" )
-+                                                      .addClass( "ui-btn-footer-right" );
-+                                      }
-+                              });
-+                      }
-                       var page = $( event.target ),
--                              footer = page.find( ":jqmData(role='footer')" ),
--                              id = footer.data( "id" ),
--                              prevPage = ui.prevPage,
--                              prevFooter = prevPage && prevPage.find( ":jqmData(role='footer')" ),
--                              prevFooterMatches = prevFooter.length && prevFooter.jqmData( "id" ) === id;
-+                      footer = page.find( ":jqmData(role='footer')" ),
-+                      id = footer.data( "id" ),
-+                      prevPage = ui.prevPage,
-+                      prevFooter = prevPage && prevPage.find( ":jqmData(role='footer')" ),
-+                      prevFooterMatches = prevFooter.length && prevFooter.jqmData( "id" ) === id;
-                       if ( id && prevFooterMatches ) {
-                               stickyFooter = footer;
--                              setTop( stickyFooter.removeClass( "fade in out" ).appendTo( $.mobile.pageContainer ) );
-+                              stickyFooter.removeClass( "fade in out" ).appendTo( $.mobile.pageContainer );
-+                              stickyFooter
-+                                      .css("position", "fixed")
-+                                      .css("top", $(".ui-page").find(":jqmData(role='footer')").eq(0).css("top"));
-+
-+                      }                                                                       
-+                      if( footer.is(".ui-footer-fixed") ){
-+                              footer.css( "top", window.innerHeight - footer.height() );
-+                      }
-+
-+                      /* Increase Content size with dummy <div> because of footer height */
-+                      if( footer.length != 0 && $( event.target ).find(".dummy-div").length == 0 ){
-+                              $( event.target ).find( ":jqmData(role='content')" ).append( '<div class="dummy-div"></div>' );
-+                              $( ".dummy-div" )
-+                                      .css( "width", footer.width() )
-+                                      .css( "height", footer.height() );              
-+                              if( $(".dummy-div").height() < defaultFooterHeight )
-+                                      $( ".dummy-div" ).css( "height", defaultFooterHeight );
-                       }
-+
-+                      /* Header position fix(remove transition) : Jinhyuk */
-+                      var next_id = $( event.target ).attr( "id" );
-+                      $( "#"+next_id ).find( ":jqmData(role='header')" ).removeClass( "fade in out" ).appendTo( $.mobile.pageContainer );
-               })
-+
-               .live( "pageshow", function( event, ui ) {
-+                      /* Fixed header modify for theme-s : Jinhyuk */
-+                      var s_theme_header = $( event.target ).find( ":jqmData(role='header')" );
-+                      if( s_theme_header.is(".ui-header-fixed") && s_theme_header.is(".ui-bar-s") ){  
-+                              $( event.target ).find( ":jqmData(role='header')" )
-+                                      .css( "position", "fixed" )
-+                              .css("top", "0px");
-+                               (( $( document ).scrollTop() === 0 ) ? $( window ) : $( document ) )
-+                                      .unbind( "scrollstart")
-+                                      .unbind( "silentscroll")
-+                                      .unbind( "scrollstop");
-+                      }
-                       var $this = $( this );
-                       if ( stickyFooter && stickyFooter.length ) {
--
-                               setTimeout(function() {
-                                       setTop( stickyFooter.appendTo( $this ).addClass( "fade" ) );
-                                       stickyFooter = null;
-                               }, 500);
-                       }
--                      $.mobile.fixedToolbars.show( true, this );
-+                      $.mobile.fixedToolbars.show( true, this );                                      
-+
-+                      /* Header position fix(remove transition) : Jinhyuk */
-+                      $("body").children(":jqmData(role='header')").insertBefore($(event.target).find(":jqmData(role='content')").eq(0));
-+              })
-+
-+              .live( "vclick", function( event, ui ) {
-+/*
-+                      var previous_index = $(".ui-page-active").find(":jqmData(role='footer')" ).find(".ui-state-persist").parents("li").index();
-+                      var active_index = $(event.target).parents("li").index();
-+                      var navbar_filter = $(".ui-page-active").find(":jqmData(role='footer')" ).find(":jqmData(role='navbar')");
-+                      var element_count = navbar_filter.find('li').length;
-+                      var style = navbar_filter.jqmData( "style" );
-+                      var list_width = $(".ui-page-active").find('.ui-navbar').width()/element_count;
-+                      
-+                      var next_link = $(event.target).parents("a").attr("href");
-+                      
-+                      
-+                      $(".ui-page-active").addClass("ui-btn-hide-style");
-+
-+
-+                      if(navbar_filter.find(".ui-btn-animation").length == 0 && style != "toolbar"){                                  
-+                              $('<div class="ani-focus"></div>').appendTo(navbar_filter.children());
-+                              $(".ani-focus")
-+                                      .addClass("ui-btn-animation")   
-+                                      .removeClass("ui-btn-ani-verticalendposition")
-+                                      .removeClass("ui-btn-ani-endposition");
-+
-+                      }                                       
-+                              $(".ani-focus")                         
-+                                      .css("width", navbar_filter.width()/element_count )
-+                                      .css("height",navbar_filter.css("height"))      
-+                                      .css("left", previous_index * list_width);
-+
-+
-+                              $(".ui-btn-ani-startposition").css("-webkit-transform","translateX("+previous_index *list_width+")");
-+                              $(".ani-focus").addClass("ui-btn-ani-startposition");
-+                              
-+                              var t=setTimeout("",10);
-+                              $(".ui-btn-ani-endposition").css("-webkit-transform","translateX("+active_index *list_width+")");
-+                              $(".ani-focus").removeClass("ui-btn-ani-startposition");
-+                              $(".ani-focus").addClass("ui-btn-ani-endposition");
-+*/
-               });
-+              
-       // When a collapsiable is hidden or shown we need to trigger the fixed toolbar to reposition itself (#1635)
-       $( ".ui-collapsible-contain" ).live( "collapse expand", showEventCallback );
-@@ -215,30 +445,34 @@ $.mobile.fixedToolbars = (function() {
-       }
-       function setTop( el ) {
--              var fromTop = $(window).scrollTop(),
--                      thisTop = getOffsetTop( el[ 0 ] ), // el.offset().top returns the wrong value on iPad iOS 3.2.1, call our workaround instead.
--                      thisCSStop = el.css( "top" ) == "auto" ? 0 : parseFloat(el.css( "top" )),
--                      screenHeight = window.innerHeight,
--                      thisHeight = el.outerHeight(),
--                      useRelative = el.parents( ".ui-page:not(.ui-page-fullscreen)" ).length,
--                      relval;
--
--              if ( el.is( ".ui-header-fixed" ) ) {
--
--                      relval = fromTop - thisTop + thisCSStop;
--
--                      if ( relval < thisTop ) {
--                              relval = 0;
-+              if(!(el.parents(".ui-page").find( ":jqmData(role='header')" ).is(".ui-header-fixed")&&
-+              el.parents(".ui-page").find( ":jqmData(role='header')" ).is(".ui-bar-s"))){                             
-+                      var fromTop = $(window).scrollTop(),
-+                              thisTop = getOffsetTop( el[ 0 ] ), // el.offset().top returns the wrong value on iPad iOS 3.2.1, call our workaround instead.
-+                              thisCSStop = el.css( "top" ) == "auto" ? 0 : parseFloat(el.css( "top" )),
-+                              screenHeight = window.innerHeight,
-+                              thisHeight = el.outerHeight(),
-+                              useRelative = el.parents( ".ui-page:not(.ui-page-fullscreen)" ).length,
-+                              relval;
-+      
-+                      if ( el.is( ".ui-header-fixed" ) ) {
-+      
-+                              relval = fromTop - thisTop + thisCSStop;
-+      
-+                              if ( relval < thisTop ) {
-+                                      relval = 0;
-+                              }
-+      
-+                              return el.css( "top", useRelative ? relval : fromTop );
-+                      } else {
-+                              // relval = -1 * (thisTop - (fromTop + screenHeight) + thisCSStop + thisHeight);
-+                              // if ( relval > thisTop ) { relval = 0; }
-+                              relval = fromTop + screenHeight - thisHeight - (thisTop - thisCSStop );
-+      
-+                              return el.css( "top", useRelative ? relval : fromTop + screenHeight - thisHeight );
-                       }
--
--                      return el.css( "top", useRelative ? relval : fromTop );
--              } else {
--                      // relval = -1 * (thisTop - (fromTop + screenHeight) + thisCSStop + thisHeight);
--                      // if ( relval > thisTop ) { relval = 0; }
--                      relval = fromTop + screenHeight - thisHeight - (thisTop - thisCSStop );
--
--                      return el.css( "top", useRelative ? relval : fromTop + screenHeight - thisHeight );
-               }
-+
-       }
-       // Exposed methods
-@@ -264,16 +498,16 @@ $.mobile.fixedToolbars = (function() {
-                                       thisHeight = el.outerHeight(),
-                                       alreadyVisible = ( el.is( ".ui-header-fixed" ) && fromTop <= thisTop + thisHeight ) ||
-                                                                                                               ( el.is( ".ui-footer-fixed" ) && thisTop <= fromTop + screenHeight );
--
-+// block blink code in title : Jinhyuk
-                               // Add state class
--                              el.addClass( "ui-fixed-overlay" ).removeClass( "ui-fixed-inline" );
-+//                            el.addClass( "ui-fixed-overlay" ).removeClass( "ui-fixed-inline" );
--                              if ( !alreadyVisible && !immediately ) {
-+/*                            if ( !alreadyVisible && !immediately ) {
-                                       el.animationComplete(function() {
-                                               el.removeClass( "in" );
-                                       }).addClass( "in" );
--                              }
--                              setTop(el);
-+                              }*/
-+//                            setTop(el);
-                       });
-               },
--- 
-1.7.5.4
-
diff --git a/libs/patch/0006-JQM-Change-header-footer-code-to-meet-TIZEN-UI.patch b/libs/patch/0006-JQM-Change-header-footer-code-to-meet-TIZEN-UI.patch
new file mode 100644 (file)
index 0000000..5008821
--- /dev/null
@@ -0,0 +1,406 @@
+From f55b2231026c520cc9899aaf8f2279c29e057da3 Mon Sep 17 00:00:00 2001
+From: Minkyu Kang <mk7.kang@samsung.com>
+Date: Wed, 29 Feb 2012 15:44:47 +0900
+Subject: [PATCH] JQM: Change header/footer code to meet TIZEN UI
+
+Signed-off-by: Jun Jinhyuk <jinhyuk.jun@samsung.com>
+Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
+---
+ .../js/jquery.mobile.fixHeaderFooter.js            |  293 +++++++++++++++++++-
+ 1 files changed, 279 insertions(+), 14 deletions(-)
+
+diff --git a/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.fixHeaderFooter.js b/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.fixHeaderFooter.js
+index 3bb5613..0216c65 100644
+--- a/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.fixHeaderFooter.js
++++ b/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.fixHeaderFooter.js
+@@ -2,6 +2,51 @@
+ * "fixHeaderFooter" plugin - on-demand positioning for headers,footers
+ */
++/*
++ * Header/Footer can be created using the
++ * data-role="header", data-role="footer" attribute to an element.
++ *
++ * Every page in SLP theme have Header&Footer and default footer contains back button
++ * Framework automatically generate footer even though web developer does not define footer
++ * For more detail footer usage, refer Page(page.section.js) guideline
++ *
++ * Attribute:
++ *    data-position : default value is fixed, automatically generated footer has fixed position,
++ *                   in header, web dev. defines header fix or not.
++ *
++ * Examples:
++ *
++ *     HTML markup for creating header :
++ *         <div data-role="header" data-position="fixed">
++ *             <h1>NBeat UI</h1>
++ *         </div>
++ *
++ *     HTML markup for creating 1 button title ( button is available 1~3 )
++ *         <div data-role="header" data-position="fixed">
++ *             <a>Text1</a>
++ *             <h1>Title Area</h1>
++ *         </div>
++ *
++ *     HTML markup for creating 2 button and groupControl title ( Groupcontrol is available 2~4 )
++ *     <div data-role="header" data-position="fixed">
++ *         <a>Text</a>
++ *         <h1>Title Extend 2 Button </h1>
++ *         <a>Text</a>
++ *         <div data-role="fieldcontain">
++ *             <fieldset data-role="controlgroup" data-type="horizontal">
++ *                 <input type="radio" name="radio-view-8" data-icon="segment-titlestyle-segonly" id="segment1" value="on" checked="checked" />
++ *                 <label for="segment1">All</label>
++ *                 <input type="radio" name="radio-view-8" data-icon="segment-titlestyle-segonly" id="segment2" value="off" />
++ *                 <label for="segment2">Call</label>
++ *             </fieldset>
++ *         </div>
++ *     </div>
++ *
++ *     HTML markup for creating footer
++ *         <div data-role="footer" data-position="fixed">
++ *         </div>
++ */
++
+ (function( $, undefined ) {
+ var slideDownClass = "ui-header-fixed ui-fixed-inline fade",
+@@ -50,6 +95,7 @@ $.mobile.fixedToolbars = (function() {
+               touchStopEvent = supportTouch ? "touchend" : "mouseup",
+               stateBefore = null,
+               scrollTriggered = false,
++              defaultFooterHeight = 114,
+               touchToggleEnabled = true;
+       function showEventCallback( event ) {
+@@ -62,6 +108,57 @@ $.mobile.fixedToolbars = (function() {
+               //
+               // If we are in autoHideMode, we don't do anything because we know the scroll
+               // callbacks for the plugin will fire off a show when the scrolling has stopped.
++
++              var footer_filter;
++
++              if ( $( document ).find( ".ui-page-active" ).length ) {
++                      footer_filter = $( document ).find( ".ui-page-active" ).find( ":jqmData(role='footer')" );
++              } else {
++                      footer_filter = $( document ).find( ":jqmData(role='footer')" ).eq( 0 );
++              }
++
++              if ( footer_filter.height() < defaultFooterHeight ) {
++                      footer_filter.css("height", defaultFooterHeight);
++              }
++
++              footer_filter
++                      .css( "top", $(window).height() - footer_filter.height() )
++                      .show();
++
++              var footerNavbar = footer_filter.find(".ui-navbar");
++
++              if ( footerNavbar.jqmData("style") == "toolbar" ) {
++                      footerNavbar
++                              .css( "width", $(window).width() - footerNavbar.siblings(".ui-btn").width() );
++              }
++
++              // divide content mode scrollview and non-scrollview
++              // recalculate content area when resize callback occur
++              if ( event.type == "resize" ) {
++                      var s_theme_header =
++                              $( document ).find( ".ui-page-active" ).find( ":jqmData(role='header')" );
++                      var s_theme_content =
++                              $( document ).find( ".ui-page-active" ).find( ":jqmData(role='content')" );
++
++                      if ( $.support.scrollview ) {
++                              if ( s_theme_header.css("position") != "fixed" ) {
++                                      s_theme_header.css( "position", "fixed" );
++                              }
++
++                              s_theme_content.css( "top", s_theme_header.height() );
++                              s_theme_content.css( "height",
++                                              document.documentElement.clientHeight -
++                                              footer_filter.height() - s_theme_header.height() );
++                      } else {
++                              if ( s_theme_header.css("position") != "fixed" ) {
++                                      s_theme_header.css( "position", "relative" );
++                                      s_theme_content
++                                              .css( "top", "0" )
++                                              .css( "height", "" );
++                              }
++                      }
++              }
++
+               if ( !autoHideMode && currentstate === "overlay" ) {
+                       if ( !delayTimer ) {
+                               $.mobile.fixedToolbars.hide( true );
+@@ -107,6 +204,9 @@ $.mobile.fixedToolbars = (function() {
+               ( ( $document.scrollTop() === 0 ) ? $window : $document )
+                       .bind( "scrollstart", function( event ) {
++                              if ( $( event.target ).find(":jqmData(role='header')").is(":jqmData(position='fixed')") ) {
++                                      return;
++                              }
+                               scrollTriggered = true;
+@@ -131,7 +231,6 @@ $.mobile.fixedToolbars = (function() {
+                               }
+                       })
+                       .bind( "scrollstop", function( event ) {
+-
+                               if ( $( event.target ).closest( ignoreTargets ).length ) {
+                                       return;
+                               }
+@@ -145,13 +244,141 @@ $.mobile.fixedToolbars = (function() {
+                               stateBefore = null;
+                       });
+-                      $window.bind( "resize updatelayout", showEventCallback );
++                      $window.bind( "resize", showEventCallback );
+       });
+       // 1. Before page is shown, check for duplicate footer
+       // 2. After page is shown, append footer to new page
+       $( ".ui-page" )
+               .live( "pagebeforeshow", function( event, ui ) {
++                      /* Fixed header modify for theme-s */
++                      var s_theme_header = $( event.target ).find(":jqmData(role='header')");
++                      var s_theme_fieldcontain = s_theme_header.find(":jqmData(role='fieldcontain')");
++                      var s_theme_content = $( event.target ).find(".ui-content");
++                      var title_style = "normal";
++
++                      if ( s_theme_fieldcontain.length != 0 ) {
++                              title_style = "extended";
++                      }
++
++                      if ( s_theme_header.jqmData("position") == "fixed" || window.S.frameworkData.theme.match(/tizen/).length ||
++                              s_theme_header.css("position") == "fixed" ) {
++                              s_theme_header
++                                      .css( "position", "fixed" )
++                                      .css( "top", "0px" );
++
++                              if ( s_theme_header.children().is(".ui-navbar") ) {
++                                      s_theme_header.addClass("ui-title-controlbar-height");
++                                      $( event.target ).find( ".ui-content" )
++                                              .addClass("ui-title-content-controlbar-height");
++                              } else {
++                                      $( event.target ).find( ".ui-content" )
++                                              .addClass("ui-title-content-" + title_style + "-height");
++                              }
++                      }
++
++                      if ( s_theme_header.children().is(".ui-option-header") ) {
++                              s_theme_content.removeClass("ui-title-content-" + title_style + "-height");
++
++                              if ( s_theme_header.children().is(".input-search-bar") ) {
++                                      s_theme_content.addClass("ui-title-content-optionheader-search");
++                              } else {
++                                      if ( $.tizen.optionheader.prototype.options.collapseOnInit == true ) {
++                                              s_theme_content
++                                                      .addClass("ui-title-content-option-header-collapsed-1line-height");
++                                      } else {
++                                              s_theme_content
++                                                      .addClass("ui-title-content-option-header-expanded-1line-height");
++                                      }
++                              }
++                      } else if ( s_theme_header.find("input").jqmData("type") == "search" ) {
++                              s_theme_content
++                                      .removeClass("ui-title-content-" + title_style + "-height")
++                                      .addClass("ui-title-content-search");
++                      }
++
++                      if ( s_theme_header.children().is("a") ||
++                              s_theme_header.children().find(".ui-radio").length != 0 ) {
++                              if ( title_style == "normal" ) {
++                                      if ( s_theme_header.children("a").length == 3 ) {
++                                              s_theme_header.find( "a" ).eq( 1 )
++                                                      .removeClass("ui-btn-right")
++                                                      .addClass("ui-title-normal-3btn");
++
++                                              s_theme_header.find( "a" ).eq( 2 )
++                                                      .addClass("ui-btn-right");
++                                      }
++                              } else {
++                                      var group_length = s_theme_fieldcontain.find(".ui-radio").length;
++
++                                      s_theme_header
++                                              .addClass("ui-title-extended-height");
++
++                                      s_theme_fieldcontain
++                                              .find(".ui-controlgroup")
++                                              .addClass("ui-title-extended-controlgroup");
++
++                                      s_theme_fieldcontain
++                                              .find(".ui-controlgroup")
++                                              .addClass("ui-extended-controlgroup");
++
++                                      s_theme_fieldcontain
++                                              .addClass("ui-title-extended-segment-style");
++
++                                      if ( group_length == 2 || group_length == 3 || group_length == 4 ) {
++                                              s_theme_fieldcontain
++                                                      .addClass("ui-title-extended-controlgroup-" + group_length + "btn");
++                                      }
++                              }
++                              s_theme_content.addClass("ui-title-content-" + title_style + "-height");
++                      }
++
++                      // divide content mode scrollview and non-scrollview
++                      // recalculate content area when resize callback occur
++                      if ( event.type == "resize" ) {
++                              if ( $.support.scrollview ) {
++                                      if ( s_theme_header.css("position") != "fixed" ) {
++                                              s_theme_header.css( "position", "fixed" );
++                                      }
++
++                                      s_theme_content.css( "top", s_theme_header.height() );
++                              } else {
++                                      if ( s_theme_header.css("position") != "fixed" ) {
++                                              s_theme_header.css( "position", "relative" );
++                                              s_theme_content.css( "top", "0" );
++                                      }
++                              }
++                      }
++
++                      var footer_filter = $( document ).find(":jqmData(role='footer')");
++
++                      if ( footer_filter.find(".ui-navbar").is(".ui-controlbar-s") ){
++                              footer_filter
++                                      .css( "top", $(window).height() - footer_filter.height() )
++                                      .show();
++                      }
++
++                      if ( footer_filter.children().find(".ui-radio").length != 0 ) {
++                              var footerGroup = footer_filter.find(":jqmData(role='fieldcontain')");
++                              var groupLength = footerGroup.find(".ui-radio").length;
++
++                              footerGroup.find(".ui-controlgroup")
++                                      .addClass("ui-extended-controlgroup")
++                                      .addClass("ui-footer-extended-controlgroup")
++                                      .css( "display", "inline" );
++
++                                      /* Groupcontrol cannot initialize inline property at first page */
++                              footerGroup.addClass("ui-title-extended-controlgroup-" + groupLength + "btn");
++
++                              footerButton = footer_filter.children("a");
++                              footerButton.each(function( i ) {
++                                      if ( footerButton.eq( i ).is(".ui-btn") && !footerButton.eq( i ).is(".ui-btn-back") ){
++                                              footerButton.eq( i )
++                                                      .removeClass("ui-btn-left")
++                                                      .addClass("ui-btn-footer-right");
++                                      }
++                              });
++                      }
+                       var page = $( event.target ),
+                               footer = page.find( ":jqmData(role='footer')" ),
+@@ -162,15 +389,53 @@ $.mobile.fixedToolbars = (function() {
+                       if ( id && prevFooterMatches ) {
+                               stickyFooter = footer;
+-                              setTop( stickyFooter.removeClass( "fade in out" ).appendTo( $.mobile.pageContainer ) );
++                              stickyFooter.removeClass( "fade in out" ).appendTo( $.mobile.pageContainer );
++                              stickyFooter
++                                      .css("position", "fixed")
++                                      .css("top", $(".ui-page").find(":jqmData(role='footer')").eq( 0 ).css("top"));
++
++                      }
++
++                      if ( footer.is(".ui-footer-fixed") ) {
++                              footer.css( "top", $(window).height() - footer.height() );
++                      }
++
++                      /* Increase Content size with dummy <div> because of footer height */
++                      if ( footer.length != 0 && $( event.target ).find(".dummy-div").length == 0 ) {
++                              $( event.target ).find( ":jqmData(role='content')" ).append( '<div class="dummy-div"></div>' );
++                              $( ".dummy-div" )
++                                      .css( "width", footer.width() )
++                                      .css( "height", footer.height() );
++
++                              if ( $(".dummy-div").height() < defaultFooterHeight ) {
++                                      $( ".dummy-div" ).css( "height", defaultFooterHeight );
++                              }
+                       }
++
++                      /* Header position fix(remove transition) */
++                      var next_id = $( event.target ).attr( "id" );
++
++                      $( "#"+next_id ).find( ":jqmData(role='header')" )
++                              .removeClass( "fade in out" )
++                              .appendTo( $.mobile.pageContainer );
+               })
+               .live( "pageshow", function( event, ui ) {
++                      /* Fixed header modify for theme-s */
++                      var s_theme_header = $( event.target ).find( ":jqmData(role='header')" );
++                      if ( s_theme_header.is(".ui-header-fixed") && s_theme_header.is(".ui-bar-s") ) {
++                              $( event.target ).find(":jqmData(role='header')")
++                                      .css( "position", "fixed" )
++                                      .css( "top", "0px" );
++
++                               ( $( document ).scrollTop() === 0 ? $( window ) : $( document ) )
++                                      .unbind("scrollstart")
++                                      .unbind("silentscroll")
++                                      .unbind("scrollstop");
++                      }
+                       var $this = $( this );
+                       if ( stickyFooter && stickyFooter.length ) {
+-
+                               setTimeout(function() {
+                                       setTop( stickyFooter.appendTo( $this ).addClass( "fade" ) );
+                                       stickyFooter = null;
+@@ -178,8 +443,13 @@ $.mobile.fixedToolbars = (function() {
+                       }
+                       $.mobile.fixedToolbars.show( true, this );
++
++                      /* Header position fix(remove transition) */
++                      $("body").children(":jqmData(role='header')")
++                              .insertBefore( $(event.target).find(":jqmData(role='content')").eq( 0 ) );
+               });
++
+       // When a collapsiable is hidden or shown we need to trigger the fixed toolbar to reposition itself (#1635)
+       $( ".ui-collapsible-contain" ).live( "collapse expand", showEventCallback );
+@@ -215,10 +485,15 @@ $.mobile.fixedToolbars = (function() {
+       }
+       function setTop( el ) {
++              if ( el.parents(".ui-page").find(":jqmData(role='header')").is(".ui-header-fixed") &&
++                      el.parents(".ui-page").find(":jqmData(role='header')").is(".ui-bar-s") ) {
++                      return;
++              }
++
+               var fromTop = $(window).scrollTop(),
+                       thisTop = getOffsetTop( el[ 0 ] ), // el.offset().top returns the wrong value on iPad iOS 3.2.1, call our workaround instead.
+                       thisCSStop = el.css( "top" ) == "auto" ? 0 : parseFloat(el.css( "top" )),
+-                      screenHeight = window.innerHeight,
++                      screenHeight = $(window).height(),
+                       thisHeight = el.outerHeight(),
+                       useRelative = el.parents( ".ui-page:not(.ui-page-fullscreen)" ).length,
+                       relval;
+@@ -260,20 +535,10 @@ $.mobile.fixedToolbars = (function() {
+                                       fromTop = $( window ).scrollTop(),
+                                       // el.offset().top returns the wrong value on iPad iOS 3.2.1, call our workaround instead.
+                                       thisTop = getOffsetTop( el[ 0 ] ),
+-                                      screenHeight = window.innerHeight,
++                                      screenHeight = $(window).height(),
+                                       thisHeight = el.outerHeight(),
+                                       alreadyVisible = ( el.is( ".ui-header-fixed" ) && fromTop <= thisTop + thisHeight ) ||
+                                                                                                               ( el.is( ".ui-footer-fixed" ) && thisTop <= fromTop + screenHeight );
+-
+-                              // Add state class
+-                              el.addClass( "ui-fixed-overlay" ).removeClass( "ui-fixed-inline" );
+-
+-                              if ( !alreadyVisible && !immediately ) {
+-                                      el.animationComplete(function() {
+-                                              el.removeClass( "in" );
+-                                      }).addClass( "in" );
+-                              }
+-                              setTop(el);
+                       });
+               },
+-- 
+1.7.5.4
+
@@ -1,20 +1,23 @@
-From 259750f02a678feeb3ce1da00c8af596ab584303 Mon Sep 17 00:00:00 2001
+From 4755edbf7aaae376a58f94ec98ca433ce98ef0d9 Mon Sep 17 00:00:00 2001
 From: Minkyu Kang <mk7.kang@samsung.com>
-Date: Thu, 16 Feb 2012 18:01:41 +0900
-Subject: [PATCH 2/2] JQM: Add back button into header/footer
+Date: Wed, 29 Feb 2012 16:17:13 +0900
+Subject: [PATCH] JQM: Add back button into header/footer
 
+Signed-off-by: Jun Jinhyuk <jinhyuk.jun@samsung.com>
+Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
 ---
- .../js/jquery.mobile.page.sections.js              |  105 +++++++++++++++++---
- 1 files changed, 91 insertions(+), 14 deletions(-)
+ .../js/jquery.mobile.page.sections.js              |   97 ++++++++++++++++++--
+ 1 files changed, 90 insertions(+), 7 deletions(-)
 
 diff --git a/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.page.sections.js b/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.page.sections.js
-index 2317c0c..9c81ac6 100644
+index 2317c0c..63bba20 100644
 --- a/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.page.sections.js
 +++ b/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.page.sections.js
-@@ -1,5 +1,34 @@
--/*
--* This plugin handles theming and layout of headers, footers, and content areas
-+/**
+@@ -2,6 +2,40 @@
+ * This plugin handles theming and layout of headers, footers, and content areas
+ */
++/*
 + * Page can be created using the calendarpicker() method or by adding a
 + * data-role="page" attribute to an element.
 + *
@@ -23,17 +26,18 @@ index 2317c0c..9c81ac6 100644
 + *
 + * Attribute:
 + *
-+ *    data-back-Btn-Text : determine which text is displayed in back button
-+ *    data-add-Back-Btn : Defines if header/footer has back button or not(default "false")
-+ *    data-back-Btn-Theme : defines back button's theme
-+ *    data-header-Theme = defines header <div>'s theme
-+ *    data-footer-Theme = defines footer <div>'s theme
-+ *    data-content-Theme = defines content <div>'s theme
-+ *    data-footer-Exist =  defines to show default footer or not in each page (SLP default true)
-+ *    data-footer-User-Control-Theme = defines to show default footer in whole page(SLP default false. if true, all document do not has footer)
++ *    data-back-Btn-Text:     determine which text is displayed in back button
++ *    data-add-Back-Btn:      Defines if header/footer has back button or not (default false)
++ *    data-back-Btn-Theme:    defines back button's theme
++ *    data-header-Theme:      defines header <div>'s theme
++ *    data-footer-Theme:      defines footer <div>'s theme
++ *    data-content-Theme:     defines content <div>'s theme
++ *    data-footer-Exist:      defines to show default footer or not in each page (default true)
++ *    data-footer-User-Control-Theme: defines to show default footer in whole page
++ *                            (default false. if true, all document do not has footer)
 + *
 + * Examples:
-+ * 
++ *
 + *     HTML markup for creating Page:
 + *     <div data-role="page">
 + *
@@ -45,24 +49,21 @@ index 2317c0c..9c81ac6 100644
 + *
 + *     How to  remove footer of whole page
 + *     <div data-role="page" id="no-contents-0" data-footer-User-Control="true">
- */
++ */
++
  (function( $, undefined ) {
-@@ -10,29 +39,36 @@ $.mobile.page.prototype.options.backBtnTheme = null;
+ $.mobile.page.prototype.options.backBtnText  = "Back";
+@@ -10,6 +44,8 @@ $.mobile.page.prototype.options.backBtnTheme = null;
  $.mobile.page.prototype.options.headerTheme  = "a";
  $.mobile.page.prototype.options.footerTheme  = "a";
  $.mobile.page.prototype.options.contentTheme = null;
-+$.mobile.page.prototype.options.footerExist = true; /* SLP Default Footer : Jinhyuk */
-+$.mobile.page.prototype.options.footerUserControl = false; /* SLP Default Footer : Jinhyuk */
++$.mobile.page.prototype.options.footerExist = true;
++$.mobile.page.prototype.options.footerUserControl = false;
  
  $( ":jqmData(role='page'), :jqmData(role='dialog')" ).live( "pagecreate", function( e ) {
        
-       var $page = $( this ),
-               o = $page.data( "page" ).options,
--              pageRole = $page.jqmData( "role" ),
-               pageTheme = o.theme;
-       
-       $( ":jqmData(role='header'), :jqmData(role='footer'), :jqmData(role='content')", this ).each(function() {
+@@ -22,17 +58,23 @@ $( ":jqmData(role='page'), :jqmData(role='dialog')" ).live( "pagecreate", functi
                var $this = $( this ),
                        role = $this.jqmData( "role" ),
                        theme = $this.jqmData( "theme" ),
@@ -71,13 +72,12 @@ index 2317c0c..9c81ac6 100644
                        $headeranchors,
                        leftbtn,
                        rightbtn,
--                      backBtn;
-+                      normalFooter, /* SLP Default Footer : Jinhyuk */
-+                      backBtn,
-+                      footerExist = $this.jqmData("footerexist");  /* Footer on / off option : Wongi */
-+              
-+              if ( footerExist != undefined && (footerExist == true || footerExist == false) ){
-+                      /*$.mobile.page.prototype.options.footerExist = footerExist;*/
+                       backBtn;
++
++              var normalFooter,
++                      footerExist = $this.jqmData("footerexist");
++
++              if ( footerExist != undefined ) {
 +                      o.footerExist = footerExist;
 +              }
                        
@@ -89,35 +89,34 @@ index 2317c0c..9c81ac6 100644
                        var thisTheme = theme || ( role === "header" ? o.headerTheme : o.footerTheme ) || pageTheme;
  
                        $this
-@@ -47,20 +83,29 @@ $( ":jqmData(role='page'), :jqmData(role='dialog')" ).live( "pagecreate", functi
+@@ -47,20 +89,31 @@ $( ":jqmData(role='page'), :jqmData(role='dialog')" ).live( "pagecreate", functi
                        rightbtn = $headeranchors.hasClass( "ui-btn-right" );
  
                        leftbtn = leftbtn || $headeranchors.eq( 0 ).not( ".ui-btn-right" ).addClass( "ui-btn-left" ).length;
 -                      
                        rightbtn = rightbtn || $headeranchors.eq( 1 ).addClass( "ui-btn-right" ).length;
 +
-+                      // set default userControl value _ SLP
-+                      if( o.footerUserControl )
++                      // set default userControl value
++                      if ( o.footerUserControl ) {
 +                              $.mobile.page.prototype.options.footerUserControl = "true";
++                      }
                        
                        // Auto-add back btn on pages beyond first view
--                      if ( o.addBackBtn && 
++                      // create backbtn in case footer exist
+                       if ( o.addBackBtn && 
 -                              role === "header" &&
 -                              $( ".ui-page" ).length > 1 &&
-+                      // create backbtn in case footer exist _ SLP
-+                      if( o.addBackBtn &&
++                              role === "footer" &&
 +                              o.footerExist &&
-+                              ( role === "footer" ) &&
                                $this.jqmData( "url" ) !== $.mobile.path.stripHash( location.hash ) &&
                                !leftbtn ) {
--
 -                              backBtn = $( "<a href='#' class='ui-btn-left' data-"+ $.mobile.ns +"rel='back' data-"+ $.mobile.ns +"icon='arrow-l'>"+ o.backBtnText +"</a>" )
-+                              
-+                              backBtn = $( "<a href='#' class='ui-btn-back' data-"+ $.mobile.ns +"rel='back' data-"+ $.mobile.ns +"icon='header-back-btn'></a>" )                             
++                              backBtn = $( "<a href='#' class='ui-btn-back' data-"+ $.mobile.ns +"rel='back' data-"+ $.mobile.ns +"icon='header-back-btn'></a>" )
                                        // If theme is provided, override default inheritance
                                        .attr( "data-"+ $.mobile.ns +"theme", o.backBtnTheme || thisTheme )
--                                      .prependTo( $this );                            
-+                                      .prependTo( $this );
+                                       .prependTo( $this );                            
++
 +
 +                              backBtn.bind( "vclick", function( event ) {
 +                                      window.history.back();
@@ -126,43 +125,34 @@ index 2317c0c..9c81ac6 100644
                        }
  
                        // Page title
-@@ -72,6 +117,10 @@ $( ":jqmData(role='page'), :jqmData(role='dialog')" ).live( "pagecreate", functi
-                                       "role": "heading",
-                                       "aria-level": "1"
-                               });
-+                      //SLP -- start
-+                      // prevent winset selection for header & footer
-+//                    $this.preventDefaultBehaviour();
-+                      //SLP -- end
-               } else if ( role === "content" ) {
-                       if ( contentTheme ) {
-@@ -80,8 +129,36 @@ $( ":jqmData(role='page'), :jqmData(role='dialog')" ).live( "pagecreate", functi
+@@ -80,8 +133,38 @@ $( ":jqmData(role='page'), :jqmData(role='dialog')" ).live( "pagecreate", functi
  
                        // Add ARIA role
                        $this.attr( "role", "main" );
 +
 +                      /* Add default footer to add backbtn */
-+                      // set backbtn in case footer is not exist _ SLP
 +                      thisTheme = "s";
-+                      if( o.footerExist ){
-+                              backBtn = $( "<a href='#' class='ui-btn-back' data-"+ $.mobile.ns +"rel='back' data-"+ $.mobile.ns +"icon='header-back-btn'></a>" )
-+                                      .attr( "data-"+ $.mobile.ns +"theme", o.backBtnTheme || thisTheme );
-+                              var footer = $page.find( "div:jqmData(role='footer')" );                                        
 +
-+                              if( footer.length != 0 ){
-+                                      // add backbtn in case toolbar _ SLP
-+                                      if( !footer.find("jqmData(role='navbar')").is("jqmData(style='tabbar')") ){
-+                                              backBtn.appendTo( footer );     
++                      if ( o.footerExist ) {
++                              backBtn = $( "<a href='#' class='ui-btn-back' data-" +
++                                              $.mobile.ns + "rel='back' data-" +
++                                              $.mobile.ns + "icon='header-back-btn'></a>" )
++                                              .attr( "data-" + $.mobile.ns + "theme", o.backBtnTheme || thisTheme );
++                              var footer = $page.find("div:jqmData(role='footer')");
++
++                              if ( footer.length != 0 ) {
++                                      if ( !footer.find("jqmData(role='navbar')").is("jqmData(style='tabbar')") ) {
++                                              backBtn.appendTo( footer );
 +                                      }
-+                              } else{                                 
-+                                      if( !$.mobile.page.prototype.options.footerUserControl ) {
++                              } else {
++                                      if ( !$.mobile.page.prototype.options.footerUserControl ) {
 +                                              normalFooter = $( "<div data-role='footer' class='ui-footer ui-bar-s ui-footer-fixed fade ui-fixed-overlay' data-position='fixed'></div>" )
-+                                              .insertAfter( $page.find( ".ui-content" ) );
-+                                              backBtn.appendTo( normalFooter );                       
++                                                              .insertAfter( $page.find( ".ui-content" ) );
++                                              backBtn.appendTo( normalFooter );
 +                                      }
 +                              }
-+                              if( backBtn ){
++
++                              if ( backBtn ) {
 +                                      backBtn.bind( "vclick", function( event ) {
 +                                              window.history.back();
 +                                              return false;
diff --git a/libs/patch/0008-JQM-change-click-to-vclick-for-click-routing.patch b/libs/patch/0008-JQM-change-click-to-vclick-for-click-routing.patch
deleted file mode 100644 (file)
index 47b882a..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-From b0074ca866b536d2a8cfbe6a195cd7b8f1cb8e8c Mon Sep 17 00:00:00 2001
-From: Minkyu Kang <mk7.kang@samsung.com>
-Date: Wed, 15 Feb 2012 19:55:16 +0900
-Subject: [PATCH] JQM: change click to vclick for click routing
-
----
- .../js/jquery.mobile.navigation.js                 |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.navigation.js b/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.navigation.js
-index f85a491..555f4b3 100755
---- a/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.navigation.js
-+++ b/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.navigation.js
-@@ -1294,7 +1294,7 @@
-               });
-               // click routing - direct to HTTP or Ajax, accordingly
--              $( document ).bind( "click", function( event ) {
-+              $( document ).bind( "vclick", function( event ) {
-                       if( !$.mobile.linkBindingEnabled ){
-                               return;
-                       }
--- 
-1.7.5.4
-
@@ -1,59 +1,57 @@
-From e424c135d1a438cc234107bb45608baa26139ebc Mon Sep 17 00:00:00 2001
-From: Koeun Choi <koeun.choi@samsung.com>
-Date: Wed, 15 Feb 2012 19:34:44 +0900
-Subject: [PATCH] JQM:checkbox pressed, no-lable support
+From 412619cb65dfa87ee6485afa6bbe810a2705dd67 Mon Sep 17 00:00:00 2001
+From: Minkyu Kang <mk7.kang@samsung.com>
+Date: Wed, 29 Feb 2012 16:46:14 +0900
+Subject: [PATCH] JQM: checkbox pressed, no-lable support
 
+Signed-off-by: Koeun Choi <koeun.choi@samsung.com>
 ---
- .../js/jquery.mobile.forms.checkboxradio.js        |   60 ++++++++++++++++++--
- 1 files changed, 55 insertions(+), 5 deletions(-)
+ .../js/jquery.mobile.forms.checkboxradio.js        |   57 ++++++++++++++++++-
+ 1 files changed, 54 insertions(+), 3 deletions(-)
 
 diff --git a/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.forms.checkboxradio.js b/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.forms.checkboxradio.js
-index d09a422..6b2268f 100644
+index d09a422..9243f2e 100644
 --- a/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.forms.checkboxradio.js
 +++ b/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.forms.checkboxradio.js
-@@ -23,11 +23,22 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
-                       checkedClass = "ui-" + checkedState + activeBtn,
-                       uncheckedClass = "ui-" + uncheckedState,
+@@ -25,10 +25,23 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
                        checkedicon = "ui-icon-" + checkedState,
--                      uncheckedicon = "ui-icon-" + uncheckedState;
-+                      uncheckedicon = "ui-icon-" + uncheckedState,
-+                      checkedpressedicon = checkedicon + "-press",
-+                      uncheckedpressedicon = uncheckedicon + "-press";
+                       uncheckedicon = "ui-icon-" + uncheckedState;
  
++              var checkedpressedicon = checkedicon + "-press",
++                      uncheckedpressedicon = uncheckedicon + "-press";
++
                if ( inputtype !== "checkbox" && inputtype !== "radio" ) {
                        return;
                }
 +              // Support fake label
 +              if ( label.length == 0 ) {
-+                      //fake label
-+                      label = $( "<label for='" + input[ 0 ].id  + "' style='display:block;width:1px;height:1px;'></label>" );
++                      label = $( "<label for='" + input[ 0 ].id  +
++                              "' style='display:block;width:1px;height:1px;'></label>" );
 +              }
 +
 +              // Wrap the input + label in a div
 +              input.add( label )
 +                      .wrapAll( "<div class='ui-" + inputtype + "'></div>" );
++
                // Expose for other methods
                $.extend( this, {
-@@ -36,7 +47,9 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
+                       label: label,
+@@ -36,6 +49,8 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
                        checkedClass: checkedClass,
                        uncheckedClass: uncheckedClass,
                        checkedicon: checkedicon,
--                      uncheckedicon: uncheckedicon
-+                      uncheckedicon: uncheckedicon,
 +                      checkedpressedicon: checkedpressedicon,
-+                      uncheckedpressedicon: uncheckedpressedicon
++                      uncheckedpressedicon: uncheckedpressedicon,
+                       uncheckedicon: uncheckedicon
                });
  
-               // If there's no selected theme...
-@@ -50,11 +63,20 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
+@@ -50,11 +65,19 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
                        shadow: false
                });
  
 -              // Wrap the input + label in a div
 -              input.add( label )
 -                      .wrapAll( "<div class='ui-" + inputtype + "'></div>" );
-+              // TODO : support either data-style or class...
 +              if ( input.hasClass( "favorite" ) ) {
 +                      input.parent().addClass( "favorite" ).end();
 +              }
@@ -70,7 +68,7 @@ index d09a422..6b2268f 100644
                        vmouseover: function( event ) {
                                if ( $( this ).parent().is( ".ui-disabled" ) ) {
                                        event.stopPropagation();
-@@ -154,6 +176,34 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
+@@ -154,6 +177,34 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
                .checkboxradio( "refresh" );
        },
  
@@ -106,5 +104,5 @@ index d09a422..6b2268f 100644
                var input = this.element,
                        label = this.label,
 -- 
-1.7.0.4
+1.7.5.4
 
diff --git a/libs/patch/0009-JQM-Resize-content-in-scrollview.patch b/libs/patch/0009-JQM-Resize-content-in-scrollview.patch
deleted file mode 100644 (file)
index 6c593d6..0000000
+++ /dev/null
@@ -1,214 +0,0 @@
-From c1aaf9af8c239fa8d6da305a74dcbd355fa65c99 Mon Sep 17 00:00:00 2001
-From: Lee Wongi <wongi11.lee@samsung.com>
-Date: Thu, 23 Feb 2012 11:28:27 +0900
-Subject: [PATCH] JQM Resize content in scrollview.
-
-Change-Id: If40d512a7d2df0d038013bb6ebc06de90c13d1af
----
- .../js/jquery.mobile.fixHeaderFooter.js            |  117 +++++++++----------
- 1 files changed, 55 insertions(+), 62 deletions(-)
-
-diff --git a/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.fixHeaderFooter.js b/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.fixHeaderFooter.js
-index 2aa10b5..d05fe11 100644
---- a/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.fixHeaderFooter.js
-+++ b/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.fixHeaderFooter.js
-@@ -105,8 +105,7 @@ $.mobile.fixedToolbars = (function() {
-               // If we are in autoHideMode, we don't do anything because we know the scroll
-               // callbacks for the plugin will fire off a show when the scrolling has stopped.
--
--              /* resize test : Jinhyuk    */
-+              
-               var footer_filter;
-               if( $( document ).find( ".ui-page-active" ).length ) 
-                       footer_filter = $( document ).find( ".ui-page-active" ).find( ":jqmData(role='footer')" );              
-@@ -124,11 +123,38 @@ $.mobile.fixedToolbars = (function() {
-                       footerNavbar
-                               .css("width", window.innerWidth - footerNavbar.siblings(".ui-btn").width());            
-               }                                       
--              /* resize test : Jinhyuk    */
-+              // NOTE : by Jinhyuk Jun <jinhyuk.jun@samsung.com>
-+              //     divide content mode scrollview and non-scrollview
-+              //     recalculate content area when resize callback occur
-+
-+              if(event.type == "resize") /* resize only */
-+              {
-+                      var s_theme_header = $( document ).find( ".ui-page-active" ).find( ":jqmData(role='header')" );
-+                      var s_theme_content = $( document ).find( ".ui-page-active" ).find( ":jqmData(role='content')" );
-+                      
-+                      // data-role != "fixed", scrollview=false -> header scroll support
-+                      if( $.support.scrollview === false && s_theme_header.css("position") != "fixed" ){
-+                              s_theme_header.css( "position", "relative" );
-+                              s_theme_content
-+                                      .css( "top", "0" )
-+                                      .css( "height", "" );
-+                      } else if( $.support.scrollview === true ) {
-+                              if(s_theme_header.css( "position") != "fixed" )
-+                                      s_theme_header.css( "position", "fixed" );
-+                                      s_theme_content.css( "top", s_theme_header.height() );
-+                      }
-+              
-+                      // resize content size in case scrollview
-+                      if( $.support.scrollview === true ) {
-+                              s_theme_content
-+                                      .css( "height", document.documentElement.clientHeight - footer_filter.height() - s_theme_header.height());      
-+                      }
-+              }
-+              
-               if ( !autoHideMode && currentstate === "overlay" ) {
-                       if ( !delayTimer ) {
--                              /* Fixed header modify for theme-s : Jinhyuk */
-+                              /* Fixed header modify for theme-s */
-                               if(!($( event.target).find( ":jqmData(role='header')" ).is(":jqmData(position='fixed')")&&
-                               $( event.target).find( ":jqmData(role='header')" ).is(".ui-bar-s")))                            
-                                       $.mobile.fixedToolbars.hide( true );
-@@ -173,7 +199,7 @@ $.mobile.fixedToolbars = (function() {
-               ( ( $document.scrollTop() === 0 ) ? $window : $document )
-                       .bind( "scrollstart", function( event ) {
--                              /* Fixed header modify for theme-s : Jinhyuk */
-+                              /* Fixed header modify for theme-s */
-                               if(!$( event.target).find( ":jqmData(role='header')" ).is(":jqmData(position='fixed')"))
-                               {
-                                       scrollTriggered = true;
-@@ -219,7 +245,7 @@ $.mobile.fixedToolbars = (function() {
-       // 1. Before page is shown, check for duplicate footer
-       // 2. After page is shown, append footer to new page
--      $( ".ui-page" )  /* Fixed header modify for theme-s : Jinhyuk */
-+      $( ".ui-page" )  /* Fixed header modify for theme-s */
-               .live( "pagebeforeshow", function( event, ui ) {                
-                       var s_theme_header = $( event.target ).find( ":jqmData(role='header')" );
-                       var s_theme_fieldcontain = s_theme_header.find( ":jqmData(role='fieldcontain')" );
-@@ -249,7 +275,7 @@ $.mobile.fixedToolbars = (function() {
-                                       else
-                                               s_theme_content.addClass( "ui-title-content-option-header-expanded-1line-height" );
-                               }
--                      } else if( s_theme_header.find("input").jqmData("type") == "search" ){ /* In case searchbar in header : Jinhyuk */
-+                      } else if( s_theme_header.find("input").jqmData("type") == "search" ){
-                               s_theme_content
-                                       .removeClass( "ui-title-content-" + title_style + "-height" )
-                                       .addClass( "ui-title-content-search" );
-@@ -280,14 +306,30 @@ $.mobile.fixedToolbars = (function() {
-                               s_theme_content.addClass( "ui-title-content-" + title_style + "-height" );
-                       }
--                      /* resize footer : Jinhyuk    */
-+                      // NOTE : by Jinhyuk Jun <jinhyuk.jun@samsung.com>
-+                      //     divide content mode scrollview and non-scrollview
-+                      //     recalculate content area when resize callback occur
-+
-+                      if(event.type == "resize") /* resize only */
-+                      {
-+                              // data-role != "fixed", scrollview=false -> header scroll support
-+                              if( $.support.scrollview === false && s_theme_header.css("position") != "fixed" ){
-+                                      s_theme_header.css( "position", "relative" );
-+                                      s_theme_content.css( "top", "0" );
-+                              } else if( $.support.scrollview === true ){
-+                                      if( s_theme_header.css("position") != "fixed" )
-+                                              s_theme_header.css( "position", "fixed" );
-+                                              s_theme_content.css( "top", s_theme_header.height() );
-+                              }
-+                      }
-+
-                       var footer_filter = $(document).find(":jqmData(role='footer')");
-                       if( footer_filter.find(".ui-navbar").is(".ui-controlbar-s") ){
-                               footer_filter
-                                       .css( "top", window.innerHeight  - footer_filter.height() )
-                                       .show();
-                       }               
--                      /* resize footer : Jinhyuk    */
-+
-                       if( footer_filter.children().find(".ui-radio").length != 0 ){
-                               var footerGroup = footer_filter.find( ":jqmData(role='fieldcontain')" );
-                               var groupLength = footerGroup.find( ".ui-radio" ).length;
-@@ -337,13 +379,13 @@ $.mobile.fixedToolbars = (function() {
-                                       $( ".dummy-div" ).css( "height", defaultFooterHeight );
-                       }
--                      /* Header position fix(remove transition) : Jinhyuk */
-+                      /* Header position fix(remove transition) */
-                       var next_id = $( event.target ).attr( "id" );
-                       $( "#"+next_id ).find( ":jqmData(role='header')" ).removeClass( "fade in out" ).appendTo( $.mobile.pageContainer );
-               })
-               .live( "pageshow", function( event, ui ) {
--                      /* Fixed header modify for theme-s : Jinhyuk */
-+                      /* Fixed header modify for theme-s */
-                       var s_theme_header = $( event.target ).find( ":jqmData(role='header')" );
-                       if( s_theme_header.is(".ui-header-fixed") && s_theme_header.is(".ui-bar-s") ){  
-                               $( event.target ).find( ":jqmData(role='header')" )
-@@ -366,49 +408,10 @@ $.mobile.fixedToolbars = (function() {
-                       $.mobile.fixedToolbars.show( true, this );                                      
--                      /* Header position fix(remove transition) : Jinhyuk */
-+                      /* Header position fix(remove transition) */
-                       $("body").children(":jqmData(role='header')").insertBefore($(event.target).find(":jqmData(role='content')").eq(0));
-               })
--              .live( "vclick", function( event, ui ) {
--/*
--                      var previous_index = $(".ui-page-active").find(":jqmData(role='footer')" ).find(".ui-state-persist").parents("li").index();
--                      var active_index = $(event.target).parents("li").index();
--                      var navbar_filter = $(".ui-page-active").find(":jqmData(role='footer')" ).find(":jqmData(role='navbar')");
--                      var element_count = navbar_filter.find('li').length;
--                      var style = navbar_filter.jqmData( "style" );
--                      var list_width = $(".ui-page-active").find('.ui-navbar').width()/element_count;
--                      
--                      var next_link = $(event.target).parents("a").attr("href");
--                      
--                      
--                      $(".ui-page-active").addClass("ui-btn-hide-style");
--
--
--                      if(navbar_filter.find(".ui-btn-animation").length == 0 && style != "toolbar"){                                  
--                              $('<div class="ani-focus"></div>').appendTo(navbar_filter.children());
--                              $(".ani-focus")
--                                      .addClass("ui-btn-animation")   
--                                      .removeClass("ui-btn-ani-verticalendposition")
--                                      .removeClass("ui-btn-ani-endposition");
--
--                      }                                       
--                              $(".ani-focus")                         
--                                      .css("width", navbar_filter.width()/element_count )
--                                      .css("height",navbar_filter.css("height"))      
--                                      .css("left", previous_index * list_width);
--
--
--                              $(".ui-btn-ani-startposition").css("-webkit-transform","translateX("+previous_index *list_width+")");
--                              $(".ani-focus").addClass("ui-btn-ani-startposition");
--                              
--                              var t=setTimeout("",10);
--                              $(".ui-btn-ani-endposition").css("-webkit-transform","translateX("+active_index *list_width+")");
--                              $(".ani-focus").removeClass("ui-btn-ani-startposition");
--                              $(".ani-focus").addClass("ui-btn-ani-endposition");
--*/
--              });
--              
-       // When a collapsiable is hidden or shown we need to trigger the fixed toolbar to reposition itself (#1635)
-       $( ".ui-collapsible-contain" ).live( "collapse expand", showEventCallback );
-@@ -497,17 +500,7 @@ $.mobile.fixedToolbars = (function() {
-                                       screenHeight = window.innerHeight,
-                                       thisHeight = el.outerHeight(),
-                                       alreadyVisible = ( el.is( ".ui-header-fixed" ) && fromTop <= thisTop + thisHeight ) ||
--                                                                                                              ( el.is( ".ui-footer-fixed" ) && thisTop <= fromTop + screenHeight );
--// block blink code in title : Jinhyuk
--                              // Add state class
--//                            el.addClass( "ui-fixed-overlay" ).removeClass( "ui-fixed-inline" );
--
--/*                            if ( !alreadyVisible && !immediately ) {
--                                      el.animationComplete(function() {
--                                              el.removeClass( "in" );
--                                      }).addClass( "in" );
--                              }*/
--//                            setTop(el);
-+                                                      ( el.is( ".ui-footer-fixed" ) && thisTop <= fromTop + screenHeight );
-                       });
-               },
--- 
-1.7.0.4
-
diff --git a/libs/patch/0009-JQM-remove-search-init-selector-and-functions.patch b/libs/patch/0009-JQM-remove-search-init-selector-and-functions.patch
new file mode 100644 (file)
index 0000000..7a9bd53
--- /dev/null
@@ -0,0 +1,82 @@
+From 83fdd7d7b42cc8a9326f0f991d6a1928c83fb8cf Mon Sep 17 00:00:00 2001
+From: Lee Wongi <wongi11.lee@samsung.com>
+Date: Wed, 29 Feb 2012 14:21:44 +0900
+Subject: [PATCH] JQM remove search init selector and functions.
+
+Signed-off-by: Lee Wongi <wongi11.lee@samsung.com>
+---
+ .../js/jquery.mobile.forms.textinput.js            |   41 ++------------------
+ 1 files changed, 4 insertions(+), 37 deletions(-)
+
+diff --git a/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.forms.textinput.js b/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.forms.textinput.js
+index f44c8a8..44cab9b 100644
+--- a/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.forms.textinput.js
++++ b/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.forms.textinput.js
+@@ -7,7 +7,7 @@
+ $.widget( "mobile.textinput", $.mobile.widget, {
+       options: {
+               theme: null,
+-              initSelector: "input[type='text'], input[type='search'], :jqmData(type='search'), input[type='number'], :jqmData(type='number'), input[type='password'], input[type='email'], input[type='url'], input[type='tel'], textarea, input[type='time'], input[type='date'], input[type='month'], input[type='week'], input[type='datetime'], input[type='datetime-local'], input[type='color'], input:not([type])"
++              initSelector: "input[type='text'], input[type='number'], :jqmData(type='number'), input[type='password'], input[type='email'], input[type='url'], input[type='tel'], textarea, input[type='time'], input[type='date'], input[type='month'], input[type='week'], input[type='datetime'], input[type='datetime-local'], input[type='color'], input:not([type])"
+       },
+       _create: function() {
+@@ -37,38 +37,7 @@ $.widget( "mobile.textinput", $.mobile.widget, {
+               }
+-              //"search" input widget
+-              if ( input.is( "[type='search'],:jqmData(type='search')" ) ) {
+-
+-                      focusedEl = input.wrap( "<div class='ui-input-search ui-shadow-inset ui-btn-corner-all ui-btn-shadow ui-icon-searchfield" + themeclass + "'></div>" ).parent();
+-                      clearbtn = $( "<a href='#' class='ui-input-clear' title='clear text'>clear text</a>" )
+-                              .tap(function( event ) {
+-                                      input.val( "" ).focus();
+-                                      input.trigger( "change" );
+-                                      clearbtn.addClass( "ui-input-clear-hidden" );
+-                                      event.preventDefault();
+-                              })
+-                              .appendTo( focusedEl )
+-                              .buttonMarkup({
+-                                      icon: "delete",
+-                                      iconpos: "notext",
+-                                      corners: true,
+-                                      shadow: true
+-                              });
+-
+-                      function toggleClear() {
+-                              setTimeout(function() {
+-                                      clearbtn.toggleClass( "ui-input-clear-hidden", !input.val() );
+-                              }, 0);
+-                      }
+-
+-                      toggleClear();
+-
+-                      input.bind('paste cut keyup focus change blur', toggleClear);
+-
+-              } else {
+-                      input.addClass( "ui-corner-all ui-shadow-inset" + themeclass );
+-              }
++              input.addClass( "ui-corner-all ui-shadow-inset" + themeclass );
+               input.focus(function() {
+                               focusedEl.addClass( "ui-focus" );
+@@ -110,13 +79,11 @@ $.widget( "mobile.textinput", $.mobile.widget, {
+       },
+       disable: function(){
+-              ( this.element.attr( "disabled", true ).is( "[type='search'],:jqmData(type='search')" ) ?
+-                      this.element.parent() : this.element ).addClass( "ui-disabled" );
++              this.element.attr( "disabled", true ).addClass( "ui-disabled" );
+       },
+       enable: function(){
+-              ( this.element.attr( "disabled", false).is( "[type='search'],:jqmData(type='search')" ) ?
+-                      this.element.parent() : this.element ).removeClass( "ui-disabled" );
++              this.element.attr( "disabled", false).removeClass( "ui-disabled" );
+       }
+ });
+-- 
+1.7.0.4
+
diff --git a/libs/patch/0010-JQM-change-input-s-type-on-fixed-header.patch b/libs/patch/0010-JQM-change-input-s-type-on-fixed-header.patch
new file mode 100644 (file)
index 0000000..9fcdf8d
--- /dev/null
@@ -0,0 +1,26 @@
+From 88c84e8e486540403b51573a28350a707f4b60ef Mon Sep 17 00:00:00 2001
+From: Minkyu Kang <mk7.kang@samsung.com>
+Date: Wed, 29 Feb 2012 16:56:24 +0900
+Subject: [PATCH] JQM change input's type on fixed header
+
+Signed-off-by: Lee Wongi <wongi11.lee@samsung.com>
+---
+ .../js/jquery.mobile.fixHeaderFooter.js            |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.fixHeaderFooter.js b/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.fixHeaderFooter.js
+index 0216c65..8fd9357 100644
+--- a/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.fixHeaderFooter.js
++++ b/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.fixHeaderFooter.js
+@@ -291,7 +291,7 @@ $.mobile.fixedToolbars = (function() {
+                                                       .addClass("ui-title-content-option-header-expanded-1line-height");
+                                       }
+                               }
+-                      } else if ( s_theme_header.find("input").jqmData("type") == "search" ) {
++                      } else if( s_theme_header.find("input").attr("type") === "search" || s_theme_header.find("input").attr("type") === "tizen-search" ) {
+                               s_theme_content
+                                       .removeClass("ui-title-content-" + title_style + "-height")
+                                       .addClass("ui-title-content-search");
+-- 
+1.7.5.4
+
diff --git a/libs/patch/0011-JQM-change-input-s-type-on-fixed-header.patch b/libs/patch/0011-JQM-change-input-s-type-on-fixed-header.patch
deleted file mode 100644 (file)
index 53dee0d..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-From 7cf6c94898a6b9240030cdee5e2dae85fa90ae82 Mon Sep 17 00:00:00 2001
-From: Lee Wongi <wongi11.lee@samsung.com>
-Date: Thu, 23 Feb 2012 16:56:46 +0900
-Subject: [PATCH] JQM change input's type on fixed header.
-
-Change-Id: I42cfcb0654fb4f7f5bc0115b1894d1f4d9942b09
----
- .../js/jquery.mobile.fixHeaderFooter.js            |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
- mode change 100644 => 100755 libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.fixHeaderFooter.js
-
-diff --git a/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.fixHeaderFooter.js b/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.fixHeaderFooter.js
-old mode 100644
-new mode 100755
-index d05fe11..26d0ec3
---- a/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.fixHeaderFooter.js
-+++ b/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.fixHeaderFooter.js
-@@ -275,7 +275,7 @@ $.mobile.fixedToolbars = (function() {
-                                       else
-                                               s_theme_content.addClass( "ui-title-content-option-header-expanded-1line-height" );
-                               }
--                      } else if( s_theme_header.find("input").jqmData("type") == "search" ){
-+                      } else if( s_theme_header.find("input").attr("type") === "tizen-search" ){
-                               s_theme_content
-                                       .removeClass( "ui-title-content-" + title_style + "-height" )
-                                       .addClass( "ui-title-content-search" );
--- 
-1.7.0.4
-
diff --git a/libs/patch/0011-jQuery-Remove-layerX-layerY-events-which-is-deprecat.patch b/libs/patch/0011-jQuery-Remove-layerX-layerY-events-which-is-deprecat.patch
new file mode 100644 (file)
index 0000000..f0801ed
--- /dev/null
@@ -0,0 +1,39 @@
+From 8983a5b902ea20d879321cad4162c91b0efd6bbf Mon Sep 17 00:00:00 2001
+From: Youmin Ha <youmin.ha@samsung.com>
+Date: Fri, 16 Mar 2012 15:16:03 +0900
+Subject: [PATCH] jQuery: Remove layerX, layerY events which is deprecated in webkit
+
+Signed-off-by: Youmin Ha <youmin.ha@samsung.com>
+---
+ libs/js/jquery-1.6.4.js     |    2 +-
+ libs/js/jquery-1.6.4.min.js |    4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/libs/js/jquery-1.6.4.js b/libs/js/jquery-1.6.4.js
+index 11e6d06..2c12adb 100644
+--- a/libs/js/jquery-1.6.4.js
++++ b/libs/js/jquery-1.6.4.js
+@@ -3016,7 +3016,7 @@ jQuery.event = {
+               return event.result;
+       },
+-      props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
++      props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
+       fix: function( event ) {
+               if ( event[ jQuery.expando ] ) {
+diff --git a/libs/js/jquery-1.6.4.min.js b/libs/js/jquery-1.6.4.min.js
+index 628ed9b..1d70aab 100644
+--- a/libs/js/jquery-1.6.4.min.js
++++ b/libs/js/jquery-1.6.4.min.js
+@@ -1,4 +1,4 @@
+ /*! jQuery v1.6.4 http://jquery.com/ | http://jquery.org/license */
+ (function(a,b){function cu(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cr(a){if(!cg[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ch||(ch=c.createElement("iframe"),ch.frameBorder=ch.width=ch.height=0),b.appendChild(ch);if(!ci||!ch.createElement)ci=(ch.contentWindow||ch.contentDocument).document,ci.write((c.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>"),ci.close();d=ci.createElement(a),ci.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ch)}cg[a]=e}return cg[a]}function cq(a,b){var c={};f.each(cm.concat.apply([],cm.slice(0,b)),function(){c[this]=a});return c}function cp(){cn=b}function co(){setTimeout(cp,0);return cn=f.now()}function cf(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ce(){try{return new a.XMLHttpRequest}catch(b){}}function b$(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function bZ(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function bY(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bA.test(a)?d(a,e):bY(a+"["+(typeof e=="object"||f.isArray(e)?b:"")+"]",e,c,d)});else if(!c&&b!=null&&typeof b=="object")for(var e in b)bY(a+"["+e+"]",b[e],c,d);else d(a,b)}function bX(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);e&&f.extend(!0,a,e)}function bW(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bP,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=bW(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=bW(a,c,d,e,"*",g));return l}function bV(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bL),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function by(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?bt:bu;if(d>0){c!=="border"&&f.each(e,function(){c||(d-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?d+=parseFloat(f.css(a,c+this))||0:d-=parseFloat(f.css(a,"border"+this+"Width"))||0});return d+"px"}d=bv(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0,c&&f.each(e,function(){d+=parseFloat(f.css(a,"padding"+this))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+this+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+this))||0)});return d+"px"}function bl(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bd,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bk(a){f.nodeName(a,"input")?bj(a):"getElementsByTagName"in a&&f.grep(a.getElementsByTagName("input"),bj)}function bj(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bi(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function bh(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bg(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c=f.expando,d=f.data(a),e=f.data(b,d);if(d=d[c]){var g=d.events;e=e[c]=f.extend({},d);if(g){delete e.handle,e.events={};for(var h in g)for(var i=0,j=g[h].length;i<j;i++)f.event.add(b,h+(g[h][i].namespace?".":"")+g[h][i].namespace,g[h][i],g[h][i].data)}}}}function bf(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function V(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(Q.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function U(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function M(a,b){return(a&&a!=="*"?a+".":"")+b.replace(y,"`").replace(z,"&")}function L(a){var b,c,d,e,g,h,i,j,k,l,m,n,o,p=[],q=[],r=f._data(this,"events");if(!(a.liveFired===this||!r||!r.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var s=r.live.slice(0);for(i=0;i<s.length;i++)g=s[i],g.origType.replace(w,"")===a.type?q.push(g.selector):s.splice(i--,1);e=f(a.target).closest(q,a.currentTarget);for(j=0,k=e.length;j<k;j++){m=e[j];for(i=0;i<s.length;i++){g=s[i];if(m.selector===g.selector&&(!n||n.test(g.namespace))&&!m.elem.disabled){h=m.elem,d=null;if(g.preType==="mouseenter"||g.preType==="mouseleave")a.type=g.preType,d=f(a.relatedTarget).closest(g.selector)[0],d&&f.contains(h,d)&&(d=h);(!d||d!==h)&&p.push({elem:h,handleObj:g,level:m.level})}}}for(j=0,k=p.length;j<k;j++){e=p[j];if(c&&e.level>c)break;a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments);if(o===!1||a.isPropagationStopped()){c=e.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function J(a,c,d){var e=f.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function D(){return!0}function C(){return!1}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);i&&(d==="queue"||!f.data(a,g,b,!0))&&(d==="mark"||!f.data(a,h,b,!0))&&setTimeout(function(){!f.data(a,g,b,!0)&&!f.data(a,h,b,!0)&&(f.removeData(a,e,!0),i.resolve())},0)}function l(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function k(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(j,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d)}catch(g){}f.data(a,c,d)}else d=b}return d}var c=a.document,d=a.navigator,e=a.location,f=function(){function K(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(K,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=/-([a-z]|[0-9])/ig,x=/^-ms-/,y=function(a,b){return(b+"").toUpperCase()},z=d.userAgent,A,B,C,D=Object.prototype.toString,E=Object.prototype.hasOwnProperty,F=Array.prototype.push,G=Array.prototype.slice,H=String.prototype.trim,I=Array.prototype.indexOf,J={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=n.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.6.4",length:0,size:function(){return this.length},toArray:function(){return G.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?F.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),B.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(G.apply(this,arguments),"slice",G.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:F,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;B.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!B){B=e._Deferred();if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",C,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",C),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&K()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNaN:function(a){return a==null||!m.test(a)||isNaN(a)},type:function(a){return a==null?String(a):J[D.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!E.call(a,"constructor")&&!E.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||E.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(o.test(b.replace(p,"@").replace(q,"]").replace(r,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(x,"ms-").replace(w,y)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:H?function(a){return a==null?"":H.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?F.call(c,a):e.merge(c,a)}return c},inArray:function(a,b){if(!b)return-1;if(I)return I.call(b,a);for(var c=0,d=b.length;c<d;c++)if(b[c]===a)return c;return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=G.call(arguments,2),g=function(){return a.apply(c,f.concat(G.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h){var i=a.length;if(typeof c=="object"){for(var j in c)e.access(a,j,c[j],f,g,d);return a}if(d!==b){f=!h&&f&&e.isFunction(d);for(var k=0;k<i;k++)g(a[k],c,f?d.call(a[k],k,g(a[k],c)):d,h);return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=s.exec(a)||t.exec(a)||u.exec(a)||a.indexOf("compatible")<0&&v.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){J["[object "+b+"]"]=b.toLowerCase()}),A=e.uaMatch(z),A.browser&&(e.browser[A.browser]=!0,e.browser.version=A.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?C=function(){c.removeEventListener("DOMContentLoaded",C,!1),e.ready()}:c.attachEvent&&(C=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",C),e.ready())});return e}(),g="done fail isResolved isRejected promise then always pipe".split(" "),h=[].slice;f.extend({_Deferred:function(){var a=[],b,c,d,e={done:function(){if(!d){var c=arguments,g,h,i,j,k;b&&(k=b,b=0);for(g=0,h=c.length;g<h;g++)i=c[g],j=f.type(i),j==="array"?e.done.apply(e,i):j==="function"&&a.push(i);k&&e.resolveWith(k[0],k[1])}return this},resolveWith:function(e,f){if(!d&&!b&&!c){f=f||[],c=1;try{while(a[0])a.shift().apply(e,f)}finally{b=[e,f],c=0}}return this},resolve:function(){e.resolveWith(this,arguments);return this},isResolved:function(){return!!c||!!b},cancel:function(){d=1,a=[];return this}};return e},Deferred:function(a){var b=f._Deferred(),c=f._Deferred(),d;f.extend(b,{then:function(a,c){b.done(a).fail(c);return this},always:function(){return b.done.apply(b,arguments).fail.apply(this,arguments)},fail:c.done,rejectWith:c.resolveWith,reject:c.resolve,isRejected:c.isResolved,pipe:function(a,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[c,"reject"]},function(a,c){var e=c[0],g=c[1],h;f.isFunction(e)?b[a](function(){h=e.apply(this,arguments),h&&f.isFunction(h.promise)?h.promise().then(d.resolve,d.reject):d[g+"With"](this===b?d:this,[h])}):b[a](d[g])})}).promise()},promise:function(a){if(a==null){if(d)return d;d=a={}}var c=g.length;while(c--)a[g[c]]=b[g[c]];return a}}),b.done(c.cancel).fail(b.cancel),delete b.cancel,a&&a.call(b,b);return b},when:function(a){function i(a){return function(c){b[a]=arguments.length>1?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0))}}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred();if(d>1){for(;c<d;c++)b[c]&&f.isFunction(b[c].promise)?b[c].promise().then(i(c),g.reject):--e;e||g.resolveWith(g,b)}else g!==a&&g.resolveWith(g,d?[a]:[]);return g.promise()}}),f.support=function(){var a=c.createElement("div"),b=c.documentElement,d,e,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;a.setAttribute("className","t"),a.innerHTML="   <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=a.getElementsByTagName("input")[0],k={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55$/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,k.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,k.optDisabled=!h.disabled;try{delete a.test}catch(v){k.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function(){k.noCloneEvent=!1}),a.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),k.radioValue=i.value==="t",i.setAttribute("checked","checked"),a.appendChild(i),l=c.createDocumentFragment(),l.appendChild(a.firstChild),k.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",m=c.getElementsByTagName("body")[0],o=c.createElement(m?"div":"body"),p={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},m&&f.extend(p,{position:"absolute",left:"-1000px",top:"-1000px"});for(t in p)o.style[t]=p[t];o.appendChild(a),n=m||b,n.insertBefore(o,n.firstChild),k.appendChecked=i.checked,k.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,k.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="<div style='width:4px;'></div>",k.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>",q=a.getElementsByTagName("td"),u=q[0].offsetHeight===0,q[0].style.display="",q[1].style.display="none",k.reliableHiddenOffsets=u&&q[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",a.appendChild(j),k.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0),o.innerHTML="",n.removeChild(o);if(a.attachEvent)for(t in{submit:1,change:1,focusin:1})s="on"+t,u=s in a,u||(a.setAttribute(s,"return;"),u=typeof a[s]=="function"),k[t+"Bubbles"]=u;o=l=g=h=m=j=a=i=null;return k}(),f.boxModel=f.support.boxModel;var i=/^(?:\{.*\}|\[.*\])$/,j=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!l(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i=f.expando,j=typeof c=="string",k=a.nodeType,l=k?f.cache:a,m=k?a[f.expando]:a[f.expando]&&f.expando;if((!m||e&&m&&l[m]&&!l[m][i])&&j&&d===b)return;m||(k?a[f.expando]=m=++f.uuid:m=f.expando),l[m]||(l[m]={},k||(l[m].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?l[m][i]=f.extend(l[m][i],c):l[m]=f.extend(l[m],c);g=l[m],e&&(g[i]||(g[i]={}),g=g[i]),d!==b&&(g[f.camelCase(c)]=d);if(c==="events"&&!g[c])return g[i]&&g[i].events;j?(h=g[c],h==null&&(h=g[f.camelCase(c)])):h=g;return h}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e=f.expando,g=a.nodeType,h=g?f.cache:a,i=g?a[f.expando]:f.expando;if(!h[i])return;if(b){d=c?h[i][e]:h[i];if(d){d[b]||(b=f.camelCase(b)),delete d[b];if(!l(d))return}}if(c){delete h[i][e];if(!l(h[i]))return}var j=h[i][e];f.support.deleteExpando||!h.setInterval?delete h[i]:h[i]=null,j?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=j):g&&(f.support.deleteExpando?delete a[f.expando]:a.removeAttribute?a.removeAttribute(f.expando):a[f.expando]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d=null;if(typeof a=="undefined"){if(this.length){d=f.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,g;for(var h=0,i=e.length;h<i;h++)g=e[h].name,g.indexOf("data-")===0&&(g=f.camelCase(g.substring(5)),k(this[0],g,d[g]))}}return d}if(typeof a=="object")return this.each(function(){f.data(this,a)});var j=a.split(".");j[1]=j[1]?"."+j[1]:"";if(c===b){d=this.triggerHandler("getData"+j[1]+"!",[j[0]]),d===b&&this.length&&(d=f.data(this[0],a),d=k(this[0],a,d));return d===b&&j[1]?this.data(j[0]):d}return this.each(function(){var b=f(this),d=[j[0],c];b.triggerHandler("setData"+j[1]+"!",d),f.data(this,a,c),b.triggerHandler("changeData"+j[1]+"!",d)})},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,c){a&&(c=(c||"fx")+"mark",f.data(a,c,(f.data(a,c,b,!0)||0)+1,!0))},_unmark:function(a,c,d){a!==!0&&(d=c,c=a,a=!1);if(c){d=d||"fx";var e=d+"mark",g=a?0:(f.data(c,e,b,!0)||1)-1;g?f.data(c,e,g,!0):(f.removeData(c,e,!0),m(c,d,"mark"))}},queue:function(a,c,d){if(a){c=(c||"fx")+"queue";var e=f.data(a,c,b,!0);d&&(!e||f.isArray(d)?e=f.data(a,c,f.makeArray(d),!0):e.push(d));return e||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e;d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),d.call(a,function(){f.dequeue(a,b)})),c.length||(f.removeData(a,b+"queue",!0),m(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){typeof a!="string"&&(c=a,a="fx");if(c===b)return f.queue(this[0],a);return this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(){var c=this;setTimeout(function(){f.dequeue(c,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f._Deferred(),!0))h++,l.done(m);m();return d.promise()}});var n=/[\n\t\r]/g,o=/\s+/,p=/\r/g,q=/^(?:button|input)$/i,r=/^(?:button|input|object|select|textarea)$/i,s=/^a(?:rea)?$/i,t=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,u,v;f.fn.extend({attr:function(a,b){return f.access(this,a,b,!0,f.attr)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,a,b,!0,f.prop)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(o);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(o);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(n," ");for(i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(o);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ";for(var c=0,d=this.length;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(n," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e=this[0];if(!arguments.length){if(e){c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type];if(c&&"get"in c&&(d=c.get(e,"value"))!==b)return d;d=e.value;return typeof d=="string"?d.replace(p,""):d==null?"":d}return b}var g=f.isFunction(a);return this.each(function(d){var e=f(this),h;if(this.nodeType===1){g?h=a.call(this,d,e.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c=a.selectedIndex,d=[],e=a.options,g=a.type==="select-one";if(c<0)return null;for(var h=g?c:0,i=g?c+1:e.length;h<i;h++){var j=e[h];if(j.selected&&(f.support.optDisabled?!j.disabled:j.getAttribute("disabled")===null)&&(!j.parentNode.disabled||!f.nodeName(j.parentNode,"optgroup"))){b=f(j).val();if(g)return b;d.push(b)}}if(g&&!d.length&&e.length)return f(e[c]).val();return d},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var g=a.nodeType;if(!a||g===3||g===8||g===2)return b;if(e&&c in f.attrFn)return f(a)[c](d);if(!("getAttribute"in a))return f.prop(a,c,d);var h,i,j=g!==1||!f.isXMLDoc(a);j&&(c=f.attrFix[c]||c,i=f.attrHooks[c],i||(t.test(c)?i=v:u&&(i=u)));if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(i&&"set"in i&&j&&(h=i.set(a,d,c))!==b)return h;a.setAttribute(c,""+d);return d}if(i&&"get"in i&&j&&(h=i.get(a,c))!==null)return h;h=a.getAttribute(c);return h===null?b:h},removeAttr:function(a,b){var c;a.nodeType===1&&(b=f.attrFix[b]||b,f.attr(a,b,""),a.removeAttribute(b),t.test(b)&&(c=f.propFix[b]||b)in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(q.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},value:{get:function(a,b){if(u&&f.nodeName(a,"button"))return u.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(u&&f.nodeName(a,"button"))return u.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e=a.nodeType;if(!a||e===3||e===8||e===2)return b;var g,h,i=e!==1||!f.isXMLDoc(a);i&&(c=f.propFix[c]||c,h=f.propHooks[c]);return d!==b?h&&"set"in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get"in h&&(g=h.get(a,c))!==null?g:a[c]},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):r.test(a.nodeName)||s.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabIndex=f.propHooks.tabIndex,v={get:function(a,c){var d;return f.prop(a,c)===!0||(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},f.support.getSetAttribute||(u=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&d.nodeValue!==""?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})})),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var w=/\.(.*)$/,x=/^(?:textarea|input|select)$/i,y=/\./g,z=/ /g,A=/[^\w\s.|`]/g,B=function(a){return a.replace(A,"\\$&")};f.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1)d=C;else if(!d)return;var g,h;d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);var i=f._data(a);if(!i)return;var j=i.events,k=i.handle;j||(i.events=j={}),k||(i.handle=k=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.handle.apply(k.elem,arguments):b}),k.elem=a,c=c.split(" ");var l,m=0,n;while(l=c[m++]){h=g?f.extend({},g):{handler:d,data:e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);var o=j[l],p=f.event.special[l]||{};if(!o){o=j[l]=[];if(!p.setup||p.setup.call(a,e,n,k)===!1)a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k)}p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0}a=null}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=C);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=f.hasData(a)&&f._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(h in t)f.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),B).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!d){for(j=0;j<p.length;j++){q=p[j];if(l||n.test(q.namespace))f.event.remove(a,r,q.handler,j),p.splice(j--,1)}continue}o=f.event.special[h]||{};for(j=e||0;j<p.length;j++){q=p[j];if(d.guid===q.guid){if(l||n.test(q.namespace))e==null&&p.splice(j--,1),o.remove&&o.remove.call(a,q);if(e!=null)break}}if(p.length===0||e!=null&&p.length===1)(!o.teardown||o.teardown.call(a,m)===!1)&&f.removeEvent(a,h,s.handle),g=null,delete 
+-t[h]}if(f.isEmptyObject(t)){var u=s.handle;u&&(u.elem=null),delete s.events,delete s.handle,f.isEmptyObject(s)&&f.removeData(a,b,!0)}}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){var h=c.type||c,i=[],j;h.indexOf("!")>=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!e)c.preventDefault(),c.stopPropagation();if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem)});return}if(e.nodeType===3||e.nodeType===8)return;c.result=b,c.target=e,d=d!=null?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())}catch(p){}n&&(e[l]=n),f.event.triggered=b}}return c.result}},handle:function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;h<i;h++){var j=d[h];if(e||c.namespace_re.test(j.namespace)){c.handler=j.handler,c.data=j.data,c.handleObj=j;var k=j.handler.apply(this,g);k!==b&&(c.result=k,k===!1&&(c.preventDefault(),c.stopPropagation()));if(c.isImmediatePropagationStopped())break}}return c.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(a){if(a[f.expando])return a;var d=a;a=f.Event(d);for(var e=this.props.length,g;e;)g=this.props[--e],a[g]=d[g];a.target||(a.target=a.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),!a.relatedTarget&&a.fromElement&&(a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement);if(a.pageX==null&&a.clientX!=null){var h=a.target.ownerDocument||c,i=h.documentElement,j=h.body;a.pageX=a.clientX+(i&&i.scrollLeft||j&&j.scrollLeft||0)-(i&&i.clientLeft||j&&j.clientLeft||0),a.pageY=a.clientY+(i&&i.scrollTop||j&&j.scrollTop||0)-(i&&i.clientTop||j&&j.clientTop||0)}a.which==null&&(a.charCode!=null||a.keyCode!=null)&&(a.which=a.charCode!=null?a.charCode:a.keyCode),!a.metaKey&&a.ctrlKey&&(a.metaKey=a.ctrlKey),!a.which&&a.button!==b&&(a.which=a.button&1?1:a.button&2?3:a.button&4?2:0);return a},guid:1e8,proxy:f.proxy,special:{ready:{setup:f.bindReady,teardown:f.noop},live:{add:function(a){f.event.add(this,M(a.origType,a.selector),f.extend({},a,{handler:L,guid:a.handler.guid}))},remove:function(a){f.event.remove(this,M(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}}},f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!this.preventDefault)return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?D:C):this.type=a,b&&f.extend(this,b),this.timeStamp=f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=D;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=D;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=D,this.stopPropagation()},isDefaultPrevented:C,isPropagationStopped:C,isImmediatePropagationStopped:C};var E=function(a){var b=a.relatedTarget,c=!1,d=a.type;a.type=a.data,b!==this&&(b&&(c=f.contains(this,b)),c||(f.event.handle.apply(this,arguments),a.type=d))},F=function(a){a.type=a.data,f.event.handle.apply(this,arguments)};f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={setup:function(c){f.event.add(this,b,c&&c.selector?F:E,a)},teardown:function(a){f.event.remove(this,b,a&&a.selector?F:E)}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(a,b){if(!f.nodeName(this,"form"))f.event.add(this,"click.specialSubmit",function(a){var b=a.target,c=f.nodeName(b,"input")||f.nodeName(b,"button")?b.type:"";(c==="submit"||c==="image")&&f(b).closest("form").length&&J("submit",this,arguments)}),f.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,c=f.nodeName(b,"input")||f.nodeName(b,"button")?b.type:"";(c==="text"||c==="password")&&f(b).closest("form").length&&a.keyCode===13&&J("submit",this,arguments)});else return!1},teardown:function(a){f.event.remove(this,".specialSubmit")}});if(!f.support.changeBubbles){var G,H=function(a){var b=f.nodeName(a,"input")?a.type:"",c=a.value;b==="radio"||b==="checkbox"?c=a.checked:b==="select-multiple"?c=a.selectedIndex>-1?f.map(a.options,function(a){return a.selected}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex);return c},I=function(c){var d=c.target,e,g;if(!!x.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=H(d),(c.type!=="focusout"||d.type!=="radio")&&f._data(d,"_change_data",g);if(e===b||g===e)return;if(e!=null||g)c.type="change",c.liveFired=b,f.event.trigger(c,arguments[1],d)}};f.event.special.change={filters:{focusout:I,beforedeactivate:I,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&I.call(this,a)},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&I.call(this,a)},beforeactivate:function(a){var b=a.target;f._data(b,"_change_data",H(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in G)f.event.add(this,c+".specialChange",G[c]);return x.test(this.nodeName)},teardown:function(a){f.event.remove(this,".specialChange");return x.test(this.nodeName)}},G=f.event.special.change.filters,G.focus=G.beforeactivate}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;if(typeof a=="object"){for(var h in a)this[c](h,d,a[h],e);return this}if(arguments.length===2||d===!1)e=d,d=b;c==="one"?(g=function(a){f(this).unbind(a,g);return e.apply(this,arguments)},g.guid=e.guid||f.guid++):g=e;if(a==="unload"&&c!=="one")this.one(a,d,e);else for(var i=0,j=this.length;i<j;i++)f.event.add(this[i],a,g,d);return this}}),f.fn.extend({unbind:function(a,b){if(typeof a=="object"&&!a.preventDefault)for(var c in a)this.unbind(c,a[c]);else for(var d=0,e=this.length;d<e;d++)f.event.remove(this[d],a,b);return this},delegate:function(a,b,c,d){return this.live(b,c,d,a)},undelegate:function(a,b,c){return arguments.length===0?this.unbind("live"):this.die(b,null,c,a)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f.data(this,"lastToggle"+a.guid)||0)%d;f.data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var K={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};f.each(["live","die"],function(a,c){f.fn[c]=function(a,d,e,g){var h,i=0,j,k,l,m=g||this.selector,n=g?this:f(this.context);if(typeof a=="object"&&!a.preventDefault){for(var o in a)n[c](o,d,a[o],m);return this}if(c==="die"&&!a&&g&&g.charAt(0)==="."){n.unbind(g);return this}if(d===!1||f.isFunction(d))e=d||C,d=b;a=(a||"").split(" ");while((h=a[i++])!=null){j=w.exec(h),k="",j&&(k=j[0],h=h.replace(w,""));if(h==="hover"){a.push("mouseenter"+k,"mouseleave"+k);continue}l=h,K[h]?(a.push(K[h]+k),h=h+k):h=(K[h]||h)+k;if(c==="live")for(var p=0,q=n.length;p<q;p++)f.event.add(n[p],"live."+M(h,m),{data:d,selector:m,handler:e,origType:h,origHandler:e,preType:l});else n.unbind("live."+M(h,m),e)}return this}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}if(i.nodeType===1){f||(i.sizcache=c,i.sizset=g);if(typeof b!="string"){if(i===b){j=!0;break}}else if(k.filter(b,[i]).length>0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}i.nodeType===1&&!f&&(i.sizcache=c,i.sizset=g);if(i.nodeName.toLowerCase()===b){j=i;break}i=i[a]}d[g]=j}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,f,g){f=f||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return f;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(e.call(n)==="[object Array]")if(!u)f.push.apply(f,n);else if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&f.push(j[t]);else p(n,f);o&&(k(o,h,f,g),k.uniqueSort(f));return f};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},k.matches=function(a,b){return k(a,null,null,b)},k.matchesSelector=function(a,b){return k(b,null,null,[a]).length>0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e<f;e++){var g,h=l.order[e];if(g=l.leftMatch[h].exec(a)){var j=g[1];g.splice(1,1);if(j.substr(j.length-1)!=="\\"){g[1]=(g[1]||"").replace(i,""),d=l.find[h](g,b,c);if(d!=null){a=a.replace(l.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},k.filter=function(a,c,d,e){var f,g,h=a,i=[],j=c,m=c&&c[0]&&k.isXML(c[0]);while(a&&c.length){for(var n in l.filter)if((f=l.leftMatch[n].exec(a))!=null&&f[2]){var o,p,q=l.filter[n],r=f[1];g=!1,f.splice(1,1);if(r.substr(r.length-1)==="\\")continue;j===i&&(i=[]);if(l.preFilter[n]){f=l.preFilter[n](f,j,d,i,e,m);if(!f)g=o=!0;else if(f===!0)continue}if(f)for(var s=0;(p=j[s])!=null;s++)if(p){o=q(p,f,s,j);var t=e^!!o;d&&o!=null?t?g=!0:j[s]=!1:t&&(i.push(p),g=!0)}if(o!==b){d||(j=i),a=a.replace(l.match[n],"");if(!g)return[];break}}if(a===h)if(g==null)k.error(a);else break;h=a}return j},k.error=function(a){throw"Syntax error, unrecognized expression: "+a};var l=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!j.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&k.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&k.filter(b,a,!0)}},"":function(a,b,c){var e,f=d++,g=u;typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),e=b,g=t),g("parentNode",b,f,a,e,c)},"~":function(a,b,c){var e,f=d++,g=u;typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),e=b,g=t),g("previousSibling",b,f,a,e,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(i,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=d++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}k.error(e)},CHILD:function(a,b){var c=b[1],d=a;switch(c){case"only":case"first":while(d=d.previousSibling)if(d.nodeType===1)return!1;if(c==="first")return!0;d=a;case"last":while(d=d.nextSibling)if(d.nodeType===1)return!1;return!0;case"nth":var e=b[2],f=b[3];if(e===1&&f===0)return!0;var g=b[0],h=a.parentNode;if(h&&(h.sizcache!==g||!a.nodeIndex)){var i=0;for(d=h.firstChild;d;d=d.nextSibling)d.nodeType===1&&(d.nodeIndex=++i);h.sizcache=g}var j=a.nodeIndex-f;return e===0?j===0:j%e===0&&j/e>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(e.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var f=a.length;c<f;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var r,s;c.documentElement.compareDocumentPosition?r=function(a,b){if(a===b){g=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(r=function(a,b){if(a===b){g=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],h=a.parentNode,i=b.parentNode,j=h;if(h===i)return s(a,b);if(!h)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return s(e[k],f[k]);return k===c?s(a,f[k],-1):s(e[k],b,1)},s=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),k.getText=function(a){var b="",c;for(var d=0;a[d];d++)c=a[d],c.nodeType===3||c.nodeType===4?b+=c.nodeValue:c.nodeType!==8&&(b+=k.getText(c.childNodes));return b},function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g<h;g++)k(a,f[g],d);return k.filter(e,d)};f.find=k,f.expr=k.selectors,f.expr[":"]=f.expr.filters,f.unique=k.uniqueSort,f.text=k.getText,f.isXMLDoc=k.isXML,f.contains=k.contains}();var N=/Until$/,O=/^(?:parents|prevUntil|prevAll)/,P=/,/,Q=/^.[^:#\[\.,]*$/,R=Array.prototype.slice,S=f.expr.match.POS,T={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(V(this,a,!1),"not",a)},filter:function(a){return this.pushStack(V(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(d=0,e=a.length;d<e;d++)i=a[d],j[i]||(j[i]=S.test(i)?f(i,b||this.context):i);while(g&&g.ownerDocument&&g!==b){for(i in j)h=j[i],(h.jquery?h.index(g)>-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=S.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(l?l.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(U(c[0])||U(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=R.call(arguments);N.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!T[a]?f.unique(e):e,(this.length>1||P.test(d))&&O.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/<tbody/i,_=/<|&#?\w+;/,ba=/<(?:script|object|embed|option|style)/i,bb=/checked\s*(?:[^=]|=\s*.checked.)/i,bc=/\/(java|ecma)script/i,bd=/^\s*<!(?:\[CDATA\[|\-\-)/,be={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};be.optgroup=be.option,be.tbody=be.tfoot=be.colgroup=be.caption=be.thead,be.th=be.td,f.support.htmlSerialize||(be._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){f(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!be[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1></$2>");try{for(var c=0,d=this.length;c<d;c++)this[c].nodeType===1&&(f.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(e){this.empty().append(a)}}else f.isFunction(a)?this.each(function(b){var c=f(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bb.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bf(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,bl)}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i;b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof a[0]=="string"&&a[0].length<512&&i===c&&a[0].charAt(0)==="<"&&!ba.test(a[0])&&(f.support.checkClone||!bb.test(a[0]))&&(g=!0,h=f.fragments[a[0]],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean
+-(a,i,e,d)),g&&(f.fragments[a[0]]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bh(a,d),e=bi(a),g=bi(d);for(h=0;e[h];++h)g[h]&&bh(e[h],g[h])}if(b){bg(a,d);if(c){e=bi(a),g=bi(d);for(h=0;e[h];++h)bg(e[h],g[h])}}e=g=null;return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1></$2>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=be[l]||be._default,n=m[0],o=b.createElement("div");o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]==="<table>"&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i<r;i++)bk(k[i]);else bk(k);k.nodeType?h.push(k):h=f.merge(h,k)}if(d){g=function(a){return!a.type||bc.test(a.type)};for(j=0;h[j];j++)if(e&&f.nodeName(h[j],"script")&&(!h[j].type||h[j].type.toLowerCase()==="text/javascript"))e.push(h[j].parentNode?h[j].parentNode.removeChild(h[j]):h[j]);else{if(h[j].nodeType===1){var s=f.grep(h[j].getElementsByTagName("script"),g);h.splice.apply(h,[j+1,0].concat(s))}d.appendChild(h[j])}}return h},cleanData:function(a){var b,c,d=f.cache,e=f.expando,g=f.event.special,h=f.support.deleteExpando;for(var i=0,j;(j=a[i])!=null;i++){if(j.nodeName&&f.noData[j.nodeName.toLowerCase()])continue;c=j[f.expando];if(c){b=d[c]&&d[c][e];if(b&&b.events){for(var k in b.events)g[k]?f.event.remove(j,k):f.removeEvent(j,k,b.handle);b.handle&&(b.handle.elem=null)}h?delete j[f.expando]:j.removeAttribute&&j.removeAttribute(f.expando),delete d[c]}}}});var bm=/alpha\([^)]*\)/i,bn=/opacity=([^)]*)/,bo=/([A-Z]|^ms)/g,bp=/^-?\d+(?:px)?$/i,bq=/^-?\d/,br=/^([\-+])=([\-+.\de]+)/,bs={position:"absolute",visibility:"hidden",display:"block"},bt=["Left","Right"],bu=["Top","Bottom"],bv,bw,bx;f.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return f.access(this,a,c,!0,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)})},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bv(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=br.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(bv)return bv(a,c)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]}}),f.curCSS=f.css,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){var e;if(c){if(a.offsetWidth!==0)return by(a,b,d);f.swap(a,bs,function(){e=by(a,b,d)});return e}},set:function(a,b){if(!bp.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bn.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bm,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bm.test(g)?g.replace(bm,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bv(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bw=function(a,c){var d,e,g;c=c.replace(bo,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bx=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bp.test(d)&&bq.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bv=bw||bx,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bz=/%20/g,bA=/\[\]$/,bB=/\r?\n/g,bC=/#.*$/,bD=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bE=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bF=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bG=/^(?:GET|HEAD)$/,bH=/^\/\//,bI=/\?/,bJ=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bK=/^(?:select|textarea)/i,bL=/\s+/,bM=/([?&])_=[^&]*/,bN=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bO=f.fn.load,bP={},bQ={},bR,bS,bT=["*/"]+["*"];try{bR=e.href}catch(bU){bR=c.createElement("a"),bR.href="",bR=bR.href}bS=bN.exec(bR.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bO)return bO.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bJ,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bK.test(this.nodeName)||bE.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bB,"\r\n")}}):{name:b.name,value:c.replace(bB,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?bX(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),bX(a,b);return a},ajaxSettings:{url:bR,isLocal:bF.test(bS[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bT},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bV(bP),ajaxTransport:bV(bQ),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?bZ(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=b$(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f._Deferred(),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bD.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.done,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bC,"").replace(bH,bS[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bL),d.crossDomain==null&&(r=bN.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bS[1]&&r[2]==bS[2]&&(r[3]||(r[1]==="http:"?80:443))==(bS[3]||(bS[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bW(bP,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bG.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bI.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bM,"$1_="+x);d.url=y+(y===d.url?(bI.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bT+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bW(bQ,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){s<2?w(-1,z):f.error(z)}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)bY(g,a[g],c,e);return d.join("&").replace(bz,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var b_=f.now(),ca=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+b_++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ca.test(b.url)||e&&ca.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ca,l),b.url===j&&(e&&(k=k.replace(ca,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cb=a.ActiveXObject?function(){for(var a in cd)cd[a](0,1)}:!1,cc=0,cd;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ce()||cf()}:ce,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cb&&delete cd[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cc,cb&&(cd||(cd={},f(a).unload(cb)),cd[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cg={},ch,ci,cj=/^(?:toggle|show|hide)$/,ck=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cl,cm=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cn;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cq("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),e===""&&f.css(d,"display")==="none"&&f._data(d,"olddisplay",cr(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(cq("hide",3),a,b,c);for(var d=0,e=this.length;d<e;d++)if(this[d].style){var g=f.css(this[d],"display");g!=="none"&&!f._data(this[d],"olddisplay")&&f._data(this[d],"olddisplay",g)}for(d=0;d<e;d++)this[d].style&&(this[d].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(cq("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return this[e.queue===!1?"each":"queue"](function(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]),h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(f.support.inlineBlockNeedsLayout?(j=cr(this.nodeName),j==="inline"?this.style.display="inline-block":(this.style.display="inline",this.style.zoom=1)):this.style.display="inline-block"))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)k=new f.fx(this,b,i),h=a[i],cj.test(h)?k[h==="toggle"?d?"show":"hide":h]():(l=ck.exec(h),m=k.cur(),l?(n=parseFloat(l[2]),o=l[3]||(f.cssNumber[i]?"":"px"),o!=="px"&&(f.style(this,i,(n||1)+o),m=(n||1)/k.cur()*m,f.style(this,i,m+o)),l[1]&&(n=(l[1]==="-="?-1:1)*n+m),k.custom(m,n,o)):k.custom(m,h,""));return!0})},stop:function(a,b){a&&this.queue([]),this.each(function(){var a=f.timers,c=a.length;b||f._unmark(!0,this);while(c--)a[c].elem===this&&(b&&a[c](!0),a.splice(c,1))}),b||this.dequeue();return this}}),f.each({slideDown:cq("show",1),slideUp:cq("hide",1),slideToggle:cq("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default,d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue!==!1?f.dequeue(this):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,b,c){function g(a){return d.step(a)}var d=this,e=f.fx;this.startTime=cn||co(),this.start=a,this.end=b,this.unit=c||this.unit||(f.cssNumber[this.prop]?"":"px"),this.now=this.start,this.pos=this.state=0,g.elem=this.elem,g()&&f.timers.push(g)&&!cl&&(cl=setInterval(e.tick,e.interval))},show:function(){this.options.orig[this.prop]=f.style(this.elem,this.prop),this.options.show=!0,this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b=cn||co(),c=!0,d=this.elem,e=this.options,g,h;if(a||b>=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(g in e.animatedProperties)e.animatedProperties[g]!==!0&&(c=!1);if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&f(d).hide();if(e.hide||e.show)for(var i in e.animatedProperties)f.style(d,i,e.orig[i]);e.complete.call(d)}return!1}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;b<a.length;++b)a[b]()||a.splice(b--,1);a.length||f.fx.stop()},interval:13,stop:function(){clearInterval(cl),cl=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit:a.elem[a.prop]=a.now}}}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var cs=/^t(?:able|d|h)$/i,ct=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?f.fn.offset=function(a){var b=this[0],c;if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);try{c=b.getBoundingClientRect()}catch(d){}var e=b.ownerDocument,g=e.documentElement;if(!c||!f.contains(g,b))return c?{top:c.top,left:c.left}:{top:0,left:0};var h=e.body,i=cu(e),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||f.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||f.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}}:f.fn.offset=function(a){var b=this[0];if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);f.offset.initialize();var c,d=b.offsetParent,e=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(f.offset.supportsFixedPosition&&k.position==="fixed")break;c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===d&&(l+=b.offsetTop,m+=b.offsetLeft,f.offset.doesNotAddBorder&&(!f.offset.doesAddBorderForTableAndCells||!cs.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),e=d,d=b.offsetParent),f.offset.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c}if(k.position==="relative"||k.position==="static")l+=i.offsetTop,m+=i.offsetLeft;f.offset.supportsFixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},f.offset={initialize:function(){var a=c.body,b=c.createElement("div"),d,e,g,h,i=parseFloat(f.css(a,"marginTop"))||0,j="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.offset.initialize(),f.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=ct.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!ct.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cu(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cu(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a&&a.style?parseFloat(f.css(a,d,"padding")):null},f.fn["outer"+c]=function(a){var b=this[0];return b&&b.style?parseFloat(f.css(b,d,a?"margin":"border")):null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNaN(j)?i:j}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window);
+\ No newline at end of file
++t[h]}if(f.isEmptyObject(t)){var u=s.handle;u&&(u.elem=null),delete s.events,delete s.handle,f.isEmptyObject(s)&&f.removeData(a,b,!0)}}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){var h=c.type||c,i=[],j;h.indexOf("!")>=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!e)c.preventDefault(),c.stopPropagation();if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem)});return}if(e.nodeType===3||e.nodeType===8)return;c.result=b,c.target=e,d=d!=null?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())}catch(p){}n&&(e[l]=n),f.event.triggered=b}}return c.result}},handle:function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;h<i;h++){var j=d[h];if(e||c.namespace_re.test(j.namespace)){c.handler=j.handler,c.data=j.data,c.handleObj=j;var k=j.handler.apply(this,g);k!==b&&(c.result=k,k===!1&&(c.preventDefault(),c.stopPropagation()));if(c.isImmediatePropagationStopped())break}}return c.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(a){if(a[f.expando])return a;var d=a;a=f.Event(d);for(var e=this.props.length,g;e;)g=this.props[--e],a[g]=d[g];a.target||(a.target=a.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),!a.relatedTarget&&a.fromElement&&(a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement);if(a.pageX==null&&a.clientX!=null){var h=a.target.ownerDocument||c,i=h.documentElement,j=h.body;a.pageX=a.clientX+(i&&i.scrollLeft||j&&j.scrollLeft||0)-(i&&i.clientLeft||j&&j.clientLeft||0),a.pageY=a.clientY+(i&&i.scrollTop||j&&j.scrollTop||0)-(i&&i.clientTop||j&&j.clientTop||0)}a.which==null&&(a.charCode!=null||a.keyCode!=null)&&(a.which=a.charCode!=null?a.charCode:a.keyCode),!a.metaKey&&a.ctrlKey&&(a.metaKey=a.ctrlKey),!a.which&&a.button!==b&&(a.which=a.button&1?1:a.button&2?3:a.button&4?2:0);return a},guid:1e8,proxy:f.proxy,special:{ready:{setup:f.bindReady,teardown:f.noop},live:{add:function(a){f.event.add(this,M(a.origType,a.selector),f.extend({},a,{handler:L,guid:a.handler.guid}))},remove:function(a){f.event.remove(this,M(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}}},f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!this.preventDefault)return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?D:C):this.type=a,b&&f.extend(this,b),this.timeStamp=f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=D;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=D;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=D,this.stopPropagation()},isDefaultPrevented:C,isPropagationStopped:C,isImmediatePropagationStopped:C};var E=function(a){var b=a.relatedTarget,c=!1,d=a.type;a.type=a.data,b!==this&&(b&&(c=f.contains(this,b)),c||(f.event.handle.apply(this,arguments),a.type=d))},F=function(a){a.type=a.data,f.event.handle.apply(this,arguments)};f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={setup:function(c){f.event.add(this,b,c&&c.selector?F:E,a)},teardown:function(a){f.event.remove(this,b,a&&a.selector?F:E)}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(a,b){if(!f.nodeName(this,"form"))f.event.add(this,"click.specialSubmit",function(a){var b=a.target,c=f.nodeName(b,"input")||f.nodeName(b,"button")?b.type:"";(c==="submit"||c==="image")&&f(b).closest("form").length&&J("submit",this,arguments)}),f.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,c=f.nodeName(b,"input")||f.nodeName(b,"button")?b.type:"";(c==="text"||c==="password")&&f(b).closest("form").length&&a.keyCode===13&&J("submit",this,arguments)});else return!1},teardown:function(a){f.event.remove(this,".specialSubmit")}});if(!f.support.changeBubbles){var G,H=function(a){var b=f.nodeName(a,"input")?a.type:"",c=a.value;b==="radio"||b==="checkbox"?c=a.checked:b==="select-multiple"?c=a.selectedIndex>-1?f.map(a.options,function(a){return a.selected}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex);return c},I=function(c){var d=c.target,e,g;if(!!x.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=H(d),(c.type!=="focusout"||d.type!=="radio")&&f._data(d,"_change_data",g);if(e===b||g===e)return;if(e!=null||g)c.type="change",c.liveFired=b,f.event.trigger(c,arguments[1],d)}};f.event.special.change={filters:{focusout:I,beforedeactivate:I,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&I.call(this,a)},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&I.call(this,a)},beforeactivate:function(a){var b=a.target;f._data(b,"_change_data",H(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in G)f.event.add(this,c+".specialChange",G[c]);return x.test(this.nodeName)},teardown:function(a){f.event.remove(this,".specialChange");return x.test(this.nodeName)}},G=f.event.special.change.filters,G.focus=G.beforeactivate}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;if(typeof a=="object"){for(var h in a)this[c](h,d,a[h],e);return this}if(arguments.length===2||d===!1)e=d,d=b;c==="one"?(g=function(a){f(this).unbind(a,g);return e.apply(this,arguments)},g.guid=e.guid||f.guid++):g=e;if(a==="unload"&&c!=="one")this.one(a,d,e);else for(var i=0,j=this.length;i<j;i++)f.event.add(this[i],a,g,d);return this}}),f.fn.extend({unbind:function(a,b){if(typeof a=="object"&&!a.preventDefault)for(var c in a)this.unbind(c,a[c]);else for(var d=0,e=this.length;d<e;d++)f.event.remove(this[d],a,b);return this},delegate:function(a,b,c,d){return this.live(b,c,d,a)},undelegate:function(a,b,c){return arguments.length===0?this.unbind("live"):this.die(b,null,c,a)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f.data(this,"lastToggle"+a.guid)||0)%d;f.data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var K={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};f.each(["live","die"],function(a,c){f.fn[c]=function(a,d,e,g){var h,i=0,j,k,l,m=g||this.selector,n=g?this:f(this.context);if(typeof a=="object"&&!a.preventDefault){for(var o in a)n[c](o,d,a[o],m);return this}if(c==="die"&&!a&&g&&g.charAt(0)==="."){n.unbind(g);return this}if(d===!1||f.isFunction(d))e=d||C,d=b;a=(a||"").split(" ");while((h=a[i++])!=null){j=w.exec(h),k="",j&&(k=j[0],h=h.replace(w,""));if(h==="hover"){a.push("mouseenter"+k,"mouseleave"+k);continue}l=h,K[h]?(a.push(K[h]+k),h=h+k):h=(K[h]||h)+k;if(c==="live")for(var p=0,q=n.length;p<q;p++)f.event.add(n[p],"live."+M(h,m),{data:d,selector:m,handler:e,origType:h,origHandler:e,preType:l});else n.unbind("live."+M(h,m),e)}return this}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}if(i.nodeType===1){f||(i.sizcache=c,i.sizset=g);if(typeof b!="string"){if(i===b){j=!0;break}}else if(k.filter(b,[i]).length>0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}i.nodeType===1&&!f&&(i.sizcache=c,i.sizset=g);if(i.nodeName.toLowerCase()===b){j=i;break}i=i[a]}d[g]=j}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,f,g){f=f||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return f;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(e.call(n)==="[object Array]")if(!u)f.push.apply(f,n);else if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&f.push(j[t]);else p(n,f);o&&(k(o,h,f,g),k.uniqueSort(f));return f};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},k.matches=function(a,b){return k(a,null,null,b)},k.matchesSelector=function(a,b){return k(b,null,null,[a]).length>0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e<f;e++){var g,h=l.order[e];if(g=l.leftMatch[h].exec(a)){var j=g[1];g.splice(1,1);if(j.substr(j.length-1)!=="\\"){g[1]=(g[1]||"").replace(i,""),d=l.find[h](g,b,c);if(d!=null){a=a.replace(l.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},k.filter=function(a,c,d,e){var f,g,h=a,i=[],j=c,m=c&&c[0]&&k.isXML(c[0]);while(a&&c.length){for(var n in l.filter)if((f=l.leftMatch[n].exec(a))!=null&&f[2]){var o,p,q=l.filter[n],r=f[1];g=!1,f.splice(1,1);if(r.substr(r.length-1)==="\\")continue;j===i&&(i=[]);if(l.preFilter[n]){f=l.preFilter[n](f,j,d,i,e,m);if(!f)g=o=!0;else if(f===!0)continue}if(f)for(var s=0;(p=j[s])!=null;s++)if(p){o=q(p,f,s,j);var t=e^!!o;d&&o!=null?t?g=!0:j[s]=!1:t&&(i.push(p),g=!0)}if(o!==b){d||(j=i),a=a.replace(l.match[n],"");if(!g)return[];break}}if(a===h)if(g==null)k.error(a);else break;h=a}return j},k.error=function(a){throw"Syntax error, unrecognized expression: "+a};var l=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!j.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&k.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&k.filter(b,a,!0)}},"":function(a,b,c){var e,f=d++,g=u;typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),e=b,g=t),g("parentNode",b,f,a,e,c)},"~":function(a,b,c){var e,f=d++,g=u;typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),e=b,g=t),g("previousSibling",b,f,a,e,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(i,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=d++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}k.error(e)},CHILD:function(a,b){var c=b[1],d=a;switch(c){case"only":case"first":while(d=d.previousSibling)if(d.nodeType===1)return!1;if(c==="first")return!0;d=a;case"last":while(d=d.nextSibling)if(d.nodeType===1)return!1;return!0;case"nth":var e=b[2],f=b[3];if(e===1&&f===0)return!0;var g=b[0],h=a.parentNode;if(h&&(h.sizcache!==g||!a.nodeIndex)){var i=0;for(d=h.firstChild;d;d=d.nextSibling)d.nodeType===1&&(d.nodeIndex=++i);h.sizcache=g}var j=a.nodeIndex-f;return e===0?j===0:j%e===0&&j/e>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(e.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var f=a.length;c<f;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var r,s;c.documentElement.compareDocumentPosition?r=function(a,b){if(a===b){g=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(r=function(a,b){if(a===b){g=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],h=a.parentNode,i=b.parentNode,j=h;if(h===i)return s(a,b);if(!h)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return s(e[k],f[k]);return k===c?s(a,f[k],-1):s(e[k],b,1)},s=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),k.getText=function(a){var b="",c;for(var d=0;a[d];d++)c=a[d],c.nodeType===3||c.nodeType===4?b+=c.nodeValue:c.nodeType!==8&&(b+=k.getText(c.childNodes));return b},function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g<h;g++)k(a,f[g],d);return k.filter(e,d)};f.find=k,f.expr=k.selectors,f.expr[":"]=f.expr.filters,f.unique=k.uniqueSort,f.text=k.getText,f.isXMLDoc=k.isXML,f.contains=k.contains}();var N=/Until$/,O=/^(?:parents|prevUntil|prevAll)/,P=/,/,Q=/^.[^:#\[\.,]*$/,R=Array.prototype.slice,S=f.expr.match.POS,T={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(V(this,a,!1),"not",a)},filter:function(a){return this.pushStack(V(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(d=0,e=a.length;d<e;d++)i=a[d],j[i]||(j[i]=S.test(i)?f(i,b||this.context):i);while(g&&g.ownerDocument&&g!==b){for(i in j)h=j[i],(h.jquery?h.index(g)>-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=S.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(l?l.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(U(c[0])||U(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=R.call(arguments);N.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!T[a]?f.unique(e):e,(this.length>1||P.test(d))&&O.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/<tbody/i,_=/<|&#?\w+;/,ba=/<(?:script|object|embed|option|style)/i,bb=/checked\s*(?:[^=]|=\s*.checked.)/i,bc=/\/(java|ecma)script/i,bd=/^\s*<!(?:\[CDATA\[|\-\-)/,be={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};be.optgroup=be.option,be.tbody=be.tfoot=be.colgroup=be.caption=be.thead,be.th=be.td,f.support.htmlSerialize||(be._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){f(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!be[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1></$2>");try{for(var c=0,d=this.length;c<d;c++)this[c].nodeType===1&&(f.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(e){this.empty().append(a)}}else f.isFunction(a)?this.each(function(b){var c=f(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bb.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bf(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,bl)}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i;b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof a[0]=="string"&&a[0].length<512&&i===c&&a[0].charAt(0)==="<"&&!ba.test(a[0])&&(f.support.checkClone||!bb.test(a[0]))&&(g=!0,h=f.fragments[a[0]],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean
++(a,i,e,d)),g&&(f.fragments[a[0]]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bh(a,d),e=bi(a),g=bi(d);for(h=0;e[h];++h)g[h]&&bh(e[h],g[h])}if(b){bg(a,d);if(c){e=bi(a),g=bi(d);for(h=0;e[h];++h)bg(e[h],g[h])}}e=g=null;return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1></$2>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=be[l]||be._default,n=m[0],o=b.createElement("div");o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]==="<table>"&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i<r;i++)bk(k[i]);else bk(k);k.nodeType?h.push(k):h=f.merge(h,k)}if(d){g=function(a){return!a.type||bc.test(a.type)};for(j=0;h[j];j++)if(e&&f.nodeName(h[j],"script")&&(!h[j].type||h[j].type.toLowerCase()==="text/javascript"))e.push(h[j].parentNode?h[j].parentNode.removeChild(h[j]):h[j]);else{if(h[j].nodeType===1){var s=f.grep(h[j].getElementsByTagName("script"),g);h.splice.apply(h,[j+1,0].concat(s))}d.appendChild(h[j])}}return h},cleanData:function(a){var b,c,d=f.cache,e=f.expando,g=f.event.special,h=f.support.deleteExpando;for(var i=0,j;(j=a[i])!=null;i++){if(j.nodeName&&f.noData[j.nodeName.toLowerCase()])continue;c=j[f.expando];if(c){b=d[c]&&d[c][e];if(b&&b.events){for(var k in b.events)g[k]?f.event.remove(j,k):f.removeEvent(j,k,b.handle);b.handle&&(b.handle.elem=null)}h?delete j[f.expando]:j.removeAttribute&&j.removeAttribute(f.expando),delete d[c]}}}});var bm=/alpha\([^)]*\)/i,bn=/opacity=([^)]*)/,bo=/([A-Z]|^ms)/g,bp=/^-?\d+(?:px)?$/i,bq=/^-?\d/,br=/^([\-+])=([\-+.\de]+)/,bs={position:"absolute",visibility:"hidden",display:"block"},bt=["Left","Right"],bu=["Top","Bottom"],bv,bw,bx;f.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return f.access(this,a,c,!0,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)})},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bv(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=br.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(bv)return bv(a,c)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]}}),f.curCSS=f.css,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){var e;if(c){if(a.offsetWidth!==0)return by(a,b,d);f.swap(a,bs,function(){e=by(a,b,d)});return e}},set:function(a,b){if(!bp.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bn.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bm,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bm.test(g)?g.replace(bm,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bv(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bw=function(a,c){var d,e,g;c=c.replace(bo,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bx=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bp.test(d)&&bq.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bv=bw||bx,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bz=/%20/g,bA=/\[\]$/,bB=/\r?\n/g,bC=/#.*$/,bD=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bE=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bF=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bG=/^(?:GET|HEAD)$/,bH=/^\/\//,bI=/\?/,bJ=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bK=/^(?:select|textarea)/i,bL=/\s+/,bM=/([?&])_=[^&]*/,bN=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bO=f.fn.load,bP={},bQ={},bR,bS,bT=["*/"]+["*"];try{bR=e.href}catch(bU){bR=c.createElement("a"),bR.href="",bR=bR.href}bS=bN.exec(bR.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bO)return bO.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bJ,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bK.test(this.nodeName)||bE.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bB,"\r\n")}}):{name:b.name,value:c.replace(bB,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?bX(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),bX(a,b);return a},ajaxSettings:{url:bR,isLocal:bF.test(bS[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bT},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bV(bP),ajaxTransport:bV(bQ),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?bZ(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=b$(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f._Deferred(),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bD.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.done,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bC,"").replace(bH,bS[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bL),d.crossDomain==null&&(r=bN.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bS[1]&&r[2]==bS[2]&&(r[3]||(r[1]==="http:"?80:443))==(bS[3]||(bS[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bW(bP,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bG.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bI.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bM,"$1_="+x);d.url=y+(y===d.url?(bI.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bT+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bW(bQ,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){s<2?w(-1,z):f.error(z)}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)bY(g,a[g],c,e);return d.join("&").replace(bz,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var b_=f.now(),ca=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+b_++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ca.test(b.url)||e&&ca.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ca,l),b.url===j&&(e&&(k=k.replace(ca,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cb=a.ActiveXObject?function(){for(var a in cd)cd[a](0,1)}:!1,cc=0,cd;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ce()||cf()}:ce,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cb&&delete cd[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cc,cb&&(cd||(cd={},f(a).unload(cb)),cd[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cg={},ch,ci,cj=/^(?:toggle|show|hide)$/,ck=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cl,cm=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cn;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cq("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),e===""&&f.css(d,"display")==="none"&&f._data(d,"olddisplay",cr(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(cq("hide",3),a,b,c);for(var d=0,e=this.length;d<e;d++)if(this[d].style){var g=f.css(this[d],"display");g!=="none"&&!f._data(this[d],"olddisplay")&&f._data(this[d],"olddisplay",g)}for(d=0;d<e;d++)this[d].style&&(this[d].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(cq("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return this[e.queue===!1?"each":"queue"](function(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]),h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(f.support.inlineBlockNeedsLayout?(j=cr(this.nodeName),j==="inline"?this.style.display="inline-block":(this.style.display="inline",this.style.zoom=1)):this.style.display="inline-block"))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)k=new f.fx(this,b,i),h=a[i],cj.test(h)?k[h==="toggle"?d?"show":"hide":h]():(l=ck.exec(h),m=k.cur(),l?(n=parseFloat(l[2]),o=l[3]||(f.cssNumber[i]?"":"px"),o!=="px"&&(f.style(this,i,(n||1)+o),m=(n||1)/k.cur()*m,f.style(this,i,m+o)),l[1]&&(n=(l[1]==="-="?-1:1)*n+m),k.custom(m,n,o)):k.custom(m,h,""));return!0})},stop:function(a,b){a&&this.queue([]),this.each(function(){var a=f.timers,c=a.length;b||f._unmark(!0,this);while(c--)a[c].elem===this&&(b&&a[c](!0),a.splice(c,1))}),b||this.dequeue();return this}}),f.each({slideDown:cq("show",1),slideUp:cq("hide",1),slideToggle:cq("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default,d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue!==!1?f.dequeue(this):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,b,c){function g(a){return d.step(a)}var d=this,e=f.fx;this.startTime=cn||co(),this.start=a,this.end=b,this.unit=c||this.unit||(f.cssNumber[this.prop]?"":"px"),this.now=this.start,this.pos=this.state=0,g.elem=this.elem,g()&&f.timers.push(g)&&!cl&&(cl=setInterval(e.tick,e.interval))},show:function(){this.options.orig[this.prop]=f.style(this.elem,this.prop),this.options.show=!0,this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b=cn||co(),c=!0,d=this.elem,e=this.options,g,h;if(a||b>=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(g in e.animatedProperties)e.animatedProperties[g]!==!0&&(c=!1);if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&f(d).hide();if(e.hide||e.show)for(var i in e.animatedProperties)f.style(d,i,e.orig[i]);e.complete.call(d)}return!1}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;b<a.length;++b)a[b]()||a.splice(b--,1);a.length||f.fx.stop()},interval:13,stop:function(){clearInterval(cl),cl=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit:a.elem[a.prop]=a.now}}}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var cs=/^t(?:able|d|h)$/i,ct=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?f.fn.offset=function(a){var b=this[0],c;if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);try{c=b.getBoundingClientRect()}catch(d){}var e=b.ownerDocument,g=e.documentElement;if(!c||!f.contains(g,b))return c?{top:c.top,left:c.left}:{top:0,left:0};var h=e.body,i=cu(e),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||f.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||f.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}}:f.fn.offset=function(a){var b=this[0];if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);f.offset.initialize();var c,d=b.offsetParent,e=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(f.offset.supportsFixedPosition&&k.position==="fixed")break;c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===d&&(l+=b.offsetTop,m+=b.offsetLeft,f.offset.doesNotAddBorder&&(!f.offset.doesAddBorderForTableAndCells||!cs.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),e=d,d=b.offsetParent),f.offset.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c}if(k.position==="relative"||k.position==="static")l+=i.offsetTop,m+=i.offsetLeft;f.offset.supportsFixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},f.offset={initialize:function(){var a=c.body,b=c.createElement("div"),d,e,g,h,i=parseFloat(f.css(a,"marginTop"))||0,j="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.offset.initialize(),f.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=ct.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!ct.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cu(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cu(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a&&a.style?parseFloat(f.css(a,d,"padding")):null},f.fn["outer"+c]=function(a){var b=this[0];return b&&b.style?parseFloat(f.css(b,d,a?"margin":"border")):null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNaN(j)?i:j}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window);
+-- 
+1.7.4.1
+
diff --git a/libs/patch/0012-JQM-delete-defaultFooter-size.patch b/libs/patch/0012-JQM-delete-defaultFooter-size.patch
new file mode 100755 (executable)
index 0000000..b715ffe
--- /dev/null
@@ -0,0 +1,52 @@
+From e8670410ade06362532722b541ce4bef81222d6b Mon Sep 17 00:00:00 2001
+From: Jun Jinhyuk <jinhyuk.jun@samsung.com>
+Date: Mon, 19 Mar 2012 22:13:16 -0400
+Subject: [PATCH] delete defaultFooter size
+
+Change-Id: I026d36ed75b53707d682731d26150bee3521a7f2
+---
+ .../js/jquery.mobile.fixHeaderFooter.js            |   14 +++++++-------
+ 1 files changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.fixHeaderFooter.js b/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.fixHeaderFooter.js
+index 2d19b4e..23877df 100644
+--- a/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.fixHeaderFooter.js
++++ b/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.fixHeaderFooter.js
+@@ -95,7 +95,7 @@ $.mobile.fixedToolbars = (function() {
+               touchStopEvent = supportTouch ? "touchend" : "mouseup",
+               stateBefore = null,
+               scrollTriggered = false,
+-              defaultFooterHeight = 114,
++//            defaultFooterHeight = 114,
+               touchToggleEnabled = true;
+
+       function showEventCallback( event ) {
+@@ -117,9 +117,9 @@ $.mobile.fixedToolbars = (function() {
+                       footer_filter = $( document ).find( ":jqmData(role='footer')" ).eq( 0 );
+               }
+
+-              if ( footer_filter.height() < defaultFooterHeight ) {
+-                      footer_filter.css("height", defaultFooterHeight);
+-              }
++//            if ( footer_filter.height() < defaultFooterHeight ) {
++//                    footer_filter.css("height", defaultFooterHeight);
++//            }
+
+               footer_filter
+                       .css( "top", $(window).height() - footer_filter.height() )
+@@ -407,9 +407,9 @@ $.mobile.fixedToolbars = (function() {
+                                       .css( "width", footer.width() )
+                                       .css( "height", footer.height() );
+
+-                              if ( $(".dummy-div").height() < defaultFooterHeight ) {
+-                                      $( ".dummy-div" ).css( "height", defaultFooterHeight );
+-                              }
++//                            if ( $(".dummy-div").height() < defaultFooterHeight ) {
++//                                    $( ".dummy-div" ).css( "height", defaultFooterHeight );
++//                            }
+                       }
+
+                       /* Header position fix(remove transition) */
+-- 
+1.7.4.1
+
diff --git a/packaging/web-ui-fw.spec b/packaging/web-ui-fw.spec
new file mode 100644 (file)
index 0000000..8738e99
--- /dev/null
@@ -0,0 +1,34 @@
+Name:          web-ui-fw
+Summary:       Tizen Web UI Framework Library
+Version:       0.1.11
+Release:       1
+Group:         TO_BE/FILLED_IN
+License:       MIT
+BuildRequires: node-js, make
+
+%description
+Tizen Web UI Framework library package
+
+%prep
+make clean
+
+%build
+make
+
+%post
+
+
+%files
+/usr/lib/tizen-web-ui-fw/*/js
+/usr/lib/tizen-web-ui-fw/*/themes/tizen-gray
+
+
+%package -n libweb-ui-fw
+
+%package -n libweb-ui-fw-theme-tizen-gray
+
+%package -n libweb-ui-fw-dev
+
+%package -n libweb-ui-fw-demo-tizen-gray
+
+
index 1a3e176..2bdffc3 100644 (file)
  * By Youmin Ha <youmin.ha@samsung.com>
  *
  */
-S = {
-       libFileName : "tizen-web-ui-fw(.min)?.js",
 
-       frameworkData : {
-               rootDir: '/usr/lib/tizen-web-ui-fw',
-               version: '0.1',
-               theme: "default",
-               },
+( function ($, Globalize, window, undefined) {
 
-    cacheBust: (document.location.href.match(/debug=true/)) ?
-               '?cacheBust=' + (new Date()).getTime() :
-               '',
+       window.S = {
+               libFileName : "tizen-web-ui-fw(.min)?.js",
 
-       util : {
-               addElementToHead : function(elem) {
-                       var head = document.getElementsByTagName('head')[0];
-                       head.appendChild(elem);
+               frameworkData : {
+                       rootDir: '/usr/lib/tizen-web-ui-fw',
+                       version: '0.1',
+                       theme: "default",
+                       viewportScale: false,
                },
-               loadScriptSync : function(scriptPath, successCB, errorCB) {
-                       $.ajax({
-                               url: scriptPath,
-                               dataType: 'script',
-                               async: false,
-                               success: successCB,
-                               error: function(jqXHR, textStatus, errorThrown) {
-                                       if(errorCB) errorCB(jqXHR, textStatus, errorThrown);
-                                       else {
-                                               var ignoreStatusList = [
-                                                       404,    // not found
-                                                       ];
-                                               if(-1 == $.inArray(jqXHR.status, ignoreStatusList)) {
-                                                       alert('Error while loading ' + scriptPath + '\n' + jqXHR.status + ':' + jqXHR.statusText);
-                                               }
-                                               else {
-                                                       console.log('Error while loading ' + scriptPath + '\n' + jqXHR.status + ':' + jqXHR.statusText);
+
+               util : {
+                       loadScriptSync : function ( scriptPath, successCB, errorCB ) {
+                               $.ajax( {
+                                       url: scriptPath,
+                                       dataType: 'script',
+                                       async: false,
+                                       success: successCB,
+                                       error: function ( jqXHR, textStatus, errorThrown ) {
+                                               if ( errorCB ) {
+                                                       errorCB( jqXHR, textStatus, errorThrown );
+                                               } else {
+                                                       var ignoreStatusList = [ 404 ];  // 404: not found
+                                                       if ( -1 == $.inArray( jqXHR.status, ignoreStatusList ) ) {
+                                                               window.alert( 'Error while loading ' + scriptPath + '\n' + jqXHR.status + ':' + jqXHR.statusText );
+                                                       } else {
+                                                               console.log( 'Error while loading ' + scriptPath + '\n' + jqXHR.status + ':' + jqXHR.statusText );
+                                                       }
                                                }
                                        }
-                               },
-                       });
-               },
-               getScaleFactor: function () {
-                       var factor = window.scale;
-
-                       if ( !factor ) {
-                               var width = screen.width < screen.height ? screen.width : screen.height,
+                               } );
+                       },
+                       getScaleFactor: function ( ) {
+                               var factor = window.scale,
+                                       width = 0,
                                        defaultWidth = 720;
 
-                               factor = width / defaultWidth;
-                               if ( factor > 1 ) {
-                                       // TODO NOTE some of targets(e.g iPad) need to set scale equal or less than 1.0
-                                       factor = 1;
+                               if ( !factor ) {
+                                       width = screen.width < screen.height ? screen.width : screen.height;
+                                       factor = width / defaultWidth;
+                                       if ( factor > 1 ) {
+                                               // NOTE: some targets(e.g iPad) need to set scale equal or less than 1.0
+                                               factor = 1;
+                                       }
                                }
+                               console.log( "ScaleFactor: " + factor );
+                               return factor;
+                       },
+                       isMobileBrowser: function ( ) {
+                               var mobileIdx = window.navigator.appVersion.indexOf("Mobile"),
+                                       isMobile = -1 < mobileIdx;
+                               return isMobile;
                        }
-                       console.log( "ScaleFactor: " + factor );
-                       return factor;
                },
-       },
 
-       css : {
-               load: function (path) {
-                       S.util.addElementToHead(this.makeLink(path + S.cacheBust));
+               css : {
+                       cacheBust: ( document.location.href.match( /debug=true/ ) ) ?
+                                       '?cacheBust=' + ( new Date( ) ).getTime( ) :
+                                       '',
+                       addElementToHead : function ( elem ) {
+                               var head = document.getElementsByTagName( 'head' )[0];
+                               head.appendChild( elem );
+                       },
+                       load: function ( path ) {
+                               this.addElementToHead( this.makeLink( path + this.cacheBust ) );
+                       },
+                       makeLink : function ( href ) {
+                               var customstylesheetLink = document.createElement( 'link' );
+                               customstylesheetLink.setAttribute( 'rel', 'stylesheet' );
+                               customstylesheetLink.setAttribute( 'href', href );
+                               return customstylesheetLink;
+                       }
                },
 
-               makeLink : function (href) {
-                       var customstylesheetLink = document.createElement('link');
-                       customstylesheetLink.setAttribute('rel', 'stylesheet');
-                       customstylesheetLink.setAttribute('href', href);
-                       return customstylesheetLink;
+               getParams: function ( ) {
+                       /* Get data-* params from <script> tag, and set S.frameworkData.* values
+                        * Returns true if proper <script> tag is found, or false if not.
+                        */
+                       // Find current <script> tag element
+                       var scriptElems = document.getElementsByTagName( 'script' ),
+                               val = null,
+                               foundScriptTag = false,
+                               idx,
+                               elem,
+                               src,
+                               tokens,
+                               version_idx;
+                       for ( idx in scriptElems ) {
+                               elem = scriptElems[idx];
+                               src = elem.src ? elem.getAttribute( 'src' ) : undefined;
+                               if (src && src.match( this.libFileName )) {
+                                       // Set framework data, only when they are given.
+                                       tokens = src.split(/[\/\\]/);
+                                       version_idx = -3;
+                                       this.frameworkData.rootDir = elem.getAttribute( 'data-framework-root' )
+                                               || tokens.slice( 0, tokens.length + version_idx ).join( '/' )
+                                               || this.frameworkData.rootDir;
+                                       this.frameworkData.version = elem.getAttribute( 'data-framework-version' )
+                                               || tokens[ tokens.length + version_idx ]
+                                               || this.frameworkData.version;
+                                       this.frameworkData.theme = elem.getAttribute( 'data-framework-theme' )
+                                               || this.frameworkData.theme;
+                                       this.frameworkData.viewportScale = "true" === elem.getAttribute( 'data-framework-viewport-scale' ) ? true : this.frameworkData.viewportScale;
+                                       foundScriptTag = true;
+                                       break;
+                               }
+                       }
+                       return foundScriptTag;
                },
-       },
 
-       getParams: function() {
-               /* Get data-* params from <script> tag, and set S.frameworkData.* values
-                * Returns true if proper <script> tag is found, or false if not.
+               loadTheme: function ( ) {
+                       var themePath = [
+                                       this.frameworkData.rootDir,
+                                       this.frameworkData.version,
+                                       'themes',
+                                       this.frameworkData.theme
+                               ].join( '/' ),
+                               cssPath = [themePath, 'tizen-web-ui-fw-theme.css'].join( '/' ),
+                               jsPath = [themePath, 'theme.js'].join( '/' );
+
+                       this.css.load( cssPath );
+                       this.util.loadScriptSync( jsPath );
+               },
+
+               /** Load Globalize culture file, and set default culture.
+                *  @param[in]  language  Language code. ex) en-US, en, ko-KR, ko
+                *                        If language is not given, read language from html 'lang' attribute, or from system setting.
                 */
-               // Find current <script> tag element
-               var scriptElems = document.getElementsByTagName('script'),
-                       val = null,
-                       foundScript = false;
-               for (var idx in scriptElems) {
-                       var elem = scriptElems[idx],
-                               src = elem.getAttribute('src');
-                       if(src && src.match(this.libFileName)) {
-                               // Set framework data, only when they are given.
-                               var tokens = src.split(/[\/\\]/),
-                                       version_idx = -3;
-                               this.frameworkData.rootDir = elem.getAttribute( 'data-framework-root' ) || tokens.slice( 0, tokens.length + version_idx ).join( '/' ) || this.frameworkData.rootDir;
-                               this.frameworkData.version = elem.getAttribute( 'data-framework-version' ) || tokens[ tokens.length + version_idx ] || this.frameworkData.version;
-                               this.frameworkData.theme = elem.getAttribute( 'data-framework-theme' ) || this.frameworkData.theme;
-                               foundScript = true;
-                               break;
+               loadGlobalizeCulture: function ( language ) {
+                       function getGlobalizeCultureFile( lang ) {
+                               return ['globalize.culture.', lang, '.js'].join( '' );
                        }
-               }
-               return foundScript;
-       },
-
-       loadTheme: function() {
-               var themePath = [
-                               this.frameworkData.rootDir, 
-                               this.frameworkData.version,
-                               'themes',
-                               this.frameworkData.theme
-                                       ].join('/'),
-                       cssPath = [themePath, 'tizen-web-ui-fw-theme.css'].join('/'),
-                       jsPath = [themePath, 'theme.js'].join('/');
-
-               this.css.load(cssPath);
-               this.util.loadScriptSync(jsPath);
-       },
-
-       setViewport: function () {
-               var meta;
-               $("meta").each( function() {
-                       if ( $(this).attr("name") === "viewport" ) {
-                               console.log("user set viewport... framework viewport will not be applied.");
-                               meta = this;
+                       function getGlobalizeCulturePath( self, file ) {
+                               return [
+                                       self.frameworkData.rootDir,
+                                       self.frameworkData.version,
+                                       'js',
+                                       'cultures',
+                                       file,
+                               ].join( '/' );
                        }
-               });
-               if ( meta )
-                       return;
-               if ( meta = document.createElement( "meta" )) {
-                       //set meta tags for view port
-                       var scale = S.util.getScaleFactor();
-
-                       meta.name = "viewport";
-                       meta.content = "width=device-width, initial-scale=" + scale + ", maximum-scale=" + scale + ", user-scalable=0, target-densityDpi=device-dpi";
-                       console.log( meta.content );
-                       var head = document.getElementsByTagName('head').item(0);
-                       head.insertBefore(meta, head.firstChild);
-               }
-       },
-
-       /** Load Globalize culture file, and set default culture.
-        *  @param[in]  language  Language code. ex) en-US, en, ko-KR, ko
-        *                        If language is not given, read language from html 'lang' attribute, or from system setting.
-        */
-       loadGlobalizeCulture: function(language) {
-               function getGlobalizeCultureFile(lang) {
-                       return ['globalize.culture.', lang, '.js'].join('');
-               };
-               function getGlobalizeCulturePath(self, file) {
-                       return [
-                               self.frameworkData.rootDir, 
-                               self.frameworkData.version,
-                               'js',
-                               'cultures',
-                               file,
-                       ].join('/');
-               }
 
-               // Get lang, and change country code to uppercase chars.
-               var lang = language || $('html').attr('lang') || window.navigator.language,
-                       countryCodeIdx = lang.lastIndexOf('-'),
-                       ignoreCodes = ['Cyrl', 'Latn', 'Mong']; // Not country code!
+                       // Get lang, and change country code to uppercase chars.
+                       var self = this,
+                               lang = language
+                                       || $( 'html' ).attr( 'lang' )
+                                       || window.navigator.language.split( '.' )[0]    /* Webkit, Safari + workaround for Tizen */
+                                       || window.navigator.userLanguage        /* IE */
+                                       || 'en',
+                               countryCode = null,
+                               countryCodeIdx = lang.lastIndexOf('-'),
+                               ignoreCodes = ['Cyrl', 'Latn', 'Mong'], // Not country code!
+                               globalizeCultureFile,
+                               globalizeCulturePath,
+                               neutralLangIndex;
 
-               if(countryCodeIdx != -1) {      // Found country code!
-                       var countryCode = lang.substr(countryCodeIdx + 1);
-                       if(ignoreCodes.join('-').indexOf(countryCode) < 0) { // countryCode is not found from ignoreCodes
-                               // Make countryCode to uppercase
-                               lang = [ lang.substr(0, countryCodeIdx), countryCode.toUpperCase() ].join('-');
+                       if ( countryCodeIdx != -1 ) {   // Found country code!
+                               countryCode = lang.substr( countryCodeIdx + 1 );
+                               if ( ignoreCodes.join( '-' ).indexOf( countryCode ) < 0 ) { // countryCode is not found from ignoreCodes
+                                       // Make countryCode to uppercase
+                                       lang = [ lang.substr( 0, countryCodeIdx ), countryCode.toUpperCase( ) ].join( '-' );
+                               }
                        }
-               }
 
-               var self = this,
-                       globalizeCultureFile = getGlobalizeCultureFile(lang),
-                       globalizeCulturePath = getGlobalizeCulturePath(self, globalizeCultureFile),
-                       neutralLangIndex = lang.lastIndexOf('-');
-
-               // Run culture script
-               console.log('Run globalize culture: ' + globalizeCulturePath);
-               this.util.loadScriptSync(
-                       globalizeCulturePath, 
-                       null, 
-                       function(jqXHR, textStatus, errorThrown) {      // Failed to load!
-                               if(jqXHR.status == 404) {
-                                       // If culture file is not found, run neutral language culture. 
-                                       // (e.g. en-US --> en)
-                                       if(neutralLangIndex != -1) {
-                                               var neutralLang = lang.substr(0, neutralLangIndex),
-                                                       neutralCultureFile = getGlobalizeCultureFile(neutralLang),
-                                                       neutralCulturePath = getGlobalizeCulturePath(self, neutralCultureFile);
-                                               console.log('Run globalize culture of neutral lang: ' + neutralCulturePath);
-                                               self.util.loadScriptSync(neutralCulturePath);
+                       globalizeCultureFile = getGlobalizeCultureFile( lang );
+                       globalizeCulturePath = getGlobalizeCulturePath( self, globalizeCultureFile );
+                       neutralLangIndex = lang.lastIndexOf( '-' );
+
+                       // Run culture script
+                       console.log( 'Run globalize culture: ' + globalizeCulturePath );
+                       this.util.loadScriptSync(
+                               globalizeCulturePath,
+                               null,
+                               function ( jqXHR, textStatus, errorThrown ) {   // Failed to load!
+                                       if ( jqXHR.status == 404 ) {
+                                               // If culture file is not found, run neutral language culture. 
+                                               // (e.g. en-US --> en)
+                                               if ( neutralLangIndex != -1 ) {
+                                                       var neutralLang = lang.substr( 0, neutralLangIndex ),
+                                                               neutralCultureFile = getGlobalizeCultureFile( neutralLang ),
+                                                               neutralCulturePath = getGlobalizeCulturePath( self, neutralCultureFile );
+                                                       console.log( 'Run globalize culture of neutral lang: ' + neutralCulturePath );
+                                                       self.util.loadScriptSync( neutralCulturePath );
+                                               }
+                                       } else {
+                                               window.alert( 'Error while loading ' + globalizeCulturePath + '\n' + jqXHR.status + ':' + jqXHR.statusText );
                                        }
                                }
-                               else {
-                                       alert('Error while loading ' + scriptPath + '\n' + jqXHR.status + ':' + jqXHR.statusText);
+                       );
+                       return lang;
+               },
+               setGlobalize: function ( ) {
+                       var lang = this.loadGlobalizeCulture( );
+
+                       // Set culture
+                       // NOTE: It is not needed to set with neutral lang. 
+                       //       Globalize automatically deals with it.
+                       Globalize.culture( lang );
+               },
+
+               /** Set viewport meta tag for mobile devices.
+                *
+                * @param[in]   viewportWidth   Viewport width. 'device-dpi' is also allowed.
+                * @param[in]   useAutoScale    If true, calculate & use scale factor. otherwise, scale factor is 1.
+                * @param[in]   useDeviceDpi    If true, add 'target-densityDpi=device-dpi' to viewport meta content.
+                */
+               setViewport: function ( viewportWidth, useAutoScale, useDeviceDpi ) {
+                       var meta,
+                               scale = 1,
+                               head;
+                       // Do nothing if viewport setting code is already in the code.
+                       $( "meta" ).each( function ( ) {
+                               if ( $( this ).attr( "name" ) === "viewport" ) {
+                                       console.log( "User set viewport... framework viewport will not be applied." );
+                                       meta = this;
+                                       return;
+                               }
+                       });
+
+                       // Set meta tag
+                       meta = document.createElement( "meta" );
+                       if ( meta ) {
+                               scale = useAutoScale ? this.util.getScaleFactor( ) : scale;
+                               meta.name = "viewport";
+                               meta.content = "width=" + viewportWidth + ", initial-scale=" + scale + ", maximum-scale=" + scale + ", user-scalable=0";
+                               if ( useDeviceDpi ) {
+                                       meta.content += ", target-densityDpi=device-dpi";
                                }
+                               console.log( meta.content );
+                               head = document.getElementsByTagName( 'head' ).item( 0 );
+                               head.insertBefore( meta, head.firstChild );
+                       }
+               },
+
+               /**     Read body's font-size, scale it, and reset it.
+                *  param[in]   desired font-size / base font-size.
+                */
+               scaleBaseFontSize: function ( themeDefaultFontSize, ratio ) {
+                       var scaledFontSize = Math.round( themeDefaultFontSize * ratio );
+                       $( '.ui-mobile' ).css( { 'font-size': scaledFontSize + "px" } );
+                       $( '.ui-mobile').children( 'body' ).css( { 'font-size': scaledFontSize + "px" } );
+               },
+
+               setScaling: function ( ) {
+                       var baseWidth = 720,            // NOTE: need to be changed to get the value from theme.
+                               standardWidth = 360,
+                               themeDefaultFontSize = parseInt( $( 'body' ).css( 'font-size' ), 10 );
+                       $( 'body' ).attr( 'data-tizen-theme-default-font-size', themeDefaultFontSize );
+
+                       if ( this.frameworkData.viewportScale ) {
+                               // Use viewport scaling with base font-size
+                               // NOTE: No font-size setting is needed.
+                               this.setViewport( baseWidth, true, true );
+                       } else {
+                               // Fixed viewport scale(=1.0) with scaled font size
+                               this.setViewport( "device-dpi", false, undefined );
+                               this.scaleBaseFontSize( themeDefaultFontSize, parseFloat( standardWidth / baseWidth ) );
                        }
-               );
-               return lang;
-       },
-       setGlobalize: function() {
-               var lang = this.loadGlobalizeCulture();
-
-               // Set culture
-               // NOTE: It is not needed to set with neutral lang. 
-               //       Globalize automatically deals with it.
-               Globalize.culture(lang);
-       },
-};
-
-
-// Loader's jobs
-(function (S, $, undefined) {
+               }
+       };
+} ( jQuery, window.Globalize, window ) );
+
+
+// Loader's job list
+( function ( S, $, undefined ) {
        S.getParams( );
        S.loadTheme( );
-       S.setViewport( );
        S.setGlobalize( );
 
-       // Turn off JQM's auto initialization option.
+       // Turn off JQM's auto initialization option.
        // NOTE: This job must be done before domready.
        $.mobile.autoInitializePage = false;
-       domReady( function( ) {
+
+       $(document).ready( function ( ) {
+               S.setScaling( );
                $.mobile.initializePage( );
        });
- })(S, jQuery);
+} ( window.S, jQuery ) );
index 2125ada..2089859 100644 (file)
@@ -9,7 +9,8 @@
                <script src="@LIBDIR@/jquery.js"></script>
                <script src="@LIBDIR@/tizen-web-ui-fw-libs.min.js"></script>
                <script src="@LIBDIR@/tizen-web-ui-fw.min.js"
-                       data-framework-theme="tizen-gray"></script>
+                       data-framework-theme="tizen-gray"
+                       data-framework-viewport-scale=false></script>
 
                <!--NOTE:
                        Additional scripts and css files are to be placed here.
@@ -20,9 +21,9 @@
                                <link rel="stylesheet" href="my.css">
 
                        When you want to manipulate elements in your code, you have to
-                       use domReady for your code to work properly, like this;
+                       use $(document).ready() for your code to work properly, like this;
 
-                               domReady(function(){ ... });
+                               $(document).ready(function(){ ... });
                -->
     </head>
 
diff --git a/src/themes/tizen/common/dayselector.less b/src/themes/tizen/common/dayselector.less
deleted file mode 100755 (executable)
index cbd6331..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-
-@import "config.less";
-
-/* dayselector CSS */
-.ui-dayselector label {
-    height: 56px;
-    width: 64px;
-}
-
-.ui-dayselector  {
-       
-       .ui-btn {
-               border-color : @color_dayselector_Btn_border;
-               border-style : solid;
-               border-width : 1 * @unit_base;
-               .ui-btn-inner {
-                       text-align :center;                     
-                       padding : 0.8em 0px;
-               }
-       }
-       .ui-checkbox-off {
-               background : @color_dayselector_Btn_normal;
-               .ui-btn-text {
-                       color : @color_dayselector_Btn_Mon_to_Fri;
-               }       
-       }
-       
-       .ui-checkbox-off.ui-btn-down-s.ui-btn-hover-s {
-               background : @color_dayselector_Btn_press;
-       }
-       
-       .ui-checkbox-on {
-               background : @color_dayselector_Btn_press;
-               .ui-btn-text {
-                       color : @color_dayselector_Btn_Mon_to_Fri;      
-               }       
-       }
-
-       .ui-checkbox-on.ui-btn-down-s.ui-btn-hover-s {
-               background : @color_dayselector_Btn_normal;
-       }
-       .ui-dayselector-label-saturday {
-               .ui-btn-text {  
-               color: @color_dayselector_Btn_Sat;
-               }
-       }
-       .ui-dayselector-label-sunday {
-               .ui-btn-text {
-                   color: @color_dayselector_Btn_Sun;
-               }
-       }
-       .ui-checkbox {  
-               height : 90 * @unit_base;
-               
-               .ui-btn {
-                       width : 94 * @unit_base;
-               }
-               .ui-btn.ui-corner-left  {
-                       border-top-left-radius : 5 * @unit_base;
-                       border-bottom-left-radius : 5 * @unit_base;
-               } 
-               .ui-btn.ui-corner-right {
-                       border-top-right-radius : 5 * @unit_base;
-                       border-bottom-right-radius : 5 * @unit_base;
-               }                        
-}
-
-}
-
index fed0faf..ee0234e 100755 (executable)
@@ -212,7 +212,6 @@ background-image: url(images/00_winset_Back.png);}
        position: absolute;
        top: 0 * @unit_base;
        margin-top: 0 * @unit_base;
-       left : 950px - 160px - @width_buttonEdit;
 }
 
 .ui-btn.ui-btn-edit.ui-btn-down-s
index 6d8cb45..86ce52b 100755 (executable)
@@ -57,7 +57,7 @@
 .ui-loading .ui-loader { display: block; }
 .ui-loading .ui-page { overflow: hidden;  }
 .ui-loader { display: none; position: absolute; opacity: .85; z-index: @z_base_loader; left: 50%; width: 200px; margin-left: -130px; margin-top: -35px; padding: 10px 30px; }
-.ui-loader h1 { font-size: 0.5 * @font_size_default; text-align: center; }
+.ui-loader h1 { font-size: 32 * @unit_base; text-align: center; }
 .ui-loader .ui-icon { position: static; display: block; opacity: .9; margin: 0 auto; width: 35px; height: 35px; background-color: transparent; }
 
 /*fouc*/
index 031c62e..355d653 100755 (executable)
@@ -1,8 +1,8 @@
 @import "config.less";\r
-@search-bar-padding: (16*@em_base);\r
+@search-bar-padding: (16*@unit_base);\r
 \r
 label.ui-input-text {\r
-       font-size: @font_size_default;\r
+       font-size: 32 * @unit_base;\r
        line-height: 1.4;\r
        display: block;\r
        font-weight: normal;\r
@@ -12,13 +12,13 @@ input.ui-input-text, textarea.ui-input-text {
        background-image: none;\r
        padding: .4em;\r
        line-height: 1.4;\r
-       font-size: @font_size_default;\r
+       font-size: 32 * @unit_base;\r
        display: block;\r
        width: 95%;\r
 }\r
 input.ui-input-text { -webkit-appearance: none; }\r
 textarea.ui-input-text {\r
-       height: 50*@em_base;\r
+       height: 50*@unit_base;\r
        -webkit-transition: height 200ms linear;\r
        -moz-transition: height 200ms linear;\r
        -o-transition: height 200ms linear;\r
@@ -72,7 +72,7 @@ textarea.ui-input-text {
 }\r
 \r
 /* orientation adjustments - incomplete!*/\r
-@media all and (min-width: 720*@em_base){\r
+@media all and (min-width: 720*@unit_base){\r
        label.ui-input-text  {\r
                vertical-align: top;\r
                display: inline-block;\r
@@ -137,7 +137,6 @@ textarea.ui-input-text {
                margin-right : 10 * @unit_base;\r
                padding : 0px;\r
 \r
-               background : black;\r
                height : 74 * @unit_base;\r
                \r
                border-color : none;\r
index f09696b..bbb3c03 100755 (executable)
@@ -62,9 +62,9 @@
 
 /************************/
 
-.ui-listview { 
-       margin: 0; 
-       counter-reset: listnumbering; 
+.ui-listview {
+       margin: 0;
+       counter-reset: listnumbering;
        border-top-width: 1px;
        border-top-style: solid;
 
        li.ui-btn-down-s > .ui-li > .ui-btn-text > a.ui-link-inherit {
                font-size: @font_size_list_main_text;
        }
-       
+
        li.ui-btn > .ui-btn-hastxt > .ui-btn-text.ui-btn-text-padding-right {
                padding-right: 0 * @unit_base;  // Clear default button padding-right
        }
-       
-       &> .ui-li { 
+
+       &> .ui-li {
                // list item separator line
-               border-bottom-width: 1px; 
-               border-bottom-style: solid; 
+               border-bottom-width: 1px;
+               border-bottom-style: solid;
        }
 }
 
 .ui-content {
-       .ui-listview { 
-               margin: -15px; 
+       .ui-listview {
+               margin: -16 * @unit_base;
 
-               .ui-listview { 
-                       margin: 0; 
+               .ui-listview {
+                       margin: 0;
                }
 
        }
-       .ui-listview-inset { 
-               margin: 1em 0;  
+       .ui-listview-inset {
+               margin: 1em 0;
        }
 }
-.ui-listview, 
-.ui-li { 
-       list-style:none; 
-       padding:0; 
+.ui-listview,
+.ui-li {
+       list-style:none;
+       padding:0;
 }
-.ui-li, 
-.ui-li.ui-field-contain { 
-       display: block; 
-       margin:0; 
-       position: relative; 
-       overflow: visible; 
-       text-align: left;  
+.ui-li,
+.ui-li.ui-field-contain {
+       display: block;
+       margin:0;
+       position: relative;
+       overflow: visible;
+       text-align: left;
 }
 .ui-li {
        .ui-btn {
-               // NOTE: position(:absolute), right(:16px) is defined in jquery.mobile.button.less
-               //       Have to cross-check with Wongi!
-               
-               // vertical center
                top: 50%;
-               margin-top: -0.8em;     // TODO: guessed value. Fix this with Wongi.
+               margin-top: -0.8em;
        }
-       .ui-btn-text { 
-               position: relative; 
-       //      z-index: 1; 
+       .ui-btn-text {
+               position: relative;
 
-               a.ui-link-inherit { 
-                       text-overflow: ellipsis; 
-                       overflow: hidden; 
-                       white-space: nowrap;  
+               a.ui-link-inherit {
+                       text-overflow: ellipsis;
+                       overflow: hidden;
+                       white-space: nowrap;
                }
        }
-       &:last-child, 
-       &.ui-field-contain:last-child { 
-               border-bottom-width: 1px; 
+       &:last-child,
+       &.ui-field-contain:last-child {
+               border-bottom-width: 1px;
        }
-       &>.ui-btn-inner { 
-               display: block; 
-               position: relative; 
-               padding: 0; 
-               border-width:0; 
+       &>.ui-btn-inner {
+               display: block;
+               position: relative;
+               padding: 0;
+               border-width:0;
        }
-       .ui-btn-inner a.ui-link-inherit, 
-       &.ui-li-static { 
-               padding: .7em 15px;
-               display: block; 
+       .ui-btn-inner a.ui-link-inherit,
+       &.ui-li-static {
+               padding: .7em 16*@unit_base;
+               display: block;
        }
 }
-.ui-li-divider, 
-.ui-li-static {  
-       font-weight: @list-font-weight;  
+.ui-li-divider,
+.ui-li-static {
+       font-weight: @list-font-weight;
        padding: 0px @list-li-padding-horizontal;
 }
-.ui-li-static { 
-       font-size: @font_size_list_main_text;  
+.ui-li-static {
+       font-size: @font_size_list_main_text;
 }
-.ui-li-divider { 
-       counter-reset: listnumbering;  
+.ui-li-divider {
+       counter-reset: listnumbering;
        font-size: @list-font-size-divider;
-       // text align: bottom
        padding-top: @list-font-size-divider;
        &.ui-bar-s {
                height : @list-font-size-divider;
 
 
 // Ordered list
-ol.ui-listview .ui-link-inherit:before, 
-ol.ui-listview .ui-li-static:before, 
-.ui-li-dec { 
-       font-size: .8em; 
-       display: inline-block; 
-       padding-right: .3em; 
+ol.ui-listview .ui-link-inherit:before,
+ol.ui-listview .ui-li-static:before,
+.ui-li-dec {
+       font-size: .8em;
+       display: inline-block;
+       padding-right: .3em;
        font-weight: normal;
-       counter-increment: listnumbering; 
-       content: counter(listnumbering) ". "; 
+       counter-increment: listnumbering;
+       content: counter(listnumbering) ". ";
 }
 ol.ui-listview {
-       .ui-li-jsnumbering:before { 
+       .ui-li-jsnumbering:before {
                content: "" !important; /* to avoid chance of duplication */
        }
 }
@@ -186,177 +180,165 @@ ol.ui-listview {
 // Detailed li styles
 
 .ui-listview-inset {
-       .ui-li { 
-               border-right-width: 1px; 
-               border-left-width: 1px; 
+       .ui-li {
+               border-right-width: 1px;
+               border-left-width: 1px;
        }
 }
 .ui-li-has-thumb {
-       .ui-btn-inner a.ui-link-inherit, 
-       &.ui-li-static  { 
-               min-height: 60px; 
-               padding-left: 100px; 
+       .ui-btn-inner a.ui-link-inherit,
+       &.ui-li-static  {
+               min-height: 60 * @unit_base;
+               padding-left: 100 * @unit_base;
        }
 }
 .ui-li-has-icon {
-       .ui-btn-inner a.ui-link-inherit, 
-       &.ui-li-static {  
-               min-height: 20px; 
-               padding-left: 40px; 
+       .ui-btn-inner a.ui-link-inherit,
+       &.ui-li-static {
+               min-height: 20px;
+               padding-left: 40px;
        }
 }
 .ui-li-has-count {
-       .ui-btn-inner a.ui-link-inherit, 
-       &.ui-li-static { 
-               padding-right: 45px; 
+       .ui-btn-inner a.ui-link-inherit,
+       &.ui-li-static {
+               padding-right: 45px;
        }
 }
 .ui-li-has-arrow {
-       .ui-btn-inner a.ui-link-inherit, 
-       &.ui-li-static { 
-               padding-right: 30px; 
-       }
-       &.ui-li-has-count .ui-btn-inner a.ui-link-inherit, 
-       &.ui-li-static.ui-li-has-count { 
-               padding-right: 75px; 
-       }
-}
-.ui-li-heading { 
-       font-size: 16px; 
-       font-weight: bold; 
-       display: block; 
-       margin: .6em 0; 
-       text-overflow: ellipsis; 
-       overflow: hidden; 
-       white-space: nowrap;  
-}
-.ui-li-desc {  
-       font-size: 12px; 
-       font-weight: normal; 
-       display: block; 
-       margin: -.5em 0 .6em; 
-       text-overflow: ellipsis; 
-       overflow: hidden; 
-       white-space: nowrap; 
-}
-.ui-li-thumb, 
-.ui-li-icon { 
-       position: absolute; 
-       left: 1px; 
-       top: 0; 
-       max-height: @list-bigicon-size2; 
-       max-width: @list-bigicon-size2; 
-}
-//.ui-li-icon { 
-//     max-height: 40px; 
-//     max-width: 40px; 
-//     left: 10px; 
-//     top: .9em; 
-//}
-//.ui-li-thumb, 
-//.ui-li-icon, 
-//.ui-li-content { 
-//     float: left; 
-//     margin-right: 10px; 
-//}
-.ui-li-aside { 
-       float: right; 
-       width: 50%; 
-       text-align: right; 
-       margin: .3em 0; 
+       .ui-btn-inner a.ui-link-inherit,
+       &.ui-li-static {
+               padding-right: 30px;
+       }
+       &.ui-li-has-count .ui-btn-inner a.ui-link-inherit,
+       &.ui-li-static.ui-li-has-count {
+               padding-right: 75px;
+       }
+}
+.ui-li-heading {
+       font-size: 16px;
+       font-weight: bold;
+       display: block;
+       margin: .6em 0;
+       text-overflow: ellipsis;
+       overflow: hidden;
+       white-space: nowrap;
+}
+.ui-li-desc {
+       font-size: 12px;
+       font-weight: normal;
+       display: block;
+       margin: -.5em 0 .6em;
+       text-overflow: ellipsis;
+       overflow: hidden;
+       white-space: nowrap;
+}
+.ui-li-thumb,
+.ui-li-icon {
+       position: absolute;
+       left: 1px;
+       top: 0;
+       max-height: @list-bigicon-size2;
+       max-width: @list-bigicon-size2;
+}
+.ui-li-aside {
+       float: right;
+       width: 50%;
+       text-align: right;
+       margin: .3em 0;
 }
 @media all and (min-width: 480px){
         .ui-li-aside { width: 45%; }
-}       
-.ui-li-divider { 
-       cursor: default; 
+}
+.ui-li-divider {
+       cursor: default;
 }
 .ui-li-has-alt {
-       .ui-btn-inner a.ui-link-inherit, 
-       &.ui-li-static { 
-               padding-right: 95px; 
+       .ui-btn-inner a.ui-link-inherit,
+       &.ui-li-static {
+               padding-right: 95px;
        }
 }
 .ui-li-has-count {
-       .ui-li-count { 
-               position: absolute; 
-               font-size: 11px; 
-               font-weight: bold; 
-               padding: .2em .5em; 
-               top: 50%; 
-               margin-top: -.9em; 
-               right: 38px; 
-       }
-}
-.ui-li-divider .ui-li-count, 
-.ui-li-static .ui-li-count { 
-       right: 10px; 
-}
-.ui-li-has-alt .ui-li-count { 
-       right: 55px; 
-}
-.ui-li-link-alt { 
-       position: absolute; 
-       width: 40px; 
-       height: 100%; 
-       border-width: 0; 
-       border-left-width: 1px; 
-       top: 0; 
-       right: 0; 
-       margin: 0; 
-       padding: 0; 
-       z-index: 2; 
-
-       .ui-btn { 
-               overflow: hidden; 
-               position: absolute; 
-               right: 8px; 
-               top: 50%; 
-               margin: -11px 0 0 0; 
-               border-bottom-width: 1px; 
+       .ui-li-count {
+               position: absolute;
+               font-size: 11px;
+               font-weight: bold;
+               padding: .2em .5em;
+               top: 50%;
+               margin-top: -.9em;
+               right: 38px;
+       }
+}
+.ui-li-divider .ui-li-count,
+.ui-li-static .ui-li-count {
+       right: 10px;
+}
+.ui-li-has-alt .ui-li-count {
+       right: 55px;
+}
+.ui-li-link-alt {
+       position: absolute;
+       width: 40px;
+       height: 100%;
+       border-width: 0;
+       border-left-width: 1px;
+       top: 0;
+       right: 0;
+       margin: 0;
+       padding: 0;
+       z-index: 2;
+
+       .ui-btn {
+               overflow: hidden;
+               position: absolute;
+               right: 8px;
+               top: 50%;
+               margin: -11px 0 0 0;
+               border-bottom-width: 1px;
                z-index: -1;
        }
-       .ui-btn-inner { 
-               padding: 0; 
-               height: 100%; 
-               position: absolute; 
-               width: 100%; 
-               top: 0; 
+       .ui-btn-inner {
+               padding: 0;
+               height: 100%;
+               position: absolute;
+               width: 100%;
+               top: 0;
                left: 0;
        }
-       .ui-btn .ui-icon { 
-               right: 50%; 
-               margin-right: -9px;  
+       .ui-btn .ui-icon {
+               right: 50%;
+               margin-right: -9px;
        }
 }
-.ui-listview * .ui-btn-inner > .ui-btn > .ui-btn-inner { 
-       border-top: 0px; 
+.ui-listview * .ui-btn-inner > .ui-btn > .ui-btn-inner {
+       border-top: 0px;
 }
 
-.ui-listview-filter { 
-       border-width: 0; 
-       overflow: hidden; 
+.ui-listview-filter {
+       border-width: 0;
+       overflow: hidden;
        margin: -15px -15px 15px -15px;
 
-       .ui-input-search { 
-               margin: 5px; 
-               width: auto; 
-               display: block; 
+       .ui-input-search {
+               margin: 5px;
+               width: auto;
+               display: block;
        }
 }
-.ui-listview-filter-inset { 
-       margin: -15px -5px -15px -5px; 
-       background: transparent; 
+.ui-listview-filter-inset {
+       margin: -15px -5px -15px -5px;
+       background: transparent;
 }
 .ui-li.ui-screen-hidden {
        display:none;
 }
-.ui-li-sub, 
-.ui-li-sub-setting { 
-       float: right; 
-       text-align: right; 
-       font-size: @font_size_list_sub_text; 
-       margin: .3em 0; 
+.ui-li-sub,
+.ui-li-sub-setting {
+       float: right;
+       text-align: right;
+       font-size: @font_size_list_sub_text;
+       margin: .3em 0;
 }
 
 /* listview: size for li with a link */
@@ -365,7 +347,6 @@ ol.ui-listview {
 .ui-listview li.ui-btn-hover-s > .ui-li > .ui-btn-text > a.ui-link-inherit,
 .ui-listview li.ui-btn-down-s > .ui-li > .ui-btn-text > a.ui-link-inherit {
        margin: 0;
-//     height: @height;
        min-height: @height;
        padding-left: 0;
 }
@@ -410,9 +391,9 @@ ol.ui-listview {
 
 .LESStext-sub-1line() {
        .ui-li-text-sub {
-               float: right; 
-               text-align: right; 
-               font-size: @font_size_list_sub_text; 
+               float: right;
+               text-align: right;
+               font-size: @font_size_list_sub_text;
                color: @color_list_sub_text_default;
                top: 50%;
                margin-top: -0.5em;
@@ -438,12 +419,10 @@ ol.ui-listview {
                width: @list-li-sub-left-width;
                line-height: @list-li-main-line-height;
                margin-top: -0.5em;
-       //      border-right: 1px rgba(68, 68, 68, 255) solid;
                vertical-align: top;
        }
 
 }
-//.LESStext-main-1line-right(@left:@list-li-main-right-padding+@list-li-padding-horizontal) {
 .LESStext-main-1line-right(@left:@list-li-main-right-padding) {
        .ui-li-text-main-right {
                font-size: @font_size_list_main_text;
@@ -477,7 +456,7 @@ ol.ui-listview {
 .LESStext-sub-2line-left(@left:@list-li-padding-horizontal, @top: @list-li-top-padding+@list-li-main-line-height) {
        .ui-li-text-sub {
                position: absolute;
-               font-size: @font_size_list_sub_text; 
+               font-size: @font_size_list_sub_text;
                line-height: @list-li-sub-line-height;
                color: @color_list_sub_text_default;
                left: @left;
@@ -492,7 +471,7 @@ ol.ui-listview {
 .LESStext-sub-2line-right(@right:@list-li-padding-horizontal, @top: @list-li-top-padding) {
        .ui-li-text-sub2 {
                position: absolute;
-               font-size: @font_size_list_sub_text; 
+               font-size: @font_size_list_sub_text;
                line-height: @list-li-sub-line-height;
                color: @color_list_sub_text_default;
                right: @right;
@@ -534,7 +513,7 @@ ol.ui-listview {
 .LESStext-sub-3line-left1(@left:@list-li-padding-horizontal, @top: @list-li-top-padding+@list-li-main-line-height) {
        .ui-li-text-sub1 {
                position: absolute;
-               font-size: @font_size_list_sub_text; 
+               font-size: @font_size_list_sub_text;
                line-height: @list-li-sub-line-height;
                color: @color_list_sub_text_default;
                left: @left;
@@ -548,7 +527,7 @@ ol.ui-listview {
 .LESStext-sub-3line-left2(@left:@list-li-padding-horizontal, @top: @list-li-top-padding+@list-li-main-line-height) {
        .ui-li-text-sub2 {
                position: absolute;
-               font-size: @font_size_list_sub_text; 
+               font-size: @font_size_list_sub_text;
                line-height: @list-li-sub-line-height;
                color: @color_list_sub_text_default;
                left: @left;
@@ -563,7 +542,7 @@ ol.ui-listview {
 .LESStext-email-sub-3line-sub1(@left:2 * @list-li-padding-horizontal + @list-checkbox-size, @top:@list-li-email-top-padding + @list-li-main-line-height + @list-li-email-subline-top-padding) {
        .ui-li-text-sub1 {
                position: absolute;
-               font-size: @font_size_list_sub_text; 
+               font-size: @font_size_list_sub_text;
                line-height: @list-li-email-sub-line-height;
                color: @color_list_name_text;
                left: @left;
@@ -577,7 +556,7 @@ ol.ui-listview {
 .LESStext-email-sub-3line-sub2(@left:2 * @list-li-padding-horizontal + @list-checkbox-size, @top:@list-li-email-top-padding + @list-li-main-line-height + @list-li-email-sub-line-height) {
        .ui-li-text-sub2 {
                position: absolute;
-               font-size: @font_size_list_sub_text; 
+               font-size: @font_size_list_sub_text;
                line-height: @list-li-email-sub-line-height;
                color: @color_list_contents_text;
                left: @left;
@@ -591,7 +570,7 @@ ol.ui-listview {
 .LESStext-email-sub-3line-sub3(@right:@list-li-padding-horizontal, @top: @list-li-email-top-padding + @list-li-main-line-height + @list-li-email-sub-line-height) {
        .ui-li-text-sub3 {
                position: absolute;
-               font-size: @font_size_list_sub_text; 
+               font-size: @font_size_list_sub_text;
                line-height: @list-li-email-sub-line-height;
                color: @color_list_sub_text_default;
                right: @right;
@@ -689,16 +668,6 @@ ol.ui-listview {
                top: @top;
                margin: -1.1em 65*@unit_base 0 @list-li-padding-horizontal;
        }
-/*     &> .ui-checkbox.onoff {
-               position: absolute;
-               left: auto;
-               right: @right;
-               top: @top;
-               margin-top: -1.1em;
-               //float: right;
-               //margin-right: @list-li-padding-horizontal;
-       }
-*/
 }
 .LESStoggleswitch-right(@right:@list-li-padding-horizontal, @top: 50%) {       // NOTE: This can be changed according to checkbox implementation!
        .ui-toggleswitch {
@@ -723,7 +692,7 @@ ol.ui-listview {
                right: auto;
                left: @left;
                top: @top;
-               margin: -1.1em 0 0 -8*@unit_base; 
+               margin: -1.1em 0 0 -8*@unit_base;
        }
 }
 .LESSimg-bigicon(@size:@list-bigicon-size) {
@@ -788,14 +757,14 @@ ul.ui-listview {
                padding : 0px;
                padding-left : 16px;
                padding-right : 16px;
-               
+
                &> div.ui-btn {
                        position : absolute;
                        padding : 0px;
                        margin-top : 0px;
                        width : 336px;
                        top : 18px;
-                       
+
                        &> span.ui-btn-hastxt {
                                padding-top : 0.4em;
                        }
@@ -804,7 +773,7 @@ ul.ui-listview {
                &> div.ui-btn:nth-child(1) {
                        left : 16px;
                }
-               
+
                &> div.ui-btn:nth-child(2) {
                        left : 372px;
                }
@@ -828,7 +797,7 @@ ul.ui-listview {
                .LESStext-main-1line;
                .LESStoggleswitch-right;
        }
-       
+
        &> li.ui-li-1line-bigicon1,
        &> li.ui-li-1line-bigicon2,
        &> li.ui-li-1line-bigicon4,
@@ -955,7 +924,7 @@ ul.ui-listview {
        &> li.ui-li-2line-bigicon2 {
                .LESStext-sub-2line-right;
        }
-       
+
        &> li.ui-li-2line-setting,
        &> li.ui-li-2line-toggle-setting,
        &> li.ui-li-2line-btn-setting,
@@ -1224,7 +1193,7 @@ ul.ui-listview {
                font-size: 36 * @unit_base;
                padding: 16 * @unit_base;
 
-               h1.ui-li-heading { 
+               h1.ui-li-heading {
                        font-size: 48 * @unit_base;
                        margin-top: 0 * @unit_base;
                        margin-bottom: 0 * @unit_base;
@@ -1323,7 +1292,7 @@ ul.ui-listview {
        &> li.ui-li-email-name1-btn-warning-attach,
        &> li.ui-li-email-name1-warning-attach {
                .LESStext-email-sub1-setting;
-       }       
+       }
 
 
        // Dialogue list
@@ -1331,13 +1300,13 @@ ul.ui-listview {
                .LESStext-sub-1line-left;
                .LESStext-main-1line-right;
        }
-       &> li.ui-li-1line-leftsub2 { 
+       &> li.ui-li-1line-leftsub2 {
                .LESSli-reset-position-1line;
                .LESStext-sub-1line-left;
                .LESStext-main-1line-right;
                .LESSimg-bigicon-right(16 * @unit_base);
        }
-       &> li.ui-li-4-2-3 { 
+       &> li.ui-li-4-2-3 {
                .LESSli-reset-position;
                .LESStext-main-2line;
                .LESStext-sub-2line-left;
@@ -1347,7 +1316,7 @@ ul.ui-listview {
                        max-width: 95%;
                }
        }
-       &> li.ui-li-4-2-10 { 
+       &> li.ui-li-4-2-10 {
                .LESSli-reset-position;
                .LESStext-main-2line(@list-li-padding-horizontal, @list-li-top-padding + @list-li-sub-line-height);
                .LESStext-sub-2line-left(@list-li-padding-horizontal, @list-li-top-padding);
@@ -1357,19 +1326,19 @@ ul.ui-listview {
                }
                .LESScheckbox-right;
        }
-       
+
        &> li.ui-li-4-2-11 {
                .LESStext-sub-1line-left;
                .LESStext-main-1line-right;
-               
-               .ui-li-text-main-right  
+
+               .ui-li-text-main-right
                {
                        display: inline-block;
                        word-wrap:normal;
                }
        }
-       
-       &> li.ui-li-3line-dgroup1 { 
+
+       &> li.ui-li-3line-dgroup1 {
                .LESSli-reset-position-3line;
                .LESStext-main-3line(@list-li-padding-horizontal, @list-li-top-padding);
                .LESStext-sub-3line-left1(@list-li-padding-horizontal, @list-li-top-padding + @list-li-sub-line-height);
@@ -1380,7 +1349,7 @@ ul.ui-listview {
        &> li.ui-li-4-3-2 {
                height : 190px;
                padding : 0px;
-       
+
                .ui-li-thumb {
                        float : left;
                        height : 128px;
@@ -1388,9 +1357,9 @@ ul.ui-listview {
                        width : 128px;
                        max-width: 128px;
                        left: 32px;
-                       top: 28px;                      
+                       top: 28px;
                }
-               
+
                span.contact_name_field {
                        position : absolute;
                        font-size : @list-dialogue-font-size-main;
@@ -1399,7 +1368,7 @@ ul.ui-listview {
                        top : 32px;
                        height : 54px;
                }
-               
+
                span.contact_subname_field {
                        position : absolute;
                        font-size : @list-dialogue-font-size-sub;
@@ -1407,7 +1376,7 @@ ul.ui-listview {
                        left : 184px;
                        top : 94px;
                }
-               
+
                span.companyname_field {
                        position : absolute;
                        font-size : @list-dialogue-font-size-sub;
@@ -1426,7 +1395,7 @@ ul.ui-listview {
                position: absolute;
                &> img
                {
-                       width:128px; 
+                       width:128px;
                        height:128px;
                }
        }
@@ -1439,13 +1408,13 @@ ul.ui-listview {
                width : 790px;
                padding-left: 12px;
                padding-right: 0px;
-               
+
                &> .ui-field-contain
                {
                        margin:0;
                        padding : 8px;
                        width : 782px;
-                       
+
                        &> input
                        {
                                border : none;
@@ -1453,7 +1422,7 @@ ul.ui-listview {
                                width : 782px;
                                padding : 0px;
                        }
-                       
+
                        /* wongi_1215 : Default Text */
                        &>div.ui-input-default-text {
                                position: absolute;
@@ -1463,7 +1432,7 @@ ul.ui-listview {
                                margin: 0px;
                                color: @color_dialogue_editor_default_text;
                        }
-                       
+
                        &>div.ui-input-default-text.ui-input-default-hidden {
                                display : none;
                        }
@@ -1489,7 +1458,7 @@ ul.ui-listview {
                {
                        border-right: 1px @color_dialogue_editor_border solid;
                        width: 160px;
-                       height: 130px;  
+                       height: 130px;
                }
 
                &> div div.ui-li-dialogue-editor-2-label
@@ -1500,7 +1469,7 @@ ul.ui-listview {
                        top:50%;
                        margin-top:-16px;
                }
-               
+
                &> .ui-field-contain
                {
                        margin:0;
@@ -1508,8 +1477,8 @@ ul.ui-listview {
                        position:absolute;
                        top:50%;
                        margin-top:-16px;
-                       left : 200px; 
-                       
+                       left : 200px;
+
                        &> input
                        {
                                border : none;
@@ -1517,7 +1486,7 @@ ul.ui-listview {
                                width : 676px;
                                padding : 0px;
                        }
-                       
+
                        /* wongi_1215 : Default Text */
                        &>div.ui-input-default-text {
                                position: absolute;
@@ -1526,35 +1495,35 @@ ul.ui-listview {
                                margin: 0px;
                                color: @color_dialogue_editor_default_text;
                        }
-                       
+
                        &>div.ui-input-default-text.ui-input-default-hidden {
                                display : none;
                        }
                }
-       }       
+       }
 
-       // Dialogue 
+       // Dialogue
        &> li.ui-li-dialogue {
                border-left: @list-li-dialogue-width @color_dialogue_editor_border solid;
                border-top-width: 0px;
        }
-       
+
        &> li.ui-li-dialogue.ui-li-divider {
-               height: 32px;
+               height: 32 * @unit_base;
                padding : 0px;
        }
 
        &> li.ui-li-divider {
-               height: 32px;   /* wongi_1206 */
+               height: 32 * @unit_base;
                padding : 0px;
        }
 
-       &> li.ui-li-group-title {       /* wongi_1206 */
-               padding-top : 32px;
+       &> li.ui-li-group-title {
+               padding-top : 32 * @unit_base;
        }
-               
-       &> li.ui-li-group-title span {  /* wongi_1206 */
-               padding-left : 16px;
+
+       &> li.ui-li-group-title span {
+               padding-left : 16 * @unit_base;
        }
 
        &> li.ui-li-3-button {
@@ -1562,7 +1531,7 @@ ul.ui-listview {
                padding-right : 8px;
                height : 60px;
        }
-       
+
        &> li.ui-li-3-button div.ui-btn {
                margin-left : 8px;
                margin-right : 8px;
@@ -1576,7 +1545,7 @@ ul.ui-listview {
                        padding-top : 0.6em;
                }
        }
-       
+
        &> li.ui-li-3-button div.ui-btn:nth-child(1) {
                left : 0%;
        }
@@ -1588,18 +1557,29 @@ ul.ui-listview {
        &> li.ui-li-3-button div.ui-btn:nth-child(3) {
                left : 66%;
        }
-
 }
 
 // =========
 // bubble li
 // =========
 .ui-listview {
+       .ui-li-bubble-left,
+               .ui-li-bubble-right,
+               .ui-li-bubble-sos {
+               img {
+                       position: relative;
+                       min-width: 160 * @unit_base;
+                       min-height: 160 * @unit_base;
+               }
+       }
        .ui-li-bubble-left {
                word-wrap: break-word;
                .LESSborder-radius-topright(@list-li-bubble-corner-radius);
                .LESSborder-radius-bottomright(@list-li-bubble-corner-radius);
                font-size: @list-li-bubble-font-size;
+               p, span {
+                       font-size: @list-li-bubble-font-size;
+               }
                //margin: 12px 20% 12px 0%;
                margin-top: 12 * @unit_base;
                margin-bottom: 12 * @unit_base;
@@ -1667,7 +1647,7 @@ ul.ui-listview {
 
 /* Odd iPad positioning issue. */
 @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) {
-    .ui-li .ui-btn-text { 
-               overflow:  visible; 
+    .ui-li .ui-btn-text {
+               overflow:  visible;
        }
 }
index 7432f15..6706924 100755 (executable)
@@ -64,8 +64,8 @@
                        background: @color_bar_footer_btn_bg;                                   
 
                        border-color : black; 
-                       border-width : 2px;
-                       border-style :  groove;                 
+                       border-width : 2 * @unit_base;
+                       border-style :  groove;
                }
        
        .ui-btn.ui-btn-back{
                margin-left : auto;
                margin-right : auto;
                height : 74  * @unit_base;
-               
+
                font-size : 28 * @unit_base;
-               
+
                .ui-extended-controlgroup {
                        position : absolute;
-                       display : inline;                       
-       
+                       display : inline;
+
                        margin-top : 0 * @unit_base;
                        margin-bottom : 0 * @unit_base;
-                       
+
                        label {
                                border-color : @color_bar_seg_btn_border;
                                border-style : solid;
                                border-left-width : 1px;
                                border-right-width : 1px;
                        }
-                       
+
                        .ui-radio {
                                height : 74 * @unit_base;
                                .ui-btn {
                                        width : 100%;
                                }
-                               
+
                                .ui-btn-inner {
                                        .ui-btn-text {
                                                text-align : center;
                                        .ui-btn-text{
                                                color : @color_bar_seg_text_normal;
                                        }
-                               }                       
+                               }
                                .ui-radio-on{
                                        background : @color_bar_seg_btn_press;
-                                       .ui-btn-text{                                                                                   
+                                       .ui-btn-text{                           
                                                color : @color_bar_seg_text_press;              
                                        }
-                               }       
+                               }
                        }
-               }       
+               }
                .ui-title-extended-controlgroup {
-                       top : 15  * @unit_base;
+                       top : 5  * @unit_base; // scale change
                }
                .ui-footer-extended-controlgroup {
-                       top : -5  * @unit_base;
+                       top : 16  * @unit_base; // scale change
                        .ui-btn-inner {
                                line-height : 74  * @unit_base;
                                padding : 0  * @unit_base;
                        }
-               }               
-       }       
+               }
+       }
        .ui-title-normal-3btn {
                position : absolute;
-               right : 144 * @unit_base;
-               
+               right : 154 * @unit_base;
+
                display : block;
        }
-               
+
        .ui-title-extended-controlgroup-4btn {
                width : 682 * @unit_base;
                .ui-radio {
 
        .ui-title-extended-segment-style {
                left : 0 * @unit_base;
-               top : -30%;
-       }               
+               margin-top : 0 * @unit_base;
+               top : 2 * @unit_base; // scale change
+       }
 }
 
-.ui-header.ui-bar-s.ui-title-controlbar-height {
+.ui-header.ui-bar-s.ui-title-controlbar-height,
+.ui-footer.ui-bar-s {
        height : 114 * @unit_base;
 }
 
                font-size : 32 * @unit_base;
        }
 }
+.ui-footer.ui-bar-s .ui-title-extended-controlgroup-4btn {
+       margin-top : 0 * @unit_base;
+}
+
+
 /***************************************************************************
                     Header / Footer 
                     NavigationBar
@@ -478,6 +485,9 @@ a.ui-link-inherit {
        .ui-link-inherit, .ui-link {
                color: @color_controlbar_btn_text;
                font-weight: bold;
+               &:hover { color: @color_controlbar_btn_text; }
+               &:active { color: @color_controlbar_btn_text; }
+               &:visited {     color: @color_controlbar_btn_text; }
        }
 
        .ui-btn-text, .ui-btn {
@@ -525,6 +535,9 @@ a.ui-link-inherit {
                        padding-left : 0px;
                }
        }
+       .ui-btn.ui-ctrlbar-icononly {
+               padding-top : 20 * @unit_base;
+       }
        .ui-btn-inner {
                z-index : 200;
        }
@@ -737,15 +750,15 @@ a.ui-link-inherit {
 }
 
 .ui-image-search {
-
        background-image: url(images/00_search_icon.png);
        background-repeat: no-repeat;
-       
+       .LESSbackground-size(42 * @unit_base, 42 * @unit_base);
 }
 
 .ui-icon-deleteSearch {
        background-image: url(images/00_field_btn_Clear.png);
        background-repeat: no-repeat;
+       .LESSbackground-size(38 * @unit_base, 38 * @unit_base);
 }
 
 
index 8ab2e6a..578b9a9 100755 (executable)
@@ -3,12 +3,12 @@
 @todons-selected-color: #d9931a;
 @todons-selected-color-disabled: #999999;
 
-@colorpalette-choice-total-width:  54px;
-@colorpalette-choice-total-height: 54px;
-@colorpalette-item-border-width:  4px;
+@colorpalette-choice-total-width:  54 * @unit_base;
+@colorpalette-choice-total-height: 54 * @unit_base;
+@colorpalette-item-border-width:  4 * @unit_base;
 @colorpalette-item-border-color: #c0c0c0;
-@colorpalette-preview-total-width:  304px;
-@colorpalette-preview-total-height: 109px;
+@colorpalette-preview-total-width:  304 * @unit_base;
+@colorpalette-preview-total-height: 109 * @unit_base;
 
 @colorpalette-choice-actual-width:  @colorpalette-choice-total-width  - 2 * @colorpalette-item-border-width;
 @colorpalette-choice-actual-height: @colorpalette-choice-total-height - 2 * @colorpalette-item-border-width;
 
 .ui-colorpalette {
   display: table;
-    padding-left:   24px;
-    padding-right:  24px;
-    padding-top:    15px;
-    padding-bottom: 15px;
+    padding-left:   24 * @unit_base;
+    padding-right:  24 * @unit_base;
+    padding-top:    15 * @unit_base;
+    padding-bottom: 15 * @unit_base;
 
   .colorpalette-preview-container {
-        padding-top: 48px;
-        padding-bottom: 39px;
+        padding-top: 48 * @unit_base;
+        padding-bottom: 39 * @unit_base;
     display: table;
     margin: auto;
 
 
     .colorpalette-choice-container-rest {
       .colorpalette-choice-container-left;
-            padding-left: 38px;
+            padding-left: 38 * @unit_base;
     }
 
     .colorpalette-normal-row .colorpalette-choice-container-left {
-            padding-bottom: 16px;
+            padding-bottom: 16 * @unit_base;
     }
 
     .colorpalette-choice {
index a85ca31..73488fa 100755 (executable)
@@ -1,12 +1,13 @@
 /* Own CSS */
+@import "config.less";
 
 /* @selector-size should be an odd number, in order to pixel-perfectly center on a given colour */
-@colorpicker-selector-size: 61px;
-@colorpicker-selector-border-width: 5px;
-@colorpicker-clrchannel-hs-width:  256px;
-@colorpicker-clrchannel-hs-height: 256px;
-@colorpicker-clrchannel-l-width: 16px;
-@colorpicker-clrchannel-l-height: 256px;
+@colorpicker-selector-size: 72 * @unit_base;
+@colorpicker-selector-border-width: 5 * @unit_base;
+@colorpicker-clrchannel-hs-width:  256 * @unit_base;
+@colorpicker-clrchannel-hs-height: 256 * @unit_base;
+@colorpicker-clrchannel-l-width: 18 * @unit_base;
+@colorpicker-clrchannel-l-height: 256 * @unit_base;
 
 @colorpicker-selector-total-size: @colorpicker-selector-size + 2 * @colorpicker-selector-border-width;
 @colorpicker-clrchannel-hs-padding: @colorpicker-selector-total-size / 2;
@@ -60,6 +61,7 @@
             position: absolute;
             width:  @colorpicker-clrchannel-l-width;
             height: @colorpicker-clrchannel-l-height;
+            left: ( @colorpicker-selector-size + ( @colorpicker-selector-border-width * 2 ) - @colorpicker-clrchannel-l-width ) / 2;
         }
 
         .colorpicker-l-selector {
@@ -1,6 +1,8 @@
 /* Need to add !important below, because these classes are added before jqm enhancement */
+@import "config.less";
+
 .ui-colorpickerbutton-input {
-    max-width: 150px;
+    max-width: 150 * @unit_base;
     display: inline-block !important;
 }
 
index 890e999..729041b 100755 (executable)
@@ -1,10 +1,10 @@
 @import "config.less";
 
-@colortitle-vpadding: 15px;
+@colortitle-vpadding: 15 * @unit_base;
 
 .ui-colortitle {
     h1 {
-        margin-left:  10px;
+        margin-left:  10 * @unit_base;
     }
 }
 
index 6e42b4e..46395cf 100755 (executable)
@@ -6,19 +6,19 @@
        display: table;
        
        .ui-ctxpopup-row .ui-triangle-top {
-               top: 1px;
+               top: 2px;
        }
 
        .ui-ctxpopup-row .ui-triangle-left {
-               left: 1px;
+               left: 2px;
        }
 
        .ui-ctxpopup-row .ui-triangle-right {
-               right: 1px;
+               right: 2px;
        }
 
        .ui-ctxpopup-row .ui-triangle-bottom {
-               bottom: 1px;
+               bottom: 2px;
        }
 
        .ui-ctxpopup-row {
@@ -86,8 +86,8 @@
                                height: inherit;
                                width: inherit;
                                margin: 0;
-                               background-size: inherit;
                                background-position: center;
+                               .LESSbackground-size( 64 * @unit_base, 64 * @unit_base );
                        }
                }
 
index 23d9c9c..c80b918 100755 (executable)
@@ -3,8 +3,8 @@
 
 /* dayselector CSS */
 .ui-dayselector label {
-    height: 56px;
-    width: 64px;
+    height: 56 * @unit_base;
+    width: 64 * @unit_base;
 }
 
 .ui-dayselector  {
                color: @color_dayselector_Btn_Sat;
                }
        }
+       .ui-dayselector-label-6.ui-checkbox-on {
+               .ui-btn-text {
+                       color: @color_dayselector_Btn_Mon_to_Fri;
+               }
+       }
        .ui-dayselector-label-0 {
                .ui-btn-text {
                    color: @color_dayselector_Btn_Sun;
index 6234cdf..9ec609d 100755 (executable)
@@ -1,12 +1,12 @@
 @import "config.less";
 
-@hsvpicker-clrchannel-masks-width: 300px;
-@hsvpicker-clrchannel-masks-height: 38px;
-@hsvpicker-clrchannel-selector-width: 10px;
-@hsvpicker-clrchannel-selector-height: 50px;
-@hsvpicker-clrchannel-selector-border-width: 5px;
-@hsvpicker-clrchannel-masks-container-hpadding: 12px;
-@hsvpicker-clrchannel-masks-container-vpadding: 16px;
+@hsvpicker-clrchannel-masks-width: 300 * @unit_base;
+@hsvpicker-clrchannel-masks-height: 38 * @unit_base;
+@hsvpicker-clrchannel-selector-width: 10 * @unit_base;
+@hsvpicker-clrchannel-selector-height: 50 * @unit_base;
+@hsvpicker-clrchannel-selector-border-width: 5 * @unit_base;
+@hsvpicker-clrchannel-masks-container-hpadding: 12 * @unit_base;
+@hsvpicker-clrchannel-masks-container-vpadding: 16 * @unit_base;
 
 @hsvpicker-clrchannel-selector-actual-height: @hsvpicker-clrchannel-selector-height -
     2 * @hsvpicker-clrchannel-selector-border-width;
@@ -29,8 +29,8 @@
 .ui-hsvpicker {
     .hsvpicker-clrchannel-container {
         display: table;
-        padding-left: 27px;
-        padding-right: 27px;
+        padding-left: 27 * @unit_base;
+        padding-right: 27 * @unit_base;
 
         .hsvpicker-arrow-btn-container {
             display: table-cell;
@@ -73,8 +73,8 @@
 
             .hsvpicker-clrchannel-selector {
                 position: absolute;
-                left: 0px;
-                top: 0px;
+                left: 0 * @unit_base;
+                top: 0 * @unit_base;
                 width: @hsvpicker-clrchannel-selector-width;
                 height: @hsvpicker-clrchannel-selector-actual-height;
                 border: @hsvpicker-clrchannel-selector-border-width solid black;
index 3479b69..583c0e2 100644 (file)
@@ -2,13 +2,13 @@
  * Common definition for theme
  */
 
-@font_size_default: 32px;      // Default unit font size
-//@rem_base: (1rem/@font_size_default);
+@font_size_default: 36px;      // Default unit font size. DO NOT USE THIS VALUE IN WIDGET CSS!
+@rem_base: (1rem/@font_size_default);
 
 @em_base: 1em/@font_size_default;      // WARNING: Don't use em unit!  This value is to be removed.
 @px_base: 1px;
 
-@unit_base: @px_base;
+@unit_base: @rem_base;
 
 @font_family: Helvetica, Arial, sans-serif;
 
diff --git a/src/themes/tizen/common/jquery.mobile.tizen.multibuttonentry.less b/src/themes/tizen/common/jquery.mobile.tizen.multibuttonentry.less
new file mode 100755 (executable)
index 0000000..303189b
--- /dev/null
@@ -0,0 +1,88 @@
+@import "config.less";\r
+\r
+.ui-multibuttonentry {\r
+       display : table;\r
+       background-color : #DDDDDD;\r
+       outline : none;\r
+}\r
+\r
+.ui-multibuttonentry .ui-multibuttonentry-label {\r
+       display : inline-block;\r
+       text-align : center;\r
+       position : relative;\r
+       margin : .3em;\r
+       padding : .2em .5em;\r
+       color : #222222;\r
+       font-weight : bold;\r
+       text-align : center;\r
+       font-size : 1em;\r
+       background-color : #DDDDDD;\r
+}\r
+\r
+.ui-multibuttonentry-input {\r
+       display : inline-block;\r
+       outline : none;\r
+       position : relative;\r
+       border : 0 !important;\r
+       padding : 0 !important;\r
+       margin : .5em;\r
+       color : #222222;\r
+       text-align : left;\r
+       font-size : 1em;\r
+       background-color : #DDDDDD;\r
+}\r
+\r
+.ui-multibuttonentry div, .ui-multibuttonentry a {\r
+       display : inline-block;\r
+       text-align : center;\r
+       cursor : pointer;\r
+       position : relative;\r
+       margin : .3em;\r
+       padding : .2em .5em;\r
+       font-size : 1em;\r
+       text-shadow : 0 .1em .1em rgba(0,0,0,.3);\r
+       -webkit-border-radius : .5em;\r
+       -moz-border-radius : .5em;\r
+       border-radius : .5em;\r
+       -webkit-box-shadow : 0 .1em .1em rgba(0,0,0,.2);\r
+       -moz-box-shadow : 0 .1em .1em rgba(0,0,0,.2);\r
+       box-shadow : 0 .1em .1em rgba(0,0,0,.2);\r
+       color : #fef4e9;\r
+}\r
+\r
+a.ui-multibuttonentry-link {\r
+       float : right;\r
+       color : #ffffff !important;\r
+       font-size : 1em;\r
+       font-weight : bold;\r
+       text-decoration : none;\r
+       border : solid 1px #696969;\r
+       background : #a9a9a9;\r
+       background : -webkit-gradient(linear, left top, left bottom, from(#a9a9a9), to(#696969));\r
+       background : -moz-linear-gradient(top,  #a9a9a9,  #696969);\r
+}\r
+\r
+div.ui-multibuttonentry-block {\r
+       border : solid 1px #da7c0c;\r
+       background : #f78d1d;\r
+       background : -webkit-gradient(linear, left top, left bottom, from(#faa51a), to(#f47a20));\r
+       background : -moz-linear-gradient(top,  #faa51a,  #f47a20);\r
+}\r
+\r
+div.ui-multibuttonentry-sblock {\r
+       border : solid 1px #0033FF;\r
+       background : #0099FF;\r
+       background : -webkit-gradient(linear, left top, left bottom, from(#00FFFF), to(#0099FF));\r
+       background : -moz-linear-gradient(top,  #00FFFF,  #0099FF);\r
+}\r
+\r
+.ui-multibuttonentry .ui-multibuttonentry-desclabel {\r
+       display : inline-block;\r
+       outline : none;\r
+       position : relative;\r
+       border : 0;\r
+       color : #222222;\r
+       text-align : left;\r
+       font-size : 1em;\r
+       background-color : #DDDDDD;\r
+}\r
diff --git a/src/themes/tizen/common/jquery.mobile.tizen.multimediaview.less b/src/themes/tizen/common/jquery.mobile.tizen.multimediaview.less
new file mode 100755 (executable)
index 0000000..95a130c
--- /dev/null
@@ -0,0 +1,197 @@
+@import "config.less";\r
+\r
+.ui-multimediaview {\r
+       background-color : @color_multimediaview_bg;\r
+       overflow : hidden;\r
+}\r
+\r
+.ui-multimediaview-wrap {\r
+       width : 100%;\r
+       margin : 0;\r
+       padding : 0;\r
+       border : 0;\r
+}\r
+\r
+.ui-multimediaview-fullscreen {\r
+       position : absolute !important;\r
+       z-index : @z_base_header_footer  + 100 !important;\r
+}\r
+\r
+.ui-multimediaview-audio {\r
+       background-color : @color_multimediaview_bg !important;\r
+}\r
+\r
+.ui-multimediaview-control span {\r
+       display : inline-block;\r
+}\r
+\r
+.ui-multimediaview-control span.ui-play-icon {\r
+       background-image : url("./images/controlbar/01_controlbar_icon_Play.png");\r
+}\r
+\r
+.ui-multimediaview-control span.ui-pause-icon {\r
+       background-image : url("./images/controlbar/01_controlbar_icon_pause.png");\r
+}\r
+\r
+.ui-multimediaview-control span.ui-stop-icon {\r
+       background-image : url(./images/stop.png);\r
+}\r
+\r
+.ui-multimediaview-control span.ui-ff-icon {\r
+       background : url(./images/controlbar/01_controlbar_icon_FF.png);\r
+}\r
+\r
+.ui-multimediaview-control span.ui-rew-icon {\r
+       background-image : url(./images/controlbar/01_controlbar_icon_REW.png);\r
+}\r
+\r
+.ui-multimediaview-control span.ui-volume-icon {\r
+       background-image : url(./images/Volume/00_volume_icon.png);\r
+}\r
+\r
+.ui-multimediaview-control span.ui-mute-icon {\r
+       background-image : url(./images/Volume/00_volume_icon_Mute.png);\r
+}\r
+\r
+.ui-multimediaview-control span.ui-fullscreen-on {\r
+       background-image : url(./images/00_button_fullscreen_on.png);\r
+}\r
+\r
+.ui-multimediaview-control span.ui-fullscreen-off {\r
+       background-image : url(./images/00_button_fullscreen_off.png);\r
+}\r
+\r
+.ui-multimediaview-control {\r
+       position : absolute;\r
+       display : block;\r
+       z-index : @z_base_header_footer  + 101 !important;\r
+       padding : 0;\r
+       margin : 0;\r
+       outline : 0;\r
+       border : 0;\r
+       background-color : @color_multimediaview_control_bg;\r
+       height : 84 * @unit_base;\r
+}\r
+\r
+.ui-multimediaview-control span.ui-button {\r
+       background-position : center center;\r
+       background-size : 80%;\r
+       background-repeat : no-repeat;\r
+       width : 74 * @unit_base;\r
+       height : 74 * @unit_base;\r
+       -webkit-border-radius : 6 * @unit_base;\r
+       -moz-border-radius : 6 * @unit_base;\r
+       border-radius : 6 * @unit_base;\r
+       background-color : @color_multimediaview_button_bg;\r
+       margin : 4 * @unit_base;\r
+}\r
+\r
+.ui-multimediaview-control .ui-playpausebutton {\r
+       background-color : transparent !important;\r
+       float : left;\r
+}\r
+\r
+.ui-multimediaview-control .ui-timestamplabel {\r
+       text-align : center;\r
+       color : @color_multimediaview_timestamp_text;\r
+       float : left;\r
+}\r
+\r
+.ui-multimediaview-control .ui-timestamplabel p {\r
+       margin : 0;\r
+       text-align : center;\r
+       font-size : 22 * @unit_base;\r
+       line-height : 28 * @unit_base;\r
+       text-align : left;\r
+}\r
+\r
+.ui-multimediaview-control .ui-durationlabel {\r
+       text-align : center;\r
+       color : @color_multimediaview_duration_text;\r
+       float : right;\r
+}\r
+\r
+.ui-multimediaview-control .ui-durationlabel p {\r
+       margin : 0 * @unit_base;\r
+       text-align : center;\r
+       font-size : 22 * @unit_base;\r
+       line-height : 28 * @unit_base;\r
+       text-align : right;\r
+}\r
+\r
+.ui-multimediaview-control .ui-seekbar {\r
+       margin-top : 20 * @unit_base;\r
+       padding-left : 4 * @unit_base;\r
+       padding-right : 4 * @unit_base;\r
+       height : 16 * @unit_base;\r
+       float : left;\r
+}\r
+\r
+.ui-multimediaview-control .ui-seekbar .ui-duration {\r
+       margin : 0;\r
+       padding : 0;\r
+       width : 100%;\r
+       height : 16 * @unit_base;\r
+       background-color : @color_multimediaview_bar_gray;\r
+       -webkit-border-radius : 3 * @unit_base;\r
+       -moz-border-radius : 3 * @unit_base;\r
+       border-radius : 3 * @unit_base;\r
+}\r
+\r
+.ui-multimediaview-control .ui-seekbar .ui-currenttime {\r
+       margin : 0;\r
+       padding : 0;\r
+       height : 16 * @unit_base;\r
+       position : absolute;\r
+       background-color : @color_multimediaview_bar_active;\r
+       -webkit-border-radius : 3 * @unit_base;\r
+       -moz-border-radius : 3 * @unit_base;\r
+       border-radius : 3 * @unit_base;\r
+}\r
+\r
+.ui-multimediaview-control .ui-volumecontrol {\r
+       width : 220 * @unit_base;\r
+       height : 100%;\r
+       float : left;\r
+}\r
+\r
+.ui-multimediaview-control .ui-volumecontrol .ui-volumebar {\r
+       height : 100%;\r
+       padding-top : 33 * @unit_base;\r
+       padding-left : 40 * @unit_base;\r
+       display : block;\r
+}\r
+\r
+.ui-multimediaview-control .ui-volumecontrol .ui-volumebar .ui-guide {\r
+       width : 160 * @unit_base;\r
+       height : 16 * @unit_base;\r
+       position : absolute;\r
+       background-color : white;\r
+       -webkit-border-radius : 3 * @unit_base;\r
+       -moz-border-radius : 3 * @unit_base;\r
+       border-radius : 3 * @unit_base;\r
+       background-color : @color_multimediaview_bar_gray;\r
+}\r
+\r
+.ui-multimediaview-control .ui-volumecontrol .ui-volumebar .ui-value {\r
+       margin : 0;\r
+       padding : 0;\r
+       height : 16 * @unit_base;\r
+       position : absolute;\r
+       -webkit-border-radius : 3 * @unit_base;\r
+       -moz-border-radius : 3 * @unit_base;\r
+       border-radius : 3 * @unit_base;\r
+       background-color : @color_multimediaview_bar_active;\r
+}\r
+\r
+.ui-multimediaview-control .ui-volumecontrol .ui-volumebar .ui-handler {\r
+       margin : 0;\r
+       padding : 0;\r
+       width : 30 * @unit_base;\r
+       height : 30 * @unit_base;\r
+       position : absolute;\r
+       -webkit-border-radius : 5 * @unit_base;\r
+       -moz-border-radius : 5 * @unit_base;\r
+       border-radius : 5 * @unit_base;\r
+       background-color : @color_multimediaview_bar_handle;\r
+}
\ No newline at end of file
index c19fa67..6312b8e 100644 (file)
@@ -1,10 +1,13 @@
 @import "config.less";
 
+@img-width: 314 * @unit_base;
+@img-height: 310 * @unit_base;
+
 .ui-nocontents {
        position: relative;
        left: 0;
        width: 100%;
-       height: 508px;
+       height: 508 * @unit_base;
 }
 
 .ui-nocontents-icon-text,
 .ui-nocontents-icon-unnamed {
        position: absolute;
        display: block;
-       width: 314px;
-       height: 310px;
+       width: @img-width;
+       height: @img-height;
        
        background: url(images/00_Nocontents_text.png) no-repeat;
+       .LESSbackground-size(@img-height, @img-width);
 }
 
 .ui-nocontents-icon-picture {
        background: url(images/00_Nocontents_picture.png) no-repeat;
+       .LESSbackground-size(@img-height, @img-width);
 }
 
 .ui-nocontents-icon-multimedia {
        background: url(images/00_Nocontents_multimedia.png) no-repeat;
+       .LESSbackground-size(@img-height, @img-width);
 }
 
 .ui-nocontents-icon-unnamed {
        background: url(images/00_Nocontents_unnamed.png) no-repeat;
+       .LESSbackground-size(@img-height, @img-width);
 }
 
 .ui-nocontents-text {
        position: absolute;
-       height: 46px;
+       height: 46 * @unit_base;
        width: 100%;
        text-align: center;
        color: @color_nocontents_text;
index fc0b2da..1e09d15 100644 (file)
@@ -2,7 +2,7 @@
 
 /* tickernoti */
 
-@ticker-height: 100px;
+@ticker-height: 100 * @unit_base;
 
 @-webkit-keyframes ui-ticker-show {
        from {
@@ -45,7 +45,7 @@
 .ui-ticker.show {
        display: block;
        -webkit-animation: ui-ticker-show 0.8s 1 ease;
-       top: 0px;
+       top: 0;
 }
 
 .ui-ticker.hide {
 
 .ui-ticker-btn {
        position: relative;
-       height: 54px;
-       margin-top: 23px;
-       margin-left: 16px;
-       margin-right: 16px;
+       height: 54 * @unit_base;
+       margin-top: 23 * @unit_base;
+       margin-left: 16 * @unit_base;
+       margin-right: 16 * @unit_base;
        vertical-align: middle;
        float: right;
 
 .ui-ticker-icon {
        position: absolute;
        top: 0;
-       height: 64px;
-       width: 64px;
-       margin-top: 18px;
-       margin-bottom: 18px;
-       margin-left: 16px;
-       margin-right: 16px;
+       height: 64 * @unit_base;
+       width: 64 * @unit_base;
+       margin-top: 18 * @unit_base;
+       margin-bottom: 18 * @unit_base;
+       margin-left: 16 * @unit_base;
+       margin-right: 16 * @unit_base;
        vertical-align: middle;
 
        /* FIXME: please fix this image file */
        background: url(images/00_button_call.png) no-repeat;
+       .LESSbackground-size(64 * @unit_base, 64 * @unit_base);
 }
 
 .ui-ticker-text1-bg {
        position: absolute;
        top: 0;
-       height: 28px;
-       left: 96px;
-       margin-top: 20px;
+       height: 28 * @unit_base;
+       left: 96 * @unit_base;
+       margin-top: 20 * @unit_base;
        font-size: 0.8em;
        color: @color_ticker_text1;
 }
 .ui-ticker-text2-bg {
        position: absolute;
        top: 0;
-       height: 32px;
-       left: 96px;
-       margin-top: 48px;
+       height: 32 * @unit_base;
+       left: 96 * @unit_base;
+       margin-top: 48 * @unit_base;
        color: @color_ticker_text2;
 }
 
 /* smallpopup */
 
-@smallpopup-height: 48px;
+@smallpopup-height: 48 * @unit_base;
 
 @-webkit-keyframes ui-smallpopup-show {
        from {
 
 .ui-smallpopup-text-bg {
        position: relative;
-       margin-top: 6px;
-       margin-left: 16px;
+       margin-top: 6 * @unit_base;
+       margin-left: 16 * @unit_base;
        color: @color_smallpopup_text;
 }
index 2993d0d..ff89777 100755 (executable)
@@ -7,7 +7,7 @@
 }
 
 .ui-option-header-1-row {
-    height: 106px;
+    height: 106 * @unit_base;
     border: none;
 }
 .ui-option-header-2-row {
@@ -21,7 +21,7 @@
 .ui-option-header-row-2 {
     height: 196 * @unit_base;
     margin-top: -2px;
-    padding: 0px 5px 6px 5px;
+    padding: 0 * @unit_base 5 * @unit_base 6 * @unit_base 5 * @unit_base;
     
     div {
            margin-top: 5 * @unit_base;
@@ -31,7 +31,7 @@
 
 .ui-option-header .ui-btn {
     display: block;
-    margin: 3px 5px 5px 5px;
+    margin: 3 * @unit_base 5 * @unit_base 5 * @unit_base 5 * @unit_base;
 }
 
 .ui-option-header .ui-input-search .ui-btn {
@@ -39,7 +39,7 @@
 }      
        
 .ui-option-header .ui-btn-text {
-    line-height: 34px;
+    line-height: 34 * @unit_base
 }
 .ui-option-header {
        .ui-btn-down-s.ui-btn-hover-s .ui-btn-inner,
 
 .ui-option-header .ui-controlgroup-horizontal .ui-btn {
     display: inline-block !important;
-    margin: -3px !important;
+    margin: -3 * @unit_base !important;
 }
 .ui-option-header .ui-controlgroup,
 .ui-option-header fieldset.ui-controlgroup {
     margin-bottom: 0px !important;
 }
 .ui-option-header .ui-controlgroup-horizontal .ui-corner-left {
-    margin-left: 5px !important;
+    margin-left: 5 * @unit_base !important;
 }
 .ui-option-header .ui-controlgroup-horizontal .ui-corner-right {
-    margin-right: 5px !important;
+    margin-right: 5 * @unit_base !important;
 }
 
 .ui-option-header-triangle-arrow {
-  top:-10px;
-  height:10px;
+  top:-10 * @unit_base;
+  height:10 * @unit_base;
   width:100%;
   position:relative;
-  margin-bottom: -10px;
+  margin-bottom: -10 * @unit_base;
 }
 
 .ui-header.ui-option-header-resizing {
 */
 .ui-triangle-image{
        background-image: url(images/00_winset_control_top_arrow.png); 
+       background-size:  100% 100%;
 
        position : absolute;
        width: 28 * @unit_base;
        
 }
 
-.ui-icon-optiontray    {       background-image: url(images/00_winset_btn_optiontray.png);}
+.ui-icon-optiontray    {       
+       background-size:  100% 100%;
+       background-image: url(images/00_winset_btn_optiontray.png);
+}
 
 .ui-header {
        .ui-btn{        
index b6b51f8..321b855 100644 (file)
@@ -1,5 +1,8 @@
 @import "config.less";
 
+@popupwindow-text-padding-vert: 22 * @unit_base;
+@popupwindow-text-padding-hori: 16 * @unit_base;
+
 .ui-popupwindow-screen {
     background: #000000;
     opacity: 0;
@@ -18,7 +21,7 @@
        background: #536771; //recheck color and change it to var
        color: white; //recheck color and change it to var
 
-       padding: 2px 2px;
+       padding: 2*@unit_base 2*@unit_base;
 
        .center_info {
 
@@ -33,7 +36,7 @@
                        width: 100%;
                        p {
                                text-align: center;
-                               padding: 22px 16px;
+                               padding: @popupwindow-text-padding-vert @popupwindow-text-padding-hori;
                        }
                }
        }
 
                .popup-title {
                        font-size: @font_size_popup_basic_style_title;
-                       height: 64px;
+                       height: 64*@unit_base;
                        p { 
-                               margin: 0px 0px;
-                               padding: 13px 0px;
+                               margin: 0*@unit_base 0*@unit_base;
+                               padding: 13*@unit_base 0*@unit_base;
                        }
                }
                .popup-text {
@@ -61,7 +64,7 @@
                        width: 100%;
                        p {
                                text-align: center;
-                               padding: 22px 16px;
+                               padding: @popupwindow-text-padding-vert @popupwindow-text-padding-hori;
                        }
                }
        }
@@ -81,7 +84,7 @@
                        width: 100%;
                        p {
                                text-align: center;
-                               padding: 22px 16px;
+                               padding: @popupwindow-text-padding-vert @popupwindow-text-padding-hori;
                        }
                }
 
                        font-size: @font_size_popup_button_text;
                        background: @color_popup_button_background;
                        width: 100%;
-                       padding-top: 11px;
-                       padding-bottom: 11px;
+                       padding-top: 11*@unit_base;
+                       padding-bottom: 11*@unit_base;
                        vertical-align: middle;
                        
                        .ui-btn {
-                               width: 402px;
-                               height: 74px;
+                               width: 402*@unit_base;
+                               height: 74*@unit_base;
                                margin:auto;
 
                        }
                        width: 100%;
                        p {
                                text-align: center;
-                               padding: 22px 16px;
+                               padding: @popupwindow-text-padding-vert @popupwindow-text-padding-hori;
                        }
                }
 
                        font-size: @font_size_popup_button_text;
                        background: @color_popup_button_background;
                        width: 100%;
-                       padding-top: 11px;
-                       padding-bottom: 11px;
+                       padding-top: 11*@unit_base;
+                       padding-bottom: 11*@unit_base;
                        vertical-align: middle;
                        
                        .ui-btn {
-                               width: 274px;
-                               height: 74px;
-                               margin-top: 0px;
-                               margin-bottom: 0px;
-                               margin-left: 5px;
-                               margin-right: 5px;
+                               width: 274*@unit_base;
+                               height: 74*@unit_base;
+                               margin-top: 0*@unit_base;
+                               margin-bottom: 0*@unit_base;
+                               margin-left: 5*@unit_base;
+                               margin-right: 5*@unit_base;
 
                                display: inline-block;
                        }
                        width: 100%;
                        p {
                                text-align: center;
-                               padding: 22px 16px;
+                               padding: @popupwindow-text-padding-vert @popupwindow-text-padding-hori;
                        }
                }
 
                        font-size: @font_size_popup_button_text;
                        background: @color_popup_button_background;
                        width: 100%;
-                       padding-top: 11px;
-                       padding-bottom: 11px;
+                       padding-top: 11*@unit_base;
+                       padding-bottom: 11*@unit_base;
                        vertical-align: middle;
 
                        .ui-btn {
-                               width: 186px;
-                               height: 74px;
-                               margin-top: 0px;
-                               margin-bottom: 0px;
-                               margin-left: 5px;
-                               margin-right: 5px;
+                               width: 186*@unit_base;
+                               height: 74*@unit_base;
+                               margin-top: 0*@unit_base;
+                               margin-bottom: 0*@unit_base;
+                               margin-left: 5*@unit_base;
+                               margin-right: 5*@unit_base;
 
                                display: inline-block;
                        }
 
                .popup-title {
                        font-size: @font_size_popup_basic_style_title;
-                       height: 64px;
+                       height: 64*@unit_base;
                        p { 
-                               margin: 0px 0px;
-                               padding: 13px 0px;
+                               margin: 0*@unit_base 0*@unit_base;
+                               padding: 13*@unit_base 0*@unit_base;
                        }
                }
                .popup-text {
                        width: 100%;
                        p {
                                text-align: center;
-                               padding: 22px 16px;
+                               padding: @popupwindow-text-padding-vert @popupwindow-text-padding-hori;
                        }
                }
 
                        font-size: @font_size_popup_button_text;
                        background: @color_popup_button_background;
                        width: 100%;
-                       padding-top: 11px;
-                       padding-bottom: 11px;
+                       padding-top: 11*@unit_base;
+                       padding-bottom: 11*@unit_base;
                        vertical-align: middle;
                        
                        .ui-btn {
-                               width: 402px;
-                               height: 74px;
+                               width: 402*@unit_base;
+                               height: 74*@unit_base;
                                margin:auto;
 
                        }
 
                .popup-title {
                        font-size: @font_size_popup_basic_style_title;
-                       height: 64px;
+                       height: 64*@unit_base;
                        p { 
-                               margin: 0px 0px;
-                               padding: 13px 0px;
+                               margin: 0*@unit_base 0*@unit_base;
+                               padding: 13*@unit_base 0*@unit_base;
                        }
                }
                .popup-text {
                        width: 100%;
                        p {
                                text-align: center;
-                               padding: 22px 16px;
+                               padding: @popupwindow-text-padding-vert @popupwindow-text-padding-hori;
                        }
                }
 
                        font-size: @font_size_popup_button_text;
                        background: @color_popup_button_background;
                        width: 100%;
-                       padding-top: 11px;
-                       padding-bottom: 11px;
+                       padding-top: 11*@unit_base;
+                       padding-bottom: 11*@unit_base;
                        vertical-align: middle;
                        
                        .ui-btn {
-                               width: 274px;
-                               height: 74px;
-                               margin-top: 0px;
-                               margin-bottom: 0px;
-                               margin-left: 5px;
-                               margin-right: 5px;
+                               width: 274*@unit_base;
+                               height: 74*@unit_base;
+                               margin-top: 0*@unit_base;
+                               margin-bottom: 0*@unit_base;
+                               margin-left: 5*@unit_base;
+                               margin-right: 5*@unit_base;
 
                                display: inline-block;
                        }
 
                .popup-title {
                        font-size: @font_size_popup_basic_style_title;
-                       height: 64px;
+                       height: 64*@unit_base;
                        p { 
-                               margin: 0px 0px;
-                               padding: 13px 0px;
+                               margin: 0*@unit_base 0*@unit_base;
+                               padding: 13*@unit_base 0*@unit_base;
                        }
                }
                .popup-text {
                        width: 100%;
                        p {
                                text-align: center;
-                               padding: 22px 16px;
+                               padding: @popupwindow-text-padding-vert @popupwindow-text-padding-hori;
                        }
                }
 
                        font-size: @font_size_popup_button_text;
                        background: @color_popup_button_background;
                        width: 100%;
-                       padding-top: 11px;
-                       padding-bottom: 11px;
+                       padding-top: 11*@unit_base;
+                       padding-bottom: 11*@unit_base;
                        vertical-align: middle;
 
                        .ui-btn {
-                               width: 186px;
-                               height: 74px;
-                               margin-top: 0px;
-                               margin-bottom: 0px;
-                               margin-left: 5px;
-                               margin-right: 5px;
+                               width: 186*@unit_base;
+                               height: 74*@unit_base;
+                               margin-top: 0*@unit_base;
+                               margin-bottom: 0*@unit_base;
+                               margin-left: 5*@unit_base;
+                               margin-right: 5*@unit_base;
 
                                display: inline-block;
                        }
                        width: 100%;
                        p {
                                text-align: center;
-                               padding: 22px 16px;
+                               padding: @popupwindow-text-padding-vert @popupwindow-text-padding-hori;
                        }
                }
 
                        font-size: @font_size_popup_button_text;
                        background: @color_popup_button_background;
                        width: 100%;
-                       padding-top: 1px; //TODO
-                       padding-bottom: 16px;
+                       padding-top: 1px;
+                       padding-bottom: 16*@unit_base;
                        vertical-align: middle;
                        
                        .ui-btn {
-                               width: 356px;
-                               height: 74px;
-                               margin-top: 16px;
-                               margin-bottom: 0px;
+                               width: 356*@unit_base;
+                               height: 74*@unit_base;
+                               margin-top: 16*@unit_base;
+                               margin-bottom: 0*@unit_base;
                                margin-left: auto;
                                margin-right: auto;
                        }
                        width: 100%;
                        p {
                                text-align: center;
-                               padding: 22px 16px;
+                               padding: @popupwindow-text-padding-vert @popupwindow-text-padding-hori;
                        }
                }
 
                        font-size: @font_size_popup_info_style;
                        background: @color_popup_text_background;
                        width: 100%;
-                       padding-top: 0px;
-                       padding-bottom: 22px;
+                       padding-top: 0*@unit_base;
+                       padding-bottom: 22*@unit_base;
                        vertical-align: middle;
 
                        .ui-checkbox {
                                .ui-btn {
                                        text-align: center;
                                        background: @color_popup_text_background;
-                                       border: 0px;
+                                       border: 0*@unit_base;
 
                                        .ui-btn-inner {
-                                               border: 0px;
+                                               border: 0*@unit_base;
                                        }
                                }
                        }
                        font-size: @font_size_popup_button_text;
                        background: @color_popup_button_background;
                        width: 100%;
-                       padding-top: 11px;
-                       padding-bottom: 11px;
+                       padding-top: 11*@unit_base;
+                       padding-bottom: 11*@unit_base;
                        vertical-align: middle;
                        
                        .ui-btn {
-                               width: 274px;
-                               height: 74px;
-                               margin-top: 0px;
-                               margin-bottom: 0px;
-                               margin-left: 5px;
-                               margin-right: 5px;
+                               width: 274*@unit_base;
+                               height: 74*@unit_base;
+                               margin-top: 0*@unit_base;
+                               margin-bottom: 0*@unit_base;
+                               margin-left: 5*@unit_base;
+                               margin-right: 5*@unit_base;
 
                                display: inline-block;
                        }
 
                .popup-title {
                        font-size: @font_size_popup_basic_style_title;
-                       height: 64px;
+                       height: 64*@unit_base;
                        p { 
-                               margin: 0px 0px;
-                               padding: 13px 0px;
+                               margin: 0*@unit_base 0*@unit_base;
+                               padding: 13*@unit_base 0*@unit_base;
                        }
                }
                .popup-scroller-bg {
                        background: black;
 
                        .ui-listview {
-                               height: 512px;
+                               height: 512*@unit_base;
                        }
                }
                .popup-button-bg {
                        font-size: @font_size_popup_button_text;
                        background: @color_popup_button_background;
                        width: 100%;
-                       padding-top: 11px;
-                       padding-bottom: 11px;
+                       padding-top: 11*@unit_base;
+                       padding-bottom: 11*@unit_base;
                        vertical-align: middle;
                        
                        .ui-btn {
-                               width: 402px;
-                               height: 74px;
+                               width: 402*@unit_base;
+                               height: 74*@unit_base;
                                margin:auto;
 
                        }
 
                .popup-title {
                        font-size: @font_size_popup_basic_style_title;
-                       height: 64px;
+                       height: 64*@unit_base;
                        p { 
-                               margin: 0px 0px;
-                               padding: 13px 0px;
+                               margin: 0*@unit_base 0*@unit_base;
+                               padding: 13*@unit_base 0*@unit_base;
                        }
                }
                .popup-scroller-bg {
                        background: black;
 
                        .ui-listview {
-                               height: 512px;
+                               height: 512*@unit_base;
                        }
                }
                .popup-button-bg {
                        font-size: @font_size_popup_button_text;
                        background: @color_popup_button_background;
                        width: 100%;
-                       padding-top: 11px;
-                       padding-bottom: 11px;
+                       padding-top: 11*@unit_base;
+                       padding-bottom: 11*@unit_base;
                        vertical-align: middle;
                        
                        .ui-btn {
-                               width: 274px;
-                               height: 74px;
-                               margin-top: 0px;
-                               margin-bottom: 0px;
-                               margin-left: 5px;
-                               margin-right: 5px;
+                               width: 274*@unit_base;
+                               height: 74*@unit_base;
+                               margin-top: 0*@unit_base;
+                               margin-bottom: 0*@unit_base;
+                               margin-left: 5*@unit_base;
+                               margin-right: 5*@unit_base;
 
                                display: inline-block;
                        }
 
                .popup-title {
                        font-size: @font_size_popup_basic_style_title;
-                       height: 64px;
+                       height: 64*@unit_base;
                        p { 
-                               margin: 0px 0px;
-                               padding: 13px 0px;
+                               margin: 0*@unit_base 0*@unit_base;
+                               padding: 13*@unit_base 0*@unit_base;
                        }
                }
                .popup-scroller-bg {
                        background: black;
 
                        .ui-listview {
-                               height: 512px;
+                               height: 512*@unit_base;
                        }
                }
                .popup-button-bg {
                        font-size: @font_size_popup_button_text;
                        background: @color_popup_button_background;
                        width: 100%;
-                       padding-top: 11px;
-                       padding-bottom: 11px;
+                       padding-top: 11*@unit_base;
+                       padding-bottom: 11*@unit_base;
                        vertical-align: middle;
                        
                        .ui-btn {
-                               width: 186px;
-                               height: 74px;
-                               margin-top: 0px;
-                               margin-bottom: 0px;
-                               margin-left: 5px;
-                               margin-right: 5px;
+                               width: 186*@unit_base;
+                               height: 74*@unit_base;
+                               margin-top: 0*@unit_base;
+                               margin-bottom: 0*@unit_base;
+                               margin-left: 5*@unit_base;
+                               margin-right: 5*@unit_base;
 
                                display: inline-block;
                        }
                        font-color: @color_popup_center_progressbar_title;
                        background: @color_popup_text_background;
                        width: 100%;
-                       height: 70px;
+                       height: 70*@unit_base;
                        p {
                                height: 100%;
                                text-align: center;
-                               padding: 22px 16px 0px 16px;
+                               padding: 22*@unit_base 16*@unit_base 0*@unit_base 16*@unit_base;
                        }
                }
 
 
                        .text-left {
                                width: 40%;
-                               height: 48px;
-                               padding: 0px 16px 0px 16px;
+                               height: 48*@unit_base;
+                               padding: 0*@unit_base 16*@unit_base 0*@unit_base 16*@unit_base;
                                text-align: left;
                
                                display: inline-block;
                        }
                        .text-right {
                                width: 40%;
-                               height: 48px;
-                               padding: 0px 16px 0px 16px;
+                               height: 48*@unit_base;
+                               padding: 0*@unit_base 16*@unit_base 0*@unit_base 16*@unit_base;
                                text-align: right;
 
                                display: inline-block;
                        font-size: @font_size_popup_button_text;
                        background: @color_popup_button_background;
                        width: 100%;
-                       padding-top: 11px;
-                       padding-bottom: 11px;
+                       padding-top: 11*@unit_base;
+                       padding-bottom: 11*@unit_base;
                        vertical-align: middle;
                        
                        .ui-btn {
-                               width: 402px;
-                               height: 74px;
+                               width: 402*@unit_base;
+                               height: 74*@unit_base;
                                margin:auto;
 
                        }
                        font-color: @color_popup_center_progressbar_title;
                        background: @color_popup_text_background;
                        width: 100%;
-                       padding-top: 22px;
-                       padding-bottom: 16px;
+                       padding-top: 22*@unit_base;
+                       padding-bottom: 16*@unit_base;
                        p {
                                text-align: center;
                        }
 
                        .text-left {
                                width: 40%;
-                               height: 40px;
-                               padding: 16px 16px 22px 16px;
+                               height: 40*@unit_base;
+                               padding: 16*@unit_base 16*@unit_base 22*@unit_base 16*@unit_base;
                                text-align: left;
                
                                display: inline-block;
                        }
                        .text-right {
                                width: 40%;
-                               height: 40px;
-                               padding: 16px 16px 22px 16px;
+                               height: 40*@unit_base;
+                               padding: 16*@unit_base 16*@unit_base 22*@unit_base 16*@unit_base;
                                text-align: right;
 
                                display: inline-block;
                        font-size: @font_size_popup_button_text;
                        background: @color_popup_button_background;
                        width: 100%;
-                       padding-top: 11px;
-                       padding-bottom: 11px;
+                       padding-top: 11*@unit_base;
+                       padding-bottom: 11*@unit_base;
                        vertical-align: middle;
                        
                        .ui-btn {
-                               width: 402px;
-                               height: 74px;
+                               width: 402*@unit_base;
+                               height: 74*@unit_base;
                                margin:auto;
 
                        }
        display: table;
        margin: auto;
        background: rgba(0, 0, 0, 0.666667);
-       width: 416px;
-       height: 676px;
-       padding-top: 22px;
+       width: 416*@unit_base;
+       height: 676*@unit_base;
+       padding-top: 22*@unit_base;
 
        h1 {
                font-size: @font_size_popup_info_style;
        .ui-volumecontrol-icon {
                display: table;
                width: 100%;
-               height: 128px;
-               padding-top: 21px;
-               padding-bottom: 21px;
-               padding-left: 165px;
-               padding-right: 165px;
+               height: 128*@unit_base;
+               padding-top: 21*@unit_base;
+               padding-bottom: 21*@unit_base;
+               padding-left: 165*@unit_base;
+               padding-right: 165*@unit_base;
        }
 
        .ui-volumecontrol-indicator {
                display: table;
                width: 100%;
-               height: 420px;
-               padding-left: 68px;
-               padding-right: 68px;
+               height: 420*@unit_base;
+               padding-left: 68*@unit_base;
+               padding-right: 68*@unit_base;
        }
 
        .ui-corner-all {
index 4a975e4..e782c74 100644 (file)
@@ -1,10 +1,10 @@
 @import "config.less";
 
 /* Progress - circle style */
-@img-height: 64px;
-@img-width: 64px;
-@bar-vmargin: 16px;
-@bar-hmargin: 1px;
+@img-height: 64 * @unit_base;
+@img-width: 64 * @unit_base;
+@bar-vmargin: 16 * @unit_base;
+@bar-hmargin: 1 * @unit_base;
 
 @-webkit-keyframes ui-rotate-animation {
        from {
        position: relative;
        top: 0;
 
-       /* FIXME: image is unbalanced - expanded it forced */
-       height: @img-height + 1;
-       width: @img-width + 1;
+       height: @img-height;
+       width: @img-width;
 
        background: url(images/process/00_winset_list_process_01.png) no-repeat;
+       .LESSbackground-size(@img-height, @img-width);
 }
 .ui-progress-circle-running {
-       -webkit-animation: ui-rotate-animation 1.5s infinite linear;
+       -webkit-animation: ui-rotate-animation 1s infinite linear;
 }
 
 /* Progress - pending style */
-@bar-height: 16px;
-@bar-margin: 16px;
+@bar-height: 16 * @unit_base;
+@bar-margin: 16 * @unit_base;
 @bar-color0: rgb(55, 55, 55);
 @bar-color1: rgb(0, 140, 210);
 
@@ -98,7 +98,7 @@
 
        background-color: @bar-color0;
 
-       -webkit-background-size: @bar-height * 2 @bar-height * 2;
+       .LESSbackground-size(@bar-height * 2, @bar-height * 2);
 }
 .ui-progress-pending-running {
        -webkit-animation: ui-move-animation 0.5s infinite linear;
index b8a10ce..c8332c4 100644 (file)
@@ -1,7 +1,7 @@
 @import "config.less";
 
-@bar-height: 16px;
-@bar-margin: 16px;
+@bar-height: 16 * @unit_base;
+@bar-margin: 16 * @unit_base;
 
 @-webkit-keyframes ui-scale-animation {
        from {
diff --git a/src/themes/tizen/common/jquery.mobile.tizen.scrollview.handler.less b/src/themes/tizen/common/jquery.mobile.tizen.scrollview.handler.less
new file mode 100755 (executable)
index 0000000..eb2f793
--- /dev/null
@@ -0,0 +1,52 @@
+@import "config.less";
+
+.ui-handler {
+       position : absolute;
+       overflow : hidden;
+}
+
+.ui-handler-y {
+       top : 10 * @unit_base;
+       right : 10 * @unit_base;
+       bottom : 10 * @unit_base;
+       width : 48 * @unit_base;
+}
+
+.ui-handler-x {
+       right : 10 * @unit_base;
+       bottom : 10 * @unit_base;
+       left : 10 * @unit_base;
+       height : 48 * @unit_base;
+}
+
+.ui-handler-track {
+       position : relative;
+       width : 100%;
+       height : 100%;
+}
+
+.ui-handler-thumb {
+       position : absolute;
+       top : 0;
+       left : 0;
+       background-color : @color_scrollview_handler_bg;
+       background-position : center;
+       background-repeat : no-repeat;
+       -moz-border-radius : 5 * @unit_base;
+       -webkit-border-radius : 5 * @unit_base;
+       border-radius : 5 * @unit_base;
+}
+
+.ui-handler-y .ui-handler-thumb {
+       width : 48 * @unit_base;
+       height : 214 * @unit_base;
+       background-image : url("images/00_scroll_bar_handler.png");
+       background-size : 48 * @unit_base       40 * @unit_base;
+}
+
+.ui-handler-x .ui-handler-thumb {
+       width : 214 * @unit_base;
+       height : 48 * @unit_base;
+       background-image : url("images/00_scroll_bar_handler_hor.png");
+       background-size : 40 * @unit_base 48 * @unit_base;
+}
@@ -1,4 +1,4 @@
-@charset "utf-8";
+@import "config.less";
 
 .ui-scrollview-clip {
        position: relative;
 }
 
 .ui-scrollbar-y {
-       top: 2px;
-       right: 2px;
-       bottom: 8px;
-       width: 10px;
+       top: 2 * @unit_base;
+       right: 2 * @unit_base;
+       bottom: 2 * @unit_base;
+       width: 10 * @unit_base;
 }
 
 .ui-scrollbar-x {
-       right: 8px;
-       bottom: 2px;
-       left: 2px;
-       height: 10px;
+       right: 2 * @unit_base;
+       bottom: 2 * @unit_base;
+       left: 2 * @unit_base;
+       height: 10 * @unit_base;
 }
 
 .ui-scrollbar-track {
        position: absolute;
        top: 0;
        left: 0;
-       background-color: rgba(64, 64, 64, 0.7);
+       background-color: @color_header;
 }
 
 .ui-scrollbar-y .ui-scrollbar-thumb {
-       width: 10px;
+       width:  10 * @unit_base;
        height: 100%;
 }
 
 .ui-scrollbar-x .ui-scrollbar-thumb {
        width: 100%;
-       height: 10px;
+       height: 10 * @unit_base;
 }
 
 /*
  */
 .ui-content.ui-scrollview-clip {
        padding: 0;
-       padding-bottom: 15px;
+       padding-bottom: 16 * @unit_base;
 }
 .ui-content.ui-scrollview-clip > div.ui-scrollview-view {
        margin: 0;
-       padding: 15px;
+       padding: 16 * @unit_base;
 }
 
 /*
index 56186be..705de46 100644 (file)
@@ -1,7 +1,9 @@
 @import "config.less";
 
-@popup-size: 102px;
-@padding-size: 18px;
+@popup-size: 102 * @unit_base;
+@padding-size: 18 * @unit_base;
+@img-height: 80 * @unit_base;
+@img-width: 80 * @unit_base;
 
 label.ui-slider {
        display: block;
@@ -9,7 +11,7 @@ label.ui-slider {
 
 input.ui-slider-input {
        display: inline-block;
-       width: 50px;
+       width: 50 * @unit_base;
 }
 
 select.ui-slider-switch {
@@ -19,53 +21,57 @@ select.ui-slider-switch {
 .ui-slider-bg,
 .ui-slider-icon-bg {
        position: relative;
-       margin-left: 32px;
-       margin-right: 32px;
+       margin-left: 32 * @unit_base;
+       margin-right: 32 * @unit_base;
        margin-bottom: 0.2em;
        vertical-align: middle;
 }
 
 .ui-slider-icon-bg {
-       margin-left: 96px;
-       margin-right: 96px;
+       margin-left: 96 * @unit_base;
+       margin-right: 96 * @unit_base;
 }
 
 .ui-slider-left-volume,
 .ui-slider-left-bright {
        position: absolute;
        top: -0.2em;
-       left: -96px;
-       height: 80px;
-       width: 80px;
+       left: -96 * @unit_base;
+       height: @img-height;
+       width: @img-width;
        vertical-align: middle;
        background: url(images/00_slider_btn_brightness01.png) no-repeat;
+       .LESSbackground-size(@img-height, @img-width);
 }
 
 .ui-slider-left-volume {
        background: url(images/00_slider_btn_volume01.png) no-repeat;
+       .LESSbackground-size(@img-height, @img-width);
 }
 
 .ui-slider-right-volume,
 .ui-slider-right-bright {
        position: absolute;
        top: -0.2em;
-       right: -96px;
-       height: 80px;
-       width: 80px;
+       right: -96 * @unit_base;
+       height: @img-height;
+       width: @img-width;
        vertical-align: middle;
        background: url(images/00_slider_btn_brightness02.png) no-repeat;
+       .LESSbackground-size(@img-height, @img-width);
 }
 
 .ui-slider-right-volume {
        background: url(images/00_slider_btn_volume02.png) no-repeat;
+       .LESSbackground-size(@img-height, @img-width);
 }
 
 .ui-slider-left-text {
        position: absolute;
        top: -0.2em;
-       left: -96px;
-       height: 80px;
-       width: 80px;
+       left: -96 * @unit_base;
+       height: 80 * @unit_base;
+       width: 80 * @unit_base;
        text-align: center;
        color: rgb(100, 100, 100);
 }
@@ -73,9 +79,9 @@ select.ui-slider-switch {
 .ui-slider-right-text {
        position: absolute;
        top: -0.2em;
-       right: -96px;
-       height: 80px;
-       width: 80px;
+       right: -96 * @unit_base;
+       height: 80 * @unit_base;
+       width: 80 * @unit_base;
        text-align: center;
        color: rgb(100, 100, 100);
 }
@@ -83,7 +89,7 @@ select.ui-slider-switch {
 div.ui-slider {
        display: inline-block;
        overflow: visible;
-       height: 16px;
+       height: 16 * @unit_base;
        width: 100%;
        background-image: url(images/00_winset_list_progress_bg.png);
 
@@ -91,7 +97,7 @@ div.ui-slider {
                top: 0.15em !important;
        }
        .ui-btn-inner {
-               padding: 0.4em 0px;
+               padding: 0.4em 0 * @unit_base;
        }
        .ui-btn-text {
                color: @color_slider_handle_text;
@@ -101,13 +107,14 @@ div.ui-slider {
 a.ui-slider-handle {
        position: relative;
        z-index: 10;
-       top: -21px;
-       width: 58px;
-       height: 58px;
-       margin-top: -29px;
-       margin-left: -29px;
+       top: -21 * @unit_base;
+       width: 58 * @unit_base;
+       height: 58 * @unit_base;
+       margin-top: -29 * @unit_base;
+       margin-left: -29 * @unit_base;
        color: @color_slider_handle_text;
        background: url(images/00_slider_handle.png) no-repeat;
+       .LESSbackground-size(58 * @unit_base, 58 * @unit_base);
 }
 
 .ui-slider-popup {
@@ -119,12 +126,13 @@ a.ui-slider-handle {
        z-index: 100;
        opacity: 0.9;
        background: url(images/00_slider_popup_bg.png) no-repeat;
+       .LESSbackground-size(@popup-size, @popup-size);
 }
 
 .ui-slider-bar {
        position: absolute;
        top: 0.8em;
-       height: 16px;
+       height: 16 * @unit_base;
        width: 0;
        background-image: url(images/00_winset_list_progress_bar.png);
 }
@@ -132,7 +140,8 @@ a.ui-slider-handle {
 .ui-slider-handle-press {
        position: absolute;
        z-index: 15;
-       width: 58px;
-       height: 58px;
+       width: 58 * @unit_base;
+       height: 58 * @unit_base;
        background: url(images/00_slider_handle_press.png) no-repeat;
+       .LESSbackground-size(58 * @unit_base, 58 * @unit_base);
 }
diff --git a/src/themes/tizen/common/jquery.mobile.tizen.virtualgridview.less b/src/themes/tizen/common/jquery.mobile.tizen.virtualgridview.less
new file mode 100755 (executable)
index 0000000..199d140
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ * jQuery Mobile Framework
+ * Copyright (c) jQuery Project
+ * Dual licensed under the MIT (MIT-LICENSE.txt) or GPL (GPL-LICENSE.txt)
+ * licenses.
+ */
+
+/*** less definitions ***/
+
+@import "config.less";
+
+.ui-virtualgrid {
+       overflow : hidden;
+       position : absolute;
+}
+
+.ui-virtualgrid-wrapblock {
+       position : absolute;
+       left : 0;
+}
\ No newline at end of file
index 083e4e1..29bfe90 100755 (executable)
@@ -23,7 +23,7 @@ CSS_SRCS=     ../common/jquery.mobile.theme.less.css \
                ../common/jquery.mobile.segmentctrl.less.css \
                ../common/jquery.mobile.tizen.optionheader.less.css \
                ../common/jquery.mobile.tizen.virtuallistview.less.css \
-               ../common/jquery.mobile.tizen.scrollview.css \
+               ../common/jquery.mobile.tizen.scrollview.less.css \
                ../common/jquery.mobile.tizen.hsvpicker.less.css \
                ../common/jquery.mobile.tizen.colorpalette.less.css \
                ../common/jquery.mobile.tizen.colortitle.less.css \
@@ -43,8 +43,12 @@ CSS_SRCS=    ../common/jquery.mobile.theme.less.css \
                ../common/jquery.mobile.tizen.toggleswitch.less.css \
                ../common/jquery.mobile.tizen.huegradient.css \
                ../common/jquery.mobile.tizen.colorpicker.less.css \
-               ../common/jquery.mobile.tizen.colorpickerbutton.css \
-               ../common/jquery.mobile.tizen.triangle.less.css
+               ../common/jquery.mobile.tizen.colorpickerbutton.less.css \
+               ../common/jquery.mobile.tizen.triangle.less.css \
+               ../common/jquery.mobile.tizen.multibuttonentry.less.css \
+               ../common/jquery.mobile.tizen.scrollview.handler.less.css \
+               ../common/jquery.mobile.tizen.virtualgridview.less.css \
+               ../common/jquery.mobile.tizen.multimediaview.less.css
 
 all: prepare css images js
 
index 7d60b22..824d15c 100755 (executable)
 @color_slider_handle_text:             rgb(42, 109, 140);
 
 
+/***************************************************************************
+                   Handler
+***************************************************************************/
+@color_scrollview_handler_bg : rgba(255, 255, 255, 0.5);
 
+/***************************************************************************
+                   multimediaview
+***************************************************************************/
+@color_multimediaview_bg : rgb(0, 0, 0);
+@color_multimediaview_control_bg : rgba(0, 0, 0, 0.5);
+@color_multimediaview_button_bg : rgb(85, 85, 85);
+@color_multimediaview_timestamp_text : rgb(42, 109, 140);
+@color_multimediaview_duration_text : rgb(255, 255, 255);
+@color_multimediaview_bar_gray : rgb(55, 55, 55);
+@color_multimediaview_bar_active : rgb(42, 109, 140);
+@color_multimediaview_bar_handle : rgb(249, 249, 249);
diff --git a/src/themes/tizen/tizen-gray/images/00_button_fullscreen_off.png b/src/themes/tizen/tizen-gray/images/00_button_fullscreen_off.png
new file mode 100755 (executable)
index 0000000..d9c0f89
Binary files /dev/null and b/src/themes/tizen/tizen-gray/images/00_button_fullscreen_off.png differ
diff --git a/src/themes/tizen/tizen-gray/images/00_button_fullscreen_on.png b/src/themes/tizen/tizen-gray/images/00_button_fullscreen_on.png
new file mode 100755 (executable)
index 0000000..6f5fd0a
Binary files /dev/null and b/src/themes/tizen/tizen-gray/images/00_button_fullscreen_on.png differ
index 299bb93..52ffbef 100755 (executable)
Binary files a/src/themes/tizen/tizen-gray/images/00_scroll_bar_handler.png and b/src/themes/tizen/tizen-gray/images/00_scroll_bar_handler.png differ
index a7d1e15..76a84a9 100755 (executable)
Binary files a/src/themes/tizen/tizen-gray/images/00_scroll_bar_handler_hor.png and b/src/themes/tizen/tizen-gray/images/00_scroll_bar_handler_hor.png differ
index de0f345..7abc6ef 100755 (executable)
Binary files a/src/themes/tizen/tizen-gray/images/00_splitscreen_handler.png and b/src/themes/tizen/tizen-gray/images/00_splitscreen_handler.png differ
index 5f2e7b5..6ae0864 100755 (executable)
Binary files a/src/themes/tizen/tizen-gray/images/00_splitscreen_handler_hor.png and b/src/themes/tizen/tizen-gray/images/00_splitscreen_handler_hor.png differ
diff --git a/src/themes/tizen/tizen-gray/images/ajax-loader.png b/src/themes/tizen/tizen-gray/images/ajax-loader.png
new file mode 100644 (file)
index 0000000..811a2cd
Binary files /dev/null and b/src/themes/tizen/tizen-gray/images/ajax-loader.png differ
old mode 100644 (file)
new mode 100755 (executable)
index 3203459..daf91bd
@@ -7,7 +7,7 @@
  * Copyright (C) 2011 by Intel Corporation Ltd.
  * 
  * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
+ * copy of this software and associated documentation files (the "Software" ),
  * to deal in the Software without restriction, including without limitation
  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  * and/or sell copies of the Software, and to permit persons to whom the
@@ -69,7 +69,7 @@
 // source: "alternateWidgetName"
 //
 // If AJAX loading fails, source is set to a jQuery object containing a div with an error message. You can check whether
-// loading failed via the jQuery object's jqmData("tizen.widgetex.ajax.fail") data item. If false, then the jQuery object
+// loading failed via the jQuery object's jqmData( "tizen.widgetex.ajax.fail" ) data item. If false, then the jQuery object
 // is the actual prototype loaded via AJAX or present inline. Otherwise, the jQuery object is the error message div.
 //
 // If 'source' is defined as a jQuery object, it is considered already loaded.
@@ -88,7 +88,7 @@
 // Add _htmlProto to your widget's prototype as described above. Then, in your widget's _create() method, call
 // loadPrototype in the following manner:
 //
-// $.tizen.widgetex.loadPrototype.call(this, "namespace.widgetName");
+// $.tizen.widgetex.loadPrototype.call(this, "namespace.widgetName" );
 //
 // Thereafter, you may use the HTML prototype from your widget's prototype or, if you have specified a 'ui' key in your
 // _htmlProto key, you may use this._ui from your widget instance.
 // such code duplication, this class calls _setOption once for each option after _create() has completed.
 //
 // Furthermore, to avoid writing long switches in a widget's _setOption method, this class implements _setOption in such
-// a way that, for any given option (e.g. "myOption"), _setOption looks for a method _setMyOption in the widget's
+// a way that, for any given option (e.g. "myOption" ), _setOption looks for a method _setMyOption in the widget's
 // implementation, and if found, calls the method with the value of the option.
 //
 // If your widget does not inherit from widgetex, you can still use widgetex' systematic option handling:
 //
 // widgetex implements _setDisabled which will disable the input associated with this widget, if any. Thus, if you derive
 // from widgetex and you plan on implementing the disabled state, you should chain up to
-// $.tizen.widgetex.prototype._setDisabled(value), rather than $.Widget.prototype._setOption("disabled", value).
+// $.tizen.widgetex.prototype._setDisabled(value), rather than $.Widget.prototype._setOption( "disabled", value).
 
-(function($, undefined) {
+(function ($, undefined) {
 
 // Framework-specific HTML prototype path for AJAX loads
-function getProtoPath() {
-    var theScriptTag = $("script[data-framework-version][data-framework-root][data-framework-theme]");
-
-    return (theScriptTag.attr("data-framework-root")    + "/" +
-            theScriptTag.attr("data-framework-version") + "/themes/" + 
-            theScriptTag.attr("data-framework-theme")   + "/proto-html");
-}
-
-$.widget("tizen.widgetex", $.mobile.widget, {
-    _createWidget: function() {
-        $.tizen.widgetex.loadPrototype.call(this, this.namespace + "." + this.widgetName);
-        $.mobile.widget.prototype._createWidget.apply(this, arguments);
-    },
-
-    _init: function() {
-        var page = this.element.closest(".ui-page"),
-            self = this,
-            myOptions = {};
-
-        if (page.is(":visible"))
-            this._realize();
-        else
-            page.bind("pageshow", function() { self._realize(); });
-
-        $.extend(myOptions, this.options);
-
-        this.options = {};
-
-        this._setOptions(myOptions);
-    },
-
-    _getCreateOptions: function() {
-        // if we're dealing with an <input> element, value takes precedence over corresponding data-* attribute, if a
-        // mapping has been established via this._value. So, assign the value to the data-* attribute, so that it may
-        // then be assigned to this.options in the superclass' _getCreateOptions
-
-        if (this.element.is("input") && this._value !== undefined) {
-            var theValue =
-                ((this.element.attr("type") === "checkbox" || this.element.attr("type") === "radio")
-                    ? this.element.is(":checked")
-                    : this.element.is("[value]")
-                        ? this.element.attr("value")
-                        : undefined);
-
-            if (theValue != undefined)
-                this.element.attr(this._value.attr, theValue);
-        }
-
-        return $.mobile.widget.prototype._getCreateOptions.apply(this, arguments);
-    },
-
-    _setOption: function(key, value) {
-        var setter = "_set" + key.replace(/^[a-z]/, function(c) {return c.toUpperCase();});
-
-        if (this[setter] !== undefined)
-            this[setter](value);
-        else
-            $.mobile.widget.prototype._setOption.apply(this, arguments);
-    },
-
-    _setDisabled: function(value) {
-        $.Widget.prototype._setOption.call(this, "disabled", value);
-        if (this.element.is("input"))
-            this.element.attr("disabled", value);
-    },
-
-    _setValue: function(newValue) {
-        $.tizen.widgetex.setValue(this, newValue);
-    },
-
-    _realize: function() {}
-});
-
-$.tizen.widgetex.setValue = function(widget, newValue) {
-    if (widget._value !== undefined) {
-        var valueString = widget._value.makeString ? widget._value.makeString(newValue) : newValue;
-
-        widget.element.attr(widget._value.attr, valueString);
-        if (widget._value.signal !== undefined)
-            widget.element.triggerHandler(widget._value.signal, newValue);
-        if (widget.element.is("input")) {
-            var inputType = widget.element.attr("type");
-
-            // Special handling for checkboxes and radio buttons, where the presence of the "checked" attribute is really
-            // the value
-            if (inputType === "checkbox" || inputType === "radio") {
-                if (newValue)
-                    widget.element.attr("checked", true);
-                else
-                    widget.element.removeAttr("checked");
-            }
-            else
-                widget.element.attr("value", valueString);
-            widget.element.trigger("change");
-        }
-    }
-};
-
-$.tizen.widgetex.assignElements = function(proto, obj) {
-    var ret = {};
-    for (var key in obj)
-        if ((typeof obj[key]) === "string") {
-            ret[key] = proto.find(obj[key]);
-            if (obj[key].match(/^#/))
-                ret[key].removeAttr("id");
-        }
-        else
-        if ((typeof obj[key]) === "object")
-            ret[key] = $.tizen.widgetex.assignElements(proto, obj[key]);
-    return ret;
-}
-
-$.tizen.widgetex.loadPrototype = function(widget, ui) {
-    var ar = widget.split(".");
-
-    if (ar.length == 2) {
-        var namespace = ar[0],
-            widgetName = ar[1];
-
-        var htmlProto = $("<div></div>")
-                .text("Failed to load proto for widget " + namespace + "." + widgetName + "!")
-                .css({background: "red", color: "blue", border: "1px solid black"})
-                .jqmData("tizen.widgetex.ajax.fail", true);
-
-        // If htmlProto is defined
-        if ($[namespace][widgetName].prototype._htmlProto !== undefined) {
-            // If no source is defined, use the widget name
-            if ($[namespace][widgetName].prototype._htmlProto.source === undefined)
-                $[namespace][widgetName].prototype._htmlProto.source = widgetName;
-
-            // Load the HTML prototype via AJAX if not defined inline
-            if (typeof $[namespace][widgetName].prototype._htmlProto.source === "string") {
-                // Establish the path for the proto file
-                    widget = $[namespace][widgetName].prototype._htmlProto.source,
-                    protoPath = getProtoPath();
-
-                // Make the AJAX call
-                $.ajax({
-                    url: protoPath + "/" + widget + ".prototype.html",
-                    async: false,
-                    dataType: "html"
-                }).success(function(data, textStatus, jqXHR) {
-                    htmlProto = $("<div></div>").html(data).jqmData("tizen.widgetex.ajax.fail", false);
-                });
-
-                // Assign the HTML proto to the widget prototype
-                $[namespace][widgetName].prototype._htmlProto.source = htmlProto;
-            }
-            // Otherwise, use the inline definition
-            else {
-                // AJAX loading has trivially succeeded, since there was no AJAX loading at all
-                $[namespace][widgetName].prototype._htmlProto.source.jqmData("tizen.widgetex.ajax.fail", false);
-                htmlProto = $[namespace][widgetName].prototype._htmlProto.source;
-            }
-
-            // If there's a "ui" portion in the HTML proto, copy it over to this instance, and
-            // replace the selectors with the selected elements from a copy of the HTML prototype
-            if ($[namespace][widgetName].prototype._htmlProto.ui !== undefined) {
-               // Assign the relevant parts of the proto
-                $.extend(this, {
-                    _ui: $.tizen.widgetex.assignElements(htmlProto.clone(), $[namespace][widgetName].prototype._htmlProto.ui)
-                });
-            }
-        }
-    }
-};
-
-})(jQuery);
+       function getProtoPath() {
+               var theScriptTag = $( "script[data-framework-version][data-framework-root][data-framework-theme]" );
+
+               return (theScriptTag.attr( "data-framework-root" ) + "/" +
+                               theScriptTag.attr( "data-framework-version" ) + "/themes/" +
+                               theScriptTag.attr( "data-framework-theme" ) + "/proto-html" );
+       }
+
+       $.widget( "tizen.widgetex", $.mobile.widget, {
+               _createWidget: function () {
+                       $.tizen.widgetex.loadPrototype.call( this, this.namespace + "." + this.widgetName );
+                       $.mobile.widget.prototype._createWidget.apply( this, arguments );
+               },
+
+               _init: function () {
+                       // TODO THIS IS TEMPORARY PATCH TO AVOID CTXPOPUP PAGE CRASH
+                       if ( this.element === undefined ) {
+                               return;
+                       }
+
+                       var page = this.element.closest( ".ui-page" ),
+                               self = this,
+                               myOptions = {};
+
+                       if ( page.is( ":visible" ) ) {
+                               this._realize();
+                       } else {
+                               page.bind( "pageshow", function () { self._realize(); } );
+                       }
+
+                       $.extend( myOptions, this.options );
+
+                       this.options = {};
+
+                       this._setOptions( myOptions );
+               },
+
+               _getCreateOptions: function () {
+                       // if we're dealing with an <input> element, value takes precedence over corresponding data-* attribute, if a
+                       // mapping has been established via this._value. So, assign the value to the data-* attribute, so that it may
+                       // then be assigned to this.options in the superclass' _getCreateOptions
+
+                       if (this.element.is( "input" ) && this._value !== undefined) {
+                               var theValue =
+                                       ( ( this.element.attr( "type" ) === "checkbox" || this.element.attr( "type" ) === "radio" )
+                                                       ? this.element.is( ":checked" )
+                                                                       : this.element.is( "[value]" )
+                                                                       ? this.element.attr( "value" )
+                                                                                       : undefined);
+
+                               if ( theValue != undefined ) {
+                                       this.element.attr( this._value.attr, theValue );
+                               }
+                       }
+
+                       return $.mobile.widget.prototype._getCreateOptions.apply( this, arguments );
+               },
+
+               _setOption: function ( key, value ) {
+                       var setter = "_set" + key.replace(/^[a-z]/, function (c) { return c.toUpperCase(); } );
+
+                       if ( this[setter] !== undefined ) {
+                               this[setter]( value );
+                       } else {
+                               $.mobile.widget.prototype._setOption.apply( this, arguments );
+                       }
+               },
+
+               _setDisabled: function ( value ) {
+                       $.Widget.prototype._setOption.call( this, "disabled", value );
+                       if ( this.element.is( "input" ) ) {
+                               this.element.attr( "disabled", value );
+                       }
+               },
+
+               _setValue: function ( newValue ) {
+                       $.tizen.widgetex.setValue( this, newValue );
+               },
+
+               _realize: function () {}
+       } );
+
+       $.tizen.widgetex.setValue = function ( widget, newValue ) {
+               if ( widget._value !== undefined ) {
+                       var valueString = ( widget._value.makeString ? widget._value.makeString(newValue) : newValue ),
+                               inputType;
+
+                       widget.element.attr( widget._value.attr, valueString );
+                       if ( widget._value.signal !== undefined ) {
+                               widget.element.triggerHandler( widget._value.signal, newValue );
+                       }
+
+                       if ( widget.element.is( "input" ) ) {
+                               inputType = widget.element.attr( "type" );
+
+                               // Special handling for checkboxes and radio buttons, where the presence of the "checked" attribute is really
+                               // the value
+                               if ( inputType === "checkbox" || inputType === "radio" ) {
+                                       if ( newValue ) {
+                                               widget.element.attr( "checked", true );
+                                       } else {
+                                               widget.element.removeAttr( "checked" );
+                                       }
+                               } else {
+                                       widget.element.attr( "value", valueString );
+                               }
+
+                               widget.element.trigger( "change" );
+                       }
+               }
+       };
+
+       $.tizen.widgetex.assignElements = function (proto, obj) {
+               var ret = {},
+                       key;
+
+               for ( key in obj ) {
+                       if ( ( typeof obj[key] ) === "string" ) {
+                               ret[key] = proto.find( obj[key] );
+                               if ( obj[key].match(/^#/) ) {
+                                       ret[key].removeAttr( "id" );
+                               }
+                       } else {
+                               if ( (typeof obj[key]) === "object" ) {
+                                       ret[key] = $.tizen.widgetex.assignElements( proto, obj[key] );
+                               }
+                       }
+               }
+
+               return ret;
+       };
+
+       $.tizen.widgetex.loadPrototype = function ( widget, ui ) {
+               var ar = widget.split( "." ),
+                       namespace,
+                       widgetName,
+                       htmlProto,
+                       protoPath;
+
+               if ( ar.length == 2 ) {
+                       namespace = ar[0];
+                       widgetName = ar[1];
+                       htmlProto = $( "<div></div>" )
+                                               .text( "Failed to load proto for widget " + namespace + "." + widgetName + "!" )
+                                               .css( {background: "red", color: "blue", border: "1px solid black"} )
+                                               .jqmData( "tizen.widgetex.ajax.fail", true );
+
+                       // If htmlProto is defined
+                       if ( $[namespace][widgetName].prototype._htmlProto !== undefined ) {
+                               // If no source is defined, use the widget name
+                               if ( $[namespace][widgetName].prototype._htmlProto.source === undefined ) {
+                                       $[namespace][widgetName].prototype._htmlProto.source = widgetName;
+                               }
+
+                               // Load the HTML prototype via AJAX if not defined inline
+                               if ( typeof $[namespace][widgetName].prototype._htmlProto.source === "string" ) {
+                                       // Establish the path for the proto file
+                                       widget = $[namespace][widgetName].prototype._htmlProto.source;
+                                       protoPath = getProtoPath();
+
+                                       // Make the AJAX call
+                                       $.ajax( {
+                                               url: protoPath + "/" + widget + ".prototype.html",
+                                               async: false,
+                                               dataType: "html"
+                                       }).success( function (data, textStatus, jqXHR ) {
+                                               htmlProto = $( "<div></div>" ).html(data).jqmData( "tizen.widgetex.ajax.fail", false );
+                                       } );
+
+                                       // Assign the HTML proto to the widget prototype
+                                       $[namespace][widgetName].prototype._htmlProto.source = htmlProto;
+                               } else { // Otherwise, use the inline definition
+                                       // AJAX loading has trivially succeeded, since there was no AJAX loading at all
+                                       $[namespace][widgetName].prototype._htmlProto.source.jqmData( "tizen.widgetex.ajax.fail", false );
+                                       htmlProto = $[namespace][widgetName].prototype._htmlProto.source;
+                               }
+
+                               // If there's a "ui" portion in the HTML proto, copy it over to this instance, and
+                               // replace the selectors with the selected elements from a copy of the HTML prototype
+                               if ( $[namespace][widgetName].prototype._htmlProto.ui !== undefined ) {
+                                       // Assign the relevant parts of the proto
+                                       $.extend( this, {
+                                               _ui: $.tizen.widgetex.assignElements( htmlProto.clone(), $[namespace][widgetName].prototype._htmlProto.ui )
+                                       });
+                               }
+                       }
+               }
+       };
+
+}( jQuery ) );
index b5a06be..abc6b83 100755 (executable)
@@ -7,7 +7,7 @@
  * Copyright (C) 2011 by Intel Corporation Ltd.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
+ * copy of this software and associated documentation files (the "Software" ),
  * to deal in the Software without restriction, including without limitation
  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  * and/or sell copies of the Software, and to permit persons to whom the
  * ***************************************************************************
  */
 
-(function($, undefined) {
-
-$.widget("tizen.colorwidget", $.tizen.widgetex, {
-    options: {
-        color: "#ff0972"
-    },
-
-    _value: {
-        attr: "data-" + ($.mobile.ns || "") + "color",
-        signal: "colorchanged"
-    },
-
-    _getElementColor: function(el, cssProp) {
-        return el.jqmData("clr");
-    },
-
-    _setElementColor: function(el, hsl, cssProp) {
-        var clrlib = $.tizen.colorwidget.clrlib,
-            clr = clrlib.RGBToHTML(clrlib.HSLToRGB(hsl)),
-            dclr = clrlib.RGBToHTML(clrlib.HSLToGray(hsl));
-
-        el.jqmData("clr", clr);
-        el.jqmData("dclr", dclr);
-        el.jqmData("cssProp", cssProp);
-        el.attr("data-" + ($.mobile.ns || "") + "has-dclr", true);
-        el.css(cssProp, this.options.disabled ? dclr : clr);
-
-        return { clr: clr, dclr: dclr };
-    },
-
-    _displayDisabledState: function(toplevel) {
-        var self = this,
-            sel = ":jqmData(has-dclr='true')",
-            dst = toplevel.is(sel) ? toplevel : $([]);
-        dst
-            .add(toplevel.find(sel))
-            .each(function() {
-                el = $(this);
-
-                el.css(el.jqmData("cssProp"), el.jqmData(self.options.disabled ? "dclr" : "clr"));
-            });
-    },
-
-    _setColor: function(value) {
-        var currentValue = (this.options.color + "");
-
-        value = value + "";
-        value = value.match(/#[0-9A-Fa-f]{6}/)
-            ? value
-            : currentValue.match(/#[0-9A-Fa-f]{6}/)
-                ? currentValue
-                : $.tizen.colorwidget.prototype.options.color;
-
-        if (this.options.color !== value) {
-            this.options.color = value;
-            this._setValue(value);
-            return true;
-        }
-        return false;
-    }
-});
-
-$.tizen.colorwidget.clrlib = {
-    nearestInt: function(val) {
-        var theFloor = Math.floor(val);
-
-        return (((val - theFloor) > 0.5) ? (theFloor + 1) : theFloor);
-    },
-
-    // Converts html color string to rgb array.
-    //
-    // Input: string clr_str, where
-    // clr_str is of the form "#aabbcc"
-    //
-    // Returns: [ r, g, b ], where
-    // r is in [0, 1]
-    // g is in [0, 1]
-    // b is in [0, 1]
-    HTMLToRGB: function(clr_str) {
-        clr_str = (('#' == clr_str.charAt(0)) ? clr_str.substring(1) : clr_str);
-
-        return [ parseInt(clr_str.substring(0, 2), 16) / 255.0,
-                 parseInt(clr_str.substring(2, 4), 16) / 255.0,
-                 parseInt(clr_str.substring(4, 6), 16) / 255.0 ];
-    },
-
-    // Converts rgb array to html color string.
-    //
-    // Input: [ r, g, b ], where
-    // r is in [0, 1]
-    // g is in [0, 1]
-    // b is in [0, 1]
-    //
-    // Returns: string of the form "#aabbcc"
-    RGBToHTML: function(rgb) {
-        var ret = "#", val, theFloor;
-        for (var Nix in rgb) {
-            val = rgb[Nix] * 255;
-            theFloor = Math.floor(val);
-            val = ((val - theFloor > 0.5) ? (theFloor + 1) : theFloor);
-            ret = ret + (((val < 16) ? "0" : "") + (val & 0xff).toString(16));
-        }
-
-        return ret;
-    },
-
-    // Converts hsl to rgb.
-    //
-    // From http://130.113.54.154/~monger/hsl-rgb.html
-    //
-    // Input: [ h, s, l ], where
-    // h is in [0, 360]
-    // s is in [0,   1]
-    // l is in [0,   1]
-    //
-    // Returns: [ r, g, b ], where
-    // r is in [0, 1]
-    // g is in [0, 1]
-    // b is in [0, 1]
-    HSLToRGB: function(hsl) {
-        var h = hsl[0] / 360.0, s = hsl[1], l = hsl[2];
-
-        if (0 === s)
-            return [ l, l, l ];
-
-        var temp2 = ((l < 0.5)
-                ? l * (1.0 + s)
-                : l + s - l * s),
-            temp1 = 2.0 * l - temp2,
-            temp3 = {
-                r: h + 1.0 / 3.0,
-                g: h,
-                b: h - 1.0 / 3.0
-            };
-
-        temp3.r = ((temp3.r < 0) ? (temp3.r + 1.0) : ((temp3.r > 1) ? (temp3.r - 1.0) : temp3.r));
-        temp3.g = ((temp3.g < 0) ? (temp3.g + 1.0) : ((temp3.g > 1) ? (temp3.g - 1.0) : temp3.g));
-        temp3.b = ((temp3.b < 0) ? (temp3.b + 1.0) : ((temp3.b > 1) ? (temp3.b - 1.0) : temp3.b));
-
-        ret = [
-            (((6.0 * temp3.r) < 1) ? (temp1 + (temp2 - temp1) * 6.0 * temp3.r) :
-            (((2.0 * temp3.r) < 1) ? temp2 :
-            (((3.0 * temp3.r) < 2) ? (temp1 + (temp2 - temp1) * ((2.0 / 3.0) - temp3.r) * 6.0) :
-             temp1))),
-            (((6.0 * temp3.g) < 1) ? (temp1 + (temp2 - temp1) * 6.0 * temp3.g) :
-            (((2.0 * temp3.g) < 1) ? temp2 :
-            (((3.0 * temp3.g) < 2) ? (temp1 + (temp2 - temp1) * ((2.0 / 3.0) - temp3.g) * 6.0) :
-             temp1))),
-            (((6.0 * temp3.b) < 1) ? (temp1 + (temp2 - temp1) * 6.0 * temp3.b) :
-            (((2.0 * temp3.b) < 1) ? temp2 :
-            (((3.0 * temp3.b) < 2) ? (temp1 + (temp2 - temp1) * ((2.0 / 3.0) - temp3.b) * 6.0) :
-             temp1)))];
-
-        return ret;
-    },
-
-    // Converts hsv to rgb.
-    //
-    // Input: [ h, s, v ], where
-    // h is in [0, 360]
-    // s is in [0,   1]
-    // v is in [0,   1]
-    //
-    // Returns: [ r, g, b ], where
-    // r is in [0, 1]
-    // g is in [0, 1]
-    // b is in [0, 1]
-    HSVToRGB: function(hsv) {
-        return $.tizen.colorwidget.clrlib.HSLToRGB($.tizen.colorwidget.clrlib.HSVToHSL(hsv));
-    },
-
-    // Converts rgb to hsv.
-    //
-    // from http://coecsl.ece.illinois.edu/ge423/spring05/group8/FinalProject/HSV_writeup.pdf
-    //
-    // Input: [ r, g, b ], where
-    // r is in [0,   1]
-    // g is in [0,   1]
-    // b is in [0,   1]
-    //
-    // Returns: [ h, s, v ], where
-    // h is in [0, 360]
-    // s is in [0,   1]
-    // v is in [0,   1]
-    RGBToHSV: function(rgb) {
-        var min, max, delta, h, s, v, r = rgb[0], g = rgb[1], b = rgb[2];
-
-        min = Math.min(r, Math.min(g, b));
-        max = Math.max(r, Math.max(g, b));
-        delta = max - min;
-
-        h = 0;
-        s = 0;
-        v = max;
-
-        if (delta > 0.00001) {
-            s = delta / max;
-
-            if (r === max)
-                h = (g - b) / delta ;
-            else
-            if (g === max)
-                h = 2 + (b - r) / delta ;
-            else
-                h = 4 + (r - g) / delta ;
-
-            h *= 60 ;
-
-            if (h < 0)
-                h += 360 ;
-        }
-
-        return [h, s, v];
-    },
-
-    // Converts hsv to hsl.
-    //
-    // Input: [ h, s, v ], where
-    // h is in [0, 360]
-    // s is in [0,   1]
-    // v is in [0,   1]
-    //
-    // Returns: [ h, s, l ], where
-    // h is in [0, 360]
-    // s is in [0,   1]
-    // l is in [0,   1]
-    HSVToHSL: function(hsv) {
-        var max = hsv[2],
-            delta = hsv[1] * max,
-            min = max - delta,
-            sum = max + min,
-            half_sum = sum / 2,
-            s_divisor = ((half_sum < 0.5) ? sum : (2 - max - min));
-
-        return [ hsv[0], ((0 == s_divisor) ? 0 : (delta / s_divisor)), half_sum ];
-    },
-
-    // Converts rgb to hsl
-    //
-    // Input: [ r, g, b ], where
-    // r is in [0,   1]
-    // g is in [0,   1]
-    // b is in [0,   1]
-    //
-    // Returns: [ h, s, l ], where
-    // h is in [0, 360]
-    // s is in [0,   1]
-    // l is in [0,   1]
-    RGBToHSL: function(rgb) {
-        return $.tizen.colorwidget.clrlib.HSVToHSL($.tizen.colorwidget.clrlib.RGBToHSV(rgb));
-    },
-
-    // Converts hsl to grayscale
-    // Full-saturation magic grayscale values were taken from the Gimp
-    //
-    // Input: [ h, s, l ], where
-    // h is in [0, 360]
-    // s is in [0,   1]
-    // l is in [0,   1]
-    //
-    // Returns: [ r, g, b ], where
-    // r is in [0,   1]
-    // g is in [0,   1]
-    // b is in [0,   1]
-    HSLToGray: function(hsl) {
-        var intrinsic_vals = [0.211764706, 0.929411765, 0.71372549, 0.788235294, 0.070588235, 0.28627451, 0.211764706],
-            idx = Math.floor(hsl[0] / 60),
-            begVal, endVal, val;
-
-        // Find hue interval
-        begVal = intrinsic_vals[idx];
-        endVal = intrinsic_vals[idx + 1];
-
-        // Adjust for lum
-        if (hsl[2] < 0.5) {
-            var lowerHalfPercent = hsl[2] * 2;
-            begVal *= lowerHalfPercent;
-            endVal *= lowerHalfPercent;
-        }
-        else {
-            var upperHalfPercent = (hsl[2] - 0.5) * 2;
-            begVal += (1.0 - begVal) * upperHalfPercent;
-            endVal += (1.0 - endVal) * upperHalfPercent;
-        }
-
-        // This is the gray value at full sat, whereas hsl[2] is the gray value at 0 sat.
-        val = begVal + ((endVal - begVal) * (hsl[0] - (idx * 60))) / 60;
-
-        // Get value at hsl[1]
-        val = val + (hsl[2] - val) * (1.0 - hsl[1]);
-
-        return [val, val, val];
-    }
-};
-
-})(jQuery);
+(function ( $, undefined ) {
+
+       $.widget( "tizen.colorwidget", $.tizen.widgetex, {
+               options: {
+                       color: "#ff0972"
+               },
+
+               _value: {
+                       attr: "data-" + ( $.mobile.ns || "" ) + "color",
+                       signal: "colorchanged"
+               },
+
+               _getElementColor: function ( el, cssProp ) {
+                       return el.jqmData( "clr" );
+               },
+
+               _setElementColor: function ( el, hsl, cssProp ) {
+                       var clrlib = $.tizen.colorwidget.clrlib,
+                               clr = clrlib.RGBToHTML( clrlib.HSLToRGB( hsl ) ),
+                               dclr = clrlib.RGBToHTML( clrlib.HSLToGray( hsl ) );
+
+                       el.jqmData( "clr", clr );
+                       el.jqmData( "dclr", dclr );
+                       el.jqmData( "cssProp", cssProp );
+                       el.attr( "data-" + ( $.mobile.ns || "" ) + "has-dclr", true );
+                       el.css( cssProp, this.options.disabled ? dclr : clr );
+
+                       return { clr: clr, dclr: dclr };
+               },
+
+               _displayDisabledState: function ( toplevel ) {
+                       var self = this,
+                               sel = ":jqmData(has-dclr='true')",
+                               dst = toplevel.is( sel ) ? toplevel : $([]),
+                               el;
+
+                       dst.add( toplevel.find( sel ) )
+                               .each( function () {
+                                       el = $( this );
+                                       el.css( el.jqmData( "cssProp" ), el.jqmData( self.options.disabled ? "dclr" : "clr" ) );
+                               } );
+               },
+
+               _setColor: function ( value ) {
+                       var currentValue = ( this.options.color );
+
+                       value = value.match(/#[0-9A-Fa-f]{6}/)
+                               ? value
+                                       : currentValue.match(/#[0-9A-Fa-f]{6}/)
+                                       ? currentValue
+                                                       : $.tizen.colorwidget.prototype.options.color;
+
+                       if ( this.options.color !== value ) {
+                               this.options.color = value;
+                               this._setValue( value );
+                               return true;
+                       }
+                       return false;
+               }
+       } );
+
+       $.tizen.colorwidget.clrlib = {
+               nearestInt: function ( val ) {
+                       var theFloor = Math.floor( val );
+
+                       return ( ( ( val - theFloor ) > 0.5 ) ? ( theFloor + 1 ) : theFloor );
+               },
+
+               // Converts html color string to rgb array.
+               //
+               // Input: string clr_str, where
+               // clr_str is of the form "#aabbcc"
+               //
+               // Returns: [ r, g, b ], where
+               // r is in [0, 1]
+               // g is in [0, 1]
+               // b is in [0, 1]
+               HTMLToRGB: function ( clr_str ) {
+                       clr_str = ( ( '#' == clr_str.charAt( 0 ) ) ? clr_str.substring( 1 ) : clr_str );
+
+                       return [ parseInt(clr_str.substring(0, 2), 16) / 255.0,
+                                       parseInt(clr_str.substring(2, 4), 16) / 255.0,
+                                       parseInt(clr_str.substring(4, 6), 16) / 255.0 ];
+               },
+
+               // Converts rgb array to html color string.
+               //
+               // Input: [ r, g, b ], where
+               // r is in [0, 1]
+               // g is in [0, 1]
+               // b is in [0, 1]
+               //
+               // Returns: string of the form "#aabbcc"
+               RGBToHTML: function ( rgb ) {
+                       var ret = "#", val, theFloor,
+                               Nix;
+                       for ( Nix in rgb ) {
+                               val = rgb[Nix] * 255;
+                               theFloor = Math.floor( val );
+                               val = ( ( val - theFloor > 0.5 ) ? ( theFloor + 1 ) : theFloor );
+                               ret = ret + ( ( ( val < 16 ) ? "0" : "" ) + ( val & 0xff ).toString( 16 ) );
+                       }
+
+                       return ret;
+               },
+
+               // Converts hsl to rgb.
+               //
+               // From http://130.113.54.154/~monger/hsl-rgb.html
+               //
+               // Input: [ h, s, l ], where
+               // h is in [0, 360]
+               // s is in [0,   1]
+               // l is in [0,   1]
+               //
+               // Returns: [ r, g, b ], where
+               // r is in [0, 1]
+               // g is in [0, 1]
+               // b is in [0, 1]
+               HSLToRGB: function ( hsl ) {
+                       var h = hsl[0] / 360.0, s = hsl[1], l = hsl[2],
+                               temp1,
+                               temp2,
+                               temp3,
+                               ret;
+
+                       if ( 0 === s ) {
+                               return [ l, l, l ];
+                       }
+
+                       temp2 = ( ( l < 0.5 )
+                                       ? l * ( 1.0 + s )
+                                       : l + s - l * s);
+
+                       temp1 = 2.0 * l - temp2;
+                       temp3 = {
+                               r: h + 1.0 / 3.0,
+                               g: h,
+                               b: h - 1.0 / 3.0
+                       };
+
+                       temp3.r = ( ( temp3.r < 0 ) ? ( temp3.r + 1.0 ) : ( ( temp3.r > 1 ) ? ( temp3.r - 1.0 ) : temp3.r ) );
+                       temp3.g = ( ( temp3.g < 0 ) ? ( temp3.g + 1.0 ) : ( ( temp3.g > 1 ) ? ( temp3.g - 1.0 ) : temp3.g ) );
+                       temp3.b = ( ( temp3.b < 0 ) ? ( temp3.b + 1.0 ) : ( ( temp3.b > 1 ) ? ( temp3.b - 1.0 ) : temp3.b ) );
+
+                       ret = [( ( ( 6.0 * temp3.r ) < 1 ) ? ( temp1 + ( temp2 - temp1 ) * 6.0 * temp3.r ) :
+                                       ( ( ( 2.0 * temp3.r ) < 1 ) ? temp2 :
+                                                       ( ( ( 3.0 * temp3.r ) < 2 ) ? ( temp1 + ( temp2 - temp1 ) * ( ( 2.0 / 3.0 ) - temp3.r ) * 6.0 ) :
+                                                                       temp1) ) ),
+                                               ( ( ( 6.0 * temp3.g ) < 1) ? ( temp1 + ( temp2 - temp1 ) * 6.0 * temp3.g ) :
+                                                       ( ( ( 2.0 * temp3.g ) < 1 ) ? temp2 :
+                                                               ( ( ( 3.0 * temp3.g ) < 2 ) ? ( temp1 + ( temp2 - temp1 ) * ( ( 2.0 / 3.0 ) - temp3.g ) * 6.0 ) :
+                                                                               temp1 ) ) ),
+                                                                       ( ( ( 6.0 * temp3.b ) < 1 ) ? ( temp1 + ( temp2 - temp1 ) * 6.0 * temp3.b ) :
+                                                                               ( ( ( 2.0 * temp3.b ) < 1 ) ? temp2 :
+                                                                                       ( ( ( 3.0 * temp3.b ) < 2 ) ? ( temp1 + ( temp2 - temp1 ) * ( ( 2.0 / 3.0 ) - temp3.b ) * 6.0 ) :
+                                                                                               temp1 ) ) )];
+
+                       return ret;
+               },
+
+               // Converts hsv to rgb.
+               //
+               // Input: [ h, s, v ], where
+               // h is in [0, 360]
+               // s is in [0,   1]
+               // v is in [0,   1]
+               //
+               // Returns: [ r, g, b ], where
+               // r is in [0, 1]
+               // g is in [0, 1]
+               // b is in [0, 1]
+               HSVToRGB: function ( hsv ) {
+                       return $.tizen.colorwidget.clrlib.HSLToRGB( $.tizen.colorwidget.clrlib.HSVToHSL( hsv ) );
+               },
+
+               // Converts rgb to hsv.
+               //
+               // from http://coecsl.ece.illinois.edu/ge423/spring05/group8/FinalProject/HSV_writeup.pdf
+               //
+               // Input: [ r, g, b ], where
+               // r is in [0,   1]
+               // g is in [0,   1]
+               // b is in [0,   1]
+               //
+               // Returns: [ h, s, v ], where
+               // h is in [0, 360]
+               // s is in [0,   1]
+               // v is in [0,   1]
+               RGBToHSV: function ( rgb ) {
+                       var min, max, delta, h, s, v, r = rgb[0], g = rgb[1], b = rgb[2];
+
+                       min = Math.min( r, Math.min( g, b ) );
+                       max = Math.max( r, Math.max( g, b ) );
+                       delta = max - min;
+
+                       h = 0;
+                       s = 0;
+                       v = max;
+
+                       if ( delta > 0.00001 ) {
+                               s = delta / max;
+
+                               if ( r === max ) {
+                                       h = ( g - b ) / delta;
+                               } else {
+                                       if ( g === max ) {
+                                               h = 2 + ( b - r ) / delta;
+                                       } else {
+                                               h = 4 + ( r - g ) / delta;
+                                       }
+                               }
+                               h *= 60;
+
+                               if ( h < 0 ) {
+                                       h += 360;
+                               }
+                       }
+
+                       return [h, s, v];
+               },
+
+               // Converts hsv to hsl.
+               //
+               // Input: [ h, s, v ], where
+               // h is in [0, 360]
+               // s is in [0,   1]
+               // v is in [0,   1]
+               //
+               // Returns: [ h, s, l ], where
+               // h is in [0, 360]
+               // s is in [0,   1]
+               // l is in [0,   1]
+               HSVToHSL: function ( hsv ) {
+                       var max = hsv[2],
+                               delta = hsv[1] * max,
+                               min = max - delta,
+                               sum = max + min,
+                               half_sum = sum / 2,
+                               s_divisor = ( ( half_sum < 0.5 ) ? sum : ( 2 - max - min ) );
+
+                       return [ hsv[0], ( ( 0 == s_divisor ) ? 0 : ( delta / s_divisor ) ), half_sum ];
+               },
+
+               // Converts rgb to hsl
+               //
+               // Input: [ r, g, b ], where
+               // r is in [0,   1]
+               // g is in [0,   1]
+               // b is in [0,   1]
+               //
+               // Returns: [ h, s, l ], where
+               // h is in [0, 360]
+               // s is in [0,   1]
+               // l is in [0,   1]
+               RGBToHSL: function ( rgb ) {
+                       return $.tizen.colorwidget.clrlib.HSVToHSL( $.tizen.colorwidget.clrlib.RGBToHSV( rgb ) );
+               },
+
+               // Converts hsl to grayscale
+               // Full-saturation magic grayscale values were taken from the Gimp
+               //
+               // Input: [ h, s, l ], where
+               // h is in [0, 360]
+               // s is in [0,   1]
+               // l is in [0,   1]
+               //
+               // Returns: [ r, g, b ], where
+               // r is in [0,   1]
+               // g is in [0,   1]
+               // b is in [0,   1]
+               HSLToGray: function ( hsl ) {
+                       var intrinsic_vals = [0.211764706, 0.929411765, 0.71372549, 0.788235294, 0.070588235, 0.28627451, 0.211764706],
+                               idx = Math.floor(hsl[0] / 60),
+                               lowerHalfPercent,
+                               upperHalfPercent,
+                               begVal,
+                               endVal,
+                               val;
+
+                       // Find hue interval
+                       begVal = intrinsic_vals[idx];
+                       endVal = intrinsic_vals[idx + 1];
+
+                       // Adjust for lum
+                       if ( hsl[2] < 0.5 ) {
+                               lowerHalfPercent = hsl[2] * 2;
+                               begVal *= lowerHalfPercent;
+                               endVal *= lowerHalfPercent;
+                       } else {
+                               upperHalfPercent = ( hsl[2] - 0.5 ) * 2;
+                               begVal += ( 1.0 - begVal ) * upperHalfPercent;
+                               endVal += ( 1.0 - endVal ) * upperHalfPercent;
+                       }
+
+                       // This is the gray value at full sat, whereas hsl[2] is the gray value at 0 sat.
+                       val = begVal + ( ( endVal - begVal ) * ( hsl[0] - ( idx * 60 ) ) ) / 60;
+
+                       // Get value at hsl[1]
+                       val = val + ( hsl[2] - val ) * ( 1.0 - hsl[1] );
+
+                       return [val, val, val];
+               }
+       };
+
+}( jQuery ));
index f2c0e07..cee5c3f 100755 (executable)
@@ -1,35 +1,37 @@
-(function($, undefined) {
+(function ( $, undefined ) {
 
-$.widget("tizen.huegradient", $.tizen.widgetex, {
-    _create: function() {
-        this.element.addClass("tizen-huegradient");
-    },
+       $.widget( "tizen.huegradient", $.tizen.widgetex, {
+               _create: function () {
+                       this.element.addClass( "tizen-huegradient" );
+               },
 
-    // Crutches for IE: it is incapable of multi-stop gradients, so add multiple divs inside the given div, each with a
-    // two-point gradient
-    _IEGradient: function(div, disabled) {
-        var rainbow = disabled
-            ? ["#363636", "#ededed", "#b6b6b6", "#c9c9c9", "#121212", "#494949", "#363636"]
-            : ["#ff0000", "#ffff00", "#00ff00", "#00ffff", "#0000ff", "#ff00ff", "#ff0000"];
-        for (var Nix = 0 ; Nix < 6 ; Nix++) {
-            $("<div></div>")
-                .css({
-                    position: "absolute",
-                    width: (100 / 6) + "%",
-                    height: "100%",
-                    left: (Nix * 100 / 6) + "%",
-                    top: "0px",
-                    filter: "progid:DXImageTransform.Microsoft.gradient (startColorstr='" + rainbow[Nix] + "', endColorstr='" + rainbow[Nix + 1] + "', GradientType = 1)"
-                })
-                .appendTo(div);
-        }
-    },
+               // Crutches for IE: it is incapable of multi-stop gradients, so add multiple divs inside the given div, each with a
+               // two-point gradient
+               _IEGradient: function ( div, disabled ) {
+                       var rainbow = disabled
+                               ? ["#363636", "#ededed", "#b6b6b6", "#c9c9c9", "#121212", "#494949", "#363636"]
+                               : ["#ff0000", "#ffff00", "#00ff00", "#00ffff", "#0000ff", "#ff00ff", "#ff0000"],
+                               Nix;
 
-    _setDisabled: function(value) {
-        $.Widget.prototype._setOption.call(this, "disabled", value);
-        if ($.mobile.browser.ie)
-            this._IEGradient(this.element.empty(), value);
-    }
-});
+                       for (Nix = 0 ; Nix < 6 ; Nix++ ) {
+                               $( "<div></div>" )
+                                       .css( {
+                                               position: "absolute",
+                                               width: ( 100 / 6 ) + "%",
+                                               height: "100%",
+                                               left: ( Nix * 100 / 6 ) + "%",
+                                               top: "0px",
+                                               filter: "progid:DXImageTransform.Microsoft.gradient (startColorstr='" + rainbow[Nix] + "', endColorstr='" + rainbow[Nix + 1] + "', GradientType = 1)"
+                                       } )
+                                       .appendTo( div );
+                       }
+               },
 
-})(jQuery);
+               _setDisabled: function ( value ) {
+                       $.Widget.prototype._setOption.call( this, "disabled", value );
+                       if ( $.mobile.browser.ie ) {
+                               this._IEGradient( this.element.empty(), value );
+                       }
+               }
+       } );
+}( jQuery ) );
old mode 100644 (file)
new mode 100755 (executable)
index 29abb4d..4838170
@@ -1,57 +1,49 @@
-/*
-       Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
-
-       Licensed under the Apache License, Version 2.0 (the "License");
-       you may not use this file except in compliance with the License.
-       You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-       Unless required by applicable law or agreed to in writing, software
-       distributed under the License is distributed on an "AS IS" BASIS,
-       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-       See the License for the specific language governing permissions and
-       limitations under the License.
-*/
-
-(function($, undefined) {
-
-$.widget("todons.colorwidget", $.mobile.widget, {
-  options: {
-    color: "#ff0972"
-  },
-
-  _create: function() {
-    $.extend (this, {
-      isInput: this.element.is("input")
-    });
-
-    /* "value", if present, takes precedence over "data-color" */
-    if (this.isInput)
-      if (this.element.attr("value").match(/#[0-9A-Fa-f]{6}/))
-        this.element.attr("data-color", this.element.attr("value"));
-
-    $.mobile.todons.parseOptions(this, true);
-  },
-
-  _setOption: function(key, value, unconditional) {
-    if (undefined === unconditional)
-      unconditional = false;
-    if (key === "color")
-      this._setColor(value, unconditional);
-  },
-
-  _setColor: function(value, unconditional) {
-    if (value.match(/#[0-9A-Fa-f]{6}/) && (value != this.options.color || unconditional)) {
-      this.options.color = value;
-      this.element.attr("data-color", value);
-      if (this.isInput)
-        this.element.attr("value", value);
-      this.element.triggerHandler("colorchanged", value);
-      return true;
-    }
-    return false;
-  },
-});
-
-})(jQuery);
+( function ( $, undefined ) {
+
+       $.widget( "todons.colorwidget", $.mobile.widget, {
+               options: {
+                       color: "#ff0972"
+               },
+
+               _create: function () {
+                       $.extend ( this, {
+                               isInput: this.element.is( "input" )
+                       } );
+
+                       /* "value", if present, takes precedence over "data-color" */
+                       if ( this.isInput ) {
+                               if ( this.element.attr( "value" ).match(/#[0-9A-Fa-f]{6}/) ) {
+                                       this.element.attr( "data-color", this.element.attr( "value" ) );
+                               }
+                       }
+
+                       $.mobile.todons.parseOptions( this, true );
+               },
+
+               _setOption: function ( key, value, unconditional ) {
+                       if ( undefined === unconditional ) {
+                               unconditional = false;
+                       }
+
+                       if ( key === "color" ) {
+                               this._setColor(value, unconditional);
+                       }
+               },
+
+               _setColor: function ( value, unconditional ) {
+                       if ( value.match(/#[0-9A-Fa-f]{6}/) && ( value != this.options.color || unconditional ) ) {
+                               this.options.color = value;
+                               this.element.attr( "data-color", value );
+
+                               if ( this.isInput ) {
+                                       this.element.attr( "value", value );
+                               }
+
+                               this.element.triggerHandler( "colorchanged", value );
+                               return true;
+                       }
+                       return false;
+               }
+       } );
+
+}( jQuery ) );
old mode 100644 (file)
new mode 100755 (executable)
similarity index 52%
rename from src/widgets/autodividers/js/autodividers.js
rename to src/widgets/autodividers/js/jquery.mobile.tizen.autodividers.js
index e1bd579..945670e
@@ -1,4 +1,3 @@
-/* TBD */
 /*
  * jQuery Mobile Widget @VERSION - listview autodividers
  *
@@ -6,7 +5,7 @@
  * http://www.opensource.org/licenses/mit-license.php)
  * 
  * ***************************************************************************
- * Copyright (C) 2011 by Intel Corporation Ltd.
+ * Copyright (c) 2011 by Intel Corporation Ltd.
  * 
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
 //             this happens if list items are added to the listview,
 //             which causes the autodividers to be regenerated.
 
-(function( $, undefined ) {
-
-var autodividers = function(options) {
-       var list = $( this );
-       options = options || {};
-
-       var listview = list.data( 'listview' );
-
-       var dividerType = options.type || list.jqmData( 'autodividers' ) || 'alpha';
+(function ( $, undefined ) {
+
+       var autodividers = function ( options ) {
+               var list = $( this ),
+                       listview = list.data( 'listview' ),
+                       dividerType,
+                       textSelector,
+                       getDividerText,
+                       mergeDividers,
+                       isNonDividerLi,
+                       liAdded,
+                       liRemoved;
+
+               options = options || {};
+               dividerType = options.type || list.jqmData( 'autodividers' ) || 'alpha';
+               textSelector = options.selector || list.jqmData( 'autodividers-selector' ) || 'a';
+
+               getDividerText = function ( elt ) {
+                       // look for some text in the item
+                       var text = elt.find( textSelector ).text() || elt.text() || null;
+
+                       if ( !text ) {
+                               return null;
+                       }
 
-       var textSelector = options.selector || list.jqmData( 'autodividers-selector' ) || 'a';
+                       // create the text for the divider
+                       if ( dividerType === 'alpha' ) {
+                               text = text.slice( 0, 1 ).toUpperCase();
+                       }
 
-       var getDividerText = function( elt ) {
-               // look for some text in the item
-               var text = elt.find( textSelector ).text() || elt.text() || null;
+                       return text;
+               };
+
+               mergeDividers = function () {
+                       var dividersChanged = false,
+                               divider,
+                               dividerText,
+                               selector,
+                               nextDividers;
+
+                       // any dividers which are following siblings of a divider, where
+                       // there are no dividers with different text inbetween, can be removed
+                       list.find( 'li.ui-li-divider' ).each(function () {
+                               divider = $( this );
+                               dividerText = divider.text();
+                               selector = '.ui-li-divider:not(:contains(' + dividerText + '))';
+                               nextDividers = divider.nextUntil( selector );
+                               nextDividers = nextDividers.filter( '.ui-li-divider:contains(' + dividerText + ')' );
+
+                               if ( nextDividers.length > 0 ) {
+                                       nextDividers.remove();
+                                       dividersChanged = true;
+                               }
+                       } );
+
+                       if ( dividersChanged ) {
+                               list.trigger( 'updatelayout' );
+                       }
+               };
+
+               // check that elt is a non-divider li element
+               isNonDividerLi = function ( elt ) {
+                       return elt.is('li') &&
+                                       elt.jqmData( 'role' ) !== 'list-divider';
+               };
+
+               // li element inserted, so check whether it needs a divider
+               liAdded = function ( li ) {
+                       var dividerText = getDividerText( li ),
+                               existingDividers,
+                               divider;
+
+                       if ( !dividerText ) {
+                               listview.refresh();
+                               return;
+                       }
 
-               if ( !text ) {
-                       return null;
-               }
+                       // add expected divider for this li if it doesn't exist
+                       existingDividers = li.prevAll( '.ui-li-divider:first:contains(' + dividerText + ')' );
 
-               // create the text for the divider
-               if ( dividerType === 'alpha' ) {
-                       text = text.slice( 0, 1 ).toUpperCase();
-               }
+                       if ( existingDividers.length === 0 ) {
+                               divider = $( '<li>' + dividerText + '</li>' );
+                               divider.attr( 'data-' + $.mobile.ns + 'role', 'list-divider' );
+                               li.before( divider );
 
-               return text;
-       };
+                               listview.refresh();
 
-       var mergeDividers = function() {
-               var dividersChanged = false;
-
-               // any dividers which are following siblings of a divider, where
-               // there are no dividers with different text inbetween, can be removed
-               list.find( 'li.ui-li-divider' ).each(function() {
-                       var divider = $( this );
-                       var dividerText = divider.text();
-                       var selector = '.ui-li-divider:not(:contains(' + dividerText + '))';
-                       var nextDividers = divider.nextUntil( selector );
-                       nextDividers = nextDividers.filter( '.ui-li-divider:contains(' + dividerText + ')' );
-
-                       if (nextDividers.length > 0) {
-                               nextDividers.remove();
-                               dividersChanged = true;
+                               mergeDividers();
+                       } else {
+                               listview.refresh();
                        }
-               });
+               };
 
-               if (dividersChanged) {
-                       list.trigger( 'updatelayout' );
-               }
-       };
+               // li element removed, so check whether its divider should go
+               liRemoved = function ( li ) {
+                       var dividerText = getDividerText( li ),
+                               precedingItems,
+                               nextItems;
 
-       // check that elt is a non-divider li element
-       var isNonDividerLi = function( elt ) {
-               return elt.is('li') &&
-                      elt.jqmData( 'role' ) !== 'list-divider';
-       };
+                       if ( !dividerText ) {
+                               listview.refresh();
+                               return;
+                       }
 
-       // li element inserted, so check whether it needs a divider
-       var liAdded = function( li ) {
-               var dividerText = getDividerText( li );
+                       // remove divider for this li if there are no other
+                       // li items for the divider before or after this li item
+                       precedingItems = li.prevUntil( '.ui-li-divider:contains(' + dividerText + ')' );
+                       nextItems = li.nextUntil( '.ui-li-divider' );
 
-               if ( !dividerText ) {
-                       listview.refresh();
-                       return;
-               }
+                       if ( precedingItems.length === 0 && nextItems.length === 0 ) {
+                               li.prevAll( '.ui-li-divider:contains(' + dividerText + '):first' ).remove();
 
-               // add expected divider for this li if it doesn't exist
-               var existingDividers = li.prevAll( '.ui-li-divider:first:contains(' + dividerText + ')' );
+                               listview.refresh();
 
-               if ( existingDividers.length === 0 ) {
-                       var divider = $( '<li>' + dividerText + '</li>' );
-                       divider.attr( 'data-' + $.mobile.ns + 'role', 'list-divider' );
-                       li.before( divider );
-
-                       listview.refresh();
+                               mergeDividers();
+                       } else {
+                               listview.refresh();
+                       }
+               };
 
-                       mergeDividers();
-               }
-               else {
-                       listview.refresh();
-               }
-       };
+               // set up the dividers on first create
+               list.find( 'li' ).each( function () {
+                       var li = $( this );
 
-       // li element removed, so check whether its divider should go
-       var liRemoved = function( li ) {
+                       // remove existing dividers
+                       if ( li.jqmData( 'role' ) === 'list-divider' ) {
+                               li.remove();
+                       } else {                        // make new dividers for list items
+                               liAdded( li );
+                       }
+               } );
 
-               var dividerText = getDividerText( li );
+               // bind to DOM events to keep list up to date
+               list.bind( 'DOMNodeInserted', function ( e ) {
+                       var elt = $( e.target );
 
-               if ( !dividerText ) {
-                       listview.refresh();
-                       return;
-               }
+                       if ( !isNonDividerLi( elt ) ) {
+                               return;
+                       }
 
-               // remove divider for this li if there are no other
-               // li items for the divider before or after this li item
-               var precedingItems = li.prevUntil( '.ui-li-divider:contains(' + dividerText + ')' );
-               var nextItems = li.nextUntil( '.ui-li-divider' );
+                       liAdded( elt );
+               } );
 
-               if ( precedingItems.length === 0 && nextItems.length === 0 ) {
-                       li.prevAll( '.ui-li-divider:contains(' + dividerText + '):first' ).remove();
+               list.bind( 'DOMNodeRemoved', function ( e ) {
+                       var elt = $( e.target );
 
-                       listview.refresh();
+                       if ( !isNonDividerLi( elt ) ) {
+                               return;
+                       }
 
-                       mergeDividers();
-               }
-               else {
-                       listview.refresh();
-               }
+                       liRemoved( elt );
+               } );
        };
 
-       // set up the dividers on first create
-       list.find( 'li' ).each( function() {
-               var li = $( this );
-
-               // remove existing dividers
-               if ( li.jqmData( 'role' ) === 'list-divider' ) {
-                       li.remove();
-               }
-               // make new dividers for list items
-               else {
-                       liAdded( li );
-               }
-       });
+       $.fn.autodividers = autodividers;
 
-       // bind to DOM events to keep list up to date
-       list.bind( 'DOMNodeInserted', function( e ) {
-               var elt = $( e.target );
+       $( ":jqmData(role=listview)" ).live( "listviewcreate", function () {
+               var list = $( this );
 
-               if ( !isNonDividerLi( elt ) ) {
-                       return;
+               if ( list.is( ':jqmData(autodividers)' ) ) {
+                       list.autodividers();
                }
-
-               liAdded( elt );
-       });
-
-       list.bind( 'DOMNodeRemoved', function( e ) {
-               var elt = $( e.target );
-
-               if ( !isNonDividerLi( elt ) ) {
-                       return;
-               }
-
-               liRemoved( elt );
-       });
-};
-
-$.fn.autodividers = autodividers;
-
-$( ":jqmData(role=listview)" ).live( "listviewcreate", function() {
-       var list = $( this );
-
-       if ( list.is( ':jqmData(autodividers)' ) ) {
-               list.autodividers();
-       }
-});
-
-})( jQuery );
+       } );
+}( jQuery ) );
old mode 100644 (file)
new mode 100755 (executable)
index 6bfca37..f26895c
+/* ***************************************************************************
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software" ),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ */
+
 // most of following codes are derived from jquery.mobile.scrollview.js
-(function($,window,document,undefined) {
-
-jQuery.widget( "mobile.circularview", jQuery.mobile.widget, {
-       options: {
-               fps:                            60,
-               
-               scrollDuration:         2000,
-
-               moveThreshold:          10,
-               moveIntervalThreshold:  150,
-
-               startEventName:         "scrollstart",
-               updateEventName:        "scrollupdate",
-               stopEventName:          "scrollstop",
-
-               eventType:                      $.support.touch ? "touch" : "mouse",
-
-               delayedClickSelector: "a, .ui-btn",
-               delayedClickEnabled: false 
-       },
-       _makePositioned: function($ele) {
-               if ( $ele.css( 'position' ) == 'static' ) 
-                       $ele.css( 'position', 'relative' );
-
-       },
-
-       _create: function() {
-               this._$clip = $(this.element).addClass("ui-scrollview-clip");
-               var $child = this._$clip.children();
-//             if ( $child.length > 1 ) {
-                       $child = this._$clip.wrapInner("<div></div>").children();
-//             }
-               this._$view = $child.addClass("ui-scrollview-view");
-               this._$list = $child.children();
-
-               this._$clip.css( "overflow", "hidden" );
-               this._makePositioned( this._$clip );
-
-               this._$view.css( "overflow", "hidden" );
-               this._tracker = new MomentumTracker( this.options );
-
-               this._timerInterval = 1000/ this.options.fps;
-               this._timerID = 0;
-
-               var self = this;
-               this._timerCB = function() { self._handleMomentumScroll(); };
-        
-        this.refresh();
-
-               this._addBehaviors();
-       },
-
-    refresh: function() {
-               this._viewWidth = this._$view.width();
-               this._clipWidth = window.innerWidth;
-               this._itemWidth = this._$list.children().first().outerWidth();
-               this._$items = this._$list.children().detach();
-               var itemsPerView = this._clipWidth / this._itemWidth;
-               itemsPerView = Math.ceil( itemsPerView * 10 ) / 10;
-               this._itemsPerView = parseInt( itemsPerView );
-
-               this._rx = -this._itemWidth;
-               this._sx = -this._itemWidth;
-               this._setItems();
-    },
-
-       _startMScroll: function( speedX, speedY ) {
-               this._stopMScroll();
-               
-               var keepGoing = false;
-               var duration = this.options.scrollDuration;
-
-               this._$clip.trigger(this.options.startEventName);
-
-               var t = this._tracker;
-               var c = this._clipWidth;
-               var v = this._viewWidth;
-               t.start( this._rx, speedX, duration, (v > c ) ? -(v - c) : 0, 0 );
-               keepGoing = !t.done();
-
-               if ( keepGoing ) {
-                       this._timerID = setTimeout( this._timerCB, this._timerInterval );
-               } else {
-                       this._stopMScroll();
-               }
-               //console.log("startmscroll" + this._rx + "," + this._sx );
-       },
+(function ( $, window, document, undefined ) {
 
-       _stopMScroll: function() {
-               if ( this._timerID ) {
-                       this._$clip.trigger(this.options.stopEventName);
-                       clearTimeout(this._timerID);
+       function circularNum( num, total ) {
+               var n = num % total;
+               if ( n < 0 ) {
+                       n = total + n;
                }
+               return n;
+       }
 
-               this._timerID = 0;
+       function setElementTransform( $ele, x, y ) {
+               var v = "translate3d( " + x + "," + y + ", 0px)";
+               $ele.css({
+                       "-moz-transform": v,
+                       "-webkit-transform": v,
+                       "transform": v
+               } );
+       }
 
-               if ( this._tracker ) {
-                       this._tracker.reset();
-               }
-               //console.log("stopmscroll" + this._rx + "," + this._sx );
-       },
+       function MomentumTracker( options ) {
+               this.options = $.extend( {}, options );
+               this.easing = "easeOutQuad";
+               this.reset();
+       }
 
-       _handleMomentumScroll: function() {
-               var keepGoing = false;
-               var v = this._$view;
+       var tstates = {
+               scrolling : 0,
+               done : 1
+       };
 
-               var x = 0, y = 0;
+       function getCurrentTime() {
+               return ( new Date()).getTime();
+       }
 
-               var t = this._tracker;
-               if ( t ) {
-                       t.update();
-                       x = t.getPosition();
+       $.extend( MomentumTracker.prototype, {
+               start: function ( pos, speed, duration ) {
+                       this.state = ( speed != 0 ) ? tstates.scrolling : tstates.done;
+                       this.pos = pos;
+                       this.speed = speed;
+                       this.duration = duration;
 
-                       keepGoing = !t.done();
+                       this.fromPos = 0;
+                       this.toPos = 0;
+
+                       this.startTime = getCurrentTime();
+               },
+
+               reset: function () {
+                       this.state = tstates.done;
+                       this.pos = 0;
+                       this.speed = 0;
+                       this.duration = 0;
+               },
+
+               update: function () {
+                       var state = this.state,
+                               duration,
+                               elapsed,
+                               dx,
+                               x;
+
+                       if ( state == tstates.done ) {
+                               return this.pos;
+                       }
+
+                       duration = this.duration;
+                       elapsed = getCurrentTime() - this.startTime;
+                       elapsed = elapsed > duration ? duration : elapsed;
+
+                       dx = this.speed * ( 1 - $.easing[this.easing](elapsed / duration, elapsed, 0, 1, duration ) );
+
+                       x = this.pos + dx;
+                       this.pos = x;
+
+                       if ( elapsed >= duration ) {
+                               this.state = tstates.done;
+                       }
+
+                       return this.pos;
+               },
+
+               done: function () {
+                       return this.state == tstates.done;
+               },
 
+               getPosition: function () {
+                       return this.pos;
                }
+       } );
+
+       jQuery.widget( "mobile.circularview", jQuery.mobile.widget, {
+               options: {
+                       fps:                            60,
+
+                       scrollDuration:         2000,
+
+                       moveThreshold:          10,
+                       moveIntervalThreshold:  150,
+
+                       startEventName:         "scrollstart",
+                       updateEventName:        "scrollupdate",
+                       stopEventName:          "scrollstop",
+
+                       eventType:                      $.support.touch ? "touch" : "mouse",
+
+                       delayedClickSelector: "a, .ui-btn",
+                       delayedClickEnabled: false
+               },
+
+               _makePositioned: function ( $ele ) {
+                       if ( $ele.css( 'position' ) == 'static' ) {
+                               $ele.css( 'position', 'relative' );
+                       }
+               },
+
+               _create: function () {
+                       this._$clip = $( this.element).addClass( "ui-scrollview-clip" );
+                       var $child = this._$clip.children(),
+                               self;
+                       //if ( $child.length > 1 ) {
+                       $child = this._$clip.wrapInner( "<div></div>" ).children();
+                       //}
+                       this._$view = $child.addClass( "ui-scrollview-view" );
+                       this._$list = $child.children();
+
+                       this._$clip.css( "overflow", "hidden" );
+                       this._makePositioned( this._$clip );
+
+                       this._$view.css( "overflow", "hidden" );
+                       this._tracker = new MomentumTracker( this.options );
+
+                       this._timerInterval = 1000 / this.options.fps;
+                       this._timerID = 0;
 
-               this._setScrollPosition( x, y );
-               this._rx = x;
+                       self = this;
+                       this._timerCB = function () { self._handleMomentumScroll(); };
 
-               this._$clip.trigger( this.options.updateEventName, [ { x: x, y: y } ] );
+                       this.refresh();
 
-               if ( keepGoing ) {
-                       this._timerID = setTimeout( this._timerCB, this._timerInterval );
-               } else {
+                       this._addBehaviors();
+               },
+
+               refresh: function () {
+                       var itemsPerView;
+
+                       this._viewWidth = this._$view.width();
+                       this._clipWidth = $( window ).width();
+                       this._itemWidth = this._$list.children().first().outerWidth();
+                       this._$items = this._$list.children().detach();
+                       itemsPerView = this._clipWidth / this._itemWidth;
+                       itemsPerView = Math.ceil( itemsPerView * 10 ) / 10;
+                       this._itemsPerView = parseInt( itemsPerView, 10 );
+
+                       this._rx = -this._itemWidth;
+                       this._sx = -this._itemWidth;
+                       this._setItems();
+               },
+
+               _startMScroll: function ( speedX, speedY ) {
                        this._stopMScroll();
-               }
-       },
 
-       _setItems: function() {
-               for ( var i = -1; i < this._itemsPerView + 1; i++ ) {
-                       var $item = this._$items[ circularNum( i, this._$items.length ) ];
-                       this._$list.append( $item );
-               }
-               setElementTransform( this._$view, this._sx + "px", 0 );
-        this._$view.width( this._itemWidth * ( this._itemsPerView + 2 ) );
-        this._viewWidth = this._$view.width();
-       },
-       
-       _setScrollPosition: function( x, y ) {
-               var sx = this._sx;
-               var dx = x - sx;
-               var di = parseInt( dx / this._itemWidth );
-               if ( di > 0 ) {
-                       for ( var i = 0; i < di; i++ ) {
-                               this._$list.children().last().detach();
-                               var idx = -parseInt( ( sx / this._itemWidth ) + i + 3 );
-                               var $item = this._$items[ circularNum( idx, this._$items.length ) ];
-                               this._$list.prepend( $item );
-                               //console.log( "di > 0 : " + idx );
+                       var keepGoing = false,
+                               duration = this.options.scrollDuration,
+                               t = this._tracker,
+                               c = this._clipWidth,
+                               v = this._viewWidth;
+
+                       this._$clip.trigger( this.options.startEventName);
+
+                       t.start( this._rx, speedX, duration, (v > c ) ? -(v - c) : 0, 0 );
+                       keepGoing = !t.done();
+
+                       if ( keepGoing ) {
+                               this._timerID = setTimeout( this._timerCB, this._timerInterval );
+                       } else {
+                               this._stopMScroll();
                        }
-               } else if ( di < 0   ) {
-                       for ( var i = 0; i > di; i-- ) {  
-                               this._$list.children().first().detach();
-                               var idx = this._itemsPerView - parseInt( ( sx / this._itemWidth ) + i );
-                               var $item = this._$items[ circularNum( idx, this._$items.length ) ];
-                               this._$list.append( $item );
-                               //console.log( "di < 0 : " + idx );
+                       //console.log( "startmscroll" + this._rx + "," + this._sx );
+               },
+
+               _stopMScroll: function () {
+                       if ( this._timerID ) {
+                               this._$clip.trigger( this.options.stopEventName );
+                               clearTimeout( this._timerID );
                        }
-               }
-               
-
-
-               this._sx += di * this._itemWidth;
-
-               setElementTransform( this._$view, ( x - this._sx - this._itemWidth ) + "px", 0 );
-
-               //console.log( "rx " + this._rx + "sx " + this._sx );
-       },
-
-       _enableTracking: function() {
-               $(document).bind( this._dragMoveEvt, this._dragMoveCB );
-               $(document).bind( this._dragStopEvt, this._dragStopCB );
-       },
-
-       _disableTracking: function() {
-               $(document).unbind( this._dragMoveEvt, this._dragMoveCB );
-               $(document).unbind( this._dragStopEvt, this._dragStopCB );
-       },
-
-       _getScrollHierarchy: function() {
-               var svh = [];
-               this._$clip.parents('.ui-scrollview-clip').each( function() {
-                       var d = $(this).jqmData('circulaview');
-                       if ( d ) svh.unshift(d);
-               });
-               return svh;
-       },
-    
-    centerTo: function( selector ) {
-        for ( var i = 0; i < this._$items.length; i++ ) {
-            if ( $(this._$items[i]).is( selector ) ) {
-               var newX = -( i * this._itemWidth - this._clipWidth / 2 + this._itemWidth * 2 );
-               this.scrollTo( newX, 0 );
-               console.log( i + "," + newX );
-               return;
-            }
-        }
-    },
-
-       scrollTo: function(x, y, duration) {
-               this._stopMScroll();
-               if ( !duration ) {
+
+                       this._timerID = 0;
+
+                       if ( this._tracker ) {
+                               this._tracker.reset();
+                       }
+                       //console.log( "stopmscroll" + this._rx + "," + this._sx );
+               },
+
+               _handleMomentumScroll: function () {
+                       var keepGoing = false,
+                               v = this._$view,
+                               x = 0,
+                               y = 0,
+                               t = this._tracker;
+
+                       if ( t ) {
+                               t.update();
+                               x = t.getPosition();
+
+                               keepGoing = !t.done();
+
+                       }
+
                        this._setScrollPosition( x, y );
-            this._rx = x;
-            return;
-               }
+                       this._rx = x;
 
-               x = -x;
-               y = -y;
-
-               var self = this;
-               var start = getCurrentTime();
-               var efunc = $.easing["easeOutQuad"];
-               var sx = this._rx;
-               var sy = 0;
-               var dx = x - sx;
-               var dy = 0;
-               var tfunc = function() {
-                       var elapsed = getCurrentTime() - start;
-                       if ( elapsed >= duration ) {
-                               self._timerID = 0;
-                               self._setScrollPosition( x, y );
+                       this._$clip.trigger( this.options.updateEventName, [ { x: x, y: y } ] );
+
+                       if ( keepGoing ) {
+                               this._timerID = setTimeout( this._timerCB, this._timerInterval );
                        } else {
-                               var ec = efunc( elapsed / duration, elapsed, 0, 1, duration );
-                               self._setScrollPosition( sx + ( dx * ec ), sy + ( dy * ec ) );
-                               self._timerID = setTimeout( tfunc, self._timerInterval );
+                               this._stopMScroll();
                        }
-               };
+               },
 
-               this._timerID = setTimeout( tfunc, this._timerInterval );
-       },
+               _setItems: function () {
+                       var i,
+                               $item;
 
-       getScrollPosition: function() {
-               return { x: -this._rx, y: 0 };
-       },
+                       for ( i = -1; i < this._itemsPerView + 1; i++ ) {
+                               $item = this._$items[ circularNum( i, this._$items.length ) ];
+                               this._$list.append( $item );
+                       }
+                       setElementTransform( this._$view, this._sx + "px", 0 );
+                       this._$view.width( this._itemWidth * ( this._itemsPerView + 2 ) );
+                       this._viewWidth = this._$view.width();
+               },
+
+               _setScrollPosition: function ( x, y ) {
+                       var sx = this._sx,
+                               dx = x - sx,
+                               di = parseInt( dx / this._itemWidth, 10 ),
+                               i,
+                               idx,
+                               $item;
+
+                       if ( di > 0 ) {
+                               for ( i = 0; i < di; i++ ) {
+                                       this._$list.children().last().detach();
+                                       idx = -parseInt( ( sx / this._itemWidth ) + i + 3, 10 );
+                                       $item = this._$items[ circularNum( idx, this._$items.length ) ];
+                                       this._$list.prepend( $item );
+                                       //console.log( "di > 0 : " + idx );
+                               }
+                       } else if ( di < 0 ) {
+                               for ( i = 0; i > di; i-- ) {
+                                       this._$list.children().first().detach();
+                                       idx = this._itemsPerView - parseInt( ( sx / this._itemWidth ) + i, 10 );
+                                       $item = this._$items[ circularNum( idx, this._$items.length ) ];
+                                       this._$list.append( $item );
+                                       //console.log( "di < 0 : " + idx );
+                               }
+                       }
 
-       _handleDragStart: function( e, ex, ey ) {
-               $.each( this._getScrollHierarchy(), function( i, sv ) { 
-                       sv._stopMScroll(); } );
-               this._stopMScroll();
+                       this._sx += di * this._itemWidth;
+
+                       setElementTransform( this._$view, ( x - this._sx - this._itemWidth ) + "px", 0 );
+
+                       //console.log( "rx " + this._rx + "sx " + this._sx );
+               },
+
+               _enableTracking: function () {
+                       $(document).bind( this._dragMoveEvt, this._dragMoveCB );
+                       $(document).bind( this._dragStopEvt, this._dragStopCB );
+               },
+
+               _disableTracking: function () {
+                       $(document).unbind( this._dragMoveEvt, this._dragMoveCB );
+                       $(document).unbind( this._dragStopEvt, this._dragStopCB );
+               },
+
+               _getScrollHierarchy: function () {
+                       var svh = [],
+                               d;
+                       this._$clip.parents( '.ui-scrollview-clip' ).each( function () {
+                               d = $( this ).jqmData( 'circulaview' );
+                               if ( d ) {
+                                       svh.unshift( d );
+                               }
+                       } );
+                       return svh;
+               },
+
+               centerTo: function ( selector ) {
+                       var i,
+                               newX;
+
+                       for ( i = 0; i < this._$items.length; i++ ) {
+                               if ( $( this._$items[i]).is( selector ) ) {
+                                       newX = -( i * this._itemWidth - this._clipWidth / 2 + this._itemWidth * 2 );
+                                       this.scrollTo( newX, 0 );
+                                       console.log( i + "," + newX );
+                                       return;
+                               }
+                       }
+               },
 
-               if ( this.options.delayedClickEnabled ) {
-                       this._$clickEle = $(e.target).closest(this.options.delayedClickSelector);
-               }
-               this._lastX = ex;
-               this._lastY = ey;
-               this._speedX = 0;
-               this._speedY = 0;
-               this._didDrag = false;
-       
-               this._lastMove = 0;
-               this._enableTracking();         
-
-               this._ox = ex;
-               this._nx = this._rx;
-               
-               if ( this.options.eventType == "mouse" || this.options.delayedClickEnabled ) {
-                       e.preventDefault();
-               }
-               //console.log("scrollstart" + this._rx + "," + this._sx );
-               e.stopPropagation();
-       },
+               scrollTo: function ( x, y, duration ) {
+                       this._stopMScroll();
+                       if ( !duration ) {
+                               this._setScrollPosition( x, y );
+                               this._rx = x;
+                               return;
+                       }
+
+                       x = -x;
+                       y = -y;
+
+                       var self = this,
+                               start = getCurrentTime(),
+                               efunc = $.easing.easeOutQuad,
+                               sx = this._rx,
+                               sy = 0,
+                               dx = x - sx,
+                               dy = 0,
+                               tfunc,
+                               elapsed,
+                               ec;
+
+                       tfunc = function () {
+                               elapsed = getCurrentTime() - start;
+                               if ( elapsed >= duration ) {
+                                       self._timerID = 0;
+                                       self._setScrollPosition( x, y );
+                               } else {
+                                       ec = efunc( elapsed / duration, elapsed, 0, 1, duration );
+                                       self._setScrollPosition( sx + ( dx * ec ), sy + ( dy * ec ) );
+                                       self._timerID = setTimeout( tfunc, self._timerInterval );
+                               }
+                       };
+
+                       this._timerID = setTimeout( tfunc, this._timerInterval );
+               },
 
-       _handleDragMove: function( e, ex, ey ) {
-               this._lastMove = getCurrentTime();
+               getScrollPosition: function () {
+                       return { x: -this._rx, y: 0 };
+               },
 
-               var dx = ex - this._lastX;
-               var dy = ey - this._lastY;
-               
-               this._speedX = dx;
-               this._speedY = 0;
+               _handleDragStart: function ( e, ex, ey ) {
+                       $.each( this._getScrollHierarchy(), function ( i, sv ) {
+                               sv._stopMScroll();
+                       } );
 
-               this._didDrag = true;
+                       this._stopMScroll();
 
-               this._lastX = ex;
-               this._lastY = ey;
+                       if ( this.options.delayedClickEnabled ) {
+                               this._$clickEle = $( e.target ).closest( this.options.delayedClickSelector );
+                       }
+                       this._lastX = ex;
+                       this._lastY = ey;
+                       this._speedX = 0;
+                       this._speedY = 0;
+                       this._didDrag = false;
 
-               this._mx = ex - this._ox;
-               
-               this._setScrollPosition( this._nx + this._mx, 0 );
+                       this._lastMove = 0;
+                       this._enableTracking();
 
-               //console.log("scrollmove" + this._rx + "," + this._sx );
-               return false;
-       },
+                       this._ox = ex;
+                       this._nx = this._rx;
 
-       _handleDragStop: function( e ) {
-               var l = this._lastMove;
-               var t = getCurrentTime();
-               var doScroll = l && ( t - l ) <= this.options.moveIntervalThreshold;
+                       if ( this.options.eventType == "mouse" || this.options.delayedClickEnabled ) {
+                               e.preventDefault();
+                       }
+                       //console.log( "scrollstart" + this._rx + "," + this._sx );
+                       e.stopPropagation();
+               },
 
-               var sx = ( this._tracker && this._speedX && doScroll ) ? this._speedX : 0;
-               var sy = 0;
+               _handleDragMove: function ( e, ex, ey ) {
+                       this._lastMove = getCurrentTime();
 
-               this._rx = this._mx ? this._nx + this._mx : this._rx;
+                       var dx = ex - this._lastX,
+                               dy = ey - this._lastY;
 
-               if ( sx ) {
-                       this._startMScroll( sx, sy );
-               }
+                       this._speedX = dx;
+                       this._speedY = 0;
 
-               //console.log("scrollstop" + this._rx + "," + this._sx );
-               
+                       this._didDrag = true;
 
-               this._disableTracking();
+                       this._lastX = ex;
+                       this._lastY = ey;
 
-               if ( !this._didDrag && this.options.delayedClickEnabled && this._$clickEle.length ) {
-                       this._$clickEle
-                               .trigger("mousedown")
-                               .trigger("mouseup")
-                               .trigger("click");
-               }
-        
-        if ( this._didDrag ) {
-            e.preventDefault();
-            e.stopPropagation();
-        }
-
-               return this._didDrag ? false : undefined;
-       },
-
-       _addBehaviors: function() {
-               var self = this;
-               if ( this.options.eventType === "mouse" ) {
-                       this._dragStartEvt = "mousedown";
-                       this._dragStartCB = function(e) { 
-                               return self._handleDragStart( e, e.clientX, e.clientY ); 
-                       };
-                       
-                       this._dragMoveEvt = "mousemove";
-                       this._dragMoveCB = function(e) { 
-                               return self._handleDragMove( e, e.clientX, e.clientY );
-                       };
+                       this._mx = ex - this._ox;
 
-                       this._dragStopEvt = "mouseup";
-                       this._dragStopCB = function(e) {
-                               return self._handleDragStop( e ); 
-                       };
-            
-            this._$view.bind( "vclick", function(e) {
-                return !self._didDrag;
-            });
-            
-               } else { //touch
-                       this._dragStartEvt = "touchstart";
-                       this._dragStartCB = function(e) {
-                               var t = e.originalEvent.targetTouches[0];
-                               return self._handleDragStart(e, t.pageX, t.pageY );
-                       };
+                       this._setScrollPosition( this._nx + this._mx, 0 );
 
-                       this._dragMoveEvt = "touchmove";
-                       this._dragMoveCB = function(e) {
-                               var t = e.originalEvent.targetTouches[0];
-                               return self._handleDragMove(e, t.pageX, t.pageY );
-                       };
+                       //console.log( "scrollmove" + this._rx + "," + this._sx );
+                       return false;
+               },
 
-                       this._dragStopEvt = "touchend";
-                       this._dragStopCB = function(e) {
-                               return self._handleDragStop(e);
-                       };
-               
-        }
-               this._$view.bind( this._dragStartEvt, this._dragStartCB );
-       },
+               _handleDragStop: function ( e ) {
+                       var l = this._lastMove,
+                               t = getCurrentTime(),
+                               doScroll = l && ( t - l ) <= this.options.moveIntervalThreshold,
+                               sx = ( this._tracker && this._speedX && doScroll ) ? this._speedX : 0,
+                               sy = 0;
 
-});
+                       this._rx = this._mx ? this._nx + this._mx : this._rx;
 
-function circularNum( num, total ) {
-               var n = num % total;
-               if ( n < 0 ) {
-                       n = total + n;
-               }               
-               return n;
-}
-
-function setElementTransform( $ele, x, y ) {
-       var v = "translate3d(" + x + "," + y + ", 0px)";
-       $ele.css({
-               "-moz-transform": v,
-               "-webkit-transform": v,
-               "transform": v
-       });
-}
-
-function MomentumTracker(options) {
-       this.options = $.extend( {}, options );
-       this.easing = "easeOutQuad";
-       this.reset();
-}
-
-var tstates = {
-       scrolling : 0,
-       done : 1
-};
-
-function getCurrentTime() { return (new Date()).getTime(); }
-
-$.extend(MomentumTracker.prototype, {
-       start: function( pos, speed, duration ) {
-               this.state = (speed != 0) ? tstates.scrolling : tstates.done;
-               this.pos = pos;
-               this.speed = speed;
-               this.duration = duration;
-               
-               this.fromPos = 0;
-               this.toPos = 0;
-
-               this.startTime = getCurrentTime();
-       }, 
-       
-       reset: function() {
-               this.state = tstates.done;
-               this.pos = 0;
-               this.speed = 0;
-               this.duration = 0;      
-       },
-
-       update: function() {
-               var state = this.state;
-               if ( state == tstates.done ) {
-                       return this.pos;
-               }
+                       if ( sx ) {
+                               this._startMScroll( sx, sy );
+                       }
 
-               var duration = this.duration;
-               var elapsed = getCurrentTime() - this.startTime;
-               elapsed = elapsed > duration ? duration : elapsed;
+                       //console.log( "scrollstop" + this._rx + "," + this._sx );
 
-               var dx = this.speed * ( 1 - $.easing[this.easing](elapsed / duration, elapsed, 0, 1, duration ) );
-               
-               var x = this.pos + dx;
-               this.pos = x;
-               
-               if ( elapsed >= duration ) {
-                       this.state = tstates.done;
-               }
-               
-               return this.pos;
-       }, 
+                       this._disableTracking();
 
-       done: function() { 
-               return this.state == tstates.done; 
-       },
+                       if ( !this._didDrag && this.options.delayedClickEnabled && this._$clickEle.length ) {
+                               this._$clickEle
+                                       .trigger( "mousedown" )
+                                       .trigger( "mouseup" )
+                                       .trigger( "click" );
+                       }
 
-       getPosition: function() { 
-               return this.pos;
-       }
-});
+                       if ( this._didDrag ) {
+                               e.preventDefault();
+                               e.stopPropagation();
+                       }
 
+                       return this._didDrag ? false : undefined;
+               },
+
+               _addBehaviors: function () {
+                       var self = this;
+
+                       if ( this.options.eventType === "mouse" ) {
+                               this._dragStartEvt = "mousedown";
+                               this._dragStartCB = function ( e ) {
+                                       return self._handleDragStart( e, e.clientX, e.clientY );
+                               };
+
+                               this._dragMoveEvt = "mousemove";
+                               this._dragMoveCB = function ( e ) {
+                                       return self._handleDragMove( e, e.clientX, e.clientY );
+                               };
+
+                               this._dragStopEvt = "mouseup";
+                               this._dragStopCB = function ( e ) {
+                                       return self._handleDragStop( e );
+                               };
+
+                               this._$view.bind( "vclick", function (e) {
+                                       return !self._didDrag;
+                               } );
+
+                       } else { //touch
+                               this._dragStartEvt = "touchstart";
+                               this._dragStartCB = function ( e ) {
+                                       var t = e.originalEvent.targetTouches[0];
+                                       return self._handleDragStart(e, t.pageX, t.pageY );
+                               };
+
+                               this._dragMoveEvt = "touchmove";
+                               this._dragMoveCB = function ( e ) {
+                                       var t = e.originalEvent.targetTouches[0];
+                                       return self._handleDragMove(e, t.pageX, t.pageY );
+                               };
+
+                               this._dragStopEvt = "touchend";
+                               this._dragStopCB = function ( e ) {
+                                       return self._handleDragStop( e );
+                               };
+                       }
+                       this._$view.bind( this._dragStartEvt, this._dragStartCB );
+               }
+       } );
 
-$( document ).bind( "pagecreate create", function( e ) {
-       $( $.mobile.circularview.prototype.options.initSelector, e.target ).circularview();
-});
+       $( document ).bind( "pagecreate create", function ( e ) {
+               $( $.mobile.circularview.prototype.options.initSelector, e.target ).circularview();
+       } );
 
-})(jQuery,window,document); // End Component
+}( jQuery, window, document ) ); // End Component
index 27f3598..1743910 100755 (executable)
@@ -6,7 +6,8 @@
  * http://www.opensource.org/licenses/mit-license.php)
  * 
  * ***************************************************************************
- * Copyright (C) 2011 by Intel Corporation Ltd.
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2011 by Intel Corporation Ltd.
  * 
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
  *                $("#mycolorpalette").colorpalette("option", "color", "#ABCDEF");
  *            Default: "#1a8039"
  *
- * APIs:
- *             $('obj').colorpalette() : Make an object to a colorpalette widget.
+ *APIs:
+ *             $('obj').colorpalette() : Make an object to a colorpalette widget.
  *
- * Events:
- *             No event.
+ *Events:
+ *             No event.
  *
- * Examples:
- *             <div data-role="colorpalette" data-color: "#ffffff"></div>
+ *Examples:
+ *             <div data-role="colorpalette" data-color: "#ffffff"></div>
  *
- *             <div id="toBeColorpalette"></div>
- *             <script>
- *                     $("#toBeColorpalette").colorpalette({ color: "#ffffff" });
- *             </script>
+ *             <div id="toBeColorpalette"></div>
+ *             <script>
+ *                     $("#toBeColorpalette").colorpalette({ color: "#ffffff" });
+ *             </script>
  *
  */
 
-(function( $, undefined ) {
-
-$.widget( "tizen.colorpalette", $.tizen.colorwidget, {
-    options: {
-        showPreview: false,
-        initSelector: ":jqmData(role='colorpalette')"
-    },
-
-    _htmlProto: {
-        ui: {
-            clrpalette: "#colorpalette",
-            preview: "#colorpalette-preview",
-            previewContainer: "#colorpalette-preview-container"
-        }
-    },
-
-    _create: function() {
-        var self = this;
-
-        this.element
-            .css("display", "none")
-            .after(this._ui.clrpalette);
-
-        this._ui.clrpalette.find("[data-colorpalette-choice]").bind("vclick", function(e) {
-            var clr = $.tizen.colorwidget.prototype._getElementColor.call(this, $(e.target)),
-                Nix,
-                nChoices = self._ui.clrpalette.attr("data-" + ($.mobile.ns || "") + "n-choices"),
-                choiceId, rgbMatches;
-
-            rgbMatches = clr.match(/rgb\(([0-9]*), *([0-9]*), *([0-9]*)\)/);
-
-            if (rgbMatches && rgbMatches.length > 3)
-                clr = $.tizen.colorwidget.clrlib.RGBToHTML([
-                    parseInt(rgbMatches[1]) / 255,
-                    parseInt(rgbMatches[2]) / 255,
-                    parseInt(rgbMatches[3]) / 255]);
-
-            for (Nix = 0 ; Nix < nChoices ; Nix++)
-                self._ui.clrpalette.find("[data-colorpalette-choice=" + Nix + "]").removeClass("colorpalette-choice-active");
-
-            $(e.target).addClass("colorpalette-choice-active");
-            $.tizen.colorwidget.prototype._setColor.call(self, clr);
-            $.tizen.colorwidget.prototype._setElementColor.call(self, self._ui.preview,
-                $.tizen.colorwidget.clrlib.RGBToHSL($.tizen.colorwidget.clrlib.HTMLToRGB(clr)), "background");
-        });
-    },
-
-    _setShowPreview: function(show) {
-        if (show)
-            this._ui.previewContainer.removeAttr("style");
-        else
-            this._ui.previewContainer.css("display", "none");
-        this.element.attr("data-" + ($.mobile.ns || "") + "show-preview", show);
-        this.options.showPreview = show;
-    },
-
-    widget: function(value) {
-        return this._ui.clrpalette;
-    },
-
-    _setDisabled: function(value) {
-        $.tizen.widgetex.prototype._setDisabled.call(this, value);
-        this._ui.clrpalette[value ? "addClass" : "removeClass"]("ui-disabled");
-        $.tizen.colorwidget.prototype._displayDisabledState.call(this, this._ui.clrpalette);
-    },
-
-    _setColor: function(clr) {
-        if ($.tizen.colorwidget.prototype._setColor.call(this, clr)) {
-            clr = this.options.color;
-            var Nix,
-                activeIdx = -1,
-                nChoices = this._ui.clrpalette.attr("data-" + ($.mobile.ns || "") + "n-choices"),
-                hsl = $.tizen.colorwidget.clrlib.RGBToHSL($.tizen.colorwidget.clrlib.HTMLToRGB(clr)),
-                origHue = hsl[0],
-                offset = hsl[0] / 36,
-                theFloor = Math.floor(offset),
-                newClr;
-
-            $.tizen.colorwidget.prototype._setElementColor.call(this, this._ui.preview,
-                $.tizen.colorwidget.clrlib.RGBToHSL($.tizen.colorwidget.clrlib.HTMLToRGB(clr)), "background");
-
-            offset = (offset - theFloor < 0.5)
-                ? (offset - theFloor)
-                : (offset - (theFloor + 1));
-
-            offset *= 36;
-
-            for (Nix = 0 ; Nix < nChoices ; Nix++) {
-                hsl[0] = Nix * 36 + offset;
-                hsl[0] = ((hsl[0] < 0) ? (hsl[0] + 360) : ((hsl[0] > 360) ? (hsl[0] - 360) : hsl[0]));
-
-                if (hsl[0] === origHue)
-                    activeIdx = Nix;
-
-                newClr = $.tizen.colorwidget.clrlib.RGBToHTML($.tizen.colorwidget.clrlib.HSLToRGB(hsl));
-
-                $.tizen.colorwidget.prototype._setElementColor.call(this, this._ui.clrpalette.find("[data-colorpalette-choice=" + Nix + "]"),
-                    $.tizen.colorwidget.clrlib.RGBToHSL($.tizen.colorwidget.clrlib.HTMLToRGB(newClr)), "background");
-            }
-
-            if (activeIdx != -1) {
-                var currentlyActive = parseInt(this._ui.clrpalette.find(".colorpalette-choice-active").attr("data-" + ($.mobile.ns || "") + "colorpalette-choice"));
-                if (currentlyActive != activeIdx) {
-                    this._ui.clrpalette.find("[data-colorpalette-choice=" + currentlyActive + "]").removeClass("colorpalette-choice-active");
-                    this._ui.clrpalette.find("[data-colorpalette-choice=" + activeIdx + "]").addClass("colorpalette-choice-active");
-                }
-            }
-        }
-    }
-});
-
-$(document).bind("pagecreate create", function(e) {
-    $($.tizen.colorpalette.prototype.options.initSelector, e.target)
-        .not(":jqmData(role='none'), :jqmData(role='nojs')")
-        .colorpalette();
-});
-
-})( jQuery );
+( function ( $, undefined ) {
+
+       $.widget( "tizen.colorpalette", $.tizen.colorwidget, {
+               options: {
+                       showPreview: false,
+                       initSelector: ":jqmData(role='colorpalette')"
+               },
+
+               _htmlProto: {
+                       ui: {
+                               clrpalette: "#colorpalette",
+                               preview: "#colorpalette-preview",
+                               previewContainer: "#colorpalette-preview-container"
+                       }
+               },
+
+               _create: function () {
+                       var self = this;
+
+                       this.element
+                               .css( "display", "none" )
+                               .after( this._ui.clrpalette );
+
+                       this._ui.clrpalette.find( "[data-colorpalette-choice]" ).bind( "vclick", function ( e ) {
+                               var clr = $.tizen.colorwidget.prototype._getElementColor.call(this, $(e.target)),
+                                       Nix,
+                                       nChoices = self._ui.clrpalette.attr( "data-" + ( $.mobile.ns || "" ) + "n-choices" ),
+                                       choiceId,
+                                       rgbMatches;
+
+                               rgbMatches = clr.match(/rgb\(([0-9]*), *([0-9]*), *([0-9]*)\)/);
+
+                               if ( rgbMatches && rgbMatches.length > 3 ) {
+                                       clr = $.tizen.colorwidget.clrlib.RGBToHTML( [
+                                               parseInt(rgbMatches[1], 10) / 255,
+                                               parseInt(rgbMatches[2], 10) / 255,
+                                               parseInt(rgbMatches[3], 10) / 255] );
+                               }
+
+                               for ( Nix = 0 ; Nix < nChoices ; Nix++ ) {
+                                       self._ui.clrpalette.find( "[data-colorpalette-choice=" + Nix + "]" ).removeClass( "colorpalette-choice-active" );
+                               }
+
+                               $(e.target).addClass( "colorpalette-choice-active" );
+                               $.tizen.colorwidget.prototype._setColor.call( self, clr );
+                               $.tizen.colorwidget.prototype._setElementColor.call( self, self._ui.preview, $.tizen.colorwidget.clrlib.RGBToHSL( $.tizen.colorwidget.clrlib.HTMLToRGB( clr ) ), "background" );
+                       } );
+               },
+
+               _setShowPreview: function ( show ) {
+                       if ( show ) {
+                               this._ui.previewContainer.removeAttr( "style" );
+                       } else {
+                               this._ui.previewContainer.css( "display", "none" );
+                       }
+
+                       this.element.attr( "data-" + ( $.mobile.ns || "" ) + "show-preview", show );
+                       this.options.showPreview = show;
+               },
+
+               widget: function ( value ) {
+                       return this._ui.clrpalette;
+               },
+
+               _setDisabled: function ( value ) {
+                       $.tizen.widgetex.prototype._setDisabled.call( this, value );
+                       this._ui.clrpalette[value ? "addClass" : "removeClass"]( "ui-disabled" );
+                       $.tizen.colorwidget.prototype._displayDisabledState.call( this, this._ui.clrpalette );
+               },
+
+               _setColor: function ( clr ) {
+                       if ( $.tizen.colorwidget.prototype._setColor.call( this, clr ) ) {
+                               clr = this.options.color;
+
+                               var Nix,
+                                       activeIdx = -1,
+                                       nChoices = this._ui.clrpalette.attr( "data-" + ( $.mobile.ns || "" ) + "n-choices" ),
+                                       hsl = $.tizen.colorwidget.clrlib.RGBToHSL( $.tizen.colorwidget.clrlib.HTMLToRGB( clr ) ),
+                                       origHue = hsl[0],
+                                       offset = hsl[0] / 36,
+                                       theFloor = Math.floor( offset ),
+                                       newClr,
+                                       currentlyActive;
+
+                               $.tizen.colorwidget.prototype._setElementColor.call( this, this._ui.preview,
+                                               $.tizen.colorwidget.clrlib.RGBToHSL( $.tizen.colorwidget.clrlib.HTMLToRGB( clr ) ), "background" );
+
+                               offset = ( offset - theFloor < 0.5 )
+                                       ? ( offset - theFloor )
+                                       : ( offset - ( theFloor + 1 ) );
+
+                               offset *= 36;
+
+                               for ( Nix = 0 ; Nix < nChoices ; Nix++ ) {
+                                       hsl[0] = Nix * 36 + offset;
+                                       hsl[0] = ( ( hsl[0] < 0) ? ( hsl[0] + 360 ) : ( ( hsl[0] > 360 ) ? ( hsl[0] - 360 ) : hsl[0] ) );
+
+                                       if ( hsl[0] === origHue ) {
+                                               activeIdx = Nix;
+                                       }
+
+                                       newClr = $.tizen.colorwidget.clrlib.RGBToHTML( $.tizen.colorwidget.clrlib.HSLToRGB( hsl ) );
+
+                                       $.tizen.colorwidget.prototype._setElementColor.call( this, this._ui.clrpalette.find( "[data-colorpalette-choice=" + Nix + "]" ),
+                                                       $.tizen.colorwidget.clrlib.RGBToHSL( $.tizen.colorwidget.clrlib.HTMLToRGB( newClr ) ), "background" );
+                               }
+
+                               if (activeIdx != -1) {
+                                       currentlyActive = parseInt( this._ui.clrpalette.find( ".colorpalette-choice-active" ).attr( "data-" + ($.mobile.ns || "" ) + "colorpalette-choice" ), 10 );
+                                       if ( currentlyActive != activeIdx ) {
+                                               this._ui.clrpalette.find( "[data-colorpalette-choice=" + currentlyActive + "]" ).removeClass( "colorpalette-choice-active" );
+                                               this._ui.clrpalette.find( "[data-colorpalette-choice=" + activeIdx + "]" ).addClass( "colorpalette-choice-active" );
+                                       }
+                               }
+                       }
+               }
+       });
+
+       $( document ).bind( "pagecreate create", function ( e ) {
+               $( $.tizen.colorpalette.prototype.options.initSelector, e.target )
+                       .not( ":jqmData(role='none'), :jqmData(role='nojs')" )
+                       .colorpalette();
+       });
+
+}( jQuery ) );
\ No newline at end of file
index 05c3cc9..e8f5cfe 100755 (executable)
@@ -5,7 +5,8 @@
  * http://www.opensource.org/licenses/mit-license.php)
  * 
  * ***************************************************************************
- * Copyright (C) 2011 by Intel Corporation Ltd.
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2011 by Intel Corporation Ltd.
  * 
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
 // element inside a page. Alternatively, call colorpicker() 
 // on an element (see below).
 //
-// Options:
-//     color: String; can be specified in html using the
-//            data-color="#ff00ff" attribute or when constructed
-//                $("#mycolorpicker").colorpicker({ color: "#ff00ff" });
-//            where the html might be :
-//                <div id="mycolorpicker"/>
-
-(function( $, undefined ) {
-
-$.widget( "tizen.colorpicker", $.tizen.colorwidget, {
-    options: {
-        initSelector: ":jqmData(role='colorpicker')"
-    },
-
-    _htmlProto: {
-        ui: {
-            clrpicker: "#colorpicker",
-            hs: {
-                hueGradient: "#colorpicker-hs-hue-gradient",
-                gradient:    "#colorpicker-hs-sat-gradient",
-                eventSource: "[data-event-source='hs']",
-                valMask:     "#colorpicker-hs-val-mask",
-                selector:    "#colorpicker-hs-selector"
-            },
-            l: {
-                gradient:    "#colorpicker-l-gradient",
-                eventSource: "[data-event-source='l']",
-                selector:    "#colorpicker-l-selector"
-            }
-        }
-    },
-
-    _create: function() {
-        var self = this;
-
-        this.element
-            .css("display", "none")
-            .after(this._ui.clrpicker);
-
-        this._ui.hs.hueGradient.huegradient();
-
-        $.extend( self, {
-            dragging: false,
-            draggingHS: false,
-            selectorDraggingOffset: {
-                x : -1,
-                y : -1
-            },
-            dragging_hsl: undefined
-        });
-
-        $( document )
-            .bind( "vmousemove", function( event ) {
-                if ( self.dragging ) {
-                    event.stopPropagation();
-                    event.preventDefault();
-                }
-            })
-            .bind( "vmouseup", function( event ) {
-                if ( self.dragging )
-                    self.dragging = false;
-            });
-
-        this._bindElements("hs");
-        this._bindElements("l");
-    },
-
-    _bindElements: function(which) {
-        var self = this,
-            stopDragging = function(event) {
-                self.dragging = false;
-                event.stopPropagation();
-                event.preventDefault();
-            };
-
-        this._ui[which].eventSource
-            .bind( "vmousedown mousedown", function (event) { self._handleMouseDown(event, which, false); })
-            .bind( "vmousemove"          , function (event) { self._handleMouseMove(event, which, false); })
-            .bind( "vmouseup"            , stopDragging);
-
-        this._ui[which].selector
-            .bind( "vmousedown mousedown", function (event) { self._handleMouseDown(event, which, true); })
-            .bind( "touchmove vmousemove", function (event) { self._handleMouseMove(event, which, true); })
-            .bind( "vmouseup"            , stopDragging);
-    },
-
-    _handleMouseDown: function(event, containerStr, isSelector) {
-        var coords = $.mobile.tizen.targetRelativeCoordsFromEvent(event),
-            widgetStr = isSelector ? "selector" : "eventSource";
-        if ((coords.x >= 0 && coords.x <= this._ui[containerStr][widgetStr].width() &&
-             coords.y >= 0 && coords.y <= this._ui[containerStr][widgetStr].height()) || isSelector) {
-            this.dragging = true;
-            this.draggingHS = ("hs" === containerStr);
-
-            if (isSelector) {
-                this.selectorDraggingOffset.x = coords.x;
-                this.selectorDraggingOffset.y = coords.y;
-            }
-
-            this._handleMouseMove(event, containerStr, isSelector, coords);
-        }
-    },
-
-    _handleMouseMove: function(event, containerStr, isSelector, coords) {
-        if (this.dragging &&
-            !(( this.draggingHS && containerStr === "l") || 
-              (!this.draggingHS && containerStr === "hs"))) {
-            coords = (coords || $.mobile.tizen.targetRelativeCoordsFromEvent(event));
-
-            if (this.draggingHS) {
-                var potential_h = isSelector
-                      ? this.dragging_hsl[0] / 360 + (coords.x - this.selectorDraggingOffset.x) / this._ui[containerStr].eventSource.width()
-                      : coords.x / this._ui[containerStr].eventSource.width(),
-                    potential_s = isSelector
-                      ? this.dragging_hsl[1]       + (coords.y - this.selectorDraggingOffset.y) / this._ui[containerStr].eventSource.height()
-                      : coords.y / this._ui[containerStr].eventSource.height();
-
-                this.dragging_hsl[0] = Math.min(1.0, Math.max(0.0, potential_h)) * 360;
-                this.dragging_hsl[1] = Math.min(1.0, Math.max(0.0, potential_s));
-            }
-            else {
-                var potential_l = isSelector
-                      ? this.dragging_hsl[2]       + (coords.y - this.selectorDraggingOffset.y) / this._ui[containerStr].eventSource.height()
-                      : coords.y / this._ui[containerStr].eventSource.height();
-
-                this.dragging_hsl[2] = Math.min(1.0, Math.max(0.0, potential_l));
-            }
-
-            if (!isSelector) {
-                this.selectorDraggingOffset.x = Math.ceil(this._ui[containerStr].selector.outerWidth()  / 2.0);
-                this.selectorDraggingOffset.y = Math.ceil(this._ui[containerStr].selector.outerHeight() / 2.0);
-            }
-
-            this._updateSelectors(this.dragging_hsl);
-            event.stopPropagation();
-            event.preventDefault();
-        }
-    },
-
-    _updateSelectors: function(hsl) {
-        var clr = $.tizen.colorwidget.prototype._setElementColor.call(this, this._ui.hs.selector, [hsl[0], 1.0 - hsl[1], hsl[2]], "background").clr,
-            gray = $.tizen.colorwidget.clrlib.RGBToHTML([hsl[2], hsl[2], hsl[2]]);
-
-        this._ui.hs.valMask.css((hsl[2] < 0.5)
-            ? { background : "#000000" , opacity : (1.0 - hsl[2] * 2.0)   }
-            : { background : "#ffffff" , opacity : ((hsl[2] - 0.5) * 2.0) });
-        this._ui.hs.selector.css({
-            left       : (hsl[0] / 360 * this._ui.hs.eventSource.width()),
-            top        : (hsl[1] * this._ui.hs.eventSource.height()),
-        });
-        this._ui.l.selector.css({
-            top        : (hsl[2] * this._ui.l.eventSource.height()),
-            background : gray
-        });
-        $.tizen.colorwidget.prototype._setColor.call(this, clr);
-    },
-
-    widget: function() { return this._ui.clrpicker; },
-
-    _setDisabled: function(value) {
-        $.tizen.widgetex.prototype._setDisabled.call(this, value);
-        this._ui.hs.hueGradient.huegradient("option", "disabled", value);
-        this._ui.clrpicker[value ? "addClass" : "removeClass"]("ui-disabled");
-        $.tizen.colorwidget.prototype._displayDisabledState.call(this, this._ui.clrpicker);
-    },
-
-    _setColor: function(clr) {
-        if ($.tizen.colorwidget.prototype._setColor.call(this, clr)) {
-            this.dragging_hsl = $.tizen.colorwidget.clrlib.RGBToHSL($.tizen.colorwidget.clrlib.HTMLToRGB(this.options.color));
-            this.dragging_hsl[1] = 1.0 - this.dragging_hsl[1];
-            this._updateSelectors(this.dragging_hsl);
-        }
-    }
-});
-
-$(document).bind("pagecreate create", function(e) {
-    $($.tizen.colorpicker.prototype.options.initSelector, e.target)
-        .not(":jqmData(role='none'), :jqmData(role='nojs')")
-        .colorpicker();
-});
-
-})(jQuery);
+//Options:
+//     color: String; can be specified in html using the
+//             data-color="#ff00ff" attribute or when constructed
+//                     $("#mycolorpicker").colorpicker({ color: "#ff00ff" });
+//             where the html might be :
+//                     <div id="mycolorpicker"/>
+
+(function ( $, undefined ) {
+
+       $.widget( "tizen.colorpicker", $.tizen.colorwidget, {
+               options: {
+                       initSelector: ":jqmData(role='colorpicker')"
+               },
+
+               _htmlProto: {
+                       ui: {
+                               clrpicker: "#colorpicker",
+                               hs: {
+                                       hueGradient: "#colorpicker-hs-hue-gradient",
+                                       gradient:    "#colorpicker-hs-sat-gradient",
+                                       eventSource: "[data-event-source='hs']",
+                                       valMask:     "#colorpicker-hs-val-mask",
+                                       selector:    "#colorpicker-hs-selector"
+                               },
+                               l: {
+                                       gradient:    "#colorpicker-l-gradient",
+                                       eventSource: "[data-event-source='l']",
+                                       selector:    "#colorpicker-l-selector"
+                               }
+                       }
+               },
+
+               _create: function () {
+                       var self = this;
+
+                       this.element
+                               .css( "display", "none" )
+                               .after( this._ui.clrpicker );
+
+                       this._ui.hs.hueGradient.huegradient();
+
+                       $.extend( self, {
+                               dragging: false,
+                               draggingHS: false,
+                               selectorDraggingOffset: {
+                                       x : -1,
+                                       y : -1
+                               },
+                               dragging_hsl: undefined
+                       } );
+
+                       $( document )
+                               .bind( "vmousemove", function ( event ) {
+                                       if ( self.dragging ) {
+                                               event.stopPropagation();
+                                               event.preventDefault();
+                                       }
+                               } )
+                               .bind( "vmouseup", function ( event ) {
+                                       if ( self.dragging ) {
+                                               self.dragging = false;
+                                       }
+                               } );
+
+                       this._bindElements( "hs" );
+                       this._bindElements( "l" );
+               },
+
+               _bindElements: function ( which ) {
+                       var self = this,
+                               stopDragging = function ( event ) {
+                                       self.dragging = false;
+                                       event.stopPropagation();
+                                       event.preventDefault();
+                               };
+
+                       this._ui[which].eventSource
+                               .bind( "vmousedown mousedown", function ( event ) { self._handleMouseDown( event, which, false ); } )
+                               .bind( "vmousemove"          , function ( event ) { self._handleMouseMove( event, which, false ); } )
+                               .bind( "vmouseup"            , stopDragging );
+
+                       this._ui[which].selector
+                               .bind( "vmousedown mousedown", function ( event ) { self._handleMouseDown( event, which, true); } )
+                               .bind( "touchmove vmousemove", function ( event ) { self._handleMouseMove( event, which, true); } )
+                               .bind( "vmouseup"            , stopDragging );
+               },
+
+               _handleMouseDown: function ( event, containerStr, isSelector ) {
+                       var coords = $.mobile.tizen.targetRelativeCoordsFromEvent( event ),
+                               widgetStr = isSelector ? "selector" : "eventSource";
+                       if ( ( coords.x >= 0 && coords.x <= this._ui[containerStr][widgetStr].width() &&
+                                       coords.y >= 0 && coords.y <= this._ui[containerStr][widgetStr].height() ) || isSelector ) {
+                               this.dragging = true;
+                               this.draggingHS = ( "hs" === containerStr );
+
+                               if ( isSelector ) {
+                                       this.selectorDraggingOffset.x = coords.x;
+                                       this.selectorDraggingOffset.y = coords.y;
+                               }
+
+                               this._handleMouseMove( event, containerStr, isSelector, coords );
+                       }
+               },
+
+               _handleMouseMove: function ( event, containerStr, isSelector, coords ) {
+                       var potential_h,
+                               potential_s,
+                               potential_l;
+
+                       if ( this.dragging &&
+                                       !( ( this.draggingHS && containerStr === "l" ) ||
+                                               ( !this.draggingHS && containerStr === "hs" ) ) ) {
+                               coords = ( coords || $.mobile.tizen.targetRelativeCoordsFromEvent( event ) );
+
+                               if ( this.draggingHS ) {
+                                       potential_h = isSelector
+                                               ? this.dragging_hsl[0] / 360 + ( coords.x - this.selectorDraggingOffset.x ) / this._ui[containerStr].eventSource.width()
+                                               : coords.x / this._ui[containerStr].eventSource.width();
+                                       potential_s = isSelector
+                                               ? this.dragging_hsl[1] + ( coords.y - this.selectorDraggingOffset.y ) / this._ui[containerStr].eventSource.height()
+                                               : coords.y / this._ui[containerStr].eventSource.height();
+
+                                       this.dragging_hsl[0] = Math.min( 1.0, Math.max( 0.0, potential_h ) ) * 360;
+                                       this.dragging_hsl[1] = Math.min( 1.0, Math.max( 0.0, potential_s ) );
+                               } else {
+                                       potential_l = isSelector
+                                               ? this.dragging_hsl[2] + ( coords.y - this.selectorDraggingOffset.y ) / this._ui[containerStr].eventSource.height()
+                                               : coords.y / this._ui[containerStr].eventSource.height();
+
+                                       this.dragging_hsl[2] = Math.min( 1.0, Math.max( 0.0, potential_l ) );
+                               }
+
+                               if ( !isSelector ) {
+                                       this.selectorDraggingOffset.x = Math.ceil( this._ui[containerStr].selector.outerWidth()  / 2.0 );
+                                       this.selectorDraggingOffset.y = Math.ceil( this._ui[containerStr].selector.outerHeight() / 2.0 );
+                               }
+
+                               this._updateSelectors( this.dragging_hsl );
+                               event.stopPropagation();
+                               event.preventDefault();
+                       }
+               },
+
+               _updateSelectors: function ( hsl ) {
+                       var clr = $.tizen.colorwidget.prototype._setElementColor.call( this, this._ui.hs.selector, [hsl[0], 1.0 - hsl[1], hsl[2]], "background" ).clr,
+                               gray = $.tizen.colorwidget.clrlib.RGBToHTML( [hsl[2], hsl[2], hsl[2]] );
+
+                       this._ui.hs.valMask.css((hsl[2] < 0.5)
+                               ? { background : "#000000" , opacity : ( 1.0 - hsl[2] * 2.0 )   }
+                               : { background : "#ffffff" , opacity : ( ( hsl[2] - 0.5 ) * 2.0 ) } );
+                       this._ui.hs.selector.css( {
+                               left : ( hsl[0] / 360 * this._ui.hs.eventSource.width() ),
+                               top : ( hsl[1] * this._ui.hs.eventSource.height() )
+                       });
+                       this._ui.l.selector.css({
+                               top : ( hsl[2] * this._ui.l.eventSource.height() ),
+                               background : gray
+                       } );
+                       $.tizen.colorwidget.prototype._setColor.call( this, clr );
+               },
+
+               widget: function () { return this._ui.clrpicker; },
+
+               _setDisabled: function ( value ) {
+                       $.tizen.widgetex.prototype._setDisabled.call( this, value );
+                       this._ui.hs.hueGradient.huegradient( "option", "disabled", value );
+                       this._ui.clrpicker[value ? "addClass" : "removeClass"]( "ui-disabled" );
+                       $.tizen.colorwidget.prototype._displayDisabledState.call( this, this._ui.clrpicker );
+               },
+
+               _setColor: function ( clr ) {
+                       if ( $.tizen.colorwidget.prototype._setColor.call( this, clr ) ) {
+                               this.dragging_hsl = $.tizen.colorwidget.clrlib.RGBToHSL( $.tizen.colorwidget.clrlib.HTMLToRGB( this.options.color ) );
+                               this.dragging_hsl[1] = 1.0 - this.dragging_hsl[1];
+                               this._updateSelectors( this.dragging_hsl );
+                       }
+               }
+       } );
+
+       $( document ).bind( "pagecreate create", function ( e ) {
+               $( $.tizen.colorpicker.prototype.options.initSelector, e.target )
+                       .not( ":jqmData(role='none'), :jqmData(role='nojs')" )
+                       .colorpicker();
+       } );
+
+}( jQuery ) );
\ No newline at end of file
index b0a35e9..a24d835 100755 (executable)
@@ -1,14 +1,15 @@
 /*
  * jQuery Mobile Widget @VERSION
  *
- * This software is licensed under the MIT licence (as defined by the OSI at
- * http://www.opensource.org/licenses/mit-license.php)
+ * This software is licensed under the MIT licence ( as defined by the OSI at
+ * http://www.opensource.org/licenses/mit-license.php )
  *
  * ***************************************************************************
- * Copyright (C) 2011 by Intel Corporation Ltd.
+ * Copyright ( c ) 2000 - 2011 Samsung Electronics Co., Ltd.
+ * Copyright ( c ) 2011 by Intel Corporation Ltd.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
+ * copy of this software and associated documentation files ( the "Software" ),
  * to deal in the Software without restriction, including without limitation
  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  * and/or sell copies of the Software, and to permit persons to whom the
 //
 // Options:
 //
-//     color: String; color displayed on the button and the base color
-//            of the hsvpicker (see hsvpicker).
-//            initial color can be specified in html using the
-//            data-color="#ff00ff" attribute or when constructed in
-//            javascript, eg :
-//                $("#mycolorpickerbutton").colorpickerbutton({ color: "#ff00ff" });
-//            where the html might be :
-//                <div id="colorpickerbutton"></div>
-//            The color can be changed post-construction like this :
-//                $("#mycolorpickerbutton").colorpickerbutton("option", "color", "#ABCDEF");
-//            Default: "#1a8039"
+//   color: String; color displayed on the button and the base color
+//      of the hsvpicker ( see hsvpicker ).
+//      initial color can be specified in html using the
+//      data-color="#ff00ff" attribute or when constructed in
+//      javascript, eg :
+//        $( "#mycolorpickerbutton" ).colorpickerbutton( { color: "#ff00ff" } );
+//      where the html might be :
+//        <div id="colorpickerbutton"></div>
+//      The color can be changed post-construction like this :
+//        $( "#mycolorpickerbutton" ).colorpickerbutton( "option", "color", "#ABCDEF" );
+//      Default: "#1a8039"
 //
-//     buttonMarkup: String; markup to use for the close button on the popupwindow, eg :
-//                   $("#mycolorpickerbutton").colorpickerbutton("option","buttonMarkup",
-//                     "<a href='#' data-role='button'>ignored</a>");
+//   buttonMarkup: String; markup to use for the close button on the popupwindow, eg :
+//          $( "#mycolorpickerbutton" ).colorpickerbutton( "option","buttonMarkup",
+//           "<a href='#' data-role='button'>ignored</a>" );
 //
-//     closeText: String; the text to display on the close button on the popupwindow.
-//                The text set in the buttonMarkup will be ignored and this used instead.
+//   closeText: String; the text to display on the close button on the popupwindow.
+//        The text set in the buttonMarkup will be ignored and this used instead.
 //
 // Events:
 //
-//     colorchanged: emitted when the color has been changed and the popupwindow is closed.
-
-(function($, undefined) {
-
-$.widget("tizen.colorpickerbutton", $.tizen.colorwidget, {
-    options: {
-        buttonMarkup: {
-            theme: null,
-            inline: true,
-            corners: true,
-            shadow: true
-        },
-        hideInput: true,
-        closeText: "Close",
-        initSelector: "input[type='color'], :jqmData(type='color'), :jqmData(role='colorpickerbutton')"
-    },
-
-    _htmlProto: {
-        ui: {
-            button:          "#colorpickerbutton-button",
-            buttonContents:  "#colorpickerbutton-button-contents",
-            popup:           "#colorpickerbutton-popup-container",
-            hsvpicker:       "#colorpickerbutton-popup-hsvpicker",
-            closeButton:     "#colorpickerbutton-popup-close-button",
-            closeButtonText: "#colorpickerbutton-popup-close-button-text"
-        }
-    },
-
-    _create: function() {
-        var self = this;
-
-        this.element
-            .css("display", "none")
-            .after(this._ui.button);
-
-        /* Tear apart the proto */
-        this._ui.popup.insertBefore(this.element).popupwindow();
-        this._ui.hsvpicker.hsvpicker();
-
-        $.tizen.popupwindow.bindPopupToButton(this._ui.button, this._ui.popup);
-
-        this._ui.closeButton.bind("vclick", function(event) {
-            self._setColor(self._ui.hsvpicker.hsvpicker("option", "color"));
-            self.close();
-        });
-
-        this.element.bind("change keyup blur", function() {
-            self._setColor(self.element.val());
-        });
-    },
-
-    _setHideInput: function(value) {
-        this.element[value ? "addClass" : "removeClass"]("ui-colorpickerbutton-input-hidden");
-        this.element[value ? "removeClass" : "addClass"]("ui-colorpickerbutton-input");
-        this.element.attr("data-" + ($.mobile.ns || "") + "hide-input", value);
-    },
-
-    _setColor: function(clr) {
-        if ($.tizen.colorwidget.prototype._setColor.call(this, clr)) {
-            var clrlib = $.tizen.colorwidget.clrlib;
-
-            this._ui.hsvpicker.hsvpicker("option", "color", this.options.color);
-            $.tizen.colorwidget.prototype._setElementColor.call(this, this._ui.buttonContents, 
-                clrlib.RGBToHSL(clrlib.HTMLToRGB(this.options.color)), "color");
-        }
-    },
-
-    _setButtonMarkup: function(value) {
-        this._ui.button.buttonMarkup(value);
-        this.options.buttonMarkup = value;
-        value["inline"] = false;
-        this._ui.closeButton.buttonMarkup(value);
-    },
-
-    _setCloseText: function(value) {
-        this._ui.closeButtonText.text(value);
-        this.options.closeText = value;
-        this.element.attr("data-" + ($.mobile.ns || "") + "close-text", value);
-    },
-
-    _setDisabled: function(value) {
-        $.tizen.widgetex.prototype._setDisabled.call(this, value);
-        this._ui.popup.popupwindow("option", "disabled", value);
-        this._ui.button[value ? "addClass" : "removeClass"]("ui-disabled");
-        $.tizen.colorwidget.prototype._displayDisabledState.call(this, this._ui.button);
-    },
-
-    open: function() {
-        this._ui.popup.popupwindow("open",
-            this._ui.button.offset().left + this._ui.button.outerWidth()  / 2,
-            this._ui.button.offset().top  + this._ui.button.outerHeight() / 2);
-    },
-
-    _focusButton : function(){
-        var self = this;
-        setTimeout(function() {
-            self._ui.button.focus();
-        }, 40);
-    },
-
-    close: function() {
-        this._focusButton();
-        this._ui.popup.popupwindow("close");
-    }
-});
+//   colorchanged: emitted when the color has been changed and the popupwindow is closed.
+
+( function ( $, undefined ) {
+
+       $.widget( "tizen.colorpickerbutton", $.tizen.colorwidget, {
+               options: {
+                       buttonMarkup: {
+                               theme: null,
+                               inline: true,
+                               corners: true,
+                               shadow: true
+                       },
+                       hideInput: true,
+                       closeText: "Close",
+                       initSelector: "input[type='color'], :jqmData(type='color'), :jqmData(role='colorpickerbutton')"
+               },
+
+               _htmlProto: {
+                       ui: {
+                               button: "#colorpickerbutton-button",
+                               buttonContents: "#colorpickerbutton-button-contents",
+                               popup: "#colorpickerbutton-popup-container",
+                               hsvpicker: "#colorpickerbutton-popup-hsvpicker",
+                               closeButton: "#colorpickerbutton-popup-close-button",
+                               closeButtonText: "#colorpickerbutton-popup-close-button-text"
+                       }
+               },
+
+               _create: function () {
+                       var self = this;
+
+                       this.element
+                               .css( "display", "none" )
+                               .after( this._ui.button );
+
+                       /* Tear apart the proto */
+                       this._ui.popup.insertBefore( this.element ).popupwindow();
+                       this._ui.hsvpicker.hsvpicker();
+
+                       $.tizen.popupwindow.bindPopupToButton( this._ui.button, this._ui.popup );
+
+                       this._ui.closeButton.bind( "vclick", function ( event ) {
+                               self._setColor( self._ui.hsvpicker.hsvpicker( "option", "color" ) );
+                               self.close();
+                       } );
+
+                       this.element.bind( "change keyup blur", function () {
+                               self._setColor( self.element.val() );
+                       } );
+               },
+
+               _setHideInput: function ( value ) {
+                       this.element[value ? "addClass" : "removeClass"]( "ui-colorpickerbutton-input-hidden" );
+                       this.element[value ? "removeClass" : "addClass"]( "ui-colorpickerbutton-input" );
+                       this.element.attr( "data-" + ( $.mobile.ns || "" ) + "hide-input", value );
+               },
+
+               _setColor: function ( clr ) {
+                       if ( $.tizen.colorwidget.prototype._setColor.call( this, clr ) ) {
+                               var clrlib = $.tizen.colorwidget.clrlib;
+
+                               this._ui.hsvpicker.hsvpicker( "option", "color", this.options.color );
+                               $.tizen.colorwidget.prototype._setElementColor.call( this, this._ui.buttonContents,
+                                               clrlib.RGBToHSL( clrlib.HTMLToRGB( this.options.color ) ), "color" );
+                       }
+               },
+
+               _setButtonMarkup: function ( value ) {
+                       this._ui.button.buttonMarkup( value );
+                       this.options.buttonMarkup = value;
+                       value.inline = false;
+                       this._ui.closeButton.buttonMarkup( value );
+               },
+
+               _setCloseText: function ( value ) {
+                       this._ui.closeButtonText.text( value );
+                       this.options.closeText = value;
+                       this.element.attr( "data-" + ( $.mobile.ns || "" ) + "close-text", value );
+               },
+
+               _setDisabled: function ( value ) {
+                       $.tizen.widgetex.prototype._setDisabled.call( this, value );
+                       this._ui.popup.popupwindow( "option", "disabled", value );
+                       this._ui.button[value ? "addClass" : "removeClass"]( "ui-disabled" );
+                       $.tizen.colorwidget.prototype._displayDisabledState.call( this, this._ui.button );
+               },
+
+               open: function () {
+                       this._ui.popup.popupwindow( "open",
+                                       this._ui.button.offset().left + this._ui.button.outerWidth() / 2,
+                                       this._ui.button.offset().top + this._ui.button.outerHeight() / 2 );
+               },
+
+               _focusButton : function () {
+                       var self = this;
+                       setTimeout( function () {
+                               self._ui.button.focus();
+                       }, 40 );
+               },
+
+               close: function () {
+                       this._focusButton();
+                       this._ui.popup.popupwindow( "close" );
+               }
+       } );
 
 //auto self-init widgets
-$(document).bind("pagecreate create", function(e) {
-    $($.tizen.colorpickerbutton.prototype.options.initSelector, e.target)
-        .not(":jqmData(role='none'), :jqmData(role='nojs')")
-        .colorpickerbutton();
-});
+       $( document ).bind( "pagecreate create", function ( e ) {
+               $( $.tizen.colorpickerbutton.prototype.options.initSelector, e.target )
+                       .not( ":jqmData(role='none'), :jqmData(role='nojs')" )
+                       .colorpickerbutton();
+       } );
 
-})(jQuery);
+}( jQuery ) );
\ No newline at end of file
index c8ff03a..3536ea0 100755 (executable)
 //                $("#mycolortitle").colortitle("option", "color", "#ABCDEF");
 //            Default: "#1a8039".
 
-(function( $, undefined ) {
+(function ( $, undefined ) {
 
-$.widget( "tizen.colortitle", $.tizen.colorwidget, {
-    options: {
-        initSelector: ":jqmData(role='colortitle')"
-    },
+       $.widget( "tizen.colortitle", $.tizen.colorwidget, {
+               options: {
+                       initSelector: ":jqmData(role='colortitle')"
+               },
 
-    _htmlProto: {
-        ui: {
-            clrtitle: "#colortitle",
-            header:   "#colortitle-string"
-        }
-    },
+               _htmlProto: {
+                       ui: {
+                               clrtitle: "#colortitle",
+                               header:   "#colortitle-string"
+                       }
+               },
 
-    _create: function() {
-        this.element
-            .css("display", "none")
-            .after(this._ui.clrtitle);
+               _create: function () {
+                       this.element
+                               .css( "display", "none" )
+                               .after( this._ui.clrtitle );
 
-    },
+               },
 
-    widget: function() { return this._ui.clrtitle; },
+               widget: function () { return this._ui.clrtitle; },
 
-    _setDisabled: function(value) {
-        $.tizen.widgetex.prototype._setDisabled.call(this, value);
-        this._ui.clrtitle[value ? "addClass" : "removeClass"]("ui-disabled");
-    },
+               _setDisabled: function ( value ) {
+                       $.tizen.widgetex.prototype._setDisabled.call( this, value );
+                       this._ui.clrtitle[value ? "addClass" : "removeClass"]( "ui-disabled" );
+               },
 
-    _setColor: function(clr) {
-        if ($.tizen.colorwidget.prototype._setColor.call(this, clr)) {
-            this._ui.header.text(this.options.color);
-            $(this._ui.header).parent().css("color", this.options.color);
-        }
-    }
-});
+               _setColor: function ( clr ) {
+                       if ( $.tizen.colorwidget.prototype._setColor.call( this, clr ) ) {
+                               this._ui.header.text( this.options.color );
+                               $( this._ui.header ).parent().css( "color", this.options.color );
+                       }
+               }
+       } );
 
-$(document).bind("pagecreate create", function(e) {
-    $($.tizen.colortitle.prototype.options.initSelector, e.target)
-        .not(":jqmData(role='none'), :jqmData(role='nojs')")
-        .colortitle();
-});
+       $( document ).bind( "pagecreate create", function ( e ) {
+               $( $.tizen.colortitle.prototype.options.initSelector, e.target )
+                       .not( ":jqmData(role='none'), :jqmData(role='nojs')" )
+                       .colortitle();
+       } );
 
-})(jQuery);
+}( jQuery ) );
\ No newline at end of file
index 309dc08..f406f73 100644 (file)
 * Modified by Minkyu Kang <mk7.kang@samsung.com>
 */
 
-( function ( $, window, document, undefined ) {
+(function ( $, window, document, undefined ) {
 
-jQuery.widget( "tizen.scrollview", jQuery.mobile.widget, {
-       options: {
-               fps:               60,    // Frames per second in msecs.
-               direction:         null,  // "x", "y", or null for both.
+       function setElementTransform( $ele, x, y, duration ) {
+               var v = "translate(" + x + "," + y + ")",
+                       transition;
 
-               scrollDuration:    2000,  // Duration of the scrolling animation in msecs.
-               overshootDuration: 250,   // Duration of the overshoot animation in msecs.
-               snapbackDuration:  500,   // Duration of the snapback animation in msecs.
-
-               moveThreshold:     50,   // User must move this many pixels in any direction to trigger a scroll.
-               moveIntervalThreshold:     150,   // Time between mousemoves must not exceed this threshold.
-
-               scrollMethod:      "translate",  // "translate", "position", "scroll"
-               startEventName:    "scrollstart",
-               updateEventName:   "scrollupdate",
-               stopEventName:     "scrollstop",
-
-               eventType:         $.support.touch ? "touch" : "mouse",
-
-               showScrollBars:    true,
-
-               pagingEnabled:     false,
-               overshootEnable:   false,
-
-               delayedClickSelector: "a,input,textarea,select,button,.ui-btn",
-               delayedClickEnabled: false
-       },
-
-       _makePositioned: function ( $ele ) {
-               if ( $ele.css("position") === "static" ) {
-                       $ele.css( "position", "relative" );
+               if ( !duration || duration === undefined ) {
+                       transition = "none";
+               } else {
+                       transition =  "-webkit-transform " + duration / 1000 + "s";
                }
-       },
-
-       _create: function () {
-               var $page = $('.ui-page');
-               this._$content = $page.children('.ui-content');
-
-               this._$clip = $( this.element ).addClass("ui-scrollview-clip");
-
-               var $child = this._$clip.children();
 
-               if ( $child.length > 1 ) {
-                       $child = this._$clip.wrapInner("<div></div>").children();
-               }
+               $ele.css({
+                       "-moz-transform": v,
+                       "-webkit-transform": v,
+                       "-ms-transform": v,
+                       "-o-transform": v,
+                       "transform": v,
+                       "-webkit-transition": transition
+               });
+       }
 
-               this._$view = $child.addClass("ui-scrollview-view");
+       function MomentumTracker( options ) {
+               this.options = $.extend( {}, options );
+               this.easing = "easeOutQuad";
+               this.reset();
+       }
 
-               this._$clip.css( "overflow",
-                       this.options.scrollMethod === "scroll" ? "scroll" : "hidden" );
+       var tstates = {
+               scrolling: 0,
+               overshot:  1,
+               snapback:  2,
+               done:      3
+       };
 
-               this._makePositioned( this._$clip );
+       function getCurrentTime() {
+               return ( new Date() ).getTime();
+       }
 
-               /*
-                * Turn off our faux scrollbars if we are using native scrolling
-                * to position the view.
-                */
-               if ( this.options.scrollMethod === "scroll" ) {
-                       this.options.showScrollBars = false;
-               }
+       jQuery.widget( "tizen.scrollview", jQuery.mobile.widget, {
+               options: {
+                       fps:               60,    // Frames per second in msecs.
+                       direction:         null,  // "x", "y", or null for both.
 
-               /*
-                * We really don't need this if we are using a translate transformation
-                * for scrolling. We set it just in case the user wants to switch methods
-                * on the fly.
-                */
-               this._makePositioned( this._$view );
-               this._$view.css({ left: 0, top: 0 });
+                       scrollDuration:    2000,  // Duration of the scrolling animation in msecs.
+                       overshootDuration: 250,   // Duration of the overshoot animation in msecs.
+                       snapbackDuration:  500,   // Duration of the snapback animation in msecs.
 
-               this._sx = 0;
-               this._sy = 0;
+                       moveThreshold:     50,   // User must move this many pixels in any direction to trigger a scroll.
+                       moveIntervalThreshold:     150,   // Time between mousemoves must not exceed this threshold.
 
-               var direction = this.options.direction;
+                       scrollMethod:      "translate",  // "translate", "position", "scroll"
+                       startEventName:    "scrollstart",
+                       updateEventName:   "scrollupdate",
+                       stopEventName:     "scrollstop",
 
-               this._hTracker = ( direction !== "y" ) ?
-                       new MomentumTracker( this.options ) : null;
-               this._vTracker = ( direction !== "x" ) ?
-                       new MomentumTracker( this.options ) : null;
+                       eventType:         $.support.touch ? "touch" : "mouse",
 
-               this._timerInterval = 1000 / this.options.fps;
-               this._timerID = 0;
+                       showScrollBars:    true,
 
-               var self = this;
-               this._timerCB = function () {
-                       self._handleMomentumScroll();
-               };
+                       pagingEnabled:     false,
+                       overshootEnable:   false,
 
-               this._addBehaviors();
-       },
+                       delayedClickSelector: "a,input,textarea,select,button,.ui-btn"
+               },
 
-       _startMScroll: function ( speedX, speedY ) {
-               this._stopMScroll();
-               this._showScrollBars();
+               _makePositioned: function ( $ele ) {
+                       if ( $ele.css("position") === "static" ) {
+                               $ele.css( "position", "relative" );
+                       }
+               },
 
-               var keepGoing = false;
-               var duration = this.options.scrollDuration;
+               _create: function () {
+                       var $page = $('.ui-page'),
+                               $child,
+                               direction,
+                               self = this;
 
-               this._$clip.trigger( this.options.startEventName );
-               $( document ).trigger("scrollview_scroll");
+                       this._$clip = $( this.element ).addClass("ui-scrollview-clip");
 
-               var ht = this._hTracker;
-               if ( ht ) {
-                       var c = this._$clip.width();
-                       var v = this._$view.width();
-                       ht.start( this._sx, speedX,
-                               duration, (v > c) ? -(v - c) : 0, 0 );
-                       keepGoing = !ht.done();
-               }
+                       $child = this._$clip.wrapInner("<div></div>").children();
 
-               var vt = this._vTracker;
-               if ( vt ) {
-                       var c = this._$clip.height();
-                       var v = this._$view.height() +
-                               parseFloat( this._$view.css("padding-top") );
+                       this._$view = $child.addClass("ui-scrollview-view");
 
-                       vt.start( this._sy, speedY,
-                               duration, (v > c) ? -(v - c) : 0, 0 );
-                       keepGoing = keepGoing || !vt.done();
-               }
+                       if ( this.options.scrollMethod === "translate" ) {
+                               if ( this._$view.css("transform") === undefined ) {
+                                       this.options.scrollMethod = "position";
+                               }
+                       }
 
-               if ( keepGoing ) {
-                       this._timerID = setTimeout( this._timerCB, this._timerInterval );
-               } else {
-                       this._stopMScroll();
-               }
-       },
+                       this._$clip.css( "overflow",
+                               this.options.scrollMethod === "scroll" ? "scroll" : "hidden" );
 
-       _stopMScroll: function () {
-               if ( this._timerID ) {
-                       this._$clip.trigger( this.options.stopEventName );
-                       clearTimeout( this._timerID );
-               }
-               this._timerID = 0;
+                       this._makePositioned( this._$clip );
 
-               if ( this._vTracker ) {
-                       this._vTracker.reset();
-               }
+                       /*
+                        * Turn off our faux scrollbars if we are using native scrolling
+                        * to position the view.
+                        */
+                       if ( this.options.scrollMethod === "scroll" ) {
+                               this.options.showScrollBars = false;
+                       }
 
-               if ( this._hTracker ) {
-                       this._hTracker.reset();
-               }
+                       /*
+                        * We really don't need this if we are using a translate transformation
+                        * for scrolling. We set it just in case the user wants to switch methods
+                        * on the fly.
+                        */
+                       this._makePositioned( this._$view );
+                       this._$view.css({ left: 0, top: 0 });
 
-               this._hideScrollBars();
-       },
+                       this._sx = 0;
+                       this._sy = 0;
 
-       _handleMomentumScroll: function () {
-               var keepGoing = false;
-               var v = this._$view;
+                       direction = this.options.direction;
 
-               var x = 0, y = 0;
+                       this._hTracker = ( direction !== "y" ) ?
+                                       new MomentumTracker( this.options ) : null;
+                       this._vTracker = ( direction !== "x" ) ?
+                                       new MomentumTracker( this.options ) : null;
 
-               var vt = this._vTracker;
-               if ( vt ) {
-                       vt.update( this.options.overshootEnable );
-                       y = vt.getPosition();
-                       keepGoing = !vt.done();
-               }
+                       this._timerInterval = 1000 / this.options.fps;
+                       this._timerID = 0;
 
-               var ht = this._hTracker;
-               if ( ht ) {
-                       ht.update( this.options.overshootEnable );
-                       x = ht.getPosition();
-                       keepGoing = keepGoing || !ht.done();
-               }
+                       this._timerCB = function () {
+                               self._handleMomentumScroll();
+                       };
 
-               this._setScrollPosition( x, y );
-               this._$clip.trigger( this.options.updateEventName,
-                               [ { x: x, y: y } ] );
+                       this._addBehaviors();
+               },
 
-               if ( keepGoing ) {
-                       this._timerID = setTimeout( this._timerCB, this._timerInterval );
-               } else {
+               _startMScroll: function ( speedX, speedY ) {
                        this._stopMScroll();
-               }
-       },
-
-       _setCalibration: function ( x, y ) {
-               if ( this.options.overshootEnable ) {
-                       this._sx = x;
-                       this._sy = y;
-                       return;
-               }
-
-               var v = this._$view;
-               var c = this._$clip;
-               var dirLock = this._directionLock;
+                       this._showScrollBars();
+
+                       var keepGoing = false,
+                               duration = this.options.scrollDuration,
+                               ht = this._hTracker,
+                               vt = this._vTracker,
+                               c,
+                               v;
+
+                       this._$clip.trigger( this.options.startEventName );
+                       $( document ).trigger("scrollview_scroll");
+
+                       if ( ht ) {
+                               c = this._$clip.width();
+                               v = this._$view.width();
+                               ht.start( this._sx, speedX,
+                                       duration, (v > c) ? -(v - c) : 0, 0 );
+                               keepGoing = !ht.done();
+                       }
 
-               if ( dirLock !== "y" && this._hTracker ) {
-                       this._sx = x;
-               }
+                       if ( vt ) {
+                               c = this._$clip.height();
+                               v = this._$view.height() +
+                                       parseFloat( this._$view.css("padding-top") );
 
-               if ( dirLock !== "x" && this._vTracker ) {
-                       var scroll_height = v.height() - c.height() +
-                               parseFloat( c.css("padding-top") ) +
-                               parseFloat( c.css("padding-bottom") );
+                               vt.start( this._sy, speedY,
+                                       duration, (v > c) ? -(v - c) : 0, 0 );
+                               keepGoing = keepGoing || !vt.done();
+                       }
 
-                       if ( y >= 0 ) {
-                               this._sy = 0;
-                       } else if ( y < -scroll_height ) {
-                               this._sy = -scroll_height;
+                       if ( keepGoing ) {
+                               this._timerID = setTimeout( this._timerCB, this._timerInterval );
                        } else {
-                               this._sy = y;
+                               this._stopMScroll();
                        }
+               },
 
-                       if ( scroll_height < 0 ) {
-                               this._sy = 0;
+               _stopMScroll: function () {
+                       if ( this._timerID ) {
+                               this._$clip.trigger( this.options.stopEventName );
+                               clearTimeout( this._timerID );
                        }
-               }
-       },
-
-       _setScrollPosition: function ( x, y, duration ) {
-               this._setCalibration( x, y );
-
-               x = this._sx;
-               y = this._sy;
-
-               var $v = this._$view;
-
-               var sm = this.options.scrollMethod;
-
-               switch ( sm ) {
-               case "translate":
-                       setElementTransform( $v, x + "px", y + "px", duration );
-                       break;
+                       this._timerID = 0;
 
-               case "position":
-                       $v.css({left: x + "px", top: y + "px"});
-                       break;
-
-               case "scroll":
-                       var c = this._$clip[0];
-                       c.scrollLeft = -x;
-                       c.scrollTop = -y;
-                       break;
-               }
+                       if ( this._vTracker ) {
+                               this._vTracker.reset();
+                       }
 
-               var $vsb = this._$vScrollBar;
-               var $hsb = this._$hScrollBar;
+                       if ( this._hTracker ) {
+                               this._hTracker.reset();
+                       }
 
-               if ( $vsb ) {
-                       var $sbt = $vsb.find(".ui-scrollbar-thumb");
+                       this._hideScrollBars();
+               },
+
+               _handleMomentumScroll: function () {
+                       var keepGoing = false,
+                               v = this._$view,
+                               x = 0,
+                               y = 0,
+                               vt = this._vTracker,
+                               ht = this._hTracker;
+
+                       if ( vt ) {
+                               vt.update( this.options.overshootEnable );
+                               y = vt.getPosition();
+                               keepGoing = !vt.done();
+                       }
 
-                       if ( sm === "translate" ) {
-                               setElementTransform( $sbt, "0px",
-                                       -y / $v.height() * $sbt.parent().height() + "px",
-                                       duration );
-                       } else {
-                               $sbt.css( "top", -y / $v.height() * 100 + "%" );
+                       if ( ht ) {
+                               ht.update( this.options.overshootEnable );
+                               x = ht.getPosition();
+                               keepGoing = keepGoing || !ht.done();
                        }
-               }
 
-               if ( $hsb ) {
-                       var $sbt = $hsb.find(".ui-scrollbar-thumb");
+                       this._setScrollPosition( x, y );
+                       this._$clip.trigger( this.options.updateEventName,
+                                       [ { x: x, y: y } ] );
 
-                       if ( sm === "translate" ) {
-                               setElementTransform( $sbt,
-                                       -x / $v.width() * $sbt.parent().width() + "px", "0px",
-                                       duration);
+                       if ( keepGoing ) {
+                               this._timerID = setTimeout( this._timerCB, this._timerInterval );
                        } else {
-                               $sbt.css("left", -x/$v.width() * 100 + "%");
+                               this._stopMScroll();
                        }
-               }
-       },
-
-       scrollTo: function ( x, y, duration ) {
-               this._stopMScroll();
-               var sm = this.options.scrollMethod;
-
-               /*
-                * currently support only animation for translate
-                * Don't want to use setTimeout algorithm for animation.
-                */
-               if ( !duration || (duration && sm === "translate") ) {
-                       return this._setScrollPosition( x, y, duration );
-               }
+               },
 
-               // follow jqm default animation when the scrollmethod is not translate. 
+               _setCalibration: function ( x, y ) {
+                       if ( this.options.overshootEnable ) {
+                               this._sx = x;
+                               this._sy = y;
+                               return;
+                       }
 
-               x = -x;
-               y = -y;
+                       var v = this._$view,
+                               c = this._$clip,
+                               dirLock = this._directionLock,
+                               scroll_height = 0;
 
-               var self = this;
-               var start = getCurrentTime();
-               var efunc = $.easing["easeOutQuad"];
-               var sx = this._sx;
-               var sy = this._sy;
-               var dx = x - sx;
-               var dy = y - sy;
+                       if ( dirLock !== "y" && this._hTracker ) {
+                               this._sx = x;
+                       }
 
-               var tfunc = function() {
-                       var elapsed = getCurrentTime() - start;
+                       if ( dirLock !== "x" && this._vTracker ) {
+                               scroll_height = v.height() - c.height() +
+                                       parseFloat( c.css("padding-top") ) +
+                                       parseFloat( c.css("padding-bottom") );
 
-                       if ( elapsed >= duration ) {
-                               self._timerID = 0;
-                               self._setScrollPosition( x, y );
-                       } else {
-                               var ec = efunc( elapsed / duration, elapsed, 0, 1, duration );
+                               if ( y >= 0 ) {
+                                       this._sy = 0;
+                               } else if ( y < -scroll_height ) {
+                                       this._sy = -scroll_height;
+                               } else {
+                                       this._sy = y;
+                               }
 
-                               self._setScrollPosition( sx + (dx * ec), sy + (dy * ec) );
-                               self._timerID = setTimeout( tfunc, self._timerInterval );
+                               if ( scroll_height < 0 ) {
+                                       this._sy = 0;
+                               }
                        }
-               };
+               },
 
-               this._timerID = setTimeout( tfunc, this._timerInterval );
-       },
+               _setScrollPosition: function ( x, y, duration ) {
+                       this._setCalibration( x, y );
 
-       getScrollPosition: function () {
-               return { x: -this._sx, y: -this._sy };
-       },
+                       x = this._sx;
+                       y = this._sy;
 
-       _getScrollHierarchy: function () {
-               var svh = [];
-               this._$clip.parents(".ui-scrollview-clip").each( function () {
-                       var d = $(this).jqmData("scrollview");
-                       if ( d ) {
-                               svh.unshift( d );
-                       }
-               } );
-               return svh;
-       },
+                       var $v = this._$view,
+                               sm = this.options.scrollMethod,
+                               $vsb = this._$vScrollBar,
+                               $hsb = this._$hScrollBar,
+                               $sbt;
 
-       _getAncestorByDirection: function ( dir ) {
-               var svh = this._getScrollHierarchy();
-               var n = svh.length;
+                       switch ( sm ) {
+                       case "translate":
+                               setElementTransform( $v, x + "px", y + "px", duration );
+                               break;
 
-               while ( 0 < n-- ) {
-                       var sv = svh[n];
-                       var svdir = sv.options.direction;
+                       case "position":
+                               $v.css({left: x + "px", top: y + "px"});
+                               break;
 
-                       if (!svdir || svdir === dir) {
-                               return sv;
+                       case "scroll":
+                               this._$clip[0].scrollLeft = -x;
+                               this._$clip[0].scrollTop = -y;
+                               break;
                        }
-               }
-               return null;
-       },
 
-       _handleDragStart: function ( e, ex, ey ) {
-               // Stop any scrolling of elements in our parent hierarcy.
-               $.each( this._getScrollHierarchy(),
-                       function (i, sv) {
-                               sv._stopMScroll();
-                       } );
-               this._stopMScroll();
+                       if ( $vsb ) {
+                               $sbt = $vsb.find(".ui-scrollbar-thumb");
 
-               this._didDrag = false;
-               var target = $( e.target );
+                               if ( sm === "translate" ) {
+                                       setElementTransform( $sbt, "0px",
+                                               -y / $v.height() * $sbt.parent().height() + "px",
+                                               duration );
+                               } else {
+                                       $sbt.css( "top", -y / $v.height() * 100 + "%" );
+                               }
+                       }
 
-               // should skip the dragging when click the button
-               this._skip_dragging = target.is('.ui-btn-text') ||
-                               target.is('.ui-btn-inner');
+                       if ( $hsb ) {
+                               $sbt = $hsb.find(".ui-scrollbar-thumb");
 
-               if ( this._skip_dragging ) {
-                       return;
-               }
+                               if ( sm === "translate" ) {
+                                       setElementTransform( $sbt,
+                                               -x / $v.width() * $sbt.parent().width() + "px", "0px",
+                                               duration);
+                               } else {
+                                       $sbt.css("left", -x / $v.width() * 100 + "%");
+                               }
+                       }
+               },
 
-               /*
-                * If we're using mouse events, we need to prevent the default
-                * behavior to suppress accidental selection of text, etc. We
-                * can't do this on touch devices because it will disable the
-                * generation of "click" events.
-                */
+               scrollTo: function ( x, y, duration ) {
+                       this._stopMScroll();
 
-               var shouldBlockEvent = 1;
+                       /*
+                        * currently support only animation for translate
+                        * Don't want to use setTimeout algorithm for animation.
+                        */
+                       if ( !duration || (duration && this.options.scrollMethod === "translate") ) {
+                               return this._setScrollPosition( x, y, duration );
+                       }
 
-               if ( this.options.eventType === "mouse" ) {
-                       shouldBlockEvent = !( target.is(':input') ||
-                               target.parents(':input').length > 0 );
-               } else if ( this.options.eventType === "touch" ) {
-                       shouldBlockEvent = !( target.is(':input') ||
-                               target.parents(':input').length > 0 );
+                       // follow jqm default animation when the scrollmethod is not translate.
 
-               }
+                       x = -x;
+                       y = -y;
 
-               if ( shouldBlockEvent ) {
-                       e.preventDefault();
-               }
+                       var self = this,
+                               start = getCurrentTime(),
+                               efunc = $.easing.easeOutQuad,
+                               sx = this._sx,
+                               sy = this._sy,
+                               dx = x - sx,
+                               dy = y - sy,
+                               tfunc;
 
-               var c = this._$clip;
-               var v = this._$view;
+                       tfunc = function () {
+                               var elapsed = getCurrentTime() - start,
+                                   ec;
 
-               if ( this.options.delayedClickEnabled ) {
-                       this._$clickEle =
-                               target.closest( this.options.delayedClickSelector );
-               }
+                               if ( elapsed >= duration ) {
+                                       self._timerID = 0;
+                                       self._setScrollPosition( x, y );
+                               } else {
+                                       ec = efunc( elapsed / duration, elapsed, 0, 1, duration );
 
-               this._lastX = ex;
-               this._lastY = ey;
-               this._startY = ey;
-               this._doSnapBackX = false;
-               this._doSnapBackY = false;
-               this._speedX = 0;
-               this._speedY = 0;
+                                       self._setScrollPosition( sx + (dx * ec), sy + (dy * ec) );
+                                       self._timerID = setTimeout( tfunc, self._timerInterval );
+                               }
+                       };
 
-               this._directionLock = "";
+                       this._timerID = setTimeout( tfunc, this._timerInterval );
+               },
 
-               var cw = 0,
-                   vw = 0,
-                   ch = 0,
-                   vh = 0;
+               getScrollPosition: function () {
+                       return { x: -this._sx, y: -this._sy };
+               },
 
-               if ( this._hTracker ) {
-                       cw = parseInt( c.css("width"), 10 );
-                       vw = parseInt( v.css("width"), 10 );
-                       this._maxX = cw - vw;
+               _getScrollHierarchy: function () {
+                       var svh = [],
+                               d;
 
-                       if ( this._maxX > 0 ) {
-                               this._maxX = 0;
-                       }
-                       if ( this._$hScrollBar ) {
-                               var thumb = this._$hScrollBar.find(".ui-scrollbar-thumb");
-                               thumb.css( "width", (cw >= vw ?
-                                       "100%" : Math.floor(cw / vw * 100) + "%") );
+                       this._$clip.parents(".ui-scrollview-clip").each(function () {
+                               d = $( this ).jqmData("scrollview");
+                               if ( d ) {
+                                       svh.unshift( d );
+                               }
+                       });
+                       return svh;
+               },
+
+               _getAncestorByDirection: function ( dir ) {
+                       var svh = this._getScrollHierarchy(),
+                               n = svh.length,
+                               sv,
+                               svdir;
+
+                       while ( 0 < n-- ) {
+                               sv = svh[n];
+                               svdir = sv.options.direction;
+
+                               if (!svdir || svdir === dir) {
+                                       return sv;
+                               }
                        }
-               }
+                       return null;
+               },
 
-               if ( this._vTracker ) {
-                       ch = parseInt( c.css("height"), 10 );
-                       vh = parseInt( v.css("height"), 10 ) +
-                               parseFloat( v.css("padding-top") );
-                       this._maxY = ch - vh;
+               _handleDragStart: function ( e, ex, ey ) {
+                       // Stop any scrolling of elements in our parent hierarcy.
+                       $.each( this._getScrollHierarchy(), function (i, sv) {
+                               sv._stopMScroll();
+                       });
+                       this._stopMScroll();
 
-                       if ( this._maxY > 0 ) {
-                               this._maxY = 0;
+                       this._didDrag = false;
+
+                       var target = $( e.target ),
+                               shouldBlockEvent = 1,
+                               c = this._$clip,
+                               v = this._$view,
+                               cw = 0,
+                               vw = 0,
+                               ch = 0,
+                               vh = 0,
+                               svdir = this.options.direction,
+                               thumb;
+
+                       // should skip the dragging when click the button
+                       this._skip_dragging = target.is('.ui-btn-text') ||
+                                       target.is('.ui-btn-inner');
+
+                       if ( this._skip_dragging ) {
+                               return;
                        }
-                       if ( this._$vScrollBar ) {
-                               var thumb = this._$vScrollBar.find(".ui-scrollbar-thumb");
-                               thumb.css( "height", (ch >= vh ?
-                                       "100%" : Math.floor(ch / vh * 100) + "%") );
-                       }
-               }
 
-               var svdir = this.options.direction;
+                       /*
+                        * If we're using mouse events, we need to prevent the default
+                        * behavior to suppress accidental selection of text, etc. We
+                        * can't do this on touch devices because it will disable the
+                        * generation of "click" events.
+                        */
 
-               this._pageDelta = 0;
-               this._pageSize = 0;
-               this._pagePos = 0;
+                       this._shouldBlockEvent = !( target.is(':input') ||
+                                       target.parents(':input').length > 0 );
 
-               if ( this.options.pagingEnabled && (svdir === "x" || svdir === "y") ) {
-                       this._pageSize = (svdir === "x") ? cw : ch;
-                       this._pagePos = (svdir === "x") ? this._sx : this._sy;
-                       this._pagePos -= this._pagePos % this._pageSize;
-               }
+                       if ( this._shouldBlockEvent ) {
+                               e.preventDefault();
+                       }
 
-               this._lastMove = 0;
-               this._enableTracking();
-       },
+                       this._lastX = ex;
+                       this._lastY = ey;
+                       this._startY = ey;
+                       this._doSnapBackX = false;
+                       this._doSnapBackY = false;
+                       this._speedX = 0;
+                       this._speedY = 0;
 
-       _propagateDragMove: function ( sv, e, ex, ey, dir ) {
-               this._hideScrollBars();
-               this._disableTracking();
-               sv._handleDragStart( e,ex,ey );
-               sv._directionLock = dir;
-               sv._didDrag = this._didDrag;
-       },
+                       this._directionLock = "";
 
-       _handleDragMove: function ( e, ex, ey ) {
-               if ( this._skip_dragging ) {
-                       return;
-               }
+                       if ( this._hTracker ) {
+                               cw = parseInt( c.css("width"), 10 );
+                               vw = parseInt( v.css("width"), 10 );
+                               this._maxX = cw - vw;
 
-               if ( !this._dragging ) {
-                       return;
-               }
+                               if ( this._maxX > 0 ) {
+                                       this._maxX = 0;
+                               }
+                               if ( this._$hScrollBar  && vw ) {
+                                       thumb = this._$hScrollBar.find(".ui-scrollbar-thumb");
+                                       thumb.css( "width", (cw >= vw ? "100%" :
+                                                       (Math.floor(cw / vw * 100) || 1) + "%") );
+                               }
+                       }
+
+                       if ( this._vTracker ) {
+                               ch = parseInt( c.css("height"), 10 );
+                               vh = parseInt( v.css("height"), 10 ) +
+                                       parseFloat( v.css("padding-top") );
+                               this._maxY = ch - vh;
 
-               var mt = this.options.moveThreshold;
+                               if ( this._maxY > 0 ) {
+                                       this._maxY = 0;
+                               }
+                               if ( this._$vScrollBar && vh ) {
+                                       thumb = this._$vScrollBar.find(".ui-scrollbar-thumb");
+                                       thumb.css( "height", (ch >= vh ? "100%" :
+                                                       (Math.floor(ch / vh * 100) || 1) + "%") );
+                               }
+                       }
 
-               if ( Math.abs( this._startY - ey ) < mt && !this._didDrag ) {
-                       return;
-               }
+                       this._pageDelta = 0;
+                       this._pageSize = 0;
+                       this._pagePos = 0;
 
-               this._lastMove = getCurrentTime();
+                       if ( this.options.pagingEnabled && (svdir === "x" || svdir === "y") ) {
+                               this._pageSize = (svdir === "x") ? cw : ch;
+                               this._pagePos = (svdir === "x") ? this._sx : this._sy;
+                               this._pagePos -= this._pagePos % this._pageSize;
+                       }
 
-               var v = this._$view;
+                       this._lastMove = 0;
+                       this._enableTracking();
+               },
 
-               var dx = ex - this._lastX;
-               var dy = ey - this._lastY;
-               var svdir = this.options.direction;
-               var dir = null;
+               _propagateDragMove: function ( sv, e, ex, ey, dir ) {
+                       this._hideScrollBars();
+                       this._disableTracking();
+                       sv._handleDragStart( e, ex, ey );
+                       sv._directionLock = dir;
+                       sv._didDrag = this._didDrag;
+               },
+
+               _handleDragMove: function ( e, ex, ey ) {
+                       if ( this._skip_dragging ) {
+                               return;
+                       }
 
-               if ( !this._directionLock ) {
-                       var x = Math.abs( dx );
-                       var y = Math.abs( dy );
+                       if ( !this._dragging ) {
+                               return;
+                       }
 
-                       if ( x < mt && y < mt ) {
-                               return false;
+                       if ( this._shouldBlockEvent ) {
+                               e.preventDefault();
                        }
 
-                       if ( x < y && (x / y) < 0.5 ) {
-                               dir = "y";
-                       } else if ( x > y && (y / x) < 0.5 ) {
-                               dir = "x";
+                       var mt = this.options.moveThreshold,
+                               v = this._$view,
+                               dx = ex - this._lastX,
+                               dy = ey - this._lastY,
+                               svdir = this.options.direction,
+                               dir = null,
+                               x,
+                               y,
+                               sv,
+                               scope,
+                               newX,
+                               newY,
+                               dirLock,
+                               opos,
+                               cpos,
+                               delta;
+
+                       if ( Math.abs( this._startY - ey ) < mt && !this._didDrag ) {
+                               return;
                        }
 
-                       if ( svdir && dir && svdir !== dir ) {
-                               /*
-                                * This scrollview can't handle the direction the user
-                                * is attempting to scroll. Find an ancestor scrollview
-                                * that can handle the request.
-                                */
+                       this._lastMove = getCurrentTime();
+                       if ( !this._directionLock ) {
+                               x = Math.abs( dx );
+                               y = Math.abs( dy );
 
-                               var sv = this._getAncestorByDirection( dir );
-                               if ( sv ) {
-                                       this._propagateDragMove( sv, e, ex, ey, dir );
+                               if ( x < mt && y < mt ) {
                                        return false;
                                }
+
+                               if ( x < y && (x / y) < 0.5 ) {
+                                       dir = "y";
+                               } else if ( x > y && (y / x) < 0.5 ) {
+                                       dir = "x";
+                               }
+
+                               if ( svdir && dir && svdir !== dir ) {
+                                       /*
+                                        * This scrollview can't handle the direction the user
+                                        * is attempting to scroll. Find an ancestor scrollview
+                                        * that can handle the request.
+                                        */
+
+                                       sv = this._getAncestorByDirection( dir );
+                                       if ( sv ) {
+                                               this._propagateDragMove( sv, e, ex, ey, dir );
+                                               return false;
+                                       }
+                               }
+
+                               //this._directionLock = svdir ? svdir : (dir ? dir : "none");
+                               this._directionLock = svdir || (dir || "none");
                        }
 
-                       this._directionLock = svdir ? svdir : (dir ? dir : "none");
-               }
+                       newX = this._sx;
+                       newY = this._sy;
+                       dirLock = this._directionLock;
 
-               var newX = this._sx;
-               var newY = this._sy;
-               var dirLock = this._directionLock;
+                       if ( dirLock !== "y" && this._hTracker ) {
+                               x = this._sx;
+                               this._speedX = dx;
+                               newX = x + dx;
 
-               if ( dirLock !== "y" && this._hTracker ) {
-                       var x = this._sx;
-                       this._speedX = dx;
-                       newX = x + dx;
+                               // Simulate resistance.
 
-                       // Simulate resistance.
+                               this._doSnapBackX = false;
 
-                       this._doSnapBackX = false;
+                               scope = (newX > 0 || newX < this._maxX);
+                               if ( scope && dirLock === "x" ) {
+                                       sv = this._getAncestorByDirection("x");
+                                       if ( sv ) {
+                                               this._setScrollPosition( newX > 0 ?
+                                                               0 : this._maxX, newY );
+                                               this._propagateDragMove( sv, e, ex, ey, dir );
+                                               return false;
+                                       }
 
-                       var scope = (newX > 0 || newX < this._maxX);
-                       if ( scope && dirLock === "x" ) {
-                               var sv = this._getAncestorByDirection("x");
-                               if ( sv ) {
-                                       this._setScrollPosition( newX > 0 ?
-                                                       0 : this._maxX, newY );
-                                       this._propagateDragMove( sv, e, ex, ey, dir );
-                                       return false;
+                                       newX = x + (dx / 2);
+                                       this._doSnapBackX = true;
                                }
-
-                               newX = x + (dx / 2);
-                               this._doSnapBackX = true;
                        }
-               }
 
-               if ( dirLock !== "x" && this._vTracker ) {
-                       var y = this._sy;
-                       this._speedY = dy;
-                       newY = y + dy;
+                       if ( dirLock !== "x" && this._vTracker ) {
+                               y = this._sy;
+                               this._speedY = dy;
+                               newY = y + dy;
 
-                       // Simulate resistance.
+                               // Simulate resistance.
 
-                       this._doSnapBackY = false;
+                               this._doSnapBackY = false;
 
-                       var scope = (newY > 0 || newY < this._maxY);
-                       if ( scope && dirLock === "y" ) {
-                               var sv = this._getAncestorByDirection("y");
-                               if ( sv ) {
-                                       this._setScrollPosition( newX,
-                                                       newY > 0 ? 0 : this._maxY );
-                                       this._propagateDragMove( sv, e, ex, ey, dir );
-                                       return false;
-                               }
+                               scope = (newY > 0 || newY < this._maxY);
+                               if ( scope && dirLock === "y" ) {
+                                       sv = this._getAncestorByDirection("y");
+                                       if ( sv ) {
+                                               this._setScrollPosition( newX,
+                                                               newY > 0 ? 0 : this._maxY );
+                                               this._propagateDragMove( sv, e, ex, ey, dir );
+                                               return false;
+                                       }
 
-                               newY = y + (dy / 2);
-                               this._doSnapBackY = true;
+                                       newY = y + (dy / 2);
+                                       this._doSnapBackY = true;
+                               }
                        }
-               }
 
-               if ( this.options.overshootEnable === false ) {
-                       this._doSnapBackX = false;
-                       this._doSnapBackY = false;
-               }
+                       if ( this.options.overshootEnable === false ) {
+                               this._doSnapBackX = false;
+                               this._doSnapBackY = false;
+                       }
 
-               if ( this.options.pagingEnabled && (svdir === "x" || svdir === "y") ) {
-                       if ( this._doSnapBackX || this._doSnapBackY ) {
-                               this._pageDelta = 0;
-                       } else {
-                               var opos = this._pagePos;
-                               var cpos = svdir === "x" ? newX : newY;
-                               var delta = svdir === "x" ? dx : dy;
-
-                               if ( opos > cpos && delta < 0 ) {
-                                       this._pageDelta = this._pageSize;
-                               } else if ( opos < cpos && delta > 0 ) {
-                                       this._pageDelta = -this._pageSize;
-                               } else {
+                       if ( this.options.pagingEnabled && (svdir === "x" || svdir === "y") ) {
+                               if ( this._doSnapBackX || this._doSnapBackY ) {
                                        this._pageDelta = 0;
+                               } else {
+                                       opos = this._pagePos;
+                                       cpos = svdir === "x" ? newX : newY;
+                                       delta = svdir === "x" ? dx : dy;
+
+                                       if ( opos > cpos && delta < 0 ) {
+                                               this._pageDelta = this._pageSize;
+                                       } else if ( opos < cpos && delta > 0 ) {
+                                               this._pageDelta = -this._pageSize;
+                                       } else {
+                                               this._pageDelta = 0;
+                                       }
                                }
                        }
-               }
-
-               this._didDrag = true;
-               this._lastX = ex;
-               this._lastY = ey;
-
-               this._setScrollPosition( newX, newY );
 
-               this._showScrollBars();
+                       this._didDrag = true;
+                       this._lastX = ex;
+                       this._lastY = ey;
 
-               return;
-       },
+                       this._setScrollPosition( newX, newY );
 
-       _handleDragStop: function ( e ) {
-               if ( this._skip_dragging ) {
-                       return;
-               }
+                       this._showScrollBars();
+               },
 
-               var l = this._lastMove;
-               var t = getCurrentTime();
-               var doScroll = (l && (t - l) <= this.options.moveIntervalThreshold);
-
-               var sx = ( this._hTracker && this._speedX && doScroll ) ?
-                               this._speedX : ( this._doSnapBackX ? 1 : 0 );
-               var sy = ( this._vTracker && this._speedY && doScroll ) ?
-                       this._speedY : ( this._doSnapBackY ? 1 : 0 );
+               _handleDragStop: function ( e ) {
+                       if ( this._skip_dragging ) {
+                               return;
+                       }
 
-               var svdir = this.options.direction;
-               if ( this.options.pagingEnabled && (svdir === "x" || svdir === "y") &&
-                               !this._doSnapBackX && !this._doSnapBackY ) {
-                       var x = this._sx;
-                       var y = this._sy;
+                       var l = this._lastMove,
+                               t = getCurrentTime(),
+                               doScroll = (l && (t - l) <= this.options.moveIntervalThreshold),
+                               sx = ( this._hTracker && this._speedX && doScroll ) ?
+                                               this._speedX : ( this._doSnapBackX ? 1 : 0 ),
+                               sy = ( this._vTracker && this._speedY && doScroll ) ?
+                                               this._speedY : ( this._doSnapBackY ? 1 : 0 ),
+                               svdir = this.options.direction,
+                               x,
+                               y;
+
+                       if ( this.options.pagingEnabled && (svdir === "x" || svdir === "y") &&
+                                       !this._doSnapBackX && !this._doSnapBackY ) {
+                               x = this._sx;
+                               y = this._sy;
+
+                               if ( svdir === "x" ) {
+                                       x = -this._pagePos + this._pageDelta;
+                               } else {
+                                       y = -this._pagePos + this._pageDelta;
+                               }
 
-                       if ( svdir === "x" ) {
-                               x = -this._pagePos + this._pageDelta;
+                               this.scrollTo( x, y, this.options.snapbackDuration );
+                       } else if ( sx || sy ) {
+                               this._startMScroll( sx, sy );
                        } else {
-                               y = -this._pagePos + this._pageDelta;
+                               this._hideScrollBars();
                        }
 
-                       this.scrollTo( x, y, this.options.snapbackDuration );
-               } else if ( sx || sy ) {
-                       this._startMScroll( sx, sy );
-               } else {
-                       this._hideScrollBars();
-               }
-
-               this._disableTracking();
-
-               if ( !this._didDrag &&
-                               this.options.delayedClickEnabled &&
-                               this._$clickEle.length ) {
-                       this._$clickEle
-                               .trigger("mousedown")
-                               .trigger("mouseup")
-                               .trigger("click");
-               }
-
-               /*
-                * If a view scrolled, then we need to absorb
-                * the event so that links etc, underneath our
-                * cursor/finger don't fire.
-                */
-
-               return !this._didDrag;
-       },
+                       this._disableTracking();
 
-       _enableTracking: function () {
-               this._dragging = true;
-       },
+                       if ( !this._didDrag && this.options.eventType === "touch" ) {
+                               $(e.target).closest(this.options.delayedClickSelector).trigger("click");
+                       }
 
-       _disableTracking: function () {
-               this._dragging = false;
-       },
+                       /*
+                        * If a view scrolled, then we need to absorb
+                        * the event so that links etc, underneath our
+                        * cursor/finger don't fire.
+                        */
 
-       _showScrollBars: function () {
-               var vclass = "ui-scrollbar-visible";
-               if ( this._$vScrollBar ) {
-                       this._$vScrollBar.addClass( vclass );
-               }
-               if ( this._$hScrollBar ) {
-                       this._$hScrollBar.addClass( vclass );
-               }
-       },
+                       return !this._didDrag;
+               },
 
-       _hideScrollBars: function () {
-               var vclass = "ui-scrollbar-visible";
-               if ( this._$vScrollBar ) {
-                       this._$vScrollBar.removeClass( vclass );
-               }
-               if ( this._$hScrollBar ) {
-                       this._$hScrollBar.removeClass( vclass );
-               }
-       },
+               _enableTracking: function () {
+                       this._dragging = true;
+               },
 
-       _addBehaviors: function () {
-               var self = this;
+               _disableTracking: function () {
+                       this._dragging = false;
+               },
 
-               if ( this.options.eventType === "mouse" ) {
-                       this._dragEvt = "mousedown mousemove mouseup click";
-                       this._dragCB = function ( e ) {
-                               switch ( e.type ) {
-                               case "mousedown":
-                                       return self._handleDragStart( e,
-                                                       e.clientX, e.clientY );
+               _showScrollBars: function () {
+                       var vclass = "ui-scrollbar-visible";
+                       if ( this._$vScrollBar ) {
+                               this._$vScrollBar.addClass( vclass );
+                       }
+                       if ( this._$hScrollBar ) {
+                               this._$hScrollBar.addClass( vclass );
+                       }
+               },
 
-                               case "mousemove":
-                                       return self._handleDragMove( e,
-                                                       e.clientX, e.clientY );
+               _hideScrollBars: function () {
+                       var vclass = "ui-scrollbar-visible";
+                       if ( this._$vScrollBar ) {
+                               this._$vScrollBar.removeClass( vclass );
+                       }
+                       if ( this._$hScrollBar ) {
+                               this._$hScrollBar.removeClass( vclass );
+                       }
+               },
+
+               _addBehaviors: function () {
+                       var self = this,
+                               $c = this._$clip,
+                               prefix = "<div class=\"ui-scrollbar ui-scrollbar-",
+                               suffix = "\"><div class=\"ui-scrollbar-track\"><div class=\"ui-scrollbar-thumb\"></div></div></div>";
+
+                       if ( this.options.eventType === "mouse" ) {
+                               this._dragEvt = "mousedown mousemove mouseup click";
+                               this._dragCB = function ( e ) {
+                                       switch ( e.type ) {
+                                       case "mousedown":
+                                               return self._handleDragStart( e,
+                                                               e.clientX, e.clientY );
+
+                                       case "mousemove":
+                                               return self._handleDragMove( e,
+                                                               e.clientX, e.clientY );
+
+                                       case "mouseup":
+                                               return self._handleDragStop( e );
+
+                                       case "click":
+                                               return !self._didDrag;
+                                       }
+                               };
+                       } else {
+                               this._dragEvt = "touchstart touchmove touchend vclick";
+                               this._dragCB = function ( e ) {
+                                       var t;
+
+                                       switch ( e.type ) {
+                                       case "touchstart":
+                                               t = e.originalEvent.targetTouches[0];
+                                               return self._handleDragStart( e,
+                                                               t.pageX, t.pageY );
+
+                                       case "touchmove":
+                                               t = e.originalEvent.targetTouches[0];
+                                               return self._handleDragMove( e,
+                                                               t.pageX, t.pageY );
+
+                                       case "touchend":
+                                               return self._handleDragStop( e );
+
+                                       case "vclick":
+                                               return !self._didDrag;
+                                       }
+                               };
+                       }
 
-                               case "mouseup":
-                                       return self._handleDragStop( e );
+                       this._$view.bind( this._dragEvt, this._dragCB );
 
-                               case "click":
-                                       return !self._didDrag;
+                       if ( this.options.showScrollBars ) {
+                               if ( this._vTracker ) {
+                                       $c.append( prefix + "y" + suffix );
+                                       this._$vScrollBar = $c.children(".ui-scrollbar-y");
                                }
-                       };
-               } else {
-                       this._dragEvt = "touchstart touchmove touchend vclick";
-                       this._dragCB = function ( e ) {
-                               var t;
-
-                               switch ( e.type ) {
-                               case "touchstart":
-                                       t = e.originalEvent.targetTouches[0];
-                                       return self._handleDragStart( e,
-                                                       t.pageX, t.pageY );
-
-                               case "touchmove":
-                                       t = e.originalEvent.targetTouches[0];
-                                       return self._handleDragMove( e,
-                                                       t.pageX, t.pageY );
-
-                               case "touchend":
-                                       return self._handleDragStop( e );
-
-                               case "vclick":
-                                       return !self._didDrag;
+                               if ( this._hTracker ) {
+                                       $c.append( prefix + "x" + suffix );
+                                       this._$hScrollBar = $c.children(".ui-scrollbar-x");
                                }
-                       };
-               }
-
-               this._$view.bind( this._dragEvt, this._dragCB );
-
-               if ( this.options.showScrollBars ) {
-                       var $c = this._$clip;
-                       var prefix = "<div class=\"ui-scrollbar ui-scrollbar-";
-                       var suffix = "\"><div class=\"ui-scrollbar-track\"><div class=\"ui-scrollbar-thumb\"></div></div></div>";
-                       if ( this._vTracker ) {
-                               $c.append( prefix + "y" + suffix );
-                               this._$vScrollBar = $c.children(".ui-scrollbar-y");
-                       }
-                       if ( this._hTracker ) {
-                               $c.append( prefix + "x" + suffix );
-                               this._$hScrollBar = $c.children(".ui-scrollbar-x");
                        }
                }
-       }
-});
-
-function setElementTransform( $ele, x, y, duration ) {
-       var v = "translate3d(" + x + "," + y + ", 0px)";
-       var transition;
-
-       if ( !duration || duration === undefined ) {
-               transition = "none";
-       } else {
-               transition =  "-webkit-transform " + duration / 1000 + "s";
-       }
-
-       $ele.css({
-               "-moz-transform": v,
-               "-webkit-transform": v,
-               "transform": v,
-               "-webkit-transition": transition
        });
-}
-
-function MomentumTracker( options ) {
-       this.options = $.extend( {}, options );
-       this.easing = "easeOutQuad";
-       this.reset();
-}
-
-var tstates = {
-       scrolling: 0,
-       overshot:  1,
-       snapback:  2,
-       done:      3
-};
-
-function getCurrentTime() {
-       return ( new Date() ).getTime();
-}
-
-$.extend( MomentumTracker.prototype, {
-       start: function ( pos, speed, duration, minPos, maxPos ) {
-               var tstate = (pos < minPos || pos > maxPos) ?
-                               tstates.snapback : tstates.scrolling;
-               this.state = (speed !== 0) ? tstate : tstates.done;
-               this.pos = pos;
-               this.speed = speed;
-               this.duration = (this.state === tstates.snapback) ?
-                               this.options.snapbackDuration : duration;
-               this.minPos = minPos;
-               this.maxPos = maxPos;
-
-               this.fromPos = (this.state === tstates.snapback) ? this.pos : 0;
-               var pos_temp = (this.pos < this.minPos) ? this.minPos : this.maxPos;
-               this.toPos = (this.state === tstates.snapback) ? pos_temp : 0;
-
-               this.startTime = getCurrentTime();
-       },
-
-       reset: function () {
-               this.state = tstates.done;
-               this.pos = 0;
-               this.speed = 0;
-               this.minPos = 0;
-               this.maxPos = 0;
-               this.duration = 0;
-       },
-
-       update: function ( overshootEnable ) {
-               var state = this.state;
-
-               if ( state === tstates.done ) {
-                       return this.pos;
-               }
 
-               var cur_time = getCurrentTime();
-               var duration = this.duration;
-               var elapsed =  cur_time - this.startTime;
-               elapsed = elapsed > duration ? duration : elapsed;
+       $.extend( MomentumTracker.prototype, {
+               start: function ( pos, speed, duration, minPos, maxPos ) {
+                       var tstate = (pos < minPos || pos > maxPos) ?
+                                       tstates.snapback : tstates.scrolling,
+                               pos_temp;
+
+                       this.state = (speed !== 0) ? tstate : tstates.done;
+                       this.pos = pos;
+                       this.speed = speed;
+                       this.duration = (this.state === tstates.snapback) ?
+                                       this.options.snapbackDuration : duration;
+                       this.minPos = minPos;
+                       this.maxPos = maxPos;
+
+                       this.fromPos = (this.state === tstates.snapback) ? this.pos : 0;
+                       pos_temp = (this.pos < this.minPos) ? this.minPos : this.maxPos;
+                       this.toPos = (this.state === tstates.snapback) ? pos_temp : 0;
+
+                       this.startTime = getCurrentTime();
+               },
+
+               reset: function () {
+                       this.state = tstates.done;
+                       this.pos = 0;
+                       this.speed = 0;
+                       this.minPos = 0;
+                       this.maxPos = 0;
+                       this.duration = 0;
+               },
+
+               update: function ( overshootEnable ) {
+                       var state = this.state,
+                               cur_time = getCurrentTime(),
+                               duration = this.duration,
+                               elapsed =  cur_time - this.startTime,
+                               dx,
+                               x,
+                               didOverShoot;
+
+                       if ( state === tstates.done ) {
+                               return this.pos;
+                       }
 
-               if ( state === tstates.scrolling || state === tstates.overshot ) {
-                       var dx = this.speed *
-                               (1 - $.easing[this.easing]( elapsed / duration,
-                                                       elapsed, 0, 1, duration ));
+                       elapsed = elapsed > duration ? duration : elapsed;
 
-                       var x = this.pos + dx;
+                       if ( state === tstates.scrolling || state === tstates.overshot ) {
+                               dx = this.speed *
+                                       (1 - $.easing[this.easing]( elapsed / duration,
+                                                               elapsed, 0, 1, duration ));
 
-                       var didOverShoot = (state === tstates.scrolling) &&
-                               (x < this.minPos || x > this.maxPos);
+                               x = this.pos + dx;
 
-                       if ( didOverShoot ) {
-                               x = (x < this.minPos) ? this.minPos : this.maxPos;
-                       }
+                               didOverShoot = (state === tstates.scrolling) &&
+                                       (x < this.minPos || x > this.maxPos);
 
-                       this.pos = x;
+                               if ( didOverShoot ) {
+                                       x = (x < this.minPos) ? this.minPos : this.maxPos;
+                               }
 
-                       if ( state === tstates.overshot ) {
-                               if ( elapsed >= duration ) {
-                                       this.state = tstates.snapback;
-                                       this.fromPos = this.pos;
-                                       this.toPos = (x < this.minPos) ?
-                                               this.minPos : this.maxPos;
-                                       this.duration = this.options.snapbackDuration;
-                                       this.startTime = cur_time;
-                                       elapsed = 0;
+                               this.pos = x;
+
+                               if ( state === tstates.overshot ) {
+                                       if ( elapsed >= duration ) {
+                                               this.state = tstates.snapback;
+                                               this.fromPos = this.pos;
+                                               this.toPos = (x < this.minPos) ?
+                                                               this.minPos : this.maxPos;
+                                               this.duration = this.options.snapbackDuration;
+                                               this.startTime = cur_time;
+                                               elapsed = 0;
+                                       }
+                               } else if ( state === tstates.scrolling ) {
+                                       if ( didOverShoot && overshootEnable ) {
+                                               this.state = tstates.overshot;
+                                               this.speed = dx / 2;
+                                               this.duration = this.options.overshootDuration;
+                                               this.startTime = cur_time;
+                                       } else if ( elapsed >= duration ) {
+                                               this.state = tstates.done;
+                                       }
                                }
-                       } else if ( state === tstates.scrolling ) {
-                               if ( didOverShoot && overshootEnable ) {
-                                       this.state = tstates.overshot;
-                                       this.speed = dx / 2;
-                                       this.duration = this.options.overshootDuration;
-                                       this.startTime = cur_time;
-                               } else if ( elapsed >= duration ) {
+                       } else if ( state === tstates.snapback ) {
+                               if ( elapsed >= duration ) {
+                                       this.pos = this.toPos;
                                        this.state = tstates.done;
+                               } else {
+                                       this.pos = this.fromPos + ((this.toPos - this.fromPos) *
+                                               $.easing[this.easing]( elapsed / duration,
+                                                       elapsed, 0, 1, duration ));
                                }
                        }
-               } else if ( state === tstates.snapback ) {
-                       if ( elapsed >= duration ) {
-                               this.pos = this.toPos;
-                               this.state = tstates.done;
-                       } else {
-                               this.pos = this.fromPos + ((this.toPos - this.fromPos) *
-                                       $.easing[this.easing]( elapsed/duration,
-                                               elapsed, 0, 1, duration ));
-                       }
-               }
 
-               return this.pos;
-       },
+                       return this.pos;
+               },
 
-       done: function () {
-               return this.state === tstates.done;
-       },
+               done: function () {
+                       return this.state === tstates.done;
+               },
 
-       getPosition: function () {
-               return this.pos;
-       }
-});
-
-function ResizePageContentHeight( page ) {
-       var $page = $( page ),
-               $content = $page.children(".ui-content"),
-               hh = $page.children(".ui-header").outerHeight() || 0,
-               fh = $page.children(".ui-footer").outerHeight() || 0,
-               pt = parseFloat( $content.css("padding-top") ),
-               pb = parseFloat( $content.css("padding-bottom") ),
-               wh = window.innerHeight;
-
-       $content.height( wh - (hh + fh) - (pt + pb) );
-}
-
-// auto-init scrollview and scrolllistview widgets
-$( document ).bind( 'pagecreate create', function ( e ) {
-       var $page = $( e.target );
-       var scroll = $page.find(".ui-content").attr("data-scroll");
-
-       if ( scroll === "none" ) {
-               return;
-       }
+               getPosition: function () {
+                       return this.pos;
+               }
+       });
+
+       function resizePageContentHeight( page ) {
+               var $page = $( page ),
+                       $content = $page.children(".ui-content"),
+                       hh = $page.children(".ui-header").outerHeight() || 0,
+                       fh = $page.children(".ui-footer").outerHeight() || 0,
+                       pt = parseFloat( $content.css("padding-top") ),
+                       pb = parseFloat( $content.css("padding-bottom") ),
+                       wh = $(window).height();
 
-       if ( $.support.scrollview === true && scroll === undefined ) {
-               $page.find(".ui-content").attr( "data-scroll", "y" );
+               $content.height( wh - (hh + fh) - (pt + pb) );
        }
 
-       $page.find(":jqmData(scroll):not(.ui-scrollview-clip)").each( function () {
-               var $this = $( this );
+       // auto-init scrollview and scrolllistview widgets
+       $( document ).bind( 'pagecreate create', function ( e ) {
+               var $page = $( e.target ),
+                       scroll = $page.find(".ui-content").attr("data-scroll");
 
-               if ( $this.hasClass("ui-scrolllistview") ) {
-                       $this.scrolllistview();
-               } else {
-                       var st = $this.jqmData("scroll") + "",
-                               paging = st && (st.search(/^[xy]p$/) !== -1),
-                               dir = st && (st.search(/^[xy]/) !== -1) ? st.charAt(0) : null;
-
-                       var opts = {
-                               direction: dir || undefined,
-                               paging: paging || undefined,
-                               scrollMethod: $this.jqmData("scroll-method") || undefined
-                       };
+               if ( scroll === "none" ) {
+                       return;
+               }
 
-                       $this.scrollview( opts );
+               if ( $.support.scrollview === undefined ) {
+                       // set as default value
+                       $.support.scrollview = true;
                }
+
+               if ( $.support.scrollview === true && scroll === undefined ) {
+                       $page.find(".ui-content").attr( "data-scroll", "y" );
+               }
+
+               $page.find(":jqmData(scroll):not(.ui-scrollview-clip)").each( function () {
+                       if ( $( this ).hasClass("ui-scrolllistview") ) {
+                               $( this ).scrolllistview();
+                       } else {
+                               var st = $( this ).jqmData("scroll"),
+                                       paging = st && (st.search(/^[xy]p$/) !== -1),
+                                       dir = st && (st.search(/^[xy]/) !== -1) ? st.charAt(0) : null,
+                                       opts;
+
+                               opts = {
+                                       direction: dir || undefined,
+                                       paging: paging || undefined,
+                                       scrollMethod: $( this ).jqmData("scroll-method") || undefined
+                               };
+
+                               $( this ).scrollview( opts );
+                       }
+               });
        });
-});
 
-$( document ).bind( 'pageshow', function ( e ) {
-       var $page = $( e.target );
-       var scroll = $page.find(".ui-content").attr("data-scroll");
+       $( document ).bind( 'pageshow', function ( e ) {
+               var $page = $( e.target ),
+                       scroll = $page.find(".ui-content").attr("data-scroll");
 
-       if ( scroll === "y" ) {
-               setTimeout( function () {
-                       ResizePageContentHeight( e.target );
-               }, 100);
-       }
-});
+               if ( scroll === "y" ) {
+                       setTimeout( function () {
+                               resizePageContentHeight( e.target );
+                       }, 100);
+               }
+       });
 
-$( window ).bind( "orientationchange", function( e ) {
-       ResizePageContentHeight( $(".ui-page") );
-});
+       $( window ).bind( "orientationchange", function ( e ) {
+               resizePageContentHeight( $(".ui-page") );
+       });
 
 }( jQuery, window, document ) );
index 2798280..92d8cce 100755 (executable)
@@ -1,9 +1,30 @@
-/*
-* jQuery Mobile Framework : "controlbar" plugin
-* Copyright (c) jQuery Project
-* Dual licensed under the MIT or GPL Version 2 licenses.
-* http://jquery.org/license
-* Authors: Jinhyuk Jun <jinhyuk.jun@samsung.com>
+/* ***************************************************************************
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ *
+ * jQuery Mobile Framework : "controlbar" plugin
+ * Copyright (c) jQuery Project
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ * Authors: Jinhyuk Jun <jinhyuk.jun@samsung.com>
 */
 
 /**
  *      </div>
 */
 
-(function( $, undefined ) {
-
-$.widget( "tizen.controlbar", $.mobile.widget, {
-       options: {
-               iconpos: "top",
-               grid: null,
-               initSelector: ":jqmData(role='controlbar')"
-       },
-
-       _create: function(){
-
-               var $controlbar = this.element,
-                       $navbtns = $controlbar.find( "a" ),
-                       iconpos = $navbtns.filter( ":jqmData(icon)" ).length ?
-                                                                       this.options.iconpos : undefined,
-                       theme = $.mobile.listview.prototype.options.theme,      /* Get current theme */
-                       style = $controlbar.attr( "data-style" );
-
-               if( style === "left" || style === "right" ) {
-                       $controlbar
-                               .parents( ".ui-content" )
-                               .css( 'padding', '0' );
-               } else {
-                       $controlbar
-                               .addClass( "ui-navbar" )
-                               .attr( "role","navigation" )
-                               .find( "ul" )
-                                       .grid( { grid: this.options.grid } );
-               }
+(function ( $, undefined ) {
+
+       $.widget( "tizen.controlbar", $.mobile.widget, {
+               options: {
+                       iconpos: "top",
+                       grid: null,
+                       initSelector: ":jqmData(role='controlbar')"
+               },
+
+               _create: function () {
+
+                       var $controlbar = this.element,
+                               $navbtns = $controlbar.find( "a" ),
+                               iconpos = $navbtns.filter( ":jqmData(icon)" ).length ?
+                                                                               this.options.iconpos : undefined,
+                               theme = $.mobile.listview.prototype.options.theme,      /* Get current theme */
+                               style = $controlbar.attr( "data-style" );
+
+                       if ( style === "left" || style === "right" ) {
+                               $controlbar
+                                       .parents( ".ui-content" )
+                                       .css( 'padding', '0' );
+                       } else {
+                               $controlbar
+                                       .addClass( "ui-navbar" )
+                                       .attr( "role", "navigation" )
+                                       .find( "ul" )
+                                               .grid( { grid: this.options.grid } );
+                       }
 
-               if ( !iconpos ) {
-                       $controlbar.addClass( "ui-navbar-noicons" );
-               }
+                       if ( !iconpos ) {
+                               $controlbar.addClass( "ui-navbar-noicons" );
+                       }
 
-               $navbtns.buttonMarkup({
-                       corners:        false,
-                       shadow:         false,
-               iconpos:        iconpos
-               });
-
-               $controlbar.delegate( "a", "vclick", function( event ) {
-                       $navbtns.not( ".ui-state-persist" ).removeClass( $.mobile.activeBtnClass );
-                       $( this ).addClass( $.mobile.activeBtnClass );
-               });
-
-               if( style === "tabbar" || style === "toolbar" ){
-                       $controlbar
-                               .addClass( "ui-controlbar-" + theme )
-                               .addClass( "ui-"+style+"-" + theme );
-               } else {
-                       $controlbar
-                               .addClass( "ui-controlbar-" + style )
-                               .end();
-               }
+                       $navbtns.buttonMarkup({
+                               corners:        false,
+                               shadow:         false,
+                               iconpos:        iconpos
+                       });
+
+                       $controlbar.delegate( "a", "vclick", function ( event ) {
+                               $navbtns.not( ".ui-state-persist" ).removeClass( $.mobile.activeBtnClass );
+                               $( this ).addClass( $.mobile.activeBtnClass );
+                       });
+
+                       if ( style === "tabbar" || style === "toolbar" ) {
+                               $controlbar
+                                       .addClass( "ui-controlbar-" + theme )
+                                       .addClass( "ui-" + style + "-" + theme );
+                       } else {
+                               $controlbar
+                                       .addClass( "ui-controlbar-" + style )
+                                       .end();
+                       }
 
-               $( document ).bind( "pagebeforeshow", function( event, ui ) {
-                       var footer_filter = $( event.target ).find( ":jqmData(role='footer')" );
-                       var controlbar_filter = footer_filter.find( ":jqmData(role='controlbar')" );
-                       var style = controlbar_filter.jqmData( "style" );
+                       $( document ).bind( "pagebeforeshow", function ( event, ui ) {
+                               var footer_filter = $( event.target ).find( ":jqmData(role='footer')" ),
+                                       controlbar_filter = footer_filter.find( ":jqmData(role='controlbar')" ),
+                                       style = controlbar_filter.jqmData( "style" );
+
+                               if ( style == "toolbar" || style == "tabbar" ) {
+                                       /* Need to add text only style */
+                                       if ( !(controlbar_filter.find(".ui-btn-inner").children().is(".ui-icon")) ) {
+                                               controlbar_filter.find( ".ui-btn-inner" ).addClass( "ui-navbar-textonly" );
+                                       } else {
+                                               if ( controlbar_filter.find( ".ui-btn-text" ).text() == "" ) {
+                                                       controlbar_filter.find( ".ui-btn" ).addClass( "ui-ctrlbar-icononly" );
+                                               }
+                                       }
+                                       footer_filter
+                                               .css( "position", "fixed" )
+                                               .css( "height", controlbar_filter.height() )
+                                               .css( "top", window.innerHeight - footer_filter.height() );
+                                       if ( style == "toolbar" ) {
+                                               controlbar_filter
+                                                       .css( "width", window.innerWidth - controlbar_filter.siblings(".ui-btn").width() );
+                                       }
+                               }
+                       });
 
-                       if( style == "toolbar" || style == "tabbar" ){
-                               /* Need to add text only style */
-                               if( !(controlbar_filter.find(".ui-btn-inner").children().is(".ui-icon")) ){
-                                       controlbar_filter.find( ".ui-btn-inner" ).addClass( "ui-navbar-textonly" );
+                       $( document ).bind( "pageshow", function ( e, ui ) {
+                               var controlbar_filter = $( ".ui-page" ).find( ":jqmData(role='footer')" ).eq( 0 ).find( ":jqmData(role='controlbar')" ),
+                                       element_count = controlbar_filter.find( 'li' ).length;
+
+                               if ( controlbar_filter.find(".ui-btn-active").length == 0 ) {
+                                       controlbar_filter.find( "div" ).css( "left", "0px" );
                                } else {
-                                       if( controlbar_filter.find(".ui-btn-text").text() == "" ){
-                                               controlbar_filter.find( ".ui-btn" ).css( "padding-top", "20px" );
-                                       }
+                                       controlbar_filter.find( "div" ).css( "left", controlbar_filter.find( ".ui-btn-active" ).parent( "li" ).index() * controlbar_filter.width() / element_count );
                                }
-                               footer_filter
-                                       .css( "position", "fixed" )
-                                       .css( "height", controlbar_filter.height() )
-                                       .css( "top", window.innerHeight - footer_filter.height() );
-                               if( style == "toolbar" ){
-                                       controlbar_filter
-                                               .css( "width", window.innerWidth - controlbar_filter.siblings(".ui-btn").width() );
+
+                               /* Increase Content size with dummy <div> because of footer height */
+                               if ( controlbar_filter.length != 0 && $( ".ui-page-active" ).find( ".dummy-div" ).length == 0 && $( ".ui-page-active" ).find( ":jqmData(role='footer')" ).find( ":jqmData(role='controlbar')" ).length != 0 ) {
+                                       $( ".ui-page-active" ).find( ":jqmData(role='content')" ).append( '<div class="dummy-div"></div>' );
+                                       $( ".ui-page-active" ).find( ".dummy-div" )
+                                               .css( "width", controlbar_filter.width() )
+                                               .css( "height", controlbar_filter.height() );
                                }
-                       }
-               });
-
-               $( document ).bind( "pageshow", function( e, ui ){
-                       var controlbar_filter = $( ".ui-page" ).find( ":jqmData(role='footer')" ).eq( 0 ).find( ":jqmData(role='controlbar')" );
-                       var element_count = controlbar_filter.find( 'li' ).length;
-
-                       if( controlbar_filter.find(".ui-btn-active").length == 0 )
-                               controlbar_filter.find( "div" ).css( "left", "0px" );
-                       else
-                               controlbar_filter.find( "div" ).css( "left", controlbar_filter.find( ".ui-btn-active" ).parent( "li" ).index() * controlbar_filter.width()/element_count );
-
-                       /* Increase Content size with dummy <div> because of footer height */
-                       if( controlbar_filter.length != 0 && $( ".ui-page-active" ).find( ".dummy-div" ).length == 0
-                       && $( ".ui-page-active" ).find( ":jqmData(role='footer')" ).find( ":jqmData(role='controlbar')" ).length != 0 ){
-                               $( ".ui-page-active" ).find( ":jqmData(role='content')" ).append( '<div class="dummy-div"></div>' );
-                               $( ".ui-page-active" ).find( ".dummy-div" )
-                                       .css( "width", controlbar_filter.width() )
-                                       .css( "height", controlbar_filter.height() );
-                       }
-               });
-
-       },
-
-       _setDisabled: function( value, cnt ) {
-               this.element.find( "li" ).eq( cnt ).attr( "disabled", value );
-               this.element.find( "li" ).eq( cnt ).attr( "aria-disabled", value );
-       },
-
-       disable: function( cnt ) {
-               this._setDisabled( true, cnt );
-               this.element.find( "li" ).eq( cnt ).addClass( "ui-disabled" );
-       },
-
-       enable: function( cnt ) {
-               this._setDisabled( false, cnt );
-               this.element.find( "li" ).eq( cnt ).removeClass( "ui-disabled" );
-       }
-});
-
-//auto self-init widgets
-$( document ).bind( "pagecreate create", function( e ){
-       $( $.tizen.controlbar.prototype.options.initSelector, e.target ).controlbar();
-});
-})( jQuery );
+                       });
+               },
+
+               _setDisabled: function ( value, cnt ) {
+                       this.element.find( "li" ).eq( cnt ).attr( "disabled", value );
+                       this.element.find( "li" ).eq( cnt ).attr( "aria-disabled", value );
+               },
+
+               disable: function ( cnt ) {
+                       this._setDisabled( true, cnt );
+                       this.element.find( "li" ).eq( cnt ).addClass( "ui-disabled" );
+               },
+
+               enable: function ( cnt ) {
+                       this._setDisabled( false, cnt );
+                       this.element.find( "li" ).eq( cnt ).removeClass( "ui-disabled" );
+               }
+       });
+
+       //auto self-init widgets
+       $( document ).bind( "pagecreate create", function ( e ) {
+               $( $.tizen.controlbar.prototype.options.initSelector, e.target ).controlbar();
+       });
+}( jQuery ) );
index a45cee9..e9e28c9 100644 (file)
@@ -1,3 +1,4 @@
+/*global Globalize:false, range:false, regexp:false*/
 /*
  * jQuery Mobile Widget @VERSION
  *
@@ -27,7 +28,7 @@
  * ***************************************************************************
  *
  * Authors: Salvatore Iovene <salvatore.iovene@intel.com>
- *                     Daehyon Jung <darrenh.jung@samsung.com>
+ *                     Daehyon Jung <darrenh.jung@samsung.com>
  */
 
 /**
  *     data-role: 'datetimepicker'
  *     data-format: date format string. e.g) "MMM dd yyyy, HH:mm"
  *     type: 'date', 'datetime', 'time'
+ *     data-val: pre-set value. any date/time string Date.parse() accepts.
  *
  * Options:
- *     type: 'date', 'datetime', 'time'
+ *     type: 'date', 'datetime', 'time'
  *     format: see data-format in HTML Attributes.
+ *     val: see data-val in HTML Attributes.
  *
  * APIs:
- *     getValue()
+ *     getValue()
  *             : Get current selected date/time as W3C DTF style string.
- *     update()
- *             : Force to update fields.
+ *     update()
+ *             : Force to update fields.
  *
  * Events:
- *     data-changed: Raised when date/time was changed.
+ *     data-changed: Raised when date/time was changed.
  *
  * Examples:
  *     <ul data-role="listview">
@@ -61,7 +64,7 @@
  *                     <span class="ui-li-text-main">
  *                             <input type="datetime" name="demo-date" id="demo-date" 
  *                                     data-format="MMM dd yyyy hh:mm tt"/>
- *                     </span>
+ *                     </span>
  *                     <span class="ui-li-text-sub">
  *                             Date/Time Picker - <span id="selected-date1"><em>(select a date first)</em></span>
  *                     </span>
  */
 
 
-(function($, window, undefined) {
-       $.widget("tizen.datetimepicker", $.tizen.widgetex, {
+( function ( $, window, undefined ) {
+       $.widget( "tizen.datetimepicker", $.tizen.widgetex, {
                options: {
                        type: 'datetime', // date, time, datetime applicable
                        format: null,
+                       val: null,
                        initSelector: "input[type='date'], input[type='datetime'], input[type='time'], :jqmData(role='datetimepicker')"
                },
 
-               _makeTwoDigits: function(val) {
+               _makeTwoDigits: function ( val ) {
                        var ret = val.toString(10);
 
                        if ( val < 10 ) {
                /**
                 * return W3C DTF string
                 */
-               getValue: function() {
-                       var data = [];
+               getValue: function () {
+                       var data = [],
+                               item,
+                               greg,
+                               obj = this,
+                               toTimeString,
+                               toDateString;
+
                        for ( item in this.data ) {
                                data[item] = this.data[item];
                        }
 
                        if ( this.calendar.convert ) {
-                               var greg = this.calendar.convert.toGregorian(
-                                               data.year, data.month, data.day );
-                               data["year"] = greg.getFullYear();
-                               data["month"] = greg.getMonth();
-                               data["day"] = greg.getDate();
+                               greg = this.calendar.convert.toGregorian( data.year, data.month, data.day );
+                               data.year = greg.getFullYear();
+                               data.month = greg.getMonth();
+                               data.day = greg.getDate();
                        }
-                       var obj = this;
-                       var toTimeString = function timeStr( t ) {
-                               return  obj._makeTwoDigits( t["hour"] ) + ':' +
-                                       obj._makeTwoDigits( t["min"] ) + ':' +
-                                       obj._makeTwoDigits( t["sec"] );
+                       obj = this;
+                       toTimeString = function timeStr( t ) {
+                               return obj._makeTwoDigits( t.hour ) + ':' +
+                                       obj._makeTwoDigits( t.min ) + ':' +
+                                       obj._makeTwoDigits( t.sec );
                        };
 
-                       var toDateString = function dateStr( d ) {
-                               return ( "" + ( ( d["year"] % 10000 ) + 10000 ) ).substr(1) + '-' +
-                                       obj._makeTwoDigits( d["month"] ) + '-' +
-                                       obj._makeTwoDigits( d["day"] );
+                       toDateString = function dateStr( d ) {
+                               return ( ( d.year % 10000 ) + 10000 ).toString().substr(1) + '-' +
+                                       obj._makeTwoDigits( d.month ) + '-' +
+                                       obj._makeTwoDigits( d.day );
                        };
 
                        switch ( this.options.type ) {
                        }
                },
 
-               _updateField: function( target, value ) {
+               _updateField: function ( target, value ) {
                        if ( !target || target.length == 0 ) {
                                return;
                        }
                                value = "0";
                        }
 
-                       var pat = target.jqmData( 'pat' );
+                       var pat = target.jqmData( 'pat' ),
+                               hour;
                        switch ( pat ) {
                        case 'H':
                        case 'HH':
                        case 'h':
                        case 'hh':
-                               var hour = value;
+                               hour = value;
                                if ( pat.charAt(0) == 'h' ) {
                                        if ( hour > 12 ) {
                                                hour -= 12;
-                                       }
-                                       else if ( hour == 0 ) {
+                                       } else if ( hour == 0 ) {
                                                hour = 12;
                                        }
                                }
 
                },
 
-               _format: function( pattern ) {
-                       var token = this._parsePattern( pattern );
-                       var div = document.createElement('div');
-                       var attr = [];
+               _format: function ( pattern ) {
+                       var token = this._parsePattern( pattern ),
+                               div = document.createElement('div'),
+                               attr = [],
+                               pat,
+                               tpl,
+                               ampm,
+                               btn;
+
                        while ( token.length > 0 ) {
-                               var pat = token.shift();
-                               var tpl = '<span class="ui-datefield-%1" data-pat="' + pat + '">%2</span>';
+                               pat = token.shift();
+                               tpl = '<span class="ui-datefield-%1" data-pat="' + pat + '">%2</span>';
                                switch ( pat ) {
                                case 'H': //0 1 2 3 ... 21 22 23
                                case 'HH': //00 01 02 ... 21 22 23
                                case 'h': //0 1 2 3 ... 11 12
-                               case 'hh': //00 01 02 ... 11 12                                         
+                               case 'hh': //00 01 02 ... 11 12
                                        $(div).append( tpl.replace('%1', 'hour') );
-                                       attr['hour'] = true;
+                                       attr.hour = true;
                                        break;
                                case 'mm': //00 01 ... 59
                                case 'm': //0 1 2 ... 59
                                        $(div).append( tpl.replace('%1', 'min') );
-                                       attr['min'] = true;
+                                       attr.min = true;
                                        break;
                                case 'ss':
                                case 's':
                                        $(div).append( tpl.replace('%1', 'sec') );
-                                       attr['sec'] = true;
+                                       attr.sec = true;
                                        break;
                                case 'd': // day of month 5                                     
                                case 'dd': // day of month(leading zero) 05
                                        $(div).append( tpl.replace('%1', 'day') );
-                                       attr['day'] = true;
+                                       attr.day = true;
                                        break;
                                case 'M': // Month of year 9
                                case 'MM': // Month of year(leading zero) 09
                                case 'MMM':
                                case 'MMMM':
                                        $(div).append( tpl.replace('%1', 'month') );
-                                       attr['month'] = true;
+                                       attr.month = true;
                                        break;
                                case 'yy':      // year two digit
                                case 'yyyy': // year four digit
                                        $(div).append( tpl.replace('%1', 'year') );
-                                       attr['year'] = true;
+                                       attr.year = true;
                                        break;
                                case 't': //AM / PM indicator(first letter) A, P
                                        // add button
                                case 'tt': //AM / PM indicator AM/PM
                                        // add button
-                                       var ampm = this.data["hour"] > 11 ?
+                                       ampm = this.data.hour > 11 ?
                                                        this.calendar.PM[0] : this.calendar.AM[0];
-                                       var btn = '<a href="#" class="ui-datefield-ampm"' +
-                                                       ' data-role="button" data-inline="true">' +
-                                                       ampm + '</a>';
+                                       btn = '<a href="#" class="ui-datefield-ampm"' +
+                                               ' data-role="button" data-inline="true">' +
+                                               ampm + '</a>';
                                        $(div).append( btn );
-                                       attr['ampm'] = true;
+                                       attr.ampm = true;
                                        break;
                                case 'g':
                                case 'gg':
-                                       $(div).append( tpl.replace('%1', 'era').replace('%2',
-                                                                                                                               this.calendar.eras.name) );
+                                       $(div).append( tpl.replace('%1', 'era').replace('%2', this.calendar.eras.name) );
                                        break;
                                default : // string or any non-clickable object
                                        $(div).append( tpl.replace('%1', 'seperator').replace('%2', pat) );
 
                        return {
                                attr: attr,
-                               html: div,
+                               html: div
                        };
                },
 
-               _switchAmPm: function( obj, owner ) {
+               _switchAmPm: function ( obj, owner ) {
                        if ( this.calendar.AM != null ) {
                                if ( this.calendar.AM[0] == $(owner).find('.ui-btn-text').text() ) { // AM to PM
-                                       this.data["hour"] += 12;
+                                       this.data.hour += 12;
                                        $(owner).find('.ui-btn-text').text( this.calendar.PM[0] );
                                } else {        // PM to AM
-                                       this.data["hour"] -= 12;
+                                       this.data.hour -= 12;
                                        $(owner).find('.ui-btn-text').text( this.calendar.AM[0] );
                                }
                                obj.update();
                        }
                },
 
-               update: function() {
+               update: function () {
                        if ( $(this.elem).is('input') ) {
-                               this.elem.value = this.getValue();
+                               this.options.val = this.getValue();
+                               this.elem.value = this.options.val;
                        }
                        $(this.elem).trigger('date-changed', this.getValue() );
                },
 
-               _parsePattern: function( pattern ) {
-                       var regex = /^(\/|\s|dd|d|MMMM|MMM|MM|M|yyyy|yy|y|hh|h|HH|H|mm|m|ss|s|tt|t|f|gg|g)|('.*?')/;
-                       var token = [];
+               _parsePattern: function ( pattern ) {
+                       var regex = /^(\/|\s|dd|d|MMMM|MMM|MM|M|yyyy|yy|y|hh|h|HH|H|mm|m|ss|s|tt|t|f|gg|g)|('[\w\W\s]*?')/,
+                               token = [],
+                               s;
 
                        while ( pattern.length > 0 ) {
-                               var s = regex.exec( pattern );
+                               s = regex.exec( pattern );
                                if ( s ) {
                                        pattern = pattern.substr( s[0].length );
                                        if ( s[0].charAt(0) == "'" ) {
                        return token;
                },
 
-               _create: function() {
-                       var input = this.element;
-                       var type = $(input).attr("type");
+               _create: function () {
+                       var input = this.element.get(0),
+                               type = $(input).attr("type"),
+                               isTime,
+                               isDate,
+                               val,
+                               now,
+                               data,
+                               local,
+                               obj = this,
+                               $div;
+
                        if ( type ) {
-                               this.options.type = type;
+                               obj.options.type = type;
                        }
 
-                       var isTime = type.indexOf("time") > -1;
-                       var isDate = type.indexOf("date") > -1;
-
-                       $.extend( this, {
+                       isTime = type.indexOf("time") > -1;
+                       isDate = type.indexOf("date") > -1;
+                       $.extend( obj, {
                                elem: input,
                                time: isTime,
                                date: isDate,
-                               calendar: Globalize.culture().calendars.standard,
+                               calendar: window.Globalize.culture().calendars.standard,
                                data: {
-                                       now             : new Date(),
                                        "hour"  : 0,
                                        "min"   : 0,
                                        "sec"   : 0,
                                        "year"  : 0,
                                        "month" : 0,
                                        "day"   : 0
-                               },
+                               }
 
                        });
 
                        // init date&time
-                       var now = this.data.now;
-                       var data = this.data;
+                       val = this.options.val;
+                       if ( val ) {
+                               now = new Date( Date.parse( val ) );
+                       } else {
+                               now = new Date();
+                       }
+
+                       data = obj.data;
                        if ( isDate ) {
-                               if ( this.calendar.convert ) {
-                                       var local = this.calendar.convert.fromGregorian(
-                                                       this.data.now );
-                                       data["year"] = local.year;
-                                       data["month"] = local.month + 1;
-                                       data["day"] = local.day;
+                               if ( obj.calendar.convert ) {
+                                       local = obj.calendar.convert.fromGregorian( now );
+                                       data.year = local.year;
+                                       data.month = local.month + 1;
+                                       data.day = local.day;
                                } else {
-                                       data["year"] = now.getFullYear();
-                                       data["month"] = now.getMonth() + 1;
-                                       data["day"] = now.getDate();
+                                       data.year = now.getFullYear();
+                                       data.month = now.getMonth() + 1;
+                                       data.day = now.getDate();
                                }
                        }
 
                        if ( isTime ) {
-                               data["hour"] = now.getHours();
-                               data["min"] = now.getMinutes();
-                               data["sec"] = now.getSeconds();
+                               data.hour = now.getHours();
+                               data.min = now.getMinutes();
+                               data.sec = now.getSeconds();
                        }
 
                        $(input).css('display', 'none');
                        $(input).after( $div );
                        this._initField( this.options.type, $div );
                        $div.trigger('create');
-                       var obj = this;
-                       $div.bind('vclick', function(e) {
+
+                       $div.bind('vclick', function ( e ) {
                                obj._showDataSelector( obj, this, e.target );
                        });
-                       $div.find('.ui-datefield-ampm').bind( 'vclick', function(e) {
+
+                       $div.find('.ui-datefield-ampm').bind( 'vclick', function ( e ) {
                                obj._switchAmPm( obj, this );
                        });
                },
 
-               _populateDataSelector: function( field, pat, obj ) {
-                       var values, numItems, current, data;
+               _populateDataSelector: function ( field, pat, obj ) {
+                       var values,
+                               numItems,
+                               current,
+                               data,
+                               range = window.range,
+                               local,
+                               yearlb,
+                               yearhb,
+                               day;
+
+
                        switch ( field ) {
                        case 'hour':
                                if ( pat == 'H' ) {
                                        // twentyfour
                                        values = range( 0, 23 );
                                        data = range( 0, 23 );
-                                       current = obj.data["hour"];
+                                       current = obj.data.hour;
                                } else {
                                        values = range( 1, 12 );
-                                       current = obj.data["hour"] - 1;//11
+                                       current = obj.data.hour - 1;//11
                                        if ( current >= 11 ) {
                                                current = current - 12;
                                                data = range( 13, 23 );
                                        values = values.map( obj._makeTwoDigits );
                                }
                                data = range( 0, 59 );
-                               current = ( field == 'min' ? obj.data["min"] : obj.data["sec"] );
+                               current = ( field == 'min' ? obj.data.min : obj.data.sec );
                                numItems = values.length;
                                break;
                        case 'year':
-                               var local = new Date( 1900, 0, 1 );
-                               var yearlb;
-                               var yearhb;
+                               local = new Date( 1900, 0, 1 );
                                if ( obj.calendar.convert ) {
                                        local = obj.calendar.convert.fromGregorian( local );
                                        yearlb = local.year;
                                        yearhb = yearlb + 200;
                                }
                                data = range( yearlb, yearhb );
-                               current = obj.data["year"] - yearlb;
+                               current = obj.data.year - yearlb;
                                values = range( yearlb, yearhb );
                                numItems = values.length;
                                break;
                                        }
                                }
                                data = range( 1, values.length );
-                               current = obj.data["month"] - 1;
+                               current = obj.data.month - 1;
                                numItems = values.length;
                                break;
                        case 'day':
                                //@TODO max number 31 -> depends on month
-                               var day = 31;
+                               day = 31;
                                values = range( 1, day );
                                if ( pat.length == 2 ) {
                                        values = values.map( obj._makeTwoDigits );
                                }
                                data = range( 1, day );
-                               current = obj.data["day"] - 1;
+                               current = obj.data.day - 1;
                                numItems = day;
                                break;
                        }
 
                },
 
-               _showDataSelector: function( obj, ui, target ) {
+               _showDataSelector: function ( obj, ui, target ) {
                        target = $(target);
 
-                       var attr = target.attr("class");
+                       var attr = target.attr("class"),
+                               field = attr.match(/ui-datefield-([\w]*)/),
+                               pat,
+                               data,
+                               values,
+                               numItems,
+                               current,
+                               valuesData,
+                               item,
+                               $li,
+                               $item,
+                               $ul,
+                               $div,
+                               $ctx;
+
                        if ( !attr ) {
                                return;
                        }
-                       var field = attr.match(/ui-datefield-([^ ]*)/);
                        if ( !field ) {
                                return;
                        }
 
                        target.not('.ui-datefield-seperator').addClass('ui-datefield-selected');
 
-                       var pat = target.jqmData('pat');
-                       var data = obj._populateDataSelector( field[1], pat, obj );
+                       pat = target.jqmData('pat');
+                       data = obj._populateDataSelector( field[1], pat, obj );
 
-                       var values = data.values,
-                               numItems = data.numItems;
-                               current = data.current;
-                               valuesData = data.data;
+                       values = data.values;
+                       numItems = data.numItems;
+                       current = data.current;
+                       valuesData = data.data;
 
                        if ( values ) {
                                $ul = $(document.createElement('ul'));
                                }
 
                                /* TODO NEED TO REFACTORING HERE */
-                               var $div = $(document.createElement('div'));
+                               $div = $(document.createElement('div'));
                                $div.append( $ul ).appendTo( ui );
                                $div.addClass('ui-datetimepicker-selector');
                                $div.attr( 'data-transition', 'none' );
-                               var $ctx = $div.ctxpopup();
+                               $ctx = $div.ctxpopup();
                                $ctx.parents('.ui-popupwindow').addClass('ui-datetimepicker');
                                $div.circularview();
                                $div.circularview( 'centerTo', '.current' );
                                $ctx.popupwindow( 'open',
                                                target.offset().left + target.width() / 2 - window.pageXOffset,
                                                target.offset().top + target.height() - window.pageYOffset );
-                               $div.bind('closed', function(e) {
+                               $div.bind('closed', function ( e ) {
                                        $div.unbind( 'closed' );
                                        $ul.unbind( 'vclick' );
                                        $(obj).unbind( 'update' );
                                        $div.remove();
                                });
 
-                               $(obj).bind( 'update', function( e, val ) {
+                               $(obj).bind( 'update', function ( e, val ) {
                                        $ctx.popupwindow( 'close' );
                                        var data = $(ui).find( '.' + field[0] );
                                        obj._updateField( $(data), val );
                                        obj.update();
                                });
 
-                               $ul.bind( 'vclick', function( e ) {
+                               $ul.bind( 'vclick', function ( e ) {
                                        if ( $(e.target).is('a') ) {
                                                $ul.find(".current").removeClass("current");
                                                $(e.target).parent().addClass('current');
                        }
                },
 
-               _initField: function( type, div ){
-                       var updateFields = function( obj, html, attr ) {
-                               for( item in attr ) {
-                                       if ( attr[item] ) {
-                                               obj._updateField( $(html).find( '.ui-datefield-' + item ),
-                                                       obj.data[item] );
+               _initField: function ( type, div ) {
+                       var date,
+                               time,
+                               datetime,
+                               updateFields = function ( obj, html, attr ) {
+                                       var item;
+                                       for ( item in attr ) {
+                                               if ( attr[item] ) {
+                                                       obj._updateField( $(html).find( '.ui-datefield-' + item ),
+                                                               obj.data[item] );
+                                               }
                                        }
-                               }
-                       };
+                               };
 
                        if ( this.options.format ) {
-                               var datetime = this._format( this.options.format );
+                               datetime = this._format( this.options.format );
                                updateFields( this, datetime.html, datetime.attr );
                                div.append( datetime.html );
                        } else {
                                if ( type.match( 'date' ) ) {
-                                       var date = this._format( this.calendar.patterns.d );
+                                       date = this._format( this.calendar.patterns.d );
                                        $(date.html).addClass('date');
                                        updateFields( this, date.html, date.attr );
                                        div.append( date.html );
                                }
 
                                if ( type.match( 'time' ) ) {
-                                       var time = this._format( this.calendar.patterns.t );
+                                       time = this._format( this.calendar.patterns.t );
                                        $(time.html).addClass('time');
                                        updateFields( this, time.html, time.attr );
                                        div.append( time.html );
                                }
                        }
-               },
+               }
 
        });
 
-       $(document).bind("pagecreate create", function(e) {
+       $(document).bind("pagecreate create", function ( e ) {
                $($.tizen.datetimepicker.prototype.options.initSelector, e.target)
                        .not(":jqmData(role='none'), :jqmData(role='nojs')")
                        .datetimepicker();
        });
 
-})(jQuery, this);
+} ( jQuery, this ) );
index 87c66af..e8c7420 100644 (file)
@@ -4,7 +4,7 @@
  * original by: Waldo Malqui Silva
  * version: 1107.2516
  */
-function range (low, high, step) {
+function range( low, high, step ) {
     // Create an array containing the range of integers or characters
     // from low to high (inclusive)  
     // 
@@ -19,11 +19,13 @@ function range (low, high, step) {
     // *     returns 3: ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i']
     // *     example 4: range( 'c', 'a' );
     // *     returns 4: ['c', 'b', 'a']
-    var matrix = [];
-    var inival, endval, plus;
-    var walker = step || 1;
-    var chars = false;
+       var matrix = [],
+               inival,
+               endval,
+               plus,
+               walker = step || 1,
+               chars = false;
+
     if (!isNaN(low) && !isNaN(high)) {
         inival = low;
         endval = high;
@@ -35,7 +37,7 @@ function range (low, high, step) {
         inival = (isNaN(low) ? 0 : low);
         endval = (isNaN(high) ? 0 : high);
     }
+
     plus = ((inival > endval) ? false : true);
     if (plus) {
         while (inival <= endval) {
@@ -48,7 +50,7 @@ function range (low, high, step) {
             inival -= walker;
         }
     }
+
     return matrix;
 }
 
index 028684f..5ae570d 100755 (executable)
 //     days: array of day names, Sunday first; defaults to English day
 //           names; the first letters are used as text for the checkboxes
 
-(function ($, window, undefined) {
-    $.widget("tizen.dayselector", $.mobile.widget, {
-        options: {
-            initSelector: 'fieldset:jqmData(role="dayselector")',
-            theme: null,
-            type: 'horizontal',
-            days: ['Sunday',
-                   'Monday',
-                   'Tuesday',
-                   'Wednesday',
-                   'Thursday',
-                   'Friday',
-                   'Saturday']
-        },
-
-        defaultTheme: 'c',
-
-        _create: function () {
-            this.element.addClass('ui-dayselector');
-
-            this.options.type = this.element.jqmData('type') || this.options.type;
-
-            this.options.theme = this.element.jqmData('theme') ||
-                                 this.options.theme ||
-                                 this.element.closest(':jqmData(theme)').jqmData('theme') ||
-                                 this.defaultTheme;
-
-            var days = this.options.days;
-
-            this.element.attr('data-' + $.mobile.ns + 'type', this.options.type);
-
-            var parentId = this.element.attr('id') ||
-                           'dayselector' + (new Date()).getTime();
-
-            for (var i = 0; i < days.length; i++) {
-                var day = days[i];
-                var letter = day.slice(0, 1);
-                               if ( Globalize ) {
+(function ( $, window, undefined ) {
+       $.widget( "tizen.dayselector", $.mobile.widget, {
+               options: {
+                       initSelector: 'fieldset:jqmData(role="dayselector")',
+                       theme: null,
+                       type: 'horizontal',
+                       days: ['Sunday',
+                              'Monday',
+                              'Tuesday',
+                              'Wednesday',
+                              'Thursday',
+                              'Friday',
+                              'Saturday']
+               },
+
+               defaultTheme: 'c',
+
+               _create: function () {
+                       var days,
+                               parentId,
+                               i,
+                               day,
+                               letter,
+                               id,
+                               labelClass,
+                               checkbox,
+                               label;
+
+                       this.element.addClass( 'ui-dayselector' );
+
+                       this.options.type = this.element.jqmData( 'type' ) || this.options.type;
+
+                       this.options.theme = this.element.jqmData( 'theme' ) ||
+                                                                       this.options.theme ||
+                                                                       this.element.closest( ':jqmData(theme)').jqmData('theme' ) ||
+                                                                       this.defaultTheme;
+
+                       days = this.options.days;
+
+                       this.element.attr( 'data-' + $.mobile.ns + 'type', this.options.type );
+
+                       parentId = this.element.attr( 'id' ) ||
+                                                       'dayselector' + ( new Date() ).getTime();
+
+                       for ( i = 0; i < days.length; i++ ) {
+                               day = days[i];
+                               letter = day.slice(0, 1);
+
+                               if ( window.Globalize ) {
                                        //TODO may some modification required to support
                                        //      start week day difference upon cultures.
-                                       letter = Globalize.culture().calendars.standard.days.namesShort[i];
+                                       letter = window.Globalize.culture().calendars.standard.days.namesShort[i];
                                }
-                var id = parentId + '_' + i;
-                var labelClass = 'ui-dayselector-label-' + i;
-
-                var checkbox = $('<input type="checkbox"/>')
-                               .attr('id', id)
-                               .attr('value', i);
-
-                var label = $('<label>' + letter + '</label>')
-                            .attr('for', id)
-                            .addClass(labelClass);
-
-                this.element.append(checkbox);
-                this.element.append(label);
-            }
-
-            this.checkboxes = this.element.find(':checkbox')
-                                          .checkboxradio({theme: this.options.theme});
-
-            this.element.controlgroup({excludeInvisible: false});
-        },
-
-        _setOption: function(key, value) {
-            if (key === "disabled")
-                this._setDisabled(value);
-        },
-
-        _setDisabled: function(value) {
-            $.Widget.prototype._setOption.call(this, "disabled", value);
-            this.element[value ? "addClass" : "removeClass"]("ui-disabled");
-        },
-
-        value: function () {
-            var values = this.checkboxes.filter(':checked').map(function () {
-                return this.value;
-            }).get();
-
-            return values;
-        },
-
-        selectAll: function () {
-            this.checkboxes.attr('checked', 'checked')
-                           .checkboxradio('refresh');
-        }
-
-    }); /* End of Widget */
-
-    // auto self-init widgets
-    $(document).bind("pagebeforecreate", function (e) {
-        var elts = $($.tizen.dayselector.prototype.options.initSelector, e.target);
-        elts.not(":jqmData(role='none'), :jqmData(role='nojs')").dayselector();
-    });
-
-})(jQuery, this);
+                               id = parentId + '_' + i;
+                               labelClass = 'ui-dayselector-label-' + i;
+
+                               checkbox = $( '<input type="checkbox"/>' )
+                                                       .attr( 'id', id )
+                                                       .attr( 'value', i );
+
+                               label = $( '<label>' + letter + '</label>' )
+                                               .attr( 'for', id )
+                                               .addClass( labelClass );
+
+                               this.element.append( checkbox );
+                               this.element.append( label );
+                       }
+
+                       this.checkboxes = this.element
+                                                               .find( ':checkbox' )
+                                                               .checkboxradio( { theme: this.options.theme } );
+
+                       this.element.controlgroup( { excludeInvisible: false } );
+               },
+
+               _setOption: function ( key, value ) {
+                       if ( key === "disabled" ) {
+                               this._setDisabled( value );
+                       }
+               },
+
+               _setDisabled: function ( value ) {
+                       $.Widget.prototype._setOption.call(this, "disabled", value);
+                       this.element[value ? "addClass" : "removeClass"]("ui-disabled");
+               },
+
+               value: function () {
+                       var values = this.checkboxes.filter( ':checked' ).map( function () {
+                               return this.value;
+                       } ).get();
+
+                       return values;
+               },
+
+               selectAll: function () {
+                       this.checkboxes
+                               .attr( 'checked', 'checked' )
+                               .checkboxradio( 'refresh' );
+               }
+
+       } ); /* End of Widget */
+
+       // auto self-init widgets
+       $( document ).bind( "pagebeforecreate", function ( e ) {
+               var elts = $( $.tizen.dayselector.prototype.options.initSelector, e.target );
+               elts.not( ":jqmData(role='none'), :jqmData(role='nojs')" ).dayselector();
+       } );
+
+}( jQuery, this ) );
index a8ca963..dcf0e11 100644 (file)
@@ -1,3 +1,25 @@
+/* ***************************************************************************
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ */
 /**
  * Displays vertical multi-level list.
  *
  *     <li data-expanded-by="exp1">Child</li>
  */
 
-(function ($, undefined) {
-
-$.widget("todons.expandablelist", $.mobile.widget, {
-       options: {
-               initSelector: ":jqmData(expandable='true')",
-       },
-
-       _hide: function(e) {
-               $(e).removeClass('ui-li-expand-transition-show')
-                       .addClass('ui-li-expand-transition-hide');
-       },
-       _show: function(e) {
-               $(e).removeClass('ui-li-expand-transition-hide')
-                       .addClass('ui-li-expand-transition-show');
-       },
-       _hide_expand_img: function(e) {
-               $(e).removeClass('ui-li-expandable-hidden')
-                       .addClass('ui-li-expandable-shown');
-
-               $(e).find( ".ui-li-expand-icon" )
-                       .addClass( "ui-li-expanded-icon" )
-                       .removeClass( "ui-li-expand-icon" );
-       },
-       _show_expand_img: function(e) {
-               $(e).removeClass('ui-li-expandable-shown')
-                       .addClass('ui-li-expandable-hidden');
-
-               $(e).find( ".ui-li-expanded-icon" )
-                       .addClass( "ui-li-expand-icon" )
-                       .removeClass( "ui-li-expanded-icon" );
-       },
-
-       _set_expand_arrow: function(self, e, parent_is_expanded) {
-                       if (parent_is_expanded) {
-                               self._hide_expand_img(e);
+( function ( $, undefined ) {
+
+       $.widget( "tizen.expandablelist", $.mobile.widget, {
+               options: {
+                       initSelector: ":jqmData(expandable='true')"
+               },
+
+               _hide: function ( e ) {
+                       $( e ).removeClass( 'ui-li-expand-transition-show' )
+                               .addClass( 'ui-li-expand-transition-hide' );
+               },
+               _show: function ( e ) {
+                       $( e ).removeClass( 'ui-li-expand-transition-hide' )
+                               .addClass( 'ui-li-expand-transition-show' );
+               },
+               _hide_expand_img: function ( e ) {
+                       $( e ).removeClass( 'ui-li-expandable-hidden' )
+                               .addClass( 'ui-li-expandable-shown' );
+
+                       $( e ).find( ".ui-li-expand-icon" )
+                               .addClass( "ui-li-expanded-icon" )
+                               .removeClass( "ui-li-expand-icon" );
+               },
+               _show_expand_img: function ( e ) {
+                       $( e ).removeClass( 'ui-li-expandable-shown' )
+                               .addClass( 'ui-li-expandable-hidden' );
+
+                       $( e ).find( ".ui-li-expanded-icon" )
+                               .addClass( "ui-li-expand-icon" )
+                               .removeClass( "ui-li-expanded-icon" );
+               },
+
+               _set_expand_arrow: function ( self, e, parent_is_expanded ) {
+                       if ( parent_is_expanded ) {
+                               self._hide_expand_img( e );
                        } else {
-                               self._show_expand_img(e);
+                               self._show_expand_img( e );
                        }
-                       if($(e[0]).data("expandable") && parent_is_expanded == false) {
-                               var children = $(e).nextAll(":jqmData(expanded-by='"+$(e).attr('id')+"')");
-                               children.each(function(idx, child) {
-                                       self._set_expand_arrow(self, child, e.is_expanded);
-                               });
+                       if ( $( e[0] ).data( "expandable" ) && parent_is_expanded == false ) {
+                               var children = $( e ).nextAll( ":jqmData(expanded-by='" + $( e ).attr( 'id' ) + "')" );
+                               children.each( function ( idx, child ) {
+                                       self._set_expand_arrow( self, child, e.is_expanded );
+                               } );
                        }
-       },
+               },
 
-       _toggle: function(self, e, parent_is_expanded) {
-               if (! parent_is_expanded) {
-                       self._show(e);
-               }
-               else {
-                       self._hide(e);
-                       if($(e).data("expandable") && e.is_expanded == true) {
-                               var children = $(e).nextAll(":jqmData(expanded-by='"+$(e).attr('id')+"')");
-                               children.each(function(idx, child) {
-                                       self._toggle(self, child, e.is_expanded);
-                               });
-                               e.is_expanded = false;
+               _toggle: function ( self, e, parent_is_expanded ) {
+                       if ( ! parent_is_expanded ) {
+                               self._show( e );
+                       } else {
+                               self._hide( e );
+                               if ( $( e ).data( "expandable" ) && e.is_expanded == true ) {
+                                       var children = $( e ).nextAll( ":jqmData(expanded-by='" + $( e ).attr( 'id' ) + "')" );
+                                       children.each( function ( idx, child ) {
+                                               self._toggle( self, child, e.is_expanded );
+                                       } );
+                                       e.is_expanded = false;
+                               }
+                       }
+               },
+               _is_hidden: function ( e ) {
+                       return ( $( e ).height( ) == 0);
+               },
+
+               _create: function ( ) {
+
+                       var children = $( this.element ).nextAll( ":jqmData(expanded-by='" + $( this.element ).attr( 'id' ) + "')" ),
+                               e = this.element,
+                               self = this,
+                               expanded = e.nextAll( ":jqmData(expanded-by='" + e[0].id + "')" ),
+                               initial_expansion = e.data( "initial-expansion" ),
+                               is_expanded = false,
+                               parent_id = null;
+
+                       if ( children.length == 0 ) {
+                               return;
                        }
-               }
-       },
-       _is_hidden: function(e) {
-               return ( $(e).height() == 0);
-       },
-
-       _create: function () {
-
-               var children = $(this.element).nextAll(":jqmData(expanded-by='"+$(this.element).attr('id')+"')");
-               if (children.length == 0) {
-                       return;
-               }
 
-               var e = this.element,
-                       self = this,
-                       expanded = e.nextAll(":jqmData(expanded-by='" + e[0].id + "')"),
-                       initial_expansion = e.data("initial-expansion");
-                       is_expanded = false;
+                       if ( initial_expansion == true ) {
+                               parent_id = e.data( "expanded-by" );
+                               if ( parent_id ) {
+                                       if ( $( "#" + parent_id ).is_expanded == true) {
+                                               is_expanded = true;
+                                       }
+                               } else {
+                                       is_expanded = true;
+                               }
+                       }
 
-               if(initial_expansion == true ) {
-                       var parent_id = e.data("expanded-by");
-                       if(parent_id) {
-                               if($("#"+parent_id).is_expanded == true)  is_expanded = true;
+                       e[0].is_expanded = is_expanded;
+                       if ( e[0].is_expanded ) {
+                               self._hide_expand_img( e );
+                               $(e).append( "<div class='ui-li-expanded-icon'></div>" );
                        } else {
-                               is_expanded = true;
+                               self._show_expand_img( e );
+                               $(e).append( "<div class='ui-li-expand-icon'></div>" );
                        }
-               }
 
-               e[0].is_expanded = is_expanded;
-               if (e[0].is_expanded) {
-                       self._hide_expand_img(e);
-                       $(e).append("<div class='ui-li-expanded-icon'></div>");
-               } else {
-                       self._show_expand_img(e);
-                       $(e).append("<div class='ui-li-expand-icon'></div>");
-               }
-
-               if(e[0].is_expanded) expanded.each(function(i, e) { self._show(e); });
-               else expanded.each(function(i, e) { self._hide(e); });
+                       if ( e[0].is_expanded ) {
+                               expanded.each( function ( i, e ) { self._show( e ); } );
+                       } else {
+                               expanded.each( function ( i, e ) { self._hide( e ); } );
+                       }
 
-               expanded.addClass("ui-li-expanded");
+                       expanded.addClass( "ui-li-expanded" );
 
-               e.bind('vclick', function() {
-                       var _is_expanded = e[0].is_expanded;
-                       expanded.each(function(i, e) { self._toggle(self, e, _is_expanded); });
-                       e[0].is_expanded = ! e[0].is_expanded;
+                       e.bind( 'vclick', function ( ) {
+                               var _is_expanded = e[0].is_expanded;
+                               expanded.each( function ( i, e ) { self._toggle( self, e, _is_expanded ); } );
+                               e[0].is_expanded = ! e[0].is_expanded;
 
-                       self._set_expand_arrow(self, e, e[0].is_expanded);
-               });
-       },
+                               self._set_expand_arrow( self, e, e[0].is_expanded );
+                       });
+               }
 
 
-});    // end: $.widget()
+       });     // end: $.widget()
 
 
-$(document).bind("pagecreate create", function (e) {
-       $($.todons.expandablelist.prototype.options.initSelector, e.target)
-    .not(":jqmData(role='none'), :jqmData(role='nojs')")
-       .expandablelist();
-});
+       $( document ).bind( "pagecreate create", function ( e ) {
+               $( $.tizen.expandablelist.prototype.options.initSelector, e.target )
+                       .not( ":jqmData(role='none'), :jqmData(role='nojs')" )
+                       .expandablelist( );
+       });
 
-})(jQuery);
+} ( jQuery ) );
index ff676d3..7d20590 100755 (executable)
-/*\r
+/* ***************************************************************************\r
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.\r
+ *\r
+ * Permission is hereby granted, free of charge, to any person obtaining a\r
+ * copy of this software and associated documentation files (the "Software"),\r
+ * to deal in the Software without restriction, including without limitation\r
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
+ * and/or sell copies of the Software, and to permit persons to whom the\r
+ * Software is furnished to do so, subject to the following conditions:\r
+ *\r
+ * The above copyright notice and this permission notice shall be included in\r
+ * all copies or substantial portions of the Software.\r
+ *\r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\r
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\r
+ * DEALINGS IN THE SOFTWARE.\r
+ * ***************************************************************************\r
+ *\r
  *     Author: Wongi Lee <wongi11.lee@samsung.com>\r
 */\r
 \r
 /**\r
- * Extendable List Widget for unlimited data.\r
- * To support more then 1,000 items, special list widget developed. \r
- * Fast initialize and append some element into the DOM tree repeatedly.\r
- * DB connection and works like DB cursor.     \r
- * \r
+ *     Extendable List Widget for unlimited data.\r
+ *     To support more then 1,000 items, special list widget developed.\r
+ *     Fast initialize and append some element into the DOM tree repeatedly.\r
+ *     DB connection and works like DB cursor.\r
+ *\r
  * HTML Attributes:\r
  *\r
  *             data-role:      extendablelist\r
- *             data-template : jQuery.template ID that populate into extendable list. A button : a <DIV> element with "data-role : button" should be included on data-template. \r
+ *             data-template : jQuery.template ID that populate into extendable list. A button : a <DIV> element with "data-role : button" should be included on data-template.\r
  *             data-dbtable : DB Table name. It used as window[DB NAME]. Loaded data should be converted as window object.\r
- *             data-extenditems : Number of elements to extend at once. \r
+ *             data-extenditems : Number of elements to extend at once.\r
  *             \r
  *             ID : <UL> element that has "data-role=extendablelist" must have ID attribute.\r
  *             Class : <UL> element that has "data-role=extendablelist" should have "vlLoadSuccess" class to guaranty DB loading is completed.\r
- *             tmp_load_more : Template ID for "load more" message and button. \r
+ *             tmp_load_more : Template ID for "load more" message and button.\r
  *\r
  *\r
- * APIs:\r
+ *APIs:\r
  *\r
  *             create ( void )\r
  *                     : API to call _create method. API for AJAX or DB loading callback.\r
  *\r
  *             recreate ( Array )\r
- *                     : Update extendable list with new data array. For example, update with search result. \r
+ *                     : Update extendable list with new data array. For example, update with search result.\r
+ *\r
+ *Examples:\r
  *\r
- * Examples:\r
- * \r
- *             <script id="tmp-3-1-1" type="text/x-jquery-tmpl">\r
+ *             <script id="tmp-3-1-1" type="text/x-jquery-tmpl">\r
  *                     <li class="ui-li-3-1-1"><span class="ui-li-text-main">${NAME}</span></li>\r
  *             </script>\r
- * \r
+ *\r
  *             <script id="tmp_load_more" type="text/x-jquery-tmpl"> \r
- *                     <li class="ui-li-3-1-1" style="text-align:center; margin:0 auto">\r
- *                             <div data-role="button">Load ${NUM_MORE_ITEMS} more items</div>\r
- *                     </li>\r
- *             </script>\r
- *     \r
- *             <ul id = "extendable_list_main" data-role="extendablelist" data-extenditems="50" data-template="tmp-3-1-1" data-dbtable="JSON_DATA">\r
- *             </ul>\r
- * \r
+ *                     <li class="ui-li-3-1-1" style="text-align:center; margin:0 auto">\r
+ *                             <div data-role="button">Load ${NUM_MORE_ITEMS} more items</div>\r
+ *                     </li>\r
+ *             </script>\r
+ *     \r
+ *             <ul id = "extendable_list_main" data-role="extendablelist" data-extenditems="50" data-template="tmp-3-1-1" data-dbtable="JSON_DATA">\r
+ *             </ul>\r
+ *\r
  */\r
 \r
 \r
-(function( $, undefined ) {\r
-\r
-//Keeps track of the number of lists per page UID\r
-//This allows support for multiple nested list in the same page\r
-//https://github.com/jquery/jquery-mobile/issues/1617\r
-var listCountPerPage = {};\r
-\r
-var    TOTAL_ITEMS = 0;\r
-\r
-var i =0;\r
-var last_index = 0;\r
-\r
-$.widget( "tizen.extendablelist", $.mobile.widget, {\r
-       options: {\r
-               theme: "s",\r
-               countTheme: "c",\r
-               headerTheme: "b",\r
-               dividerTheme: "b",\r
-               splitIcon: "arrow-r",\r
-               splitTheme: "b",\r
-               inset: false,\r
-               id:     "",                                             /* Extendable list UL elemet's ID */\r
-               extenditems: 50,                        /* Number of append items */ \r
-               childSelector: " li",           /* To support swipe list */\r
-               dbtable: "",\r
-               template : "",                          /* Template for each list item */\r
-               loadmore : "tmp_load_more",     /* Template for "Load more" message */\r
-               scrollview: false,\r
-               initSelector: ":jqmData(role='extendablelist')"\r
-       },\r
-\r
-       _stylerMouseUp: function() {\r
-               $( this ).addClass( "ui-btn-up-s" );\r
-               $( this ).removeClass( "ui-btn-down-s" );\r
-       },\r
-\r
-       _stylerMouseDown: function() {\r
-               $( this ).addClass( "ui-btn-down-s" );\r
-               $( this ).removeClass( "ui-btn-up-s" );\r
-       },\r
-       \r
-       _stylerMouseOver: function() {\r
-               $( this ).toggleClass( "ui-btn-hover-s" );              \r
-       },\r
-       \r
-       _stylerMouseOut: function() {\r
-               $( this ).toggleClass( "ui-btn-hover-s" );\r
-       },\r
-\r
-       _pushData: function ( template, data ) {\r
-               var o = this.options;\r
-               \r
-               var dataTable = data;\r
-               \r
-               var myTemplate = $( "#" + template );\r
-               \r
-               var loadMoreItems = ( o.extenditems > data.length - last_index ? data.length - last_index : o.extenditems); \r
-               \r
-               for (i = 0; i < loadMoreItems; i++ ) \r
-               {\r
-                       var htmlData = myTemplate.tmpl( dataTable[ i ]);\r
-                       $( o.id ).append( $( htmlData ).attr( 'id', 'li_'+i ) );\r
-                       last_index++;\r
-               }\r
-               \r
-               /* After push data, re-style extendable list widget */\r
-               $( o.id ).trigger( "create" );\r
-       },\r
-       \r
-       _loadmore: function( event ){\r
-               var t = this;\r
-               var o = event.data;\r
-       \r
-               /* Remove load more message */\r
-               $( "#load_more_message" ).remove();\r
-\r
-               /* Append items */\r
-               var dataTable = window[ o.dbtable ];\r
-               var myTemplate = $( "#" + o.template );\r
-               \r
-               var loadMoreItems = ( o.extenditems > dataTable.length - last_index ? dataTable.length - last_index : o.extenditems ); \r
-               \r
-               for ( i = 0; i < loadMoreItems; i++ ) \r
-               {\r
-                       last_index++;\r
-                       var htmlData = myTemplate.tmpl( dataTable[ last_index ] );\r
-                       $( o.id ).append( $( htmlData ).attr( 'id', 'li_' + last_index ) );\r
-               }\r
-               \r
-               /* Append "Load more" message on the last of list */\r
-           if ( TOTAL_ITEMS > last_index ) {\r
-               var myTemplate = $( "#" + o.loadmore );\r
-               var more_items_to_load = TOTAL_ITEMS - last_index;\r
-               var num_next_load_items = ( o.extenditems <= more_items_to_load ) ? o.extenditems : more_items_to_load;\r
-               var htmlData = myTemplate.tmpl( { NUM_MORE_ITEMS : num_next_load_items } );\r
-               \r
-               $( o.id ).append( $( htmlData ).attr( 'id', "load_more_message" ) );\r
-           }\r
-           \r
-           $( o.id ).trigger( "create" );\r
-           $( o.id ).extendablelist( "refresh" );\r
-       },\r
-       \r
-       recreate: function( newArray ) {\r
-               var t = this;\r
-               var o = this.options;\r
-               \r
-               $( o.id ).empty();\r
-               \r
-               TOTAL_ITEMS = newArray.length;\r
-               \r
-               t._pushData( ( o.template), newArray );\r
-               \r
-               if ( o.childSelector == " ul" ) {\r
-                       $( o.id + " ul" ).swipelist();  \r
-               }\r
-               \r
-               $( o.id ).extendablelist();\r
-               \r
-               t.refresh( true );\r
-       },\r
-\r
-       _initList: function(){\r
-               var t = this;\r
-               var o = this.options;\r
-               \r
-               /* After AJAX loading success */\r
-               o.dbtable = t.element.data( "dbtable" );\r
-               \r
-               TOTAL_ITEMS = $( window[ o.dbtable ] ).size();\r
-               \r
-        /* Make Gen list by template */\r
-               if ( last_index <= 0 ) {\r
-                       t._pushData( ( o.template ), window[ o.dbtable ] );\r
-\r
-                   /* Append "Load more" message on the last of list */\r
-                   if ( TOTAL_ITEMS > last_index ) {\r
-                       var myTemplate = $( "#" + o.loadmore );\r
-                       var more_items_to_load = TOTAL_ITEMS - last_index;\r
-                       var num_next_load_items = ( o.extenditems <= more_items_to_load) ? o.extenditems : more_items_to_load;\r
-                       var htmlData = myTemplate.tmpl( { NUM_MORE_ITEMS : num_next_load_items } );\r
-                       \r
-                       $( o.id ).append( $( htmlData ).attr( 'id', "load_more_message" ) );\r
-                       \r
-                       $( "#load_more_message" ).live( "click", t.options, t._loadmore );\r
-                   }\r
-                   else {\r
-                       /* No more items to load */\r
-                       $( "#load_more_message" ).die();\r
-                       $( "#load_more_message" ).remove();\r
-                   }\r
-               }\r
+( function ( $, undefined ) {\r
+\r
+       //Keeps track of the number of lists per page UID\r
+       //This allows support for multiple nested list in the same page\r
+       //https://github.com/jquery/jquery-mobile/issues/1617\r
+       var listCountPerPage = {},\r
+               TOTAL_ITEMS = 0,\r
+               last_index = 0;\r
+\r
+       $.widget( "tizen.extendablelist", $.mobile.widget, {\r
+               options: {\r
+                       theme: "s",\r
+                       countTheme: "c",\r
+                       headerTheme: "b",\r
+                       dividerTheme: "b",\r
+                       splitIcon: "arrow-r",\r
+                       splitTheme: "b",\r
+                       inset: false,\r
+                       id:     "",                                             /* Extendable list UL elemet's ID */\r
+                       extenditems: 50,                        /* Number of append items */\r
+                       childSelector: " li",           /* To support swipe list */\r
+                       dbtable: "",\r
+                       template : "",                          /* Template for each list item */\r
+                       loadmore : "tmp_load_more",     /* Template for "Load more" message */\r
+                       scrollview: false,\r
+                       initSelector: ":jqmData(role='extendablelist')"\r
+               },\r
+\r
+               _stylerMouseUp: function () {\r
+                       $( this ).addClass( "ui-btn-up-s" );\r
+                       $( this ).removeClass( "ui-btn-down-s" );\r
+               },\r
+\r
+               _stylerMouseDown: function () {\r
+                       $( this ).addClass( "ui-btn-down-s" );\r
+                       $( this ).removeClass( "ui-btn-up-s" );\r
+               },\r
+\r
+               _stylerMouseOver: function () {\r
+                       $( this ).toggleClass( "ui-btn-hover-s" );\r
+               },\r
+\r
+               _stylerMouseOut: function () {\r
+                       $( this ).toggleClass( "ui-btn-hover-s" );\r
+               },\r
+\r
+               _pushData: function ( template, data ) {\r
+                       var o = this.options,\r
+                               i = 0,\r
+                               dataTable = data,\r
+                               myTemplate = $( "#" + template ),\r
+                               loadMoreItems = ( o.extenditems > data.length - last_index ? data.length - last_index : o.extenditems ),\r
+                               htmlData;\r
+\r
+                       for (i = 0; i < loadMoreItems; i++ ) {\r
+                               htmlData = myTemplate.tmpl( dataTable[ i ] );\r
+                               $( o.id ).append( $( htmlData ).attr( 'id', 'li_' + i ) );\r
+                               last_index++;\r
+                       }\r
+\r
+                       /* After push data, re-style extendable list widget */\r
+                       $( o.id ).trigger( "create" );\r
+               },\r
+\r
+               _loadmore: function ( event ) {\r
+                       var t = this,\r
+                               o = event.data,\r
+                               i = 0,\r
+                               dataTable = window[ o.dbtable ],\r
+                               myTemplate = $( "#" + o.template ),\r
+                               loadMoreItems = ( o.extenditems > dataTable.length - last_index ? dataTable.length - last_index : o.extenditems ),\r
+                               htmlData,\r
+                               more_items_to_load,\r
+                               num_next_load_items;\r
+\r
+                       /* Remove load more message */\r
+                       $( "#load_more_message" ).remove();\r
+\r
+                       /* Append More Items */\r
+                       for ( i = 0; i < loadMoreItems; i++ ) {\r
+                               htmlData = myTemplate.tmpl( dataTable[ last_index ] );\r
+                               $( o.id ).append( $( htmlData ).attr( 'id', 'li_' + last_index ) );\r
+                               last_index++;\r
+                       }\r
+\r
+                       /* Append "Load more" message on the last of list */\r
+                       if ( TOTAL_ITEMS > last_index ) {\r
+                               myTemplate = $( "#" + o.loadmore );\r
+                               more_items_to_load = TOTAL_ITEMS - last_index;\r
+                               num_next_load_items = ( o.extenditems <= more_items_to_load ) ? o.extenditems : more_items_to_load;\r
+                               htmlData = myTemplate.tmpl( { NUM_MORE_ITEMS : num_next_load_items } );\r
+\r
+                               $( o.id ).append( $( htmlData ).attr( 'id', "load_more_message" ) );\r
+                       }\r
+\r
+                       $( o.id ).trigger( "create" );\r
+                       $( o.id ).extendablelist( "refresh" );\r
+               },\r
+\r
+               recreate: function ( newArray ) {\r
+                       var t = this,\r
+                               o = this.options;\r
 \r
-           if ( o.childSelector == " ul" ) {\r
-                       $( o.id + " ul" ).swipelist();\r
-               }\r
-           \r
-           $( o.id ).trigger( "create" );\r
-           \r
-               t.refresh( true );\r
-       },\r
-       \r
-       \r
-       \r
-       create: function() {\r
-               var o = this.options;\r
-\r
-               /* external API for AJAX callback */\r
-               this._create( "create" );\r
-       },\r
-       \r
-       _create: function( event ) {\r
-               var t = this;\r
-               var o = this.options; \r
-               \r
-               // create listview markup\r
-               t.element.addClass( function( i, orig ) {\r
-                       return orig + " ui-listview ui-extendable-list-container" + ( t.options.inset ? " ui-listview-inset ui-corner-all ui-shadow " : "" );\r
-               });\r
-\r
-        var $el = this.element;\r
-               \r
-        o.id = "#" + $el.attr( "id" );\r
-        \r
-        if ( $el.data( "extenditems" ) ) {\r
-               o.extenditems = parseInt( $el.data( "extenditems" ) );\r
-        }\r
-        \r
-           $( o.id ).bind( "pagehide", function(e){\r
                        $( o.id ).empty();\r
-               });\r
-           \r
-           /* Scroll view */\r
-           ( $( ".ui-scrollview-clip" ).size() > 0) ? o.scrollview = true : o.scrollview = false;\r
-\r
-           /* After DB Load complete, Init Vritual list */\r
-           if ( $( o.id ).hasClass( "vlLoadSuccess" ) ) {\r
-                   if ( $el.data( "template" ) ) {\r
-                               o.template = $el.data( "template" );\r
-                               \r
-                       /* to support swipe list, <li> or <ul> can be main node of extendable list. */\r
-                               if ( $el.data( "swipelist" ) == true ) {\r
-                                       o.childSelector = " ul";\r
-                               }\r
-                               else {\r
-                                       o.shildSelector = " li";\r
+\r
+                       TOTAL_ITEMS = newArray.length;\r
+\r
+                       t._pushData( ( o.template), newArray );\r
+\r
+                       if ( o.childSelector == " ul" ) {\r
+                               $( o.id + " ul" ).swipelist();\r
+                       }\r
+\r
+                       $( o.id ).extendablelist();\r
+\r
+                       t.refresh( true );\r
+               },\r
+\r
+               _initList: function () {\r
+                       var t = this,\r
+                               o = this.options,\r
+                               myTemplate,\r
+                               more_items_to_load,\r
+                               num_next_load_items,\r
+                               htmlData;\r
+\r
+                       /* After AJAX loading success */\r
+                       o.dbtable = t.element.data( "dbtable" );\r
+\r
+                       TOTAL_ITEMS = $( window[ o.dbtable ] ).size();\r
+\r
+                       /* Make Gen list by template */\r
+                       if ( last_index <= 0 ) {\r
+                               t._pushData( ( o.template ), window[ o.dbtable ] );\r
+\r
+                               /* Append "Load more" message on the last of list */\r
+                               if ( TOTAL_ITEMS > last_index ) {\r
+                                       myTemplate = $( "#" + o.loadmore );\r
+                                       more_items_to_load = TOTAL_ITEMS - last_index;\r
+                                       num_next_load_items = ( o.extenditems <= more_items_to_load) ? o.extenditems : more_items_to_load;\r
+                                       htmlData = myTemplate.tmpl( { NUM_MORE_ITEMS : num_next_load_items } );\r
+\r
+                                       $( o.id ).append( $( htmlData ).attr( 'id', "load_more_message" ) );\r
+\r
+                                       $( "#load_more_message" ).live( "click", t.options, t._loadmore );\r
+                               } else {\r
+                                       /* No more items to load */\r
+                                       $( "#load_more_message" ).die();\r
+                                       $( "#load_more_message" ).remove();\r
                                }\r
                        }\r
-                       \r
-                       t._initList();\r
-           }\r
-       },\r
-       \r
-       destroy : function(){\r
-               var o = this.options;\r
-               \r
-               $( o.id ).empty();\r
-               \r
-               TOTAL_ITEMS = 0;\r
-               i =0;\r
-               last_index = 0;\r
-               \r
-               $( "#load_more_message" ).die();\r
-       },\r
-       \r
-       _itemApply: function( $list, item ) {\r
-               var $countli = item.find( ".ui-li-count" );\r
-               \r
-               if ( $countli.length ) {\r
-                       item.addClass( "ui-li-has-count" );\r
-               }\r
-               \r
-               $countli.addClass( "ui-btn-up-" + ( $list.jqmData( "counttheme" ) || this.options.countTheme ) + " ui-btn-corner-all" );\r
-\r
-               // TODO class has to be defined in markup\r
-               item.find( "h1, h2, h3, h4, h5, h6" ).addClass( "ui-li-heading" ).end()\r
-                       .find( "p, dl" ).addClass( "ui-li-desc" ).end()\r
-                       .find( ">img:eq(0), .ui-link-inherit>img:eq(0)" ).addClass( "ui-li-thumb" ).each(function() {\r
-                               item.addClass( $( this ).is( ".ui-li-icon" ) ? "ui-li-has-icon" : "ui-li-has-thumb" );\r
-                       }).end()\r
-                       .find( ".ui-li-aside" ).each(function() {\r
-                               var $this = $( this );\r
-                               $this.prependTo( $this.parent() ); //shift aside to front for css float\r
+\r
+                       if ( o.childSelector == " ul" ) {\r
+                               $( o.id + " ul" ).swipelist();\r
+                       }\r
+\r
+                       $( o.id ).trigger( "create" );\r
+\r
+                       t.refresh( true );\r
+               },\r
+\r
+               create: function () {\r
+                       var o = this.options;\r
+\r
+                       /* external API for AJAX callback */\r
+                       this._create( "create" );\r
+               },\r
+\r
+               _create: function ( event ) {\r
+                       var t = this,\r
+                               o = this.options,\r
+                               $el = this.element;\r
+\r
+                       // create listview markup\r
+                       t.element.addClass( function ( i, orig ) {\r
+                               return orig + " ui-listview ui-extendable-list-container" + ( t.options.inset ? " ui-listview-inset ui-corner-all ui-shadow " : "" );\r
                        });\r
-       },\r
 \r
-       _removeCorners: function( li, which ) {\r
-               var top = "ui-corner-top ui-corner-tr ui-corner-tl",\r
-                       bot = "ui-corner-bottom ui-corner-br ui-corner-bl";\r
+                       o.id = "#" + $el.attr( "id" );\r
+\r
+                       if ( $el.data( "extenditems" ) ) {\r
+                               o.extenditems = parseInt( $el.data( "extenditems" ), 10 );\r
+                       }\r
 \r
-               li = li.add( li.find( ".ui-btn-inner, .ui-li-link-alt, .ui-li-thumb" ) );\r
+                       $( o.id ).bind( "pagehide", function (e) {\r
+                               $( o.id ).empty();\r
+                       });\r
 \r
-               if ( which === "top" ) {\r
-                       li.removeClass( top );\r
-               } else if ( which === "bottom" ) {\r
-                       li.removeClass( bot );\r
-               } else {\r
-                       li.removeClass( top + " " + bot );\r
-               }\r
-       },\r
-\r
-       _refreshCorners: function( create ) {\r
-               var $li,\r
-                       $visibleli,\r
-                       $topli,\r
-                       $bottomli;\r
-\r
-               if ( this.options.inset ) {\r
-                       $li = this.element.children( "li" );\r
-                       // at create time the li are not visible yet so we need to rely on .ui-screen-hidden\r
-                       $visibleli = create?$li.not( ".ui-screen-hidden" ):$li.filter( ":visible" );\r
-\r
-                       this._removeCorners( $li );\r
-\r
-                       // Select the first visible li element\r
-                       $topli = $visibleli.first()\r
-                               .addClass( "ui-corner-top" );\r
-\r
-                       $topli.add( $topli.find( ".ui-btn-inner" ) )\r
-                               .find( ".ui-li-link-alt" )\r
-                                       .addClass( "ui-corner-tr" )\r
-                               .end()\r
-                               .find( ".ui-li-thumb" )\r
-                                       .not( ".ui-li-icon" )\r
-                                       .addClass( "ui-corner-tl" );\r
-\r
-                       // Select the last visible li element\r
-                       $bottomli = $visibleli.last()\r
-                               .addClass( "ui-corner-bottom" );\r
-\r
-                       $bottomli.add( $bottomli.find( ".ui-btn-inner" ) )\r
-                               .find( ".ui-li-link-alt" )\r
-                                       .addClass( "ui-corner-br" )\r
-                               .end()\r
-                               .find( ".ui-li-thumb" )\r
-                                       .not( ".ui-li-icon" )\r
-                                       .addClass( "ui-corner-bl" );\r
-               }\r
-       },\r
-\r
-       refresh: function( create ) {\r
-               this.parentPage = this.element.closest( ".ui-page" );\r
-               this._createSubPages();\r
-\r
-               var o = this.options,\r
-                       $list = this.element,\r
-                       self = this,\r
-                       dividertheme = $list.jqmData( "dividertheme" ) || o.dividerTheme,\r
-                       listsplittheme = $list.jqmData( "splittheme" ),\r
-                       listspliticon = $list.jqmData( "spliticon" ),\r
-                       li = $list.children( "li" ),\r
-                       counter = $.support.cssPseudoElement || !$.nodeName( $list[ 0 ], "ol" ) ? 0 : 1,\r
-                       item, itemClass, itemTheme,\r
-                       a, last, splittheme, countParent, icon;\r
-\r
-               if ( counter ) {\r
-                       $list.find( ".ui-li-dec" ).remove();\r
-               }\r
+                       /* Scroll view */\r
+                       if ( $( ".ui-scrollview-clip" ).size() > 0) {\r
+                               o.scrollview = true;\r
+                       } else {\r
+                               o.scrollview = false;\r
+                       }\r
 \r
-               for ( var pos = 0, numli = li.length; pos < numli; pos++ ) {\r
-                       item = li.eq( pos );\r
-                       itemClass = "ui-li";\r
-\r
-                       // If we're creating the element, we update it regardless\r
-                       if ( create || !item.hasClass( "ui-li" ) ) {\r
-                               itemTheme = item.jqmData( "theme" ) || o.theme;\r
-                               a = item.children( "a" );\r
-\r
-                               if ( a.length ) {\r
-                                       icon = item.jqmData( "icon" );\r
-\r
-                                       item.buttonMarkup({\r
-                                               wrapperEls: "div",\r
-                                               shadow: false,\r
-                                               corners: false,\r
-                                               iconpos: "right",\r
-                                               /* icon: a.length > 1 || icon === false ? false : icon || "arrow-r",*/\r
-                                               icon: false,    /* Remove unnecessary arrow icon */\r
-                                               theme: itemTheme\r
-                                       });\r
-\r
-                                       if ( ( icon != false ) && ( a.length == 1 ) ) {\r
-                                               item.addClass( "ui-li-has-arrow" );\r
+                       /* After DB Load complete, Init Extendable list */\r
+                       if ( $( o.id ).hasClass( "elLoadSuccess" ) ) {\r
+                               if ( !$( o.id ).hasClass( "elInitComplete" ) ) {\r
+                                       if ( $el.data( "template" ) ) {\r
+                                               o.template = $el.data( "template" );\r
+\r
+                                               /* to support swipe list, <li> or <ul> can be main node of extendable list. */\r
+                                               if ( $el.data( "swipelist" ) == true ) {\r
+                                                       o.childSelector = " ul";\r
+                                               } else {\r
+                                                       o.shildSelector = " li";\r
+                                               }\r
                                        }\r
 \r
-                                       a.first().addClass( "ui-link-inherit" );\r
-\r
-                                       if ( a.length > 1 ) {\r
-                                               itemClass += " ui-li-has-alt";\r
-\r
-                                               last = a.last();\r
-                                               splittheme = listsplittheme || last.jqmData( "theme" ) || o.splitTheme;\r
-\r
-                                               last.appendTo(item)\r
-                                                       .attr( "title", last.getEncodedText() )\r
-                                                       .addClass( "ui-li-link-alt" )\r
-                                                       .empty()\r
-                                                       .buttonMarkup({\r
-                                                               shadow: false,\r
-                                                               corners: false,\r
-                                                               theme: itemTheme,\r
-                                                               icon: false,\r
-                                                               iconpos: false\r
-                                                       })\r
-                                                       .find( ".ui-btn-inner" )\r
+                                       $( o.id ).addClass( "elInitComplete" );\r
+                               }\r
+\r
+                               t._initList();\r
+                       }\r
+               },\r
+\r
+               destroy : function () {\r
+                       var o = this.options;\r
+\r
+                       $( o.id ).empty();\r
+\r
+                       TOTAL_ITEMS = 0;\r
+                       last_index = 0;\r
+\r
+                       $( "#load_more_message" ).die();\r
+               },\r
+\r
+               _itemApply: function ( $list, item ) {\r
+                       var $countli = item.find( ".ui-li-count" );\r
+\r
+                       if ( $countli.length ) {\r
+                               item.addClass( "ui-li-has-count" );\r
+                       }\r
+\r
+                       $countli.addClass( "ui-btn-up-" + ( $list.jqmData( "counttheme" ) || this.options.countTheme ) + " ui-btn-corner-all" );\r
+\r
+                       // TODO class has to be defined in markup\r
+                       item.find( "h1, h2, h3, h4, h5, h6" ).addClass( "ui-li-heading" ).end()\r
+                               .find( "p, dl" ).addClass( "ui-li-desc" ).end()\r
+                               .find( ">img:eq(0), .ui-link-inherit>img:eq(0)" ).addClass( "ui-li-thumb" ).each(function () {\r
+                                       item.addClass( $( this ).is( ".ui-li-icon" ) ? "ui-li-has-icon" : "ui-li-has-thumb" );\r
+                               }).end()\r
+                               .find( ".ui-li-aside" ).each(function () {\r
+                                       var $this = $( this );\r
+                                       $this.prependTo( $this.parent() ); //shift aside to front for css float\r
+                               });\r
+               },\r
+\r
+               _removeCorners: function ( li, which ) {\r
+                       var top = "ui-corner-top ui-corner-tr ui-corner-tl",\r
+                               bot = "ui-corner-bottom ui-corner-br ui-corner-bl";\r
+\r
+                       li = li.add( li.find( ".ui-btn-inner, .ui-li-link-alt, .ui-li-thumb" ) );\r
+\r
+                       if ( which === "top" ) {\r
+                               li.removeClass( top );\r
+                       } else if ( which === "bottom" ) {\r
+                               li.removeClass( bot );\r
+                       } else {\r
+                               li.removeClass( top + " " + bot );\r
+                       }\r
+               },\r
+\r
+               _refreshCorners: function ( create ) {\r
+                       var $li,\r
+                               $visibleli,\r
+                               $topli,\r
+                               $bottomli;\r
+\r
+                       if ( this.options.inset ) {\r
+                               $li = this.element.children( "li" );\r
+                               // at create time the li are not visible yet so we need to rely on .ui-screen-hidden\r
+                               $visibleli = create ? $li.not( ".ui-screen-hidden" ) : $li.filter( ":visible" );\r
+\r
+                               this._removeCorners( $li );\r
+\r
+                               // Select the first visible li element\r
+                               $topli = $visibleli.first()\r
+                                       .addClass( "ui-corner-top" );\r
+\r
+                               $topli.add( $topli.find( ".ui-btn-inner" ) )\r
+                                       .find( ".ui-li-link-alt" )\r
+                                               .addClass( "ui-corner-tr" )\r
+                                       .end()\r
+                                       .find( ".ui-li-thumb" )\r
+                                               .not( ".ui-li-icon" )\r
+                                               .addClass( "ui-corner-tl" );\r
+\r
+                               // Select the last visible li element\r
+                               $bottomli = $visibleli.last()\r
+                                       .addClass( "ui-corner-bottom" );\r
+\r
+                               $bottomli.add( $bottomli.find( ".ui-btn-inner" ) )\r
+                                       .find( ".ui-li-link-alt" )\r
+                                               .addClass( "ui-corner-br" )\r
+                                       .end()\r
+                                       .find( ".ui-li-thumb" )\r
+                                               .not( ".ui-li-icon" )\r
+                                               .addClass( "ui-corner-bl" );\r
+                       }\r
+               },\r
+\r
+               refresh: function ( create ) {\r
+                       this.parentPage = this.element.closest( ".ui-page" );\r
+                       this._createSubPages();\r
+\r
+                       var o = this.options,\r
+                               $list = this.element,\r
+                               self = this,\r
+                               dividertheme = $list.jqmData( "dividertheme" ) || o.dividerTheme,\r
+                               listsplittheme = $list.jqmData( "splittheme" ),\r
+                               listspliticon = $list.jqmData( "spliticon" ),\r
+                               li = $list.children( "li" ),\r
+                               counter = $.support.cssPseudoElement || !$.nodeName( $list[ 0 ], "ol" ) ? 0 : 1,\r
+                               item,\r
+                               itemClass,\r
+                               itemTheme,\r
+                               a,\r
+                               last,\r
+                               splittheme,\r
+                               countParent,\r
+                               icon,\r
+                               pos,\r
+                               numli;\r
+\r
+                       if ( counter ) {\r
+                               $list.find( ".ui-li-dec" ).remove();\r
+                       }\r
+\r
+                       for ( pos = 0, numli = li.length; pos < numli; pos++ ) {\r
+                               item = li.eq( pos );\r
+                               itemClass = "ui-li";\r
+\r
+                               // If we're creating the element, we update it regardless\r
+                               if ( create || !item.hasClass( "ui-li" ) ) {\r
+                                       itemTheme = item.jqmData( "theme" ) || o.theme;\r
+                                       a = item.children( "a" );\r
+\r
+                                       if ( a.length ) {\r
+                                               icon = item.jqmData( "icon" );\r
+\r
+                                               item.buttonMarkup({\r
+                                                       wrapperEls: "div",\r
+                                                       shadow: false,\r
+                                                       corners: false,\r
+                                                       iconpos: "right",\r
+                                                       /* icon: a.length > 1 || icon === false ? false : icon || "arrow-r",*/\r
+                                                       icon: false,    /* Remove unnecessary arrow icon */\r
+                                                       theme: itemTheme\r
+                                               });\r
+\r
+                                               if ( ( icon != false ) && ( a.length == 1 ) ) {\r
+                                                       item.addClass( "ui-li-has-arrow" );\r
+                                               }\r
+\r
+                                               a.first().addClass( "ui-link-inherit" );\r
+\r
+                                               if ( a.length > 1 ) {\r
+                                                       itemClass += " ui-li-has-alt";\r
+\r
+                                                       last = a.last();\r
+                                                       splittheme = listsplittheme || last.jqmData( "theme" ) || o.splitTheme;\r
+\r
+                                                       last.appendTo(item)\r
+                                                               .attr( "title", last.getEncodedText() )\r
+                                                               .addClass( "ui-li-link-alt" )\r
+                                                               .empty()\r
+                                                               .buttonMarkup({\r
+                                                                       shadow: false,\r
+                                                                       corners: false,\r
+                                                                       theme: itemTheme,\r
+                                                                       icon: false,\r
+                                                                       iconpos: false\r
+                                                               })\r
+                                                               .find( ".ui-btn-inner" )\r
                                                                .append(\r
-                                                                       $( "<span />" ).buttonMarkup({\r
-                                                                               shadow: true,\r
-                                                                               corners: true,\r
-                                                                               theme: splittheme,\r
-                                                                               iconpos: "notext",\r
-                                                                               icon: listspliticon || last.jqmData( "icon" ) || o.splitIcon\r
+                                                                       $( "<span />" ).buttonMarkup( {\r
+                                                                               shadow : true,\r
+                                                                               corners : true,\r
+                                                                               theme : splittheme,\r
+                                                                               iconpos : "notext",\r
+                                                                               icon : listspliticon || last.jqmData( "icon" ) || o.splitIcon\r
                                                                        })\r
                                                                );\r
-                                       }\r
-                               } else if ( item.jqmData( "role" ) === "list-divider" ) {\r
+                                               }\r
+                                       } else if ( item.jqmData( "role" ) === "list-divider" ) {\r
 \r
-                                       itemClass += " ui-li-divider ui-btn ui-bar-" + dividertheme;\r
-                                       item.attr( "role", "heading" );\r
+                                               itemClass += " ui-li-divider ui-btn ui-bar-" + dividertheme;\r
+                                               item.attr( "role", "heading" );\r
 \r
-                                       //reset counter when a divider heading is encountered\r
-                                       if ( counter ) {\r
-                                               counter = 1;\r
-                                       }\r
+                                               //reset counter when a divider heading is encountered\r
+                                               if ( counter ) {\r
+                                                       counter = 1;\r
+                                               }\r
 \r
-                               } else {\r
-                                       itemClass += " ui-li-static ui-body-" + itemTheme;\r
+                                       } else {\r
+                                               itemClass += " ui-li-static ui-body-" + itemTheme;\r
+                                       }\r
                                }\r
-                       }\r
 \r
-                       if ( counter && itemClass.indexOf( "ui-li-divider" ) < 0 ) {\r
-                               countParent = item.is( ".ui-li-static:first" ) ? item : item.find( ".ui-link-inherit" );\r
+                               if ( counter && itemClass.indexOf( "ui-li-divider" ) < 0 ) {\r
+                                       countParent = item.is( ".ui-li-static:first" ) ? item : item.find( ".ui-link-inherit" );\r
 \r
-                               countParent.addClass( "ui-li-jsnumbering" )\r
-                                       .prepend( "<span class='ui-li-dec'>" + (counter++) + ". </span>" );\r
-                       }\r
+                                       countParent.addClass( "ui-li-jsnumbering" )\r
+                                               .prepend( "<span class='ui-li-dec'>" + (counter++) + ". </span>" );\r
+                               }\r
 \r
-                       item.add( item.children( ".ui-btn-inner" ) ).addClass( itemClass );\r
+                               item.add( item.children( ".ui-btn-inner" ) ).addClass( itemClass );\r
 \r
-                       self._itemApply( $list, item );\r
-               }\r
+                               self._itemApply( $list, item );\r
+                       }\r
 \r
-               this._refreshCorners( create );\r
-       },\r
-\r
-       //create a string for ID/subpage url creation\r
-       _idStringEscape: function( str ) {\r
-               return str.replace(/[^a-zA-Z0-9]/g, '-');\r
-       },\r
-\r
-       _createSubPages: function() {\r
-               var parentList = this.element,\r
-                       parentPage = parentList.closest( ".ui-page" ),\r
-                       parentUrl = parentPage.jqmData( "url" ),\r
-                       parentId = parentUrl || parentPage[ 0 ][ $.expando ],\r
-                       parentListId = parentList.attr( "id" ),\r
-                       o = this.options,\r
-                       dns = "data-" + $.mobile.ns,\r
-                       self = this,\r
-                       persistentFooterID = parentPage.find( ":jqmData(role='footer')" ).jqmData( "id" ),\r
-                       hasSubPages;\r
-\r
-               if ( typeof listCountPerPage[ parentId ] === "undefined" ) {\r
-                       listCountPerPage[ parentId ] = -1;\r
-               }\r
+                       this._refreshCorners( create );\r
+               },\r
+\r
+               //create a string for ID/subpage url creation\r
+               _idStringEscape: function ( str ) {\r
+                       return str.replace(/\W/g , "-");\r
+\r
+               },\r
+\r
+               _createSubPages: function () {\r
+                       var parentList = this.element,\r
+                               parentPage = parentList.closest( ".ui-page" ),\r
+                               parentUrl = parentPage.jqmData( "url" ),\r
+                               parentId = parentUrl || parentPage[ 0 ][ $.expando ],\r
+                               parentListId = parentList.attr( "id" ),\r
+                               o = this.options,\r
+                               dns = "data-" + $.mobile.ns,\r
+                               self = this,\r
+                               persistentFooterID = parentPage.find( ":jqmData(role='footer')" ).jqmData( "id" ),\r
+                               hasSubPages,\r
+                               newRemove;\r
+\r
+                       if ( typeof listCountPerPage[ parentId ] === "undefined" ) {\r
+                               listCountPerPage[ parentId ] = -1;\r
+                       }\r
 \r
-               parentListId = parentListId || ++listCountPerPage[ parentId ];\r
-\r
-               $( parentList.find( "li>ul, li>ol" ).toArray().reverse() ).each(function( i ) {\r
-                       var self = this,\r
-                               list = $( this ),\r
-                               listId = list.attr( "id" ) || parentListId + "-" + i,\r
-                               parent = list.parent(),\r
-                               nodeEls = $( list.prevAll().toArray().reverse() ),\r
-                               nodeEls = nodeEls.length ? nodeEls : $( "<span>" + $.trim(parent.contents()[ 0 ].nodeValue) + "</span>" ),\r
-                               title = nodeEls.first().getEncodedText(),//url limits to first 30 chars of text\r
-                               id = ( parentUrl || "" ) + "&" + $.mobile.subPageUrlKey + "=" + listId,\r
-                               theme = list.jqmData( "theme" ) || o.theme,\r
-                               countTheme = list.jqmData( "counttheme" ) || parentList.jqmData( "counttheme" ) || o.countTheme,\r
-                               newPage, anchor;\r
-\r
-                       //define hasSubPages for use in later removal\r
-                       hasSubPages = true;\r
-\r
-                       newPage = list.detach()\r
-                                               .wrap( "<div " + dns + "role='page' " + dns + "url='" + id + "' " + dns + "theme='" + theme + "' " + dns + "count-theme='" + countTheme + "'><div " + dns + "role='content'></div></div>" )\r
-                                               .parent()\r
-                                                       .before( "<div " + dns + "role='header' " + dns + "theme='" + o.headerTheme + "'><div class='ui-title'>" + title + "</div></div>" )\r
-                                                       .after( persistentFooterID ? $( "<div " + dns + "role='footer' " + dns + "id='"+ persistentFooterID +"'>" ) : "" )\r
+                       parentListId = parentListId || ++listCountPerPage[ parentId ];\r
+\r
+                       $( parentList.find( "li>ul, li>ol" ).toArray().reverse() ).each(function ( i ) {\r
+                               var self = this,\r
+                                       list = $( this ),\r
+                                       listId = list.attr( "id" ) || parentListId + "-" + i,\r
+                                       parent = list.parent(),\r
+                                       nodeEls,\r
+                                       title = nodeEls.first().getEncodedText(),//url limits to first 30 chars of text\r
+                                       id = ( parentUrl || "" ) + "&" + $.mobile.subPageUrlKey + "=" + listId,\r
+                                       theme = list.jqmData( "theme" ) || o.theme,\r
+                                       countTheme = list.jqmData( "counttheme" ) || parentList.jqmData( "counttheme" ) || o.countTheme,\r
+                                       newPage,\r
+                                       anchor;\r
+\r
+                               nodeEls = $( list.prevAll().toArray().reverse() );\r
+                               nodeEls = nodeEls.length ? nodeEls : $( "<span>" + $.trim(parent.contents()[ 0 ].nodeValue) + "</span>" );\r
+\r
+                               //define hasSubPages for use in later removal\r
+                               hasSubPages = true;\r
+\r
+                               newPage = list.detach()\r
+                                                       .wrap( "<div " + dns + "role='page' " + dns + "url='" + id + "' " + dns + "theme='" + theme + "' " + dns + "count-theme='" + countTheme + "'><div " + dns + "role='content'></div></div>" )\r
                                                        .parent()\r
-                                                               .appendTo( $.mobile.pageContainer );\r
+                                                               .before( "<div " + dns + "role='header' " + dns + "theme='" + o.headerTheme + "'><div class='ui-title'>" + title + "</div></div>" )\r
+                                                               .after( persistentFooterID ? $( "<div " + dns + "role='footer' " + dns + "id='" + persistentFooterID + "'>" ) : "" )\r
+                                                               .parent()\r
+                                                                       .appendTo( $.mobile.pageContainer );\r
 \r
-                       newPage.page();\r
+                               newPage.page();\r
 \r
-                       anchor = parent.find('a:first');\r
+                               anchor = parent.find('a:first');\r
 \r
-                       if ( !anchor.length ) {\r
-                               anchor = $( "<a/>" ).html( nodeEls || title ).prependTo( parent.empty() );\r
-                       }\r
+                               if ( !anchor.length ) {\r
+                                       anchor = $( "<a/>" ).html( nodeEls || title ).prependTo( parent.empty() );\r
+                               }\r
 \r
-                       anchor.attr( "href", "#" + id );\r
+                               anchor.attr( "href", "#" + id );\r
 \r
-               }).extendablelist();\r
+                       }).extendablelist();\r
 \r
-               // on pagehide, remove any nested pages along with the parent page, as long as they aren't active\r
-               // and aren't embedded\r
-               if( hasSubPages &&\r
-                       parentPage.is( ":jqmData(external-page='true')" ) &&\r
-                       parentPage.data( "page" ).options.domCache === false ) {\r
+                       // on pagehide, remove any nested pages along with the parent page, as long as they aren't active\r
+                       // and aren't embedded\r
+                       if ( hasSubPages &&\r
+                                       parentPage.is( ":jqmData(external-page='true')" ) &&\r
+                                       parentPage.data( "page" ).options.domCache === false ) {\r
 \r
-                       var newRemove = function( e, ui ){\r
-                               var nextPage = ui.nextPage, npURL;\r
+                               newRemove = function ( e, ui ) {\r
+                                       var nextPage = ui.nextPage, npURL;\r
 \r
-                               if( ui.nextPage ){\r
-                                       npURL = nextPage.jqmData( "url" );\r
-                                       if( npURL.indexOf( parentUrl + "&" + $.mobile.subPageUrlKey ) !== 0 ){\r
-                                               self.childPages().remove();\r
-                                               parentPage.remove();\r
+                                       if ( ui.nextPage ) {\r
+                                               npURL = nextPage.jqmData( "url" );\r
+                                               if ( npURL.indexOf( parentUrl + "&" + $.mobile.subPageUrlKey ) !== 0 ) {\r
+                                                       self.childPages().remove();\r
+                                                       parentPage.remove();\r
+                                               }\r
                                        }\r
-                               }\r
-                       };\r
+                               };\r
 \r
-                       // unbind the original page remove and replace with our specialized version\r
-                       parentPage\r
-                               .unbind( "pagehide.remove" )\r
-                               .bind( "pagehide.remove", newRemove);\r
-               }\r
-       },\r
+                               // unbind the original page remove and replace with our specialized version\r
+                               parentPage\r
+                                       .unbind( "pagehide.remove" )\r
+                                       .bind( "pagehide.remove", newRemove);\r
+                       }\r
+               },\r
 \r
-       // TODO sort out a better way to track sub pages of the extendable listview this is brittle\r
-       childPages: function(){\r
-               var parentUrl = this.parentPage.jqmData( "url" );\r
+               // TODO sort out a better way to track sub pages of the extendable listview this is brittle\r
+               childPages: function () {\r
+                       var parentUrl = this.parentPage.jqmData( "url" );\r
 \r
-               return $( ":jqmData(url^='"+  parentUrl + "&" + $.mobile.subPageUrlKey +"')" );\r
-       }\r
-});\r
+                       return $( ":jqmData(url^='" +  parentUrl + "&" + $.mobile.subPageUrlKey + "')" );\r
+               }\r
+       });\r
 \r
-//auto self-init widgets\r
-$( document ).bind( "pagecreate create", function( e ){\r
-       $( $.tizen.extendablelist.prototype.options.initSelector, e.target ).extendablelist();\r
-});\r
+       //auto self-init widgets\r
+       $( document ).bind( "pagecreate create", function ( e ) {\r
+               $( $.tizen.extendablelist.prototype.options.initSelector, e.target ).extendablelist();\r
+       });\r
 \r
-})( jQuery );\r
+}( jQuery ));\r
diff --git a/src/widgets/handler/js/jquery.tizen.scrollview.handler.js b/src/widgets/handler/js/jquery.tizen.scrollview.handler.js
new file mode 100755 (executable)
index 0000000..4e4ae4a
--- /dev/null
@@ -0,0 +1,266 @@
+/* ***************************************************************************
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ *
+ * Authors: Wonseop Kim ( wonseop.kim@samsung.com )
+*/
+
+/**
+ * 'Handler' is widget that is working in conjunction with 'scrollview'.
+ * 'Handler' is supporting 'scroll event( up/down )' and is indicating scroll
+ * position.
+ *
+ * HTML Attributes:
+ *
+ *             data-handler : This attribute is indicating that whether enable.
+ *                                             If you want to use, you will set 'true'.
+ *             data-handlertheme : Set the widget theme ( optional )
+ *
+ * APIs:
+ *
+ *             enableHandler ( void )
+ *                     : Get a status that whether enable.
+ *             enableHandler ( boolean )
+ *                     : Set a status that whether enable.
+ *
+ * Events:
+ *
+ * Examples:
+ *
+ *             <div data-role="content" data-scroll="y" data-handler="true">
+ *                     <ul data-role="listview">
+ *                             <li data-role="list-divider">A</li>
+ *                             <li><a href="../../docs/lists/index.html">Adam Kinkaid</a></li>
+ *                             <li><a href="../../docs/lists/index.html">Alex Wickerham</a></li>
+ *                             <li><a href="../../docs/lists/index.html">Avery Johnson</a></li>
+ *                     </ul>
+ *             </div>
+ */
+
+( function ( $, document, undefined ) {
+       // The options of handler in scrollview
+       $.tizen.scrollview.prototype.options.handler = false;
+       $.tizen.scrollview.prototype.options.handlerTheme = "s";
+
+       $.extend( $.tizen.scrollview.prototype, {
+               enableHandler : function ( enabled ) {
+                       if ( typeof enabled === 'undefined' ) {
+                               return this.options.handler;
+                       }
+
+                       this.options.handler = !!enabled;
+
+                       var view = this.element;
+                       if ( this.options.handler ) {
+                               view.find( ".ui-scrollbar" ).hide();
+                               view.find( ".ui-handler" ).show();
+                       } else {
+                               view.find( ".ui-handler" ).hide();
+                               view.find( ".ui-scrollbar" ).show();
+                       }
+               },
+               _handlerTimer : 0
+       });
+
+       $( document ).delegate( ":jqmData(scroll)", "scrollviewcreate", function () {
+               if ( $( this ).attr( "data-" + $.mobile.ns + "scroll" ) === "none" ) {
+                       return;
+               }
+
+               var self = this,
+                       $this = $( this ),
+                       scrollview = $this.data( "scrollview" ),
+                       prefix = "<div class=\"ui-handler ui-handler-",
+                       suffix = "\"><div class=\"ui-handler-track\"><div class=\"ui-handler-thumb\"></div></div></div>",
+                       direction = scrollview.options.direction,
+                       isHorizontal = ( scrollview.options.direction === "x" ),
+                       _$view = scrollview._$view,
+                       _$clip = scrollview._$clip,
+                       handler = null,
+                       handlerThumb = null,
+                       viewLength = 0,
+                       clipLength = 0,
+                       handlerHeight = 0,
+                       handlerMargin = 0,
+                       trackLength = 0,
+                       isTouchable = $.support.touch,
+                       dragStartEvt = ( isTouchable ? "touchstart" : "mousedown" ) + ".handler",
+                       dragMoveEvtDefault = ( isTouchable ? "touchmove" : "mousemove" ),
+                       dragMoveEvt = dragMoveEvtDefault + ".handler",
+                       dragStopEvt = ( isTouchable ? "touchend" : "mouseup" ) + ".handler";
+
+               if ( $this.find( ".ui-handler-thumb" ).length !== 0 || typeof direction !== "string" ) {
+                       return;
+               }
+
+               $this.append( prefix + direction + suffix );
+               handler = $this.find( ".ui-handler" );
+               handlerThumb = $this.find( ".ui-handler-thumb" ).hide();
+               handlerHeight = ( isHorizontal ? handlerThumb.width() : handlerThumb.height() );
+               handlerMargin = ( isHorizontal ? parseInt( handler.css( "right" ), 10 ) : parseInt( handler.css( "bottom" ), 10 ) );
+
+               scrollview.enableHandler( scrollview.options.handler );
+
+               $.extend( self, {
+                       moveData : null
+               });
+
+               // handler drag
+               handlerThumb.bind( dragStartEvt, {
+                       e : handlerThumb
+               }, function ( event ) {
+                       scrollview._stopMScroll();
+
+                       var target = event.data.e, t = ( isTouchable ? event.originalEvent.targetTouches[0] : event );
+
+                       self.moveData = {
+                               target : target,
+                               X : parseInt( target.css( 'left' ), 10 ) || 0,
+                               Y : parseInt( target.css( 'top' ), 10 ) || 0,
+                               pX : t.pageX,
+                               pY : t.pageY
+                       };
+                       clipLength = ( isHorizontal ? _$clip.width() : _$clip.height() );
+                       viewLength = ( isHorizontal ? _$view.outerWidth( true ) : _$view.outerHeight( true ) ) - clipLength;
+                       trackLength = clipLength - handlerHeight - handlerMargin;
+
+                       _$view.trigger( "scrollstart" );
+                       event.preventDefault();
+                       event.stopPropagation();
+
+                       $( document ).bind( dragMoveEvt, function ( event ) {
+                               var moveData = self.moveData,
+                                       handlePos = 0,
+                                       scrollPos = 0,
+                                       t = ( isTouchable ? event.originalEvent.targetTouches[0] : event );
+
+                               handlePos = ( isHorizontal ? moveData.X + t.pageX - moveData.pX : moveData.Y + t.pageY - moveData.pY );
+
+                               if ( handlePos < 0 ) {
+                                       handlePos = 0;
+                               }
+
+                               if ( handlePos > trackLength ) {
+                                       handlePos = trackLength;
+                               }
+                               scrollPos = - Math.round( handlePos / trackLength * viewLength );
+
+                               $this.attr( "display", "none" );
+                               if ( isHorizontal ) {
+                                       scrollview._setScrollPosition( scrollPos, 0 );
+                                       moveData.target.css( {
+                                               left : handlePos
+                                       });
+                               } else {
+                                       scrollview._setScrollPosition( 0, scrollPos );
+                                       moveData.target.css( {
+                                               top : handlePos
+                                       });
+                               }
+                               $this.attr( "display", "inline" );
+
+                               event.preventDefault();
+                               event.stopPropagation();
+                       }).bind( dragStopEvt, function ( event ) {
+                               $( document ).unbind( dragMoveEvt ).unbind( dragStopEvt );
+
+                               self.moveData = null;
+                               _$view.trigger( "scrollstop" );
+
+                               event.preventDefault();
+                       });
+               });
+
+               $( document ).bind( dragMoveEvtDefault, function ( event ) {
+                       var isVisible = false,
+                               vclass = "ui-scrollbar-visible";
+
+                       if ( scrollview._$vScrollBar ) {
+                               isVisible = scrollview._$vScrollBar.hasClass( vclass );
+                       } else if ( scrollview._$hScrollBar ) {
+                               isVisible = scrollview._$hScrollBar.hasClass( vclass );
+                       }
+
+                       if ( isVisible || self.moveData !== null ) {
+                               if ( handlerThumb.hasClass( "ui-handler-visible" ) ) {
+                                       _$view.trigger( "scrollupdate" );
+                               } else {
+                                       _$view.trigger( "scrollstart" );
+                               }
+                       }
+               });
+
+               $this.bind( "scrollstart", function ( event ) {
+                       if ( !scrollview.enableHandler() ) {
+                               return;
+                       }
+                       clipLength = ( isHorizontal ? _$clip.width() : _$clip.height() );
+                       viewLength = ( isHorizontal ? _$view.outerWidth( true ) : _$view.outerHeight( true ) ) - clipLength;
+                       trackLength = clipLength - handlerHeight - handlerMargin;
+
+                       if ( clipLength > viewLength || trackLength < ( handlerHeight * 4 / 3 ) ) {
+                               return;
+                       }
+
+                       handlerThumb.addClass( "ui-handler-visible" );
+                       handlerThumb.stop().fadeIn( 'fast' );
+
+                       event.preventDefault();
+                       event.stopPropagation();
+               }).bind( "scrollupdate", function ( event, data ) {
+                       if ( !scrollview.enableHandler() || clipLength > viewLength || trackLength < ( handlerHeight * 4 / 3 ) ) {
+                               return;
+                       }
+
+                       var scrollPos = scrollview.getScrollPosition(), handlerPos = 0;
+
+                       handlerThumb.stop( true, true ).hide().css( "opacity", 1.0 );
+
+                       if ( isHorizontal ) {
+                               handlerPos = Math.round( scrollPos.x / viewLength * trackLength );
+                               handlerThumb.css( "left", handlerPos );
+                       } else {
+                               handlerPos = Math.round( scrollPos.y / viewLength * trackLength );
+                               handlerThumb.css( "top", handlerPos );
+                       }
+
+                       handlerThumb.show();
+
+                       event.preventDefault();
+                       event.stopPropagation();
+               }).bind( "scrollstop", function ( event ) {
+                       if ( !scrollview.enableHandler() || clipLength > viewLength ) {
+                               return;
+                       }
+
+                       scrollview._handlerTimer = setTimeout( function () {
+                               if ( scrollview._timerID === 0 && self.moveData === null ) {
+                                       handlerThumb.removeClass( "ui-handler-visible" );
+                                       handlerThumb.stop( true, true ).fadeOut( 'fast' );
+                                       clearTimeout( scrollview._handlerTimer );
+                                       scrollview._handlerTimer = 0;
+                               }
+                       }, 1000 );
+
+                       event.preventDefault();
+               });
+       });
+} ( jQuery, document ) );
index 1b067e1..70773ae 100755 (executable)
@@ -8,7 +8,7 @@
  * Copyright (C) 2011 by Intel Corporation Ltd.
  * 
  * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
+ * copy of this software and associated documentation files (the "Software" ),
  * to deal in the Software without restriction, including without limitation
  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  * and/or sell copies of the Software, and to permit persons to whom the
 //     color: String; the initial color can be specified in html using the
 //            data-color="#ff00ff" attribute or when constructed
 //            in javascript, eg
-//                $("#myhsvpicker").hsvpicker({ color: "#ff00ff" });
+//                $( "#myhsvpicker" ).hsvpicker({ color: "#ff00ff" });
 //            where the html might be :
 //                <div id="myhsvpicker"></div>
 //            The color can be changed post-construction like this :
-//                $("#myhsvpicker").hsvpicker("option", "color", "#ABCDEF");
+//                $( "#myhsvpicker" ).hsvpicker( "option", "color", "#ABCDEF" );
 //            Default: "#1a8039"
 //
 // Events:
 //
 //     colorchanged: Fired when the color is changed.
 
-(function( $, undefined ) {
-
-$.widget( "tizen.hsvpicker", $.tizen.colorwidget, {
-    options: {
-        initSelector: ":jqmData(role='hsvpicker')"
-    },
-
-    _htmlProto: {
-        ui: {
-            container: "#hsvpicker",
-            hue: {
-                eventSource: "[data-event-source='hue']",
-                selector:    "#hsvpicker-hue-selector",
-                hue:         "#hsvpicker-hue-hue",
-                valMask:     "#hsvpicker-hue-mask-val"
-            },
-            sat: {
-                gradient:    "#hsvpicker-sat-gradient",
-                eventSource: "[data-event-source='sat']",
-                selector:    "#hsvpicker-sat-selector",
-                hue:         "#hsvpicker-sat-hue",
-                valMask:     "#hsvpicker-sat-mask-val"
-            },
-            val: {
-                gradient:    "#hsvpicker-val-gradient",
-                eventSource: "[data-event-source='val']",
-                selector:    "#hsvpicker-val-selector",
-                hue:         "#hsvpicker-val-hue"
-            }
-        }
-    },
-
-    _create: function() {
-        var self = this;
-
-        this.element
-            .css("display", "none")
-            .after(this._ui.container);
-
-        this._ui.hue.hue.huegradient();
-
-        $.extend(this, {
-            dragging_hsv: [ 0, 0, 0],
-            selectorDraggingOffset: {
-                x : -1,
-                y : -1
-            },
-            dragging: -1
-        });
-
-        this._ui.container.find(".hsvpicker-arrow-btn")
-            .buttonMarkup()
-            .bind("vclick", function(e) {
-                var chan = $(this).attr("data-" + ($.mobile.ns || "") + "target"),
-                    hsvIdx = ("hue" === chan) ? 0 :
-                             ("sat" === chan) ? 1 : 2,
-                    max = (0 == hsvIdx ? 360 : 1),
-                    step = 0.05 * max;
-
-                self.dragging_hsv[hsvIdx] = self.dragging_hsv[hsvIdx] + step * ("left" === $(this).attr("data-" + ($.mobile.ns || "") + "location") ? -1 : 1);
-                self.dragging_hsv[hsvIdx] = Math.min(max, Math.max(0.0, self.dragging_hsv[hsvIdx]));
-                self._updateSelectors(self.dragging_hsv);
-            });
-
-        $( document )
-            .bind( "vmousemove", function( event ) {
-                if ( self.dragging != -1 ) {
-                    event.stopPropagation();
-                    event.preventDefault();
-                }
-            })
-            .bind( "vmouseup", function( event ) {
-                self.dragging = -1;
-            });
-
-        this._bindElements("hue", 0);
-        this._bindElements("sat", 1);
-        this._bindElements("val", 2);
-    },
-
-    _bindElements: function(chan, idx) {
-        var self = this;
-        this._ui[chan].selector
-            .bind("mousedown vmousedown", function(e) { self._handleMouseDown(chan, idx, e, true); })
-            .bind("vmousemove touchmove", function(e) { self._handleMouseMove(chan, idx, e, true); })
-            .bind("vmouseup",             function(e) { self.dragging = -1; });
-        this._ui[chan].eventSource
-            .bind("mousedown vmousedown", function(e) { self._handleMouseDown(chan, idx, e, false); })
-            .bind("vmousemove touchmove", function(e) { self._handleMouseMove(chan, idx, e, false); })
-            .bind("vmouseup",             function(e) { self.dragging = -1; });
-    },
-
-    _handleMouseDown: function(chan, idx, e, isSelector) {
-        var coords = $.mobile.tizen.targetRelativeCoordsFromEvent(e),
-            widgetStr = (isSelector ? "selector" : "eventSource");
-
-        if (coords.x >= 0 && coords.x <= this._ui[chan][widgetStr].outerWidth() &&
-            coords.y >= 0 && coords.y <= this._ui[chan][widgetStr].outerHeight()) {
-
-            this.dragging = idx;
-
-            if (isSelector) {
-                this.selectorDraggingOffset.x = coords.x;
-                this.selectorDraggingOffset.y = coords.y;
-            }
-
-            this._handleMouseMove(chan, idx, e, isSelector, coords);
-        }
-    },
-
-    _handleMouseMove: function(chan, idx, e, isSelector, coords) {
-        if (this.dragging === idx) {
-            coords = (coords || $.mobile.tizen.targetRelativeCoordsFromEvent(e));
-
-            var factor = ((0 === idx) ? 360 : 1),
-                potential = (isSelector
-                  ? ((this.dragging_hsv[idx] / factor) +
-                     ((coords.x - this.selectorDraggingOffset.x) / this._ui[chan].eventSource.width()))
-                  : (coords.x / this._ui[chan].eventSource.width()));
-
-            this.dragging_hsv[idx] = Math.min(1.0, Math.max(0.0, potential)) * factor;
-
-            if (!isSelector) {
-                this.selectorDraggingOffset.x = Math.ceil(this._ui[chan].selector.outerWidth()  / 2.0);
-                this.selectorDraggingOffset.y = Math.ceil(this._ui[chan].selector.outerHeight() / 2.0);
-            }
-
-            this._updateSelectors(this.dragging_hsv);
-            e.stopPropagation();
-            e.preventDefault();
-        }
-    },
-
-    _updateSelectors: function(hsv) {
-        var clrlib = $.tizen.colorwidget.clrlib,
-            clrwidget = $.tizen.colorwidget.prototype,
-             clr = clrlib.HSVToHSL(hsv),
-            hclr = clrlib.HSVToHSL([hsv[0], 1.0, 1.0]),
-            vclr = clrlib.HSVToHSL([hsv[0], hsv[1], 1.0]);
-
-        this._ui.hue.selector.css({ left : this._ui.hue.eventSource.width() * hsv[0] / 360});
-        clrwidget._setElementColor.call(this, this._ui.hue.selector,  clr, "background");
-        if ($.mobile.browser.ie)
-            this._ui.hue.hue.find("*").css("opacity", hsv[1]);
-        else
-            this._ui.hue.hue.css("opacity", hsv[1]);
-        this._ui.hue.valMask.css("opacity", 1.0 - hsv[2]);
-
-        this._ui.sat.selector.css({ left : this._ui.sat.eventSource.width() * hsv[1]});
-        clrwidget._setElementColor.call(this, this._ui.sat.selector,  clr, "background");
-        clrwidget._setElementColor.call(this, this._ui.sat.hue,      hclr, "background");
-        this._ui.sat.valMask.css("opacity", 1.0 - hsv[2]);
-
-        this._ui.val.selector.css({ left : this._ui.val.eventSource.width() * hsv[2]});
-        clrwidget._setElementColor.call(this, this._ui.val.selector,  clr, "background");
-        clrwidget._setElementColor.call(this, this._ui.val.hue,      vclr, "background");
-        clrwidget._setColor.call(this, clrlib.RGBToHTML(clrlib.HSLToRGB(clr)));
-    },
-
-    _setDisabled: function(value) {
-        $.tizen.widgetex.prototype._setDisabled.call(this, value);
-        this._ui.container[value ? "addClass" : "removeClass"]("ui-disabled");
-        this._ui.hue.hue.huegradient("option", "disabled", value);
-        $.tizen.colorwidget.prototype._displayDisabledState.call(this, this._ui.container);
-    },
-
-    _setColor: function(clr) {
-        if ($.tizen.colorwidget.prototype._setColor.call(this, clr)) {
-            this.dragging_hsv = $.tizen.colorwidget.clrlib.RGBToHSV($.tizen.colorwidget.clrlib.HTMLToRGB(this.options.color));
-            this._updateSelectors(this.dragging_hsv);
-        }
-    }
-});
-
-$(document).bind("pagecreate create", function(e) {
-    $($.tizen.hsvpicker.prototype.options.initSelector, e.target)
-        .not(":jqmData(role='none'), :jqmData(role='nojs')")
-        .hsvpicker();
-});
-
-})(jQuery);
+(function ( $, undefined ) {
+
+       $.widget( "tizen.hsvpicker", $.tizen.colorwidget, {
+               options: {
+                       initSelector: ":jqmData(role='hsvpicker')"
+               },
+
+               _htmlProto: {
+                       ui: {
+                               container: "#hsvpicker",
+                               hue: {
+                                       eventSource: "[data-event-source='hue']",
+                                       selector: "#hsvpicker-hue-selector",
+                                       hue: "#hsvpicker-hue-hue",
+                                       valMask:  "#hsvpicker-hue-mask-val"
+                               },
+                               sat: {
+                                       gradient: "#hsvpicker-sat-gradient",
+                                       eventSource: "[data-event-source='sat']",
+                                       selector: "#hsvpicker-sat-selector",
+                                       hue: "#hsvpicker-sat-hue",
+                                       valMask: "#hsvpicker-sat-mask-val"
+                               },
+                               val: {
+                                       gradient: "#hsvpicker-val-gradient",
+                                       eventSource: "[data-event-source='val']",
+                                       selector: "#hsvpicker-val-selector",
+                                       hue: "#hsvpicker-val-hue"
+                               }
+                       }
+               },
+
+               _create: function () {
+                       var self = this,
+                               chan,
+                               hsvIdx,
+                               max,
+                               step;
+
+                       this.element
+                               .css( "display", "none" )
+                               .after( this._ui.container );
+
+                       this._ui.hue.hue.huegradient();
+
+                       $.extend( this, {
+                               dragging_hsv: [ 0, 0, 0],
+                               selectorDraggingOffset: {
+                                       x : -1,
+                                       y : -1
+                               },
+                               dragging: -1
+                       } );
+
+                       this._ui.container.find( ".hsvpicker-arrow-btn" )
+                               .buttonMarkup()
+                               .bind( "vclick", function ( e ) {
+                                       chan = $( this).attr( "data-" + ( $.mobile.ns || "" ) + "target" );
+                                       hsvIdx = ( "hue" === chan ) ? 0 :
+                                                       ( "sat" === chan) ? 1 : 2;
+                                       max = ( 0 == hsvIdx ? 360 : 1 );
+                                       step = 0.05 * max;
+
+                                       self.dragging_hsv[hsvIdx] = self.dragging_hsv[hsvIdx] + step * ( "left" === $( this ).attr( "data-" + ( $.mobile.ns || "" ) + "location" ) ? -1 : 1);
+                                       self.dragging_hsv[hsvIdx] = Math.min( max, Math.max( 0.0, self.dragging_hsv[hsvIdx] ) );
+                                       self._updateSelectors( self.dragging_hsv );
+                               } );
+
+                       $( document )
+                               .bind( "vmousemove", function ( event ) {
+                                       if ( self.dragging != -1 ) {
+                                               event.stopPropagation();
+                                               event.preventDefault();
+                                       }
+                               } )
+                               .bind( "vmouseup", function ( event ) {
+                                       self.dragging = -1;
+                               } );
+
+                       this._bindElements( "hue", 0 );
+                       this._bindElements( "sat", 1 );
+                       this._bindElements( "val", 2 );
+               },
+
+               _bindElements: function ( chan, idx ) {
+                       var self = this;
+                       this._ui[chan].selector
+                               .bind( "mousedown vmousedown", function ( e ) { self._handleMouseDown( chan, idx, e, true ); } )
+                               .bind( "vmousemove touchmove", function ( e ) { self._handleMouseMove( chan, idx, e, true ); } )
+                               .bind( "vmouseup",             function ( e ) { self.dragging = -1; } );
+                       this._ui[chan].eventSource
+                               .bind( "mousedown vmousedown", function ( e ) { self._handleMouseDown( chan, idx, e, false ); } )
+                               .bind( "vmousemove touchmove", function ( e ) { self._handleMouseMove( chan, idx, e, false ); } )
+                               .bind( "vmouseup",             function ( e ) { self.dragging = -1; } );
+               },
+
+               _handleMouseDown: function ( chan, idx, e, isSelector ) {
+                       var coords = $.mobile.tizen.targetRelativeCoordsFromEvent( e ),
+                               widgetStr = ( isSelector ? "selector" : "eventSource" );
+
+                       if ( coords.x >= 0 && coords.x <= this._ui[chan][widgetStr].outerWidth() &&
+                                       coords.y >= 0 && coords.y <= this._ui[chan][widgetStr].outerHeight() ) {
+
+                               this.dragging = idx;
+
+                               if ( isSelector ) {
+                                       this.selectorDraggingOffset.x = coords.x;
+                                       this.selectorDraggingOffset.y = coords.y;
+                               }
+
+                               this._handleMouseMove( chan, idx, e, isSelector, coords );
+                       }
+               },
+
+               _handleMouseMove: function ( chan, idx, e, isSelector, coords ) {
+                       if ( this.dragging === idx ) {
+                               coords = ( coords || $.mobile.tizen.targetRelativeCoordsFromEvent( e ) );
+
+                               var factor = ( ( 0 === idx ) ? 360 : 1 ),
+                                       potential = ( isSelector
+                                                       ? ( ( this.dragging_hsv[idx] / factor) +
+                                                                       ( ( coords.x - this.selectorDraggingOffset.x ) / this._ui[chan].eventSource.width() ) )
+                                                                       : ( coords.x / this._ui[chan].eventSource.width() ) );
+
+                               this.dragging_hsv[idx] = Math.min( 1.0, Math.max( 0.0, potential ) ) * factor;
+
+                               if ( !isSelector ) {
+                                       this.selectorDraggingOffset.x = Math.ceil( this._ui[chan].selector.outerWidth() / 2.0 );
+                                       this.selectorDraggingOffset.y = Math.ceil( this._ui[chan].selector.outerHeight() / 2.0 );
+                               }
+
+                               this._updateSelectors( this.dragging_hsv );
+                               e.stopPropagation();
+                               e.preventDefault();
+                       }
+               },
+
+               _updateSelectors: function ( hsv ) {
+                       var clrlib = $.tizen.colorwidget.clrlib,
+                               clrwidget = $.tizen.colorwidget.prototype,
+                               clr = clrlib.HSVToHSL( hsv ),
+                               hclr = clrlib.HSVToHSL( [hsv[0], 1.0, 1.0] ),
+                               vclr = clrlib.HSVToHSL( [hsv[0], hsv[1], 1.0] );
+
+                       this._ui.hue.selector.css( { left : this._ui.hue.eventSource.width() * hsv[0] / 360} );
+                       clrwidget._setElementColor.call( this, this._ui.hue.selector,  clr, "background" );
+                       if ( $.mobile.browser.ie ) {
+                               this._ui.hue.hue.find( "*" ).css( "opacity", hsv[1] );
+                       } else {
+                               this._ui.hue.hue.css( "opacity", hsv[1] );
+                       }
+
+                       this._ui.hue.valMask.css( "opacity", 1.0 - hsv[2] );
+
+                       this._ui.sat.selector.css( { left : this._ui.sat.eventSource.width() * hsv[1]} );
+                       clrwidget._setElementColor.call( this, this._ui.sat.selector,  clr, "background" );
+                       clrwidget._setElementColor.call( this, this._ui.sat.hue, hclr, "background" );
+                       this._ui.sat.valMask.css( "opacity", 1.0 - hsv[2] );
+
+                       this._ui.val.selector.css( { left : this._ui.val.eventSource.width() * hsv[2]} );
+                       clrwidget._setElementColor.call( this, this._ui.val.selector,  clr, "background" );
+                       clrwidget._setElementColor.call( this, this._ui.val.hue, vclr, "background" );
+                       clrwidget._setColor.call( this, clrlib.RGBToHTML( clrlib.HSLToRGB(clr) ) );
+               },
+
+               _setDisabled: function ( value ) {
+                       $.tizen.widgetex.prototype._setDisabled.call( this, value );
+                       this._ui.container[value ? "addClass" : "removeClass"]( "ui-disabled" );
+                       this._ui.hue.hue.huegradient( "option", "disabled", value );
+                       $.tizen.colorwidget.prototype._displayDisabledState.call( this, this._ui.container );
+               },
+
+               _setColor: function ( clr ) {
+                       if ( $.tizen.colorwidget.prototype._setColor.call( this, clr ) ) {
+                               this.dragging_hsv = $.tizen.colorwidget.clrlib.RGBToHSV( $.tizen.colorwidget.clrlib.HTMLToRGB( this.options.color ) );
+                               this._updateSelectors( this.dragging_hsv );
+                       }
+               }
+       } );
+
+       $( document ).bind( "pagecreate create", function ( e ) {
+               $( $.tizen.hsvpicker.prototype.options.initSelector, e.target )
+                       .not( ":jqmData(role='none'), :jqmData(role='nojs')" )
+                       .hsvpicker();
+       } );
+
+}( jQuery ) );
\ No newline at end of file
old mode 100644 (file)
new mode 100755 (executable)
index d06246e..c65f942
@@ -1,6 +1,27 @@
-/*
-       Author: Minkyu Kang <mk7.kang@samsung.com>
-*/
+/* ***************************************************************************
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ *
+ *     Author: Minkyu Kang <mk7.kang@samsung.com>
+ */
 
 /*
  * Notification widget
@@ -44,8 +65,8 @@
  *
  */
 
-(function ($, window, undefined) {
-       $.widget("tizen.imageslider", $.mobile.widget, {
+(function ( $, window, undefined ) {
+       $.widget( "tizen.imageslider", $.mobile.widget, {
                options: {
                        photoFlicking: false
                },
@@ -59,8 +80,8 @@
                cur_img: null,
                prev_img: null,
                next_img: null,
-               images: null,
-               images_hold: null,
+               images: [],
+               images_hold: [],
                index: 0,
                align_type: null,
                direction: 1,
                interval: null,
 
                _resize: function ( obj ) {
-                       var width;
-                       var height;
-                       var margin = 40;
-                       var ratio;
-                       var img_max_width = this.max_width - margin;
-                       var img_max_height = this.max_height - margin;
+                       var width,
+                               height,
+                               margin = 40,
+                               ratio,
+                               img_max_width = this.max_width - margin,
+                               img_max_height = this.max_height - margin;
 
                        height = obj.height();
                        width = obj.width();
                _align: function ( obj, img ) {
                        var img_top = 0;
 
-                       if ( !obj.length )
+                       if ( !obj.length ) {
                                return;
+                       }
 
                        if ( this.align_type == "middle" ) {
-                               img_top = (this.max_height - img.height()) / 2;
+                               img_top = ( this.max_height - img.height() ) / 2;
                        } else if ( this.align_type == "bottom" ) {
                                img_top = this.max_height - img.height();
                        } else {
                },
 
                _drag: function ( _x ) {
+                       var delta,
+                               coord_x;
+
                        if ( !this.dragging ) {
                                return;
                        }
 
                        if ( this.options.photoFlicking === false ) {
-                               var delta = this.org_x - _x;
+                               delta = this.org_x - _x;
 
                                // first image
                                if ( delta < 0 && !this.prev_img.length ) {
                                }
                        }
 
-                       var coord_x = _x - this.org_x;
+                       coord_x = _x - this.org_x;
 
                        this.cur_img.css( 'left', coord_x + 'px' );
                        if ( this.next_img.length ) {
-                               this.next_img.css('left',
-                                               coord_x + this.max_width + 'px');
+                               this.next_img.css( 'left', coord_x + this.max_width + 'px' );
                        }
                        if ( this.prev_img.length ) {
-                               this.prev_img.css('left',
-                                               coord_x - this.max_width + 'px');
+                               this.prev_img.css( 'left', coord_x - this.max_width + 'px' );
                        }
                },
 
                _move: function ( _x ) {
-                       var delta = this.org_x - _x;
-                       var flip = 0;
+                       var delta = this.org_x - _x,
+                               flip = 0,
+                               date,
+                               drag_time,
+                               sec,
+                               self;
 
                        if ( delta == 0 ) {
                                return;
                        }
 
                        if ( delta > 0 ) {
-                               flip = delta < (this.max_width * 0.45) ? 0 : 1;
+                               flip = delta < ( this.max_width * 0.45 ) ? 0 : 1;
                        } else {
-                               flip = -delta < (this.max_width * 0.45) ? 0 : 1;
+                               flip = -delta < ( this.max_width * 0.45 ) ? 0 : 1;
                        }
 
                        if ( !flip ) {
-                               var date = new Date();
-                               var drag_time = date.getTime() - this.org_time;
+                               date = new Date();
+                               drag_time = date.getTime() - this.org_time;
 
-                               if ( Math.abs(delta) / drag_time > 1 ) {
+                               if ( Math.abs( delta ) / drag_time > 1 ) {
                                        flip = 1;
                                }
                        }
                                        this.index++;
 
                                        if ( this.next_img.length ) {
-                                               this.next_img.css( 'left',
-                                                       this.max_width + 'px' );
-                                               this._attach( this.index + 1,
-                                                       this.next_img );
+                                               this.next_img.css( 'left', this.max_width + 'px' );
+                                               this._attach( this.index + 1, this.next_img );
                                        }
 
                                        this.direction = 1;
                                        this.index--;
 
                                        if ( this.prev_img.length ) {
-                                               this.prev_img.css( 'left',
-                                                       -this.max_width + 'px' );
-                                               this._attach( this.index - 1,
-                                                       this.prev_img );
+                                               this.prev_img.css( 'left', -this.max_width + 'px' );
+                                               this._attach( this.index - 1, this.prev_img );
                                        }
 
                                        this.direction = -1;
                                }
                        }
 
-                       var sec = 500;
-                       var self = this;
+                       sec = 500;
+                       self = this;
 
                        this.moving = true;
 
-                       this.interval = setInterval(function () {
+                       this.interval = setInterval( function () {
                                self.moving = false;
                                clearInterval( self.interval );
-                       }, sec - 50);
+                       }, sec - 50 );
 
-                       this.cur_img.animate({left: 0}, sec);
+                       this.cur_img.animate( { left: 0 }, sec );
                        if ( this.next_img.length ) {
-                               this.next_img.animate({left: this.max_width}, sec);
+                               this.next_img.animate( { left: this.max_width }, sec );
                        }
                        if ( this.prev_img.length ) {
-                               this.prev_img.animate({left: -this.max_width}, sec);
+                               this.prev_img.animate( { left: -this.max_width }, sec );
                        }
                },
 
                _add_event: function () {
-                       var self = this;
+                       var self = this,
+                               date;
 
-                       this.container.bind('vmousemove', function ( e ) {
+                       this.container.bind( 'vmousemove', function ( e ) {
                                e.preventDefault();
 
                                if ( self.moving ) {
                                }
 
                                self._drag( e.pageX );
-                       });
+                       } );
 
-                       this.container.bind('vmousedown', function ( e ) {
+                       this.container.bind( 'vmousedown', function ( e ) {
                                e.preventDefault();
 
                                if ( self.moving ) {
 
                                self.org_x = e.pageX;
 
-                               var date = new Date();
+                               date = new Date();
                                self.org_time = date.getTime();
-                       });
+                       } );
 
-                       this.container.bind('vmouseup', function (e) {
+                       this.container.bind( 'vmouseup', function ( e ) {
                                if ( self.moving ) {
                                        return;
                                }
                                self.dragging = false;
 
                                self._move( e.pageX );
-                       });
+                       } );
 
-                       this.container.bind('vmouseout', function (e) {
+                       this.container.bind( 'vmouseout', function ( e ) {
                                if ( self.moving ) {
                                        return;
                                }
                                        return;
                                }
 
-                               if ( (e.pageX < 20) ||
-                                       (e.pageX > (self.max_width - 20)) ) {
+                               if ( ( e.pageX < 20 ) ||
+                                               ( e.pageX > ( self.max_width - 20 ) ) ) {
                                        self._move( e.pageX );
                                        self.dragging = false;
                                }
-                       });
+                       } );
                },
 
                _del_event: function () {
-                       this.container.unbind('vmousemove');
-                       this.container.unbind('vmousedown');
-                       this.container.unbind('vmouseup');
-                       this.container.unbind('vmouseout');
+                       this.container.unbind( 'vmousemove' );
+                       this.container.unbind( 'vmousedown' );
+                       this.container.unbind( 'vmouseup' );
+                       this.container.unbind( 'vmouseout' );
                },
 
                _show: function () {
-                       this.cur_img = $('div').find(
-                                       '.ui-imageslider-bg:eq(' + this.index + ')');
+                       this.cur_img = $( 'div' ).find( '.ui-imageslider-bg:eq(' + this.index + ')' );
                        this.prev_img = this.cur_img.prev();
                        this.next_img = this.cur_img.next();
 
                                this.prev_img.css( 'left', -this.max_width + 'px' );
                        }
 
-                       this.cur_img.css( 'left', 0 + 'px' );
+                       this.cur_img.css( 'left', '0px' );
 
                        if ( this.next_img.length ) {
                                this.next_img.css( 'left', this.max_width + 'px' );
                },
 
                _get_height: function () {
-                       var $page = $('.ui-page');
-                       var $content = $page.children('.ui-content');
-                       var $header = $page.children('.ui-header');
-                       var $footer = $page.children('.ui-footer');
-
-                       var header_h = $header.outerHeight();
-                       var footer_h = $footer.outerHeight();
-                       var padding = parseFloat($content.css('padding-top')) +
-                                       parseFloat($content.css('padding-bottom'));
-
-                       var content_h = window.innerHeight - header_h -
-                                       footer_h - padding * 2;
+                       var $page = $( '.ui-page' ),
+                               $content = $page.children( '.ui-content' ),
+                               $header = $page.children( '.ui-header' ),
+                               $footer = $page.children( '.ui-footer' ),
+                               header_h = $header.outerHeight(),
+                               footer_h = $footer.outerHeight(),
+                               padding = parseFloat( $content.css( 'padding-top' ) ) + parseFloat( $content.css( 'padding-bottom' ) ),
+                               content_h = $( window ).height() - header_h - footer_h - padding * 2;
 
                        return content_h;
                },
 
                _create: function () {
-                       this.images = new Array();
-                       this.images_hold = new Array();
+                       var temp_img,
+                               start_index,
+                               i = 0;
 
-                       $( this.element ).wrapInner('<div class="ui-imageslider"></div>');
-                       $('img').wrap('<div class="ui-imageslider-bg"></div>');
+                       $( this.element ).wrapInner( '<div class="ui-imageslider"></div>' );
+                       $( this.element ).find( 'img' ).wrap( '<div class="ui-imageslider-bg"></div>' );
 
                        this.container = $( this.element ).find('.ui-imageslider');
 
-                       this.max_width = window.innerWidth;
+                       this.max_width = $( window ).width();
                        this.max_height = this._get_height();
                        this.container.css( 'height', this.max_height );
 
-                       var temp_img = $('div').find('.ui-imageslider-bg:first');
-
-                       for ( i = 0; ; i++ ) {
-                               if ( !temp_img.length ) {
-                                       break;
-                               }
-
-                               this.images[i] = temp_img.find('img');
+                       temp_img = $( 'div' ).find( '.ui-imageslider-bg:first' );
 
+                       while ( temp_img.length ) {
+                               this.images[i] = temp_img.find( 'img' );
                                temp_img = temp_img.next();
+                               i++;
                        }
 
                        for ( i = 0; i < this.images.length; i++ ) {
                                this.images[i].detach();
                        }
 
-                       var start_index = parseInt( $(this.element).attr('data-start-index') );
+                       start_index = parseInt( $( this.element ).attr( 'data-start-index' ), 10 );
                        if ( start_index === undefined ) {
                                start_index = 0;
                        }
 
                        this.index = start_index;
 
-                       this.align_type = $( this.element ).attr('data-vertical-align');
+                       this.align_type = $( this.element ).attr( 'data-vertical-align' );
                },
 
                _update: function () {
-                       while ( 1 ) {
-                               if ( !this.images_hold.length ) {
-                                       break;
-                               }
+                       var image_file,
+                               bg_html,
+                               temp_img;
 
-                               var image_file = this.images_hold.shift();
+                       while ( this.images_hold.length ) {
+                               image_file = this.images_hold.shift();
 
-                               var bg_html = $('<div class="ui-imageslider-bg"></div>');
-                               var temp_img = $('<img src="' + image_file + '"></div>');
+                               bg_html = $( '<div class="ui-imageslider-bg"></div>' );
+                               temp_img = $( '<img src="' + image_file + '"></div>' );
 
                                bg_html.append( temp_img );
                                this.container.append( bg_html );
                                        }
                                }
 
-                               this.cur_img.animate({left: 0}, 500);
+                               this.cur_img.animate( { left: 0 }, 500 );
 
                        } else if ( image_index == this.index - 1 ) {
                                temp_img = this.prev_img;
                                }
 
                        } else {
-                               temp_img = $('div').find('.ui-imageslider-bg:eq('+ image_index + ')');
+                               temp_img = $( 'div' ).find( '.ui-imageslider-bg:eq(' + image_index + ')' );
                        }
 
                        this.images.splice( image_index, 1 );
                        temp_img.detach();
-               },
+               }
        }); /* End of widget */
 
        // auto self-init widgets
-       $( document ).bind("pagecreate", function (e) {
-               $( e.target ).find(":jqmData(role='imageslider')").imageslider();
+       $( document ).bind( "pagecreate", function ( e ) {
+               $( e.target ).find( ":jqmData(role='imageslider')" ).imageslider();
        });
 
-       $( document ).bind("pageshow", function (e) {
-               $( e.target ).find(":jqmData(role='imageslider')").imageslider('show');
+       $( document ).bind( "pageshow", function ( e ) {
+               $( e.target ).find( ":jqmData(role='imageslider')" ).imageslider( 'show' );
        });
 
-       $( document ).bind("pagebeforehide", function (e) {
-               $ (e.target ).find(":jqmData(role='imageslider')").imageslider('hide');
-       });
+       $( document ).bind( "pagebeforehide", function ( e ) {
+               $( e.target ).find( ":jqmData(role='imageslider')" ).imageslider( 'hide' );
+       } );
 
-})( jQuery, this );
+}( jQuery, this ) );
old mode 100644 (file)
new mode 100755 (executable)
index a1c9689..5eb6065
 //   Set to false to hide scrollbars on the container's scrollview.
 //   Has no effect is scrollable=false
 
-(function ($, undefined) {
+(function ( $, undefined ) {
 
-// hbox
-$.widget("tizen.layouthbox", $.tizen.jlayoutadaptor, {
-    fixed: {
-        type: 'flexGrid',
-        rows: 1,
-        direction: 'x',
-        initSelector: ':jqmData(layout="hbox")'
-    },
+       // hbox
+       $.widget( "tizen.layouthbox", $.tizen.jlayoutadaptor, {
+               fixed: {
+                       type: 'flexGrid',
+                       rows: 1,
+                       direction: 'x',
+                       initSelector: ':jqmData(layout="hbox")'
+               },
 
-    _create: function () {
-        if (!this.options.hgap) {
-            this.options.hgap = 0;
-        }
+               _create: function () {
+                       if ( !this.options.hgap ) {
+                               this.options.hgap = 0;
+                       }
 
-        $.tizen.jlayoutadaptor.prototype._create.apply(this, arguments);
-    }
-});
+                       $.tizen.jlayoutadaptor.prototype._create.apply( this, arguments );
+               }
+       } );
 
-$(document).bind("pagecreate", function (e) {
-    $($.tizen.layouthbox.prototype.fixed.initSelector, e.target)
-    .not(":jqmData(role='none'), :jqmData(role='nojs')")
-    .layouthbox();
-});
+       $( document ).bind( "pagecreate", function ( e ) {
+               $( $.tizen.layouthbox.prototype.fixed.initSelector, e.target )
+                       .not( ":jqmData(role='none'), :jqmData(role='nojs')" )
+                       .layouthbox();
+       } );
 
-// vbox
-$.widget("tizen.layoutvbox", $.tizen.jlayoutadaptor, {
-    fixed: {
-        type: 'flexGrid',
-        columns: 1,
-        direction: 'y',
-        initSelector: ':jqmData(layout="vbox")'
-    },
+       // vbox
+       $.widget( "tizen.layoutvbox", $.tizen.jlayoutadaptor, {
+               fixed: {
+                       type: 'flexGrid',
+                       columns: 1,
+                       direction: 'y',
+                       initSelector: ':jqmData(layout="vbox")'
+               },
 
-    _create: function () {
-        if (!this.options.vgap) {
-            this.options.vgap = 0;
-        }
+               _create: function () {
+                       if ( !this.options.vgap ) {
+                               this.options.vgap = 0;
+                       }
 
-        $.tizen.jlayoutadaptor.prototype._create.apply(this, arguments);
-    }
-});
+                       $.tizen.jlayoutadaptor.prototype._create.apply( this, arguments );
+               }
+       } );
 
-$(document).bind("pagecreate", function (e) {
-    $($.tizen.layoutvbox.prototype.fixed.initSelector, e.target)
-    .not(":jqmData(role='none'), :jqmData(role='nojs')")
-    .layoutvbox();
-});
+       $( document ).bind( "pagecreate", function ( e ) {
+               $( $.tizen.layoutvbox.prototype.fixed.initSelector, e.target )
+                       .not( ":jqmData(role='none'), :jqmData(role='nojs')" )
+                       .layoutvbox();
+       } );
 
-})(jQuery);
+}( jQuery ) );
old mode 100644 (file)
new mode 100755 (executable)
index e06714a..97e1680
 
 (function ($) {
 
-$.widget("todons.listviewcontrols", $.mobile.widget, {
-    _defaults: {
-        controlPanelSelector: null,
-        modesAvailable: ['edit', 'view'],
-        mode: 'view',
-        controlPanelShowIn: null
-    },
-
-    _listviewCssClass: 'ui-listviewcontrols-listview',
-    _controlsCssClass: 'ui-listviewcontrols-panel',
-
-    _create: function () {
-        var self = this,
-            o = this.options,
-            optionsValid = true,
-            page = this.element.closest('.ui-page'),
-            controlPanelSelectorAttr = 'data-' + $.mobile.ns + 'listviewcontrols',
-            controlPanelSelector = this.element.attr(controlPanelSelectorAttr),
-            dataOptions = this.element.jqmData('listviewcontrols-options'),
-            controlPanelShowInAttr;
-
-        o.controlPanelSelector = o.controlPanelSelector || controlPanelSelector;
-
-        // precedence for options: defaults < jqmData attribute < options arg
-        o = $.extend({}, this._defaults, dataOptions, o);
-
-        optionsValid = (this._validOption('modesAvailable', o.modesAvailable, o) &&
-                        this._validOption('controlPanelSelector', o.controlPanelSelector, o) &&
-                        this._validOption('mode', o.mode, o));
-
-        if (!optionsValid) {
-            return false;
-        }
-
-        // get the controls element
-        this.controlPanel = $(document).find(o.controlPanelSelector).first();
-
-        if (this.controlPanel.length === 0) {
-            return false;
-        }
-
-        // once we have the controls element, we may need to override the
-        // mode in which controls are shown
-        controlPanelShowInAttr = this.controlPanel.jqmData('listviewcontrols-show-in');
-        if (controlPanelShowInAttr) {
-            o.controlPanelShowIn = controlPanelShowInAttr;
-        }
-        else if (!o.controlPanelShowIn) {
-            o.controlPanelShowIn = o.modesAvailable[0];
-        }
-
-        if (!this._validOption('controlPanelShowIn', o.controlPanelShowIn, o)) {
-            return;
-        }
-
-        // done setting options
-        this.options = o;
-
-        // mark the controls and the list with a class
-        this.element.removeClass(this._listviewCssClass).addClass(this._listviewCssClass);
-        this.controlPanel.removeClass(this._controlsCssClass).addClass(this._controlsCssClass);
-
-        // show the widget
-        if (page && !page.is(':visible')) {
-            page.bind('pageshow', function () { self.refresh(); });
-        }
-        else {
-            this.refresh();
-        }
-    },
-
-    _validOption: function (varName, value, otherOptions) {
-        var ok = false;
-
-        if (varName === 'mode') {
-            ok = ($.inArray(value, otherOptions.modesAvailable) >= 0);
-        }
-        else if (varName === 'controlPanelSelector') {
-            ok = ($.type(value) === 'string');
-        }
-        else if (varName === 'modesAvailable') {
-            ok = ($.isArray(value) && value.length > 1);
-
-            if (ok) {
-                for (var i = 0; i < value.length; i++) {
-                    if (value[i] === '' || $.type(value[i]) !== 'string') {
-                        ok = false;
-                    }
-                }
-            }
-        }
-        else if (varName === 'controlPanelShowIn') {
-            ok = ($.inArray(value, otherOptions.modesAvailable) >= 0);
-        }
-
-        return ok;
-    },
-
-    _setOption: function (varName, value) {
-        var oldValue = this.options[varName];
-
-        if (oldValue !== value && this._validOption(varName, value, this.options)) {
-            this.options[varName] = value;
-            this.refresh();
-        }
-    },
-
-    visibleListItems: function () {
-        return this.element.find('li:not(:jqmData(role=list-divider)):visible');
-    },
-
-    refresh: function () {
-        var self = this,
-            triggerUpdateLayout = false,
-            isVisible = null,
-            showIn,
-            modalElements;
-
-        // hide/show the control panel and hide/show controls inside
-        // list items based on their "show-in" option
-        isVisible = this.controlPanel.is(':visible');
-
-        if (this.options.mode === this.options.controlPanelShowIn) {
-            this.controlPanel.show();
-        }
-        else {
-            this.controlPanel.hide();
-        }
-
-        if (this.controlPanel.is(':visible') !== isVisible) {
-            triggerUpdateLayout = true;
-        }
-
-        // we only operate on elements inside list items which aren't dividers
-        modalElements = this.element.find('li:not(:jqmData(role=list-divider))')
-                                    .find(':jqmData(listviewcontrols-show-in)');
-
-        modalElements.each(function () {
-            showIn = $(this).jqmData('listviewcontrols-show-in');
-
-            isVisible = $(this).is(':visible');
-
-            if (showIn === self.options.mode) {
-                $(this).show();
-            }
-            else {
-                $(this).hide();
-            }
-
-            if ($(this).is(':visible') !== isVisible) {
-                triggerUpdateLayout = true;
-            }
-        });
-
-        if (triggerUpdateLayout) {
-            this.element.trigger('updatelayout');
-        }
-    }
-});
-
-$('ul').live('listviewcreate', function () {
-       var list = $(this);
-
-       if (list.is(':jqmData(listviewcontrols)')) {
-               list.listviewcontrols();
-       }
-});
-
-})(jQuery);
+       $.widget( "todons.listviewcontrols", $.mobile.widget, {
+               _defaults: {
+                       controlPanelSelector: null,
+                       modesAvailable: ['edit', 'view'],
+                       mode: 'view',
+                       controlPanelShowIn: null
+               },
+
+               _listviewCssClass: 'ui-listviewcontrols-listview',
+               _controlsCssClass: 'ui-listviewcontrols-panel',
+
+               _create: function () {
+                       var self = this,
+                               o = this.options,
+                               optionsValid = true,
+                               page = this.element.closest( '.ui-page' ),
+                               controlPanelSelectorAttr = 'data-' + $.mobile.ns + 'listviewcontrols',
+                               controlPanelSelector = this.element.attr( controlPanelSelectorAttr ),
+                               dataOptions = this.element.jqmData( 'listviewcontrols-options' ),
+                               controlPanelShowInAttr;
+
+                       o.controlPanelSelector = o.controlPanelSelector || controlPanelSelector;
+
+                       // precedence for options: defaults < jqmData attribute < options arg
+                       o = $.extend( {}, this._defaults, dataOptions, o );
+
+                       optionsValid = ( this._validOption( 'modesAvailable', o.modesAvailable, o ) &&
+                                       this._validOption( 'controlPanelSelector', o.controlPanelSelector, o ) &&
+                                       this._validOption( 'mode', o.mode, o ) );
+
+                       if ( !optionsValid ) {
+                               return false;
+                       }
+
+                       // get the controls element
+                       this.controlPanel = $( document ).find( o.controlPanelSelector ).first();
+
+                       if ( this.controlPanel.length === 0 ) {
+                               return false;
+                       }
+
+                       // once we have the controls element, we may need to override the
+                       // mode in which controls are shown
+                       controlPanelShowInAttr = this.controlPanel.jqmData( 'listviewcontrols-show-in' );
+                       if ( controlPanelShowInAttr ) {
+                               o.controlPanelShowIn = controlPanelShowInAttr;
+                       } else if ( !o.controlPanelShowIn ) {
+                               o.controlPanelShowIn = o.modesAvailable[0];
+                       }
+
+                       if ( !this._validOption( 'controlPanelShowIn', o.controlPanelShowIn, o ) ) {
+                               return;
+                       }
+
+                       // done setting options
+                       this.options = o;
+
+                       // mark the controls and the list with a class
+                       this.element.removeClass(this._listviewCssClass).addClass(this._listviewCssClass);
+                       this.controlPanel.removeClass(this._controlsCssClass).addClass(this._controlsCssClass);
+
+                       // show the widget
+                       if ( page && !page.is( ':visible' ) ) {
+                               page.bind( 'pageshow', function () { self.refresh(); } );
+                       } else {
+                               this.refresh();
+                       }
+               },
+
+               _validOption: function ( varName, value, otherOptions ) {
+                       var ok = false,
+                               i = 0;
+
+                       if ( varName === 'mode' ) {
+                               ok = ( $.inArray( value, otherOptions.modesAvailable ) >= 0 );
+                       } else if ( varName === 'controlPanelSelector' ) {
+                               ok = ( $.type( value ) === 'string' );
+                       } else if ( varName === 'modesAvailable' ) {
+                               ok = ( $.isArray( value ) && value.length > 1 );
+
+                               if ( ok ) {
+                                       for ( i = 0; i < value.length; i++ ) {
+                                               if ( value[i] === '' || $.type( value[i] ) !== 'string' ) {
+                                                       ok = false;
+                                               }
+                                       }
+                               }
+                       } else if ( varName === 'controlPanelShowIn' ) {
+                               ok = ( $.inArray( value, otherOptions.modesAvailable ) >= 0 );
+                       }
+
+                       return ok;
+               },
+
+               _setOption: function ( varName, value ) {
+                       var oldValue = this.options[varName];
+
+                       if ( oldValue !== value && this._validOption( varName, value, this.options ) ) {
+                               this.options[varName] = value;
+                               this.refresh();
+                       }
+               },
+
+               visibleListItems: function () {
+                       return this.element.find( 'li:not(:jqmData(role=list-divider)):visible' );
+               },
+
+               refresh: function () {
+                       var self = this,
+                               triggerUpdateLayout = false,
+                               isVisible = null,
+                               showIn,
+                               modalElements;
+
+                       // hide/show the control panel and hide/show controls inside
+                       // list items based on their "show-in" option
+                       isVisible = this.controlPanel.is( ':visible' );
+
+                       if ( this.options.mode === this.options.controlPanelShowIn ) {
+                               this.controlPanel.show();
+                       } else {
+                               this.controlPanel.hide();
+                       }
+
+                       if ( this.controlPanel.is( ':visible' ) !== isVisible ) {
+                               triggerUpdateLayout = true;
+                       }
+
+                       // we only operate on elements inside list items which aren't dividers
+                       modalElements = this.element
+                                                               .find( 'li:not(:jqmData(role=list-divider))' )
+                                                               .find( ':jqmData(listviewcontrols-show-in)' );
+
+                       modalElements.each(function () {
+                               showIn = $( this ).jqmData( 'listviewcontrols-show-in' );
+
+                               isVisible = $( this ).is( ':visible' );
+
+                               if ( showIn === self.options.mode ) {
+                                       $( this ).show();
+                               } else {
+                                       $( this ).hide();
+                               }
+
+                               if ( $( this ).is( ':visible' ) !== isVisible ) {
+                                       triggerUpdateLayout = true;
+                               }
+                       } );
+
+                       if ( triggerUpdateLayout ) {
+                               this.element.trigger( 'updatelayout' );
+                       }
+               }
+       } );
+
+       $( 'ul' ).live( 'listviewcreate', function () {
+               var list = $(this);
+
+               if ( list.is( ':jqmData(listviewcontrols)' ) ) {
+                       list.listviewcontrols();
+               }
+       } );
+
+}( jQuery ) );
diff --git a/src/widgets/multibuttonentry/js/jquery.mobile.tizen.multibuttonentry.js b/src/widgets/multibuttonentry/js/jquery.mobile.tizen.multibuttonentry.js
new file mode 100755 (executable)
index 0000000..1447f39
--- /dev/null
@@ -0,0 +1,525 @@
+/* ***************************************************************************
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ *
+ *     Author: Kangsik Kim <kangsik81.kim@samsung.com>
+*/
+
+/**
+ *     Multibuttonentry widget is a kind of button widget.
+ *     When a user inputs a text and the text gets an change event,
+ *     the text can be changed from it to a button widget.
+ *
+ *     HTML Attributes:
+ *
+ *             data-listUrl : This attribute is represent a 'id' about page.
+ *                             This page is containing prepared data for provide to user.
+ *                             For example, like address book.
+ *             data-label:     This attribute is providing label for user-guide. (Default : 'To : ')
+ *             data-descMessage : This attribute is managing message format.
+ *                              This message is displayed when widget status was changed to 'focusout'.
+ *
+ *     APIs:
+ *
+ *             inputtext ( void )
+ *                     : Get a string from inputbox.
+ *             inputtext (  [string]  )
+ *                     : If argument is not exist, will get a string from inputbox.
+ *                     If argument is exist, will set a string to inputbox.
+ *             select (  [number]  )
+ *                     : If argument is not exist, will act  as a getter.
+ *                     Get a string of selected block.
+ *                     If widget is not exist a selected button, it will return 'null'.
+ *                     Select a button located on the index. (number : index of button)
+ *             add ( text, [number] )
+ *                     : If second argument is not exist, will insert to a new textblock at last position.
+ *                     Insert a new button at position that is pointed by index. (number : index of button)
+ *             remove ( [number] )
+ *                     : If argument is not exist, will remove all buttons.
+ *                     Remove a button that is pointed by index. (number : index of button)
+ *             length ( void )
+ *                     : Get a number of buttons.
+ *             foucsIn ( void )
+ *                     : This method change a status to 'focusin'.
+ *                     This status is able to manage a widget.
+ *             focusOut ( void )
+ *                     : This method change a status to 'focusout'.
+ *                     This status is not able to manage a widget.
+ *
+ *
+ *     Events:
+ *
+ *             select : This event will occur when select a button.
+ *             add : This event will occur when insert new button.
+ *             remove : This event will occur when remove a button.
+ *
+ *     Examples:
+ *
+ *             <div data-role="multibuttonentry" data-label="To : " data-listUrl:"#addressbook" data-descMessage="{0} & {1} more...">
+ *             </div>
+ *
+ */
+
+( function ( $, window, document, undefined ) {
+       $.widget( "tizen.multibuttonentry", $.mobile.widget, {
+               _focusStatus : null,
+               _items : null,
+               _viewWidth : 0,
+               _reservedWidth : 0,
+               _currentWidth : 0,
+               _fontSize : 0,
+               _anchorWidth : 0,
+               _labelWidth : 0,
+               _marginWidth : 0,
+               options : {
+                       label : "To : ",
+                       listUrl : "#addressbook",
+                       descMessage : "{0} & {1} more..."
+               },
+               _create : function () {
+                       var self = this,
+                               $view = this.element,
+                               role = $view.jqmData( "role" ),
+                               option = this.options,
+                               inputbox = $( document.createElement( "input" ) ),
+                               labeltag = $( document.createElement( "label" ) ),
+                               moreBlock = $( document.createElement( "a" ) );
+
+                       $view.hide().empty().addClass( "ui-" + role );
+
+                       // create a label tag.
+                       $( labeltag ).text( this.options.label ).addClass( "ui-multibuttonentry-label" );
+                       $view.append( labeltag );
+
+                       // create a input tag
+                       $( inputbox ).text( option.label ).addClass( "ui-multibuttonentry-input" );
+                       $view.append( inputbox );
+
+                       // create a anchor tag.
+                       $( moreBlock ).text( "+" ).attr( "href", option.listUrl ).addClass( "ui-multibuttonentry-link" );
+
+                       // append default htmlelements to main widget.
+                       $view.append( moreBlock );
+
+                       // bind a event
+                       this._bindEvents();
+                       self._focusStatus = "init";
+                       // display widget
+                       $view.show();
+                       $view.attr( "tabindex", -1 ).focusin( function ( e ) {
+                               self.focusIn();
+                       });
+
+                       // assign global variables
+                       self._viewWidth = $view.innerWidth();
+                       self._reservedWidth += self._calcBlockWidth( moreBlock );
+                       self._reservedWidth += self._calcBlockWidth( labeltag );
+                       self._fontSize = parseInt( $( moreBlock ).css( "font-size" ), 10 );
+                       self._currentWidth = self._reservedWidth;
+               },
+               // bind events
+               _bindEvents : function () {
+                       var self = this,
+                               $view = self.element,
+                               option = self.options,
+                               inputbox = $view.find( ".ui-multibuttonentry-input" ),
+                               moreBlock = $view.find( ".ui-multibuttonentry-link" );
+
+                       inputbox.bind( "keydown", function ( event ) {
+                               // 8  : backspace
+                               // 13 : Enter
+                               var keyValue = event.keyCode,
+                                       valueString = $( inputbox ).val();
+
+                               if ( keyValue == 8 ) {
+                                       if ( valueString.length === 0 ) {
+                                               self._validateTargetBlock();
+                                       }
+                               } else if ( keyValue == 13 ) {
+                                       if ( valueString.length !== 0 ) {
+                                               self._addTextBlock( valueString );
+                                       }
+                                       inputbox.val( "" );
+                               } else {
+                                       self._unlockTextBlock();
+                               }
+                       });
+
+                       moreBlock.click( function () {
+                               $.mobile.changePage( option.listUrl, {
+                                       transition: "slide",
+                                       reverse: false,
+                                       changeHash: false
+                               } );
+                       } );
+
+                       $( document ).bind( "pagechange.mbe", function ( event ) {
+                               if ( $view.innerWidth() === 0 ) {
+                                       return ;
+                               }
+                               var inputBox = $view.find( ".ui-multibuttonentry-input" );
+                               if ( self._labelWidth === 0 ) {
+                                       self._labelWidth = $view.find( ".ui-multibuttonentry-label" ).outerWidth( true );
+                                       self._anchorWidth = $view.find( ".ui-multibuttonentry-link" ).outerWidth( true );
+                                       self._marginWidth = parseInt( ( $( inputBox ).css( "margin-left" ) ), 10 );
+                                       self._marginWidth += parseInt( ( $( inputBox ).css( "margin-right" ) ), 10 );
+                                       self._viewWidth = $view.innerWidth();
+                               }
+                               self._modifyInputBoxWidth();
+                       });
+               },
+               // create a textbutton and append this button to parent layer.
+               // @param arg1 : string
+               // @param arg2 : index
+               _addTextBlock : function ( messages, blcokIndex ) {
+                       if ( arguments.length === 0 ) {
+                               return;
+                       }
+
+                       if ( ! messages ) {
+                               return ;
+                       }
+
+                       var self = this,
+                               $view = self.element,
+                               content = messages,
+                               index = blcokIndex,
+                               blocks = null,
+                               dataBlock = null,
+                               displayText = null,
+                               textBlock = null;
+
+                       if ( self._viewWidth === 0 ) {
+                               self._viewWidth = $view.innerWidth();
+                       }
+                       // save src data
+                       dataBlock = $( document.createElement( 'input' ) );
+                       dataBlock.val( content ).addClass( "ui-multibuttonentry-data" ).hide();
+
+                       // Create a new text HTMLDivElement.
+                       textBlock = $( document.createElement( 'div' ) );
+                       displayText = self._ellipsisTextBlock( content ) ;
+                       textBlock.text( displayText ).addClass( "ui-multibuttonentry-block" );
+                       textBlock.append( dataBlock );
+                       // bind a event to HTMLDivElement.
+                       textBlock.bind( "vclick", function ( event ) {
+                               if ( self._focusStatus === "focusOut" ) {
+                                       self.focusInEvent();
+                                       return;
+                               }
+
+                               if ( $( this ).hasClass( "ui-multibuttonentry-sblock" ) ) {
+                                       // If block is selected, it will be removed.
+                                       self._removeTextBlock();
+                               }
+
+                               var lockBlock = $view.find( "div.ui-multibuttonentry-sblock" );
+                               if ( typeof lockBlock != "undefined" ) {
+                                       lockBlock.removeClass( "ui-multibuttonentry-sblock" ).addClass( "ui-multibuttonentry-block" );
+                               }
+                               $( this ).removeClass( "ui-multibuttonentry-block" ).addClass( "ui-multibuttonentry-sblock" );
+                               self._trigger( "select" );
+                       });
+
+                       blocks = $view.find( "div" );
+                       if ( index !== null && index <= blocks.length ) {
+                               $( blocks[index] ).before( textBlock );
+                       } else {
+                               $view.find( ".ui-multibuttonentry-input" ).before( textBlock );
+                       }
+
+                       self._currentWidth += self._calcBlockWidth( textBlock );
+                       self._modifyInputBoxWidth();
+                       self._trigger( "add" );
+               },
+               _removeTextBlock : function () {
+                       var self = this,
+                               $view = this.element,
+                               targetBlock = null,
+                               lockBlock = $view.find( "div.ui-multibuttonentry-sblock" );
+
+                       if ( lockBlock !== null && lockBlock.length > 0 ) {
+                               self._currentWidth -= self._calcBlockWidth( lockBlock );
+                               lockBlock.remove();
+                               self._modifyInputBoxWidth();
+                               this._trigger( "remove" );
+                       } else {
+                               $view.find( "div:last" ).removeClass( "ui-multibuttonentry-block" ).addClass( "ui-multibuttonentry-sblock" );
+                       }
+               },
+               _calcBlockWidth : function ( block ) {
+                       var blockWidth = 0;
+                       blockWidth = $( block ).outerWidth( true );
+                       return blockWidth;
+               },
+               _unlockTextBlock : function () {
+                       var $view = this.element,
+                               lockBlock = $view.find( "div.ui-multibuttonentry-sblock" );
+                       if ( lockBlock !== null ) {
+                               lockBlock.removeClass( "ui-multibuttonentry-sblock" ).addClass( "ui-multibuttonentry-block" );
+                       }
+               },
+               // call when remove text block by backspace key.
+               _validateTargetBlock : function () {
+                       var self = this,
+                               $view = self.element,
+                               lastBlock = $view.find( "div:last" ),
+                               tmpBlock = null;
+
+                       if ( lastBlock.hasClass( "ui-multibuttonentry-sblock" ) ) {
+                               self._removeTextBlock();
+                       } else {
+                               tmpBlock = $view.find( "div.ui-multibuttonentry-sblock" );
+                               tmpBlock.removeClass( "ui-multibuttonentry-sblock" ).addClass( "ui-multibuttonentry-block" );
+                               lastBlock.removeClass( "ui-multibuttonentry-block" ).addClass( "ui-multibuttonentry-sblock" );
+                       }
+               },
+               _ellipsisTextBlock : function ( text ) {
+                       var self = this,
+                               str = text,
+                               length = 0,
+                               maxWidth = self._viewWidth,
+                               maxCharCnt = parseInt( ( self._viewWidth / self._fontSize ), 10 ) - 5,
+                               ellipsisStr = null;
+                       if ( str ) {
+                               length = str.length ;
+                               if ( length > maxCharCnt ) {
+                                       ellipsisStr = str.substring( 0, maxCharCnt );
+                                       ellipsisStr += "...";
+                               } else {
+                                       ellipsisStr = str;
+                               }
+                       }
+                       return ellipsisStr;
+               },
+               _modifyInputBoxWidth : function () {
+                       var self = this,
+                               $view = self.element,
+                               labelWidth = self._labelWidth,
+                               anchorWidth = self._anchorWidth,
+                               inputBoxWidth = self._viewWidth - labelWidth - anchorWidth,
+                               blocks = $view.find( "div" ),
+                               blockWidth = 0,
+                               index = 0,
+                               margin = self._marginWidth,
+                               inputBox = $view.find( ".ui-multibuttonentry-input" );
+
+                       if ( $view.width() === 0 ) {
+                               return ;
+                       }
+
+                       for ( index = 0; index < blocks.length; index += 1 ) {
+                               blockWidth = self._calcBlockWidth( blocks[index] );
+                               inputBoxWidth = inputBoxWidth - blockWidth;
+                               if ( inputBoxWidth <= 0 ) {
+                                       if ( inputBoxWidth + anchorWidth >= 0 ) {
+                                               inputBoxWidth = self._viewWidth - anchorWidth;
+                                       } else {
+                                               inputBoxWidth = self._viewWidth - blockWidth - anchorWidth;
+                                       }
+                               }
+                       }
+                       $( inputBox ).width( inputBoxWidth - margin - 1 );
+               },
+               _stringFormat : function ( expression ) {
+                       var pattern = null,
+                               message = expression,
+                               i = 0;
+                       for ( i = 1; i < arguments.length; i += 1 ) {
+                               pattern = "{" + ( i - 1 ) + "}";
+                               message = message.replace( pattern, arguments[i] );
+                       }
+                       return message;
+               },
+               _resizeBlock : function () {
+                       var self = this,
+                               $view = self.element,
+                               dataBlocks = $( ".ui-multibuttonentry-data" ),
+                               blocks = $view.find( "div" ),
+                               srcTexts = [],
+                               index = 0;
+
+                       $view.hide();
+                       for ( index = 0 ; index < dataBlocks.length ; index += 1 ) {
+                               srcTexts[index] = $( dataBlocks[index] ).val();
+                               self._addTextBlock( srcTexts[index] );
+                       }
+                       blocks.remove();
+                       $view.show();
+               },
+
+               //----------------------------------------------------//
+               //                                      Public Method                                   //
+               //----------------------------------------------------//
+               //
+               // Focus In Event
+               //
+               focusIn : function () {
+                       if ( this._focusStatus === "focusIn" ) {
+                               return;
+                       }
+
+                       var $view = this.element;
+
+                       $view.find( "label" ).show();
+                       $view.find( ".ui-multibuttonentry-desclabel" ).remove();
+                       $view.find( "div.ui-multibuttonentry-sblock" ).removeClass( "ui-multibuttonentry-sblock" ).addClass( "ui-multibuttonentry-block" );
+                       $view.find( "div" ).show();
+                       $view.find( ".ui-multibuttonentry-input" ).show();
+                       $view.find( "a" ).show();
+
+                       // change focus state.
+                       this._modifyInputBoxWidth();
+                       this._focusStatus = "focusIn";
+               },
+               focusOut : function () {
+                       if ( this._focusStatus === "focusOut" ) {
+                               return;
+                       }
+
+                       var self = this,
+                               $view = self.element,
+                               tempBlock = null,
+                               statement = "",
+                               index = 0,
+                               lastIndex = 10,
+                               label = $view.find( "label" ),
+                               more = $view.find( "span" ),
+                               blocks = $view.find( "div" ),
+                               currentWidth = $view.outerWidth( true ) - more.outerWidth( true ) - label.outerWidth( true ),
+                               textWidth = currentWidth;
+
+                       $view.find( ".ui-multibuttonentry-input" ).hide();
+                       $view.find( "a" ).hide();
+                       blocks.hide();
+
+                       // div button
+                       currentWidth = currentWidth - self._reservedWidth;
+                       for ( index = 0; index < blocks.length; index += 1 ) {
+                               currentWidth = currentWidth - $( blocks[index] ).outerWidth( true );
+                               statement += ", " + $( blocks[index] ).text();
+                               if ( currentWidth <= 0 ) {
+                                       statement = "," + $( blocks[0] ).text();
+                                       statement = self._stringFormat( self.options.descMessage, statement, blocks.length - 1 );
+                                       break;
+                               }
+                               lastIndex = statement.length;
+                       }
+                       tempBlock = $( document.createElement( 'input' ) );
+                       tempBlock.val( statement.substr( 1, statement.length ) );
+                       tempBlock.addClass( "ui-multibuttonentry-desclabel" ).addClass( "ui-multibuttonentry-desclabel" );
+                       tempBlock.width( textWidth - ( self._reservedWidth ) );
+                       tempBlock.attr( "disabled", true );
+                       $view.find( "label" ).after( tempBlock );
+                       // update foucs state
+                       this._focusStatus = "focusOut";
+               },
+               inputText : function ( message ) {
+                       var $view = this.element;
+
+                       if ( arguments.length === 0 ) {
+                               return $view.find( ".ui-multibuttonentry-input" ).val();
+                       }
+                       $view.find( ".ui-multibuttonentry-input" ).val( message );
+                       return message;
+               },
+               select : function ( index ) {
+                       var $view = this.element,
+                               lockBlock = null,
+                               blocks = null;
+
+                       if ( this._focusStatus === "focusOut" ) {
+                               return;
+                       }
+
+                       if ( arguments.length === 0 ) {
+                               // return a selected block.
+                               lockBlock = $view.find( "div.ui-multibuttonentry-sblock" );
+                               if ( lockBlock) {
+                                       return lockBlock.text();
+                               }
+                               return null;
+                       }
+                       // 1. unlock all blocks.
+                       this._unlockTextBlock();
+                       // 2. select pointed block.
+                       blocks = $view.find( "div" );
+                       if ( blocks.length > index ) {
+                               $( blocks[index] ).removeClass( "ui-multibuttonentry-block" ).addClass( "ui-multibuttonentry-sblock" );
+                               this._trigger( "select" );
+                       }
+                       return null;
+               },
+               add : function ( message, position ) {
+                       if ( this._focusStatus === "focusOut" ) {
+                               return;
+                       }
+
+                       this._addTextBlock( message, position );
+               },
+               remove : function ( position ) {
+                       var self = this,
+                               $view = this.element,
+                               blocks = $view.find( "div" ),
+                               index = 0;
+                       if ( this._focusStatus === "focusOut" ) {
+                               return;
+                       }
+
+                       if ( arguments.length === 0 ) {
+                               blocks.remove();
+                               this._trigger( "clear" );
+                       } else if ( typeof position == "number" ) {
+                               // remove selected button
+                               index = ( ( position < blocks.length ) ? position : ( blocks.length - 1 ) );
+                               $( blocks[index] ).remove();
+                               this._trigger( "remove" );
+                       }
+                       self._modifyInputBoxWidth();
+               },
+               length : function () {
+                       return this.element.find( "div" ).length;
+               },
+               refresh : function () {
+                       var self = this;
+                       self.element.hide();
+                       self.element.show();
+               },
+               destory : function () {
+                       var $view = this.element;
+
+                       $view.find( "label" ).remove();
+                       $view.find( "div" ).unbind( "vclick" ).remove();
+                       $view.find( "a" ).remove();
+                       $view.find( ".ui-multibuttonentry-input" ).unbind( "keydown" ).remove();
+
+                       this._trigger( "destory" );
+               }
+       });
+
+       $( document ).bind( "pagecreate create", function () {
+               $( ":jqmData(role='multibuttonentry')" ).multibuttonentry();
+       });
+
+       $( window ).bind( "resize", function () {
+               $( ":jqmData(role='multibuttonentry')" ).multibuttonentry( "refresh" );
+       });
+} ( jQuery, window, document ) );
diff --git a/src/widgets/multimediaview/js/jquery.mobile.tizen.multimediaview.js b/src/widgets/multimediaview/js/jquery.mobile.tizen.multimediaview.js
new file mode 100755 (executable)
index 0000000..68c93ad
--- /dev/null
@@ -0,0 +1,688 @@
+/*
+ * Authors: Yonghwi Park <yonghwi0324.park@samsung.com>
+ *              Wonseop Kim <wonseop.kim@samsung.com>
+ */
+
+/**
+ * MultiMediaView is a widget that provides an audio or a video content handling features.
+ * A multi-media content handled with this widget can be played with HTML5's <audio> or <video> tag.
+ * If a user wants to play a music file, he should use "<audio>" tag.
+ * And he should use "<video>" tag to play a video file.
+ *
+ * HTML Attributes:
+ *                     data-theme : Set a theme of widget.
+ *                             If this value is not defined, widget will use parent`s theme. (optional)
+ *                     data-controls : If this value is 'true', widget will use belonging controller.
+ *                             If this value is 'false', widget will use browser`s controller.
+ *                             Default value is 'true'.
+ *                     data-fullscreen : Set a status that fullscreen when inital start.
+ *                             Default value is 'false'.
+ *
+ * APIs:
+ *                     width( [number] )
+ *                                     : Get or set a widget of widget.
+ *                     height( [number] )
+ *                                     : Get or set a height of widget.
+ *                     size( number, number )
+ *                                     : Set a size of widget and resize a widget.
+ *                                      First argument is width and second argument is height.
+ *                     fullscreen( [boolean] )
+ *                                     : Set a status that fullscreen.
+ *
+ * Events:
+ *
+ *                     create :  triggered when a multimediaview is created.
+ *
+ * Examples:
+ *
+ *                     VIDEO :
+ *                             <video data-controls="true" style="width:100%;">
+ *                                     <source src="media/oceans-clip.mp4" type="video/mp4" />
+ *                                     Your browser does not support the video tag.
+ *                             </video>
+ *
+ *                     AUDIO :
+ *                             <audio data-controls="true" style="width:100%;">
+ *                                     <source src="media/Over the horizon.mp3" type="audio/mp3" />
+ *                                     Your browser does not support the audio tag.
+ *                             </audio>
+ *
+ */
+
+( function ( $, document, window, undefined ) {
+       $.widget( "tizen.multimediaview", $.mobile.widget, {
+               options : {
+                       theme : null,
+                       controls : true,
+                       fullscreen : false,
+                       initSelector : "video, audio"
+               },
+               _create : function () {
+                       var self = this,
+                               view = self.element,
+                               viewElement = view[0],
+                               option = self.options,
+                               role = "multimediaview",
+                               control = null;
+
+                       $.extend( this, {
+                               role : null,
+                               isControlHide : false,
+                               controlTimer : null,
+                               isVolumeHide : true,
+                               isVertical : true,
+                               backupView : null
+                       });
+
+                       self.role = role;
+                       view.addClass( "ui-multimediaview" );
+                       control = self._createControl();
+
+                       if ( view[0].nodeName === "AUDIO" ) {
+                               control.addClass( "ui-multimediaview-audio" );
+                       }
+
+                       control.hide();
+                       view.wrap( "<div class='ui-multimediaview-wrap'>" ).after( control );
+                       if ( option.controls ) {
+                               if ( view.attr("controls") ) {
+                                       view.removeAttr( "controls" );
+                               }
+                       }
+
+                       self._addEvent();
+
+                       $( document ).bind( "pagechange.multimediaview", function ( e ) {
+                               var $page = $( e.target );
+                               if ( $page.find( view ).length > 0 && viewElement.autoplay ) {
+                                       viewElement.play();
+                               }
+
+                               if ( option.controls ) {
+                                       control.show();
+                                       self._resize();
+                               }
+                       }).bind( "pagebeforechange.multimediaview", function ( e ) {
+                               if ( viewElement.played.length !== 0 ) {
+                                       viewElement.pause();
+                                       control.hide();
+                               }
+                       });
+                       $( window ).bind( "resize.multimediaview orientationchange.multimediaview", function ( e ) {
+                               if ( !option.controls ) {
+                                       return;
+                               }
+                               var $page = $( e.target ),
+                                       $scrollview = view.parents( ".ui-scrollview-clip" );
+
+                               $scrollview.each( function ( i ) {
+                                       if ( $.data( this, "scrollview" ) ) {
+                                               $( this ).scrollview( "scrollTo", 0, 0 );
+                                       }
+                               });
+
+                               // for maintaining page layout
+                               if ( !option.fullscreen ) {
+                                       $( ".ui-footer:visible" ).show();
+                               } else {
+                                       $( ".ui-footer" ).hide();
+                                       self._fitContentArea( $page );
+                               }
+
+                               self._resize();
+                       });
+               },
+               _resize : function () {
+                       var view = this.element,
+                               parent = view.parent(),
+                               control = parent.find( ".ui-multimediaview-control" ),
+                               viewWidth = 0,
+                               viewHeight = 0,
+                               viewOffset = null;
+
+                       this._resizeFullscreen( this.options.fullscreen );
+                       viewWidth = ( ( view[0].nodeName === "VIDEO" ) ? view.width() : parent.width() );
+                       viewHeight = ( ( view[0].nodeName === "VIDEO" ) ? view.height() : control.height() );
+                       viewOffset = view.offset();
+
+                       this._resizeControl( viewOffset, viewWidth, viewHeight );
+
+                       this._updateSeekBar();
+                       this._updateVolumeState();
+               },
+               _resizeControl : function ( offset, width, height ) {
+                       var self = this,
+                               view = self.element,
+                               viewElement = view[0],
+                               control = view.parent().find( ".ui-multimediaview-control" ),
+                               buttons = control.find( ".ui-button" ),
+                               playpauseButton = control.find( ".ui-playpausebutton" ),
+                               volumeControl = control.find( ".ui-volumecontrol" ),
+                               seekBar = control.find( ".ui-seekbar" ),
+                               durationLabel = control.find( ".ui-durationlabel" ),
+                               controlWidth = width,
+                               controlHeight = control.outerHeight( true ),
+                               availableWidth = 0,
+                               controlOffset = null;
+
+                       if ( control ) {
+                               if ( view[0].nodeName === "VIDEO" ) {
+                                       controlOffset = control.offset();
+                                       controlOffset.left = offset.left;
+                                       controlOffset.top = offset.top + height - controlHeight;
+                                       control.offset( controlOffset );
+                               }
+
+                               control.width( controlWidth );
+                       }
+
+                       if ( seekBar ) {
+                               availableWidth = control.width() - ( buttons.outerWidth( true ) * buttons.length );
+                               availableWidth -= ( parseInt( buttons.eq( 0 ).css( "margin-left" ), 10 ) + parseInt( buttons.eq( 0 ).css( "margin-right" ), 10 ) ) * buttons.length;
+                               if ( !self.isVolumeHide ) {
+                                       availableWidth -= volumeControl.outerWidth( true );
+                               }
+                               seekBar.width( availableWidth );
+                       }
+
+                       if ( durationLabel && !isNaN( viewElement.duration ) ) {
+                               durationLabel.find( "p" ).text( self._convertTimeFormat( viewElement.duration ) );
+                       }
+
+                       if ( viewElement.autoplay && viewElement.paused === false ) {
+                               playpauseButton.removeClass( "ui-play-icon" ).addClass( "ui-pause-icon" );
+                       }
+               },
+               _resizeFullscreen : function ( isFullscreen ) {
+                       var self = this,
+                               view = self.element,
+                               parent = view.parent(),
+                               control = view.parent().find( ".ui-multimediaview-control" ),
+                               playpauseButton = control.find( ".ui-playpausebutton" ),
+                               timestampLabel = control.find( ".ui-timestamplabel" ),
+                               seekBar = control.find( ".ui-seekbar" ),
+                               durationBar = seekBar.find( ".ui-duration" ),
+                               currenttimeBar = seekBar.find( ".ui-currenttime" ),
+                               docWidth = 0,
+                               docHeight = 0;
+
+                       if ( isFullscreen ) {
+                               if ( !self.backupView ) {
+                                       self.backupView = {
+                                               width : view[0].style.getPropertyValue( "width" ) || "",
+                                               height : view[0].style.getPropertyValue( "height" ) || "",
+                                               position : view.css( "position" ),
+                                               zindex : view.css( "z-index" )
+                                       };
+                               }
+                               docWidth = $( "body" )[0].clientWidth;
+                               docHeight = $( "body" )[0].clientHeight;
+
+                               view.width( docWidth ).height( docHeight - 1 );
+                               view.addClass( "ui-" + self.role + "-fullscreen" );
+                               view.offset( {
+                                       top : 0,
+                                       left : 0
+                               });
+                       } else {
+                               if ( !self.backupView ) {
+                                       return;
+                               }
+
+                               view.removeClass( "ui-" + self.role + "-fullscreen" );
+                               view.css( {
+                                       "width" : self.backupView.width,
+                                       "height" : self.backupView.height,
+                                       "position": self.backupView.position,
+                                       "z-index": self.backupView.zindex
+                               });
+                               self.backupView = null;
+                       }
+                       parent.show();
+               },
+               _addEvent : function () {
+                       var self = this,
+                               view = self.element,
+                               viewElement = view[0],
+                               control = view.parent().find( ".ui-multimediaview-control" ),
+                               playpauseButton = control.find( ".ui-playpausebutton" ),
+                               timestampLabel = control.find( ".ui-timestamplabel" ),
+                               durationLabel = control.find( ".ui-durationlabel" ),
+                               volumeButton = control.find( ".ui-volumebutton" ),
+                               volumeControl = control.find( ".ui-volumecontrol" ),
+                               volumeBar = volumeControl.find( ".ui-volumebar" ),
+                               volumeGuide = volumeControl.find( ".ui-guide" ),
+                               volumeHandle = volumeControl.find( ".ui-handler" ),
+                               fullscreenButton = control.find( ".ui-fullscreenbutton" ),
+                               seekBar = control.find( ".ui-seekbar" ),
+                               durationBar = seekBar.find( ".ui-duration" ),
+                               currenttimeBar = seekBar.find( ".ui-currenttime" );
+
+                       view.bind( "loadedmetadata.multimediaview", function ( e ) {
+                               if ( !isNaN( viewElement.duration ) ) {
+                                       durationLabel.find( "p" ).text( self._convertTimeFormat( viewElement.duration ) );
+                               }
+                               self._resize();
+                       }).bind( "timeupdate.multimediaview", function ( e ) {
+                               self._updateSeekBar();
+                       }).bind( "play.multimediaview", function ( e ) {
+                               playpauseButton.removeClass( "ui-play-icon" ).addClass( "ui-pause-icon" );
+                       }).bind( "pause.multimediaview", function ( e ) {
+                               playpauseButton.removeClass( "ui-pause-icon" ).addClass( "ui-play-icon" );
+                       }).bind( "ended.multimediaview", function ( e ) {
+                               if ( typeof viewElement.loop == "undefined" || viewElement.loop === "" ) {
+                                       self.stop();
+                               }
+                       }).bind( "volumechange.multimediaview", function ( e ) {
+                               if ( viewElement.volume < 0.1 ) {
+                                       viewElement.muted = true;
+                                       volumeButton.removeClass( "ui-volume-icon" ).addClass( "ui-mute-icon" );
+                               } else {
+                                       viewElement.muted = false;
+                                       volumeButton.removeClass( "ui-mute-icon" ).addClass( "ui-volume-icon" );
+                               }
+
+                               if ( !self.isVolumeHide ) {
+                                       self._updateVolumeState();
+                               }
+                       }).bind( "durationchange.multimediaview", function ( e ) {
+                               if ( !isNaN( viewElement.duration ) ) {
+                                       durationLabel.find( "p" ).text( self._convertTimeFormat( viewElement.duration ) );
+                               }
+                               self._resize();
+                       }).bind( "error.multimediaview", function ( e ) {
+                               switch ( e.target.error.code ) {
+                               case e.target.error.MEDIA_ERR_ABORTED :
+                                       window.alert( 'You aborted the video playback.' );
+                                       break;
+                               case e.target.error.MEDIA_ERR_NETWORK :
+                                       window.alert( 'A network error caused the video download to fail part-way.' );
+                                       break;
+                               case e.target.error.MEDIA_ERR_DECODE :
+                                       window.alert( 'The video playback was aborted due to a corruption problem or because the video used features your browser did not support.' );
+                                       break;
+                               case e.target.error.MEDIA_ERR_SRC_NOT_SUPPORTED :
+                                       window.alert( 'The video could not be loaded, either because the server or network failed or because the format is not supported.' );
+                                       break;
+                               default :
+                                       window.alert( 'An unknown error occurred.' );
+                                       break;
+                               }
+                       }).bind( "vclick.multimediaview", function ( e ) {
+                               if ( !self.options.controls ) {
+                                       return;
+                               }
+
+                               control.fadeToggle( "fast", function () {
+                                       var offset = control.offset();
+                                       self.isControlHide = !self.isControlHide;
+                                       if ( self.options.mediatype == "video" ) {
+                                               self._startTimer();
+                                       }
+                               });
+                               self._resize();
+                       });
+
+                       playpauseButton.bind( "vclick.multimediaview", function () {
+                               self._endTimer();
+
+                               if ( viewElement.paused ) {
+                                       viewElement.play();
+                               } else {
+                                       viewElement.pause();
+                               }
+
+                               if ( self.options.mediatype == "video" ) {
+                                       self._startTimer();
+                               }
+                       });
+
+                       fullscreenButton.bind( "vclick.multimediaview", function () {
+                               self.fullscreen( !self.options.fullscreen );
+                               control.fadeIn( "fast" );
+                               self._endTimer();
+                       });
+
+                       seekBar.bind( "vmousedown.multimediaview", function ( e ) {
+                               var x = e.clientX,
+                                       duration = viewElement.duration,
+                                       durationOffset = durationBar.offset(),
+                                       durationWidth = durationBar.width(),
+                                       timerate = ( x - durationOffset.left ) / durationWidth,
+                                       time = duration * timerate;
+
+                               viewElement.currentTime = time;
+
+                               self._endTimer();
+
+                               e.preventDefault();
+                               e.stopPropagation();
+
+                               $( document ).bind( "vmousemove.multimediaview", function ( e ) {
+                                       var x = e.clientX,
+                                               timerate = ( x - durationOffset.left ) / durationWidth;
+
+                                       viewElement.currentTime = duration * timerate;
+
+                                       e.preventDefault();
+                                       e.stopPropagation();
+                               }).bind( "vmouseup.multimediaview", function () {
+                                       $( document ).unbind( "vmousemove.multimediaview vmouseup.multimediaview" );
+                                       if ( viewElement.paused ) {
+                                               viewElement.pause();
+                                       } else {
+                                               viewElement.play();
+                                       }
+                               });
+                       });
+
+                       volumeButton.bind( "vclick.multimediaview", function () {
+                               if ( self.isVolumeHide ) {
+                                       var view = self.element,
+                                               volume = viewElement.volume;
+
+                                       self.isVolumeHide = false;
+                                       self._resize();
+                                       volumeControl.fadeIn( "fast" );
+                                       self._updateVolumeState();
+                                       self._updateSeekBar();
+                               } else {
+                                       self.isVolumeHide = true;
+                                       volumeControl.fadeOut( "fast", function () {
+                                               self._resize();
+                                       });
+                                       self._updateSeekBar();
+                               }
+                       });
+
+                       volumeBar.bind( "vmousedown.multimediaview", function ( e ) {
+                               var baseX = e.clientX,
+                                       volumeGuideLeft = volumeGuide.offset().left,
+                                       volumeGuideWidth = volumeGuide.width(),
+                                       volumeBase = volumeGuideLeft + volumeGuideWidth,
+                                       handlerOffset = volumeHandle.offset(),
+                                       volumerate = ( baseX - volumeGuideLeft ) / volumeGuideWidth,
+                                       currentVolume = ( baseX - volumeGuideLeft ) / volumeGuideWidth;
+
+                               self._endTimer();
+                               self._setVolume( currentVolume.toFixed( 2 ) );
+
+                               e.preventDefault();
+                               e.stopPropagation();
+
+                               $( document ).bind( "vmousemove.multimediaview", function ( e ) {
+                                       var currentX = e.clientX,
+                                               currentVolume = ( currentX - volumeGuideLeft ) / volumeGuideWidth;
+
+                                       self._setVolume( currentVolume.toFixed( 2 ) );
+
+                                       e.preventDefault();
+                                       e.stopPropagation();
+                               }).bind( "vmouseup.multimediaview", function () {
+                                       $( document ).unbind( "vmousemove.multimediaview vmouseup.multimediaview" );
+
+                                       if ( self.options.mediatype == "video" ) {
+                                               self._startTimer();
+                                       }
+                               });
+                       });
+               },
+               _removeEvent : function () {
+                       var self = this,
+                               view = self.element,
+                               control = view.parent().find( ".ui-multimediaview-control" ),
+                               playpauseButton = control.find( ".ui-playpausebutton" ),
+                               fullscreenButton = control.find( ".ui-fullscreenbutton" ),
+                               seekBar = control.find( ".ui-seekbar" ),
+                               volumeControl = control.find( ".ui-volumecontrol" ),
+                               volumeBar = volumeControl.find( ".ui-volumebar" ),
+                               volumeHandle = volumeControl.find( ".ui-handler" );
+
+                       view.unbind( ".multimediaview" );
+                       playpauseButton.unbind( ".multimediaview" );
+                       fullscreenButton.unbind( ".multimediaview" );
+                       seekBar.unbind( ".multimediaview" );
+                       volumeBar.unbind( ".multimediaview" );
+                       volumeHandle.unbind( ".multimediaview" );
+               },
+               _createControl : function () {
+                       var self = this,
+                               view = self.element,
+                               control = $( "<span></span>" ),
+                               playpauseButton = $( "<span></span>" ),
+                               seekBar = $( "<span></span>" ),
+                               timestampLabel = $( "<span><p>00:00:00</p></span>" ),
+                               durationLabel = $( "<span><p>00:00:00</p></span>" ),
+                               volumeButton = $( "<span></span>" ),
+                               volumeControl = $( "<span></span>" ),
+                               volumeBar = $( "<div></div>" ),
+                               volumeGuide = $( "<span></span>" ),
+                               volumeValue = $( "<span></span>" ),
+                               volumeHandle = $( "<span></span>" ),
+                               fullscreenButton = $( "<span></span>" ),
+                               durationBar = $( "<span></span>" ),
+                               currenttimeBar = $( "<span></span>" );
+
+                       control.addClass( "ui-" + self.role + "-control" );
+                       playpauseButton.addClass( "ui-playpausebutton ui-button" );
+                       seekBar.addClass( "ui-seekbar" );
+                       timestampLabel.addClass( "ui-timestamplabel" );
+                       durationLabel.addClass( "ui-durationlabel" );
+                       volumeButton.addClass( "ui-volumebutton ui-button" );
+                       fullscreenButton.addClass( "ui-fullscreenbutton ui-button" );
+                       durationBar.addClass( "ui-duration" );
+                       currenttimeBar.addClass( "ui-currenttime" );
+                       volumeControl.addClass( "ui-volumecontrol" );
+                       volumeBar.addClass( "ui-volumebar" );
+                       volumeGuide.addClass( "ui-guide" );
+                       volumeValue.addClass( "ui-value" );
+                       volumeHandle.addClass( "ui-handler" );
+
+                       seekBar.append( durationBar ).append( currenttimeBar ).append( durationLabel ).append( timestampLabel );
+
+                       playpauseButton.addClass( "ui-play-icon" );
+                       if ( view[0].muted ) {
+                               $( volumeButton ).addClass( "ui-mute-icon" );
+                       } else {
+                               $( volumeButton ).addClass( "ui-volume-icon" );
+                       }
+
+                       volumeBar.append( volumeGuide ).append( volumeValue ).append( volumeHandle );
+                       volumeControl.append( volumeBar );
+
+                       control.append( playpauseButton ).append( seekBar ).append( volumeControl ).append( volumeButton );
+
+                       if ( self.element[0].nodeName === "VIDEO" ) {
+                               $( fullscreenButton ).addClass( "ui-fullscreen-on" );
+                               control.append( fullscreenButton );
+                       }
+                       volumeControl.hide();
+
+                       return control;
+               },
+               _startTimer : function ( duration ) {
+                       this._endTimer();
+
+                       if ( !duration ) {
+                               duration = 3000;
+                       }
+
+                       var self = this,
+                               view = self.element,
+                               control = view.parent().find( ".ui-multimediaview-control" ),
+                               volumeControl = control.find( ".ui-volumecontrol" );
+
+                       self.controlTimer = setTimeout( function () {
+                               self.isVolumeHide = true;
+                               self.isControlHide = true;
+                               self.controlTimer = null;
+                               volumeControl.hide();
+                               control.fadeOut( "fast" );
+                       }, duration );
+               },
+               _endTimer : function () {
+                       if ( this.controlTimer ) {
+                               clearTimeout( this.controlTimer );
+                               this.controlTimer = null;
+                       }
+               },
+               _convertTimeFormat : function ( systime ) {
+                       var ss = parseInt( systime % 60, 10 ).toString(),
+                               mm = parseInt( ( systime / 60 ) % 60, 10 ).toString(),
+                               hh = parseInt( systime / 3600, 10 ).toString(),
+                               time =  ( ( hh.length < 2  ) ? "0" + hh : hh ) + ":" +
+                                               ( ( mm.length < 2  ) ? "0" + mm : mm ) + ":" +
+                                               ( ( ss.length < 2  ) ? "0" + ss : ss );
+
+                       return time;
+               },
+               _updateSeekBar : function ( currenttime ) {
+                       var self = this,
+                               view = self.element,
+                               duration = view[0].duration,
+                               control = view.parent().find( ".ui-multimediaview-control" ),
+                               seekBar = control.find(  ".ui-seekbar"  ),
+                               durationBar = seekBar.find( ".ui-duration" ),
+                               currenttimeBar = seekBar.find( ".ui-currenttime" ),
+                               timestampLabel = control.find( ".ui-timestamplabel" ),
+                               durationOffset = durationBar.offset(),
+                               durationWidth = durationBar.width(),
+                               durationHeight = durationBar.height(),
+                               timebarWidth = 0;
+
+                       if ( typeof currenttime == "undefined" ) {
+                               currenttime = view[0].currentTime;
+                       }
+                       timebarWidth = parseInt( currenttime / duration * durationWidth, 10 );
+                       durationBar.offset( durationOffset );
+                       currenttimeBar.offset( durationOffset ).width( timebarWidth );
+                       timestampLabel.find( "p" ).text( self._convertTimeFormat( currenttime ) );
+               },
+               _updateVolumeState : function () {
+                       var self = this,
+                               view = self.element,
+                               control = view.parent().find( ".ui-multimediaview-control" ),
+                               volumeControl = control.find( ".ui-volumecontrol" ),
+                               volumeButton = control.find( ".ui-volumebutton" ),
+                               volumeBar = volumeControl.find( ".ui-volumebar" ),
+                               volumeGuide = volumeControl.find( ".ui-guide" ),
+                               volumeValue = volumeControl.find( ".ui-value" ),
+                               volumeHandle = volumeControl.find( ".ui-handler" ),
+                               handlerWidth = volumeHandle.width(),
+                               handlerHeight = volumeHandle.height(),
+                               volumeGuideHeight = volumeGuide.height(),
+                               volumeGuideWidth = volumeGuide.width(),
+                               volumeGuideTop = 0,
+                               volumeGuideLeft = 0,
+                               volumeBase = 0,
+                               handlerOffset = null,
+                               volume = view[0].volume;
+
+                       volumeGuideTop = parseInt( volumeGuide.offset().top, 10 );
+                       volumeGuideLeft = parseInt( volumeGuide.offset().left, 10 );
+                       volumeBase = volumeGuideLeft;
+                       handlerOffset = volumeHandle.offset();
+                       handlerOffset.top = volumeGuideTop - parseInt( ( handlerHeight - volumeGuideHeight ) / 2, 10 );
+                       handlerOffset.left = volumeBase + parseInt( volumeGuideWidth * volume, 10 ) - parseInt( handlerWidth / 2, 10 );
+                       volumeHandle.offset( handlerOffset );
+                       volumeValue.width( parseInt( volumeGuideWidth * ( volume ), 10 ) );
+               },
+               _setVolume : function ( value ) {
+                       var viewElement = this.element[0];
+
+                       if ( value < 0.0 || value > 1.0 ) {
+                               return;
+                       }
+
+                       viewElement.volume = value;
+               },
+               _fitContentArea: function ( page, parent ) {
+                       if ( typeof parent == "undefined" ) {
+                               parent = window;
+                       }
+
+                       var $page = $( page ),
+                               $content = $( ".ui-content:visible:first" ),
+                               hh = $( ".ui-header:visible" ).outerHeight() || 0,
+                               fh = $( ".ui-footer:visible" ).outerHeight() || 0,
+                               pt = parseFloat( $content.css( "padding-top" ) ),
+                               pb = parseFloat( $content.css( "padding-bottom" ) ),
+                               wh = ( ( parent === window ) ? window.innerHeight : $( parent ).height() ),
+                               height = wh - ( hh + fh ) - ( pt + pb );
+
+                       $content.offset( {
+                               top : ( hh + pt )
+                       }).height( height );
+               },
+               width : function ( value ) {
+                       var self = this,
+                               args = arguments,
+                               view = self.element;
+
+                       if ( args.length === 0 ) {
+                               return view.width();
+                       }
+                       if ( args.length === 1 ) {
+                               view.width( value );
+                               self._resize();
+                       }
+               },
+               height : function ( value ) {
+                       var self = this,
+                               view = self.element,
+                               args = arguments;
+
+                       if ( args.length === 0 ) {
+                               return view.height();
+                       }
+                       if ( args.length === 1 ) {
+                               view.height( value );
+                               self._resize();
+                       }
+               },
+               size : function ( width, height ) {
+                       var self = this,
+                               view = self.element;
+
+                       view.width( width ).height( height );
+                       self._resize();
+               },
+               fullscreen : function ( value ) {
+                       var self = this,
+                               view = self.element,
+                               control = view.parent().find( ".ui-multimediaview-control" ),
+                               fullscreenButton = control.find( ".ui-fullscreenbutton" ),
+                               args = arguments,
+                               option = self.options,
+                               currentPage = $( ".ui-page-active" );
+
+                       if ( args.length === 0 ) {
+                               return option.fullscreen;
+                       }
+                       if ( args.length === 1 ) {
+                               view.parents( ".ui-content" ).scrollview( "scrollTo", 0, 0 );
+
+                               this.options.fullscreen = value;
+                               if ( value ) {
+                                       currentPage.children( ".ui-header" ).hide();
+                                       currentPage.children( ".ui-footer" ).hide();
+                                       this._fitContentArea( currentPage );
+                                       fullscreenButton.removeClass( "ui-fullscreen-on" ).addClass( "ui-fullscreen-off" );
+                               } else {
+                                       currentPage.children( ".ui-header" ).show();
+                                       currentPage.children( ".ui-footer" ).show();
+                                       this._fitContentArea( currentPage );
+                                       fullscreenButton.removeClass( "ui-fullscreen-off" ).addClass( "ui-fullscreen-on" );
+                               }
+                               self._resize();
+                       }
+               },
+               refresh : function () {
+                       this._resize();
+               }
+       });
+
+       $( document ).bind( "pagecreate create", function ( e ) {
+               $.tizen.multimediaview.prototype.enhanceWithin( e.target );
+       });
+} ( jQuery, document, window ) );
index 502485c..94c4ef9 100644 (file)
@@ -1,6 +1,27 @@
-/*
-       Author: Minkyu Kang <mk7.kang@samsung.com>
-*/
+/* ***************************************************************************
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ *
+ *     Author: Minkyu Kang <mk7.kang@samsung.com>
+ */
 
 /*
  * nocontents widget
                                $content = $page.children('.ui-content'),
                                $header = $page.children('.ui-header'),
                                $footer = $page.children('.ui-footer'),
-                               content_h = 0,
                                header_h = $header.outerHeight() || 0,
                                footer_h = $footer.outerHeight() || 0,
                                padding_t = parseFloat( $content.css('padding-top') ) || 0,
-                               padding_b = parseFloat( $content.css('padding-bottom') ) || 0;
-
-                       content_h = window.innerHeight - header_h - footer_h -
-                                       (padding_t + padding_b) * 2;
-
-                       var container_h = this.container.height();
+                               padding_b = parseFloat( $content.css('padding-bottom') ) || 0,
+                               content_h = $(window).height() - header_h - footer_h -
+                                       (padding_t + padding_b) * 2,
+                               container_h = this.container.height();
 
                        return ( content_h < container_h ? container_h : content_h );
                },
@@ -73,6 +91,7 @@
                                content_gap = 46,
                                text0_height = this.text0_bg.height() || 0,
                                text1_height = this.text1_bg.height() || 0,
+                               text_top = 0,
                                icon_top = (content_height -
                                        (icon_height + content_gap +
                                         text0_height + text1_height)) / 2;
                        this.container.height( content_height );
 
                        this.icon_img.css( 'left',
-                               (window.innerWidth - icon_width) / 2 );
+                               ($(window).width() - icon_width) / 2 );
                        this.icon_img.css( 'top', icon_top );
 
-                       var text_top = icon_top + icon_height + content_gap;
+                       text_top = icon_top + icon_height + content_gap;
 
                        this.text0_bg.css( 'top', text_top );
                        this.text1_bg.css( 'top', text_top + text0_height );
                },
 
                _create: function () {
-                       var icon_type = $( this.element ).attr('data-type');
+                       var icon_type = $( this.element ).jqmData('type'),
+                               text = new Array(2);
 
                        if ( icon_type === undefined ||
-                               (icon_type !== "picture" &&
-                                icon_type !== "multimedia" &&
-                                icon_type !== "text") ) {
+                                       (icon_type !== "picture" &&
+                                        icon_type !== "multimedia" &&
+                                        icon_type !== "text") ) {
                                icon_type = "unnamed";
                        }
 
-                       var text = new Array(2);
-
-                       text[0] = $( this.element ).attr('data-text1');
-                       text[1] = $( this.element ).attr('data-text2');
+                       text[0] = $( this.element ).jqmData('text1');
+                       text[1] = $( this.element ).jqmData('text2');
 
                        if ( text[0] === undefined ) {
                                text[0] = "";
index 5ae3773..e975016 100644 (file)
@@ -1,6 +1,27 @@
-/*
-       Author: Minkyu Kang <mk7.kang@samsung.com>
-*/
+/* ***************************************************************************
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ *
+ *     Author: Minkyu Kang <mk7.kang@samsung.com>
+ */
 
 /*
  * Notification widget
                _get_container: function () {
                        if ( this.type === 'ticker' ) {
                                return $( this.element ).find(".ui-ticker");
-                       } else {
-                               return $( this.element ).find(".ui-smallpopup");
                        }
+
+                       return $( this.element ).find(".ui-smallpopup");
                },
 
                _add_event: function () {
                                container = this._get_container();
 
                        if ( this.type === 'ticker' ) {
-                               var btn_container = container.find(".ui-ticker-btn");
-
-                               btn_container.append( this.btn );
+                               container.find(".ui-ticker-btn").append( this.btn );
 
                                this.btn.bind( "vmouseup", function () {
                                        self.hide();
                        clearInterval( this.interval );
                },
 
-               _get_position: function ( height ) {
-                       var $page = $('.ui-page'),
+               _set_position: function () {
+                       var container = this._get_container(),
+                               container_h = parseFloat( container.css('height') ),
+                               $page = $('.ui-page'),
                                $footer = $page.children('.ui-footer'),
                                footer_h = $footer.outerHeight() || 0,
-                               position = window.innerHeight - height - footer_h;
+                               position = $(window).height() - container_h - footer_h;
 
-                       return position;
+                       container.css( 'top', position );
                },
 
                _update: function () {
                                this.html.detach();
                        }
 
-                       text[0] = $(this.element).attr('data-text1');
-                       text[1] = $(this.element).attr('data-text2');
-                       this.param = $(this.element).attr('data-param');
-                       this.seconds = $(this.element).attr('data-interval');
-                       this.type = $(this.element).attr('data-type') || 'popup';
+                       text[0] = $(this.element).jqmData('text1');
+                       text[1] = $(this.element).jqmData('text2');
+                       this.param = $(this.element).jqmData('param');
+                       this.seconds = $(this.element).jqmData('interval');
+                       this.type = $(this.element).jqmData('type') || 'popup';
 
                        if ( this.type === 'ticker' ) {
                                this.html = $('<div class="ui-ticker">' +
                                                text[1] + '</div>' +
                                                '<div class="ui-ticker-body"></div>' +
                                                '<div class="ui-ticker-btn"></div>' +
-                                               '</div>' +
                                                '</div>');
 
                                $( this.element ).append( this.html );
 
                                $( this.element ).append( this.html );
 
-                               var container = $( this.element ).find(".ui-smallpopup"),
-                                       container_h = parseFloat( container.css('height') );
-
-                               container.css( 'top', this._get_position(container_h) );
+                               this._set_position();
                        }
                },
 
                _create: function () {
                        this.btn = $("<a href='#' class='ui-input-cancel' title='close' data-theme='s'>Close</a>")
-                               .tap( function( event ) {
+                               .tap( function ( event ) {
                                        event.preventDefault();
                                })
                                .buttonMarkup({
index c79dcb1..659bbe9 100755 (executable)
@@ -5,7 +5,8 @@
  * http://www.opensource.org/licenses/mit-license.php)
  *
  * ***************************************************************************
- * Copyright (C) 2011 by Intel Corporation Ltd.
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2011 by Intel Corporation Ltd.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
 //
 
 
-(function($, undefined) {
-$.widget("tizen.optionheader", $.mobile.widget, {
-//$.widget("todons.optionheader", $.todons.widgetex, {
-       options: {
-               initSelector: ":jqmData(role='optionheader')",
-               showIndicator: true,
-               theme: 's',
-               startCollapsed: false,
-               expandable: true,
-               duration: 0.25,
-               collapseOnInit : true
-       },
-       collapsedHeight: '5px',
-
-       _create: function () {
-               var options,
-                       theme,
-                       self = this,
-                       elementHeight = 106,
-                       parentPage,
-                       dataOptions = this.element.jqmData( 'options' );
-
-               // parse data-options
-               $.extend( this.options, dataOptions );
-
-               this.isCollapsed = this.options.collapseOnInit;
-               this.expandedHeight = null;
-
-               // parse data-theme and reset options.theme if it's present
-               theme = this.element.jqmData( 'theme' ) || this.options.theme;
-               this.options.theme = theme;
-
-               this.element.closest( ':jqmData(role="header")' ).addClass( "ui-option-header-resizing" );
-
-               // set up the click handler; it's done here so it can
-               // easily be removed, as there should only be one instance
-               // of the handler function for each class instance
-               this.clickHandler = function () {
-                       self.toggle();
-               };
-
-               if( this.element.height() < elementHeight ){
-                       this.element.css( "height", elementHeight );
-               }
+(function ($, undefined) {
+       $.widget("tizen.optionheader", $.mobile.widget, {
+               options: {
+                       initSelector: ":jqmData(role='optionheader')",
+                       showIndicator: true,
+                       theme: 's',
+                       startCollapsed: false,
+                       expandable: true,
+                       duration: 0.25,
+                       collapseOnInit : true,
+                       default_font_size : $('html').css('font-size')
+               },
+               collapsedHeight: '5px',
+
+               _create: function () {
+                       var options,
+                               theme,
+                               self = this,
+                               elementHeight = 106,
+                               parentPage,
+                               dataOptions = this.element.jqmData( 'options' ),
+                               page = this.element.closest( ':jqmData(role="page")' );
+                       // parse data-options
+                       $.extend( this.options, dataOptions );
+
+                       this.isCollapsed = this.options.collapseOnInit;
+                       this.expandedHeight = null;
+
+                       // parse data-theme and reset options.theme if it's present
+                       theme = this.element.jqmData( 'theme' ) || this.options.theme;
+                       this.options.theme = theme;
+
+                       this.element.closest( ':jqmData(role="header")' ).addClass( "ui-option-header-resizing" );
+
+                       // set up the click handler; it's done here so it can
+                       // easily be removed, as there should only be one instance
+                       // of the handler function for each class instance
+                       this.clickHandler = function () {
+                               self.toggle();
+                       };
 
-               // get the element's dimensions
-               // and to set its initial collapse state;
-               // either do it now (if the page is visible already)
-               // or on pageshow
-               page = this.element.closest( ':jqmData(role="page")' );
+                       /* Apply REM scaling */
+                       elementHeight = elementHeight / ( 36 / parseInt(this.option.default_font_size) );
 
-               if ( page.is(":visible") ){
-                       self.refresh();
-                       self._realize();
-               } else {
-                       self.refresh();
+                       if ( this.element.height() < elementHeight ) {
+                               this.element.css( "height", elementHeight );
+                       }
 
-               page.bind( "pagebeforeshow", function() {
-                       self._setArrowLeft();
-                       self._realize();
-                       });
-               }
-               self._setArrowLeft();
-//        this.refresh();
-       },
+                       // get the element's dimensions
+                       // and to set its initial collapse state;
+                       // either do it now (if the page is visible already)
+                       // or on pageshow
 
-       _realize: function () {
-               if ( !this.expandedHeight ) {
-                       this.expandedHeight = this.element.height();
-               }
+                       if ( page.is(":visible") ) {
+                               self.refresh();
+                               self._realize();
+                       } else {
+                               self.refresh();
 
-               if ( this.isCollapsed ) {
-//        if (this.options.startCollapsed) {
-                       this.collapse( {duration: 0} );
-               }
-       },
+                               page.bind( "pagebeforeshow", function () {
+                                       self._setArrowLeft();
+                                       self._realize();
+                               });
+                       }
+                       self._setArrowLeft();
+       //        this.refresh();
+               },
 
-       _setArrowLeft: function () {
-               var matchingBtn = $( this.element ).jqmData( "for" ),
-                       arrowCenter = 14,
-                       btn2Position = 10,
-                       btn3Position = 144;
+               _realize: function () {
+                       if ( !this.expandedHeight ) {
+                               this.expandedHeight = this.element.height();
+                       }
+
+                       if ( this.isCollapsed ) {
+       //        if (this.options.startCollapsed) {
+                               this.collapse( {duration: 0} );
+                       }
+               },
+
+               _setArrowLeft: function () {
+                       var matchingBtn = $( this.element ).jqmData( "for" ),
+                               arrowCenter = 14,
+                               btn2Position = 10,
+                               btn3Position = 144,
+                               matchBtn = $( this.element ).parents( ".ui-page" ).find( "#" + matchingBtn ),
+                               buttonRight = matchBtn.nextAll().is( "a" ) ? btn3Position : btn2Position;
+                               /* Apply REM scaling */
+                               scaleFactor = ( 36 / parseInt(this.option.default_font_size) );
 
-               if( $(this.element).parents(".ui-page").find("#"+matchingBtn).length != 0 ){
-                       matchBtn = $( this.element ).parents( ".ui-page" ).find( "#" + matchingBtn );
+                       if ( $(this.element).parents(".ui-page").find( "#" + matchingBtn ).length != 0 ) {
 
+                               if ( this.options.expandable ) {
+                                       matchBtn.bind( 'vclick', this.clickHandler );
+                               } else {
+                                       matchBtn.unbind( 'vclick', this.clickHandler );
+                               }
 
-                       if ( this.options.expandable ) {
-                               matchBtn.bind( 'vclick', this.clickHandler );
+                               // decide arrow Button position
+                               if ( matchBtn.css( "left" ) && matchBtn.css( "left" ) != "auto" ) {
+                                       $( ".ui-triangle-image" ).css( "left", matchBtn.width() / 2 + parseInt(matchBtn.css( "left" ), 10) - ( arrowCenter / scaleFactor ) + "px" );
+                               } else if ( matchBtn.css("right") ) {
+                                       $( ".ui-triangle-image" ).css( "left", document.documentElement.clientWidth - matchBtn.width() / 2 - ( ( buttonRight - arrowCenter ) / scaleFactor ) + "px" );
+                               }
                        } else {
-                               matchBtn.unbind( 'vclick', this.clickHandler );
-                       }
-
-                       // decide arrow Button position
-                       if( matchBtn.css( "left" ) && matchBtn.css( "left" ) != "auto" ){
-                               $( ".ui-triangle-image" ).css( "left", matchBtn.width()/2 + parseInt(matchBtn.css("left")) - arrowCenter + "px" );
-                       } else if( matchBtn.css("right") ){
-                               buttonRight = matchBtn.nextAll().is( "a" ) ? btn3Position : btn2Position;
-                               $( ".ui-triangle-image" ).css( "left", document.documentElement.clientWidth - matchBtn.width()/2 - buttonRight - arrowCenter + "px" );
+                               $( ".ui-triangle-image" ).css( "left", document.documentElement.clientWidth / 2 - ( arrowCenter / scaleFactor ) + "px" );
                        }
-               } else {
-                       $( ".ui-triangle-image" ).css( "left", document.documentElement.clientWidth/2 - arrowCenter + "px" );
-               }
-       },
-       // Draw the option header, according to current options
-       refresh: function () {
-               var el = this.element,
-                       arrow = $( '<div class="ui-option-header-triangle-arrow"></div>' ),
-                       optionHeaderClass = 'ui-option-header',
-                       self = this,
-                       gridRowSelector = '.ui-grid-a,.ui-grid-b,.ui-grid-c,.ui-grid-d,.ui-grid-e',
-                       theme = this.options.theme,
-                       numRows,
-                       rowsClass,
-                       themeClass;
-
-               var $this = $( this ),
-                       o = $.extend({
-                               grid: null
-                       }),
-                       $kids = el.find( "div" ).eq( 0 ).children().children(),
-                       gridCols = {solo:1, a:2, b:3, c:4, d:5},
-                       grid = o.grid,
-                       iterator;
-
-               if ( !grid ) {
-                       if ( $kids.length <= 5 ) {
-                               for ( var letter in gridCols ) {
-                                       if ( gridCols[ letter ] === $kids.length ) {
-                                               grid = letter;
+               },
+               // Draw the option header, according to current options
+               refresh: function () {
+                       var el = this.element,
+                               arrow = $( '<div class="ui-option-header-triangle-arrow"></div>' ),
+                               optionHeaderClass = 'ui-option-header',
+                               gridRowSelector = '.ui-grid-a,.ui-grid-b,.ui-grid-c,.ui-grid-d,.ui-grid-e',
+                               theme = this.options.theme,
+                               numRows,
+                               rowsClass,
+                               themeClass,
+                               klass,
+                               o = $.extend( {grid: null} ),
+                               $kids = el.find( "div" ).eq( 0 ).children().children(),
+                               letter,
+                               gridCols = {solo: 1, a: 2, b: 3, c: 4, d: 5},
+                               grid = o.grid;
+
+                       if ( !grid ) {
+                               if ( $kids.length <= 5 ) {
+                                       for ( letter in gridCols ) {
+                                               if ( gridCols[ letter ] === $kids.length ) {
+                                                       grid = letter;
+                                               }
                                        }
+                                       numRows = $kids.length / gridCols[grid];
+                               } else {
+                                       numRows = 2;
                                }
-                               numRows = $kids.length / gridCols[grid];
-                       } else {
-                               numRows = 2;
                        }
-               }
 
-        // count ui-grid-* elements to get number of rows
-//        numRows = el.find(gridRowSelector).length;
-
-        // ...at least one row
-//        numRows = Math.max(1, numRows);
-
-        // add classes to outer div:
-        //   ui-option-header-N-row, where N = options.rows
-        //   ui-bar-X, where X = options.theme (defaults to 'c')
-        //   ui-option-header
-               rowsClass = 'ui-option-header-' + numRows + '-row';
-               themeClass = 'ui-body-' + this.options.theme;
-
-               el.removeClass( rowsClass ).addClass( rowsClass );
-               el.removeClass( themeClass ).addClass( themeClass );
-               el.removeClass( optionHeaderClass ).addClass( optionHeaderClass );
-
-               // remove any arrow currently visible
-               el.prev( '.ui-option-header-triangle-arrow' ).remove();
-//        el.prev('.ui-triangle-container').remove();
-
-               // if there are elements inside the option header
-               // and this.options.showIndicator,
-               // insert a triangle arrow as the first element inside the
-               // optionheader div to show the header has hidden content
-               if( this.options.showIndicator ) {
-                       el.before( arrow );
-                       arrow.append("<div class='ui-triangle-image'></div>");
-//            arrow.triangle({"color": el.css('background-color'), offset: "50%"});
-               }
-
-        // if expandable, bind clicks to the toggle() method
-               if( this.options.expandable ) {
-//            el.unbind('vclick', this.clickHandler).bind('vclick', this.clickHandler);
-//            arrow.unbind('vclick', this.clickHandler).bind('vclick', this.clickHandler);
-                       el.bind( 'vclick', this.clickHandler );
-                       arrow.bind( 'vclick', this.clickHandler );
-
-               } else {
-                       el.unbind( 'vclick', this.clickHandler );
-                       arrow.unbind( 'vclick', this.clickHandler );
-               }
-
-               // for each ui-grid-a element, add a class ui-option-header-row-M
-               // to it, where M is the xpath position() of the div
-/*        el.find(gridRowSelector).each(function (index) {
-            var klass = 'ui-option-header-row-' + (index + 1);
-            $(this).removeClass(klass).addClass(klass);
-        });*/
-               var klass = 'ui-option-header-row-' + ( numRows );
-               el.find( "div" ).eq( 0 ).removeClass( klass ).addClass( klass );
-
-               // redraw the buttons (now that the optionheader has the right
-               // swatch)
-               el.find( '.ui-btn' ).each(function () {
-                       $( this ).attr( 'data-' + $.mobile.ns + 'theme', theme );
-
-                       // hack the class of the button to remove the old swatch
-                       var klass = $( this ).attr( 'class' );
-                       klass = klass.replace(/ui-btn-up-\w{1}\s*/, '');
-                       klass = klass + ' ui-btn-up-' + theme;
-                       $( this ).attr( 'class', klass );
-               });
-       },
-
-       _setHeight: function ( height, isCollapsed, options ) {
-               var self = this,
-                       duration,
-                       commonCallback,
-                       callback;
-
-               options = options || {};
-
-               // set default duration if not specified
-               duration = options.duration;
-               if ( typeof duration == 'undefined' ) {
-                       duration = this.options.duration;
-               }
+               // count ui-grid-* elements to get number of rows
+       //        numRows = el.find(gridRowSelector).length;
+
+               // ...at least one row
+       //        numRows = Math.max(1, numRows);
+
+               // add classes to outer div:
+               //   ui-option-header-N-row, where N = options.rows
+               //   ui-bar-X, where X = options.theme (defaults to 'c')
+               //   ui-option-header
+                       rowsClass = 'ui-option-header-' + numRows + '-row';
+                       themeClass = 'ui-body-' + this.options.theme;
+
+                       el.removeClass( rowsClass ).addClass( rowsClass );
+                       el.removeClass( themeClass ).addClass( themeClass );
+                       el.removeClass( optionHeaderClass ).addClass( optionHeaderClass );
+
+                       // remove any arrow currently visible
+                       el.prev( '.ui-option-header-triangle-arrow' ).remove();
+       //        el.prev('.ui-triangle-container').remove();
+
+                       // if there are elements inside the option header
+                       // and this.options.showIndicator,
+                       // insert a triangle arrow as the first element inside the
+                       // optionheader div to show the header has hidden content
+                       if ( this.options.showIndicator ) {
+                               el.before( arrow );
+                               arrow.append("<div class='ui-triangle-image'></div>");
+       //            arrow.triangle({"color": el.css('background-color'), offset: "50%"});
+                       }
 
-               // the callback to always call after expanding or collapsing
-               commonCallback = function () {
-                       self.isCollapsed = isCollapsed;
+               // if expandable, bind clicks to the toggle() method
+                       if ( this.options.expandable ) {
+       //            el.unbind('vclick', this.clickHandler).bind('vclick', this.clickHandler);
+       //            arrow.unbind('vclick', this.clickHandler).bind('vclick', this.clickHandler);
+                               el.bind( 'vclick', this.clickHandler );
+                               arrow.bind( 'vclick', this.clickHandler );
 
-                       if ( isCollapsed ) {
-                               self.element.trigger( 'collapse' );
                        } else {
-                               self.element.trigger( 'expand' );
+                               el.unbind( 'vclick', this.clickHandler );
+                               arrow.unbind( 'vclick', this.clickHandler );
                        }
-               };
 
-               // combine commonCallback with any user-specified callback
-               if ( options.callback ) {
-                       callback = function () {
-                               options.callback();
-                               commonCallback();
-                       };
-               } else {
-                       callback = function () {
-                               commonCallback();
+                       // for each ui-grid-a element, add a class ui-option-header-row-M
+                       // to it, where M is the xpath position() of the div
+       /*        el.find(gridRowSelector).each(function (index) {
+                   var klass = 'ui-option-header-row-' + (index + 1);
+                   $(this).removeClass(klass).addClass(klass);
+               });*/
+                       klass = 'ui-option-header-row-' + ( numRows );
+                       el.find( "div" ).eq( 0 ).removeClass( klass ).addClass( klass );
+
+                       // redraw the buttons (now that the optionheader has the right
+                       // swatch)
+                       el.find( '.ui-btn' ).each(function () {
+                               $( this ).attr( 'data-' + $.mobile.ns + 'theme', theme );
+
+                               // hack the class of the button to remove the old swatch
+                               var klass = $( this ).attr( 'class' );
+                               klass = klass.replace(/ui-btn-up-\w{1}\s*/, '');
+                               klass = klass + ' ui-btn-up-' + theme;
+                               $( this ).attr( 'class', klass );
+                       });
+               },
+
+               _setHeight: function ( height, isCollapsed, options ) {
+                       var self = this,
+                               elt = this.element.get( 0 ),
+                               duration,
+                               commonCallback,
+                               callback,
+                               handler;
+
+                       options = options || {};
+
+                       // set default duration if not specified
+                       duration = options.duration;
+                       if ( typeof duration == 'undefined' ) {
+                               duration = this.options.duration;
                        }
-               }
 
-               // apply the animation
-               if( duration > 0 && $.support.cssTransitions ) {
-                       // add a handler to invoke a callback when the animation is done
-                       var elt = this.element.get( 0 );
+                       // the callback to always call after expanding or collapsing
+                       commonCallback = function () {
+                               self.isCollapsed = isCollapsed;
 
-                       var handler = {
-                               handleEvent: function ( e ) {
-                                       elt.removeEventListener( 'webkitTransitionEnd', this );
-                                       self.element.css( '-webkit-transition', null );
-                                       callback();
+                               if ( isCollapsed ) {
+                                       self.element.trigger( 'collapse' );
+                               } else {
+                                       self.element.trigger( 'expand' );
                                }
                        };
 
-                       elt.addEventListener( 'webkitTransitionEnd', handler, false );
+                       // combine commonCallback with any user-specified callback
+                       if ( options.callback ) {
+                               callback = function () {
+                                       options.callback();
+                                       commonCallback();
+                               };
+                       } else {
+                               callback = function () {
+                                       commonCallback();
+                               };
+                       }
 
-                       // apply the transition
-                       this.element.css( '-webkit-transition', 'height ' + duration + 's ease-out' );
-                       this.element.css( 'height', height );
-               }
-               // make sure the callback gets called even when there's no
-               // animation
-               else {
-                       this.element.css( 'height', height );
-                       callback();
-               }
-       },
-
-       /**
-       * Toggle the expanded/collapsed state of the widget.
-       * {Object} [options] Configuration for the expand/collapse
-       * {Integer} [options.duration] Duration of the expand/collapse;
-       * defaults to this.options.duration
-       * {Function} options.callback Function to call after toggle completes
-       */
-
-       toggle: function ( options ) {
-               var toggle_header = this.element.parents( ":jqmData(role='header')" );
-               var toggle_content = this.element.parents( ":jqmData(role='page')" ).find( ".ui-content" );
-               var CollapsedTop = 110,
-                       ExpandedTop = 206; 
-
-               if( toggle_header.children().is(".input-search-bar") ){
-                       CollapsedTop = 218;
-                       ExpandedTop = 314;
-               }
+                       // apply the animation
+                       if ( duration > 0 && $.support.cssTransitions ) {
+                               // add a handler to invoke a callback when the animation is done
 
-               if( $( window ).scrollTop() <= CollapsedTop ){
-                       toggle_header.css( "position", "relative" );
-                       toggle_content.css( "top", "0px" );
-       }
+                               handler = {
+                                       handleEvent: function ( e ) {
+                                               elt.removeEventListener( 'webkitTransitionEnd', this );
+                                               self.element.css( '-webkit-transition', null );
+                                               callback();
+                                       }
+                               };
 
-               if( this.isCollapsed ){
-                       this.expand( options );
+                               elt.addEventListener( 'webkitTransitionEnd', handler, false );
 
-                       if( $( window ).scrollTop() <= ExpandedTop ){
-                               var t = setTimeout( function(){  
+                               // apply the transition
+                               this.element.css( '-webkit-transition', 'height ' + duration + 's ease-out' );
+                               this.element.css( 'height', height );
+                       } else {
+                       // make sure the callback gets called even when there's no
+                       // animation
+                               this.element.css( 'height', height );
+                               callback();
+                       }
+               },
+
+               /**
+               * Toggle the expanded/collapsed state of the widget.
+               * {Object} [options] Configuration for the expand/collapse
+               * {Integer} [options.duration] Duration of the expand/collapse;
+               * defaults to this.options.duration
+               * {Function} options.callback Function to call after toggle completes
+               */
+
+               toggle: function ( options ) {
+                       var toggle_header = this.element.parents( ":jqmData(role='header')" ),
+                               toggle_content = this.element.parents( ":jqmData(role='page')" ).find( ".ui-content" ),
+                               CollapsedTop = 110,
+                               ExpandedTop = 206,
+                               CalculateTime,
+                               /* Apply REM scaling */
+                               scaleFactor = ( 36 / parseInt($('html').css('font-size')));
+                       if ( toggle_header.children().is( ".input-search-bar" ) ) {
+                               CollapsedTop = 218;
+                               ExpandedTop = 314;
+                       }
+
+                       /* Scale Factor */
+                       CollapsedTop = ( CollapsedTop / scaleFactor );
+                       ExpandedTop = ( ExpandedTop / scaleFactor );
+
+                       if ( $( window ).scrollTop() <= CollapsedTop ) {
+                               toggle_header.css( "position", "relative" );
+                               toggle_content.css( "top", "0px" );
+                       }
+
+                       if ( this.isCollapsed ) {
+                               this.expand( options );
+
+                               if ( $( window ).scrollTop() <= ExpandedTop ) {
+                                       CalculateTime = setTimeout( function () {
+                                               toggle_header.css( 'position', 'fixed' );
+                                               toggle_content.css( 'top', ExpandedTop + "px" );
+                                       }, 500 );
+                               } else {
+                                       //   Need to move scroll top
                                        toggle_header.css( 'position', 'fixed' );
                                        toggle_content.css( 'top', ExpandedTop + "px" );
-                               }, 500 );
+                               }
+                               this.options.collapseOnInit = false;
                        } else {
-                               //   Need to move scroll top                    
-                               toggle_header.css( 'position', 'fixed' );
-                               toggle_content.css( 'top', ExpandedTop + "px" );
-                       }
-                       this.options.collapseOnInit = false;
-               } else {
-                       this.collapse( options );
-                       if( $(window).scrollTop() <= ExpandedTop ){
-                               var t = setTimeout( function(){
-                               toggle_header.css( 'position', 'fixed' );
-                               toggle_content.css( 'top', CollapsedTop + "px" );
-                       }, 500 );
-               } else{
-                       toggle_header.css( 'position', 'fixed' );
-                       toggle_content.css( 'top', CollapsedTop + "px" );
+                               this.collapse( options );
+                               if ( $(window).scrollTop() <= ExpandedTop ) {
+                                       CalculateTime = setTimeout( function () {
+                                               toggle_header.css( 'position', 'fixed' );
+                                               toggle_content.css( 'top', CollapsedTop + "px" );
+                                       }, 500 );
+                               } else {
+                                       toggle_header.css( 'position', 'fixed' );
+                                       toggle_content.css( 'top', CollapsedTop + "px" );
+                               }
                        }
+                       this.options.collapseOnInit = true;
+               },
+
+               _setDisabled: function ( value ) {
+                       $.Widget.prototype._setOption.call( this, "disabled", value );
+                       this.element.add( this.element.prev( ".ui-triangle-container" ) )[value ? "addClass" : "removeClass"]("ui-disabled");
+               },
+               /**
+               * Takes the same options as toggle()
+               */
+               collapse: function ( options ) {
+                       var collapsedBarHeight = 10,
+                       scaleFactor = ( 36 / parseInt($('html').css('font-size')));
+
+                       collapsedBarHeight = collapsedBarHeight / scaleFactor;
+
+       //        if (!this.isCollapsed) {
+                       this._setHeight( collapsedBarHeight + "px", true, options );
+       //        }
+               },
+
+               /**
+               * Takes the same options as toggle()
+               */
+               expand: function ( options ) {
+       //        if (this.isCollapsed) {
+                       this._setHeight( this.expandedHeight, false, options );
+       //        }
                }
-               this.options.collapseOnInit = true;
-       },
-       _setDisabled: function( value ) {
-               $.Widget.prototype._setOption.call( this, "disabled", value );
-               this.element.add( this.element.prev(".ui-triangle-container") )[value ? "addClass" : "removeClass"]("ui-disabled");
-       },
-       /**
-       * Takes the same options as toggle()
-       */
-       collapse: function ( options ) {
-//        if (!this.isCollapsed) {
-               this._setHeight( '10px', true, options );
-//        }
-       },
-
-       /**
-       * Takes the same options as toggle()
-       */
-       expand: function ( options ) {
-//        if (this.isCollapsed) {
-               this._setHeight( this.expandedHeight, false, options );
-//        }
-       }
-});
-
-// auto self-init widgets
-$(document).bind("pagecreate create", function (e) {
-    $($.tizen.optionheader.prototype.options.initSelector, e.target)
-    .not(":jqmData(role='none'), :jqmData(role='nojs')")
-    .optionheader();
-});
-
-})(jQuery);
+       });
+
+       // auto self-init widgets
+       $(document).bind("pagecreate create", function ( e ) {
+           $($.tizen.optionheader.prototype.options.initSelector, e.target)
+                       .not(":jqmData(role='none'), :jqmData(role='nojs')")
+                       .optionheader();
+       });
+
+}(jQuery) );
index e953034..f25b17d 100644 (file)
@@ -1,6 +1,27 @@
-/*
+/* ***************************************************************************
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ *
  *     Author: Youmin Ha <youmin.ha@samsung.com>
-*/
+ */
 
 /**
  * Pagecontrol widget shows number bullets, receives touch event for each bullet,
@@ -35,7 +56,7 @@
  *             <script language="text/javascript">
  *
  *             // Bind callback to value change
- *             $('foo').bind('change', function(event, value) {
+ *             $('foo').bind('change', function (event, value) {
  *                     // event: 'change'
  *                     // value: changed value
  *             });
  */
 
 (function ($, undefined) {
+       $.widget( "tizen.pagecontrol", $.mobile.widget, {
+               options: {
+                       initSelector: ":jqmData(role='pagecontrol')"
+               },
+
+               _create: function ( ) {
+               },
+
+               _init: function ( ) {
+                       var self = this,
+                               e = this.element,
+                               maxVal = e.data( "max" ),
+                               currentVal = e.attr( "data-initVal" ),
+                               i = 0,
+                               btn = null,
+                               buf = null,
+                               page_margin_class = 'page_n_margin_44';
+
+
+                       // Set default values
+                       if ( ! maxVal ) {
+                               maxVal = 1;
+                       } else if ( maxVal > 10 ) {
+                               maxVal = 10;
+                       }
+                       e.data( "max", maxVal );
 
-$.widget("tizen.pagecontrol", $.mobile.widget, {
-       options: {
-               initSelector: ":jqmData(role='pagecontrol')",
-       },
-
-       _create: function () {
-       },
-
-       _init: function() {
-               var self = this,
-                       e = this.element,
-                       maxVal = e.data("max"),
-                       currentVal = e.attr("data-initVal"),
-                       i = 0,
-                       btn = null,
-                       buf = null,
-                       page_margin_class = 'page_n_margin_44';
-
-
-               // Set default values
-               if(!maxVal) {
-                       maxVal = 1;
-               } else if(maxVal > 10) {
-                       maxVal = 10;
-               }
-               e.data("max", maxVal);
+                       if ( ! currentVal ) {
+                               currentVal = 1;
+                       }
+                       e.data( "current", currentVal );
+
+                       // Set pagecontrol class
+                       e.addClass( 'pagecontrol' );
+
+                       // Set empty callback variable
+                       self.changeCallback = null;
+
+                       // Calculate left/right margin
+                       if ( maxVal <= 7 ) {
+                               page_margin_class = 'page_n_margin_44';
+                       } else if ( maxVal == 8 ) {
+                               page_margin_class = 'page_n_margin_35';
+                       } else if ( maxVal == 9 ) {
+                               page_margin_class = 'page_n_margin_26';
+                       } else {
+                               page_margin_class = 'page_n_margin_19';
+                       }
 
-               if(!currentVal) {
-                       currentVal = 1;
-               }
-               e.data("current", currentVal);
-
-               // Set pagecontrol class
-               e.addClass('pagecontrol');
-
-               // Set empty callback variable
-               self.changeCallback = null;
-
-               // Calculate left/right margin
-               if(maxVal <= 7) {
-                       page_margin_class = 'page_n_margin_44';
-               } else if(maxVal == 8) {
-                       page_margin_class = 'page_n_margin_35';
-               } else if(maxVal == 9) {
-                       page_margin_class = 'page_n_margin_26';
-               } else {
-                       page_margin_class = 'page_n_margin_19';
-               }
+                       // subroutine: find a child by value
+                       function getBtn( value ) {
+                               return e.children( ":jqmData(value='" + value + "')" );
+                       }
 
-               // subroutine: find a child by value
-               function getBtn(value) {
-                       return e.children(":jqmData(value='" + value + "')");
-               }
+                       // subroutine: change active button by value
+                       function changeActiveBtn( newNum ) {
+                               var oldNum = e.data( 'current' );
 
-               // subroutine: change active button by value
-               function changeActiveBtn(newNum) {
-                       // Check value
-                       if(newNum < 1 || newNum > e.max) return false;
+                               // Check value
+                               if ( newNum < 1 || newNum > e.max ) {
+                                       return false;
+                               }
 
-                       // get old and new btns
-                       var oldNum = e.data('current');
+                               getBtn( oldNum ).removeClass( 'page_n_' + oldNum )
+                                               .addClass( 'page_n_dot' );
+                               getBtn( newNum ).removeClass( 'page_n_dot' )
+                                               .addClass( 'page_n_' + newNum );
+                       }
 
-                       getBtn(oldNum).removeClass('page_n_' + oldNum)
-                                       .addClass('page_n_dot');
-                       getBtn(newNum).removeClass('page_n_dot')
-                                       .addClass('page_n_' + newNum);
-               }
+                       function triggerChange( event ) {
+                               // Trigger change event
+                               e.trigger( 'change', $( this ).data( 'value' ) );
+                       }
 
-               // Add dot icons
-               for(i=1; i<=maxVal; i++) {
-                       btn = $('<div class="page_n page_n_dot ' + page_margin_class + '" data-value="' + i + '"></div>');
-                       e.append(btn);
-                       if(i == currentVal) {
-                               btn.removeClass('page_n_dot').
-                                       addClass('page_n_'+i);
+                       // Add dot icons
+                       for ( i = 1; i <= maxVal; i++ ) {
+                               btn = $( '<div class="page_n page_n_dot ' + page_margin_class + '" data-value="' + i + '"></div>' );
+                               e.append( btn );
+                               if ( i == currentVal ) {
+                                       btn.removeClass( 'page_n_dot' )
+                                               .addClass( 'page_n_' + i );
+                               }
+                               // bind vclick event to each icon
+                               btn.bind( 'vclick', triggerChange );
                        }
-                       // bind vclick event to each icon
-                       btn.bind('vclick', function(event) {
-                               // Trigger change event
-                               e.trigger('change', $(this).data('value'));
+
+                       // pagecontrol element's change event
+                       e.bind( 'change', function ( event, value ) {
+                               // 1. Change activated button
+                               changeActiveBtn( value );
+
+                               // 2. Store new value (DO NOT change this order!)
+                               e.data( 'current', value );
+
                        });
                }
+       });     // end: $.widget()
 
-               // pagecontrol element's change event
-               e.bind('change', function(event, value) {
-                       // 1. Change activated button
-                       changeActiveBtn(value);
-
-                       // 2. Store new value (DO NOT change this order!)
-                       e.data('current', value);
-                       
-               });
-       },
-});    // end: $.widget()
 
+       $( document ).bind( "pagecreate create", function ( e ) {
+               $( $.tizen.pagecontrol.prototype.options.initSelector, e.target )
+                       .not( ":jqmData(role='none'), :jqmData(role='nojs')" )
+                       .pagecontrol( );
+       });
 
-$(document).bind("pagecreate create", function(e) {
-               $($.tizen.pagecontrol.prototype.options.initSelector, e.target)
-               .not(":jqmData(role='none'), :jqmData(role='nojs')")
-               .pagecontrol();
-});
+} ( jQuery ) );
 
-}) (jQuery);
diff --git a/src/widgets/pagelist/js/jquery.mobile.tizen.pagelist.js b/src/widgets/pagelist/js/jquery.mobile.tizen.pagelist.js
new file mode 100755 (executable)
index 0000000..dec184a
--- /dev/null
@@ -0,0 +1,146 @@
+/*
+ *
+ * This software is licensed under the MIT licence (as defined by the OSI at
+ * http://www.opensource.org/licenses/mit-license.php)
+ *
+ * ***************************************************************************
+ * Copyright (c) 2011 by Intel Corporation Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ */
+
+// pagelist widget
+//
+// Given an element, this widget collects all links contained in the descendants of the element and constructs
+// a popupwindow widget containing numbered buttons for each encountered link.
+//
+// You can mark any one element in your document with "data-pagelist='true'" and a pagelist will be created that
+// will allow the user to navigate between the pages linked to within the element.
+//
+// Currently, only one pagelist can exist in a document and, once created, it cannot be modified.
+
+(function ( $, undefined ) {
+
+       window.ensureNS( "jQuery.mobile.tizen" );
+
+       $.widget( "tizen.pagelist", $.tizen.widgetex, {
+               _htmlProto: {
+                       ui: {
+                               pageList: "#pagelist",
+                               button:   "#pagelist-button",
+                               rowBreak: "#pagelist-rowbreak"
+                       }
+               },
+               _create: function () {
+                       var self = this,
+                               popPageList = false,
+                               idx = 0;
+
+                       this._ui.button.remove();
+                       this._ui.rowBreak.remove();
+                       this._ui.pageList
+                               .appendTo( $( "body" ) )
+                               .popupwindow()
+                               .bind( "vclick", function ( e ) {
+                                       $( this ).popupwindow( "close" );
+                               } );
+
+                       this.element.find( "a[href]" ).each( function ( elemIdx, elem ) {
+                               if ( idx > 0 && ( ( idx % 10 ) != 0 ) ) {
+                                       self._ui.pageList.append( self._ui.rowBreak.clone() );
+                               }
+
+                               self._ui.button
+                                       .clone()
+                                       .attr( "href", $( elem ).attr( "href" ) )
+                                       .text( ++idx )
+                                       .appendTo( self._ui.pageList )
+                                       .buttonMarkup()
+                                       .bind( "vclick", function () { self._ui.pageList.popupwindow( "close" ); } )
+                                       .find( ".ui-btn-inner" )
+                                       .css( { padding: 2 } );
+                       } );
+
+                       $( document ).bind( "keydown", function ( e ) {
+                               popPageList = ( e.keyCode === $.mobile.keyCode.CONTROL );
+                       } );
+                       $( document ).bind( "keyup", function ( e ) {
+                               if ( e.keyCode === $.mobile.keyCode.CONTROL && popPageList ) {
+                                       var maxDim = { cx: 0, cy: 0 };
+                                       self._ui.pageList.popupwindow( "open", undefined, 0 );
+                                       self._ui.pageList.find( "a" )
+                                               .each( function () {
+                                                       var btn = $( this ),
+                                                               dim = {
+                                                                       cx: btn.outerWidth( true ),
+                                                                       cy: btn.outerHeight( true )
+                                                               };
+
+                                                       // Make sure things will be even later, because padding cannot have decimals - apparently :-S
+                                                       if ( dim.cx % 2 ) {
+                                                               btn.css( "padding-left", parseInt( btn.css( "padding-left" ), 10 ) + 1 );
+                                                       }
+                                                       if ( dim.cy % 2 ) {
+                                                               btn.css( "padding-bottom", parseInt( btn.css( "padding-bottom" ), 10 ) + 1 );
+                                                       }
+
+                                                       maxDim.cx = Math.max( maxDim.cx, dim.cx );
+                                                       maxDim.cy = Math.max( maxDim.cy, dim.cy );
+                                               } )
+                                               .each( function () {
+                                                       var padding = {
+                                                                       h: Math.max( 0, ( maxDim.cx - $( this ).outerWidth( true ) ) / 2 ),
+                                                                       v: Math.max( 0, ( maxDim.cy - $( this ).outerHeight( true ) ) / 2 )
+                                                               },
+                                                               btn = $( this ),
+                                                               inner = btn.find( ".ui-btn-inner" );
+
+                                                       inner.css( {
+                                                               "padding-left"          : parseInt( inner.css( "padding-left" ), 10 ) + padding.h,
+                                                               "padding-top"           : parseInt( inner.css( "padding-top" ), 10 ) + padding.v,
+                                                               "padding-right"         : parseInt( inner.css( "padding-right" ), 10 ) + padding.h,
+                                                               "padding-bottom"        : parseInt( inner.css( "padding-bottom" ), 10 ) + padding.v
+                                                       } );
+                                                       btn[( ( btn.attr( "href" ) === "#" + $.mobile.activePage.attr( "id" ) ) ? "addClass" : "removeClass" )]( "ui-btn-active" );
+                                               } );
+                                       e.stopPropagation();
+                                       e.preventDefault();
+                               }
+                               popPageList = false;
+                       } );
+               }
+       } );
+
+       // Look for an element marked as a pagelist and assign $.mobile.tizen.pagelist with a newly created pagelist.
+       // If $.mobile.tizen.pagelist is already assigned, ignore any new "data-pagelist='true'" designations.
+       $( document ).bind( "pagecreate create", function ( e ) {
+               $( ":jqmData(pagelist='true')", e.target )
+                       .not( ":jqmData(role='none'), :jqmData(role='nojs')" )
+                       .each( function () {
+                               if ( $.mobile.tizen.pagelist === undefined ) {
+                                       $.extend( $.mobile.tizen, {
+                                               pagelist: $( this ).pagelist()
+                                       } );
+                               }
+                               return false;
+                       } );
+       } );
+
+}( jQuery ) );
diff --git a/src/widgets/pagelist/js/pagelist.js b/src/widgets/pagelist/js/pagelist.js
deleted file mode 100644 (file)
index a447ff9..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- *
- * This software is licensed under the MIT licence (as defined by the OSI at
- * http://www.opensource.org/licenses/mit-license.php)
- *
- * ***************************************************************************
- * Copyright (C) 2011 by Intel Corporation Ltd.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- * ***************************************************************************
- */
-
-// pagelist widget
-//
-// Given an element, this widget collects all links contained in the descendants of the element and constructs
-// a popupwindow widget containing numbered buttons for each encountered link.
-//
-// You can mark any one element in your document with "data-pagelist='true'" and a pagelist will be created that
-// will allow the user to navigate between the pages linked to within the element.
-//
-// Currently, only one pagelist can exist in a document and, once created, it cannot be modified.
-
-(function($, undefined) {
-
-ensureNS("jQuery.mobile.tizen");
-
-$.widget("tizen.pagelist", $.tizen.widgetex, {
-    _htmlProto: {
-        ui: {
-            pageList: "#pagelist",
-            button:   "#pagelist-button",
-            rowBreak: "#pagelist-rowbreak"
-        }
-    },
-    _create: function() {
-        var self = this,
-            popPageList = false,
-            idx = 0;
-
-        this._ui.button.remove();
-        this._ui.rowBreak.remove();
-        this._ui.pageList
-            .appendTo($("body"))
-            .popupwindow()
-            .bind("vclick", function(e) {
-                $(this).popupwindow("close");
-            });
-
-        this.element.find("a[href]").each(function(elemIdx, elem) {
-            if (idx > 0 && !(idx % 10))
-                self._ui.pageList.append(self._ui.rowBreak.clone());
-
-            self._ui.button
-                .clone()
-                .attr("href", $(elem).attr("href"))
-                .text(++idx)
-                .appendTo(self._ui.pageList)
-                .buttonMarkup()
-                .bind("vclick", function() { self._ui.pageList.popupwindow("close"); })
-                .find(".ui-btn-inner")
-                .css({padding: 2});
-        });
-
-        $(document).bind("keydown", function(e) {
-            popPageList = (e.keyCode === $.mobile.keyCode.CONTROL);
-        });
-        $(document).bind("keyup", function(e) {
-            if (e.keyCode === $.mobile.keyCode.CONTROL && popPageList) {
-                var maxDim = {cx: 0, cy: 0};
-                self._ui.pageList.popupwindow("open", undefined, 0);
-                self._ui.pageList.find("a")
-                    .each(function() {
-                        var btn = $(this),
-                            dim = {
-                                cx: btn.outerWidth(true),
-                                cy: btn.outerHeight(true)
-                            };
-
-                        // Make sure things will be even later, because padding cannot have decimals - apparently :-S
-                        if (dim.cx % 2) btn.css("padding-left",   parseInt(btn.css("padding-left"))   + 1);
-                        if (dim.cy % 2) btn.css("padding-bottom", parseInt(btn.css("padding-bottom")) + 1);
-
-                        maxDim.cx = Math.max(maxDim.cx, dim.cx);
-                        maxDim.cy = Math.max(maxDim.cy, dim.cy);
-                    })
-                    .each(function() {
-                        var padding = {
-                                h: Math.max(0, (maxDim.cx - $(this).outerWidth(true))  / 2),
-                                v: Math.max(0, (maxDim.cy - $(this).outerHeight(true)) / 2)
-                            },
-                            btn = $(this),
-                            inner = btn.find(".ui-btn-inner");
-
-                        inner.css({
-                            "padding-left"   : parseInt(inner.css("padding-left"))   + padding.h,
-                            "padding-top"    : parseInt(inner.css("padding-top"))    + padding.v,
-                            "padding-right"  : parseInt(inner.css("padding-right"))  + padding.h,
-                            "padding-bottom" : parseInt(inner.css("padding-bottom")) + padding.v
-                        });
-                        btn[((btn.attr("href") === "#" + $.mobile.activePage.attr("id")) ? "addClass" : "removeClass")]("ui-btn-active");
-                    });
-                e.stopPropagation();
-                e.preventDefault();
-            }
-            popPageList = false;
-        });
-    }
-});
-
-// Look for an element marked as a pagelist and assign $.mobile.tizen.pagelist with a newly created pagelist.
-// If $.mobile.tizen.pagelist is already assigned, ignore any new "data-pagelist='true'" designations.
-$(document).bind("pagecreate create", function(e) {
-    $(":jqmData(pagelist='true')", e.target)
-        .not(":jqmData(role='none'), :jqmData(role='nojs')")
-        .each(function() {
-            if ($.mobile.tizen.pagelist === undefined) {
-                $.extend($.mobile.tizen, {
-                    pagelist: $(this).pagelist()
-                });
-            }
-            return false;
-        });
-});
-
-})(jQuery);
index 6b76604..6df99ed 100755 (executable)
@@ -5,7 +5,8 @@
  * http://www.opensource.org/licenses/mit-license.php)
  *
  * ***************************************************************************
- * Copyright (C) 2011 by Intel Corporation Ltd.
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2011 by Intel Corporation Ltd.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
 // Events:
 //     close: Emitted when the popupwindow is closed.
 
-(function( $, undefined ) {
-
-$.widget( "tizen.popupwindow", $.tizen.widgetex, {
-    options: {
-        theme: null,
-        overlayTheme: "s",
-       style: "custom",
-       disabled: false,
-        shadow: true,
-        corners: true,
-        fade: true,
-               widthRatio: 0.8612,
-        transition: $.mobile.defaultDialogTransition,
-        initSelector: ":jqmData(role='popupwindow')"
-    },
-
-    _htmlProto: {
-        ui: {
-            screen:    "#popupwindow-screen",
-            container: "#popupwindow-container"
-        }
-    },
-
-    _create: function() {
-        var thisPage = this.element.closest(":jqmData(role='page')"),
-            self = this;
-
-        if (thisPage.length === 0)
-            thisPage = $("body");
-
-        // Drop a placeholder into the location from which we shall rip out the popup window contents
-        this._ui.placeholder = 
-            $("<div><!-- placeholder" + 
-                    (this.element.attr("id") === undefined 
-                        ? "" 
-                        : " for " + this.element.attr("id")) + " --></div>")
-                .css("display", "none")
-                .insertBefore(this.element);
-
-        // Apply the proto
-        thisPage.append(this._ui.screen);
-        this._ui.container.insertAfter(this._ui.screen);
-        this._ui.container.append(this.element);
-
-        // Define instance variables
-        $.extend( self, {
-            _isOpen: false
-        });
-
-       //Data Style Start
-       var popup = this.element;
-       var o = this.options;
-       var style = popup.attr( 'data-style' );
-       o.style =  style ? style : o.style;
-
-       popup.addClass( o.style );
-       popup.find( ":jqmData(role='title')" )
-                .wrapAll( "<div class='popup-title'></div>" );
-       popup.find( ":jqmData(role='text')" )
-                .wrapAll( "<div class='popup-text'></div>" );
-       popup.find( ":jqmData(role='button-bg')" )
-                .wrapAll( "<div class='popup-button-bg'></div>" );
-       popup.find( ":jqmData(role='check-bg')" )
-                .wrapAll( "<div class='popup-check-bg'></div>" );
-       popup.find( ":jqmData(role='scroller-bg')" )
-                .wrapAll( "<div class='popup-scroller-bg'></div>" );
-       popup.find( ":jqmData(role='text-bottom-bg')" )
-                .wrapAll( "<div class='popup-text-bottom-bg'></div>" );
-       popup.find( ":jqmData(role='text-left')" )
-                .wrapAll( "<div class='popup-text-left'></div>" );
-       popup.find( ":jqmData(role='text-right')" )
-                .wrapAll( "<div class='popup-text-right'></div>" );
-       popup.find( ":jqmData(role='progress-bg')" )
-                .wrapAll( "<div class='popup-progress-bg'></div>" );
-       //Data Style End
-
-
-        // Events on "screen" overlay
-        this._ui.screen.bind( "vclick", function( event ) {
-            self.close();
-        });
-    },
-
-    _realSetTheme: function(dst, theme) {
-        var classes = (dst.attr("class") || "").split(" "),
-            alreadyAdded = true,
-            currentTheme = null,
-            matches;
-
-        while (classes.length > 0) {
-            currentTheme = classes.pop();
-            matches = currentTheme.match(/^ui-body-([a-z])$/);
-            if (matches && matches.length > 1) {
-                currentTheme = matches[1];
-                break;
-            }
-            else
-                currentTheme = null;
-        }
-
-        dst.removeClass("ui-body-" + currentTheme);
-        if ((theme || "").match(/[a-z]/))
-            dst.addClass("ui-body-" + theme);
-    },
-
-    _setTheme: function(value) {
-        this._realSetTheme(this.element, value);
-        this.options.theme = value;
-        this.element.attr("data-" + ($.mobile.ns || "") + "theme", value);
-    },
-
-    _setOverlayTheme: function(value) {
-        this._realSetTheme(this._ui.container, value);
-        // The screen must always have some kind of background for fade to work, so, if the theme is being unset,
-        // set the background to "a".
-        this._realSetTheme(this._ui.screen, (value === "" ? "a" : value));
-        this.options.overlayTheme = value;
-        this.element.attr("data-" + ($.mobile.ns || "") + "overlay-theme", value);
-    },
-
-    _setShadow: function(value) {
-        this.options.shadow = value;
-        this.element.attr("data-" + ($.mobile.ns || "") + "shadow", value);
-        this._ui.container[value ? "addClass" : "removeClass"]("ui-overlay-shadow");
-    },
-
-    _setCorners: function(value) {
-        this.options.corners = value;
-        this.element.attr("data-" + ($.mobile.ns || "") + "corners", value);
-        this._ui.container[value ? "addClass" : "removeClass"]("ui-corner-all");
-    },
-
-    _setFade: function(value) {
-        this.options.fade = value;
-        this.element.attr("data-" + ($.mobile.ns || "") + "fade", value);
-    },
-
-    _setTransition: function(value) {
-        this._ui.container
-                .removeClass((this.options.transition || ""))
-                .addClass(value);
-        this.options.transition = value;
-        this.element.attr("data-" + ($.mobile.ns || "") + "transition", value);
-    },
-
-    _setDisabled: function(value) {
-        $.Widget.prototype._setOption.call(this, "disabled", value);
-        if (value)
-            this.close();
-    },
-
-    _placementCoords: function(x, y, cx, cy) {
-        // Try and center the overlay over the given coordinates
-        var ret,
-            scrollTop = $(window).scrollTop(),
-            screenHeight = $(window).height(),
-            screenWidth = $(window).width(),
-            halfheight = cy / 2,
-            maxwidth = parseFloat( this._ui.container.css( "max-width" ) ),
-            roomtop = y - scrollTop,
-            roombot = scrollTop + screenHeight - y,
-            newtop, newleft;
-
-        if ( roomtop > cy / 2 && roombot > cy / 2 ) {
-            newtop = y - halfheight;
-        }
-        else {
-            // 30px tolerance off the edges
-            newtop = roomtop > roombot ? scrollTop + screenHeight - cy - 30 : scrollTop + 30;
-        }
-
-        // If the menuwidth is smaller than the screen center is
-        if ( cx < maxwidth ) {
-            newleft = ( screenWidth - cx ) / 2;
-        }
-        else {
-            //otherwise insure a >= 30px offset from the left
-            newleft = x - cx / 2;
-
-            // 10px tolerance off the edges
-            if ( newleft < 10 ) {
-                newleft = 10;
-            }
-            else
-            if ( ( newleft + cx ) > screenWidth ) {
-                newleft = screenWidth - cx - 10;
-            }
-        }
-
-        return { x : newleft, y : newtop };
-    },
-
-    destroy: function() {
-        // Put the element back where we ripped it out from
-        this.element.insertBefore(this._ui.placeholder);
-
-        // Clean up
-        this._ui.placeholder.remove();
-        this._ui.container.remove();
-        this._ui.screen.remove();
-        this.element.triggerHandler("destroyed");
-        $.Widget.prototype.destroy.call(this);
-    },
-
-    open: function(x_where, y_where) {
-        if (!(this._isOpen || this.options.disabled)) {
-            var self = this,
-                x = (undefined === x_where ? window.innerWidth  / 2 : x_where),
-                y = (undefined === y_where ? window.innerHeight / 2 : y_where),
-                coords,
-                zIndexMax = 0;
-
-                       var ctxpopup = this.element.data("ctxpopup");
-                       if ( !ctxpopup ) {
-                               var popupWidth = window.innerWidth * this.options.widthRatio;
-                               this._ui.container.css("width", popupWidth);
-                               // If the width of the popup exceeds the width of the window, we need to limit the width here,
-                               // otherwise outer{Width,Height}(true) below will happily report the unrestricted values, causing
-                               // the popup to get placed wrong.
-                               if (this._ui.container.outerWidth(true) > $(window).width())
-                                   this._ui.container.css({"max-width" : $(window).width() - 30});
+(function ( $, undefined ) {
+
+       $.widget( "tizen.popupwindow", $.tizen.widgetex, {
+               options: {
+                       theme: null,
+                       overlayTheme: "s",
+                       style: "custom",
+                       disabled: false,
+                       shadow: true,
+                       corners: true,
+                       fade: true,
+                       widthRatio: 0.8612,
+                       transition: $.mobile.defaultDialogTransition,
+                       initSelector: ":jqmData(role='popupwindow')"
+               },
+
+               _htmlProto: {
+                       ui: {
+                               screen:    "#popupwindow-screen",
+                               container: "#popupwindow-container"
                        }
+               },
 
-            coords = this._placementCoords(x, y,
-                this._ui.container.outerWidth(true),
-                this._ui.container.outerHeight(true));
-
-                       $(document)
-                .find("*")
-                .each(function() {
-                    var el = $(this),
-                        zIndex = parseInt(el.css("z-index"));
-
-                    if (!(el.is(self._ui.container) || el.is(self._ui.screen) || isNaN(zIndex)))
-                        zIndexMax = Math.max(zIndexMax, zIndex);
-                });
-
-            this._ui.screen
-                .height($(document).height())
-                .removeClass("ui-screen-hidden");
-
-            if (this.options.fade)
-                this._ui.screen.animate({opacity: 0.5}, "fast");
-            else
-                this._ui.screen.css({opacity: 0.0});
-
-           //Recalculate popup position
-           var menuHeight = this._ui.container.innerHeight(true),
-                 menuWidth = this._ui.container.innerWidth(true),
-                 scrollTop = $( window ).scrollTop(),
-                 screenHeight = window.innerHeight,
-                 screenWidth = window.innerWidth;
-
-           var roomtop = y - scrollTop,
-                 roombot = scrollTop + screenHeight - y,
-                 halfheight = menuHeight / 2,
-                 maxwidth = parseFloat( this._ui.container.css( "max-width" ) ),
-                 newtop, newleft;
-
-           newtop = (screenHeight - menuHeight) / 2 + scrollTop;
-
-             if ( menuWidth < maxwidth ) {
-                 newleft = ( screenWidth - menuWidth ) / 2;
-             }
-             else {
-                 //otherwise insure a >= 30px offset from the left
-                 newleft = x - menuWidth / 2;
-       
-                 // 30px tolerance off the edges
-                 if ( newleft < 30 ) {
-                     newleft = 30;
-                 }
-                 else if ( ( newleft + menuWidth ) > screenWidth ) {
-                     newleft = screenWidth - menuWidth - 30;
-                 }
-             }
-           //Recalculate popup position End
-               if ( ctxpopup ) {
-                       newtop = coords.y;
-                       newleft = coords.x;
+               _create: function () {
+                       var thisPage = this.element.closest(":jqmData(role='page')"),
+                               self = this,
+                               popup = this.element,
+                               o = this.options,
+                               style = popup.attr( 'data-style' );
+
+                       if (thisPage.length === 0) {
+                               thisPage = $("body");
+                       }
+
+                       // Drop a placeholder into the location from which we shall rip out the popup window contents
+                       this._ui.placeholder =
+                                       $("<div><!-- placeholder" +
+                                                                       (this.element.attr("id") === undefined
+                                                                        ? ""
+                                                                        : " for " + this.element.attr("id")) + " --></div>")
+                                       .css("display", "none")
+                                       .insertBefore(this.element);
+
+                       // Apply the proto
+                       thisPage.append(this._ui.screen);
+                       this._ui.container.insertAfter(this._ui.screen);
+                       this._ui.container.append(this.element);
+
+                       // Define instance variables
+                       $.extend( self, {
+                               _isOpen: false
+                       });
+
+                       //Data Style Start
+                       if (style) {
+                               o.style = style;
+                       }
+
+                       popup.addClass( o.style );
+                       popup.find( ":jqmData(role='title')" )
+                                       .wrapAll( "<div class='popup-title'></div>" );
+                       popup.find( ":jqmData(role='text')" )
+                                       .wrapAll( "<div class='popup-text'></div>" );
+                       popup.find( ":jqmData(role='button-bg')" )
+                                       .wrapAll( "<div class='popup-button-bg'></div>" );
+                       popup.find( ":jqmData(role='check-bg')" )
+                                       .wrapAll( "<div class='popup-check-bg'></div>" );
+                       popup.find( ":jqmData(role='scroller-bg')" )
+                                       .wrapAll( "<div class='popup-scroller-bg'></div>" );
+                       popup.find( ":jqmData(role='text-bottom-bg')" )
+                                       .wrapAll( "<div class='popup-text-bottom-bg'></div>" );
+                       popup.find( ":jqmData(role='text-left')" )
+                                       .wrapAll( "<div class='popup-text-left'></div>" );
+                       popup.find( ":jqmData(role='text-right')" )
+                                       .wrapAll( "<div class='popup-text-right'></div>" );
+                       popup.find( ":jqmData(role='progress-bg')" )
+                                       .wrapAll( "<div class='popup-progress-bg'></div>" );
+                       //Data Style End
+
+                       // Events on "screen" overlay
+                       this._ui.screen.bind( "vclick", function (event) {
+                               self.close();
+                       });
+               },
+
+               _realSetTheme: function (dst, theme) {
+
+                       var classes = (dst.attr("class") || "").split(" "),
+                               alreadyAdded = true,
+                               currentTheme = null,
+                               matches;
+
+                       while (classes.length > 0) {
+                               currentTheme = classes.pop();
+                               matches = currentTheme.match(/^ui-body-([a-z])$/);
+                               if (matches && matches.length > 1) {
+                                       currentTheme = matches[1];
+                                       break;
+                               } else {
+                                       currentTheme = null;
+                               }
+                       }
+
+                       dst.removeClass("ui-body-" + currentTheme);
+                       if ((theme || "").match(/[a-z]/)) {
+                               dst.addClass("ui-body-" + theme);
+                       }
+               },
+
+               _setTheme: function (value) {
+                       this._realSetTheme(this.element, value);
+                       this.options.theme = value;
+                       this.element.attr("data-" + ($.mobile.ns || "") + "theme", value);
+               },
+
+               _setOverlayTheme: function (value) {
+                       this._realSetTheme(this._ui.container, value);
+                       // The screen must always have some kind of background for fade to work, so, if the theme is being unset,
+       // set the background to "a".
+                       this._realSetTheme(this._ui.screen, (value === "" ? "a" : value));
+                       this.options.overlayTheme = value;
+                       this.element.attr("data-" + ($.mobile.ns || "") + "overlay-theme", value);
+               },
+
+               _setShadow: function (value) {
+                       this.options.shadow = value;
+                       this.element.attr("data-" + ($.mobile.ns || "") + "shadow", value);
+                       this._ui.container[value ? "addClass" : "removeClass"]("ui-overlay-shadow");
+               },
+
+               _setCorners: function (value) {
+                       this.options.corners = value;
+                       this.element.attr("data-" + ($.mobile.ns || "") + "corners", value);
+                       this._ui.container[value ? "addClass" : "removeClass"]("ui-corner-all");
+               },
+
+               _setFade: function (value) {
+                       this.options.fade = value;
+                       this.element.attr("data-" + ($.mobile.ns || "") + "fade", value);
+               },
+
+               _setTransition: function (value) {
+                       this._ui.container
+                               .removeClass((this.options.transition || ""))
+                               .addClass(value);
+                       this.options.transition = value;
+                       this.element.attr("data-" + ($.mobile.ns || "") + "transition", value);
+               },
+
+               _setDisabled: function (value) {
+                       $.Widget.prototype._setOption.call(this, "disabled", value);
+                       if (value) {
+                               this.close();
+                       }
+               },
+
+               _placementCoords: function (x, y, cx, cy) {
+                       // Try and center the overlay over the given coordinates
+                       var ret,
+                               scrollTop = $(window).scrollTop(),
+                               screenHeight = $(window).height(),
+                               screenWidth = $(window).width(),
+                               halfheight = cy / 2,
+                               maxwidth = parseFloat( this._ui.container.css( "max-width" ) ),
+                               roomtop = y - scrollTop,
+                               roombot = scrollTop + screenHeight - y,
+                               newtop,
+                               newleft;
+
+                       if ( roomtop > cy / 2 && roombot > cy / 2 ) {
+                               newtop = y - halfheight;
+                       } else {
+                               // 30px tolerance off the edges
+                               newtop = roomtop > roombot ? scrollTop + screenHeight - cy - 30 : scrollTop + 30;
+                       }
+
+                       // If the menuwidth is smaller than the screen center is
+                       if ( cx < maxwidth ) {
+                               newleft = ( screenWidth - cx ) / 2;
+                       } else {
+                               //otherwise insure a >= 30px offset from the left
+                               newleft = x - cx / 2;
+
+                               // 10px tolerance off the edges
+                               if ( newleft < 10 ) {
+                                       newleft = 10;
+                               } else if ( ( newleft + cx ) > screenWidth ) {
+                                       newleft = screenWidth - cx - 10;
+                               }
+                       }
+
+                       return { x : newleft, y : newtop };
+               },
+
+               destroy: function () {
+               // Put the element back where we ripped it out from
+                       this.element.insertBefore(this._ui.placeholder);
+
+                       // Clean up
+                       this._ui.placeholder.remove();
+                       this._ui.container.remove();
+                       this._ui.screen.remove();
+                       this.element.triggerHandler("destroyed");
+                       $.Widget.prototype.destroy.call(this);
+               },
+
+               open: function (x_where, y_where) {
+                       if (!(this._isOpen || this.options.disabled)) {
+                               var self = this,
+                                       x = (undefined === x_where ? $(window).width()  / 2 : x_where),
+                                       y = (undefined === y_where ? $(window).height() / 2 : y_where),
+                                       coords,
+                                       zIndexMax = 0,
+                                       ctxpopup = this.element.data("ctxpopup"),
+                                       popupWidth,
+                                       menuHeight,
+                                       menuWidth,
+                                       scrollTop,
+                                       screenHeight,
+                                       screenWidth,
+                                       roomtop,
+                                       roombot,
+                                       halfheight,
+                                       maxwidth,
+                                       newtop,
+                                       newleft;
+
+                               if ( !ctxpopup ) {
+                                       popupWidth = $(window).width() * this.options.widthRatio;
+                                       this._ui.container.css("width", popupWidth);
+                                       // If the width of the popup exceeds the width of the window, we need to limit the width here,
+                                       // otherwise outer{Width,Height}(true) below will happily report the unrestricted values, causing
+                                       // the popup to get placed wrong.
+                                       if (this._ui.container.outerWidth(true) > $(window).width()) {
+                                               this._ui.container.css({"max-width" : $(window).width() - 30});
+                                       }
+                               }
+
+                               coords = this._placementCoords(x, y,
+                                       this._ui.container.outerWidth(true),
+                                       this._ui.container.outerHeight(true));
+
+                               $(document)
+                                       .find("*")
+                                       .each(function () {
+                                               var el = $(this),
+                                                       zIndex = parseInt(el.css("z-index"), 10);
+                                               if (!(el.is(self._ui.container) || el.is(self._ui.screen) || isNaN(zIndex))) {
+                                                       zIndexMax = Math.max(zIndexMax, zIndex);
+                                               }
+                                       });
+
+                               this._ui.screen
+                                       .height($(document).height())
+                                       .removeClass("ui-screen-hidden");
+
+                               if (this.options.fade) {
+                                       this._ui.screen.animate({opacity: 0.5}, "fast");
+                               } else {
+                                       this._ui.screen.css({opacity: 0.0});
+                               }
+
+                               //Recalculate popup position
+                               menuHeight = this._ui.container.innerHeight(true);
+                               menuWidth = this._ui.container.innerWidth(true);
+                               scrollTop = $(window).scrollTop();
+                               screenHeight = $(window).height();
+                               screenWidth = $(window).width();
+                               roomtop = y - scrollTop;
+                               roombot = scrollTop + screenHeight - y;
+                               halfheight = menuHeight / 2;
+                               maxwidth = parseFloat( this._ui.container.css( "max-width" ) );
+                               newtop = (screenHeight - menuHeight) / 2 + scrollTop;
+
+                               if ( menuWidth < maxwidth ) {
+                                       newleft = ( screenWidth - menuWidth ) / 2;
+                               } else {
+                                       //otherwise insure a >= 30px offset from the left
+                                       newleft = x - menuWidth / 2;
+
+                                       // 30px tolerance off the edges
+                                       if ( newleft < 30 ) {
+                                               newleft = 30;
+                                       } else if ( ( newleft + menuWidth ) > screenWidth ) {
+                                               newleft = screenWidth - menuWidth - 30;
+                                       }
+                               }
+                               //Recalculate popup position End
+                               if ( ctxpopup ) {
+                                       newtop = coords.y;
+                                       newleft = coords.x;
+                               }
+
+                               this._ui.container
+                                       .removeClass("ui-selectmenu-hidden")
+                                       .css({
+                                               top: newtop,
+                                               left: newleft
+                                       })
+                                       .addClass("in")
+                                       .animationComplete(function () {
+                                               self._ui.screen.height($(document).height());
+                                       });
+
+                               this._isOpen = true;
+                       }
+               },
+
+               close: function () {
+                       if (this._isOpen) {
+                               var self = this,
+                                       hideScreen = function () {
+                                               self._ui.screen.addClass("ui-screen-hidden");
+                                               self._isOpen = false;
+                                               self.element.trigger("closed");
+                                       };
+
+                               this._ui.container
+                                       .removeClass("in")
+                                       .addClass("reverse out")
+                                       .animationComplete(function () {
+                                               self._ui.container
+                                                       .removeClass("reverse out")
+                                                       .addClass("ui-selectmenu-hidden")
+                                                       .removeAttr("style");
+                                       });
+
+                               if (this.options.fade) {
+                                       this._ui.screen.animate({opacity: 0.0}, "fast", hideScreen);
+                               } else {
+                                       hideScreen();
+                               }
+                       }
+               }
+       });
+
+       $.tizen.popupwindow.bindPopupToButton = function (btn, popup) {
+               if (btn.length === 0 || popup.length === 0) {
+                       return;
+               }
+
+               var btnVClickHandler = function (e) {
+                       // When /this/ button causes a popup, align the popup's theme with that of the button, unless the popup has a theme pre-set
+                       if (!popup.jqmData("overlay-theme-set")) {
+                               popup.popupwindow("option", "overlayTheme", btn.jqmData("theme"));
+                       }
+                       popup.popupwindow("open",
+                               btn.offset().left + btn.outerWidth()  / 2,
+                               btn.offset().top  + btn.outerHeight() / 2);
+
+                       // Swallow event, because it might end up getting picked up by the popup window's screen handler, which
+                       // will in turn cause the popup window to close - Thanks Sasha!
+                       if (e.stopPropagation) {
+                               e.stopPropagation();
+                       }
+                       if (e.preventDefault) {
+                               e.preventDefault();
+                       }
+               };
+
+               // If the popup has a theme set, prevent it from being clobbered by the associated button
+               if ((popup.popupwindow("option", "overlayTheme") || "").match(/[a-z]/)) {
+                       popup.jqmData("overlay-theme-set", true);
                }
-               
-            this._ui.container
-                .removeClass("ui-selectmenu-hidden")
-                .css({
-                     top: newtop,
-                     left: newleft
-                })
-                .addClass("in")
-                .animationComplete(function() {
-                    self._ui.screen.height($(document).height());
-                });
-
-            this._isOpen = true;
-        }
-    },
-
-    close: function() {
-        if (this._isOpen) {
-            var self = this,
-                hideScreen = function() {
-                    self._ui.screen.addClass("ui-screen-hidden");
-                    self._isOpen = false;
-                    self.element.trigger("closed");
-                };
-
-            this._ui.container
-                .removeClass("in")
-                .addClass("reverse out")
-                .animationComplete(function() {
-                    self._ui.container
-                        .removeClass("reverse out")
-                        .addClass("ui-selectmenu-hidden")
-                        .removeAttr("style");
-                });
-
-            if (this.options.fade)
-                this._ui.screen.animate({opacity: 0.0}, "fast", hideScreen);
-            else
-                hideScreen();
-        }
-    }
-});
-
-$.tizen.popupwindow.bindPopupToButton = function(btn, popup) {
-    if (btn.length === 0 || popup.length === 0) return;
-
-    var btnVClickHandler = function(e) {
-            // When /this/ button causes a popup, align the popup's theme with that of the button, unless the popup has a theme pre-set
-            if (!popup.jqmData("overlay-theme-set"))
-                popup.popupwindow("option", "overlayTheme", btn.jqmData("theme"));
-            popup.popupwindow("open",
-                btn.offset().left + btn.outerWidth()  / 2,
-                btn.offset().top  + btn.outerHeight() / 2);
-
-            // Swallow event, because it might end up getting picked up by the popup window's screen handler, which
-            // will in turn cause the popup window to close - Thanks Sasha!
-            if (e.stopPropagation)
-                e.stopPropagation();
-            if (e.preventDefault)
-                e.preventDefault();
-        };
-
-    // If the popup has a theme set, prevent it from being clobbered by the associated button
-    if ((popup.popupwindow("option", "overlayTheme") || "").match(/[a-z]/))
-        popup.jqmData("overlay-theme-set", true);
-
-    btn
-        .attr({
-            "aria-haspopup": true,
-            "aria-owns": btn.attr("href")
-        })
-        .removeAttr("href")
-        .bind("vclick", btnVClickHandler);
-
-    popup.bind("destroyed", function() {
-        btn.unbind("vclick", btnVClickHandler);
-    });
-};
-
-$(document).bind("pagecreate create", function(e) {
-    $($.tizen.popupwindow.prototype.options.initSelector, e.target)
-        .not(":jqmData(role='none'), :jqmData(role='nojs')")
-        .popupwindow();
-
-    $("a[href^='#']:jqmData(rel='popupwindow')", e.target).each(function() {
-       $.tizen.popupwindow.bindPopupToButton($(this), $($(this).attr("href")));
-    });
-});
-
-})(jQuery);
+
+               btn
+                       .attr({
+                               "aria-haspopup": true,
+                               "aria-owns": btn.attr("href")
+                       })
+                       .removeAttr("href")
+                       .bind("vclick", btnVClickHandler);
+
+               popup.bind("destroyed", function () {
+                       btn.unbind("vclick", btnVClickHandler);
+               });
+       };
+
+       $(document).bind("pagecreate create", function (e) {
+               $($.tizen.popupwindow.prototype.options.initSelector, e.target)
+                       .not(":jqmData(role='none'), :jqmData(role='nojs')")
+                       .popupwindow();
+
+               $("a[href^='#']:jqmData(rel='popupwindow')", e.target).each(function () {
+                       $.tizen.popupwindow.bindPopupToButton($(this), $($(this).attr("href")));
+               });
+       });
+
+}(jQuery));
old mode 100644 (file)
new mode 100755 (executable)
index e5813f2..f9c9149
@@ -5,7 +5,8 @@
  * http://www.opensource.org/licenses/mit-license.php)
  *
  * ***************************************************************************
- * Copyright (C) 2011 by Intel Corporation Ltd.
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2011 by Intel Corporation Ltd.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
 // to one in the superclass, upon calling $.widget the object is overwritten in both the prototype of the superclass and
 // the prototype of the subclass. The prototype of the superclass should remain unchanged.
 
-(function($, undefined) {
-    $.widget("tizen.ctxpopup", $.tizen.widgetex, {
-        options: $.extend({}, $.tizen.popupwindow.prototype.options, {
-            initSelector: ":not(:not(" + $.tizen.popupwindow.prototype.options.initSelector + ")):not(:not(:jqmData(show-arrow='true'), :jqmData(show-arrow)))"
-        }),
-
-        _htmlProto: {
-            ui: {
-                outer     : "#outer",
-                container : "#container", // the key has to have the name "container"
-                arrow     : {
-                    all : ":jqmData(role='triangle')",
-                    l   : "#left",
-                    t   : "#top",
-                    r   : "#right",
-                    b   : "#bottom"
-                }
-            }
-        },
-
-        _create: function(){
-            if (!this.element.data("popupwindow"))
-                this.element.popupwindow();
-            this.element.data("popupwindow")
-                    ._ui.container
-                        .removeClass("ui-popupwindow-padding")
-                        .append(this._ui.outer);
-            this._ui.outer.trigger("create"); // Creates the triangle widgets
-            this._ui.container
-                .addClass("ui-popupwindow-padding")
-                .append(this.element);
-        },
-
-        _setOption: function(key, value) {
-            $.tizen.popupwindow.prototype._setOption.apply(this.element.data("popupwindow"), arguments);
-            this.options[key] = value;
-        },
-    });
-
-var origOpen = $.tizen.popupwindow.prototype.open,
-    orig_setOption = $.tizen.popupwindow.prototype._setOption,
-    orig_placementCoords = $.tizen.popupwindow.prototype._placementCoords;
-
-$.tizen.popupwindow.prototype._setOption = function(key, value) {
-    var ctxpopup = this.element.data("ctxpopup"),
-        needsApplying = true;
-    if (ctxpopup) {
-        if ("shadow" === key || "overlayTheme" === key || "corners" === key) {
-            var origContainer = this._ui.container;
-
-            this._ui.container = ctxpopup._ui.container;
-            orig_setOption.apply(this, arguments);
-            this._ui.container = origContainer;
-            needsApplying = false;
-        }
-        ctxpopup.options[key] = value;
-    }
-
-    if (needsApplying)
-        orig_setOption.apply(this, arguments);
-};
-
-$.tizen.popupwindow.prototype._placementCoords = function(x, y, cx, cy) {
-    var ctxpopup = this.element.data("ctxpopup"),
-        self = this;
-
-    if (ctxpopup) {
-        var coords = {}, minDiff, minDiffIdx;
-
-        // Returns:
-        // {
-        //    absDiff: int
-        //    triangleOffset: int
-        //    actual: { x: int, y: int }
-        // }
-        function getCoords(arrow, x_factor, y_factor) {
-            // Unhide the arrow we want to test to take it into account
-            ctxpopup._ui.arrow.all.hide();
-            ctxpopup._ui.arrow[arrow].show();
-
-            var isHorizontal = ("b" === arrow || "t" === arrow),
-                // Names of keys used in calculations depend on whether things are horizontal or not
-                coord = (isHorizontal
-                    ? {point: "x", size: "cx", beg: "left", outerSize: "outerWidth",  niceSize: "width",  triangleSize : "height"}
-                    : {point: "y", size: "cy", beg: "top",  outerSize: "outerHeight", niceSize: "height", triangleSize : "width"}),
-                size = {
-                    cx : self._ui.container.width(),
-                    cy : self._ui.container.height()
-                },
-                halfSize = {
-                    cx : size.cx / 2,
-                    cy : size.cy / 2
-                },
-                desired = { 
-                    "x" : x + halfSize.cx * x_factor,
-                    "y" : y + halfSize.cy * y_factor
-                },
-                orig = orig_placementCoords.call(self, desired.x, desired.y, size.cx, size.cy),
-
-                // The triangleOffset must be clamped to the range described below:
-                //
-                //                          +-------...
-                //                          |   /\
-                //                          |  /  \
-                //                   ----+--+-,-----...
-                //lowerDiff       -->____|  |/ <-- possible rounded corner
-                //triangle size   -->    | /|
-                //                   ____|/ |
-                //                    ^  |\ | <-- lowest possible offset for triangle
-                // actual range of    |  | \| 
-                // arrow offset       |  |  | 
-                // values due to      |  .  . Payload table cell looks like
-                // possible rounded   |  .  . a popup window, and it may have
-                // corners and arrow  |  .  . arbitrary things like borders,
-                // triangle size -    |  |  | shadows, and rounded corners.
-                // our clamp range    |  | /|
-                //                   _v__|/ |
-                //triangle size   -->    |\ | <-- highest possible offset for triangle
-                //                   ____| \|
-                //upperDiff       -->    |  |\ <-- possible rounded corner
-                //                   ----+--+-'-----...
-                //                          |  \  /
-                //                          |   \/
-                //                          +-------...
-                //
-                // We calculate lowerDiff and upperDiff by considering the offset and width of the payload (this.element)
-                // versus the offset and width of the element enclosing the triangle, because the payload is inside
-                // whatever decorations (such as borders, shadow, rounded corners) and thus can give a reliable indication
-                // of the thickness of the combined decorations
-
-                arrowBeg = ctxpopup._ui.arrow[arrow].offset()[coord.beg],
-                arrowSize = ctxpopup._ui.arrow[arrow][coord.outerSize](true),
-                payloadBeg = self.element.offset()[coord.beg],
-                payloadSize = self.element[coord.outerSize](true),
-                triangleSize = ctxpopup._ui.arrow[arrow][coord.triangleSize](),
-                triangleOffset = 
-                    Math.max(
-                        triangleSize // triangle size
-                            + Math.max(0, payloadBeg - arrowBeg), // lowerDiff
-                        Math.min(
-                            arrowSize // bottom
-                                - triangleSize // triangle size
-                                - Math.max(0, arrowBeg + arrowSize - (payloadBeg + payloadSize)), // upperDiff
-                            arrowSize / 2 // arrow unrestricted offset
-                                + desired[coord.point]
-                                - orig[coord.point]
-                                - halfSize[coord.size])),
-                // Triangle points here
-                final = {
-                    "x": orig.x + ( isHorizontal ? triangleOffset : 0) + ("r" === arrow ? size.cx : 0),
-                    "y": orig.y + (!isHorizontal ? triangleOffset : 0) + ("b" === arrow ? size.cy : 0)
-                },
-                ret = {
-                    actual         : orig,
-                    triangleOffset : triangleOffset,
-                    absDiff        : Math.abs(x - final.x) + Math.abs(y - final.y)
-                };
-
-            // Hide it back
-            ctxpopup._ui.arrow[arrow].hide();
-
-            return ret;
-        }
-
-        coords = {
-            l : getCoords("l",  1,  0),
-            r : getCoords("r", -1,  0),
-            t : getCoords("t",  0,  1),
-            b : getCoords("b",  0, -1)
-        };
-
-        $.each(coords, function(key, value) {
-            if (minDiff === undefined || value.absDiff < minDiff) {
-                minDiff = value.absDiff;
-                minDiffIdx = key;
-            }
-        });
-
-        // Side-effect: show the appropriate arrow and move it to the right offset
-        ctxpopup._ui.arrow[minDiffIdx]
-            .show()
-            .triangle("option", "offset", coords[minDiffIdx].triangleOffset);
-        return coords[minDiffIdx].actual;
-    }
-    else
-        return orig_placementCoords.call(this, x, y, cx, cy);
-};
-
-$.tizen.popupwindow.prototype.open = function(x, y) {
-    var ctxpopup = this.element.data("ctxpopup");
-
-    if (ctxpopup) {
-        this._setShadow(false);
-        this._setCorners(false);
-        this._setOverlayTheme(null);
-        this._setOption("overlayTheme", ctxpopup.options.overlayTheme);
-        ctxpopup._ui.arrow.all.triangle("option", "color", ctxpopup._ui.container.css("background-color"));
-
-               // temporary
-               $('.ui-popupwindow').css('background', 'none');
-    }
-
-    origOpen.call(this, x, y);
-};
-
-//auto self-init widgets
-$( document ).bind( "pagecreate create", function( e ){
-    var ctxpopups = $($.tizen.ctxpopup.prototype.options.initSelector, e.target);
-    $.tizen.ctxpopup.prototype.enhanceWithin( e.target );
-
-});
-
-})(jQuery);
+(function ( $, undefined ) {
+       $.widget( "tizen.ctxpopup", $.tizen.widgetex, {
+               options: $.extend( {}, $.tizen.popupwindow.prototype.options, {
+                       initSelector: ":not(:not(" + $.tizen.popupwindow.prototype.options.initSelector + ")):not(:not(:jqmData(show-arrow='true'), :jqmData(show-arrow)))"
+               } ),
+
+               _htmlProto: {
+                       ui: {
+                               outer           : "#outer",
+                               container       : "#container", // the key has to have the name "container"
+                               arrow           : {
+                                       all             : ":jqmData(role='triangle')",
+                                       l               : "#left",
+                                       t               : "#top",
+                                       r               : "#right",
+                                       b               : "#bottom"
+                               }
+                       }
+               },
+
+               _create: function () {
+                       if ( !this.element.data( "popupwindow" ) ) {
+                               this.element.popupwindow();
+                       }
+
+                       this.element.data( "popupwindow" )
+                               ._ui.container
+                               .removeClass( "ui-popupwindow-padding" )
+                               .append( this._ui.outer );
+                       this._ui.outer.trigger( "create" ); // Creates the triangle widgets
+                       this._ui.container
+                               .addClass( "ui-popupwindow-padding" )
+                               .append( this.element );
+               },
+
+               _setOption: function ( key, value ) {
+                       $.tizen.popupwindow.prototype._setOption.apply( this.element.data( "popupwindow" ), arguments );
+                       this.options[key] = value;
+               }
+       } );
+
+       var origOpen = $.tizen.popupwindow.prototype.open,
+               orig_setOption = $.tizen.popupwindow.prototype._setOption,
+               orig_placementCoords = $.tizen.popupwindow.prototype._placementCoords;
+
+       $.tizen.popupwindow.prototype._setOption = function ( key, value ) {
+               var ctxpopup = this.element.data( "ctxpopup" ),
+                       needsApplying = true,
+                       origContainer;
+               if ( ctxpopup ) {
+                       if ( "shadow" === key || "overlayTheme" === key || "corners" === key ) {
+                               origContainer = this._ui.container;
+
+                               this._ui.container = ctxpopup._ui.container;
+                               orig_setOption.apply( this, arguments );
+                               this._ui.container = origContainer;
+                               needsApplying = false;
+                       }
+                       ctxpopup.options[key] = value;
+               }
+
+               if ( needsApplying ) {
+                       orig_setOption.apply(this, arguments);
+               }
+       };
+
+       $.tizen.popupwindow.prototype._placementCoords = function ( x, y, cx, cy ) {
+               var ctxpopup = this.element.data( "ctxpopup" ),
+                       self = this,
+                       coords = {},
+                       minDiff,
+                       minDiffIdx;
+
+               function getCoords( arrow, x_factor, y_factor ) {
+                       // Unhide the arrow we want to test to take it into account
+                       ctxpopup._ui.arrow.all.hide();
+                       ctxpopup._ui.arrow[arrow].show();
+
+                       var isHorizontal = ( "b" === arrow || "t" === arrow ),
+                       // Names of keys used in calculations depend on whether things are horizontal or not
+                               coord = ( isHorizontal
+                                               ? { point: "x", size: "cx", beg: "left", outerSize: "outerWidth",  niceSize: "width", triangleSize : "height" }
+                                               : { point: "y", size: "cy", beg: "top",  outerSize: "outerHeight", niceSize: "height", triangleSize : "width" } ),
+                               size = {
+                                       cx : self._ui.container.width(),
+                                       cy : self._ui.container.height()
+                               },
+                               halfSize = {
+                                       cx : size.cx / 2,
+                                       cy : size.cy / 2
+                               },
+                               desired = {
+                                       "x" : x + halfSize.cx * x_factor,
+                                       "y" : y + halfSize.cy * y_factor
+                               },
+                               orig = orig_placementCoords.call( self, desired.x, desired.y, size.cx, size.cy ),
+
+                       // The triangleOffset must be clamped to the range described below:
+                       //
+                       //                          +-------...
+                       //                          |   /\
+                       //                          |  /  \
+                       //                   ----+--+-,-----...
+                       //lowerDiff       -->____|  |/ <-- possible rounded corner
+                       //triangle size   -->    | /|
+                       //                   ____|/ |
+                       //                    ^  |\ | <-- lowest possible offset for triangle
+                       // actual range of    |  | \| 
+                       // arrow offset       |  |  | 
+                       // values due to      |  .  . Payload table cell looks like
+                       // possible rounded   |  .  . a popup window, and it may have
+                       // corners and arrow  |  .  . arbitrary things like borders,
+                       // triangle size -    |  |  | shadows, and rounded corners.
+                       // our clamp range    |  | /|
+                       //                   _v__|/ |
+                       //triangle size   -->    |\ | <-- highest possible offset for triangle
+                       //                   ____| \|
+                       //upperDiff       -->    |  |\ <-- possible rounded corner
+                       //                   ----+--+-'-----...
+                       //                          |  \  /
+                       //                          |   \/
+                       //                          +-------...
+                       //
+                       // We calculate lowerDiff and upperDiff by considering the offset and width of the payload (this.element)
+                       // versus the offset and width of the element enclosing the triangle, because the payload is inside
+                       // whatever decorations (such as borders, shadow, rounded corners) and thus can give a reliable indication
+                       // of the thickness of the combined decorations
+
+                               arrowBeg = ctxpopup._ui.arrow[arrow].offset()[coord.beg],
+                               arrowSize = ctxpopup._ui.arrow[arrow][coord.outerSize]( true ),
+                               payloadBeg = self.element.offset()[coord.beg],
+                               payloadSize = self.element[coord.outerSize]( true ),
+                               triangleSize = ctxpopup._ui.arrow[arrow][coord.triangleSize](),
+                               triangleOffset =
+                                       Math.max(
+                                               triangleSize // triangle size
+                                                       + Math.max( 0, payloadBeg - arrowBeg ), // lowerDiff
+                                               Math.min(
+                                                               arrowSize // bottom
+                                                                       - triangleSize // triangle size
+                                                                       - Math.max( 0, arrowBeg + arrowSize - ( payloadBeg + payloadSize ) ), // upperDiff
+                                                               arrowSize / 2 // arrow unrestricted offset
+                                                                       + desired[coord.point]
+                                                                       - orig[coord.point]
+                                                                       - halfSize[coord.size] 
+                                                       )
+                                       ),
+                                       // Triangle points here
+                               final = {
+                                       "x": orig.x + ( isHorizontal ? triangleOffset : 0) + ("r" === arrow ? size.cx : 0),
+                                       "y": orig.y + (!isHorizontal ? triangleOffset : 0) + ("b" === arrow ? size.cy : 0)
+                               },
+                               ret = {
+                                       actual                  : orig,
+                                       triangleOffset  : triangleOffset,
+                                       absDiff                 : Math.abs( x - final.x ) + Math.abs( y - final.y )
+                               };
+
+                       // Hide it back
+                       ctxpopup._ui.arrow[arrow].hide();
+
+                       return ret;
+               }
+
+               if ( ctxpopup ) {
+                       // Returns:
+                       // {
+                       //    absDiff: int
+                       //    triangleOffset: int
+                       //    actual: { x: int, y: int }
+                       // }
+
+                       coords = {
+                               l : getCoords( "l", 1, 0 ),
+                               r : getCoords( "r", -1, 0 ),
+                               t : getCoords( "t", 0, 1 ),
+                               b : getCoords( "b", 0, -1 )
+                       };
+
+                       $.each( coords, function ( key, value ) {
+                               if ( minDiff === undefined || value.absDiff < minDiff ) {
+                                       minDiff = value.absDiff;
+                                       minDiffIdx = key;
+                               }
+                       } );
+
+                       // Side-effect: show the appropriate arrow and move it to the right offset
+                       ctxpopup._ui.arrow[minDiffIdx]
+                               .show()
+                               .triangle( "option", "offset", coords[minDiffIdx].triangleOffset );
+                       return coords[minDiffIdx].actual;
+               }
+
+               return orig_placementCoords.call( this, x, y, cx, cy );
+       };
+
+       $.tizen.popupwindow.prototype.open = function ( x, y ) {
+               var ctxpopup = this.element.data( "ctxpopup" );
+
+               if ( ctxpopup ) {
+                       this._setShadow( false );
+                       this._setCorners( false );
+                       this._setOverlayTheme( null );
+                       this._setOption( "overlayTheme", ctxpopup.options.overlayTheme );
+                       ctxpopup._ui.arrow.all.triangle( "option", "color", ctxpopup._ui.container.css( "background-color" ) );
+
+                       // temporary
+                       $( '.ui-popupwindow' ).css( 'background', 'none' );
+               }
+
+               origOpen.call( this, x, y );
+       };
+
+       //auto self-init widgets
+       $( document ).bind( "pagecreate create", function ( e ) {
+               var ctxpopups = $( $.tizen.ctxpopup.prototype.options.initSelector, e.target );
+               $.tizen.ctxpopup.prototype.enhanceWithin( e.target );
+       } );
+}( jQuery ) );
old mode 100644 (file)
new mode 100755 (executable)
index df04424..dab829f
@@ -1,6 +1,28 @@
+/* ***************************************************************************
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software" ),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ */
 // progress
-(function ($, window, undefined) {
-       $.widget("tizen.progress", $.mobile.widget, {
+(function ( $, window, undefined) {
+       $.widget( "tizen.progress", $.mobile.widget, {
                options: {
                        style: "circle",
                        running: false
 
                _show: function () {
                        if ( !this.init ) {
-                               $(this.element).append(this.html);
+                               $( this.element ).append( this.html );
                                this.init = true;
                        }
                        var style = this.options.style;
-                       $(this.element).addClass("ui-progress-container-" + style+ "-bg");
-                       $(this.element).find(".ui-progress-"+style )
+                       $( this.element ).addClass( "ui-progress-container-" + style + "-bg" );
+                       $( this.element )
+                               .find( ".ui-progress-" + style )
                                .addClass( this.runningClass );
                },
 
                _hide: function () {
-                       $(this.element).find(".ui-progress-"+ this.options.style )
+                       $( this.element )
+                               .find( ".ui-progress-" + this.options.style )
                                .removeClass( this.runningClass );
                },
 
-               running: function( newRunning ) {
+               running: function ( newRunning ) {
                        // get value
                        if ( newRunning === undefined ) {
                                return this.options.running;
                        return this;
                },
 
-               _setOption: function( key, value ) {
+               _setOption: function ( key, value ) {
                        if ( key === "running" ) {
                                // normalize invalid value
                                if ( typeof value !== "boolean" ) {
-                                       alert("running value MUST be boolean type!");
+                                       window.alert( "running value MUST be boolean type!" );
                                        return;
                                }
                                this.options.running = value;
                        }
                },
 
-               _refresh: function() {
-                       if ( this.options.running )
+               _refresh: function () {
+                       if ( this.options.running ) {
                                this._show();
-                       else
+                       } else {
                                this._hide();
+                       }
                },
 
                _create: function () {
                        var self = this,
-                       element = this.element,
-                       style = element.jqmData( "style" );
+                               element = this.element,
+                               style = element.jqmData( "style" ),
+                               runningClass;
 
-                       if ( style )
+                       if ( style ) {
                                this.options.style = style;
+                       }
 
-                       this.html = $('<div class="ui-progress-container-'+ style + '">' +
+                       this.html = $( '<div class="ui-progress-container-' + style + '">' +
                                        '<div class="ui-progress-' + style + '"></div>' +
-                                       '</div>');
-                       var runningClass = "ui-progress-" + style + "-running";
+                                       '</div>' );
+
+                       runningClass = "ui-progress-" + style + "-running";
 
                        $.extend( this, {
                                init: false,
                                runningClass: runningClass
-                       });
+                       } );
                        this._refresh();
-               },
-       }); /* End of widget */
+               }
+       } ); /* End of widget */
 
        // auto self-init widgets
-       $(document).bind("pagecreate", function (e) {
-               $(e.target).find(":jqmData(role='progress')").progress();
-       });
-})(jQuery, this);
+       $( document ).bind( "pagecreate", function ( e ) {
+               $( e.target ).find( ":jqmData(role='progress')" ).progress();
+       } );
+}(jQuery, this));
old mode 100644 (file)
new mode 100755 (executable)
index 982f595..7ceba83
@@ -1,4 +1,3 @@
-/* TBD */
 /*
  * jQuery UI Progressbar @VERSION
  *
  */
 /* This is from jquery ui plugin - progressbar 11/16/2011 */
 
-(function( $, window, undefined ) {
-
-$.widget( "tizen.progressbar", $.mobile.widget, {
-       options: {
-               value: 0,
-               max: 100
-       },
-
-       min: 0,
-
-       _create: function() {
-               this.element
-                       .addClass( "ui-progressbar" )
-                       .attr({
-                               role: "progressbar",
-                               "aria-valuemin": this.min,
-                               "aria-valuemax": this.options.max,
-                               "aria-valuenow": this._value()
-                       });
-
-               this.valueDiv = $( "<div class='ui-progressbar-value'></div>" )
-                       .appendTo( this.element );
-
-               this.oldValue = this._value();
-               this._refreshValue();
-       },
-
-       _destroy: function() {
-               this.element
-                       .removeClass( "ui-progressbar" )
-                       .removeAttr( "role" )
-                       .removeAttr( "aria-valuemin" )
-                       .removeAttr( "aria-valuemax" )
-                       .removeAttr( "aria-valuenow" );
-
-               this.valueDiv.remove();
-       },
-
-       value: function( newValue ) {
-               if ( newValue === undefined ) {
-                       return this._value();
-               }
+(function ( $, window, undefined ) {
+
+       $.widget( "tizen.progressbar", $.mobile.widget, {
+               options: {
+                       value: 0,
+                       max: 100
+               },
+
+               min: 0,
 
-               this._setOption( "value", newValue );
-               return this;
-       },
+               _create: function () {
+                       this.element
+                               .addClass( "ui-progressbar" )
+                               .attr( {
+                                       role: "progressbar",
+                                       "aria-valuemin": this.min,
+                                       "aria-valuemax": this.options.max,
+                                       "aria-valuenow": this._value()
+                               } );
 
-       _setOption: function( key, value ) {
-               if ( key === "value" ) {
-                       this.options.value = value;
+                       this.valueDiv = $( "<div class='ui-progressbar-value'></div>" )
+                               .appendTo( this.element );
+
+                       this.oldValue = this._value();
                        this._refreshValue();
-                       if ( this._value() === this.options.max ) {
-                               this._trigger( "complete" );
+               },
+
+               _destroy: function () {
+                       this.element
+                               .removeClass( "ui-progressbar" )
+                               .removeAttr( "role" )
+                               .removeAttr( "aria-valuemin" )
+                               .removeAttr( "aria-valuemax" )
+                               .removeAttr( "aria-valuenow" );
+
+                       this.valueDiv.remove();
+               },
+
+               value: function ( newValue ) {
+                       if ( newValue === undefined ) {
+                               return this._value();
                        }
-               }
-               // jquery.ui.widget.js MUST be updated to new version!
-               //this._super( "_setOption", key, value );
-       },
-
-       _value: function() {
-               var val = this.options.value;
-               // normalize invalid value
-               if ( typeof val !== "number" ) {
-                       val = 0;
-               }
-               return Math.min( this.options.max, Math.max( this.min, val ) );
-       },
 
-       _percentage: function() {
-               return 100 * this._value() / this.options.max;
-       },
+                       this._setOption( "value", newValue );
+                       return this;
+               },
+
+               _setOption: function ( key, value ) {
+                       if ( key === "value" ) {
+                               this.options.value = value;
+                               this._refreshValue();
+                               if ( this._value() === this.options.max ) {
+                                       this._trigger( "complete" );
+                               }
+                       }
+                       // jquery.ui.widget.js MUST be updated to new version!
+                       //this._super( "_setOption", key, value );
+               },
+
+               _value: function () {
+                       var val = this.options.value;
+                       // normalize invalid value
+                       if ( typeof val !== "number" ) {
+                               val = 0;
+                       }
+                       return Math.min( this.options.max, Math.max( this.min, val ) );
+               },
 
-       _refreshValue: function() {
-               var value = this.value();
-               var percentage = this._percentage();
+               _percentage: function () {
+                       return 100 * this._value() / this.options.max;
+               },
 
-               if ( this.oldValue !== value ) {
-                       this.oldValue = value;
-                       this._trigger( "change" );
-               }
+               _refreshValue: function () {
+                       var value = this.value(),
+                               percentage = this._percentage();
 
-               this.valueDiv
-                       .toggle( value > this.min )
-                       .width( percentage.toFixed(0) + "%" );
-               this.element.attr( "aria-valuenow", value );
-       }
-});
+                       if ( this.oldValue !== value ) {
+                               this.oldValue = value;
+                               this._trigger( "change" );
+                       }
+
+                       this.valueDiv
+                               .toggle( value > this.min )
+                               .width( percentage.toFixed(0) + "%" );
+                       this.element.attr( "aria-valuenow", value );
+               }
+       } );
 
-// auto self-init widgets
-$(document).bind("pagecreate", function (e) {
-       $(e.target).find(":jqmData(role='progressbar')").progressbar();
-});
+       // auto self-init widgets
+       $( document ).bind( "pagecreate", function ( e ) {
+               $( e.target ).find( ":jqmData(role='progressbar')" ).progressbar();
+       } );
 
-})( jQuery, this );
+}( jQuery, this ) );
index c6fea5b..01ca81b 100755 (executable)
@@ -1,14 +1,37 @@
+/* ***************************************************************************
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ */
 /*
 * jQuery Mobile Framework : "textinput" plugin for text inputs, textareas
 * Copyright (c) jQuery Project
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 * Authors: Jinhyuk Jun <jinhyuk.jun@samsung.com>
+*          Wongi Lee <wongi11.lee@samsung.com>
 */
 
 /**
- * Searchbar can be created using <input> element with type=tizen-search
- * <input type="tizen-search" name="search" id="search1" value=""  />
+ * Searchbar can be created using <input> element with type=search
+ * <input type="search" name="search" id="search1" value=""  />
  *
  * Searchbar can be inserted 3 cases
  * content : seachbar behave same as content element
  *
  * Examples:
  *
- *     HTML markup for creating Searchbar
- *         <input type="tizen-search"/>
+ *     HTML markup for creating Searchbar
+ *             <input type="search"/>
  *
- *     How to make searchbar in content
- *         <input type="tizen-search" name="" id="" value=""  />
+ *     How to make searchbar in content
+ *             <input type="search" name="" id="" value=""  />
  *
- *     How to make searchbar in title
- *         <div data-role="header" data-position ="fixed" >
- *                <h1>Searchbar</h1>
- *             <input type="tizen-search" name="" id="" value=""  />
- *         </div>
+ *     How to make searchbar in title
+ *             <div data-role="header" data-position ="fixed" >
+ *                     <h1>Searchbar</h1>
+ *                     <input type="search" name="" id="" value=""  />
+ *             </div>
  *
- *     How to make searchbar inside optionheader
- *         <div data-role="header" data-position ="fixed" >
- *                <h1>Searchbar</h1>
- *             <div id="myoptionheader2" data-role="optionheader">
- *                 <input type="tizen-search" name="" id="" value=""  />
- *             </div>
- *         </div>
+ *     How to make searchbar inside optionheader
+ *             <div data-role="header" data-position ="fixed" >
+ *                     <h1>Searchbar</h1>
+ *                     <div id="myoptionheader2" data-role="optionheader">
+ *                             <input type="search" name="" id="" value=""  />
+ *                     </div>
+ *             </div>
 */
 
-(function( $, undefined ) {
-
-$.widget( "tizen.searchbar", $.mobile.widget, {
-       options: {
-               theme: null,
-               initSelector: "input[type='tizen-search'],:jqmData(type='tizen-search')"
-       },
-
-       _create: function() {
-
-               var input = this.element,
-                       o = this.options,
-                       theme = o.theme || $.mobile.getInheritedTheme( this.element, "c" ),
-                       themeclass  = " ui-body-" + theme,
-                       focusedEl, clearbtn,
-                       currentPage = input.closest(".ui-page");
-               
-               $( "label[for='" + input.attr( "id" ) + "']" ).addClass( "ui-input-text" );
-
-               focusedEl = input.addClass("ui-input-text ui-body-"+ theme );
-
-               // XXX: Temporary workaround for issue 785 (Apple bug 8910589).
-               //      Turn off autocorrect and autocomplete on non-iOS 5 devices
-               //      since the popup they use can't be dismissed by the user. Note
-               //      that we test for the presence of the feature by looking for
-               //      the autocorrect property on the input element. We currently
-               //      have no test for iOS 5 or newer so we're temporarily using
-               //      the touchOverflow support flag for jQM 1.0. Yes, I feel dirty. - jblas
-               if ( typeof input[0].autocorrect !== "undefined" && !$.support.touchOverflow ) {
-                       // Set the attribute instead of the property just in case there
-                       // is code that attempts to make modifications via HTML.
-                       input[0].setAttribute( "autocorrect", "off" );
-                       input[0].setAttribute( "autocomplete", "off" );
-               }
+(function ( $, undefined ) {
+
+       $.widget( "tizen.searchbar", $.mobile.widget, {
+               options: {
+                       theme: null,
+                       initSelector: "input[type='search'],:jqmData(type='search'), input[type='tizen-search'],:jqmData(type='tizen-search')"
+               },
+
+               _create: function () {
+                       var input = this.element,
+                               o = this.options,
+                               theme = o.theme || $.mobile.getInheritedTheme( this.element, "c" ),
+                               themeclass  = " ui-body-" + theme,
+                               focusedEl,
+                               clearbtn,
+                               currentPage = input.closest( ".ui-page" ),
+                               searchicon,
+                               cancelbtn,
+                               defaultText,
+                               defaultTextClass,
+                               trimedText,
+                               newClassName,
+                               newStyle,
+                               newDiv,
+                               inputedText,
+                               extraLineHeight,
+                               keyupTimeoutBuffer,
+                               keyup,
+                               keyupTimeout;
+
+                       function toggleClear() {
+                               if ( !input.val() ) {
+                                       clearbtn.addClass( "ui-input-clear-hidden" );
+                               } else {
+                                       clearbtn.removeClass( "ui-input-clear-hidden" );
+                               }
+                       }
+
+                       function showCancel() {
+                               focusedEl
+                                       .addClass( "ui-input-search-default" )
+                                       .removeClass( "ui-input-search-wide" );
+                               cancelbtn
+                                       .addClass( "ui-btn-cancel-show" )
+                                       .removeClass( "ui-btn-cancel-hide" );
+                               searchicon.hide();
+                       }
+
+                       function hideCancel() {
+                               focusedEl
+                                       .addClass( "ui-input-search-wide" )
+                                       .removeClass( "ui-input-search-default" );
+                               cancelbtn
+                                       .addClass( "ui-btn-cancel-hide" )
+                                       .removeClass( "ui-btn-cancel-show" );
+
+                               if ( input.val() == "" ) {
+                                       searchicon.show();
+                               }
+
+                               toggleClear();
+                       }
+
+                       $( "label[for='" + input.attr( "id" ) + "']" ).addClass( "ui-input-text" );
+
+                       focusedEl = input.addClass( "ui-input-text ui-body-" + theme );
+
+                       // XXX: Temporary workaround for issue 785 (Apple bug 8910589).
+                       //      Turn off autocorrect and autocomplete on non-iOS 5 devices
+                       //      since the popup they use can't be dismissed by the user. Note
+                       //      that we test for the presence of the feature by looking for
+                       //      the autocorrect property on the input element. We currently
+                       //      have no test for iOS 5 or newer so we're temporarily using
+                       //      the touchOverflow support flag for jQM 1.0. Yes, I feel dirty. - jblas
+                       if ( typeof input[0].autocorrect !== "undefined" && !$.support.touchOverflow ) {
+                               // Set the attribute instead of the property just in case there
+                               // is code that attempts to make modifications via HTML.
+                               input[0].setAttribute( "autocorrect", "off" );
+                               input[0].setAttribute( "autocomplete", "off" );
+                       }
+
+                       focusedEl = input.wrap( "<div class='ui-input-search ui-shadow-inset ui-corner-all ui-btn-shadow" + themeclass + "'></div>" ).parent();
+                       clearbtn = $( "<a href='#' class='ui-input-clear' title='clear text'>clear text</a>" )
+                               .tap( function ( event ) {
+                                       event.preventDefault();
+                                       event.stopPropagation();
+
+                                       input.val( "" )
+                                               .blur()
+                                               .focus()
+                                               .trigger( "change" )
+                                               .trigger( "input" );
+                                       clearbtn.addClass( "ui-input-clear-hidden" );
+                               } )
+                               .appendTo( focusedEl )
+                               .buttonMarkup({
+                                       icon: "deleteSearch",
+                                       iconpos: "notext",
+                                       corners: true,
+                                       shadow: true
+                               } );
+
+                       toggleClear();
+
+                       input.keyup( toggleClear );
+
+                       input.bind( 'paste cut keyup focus change blur', toggleClear );
+
+                       //SLP --start search bar with cancel button
+                       focusedEl.wrapAll( "<div class='input-search-bar'></div>" );
+
+                       input.tap( function ( event ) {
+                               inputedText = input.val();
+                               input
+                                       .blur()
+                                       .focus();
+                       } );
 
-               focusedEl = input.wrap( "<div class='ui-input-search ui-shadow-inset ui-corner-all ui-btn-shadow" + themeclass + "'></div>" ).parent();
-               clearbtn = $( "<a href='#' class='ui-input-clear' title='clear text'>clear text</a>" )
-               .tap(function( event ) {
-                       input.val( "" )
-                               .blur()
-                               .focus()
-                               .trigger( "change" )
-                               .trigger( "input" );
-                       clearbtn.addClass( "ui-input-clear-hidden" );
-                       event.stopPropagation();
-               })
-               .appendTo( focusedEl )
-               .buttonMarkup({
-                       icon: "deleteSearch",
-                       iconpos: "notext",
-                       corners: true,
-                       shadow: true
-               });
-               
-               toggleClear();
-               
-               input.keyup( toggleClear );
-               
-               input.bind('paste cut keyup focus change blur', toggleClear);
-
-               //SLP --start search bar with cancel button
-               focusedEl.wrapAll( "<div class='input-search-bar'></div>" );
-
-               input.tap(function( event ) {
-                       var inputedText = input.val();
-                       input.blur();
-                       input.focus();
-               });
-
-               var searchicon = $("<div class='ui-image-search ui-image-searchfield'></div>");
-               searchicon.tap(function( event ) {
-                       searchicon.hide();
-                       
-                       input
-                               .blur()
-                               .focus();
-               })
-               .appendTo( focusedEl );
-
-               var cancelbtn = $( "<a href='#' class='ui-input-cancel' title='clear text'>Cancel</a>" )
-               .tap(function( event ) {
-                       input.val( "" );
-                       hideCancel();
-                       input.blur();
-                       input.trigger( "change" );
-                       event.stopPropagation();
-               })
-               .appendTo( focusedEl.parent() )
-               .buttonMarkup({
-                       iconpos: "cancel",
-                       corners: true,
-                       shadow: true
-               });
-
-               // Input Focused
-               input.focus(function() {
-                       showCancel();
-                       focusedEl.addClass( "ui-focus" );
-               });
-               
-               // Input Blured
-               /* When user touch on page, it's same to blur */
-               $("form.search").tap(function( event ){
-                       input.focus();
-                       event.stopPropagation();
-               });
-
-               $( currentPage ).bind("vclick", function(e) {
-                       focusedEl.removeClass( "ui-focus" );
-                       hideCancel();
-                       input.trigger( "change" );
-               });
-
-               // Autogrow
-               if ( input.is( "textarea" ) ) {
-                       var extraLineHeight = 15,
-                               keyupTimeoutBuffer = 100,
-                               keyup = function() {
+                       searchicon = $("<div class='ui-image-search ui-image-searchfield'></div>");
+                       searchicon
+                               .tap( function ( event ) {
+                                       searchicon.hide();
+
+                                       input
+                                               .blur()
+                                               .focus();
+                               } )
+                               .appendTo( focusedEl );
+
+                       cancelbtn = $( "<a href='#' class='ui-input-cancel' title='clear text'>Cancel</a>" )
+                               .tap(function ( event ) {
+                                       event.preventDefault();
+                                       event.stopPropagation();
+
+                                       input
+                                               .val( "" )
+                                               .blur()
+                                               .trigger( "change" );
+
+                                       hideCancel();
+                               } )
+                               .appendTo( focusedEl.parent() )
+                               .buttonMarkup( {
+                                       iconpos: "cancel",
+                                       corners: true,
+                                       shadow: true
+                               } );
+
+                       // Input Focused
+                       input.focus( function () {
+                               showCancel();
+                               focusedEl.addClass( "ui-focus" );
+                       } );
+
+                       // Input Blured
+                       /* When user touch on page, it's same to blur */
+                       $( "div.input-search-bar" ).tap( function ( event ) {
+                               input.focus();
+                               event.stopPropagation();
+                       } );
+
+                       $( currentPage ).bind("tap", function ( e ) {
+                               focusedEl.removeClass( "ui-focus" );
+                               hideCancel();
+                               input.trigger( "change" );
+                       } );
+
+                       // Autogrow
+                       if ( input.is( "textarea" ) ) {
+                               extraLineHeight = 15;
+                               keyupTimeoutBuffer = 100;
+                               keyup = function () {
                                        var scrollHeight = input[ 0 ].scrollHeight,
                                                clientHeight = input[ 0 ].clientHeight;
 
                                        if ( clientHeight < scrollHeight ) {
                                                input.height(scrollHeight + extraLineHeight);
                                        }
-                               },
-                               keyupTimeout;
+                               };
 
-                               input.keyup(function() {
+                               input.keyup( function () {
                                        clearTimeout( keyupTimeout );
                                        keyupTimeout = setTimeout( keyup, keyupTimeoutBuffer );
                                });
 
-                       // binding to pagechange here ensures that for pages loaded via
-                       // ajax the height is recalculated without user input
-                       $( document ).one( "pagechange", keyup );
+                               // binding to pagechange here ensures that for pages loaded via
+                               // ajax the height is recalculated without user input
+                               $( document ).one( "pagechange", keyup );
 
-                       // Issue 509: the browser is not providing scrollHeight properly until the styles load
-                       if ( $.trim( input.val() ) ) {
-                               // bind to the window load to make sure the height is calculated based on BOTH
-                               // the DOM and CSS
-                               $( window ).load( keyup );
+                               // Issue 509: the browser is not providing scrollHeight properly until the styles load
+                               if ( $.trim( input.val() ) ) {
+                                       // bind to the window load to make sure the height is calculated based on BOTH
+                                       // the DOM and CSS
+                                       $( window ).load( keyup );
+                               }
                        }
-               }
 
-               // Default Text
-               var defaultText = input.jqmData("default-text");
-               
-               if ((defaultText != undefined) && (defaultText.length > 0))
-               {
-                       var defaultTextClass = "ui-input-default-text";
-                       var trimedText = defaultText.replace(/\s/g, "");
-
-                       /* Make new class for default text string */
-                       var newClassName = defaultTextClass + "-" + trimedText;
-                       var newStyle = $("<style>" + '.' + newClassName + ":after" + "{content:" + "'" + defaultText + "'"+ "}" + "</style>");
-                       $('html > head').append(newStyle);
-
-                       /* Make new empty <DIV> for default text */
-                       var newDiv = $("<div></div>");                  
-                       
-                       /* Add class and append new div */
-                       newDiv.addClass(defaultTextClass);
-                       newDiv.addClass(newClassName);
-                       newDiv.tap(function( event ) {
-                               input.blur();
-                               input.focus();
-                       });
-                       
-                       input.parent().append(newDiv);
-                       
-                       /* When focus, default text will be hide. */
-                       input.focus(function() {
-                               input.parent().find("div.ui-input-default-text").addClass( "ui-input-default-hidden" );
-                       })
-                       .blur(function(){
-                               var inputedText = input.val();
-                               if (inputedText.length > 0)     {
-                                       input.parent().find("div.ui-input-default-text").addClass( "ui-input-default-hidden" );
-                               }
-                               else {
-                                       input.parent().find("div.ui-input-default-text").removeClass( "ui-input-default-hidden" );
-                               }
-                       });                     
-               }
-               
-               function toggleClear() {
-                       if ( !input.val() ) {
-                               clearbtn.addClass( "ui-input-clear-hidden" );
-                       } else {
-                               clearbtn.removeClass( "ui-input-clear-hidden" );
+                       // Default Text
+                       defaultText = input.jqmData( "default-text" );
+
+                       if ( ( defaultText != undefined ) && ( defaultText.length > 0 ) ) {
+                               defaultTextClass = "ui-input-default-text";
+                               trimedText = defaultText.replace(/\s/g, "");
+
+                               /* Make new class for default text string */
+                               newClassName = defaultTextClass + "-" + trimedText;
+                               newStyle = $( "<style>" + '.' + newClassName + ":after" + "{content:" + "'" + defaultText + "'" + "}" + "</style>" );
+                               $( 'html > head' ).append( newStyle );
+
+                               /* Make new empty <DIV> for default text */
+                               newDiv = $( "<div></div>" );
+
+                               /* Add class and append new div */
+                               newDiv.addClass( defaultTextClass );
+                               newDiv.addClass( newClassName );
+                               newDiv.tap( function ( event ) {
+                                       input.blur();
+                                       input.focus();
+                               } );
+
+                               input.parent().append( newDiv );
+
+                               /* When focus, default text will be hide. */
+                               input
+                                       .focus( function () {
+                                               input.parent().find( "div.ui-input-default-text" ).addClass( "ui-input-default-hidden" );
+                                       } )
+                                       .blur( function () {
+                                               var inputedText = input.val();
+                                               if ( inputedText.length > 0 ) {
+                                                       input.parent().find( "div.ui-input-default-text" ).addClass( "ui-input-default-hidden" );
+                                               } else {
+                                                       input.parent().find( "div.ui-input-default-text" ).removeClass( "ui-input-default-hidden" );
+                                               }
+                                       } );
                        }
+               },
+
+               disable: function () {
+                       this.element.attr( "disabled", true );
+                       this.element.parent().addClass( "ui-disabled" );
+               },
+
+               enable: function () {
+                       this.element.attr( "disabled", false );
+                       this.element.parent().removeClass( "ui-disabled" );
                }
-               
-               function showCancel() {
-                       focusedEl.addClass( "ui-input-search-default" )
-                       .removeClass( "ui-input-search-wide" );
-                       cancelbtn.addClass( "ui-btn-cancel-show" )
-                       .removeClass( "ui-btn-cancel-hide" );
-                       searchicon.hide();
-               }
+       } );
 
-               function hideCancel() {
-                       focusedEl.addClass( "ui-input-search-wide" )
-                       .removeClass( "ui-input-search-default" );
-                       cancelbtn.addClass( "ui-btn-cancel-hide" )
-                       .removeClass( "ui-btn-cancel-show" );
-                       
-                       if( input.val() =="" ) {
-                               searchicon.show();
-                       }
-                       
-                       toggleClear();
-               }               
-       },
-
-       disable: function(){
-               ( this.element.attr( "disabled", true ).is( "[type='tizen-search'],:jqmData(type='tizen-search')" ) ?
-                       this.element.parent() : this.element ).addClass( "ui-disabled" );
-       },
-
-       enable: function(){
-               ( this.element.attr( "disabled", false).is( "[type='tizen-search'],:jqmData(type='tizen-search')" ) ?
-                       this.element.parent() : this.element ).removeClass( "ui-disabled" );
-       }
-});
-
-//auto self-init widgets
-$( document ).bind( "pagecreate create", function( e ){
-       $.tizen.searchbar.prototype.enhanceWithin( e.target );
-});
-
-})( jQuery );
+       //auto self-init widgets
+       $( document ).bind( "pagecreate create", function ( e ) {
+               $.tizen.searchbar.prototype.enhanceWithin( e.target );
+       } );
+
+}( jQuery ) );
old mode 100644 (file)
new mode 100755 (executable)
index 60f732f..ff214d7
@@ -5,7 +5,8 @@
  * http://www.opensource.org/licenses/mit-license.php)
  *
  * ***************************************************************************
- * Copyright (C) 2011 by Intel Corporation Ltd.
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2011 by Intel Corporation Ltd.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
 // If a listview has no dividers or a single divider, the widget won't
 // display.
 
-(function( $, undefined ) {
-
-$.widget( "tizen.shortcutscroll", $.mobile.widget, {
-    options: {
-        initSelector: ":jqmData(shortcutscroll)"
-    },
-
-    _create: function () {
-        var $el = this.element,
-            self = this,
-            $popup,
-            page = $el.closest(':jqmData(role="page")');
-
-        this.scrollview = $el.closest('.ui-scrollview-clip');
-        this.shortcutsContainer = $('<div class="ui-shortcutscroll"/>');
-        this.shortcutsList = $('<ul></ul>');
-
-        // popup for the hovering character
-        this.shortcutsContainer.append($('<div class="ui-shortcutscroll-popup"></div>'));
-        $popup = this.shortcutsContainer.find('.ui-shortcutscroll-popup');
-
-        this.shortcutsContainer.append(this.shortcutsList);
-        this.scrollview.append(this.shortcutsContainer);
-
-        // find the bottom of the last item in the listview
-        this.lastListItem = $el.children().last();
-
-        // remove scrollbars from scrollview
-        this.scrollview.find('.ui-scrollbar').hide();
-
-        var jumpToDivider = function(divider) {
-            // get the vertical position of the divider (so we can
-            // scroll to it)
-            var dividerY = $(divider).position().top;
-
-            // find the bottom of the last list item
-            var bottomOffset = self.lastListItem.outerHeight(true) +
-                               self.lastListItem.position().top;
-
-            var scrollviewHeight = self.scrollview.height();
-
-            // check that after the candidate scroll, the bottom of the
-            // last item will still be at the bottom of the scroll view
-            // and not some way up the page
-            var maxScroll = bottomOffset - scrollviewHeight;
-            dividerY = (dividerY > maxScroll ? maxScroll : dividerY);
-
-            // don't apply a negative scroll, as this means the
-            // divider should already be visible
-            dividerY = Math.max(dividerY, 0);
-
-            // apply the scroll
-            self.scrollview.scrollview('scrollTo', 0, -dividerY);
-
-            var dstOffset = self.scrollview.offset();
-            $popup.text($(divider).text())
-                  .offset({left : dstOffset.left + (self.scrollview.width()  - $popup.width())  / 2,
-                           top  : dstOffset.top  + (self.scrollview.height() - $popup.height()) / 2})
-                  .show();
-        };
-
-        this.shortcutsList
-        // bind mouse over so it moves the scroller to the divider
-        .bind('touchstart mousedown vmousedown touchmove vmousemove vmouseover', function (e) {
-            // Get coords relative to the element
-            var coords = $.mobile.tizen.targetRelativeCoordsFromEvent(e);
-            var shortcutsListOffset = self.shortcutsList.offset();
-
-            // If the element is a list item, get coordinates relative to the shortcuts list
-            if (e.target.tagName.toLowerCase() === "li") {
-                coords.x += $(e.target).offset().left - shortcutsListOffset.left;
-                coords.y += $(e.target).offset().top  - shortcutsListOffset.top;
-            }
-
-            // Hit test each list item
-            self.shortcutsList.find('li').each(function() {
-                var listItem = $(this),
-                    l = listItem.offset().left - shortcutsListOffset.left,
-                    t = listItem.offset().top  - shortcutsListOffset.top,
-                    r = l + Math.abs(listItem.outerWidth(true)),
-                    b = t + Math.abs(listItem.outerHeight(true));
-
-                if (coords.x >= l && coords.x <= r && coords.y >= t && coords.y <= b) {
-                    jumpToDivider($(listItem.data('divider')));
-                    return false;
-                }
-                return true;
-            });
-
-            e.preventDefault();
-            e.stopPropagation();
-        })
-        // bind mouseout of the shortcutscroll container to remove popup
-        .bind('touchend mouseup vmouseup vmouseout', function () {
-            $popup.hide();
-        });
-
-        if (page && !(page.is(':visible'))) {
-            page.bind('pageshow', function () { self.refresh(); });
-        }
-        else {
-            this.refresh();
-        }
-
-        // refresh the list when dividers are filtered out
-        $el.bind('updatelayout', function () {
-            self.refresh();
-        });
-    },
-
-    refresh: function () {
-        var self = this,
-            shortcutsTop,
-            minClipHeight;
-
-        this.shortcutsList.find('li').remove();
-
-        // get all the dividers from the list and turn them into
-        // shortcuts
-        var dividers = this.element.find('.ui-li-divider');
-
-        // get all the list items
-        var listItems = this.element.find('li:not(.ui-li-divider))');
-
-        // only use visible dividers
-        dividers = dividers.filter(':visible');
-        listItems = listItems.filter(':visible');
-
-        if (dividers.length < 2) {
-            this.shortcutsList.hide();
-            return;
-        }
-
-        this.shortcutsList.show();
-
-        this.lastListItem = listItems.last();
-
-        dividers.each(function (index, divider) {
-            self.shortcutsList.append($('<li>' + $(divider).text() + '</li>')
-                              .data('divider', divider));
-        });
-
-        // position the shortcut flush with the top of the first
-        // list divider
-        shortcutsTop = dividers.first().position().top;
-        this.shortcutsContainer.css('top', shortcutsTop);
-
-        // make the scrollview clip tall enough to show the whole of
-        // the shortcutslist
-        minClipHeight = shortcutsTop + this.shortcutsContainer.outerHeight() + 'px';
-        this.scrollview.css('min-height', minClipHeight);
-    }
-});
-
-$(document).bind( "pagecreate create", function (e) {
-    $($.tizen.shortcutscroll.prototype.options.initSelector, e.target)
-    .not(":jqmData(role='none'), :jqmData(role='nojs')")
-    .shortcutscroll();
-});
-
-})( jQuery );
+(function ( $, undefined ) {
+
+       $.widget( "tizen.shortcutscroll", $.mobile.widget, {
+               options: {
+                       initSelector: ":jqmData(shortcutscroll)"
+               },
+
+               _create: function () {
+                       var $el = this.element,
+                               self = this,
+                               $popup,
+                               page = $el.closest( ':jqmData(role="page")' ),
+                               jumpToDivider;
+
+                       this.scrollview = $el.closest( '.ui-scrollview-clip' );
+                       this.shortcutsContainer = $( '<div class="ui-shortcutscroll"/>' );
+                       this.shortcutsList = $( '<ul></ul>' );
+
+                       // popup for the hovering character
+                       this.shortcutsContainer.append($( '<div class="ui-shortcutscroll-popup"></div>' ) );
+                       $popup = this.shortcutsContainer.find( '.ui-shortcutscroll-popup' );
+
+                       this.shortcutsContainer.append( this.shortcutsList );
+                       this.scrollview.append( this.shortcutsContainer );
+
+                       // find the bottom of the last item in the listview
+                       this.lastListItem = $el.children().last();
+
+                       // remove scrollbars from scrollview
+                       this.scrollview.find( '.ui-scrollbar' ).hide();
+
+                       jumpToDivider = function ( divider ) {
+                               // get the vertical position of the divider (so we can scroll to it)
+                               var dividerY = $( divider ).position().top,
+                                       // find the bottom of the last list item
+                                       bottomOffset = self.lastListItem.outerHeight( true ) + self.lastListItem.position().top,
+                                       scrollviewHeight = self.scrollview.height(),
+
+                               // check that after the candidate scroll, the bottom of the
+                               // last item will still be at the bottom of the scroll view
+                               // and not some way up the page
+                                       maxScroll = bottomOffset - scrollviewHeight,
+                                       dstOffset;
+
+                               dividerY = ( dividerY > maxScroll ? maxScroll : dividerY );
+
+                               // don't apply a negative scroll, as this means the
+                               // divider should already be visible
+                               dividerY = Math.max( dividerY, 0 );
+
+                               // apply the scroll
+                               self.scrollview.scrollview( 'scrollTo', 0, -dividerY );
+
+                               dstOffset = self.scrollview.offset();
+                               $popup
+                                       .text( $( divider ).text() )
+                                       .offset( { left : dstOffset.left + ( self.scrollview.width()  - $popup.width() ) / 2,
+                                                               top  : dstOffset.top  + ( self.scrollview.height() - $popup.height() ) / 2 } )
+                                       .show();
+                       };
+
+                       this.shortcutsList
+                       // bind mouse over so it moves the scroller to the divider
+                               .bind( 'touchstart mousedown vmousedown touchmove vmousemove vmouseover ', function ( e ) {
+                                       // Get coords relative to the element
+                                       var coords = $.mobile.tizen.targetRelativeCoordsFromEvent( e ),
+                                               shortcutsListOffset = self.shortcutsList.offset();
+
+                                       // If the element is a list item, get coordinates relative to the shortcuts list
+                                       if ( e.target.tagName.toLowerCase() === "li" ) {
+                                               coords.x += $( e.target ).offset().left - shortcutsListOffset.left;
+                                               coords.y += $( e.target ).offset().top  - shortcutsListOffset.top;
+                                       }
+
+                                       // Hit test each list item
+                                       self.shortcutsList.find( 'li' ).each( function () {
+                                               var listItem = $( this ),
+                                                       l = listItem.offset().left - shortcutsListOffset.left,
+                                                       t = listItem.offset().top  - shortcutsListOffset.top,
+                                                       r = l + Math.abs(listItem.outerWidth( true ) ),
+                                                       b = t + Math.abs(listItem.outerHeight( true ) );
+
+                                               if ( coords.x >= l && coords.x <= r && coords.y >= t && coords.y <= b ) {
+                                                       jumpToDivider( $( listItem.data( 'divider' ) ) );
+                                                       return false;
+                                               }
+                                               return true;
+                                       } );
+
+                                       e.preventDefault();
+                                       e.stopPropagation();
+                               } )
+                               // bind mouseout of the shortcutscroll container to remove popup
+                               .bind( 'touchend mouseup vmouseup vmouseout', function () {
+                                       $popup.hide();
+                               } );
+
+                       if ( page && !( page.is( ':visible' ) ) ) {
+                               page.bind( 'pageshow', function () { self.refresh(); } );
+                       } else {
+                               this.refresh();
+                       }
+
+                       // refresh the list when dividers are filtered out
+                       $el.bind( 'updatelayout', function () {
+                               self.refresh();
+                       } );
+               },
+
+               refresh: function () {
+                       var self = this,
+                               shortcutsTop,
+                               minClipHeight,
+                               dividers,
+                               listItems;
+
+                       this.shortcutsList.find( 'li' ).remove();
+
+                       // get all the dividers from the list and turn them into shortcuts
+                       dividers = this.element.find( '.ui-li-divider' );
+
+                       // get all the list items
+                       listItems = this.element.find( 'li:not(.ui-li-divider)) ');
+
+                       // only use visible dividers
+                       dividers = dividers.filter( ':visible' );
+                       listItems = listItems.filter( ':visible' );
+
+                       if ( dividers.length < 2 ) {
+                               this.shortcutsList.hide();
+                               return;
+                       }
+
+                       this.shortcutsList.show();
+
+                       this.lastListItem = listItems.last();
+
+                       dividers.each( function ( index, divider ) {
+                               self.shortcutsList
+                                       .append( $( '<li>' + $( divider ).text() + '</li>' )
+                                               .data( 'divider', divider ) );
+                       } );
+
+                       // position the shortcut flush with the top of the first list divider
+                       shortcutsTop = dividers.first().position().top;
+                       this.shortcutsContainer.css( 'top', shortcutsTop );
+
+                       // make the scrollview clip tall enough to show the whole of the shortcutslist
+                       minClipHeight = shortcutsTop + this.shortcutsContainer.outerHeight() + 'px';
+                       this.scrollview.css( 'min-height', minClipHeight );
+               }
+       } );
+
+       $( document ).bind( "pagecreate create", function ( e ) {
+               $( $.tizen.shortcutscroll.prototype.options.initSelector, e.target )
+                       .not( ":jqmData(role='none'), :jqmData(role='nojs')" )
+                       .shortcutscroll();
+       } );
+
+} ( jQuery ) );
index cd13f5b..b7ac4ad 100755 (executable)
@@ -5,7 +5,8 @@
  * http://www.opensource.org/licenses/mit-license.php)
  *
  * ***************************************************************************
- * Copyright (C) 2011 by Intel Corporation Ltd.
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2011 by Intel Corporation Ltd.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -75,7 +76,7 @@
 (function ($, window, undefined) {
        $.widget("tizen.tizenslider", $.mobile.widget, {
                options: {
-                       popupEnabled: true,
+                       popupEnabled: true
                },
 
                popup: null,
                        this.popupVisible = false;
 
                        var self = this,
-                       inputElement = $(this.element),
-                       slider,
-                       showPopup,
-                       hidePopup,
-                       positionPopup,
-                       updateSlider,
-                       slider_bar,
-                       handle_press;
+                               inputElement = $(this.element),
+                               slider,
+                               showPopup,
+                               hidePopup,
+                               positionPopup,
+                               updateSlider,
+                               slider_bar,
+                               handle_press,
+                               popupEnabledAttr,
+                               icon;
 
                        // apply jqm slider
                        inputElement.slider();
                        self.popup = $('<div class="ui-slider-popup"></div>');
 
                        // set the popupEnabled according to the html attribute
-                       var popupEnabledAttr = inputElement.attr('data-popupenabled');
+                       popupEnabledAttr = inputElement.attr('data-popupenabled');
                        if ( popupEnabledAttr !== undefined ) {
                                self.options.popupEnabled = (popupEnabledAttr === 'true');
                        }
                        // get the actual slider added by jqm
                        slider = inputElement.next('.ui-slider');
 
-                       var icon = inputElement.attr('data-icon');
+                       icon = inputElement.attr('data-icon');
 
                        // wrap the background
                        if ( icon === undefined ) {
 
                // position the popup
                positionPopup: function () {
-                       this.popup.position({my: 'center bottom',
-                                       at: 'center top',
-                                       offset: '0 20px',
-                                       of: this.handle});
+                       var dstOffset = this.handle.offset();
 
-                       this.handle_press.position({my: 'left top',
-                                       at: 'left top',
-                                       offset: '0 0',
-                                       of: this.handle});
-              },
+                       this.popup.offset({
+                               left: dstOffset.left + (this.handle.width() - this.popup.width()) / 2,
+                               top: dstOffset.top  - this.popup.outerHeight() + 15
+                       });
+
+                       this.handle_press.offset({
+                               left: dstOffset.left,
+                               top: dstOffset.top
+                       });
+               },
 
                // show value on the handle and in popup
                updateSlider: function () {
 
                                break;
                        }
-               },
+               }
        });
 
        // stop jqm from initialising sliders
-       $(document).bind("pagebeforecreate", function (e) {
+       $(document).bind("pagebeforecreate", function ( e ) {
                if ($.data(window, "jqmSliderInitSelector") === undefined ) {
-                       $.data(window,"jqmSliderInitSelector",
+                       $.data(window, "jqmSliderInitSelector",
                                $.mobile.slider.prototype.options.initSelector);
                        $.mobile.slider.prototype.options.initSelector = null;
                }
        });
 
        // initialise sliders with our own slider
-       $(document).bind("pagecreate", function(e) {
-               var jqmSliderInitSelector = $.data(window,"jqmSliderInitSelector");
+       $(document).bind("pagecreate", function ( e ) {
+               var jqmSliderInitSelector = $.data(window, "jqmSliderInitSelector");
                $(e.target).find(jqmSliderInitSelector).not('select').tizenslider();
                $(e.target).find(jqmSliderInitSelector).filter('select').slider();
        });
 
-})( jQuery, this );
+}( jQuery, this ));
index a11a8a2..0fab979 100644 (file)
@@ -5,7 +5,8 @@
  * http://www.opensource.org/licenses/mit-license.php)
  *
  * ***************************************************************************
- * Copyright (C) 2011 by Intel Corporation Ltd.
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2011 by Intel Corporation Ltd.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
 //                      (to either the right or left).
 (function ($) {
 
-$.widget("tizen.swipelist", $.mobile.widget, {
-    options: {
-        theme: null
-    },
-
-    _create: function () {
-        // use the theme set on the element, set in options,
-        // the parent theme, or 'c' (in that order of preference)
-        var theme = this.element.jqmData('theme') ||
-                    this.options.theme ||
-                    this.element.parent().jqmData('theme') ||
-                    'c';
-
-        this.options.theme = theme;
-
-        this.refresh();
-    },
-
-    refresh: function () {
-        this._cleanupDom();
-
-        var self = this,
-            defaultCoverTheme,
-            covers;
-
-        defaultCoverTheme = 'ui-body-' + this.options.theme;
-
-        // swipelist is a listview
-        if (!this.element.hasClass('ui-listview')) {
-            this.element.listview();
-        }
-
-        this.element.addClass('ui-swipelist');
-
-        // get the list item covers
-        covers = this.element.find(':jqmData(role="swipelist-item-cover")');
-
-        covers.each(function () {
-            var cover = $(this);
-            var coverTheme = defaultCoverTheme;
-
-            // get the parent li element and add classes
-            var item = cover.closest('li');
-
-            // add swipelist CSS classes
-            item.addClass('ui-swipelist-item');
-
-            cover.addClass('ui-swipelist-item-cover');
-
-            // set swatch on cover: if the nearest list item has
-            // a swatch set on it, that will be used; otherwise, use
-            // the swatch set for the swipelist
-            var itemHasThemeClass = item.attr('class')
-                                        .match(/ui\-body\-[a-z]|ui\-bar\-[a-z]/);
-
-            if (itemHasThemeClass) {
-                coverTheme = itemHasThemeClass[0];
-            }
-
-            cover.addClass(coverTheme);
-
-            // wrap inner HTML (so it can potentially be styled)
-            if (cover.has('.ui-swipelist-item-cover-inner').length === 0) {
-                cover.wrapInner($('<span/>').addClass('ui-swipelist-item-cover-inner'));
-            }
-
-            // bind to swipe events on the cover and the item
-            if (!(cover.data('animateRight') && cover.data('animateLeft'))) {
-                cover.data('animateRight', function () {
-                    self._animateCover(cover, 100);
-                });
-
-                cover.data('animateLeft', function () {
-                    self._animateCover(cover, 0);
-                });
-            }
-
-            // bind to synthetic events
-            item.bind('swipeleft', cover.data('animateLeft'));
-            cover.bind('swiperight', cover.data('animateRight'));
-
-            // any clicks on buttons inside the item also trigger
-            // the cover to slide back to the left
-            item.find('.ui-btn').bind('vclick', cover.data('animateLeft'));
-        });
-    },
-
-    _cleanupDom: function () {
-        var self = this,
-            defaultCoverTheme,
-            covers;
-
-        defaultCoverTheme = 'ui-body-' + this.options.theme;
-
-        this.element.removeClass('ui-swipelist');
-
-        // get the list item covers
-        covers = this.element.find(':jqmData(role="swipelist-item-cover")');
-
-        covers.each(function () {
-            var cover = $(this);
-            var coverTheme = defaultCoverTheme;
-            var text, wrapper;
-
-            // get the parent li element and add classes
-            var item = cover.closest('li');
-
-            // remove swipelist CSS classes
-            item.removeClass('ui-swipelist-item');
-            cover.removeClass('ui-swipelist-item-cover');
-
-            // remove swatch from cover: if the nearest list item has
-            // a swatch set on it, that will be used; otherwise, use
-            // the swatch set for the swipelist
-            var itemClass = item.attr('class');
-            var itemHasThemeClass = itemClass &&
-                                    itemClass.match(/ui\-body\-[a-z]|ui\-bar\-[a-z]/);
-
-            if (itemHasThemeClass) {
-                coverTheme = itemHasThemeClass[0];
-            }
-
-            cover.removeClass(coverTheme);
-
-            // remove wrapper HTML
-            wrapper = cover.find('.ui-swipelist-item-cover-inner');
-
-            wrapper.children().unwrap();
-
-            text = wrapper.text()
-
-            if (text) {
-              cover.append(text);
-              wrapper.remove();
-            }
-
-            // unbind swipe events
-            if (cover.data('animateRight') && cover.data('animateLeft')) {
-                cover.unbind('swiperight', cover.data('animateRight'));
-                item.unbind('swipeleft', cover.data('animateLeft'));
-
-                // unbind clicks on buttons inside the item
-                item.find('.ui-btn').unbind('vclick', cover.data('animateLeft'));
-
-                cover.data('animateRight', null);
-                cover.data('animateLeft', null);
-            }
-        });
-    },
-
-    // NB I tried to use CSS animations for this, but the performance
-    // and appearance was terrible on Android 2.2 browser;
-    // so I reverted to jQuery animations
-    //
-    // once the cover animation is done, the cover emits an
-    // animationComplete event
-    _animateCover: function (cover, leftPercentage) {
-        var animationOptions = {
-          easing: 'linear',
-          duration: 'fast',
-          queue: true,
-          complete: function () {
-              cover.trigger('animationComplete');
-          }
-        };
-
-        cover.stop();
-        cover.clearQueue();
-        cover.animate({left: '' + leftPercentage + '%'}, animationOptions);
-    },
-
-    destroy: function () {
-      this._cleanupDom();
-    }
-
-});
-
-$(document).bind("pagecreate", function (e) {
-    $(e.target).find(":jqmData(role='swipelist')").swipelist();
-});
-
-})(jQuery);
+       $.widget("tizen.swipelist", $.mobile.widget, {
+               options: {
+                       theme: null
+               },
+
+               _create: function () {
+                       // use the theme set on the element, set in options,
+                       // the parent theme, or 'c' (in that order of preference)
+                       var theme = this.element.jqmData('theme') ||
+                               this.options.theme ||
+                               this.element.parent().jqmData('theme') ||
+                               'c';
+
+                       this.options.theme = theme;
+                       this.refresh();
+               },
+
+               refresh: function () {
+                       this._cleanupDom();
+
+                       var self = this,
+                               defaultCoverTheme,
+                               covers;
+
+                       defaultCoverTheme = 'ui-body-' + this.options.theme;
+
+                       // swipelist is a listview
+                       if (!this.element.hasClass('ui-listview')) {
+                               this.element.listview();
+                       }
+
+                       this.element.addClass('ui-swipelist');
+
+                       // get the list item covers
+                       covers = this.element.find(':jqmData(role="swipelist-item-cover")');
+
+                       covers.each(function () {
+                               var cover = $(this),
+                                       coverTheme = defaultCoverTheme,
+                               // get the parent li element and add classes
+                                       item = cover.closest('li'),
+                                       itemHasThemeClass;
+
+                               // add swipelist CSS classes
+                               item.addClass('ui-swipelist-item');
+                               cover.addClass('ui-swipelist-item-cover');
+
+                               // set swatch on cover: if the nearest list item has
+                               // a swatch set on it, that will be used; otherwise, use
+                               // the swatch set for the swipelist
+                               itemHasThemeClass = item.attr('class')
+                                       .match(/ui\-body\-[a-z]|ui\-bar\-[a-z]/);
+
+                               if (itemHasThemeClass) {
+                                       coverTheme = itemHasThemeClass[0];
+                               }
+
+                               cover.addClass(coverTheme);
+
+                               // wrap inner HTML (so it can potentially be styled)
+                               if (cover.has('.ui-swipelist-item-cover-inner').length === 0) {
+                                       cover.wrapInner($('<span/>').addClass('ui-swipelist-item-cover-inner'));
+                               }
+
+                               // bind to swipe events on the cover and the item
+                               if (!(cover.data('animateRight') && cover.data('animateLeft'))) {
+                                       cover.data('animateRight', function () {
+                                               self._animateCover(cover, 100);
+                                       });
+
+                                       cover.data('animateLeft', function () {
+                                               self._animateCover(cover, 0);
+                                       });
+                               }
+
+                               // bind to synthetic events
+                               item.bind('swipeleft', cover.data('animateLeft'));
+                               cover.bind('swiperight', cover.data('animateRight'));
+
+                               // any clicks on buttons inside the item also trigger
+                               // the cover to slide back to the left
+                               item.find('.ui-btn').bind('vclick', cover.data('animateLeft'));
+                       });
+               },
+
+               _cleanupDom: function () {
+
+                       var self = this,
+                               defaultCoverTheme,
+                               covers;
+
+                       defaultCoverTheme = 'ui-body-' + this.options.theme;
+
+                       this.element.removeClass('ui-swipelist');
+
+                       // get the list item covers
+                       covers = this.element.find(':jqmData(role="swipelist-item-cover")');
+
+                       covers.each(function () {
+                               var cover = $(this),
+                                       coverTheme = defaultCoverTheme,
+                                       text,
+                                       wrapper,
+                                       // get the parent li element and add classes
+                                       item = cover.closest('li'),
+                                       itemClass,
+                                       itemHasThemeClass;
+
+                                       // remove swipelist CSS classes
+                               item.removeClass('ui-swipelist-item');
+                               cover.removeClass('ui-swipelist-item-cover');
+
+                               // remove swatch from cover: if the nearest list item has
+                               // a swatch set on it, that will be used; otherwise, use
+                               // the swatch set for the swipelist
+                               itemClass = item.attr('class');
+                               itemHasThemeClass = itemClass &&
+                                       itemClass.match(/ui\-body\-[a-z]|ui\-bar\-[a-z]/);
+
+                               if (itemHasThemeClass) {
+                                       coverTheme = itemHasThemeClass[0];
+                               }
+
+                               cover.removeClass(coverTheme);
+
+                               // remove wrapper HTML
+                               wrapper = cover.find('.ui-swipelist-item-cover-inner');
+                               wrapper.children().unwrap();
+                               text = wrapper.text();
+
+                               if (text) {
+                                       cover.append(text);
+                                       wrapper.remove();
+                               }
+
+                               // unbind swipe events
+                               if (cover.data('animateRight') && cover.data('animateLeft')) {
+                                       cover.unbind('swiperight', cover.data('animateRight'));
+                                       item.unbind('swipeleft', cover.data('animateLeft'));
+
+                                       // unbind clicks on buttons inside the item
+                                       item.find('.ui-btn').unbind('vclick', cover.data('animateLeft'));
+
+                                       cover.data('animateRight', null);
+                                       cover.data('animateLeft', null);
+                               }
+                       });
+               },
+
+               // NB I tried to use CSS animations for this, but the performance
+               // and appearance was terrible on Android 2.2 browser;
+               // so I reverted to jQuery animations
+               //
+               // once the cover animation is done, the cover emits an
+               // animationComplete event
+               _animateCover: function (cover, leftPercentage) {
+                       var animationOptions = {
+                               easing: 'linear',
+                               duration: 'fast',
+                               queue: true,
+                               complete: function () {
+                                       cover.trigger('animationComplete');
+                               }
+                       };
+
+                       cover.stop();
+                       cover.clearQueue();
+                       cover.animate({left: leftPercentage + '%'}, animationOptions);
+               },
+
+               destroy: function () {
+                       this._cleanupDom();
+               }
+
+       });
+
+       $(document).bind("pagecreate", function (e) {
+               $(e.target).find(":jqmData(role='swipelist')").swipelist();
+       });
+
+}(jQuery));
old mode 100644 (file)
new mode 100755 (executable)
index d0aa06e..c58b9fb
@@ -5,10 +5,11 @@
  * http://www.opensource.org/licenses/mit-license.php)
  *
  * ***************************************************************************
- * Copyright (C) 2011 by Intel Corporation Ltd.
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2011 by Intel Corporation Ltd.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
+ * copy of this software and associated documentation files (the "Software" ),
  * to deal in the Software without restriction, including without limitation
  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  * and/or sell copies of the Software, and to permit persons to whom the
@@ -35,7 +36,7 @@
 // element inside a page. Alternatively, call switch()
 // on an element, like this :
 //
-//     $("#myswitch").toggleswitch();
+//     $( "#myswitch" ).toggleswitch();
 // where the html might be :
 //     <div id="myswitch"></div>
 //
 // Events:
 //     changed: Emitted when the switch is changed
 
-(function($, undefined) {
-
-$.widget("tizen.toggleswitch", $.tizen.widgetex, {
-    options: {
-        onText       : "On",
-        offText      : "Off",
-        checked      : true,
-        initSelector : ":jqmData(role='toggleswitch')"
-    },
-
-    _htmlProto: {
-        ui: {
-            outer     : "#outer",
-            bg        : "#bg",
-            txtMovers : {
-                normal : "#normal",
-                active : "#active"
-            },
-            btn       : "#button",
-            btnSpan   : "#btn-span",
-            txt       : {
-                normal : "[data-normal-text]",
-                active : "[data-active-text]",
-            },
-        }
-    },
-
-    _value: {
-        attr: "data-" + ($.mobile.ns || "") + "checked",
-        signal: "changed"
-    },
-
-    _create: function() {
-        var self = this;
-
-        this.element
-            .css("display", "none")
-            .after(this._ui.outer);
-
-        this._ui.outer.find("a").buttonMarkup();
-        this._ui.txtMovers.normal
-            .add(this._ui.txtMovers.active)
-            .find("*")
-            .css({"border-color": "transparent"});
-        this._ui.btn.addClass("toggleswitch-button");
+(function ( $, undefined ) {
+
+       $.widget( "tizen.toggleswitch", $.tizen.widgetex, {
+               options: {
+                       onText                  : "On",
+                       offText                 : "Off",
+                       checked                 : true,
+                       initSelector    : ":jqmData(role='toggleswitch')"
+               },
+
+               _htmlProto: {
+                       ui: {
+                               outer           : "#outer",
+                               bg                      : "#bg",
+                               txtMovers       : {
+                                       normal  : "#normal",
+                                       active  : "#active"
+                               },
+                               btn                     : "#button",
+                               btnSpan         : "#btn-span",
+                               txt                     : {
+                                       normal  : "[data-normal-text]",
+                                       active  : "[data-active-text]"
+                               }
+                       }
+               },
+
+               _value: {
+                       attr: "data-" + ( $.mobile.ns || "" ) + "checked",
+                       signal: "changed"
+               },
+
+               _create: function () {
+                       var self = this;
+
+                       this.element
+                               .css( "display", "none" )
+                               .after( this._ui.outer );
+
+                       this._ui.outer.find( "a" ).buttonMarkup();
+                       this._ui.txtMovers.normal
+                               .add( this._ui.txtMovers.active )
+                               .find( "*" )
+                               .css( { "border-color": "transparent" } );
+                       this._ui.btn.addClass( "toggleswitch-button" );
 /*
-        // Crutches for IE: It does not seem to understand opacity specified in a class, nor that opacity of an element
-        // affects all its children
-        if ($.mobile.browser.ie) {
-            // Remove this class, because it has no effect in IE :-S
-            this._ui.outer.find("*").removeClass("toggleswitch-button-transparent");
-            // After adding the button markup, make everything transparent
-            this._ui.normalBackground.find("*").css("opacity", 0.0);
-            this._ui.activeBackground.find("*").css("opacity", 0.0);
-            this._ui.refButton.add(this._ui.refButton.find("*")).css("opacity", 0.0);
-            this._ui.realButton.add(this._ui.realButton.find("*")).css("opacity", 0.0);
-            // ... except the buttons that display the inital position of the switch
-            this._ui.initButtons
-                .add(this._ui.initButtons.find("*"))
-                .add(this._ui.fButton.find("*"))
-                .add(this._ui.fButton)
-                .css("opacity", 1.0);
-        }
+               // Crutches for IE: It does not seem to understand opacity specified in a class, nor that opacity of an element
+               // affects all its children
+               if ($.mobile.browser.ie) {
+                       // Remove this class, because it has no effect in IE :-S
+                       this._ui.outer.find( "*" ).removeClass( "toggleswitch-button-transparent" );
+                       // After adding the button markup, make everything transparent
+                       this._ui.normalBackground.find( "*" ).css( "opacity", 0.0);
+                       this._ui.activeBackground.find( "*" ).css( "opacity", 0.0);
+                       this._ui.refButton.add( this._ui.refButton.find( "*" )).css( "opacity", 0.0);
+                       this._ui.realButton.add( this._ui.realButton.find( "*" )).css( "opacity", 0.0);
+                       // ... except the buttons that display the inital position of the switch
+                       this._ui.initButtons
+                               .add( this._ui.initButtons.find( "*" ))
+                               .add( this._ui.fButton.find( "*" ))
+                               .add( this._ui.fButton)
+                               .css( "opacity", 1.0);
+               }
 */
-        $.extend(this, {
-            _initial: true
-        });
-
-        this._ui.btn
-            .add(this._ui.outer)
-            .bind("vclick", function(e) {
-                self._setChecked(!(self.options.checked));
-                e.stopPropagation();
-            });
-    },
+                       $.extend( this, {
+                               _initial: true
+                       } );
+
+                       this._ui.btn
+                               .add( this._ui.outer )
+                               .bind( "vclick", function ( e ) {
+                                       self._setChecked( !( self.options.checked ) );
+                                       e.stopPropagation();
+                               } );
+               },
 /*
-    _makeTransparent: function(obj, b) {
-        if ($.mobile.browser.ie)
-            obj.add(obj.find("*")).css("opacity", b ? 0.0 : 1.0);
-        else
-            obj[b ? "addClass" : "removeClass"]("toggleswitch-button-transparent");
-    },
+               _makeTransparent: function (obj, b) {
+                       if ($.mobile.browser.ie)
+                               obj.add(obj.find( "*" )).css( "opacity", b ? 0.0 : 1.0);
+                       else
+                               obj[b ? "addClass" : "removeClass"]( "toggleswitch-button-transparent" );
+               },
 */
-    _setDisabled: function(value) {
-        $.tizen.widgetex.prototype._setDisabled.call(this, value);
-        this._ui.outer[value ? "addClass" : "removeClass"]("ui-disabled");
-    },
-
-
-    _updateBtnText: function() {
-        var noText = (((this.options.offText || "") === "" &&
-                       (this.options.onText  || "") === ""));
-        this._ui.btnSpan.html((noText ? "" : "&nbsp;"));
-        this._ui.outer.find("a")[(noText ? "addClass" : "removeClass")]("ui-btn-icon-notext");
-    },
-
-    _setOnText: function(value) {
-        this._ui.txt.active.text(value);
-        this.options.onText = value;
-        this.element.attr("data-" + ($.mobile.ns || "") + "on-text", value);
-        this._updateBtnText();
-    },
-
-    _setOffText: function(value) {
-        this._ui.txt.normal.text(value);
-        this.options.offText = value;
-        this.element.attr("data-" + ($.mobile.ns || "") + "off-text", value);
-        this._updateBtnText();
-    },
-
-    _setChecked: function(checked) {
-        if (this.options.checked != checked) {
-            var dst = checked
-                    ? {bg:  "0%", normalTop: "-50%", activeBot:   "0%"}
-                    : {bg: "50%", normalTop:   "0%", activeBot: "-50%"},
-                method = (this._initial ? "css" : "animate")
-
-            this._ui.btn.add(this._ui.bg)[method]({top: dst.bg});
-            this._ui.txtMovers.normal[method]({top: dst.normalTop});
-            this._ui.txtMovers.active[method]({bottom: dst.activeBot});
-
-            this._initial = false;
-
-            this.options.checked = checked;
-            this.element.attr("data-" + ($.mobile.ns || "") + "checked", checked);
-            this._setValue(checked);
-        }
-    }
-});
-
-$(document).bind("pagecreate create", function(e) {
-    $($.tizen.toggleswitch.prototype.options.initSelector, e.target)
-        .not(":jqmData(role='none'), :jqmData(role='nojs')")
-        .toggleswitch();
-});
-
-})(jQuery);
+               _setDisabled: function ( value ) {
+                       $.tizen.widgetex.prototype._setDisabled.call( this, value );
+                       this._ui.outer[value ? "addClass" : "removeClass"]( "ui-disabled" );
+               },
+
+               _updateBtnText: function () {
+                       var noText = ( ( ( this.options.offText || "" ) === "" &&
+                                       ( this.options.onText || "" ) === "" ) );
+                       this._ui.btnSpan.html( ( noText ? "" : "&nbsp;" ) );
+                       this._ui.outer.find( "a" )[( noText ? "addClass" : "removeClass" )]( "ui-btn-icon-notext" );
+               },
+
+               _setOnText: function ( value ) {
+                       this._ui.txt.active.text( value );
+                       this.options.onText = value;
+                       this.element.attr( "data-" + ( $.mobile.ns || "" ) + "on-text", value );
+                       this._updateBtnText();
+               },
+
+               _setOffText: function ( value ) {
+                       this._ui.txt.normal.text( value );
+                       this.options.offText = value;
+                       this.element.attr( "data-" + ($.mobile.ns || "" ) + "off-text", value );
+                       this._updateBtnText();
+               },
+
+               _setChecked: function ( checked ) {
+                       if ( this.options.checked != checked ) {
+                               var dst = checked
+                                       ? { bg:  "0%", normalTop: "-50%", activeBot: "0%" }
+                                       : { bg: "50%", normalTop: "0%", activeBot: "-50%" },
+                                       method = ( this._initial ? "css" : "animate" );
+
+                               this._ui.btn.add( this._ui.bg )[method]( { top: dst.bg } );
+                               this._ui.txtMovers.normal[method]( { top: dst.normalTop } );
+                               this._ui.txtMovers.active[method]( { bottom: dst.activeBot } );
+
+                               this._initial = false;
+
+                               this.options.checked = checked;
+                               this.element.attr( "data-" + ( $.mobile.ns || "" ) + "checked", checked );
+                               this._setValue( checked );
+                       }
+               }
+       } );
+
+       $( document ).bind( "pagecreate create", function ( e ) {
+               $( $.tizen.toggleswitch.prototype.options.initSelector, e.target )
+                       .not( ":jqmData(role='none'), :jqmData(role='nojs')" )
+                       .toggleswitch();
+       } );
+
+}( jQuery ) );
index dd1cfe4..fffa206 100755 (executable)
@@ -3,7 +3,8 @@
  * http://www.opensource.org/licenses/mit-license.php)
  *
  * ***************************************************************************
- * Copyright (C) 2011 by Intel Corporation Ltd.
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2011 by Intel Corporation Ltd.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
  * ***************************************************************************
  */
 
-(function($, undefined) {
-
-$.widget( "tizen.triangle", $.tizen.widgetex, {
-    options: {
-        extraClass: "",
-        offset: null,
-        color: null,
-        location: "top",
-        initSelector: ":jqmData(role='triangle')"
-    },
-
-    _create: function() {
-        var triangle = $("<div></div>", {"class" : "ui-triangle"});
-
-        $.extend(this, {
-            _triangle: triangle
-        });
-
-        this.element.addClass("ui-triangle-container").append(triangle);
-    },
-
-    _doCSS: function() {
-        var location = (this.options.location || "top"),
-            offsetCoord = (($.inArray(location, ["top", "bottom"]) === -1) ? "top" : "left"),
-            cssArg = {
-                "border-bottom-color" : "top"    === location ? this.options.color : "transparent",
-                "border-top-color"    : "bottom" === location ? this.options.color : "transparent",
-                "border-left-color"   : "right"  === location ? this.options.color : "transparent",
-                "border-right-color"  : "left"   === location ? this.options.color : "transparent"
-            };
-
-        cssArg[offsetCoord] = this.options.offset;
-
-        this._triangle.removeAttr("style").css(cssArg);
-    },
-
-    _setOffset: function(value) {
-        this.options.offset = value;
-        this.element.attr("data-" + ($.mobile.ns || "") + "offset", value);
-        this._doCSS();
-    },
-
-    _setExtraClass: function(value) {
-        this._triangle.addClass(value);
-        this.options.extraClass = value;
-        this.element.attr("data-" + ($.mobile.ns || "") + "extra-class", value);
-    },
-
-    _setColor: function(value) {
-        this.options.color = value;
-        this.element.attr("data-" + ($.mobile.ns || "") + "color", value);
-        this._doCSS();
-    },
-
-    _setLocation: function(value) {
-        this.element
-            .removeClass("ui-triangle-container-" + this.options.location)
-            .addClass("ui-triangle-container-" + value);
-        this._triangle
-            .removeClass("ui-triangle-" + this.options.location)
-            .addClass("ui-triangle-" + value);
-
-        this.options.location = value;
-        this.element.attr("data-" + ($.mobile.ns || "") + "location", value);
-
-        this._doCSS();
-    }
-});
-
-$(document).bind("pagecreate create", function(e) {
-    $($.tizen.triangle.prototype.options.initSelector, e.target)
-        .not(":jqmData(role='none'), :jqmData(role='nojs')")
-        .triangle();
-});
-
-})(jQuery);
+( function ($, undefined) {
+
+       $.widget( "tizen.triangle", $.tizen.widgetex, {
+               options: {
+                       extraClass: "",
+                       offset: null,
+                       color: null,
+                       location: "top",
+                       initSelector: ":jqmData(role='triangle')"
+               },
+
+               _create: function () {
+                       var triangle = $( "<div></div>", {"class" : "ui-triangle"} );
+
+                       $.extend(this, {
+                               _triangle: triangle
+                       });
+
+                       this.element.addClass( "ui-triangle-container" ).append( triangle );
+               },
+
+               _doCSS: function () {
+                       var location = ( this.options.location || "top" ),
+                               offsetCoord = ( ($.inArray(location, ["top", "bottom"]) === -1) ? "top" : "left"),
+                               cssArg = {
+                                       "border-bottom-color" : "top"    === location ? this.options.color : "transparent",
+                                       "border-top-color"    : "bottom" === location ? this.options.color : "transparent",
+                                       "border-left-color"   : "right"  === location ? this.options.color : "transparent",
+                                       "border-right-color"  : "left"   === location ? this.options.color : "transparent"
+                               };
+
+                       cssArg[offsetCoord] = this.options.offset;
+
+                       this._triangle.removeAttr( "style" ).css( cssArg );
+               },
+
+               _setOffset: function ( value ) {
+                       this.options.offset = value;
+                       this.element.attr( "data-" + ($.mobile.ns || "") + "offset", value );
+                       this._doCSS();
+               },
+
+               _setExtraClass: function ( value ) {
+                       this._triangle.addClass( value );
+                       this.options.extraClass = value;
+                       this.element.attr( "data-" + ($.mobile.ns || "") + "extra-class", value );
+               },
+
+               _setColor: function ( value ) {
+                       this.options.color = value;
+                       this.element.attr( "data-" + ($.mobile.ns || "") + "color", value );
+                       this._doCSS();
+               },
+
+               _setLocation: function ( value ) {
+                       this.element
+                               .removeClass( "ui-triangle-container-" + this.options.location )
+                               .addClass( "ui-triangle-container-" + value );
+                       this._triangle
+                               .removeClass( "ui-triangle-" + this.options.location )
+                               .addClass( "ui-triangle-" + value );
+
+                       this.options.location = value;
+                       this.element.attr( "data-" + ($.mobile.ns || "") + "location", value );
+
+                       this._doCSS();
+               }
+       });
+
+       $( document ).bind( "pagecreate create", function ( e ) {
+           $($.tizen.triangle.prototype.options.initSelector, e.target)
+               .not(":jqmData(role='none'), :jqmData(role='nojs')")
+               .triangle();
+       });
+
+}(jQuery) );
diff --git a/src/widgets/virtualgrid/js/jquery.mobile.tizen.virtualgrid.js b/src/widgets/virtualgrid/js/jquery.mobile.tizen.virtualgrid.js
new file mode 100755 (executable)
index 0000000..4467011
--- /dev/null
@@ -0,0 +1,407 @@
+/* ***************************************************************************
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ *
+ *     Author: Kangsik Kim <kangsik81.kim@samsung.com>
+*/
+
+/**
+ * Virtual Grid Widget for unlimited data.
+ * To support more then 1,000 items, special grid widget developed.
+ * Fast initialize and light DOM tree.
+ *
+ * HTML Attributes:
+ *
+ *             data-role:  virtualgridview
+ *             data-template : jQuery.template ID that populate into virtual list
+ *             data-dbtable : DB Table name. It used as window[DB NAME]. Loaded data should be converted as window object.
+ *             data-dbkey : Unique key of DB Table. To sync each element on virtual list with DB table.
+ *             data-column : Set a number of column. (Default : 3)
+ *             data-row : Set a number of row. (Default : 10)
+ *
+ *             ID : <UL> element that has "data-role=virtualgrid" must have ID attribute.
+ *             Class : <UL> element that has "data-role=virtualgrid" should have "vgLoadSuccess" class to guaranty DB loading is completed.
+ *
+ * APIs:
+ *
+ *             create ( void )
+ *                     : API to call _create method. API for AJAX or DB loading callback.
+ *
+ * Events:
+ *
+ *
+ * Examples:
+ *
+ *                     <script id="tizen-demo-namecard" type="text/x-jquery-tmpl">
+ *                             <div class="ui-demo-namecard">
+ *                                     <div class="ui-demo-namecard-pic">
+ *                                             <img class="ui-demo-namecard-pic-img" src="${TEAM_LOGO}"  />
+ *                                     </div>
+ *                                     <div class="ui-demo-namecard-contents">
+ *                                             <span class="name ui-li-text-main">${NAME}</span>
+ *                                             <span class="active ui-li-text-sub">${ACTIVE}</span>
+ *                                             <span class="from ui-li-text-sub">${FROM}</span>
+ *                                     </div>
+ *                             </div>
+ *                     </script>
+ *                     <div id="virtualgrid-demo" data-role="virtualgrid" data-column="3" data-row="60" data-template="tizen-demo-namecard" data-dbtable="JSON_DATA" >
+ *                     </div>
+ *
+ */
+
+( function ( $, window, undefined ) {
+       $.widget( "tizen.virtualgrid", $.mobile.widget, {
+               options : {
+                       id : "",
+                       column : 3,
+                       dbtable : "",
+                       template : "",
+                       row : 20,
+                       dbkey : false
+               },
+               create : function () {
+                       this._create();
+               },
+               _create : function () {
+                       $.extend( this, {
+                               NO_SCROLL : 0,
+                               SCROLL_DOWN : 1,
+                               SCROLL_UP : -1,
+                               _titleHeight : 0,
+                               _blockHeight : 0,
+                               _bufferSize : 0,
+                               _columnWidth : 0,
+                               _totalItemCnt : 0,
+                               _totalRowCnt : 0,
+                               _currentIndex : 0,
+                               _remainCount : 0,
+                               _viewHeight : 0,
+                               _direction : 0,
+                               _firstIndex : 0,
+                               _lastIndex : 0,
+                               _prevPos : 0,
+                               _numTopItems : 0
+                       });
+
+                       var opts = this.options, widget = this;
+                       opts.id = "#" + this.element.attr( 'id' );
+
+                       if ( $( opts.id ).hasClass( "vgLoadSuccess" ) ) {
+                               $( opts.id ).empty();
+                               // validation row, column count
+                               // initialize global value.
+                               widget._lastIndex = opts.row;
+                               widget._bufferSize = ( parseInt( ( opts.row / 4 ), 10 ) );
+                               widget._totalItemCnt = $( window[opts.dbtable] ).size();
+                               widget._pushData( ( opts.template ), window[opts.dbtable] );
+                               widget._reposition();
+                               widget._addEvents();
+                       }
+               },
+               _pushData : function ( template, data ) {
+                       var widget = this,
+                               opts = this.options,
+                               dataTable = data,
+                               myTemplate = $( "#" + template ),
+                               viewcount = opts.row * opts.column,
+                               lastIndex = viewcount,
+                               index = 0,
+                               rowIndex = 0,
+                               colIndex = 0,
+                               wrapBlock = null;
+
+                       for ( rowIndex = 0; rowIndex < opts.row; rowIndex += 1 ) {
+                               wrapBlock = widget._makeWrapBlock( myTemplate, dataTable );
+                               $( wrapBlock ).attr( "id", "block_" + rowIndex );
+                               $( opts.id ).append( wrapBlock );
+                       }
+                       widget._blockHeight = $( wrapBlock ).outerHeight();
+               },
+               // make a single row block
+               _makeWrapBlock : function ( myTemplate, dataTable ) {
+                       var widget = this,
+                               opts = widget.options,
+                               index = widget._currentIndex,
+                               htmlData = null,
+                               colIndex = 0,
+                               wrapBlock = document.createElement( "div" );
+
+                       $( wrapBlock ).addClass( "ui-virtualgrid-wrapblock" );
+                       for ( colIndex = 0; colIndex < opts.column; colIndex++ ) {
+                               htmlData = myTemplate.tmpl( dataTable[index] );
+                               $( wrapBlock ).append( htmlData );
+                               index = index <= widget._totalItemCnt ? index + 1 : 0;
+                       }
+                       widget._currentIndex = index;
+                       return wrapBlock;
+               },
+               _reposition : function () {
+                       var widget = this,
+                               $view = widget.element,
+                               opts = this.options,
+                               wrapsBlocks = null,
+                               childBlocks = null,
+                               blockCount = 0,
+                               index = 0,
+                               subIndex = 0,
+                               firstBlock = $( ".ui-virtualgrid-wrapblock:first" ),
+                               subBlocks = firstBlock.children();
+
+                       widget._blockHeight = firstBlock.outerHeight();
+                       widget._titleHeight = firstBlock.position().top;
+
+                       if ( subBlocks[0] ) {
+                               widget._columnWidth = $( subBlocks[0] ).outerWidth();
+                       }
+
+                       wrapsBlocks = $( ".ui-virtualgrid-wrapblock" );
+                       blockCount = wrapsBlocks.length;
+                       for ( index = 0; index < blockCount; index += 1 ) {
+                               $( wrapsBlocks[index] ).css( "top", widget._titleHeight + ( index * widget._blockHeight  ) );
+                               childBlocks = $( wrapsBlocks[index] ).children();
+                               for ( subIndex = 0; subIndex < childBlocks.length; subIndex += 1 ) {
+                                       $( childBlocks[subIndex] ).css( "left", ( subIndex * widget._columnWidth ) + 'px' );
+                               }
+                       }
+                       // check total row count and setup total height
+                       widget._totalRowCnt = ( widget._totalItemCnt % opts.column ) === 0 ? ( widget._totalItemCnt / opts.column ) : ( parseInt( ( widget._totalItemCnt / opts.column ), 10 ) + 1 );
+                       $( opts.id ).height( widget._totalRowCnt * widget._blockHeight );
+               },
+
+               _addEvents : function () {
+                       var widget = this;
+
+                       $( document ).bind( "scrollupdate.virtualgrid", function ( event ) {
+                               widget._doScrollEvent(event);
+                       });
+
+                       $( document ).bind( "scrollstop.virtualgrid", function ( event ) {
+                               widget._doScrollEvent(event);
+                       });
+               },
+
+               _doScrollEvent : function ( event ) {
+                       var widget = this,
+                               $view = this.element,
+                               opts = widget.options,
+                               dataList = window [opts.dbtable],
+                               filterCondition = 0,
+                               replaceRowCnt = 0,
+                               replacedCount = 0,
+                               $scrollview = $view.closest (".ui-scrollview-view"),
+                               transformValue = null,
+                               curWindowTop = 0;
+
+                       transformValue = widget._matrixToArray ($scrollview.css ("-webkit-transform"));
+                       curWindowTop = Math.abs (transformValue [5]);
+                       if (widget._prevPos > curWindowTop) {
+                               widget._direction = widget.SCROLL_UP;
+                       } else if (widget._prevPos < curWindowTop) {
+                               widget._direction = widget.SCROLL_DOWN;
+                       }
+
+                       if (widget._direction == widget.SCROLL_DOWN) {
+                               filterCondition = (curWindowTop - widget._blockHeight );
+                               replaceRowCnt = $ (".ui-virtualgrid-wrapblock").filter (function () {
+                                       return (parseInt (($ (this).position ().top ), 10) < filterCondition );
+                               }).size ();
+                               if (replaceRowCnt > widget._bufferSize) {
+                                       $ (document).bind ("touchstart.virtualgrid", function (event) {
+                                               event.preventDefault ();
+                                       });
+
+                                       replaceRowCnt = replaceRowCnt - widget._bufferSize;
+                                       replacedCount = widget._moveTopBottom (widget._firstIndex, widget._lastIndex, replaceRowCnt, opts.dbkey);
+                                       widget._firstIndex += replacedCount;
+                                       widget._lastIndex += replacedCount;
+                                       widget._numTopItems -= replacedCount;
+                                       $ (document).unbind ("touchstart.virtualgrid");
+                               }
+                       } else if (widget._direction == widget.SCROLL_UP) {
+                               filterCondition = (curWindowTop + widget._viewHeight + ( widget._blockHeight * 3) );
+                               replaceRowCnt = $ (".ui-virtualgrid-wrapblock").filter (function () {
+                                       return (parseInt (($ (this).position ().top ), 10) > filterCondition );
+                               }).size ();
+                               if (replaceRowCnt > widget._bufferSize) {
+                                       $ (document).bind ("touchstart.virtualgrid", function (event) {
+                                               event.preventDefault ();
+                                       });
+
+                                       replaceRowCnt = replaceRowCnt - widget._bufferSize;
+                                       replacedCount = widget._moveBottomTop (widget._firstIndex, widget._lastIndex, replaceRowCnt, opts.dbkey);
+                                       widget._firstIndex -= replacedCount;
+                                       widget._lastIndex -= replacedCount;
+                                       widget._numTopItems += replacedCount;
+                                       $ (document).unbind ("touchstart.virtualgrid");
+                               }
+                       }
+                       // save preve position information.
+                       widget._prevPos = curWindowTop;
+               },
+
+               /* Matrix to Array function written by Blender@stackoverflow.nnikishi@emich.edu*/
+               _matrixToArray : function ( matrix ) {
+                       var contents = matrix.substr( 7 );
+                       contents = contents.substr( 0, contents.length - 1 );
+                       return contents.split( ', ' );
+               },
+               //Move older item to bottom
+               _moveTopBottom : function ( v_firstIndex, v_lastIndex, num, key ) {
+                       if ( v_firstIndex < 0 ) {
+                               return;
+                       }
+
+                       if ( num < 1 ) {
+                               return;
+                       }
+
+                       var widget = this,
+                               opts = widget.options,
+                               dataList = window[opts.dbtable],
+                               dataIndex = ( ( v_lastIndex ) * opts.column ),
+                               count = 0,
+                               curBlock = null,
+                               cur_item = null,
+                               myTemplate = null,
+                               htmlData = null,
+                               i = 0,
+                               j = 0,
+                               contentsBlocks = null;
+
+                       // wrap block count
+                       // print argument value
+                       for ( i = 0; i < num; i += 1 ) {
+                               if ( v_lastIndex >= widget._totalRowCnt ) {
+                                       break;
+                               }
+
+                               // select block
+                               curBlock = $( "#block_" + ( v_firstIndex + i ) );
+                               if ( !curBlock ) {
+                                       break;
+                               }
+
+                               contentsBlocks = curBlock.children();
+
+                               for ( j = 0; j < opts.column; j += 1 ) {
+                                       cur_item = contentsBlocks[j];
+                                       myTemplate = $( "#" + opts.template );
+                                       htmlData = myTemplate.tmpl( dataList[dataIndex] );
+                                       widget._replace( cur_item, htmlData, key );
+                                       dataIndex += 1;
+                               }
+
+                               curBlock.css( "top", widget._titleHeight + widget._blockHeight * ( ( v_lastIndex ) ) ).css( "left", 0 );
+
+                               contentsBlocks.css( "top", widget._titleHeight + widget._blockHeight * ( ( v_lastIndex ) ) );
+                               curBlock.attr( "id", "block_" + ( v_lastIndex ) );
+
+                               v_lastIndex++;
+                               count++;
+                       }
+                       return count;
+               },
+               _moveBottomTop : function ( v_firstIndex, v_lastIndex, num, key ) {
+                       if ( v_firstIndex < 0 ) {
+                               return;
+                       }
+
+                       if ( num < 1 ) {
+                               return;
+                       }
+
+                       var widget = this,
+                               opts = widget.options,
+                               dataList = window[opts.dbtable],
+                               dataIndex = ( ( v_firstIndex - 1 ) * opts.column ),
+                               targetBlock = $( ".ui-virtualgrid-wrapblock:first" ),
+                               curBlock = null,
+                               contentsBlocks = null,
+                               cur_item = null,
+                               myTemplate = null,
+                               htmlData = null,
+                               i = 0,
+                               j = 0,
+                               count = 0;
+
+                       // print argument value
+                       for ( i = 0; i < num; i += 1 ) {
+                               if ( v_firstIndex - 1 < 0 ) {
+                                       break;
+                               }
+
+                               // select block
+                               curBlock = $( "#block_" + ( ( v_lastIndex - 1 ) - i ) );
+                               if ( !curBlock ) {
+                                       break;
+                               }
+
+                               dataIndex = ( ( v_firstIndex - 1 ) * opts.column );
+
+                               contentsBlocks = curBlock.children();
+                               for ( j = 0; j < opts.column; j += 1 ) {
+                                       cur_item = contentsBlocks[j];
+                                       myTemplate = $( "#" + opts.template );
+                                       htmlData = myTemplate.tmpl( dataList[dataIndex] );
+                                       widget._replace( cur_item, htmlData, key );
+                                       dataIndex++;
+                               }
+                               curBlock.css( "top", widget._titleHeight + widget._blockHeight * ( ( v_firstIndex - 1 ) ) ).css( "left", 0 );
+                               curBlock.attr( "id", "block_" + ( v_firstIndex - 1 ) );
+                               contentsBlocks.css( "top", widget._titleHeight + widget._blockHeight * ( ( v_firstIndex - 1 ) ) );
+
+                               v_firstIndex -= 1;
+                               count++;
+                       }
+                       return count;
+               },
+               /* Text & image src replace function */
+               // @param oldItem   : prev HtmlDivElement
+               // @param newItem   : new HtmlDivElement for replace
+               // @param key       :
+               _replace : function ( oldItem, newItem, key ) {
+                       $( oldItem ).find( ".ui-li-text-main", ".ui-li-text-sub", "ui-btn-text" ).each( function ( index ) {
+                               var oldObj = $( this ),
+                                       newText = $( newItem ).find( ".ui-li-text-main", ".ui-li-text-sub", "ui-btn-text" ).eq( index ).text();
+
+                               $( oldObj ).contents().filter( function () {
+                                       return ( this.nodeType == 3 );
+                               }).get( 0 ).data = newText;
+                       });
+
+                       $( oldItem ).find( "img" ).each( function ( imgIndex ) {
+                               var oldObj = $( this ),
+                                       newImg = $( newItem ).find( "img" ).eq( imgIndex ).attr( "src" );
+
+                               $( oldObj ).attr( "src", newImg );
+                       });
+                       if ( key ) {
+                               $( oldItem ).data( key, $( newItem ).data( key ) );
+                       }
+               }
+       });
+
+       $( document ).bind( "pagecreate create", function () {
+               $( ":jqmData(role='virtualgrid')" ).virtualgrid();
+       });
+
+} ( jQuery, window ) );
+
index a4398fd..6fc9713 100755 (executable)
@@ -1,6 +1,27 @@
-/*\r
+/* ***************************************************************************\r
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.\r
+ *\r
+ * Permission is hereby granted, free of charge, to any person obtaining a\r
+ * copy of this software and associated documentation files (the "Software"),\r
+ * to deal in the Software without restriction, including without limitation\r
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
+ * and/or sell copies of the Software, and to permit persons to whom the\r
+ * Software is furnished to do so, subject to the following conditions:\r
+ *\r
+ * The above copyright notice and this permission notice shall be included in\r
+ * all copies or substantial portions of the Software.\r
+ *\r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\r
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\r
+ * DEALINGS IN THE SOFTWARE.\r
+ * ***************************************************************************\r
+ *\r
  *     Author: Wongi Lee <wongi11.lee@samsung.com>\r
-*/\r
+ */\r
 \r
 /**\r
  * Virtual List Widget for unlimited data.\r
  *             data-template : jQuery.template ID that populate into virtual list \r
  *             data-dbtable : DB Table name. It used as window[DB NAME]. Loaded data should be converted as window object.\r
  *             data-dbkey : Unique key of DB Table. To sync each element on virtual list with DB table. \r
+ *             data-row : Optional. Set number of <li> elements that are used for data handling. \r
  *             \r
  *             ID : <UL> element that has "data-role=virtuallist" must have ID attribute.\r
  *             Class : <UL> element that has "data-role=virtuallist" should have "vlLoadSuccess" class to guaranty DB loading is completed. \r
  *\r
- *\r
- * APIs:\r
+ * * APIs:\r
  *\r
  *             create ( void )\r
  *                     : API to call _create method. API for AJAX or DB loading callback.\r
@@ -32,8 +53,8 @@
  *             touchstart : Temporary preventDefault applied on touchstart event to avoid broken screen.\r
  *\r
  * Examples:\r
- * \r
- *             <script id="tmp-3-2-7" type="text/x-jquery-tmpl">\r
+ *\r
+ *             <script id="tmp-3-2-7" type="text/x-jquery-tmpl">\r
  *                     <li class="ui-li-3-2-7">\r
  *                             <span class="ui-li-text-main">${NAME}</span>\r
  *                             <img src="00_winset_icon_favorite_on.png" class="ui-li-icon-sub">\r
  *                     </li>\r
  *             </script>\r
  *\r
- *             <ul id="virtuallist-normal_3_2_7_ul" data-role="virtuallistview" data-template="tmp-3-2-7" data-dbtable="JSON_DATA">\r
+ *             <ul id="virtuallist-normal_3_2_7_ul" data-role="virtuallistview" data-template="tmp-3-2-7" data-dbtable="JSON_DATA" data-row="100">\r
  *             </ul>\r
  *\r
  */\r
 \r
 \r
-(function( $, undefined ) {\r
-\r
-//Keeps track of the number of lists per page UID\r
-//This allows support for multiple nested list in the same page\r
-//https://github.com/jquery/jquery-mobile/issues/1617\r
-var listCountPerPage = {};\r
-\r
-/* Code for Virtual List Demo */\r
-var    INIT_LIST_NUM = 100;\r
-var    PAGE_BUF = (INIT_LIST_NUM/2);\r
-var    TOTAL_ITEMS = 0;\r
-var LINE_H = 0;\r
-var TITLE_H = 0;       \r
-var CONTAINER_W = 0;\r
-\r
-/* ENUM */\r
-var    NO_SCROLL = 0;  \r
-var    SCROLL_DOWN = 1;\r
-var    SCROLL_UP = -1;\r
-\r
-var i =0;\r
-var direction = NO_SCROLL;\r
-var first_index = 0;                           //first id of <li> element.\r
-var last_index = INIT_LIST_NUM -1;     //last id of <li> element.\r
-\r
-var num_top_items = 0;                         //By scroll move, number of hidden elements.\r
-\r
-$.widget( "tizen.virtuallistview", $.mobile.widget, {\r
-       options: {\r
-               theme: "s",\r
-               countTheme: "c",\r
-               headerTheme: "b",\r
-               dividerTheme: "b",\r
-               splitIcon: "arrow-r",\r
-               splitTheme: "b",\r
-               inset: false,\r
-               id:     "",                                     /* Virtual list UL elemet's ID */\r
-               childSelector: " li",   /* To support swipe list */\r
-               dbtable: "",\r
-               template : "",\r
-               dbkey: false,                   /* Data's unique Key */\r
-               scrollview: false,\r
-               initSelector: ":jqmData(role='virtuallistview')"\r
-       },\r
-\r
-       _stylerMouseUp: function()\r
-       {\r
-               $( this ).addClass( "ui-btn-up-s" );\r
-               $( this ).removeClass( "ui-btn-down-s" );\r
-       },\r
-\r
-       _stylerMouseDown: function()\r
-       {\r
-               $( this ).addClass( "ui-btn-down-s" );\r
-               $( this ).removeClass( "ui-btn-up-s" );\r
-       },\r
-       \r
-       _stylerMouseOver: function()\r
-       {\r
-               $( this ).toggleClass( "ui-btn-hover-s" );              \r
-       },\r
-       \r
-       _stylerMouseOut: function()\r
-       {\r
-               $( this ).toggleClass( "ui-btn-hover-s" );\r
-       },\r
-\r
-       _pushData: function ( template, data ) {\r
-               var o = this.options;\r
-               \r
-               var dataTable = data;\r
-               \r
-               var myTemplate = $( "#" + template );\r
-               \r
-               var lastIndex = ( INIT_LIST_NUM > data.length ? data.length : INIT_LIST_NUM ); \r
-               \r
-               for ( i = 0; i < lastIndex; i++ ) \r
-               {\r
-                       var htmlData = myTemplate.tmpl( dataTable[i] );\r
-                       $( o.id ).append( $(htmlData).attr( 'id', 'li_'+i ) );\r
-               }\r
-               \r
-               /* After push data, re-style virtuallist widget */\r
-               $( o.id ).trigger( "create" );\r
-       }, \r
-\r
-       _reposition: function( event ) {\r
-               var o;\r
-               \r
-               if ( event.data ) {\r
-                       o = event.data;\r
-               }\r
-               else {\r
-                       o = event;\r
-               }\r
-               \r
-               var t = this;\r
-               \r
-               if ($(o.id + o.childSelector).size() > 0){\r
-                       TITLE_H = $( o.id + o.childSelector + ':first' ).position().top;\r
-                       LINE_H = $( o.id + o.childSelector + ':first' ).outerHeight();\r
-                       \r
-                       CONTAINER_W = $( o.id ).innerWidth();\r
-                       \r
-                       var padding = parseInt( $( o.id + o.childSelector ).css( "padding-left" )) + parseInt( $(o.id + o.childSelector).css( "padding-right" ) );\r
-                       \r
-                       /* Add style */\r
-                       $( o.id + ">" + o.childSelector ).addClass( "position_absolute" ).addClass( "ui-btn-up-s" )\r
-                                                                                               .bind( "mouseup", t._stylerMouseUp )\r
-                                                                                               .bind( "mousedown", t._stylerMouseDown )                \r
-                                                                                               .bind( "mouseover", t._stylerMouseOver )\r
-                                                                                               .bind( "mouseout", t._stylerMouseOut );\r
-               }\r
+(function ( $, undefined ) {\r
+\r
+       /* Code for Virtual List Demo */\r
+       var listCountPerPage = {},      /* Keeps track of the number of lists per page UID. This allows support for multiple nested list in the same page. https://github.com/jquery/jquery-mobile/issues/1617 */\r
+               TOTAL_ITEMS = 0,\r
+               LINE_H = 0,\r
+               TITLE_H = 0,\r
+               CONTAINER_W = 0,\r
+               NO_SCROLL = 0,                                  /* ENUM */\r
+               SCROLL_DOWN = 1,                                /* ENUM */\r
+               SCROLL_UP = -1,                                 /* ENUM */\r
+               MINIMUM_ROW = 20,\r
+               direction = NO_SCROLL,\r
+               first_index,\r
+               last_index,\r
+               num_top_items = 0;                              //By scroll move, number of hidden elements.\r
+\r
+       $.widget( "tizen.virtuallistview", $.mobile.widget, {\r
+               options: {\r
+                       theme: "s",\r
+                       countTheme: "c",\r
+                       headerTheme: "b",\r
+                       dividerTheme: "b",\r
+                       splitIcon: "arrow-r",\r
+                       splitTheme: "b",\r
+                       inset: false,\r
+                       id:     "",                                     /* Virtual list UL elemet's ID */\r
+                       childSelector: " li",   /* To support swipe list */\r
+                       dbtable: "",\r
+                       template : "",\r
+                       dbkey: false,                   /* Data's unique Key */\r
+                       scrollview: false,\r
+                       row: 100,\r
+                       page_buf: 50,\r
+                       initSelector: ":jqmData(role='virtuallistview')"\r
+               },\r
+\r
+               _stylerMouseUp: function () {\r
+                       $( this ).addClass( "ui-btn-up-s" );\r
+                       $( this ).removeClass( "ui-btn-down-s" );\r
+               },\r
+\r
+               _stylerMouseDown: function () {\r
+                       $( this ).addClass( "ui-btn-down-s" );\r
+                       $( this ).removeClass( "ui-btn-up-s" );\r
+               },\r
+\r
+               _stylerMouseOver: function () {\r
+                       $( this ).toggleClass( "ui-btn-hover-s" );\r
+               },\r
+\r
+               _stylerMouseOut: function () {\r
+                       $( this ).toggleClass( "ui-btn-hover-s" );\r
+               },\r
+\r
+               _pushData: function ( template, data ) {\r
+                       var o = this.options,\r
+                               i,\r
+                               dataTable = data,\r
+                               myTemplate = $( "#" + template ),\r
+                               lastIndex = ( o.row > data.length ? data.length : o.row ),\r
+                               htmlData;\r
+\r
+                       for ( i = 0; i < lastIndex; i++ ) {\r
+                               htmlData = myTemplate.tmpl( dataTable[i] );\r
+                               $( o.id ).append( $( htmlData ).attr( 'id', 'li_' + i ) );\r
+                       }\r
 \r
-               $( o.id + ">" + o.childSelector ).each( function( index ) {\r
-                       $( this ).css( "top", TITLE_H + LINE_H*index + 'px' )\r
-                       .css( "width", CONTAINER_W - padding );\r
-               });\r
-\r
-               /* Set Max List Height */\r
-               $( o.id ).height( TOTAL_ITEMS * LINE_H );\r
-       },\r
-       \r
-       _resize: function( event ) {\r
-               var o;\r
-               \r
-               if ( event.data ) {\r
-                       o = event.data;\r
-               }\r
-               else {\r
-                       o = event;\r
-               }\r
-               \r
-               var t = this;           \r
-               \r
-               CONTAINER_W = $( o.id ).innerWidth();\r
-               \r
-               var padding = parseInt( $( o.id + o.childSelector ).css( "padding-left" )) + parseInt( $( o.id + o.childSelector ).css( "padding-right" ) );\r
-               \r
-               $( o.id + o.childSelector ).each( function(index){\r
-                       $( this ).css( "width", CONTAINER_W - padding );\r
-               });\r
-       },\r
-       \r
-       _scrollmove: function( event ) {\r
-               var velocity = 0;\r
-               var o = event.data;\r
-               var dataList = window[o.dbtable];\r
-               \r
-               /* Text & image src replace function */\r
-               var _replace= function( oldItem, newItem, key ) {\r
-                       $( oldItem ).find( ".ui-li-text-main",".ui-li-text-sub","ui-btn-text" ).each( function( index ) {\r
-                               var oldObj = $( this );\r
-                               var newText = $( newItem ).find( ".ui-li-text-main",".ui-li-text-sub","ui-btn-text" ).eq( index ).text();\r
-                               \r
-                   $( oldObj).contents().filter( function(){ \r
-                       return( this.nodeType == 3 );\r
-                   } ).get( 0 ).data = newText;\r
-                       });\r
-                       \r
-                       $( oldItem ).find( "img" ).each( function( imgIndex ) {\r
-                               var oldObj = $( this );\r
+                       /* After push data, re-style virtuallist widget */\r
+                       $( o.id ).trigger( "create" );\r
+               },\r
 \r
-                               var newImg = $( newItem ).find( "img" ).eq( imgIndex ).attr( "src" );\r
-                               \r
-                               $( oldObj ).attr( "src", newImg );\r
-                       });\r
-                       \r
-                       if (key) {\r
-                               $( oldItem ).data(key, $( newItem ).data(key));\r
+               _reposition: function ( event ) {\r
+                       var o,\r
+                               t = this,\r
+                               padding;\r
+\r
+                       if ( event.data ) {\r
+                               o = event.data;\r
+                       } else {\r
+                               o = event;\r
+                       }\r
+\r
+                       if ( $( o.id + o.childSelector ).size() > 0 ) {\r
+                               TITLE_H = $( o.id + o.childSelector + ':first' ).position().top;\r
+                               LINE_H = $( o.id + o.childSelector + ':first' ).outerHeight();\r
+\r
+                               CONTAINER_W = $( o.id ).innerWidth();\r
+\r
+                               padding = parseInt( $( o.id + o.childSelector ).css( "padding-left" ), 10 ) + parseInt( $( o.id + o.childSelector ).css( "padding-right" ), 10 );\r
+\r
+                               /* Add style */\r
+                               $( o.id + ">" + o.childSelector ).addClass( "position_absolute" ).addClass( "ui-btn-up-s" )\r
+                                                                                                       .bind( "mouseup", t._stylerMouseUp )\r
+                                                                                                       .bind( "mousedown", t._stylerMouseDown )\r
+                                                                                                       .bind( "mouseover", t._stylerMouseOver )\r
+                                                                                                       .bind( "mouseout", t._stylerMouseOut );\r
                        }\r
-           };\r
-               \r
-               //Move older item to bottom\r
-               var _moveTopBottom= function( v_firstIndex, v_lastIndex, num, key ) {\r
-                       if (v_firstIndex < 0) {\r
-                               return;\r
+\r
+                       $( o.id + ">" + o.childSelector ).each( function ( index ) {\r
+                               $( this ).css( "top", TITLE_H + LINE_H * index + 'px' )\r
+                                       .css( "width", CONTAINER_W - padding );\r
+                       } );\r
+\r
+                       /* Set Max List Height */\r
+                       $( o.id ).height( TOTAL_ITEMS * LINE_H );\r
+               },\r
+\r
+               _resize: function ( event ) {\r
+                       var o,\r
+                               t = this,\r
+                               padding;\r
+\r
+                       if ( event.data ) {\r
+                               o = event.data;\r
+                       } else {\r
+                               o = event;\r
                        }\r
-                       \r
-                       for (i=0; i<num; i++)\r
-                       {\r
-                               if (v_lastIndex + i > TOTAL_ITEMS)\r
-                                       break;\r
-                               \r
-                               var cur_item = $('#li_' + (v_firstIndex + i));\r
-                               \r
-                               if (cur_item) {\r
-                                       /* Make New <LI> element from template. */\r
-                                       var myTemplate = $( "#" + o.template );\r
-                                       var htmlData = myTemplate.tmpl( dataList[ v_lastIndex + i ] );\r
-                                       \r
-                                       /* Copy all data to current item. */\r
-                                       _replace( cur_item, htmlData, key );\r
-                                       \r
-                                       /* Set New Position */\r
-                                       ( cur_item ).css( 'top', TITLE_H + LINE_H*( v_lastIndex + 1 + i ) ).attr( 'id', 'li_' +( v_lastIndex + 1+ i ) );\r
+\r
+                       CONTAINER_W = $( o.id ).innerWidth();\r
+\r
+                       padding = parseInt( $( o.id + o.childSelector ).css( "padding-left" ), 10 ) + parseInt( $( o.id + o.childSelector ).css( "padding-right" ), 10 );\r
+\r
+                       $( o.id + o.childSelector ).each( function (index) {\r
+                               $( this ).css( "width", CONTAINER_W - padding );\r
+                       } );\r
+               },\r
+\r
+               _scrollmove: function ( event ) {\r
+                       var velocity = 0,\r
+                               o = event.data,\r
+                               i,\r
+                               dataList = window[o.dbtable],\r
+                               _replace,               /* Function */\r
+                               _moveTopBottom, /* Function */\r
+                               _moveBottomTop, /* Function */\r
+                               _matrixToArray, /* Function */\r
+                               $el,\r
+                               transformValue,\r
+                               curWindowTop,\r
+                               cur_num_top_itmes;\r
+\r
+                       /* Text & image src replace function */\r
+                       _replace = function ( oldItem, newItem, key ) {\r
+                               var oldObj,\r
+                                       newText,\r
+                                       newImg;\r
+\r
+                               $( oldItem ).find( ".ui-li-text-main", ".ui-li-text-sub", "ui-btn-text" ).each( function ( index ) {\r
+                                       oldObj = $( this );\r
+                                       newText = $( newItem ).find( ".ui-li-text-main", ".ui-li-text-sub", "ui-btn-text" ).eq( index ).text();\r
+\r
+                                       $( oldObj).contents().filter( function () {\r
+                                               return ( this.nodeType == 3 );\r
+                                       } ).get( 0 ).data = newText;\r
+                               } );\r
+\r
+                               $( oldItem ).find( "img" ).each( function ( imgIndex ) {\r
+                                       oldObj = $( this );\r
+                                       newImg = $( newItem ).find( "img" ).eq( imgIndex ).attr( "src" );\r
+\r
+                                       $( oldObj ).attr( "src", newImg );\r
+                               } );\r
+\r
+                               if (key) {\r
+                                       $( oldItem ).data( key, $( newItem ).data( key ) );\r
                                }\r
-                               else {\r
-                                       break;\r
+                       };\r
+\r
+                       //Move older item to bottom\r
+                       _moveTopBottom = function ( v_firstIndex, v_lastIndex, num, key ) {\r
+                               var myTemplate,\r
+                                       htmlData,\r
+                                       cur_item;\r
+\r
+                               if (v_firstIndex < 0) {\r
+                                       return;\r
                                }\r
-                       }\r
-               };\r
 \r
-               // Move older item to bottom\r
-               var _moveBottomTop= function( v_firstIndex, v_lastIndex, num, key ) {\r
-                       if ( v_firstIndex < 0 ) {\r
-                               return;\r
-                       }\r
-                       \r
-                       for ( i=0; i<num; i++ )\r
-                       {\r
-                               var cur_item = $( '#li_' + ( v_lastIndex - i ) );\r
-\r
-                               if ( cur_item ) {\r
-                                       if ( v_firstIndex-1-i < 0 ) {\r
-                                               break;  \r
+                               for ( i = 0; i < num; i++ ) {\r
+                                       if ( v_lastIndex + i > TOTAL_ITEMS ) {\r
+                                               break;\r
+                                       }\r
+\r
+                                       cur_item = $( '#li_' + ( v_firstIndex + i ) );\r
+\r
+                                       if ( cur_item ) {\r
+                                               /* Make New <LI> element from template. */\r
+                                               myTemplate = $( "#" + o.template );\r
+                                               htmlData = myTemplate.tmpl( dataList[ v_lastIndex + i ] );\r
+\r
+                                               /* Copy all data to current item. */\r
+                                               _replace( cur_item, htmlData, key );\r
+\r
+                                               /* Set New Position */\r
+                                               ( cur_item ).css( 'top', TITLE_H + LINE_H * ( v_lastIndex + 1 + i ) ).attr( 'id', 'li_' + ( v_lastIndex + 1 + i ) );\r
+                                       } else {\r
+                                               break;\r
                                        }\r
-                               \r
-                                       /* Make New <LI> element from template. */\r
-                                       var myTemplate = $( "#" + o.template );\r
-                                       var htmlData = myTemplate.tmpl( dataList[ v_firstIndex - 1 - i ] );\r
-                                       \r
-                                       /* Copy all data to current item. */\r
-                                       _replace( cur_item, htmlData, key );\r
-\r
-                                       /* Set New Position */\r
-                                       $( cur_item ).css( 'top', TITLE_H + LINE_H * ( v_firstIndex - 1 - i )).attr( 'id', 'li_' +( v_firstIndex - 1 - i ));\r
                                }\r
-                               else {\r
-                                       break;\r
+                       };\r
+\r
+                       // Move older item to bottom\r
+                       _moveBottomTop = function ( v_firstIndex, v_lastIndex, num, key ) {\r
+                               var myTemplate,\r
+                                       htmlData,\r
+                                       cur_item;\r
+\r
+                               if ( v_firstIndex < 0 ) {\r
+                                       return;\r
                                }\r
-                       }\r
-               };\r
-               \r
-               /* Matrix to Array function written by Blender@stackoverflow.nnikishi@emich.edu*/\r
-               var matrixToArray = function( matrix ) {\r
-                   var contents = matrix.substr( 7 );\r
-                   contents = contents.substr( 0, contents.length - 1 );\r
-\r
-                   return contents.split( ', ' );\r
-               };              \r
-               \r
-               // Get scroll direction and velocity\r
-               /* with Scroll view */\r
-               if ( o.scrollview ) {\r
-                       var $el = $( o.id ).parentsUntil( ".ui-page" ).find( ".ui-scrollview-view" );\r
-                       var transformValue = matrixToArray( $el.css( "-webkit-transform" ) );\r
-                       \r
-                       var curWindowTop = Math.abs( transformValue[ 5 ] );     /* Y vector */\r
-               }\r
-       else {\r
-               var curWindowTop = $( window ).scrollTop() - LINE_H;\r
-       }\r
-               \r
-               var cur_num_top_itmes = $( o.id + o.childSelector ).filter( function(){\r
-                                                                       return (parseInt($( this ).css( "top" )) < curWindowTop);\r
-                                                               } ).size(); \r
-               \r
-               if ( num_top_items < cur_num_top_itmes ) {\r
-                       direction = SCROLL_DOWN;\r
-                       velocity = cur_num_top_itmes - num_top_items;\r
-                       num_top_items = cur_num_top_itmes;\r
-               }\r
-               else if ( num_top_items > cur_num_top_itmes ) {\r
-                       direction = SCROLL_UP;\r
-                       velocity = num_top_items - cur_num_top_itmes;\r
-                       num_top_items = cur_num_top_itmes;\r
-               }\r
 \r
-               // Move items\r
-               if( direction == SCROLL_DOWN )\r
-               {\r
-                       if ( cur_num_top_itmes > PAGE_BUF ) {\r
-                               if ( last_index + velocity > TOTAL_ITEMS ) {\r
-                                       velocity = TOTAL_ITEMS - last_index -1;\r
+                               for ( i = 0; i < num; i++ ) {\r
+                                       cur_item = $( '#li_' + ( v_lastIndex - i ) );\r
+\r
+                                       if ( cur_item ) {\r
+                                               if ( v_firstIndex - 1 - i < 0 ) {\r
+                                                       break;\r
+                                               }\r
+\r
+                                               /* Make New <LI> element from template. */\r
+                                               myTemplate = $( "#" + o.template );\r
+                                               htmlData = myTemplate.tmpl( dataList[ v_firstIndex - 1 - i ] );\r
+\r
+                                               /* Copy all data to current item. */\r
+                                               _replace( cur_item, htmlData, key );\r
+\r
+                                               /* Set New Position */\r
+                                               $( cur_item ).css( 'top', TITLE_H + LINE_H * ( v_firstIndex - 1 - i ) ).attr( 'id', 'li_' + ( v_firstIndex - 1 - i ) );\r
+                                       } else {\r
+                                               break;\r
+                                       }\r
                                }\r
-                               \r
-                               /* Prevent scroll touch event while DOM access */\r
-                               $(document).bind( "touchstart.virtuallist", function(event) {\r
-                                         event.preventDefault();\r
-                               });                             \r
-                               \r
-                               _moveTopBottom( first_index, last_index, velocity, o.dbkey );\r
-                               \r
-                               first_index += velocity;\r
-                               last_index += velocity;\r
-                               num_top_items -= velocity;\r
-                               \r
-                               /* Unset prevent touch event */\r
-                               $( document ).unbind( "touchstart.virtuallist" );\r
+                       };\r
+\r
+                       /* Matrix to Array function written by Blender@stackoverflow.nnikishi@emich.edu*/\r
+                       _matrixToArray = function ( matrix ) {\r
+                               var contents = matrix.substr( 7 );\r
+\r
+                               contents = contents.substr( 0, contents.length - 1 );\r
+\r
+                               return contents.split( ', ' );\r
+                       };\r
+\r
+                       // Get scroll direction and velocity\r
+                       /* with Scroll view */\r
+                       if ( o.scrollview ) {\r
+                               $el = $( o.id ).parentsUntil( ".ui-page" ).find( ".ui-scrollview-view" );\r
+                               transformValue = _matrixToArray( $el.css( "-webkit-transform" ) );\r
+                               curWindowTop = Math.abs( transformValue[ 5 ] ); /* Y vector */\r
+                       } else {\r
+                               curWindowTop = $( window ).scrollTop() - LINE_H;\r
                        }\r
-               }\r
-               else if( direction == SCROLL_UP ) {\r
-                       if ( cur_num_top_itmes <= PAGE_BUF ) {\r
-                               if ( first_index < velocity ) {\r
-                                       velocity = first_index;\r
-                               }\r
 \r
-                               /* Prevent scroll touch event while DOM access */\r
-                               $( document ).bind( "touchstart.virtuallist", function( event ) {\r
-                                         event.preventDefault();\r
-                               });             \r
-                               \r
-                               _moveBottomTop( first_index, last_index, velocity, o.dbkey );\r
-                               \r
-                               first_index -= velocity;\r
-                               last_index -= velocity;\r
-                               num_top_items += velocity;\r
-                               \r
-                               /* Unset prevent touch event */\r
-                               $( document ).unbind( "touchstart.virtuallist" );                               \r
+                       cur_num_top_itmes = $( o.id + o.childSelector ).filter( function () {\r
+                               return (parseInt( $( this ).css( "top" ), 10 ) < curWindowTop );\r
+                       } ).size();\r
+\r
+                       if ( num_top_items < cur_num_top_itmes ) {\r
+                               direction = SCROLL_DOWN;\r
+                               velocity = cur_num_top_itmes - num_top_items;\r
+                               num_top_items = cur_num_top_itmes;\r
+                       } else if ( num_top_items > cur_num_top_itmes ) {\r
+                               direction = SCROLL_UP;\r
+                               velocity = num_top_items - cur_num_top_itmes;\r
+                               num_top_items = cur_num_top_itmes;\r
                        }\r
-                       \r
-                       if ( first_index < PAGE_BUF ) {\r
-                               num_top_items = first_index;\r
+\r
+                       // Move items\r
+                       if ( direction == SCROLL_DOWN ) {\r
+                               if ( cur_num_top_itmes > o.page_buf ) {\r
+                                       if ( last_index + velocity > TOTAL_ITEMS ) {\r
+                                               velocity = TOTAL_ITEMS - last_index - 1;\r
+                                       }\r
+\r
+                                       /* Prevent scroll touch event while DOM access */\r
+                                       $(document).bind( "touchstart.virtuallist", function (event) {\r
+                                               event.preventDefault();\r
+                                       });\r
+\r
+                                       _moveTopBottom( first_index, last_index, velocity, o.dbkey );\r
+\r
+                                       first_index += velocity;\r
+                                       last_index += velocity;\r
+                                       num_top_items -= velocity;\r
+\r
+                                       /* Unset prevent touch event */\r
+                                       $( document ).unbind( "touchstart.virtuallist" );\r
+                               }\r
+                       } else if ( direction == SCROLL_UP ) {\r
+                               if ( cur_num_top_itmes <= o.page_buf ) {\r
+                                       if ( first_index < velocity ) {\r
+                                               velocity = first_index;\r
+                                       }\r
+\r
+                                       /* Prevent scroll touch event while DOM access */\r
+                                       $( document ).bind( "touchstart.virtuallist", function ( event ) {\r
+                                               event.preventDefault();\r
+                                       });\r
+\r
+                                       _moveBottomTop( first_index, last_index, velocity, o.dbkey );\r
+\r
+                                       first_index -= velocity;\r
+                                       last_index -= velocity;\r
+                                       num_top_items += velocity;\r
+\r
+                                       /* Unset prevent touch event */\r
+                                       $( document ).unbind( "touchstart.virtuallist" );\r
+                               }\r
+\r
+                               if ( first_index < o.page_buf ) {\r
+                                       num_top_items = first_index;\r
+                               }\r
                        }\r
-               }\r
-       },\r
-       \r
-       recreate: function( newArray ){\r
-               var t = this;\r
-               var o = this.options;\r
-               \r
-               $( o.id ).empty();\r
-               \r
-               TOTAL_ITEMS = newArray.length;\r
-               direction = NO_SCROLL;\r
-               first_index = 0;\r
-               last_index = INIT_LIST_NUM -1;          \r
-               \r
-               t._pushData( ( o.template ), newArray );\r
-               \r
-               if (o.childSelector == " ul" ) {\r
-                       $( o.id + " ul" ).swipelist();  \r
-               }\r
-               \r
-               $( o.id ).virtuallistview();\r
-               \r
-               t._reposition( o );\r
-               \r
-               t.refresh( true );\r
-       },\r
-\r
-       _initList: function() {\r
-               var t = this;\r
-               var o = this.options;\r
-               \r
-               /* After AJAX loading success */\r
-               o.dbtable = t.element.data( "dbtable" );\r
-               \r
-               TOTAL_ITEMS = $(window[o.dbtable]).size();\r
-               \r
-               /* Make Gen list by template */\r
-               t._pushData((o.template), window[o.dbtable]);\r
-       \r
-               $( o.id ).parentsUntil( ".ui-page" ).parent().one( "pageshow", o, t._reposition);\r
-\r
-               /* Scrollview */\r
-               $( document ).bind( "scrollstop.virtuallist", t.options, t._scrollmove );\r
-               \r
-               $( window ).bind( "resize.virtuallist", t._resize );\r
-\r
-               if ( o.childSelector == " ul" ) {\r
-                       $( o.id + " ul" ).swipelist();\r
-               }\r
-           \r
-               t.refresh( true );\r
-       },\r
-       \r
-       create: function() {\r
-               var o = this.options;\r
-\r
-               /* external API for AJAX callback */\r
-               this._create( "create" );\r
-               \r
-               this._reposition( o );\r
-       },\r
-       \r
-       _create: function( event ) {\r
-               var t = this;\r
-               var o = this.options; \r
-               \r
-               // create listview markup\r
-               t.element.addClass( function( i, orig ) {\r
-                       return orig + " ui-listview ui-virtual-list-container" + ( t.options.inset ? " ui-listview-inset ui-corner-all ui-shadow " : "" );\r
-               });\r
-\r
-               var $el = this.element,\r
-               shortcutsContainer = $('<div class="ui-virtuallist"/>'),\r
-               shortcutsList = $('<ul></ul>'),\r
-               dividers = $el.find(':jqmData(role="virtuallistview" )'),\r
-               lastListItem = null,\r
-               shortcutscroll = this;\r
-               \r
-               o.id = "#" + $el.attr( "id" );\r
-        \r
-               $( o.id ).bind( "pagehide", function( e ){\r
+               },\r
+\r
+               recreate: function ( newArray ) {\r
+                       var t = this,\r
+                               o = this.options;\r
+\r
                        $( o.id ).empty();\r
-               });\r
-           \r
-               /* Scroll view */\r
-               ( $( ".ui-scrollview-clip" ).size()>0 ) ? o.scrollview = true : o.scrollview = false;\r
-\r
-               /* After DB Load complete, Init Vritual list */\r
-               if ($( o.id ).hasClass( "vlLoadSuccess" )) {\r
-                       $( o.id ).empty();              \r
-               \r
-                       if ($el.data( "template" )) {\r
-                               o.template = $el.data( "template" );\r
-                               \r
-                       /* to support swipe list, <li> or <ul> can be main node of virtual list. */\r
-                       if ( $el.data( "swipelist" ) == true ) {\r
-                               o.childSelector = " ul";\r
+\r
+                       TOTAL_ITEMS = newArray.length;\r
+                       direction = NO_SCROLL;\r
+                       first_index = 0;\r
+                       last_index = o.row - 1;\r
+\r
+                       t._pushData( ( o.template ), newArray );\r
+\r
+                       if (o.childSelector == " ul" ) {\r
+                               $( o.id + " ul" ).swipelist();\r
                        }\r
-                       else {\r
-                               o.shildSelector = " li";\r
+\r
+                       $( o.id ).virtuallistview();\r
+\r
+                       t._reposition( o );\r
+\r
+                       t.refresh( true );\r
+               },\r
+\r
+               _initList: function () {\r
+                       var t = this,\r
+                               o = this.options;\r
+\r
+                       /* After AJAX loading success */\r
+                       o.dbtable = t.element.data( "dbtable" );\r
+\r
+                       TOTAL_ITEMS = $(window[o.dbtable]).size();\r
+\r
+                       /* Make Gen list by template */\r
+                       t._pushData( (o.template), window[o.dbtable]);\r
+\r
+                       $( o.id ).parentsUntil( ".ui-page" ).parent().one( "pageshow", o, t._reposition);\r
+\r
+                       /* Scrollview */\r
+                       $( document ).bind( "scrollstop.virtuallist", t.options, t._scrollmove );\r
+\r
+                       $( window ).bind( "resize.virtuallist", t._resize );\r
+\r
+                       if ( o.childSelector == " ul" ) {\r
+                               $( o.id + " ul" ).swipelist();\r
                        }\r
-               }\r
-                       \r
-               /* Set data's unique key */\r
-               if ( $el.data( "dbkey" ) ) {\r
-                       o.datakey = $el.data( "dbkey" );\r
-               }\r
 \r
-               t._initList();\r
-           }\r
-       },\r
-       \r
-       destroy : function(){\r
-               var o = this.options;\r
-               \r
-               $( document ).unbind( "scrollstop" );\r
-               \r
-               $( window ).unbind( "resize.virtuallist" );\r
-               \r
-               $( o.id ).empty();\r
-       },\r
-       \r
-       _itemApply: function( $list, item ) {\r
-               var $countli = item.find( ".ui-li-count" );\r
-               \r
-               if ( $countli.length ) {\r
-                       item.addClass( "ui-li-has-count" );\r
-               }\r
-               \r
-               $countli.addClass( "ui-btn-up-" + ( $list.jqmData( "counttheme" ) || this.options.countTheme ) + " ui-btn-corner-all" );\r
-\r
-               // TODO class has to be defined in markup\r
-               item.find( "h1, h2, h3, h4, h5, h6" ).addClass( "ui-li-heading" ).end()\r
-                       .find( "p, dl" ).addClass( "ui-li-desc" ).end()\r
-                       .find( ">img:eq(0), .ui-link-inherit>img:eq(0)" ).addClass( "ui-li-thumb" ).each( function() {\r
-                               item.addClass( $( this ).is( ".ui-li-icon" ) ? "ui-li-has-icon" : "ui-li-has-thumb" );\r
-                       }).end()\r
-                       .find( ".ui-li-aside" ).each(function() {\r
-                               var $this = $( this );\r
-                               $this.prependTo( $this.parent() ); //shift aside to front for css float\r
-                       } );\r
-       },\r
+                       t.refresh( true );\r
+               },\r
 \r
-       _removeCorners: function( li, which ) {\r
-               var top = "ui-corner-top ui-corner-tr ui-corner-tl",\r
-                       bot = "ui-corner-bottom ui-corner-br ui-corner-bl";\r
+               create: function () {\r
+                       var o = this.options;\r
 \r
-               li = li.add( li.find( ".ui-btn-inner, .ui-li-link-alt, .ui-li-thumb" ) );\r
+                       /* external API for AJAX callback */\r
+                       this._create( "create" );\r
 \r
-               if ( which === "top" ) {\r
-                       li.removeClass( top );\r
-               } else if ( which === "bottom" ) {\r
-                       li.removeClass( bot );\r
-               } else {\r
-                       li.removeClass( top + " " + bot );\r
-               }\r
-       },\r
-\r
-       _refreshCorners: function( create ) {\r
-               var $li,\r
-                       $visibleli,\r
-                       $topli,\r
-                       $bottomli;\r
-\r
-               if ( this.options.inset ) {\r
-                       $li = this.element.children( "li" );\r
-                       // at create time the li are not visible yet so we need to rely on .ui-screen-hidden\r
-                       $visibleli = create?$li.not( ".ui-screen-hidden" ):$li.filter( ":visible" );\r
-\r
-                       this._removeCorners( $li );\r
-\r
-                       // Select the first visible li element\r
-                       $topli = $visibleli.first()\r
-                               .addClass( "ui-corner-top" );\r
-\r
-                       $topli.add( $topli.find( ".ui-btn-inner" ) )\r
-                               .find( ".ui-li-link-alt" )\r
-                                       .addClass( "ui-corner-tr" )\r
-                               .end()\r
-                               .find( ".ui-li-thumb" )\r
-                                       .not( ".ui-li-icon" )\r
-                                       .addClass( "ui-corner-tl" );\r
-\r
-                       // Select the last visible li element\r
-                       $bottomli = $visibleli.last()\r
-                               .addClass( "ui-corner-bottom" );\r
-\r
-                       $bottomli.add( $bottomli.find( ".ui-btn-inner" ) )\r
-                               .find( ".ui-li-link-alt" )\r
-                                       .addClass( "ui-corner-br" )\r
-                               .end()\r
-                               .find( ".ui-li-thumb" )\r
-                                       .not( ".ui-li-icon" )\r
-                                       .addClass( "ui-corner-bl" );\r
-               }\r
-       },\r
-\r
-       refresh: function( create ) {\r
-               this.parentPage = this.element.closest( ".ui-page" );\r
-               this._createSubPages();\r
-\r
-               var o = this.options,\r
-                       $list = this.element,\r
-                       self = this,\r
-                       dividertheme = $list.jqmData( "dividertheme" ) || o.dividerTheme,\r
-                       listsplittheme = $list.jqmData( "splittheme" ),\r
-                       listspliticon = $list.jqmData( "spliticon" ),\r
-                       li = $list.children( "li" ),\r
-                       counter = $.support.cssPseudoElement || !$.nodeName( $list[ 0 ], "ol" ) ? 0 : 1,\r
-                       item, itemClass, itemTheme,\r
-                       a, last, splittheme, countParent, icon;\r
-\r
-               if ( counter ) {\r
-                       $list.find( ".ui-li-dec" ).remove();\r
-               }\r
+                       this._reposition( o );\r
+               },\r
 \r
-               for ( var pos = 0, numli = li.length; pos < numli; pos++ ) {\r
-                       item = li.eq( pos );\r
-                       itemClass = "ui-li";\r
-\r
-                       // If we're creating the element, we update it regardless\r
-                       if ( create || !item.hasClass( "ui-li" ) ) {\r
-                               itemTheme = item.jqmData( "theme" ) || o.theme;\r
-                               a = item.children( "a" );\r
-\r
-                               if ( a.length ) {\r
-                                       icon = item.jqmData( "icon" );\r
-\r
-                                       item.buttonMarkup({\r
-                                               wrapperEls: "div",\r
-                                               shadow: false,\r
-                                               corners: false,\r
-                                               iconpos: "right",\r
-                                               /* icon: a.length > 1 || icon === false ? false : icon || "arrow-r",*/\r
-                                               icon: false,    /* Remove unnecessary arrow icon */\r
-                                               theme: itemTheme\r
-                                       });\r
+               _create: function ( event ) {\r
+                       var t = this,\r
+                               o = this.options,\r
+                               $el = this.element,\r
+                               shortcutsContainer = $('<div class="ui-virtuallist"/>'),\r
+                               shortcutsList = $('<ul></ul>'),\r
+                               dividers = $el.find(':jqmData(role="virtuallistview" )'),\r
+                               lastListItem = null,\r
+                               shortcutscroll = this;\r
+\r
+                       // create listview markup\r
+                       t.element.addClass( function ( i, orig ) {\r
+                               return orig + " ui-listview ui-virtual-list-container" + ( t.options.inset ? " ui-listview-inset ui-corner-all ui-shadow " : "" );\r
+                       });\r
+\r
+                       o.id = "#" + $el.attr( "id" );\r
+\r
+                       $( o.id ).bind( "pagehide", function ( e ) {\r
+                               $( o.id ).empty();\r
+                       });\r
+\r
+                       /* Scroll view */\r
+                       if ( $( ".ui-scrollview-clip" ).size() > 0 ) {\r
+                               o.scrollview = true;\r
+                       } else {\r
+                               o.scrollview = false;\r
+                       }\r
+\r
+                       /* Init list and page buf */\r
+                       if ( $el.data( "row" ) ) {\r
+                               o.row = $el.data( "row" );\r
+\r
+                               if ( o.row < MINIMUM_ROW ) {\r
+                                       o.row = MINIMUM_ROW;\r
+                               }\r
 \r
-                                       if ( ( icon != false ) && ( a.length == 1 ) ) {\r
-                                               item.addClass( "ui-li-has-arrow" );\r
+                               o.page_buf = parseInt( ( o.row / 2 ), 10 );\r
+                       }\r
+\r
+                       /* After DB Load complete, Init Vritual list */\r
+                       if ( $( o.id ).hasClass( "vlLoadSuccess" ) ) {\r
+                               $( o.id ).empty();\r
+\r
+                               if ( $el.data( "template" ) ) {\r
+                                       o.template = $el.data( "template" );\r
+\r
+                                       /* to support swipe list, <li> or <ul> can be main node of virtual list. */\r
+                                       if ( $el.data( "swipelist" ) == true ) {\r
+                                               o.childSelector = " ul";\r
+                                       } else {\r
+                                               o.childSelector = " li";\r
                                        }\r
+                               }\r
+\r
+                               /* Set data's unique key */\r
+                               if ( $el.data( "dbkey" ) ) {\r
+                                       o.datakey = $el.data( "dbkey" );\r
+                               }\r
+\r
+                               first_index = 0;                        //first id of <li> element.\r
+                               last_index = o.row - 1;         //last id of <li> element.\r
+\r
+                               t._initList();\r
+                       }\r
+               },\r
 \r
-                                       a.first().addClass( "ui-link-inherit" );\r
-\r
-                                       if ( a.length > 1 ) {\r
-                                               itemClass += " ui-li-has-alt";\r
-\r
-                                               last = a.last();\r
-                                               splittheme = listsplittheme || last.jqmData( "theme" ) || o.splitTheme;\r
-\r
-                                               last.appendTo(item)\r
-                                                       .attr( "title", last.getEncodedText() )\r
-                                                       .addClass( "ui-li-link-alt" )\r
-                                                       .empty()\r
-                                                       .buttonMarkup({\r
-                                                               shadow: false,\r
-                                                               corners: false,\r
-                                                               theme: itemTheme,\r
-                                                               icon: false,\r
-                                                               iconpos: false\r
-                                                       })\r
-                                                       .find( ".ui-btn-inner" )\r
+               destroy : function () {\r
+                       var o = this.options;\r
+\r
+                       $( document ).unbind( "scrollstop" );\r
+\r
+                       $( window ).unbind( "resize.virtuallist" );\r
+\r
+                       $( o.id ).empty();\r
+               },\r
+\r
+               _itemApply: function ( $list, item ) {\r
+                       var $countli = item.find( ".ui-li-count" );\r
+\r
+                       if ( $countli.length ) {\r
+                               item.addClass( "ui-li-has-count" );\r
+                       }\r
+\r
+                       $countli.addClass( "ui-btn-up-" + ( $list.jqmData( "counttheme" ) || this.options.countTheme ) + " ui-btn-corner-all" );\r
+\r
+                       // TODO class has to be defined in markup\r
+                       item.find( "h1, h2, h3, h4, h5, h6" ).addClass( "ui-li-heading" ).end()\r
+                               .find( "p, dl" ).addClass( "ui-li-desc" ).end()\r
+                               .find( ">img:eq(0), .ui-link-inherit>img:eq(0)" ).addClass( "ui-li-thumb" ).each( function () {\r
+                                       item.addClass( $( this ).is( ".ui-li-icon" ) ? "ui-li-has-icon" : "ui-li-has-thumb" );\r
+                               }).end()\r
+                               .find( ".ui-li-aside" ).each(function () {\r
+                                       var $this = $( this );\r
+                                       $this.prependTo( $this.parent() ); //shift aside to front for css float\r
+                               } );\r
+               },\r
+\r
+               _removeCorners: function ( li, which ) {\r
+                       var top = "ui-corner-top ui-corner-tr ui-corner-tl",\r
+                               bot = "ui-corner-bottom ui-corner-br ui-corner-bl";\r
+\r
+                       li = li.add( li.find( ".ui-btn-inner, .ui-li-link-alt, .ui-li-thumb" ) );\r
+\r
+                       if ( which === "top" ) {\r
+                               li.removeClass( top );\r
+                       } else if ( which === "bottom" ) {\r
+                               li.removeClass( bot );\r
+                       } else {\r
+                               li.removeClass( top + " " + bot );\r
+                       }\r
+               },\r
+\r
+               _refreshCorners: function ( create ) {\r
+                       var $li,\r
+                               $visibleli,\r
+                               $topli,\r
+                               $bottomli;\r
+\r
+                       if ( this.options.inset ) {\r
+                               $li = this.element.children( "li" );\r
+                               // at create time the li are not visible yet so we need to rely on .ui-screen-hidden\r
+                               $visibleli = create ? $li.not( ".ui-screen-hidden" ) : $li.filter( ":visible" );\r
+\r
+                               this._removeCorners( $li );\r
+\r
+                               // Select the first visible li element\r
+                               $topli = $visibleli.first()\r
+                                       .addClass( "ui-corner-top" );\r
+\r
+                               $topli.add( $topli.find( ".ui-btn-inner" ) )\r
+                                       .find( ".ui-li-link-alt" )\r
+                                               .addClass( "ui-corner-tr" )\r
+                                       .end()\r
+                                       .find( ".ui-li-thumb" )\r
+                                               .not( ".ui-li-icon" )\r
+                                               .addClass( "ui-corner-tl" );\r
+\r
+                               // Select the last visible li element\r
+                               $bottomli = $visibleli.last()\r
+                                       .addClass( "ui-corner-bottom" );\r
+\r
+                               $bottomli.add( $bottomli.find( ".ui-btn-inner" ) )\r
+                                       .find( ".ui-li-link-alt" )\r
+                                               .addClass( "ui-corner-br" )\r
+                                       .end()\r
+                                       .find( ".ui-li-thumb" )\r
+                                               .not( ".ui-li-icon" )\r
+                                               .addClass( "ui-corner-bl" );\r
+                       }\r
+               },\r
+\r
+               refresh: function ( create ) {\r
+                       this.parentPage = this.element.closest( ".ui-page" );\r
+                       this._createSubPages();\r
+\r
+                       var o = this.options,\r
+                               $list = this.element,\r
+                               self = this,\r
+                               dividertheme = $list.jqmData( "dividertheme" ) || o.dividerTheme,\r
+                               listsplittheme = $list.jqmData( "splittheme" ),\r
+                               listspliticon = $list.jqmData( "spliticon" ),\r
+                               li = $list.children( "li" ),\r
+                               counter = $.support.cssPseudoElement || !$.nodeName( $list[ 0 ], "ol" ) ? 0 : 1,\r
+                               item,\r
+                               itemClass,\r
+                               temTheme,\r
+                               a,\r
+                               last,\r
+                               splittheme,\r
+                               countParent,\r
+                               icon,\r
+                               pos,\r
+                               numli,\r
+                               itemTheme;\r
+\r
+                       if ( counter ) {\r
+                               $list.find( ".ui-li-dec" ).remove();\r
+                       }\r
+\r
+                       for ( pos = 0, numli = li.length; pos < numli; pos++ ) {\r
+                               item = li.eq( pos );\r
+                               itemClass = "ui-li";\r
+\r
+                               // If we're creating the element, we update it regardless\r
+                               if ( create || !item.hasClass( "ui-li" ) ) {\r
+                                       itemTheme = item.jqmData( "theme" ) || o.theme;\r
+                                       a = item.children( "a" );\r
+\r
+                                       if ( a.length ) {\r
+                                               icon = item.jqmData( "icon" );\r
+\r
+                                               item.buttonMarkup({\r
+                                                       wrapperEls: "div",\r
+                                                       shadow: false,\r
+                                                       corners: false,\r
+                                                       iconpos: "right",\r
+                                                       /* icon: a.length > 1 || icon === false ? false : icon || "arrow-r",*/\r
+                                                       icon: false,    /* Remove unnecessary arrow icon */\r
+                                                       theme: itemTheme\r
+                                               });\r
+\r
+                                               if ( ( icon != false ) && ( a.length == 1 ) ) {\r
+                                                       item.addClass( "ui-li-has-arrow" );\r
+                                               }\r
+\r
+                                               a.first().addClass( "ui-link-inherit" );\r
+\r
+                                               if ( a.length > 1 ) {\r
+                                                       itemClass += " ui-li-has-alt";\r
+\r
+                                                       last = a.last();\r
+                                                       splittheme = listsplittheme || last.jqmData( "theme" ) || o.splitTheme;\r
+\r
+                                                       last.appendTo(item)\r
+                                                               .attr( "title", last.getEncodedText() )\r
+                                                               .addClass( "ui-li-link-alt" )\r
+                                                               .empty()\r
+                                                               .buttonMarkup({\r
+                                                                       shadow: false,\r
+                                                                       corners: false,\r
+                                                                       theme: itemTheme,\r
+                                                                       icon: false,\r
+                                                                       iconpos: false\r
+                                                               })\r
+                                                               .find( ".ui-btn-inner" )\r
                                                                .append(\r
                                                                        $( "<span />" ).buttonMarkup({\r
                                                                                shadow: true,\r
@@ -635,132 +678,136 @@ $.widget( "tizen.virtuallistview", $.mobile.widget, {
                                                                                icon: listspliticon || last.jqmData( "icon" ) || o.splitIcon\r
                                                                        })\r
                                                                );\r
-                                       }\r
-                               } else if ( item.jqmData( "role" ) === "list-divider" ) {\r
+                                               }\r
+                                       } else if ( item.jqmData( "role" ) === "list-divider" ) {\r
 \r
-                                       itemClass += " ui-li-divider ui-btn ui-bar-" + dividertheme;\r
-                                       item.attr( "role", "heading" );\r
+                                               itemClass += " ui-li-divider ui-btn ui-bar-" + dividertheme;\r
+                                               item.attr( "role", "heading" );\r
 \r
-                                       //reset counter when a divider heading is encountered\r
-                                       if ( counter ) {\r
-                                               counter = 1;\r
-                                       }\r
+                                               //reset counter when a divider heading is encountered\r
+                                               if ( counter ) {\r
+                                                       counter = 1;\r
+                                               }\r
 \r
-                               } else {\r
-                                       itemClass += " ui-li-static ui-body-" + itemTheme;\r
+                                       } else {\r
+                                               itemClass += " ui-li-static ui-body-" + itemTheme;\r
+                                       }\r
                                }\r
-                       }\r
 \r
-                       if ( counter && itemClass.indexOf( "ui-li-divider" ) < 0 ) {\r
-                               countParent = item.is( ".ui-li-static:first" ) ? item : item.find( ".ui-link-inherit" );\r
+                               if ( counter && itemClass.indexOf( "ui-li-divider" ) < 0 ) {\r
+                                       countParent = item.is( ".ui-li-static:first" ) ? item : item.find( ".ui-link-inherit" );\r
 \r
-                               countParent.addClass( "ui-li-jsnumbering" )\r
-                                       .prepend( "<span class='ui-li-dec'>" + (counter++) + ". </span>" );\r
-                       }\r
+                                       countParent.addClass( "ui-li-jsnumbering" )\r
+                                               .prepend( "<span class='ui-li-dec'>" + (counter++) + ". </span>" );\r
+                               }\r
 \r
-                       item.add( item.children( ".ui-btn-inner" ) ).addClass( itemClass );\r
+                               item.add( item.children( ".ui-btn-inner" ) ).addClass( itemClass );\r
 \r
-                       self._itemApply( $list, item );\r
-               }\r
+                               self._itemApply( $list, item );\r
+                       }\r
 \r
-               this._refreshCorners( create );\r
-       },\r
-\r
-       //create a string for ID/subpage url creation\r
-       _idStringEscape: function( str ) {\r
-               return str.replace(/[^a-zA-Z0-9]/g, '-');\r
-       },\r
-\r
-       _createSubPages: function() {\r
-               var parentList = this.element,\r
-                       parentPage = parentList.closest( ".ui-page" ),\r
-                       parentUrl = parentPage.jqmData( "url" ),\r
-                       parentId = parentUrl || parentPage[ 0 ][ $.expando ],\r
-                       parentListId = parentList.attr( "id" ),\r
-                       o = this.options,\r
-                       dns = "data-" + $.mobile.ns,\r
-                       self = this,\r
-                       persistentFooterID = parentPage.find( ":jqmData(role='footer')" ).jqmData( "id" ),\r
-                       hasSubPages;\r
-\r
-               if ( typeof listCountPerPage[ parentId ] === "undefined" ) {\r
-                       listCountPerPage[ parentId ] = -1;\r
-               }\r
+                       this._refreshCorners( create );\r
+               },\r
+\r
+               //create a string for ID/subpage url creation\r
+               _idStringEscape: function ( str ) {\r
+                       return str.replace(/\W/g , "-");\r
+               },\r
+\r
+               _createSubPages: function () {\r
+                       var parentList = this.element,\r
+                               parentPage = parentList.closest( ".ui-page" ),\r
+                               parentUrl = parentPage.jqmData( "url" ),\r
+                               parentId = parentUrl || parentPage[ 0 ][ $.expando ],\r
+                               parentListId = parentList.attr( "id" ),\r
+                               o = this.options,\r
+                               dns = "data-" + $.mobile.ns,\r
+                               self = this,\r
+                               persistentFooterID = parentPage.find( ":jqmData(role='footer')" ).jqmData( "id" ),\r
+                               hasSubPages,\r
+                               newRemove;\r
+\r
+                       if ( typeof listCountPerPage[ parentId ] === "undefined" ) {\r
+                               listCountPerPage[ parentId ] = -1;\r
+                       }\r
 \r
-               parentListId = parentListId || ++listCountPerPage[ parentId ];\r
-\r
-               $( parentList.find( "li>ul, li>ol" ).toArray().reverse() ).each(function( i ) {\r
-                       var self = this,\r
-                               list = $( this ),\r
-                               listId = list.attr( "id" ) || parentListId + "-" + i,\r
-                               parent = list.parent(),\r
-                               nodeEls = $( list.prevAll().toArray().reverse() ),\r
-                               nodeEls = nodeEls.length ? nodeEls : $( "<span>" + $.trim(parent.contents()[ 0 ].nodeValue) + "</span>" ),\r
-                               title = nodeEls.first().getEncodedText(),//url limits to first 30 chars of text\r
-                               id = ( parentUrl || "" ) + "&" + $.mobile.subPageUrlKey + "=" + listId,\r
-                               theme = list.jqmData( "theme" ) || o.theme,\r
-                               countTheme = list.jqmData( "counttheme" ) || parentList.jqmData( "counttheme" ) || o.countTheme,\r
-                               newPage, anchor;\r
-\r
-                       //define hasSubPages for use in later removal\r
-                       hasSubPages = true;\r
-\r
-                       newPage = list.detach()\r
-                                               .wrap( "<div " + dns + "role='page' " + dns + "url='" + id + "' " + dns + "theme='" + theme + "' " + dns + "count-theme='" + countTheme + "'><div " + dns + "role='content'></div></div>" )\r
-                                               .parent()\r
-                                                       .before( "<div " + dns + "role='header' " + dns + "theme='" + o.headerTheme + "'><div class='ui-title'>" + title + "</div></div>" )\r
-                                                       .after( persistentFooterID ? $( "<div " + dns + "role='footer' " + dns + "id='"+ persistentFooterID +"'>" ) : "" )\r
+                       parentListId = parentListId || ++listCountPerPage[ parentId ];\r
+\r
+                       $( parentList.find( "li>ul, li>ol" ).toArray().reverse() ).each(function ( i ) {\r
+                               var self = this,\r
+                                       list = $( this ),\r
+                                       listId = list.attr( "id" ) || parentListId + "-" + i,\r
+                                       parent = list.parent(),\r
+                                       nodeEls,\r
+                                       title = nodeEls.first().getEncodedText(),//url limits to first 30 chars of text\r
+                                       id = ( parentUrl || "" ) + "&" + $.mobile.subPageUrlKey + "=" + listId,\r
+                                       theme = list.jqmData( "theme" ) || o.theme,\r
+                                       countTheme = list.jqmData( "counttheme" ) || parentList.jqmData( "counttheme" ) || o.countTheme,\r
+                                       newPage,\r
+                                       anchor;\r
+\r
+                               nodeEls = $( list.prevAll().toArray().reverse() );\r
+                               nodeEls = nodeEls.length ? nodeEls : $( "<span>" + $.trim( parent.contents()[ 0 ].nodeValue ) + "</span>" );\r
+\r
+                               //define hasSubPages for use in later removal\r
+                               hasSubPages = true;\r
+\r
+                               newPage = list.detach()\r
+                                                       .wrap( "<div " + dns + "role='page' " + dns + "url='" + id + "' " + dns + "theme='" + theme + "' " + dns + "count-theme='" + countTheme + "'><div " + dns + "role='content'></div></div>" )\r
                                                        .parent()\r
+                                                               .before( "<div " + dns + "role='header' " + dns + "theme='" + o.headerTheme + "'><div class='ui-title'>" + title + "</div></div>" )\r
+                                                               .after( persistentFooterID ? $( "<div " + dns + "role='footer' " + dns + "id='" + persistentFooterID + "'>" ) : "" )\r
+                                                               .parent()\r
                                                                .appendTo( $.mobile.pageContainer );\r
 \r
-                       newPage.page();\r
+                               newPage.page();\r
 \r
-                       anchor = parent.find('a:first');\r
+                               anchor = parent.find('a:first');\r
 \r
-                       if ( !anchor.length ) {\r
-                               anchor = $( "<a/>" ).html( nodeEls || title ).prependTo( parent.empty() );\r
-                       }\r
+                               if ( !anchor.length ) {\r
+                                       anchor = $( "<a/>" ).html( nodeEls || title ).prependTo( parent.empty() );\r
+                               }\r
 \r
-                       anchor.attr( "href", "#" + id );\r
+                               anchor.attr( "href", "#" + id );\r
 \r
-               }).virtuallistview();\r
+                       }).virtuallistview();\r
 \r
-               // on pagehide, remove any nested pages along with the parent page, as long as they aren't active\r
-               // and aren't embedded\r
-               if( hasSubPages &&\r
-                       parentPage.is( ":jqmData(external-page='true')" ) &&\r
-                       parentPage.data( "page" ).options.domCache === false ) {\r
+                       // on pagehide, remove any nested pages along with the parent page, as long as they aren't active\r
+                       // and aren't embedded\r
+                       if ( hasSubPages &&\r
+                                               parentPage.is( ":jqmData(external-page='true')" ) &&\r
+                                               parentPage.data( "page" ).options.domCache === false ) {\r
 \r
-                       var newRemove = function( e, ui ){\r
-                               var nextPage = ui.nextPage, npURL;\r
+                               newRemove = function ( e, ui ) {\r
+                                       var nextPage = ui.nextPage, npURL;\r
 \r
-                               if( ui.nextPage ){\r
-                                       npURL = nextPage.jqmData( "url" );\r
-                                       if( npURL.indexOf( parentUrl + "&" + $.mobile.subPageUrlKey ) !== 0 ){\r
-                                               self.childPages().remove();\r
-                                               parentPage.remove();\r
+                                       if ( ui.nextPage ) {\r
+                                               npURL = nextPage.jqmData( "url" );\r
+                                               if ( npURL.indexOf( parentUrl + "&" + $.mobile.subPageUrlKey ) !== 0 ) {\r
+                                                       self.childPages().remove();\r
+                                                       parentPage.remove();\r
+                                               }\r
                                        }\r
-                               }\r
-                       };\r
+                               };\r
 \r
-                       // unbind the original page remove and replace with our specialized version\r
-                       parentPage\r
-                               .unbind( "pagehide.remove" )\r
-                               .bind( "pagehide.remove", newRemove);\r
-               }\r
-       },\r
+                               // unbind the original page remove and replace with our specialized version\r
+                               parentPage\r
+                                       .unbind( "pagehide.remove" )\r
+                                       .bind( "pagehide.remove", newRemove );\r
+                       }\r
+               },\r
 \r
-       // TODO sort out a better way to track sub pages of the virtuallistview this is brittle\r
-       childPages: function(){\r
-               var parentUrl = this.parentPage.jqmData( "url" );\r
+               // TODO sort out a better way to track sub pages of the virtuallistview this is brittle\r
+               childPages: function () {\r
+                       var parentUrl = this.parentPage.jqmData( "url" );\r
 \r
-               return $( ":jqmData(url^='"+  parentUrl + "&" + $.mobile.subPageUrlKey +"')" );\r
-       }\r
-});\r
+                       return $( ":jqmData(url^='" +  parentUrl + "&" + $.mobile.subPageUrlKey + "')" );\r
+               }\r
+       });\r
 \r
-//auto self-init widgets\r
-$( document ).bind( "pagecreate create", function( e ){\r
-       $( $.tizen.virtuallistview.prototype.options.initSelector, e.target ).virtuallistview();\r
-});\r
+       //auto self-init widgets\r
+       $( document ).bind( "pagecreate create", function ( e ) {\r
+               $( $.tizen.virtuallistview.prototype.options.initSelector, e.target ).virtuallistview();\r
+       });\r
 \r
-})( jQuery );\r
+} ( jQuery ) );\r