merge with master
authorJinkun Jang <jinkun.jang@samsung.com>
Fri, 15 Mar 2013 16:21:39 +0000 (01:21 +0900)
committerJinkun Jang <jinkun.jang@samsung.com>
Fri, 15 Mar 2013 16:21:39 +0000 (01:21 +0900)
213 files changed:
Makefile
build-tools/README.txt
build-tools/lib/less/browser.js
build-tools/lib/less/colors.js [new file with mode: 0644]
build-tools/lib/less/functions.js
build-tools/lib/less/index.js
build-tools/lib/less/lessc_helper.js [new file with mode: 0644]
build-tools/lib/less/parser.js
build-tools/lib/less/rhino.js
build-tools/lib/less/tree.js
build-tools/lib/less/tree/alpha.js
build-tools/lib/less/tree/anonymous.js
build-tools/lib/less/tree/assignment.js [new file with mode: 0644]
build-tools/lib/less/tree/call.js
build-tools/lib/less/tree/color.js
build-tools/lib/less/tree/comment.js
build-tools/lib/less/tree/condition.js [new file with mode: 0644]
build-tools/lib/less/tree/dimension.js
build-tools/lib/less/tree/directive.js
build-tools/lib/less/tree/element.js
build-tools/lib/less/tree/expression.js
build-tools/lib/less/tree/import.js
build-tools/lib/less/tree/javascript.js
build-tools/lib/less/tree/keyword.js
build-tools/lib/less/tree/media.js [new file with mode: 0644]
build-tools/lib/less/tree/mixin.js
build-tools/lib/less/tree/operation.js
build-tools/lib/less/tree/paren.js [new file with mode: 0644]
build-tools/lib/less/tree/quoted.js
build-tools/lib/less/tree/ratio.js [new file with mode: 0644]
build-tools/lib/less/tree/rule.js
build-tools/lib/less/tree/ruleset.js
build-tools/lib/less/tree/selector.js
build-tools/lib/less/tree/unicode-descriptor.js [new file with mode: 0644]
build-tools/lib/less/tree/url.js
build-tools/lib/less/tree/value.js
build-tools/lib/less/tree/variable.js
demos/tizen-winsets/index.html
demos/tizen-winsets/tips/pinch-event/pinch.html [new file with mode: 0644]
demos/tizen-winsets/tips/pinch-event/pinch.js [new file with mode: 0644]
demos/tizen-winsets/tips/pinch-event/test.jpg [new file with mode: 0644]
demos/tizen-winsets/tips/two-line-text/two-line-text.html
demos/tizen-winsets/widgets/button/buttonNolist.html
demos/tizen-winsets/widgets/ctxpopup.html
demos/tizen-winsets/widgets/list/list-collapsible.html
demos/tizen-winsets/widgets/list/list-dialogue-edit.html
demos/tizen-winsets/widgets/list/list-dialogue.html
demos/tizen-winsets/widgets/list/list-divider_check.html
demos/tizen-winsets/widgets/list/list-divider_groupped.html
demos/tizen-winsets/widgets/list/list-vi.html
demos/tizen-winsets/widgets/multimediaview/multimediaview_audio.html
demos/tizen-winsets/widgets/multimediaview/multimediaview_video.html
demos/tizen-winsets/widgets/naviframe/naviframe_footer_more.html
demos/tizen-winsets/widgets/naviframe/naviframe_footer_more_button.html
demos/tizen-winsets/widgets/pagelayout/backbutton/back-button-to-header.html
demos/tizen-winsets/widgets/popupwindow/popup.html
demos/tizen-winsets/widgets/tabbar/tabbar.html
demos/tizen-winsets/widgets/tabbar/tabbar_footer_icon.html
demos/tizen-winsets/widgets/tokentextarea-demo.js
libs/patch/0015-JQM-add-listview-style-option.patch
libs/patch/0020-JQM-Apply-tizen-style-context-popup.patch
libs/patch/0029-JQM-performance-tuning.patch [new file with mode: 0644]
libs/patch/0030-JQM-performance-tuning-remove-jqmData.patch [new file with mode: 0644]
libs/patch/0031-JQM-performance-tuning-change-self-init-method-for-j.patch [new file with mode: 0644]
packaging/web-ui-fw.spec
src/js/jquery.mobile.label.js [moved from src/widgets/common/js/jquery.mobile.label.js with 85% similarity]
src/js/jquery.mobile.tizen.clrlib.js [moved from src/widgets/common/js/jquery.mobile.tizen.clrlib.js with 94% similarity]
src/js/jquery.mobile.tizen.configure.js [moved from src/widgets/common/js/jquery.mobile.tizen.configure.js with 58% similarity]
src/js/jquery.mobile.tizen.core.js [moved from src/widgets/common/js/jquery.mobile.tizen.core.js with 92% similarity]
src/js/jquery.mobile.tizen.loader.js [moved from src/loader/loader.js with 97% similarity]
src/js/jquery.mobile.tizen.loadprototype.js [moved from src/widgets/common/js/jquery.mobile.tizen.loadprototype.js with 95% similarity]
src/js/jquery.mobile.tizen.scrollview.js [moved from src/widgets/common/js/jquery.mobile.tizen.scrollview.js with 96% similarity]
src/js/util/ensurens.js [moved from src/widgets/common/js/ensurens.js with 84% similarity]
src/js/util/range.js [moved from src/widgets/datetimepicker/js/range.js with 84% similarity]
src/js/widgets/jquery.mobile.tizen.button.js [moved from src/widgets/button/js/jquery.mobile.tizen.button.js with 81% similarity]
src/js/widgets/jquery.mobile.tizen.checkbox.js [moved from src/widgets/checkbox/js/jquery.mobile.tizen.checkbox.js with 74% similarity]
src/js/widgets/jquery.mobile.tizen.circularview.js [moved from src/widgets/circularview/js/jquery.mobile.tizen.circularview.js with 97% similarity]
src/js/widgets/jquery.mobile.tizen.datetimepicker.js [moved from src/widgets/datetimepicker/js/jquery.mobile.tizen.datetimepicker.js with 97% similarity]
src/js/widgets/jquery.mobile.tizen.extendablelist.js [moved from src/widgets/extendablelist/js/jquery.mobile.tizen.extendablelist.js with 97% similarity]
src/js/widgets/jquery.mobile.tizen.fastscroll.js [moved from src/widgets/fastscroll/js/jquery.mobile.tizen.fastscroll.js with 95% similarity]
src/js/widgets/jquery.mobile.tizen.gallery.js [moved from src/widgets/gallery/js/jquery.mobile.tizen.gallery.js with 97% similarity]
src/js/widgets/jquery.mobile.tizen.listdivider.js [moved from src/widgets/listdivider/js/jquery.mobile.tizen.listdivider.js with 88% similarity]
src/js/widgets/jquery.mobile.tizen.multimediaview.js [moved from src/widgets/multimediaview/js/jquery.mobile.tizen.multimediaview.js with 73% similarity]
src/js/widgets/jquery.mobile.tizen.notification.js [moved from src/widgets/notification/js/jquery.mobile.tizen.notification.js with 96% similarity]
src/js/widgets/jquery.mobile.tizen.pagelayout.js [moved from src/widgets/pagelayout/js/jquery.mobile.tizen.pagelayout.js with 93% similarity]
src/js/widgets/jquery.mobile.tizen.popupwindow.ctxpopup.js [moved from src/widgets/popupwindow_ctxpopup/js/jquery.mobile.tizen.ctxpopup.js with 95% similarity]
src/js/widgets/jquery.mobile.tizen.popupwindow.js [moved from src/widgets/popupwindow/js/jquery.mobile.tizen.popupwindow.js with 97% similarity]
src/js/widgets/jquery.mobile.tizen.progress.js [moved from src/widgets/progress/js/jquery.mobile.tizen.progress.js with 91% similarity]
src/js/widgets/jquery.mobile.tizen.progressbar.js [moved from src/widgets/progressbar/js/jquery.mobile.tizen.progressbar.js with 90% similarity]
src/js/widgets/jquery.mobile.tizen.scrollview.handler.js [moved from src/widgets/handler/js/jquery.tizen.scrollview.handler.js with 96% similarity]
src/js/widgets/jquery.mobile.tizen.searchbar.js [moved from src/widgets/searchbar/js/jquery.mobile.tizen.searchbar.js with 96% similarity]
src/js/widgets/jquery.mobile.tizen.slider.js [moved from src/widgets/slider/js/jquery.mobile.tizen.slider.js with 96% similarity]
src/js/widgets/jquery.mobile.tizen.swipe.js [moved from src/widgets/swipe/js/jquery.mobile.tizen.swipe.js with 96% similarity]
src/js/widgets/jquery.mobile.tizen.tabbar.js [moved from src/widgets/tabbar/js/jquery.mobile.tizen.tabbar.js with 87% similarity]
src/js/widgets/jquery.mobile.tizen.tokentextarea.js [moved from src/widgets/tokentextarea/js/jquery.mobile.tizen.tokentextarea.js with 98% similarity]
src/js/widgets/jquery.mobile.tizen.triangle.js [moved from src/widgets/triangle/js/jquery.mobile.tizen.triangle.js with 90% similarity]
src/js/widgets/jquery.mobile.tizen.virtualgrid.js [moved from src/widgets/virtualgrid/js/jquery.mobile.tizen.virtualgrid.js with 72% similarity]
src/js/widgets/jquery.mobile.tizen.virtuallistview.js [moved from src/widgets/virtuallist/js/jquery.mobile.tizen.virtuallistview.js with 98% similarity]
src/js/widgets/jquery.mobile.tizen.widgetex.js [moved from src/widgets/000_widgetex/js/widgetex.js with 97% similarity]
src/js/widgets/less/ctxpopup.less [new file with mode: 0644]
src/js/widgets/less/popupwindow.less [moved from src/widgets/popupwindow/less/popupwindow.less with 100% similarity]
src/js/widgets/less/triangle.less [moved from src/widgets/triangle/less/jquery.mobile.tizen.triangle.less with 100% similarity, mode: 0644]
src/js/widgets/proto-html/ctxpopup.prototype.html [moved from src/widgets/popupwindow_ctxpopup/proto-html/ctxpopup.prototype.html with 100% similarity]
src/js/widgets/proto-html/popupwindow.prototype.html [moved from src/widgets/popupwindow/proto-html/popupwindow.prototype.html with 100% similarity]
src/themes/tizen/common/jquery.mobile.collapsible.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.ctxpopup.less
src/themes/tizen/common/jquery.mobile.tizen.dayselector.less [deleted file]
src/themes/tizen/common/jquery.mobile.tizen.multimediaview.less
src/themes/tizen/common/jquery.mobile.tizen.optionheader.less [deleted file]
src/themes/tizen/common/jquery.mobile.tizen.popup.less
src/themes/tizen/common/jquery.mobile.tizen.progressbar.less
src/themes/tizen/common/jquery.mobile.tizen.slider.less
src/themes/tizen/common/jquery.mobile.tizen.tabbar.less
src/themes/tizen/common/jquery.mobile.tizen.virtualgridview.less
src/themes/tizen/common/jquery.mobile.transitions.css
src/themes/tizen/tizen-white/Makefile
src/themes/tizen/tizen-white/images/controls/button/00_button_bars.png [new file with mode: 0644]
src/themes/tizen/tizen-white/images/controls/button/00_button_bars_press.png [new file with mode: 0644]
src/themes/tizen/tizen-white/images/controls/button/00_button_home.png
src/themes/tizen/tizen-white/images/controls/button/00_button_home_press.png
src/themes/tizen/tizen-white/style.less
src/widgets/popupwindow_ctxpopup/css/jquery.mobile.tizen.ctxpopup.css [deleted file]
src/widgets/popupwindow_ctxpopup/less/jquery.mobile.tizen.ctxpopup.less [deleted file]
tests/additional-unit-tests/autodivider/autodivider-tests.js [new file with mode: 0755]
tests/additional-unit-tests/autodivider/index.html [new file with mode: 0755]
tests/additional-unit-tests/button/button-tests.js [new file with mode: 0755]
tests/additional-unit-tests/button/index.html [new file with mode: 0755]
tests/additional-unit-tests/check/check-tests.js [new file with mode: 0755]
tests/additional-unit-tests/check/index.html [new file with mode: 0755]
tests/additional-unit-tests/collapsible/collapsible-tests.js [new file with mode: 0755]
tests/additional-unit-tests/collapsible/index.html [new file with mode: 0755]
tests/additional-unit-tests/datetimepicker/datetimepicker-tests.js [new file with mode: 0755]
tests/additional-unit-tests/datetimepicker/index.html [new file with mode: 0755]
tests/additional-unit-tests/dayselector/dayselector-tests.js [new file with mode: 0755]
tests/additional-unit-tests/dayselector/index.html [new file with mode: 0755]
tests/additional-unit-tests/extendablelist/extendablelist-tests.js [new file with mode: 0755]
tests/additional-unit-tests/extendablelist/index.html [new file with mode: 0755]
tests/additional-unit-tests/fastscroll/fastscroll-tests.js [new file with mode: 0755]
tests/additional-unit-tests/fastscroll/index.html [new file with mode: 0755]
tests/additional-unit-tests/gallery/01.jpg [new file with mode: 0755]
tests/additional-unit-tests/gallery/02.jpg [new file with mode: 0755]
tests/additional-unit-tests/gallery/03.jpg [new file with mode: 0755]
tests/additional-unit-tests/gallery/04.jpg [new file with mode: 0755]
tests/additional-unit-tests/gallery/05.jpg [new file with mode: 0755]
tests/additional-unit-tests/gallery/06.jpg [new file with mode: 0755]
tests/additional-unit-tests/gallery/07.jpg [new file with mode: 0755]
tests/additional-unit-tests/gallery/08.jpg [new file with mode: 0755]
tests/additional-unit-tests/gallery/09.jpg [new file with mode: 0755]
tests/additional-unit-tests/gallery/10.jpg [new file with mode: 0755]
tests/additional-unit-tests/gallery/11.jpg [new file with mode: 0755]
tests/additional-unit-tests/gallery/gallery-tests.js [new file with mode: 0755]
tests/additional-unit-tests/gallery/index.html [new file with mode: 0755]
tests/additional-unit-tests/gallery3d/gallery3d-tests.js [new file with mode: 0755]
tests/additional-unit-tests/gallery3d/index.html [new file with mode: 0755]
tests/additional-unit-tests/handler/handler-tests.js [new file with mode: 0755]
tests/additional-unit-tests/handler/index.html [new file with mode: 0755]
tests/additional-unit-tests/headerfooter/headerfooter-tests.js [new file with mode: 0755]
tests/additional-unit-tests/headerfooter/index.html [new file with mode: 0755]
tests/additional-unit-tests/index.html [new file with mode: 0755]
tests/additional-unit-tests/list.txt [new file with mode: 0755]
tests/additional-unit-tests/list/index.html [new file with mode: 0755]
tests/additional-unit-tests/list/list-tests.js [new file with mode: 0755]
tests/additional-unit-tests/listdividers/index.html [new file with mode: 0755]
tests/additional-unit-tests/listdividers/listdividers-tests.js [new file with mode: 0755]
tests/additional-unit-tests/loader/index.html [new file with mode: 0755]
tests/additional-unit-tests/loader/loader-tests.js [new file with mode: 0755]
tests/additional-unit-tests/multimediaview/index.html [new file with mode: 0755]
tests/additional-unit-tests/multimediaview/multimediaview-tests.js [new file with mode: 0755]
tests/additional-unit-tests/navigationbar/01_icon.png [new file with mode: 0755]
tests/additional-unit-tests/navigationbar/02_icon.png [new file with mode: 0755]
tests/additional-unit-tests/navigationbar/03_icon.png [new file with mode: 0755]
tests/additional-unit-tests/navigationbar/index.html [new file with mode: 0755]
tests/additional-unit-tests/navigationbar/navigationbar-tests.js [new file with mode: 0755]
tests/additional-unit-tests/notification/index.html [new file with mode: 0755]
tests/additional-unit-tests/notification/notification-tests.js [new file with mode: 0755]
tests/additional-unit-tests/popup/index.html [new file with mode: 0755]
tests/additional-unit-tests/popup/popup-tests.js [new file with mode: 0755]
tests/additional-unit-tests/progressbar/index.html [new file with mode: 0755]
tests/additional-unit-tests/progressbar/progressbar-tests.js [new file with mode: 0755]
tests/additional-unit-tests/radio/index.html [new file with mode: 0755]
tests/additional-unit-tests/radio/radio-tests.js [new file with mode: 0755]
tests/additional-unit-tests/runner.js [new file with mode: 0755]
tests/additional-unit-tests/searchbar/index.html [new file with mode: 0755]
tests/additional-unit-tests/searchbar/searchbar-tests.js [new file with mode: 0755]
tests/additional-unit-tests/segmentcontrol/index.html [new file with mode: 0755]
tests/additional-unit-tests/segmentcontrol/segmentcontrol-tests.js [new file with mode: 0755]
tests/additional-unit-tests/slider/index.html [new file with mode: 0755]
tests/additional-unit-tests/slider/slider-tests.js [new file with mode: 0755]
tests/additional-unit-tests/swipe/index.html [new file with mode: 0755]
tests/additional-unit-tests/swipe/swipe-tests.js [new file with mode: 0755]
tests/additional-unit-tests/tabbar/index.html [new file with mode: 0755]
tests/additional-unit-tests/tabbar/tabbar-tests.js [new file with mode: 0755]
tests/additional-unit-tests/tests.js [new file with mode: 0755]
tests/additional-unit-tests/toggleswitch/index.html [new file with mode: 0755]
tests/additional-unit-tests/toggleswitch/toggleswitch-tests.js [new file with mode: 0755]
tests/additional-unit-tests/tokentextarea/index.html [new file with mode: 0755]
tests/additional-unit-tests/tokentextarea/tokentextarea-tests.js [new file with mode: 0755]
tests/additional-unit-tests/virtualgrid/index.html [new file with mode: 0755]
tests/additional-unit-tests/virtualgrid/virtualgrid-tests.js [new file with mode: 0755]
tests/additional-unit-tests/virtuallist/index.html [new file with mode: 0755]
tests/additional-unit-tests/virtuallist/virtuallist-tests.js [new file with mode: 0755]
tests/unit-tests/listdivider/index.html [new file with mode: 0755]
tests/unit-tests/listdivider/listdivider-tests.js [new file with mode: 0644]
tests/unit-tests/progress/index.html [new file with mode: 0755]
tests/unit-tests/progress/progress-tests.js [new file with mode: 0644]
tests/unit-tests/progressbar/index.html
tests/unit-tests/progressbar/progressbar-tests.js
tests/unit-tests/tests.js
tools/inline-protos.sh
tools/moduledep.js [new file with mode: 0644]

index 40d39a7..a9f6949 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -20,14 +20,15 @@ FRAMEWORK_ROOT = ${OUTPUT_ROOT}/${PROJECT_NAME}/${VERSION}
 LATEST_ROOT = ${OUTPUT_ROOT}/${PROJECT_NAME}/latest
 
 JS_OUTPUT_ROOT = ${FRAMEWORK_ROOT}/js
+JS_LIB_OUTPUT_DIR = ${JS_OUTPUT_ROOT}/src
 export THEME_OUTPUT_ROOT = ${FRAMEWORK_ROOT}/themes
 CSS_OUTPUT_ROOT = ${FRAMEWORK_ROOT}/themes/${THEME_NAME}
 CSS_IMAGES_OUTPUT_DIR = ${CSS_OUTPUT_ROOT}/images
 WIDGET_CSS_OUTPUT_ROOT = ${FRAMEWORK_ROOT}/widget-css
 PROTOTYPE_HTML_OUTPUT_DIR = proto-html
 
-WIDGETS_DIR = $(CURDIR)/src/widgets
-
+JS_DIR = $(CURDIR)/src/js
+WIDGETS_DIR = ${JS_DIR}/widgets
 THEMES_DIR = $(CURDIR)/src/themes
 LIBS_DIR = $(CURDIR)/libs
 
@@ -52,7 +53,8 @@ FW_WIDGET_CSS_FILE = ${WIDGET_CSS_OUTPUT_ROOT}/${PROJECT_NAME}-widget.css
 LIBS_JS_FILES = jquery.easing.1.3.js \
                jquery.tmpl.js \
                jquery.mobile.js \
-                $(NULL)
+               globalize/lib/globalize.js \
+               $(NULL)
 
 JQUERY_MOBILE_CSS = submodules/jquery-mobile/compiled/jquery.mobile.structure.css \
                     submodules/jquery-mobile/compiled/jquery.mobile.css \
@@ -65,7 +67,7 @@ JQM_LIB_PATH = $(CURDIR)/libs/js/${JQM_VERSION}
 JQUERY = jquery-1.8.2.js
 JQUERY_MIN = $(subst .js,.min.js,$(JQUERY))
 
-all: libs_prepare third_party widgets libs_cleanup loader themes version version_compat compress
+all: libs_prepare third_party js libs_cleanup themes version version_compat compress
 
 libs_prepare:
        # Prepare libs/ build...
@@ -86,7 +88,7 @@ jqm: init
        cd ${JQM_LIB_PATH} && make js NODE=/usr/bin/node || exit 1; \
        cp -f ${JQM_LIB_PATH}/compiled/*.js ${JQM_LIB_PATH}/../; \
 
-third_party: init jqm
+third_party: init jqm globalize
        # Building third party components...
        @@cd ${LIBS_DIR}/js; \
            for f in ${LIBS_JS_FILES}; do \
@@ -97,7 +99,36 @@ third_party: init jqm
            cp ${LIBS_DIR}/js/${JQUERY} ${JS_OUTPUT_ROOT}/jquery.js
            cp ${LIBS_DIR}/js/${JQUERY_MIN} ${JS_OUTPUT_ROOT}/jquery.min.js
 
-widgets: init third_party
+js: init third_party
+       # Building JS files...
+       mkdir -p ${JS_LIB_OUTPUT_DIR}; \
+       cp -a ${JS_DIR}/* ${JS_LIB_OUTPUT_DIR}/; \
+       /usr/bin/node $(CURDIR)/tools/moduledep.js -c ${JS_LIB_OUTPUT_DIR} > ${JS_LIB_OUTPUT_DIR}/../depData.json; \
+       find ${JS_LIB_OUTPUT_DIR} -iname '*.js' | sort | \
+       while read JSFILE; do \
+               echo " # Building $$JSFILE"; \
+               sed -i -e '/^\/\/>>excludeStart\(.*\);/,/^\/\/>>excludeEnd\(.*\);/d' $$JSFILE; \
+               if test ${JSLINT_LEVEL} -ge 1; then \
+                       ${JSLINT} $$JSFILE; \
+                       if test ${JSLINT_LEVEL} -ge 2 -a $$? -ne 0; then \
+                               exit 1; \
+                       fi; \
+               fi; \
+               if test "x${INLINE_PROTO}x" = "x1x"; then \
+                       echo "          $$f (include inline-proto if exists)"; \
+                       ./tools/inline-protos.sh $$JSFILE > $$JSFILE.compiled; \
+                       rm -f $$JSFILE; \
+                       mv $$JSFILE.compiled $$JSFILE; \
+               else \
+                       echo "          $$f"; \
+               fi; \
+       done; \
+       /usr/bin/node $(CURDIR)/tools/moduledep.js -d ${JS_LIB_OUTPUT_DIR} ${JS_LIB_OUTPUT_DIR}/../depData.json >> ${FW_JS}; \
+       cp -a ${JS_DIR}/* ${JQM_LIB_PATH}/js/* ${JS_LIB_OUTPUT_DIR}/; \
+       /usr/bin/node $(CURDIR)/tools/moduledep.js -c ${JS_LIB_OUTPUT_DIR} > ${JS_LIB_OUTPUT_DIR}/../depData.json; \
+       find ${JS_LIB_OUTPUT_DIR} -iname '*.js' | xargs sed -i -e '/^\/\/>>excludeStart\(.*\);/,/^\/\/>>excludeEnd\(.*\);/d';
+
+widgets: init third_party globalize
        # Building widgets...
        @@ls -l ${WIDGETS_DIR} | grep '^d' | awk '{print $$NF;}' | \
            while read REPLY; do \
@@ -145,25 +176,18 @@ widgets: init third_party
                 fi; \
            done
 
-
-loader: widgets globalize
-       cat 'src/loader/loader.js' >> ${FW_JS}
-
-
-globalize: widgets
-       cat 'libs/js/globalize/lib/globalize.js' >> ${FW_JS}
+globalize:
        # copy globalize libs...
        cp -a libs/js/globalize/lib/cultures ${FRAMEWORK_ROOT}/js/
 
-
 themes:
        make -C src/themes || exit $?
 
-version: loader themes
+version: js themes
        echo '(function($$){$$.tizen.frameworkData.pkgVersion="$(PKG_VERSION)";}(jQuery));' >> ${FW_JS}
        echo "$(PKG_VERSION)" > ${FRAMEWORK_ROOT}/../VERSION
 
-compress: widgets loader themes
+compress: third_party js themes
        # Javacript code compressing
        @@echo "        # Compressing...."; \
        echo '/*' > ${FW_MIN}; \
@@ -196,14 +220,14 @@ docs: init
        cat docs/index.footer >> docs/index.html
 
 
-version_compat: third_party widgets
+version_compat: third_party js
        # Creating compatible version dirs...
        for v_compat in ${VERSION_COMPAT}; do \
                ln -sf ${VERSION} ${FRAMEWORK_ROOT}/../$$v_compat; \
        done;
        ln -sf ${VERSION} ${FRAMEWORK_ROOT}/../latest
 
-demo: widgets 
+demo: js
        mkdir -p ${OUTPUT_ROOT}/demos
        cp -av demos/* ${OUTPUT_ROOT}/demos/
        cp -f src/template/bootstrap.js ${OUTPUT_ROOT}/demos/gallery/
index 0efd403..cf716fd 100644 (file)
@@ -1,6 +1,7 @@
 Tizen Web UI Framework includes following tools used on build;
 
 * less (http://lesscss.org)
+       * Version: 1.3.3
        * Description: A dynamic CSS language compiler based on node.js
        * Mods
                * Support rem unit (build-tools/lib/less/parser.js)
index cba4c3b..e00ff27 100644 (file)
@@ -2,10 +2,7 @@
 // browser.js - client-side engine
 //
 
-var isFileProtocol = (location.protocol === 'file:'    ||
-                      location.protocol === 'chrome:'  ||
-                      location.protocol === 'chrome-extension:'  ||
-                      location.protocol === 'resource:');
+var isFileProtocol = /^(file|chrome(-extension)?|resource|qrc|app):/.test(location.protocol);
 
 less.env = less.env || (location.hostname == '127.0.0.1' ||
                         location.hostname == '0.0.0.0'   ||
@@ -20,42 +17,64 @@ less.env = less.env || (location.hostname == '127.0.0.1' ||
 // doesn't start loading before the stylesheets are parsed.
 // Setting this to `true` can result in flickering.
 //
-less.async = false;
+less.async = less.async || false;
+less.fileAsync = less.fileAsync || false;
 
 // Interval between watch polls
 less.poll = less.poll || (isFileProtocol ? 1000 : 1500);
 
+//Setup user functions
+if (less.functions) {
+    for(var func in less.functions) {
+        less.tree.functions[func] = less.functions[func];
+   }
+}
+
+var dumpLineNumbers = /!dumpLineNumbers:(comments|mediaquery|all)/.exec(location.hash);
+if (dumpLineNumbers) {
+    less.dumpLineNumbers = dumpLineNumbers[1];
+}
+
 //
 // Watch mode
 //
-less.watch   = function () { return this.watchMode = true };
-less.unwatch = function () { return this.watchMode = false };
+less.watch   = function () {   
+       if (!less.watchMode ){          
+               less.env = 'development';
+               initRunningMode();
+       }
+       return this.watchMode = true 
+};
 
-if (less.env === 'development') {
-    less.optimization = 0;
+less.unwatch = function () {clearInterval(less.watchTimer); return this.watchMode = false; };
+
+function initRunningMode(){
+       if (less.env === 'development') {               
+               less.optimization = 0;          
+               less.watchTimer = setInterval(function () {                     
+                       if (less.watchMode) {
+                               loadStyleSheets(function (e, root, _, sheet, env) {
+                                       if (root) {
+                                               createCSS(root.toCSS(), sheet, env.lastModified);
+                                       }
+                               });
+                       }
+               }, less.poll);
+       } else {
+               less.optimization = 3;
+       }
+}
 
-    if (/!watch/.test(location.hash)) {
-        less.watch();
-    }
-    less.watchTimer = setInterval(function () {
-        if (less.watchMode) {
-            loadStyleSheets(function (root, sheet, env) {
-                if (root) {
-                    createCSS(root.toCSS(), sheet, env.lastModified);
-                }
-            });
-        }
-    }, less.poll);
-} else {
-    less.optimization = 3;
+if (/!watch/.test(location.hash)) {
+       less.watch();
 }
 
-var cache;
+var cache = null;
 
-try {
-    cache = (typeof(window.localStorage) === 'undefined') ? null : window.localStorage;
-} catch (_) {
-    cache = null;
+if (less.env != 'development') {
+    try {
+        cache = (typeof(window.localStorage) === 'undefined') ? null : window.localStorage;
+    } catch (_) {}
 }
 
 //
@@ -73,12 +92,27 @@ for (var i = 0; i < links.length; i++) {
     }
 }
 
+//
+// With this function, it's possible to alter variables and re-render
+// CSS without reloading less-files
+//
+var session_cache = '';
+less.modifyVars = function(record) {
+       var str = session_cache;
+    for (name in record) {
+        str += ((name.slice(0,1) === '@')? '' : '@') + name +': '+ 
+                ((record[name].slice(-1) === ';')? record[name] : record[name] +';');
+    }
+    new(less.Parser)().parse(str, function (e, root) {
+        createCSS(root.toCSS(), less.sheets[less.sheets.length - 1]);
+    });
+};
 
 less.refresh = function (reload) {
     var startTime, endTime;
     startTime = endTime = new(Date);
 
-    loadStyleSheets(function (root, sheet, env) {
+    loadStyleSheets(function (e, root, _, sheet, env) {
         if (env.local) {
             log("loading " + sheet.href + " from cache.");
         } else {
@@ -100,15 +134,18 @@ function loadStyles() {
     var styles = document.getElementsByTagName('style');
     for (var i = 0; i < styles.length; i++) {
         if (styles[i].type.match(typePattern)) {
-            new(less.Parser)().parse(styles[i].innerHTML || '', function (e, tree) {
+            new(less.Parser)({
+                filename: document.location.href.replace(/#.*$/, ''),
+                dumpLineNumbers: less.dumpLineNumbers
+            }).parse(styles[i].innerHTML || '', function (e, tree) {
                 var css = tree.toCSS();
                 var style = styles[i];
-                try {
+                style.type = 'text/css';
+                if (style.styleSheet) {
+                    style.styleSheet.cssText = css;
+                } else {
                     style.innerHTML = css;
-                } catch (_) {
-                    style.styleSheets.cssText = css;
                 }
-                style.type = 'text/css';
             });
         }
     }
@@ -120,40 +157,139 @@ function loadStyleSheets(callback, reload) {
     }
 }
 
+function pathDiff(url, baseUrl) {
+    // diff between two paths to create a relative path
+
+    var urlParts = extractUrlParts(url),
+        baseUrlParts = extractUrlParts(baseUrl),
+        i, max, urlDirectories, baseUrlDirectories, diff = "";
+    if (urlParts.hostPart !== baseUrlParts.hostPart) {
+        return "";
+    }
+    max = Math.max(baseUrlParts.directories.length, urlParts.directories.length);
+    for(i = 0; i < max; i++) {
+        if (baseUrlParts.directories[i] !== urlParts.directories[i]) { break; }
+    }
+    baseUrlDirectories = baseUrlParts.directories.slice(i);
+    urlDirectories = urlParts.directories.slice(i);
+    for(i = 0; i < baseUrlDirectories.length-1; i++) {
+        diff += "../";
+    }
+    for(i = 0; i < urlDirectories.length-1; i++) {
+        diff += urlDirectories[i] + "/";
+    }
+    return diff;
+}
+
+function extractUrlParts(url, baseUrl) {
+    // urlParts[1] = protocol&hostname || /
+    // urlParts[2] = / if path relative to host base
+    // urlParts[3] = directories
+    // urlParts[4] = filename
+    // urlParts[5] = parameters
+
+    var urlPartsRegex = /^((?:[a-z-]+:)?\/\/(?:[^\/\?#]+\/)|([\/\\]))?((?:[^\/\\\?#]+[\/\\])*)([^\/\\\?#]*)([#\?].*)?$/,
+        urlParts = url.match(urlPartsRegex),
+        returner = {}, directories = [], i, baseUrlParts;
+
+    if (!urlParts) {
+        throw new Error("Could not parse sheet href - '"+url+"'");
+    }
+
+    // Stylesheets in IE don't always return the full path    
+    if (!urlParts[1] || urlParts[2]) {
+        baseUrlParts = baseUrl.match(urlPartsRegex);
+        if (!baseUrlParts) {
+            throw new Error("Could not parse page url - '"+baseUrl+"'");
+        }
+        urlParts[1] = baseUrlParts[1];
+        if (!urlParts[2]) {
+            urlParts[3] = baseUrlParts[3] + urlParts[3];
+        }
+    }
+    
+    if (urlParts[3]) {
+        directories = urlParts[3].replace("\\", "/").split("/");
+
+        for(i = 0; i < directories.length; i++) {
+            if (directories[i] === ".." && i > 0) {
+                directories.splice(i-1, 2);
+                i -= 2;
+            }
+        }
+    }
+
+    returner.hostPart = urlParts[1];
+    returner.directories = directories;
+    returner.path = urlParts[1] + directories.join("/");
+    returner.fileUrl = returner.path + (urlParts[4] || "");
+    returner.url = returner.fileUrl + (urlParts[5] || "");
+    return returner;
+}
+
 function loadStyleSheet(sheet, callback, reload, remaining) {
-    var url       = window.location.href.replace(/[#?].*$/, '');
-    var href      = sheet.href.replace(/\?.*$/, '');
+    // sheet may be set to the stylesheet for the initial load or a collection of properties including
+    // some env variables for imports
+    var contents  = sheet.contents || {};
+    var files     = sheet.files || {};
+    var hrefParts = extractUrlParts(sheet.href, window.location.href);
+    var href      = hrefParts.url;
     var css       = cache && cache.getItem(href);
     var timestamp = cache && cache.getItem(href + ':timestamp');
     var styles    = { css: css, timestamp: timestamp };
+    var rootpath;
 
-    // Stylesheets in IE don't always return the full path
-    if (! /^(https?|file):/.test(href)) {
-        if (href.charAt(0) == "/") {
-            href = window.location.protocol + "//" + window.location.host + href;
+    if (less.relativeUrls) {
+        if (less.rootpath) {
+            if (sheet.entryPath) {
+                rootpath = extractUrlParts(less.rootpath + pathDiff(hrefParts.path, sheet.entryPath)).path;
+            } else {
+                rootpath = less.rootpath;
+            }
+        } else {
+            rootpath = hrefParts.path;
+        }
+    } else  {
+        if (less.rootpath) {
+            rootpath = less.rootpath;
         } else {
-            href = url.slice(0, url.lastIndexOf('/') + 1) + href;
+            if (sheet.entryPath) {
+                rootpath = sheet.entryPath;
+            } else {
+                rootpath = hrefParts.path;
+            }
         }
     }
 
-    xhr(sheet.href, sheet.type, function (data, lastModified) {
+    xhr(href, sheet.type, function (data, lastModified) {
+        // Store data this session
+        session_cache += data.replace(/@import .+?;/ig, '');
+
         if (!reload && styles && lastModified &&
            (new(Date)(lastModified).valueOf() ===
             new(Date)(styles.timestamp).valueOf())) {
             // Use local copy
             createCSS(styles.css, sheet);
-            callback(null, sheet, { local: true, remaining: remaining });
+            callback(null, null, data, sheet, { local: true, remaining: remaining }, href);
         } else {
             // Use remote copy (re-parse)
             try {
+                contents[href] = data;  // Updating top importing parser content cache
                 new(less.Parser)({
                     optimization: less.optimization,
-                    paths: [href.replace(/[\w\.-]+$/, '')],
-                    mime: sheet.type
+                    paths: [hrefParts.path],
+                    entryPath: sheet.entryPath || hrefParts.path,
+                    mime: sheet.type,
+                    filename: href,
+                    rootpath: rootpath,
+                    relativeUrls: sheet.relativeUrls,
+                    contents: contents,    // Passing top importing parser content cache ref down.
+                    files: files,
+                    dumpLineNumbers: less.dumpLineNumbers
                 }).parse(data, function (e, root) {
                     if (e) { return error(e, href) }
                     try {
-                        callback(root, sheet, { local: false, lastModified: lastModified, remaining: remaining });
+                        callback(e, root, data, sheet, { local: false, lastModified: lastModified, remaining: remaining }, href);
                         removeNode(document.getElementById('less-error-message:' + extractId(href)));
                     } catch (e) {
                         error(e, href);
@@ -171,8 +307,7 @@ function loadStyleSheet(sheet, callback, reload, remaining) {
 function extractId(href) {
     return href.replace(/^[a-z]+:\/\/?[^\/]+/, '' )  // Remove protocol & domain
                .replace(/^\//,                 '' )  // Remove root /
-               .replace(/\?.*$/,               '' )  // Remove query
-               .replace(/\.[^\.\/]+$/,         '' )  // Remove file extension
+               .replace(/\.[a-zA-Z]+$/,        '' )  // Remove simple extension
                .replace(/[^\.\w-]+/g,          '-')  // Replace illegal characters
                .replace(/\./g,                 ':'); // Replace dots with colons(for valid id)
 }
@@ -181,7 +316,7 @@ function createCSS(styles, sheet, lastModified) {
     var css;
 
     // Strip the query-string
-    var href = sheet.href ? sheet.href.replace(/\?.*$/, '') : '';
+    var href = sheet.href || '';
 
     // If there is no title set, use the filename, minus the extension
     var id = 'less:' + (sheet.title || extractId(href));
@@ -190,9 +325,10 @@ function createCSS(styles, sheet, lastModified) {
     if ((css = document.getElementById(id)) === null) {
         css = document.createElement('style');
         css.type = 'text/css';
-        css.media = sheet.media || 'screen';
+        if( sheet.media ){ css.media = sheet.media; }
         css.id = id;
-        document.getElementsByTagName('head')[0].appendChild(css);
+        var nextEl = sheet && sheet.nextSibling || null;
+        (nextEl || document.getElementsByTagName('head')[0]).parentNode.insertBefore(css, nextEl);
     }
 
     if (css.styleSheet) { // IE
@@ -216,14 +352,19 @@ function createCSS(styles, sheet, lastModified) {
     // Don't update the local store if the file wasn't modified
     if (lastModified && cache) {
         log('saving ' + href + ' to cache.');
-        cache.setItem(href, styles);
-        cache.setItem(href + ':timestamp', lastModified);
+        try {
+            cache.setItem(href, styles);
+            cache.setItem(href + ':timestamp', lastModified);
+        } catch(e) {
+            //TODO - could do with adding more robust error handling
+            log('failed to save');
+        }
     }
 }
 
 function xhr(url, type, callback, errback) {
     var xhr = getXMLHttpRequest();
-    var async = isFileProtocol ? false : less.async;
+    var async = isFileProtocol ? less.fileAsync : less.async;
 
     if (typeof(xhr.overrideMimeType) === 'function') {
         xhr.overrideMimeType('text/css');
@@ -232,8 +373,8 @@ function xhr(url, type, callback, errback) {
     xhr.setRequestHeader('Accept', type || 'text/x-less, text/css; q=0.9, */*; q=0.5');
     xhr.send(null);
 
-    if (isFileProtocol) {
-        if (xhr.status === 0) {
+    if (isFileProtocol && !less.fileAsync) {
+        if (xhr.status === 0 || (xhr.status >= 200 && xhr.status < 300)) {
             callback(xhr.responseText);
         } else {
             errback(xhr.status, url);
@@ -281,29 +422,33 @@ function log(str) {
 
 function error(e, href) {
     var id = 'less-error-message:' + extractId(href);
-
-    var template = ['<ul>',
-                        '<li><label>[-1]</label><pre class="ctx">{0}</pre></li>',
-                        '<li><label>[0]</label><pre>{current}</pre></li>',
-                        '<li><label>[1]</label><pre class="ctx">{2}</pre></li>',
-                    '</ul>'].join('\n');
-
-    var elem = document.createElement('div'), timer, content;
+    var template = '<li><label>{line}</label><pre class="{class}">{content}</pre></li>';
+    var elem = document.createElement('div'), timer, content, error = [];
+    var filename = e.filename || href;
+    var filenameNoPath = filename.match(/([^\/]+(\?.*)?)$/)[1];
 
     elem.id        = id;
     elem.className = "less-error-message";
 
     content = '<h3>'  + (e.message || 'There is an error in your .less file') +
-              '</h3>' + '<p><a href="' + href   + '">' + href + "</a> ";
+              '</h3>' + '<p>in <a href="' + filename   + '">' + filenameNoPath + "</a> ";
 
-    if (e.extract) {
+    var errorline = function (e, i, classname) {
+        if (e.extract[i]) {
+            error.push(template.replace(/\{line\}/, parseInt(e.line) + (i - 1))
+                               .replace(/\{class\}/, classname)
+                               .replace(/\{content\}/, e.extract[i]));
+        }
+    };
+
+    if (e.stack) {
+        content += '<br/>' + e.stack.split('\n').slice(1).join('<br/>');
+    } else if (e.extract) {
+        errorline(e, 0, '');
+        errorline(e, 1, 'line');
+        errorline(e, 2, '');
         content += 'on line ' + e.line + ', column ' + (e.column + 1) + ':</p>' +
-            template.replace(/\[(-?\d)\]/g, function (_, i) {
-                return (parseInt(e.line) + parseInt(i)) || '';
-            }).replace(/\{(\d)\}/g, function (_, i) {
-                return e.extract[parseInt(i)] || '';
-            }).replace(/\{current\}/, e.extract[1].slice(0, e.column) + '<span class="error">' +
-                                      e.extract[1].slice(e.column)    + '</span>');
+                    '<ul>' + error.join('') + '</ul>';
     }
     elem.innerHTML = content;
 
@@ -322,13 +467,13 @@ function error(e, href) {
             'color: #cc7777;',
         '}',
         '.less-error-message pre {',
-            'color: #ee4444;',
+            'color: #dd6666;',
             'padding: 4px 0;',
             'margin: 0;',
             'display: inline-block;',
         '}',
-        '.less-error-message pre.ctx {',
-            'color: #dd4444;',
+        '.less-error-message pre.line {',
+            'color: #ff0000;',
         '}',
         '.less-error-message h3 {',
             'font-size: 20px;',
@@ -372,4 +517,3 @@ function error(e, href) {
         }, 10);
     }
 }
-
diff --git a/build-tools/lib/less/colors.js b/build-tools/lib/less/colors.js
new file mode 100644 (file)
index 0000000..b417af6
--- /dev/null
@@ -0,0 +1,152 @@
+(function (tree) {
+    tree.colors = {
+        'aliceblue':'#f0f8ff',
+        'antiquewhite':'#faebd7',
+        'aqua':'#00ffff',
+        'aquamarine':'#7fffd4',
+        'azure':'#f0ffff',
+        'beige':'#f5f5dc',
+        'bisque':'#ffe4c4',
+        'black':'#000000',
+        'blanchedalmond':'#ffebcd',
+        'blue':'#0000ff',
+        'blueviolet':'#8a2be2',
+        'brown':'#a52a2a',
+        'burlywood':'#deb887',
+        'cadetblue':'#5f9ea0',
+        'chartreuse':'#7fff00',
+        'chocolate':'#d2691e',
+        'coral':'#ff7f50',
+        'cornflowerblue':'#6495ed',
+        'cornsilk':'#fff8dc',
+        'crimson':'#dc143c',
+        'cyan':'#00ffff',
+        'darkblue':'#00008b',
+        'darkcyan':'#008b8b',
+        'darkgoldenrod':'#b8860b',
+        'darkgray':'#a9a9a9',
+        'darkgrey':'#a9a9a9',
+        'darkgreen':'#006400',
+        'darkkhaki':'#bdb76b',
+        'darkmagenta':'#8b008b',
+        'darkolivegreen':'#556b2f',
+        'darkorange':'#ff8c00',
+        'darkorchid':'#9932cc',
+        'darkred':'#8b0000',
+        'darksalmon':'#e9967a',
+        'darkseagreen':'#8fbc8f',
+        'darkslateblue':'#483d8b',
+        'darkslategray':'#2f4f4f',
+        'darkslategrey':'#2f4f4f',
+        'darkturquoise':'#00ced1',
+        'darkviolet':'#9400d3',
+        'deeppink':'#ff1493',
+        'deepskyblue':'#00bfff',
+        'dimgray':'#696969',
+        'dimgrey':'#696969',
+        'dodgerblue':'#1e90ff',
+        'firebrick':'#b22222',
+        'floralwhite':'#fffaf0',
+        'forestgreen':'#228b22',
+        'fuchsia':'#ff00ff',
+        'gainsboro':'#dcdcdc',
+        'ghostwhite':'#f8f8ff',
+        'gold':'#ffd700',
+        'goldenrod':'#daa520',
+        'gray':'#808080',
+        'grey':'#808080',
+        'green':'#008000',
+        'greenyellow':'#adff2f',
+        'honeydew':'#f0fff0',
+        'hotpink':'#ff69b4',
+        'indianred':'#cd5c5c',
+        'indigo':'#4b0082',
+        'ivory':'#fffff0',
+        'khaki':'#f0e68c',
+        'lavender':'#e6e6fa',
+        'lavenderblush':'#fff0f5',
+        'lawngreen':'#7cfc00',
+        'lemonchiffon':'#fffacd',
+        'lightblue':'#add8e6',
+        'lightcoral':'#f08080',
+        'lightcyan':'#e0ffff',
+        'lightgoldenrodyellow':'#fafad2',
+        'lightgray':'#d3d3d3',
+        'lightgrey':'#d3d3d3',
+        'lightgreen':'#90ee90',
+        'lightpink':'#ffb6c1',
+        'lightsalmon':'#ffa07a',
+        'lightseagreen':'#20b2aa',
+        'lightskyblue':'#87cefa',
+        'lightslategray':'#778899',
+        'lightslategrey':'#778899',
+        'lightsteelblue':'#b0c4de',
+        'lightyellow':'#ffffe0',
+        'lime':'#00ff00',
+        'limegreen':'#32cd32',
+        'linen':'#faf0e6',
+        'magenta':'#ff00ff',
+        'maroon':'#800000',
+        'mediumaquamarine':'#66cdaa',
+        'mediumblue':'#0000cd',
+        'mediumorchid':'#ba55d3',
+        'mediumpurple':'#9370d8',
+        'mediumseagreen':'#3cb371',
+        'mediumslateblue':'#7b68ee',
+        'mediumspringgreen':'#00fa9a',
+        'mediumturquoise':'#48d1cc',
+        'mediumvioletred':'#c71585',
+        'midnightblue':'#191970',
+        'mintcream':'#f5fffa',
+        'mistyrose':'#ffe4e1',
+        'moccasin':'#ffe4b5',
+        'navajowhite':'#ffdead',
+        'navy':'#000080',
+        'oldlace':'#fdf5e6',
+        'olive':'#808000',
+        'olivedrab':'#6b8e23',
+        'orange':'#ffa500',
+        'orangered':'#ff4500',
+        'orchid':'#da70d6',
+        'palegoldenrod':'#eee8aa',
+        'palegreen':'#98fb98',
+        'paleturquoise':'#afeeee',
+        'palevioletred':'#d87093',
+        'papayawhip':'#ffefd5',
+        'peachpuff':'#ffdab9',
+        'peru':'#cd853f',
+        'pink':'#ffc0cb',
+        'plum':'#dda0dd',
+        'powderblue':'#b0e0e6',
+        'purple':'#800080',
+        'red':'#ff0000',
+        'rosybrown':'#bc8f8f',
+        'royalblue':'#4169e1',
+        'saddlebrown':'#8b4513',
+        'salmon':'#fa8072',
+        'sandybrown':'#f4a460',
+        'seagreen':'#2e8b57',
+        'seashell':'#fff5ee',
+        'sienna':'#a0522d',
+        'silver':'#c0c0c0',
+        'skyblue':'#87ceeb',
+        'slateblue':'#6a5acd',
+        'slategray':'#708090',
+        'slategrey':'#708090',
+        'snow':'#fffafa',
+        'springgreen':'#00ff7f',
+        'steelblue':'#4682b4',
+        'tan':'#d2b48c',
+        'teal':'#008080',
+        'thistle':'#d8bfd8',
+        'tomato':'#ff6347',
+        // 'transparent':'rgba(0,0,0,0)',
+        'turquoise':'#40e0d0',
+        'violet':'#ee82ee',
+        'wheat':'#f5deb3',
+        'white':'#ffffff',
+        'whitesmoke':'#f5f5f5',
+        'yellow':'#ffff00',
+        'yellowgreen':'#9acd32'
+    };
+})(require('./tree'));
index fc9d86f..b077123 100644 (file)
@@ -5,8 +5,8 @@ tree.functions = {
         return this.rgba(r, g, b, 1.0);
     },
     rgba: function (r, g, b, a) {
-        var rgb = [r, g, b].map(function (c) { return number(c) }),
-            a = number(a);
+        var rgb = [r, g, b].map(function (c) { return scaled(c, 256); });
+        a = number(a);
         return new(tree.Color)(rgb, a);
     },
     hsl: function (h, s, l) {
@@ -32,6 +32,36 @@ tree.functions = {
             else                return m1;
         }
     },
+
+    hsv: function(h, s, v) {
+        return this.hsva(h, s, v, 1.0);
+    },
+
+    hsva: function(h, s, v, a) {
+        h = ((number(h) % 360) / 360) * 360;
+        s = number(s); v = number(v); a = number(a);
+
+        var i, f;
+        i = Math.floor((h / 60) % 6);
+        f = (h / 60) - i;
+
+        var vs = [v,
+                  v * (1 - s),
+                  v * (1 - f * s),
+                  v * (1 - (1 - f) * s)];
+        var perm = [[0, 3, 1],
+                    [2, 0, 1],
+                    [1, 0, 3],
+                    [1, 2, 0],
+                    [3, 1, 0],
+                    [0, 1, 2]];
+
+        return this.rgba(vs[perm[i][0]] * 255,
+                         vs[perm[i][1]] * 255,
+                         vs[perm[i][2]] * 255,
+                         a);
+    },
+
     hue: function (color) {
         return new(tree.Dimension)(Math.round(color.toHSL().h));
     },
@@ -41,9 +71,24 @@ tree.functions = {
     lightness: function (color) {
         return new(tree.Dimension)(Math.round(color.toHSL().l * 100), '%');
     },
+    red: function (color) {
+        return new(tree.Dimension)(color.rgb[0]);
+    },
+    green: function (color) {
+        return new(tree.Dimension)(color.rgb[1]);
+    },
+    blue: function (color) {
+        return new(tree.Dimension)(color.rgb[2]);
+    },
     alpha: function (color) {
         return new(tree.Dimension)(color.toHSL().a);
     },
+    luma: function (color) {
+        return new(tree.Dimension)(Math.round((0.2126 * (color.rgb[0]/255) +
+            0.7152 * (color.rgb[1]/255) +
+            0.0722 * (color.rgb[2]/255)) *
+            color.alpha * 100), '%');
+    },
     saturate: function (color, amount) {
         var hsl = color.toHSL();
 
@@ -106,6 +151,9 @@ tree.functions = {
     // http://sass-lang.com
     //
     mix: function (color1, color2, weight) {
+        if (!weight) {
+            weight = new(tree.Dimension)(50);
+        }
         var p = weight.value / 100.0;
         var w = p * 2 - 1;
         var a = color1.toHSL().a - color2.toHSL().a;
@@ -124,6 +172,29 @@ tree.functions = {
     greyscale: function (color) {
         return this.desaturate(color, new(tree.Dimension)(100));
     },
+    contrast: function (color, dark, light, threshold) {
+        // filter: contrast(3.2);
+        // should be kept as is, so check for color
+        if (!color.rgb) {
+            return null;
+        }
+        if (typeof light === 'undefined') {
+            light = this.rgba(255, 255, 255, 1.0);
+        }
+        if (typeof dark === 'undefined') {
+            dark = this.rgba(0, 0, 0, 1.0);
+        }
+        if (typeof threshold === 'undefined') {
+            threshold = 0.43;
+        } else {
+            threshold = threshold.value;
+        }
+        if (((0.2126 * (color.rgb[0]/255) + 0.7152 * (color.rgb[1]/255) + 0.0722 * (color.rgb[2]/255)) * color.alpha) < threshold) {
+            return light;
+        } else {
+            return dark;
+        }
+    },
     e: function (str) {
         return new(tree.Anonymous)(str instanceof tree.JavaScript ? str.evaluated : str);
     },
@@ -143,26 +214,147 @@ tree.functions = {
         str = str.replace(/%%/g, '%');
         return new(tree.Quoted)('"' + str + '"', str);
     },
-    round: function (n) {
+    unit: function (val, unit) {
+        return new(tree.Dimension)(val.value, unit ? unit.toCSS() : "");
+    },
+    round: function (n, f) {
+        var fraction = typeof(f) === "undefined" ? 0 : f.value;
+        return this._math(function(num) { return num.toFixed(fraction); }, n);
+    },
+    ceil: function (n) {
+        return this._math(Math.ceil, n);
+    },
+    floor: function (n) {
+        return this._math(Math.floor, n);
+    },
+    _math: function (fn, n) {
         if (n instanceof tree.Dimension) {
-            return new(tree.Dimension)(Math.round(number(n)), n.unit);
+            return new(tree.Dimension)(fn(parseFloat(n.value)), n.unit);
         } else if (typeof(n) === 'number') {
-            return Math.round(n);
+            return fn(n);
         } else {
-           throw {
-                error: "RuntimeError",
-                message: "math functions take numbers as parameters"
-            };
+            throw { type: "Argument", message: "argument must be a number" };
         }
     },
     argb: function (color) {
         return new(tree.Anonymous)(color.toARGB());
 
+    },
+    percentage: function (n) {
+        return new(tree.Dimension)(n.value * 100, '%');
+    },
+    color: function (n) {
+        if (n instanceof tree.Quoted) {
+            return new(tree.Color)(n.value.slice(1));
+        } else {
+            throw { type: "Argument", message: "argument must be a string" };
+        }
+    },
+    iscolor: function (n) {
+        return this._isa(n, tree.Color);
+    },
+    isnumber: function (n) {
+        return this._isa(n, tree.Dimension);
+    },
+    isstring: function (n) {
+        return this._isa(n, tree.Quoted);
+    },
+    iskeyword: function (n) {
+        return this._isa(n, tree.Keyword);
+    },
+    isurl: function (n) {
+        return this._isa(n, tree.URL);
+    },
+    ispixel: function (n) {
+        return (n instanceof tree.Dimension) && n.unit === 'px' ? tree.True : tree.False;
+    },
+    ispercentage: function (n) {
+        return (n instanceof tree.Dimension) && n.unit === '%' ? tree.True : tree.False;
+    },
+    isem: function (n) {
+        return (n instanceof tree.Dimension) && n.unit === 'em' ? tree.True : tree.False;
+    },
+    _isa: function (n, Type) {
+        return (n instanceof Type) ? tree.True : tree.False;
+    },
+    
+    /* Blending modes */
+    
+    multiply: function(color1, color2) {
+        var r = color1.rgb[0] * color2.rgb[0] / 255;
+        var g = color1.rgb[1] * color2.rgb[1] / 255;
+        var b = color1.rgb[2] * color2.rgb[2] / 255;
+        return this.rgb(r, g, b);
+    },
+    screen: function(color1, color2) {
+        var r = 255 - (255 - color1.rgb[0]) * (255 - color2.rgb[0]) / 255;
+        var g = 255 - (255 - color1.rgb[1]) * (255 - color2.rgb[1]) / 255;
+        var b = 255 - (255 - color1.rgb[2]) * (255 - color2.rgb[2]) / 255;
+        return this.rgb(r, g, b);
+    },
+    overlay: function(color1, color2) {
+        var r = color1.rgb[0] < 128 ? 2 * color1.rgb[0] * color2.rgb[0] / 255 : 255 - 2 * (255 - color1.rgb[0]) * (255 - color2.rgb[0]) / 255;
+        var g = color1.rgb[1] < 128 ? 2 * color1.rgb[1] * color2.rgb[1] / 255 : 255 - 2 * (255 - color1.rgb[1]) * (255 - color2.rgb[1]) / 255;
+        var b = color1.rgb[2] < 128 ? 2 * color1.rgb[2] * color2.rgb[2] / 255 : 255 - 2 * (255 - color1.rgb[2]) * (255 - color2.rgb[2]) / 255;
+        return this.rgb(r, g, b);
+    },
+    softlight: function(color1, color2) {
+        var t = color2.rgb[0] * color1.rgb[0] / 255;
+        var r = t + color1.rgb[0] * (255 - (255 - color1.rgb[0]) * (255 - color2.rgb[0]) / 255 - t) / 255;
+        t = color2.rgb[1] * color1.rgb[1] / 255;
+        var g = t + color1.rgb[1] * (255 - (255 - color1.rgb[1]) * (255 - color2.rgb[1]) / 255 - t) / 255;
+        t = color2.rgb[2] * color1.rgb[2] / 255;
+        var b = t + color1.rgb[2] * (255 - (255 - color1.rgb[2]) * (255 - color2.rgb[2]) / 255 - t) / 255;
+        return this.rgb(r, g, b);
+    },
+    hardlight: function(color1, color2) {
+        var r = color2.rgb[0] < 128 ? 2 * color2.rgb[0] * color1.rgb[0] / 255 : 255 - 2 * (255 - color2.rgb[0]) * (255 - color1.rgb[0]) / 255;
+        var g = color2.rgb[1] < 128 ? 2 * color2.rgb[1] * color1.rgb[1] / 255 : 255 - 2 * (255 - color2.rgb[1]) * (255 - color1.rgb[1]) / 255;
+        var b = color2.rgb[2] < 128 ? 2 * color2.rgb[2] * color1.rgb[2] / 255 : 255 - 2 * (255 - color2.rgb[2]) * (255 - color1.rgb[2]) / 255;
+        return this.rgb(r, g, b);
+    },
+    difference: function(color1, color2) {
+        var r = Math.abs(color1.rgb[0] - color2.rgb[0]);
+        var g = Math.abs(color1.rgb[1] - color2.rgb[1]);
+        var b = Math.abs(color1.rgb[2] - color2.rgb[2]);
+        return this.rgb(r, g, b);
+    },
+    exclusion: function(color1, color2) {
+        var r = color1.rgb[0] + color2.rgb[0] * (255 - color1.rgb[0] - color1.rgb[0]) / 255;
+        var g = color1.rgb[1] + color2.rgb[1] * (255 - color1.rgb[1] - color1.rgb[1]) / 255;
+        var b = color1.rgb[2] + color2.rgb[2] * (255 - color1.rgb[2] - color1.rgb[2]) / 255;
+        return this.rgb(r, g, b);
+    },
+    average: function(color1, color2) {
+        var r = (color1.rgb[0] + color2.rgb[0]) / 2;
+        var g = (color1.rgb[1] + color2.rgb[1]) / 2;
+        var b = (color1.rgb[2] + color2.rgb[2]) / 2;
+        return this.rgb(r, g, b);
+    },
+    negation: function(color1, color2) {
+        var r = 255 - Math.abs(255 - color2.rgb[0] - color1.rgb[0]);
+        var g = 255 - Math.abs(255 - color2.rgb[1] - color1.rgb[1]);
+        var b = 255 - Math.abs(255 - color2.rgb[2] - color1.rgb[2]);
+        return this.rgb(r, g, b);
+    },
+    tint: function(color, amount) {
+        return this.mix(this.rgb(255,255,255), color, amount);
+    },
+    shade: function(color, amount) {
+        return this.mix(this.rgb(0, 0, 0), color, amount);
     }
 };
 
-function hsla(hsla) {
-    return tree.functions.hsla(hsla.h, hsla.s, hsla.l, hsla.a);
+function hsla(color) {
+    return tree.functions.hsla(color.h, color.s, color.l, color.a);
+}
+
+function scaled(n, size) {
+    if (n instanceof tree.Dimension && n.unit == '%') {
+        return parseFloat(n.value * size / 100);
+    } else {
+        return number(n);
+    }
 }
 
 function number(n) {
@@ -182,4 +374,4 @@ function clamp(val) {
     return Math.min(1, Math.max(0, val));
 }
 
-})(require('less/tree'));
+})(require('./tree'));
index c2c248d..37fc902 100644 (file)
@@ -1,18 +1,14 @@
 var path = require('path'),
     sys = require('util'),
+    url = require('url'),
+    http = require('http'),
     fs = require('fs');
 
-try {
-       // For old node.js versions
-       require.paths.unshift( path.join( __dirname, '..' ) );
-} catch ( ex ) {
-}
-
 var less = {
-    version: [1, 1, 3],
-    Parser: require('less/parser').Parser,
-    importer: require('less/parser').importer,
-    tree: require('less/tree'),
+    version: [1, 3, 3],
+    Parser: require('./parser').Parser,
+    importer: require('./parser').importer,
+    tree: require('./tree'),
     render: function (input, options, callback) {
         options = options || {};
 
@@ -20,12 +16,12 @@ var less = {
             callback = options, options = {};
         }
 
-        var parser = new(this.Parser)(options),
+        var parser = new(less.Parser)(options),
             ee;
 
         if (callback) {
             parser.parse(input, function (e, root) {
-                callback(e, root.toCSS(options));
+                callback(e, root && root.toCSS && root.toCSS(options));
             });
         } else {
             ee = new(require('events').EventEmitter);
@@ -39,105 +35,182 @@ var less = {
             return ee;
         }
     },
-    writeError: function (ctx, options) {
+    formatError: function(ctx, options) {
+        options = options || {};
+
         var message = "";
         var extract = ctx.extract;
         var error = [];
-        var stylize = options.color ? less.stylize : function (str) { return str };
+        var stylize = options.color ? require('./lessc_helper').stylize : function (str) { return str };
 
-        options = options || {};
-
-        if (options.silent) { return }
+        // only output a stack if it isn't a less error
+        if (ctx.stack && !ctx.type) { return stylize(ctx.stack, 'red') }
 
-        if (!ctx.index) {
-            return sys.error(ctx.stack || ctx.message);
+        if (!ctx.hasOwnProperty('index') || !extract) {
+            return ctx.stack || ctx.message;
         }
 
         if (typeof(extract[0]) === 'string') {
             error.push(stylize((ctx.line - 1) + ' ' + extract[0], 'grey'));
         }
 
-        error.push(ctx.line + ' ' + extract[1].slice(0, ctx.column)
-                            + stylize(stylize(extract[1][ctx.column], 'bold')
-                            + extract[1].slice(ctx.column + 1), 'yellow'));
+        if (extract[1]) {
+            error.push(ctx.line + ' ' + extract[1].slice(0, ctx.column)
+                                + stylize(stylize(stylize(extract[1][ctx.column], 'bold')
+                                + extract[1].slice(ctx.column + 1), 'red'), 'inverse'));
+        }
 
         if (typeof(extract[2]) === 'string') {
             error.push(stylize((ctx.line + 1) + ' ' + extract[2], 'grey'));
         }
-        error = error.join('\n') + '\033[0m\n';
+        error = error.join('\n') + stylize('', 'reset') + '\n';
 
-        message += stylize(ctx.message, 'red');
-        ctx.filename && (message += stylize(' in ', 'red') + ctx.filename);
+        message += stylize(ctx.type + 'Error: ' + ctx.message, 'red');
+        ctx.filename && (message += stylize(' in ', 'red') + ctx.filename +
+                stylize(':' + ctx.line + ':' + ctx.column, 'grey'));
 
-        sys.error(message, error);
+        message += '\n' + error;
 
         if (ctx.callLine) {
-            sys.error(stylize('from ', 'red')       + (ctx.filename || ''));
-            sys.error(stylize(ctx.callLine, 'grey') + ' ' + ctx.callExtract);
+            message += stylize('from ', 'red') + (ctx.filename || '') + '/n';
+            message += stylize(ctx.callLine, 'grey') + ' ' + ctx.callExtract + '/n';
         }
-        if (ctx.stack) { sys.error(stylize(ctx.stack, 'red')) }
+
+        return message;
+    },
+    writeError: function (ctx, options) {
+        options = options || {};
+        if (options.silent) { return }
+        sys.error(less.formatError(ctx, options));
     }
 };
 
-['color',    'directive', 'operation',  'dimension',
- 'keyword',  'variable',  'ruleset',    'element',
- 'selector', 'quoted',    'expression', 'rule',
- 'call',     'url',       'alpha',      'import',
- 'mixin',    'comment',   'anonymous',  'value', 'javascript'
+['color',      'directive',  'operation',  'dimension',
+ 'keyword',    'variable',   'ruleset',    'element',
+ 'selector',   'quoted',     'expression', 'rule',
+ 'call',       'url',        'alpha',      'import',
+ 'mixin',      'comment',    'anonymous',  'value',
+ 'javascript', 'assignment', 'condition',  'paren',
+ 'media',      'ratio',      'unicode-descriptor'
 ].forEach(function (n) {
-    require(path.join('less', 'tree', n));
+    require('./tree/' + n);
 });
 
-less.Parser.importer = function (file, paths, callback) {
-    var pathname;
 
-    paths.unshift('.');
+var isUrlRe = /^(?:https?:)?\/\//i;
+
+less.Parser.importer = function (file, paths, callback, env) {
+    var pathname, dirname, data;
 
-    for (var i = 0; i < paths.length; i++) {
-        try {
-            pathname = path.join(paths[i], file);
-            fs.statSync(pathname);
-            break;
-        } catch (e) {
-            pathname = null;
+    function parseFile(e, data) {
+        if (e) return callback(e);
+        
+        var rootpath = env.rootpath,
+            j = file.lastIndexOf('/');
+
+        // Pass on an updated rootpath if path of imported file is relative and file 
+        // is in a (sub|sup) directory
+        // 
+        // Examples: 
+        // - If path of imported file is 'module/nav/nav.less' and rootpath is 'less/',
+        //   then rootpath should become 'less/module/nav/'
+        // - If path of imported file is '../mixins.less' and rootpath is 'less/', 
+        //   then rootpath should become 'less/../'
+        if(env.relativeUrls && !/^(?:[a-z-]+:|\/)/.test(file) && j != -1) {
+            rootpath = rootpath + file.slice(0, j+1); // append (sub|sup) directory path of imported file
         }
-    }
 
-    if (pathname) {
-        fs.readFile(pathname, 'utf-8', function(e, data) {
-          if (e) sys.error(e);
-
-          new(less.Parser)({
-              paths: [path.dirname(pathname)].concat(paths),
-              filename: pathname
-          }).parse(data, function (e, root) {
-              if (e) less.writeError(e);
-              callback(root);
-          });
+        env.contents[pathname] = data;      // Updating top importing parser content cache.
+        new(less.Parser)({
+                paths: [dirname].concat(paths),
+                filename: pathname,
+                contents: env.contents,
+                files: env.files,
+                syncImport: env.syncImport,
+                relativeUrls: env.relativeUrls,
+                rootpath: rootpath,
+                dumpLineNumbers: env.dumpLineNumbers
+        }).parse(data, function (e, root) {
+            callback(e, root, pathname);
         });
+    };
+    
+    var isUrl = isUrlRe.test( file );
+    if (isUrl || isUrlRe.test(paths[0])) {
+
+        var urlStr = isUrl ? file : url.resolve(paths[0], file),
+            urlObj = url.parse(urlStr),
+            req = {
+                host:   urlObj.hostname,
+                port:   urlObj.port || 80,
+                path:   urlObj.pathname + (urlObj.search||'')
+            };
+
+        http.get(req, function (res) {
+            var body = '';
+            res.on('data', function (chunk) {
+                body += chunk.toString();
+            });
+            res.on('end', function () {
+                if (res.statusCode === 404) {
+                    callback({ type: 'File', message: "resource '" + urlStr + "' was not found\n" });
+                }
+                if (!body) {
+                    sys.error( 'Warning: Empty body (HTTP '+ res.statusCode + ') returned by "' + urlStr +'"' );
+                }
+                pathname = urlStr;
+                dirname = urlObj.protocol +'//'+ urlObj.host + urlObj.pathname.replace(/[^\/]*$/, '');
+                parseFile(null, body);
+            });
+        }).on('error', function (err) {
+            callback({ type: 'File', message: "resource '" + urlStr + "' gave this Error:\n  "+ err +"\n" });
+        });
+
     } else {
-        sys.error("file '" + file + "' wasn't found.\n");
-        process.exit(1);
-    }
-}
 
-require('less/functions');
+        // TODO: Undo this at some point,
+        // or use different approach.
+        var paths = [].concat(paths);
+        paths.push('.');
+
+        for (var i = 0; i < paths.length; i++) {
+            try {
+                pathname = path.join(paths[i], file);
+                fs.statSync(pathname);
+                break;
+            } catch (e) {
+                pathname = null;
+            }
+        }
+        
+        paths = paths.slice(0, paths.length - 1);
 
-for (var k in less) { exports[k] = less[k] }
+        if (!pathname) {
 
-// Stylize a string
-function stylize(str, style) {
-    var styles = {
-        'bold'      : [1,  22],
-        'inverse'   : [7,  27],
-        'underline' : [4,  24],
-        'yellow'    : [33, 39],
-        'green'     : [32, 39],
-        'red'       : [31, 39],
-        'grey'      : [90, 39]
-    };
-    return '\033[' + styles[style][0] + 'm' + str +
-           '\033[' + styles[style][1] + 'm';
+            if (typeof(env.errback) === "function") {
+                env.errback(file, paths, callback);
+            } else {
+                callback({ type: 'File', message: "'" + file + "' wasn't found.\n" });
+            }
+            return;
+        }
+        
+        dirname = path.dirname(pathname);
+
+        if (env.syncImport) {
+            try {
+                data = fs.readFileSync(pathname, 'utf-8');
+                parseFile(null, data);
+            } catch (e) {
+                parseFile(e);
+            }
+        } else {
+            fs.readFile(pathname, 'utf-8', parseFile);
+        }
+    }
 }
-less.stylize = stylize;
 
+require('./functions');
+require('./colors');
+
+for (var k in less) { exports[k] = less[k] }
diff --git a/build-tools/lib/less/lessc_helper.js b/build-tools/lib/less/lessc_helper.js
new file mode 100644 (file)
index 0000000..1a82ef9
--- /dev/null
@@ -0,0 +1,62 @@
+// lessc_helper.js
+//
+//      helper functions for lessc
+sys = require('util');
+
+var lessc_helper = {
+
+    //Stylize a string
+    stylize : function(str, style) {
+        var styles = {
+            'reset'     : [0,   0],
+            'bold'      : [1,  22],
+            'inverse'   : [7,  27],
+            'underline' : [4,  24],
+            'yellow'    : [33, 39],
+            'green'     : [32, 39],
+            'red'       : [31, 39],
+            'grey'      : [90, 39]
+        };
+        return '\033[' + styles[style][0] + 'm' + str +
+               '\033[' + styles[style][1] + 'm';
+    },
+
+    //Print command line options
+    printUsage: function() {
+        sys.puts("usage: lessc [option option=parameter ...] <source> [destination]");
+        sys.puts("");
+        sys.puts("If source is set to `-' (dash or hyphen-minus), input is read from stdin.");
+        sys.puts("");
+        sys.puts("options:");
+        sys.puts("  -h, --help              Print help (this message) and exit.");
+        sys.puts("  --include-path          Set include paths. Separated by `:'. Use `;' on Windows.");
+        sys.puts("  --no-color              Disable colorized output.");
+        sys.puts("  -s, --silent            Suppress output of error messages.");
+        sys.puts("  --strict-imports        Force evaluation of imports.");
+        sys.puts("  --verbose               Be verbose.");
+        sys.puts("  -v, --version           Print version number and exit.");
+        sys.puts("  -x, --compress          Compress output by removing some whitespaces.");
+        sys.puts("  --yui-compress          Compress output using ycssmin");
+        sys.puts("  -O0, -O1, -O2           Set the parser's optimization level. The lower");
+        sys.puts("                          the number, the less nodes it will create in the");
+        sys.puts("                          tree. This could matter for debugging, or if you");
+        sys.puts("                          want to access the individual nodes in the tree.");
+        sys.puts("  --line-numbers=TYPE     Outputs filename and line numbers.");
+        sys.puts("                          TYPE can be either 'comments', which will output");
+        sys.puts("                          the debug info within comments, 'mediaquery'");
+        sys.puts("                          that will output the information within a fake");
+        sys.puts("                          media query which is compatible with the SASS");
+        sys.puts("                          format, and 'all' which will do both.");
+        sys.puts("  -rp, --rootpath         Set rootpath for url rewriting in relative imports and urls.");
+        sys.puts("                          Works with or withour the relative-urls option.");
+        sys.puts("  -ru, --relative-urls    re-write relative urls to the base less file.");
+        sys.puts("");
+        sys.puts("Report bugs to: http://github.com/cloudhead/less.js/issues");
+        sys.puts("Home page: <http://lesscss.org/>");
+    }
+
+
+}
+
+// Exports helper functions
+for (var h in lessc_helper) { exports[h] = lessc_helper[h] }
index fae248e..c8c280b 100644 (file)
@@ -1,16 +1,17 @@
-var less, tree;
+var less, tree, charset;
 
 if (typeof environment === "object" && ({}).toString.call(environment) === "[object Environment]") {
     // Rhino
     // Details on how to detect Rhino: https://github.com/ringo/ringojs/issues/88
-    less = {};
+    if (typeof(window) === 'undefined') { less = {} }
+    else                                { less = window.less = {} }
     tree = less.tree = {};
     less.mode = 'rhino';
 } else if (typeof(window) === 'undefined') {
     // Node.js
     less = exports,
-    tree = require('less/tree');
-    less.mode = 'rhino';
+    tree = require('./tree');
+    less.mode = 'node';
 } else {
     // Browser
     if (typeof(window.less) === 'undefined') { window.less = {} }
@@ -64,15 +65,25 @@ less.Parser = function Parser(env) {
 
     var that = this;
 
+    // Top parser on an import tree must be sure there is one "env"
+    // which will then be passed arround by reference.
+    var env = env || { };
+    // env.contents and files must be passed arround with top env
+    if (!env.contents) { env.contents = {}; }
+    env.rootpath = env.rootpath || '';       // env.rootpath must be initialized to '' if not provided
+    if (!env.files) { env.files = {}; }
+
     // This function is called after all files
     // have been imported through `@import`.
     var finish = function () {};
 
     var imports = this.imports = {
-        paths: env && env.paths || [],  // Search paths, when importing
-        queue: [],                      // Files which haven't been imported yet
-        files: {},                      // Holds the imported parse trees
-        mime:  env && env.mime,         // MIME type of .less files
+        paths: env.paths || [],  // Search paths, when importing
+        queue: [],               // Files which haven't been imported yet
+        files: env.files,        // Holds the imported parse trees
+        contents: env.contents,  // Holds the imported file contents
+        mime:  env.mime,         // MIME type of .less files
+        error: null,             // Error in parsing/evaluating an import
         push: function (path, callback) {
             var that = this;
             this.queue.push(path);
@@ -80,13 +91,18 @@ less.Parser = function Parser(env) {
             //
             // Import a file asynchronously
             //
-            less.Parser.importer(path, this.paths, function (root) {
+            less.Parser.importer(path, this.paths, function (e, root, fullPath) {
                 that.queue.splice(that.queue.indexOf(path), 1); // Remove the path from the queue
-                that.files[path] = root;                        // Store the root
 
-                callback(root);
+                var imported = fullPath in that.files;
+
+                that.files[fullPath] = root;                        // Store the root
 
-                if (that.queue.length === 0) { finish() }       // Call `finish` if we're done importing
+                if (e && !that.error) { that.error = e }
+
+                callback(e, root, imported);
+
+                if (that.queue.length === 0) { finish(that.error) }       // Call `finish` if we're done importing
             }, env);
         }
     };
@@ -100,11 +116,16 @@ less.Parser = function Parser(env) {
             current = i;
         }
     }
+    function isWhitespace(c) {
+        // Could change to \s?
+        var code = c.charCodeAt(0);
+        return code === 32 || code === 10 || code === 9;
+    }
     //
     // Parse from a token, regexp or string, and move forward if match
     //
     function $(tok) {
-        var match, args, length, c, index, endIndex, k, mem;
+        var match, args, length, index, k;
 
         //
         // Non-terminal
@@ -137,18 +158,7 @@ less.Parser = function Parser(env) {
         // grammar is mostly white-space insensitive.
         //
         if (match) {
-            mem = i += length;
-            endIndex = i + chunks[j].length - length;
-
-            while (i < endIndex) {
-                c = input.charCodeAt(i);
-                if (! (c === 32 || c === 10 || c === 9)) { break }
-                i++;
-            }
-            chunks[j] = chunks[j].slice(length + (i - mem));
-            current = i;
-
-            if (chunks[j].length === 0 && j < chunks.length - 1) { j++ }
+            skipWhitespace(length);
 
             if(typeof(match) === 'string') {
                 return match;
@@ -158,6 +168,40 @@ less.Parser = function Parser(env) {
         }
     }
 
+    function skipWhitespace(length) {
+        var oldi = i, oldj = j,
+            endIndex = i + chunks[j].length,
+            mem = i += length;
+
+        while (i < endIndex) {
+            if (! isWhitespace(input.charAt(i))) { break }
+            i++;
+        }
+        chunks[j] = chunks[j].slice(length + (i - mem));
+        current = i;
+
+        if (chunks[j].length === 0 && j < chunks.length - 1) { j++ }
+
+        return oldi !== i || oldj !== j;
+    }
+
+    function expect(arg, msg) {
+        var result = $(arg);
+        if (! result) {
+            error(msg || (typeof(arg) === 'string' ? "expected '" + arg + "' got '" + input.charAt(i) + "'"
+                                                   : "unexpected token"));
+        } else {
+            return result;
+        }
+    }
+
+    function error(msg, type) {
+        var e = new Error(msg);
+        e.index = i;
+        e.type = type || 'Syntax';
+        throw e;
+    }
+
     // Same as $(), but don't change the state of the parser,
     // just return the match.
     function peek(tok) {
@@ -172,6 +216,60 @@ less.Parser = function Parser(env) {
         }
     }
 
+    function getInput(e, env) {
+        if (e.filename && env.filename && (e.filename !== env.filename)) {
+            return parser.imports.contents[e.filename];
+        } else {
+            return input;
+        }
+    }
+
+    function getLocation(index, input) {
+        for (var n = index, column = -1;
+                 n >= 0 && input.charAt(n) !== '\n';
+                 n--) { column++ }
+
+        return { line:   typeof(index) === 'number' ? (input.slice(0, index).match(/\n/g) || "").length : null,
+                 column: column };
+    }
+
+    function getFileName(e) {
+        if(less.mode === 'browser' || less.mode === 'rhino')
+            return e.filename;
+        else
+            return require('path').resolve(e.filename);
+    }
+
+    function getDebugInfo(index, inputStream, e) {
+        return {
+            lineNumber: getLocation(index, inputStream).line + 1,
+            fileName: getFileName(e)
+        };
+    }
+
+    function LessError(e, env) {
+        var input = getInput(e, env),
+            loc = getLocation(e.index, input),
+            line = loc.line,
+            col  = loc.column,
+            lines = input.split('\n');
+
+        this.type = e.type || 'Syntax';
+        this.message = e.message;
+        this.filename = e.filename || env.filename;
+        this.index = e.index;
+        this.line = typeof(line) === 'number' ? line + 1 : null;
+        this.callLine = e.call && (getLocation(e.call, input).line + 1);
+        this.callExtract = lines[getLocation(e.call, input).line];
+        this.stack = e.stack;
+        this.column = col;
+        this.extract = [
+            lines[line - 1],
+            lines[line],
+            lines[line + 1]
+        ];
+    }
+
     this.env = env = env || {};
 
     // The optimization level dictates the thoroughness of the parser,
@@ -196,21 +294,23 @@ less.Parser = function Parser(env) {
             var root, start, end, zone, line, lines, buff = [], c, error = null;
 
             i = j = current = furthest = 0;
-            chunks = [];
             input = str.replace(/\r\n/g, '\n');
 
+            // Remove potential UTF Byte Order Mark
+            input = input.replace(/^\uFEFF/, '');
+
             // Split the input into chunks.
             chunks = (function (chunks) {
                 var j = 0,
-                    skip = /[^"'`\{\}\/\(\)]+/g,
+                    skip = /(?:@\{[\w-]+\}|[^"'`\{\}\/\(\)\\])+/g,
                     comment = /\/\*(?:[^*]|\*+[^\/*])*\*+\/|\/\/.*/g,
+                    string = /"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'|`((?:[^`]|\\.)*)`/g,
                     level = 0,
                     match,
                     chunk = chunks[0],
-                    inParam,
-                    inString;
+                    inParam;
 
-                for (var i = 0, c, cc; i < input.length; i++) {
+                for (var i = 0, c, cc; i < input.length;) {
                     skip.lastIndex = i;
                     if (match = skip.exec(input)) {
                         if (match.index === i) {
@@ -219,66 +319,71 @@ less.Parser = function Parser(env) {
                         }
                     }
                     c = input.charAt(i);
-                    comment.lastIndex = i;
+                    comment.lastIndex = string.lastIndex = i;
+
+                    if (match = string.exec(input)) {
+                        if (match.index === i) {
+                            i += match[0].length;
+                            chunk.push(match[0]);
+                            continue;
+                        }
+                    }
 
-                    if (!inString && !inParam && c === '/') {
+                    if (!inParam && c === '/') {
                         cc = input.charAt(i + 1);
                         if (cc === '/' || cc === '*') {
                             if (match = comment.exec(input)) {
                                 if (match.index === i) {
                                     i += match[0].length;
                                     chunk.push(match[0]);
-                                    c = input.charAt(i);
+                                    continue;
                                 }
                             }
                         }
                     }
-
-                    if        (c === '{' && !inString && !inParam) { level ++;
-                        chunk.push(c);
-                    } else if (c === '}' && !inString && !inParam) { level --;
-                        chunk.push(c);
-                        chunks[++j] = chunk = [];
-                    } else if (c === '(' && !inString && !inParam) {
-                        chunk.push(c);
-                        inParam = true;
-                    } else if (c === ')' && !inString && inParam) {
-                        chunk.push(c);
-                        inParam = false;
-                    } else {
-                        if (c === '"' || c === "'" || c === '`') {
-                            if (! inString) {
-                                inString = c;
-                            } else {
-                                inString = inString === c ? false : inString;
-                            }
-                        }
-                        chunk.push(c);
+                    
+                    switch (c) {
+                        case '{': if (! inParam) { level ++;        chunk.push(c);                           break }
+                        case '}': if (! inParam) { level --;        chunk.push(c); chunks[++j] = chunk = []; break }
+                        case '(': if (! inParam) { inParam = true;  chunk.push(c);                           break }
+                        case ')': if (  inParam) { inParam = false; chunk.push(c);                           break }
+                        default:                                    chunk.push(c);
                     }
+                    
+                    i++;
                 }
-                if (level > 0) {
-                    throw {
-                        type: 'Syntax',
-                        message: "Missing closing `}`",
+                if (level != 0) {
+                    error = new(LessError)({
+                        index: i-1,
+                        type: 'Parse',
+                        message: (level > 0) ? "missing closing `}`" : "missing opening `{`",
                         filename: env.filename
-                    };
+                    }, env);
                 }
 
                 return chunks.map(function (c) { return c.join('') });;
             })([[]]);
 
+            if (error) {
+                return callback(error, env);
+            }
+
             // Start with the primary rule.
             // The whole syntax tree is held under a Ruleset node,
             // with the `root` property set to true, so no `{}` are
             // output. The callback is called when the input is parsed.
-            root = new(tree.Ruleset)([], $(this.parsers.primary));
-            root.root = true;
+            try {
+                root = new(tree.Ruleset)([], $(this.parsers.primary));
+                root.root = true;
+            } catch (e) {
+                return callback(new(LessError)(e, env));
+            }
 
             root.toCSS = (function (evaluate) {
                 var line, lines, column;
 
                 return function (options, variables) {
-                    var frames = [];
+                    var frames = [], importError;
 
                     options = options || {};
                     //
@@ -311,41 +416,23 @@ less.Parser = function Parser(env) {
 
                     try {
                         var css = evaluate.call(this, { frames: frames })
-                                          .toCSS([], { compress: options.compress || false });
+                                          .toCSS([], { compress: options.compress || false, dumpLineNumbers: env.dumpLineNumbers });
                     } catch (e) {
-                        lines = input.split('\n');
-                        line = getLine(e.index);
-
-                        for (var n = e.index, column = -1;
-                                 n >= 0 && input.charAt(n) !== '\n';
-                                 n--) { column++ }
-
-                        throw {
-                            type: e.type,
-                            message: e.message,
-                            filename: env.filename,
-                            index: e.index,
-                            line: typeof(line) === 'number' ? line + 1 : null,
-                            callLine: e.call && (getLine(e.call) + 1),
-                            callExtract: lines[getLine(e.call)],
-                            stack: e.stack,
-                            column: column,
-                            extract: [
-                                lines[line - 1],
-                                lines[line],
-                                lines[line + 1]
-                            ]
-                        };
+                        throw new(LessError)(e, env);
                     }
-                    if (options.compress) {
+
+                    if ((importError = parser.imports.error)) { // Check if there was an error during importing
+                        if (importError instanceof LessError) throw importError;
+                        else                                  throw new(LessError)(importError, env);
+                    }
+
+                    if (options.yuicompress && less.mode === 'node') {
+                        return require('ycssmin').cssmin(css);
+                    } else if (options.compress) {
                         return css.replace(/(\s)+/g, "$1");
                     } else {
                         return css;
                     }
-
-                    function getLine(index) {
-                        return index ? (input.slice(0, index).match(/\n/g) || "").length : null;
-                    }
                 };
             })(root.eval);
 
@@ -365,7 +452,7 @@ less.Parser = function Parser(env) {
                 for (var n = i, column = -1; n >= 0 && input.charAt(n) !== '\n'; n--) { column++ }
 
                 error = {
-                    name: "ParseError",
+                    type: "Parse",
                     message: "Syntax Error on line " + line,
                     index: i,
                     filename: env.filename,
@@ -380,7 +467,11 @@ less.Parser = function Parser(env) {
             }
 
             if (this.imports.queue.length > 0) {
-                finish = function () { callback(error, root) };
+                finish = function (e) {
+                    e = error || e;
+                    if (e) callback(e);
+                    else callback(null, root);
+                };
             } else {
                 callback(error, root);
             }
@@ -436,7 +527,7 @@ less.Parser = function Parser(env) {
 
                 while ((node = $(this.mixin.definition) || $(this.rule)    ||  $(this.ruleset) ||
                                $(this.mixin.call)       || $(this.comment) ||  $(this.directive))
-                               || $(/^[\s\n]+/)) {
+                               || $(/^[\s\n]+/) || $(/^;+/)) {
                     node && root.push(node);
                 }
                 return root;
@@ -486,7 +577,15 @@ less.Parser = function Parser(env) {
                 //
                 keyword: function () {
                     var k;
-                    if (k = $(/^[_A-Za-z-][_A-Za-z0-9-]*/)) { return new(tree.Keyword)(k) }
+
+                    if (k = $(/^[_A-Za-z-][_A-Za-z0-9-]*/)) {
+                        if (tree.colors.hasOwnProperty(k)) {
+                            // detect named color
+                            return new(tree.Color)(tree.colors[k].slice(1));
+                        } else {
+                            return new(tree.Keyword)(k);
+                        }
+                    }
                 },
 
                 //
@@ -500,16 +599,22 @@ less.Parser = function Parser(env) {
                 // The arguments are parsed with the `entities.arguments` parser.
                 //
                 call: function () {
-                    var name, args, index = i;
+                    var name, nameLC, args, alpha_ret, index = i;
 
-                    if (! (name = /^([\w-]+|%)\(/.exec(chunks[j]))) return;
+                    if (! (name = /^([\w-]+|%|progid:[\w\.]+)\(/.exec(chunks[j]))) return;
 
-                    name = name[1].toLowerCase();
+                    name = name[1];
+                    nameLC = name.toLowerCase();
 
-                    if (name === 'url') { return null }
+                    if (nameLC === 'url') { return null }
                     else                { i += name.length }
 
-                    if (name === 'alpha') { return $(this.alpha) }
+                    if (nameLC === 'alpha') {
+                        alpha_ret = $(this.alpha);
+                        if(typeof alpha_ret !== 'undefined') {
+                            return alpha_ret;
+                        }
+                    }
 
                     $('('); // Parse the '(' and consume whitespace.
 
@@ -517,21 +622,36 @@ less.Parser = function Parser(env) {
 
                     if (! $(')')) return;
 
-                    if (name) { return new(tree.Call)(name, args, index) }
+                    if (name) { return new(tree.Call)(name, args, index, env.filename) }
                 },
                 arguments: function () {
                     var args = [], arg;
 
-                    while (arg = $(this.expression)) {
+                    while (arg = $(this.entities.assignment) || $(this.expression)) {
                         args.push(arg);
                         if (! $(',')) { break }
                     }
                     return args;
                 },
                 literal: function () {
-                    return $(this.entities.dimension) ||
+                    return $(this.entities.ratio) ||
+                           $(this.entities.dimension) ||
                            $(this.entities.color) ||
-                           $(this.entities.quoted);
+                           $(this.entities.quoted) ||
+                           $(this.entities.unicodeDescriptor);
+                },
+
+                // Assignments are argument entities for calls.
+                // They are present in ie filter properties as shown below.
+                //
+                //     filter: progid:DXImageTransform.Microsoft.Alpha( *opacity=50* )
+                //
+
+                assignment: function () {
+                    var key, value;
+                    if ((key = $(/^\w+(?=\s?=)/i)) && $('=') && (value = $(this.entity))) {
+                        return new(tree.Assignment)(key, value);
+                    }
                 },
 
                 //
@@ -546,25 +666,12 @@ less.Parser = function Parser(env) {
 
                     if (input.charAt(i) !== 'u' || !$(/^url\(/)) return;
                     value = $(this.entities.quoted)  || $(this.entities.variable) ||
-                            $(this.entities.dataURI) || $(/^[-\w%@$\/.&=:;#+?~]+/) || "";
-                    if (! $(')')) throw new(Error)("missing closing ) for url()");
-
-                    return new(tree.URL)((value.value || value.data || value instanceof tree.Variable)
-                                        ? value : new(tree.Anonymous)(value), imports.paths);
-                },
+                            $(/^(?:(?:\\[\(\)'"])|[^\(\)'"])+/) || "";
 
-                dataURI: function () {
-                    var obj;
+                    expect(')');
 
-                    if ($(/^data:/)) {
-                        obj         = {};
-                        obj.mime    = $(/^[^\/]+\/[^,;)]+/)     || '';
-                        obj.charset = $(/^;\s*charset=[^,;)]+/) || '';
-                        obj.base64  = $(/^;\s*base64/)          || '';
-                        obj.data    = $(/^,\s*[^)]+/);
-
-                        if (obj.data) { return obj }
-                    }
+                    return new(tree.URL)((value.value != null || value instanceof tree.Variable)
+                                        ? value : new(tree.Anonymous)(value), env.rootpath);
                 },
 
                 //
@@ -579,7 +686,16 @@ less.Parser = function Parser(env) {
                     var name, index = i;
 
                     if (input.charAt(i) === '@' && (name = $(/^@@?[\w-]+/))) {
-                        return new(tree.Variable)(name, index);
+                        return new(tree.Variable)(name, index, env.filename);
+                    }
+                },
+
+                // A variable entity useing the protective {} e.g. @{var}
+                variableCurly: function () {
+                    var name, curly, index = i;
+
+                    if (input.charAt(i) === '@' && (curly = $(/^@\{([\w-]+)\}/))) {
+                        return new(tree.Variable)("@" + curly[1], index, env.filename);
                     }
                 },
 
@@ -593,7 +709,7 @@ less.Parser = function Parser(env) {
                 color: function () {
                     var rgb;
 
-                    if (input.charAt(i) === '#' && (rgb = $(/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})/))) {
+                    if (input.charAt(i) === '#' && (rgb = $(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})/))) {
                         return new(tree.Color)(rgb[1]);
                     }
                 },
@@ -605,14 +721,42 @@ less.Parser = function Parser(env) {
                 //
                 dimension: function () {
                     var value, c = input.charCodeAt(i);
-                    if ((c > 57 || c < 45) || c === 47) return;
+                    //Is the first char of the dimension 0-9, '.', '+' or '-'
+                    if ((c > 57 || c < 43) || c === 47 || c == 44) return;
 
-                    if (value = $(/^(-?\d*\.?\d+)(px|%|em|rem|pc|ex|in|deg|s|ms|pt|cm|mm|rad|grad|turn)?/)) {
+                    if (value = $(/^([+-]?\d*\.?\d+)(px|%|em|pc|ex|in|deg|s|ms|pt|cm|mm|rad|grad|turn|dpi|dpcm|dppx|rem|vw|vh|vmin|vm|ch)?/)) {
                         return new(tree.Dimension)(value[1], value[2]);
                     }
                 },
 
                 //
+                // A Ratio
+                //
+                //    16/9
+                //
+                ratio: function () {
+                  var value, c = input.charCodeAt(i);
+                  if (c > 57 || c < 48) return;
+
+                  if (value = $(/^(\d+\/\d+)/)) {
+                    return new(tree.Ratio)(value[1]);
+                  }
+                },
+                
+                //
+                // A unicode descriptor, as is used in unicode-range
+                //
+                // U+0??  or U+00A1-00A9
+                //
+                unicodeDescriptor: function () {
+                    var ud;
+                    
+                    if (ud = $(/^U\+[0-9a-fA-F?]+(\-[0-9a-fA-F?]+)?/)) {
+                        return new(tree.UnicodeDescriptor)(ud[0]);
+                    }
+                },
+
+                //
                 // JavaScript code to be evaluated
                 //
                 //     `window.location.href`
@@ -654,9 +798,13 @@ less.Parser = function Parser(env) {
 
                 if (! peek(/^[@\w.%-]+\/[@\w.-]+/)) return;
 
+                save();
+
                 if ((a = $(this.entity)) && $('/') && (b = $(this.entity))) {
                     return new(tree.Shorthand)(a, b);
                 }
+
+                restore();
             },
 
             //
@@ -675,19 +823,80 @@ less.Parser = function Parser(env) {
                 // selector for now.
                 //
                 call: function () {
-                    var elements = [], e, c, args, index = i, s = input.charAt(i);
+                    var elements = [], e, c, argsSemiColon = [], argsComma = [], args, delim, arg, nameLoop, expressions, isSemiColonSeperated, expressionContainsNamed, index = i, s = input.charAt(i), name, value, important = false;
 
                     if (s !== '.' && s !== '#') { return }
+                    
+                    save(); // stop us absorbing part of an invalid selector
 
-                    while (e = $(/^[#.](?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+/)) {
-                        elements.push(new(tree.Element)(c, e));
+                    while (e = $(/^[#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/)) {
+                        elements.push(new(tree.Element)(c, e, i));
                         c = $('>');
                     }
-                    $('(') && (args = $(this.entities.arguments)) && $(')');
+                    if ($('(')) {
+                        expressions = [];
+                        while (arg = $(this.expression)) {
+                            nameLoop = null;
+                            value = arg;
+
+                            // Variable
+                            if (arg.value.length == 1) {
+                                var val = arg.value[0];
+                                if (val instanceof tree.Variable) {
+                                    if ($(':')) {
+                                        if (expressions.length > 0) {
+                                            if (isSemiColonSeperated) {
+                                                error("Cannot mix ; and , as delimiter types");
+                                            }
+                                            expressionContainsNamed = true;
+                                        }
+                                        value = expect(this.expression);
+                                        nameLoop = (name = val.name);
+                                    }
+                                }
+                            }
+                            
+                            expressions.push(value);
+                            
+                            argsComma.push({ name: nameLoop, value: value });
+                            
+                            if ($(',')) {
+                                continue;
+                            }
+                            
+                            if ($(';') || isSemiColonSeperated) {
+                            
+                                if (expressionContainsNamed) {
+                                    error("Cannot mix ; and , as delimiter types");
+                                }
+                            
+                                isSemiColonSeperated = true;
+                                                        
+                                if (expressions.length > 1) {
+                                    value = new(tree.Value)(expressions);
+                                }
+                                argsSemiColon.push({ name: name, value: value });
+                            
+                                name = null;
+                                expressions = [];
+                                expressionContainsNamed = false;
+                            }
+                        }
+
+                        expect(')');
+                    }
+
+                    args = isSemiColonSeperated ? argsSemiColon : argsComma;
+
+                    if ($(this.important)) {
+                        important = true;
+                    }
 
                     if (elements.length > 0 && ($(';') || peek('}'))) {
-                        return new(tree.mixin.Call)(elements, args, index);
+                        return new(tree.mixin.Call)(elements, args, index, env.filename, important);
                     }
+                    
+                    restore();
                 },
 
                 //
@@ -710,38 +919,62 @@ less.Parser = function Parser(env) {
                 // the `{...}` block.
                 //
                 definition: function () {
-                    var name, params = [], match, ruleset, param, value;
-
+                    var name, params = [], match, ruleset, param, value, cond, variadic = false;
                     if ((input.charAt(i) !== '.' && input.charAt(i) !== '#') ||
-                        peek(/^[^{]*(;|})/)) return;
+                        peek(/^[^{]*\}/)) return;
+
+                    save();
 
-                    if (match = $(/^([#.](?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+)\s*\(/)) {
+                    if (match = $(/^([#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+)\s*\(/)) {
                         name = match[1];
 
-                        while (param = $(this.entities.variable) || $(this.entities.literal)
-                                                                 || $(this.entities.keyword)) {
-                            // Variable
-                            if (param instanceof tree.Variable) {
-                                if ($(':')) {
-                                    if (value = $(this.expression)) {
+                        do {
+                            $(this.comment);
+                            if (input.charAt(i) === '.' && $(/^\.{3}/)) {
+                                variadic = true;
+                                params.push({ variadic: true });
+                                break;
+                            } else if (param = $(this.entities.variable) || $(this.entities.literal)
+                                                                         || $(this.entities.keyword)) {
+                                // Variable
+                                if (param instanceof tree.Variable) {
+                                    if ($(':')) {
+                                        value = expect(this.expression, 'expected expression');
                                         params.push({ name: param.name, value: value });
+                                    } else if ($(/^\.{3}/)) {
+                                        params.push({ name: param.name, variadic: true });
+                                        variadic = true;
+                                        break;
                                     } else {
-                                        throw new(Error)("Expected value");
+                                        params.push({ name: param.name });
                                     }
                                 } else {
-                                    params.push({ name: param.name });
+                                    params.push({ value: param });
                                 }
                             } else {
-                                params.push({ value: param });
+                                break;
                             }
-                            if (! $(',')) { break }
+                        } while ($(',') || $(';'))
+
+                        // .mixincall("@{a}"); 
+                        // looks a bit like a mixin definition.. so we have to be nice and restore
+                        if (!$(')')) {
+                            furthest = i;
+                            restore();
+                        }
+                        
+                        $(this.comment);
+
+                        if ($(/^when/)) { // Guard
+                            cond = expect(this.conditions, 'expected condition');
                         }
-                        if (! $(')')) throw new(Error)("Expected )");
 
                         ruleset = $(this.block);
 
                         if (ruleset) {
-                            return new(tree.mixin.Definition)(name, params, ruleset);
+                            return new(tree.mixin.Definition)(name, params, ruleset, cond, variadic);
+                        } else {
+                            restore();
                         }
                     }
                 }
@@ -753,7 +986,7 @@ less.Parser = function Parser(env) {
             //
             entity: function () {
                 return $(this.entities.literal) || $(this.entities.variable) || $(this.entities.url) ||
-                       $(this.entities.call)    || $(this.entities.keyword)  || $(this.entities.javascript) ||
+                       $(this.entities.call)    || $(this.entities.keyword)  ||$(this.entities.javascript) ||
                        $(this.comment);
             },
 
@@ -776,7 +1009,7 @@ less.Parser = function Parser(env) {
 
                 if (! $(/^\(opacity=/i)) return;
                 if (value = $(/^\d+/) || $(this.entities.variable)) {
-                    if (! $(')')) throw new(Error)("missing closing ) for alpha()");
+                    expect(')');
                     return new(tree.Alpha)(value);
                 }
             },
@@ -794,16 +1027,25 @@ less.Parser = function Parser(env) {
             // and an element name, such as a tag a class, or `*`.
             //
             element: function () {
-                var e, t, c;
+                var e, t, c, v;
 
                 c = $(this.combinator);
-                e = $(/^(?:[.#]?|:*)(?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+/) || $('*') || $(this.attribute) || $(/^\([^)@]+\)/) || $(/^(?:\d*\.)?\d+%/);
 
-                if (e) { return new(tree.Element)(c, e) }
+                e = $(/^(?:\d+\.\d+|\d+)%/) || $(/^(?:[.#]?|:*)(?:[\w-]|[^\x00-\x9f]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/) ||
+                    $('*') || $('&') || $(this.attribute) || $(/^\([^()@]+\)/) || $(/^[\.#](?=@)/) || $(this.entities.variableCurly);
 
-                if (c.value && c.value[0] === '&') {
-                  return new(tree.Element)(c, null);
+                if (! e) {
+                    if ($('(')) {
+                        if ((v = ($(this.entities.variableCurly) || 
+                                $(this.entities.variable) || 
+                                $(this.selector))) && 
+                                $(')')) {
+                            e = new(tree.Paren)(v);
+                        }
+                    }
                 }
+
+                if (e) { return new(tree.Element)(c, e, i) }
             },
 
             //
@@ -818,23 +1060,11 @@ less.Parser = function Parser(env) {
             combinator: function () {
                 var match, c = input.charAt(i);
 
-                if (c === '>' || c === '+' || c === '~') {
+                if (c === '>' || c === '+' || c === '~' || c === '|') {
                     i++;
-                    while (input.charAt(i) === ' ') { i++ }
+                    while (input.charAt(i).match(/\s/)) { i++ }
                     return new(tree.Combinator)(c);
-                } else if (c === '&') {
-                    match = '&';
-                    i++;
-                    if(input.charAt(i) === ' ') {
-                        match = '& ';
-                    }
-                    while (input.charAt(i) === ' ') { i++ }
-                    return new(tree.Combinator)(match);
-                } else if (c === ':' && input.charAt(i + 1) === ':') {
-                    i += 2;
-                    while (input.charAt(i) === ' ') { i++ }
-                    return new(tree.Combinator)('::');
-                } else if (input.charAt(i - 1) === ' ') {
+                } else if (input.charAt(i - 1).match(/\s/)) {
                     return new(tree.Combinator)(" ");
                 } else {
                     return new(tree.Combinator)(null);
@@ -852,23 +1082,27 @@ less.Parser = function Parser(env) {
             selector: function () {
                 var sel, e, elements = [], c, match;
 
+                // depreciated, will be removed soon
+                if ($('(')) {
+                    sel = $(this.entity);
+                    if (!$(')')) { return null; }
+                    return new(tree.Selector)([new(tree.Element)('', sel, i)]);
+                }
+
                 while (e = $(this.element)) {
                     c = input.charAt(i);
                     elements.push(e)
-                    if (c === '{' || c === '}' || c === ';' || c === ',') { break }
+                    if (c === '{' || c === '}' || c === ';' || c === ',' || c === ')') { break }
                 }
 
                 if (elements.length > 0) { return new(tree.Selector)(elements) }
             },
-            tag: function () {
-                return $(/^[a-zA-Z][a-zA-Z-]*[0-9]?/) || $('*');
-            },
             attribute: function () {
                 var attr = '', key, val, op;
 
                 if (! $('[')) return;
 
-                if (key = $(/^[a-zA-Z-]+/) || $(this.entities.quoted)) {
+                if (key = $(/^(?:[_A-Za-z0-9-]|\\.)+/) || $(this.entities.quoted)) {
                     if ((op = $(/^[|~*$^]?=/)) &&
                         (val = $(this.entities.quoted) || $(/^[\w-]+/))) {
                         attr = [key, op, val.toCSS ? val.toCSS() : val].join('');
@@ -886,7 +1120,6 @@ less.Parser = function Parser(env) {
             //
             block: function () {
                 var content;
-
                 if ($('{') && (content = $(this.primary)) && $('}')) {
                     return content;
                 }
@@ -896,9 +1129,13 @@ less.Parser = function Parser(env) {
             // div, .class, body > p {...}
             //
             ruleset: function () {
-                var selectors = [], s, rules, match;
+                var selectors = [], s, rules, match, debugInfo;
+                
                 save();
 
+                if (env.dumpLineNumbers)
+                    debugInfo = getDebugInfo(i, input, env);
+
                 while (s = $(this.selector)) {
                     selectors.push(s);
                     $(this.comment);
@@ -907,7 +1144,10 @@ less.Parser = function Parser(env) {
                 }
 
                 if (selectors.length > 0 && (rules = $(this.block))) {
-                    return new(tree.Ruleset)(selectors, rules);
+                    var ruleset = new(tree.Ruleset)(selectors, rules, env.strictImports);
+                    if (env.dumpLineNumbers)
+                        ruleset.debugInfo = debugInfo;
+                    return ruleset;
                 } else {
                     // Backtrack
                     furthest = i;
@@ -951,11 +1191,79 @@ less.Parser = function Parser(env) {
             // stored in `import`, which we pass to the Import constructor.
             //
             "import": function () {
-                var path;
-                if ($(/^@import\s+/) &&
-                    (path = $(this.entities.quoted) || $(this.entities.url)) &&
-                    $(';')) {
-                    return new(tree.Import)(path, imports);
+                var path, features, index = i;
+                
+                save();
+                
+                var dir = $(/^@import(?:-(once))?\s+/);
+
+                if (dir && (path = $(this.entities.quoted) || $(this.entities.url))) {
+                    features = $(this.mediaFeatures);
+                    if ($(';')) {
+                        return new(tree.Import)(path, imports, features, (dir[1] === 'once'), index, env.rootpath);
+                    }
+                }
+                
+                restore();
+            },
+
+            mediaFeature: function () {
+                var e, p, nodes = [];
+
+                do {
+                    if (e = $(this.entities.keyword)) {
+                        nodes.push(e);
+                    } else if ($('(')) {
+                        p = $(this.property);
+                        e = $(this.entity);
+                        if ($(')')) {
+                            if (p && e) {
+                                nodes.push(new(tree.Paren)(new(tree.Rule)(p, e, null, i, true)));
+                            } else if (e) {
+                                nodes.push(new(tree.Paren)(e));
+                            } else {
+                                return null;
+                            }
+                        } else { return null }
+                    }
+                } while (e);
+
+                if (nodes.length > 0) {
+                    return new(tree.Expression)(nodes);
+                }
+            },
+
+            mediaFeatures: function () {
+                var e, features = [];
+
+                do {
+                  if (e = $(this.mediaFeature)) {
+                      features.push(e);
+                      if (! $(',')) { break }
+                  } else if (e = $(this.entities.variable)) {
+                      features.push(e);
+                      if (! $(',')) { break }
+                  }
+                } while (e);
+
+                return features.length > 0 ? features : null;
+            },
+
+            media: function () {
+                var features, rules, media, debugInfo;
+
+                if (env.dumpLineNumbers)
+                    debugInfo = getDebugInfo(i, input, env);
+
+                if ($(/^@media/)) {
+                    features = $(this.mediaFeatures);
+
+                    if (rules = $(this.block)) {
+                        media = new(tree.Media)(rules, features);
+                        if(env.dumpLineNumbers)
+                            media.debugInfo = debugInfo;
+                        return media;
+                    }
                 }
             },
 
@@ -965,26 +1273,81 @@ less.Parser = function Parser(env) {
             //     @charset "utf-8";
             //
             directive: function () {
-                var name, value, rules, types;
+                var name, value, rules, identifier, e, nodes, nonVendorSpecificName,
+                    hasBlock, hasIdentifier, hasExpression;
 
                 if (input.charAt(i) !== '@') return;
 
-                if (value = $(this['import'])) {
+                if (value = $(this['import']) || $(this.media)) {
                     return value;
-                } else if (name = $(/^@media|@page/) || $(/^@(?:-webkit-|-moz-)?keyframes/)) {
-                    types = ($(/^[^{]+/) || '').trim();
+                }
+                
+                save();
+
+                name = $(/^@[a-z-]+/);
+                
+                if (!name) return;
+
+                nonVendorSpecificName = name;
+                if (name.charAt(1) == '-' && name.indexOf('-', 2) > 0) {
+                    nonVendorSpecificName = "@" + name.slice(name.indexOf('-', 2) + 1);
+                }
+
+                switch(nonVendorSpecificName) {
+                    case "@font-face":
+                        hasBlock = true;
+                        break;
+                    case "@viewport":
+                    case "@top-left":
+                    case "@top-left-corner":
+                    case "@top-center":
+                    case "@top-right":
+                    case "@top-right-corner":
+                    case "@bottom-left":
+                    case "@bottom-left-corner":
+                    case "@bottom-center":
+                    case "@bottom-right":
+                    case "@bottom-right-corner":
+                    case "@left-top":
+                    case "@left-middle":
+                    case "@left-bottom":
+                    case "@right-top":
+                    case "@right-middle":
+                    case "@right-bottom":
+                        hasBlock = true;
+                        break;
+                    case "@page":
+                    case "@document":
+                    case "@supports":
+                    case "@keyframes":
+                        hasBlock = true;
+                        hasIdentifier = true;
+                        break;
+                    case "@namespace":
+                        hasExpression = true;
+                        break;
+                }
+
+                if (hasIdentifier) {
+                    name += " " + ($(/^[^{]+/) || '').trim();
+                }
+
+                if (hasBlock)
+                {
                     if (rules = $(this.block)) {
-                        return new(tree.Directive)(name + " " + types, rules);
+                        return new(tree.Directive)(name, rules);
                     }
-                } else if (name = $(/^@[-a-z]+/)) {
-                    if (name === '@font-face') {
-                        if (rules = $(this.block)) {
-                            return new(tree.Directive)(name, rules);
+                } else {
+                    if ((value = hasExpression ? $(this.expression) : $(this.entity)) && $(';')) {
+                        var directive = new(tree.Directive)(name, value);
+                        if (env.dumpLineNumbers) {
+                            directive.debugInfo = getDebugInfo(i, input, env);
                         }
-                    } else if ((value = $(this.entity)) && $(';')) {
-                        return new(tree.Directive)(name, value);
+                        return directive;
                     }
                 }
+                
+                restore();
             },
             font: function () {
                 var value = [], expression = [], weight, shorthand, font, e;
@@ -1038,7 +1401,7 @@ less.Parser = function Parser(env) {
             multiplication: function () {
                 var m, a, op, operation;
                 if (m = $(this.operand)) {
-                    while ((op = ($('/') || $('*'))) && (a = $(this.operand))) {
+                    while (!peek(/^\/[*\/]/) && (op = ($('/') || $('*'))) && (a = $(this.operand))) {
                         operation = new(tree.Operation)(op, [operation || m, a]);
                     }
                     return operation || m;
@@ -1047,13 +1410,42 @@ less.Parser = function Parser(env) {
             addition: function () {
                 var m, a, op, operation;
                 if (m = $(this.multiplication)) {
-                    while ((op = $(/^[-+]\s+/) || (input.charAt(i - 1) != ' ' && ($('+') || $('-')))) &&
+                    while ((op = $(/^[-+]\s+/) || (!isWhitespace(input.charAt(i - 1)) && ($('+') || $('-')))) &&
                            (a = $(this.multiplication))) {
                         operation = new(tree.Operation)(op, [operation || m, a]);
                     }
                     return operation || m;
                 }
             },
+            conditions: function () {
+                var a, b, index = i, condition;
+
+                if (a = $(this.condition)) {
+                    while ($(',') && (b = $(this.condition))) {
+                        condition = new(tree.Condition)('or', condition || a, b, index);
+                    }
+                    return condition || a;
+                }
+            },
+            condition: function () {
+                var a, b, c, op, index = i, negate = false;
+
+                if ($(/^not/)) { negate = true }
+                expect('(');
+                if (a = $(this.addition) || $(this.entities.keyword) || $(this.entities.quoted)) {
+                    if (op = $(/^(?:>=|=<|[<=>])/)) {
+                        if (b = $(this.addition) || $(this.entities.keyword) || $(this.entities.quoted)) {
+                            c = new(tree.Condition)(op, a, b, index, negate);
+                        } else {
+                            error('expected expression');
+                        }
+                    } else {
+                        c = new(tree.Condition)('=', a, new(tree.Keyword)('true'), index, negate);
+                    }
+                    expect(')');
+                    return $(/^and/) ? new(tree.Condition)('and', c, $(this.condition)) : c;
+                }
+            },
 
             //
             // An operand is anything that can be part of an operation,
@@ -1090,7 +1482,7 @@ less.Parser = function Parser(env) {
             property: function () {
                 var name;
 
-                if (name = $(/^(\*?-?[-a-z_0-9]+)\s*:/)) {
+                if (name = $(/^(\*?-?[_a-z0-9-]+)\s*:/)) {
                     return name[1];
                 }
             }
@@ -1103,13 +1495,28 @@ if (less.mode === 'browser' || less.mode === 'rhino') {
     // Used by `@import` directives
     //
     less.Parser.importer = function (path, paths, callback, env) {
-        if (path.charAt(0) !== '/' && paths.length > 0) {
+        if (!/^([a-z-]+:)?\//.test(path) && paths.length > 0) {
             path = paths[0] + path;
         }
         // We pass `true` as 3rd argument, to force the reload of the import.
         // This is so we can get the syntax tree as opposed to just the CSS output,
         // as we need this to evaluate the current stylesheet.
-        loadStyleSheet({ href: path, title: path, type: env.mime }, callback, true);
+        loadStyleSheet({ 
+            href: path, 
+            title: path, 
+            type: env.mime, 
+            contents: env.contents, 
+            files: env.files, 
+            rootpath: env.rootpath,
+            entryPath: env.entryPath,
+            relativeUrls: env.relativeUrls }, 
+        function (e, root, data, sheet, _, path) {
+            if (e && typeof(env.errback) === "function") {
+                env.errback.call(null, path, paths, callback, env);
+            } else {
+                callback.call(null, e, root, path);
+            }
+        }, true);
     };
 }
 
index ab1c886..57d60f5 100644 (file)
@@ -1,18 +1,27 @@
 var name;
 
 function loadStyleSheet(sheet, callback, reload, remaining) {
-    var sheetName = name.slice(0, name.lastIndexOf('/') + 1) + sheet.href;
-    var input = readFile(sheetName);
-    var parser = new less.Parser();
+    var endOfPath = Math.max(name.lastIndexOf('/'), name.lastIndexOf('\\')),
+        sheetName = name.slice(0, endOfPath + 1) + sheet.href,
+        contents = sheet.contents || {},
+        input = readFile(sheetName);
+        
+    contents[sheetName] = input;
+        
+    var parser = new less.Parser({
+        paths: [sheet.href.replace(/[\w\.-]+$/, '')],
+        contents: contents
+    });
     parser.parse(input, function (e, root) {
         if (e) {
-            print("Error: " + e);
-            quit(1);
+            return error(e, sheetName);
+        }
+        try {
+            callback(e, root, input, sheet, { local: false, lastModified: 0, remaining: remaining }, sheetName);
+        } catch(e) {
+            error(e, sheetName);
         }
-        callback(root, sheet, { local: false, lastModified: 0, remaining: remaining });
     });
-
-    // callback({}, sheet, { local: true, remaining: remaining });
 }
 
 function writeFile(filename, content) {
@@ -24,8 +33,26 @@ function writeFile(filename, content) {
 
 // Command line integration via Rhino
 (function (args) {
-    name = args[0];
-    var output = args[1];
+    var output,
+        compress = false,
+        i;
+        
+    for(i = 0; i < args.length; i++) {
+        switch(args[i]) {
+            case "-x":
+                compress = true;
+                break;
+            default:
+                if (!name) {
+                    name = args[i];
+                } else if (!output) {
+                    output = args[i];
+                } else {
+                    print("unrecognised parameters");
+                    print("input_file [output_file] [-x]");
+                }
+        }
+    }
 
     if (!name) {
         print('No files present in the fileset; Check your pattern match in build.xml');
@@ -41,20 +68,56 @@ function writeFile(filename, content) {
     }
 
     var result;
-    var parser = new less.Parser();
-    parser.parse(input, function (e, root) {
-        if (e) {
-            quit(1);
-        } else {
-            result = root.toCSS();
-            if (output) {
-                writeFile(output, result);
-                print("Written to " + output);
+    try {
+        var parser = new less.Parser();
+        parser.parse(input, function (e, root) {
+            if (e) {
+                error(e, name);
+                quit(1);
             } else {
-                print(result);
+                result = root.toCSS({compress: compress || false});
+                if (output) {
+                    writeFile(output, result);
+                    print("Written to " + output);
+                } else {
+                    print(result);
+                }
+                quit(0);
             }
-            quit(0);
-        }
-    });
+        });
+    }
+    catch(e) {
+        error(e, name);
+        quit(1);
+    }
     print("done");
 }(arguments));
+
+function error(e, filename) {
+
+    var content = "Error : " + filename + "\n";
+    
+    filename = e.filename || filename;
+    
+    if (e.message) {
+        content += e.message + "\n";
+    }
+
+    var errorline = function (e, i, classname) {
+        if (e.extract[i]) {
+            content += 
+                String(parseInt(e.line) + (i - 1)) + 
+                ":" + e.extract[i] + "\n";
+        }
+    };
+
+    if (e.stack) {
+        content += e.stack;
+    } else if (e.extract) {
+        content += 'on line ' + e.line + ', column ' + (e.column + 1) + ':\n';
+        errorline(e, 0);
+        errorline(e, 1);
+        errorline(e, 2);
+    }
+   print(content);
+}
\ No newline at end of file
index eb08aa4..134adbd 100644 (file)
@@ -1,13 +1,45 @@
-require('less/tree').find = function (obj, fun) {
+(function (tree) {
+
+tree.debugInfo = function(env, ctx) {
+    var result="";
+    if (env.dumpLineNumbers && !env.compress) {
+        switch(env.dumpLineNumbers) {
+            case 'comments':
+                result = tree.debugInfo.asComment(ctx);
+                break;
+            case 'mediaquery':
+                result = tree.debugInfo.asMediaQuery(ctx);
+                break;
+            case 'all':
+                result = tree.debugInfo.asComment(ctx)+tree.debugInfo.asMediaQuery(ctx);
+                break;
+        }
+    }
+    return result;
+};
+
+tree.debugInfo.asComment = function(ctx) {
+    return '/* line ' + ctx.debugInfo.lineNumber + ', ' + ctx.debugInfo.fileName + ' */\n';
+};
+
+tree.debugInfo.asMediaQuery = function(ctx) {
+    return '@media -sass-debug-info{filename{font-family:' +
+        ('file://' + ctx.debugInfo.fileName).replace(/[\/:.]/g, '\\$&') +
+        '}line{font-family:\\00003' + ctx.debugInfo.lineNumber + '}}\n';
+};
+
+tree.find = function (obj, fun) {
     for (var i = 0, r; i < obj.length; i++) {
         if (r = fun.call(obj, obj[i])) { return r }
     }
     return null;
 };
-require('less/tree').jsify = function (obj) {
+tree.jsify = function (obj) {
     if (Array.isArray(obj.value) && (obj.value.length > 1)) {
         return '[' + obj.value.map(function (v) { return v.toCSS(false) }).join(', ') + ']';
     } else {
         return obj.toCSS(false);
     }
 };
+
+})(require('./tree'));
index 551ccba..139ae92 100644 (file)
@@ -14,4 +14,4 @@ tree.Alpha.prototype = {
     }
 };
 
-})(require('less/tree'));
+})(require('../tree'));
index 89840d0..4461490 100644 (file)
@@ -7,7 +7,21 @@ tree.Anonymous.prototype = {
     toCSS: function () {
         return this.value;
     },
-    eval: function () { return this }
+    eval: function () { return this },
+    compare: function (x) {
+        if (!x.toCSS) {
+            return -1;
+        }
+        
+        var left = this.toCSS(),
+            right = x.toCSS();
+        
+        if (left === right) {
+            return 0;
+        }
+        
+        return left < right ? -1 : 1;
+    }
 };
 
-})(require('less/tree'));
+})(require('../tree'));
diff --git a/build-tools/lib/less/tree/assignment.js b/build-tools/lib/less/tree/assignment.js
new file mode 100644 (file)
index 0000000..a5559ad
--- /dev/null
@@ -0,0 +1,19 @@
+(function (tree) {
+
+tree.Assignment = function (key, val) {
+    this.key = key;
+    this.value = val;
+};
+tree.Assignment.prototype = {
+    toCSS: function () {
+        return this.key + '=' + (this.value.toCSS ? this.value.toCSS() : this.value);
+    },
+    eval: function (env) {
+        if (this.value.eval) {
+            return new(tree.Assignment)(this.key, this.value.eval(env));
+        }
+        return this;
+    }
+};
+
+})(require('../tree'));
\ No newline at end of file
index 4a72932..f8045ed 100644 (file)
@@ -3,17 +3,19 @@
 //
 // A function call node.
 //
-tree.Call = function (name, args, index) {
+tree.Call = function (name, args, index, filename) {
     this.name = name;
     this.args = args;
     this.index = index;
+    this.filename = filename;
 };
 tree.Call.prototype = {
     //
     // When evaluating a function call,
     // we either find the function in `tree.functions` [1],
     // in which case we call it, passing the  evaluated arguments,
-    // or we simply print it out as it appeared originally [2].
+    // if this returns null or we cannot find the function, we 
+    // simply print it out as it appeared originally [2].
     //
     // The *functions.js* file contains the built-in functions.
     //
@@ -22,19 +24,26 @@ tree.Call.prototype = {
     // The function should receive the value, not the variable.
     //
     eval: function (env) {
-        var args = this.args.map(function (a) { return a.eval(env) });
+        var args = this.args.map(function (a) { return a.eval(env) }),
+            result;
 
         if (this.name in tree.functions) { // 1.
             try {
-                return tree.functions[this.name].apply(tree.functions, args);
+                result = tree.functions[this.name].apply(tree.functions, args);
+                if (result != null) {
+                    return result;
+                }
             } catch (e) {
-                throw { message: "error evaluating function `" + this.name + "`",
-                        index: this.index };
+                throw { type: e.type || "Runtime",
+                        message: "error evaluating function `" + this.name + "`" +
+                                 (e.message ? ': ' + e.message : ''),
+                        index: this.index, filename: this.filename };
             }
-        } else { // 2.
-            return new(tree.Anonymous)(this.name +
-                   "(" + args.map(function (a) { return a.toCSS() }).join(', ') + ")");
         }
+        
+        // 2.
+        return new(tree.Anonymous)(this.name +
+            "(" + args.map(function (a) { return a.toCSS(env) }).join(', ') + ")");
     },
 
     toCSS: function (env) {
@@ -42,4 +51,4 @@ tree.Call.prototype = {
     }
 };
 
-})(require('less/tree'));
+})(require('../tree'));
index bb7646a..6adf317 100644 (file)
@@ -94,8 +94,18 @@ tree.Color.prototype = {
             i = (i > 255 ? 255 : (i < 0 ? 0 : i)).toString(16);
             return i.length === 1 ? '0' + i : i;
         }).join('');
+    },
+    compare: function (x) {
+        if (!x.rgb) {
+            return -1;
+        }
+        
+        return (x.rgb[0] === this.rgb[0] &&
+            x.rgb[1] === this.rgb[1] &&
+            x.rgb[2] === this.rgb[2] &&
+            x.alpha === this.alpha) ? 0 : -1;
     }
 };
 
 
-})(require('less/tree'));
+})(require('../tree'));
index 2d95dff..f4a3384 100644 (file)
@@ -11,4 +11,4 @@ tree.Comment.prototype = {
     eval: function () { return this }
 };
 
-})(require('less/tree'));
+})(require('../tree'));
diff --git a/build-tools/lib/less/tree/condition.js b/build-tools/lib/less/tree/condition.js
new file mode 100644 (file)
index 0000000..6b79dc9
--- /dev/null
@@ -0,0 +1,42 @@
+(function (tree) {
+
+tree.Condition = function (op, l, r, i, negate) {
+    this.op = op.trim();
+    this.lvalue = l;
+    this.rvalue = r;
+    this.index = i;
+    this.negate = negate;
+};
+tree.Condition.prototype.eval = function (env) {
+    var a = this.lvalue.eval(env),
+        b = this.rvalue.eval(env);
+
+    var i = this.index, result;
+
+    var result = (function (op) {
+        switch (op) {
+            case 'and':
+                return a && b;
+            case 'or':
+                return a || b;
+            default:
+                if (a.compare) {
+                    result = a.compare(b);
+                } else if (b.compare) {
+                    result = b.compare(a);
+                } else {
+                    throw { type: "Type",
+                            message: "Unable to perform comparison",
+                            index: i };
+                }
+                switch (result) {
+                    case -1: return op === '<' || op === '=<';
+                    case  0: return op === '=' || op === '>=' || op === '=<';
+                    case  1: return op === '>' || op === '>=';
+                }
+        }
+    })(this.op);
+    return this.negate ? !result : result;
+};
+
+})(require('../tree'));
index 41f3ca2..22241b8 100644 (file)
@@ -28,7 +28,24 @@ tree.Dimension.prototype = {
         return new(tree.Dimension)
                   (tree.operate(op, this.value, other.value),
                   this.unit || other.unit);
+    },
+
+    compare: function (other) {
+        if (other instanceof tree.Dimension) {
+            if (other.value > this.value) {
+                return -1;
+            } else if (other.value < this.value) {
+                return 1;
+            } else {
+                if (other.unit && this.unit !== other.unit) {
+                    return -1;
+                }
+                return 0;
+            }
+        } else {
+            return -1;
+        }
     }
 };
 
-})(require('less/tree'));
+})(require('../tree'));
index fbe9a93..4d682e6 100644 (file)
@@ -2,8 +2,10 @@
 
 tree.Directive = function (name, value) {
     this.name = name;
+
     if (Array.isArray(value)) {
         this.ruleset = new(tree.Ruleset)([], value);
+        this.ruleset.allowImports = true;
     } else {
         this.value = value;
     }
@@ -20,14 +22,18 @@ tree.Directive.prototype = {
         }
     },
     eval: function (env) {
-        env.frames.unshift(this);
-        this.ruleset = this.ruleset && this.ruleset.eval(env);
-        env.frames.shift();
-        return this;
+        var evaldDirective = this;
+        if (this.ruleset) {
+            env.frames.unshift(this);
+            evaldDirective = new(tree.Directive)(this.name);
+            evaldDirective.ruleset = this.ruleset.eval(env);
+            env.frames.shift();
+        }
+        return evaldDirective;
     },
     variable: function (name) { return tree.Ruleset.prototype.variable.call(this.ruleset, name) },
     find: function () { return tree.Ruleset.prototype.find.apply(this.ruleset, arguments) },
     rulesets: function () { return tree.Ruleset.prototype.rulesets.apply(this.ruleset) }
 };
 
-})(require('less/tree'));
+})(require('../tree'));
index 27cf822..4e251ee 100644 (file)
@@ -1,19 +1,35 @@
 (function (tree) {
 
-tree.Element = function (combinator, value) {
+tree.Element = function (combinator, value, index) {
     this.combinator = combinator instanceof tree.Combinator ?
                       combinator : new(tree.Combinator)(combinator);
-    this.value = value ? value.trim() : "";
+
+    if (typeof(value) === 'string') {
+        this.value = value.trim();
+    } else if (value) {
+        this.value = value;
+    } else {
+        this.value = "";
+    }
+    this.index = index;
+};
+tree.Element.prototype.eval = function (env) {
+    return new(tree.Element)(this.combinator,
+                             this.value.eval ? this.value.eval(env) : this.value,
+                             this.index);
 };
 tree.Element.prototype.toCSS = function (env) {
-    return this.combinator.toCSS(env || {}) + this.value;
+       var value = (this.value.toCSS ? this.value.toCSS(env) : this.value);
+       if (value == '' && this.combinator.value.charAt(0) == '&') {
+               return '';
+       } else {
+               return this.combinator.toCSS(env || {}) + value;
+       }
 };
 
 tree.Combinator = function (value) {
     if (value === ' ') {
         this.value = ' ';
-    } else if (value === '& ') {
-        this.value = '& ';
     } else {
         this.value = value ? value.trim() : "";
     }
@@ -22,14 +38,12 @@ tree.Combinator.prototype.toCSS = function (env) {
     return {
         ''  : '',
         ' ' : ' ',
-        '&' : '',
-        '& ' : ' ',
         ':' : ' :',
-        '::': '::',
         '+' : env.compress ? '+' : ' + ',
         '~' : env.compress ? '~' : ' ~ ',
-        '>' : env.compress ? '>' : ' > '
+        '>' : env.compress ? '>' : ' > ',
+        '|' : env.compress ? '|' : ' | '
     }[this.value];
 };
 
-})(require('less/tree'));
+})(require('../tree'));
index f638a1b..fbfa9c5 100644 (file)
@@ -15,9 +15,9 @@ tree.Expression.prototype = {
     },
     toCSS: function (env) {
         return this.value.map(function (e) {
-            return e.toCSS(env);
+            return e.toCSS ? e.toCSS(env) : '';
         }).join(' ');
     }
 };
 
-})(require('less/tree'));
+})(require('../tree'));
index 427c109..02594a7 100644 (file)
 // `import,push`, we also pass it a callback, which it'll call once
 // the file has been fetched, and parsed.
 //
-tree.Import = function (path, imports) {
+tree.Import = function (path, imports, features, once, index, rootpath) {
     var that = this;
 
+    this.once = once;
+    this.index = index;
     this._path = path;
-
+    this.features = features && new(tree.Value)(features);
+    this.rootpath = rootpath;
+               
     // The '.less' extension is optional
     if (path instanceof tree.Quoted) {
-        this.path = /\.(le?|c)ss(\?.*)?$/.test(path.value) ? path.value : path.value + '.less';
+        this.path = /(\.[a-z]*$)|([\?;].*)$/.test(path.value) ? path.value : path.value + '.less';
     } else {
         this.path = path.value.value || path.value;
     }
 
-    this.css = /css(\?.*)?$/.test(this.path);
+    this.css = /css([\?;].*)?$/.test(this.path);
 
     // Only pre-compile .less files
     if (! this.css) {
-        imports.push(this.path, function (root) {
-            if (! root) {
-                throw new(Error)("Error parsing " + that.path);
-            }
-            that.root = root;
+        imports.push(this.path, function (e, root, imported) {
+            if (e) { e.index = index }
+            if (imported && that.once) that.skip = imported;
+            that.root = root || new(tree.Ruleset)([], []);
         });
     }
 };
@@ -46,32 +49,34 @@ tree.Import = function (path, imports) {
 // ruleset.
 //
 tree.Import.prototype = {
-    toCSS: function () {
+    toCSS: function (env) {
+        var features = this.features ? ' ' + this.features.toCSS(env) : '';
+
         if (this.css) {
-            return "@import " + this._path.toCSS() + ';\n';
+            // Add the base path if the import is relative
+            if (typeof this._path.value === "string" && !/^(?:[a-z-]+:|\/)/.test(this._path.value)) {
+                this._path.value = this.rootpath + this._path.value;
+            }
+            return "@import " + this._path.toCSS() + features + ';\n';
         } else {
             return "";
         }
     },
     eval: function (env) {
-        var ruleset;
+        var ruleset, features = this.features && this.features.eval(env);
+
+        if (this.skip) return [];
 
         if (this.css) {
             return this;
         } else {
-            ruleset = new(tree.Ruleset)(null, this.root.rules.slice(0));
+            ruleset = new(tree.Ruleset)([], this.root.rules.slice(0));
 
-            for (var i = 0; i < ruleset.rules.length; i++) {
-                if (ruleset.rules[i] instanceof tree.Import) {
-                    Array.prototype
-                         .splice
-                         .apply(ruleset.rules,
-                                [i, 1].concat(ruleset.rules[i].eval(env)));
-                }
-            }
-            return ruleset.rules;
+            ruleset.evalImports(env);
+
+            return this.features ? new(tree.Media)(ruleset.rules, this.features.value) : ruleset.rules;
         }
     }
 };
 
-})(require('less/tree'));
+})(require('../tree'));
index 4ec66b9..772a31d 100644 (file)
@@ -47,5 +47,5 @@ tree.JavaScript.prototype = {
     }
 };
 
-})(require('less/tree'));
+})(require('../tree'));
 
index a4431ba..701b79e 100644 (file)
@@ -3,7 +3,17 @@
 tree.Keyword = function (value) { this.value = value };
 tree.Keyword.prototype = {
     eval: function () { return this },
-    toCSS: function () { return this.value }
+    toCSS: function () { return this.value },
+    compare: function (other) {
+        if (other instanceof tree.Keyword) {
+            return other.value === this.value ? 0 : 1;
+        } else {
+            return -1;
+        }
+    }
 };
 
-})(require('less/tree'));
+tree.True = new(tree.Keyword)('true');
+tree.False = new(tree.Keyword)('false');
+
+})(require('../tree'));
diff --git a/build-tools/lib/less/tree/media.js b/build-tools/lib/less/tree/media.js
new file mode 100644 (file)
index 0000000..d2a5347
--- /dev/null
@@ -0,0 +1,121 @@
+(function (tree) {
+
+tree.Media = function (value, features) {
+    var selectors = this.emptySelectors();
+
+    this.features = new(tree.Value)(features);
+    this.ruleset = new(tree.Ruleset)(selectors, value);
+    this.ruleset.allowImports = true;
+};
+tree.Media.prototype = {
+    toCSS: function (ctx, env) {
+        var features = this.features.toCSS(env);
+
+        this.ruleset.root = (ctx.length === 0 || ctx[0].multiMedia);
+        return '@media ' + features + (env.compress ? '{' : ' {\n  ') +
+               this.ruleset.toCSS(ctx, env).trim().replace(/\n/g, '\n  ') +
+                           (env.compress ? '}': '\n}\n');
+    },
+    eval: function (env) {
+        if (!env.mediaBlocks) {
+            env.mediaBlocks = [];
+            env.mediaPath = [];
+        }
+        
+        var media = new(tree.Media)([], []);
+        if(this.debugInfo) {
+            this.ruleset.debugInfo = this.debugInfo;
+            media.debugInfo = this.debugInfo;
+        }
+        media.features = this.features.eval(env);
+        
+        env.mediaPath.push(media);
+        env.mediaBlocks.push(media);
+        
+        env.frames.unshift(this.ruleset);
+        media.ruleset = this.ruleset.eval(env);
+        env.frames.shift();
+        
+        env.mediaPath.pop();
+
+        return env.mediaPath.length === 0 ? media.evalTop(env) :
+                    media.evalNested(env)
+    },
+    variable: function (name) { return tree.Ruleset.prototype.variable.call(this.ruleset, name) },
+    find: function () { return tree.Ruleset.prototype.find.apply(this.ruleset, arguments) },
+    rulesets: function () { return tree.Ruleset.prototype.rulesets.apply(this.ruleset) },
+    emptySelectors: function() { 
+        var el = new(tree.Element)('', '&', 0);
+        return [new(tree.Selector)([el])];
+    },
+
+    evalTop: function (env) {
+        var result = this;
+
+        // Render all dependent Media blocks.
+        if (env.mediaBlocks.length > 1) {
+            var selectors = this.emptySelectors();
+            result = new(tree.Ruleset)(selectors, env.mediaBlocks);
+            result.multiMedia = true;
+        }
+
+        delete env.mediaBlocks;
+        delete env.mediaPath;
+
+        return result;
+    },
+    evalNested: function (env) {
+        var i, value,
+            path = env.mediaPath.concat([this]);
+
+        // Extract the media-query conditions separated with `,` (OR).
+        for (i = 0; i < path.length; i++) {
+            value = path[i].features instanceof tree.Value ?
+                        path[i].features.value : path[i].features;
+            path[i] = Array.isArray(value) ? value : [value];
+        }
+
+        // Trace all permutations to generate the resulting media-query.
+        //
+        // (a, b and c) with nested (d, e) ->
+        //    a and d
+        //    a and e
+        //    b and c and d
+        //    b and c and e
+        this.features = new(tree.Value)(this.permute(path).map(function (path) {
+            path = path.map(function (fragment) {
+                return fragment.toCSS ? fragment : new(tree.Anonymous)(fragment);
+            });
+
+            for(i = path.length - 1; i > 0; i--) {
+                path.splice(i, 0, new(tree.Anonymous)("and"));
+            }
+
+            return new(tree.Expression)(path);
+        }));
+
+        // Fake a tree-node that doesn't output anything.
+        return new(tree.Ruleset)([], []);
+    },
+    permute: function (arr) {
+      if (arr.length === 0) {
+          return [];
+      } else if (arr.length === 1) {
+          return arr[0];
+      } else {
+          var result = [];
+          var rest = this.permute(arr.slice(1));
+          for (var i = 0; i < rest.length; i++) {
+              for (var j = 0; j < arr[0].length; j++) {
+                  result.push([arr[0][j]].concat(rest[i]));
+              }
+          }
+          return result;
+      }
+    },
+    bubbleSelectors: function (selectors) {
+      this.ruleset = new(tree.Ruleset)(selectors.slice(0), [this.ruleset]);
+    }
+};
+
+})(require('../tree'));
index 24cb8e4..0533036 100644 (file)
@@ -1,50 +1,84 @@
 (function (tree) {
 
 tree.mixin = {};
-tree.mixin.Call = function (elements, args, index) {
+tree.mixin.Call = function (elements, args, index, filename, important) {
     this.selector = new(tree.Selector)(elements);
     this.arguments = args;
     this.index = index;
+    this.filename = filename;
+    this.important = important;
 };
 tree.mixin.Call.prototype = {
     eval: function (env) {
-        var mixins, args, rules = [], match = false;
+        var mixins, mixin, args, rules = [], match = false, i, m, f, isRecursive, isOneFound;
 
-        for (var i = 0; i < env.frames.length; i++) {
+        args = this.arguments && this.arguments.map(function (a) {
+            return { name: a.name, value: a.value.eval(env) };
+        });
+
+        for (i = 0; i < env.frames.length; i++) {
             if ((mixins = env.frames[i].find(this.selector)).length > 0) {
-                args = this.arguments && this.arguments.map(function (a) { return a.eval(env) });
-                for (var m = 0; m < mixins.length; m++) {
-                    if (mixins[m].match(args, env)) {
-                        try {
-                            Array.prototype.push.apply(
-                                  rules, mixins[m].eval(env, this.arguments).rules);
-                            match = true;
-                        } catch (e) {
-                            throw { message: e.message, index: e.index, stack: e.stack, call: this.index };
+                isOneFound = true;
+                for (m = 0; m < mixins.length; m++) {
+                    mixin = mixins[m];
+                    isRecursive = false;
+                    for(f = 0; f < env.frames.length; f++) {
+                        if ((!(mixin instanceof tree.mixin.Definition)) && mixin === (env.frames[f].originalRuleset || env.frames[f])) {
+                            isRecursive = true;
+                            break;
                         }
                     }
+                    if (isRecursive) {
+                        continue;
+                    }
+                    if (mixin.matchArgs(args, env)) {
+                        if (!mixin.matchCondition || mixin.matchCondition(args, env)) {
+                            try {
+                                Array.prototype.push.apply(
+                                      rules, mixin.eval(env, args, this.important).rules);
+                            } catch (e) {
+                                throw { message: e.message, index: this.index, filename: this.filename, stack: e.stack };
+                            }
+                        }
+                        match = true;
+                    }
                 }
                 if (match) {
                     return rules;
-                } else {
-                    throw { message: 'No matching definition was found for `' +
-                                      this.selector.toCSS().trim() + '('      +
-                                      this.arguments.map(function (a) {
-                                          return a.toCSS();
-                                      }).join(', ') + ")`",
-                            index:   this.index };
                 }
             }
         }
-        throw { message: this.selector.toCSS().trim() + " is undefined",
-                index: this.index };
+        if (isOneFound) {
+            throw { type:    'Runtime',
+                    message: 'No matching definition was found for `' +
+                              this.selector.toCSS().trim() + '('      +
+                              (args ? args.map(function (a) {
+                                  var argValue = "";
+                                  if (a.name) {
+                                      argValue += a.name + ":";
+                                  }
+                                  if (a.value.toCSS) {
+                                      argValue += a.value.toCSS();
+                                  } else {
+                                      argValue += "???";
+                                  }
+                                  return argValue;
+                              }).join(', ') : "") + ")`",
+                    index:   this.index, filename: this.filename };
+        } else {
+            throw { type: 'Name',
+                message: this.selector.toCSS().trim() + " is undefined",
+                index: this.index, filename: this.filename };
+        }
     }
 };
 
-tree.mixin.Definition = function (name, params, rules) {
+tree.mixin.Definition = function (name, params, rules, condition, variadic) {
     this.name = name;
     this.selectors = [new(tree.Selector)([new(tree.Element)(null, name)])];
     this.params = params;
+    this.condition = condition;
+    this.variadic = variadic;
     this.arity = params.length;
     this.rules = rules;
     this._lookups = {};
@@ -62,39 +96,111 @@ tree.mixin.Definition.prototype = {
     find:      function ()     { return this.parent.find.apply(this, arguments) },
     rulesets:  function ()     { return this.parent.rulesets.apply(this) },
 
-    eval: function (env, args) {
-        var frame = new(tree.Ruleset)(null, []), context, _arguments = [];
+    evalParams: function (env, mixinEnv, args, evaldArguments) {
+        var frame = new(tree.Ruleset)(null, []), varargs, arg, params = this.params.slice(0), i, j, val, name, isNamedFound, argIndex;
+        
+        if (args) {
+            args = args.slice(0);
+
+            for(i = 0; i < args.length; i++) {
+                arg = args[i];
+                if (name = (arg && arg.name)) {
+                    isNamedFound = false;
+                    for(j = 0; j < params.length; j++) {
+                        if (!evaldArguments[j] && name === params[j].name) {
+                            evaldArguments[j] = arg.value.eval(env);
+                            frame.rules.unshift(new(tree.Rule)(name, arg.value.eval(env)));
+                            isNamedFound = true;
+                            break;
+                        }
+                    }
+                    if (isNamedFound) {
+                        args.splice(i, 1);
+                        i--;
+                        continue;
+                    } else {
+                        throw { type: 'Runtime', message: "Named argument for " + this.name +
+                            ' ' + args[i].name + ' not found' };
+                    }
+                }
+            }
+        }
+        argIndex = 0;
+        for (i = 0; i < params.length; i++) {
+            if (evaldArguments[i]) continue;
+            
+            arg = args && args[argIndex];
 
-        for (var i = 0, val; i < this.params.length; i++) {
-            if (this.params[i].name) {
-                if (val = (args && args[i]) || this.params[i].value) {
-                    frame.rules.unshift(new(tree.Rule)(this.params[i].name, val.eval(env)));
+            if (name = params[i].name) {
+                if (params[i].variadic && args) {
+                    varargs = [];
+                    for (j = argIndex; j < args.length; j++) {
+                        varargs.push(args[j].value.eval(env));
+                    }
+                    frame.rules.unshift(new(tree.Rule)(name, new(tree.Expression)(varargs).eval(env)));
                 } else {
-                    throw { message: "wrong number of arguments for " + this.name +
+                    val = arg && arg.value;
+                    if (val) {
+                        val = val.eval(env);
+                    } else if (params[i].value) {
+                        val = params[i].value.eval(mixinEnv);
+                    } else {
+                        throw { type: 'Runtime', message: "wrong number of arguments for " + this.name +
                             ' (' + args.length + ' for ' + this.arity + ')' };
+                    }
+                    
+                    frame.rules.unshift(new(tree.Rule)(name, val));
+                    evaldArguments[i] = val;
                 }
             }
+            
+            if (params[i].variadic && args) {
+                for (j = argIndex; j < args.length; j++) {
+                    evaldArguments[j] = args[j].value.eval(env);
+                }
+            }
+            argIndex++;
         }
-        for (var i = 0; i < Math.max(this.params.length, args && args.length); i++) {
-            _arguments.push(args[i] || this.params[i].value);
-        }
+
+        return frame;
+    },
+    eval: function (env, args, important) {
+        var _arguments = [],
+            mixinFrames = this.frames.concat(env.frames),
+            frame = this.evalParams(env, {frames: mixinFrames}, args, _arguments), 
+            context, rules, start, ruleset;
+
         frame.rules.unshift(new(tree.Rule)('@arguments', new(tree.Expression)(_arguments).eval(env)));
 
-        return new(tree.Ruleset)(null, this.rules.slice(0)).eval({
-            frames: [this, frame].concat(this.frames, env.frames)
+        rules = important ?
+            this.parent.makeImportant.apply(this).rules : this.rules.slice(0);
+
+        ruleset = new(tree.Ruleset)(null, rules).eval({
+            frames: [this, frame].concat(mixinFrames)
         });
+        ruleset.originalRuleset = this;
+        return ruleset;
     },
-    match: function (args, env) {
-        var argsLength = (args && args.length) || 0, len;
+    matchCondition: function (args, env) {
+        if (this.condition && !this.condition.eval({
+            frames: [this.evalParams(env, {frames: this.frames.concat(env.frames)}, args, [])].concat(env.frames)
+        }))                                                           { return false }
+        return true;
+    },
+    matchArgs: function (args, env) {
+        var argsLength = (args && args.length) || 0, len, frame;
 
-        if (argsLength < this.required)                               { return false }
-        if ((this.required > 0) && (argsLength > this.params.length)) { return false }
+        if (! this.variadic) {
+            if (argsLength < this.required)                               { return false }
+            if (argsLength > this.params.length)                          { return false }
+            if ((this.required > 0) && (argsLength > this.params.length)) { return false }
+        }
 
         len = Math.min(argsLength, this.arity);
 
         for (var i = 0; i < len; i++) {
-            if (!this.params[i].name) {
-                if (args[i].eval(env).toCSS() != this.params[i].value.eval(env).toCSS()) {
+            if (!this.params[i].name && !this.params[i].variadic) {
+                if (args[i].value.eval(env).toCSS() != this.params[i].value.eval(env).toCSS()) {
                     return false;
                 }
             }
@@ -103,4 +209,4 @@ tree.mixin.Definition.prototype = {
     }
 };
 
-})(require('less/tree'));
+})(require('../tree'));
index d2e4d57..3c4f093 100644 (file)
@@ -17,6 +17,11 @@ tree.Operation.prototype.eval = function (env) {
                     message: "Can't substract or divide a color from a number" };
         }
     }
+    if (!a.operate) {
+        throw { name: "OperationError",
+                message: "Operation on an invalid type" };
+    }
+
     return a.operate(this.op, b);
 };
 
@@ -29,4 +34,4 @@ tree.operate = function (op, a, b) {
     }
 };
 
-})(require('less/tree'));
+})(require('../tree'));
diff --git a/build-tools/lib/less/tree/paren.js b/build-tools/lib/less/tree/paren.js
new file mode 100644 (file)
index 0000000..384a43c
--- /dev/null
@@ -0,0 +1,16 @@
+
+(function (tree) {
+
+tree.Paren = function (node) {
+    this.value = node;
+};
+tree.Paren.prototype = {
+    toCSS: function (env) {
+        return '(' + this.value.toCSS(env) + ')';
+    },
+    eval: function (env) {
+        return new(tree.Paren)(this.value.eval(env));
+    }
+};
+
+})(require('../tree'));
index 6ddfa40..4ec6713 100644 (file)
@@ -20,10 +20,24 @@ tree.Quoted.prototype = {
             return new(tree.JavaScript)(exp, that.index, true).eval(env).value;
         }).replace(/@\{([\w-]+)\}/g, function (_, name) {
             var v = new(tree.Variable)('@' + name, that.index).eval(env);
-            return v.value || v.toCSS();
+            return (v instanceof tree.Quoted) ? v.value : v.toCSS();
         });
         return new(tree.Quoted)(this.quote + value + this.quote, value, this.escaped, this.index);
+    },
+    compare: function (x) {
+        if (!x.toCSS) {
+            return -1;
+        }
+        
+        var left = this.toCSS(),
+            right = x.toCSS();
+        
+        if (left === right) {
+            return 0;
+        }
+        
+        return left < right ? -1 : 1;
     }
 };
 
-})(require('less/tree'));
+})(require('../tree'));
diff --git a/build-tools/lib/less/tree/ratio.js b/build-tools/lib/less/tree/ratio.js
new file mode 100644 (file)
index 0000000..f7622fb
--- /dev/null
@@ -0,0 +1,13 @@
+(function (tree) {
+
+tree.Ratio = function (value) {
+    this.value = value;
+};
+tree.Ratio.prototype = {
+    toCSS: function (env) {
+        return this.value;
+    },
+    eval: function () { return this }
+};
+
+})(require('../tree'));
index 18cc49b..8990fef 100644 (file)
@@ -1,10 +1,11 @@
 (function (tree) {
 
-tree.Rule = function (name, value, important, index) {
+tree.Rule = function (name, value, important, index, inline) {
     this.name = name;
     this.value = (value instanceof tree.Value) ? value : new(tree.Value)([value]);
     this.important = important ? ' ' + important.trim() : '';
     this.index = index;
+    this.inline = inline || false;
 
     if (name.charAt(0) === '@') {
         this.variable = true;
@@ -15,12 +16,22 @@ tree.Rule.prototype.toCSS = function (env) {
     else {
         return this.name + (env.compress ? ':' : ': ') +
                this.value.toCSS(env) +
-               this.important + ";";
+               this.important + (this.inline ? "" : ";");
     }
 };
 
 tree.Rule.prototype.eval = function (context) {
-    return new(tree.Rule)(this.name, this.value.eval(context), this.important, this.index);
+    return new(tree.Rule)(this.name,
+                          this.value.eval(context),
+                          this.important,
+                          this.index, this.inline);
+};
+
+tree.Rule.prototype.makeImportant = function () {
+    return new(tree.Rule)(this.name,
+                          this.value,
+                          "!important",
+                          this.index, this.inline);
 };
 
 tree.Shorthand = function (a, b) {
@@ -35,4 +46,4 @@ tree.Shorthand.prototype = {
     eval: function () { return this }
 };
 
-})(require('less/tree'));
+})(require('../tree'));
index cc9a60a..a198617 100644 (file)
@@ -1,27 +1,31 @@
 (function (tree) {
 
-tree.Ruleset = function (selectors, rules) {
+tree.Ruleset = function (selectors, rules, strictImports) {
     this.selectors = selectors;
     this.rules = rules;
     this._lookups = {};
+    this.strictImports = strictImports;
 };
 tree.Ruleset.prototype = {
     eval: function (env) {
-        var ruleset = new(tree.Ruleset)(this.selectors, this.rules.slice(0));
-
+        var selectors = this.selectors && this.selectors.map(function (s) { return s.eval(env) });
+        var ruleset = new(tree.Ruleset)(selectors, this.rules.slice(0), this.strictImports);
+        var rules;
+        
+        ruleset.originalRuleset = this;
         ruleset.root = this.root;
+        ruleset.allowImports = this.allowImports;
+
+        if(this.debugInfo) {
+            ruleset.debugInfo = this.debugInfo;
+        }
 
         // push the current ruleset to the frames stack
         env.frames.unshift(ruleset);
 
         // Evaluate imports
-        if (ruleset.root) {
-            for (var i = 0; i < ruleset.rules.length; i++) {
-                if (ruleset.rules[i] instanceof tree.Import) {
-                    Array.prototype.splice
-                         .apply(ruleset.rules, [i, 1].concat(ruleset.rules[i].eval(env)));
-                }
-            }
+        if (ruleset.root || ruleset.allowImports || !ruleset.strictImports) {
+            ruleset.evalImports(env);
         }
 
         // Store the frames around mixin definitions,
@@ -31,12 +35,16 @@ tree.Ruleset.prototype = {
                 ruleset.rules[i].frames = env.frames.slice(0);
             }
         }
+        
+        var mediaBlockCount = (env.mediaBlocks && env.mediaBlocks.length) || 0;
 
         // Evaluate mixin calls.
         for (var i = 0; i < ruleset.rules.length; i++) {
             if (ruleset.rules[i] instanceof tree.mixin.Call) {
-                Array.prototype.splice
-                     .apply(ruleset.rules, [i, 1].concat(ruleset.rules[i].eval(env)));
+                rules = ruleset.rules[i].eval(env);
+                ruleset.rules.splice.apply(ruleset.rules, [i, 1].concat(rules));
+                i += rules.length-1;
+                ruleset.resetCache();
             }
         }
 
@@ -51,12 +59,47 @@ tree.Ruleset.prototype = {
 
         // Pop the stack
         env.frames.shift();
+        
+        if (env.mediaBlocks) {
+            for(var i = mediaBlockCount; i < env.mediaBlocks.length; i++) {
+                env.mediaBlocks[i].bubbleSelectors(selectors);
+            }
+        }
 
         return ruleset;
     },
-    match: function (args) {
+    evalImports: function(env) {
+        var i, rules;
+        for (i = 0; i < this.rules.length; i++) {
+            if (this.rules[i] instanceof tree.Import) {
+                rules = this.rules[i].eval(env);
+                if (typeof rules.length === "number") {
+                    this.rules.splice.apply(this.rules, [i, 1].concat(rules));
+                    i+= rules.length-1;
+                } else {
+                    this.rules.splice(i, 1, rules);
+                }
+                this.resetCache();
+            }
+        }
+    },
+    makeImportant: function() {
+        return new tree.Ruleset(this.selectors, this.rules.map(function (r) {
+                    if (r.makeImportant) {
+                        return r.makeImportant();
+                    } else {
+                        return r;
+                    }
+                }), this.strictImports);
+    },
+    matchArgs: function (args) {
         return !args || args.length === 0;
     },
+    resetCache: function () {
+        this._rulesets = null;
+        this._variables = null;
+        this._lookups = {};
+    },
     variables: function () {
         if (this._variables) { return this._variables }
         else {
@@ -111,25 +154,41 @@ tree.Ruleset.prototype = {
     toCSS: function (context, env) {
         var css = [],      // The CSS output
             rules = [],    // node.Rule instances
+           _rules = [],    //
             rulesets = [], // node.Ruleset instances
             paths = [],    // Current selectors
             selector,      // The fully rendered selector
+            debugInfo,     // Line number debugging
             rule;
 
         if (! this.root) {
-            if (context.length === 0) {
-                paths = this.selectors.map(function (s) { return [s] });
-            } else {
-                this.joinSelectors( paths, context, this.selectors );
-            }
+            this.joinSelectors(paths, context, this.selectors);
         }
 
         // Compile rules and rulesets
         for (var i = 0; i < this.rules.length; i++) {
             rule = this.rules[i];
 
-            if (rule.rules || (rule instanceof tree.Directive)) {
+            if (rule.rules || (rule instanceof tree.Media)) {
                 rulesets.push(rule.toCSS(paths, env));
+            } else if (rule instanceof tree.Directive) {
+                var cssValue = rule.toCSS(paths, env);
+                // Output only the first @charset definition as such - convert the others
+                // to comments in case debug is enabled
+                if (rule.name === "@charset") {
+                    // Only output the debug info together with subsequent @charset definitions
+                    // a comment (or @media statement) before the actual @charset directive would
+                    // be considered illegal css as it has to be on the first line
+                    if (env.charset) {
+                        if (rule.debugInfo) {
+                            rulesets.push(tree.debugInfo(env, rule));
+                            rulesets.push(new tree.Comment("/* "+cssValue.replace(/\n/g, "")+" */\n").toCSS(env));
+                        }
+                        continue;
+                    }
+                    env.charset = true;
+                }
+                rulesets.push(cssValue);
             } else if (rule instanceof tree.Comment) {
                 if (!rule.silent) {
                     if (this.root) {
@@ -156,12 +215,22 @@ tree.Ruleset.prototype = {
             css.push(rules.join(env.compress ? '' : '\n'));
         } else {
             if (rules.length > 0) {
+                debugInfo = tree.debugInfo(env, this);
                 selector = paths.map(function (p) {
                     return p.map(function (s) {
                         return s.toCSS(env);
                     }).join('').trim();
-                }).join(env.compress ? ',' : (paths.length > 3 ? ',\n' : ', '));
-                css.push(selector,
+                }).join(env.compress ? ',' : ',\n');
+
+                // Remove duplicates
+                for (var i = rules.length - 1; i >= 0; i--) {
+                    if (_rules.indexOf(rules[i]) === -1) {
+                        _rules.unshift(rules[i]);
+                    }
+                }
+                rules = _rules;
+
+                css.push(debugInfo + selector + 
                         (env.compress ? '{' : ' {\n  ') +
                         rules.join(env.compress ? '' : '\n  ') +
                         (env.compress ? '}' : '\n}\n'));
@@ -169,7 +238,7 @@ tree.Ruleset.prototype = {
         }
         css.push(rulesets);
 
-        return css.join('') + (env.compress ? '\n' : '');
+        return css.join('')  + (env.compress ? '\n' : '');
     },
 
     joinSelectors: function (paths, context, selectors) {
@@ -179,34 +248,167 @@ tree.Ruleset.prototype = {
     },
 
     joinSelector: function (paths, context, selector) {
-        var before = [], after = [], beforeElements = [],
-            afterElements = [], hasParentSelector = false, el;
 
-        for (var i = 0; i < selector.elements.length; i++) {
+        var i, j, k, 
+            hasParentSelector, newSelectors, el, sel, parentSel, 
+            newSelectorPath, afterParentJoin, newJoinedSelector, 
+            newJoinedSelectorEmpty, lastSelector, currentElements,
+            selectorsMultiplied;
+    
+        for (i = 0; i < selector.elements.length; i++) {
             el = selector.elements[i];
-            if (el.combinator.value[0] === '&') {
+            if (el.value === '&') {
                 hasParentSelector = true;
             }
-            if (hasParentSelector) afterElements.push(el);
-            else                   beforeElements.push(el);
+        }
+    
+        if (!hasParentSelector) {
+            if (context.length > 0) {
+                for(i = 0; i < context.length; i++) {
+                    paths.push(context[i].concat(selector));
+                }
+            }
+            else {
+                paths.push([selector]);
+            }
+            return;
         }
 
-        if (! hasParentSelector) {
-            afterElements = beforeElements;
-            beforeElements = [];
+        // The paths are [[Selector]]
+        // The first list is a list of comma seperated selectors
+        // The inner list is a list of inheritance seperated selectors
+        // e.g.
+        // .a, .b {
+        //   .c {
+        //   }
+        // }
+        // == [[.a] [.c]] [[.b] [.c]]
+        //
+
+        // the elements from the current selector so far
+        currentElements = [];
+        // the current list of new selectors to add to the path.
+        // We will build it up. We initiate it with one empty selector as we "multiply" the new selectors
+        // by the parents
+        newSelectors = [[]];
+
+        for (i = 0; i < selector.elements.length; i++) {
+            el = selector.elements[i];
+            // non parent reference elements just get added
+            if (el.value !== "&") {
+                currentElements.push(el);
+            } else {
+                // the new list of selectors to add
+                selectorsMultiplied = [];
+
+                // merge the current list of non parent selector elements
+                // on to the current list of selectors to add
+                if (currentElements.length > 0) {
+                    this.mergeElementsOnToSelectors(currentElements, newSelectors);
+                }
+
+                // loop through our current selectors
+                for(j = 0; j < newSelectors.length; j++) {
+                    sel = newSelectors[j];
+                    // if we don't have any parent paths, the & might be in a mixin so that it can be used
+                    // whether there are parents or not
+                    if (context.length == 0) {
+                        // the combinator used on el should now be applied to the next element instead so that
+                        // it is not lost
+                        if (sel.length > 0) {
+                            sel[0].elements = sel[0].elements.slice(0);
+                            sel[0].elements.push(new(tree.Element)(el.combinator, '', 0)); //new Element(el.Combinator,  ""));
+                        }
+                        selectorsMultiplied.push(sel);
+                    }
+                    else {
+                        // and the parent selectors
+                        for(k = 0; k < context.length; k++) {
+                            parentSel = context[k];
+                            // We need to put the current selectors
+                            // then join the last selector's elements on to the parents selectors
+
+                            // our new selector path
+                            newSelectorPath = [];
+                            // selectors from the parent after the join
+                            afterParentJoin = [];
+                            newJoinedSelectorEmpty = true;
+
+                            //construct the joined selector - if & is the first thing this will be empty,
+                            // if not newJoinedSelector will be the last set of elements in the selector
+                            if (sel.length > 0) {
+                                newSelectorPath = sel.slice(0);
+                                lastSelector = newSelectorPath.pop();
+                                newJoinedSelector = new(tree.Selector)(lastSelector.elements.slice(0));
+                                newJoinedSelectorEmpty = false;
+                            }
+                            else {
+                                newJoinedSelector = new(tree.Selector)([]);
+                            }
+
+                            //put together the parent selectors after the join
+                            if (parentSel.length > 1) {
+                                afterParentJoin = afterParentJoin.concat(parentSel.slice(1));
+                            }
+
+                            if (parentSel.length > 0) {
+                                newJoinedSelectorEmpty = false;
+
+                                // join the elements so far with the first part of the parent
+                                newJoinedSelector.elements.push(new(tree.Element)(el.combinator, parentSel[0].elements[0].value, 0));
+                                newJoinedSelector.elements = newJoinedSelector.elements.concat(parentSel[0].elements.slice(1));
+                            }
+
+                            if (!newJoinedSelectorEmpty) {
+                                // now add the joined selector
+                                newSelectorPath.push(newJoinedSelector);
+                            }
+
+                            // and the rest of the parent
+                            newSelectorPath = newSelectorPath.concat(afterParentJoin);
+
+                            // add that to our new set of selectors
+                            selectorsMultiplied.push(newSelectorPath);
+                        }
+                    }
+                }
+
+                // our new selectors has been multiplied, so reset the state
+                newSelectors = selectorsMultiplied;
+                currentElements = [];
+            }
+        }
+
+        // if we have any elements left over (e.g. .a& .b == .b)
+        // add them on to all the current selectors
+        if (currentElements.length > 0) {
+            this.mergeElementsOnToSelectors(currentElements, newSelectors);
         }
 
-        if (beforeElements.length > 0) {
-            before.push(new(tree.Selector)(beforeElements));
+        for(i = 0; i < newSelectors.length; i++) {
+            paths.push(newSelectors[i]);
         }
+    },
+    
+    mergeElementsOnToSelectors: function(elements, selectors) {
+        var i, sel;
 
-        if (afterElements.length > 0) {
-            after.push(new(tree.Selector)(afterElements));
+        if (selectors.length == 0) {
+            selectors.push([ new(tree.Selector)(elements) ]);
+            return;
         }
 
-        for (var c = 0; c < context.length; c++) {
-            paths.push(before.concat(context[c]).concat(after));
+        for(i = 0; i < selectors.length; i++) {
+            sel = selectors[i];
+
+            // if the previous thing in sel is a parent this needs to join on to it
+            if (sel.length > 0) {
+                sel[sel.length - 1] = new(tree.Selector)(sel[sel.length - 1].elements.concat(elements));
+            }
+            else {
+                sel.push(new(tree.Selector)(elements));
+            }
         }
     }
 };
-})(require('less/tree'));
+})(require('../tree'));
index ddc6842..1ce2c30 100644 (file)
@@ -2,41 +2,51 @@
 
 tree.Selector = function (elements) {
     this.elements = elements;
-    if (this.elements[0].combinator.value === "") {
-        this.elements[0].combinator.value = ' ';
-    }
 };
 tree.Selector.prototype.match = function (other) {
-    var value = this.elements[0].value,
-        len   = this.elements.length,
-        olen  = other.elements.length;
+    var elements = this.elements,
+        len elements.length,
+        oelements, olen, max, i;
 
-    if (len > olen) {
-        return value === other.elements[0].value;
-    }
+    oelements = other.elements.slice(
+        (other.elements.length && other.elements[0].value === "&") ? 1 : 0);
+    olen = oelements.length;
+    max = Math.min(len, olen)
 
-    for (var i = 0; i < olen; i ++) {
-        if (value === other.elements[i].value) {
-            for (var j = 1; j < len; j ++) {
-                if (this.elements[j].value !== other.elements[i + j].value) {
-                    return false;
-                }
+    if (olen === 0 || len < olen) {
+        return false;
+    } else {
+        for (i = 0; i < max; i++) {
+            if (elements[i].value !== oelements[i].value) {
+                return false;
             }
-            return true;
         }
     }
-    return false;
+    return true;
+};
+tree.Selector.prototype.eval = function (env) {
+    return new(tree.Selector)(this.elements.map(function (e) {
+        return e.eval(env);
+    }));
 };
 tree.Selector.prototype.toCSS = function (env) {
     if (this._css) { return this._css }
-
-    return this._css = this.elements.map(function (e) {
+    
+    if (this.elements[0].combinator.value === "") {
+        this._css = ' ';
+    } else {
+        this._css = '';
+    }
+    
+    this._css += this.elements.map(function (e) {
         if (typeof(e) === 'string') {
             return ' ' + e.trim();
         } else {
             return e.toCSS(env);
         }
     }).join('');
+    
+    return this._css;
 };
 
-})(require('less/tree'));
+})(require('../tree'));
diff --git a/build-tools/lib/less/tree/unicode-descriptor.js b/build-tools/lib/less/tree/unicode-descriptor.js
new file mode 100644 (file)
index 0000000..79b6b23
--- /dev/null
@@ -0,0 +1,13 @@
+(function (tree) {
+
+tree.UnicodeDescriptor = function (value) {
+    this.value = value;
+};
+tree.UnicodeDescriptor.prototype = {
+    toCSS: function (env) {
+        return this.value;
+    },
+    eval: function () { return this }
+};
+
+})(require('../tree'));
index f427070..e37dbef 100644 (file)
@@ -1,25 +1,27 @@
 (function (tree) {
 
-tree.URL = function (val, paths) {
-    if (val.data) {
-        this.attrs = val;
-    } else {
-        // Add the base path if the URL is relative and we are in the browser
-        if (!/^(?:https?:\/|file:\/|data:\/)?\//.test(val.value) && paths.length > 0 && typeof(window) !== 'undefined') {
-            val.value = paths[0] + (val.value.charAt(0) === '/' ? val.value.slice(1) : val.value);
-        }
-        this.value = val;
-        this.paths = paths;
-    }
+tree.URL = function (val, rootpath) {
+    this.value = val;
+    this.rootpath = rootpath;
 };
 tree.URL.prototype = {
     toCSS: function () {
-        return "url(" + (this.attrs ? 'data:' + this.attrs.mime + this.attrs.charset + this.attrs.base64 + this.attrs.data
-                                    : this.value.toCSS()) + ")";
+        return "url(" + this.value.toCSS() + ")";
     },
     eval: function (ctx) {
-        return this.attrs ? this : new(tree.URL)(this.value.eval(ctx), this.paths);
+        var val = this.value.eval(ctx), rootpath;
+
+        // Add the base path if the URL is relative
+        if (typeof val.value === "string" && !/^(?:[a-z-]+:|\/)/.test(val.value)) {
+            rootpath = this.rootpath;
+            if (!val.quote) {
+                rootpath = rootpath.replace(/[\(\)'"\s]/g, function(match) { return "\\"+match; });
+            }
+            val.value = rootpath + val.value;
+        }
+
+        return new(tree.URL)(val, this.rootpath);
     }
 };
 
-})(require('less/tree'));
+})(require('../tree'));
index 922096c..3c1eb29 100644 (file)
@@ -21,4 +21,4 @@ tree.Value.prototype = {
     }
 };
 
-})(require('less/tree'));
+})(require('../tree'));
index 10f7c08..674ca8e 100644 (file)
@@ -1,6 +1,6 @@
 (function (tree) {
 
-tree.Variable = function (name, index) { this.name = name, this.index = index };
+tree.Variable = function (name, index, file) { this.name = name, this.index = index, this.file = file };
 tree.Variable.prototype = {
     eval: function (env) {
         var variable, v, name = this.name;
@@ -8,17 +8,31 @@ tree.Variable.prototype = {
         if (name.indexOf('@@') == 0) {
             name = '@' + new(tree.Variable)(name.slice(1)).eval(env).value;
         }
+        
+        if (this.evaluating) {
+            throw { type: 'Name',
+                    message: "Recursive variable definition for " + name,
+                    filename: this.file,
+                    index: this.index };
+        }
+        
+        this.evaluating = true;
 
         if (variable = tree.find(env.frames, function (frame) {
             if (v = frame.variable(name)) {
                 return v.value.eval(env);
             }
-        })) { return variable }
+        })) { 
+            this.evaluating = false;
+            return variable;
+        }
         else {
-            throw { message: "variable " + name + " is undefined",
+            throw { type: 'Name',
+                    message: "variable " + name + " is undefined",
+                    filename: this.file,
                     index: this.index };
         }
     }
 };
 
-})(require('less/tree'));
+})(require('../tree'));
index 485c802..1ef9587 100644 (file)
@@ -2,10 +2,10 @@
 <html>
 <head>
        <meta http-equiv="X-UA-Compatible" content="IE=9; IE=8" >
-       <script src="tizen-web-ui-fw/latest/js/jquery.js"></script>
+       <script src="tizen-web-ui-fw/latest/js/jquery.min.js"></script>
        <script src="configure.js"></script>
-       <script src="tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.js"></script>
-       <script src="tizen-web-ui-fw/latest/js/tizen-web-ui-fw.js"
+       <script src="tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.min.js"></script>
+       <script src="tizen-web-ui-fw/latest/js/tizen-web-ui-fw.min.js"
                data-framework-theme="tizen-white"
                data-framework-viewport-width="device-width">
 
@@ -34,7 +34,7 @@
 
                        <script>
                                $( document ).one( "pagecreate", function ( ) {
-                                       $("#input-select-theme").find("input[name='select-theme']").bind( "change", 
+                                       $("#input-select-theme").find("input[name='select-theme']").bind( "change",
                                                function ( ev, data ) {
                                                        var radio = this,
                                                                theme = "tizen-white";
        <script src="tips/generate-elements-dynamically.js"></script>
        <script src="tips/two-line-text/two-line-text.js"></script>
        <script src="tips/list-sample/list-sample.js"></script>
+       <script src="tips/pinch-event/pinch.js"></script>
        <script src="widgets/tokentextarea-demo.js"></script>
        <script src="widgets/pagelayout/barcontrol.js"></script>
        <script src="widgets/pagelayout/backbutton-control.js"></script>
diff --git a/demos/tizen-winsets/tips/pinch-event/pinch.html b/demos/tizen-winsets/tips/pinch-event/pinch.html
new file mode 100644 (file)
index 0000000..bf92117
--- /dev/null
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<div data-role="page" data-add-back-btn="true" id="pinch_page">
+       <div data-role="header" data-position="fixed">
+               <h1>Pinch Event</h1>
+       </div>
+       <div data-role="content">
+               <div data-role="gallery" data-vertical-align="middle" id="pinch_demo">
+                       <img src="./test.jpg">
+               </div>
+       </div> <!-- /content -->
+       <div data-role="footer">
+       </div>
+</div> <!-- /page -->
diff --git a/demos/tizen-winsets/tips/pinch-event/pinch.js b/demos/tizen-winsets/tips/pinch-event/pinch.js
new file mode 100644 (file)
index 0000000..59cff62
--- /dev/null
@@ -0,0 +1,49 @@
+$( document ).bind( "pagecreate", function () {
+       $("#pinch_page").bind( "pageshow", function () {
+               var last_ratio = 1,
+                       current_ratio;
+
+               function get_ratio ( ratio ) {
+                       var v = last_ratio + ratio - 1;
+
+                       if ( v < $.mobile.pinch.min ) {
+                               v = $.mobile.pinch.min;
+                       } else if ( v > $.mobile.pinch.max ) {
+                               v = $.mobile.pinch.max;
+                       }
+
+                       return v;
+               }
+
+               $("#pinch_demo").bind( "pinch", function ( e, p ) {
+                       var ratio;
+
+                       ratio = get_ratio( p.ratio );
+
+                       if ( current_ratio == ratio ) {
+                               return;
+                       }
+
+                       current_ratio = ratio;
+
+                       $("#pinch_demo").find("img")
+                                       .css({
+                                               "-webkit-transform": "scale(" + current_ratio + ")",
+                                               "-webkit-transition": "-webkit-transform 0.15s ease"
+                                       });
+               });
+
+               $("#pinch_demo").bind( "pinchstart", function ( e, p ) {
+               });
+
+               $("#pinch_demo").bind( "pinchend", function ( e, p ) {
+                       last_ratio = get_ratio( p.ratio );
+               });
+       });
+
+       $("#pinch_page").bind( "pagebeforehide", function () {
+               $("#pinch_demo").unbind("pinch")
+                               .unbind("pinchstart")
+                               .unbind("pinchend");
+       });
+});
diff --git a/demos/tizen-winsets/tips/pinch-event/test.jpg b/demos/tizen-winsets/tips/pinch-event/test.jpg
new file mode 100644 (file)
index 0000000..2b57959
Binary files /dev/null and b/demos/tizen-winsets/tips/pinch-event/test.jpg differ
index 177f48d..b1e5933 100644 (file)
@@ -6,8 +6,8 @@
        <div data-role="content">
                <p> short button or long text button</p>
                <p> do not need to control width. because button control text width in case content area<p>
-               <div data-role="button" data-inline="true">Text Button Test</div>
-               <div data-role="button" data-inline="true">Text Button Test. long text line</div>
+               <div data-role="button" data-inline="true">Text Button</div><br>
+               <div data-role="button" data-inline="true">Long Text Button Test</div>
                <br>
                <p> but some case, for example width fixed area or narrow width<br>
                browser change text to ellipsis </p>
                                <label id="textposition" for="segment863">This button is long<br>please type 2line</label>
                        </fieldset>     <br>
                <p> to make text in button, 2 line
-               <p> Simple making step is ...<br><br>
-               1. first insert &lt;br&gt; tag between text  <br><br>
-               2. then set fontsize to see text in small area <br>
-                  &nbsp;&nbsp;ex&gt; $( "#textposition .ui-btn-text" ).css("font-size", "12px");  <br><br>
-               3. if element attribute or inner attributes has padding-top/bottom,<br>
-                control this value because this value hide some text top/bottom <br>
-                  &nbsp;&nbsp;ex&gt; $( "#textposition" ).find("span").css("padding-top", "2px"); <br><br>
-               4. last control height between line text using line-height  <br>
-                        &nbsp;&nbsp;ex&gt; $( "#textposition" ).find("span").css("line-height", "10px"); <br><br><br><br>
+               <p> Simple making step is ...<br>
+               <div>
+                       <p style="margin-right:0.5em; padding:1em; font-size:0.7em; background-color:whitesmoke; color:black; border-width:3px; border-style:inset">
+                       1. first insert &lt;br&gt; tag between text.<br><br>
+                       2. then set fontsize to see text in small area.<br>
+                               &nbsp;&nbsp;var $elTxt = $( "#textposition" );<br>
+                         &nbsp;&nbsp;$elTxt.find( ".ui-btn-text" ).css("font-size", "12px");<br><br>
+                       3. if element attribute or inner attributes has padding-top/bottom,
+                        control this value because this value hide some text top/bottom.<br>
+                         &nbsp;&nbsp;$elTxt.find("span").css("padding-top", "2px");<br><br>
+                       4. last control height between line text using line-height.<br>
+                               &nbsp;&nbsp;$elTxt.find("span").css("line-height", "10px");<br>
+                       </p>
+               </div><br>
        </div>
        <div data-role="footer">
        </div>
index b6e44f9..5d8786b 100644 (file)
 <div data-role="button" data-icon="call" data-iconpos="top" data-inline="true">PositionTop</div>
 <div data-role="button" data-icon="call" data-iconpos="bottom" data-inline="true">PositionBottom</div></textarea><br/><br/>
                *Custom Button:<br/>
-               <div data-role="button" data-inline="true" data-icon="call">Custom</div>
-               <div data-role="button" data-inline="true" data-icon="call" data-iconpos="top">Custom Top</div>
-               <div data-role="button" data-inline="true" data-icon="call" data-iconpos="bottom">Custom Bottom</div>
-               <div data-role="button" data-inline="true" data-icon="call" style="width:150px;height:150px">Custom width,height</div>
+               <div data-role="button" data-inline="true" data-icon="call">0</div>
+               <div data-role="button" data-inline="true" data-icon="call" data-iconpos="top">1</div>
+               <div data-role="button" data-inline="true" data-icon="call" data-iconpos="bottom">2</div>
+               <div data-role="button" data-inline="true" data-icon="call" style="width:150px;height:150px">3</div>
                <div data-role="button" data-inline="true" data-icon="call" data-style="circle"></div><br/>
                HTML Code:
-               <textarea style="width:80%;padding:1em;background-color:whitesmoke;color:black;border-style:inset"  readonly="readonly" disabled><div data-role="button" data-inline="true" data-icon="call">Custom</div>
-<div data-role="button" data-inline="true" data-icon="call" data-iconpos="top">Custom Top</div>
-<div data-role="button" data-inline="true" data-icon="call" data-iconpos="bottom">Custom Bottom</div>
-<div data-role="button" data-inline="true" data-icon="call" style="width:150px;height:150px">Custom width,height</div></textarea>
+               <textarea style="width:80%;padding:1em;background-color:whitesmoke;color:black;border-style:inset"  readonly="readonly" disabled><div data-role="button" data-inline="true" data-icon="call">0</div>
+<div data-role="button" data-inline="true" data-icon="call" data-iconpos="top">1</div>
+<div data-role="button" data-inline="true" data-icon="call" data-iconpos="bottom">2</div>
+<div data-role="button" data-inline="true" data-icon="call" style="width:150px;height:150px">3</div></textarea>
                CSS Code:<br/>
                <textarea style="width:80%;padding:1em;background-color:whitesmoke;color:black;border-style:inset"  readonly="readonly" disabled>.ui-icon-test{
         background-size: 100% 100%;
index 7d1873a..f16c30c 100644 (file)
                </li>
        </ul>
 </div>
+<br>
+<br>
 <span id="codeSample">
-Code Sample
+"Position to origin button" popup is located in this text
 </span>
 <br>
 <br>
@@ -142,6 +144,12 @@ Code Sample
 <div data-role="popup" id="positionOrigin" class="ui-content" data-theme="d">
        <p style="color:white">I am positioned over the origin.</p>
 </div>
+<br>
+<br>
+<input type="button" data-inline="true"  onclick="popupTest()" value="Open Popup - input type button"/>
+<br>
+<br>
+<div data-role="button" "button" data-inline="true"  onclick="popupTest()">Open Popup - div button</div>
 </div> <!-- /content -->
 
 <div data-role="footer">
index 4775c4a..6b99e37 100644 (file)
                                <span class="ui-li-text-sub">Subtext</span>
                        </li>
                        <li class="ui-li-has-radio ui-li-dialogue" data-expandable="true" id="exp5">
+                               <form>
+                               <input type="radio" name="collapsible-radio" />
                                <span class="ui-li-text-main">2line-radio1</span>
                                <span class="ui-li-text-sub">Subtext</span>
-                               <form><input type="radio" name="collapsible-radio" /></form>
+                               </form>
                        </li>
                        <li class="ui-li-dialogue" data-expandable="true" id="exp6">
                                <span class="ui-li-color-bar" style="background-color:rgba(72, 136, 42, 1);"></span>
index c2c3c8c..e5537a0 100644 (file)
@@ -11,7 +11,7 @@
                        </li>
                        <li class="ui-li-dialogue ui-li-dialogue-edit">
                                <div class="ui-edit-title">Tel.</div>
-                               <input placeholder="Input your tel number" type="number" />
+                               <input placeholder="Input your tel number" type="tel" />
                        </li>
                        <li class="ui-li-dialogue ui-li-dialogue-edit">
                                <div class="ui-edit-title">Address </div>
@@ -22,7 +22,6 @@
                                <input placeholder="Input your city" />
                        </li>
 
-
                        <li data-role="list-divider" data-style="dialogue">Contact sample ( Button )</li>
                        <li class="ui-li-dialogue ui-li-dialogue-edit">
                                <div class="ui-edit-title">Name </div>
@@ -31,7 +30,7 @@
                        </li>
                        <li class="ui-li-dialogue ui-li-dialogue-edit">
                                <div class="ui-edit-title">Tel.</div>
-                               <input placeholder="Input your tel number" type="number" />
+                               <input placeholder="Input your tel number" type="tel" />
                                <div data-role="button" data-style="edit">Delete</div>
                        </li>
                        <li class="ui-li-dialogue ui-li-dialogue-edit">
                                <input placeholder="Input your city" />
                                <div data-role="button" data-style="edit">Delete</div>
                        </li>
+
+                       <li data-role="list-divider" data-style="dialogue">Contact sample ( Disabled )</li>
+                       <li class="ui-li-dialogue ui-li-dialogue-edit">
+                               <div class="ui-edit-title">Name </div>
+                               <input value="Tizen" disabled />
+                       </li>
+                       <li class="ui-li-dialogue ui-li-dialogue-edit">
+                               <div class="ui-edit-title">Tel.</div>
+                               <input value="0000000" disabled />
+                       </li>
+                       <li class="ui-li-dialogue ui-li-dialogue-edit">
+                               <div class="ui-edit-title">Address </div>
+                               <input value="777-77" disabled />
+                       </li>
+                       <li class="ui-li-dialogue ui-li-dialogue-edit">
+                               <div class="ui-edit-title">City </div>
+                               <input value="Seoul, Korea" disabled />
+                       </li>
+
                </ul>
        </div>
        <div data-role="footer">
index 3aa4c85..92588a9 100644 (file)
                        </li>
 
                        <li data-role="list-divider" data-style="dialogue">Dialogue (with link)</li>
-                       <li class="ui-li-dialogue">
+                       <li class="ui-li-dialogue ui-li-text-ellipsis">
                                <a>1line (with link)</a>
                        </li>
-                       <li class="ui-li-dialogue">
+                       <li class="ui-li-dialogue ui-li-text-ellipsis">
                                <a>
                                1line-sub (with link)
                                <span class="ui-li-text-sub">subtext</span>
                                </a>
                        </li>
-                       <li class="ui-li-dialogue">
+                       <li class="ui-li-dialogue ui-li-text-ellipsis">
                                <a>
                                        1line-btn1 (with link)
                                        <div data-role="button" data-inline="true">Button</div>
                                </a>
                        </li>
-                       <li class="ui-li-dialogue">
+                       <li class="ui-li-dialogue ui-li-text-ellipsis">
                                <a>
                                        1line-circle button (with link)
                                        <div data-role="button" data-inline="true" data-icon="plus" data-style="circle"></div>
                                </a>
                        </li>
-                       <li class="ui-li-dialogue">
+                       <li class="ui-li-dialogue ui-li-text-ellipsis">
                                <a>
                                        1line-toggle (with link)
                                        <select name="flip-11" id="flip-11" data-role="slider">
                                        </select>
                                </a>
                        </li>
-                       <li class="ui-li-dialogue">
+                       <li class="ui-li-dialogue ui-li-text-ellipsis">
                                <a>
                                        1line-bigicon1 (with link)
                                        <img src="thumbnail.jpg" class="ui-li-bigicon">
                                </a>
                        </li>
-                       <li class="ui-li-dialogue">
+                       <li class="ui-li-dialogue ui-li-text-ellipsis">
                                <a>
-                                       1line-bigicon2 (with link)
+                                       1line-bigicon2
                                        <img src="thumbnail.jpg" class="ui-li-bigicon">
                                        <span class="ui-li-text-sub">Sub text</span>
                                </a>
                        </li>
-                       <li class="ui-li-dialogue">
+                       <li class="ui-li-dialogue ui-li-text-ellipsis">
                                <a>
                                        1line-bigicon4 (with link)
                                        <img src="thumbnail.jpg" class="ui-li-bigicon">
                                        <div data-role="button" data-inline="true">Button</div>
                                </a>
                        </li>
-                       <li class="ui-li-dialogue">
+                       <li class="ui-li-dialogue ui-li-text-ellipsis">
                                <a>
                                        1line-bigicon5 (with link)
                                        <img src="thumbnail.jpg" class="ui-li-bigicon">
                                        <div data-role="button" data-inline="true" data-icon="plus" data-style="circle"></div>
                                </a>
                        </li>
-                       <li class="ui-li-dialogue">
+                       <li class="ui-li-dialogue ui-li-text-ellipsis">
                                <a>
                                        1line-bigicon5 (with link)
                                        <img src="thumbnail.jpg" class="ui-li-bigicon">
                                        </select>
                                </a>
                        </li>
-                       <li class="ui-li-dialogue">
+                       <li class="ui-li-dialogue ui-li-text-ellipsis">
                                <a>
                                        <input type="checkbox" data-style="check" name="c1line-check2" />
                                        1line-check1 (with link)
                                        <div data-role="button" data-inline="true" data-icon="plus" data-style="circle"></div>
                                </a>
                        </li>
-                       <li class="ui-li-dialogue">
+                       <li class="ui-li-dialogue ui-li-text-ellipsis">
                                <a>
                                        <input type="radio" name="radio" />
                                        1line-radio3 (with link)
                                        <div data-role="button" data-inline="true" data-icon="plus" data-style="circle"></div>
                                </a>
                        </li>
-                       <li class="ui-li-has-multiline ui-li-dialogue">
+                       <li class="ui-li-has-multiline ui-li-dialogue ui-li-text-ellipsis">
                                <a>
                                        2line (with link)
                                        <span class="ui-li-text-sub">Subtext</span>
                                </a>
                        </li>
-                       <li class="ui-li-has-multiline ui-li-dialogue">
+                       <li class="ui-li-has-multiline ui-li-dialogue ui-li-text-ellipsis">
                                <a>
                                        2line-2sub (with link)
                                        <span class="ui-li-text-sub">Subtext</span>
                                        <span class="ui-li-text-sub2">Subtext2</span>
                                </a>
                        </li>
-                       <li class="ui-li-has-multiline ui-li-dialogue">
+                       <li class="ui-li-has-multiline ui-li-dialogue ui-li-text-ellipsis">
                                <a>
                                        2line-btn1 (with link)
                                        <span class="ui-li-text-sub">Subtext</span>
                                        <div data-role="button" data-inline="true">button</div>
                                </a>
                        </li>
-                       <li class="ui-li-has-multiline ui-li-dialogue">
+                       <li class="ui-li-has-multiline ui-li-dialogue ui-li-text-ellipsis">
                                <a>
                                        <input type="checkbox"  name="c2line-check1" />
                                        2line-check (with link)
                                        <span class="ui-li-text-sub">Subtext</span>
                                </a>
                        </li>
-                       <li class="ui-li-has-multiline ui-li-dialogue">
+                       <li class="ui-li-has-multiline ui-li-dialogue ui-li-text-ellipsis">
                                <a>
                                        <input type="radio" name="radio" />
                                        2line-radio1 (with link)
                                        <span class="ui-li-text-sub">Subtext</span>
                                </a>
                        </li>
-                       <li class="ui-li-has-multiline ui-li-dialogue">
+                       <li class="ui-li-has-multiline ui-li-dialogue ui-li-text-ellipsis">
                                <a>
                                        2line-toggle-setting (with link)
                                        <span class="ui-li-text-sub">Subtext</span>
index bae7383..8a5393c 100644 (file)
@@ -1,6 +1,6 @@
 <div data-role="page" data-add-back-btn="true">
        <div data-role="header" data-position="fixed">
-               <h1>Normal Divider </h1>
+               <h1>Check Divider </h1>
        </div>
        <div class="content" data-role="content" data-scroll="y">
                <ul data-role="listview">
index eb6a97f..ff5369e 100644 (file)
@@ -1,6 +1,6 @@
 <div data-role="page" data-add-back-btn="true">
        <div data-role="header" data-position="fixed">
-               <h1>Normal Divider </h1>
+               <h1>Groupped Divider </h1>
        </div>
        <div class="content" data-role="content" data-scroll="y">
                <ul data-role="listview">
index 6a0c87d..fca581e 100644 (file)
@@ -1,30 +1,16 @@
 <div data-role="page" data-add-back-btn="true">
        <script type="text/javascript">
                var add = function() {
-                       var val = $("#idx").val();
-                       if( isNaN( val ) ) {
-                               alert( "invalid value" );
-                               return;
-                       }
-                       $("#listvi").listview( 'addItem', '<li>Test<div data-role="button" data-inline="true">TEST</div></li>', val );
+                       $("#listvi").listview( 'addItem', '<li>Test<div data-role="button" data-inline="true">TEST</div></li>', 0 );
                }
                var del = function() {
-                       var val = $("#idx").val();
-                       if( isNaN( val ) ) {
-                               alert( "invalid value" );
-                               return;
-                       }
-                       $("#listvi").listview( 'removeItem' , val );
+                       $("#listvi").listview( 'removeItem' , 0 );
                }
        </script>
        <div data-role="header" data-position="fixed">
                <h1>List vi</h1>
        </div>
        <div class="content" data-role="content" data-scroll="y">
-               <div>
-                       Only number in textbox, list index start at 0(zero)
-               </div>
-               <input type="number" value="0" id="idx" min="0" />
                <div data-role="button" onclick="add()" data-inline="true">Add</div>
                <div data-role="button" onclick="del()" data-inline="true">Del</div>
                <ul id="listvi" data-role="listview">
index 09363c8..c436d10 100644 (file)
@@ -1,5 +1,10 @@
 <!DOCTYPE html>
 <div data-role="page" data-add-back-btn="true">
+       <script>
+               $(document).bind("pageinit", function() {
+                       $.mobile.tizen.disableContextMenu( $("div:jqmData(role='page')"));
+               });
+       </script>
        <div data-role="header" data-position="fixed">
                <h1>Audio Test</h1>
        </div>
index 5a481cc..dbe903c 100644 (file)
@@ -1,5 +1,10 @@
 <!DOCTYPE html>
 <div data-role="page" data-add-back-btn="true">
+       <script>
+               $(document).bind("pageinit", function() {
+                       $.mobile.tizen.disableContextMenu( $("div:jqmData(role='page')"));
+               });
+       </script>
        <div data-role="header" data-position="fixed">
                <h1>Video Test</h1>
        </div>
index cf672b4..4f82c58 100644 (file)
@@ -19,7 +19,7 @@
                <p>Footer more sample</p>
        </div>
        <div data-role="footer">
-               <a href="#pop_js" data-role="button"  data-icon="naviframe-more" data-rel="popup"></a>
+               <a href="#pop_js" data-role="button"  data-icon="naviframe-more" data-transition="slideupfade" data-rel="popup"></a>
 
                <div id="pop_js" data-role="popup" >
                <ul data-role="listview">
index 36218fa..8237535 100644 (file)
@@ -19,7 +19,7 @@
                <p>Footer more sample</p>
        </div>
        <div data-role="footer">
-               <a href="#pop_js" data-role="button"  data-icon="naviframe-more" data-transition="popbottom" data-rel="popup"></a>
+               <a href="#pop_js" data-role="button"  data-icon="naviframe-more" data-transition="slidedownfade" data-rel="popup"></a>
 
                <div data-role="button" data-inline="true" data-style="round">Button1</div>
                <div data-role="button" data-inline="true" data-style="round">Button2</div>
index ff87fed..d685857 100644 (file)
@@ -25,7 +25,6 @@
                        &nbsp&nbsp&nbsp&nbsp&lt;/div&gt; <br>
                  &lt;/div&gt; </p>
                </div><br>
-               <a href="#" data-role="button" data-inline="true" data-rel="back">Go Back</a>
        </div>
 </div>
 </body>
index d7f8512..8bcdba6 100644 (file)
@@ -39,7 +39,7 @@
                </ul>
 
                <!-- Social Magazine font popup -->
-               <div id="center_social_style1" data-role="popup" class="center_liststyle_2btn">
+               <div id="center_social_style1" data-role="popup" class="center_title_2btn">
                        <div class="ui-popup-title">
                                <h1>Font Size</h1>
                        </div>
@@ -74,7 +74,7 @@
                                <h1>Create new category<h1>
                        </div>
                        <div class="ui-popup-text">
-                                               <input type="text" id="newCategoryPopupInput" name="newCategoryName" size="30" />
+                                               <input type="text" id="newCategoryPopupInput" name="newCategoryName" size="20" />
                        </div>
                                        <div class="ui-popup-button-bg">
                                                <a data-role="button" data-rel="back" data-inline="true">OK</a>
                                <h1>PopupTest<h1>
                        </div>
                        <div class="ui-popup-text">
-                               <input type="text" size="30" />
-                               <input type="text" size="30" />
+                               <input type="text" size="20" />
+                               <input type="text" size="20" />
                        </div>
                        <div class="ui-popup-button-bg">
                                <a data-role="button" data-rel="back" data-inline="true">OK</a>
index b4e9ce9..e84f36a 100644 (file)
@@ -27,9 +27,9 @@
                                        <li><a href="tabbar_scrolling.html">Scrolling interation</a></li>
 
                                        <li data-role="list-divider">Footer</li>
-                                       <li><a href="tabbar_footer_icon.html">[Progressing...]Footer + Tab(text)</a></li>
-                                       <li><a href="tabbar_footer.html">[Progressing...]Footer + Tab(text)</a></li>
-                                       <li><a href="tabbar_footer_more.html">[Progressing...]Footer + more + Tab(text)</a></li>
+                                       <li><a href="tabbar_footer_icon.html">Footer + Tab(icon)</a></li>
+                                       <li><a href="tabbar_footer.html">Footer + Tab(text)</a></li>
+                                       <li><a href="tabbar_footer_more.html">Footer + more + Tab(text)</a></li>
                                        <li><a href="tabbar_footer_segment.html">Footer + SegmentTab(text)</a></li>
                                        <li><a href="tabbar_footer_segment_more.html">Footer + more + SegmentTab(text)</a></li>
                                </ul>
index 771472d..90f6e20 100644 (file)
@@ -12,7 +12,7 @@
 <body>
 <div data-role="page" data-add-back-btn="true">
        <div data-role="header" data-position="fixed">
-               <h1>Tabbar text with title</h1>
+               <h1>Tabbar icon with title</h1>
        </div>
 
        <div data-role="content">
index 4035354..4cf7a73 100644 (file)
 
                $( "#MBTfocusInTest" ).click( function () {
                        $( ":jqmData(role='tokentextarea')" ).tokentextarea( "focusIn", 0 );
+                       $( ":jqmData(role='tokentextarea')" ).parents( ".ui-scrollview-view" ).parent().scrollview( "scrollTo", 0, 0 );
                });
 
                $( "#MBTfocusOutTest" ).click( function () {
                        $( ":jqmData(role='tokentextarea')" ).tokentextarea( "focusOut", 0 );
+                       $( ":jqmData(role='tokentextarea')" ).parents( ".ui-scrollview-view" ).parent().scrollview( "scrollTo", 0, 0 );
                });
 
                $( "#MBTdestroyTest" ).click( function () {
index a94bf2d..1060633 100644 (file)
@@ -33,7 +33,7 @@ index f24699b..d56a7ba 100644
 +      {
 +              var i, btnAttr, len = containers.length;
 +              for ( i = 0; i < len; i++ ) {
-+                      btnAttr = $( containers[ i ] ).find( ":jqmData(role='button')" ) || ( $( containers[ i ] ).find( "input" ).attr( "type" ) == "button" );
++                      btnAttr = $( containers[ i ] ).find( ":jqmData(role='button'),input[type='button'],select:jqmData(role='slider')" );
 +                      if ( btnAttr.length ) {
 +                              if ( btnAttr.jqmData( "style" ) == "circle" )  {
 +                                      $( containers[ i ] ).addClass( "ui-li-has-right-circle-btn" );
index f8420c3..9388e28 100644 (file)
@@ -99,7 +99,7 @@ index c222f08..b46e737 100644
 +                                      break;
 +                              case 1:
 +                                      correctionValue = [ 0 , -(ret.y + menuSize.cy - linkOffset.top)];
-+                                      arrowtop = menuSize.cy - 1;
++                                      arrowtop = menuSize.cy - 2;
 +                                      arrowleft = (linkOffset.left - ret.x + correctionValue[0]) + ( $(this.link).width() / 2 ) - parseInt( $(this._ui.arrow).css("border-width") ) / 2;
 +                                      $(this._ui.arrow).attr( "class", "" )
 +                                                                      .addClass( "ui-arrow bottom" );
@@ -150,7 +150,7 @@ index c222f08..b46e737 100644
 +                              options = [];
 +                      }
 +                      if ( !options.link ) {
-+                              self.link = $(event.target).closest('a')[0];
++                              self.link = ( $(event.target).closest('a')[0] || $(event.target).closest('div')[0] );
 +                      } else {
 +                              self.link = options.link;
 +                      }
diff --git a/libs/patch/0029-JQM-performance-tuning.patch b/libs/patch/0029-JQM-performance-tuning.patch
new file mode 100644 (file)
index 0000000..163c109
--- /dev/null
@@ -0,0 +1,816 @@
+From 77d1c8c71a7bc71b807e2fe1e0eca3b286bcb04b Mon Sep 17 00:00:00 2001
+From: Minkyeong Kim <minkyeong.kim@samsung.com>
+Date: Wed, 30 Jan 2013 19:11:23 +0900
+Subject: [PATCH] JQM performance tuning
+
+---
+ .../js/events/orientationchange.js                 |    8 +++---
+ libs/js/jquery-mobile-1.2.0/js/events/touch.js     |    4 +-
+ .../js/jquery.mobile.buttonMarkup.js               |   23 ++++++++++---------
+ .../jquery-mobile-1.2.0/js/jquery.mobile.core.js   |    8 +++++-
+ .../js/jquery.mobile.degradeInputs.js              |    2 +-
+ .../js/jquery.mobile.fieldContain.js               |    2 +-
+ .../jquery-mobile-1.2.0/js/jquery.mobile.init.js   |   12 +++++-----
+ .../jquery-mobile-1.2.0/js/jquery.mobile.links.js  |    2 +-
+ .../jquery-mobile-1.2.0/js/jquery.mobile.media.js  |    2 +-
+ .../js/jquery.mobile.navigation.js                 |   14 ++++++------
+ .../js/jquery.mobile.navigation.pushstate.js       |    6 ++--
+ .../jquery-mobile-1.2.0/js/jquery.mobile.nojs.js   |    2 +-
+ .../js/jquery.mobile.transition.js                 |   10 ++++----
+ .../jquery-mobile-1.2.0/js/jquery.mobile.vmouse.js |    2 +-
+ .../js/jquery.mobile.zoom.iosorientationfix.js     |    2 +-
+ .../jquery-mobile-1.2.0/js/widgets/collapsible.js  |    2 +-
+ .../js/widgets/collapsibleSet.js                   |    2 +-
+ libs/js/jquery-mobile-1.2.0/js/widgets/dialog.js   |    2 +-
+ .../jquery-mobile-1.2.0/js/widgets/fixedToolbar.js |    8 +++---
+ .../jquery-mobile-1.2.0/js/widgets/forms/button.js |    4 +-
+ .../js/widgets/forms/checkboxradio.js              |    2 +-
+ .../js/widgets/forms/select.custom.js              |    4 +-
+ .../jquery-mobile-1.2.0/js/widgets/forms/select.js |    2 +-
+ .../jquery-mobile-1.2.0/js/widgets/forms/slider.js |    4 +-
+ .../js/widgets/forms/textinput.js                  |    6 ++--
+ .../js/widgets/listview.autodividers.js            |    2 +-
+ .../js/widgets/listview.filter.js                  |    2 +-
+ libs/js/jquery-mobile-1.2.0/js/widgets/listview.js |    2 +-
+ libs/js/jquery-mobile-1.2.0/js/widgets/loader.js   |    6 ++--
+ libs/js/jquery-mobile-1.2.0/js/widgets/navbar.js   |    2 +-
+ .../js/widgets/page.sections.js                    |   11 +++++----
+ libs/js/jquery-mobile-1.2.0/js/widgets/popup.js    |    8 +++---
+ 32 files changed, 87 insertions(+), 81 deletions(-)
+
+diff --git a/libs/js/jquery-mobile-1.2.0/js/events/orientationchange.js b/libs/js/jquery-mobile-1.2.0/js/events/orientationchange.js
+index 95674f3..de903c8 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/events/orientationchange.js
++++ b/libs/js/jquery-mobile-1.2.0/js/events/orientationchange.js
+@@ -7,7 +7,7 @@ define( [ "jquery", "../jquery.mobile.support.orientation", "./throttledresize"
+ //>>excludeEnd("jqmBuildExclude");
+ (function( $, window ) {
+-      var win = $( window ),
++      var win = $.mobile.$window,
+               event_name = "orientationchange",
+               special_event,
+               get_orientation,
+@@ -44,8 +44,8 @@ define( [ "jquery", "../jquery.mobile.support.orientation", "./throttledresize"
+               // developer console. The actual threshold value is somewhat arbitrary, we just
+               // need to make sure it is large enough to exclude the developer console case.
+-              var ww = window.innerWidth || $( window ).width(),
+-                      wh = window.innerHeight || $( window ).height(),
++              var ww = window.innerWidth || $.mobile.$window.width(),
++                      wh = window.innerHeight || $.mobile.$window.height(),
+                       landscape_threshold = 50;
+               initial_orientation_is_landscape = ww > wh && ( ww - wh ) > landscape_threshold;
+@@ -151,4 +151,4 @@ define( [ "jquery", "../jquery.mobile.support.orientation", "./throttledresize"
+ //>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+ });
+-//>>excludeEnd("jqmBuildExclude");
+\ No newline at end of file
++//>>excludeEnd("jqmBuildExclude");
+diff --git a/libs/js/jquery-mobile-1.2.0/js/events/touch.js b/libs/js/jquery-mobile-1.2.0/js/events/touch.js
+index 6083faf..9e616cc 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/events/touch.js
++++ b/libs/js/jquery-mobile-1.2.0/js/events/touch.js
+@@ -103,7 +103,7 @@ define( [ "jquery", "../jquery.mobile.vmouse", "../jquery.mobile.support.touch"
+                                       $this.unbind( "vclick", clickHandler )
+                                               .unbind( "vmouseup", clearTapTimer );
+-                                      $( document ).unbind( "vmousecancel", clearTapHandlers );
++                                      $.mobile.$document.unbind( "vmousecancel", clearTapHandlers );
+                               }
+                               function clickHandler( event ) {
+@@ -118,7 +118,7 @@ define( [ "jquery", "../jquery.mobile.vmouse", "../jquery.mobile.support.touch"
+                               $this.bind( "vmouseup", clearTapTimer )
+                                       .bind( "vclick", clickHandler );
+-                              $( document ).bind( "vmousecancel", clearTapHandlers );
++                              $.mobile.$document.bind( "vmousecancel", clearTapHandlers );
+                               timer = setTimeout( function() {
+                                       triggerCustomEvent( thisObject, "taphold", $.Event( "taphold", { target: origTarget } ) );
+diff --git a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.buttonMarkup.js b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.buttonMarkup.js
+index cd95245..b0b1f19 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.buttonMarkup.js
++++ b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.buttonMarkup.js
+@@ -11,6 +11,7 @@ define( [ "jquery", "./jquery.mobile.core", "./jquery.mobile.vmouse" ], function
+ $.fn.buttonMarkup = function( options ) {
+       var $workingSet = this,
++              prefix = "data-" + $.mobile.ns,
+               mapToDataAttr = function( key, value ) {
+                       e.setAttribute( "data-" + $.mobile.ns + key, value );
+                       el.jqmData( key, value );
+@@ -22,14 +23,14 @@ $.fn.buttonMarkup = function( options ) {
+               var el = $workingSet.eq( i ),
+                       e = el[ 0 ],
+                       o = $.extend( {}, $.fn.buttonMarkup.defaults, {
+-                              icon:       options.icon       !== undefined ? options.icon       : el.jqmData( "icon" ),
+-                              iconpos:    options.iconpos    !== undefined ? options.iconpos    : el.jqmData( "iconpos" ),
+-                              theme:      options.theme      !== undefined ? options.theme      : el.jqmData( "theme" ) || $.mobile.getInheritedTheme( el, $.fn.buttonMarkup.defaults["theme"] ),
+-                              inline:     options.inline     !== undefined ? options.inline     : el.jqmData( "inline" ),
+-                              shadow:     options.shadow     !== undefined ? options.shadow     : el.jqmData( "shadow" ),
+-                              corners:    options.corners    !== undefined ? options.corners    : el.jqmData( "corners" ),
+-                              iconshadow: options.iconshadow !== undefined ? options.iconshadow : el.jqmData( "iconshadow" ),
+-                              mini:       options.mini       !== undefined ? options.mini       : el.jqmData( "mini" )
++                              icon:       options.icon       !== undefined ? options.icon       : ( e.getAttribute( prefix + "icon" ) || undefined ),
++                              iconpos:    options.iconpos    !== undefined ? options.iconpos    : ( e.getAttribute( prefix + "iconpos" ) || undefined ),
++                              theme:      options.theme      !== undefined ? options.theme      : e.getAttribute( prefix + "theme" ) || $.mobile.getInheritedTheme( el, $.fn.buttonMarkup.defaults["theme"] ),
++                              inline:     options.inline     !== undefined ? options.inline     : /^true$/i.test( e.getAttribute( prefix + "inline" ) ),
++                              shadow:     options.shadow     !== undefined ? options.shadow     : !/^false$/i.test( e.getAttribute( prefix + "shadow" ) ),
++                              corners:    options.corners    !== undefined ? options.corners    : !/^false$/i.test( e.getAttribute( prefix + "corners" ) ),
++                              iconshadow: options.iconshadow !== undefined ? options.iconshadow : !/^false$/i.test( e.getAttribute( prefix + "iconshadow" ) ),
++                              mini:       options.mini       !== undefined ? options.mini       : /^true$/i.test( e.getAttribute( prefix + "mini" ) )
+                       }, options ),
+                       // Classes Defined
+@@ -44,7 +45,7 @@ $.fn.buttonMarkup = function( options ) {
+               $.each( o, mapToDataAttr );
+-              if ( el.jqmData( "rel" ) === "popup" && el.attr( "href" ) ) {
++              if ( e.getAttribute( prefix + "rel" ) === "popup" && el.attr( "href" ) ) {
+                       e.setAttribute( "aria-haspopup", true );
+                       e.setAttribute( "aria-owns", e.getAttribute( "href" ) );
+               }
+@@ -249,7 +250,7 @@ function closestEnabledButton( element ) {
+ var attachEvents = function() {
+       var hoverDelay = $.mobile.buttonMarkup.hoverDelay, hov, foc;
+-      $( document ).bind( {
++      $.mobile.$document.bind( {
+               "vmousedown vmousecancel vmouseup vmouseover vmouseout focus blur scrollstart touchend touchcancel": function( event ) {
+                       var theme,
+                               $btn = $( closestEnabledButton( event.target ) ),
+@@ -303,7 +304,7 @@ var attachEvents = function() {
+ //links in bars, or those with  data-role become buttons
+ //auto self-init widgets
+-$( document ).bind( "pagecreate create", function( e ) {
++$.mobile.$document.bind( "pagecreate create", function( e ) {
+       $( ":jqmData(role='button'), .ui-bar > a, .ui-header > a, .ui-footer > a, .ui-bar > :jqmData(role='controlgroup') > a", e.target )
+               .jqmEnhanceable()
+diff --git a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.core.js b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.core.js
+index 4e8ebfe..873293c 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.core.js
++++ b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.core.js
+@@ -84,6 +84,10 @@ define( [ "jquery", "text!../version.txt" ], function( $, __version__ ) {
+                       hoverDelay: 200
+               },
++              // define the window and the document objects
++              $window: $( window ),
++              $document: $( document ),
++
+               // TODO might be useful upstream in jquery itself ?
+               keyCode: {
+                       ALT: 18,
+@@ -131,7 +135,7 @@ define( [ "jquery", "text!../version.txt" ], function( $, __version__ ) {
+                       setTimeout( function() {
+                               window.scrollTo( 0, ypos );
+-                              $( document ).trigger( "silentscroll", { x: 0, y: ypos });
++                              $.mobile.$document.trigger( "silentscroll", { x: 0, y: ypos });
+                       }, 20 );
+                       setTimeout( function() {
+@@ -237,7 +241,7 @@ define( [ "jquery", "text!../version.txt" ], function( $, __version__ ) {
+               getScreenHeight: function() {
+                       // Native innerHeight returns more accurate value for this across platforms,
+                       // jQuery version is here as a normalized fallback for platforms like Symbian
+-                      return window.innerHeight || $( window ).height();
++                      return window.innerHeight || $.mobile.$window.height();
+               }
+       }, $.mobile );
+diff --git a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.degradeInputs.js b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.degradeInputs.js
+index 28abc52..6951e17 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.degradeInputs.js
++++ b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.degradeInputs.js
+@@ -26,7 +26,7 @@ $.mobile.page.prototype.options.degradeInputs = {
+ //auto self-init widgets
+-$( document ).bind( "pagecreate create", function( e ) {
++$.mobile.$document.bind( "pagecreate create", function( e ) {
+       var page = $.mobile.closestPageData( $( e.target ) ), options;
+diff --git a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.fieldContain.js b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.fieldContain.js
+index daf66e7..c7fd931 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.fieldContain.js
++++ b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.fieldContain.js
+@@ -19,7 +19,7 @@ $.fn.fieldcontain = function( options ) {
+ };
+ //auto self-init widgets
+-$( document ).bind( "pagecreate create", function( e ) {
++$.mobile.$document.bind( "pagecreate create", function( e ) {
+       $( ":jqmData(role='fieldcontain')", e.target ).jqmEnhanceable().fieldcontain();
+ });
+diff --git a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.init.js b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.init.js
+index 52f6434..d31ddf0 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.init.js
++++ b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.init.js
+@@ -10,7 +10,7 @@ define( [ "jquery", "./jquery.mobile.core", "./jquery.mobile.support", "./jquery
+ (function( $, window, undefined ) {
+       var     $html = $( "html" ),
+                       $head = $( "head" ),
+-                      $window = $( window );
++                      $window = $.mobile.$window;
+       //remove initial build class (only present on first pageshow)
+       function hideRenderingClass() {
+@@ -70,7 +70,7 @@ define( [ "jquery", "./jquery.mobile.core", "./jquery.mobile.support", "./jquery
+                               var $this = $( this );
+                               // unless the data url is already set set it to the pathname
+-                              if ( !$this.jqmData( "url" ) ) {
++                              if ( !$this[0].getAttribute( "data-" + $.mobile.ns + "url" ) ) {
+                                       $this.attr( "data-" + $.mobile.ns + "url", $this.attr( "id" ) || location.pathname + location.search );
+                               }
+                       });
+@@ -79,7 +79,7 @@ define( [ "jquery", "./jquery.mobile.core", "./jquery.mobile.support", "./jquery
+                       $.mobile.firstPage = $pages.first();
+                       // define page container
+-                      $.mobile.pageContainer = $pages.first().parent().addClass( "ui-mobile-viewport" );
++                      $.mobile.pageContainer = $.mobile.firstPage.parent().addClass( "ui-mobile-viewport" );
+                       // alert listeners that the pagecontainer has been determined for binding
+                       // to events triggered on it
+@@ -127,13 +127,13 @@ define( [ "jquery", "./jquery.mobile.core", "./jquery.mobile.support", "./jquery
+               // if defaultHomeScroll hasn't been set yet, see if scrollTop is 1
+               // it should be 1 in most browsers, but android treats 1 as 0 (for hiding addr bar)
+               // so if it's 1, use 0 from now on
+-              $.mobile.defaultHomeScroll = ( !$.support.scrollTop || $( window ).scrollTop() === 1 ) ? 0 : 1;
++              $.mobile.defaultHomeScroll = ( !$.support.scrollTop || $.mobile.$window.scrollTop() === 1 ) ? 0 : 1;
+               // TODO: Implement a proper registration mechanism with dependency handling in order to not have exceptions like the one below
+               //auto self-init widgets for those widgets that have a soft dependency on others
+               if ( $.fn.controlgroup ) {
+-                      $( document ).bind( "pagecreate create", function( e ) {
++                      $.mobile.$document.bind( "pagecreate create", function( e ) {
+                               $( ":jqmData(role='controlgroup')", e.target )
+                                       .jqmEnhanceable()
+                                       .controlgroup({ excludeInvisible: false });
+@@ -154,7 +154,7 @@ define( [ "jquery", "./jquery.mobile.core", "./jquery.mobile.support", "./jquery
+                       // by adding the 'ui-disabled' class to them. Using a JavaScript workaround for those browser.
+                       // https://github.com/jquery/jquery-mobile/issues/3558
+-                      $( document ).delegate( ".ui-disabled", "vclick",
++                      $.mobile.$document.delegate( ".ui-disabled", "vclick",
+                               function( e ) {
+                                       e.preventDefault();
+                                       e.stopImmediatePropagation();
+diff --git a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.links.js b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.links.js
+index a3bfdba..4145d30 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.links.js
++++ b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.links.js
+@@ -8,7 +8,7 @@ define( [ "jquery" ], function( $ ) {
+ //>>excludeEnd("jqmBuildExclude");
+ (function( $, undefined ) {
+-$( document ).bind( "pagecreate create", function( e ) {
++$.mobile.$document.bind( "pagecreate create", function( e ) {
+       //links within content areas, tests included with page
+       $( e.target )
+diff --git a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.media.js b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.media.js
+index 73b6802..2068ca5 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.media.js
++++ b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.media.js
+@@ -8,7 +8,7 @@ define( [ "jquery", "./jquery.mobile.core" ], function( $ ) {
+ //>>excludeEnd("jqmBuildExclude");
+ (function( $, undefined ) {
+-var $window = $( window ),
++var $window = $.mobile.$window,
+       $html = $( "html" );
+ /* $.mobile.media method: pass a CSS media type or query and get a bool return
+diff --git a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.navigation.js b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.navigation.js
+index 9048789..203557a 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.navigation.js
++++ b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.navigation.js
+@@ -15,7 +15,7 @@ define( [
+ (function( $, undefined ) {
+       //define vars for interal use
+-      var $window = $( window ),
++      var $window = $.mobile.$window,
+               $html = $( 'html' ),
+               $head = $( 'head' ),
+@@ -1256,7 +1256,7 @@ define( [
+       $.mobile.navreadyDeferred = $.Deferred();
+       $.mobile.navreadyDeferred.done(function() {
+               //bind to form submit events, handle with Ajax
+-              $( document ).delegate( "form", "submit", function( event ) {
++              $.mobile.$document.delegate( "form", "submit", function( event ) {
+                       var $this = $( this );
+                       if ( !$.mobile.ajaxEnabled ||
+@@ -1309,7 +1309,7 @@ define( [
+               });
+               //add active state on vclick
+-              $( document ).bind( "vclick", function( event ) {
++              $.mobile.$document.bind( "vclick", function( event ) {
+                       // if this isn't a left click we don't care. Its important to note
+                       // that when the virtual event is generated it will create the which attr
+                       if ( event.which > 1 || !$.mobile.linkBindingEnabled ) {
+@@ -1335,7 +1335,7 @@ define( [
+               });
+               // click routing - direct to HTTP or Ajax, accordingly
+-              $( document ).bind( "click", function( event ) {
++              $.mobile.$document.bind( "click", function( event ) {
+                       if ( !$.mobile.linkBindingEnabled ) {
+                               return;
+                       }
+@@ -1433,7 +1433,7 @@ define( [
+               });
+               //prefetch pages when anchors with data-prefetch are encountered
+-              $( document ).delegate( ".ui-page", "pageshow.prefetch", function() {
++              $.mobile.$document.delegate( ".ui-page", "pageshow.prefetch", function() {
+                       var urls = [];
+                       $( this ).find( "a:jqmData(prefetch)" ).each(function() {
+                               var $link = $( this ),
+@@ -1553,8 +1553,8 @@ define( [
+               });
+               //set page min-heights to be device specific
+-              $( document ).bind( "pageshow", resetActivePageHeight );
+-              $( window ).bind( "throttledresize", resetActivePageHeight );
++              $.mobile.$document.bind( "pageshow", resetActivePageHeight );
++              $.mobile.$window.bind( "throttledresize", resetActivePageHeight );
+       });//navreadyDeferred done callback
+diff --git a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.navigation.pushstate.js b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.navigation.pushstate.js
+index e0c73e4..10761d1 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.navigation.pushstate.js
++++ b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.navigation.pushstate.js
+@@ -11,14 +11,14 @@ define( [ "jquery", "./jquery.mobile.navigation", "depend!./jquery.hashchange[jq
+       // methods handed off as event handlers
+       var     pushStateHandler = {},
+               self = pushStateHandler,
+-              $win = $( window ),
++              $win = $.mobile.$window,
+               url = $.mobile.path.parseLocation(),
+               mobileinitDeferred = $.Deferred(),
+               domreadyDeferred = $.Deferred();
+-      $( document ).ready( $.proxy( domreadyDeferred, "resolve" ) );
++      $.mobile.$document.ready( $.proxy( domreadyDeferred, "resolve" ) );
+-      $( document ).one( "mobileinit", $.proxy( mobileinitDeferred, "resolve" ) );
++      $.mobile.$document.one( "mobileinit", $.proxy( mobileinitDeferred, "resolve" ) );
+       $.extend( pushStateHandler, {
+               // TODO move to a path helper, this is rather common functionality
+diff --git a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.nojs.js b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.nojs.js
+index 159d1fc..807a319 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.nojs.js
++++ b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.nojs.js
+@@ -7,7 +7,7 @@ define( [ "jquery" ], function( $ ) {
+ //>>excludeEnd("jqmBuildExclude");
+ (function( $, undefined ) {
+-$( document ).bind( "pagecreate create", function( e ) {
++$.mobile.$document.bind( "pagecreate create", function( e ) {
+       $( ":jqmData(role='nojs')", e.target ).addClass( "ui-nojs" );
+       
+ });
+diff --git a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.transition.js b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.transition.js
+index cb7c9a7..f8edcee 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.transition.js
++++ b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.transition.js
+@@ -24,8 +24,8 @@ var createHandler = function( sequential ) {
+                       active  = $.mobile.urlHistory.getActive(),
+                       toScroll = active.lastScroll || $.mobile.defaultHomeScroll,
+                       screenHeight = $.mobile.getScreenHeight(),
+-                      maxTransitionOverride = $.mobile.maxTransitionWidth !== false && $( window ).width() > $.mobile.maxTransitionWidth,
+-                      none = !$.support.cssTransitions || maxTransitionOverride || !name || name === "none" || Math.max( $( window ).scrollTop(), toScroll ) > $.mobile.getMaxScrollForTransition(),
++                      maxTransitionOverride = $.mobile.maxTransitionWidth !== false && $.mobile.$window.width() > $.mobile.maxTransitionWidth,
++                      none = !$.support.cssTransitions || maxTransitionOverride || !name || name === "none" || Math.max( $.mobile.$window.scrollTop(), toScroll ) > $.mobile.getMaxScrollForTransition(),
+                       toPreClass = " ui-page-pre-in",
+                       toggleViewportClass = function() {
+                               $.mobile.pageContainer.toggleClass( "ui-mobile-viewport-transitioning viewport-" + name );
+@@ -35,7 +35,7 @@ var createHandler = function( sequential ) {
+                               // Don't scoll window, when current scroll top(scrollTop()) is already at toScroll,
+                               // or when current scroll top is 0 and toScroll is same to defaultHomeScroll
+                               // (which means the top position of page). In these case, page scrolling is not needed.
+-                              var st = $( window ).scrollTop();
++                              var st = $.mobile.$window.scrollTop();
+                               if( st === toScroll || ( $.mobile.defaultHomeScroll === toScroll && st == 0 ) ) {
+                                       return;
+                               }
+@@ -68,7 +68,7 @@ var createHandler = function( sequential ) {
+                               // Set the from page's height and start it transitioning out
+                               // Note: setting an explicit height helps eliminate tiling in the transitions
+                               $from
+-                                      .height( screenHeight + $( window ).scrollTop() )
++                                      .height( screenHeight + $.mobile.$window.scrollTop() )
+                                       .addClass( name + " out" + reverseClass );
+                       },
+@@ -130,7 +130,7 @@ var createHandler = function( sequential ) {
+                               // In some browsers (iOS5), 3D transitions block the ability to scroll to the desired location during transition
+                               // This ensures we jump to that spot after the fact, if we aren't there already.
+-                              if ( $( window ).scrollTop() !== toScroll ) {
++                              if ( $.mobile.$window.scrollTop() !== toScroll ) {
+                                       scrollPage();
+                               }
+diff --git a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.vmouse.js b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.vmouse.js
+index 25188d8..a98b73e 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.vmouse.js
++++ b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.vmouse.js
+@@ -38,7 +38,7 @@ var dataPropertyName = "virtualMouseBindings",
+       blockMouseTriggers = false,
+       blockTouchTriggers = false,
+       eventCaptureSupported = "addEventListener" in document,
+-      $document = $( document ),
++      $document = $.mobile.$document,
+       nextTouchID = 1,
+       lastTouchID = 0, threshold;
+diff --git a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.zoom.iosorientationfix.js b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.zoom.iosorientationfix.js
+index 71ddc8b..61917f7 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.zoom.iosorientationfix.js
++++ b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.zoom.iosorientationfix.js
+@@ -33,7 +33,7 @@ define( [ "jquery", "./jquery.mobile.core", "./jquery.mobile.zoom" ], function(
+     }
+   }
+-  $( window )
++  $.mobile.$window
+               .bind( "orientationchange.iosorientationfix", zoom.enable )
+               .bind( "devicemotion.iosorientationfix", checkTilt );
+diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/collapsible.js b/libs/js/jquery-mobile-1.2.0/js/widgets/collapsible.js
+index d56a24f..41492ca 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/widgets/collapsible.js
++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/collapsible.js
+@@ -167,7 +167,7 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
+ });
+ //auto self-init widgets
+-$( document ).bind( "pagecreate create", function( e ) {
++$.mobile.$document.bind( "pagecreate create", function( e ) {
+       $.mobile.collapsible.prototype.enhanceWithin( e.target );
+ });
+diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/collapsibleSet.js b/libs/js/jquery-mobile-1.2.0/js/widgets/collapsibleSet.js
+index ce66110..4c5a419 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/widgets/collapsibleSet.js
++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/collapsibleSet.js
+@@ -108,7 +108,7 @@ $.widget( "mobile.collapsibleset", $.mobile.widget, {
+ });
+ //auto self-init widgets
+-$( document ).bind( "pagecreate create", function( e ) {
++$.mobile.$document.bind( "pagecreate create", function( e ) {
+       $.mobile.collapsibleset.prototype.enhanceWithin( e.target );
+ });
+diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/dialog.js b/libs/js/jquery-mobile-1.2.0/js/widgets/dialog.js
+index e04f557..d7a0795 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/widgets/dialog.js
++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/dialog.js
+@@ -102,7 +102,7 @@ $.widget( "mobile.dialog", $.mobile.widget, {
+ });
+ //auto self-init widgets
+-$( document ).delegate( $.mobile.dialog.prototype.options.initSelector, "pagecreate", function() {
++$.mobile.$document.delegate( $.mobile.dialog.prototype.options.initSelector, "pagecreate", function() {
+       $.mobile.dialog.prototype.enhance( this );
+ });
+diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/fixedToolbar.js b/libs/js/jquery-mobile-1.2.0/js/widgets/fixedToolbar.js
+index 9e72b3d..ea9fe60 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/widgets/fixedToolbar.js
++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/fixedToolbar.js
+@@ -133,7 +133,7 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.core", "../jque
+                                       var thisPage = this;
+                                       self.updatePagePadding( thisPage );
+                                       if ( o.updatePagePadding ) {
+-                                              $( window ).bind( "throttledresize." + self.widgetName, function() {
++                                              $.mobile.$window.bind( "throttledresize." + self.widgetName, function() {
+                                                       self.updatePagePadding( thisPage );
+                                               });
+                                       }
+@@ -143,7 +143,7 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.core", "../jque
+                                               $.mobile.zoom.enable( true );
+                                       }
+                                       if ( o.updatePagePadding ) {
+-                                              $( window ).unbind( "throttledresize." + self.widgetName );
++                                              $.mobile.$window.unbind( "throttledresize." + self.widgetName );
+                                       }
+                                       if ( o.trackPersistentToolbars ) {
+@@ -179,7 +179,7 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.core", "../jque
+               },
+               _useTransition: function( notransition ) {
+-                      var $win = $( window ),
++                      var $win = $.mobile.$window,
+                               $el = this.element,
+                               scroll = $win.scrollTop(),
+                               elHeight = $el.height(),
+@@ -262,7 +262,7 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.core", "../jque
+       });
+       //auto self-init widgets
+-      $( document )
++      $.mobile.$document
+               .bind( "pagecreate create", function( e ) {
+                       // DEPRECATED in 1.1: support for data-fullscreen=true|false on the page element.
+diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/forms/button.js b/libs/js/jquery-mobile-1.2.0/js/widgets/forms/button.js
+index 78f43a0..7b0141b 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/widgets/forms/button.js
++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/forms/button.js
+@@ -95,7 +95,7 @@ $.widget( "mobile.button", $.mobile.widget, {
+                                               }).insertBefore( $el );
+                                               // Bind to doc to remove after submit handling
+-                                              $( document ).one( "submit", function() {
++                                              $.mobile.$document.one( "submit", function() {
+                                                       $buttonPlaceholder.remove();
+                                                       // reset the local var so that the hidden input
+@@ -146,7 +146,7 @@ $.widget( "mobile.button", $.mobile.widget, {
+ });
+ //auto self-init widgets
+-$( document ).bind( "pagecreate create", function( e ) {
++$.mobile.$document.bind( "pagecreate create", function( e ) {
+       $.mobile.button.prototype.enhanceWithin( e.target, true );
+ });
+diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/forms/checkboxradio.js b/libs/js/jquery-mobile-1.2.0/js/widgets/forms/checkboxradio.js
+index d28cdfb..a9f8f31 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/widgets/forms/checkboxradio.js
++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/forms/checkboxradio.js
+@@ -211,7 +211,7 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
+ });
+ //auto self-init widgets
+-$( document ).bind( "pagecreate create", function( e ) {
++$.mobile.$document.bind( "pagecreate create", function( e ) {
+       $.mobile.checkboxradio.prototype.enhanceWithin( e.target, true );
+ });
+diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/forms/select.custom.js b/libs/js/jquery-mobile-1.2.0/js/widgets/forms/select.custom.js
+index 98d2fe6..85a024f 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/widgets/forms/select.custom.js
++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/forms/select.custom.js
+@@ -332,7 +332,7 @@ define( [
+                               }
+                               var self = this,
+-                                      $window = $( window ),
++                                      $window = $.mobile.$window,
+                                       selfListParent = self.list.parent(),
+                                       menuHeight = selfListParent.outerHeight(),
+                                       menuWidth = selfListParent.outerWidth(),
+@@ -510,7 +510,7 @@ define( [
+       };
+       // issue #3894 - core doesn't trigger events on disabled delegates
+-      $( document ).bind( "selectmenubeforecreate", function( event ) {
++      $.mobile.$document.bind( "selectmenubeforecreate", function( event ) {
+               var selectmenuWidget = $( event.target ).data( "selectmenu" );
+               if ( !selectmenuWidget.options.nativeMenu &&
+diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/forms/select.js b/libs/js/jquery-mobile-1.2.0/js/widgets/forms/select.js
+index 3c70fed..a8b0f9f 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/widgets/forms/select.js
++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/forms/select.js
+@@ -252,7 +252,7 @@ $.widget( "mobile.selectmenu", $.mobile.widget, {
+ });
+ //auto self-init widgets
+-$( document ).bind( "pagecreate create", function( e ) {
++$.mobile.$document.bind( "pagecreate create", function( e ) {
+       $.mobile.selectmenu.prototype.enhanceWithin( e.target, true );
+ });
+ })( jQuery );
+diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/forms/slider.js b/libs/js/jquery-mobile-1.2.0/js/widgets/forms/slider.js
+index 1bd4adf..c6d4c9b 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/widgets/forms/slider.js
++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/forms/slider.js
+@@ -178,7 +178,7 @@ $.widget( "mobile.slider", $.mobile.widget, {
+                       }
+               }
+-              this._on( $( document ), { "vmousemove": this._preventDocumentDrag });
++              this._on( $.mobile.$document, { "vmousemove": this._preventDocumentDrag });
+               // it appears the clicking the up and down buttons in chrome on
+               // range/number inputs doesn't trigger a change until the field is
+@@ -468,7 +468,7 @@ $.widget( "mobile.slider", $.mobile.widget, {
+ });
+ //auto self-init widgets
+-$( document ).bind( "pagecreate create", function( e ) {
++$.mobile.$document.bind( "pagecreate create", function( e ) {
+       $.mobile.slider.prototype.enhanceWithin( e.target, true );
+ });
+diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/forms/textinput.js b/libs/js/jquery-mobile-1.2.0/js/widgets/forms/textinput.js
+index 05b1b03..075d35d 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/widgets/forms/textinput.js
++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/forms/textinput.js
+@@ -93,13 +93,13 @@ $.widget( "mobile.textinput", $.mobile.widget, {
+                       // binding to pagechange here ensures that for pages loaded via
+                       // ajax the height is recalculated without user input
+-                      this._on( $(document), {"pagechange": "_keyup" });
++                      this._on( $.mobile.$document, {"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
+-                              this._on( $(window), {"load": "_keyup"});
++                              this._on( $.mobile.$window, {"load": "_keyup"});
+                       }
+               }
+               if ( input.attr( "disabled" ) ) {
+@@ -133,7 +133,7 @@ $.widget( "mobile.textinput", $.mobile.widget, {
+ });
+ //auto self-init widgets
+-$( document ).bind( "pagecreate create", function( e ) {
++$.mobile.$document.bind( "pagecreate create", function( e ) {
+       $.mobile.textinput.prototype.enhanceWithin( e.target, true );
+ });
+diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/listview.autodividers.js b/libs/js/jquery-mobile-1.2.0/js/widgets/listview.autodividers.js
+index 4d947b4..ae123a8 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/widgets/listview.autodividers.js
++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/listview.autodividers.js
+@@ -21,7 +21,7 @@ $.mobile.listview.prototype.options.autodividersSelector = function( elt ) {
+       return text;
+ };
+-$( document ).delegate( "ul,ol", "listviewcreate", function() {
++$.mobile.$document.delegate( "ul,ol", "listviewcreate", function() {
+       var list = $( this ),
+                       listview = list.data( "listview" );
+diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/listview.filter.js b/libs/js/jquery-mobile-1.2.0/js/widgets/listview.filter.js
+index 0774615..0519b9a 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/widgets/listview.filter.js
++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/listview.filter.js
+@@ -18,7 +18,7 @@ var defaultFilterCallback = function( text, searchValue, item ) {
+ $.mobile.listview.prototype.options.filterCallback = defaultFilterCallback;
+-$( document ).delegate( ":jqmData(role='listview')", "listviewcreate", function() {
++$.mobile.$document.delegate( ":jqmData(role='listview')", "listviewcreate", function() {
+       var list = $( this ),
+               listview = list.data( "listview" );
+diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/listview.js b/libs/js/jquery-mobile-1.2.0/js/widgets/listview.js
+index ef1e178..e46f842 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/widgets/listview.js
++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/listview.js
+@@ -521,7 +521,7 @@ $.widget( "mobile.listview", $.mobile.widget, {
+ });
+ //auto self-init widgets
+-$( document ).bind( "pagecreate create", function( e ) {
++$.mobile.$document.bind( "pagecreate create", function( e ) {
+       $.mobile.listview.prototype.enhanceWithin( e.target );
+ });
+diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/loader.js b/libs/js/jquery-mobile-1.2.0/js/widgets/loader.js
+index 6d2f2bc..b028698 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/widgets/loader.js
++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/loader.js
+@@ -38,7 +38,7 @@ define( [ "jquery",  "../jquery.mobile.core", "../jquery.mobile.widget" ], functi
+       });
+       // TODO move loader class down into the widget settings
+-      var loaderClass = "ui-loader", $html = $( "html" ), $window = $( window );
++      var loaderClass = "ui-loader", $html = $( "html" ), $window = $.mobile.$window;
+       $.widget( "mobile.loader", {
+               // NOTE if the global config settings are defined they will override these
+@@ -170,8 +170,8 @@ define( [ "jquery",        "../jquery.mobile.core", "../jquery.mobile.widget" ], functi
+                               this.element.removeClass( "ui-loader-fakefix" );
+                       }
+-                      $( window ).unbind( "scroll", $.proxy( this.fakeFixLoader, this) );
+-                      $( window ).unbind( "scroll", $.proxy( this.checkLoaderPosition, this ) );
++                      $.mobile.$window.unbind( "scroll", $.proxy( this.fakeFixLoader, this) );
++                      $.mobile.$window.unbind( "scroll", $.proxy( this.checkLoaderPosition, this ) );
+               }
+       });
+diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/navbar.js b/libs/js/jquery-mobile-1.2.0/js/widgets/navbar.js
+index 65f5869..29c5057 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/widgets/navbar.js
++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/navbar.js
+@@ -52,7 +52,7 @@ $.widget( "mobile.navbar", $.mobile.widget, {
+ });
+ //auto self-init widgets
+-$( document ).bind( "pagecreate create", function( e ) {
++$.mobile.$document.bind( "pagecreate create", function( e ) {
+       $.mobile.navbar.prototype.enhanceWithin( e.target );
+ });
+diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/page.sections.js b/libs/js/jquery-mobile-1.2.0/js/widgets/page.sections.js
+index 90a298a..e00684c 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/widgets/page.sections.js
++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/page.sections.js
+@@ -18,10 +18,11 @@ $.mobile.page.prototype.options.contentTheme = null;
+ //      which expects .ui-footer top be applied in its gigantic selector
+ // TODO remove the buttonMarkup giant selector and move it to the various modules
+ //      on which it depends
+-$( document ).bind( "pagecreate", function( e ) {
++$.mobile.$document.bind( "pagecreate", function( e ) {
+       var $page = $( e.target ),
+               o = $page.data( "page" ).options,
+-              pageRole = $page.jqmData( "role" ),
++              prefix = "data-"+$.mobile.ns,
++              pageRole = $page[0].getAttribute( prefix + "role" ) || undefined,
+               pageTheme = o.theme;
+       $( ":jqmData(role='header'), :jqmData(role='footer'), :jqmData(role='content')", $page )
+@@ -29,8 +30,8 @@ $( document ).bind( "pagecreate", function( e ) {
+               .each(function() {
+               var $this = $( this ),
+-                      role = $this.jqmData( "role" ),
+-                      theme = $this.jqmData( "theme" ),
++                      role = $this[0].getAttribute( prefix + "role" ) || undefined,
++                      theme = $this[0].getAttribute( prefix + "theme" ) || undefined,
+                       contentTheme = theme || o.contentTheme || ( pageRole === "dialog" && pageTheme ),
+                       $headeranchors,
+                       leftbtn,
+@@ -65,7 +66,7 @@ $( document ).bind( "pagecreate", function( e ) {
+                       // Auto-add back btn on pages beyond first view
+                       if ( o.addBackBtn &&
+                               ( role === "footer" || role === "header" ) &&
+-                              $page.jqmData( "url" ) !== $.mobile.path.stripHash( location.hash ) &&
++                              $page[0].getAttribute( prefix + "url" ) !== $.mobile.path.stripHash( location.hash ) &&
+                               !leftbtn ) {
+                               if ( o.addBackBtn == "header" ) {
+diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/popup.js b/libs/js/jquery-mobile-1.2.0/js/widgets/popup.js
+index b9a950e..13cb548 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/widgets/popup.js
++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/popup.js
+@@ -28,7 +28,7 @@ define( [ "jquery",
+       }
+       function windowCoords() {
+-              var $win = $( window );
++              var $win = $.mobile.$window;
+               return {
+                       x: $win.scrollLeft(),
+@@ -192,7 +192,7 @@ define( [ "jquery",
+                               _orientationchangeInProgress: false,
+                               _globalHandlers: [
+                                       {
+-                                              src: $( window ),
++                                              src: $.mobile.$window,
+                                               handler: {
+                                                       orientationchange: $.proxy( this, "_handleWindowOrientationchange" ),
+                                                       resize: $.proxy( this, "_handleWindowResize" ),
+@@ -886,14 +886,14 @@ define( [ "jquery",
+       };
+       // TODO move inside _create
+-      $( document ).bind( "pagebeforechange", function( e, data ) {
++      $.mobile.$document.bind( "pagebeforechange", function( e, data ) {
+               if ( data.options.role === "popup" ) {
+                       $.mobile.popup.handleLink( data.options.link );
+                       e.preventDefault();
+               }
+       });
+-      $( document ).bind( "pagecreate create", function( e )  {
++      $.mobile.$document.bind( "pagecreate create", function( e )  {
+               $.mobile.popup.prototype.enhanceWithin( e.target, true );
+       });
+-- 
+1.7.5.4
+
+
diff --git a/libs/patch/0030-JQM-performance-tuning-remove-jqmData.patch b/libs/patch/0030-JQM-performance-tuning-remove-jqmData.patch
new file mode 100644 (file)
index 0000000..436349b
--- /dev/null
@@ -0,0 +1,428 @@
+From c5e658e96ae2b60731934f6cc0cb8cdf1e515698 Mon Sep 17 00:00:00 2001
+From: Minkyeong Kim <minkyeong.kim@samsung.com>
+Date: Fri, 1 Feb 2013 14:15:11 +0900
+Subject: [PATCH] [JQM] performance tuning : remove jqmData
+
+---
+ .../js/jquery.mobile.buttonMarkup.js               |   26 +++++++++++---------
+ .../js/jquery.mobile.controlGroup.js               |    4 +--
+ .../jquery-mobile-1.2.0/js/jquery.mobile.core.js   |    8 ++++++
+ .../js/jquery.mobile.navigation.js                 |   12 ++++-----
+ .../jquery-mobile-1.2.0/js/widgets/collapsible.js  |   26 ++++++++++----------
+ .../js/widgets/collapsibleSet.js                   |    6 ++---
+ libs/js/jquery-mobile-1.2.0/js/widgets/dialog.js   |    2 +-
+ .../jquery-mobile-1.2.0/js/widgets/forms/button.js |    4 +--
+ .../jquery-mobile-1.2.0/js/widgets/forms/select.js |    6 ++---
+ .../jquery-mobile-1.2.0/js/widgets/forms/slider.js |    6 ++---
+ .../js/widgets/forms/textinput.js                  |    2 +-
+ .../js/widgets/listview.filter.js                  |    2 +-
+ libs/js/jquery-mobile-1.2.0/js/widgets/listview.js |   22 ++++++++---------
+ libs/js/jquery-mobile-1.2.0/js/widgets/popup.js    |    4 +--
+ 14 files changed, 70 insertions(+), 60 deletions(-)
+
+diff --git a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.buttonMarkup.js b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.buttonMarkup.js
+index 4d07961..7c17ba6 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.buttonMarkup.js
++++ b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.buttonMarkup.js
+@@ -23,14 +23,14 @@ $.fn.buttonMarkup = function( options ) {
+               var el = $workingSet.eq( i ),
+                       e = el[ 0 ],
+                       o = $.extend( {}, $.fn.buttonMarkup.defaults, {
+-                              icon:       options.icon       !== undefined ? options.icon       : ( e.getAttribute( prefix + "icon" ) || undefined ),
+-                              iconpos:    options.iconpos    !== undefined ? options.iconpos    : ( e.getAttribute( prefix + "iconpos" ) || undefined ),
+-                              theme:      options.theme      !== undefined ? options.theme      : e.getAttribute( prefix + "theme" ) || $.mobile.getInheritedTheme( el, $.fn.buttonMarkup.defaults["theme"] ),
+-                              inline:     options.inline     !== undefined ? options.inline     : /^true$/i.test( e.getAttribute( prefix + "inline" ) ),
+-                              shadow:     options.shadow     !== undefined ? options.shadow     : !/^false$/i.test( e.getAttribute( prefix + "shadow" ) ),
+-                              corners:    options.corners    !== undefined ? options.corners    : !/^false$/i.test( e.getAttribute( prefix + "corners" ) ),
+-                              iconshadow: options.iconshadow !== undefined ? options.iconshadow : !/^false$/i.test( e.getAttribute( prefix + "iconshadow" ) ),
+-                              mini:       options.mini       !== undefined ? options.mini       : /^true$/i.test( e.getAttribute( prefix + "mini" ) )
++                              icon:       options.icon       !== undefined ? options.icon       : $.mobile.getAttrFixed( e, prefix + "icon" ),
++                              iconpos:    options.iconpos    !== undefined ? options.iconpos    : $.mobile.getAttrFixed( e, prefix + "iconpos" ),
++                              theme:      options.theme      !== undefined ? options.theme      : $.mobile.getAttrFixed( e, prefix + "theme" ) || $.mobile.getInheritedTheme( el, $.fn.buttonMarkup.defaults["theme"] ),
++                              inline:     options.inline     !== undefined ? options.inline     : $.mobile.getAttrFixed( e, prefix + "inline" ),
++                              shadow:     options.shadow     !== undefined ? options.shadow     : $.mobile.getAttrFixed( e, prefix + "shadow" ),
++                              corners:    options.corners    !== undefined ? options.corners    : $.mobile.getAttrFixed( e, prefix + "corners" ),
++                              iconshadow: options.iconshadow !== undefined ? options.iconshadow : $.mobile.getAttrFixed( e, prefix + "iconshadow" ),
++                              mini:       options.mini       !== undefined ? options.mini       : $.mobile.getAttrFixed( e, prefix + "mini" )
+                       }, options ),
+                       // Classes Defined
+@@ -43,9 +43,11 @@ $.fn.buttonMarkup = function( options ) {
+                       buttonIcon,
+                       buttonElements;
+-              $.each( o, mapToDataAttr );
++              for ( key in o ) {
++                      e.setAttribute ( prefix + key, o[ key ])
++              }
+-              if ( e.getAttribute( prefix + "rel" ) === "popup" && el.attr( "href" ) ) {
++              if ( $.mobile.getAttrFixed( e, prefix + "rel" ) === "popup" && el.attr( "href" ) ) {
+                       e.setAttribute( "aria-haspopup", true );
+                       e.setAttribute( "aria-owns", e.getAttribute( "href" ) );
+               }
+@@ -82,12 +84,12 @@ $.fn.buttonMarkup = function( options ) {
+               buttonClass += o.corners ? " ui-btn-corner-all" : "";
+               // To distinguish real buttons
+-              if( el.jqmData("role") == "button" || e.tagName == "BUTTON" || e.tagName == "DIV" ){
++              if(  $.mobile.getAttrFixed( e, prefix + "role" ) == "button" || e.tagName == "BUTTON" || e.tagName == "DIV" ){
+                       buttonClass += " ui-btn-box-" + o.theme;
+               }
+               /* TIZEN style markup */
+-              buttonStyle = el.jqmData("style");
++              buttonStyle =  $.mobile.getAttrFixed( e, prefix + "style" );
+               if ( buttonStyle == "circle" && !($(el).text().length > 0) ) {
+                       /* style : no text, Icon only */
+diff --git a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.controlGroup.js b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.controlGroup.js
+index 9e72818..06c5312 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.controlGroup.js
++++ b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.controlGroup.js
+@@ -20,10 +20,10 @@ $.fn.controlgroup = function( options ) {
+       return this.each(function() {
+               var $el = $( this ),
+                       o = $.extend({
+-                                              direction: $el.jqmData( "type" ) || "vertical",
++                                              direction:  $.mobile.getAttrFixed( $el[0], "data-"+ $.mobile.ns + "type" ) || "vertical",
+                                               shadow: false,
+                                               excludeInvisible: true,
+-                                              mini: $el.jqmData( "mini" )
++                                              mini: $.mobile.getAttrFixed( $el[0], "data-"+ $.mobile.ns + "mini" )
+                                       }, options ),
+                       grouplegend = $el.children( "legend" ),
+                       groupheading = $el.children( ".ui-controlgroup-label" ),
+diff --git a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.core.js b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.core.js
+index 873293c..f8c3a2d 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.core.js
++++ b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.core.js
+@@ -88,6 +88,14 @@ define( [ "jquery", "text!../version.txt" ], function( $, __version__ ) {
+               $window: $( window ),
+               $document: $( document ),
++              getAttrFixed : function( e, key ) {
++                      var value = e.getAttribute( key );
++
++                      return value === "true" ? true :
++                              value === "false" ? false :
++                              value === null ? undefined : value;
++              },
++
+               // TODO might be useful upstream in jquery itself ?
+               keyCode: {
+                       ALT: 18,
+diff --git a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.navigation.js b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.navigation.js
+index 203557a..0a727b4 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.navigation.js
++++ b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.navigation.js
+@@ -1050,7 +1050,7 @@ define( [
+                       activeIsInitialPage = urlHistory.activeIndex === 0,
+                       historyDir = 0,
+                       pageTitle = document.title,
+-                      isDialog = settings.role === "dialog" || toPage.jqmData( "role" ) === "dialog";
++                      isDialog = settings.role === "dialog" || $.mobile.getAttrFixed( toPage [0], "data-" + $.mobile.ns + "role" ) === "dialog";
+               // By default, we prevent changePage requests when the fromPage and toPage
+               // are the same element, but folks that generate content manually/dynamically
+@@ -1300,8 +1300,8 @@ define( [
+                               {
+                                       type:           type && type.length && type.toLowerCase() || "get",
+                                       data:           $this.serialize(),
+-                                      transition:     $this.jqmData( "transition" ),
+-                                      reverse:        $this.jqmData( "direction" ) === "reverse",
++                                      transition:     $.mobile.getAttrFixed( $this [0], "data-" + $.mobile.ns + "transition" ),
++                                      reverse:        $.mobile.getAttrFixed( $this [0], "data-" + $.mobile.ns + "direction" ) === "reverse",
+                                       reloadPage:     true
+                               }
+                       );
+@@ -1420,10 +1420,10 @@ define( [
+                       }
+                       //use ajax
+-                      var transition = $link.jqmData( "transition" ),
+-                              reverse = $link.jqmData( "direction" ) === "reverse" ||
++                      var transition = $.mobile.getAttrFixed( $link [0], "data-" + $.mobile.ns + "transition" ),
++                              reverse =  $.mobile.getAttrFixed( $link [0], "data-" + $.mobile.ns + "direction" ) === "reverse" ||
+                                                       // deprecated - remove by 1.0
+-                                                      $link.jqmData( "back" ),
++                                                       $.mobile.getAttrFixed( $link [0], "data-" + $.mobile.ns + "back" ),
+                               //this may need to be more specific as we use data-rel more
+                               role = $link.attr( "data-" + $.mobile.ns + "rel" ) || undefined;
+diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/collapsible.js b/libs/js/jquery-mobile-1.2.0/js/widgets/collapsible.js
+index 41492ca..ad1ca3b 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/widgets/collapsible.js
++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/collapsible.js
+@@ -27,8 +27,8 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
+                       o = this.options,
+                       collapsible = $el.addClass( "ui-collapsible" ),
+                       collapsibleHeading = $el.children( o.heading ).first(),
+-                      collapsedIcon = $el.jqmData( "collapsed-icon" ) || o.collapsedIcon,
+-                      expandedIcon = $el.jqmData( "expanded-icon" ) || o.expandedIcon,
++                      collapsedIcon = $.mobile.getAttrFixed( $el[0], "data-" + $.mobile.ns + "collapsed-icon" ) || o.collapsedIcon,
++                      expandedIcon = $.mobile.getAttrFixed( $el[0], "data-" + $.mobile.ns + "expanded-icon" ) || o.expandedIcon,
+                       collapsibleContent = collapsible.wrapInner( "<div class='ui-collapsible-content'></div>" ).children( ".ui-collapsible-content" ),
+                       collapsibleSet = $el.closest( ":jqmData(role='collapsible-set')" ).addClass( "ui-collapsible-set" );
+@@ -42,34 +42,34 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
+               if ( collapsibleSet.length ) {
+                       // Inherit the theme from collapsible-set
+                       if ( !o.theme ) {
+-                              o.theme = collapsibleSet.jqmData( "theme" ) || $.mobile.getInheritedTheme( collapsibleSet, "c" );
++                              o.theme = $.mobile.getAttrFixed( collapsibleSet[0], "data-" + $.mobile.ns + "theme" ) || $.mobile.getInheritedTheme( collapsibleSet, "c" );
+                       }
+                       // Inherit the content-theme from collapsible-set
+                       if ( !o.contentTheme ) {
+-                              o.contentTheme = collapsibleSet.jqmData( "content-theme" );
++                              o.contentTheme = $.mobile.getAttrFixed( collapsibleSet[0], "data-" + $.mobile.ns + "content-theme" );
+                       }
+                       // Get the preference for collapsed icon in the set
+                       if ( !o.collapsedIcon ) {
+-                              o.collapsedIcon = collapsibleSet.jqmData( "collapsed-icon" );
++                              o.collapsedIcon = $.mobile.getAttrFixed( collapsibleSet[0], "data-" + $.mobile.ns + "collapsed-icon" );
+                       }
+                       // Get the preference for expanded icon in the set
+                       if ( !o.expandedIcon ) {
+-                              o.expandedIcon = collapsibleSet.jqmData( "expanded-icon" );
++                              o.expandedIcon = $.mobile.getAttrFixed( collapsibleSet[0], "data-" + $.mobile.ns + "expanded-icon" );
+                       }
+                       // Gets the preference icon position in the set
+                       if ( !o.iconPos ) {
+-                              o.iconPos = collapsibleSet.jqmData( "iconpos" );
++                              o.iconPos = $.mobile.getAttrFixed( collapsibleSet[0], "data-" + $.mobile.ns + "iconpos" );
+                       }
+                       // Inherit the preference for inset from collapsible-set or set the default value to ensure equalty within a set
+-                      if ( collapsibleSet.jqmData( "inset" ) !== undefined ) {
+-                              o.inset = collapsibleSet.jqmData( "inset" );
++                      if ( $.mobile.getAttrFixed( collapsibleSet[0], "data-" + $.mobile.ns + "inset" ) !== undefined ) {
++                              o.inset = $.mobile.getAttrFixed( collapsibleSet[0], "data-" + $.mobile.ns + "inset" );
+                       } else {
+                               o.inset = true;
+                       }
+                       // Gets the preference for mini in the set
+                       if ( !o.mini ) {
+-                              o.mini = collapsibleSet.jqmData( "mini" );
++                              o.mini = $.mobile.getAttrFixed( collapsibleSet[0], "data-" + $.mobile.ns + "mini" );
+                       }
+               } else {
+                       // get inherited theme if not a set and no theme has been set
+@@ -84,8 +84,8 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
+               
+               collapsibleContent.addClass( ( o.contentTheme ) ? ( "ui-body-" + o.contentTheme ) : "");
+-              collapsedIcon = $el.jqmData( "collapsed-icon" ) || o.collapsedIcon || "plus";
+-              expandedIcon = $el.jqmData( "expanded-icon" ) || o.expandedIcon || "minus";
++              collapsedIcon = $.mobile.getAttrFixed( $el[0], "data-" + $.mobile.ns + "collapsed-icon" ) || o.collapsedIcon || "plus";
++              expandedIcon = $.mobile.getAttrFixed( $el[0], "data-" + $.mobile.ns + "expanded-icon" ) || o.expandedIcon || "minus";
+               collapsibleHeading
+                       //drop heading in before content
+@@ -99,7 +99,7 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
+                               .buttonMarkup({
+                                       shadow: false,
+                                       corners: false,
+-                                      iconpos: $el.jqmData( "iconpos" ) || o.iconPos || "left",
++                                      iconpos: $.mobile.getAttrFixed( $el[0], "data-" + $.mobile.ns + "iconpos" ) || o.iconPos || "left",
+                                       icon: collapsedIcon,
+                                       mini: o.mini,
+                                       theme: o.theme
+diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/collapsibleSet.js b/libs/js/jquery-mobile-1.2.0/js/widgets/collapsibleSet.js
+index 4c5a419..ebc762d 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/widgets/collapsibleSet.js
++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/collapsibleSet.js
+@@ -23,11 +23,11 @@ $.widget( "mobile.collapsibleset", $.mobile.widget, {
+               }
+               // Inherit the content-theme from collapsible-set
+               if ( !o.contentTheme ) {
+-                      o.contentTheme = $el.jqmData( "content-theme" );
++                      o.contentTheme = $.mobile.getAttrFixed( $el[0], "data-" + $.mobile.ns + "content-theme" );
+               }
+-              if ( $el.jqmData( "inset" ) !== undefined ) {
+-                      o.inset = $el.jqmData( "inset" );
++              if ( $.mobile.getAttrFixed( $el[0], "data-" + $.mobile.ns + "inset" ) !== undefined ) {
++                      o.inset = $.mobile.getAttrFixed( $el[0], "data-" + $.mobile.ns + "inset" );
+               }
+               o.inset = o.inset !== undefined ? o.inset : true;
+diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/dialog.js b/libs/js/jquery-mobile-1.2.0/js/widgets/dialog.js
+index d7a0795..9e390ef 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/widgets/dialog.js
++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/dialog.js
+@@ -59,7 +59,7 @@ $.widget( "mobile.dialog", $.mobile.widget, {
+                       var $target = $( event.target ).closest( event.type === "vclick" ? "a" : "form" ),
+                               active;
+-                      if ( $target.length && !$target.jqmData( "transition" ) ) {
++                      if ( $target.length && !$.mobile.getAttrFixed( $target[0], "data-" + $.mobile.ns + "transition" ) ) {
+                               active = $.mobile.urlHistory.getActive() || {};
+diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/forms/button.js b/libs/js/jquery-mobile-1.2.0/js/widgets/forms/button.js
+index 7b0141b..fe6d81c 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/widgets/forms/button.js
++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/forms/button.js
+@@ -25,8 +25,8 @@ $.widget( "mobile.button", $.mobile.widget, {
+                       o = this.options,
+                       type,
+                       name,
+-                      inline = o.inline || $el.jqmData( "inline" ),
+-                      mini = o.mini || $el.jqmData( "mini" ),
++                      inline = o.inline ||  $.mobile.getAttrFixed( $el[0], "data-" + $.mobile.ns + "inline" ),
++                      mini = o.mini || $.mobile.getAttrFixed( $el[0], "data-" + $.mobile.ns + "mini" ),
+                       classes = "",
+                       $buttonPlaceholder;
+diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/forms/select.js b/libs/js/jquery-mobile-1.2.0/js/widgets/forms/select.js
+index a8b0f9f..9c78a90 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/widgets/forms/select.js
++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/forms/select.js
+@@ -89,9 +89,9 @@ $.widget( "mobile.selectmenu", $.mobile.widget, {
+                       options = this.options,
+-                      inline = options.inline || this.select.jqmData( "inline" ),
+-                      mini = options.mini || this.select.jqmData( "mini" ),
+-                      iconpos = options.icon ? ( options.iconpos || this.select.jqmData( "iconpos" ) ) : false,
++                      inline = options.inline ||  $.mobile.getAttrFixed( this.select[0], "data-" + $.mobile.ns + "inline" ),
++                      mini = options.mini || $.mobile.getAttrFixed( this.select[0], "data-" + $.mobile.ns + "mini" ),
++                      iconpos = options.icon ? ( options.iconpos || $.mobile.getAttrFixed( this.select[0], "data-" + $.mobile.ns + "iconpos" ) ) : false,
+                       // IE throws an exception at options.item() function when
+                       // there is no selected item
+diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/forms/slider.js b/libs/js/jquery-mobile-1.2.0/js/widgets/forms/slider.js
+index c6d4c9b..6729af7 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/widgets/forms/slider.js
++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/forms/slider.js
+@@ -55,9 +55,9 @@ $.widget( "mobile.slider", $.mobile.widget, {
+                       step = window.parseFloat( control.attr( "step" ) || 1 ),
+-                      inlineClass = ( this.options.inline || control.jqmData( "inline" ) === true ) ? " ui-slider-inline" : "",
++                      inlineClass = ( this.options.inline || $.mobile.getAttrFixed( control[0], "data-" + $.mobile.ns + "inline" ) === true ) ? " ui-slider-inline" : "",
+-                      miniClass = ( this.options.mini || control.jqmData( "mini" ) ) ? " ui-slider-mini" : "",
++                      miniClass = ( this.options.mini || $.mobile.getAttrFixed( control[0], "data-" + $.mobile.ns + "min" ) ) ? " ui-slider-mini" : "",
+                       domHandle = document.createElement( 'a' ),
+@@ -65,7 +65,7 @@ $.widget( "mobile.slider", $.mobile.widget, {
+                       domSlider = document.createElement( 'div' ),
+                       slider = $( domSlider ),
+-                      valuebg = control.jqmData( "highlight" ) !== false && cType !== "select" ? (function() {
++                      valuebg = $.mobile.getAttrFixed( control[0], "data-" + $.mobile.ns + "highlight" ) !== false && cType !== "select" ? (function() {
+                               var bg = document.createElement('div');
+                               bg.className = 'ui-slider-bg ' + $.mobile.activeBtnClass + ' ui-btn-corner-all';
+                               return $( bg ).prependTo( slider );
+diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/forms/textinput.js b/libs/js/jquery-mobile-1.2.0/js/widgets/forms/textinput.js
+index 075d35d..9a7765e 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/widgets/forms/textinput.js
++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/forms/textinput.js
+@@ -25,7 +25,7 @@ $.widget( "mobile.textinput", $.mobile.widget, {
+                       o = this.options,
+                       theme = o.theme || $.mobile.getInheritedTheme( this.element, "c" ),
+                       themeclass  = " ui-body-" + theme,
+-                      mini = input.jqmData( "mini" ) === true,
++                      mini = $.mobile.getAttrFixed( input[0], "data-" + $.mobile.ns + "mini" ) === true,
+                       miniclass = mini ? " ui-mini" : "",
+                       focusedEl, clearbtn;
+diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/listview.filter.js b/libs/js/jquery-mobile-1.2.0/js/widgets/listview.filter.js
+index 0519b9a..b1ed1e4 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/widgets/listview.filter.js
++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/listview.filter.js
+@@ -69,7 +69,7 @@ $.mobile.$document.delegate( ":jqmData(role='listview')", "listviewcreate", func
+                               for ( var i = listItems.length - 1; i >= 0; i-- ) {
+                                       item = $( listItems[ i ] );
+-                                      itemtext = item.jqmData( "filtertext" ) || item.text();
++                                      itemtext =  $.mobile.getAttrFixed( item[0], "data-" + $.mobile.ns + "filtertext" ) || item.text();
+                                       if ( item.is( "li:jqmData(role=list-divider)" ) ) {
+diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/listview.js b/libs/js/jquery-mobile-1.2.0/js/widgets/listview.js
+index e46f842..e0d68f7 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/widgets/listview.js
++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/listview.js
+@@ -188,9 +188,9 @@ $.widget( "mobile.listview", $.mobile.widget, {
+               var o = this.options,
+                       $list = this.element,
+                       self = this,
+-                      dividertheme = $list.jqmData( "dividertheme" ) || o.dividerTheme,
+-                      listsplittheme = $list.jqmData( "splittheme" ),
+-                      listspliticon = $list.jqmData( "spliticon" ),
++                      dividertheme = $.mobile.getAttrFixed( $list[0], "data-" + $.mobile.ns + "dividertheme" ) || o.dividerTheme,
++                      listsplittheme =  $.mobile.getAttrFixed( $list[0], "data-" + $.mobile.ns + "splittheme" ),
++                      listspliticon = $.mobile.getAttrFixed( $list[0], "data-" + $.mobile.ns + "spliticon" ),
+                       li = this._getChildrenByTagName( $list[ 0 ], "li", "LI" ),
+                       ol = !!$.nodeName( $list[ 0 ], "ol" ),
+                       jsCount = !$.support.cssPseudoElement,
+@@ -227,12 +227,12 @@ $.widget( "mobile.listview", $.mobile.widget, {
+                       // If we're creating the element, we update it regardless
+                       if ( create || !item.hasClass( "ui-li" ) ) {
+-                              itemTheme = item.jqmData( "theme" ) || o.theme;
++                              itemTheme = $.mobile.getAttrFixed( item[0], "data-" + $.mobile.ns + "theme" ) || o.theme;
+                               a = this._getChildrenByTagName( item[ 0 ], "a", "A" );
+-                              var isDivider = ( item.jqmData( "role" ) === "list-divider" );
++                              var isDivider = ( $.mobile.getAttrFixed( item[0], "data-" + $.mobile.ns + "role" ) === "list-divider" );
+                               if ( a.length && !isDivider ) {
+-                                      icon = item.jqmData( "icon" );
++                                      icon = $.mobile.getAttrFixed( item[0], "data-" + $.mobile.ns + "icon" );
+                                       /* Remove auto populated right-arrow button. */
+                                       if ( icon === undefined ) {
+@@ -258,8 +258,8 @@ $.widget( "mobile.listview", $.mobile.widget, {
+                                               itemClass += " ui-li-has-alt";
+                                               last = a.last();
+-                                              splittheme = listsplittheme || last.jqmData( "theme" ) || o.splitTheme;
+-                                              linkIcon = last.jqmData( "icon" );
++                                              splittheme = listsplittheme || $.mobile.getAttrFixed( last[0], "data-" + $.mobile.ns + "theme" ) || o.splitTheme;
++                                              linkIcon = $.mobile.getAttrFixed( last[0], "data-" + $.mobile.ns + "icon" );
+                                               last.appendTo( item )
+                                                       .attr( "title", last.getEncodedText() )
+@@ -351,7 +351,7 @@ $.widget( "mobile.listview", $.mobile.widget, {
+                       .find( ".ui-li-count" ).each(function() {
+                                       $( this ).closest( "li" ).addClass( "ui-li-has-count" );
+-                              }).addClass( "ui-btn-up-" + ( $list.jqmData( "counttheme" ) || this.options.countTheme) + " ui-btn-corner-all" );
++                              }).addClass( "ui-btn-up-" + ( $.mobile.getAttrFixed( $list[0], "data-" + $.mobile.ns + "counttheme" ) || this.options.countTheme) + " ui-btn-corner-all" );
+               // The idea here is to look at the first image in the list item
+               // itself, and any .ui-link-inherit element it may contain, so we
+@@ -412,8 +412,8 @@ $.widget( "mobile.listview", $.mobile.widget, {
+                               nodeEls = nodeElsFull.length ? nodeElsFull : $( "<span>" + $.trim(parent.contents()[ 0 ].nodeValue) + "</span>" ),
+                               title = nodeEls.first().getEncodedText(),//url limits to first 30 chars of text
+                               id = ( parentUrl || "" ) + "&" + $.mobile.subPageUrlKey + "=" + listId,
+-                              theme = list.jqmData( "theme" ) || o.theme,
+-                              countTheme = list.jqmData( "counttheme" ) || parentList.jqmData( "counttheme" ) || o.countTheme,
++                              theme = $.mobile.getAttrFixed( list[0], "data-" + $.mobile.ns + "theme" ) || o.theme,
++                              countTheme = $.mobile.getAttrFixed( list[0], "data-" + $.mobile.ns + "counttheme" ) || $.mobile.getAttrFixed( parentList[0], "data-" + $.mobile.ns + "counttheme" ) || o.countTheme,
+                               newPage, anchor;
+                       //define hasSubPages for use in later removal
+diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/popup.js b/libs/js/jquery-mobile-1.2.0/js/widgets/popup.js
+index 13cb548..35d1933 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/widgets/popup.js
++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/popup.js
+@@ -873,8 +873,8 @@ define( [ "jquery",
+                       popup.popup( "open", {
+                               x: offset.left + $link.outerWidth() / 2,
+                               y: offset.top + $link.outerHeight() / 2,
+-                              transition: $link.jqmData( "transition" ),
+-                              positionTo: $link.jqmData( "position-to" ),
++                              transition: $.mobile.getAttrFixed( $link[0], "data-" + $.mobile.ns + "transition" ),
++                              positionTo: $.mobile.getAttrFixed( $link[0], "data-" + $.mobile.ns + "position-to" ),
+                               link: $link
+                       });
+               }
+-- 
+1.7.9.5
+
+
diff --git a/libs/patch/0031-JQM-performance-tuning-change-self-init-method-for-j.patch b/libs/patch/0031-JQM-performance-tuning-change-self-init-method-for-j.patch
new file mode 100644 (file)
index 0000000..515b4f4
--- /dev/null
@@ -0,0 +1,135 @@
+From 18454b17fb19e4fa24b151ad377e43252ecf552f Mon Sep 17 00:00:00 2001
+From: Minkyeong Kim <minkyeong.kim@samsung.com>
+Date: Fri, 1 Feb 2013 15:04:58 +0900
+Subject: [PATCH] [JQM] performance tuning : change self-init method for jQM
+ performance
+
+---
+ .../jquery-mobile-1.2.0/js/jquery.mobile.core.js   |   38 ++++++++++++++++++++
+ .../jquery-mobile-1.2.0/js/widgets/collapsible.js  |    6 ++--
+ .../js/widgets/collapsibleSet.js                   |    6 ++--
+ libs/js/jquery-mobile-1.2.0/js/widgets/listview.js |    6 ++--
+ libs/js/jquery-mobile-1.2.0/js/widgets/navbar.js   |    6 ++--
+ 5 files changed, 46 insertions(+), 16 deletions(-)
+
+diff --git a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.core.js b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.core.js
+index f8c3a2d..d8a4b42 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.core.js
++++ b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.core.js
+@@ -345,6 +345,44 @@ define( [ "jquery", "text!../version.txt" ], function( $, __version__ ) {
+       $.find.matchesSelector = function( node, expr ) {
+               return $.find( expr, null, null, [ node ] ).length > 0;
+       };
++
++      $.extend({
++              creatorDict: {},
++
++              delegateSelfInitWithSingleSelector: function( target, useKeepNative ) {
++                      if ( typeof target !== 'function' ) {
++                              return false;
++                      }
++                      var selector = target.prototype.options.initSelector;
++                      var selectorRE = /:jqmData\(role='[A-z\-]+'\)$/;
++                      if ( selectorRE.test(selector) ) {
++                              var firstIdx = selector.indexOf( "'" ) + 1;
++                              var lastIdx = selector.lastIndexOf( "'" );
++                              var key = selector.substring( firstIdx, lastIdx );
++                              if ( !$.creatorDict.hasOwnProperty( key ) ) {
++                                      $.creatorDict[key] = {};
++                                      $.creatorDict[key].target = target;
++                                      if ( useKeepNative === true ) {
++                                              $.creatorDict[key].useKeepNative = useKeepNative;
++                                      }
++                                      return true;
++                              }
++                      }
++                      return false;
++              }
++      });
++
++      //auto self-init widgets
++      $( document ).bind( "pagecreate create", function( e ) {
++              var selector = "*[data-" + $.mobile.ns + "role]";
++              $( selector, e.target ).each( function () {
++                      dataRoleValue = this.getAttribute( "data-role" );
++                      matchedObj = $.creatorDict[dataRoleValue];
++                      if ( matchedObj ) {
++                              matchedObj.target.prototype.enhance( this, matchedObj.useKeepNative );
++                      }
++              });
++      });
+ })( jQuery, this );
+ //>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+ });
+diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/collapsible.js b/libs/js/jquery-mobile-1.2.0/js/widgets/collapsible.js
+index ad1ca3b..26dbb61 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/widgets/collapsible.js
++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/collapsible.js
+@@ -166,10 +166,8 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
+       }
+ });
+-//auto self-init widgets
+-$.mobile.$document.bind( "pagecreate create", function( e ) {
+-      $.mobile.collapsible.prototype.enhanceWithin( e.target );
+-});
++//delegate auto self-init widgets
++$.delegateSelfInitWithSingleSelector( $.mobile.collapsible );
+ })( jQuery );
+ //>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/collapsibleSet.js b/libs/js/jquery-mobile-1.2.0/js/widgets/collapsibleSet.js
+index ebc762d..43975e8 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/widgets/collapsibleSet.js
++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/collapsibleSet.js
+@@ -107,10 +107,8 @@ $.widget( "mobile.collapsibleset", $.mobile.widget, {
+       }
+ });
+-//auto self-init widgets
+-$.mobile.$document.bind( "pagecreate create", function( e ) {
+-      $.mobile.collapsibleset.prototype.enhanceWithin( e.target );
+-});
++//delegate auto self-init widgets
++$.delegateSelfInitWithSingleSelector( $.mobile.collapsibleset );
+ })( jQuery );
+ //>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/listview.js b/libs/js/jquery-mobile-1.2.0/js/widgets/listview.js
+index e0d68f7..58a2d04 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/widgets/listview.js
++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/listview.js
+@@ -520,10 +520,8 @@ $.widget( "mobile.listview", $.mobile.widget, {
+       }
+ });
+-//auto self-init widgets
+-$.mobile.$document.bind( "pagecreate create", function( e ) {
+-      $.mobile.listview.prototype.enhanceWithin( e.target );
+-});
++//delegate auto self-init widgets
++$.delegateSelfInitWithSingleSelector( $.mobile.listview );
+ })( jQuery );
+ //>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/navbar.js b/libs/js/jquery-mobile-1.2.0/js/widgets/navbar.js
+index 29c5057..0b52a06 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/widgets/navbar.js
++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/navbar.js
+@@ -51,10 +51,8 @@ $.widget( "mobile.navbar", $.mobile.widget, {
+       }
+ });
+-//auto self-init widgets
+-$.mobile.$document.bind( "pagecreate create", function( e ) {
+-      $.mobile.navbar.prototype.enhanceWithin( e.target );
+-});
++//delegate auto self-init widgets
++$.delegateSelfInitWithSingleSelector( $.mobile.navbar );
+ })( jQuery );
+ //>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+-- 
+1.7.9.5
+
+
index c334bbb..171d3cd 100644 (file)
@@ -1,5 +1,5 @@
 Name:       web-ui-fw
-Version:    0.2.16
+Version:    0.2.18
 Release:    0
 Summary:    Tizen Web UI Framework Library
 Group:      Development/Other
@@ -83,6 +83,57 @@ Summary:    Tizen Web UI Framework Demo Application: tizen winset demo
 
 ###############################
 %changelog
+
+* Thu Mar 7 2013 Youmin Ha <youmin.ha@samsung.com> 0.2.18
+       - build: Fix Makefile to add globalize to the minified lib
+       - build-tools : upgrade less to v1.3.3
+       - demos : change normal js path to minified js
+       - Theme : remove reduantant less - dayselector, optionheader, nocontents
+       - multimediaview : fix full-screen mode.
+       - multimediaview : fix 'width', 'height' and 'fullScreen' methods
+       - Extendablelist: Added min-height "load more button" in listitem
+       - virtualgrid: adjusts VI effect for an overflow action
+       - ControlGroup : change ellipsis font color (press/normal)
+       - multimediaview: Add an error message to Multimediaview
+       - virtualgrid: adjusts triple flick gesture
+       - scrollview: add function for getting width of view
+       - scrollview: adds support x axis gesture scroll
+       - multimediaview : fix audio control
+       - tabbar : tabbar slide animation change
+       - TizenWinsetDemo : 2line-text demo bug fix
+       - collapsible: Fix demo to show radio button correctly in the collapsible list
+       - collapsible: Set listitem position to relative
+       - UnitTC: added list divider unit test
+       - Style: unnecessary color codes have been deleted and modified
+       - build: Module build implementation
+       - UnitTC: Additional unit testcases have been added
+       - listview : bug fix
+       - Naviframe : remove back button's hover effect
+       - TizenDemo : remove back button
+       - Transition: added more-button vi
+       - pinch: added new event called pinch
+       - Popup: css word-wrap:break-word has been added
+       - virtualgrid: memory leak fix
+       - progress: set to init state at pending bar
+       - progress: add margin of top/bottom
+       - unit-test: split progress test and progressbar test
+       - Tizen-winset: Context popup sample page guide text has been changed
+       - multimediaview: fix the height of widget when full-screen mode
+       - JQM: performance tuning
+
+* Tue Feb 19 2013 Minkyu Kang <mk7.kang@samsung.com> 0.2.17
+       - DialogueList : delete border top value / add sample's text ellipsis
+       - Tokentextarea: Add scroll-to-top for Grouping On/Off regarding #N_SE-24877
+       - Multimediaview: Fix mute function
+       - Tizen-winset: list vi index guide textbox has been removed
+       - Tizen-winset: custom button texts have been changed
+       - slider: move popup div to out of content
+       - TizenWinset: disable context popup in multimediaview
+       - Swipe: wrong style name has been fixed
+       - demo: add the sample at dialogue list
+       - listview: Add ui-li-has-right-btn class with toggleswitch
+       - WinsetDemo : change wrong title name
+
 * Mon Jan 28 2013 Youmin Ha <youmin.ha@samsung.com> 0.2.16
        - demo: checkbox: reduce button's width
        - tabbar : delete right/left tab animation color
similarity index 85%
rename from src/widgets/common/js/jquery.mobile.label.js
rename to src/js/jquery.mobile.label.js
index 2199614..365d444 100644 (file)
@@ -1,3 +1,11 @@
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+//>>description: Add markup for labels
+//>>label: Label
+//>>group: Tizen:Core
+
+define( [ ], function ( ) {
+//>>excludeEnd("jqmBuildExclude");
+
 /*
  *
  * This software is licensed under the MIT licence (as defined by the OSI at
@@ -28,6 +36,7 @@
 
 // Add markup for labels
 
+
 (function($, undefined) {
 
 $(document).bind("pagecreate create", function(e) {
@@ -38,3 +47,8 @@ $(document).bind("pagecreate create", function(e) {
 });
 
 })(jQuery);
+
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+} );
+//>>excludeEnd("jqmBuildExclude");
+
similarity index 94%
rename from src/widgets/common/js/jquery.mobile.tizen.clrlib.js
rename to src/js/jquery.mobile.tizen.clrlib.js
index c243c3b..1f8eb2c 100644 (file)
@@ -1,3 +1,11 @@
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+//>>description: Color code converter
+//>>label: Color library
+//>>group: Tizen:Core
+
+define( [ ], function ( ) {
+//>>excludeEnd("jqmBuildExclude");
+
 ensureNS("jQuery.mobile.tizen.clrlib");
 
 jQuery.extend( jQuery.mobile.tizen.clrlib, 
@@ -210,3 +218,7 @@ jQuery.extend( jQuery.mobile.tizen.clrlib,
         return $.mobile.tizen.clrlib.HSVToHSL($.mobile.tizen.clrlib.RGBToHSV(rgb));
     }
 });
+
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+} );
+//>>excludeEnd("jqmBuildExclude");
@@ -1,3 +1,11 @@
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+//>>description: jQuery Mobile configuration for Tizen widgets
+//>>label: Configuration
+//>>group: Tizen:Core
+
+define( [ ], function ( ) {
+//>>excludeEnd("jqmBuildExclude");
+
 /*
  * set TIZEN specific configures
  */
@@ -18,3 +26,8 @@
        $.mobile.buttonMarkup.hoverDelay = 0;
 
 })( jQuery, this );
+
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+} );
+//>>excludeEnd("jqmBuildExclude");
+
similarity index 92%
rename from src/widgets/common/js/jquery.mobile.tizen.core.js
rename to src/js/jquery.mobile.tizen.core.js
index ac8beb7..28adb3c 100644 (file)
@@ -1,3 +1,11 @@
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+//>>description: Tizen core library
+//>>label: Tizen core
+//>>group: Tizen:Core
+
+define( [ 'jquery.mobile.core', 'jquery.mobile.tizen.configure', 'util/ensurens' ], function ( ) {
+//>>excludeEnd("jqmBuildExclude");
+
 /*
  * jQuery Mobile Widget @VERSION
  *
@@ -149,3 +157,7 @@ jQuery.extend(jQuery.mobile.tizen, {
 });
 
 })();
+
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+} );
+//>>excludeEnd("jqmBuildExclude");
similarity index 97%
rename from src/loader/loader.js
rename to src/js/jquery.mobile.tizen.loader.js
index 8378f32..d884eb6 100644 (file)
@@ -1,3 +1,11 @@
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+//>>description: Loader doing theme loading, viewport setting, globalize loading, etc.
+//>>label: Loader
+//>>group: Tizen:Core
+
+define( [ 'jquery.mobile.tizen.core' ], function ( ) {
+//>>excludeEnd("jqmBuildExclude");
+
 /**
  * @class core
  * loader.js
@@ -458,7 +466,7 @@ If developers do not give a viewport meta tag, Tizen Web UI Framework automatica
        };
 
        function export2TizenNS ( $, tizen ) {
-               if ( undefined == typeof $.tizen ) {
+               if ( !$.tizen ) {
                        $.tizen = { };
                }
 
@@ -485,3 +493,7 @@ If developers do not give a viewport meta tag, Tizen Web UI Framework automatica
        });
 
 } ( jQuery, window.Globalize, window ) );
+
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+} );
+//>>excludeEnd("jqmBuildExclude");
@@ -1,3 +1,11 @@
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+//>>description: Loads widget's prototype
+//>>label: Widget prototype loader
+//>>group: Tizen:Core
+
+define( [ ], function ( ) {
+//>>excludeEnd("jqmBuildExclude");
+
 (function($, undefined) {
 
 ensureNS("jQuery.mobile.tizen");
@@ -138,3 +146,7 @@ jQuery.extend( jQuery.mobile.tizen,
     }
 });
 })(jQuery);
+
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+} );
+//>>excludeEnd("jqmBuildExclude");
@@ -1,3 +1,11 @@
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+//>>description: Implements scroll by javascript
+//>>label: Scrollview
+//>>group: Tizen:Core
+
+define( [ ], function ( ) {
+//>>excludeEnd("jqmBuildExclude");
+
 /*
 * jQuery Mobile Framework : scrollview plugin
 * Copyright (c) 2010 Adobe Systems Incorporated - Kin Blas (jblas@adobe.com)
                        return this._$view.height();
                },
 
+               _getViewWidth: function () {
+                       return this._$view.width();
+               },
+
                _makePositioned: function ( $ele ) {
                        if ( $ele.css("position") === "static" ) {
                                $ele.css( "position", "relative" );
 
                        if ( ht ) {
                                c = this._$clip.width();
-                               v = this._$view.width();
+                               v = this._getViewWidth();
 
                                if ( (( this._sx === 0 && speedX > 0 ) ||
                                        ( this._sx === -(v - c) && speedX < 0 )) &&
                                        self._gesture_dir = 0;
                                        self._gesture_count = 0;
                                        self._gesture_timer = undefined;
+                               },
+                               direction = {
+                                       top: 0,
+                                       bottom: 1,
+                                       left: 2,
+                                       right: 3
                                };
 
-                       if ( !sy ) {
+                       if ( !sy && !sx ) {
                                return false;
                        }
 
-                       dir = sy > 0 ? 1 : -1;
+                       if ( Math.abs( sx ) > Math.abs( sy ) ) {
+                               dir = sx > 0 ? direction.left : direction.right;
+                       } else {
+                               dir = sy > 0 ? direction.top : direction.bottom;
+                       }
 
                        if ( !this._gesture_timer ) {
                                this._gesture_count = 1;
                        this._gesture_count++;
 
                        if ( this._gesture_count === 3 ) {
-                               if ( dir > 0 ) {
-                                       this.scrollTo( 0, 0, this.options.overshootDuration );
-                               } else {
-                                       this.scrollTo( 0, -( this._getViewHeight() - this._$clip.height() ),
+                               switch ( dir ) {
+                               case direction.top:
+                                       this.scrollTo( this._sx, 0, this.options.overshootDuration );
+                                       break;
+                               case direction.bottom:
+                                       this.scrollTo( this._sx, -( this._getViewHeight() - this._$clip.height() ),
+                                                       this.options.overshootDuration );
+                                       break;
+                               case direction.left:
+                                       this.scrollTo( 0, this._sy, this.options.overshootDuration );
+                                       break;
+                               case direction.right:
+                                       this.scrollTo( -( this._getViewWidth() - this._$clip.width() ), this._sy,
                                                        this.options.overshootDuration );
+                                       break;
                                }
+
                                reset();
+                               this._didDrag = true;
 
                                return true;
                        }
        });
 
 }( jQuery, window, document ) );
+
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+} );
+//>>excludeEnd("jqmBuildExclude");
similarity index 84%
rename from src/widgets/common/js/ensurens.js
rename to src/js/util/ensurens.js
index 08732d6..71c8c83 100644 (file)
@@ -1,3 +1,11 @@
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+//>>description: Make namespace for modules
+//>>label: Ensurens
+//>>group: Tizen:Utilities
+
+define( [ ], function ( ) {
+//>>excludeEnd("jqmBuildExclude");
+
 /*
  *
  * This software is licensed under the MIT licence (as defined by the OSI at
@@ -38,3 +46,7 @@ function ensureNS(ns) {
         eval (nsSoFar + " = " + nsSoFar + " || {};");
     }
 }
+
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+} );
+//>>excludeEnd("jqmBuildExclude");
similarity index 84%
rename from src/widgets/datetimepicker/js/range.js
rename to src/js/util/range.js
index e8c7420..3291002 100644 (file)
@@ -1,3 +1,11 @@
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+//>>description: Makes array with given range
+//>>label: Range
+//>>group: Tizen:Utilities
+
+define( [ ], function ( ) {
+//>>excludeEnd("jqmBuildExclude");
+
 /*
  * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL licenses
  * http://phpjs.org/functions/range
@@ -54,3 +62,6 @@ function range( low, high, step ) {
     return matrix;
 }
 
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+} );
+//>>excludeEnd("jqmBuildExclude");
@@ -1,3 +1,11 @@
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+//>>description: Tizen button
+//>>label: Button
+//>>group: Tizen:Widgets
+
+define( [ ], function ( ) {
+//>>excludeEnd("jqmBuildExclude");
+
 /**
        @class Button
        The button widget shows a control on the screen that you can use to generate an action event when it is pressed and released. This widget is coded with standard HTML anchor and input elements and then enhanced by jQueryMobile to make it more attractive and usable on a mobile device. Buttons can be used in Tizen as described in the jQueryMobile documentation for buttons.
@@ -22,3 +30,7 @@
        Defines an icon for a button. Tizen supports 12 icon styles: reveal, closed, opened, info, rename, call, warning, plus, minus, cancel, send, and favorite.
 
 */
+
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+} );
+//>>excludeEnd("jqmBuildExclude");
@@ -1,3 +1,11 @@
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);\r
+//>>description: Checkbox widget\r
+//>>label: Checkbox\r
+//>>group: Tizen:Widgets\r
+\r
+define( [ ], function ( ) {\r
+//>>excludeEnd("jqmBuildExclude");\r
+\r
 /**\r
        @class Checkbox\r
        The check box widget shows a list of options on the screen where one or more can be selected. Check boxes can be used in Tizen as described in the jQueryMobile documentation for check boxes.<br/> To add a check box widget to the application, use the following code:\r
@@ -14,4 +22,8 @@
 /**\r
        @property {String} class\r
        Defines the check box style. <br/> The default value is check. If the value is set to favorite, a star-shaped check box is created.\r
-*/
\ No newline at end of file
+*/\r
+\r
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);\r
+} );\r
+//>>excludeEnd("jqmBuildExclude");\r
@@ -1,3 +1,11 @@
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+//>>description: Container widget showing children circulary
+//>>label: Circularview
+//>>group: Tizen:Widgets
+
+define( [ '../jquery.mobile.tizen.scrollview' ], function ( ) {
+//>>excludeEnd("jqmBuildExclude");
+
 /* ***************************************************************************
  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
  *
        } );
 
 }( jQuery, window, document ) ); // End Component
+
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+} );
+//>>excludeEnd("jqmBuildExclude");
@@ -1,3 +1,11 @@
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+//>>description: Shows date and time, and make them able to be changed by user
+//>>label: Datetime picker
+//>>group: Tizen:Widgets
+
+define( [ 'jquery.mobile.tizen.widgetex', 'jquery.mobile.tizen.popupwindow', 'jquery.mobile.tizen.popupwindow.ctxpopup' ], function ( ) {
+//>>excludeEnd("jqmBuildExclude");
+
 /*global Globalize:false, range:false, regexp:false*/
 /*
  * jQuery Mobile Widget @VERSION
        });
 
 } ( jQuery, this ) );
+
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+} );
+//>>excludeEnd("jqmBuildExclude");
@@ -1,3 +1,11 @@
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+//>>description: Listview which can be extended more and more
+//>>label: Extendable list
+//>>group: Tizen:Widgets
+
+define( [ '../jquery.mobile.tizen.scrollview' ], function ( ) {
+//>>excludeEnd("jqmBuildExclude");
+
 /****************************************************************************
  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
  *
                                more_items_to_load = t._numItemData - t._lastIndex;
                                num_next_load_items = ( o.extenditems <= more_items_to_load ) ? o.extenditems : more_items_to_load;
                                htmlData = myTemplate.tmpl( { NUM_MORE_ITEMS : num_next_load_items } );
-
-                               $( o.id ).append( $( htmlData ).attr( 'id', "load_more_message" ) );
+                               // Button minimum height(37px)
+                               $( o.id ).append( $( htmlData ).attr( 'id', "load_more_message" ).css( 'min-height' , "37px") );
                        }
 
                        $( o.id ).trigger( "create" );
                                        more_items_to_load = t._numItemData - t._lastIndex;
                                        num_next_load_items = ( o.extenditems <= more_items_to_load) ? o.extenditems : more_items_to_load;
                                        htmlData = myTemplate.tmpl( { NUM_MORE_ITEMS : num_next_load_items } );
-
-                                       $( o.id ).append( $( htmlData ).attr( 'id', "load_more_message" ) );
+                                       // Button minimum height(37px)
+                                       $( o.id ).append( $( htmlData ).attr( 'id', "load_more_message" ).css( 'min-height' , "37px") );
 
                                        $( "#load_more_message" ).live( "click", t, t._loadmore );
                                } else {
        });
 
 }( jQuery ));
+
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+} );
+//>>excludeEnd("jqmBuildExclude");
@@ -1,3 +1,11 @@
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+//>>description: Shows list index and scroll to the index directly
+//>>label: Fastscroll
+//>>group: Tizen:Widgets
+
+define( [ '../jquery.mobile.tizen.scrollview' ], function ( ) {
+//>>excludeEnd("jqmBuildExclude");
+
 /*
  * jQuery Mobile Widget @VERSION
  *
        } );
 
 } ( jQuery ) );
+
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+} );
+//>>excludeEnd("jqmBuildExclude");
@@ -1,3 +1,11 @@
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+//>>description: Shows images one by one, and moves them by flicking
+//>>label: Gallery
+//>>group: Tizen:Widgets
+
+define( [ ], function ( ) {
+//>>excludeEnd("jqmBuildExclude");
+
 /* ***************************************************************************
  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
  *
        } );
 
 }( jQuery, this ) );
+
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+} );
+//>>excludeEnd("jqmBuildExclude");
@@ -1,3 +1,11 @@
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+//>>description: Divider listitem in listview
+//>>label: List divider
+//>>group: Tizen:Widgets
+
+define( [ ], function ( ) {
+//>>excludeEnd("jqmBuildExclude");
+
 /* ***************************************************************************
 * style : normal, check
 * option :
@@ -73,3 +81,7 @@
                $( $.tizen.listdivider.prototype.options.initSelector, e.target ).listdivider();
        });
 }( jQuery ) );
+
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+} );
+//>>excludeEnd("jqmBuildExclude");
@@ -1,3 +1,11 @@
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+//>>description: Shows multimedia and its controls
+//>>label: Multimedia view
+//>>group: Tizen:Widgets
+
+define( [ '../jquery.mobile.tizen.scrollview' ], function ( ) {
+//>>excludeEnd("jqmBuildExclude");
+
 /* ***************************************************************************
  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
  *
                        var self = this,
                                view = self.element,
                                viewElement = view[0],
+                               isVideo = ( viewElement.nodeName === "VIDEO" ),
                                option = self.options,
                                parentTheme = $.mobile.getInheritedTheme( view, "s" ),
                                theme = option.theme || parentTheme,
-                               role = "multimediaview",
+                               width = viewElement.style.getPropertyValue( "width" ) || "",
+                               wrap = $( "<div class='ui-multimediaview-wrap ui-multimediaview-" + theme + "'>" ),
                                control = null;
 
                        $.extend( this, {
                                role: null,
-                               isControlHide: false,
                                controlTimer: null,
                                isVolumeHide: true,
-                               isVertical: true,
-                               backupView: null
+                               backupView: null,
+                               _reserveVolume: -1,
+                               _isVideo: isVideo
                        });
 
-                       self.role = role;
                        view.addClass( "ui-multimediaview" );
                        control = self._createControl();
+                       control.hide();
+
                        control.find( ".ui-button" ).each( function ( index ) {
                                $( this ).buttonMarkup( { corners: true, theme: theme, shadow: true } );
                        });
 
-                       if ( view[0].nodeName === "VIDEO" ) {
-                               control.addClass( "ui-" + role + "-video" );
+                       view.wrap( wrap ).after( control );
+
+                       if ( isVideo ) {
+                               control.addClass( "ui-multimediaview-video" );
+                       } else {
+                               self.width( width );
+                               self.options.fullScreen = false;
                        }
 
-                       control.hide();
-                       view.wrap( [ "<div class='ui-", role, "-wrap ui-", role , "-", theme, "'>" ].join( "" ) ).after( control );
                        if ( option.controls && view.attr( "controls" ) ) {
                                view.removeAttr( "controls" );
                        }
                },
 
                _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._resizeControl();
                        this._updateSeekBar();
                        this._updateVolumeState();
                },
 
-               _resizeControl: function ( offset, width, height ) {
+               _resizeControl: function () {
                        var self = this,
                                view = self.element,
                                viewElement = view[0],
-                               control = view.parent().find( ".ui-multimediaview-control" ),
+                               isVideo = self._isVideo,
+                               wrap = view.parent( ".ui-multimediaview-wrap" ),
+                               control = wrap.find( ".ui-multimediaview-control" ),
                                buttons = control.find( ".ui-button" ),
                                playpauseButton = control.find( ".ui-playpausebutton" ),
                                seekBar = control.find( ".ui-seekbar" ),
                                timestampLabel = control.find( ".ui-timestamplabel" ),
                                volumeControl = control.find( ".ui-volumecontrol" ),
                                volumeBar = volumeControl.find( ".ui-volumebar" ),
-                               controlWidth = width,
-                               controlHeight = control.outerHeight( true ),
+                               width = ( isVideo ? view.width() : wrap.width() ),
+                               height = ( isVideo ? view.height() : control.height() ),
+                               offset = view.offset(),
+                               controlHeight = control.height(),
                                availableWidth = 0,
                                controlOffset = null;
 
                        if ( control ) {
-                               if ( view[0].nodeName === "VIDEO" ) {
+                               if ( isVideo ) {
                                        controlOffset = control.offset();
                                        controlOffset.left = offset.left;
                                        controlOffset.top = offset.top + height - controlHeight;
                                        control.offset( controlOffset );
                                }
-
-                               control.width( controlWidth );
+                               control.width( width );
                        }
 
                        if ( seekBar ) {
                },
 
                _resizeFullscreen: function ( isFullscreen ) {
+                       if ( !this._isVideo ) {
+                               return;
+                       }
+
                        var self = this,
                                view = self.element,
-                               parent = view.parent(),
-                               control = view.parent().find( ".ui-multimediaview-control" ),
+                               viewElement = view[0],
+                               wrap = view.parent( ".ui-multimediaview-wrap" ),
+                               control = wrap.find( ".ui-multimediaview-control" ),
+                               fullscreenButton = control.find( ".ui-fullscreenbutton" ),
+                               currentPage = $( ".ui-page-active" ),
                                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" ),
+                               body = $( "body" )[0],
+                               header = currentPage.children( ".ui-header" ),
+                               footer = currentPage.children( ".ui-footer" ),
                                docWidth = 0,
                                docHeight = 0;
 
                        if ( isFullscreen ) {
                                if ( !self.backupView ) {
                                        self.backupView = {
-                                               width: view[0].style.getPropertyValue( "width" ) || "",
-                                               height: view[0].style.getPropertyValue( "height" ) || "",
+                                               width: viewElement.style.getPropertyValue( "width" ) || "",
+                                               height: viewElement.style.getPropertyValue( "height" ) || "",
                                                position: view.css( "position" ),
-                                               zindex: view.css( "z-index" )
+                                               zindex: view.css( "z-index" ),
+                                               wrapHeight: wrap[0].style.getPropertyValue( "height" ) || ""
                                        };
                                }
-                               docWidth = $( "body" )[0].clientWidth;
-                               docHeight = $( "body" )[0].clientHeight;
+                               docWidth = body.clientWidth;
+                               docHeight = body.clientHeight;
+
+                               header.hide();
+                               footer.hide();
+                               view.parents().each( function ( e ) {
+                                       var element = $( this );
+                                       element.addClass( "ui-fullscreen-parents" )
+                                               .siblings()
+                                               .addClass( "ui-multimediaview-siblings-off" );
+                               });
+                               this._fitContentArea( currentPage );
+                               fullscreenButton.removeClass( "ui-fullscreen-on" ).addClass( "ui-fullscreen-off" );
 
                                view.width( docWidth ).height( docHeight - 1 );
-                               view.closest(".ui-multimediaview-wrap").height( docHeight - 1 );
-                               view.addClass( "ui-" + self.role + "-fullscreen" );
+                               wrap.height( docHeight - 1 );
                                view.offset( {
                                        top: 0,
                                        left: 0
-                               });
+                               }).addClass( "ui-multimediaview-fullscreen" );
                        } else {
                                if ( !self.backupView ) {
                                        return;
                                }
 
-                               view.removeClass( "ui-" + self.role + "-fullscreen" );
+                               header.show();
+                               footer.show();
+                               view.parents().each( function ( e ) {
+                                       var element = $( this );
+                                       element.removeClass( "ui-fullscreen-parents" )
+                                               .siblings()
+                                               .removeClass( "ui-multimediaview-siblings-off" );
+                               });
+                               this._fitContentArea( currentPage );
+                               fullscreenButton.removeClass( "ui-fullscreen-off" ).addClass( "ui-fullscreen-on" );
+
+                               wrap.css( "height", self.backupView.wrapHeight );
                                view.css( {
                                        "width": self.backupView.width,
                                        "height": self.backupView.height,
                                        "position": self.backupView.position,
                                        "z-index": self.backupView.zindex
-                               });
-                               view.closest(".ui-multimediaview-wrap").css( "height", "" );
+                               }).removeClass( "ui-multimediaview-fullscreen" );
                                self.backupView = null;
                        }
-                       parent.show();
                },
 
                _addEvent: function () {
                                view = self.element,
                                option = self.options,
                                viewElement = view[0],
-                               control = view.parent().find( ".ui-multimediaview-control" ),
+                               isVideo = self._isVideo,
+                               control = view.parent( ".ui-multimediaview-wrap" ).find( ".ui-multimediaview-control" ),
                                playpauseButton = control.find( ".ui-playpausebutton" ),
                                timestampLabel = control.find( ".ui-timestamplabel" ),
                                durationLabel = control.find( ".ui-durationlabel" ),
                                volumeControl = control.find( ".ui-volumecontrol" ),
                                volumeBar = volumeControl.find( ".ui-volumebar" ),
                                volumeGuide = volumeControl.find( ".ui-guide" ),
-                               volumeHandle = volumeControl.find( ".ui-handler" ),
+                               volumeHandle = volumeControl.find( ".ui-handle" ),
                                fullscreenButton = control.find( ".ui-fullscreenbutton" ),
                                seekBar = control.find( ".ui-seekbar" ),
                                durationBar = seekBar.find( ".ui-duration" ),
-                               currenttimeBar = seekBar.find( ".ui-currenttime" );
+                               currenttimeBar = seekBar.find( ".ui-currenttime" ),
+                               $document = $( document );
 
-                       $( document ).unbind( ".multimediaview" ).bind( "pagechange.multimediaview", function ( e ) {
+                       $document.unbind( ".multimediaview" ).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 ( option.fullScreen ) {
+                                       self.fullScreen( !option.fullScreen );
+                               }
+
                                if ( viewElement.played.length !== 0 ) {
                                        viewElement.pause();
-                                       control.hide();
                                }
                        });
 
                                        self._fitContentArea( $page );
                                }
 
-                               self._resize();
+                               if ( control.css( "display" ) !== "none" ) {
+                                       self._resize();
+                               }
                        });
 
                        view.bind( "loadedmetadata.multimediaview", function ( e ) {
                                        self.stop();
                                }
                        }).bind( "volumechange.multimediaview", function ( e ) {
-                               if ( viewElement.volume < 0.1 ) {
-                                       viewElement.muted = true;
+                               if ( viewElement.muted && viewElement.volume > 0.1 ) {
+                                       volumeButton.removeClass( "ui-volume-icon" ).addClass( "ui-mute-icon" );
+                                       self._reserveVolume = viewElement.volume;
+                                       viewElement.volume = 0;
+                               } else if ( self._reserveVolume !== -1 && !viewElement.muted ) {
+                                       volumeButton.removeClass( "ui-mute-icon" ).addClass( "ui-volume-icon" );
+                                       viewElement.volume = self._reserveVolume;
+                                       self._reserveVolume = -1;
+                               } else if ( viewElement.volume < 0.1 ) {
                                        volumeButton.removeClass( "ui-volume-icon" ).addClass( "ui-mute-icon" );
                                } else {
-                                       viewElement.muted = false;
                                        volumeButton.removeClass( "ui-mute-icon" ).addClass( "ui-volume-icon" );
                                }
 
                                        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 ) {
+                       }).bind( "click.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();
-                                       }
-                               });
+                               control.fadeToggle( "fast" );
+                               self._resize();
+                       }).bind( "multimediaviewinit", function ( e ) {
+                               if ( option.controls ) {
+                                       control.show();
+                               }
                                self._resize();
                        });
 
-                       playpauseButton.bind( "vclick.multimediaview", function () {
+                       playpauseButton.bind( "click.multimediaview", function () {
                                self._endTimer();
 
                                if ( viewElement.paused ) {
                                        viewElement.pause();
                                }
 
-                               if ( self.options.mediatype == "video" ) {
+                               if ( isVideo ) {
                                        self._startTimer();
                                }
                        });
 
-                       fullscreenButton.bind( "vclick.multimediaview", function ( e ) {
+                       fullscreenButton.bind( "click.multimediaview", function ( e ) {
+                               e.preventDefault();
                                self.fullScreen( !self.options.fullScreen );
-                               control.fadeIn( "fast" );
+                               control.fadeIn( "fast", function () {
+                                       self._resize();
+                               });
                                self._endTimer();
-                               e.preventDefault();
                                e.stopPropagation();
                        });
 
                                self._endTimer();
 
                                e.preventDefault();
-                               e.stopPropagation();
 
-                               $( document ).bind( "vmousemove.multimediaview", function ( e ) {
+                               $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" );
+                                       $document.unbind( "vmousemove.multimediaview vmouseup.multimediaview" );
                                        if ( viewElement.paused ) {
                                                viewElement.pause();
                                        } else {
                                });
                        });
 
-                       volumeButton.bind( "vclick.multimediaview", function () {
+                       volumeButton.bind( "click.multimediaview", function () {
                                if ( self.isVolumeHide ) {
                                        var view = self.element,
                                                volume = viewElement.volume;
 
                                        self.isVolumeHide = false;
+                                       volumeControl.fadeIn( "fast", function () {
+                                               self._updateVolumeState();
+                                               self._updateSeekBar();
+                                       });
                                        self._resize();
-                                       volumeControl.fadeIn( "fast" );
-                                       self._updateVolumeState();
-                                       self._updateSeekBar();
                                } else {
                                        self.isVolumeHide = true;
                                        volumeControl.fadeOut( "fast", function () {
                                                self._resize();
                                        });
-                                       self._updateSeekBar();
                                }
                        });
 
                                self._setVolume( currentVolume.toFixed( 2 ) );
 
                                e.preventDefault();
-                               e.stopPropagation();
 
-                               $( document ).bind( "vmousemove.multimediaview", function ( e ) {
+                               $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();
-                                       }
+                                       $document.unbind( "vmousemove.multimediaview vmouseup.multimediaview" );
                                });
                        });
                },
 
                _removeEvent: function () {
-                       var self = this,
-                               view = self.element,
-                               control = view.parent().find( ".ui-multimediaview-control" ),
+                       var view = this.element,
+                               control = view.parent( ".ui-multimediaview-wrap" ).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" );
+                               volumeHandle = volumeControl.find( ".ui-handle" );
 
                        view.unbind( ".multimediaview" );
                        playpauseButton.unbind( ".multimediaview" );
                },
 
                _createControl: function () {
-                       var self = this,
-                               view = self.element,
-                               control = $( "<span></span>" ).addClass( "ui-" + self.role + "-control" ),
+                       var view = this.element,
+                               viewElement = view[0],
+                               control = $( "<span></span>" ).addClass( "ui-multimediaview-control" ),
                                playpauseButton = $( "<span></span>" ).addClass( "ui-playpausebutton ui-button" ),
-                               seekBar = $( "<span></span>" ).addClass( "ui-seekbar" ),
+                               seekBar = $( "<span></span>" ).addClass( "ui-seekbar ui-multimediaview-bar" ),
                                timestampLabel = $( "<span><p>00:00:00</p></span>" ).addClass( "ui-timestamplabel" ),
                                durationLabel = $( "<span><p>00:00:00</p></span>" ).addClass( "ui-durationlabel" ),
                                volumeButton = $( "<span></span>" ).addClass( "ui-volumebutton ui-button" ),
                                volumeControl = $( "<span></span>" ).addClass( "ui-volumecontrol" ),
-                               volumeBar = $( "<div></div>" ).addClass( "ui-volumebar" ),
-                               volumeGuide = $( "<span></span>" ).addClass( "ui-guide" ),
-                               volumeValue = $( "<span></span>" ).addClass( "ui-value" ),
-                               volumeHandle = $( "<span></span>" ).addClass( "ui-handler" ),
+                               volumeBar = $( "<div></div>" ).addClass( "ui-volumebar ui-multimediaview-bar" ),
+                               volumeGuide = $( "<span></span>" ).addClass( "ui-guide ui-multimediaview-bar-bg" ),
+                               volumeValue = $( "<span></span>" ).addClass( "ui-value ui-multimediaview-bar-highlight" ),
+                               volumeHandle = $( "<span></span>" ).addClass( "ui-handle" ),
                                fullscreenButton = $( "<span></span>" ).addClass( "ui-fullscreenbutton ui-button" ),
-                               durationBar = $( "<span></span>" ).addClass( "ui-duration" ),
-                               currenttimeBar = $( "<span></span>" ).addClass( "ui-currenttime" );
+                               durationBar = $( "<span></span>" ).addClass( "ui-duration ui-multimediaview-bar-bg" ),
+                               currenttimeBar = $( "<span></span>" ).addClass( "ui-currenttime ui-multimediaview-bar-highlight" );
 
                        seekBar.append( durationBar ).append( currenttimeBar ).append( durationLabel ).append( timestampLabel );
 
                        playpauseButton.addClass( "ui-play-icon" );
-                       volumeButton.addClass( view[0].muted ? "ui-mute-icon" : "ui-volume-icon" );
+                       volumeButton.addClass( viewElement.muted ? "ui-mute-icon" : "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" ) {
+                       if ( this._isVideo ) {
                                $( fullscreenButton ).addClass( "ui-fullscreen-on" );
                                control.append( fullscreenButton );
                        }
 
                        var self = this,
                                view = self.element,
-                               control = view.parent().find( ".ui-multimediaview-control" ),
+                               control = view.parent( ".ui-multimediaview-wrap" ).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" );
                },
 
                _convertTimeFormat: function ( systime ) {
+                       if ( !$.isNumeric( systime ) ) {
+                               return "Playback Error";
+                       }
+
                        var ss = parseInt( systime % 60, 10 ).toString(),
                                mm = parseInt( ( systime / 60 ) % 60, 10 ).toString(),
                                hh = parseInt( systime / 3600, 10 ).toString(),
                },
 
                _updateSeekBar: function ( currenttime ) {
-                       var self = this,
-                               view = self.element,
-                               duration = view[0].duration,
-                               control = view.parent().find( ".ui-multimediaview-control" ),
+                       var view = this.element,
+                               viewElement = view[0],
+                               duration = viewElement.duration,
+                               control = view.parent( ".ui-multimediaview-wrap" ).find( ".ui-multimediaview-control" ),
                                seekBar = control.find(  ".ui-seekbar"  ),
                                durationBar = seekBar.find( ".ui-duration" ),
                                currenttimeBar = seekBar.find( ".ui-currenttime" ),
                                durationHeight = durationBar.height(),
                                timebarWidth = 0;
 
-                       if ( typeof currenttime == "undefined" ) {
-                               currenttime = view[0].currentTime;
+                       if ( typeof currenttime === "undefined" ) {
+                               currenttime = viewElement.currentTime;
                        }
                        timebarWidth = parseInt( currenttime / duration * durationWidth, 10 );
                        durationBar.offset( durationOffset );
                        currenttimeBar.offset( durationOffset ).width( timebarWidth );
-                       timestampLabel.find( "p" ).text( self._convertTimeFormat( currenttime ) );
+                       timestampLabel.find( "p" ).text( this._convertTimeFormat( currenttime ) );
                },
 
                _updateVolumeState: function () {
-                       var self = this,
-                               view = self.element,
-                               control = view.parent().find( ".ui-multimediaview-control" ),
+                       var view = this.element,
+                               control = view.parent( ".ui-multimediaview-wrap" ).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" ),
+                               volumeHandle = volumeControl.find( ".ui-handle" ),
                                handlerWidth = volumeHandle.width(),
                                handlerHeight = volumeHandle.height(),
                                volumeGuideHeight = volumeGuide.height(),
                        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 ) );
+                       volumeValue.offset( volumeGuide.offset() ).width( parseInt( volumeGuideWidth * ( volume ), 10 ) );
                },
 
                _setVolume: function ( value ) {
                },
 
                _fitContentArea: function ( page, parent ) {
-                       if ( typeof parent == "undefined" ) {
+                       if ( typeof parent === "undefined" ) {
                                parent = window;
                        }
 
                },
 
                width: function ( value ) {
-                       var self = this,
-                               args = arguments,
-                               view = self.element;
+                       if ( this.options.fullScreen ) {
+                               return;
+                       }
+
+                       var view = this.element,
+                               wrap = view.parent( ".ui-multimediaview-wrap" );
 
-                       if ( args.length === 0 ) {
+                       if ( arguments.length === 0 ) {
                                return view.width();
                        }
-                       if ( args.length === 1 ) {
-                               view.width( value );
-                               self._resize();
+
+                       if ( !this._isVideo ) {
+                               wrap.width( value );
                        }
+
+                       view.width( value );
+                       this._resize();
                },
 
                height: function ( value ) {
-                       var self = this,
-                               view = self.element,
-                               args = arguments;
+                       if ( !this._isVideo || this.options.fullScreen ) {
+                               return;
+                       }
+
+                       var view = this.element;
 
-                       if ( args.length === 0 ) {
+                       if ( arguments.length === 0 ) {
                                return view.height();
                        }
-                       if ( args.length === 1 ) {
-                               view.height( value );
-                               self._resize();
-                       }
+
+                       view.height( value );
+                       this._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 ( !this._isVideo ) {
+                               return;
+                       }
+
+                       var view = this.element,
+                               option = this.options;
 
-                       if ( args.length === 0 ) {
+                       if ( arguments.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();
-                                       currentPage.addClass( "ui-fullscreen-page" );
-                                       this._fitContentArea( currentPage );
-                                       fullscreenButton.removeClass( "ui-fullscreen-on" ).addClass( "ui-fullscreen-off" );
-                               } else {
-                                       currentPage.children( ".ui-header" ).show();
-                                       currentPage.children( ".ui-footer" ).show();
-                                       currentPage.removeClass( "ui-fullscreen-page" );
-                                       this._fitContentArea( currentPage );
-                                       fullscreenButton.removeClass( "ui-fullscreen-off" ).addClass( "ui-fullscreen-on" );
-                               }
-                               self._resize();
-                       }
+
+                       view.parents( ".ui-scrollview-clip" ).scrollview( "scrollTo", 0, 0 );
+
+                       this.options.fullScreen = value;
+
+                       this._resize();
                },
 
                refresh: function () {
                $.tizen.multimediaview.prototype.enhanceWithin( e.target );
        });
 } ( jQuery, document, window ) );
+
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+} );
+//>>excludeEnd("jqmBuildExclude");
@@ -1,3 +1,11 @@
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+//>>description: Shows notification popup over header/footer
+//>>label: Notification
+//>>group: Tizen:Widgets
+
+define( [ '../jquery.mobile.tizen.core' ], function ( ) {
+//>>excludeEnd("jqmBuildExclude");
+
 /* ***************************************************************************
  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
  *
                $( e.target ).find(":jqmData(role='notification')").notification('destroy');
        });
 }( jQuery, this ));
+
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+} );
+//>>excludeEnd("jqmBuildExclude");
@@ -1,3 +1,11 @@
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+//>>description: Set a layout of pages
+//>>label: Pagelayout
+//>>group: Tizen:Widgets
+
+define( [ '../jquery.mobile.tizen.core' ], function ( ) {
+//>>excludeEnd("jqmBuildExclude");
+
 /* ***************************************************************************
  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
  *
@@ -35,7 +43,6 @@
                        tapToggleBlacklist: "a, input, select, textarea, .ui-header-fixed, .ui-footer-fixed",
                        hideDuringFocus: "input, textarea, select",
                        updatePagePadding: true,
-                       trackPersistentToolbars: true,
                        // Browser detection! Weeee, here we go...
                        // Unfortunately, position:fixed is costly, not to mention probably impossible, to feature-detect accurately.
                        // Some tests exist, but they currently return false results in critical devices and browsers, which could lead to a broken experience.
                                        if ( o.updatePagePadding ) {
                                                $( window ).unbind( "throttledresize." + self.widgetName );
                                        }
-
-                                       if ( o.trackPersistentToolbars ) {
-                                               var thisFooter = $( ".ui-footer-fixed:jqmData(id)", this ),
-                                                       thisHeader = $( ".ui-header-fixed:jqmData(id)", this ),
-                                                       nextFooter = thisFooter.length && ui.nextPage && $( ".ui-footer-fixed:jqmData(id='" + thisFooter.jqmData( "id" ) + "')", ui.nextPage ),
-                                                       nextHeader = thisHeader.length && ui.nextPage && $( ".ui-header-fixed:jqmData(id='" + thisHeader.jqmData( "id" ) + "')", ui.nextPage );
-
-                                               nextFooter = nextFooter || $();
-
-                                               if ( nextFooter.length || nextHeader.length ) {
-
-                                                       nextFooter.add( nextHeader ).appendTo( $.mobile.pageContainer );
-
-                                                       ui.nextPage.one( "pageshow", function () {
-                                                               nextFooter.add( nextHeader ).appendTo( this );
-                                                       });
-                                               }
-                                       }
                                });
 
                        window.addEventListener( "softkeyboardchange", function ( e ) {
                                headerSrcNum = $elHeader.children("img").length;
 
                        if ( !$elPage.is( ".ui-dialog" ) ) {
-                               $elHeader.find( "h1" ).css( "width", window.innerWidth - $elHeader.children( "a" ).width() * headerBtnNum - $elHeader.children( "a" ).width() / 4 - $elHeader.children( "img" ).width() * headerSrcNum * 4 );
+                               $elHeader.find( "h1" ).css( "width", window.innerWidth - parseInt( $elHeader.find( "h1" ).css( "margin-left" ), 10 ) * 2 - $elHeader.children( "a" ).width() * headerBtnNum - $elHeader.children( "a" ).width() / 4 - $elHeader.children( "img" ).width() * headerSrcNum * 4 );
                        }
                        /* add half width for default space between text and button, and img tag area is too narrow, so multiply three for img width*/
                },
                });
 
 }( jQuery ));
+
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+} );
+//>>excludeEnd("jqmBuildExclude");
@@ -1,3 +1,11 @@
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+//>>description: Shows popup at any place in the page content, with various styles
+//>>label: Context popup
+//>>group: Tizen:Widgets
+
+define( [ '../jquery.mobile.tizen.core', 'jquery.mobile.tizen.popupwindow', 'jquery.mobile.tizen.triangle' ], function ( core, _popupwindow, _triangle ) {
+//>>excludeEnd("jqmBuildExclude");
+
 /*
  * jQuery Mobile Widget @VERSION
  *
                $.tizen.ctxpopup.prototype.enhanceWithin( e.target );
        } );
 }( jQuery ) );
+
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+} );
+//>>excludeEnd("jqmBuildExclude");
@@ -1,3 +1,11 @@
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+//>>description: Shows popup on the page
+//>>label: Popup
+//>>group: Tizen:Widgets
+
+define( [ '../jquery.mobile.tizen.core', 'jquery.mobile.tizen.widgetex' ], function ( ) {
+//>>excludeEnd("jqmBuildExclude");
+
 /*
  * jQuery Mobile Widget @VERSION
  *
                });
        });
 }( jQuery ));
+
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+} );
+//>>excludeEnd("jqmBuildExclude");
@@ -1,3 +1,11 @@
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+//>>description: Shows progressbar or progress circle
+//>>label: Progress
+//>>group: Tizen:Widgets
+
+define( [ '../jquery.mobile.tizen.core' ], function ( ) {
+//>>excludeEnd("jqmBuildExclude");
+
 /* ***************************************************************************
  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
  *
                                init: false,
                                runningClass: runningClass
                        } );
+
+                       if ( style === "pending" ) {
+                               $( this.element ).append( this.html );
+                               this.init = true;
+                       }
+
                        this._refresh();
                }
        } ); /* End of widget */
                $( e.target ).find( ":jqmData(role='progress')" ).progress();
        } );
 }( jQuery, this ));
+
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+} );
+//>>excludeEnd("jqmBuildExclude");
@@ -1,3 +1,11 @@
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+//>>description: Shows progressbar
+//>>label: Progressbar
+//>>group: Tizen:Widgets
+
+define( [ '../jquery.mobile.tizen.core' ], function ( ) {
+//>>excludeEnd("jqmBuildExclude");
+
 /*
  * jQuery UI Progressbar @VERSION
  *
        } );
 
 }( jQuery, this ) );
+
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+} );
+//>>excludeEnd("jqmBuildExclude");
@@ -1,3 +1,11 @@
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+//>>description: Shows a scroll-handler with a scrollview
+//>>label: Scrollview Handler
+//>>group: Tizen:Widgets
+
+define( [ '../jquery.mobile.tizen.core', '../jquery.mobile.tizen.scrollview' ], function ( ) {
+//>>excludeEnd("jqmBuildExclude");
+
 /* ***************************************************************************
  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
  *
                widget.scrollview( "enableHandler", "true" );
        });
 } ( jQuery, document ) );
+
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+} );
+//>>excludeEnd("jqmBuildExclude");
@@ -1,3 +1,11 @@
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+//>>description: Shows searchbar, for text search
+//>>label: Searchbar
+//>>group: Tizen:Widgets
+
+define( [ '../jquery.mobile.tizen.core', 'jquery.mobile.tizen.pagelayout' ], function ( ) {
+//>>excludeEnd("jqmBuildExclude");
+
 /* ***************************************************************************
  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
  *
        } );
 
 }( jQuery ) );
+
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+} );
+//>>excludeEnd("jqmBuildExclude");
@@ -1,3 +1,11 @@
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+//>>description: Shows slider bar to input number by dragging
+//>>label: Slider
+//>>group: Tizen:Widgets
+
+define( [ '../jquery.mobile.tizen.core' ], function ( ) {
+//>>excludeEnd("jqmBuildExclude");
+
 /*
  * jQuery Mobile Widget @VERSION
  *
                        self.handle_press.css('display', 'none');
 
                        // add a popup element (hidden initially)
-                       slider.before( self.popup );
+                       slider.parents(".ui-page").append( self.popup );
                        self.popup.hide();
 
                        // get the element where value can be displayed
                        var dstOffset = this.handle.offset();
 
                        this.popup.offset({
-                               left: dstOffset.left + ( this.handle.width() - this.popup.width() ) / 2
+                               left: dstOffset.left + ( this.handle.width() - this.popup.width() ) / 2,
+                               top: dstOffset.top - this.popup.height()
                        });
 
                        this.handle_press.offset({
        });
 
 }( jQuery, this ));
+
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+} );
+//>>excludeEnd("jqmBuildExclude");
@@ -1,3 +1,11 @@
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+//>>description: Shows background listitem by swiping left/right on a listitem
+//>>label: Swipe list
+//>>group: Tizen:Widgets
+
+define( [ '../jquery.mobile.tizen.core' ], function ( ) {
+//>>excludeEnd("jqmBuildExclude");
+
 /*
  * jQuery Mobile Widget @VERSION
  *
        });
 
 }( jQuery ));
+
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+} );
+//>>excludeEnd("jqmBuildExclude");
@@ -1,3 +1,11 @@
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+//>>description: Shows buttons divided automatically on the header
+//>>label: Tabbar
+//>>group: Tizen:Widgets
+
+define( [ '../jquery.mobile.tizen.core', 'jquery.mobile.tizen.pagelayout' ], function ( ) {
+//>>excludeEnd("jqmBuildExclude");
+
 /* ***************************************************************************
  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
  *
@@ -67,8 +75,6 @@
                                wh = window.innerHeight || $( window ).height(),
                                tabbarDividerLeft = "<div class='ui-tabbar-divider ui-tabbar-divider-left'></div>",
                                tabbarDividerRight = "<div class='ui-tabbar-divider ui-tabbar-divider-right'></div>",
-                               isScrollingStart = false,
-                               isScrollingEnd = false,
                                isLandscape;
 
                        isLandscape = ww > wh && ( ww - wh );
                                if ( $elFooterBack.length ) {
                                        tabbar_filter.addClass( "ui-tabbar-margin-back" );
                                }
+                       });
 
-                               isScrollingStart = false;
+                       $tabbar.bind( "touchstart vmousedown", function ( e ) {
+                               var $tabbarScroll = $( e.target ).parents( ".ui-scrollview-view" );
+                               if ( $tabbarScroll.offset() ) {
+                                       if ( $tabbarScroll.offset().left < 0 ) {
+                                               $( ".ui-tabbar-divider-left" ).show();
+                                       } else {
+                                               $( ".ui-tabbar-divider-left" ).hide();
+                                       }
+                                       if ( ( $tabbarScroll.width() - $tabbarScroll.parents( ".ui-scrollview-clip" ).width() ) ==  Math.abs( $tabbarScroll.offset().left ) ) {
+                                               $( ".ui-tabbar-divider-right" ).hide();
+                                       } else {
+                                               $( ".ui-tabbar-divider-right" ).show();
+                                       }
+                               }
                        });
 
-                       $( window ).bind( "tabbar.scrollstart", function ( e ) {
+                       this._bindTabbarEvents();
+                       this._initTabbarAnimation();
+               },
+
+               _initTabbarAnimation: function () {
+                       var isScrollingStart = false,
+                               isScrollingEnd = false;
+                       $( document ).bind( "scrollstart.tabbar", function ( e ) {
                                if ( $( e.target ).find( ".ui-tabbar" ).length ) {
                                        isScrollingStart = true;
                                        isScrollingEnd = false;
                                }
                        });
 
-                       $( window ).bind( "tabbar.scrollstop", function ( e ) {
+                       $( document ).bind( "scrollstop.tabbar", function ( e ) {
                                var $tabbarScrollview = $( e.target ),
-                                       $minElement = $tabbar.find( "li" ).eq( 0 ),
-                                       minElementIndexVal = Math.abs( $tabbar.find( "li" ).eq( 0 ).offset().left ),
+                                       $elTabbar = $( e.target ).find( ".ui-tabbar" ),
+                                       $elTabbarLI = $( e.target ).find( ".ui-tabbar li" ),
+                                       $minElement = $elTabbarLI.eq( 0 ),
+                                       minElementIndexVal,
                                        minElementIndex = -1;
 
                                isScrollingEnd = true;
-                               if ( $( e.target ).find( ".ui-tabbar" ).length && isScrollingStart == true ) {
-                                       $tabbar.find( "li" ).each( function ( i ) {
-                                               var offset      = $tabbar.find( "li" ).eq( i ).offset();
+                               if ( $elTabbar.length && isScrollingStart == true ) {
+                                       minElementIndexVal = Math.abs( $elTabbarLI.eq( 0 ).offset().left );
+                                       $elTabbarLI.each( function ( i ) {
+                                               var offset      = $elTabbarLI.eq( i ).offset();
+
                                                if ( Math.abs( offset.left ) < minElementIndexVal ) {
                                                        minElementIndexVal = Math.abs( offset.left );
                                                        minElementIndex = i;
-                                                       $minElement = $tabbar.find( "li" ).eq( i );
+                                                       $minElement = $elTabbarLI.eq( i );
                                                }
                                        });
 
                                        if ( $tabbarScrollview.length && isScrollingStart == isScrollingEnd && minElementIndex != -1) {
                                                isScrollingStart = false;
-                                               $tabbarScrollview.scrollview( "scrollTo", -( window.innerWidth / $( e.target ).find( ".ui-tabbar" ).data( "defaultList" ) * minElementIndex ) , 0, 357);
+                                               $tabbarScrollview.scrollview( "scrollTo", -( window.innerWidth / $elTabbar.data( "defaultList" ) * minElementIndex ) , 0, 357);
                                        }
                                }
 
                                $( ".ui-tabbar-divider-left" ).hide();
                                $( ".ui-tabbar-divider-right" ).hide();
                        });
-
-                       $tabbar.bind( "touchstart vmousedown", function ( e ) {
-                               var $tabbarScroll = $( e.target ).parents( ".ui-scrollview-view" );
-                               if ( $tabbarScroll.offset() ) {
-                                       if ( $tabbarScroll.offset().left < 0 ) {
-                                               $( ".ui-tabbar-divider-left" ).show();
-                                       } else {
-                                               $( ".ui-tabbar-divider-left" ).hide();
-                                       }
-                                       if ( ( $tabbarScroll.width() - $tabbarScroll.parents( ".ui-scrollview-clip" ).width() ) ==  Math.abs( $tabbarScroll.offset().left ) ) {
-                                               $( ".ui-tabbar-divider-right" ).hide();
-                                       } else {
-                                               $( ".ui-tabbar-divider-right" ).show();
-                                       }
-                               }
-                       });
-
-                       this._bindTabbarEvents();
                },
 
                _bindTabbarEvents: function () {
                $( $.tizen.tabbar.prototype.options.initSelector, e.target ).tabbar();
        });
 }( jQuery ) );
+
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+} );
+//>>excludeEnd("jqmBuildExclude");
@@ -1,3 +1,11 @@
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+//>>description: Make words to selectable tokens
+//>>label: Token textarea
+//>>group: Tizen:Widgets
+
+define( [ '../jquery.mobile.tizen.core' ], function ( ) {
+//>>excludeEnd("jqmBuildExclude");
+
 /* ***************************************************************************
  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
  *
                $( ":jqmData(role='tokentextarea')" ).tokentextarea( "refresh" );
        });
 } ( jQuery, window, document ) );
+
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+} );
+//>>excludeEnd("jqmBuildExclude");
@@ -1,3 +1,11 @@
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+//>>description: Shows triangle, used by context popup
+//>>label: Triangle
+//>>group: Tizen:Widgets
+
+define( [ '../jquery.mobile.tizen.core', 'jquery.mobile.tizen.widgetex' ], function ( ) {
+//>>excludeEnd("jqmBuildExclude");
+
 /*
  * This software is licensed under the MIT licence (as defined by the OSI at
  * http://www.opensource.org/licenses/mit-license.php)
        });
 
 }(jQuery) );
+
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+} );
+//>>excludeEnd("jqmBuildExclude");
@@ -1,3 +1,11 @@
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+//>>description: Shows grid swapping its contents automatically
+//>>label: Virtual grid
+//>>group: Tizen:Widgets
+
+define( [ '../jquery.mobile.tizen.core', '../jquery.mobile.tizen.scrollview' ], function ( ) {
+//>>excludeEnd("jqmBuildExclude");
+
 /* ***************************************************************************
  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
  *
        @since Tizen2.0
 */
 
-( function ($, window, document, undefined) {
+( function ( $, window, document, undefined ) {
 
-       function circularNum (num, total) {
+       function circularNum ( num, total ) {
                var n = num % total;
-               if (n < 0) {
+               if ( n < 0 ) {
                        n = total + n;
                }
                return n;
        }
 
-       function MomentumTracker (options) {
-               this.options = $.extend({}, options);
+       function MomentumTracker ( options ) {
+               this.options = $.extend( {}, options );
                this.easing = "easeOutQuad";
                this.reset();
        }
 
        var tstates = {
-               scrolling : 0,
-               done : 1
-       };
+                       scrolling : 0,
+                       done : 1
+               },
+               _OVERFLOW_DIR_NONE = 0,         /* ENUM */
+               _OVERFLOW_DIR_UP = 1,           /* ENUM */
+               _OVERFLOW_DIR_DOWN = -1;        /* ENUM */
 
        function getCurrentTime () {
                return Date.now();
        }
 
-       $.extend (MomentumTracker.prototype, {
-               start : function (pos, speed, duration) {
-                       this.state = (speed !== 0 ) ? tstates.scrolling : tstates.done;
+       $.extendMomentumTracker.prototype, {
+               start : function ( pos, speed, duration ) {
+                       this.state = ( speed !== 0 ) ? tstates.scrolling : tstates.done;
                        this.pos = pos;
                        this.speed = speed;
                        this.duration = duration;
                update : function () {
                        var state = this.state, duration, elapsed, dx, x;
 
-                       if (state == tstates.done) {
+                       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) );
+                       dx = this.speed * ( 1 - $.easing[this.easing]( elapsed / duration, elapsed, 0, 1, duration ) );
                        x = this.pos + dx;
                        this.pos = x;
 
-                       if (elapsed >= duration) {
+                       if ( elapsed >= duration ) {
                                this.state = tstates.done;
                        }
                        return this.pos;
                }
        });
 
-       jQuery.widget ("mobile.virtualgrid", jQuery.mobile.widget, {
+       jQuery.widget ( "mobile.virtualgrid", jQuery.mobile.widget, {
                options : {
                        // virtualgrid option
                        template : "",
                        direction : "y",
-                       rotation : false,
+                       rotation : false
                },
 
                create : function () {
                },
 
                _create : function ( args ) {
-                       $.extend(this, {
+                       $.extend( this, {
                                // view
                                _$view : null,
                                _$clip : null,
                                _template : null,
                                _maxViewSize : 0,
                                _modifyViewPos : 0,
+                               _maxSizeExceptClip : 0,
                                _maxSize : 0,
 
                                // axis - ( true : x , false : y )
                                _rowsPerView : 0,
                                _fragment : null,
 
-                               _filterRatio : 0.9
+                               _filterRatio : 0.9,
+
+                               _overflowStartPos : 0,
+                               _overflowDir : 0,
+                               _overflowMaxDragDist : 100
                        });
 
                        var self = this,
-                               $dom = $(self.element),
+                               $dom = $( self.element ),
                                opts = self.options,
                                $item = null;
 
                                return ;
                        }
 
-                       if ( !self._loadData(args) ) {
+                       if ( !self._loadData( args ) ) {
                                return;
                        }
 
                        self._fragment = document.createDocumentFragment();
 
                        // read defined properties(width and height) from dom element.
-                       self._inheritedSize = self._getinheritedSize(self.element);
+                       self._inheritedSize = self._getinheritedSize( self.element );
 
                        // set a scroll direction.
                        self._direction = opts.direction === 'x' ? true : false;
 
                        // make view layer
-                       self._$clip = $(self.element).addClass("ui-scrollview-clip").addClass("ui-virtualgrid-view");
-                       $item = $(document.createElement("div")).addClass("ui-scrollview-view");
+                       self._$clip = $( self.element ).addClass( "ui-scrollview-clip" ).addClass( "ui-virtualgrid-view" );
+                       $item = $( document.createElement( "div" ) ).addClass( "ui-scrollview-view" );
                        self._clipSize =  self._calculateClipSize();
-                       self._$clip.append($item);
+                       self._$clip.append( $item );
                        self._$view = $item;
-                       self._$clip.css("overflow", "hidden");
-                       self._$view.css("overflow", "hidden");
+                       self._$clip.css( "overflow", "hidden" );
+                       self._$view.css( "overflow", "hidden" );
 
                        // inherit from scrollview widget.
                        self._scrollView = $.tizen.scrollview.prototype;
 
                        // create tracker.
                        self._createTracker();
-                       self._makePositioned(self._$clip);
+                       self._makePositioned( self._$clip );
                        self._timerInterval = 1000 / self.options.fps;
 
                        self._timerID = 0;
                        self._timerCB = function () {
                                self._handleMomentumScroll();
                        };
-                       $dom.closest(".ui-content").addClass("ui-virtualgrid-content").css("overflow", "hidden");
+                       $dom.closest( ".ui-content" ).addClass( "ui-virtualgrid-content" ).css( "overflow", "hidden" );
 
                        // add event handler.
                        self._addBehaviors();
 
                        self._currentItemCount = 0;
+                       self._createOverflowArea();
                        self._createScrollBar();
                        self.refresh();
                },
                        } else {
                                return false;
                        }
+                       self._getObjectNames( self._itemData( 0 ) );
                        return true;
                },
 
                        }
                        self._setElementTransform( -self._cellSize );
 
-                       self._replaceRow(self._$view.children().first(), self._totalRowCnt - 1);
+                       self._replaceRow( self._$view.children().first(), self._totalRowCnt - 1 );
                        if ( opts.rotation && self._rowsPerView >= self._totalRowCnt ) {
-                               self._replaceRow(self._$view.children().last(), 0);
+                               self._replaceRow( self._$view.children().last(), 0 );
                        }
                        self._setViewSize();
                },
 
                        if ( self._direction ) {
                                width = self._cellSize * ( self._rowsPerView + 2 );
-                               width = parseInt(width, 10) + 1;
+                               width = parseInt( width, 10 ) + 1;
                                self._$view.width( width );
                                self._viewSize = self._$view.width();
                        } else {
                        }
                },
 
+               _getViewWidth : function () {
+                       var self = this;
+                       return self._maxSize;
+               },
+
                _getViewHeight : function () {
                        var self = this;
-                       return self._$view.height();
+                       return self._maxSize;
                },
 
                refresh : function () {
 
                        width = self._calculateClipWidth();
                        height = self._calculateClipHeight();
-                       self._$view.width(width).height(height);
-                       self._$clip.width(width).height(height);
+                       self._$view.width( width ).height( height );
+                       self._$clip.width( width ).height( height );
 
                        self._clipSize = self._calculateClipSize();
                        self._calculateColumnSize();
 
                        columnCount = self._calculateColumnCount();
 
-                       totalRowCnt = parseInt(self._numItemData / columnCount , 10 );
+                       totalRowCnt = parseInt( self._numItemData / columnCount, 10 );
                        self._totalRowCnt = self._numItemData % columnCount === 0 ? totalRowCnt : totalRowCnt + 1;
                        self._itemCount = columnCount;
 
-                       if ( self._cellSize <= 0) {
+                       if ( self._cellSize <= 0 ) {
                                return ;
                        }
 
                        rowsPerView = self._clipSize / self._cellSize;
                        rowsPerView = Math.ceil( rowsPerView );
-                       self._rowsPerView = parseInt( rowsPerView, 10);
+                       self._rowsPerView = parseInt( rowsPerView, 10 );
 
                        $child = self._makeRows( rowsPerView + 2 );
-                       $(self._$view).append($child.children());
-                       self._$view.children().css(attributeName, self._cellSize + "px");
+                       $( self._$view ).append( $child.children() );
+                       self._$view.children().css( attributeName, self._cellSize + "px" );
                        self._$rows = self._$view.children().detach();
 
                        self._reservedPos = -self._cellSize;
                        self._initLayout();
 
                        self._blockScroll = self._rowsPerView > self._totalRowCnt;
-                       self._maxSize = ( self._totalRowCnt - self._rowsPerView ) * self._cellSize;
+                       self._maxSizeExceptClip = ( self._totalRowCnt - self._rowsPerView ) * self._cellSize;
+                       self._maxSize = self._totalRowCnt * self._cellSize;
                        self._maxViewSize = ( self._rowsPerView ) * self._cellSize;
                        self._modifyViewPos = -self._cellSize;
                        if ( self._clipSize < self._maxViewSize ) {
-                               self._modifyViewPos = (-self._cellSize) + ( self._clipSize - self._maxViewSize );
+                               self._modifyViewPos = ( -self._cellSize ) + ( self._clipSize - self._maxViewSize );
                        }
                },
 
                _getinheritedSize : function ( elem ) {
-                       var $target = $(elem),
+                       var $target = $( elem ),
                                height,
                                width,
                                NODETYPE = { ELEMENT_NODE : 1, TEXT_NODE : 3 },
                                        height : 0
                                };
 
-                       while ( $target[0].nodeType === NODETYPE.ELEMENT_NODE && (ret.isDefinedWidth === false || ret.isHeightDefined === false )) {
+                       while ( $target[0].nodeType === NODETYPE.ELEMENT_NODE && ( ret.isDefinedWidth === false || ret.isHeightDefined === false ) ) {
                                height = $target[0].style.height;
                                width = $target[0].style.width;
 
-                               if (ret.isDefinedHeight === false && height !== "" ) {
+                               if ( ret.isDefinedHeight === false && height !== "" ) {
                                        // Size was defined
                                        ret.isDefinedHeight = true;
-                                       ret.height = parseInt(height, 10);
+                                       ret.height = parseInt( height, 10 );
                                }
 
                                if ( ret.isDefinedWidth === false && width !== "" ) {
                                        // Size was defined
                                        ret.isDefinedWidth = true;
-                                       ret.width = parseInt(width, 10);
+                                       ret.width = parseInt( width, 10 );
                                }
                                $target = $target.parent();
+                               if ( $target.hasClass( "ui-content" ) ) {
+                                       break;
+                               }
                        }
                        return ret;
                },
 
                        itemCount = self._calculateColumnCount();
                        if ( itemCount != self._itemCount ) {
-                               totalRowCnt = parseInt(self._numItemData / itemCount , 10 );
+                               totalRowCnt = parseInt( self._numItemData / itemCount, 10 );
                                self._totalRowCnt = self._numItemData % itemCount === 0 ? totalRowCnt : totalRowCnt + 1;
                                prevcnt = self._itemCount;
                                self._itemCount = itemCount;
                                self._$view.hide();
 
                                diffRowCnt = self._replaceRows(itemCount, prevcnt, self._totalRowCnt, clipPosition);
-                               self._maxSize = ( self._totalRowCnt - self._rowsPerView ) * self._cellSize;
+                               self._maxSizeExceptClip = ( self._totalRowCnt - self._rowsPerView ) * self._cellSize;
+                               self._maxSize = self._totalRowCnt * self._cellSize;
                                self._scalableSize += (-diffRowCnt) * self._cellSize;
                                self._reservedPos  += (-diffRowCnt) * self._cellSize;
                                self._setScrollBarSize();
-                               self._setScrollBarPosition(diffRowCnt);
+                               self._setScrollBarPosition( diffRowCnt );
 
                                self._$view.show();
                        }
                                self._rowsPerView = rowsPerView;
                                self._clipSize = clipSize;
                                self._blockScroll = self._rowsPerView > self._totalRowCnt;
-                               self._maxSize = ( self._totalRowCnt - self._rowsPerView ) * self._cellSize;
+                               self._maxSizeExceptClip = ( self._totalRowCnt - self._rowsPerView ) * self._cellSize;
+                               self._maxSize = self._totalRowCnt * self._cellSize;
                                self._maxViewSize = ( self._rowsPerView ) * self._cellSize;
                                if ( self._clipSize < self._maxViewSize ) {
-                                       self._modifyViewPos = (-self._cellSize) + ( self._clipSize - self._maxViewSize );
+                                       self._modifyViewPos = ( -self._cellSize ) + ( self._clipSize - self._maxViewSize );
                                }
                                if ( self._direction ) {
-                                       self._$clip.width(self._clipSize);
+                                       self._$clip.width( self._clipSize );
                                } else {
-                                       self._$clip.height(self._clipSize);
+                                       self._$clip.height( self._clipSize );
                                }
                                self._setScrollBarSize();
-                               self._setScrollBarPosition(0);
+                               self._setScrollBarPosition( 0 );
                                self._setViewSize();
                        }
                },
 
                _initScrollView : function () {
                        var self = this;
-                       $.extend(self.options, self._scrollView.options);
+                       $.extend( self.options, self._scrollView.options );
                        self.options.moveThreshold = 10;
                        self.options.showScrollBars = false;
                        self._getScrollHierarchy = self._scrollView._getScrollHierarchy;
                _createTracker : function () {
                        var self = this;
 
-                       self._tracker = new MomentumTracker(self.options);
+                       self._tracker = new MomentumTracker( self.options );
                        if ( self._direction ) {
                                self._hTracker = self._tracker;
-                               self._$clip.width(self._clipSize);
+                               self._$clip.width( self._clipSize );
                        } else {
                                self._vTracker = self._tracker;
-                               self._$clip.height(self._clipSize);
+                               self._$clip.height( self._clipSize );
+                       }
+               },
+
+               //----------------------------------------------------//
+               //              Overflow effect
+               //----------------------------------------------------//
+               _createOverflowArea : function () {
+                       var self = this,
+                               prefix = "<div class=\"ui-virtualgrid-overflow-indicator-",
+                               suffixTop = "-top\"></div>",
+                               suffixBottom = "-bottom\"></div>";
+
+                       if ( self.options.rotation ) {
+                               return;
+                       }
+
+                       if ( self._direction ) {
+                               self._overflowTop = $( prefix + "x" + suffixTop );
+                               self._overflowBottom = $( prefix + "x" + suffixBottom );
+                       } else {
+                               self._overflowTop = $( prefix + "y" + suffixTop );
+                               self._overflowBottom = $( prefix + "y" + suffixBottom );
                        }
+
+                       self._$clip.append( self._overflowTop );
+                       self._$clip.append( self._overflowBottom );
+                       self._overflowDisplayed = false;
+               },
+
+               _hideVGOverflowIndicator : function () {
+                       if ( this._overflowDisplayed === false ) {
+                               return;
+                       }
+
+                       this._overflowTop.animate( { opacity: 0 }, 300 );
+                       this._overflowBottom.animate( { opacity: 0 }, 300 );
+                       this._overflowDisplayed = false;
                },
 
                //----------------------------------------------------//
 
                        if ( self._direction ) {
                                self._$clip.append( prefix + "x" + suffix );
-                               self._hScrollBar = $(self._$clip.children(".ui-scrollbar-x"));
-                               self._hScrollBar.find(".ui-scrollbar-thumb").addClass("ui-scrollbar-thumb-x");
+                               self._hScrollBar = $( self._$clip.children( ".ui-scrollbar-x" ) );
+                               self._hScrollBar.find( ".ui-scrollbar-thumb" ).addClass( "ui-scrollbar-thumb-x" );
                        } else {
                                self._$clip.append( prefix + "y" + suffix );
-                               self._vScrollBar = $(self._$clip.children(".ui-scrollbar-y"));
-                               self._vScrollBar.find(".ui-scrollbar-thumb").addClass("ui-scrollbar-thumb-y");
+                               self._vScrollBar = $( self._$clip.children( ".ui-scrollbar-y" ) );
+                               self._vScrollBar.find( ".ui-scrollbar-thumb" ).addClass( "ui-scrollbar-thumb-y" );
                        }
                },
 
                                return ;
                        }
 
-                       scrollBarSize = parseInt( self._maxViewSize / self._clipSize , 10);
+                       scrollBarSize = parseInt( self._maxViewSize / self._clipSize, 10 );
                        if ( self._direction ) {
-                               $scrollBar = self._hScrollBar.find(".ui-scrollbar-thumb");
+                               $scrollBar = self._hScrollBar.find( ".ui-scrollbar-thumb" );
                                attrName = "width";
                                currentSize = $scrollBar.width();
                                className = "ui-scrollbar-thumb-x";
-                               self._hScrollBar.css("width", self._clipSize);
+                               self._hScrollBar.css( "width", self._clipSize );
                        } else {
-                               $scrollBar = self._vScrollBar.find(".ui-scrollbar-thumb");
+                               $scrollBar = self._vScrollBar.find( ".ui-scrollbar-thumb" );
                                attrName = "height";
                                className = "ui-scrollbar-thumb-y";
                                currentSize = $scrollBar.height();
-                               self._vScrollBar.css("height", self._clipSize);
+                               self._vScrollBar.css( "height", self._clipSize );
                        }
 
                        if ( scrollBarSize > currentSize ) {
-                               $scrollBar.removeClass(className);
-                               $scrollBar.css(attrName, scrollBarSize);
+                               $scrollBar.removeClass( className );
+                               $scrollBar.css( attrName, scrollBarSize );
                        } else {
                                scrollBarSize = currentSize;
                        }
 
                        self._itemScrollSize = parseFloat( ( self._clipSize - scrollBarSize ) / ( self._totalRowCnt - self._rowsPerView ) );
-                       self._itemScrollSize = Math.round(self._itemScrollSize * 100) / 100;
+                       self._itemScrollSize = Math.round( self._itemScrollSize * 100 ) / 100;
                },
 
                _setScrollBarPosition : function ( di, duration ) {
 
                        self._currentItemCount = self._currentItemCount + di;
                        if ( self._vScrollBar ) {
-                               $sbt = self._vScrollBar .find(".ui-scrollbar-thumb");
+                               $sbt = self._vScrollBar .find( ".ui-scrollbar-thumb" );
                                y = ( self._currentItemCount * self._itemScrollSize ) + "px";
                        } else {
-                               $sbt = self._hScrollBar .find(".ui-scrollbar-thumb");
+                               $sbt = self._hScrollBar .find( ".ui-scrollbar-thumb" );
                                x = ( self._currentItemCount * self._itemScrollSize ) + "px";
                        }
                        self._setStyleTransform( $sbt, x, y, duration );
                        }
 
                        for ( i = 0; i < self._$rows.length; i++ ) {
-                               if ( $( self._$rows[i]).hasClass( selector ) ) {
+                               if ( $( self._$rows[i] ).hasClass( selector ) ) {
                                        if ( self._direction ) {
                                                newX = -( i * self._cellSize - self._clipSize / 2 + self._cellSize * 2 );
                                        } else {
                scrollTo: function ( x, y, duration ) {
                        var self = this;
                        if ( self._direction ) {
+                               x -= self._cellSize;
                                self._sx = self._reservedPos;
                                self._reservedPos = x;
                        } else {
+                               y -= self._cellSize;
                                self._sy = self._reservedPos;
                                self._reservedPos = y;
                        }
                                di = parseInt( dy / self._cellSize, 10 ),
                                i = 0,
                                idx = 0,
+                               replaceStartIdx = 0,
+                               realRowCount = self._rowsPerView + 2,
                                $row = null;
 
                        if ( self._blockScroll ) {
-                               return ;
+                               if ( dy > 0 && distance >= -self._cellSize && self._scalableSize >= -self._cellSize ) {
+                                       self._overflowDir = _OVERFLOW_DIR_UP;
+                               }
+                               if ( (dy < 0 && self._scalableSize <= -(self._maxSize + self._cellSize) )) {
+                                       self._overflowDir = _OVERFLOW_DIR_DOWN;
+                               }
+                               return;
                        }
 
                        if ( ! self.options.rotation ) {
                                        self._stopMScroll();
                                        self._scalableSize = -self._cellSize;
                                        self._setElementTransform( -self._cellSize );
+                                       if ( self._overflowDir === _OVERFLOW_DIR_NONE ) {
+                                               self._overflowDir = _OVERFLOW_DIR_UP;
+                                       }
                                        return;
                                }
-                               if ( (dy < 0 && self._scalableSize <= -(self._maxSize + self._cellSize) )) {
+                               if ( ( dy < 0 && self._scalableSize <= -( self._maxSize + self._cellSize ) ) ) {
                                        // bottom
                                        self._stopMScroll();
-                                       self._scalableSize = -(self._maxSize + self._cellSize);
+                                       self._scalableSize = -(self._maxSizeExceptClip + self._cellSize);
                                        self._setElementTransform( self._modifyViewPos );
+                                       if ( self._overflowDir === _OVERFLOW_DIR_NONE ) {
+                                               self._overflowDir = _OVERFLOW_DIR_DOWN;
+                                       }
                                        return;
                                }
                        }
 
+                       replaceStartIdx = ( Math.abs( di ) < realRowCount ) ? 0 : ( di > 0 ) ? di - realRowCount : di + realRowCount;
                        if ( di > 0 ) { // scroll up
-                               for ( i = 0; i < di; i++ ) {
+                               for ( i = replaceStartIdx; i < di; i++ ) {
                                        idx = -parseInt( ( sy / self._cellSize ) + i + 3, 10 );
-                                       $row = self._$view.children( ).last( ).detach( );
+                                       $row = self._$view.children().last().detach();
                                        self._replaceRow( $row, circularNum( idx, self._totalRowCnt ) );
                                        self._$view.prepend( $row );
-                                       self._setScrollBarPosition(-1);
                                }
                        } else if ( di < 0 ) { // scroll down
-                               for ( i = 0; i > di; i-- ) {
+                               for ( i = replaceStartIdx; i > di; i-- ) {
                                        idx = self._rowsPerView - parseInt( ( sy / self._cellSize ) + i, 10 );
                                        $row = self._$view.children().first().detach();
-                                       self._replaceRow($row, circularNum( idx, self._totalRowCnt ) );
+                                       self._replaceRow( $row, circularNum( idx, self._totalRowCnt ) );
                                        self._$view.append( $row );
-                                       self._setScrollBarPosition(1);
                                }
                        }
+                       self._setScrollBarPosition( -di );
                        self._scalableSize += di * self._cellSize;
                        self._setElementTransform( distance - self._scalableSize - self._cellSize );
                },
                        } else {
                                y = value + "px";
                        }
-                       self._setStyleTransform(self._$view, x, y );
+                       self._setStyleTransform( self._$view, x, y );
                },
 
                //----------------------------------------------------//
                                keepGoing = !t.done();
                                self._reservedPos = self._direction ? x : y;
                                // bottom
-                               self._reservedPos = self._reservedPos <= (-(self._maxSize - self._modifyViewPos)) ? ( - ( self._maxSize + self._cellSize) ) : self._reservedPos;
+                               self._reservedPos = self._reservedPos <= (-(self._maxSizeExceptClip - self._modifyViewPos)) ? ( - ( self._maxSizeExceptClip + self._cellSize) ) : self._reservedPos;
                                // top
                                self._reservedPos = self._reservedPos > -self._cellSize ? -self._cellSize : self._reservedPos;
                        } else {
 
                _startMScroll: function ( speedX, speedY ) {
                        var self = this;
-                       if ( self._direction  ) {
+                       if ( self._direction ) {
                                self._sx = self._reservedPos;
                        } else {
                                self._sy = self._reservedPos;
                        }
-                       self._scrollView._startMScroll.apply(self, [speedX, speedY]);
+                       self._scrollView._startMScroll.apply( self, [ speedX, speedY ] );
                },
 
                _stopMScroll: function () {
-                       this._scrollView._stopMScroll.apply(this);
+                       this._scrollView._stopMScroll.apply( this );
                },
 
                _enableTracking: function () {
                                dx = ex - self._lastX,
                                dy = ey - self._lastY,
                                x = 0,
-                               y = 0;
+                               y = 0,
+                               diffFromStartPos = 0,
+                               diffFromLastPos = 0,
+                               opacity = 0,
+                               overflowPos = 0,
+                               overFlowTarget = null;
 
                        self._lastMove = getCurrentTime();
                        self._speedX = dx;
                        if ( self._direction ) {
                                self._movePos = ex - self._eventPos;
                                x = self._nextPos + self._movePos;
+                               overflowPos = ex;
                        } else {
                                self._movePos = ey - self._eventPos;
                                y = self._nextPos + self._movePos;
+                               overflowPos = ey;
                        }
                        self._showScrollBars();
                        self._setScrollPosition( x, y );
+                       if ( self._overflowDir !== _OVERFLOW_DIR_NONE ) {
+                               overFlowTarget = ( self._overflowDir === _OVERFLOW_DIR_UP ) ? self._overflowTop : self._overflowBottom;
+                               if ( !self._overflowDisplayed ) {
+                                       self._overflowDisplayed = true;
+                                       self._overflowStartPos = overflowPos;
+                               }
+                               diffFromStartPos = ( overflowPos - self._overflowStartPos ) * self._overflowDir;
+                               opacity = ( diffFromStartPos < 0 ) ?
+                                                       0 : ( diffFromStartPos > self._overflowMaxDragDist ) ?
+                                                               1 : ( diffFromStartPos / self._overflowMaxDragDist );
+                               overFlowTarget.css( "opacity", opacity );
+                       }
+
                        return false;
                },
 
 
                        self._reservedPos = self._movePos ? self._nextPos + self._movePos : self._reservedPos;
                        self._scrollView._handleDragStop.apply( this, [ e ] );
+                       if ( self._overflowDir !== _OVERFLOW_DIR_NONE ) {
+                               self._overflowDir = _OVERFLOW_DIR_NONE;
+                               self._hideVGOverflowIndicator();
+                       }
                        return self._didDrag ? false : undefined;
                },
 
                                        return self._handleDragStop( e, e.clientX, e.clientY );
                                };
 
-                               self._$view.bind( "vclick", function (e) {
+                               self._$view.bind( "vclick", function ( e ) {
                                        return !self._didDrag;
                                } );
                        } else { //touch
                                self._dragStartEvt = "touchstart";
                                self._dragStartCB = function ( e ) {
                                        var t = e.originalEvent.targetTouches[0];
-                                       return self._handleDragStart(e, t.pageX, t.pageY );
+                                       return self._handleDragStart( e, t.pageX, t.pageY );
                                };
 
                                self._dragMoveEvt = "touchmove";
                                self._dragMoveCB = function ( e ) {
                                        var t = e.originalEvent.targetTouches[0];
-                                       return self._handleDragMove(e, t.pageX, t.pageY );
+                                       return self._handleDragMove( e, t.pageX, t.pageY );
                                };
 
                                self._dragStopEvt = "touchend";
                        self._$view.bind( self._dragStartEvt, self._dragStartCB );
 
                        // other events.
-                       self._$view.delegate(".virtualgrid-item", "click", function (event) {
-                               var $selectedItem = $(this);
-                               $selectedItem.trigger("select", this);
-                       });
+                       self._$view.delegate( ".virtualgrid-item", "click", function ( event ) {
+                               var $selectedItem = $( this );
+                               $selectedItem.trigger( "select", this );
+                       } );
 
-                       $( window ).bind("resize", function ( e ) {
+                       $( window ).bind( "resize", function ( e ) {
                                var height = 0,
-                                       $virtualgrid = $(".ui-virtualgrid-view");
+                                       $virtualgrid = $( ".ui-virtualgrid-view" );
                                if ( $virtualgrid.length !== 0 ) {
                                        if ( self._direction ) {
                                                height = self._calculateClipHeight();
-                                               self._$view.height(height);
-                                               self._$clip.height(height);
+                                               self._$view.height( height );
+                                               self._$clip.height( height );
                                        } else {
                                                height = self._calculateClipWidth();
-                                               self._$view.width(height);
-                                               self._$clip.width(height);
+                                               self._$view.width( height );
+                                               self._$clip.width( height );
                                        }
-                                       self.resize( );
+                                       self.resize();
                                }
-                       });
+                       } );
 
-                       $(document).one("pageshow", function (event) {
-                               var $page = $(self.element).parents(".ui-page"),
+                       $( document ).one( "pageshow", function ( event ) {
+                               var $page = $( self.element ).parents( ".ui-page" ),
                                        $header = $page.find( ":jqmData(role='header')" ),
                                        $footer = $page.find( ":jqmData(role='footer')" ),
                                        $content = $page.find( ":jqmData(role='content')" ),
                                        headerHeight = $header ? $header.height() : 0;
 
                                if ( $page && $content ) {
-                                       $content.height(window.innerHeight - headerHeight - footerHeight).css("overflow", "hidden");
-                                       $content.addClass("ui-virtualgrid-content");
+                                       $content.height( window.innerHeight - headerHeight - footerHeight ).css( "overflow", "hidden" );
+                                       $content.addClass( "ui-virtualgrid-content" );
                                }
-                       });
+                       } );
                },
 
                //----------------------------------------------------//
 
                _calculateClipWidth : function () {
                        var self = this,
-                               view = $(self.element),
-                               $parent = $(self.element).parent(),
+                               view = $( self.element ),
+                               $parent = $( self.element ).parent(),
                                paddingValue = 0,
-                               clipSize = $(window).width();
+                               clipSize = $( window ).width();
 
                        if ( self._inheritedSize.isDefinedWidth ) {
                                return self._inheritedSize.width;
                        }
 
-                       if ( $parent.hasClass("ui-content") ) {
-                               paddingValue = parseInt($parent.css("padding-left"), 10);
+                       if ( $parent.hasClass( "ui-content" ) ) {
+                               paddingValue = parseInt( $parent.css( "padding-left" ), 10 );
+                               clipSize = clipSize - ( paddingValue || 0 );
+                               paddingValue = parseInt( $parent.css( "padding-right" ), 10 );
                                clipSize = clipSize - ( paddingValue || 0 );
-                               paddingValue = parseInt($parent.css("padding-right"), 10);
-                               clipSize = clipSize - ( paddingValue || 0);
                        } else {
                                clipSize = view.width();
                        }
 
                _calculateClipHeight : function () {
                        var self = this,
-                               view = $(self.element),
-                               $parent = $(self.element).parent(),
+                               view = $( self.element ),
+                               $parent = view.parent(),
                                header = null,
                                footer = null,
                                paddingValue = 0,
-                               clipSize = $(window).height();
+                               clipSize = $( window ).height();
 
                        if ( self._inheritedSize.isDefinedHeight ) {
                                return self._inheritedSize.height;
                        }
 
-                       if ( $parent.hasClass("ui-content") ) {
-                               paddingValue = parseInt($parent.css("padding-top"), 10);
+                       if ( $parent.hasClass( "ui-content" ) ) {
+                               paddingValue = parseInt( $parent.css( "padding-top" ), 10 );
                                clipSize = clipSize - ( paddingValue || 0 );
-                               paddingValue = parseInt($parent.css("padding-bottom"), 10);
-                               clipSize = clipSize - ( paddingValue || 0);
-                               header = $parent.siblings(".ui-header");
-                               footer = $parent.siblings(".ui-footer");
+                               paddingValue = parseInt( $parent.css( "padding-bottom" ), 10 );
+                               clipSize = clipSize - ( paddingValue || 0 );
+                               header = $parent.siblings( ".ui-header" );
+                               footer = $parent.siblings( ".ui-footer" );
 
                                if ( header ) {
-                                       if ( header.outerHeight(true) === null ) {
-                                               clipSize = clipSize - ( $(".ui-header").outerHeight() || 0 );
+                                       if ( header.outerHeight( true ) === null ) {
+                                               clipSize = clipSize - ( $( ".ui-header" ).outerHeight() || 0 );
                                        } else {
-                                               clipSize = clipSize - header.outerHeight(true);
+                                               clipSize = clipSize - header.outerHeight( true );
                                        }
                                }
                                if ( footer ) {
-                                       clipSize = clipSize - footer.outerHeight(true);
+                                       clipSize = clipSize - footer.outerHeight( true );
                                }
                        } else {
                                clipSize = view.height();
                                // x-axis
                                self._viewSize = self._$view.width();
                                $cell = self._$view.children().first().children().first();
-                               self._cellSize = $cell.outerWidth(true);
-                               self._cellOtherSize = $cell.outerHeight(true);
+                               self._cellSize = $cell.outerWidth( true );
+                               self._cellOtherSize = $cell.outerHeight( true );
                        } else {
                                // y-axis
                                self._viewSize = self._$view.height();
                                $cell = self._$view.children().first().children().first();
-                               self._cellSize = $cell.outerHeight(true);
-                               self._cellOtherSize = $cell.outerWidth(true);
+                               self._cellSize = $cell.outerHeight( true );
+                               self._cellOtherSize = $cell.outerWidth( true );
                        }
                        $tempBlock.remove();
                        self._$view.children().remove();
 
                _calculateColumnCount : function ( ) {
                        var self = this,
-                               $view = $(self.element),
+                               $view = $( self.element ),
                                viewSize = self._direction ? $view.innerHeight() : $view.innerWidth(),
                                itemCount = 0 ;
 
                        if ( self._direction ) {
-                               viewSize = viewSize - ( parseInt( $view.css("padding-top"), 10 ) + parseInt( $view.css("padding-bottom"), 10 ) );
+                               viewSize = viewSize - ( parseInt( $view.css( "padding-top" ), 10 ) + parseInt( $view.css( "padding-bottom" ), 10 ) );
                        } else {
-                               viewSize = viewSize - ( parseInt( $view.css("padding-left"), 10 ) + parseInt( $view.css("padding-right"), 10 ) );
+                               viewSize = viewSize - ( parseInt( $view.css( "padding-left" ), 10 ) + parseInt( $view.css( "padding-right" ), 10 ) );
                        }
 
-                       itemCount = parseInt( (viewSize / self._cellOtherSize), 10);
+                       itemCount = parseInt( ( viewSize / self._cellOtherSize ), 10 );
                        return itemCount > 0 ? itemCount : 1 ;
                },
 
                                matrix = null,
                                contents = null,
                                result = -self._cellSize,
-                               $scrollview = self._$view.closest(".ui-scrollview-view");
+                               $scrollview = self._$view.closest( ".ui-scrollview-view" );
 
                        if ( $scrollview ) {
-                               matrix = $scrollview.css("-webkit-transform");
+                               matrix = $scrollview.css( "-webkit-transform" );
                                contents = matrix.substr( 7 );
                                contents = contents.substr( 0, contents.length - 1 );
                                contents = contents.split( ', ' );
-                               result =  Math.abs(contents [5]);
+                               result =  Math.abs( contents [5] );
                        }
                        return result;
                },
                                $wrapper = null;
 
                        $wrapper = $( self._createElement( "div" ) );
-                       $wrapper.addClass("ui-scrollview-view");
+                       $wrapper.addClass( "ui-scrollview-view" );
                        for ( index = 0; index < count ; index += 1 ) {
                                $row = self._makeRow( self._template, index );
                                if ( self._direction ) {
-                                       $row.css("top", 0).css("left", ( index * self._cellSize ));
+                                       $row.css( "top", 0 ).css( "left", ( index * self._cellSize ) );
                                }
-                               $wrapper.append($row);
+                               $wrapper.append( $row );
                        }
                        return $wrapper;
                },
                                blockAttrName = self._direction ? "top" : "left",
                                wrapBlock = $( self._createElement( "div" ) );
 
-                       wrapBlock.addClass( blockClassName ).attr("row-index", rowIndex);
+                       wrapBlock.addClass( blockClassName ).attr( "row-index", rowIndex );
                        for ( colIndex = 0; colIndex < self._itemCount; colIndex++ ) {
-                               htmlData = self._makeHtmlData( myTemplate, index, colIndex);
+                               htmlData = self._makeHtmlData( myTemplate, index, colIndex );
                                if ( htmlData ) {
                                        wrapBlock.append( htmlData );
                                }
 
                        itemData = self._itemData( dataIndex );
                        if ( itemData ) {
-                               htmlData = myTemplate.tmpl( itemData );
-                               $(htmlData).css(attrName, ( colIndex * self._cellOtherSize )).addClass("virtualgrid-item");
+                               htmlData = self._tmpl( itemData );
+                               htmlData.css( attrName, ( colIndex * self._cellOtherSize ) ).addClass( "virtualgrid-item" );
                        }
                        return htmlData;
                },
                                size = self._scalableSize,
                                idx = 0;
 
-                       headItemIndex = parseInt( $(self._$view.children().first()).attr("row-index"), 10) - 1;
-                       tailItemIndex = parseInt( $(self._$view.children()[self._rowsPerView]).attr("row-index"), 10) + 1;
+                       headItemIndex = parseInt( $( self._$view.children().first() ).attr( "row-index" ), 10 ) - 1;
+                       tailItemIndex = parseInt( $( self._$view.children()[self._rowsPerView] ).attr( "row-index" ), 10 ) + 1;
 
                        for ( idx = 1 ; idx <= num ; idx++ ) {
                                if ( tailItemIndex + idx  >= self._totalRowCnt ) {
                                        $row = self._makeRow( self._template, headItemIndex );
-                                       self._$view.prepend($row);
+                                       self._$view.prepend( $row );
                                        headItemIndex -= 1;
                                } else {
                                        $row = self._makeRow( self._template, tailItemIndex + idx );
-                                       self._$view.append($row);
+                                       self._$view.append( $row );
                                }
                                if ( self._direction ) {
-                                       $row.width(self._cellSize);
+                                       $row.width( self._cellSize );
                                } else {
-                                       $row.height(self._cellSize);
+                                       $row.height( self._cellSize );
                                }
                        }
                },
                                rowIndex = 0,
                                diffRowCnt = 0,
                                targetCnt = 1,
-                               filterCondition = ( self._filterRatio * self._cellSize) + self._cellSize,
+                               filterCondition = ( self._filterRatio * self._cellSize ) + self._cellSize,
                                idx = 0;
 
                        if ( filterCondition < clipPosition ) {
                                targetCnt += 1;
                        }
 
-                       prevRowIndex = parseInt( $($rows[targetCnt]).attr("row-index"), 10);
+                       prevRowIndex = parseInt( $( $rows[targetCnt] ).attr( "row-index" ), 10 );
                        if ( prevRowIndex === 0 ) {
                                // only top.
                                rowIndex = maxCnt - targetCnt;
                        } else {
-                               rowIndex = Math.round( (prevRowIndex * prevCnt) / curCnt );
+                               rowIndex = Math.round( ( prevRowIndex * prevCnt ) / curCnt );
                                if ( rowIndex + self._rowsPerView >= maxCnt ) {
                                        // only bottom.
                                        rowIndex = maxCnt - self._rowsPerView;
                        }
 
                        for ( idx = 0 ; idx < $rows.length ; idx += 1 ) {
-                               self._replaceRow($rows[idx], circularNum( rowIndex, self._totalRowCnt ));
+                               self._replaceRow( $rows[idx], circularNum( rowIndex, self._totalRowCnt ) );
                                rowIndex++;
                        }
                        return -diffRowCnt;
                                dataIdx = 0,
                                tempBlocks = null;
 
-                       $columns = $block.attr("row-index", index).children();
+                       $columns = $block.attr( "row-index", index ).children();
                        if ( $columns.length !== self._itemCount ) {
                                $block.children().remove();
-                               tempBlocks = $(self._makeRow( self._template, index ));
-                               $block.append(tempBlocks.children());
+                               tempBlocks = $( self._makeRow( self._template, index ) );
+                               $block.append( tempBlocks.children() );
                                tempBlocks.remove();
                                return ;
                        }
 
                        dataIdx = index * self._itemCount;
                        for ( idx = 0; idx < self._itemCount ; idx += 1 ) {
-                               $column = $columns.eq(idx);
-                               data = self._itemData(dataIdx);
+                               $column = $columns.eq( idx );
+                               data = self._itemData( dataIdx );
                                if ( $column && data ) {
-                                       myTemplate = self._template;
-                                       htmlData = myTemplate.tmpl( data );
+                                       htmlData = self._tmpl( data );
                                        self._replace( $column, htmlData, false );
                                        htmlData.remove();      // Clear temporary htmlData to free cache
                                        dataIdx ++;
-                               } else if ($column && !data ) {
+                               } else if ( $column && !data ) {
                                        $column.remove();
                                }
                        }
                        this._fragment.appendChild( element );
                        return element;
                },
+               _getObjectNames : function ( obj ) {
+                       var properties = [],
+                               name = "";
+
+                       for ( name in obj ) {
+                               properties.push( name );
+                       }
+                       this._properties = properties;
+               },
+
+               _tmpl : function ( data ) {
+                       var self = this,
+                               idx = 0,
+                               plainMsg,
+                               ret;
+                       if ( !data ) {
+                               return ;
+                       }
+
+                       plainMsg = self._template.text();
+                       for ( idx = 0 ; idx < self._properties.length ; idx++ ) {
+                               plainMsg = self._strReplace( plainMsg, "${" + self._properties[ idx ] + "}" , data[ self._properties[ idx ] ] );
+                       }
+                       ret = $( plainMsg );
+                       return ret;
+               },
+
+               _strReplace : function ( plainMsg, stringToFind, stringToReplace ) {
+                       var temp = plainMsg,
+                               index = plainMsg.indexOf( stringToFind );
+                       while ( index !== -1 ) {
+                               temp = temp.replace( stringToFind, stringToReplace );
+                               index = temp.indexOf( stringToFind );
+                       }
+                       return temp;
+               },
 
                /* Text & image src replace function */
                // @param oldItem   : prev HtmlDivElement
 
                                $( oldObj ).attr( "src", newImg );
                        });
-                       $( oldItem).removeData();
+                       $( oldItem ).removeData();
                        if ( key ) {
                                $( oldItem ).data( key, $( newItem ).data( key ) );
                        }
        } );
 
        $( document ).bind( "pagecreate create", function ( e ) {
-               $(":jqmData(role='virtualgrid')").virtualgrid();
+               $( ":jqmData(role='virtualgrid')" ).virtualgrid();
        } );
-} (jQuery, window, document) );
+} ( jQuery, window, document ) );
@@ -1,3 +1,11 @@
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+//>>description: Shows listview swapping its contents automatically
+//>>label: Virtual listview
+//>>group: Tizen:Widgets
+
+define( [ '../jquery.mobile.tizen.core', '../jquery.mobile.tizen.scrollview' ], function ( ) {
+//>>excludeEnd("jqmBuildExclude");
+
 /* ***************************************************************************
  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
  *
        });
 
 } ( jQuery ) );
+
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+} );
+//>>excludeEnd("jqmBuildExclude");
similarity index 97%
rename from src/widgets/000_widgetex/js/widgetex.js
rename to src/js/widgets/jquery.mobile.tizen.widgetex.js
index 1bbfe04..5cf70a1 100644 (file)
@@ -1,3 +1,11 @@
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+//>>description: Widget class extending functionality of jQueryMobile widget class
+//>>label: Widget extension
+//>>group: Tizen:Widgets
+
+define( [ '../jquery.mobile.tizen.core' ], function ( ) {
+//>>excludeEnd("jqmBuildExclude");
+
 /*
  *
  * This software is licensed under the MIT licence (as defined by the OSI at
        };
 
 }( jQuery ) );
+
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+} );
+//>>excludeEnd("jqmBuildExclude");
diff --git a/src/js/widgets/less/ctxpopup.less b/src/js/widgets/less/ctxpopup.less
new file mode 100644 (file)
index 0000000..def9e09
--- /dev/null
@@ -0,0 +1,21 @@
+.ui-ctxpopup {
+    display: table;
+
+    .ui-ctxpopup-row {
+        display: table-row;
+
+        .ui-ctxpopup-cell {
+            display: table-cell;
+        }
+    }
+}
+/* 
+ * The settings in this file are part of the theme. They are not part of the structure of ctxpopup.
+ * In the default theme, ui-body-* has a border width of 1px. So, to make the triangles cross this border, we set them in
+ * by 1px.
+ */
+.ui-ctxpopup-row {
+       .ui-triangle-top { top: 1px; }
+       .ui-triangle-left { left: 1px; }
+       .ui-triangle-right { right: 1px; }
+       .ui-triangle-bottom { bottom: 1px; }
index 7802a84..b6e4a0e 100644 (file)
@@ -21,6 +21,9 @@
 .ui-collapsible-set .ui-collapsible:not(.ui-collapsible-inset) .ui-collapsible-heading .ui-btn {
        border-top-width: 1px; 
 }
+.ui-collapsible-heading, .ui-collapsible-content > li {
+       position: relative;
+}
 .ui-collapsible-heading {
        font-size: @list-font-size-main;
        display: block;
index faed987..56ea191 100644 (file)
@@ -78,7 +78,7 @@ textarea.ui-input-text {
 }
 
 /* code for label+inputbox : remove this code if webApp dev. controls input area */
-@media all and (min-width: 721*@unit_base) {
+@media all and (min-width: 721px) {
        label.ui-input-text:not([data-type='search']) {
                vertical-align: top;
                display: inline-block;
index e84d480..a9bfc18 100644 (file)
        .ui-li-color-bar {
                position : absolute;
                width  : 3 * @unit_base;
-               height : 65 * @unit_base;
+               height : 100%;
 
                top : 0 * @unit_base;
                left : -13 * @unit_base;
@@ -521,7 +521,7 @@ li.ui-li-thumbnail-right {
        }
 }
 
-.ui-li.ui-li-has-right-btn:not(.ui-swipelist-item) {
+.ui-li.ui-li-has-right-btn:not(.ui-swipe) {
        .ui-btn-inner a {
                padding-right : 79 * @unit_base;
        }
@@ -536,7 +536,7 @@ li.ui-li-thumbnail-right {
        padding-right : 48 * @unit_base;
 }
 
-.ui-li.ui-li-static.ui-li-has-right-btn:not(.ui-swipelist-item) {
+.ui-li.ui-li-static.ui-li-has-right-btn:not(.ui-swipe) {
        padding-right : 79 * @unit_base;
 }
 
@@ -694,7 +694,7 @@ li:not(.ui-li-has-multiline) .ui-li-text-sub {
 // Dialogue
 // =========
 .ui-listview {
-        li.ui-li-dialogue {
+       li.ui-li-dialogue {
                margin-left: 4 * @unit_base;
                margin-right : 4 * @unit_base;
                padding-left : 10 * @unit_base;
@@ -703,6 +703,7 @@ li:not(.ui-li-has-multiline) .ui-li-text-sub {
                border-style : solid;
                border-color : @color_dialogue_border_right;
                border-width : 1px;
+               border-top-width : 0px;
 
                > .ui-btn-inner {
                        margin-left : 0px;
@@ -762,6 +763,10 @@ li:not(.ui-li-has-multiline) .ui-li-text-sub {
                }
        }
 
+       li.ui-li-divider + .ui-li-dialogue {
+               border-top-width : 1px;
+       }
+
        &> li.ui-li-dialogue.ui-body-s,
        &> li.ui-li-dialogue.ui-btn-hover-up-s:not(.ui-btn-down-s),
        &> li.ui-li-dialogue.ui-btn-up-s {
index bfffcf8..7a6e56f 100644 (file)
                        border-color : @color_bar_divider_line;
                        border-top-width : 0px;
                        border-bottom-width : 0px;
-                       border-left-width : 0px;
+                       border-left-width : 1px;
                        border-right-width : 1px;
 
-                       border-top-left-radius : 0px !important;
-                       border-top-right-radius : 0px !important;
-                       border-bottom-left-radius : 0px !important;
-                       border-bottom-right-radius : 0px !important;
+                       .LESSborder-radius-all(0);
 
                        box-shadow : none;
 
                        padding : 0px;
                        margin-left : -4 * @unit_base;
                        margin-right : -5 * @unit_base;
-
+                       &.ui-btn-hover-s {
+                               .LESSborder-radius-all(0);
+                       }
                        &.ui-btn-down-s, .ui-btn-active-s {
+                               .LESSborder-radius-all(0);
                                .ui-btn-inner {
                                        background : @color_bg;
                                        .ui-btn-text {
                        }
 
                        >.ui-btn-inner {
+                               .LESSborder-radius-all(0);
                                border : 0px solid;
                                box-shadow : none;
                        }
@@ -493,7 +494,7 @@ a.ui-link-inherit {
 
 }
 
-.ui-btn-up-s {
+.ui-btn-up-s, .ui-btn-hover-s {
        .ui-icon-header-back-btn { background-image: url(images/page/00_icon_Back.png); }
        .ui-icon-naviframe-more { background-image: url(images/page/00_icon_more.png); }
        .ui-icon-naviframe-cancel { background-image: url(images/00_icon_cancel.png); } /* FIXME : check ux if it needs to be deprecated... */
@@ -501,7 +502,7 @@ a.ui-link-inherit {
        .ui-icon-naviframe-plus { background-image: url(images/page/00_icon_plus.png); }
 }
 
-.ui-btn-down-s, .ui-btn-hover-s {
+.ui-btn-down-s {
        .ui-icon-header-back-btn { background-image: url(images/page/00_icon_Back_press.png); }
        .ui-icon-naviframe-more { background-image: url(images/page/00_icon_more_press.png); }
        .ui-icon-naviframe-cancel { background-image: url(images/00_icon_cancel_press.png); } /* FIXME: check ux if it needs to be deprecated.. */
index b8eb203..f789cb5 100644 (file)
     .ui-listview li.ui-btn-up-s, .ui-listview li.ui-btn-hover-s {
         background: transparent;
     }
-
-       .ui-listview li.ui-btn-down-s {
-               background: @color_bar_back_btn_press;
-       }
-
        .ui-listview li:last-child {
                border-bottom-left-radius: @border_radius;
                border-bottom-right-radius: @border_radius;
         -moz-transform: scale(.8);
         opacity: 0;
     }
-}
\ No newline at end of file
+}
diff --git a/src/themes/tizen/common/jquery.mobile.tizen.dayselector.less b/src/themes/tizen/common/jquery.mobile.tizen.dayselector.less
deleted file mode 100644 (file)
index 2a436d2..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-
-@import "config.less";
-
-/* dayselector CSS */
-.ui-dayselector label {
-    height: 56 * @unit_base;
-    width: 64 * @unit_base;
-}
-
-.ui-dayselector  {
-       display: inline-block;
-
-       .ui-btn {
-               border-color : @color_dayselector_Btn_border;
-               border-style : solid;
-               border-width : 1 * @unit_base;
-               .ui-btn-inner {
-                       text-align :center;                     
-                       padding : 0.4em 0px;
-               }
-       }
-       .ui-checkbox-off {
-               .LESSDayselectorButtonNormal;
-               .ui-btn-text {
-                       color : @color_dayselector_Btn_Mon_to_Fri;
-               }       
-       }
-       
-       .ui-checkbox-off.ui-btn-down-s.ui-btn-hover-s {
-               .LESSDayaselectorButtonPress;
-       }
-       
-       .ui-checkbox-on {
-               .LESSDayaselectorButtonPress;
-               .ui-btn-text {
-                       color : @color_dayselector_Btn_Mon_to_Fri;      
-               }       
-       }
-
-       .ui-checkbox-on.ui-btn-down-s.ui-btn-hover-s {
-               .LESSDayselectorButtonNormal;
-       }
-       .ui-dayselector-label-6 {
-               .ui-btn-text {  
-               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;
-               }
-       }
-       .ui-checkbox {  
-               height : 45 * @unit_base;
-               
-               .ui-btn {
-                       width : 47 * @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;
-               }                        
-       }
-       .todons-dayselector-disabled .ui-dayselector-label-6 {
-           color: #121212;
-       }
-
-       .todons-dayselector-disabled .ui-dayselector-label-0 {
-       color: #363636;
-       }
-
-}
-
-.ui-dayselector.ui-controlgroup-vertical  {
-       .ui-checkbox .ui-btn{
-               width : 64 * @unit_base;
-               .ui-btn-text {
-                       margin-left : 2 * @unit_base;
-               }
-       }
-}
index e7ac164..8d43d38 100644 (file)
@@ -8,32 +8,38 @@
 }
 
 .ui-multimediaview-wrap {
-       position : relative;
        width : 100%;
-       margin-top : 16 * @unit_base;
-       margin-bottom : 16 * @unit_base;
        padding : 0;
-       border : 0;
+       position : relative;
 }
 
 .ui-multimediaview-fullscreen {
        position : absolute !important;
-       z-index : @z_base_header_footer + 100 !important;
+       z-index : @z_base_header_footer + 1;
+}
+
+.ui-multimediaview-siblings-off {
+       display : none !important;
 }
 
 .ui-multimediaview-control span {
        display : inline-block;
 }
 
+.ui-multimediaview-video {
+       position : absolute;
+}
+
 .ui-multimediaview-control {
-       position : relative;
        display : block;
-       z-index : @z_base_header_footer + 101 !important;
+       z-index : @z_base_header_footer + 2;
        padding : 0;
        margin : 0;
        outline : 0;
        border : 0;
        height : 84 * @unit_base_multimediaview;
+       text-align: left;
+       overflow: hidden;
 }
 
 .ui-multimediaview-control span.ui-button {
        text-align : right;
 }
 
-.ui-multimediaview-control .ui-seekbar {
-       margin-top : 11.5 * @unit_base_multimediaview;
-       padding-left : 4 * @unit_base_multimediaview;
-       padding-right : 4 * @unit_base_multimediaview;
-       height : 16 * @unit_base_multimediaview;
+.ui-multimediaview-bar {
+       margin-top : 9.8 * @unit_base_multimediaview;
        float : left;
 }
 
-.ui-multimediaview-control .ui-seekbar .ui-duration {
-       margin : 0;
-       padding : 0;
-       width : 100%;
+.ui-multimediaview-bar-bg {
        height : 16 * @unit_base_multimediaview;
        border-radius : 1.5em;
 }
 
-.ui-multimediaview-control .ui-seekbar .ui-currenttime {
-       margin : 0;
-       padding : 0;
+.ui-multimediaview-bar-highlight {
        height : 16 * @unit_base_multimediaview;
        position : absolute;
        border-radius : 1.5em;
 }
 
+.ui-multimediaview-control .ui-seekbar {
+       margin-left : 4 * @unit_base_multimediaview;
+}
+
+.ui-multimediaview-control .ui-seekbar .ui-duration {
+       width : 100%;
+}
+
 .ui-multimediaview-control .ui-volumecontrol {
        width : 220 * @unit_base_multimediaview;
        height : 100%;
 }
 
 .ui-multimediaview-control .ui-volumecontrol .ui-volumebar {
-       height : 100%;
-       padding-top : 35 * @unit_base_multimediaview;
-       padding-left : 40 * @unit_base_multimediaview;
-       display : block;
+       margin-left : 30 * @unit_base_multimediaview;
 }
 
 .ui-multimediaview-control .ui-volumecontrol .ui-volumebar .ui-guide {
-       width : 160 * @unit_base_multimediaview;
-       height : 16 * @unit_base_multimediaview;
-       position : absolute;
-       border-radius : 1.5em;
+       width : 170 * @unit_base_multimediaview;
 }
 
-.ui-multimediaview-control .ui-volumecontrol .ui-volumebar .ui-value {
-       margin : 0;
-       padding : 0;
-       height : 16 * @unit_base_multimediaview;
-       position : absolute;
-       border-radius : 1.5em;
-}
-
-.ui-multimediaview-control .ui-volumecontrol .ui-volumebar .ui-handler {
+.ui-multimediaview-control .ui-volumecontrol .ui-volumebar .ui-handle {
        margin : 0;
        padding : 0;
        width : 30 * @unit_base_multimediaview;
        height : 30 * @unit_base_multimediaview;
-       position : absolute;
        border-style: solid;
        border-width: 1px;
        border-radius : 1.5em;
 }
 
-.ui-fullscreen-page {
-  padding: 0 !important;
+.ui-fullscreen-parents {
+       padding: 0 !important;
+       margin: 0 !important;
+       width: 100% !important;
+       height: 100% !important;
 }
 
 /* S
                        .LESSmultimediaview_bar_active_style();
                }
 
-               .ui-handler {
+               .ui-handle {
                        .LESSmultimediaview_bar_handle_style();
                        border-color : @color_multimediaview_button_border;
                }
diff --git a/src/themes/tizen/common/jquery.mobile.tizen.optionheader.less b/src/themes/tizen/common/jquery.mobile.tizen.optionheader.less
deleted file mode 100644 (file)
index 74af122..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-@import "config.less";
-
-
-.ui-option-header {
-    overflow: hidden;
-    background : @color_optionheader_Background;
-}
-
-.ui-option-header-1-row {
-    height: 106 * @unit_base;
-    border: none;
-}
-.ui-option-header-2-row {
-    height: 196 * @unit_base;
-    border: none;
-}
-
-.ui-option-header-row-1 {
-    height : 106 * @unit_base;
-}
-.ui-option-header-row-2 {
-    height: 196 * @unit_base;
-    margin-top: -2px;
-    padding: 0 * @unit_base 5 * @unit_base 6 * @unit_base 5 * @unit_base;
-    
-    div {
-           margin-top: 5 * @unit_base;
-           margin-bottom: 5 * @unit_base;
-       }
-}
-
-.ui-option-header .ui-btn {
-    display: block;
-    margin: 3 * @unit_base 5 * @unit_base 5 * @unit_base 5 * @unit_base;
-}
-
-.ui-option-header .ui-input-search .ui-btn {
-       display : none;
-}      
-       
-.ui-option-header .ui-btn-text {
-    line-height: 34 * @unit_base;
-    font-weight: bold;
-}
-.ui-option-header {
-       .ui-btn-down-s.ui-btn-hover-s .ui-btn-inner,
-       .ui-btn-down-s .ui-btn-inner {
-               background : @color_optionheader_bt_press;
-       }
-       .ui-btn-hover-s .ui-btn-inner,
-       .ui-btn-up-s .ui-btn-inner {
-               background : @color_optionheader_bt;
-       }
-
-       .ui-btn-inner {
-           padding-top: 6 * @unit_base;
-           padding-bottom: 6 * @unit_base;
-               color           : @color_optionheader_tab_text;     
-       }       
-}
-
-.ui-option-header .ui-controlgroup-horizontal .ui-btn {
-    display: inline-block !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: 5 * @unit_base !important;
-}
-.ui-option-header .ui-controlgroup-horizontal .ui-corner-right {
-    margin-right: 5 * @unit_base !important;
-}
-
-.ui-option-header-triangle-arrow {
-  top: -12 * @unit_base;
-  height:10 * @unit_base;
-  width:100%;
-  position:relative;
-  margin-bottom: -10 * @unit_base;
-}
-
-.ui-header.ui-option-header-resizing {
-       .ui-option-header {
-               .ui-btn {
-                       background : transparent;
-                       border : none;
-                       width : 100%;   
-                       top : 16 * @unit_base;          
-                       .ui-btn-inner {
-                               width : 92%;
-                               padding : 0.66em 0px 0.66em;
-                               margin : 0px auto;
-                       }
-               }
-               .input-search-bar .ui-btn {
-                       width : 28%; /* 134  * @unit_base; */
-               }
-       }
-}
-/*
-.ui-triangle {
-  color : @color_optionheader_Background; 
-
-  position: absolute;
-  bottom: 0px;
-  border-style: solid;
-       
-       margin-left : -10 * @unit_base;
-
-       border-left-width : 10 * @unit_base;
-       border-top-width : 0 * @unit_base;
-       border-right-width :10 * @unit_base;
-       border-bottom-width : 10 * @unit_base;
-       border-bottom-color : @color_optionheader_Background;
-}
-*/
-.ui-triangle-image{
-       background-image: url(images/00_winset_control_top_arrow.png); 
-       background-size:  100% 100%;
-
-       position : absolute;
-       width: 28 * @unit_base;
-       height : 24 * @unit_base;
-       left : 50%;
-}
-       
-.ui-btn-up-s, .ui-btn-hover-s {
-       .ui-icon-optiontray     {
-               background-size:  100% 100%;
-               background-image: url(images/00_winset_more.png);
-       }
-}
-.ui-btn-down-s {
-       .ui-icon-optiontray     {
-               background-size:  100% 100%;
-               background-image: url(images/00_winset_more_press.png);
-       }
-}
-
-.ui-header {
-       .ui-btn{
-               .ui-btn-icon-only {
-                       padding : 0 0 0 0;
-                       height : 100%;
-                       .ui-icon-optiontray     {
-                               width: 56 * @unit_base;
-                               height : 56 * @unit_base;
-
-                               left : 30 * @unit_base;
-                       }
-               }
-       }
-}
index a14f9f4..a7d9562 100644 (file)
@@ -40,6 +40,7 @@
                > .ui-popup-button-bg {
                        width : 100%;
                }
+               word-wrap : break-word;
        }
 
        .ui-popup-title {
                        vertical-align: middle;
 
                        .ui-btn {
-                               width: 130*@unit_base;
+                               width: 110*@unit_base;
                                height: 37*@unit_base;
                                margin-top: 0*@unit_base;
                                margin-bottom: 0*@unit_base;
                        vertical-align: middle;
 
                        .ui-btn {
-                               width: 130*@unit_base;
+                               width: 110*@unit_base;
                                height: 37*@unit_base;
                                margin-top: 0*@unit_base;
                                margin-bottom: 0*@unit_base;
 
        .center_title_2btn {
                .ui-popup-button-bg {
+                       padding-top: 11*@unit_base;
+                       padding-bottom: 11*@unit_base;
+                       vertical-align: middle;
+
                        .ui-btn {
-                               width: 130*@unit_base;
+                               width: 120*@unit_base;
+                               height: 37*@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;
+
+                               .ui-btn-inner {
+                                       padding-top: 5 * @unit_base;
+                                       padding-bottom: 5 * @unit_base;
+                                       padding-left : 20 * @unit_base;
+                                       padding-right : 20 * @unit_base;
+                               }
                        }
                }
        }
index 3e44c8d..d153b80 100644 (file)
@@ -44,6 +44,8 @@
 
 .ui-progressbar {
        position: relative;
+       margin-top: 18 * @unit_base;
+       margin-bottom: 18 * @unit_base;
        margin-left: @bar-margin;
        margin-right: @bar-margin;
        height: @bar-height;
index 6644c72..81addc7 100644 (file)
@@ -144,11 +144,10 @@ a.ui-slider-handle {
 
 .ui-slider-popup {
        position: absolute !important;
-       z-index: 100;
+       z-index: @z_base_popup;
 
        width: @popup-width;
        height: @popup-height;
-       top: -60 * @unit_base;
        padding-top: 0.1rem;
 
        color: @color_slider_popup_text;
index 8635dd8..cb4b9ad 100644 (file)
        left : 0px;
        border-top-right-radius : 10 * @unit_base;
        border-bottom-right-radius : 10 * @unit_base;
-       background : -webkit-linear-gradient(left,  rgba(246, 248, 239, 1) 0%,rgba(246,248,239,1) 100%);
+       background : -webkit-linear-gradient(left,  rgba(153, 153, 153, 1) 0%,rgba(246,248,239,1) 100%);
 }
 
 .ui-tabbar-divider-right {
        right : 0px;
        border-top-left-radius : 10 * @unit_base;
        border-bottom-left-radius : 10 * @unit_base;
-       background : -webkit-linear-gradient(right,  rgba(246, 248, 239, 1) 0%,rgba(246,248,239,1) 100%);
+       background : -webkit-linear-gradient(right,  rgba(153, 153, 153, 1) 0%,rgba(246,248,239,1) 100%);
 }
index 8a04bd6..b18bf90 100644 (file)
 .ui-scrollbar-thumb-y {
        height : 1.5rem !important;
 }
+
+.ui-virtualgrid-overflow-indicator-x-top {
+       position : absolute;
+       display : block;
+       left : 0;
+       top : 0;
+       width : 10 * @unit_base;
+       height : 100%;
+       opacity : 0;
+       background : -webkit-gradient(linear,
+                               right top,
+                               left top,
+                               color-stop(0, rgba(128,128,128,0)),
+                               color-stop(1, rgba(128,128,128,1)));
+       pointer-events : none;
+}
+
+.ui-virtualgrid-overflow-indicator-x-bottom {
+       position : absolute;
+       display : block;
+       right : 0;
+       bottom : 0;
+       width : 10 * @unit_base;
+       height : 100%;
+       opacity : 0;
+       background : -webkit-gradient(linear,
+                               right top,
+                               left top,
+                               color-stop(0, rgba(128,128,128,1)),
+                               color-stop(1, rgba(128,128,128,0)));
+       pointer-events : none;
+}
+
+.ui-virtualgrid-overflow-indicator-y-top {
+       position : absolute;
+       display : block;
+       top : 0;
+       width : 100%;
+       height : 10 * @unit_base;
+       opacity : 0;
+       background : -webkit-gradient(linear,
+                               left bottom,
+                               left top,
+                               color-stop(0, rgba(128,128,128,0)),
+                               color-stop(1, rgba(128,128,128,1)));
+       pointer-events : none;
+}
+
+.ui-virtualgrid-overflow-indicator-y-bottom {
+       position : absolute;
+       display : block;
+       bottom : 0;
+       width : 100%;
+       height : 10 * @unit_base;
+       opacity : 0;
+       background : -webkit-gradient(linear,
+                               left bottom,
+                               left top,
+                               color-stop(0, rgba(128,128,128,1)),
+                               color-stop(1, rgba(128,128,128,0)));
+       pointer-events : none;
+}
+
+/*
+ * padding here set to zero - otherwise the list scrolls underneith the top heading and can be seen above it
+ */
+.ui-content.ui-virtualgrid-content {
+  padding : 0;
+}
\ No newline at end of file
index c18e491..24c2322 100644 (file)
     to { -moz-transform: translate3d(0, 100%, 0); }
 }
 
+/* slide up + fade */
+
+.slideupfade.out {
+       -webkit-animation-name: fadeout;
+       -moz-animation-name: fadeout;
+       -webkit-animation-duration: 100ms;
+       -moz-animation-duration: 100ms;
+}
+
+.slideupfade.in {
+       -webkit-transform: translate3d(0, 0, 0);
+       -webkit-animation-name: slideupfadeinfrombottom;
+       -moz-transform: translate3d(0, 0, 0);
+       -moz-animation-name: slideupfadeinfrombottom;
+       -webkit-animation-duration: 250ms;
+       -moz-animation-duration: 250ms;
+}
+
+.slideupfade.in.reverse {
+       -webkit-animation-name: fadein;
+       -moz-animation-name: fadein;
+       -webkit-animation-duration: 150ms;
+       -moz-animation-duration: 150ms;
+}
+
+.slideupfade.out.reverse {
+       -webkit-transform: translate3d(0, 5%, 0);
+       -moz-transform: translate3d(0, 5%, 0);
+       -webkit-animation-name: slideupfadeouttobottom;
+       -moz-animation-name: slideupfadeouttobottom;
+       -webkit-animation-duration: 200ms;
+       -moz-animation-duration: 200ms;
+}
+
+@-webkit-keyframes slideupfadeinfrombottom {
+    from {
+               opacity: 0;
+               -webkit-transform: translate3d(0, 5%, 0);
+       }
+    to {
+               opacity: 1;
+               -webkit-transform: translate3d(0, 0, 0);
+       }
+}
+@-moz-keyframes slideupfadeinfrombottom {
+    from {
+               opacity: 0;
+               -moz-transform: translate3d(0, 5%, 0);
+       }
+    to {
+               opacity: 1;
+               -moz-transform: translate3d(0, 0, 0);
+       }
+}
+
+@-webkit-keyframes slideupfadeouttobottom {
+    from {
+               opacity: 1;
+               -webkit-transform: translate3d(0, 0, 0);
+       }
+    to {
+               opacity: 0;
+               -webkit-transform: translate3d(0, 5%, 0);
+       }
+}
+@-moz-keyframes slideupfadeouttobottom {
+    from {
+               opacity: 1;
+               -moz-transform: translate3d(0, 0, 0);
+       }
+    to {
+               opacity: 0;
+               -moz-transform: translate3d(0, 5%, 0);
+       }
+}
+
+/* slide down + fade */
+
+.slidedownfade.out {
+       -webkit-animation-name: fadeout;
+       -moz-animation-name: fadeout;
+       -webkit-animation-duration: 100ms;
+       -moz-animation-duration: 100ms;
+}
+
+.slidedownfade.in {
+       -webkit-transform: translate3d(0, 0, 0);
+       -webkit-animation-name: slidedownfadeinfromtop;
+       -moz-transform: translate3d(0, 0, 0);
+       -moz-animation-name: slidedownfadeinfromtop;
+       -webkit-animation-duration: 250ms;
+       -moz-animation-duration: 250ms;
+}
+
+.slidedownfade.in.reverse {
+       -webkit-animation-name: fadein;
+       -moz-animation-name: fadein;
+       -webkit-animation-duration: 150ms;
+       -moz-animation-duration: 150ms;
+}
+
+.slidedownfade.out.reverse {
+       -webkit-transform: translate3d(0, -5%, 0);
+       -moz-transform: translate3d(0, -5%, 0);
+       -webkit-animation-name: slidedownfadeouttotop;
+       -moz-animation-name: slidedownfadeouttotop;
+       -webkit-animation-duration: 200ms;
+       -moz-animation-duration: 200ms;
+}
+
+@-webkit-keyframes slidedownfadeinfromtop {
+    from {
+               opacity: 0;
+               -webkit-transform: translate3d(0, -5%, 0);
+       }
+    to {
+               opacity: 1;
+               -webkit-transform: translate3d(0, 0, 0);
+       }
+}
+@-moz-keyframes slidedownfadeinfromtop {
+    from {
+               opacity: 0;
+               -moz-transform: translate3d(0, -5%, 0);
+       }
+    to {
+               opacity: 1;
+               -moz-transform: translate3d(0, 0, 0);
+       }
+}
+
+@-webkit-keyframes slidedownfadeouttotop {
+    from {
+               opacity: 1;
+               -webkit-transform: translate3d(0, 0, 0);
+       }
+    to {
+               opacity: 0;
+               -webkit-transform: translate3d(0, -5%, 0);
+       }
+}
+@-moz-keyframes slidedownfadeouttotop {
+    from {
+               opacity: 1;
+               -moz-transform: translate3d(0, 0, 0);
+       }
+    to {
+               opacity: 0;
+               -moz-transform: translate3d(0, -5%, 0);
+       }
+}
+
 /* slide fade */
 
 .slidefade.out {
index af327d1..b7bf71f 100644 (file)
@@ -21,7 +21,6 @@ CSS_SRCS=     ../common/jquery.mobile.theme.less.css \
                ../common/jquery.mobile.controlgroup.less.css \
                ../common/jquery.mobile.listview.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.less.css \
                ../common/jquery.mobile.tizen.datetimepicker.less.css \
@@ -34,7 +33,6 @@ CSS_SRCS=     ../common/jquery.mobile.theme.less.css \
                ../common/jquery.mobile.tizen.notification.less.css \
                ../common/jquery.mobile.tizen.swipe.less.css \
                ../common/jquery.mobile.tizen.fastscroll.less.css \
-               ../common/jquery.mobile.tizen.dayselector.less.css \
                ../common/jquery.mobile.tizen.toggleswitch.less.css \
                ../common/jquery.mobile.tizen.triangle.less.css \
                ../common/jquery.mobile.tizen.tokentextarea.less.css \
diff --git a/src/themes/tizen/tizen-white/images/controls/button/00_button_bars.png b/src/themes/tizen/tizen-white/images/controls/button/00_button_bars.png
new file mode 100644 (file)
index 0000000..0c34258
Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controls/button/00_button_bars.png differ
diff --git a/src/themes/tizen/tizen-white/images/controls/button/00_button_bars_press.png b/src/themes/tizen/tizen-white/images/controls/button/00_button_bars_press.png
new file mode 100644 (file)
index 0000000..8cf6cc1
Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controls/button/00_button_bars_press.png differ
index 0c34258..51cef23 100644 (file)
Binary files a/src/themes/tizen/tizen-white/images/controls/button/00_button_home.png and b/src/themes/tizen/tizen-white/images/controls/button/00_button_home.png differ
index 8cf6cc1..92d6a22 100644 (file)
Binary files a/src/themes/tizen/tizen-white/images/controls/button/00_button_home_press.png and b/src/themes/tizen/tizen-white/images/controls/button/00_button_home_press.png differ
index bfb2dad..2f42146 100644 (file)
 /***************************************************************************
                         Button(connected with other winset)
 ***************************************************************************/
+
+@color_button_text_black:      rgb(0, 0, 0);
+
 @color_button_EditText:         rgb(249, 249, 249);
 @color_button_EditTextPress:    rgb(61, 61, 61);
 
-@color_button_text_normal:      rgb(54, 49, 51);
+@color_button_text_normal:      rgb(58, 58, 58);
 @color_button_text_press:       rgb(248, 246, 239);
 @color_button_text_white:       rgb(249, 249, 249);
 
 
 @color_ctxbutton_press:            rgb(59, 115, 182);
 
-@color_ctxpopup_timepicker_text:        rgba( 249, 249, 249, 0.4 );
-@color_ctxpopup_timepicker_text_focus:  rgba( 249, 249, 249, 1 );
-@color_bar_back_btn_press : rgba(26, 82, 116, 0.3); /* #1A5274 */
+@color_ctxpopup_timepicker_text:        rgba( 255, 255, 255, 0.7 );
+@color_ctxpopup_timepicker_text_focus:  rgba( 255, 255, 255, 1 );
 
 
 /***************************************************************************
 @font_size_datetime_main_text:              22 * @unit_base;
 @font_size_datetime_sub_text:               16 * @unit_base;
 
-
-/***************************************************************************
-                   DaySelector
-***************************************************************************/
-@color_dayselector_Btn_Sat:            rgba(0, 168, 231, 1); /* #00a8e7 */
-@color_dayselector_Btn_Sun:            rgba(240, 20, 2, 1); /* #f01402 */
-@color_dayselector_Btn_Mon_to_Fri:     rgba(249, 249, 249, 1); /* #f9f9f9 */   
-@color_dayselector_Btn_border:         rgba(26, 82, 116, 1); /* #f9f9f9 */     
-
-@color_dayselector_Btn_normal_start:   rgb(126, 157, 178);
-@color_dayselector_Btn_normal_end:     rgb(84,121,144);
-
-@color_dayselector_Btn_press_start:    rgb(59,119,150);
-@color_dayselector_Btn_press_end:      rgb(47,91,117);
-
-
-.LESSDayselectorButtonNormal{
-       .LESSbackground-with-gradient(top, @color_dayselector_Btn_normal_start, @color_dayselector_Btn_normal_end);
-}
-
-.LESSDayaselectorButtonPress{
-       .LESSbackground-with-gradient(top, @color_dayselector_Btn_press_start, @color_dayselector_Btn_press_end);
-}
-
-
-/***************************************************************************
-                   OptionHeader
-***************************************************************************/
-@color_optionheader_Background:        rgba(26, 82, 116, 1); 
-@color_optionheader_bt:                -webkit-linear-gradient(top,  rgb(56,112,141) 0%,rgb(36,93,128) 100%);
-@color_optionheader_bt_press:  -webkit-linear-gradient(top,  rgb(74,164,218) 0%,rgb(43,138,195) 100%);
-@color_optionheader_tab_text:  rgba(249, 249, 249, 1); /* #f9f9f9 */
-
-
 /***************************************************************************
                    SegmentControl
 ***************************************************************************/
 @color_segmentcontrol_btn_press_start : rgb(59,119,150);
 @color_segmentcontrol_btn_press_end : rgb(47,91,117);
 
-@color_segmentcontrol_Seg_text : rgba(249, 249, 249, 1); /* #F9F9F9*/
-@color_segmentcontrol_Seg_text_pressed : rgba(249, 249, 249, 1); /* #F9F9F9*/
+@color_segmentcontrol_Seg_text : rgba(58, 58, 58, 1);  /* B052L4 : Title text button */
+@color_segmentcontrol_Seg_text_pressed : rgb(59,119,150);
 
 
 /***************************************************************************
 .LESSpopup_padding_style{
 }
 
-
-/***************************************************************************
-                    Button
-***************************************************************************/
-
-@color_button_text_black:      rgb(0, 0, 0);
-
-@color_circlebutton_hover:             rgb(239, 119, 126);
-@color_circlebutton_hover_webkit:      -webkit-gradient(linear, left top, left bottom, from(rgb(198, 78, 85)), to(rgb(166, 43, 45)));
-@color_circlebutton_hover_moz:         -moz-linear-gradient(top, rgb(198, 78, 85), rgb(166,43,45));
-@color_circlebutton_press:             rgb(67, 160, 217);
-@color_circlebutton_press_webkit:       -webkit-gradient(linear, left top, left bottom, from(rgb(67, 160, 217)), to(rgb(56, 139, 185)));
-@color_circlebutton_press_moz:         -moz-linear-gradient(top, rgb(67, 160, 217), rgb(56, 139, 185));
-
-
-@color_button_switch_BGon:             rgb(42, 126, 172);
-@color_button_switch_BGon_webkit:      -webkit-gradient(linear, left top, left bottom, from(rgb(33, 116, 167)), to(rgb(75, 165, 219)));
-@color_button_switch_BGon_moz:         -moz-linear-gradient(top, rgb(33, 116, 167), rgb(75, 165, 219));
-@color_button_switch_BGoff:            rgb(151, 161, 167);
-@color_button_switch_BGoff_text_color: rgb(203, 203, 203);
-@color_button_switch_BGoff_webkit:     -webkit-gradient(linear, left top, left bottom, from(rgb(114, 114, 114)), to(rgb(141, 141, 141)));
-@color_button_switch_BGoff_moz:                -moz-linear-gradient(top, rgb(114, 114, 114), rgb(141, 141, 141));
-@color_button_switch_BGreed:           rgb(253, 253, 253);
-@color_button_switch_BGreed_webkit:    -webkit-gradient(linear, left top, left bottom, from(rgb(253, 253, 253)), to(rgb(231, 231, 231)));
-@color_button_switch_BGreed_moz:       -moz-linear-gradient(top, rgb(253, 253, 253), rgb(231, 231, 231));
-
-@radius_button_switch: 4px;
-@radius_button_switch_reed: 2px;
-
-@color_button_edit_press:              rgb(147, 24, 24);
-@color_button_edit_press_webkit:       -webkit-gradient(linear, left top, left bottom, from(rgb(147, 24,24)), to(rgb(110, 23, 23)));
-@color_button_edit_press_moz:          -moz-linear-gradient(top, rgb(147, 24, 24), rgb(110, 23, 23));
-
-
-.LESStoggleswitch_on_style{
-       background: @color_button_switch_BGon;
-       background: @color_button_switch_BGon_webkit;
-       background: @color_button_switch_BGon_moz;
-       border-radius: @radius_button_switch;
-       -webkit-border-radius: @radius_button_switch;
-       -moz-border-radius: @radius_button_switch;
-}
-
-.LESStoggleswitch_off_style{
-       color: @color_button_switch_BGoff_text_color;
-       background: @color_button_switch_BGoff;
-       background: @color_button_switch_BGoff_webkit;
-       background: @color_button_switch_BGoff_moz;
-       border-radius: @radius_button_switch;
-       -webkit-border-radius: @radius_button_switch;
-       -moz-border-radius: @radius_button_switch;
-}
-
-.LESStoggleswitch_reed_style{
-       background: @color_button_switch_BGreed;
-       background: @color_button_switch_BGreed_webkit;
-       background: @color_button_switch_BGreed_moz;
-       border-radius: @radius_button_switch_reed;
-       -webkit-border-radius: @radius_button_switch_reed;
-       -moz-border-radius: @radius_button_switch_reed;
-}
-
-.LESSbutton_editpress_style{
-       background: @color_button_edit_press;
-       background: @color_button_edit_press_webkit;
-       background: @color_button_edit_press_moz;
-}
-
-.LESSbutton_edit_padding{
-       padding: 0.5em 0.8em;
-}
-
-
 /***************************************************************************
                     Tickernoti
 ***************************************************************************/
 @color_smallpopup_bg:                  rgb(68, 68, 68);
 @color_smallpopup_text:                        rgb(255, 255, 255);
 
-
-/***************************************************************************
-                    No Contents
-***************************************************************************/
-@color_nocontents_text:                        rgb(128, 128, 128);
-
-
 /***************************************************************************
                     Slider
 ***************************************************************************/
diff --git a/src/widgets/popupwindow_ctxpopup/css/jquery.mobile.tizen.ctxpopup.css b/src/widgets/popupwindow_ctxpopup/css/jquery.mobile.tizen.ctxpopup.css
deleted file mode 100644 (file)
index fdc4071..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/* 
- * The settings in this file are part of the theme. They are not part of the structure of ctxpopup.
- * In the default theme, ui-body-* has a border width of 1px. So, to make the triangles cross this border, we set them in
- * by 1px.
- */
-
-.ui-ctxpopup-row .ui-triangle-top {
-    top: 1px;
-}
-
-.ui-ctxpopup-row .ui-triangle-left {
-    left: 1px;
-}
-
-.ui-ctxpopup-row .ui-triangle-right {
-    right: 1px;
-}
-
-.ui-ctxpopup-row .ui-triangle-bottom {
-    bottom: 1px;
-}
diff --git a/src/widgets/popupwindow_ctxpopup/less/jquery.mobile.tizen.ctxpopup.less b/src/widgets/popupwindow_ctxpopup/less/jquery.mobile.tizen.ctxpopup.less
deleted file mode 100644 (file)
index b79df71..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-.ui-ctxpopup {
-    display: table;
-
-    .ui-ctxpopup-row {
-        display: table-row;
-
-        .ui-ctxpopup-cell {
-            display: table-cell;
-        }
-    }
-}
diff --git a/tests/additional-unit-tests/autodivider/autodivider-tests.js b/tests/additional-unit-tests/autodivider/autodivider-tests.js
new file mode 100755 (executable)
index 0000000..11b8d50
--- /dev/null
@@ -0,0 +1,83 @@
+/*
+ * Unit Test : autodivider
+ *
+ *
+ */
+/*jslint browser: true*/
+/*global $,  jQuery,  test,  equal,  ok*/
+
+$ ( document ).ready ( function ( ) {
+       module ("Autodivider") ;
+
+       var unit_listdividers_test = function ( widget ) {
+               var li ;
+               /*markup*/
+               equal ( widget.hasClass ("ui-listview") ,  true, "Markup check") ;
+               equal ( widget.find ( ' li.ui-li ' ).length,  24, "Markup check") ;
+               equal ( widget.find (":jqmData(role=list-divider)").length,  8, "Markup check : list dividers count") ;
+               equal ( widget.find ( ' li.ui-li-divider ' ).length,  8, "Markup check : list dividers count") ;
+
+               /*adding element which fits in last divisiov*/
+               li = "<li>Harry</li>";
+               $ ( li ).appendTo ( widget ) ;
+               $ ( widget ).listview ("refresh") ;
+               equal ( widget.find ( ' li.ui-li ' ).length,  25, "API : refresh check") ;
+
+               /*adding element which need new divisiov*/
+               li = "<li>Jack</li>";
+               $ ( li ).appendTo ( widget ) ;
+               $ ( widget ).listview ("refresh") ;
+               equal ( widget.find ( ' li.ui-li ' ).length,  27, "API : refresh check") ;
+       } ;
+
+       test ("Autodivider",  function ( ) {
+               // trigger pagecreate
+               $ ("#autodivider-unit-test").page ( ) ;
+               /* Initialize */
+               $ ( ' #autodividersample ' ).listview ( ) ;
+               unit_listdividers_test ( $ ( ' #autodividersample ' ) ,  {button : ' call ' ,  cancel : true} ) ;
+
+       } ) ;
+
+       test ("autodivider- dynamic",  function ( ) {
+
+               var createEvent = false ,
+                       listHTMML = ' <ul data-role="listview"id="autodividersample1"data-autodividers="alpha"> ' +
+                                                                                        ' <li><a href="#">Adam Kinkaid</a></li> ' +
+                                                                                        ' <li><a href="#">Alex Wickerham</a></li> ' +
+                                                                                        ' <li><a href="#">Avery Johnson</a></li> ' +
+                                                                                        ' <li><a href="#">Bob Cabot</a></li> ' +
+                                                                                        ' <li><a href="#">Caleb Booth</a></li> ' +
+                                                                                        ' <li><a href="#">Christopher Adams</a></li> ' +
+                                                                                        ' <li><a href="#">Culver James</a></li> ' +
+                                                                                        ' <li><a href="#">David Walsh</a></li> ' +
+                                                                                        ' <li><a href="#">Drake Alfred</a></li> ' +
+                                                                                        ' <li><a href="#">Elizabeth Bacon</a></li> ' +
+                                                                                        ' <li><a href="#">Emery Parker</a></li> ' +
+                                                                                        ' <li><a href="#">Enid Voldon</a></li> ' +
+                                                                                        ' <li><a href="#">Francis Wall</a></li> ' +
+                                                                                        ' <li><a href="#">Graham Smith</a></li> ' +
+                                                                                        ' <li><a href="#">Greta Peete</a></li> ' +
+                                                                                        ' <li><a href="#">Harvey Walls</a></li> ' +
+                                                                ' </ul> ' ;
+
+               // trigger pagecreate
+               $ ("#autodivider-unit-test-dynamic").page ( ) ;
+
+               /* Initialize */
+               $ ("#autodivider-unit-test-dynamic").find (":jqmData(role=contents)").append ( listHTMML ) ;
+               equal ( $ ("#autodivider-unit-test-dynamic").find ( ' li ' ).length,  16, "Markup check before autodividers created") ;
+               $ ( ' #autodividersample1 ' ).listview ( {create : function ( ) {
+                       createEvent = true ;
+               }} ) ;
+
+               $ ("#autodivider-unit-test-dynamic").find (":jqmData(role=contents)").trigger ( ' create ' ) ;
+               $ ( ' #autodividersample1 ' ).listview ( ) ;
+
+               equal ( createEvent,  true, "Create Event") ;
+               equal ( $ ("#autodivider-unit-test-dynamic").find ( ' li.ui-li ' ).length,  24, "Markup check after autodividers created") ;
+               unit_listdividers_test ( $ ( ' #autodividersample1 ' ) ) ;
+
+       } ) ;
+
+} ) ;
diff --git a/tests/additional-unit-tests/autodivider/index.html b/tests/additional-unit-tests/autodivider/index.html
new file mode 100755 (executable)
index 0000000..30a04e8
--- /dev/null
@@ -0,0 +1,76 @@
+<!DOCTYPE html>
+<html>
+       <head>
+               <script src="../../../build/tizen-web-ui-fw/latest/js/jquery.js"></script>
+               <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.min.js"></script>
+               <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw.js"
+                       data-framework-theme="tizen-white"
+                       data-framework-viewport-scale=false>
+               </script>
+
+               <link rel="stylesheet" href="../../../libs/js/jquery-mobile-1.2.0/external/qunit.css" />
+               <script src="../../../libs/js/jquery-mobile-1.2.0/external/qunit.js"></script>
+               <script src="autodivider-tests.js"></script>
+               <title>Autodividers</title>
+       </head>
+
+       <body>
+               <h1 id="qunit-header">Autodividers</h1>
+               <h2 id="qunit-banner"></h2>
+               <div id="qunit-testrunner-toolbar"></div>
+               <h2 id="qunit-userAgent"></h2>
+               <ol id="qunit-tests"></ol>
+
+               <div id="qunit-fixture">
+                       <div data-role="page" id="dummy-page">
+                               <div data-role="header" data-position="fixed">
+                                       <h1>Dummy</h1>
+                               </div>
+                               <div data-role="contents">
+                               </div>
+                       </div>
+
+                       <div data-role="page" id="autodivider-unit-test" data-add-back-btn="true">
+                               <div data-role="header" data-position="fixed">
+                                       <h1>Autodividers</h1>
+                                       <input type="search" data-cancel-btn='true' name="search" data-icon="call" id="searchInput" value=""/>
+                               </div>
+                               <div data-role="content" id="autodivider-content">
+                                                               <ul data-role="listview" id='autodividersample' data-autodividers="alpha">
+                                                       
+                                                               <li><a href="#">Adam Kinkaid</a></li>
+                                                               <li><a href="#">Alex Wickerham</a></li>
+                                                               <li><a href="#">Avery Johnson</a></li>
+                                                               
+                                                               <li><a href="#">Bob Cabot</a></li>
+                                                               
+                                                               <li><a href="#">Caleb Booth</a></li>
+                                                               <li><a href="#">Christopher Adams</a></li>
+                                                               <li><a href="#">Culver James</a></li>
+                                                               
+                                                               <li><a href="#">David Walsh</a></li>
+                                                               <li><a href="#">Drake Alfred</a></li>
+                                                               
+                                                               <li><a href="#">Elizabeth Bacon</a></li>
+                                                               <li><a href="#">Emery Parker</a></li>
+                                                               <li><a href="#">Enid Voldon</a></li>
+                                                       
+                                                               <li><a href="#">Francis Wall</a></li>
+                                                               
+                                                               <li><a href="#">Graham Smith</a></li>
+                                                               <li><a href="#">Greta Peete</a></li>
+                                                               
+                                                               <li><a href="#">Harvey Walls</a></li>
+                                                       </ul>
+                               </div>
+                       </div>
+               </div>
+               <div data-role="page" id="autodivider-unit-test-dynamic">
+                               <div data-role="header" data-position="fixed">
+                                       <h1>Dummy</h1>
+                               </div>
+                               <div data-role="contents">
+                               </div>
+                       </div>
+       </body>
+</html>
diff --git a/tests/additional-unit-tests/button/button-tests.js b/tests/additional-unit-tests/button/button-tests.js
new file mode 100755 (executable)
index 0000000..5a53ddb
--- /dev/null
@@ -0,0 +1,224 @@
+/*
+ * Unit Test: Button
+ *
+ * Hyunjung Kim <hjnim.kim@samsung.com>
+ *
+ */
+/*jslint browser: true*/
+/*global $, jQuery, test, equal, ok*/
+$("#checkboxpage").live ("pageinit", function ( event ) {
+
+       module ("button") ;
+
+       var unit_button = function ( widget, type ) {
+               var buttonClassPrefix = "ui-btn",
+                       buttonText = type,
+                       icon,
+                       position,
+                       buttonStyle,
+                       hasClass;
+
+               ok ( widget.hasClass ( buttonClassPrefix ) , "Create - Button") ;
+
+               if ( widget.jqmData ("inline") ) {
+                       ok ( widget.hasClass ( buttonClassPrefix + "-inline") , "Style - Inline") ;
+               } else {
+                       ok ( !widget.hasClass ( buttonClassPrefix + "-inline") , "Style - Non Inline") ;
+               }
+
+               if ( !widget.children ( ).first ( ).hasClass ( buttonClassPrefix + "-hastxt") ) {
+                       buttonText = "";
+               }
+
+               // Text Trim, CausejQueryMobile ( JQM ) 1.1 forced to add -"\u00a0"in buttonIcon ( ButtonMarkup )
+               // JQM 1.1 buttonMarkup code :
+               // - if ( buttonIcon ) buttonIcon.appendChild ( document.createTextNode ("\u00a0") ) ;
+               equal ( widget.text ( ).trim ( ) , buttonText , "Button Text") ;
+               icon = widget.jqmData ("icon") ;
+               if ( icon !== undefined ) {
+                       ok ( widget.children ( ).children ( ).hasClass ("ui-icon-" + icon ) , "Style - Button Icon") ;
+               }
+               if ( icon !== undefined && buttonText != "") {
+                       position = widget.jqmData ("iconpos") ;
+                       if ( position === undefined ) {
+                               position = "left";
+                       }
+                       ok ( widget.children ( ).children ( ).first ( ).hasClass ( buttonClassPrefix + "-text-padding-" + position ) , "Style - Button Icon, Text Position") ;
+               }
+
+               buttonStyle = widget.jqmData ("style") ;
+               if ( buttonStyle !== undefined ) {
+                       switch ( buttonStyle ) {
+                       case "circle":
+                               hasClass = ".ui-btn-corner-circle, .ui-btn-icon_only";
+                               break;
+                       case "edit":
+                               hasClass = ".ui-btn-edit";
+                               break;
+                       case "nobg":
+                               hasClass = ".ui-btn-icon-nobg, .ui-btn-icon_only";
+                               break;
+                       }
+                       ok ( widget.children ( ).is ( hasClass ) ) ;
+               }
+
+               // Check APIs
+               widget.button ( ).button ("disable") ;
+               equal ( widget.attr ("disabled") , "disabled", "button disable test") ;
+
+               widget.button ( ).button ("enable") ;
+               equal ( widget.attr ("disable") , undefined, "button enable test") ;
+       },
+
+               unit_button_events = function ( ) {
+
+                       var createEvent = false,
+                               clickEvent = false,
+                               buttonClassPrefix = "ui-btn",
+                               widget,
+                               markup ;
+
+                       //remove all controls form content
+                       $('#checkboxpage').find(":jqmData(role=contents)").empty( ) ;
+                       markup = '<div data-role="button"id="button-0">Text Button Dynamic</div>';
+                       $('#checkboxpage').find(":jqmData(role=contents)").append( markup ) ;
+                       widget = $("#button-0") ;
+
+                       /*Bind Event*/
+                       widget.button( {create: function ( ) {
+                               createEvent = true ;
+                       }} ) ;
+
+                       widget.bind("click", function ( ) {
+                               clickEvent = true ;
+                       } ) ;
+
+                       $('#checkboxpage').find(":jqmData(role=contents)").trigger('create') ;
+                       widget.button ( ) ;
+
+                       /*Check Event*/
+                       $('#checkboxpage').find(":jqmData(role=contents)").trigger('create') ;
+                       ok( widget.hasClass ( buttonClassPrefix ) , "Create - Button") ;
+                       ok( createEvent , "Button Create Event") ;
+                       widget.trigger ('click') ;
+                       ok( clickEvent , "Button Click Event") ;
+               };
+
+       test ("Button", function ( ) {
+               unit_button ( $("#button-0") , "Text Button") ;
+       } ) ;
+
+       test ("Button - Inline", function ( ) {
+               unit_button ( $("#button-1") , "Text Button Inline") ;
+       } ) ;
+
+       test ("Button - Inline, Icon", function ( ) {
+               unit_button ( $("#button-2") , "Call Icon") ;
+       } ) ;
+
+       test ("Button - Inline, Call Icon, Icon Position ( Right )", function ( ) {
+               unit_button ( $("#button-3") , "Icon Text") ;
+       } ) ;
+
+       test ("Button - Inline, Only Icon ( Reveal )", function ( ) {
+               unit_button ( $("#button-4") , "Non Text Button") ;
+       } ) ;
+
+       test ("Button - Inline, Only Icon ( Send ) , circle", function ( ) {
+               unit_button ( $("#button-5") , "Non Text Button") ;
+       } ) ;
+
+       test ("Button - Inline, Only Icon ( Favorite ) , nobackground", function ( ) {
+               unit_button ( $("#button-6") , "Non Text Button") ;
+       } ) ;
+
+       test ("Button", function ( ) {
+               var markup;
+               //remove all controls form content
+               $('#checkboxpage').find (":jqmData(role=contents)").empty ( ) ;
+
+               markup = '<div data-role = "button" id = "button-0">Text Button Dynamic</div>';
+               $('#checkboxpage').find (":jqmData(role=contents)").append ( markup ) ;
+               $('#checkboxpage').find (":jqmData(role=contents)").trigger ( 'create' ) ;
+               unit_button ( $("#button-0") , "Text Button Dynamic") ;
+       } ) ;
+
+       test ("Button - Inline", function ( ) {
+               var markup ;
+               //remove all controls form content
+               $('#checkboxpage').find (":jqmData(role=contents)").empty ( ) ;
+
+               markup = '<div data-role = "button" id = "button-1">Text Button Inline Dynamic</div>';
+               $('#checkboxpage').find (":jqmData(role=contents)").append ( markup ) ;
+               $('#checkboxpage').find (":jqmData(role=contents)").trigger ('create') ;
+               unit_button ( $("#button-1") , "Text Button Inline Dynamic") ;
+
+       } ) ;
+
+       test ("Button - Inline, Icon", function ( ) {
+               var markup;
+               //remove all controls form content
+               $('#checkboxpage').find (":jqmData(role=contents)").empty ( ) ;
+
+               markup = '<div data-role = "button" id = "button-2">Call Icon Dynamic</div>';
+               $('#checkboxpage').find (":jqmData(role=contents)").append ( markup ) ;
+               $('#checkboxpage').find (":jqmData(role=contents)").trigger ('create') ;
+               unit_button ( $("#button-2") , "Call Icon Dynamic") ;
+
+       } ) ;
+
+       test ("Button - Inline, Call Icon, Icon Position ( Right )", function ( ) {
+               var markup;
+               //remove all controls form content
+               $('#checkboxpage').find (":jqmData(role=contents)").empty ( ) ;
+
+               markup = '<div data-role = "button" id = "button-3">Icon Text Dynamic</div>';
+               $('#checkboxpage').find (":jqmData(role=contents)").append ( markup ) ;
+               $('#checkboxpage').find (":jqmData(role=contents)").trigger ('create') ;
+               unit_button ( $("#button-3") , "Icon Text Dynamic") ;
+
+       } ) ;
+
+       test ("Button - Inline, Only Icon ( Reveal )", function ( ) {
+               var markup;
+               //remove all controls form content
+               $('#checkboxpage').find (":jqmData(role=contents)").empty ( ) ;
+
+               markup = '<div data-role = "button" id = "button-4">Non Text Button Dynamic</div>';
+               $('#checkboxpage').find (":jqmData(role=contents)").append ( markup ) ;
+               $('#checkboxpage').find (":jqmData(role=contents)").trigger ('create') ;
+               unit_button ( $("#button-4") , "Non Text Button Dynamic") ;
+
+       } ) ;
+
+       test ("Button - Inline, Only Icon ( Send ) , circle", function ( ) {
+               var markup;
+               //remove all controls form content
+               $('#checkboxpage').find (":jqmData(role=contents)").empty ( ) ;
+
+               markup = '<div data-role = "button" id = "button-5">Non Text Button Dynamic</div>';
+               $('#checkboxpage').find (":jqmData(role=contents)").append ( markup ) ;
+               $('#checkboxpage').find (":jqmData(role=contents)").trigger ('create') ;
+               unit_button ( $("#button-5") , "Non Text Button Dynamic") ;
+
+       } ) ;
+
+       test ("Button - Inline, Only Icon ( Favorite ) , nobackground", function ( ) {
+               var markup;
+               //remove all controls form content
+               $('#checkboxpage').find (":jqmData(role=contents)").empty ( ) ;
+
+               markup = '<div data-role = "button" id = "button-6">Non Text Button Dynamic</div>';
+               $('#checkboxpage').find (":jqmData(role=contents)").append ( markup ) ;
+               $('#checkboxpage').find (":jqmData(role=contents)").trigger ('create') ;
+               unit_button ( $("#button-6") , "Non Text Button Dynamic") ;
+
+       } ) ;
+
+       test ("Button", function ( ) {
+               //remove all controls form content
+               $('#checkboxpage').find (":jqmData(role=contents)").empty ( ) ;
+               unit_button_events ( ) ;
+       } ) ;
+
+} ) ;
diff --git a/tests/additional-unit-tests/button/index.html b/tests/additional-unit-tests/button/index.html
new file mode 100755 (executable)
index 0000000..b23593e
--- /dev/null
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+<head>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/jquery.js"></script>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.min.js"></script>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw.js"
+               data-framework-theme="tizen-white"
+               data-framework-viewport-scale=false>
+       </script>
+
+       <link rel="stylesheet" href="../../../libs/js/jquery-mobile-1.2.0/external/qunit.css" />
+
+       <script src="../../../libs/js/jquery-mobile-1.1.0/tests/jquery.testHelper.js"></script>
+       <script src="../../../libs/js/jquery-mobile-1.2.0/external/qunit.js"></script>
+       <script src="button-tests.js"></script>
+       <title>Button</title>
+</head>
+
+<body>
+
+<h1 id="qunit-header">Button</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+
+<div id="qunit-fixture">
+       <div data-role="page" id="checkboxpage">
+               <div data-role="contents">
+                       <div data-role="button" id="button-0">Text Button</div>
+                       <div data-role="button" data-inline="true" id="button-1">Text Button Inline</div>
+                       <div data-role="button" data-inline="true" data-icon="reveal" id="button-2">Call Icon</div>
+                       <div data-role="button" data-inline="true" data-icon="call" data-iconpos="right" id="button-3">Icon Text</div>
+                       <div data-role="button" data-inline="true" data-icon="reveal" id="button-4"></div>
+                       <div data-role="button" data-inline="true" data-icon="send" data-style="circle" id="button-5"></div>
+                       <div data-role="button" data-inline="true" data-icon="favorite" data-style="nobg" id="button-6"></div>
+               </div>
+       </div>
+</div>
+
+</body>
+</html>
diff --git a/tests/additional-unit-tests/check/check-tests.js b/tests/additional-unit-tests/check/check-tests.js
new file mode 100755 (executable)
index 0000000..dbb4187
--- /dev/null
@@ -0,0 +1,196 @@
+/*
+ * Unit Test: Checkbox
+ *
+ * Hyunjung Kim <hjnim.kim@samsung.com>
+ */
+/*jslint browser: true*/
+/*global $, jQuery, test, equal, ok*/
+$("#checkpage").live("pageinit", function ( event ) {
+
+       module("checkbox");
+
+       var unit_check = function ( widget, type ) {
+               var checkbox,
+                       label,
+                       checkClass,
+                       classPrefix = "ui-checkbox";
+
+               widget.checkboxradio( );
+               checkbox = widget.parent( );
+               ok( checkbox.hasClass( classPrefix ) , "Create - Checkbox");
+
+               checkClass = classPrefix + "-on";
+               if ( !widget.is(":checked") ) {
+                       checkClass = classPrefix + "-off";
+               }
+               if ( widget.hasClass("favorite") ) {
+                       ok( checkbox.hasClass("favorite"), "Style - Favorite");
+               }
+
+               // Text Trim, Cause jQueryMobile( JQM ) 1.1 forced to add -"\u00a0"in buttonIcon( ButtonMarkup )
+               // JQM 1.1 buttonMarkup code :
+               // - if ( buttonIcon ) buttonIcon.appendChild( document.createTextNode("\u00a0") );
+               label = checkbox.children( ).last( );
+               equal ( label.text( ).trim( ), type, "label, type string must be same");
+
+               label.trigger("vclick");
+               if ( !widget.is(":disabled") ) {
+                       checkClass = classPrefix + "-on";
+                       ok( label.hasClass( checkClass ) , "Click - Normal Checkbox On");
+
+                       checkClass = classPrefix + "-off";
+                       label.trigger("vclick");
+                       ok( label.hasClass( checkClass ) , "Click - Normal Checkbox Off");
+               } else {
+                       ok( label.hasClass( checkClass ) , "Click - Disable Checkbox");
+                       label.trigger("vclick");
+                       ok( label.hasClass( checkClass ) , "Click - click event doesn't have effect");
+               }
+
+               /*markup check */
+               ok( label.find('.ui-btn-hastxt'), "Markup check for text");
+               ok( label.find('.ui-btn-text') , "Markup check for text");
+               equal( label.find('.ui-btn-hastxt span.ui-btn-text').last( ).html( ), type , "Markup check for text value");
+
+
+               /*API check*/
+               widget.checkboxradio('disable') ;
+               equal( widget.is(":disabled") , true, "API check disable") ;
+               ok( checkbox.hasClass("ui-disabled") , "API disable - Disable Checkbox");
+
+               widget.checkboxradio('enable') ;
+               equal( widget.is(":disabled") , false, "API check enable") ;
+               equal( checkbox.hasClass("ui-disabled") , false, "API enable - Disable Checkbox");
+
+
+       },
+
+               unit_check_events = function ( widget, type ) {
+                       var createEvent = false,
+                               changeEvent = false,
+                               checkbox,
+                               label;
+
+                       widget.checkboxradio({create: function ( ) {
+                               createEvent = true ;
+                       }}  ) ;
+                       checkbox = widget.parent( );
+                       label = checkbox.children( ).last( );
+
+                       widget.bind("change", function ( ) {
+                               changeEvent = true ;
+                       } ) ;
+
+                       $('#checkpage').find(":jqmData(role=controlgroup)").trigger('create') ;
+                       ok( createEvent , "Checkbox Create Event");
+
+                       widget.trigger("click");
+                       ok( changeEvent , "Checkbox Change Event");
+               };
+
+       test("checkbox - Normal", function ( ) {
+               unit_check( $("#checkbox-1"), "Normal");
+       } );
+
+       test("checkbox - Checked, Disabled", function ( ) {
+               unit_check( $("#checkbox-2"), "Checked, Disabled");
+       } );
+
+       test("checkbox - Disabled", function ( ) {
+               unit_check( $("#checkbox-3"), "Disabled");
+       } );
+
+       test("Favorite - Favorite", function ( ) {
+               unit_check( $("#checkbox-4"), "Favorite");
+       } );
+
+       test("Favorite - Favorite Checked, Disabled", function ( ) {
+               unit_check( $("#checkbox-5"), "Favorite Checked, Disabled");
+       } );
+
+       test("Favorite - Favorite, Disabled", function ( ) {
+               unit_check( $("#checkbox-6"), "Favorite, Disabled");
+       } );
+
+       test("checkbox - Normal Dynamic", function ( ) {
+
+               var markup;
+               //remove all controls form content
+               $('#checkpage').find(":jqmData(role=controlgroup)").empty( );
+
+               markup = '<input type= "checkbox"name= "checkbox-1"id= "checkbox-1"/><label for= "checkbox-1">Normal Dynamic</label>';
+               $('#checkpage').find(":jqmData(role=controlgroup)").append( markup ) ;
+               $('#checkpage').find(":jqmData(role=controlgroup)").trigger('create') ;
+
+               unit_check( $("#checkbox-1"), "Normal Dynamic");
+       } );
+
+
+       test("checkbox - Checked, Disabled Dynamic", function ( ) {
+
+               var markup;
+               //remove all controls form content
+               $('#checkpage').find(":jqmData(role=controlgroup)").empty( );
+
+               markup = '<input type= "checkbox"name= "checkbox-2"id= "checkbox-2"checked= "checked"disabled= "true"/><label for= "checkbox-2">Checked, Disabled Dymanic</label>';
+               $('#checkpage').find(":jqmData(role=controlgroup)").append( markup ) ;
+               $('#checkpage').find(":jqmData(role=controlgroup)").trigger('create') ;
+               unit_check( $("#checkbox-2"), "Checked, Disabled Dymanic");
+       } );
+
+       test("checkbox - Disabled Dynamic", function ( ) {
+               var markup;
+               //remove all controls form content
+               $('#checkpage').find(":jqmData(role=controlgroup)").empty( );
+
+               markup = '<input type= "checkbox"name= "checkbox-3"id= "checkbox-3"disabled= "true"/><label for= "checkbox-3">Disabled Dynamic</label>';
+               $('#checkpage').find(":jqmData(role=controlgroup)").append( markup ) ;
+               $('#checkpage').find(":jqmData(role=controlgroup)").trigger('create') ;
+               unit_check( $("#checkbox-3"), "Disabled Dynamic");
+       } );
+
+       test("Favorite - Favorite Dynamic", function ( ) {
+               var markup;
+               //remove all controls form content
+               $('#checkpage').find(":jqmData(role=controlgroup)").empty( );
+
+               markup = '<input type= "checkbox"name= "checkbox-4"id= "checkbox-4"class= "favorite"/><label for= "checkbox-4">Favorite Dynamic</label>';
+               $('#checkpage').find(":jqmData(role=controlgroup)").append( markup ) ;
+               $('#checkpage').find(":jqmData(role=controlgroup)").trigger('create') ;
+               unit_check( $("#checkbox-4"), "Favorite Dynamic");
+       } );
+
+       test("Favorite - Favorite Checked, Disabled Dynamic", function ( ) {
+               var markup;
+               //remove all controls form content
+               $('#checkpage').find(":jqmData(role=controlgroup)").empty( );
+
+               markup = '<input type= "checkbox"name= "checkbox-5"id= "checkbox-5"checked= "checked"disabled= "true"class= "favorite"/><label for= "checkbox-5">Favorite Checked, Disabled Dynamic</label>';
+               $('#checkpage').find(":jqmData(role=controlgroup)").append( markup ) ;
+               $('#checkpage').find(":jqmData(role=controlgroup)").trigger('create') ;
+               unit_check( $("#checkbox-5"), "Favorite Checked, Disabled Dynamic");
+       } );
+
+       test("Favorite - Favorite, Disabled Dynamic", function ( ) {
+               var markup;
+               //remove all controls form content
+               $('#checkpage').find(":jqmData(role=controlgroup)").empty( );
+
+               markup = '<input type= "checkbox"name= "checkbox-6"id= "checkbox-6"disabled= "disabled"class= "favorite"/><label for= "checkbox-6">Favorite, Disabled Dynamic</label>';
+               $('#checkpage').find(":jqmData(role=controlgroup)").append( markup ) ;
+               $('#checkpage').find(":jqmData(role=controlgroup)").trigger('create') ;
+               unit_check( $("#checkbox-6"), "Favorite, Disabled Dynamic");
+       } );
+
+       test("Favorite - Favorite, Disabled Dynamic Events", function ( ) {
+               var markup ;
+               //remove all controls form content
+               $('#checkpage').find(":jqmData(role=controlgroup)").empty( );
+
+               markup = '<input type= "checkbox"name= "checkbox-6"id= "checkbox-6"disabled= "disabled"class= "favorite"/><label for= "checkbox-6">Favorite, Disabled Dynamic Events</label>';
+               $('#checkpage').find(":jqmData(role=controlgroup)").append( markup ) ;
+               //$('#checkpage').find(":jqmData(role=controlgroup)").trigger('create') ;
+               unit_check_events( $("#checkbox-6"), "Favorite, Disabled Dynamic Events");
+       } );
+
+} );
diff --git a/tests/additional-unit-tests/check/index.html b/tests/additional-unit-tests/check/index.html
new file mode 100755 (executable)
index 0000000..284169b
--- /dev/null
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<html>
+<head>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/jquery.js"></script>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.min.js"></script>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw.js"
+               data-framework-theme="tizen-white"
+               data-framework-viewport-scale=false>
+       </script>
+
+       <link rel="stylesheet" href="../../../libs/js/jquery-mobile-1.2.0/external/qunit.css" />
+       <script src="../../../libs/js/jquery-mobile-1.1.0/tests/jquery.testHelper.js"></script>
+       <script src="../../../libs/js/jquery-mobile-1.2.0/external/qunit.js"></script>
+       <script src="check-tests.js"></script>
+
+       <title>Check-Box</title>
+</head>
+
+<body>
+
+<h1 id="qunit-header">Check-Box</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+
+<div id="qunit-fixture">
+       <div data-role="page" id="checkpage">
+               <div data-role="header" data-position="fixed">
+                       <h1>Checkbox</h1>
+               </div>
+               <div data-role="contents">
+                       <fieldset data-role="controlgroup">
+                       <input type="checkbox" name="checkbox-1" id="checkbox-1"/>
+                       <label for="checkbox-1">Normal</label>
+                       <input type="checkbox" name="checkbox-2" id="checkbox-2" checked="checked" disabled="true"/>
+                       <label for="checkbox-2">Checked, Disabled</label>
+                       <input type="checkbox" name="checkbox-3" id="checkbox-3" disabled="true"/>
+                       <label for="checkbox-3">Disabled</label>
+                       <input type="checkbox" name="checkbox-4" id="checkbox-4" class="favorite"/>
+                       <label for="checkbox-4">Favorite</label>
+                       <input type="checkbox" name="checkbox-5" id="checkbox-5" checked="checked" disabled="true" class="favorite"/>
+                       <label for="checkbox-5">Favorite Checked, Disabled</label>
+                       <input type="checkbox" name="checkbox-6" id="checkbox-6" disabled="disabled" class="favorite"/>
+                       <label for="checkbox-6">Favorite, Disabled</label>
+                       </fieldset>
+               </div>
+       </div>
+</div>
+
+</body>
+</html>
diff --git a/tests/additional-unit-tests/collapsible/collapsible-tests.js b/tests/additional-unit-tests/collapsible/collapsible-tests.js
new file mode 100755 (executable)
index 0000000..b6a17ef
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * collapse unit tests
+ */
+/*jslint browser: true*/
+/*global $, jQuery, test, equal, ok*/
+( function ( $ ) {
+       module("collapse test");
+
+       var unit_collapse = function ( widget ) {
+               var created_collapse = widget.collapsible( ),
+                       obj_collapse = created_collapse.data("collapsible");
+
+               ok( created_collapse, "Create");
+
+               /*Markup check*/
+               equal( widget.hasClass('ui-collapsible'), true, "Markup check") ;
+
+               /* Check Option */
+               equal( obj_collapse.options.expandCueText, " click to expand contents", "Collapsed test -> expandCueText");
+               equal( obj_collapse.options.collapseCueText, " click to collapse contents", "Collapsed test -> collapseCueText");
+               equal( obj_collapse.options.collapsed, true, "Collapsed test -> collapsed");
+               equal( obj_collapse.options.heading, "h1,h2,h3,h4,h5,h6,legend,li", "Collapsed test -> heading");
+               equal( obj_collapse.options.theme, 's', "Collapsed test -> theme");
+               equal( obj_collapse.options.contentTheme, null, "Collapsed test -> contentTheme");
+
+               /* Check event */
+               created_collapse.trigger("collpase");
+               equal( created_collapse.hasClass("ui-collapsible-collapsed") , true, "API test -> collapse");
+
+               created_collapse.trigger("expand");
+               equal( created_collapse.hasClass("ui-collapsible-collapsed") , false, "API test -> expand");
+       };
+
+       test("collapse test", function ( ) {
+               unit_collapse( $("#collapsedContent") );
+       } );
+} ( jQuery ));
diff --git a/tests/additional-unit-tests/collapsible/index.html b/tests/additional-unit-tests/collapsible/index.html
new file mode 100755 (executable)
index 0000000..fc150a8
--- /dev/null
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/jquery.js"></script>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.min.js"></script>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw.js"
+               data-framework-theme="tizen-white"
+               data-framework-viewport-scale=false>
+       </script>
+
+       <link rel="stylesheet" href="../../../libs/js/jquery-mobile-1.2.0/external/qunit.css" />
+
+       <script src="../../../libs/js/jquery-mobile-1.2.0/external/qunit.js"></script>
+
+  <script src="collapsible-tests.js"></script>
+</head>
+<body>
+
+<h1 id="qunit-header">Collapsible</h1>
+<h2 id="qunit-banner"></h2>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests">
+</ol>
+
+<div data-nstest-role="page" data-add-back-btn="true" id='collapsiblepage'>
+       <div data-nstest-role="header" data-nstest-position="fixed">
+               <h1>Collapsible</h1>
+       </div>
+       <div data-nstest-role="content">
+               <div data-role="collapsible" id="collapsedContent">
+                        <h3>I'm a header</h3>
+                       <a>test</a>
+                       <p>Some content would be here</p>
+               </div>
+       </div>
+</div>
+</body>
+</html>
diff --git a/tests/additional-unit-tests/datetimepicker/datetimepicker-tests.js b/tests/additional-unit-tests/datetimepicker/datetimepicker-tests.js
new file mode 100755 (executable)
index 0000000..45326a4
--- /dev/null
@@ -0,0 +1,497 @@
+/*jslint browser: true*/
+/*global $, jQuery, test, equal, ok, asyncTest, Globalize, start, stop, deepEqual, range*/
+$(document).ready( function () {
+
+       module( "Date Time Picker" );
+
+       var datetime,
+               date,
+               time,
+               custom,
+               make2digit,
+               isLeapYear,
+               getDay,
+               getCurDate,
+               objDatetime,
+               objDate,
+               objTime,
+               objCustom,
+               markup,
+               datetime2 ,
+               date2,
+               time2 ,
+               custom2 ,
+               objDatetime2,
+               objDate2 ,
+               objTime2,
+               objCustom2;
+
+       // trigger pagecreate
+       $( "#page-1" ).page();
+
+       datetime = $( "#datetime" )[0];
+       date = $( "#date" )[0];
+       time = $( "#time" )[0];
+       custom = $( "#custom" )[0];
+
+       make2digit = function (arr) {
+               var i, ret;
+               for ( i = 0;  i < arr.length;  i++ ) {
+                       arr[i] = arr[i].toString();
+                       ret = arr[i].toString(10);
+                       if ( arr[i] < 10 ) {
+                               arr[i] = "0" + arr[i];
+                       }
+               }
+               return arr;
+       } ;
+
+       isLeapYear = function ( year ) {
+               return year % 4 ? 0 : ( year % 100 ? 1 : ( year % 400 ? 0 : 1 ) );
+       } ;
+
+       getDay = function () {
+               var date = new Date( "May 2 18:30:00 2012" ),
+                       daysInMonth = [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ],
+                       day = daysInMonth[ date.getMonth() ];
+               if ( day == 28 ) {
+                       day += isLeapYear( date.getFullYear() );
+               }
+               return day;
+       } ;
+
+       getCurDate = function () {
+               var date = new Date( "May 2 18:30:00 2012" );
+               return date.getDate();
+       } ;
+
+       //Dymanically creating datetimepicker
+       objDatetime = $(datetime).data( "datetimepicker" );
+       objDate = $(date).data( "datetimepicker" );
+       objTime = $(time).data( "datetimepicker" );
+       objCustom = $(custom).data( "datetimepicker" );
+       markup = '<ul data-role="listview" id="datetimeList2">' +
+                                               '<li class="ui-li-2line-sub-main">' +
+                                                       '<span class="ui-li-text-main">' +
+                                                               '<input type="datetime" id="datetime2" />' +
+                                                       '</span>' +
+                                                       '<span class="ui-li-text-sub">DateTimePicker</span>' +
+                                               '</li>' +
+                                               '<li class="ui-li-2line-sub-main">' +
+                                                       '<span class="ui-li-text-main">' +
+                                                               '<input type="date" id="date2"/>' +
+                                                       '</span>' +
+                                                       '<span class="ui-li-text-sub">DatePicker</span>' +
+                                               '</li>' +
+                                               '<li class="ui-li-2line-sub-main">' +
+                                                       '<span class="ui-li-text-main">' +
+                                                               '<input type="time" id="time2"/>' +
+                                                       '</span>' +
+                                                       '<span class="ui-li-text-sub">TimePicker</span>' +
+                                               '</li>' +
+                                               '<li class="ui-li-2line-sub-main">' +
+                                                       '<span class="ui-li-text-main">' +
+                                                               '<input type="datetime" id="custom2" data-format="MMM dd yyyy hh:mm tt" value="2012-06-30T00:00:00+00:00" />' +
+                                                       '</span>' +
+                                                       '<span class="ui-li-text-sub">DateTimePicker</span>' +
+                                               '</li>' +
+                                       '</ul>';
+
+       // trigger pagecreate
+       $( "#page-1" ).page();
+       $('#page-1').find( ":jqmData(role=content)" ).append(markup);
+       $('#page-1').find( ":jqmData(role=content)" ).trigger('create');
+
+       datetime2 = $( "#datetime2" )[0];
+       date2 = $( "#date2" )[0];
+       time2 = $( "#time2" )[0];
+       custom2 = $( "#custom2" )[0];
+
+       objDatetime2 = $(datetime2).data( "datetimepicker" );
+       objDate2 = $(date2).data( "datetimepicker" );
+       objTime2 = $(time2).data( "datetimepicker" );
+       objCustom2 = $(custom2).data( "datetimepicker" );
+       /* End of dynamic creation*/
+
+       asyncTest( "Auto-initialization", function () {
+               ok( objDatetime, "should Date/Time instace created" );
+               ok( objDate, "should Date instance created" );
+               ok( objTime, "should Time instance created" );
+               ok( objCustom, "should Custom format instance created" );
+               start();
+       });
+
+       asyncTest( "Options", function () {
+               equal( objDatetime.options.type, "datetime", "should 'datetime' type created." );
+               equal( objDate.options.type, "date", "should 'date' type created." );
+               equal( objTime.options.type, "time", "should 'time' type created." );
+               equal( objCustom.options.type, "datetime", "should custom format created as 'datetime' type." );
+               equal( objCustom.options.format, "MMM dd yyyy hh:mm tt", "should accept custom format string." );
+               equal( objCustom.options.date.toString(), new Date( "Jun 30 00:00:00 UTC+0000 2012" ).toString(), "should accept preset date." );
+               start();
+       });
+
+       asyncTest( "Private Methods", function () {
+               var months, updateFieldTest ;
+               ok( ( function () {
+                       var year = 0,
+                               expect = false,
+                               actual = false;
+
+                       try {
+                               for ( year = 1;  year < 2100;  year++ ) {
+                                       expect = new Date( year, 1, 29 ).getDate() == 29;
+                                       actual = objDatetime._isLeapYear( year );
+                                       if ( expect != actual ) {
+                                               throw year + " is wrong";
+                                       }
+                               }
+                       } catch ( exception ) {
+                               console.log( exception );
+                               return false;
+                       }
+                       return true;
+               }()), "should be able to check leap year" );
+
+               updateFieldTest = function ( format, value, obj, expect ) {
+                       var target = $('<div data-pat=' + format + '></div>');
+                       obj._updateField( target, value );
+
+                       return target.text();
+               } ;
+
+               deepEqual(
+                       [
+                               updateFieldTest( "h", 0, objTime2 ),
+                               updateFieldTest( "hh", 1, objTime2 ),
+                               updateFieldTest( "H", 13 , objTime2),
+                               updateFieldTest( "HH", 9, objTime2 ),
+                               updateFieldTest( "m", 9, objTime2 ),
+                               updateFieldTest( "mm", 9 , objTime2),
+                               updateFieldTest( "s", 1, objTime2 ),
+                               updateFieldTest( "ss", 10 , objTime2),
+                               updateFieldTest( "MMM", 3 , objTime2),
+                               updateFieldTest( "MMMM", 3, objTime2 ),
+                               updateFieldTest( "yy", 95, objTime2 ),
+                               updateFieldTest( "yyyy", 95, objTime2 )
+                       ],
+                       [
+                               "12", "01", "13", "09", "9", "09", "1" , "10", Globalize.culture().calendar.months.namesAbbr[2], Globalize.culture().calendar.months.names[2], "95", "0095"
+                       ],
+                       "should update field to given value with format"
+               );
+
+               deepEqual(
+                       [
+                               updateFieldTest( "h", 0, objDate2),
+                               updateFieldTest( "hh", 1, objDate2 ),
+                               updateFieldTest( "H", 13 , objDate2),
+                               updateFieldTest( "HH", 9, objDate2 ),
+                               updateFieldTest( "m", 9, objDate2 ),
+                               updateFieldTest( "mm", 9, objDate2 ),
+                               updateFieldTest( "s", 1, objDate2 ),
+                               updateFieldTest( "ss", 10 , objDate2),
+                               updateFieldTest( "MMM", 3 , objDate2),
+                               updateFieldTest( "MMMM", 3 , objDate2),
+                               updateFieldTest( "yy", 9, objDate2 ),
+                               updateFieldTest( "yyyy", 9, objDate2 )
+                       ],
+                       [
+                               "12", "01", "13", "09", "9", "09", "1" , "10", Globalize.culture().calendar.months.namesAbbr[2], Globalize.culture().calendar.months.names[2], "09", "0009"
+                       ],
+                       "should update field to given value with format"
+               );
+
+               ok( ( function () {
+                       var beforeNoon = objTime.options.date.getHours() < 12;
+                       objTime._switchAmPm();
+                       return beforeNoon != objTime.options.date.getHours() < 12;
+               }()), "should change AM/PM by AMPM button" );
+
+               deepEqual( [ "MMMM", " ", "dd", " ", "yyyy", " ", "hh", ":", "mm", " ", "dummy space" ],
+                       objTime._parsePattern( "MMMM dd yyyy hh:mm 'dummy space'" ), "should parse DTF string as array" );
+
+               objDatetime.options.date = new Date( "May 2 18:30:00 2012" );
+
+               months = Globalize.culture().calendar.months.namesAbbr.slice();
+               if ( months.length > 12 ) {
+                       months.length = 12;
+               }
+
+
+               deepEqual(
+                       [
+                               {
+                                       values : make2digit( range( 1, getDay() )),
+                                       data : range( 1, getDay() ),
+                                       current : getCurDate() - 1,
+                                       numItems : getDay()
+                               },
+                               {
+                                       values : make2digit (range( 0, 59 )),
+                                       data : range(0, 59),
+                                       numItems : 60,
+                                       current : 0
+                               },
+                               {
+                                       values : range( 1900, 2100 ),
+                                       data : range( 1900, 2100 ),
+                                       numItems : 201,
+                                       current : 112
+                               },
+                               { // hour h 6
+                                       values : [ "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12" ],
+                                       data : [ 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 12 ],
+                                       numItems : 12,
+                                       current : 5
+                               },
+                               { // hour H 6
+                                       values : range( 0, 23 ),
+                                       data : range( 0, 23 ),
+                                       numItems : 24,
+                                       current : 18
+                               },
+                               {
+                                       values : months,
+                                       data : range( 1, 12 ),
+                                       numItems : 12,
+                                       current : 4
+                               },
+
+                       ],
+                       [
+                               objDatetime._populateDataSelector( "day", "dd", objDatetime ),
+                               objDatetime._populateDataSelector( "sec", "ss", objDatetime ),
+                               objDatetime._populateDataSelector( "year", "YYYY", objDatetime ),
+                               objDatetime._populateDataSelector( "hour", "hh", objDatetime ),
+                               objDatetime._populateDataSelector( "hour", "H", objDatetime ),
+                               objDatetime._populateDataSelector( "month", "MMM", objDatetime ),
+
+                       ],
+                       "should populate data selector by given field and pattern"
+               );
+
+               /*date Value Api*/
+               objDate.value( "Jan 1 09:00:00 2012" );
+               equal(objDate.value( ) , "2012-01-01" , "Set and get value for date" );
+
+               /*date Value Api*/
+               objTime.value( "Jan 1 09:00:00 2012" );
+               equal(objTime.value( ) , "09:00:00" , "Set and get value for time" );
+               start();
+       });
+
+       asyncTest( "Public Methods", function () {
+               objDatetime.value.call( objDatetime, "Jan 1 09:00:00 2012" );
+               equal( "2012-01-01T09:00:00", objDatetime.value(), "should set and get value by API" );
+               var format = "yyyy MM dd hh mm";
+               objDatetime._setFormat( format );
+               equal( objDatetime.option( "format" ), format, "should set type and format" );
+               start();
+       });
+
+       asyncTest( "Events", function () {
+               var str = "May 2 18:00:00 2012";
+
+               $(datetime).bind( "date-changed", function (e, date) {
+                       equal( objDatetime.value(), "2012-05-02T18:00:00", "Should invoke event when date changed" );
+                       start();
+               });
+
+               objDatetime.value( str );
+       });
+
+
+       asyncTest( "Auto-initialization Dynamic", function () {
+               ok( objDatetime2, "should Date/Time instace created" );
+               ok( objDate2, "should Date instance created" );
+               ok( objTime2, "should Time instance created" );
+               ok( objCustom2, "should Custom format instance created" );
+               start();
+       });
+
+       asyncTest( "Options Dynamic", function () {
+               equal( objDatetime2.options.type, "datetime", "should 'datetime' type created." );
+               equal( objDate2.options.type, "date", "should 'date' type created." );
+               equal( objTime2.options.type, "time", "should 'time' type created." );
+               equal( objCustom2.options.type, "datetime", "should custom format created as 'datetime' type." );
+               equal( objCustom2.options.format, "MMM dd yyyy hh:mm tt", "should accept custom format string." );
+               equal( objCustom2.options.date.toString(), new Date( "Jun 30 00:00:00 UTC+0000 2012" ).toString(), "should accept preset date." );
+
+               start();
+       });
+
+       asyncTest( "Private Methods Dynamic", function () {
+               var months, updateFieldTest ;
+               ok( ( function () {
+                       var year = 0,
+                               expect = false,
+                               actual = false;
+
+                       try {
+                               for ( year = 1;  year < 2100;  year++ ) {
+                                       expect = new Date( year, 1, 29 ).getDate() == 29;
+                                       actual = objDatetime2._isLeapYear( year );
+                                       if ( expect != actual ) {
+                                               throw year + " is wrong";
+                                       }
+                               }
+                       } catch ( exception ) {
+                               console.log( exception );
+                               return false;
+                       }
+                       return true;
+               }()), "should be able to check leap year" );
+
+               updateFieldTest = function ( format, value, obj, expect ) {
+                       var target = $('<div data-pat=' + format + '></div>');
+                       obj._updateField( target, value );
+
+                       return target.text();
+               } ;
+
+               deepEqual(
+                       [
+                               updateFieldTest( "h", 0, objTime2 ),
+                               updateFieldTest( "hh", 1, objTime2 ),
+                               updateFieldTest( "H", 13 , objTime2),
+                               updateFieldTest( "HH", 9, objTime2 ),
+                               updateFieldTest( "m", 9, objTime2 ),
+                               updateFieldTest( "mm", 9 , objTime2),
+                               updateFieldTest( "s", 1, objTime2 ),
+                               updateFieldTest( "ss", 10 , objTime2),
+                               updateFieldTest( "MMM", 3 , objTime2),
+                               updateFieldTest( "MMMM", 3, objTime2 ),
+                               updateFieldTest( "yy", 95, objTime2 ),
+                               updateFieldTest( "yyyy", 95, objTime2 )
+                       ],
+                       [
+                               "12", "01", "13", "09", "9", "09", "1" , "10", Globalize.culture().calendar.months.namesAbbr[2], Globalize.culture().calendar.months.names[2], "95", "0095"
+                       ],
+                       "should update field to given value with format"
+               );
+
+               deepEqual(
+                       [
+                               updateFieldTest( "h", 0, objDate2),
+                               updateFieldTest( "hh", 1, objDate2 ),
+                               updateFieldTest( "H", 13 , objDate2),
+                               updateFieldTest( "HH", 9, objDate2 ),
+                               updateFieldTest( "m", 9, objDate2 ),
+                               updateFieldTest( "mm", 9, objDate2 ),
+                               updateFieldTest( "s", 1, objDate2 ),
+                               updateFieldTest( "ss", 10 , objDate2),
+                               updateFieldTest( "MMM", 3 , objDate2),
+                               updateFieldTest( "MMMM", 3 , objDate2),
+                               updateFieldTest( "yy", 9, objDate2 ),
+                               updateFieldTest( "yyyy", 9, objDate2 )
+                       ],
+                       [
+                               "12", "01", "13", "09", "9", "09", "1" , "10", Globalize.culture().calendar.months.namesAbbr[2], Globalize.culture().calendar.months.names[2], "09", "0009"
+                       ],
+                       "should update field to given value with format"
+               );
+
+               ok( ( function () {
+                       var beforeNoon = objTime2.options.date.getHours() < 12;
+                       objTime2._switchAmPm();
+                       return beforeNoon != objTime2.options.date.getHours() < 12;
+               }()), "should change AM/PM by AMPM button" );
+
+               deepEqual(
+                       [ "MMMM", " ", "dd", " ", "yyyy", " ", "hh", ":", "mm", " ", "dummy space" ],
+                       objTime2._parsePattern( "MMMM dd yyyy hh:mm 'dummy space'" ),
+                       "should parse DTF string as array"
+               );
+
+               objDatetime2.options.date = new Date( "May 2 18:30:00 2012" );
+
+               months = Globalize.culture().calendar.months.namesAbbr.slice();
+               if ( months.length > 12 ) {
+                       months.length = 12;
+               }
+
+               deepEqual(
+                       [
+                               {
+                                       values : make2digit( range( 1, getDay() )),
+                                       data : range( 1, getDay() ),
+                                       current : getCurDate() - 1,
+                                       numItems : getDay()
+                               },
+                               {
+                                       values : make2digit (range( 0, 59 )),
+                                       data : range(0, 59),
+                                       numItems : 60,
+                                       current : 0
+                               },
+                               {
+                                       values : range( 1900, 2100 ),
+                                       data : range( 1900, 2100 ),
+                                       numItems : 201,
+                                       current : 112
+                               },
+                               { // hour h 6
+                                       values : [ "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12" ],
+                                       data : [ 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 12 ],
+                                       numItems : 12,
+                                       current : 5
+                               },
+                               { // hour H 6
+                                       values : range( 0, 23 ),
+                                       data : range( 0, 23 ),
+                                       numItems : 24,
+                                       current : 18
+                               },
+                               {
+                                       values : months,
+                                       data : range( 1, 12 ),
+                                       numItems : 12,
+                                       current : 4
+                               },
+
+                       ],
+                       [
+                               objDatetime2._populateDataSelector( "day", "dd", objDatetime2 ),
+                               objDatetime2._populateDataSelector( "sec", "ss", objDatetime2 ),
+                               objDatetime2._populateDataSelector( "year", "YYYY", objDatetime2 ),
+                               objDatetime2._populateDataSelector( "hour", "hh", objDatetime2 ),
+                               objDatetime2._populateDataSelector( "hour", "H", objDatetime2 ),
+                               objDatetime2._populateDataSelector( "month", "MMM", objDatetime2 ),
+
+                       ],
+                       "should populate data selector by given field and pattern"
+               );
+
+               /*date Value Api*/
+               objDate2.value( "Jan 1 09:00:00 2012" );
+               equal(objDate2.value( ) , "2012-01-01" , "Set and get value for date" );
+
+               /*date Value Api*/
+               objTime2.value( "Jan 1 09:00:00 2012" );
+               equal(objTime2.value( ) , "09:00:00" , "Set and get value for time" );
+
+               start();
+       });
+
+       asyncTest( "Public Methods Dynamic", function () {
+               objDatetime2.value.call( objDatetime2, "Jan 1 09:00:00 2012" );
+               equal( "2012-01-01T09:00:00", objDatetime2.value(), "should set and get value by API" );
+               var format = "yyyy MM dd hh mm";
+               objDatetime2._setFormat( format );
+               equal( objDatetime2.option( "format" ), format, "should set type and format" );
+               start();
+       });
+
+       asyncTest( "Events Dynamic", function () {
+               var str = "May 2 18:00:00 2012";
+               $(datetime2).bind( "date-changed", function (e, date) {
+                       equal( objDatetime2.value(), "2012-05-02T18:00:00", "Should invoke event when date changed" );
+                       start();
+               });
+
+               objDatetime2.value( str );
+       });
+
+
+});
diff --git a/tests/additional-unit-tests/datetimepicker/index.html b/tests/additional-unit-tests/datetimepicker/index.html
new file mode 100755 (executable)
index 0000000..f56a916
--- /dev/null
@@ -0,0 +1,74 @@
+<!DOCTYPE html>
+<html>
+<head>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/jquery.js"></script>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.min.js"></script>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw.js"
+               data-framework-theme="tizen-white"
+               data-framework-viewport-scale=false>
+       </script>
+
+       <link rel="stylesheet" href="../../../libs/js/jquery-mobile-1.2.0/external/qunit.css" />
+
+       <script src="../../../libs/js/jquery-mobile-1.1.0/tests/jquery.testHelper.js"></script>
+       <script src="../../../libs/js/jquery-mobile-1.2.0/external/qunit.js"></script>
+       <script src="datetimepicker-tests.js"></script>
+
+       <title>Date Time Picker</title>
+</head>
+
+<body>
+
+<h1 id="qunit-header">Date Time Picker</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+
+<div id="qunit-fixture">
+       <div data-role="page" id="dummy-page">
+               <div data-role="header" data-position="fixed">
+                       <h1>Dummy</h1>
+               </div>
+               <div data-role="contents">
+               </div>
+       </div>
+       <div data-role="page" id="page-1">
+               <div data-role="header" data-position="fixed">
+                       <h1>Date Time Picker</h1>
+               </div>
+               <div data-role="content">
+                       <ul data-role="listview">
+                               <li class="ui-li-2line-sub-main">
+                                       <span class="ui-li-text-main">
+                                               <input type="datetime" id="datetime" />
+                                       </span>
+                                       <span class="ui-li-text-sub">DateTimePicker</span>
+                               </li>
+                               <li class="ui-li-2line-sub-main">
+                                       <span class="ui-li-text-main">
+                                               <input type="date" id="date"/>
+                                       </span>
+                                       <span class="ui-li-text-sub">DatePicker</span>
+                               </li>
+                               <li class="ui-li-2line-sub-main">
+                                       <span class="ui-li-text-main">
+                                               <input type="time" id="time"/>
+                                       </span>
+                                       <span class="ui-li-text-sub">TimePicker</span>
+                               </li>
+                               <li class="ui-li-2line-sub-main">
+                                       <span class="ui-li-text-main">
+                                               <input type="datetime" id="custom" data-format="MMM dd yyyy hh:mm tt" value="2012-06-30T00:00:00+00:00" />
+                                       </span>
+                                       <span class="ui-li-text-sub">DateTimePicker</span>
+                               </li>
+                       </ul>
+               </div>
+       </div>
+
+</div>
+
+</body>
+</html>
+
diff --git a/tests/additional-unit-tests/dayselector/dayselector-tests.js b/tests/additional-unit-tests/dayselector/dayselector-tests.js
new file mode 100755 (executable)
index 0000000..8363e91
--- /dev/null
@@ -0,0 +1,159 @@
+/*
+ * Unit Test: Dayselector
+ * modified by : Koeun Choi <koeun.choi@samsung.com>
+ */
+/*jslint browser: true*/
+/*global $, jQuery, test, equal, ok*/
+( function ( $ ) {
+
+       module("Day selector");
+
+       var unit_dayselector = function ( elt, expectedType, expectedTheme ) {
+               var days = 7,
+                       checkbox,
+                       label,
+                       expectedId,
+                       i;
+
+               elt.dayselector( );
+
+               ok( elt.hasClass( 'ui-dayselector '), "day-selector has 'ui-dayselector 'class.");
+               // main element should be a controlgroup
+               ok( elt.hasClass( 'ui-controlgroup '), "day-selector has 'ui-controlgroup 'class.");
+
+               equal( elt.attr( 'data- '+ $.mobile.ns + 'type '), expectedType, "should have '"+ expectedType +"'type");
+
+               for ( i = 0; i < days ; i++ ) {
+                       expectedId = elt.attr( 'id ') + '_ '+ i;
+                       checkbox = elt.find( '.ui-checkbox :checkbox[value= '+ i + '][id= '+ expectedId + '] ');
+                       equal( checkbox.length, 1, "should be one checkbox per day");
+                       equal( checkbox.prop( 'value '), String( i ), "should have correct day value");
+
+                       label = checkbox.siblings( ).first( );
+                       equal( label.length, 1, "should be one label per day");
+                       equal( label.attr( 'for '), expectedId, "should associate correctly with checkbox");
+                       ok( label.hasClass( 'ui-dayselector-label- '+ i ), "should have the right label class");
+                       equal( label.jqmData( 'theme '), expectedTheme, "should have '"+ expectedTheme +"'theme");
+               }
+       };
+
+       /* Test 1. Default Configuration Check */
+       asyncTest("Default Configuration Check", function ( ) {
+
+               $.testHelper.pageSequence( [
+                       function ( ) {
+                               $.testHelper.openPage( '#dayselector-test-configuration ');
+                       },
+
+                       function ( ) {
+                               var expectedType = 'horizontal ',
+                                       testPage = $( '#dayselector-test-configuration '),
+                                       expectedTheme = 's ',
+                                       daySelector;
+
+                               // test default values are applied correctly
+                               daySelector = testPage.find( '#dayselector-test-configuration-default ');
+                               unit_dayselector( daySelector, expectedType, expectedTheme );
+
+                               start( );
+                       }
+               ] );
+       } );
+
+       /* Test 2. Theme Configuration Check */
+       asyncTest("Theme Configuration Check", function ( ) {
+
+               $.testHelper.pageSequence( [
+                       function ( ) {
+                               $.testHelper.openPage( '#dayselector-test-configuration ');
+                       },
+
+                       function ( ) {
+                               var expectedType = 'horizontal ',
+                                       testPage = $( '#dayselector-test-configuration '),
+                                       expectedTheme,
+                                       daySelector;
+
+                               // test user theme is applied to dayselector winset correctly
+                               daySelector = testPage.find( '#dayselector-test-configuration-theme ');
+                               daySelector.dayselector( );
+                               expectedTheme = daySelector.jqmData( 'theme ');
+                               equal( expectedTheme, 'a ', "dayselector fieldset theme is 'a '");
+                               unit_dayselector( daySelector, expectedType, expectedTheme );
+
+                               start( );
+                       }
+
+               ] );
+       } );
+
+       /* Test 3. Custom Configuration Check */
+       asyncTest("Custom Configuration Check", function ( ) {
+
+               $.testHelper.pageSequence( [
+                       function ( ) {
+                               $.testHelper.openPage( '#dayselector-test-configuration ');
+                       },
+
+                       function ( ) {
+                               var expectedType = 'vertical ',
+                                       testPage = $( '#dayselector-test-configuration '),
+                                       expectedTheme = 'a ',
+                                       daySelector;
+
+                               // test custom config is applied correctly
+                               daySelector = testPage.find( '#dayselector-test-configuration-custom ');
+
+                               daySelector.dayselector( { type: expectedType, theme: expectedTheme } );
+                               unit_dayselector( daySelector, expectedType, expectedTheme );
+
+                               start( );
+                       }
+
+               ] );
+       } );
+
+       /* Test 4. Check Event and APIs */
+       asyncTest("Check Event and APIs", function ( ) {
+
+               $.testHelper.pageSequence( [
+                       function ( ) {
+                               $.testHelper.openPage( '#dayselector-test-select ');
+                       },
+
+                       function ( ) {
+                               var testPage,
+                                       daySelectorElem,
+                                       wednesday,
+                                       friday;
+                               testPage = $( '#dayselector-test-select ');
+                               ok( testPage.hasClass( 'ui-page-active ') );
+
+                               // test defaults are applied correctly
+                               daySelectorElem = testPage.find( '#dayselector-test-select-1 ');
+
+                               // nothing should be selected yet
+                               deepEqual( daySelectorElem.dayselector( 'value '), [] );
+
+                               // click on Wednesday and Friday to switch them on
+                               wednesday = daySelectorElem.find( '.ui-checkbox ')[3];
+                               $( wednesday ).find( 'label ').trigger( 'click ');
+
+                               friday = daySelectorElem.find( '.ui-checkbox ')[5];
+                               $( friday ).find( 'label ').trigger( 'click ');
+                               deepEqual( daySelectorElem.dayselector( 'value '), [ '3 ', '5 '] );
+
+                               // turn off Wednesday and Friday
+                               $( wednesday ).find( 'label ').trigger( 'click ');
+                               $( friday ).find( 'label ').trigger( 'click ');
+                               deepEqual( daySelectorElem.dayselector( 'value '), [] );
+
+                               // test the selectAll( ) method
+                               daySelectorElem.dayselector( 'selectAll ');
+                               deepEqual( daySelectorElem.dayselector( 'value '), [ '0 ', '1 ', '2 ', '3 ', '4 ', '5 ', '6 '] );
+
+                               start( );
+                       }
+               ] );
+       } );
+} )( jQuery );
diff --git a/tests/additional-unit-tests/dayselector/index.html b/tests/additional-unit-tests/dayselector/index.html
new file mode 100755 (executable)
index 0000000..57c3d35
--- /dev/null
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+       <title>jQuery Mobile Day Selector Tests</title>
+
+       <script src="../../../build/tizen-web-ui-fw/latest/js/jquery.js"></script>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.min.js"></script>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw.js"
+               data-framework-theme="tizen-white"
+               data-framework-viewport-scale=false>
+       </script>
+
+       <script src="../../../libs/js/jquery-mobile-1.1.0/tests/jquery.testHelper.js"></script>
+       <link rel="stylesheet" href="../../../libs/js/jquery-mobile-1.1.0/external/qunit.css" />
+       <script src="../../../libs/js/jquery-mobile-1.1.0/external/qunit.js"></script>
+       <script src="dayselector-tests.js"></script>
+       </head>
+       <body>
+
+       <h1 id="qunit-header">jQuery Mobile Day Selector Tests</h1>
+       <h2 id="qunit-banner"></h2>
+       <h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests">
+</ol>
+
+<div data-nstest-role="page" id="dayselector-test-configuration">
+       <div data-nstest-role="header" data-nstest-position="inline">
+               <h1>Day Selector Tests - configuration</h1>
+       </div>
+       <div data-nstest-role="content">
+         <fieldset id="dayselector-test-configuration-default" data-nstest-role="dayselector"> </fieldset>
+         <fieldset id="dayselector-test-configuration-theme" data-nstest-theme="a" data-nstest-role="dayselector"></fieldset>
+         <fieldset id="dayselector-test-configuration-custom"></fieldset>
+       </div>
+</div>
+
+<div data-nstest-role="page" id="dayselector-test-select">
+       <div data-nstest-role="header" data-nstest-position="inline">
+               <h1>Day Selector Tests - selection</h1>
+       </div>
+       <div data-nstest-role="content">
+         <fieldset id="dayselector-test-select-1" data-nstest-role="dayselector"></fieldset>
+       </div>
+</div>
+
+</body>
+</html>
diff --git a/tests/additional-unit-tests/extendablelist/extendablelist-tests.js b/tests/additional-unit-tests/extendablelist/extendablelist-tests.js
new file mode 100755 (executable)
index 0000000..2cffa86
--- /dev/null
@@ -0,0 +1,124 @@
+/*
+ * Unit Test: Extendable list
+ *
+ * Wongi Lee <wongi11.lee@samsung.com>
+ */
+/*jslint browser: true*/
+/*global $, jQuery, test, equal, ok*/
+$( document ).ready( function ( ) {
+
+       module("Extendable List");
+       var unit_extendablelist_test = function ( widget ) {
+
+               var $elContainer = widget,
+                       $elElements = widget.find("li"),
+                       $spanElements = widget.find("span.ui-li-text-main"),
+                       elOptions = widget.extendablelist("option");
+
+               widget.extendablelist( );
+               console.dir( elOptions );
+               /* Initialize and create method */
+               ok( $elContainer );
+               equal( $elElements.length, 51 );        /* 50 <li> items + one button. */
+               equal( $spanElements.length, 50 );      /* 50 <li> items + one button. */
+               /* Options */
+               equal( elOptions.id, "#" + widget.attr('id') );
+               equal( elOptions.childSelector, " li");
+               //equal( elOptions.dbtable, "JSON_DATA");
+               equal( elOptions.template, widget.jqmData('template') );
+               equal( elOptions.extenditems, 50 );
+               equal( elOptions.scrollview, true );
+
+               /*markup check*/
+               ok( widget.hasClass('ui-extendable-list-container'), "Markup check") ;
+
+               /* Click Load more button */
+               ok ( ( function ( ) {
+                       /* Click Button */
+                       $("#load_more_message").click( );
+
+                       $elElements = $("ul#extendable_list_main li");
+                       $spanElements = widget.find("span.ui-li-text-main") ;
+                       console.log( $elElements.length );
+
+                       try {
+                               equal ( $elElements.length, 101 );
+                               equal( $spanElements.length, 100 );     /* 50 <li> items + one button. */
+                       } catch ( exception ) {
+                               console.log("click load more button :" + exception );
+                               return false;
+                       }
+                       return true;
+               }( ) ), "Click Load More button( )");
+
+               ok ( ( function ( ) {
+                       var i = 0,
+                               newJSON = [],
+                               newItem,
+                               firstLI,
+                               result = true;
+
+                       /* make short JSON array */
+                       for ( i = 0; i < 200; i++ ) {
+                               newJSON.push( window.JSON_DATA[ ( i + 100 ) ] );
+                       }
+
+                       /* Call recreate */
+                       $("ul#extendable_list_main").extendablelist("recreate", newJSON );
+
+                       $elContainer = $("ul#extendable_list_main");
+                       $elElements = $("ul#extendable_list_main li");
+
+                       /* Check new List */
+                       ok( $elContainer );
+                       equal( $elElements.length, 51 );        /* 50 <li> items + one button. */
+
+                       newItem = window.JSON_DATA[ 100 ];
+
+                       firstLI = $("ul#extendable_list_main li:first");
+
+                       try {
+                               equal( newItem.NAME, $( firstLI ).find("span.ui-li-text-main").text( ) );
+                       } catch ( exception ) {
+                               console.log( exception );
+                               return false;
+                       }
+
+                       return true;
+               }( ) ), "recreate( )");
+
+               /* Destroy method */
+               ok ( ( function ( ) {
+                       /* Call destroy */
+                       $("ul#extendable_list_main").extendablelist("destroy");
+
+                       var destoyedelElements = $("ul#extendable_list_main li");
+                       console.log( destoyedelElements.length );
+
+                       try {
+                               equal ( destoyedelElements.length, 0 );
+                       } catch ( exception ) {
+                               console.log("destroy :" + exception );
+                               return false;
+                       }
+                       return true;
+               }( ) ), "destroy( )");
+       } ;
+
+       /* Load Dummy Data and Init Extendable List widget*/
+       if ( window.JSON_DATA ) {
+               $("ul").filter( function ( ) {
+                       return $( this ).data("role") == "extendablelist";
+               } ).addClass("elLoadSuccess");
+
+               // trigger pagecreate
+               $("#extendablelist-unit-test").page( );
+               $("ul#extendable_list_main").extendablelist("create");
+
+               test("Extendable list test", function ( ) {
+                       unit_extendablelist_test( $('#extendable_list_main') ) ;
+               } );
+       } else {
+               console.log ("Extendable List Init Fail.");
+       }
+} );
diff --git a/tests/additional-unit-tests/extendablelist/index.html b/tests/additional-unit-tests/extendablelist/index.html
new file mode 100755 (executable)
index 0000000..f2d714b
--- /dev/null
@@ -0,0 +1,69 @@
+<!DOCTYPE html>
+<html>
+       <head>
+               <script src="../../../build/tizen-web-ui-fw/latest/js/jquery.js"></script>
+               <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.min.js"></script>
+               <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw.js"
+                       data-framework-theme="tizen-white"
+                       data-framework-viewport-scale=false>
+               </script>
+
+               <link rel="stylesheet" href="../../../libs/js/jquery-mobile-1.2.0/external/qunit.css" />
+               <script src="../../../libs/js/jquery-mobile-1.2.0/external/qunit.js"></script>
+               <script src = "../../../demos/tizen-gray/widgets/list/virtuallist-db-demo.js"></script>
+               <script src="extendablelist-tests.js"></script>
+               <title>Extendable</title>
+       </head>
+
+       <body>
+               <h1 id="qunit-header">Extendablelist</h1>
+               <h2 id="qunit-banner"></h2>
+               <div id="qunit-testrunner-toolbar"></div>
+               <h2 id="qunit-userAgent"></h2>
+               <ol id="qunit-tests"></ol>
+
+               <div id="qunit-fixture">
+                       <div data-role="page" id="dummy-page">
+                               <div data-role="header" data-position="fixed">
+                                       <h1>Dummy</h1>
+                               </div>
+                               <div data-role="contents">
+                               </div>
+                       </div>
+                       <div data-role="page" id="extendablelist-unit-test" data-add-back-btn="true">
+                               <script id="tmp-1line" type="text/x-jquery-tmpl">
+                                       <li class="ui-li-1line"><span class="ui-li-text-main">${NAME}</span></li>
+                               </script>
+                               <script id="tmp_load_more" type="text/x-jquery-tmpl">
+                                       <li class="ui-li-1line" style="text-align:center; margin:0 auto">
+                                               <div data-role="button">Load ${NUM_MORE_ITEMS} more items</div>
+                                       </li>
+                               </script>
+                               <div data-role="header" data-position="fixed">
+                                       <h1>extendable list</h1>
+                               </div>
+                               <div data-role="content">
+                                       <ul id = "extendable_list_main" data-role="extendablelist" data-extenditems="50" data-template="tmp-1line" data-dbtable="JSON_DATA">
+                                       </ul>
+                               </div>
+                       </div>
+                       <div data-role="page" id="extendablelist-unit-test-dynamic" data-add-back-btn="true">
+                               <script id="tmp-2line-" type="text/x-jquery-tmpl">
+                                       <li class="ui-li-1line"><span class="ui-li-text-main">${NAME}</span></li>
+                               </script>
+                               <script id="tmp_load_more2" type="text/x-jquery-tmpl">
+                                       <li class="ui-li-1line" style="text-align:center; margin:0 auto">
+                                               <div data-role="button">Load ${NUM_MORE_ITEMS} more items</div>
+                                       </li>
+                               </script>
+                               <div data-role="header" data-position="fixed">
+                                       <h1>extendable list</h1>
+                               </div>
+                               <div data-role="content">
+                                       
+                               </div>
+                       </div>
+                       
+               </div>
+       </body>
+</html>
diff --git a/tests/additional-unit-tests/fastscroll/fastscroll-tests.js b/tests/additional-unit-tests/fastscroll/fastscroll-tests.js
new file mode 100755 (executable)
index 0000000..1083b37
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Unit Test: FastScroll
+ *
+ * Minkyu Kang <mk7.kang@samsung.com>
+ */
+/*jslint browser: true*/
+/*global $, jQuery, test, equal, ok*/
+( function ( $ ) {
+       module("FastScroll");
+
+       var unit_fastscroll = function ( list ) {
+               var widget,
+                       shortcut,
+                       divider,
+                       fastpopup,
+                       i;
+
+               widget = list.parentsUntil(".ui-content").parent( ).find(".ui-fastscroll");
+               ok( widget , "Markup check: fast scroll");
+               fastpopup = list.parentsUntil(".ui-content").parent( ).find(".ui-fastscroll-popup");
+               ok( fastpopup , "Markup check: fastscroll popup");
+
+               /* Create */
+               ok( widget.hasClass("ui-fastscroll"), "Create");
+               shortcut = widget.find("li");
+               divider = list.find(".ui-li-divider");
+
+               /* Shortcuts */
+               for ( i = 0; i < divider.length; i++ ) {
+                       equal( $( divider[i] ).text( ), $( shortcut[i] ).text( ), "Shortcut");
+               }
+       };
+
+       test("shortcut", function ( ) {
+               unit_fastscroll( $("#shortcut") );
+       } );
+
+}( jQuery ) );
diff --git a/tests/additional-unit-tests/fastscroll/index.html b/tests/additional-unit-tests/fastscroll/index.html
new file mode 100755 (executable)
index 0000000..755bf1c
--- /dev/null
@@ -0,0 +1,90 @@
+<!DOCTYPE html>
+<html>
+<head>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/jquery.js"></script>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.min.js"></script>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw.js"
+               data-framework-theme="tizen-white"
+               data-framework-viewport-scale=false>
+       </script>
+
+       <link rel="stylesheet" href="../../../libs/js/jquery-mobile-1.2.0/external/qunit.css" />
+
+       <script src="../../../libs/js/jquery-mobile-1.2.0/external/qunit.js"></script>
+       <script src="fastscroll-tests.js"></script>
+
+       <title>Fast Scroll</title>
+</head>
+
+<body>
+
+<h1 id="qunit-header">Fast Scroll</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+
+<div id="qunit-fixture">
+
+       <div data-role="page" id="fastscroll">
+               <div data-role="header" data-position="fixed">
+                       <h1>Fast Scroll</h1>
+               </div>
+               <div data-role="content">
+                       <ul id="shortcut" data-role="listview" data-fastscroll="true">
+                               <li data-role="list-divider">A</li>
+                               <li>Anton</li>
+                               <li>Arabella</li>
+                               <li>Art</li>
+                               <li data-role="list-divider">B</li>
+                               <li>Barry</li>
+                               <li>Bibi</li>
+                               <li>Billy</li>
+                               <li>Bob</li>
+                               <li data-role="list-divider">D</li>
+                               <li>Daisy</li>
+                               <li>Derek</li>
+                               <li>Desmond</li>
+                               <li data-role="list-divider">E</li>
+                               <li>Eric</li>
+                               <li>Ernie</li>
+                               <li>Esme</li>
+                               <li data-role="list-divider">F</li>
+                               <li>Fay</li>
+                               <li>Felicity</li>
+                               <li>Francis</li>
+                               <li>Frank</li>
+                               <li data-role="list-divider">H</li>
+                               <li>Harry</li>
+                               <li>Herman</li>
+                               <li>Horace</li>
+                               <li data-role="list-divider">J</li>
+                               <li>Jack</li>
+                               <li>Jane</li>
+                               <li>Jill</li>
+                               <li data-role="list-divider">K</li>
+                               <li>Katherine</li>
+                               <li>Katy</li>
+                               <li>Keith</li>
+                               <li data-role="list-divider">L</li>
+                               <li>Larry</li>
+                               <li>Lee</li>
+                               <li>Lola</li>
+                               <li data-role="list-divider">M</li>
+                               <li>Mark</li>
+                               <li>Milly</li>
+                               <li>Mort</li>
+                               <li data-role="list-divider">N</li>
+                               <li>Nigel</li>
+                               <li>Norman</li>
+                               <li data-role="list-divider">O</li>
+                               <li>Organza</li>
+                               <li>Orlando</li>
+                       </ul>
+               </div>
+       </div>
+
+</div>
+
+</body>
+</html>
diff --git a/tests/additional-unit-tests/gallery/01.jpg b/tests/additional-unit-tests/gallery/01.jpg
new file mode 100755 (executable)
index 0000000..df471b3
Binary files /dev/null and b/tests/additional-unit-tests/gallery/01.jpg differ
diff --git a/tests/additional-unit-tests/gallery/02.jpg b/tests/additional-unit-tests/gallery/02.jpg
new file mode 100755 (executable)
index 0000000..7cd3f0f
Binary files /dev/null and b/tests/additional-unit-tests/gallery/02.jpg differ
diff --git a/tests/additional-unit-tests/gallery/03.jpg b/tests/additional-unit-tests/gallery/03.jpg
new file mode 100755 (executable)
index 0000000..a976675
Binary files /dev/null and b/tests/additional-unit-tests/gallery/03.jpg differ
diff --git a/tests/additional-unit-tests/gallery/04.jpg b/tests/additional-unit-tests/gallery/04.jpg
new file mode 100755 (executable)
index 0000000..9305cd0
Binary files /dev/null and b/tests/additional-unit-tests/gallery/04.jpg differ
diff --git a/tests/additional-unit-tests/gallery/05.jpg b/tests/additional-unit-tests/gallery/05.jpg
new file mode 100755 (executable)
index 0000000..120cd41
Binary files /dev/null and b/tests/additional-unit-tests/gallery/05.jpg differ
diff --git a/tests/additional-unit-tests/gallery/06.jpg b/tests/additional-unit-tests/gallery/06.jpg
new file mode 100755 (executable)
index 0000000..11f4ef9
Binary files /dev/null and b/tests/additional-unit-tests/gallery/06.jpg differ
diff --git a/tests/additional-unit-tests/gallery/07.jpg b/tests/additional-unit-tests/gallery/07.jpg
new file mode 100755 (executable)
index 0000000..c7178f2
Binary files /dev/null and b/tests/additional-unit-tests/gallery/07.jpg differ
diff --git a/tests/additional-unit-tests/gallery/08.jpg b/tests/additional-unit-tests/gallery/08.jpg
new file mode 100755 (executable)
index 0000000..b6adfee
Binary files /dev/null and b/tests/additional-unit-tests/gallery/08.jpg differ
diff --git a/tests/additional-unit-tests/gallery/09.jpg b/tests/additional-unit-tests/gallery/09.jpg
new file mode 100755 (executable)
index 0000000..33d4d66
Binary files /dev/null and b/tests/additional-unit-tests/gallery/09.jpg differ
diff --git a/tests/additional-unit-tests/gallery/10.jpg b/tests/additional-unit-tests/gallery/10.jpg
new file mode 100755 (executable)
index 0000000..7b556da
Binary files /dev/null and b/tests/additional-unit-tests/gallery/10.jpg differ
diff --git a/tests/additional-unit-tests/gallery/11.jpg b/tests/additional-unit-tests/gallery/11.jpg
new file mode 100755 (executable)
index 0000000..a712a66
Binary files /dev/null and b/tests/additional-unit-tests/gallery/11.jpg differ
diff --git a/tests/additional-unit-tests/gallery/gallery-tests.js b/tests/additional-unit-tests/gallery/gallery-tests.js
new file mode 100755 (executable)
index 0000000..830ffce
--- /dev/null
@@ -0,0 +1,144 @@
+/*
+ * Unit Test: gallery
+ *
+ * Minkyu Kang <mk7.kang@samsung.com>
+ */
+/*jslint browser: true*/
+/*global $, jQuery, test, equal, ok*/
+$( document ).ready( function ( ) {
+       module("gallery");
+
+       var unit_gallery = function ( widget, count ) {
+               var imagesldier,
+                       refresh = function ( widget ) {
+                               widget.gallery("refresh", "1");
+                               return widget.find(".ui-gallery-bg");
+                       },
+                       imageWrapperDiv = widget.find(".ui-gallery-bg"),
+                       imageCount = widget.find(".ui-gallery-bg img"),
+                       index = widget.jqmData("index"),
+                       alignment = widget.jqmData("vertical-align"),
+                       gallery,
+                       temp_img;
+
+               /* Create */
+               widget.gallery( );
+
+               gallery = widget.find(".ui-gallery-bg");
+               ok( gallery, "Create");
+
+               /* Initialize */
+               equal( gallery.length, count, "Initialize");
+
+               /*Initail image count*/
+               equal( imageCount.length, 3, "Makrup : image tag count");
+               equal( imageWrapperDiv.length, count, "Markup : wrapper div count");
+
+               /* current image*/
+               equal( index , 3, "Property: data-index");
+
+               /* vartical alignment image*/
+               equal( alignment , "middle", "Property: data-vertical-align");
+
+               /*Current Image Check*/
+               temp_img = widget.find('.ui-gallery-bg:eq(' + index + ' ) img');
+               equal( temp_img.attr("src") , "04.jpg", "Current Image Check");
+
+               /* API: length */
+               equal( widget.gallery("length"), count, "API: length");
+
+               /* API: del */
+               widget.gallery("remove", count - 1 );
+               gallery = refresh( widget );
+               equal( gallery.length, count - 1, "API: del");
+
+               /* API: add */
+               widget.gallery("add", "06.jpg");
+               gallery = refresh( widget );
+               equal( gallery.length, count , "API: add");
+
+               /* vartical alignment image*/
+               widget.jqmData("vertical-align", 'top') ;
+               gallery = refresh( widget );
+               alignment = widget.jqmData("vertical-align") ;
+               equal( alignment , "top", "Property change: data-vertical-align");
+
+               /* vartical alignment image*/
+               widget.jqmData("vertical-align", 'bottom') ;
+               gallery = refresh( widget );
+               alignment = widget.jqmData("vertical-align") ;
+               equal( alignment , "bottom", "Property change: data-vertical-align");
+
+               /* API: length */
+               equal( widget.gallery("value"), 1, "API: value");
+
+               /* API: del */
+               widget.gallery("remove", -1 );
+               gallery = refresh( widget );
+               equal( gallery.length, count , "API: remove with invalid index");
+               widget.gallery("remove", 1 );
+               gallery = refresh( widget );
+               count-- ;
+               equal( gallery.length, count , "API: remove with index less then current index");
+
+               widget.gallery("remove", 3 );
+               gallery = refresh( widget );
+               count-- ;
+               equal( gallery.length, count , "API: remove with index greater then current index");
+
+               widget.gallery("remove", 2 );
+               gallery = refresh( widget );
+               count-- ;
+               equal( gallery.length, count, "API: remove with current index");
+
+               /* API: empty */
+               widget.gallery("empty");
+               gallery = refresh( widget );
+               equal( gallery.length, 0, "API: empty");
+               count = 0 ;
+
+               /* API: add */
+               widget.gallery("add", "06.jpg");
+               widget.gallery("add", "07.jpg");
+               widget.gallery("add", "08.jpg");
+               count = 3;
+               gallery = refresh( widget );
+               equal( gallery.length, count , "API: add");
+               widget.gallery("remove", 1 );
+               gallery = refresh( widget );
+               count-- ;
+               equal( gallery.length, count, "API: remove with current index");
+               widget.gallery("remove", 0 );
+               gallery = refresh( widget );
+               count-- ;
+               equal( gallery.length, count, "API: remove with current index");
+
+               widget.gallery("hide");
+               gallery = refresh( widget );
+               equal( gallery.find('ui-gallery-bg').attr('style'), undefined , "API: hide");
+               widget.gallery("show");
+               gallery = refresh( widget );
+               equal( gallery.find('ui-gallery-bg').attr('style'), undefined , "API: show");
+       };
+
+       test("gallery", function ( ) {
+               $('#gallery-page-test').page( );
+               unit_gallery( $("#gallery"), 5 );
+       } );
+
+       test("Gallery Dynamic", function ( ) {
+
+               var markup = '<div data-role="gallery"id="gallery2"data-index="3"data-vertical-align="middle">' +
+                                                               '<img src="01.jpg"/>' +
+                                                               '<img src="02.jpg"/>' +
+                                                               '<img src="03.jpg"/>' +
+                                                               '<img src="04.jpg"/>' +
+                                                       '</div>';
+               $('#gallery-page-test-dynamic').page( );
+               $('#gallery-page-test-dynamic').find(":jqmData(role=content)").append( markup ) ;
+               $('#gallery-page-test-dynamic').find(":jqmData(role=content)").trigger('create') ;
+               unit_gallery( $("#gallery2"), 5 );
+
+       } );
+
+} );
diff --git a/tests/additional-unit-tests/gallery/index.html b/tests/additional-unit-tests/gallery/index.html
new file mode 100755 (executable)
index 0000000..0058b47
--- /dev/null
@@ -0,0 +1,55 @@
+<!DOCTYPE html>
+<html>
+<head>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/jquery.js"></script>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.min.js"></script>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw.js"
+               data-framework-theme="tizen-white"
+               data-framework-viewport-scale=false>
+       </script>
+
+       <link rel="stylesheet" href="../../../libs/js/jquery-mobile-1.2.0/external/qunit.css" />
+
+       <script src="../../../libs/js/jquery-mobile-1.2.0/external/qunit.js"></script>
+       <script src="gallery-tests.js"></script>
+
+       <title>Gallery</title>
+</head>
+
+<body>
+
+<h1 id="qunit-header">Gallery</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+
+<div id="qunit-fixture">
+
+       <div data-role="page" id='gallery-page-test'>
+               <div data-role="header" data-position="fixed">
+                       <h1>Gallery</h1>
+               </div>
+               <div data-role="content" data-scroll="none" id='gallerycontent'>
+                       <div data-role="gallery" id="gallery" data-index="3" data-vertical-align="middle">
+                               <img src="01.jpg">
+                               <img src="02.jpg">
+                               <img src="03.jpg">
+                               <img src="04.jpg">
+                               <img src="05.jpg">
+                       </div>
+               </div>
+       </div>
+       
+       <div data-role="page" id='gallery-page-test-dynamic'>
+               <div data-role="header" data-position="fixed">
+                       <h1>Gallery</h1>
+               </div>
+               <div data-role="content" data-scroll="none" id='gallerycontentdynamic'></div>
+       </div>
+       
+
+</div>
+
+</body>
+</html>
diff --git a/tests/additional-unit-tests/gallery3d/gallery3d-tests.js b/tests/additional-unit-tests/gallery3d/gallery3d-tests.js
new file mode 100755 (executable)
index 0000000..85d7314
--- /dev/null
@@ -0,0 +1,99 @@
+/*
+ * Unit Test: Gallery3d
+ *
+ * Wonseop Kim <wonseop.kim@samsung.com>
+ */
+
+(function ($) {
+       $.mobile.defaultTransition = "none";
+
+       module("Galley3d");
+
+       asyncTest( "create & select", function() {
+               var widget = $( "#galley3dTest1" ),
+                       imageList = [],
+                       path = widget.attr( "data-json-url" ),
+                       key = widget.attr( "data-json-key" ),
+                       elem = "ui-gallery3d";
+
+               $.ajax({
+                       async : false,
+                       url : path,
+                       dataType: "json",
+                       success : function ( result ) {
+                               imageList = result[key];
+                       }
+               });
+
+               /* Create */
+               widget.gallery3d();
+               ok( widget.hasClass( elem ), "Create" );
+
+               /* API */
+               widget.gallery3d( "select", 1 );
+               setTimeout( function () {
+                       equal( widget.gallery3d( "select" ), imageList[1].src, "API : select" );
+                       start();
+               }, 2400 );
+       });
+
+       asyncTest( "remove", function() {
+               var widget = $( "#galley3dTest2" ),
+                       imageList = [],
+                       path = widget.attr( "data-json-url" ),
+                       key = widget.attr( "data-json-key" ),
+                       currentSource;
+
+               $.ajax({
+                       async : false,
+                       url : path,
+                       dataType: "json",
+                       success : function ( result ) {
+                               imageList = result[key];
+                       }
+               });
+
+               widget.gallery3d();
+               currentSource = widget.gallery3d( "select" );
+
+               /* API */
+               widget.gallery3d( "remove" );
+               notEqual( widget.gallery3d( "select" ), currentSource, "API : remove" );
+               start();
+       });
+
+       asyncTest( "move", function() {
+               var widget = $( "#galley3dTest3" ),
+                       imageList = [],
+                       path = widget.attr( "data-json-url" ),
+                       key = widget.attr( "data-json-key" ),
+                       currentSource;
+
+               $.ajax({
+                       async : false,
+                       url : path,
+                       dataType: "json",
+                       success : function ( result ) {
+                               imageList = result[key];
+                       }
+               });
+
+               widget.gallery3d();
+               currentSource = widget.gallery3d( "select" );
+
+               /* API */
+               widget.gallery3d( "moveNext" );
+               setTimeout( function () {
+                       equal( widget.gallery3d( "select" ), imageList[1].src, "API : moveNext" );
+                       start();
+
+                       stop();
+                       widget.gallery3d( "movePrev" );
+                       setTimeout( function () {
+                               equal( widget.gallery3d( "select" ), imageList[0].src, "API : movePrev" );
+                               start();
+                       }, 300 );
+               }, 2400 );
+       });
+
+}( jQuery ));
diff --git a/tests/additional-unit-tests/gallery3d/index.html b/tests/additional-unit-tests/gallery3d/index.html
new file mode 100755 (executable)
index 0000000..7935a4b
--- /dev/null
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<html>
+<head>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/jquery.js"></script>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.js"></script>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw.js"
+               data-framework-theme="tizen-gray"
+               data-framework-viewport-scale=false>
+       </script>
+
+       <link rel="stylesheet" href="../../../libs/js/jquery-mobile-1.1.0/external/qunit.css" />
+
+       <script src="../../../libs/js/jquery-mobile-1.1.0/external/qunit.js"></script>
+       <script src="gallery3d-tests.js"></script>
+
+       <title>Galley3d</title>
+</head>
+
+<body>
+
+<h1 id="qunit-header">Galley3d</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+
+<div id="qunit-fixture">
+
+       <div data-role="page">
+               <div data-role="header" data-position="fixed">
+                       <h1>Galley3d</h1>
+               </div>
+               <div data-role="content">
+                       <div id="galley3dTest1" data-role="galley3d" style="width: 100%;"
+                               data-json-url="../../../demos/tizen-gray/widgets/gallery3d/gallery3d-db.json"
+                               data-json-key="JSON_DATA" > </div>
+               </div>
+       </div>
+
+       <div data-role="page">
+               <div data-role="header" data-position="fixed">
+                       <h1>Galley3d</h1>
+               </div>
+               <div data-role="content">
+                       <div id="galley3dTest2" data-role="galley3d" style="width: 100%;"
+                               data-json-url="../../../demos/tizen-gray/widgets/gallery3d/gallery3d-db.json"
+                               data-json-key="JSON_DATA" > </div>
+               </div>
+       </div>
+
+       <div data-role="page">
+               <div data-role="header" data-position="fixed">
+                       <h1>Galley3d</h1>
+               </div>
+               <div data-role="content">
+                       <div id="galley3dTest3" data-role="galley3d" style="width: 100%;"
+                               data-json-url="../../../demos/tizen-gray/widgets/gallery3d/gallery3d-db.json"
+                               data-json-key="JSON_DATA" > </div>
+               </div>
+       </div>
+
+</div>
+
+</body>
+</html>
diff --git a/tests/additional-unit-tests/handler/handler-tests.js b/tests/additional-unit-tests/handler/handler-tests.js
new file mode 100755 (executable)
index 0000000..d63ac8e
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Unit Test: Handler
+ *
+ * Wonseop Kim <wonseop.kim@samsung.com>
+ */
+/*jslint browser: true*/
+/*global $,  jQuery,  test,  equal,  ok*/
+( function ( $ ) {
+       module("Handler");
+
+       var unit_handler = function ( widget ) {
+               var elem = ".ui-handler",
+                       handler;
+
+               /* Create */
+               widget.scrollview( );
+               handler = widget.find( elem );
+               ok( ( handler.length > 0 ), "Create");
+
+               /* API */
+               widget.scrollview("enableHandler",  false );
+               ok( handler.is(":hidden"), "API: enableHandler( false )");
+               widget.scrollview("enableHandler",  true );
+               ok( handler.is(":visible"), "API: enableHandler( true )");
+       };
+
+       test("handler",  function ( ) {
+               $('#handler0').page( );
+               unit_handler( $("#handlerY") );
+       } );
+
+       test( "handler - dynamic",  function ( ) {
+               var listHTML = '<div id= "handlerY"data-role= "content"data-scroll= "y"data-handler= "true">' +
+                                                                       '<ul data-role= "listview">                                                                                     ' +
+                                                                               '<li><a href= "#">Graham Smith</a></li>' +
+                                                                               '<li><a href= "#">Greta Peete</a></li>' +
+                                                                               '<li data-role= "list-divider">H</li>' +
+                                                                               '<li><a href= "#">Harvey Walls</a></li>' +
+                                                                       '</ul>' +
+                                                               '</div>';
+
+               $('#handler1').page( );
+               $('#handler1').find(":jqmData(role=content)").empty( );
+               $('#handler1').find(":jqmData(role=content)").append( listHTML ).trigger('create') ;
+               unit_handler( $("#handlerY") );
+       } );
+}( jQuery ) );
diff --git a/tests/additional-unit-tests/handler/index.html b/tests/additional-unit-tests/handler/index.html
new file mode 100755 (executable)
index 0000000..6233d48
--- /dev/null
@@ -0,0 +1,77 @@
+<!DOCTYPE html>
+<html>
+<head>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/jquery.js"></script>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.min.js"></script>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw.js"
+               data-framework-theme="tizen-white"
+               data-framework-viewport-scale=false>
+       </script>
+
+       <link rel="stylesheet" href="../../../libs/js/jquery-mobile-1.2.0/external/qunit.css" />
+
+       <script src="../../../libs/js/jquery-mobile-1.2.0/external/qunit.js"></script>
+       <script src="handler-tests.js"></script>
+
+       <title>Handler</title>
+</head>
+
+<body>
+
+<h1 id="qunit-header">Handler</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+
+<div id="qunit-fixture">
+
+       <div data-role="page" id="handler0">
+               <div data-role="header" data-position="fixed">
+                       <h1>Handler</h1>
+               </div>
+               <div data-role="content" >
+                       <div id="handlerY" data-role="content" data-scroll="y" data-handler="true">
+                               <ul data-role="listview">
+                                       <li data-role="list-divider">A</li>
+                                       <li><a href="#">Adam Kinkaid</a></li>
+                                       <li><a href="#">Alex Wickerham</a></li>
+                                       <li><a href="#">Avery Johnson</a></li>
+                                       <li data-role="list-divider">B</li>
+                                       <li><a href="#">Bob Cabot</a></li>
+                                       <li data-role="list-divider">C</li>
+                                       <li><a href="#">Caleb Booth</a></li>
+                                       <li><a href="#">Christopher Adams</a></li>
+                                       <li><a href="#">Culver James</a></li>
+                                       <li data-role="list-divider">D</li>
+                                       <li><a href="#">David Walsh</a></li>
+                                       <li><a href="#">Drake Alfred</a></li>
+                                       <li data-role="list-divider">E</li>
+                                       <li><a href="#">Elizabeth Bacon</a></li>
+                                       <li><a href="#">Emery Parker</a></li>
+                                       <li><a href="#">Enid Voldon</a></li>
+                                       <li data-role="list-divider">F</li>
+                                       <li><a href="#">Francis Wall</a></li>
+                                       <li data-role="list-divider">G</li>
+                                       <li><a href="#">Graham Smith</a></li>
+                                       <li><a href="#">Greta Peete</a></li>
+                                       <li data-role="list-divider">H</li>
+                                       <li><a href="#">Harvey Walls</a></li>
+                               </ul>
+                       </div>
+               </div>
+       </div>
+       
+       
+       <div data-role="page" id="handler1">
+               <div data-role="header" data-position="fixed">
+                       <h1>Handler</h1>
+               </div>
+               <div data-role="content" >
+                       
+               </div>
+       </div>
+</div>
+
+</body>
+</html>
diff --git a/tests/additional-unit-tests/headerfooter/headerfooter-tests.js b/tests/additional-unit-tests/headerfooter/headerfooter-tests.js
new file mode 100755 (executable)
index 0000000..44fcf71
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * Unit Test: Header Footer
+ *
+ *
+ */
+/*jslint browser: true*/
+/*global $, jQuery, test, equal, ok*/
+$( document ).ready( function ( ) {
+
+       module("Header Footer");
+
+       var unit_headerfooter_test = function ( widget, type ) {
+               var html ;
+
+               /*Markuo check*/
+               equal( widget.hasClass('ui-' + type ), true, "Markup check") ;
+
+               equal( widget.jqmData('position'), 'fixed', "jqmData - position") ;
+               equal( $('.ui.page-active').find('.ui-footer a.ui-btn-back').length, 0, "markup check back button present") ;
+               equal( widget.css('display'), 'block', "CSS check for display") ;
+
+               /*hide show API*/
+               widget.hide( );
+               equal( widget.css('display'), 'none', "API hide") ;
+               widget.show( );
+               equal( widget.css('display'), 'block', "API show") ;
+
+               /*add text */
+               html = "<h1>Sample text</h1>";
+               widget.html( html );
+               $('.ui.page-active').page('refresh') ;
+               equal( widget.html( ) , html, "Markup check after adding text") ;
+       } ;
+
+       test("Header", function ( ) {
+               // trigger pagecreate
+               $("#headerfooter-unit-test").page( );
+               unit_headerfooter_test( $("#headerfooter-unit-test").find(':jqmData(role=header)') , 'header') ;
+
+       } );
+
+       test("footer", function ( ) {
+               // trigger pagecreate
+               $("#headerfooter-unit-test-footer").page( );
+               unit_headerfooter_test( $("#headerfooter-unit-test-footer").find(':jqmData(role=footer)'), 'footer') ;
+
+       } );
+
+} );
diff --git a/tests/additional-unit-tests/headerfooter/index.html b/tests/additional-unit-tests/headerfooter/index.html
new file mode 100755 (executable)
index 0000000..5c426d7
--- /dev/null
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<html>
+       <head>
+               <script src="../../../build/tizen-web-ui-fw/latest/js/jquery.js"></script>
+               <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.min.js"></script>
+               <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw.js"
+                       data-framework-theme="tizen-white"
+                       data-framework-viewport-scale=false>
+               </script>
+
+               <link rel="stylesheet" href="../../../libs/js/jquery-mobile-1.2.0/external/qunit.css" />
+               <script src="../../../libs/js/jquery-mobile-1.2.0/external/qunit.js"></script>
+               <script src="headerfooter-tests.js"></script>
+               <title>Header Footer</title>
+       </head>
+
+       <body>
+               <h1 id="qunit-header">Header Footer</h1>
+               <h2 id="qunit-banner"></h2>
+               <div id="qunit-testrunner-toolbar"></div>
+               <h2 id="qunit-userAgent"></h2>
+               <ol id="qunit-tests"></ol>
+
+               <div id="qunit-fixture">
+                       <div data-role="page" id="dummy-page">
+                               <div data-role="header" data-position="fixed">
+                                       <h1>Dummy</h1>
+                               </div>
+                               <div data-role="contents">
+                               </div>
+                       </div>
+
+                       <div data-role="page" id="headerfooter-unit-test" data-add-back-btn="true">
+                               <div data-role="header" data-position="fixed">
+                                       <h1>Header Footer</h1>                                  
+                               </div>
+                               <div data-role="content" id="headerfooter-content" >                                                            
+                               </div>
+                               <div data-role="footer" data-position="fixed">
+                                       <h1>Dummy</h1>
+                               </div>
+                       </div>
+               </div>
+               <div data-role="page" id="headerfooter-unit-test-footer" data-add-back-btn="true">
+                               <div data-role="contents">
+                               </div>
+                               <div data-role="footer" data-position="fixed">
+                                       <h1>Dummy</h1>
+                               </div>
+                       </div>
+       </body>
+</html>
diff --git a/tests/additional-unit-tests/index.html b/tests/additional-unit-tests/index.html
new file mode 100755 (executable)
index 0000000..454dfef
--- /dev/null
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <meta charset="utf-8">
+
+  <link rel="stylesheet" href="../../libs/js/jquery-mobile-1.2.0/external/qunit.css"/>
+  <script src="../../build/tizen-web-ui-fw/latest/js/jquery.js"></script>
+  <script src="../../libs/js/jquery-mobile-1.2.0/external/qunit.js"></script>
+  <script src="../jqm-tchelper/cookie.js"></script>
+  <script src="tests.js"></script>
+  <script src="runner.js"></script>
+  <style type="text/css">
+    html, body {
+      width:100%;
+      height:100%;
+      margin:0px;
+      padding:0px;
+    }
+
+    #testFrame {
+      float: left;
+      border: 0px;
+      height: 100%;
+      width: 60%;
+    }
+
+    #results {
+      float: left;
+      width: 30%;
+    }
+  </style>
+</head>
+<body>
+  <div id="results">
+    <h1 id="qunit-header"><a href="#">jQuery Mobile Test Suite</a></h1>
+    <h2 id="qunit-banner"></h2>
+    <ol id="qunit-tests">
+    </ol>
+  </div>
+       <iframe data-src="{{testfile}}" name="testFrame" id="testFrame" scrolling="no">
+       </iframe>
+</body>
+</html>
diff --git a/tests/additional-unit-tests/list.txt b/tests/additional-unit-tests/list.txt
new file mode 100755 (executable)
index 0000000..d14642d
--- /dev/null
@@ -0,0 +1,31 @@
+autodivider/autodivider-tests.js
+button/button-tests.js
+check/check-tests.js
+collapsible/collapsible-tests.js
+datetimepicker/datetimepicker-tests.js
+dayselector/dayselector-tests.js
+extendablelist/extendablelist-tests.js
+fastscroll/fastscroll-tests.js
+gallery3d/gallery3d-tests.js
+gallery/gallery-tests.js
+handler/handler-tests.js
+headerfooter/headerfooter-tests.js
+listdividers/listdividers-tests.js
+list/list-tests.js
+loader/loader-tests.js
+multimediaview/multimediaview-tests.js
+navigationbar/navigationbar-tests.js
+notification/notification-tests.js
+popupwindow_ctxpopup/ctxpopup-tests.js
+popupwindow/popup-tests.js
+progressbar/progressbar-tests.js
+radio/radio-tests.js
+searchbar/searchbar-tests.js
+segmentcontrol/segmentcontrol-tests.js
+slider/slider-tests.js
+swipe/swipe-tests.js
+tabbar/tabbar-tests.js
+toggleswitch/toggleswitch-tests.js
+tokentextarea/tokentextarea-tests.js
+virtualgrid/virtualgrid-tests.js
+virtuallist/virtuallist-tests.js
diff --git a/tests/additional-unit-tests/list/index.html b/tests/additional-unit-tests/list/index.html
new file mode 100755 (executable)
index 0000000..7a33f79
--- /dev/null
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+       <head>
+               <script src="../../../build/tizen-web-ui-fw/latest/js/jquery.js"></script>
+               <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.min.js"></script>
+               <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw.js"
+                       data-framework-theme="tizen-white"
+                       data-framework-viewport-scale=false>
+               </script>
+               <link rel="stylesheet" href="../../../libs/js/jquery-mobile-1.2.0/external/qunit.css" />
+               <script src="../../../libs/js/jquery-mobile-1.2.0/external/qunit.js"></script>
+               <script src="list-tests.js"></script>
+               <title>List</title>
+       </head>
+
+       <body>
+               <h1 id="qunit-header">List</h1>
+               <h2 id="qunit-banner"></h2>
+               <div id="qunit-testrunner-toolbar"></div>
+               <h2 id="qunit-userAgent"></h2>
+               <ol id="qunit-tests"></ol>
+
+               <div id="qunit-fixture">
+                       <div data-role="page" id="dummy-page">
+                               <div data-role="header" data-position="fixed">
+                                       <h1>Dummy</h1>
+                               </div>
+                               <div data-role="contents">
+                               </div>
+                       </div>
+
+                       <div data-role="page" id="list-unit-test" data-add-back-btn="true">
+                               <div data-role="header" data-position="fixed">
+                                       <h1>List</h1>
+                                       <input type="search" data-cancel-btn='true' name="search" data-icon="call" id="searchInput" value=""/>
+                               </div>
+                               <div data-role="content" id="list-content">
+                                       <ul id="listsample" data-role="listview" data-fastscroll="true">
+                                               <li>Anton</li>
+                                               <li class='ui-li-multiline'>    Arabella        <span class='ui-li-text-sub'>Subtext</span></li>
+                                               <li>Art<a href='#dummy-page'>1line-sub with anchor<span class='ui-li-text-sub'>Subtext</span></a>       </li>
+                                               <li>Barry<img src='thumbnail.jpg' class='ui-li-bigicon'/>1line-bigicon1</li></li>
+                                               <li>Bibi</li>
+                                               <li>Billy</li>
+                                               <li>Bob</li>
+                                       </ul>
+                               </div>
+                       </div>
+               </div>
+               <div data-role="page" id="list-unit-test-dynamic">
+                               <div data-role="header" data-position="fixed">
+                                       <h1>Dummy</h1>
+                               </div>
+                               <div data-role="contents">
+                               </div>
+                       </div>
+       </body>
+</html>
diff --git a/tests/additional-unit-tests/list/list-tests.js b/tests/additional-unit-tests/list/list-tests.js
new file mode 100755 (executable)
index 0000000..f71cdd1
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * Unit Test: list
+ *
+ *
+ */
+/*jslint browser: true*/
+/*global $, jQuery, test, equal, ok*/
+$( document ).ready( function ( ) {
+
+       module("List");
+
+       var unit_list_test = function ( widget ) {
+               var li ;
+
+               /*markup*/
+               equal( widget.hasClass("ui-listview"), true, "Markup check") ;
+               equal( widget.find('li.ui-li').length, 7, "Markup check") ;
+               equal( widget.find('li.ui-li-multiline').length, 1, "Markup check: multiline text") ;
+               equal( widget.find('li.ui-li-multiline span.ui-li-text-sub').length, 1, "Markup check: multiline text") ;
+               equal( widget.find('li.ui-li a.ui-link-inherit').length, 1, "Markup check:item with anchor") ;
+               equal( widget.find('li.ui-li-has-thumb img.ui-li-bigicon').length, 1, "Markup check: item with icon") ;
+
+               li = "<li>1line</li>";
+               $( li ).appendTo( widget );
+               $( widget ).listview("refresh");
+               equal( widget.find('li.ui-li').length, 8, "Markup check") ;
+       } ;
+
+       test("List", function ( ) {
+               // trigger pagecreate
+               $("#list-unit-test").page( );
+               /* Initialize */
+               $('#listsample').listview( );
+               unit_list_test( $('#listsample'), {button : 'call', cancel : true} ) ;
+
+       } );
+
+       test("List- dynamic", function ( ) {
+
+               var createEvent = false,
+                       listHTMML = '<ul id= "listsample1"data-role= "listview"data-fastscroll= "true">' +
+                                                                       '<li>Anton</li>' +
+                                                                       '<li class= "ui-li-multiline"> Arabella <span class= "ui-li-text-sub">Subtext</span></li>' +
+                                                                       '<li>Art<a href= "#dummy-page">1line-sub with anchor<span class= "ui-li-text-sub">Subtext</span></a> </li>' +
+                                                                       '<li>Barry<img src= "thumbnail.jpg"class= "ui-li-bigicon"/>1line-bigicon1</li></li>' +
+                                                                       '<li>Bibi</li>' +
+                                                                       '<li>Billy</li>' +
+                                                                       '<li>Bob</li>' +
+                                                               '</ul>';
+
+               // trigger pagecreate
+               $("#list-unit-test-dynamic").page( );
+               /* Initialize */
+               $("#list-unit-test-dynamic").find(":jqmData(role=contents)").append( listHTMML ) ;
+               $('#listsample1').listview( {create : function ( ) {
+                       createEvent = true ;
+               }} );
+
+               $("#list-unit-test-dynamic").find(":jqmData(role=contents)").trigger('create') ;
+               $('#listsample1').listview( ) ;
+
+               equal( createEvent, true, "Create Event") ;
+               unit_list_test( $('#listsample1') ) ;
+
+       } );
+
+} );
diff --git a/tests/additional-unit-tests/listdividers/index.html b/tests/additional-unit-tests/listdividers/index.html
new file mode 100755 (executable)
index 0000000..16916e4
--- /dev/null
@@ -0,0 +1,76 @@
+<!DOCTYPE html>
+<html>
+       <head>
+               <script src="../../../build/tizen-web-ui-fw/latest/js/jquery.js"></script>
+               <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.min.js"></script>
+               <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw.js"
+                       data-framework-theme="tizen-white"
+                       data-framework-viewport-scale=false>
+               </script>
+
+               <link rel="stylesheet" href="../../../libs/js/jquery-mobile-1.2.0/external/qunit.css" />
+               <script src="../../../libs/js/jquery-mobile-1.2.0/external/qunit.js"></script>
+               <script src="listdividers-tests.js"></script>
+               <title>List Dividers</title>
+       </head>
+
+       <body>
+               <h1 id="qunit-header">List Divider</h1>
+               <h2 id="qunit-banner"></h2>
+               <div id="qunit-testrunner-toolbar"></div>
+               <h2 id="qunit-userAgent"></h2>
+               <ol id="qunit-tests"></ol>
+
+               <div id="qunit-fixture">
+                       <div data-role="page" id="dummy-page">
+                               <div data-role="header" data-position="fixed">
+                                       <h1>Dummy</h1>
+                               </div>
+                               <div data-role="contents">
+                               </div>
+                       </div>
+
+                       <div data-role="page" id="listdividers-unit-test" data-add-back-btn="true">
+                               <div data-role="header" data-position="fixed">
+                                       <h1>List Divider</h1>
+                                       <input type="search" data-cancel-btn='true' name="search" data-icon="call" id="searchInput" value=""/>
+                               </div>
+                               <div data-role="content" id="listdividers-content">
+                                                               <ul data-role="listview" id='listdividerssample'>
+                                                               <li data-role="list-divider">A</li>
+                                                               <li><a href="#">Adam Kinkaid</a></li>
+                                                               <li><a href="#">Alex Wickerham</a></li>
+                                                               <li><a href="#">Avery Johnson</a></li>
+                                                               <li data-role="list-divider" data-style='dialogue'>B</li>
+                                                               <li><a href="#">Bob Cabot</a></li>
+                                                               <li data-role="list-divider" data-style='check'>C</li>
+                                                               <li><a href="#">Caleb Booth</a></li>
+                                                               <li><a href="#">Christopher Adams</a></li>
+                                                               <li><a href="#">Culver James</a></li>
+                                                               <li data-role="list-divider" data-style='expandable'>D</li>
+                                                               <li><a href="#">David Walsh</a></li>
+                                                               <li><a href="#">Drake Alfred</a></li>
+                                                               <li data-role="list-divider" data-style='checkexpandable'>E</li>
+                                                               <li><a href="#">Elizabeth Bacon</a></li>
+                                                               <li><a href="#">Emery Parker</a></li>
+                                                               <li><a href="#">Enid Voldon</a></li>
+                                                               <li data-role="list-divider">F</li>
+                                                               <li><a href="#">Francis Wall</a></li>
+                                                               <li data-role="list-divider">G</li>
+                                                               <li><a href="#">Graham Smith</a></li>
+                                                               <li><a href="#">Greta Peete</a></li>
+                                                               <li data-role="list-divider">H</li>
+                                                               <li><a href="#">Harvey Walls</a></li>
+                                                       </ul>
+                               </div>
+                       </div>
+               </div>
+               <div data-role="page" id="listdividers-unit-test-dynamic">
+                               <div data-role="header" data-position="fixed">
+                                       <h1>Dummy</h1>
+                               </div>
+                               <div data-role="contents">
+                               </div>
+                       </div>
+       </body>
+</html>
diff --git a/tests/additional-unit-tests/listdividers/listdividers-tests.js b/tests/additional-unit-tests/listdividers/listdividers-tests.js
new file mode 100755 (executable)
index 0000000..a9393b4
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+ * Unit Test: listdividers
+ *
+ *
+ */
+/*jslint browser: true*/
+/*global $, jQuery, test, equal, ok*/
+$( document ).ready( function ( ) {
+
+       module("List dividers");
+
+       var unit_listdividers_test = function ( widget ) {
+               var li ;
+
+               /*markup*/
+               equal( widget.hasClass("ui-listview"), true, "Markup check") ;
+               equal( widget.find('li.ui-li').length, 24, "Markup check") ;
+               equal( widget.find(":jqmData(role=list-divider)").length, 8, "List dividers count");
+               equal( widget.find('li.ui-li-divider').length, 8, "Markup check : list dividers count") ;
+
+               li = "<li>1line</li>";
+               $( li ).appendTo( widget );
+               $( widget ).listview("refresh");
+               equal( widget.find('li.ui-li').length, 25, "Markup check") ;
+       } ;
+
+       test("Listdividers", function ( ) {
+               // trigger pagecreate
+               $("#listdividers-unit-test").page( );
+               /* Initialize */
+               $('#listdividerssample').listview( );
+               unit_listdividers_test( $('#listdividerssample'), {button : 'call', cancel : true} ) ;
+
+       } );
+
+       test("Listdividers- dynamic", function ( ) {
+               var createEvent = false,
+                       listHTMML = '<ul data-role= "listview"id= "listdividerssample1">' +
+                                                                                       '<li data-role= "list-divider">A</li>' +
+                                                                                       '<li><a href= "#">Adam Kinkaid</a></li>' +
+                                                                                       '<li><a href= "#">Alex Wickerham</a></li>' +
+                                                                                       '<li><a href= "#">Avery Johnson</a></li>' +
+                                                                                       '<li data-role= "list-divider"data-style= "dialogue">B</li>' +
+                                                                                       '<li><a href= "#">Bob Cabot</a></li>' +
+                                                                                       '<li data-role= "list-divider"data-style= "check">C</li>' +
+                                                                                       '<li><a href= "#">Caleb Booth</a></li>' +
+                                                                                       '<li><a href= "#">Christopher Adams</a></li>' +
+                                                                                       '<li><a href= "#">Culver James</a></li>' +
+                                                                                       '<li data-role= "list-divider"data-style= "expandable">D</li>' +
+                                                                                       '<li><a href= "#">David Walsh</a></li>' +
+                                                                                       '<li><a href= "#">Drake Alfred</a></li>' +
+                                                                                       '<li data-role= "list-divider"data-style= "checkexpandable">E</li>' +
+                                                                                       '<li><a href= "#">Elizabeth Bacon</a></li>' +
+                                                                                       '<li><a href= "#">Emery Parker</a></li>' +
+                                                                                       '<li><a href= "#">Enid Voldon</a></li>' +
+                                                                                       '<li data-role= "list-divider">F</li>' +
+                                                                                       '<li><a href= "#">Francis Wall</a></li>' +
+                                                                                       '<li data-role= "list-divider">G</li>' +
+                                                                                       '<li><a href= "#">Graham Smith</a></li>' +
+                                                                                       '<li><a href= "#">Greta Peete</a></li>' +
+                                                                                       '<li data-role= "list-divider">H</li>' +
+                                                                                       '<li><a href= "#">Harvey Walls</a></li>' +
+                                                                               '</ul>';
+
+               // trigger pagecreate
+               $("#listdividers-unit-test-dynamic").page( );
+               /* Initialize */
+               $("#listdividers-unit-test-dynamic").find(":jqmData(role=contents)").append( listHTMML ) ;
+
+               $('#listdividerssample1').listview( {create : function ( ) {
+                       createEvent = true ;
+               }} );
+
+               $("#listdividers-unit-test-dynamic").find(":jqmData(role=contents)").trigger('create') ;
+               $('#listdividerssample1').listview( ) ;
+
+               equal( createEvent, true, "Create Event") ;
+               unit_listdividers_test( $('#listdividerssample1') ) ;
+
+       } );
+
+} );
diff --git a/tests/additional-unit-tests/loader/index.html b/tests/additional-unit-tests/loader/index.html
new file mode 100755 (executable)
index 0000000..b3d5825
--- /dev/null
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+       <meta charset="utf-8">
+       <meta name="viewport" content="width=device-width, initial-scale=1">
+       <title>loader test</title>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/jquery.js"></script>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.js"></script>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw.js"
+               data-framework-theme="tizen-white"></script>
+       <script src="../../../libs/js/jquery-mobile-1.1.0/tests/unit/jquery.setNameSpace.js"></script>
+       <script src="../../../libs/js/jquery-mobile-1.1.0/tests/jquery.testHelper.js"></script>
+       <script src="../../../libs/js/jquery-mobile-1.1.0/external/qunit.js"></script>
+
+       <link rel="stylesheet" href="../../../libs/js/jquery-mobile-1.1.0/external/qunit.css"/>
+
+       <script src="loader-tests.js"></script>
+</head>
+<body>
+       <!-- QUnit template -->
+       <h1 id="qunit-header">Test : loader</h1>
+       <h2 id="qunit-banner"></h2>
+       <h2 id="qunit-userAgent"></h2>
+       <ol id="qunit-tests"></ol>
+
+       <div id="qunit-fixture">
+
+       </div>
+</body>
+</html>
diff --git a/tests/additional-unit-tests/loader/loader-tests.js b/tests/additional-unit-tests/loader/loader-tests.js
new file mode 100755 (executable)
index 0000000..41e272b
--- /dev/null
@@ -0,0 +1,56 @@
+/**
+ * Loader test
+ *
+ * Youmin Ha <youmin.ha@samsung.com>
+ *
+ */
+ /*jslint browser: true*/
+/*global $, jQuery, test, equal, ok*/
+( function ( $ ) {
+       $.mobile.defaultTransition = " none " ;
+
+       module( " Loader " );
+
+       var tizen = $.tizen.__tizen__;
+
+       test( " util.getScaleFactor( ) " , function ( ) {
+               var util = tizen.util, 
+                       expected = 1, 
+                       defaultWidth = 720;
+
+               if ( window.scale ) {
+                       expected = window.scale;
+               } else {
+                       expected = screen.width / defaultWidth;
+                       if ( expected > 1 ) {   // Don ' t allow expansion
+                               expected = 1;
+                       }
+               }
+
+               // Test value
+               equal( util.getScaleFactor( ), expected, " Scale factor value should calculated properly. " );
+       } );
+
+       test( " util.isMobileBrowser( ) " , function ( ) {
+               var appVersion = window.navigator.appVersion, 
+                       mobile = appVersion.match( " Mobile " ), 
+                       isMobile = mobile ? true : false;
+
+               equal( tizen.util.isMobileBrowser( ), isMobile, " Mobile browser must be detected. " );
+
+               /* NOTE:
+                * Is this test OK? How are both cases( mobile/non-mobile ) tested?
+                */
+       } );
+
+       test( " css.addElementToHead( ) " , function ( ) {
+               var css = tizen.css, 
+                       scarecrow = $( ' <meta name= " scarecrow " /> ' ), 
+                       selected;
+
+               css.addElementToHead( scarecrow );
+               selected = $( ' head ' ).children( ' meta[name=scarecrow] ' );
+               ok( selected.length > 0, ' Object must be added to header. ' );
+       } );
+} ) ( jQuery );
+
diff --git a/tests/additional-unit-tests/multimediaview/index.html b/tests/additional-unit-tests/multimediaview/index.html
new file mode 100755 (executable)
index 0000000..4daf4b2
--- /dev/null
@@ -0,0 +1,80 @@
+<!DOCTYPE html>
+<html>
+<head>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/jquery.js"></script>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.min.js"></script>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw.js"
+               data-framework-theme="tizen-white"
+               data-framework-viewport-scale=false>
+       </script>
+
+       <link rel="stylesheet" href="../../../libs/js/jquery-mobile-1.2.0/external/qunit.css" />
+
+       <script src="../../../libs/js/jquery-mobile-1.2.0/external/qunit.js"></script>
+       
+
+       <title>MultiMediaView</title>
+</head>
+
+<body>
+
+<h1 id="qunit-header">MultiMediaView</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+
+<div id="qunit-fixture">
+
+       <div data-role="page" id="multimediaview0">
+               <div data-role="header" data-position="fixed">
+                       <h1>MultiMediaView (video)</h1>
+               </div>
+               <div data-role="content">
+                       <video data-controls="true" style="width:100%;" id="video">
+                               <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>
+       
+       <div data-role="page" id="multimediaview01">
+               <div data-role="header" data-position="fixed">
+                       <h1>MultiMediaView (video)</h1>
+               </div>
+               <div data-role="content">
+                       
+               </div>
+       </div>
+
+       <div data-role="page" id="multimediaview1">
+               <div data-role="header" data-position="fixed">
+                       <h1>MultiMediaView (audio)</h1>
+               </div>
+               <div data-role="content">
+                       <audio data-controls="true" style="width:100%;" id="audio">
+                               <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>
+       <div data-role="page" id="multimediaview11">
+               <div data-role="header" data-position="fixed">
+                       <h1>MultiMediaView (audio)</h1>
+               </div>
+               <div data-role="content">
+                       <audio data-controls="true" style="width:100%;" id="audio">
+                               <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>
+
+</div>
+<script src="multimediaview-tests.js"></script>
+</body>
+</html>
diff --git a/tests/additional-unit-tests/multimediaview/multimediaview-tests.js b/tests/additional-unit-tests/multimediaview/multimediaview-tests.js
new file mode 100755 (executable)
index 0000000..9148c6e
--- /dev/null
@@ -0,0 +1,126 @@
+/*
+ * Unit Test: MultiMediaView
+ *
+ * Wonseop Kim <wonseop.kim@samsung.com>
+ */
+/*jslint browser: true*/
+/*global $, jQuery, test, equal, ok*/
+$( document ).ready( function ( ) {
+       module("MultiMediaView");
+
+       var unit_multimediaview = function ( widget, type ) {
+               var control,
+                       fullscreenButton,
+                       width,
+                       height,
+                       played,
+                       fullScreen,
+                       timeupdated,
+                       ended,
+                       param,
+                       volumebutton,
+                       seekerbar,
+                       playpause;
+
+               /* Create */
+               widget.multimediaview( );
+               ok( widget.hasClass("ui-multimediaview") , "Create");
+
+               playpause = widget.parent( ).find('.ui-playpausebutton') ;
+               ok( playpause.hasClass("ui-play-icon") , "Markup: Play button present");
+               if ( type == 'vedio') {
+                       fullScreen = widget.parent( ).find('.ui-fullscreenbutton') ;
+                       ok( fullScreen.hasClass("ui-fullscreen-on") , "Markup: fullscreen button present");
+               }
+               volumebutton = widget.parent( ).find('.ui-volumebutton') ;
+               ok( volumebutton.hasClass("ui-volume-icon") , "Markup: Volume button present");
+               seekerbar = widget.parent( ).find('.ui-seekbar') ;
+               equal( seekerbar.find(".ui-currenttime").css('width'), '0px', "Markup: initial current time");
+               ok( widget.parent( ).find(".ui-durationlabel"), "Markup : duration label");
+               ok( widget.parent( ).find(".ui-timestamplabel"), "Markup : current time label");
+               ok( widget.parent( ).find(".ui-volumecontrol"), "Markup : volume control");
+
+               /* width */
+               width = 100;
+               widget.multimediaview("width", width );
+               equal( width, widget.width( ), "API: width");
+
+               equal( width, widget.multimediaview("width") , "API: width multimediaview");
+
+               /* height */
+               height = 200;
+               widget.multimediaview("height", height );
+               equal( height, widget.height( ), "API: height");
+               equal( height, widget.multimediaview("height") , "API: height multimediaview");
+               if ( type === "video") {
+
+                       /* fullscreen */
+                       fullscreenButton = widget.parent( ).find(".ui-fullscreenbutton");
+                       equal( false, widget.multimediaview("fullScreen") , "API: fullScreen initially value - multimediaview");
+
+                       widget.multimediaview("fullScreen", true );
+                       ok( fullscreenButton.hasClass("ui-fullscreen-off"), "API: fullScreen ( on ) - markup");
+                       equal( true, widget.multimediaview("fullScreen") , "API: fullScreen set to true - multimediaview");
+                       equal( $("body")[0].clientHeight - 1 , widget.height( ), "API: height after full screen on");
+                       equal( $("body")[0].clientWidth , widget.width( ), "API: width after full screen on");
+
+                       widget.multimediaview("fullScreen", false );
+                       ok( fullscreenButton.hasClass("ui-fullscreen-on"), "API: fullScreen ( off ) - markup");
+                       equal( false, widget.multimediaview("fullScreen") , "API: fullScreen set to true - multimediaview");
+                       equal( widget.height( ) , height, "API: height after full screen off");
+                       equal( widget.width( ) , width, "API: width after full screen off");
+
+               }
+       };
+
+       test("video", function ( ) {
+               $('#multimediaview0').page( );
+               unit_multimediaview( $("#video"), "video");
+       } );
+
+       test("audio", function ( ) {
+               $('#multimediaview1').page( );
+               unit_multimediaview( $("#audio"), "audio");
+       } );
+
+       test("audio dymanic", function ( ) {
+
+               var createEvent = false,
+                       audioHTML = '<audio data-controls= "false"style= "width:100%;"id= "audioControl2"data-fullscreen= "false"class= "multimediaobjetc">' +
+                                                                               '<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>';
+               $('#multimediaview11').page( );
+               $('#multimediaview11').find(":jqmData(role=content)").append( audioHTML );
+
+               $("#audioControl").bind("create", function ( ) {
+                       createEvent = true ;
+               } );
+
+               $('#audioControl2').trigger("create") ;
+               equal( createEvent, true, "Audio Create Event") ;
+               unit_multimediaview( $("#audioControl2"), "audio");
+       } );
+
+       test("video dymanic", function ( ) {
+
+               var createEvent = false,
+                       videoHTML = '<video data-controls= "true"style= "width:100%;"id= "vedioControl1"data-fullscreen= "false"class= "multimediaobjetc">' +
+                                                                       '<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>';
+               $('#multimediaview01').page( );
+               $('#multimediaview01').find(":jqmData(role=content)").append( videoHTML ) ;
+
+               $("#vedioControl1").bind("create", function ( ) {
+                       createEvent = true ;
+               } );
+               $('#vedioControl1').trigger("create") ;
+               equal( createEvent, true, "Vedio Create Event") ;
+               unit_multimediaview( $("#vedioControl1"), "video");
+       } );
+
+} );
diff --git a/tests/additional-unit-tests/navigationbar/01_icon.png b/tests/additional-unit-tests/navigationbar/01_icon.png
new file mode 100755 (executable)
index 0000000..768d8db
Binary files /dev/null and b/tests/additional-unit-tests/navigationbar/01_icon.png differ
diff --git a/tests/additional-unit-tests/navigationbar/02_icon.png b/tests/additional-unit-tests/navigationbar/02_icon.png
new file mode 100755 (executable)
index 0000000..bc2e48b
Binary files /dev/null and b/tests/additional-unit-tests/navigationbar/02_icon.png differ
diff --git a/tests/additional-unit-tests/navigationbar/03_icon.png b/tests/additional-unit-tests/navigationbar/03_icon.png
new file mode 100755 (executable)
index 0000000..20eae31
Binary files /dev/null and b/tests/additional-unit-tests/navigationbar/03_icon.png differ
diff --git a/tests/additional-unit-tests/navigationbar/index.html b/tests/additional-unit-tests/navigationbar/index.html
new file mode 100755 (executable)
index 0000000..0195fa4
--- /dev/null
@@ -0,0 +1,286 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/jquery.js"></script>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.min.js"></script>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw.js"
+               data-framework-theme="tizen-white"
+               data-framework-viewport-scale=false>
+       </script>
+       <link rel="stylesheet" href="../../../libs/js/jquery-mobile-1.2.0/external/qunit.css" />
+
+       <script src="../../../libs/js/jquery-mobile-1.2.0/external/qunit.js"></script>
+
+       <script src="navigationbar-tests.js"></script>
+</head>
+<body>
+
+<h1 id="qunit-header">Navigationbar</h1>
+<h2 id="qunit-banner"></h2>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests">
+</ol>
+
+
+<div data-nstest-role="page">
+       <div data-nstest-role="header" id="normalnavigation1">
+               <h1>Navigationbar Test - markup</h1>
+       </div>
+       <div data-nstest-role="content">
+       </div>
+       <div data-nstest-role="footer">
+       </div>
+</div>
+
+<div data-nstest-role="page">
+       <div data-nstest-role="header" >
+               
+       </div>
+       <div data-nstest-role="content">
+       </div>
+       <div data-nstest-role="footer" id="normalnavigation12">
+               <h1>Navigationbar Test - markup</h1>
+       </div>
+</div>
+
+<div data-nstest-role="page">
+       <div data-nstest-role="header" id="normalnavigation11">
+               
+       </div>
+       <div data-nstest-role="content">
+       </div>
+       <div data-nstest-role="footer">
+       </div>
+</div>
+
+<div data-nstest-role="page">
+       <div data-nstest-role="header">
+               
+       </div>
+       <div data-nstest-role="content">
+       </div>
+       <div data-nstest-role="footer"  id="normalnavigation111">
+       </div>
+</div>
+
+
+<div data-nstest-role="page">
+       <div data-nstest-role="header" id="normalnavigation2">
+               <h1>Navigationbar Test - markup</h1>
+               <a>Button</a>
+       </div>
+       <div data-nstest-role="content">
+       </div>
+       <div data-nstest-role="footer">
+       </div>
+</div>
+
+<div data-nstest-role="page">
+       <div data-nstest-role="header">
+               
+       </div>
+       <div data-nstest-role="content">
+       </div>
+       <div data-nstest-role="footer"  id="normalnavigation22">
+               <h1>Navigationbar Test - markup</h1>
+               <a>Button</a>
+       </div>
+</div>
+
+<div data-nstest-role="page">
+       <div data-nstest-role="header" id="normalnavigation3">
+               <a>Button</a>
+               <h1>Navigationbar Test - markup</h1>
+               <a>Button</a>
+       </div>
+<div data-nstest-role="content">
+       </div>
+       <div data-nstest-role="footer">
+       </div>
+</div>
+
+<div data-nstest-role="page">
+       <div data-nstest-role="header">
+               
+       </div>
+<div data-nstest-role="content">
+       </div>
+       <div data-nstest-role="footer"  id="normalnavigation32">
+               <a>Button</a>
+               <h1>Navigationbar Test - markup</h1>
+               <a>Button</a>
+       </div>
+</div>
+
+
+<div data-nstest-role="page">
+       <div data-nstest-role="header" id="normalnavigation4">
+               <a>Button</a>
+               <h1>Navigationbar Test - markup</h1>
+               <a>Button2</a>
+               <a>Button3</a>
+       </div>
+       <div data-nstest-role="content">
+       </div>
+       <div data-nstest-role="footer">
+       </div>
+</div>
+
+<div data-nstest-role="page">
+       <div data-nstest-role="header" >
+               
+       </div>
+       <div data-nstest-role="content">
+       </div>
+       <div data-nstest-role="footer" id="normalnavigation42">
+               <a>Button</a>
+               <h1>Navigationbar Test - markup</h1>
+               <a>Button2</a>
+               <a>Button3</a>
+       </div>
+</div>
+
+<div data-nstest-role="page">
+       <div data-nstest-role="header" data-position="fixed" id="extendedstyle2btn">
+               <h1>Extended Title 2 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="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>
+       <div data-nstest-role="content">
+       </div>
+</div>
+
+<div data-nstest-role="page">
+       <div data-nstest-role="header" data-position="fixed" >
+               
+       </div>
+       <div data-nstest-role="content">
+       </div>
+       <div data-nstest-role="footer" id="extendedstyle22btn">
+               <h1>Extended Title 2 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="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>
+</div>
+
+
+<div data-nstest-role="page">
+       <div data-nstest-role="header" data-position="fixed" id="extendedstyle3btn">
+               <h1>Extended Title 3 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="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>
+                               <input type="radio" name="radio-view-8" data-icon="segment-titlestyle-segonly" id="segment3" value="off" />
+                               <label for="segment3">Save</label>
+                       </fieldset>
+               </div>
+       </div>
+       <div data-nstest-role="content">
+       </div>
+</div>
+
+<div data-nstest-role="page">
+       <div data-nstest-role="header" data-position="fixed" >
+               
+       </div>
+       <div data-nstest-role="content">
+       </div>
+       <div data-nstest-role="footer" id="extendedstyle32btn">
+               <h1>Extended Title 3 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="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>
+                               <input type="radio" name="radio-view-8" data-icon="segment-titlestyle-segonly" id="segment3" value="off" />
+                               <label for="segment3">Save</label>
+                       </fieldset>
+               </div>
+       </div>
+</div>
+
+<div data-nstest-role="page">
+       <div data-nstest-role="header" data-position="fixed" id="extendedstyle4btn">
+               <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="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>
+                               <input type="radio" name="radio-view-8" data-icon="segment-titlestyle-segonly" id="segment3" value="off" />
+                               <label for="segment3">Save</label>
+                               <input type="radio" name="radio-view-8" data-icon="segment-titlestyle-segonly" id="segment4" value="off" />
+                               <label for="segment4">Back</label>
+                       </fieldset>
+               </div>
+       </div>
+       <div data-nstest-role="content">
+       </div>
+</div>
+
+<div data-nstest-role="page">
+       <div data-position="fixed" >
+               
+       </div>
+       <div data-nstest-role="content">
+       </div>
+       <div data-nstest-role="footer" id="extendedstyle42btn">
+               <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="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>
+                               <input type="radio" name="radio-view-8" data-icon="segment-titlestyle-segonly" id="segment3" value="off" />
+                               <label for="segment3">Save</label>
+                               <input type="radio" name="radio-view-8" data-icon="segment-titlestyle-segonly" id="segment4" value="off" />
+                               <label for="segment4">Back</label>
+                       </fieldset>
+               </div>
+       </div>
+</div>
+
+
+<div data-nstest-role="page">
+       <div data-position="fixed" >
+               <h1>Extended Title 4 Button </h1>
+               
+       </div>
+       <div data-nstest-role="content">
+       </div>
+       <div data-nstest-role="footer" id="extendedstyle52btn">
+               
+       </div>
+</div>
+
+<div data-nstest-role="page">
+       <div data-nstest-role="header" data-position="fixed" id="extendedstyle5btn">
+               
+       </div>
+       <div data-nstest-role="content">
+       </div>
+</div>
+
+
+</body>
+</html>
+
+
diff --git a/tests/additional-unit-tests/navigationbar/navigationbar-tests.js b/tests/additional-unit-tests/navigationbar/navigationbar-tests.js
new file mode 100755 (executable)
index 0000000..7ed252a
--- /dev/null
@@ -0,0 +1,136 @@
+/*
+ * navigationbar unit tests
+*/
+/*jslint browser: true*/
+/*global $, jQuery, test, equal, ok*/
+( function ( $ ) {
+       module("Navigationbar");
+
+       var unit_navigationbar = function ( widget, anchorCount, position, extendedValue ) {
+               /* Create */
+               var created_navigationbar = $( widget );
+               ok( created_navigationbar, "Create");
+
+               /* Check Parameters */
+               equal( created_navigationbar.jqmData("nstest-role"), position, "Basic test");
+
+               if ( extendedValue ) {
+                       equal( created_navigationbar.find("input").length, anchorCount, "Groupcontrol button test");
+               } else {
+                       equal( created_navigationbar.children("a").length, anchorCount, "button test");
+               }
+       };
+
+       test("navigationbar no button test -header", function ( ) {
+               unit_navigationbar( $("#normalnavigation1"), 0, 'header');
+       } );
+
+       test("navigationbar one button test -header", function ( ) {
+               unit_navigationbar( $("#normalnavigation2"), 1, 'header');
+       } );
+
+       test("navigationbar two button test -header", function ( ) {
+               unit_navigationbar( $("#normalnavigation3"), 2 , 'header');
+       } );
+
+       test("navigationbar three button test -header", function ( ) {
+               unit_navigationbar( $("#normalnavigation4"), 3 , 'header');
+       } );
+
+       test("navigationbar extended two button test -header", function ( ) {
+               unit_navigationbar( $("#extendedstyle2btn"), 2, 'header', true );
+       } );
+
+       test("navigationbar extended three button test - header", function ( ) {
+               unit_navigationbar( $("#extendedstyle3btn"), 3, 'header', true );
+       } );
+
+       test("navigationbar extended four button test -header", function ( ) {
+               unit_navigationbar( $("#extendedstyle4btn"), 4, 'header', true );
+       } );
+
+       test("navigationbar no button test -header - Dynamic", function ( ) {
+
+               var markup = '<h1>Navigationbar Test - markup</h1>';
+               $('#normalnavigation11').append( markup ).trigger('create');
+
+               unit_navigationbar( $("#normalnavigation11"), 0, 'header');
+       } );
+
+       test("navigationbar extended four button test -header- Dymanic", function ( ) {
+
+               var markup = '<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>' +
+                                                                       '<input type= "radio"name= "radio-view-8"data-icon= "segment-titlestyle-segonly"id= "segment3"value= "off"/>' +
+                                                                       '<label for= "segment3">Save</label>' +
+                                                                       '<input type= "radio"name= "radio-view-8"data-icon= "segment-titlestyle-segonly"id= "segment4"value= "off"/>' +
+                                                                       '<label for= "segment4">Back</label>' +
+                                                               '</fieldset>' +
+                                                       '</div>';
+
+               $('#extendedstyle5btn').append( markup ).trigger('create');
+               $('#extendedstyle5btn').find(":jqmData(role=fieldcontain)").trigger('create');
+               unit_navigationbar( $("#extendedstyle5btn"), 4, 'header', true );
+       } );
+
+
+       test("navigationbar no button test -footer", function ( ) {
+               unit_navigationbar( $("#normalnavigation12"), 0 , 'footer');
+       } );
+
+       test("navigationbar one button test -footer", function ( ) {
+               unit_navigationbar( $("#normalnavigation22"), 1 , 'footer');
+       } );
+
+       test("navigationbar two button test -footer", function ( ) {
+               unit_navigationbar( $("#normalnavigation32"), 2 , 'footer');
+       } );
+
+       test("navigationbar three button test -footer", function ( ) {
+               unit_navigationbar( $("#normalnavigation42"), 3 , 'footer');
+       } );
+
+       test("navigationbar extended two button test -footer", function ( ) {
+               unit_navigationbar( $("#extendedstyle22btn"), 2 , 'footer', true );
+       } );
+
+       test("navigationbar extended three button test -footer", function ( ) {
+               unit_navigationbar( $("#extendedstyle32btn"), 3 , 'footer', true );
+       } );
+
+       test("navigationbar extended four button test -footer", function ( ) {
+               unit_navigationbar( $("#extendedstyle42btn"), 4 , 'footer', true );
+       } );
+
+       test("navigationbar no button test -footer - Dynamic", function ( ) {
+
+               var markup = '<h1>Navigationbar Test - markup</h1>';
+               $('#normalnavigation111').append( markup ).trigger('create');
+
+               unit_navigationbar( $("#normalnavigation111"), 0 , 'footer');
+       } );
+
+       test("navigationbar extended four button test -footer- Dymanic", function ( ) {
+
+               var markup = '<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>' +
+                                                                       '<input type= "radio"name= "radio-view-8"data-icon= "segment-titlestyle-segonly"id= "segment3"value= "off"/>' +
+                                                                       '<label for= "segment3">Save</label>' +
+                                                                       '<input type= "radio"name= "radio-view-8"data-icon= "segment-titlestyle-segonly"id= "segment4"value= "off"/>' +
+                                                                       '<label for= "segment4">Back</label>' +
+                                                               '</fieldset>' +
+                                                       '</div>';
+
+               $('#extendedstyle52btn').append( markup ).trigger('create');
+               $('#extendedstyle52btn').find(":jqmData(role=fieldcontain)").trigger('create');
+               unit_navigationbar( $("#extendedstyle52btn"), 4 , 'footer', true );
+       } );
+} ( jQuery ));
diff --git a/tests/additional-unit-tests/notification/index.html b/tests/additional-unit-tests/notification/index.html
new file mode 100755 (executable)
index 0000000..73c359e
--- /dev/null
@@ -0,0 +1,70 @@
+<!DOCTYPE html>
+<html>
+<head>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/jquery.js"></script>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.min.js"></script>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw.js"
+               data-framework-theme="tizen-white"
+               data-framework-viewport-scale=false>
+       </script>
+
+       <link rel="stylesheet" href="../../../libs/js/jquery-mobile-1.2.0/external/qunit.css" />
+
+       <script src="../../../libs/js/jquery-mobile-1.2.0/external/qunit.js"></script>
+       <script src="notification-tests.js"></script>
+
+       <title>Notification</title>
+</head>
+
+<body>
+
+<h1 id="qunit-header">Notification</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+
+<div id="qunit-fixture">
+
+       <div data-role="page" id="notifiaction0">
+               <div data-role="notification" id="smallpopup" data-type="popup" data-interval='1000'>
+                       <p>text1</p>
+               </div>
+               <div data-role="notification" id="smallpopup2" data-type="popup" data-interval='1000'>
+                       <p>text1</p>
+                       <p>text2</p>
+               </div>
+               <div data-role="notification" id="smallpopup3" data-type="popup" data-interval='1000'>                  
+               </div>
+               <div data-role="header" data-position="fixed">
+                       <h1>Notification</h1>
+               </div>
+               <div data-role="content">
+               </div>
+       </div>
+
+       <div data-role="page" id="notification1">
+               <div data-role="notification" id="tickernoti" data-type="ticker"  data-icon="02_icon.png" data-interval='5'>
+                       <p>text1</p>
+                       <p>text2</p>
+               </div>
+               <div data-role="notification" id="tickernoti2" data-type="ticker"  data-icon="02_icon.png" data-interval='5'>
+                       <p>text1</p>
+                       <p>text2</p>
+                       <p>text3</p>
+                       <p>text4</p>
+               </div>
+               <div data-role="notification" id="tickernoti3" data-type="ticker"  data-icon="02_icon.png" data-interval='5'>                   
+               </div>
+               <div data-role="header" data-position="fixed">
+                       <h1>Notification</h1>
+               </div>
+               <div data-role="content">
+               </div>
+       </div>
+       
+
+</div>
+
+</body>
+</html>
diff --git a/tests/additional-unit-tests/notification/notification-tests.js b/tests/additional-unit-tests/notification/notification-tests.js
new file mode 100755 (executable)
index 0000000..434ee6a
--- /dev/null
@@ -0,0 +1,107 @@
+/*
+ * Unit Test : Notification
+ *
+ * Minkyu Kang <mk7.kang@samsung.com>
+ */
+/*jslint browser: true*/
+/*global $, jQuery, test, equal, ok*/
+(function ($) {
+       module("Notification");
+
+       var unit_notification = function ( widget, type ) {
+               var notification,
+                       elem = ".ui-" + type,
+                       text,
+                       closebutton;
+
+               /* Create */
+               widget.notification();
+
+               notification = widget.children( elem );
+               ok( notification, "Create");
+
+               /*markup check*/
+               if (type == ' ticker') {
+                       ok(notification.find('.ui-ticker-btn'), "makrup Check : Close button") ;
+                       ok(notification.find('.ui-ticker-btn').find(":jqmData(role=button)"), "makrup Check : Close button present") ;
+                       equal(notification.find('.ui-ticker-btn').find(":jqmData(role=button)").text(), 'Close', "makrup Check : Close button text") ;
+                       ok(notification.find('.ui-ticker').find(".ui.ticker-text1-bg"), "makrup Check : ticker text present") ;
+                       ok(notification.find('.ui-ticker').find(".ui.ticker-text2-bg"), "makrup Check : ticker text present") ;
+                       ok(notification.find('.ui-ticker').find("img.ui-ticker-icon").length > 0, "makrup Check : ticker icon present") ;
+               } else {
+                       ok(notification.find('.ui-smallpopup'), "makrup Check : smapll popup") ;
+                       ok(notification.find('.ui-smallpopup').find(".ui.smallpopup-text-bg"), "makrup Check : popup text present") ;
+               }
+
+               /* Open */
+               widget.notification("open");
+               notification = widget.children( elem );
+               ok( notification.hasClass("show"), "API : open");
+
+               /* Close */
+               widget.notification("close");
+               notification = widget.children( elem );
+               ok( notification.hasClass("hide"), "API : close");
+
+               /* hide when click */
+               widget.notification("open");
+               notification = widget.children( elem );
+
+               /*for coverage open notification when it is already open*/
+               widget.notification("open");
+               notification.trigger("vmouseup");
+               notification = widget.children( elem );
+               ok( notification.hasClass("hide"), "Hide when click the notification");
+
+               if ( type == ' ticker') {
+                       widget.notification("open");
+                       closebutton = widget.find(':jqmData(role=button)');
+                       closebutton.trigger("vmouseup");
+                       notification = widget.children( elem );
+                       ok( notification.hasClass("hide"), "Hide when click on the close button");
+               }
+
+               text = notification.children("p");
+               if ( type === "smallpopup") {
+                       ok( $( text[0] ).hasClass("ui-smallpopup-text-bg"), "Text");
+                       widget.notification('text', 'Text21');
+                       ok( $( text[0] ).hasClass("ui-smallpopup-text-bg"), "Text21");
+                       equal( widget.notification('text')[0], "Text21", "API : text - smallpopup");
+                       equal( text[0].innerHTML, "Text21", "API : text - smallpopup");
+               } else {
+                       ok( $( text[0] ).hasClass("ui-ticker-text1-bg"), "Top Text");
+                       ok( $( text[1] ).hasClass("ui-ticker-text2-bg"), "Bottom Text");
+
+                       widget.notification('text', 'Text31', 'Text32');
+                       ok( $( text[0] ).hasClass("ui-ticker-text1-bg"), "Text31", "API : text- ticker");
+                       ok( $( text[1] ).hasClass("ui-ticker-text2-bg"), "Text32", "API : text- ticker");
+                       equal( text[0].innerHTML, "Text31", "API : text - ticker");
+                       equal( text[1].innerHTML, "Text32", "API : text - ticker");
+                       equal( widget.notification('text')[0], "Text31", "API : text - ticker");
+                       equal( widget.notification('text')[1], "Text32", "API : text - ticker");
+
+                       /*icon*/
+                       equal(widget.jqmData('icon'), '02_icon.png', "API : icon , initial check") ;
+                       widget.notification('icon', '03_icon.png');
+                       equal(widget.find('img').attr("src"), '03_icon.png', "API : icon , new icon is set") ;
+               }
+               /*destroy*/
+               widget.notification("destroy");
+               notification = widget.children( elem );
+               ok( !notification.hasClass("show") || !notification.hasClass("hide"), "destroy check");
+       };
+
+       test("smallpopup", function () {
+               $('#notifiaction0').page();
+               unit_notification( $("#smallpopup"), "smallpopup");
+               unit_notification( $("#smallpopup2"), "smallpopup");
+               unit_notification( $("#smallpopup3"), "smallpopup");
+       });
+
+       test("tickernoti", function () {
+               $('#notifiaction1').page();
+               unit_notification( $("#tickernoti"), "ticker");
+               unit_notification( $("#tickernoti2"), "ticker");
+               unit_notification( $("#tickernoti3"), "ticker");
+       });
+}( jQuery ));
diff --git a/tests/additional-unit-tests/popup/index.html b/tests/additional-unit-tests/popup/index.html
new file mode 100755 (executable)
index 0000000..5c0ed07
--- /dev/null
@@ -0,0 +1,253 @@
+<!DOCTYPE html>
+<html>
+<head>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/jquery.js"></script>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.js"></script>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw.js"
+               data-framework-theme="tizen-white"
+               data-framework-viewport-scale=false>
+       </script>
+
+       <link rel="stylesheet" href="../../../libs/js/jquery-mobile-1.2.0/external/qunit.css" />
+
+       <script src="../../../libs/js/jquery-mobile-1.2.0/external/qunit.js"></script>
+       <script src="popup-tests.js"></script>
+
+       <title>Popup Window</title>
+</head>
+
+<body>
+
+<h1 id="qunit-header">Popup Window</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+
+<div id="qunit-fixture">
+
+       <div data-role="page" id="popupwindow">
+               <div data-role="header" data-position="fixed">
+                       <h1>Popup Window</h1>
+               </div>
+               <div data-role="content">
+               
+                   <div data-role="button" id="popupbutton">Text Button</div>
+                       
+                       <div id="center_info" data-role="popup"  data-position-to='window' class="center_info" data-style='center_info' >
+                               <p class="ui-popup-title">title</p>
+                               <p  class="ui-popup-text">text</p>
+                       </div>
+
+                       <div id="center_title" data-role="popup"  data-position-to='window' class="center_title">
+                               <p class="ui-popup-title">title</p>
+                               <p class="ui-popup-text">text</p>
+                       </div>
+
+                       <div id="center_basic_1btn" data-role="popup"  data-position-to='window' class ="center_basic_1btn">
+                       <p class="ui-popup-title">title</p>
+                               <p  class="ui-popup-text">text</p>
+                               <div class="ui-popup-button-bg">
+                                       <input data-role="button" value="button" />
+                               </div>
+                       </div>
+
+                       <div id="center_title_1btn" data-role="popup"  data-position-to='window' class="center_title_1btn">
+                               <p class="ui-popup-title">title</p>
+                               <p  class="ui-popup-text">text</p>
+                               <div class="ui-popup-button-bg">
+                                       <input data-role="button" value="button" />
+                               </div>
+                       </div>
+                       
+                       
+                       <!-- Social Magazine font popup -->
+               <div id="center_social_style1" data-role="popup"  data-position-to='window' class="center_liststyle_2btn">
+                       <p class="ui-popup-title">title</p>
+                               <p  class="ui-popup-text">text</p>
+                                       <div class="ui-popup-scroller-bg" data-scroll="y"  style="height:auto">
+                                               <ul data-role="listview">
+                                                       <li class="ui-li-has-radio" id="text_fontSmall">
+                                                               <a href="#">
+                                                               <input type="radio" name="radio-choice-1" id="fontSmall" value="choice-1"/>
+                                                               text_Small</a>
+                                                       </li>
+                                                       <li class="ui-li-has-radio" id="text_fontMedium">
+                                                               <a href="#">
+                                                               <input type="radio" name="radio-choice-1" id="fontMedium" value="choice-2"/>
+                                                               text_Medium</a>
+                                                       </li>
+                                                       <li class="ui-li-has-radio" id="text_fontLarge">
+                                                               <a href="#">
+                                                               <input type="radio" name="radio-choice-1" id="fontLarge" value="choice-3"/>
+                                                               text_Large</a>
+                                                       </li>
+                                               </ul>
+                                       </div>
+                                       <div class="ui-popup-button-bg">
+                                               <div data-role="button"  data-inline="true">OK</div>
+                                               <div data-role="button"  data-inline="true">Cancel</div>
+                                       </div>
+               </div>
+
+               <!-- Social Magazine ime popup -->
+               <div id="center_social_style2" data-role="popup"  data-position-to='window' class="center_title_2btn">
+                       <p class="ui-popup-title">title</p>
+                               <p  class="ui-popup-text">text</p>
+                       <div class="ui-popup-text">
+                                               <input type="text" id="newCategoryPopupInput" name="newCategoryName" size="30" />
+                       </div>
+                                       <div class="ui-popup-button-bg">
+                                               <div data-role="button"  data-inline="true">OK</div>
+                                               <div data-role="button"  data-inline="true">Cancel</div>
+                                       </div>
+               </div>
+
+               
+
+
+
+               <!-- Center basic 2 button popup -->
+               <div id="center_basic_2btn" data-role="popup"  data-position-to='window' class="center_basic_2btn">
+                       <p class="ui-popup-title">title</p>
+                               <p  class="ui-popup-text">text</p>
+                       <div class="ui-popup-button-bg">
+                               <div data-role="button"  data-inline="true">Button1</div>
+                               <div data-role="button"  data-inline="true">Button2</div>
+                       </div>
+               </div>
+
+               <!-- Center basic 3 button popup -->
+               <div id="center_basic_3btn" data-role="popup"  data-position-to='window' class="center_basic_3btn">
+                       <p class="ui-popup-title">title</p>
+                               <p  class="ui-popup-text">text</p>
+                       <div class="ui-popup-button-bg">
+                                       <div data-role="button"  data-inline="true">Button1</div>
+                                       <div data-role="button"  data-inline="true">Button2</div>
+                                       <div data-role="button"  data-inline="true">Button3</div>
+                       </div>
+               </div>
+
+
+               <!-- Center title 2 button popup -->
+               <div id="center_title_2btn" data-role="popup"  data-position-to='window' class="center_title_2btn">
+                       <div class="ui-popup-title">title</div>
+                       <div class="ui-popup-text">text</div>
+                       <div class="ui-popup-button-bg">
+                               <div data-role="button"  data-inline="true">Button1</div>
+                               <div data-role="button"  data-inline="true">Button2</div>
+                       </div>
+               </div>
+
+               <!-- Center title 3 button popup -->
+               <div id="center_title_3btn" data-role="popup"  data-position-to='window' class="center_title_3btn">
+                       <div class="ui-popup-title">title</div>
+                       <div class="ui-popup-text">text</div>
+                       <div class="ui-popup-button-bg">
+                               <div data-role="button"  data-inline="true">Button1</div>
+                               <div data-role="button"  data-inline="true">Button2</div>
+                               <div data-role="button"  data-inline="true">Button3</div>
+                       </div>
+               </div>
+
+               <!-- Center button vertical -->
+               <div id="center_button_vertical" data-role="popup"  data-position-to='window' class="center_button_vertical">
+                       <p class="ui-popup-title">title</p>
+                               <p  class="ui-popup-text">text</p>
+                       <div class="ui-popup-button-bg">
+                               <div data-role="button"  data-inline="true">Rename</div>
+                               <div data-role="button"  data-inline="true">Replace</div>
+                               <div data-role="button"  data-inline="true">Cancel</div>
+                       </div>
+               </div>
+
+               <!-- popup checkbox  -->
+               <div id="center_checkbox" data-role="popup"  data-position-to='window' class="center_checkbox">
+                       <p class="ui-popup-title">title</p>
+                               <p  class="ui-popup-text">text</p>
+                       <div class="ui-popup-check-bg">
+                               <input type="checkbox" name="checkbox-1" id="checkbox-1" class="custom" />
+                               <label for="checkbox-1">Don't ask again</label>
+                       </div>
+                       <div class="ui-popup-button-bg">
+                               <div data-role="button"  data-inline="true">Rename</div>
+                               <div data-role="button"  data-inline="true">Replace</div>
+                       </div>
+               </div>
+
+               <!-- popup liststyle 1 button -->
+               <div id="center_liststyle_1btn" data-role="popup"  data-position-to='window' class="center_liststyle_1btn">
+                       <p class="ui-popup-title">title</p>
+                               <p  class="ui-popup-text">text</p>
+                       <div class="ui-popup-scroller-bg" data-scroll="y">
+                               <ul data-role="listview" data-icon="1line-textonly">
+                                       <li><a href="#">List item 1</a></li>
+                                       <li><a href="#">List item 2</a></li>
+                                       <li><a href="#">List item 3</a></li>
+                                       <li><a href="#">List item 4</a></li>
+                                       <li><a href="#">List item 5</a></li>
+                                       <li><a href="#">List item 6</a></li>
+                                       <li><a href="#">List item 7</a></li>
+                                       <li><a href="#">List item 8</a></li>
+                                       <li><a href="#">List item 9</a></li>
+                               </ul>
+                       </div>
+                       <div class="ui-popup-button-bg">
+                               <div data-role="button"  data-inline="true">Cancel</div>
+                       </div>
+               </div>
+
+               <!-- popup liststyle 2 button -->
+               <div id="center_liststyle_2btn" data-role="popup"  data-position-to='window' class="center_liststyle_2btn">
+                       <p class="ui-popup-title">title</p>
+                               <p  class="ui-popup-text">text</p>
+                       <div class="ui-popup-scroller-bg" data-scroll="y">
+                               <ul data-role="listview" data-icon="1line-textonly">
+                                       <li><a href="#">List item 1</a></li>
+                                       <li><a href="#">List item 2</a></li>
+                                       <li><a href="#">List item 3</a></li>
+                                       <li><a href="#">List item 4</a></li>
+                                       <li><a href="#">List item 5</a></li>
+                                       <li><a href="#">List item 6</a></li>
+                                       <li><a href="#">List item 7</a></li>
+                                       <li><a href="#">List item 8</a></li>
+                                       <li><a href="#">List item 9</a></li>
+                               </ul>
+                       </div>
+                       <div class="ui-popup-button-bg">
+                               <div data-role="button"  data-inline="true">Ok</div>
+                               <div data-role="button"  data-inline="true">Cancel</div>
+                       </div>
+               </div>
+
+               <!-- popup liststyle 3 button -->
+               <div id="center_liststyle_3btn" data-role="popup"  data-position-to='window' class="center_liststyle_3btn">
+               <p class="ui-popup-title">title</p>
+                               <p  class="ui-popup-text">text</p>
+                       <div class="ui-popup-scroller-bg" data-scroll="y">
+                               <ul data-role="listview" data-icon="1line-textonly">
+                                       <li><a href="#">List item 1</a></li>
+                                       <li><a href="#">List item 2</a></li>
+                                       <li><a href="#">List item 3</a></li>
+                                       <li><a href="#">List item 4</a></li>
+                                       <li><a href="#">List item 5</a></li>
+                                       <li><a href="#">List item 6</a></li>
+                                       <li><a href="#">List item 7</a></li>
+                                       <li><a href="#">List item 8</a></li>
+                                       <li><a href="#">List item 9</a></li>
+                               </ul>
+                       </div>
+                       <div class="ui-popup-button-bg">
+                               <div data-role="button"  data-inline="true">Rename</div>
+                               <div data-role="button"  data-inline="true">Replace</div>
+                               <div data-role="button"  data-inline="true">Cancel</div>
+                       </div>
+               </div>
+
+               </div>
+       </div>
+
+</div>
+
+</body>
+</html>
diff --git a/tests/additional-unit-tests/popup/popup-tests.js b/tests/additional-unit-tests/popup/popup-tests.js
new file mode 100755 (executable)
index 0000000..3a3f2db
--- /dev/null
@@ -0,0 +1,112 @@
+/*
+ * Unit Test : Popup window
+ *
+ * Minkyu Kang <mk7.kang@samsung.com>
+ */
+/*jslint browser: true*/
+/*global $, jQuery, test, equal, ok*/
+$( document ).bind( "pageshow", function ( ) {
+
+       module("Popup Window" );
+       var unit_popup = function ( widget, type, buttoncount ) {
+
+               var popupbeforepositionEvent = 0,
+                       popupafteropenEvent = 0,
+                       popupaftercloseEvent = 0,
+                       buttonList,
+                       popupwindow = function ( widget ) {
+                               return widget.parent('.ui-popup-container') ;
+                       },
+                       check_text = function ( widget, selector, type ) {
+                               if ( !widget.find( selector ).length ) {
+                                       return;
+                               }
+                               equal( widget.find( selector ).text( ), type, type );
+                       };
+
+               $('#popupbutton').unbind('vclick') ;
+               $('#popupbutton').bind('vclick', function ( ) {
+                       widget.popup("open", {positionTo : 'window', transition : 'none', x : '0', y : '0', link : widget } );
+               } ) ;
+
+               /* Create */
+               widget.popup( );
+               ok( popupwindow( widget ), "Create" );
+
+               /* Open */
+               $('#popupbutton').trigger('vclick') ;
+               ok( parseInt( popupwindow( widget ).css("top" ), 10 ) > 0, "API : open" );
+
+               /* Close */
+               widget.popup("close" );
+               ok( popupwindow( widget ).hasClass("ui-selectmenu-hidden" ) ||
+                               popupwindow( widget ).hasClass("reverse out" ),
+                               "API : close" );
+
+               /* Close the popup by click the screen */
+               $('#popupbutton').trigger('vlick') ;
+               $(".ui-selectmenu-screen" ).trigger("vclick" );
+               ok( popupwindow( widget ).hasClass("ui-selectmenu-hidden" ) || popupwindow( widget ).hasClass("reverse out" ), "Close the popup by click the screen" );
+
+               /* Check Texts */
+               if ( widget.find(".ui-popup-text" ) != undefined ) {
+                       equal( widget.find(".ui-popup-text" ).html( ), "text" );
+               }
+               if ( widget.find(".ui-popup-title" ) != undefined ) {
+                       equal( widget.find(".ui-popup-title" ).html( ), "title" );
+               }
+
+               buttonList = widget.find(":jqmData(role=button )" ) ;
+               equal( buttonList.length, buttoncount, "Button count correct" );
+
+       };
+
+       $("#popupwindow" ).page( );
+
+       test( "Center Title", function ( ) {
+               unit_popup( $("#center_title" ), "center_title" , 0 );
+       } );
+       test( "Center Info", function ( ) {
+               unit_popup( $("#center_info" ), "center_info", 0 );
+       } );
+       test( "Center Basic 1 Button", function ( ) {
+               unit_popup( $("#center_basic_1btn" ), "center_basic_1btn" , 1 );
+       } );
+       test( "Center Title 1 Button", function ( ) {
+               unit_popup( $("#center_title_1btn" ), "center_title_1btn" , 1 );
+       } );
+       test( "Center social style", function ( ) {
+               unit_popup( $("#center_social_style1" ), "center_liststyle_2btn" , 2 );
+       } );
+       test( "center_social_style2", function ( ) {
+               unit_popup( $("#center_social_style2" ), "center_title_2btn" , 2 );
+       } );
+       test( "center_basic_2btn", function ( ) {
+               unit_popup( $("#center_basic_2btn" ), "center_basic_2btn" , 2 );
+       } );
+       test( "center_basic_3btn", function ( ) {
+               unit_popup( $("#center_basic_3btn" ), "center_basic_3btn" , 3 );
+       } );
+       test( "center_title_2btn", function ( ) {
+               unit_popup( $("#center_title_2btn" ), "center_title_2btn" , 2 );
+       } );
+       test( "Center_title_3btn", function ( ) {
+               unit_popup( $("#center_title_3btn" ), "center_title_3btn" , 3 );
+       } );
+       test( "center_button_vertical", function ( ) {
+               unit_popup( $("#center_button_vertical" ), "center_button_vertical" , 3 );
+       } );
+       test( "Center_checkbox", function ( ) {
+               unit_popup( $("#center_checkbox" ), "center_checkbox" , 2 );
+       } );
+       test( "center_liststyle_1btn", function ( ) {
+               unit_popup( $("#center_liststyle_1btn" ), "center_liststyle_1btn" , 1 );
+       } );
+       test( "center_liststyle_2btn", function ( ) {
+               unit_popup( $("#center_liststyle_2btn" ), "center_liststyle_2btn" , 2 );
+       } );
+       test( "center_liststyle_3btn", function ( ) {
+               unit_popup( $("#center_liststyle_3btn" ), "center_liststyle_3btn" , 3 );
+       } );
+
+} );
diff --git a/tests/additional-unit-tests/progressbar/index.html b/tests/additional-unit-tests/progressbar/index.html
new file mode 100755 (executable)
index 0000000..4bd0f3f
--- /dev/null
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+<head>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/jquery.js"></script>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.min.js"></script>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw.js"
+               data-framework-theme="tizen-white"
+               data-framework-viewport-scale=false>
+       </script>
+
+       <link rel="stylesheet" href="../../../libs/js/jquery-mobile-1.2.0/external/qunit.css" />
+
+       <script src="../../../libs/js/jquery-mobile-1.2.0/external/qunit.js"></script>
+       <script src="progressbar-tests.js"></script>
+
+       <title>Progressbar</title>
+</head>
+
+<body>
+
+<h1 id="qunit-header">Progressbar</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+
+<div id="qunit-fixture">
+
+       <div data-role="page" id="progressbar_demo">
+               <div data-role="header" data-position="fixed">
+                       <h1>Progressbar</h1>
+               </div>
+               <div data-role="content">
+                       <ul data-role="listview">
+                               <li><div data-role="progressbar" id="progressbar"></div></li>
+                               <li><div data-role="progressing" data-style="pending" id="pending"></div></li>
+                               <li><div data-role="progressing" data-style="circle" id="progressing"></div></li>
+                       </ul>
+               </div>
+       </div>
+
+</div>
+
+</body>
+</html>
diff --git a/tests/additional-unit-tests/progressbar/progressbar-tests.js b/tests/additional-unit-tests/progressbar/progressbar-tests.js
new file mode 100755 (executable)
index 0000000..f82258a
--- /dev/null
@@ -0,0 +1,104 @@
+/*
+ * Unit Test : Progressbar
+ *
+ * Minkyu Kang <mk7.kang@samsung.com>
+ */
+/*jslint browser: true*/
+/*global $, jQuery, test, equal, ok*/
+( function ( $ ) {
+       module("Progressbar" );
+
+       var unit_progressbar = function ( widget ) {
+               var progress,
+                       i,
+                       value,
+                       get_width = function ( widget ) {
+                               return widget.progressbar( "option", "value" );
+                       },
+                       changeEvent = false ;
+
+               widget.bind('change', function ( ) {
+                       changeEvent = true ;
+               } );
+               widget.progressbar( );
+
+               /* Create */
+               equal( widget.hasClass("ui-progressbar" ), true, "Create" );
+
+               /*markup check */
+               ok( widget.find(".ui-progressbar-bg" ), "Markup check" );
+               ok( widget.find(".ui-progressbar-value" ), "Markup check" );
+
+               /* Value */
+               for ( i = 0; i < 5; i++ ) {
+                       value = Math.floor( Math.random( ) * 100 );
+                       widget.progressbar( "option", "value", value );
+                       equal( changeEvent, true, "Change Event : " );
+                       equal( get_width( widget ), value, "API : value" );
+                       equal( parseInt( widget.find(".ui-progressbar-value" ).css('width'), 10 ) - parseInt( widget.find(".ui-progressbar-bg" ).css('width'), 10 ) * value / 100 < 5, true , "Markup check after value is changed" );
+                       changeEvent = false ;
+               }
+       },
+
+               unit_progress = function ( widget, type ) {
+                       var progress,
+                               elem = ".ui-progress-" + type,
+                               _class = "ui-progress-" + type + "-running";
+
+                       widget.progress( );
+
+                       /* Create */
+                       progress = widget.find( elem );
+                       ok( progress, "Create" );
+
+                       /* Option */
+                       equal( widget.progress( "option", "style" ), type, "Option : style" );
+
+                       /* Running */
+                       widget.progress( "running", true );
+                       progress = widget.find( elem );
+                       equal( progress.hasClass( _class ), true, "API : running" );
+
+                       /* Stop */
+                       widget.progress( "running", false );
+                       progress = widget.find( elem );
+                       equal( progress.hasClass( _class ), false, "API : stop" );
+               };
+
+       test( "progressbar", function ( ) {
+               unit_progressbar( $("#progressbar" ) );
+       } );
+
+       test( "pending bar", function ( ) {
+               unit_progress( $("#pending" ), "pending" );
+       } );
+
+       test( "processing circle", function ( ) {
+               unit_progress( $("#progressing" ), "circle" );
+       } );
+
+
+       test( "progressbar - dynamic", function ( ) {
+
+               $('#progressbar_demo').find(":jqmData(role=contents)" ).empty( );
+               var markup = ' <div data-role= "progressbar" id= "progressbar"></div>';
+               $('#progressbar_demo').find(":jqmData(role=contents)" ).append( markup ).trigger('create') ;
+               unit_progressbar( $("#progressbar" ) );
+       } );
+
+       test( "pending bar - dynamic", function ( ) {
+               $('#progressbar_demo').find(":jqmData(role=contents)" ).empty( );
+               var markup = ' <div data-role= "progressing" data-style= "pending" id= "pending"></div>';
+               $('#progressbar_demo').find(":jqmData(role=contents)" ).append( markup ).trigger('create') ;
+
+               unit_progress( $("#pending" ), "pending" );
+       } );
+
+       test( "processing circle - dynamic", function ( ) {
+               $('#progressbar_demo').find(":jqmData(role=contents)" ).empty( );
+               var markup = ' <div data-role= "progressing" data-style= "circle" id= "progressing"></div>';
+               $('#progressbar_demo').find(":jqmData(role=contents)" ).append( markup ).trigger('create') ;
+
+               unit_progress( $("#progressing" ), "circle" );
+       } );
+} ( jQuery ) );
diff --git a/tests/additional-unit-tests/radio/index.html b/tests/additional-unit-tests/radio/index.html
new file mode 100755 (executable)
index 0000000..3104022
--- /dev/null
@@ -0,0 +1,69 @@
+<!DOCTYPE html>
+<html>
+<head>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/jquery.js"></script>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.min.js"></script>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw.js"
+               data-framework-theme="tizen-white"
+               data-framework-viewport-scale=false>
+       </script>
+
+
+       <link rel="stylesheet" href="../../../libs/js/jquery-mobile-1.2.0/external/qunit.css" />
+       <script src="../../../libs/js/jquery-mobile-1.2.0/external/qunit.js"></script>
+
+       <script src="radio-tests.js"></script>
+       <title>Radio</title>
+</head>
+
+<body>
+
+<h1 id="qunit-header">Radio</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+
+<div id="qunit-fixture">
+       <div data-role="page" id="radiopage">
+               <div data-role='content'>
+                       <input type="radio" name="radio-single" id="radio-single-1" value="Normal" />
+                       <label for="radio-single-1">Normal</label>
+                       <input type="radio" name="radio-2" id="radio-single-2" checked="checked" disabled="disabled" value="Checked, Disabled" />
+                       <label for="radio-single-2">Checked, Disabled</label>
+                       <input type="radio" name="radio-3" id="radio-single-3" disabled="disabled" value="Disabled" />
+                       <label for="radio-single-3">Disabled</label>
+
+                       <fieldset id="controlgroup" data-role="controlgroup">
+                               <input type="radio" name="radio-choice" id="radio-choice-1" value="Cat"  />
+                               <label for="radio-choice-1">Cat</label>
+
+                               <input type="radio" name="radio-choice" id="radio-choice-2" value="Dog" />
+                               <label for="radio-choice-2">Dog</label>
+
+                               <input type="radio" name="radio-choice" id="radio-choice-3" value="Hamster" />
+                               <label for="radio-choice-3">Hamster</label>
+
+                               <input type="radio" name="radio-choice" id="radio-choice-4" value="Lizard" />
+                               <label for="radio-choice-4">Lizard</label>
+                       </fieldset>
+
+                       <fieldset id="controlgroup2" data-type="horizontal" data-role="controlgroup">
+                               <input type="radio" name="radio-choice2" id="radio-choiceh-1" value="Cat"  />
+                               <label for="radio-choiceh-1">Cat</label>
+
+                               <input type="radio" name="radio-choice2" id="radio-choiceh-2" value="Dog" />
+                               <label for="radio-choiceh-2">Dog</label>
+
+                               <input type="radio" name="radio-choice2" id="radio-choiceh-3" value="Hamster" />
+                               <label for="radio-choiceh-3">Hamster</label>
+
+                               <input type="radio" name="radio-choice2" id="radio-choiceh-4" value="Lizard" />
+                               <label for="radio-choiceh-4">Lizard</label>
+                       </fieldset>
+               </div>
+       </div>
+</div>
+
+</body>
+</html>
diff --git a/tests/additional-unit-tests/radio/radio-tests.js b/tests/additional-unit-tests/radio/radio-tests.js
new file mode 100755 (executable)
index 0000000..57ff43b
--- /dev/null
@@ -0,0 +1,179 @@
+/*
+ * Unit Test : Radio
+ *
+ * Hyunjung Kim <hjnim.kim@samsung.com>
+ *
+ */
+/*jslint browser: true*/
+/*global $, jQuery, test, equal, ok*/
+$( "#radiopage" ).live( "pageinit", function ( event ) {
+
+       module("Radio" );
+
+       /* Single Radio */
+       var unit_radio = function ( input , type ) {
+               var radio,
+                       label,
+                       checkClass,
+                       labelSpan,
+                       radioClassPrefix = "ui-radio";
+
+               radio = input.parent( );
+               ok( radio.hasClass( radioClassPrefix ) , "Create - Single Radio Button" );
+
+               label = radio.find( "label" );
+               label.trigger( "vclick" );
+               checkClass = radioClassPrefix + "-on";
+               if ( !input.is( ":checked" ) ) {
+                       checkClass = radioClassPrefix + "-off";
+               }
+               ok( label.hasClass( checkClass ), "Click - Radio button" );
+
+               labelSpan = label.children( ).children( );
+               ok( labelSpan.first( ).is( ".ui-btn-text, .ui-btn-text-padding-left" ), "Okay - Label Padding" );
+
+               if ( !input.is( ":disabled" ) ) {
+                       label.trigger( "vclick" );
+               }
+
+               // Text Trim, Cause jQueryMobile( JQM ) 1.1 forced to add -"\u00a0" in buttonIcon( ButtonMarkup )
+               // JQM 1.1 buttonMarkup code :
+               // - if ( buttonIcon ) buttonIcon.appendChild( document.createTextNode( "\u00a0" ) );
+               equal( labelSpan.text( ).trim( ), input.val( ), "Label Text" );
+       },
+
+       /* Group Radio */
+               unit_radio_group = function ( fieldset , type ) {
+                       var radios = [],
+                               label,
+                               labels,
+                               i,
+                               j;
+
+                       type = fieldset.jqmData( "type" );
+                       if ( type === undefined ) {
+                               type = "vertical";
+                       }
+                       ok( fieldset.is( ".ui-corner-all, .ui-controlgroup, .ui-controlgroup-" + type ) , "Create - ControlGroup" );
+
+                       if ( type == "horizontal" ) {
+                               labels = fieldset.find( "span.ui-btn-text" ).each( function ( ) {
+                                       ok( ( $( this ).siblings( ).length == 0 && $( this ).hasClass( "ui-btn-text" ) ) ? true : false, "Alignment - ControlGroup( Horizontal, Single Radio )" );
+                               } );
+                       }
+
+                       radios = fieldset.find( "input[type= ' radio']" );
+                       radios.each( function ( ) {
+                               unit_radio( $( this ) , "Normal" );
+                       } );
+
+                       ok( function ( ) {
+                               try {
+                                       for ( i = 0 ; i < radios.lenght ; i++ ) {
+                                               label = radios[i].find( "label" );
+                                               label.trigger( "vclick" );
+                                               if ( !label.hasClass( "ui-radio-on" ) ) {
+                                                       throw "error - other button activate";
+                                               }
+                                               for ( j = 0 ; j < radios.lenght ; j++ ) {
+                                                       if ( i !== j ) {
+                                                               label = radios[j].find( "label" );
+                                                               if ( label.hasClass( "ui-radio-on" ) ) {
+                                                                       throw "error - other button activate";
+                                                               }
+                                                       }
+                                               }
+                                       }
+                               } catch ( Exception ) {
+                                       return false;
+                               }
+                               return true;
+                       }, "Click - Radio Button( Group )" );
+               };
+
+       test( "radiobutton - Single" , function ( ) {
+               unit_radio( $("#radio-single-1" ) , "Normal" );
+       } );
+
+       test( "radiobutton - Single, Checked, Disabled" , function ( ) {
+               unit_radio( $("#radio-single-2" ) , "Checked, Disabled" );
+       } );
+
+       test( "radiobutton - Single, Disabled" , function ( ) {
+               unit_radio( $("#radio-single-3" ) , "Disabled" );
+       } );
+
+       test( "radiobutton - Group" , function ( ) {
+               unit_radio_group( $("#controlgroup" ) , "Group" );
+       } );
+
+       test( "radiobutton - Group, Horizontal" , function ( ) {
+               unit_radio_group( $("#controlgroup2" ) , "Group - horizontal" );
+       } );
+
+       test( "radiobutton - Single -Dunamic" , function ( ) {
+
+               $('#radiopage').find(":jqmData(role=contents)" ).empty( );
+
+               var markup = ' <input type= "radio" name= "radio-single" id= "radio-single-1" value= "Normal" /><label for= "radio-single-1">Normal</label>';
+               $('#radiopage').find(":jqmData(role=contents)" ).append( markup ).trigger('create');
+
+               unit_radio( $("#radio-single-1" ) , "Normal" );
+       } );
+
+       test( "radiobutton - Single, Checked, Disabled -Dunamic" , function ( ) {
+               $('#radiopage').find(":jqmData(role=contents)" ).empty( );
+
+               var markup = ' <input type= "radio" name= "radio-2" id= "radio-single-2" checked= "checked" disabled= "disabled" value= "Checked, Disabled" /><label for= "radio-single-2">Checked, Disabled</label>';
+               $('#radiopage').find(":jqmData(role=contents)" ).append( markup ).trigger('create');
+               unit_radio( $("#radio-single-2" ) , "Checked, Disabled" );
+       } );
+
+       test( "radiobutton - Single, Disabled -Dunamic" , function ( ) {
+               $('#radiopage').find(":jqmData(role=contents)" ).empty( );
+
+               var markup = ' <input type= "radio" name= "radio-3" id= "radio-single-3" disabled= "disabled" value= "Disabled" /><label for= "radio-single-3">Disabled</label>';
+               $('#radiopage').find(":jqmData(role=contents)" ).append( markup ).trigger('create');
+               unit_radio( $("#radio-single-3" ) , "Disabled" );
+       } );
+
+       test( "radiobutton - Group -Dunamic" , function ( ) {
+               $('#radiopage').find(":jqmData(role=contents)" ).empty( );
+
+               var markup = ' <fieldset id= "controlgroup" data-role= "controlgroup">' +
+                                                                       '<input type= "radio" name= "radio-choice" id= "radio-choice-1" value= "Cat" />' +
+                                                                       '<label for= "radio-choice-1">Cat</label>' +
+
+                                                                       '<input type= "radio" name= "radio-choice" id= "radio-choice-2" value= "Dog" />' +
+                                                                       '<label for= "radio-choice-2">Dog</label>' +
+
+                                                                       '<input type= "radio" name= "radio-choice" id= "radio-choice-3" value= "Hamster" />' +
+                                                                       '<label for= "radio-choice-3">Hamster</label>' +
+
+                                                                       '<input type= "radio" name= "radio-choice" id= "radio-choice-4" value= "Lizard" />' +
+                                                                       '<label for= "radio-choice-4">Lizard</label>' +
+                                                               '</fieldset>';
+               $('#radiopage').find(":jqmData(role=contents)" ).append( markup ).trigger('create');
+               unit_radio_group( $("#controlgroup" ) , "Group" );
+       } );
+
+       test( "radiobutton - Group, Horizontal -Dunamic" , function ( ) {
+               $('#radiopage').find(":jqmData(role=contents)" ).empty( );
+
+               var markup = ' <fieldset id= "controlgroup2" data-type= "horizontal" data-role= "controlgroup">' +
+                                                               '<input type= "radio" name= "radio-choice2" id= "radio-choiceh-1" value= "Cat" />' +
+                                                               '<label for= "radio-choiceh-1">Cat</label>' +
+
+                                                               '<input type= "radio" name= "radio-choice2" id= "radio-choiceh-2" value= "Dog" />' +
+                                                               '<label for= "radio-choiceh-2">Dog</label>' +
+
+                                                               '<input type= "radio" name= "radio-choice2" id= "radio-choiceh-3" value= "Hamster" />' +
+                                                               '<label for= "radio-choiceh-3">Hamster</label>' +
+
+                                                               '<input type= "radio" name= "radio-choice2" id= "radio-choiceh-4" value= "Lizard" />' +
+                                                               '<label for= "radio-choiceh-4">Lizard</label>' +
+                                                       '</fieldset>';
+               $('#radiopage').find(":jqmData(role=contents)" ).append( markup ).trigger('create');
+               unit_radio_group( $("#controlgroup2" ) , "Group - horizontal" );
+       } );
+} );
diff --git a/tests/additional-unit-tests/runner.js b/tests/additional-unit-tests/runner.js
new file mode 100755 (executable)
index 0000000..7ff75d4
--- /dev/null
@@ -0,0 +1,100 @@
+$(document).ready(function() {
+       var Runner = function( ) {
+               var self = this;
+
+               $.extend( self, {
+                       frame: window.frames[ "testFrame" ],
+
+                       testTimeout: 3 * 60 * 1000,
+
+                       $frameElem: $( "#testFrame" ),
+
+                       assertionResultPrefix: "assertion result for test:",
+
+                       onTimeout: QUnit.start,
+
+                       onFrameLoad: function() {
+                               // establish a timeout for a given suite in case of async tests hanging
+                               self.testTimer = setTimeout( self.onTimeout, self.testTimeout );
+
+                               // it might be a redirect with query params for push state
+                               // tests skip this call and expect another
+                               if( !self.frame.QUnit ) {
+                                       self.$frameElem.one( "load", self.onFrameLoad );
+                                       return;
+                               }
+
+                               // when the QUnit object reports done in the iframe
+                               // run the onFrameDone method
+                               self.frame.QUnit.done = self.onFrameDone;
+                               self.frame.QUnit.testDone = self.onTestDone;
+                       },
+
+                       onTestDone: function( result ) {
+                               QUnit.ok( !(result.failed > 0), result.name );
+                               //self.recordAssertions( result.total - result.failed, result.name );
+                       },
+
+                       onFrameDone: function( failed, passed, total, runtime ){
+                               // make sure we don't time out the tests
+                               clearTimeout( self.testTimer );
+
+                               // TODO decipher actual cause of multiple test results firing twice
+                               // clear the done call to prevent early completion of other test cases
+                               self.frame.QUnit.done = $.noop;
+                               self.frame.QUnit.testDone = $.noop;
+
+                               // hide the extra assertions made to propogate the count
+                               // to the suite level test
+                               self.hideAssertionResults();
+
+                               // continue on to the next suite
+                               QUnit.start();
+                       },
+
+                       recordAssertions: function( count, parentTest ) {
+                               for( var i = 0; i < count; i++ ) {
+                                       ok( true, self.assertionResultPrefix + parentTest );
+                               }
+                       },
+
+                       hideAssertionResults: function() {
+                               $( "li:not([id]):contains('" + self.assertionResultPrefix + "')" ).hide();
+                       },
+
+                       exec: function( data ) {
+                               var template = self.$frameElem.attr( "data-src" );
+
+                               $.each( data.testPages, function(i, dir) {
+                                       QUnit.asyncTest( dir, function() {
+                                               console.log('Test start: ' + dir);
+                                               self.dir = dir;
+                                               self.$frameElem.one( "load", self.onFrameLoad );
+                                               self.$frameElem.attr( "src", template.replace("{{testfile}}", dir + '/index.html') );
+                                       });
+                               });
+
+                               // having defined all suite level tests let QUnit run
+                               QUnit.start();
+                       }
+               });
+       };
+
+       // prevent qunit from starting the test suite until all tests are defined
+       QUnit.begin = function(  ) {
+               this.config.autostart = false;
+               this.config.reorder = false;
+       };
+
+       QUnit.done = function( details ) {
+       /*
+               setCookie( "TizenP", details.passed );
+               setCookie( "TizenF", details.failed );
+               setCookie( "TizenR", details.runtime );
+               setCookie( "TizenT", details.total );
+               location.href = "../jqm-tchelper/result.php";
+               */
+       }
+       // get the test directories
+       new Runner().exec(TESTS);
+});
diff --git a/tests/additional-unit-tests/searchbar/index.html b/tests/additional-unit-tests/searchbar/index.html
new file mode 100755 (executable)
index 0000000..ff45637
--- /dev/null
@@ -0,0 +1,89 @@
+<!DOCTYPE html>
+<html>
+       <head>
+               <script src="../../../build/tizen-web-ui-fw/latest/js/jquery.js"></script>
+               <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.min.js"></script>
+               <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw.js"
+                       data-framework-theme="tizen-white"
+                       data-framework-viewport-scale=false>
+               </script>
+
+               <link rel="stylesheet" href="../../../libs/js/jquery-mobile-1.2.0/external/qunit.css" />
+               <script src="../../../libs/js/jquery-mobile-1.2.0/external/qunit.js"></script>
+               <script src="searchbar-tests.js"></script>
+               <title>Searchbar</title>
+       </head>
+
+       <body>
+               <h1 id="qunit-header">Searchbar</h1>
+               <h2 id="qunit-banner"></h2>
+               <div id="qunit-testrunner-toolbar"></div>
+               <h2 id="qunit-userAgent"></h2>
+               <ol id="qunit-tests"></ol>
+
+               <div id="qunit-fixture">
+                       <div data-role="page" id="dummy-page">
+                               <div data-role="header" data-position="fixed">
+                                       <h1>Dummy</h1>
+                               </div>
+                               <div data-role="contents">
+                               </div>
+                       </div>
+
+                       <div data-role="page" id="searchbar-unit-test" data-add-back-btn="true">
+                               <div data-role="header" data-position="fixed">
+                                       <h1>Searchbar</h1>
+                                       <input type="search" data-cancel-btn=true name="search" data-icon="call" id="searchInput" value=""/>
+                               </div>
+                               <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>
+               </div>
+               <script>
+                       $( "#searchInput" ).live( "input change", function(){
+                               var regEx = "";
+
+                               regEx = ".*" + $( "#searchInput" ).val();
+
+                               $( "#searchbar-content p" ).each( function(){
+                                       if ( $( this ).text().search( new RegExp( regEx ) ) != -1) {
+                                               $( this ).show();
+                                       }
+                                       else {
+                                               $( this ).hide();
+                                       }
+                               });
+                       } );
+               </script>
+       </body>
+</html>
diff --git a/tests/additional-unit-tests/searchbar/searchbar-tests.js b/tests/additional-unit-tests/searchbar/searchbar-tests.js
new file mode 100755 (executable)
index 0000000..3cfb7f5
--- /dev/null
@@ -0,0 +1,96 @@
+/*
+ * Unit Test : Searchbar list
+ *
+ * Wongi Lee <wongi11.lee@samsung.com>
+ */
+/*jslint browser: true*/
+/*global $, jQuery, test, equal, ok, notEqual*/
+$( document ).ready( function ( ) {
+
+       module( "Searchbar" );
+
+       // trigger pagecreate
+       $( "#searchbar-unit-test" ).page( );
+
+       var searctbar_test = function ( widget, options ) {
+               var $divSearchbar = $( "#searchbar-unit-test div.input-search-bar" ),
+                       $input = $( "input" );
+
+               equal( $divSearchbar.length, 1, "initialized" );
+               equal( $divSearchbar.find( "div.ui-input-search" ).length, 1 );
+               equal( $divSearchbar.find( "div.ui-input-search input.ui-input-text" ).length, 1 );
+               equal( $divSearchbar.find( "div.ui-input-search a.ui-input-clear" ).hasClass( "ui-input-clear-hidden" ), true );
+               equal( $divSearchbar.find( "div.ui-input-search div.ui-image-search" ).length, 1 );
+
+               equal( $("#searchbar-content p" ).filter( function ( index ) {
+                       return $( this ).css( "display" ) != "none";
+               } ).length, 30 );
+
+               /* Public Method */
+               /* disable */
+               $( "#searchInput" ).searchbar( "disable" );
+               equal( $( "#searchbar-unit-test div.ui-input-search" ).hasClass( "ui-disabled" ), true, "disable" );
+               equal( $( "#searchInput" ).attr( "disabled" ), "disabled" );
+
+
+               $input.val( "are" ).trigger( "change" );
+               equal( $("#searchbar-content p" ).filter( function ( index ) {
+                       return $( this ).css( "display" ) != "none";
+               } ).length, 1 , "After search bar was disabled testing chage event" );
+
+               /* enable */
+               $( "#searchInput" ).searchbar( "enable" );
+               equal( $( "#searchbar-unit-test div.ui-input-search" ).hasClass( "ui-disabled" ), false, "enable" );
+               equal( $( "#searchInput" ).attr( "disabled" ), undefined );
+
+               /* Event */
+               /* Search : Input and trigger change */
+               $input.focus( );
+               equal( $( "div.ui-image-search" ).css( "display" ), "block", "Input and trigger change" );
+
+               $input.val( "a" ).trigger( "change" );
+
+               $input.val( "are" ).trigger( "change" );
+               equal( $("#searchbar-content p" ).filter( function ( index ) {
+                       return $( this ).css( "display" ) != "none";
+               } ).length, 1 );
+
+               $input.val( "12" ).trigger( "change" );
+               equal( $("#searchbar-content p" ).filter( function ( index ) {
+                       return $( this ).css( "display" ) != "none";
+               } ).length, 0 );
+
+               /* Clear button pressed. */
+               $( "a.ui-input-clear" ).trigger( "click" );
+               equal( $("#searchbar-content p" ).filter( function ( index ) {
+                       return $( this ).css( "display" ) != "none";
+               } ).length, 30 );
+
+               equal( $divSearchbar.find( "div.ui-input-search a.ui-input-clear" ).hasClass( "ui-input-clear-hidden" ), true, "Clear button pressed" );
+
+               if ( options.button ) {
+                       /* Button test */
+                       equal( $( ".ui-btn" ).hasClass( "ui-btn" ), true );
+                       equal( $divSearchbar.find( "> .ui-btn" ).jqmData("icon" ), options.button );
+               }
+
+               if ( options.cancel == true ) {
+                       /* Cancel test*/
+                       equal( $( ".ui-input-cancel" ).hasClass( "ui-btn" ), true );
+                       equal( $( ".ui-input-cancel" ).hasClass( "ui-btn-icon-cancel" ), true );
+
+                       equal( $( ".ui-input-cancel" ).hasClass( "ui-btn" ), true );
+                       equal( $( ".ui-input-cancel" ).hasClass( "ui-btn-icon-cancel" ), true );
+
+                       /* Cancel button pressed. */
+                       $( "a.ui-btn-icon-cancel" ).trigger( "click" );
+                       notEqual( $( "div.ui-image-search" ).css( "display" ), "none" );
+               }
+       } ;
+
+       test( "Searchbar", function ( ) {
+               /* Initialize */
+               searctbar_test( $('#searchInput'), {button : 'call', cancel : true} ) ;
+       } );
+
+} );
diff --git a/tests/additional-unit-tests/segmentcontrol/index.html b/tests/additional-unit-tests/segmentcontrol/index.html
new file mode 100755 (executable)
index 0000000..8f31f39
--- /dev/null
@@ -0,0 +1,108 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/jquery.js"></script>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.min.js"></script>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw.js"
+               data-framework-theme="tizen-white"
+               data-framework-viewport-scale=false>
+       </script>
+
+
+       <link rel="stylesheet" href="../../../libs/js/jquery-mobile-1.2.0/external/qunit.css" />
+
+       <script src="../../../libs/js/jquery-mobile-1.2.0/external/qunit.js"></script>
+
+  <script src="segmentcontrol-tests.js"></script>
+</head>
+<body>
+
+<h1 id="qunit-header">Controlbar</h1>
+<h2 id="qunit-banner"></h2>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests">
+</ol>
+
+
+<div data-nstest-role="page" id='segmentcontrol_page'>
+  <div data-nstest-role="header" data-position="inline">
+    <h1>SegmentControl Test - markup</h1>
+  </div>
+  <div data-nstest-role="content">
+               <div data-role="fieldcontain" id="segmentcontrol-2btn">
+                       <fieldset data-role="controlgroup" data-type="horizontal">
+                               <input type="radio" name="radio-view-1" data-icon="segment-titlestyle-segonly" id="segment1" value="on" checked="checked" />
+                               <label for="segment1">List</label>
+                               <input type="radio" name="radio-view-1" data-icon="segment-titlestyle-segonly" id="segment2" value="off" />
+                               <label for="segment2">Grid</label>
+                       </fieldset>
+               </div>
+
+               <div data-role="fieldcontain" id="segmentcontrol-3btn">
+                       <fieldset data-role="controlgroup" data-type="horizontal">
+                               <input type="radio" name="radio-view-2" data-icon="segment-titlestyle-segonly" id="segment3" value="on" checked="checked" />
+                               <label for="segment3">List</label>
+                               <input type="radio" name="radio-view-2" data-icon="segment-titlestyle-segonly" id="segment4" value="off" />
+                               <label for="segment4">Grid</label>
+                               <input type="radio" name="radio-view-2" data-icon="segment-titlestyle-segonly" id="segment5" value="off" />
+                               <label for="segment5">Grid</label>
+                       </fieldset>
+               </div>
+
+               <div data-role="fieldcontain" id="segmentcontrol-4btn">
+                       <fieldset data-role="controlgroup" data-type="horizontal">
+                               <input type="radio" name="radio-view-9" data-icon="segment-titlestyle-segonly" id="segment6" value="on" checked="checked" />
+                               <label for="segment6">List</label>
+                               <input type="radio" name="radio-view-9" data-icon="segment-titlestyle-segonly" id="segment7" value="off" />
+                               <label for="segment7">Grid</label>
+                               <input type="radio" name="radio-view-9" data-icon="segment-titlestyle-segonly" id="segment8" value="off" />
+                               <label for="segment8">Grid</label>
+                               <input type="radio" name="radio-view-9" data-icon="segment-titlestyle-segonly" id="segment9" value="off" />
+                               <label for="segment9">Grid</label>
+                       </fieldset>
+               </div>
+               
+               <div data-role="fieldcontain" class="controlField" id="segmentcontrol-2btn-v">
+                       <fieldset data-role="controlgroup" data-type="vertical">
+                               <legend>segment toolbar with 2 options</legend>
+                               <input type="radio" name="radio-view-9" data-icon="segment-titlestyle-segonly" id="segment861" value="on" checked="checked" />
+                               <label for="segment861">Option 1</label>
+                               <input type="radio" name="radio-view-9" data-icon="segment-titlestyle-segonly" id="segment862" value="off" />
+                               <label for="segment862">Option 2</label>
+                       </fieldset>
+               </div>
+                                                                       
+               <div data-role="fieldcontain" class="controlField" id="segmentcontrol-3btn-v">
+                       <fieldset data-role="controlgroup" data-type="vertical">
+                               <legend>segment toolbar with 3 options</legend>
+                               <input type="radio" name="radio-view-9" data-icon="segment-titlestyle-segonly" id="segment861" value="off"  />
+                               <label for="segment861">Option 1</label>
+                               <input type="radio" name="radio-view-9" data-icon="segment-titlestyle-segonly" id="segment862" value="on" checked="checked" />
+                               <label for="segment862">Option 2</label>
+                               <input type="radio" name="radio-view-9" data-icon="segment-titlestyle-segonly" id="segment863" value="off" />
+                               <label for="segment863">Option 3</label>
+                       </fieldset>
+               </div>
+               
+                <div data-role="fieldcontain" class="controlField" id="segmentcontrol-4btn-v">
+                       <fieldset data-role="controlgroup" data-type="vertical">
+                               <legend>segment toolbar with 4 options</legend>
+                               <input type="radio" name="radio-view-9" data-icon="segment-titlestyle-segonly" id="segment861" value="off" />
+                               <label for="segment861">Option 1</label>
+                               <input type="radio" name="radio-view-9" data-icon="segment-titlestyle-segonly" id="segment862" value="off" />
+                               <label for="segment862">Option 2</label>
+                               <input type="radio" name="radio-view-9" data-icon="segment-titlestyle-segonly" id="segment863" value="off" />
+                               <label for="segment863">Option 3</label>
+                               <input type="radio" name="radio-view-9" data-icon="segment-titlestyle-segonly" id="segment864" value="on"  checked="checked" />
+                               <label for="segment864">Option 4</label>
+                       </fieldset>
+               </div>
+
+       </div>
+       <div data-nstest-role="footer">
+       </div>
+</div>
+
+
+</body>
+</html>
diff --git a/tests/additional-unit-tests/segmentcontrol/segmentcontrol-tests.js b/tests/additional-unit-tests/segmentcontrol/segmentcontrol-tests.js
new file mode 100755 (executable)
index 0000000..af75328
--- /dev/null
@@ -0,0 +1,175 @@
+/*
+ * segmentcontrol unit tests
+ */
+/*jslint browser: true*/
+/*global $, jQuery, test, equal, ok*/
+( function ( $ ) {
+       module( "SegmentControl" );
+
+       var unit_segmentcontrol = function ( widget, inputCount, layout ) {
+               var segmentGroup = widget;
+
+               /* Create */
+               ok( segmentGroup, "Create" );
+               equal( "fieldcontain", segmentGroup.jqmData("role" ), "segment control generate" );
+               equal( segmentGroup.find( "input" ).length, inputCount, "segment control listitem count test" );
+               equal( segmentGroup.find( "input" ).is( ":jqmData(icon=segment-titlestyle-segonly)" ), true, "segment control style test" );
+
+               /*Markup Check*/
+               equal( segmentGroup.hasClass("ui-field-contain" ), true, "ui-field-contain class added" ) ;
+               equal( segmentGroup.find(":jqmData(role=controlgroup )" ).hasClass("ui-controlgroup-" + layout ), true ) ;
+               equal( segmentGroup.find(":jqmData(role=controlgroup )" ).jqmData("type" ) , layout, "data-type" ) ;
+
+       };
+
+       test( "segmentcontrol 2btn-h test", function ( ) {
+               unit_segmentcontrol( $("#segmentcontrol-2btn" ), 2 , "horizontal" );
+       } );
+
+       test( "segmentcontrol 3btn-h test", function ( ) {
+               unit_segmentcontrol( $("#segmentcontrol-3btn" ), 3, "horizontal" );
+       } );
+
+       test( "segmentcontrol 4btn-h test", function ( ) {
+               unit_segmentcontrol( $("#segmentcontrol-4btn" ), 4, "horizontal" );
+       } );
+
+       test( "segmentcontrol 2btn-v test", function ( ) {
+               unit_segmentcontrol( $("#segmentcontrol-2btn-v" ), 2, "vertical" );
+       } );
+
+       test( "segmentcontrol 3btn-v test", function ( ) {
+               unit_segmentcontrol( $("#segmentcontrol-3btn-v" ), 3 , "vertical" );
+       } );
+
+       test( "segmentcontrol 4btn-v test", function ( ) {
+               unit_segmentcontrol( $("#segmentcontrol-4btn-v" ), 4, "vertical" );
+       } );
+
+
+       test( "segmentcontrol 2btn-h test - dynamic", function ( ) {
+
+               /* Create */
+               var segmentControlHTML = '<div data-nstest-role= "content">' +
+                                                                                                               '<div data-role= "fieldcontain" id= "segmentcontrol-2btn">' +
+                                                                                                                       '<fieldset data-role= "controlgroup" data-type= "horizontal">' +
+                                                                                                                               '<input type= "radio" name= "radio-view-1" data-icon= "segment-titlestyle-segonly" id= "segment1" value= "on" checked= "checked" />' +
+                                                                                                                               '<label for= "segment1">List</label>' +
+                                                                                                                               '<input type= "radio" name= "radio-view-1" data-icon= "segment-titlestyle-segonly" id= "segment2" value= "off" />' +
+                                                                                                                               '<label for= "segment2">Grid</label>' +
+                                                                                                                       '</fieldset>' +
+                                                                                                       '</div>';
+               /* Clean */
+               $('#segmentcontrol_page').find(":jqmData(role=content)" ).empty( );
+               $('#segmentcontrol_page').find(":jqmData(role=content)" ).append( segmentControlHTML ).trigger('create') ;
+               unit_segmentcontrol( $("#segmentcontrol-2btn" ), 2 , "horizontal" );
+       } );
+
+       test( "segmentcontrol 3btn test-h - dynamic", function ( ) {
+
+               /* Create */
+               var segmentControlHTML = '<div data-nstest-role= "content">' +
+                                                                                                               '<div data-role= "fieldcontain" id= "segmentcontrol-2btn">' +
+                                                                                                                       '<fieldset data-role= "controlgroup" data-type= "horizontal">' +
+                                                                                                                               '<input type= "radio" name= "radio-view-1" data-icon= "segment-titlestyle-segonly" id= "segment1" value= "on" checked= "checked" />' +
+                                                                                                                               '<label for= "segment1">List</label>' +
+                                                                                                                               '<input type= "radio" name= "radio-view-1" data-icon= "segment-titlestyle-segonly" id= "segment2" value= "off" />' +
+                                                                                                                               '<label for= "segment2">Grid</label>' +
+                                                                                                                               '<input type= "radio" name= "radio-view-1" data-icon= "segment-titlestyle-segonly" id= "segment3" value= "off" />' +
+                                                                                                                               '<label for= "segment3">Grid</label>' +
+                                                                                                                       '</fieldset>' +
+                                                                                                       '</div>';
+               /* Clean */
+               $('#segmentcontrol_page').find(":jqmData(role=content)" ).empty( );
+
+               $('#segmentcontrol_page').find(":jqmData(role=content)" ).append( segmentControlHTML ).trigger('create') ;
+               unit_segmentcontrol( $("#segmentcontrol-3btn" ), 3, "horizontal" );
+       } );
+
+       test( "segmentcontrol 4btn test-h - dynamic", function ( ) {
+
+               /* Create */
+               var segmentControlHTML = '<div data-nstest-role= "content">' +
+                                                                                                               '<div data-role= "fieldcontain" id= "segmentcontrol-2btn">' +
+                                                                                                                       '<fieldset data-role= "controlgroup" data-type= "horizontal">' +
+                                                                                                                               '<input type= "radio" name= "radio-view-1" data-icon= "segment-titlestyle-segonly" id= "segment1" value= "on" checked= "checked" />' +
+                                                                                                                               '<label for= "segment1">List</label>' +
+                                                                                                                               '<input type= "radio" name= "radio-view-1" data-icon= "segment-titlestyle-segonly" id= "segment2" value= "off" />' +
+                                                                                                                               '<label for= "segment2">Grid</label>' +
+                                                                                                                               '<input type= "radio" name= "radio-view-1" data-icon= "segment-titlestyle-segonly" id= "segment3" value= "off" />' +
+                                                                                                                               '<label for= "segment3">Grid</label>' +
+                                                                                                                                       '<input type= "radio" name= "radio-view-1" data-icon= "segment-titlestyle-segonly" id= "segment4" value= "off" />' +
+                                                                                                                               '<label for= "segment4">Grid</label>' +
+                                                                                                                       '</fieldset>' +
+                                                                                                       '</div>';
+               /* Clean */
+               $('#segmentcontrol_page').find(":jqmData(role=content)" ).empty( );
+
+               $('#segmentcontrol_page').find(":jqmData(role=content)" ).append( segmentControlHTML ).trigger('create') ;
+               unit_segmentcontrol( $("#segmentcontrol-4btn" ), 4, "horizontal" );
+       } );
+
+       test( "segmentcontrol 2btn-v test - dynamic", function ( ) {
+
+               /* Create */
+               var segmentControlHTML = '<div data-nstest-role= "content">' +
+                                                                                                               '<div data-role= "fieldcontain" id= "segmentcontrol-2btn">' +
+                                                                                                                       '<fieldset data-role= "controlgroup" data-type= "vertical">' +
+                                                                                                                               '<input type= "radio" name= "radio-view-1" data-icon= "segment-titlestyle-segonly" id= "segment1" value= "on" checked= "checked" />' +
+                                                                                                                               '<label for= "segment1">List</label>' +
+                                                                                                                               '<input type= "radio" name= "radio-view-1" data-icon= "segment-titlestyle-segonly" id= "segment2" value= "off" />' +
+                                                                                                                               '<label for= "segment2">Grid</label>' +
+                                                                                                                       '</fieldset>' +
+                                                                                                       '</div>';
+               /* Clean */
+               $('#segmentcontrol_page').find(":jqmData(role=content)" ).empty( );
+
+               $('#segmentcontrol_page').find(":jqmData(role=content)" ).append( segmentControlHTML ).trigger('create') ;
+               unit_segmentcontrol( $("#segmentcontrol-2btn-v" ), 2, "vertical" );
+       } );
+
+       test( "segmentcontrol 3btn-v test - dynamic", function ( ) {
+
+               /* Create */
+               var segmentControlHTML = '<div data-nstest-role= "content">' +
+                                                                                                               '<div data-role= "fieldcontain" id= "segmentcontrol-2btn">' +
+                                                                                                                       '<fieldset data-role= "controlgroup" data-type= "vertical">' +
+                                                                                                                               '<input type= "radio" name= "radio-view-1" data-icon= "segment-titlestyle-segonly" id= "segment1" value= "on" checked= "checked" />' +
+                                                                                                                               '<label for= "segment1">List</label>' +
+                                                                                                                               '<input type= "radio" name= "radio-view-1" data-icon= "segment-titlestyle-segonly" id= "segment2" value= "off" />' +
+                                                                                                                               '<label for= "segment2">Grid</label>' +
+                                                                                                                               '<input type= "radio" name= "radio-view-1" data-icon= "segment-titlestyle-segonly" id= "segment3" value= "off" />' +
+                                                                                                                               '<label for= "segment3">Grid</label>' +
+                                                                                                                       '</fieldset>' +
+                                                                                                       '</div>';
+               /* Clean */
+               $('#segmentcontrol_page').find(":jqmData(role=content)" ).empty( );
+               $('#segmentcontrol_page').find(":jqmData(role=content)" ).append( segmentControlHTML ).trigger('create') ;
+               unit_segmentcontrol( $("#segmentcontrol-3btn-v" ), 3 , "vertical" );
+       } );
+
+       test( "segmentcontrol 4btn-v test - dynamic", function ( ) {
+               /* Create */
+               var segmentControlHTML = '<div data-nstest-role= "content">' +
+                                                                                                               '<div data-role= "fieldcontain" id= "segmentcontrol-2btn">' +
+                                                                                                                       '<fieldset data-role= "controlgroup" data-type= "vertical">' +
+                                                                                                                               '<input type= "radio" name= "radio-view-1" data-icon= "segment-titlestyle-segonly" id= "segment1" value= "on" checked= "checked" />' +
+                                                                                                                               '<label for= "segment1">List</label>' +
+                                                                                                                               '<input type= "radio" name= "radio-view-1" data-icon= "segment-titlestyle-segonly" id= "segment2" value= "off" />' +
+                                                                                                                               '<label for= "segment2">Grid</label>' +
+                                                                                                                               '<input type= "radio" name= "radio-view-1" data-icon= "segment-titlestyle-segonly" id= "segment3" value= "off" />' +
+                                                                                                                               '<label for= "segment3">Grid</label>' +
+                                                                                                                                       '<input type= "radio" name= "radio-view-1" data-icon= "segment-titlestyle-segonly" id= "segment4" value= "off" />' +
+                                                                                                                               '<label for= "segment4">Grid</label>' +
+                                                                                                                       '</fieldset>' +
+                                                                                                       '</div>';
+               /* Clean */
+               $('#segmentcontrol_page').find(":jqmData(role=content)" ).empty( );
+
+               $('#segmentcontrol_page').find(":jqmData(role=content)" ).append( segmentControlHTML ).trigger('create') ;
+               unit_segmentcontrol( $("#segmentcontrol-4btn-v" ), 4, "vertical" );
+       } );
+
+
+
+} ( jQuery ) );
diff --git a/tests/additional-unit-tests/slider/index.html b/tests/additional-unit-tests/slider/index.html
new file mode 100755 (executable)
index 0000000..fac80d6
--- /dev/null
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<html>
+<head>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/jquery.js"></script>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.min.js"></script>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw.js"
+               data-framework-theme="tizen-white"
+               data-framework-viewport-scale=false>
+       </script>
+
+       <link rel="stylesheet" href="../../../libs/js/jquery-mobile-1.2.0/external/qunit.css" />
+
+       <script src="../../../libs/js/jquery-mobile-1.2.0/external/qunit.js"></script>
+       <script src="slider-tests.js"></script>
+
+       <title>Slider</title>
+</head>
+
+<body>
+
+<h1 id="qunit-header">Slider</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+
+<div id="qunit-fixture">
+
+       <div data-role="page" id="sliderpage1">
+               <div data-role="header" data-position="fixed">
+                       <h1>Slider</h1>
+               </div>
+               <div data-role="content">
+                       <input id="slider0" data-popup="false" type="range" name="slider" value="50" min="0" max="100"></input>
+               </div>
+       </div>
+       
+       <div data-role="page" id="sliderpage2">
+               <div data-role="header" data-position="fixed">
+                       <h1>Slider</h1>
+               </div>
+               <div data-role="content">               
+                       <input id="slider1" data-popup="false" type="range" name="slider" value="5" min="0" max="10" data-icon="volume"></input>
+               </div>
+       </div>
+</div>
+
+</body>
+</html>
diff --git a/tests/additional-unit-tests/slider/slider-tests.js b/tests/additional-unit-tests/slider/slider-tests.js
new file mode 100755 (executable)
index 0000000..fc1c582
--- /dev/null
@@ -0,0 +1,81 @@
+/*
+ * Unit Test : Slider
+ *
+ * Minkyu Kang <mk7.kang@samsung.com>
+ */
+/*jslint browser: true*/
+/*global $, jQuery, test, equal, ok*/
+$( document ).ready( function ( ) {
+       module("Slider" );
+       QUnit.config.reorder = false;
+       var unit_slider = function ( widget , options ) {
+               var slider,
+                       popup,
+                       oldValue,
+                       slider_bg = function ( widget ) {
+                               return "ui-slider-container";
+                       },
+                       handle,
+                       handle_left = function ( widget, slider ) {
+                               var left = widget.val() * slider.width() /
+                                       ( widget.attr("max") - widget.attr("min") );
+                               return Math.floor( left );
+                       },
+                       random_move = function ( min, max ) {
+                               return Math.floor( ( Math.random( ) * ( max - min + 1 ) ) + min );
+                       },
+                       checkEquality = function ( val1, val2 ) {
+                               return ( parseInt( val1, 10 ) - parseInt( val2, 10 ) ) < 5 ? true : false ;
+                       };
+
+               /* Create */
+               widget.tizenslider( );
+               slider = widget.next( ).children(".ui-slider" );
+               ok( slider, "Create" );
+
+               /* Check Background */
+               equal( slider.parent( ).attr("class" ), slider_bg( widget ), "Background" );
+
+               /* Check Parameters */
+               handle = slider.find(".ui-slider-handle" );
+
+               equal( handle.attr("aria-valuenow" ), widget.val( ), "Paramter : value" );
+               equal( handle.attr("aria-valuemin" ), widget.attr("min" ), "Paramter : min" );
+               equal( handle.attr("aria-valuemax" ), widget.attr("max" ), "Paramter : max" );
+
+               equal( parseInt( handle.css("left") ), handle_left( widget, slider ), "Handle Location: Default" );
+
+               /* Check APIs */
+               widget.val( random_move( widget.attr("min" ), widget.attr("max" ) ) );
+               widget.trigger("change" );
+               equal( parseInt( handle.css("left") ), handle_left( widget, slider ), "Handle Location: Moved" );
+               if ( widget.jqmData('popup') == true ) {
+                       popup = slider.find(".ui-slider-handle-press" );
+                       ok( popup, "Popup present" );
+                       equal( checkEquality( popup.css("left" ), handle_left( widget, handle ) ) , true, "popup value check Enabled" );
+               }
+
+               /*jqm data*/
+               if ( options && options.leftText ) {
+                       equal( widget.jqmData('text-left'), options.leftText, "jqmData left text" );
+               }
+               if ( options && options.rightText ) {
+                       equal( widget.jqmData('text-right'), options.rightText, "jqmData right text" );
+               }
+               if ( options && options.icon ) {
+                       equal( widget.jqmData('icon'), options.icon, "jqmData icon" );
+               }
+
+       };
+
+       test( "normal slider", function ( ) {
+               $('#sliderpage1').page( ) ;
+               unit_slider( $("#slider0" ) );
+       } );
+
+       test( "icon slider", function ( ) {
+               $('#sliderpage2').page( ) ;
+               unit_slider( $("#slider1" ) );
+       } );
+
+} );
diff --git a/tests/additional-unit-tests/swipe/index.html b/tests/additional-unit-tests/swipe/index.html
new file mode 100755 (executable)
index 0000000..922eca1
--- /dev/null
@@ -0,0 +1,92 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/jquery.js"></script>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.min.js"></script>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw.js"
+               data-framework-theme="tizen-white"
+               data-framework-viewport-scale=false>
+       </script>
+
+
+       <link rel="stylesheet" href="../../../libs/js/jquery-mobile-1.2.0/external/qunit.css" />
+
+       <script src="../../../libs/js/jquery-mobile-1.2.0/external/qunit.js"></script>
+       <script src="swipe-tests.js"></script>
+
+       <title>Swipe</title>
+</head>
+<body>
+
+<h1 id="qunit-header">Swipe Tests</h1>
+<h2 id="qunit-banner"></h2>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests">
+</ol>
+
+<div id="qunit-fixture" style="top:0px;left:0px;">
+       <div data-role="page" id="swipelistpage">
+                       <ul data-role="listview">
+                               <li id="swipewidget" data-role="swipe">
+                                       <div data-role="swipe-item">
+                                               <div data-role="button" data-inline="true">Twitter</div>
+                                               <div data-role="button" data-inline="true">Twitter</div>
+                                               <div data-role="button" data-inline="true">Facebook</div>
+                                               <div data-role="button" data-inline="true">Facebook</div>
+                                       </div>
+                                       <div data-role="swipe-item-cover">
+                                               Swipe2
+                                       </div>
+                               </li>
+                               <li data-role="swipe" id="swipewidget2">
+                                       <div data-role="swipe-item">
+                                               <div data-role="button" data-inline="true">Twitter</div>
+                                               <div data-role="button" data-inline="true">Twitter</div>
+                                               <div data-role="button" data-inline="true">Facebook</div>
+                                               <div data-role="button" data-inline="true">Facebook</div>
+                                       </div>
+                                       <div data-role="swipe-item-cover">
+                                               Swipe1
+                                       </div>
+                               </li>
+                       </ul>
+       </div>
+       <div data-role="page" id="swipedestorypage">
+                       <ul data-role="listview" >
+                               <li id="swipedestroy" data-role="swipe">
+                                       <div data-role="swipe-item">
+                                               <div data-role="button" data-inline="true">Twitter</div>
+                                               <div data-role="button" data-inline="true">Twitter</div>
+                                               <div data-role="button" data-inline="true">Facebook</div>
+                                               <div data-role="button" data-inline="true">Facebook</div>
+                                       </div>
+                                       <div data-role="swipe-item-cover">
+                                               <div style="display: inline-block;" class="ui-li-text-sub-left">subtext</div>
+                                               <div style="display: inline-block;" class="ui-li-text-main-right">2line-leftsub2</div>
+                                       </div>
+                               </li>
+                               <li data-role="swipe">
+                                       <div data-role="swipe-item">
+                                               <div data-role="button" data-inline="true">Twitter</div>
+                                               <div data-role="button" data-inline="true">Twitter</div>
+                                               <div data-role="button" data-inline="true">Facebook</div>
+                                               <div data-role="button" data-inline="true">Facebook</div>
+                                       </div>
+                                       <div data-role="swipe-item-cover">
+                                               <div style="display: inline-block;" class="ui-li-text-sub-left">subtext</div>
+                                               <div style="display: inline-block;" class="ui-li-text-main-right">1line-leftsub1</div>
+                                       </div>
+                               </li>
+                       </ul>
+       </div>
+       
+       <div data-role="page" id="swipedynamicpage">
+                       <ul data-role="listview" id='swipedynamiclist'>                         
+                               
+                       </ul>
+       </div>
+</div>
+
+
+</body>
+</html>
diff --git a/tests/additional-unit-tests/swipe/swipe-tests.js b/tests/additional-unit-tests/swipe/swipe-tests.js
new file mode 100755 (executable)
index 0000000..83f3164
--- /dev/null
@@ -0,0 +1,136 @@
+/*
+ * swipe unit tests
+ *
+ * Hyunjung Kim <hjnim.kim@samsung.com>
+ *
+ */
+/*jslint browser: true*/
+/*global $, jQuery, test, equal, ok, asyncTest, expect, start, stop*/
+( function ( $ ) {
+
+       module("swipe" );
+       var unit_swipe = function ( swipe, type ) {
+               var covers,
+                       cover,
+                       coverStart,
+                       item,
+                       secondSwipe,
+                       slideLeftDone = function ( ) {
+                               ok( true, "Animation Complete - sliding left" );
+                               cover.unbind("animationend" );
+                               equal( cover.position( ).left, coverStart, "Position - Cover" );
+                               start( );
+                       },
+                       slideRightDone = function ( ) {
+                               ok( true, "Animation Complete - sliding right" );
+                               setTimeout( function ( ) {
+                                       cover.unbind("animationend" );
+                                       cover.bind("animationend", slideLeftDone );
+                                       item.trigger("swipeleft" );
+                               }, 0 );
+                       };
+
+               if ( type == 'swipe') {
+                       $("#swipepage" ).page( );
+               } else if ( type == 'swipedynamic') {
+                       $("#swipedynamicpage" ).page( );
+               }
+
+               swipe.swipe( );
+               ok( swipe.hasClass("ui-swipe" ), "Create - Swipe" );
+
+               covers = swipe.find("div.ui-swipe-item-cover" );
+               cover = covers.first( );
+
+               coverStart = cover.position( ).left;
+               item = swipe.find("div.ui-swipe-item" ).first( );
+
+               /*API : open , close*/
+               cover.unbind("animationend" );
+               swipe.swipe('open');
+               equal( swipe.swipe('opened'), true, "API : open" );
+
+               swipe.swipe('close');
+               equal( swipe.swipe('opened'), false, "API : close" );
+
+               cover.bind("animationend", slideRightDone );
+               cover.trigger("swiperight" );
+               stop( );
+
+               equal( swipe.find("div.ui-swipe-item" ).length , 1, "Count - Swipeable li" );
+               equal( covers.length , 1, "Count - cover" );
+
+               equal( covers.get( 0 ).innerText, "Swipe2", "Check - Cover string value" );
+
+               /*Check other swipe items are closed*/
+               secondSwipe = swipe.next( );
+               secondSwipe.swipe( ) ;
+               if ( secondSwipe ) {
+                       secondSwipe.swipe('open');
+                       swipe.swipe('open');
+                       equal( secondSwipe.swipe('opened'), false, "When one open other swipe elements close." );
+               }
+       },
+
+               unit_swipe_destroy = function ( swipe, type ) {
+                       var covers,
+                               new_page = $("#swipedestorypage" );
+
+                       new_page.page( );
+                       swipe.swipe( );
+                       ok( swipe.hasClass("ui-swipe" ), "Create - Swipe" );
+                       covers = swipe.find("div.ui-swipe-item-cover" );
+                       equal( swipe.find("div.ui-swipe-item" ).length , 1, "Count - Swipeable ui-swipe-item" );
+
+                       equal( covers.length , 1, "Count - cover" );
+
+                       swipe.swipe("destroy" );
+                       equal( swipe.has('.ui-swipe').length, 0, "Destroy - swipe" );
+                       equal( swipe.has('.ui-swipe-item').length, 0 , "Destroy - item" );
+                       equal( swipe.has('.ui-swipe-item-cover').length, 0, "Destroy - cover" );
+
+               };
+
+       asyncTest( " swipe", function ( ) {
+               expect( 10 );
+               unit_swipe( $("#swipewidget" ), "swipe" );
+               start( );
+       } );
+
+
+       asyncTest( " swipe - destory", function ( ) {
+               expect( 6 ) ;
+               unit_swipe_destroy( $("#swipedestroy" ), "swipedestroy" ) ;
+               start( ) ;
+       } );
+
+       asyncTest( " swipe - dynamic", function ( ) {
+               expect( 10 );
+               var listContentHTML = '<li id= "swipewidgetdynamic" data-role= "swipe">' +
+                                                                                       '<div data-role= "swipe-item">' +
+                                                                                               '<div data-role= "button" data-inline= "true">Twitter</div>' +
+                                                                                               '<div data-role= "button" data-inline= "true">Twitter</div>' +
+                                                                                               '<div data-role= "button" data-inline= "true">Facebook</div>' +
+                                                                                               '<div data-role= "button" data-inline= "true">Facebook</div>' +
+                                                                                       '</div>' +
+                                                                                       '<div data-role= "swipe-item-cover">' +
+                                                                                               'Swipe2' +
+                                                                                       '</div>' +
+                                                                               '</li>' +
+                                                                               '<li data-role= "swipe" id= "swipewidget2">' +
+                                                                                       '<div data-role= "swipe-item">' +
+                                                                                               '<div data-role= "button" data-inline= "true">Twitter</div>' +
+                                                                                               '<div data-role= "button" data-inline= "true">Twitter</div>' +
+                                                                                               '<div data-role= "button" data-inline= "true">Facebook</div>' +
+                                                                                               '<div data-role= "button" data-inline= "true">Facebook</div>' +
+                                                                                       '</div>' +
+                                                                                       '<div data-role= "swipe-item-cover">' +
+                                                                                               'Swipe1' +
+                                                                                       '</div>' +
+                                                                               '</li>';
+               $("#swipedynamiclist" ).append( listContentHTML ).trigger("create" ) ;
+               unit_swipe( $("#swipewidgetdynamic" ), "swipedynamic" );
+               start( ) ;
+       } );
+
+} ( jQuery ) ) ;
diff --git a/tests/additional-unit-tests/tabbar/index.html b/tests/additional-unit-tests/tabbar/index.html
new file mode 100755 (executable)
index 0000000..5b89fc6
--- /dev/null
@@ -0,0 +1,55 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/jquery.js"></script>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.min.js"></script>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw.js"
+               data-framework-theme="tizen-white"
+               data-framework-viewport-scale=false>
+       </script>
+
+
+       <link rel="stylesheet" href="../../../libs/js/jquery-mobile-1.2.0/external/qunit.css" />
+
+       <script src="../../../libs/js/jquery-mobile-1.2.0/external/qunit.js"></script>
+
+  <script src="tabbar-tests.js"></script>
+</head>
+<body>
+
+<h1 id="qunit-header">Tabbar</h1>
+<h2 id="qunit-banner"></h2>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests">
+</ol>
+</div>
+
+<div data-nstest-role="page">
+       <div data-nstest-role="header" data-nstest-position="inline" id='tabbarheader'>
+               <h1>Tabbar Test - markup</h1>
+               <div id="tabbar-test-text-only-header" data-role="tabbar">
+                       <ul>
+                               <li><a href="#" data-icon='delete'>Menu</a></li>
+                               <li><a href="#" class="ui-btn-active" data-icon='forward'>Save</a></li>
+                               <li><a href="#" data-icon='plus'>Share</a></li>
+                               <li><a href="#" data-icon='back'>Timeline</a></li>
+                               <li><a href="#" data-icon='search'>WorldClock</a></li>
+                       </ul>
+               </div>
+       </div>
+       <div data-nstest-role="content">
+       </div>
+       <div data-nstest-role="footer" id='tabbarfooter'>
+               <div id="tabbar-test-text-only" data-role="tabbar">
+                       <ul>
+                               <li><a href="#" data-icon='delete'>Menu</a></li>
+                               <li><a href="#" class="ui-btn-active" data-icon='forward'>Save</a></li>
+                               <li><a href="#" data-icon='plus'>Share</a></li>
+                               <li><a href="#" data-icon='back'>Timeline</a></li>
+                               <li><a href="#" data-icon='search'>WorldClock</a></li>
+                       </ul>
+               </div>
+       </div>
+</div>
+</body>
+</html>
diff --git a/tests/additional-unit-tests/tabbar/tabbar-tests.js b/tests/additional-unit-tests/tabbar/tabbar-tests.js
new file mode 100755 (executable)
index 0000000..a377f6a
--- /dev/null
@@ -0,0 +1,99 @@
+/*
+ * tabbar unit tests
+ */
+/*jslint browser: true*/
+/*global $, jQuery, test, equal, ok*/
+( function ( $ ) {
+       $.mobile.defaultTransition = "none";
+
+       module( "Tabbar" );
+
+       var unit_tabbar = function ( widget, drayStyle ) {
+               var tabbar,
+                       tabbar_style,
+                       item_count,
+                       activeIndex,
+                       deactiveReturn,
+                       activeReturn,
+                       ww,
+                       wh,
+                       index,
+                       isLandscape,
+                       created_tabbar = widget.tabbar( );
+
+               /* Create */
+               ok( created_tabbar, "Create" );
+               equal( widget.find( "a" ).length, drayStyle.icon.length, "Markup check icons" ) ;
+               if ( drayStyle ) {
+                       if ( drayStyle.icon ) {
+                               for ( index = 0; index < drayStyle.icon.length; index++ ) {
+                                       equal( widget.find( "a" )[index].getAttribute("data-icon" ), drayStyle.icon[index], "Icon check" );
+                                       equal( widget.find( "a span.ui-btn-text" )[index].innerHTML, drayStyle.text[index], "Text check" );
+                               }
+                       }
+               }
+
+               /*Markup check*/
+               ww = window.innerWidth || $( window ).width( ) ;
+               wh = window.innerHeight || $( window ).height( );
+               isLandscape = ww > wh && ( ww - wh );
+
+               if ( isLandscape ) {
+                       equal( widget.hasClass( "ui-landscape-tabbar" ), true, "Markup check layout" );
+               } else {
+                       equal( widget.hasClass( "ui-portrait-tabbar" ), true, "Markup check layout" );
+               }
+
+
+               /* Check APIs */
+               activeIndex = created_tabbar.find(".ui-btn-active" ).index( );
+               created_tabbar.tabbar( "disable", activeIndex );
+               deactiveReturn = created_tabbar.find("li:eq(" + activeIndex + " )" ).is(".ui-disabled" );
+
+               equal( deactiveReturn, true, "List Deactive test" );
+
+               created_tabbar.tabbar("enable", activeIndex );
+               activeReturn = created_tabbar.find("li:eq(" + activeIndex + " )" ).is(".ui-disabled" );
+               equal( activeReturn, false, "List Active test" );
+       };
+
+       test( "tabbar text style test - footer", function ( ) {
+               unit_tabbar( $("#tabbar-test-text-only" ), {icon : ['delete', 'forward', 'plus', 'back', 'search'], text : ["Menu", "Save", "Share", "Timeline", "WorldClock"]} );
+       } );
+
+       test( "tabbar text style test - header", function ( ) {
+               unit_tabbar( $("#tabbar-test-text-only-header" ), {icon : ['delete', 'forward', 'plus', 'back', 'search'], text : ["Menu", "Save", "Share", "Timeline", "WorldClock"]} );
+       } );
+
+       test( "tabbar text style test - footer - Dynamic", function ( ) {
+
+               $('#abbar-test-text-only').remove( );
+               var VirtualMarkup = '<div id= "tabbar-test-text-only" data-role= "tabbar">' +
+                                                                                       '<ul>' +
+                                                                                               '<li><a href= "#" data-icon= "delete">Menu</a></li>' +
+                                                                                               '<li><a href= "#" class= "ui-btn-active" data-icon= "forward">Save</a></li>' +
+                                                                                               '<li><a href= "#" data-icon= "plus">Share</a></li>' +
+                                                                                               '<li><a href= "#" data-icon= "Back">Timeline</a></li>' +
+                                                                                               '<li><a href= "#" data-icon= "search"WorldClock</a></li>' +
+                                                                                       '</ul>' +
+                                                                               '</div>';
+               $('#tabbarfooter').append( VirtualMarkup ).trigger("create" );
+               unit_tabbar( $("#tabbar-test-text-only" ), {icon : ['delete', 'forward', 'plus', 'back', 'search'], text : ["Menu", "Save", "Share", "Timeline", "WorldClock"]} );
+       } );
+
+       test( "tabbar text style test- header - Dynamic", function ( ) {
+
+               $('#abbar-test-text-only-header').remove( );
+               var VirtualMarkup = '<div id= "tabbar-test-text-only-header" data-role= "tabbar">' +
+                                                                                       '<ul>' +
+                                                                                               '<li><a href= "#" data-icon= "delete">Menu</a></li>' +
+                                                                                               '<li><a href= "#" class= "ui-btn-active" data-icon= "forward">Save</a></li>' +
+                                                                                               '<li><a href= "#" data-icon= "plus">Share</a></li>' +
+                                                                                               '<li><a href= "#" data-icon= "Back">Timeline</a></li>' +
+                                                                                               '<li><a href= "#" data-icon= "search"WorldClock</a></li>' +
+                                                                                       '</ul>' +
+                                                                               '</div>';
+               $('#tabbarheader').append( VirtualMarkup ).trigger("create" );
+               unit_tabbar( $("#tabbar-test-text-only-header" ), {icon : ['delete', 'forward', 'plus', 'back', 'search'], text : ["Menu", "Save", "Share", "Timeline", "WorldClock"]} );
+       } );
+} ( jQuery ) );
diff --git a/tests/additional-unit-tests/tests.js b/tests/additional-unit-tests/tests.js
new file mode 100755 (executable)
index 0000000..8a77085
--- /dev/null
@@ -0,0 +1,31 @@
+var TESTS = {
+       "testPages":
+       [
+               "autodivider",
+               "button",
+               "check",
+               "collapsible",
+               "datetimepicker",
+               "fastscroll",
+               "gallery",
+               "handler",
+               "headerfooter",
+               "list",
+               "listdividers",
+               /*"multimediaview",*/
+               "navigationbar",
+               "notification",
+               "popup",
+               "progressbar",
+               "radio",
+               "searchbar",
+               "segmentcontrol",
+               "slider",
+               "swipe",
+               "tabbar",
+               "toggleswitch",
+               "tokentextarea",
+               "virtuallist",
+               "virtualgrid",
+       ]
+};
\ No newline at end of file
diff --git a/tests/additional-unit-tests/toggleswitch/index.html b/tests/additional-unit-tests/toggleswitch/index.html
new file mode 100755 (executable)
index 0000000..8cf810a
--- /dev/null
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<html>
+<head>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/jquery.js"></script>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.min.js"></script>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw.js"
+               data-framework-theme="tizen-white"
+               data-framework-viewport-scale=false>
+       </script>
+
+       <link rel="stylesheet" href="../../../libs/js/jquery-mobile-1.2.0/external/qunit.css" />
+
+       <script src="../../../libs/js/jquery-mobile-1.2.0/external/qunit.js"></script>
+       <script src="toggleswitch-tests.js"></script>
+
+       <title>Toggleswitch</title>
+</head>
+
+<body>
+
+<h1 id="qunit-header">Toggleswitch</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+
+<div id="qunit-fixture">
+
+       <div data-role="page" id="toggleswitch1">
+               <div data-role="header" data-position="fixed">
+                       <h1>Toggleswitch</h1>
+               </div>
+               <div data-role="content">
+                       <select data-role='slider' name='slider' id='newslider' >
+                               <option value='on'>On</option>
+                               <option value='off'>Off</option>
+                       </select>
+               </div>
+       </div>
+       
+       <div data-role="page" id="toggleswitch2">
+               <div data-role="header" data-position="fixed">
+                       <h1>Toggleswitch</h1>
+               </div>
+               <div data-role="content">               
+                       
+               </div>
+       </div>  
+</div>
+
+</body>
+</html>
diff --git a/tests/additional-unit-tests/toggleswitch/toggleswitch-tests.js b/tests/additional-unit-tests/toggleswitch/toggleswitch-tests.js
new file mode 100755 (executable)
index 0000000..a01f414
--- /dev/null
@@ -0,0 +1,86 @@
+/*
+ * Unit Test : Toggle Switch
+ *
+ *
+ */
+/*jslint browser: true*/
+/*global $, jQuery, test, equal, ok*/
+$( document ).ready( function ( ) {
+       module("toggleswitch" );
+
+       var unit_toggleswitch = function ( widget ) {
+               var toggleswitch ;
+
+               /* Create */
+               widget.slider( );
+               toggleswitch = widget.parent( ).find('.ui-slider-switch') ;
+               ok( toggleswitch, "Create" );
+
+               /* Class Check*/
+               equal( toggleswitch.hasClass('ui-slider'), true , "Class check" );
+
+               /*Markup check*/
+               equal( toggleswitch.find('span.ui-slider-label').length, 2 , "makrup check : 2 options present" );
+               equal( toggleswitch.find('span.ui-slider-label')[1].innerHTML, "On" , "makrup check : correct text in option" );
+               equal( toggleswitch.find('span.ui-slider-label')[0].innerHTML , "Off" , "makrup check : correct text in option" );
+               ok( toggleswitch.find('a.ui-slider-handle') , "makrup check : toggle handle present" );
+               equal( toggleswitch.find('a.ui-slider-handle').attr('title'), 'On', "makrup check : handle present" );
+               equal( toggleswitch.find('span.ui-slider-label')[1].style.width, '100%', "makrup check : 2 options present" );
+
+               /*check control after firing events*/
+               toggleswitch.trigger('vmousedown') ;
+               toggleswitch.trigger('vmouseup') ;
+               equal( toggleswitch.find('a.ui-slider-handle').attr('title'), 'Off', "Markup check after firing click event first time" );
+               equal( toggleswitch.find('span.ui-slider-label')[0].style.width, '100%', "Markup check after firing click event first time" );
+               equal( toggleswitch.find('span.ui-slider-label')[1].style.width, '0%', "Markup check after firing click event first time" );
+               toggleswitch.trigger('vmousedown') ;
+               toggleswitch.trigger('vmouseup') ;
+               equal( toggleswitch.find('a.ui-slider-handle').attr('title'), 'On', "Markup check after firing click event second time" );
+               equal( toggleswitch.find('span.ui-slider-label')[0].style.width, '0%', "Markup check after firing click event second time" );
+               equal( toggleswitch.find('span.ui-slider-label')[1].style.width, '100%', "Markup check after firing click event second time" );
+
+               /* Check Enable , Disbale */
+               widget.slider("disable" );
+               toggleswitch.trigger('vmousedown') ;
+               toggleswitch.trigger('vmouseup') ;
+               equal( toggleswitch.find('a.ui-slider-handle').attr('title'), 'On', "Markup check after firing click event after switch was disabled" );
+               equal( toggleswitch.find('span.ui-slider-label')[1].style.width, '100%', "Markup check after firing click event after switch was disabled" );
+               equal( toggleswitch.find('span.ui-slider-label')[0].style.width, '0%', "Markup check after firing click event after switch was disabled" );
+
+               widget.slider("enable" );
+               toggleswitch.trigger('vmousedown') ;
+               toggleswitch.trigger('vmouseup') ;
+               equal( toggleswitch.find('a.ui-slider-handle').attr('title'), 'Off', "Markup check after firing click event after switch was re enabled" );
+               equal( toggleswitch.find('span.ui-slider-label')[0].style.width, '100%', "Markup check after firing click event after switch was re enabled" );
+               equal( toggleswitch.find('span.ui-slider-label')[1].style.width, '0%', "Markup check after firing click event after switch was re enabled" );
+
+               /*refresh */
+               widget.find('option')[1].innerHTML = "False" ;
+               equal( toggleswitch.find('a.ui-slider-handle').attr('title'), 'Off', "API Refresh : Stoggleswitch is not modified before refresh is called" );
+               widget.slider('refresh') ;
+               equal( toggleswitch.find('a.ui-slider-handle').attr('title'), 'False', "API Refresh : Stoggleswitch is modified after refresh is called" );
+
+       };
+
+       test( "normal toggleswitch", function ( ) {
+               $('#toggleswitch1').page( ) ;
+               unit_toggleswitch( $("#newslider" ) );
+       } );
+
+       test( "normal toggleswitch -dynamic", function ( ) {
+               var createEvent = false ,
+                       toggleHTML = "<select data-role='slider'name='slider'id='dynamicslider'data-texton='true'>" +
+                                                                               "<option value='on'>On</option>" +
+                                                                               "<option value='off'>Off</option>" +
+                                                                       "</select>;";
+
+               $('#toggleswitch2').page( ) ;
+               $('#toggleswitch2').find(":jqmData(role=content)" ).append( toggleHTML );
+               $('#dynamicslider').slider( {create : function ( ) {
+                       createEvent = true ;
+               }} ) ;
+               $('#toggleswitch2').find(":jqmData(role=content)" ).trigger("create" );
+               equal( createEvent, true, "Create Event" );
+               unit_toggleswitch( $("#dynamicslider" ) );
+       } );
+} );
diff --git a/tests/additional-unit-tests/tokentextarea/index.html b/tests/additional-unit-tests/tokentextarea/index.html
new file mode 100755 (executable)
index 0000000..76d3f26
--- /dev/null
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<html>
+<head>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/jquery.js"></script>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.min.js"></script>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw.js"
+               data-framework-theme="tizen-white"
+               data-framework-viewport-scale=false>
+       </script>
+
+
+       <link rel="stylesheet" href="../../../libs/js/jquery-mobile-1.2.0/external/qunit.css" />
+
+       <script src="../../../libs/js/jquery-mobile-1.2.0/external/qunit.js"></script>
+       <script src="tokentextarea-tests.js"></script>
+
+       <title>Tokentextarea</title>
+</head>
+
+<body>
+
+<h1 id="qunit-header">Tokentextarea</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+
+<div id="qunit-fixture">
+
+       <div data-role="page" id="notifiaction0">
+               <div data-role="notification" id="smallpopup" data-type="popup" data-text1="text1" data-param="param"></div>
+               <div data-role="header" data-position="fixed">
+                       <h1>Tokentextarea</h1>
+               </div>
+               <div data-role="content">
+               </div>
+       </div>
+
+       <div data-role="page" id="notification1">
+               <div data-role="tokentextarea" id="tokentextarea-test"  data-label='To:' data-description='description123' data-link='#address'></div>          
+               <div data-role="header" data-position="fixed">
+                       <h1>Tokentextarea</h1>
+               </div>
+               <div data-role="content">
+               </div>
+       </div>
+
+</div>
+
+</body>
+</html>
diff --git a/tests/additional-unit-tests/tokentextarea/tokentextarea-tests.js b/tests/additional-unit-tests/tokentextarea/tokentextarea-tests.js
new file mode 100755 (executable)
index 0000000..6ab53a8
--- /dev/null
@@ -0,0 +1,98 @@
+/*
+ * Unit Test : tokentextarea
+ *
+ * Kangsik Kim <kangsik81.kim@samsung.com>
+ * Minkyeong Kim <minkyeong.kim@samsung.com>
+ */
+/*jslint browser: true*/
+/*global $, jQuery, test, equal, ok*/
+( function ( $ ) {
+       module( "Tokentextarea" );
+
+       var unit_tokentextarea = function ( widget, type, options ) {
+               var tokentextarea,
+                       inputText,
+                       outputText,
+                       status,
+                       selectEvent = false ,
+                       addEvent = false,
+                       removeEvent = false;
+
+               /* Create */
+               tokentextarea = widget.tokentextarea( );
+               ok( tokentextarea.length > 0, "Create" );
+
+               /*markup*/
+               equal( widget.jqmData('label'), options.lable, 'Property : data-label') ;
+               equal( widget.find('label.ui-tokentextarea-label').html( ), options.lable, 'Property : data-label') ;
+               equal( widget.jqmData('description'), options.description, 'Property : data-description') ;
+               equal( widget.jqmData('link'), options.link, 'Property : data-link') ;
+               equal( widget.find( "input" ).hasClass('ui-tokentextarea-input'), true, "Markup Check" );
+               equal( widget.find( "label" ).hasClass('ui-tokentextarea-label'), true, "Markup Check" );
+               equal( widget.find( "a" ).hasClass('ui-tokentextarea-link-base'), true, "Markup Check" );
+               equal( widget.find( "a" ).attr('href'), '#address', "Markup Check" );
+
+               /*bind events*/
+               tokentextarea.bind('select', function ( ) {
+                       selectEvent = true ;
+               } ) ;
+               tokentextarea.bind('add', function ( ) {
+                       addEvent = true ;
+               } ) ;
+               tokentextarea.bind('remove', function ( ) {
+                       removeEvent = true ;
+               } ) ;
+
+               /* length */
+               equal( tokentextarea.tokentextarea( "length" ), 0, "API : length" );
+
+               /* Add */
+               tokentextarea.tokentextarea( "add", "string1" );
+               //equal( addEvent, true, "Event : add" ) ;
+               equal( tokentextarea.tokentextarea( "length" ), 1, "API : add('string1')" );
+               tokentextarea.tokentextarea( "add", "string2" );
+               equal( tokentextarea.tokentextarea( "length" ), 2, "API : add('string2')" );
+               tokentextarea.tokentextarea( "add", "string3" );
+               equal( tokentextarea.tokentextarea( "length" ), 3, "API : add('string3')" );
+               equal( widget.find(".ui-tokentextarea-block" ).length, 3, 'API : count number of elements after add') ;
+
+
+               /* Select */
+               tokentextarea.tokentextarea( "select", 1 );
+               //equal( selectEvent, true, "Event : select" ) ;
+               outputText = tokentextarea.tokentextarea( "select" );
+               equal( outputText, "string2", "API : select( 1 )" );
+
+               /* Focus Out */
+               tokentextarea.tokentextarea( "focusOut" );
+               status = tokentextarea.hasClass( "ui-tokentextarea-focusout" );
+               equal( status, true, "API : focusOut" );
+
+               /* Focus In */
+               tokentextarea.tokentextarea( "focusIn" );
+               status = tokentextarea.hasClass( "ui-tokentextarea-focusin" );
+               equal( status, true, "API : focusIn" );
+
+               /* Remove */
+               tokentextarea.tokentextarea( "remove", 0 );
+               //equal( removeEvent, true, "Event : remove" ) ;
+               equal( tokentextarea.tokentextarea( "length" ), 2 , "API : remove( 0 )" );
+               equal( widget.find(".ui-tokentextarea-block" ).length, 2, 'API : API : remove( 0 )') ;
+
+               /* Reamove all */
+               tokentextarea.tokentextarea( "remove" );
+               equal( tokentextarea.tokentextarea( "length" ), 0, "API : remove" );
+               equal( widget.find(".ui-tokentextarea-block" ).length, 0, 'API : API : remove all') ;
+
+               /* input */
+               inputText = "tokentextarea";
+               tokentextarea.tokentextarea( "inputText", inputText );
+               outputText = tokentextarea.tokentextarea( "inputText" );
+               equal( outputText, inputText, "API : input('" + outputText + "')" );
+       };
+
+       test( "Tokentextarea", function ( ) {
+               unit_tokentextarea( $( "#tokentextarea-test" ), "tokentextarea", { lable : 'To:', description : "description123", link : '#address' } );
+       } );
+
+} ( jQuery ) );
diff --git a/tests/additional-unit-tests/virtualgrid/index.html b/tests/additional-unit-tests/virtualgrid/index.html
new file mode 100755 (executable)
index 0000000..03fada0
--- /dev/null
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<html>
+       <head>
+               <script src="../../../build/tizen-web-ui-fw/latest/js/jquery.js"></script>
+               <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.min.js"></script>
+               <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw.js"
+                       data-framework-theme="tizen-white"
+                       data-framework-viewport-scale=false>
+               </script>
+
+               <link rel="stylesheet" href="../../../libs/js/jquery-mobile-1.2.0/external/qunit.css" />
+               <script src="../../../libs/js/jquery-mobile-1.2.0/external/qunit.js"></script>
+               <script src="virtualgrid-tests.js"></script>
+               <title>Virtualgrid</title>
+       </head>
+
+       <body>
+               <h1 id="qunit-header">Virtualgrid</h1>
+               <h2 id="qunit-banner"></h2>
+               <div id="qunit-testrunner-toolbar"></div>
+               <h2 id="qunit-userAgent"></h2>
+               <ol id="qunit-tests"></ol>
+
+               <div id="qunit-fixture">
+                       <div data-role="page" id="virtualgrid_demo_page" class="virtualgrid_demo_page">
+                               <div data-role="header" data-position="fixed">
+                                       <h1>Virtualgrid</h1>
+                               </div>
+                               <div data-role="content">
+                                       <script id="tizen-demo-namecard" type="text/x-jquery-tmpl">
+                                               <div class="ui-demo-namecard">
+                                                       <div class="ui-demo-namecard-pic">
+                                                       </div>
+                                                       <div class="ui-demo-namecard-contents">
+                                                               <span class="name ui-li-text-main">${NAME}</span>
+                                                       </div>
+                                               </div>
+                                       </script>
+                                       <div id="virtualgrid-test" data-direction="y" data-role="virtualgrid" data-rotation="true" data-template="tizen-demo-namecard" data-dbtable="JSON_DATA" style="width: 500px;height:600px;"></div>
+                                       <script>
+                                               $( ".virtualgrid_demo_page" ).live( "pagecreate", function() {
+                                                       console.log("pagecreate...");
+                                                       $.getScript( "../../../demos/tizen-winsets/widgets/grid/js/virtualgrid-db-demo.js", function( data, textStatus ) {
+                                                               $(document).trigger("dataloaded");
+                                                       });
+                                               });
+                                       </script>
+                               </div>
+                       </div>
+               </div>
+       </body>
+</html>
diff --git a/tests/additional-unit-tests/virtualgrid/virtualgrid-tests.js b/tests/additional-unit-tests/virtualgrid/virtualgrid-tests.js
new file mode 100755 (executable)
index 0000000..f86e583
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * Unit Test : virtual grid
+ *
+ * Kangsik Kim <kangsik81.kim@samsung.com>
+ */
+/*jslint browser: true*/
+/*global $, jQuery, test, equal, ok, JSON_DATA, notEqual*/
+( function ( $ ) {
+       module("Virtualgrid" );
+
+       var unit_virtualgrid = function ( widget, type ) {
+               var virtualGrid,
+                       idx,
+                       index = 0,
+                       $items,
+                       $item;
+
+               /* Create */
+               virtualGrid = widget.virtualgrid( "create" , {
+                       itemData : function ( idx ) {
+                               return JSON_DATA[ idx ];
+                       },
+                       numItemData : JSON_DATA.length,
+                       cacheItemData : function ( minIdx, maxIdx ) { }
+               } );
+               ok( virtualGrid, "Create" );
+
+               $(".virtualgrid_demo_page" ).bind("select", function ( event ) {
+                       ok( true, "Event : select" );
+               } );
+
+               $(".virtualgrid_demo_page" ).bind("test.resize", function ( event ) {
+                       var prevColCnt = 0 ;
+                       $item = $(".ui-virtualgrid-wrapblock-y:first" );
+                       prevColCnt = $item.children( ).length;
+                       $("#virtualgrid-test" ).css("width", "1500px" );
+                       widget.virtualgrid("resize" );
+                       $item = $(".ui-virtualgrid-wrapblock-y:first" );
+                       notEqual( $item.children( ).length, prevColCnt, "Event : resize" );
+               } );
+
+               $( $(".virtualgrid_demo_page" ).find(".ui-scrollview-view" ) ).find(".ui-virtualgrid-wrapblock-y:first" ).addClass("center" );
+               widget.virtualgrid("centerTo", "center" );
+               $items = $( $(".virtualgrid_demo_page" ).find(".ui-scrollview-view" ) ).find(".ui-virtualgrid-wrapblock-y" );
+               for ( idx = 0 ; idx < $items.length ; idx += 1 ) {
+                       if ( $( $items[idx] ).hasClass("center" ) ) {
+                               index = idx;
+                               break;
+                       }
+               }
+
+               notEqual( index, 0, "API : centerTo" );
+
+               $item = $( $(".ui-virtualgrid-wrapblock-y:first" ).children( )[0] );
+               $item.trigger("click" );
+               $item.trigger("test.resize" );
+
+               /*jqmData*/
+               equal( widget.jqmData('direction'), 'y', "jqmData : direction" ) ;
+               equal( widget.jqmData('rotation'), true, "jqmData : rotation" ) ;
+               equal( widget.jqmData('template'), 'tizen-demo-namecard', "jqmData : template" ) ;
+               equal( widget.jqmData('dbtable'), 'JSON_DATA', "jqmData : dbtable" ) ;
+
+       };
+
+       $( document ).bind("dataloaded" , function ( ) {
+               test( "Virtualgrid", function ( ) {
+                       unit_virtualgrid( $("#virtualgrid-test" ), "virtualgrid" );
+               } );
+       } );
+} ( jQuery ) );
diff --git a/tests/additional-unit-tests/virtuallist/index.html b/tests/additional-unit-tests/virtuallist/index.html
new file mode 100755 (executable)
index 0000000..587d2c1
--- /dev/null
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html>
+       <head>
+               <script src="../../../build/tizen-web-ui-fw/latest/js/jquery.js"></script>
+               <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.min.js"></script>
+               <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw.js"
+                       data-framework-theme="tizen-white"
+                       data-framework-viewport-scale=false>
+               </script>
+
+               <link rel="stylesheet" href="../../../libs/js/jquery-mobile-1.2.0/external/qunit.css" />
+               <script src="../../../libs/js/jquery-mobile-1.2.0/external/qunit.js"></script>
+               <script src = "../../../demos/tizen-winsets/widgets/list/virtuallist-db-demo.js"></script>
+               <script src="virtuallist-tests.js"></script>
+               <title>Virtuallist</title>
+       </head>
+
+       <body>
+               <h1 id="qunit-header">Virtuallist</h1>
+               <h2 id="qunit-banner"></h2>
+               <div id="qunit-testrunner-toolbar"></div>
+               <h2 id="qunit-userAgent"></h2>
+               <ol id="qunit-tests"></ol>
+
+               <div id="qunit-fixture">
+                       <div data-role="page" id="dummy-page">                          
+                               <div data-role="header" data-position="fixed">
+                                       <h1>Dummy</h1>
+                               </div>
+                               <div data-role="contents">
+                               </div>
+                       </div>
+                       <div data-role="page" id="virtuallist-unit-test" data-add-back-btn="true">                              
+                               <div data-role="header" data-position="fixed">
+                                       <h1>Virtual List - Normal Style 1line</h1>
+                               </div>
+                               <div data-role="content">
+                                       <script id="tmp-1line" type="text/x-jquery-tmpl">
+                                               <li class="ui-li-1line"><span class="ui-li-text-main">${NAME}</span></li>
+                                       </script>
+                                       <script id="tmp-2line" type="text/x-jquery-tmpl">
+                                               <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" data-row="100">
+                                       </ul>
+                               </div>
+                       </div>
+               </div>
+       </body>
+</html>
diff --git a/tests/additional-unit-tests/virtuallist/virtuallist-tests.js b/tests/additional-unit-tests/virtuallist/virtuallist-tests.js
new file mode 100755 (executable)
index 0000000..32c5ae9
--- /dev/null
@@ -0,0 +1,100 @@
+/*
+ * Unit Test : Virtual list
+ *
+ * Wongi Lee <wongi11.lee@samsung.com>
+ */
+/*jslint browser: true*/
+/*global $, jQuery, test, equal, ok, JSON_DATA*/
+$( document ).ready( function ( ) {
+
+       module( "Virtual List" );
+
+       function startVirtualListTest( ) {
+
+               var $vlContainer = $( "ul.ui-virtual-list-container" ),
+                       $vlElements = $( "ul.ui-virtual-list-container li" ),
+                       vlHeight = $vlContainer.css( "height" ),
+                       vlOptions = $( "#virtuallist-normal_1line_ul" ).virtuallistview( "option" );
+
+               test( "Virtual list test", function ( ) {
+                       var destoyedVlElements ;
+
+                       /* Initialize and create method */
+                       $( "#virtuallist-normal_1line_ul" ).virtuallistview( );
+                       ok( $vlContainer );
+                       equal( $vlElements.length, 100 );
+                       ok( parseInt( vlHeight, 10 ) > 3000 );
+
+                       /* Options */
+                       equal( vlOptions.id, "#virtuallist-normal_1line_ul" );
+                       equal( vlOptions.childSelector, " li" );
+                       equal( vlOptions.dbtable, "JSON_DATA" );
+                       equal( vlOptions.template, "tmp-1line" );
+                       equal( vlOptions.row, 100 );
+                       equal( vlOptions.dbkey, false );
+                       equal( vlOptions.scrollview, true );
+
+
+                       /* Destroy method */
+                       ok ( ( function ( ) {
+                               /* Call destroy */
+                               $( "#virtuallist-normal_1line_ul" ).virtuallistview( "destroy" );
+
+                               destoyedVlElements = $( "ul.ui-virtual-list-container li" );
+                               console.log( destoyedVlElements.length );
+
+                               try {
+                                       equal ( destoyedVlElements.length, 0 );
+                               } catch ( exception ) {
+                                       console.log( "destroy : " + exception );
+                                       return false;
+                               }
+                               return true;
+                       } ( ) ), "destroy( )" );
+               } );
+       }
+
+       var startVirtualListTestDynamic = function ( ) {
+               /* dynamic testing */
+               $('#virtuallist-normal_1line_ul').remove( );
+               var VirtualMarkup = '<ul id= "virtuallist-normal_1line_ul" data-role= "virtuallistview" data-template= "tmp-1line" data-dbtable= "JSON_DATA" data-row= "100"></ul>';
+               $('#virtuallist-unit-test').find(":jqmData(role=content)" ).append( VirtualMarkup ).trigger("create" );
+
+               $.getScript( "../../../demos/tizen-winsets/widgets/list/virtuallist-db-demo.js", function ( data, textStatus ) {
+                       $( "ul" ).filter( function ( ) {
+                               return $( this ).data( "role" ) == "virtuallistview";
+                       } ).addClass( "vlLoadSuccess" );
+
+                       $("ul.ui-virtual-list-container" ).virtuallistview( "create", {
+                               itemData : function ( idx ) {
+                                       return JSON_DATA[ idx ];
+                               },
+                               numItemData : JSON_DATA.length,
+                               cacheItemData : function ( minIdx, maxIdx ) {
+                               }
+                       } );
+                       startVirtualListTest( );
+               } );
+
+       } ;
+
+       /* Load Dummy Data and Init Virtual List widget*/
+       if ( window.JSON_DATA ) {
+               $( "ul" ).filter( function ( ) {
+                       return $( this ).data( "role" ) == "virtuallistview";
+               } ).addClass( "vlLoadSuccess" );
+
+               // trigger pagecreate
+               $( "#virtuallist-unit-test" ).page( );
+
+               $( "ul.ui-virtual-list-container" ).virtuallistview( "create" );
+
+               startVirtualListTest( );
+
+               startVirtualListTestDynamic( ) ;
+
+
+       } else {
+               console.log ( "Virtual List Init Fail." );
+       }
+} );
diff --git a/tests/unit-tests/listdivider/index.html b/tests/unit-tests/listdivider/index.html
new file mode 100755 (executable)
index 0000000..e378211
--- /dev/null
@@ -0,0 +1,78 @@
+<!DOCTYPE html>
+<html>
+<head>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/jquery.js"></script>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.min.js"></script>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw.js"
+               data-framework-theme="tizen-white"
+               data-framework-viewport-scale=false>
+       </script>
+
+       <link rel="stylesheet" href="../../../libs/js/jquery-mobile-1.2.0/external/qunit.css" />
+
+       <script src="../../../libs/js/jquery-mobile-1.2.0/external/qunit.js"></script>
+       <script src="listdivider-tests.js"></script>
+
+       <title>Listdivider</title>
+</head>
+
+<body>
+
+<h1 id="qunit-header">List divider</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+
+<div id="qunit-fixture">
+
+       <div data-role="page">
+               <div data-role="header" data-position="fixed">
+                       <h1>List divider</h1>
+               </div>
+               <div class="content" data-role="content" data-scroll="y">
+                       <ul id="listview1" data-role="listview">
+                               <li data-role="list-divider">Item styles</li>
+                               <li><a href="#">Normal lists</a></li>
+                               <li><a href="#">Normal lists</a></li>
+                               <li><a href="#">Normal lists</a></li>
+                               <li data-role="list-divider">Item styles</li>
+                               <li><a href="#">Normal lists</a></li>
+                               <li><a href="#">Normal lists</a></li>
+                               <li><a href="#">Normal lists</a></li>
+                               <li data-role="list-divider">Item styles</li>
+                               <li><a href="#">Normal lists</a></li>
+                               <li><a href="#">Normal lists</a></li>
+                               <li><a href="#">Normal lists</a></li>
+                       </ul>
+               </div>
+       </div>
+
+       <div id="listdivdier_group" data-role="page">
+               <div data-role="header" data-position="fixed">
+                       <h1>Groupped Divider </h1>
+               </div>
+               <div class="content" data-role="content" data-scroll="y">
+                       <ul id="listview2" data-role="listview">
+                               <li data-role="list-divider" data-style="check"><form><input type="checkbox"  name="c2line-check1" /></form>Item styles</li>
+                               <li><a href="#" >Normal lists</a></li>
+                               <li><a href="#" >Normal lists</a></li>
+                               <li><a href="#" >Normal lists</a></li>
+                               <li data-role="list-divider" data-style="check"><form><input type="checkbox"  name="c2line-check1" /></form>Item styles</li>
+                               <li><a href="#" >Normal lists</a></li>
+                               <li><a href="#" >Normal lists</a></li>
+                               <li><a href="#" >Normal lists</a></li>
+                               <li data-role="list-divider" data-style="check"><form><input type="checkbox"  name="c2line-check1" /></form>Item styles</li>
+                               <li><a href="#" >Normal lists</a></li>
+                               <li><a href="#" >Normal lists</a></li>
+                               <li><a href="#" >Normal lists</a></li>
+                       </ul>
+               </div>
+               <div data-role="footer">
+               </div>
+       </div>
+
+</div>
+
+</body>
+</html>
diff --git a/tests/unit-tests/listdivider/listdivider-tests.js b/tests/unit-tests/listdivider/listdivider-tests.js
new file mode 100644 (file)
index 0000000..82a34f3
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Unit Test: listdivider
+ *
+ * Hyunjung Kim <hjnim.kim@samsung.com>
+ */
+
+(function ($) {
+       module("Listdivider");
+
+       var unit_listdivider = function ( widget ) {
+               var listdivdierDynamic = '<li data-role= "list-divider">Item styles</li>';
+               equal( widget.find(":jqmData(role=list-divider)").length, 3, "List dividers count");
+               widget.find(":jqmData(role=list-divider)").each( function( ) {
+                       equal( $(this).text().trim(), "Item styles", "List divider text check" )
+               } );
+               equal( widget.find('li.ui-li-divider').length, 3, "CSS check : list dividers count");
+
+               $( listdivdierDynamic ).appendTo( widget );
+               $( widget ).listview("refresh");
+
+               equal( widget.find(":jqmData(role=list-divider)").length, 4, "List dividers count");
+               widget.find(":jqmData(role=list-divider)").each( function( ) {
+                       equal( $(this).text().trim(), "Item styles", "List divider text check" )
+               } );
+       };
+
+       var unit_listcheckdivider = function ( widget ) {
+               unit_listdivider( widget );
+               equal(  widget.find('li.ui-li-has-checkbox').length, widget.find('li.ui-li-divider').length - 1, "List checkbox divider count check");
+       };
+
+       test( "Listdivider", function () {
+               $("#listview1").listview();
+               unit_listdivider( $("#listview1") );
+       });
+
+       test( "listdivdier_group", function() {
+               $("#listdivdier_group").page( );
+               $("#listview2").listview();
+               unit_listcheckdivider( $("#listview2") );
+       });
+}( jQuery ));
diff --git a/tests/unit-tests/progress/index.html b/tests/unit-tests/progress/index.html
new file mode 100755 (executable)
index 0000000..0d05f86
--- /dev/null
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<html>
+<head>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/jquery.js"></script>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.min.js"></script>
+       <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw.js"
+               data-framework-theme="tizen-white"
+               data-framework-viewport-scale=false>
+       </script>
+
+       <link rel="stylesheet" href="../../../libs/js/jquery-mobile-1.2.0/external/qunit.css" />
+
+       <script src="../../../libs/js/jquery-mobile-1.2.0/external/qunit.js"></script>
+       <script src="progress-tests.js"></script>
+
+       <title>Progress</title>
+</head>
+
+<body>
+
+<h1 id="qunit-header">Progressbar</h1>
+<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests"></ol>
+
+<div id="qunit-fixture">
+
+       <div data-role="page" id="progress_demo">
+               <div data-role="header" data-position="fixed">
+                       <h1>Progressbar</h1>
+               </div>
+               <div data-role="content">
+                       <ul data-role="listview">
+                               <li><div data-role="progressing" data-style="pending" id="pending"></div></li>
+                               <li><div data-role="progressing" data-style="circle" id="progressing"></div></li>
+                       </ul>
+               </div>
+       </div>
+
+</div>
+
+</body>
+</html>
diff --git a/tests/unit-tests/progress/progress-tests.js b/tests/unit-tests/progress/progress-tests.js
new file mode 100644 (file)
index 0000000..8ffe234
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Unit Test: Progress
+ *
+ * Minkyu Kang <mk7.kang@samsung.com>
+ */
+
+(function ($) {
+       module("Progress");
+
+       var unit_progress = function ( widget, type ) {
+               var progress,
+                       elem = ".ui-progress-" + type,
+                       _class = "ui-progress-" + type + "-running";
+
+               widget.progress();
+
+               /* Create */
+               progress = widget.find( elem );
+               ok( progress, "Create" );
+
+               /* Option */
+               equal( widget.progress( "option", "style" ), type, "Option: style" );
+
+               /* Running */
+               widget.progress( "running", true );
+               progress = widget.find( elem );
+               equal( progress.hasClass( _class ), true, "API: running" );
+
+               /* Stop */
+               widget.progress( "running", false );
+               progress = widget.find( elem );
+               equal( progress.hasClass( _class ), false, "API: stop" );
+       };
+
+       test( "pending bar", function () {
+               unit_progress( $("#pending"), "pending" );
+       });
+
+       test( "processing circle", function () {
+               unit_progress( $("#progressing"), "circle" );
+       });
+}( jQuery ));
index 4bd0f3f..5dfe65b 100755 (executable)
@@ -33,8 +33,6 @@
                <div data-role="content">
                        <ul data-role="listview">
                                <li><div data-role="progressbar" id="progressbar"></div></li>
-                               <li><div data-role="progressing" data-style="pending" id="pending"></div></li>
-                               <li><div data-role="progressing" data-style="circle" id="progressing"></div></li>
                        </ul>
                </div>
        </div>
index c9f6832..1b75bc2 100644 (file)
                }
        };
 
-       var unit_progress = function ( widget, type ) {
-               var progress,
-                       elem = ".ui-progress-" + type,
-                       _class = "ui-progress-" + type + "-running";
-
-               widget.progress();
-
-               /* Create */
-               progress = widget.find( elem );
-               ok( progress, "Create" );
-
-               /* Option */
-               equal( widget.progress( "option", "style" ), type, "Option: style" );
-
-               /* Running */
-               widget.progress( "running", true );
-               progress = widget.find( elem );
-               equal( progress.hasClass( _class ), true, "API: running" );
-
-               /* Stop */
-               widget.progress( "running", false );
-               progress = widget.find( elem );
-               equal( progress.hasClass( _class ), false, "API: stop" );
-       };
-
        test( "progressbar", function () {
                unit_progressbar( $("#progressbar") );
        });
-
-       test( "pending bar", function () {
-               unit_progress( $("#pending"), "pending" );
-       });
-
-       test( "processing circle", function () {
-               unit_progress( $("#progressing"), "circle" );
-       });
 }( jQuery ));
index 14689e1..7963c9b 100755 (executable)
@@ -14,6 +14,7 @@ var TESTS = {
                "popupwindow",
                "popupwindow_ctxpopup",
                "progressbar",
+               "progress",
                "radio",
                "searchbar",
                "segmentcontrol",
index 450a5c7..f25554a 100755 (executable)
@@ -1,6 +1,7 @@
 #!/bin/bash
 
-WIDGET_BASE_DIR="$1"
+WIDGET_FNAME=$1
+WIDGET_BASE_DIR="`dirname ${WIDGET_FNAME}`"
 VERBOSE=$(test "x$2x" != "xx" && echo "1" || echo "0")
 
 rm_tmpfile() # No args
@@ -200,19 +201,20 @@ process_fname() # $1 = file name, n_pass
 }
 
 if test "x${WIDGET_BASE_DIR}x" = "xx"; then
-  echo "Usage: $(basename $0) <widget_base_dir>"
+  echo "Usage: $(basename $0) <widget_file_path>"
   exit 1
 fi
 
-for FNAME in ${WIDGET_BASE_DIR}/js/*.js; do
-  TMP_FNAME=`mktemp`
-  N_PASS=0
-  while ! process_fname $FNAME $N_PASS > $TMP_FNAME; do 
-    if test $VERBOSE -eq 1; then
-        echo "Going for another pass with ${TMP_FNAME}" > /dev/stderr
-    fi
-    N_PASS=`expr "$N_PASS" + 1`
-  done
-  cat $TMP_FNAME
-  rm_tmpfile
+FNAME=${WIDGET_FNAME}
+TMP_FNAME=`mktemp`
+N_PASS=0
+while ! process_fname $FNAME $N_PASS > $TMP_FNAME; do 
+       if test $VERBOSE -eq 1; then
+               echo "Going for another pass with ${TMP_FNAME}" > /dev/stderr
+       fi
+       N_PASS=`expr "$N_PASS" + 1`
 done
+cat $TMP_FNAME
+rm_tmpfile
+
+
diff --git a/tools/moduledep.js b/tools/moduledep.js
new file mode 100644 (file)
index 0000000..555279e
--- /dev/null
@@ -0,0 +1,329 @@
+#!/usr/bin/env node
+/*
+ * moduledep.js
+ *
+ * Read dependency info from a file, and get dependency tree/library load order 
+ * from the dependency info of all files
+ *
+ * ***************************************************************************
+ * Copyright (c) 2013 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: Youmin Ha <youmin.ha@samsung.com>
+*/
+
+var util = require("util"),
+       assert = require("assert"),
+       path = require("path"),
+       vm = require("vm"),
+       fs = require("fs"),
+       child_process = require('child_process'),
+       puts = util.puts,
+       error = util.error,
+       print = util.print;
+
+path.sep = path.sep ? path.sep : '/';
+
+function DepInfo( fPath, basedir ) {
+       var self = this,
+               code,
+               context,
+               origDir,
+               linebuf,
+               line;
+
+       function define( depModList, moduleBody ) {
+               var p, i;
+               if ( typeof depModList == 'object' ) {
+                       for( i in depModList ) {
+                               p = path.join( path.dirname( self.filePath() ), depModList[i] );
+                               self.depends.push( path.normalize( p, '.js' ) );
+                       }
+               }
+       }
+
+       origDir = path.resolve();       // Backup origDir
+
+       if ( ! basedir || ! basedir.length ) {
+               basedir = ".";
+       }
+       process.chdir( basedir );       // Move to basedir
+       self.basedir = path.resolve( );         //self.basedir: absolute path.
+       self.path = path.normalize( fPath );
+       self.name = path.join( path.dirname( self.path ), path.basename( self.path, '.js' ) );
+       self.depends = [ ];
+       self.label = '';
+       self.group = '';
+       self.description = '';
+
+       try {
+               code = fs.readFileSync( self.path, 'utf-8' );
+               linebuf = code.split( /\n\r?/ );
+               for( var idx in linebuf ) {
+                       line = linebuf[idx];
+                       if( line.match( /^\/\/>>label:/ ) ) {
+                               self.label = line.replace( /^\/\/>>label:(.*)$/, "$1" ).trim();
+                       }
+                       if( line.match( /^\/\/>>group:/ ) ) {
+                               self.group = line.replace( /^\/\/>>group:(.*)$/, "$1" ).trim();
+                       }
+                       if( line.match( /^\/\/>>description:/ ) ) {
+                               self.description = line.replace( /^\/\/>>description:(.*)$/, "$1" ).trim();
+                       }
+               }
+               context = vm.createContext( { define: define } );
+               vm.runInContext( code, context );       // Set depends
+       } catch ( e ) {
+               // file read failure
+               //error(e);
+               return null;
+       } finally {
+               process.chdir( origDir );       // Back to origDir
+       }
+}
+DepInfo.prototype = {
+       fullPath: function ( ) {
+               return path.normalize( path.join( this.basedir, this.path ) );
+       },
+       filePath: function ( ) {
+               return path.relative( this.basedir, this.fullPath() );
+       }
+}
+
+function DepTree( ) {
+       return this;
+}
+DepTree.prototype = {
+       _depData: { },
+
+       // Set basedir(s)
+       setBasedir: function ( ) {
+               this.basedir = arguments[0];
+       },
+
+       // Add dependency data from file at the path
+       // @param[in]   fPath   module file's path
+       // @return      true if collection is successful, false if not
+       add: function ( fPath ) {
+               var di;
+
+               di = new DepInfo( fPath, this.basedir );
+               if ( di ) {
+                       this._depData[ di.name ] = di;
+               } else {
+                       return false;
+               }
+               return true;
+       },
+       depData: function ( ) {
+               return this._depData;
+       },
+       order: function ( reqList ) {
+               var self = this,
+                       depData = {},
+                       order = [],
+                       pool = [],
+                       mName,  // current module name
+                       mDep,   // current module's dependency (array)
+                       depIdx,
+                       i, j;
+
+               if( ! reqList ) {
+                       reqList = Object.keys( self._depData );
+               }
+
+               // copy _depData into pool & depData
+               for( j=0; j<reqList.length; j++ ) {
+                       modName = reqList[j];
+                       pool.push( modName );
+                       depData[ modName ] = [];
+                       for( i in self._depData[ modName ].depends ) {
+                               // deep copy
+                               depData[ modName ][i] = self._depData[ modName ].depends[i];
+
+                               // Still not exist in the reqList, add it
+                               if( reqList.indexOf( depData[ modName ][i] ) == -1 ) {
+                                       //error("NOT found! " + depData[ modName ][i] );
+                                       reqList.push( depData[ modName ][i] );
+                               }
+                       }
+               };
+
+               // Mark and sweep
+               while( pool.length > 0 ) {
+                       // Sort pool with remained dependency
+                       pool.sort( function ( a, b ) {
+                               var la, lb;
+                               la =  depData[ a ] ? depData[ a ].length : 0;
+                               lb =  depData[ b ] ? depData[ b ].length : 0;
+                               return la - lb;
+                       } );
+
+                       // Sweep
+                       mName = pool.shift();   // Pop a module name
+                       order.push( mName );    // Add first module to the order (Don't consider whether depData[mName].length == 0.
+
+                       // and Mark
+                       for( i = 0; i < pool.length; i++ ) {    // For all remained modules,
+                               mDep = depData[ pool[i] ];      // Get a dependency list
+                               depIdx = mDep.indexOf( mName );
+                               if ( depIdx != -1 ) {   // Found a dependency!
+                                       mDep.splice( depIdx, 1 );       // Remove mName module
+                               }
+                       }
+               }
+               return order;
+       },
+       construct: function ( ) {
+               var dd = this._depData,
+                       di,
+                       i, j, m;
+               for( i in dd ) {
+                       di = dd[i];             // Get DependencyInfo
+                       for( j in di.depends ) {
+                               m = di.depends[ j ];    // Per dependent module,
+                               if ( ! dd[ m ] ) {              // if there is no module in depData,
+                                       this.add( m );          // add it.
+                               }
+                       }
+               }
+       },
+       import: function ( depData ) {
+               var i;
+               this._depData = depData;
+       },
+       printDepJSON: function ( ) {
+               puts( JSON.stringify( this._depData, null, '\t' ) );
+       }
+};
+
+// Export modules
+module.exports.DepInfo = DepInfo;
+module.exports.DepTree = DepTree;
+
+// main module
+function main( argv ) {
+       var option = argv[2],
+               val = argv[3];
+
+       switch( option ) {
+               case '-c':
+                       createDepInfo( val );
+                       break;
+               case '-d':
+                       calculateDepOrder( val, argv[4], argv[5] );
+                       break;
+               default:
+                       usage();
+       }
+
+       function usage() {
+               error("Usage: " + path.basename( argv[1] ) + " [option] [argument]" );
+               error("       " + path.basename( argv[1] ) + " -c [module directory path] : Create a dependency data" );
+               error("       " + path.basename( argv[1] ) + " -d [module directory path] [depData.json path] [require file path]: Calculate a dependency order, and make a library" );
+               process.exit();
+       }
+
+       function createDepInfo( basedir ) {
+               var dt,
+                       origdir = path.resolve();       // Remember original dir
+
+               if( ! basedir ) basedir = '.';
+
+               dt = new DepTree();
+               dt.setBasedir( basedir );
+
+               child_process.exec('find ' + basedir +  ' -name "*.js" -type f',
+                       function ( err, stdout, stderr ) {
+                               var fpathlist,
+                                       fpath,
+                                       i;
+
+                               if( err ) {
+                                       error( 'Failure finding js files in ' + basedir );
+                                       process.chdir( origdir );
+                                       process.exit(1);
+                               }
+                               fpathlist = stdout.split(/\r?\n/);
+                               for( i in fpathlist ) {
+                                       fpath = fpathlist[i];
+                                       fpath =  path.relative( basedir, fpath );
+                                       //puts(">> " + fpath + " ? " + fpath.match( /.*\.js$/ ) );
+                                       if( fpath.match( /.*\.js$/ ) ) {
+                                               dt.add( fpath );
+                                       }
+                               }
+                               dt.construct();
+                               dt.printDepJSON();
+                       } );
+       }
+
+       function calculateDepOrder( modPath, depDataPath, requirePath ) {
+               var dt = new DepTree(),
+                       depData,
+                       require = null,
+                       code,
+                       context,
+                       order,
+                       mod,
+                       i;
+
+               function _require( depList ) {
+                       var i;
+                       for( i in depList ) {
+                               //dt.add( depList[i] );
+                               require.push( depList[i] );
+                       }
+               }
+
+               dt.setBasedir( modPath );
+
+               if( path.basename( depDataPath ) == "depData.json" ) {
+                       code = fs.readFileSync( depDataPath, 'utf-8' );
+                       depData = JSON.parse( code );
+                       dt.import( depData );
+               }
+               if ( path.basename( requirePath ) == "require.js" ) {
+                       require = [];
+                       code = fs.readFileSync( requirePath, 'utf-8' );
+                       context = vm.createContext( { require: _require } );
+                       vm.runInContext( code, context );
+               }
+
+               dt.construct();
+               order = dt.order( require );
+               //error(order);
+
+
+               for( i in order ) {
+                       mod = order[i];
+                       try {
+                               code = fs.readFileSync( path.join( modPath, mod + '.js' ) );
+                               puts(code);
+                       } catch( ex ) {
+                               if( ex.code != "ENOENT" ) {     // Ignore No entry(no file) error
+                                       throw( ex );
+                               }
+                       }
+               }
+       }
+}
+if ( require.main === module ) main( process.argv );