From: Minkyu Kang Date: Mon, 10 Sep 2012 08:04:29 +0000 (+0900) Subject: Revert "Export" X-Git-Tag: 2.0_alpha~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f3bc06001f660ef156e0895f4be1e81a0ac99502;p=framework%2Fweb%2Fweb-ui-fw.git Revert "Export" This reverts commit b087adb7b7df900f9656425e5cea9dc7abdf935b. --- diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..23acf1f --- /dev/null +++ b/COPYING @@ -0,0 +1,55 @@ +This software is licensed under the MIT license (as defined +by the OSI at http://www.opensource.org/licenses/mit-license.php) + +**************************************************************************** +Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. +Copyright (C) 2011 by Intel Corporation Ltd. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to 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. +**************************************************************************** + +This software incorporates software from other sources, including: + +widgets/jquery.mobile.groupindex/ + initial version taken from + git clone https://github.com/jquery/jquery-mobile.git + commit a197e17500ed9f4994f532ab384b0b45b414a1ea + including theme files (removed php files which required some changes), demo html, js, and also the + jquery.mobile.scrollview.{js/css} in the common directories (already copied as part of datetimepicker). + +widgets/jquery.mobile.maps/ + initial version taken from : + svn checkout http://jquery-ui-map.googlecode.com/svn/trunk/ jquery-ui-map-read-only + Checked out revision 254. + +jQuery UI (http://jqueryui.com/) [MIT license] +JQM-DateBox (https://github.com/jtsage/jquery-mobile-datebox) [CC 3.0 Attribution] +developed by JTSage (http://dev.jtsage.com/blog/) + +jQuery Mobile (http://jquerymobile.com/) [MIT license] + +jQuery (http://jquery.com/) [MIT license] + +(parts of) Underscore (http://documentcloud.github.com/underscore/) [MIT license] + +jLayout (http://www.bramstein.com/projects/jlayout/) [BSD license] + +jSizes (http://www.bramstein.com/projects/jsizes/) [BSD license] + +Globalize (http://github.com/jquery/globalize/) [MIT license] diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f7f0ccb --- /dev/null +++ b/Makefile @@ -0,0 +1,310 @@ +SHELL := /bin/bash + +## Project setting +DEBUG ?= yes +PROJECT_NAME = tizen-web-ui-fw +VERSION = 0.1 +VERSION_COMPAT = +THEME_NAME = default + +PATH := $(CURDIR)/build-tools/bin:$(PATH) + +JSLINT_LEVEL = 1 +JSLINT = jslint --sloppy --eqeq --bitwise --forin --nomen --predef jQuery --color --plusplus --browser --jqmspace +COMMON_WIDGET = common +INLINE_PROTO = 1 +OUTPUT_ROOT = $(CURDIR)/build +FRAMEWORK_ROOT = ${OUTPUT_ROOT}/${PROJECT_NAME}/${VERSION} + +LATEST_ROOT = ${OUTPUT_ROOT}/${PROJECT_NAME}/latest + +JS_OUTPUT_ROOT = ${FRAMEWORK_ROOT}/js +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 + +THEMES_DIR = $(CURDIR)/src/themes +LIBS_DIR = $(CURDIR)/libs + +COPYING_FILE = $(CURDIR)/COPYING + +DESTDIR ?= + +PREFIX ?= /usr +INSTALL_DIR = ${DESTDIR}${PREFIX} + +FW_JS = ${JS_OUTPUT_ROOT}/${PROJECT_NAME}.js +FW_MIN = $(subst .js,.min.js,$(FW_JS)) +FW_LIB_JS = ${JS_OUTPUT_ROOT}/${PROJECT_NAME}-libs.js +FW_LIB_MIN = $(subst .js,.min.js,$(FW_LIB_JS)) + +FW_JS_THEME = ${JS_OUTPUT_ROOT}/${PROJECT_NAME}-${THEME_NAME}-theme.js +FW_CSS = ${CSS_OUTPUT_ROOT}/${PROJECT_NAME}-theme.css +FW_LIBS_JS = ${JS_OUTPUT_ROOT}/${PROJECT_NAME}-libs.js +FW_THEME_CSS_FILE = ${PROJECT_NAME}-theme.css +FW_WIDGET_CSS_FILE = ${WIDGET_CSS_OUTPUT_ROOT}/${PROJECT_NAME}-widget.css + +GEO_VERSION = jquery-geo-1.0a4 + +LIBS_JS_FILES = jlayout/jquery.sizes.js \ + jlayout/jlayout.border.js \ + jlayout/jlayout.grid.js \ + jlayout/jlayout.flexgrid.js \ + jlayout/jlayout.flow.js \ + jlayout/jquery.jlayout.js \ + jquery.easing.1.3.js \ + jquery.tmpl.js \ + jquery.mobile.js \ + ${GEO_VERSION}/js/jquery.geo.head.js \ + ${GEO_VERSION}/js/jquery.mousewheel.js \ + ${GEO_VERSION}/js/jquery.geo.core.js \ + ${GEO_VERSION}/js/jquery.geo.geographics.js \ + ${GEO_VERSION}/js/jquery.geo.geomap.js \ + ${GEO_VERSION}/js/jquery.geo.tiled.js \ + ${GEO_VERSION}/js/jquery.geo.shingled.js \ + $(NULL) + +JQUERY_MOBILE_CSS = submodules/jquery-mobile/compiled/jquery.mobile.structure.css \ + submodules/jquery-mobile/compiled/jquery.mobile.css \ + $(NULL) +JQUERY_MOBILE_IMAGES = submodules/jquery-mobile/css/themes/default/images + +JQM_VERSION = jquery-mobile-1.1.0 +JQM_LIB_PATH = $(CURDIR)/libs/js/${JQM_VERSION} + +ifeq (${DEBUG},yes) +JQUERY = jquery-1.7.1.js +else +LIBS_JS_FILES +=\ + jquery.mobile.min.js \ + $(NULL) +JQUERY = jquery-1.7.1.min.js +endif + +LIBS_CSS_FILES = +ifeq (${DEBUG},yes) +LIBS_CSS_FILES +=\ + $(CURDIR)/src/jqm/compiled/jquery.mobile-1.0rc2pre.css \ + $(NULL) +else +LIBS_CSS_FILES +=\ + $(CURDIR)/src/jqm/compiled/jquery.mobile-1.0rc2pre.min.css \ + $(NULL) +endif + + +all: libs_prepare third_party widgets libs_cleanup loader themes version_compat compress + +libs_prepare: + # Prepare libs/ build... + @@test -d ${LIBS_DIR}.bak && rm -rf ${LIBS_DIR} && mv ${LIBS_DIR}.bak ${LIBS_DIR}; \ + cp -a ${LIBS_DIR} ${LIBS_DIR}.bak + for f in `ls ${LIBS_DIR}/patch/*.patch`; do \ + cd $(CURDIR); \ + echo "Apply patch: $$f"; \ + cat $$f | patch -p1 -N; \ + done; \ + +libs_cleanup: + # Cleanup libs/ directory... + @@rm -rf ${LIBS_DIR} && mv ${LIBS_DIR}.bak ${LIBS_DIR} + +jqm: init + # Building jQuery Mobile... + cd ${JQM_LIB_PATH} && make js NODE=/usr/bin/node || exit 1; \ + cp -f ${JQM_LIB_PATH}/compiled/*.js ${JQM_LIB_PATH}/../; \ + +third_party: init jqm + # Building third party components... + @@cd ${LIBS_DIR}/js; \ + for f in ${LIBS_JS_FILES}; do \ + cat $$f >> ${FW_LIB_JS}; \ + uglifyjs --ascii $$f >> ${FW_LIB_MIN}; \ + echo "" >> ${FW_LIB_MIN}; \ + done; \ + cp ${LIBS_DIR}/js/${JQUERY} ${JS_OUTPUT_ROOT}/jquery.js + @@cd ${LIBS_DIR}/css; \ + for f in ${LIBS_CSS_FILES}; do \ + cat $$f >> ${FW_CSS}; \ + done; \ + cp -r images/* ${CSS_IMAGES_OUTPUT_DIR} + + #@@cp -a ${LIBS_DIR}/images ${FRAMEWORK_ROOT}/ + + +widgets: init third_party + # Building widgets... + @@ls -l ${WIDGETS_DIR} | grep '^d' | awk '{print $$NF;}' | \ + while read REPLY; do \ + echo " # Building widget $$REPLY"; \ + if test ${JSLINT_LEVEL} -ge 1; then \ + if test $$REPLY != ${COMMON_WIDGET}; then \ + for FNAME in ${WIDGETS_DIR}/$$REPLY/js/*.js; do \ + ${JSLINT} $$FNAME; \ + if test ${JSLINT_LEVEL} -ge 2 -a $$? -ne 0; then \ + exit 1; \ + fi; \ + done; \ + fi; \ + fi; \ + if test "x${INLINE_PROTO}x" = "x1x"; then \ + ./tools/inline-protos.sh ${WIDGETS_DIR}/$$REPLY >> ${WIDGETS_DIR}/$$REPLY/js/$$REPLY.js.compiled; \ + cat ${WIDGETS_DIR}/$$REPLY/js/$$REPLY.js.compiled >> ${FW_JS}; \ + else \ + for f in `find ${WIDGETS_DIR}/$$REPLY -iname 'js/*.js' | sort`; do \ + echo " $$f"; \ + cat $$f >> ${FW_JS}; \ + done; \ + fi; \ + for f in `find ${WIDGETS_DIR}/$$REPLY -iname '*.js.theme' | sort`; do \ + echo " $$f"; \ + cat $$f >> ${FW_JS_THEME}; \ + done; \ + for f in `find ${WIDGETS_DIR}/$$REPLY -iname '*.less' | sort`; do \ + echo " $$f"; \ + lessc $$f > $$f.css; \ + done; \ + for f in `find ${WIDGETS_DIR}/$$REPLY -iname '*.css' | sort`; do \ + echo " $$f"; \ + cat $$f >> ${FW_CSS}; \ + done; \ + for f in `find ${WIDGETS_DIR}/$$REPLY -iname '*.gif' -or -iname '*.png' -or -iname '*.jpg' | sort`; do \ + echo " $$f"; \ + cp $$f ${CSS_IMAGES_OUTPUT_DIR}; \ + done; \ + if test "x${INLINE_PROTO}x" != "x1x"; then \ + for f in `find ${WIDGETS_DIR}/$$REPLY -iname '*.prototype.html' | sort`; do \ + echo " $$f"; \ + cp $$f ${PROTOTYPE_HTML_OUTPUT_DIR}; \ + done; \ + fi; \ + done + + +loader: widgets globalize + cat 'src/loader/loader.js' >> ${FW_JS} + + +globalize: widgets + cat 'libs/js/globalize/lib/globalize.js' >> ${FW_JS} + # copy globalize libs... + cp -a libs/js/globalize/lib/cultures ${FRAMEWORK_ROOT}/js/ + + +themes: + make -C src/themes || exit $? + + +compress: widgets loader themes + # Javacript code compressing + @@echo " # Compressing...."; \ + echo '/*' > ${FW_MIN}; \ + cat ${COPYING_FILE} >> ${FW_MIN}; \ + echo '*/' >> ${FW_MIN}; \ + uglifyjs --ascii -nc ${FW_JS} >> ${FW_MIN}; \ + # CSS compressing + @@cd ${THEME_OUTPUT_ROOT}; \ + for csspath in */*.css; do \ + echo "Compressing $$csspath"; \ + cleancss -o $${csspath/%.css/.min.css} $$csspath; \ + done + + +docs: init + # Building documentation... + @@hash docco 2>&1 /dev/null || (echo "docco not found. Please see README."; exit 1); \ + ls -l ${WIDGETS_DIR} | grep '^d' | awk '{print $$NF;}' | \ + while read REPLY; do \ + echo " # Building docs for widget $$REPLY"; \ + for f in `find ${WIDGETS_DIR}/$$REPLY -iname '*.js' | sort`; do \ + docco $$f > /dev/null; \ + done; \ + done; \ + cp docs/docco.custom.css docs/docco.css; \ + cat docs/index.header > docs/index.html; \ + for f in `find docs -name '*.html' -not -name index.html | sort`; do \ + echo "
  • $$(basename $$f .html)
  • " >> docs/index.html; \ + done; \ + cat docs/index.footer >> docs/index.html + + +version_compat: third_party widgets + # 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 + mkdir -p ${OUTPUT_ROOT}/demos + cp -av demos/* ${OUTPUT_ROOT}/demos/ + cp -f src/template/bootstrap.js ${OUTPUT_ROOT}/demos/gallery/ + + +install: all + mkdir -p ${INSTALL_DIR}/bin ${INSTALL_DIR}/share/tizen-web-ui-fw/demos/ ${INSTALL_DIR}/share/tizen-web-ui-fw/bin/ + cp -av ${OUTPUT_ROOT}/tizen-web-ui-fw/* src/template ${INSTALL_DIR}/share/tizen-web-ui-fw/ + cp -av tools/* ${INSTALL_DIR}/share/tizen-web-ui-fw/bin/ + cp -av demos/tizen-winsets ${INSTALL_DIR}/share/tizen-web-ui-fw/demos/ && cd ${INSTALL_DIR}/share/tizen-web-ui-fw/demos/tizen-winsets && sed -i -e "s#../../build#../../..#g" *.html + + +coverage: clean all + # Checking unit test coverage + $(CURDIR)/tests/coverage/instrument.sh + + +dist: clean all docs + # Creating tarball... + @@ \ + TMPDIR=$$(mktemp -d tarball.XXXXXXXX); \ + DESTDIR=$${TMPDIR}/${PROJECT_NAME}; \ + MIN=''; \ + if test "x${DEBUG}x" = "xnox"; then \ + MIN='.min'; \ + fi; \ + TARBALL=${PROJECT_NAME}-${VERSION}-`date +%Y%m%d`$${MIN}.tar.gz; \ + mkdir -p $${DESTDIR}; \ + cp -a ${FW_JS} \ + ${FW_LIBS_JS} \ + ${THEMES_OUTPUT_ROOT}/tizen/${FW_THEME_CSS_FILE} \ + ${FW_WIDGET_CSS_FILE} \ + ${THEMES_OUTPUT_ROOT}/tizen/images \ + docs \ + README.md \ + COPYING \ + $${DESTDIR}; \ + hash git 2>&1 /dev/null && touch $${DESTDIR}/$$(git log | head -n 1 | awk '{print $$2;}'); \ + tar cfzps \ + $${TARBALL} \ + --exclude='.git' \ + --exclude='*.less.css' \ + --exclude='*.js.compiled' \ + --exclude='submodules/jquery-mobile' \ + --exclude='${JQUERY}' \ + -C $${TMPDIR} ${PROJECT_NAME}; \ + rm -rf $${TMPDIR} + + +clean: + # Removing destination directory... + @@rm -rf ${OUTPUT_ROOT} + # Remove generated files... + @@rm -f `find . -iname *.less.css` + @@rm -f `find . -iname *.js.compiled` + + +init: clean + # Check build environment... + @@hash lessc 2>/dev/null || (echo "lessc not found. Please see HACKING."; exit 1); \ + + # Initializing... + @@mkdir -p ${JS_OUTPUT_ROOT} + @@mkdir -p ${THEME_OUTPUT_ROOT} + @@mkdir -p ${CSS_OUTPUT_ROOT} + @@mkdir -p ${CSS_IMAGES_OUTPUT_DIR} + @@mkdir -p ${PROTOTYPE_HTML_OUTPUT_DIR} + @@rm -f docs/*.html diff --git a/build-tools/README.txt b/build-tools/README.txt new file mode 100644 index 0000000..0efd403 --- /dev/null +++ b/build-tools/README.txt @@ -0,0 +1,44 @@ +Tizen Web UI Framework includes following tools used on build; + +* less (http://lesscss.org) + * Description: A dynamic CSS language compiler based on node.js + * Mods + * Support rem unit (build-tools/lib/less/parser.js) + * License: Apache License Version 2.0 (build-tools/lib/less/LICENSE) + +* UglifyJS (https://github.com/mishoo/UglifyJS) + * Description: A javascript code compressor/uglifier based on node.js + * Mods + * Add relative lib directory to work with UglifyJS libs (build-tools/bin/uglifyjs) + * Change lib directory structure: lib/ to lib/uglifyjs/ (build-tools/bin/uglifyjs, build-tools/lib/uglify-js) + * License: BSD License (build-tools/lib/uglifyjs/LICENSE) + +* node-jslint (http://github.com/reid/node-jslint) + * Version: 3/2/2012 Update (node-jslint: 0.1.6) + * Description: The JavaScript Code Quality Tool for Node.js + * Mods + * Change lib directory structure: lib/ to lib/jslint/ (build-tools/bin/jslint, build-tools/lib/jslint) + * License + * node-jslint: BSD License (build-tools/lib/jslint/LICENSE) + * jslint: Customized MIT License (build-tools/lib/jslint/jslint.js) + * nopt, abbrev: MIT License (build-tools/lib/jslint/nopt/LICENSE) + +* clean-css (http://github.com/GoalSmashers/clean-css) + * Version: 0.4.0 + * Description: A CSS code minifier + * Mods + * Fix local library path and name + * License + * MIT license (build-tools/lib/cleancss/LICENSE) + +* optimist (http://github.com/substack/node-optimist) + * Version: 0.3.4 + * Description: A node.js command-line option parser libraryr, used by clean-css. + * License + * MIT/X11 license (build-tools/lib/optimist/LICENSE) + +* wordwrap (http://github.com/substack/node-wordwrap) + * Version: b026541 (Released at Apr. 30 2012) + * Description: Word-wrapping library, used by optimist. + * License + * MIT license (build-tools/lib/wordwrap/LICENSE) diff --git a/build-tools/bin/cleancss b/build-tools/bin/cleancss new file mode 100755 index 0000000..0ec2ef3 --- /dev/null +++ b/build-tools/bin/cleancss @@ -0,0 +1,44 @@ +#!/usr/bin/env node + +global.util = require("util"); +var argv = require('optimist').argv, + cleanCss = require('cleancss'), + fs = require('fs'); + +var options = { + source: null, + target: null +}; +var cleanOptions = {}; + +if (argv.o) options.target = argv.o; +if (argv._) options.source = argv._[0]; +if (argv.e) cleanOptions.removeEmpty = true; + +if (argv.h || argv.help) { + global.util.print('Usage: cleancss [-e] -o \n'); + process.exit(0); +} + +if (options.source) { + fs.readFile(options.source, 'utf8', function(error, text) { + if (error) throw error; + output(cleanCss.process(text)); + }); +} else { + var stdin = process.openStdin(); + stdin.setEncoding('utf-8'); + var text = ''; + stdin.on('data', function(chunk) { text += chunk; }); + stdin.on('end', function() { output(cleanCss.process(text, cleanOptions)); }); +} + +function output(cleaned) { + if (options.target) { + var out = fs.createWriteStream(options.target, { flags: 'w', encoding: 'utf-8', mode: 0644 }); + out.write(cleaned); + out.end(); + } else { + process.stdout.write(cleaned); + } +}; diff --git a/build-tools/bin/jslint b/build-tools/bin/jslint new file mode 100755 index 0000000..13aec28 --- /dev/null +++ b/build-tools/bin/jslint @@ -0,0 +1,99 @@ +#!/usr/bin/env node +/* original +var linter = require("../lib/linter"); +var reporter = require("../lib/reporter"); +var nopt = require("nopt"); +var fs = require("fs"); +*/ +var linter = require("../lib/jslint/linter"), + reporter = require("../lib/jslint/reporter"), + nopt = require("../lib/jslint/nopt/nopt"), + fs = require("fs"); + +function commandOptions() { + 'use strict'; + var flags = [ + 'anon', 'bitwise', 'browser', 'cap', 'continue', 'css', + 'debug', 'devel', 'eqeq', 'es5', 'evil', 'forin', 'fragment', + 'newcap', 'node', 'nomen', 'on', 'passfail', 'plusplus', + 'properties', 'regexp', 'rhino', 'undef', 'unparam', + 'sloppy', 'sub', 'vars', 'white', 'widget', 'windows', + 'json', 'color', 'jqmspace' + ], + commandOpts = { + 'indent' : Number, + 'maxerr' : Number, + 'maxlen' : Number, + 'predef' : [String, Array] + }; + + flags.forEach(function (option) { + commandOpts[option] = Boolean; + }); + + return commandOpts; +} + +var options = commandOptions(); + +var parsed = nopt(options); + +function die(why) { + 'use strict'; + console.warn(why); + console.warn("Usage: " + process.argv[1] + + " [--" + Object.keys(options).join("] [--") + + "] [--] ..."); + process.exit(1); +} + +if (!parsed.argv.remain.length) { + die("No files specified."); +} + + +// If there are no more files to be processed, exit with the value 1 +// if any of the files contains any lint. +var maybeExit = (function () { + 'use strict'; + var filesLeft = parsed.argv.remain.length, + ok = true; + + return function (lint) { + filesLeft -= 1; + ok = lint.ok && ok; + + if (filesLeft === 0) { + // This was the last file. + process.exit(ok ? 0 : 1); + } + }; +}()); + + +function lintFile(file) { + 'use strict'; + fs.readFile(file, function (err, data) { + if (err) { + throw err; + } + + // Fix UTF8 with BOM + if (0xEF === data[0] && 0xBB === data[1] && 0xBF === data[2]) { + data = data.slice(3); + } + + data = data.toString("utf8"); + var lint = linter.lint(data, parsed); + + if (parsed.json) { + console.log(JSON.stringify([file, lint.errors])); + } else { + reporter.report(file, lint, parsed.color); + } + + maybeExit(lint); + }); +} + +parsed.argv.remain.forEach(lintFile); diff --git a/build-tools/bin/lessc b/build-tools/bin/lessc new file mode 100755 index 0000000..32f993f --- /dev/null +++ b/build-tools/bin/lessc @@ -0,0 +1,134 @@ +#!/usr/bin/env node + +var path = require('path'), + fs = require('fs'), + sys = require('sys'); + +try { + // For old node.js versions + require.paths.unshift( path.join( __dirname, '..', 'lib' ) ); +} catch ( ex ) { +} + +var less = require('less'); +var args = process.argv.slice(1); +var options = { + compress: false, + optimization: 1, + silent: false, + paths: [], + color: true +}; + +args = args.filter(function (arg) { + var match; + + if (match = arg.match(/^-I(.+)$/)) { + options.paths.push(match[1]); + return false; + } + + if (match = arg.match(/^--?([a-z][0-9a-z-]*)(?:=([^\s]+))?$/i)) { arg = match[1] } + else { return arg } + + switch (arg) { + case 'v': + case 'version': + sys.puts("lessc " + less.version.join('.') + " (LESS Compiler) [JavaScript]"); + process.exit(0); + case 'verbose': + options.verbose = true; + break; + case 's': + case 'silent': + options.silent = true; + break; + case 'h': + case 'help': + sys.puts("usage: lessc source [destination]"); + process.exit(0); + case 'x': + case 'compress': + options.compress = true; + break; + case 'no-color': + options.color = false; + break; + case 'include-path': + options.paths = match[2].split(':') + .map(function(p) { + if (p && p[0] == '/') { + return path.join(path.dirname(input), p); + } else if (p) { + return path.join(process.cwd(), p); + } + }); + break; + case 'O0': options.optimization = 0; break; + case 'O1': options.optimization = 1; break; + case 'O2': options.optimization = 2; break; + } +}); + +var input = args[1]; +if (input && input[0] != '/' && input != '-') { + input = path.join(process.cwd(), input); +} +var output = args[2]; +if (output && output[0] != '/') { + output = path.join(process.cwd(), output); +} + +var css, fd, tree; + +if (! input) { + sys.puts("lessc: no input files"); + process.exit(1); +} + +var parseLessFile = function (e, data) { + if (e) { + sys.puts("lessc: " + e.message); + process.exit(1); + } + + new(less.Parser)({ + paths: [path.dirname(input)].concat(options.paths), + optimization: options.optimization, + filename: input + }).parse(data, function (err, tree) { + if (err) { + less.writeError(err, options); + process.exit(1); + } else { + try { + css = tree.toCSS({ compress: options.compress }); + if (output) { + fd = fs.openSync(output, "w"); + fs.writeSync(fd, css, 0, "utf8"); + } else { + sys.print(css); + } + } catch (e) { + less.writeError(e, options); + process.exit(2); + } + } + }); +}; + +if (input != '-') { + fs.readFile(input, 'utf-8', parseLessFile); +} else { + process.stdin.resume(); + process.stdin.setEncoding('utf8'); + + var buffer = ''; + process.stdin.on('data', function(data) { + buffer += data; + }); + + process.stdin.on('end', function() { + parseLessFile(false, buffer); + }); +} diff --git a/build-tools/bin/uglifyjs b/build-tools/bin/uglifyjs new file mode 100755 index 0000000..485d9c1 --- /dev/null +++ b/build-tools/bin/uglifyjs @@ -0,0 +1,333 @@ +#!/usr/bin/env node +// -*- js -*- + +global.sys = require(/^v0\.[012]/.test(process.version) ? "sys" : "util"); +var fs = require("fs"); + +// Add ../lib to require path +// by Youmin Ha +var path = require("path"); + +try { + require.paths.unshift(path.join(__dirname, '..', 'lib')); +} catch (ex) { +} + +var uglify = require("uglify-js"), // symlink ~/.node_libraries/uglify-js.js to ../uglify-js.js + jsp = uglify.parser, + pro = uglify.uglify; + +var options = { + ast: false, + mangle: true, + mangle_toplevel: false, + no_mangle_functions: false, + squeeze: true, + make_seqs: true, + dead_code: true, + verbose: false, + show_copyright: true, + out_same_file: false, + max_line_length: 32 * 1024, + unsafe: false, + reserved_names: null, + defines: { }, + lift_vars: false, + codegen_options: { + ascii_only: false, + beautify: false, + indent_level: 4, + indent_start: 0, + quote_keys: false, + space_colon: false, + inline_script: false + }, + make: false, + output: true // stdout +}; + +var args = jsp.slice(process.argv, 2); +var filename; + +out: while (args.length > 0) { + var v = args.shift(); + switch (v) { + case "-b": + case "--beautify": + options.codegen_options.beautify = true; + break; + case "-i": + case "--indent": + options.codegen_options.indent_level = args.shift(); + break; + case "-q": + case "--quote-keys": + options.codegen_options.quote_keys = true; + break; + case "-mt": + case "--mangle-toplevel": + options.mangle_toplevel = true; + break; + case "-nmf": + case "--no-mangle-functions": + options.no_mangle_functions = true; + break; + case "--no-mangle": + case "-nm": + options.mangle = false; + break; + case "--no-squeeze": + case "-ns": + options.squeeze = false; + break; + case "--no-seqs": + options.make_seqs = false; + break; + case "--no-dead-code": + options.dead_code = false; + break; + case "--no-copyright": + case "-nc": + options.show_copyright = false; + break; + case "-o": + case "--output": + options.output = args.shift(); + break; + case "--overwrite": + options.out_same_file = true; + break; + case "-v": + case "--verbose": + options.verbose = true; + break; + case "--ast": + options.ast = true; + break; + case "--unsafe": + options.unsafe = true; + break; + case "--max-line-len": + options.max_line_length = parseInt(args.shift(), 10); + break; + case "--reserved-names": + options.reserved_names = args.shift().split(","); + break; + case "--lift-vars": + options.lift_vars = true; + break; + case "-d": + case "--define": + var defarg = args.shift(); + try { + var defsym = function(sym) { + // KEYWORDS_ATOM doesn't include NaN or Infinity - should we check + // for them too ?? We don't check reserved words and the like as the + // define values are only substituted AFTER parsing + if (jsp.KEYWORDS_ATOM.hasOwnProperty(sym)) { + throw "Don't define values for inbuilt constant '"+sym+"'"; + } + return sym; + }, + defval = function(v) { + if (v.match(/^"(.*)"$/) || v.match(/^'(.*)'$/)) { + return [ "string", RegExp.$1 ]; + } + else if (!isNaN(parseFloat(v))) { + return [ "num", parseFloat(v) ]; + } + else if (v.match(/^[a-z\$_][a-z\$_0-9]*$/i)) { + return [ "name", v ]; + } + else if (!v.match(/"/)) { + return [ "string", v ]; + } + else if (!v.match(/'/)) { + return [ "string", v ]; + } + throw "Can't understand the specified value: "+v; + }; + if (defarg.match(/^([a-z_\$][a-z_\$0-9]*)(=(.*))?$/i)) { + var sym = defsym(RegExp.$1), + val = RegExp.$2 ? defval(RegExp.$2.substr(1)) : [ 'name', 'true' ]; + options.defines[sym] = val; + } + else { + throw "The --define option expects SYMBOL[=value]"; + } + } catch(ex) { + sys.print("ERROR: In option --define "+defarg+"\n"+ex+"\n"); + process.exit(1); + } + break; + case "--define-from-module": + var defmodarg = args.shift(), + defmodule = require(defmodarg), + sym, + val; + for (sym in defmodule) { + if (defmodule.hasOwnProperty(sym)) { + options.defines[sym] = function(val) { + if (typeof val == "string") + return [ "string", val ]; + if (typeof val == "number") + return [ "num", val ]; + if (val === true) + return [ 'name', 'true' ]; + if (val === false) + return [ 'name', 'false' ]; + if (val === null) + return [ 'name', 'null' ]; + if (val === undefined) + return [ 'name', 'undefined' ]; + sys.print("ERROR: In option --define-from-module "+defmodarg+"\n"); + sys.print("ERROR: Unknown object type for: "+sym+"="+val+"\n"); + process.exit(1); + return null; + }(defmodule[sym]); + } + } + break; + case "--ascii": + options.codegen_options.ascii_only = true; + break; + case "--make": + options.make = true; + break; + case "--inline-script": + options.codegen_options.inline_script = true; + break; + default: + filename = v; + break out; + } +} + +if (options.verbose) { + pro.set_logger(function(msg){ + sys.debug(msg); + }); +} + +jsp.set_logger(function(msg){ + sys.debug(msg); +}); + +if (options.make) { + options.out_same_file = false; // doesn't make sense in this case + var makefile = JSON.parse(fs.readFileSync(filename || "Makefile.uglify.js").toString()); + output(makefile.files.map(function(file){ + var code = fs.readFileSync(file.name); + if (file.module) { + code = "!function(exports, global){global = this;\n" + code + "\n;this." + file.module + " = exports;}({})"; + } + else if (file.hide) { + code = "(function(){" + code + "}());"; + } + return squeeze_it(code); + }).join("\n")); +} +else if (filename) { + fs.readFile(filename, "utf8", function(err, text){ + if (err) throw err; + output(squeeze_it(text)); + }); +} +else { + var stdin = process.openStdin(); + stdin.setEncoding("utf8"); + var text = ""; + stdin.on("data", function(chunk){ + text += chunk; + }); + stdin.on("end", function() { + output(squeeze_it(text)); + }); +} + +function output(text) { + var out; + if (options.out_same_file && filename) + options.output = filename; + if (options.output === true) { + out = process.stdout; + } else { + out = fs.createWriteStream(options.output, { + flags: "w", + encoding: "utf8", + mode: 0644 + }); + } + out.write(text.replace(/;*$/, ";")); + if (options.output !== true) { + out.end(); + } +}; + +// --------- main ends here. + +function show_copyright(comments) { + var ret = ""; + for (var i = 0; i < comments.length; ++i) { + var c = comments[i]; + if (c.type == "comment1") { + ret += "//" + c.value + "\n"; + } else { + ret += "/*" + c.value + "*/"; + } + } + return ret; +}; + +function squeeze_it(code) { + var result = ""; + if (options.show_copyright) { + var tok = jsp.tokenizer(code), c; + c = tok(); + result += show_copyright(c.comments_before); + } + try { + var ast = time_it("parse", function(){ return jsp.parse(code); }); + if (options.lift_vars) { + ast = time_it("lift", function(){ return pro.ast_lift_variables(ast); }); + } + if (options.mangle) ast = time_it("mangle", function(){ + return pro.ast_mangle(ast, { + toplevel : options.mangle_toplevel, + defines : options.defines, + except : options.reserved_names, + no_functions : options.no_mangle_functions + }); + }); + if (options.squeeze) ast = time_it("squeeze", function(){ + ast = pro.ast_squeeze(ast, { + make_seqs : options.make_seqs, + dead_code : options.dead_code, + keep_comps : !options.unsafe + }); + if (options.unsafe) + ast = pro.ast_squeeze_more(ast); + return ast; + }); + if (options.ast) + return sys.inspect(ast, null, null); + result += time_it("generate", function(){ return pro.gen_code(ast, options.codegen_options) }); + if (!options.codegen_options.beautify && options.max_line_length) { + result = time_it("split", function(){ return pro.split_lines(result, options.max_line_length) }); + } + return result; + } catch(ex) { + sys.debug(ex.stack); + sys.debug(sys.inspect(ex)); + sys.debug(JSON.stringify(ex)); + process.exit(1); + } +}; + +function time_it(name, cont) { + if (!options.verbose) + return cont(); + var t1 = new Date().getTime(); + try { return cont(); } + finally { sys.debug("// " + name + ": " + ((new Date().getTime() - t1) / 1000).toFixed(3) + " sec."); } +}; diff --git a/build-tools/lib/cleancss/LICENSE b/build-tools/lib/cleancss/LICENSE new file mode 100644 index 0000000..9e592d3 --- /dev/null +++ b/build-tools/lib/cleancss/LICENSE @@ -0,0 +1,7 @@ +Copyright (c) 2011 GoalSmashers.com + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE 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. \ No newline at end of file diff --git a/build-tools/lib/cleancss/clean.js b/build-tools/lib/cleancss/clean.js new file mode 100644 index 0000000..3fa03f0 --- /dev/null +++ b/build-tools/lib/cleancss/clean.js @@ -0,0 +1,201 @@ +var util = require('util'); + +var CleanCSS = { + colors: { + white: '#fff', + black: '#000', + fuchsia: '#f0f', + yellow: '#ff0' + }, + + specialComments: [], + contentBlocks: [], + + process: function(data, options) { + var self = this, + replace = function(pattern, replacement) { + if (typeof arguments[0] == 'function') + arguments[0](); + else + data = data.replace.apply(data, arguments); + }; + + options = options || {}; + + // replace function + if (options.debug) { + var originalReplace = replace; + replace = function(pattern, replacement) { + var name = typeof pattern == 'function' ? + /function (\w+)\(/.exec(pattern.toString())[1] : + pattern; + console.time(name); + originalReplace(pattern, replacement); + console.timeEnd(name); + }; + } + + // strip comments one by one + replace(function stripComments() { + data = self.stripComments(data); + }); + + // replace content: with a placeholder + replace(function stripContent() { + data = self.stripContent(data); + }); + + replace(/;\s*;+/g, ';') // whitespace between semicolons & multiple semicolons + replace(/\n/g, '') // line breaks + replace(/\s+/g, ' ') // multiple whitespace + replace(/ !important/g, '!important') // whitespace before !important + replace(/[ ]?,[ ]?/g, ',') // space with a comma + replace(/progid:[^(]+\(([^\)]+)/g, function(match, contents) { // restore spaces inside IE filters (IE 7 issue) + return match.replace(/,/g, ', '); + }) + replace(/ ([+~>]) /g, '$1') // replace spaces around selectors + replace(/\{([^}]+)\}/g, function(match, contents) { // whitespace inside content + return '{' + contents.trim().replace(/(\s*)([;:=\s])(\s*)/g, '$2') + '}'; + }) + replace(/;}/g, '}') // trailing semicolons + replace(/rgb\s*\(([^\)]+)\)/g, function(match, color) { // rgb to hex colors + var parts = color.split(','); + var encoded = '#'; + for (var i = 0; i < 3; i++) { + var asHex = parseInt(parts[i], 10).toString(16); + encoded += asHex.length == 1 ? '0' + asHex : asHex; + } + return encoded; + }) + replace(/([^"'=\s])\s*#([0-9a-f]{6})/gi, function(match, prefix, color) { // long hex to short hex + if (color[0] == color[1] && color[2] == color[3] && color[4] == color[5]) + return (prefix + (/:$/.test(prefix) ? '' : ' ')) + '#' + color[0] + color[2] + color[4]; + else + return (prefix + (/:$/.test(prefix) ? '' : ' ')) + '#' + color; + }) + replace(/(color|background):(\w+)/g, function(match, property, colorName) { // replace standard colors with hex values (only if color name is longer then hex value) + if (CleanCSS.colors[colorName]) return property + ':' + CleanCSS.colors[colorName]; + else return match; + }) + replace(/([: ,\(])#f00/g, '$1red') // replace #f00 with red as it's shorter + replace(/font\-weight:(\w+)/g, function(match, weight) { // replace font weight with numerical value + if (weight == 'normal') return 'font-weight:400'; + else if (weight == 'bold') return 'font-weight:700'; + else return match; + }) + replace(/progid:DXImageTransform\.Microsoft\.(Alpha|Chroma)(\([^\)]+\))([;}'"])/g, function(match, filter, args, suffix) { // IE shorter filters but only if single (IE 7 issue) + return filter.toLowerCase() + args + suffix; + }) + replace(/(\s|:)0(px|em|ex|cm|mm|in|pt|pc|%)/g, '$1' + '0') // zero + unit to zero + replace(/(border|border-top|border-right|border-bottom|border-left|outline):none/g, '$1:0') // none to 0 + replace(/(background):none([;}])/g, '$1:0$2') // background:none to 0 + replace(/0 0 0 0([^\.])/g, '0$1') // multiple zeros into one + replace(/([: ,=\-])0\.(\d)/g, '$1.$2') + if (options.removeEmpty) replace(/[^}]+?{\s*?}/g, '') // empty elements + if (data.indexOf('charset') > 0) replace(/(.+)(@charset [^;]+;)/, '$2$1') // move first charset to the beginning + replace(/(.)(@charset [^;]+;)/g, '$1') // remove all extra charsets that are not at the beginning + replace(/\*([\.#:\[])/g, '$1') // remove universal selector when not needed (*#id, *.class etc) + replace(/ {/g, '{') // whitespace before definition + replace(/\} /g, '}') // whitespace after definition + + // Get the special comments, content content, and spaces inside calc back + replace(/calc\([^\}]+\}/g, function(match) { + return match.replace(/\+/g, ' + '); + }); + replace(/__CSSCOMMENT__/g, function() { return self.specialComments.shift(); }); + replace(/__CSSCONTENT__/g, function() { return self.contentBlocks.shift(); }); + + return data.trim() // trim spaces at beginning and end + }, + + // Strips special comments (/*! ... */) by replacing them by __CSSCOMMENT__ marker + // for further restoring. Plain comments are removed. It's done by scanning datq using + // String#indexOf scanning instead of regexps to speed up the process. + stripComments: function(data) { + var tempData = [], + nextStart = 0, + nextEnd = 0, + cursor = 0; + + for (; nextEnd < data.length; ) { + nextStart = data.indexOf('/*', nextEnd); + nextEnd = data.indexOf('*/', nextStart); + if (nextStart == -1 || nextEnd == -1) break; + + tempData.push(data.substring(cursor, nextStart)) + if (data[nextStart + 2] == '!') { + // in case of special comments, replace them with a placeholder + this.specialComments.push(data.substring(nextStart, nextEnd + 2)); + tempData.push('__CSSCOMMENT__'); + } + cursor = nextEnd + 2; + } + + return tempData.length > 0 ? + tempData.join('') + data.substring(cursor, data.length) : + data; + }, + + // Strips content tags by replacing them by __CSSCONTENT__ marker + // for further restoring. It's done via string scanning instead of + // regexps to speed up the process. + stripContent: function(data) { + var tempData = [], + nextStart = 0, + nextEnd = 0, + tempStart = 0, + cursor = 0, + matchedParenthesis = null; + + // Finds either first (matchedParenthesis == null) or second matching parenthesis + // so we can determine boundaries of content block. + var nextParenthesis = function(pos) { + var min, + max = data.length; + + if (matchedParenthesis) { + min = data.indexOf(matchedParenthesis, pos); + if (min == -1) min = max; + } else { + var next1 = data.indexOf("'", pos); + var next2 = data.indexOf('"', pos); + if (next1 == -1) next1 = max; + if (next2 == -1) next2 = max; + + min = next1 > next2 ? next2 : next1; + } + + if (min == max) return -1; + + if (matchedParenthesis) { + matchedParenthesis = null; + return min; + } else { + // check if there's anything else between pos and min that doesn't match ':' or whitespace + if (/[^:\s]/.test(data.substring(pos, min))) return -1; + matchedParenthesis = data.charAt(min); + return min + 1; + } + }; + + for (; nextEnd < data.length; ) { + nextStart = data.indexOf('content', nextEnd); + if (nextStart == -1) break; + + nextStart = nextParenthesis(nextStart + 7); + nextEnd = nextParenthesis(nextStart); + if (nextStart == -1 || nextEnd == -1) break; + + tempData.push(data.substring(cursor, nextStart - 1)); + tempData.push('__CSSCONTENT__'); + this.contentBlocks.push(data.substring(nextStart - 1, nextEnd + 1)); + cursor = nextEnd + 1; + } + + return tempData.length > 0 ? + tempData.join('') + data.substring(cursor, data.length) : + data; + } +}; + +module.exports = CleanCSS; diff --git a/build-tools/lib/cleancss/index.js b/build-tools/lib/cleancss/index.js new file mode 100644 index 0000000..b93b57c --- /dev/null +++ b/build-tools/lib/cleancss/index.js @@ -0,0 +1 @@ +module.exports = require("./clean"); diff --git a/build-tools/lib/jslint/LICENSE b/build-tools/lib/jslint/LICENSE new file mode 100644 index 0000000..6132b5d --- /dev/null +++ b/build-tools/lib/jslint/LICENSE @@ -0,0 +1,39 @@ +Copyright 2011 Yahoo! Inc. +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of Yahoo! Inc. nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of Yahoo! Inc. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +=== + +This license applies to everything except JSLint. +JSLint, located at lib/jslint.js, is copyright Douglas Crockford. +JSLint is provided under a customized MIT license, which is +included in the header of jslint.js. diff --git a/build-tools/lib/jslint/abbrev.js b/build-tools/lib/jslint/abbrev.js new file mode 100644 index 0000000..037de2d --- /dev/null +++ b/build-tools/lib/jslint/abbrev.js @@ -0,0 +1,106 @@ + +module.exports = exports = abbrev.abbrev = abbrev + +abbrev.monkeyPatch = monkeyPatch + +function monkeyPatch () { + Array.prototype.abbrev = function () { return abbrev(this) } + Object.prototype.abbrev = function () { return abbrev(Object.keys(this)) } +} + +function abbrev (list) { + if (arguments.length !== 1 || !Array.isArray(list)) { + list = Array.prototype.slice.call(arguments, 0) + } + for (var i = 0, l = list.length, args = [] ; i < l ; i ++) { + args[i] = typeof list[i] === "string" ? list[i] : String(list[i]) + } + + // sort them lexicographically, so that they're next to their nearest kin + args = args.sort(lexSort) + + // walk through each, seeing how much it has in common with the next and previous + var abbrevs = {} + , prev = "" + for (var i = 0, l = args.length ; i < l ; i ++) { + var current = args[i] + , next = args[i + 1] || "" + , nextMatches = true + , prevMatches = true + if (current === next) continue + for (var j = 0, cl = current.length ; j < cl ; j ++) { + var curChar = current.charAt(j) + nextMatches = nextMatches && curChar === next.charAt(j) + prevMatches = prevMatches && curChar === prev.charAt(j) + if (nextMatches || prevMatches) continue + else { + j ++ + break + } + } + prev = current + if (j === cl) { + abbrevs[current] = current + continue + } + for (var a = current.substr(0, j) ; j <= cl ; j ++) { + abbrevs[a] = current + a += current.charAt(j) + } + } + return abbrevs +} + +function lexSort (a, b) { + return a === b ? 0 : a > b ? 1 : -1 +} + + +// tests +if (module === require.main) { + +var assert = require("assert") + , sys +sys = require("util") + +console.log("running tests") +function test (list, expect) { + var actual = abbrev(list) + assert.deepEqual(actual, expect, + "abbrev("+sys.inspect(list)+") === " + sys.inspect(expect) + "\n"+ + "actual: "+sys.inspect(actual)) + actual = abbrev.apply(exports, list) + assert.deepEqual(abbrev.apply(exports, list), expect, + "abbrev("+list.map(JSON.stringify).join(",")+") === " + sys.inspect(expect) + "\n"+ + "actual: "+sys.inspect(actual)) +} + +test([ "ruby", "ruby", "rules", "rules", "rules" ], +{ rub: 'ruby' +, ruby: 'ruby' +, rul: 'rules' +, rule: 'rules' +, rules: 'rules' +}) +test(["fool", "foom", "pool", "pope"], +{ fool: 'fool' +, foom: 'foom' +, poo: 'pool' +, pool: 'pool' +, pop: 'pope' +, pope: 'pope' +}) +test(["a", "ab", "abc", "abcd", "abcde", "acde"], +{ a: 'a' +, ab: 'ab' +, abc: 'abc' +, abcd: 'abcd' +, abcde: 'abcde' +, ac: 'acde' +, acd: 'acde' +, acde: 'acde' +}) + +console.log("pass") + +} diff --git a/build-tools/lib/jslint/color.js b/build-tools/lib/jslint/color.js new file mode 100644 index 0000000..c226459 --- /dev/null +++ b/build-tools/lib/jslint/color.js @@ -0,0 +1,20 @@ +function color(code, string) { + 'use strict'; + return "\x1b[" + code + "m" + string + "\x1b[0m"; +} + +function factory(code) { + 'use strict'; + return function (string) { + return color(code, string); + }; +} + +module.exports = { + bold : factory(1), + red : factory(31), + green : factory(32), + yellow : factory(33), + blue : factory(34), + grey : factory(90) +}; diff --git a/build-tools/lib/jslint/jslint.js b/build-tools/lib/jslint/jslint.js new file mode 100644 index 0000000..ab26bc8 --- /dev/null +++ b/build-tools/lib/jslint/jslint.js @@ -0,0 +1,6402 @@ +// jslint.js +// 2012-03-02 + +// Copyright (c) 2002 Douglas Crockford (www.JSLint.com) + +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: + +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. + +// The Software shall be used for Good, not Evil. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +// WARNING: JSLint will hurt your feelings. + +// JSLINT is a global function. It takes two parameters. + +// var myResult = JSLINT(source, option); + +// The first parameter is either a string or an array of strings. If it is a +// string, it will be split on '\n' or '\r'. If it is an array of strings, it +// is assumed that each string represents one line. The source can be a +// JavaScript text, or HTML text, or a JSON text, or a CSS text. + +// The second parameter is an optional object of options that control the +// operation of JSLINT. Most of the options are booleans: They are all +// optional and have a default value of false. One of the options, predef, +// can be an array of names, which will be used to declare global variables, +// or an object whose keys are used as global names, with a boolean value +// that determines if they are assignable. + +// If it checks out, JSLINT returns true. Otherwise, it returns false. + +// If false, you can inspect JSLINT.errors to find out the problems. +// JSLINT.errors is an array of objects containing these properties: + +// { +// line : The line (relative to 0) at which the lint was found +// character : The character (relative to 0) at which the lint was found +// reason : The problem +// evidence : The text line in which the problem occurred +// raw : The raw message before the details were inserted +// a : The first detail +// b : The second detail +// c : The third detail +// d : The fourth detail +// } + +// If a stopping error was found, a null will be the last element of the +// JSLINT.errors array. A stopping error means that JSLint was not confident +// enough to continue. It does not necessarily mean that the error was +// especially heinous. + +// You can request a Function Report, which shows all of the functions +// and the parameters and vars that they use. This can be used to find +// implied global variables and other problems. The report is in HTML and +// can be inserted in an HTML . + +// var myReport = JSLINT.report(errors_only); + +// If errors_only is true, then the report will be limited to only errors. + +// You can request a data structure that contains JSLint's results. + +// var myData = JSLINT.data(); + +// It returns a structure with this form: + +// { +// errors: [ +// { +// line: NUMBER, +// character: NUMBER, +// reason: STRING, +// evidence: STRING +// } +// ], +// functions: [ +// { +// name: STRING, +// line: NUMBER, +// last: NUMBER, +// params: [ +// { +// string: STRING +// } +// ], +// closure: [ +// STRING +// ], +// var: [ +// STRING +// ], +// exception: [ +// STRING +// ], +// outer: [ +// STRING +// ], +// unused: [ +// STRING +// ], +// undef: [ +// STRING +// ], +// global: [ +// STRING +// ], +// label: [ +// STRING +// ] +// } +// ], +// globals: [ +// STRING +// ], +// member: { +// STRING: NUMBER +// }, +// urls: [ +// STRING +// ], +// json: BOOLEAN +// } + +// Empty arrays will not be included. + +// You can obtain the parse tree that JSLint constructed while parsing. The +// latest tree is kept in JSLINT.tree. A nice stringication can be produced +// with + +// JSON.stringify(JSLINT.tree, [ +// 'string', 'arity', 'name', 'first', +// 'second', 'third', 'block', 'else' +// ], 4)); + +// JSLint provides three directives. They look like slashstar comments, and +// allow for setting options, declaring global variables, and establishing a +// set of allowed property names. + +// These directives respect function scope. + +// The jslint directive is a special comment that can set one or more options. +// The current option set is + +// anon true, if the space may be omitted in anonymous function declarations +// bitwise true, if bitwise operators should be allowed +// browser true, if the standard browser globals should be predefined +// cap true, if upper case HTML should be allowed +// 'continue' true, if the continuation statement should be tolerated +// css true, if CSS workarounds should be tolerated +// debug true, if debugger statements should be allowed +// devel true, if logging should be allowed (console, alert, etc.) +// eqeq true, if == should be allowed +// es5 true, if ES5 syntax should be allowed +// evil true, if eval should be allowed +// forin true, if for in statements need not filter +// fragment true, if HTML fragments should be allowed +// indent the indentation factor +// maxerr the maximum number of errors to allow +// maxlen the maximum length of a source line +// newcap true, if constructor names capitalization is ignored +// node true, if Node.js globals should be predefined +// nomen true, if names may have dangling _ +// on true, if HTML event handlers should be allowed +// passfail true, if the scan should stop on first error +// plusplus true, if increment/decrement should be allowed +// properties true, if all property names must be declared with /*properties*/ +// regexp true, if the . should be allowed in regexp literals +// rhino true, if the Rhino environment globals should be predefined +// undef true, if variables can be declared out of order +// unparam true, if unused parameters should be tolerated +// sloppy true, if the 'use strict'; pragma is optional +// sub true, if all forms of subscript notation are tolerated +// vars true, if multiple var statements per function should be allowed +// white true, if sloppy whitespace is tolerated +// widget true if the Yahoo Widgets globals should be predefined +// windows true, if MS Windows-specific globals should be predefined + +// For example: + +/*jslint + evil: true, nomen: true, regexp: true +*/ + +// The properties directive declares an exclusive list of property names. +// Any properties named in the program that are not in the list will +// produce a warning. + +// For example: + +/*properties + '\b', '\t', '\n', '\f', '\r', '!=', '!==', '"', '%', '\'', '(arguments)', + '(begin)', '(breakage)', '(context)', '(error)', '(identifier)', '(line)', + '(loopage)', '(name)', '(params)', '(scope)', '(token)', '(vars)', '(verb)', + '*', '+', '-', '/', '<', '<=', '==', '===', '>', '>=', ADSAFE, + Array, Date, Function, Object, '\\', a, a_label, a_not_allowed, + a_not_defined, a_scope, abbr, acronym, address, adsafe, adsafe_a, + adsafe_autocomplete, adsafe_bad_id, adsafe_div, adsafe_fragment, adsafe_go, + adsafe_html, adsafe_id, adsafe_id_go, adsafe_lib, adsafe_lib_second, + adsafe_missing_id, adsafe_name_a, adsafe_placement, adsafe_prefix_a, + adsafe_script, adsafe_source, adsafe_subscript_a, adsafe_tag, all, + already_defined, and, anon, applet, apply, approved, area, arity, article, + aside, assign, assign_exception, assignment_function_expression, at, + attribute_case_a, audio, autocomplete, avoid_a, b, background, + 'background-attachment', 'background-color', 'background-image', + 'background-position', 'background-repeat', bad_assignment, bad_color_a, + bad_constructor, bad_entity, bad_html, bad_id_a, bad_in_a, bad_invocation, + bad_name_a, bad_new, bad_number, bad_operand, bad_style, bad_type, bad_url_a, + bad_wrap, base, bdo, big, bitwise, block, blockquote, body, border, + 'border-bottom', 'border-bottom-color', 'border-bottom-left-radius', + 'border-bottom-right-radius', 'border-bottom-style', 'border-bottom-width', + 'border-collapse', 'border-color', 'border-left', 'border-left-color', + 'border-left-style', 'border-left-width', 'border-radius', 'border-right', + 'border-right-color', 'border-right-style', 'border-right-width', + 'border-spacing', 'border-style', 'border-top', 'border-top-color', + 'border-top-left-radius', 'border-top-right-radius', 'border-top-style', + 'border-top-width', 'border-width', bottom, br, braille, browser, button, c, + call, canvas, cap, caption, 'caption-side', center, charAt, charCodeAt, + character, cite, clear, clip, closure, cm, code, col, colgroup, color, + combine_var, command, conditional_assignment, confusing_a, confusing_regexp, + constructor_name_a, content, continue, control_a, 'counter-increment', + 'counter-reset', create, css, cursor, d, dangerous_comment, dangling_a, data, + datalist, dd, debug, del, deleted, details, devel, dfn, dialog, dir, + direction, display, disrupt, div, dl, dt, duplicate_a, edge, edition, else, + em, embed, embossed, empty, 'empty-cells', empty_block, empty_case, + empty_class, entityify, eqeq, errors, es5, eval, evidence, evil, ex, + exception, exec, expected_a, expected_a_at_b_c, expected_a_b, + expected_a_b_from_c_d, expected_at_a, expected_attribute_a, + expected_attribute_value_a, expected_class_a, expected_fraction_a, + expected_id_a, expected_identifier_a, expected_identifier_a_reserved, + expected_lang_a, expected_linear_a, expected_media_a, expected_name_a, + expected_nonstandard_style_attribute, expected_number_a, expected_operator_a, + expected_percent_a, expected_positive_a, expected_pseudo_a, + expected_selector_a, expected_small_a, expected_space_a_b, expected_string_a, + expected_style_attribute, expected_style_pattern, expected_tagname_a, + expected_type_a, f, fieldset, figure, filter, first, flag, float, floor, + font, 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', + 'font-style', 'font-variant', 'font-weight', footer, forEach, for_if, forin, + form, fragment, frame, frameset, from, fromCharCode, fud, funct, function, + function_block, function_eval, function_loop, function_statement, + function_strict, functions, global, globals, h1, h2, h3, h4, h5, h6, + handheld, hasOwnProperty, head, header, height, hgroup, hr, + 'hta:application', html, html_confusion_a, html_handlers, i, id, identifier, + identifier_function, iframe, img, immed, implied_evil, in, indent, indexOf, + infix_in, init, input, ins, insecure_a, isAlpha, isArray, isDigit, isNaN, + join, jslint, json, kbd, keygen, keys, label, label_a_b, labeled, lang, lbp, + leading_decimal_a, led, left, legend, length, 'letter-spacing', li, lib, + line, 'line-height', link, 'list-style', 'list-style-image', + 'list-style-position', 'list-style-type', map, margin, 'margin-bottom', + 'margin-left', 'margin-right', 'margin-top', mark, 'marker-offset', match, + 'max-height', 'max-width', maxerr, maxlen, member, menu, message, meta, + meter, 'min-height', 'min-width', missing_a, missing_a_after_b, + missing_option, missing_property, missing_space_a_b, missing_url, + missing_use_strict, mixed, mm, mode, move_invocation, move_var, n, name, + name_function, nav, nested_comment, newcap, node, noframes, nomen, noscript, + not, not_a_constructor, not_a_defined, not_a_function, not_a_label, + not_a_scope, not_greater, nud, number, object, octal_a, ol, on, opacity, + open, optgroup, option, outer, outline, 'outline-color', 'outline-style', + 'outline-width', output, overflow, 'overflow-x', 'overflow-y', p, padding, + 'padding-bottom', 'padding-left', 'padding-right', 'padding-top', + 'page-break-after', 'page-break-before', param, parameter_a_get_b, + parameter_arguments_a, parameter_set_a, params, paren, parent, passfail, pc, + plusplus, pop, position, postscript, pre, predef, print, progress, + projection, properties, prototype, pt, push, px, q, quote, quotes, r, radix, + range, raw, read_only, reason, redefinition_a, regexp, replace, report, + reserved, reserved_a, rhino, right, rp, rt, ruby, safe, samp, scanned_a_b, + screen, script, search, second, section, select, shift, slash_equal, slice, + sloppy, small, sort, source, span, speech, split, src, statement_block, + stopping, strange_loop, strict, string, strong, style, styleproperty, sub, + subscript, substr, sup, supplant, t, table, 'table-layout', tag_a_in_b, + tbody, td, test, 'text-align', 'text-decoration', 'text-indent', + 'text-shadow', 'text-transform', textarea, tfoot, th, thead, third, thru, + time, title, toLowerCase, toString, toUpperCase, token, too_long, too_many, + top, tr, trailing_decimal_a, tree, tt, tty, tv, type, u, ul, unclosed, + unclosed_comment, unclosed_regexp, undef, undefined, unescaped_a, + unexpected_a, unexpected_char_a_b, unexpected_comment, unexpected_else, + unexpected_property_a, unexpected_space_a_b, 'unicode-bidi', + unnecessary_initialize, unnecessary_use, unparam, unreachable_a_b, + unrecognized_style_attribute_a, unrecognized_tag_a, unsafe, unused, url, + urls, use_array, use_braces, use_charAt, use_object, use_or, use_param, + used_before_a, var, var_a_not, vars, 'vertical-align', video, visibility, + was, weird_assignment, weird_condition, weird_new, weird_program, + weird_relation, weird_ternary, white, 'white-space', widget, width, windows, + 'word-spacing', 'word-wrap', wrap, wrap_immediate, wrap_regexp, + write_is_wrong, writeable, 'z-index' +*/ + +// The global directive is used to declare global variables that can +// be accessed by the program. If a declaration is true, then the variable +// is writeable. Otherwise, it is read-only. + +// We build the application inside a function so that we produce only a single +// global variable. That function will be invoked immediately, and its return +// value is the JSLINT function itself. That function is also an object that +// can contain data and other functions. + +var JSLINT = (function () { + 'use strict'; + + function array_to_object(array, value) { + +// Make an object from an array of keys and a common value. + + var i, length = array.length, object = {}; + for (i = 0; i < length; i += 1) { + object[array[i]] = value; + } + return object; + } + + + var adsafe_id, // The widget's ADsafe id. + adsafe_may, // The widget may load approved scripts. + adsafe_top, // At the top of the widget script. + adsafe_went, // ADSAFE.go has been called. + allowed_option = { + anon : true, + bitwise : true, + browser : true, + cap : true, + 'continue': true, + css : true, + debug : true, + devel : true, + eqeq : true, + es5 : true, + evil : true, + forin : true, + fragment : true, + indent : 10, + maxerr : 1000, + maxlen : 256, + newcap : true, + node : true, + nomen : true, + on : true, + passfail : true, + plusplus : true, + properties: true, + regexp : true, + rhino : true, + undef : true, + unparam : true, + sloppy : true, + sub : true, + vars : true, + white : true, + jqmspace : true, + widget : true, + windows : true + }, + anonname, // The guessed name for anonymous functions. + approved, // ADsafe approved urls. + +// These are operators that should not be used with the ! operator. + + bang = { + '<' : true, + '<=' : true, + '==' : true, + '===': true, + '!==': true, + '!=' : true, + '>' : true, + '>=' : true, + '+' : true, + '-' : true, + '*' : true, + '/' : true, + '%' : true + }, + +// These are property names that should not be permitted in the safe subset. + + banned = array_to_object([ + 'arguments', 'callee', 'caller', 'constructor', 'eval', 'prototype', + 'stack', 'unwatch', 'valueOf', 'watch' + ], true), + begin, // The root token + +// browser contains a set of global names that are commonly provided by a +// web browser environment. + + browser = array_to_object([ + 'clearInterval', 'clearTimeout', 'document', 'event', 'frames', + 'history', 'Image', 'localStorage', 'location', 'name', 'navigator', + 'Option', 'parent', 'screen', 'sessionStorage', 'setInterval', + 'setTimeout', 'Storage', 'window', 'XMLHttpRequest' + ], false), + +// bundle contains the text messages. + + bundle = { + a_label: "'{a}' is a statement label.", + a_not_allowed: "'{a}' is not allowed.", + a_not_defined: "'{a}' is not defined.", + a_scope: "'{a}' used out of scope.", + adsafe_a: "ADsafe violation: '{a}'.", + adsafe_autocomplete: "ADsafe autocomplete violation.", + adsafe_bad_id: "ADSAFE violation: bad id.", + adsafe_div: "ADsafe violation: Wrap the widget in a div.", + adsafe_fragment: "ADSAFE: Use the fragment option.", + adsafe_go: "ADsafe violation: Misformed ADSAFE.go.", + adsafe_html: "Currently, ADsafe does not operate on whole HTML " + + "documents. It operates on
    fragments and .js files.", + adsafe_id: "ADsafe violation: id does not match.", + adsafe_id_go: "ADsafe violation: Missing ADSAFE.id or ADSAFE.go.", + adsafe_lib: "ADsafe lib violation.", + adsafe_lib_second: "ADsafe: The second argument to lib must be a function.", + adsafe_missing_id: "ADSAFE violation: missing ID_.", + adsafe_name_a: "ADsafe name violation: '{a}'.", + adsafe_placement: "ADsafe script placement violation.", + adsafe_prefix_a: "ADsafe violation: An id must have a '{a}' prefix", + adsafe_script: "ADsafe script violation.", + adsafe_source: "ADsafe unapproved script source.", + adsafe_subscript_a: "ADsafe subscript '{a}'.", + adsafe_tag: "ADsafe violation: Disallowed tag '{a}'.", + already_defined: "'{a}' is already defined.", + and: "The '&&' subexpression should be wrapped in parens.", + assign_exception: "Do not assign to the exception parameter.", + assignment_function_expression: "Expected an assignment or " + + "function call and instead saw an expression.", + attribute_case_a: "Attribute '{a}' not all lower case.", + avoid_a: "Avoid '{a}'.", + bad_assignment: "Bad assignment.", + bad_color_a: "Bad hex color '{a}'.", + bad_constructor: "Bad constructor.", + bad_entity: "Bad entity.", + bad_html: "Bad HTML string", + bad_id_a: "Bad id: '{a}'.", + bad_in_a: "Bad for in variable '{a}'.", + bad_invocation: "Bad invocation.", + bad_name_a: "Bad name: '{a}'.", + bad_new: "Do not use 'new' for side effects.", + bad_number: "Bad number '{a}'.", + bad_operand: "Bad operand.", + bad_style: "Bad style.", + bad_type: "Bad type.", + bad_url_a: "Bad url '{a}'.", + bad_wrap: "Do not wrap function literals in parens unless they " + + "are to be immediately invoked.", + combine_var: "Combine this with the previous 'var' statement.", + conditional_assignment: "Expected a conditional expression and " + + "instead saw an assignment.", + confusing_a: "Confusing use of '{a}'.", + confusing_regexp: "Confusing regular expression.", + constructor_name_a: "A constructor name '{a}' should start with " + + "an uppercase letter.", + control_a: "Unexpected control character '{a}'.", + css: "A css file should begin with @charset 'UTF-8';", + dangling_a: "Unexpected dangling '_' in '{a}'.", + dangerous_comment: "Dangerous comment.", + deleted: "Only properties should be deleted.", + duplicate_a: "Duplicate '{a}'.", + empty_block: "Empty block.", + empty_case: "Empty case.", + empty_class: "Empty class.", + es5: "This is an ES5 feature.", + evil: "eval is evil.", + expected_a: "Expected '{a}'.", + expected_a_b: "Expected '{a}' and instead saw '{b}'.", + expected_a_b_from_c_d: "Expected '{a}' to match '{b}' from line " + + "{c} and instead saw '{d}'.", + expected_at_a: "Expected an at-rule, and instead saw @{a}.", + expected_a_at_b_c: "Expected '{a}' at column {b}, not column {c}.", + expected_attribute_a: "Expected an attribute, and instead saw [{a}].", + expected_attribute_value_a: "Expected an attribute value and " + + "instead saw '{a}'.", + expected_class_a: "Expected a class, and instead saw .{a}.", + expected_fraction_a: "Expected a number between 0 and 1 and " + + "instead saw '{a}'", + expected_id_a: "Expected an id, and instead saw #{a}.", + expected_identifier_a: "Expected an identifier and instead saw '{a}'.", + expected_identifier_a_reserved: "Expected an identifier and " + + "instead saw '{a}' (a reserved word).", + expected_linear_a: "Expected a linear unit and instead saw '{a}'.", + expected_lang_a: "Expected a lang code, and instead saw :{a}.", + expected_media_a: "Expected a CSS media type, and instead saw '{a}'.", + expected_name_a: "Expected a name and instead saw '{a}'.", + expected_nonstandard_style_attribute: "Expected a non-standard " + + "style attribute and instead saw '{a}'.", + expected_number_a: "Expected a number and instead saw '{a}'.", + expected_operator_a: "Expected an operator and instead saw '{a}'.", + expected_percent_a: "Expected a percentage and instead saw '{a}'", + expected_positive_a: "Expected a positive number and instead saw '{a}'", + expected_pseudo_a: "Expected a pseudo, and instead saw :{a}.", + expected_selector_a: "Expected a CSS selector, and instead saw {a}.", + expected_small_a: "Expected a small positive integer and instead saw '{a}'", + expected_space_a_b: "Expected exactly one space between '{a}' and '{b}'.", + expected_string_a: "Expected a string and instead saw {a}.", + expected_style_attribute: "Excepted a style attribute, and instead saw '{a}'.", + expected_style_pattern: "Expected a style pattern, and instead saw '{a}'.", + expected_tagname_a: "Expected a tagName, and instead saw {a}.", + expected_type_a: "Expected a type, and instead saw {a}.", + for_if: "The body of a for in should be wrapped in an if " + + "statement to filter unwanted properties from the prototype.", + function_block: "Function statements should not be placed in blocks. " + + "Use a function expression or move the statement to the top of " + + "the outer function.", + function_eval: "The Function constructor is eval.", + function_loop: "Don't make functions within a loop.", + function_statement: "Function statements are not invocable. " + + "Wrap the whole function invocation in parens.", + function_strict: "Use the function form of 'use strict'.", + html_confusion_a: "HTML confusion in regular expression '<{a}'.", + html_handlers: "Avoid HTML event handlers.", + identifier_function: "Expected an identifier in an assignment " + + "and instead saw a function invocation.", + implied_evil: "Implied eval is evil. Pass a function instead of a string.", + infix_in: "Unexpected 'in'. Compare with undefined, or use the " + + "hasOwnProperty method instead.", + insecure_a: "Insecure '{a}'.", + isNaN: "Use the isNaN function to compare with NaN.", + label_a_b: "Label '{a}' on '{b}' statement.", + lang: "lang is deprecated.", + leading_decimal_a: "A leading decimal point can be confused with a dot: '.{a}'.", + missing_a: "Missing '{a}'.", + missing_a_after_b: "Missing '{a}' after '{b}'.", + missing_option: "Missing option value.", + missing_property: "Missing property name.", + missing_space_a_b: "Missing space between '{a}' and '{b}'.", + missing_url: "Missing url.", + missing_use_strict: "Missing 'use strict' statement.", + mixed: "Mixed spaces and tabs.", + move_invocation: "Move the invocation into the parens that " + + "contain the function.", + move_var: "Move 'var' declarations to the top of the function.", + name_function: "Missing name in function statement.", + nested_comment: "Nested comment.", + not: "Nested not.", + not_a_constructor: "Do not use {a} as a constructor.", + not_a_defined: "'{a}' has not been fully defined yet.", + not_a_function: "'{a}' is not a function.", + not_a_label: "'{a}' is not a label.", + not_a_scope: "'{a}' is out of scope.", + not_greater: "'{a}' should not be greater than '{b}'.", + octal_a: "Don't use octal: '{a}'. Use '\\u....' instead.", + parameter_arguments_a: "Do not mutate parameter '{a}' when using 'arguments'.", + parameter_a_get_b: "Unexpected parameter '{a}' in get {b} function.", + parameter_set_a: "Expected parameter (value) in set {a} function.", + radix: "Missing radix parameter.", + read_only: "Read only.", + redefinition_a: "Redefinition of '{a}'.", + reserved_a: "Reserved name '{a}'.", + scanned_a_b: "{a} ({b}% scanned).", + slash_equal: "A regular expression literal can be confused with '/='.", + statement_block: "Expected to see a statement and instead saw a block.", + stopping: "Stopping. ", + strange_loop: "Strange loop.", + strict: "Strict violation.", + subscript: "['{a}'] is better written in dot notation.", + tag_a_in_b: "A '<{a}>' must be within '<{b}>'.", + too_long: "Line too long.", + too_many: "Too many errors.", + trailing_decimal_a: "A trailing decimal point can be confused " + + "with a dot: '.{a}'.", + type: "type is unnecessary.", + unclosed: "Unclosed string.", + unclosed_comment: "Unclosed comment.", + unclosed_regexp: "Unclosed regular expression.", + unescaped_a: "Unescaped '{a}'.", + unexpected_a: "Unexpected '{a}'.", + unexpected_char_a_b: "Unexpected character '{a}' in {b}.", + unexpected_comment: "Unexpected comment.", + unexpected_else: "Unexpected 'else' after 'return'.", + unexpected_property_a: "Unexpected /*property*/ '{a}'.", + unexpected_space_a_b: "Unexpected space between '{a}' and '{b}'.", + unnecessary_initialize: "It is not necessary to initialize '{a}' " + + "to 'undefined'.", + unnecessary_use: "Unnecessary 'use strict'.", + unreachable_a_b: "Unreachable '{a}' after '{b}'.", + unrecognized_style_attribute_a: "Unrecognized style attribute '{a}'.", + unrecognized_tag_a: "Unrecognized tag '<{a}>'.", + unsafe: "Unsafe character.", + url: "JavaScript URL.", + use_array: "Use the array literal notation [].", + use_braces: "Spaces are hard to count. Use {{a}}.", + use_charAt: "Use the charAt method.", + use_object: "Use the object literal notation {}.", + use_or: "Use the || operator.", + use_param: "Use a named parameter.", + used_before_a: "'{a}' was used before it was defined.", + var_a_not: "Variable {a} was not declared correctly.", + weird_assignment: "Weird assignment.", + weird_condition: "Weird condition.", + weird_new: "Weird construction. Delete 'new'.", + weird_program: "Weird program.", + weird_relation: "Weird relation.", + weird_ternary: "Weird ternary.", + wrap_immediate: "Wrap an immediate function invocation in parentheses " + + "to assist the reader in understanding that the expression " + + "is the result of a function, and not the function itself.", + wrap_regexp: "Wrap the /regexp/ literal in parens to " + + "disambiguate the slash operator.", + write_is_wrong: "document.write can be a form of eval." + }, + comments_off, + css_attribute_data, + css_any, + + css_colorData = array_to_object([ + "aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige", + "bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown", + "burlywood", "cadetblue", "chartreuse", "chocolate", "coral", + "cornflowerblue", "cornsilk", "crimson", "cyan", "darkblue", + "darkcyan", "darkgoldenrod", "darkgray", "darkgreen", "darkkhaki", + "darkmagenta", "darkolivegreen", "darkorange", "darkorchid", + "darkred", "darksalmon", "darkseagreen", "darkslateblue", + "darkslategray", "darkturquoise", "darkviolet", "deeppink", + "deepskyblue", "dimgray", "dodgerblue", "firebrick", "floralwhite", + "forestgreen", "fuchsia", "gainsboro", "ghostwhite", "gold", + "goldenrod", "gray", "green", "greenyellow", "honeydew", "hotpink", + "indianred", "indigo", "ivory", "khaki", "lavender", + "lavenderblush", "lawngreen", "lemonchiffon", "lightblue", + "lightcoral", "lightcyan", "lightgoldenrodyellow", "lightgreen", + "lightpink", "lightsalmon", "lightseagreen", "lightskyblue", + "lightslategray", "lightsteelblue", "lightyellow", "lime", + "limegreen", "linen", "magenta", "maroon", "mediumaquamarine", + "mediumblue", "mediumorchid", "mediumpurple", "mediumseagreen", + "mediumslateblue", "mediumspringgreen", "mediumturquoise", + "mediumvioletred", "midnightblue", "mintcream", "mistyrose", + "moccasin", "navajowhite", "navy", "oldlace", "olive", "olivedrab", + "orange", "orangered", "orchid", "palegoldenrod", "palegreen", + "paleturquoise", "palevioletred", "papayawhip", "peachpuff", + "peru", "pink", "plum", "powderblue", "purple", "red", "rosybrown", + "royalblue", "saddlebrown", "salmon", "sandybrown", "seagreen", + "seashell", "sienna", "silver", "skyblue", "slateblue", "slategray", + "snow", "springgreen", "steelblue", "tan", "teal", "thistle", + "tomato", "turquoise", "violet", "wheat", "white", "whitesmoke", + "yellow", "yellowgreen", + + "activeborder", "activecaption", "appworkspace", "background", + "buttonface", "buttonhighlight", "buttonshadow", "buttontext", + "captiontext", "graytext", "highlight", "highlighttext", + "inactiveborder", "inactivecaption", "inactivecaptiontext", + "infobackground", "infotext", "menu", "menutext", "scrollbar", + "threeddarkshadow", "threedface", "threedhighlight", + "threedlightshadow", "threedshadow", "window", "windowframe", + "windowtext" + ], true), + + css_border_style, + css_break, + + css_lengthData = { + '%': true, + 'cm': true, + 'em': true, + 'ex': true, + 'in': true, + 'mm': true, + 'pc': true, + 'pt': true, + 'px': true + }, + + css_media, + css_overflow, + + descapes = { + 'b': '\b', + 't': '\t', + 'n': '\n', + 'f': '\f', + 'r': '\r', + '"': '"', + '/': '/', + '\\': '\\' + }, + + devel = array_to_object([ + 'alert', 'confirm', 'console', 'Debug', 'opera', 'prompt', 'WSH' + ], false), + directive, + escapes = { + '\b': '\\b', + '\t': '\\t', + '\n': '\\n', + '\f': '\\f', + '\r': '\\r', + '\'': '\\\'', + '"' : '\\"', + '/' : '\\/', + '\\': '\\\\' + }, + + funct, // The current function, including the labels used in + // the function, as well as (breakage), + // (context), (loopage), (name), (params), (token), + // (vars), (verb) + + functionicity = [ + 'closure', 'exception', 'global', 'label', 'outer', 'undef', + 'unused', 'var' + ], + + functions, // All of the functions + global_funct, // The global body + global_scope, // The global scope + html_tag = { + a: {}, + abbr: {}, + acronym: {}, + address: {}, + applet: {}, + area: {empty: true, parent: ' map '}, + article: {}, + aside: {}, + audio: {}, + b: {}, + base: {empty: true, parent: ' head '}, + bdo: {}, + big: {}, + blockquote: {}, + body: {parent: ' html noframes '}, + br: {empty: true}, + button: {}, + canvas: {parent: ' body p div th td '}, + caption: {parent: ' table '}, + center: {}, + cite: {}, + code: {}, + col: {empty: true, parent: ' table colgroup '}, + colgroup: {parent: ' table '}, + command: {parent: ' menu '}, + datalist: {}, + dd: {parent: ' dl '}, + del: {}, + details: {}, + dialog: {}, + dfn: {}, + dir: {}, + div: {}, + dl: {}, + dt: {parent: ' dl '}, + em: {}, + embed: {}, + fieldset: {}, + figure: {}, + font: {}, + footer: {}, + form: {}, + frame: {empty: true, parent: ' frameset '}, + frameset: {parent: ' html frameset '}, + h1: {}, + h2: {}, + h3: {}, + h4: {}, + h5: {}, + h6: {}, + head: {parent: ' html '}, + header: {}, + hgroup: {}, + hr: {empty: true}, + 'hta:application': + {empty: true, parent: ' head '}, + html: {parent: '*'}, + i: {}, + iframe: {}, + img: {empty: true}, + input: {empty: true}, + ins: {}, + kbd: {}, + keygen: {}, + label: {}, + legend: {parent: ' details fieldset figure '}, + li: {parent: ' dir menu ol ul '}, + link: {empty: true, parent: ' head '}, + map: {}, + mark: {}, + menu: {}, + meta: {empty: true, parent: ' head noframes noscript '}, + meter: {}, + nav: {}, + noframes: {parent: ' html body '}, + noscript: {parent: ' body head noframes '}, + object: {}, + ol: {}, + optgroup: {parent: ' select '}, + option: {parent: ' optgroup select '}, + output: {}, + p: {}, + param: {empty: true, parent: ' applet object '}, + pre: {}, + progress: {}, + q: {}, + rp: {}, + rt: {}, + ruby: {}, + samp: {}, + script: {empty: true, parent: ' body div frame head iframe p pre span '}, + section: {}, + select: {}, + small: {}, + span: {}, + source: {}, + strong: {}, + style: {parent: ' head ', empty: true}, + sub: {}, + sup: {}, + table: {}, + tbody: {parent: ' table '}, + td: {parent: ' tr '}, + textarea: {}, + tfoot: {parent: ' table '}, + th: {parent: ' tr '}, + thead: {parent: ' table '}, + time: {}, + title: {parent: ' head '}, + tr: {parent: ' table tbody thead tfoot '}, + tt: {}, + u: {}, + ul: {}, + 'var': {}, + video: {} + }, + + ids, // HTML ids + in_block, + indent, + itself, // JSLint itself + json_mode, + lex, // the tokenizer + lines, + lookahead, + node = array_to_object([ + 'Buffer', 'clearInterval', 'clearTimeout', 'console', 'exports', + 'global', 'module', 'process', 'querystring', 'require', + 'setInterval', 'setTimeout', '__dirname', '__filename' + ], false), + node_js, + numbery = array_to_object(['indexOf', 'lastIndexOf', 'search'], true), + next_token, + option, + predefined, // Global variables defined by option + prereg, + prev_token, + property, + regexp_flag = array_to_object(['g', 'i', 'm'], true), + return_this = function return_this() { + return this; + }, + rhino = array_to_object([ + 'defineClass', 'deserialize', 'gc', 'help', 'load', 'loadClass', + 'print', 'quit', 'readFile', 'readUrl', 'runCommand', 'seal', + 'serialize', 'spawn', 'sync', 'toint32', 'version' + ], false), + + scope, // An object containing an object for each variable in scope + semicolon_coda = array_to_object([';', '"', '\'', ')'], true), + src, + stack, + +// standard contains the global names that are provided by the +// ECMAScript standard. + + standard = array_to_object([ + 'Array', 'Boolean', 'Date', 'decodeURI', 'decodeURIComponent', + 'encodeURI', 'encodeURIComponent', 'Error', 'eval', 'EvalError', + 'Function', 'isFinite', 'isNaN', 'JSON', 'Math', 'Number', + 'Object', 'parseInt', 'parseFloat', 'RangeError', 'ReferenceError', + 'RegExp', 'String', 'SyntaxError', 'TypeError', 'URIError' + ], false), + + strict_mode, + syntax = {}, + tab, + token, + urls, + var_mode, + warnings, + +// widget contains the global names which are provided to a Yahoo +// (fna Konfabulator) widget. + + widget = array_to_object([ + 'alert', 'animator', 'appleScript', 'beep', 'bytesToUIString', + 'Canvas', 'chooseColor', 'chooseFile', 'chooseFolder', + 'closeWidget', 'COM', 'convertPathToHFS', 'convertPathToPlatform', + 'CustomAnimation', 'escape', 'FadeAnimation', 'filesystem', 'Flash', + 'focusWidget', 'form', 'FormField', 'Frame', 'HotKey', 'Image', + 'include', 'isApplicationRunning', 'iTunes', 'konfabulatorVersion', + 'log', 'md5', 'MenuItem', 'MoveAnimation', 'openURL', 'play', + 'Point', 'popupMenu', 'preferenceGroups', 'preferences', 'print', + 'prompt', 'random', 'Rectangle', 'reloadWidget', 'ResizeAnimation', + 'resolvePath', 'resumeUpdates', 'RotateAnimation', 'runCommand', + 'runCommandInBg', 'saveAs', 'savePreferences', 'screen', + 'ScrollBar', 'showWidgetPreferences', 'sleep', 'speak', 'Style', + 'suppressUpdates', 'system', 'tellWidget', 'Text', 'TextArea', + 'Timer', 'unescape', 'updateNow', 'URL', 'Web', 'widget', 'Window', + 'XMLDOM', 'XMLHttpRequest', 'yahooCheckLogin', 'yahooLogin', + 'yahooLogout' + ], true), + + windows = array_to_object([ + 'ActiveXObject', 'CScript', 'Debug', 'Enumerator', 'System', + 'VBArray', 'WScript', 'WSH' + ], false), + +// xmode is used to adapt to the exceptions in html parsing. +// It can have these states: +// '' .js script file +// 'html' +// 'outer' +// 'script' +// 'style' +// 'scriptstring' +// 'styleproperty' + + xmode, + xquote, + +// Regular expressions. Some of these are stupidly long. + +// unsafe comment or string + ax = /@cc|<\/?|script|\]\s*\]|<\s*!|</i, +// carriage return, carriage return linefeed, or linefeed + crlfx = /\r\n?|\n/, +// unsafe characters that are silently deleted by one or more browsers + cx = /[\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/, +// query characters for ids + dx = /[\[\]\/\\"'*<>.&:(){}+=#]/, +// html token + hx = /^\s*(['"=>\/&#]|<(?:\/|\!(?:--)?)?|[a-zA-Z][a-zA-Z0-9_\-:]*|[0-9]+|--)/, +// identifier + ix = /^([a-zA-Z_$][a-zA-Z0-9_$]*)$/, +// javascript url + jx = /^(?:javascript|jscript|ecmascript|vbscript|mocha|livescript)\s*:/i, +// star slash + lx = /\*\/|\/\*/, +// characters in strings that need escapement + nx = /[\u0000-\u001f'\\\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, +// outer html token + ox = /[>&]|<[\/!]?|--/, +// attributes characters + qx = /[^a-zA-Z0-9+\-_\/. ]/, +// style + sx = /^\s*([{}:#%.=,>+\[\]@()"';]|[*$\^~]=|[a-zA-Z_][a-zA-Z0-9_\-]*|[0-9]+|<\/|\/\*)/, + ssx = /^\s*([@#!"'};:\-%.=,+\[\]()*_]|[a-zA-Z][a-zA-Z0-9._\-]*|\/\*?|\d+(?:\.\d+)?|<\/)/, +// token + tx = /^\s*([(){}\[\]\?.,:;'"~#@`]|={1,3}|\/(\*(jslint|properties|property|members?|globals?)?|=|\/)?|\*[\/=]?|\+(?:=|\++)?|-(?:=|-+)?|[\^%]=?|&[&=]?|\|[|=]?|>{1,3}=?|<(?:[\/=!]|\!(\[|--)?|<=?)?|\!={0,2}|[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+(?:[xX][0-9a-fA-F]+|\.[0-9]*)?(?:[eE][+\-]?[0-9]+)?)/, +// url badness + ux = /&|\+|\u00AD|\.\.|\/\*|%[^;]|base64|url|expression|data|mailto|script/i, + + rx = { + outer: hx, + html: hx, + style: sx, + styleproperty: ssx + }; + + + function F() {} // Used by Object.create + +// Provide critical ES5 functions to ES3. + + if (typeof Array.prototype.filter !== 'function') { + Array.prototype.filter = function (f) { + var i, length = this.length, result = [], value; + for (i = 0; i < length; i += 1) { + try { + value = this[i]; + if (f(value)) { + result.push(value); + } + } catch (ignore) { + } + } + return result; + }; + } + + if (typeof Array.prototype.forEach !== 'function') { + Array.prototype.forEach = function (f) { + var i, length = this.length; + for (i = 0; i < length; i += 1) { + try { + f(this[i]); + } catch (ignore) { + } + } + }; + } + + if (typeof Array.isArray !== 'function') { + Array.isArray = function (o) { + return Object.prototype.toString.apply(o) === '[object Array]'; + }; + } + + if (!Object.prototype.hasOwnProperty.call(Object, 'create')) { + Object.create = function (o) { + F.prototype = o; + return new F(); + }; + } + + if (typeof Object.keys !== 'function') { + Object.keys = function (o) { + var array = [], key; + for (key in o) { + if (Object.prototype.hasOwnProperty.call(o, key)) { + array.push(key); + } + } + return array; + }; + } + + if (typeof String.prototype.entityify !== 'function') { + String.prototype.entityify = function () { + return this + .replace(/&/g, '&') + .replace(//g, '>'); + }; + } + + if (typeof String.prototype.isAlpha !== 'function') { + String.prototype.isAlpha = function () { + return (this >= 'a' && this <= 'z\uffff') || + (this >= 'A' && this <= 'Z\uffff'); + }; + } + + if (typeof String.prototype.isDigit !== 'function') { + String.prototype.isDigit = function () { + return (this >= '0' && this <= '9'); + }; + } + + if (typeof String.prototype.supplant !== 'function') { + String.prototype.supplant = function (o) { + return this.replace(/\{([^{}]*)\}/g, function (a, b) { + var replacement = o[b]; + return typeof replacement === 'string' || + typeof replacement === 'number' ? replacement : a; + }); + }; + } + + + function sanitize(a) { + +// Escapify a troublesome character. + + return escapes[a] || + '\\u' + ('0000' + a.charCodeAt().toString(16)).slice(-4); + } + + + function add_to_predefined(group) { + Object.keys(group).forEach(function (name) { + predefined[name] = group[name]; + }); + } + + + function assume() { + if (!option.safe) { + if (option.rhino) { + add_to_predefined(rhino); + option.rhino = false; + } + if (option.devel) { + add_to_predefined(devel); + option.devel = false; + } + if (option.browser) { + add_to_predefined(browser); + option.browser = false; + } + if (option.windows) { + add_to_predefined(windows); + option.windows = false; + } + if (option.node) { + add_to_predefined(node); + option.node = false; + node_js = true; + } + if (option.widget) { + add_to_predefined(widget); + option.widget = false; + } + } + } + + +// Produce an error warning. + + function artifact(tok) { + if (!tok) { + tok = next_token; + } + return tok.number || tok.string; + } + + function quit(message, line, character) { + throw { + name: 'JSLintError', + line: line, + character: character, + message: bundle.scanned_a_b.supplant({ + a: message, + b: Math.floor((line / lines.length) * 100) + }) + }; + } + + function warn(message, offender, a, b, c, d) { + var character, line, warning; + offender = offender || next_token; // ~~ + line = offender.line || 0; + character = offender.from || 0; + warning = { + id: '(error)', + raw: bundle[message] || message, + evidence: lines[line - 1] || '', + line: line, + character: character, + a: a || (offender.id === '(number)' + ? String(offender.number) + : offender.string), + b: b, + c: c, + d: d + }; + warning.reason = warning.raw.supplant(warning); + JSLINT.errors.push(warning); + if (option.passfail) { + quit(bundle.stopping, line, character); + } + warnings += 1; + if (warnings >= option.maxerr) { + quit(bundle.too_many, line, character); + } + return warning; + } + + function warn_at(message, line, character, a, b, c, d) { + return warn(message, { + line: line, + from: character + }, a, b, c, d); + } + + function stop(message, offender, a, b, c, d) { + var warning = warn(message, offender, a, b, c, d); + quit(bundle.stopping, warning.line, warning.character); + } + + function stop_at(message, line, character, a, b, c, d) { + return stop(message, { + line: line, + from: character + }, a, b, c, d); + } + + function expected_at(at) { + if (!option.white && next_token.from !== at) { + warn('expected_a_at_b_c', next_token, '', at, + next_token.from); + } + } + + function aint(it, name, expected) { + if (it[name] !== expected) { + warn('expected_a_b', it, expected, it[name]); + return true; + } + return false; + } + + +// lexical analysis and token construction + + lex = (function lex() { + var character, c, from, length, line, pos, source_row; + +// Private lex methods + + function next_line() { + var at; + if (line >= lines.length) { + return false; + } + character = 1; + source_row = lines[line]; + line += 1; + at = source_row.search(/ \t/); + if (at >= 0) { + warn_at('mixed', line, at + 1); + } + source_row = source_row.replace(/\t/g, tab); + at = source_row.search(cx); + if (at >= 0) { + warn_at('unsafe', line, at); + } + if (option.maxlen && option.maxlen < source_row.length) { + warn_at('too_long', line, source_row.length); + } + return true; + } + +// Produce a token object. The token inherits from a syntax symbol. + + function it(type, value) { + var id, the_token; + if (type === '(string)' || type === '(range)') { + if (jx.test(value)) { + warn_at('url', line, from); + } + } + the_token = Object.create(syntax[( + type === '(punctuator)' || (type === '(identifier)' && + Object.prototype.hasOwnProperty.call(syntax, value)) + ? value + : type + )] || syntax['(error)']); + if (type === '(identifier)') { + the_token.identifier = true; + if (value === '__iterator__' || value === '__proto__') { + stop_at('reserved_a', line, from, value); + } else if (!option.nomen && + (value.charAt(0) === '_' || + value.charAt(value.length - 1) === '_')) { + warn_at('dangling_a', line, from, value); + } + } + if (type === '(number)') { + the_token.number = +value; + } else if (value !== undefined) { + the_token.string = String(value); + } + the_token.line = line; + the_token.from = from; + the_token.thru = character; + id = the_token.id; + prereg = id && ( + ('(,=:[!&|?{};'.indexOf(id.charAt(id.length - 1)) >= 0) || + id === 'return' || id === 'case' + ); + return the_token; + } + + function match(x) { + var exec = x.exec(source_row), first; + if (exec) { + length = exec[0].length; + first = exec[1]; + c = first.charAt(0); + source_row = source_row.slice(length); + from = character + length - first.length; + character += length; + return first; + } + } + + function string(x) { + var c, pos = 0, r = '', result; + + function hex(n) { + var i = parseInt(source_row.substr(pos + 1, n), 16); + pos += n; + if (i >= 32 && i <= 126 && + i !== 34 && i !== 92 && i !== 39) { + warn_at('unexpected_a', line, character, '\\'); + } + character += n; + c = String.fromCharCode(i); + } + + if (json_mode && x !== '"') { + warn_at('expected_a', line, character, '"'); + } + + if (xquote === x || (xmode === 'scriptstring' && !xquote)) { + return it('(punctuator)', x); + } + + for (;;) { + while (pos >= source_row.length) { + pos = 0; + if (xmode !== 'html' || !next_line()) { + stop_at('unclosed', line, from); + } + } + c = source_row.charAt(pos); + if (c === x) { + character += 1; + source_row = source_row.slice(pos + 1); + result = it('(string)', r); + result.quote = x; + return result; + } + if (c < ' ') { + if (c === '\n' || c === '\r') { + break; + } + warn_at('control_a', line, character + pos, + source_row.slice(0, pos)); + } else if (c === xquote) { + warn_at('bad_html', line, character + pos); + } else if (c === '<') { + if (option.safe && xmode === 'html') { + warn_at('adsafe_a', line, character + pos, c); + } else if (source_row.charAt(pos + 1) === '/' && (xmode || option.safe)) { + warn_at('expected_a_b', line, character, + '<\\/', '= '0' && c <= '7' ? 'octal_a' : 'unexpected_a', + line, character, '\\' + c); + } else { + c = descapes[c]; + } + } + } + } + r += c; + character += 1; + pos += 1; + } + } + + function number(snippet) { + var digit; + if (xmode !== 'style' && xmode !== 'styleproperty' && + source_row.charAt(0).isAlpha()) { + warn_at('expected_space_a_b', + line, character, c, source_row.charAt(0)); + } + if (c === '0') { + digit = snippet.charAt(1); + if (digit.isDigit()) { + if (token.id !== '.' && xmode !== 'styleproperty') { + warn_at('unexpected_a', line, character, snippet); + } + } else if (json_mode && (digit === 'x' || digit === 'X')) { + warn_at('unexpected_a', line, character, '0x'); + } + } + if (snippet.slice(snippet.length - 1) === '.') { + warn_at('trailing_decimal_a', line, character, snippet); + } + if (xmode !== 'style') { + digit = +snippet; + if (!isFinite(digit)) { + warn_at('bad_number', line, character, snippet); + } + snippet = digit; + } + return it('(number)', snippet); + } + + function comment(snippet) { + if (comments_off || src || (xmode && xmode !== 'script' && + xmode !== 'style' && xmode !== 'styleproperty')) { + warn_at('unexpected_comment', line, character); + } else if (xmode === 'script' && /<\//i.test(source_row)) { + warn_at('unexpected_a', line, character, '<\/'); + } else if (option.safe && ax.test(snippet)) { + warn_at('dangerous_comment', line, character); + } + } + + function regexp() { + var b, + bit, + captures = 0, + depth = 0, + flag = '', + high, + letter, + length = 0, + low, + potential, + quote, + result; + for (;;) { + b = true; + c = source_row.charAt(length); + length += 1; + switch (c) { + case '': + stop_at('unclosed_regexp', line, from); + return; + case '/': + if (depth > 0) { + warn_at('unescaped_a', line, from + length, '/'); + } + c = source_row.slice(0, length - 1); + potential = Object.create(regexp_flag); + for (;;) { + letter = source_row.charAt(length); + if (potential[letter] !== true) { + break; + } + potential[letter] = false; + length += 1; + flag += letter; + } + if (source_row.charAt(length).isAlpha()) { + stop_at('unexpected_a', line, from, source_row.charAt(length)); + } + character += length; + source_row = source_row.slice(length); + quote = source_row.charAt(0); + if (quote === '/' || quote === '*') { + stop_at('confusing_regexp', line, from); + } + result = it('(regexp)', c); + result.flag = flag; + return result; + case '\\': + c = source_row.charAt(length); + if (c < ' ') { + warn_at('control_a', line, from + length, String(c)); + } else if (c === '<') { + warn_at(bundle.unexpected_a, line, from + length, '\\'); + } + length += 1; + break; + case '(': + depth += 1; + b = false; + if (source_row.charAt(length) === '?') { + length += 1; + switch (source_row.charAt(length)) { + case ':': + case '=': + case '!': + length += 1; + break; + default: + warn_at(bundle.expected_a_b, line, from + length, + ':', source_row.charAt(length)); + } + } else { + captures += 1; + } + break; + case '|': + b = false; + break; + case ')': + if (depth === 0) { + warn_at('unescaped_a', line, from + length, ')'); + } else { + depth -= 1; + } + break; + case ' ': + pos = 1; + while (source_row.charAt(length) === ' ') { + length += 1; + pos += 1; + } + if (pos > 1) { + warn_at('use_braces', line, from + length, pos); + } + break; + case '[': + c = source_row.charAt(length); + if (c === '^') { + length += 1; + if (!option.regexp) { + warn_at('insecure_a', line, from + length, c); + } else if (source_row.charAt(length) === ']') { + stop_at('unescaped_a', line, from + length, '^'); + } + } + bit = false; + if (c === ']') { + warn_at('empty_class', line, from + length - 1); + bit = true; + } +klass: do { + c = source_row.charAt(length); + length += 1; + switch (c) { + case '[': + case '^': + warn_at('unescaped_a', line, from + length, c); + bit = true; + break; + case '-': + if (bit) { + bit = false; + } else { + warn_at('unescaped_a', line, from + length, '-'); + bit = true; + } + break; + case ']': + if (!bit) { + warn_at('unescaped_a', line, from + length - 1, '-'); + } + break klass; + case '\\': + c = source_row.charAt(length); + if (c < ' ') { + warn_at(bundle.control_a, line, from + length, String(c)); + } else if (c === '<') { + warn_at(bundle.unexpected_a, line, from + length, '\\'); + } + length += 1; + bit = true; + break; + case '/': + warn_at('unescaped_a', line, from + length - 1, '/'); + bit = true; + break; + case '<': + if (xmode === 'script') { + c = source_row.charAt(length); + if (c === '!' || c === '/') { + warn_at(bundle.html_confusion_a, line, + from + length, c); + } + } + bit = true; + break; + default: + bit = true; + } + } while (c); + break; + case '.': + if (!option.regexp) { + warn_at('insecure_a', line, from + length, c); + } + break; + case ']': + case '?': + case '{': + case '}': + case '+': + case '*': + warn_at('unescaped_a', line, from + length, c); + break; + case '<': + if (xmode === 'script') { + c = source_row.charAt(length); + if (c === '!' || c === '/') { + warn_at(bundle.html_confusion_a, line, from + length, c); + } + } + break; + } + if (b) { + switch (source_row.charAt(length)) { + case '?': + case '+': + case '*': + length += 1; + if (source_row.charAt(length) === '?') { + length += 1; + } + break; + case '{': + length += 1; + c = source_row.charAt(length); + if (c < '0' || c > '9') { + warn_at(bundle.expected_number_a, line, + from + length, c); + } + length += 1; + low = +c; + for (;;) { + c = source_row.charAt(length); + if (c < '0' || c > '9') { + break; + } + length += 1; + low = +c + (low * 10); + } + high = low; + if (c === ',') { + length += 1; + high = Infinity; + c = source_row.charAt(length); + if (c >= '0' && c <= '9') { + length += 1; + high = +c; + for (;;) { + c = source_row.charAt(length); + if (c < '0' || c > '9') { + break; + } + length += 1; + high = +c + (high * 10); + } + } + } + if (source_row.charAt(length) !== '}') { + warn_at(bundle.expected_a_b, line, from + length, + '}', c); + } else { + length += 1; + } + if (source_row.charAt(length) === '?') { + length += 1; + } + if (low > high) { + warn_at(bundle.not_greater, line, from + length, + low, high); + } + break; + } + } + } + c = source_row.slice(0, length - 1); + character += length; + source_row = source_row.slice(length); + return it('(regexp)', c); + } + +// Public lex methods + + return { + init: function (source) { + if (typeof source === 'string') { + lines = source.split(crlfx); + } else { + lines = source; + } + line = 0; + next_line(); + from = 1; + }, + + range: function (begin, end) { + var c, value = ''; + from = character; + if (source_row.charAt(0) !== begin) { + stop_at('expected_a_b', line, character, begin, + source_row.charAt(0)); + } + for (;;) { + source_row = source_row.slice(1); + character += 1; + c = source_row.charAt(0); + switch (c) { + case '': + stop_at('missing_a', line, character, c); + break; + case end: + source_row = source_row.slice(1); + character += 1; + return it('(range)', value); + case xquote: + case '\\': + warn_at('unexpected_a', line, character, c); + break; + } + value += c; + } + }, + +// token -- this is called by advance to get the next token. + + token: function () { + var c, i, snippet; + + for (;;) { + while (!source_row) { + if (!next_line()) { + return it('(end)'); + } + } + while (xmode === 'outer') { + i = source_row.search(ox); + if (i === 0) { + break; + } else if (i > 0) { + character += 1; + source_row = source_row.slice(i); + break; + } else { + if (!next_line()) { + return it('(end)', ''); + } + } + } + snippet = match(rx[xmode] || tx); + if (!snippet) { + if (source_row) { + if (source_row.charAt(0) === ' ') { + if (!option.white) { + warn_at('unexpected_a', line, character, + '(space)'); + } + character += 1; + source_row = ''; + } else { + stop_at('unexpected_a', line, character, + source_row.charAt(0)); + } + } + } else { + +// identifier + + c = snippet.charAt(0); + if (c.isAlpha() || c === '_' || c === '$') { + return it('(identifier)', snippet); + } + +// number + + if (c.isDigit()) { + return number(snippet); + } + switch (snippet) { + +// string + + case '"': + case "'": + return string(snippet); + +// // comment + + case '//': + comment(source_row); + source_row = ''; + break; + +// /* comment + + case '/*': + for (;;) { + i = source_row.search(lx); + if (i >= 0) { + break; + } + comment(source_row); + if (!next_line()) { + stop_at('unclosed_comment', line, character); + } + } + comment(source_row.slice(0, i)); + character += i + 2; + if (source_row.charAt(i) === '/') { + stop_at('nested_comment', line, character); + } + source_row = source_row.slice(i + 2); + break; + + case '': + break; +// / + case '/': + if (token.id === '/=') { + stop_at( + bundle.slash_equal, + line, + from + ); + } + return prereg + ? regexp() + : it('(punctuator)', snippet); + +// punctuator + + case ''); + } + character += 3; + source_row = source_row.slice(i + 3); + break; + case '#': + if (xmode === 'html' || xmode === 'styleproperty') { + for (;;) { + c = source_row.charAt(0); + if ((c < '0' || c > '9') && + (c < 'a' || c > 'f') && + (c < 'A' || c > 'F')) { + break; + } + character += 1; + source_row = source_row.slice(1); + snippet += c; + } + if (snippet.length !== 4 && snippet.length !== 7) { + warn_at('bad_color_a', line, + from + length, snippet); + } + return it('(color)', snippet); + } + return it('(punctuator)', snippet); + + default: + if (xmode === 'outer' && c === '&') { + character += 1; + source_row = source_row.slice(1); + for (;;) { + c = source_row.charAt(0); + character += 1; + source_row = source_row.slice(1); + if (c === ';') { + break; + } + if (!((c >= '0' && c <= '9') || + (c >= 'a' && c <= 'z') || + c === '#')) { + stop_at('bad_entity', line, from + length, + character); + } + } + break; + } + return it('(punctuator)', snippet); + } + } + } + } + }; + }()); + + + function add_label(token, kind, name) { + +// Define the symbol in the current function in the current scope. + + name = name || token.string; + +// Global variables cannot be created in the safe subset. If a global variable +// already exists, do nothing. If it is predefined, define it. + + if (funct === global_funct) { + if (option.safe) { + warn('adsafe_a', token, name); + } + if (typeof global_funct[name] !== 'string') { + token.writeable = typeof predefined[name] === 'boolean' + ? predefined[name] + : true; + token.funct = funct; + global_scope[name] = token; + } + if (kind === 'becoming') { + kind = 'var'; + } + +// Ordinary variables. + + } else { + +// Warn if the variable already exists. + + if (typeof funct[name] === 'string') { + if (funct[name] === 'undef') { + if (!option.undef) { + warn('used_before_a', token, name); + } + kind = 'var'; + } else { + warn('already_defined', token, name); + } + } else { + +// Add the symbol to the current function. + + token.funct = funct; + token.writeable = true; + scope[name] = token; + } + } + funct[name] = kind; + } + + + function peek(distance) { + +// Peek ahead to a future token. The distance is how far ahead to look. The +// default is the next token. + + var found, slot = 0; + + distance = distance || 0; + while (slot <= distance) { + found = lookahead[slot]; + if (!found) { + found = lookahead[slot] = lex.token(); + } + slot += 1; + } + return found; + } + + + function advance(id, match) { + +// Produce the next token, also looking for programming errors. + + if (indent) { + +// If indentation checking was requested, then inspect all of the line breakings. +// The var statement is tricky because the names might be aligned or not. We +// look at the first line break after the var to determine the programmer's +// intention. + + if (var_mode && next_token.line !== token.line) { + if ((var_mode !== indent || !next_token.edge) && + next_token.from === indent.at - + (next_token.edge ? option.indent : 0)) { + var dent = indent; + for (;;) { + dent.at -= option.indent; + if (dent === var_mode) { + break; + } + dent = dent.was; + } + dent.open = false; + } + var_mode = null; + } + if (next_token.id === '?' && indent.mode === ':' && + token.line !== next_token.line) { + indent.at -= option.indent; + } + if (indent.open) { + +// If the token is an edge. + + if (next_token.edge) { + if (next_token.edge === 'label') { + expected_at(1); + } else if (next_token.edge === 'case' || indent.mode === 'statement') { + expected_at(indent.at - option.indent); + } else if (indent.mode !== 'array' || next_token.line !== token.line) { + expected_at(indent.at); + } + +// If the token is not an edge, but is the first token on the line. + + } else if (next_token.line !== token.line) { + if (next_token.from < indent.at + (indent.mode === + 'expression' ? 0 : option.indent)) { + expected_at(indent.at + option.indent); + } + indent.wrap = true; + } + } else if (next_token.line !== token.line) { + if (next_token.edge) { + expected_at(indent.at); + } else { + indent.wrap = true; + if (indent.mode === 'statement' || indent.mode === 'var') { + expected_at(indent.at + option.indent); + } else if (next_token.from < indent.at + (indent.mode === + 'expression' ? 0 : option.indent)) { + expected_at(indent.at + option.indent); + } + } + } + } + + switch (token.id) { + case '(number)': + if (next_token.id === '.') { + warn('trailing_decimal_a'); + } + break; + case '-': + if (next_token.id === '-' || next_token.id === '--') { + warn('confusing_a'); + } + break; + case '+': + if (next_token.id === '+' || next_token.id === '++') { + warn('confusing_a'); + } + break; + } + if (token.id === '(string)' || token.identifier) { + anonname = token.string; + } + + if (id && next_token.id !== id) { + if (match) { + warn('expected_a_b_from_c_d', next_token, id, + match.id, match.line, artifact()); + } else if (!next_token.identifier || next_token.string !== id) { + warn('expected_a_b', next_token, id, artifact()); + } + } + prev_token = token; + token = next_token; + next_token = lookahead.shift() || lex.token(); + } + + + function advance_identifier(string) { + if (next_token.identifier && next_token.string === string) { + advance(); + } else { + warn('expected_a_b', next_token, string, artifact()); + } + } + + + function do_safe() { + if (option.adsafe) { + option.safe = true; + } + if (option.safe) { + option.browser = + option['continue'] = + option.css = + option.debug = + option.devel = + option.evil = + option.forin = + option.newcap = + option.nomen = + option.on = + option.rhino = + option.sloppy = + option.sub = + option.undef = + option.widget = + option.windows = false; + + + delete predefined.Array; + delete predefined.Date; + delete predefined.Function; + delete predefined.Object; + delete predefined['eval']; + + add_to_predefined({ + ADSAFE: false, + lib: false + }); + } + } + + + function do_globals() { + var name, writeable; + for (;;) { + if (next_token.id !== '(string)' && !next_token.identifier) { + return; + } + name = next_token.string; + advance(); + writeable = false; + if (next_token.id === ':') { + advance(':'); + switch (next_token.id) { + case 'true': + writeable = predefined[name] !== false; + advance('true'); + break; + case 'false': + advance('false'); + break; + default: + stop('unexpected_a'); + } + } + predefined[name] = writeable; + if (next_token.id !== ',') { + return; + } + advance(','); + } + } + + + function do_jslint() { + var name, value; + while (next_token.id === '(string)' || next_token.identifier) { + name = next_token.string; + if (!allowed_option[name]) { + stop('unexpected_a'); + } + advance(); + if (next_token.id !== ':') { + stop('expected_a_b', next_token, ':', artifact()); + } + advance(':'); + if (typeof allowed_option[name] === 'number') { + value = next_token.number; + if (value > allowed_option[name] || value <= 0 || + Math.floor(value) !== value) { + stop('expected_small_a'); + } + option[name] = value; + } else { + if (next_token.id === 'true') { + option[name] = true; + } else if (next_token.id === 'false') { + option[name] = false; + } else { + stop('unexpected_a'); + } + } + advance(); + if (next_token.id === ',') { + advance(','); + } + } + assume(); + } + + + function do_properties() { + var name; + option.properties = true; + for (;;) { + if (next_token.id !== '(string)' && !next_token.identifier) { + return; + } + name = next_token.string; + advance(); + if (next_token.id === ':') { + for (;;) { + advance(); + if (next_token.id !== '(string)' && !next_token.identifier) { + break; + } + } + } + property[name] = 0; + if (next_token.id !== ',') { + return; + } + advance(','); + } + } + + + directive = function directive() { + var command = this.id, + old_comments_off = comments_off, + old_indent = indent; + comments_off = true; + indent = null; + if (next_token.line === token.line && next_token.from === token.thru) { + warn('missing_space_a_b', next_token, artifact(token), artifact()); + } + if (lookahead.length > 0) { + warn('unexpected_a', this); + } + switch (command) { + case '/*properties': + case '/*property': + case '/*members': + case '/*member': + do_properties(); + break; + case '/*jslint': + if (option.safe) { + warn('adsafe_a', this); + } + do_jslint(); + break; + case '/*globals': + case '/*global': + if (option.safe) { + warn('adsafe_a', this); + } + do_globals(); + break; + default: + stop('unexpected_a', this); + } + comments_off = old_comments_off; + advance('*/'); + indent = old_indent; + }; + + +// Indentation intention + + function edge(mode) { + next_token.edge = indent ? indent.open && (mode || 'edge') : ''; + } + + + function step_in(mode) { + var open; + if (typeof mode === 'number') { + indent = { + at: +mode, + open: true, + was: indent + }; + } else if (!indent) { + indent = { + at: 1, + mode: 'statement', + open: true + }; + } else if (mode === 'statement') { + indent = { + at: indent.at, + open: true, + was: indent + }; + } else { + open = mode === 'var' || next_token.line !== token.line; + indent = { + at: (open || mode === 'control' + ? indent.at + option.indent + : indent.at) + (indent.wrap ? option.indent : 0), + mode: mode, + open: open, + was: indent + }; + if (mode === 'var' && open) { + var_mode = indent; + } + } + } + + function step_out(id, symbol) { + if (id) { + if (indent && indent.open) { + indent.at -= option.indent; + edge(); + } + advance(id, symbol); + } + if (indent) { + indent = indent.was; + } + } + +// Functions for conformance of whitespace. + + function one_space(left, right) { + left = left || token; + right = right || next_token; + if (right.id !== '(end)' && !option.white && + (token.line !== right.line || + token.thru + 1 !== right.from)) { + warn('expected_space_a_b', right, artifact(token), artifact(right)); + } + } + + function one_space_only(left, right) { + left = left || token; + right = right || next_token; + if (right.id !== '(end)' && (left.line !== right.line || + (!option.white && left.thru + 1 !== right.from))) { + warn('expected_space_a_b', right, artifact(left), artifact(right)); + } + } + + function no_space(left, right) { + if (option.jqmspace) + return; + + left = left || token; + right = right || next_token; + if ((!option.white || xmode === 'styleproperty' || xmode === 'style') && + left.thru !== right.from && left.line === right.line) { + warn('unexpected_space_a_b', right, artifact(left), artifact(right)); + } + } + + function no_space_only(left, right) { + if (option.jqmspace) + return; + + left = left || token; + right = right || next_token; + if (right.id !== '(end)' && (left.line !== right.line || + (!option.white && left.thru !== right.from))) { + warn('unexpected_space_a_b', right, artifact(left), artifact(right)); + } + } + + function spaces(left, right) { + if (!option.white) { + left = left || token; + right = right || next_token; + if (left.thru === right.from && left.line === right.line) { + warn('missing_space_a_b', right, artifact(left), artifact(right)); + } + } + } + + function comma() { + if (next_token.id !== ',') { + warn_at('expected_a_b', token.line, token.thru, ',', artifact()); + } else { + if (!option.white) { + no_space_only(); + } + advance(','); + spaces(); + } + } + + + function semicolon() { + if (next_token.id !== ';') { + warn_at('expected_a_b', token.line, token.thru, ';', artifact()); + } else { + if (!option.white) { + no_space_only(); + } + advance(';'); + if (semicolon_coda[next_token.id] !== true) { + spaces(); + } + } + } + + function use_strict() { + if (next_token.string === 'use strict') { + if (strict_mode) { + warn('unnecessary_use'); + } + edge(); + advance(); + semicolon(); + strict_mode = true; + option.newcap = false; + option.undef = false; + return true; + } + return false; + } + + + function are_similar(a, b) { + if (a === b) { + return true; + } + if (Array.isArray(a)) { + if (Array.isArray(b) && a.length === b.length) { + var i; + for (i = 0; i < a.length; i += 1) { + if (!are_similar(a[i], b[i])) { + return false; + } + } + return true; + } + return false; + } + if (Array.isArray(b)) { + return false; + } + if (a.id === '(number)' && b.id === '(number)') { + return a.number === b.number; + } + if (a.arity === b.arity && a.string === b.string) { + switch (a.arity) { + case 'prefix': + case 'suffix': + case undefined: + return a.id === b.id && are_similar(a.first, b.first); + case 'infix': + return are_similar(a.first, b.first) && + are_similar(a.second, b.second); + case 'ternary': + return are_similar(a.first, b.first) && + are_similar(a.second, b.second) && + are_similar(a.third, b.third); + case 'function': + case 'regexp': + return false; + default: + return true; + } + } else { + if (a.id === '.' && b.id === '[' && b.arity === 'infix') { + return a.second.string === b.second.string && b.second.id === '(string)'; + } + if (a.id === '[' && a.arity === 'infix' && b.id === '.') { + return a.second.string === b.second.string && a.second.id === '(string)'; + } + } + return false; + } + + +// This is the heart of JSLINT, the Pratt parser. In addition to parsing, it +// is looking for ad hoc lint patterns. We add .fud to Pratt's model, which is +// like .nud except that it is only used on the first token of a statement. +// Having .fud makes it much easier to define statement-oriented languages like +// JavaScript. I retained Pratt's nomenclature. + +// .nud Null denotation +// .fud First null denotation +// .led Left denotation +// lbp Left binding power +// rbp Right binding power + +// They are elements of the parsing method called Top Down Operator Precedence. + + function expression(rbp, initial) { + +// rbp is the right binding power. +// initial indicates that this is the first expression of a statement. + + var left; + if (next_token.id === '(end)') { + stop('unexpected_a', token, next_token.id); + } + advance(); + if (option.safe && scope[token.string] && + scope[token.string] === global_scope[token.string] && + (next_token.id !== '(' && next_token.id !== '.')) { + warn('adsafe_a', token); + } + if (initial) { + anonname = 'anonymous'; + funct['(verb)'] = token.string; + } + if (initial === true && token.fud) { + left = token.fud(); + } else { + if (token.nud) { + left = token.nud(); + } else { + if (next_token.id === '(number)' && token.id === '.') { + warn('leading_decimal_a', token, artifact()); + advance(); + return token; + } + stop('expected_identifier_a', token, token.id); + } + while (rbp < next_token.lbp) { + advance(); + if (token.led) { + left = token.led(left); + } else { + stop('expected_operator_a', token, token.id); + } + } + } + return left; + } + + +// Functional constructors for making the symbols that will be inherited by +// tokens. + + function symbol(s, p) { + var x = syntax[s]; + if (!x || typeof x !== 'object') { + syntax[s] = x = { + id: s, + lbp: p || 0, + string: s + }; + } + return x; + } + + function postscript(x) { + x.postscript = true; + return x; + } + + function ultimate(s) { + var x = symbol(s, 0); + x.from = 1; + x.thru = 1; + x.line = 0; + x.edge = 'edge'; + s.string = s; + return postscript(x); + } + + + function stmt(s, f) { + var x = symbol(s); + x.identifier = x.reserved = true; + x.fud = f; + return x; + } + + function labeled_stmt(s, f) { + var x = stmt(s, f); + x.labeled = true; + } + + function disrupt_stmt(s, f) { + var x = stmt(s, f); + x.disrupt = true; + } + + + function reserve_name(x) { + var c = x.id.charAt(0); + if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) { + x.identifier = x.reserved = true; + } + return x; + } + + + function prefix(s, f) { + var x = symbol(s, 150); + reserve_name(x); + x.nud = typeof f === 'function' + ? f + : function () { + if (s === 'typeof') { + one_space(); + } else { + no_space_only(); + } + this.first = expression(150); + this.arity = 'prefix'; + if (this.id === '++' || this.id === '--') { + if (!option.plusplus) { + warn('unexpected_a', this); + } else if ((!this.first.identifier || this.first.reserved) && + this.first.id !== '.' && this.first.id !== '[') { + warn('bad_operand', this); + } + } + return this; + }; + return x; + } + + + function type(s, t, nud) { + var x = symbol(s); + x.arity = t; + if (nud) { + x.nud = nud; + } + return x; + } + + + function reserve(s, f) { + var x = symbol(s); + x.identifier = x.reserved = true; + if (typeof f === 'function') { + x.nud = f; + } + return x; + } + + + function constant(name) { + var x = reserve(name); + x.string = name; + x.nud = return_this; + return x; + } + + + function reservevar(s, v) { + return reserve(s, function () { + if (typeof v === 'function') { + v(this); + } + return this; + }); + } + + + function infix(s, p, f, w) { + var x = symbol(s, p); + reserve_name(x); + x.led = function (left) { + this.arity = 'infix'; + if (!w) { + spaces(prev_token, token); + spaces(); + } + if (!option.bitwise && this.bitwise) { + warn('unexpected_a', this); + } + if (typeof f === 'function') { + return f(left, this); + } + this.first = left; + this.second = expression(p); + return this; + }; + return x; + } + + function expected_relation(node, message) { + if (node.assign) { + warn(message || bundle.conditional_assignment, node); + } + return node; + } + + function expected_condition(node, message) { + switch (node.id) { + case '[': + case '-': + if (node.arity !== 'infix') { + warn(message || bundle.weird_condition, node); + } + break; + case 'false': + case 'function': + case 'Infinity': + case 'NaN': + case 'null': + case 'true': + case 'undefined': + case 'void': + case '(number)': + case '(regexp)': + case '(string)': + case '{': + warn(message || bundle.weird_condition, node); + break; + case '(': + if (node.first.id === '.' && numbery[node.first.second.string] === true) { + warn(message || bundle.weird_condition, node); + } + break; + } + return node; + } + + function check_relation(node) { + switch (node.arity) { + case 'prefix': + switch (node.id) { + case '{': + case '[': + warn('unexpected_a', node); + break; + case '!': + warn('confusing_a', node); + break; + } + break; + case 'function': + case 'regexp': + warn('unexpected_a', node); + break; + default: + if (node.id === 'NaN') { + warn('isNaN', node); + } + } + return node; + } + + + function relation(s, eqeq) { + return infix(s, 100, function (left, that) { + check_relation(left); + if (eqeq && !option.eqeq) { + warn('expected_a_b', that, eqeq, that.id); + } + var right = expression(100); + if (are_similar(left, right) || + ((left.id === '(string)' || left.id === '(number)') && + (right.id === '(string)' || right.id === '(number)'))) { + warn('weird_relation', that); + } + that.first = left; + that.second = check_relation(right); + return that; + }); + } + + + function assignop(s, op) { + var x = infix(s, 20, function (left, that) { + var l; + that.first = left; + if (left.identifier) { + if (scope[left.string]) { + if (scope[left.string].writeable === false) { + warn('read_only', left); + } + } else { + stop('read_only'); + } + if (funct['(params)']) { + funct['(params)'].forEach(function (value) { + if (value.string === left.string) { + value.assign = true; + } + }); + } + } else if (option.safe) { + l = left; + do { + if (typeof predefined[l.string] === 'boolean') { + warn('adsafe_a', l); + } + l = l.first; + } while (l); + } + if (left === syntax['function']) { + warn('identifier_function', token); + } + if (left.id === '.' || left.id === '[') { + if (!left.first || left.first.string === 'arguments') { + warn('bad_assignment', that); + } + } else if (left.identifier) { + if (!left.reserved && funct[left.string] === 'exception') { + warn('assign_exception', left); + } + } else { + warn('bad_assignment', that); + } + that.second = expression(19); + if (that.id === '=' && are_similar(that.first, that.second)) { + warn('weird_assignment', that); + } + return that; + }); + x.assign = true; + if (op) { + if (syntax[op].bitwise) { + x.bitwise = true; + } + } + return x; + } + + + function bitwise(s, p) { + var x = infix(s, p, 'number'); + x.bitwise = true; + return x; + } + + + function suffix(s) { + var x = symbol(s, 150); + x.led = function (left) { + no_space_only(prev_token, token); + if (!option.plusplus) { + warn('unexpected_a', this); + } else if ((!left.identifier || left.reserved) && + left.id !== '.' && left.id !== '[') { + warn('bad_operand', this); + } + this.first = left; + this.arity = 'suffix'; + return this; + }; + return x; + } + + + function optional_identifier() { + if (next_token.identifier) { + advance(); + if (option.safe && banned[token.string]) { + warn('adsafe_a', token); + } else if (token.reserved && !option.es5) { + warn('expected_identifier_a_reserved', token); + } + return token.string; + } + } + + + function identifier() { + var i = optional_identifier(); + if (!i) { + stop(token.id === 'function' && next_token.id === '(' + ? 'name_function' + : 'expected_identifier_a'); + } + return i; + } + + + function statement() { + + var label, old_scope = scope, the_statement; + +// We don't like the empty statement. + + if (next_token.id === ';') { + warn('unexpected_a'); + semicolon(); + return; + } + +// Is this a labeled statement? + + if (next_token.identifier && !next_token.reserved && peek().id === ':') { + edge('label'); + label = next_token; + advance(); + advance(':'); + scope = Object.create(old_scope); + add_label(label, 'label'); + if (next_token.labeled !== true) { + warn('label_a_b', next_token, label.string, artifact()); + } else if (jx.test(label.string + ':')) { + warn('url', label); + } else if (funct === global_funct) { + stop('unexpected_a', token); + } + next_token.label = label; + } + +// Parse the statement. + + if (token.id !== 'else') { + edge(); + } + step_in('statement'); + the_statement = expression(0, true); + if (the_statement) { + +// Look for the final semicolon. + + if (the_statement.arity === 'statement') { + if (the_statement.id === 'switch' || + (the_statement.block && the_statement.id !== 'do')) { + spaces(); + } else { + semicolon(); + } + } else { + +// If this is an expression statement, determine if it is acceptable. +// We do not like +// new Blah(); +// statments. If it is to be used at all, new should only be used to make +// objects, not side effects. The expression statements we do like do +// assignment or invocation or delete. + + if (the_statement.id === '(') { + if (the_statement.first.id === 'new') { + warn('bad_new'); + } + } else if (!the_statement.assign && + the_statement.id !== 'delete' && + the_statement.id !== '++' && + the_statement.id !== '--') { + warn('assignment_function_expression', token); + } + semicolon(); + } + } + step_out(); + scope = old_scope; + return the_statement; + } + + + function statements() { + var array = [], disruptor, the_statement; + +// A disrupt statement may not be followed by any other statement. +// If the last statement is disrupt, then the sequence is disrupt. + + while (next_token.postscript !== true) { + if (next_token.id === ';') { + warn('unexpected_a', next_token); + semicolon(); + } else { + if (next_token.string === 'use strict') { + if ((!node_js && xmode !== 'script') || funct !== global_funct || array.length > 0) { + warn('function_strict'); + } + use_strict(); + } + if (disruptor) { + warn('unreachable_a_b', next_token, next_token.string, + disruptor.string); + disruptor = null; + } + the_statement = statement(); + if (the_statement) { + array.push(the_statement); + if (the_statement.disrupt) { + disruptor = the_statement; + array.disrupt = true; + } + } + } + } + return array; + } + + + function block(ordinary) { + +// array block is array sequence of statements wrapped in braces. +// ordinary is false for function bodies and try blocks. +// ordinary is true for if statements, while, etc. + + var array, + curly = next_token, + old_in_block = in_block, + old_scope = scope, + old_strict_mode = strict_mode; + + in_block = ordinary; + scope = Object.create(scope); + spaces(); + if (next_token.id === '{') { + advance('{'); + step_in(); + if (!ordinary && !use_strict() && !old_strict_mode && + !option.sloppy && funct['(context)'] === global_funct) { + warn('missing_use_strict'); + } + array = statements(); + strict_mode = old_strict_mode; + step_out('}', curly); + } else if (!ordinary) { + stop('expected_a_b', next_token, '{', artifact()); + } else { + warn('expected_a_b', next_token, '{', artifact()); + array = [statement()]; + array.disrupt = array[0].disrupt; + } + funct['(verb)'] = null; + scope = old_scope; + in_block = old_in_block; + if (ordinary && array.length === 0) { + warn('empty_block'); + } + return array; + } + + + function tally_property(name) { + if (option.properties && typeof property[name] !== 'number') { + warn('unexpected_property_a', token, name); + } + if (typeof property[name] === 'number') { + property[name] += 1; + } else { + property[name] = 1; + } + } + + +// ECMAScript parser + + syntax['(identifier)'] = { + id: '(identifier)', + lbp: 0, + identifier: true, + nud: function () { + var name = this.string, + variable = scope[name], + site, + writeable; + +// If the variable is not in scope, then we may have an undeclared variable. +// Check the predefined list. If it was predefined, create the global +// variable. + + if (typeof variable !== 'object') { + writeable = predefined[name]; + if (typeof writeable === 'boolean') { + global_scope[name] = variable = { + string: name, + writeable: writeable, + funct: global_funct + }; + global_funct[name] = 'var'; + +// But if the variable is not in scope, and is not predefined, and if we are not +// in the global scope, then we have an undefined variable error. + + } else { + if (!option.undef) { + warn('used_before_a', token); + } + scope[name] = variable = { + string: name, + writeable: true, + funct: funct + }; + funct[name] = 'undef'; + } + + } + site = variable.funct; + +// The name is in scope and defined in the current function. + + if (funct === site) { + +// Change 'unused' to 'var', and reject labels. + + switch (funct[name]) { + case 'becoming': + warn('unexpected_a', token); + funct[name] = 'var'; + break; + case 'unused': + funct[name] = 'var'; + break; + case 'unparam': + funct[name] = 'parameter'; + break; + case 'unction': + funct[name] = 'function'; + break; + case 'label': + warn('a_label', token, name); + break; + } + +// If the name is already defined in the current +// function, but not as outer, then there is a scope error. + + } else { + switch (funct[name]) { + case 'closure': + case 'function': + case 'var': + case 'unused': + warn('a_scope', token, name); + break; + case 'label': + warn('a_label', token, name); + break; + case 'outer': + case 'global': + break; + default: + +// If the name is defined in an outer function, make an outer entry, and if +// it was unused, make it var. + + switch (site[name]) { + case 'becoming': + case 'closure': + case 'function': + case 'parameter': + case 'unction': + case 'unused': + case 'var': + site[name] = 'closure'; + funct[name] = site === global_funct + ? 'global' + : 'outer'; + break; + case 'unparam': + site[name] = 'parameter'; + funct[name] = 'outer'; + break; + case 'undef': + funct[name] = 'undef'; + break; + case 'label': + warn('a_label', token, name); + break; + } + } + } + return this; + }, + led: function () { + stop('expected_operator_a'); + } + }; + +// Build the syntax table by declaring the syntactic elements. + + type('(array)', 'array'); + type('(color)', 'color'); + type('(function)', 'function'); + type('(number)', 'number', return_this); + type('(object)', 'object'); + type('(string)', 'string', return_this); + type('(boolean)', 'boolean', return_this); + type('(range)', 'range'); + type('(regexp)', 'regexp', return_this); + + ultimate('(begin)'); + ultimate('(end)'); + ultimate('(error)'); + postscript(symbol(''); + postscript(symbol('}')); + symbol(')'); + symbol(']'); + postscript(symbol('"')); + postscript(symbol('\'')); + symbol(';'); + symbol(':'); + symbol(','); + symbol('#'); + symbol('@'); + symbol('*/'); + postscript(reserve('case')); + reserve('catch'); + postscript(reserve('default')); + reserve('else'); + reserve('finally'); + + reservevar('arguments', function (x) { + if (strict_mode && funct === global_funct) { + warn('strict', x); + } else if (option.safe) { + warn('adsafe_a', x); + } + funct['(arguments)'] = true; + }); + reservevar('eval', function (x) { + if (option.safe) { + warn('adsafe_a', x); + } + }); + constant('false', 'boolean'); + constant('Infinity', 'number'); + constant('NaN', 'number'); + constant('null', ''); + reservevar('this', function (x) { + if (option.safe) { + warn('adsafe_a', x); + } else if (strict_mode && funct['(token)'].arity === 'statement' && + funct['(name)'].charAt(0) > 'Z') { + warn('strict', x); + } + }); + constant('true', 'boolean'); + constant('undefined', ''); + + infix('?', 30, function (left, that) { + step_in('?'); + that.first = expected_condition(expected_relation(left)); + that.second = expression(0); + spaces(); + step_out(); + var colon = next_token; + advance(':'); + step_in(':'); + spaces(); + that.third = expression(10); + that.arity = 'ternary'; + if (are_similar(that.second, that.third)) { + warn('weird_ternary', colon); + } else if (are_similar(that.first, that.second)) { + warn('use_or', that); + } + step_out(); + return that; + }); + + infix('||', 40, function (left, that) { + function paren_check(that) { + if (that.id === '&&' && !that.paren) { + warn('and', that); + } + return that; + } + + that.first = paren_check(expected_condition(expected_relation(left))); + that.second = paren_check(expected_relation(expression(40))); + if (are_similar(that.first, that.second)) { + warn('weird_condition', that); + } + return that; + }); + + infix('&&', 50, function (left, that) { + that.first = expected_condition(expected_relation(left)); + that.second = expected_relation(expression(50)); + if (are_similar(that.first, that.second)) { + warn('weird_condition', that); + } + return that; + }); + + prefix('void', function () { + this.first = expression(0); + this.arity = 'prefix'; + if (option.es5) { + warn('expected_a_b', this, 'undefined', 'void'); + } else if (this.first.number !== 0) { + warn('expected_a_b', this.first, '0', artifact(this.first)); + } + return this; + }); + + bitwise('|', 70); + bitwise('^', 80); + bitwise('&', 90); + + relation('==', '==='); + relation('==='); + relation('!=', '!=='); + relation('!=='); + relation('<'); + relation('>'); + relation('<='); + relation('>='); + + bitwise('<<', 120); + bitwise('>>', 120); + bitwise('>>>', 120); + + infix('in', 120, function (left, that) { + warn('infix_in', that); + that.left = left; + that.right = expression(130); + return that; + }); + infix('instanceof', 120); + infix('+', 130, function (left, that) { + if (left.id === '(number)') { + if (left.number === 0) { + warn('unexpected_a', left, '0'); + } + } else if (left.id === '(string)') { + if (left.string === '') { + warn('expected_a_b', left, 'String', '\'\''); + } + } + var right = expression(130); + if (right.id === '(number)') { + if (right.number === 0) { + warn('unexpected_a', right, '0'); + } + } else if (right.id === '(string)') { + if (right.string === '') { + warn('expected_a_b', right, 'String', '\'\''); + } + } + if (left.id === right.id) { + if (left.id === '(string)' || left.id === '(number)') { + if (left.id === '(string)') { + left.string += right.string; + if (jx.test(left.string)) { + warn('url', left); + } + } else { + left.number += right.number; + } + left.thru = right.thru; + return left; + } + } + that.first = left; + that.second = right; + return that; + }); + prefix('+', 'num'); + prefix('+++', function () { + warn('confusing_a', token); + this.first = expression(150); + this.arity = 'prefix'; + return this; + }); + infix('+++', 130, function (left) { + warn('confusing_a', token); + this.first = left; + this.second = expression(130); + return this; + }); + infix('-', 130, function (left, that) { + if ((left.id === '(number)' && left.number === 0) || left.id === '(string)') { + warn('unexpected_a', left); + } + var right = expression(130); + if ((right.id === '(number)' && right.number === 0) || right.id === '(string)') { + warn('unexpected_a', right); + } + if (left.id === right.id && left.id === '(number)') { + left.number -= right.number; + left.thru = right.thru; + return left; + } + that.first = left; + that.second = right; + return that; + }); + prefix('-'); + prefix('---', function () { + warn('confusing_a', token); + this.first = expression(150); + this.arity = 'prefix'; + return this; + }); + infix('---', 130, function (left) { + warn('confusing_a', token); + this.first = left; + this.second = expression(130); + return this; + }); + infix('*', 140, function (left, that) { + if ((left.id === '(number)' && (left.number === 0 || left.number === 1)) || left.id === '(string)') { + warn('unexpected_a', left); + } + var right = expression(140); + if ((right.id === '(number)' && (right.number === 0 || right.number === 1)) || right.id === '(string)') { + warn('unexpected_a', right); + } + if (left.id === right.id && left.id === '(number)') { + left.number *= right.number; + left.thru = right.thru; + return left; + } + that.first = left; + that.second = right; + return that; + }); + infix('/', 140, function (left, that) { + if ((left.id === '(number)' && left.number === 0) || left.id === '(string)') { + warn('unexpected_a', left); + } + var right = expression(140); + if ((right.id === '(number)' && (right.number === 0 || right.number === 1)) || right.id === '(string)') { + warn('unexpected_a', right); + } + if (left.id === right.id && left.id === '(number)') { + left.number /= right.number; + left.thru = right.thru; + return left; + } + that.first = left; + that.second = right; + return that; + }); + infix('%', 140, function (left, that) { + if ((left.id === '(number)' && (left.number === 0 || left.number === 1)) || left.id === '(string)') { + warn('unexpected_a', left); + } + var right = expression(140); + if ((right.id === '(number)' && right.number === 0) || right.id === '(string)') { + warn('unexpected_a', right); + } + if (left.id === right.id && left.id === '(number)') { + left.number %= right.number; + left.thru = right.thru; + return left; + } + that.first = left; + that.second = right; + return that; + }); + + suffix('++'); + prefix('++'); + + suffix('--'); + prefix('--'); + prefix('delete', function () { + one_space(); + var p = expression(0); + if (!p || (p.id !== '.' && p.id !== '[')) { + warn('deleted'); + } + this.first = p; + return this; + }); + + + prefix('~', function () { + no_space_only(); + if (!option.bitwise) { + warn('unexpected_a', this); + } + expression(150); + return this; + }); + prefix('!', function () { + no_space_only(); + this.first = expected_condition(expression(150)); + this.arity = 'prefix'; + if (bang[this.first.id] === true || this.first.assign) { + warn('confusing_a', this); + } + return this; + }); + prefix('typeof', null); + prefix('new', function () { + one_space(); + var c = expression(160), n, p, v; + this.first = c; + if (c.id !== 'function') { + if (c.identifier) { + switch (c.string) { + case 'Object': + warn('use_object', token); + break; + case 'Array': + if (next_token.id === '(') { + p = next_token; + p.first = this; + advance('('); + if (next_token.id !== ')') { + n = expression(0); + p.second = [n]; + if (n.id !== '(number)' || next_token.id === ',') { + warn('use_array', p); + } + while (next_token.id === ',') { + advance(','); + p.second.push(expression(0)); + } + } else { + warn('use_array', token); + } + advance(')', p); + return p; + } + warn('use_array', token); + break; + case 'Number': + case 'String': + case 'Boolean': + case 'Math': + case 'JSON': + warn('not_a_constructor', c); + break; + case 'Function': + if (!option.evil) { + warn('function_eval'); + } + break; + case 'Date': + case 'RegExp': + case 'this': + break; + default: + if (c.id !== 'function') { + v = c.string.charAt(0); + if (!option.newcap && (v < 'A' || v > 'Z')) { + warn('constructor_name_a', token); + } + } + } + } else { + if (c.id !== '.' && c.id !== '[' && c.id !== '(') { + warn('bad_constructor', token); + } + } + } else { + warn('weird_new', this); + } + if (next_token.id !== '(') { + warn('missing_a', next_token, '()'); + } + return this; + }); + + infix('(', 160, function (left, that) { + var p; + if (indent && indent.mode === 'expression') { + no_space(prev_token, token); + } else { + no_space_only(prev_token, token); + } + if (!left.immed && left.id === 'function') { + warn('wrap_immediate'); + } + p = []; + if (left.identifier) { + if (left.string.match(/^[A-Z]([A-Z0-9_$]*[a-z][A-Za-z0-9_$]*)?$/)) { + if (left.string !== 'Number' && left.string !== 'String' && + left.string !== 'Boolean' && left.string !== 'Date') { + if (left.string === 'Math' || left.string === 'JSON') { + warn('not_a_function', left); + } else if (left.string === 'Object') { + warn('use_object', token); + } else if (left.string === 'Array' || !option.newcap) { + warn('missing_a', left, 'new'); + } + } + } + } else if (left.id === '.') { + if (option.safe && left.first.string === 'Math' && + left.second === 'random') { + warn('adsafe_a', left); + } else if (left.second.string === 'split' && + left.first.id === '(string)') { + warn('use_array', left.second); + } + } + step_in(); + if (next_token.id !== ')') { + no_space(); + for (;;) { + edge(); + p.push(expression(10)); + if (next_token.id !== ',') { + break; + } + comma(); + } + } + no_space(); + step_out(')', that); + if (typeof left === 'object') { + if (left.string === 'parseInt' && p.length === 1) { + warn('radix', left); + } + if (!option.evil) { + if (left.string === 'eval' || left.string === 'Function' || + left.string === 'execScript') { + warn('evil', left); + } else if (p[0] && p[0].id === '(string)' && + (left.string === 'setTimeout' || + left.string === 'setInterval')) { + warn('implied_evil', left); + } + } + if (!left.identifier && left.id !== '.' && left.id !== '[' && + left.id !== '(' && left.id !== '&&' && left.id !== '||' && + left.id !== '?') { + warn('bad_invocation', left); + } + } + that.first = left; + that.second = p; + return that; + }, true); + + prefix('(', function () { + step_in('expression'); + no_space(); + edge(); + if (next_token.id === 'function') { + next_token.immed = true; + } + var value = expression(0); + value.paren = true; + no_space(); + step_out(')', this); + if (value.id === 'function') { + switch (next_token.id) { + case '(': + warn('move_invocation'); + break; + case '.': + case '[': + warn('unexpected_a'); + break; + default: + warn('bad_wrap', this); + } + } + return value; + }); + + infix('.', 170, function (left, that) { + no_space(prev_token, token); + no_space(); + var name = identifier(); + if (typeof name === 'string') { + tally_property(name); + } + that.first = left; + that.second = token; + if (left && left.string === 'arguments' && + (name === 'callee' || name === 'caller')) { + warn('avoid_a', left, 'arguments.' + name); + } else if (!option.evil && left && left.string === 'document' && + (name === 'write' || name === 'writeln')) { + warn('write_is_wrong', left); + } else if (option.adsafe) { + if (!adsafe_top && left.string === 'ADSAFE') { + if (name === 'id' || name === 'lib') { + warn('adsafe_a', that); + } else if (name === 'go') { + if (xmode !== 'script') { + warn('adsafe_a', that); + } else if (adsafe_went || next_token.id !== '(' || + peek(0).id !== '(string)' || + peek(0).string !== adsafe_id || + peek(1).id !== ',') { + stop('adsafe_a', that, 'go'); + } + adsafe_went = true; + adsafe_may = false; + } + } + adsafe_top = false; + } + if (!option.evil && (name === 'eval' || name === 'execScript')) { + warn('evil'); + } else if (option.safe) { + for (;;) { + if (banned[name] === true) { + warn('adsafe_a', token, name); + } + if (typeof predefined[left.string] !== 'boolean' || //// check for writeable + next_token.id === '(') { + break; + } + if (next_token.id !== '.') { + warn('adsafe_a', that); + break; + } + advance('.'); + token.first = that; + token.second = name; + that = token; + name = identifier(); + if (typeof name === 'string') { + tally_property(name); + } + } + } + return that; + }, true); + + infix('[', 170, function (left, that) { + var e, s; + no_space_only(prev_token, token); + no_space(); + step_in(); + edge(); + e = expression(0); + switch (e.id) { + case '(number)': + if (e.id === '(number)' && left.id === 'arguments') { + warn('use_param', left); + } + break; + case '(string)': + if (option.safe && (banned[e.string] || + e.string.charAt(0) === '_' || e.string.slice(-1) === '_')) { + warn('adsafe_subscript_a', e); + } else if (!option.evil && + (e.string === 'eval' || e.string === 'execScript')) { + warn('evil', e); + } else if (!option.sub && ix.test(e.string)) { + s = syntax[e.string]; + if (!s || !s.reserved) { + warn('subscript', e); + } + } + tally_property(e.string); + break; + default: + if (option.safe) { + warn('adsafe_subscript_a', e); + } + } + step_out(']', that); + no_space(prev_token, token); + that.first = left; + that.second = e; + return that; + }, true); + + prefix('[', function () { + this.arity = 'prefix'; + this.first = []; + step_in('array'); + while (next_token.id !== '(end)') { + while (next_token.id === ',') { + warn('unexpected_a', next_token); + advance(','); + } + if (next_token.id === ']') { + break; + } + indent.wrap = false; + edge(); + this.first.push(expression(10)); + if (next_token.id === ',') { + comma(); + if (next_token.id === ']' && !option.es5) { + warn('unexpected_a', token); + break; + } + } else { + break; + } + } + step_out(']', this); + return this; + }, 170); + + + function property_name() { + var id = optional_identifier(true); + if (!id) { + if (next_token.id === '(string)') { + id = next_token.string; + if (option.safe) { + if (banned[id]) { + warn('adsafe_a'); + } else if (id.charAt(0) === '_' || + id.charAt(id.length - 1) === '_') { + warn('dangling_a'); + } + } + advance(); + } else if (next_token.id === '(number)') { + id = next_token.number.toString(); + advance(); + } + } + return id; + } + + + function function_params() { + var id, paren = next_token, params = []; + advance('('); + step_in(); + no_space(); + if (next_token.id === ')') { + no_space(); + step_out(')', paren); + return params; + } + for (;;) { + edge(); + id = identifier(); + params.push(token); + add_label(token, option.unparam ? 'parameter' : 'unparam'); + if (next_token.id === ',') { + comma(); + } else { + no_space(); + step_out(')', paren); + return params; + } + } + } + + + + function do_function(func, name) { + var old_funct = funct, + old_option = option, + old_scope = scope; + funct = { + '(name)' : name || '\'' + (anonname || '').replace(nx, sanitize) + '\'', + '(line)' : next_token.line, + '(context)' : old_funct, + '(breakage)' : 0, + '(loopage)' : 0, + '(scope)' : scope, + '(token)' : func + }; + option = Object.create(old_option); + scope = Object.create(old_scope); + functions.push(funct); + func.name = name; + if (name) { + add_label(func, 'function', name); + } + func.writeable = false; + func.first = funct['(params)'] = function_params(); + one_space(); + func.block = block(false); + if (funct['(arguments)']) { + func.first.forEach(function (value) { + if (value.assign) { + warn('parameter_arguments_a', value, value.string); + } + }); + } + funct = old_funct; + option = old_option; + scope = old_scope; + } + + + assignop('='); + assignop('+=', '+'); + assignop('-=', '-'); + assignop('*=', '*'); + assignop('/=', '/').nud = function () { + stop('slash_equal'); + }; + assignop('%=', '%'); + assignop('&=', '&'); + assignop('|=', '|'); + assignop('^=', '^'); + assignop('<<=', '<<'); + assignop('>>=', '>>'); + assignop('>>>=', '>>>'); + + + prefix('{', function () { + var get, i, j, name, p, set, seen = {}; + this.arity = 'prefix'; + this.first = []; + step_in(); + while (next_token.id !== '}') { + indent.wrap = false; + +// JSLint recognizes the ES5 extension for get/set in object literals, +// but requires that they be used in pairs. + + edge(); + if (next_token.string === 'get' && peek().id !== ':') { + if (!option.es5) { + warn('es5'); + } + get = next_token; + advance('get'); + one_space_only(); + name = next_token; + i = property_name(); + if (!i) { + stop('missing_property'); + } + get.string = ''; + do_function(get); + if (funct['(loopage)']) { + warn('function_loop', get); + } + p = get.first; + if (p) { + warn('parameter_a_get_b', p[0], p[0].string, i); + } + comma(); + set = next_token; + spaces(); + edge(); + advance('set'); + set.string = ''; + one_space_only(); + j = property_name(); + if (i !== j) { + stop('expected_a_b', token, i, j || next_token.string); + } + do_function(set); + if (set.block.length === 0) { + warn('missing_a', token, 'throw'); + } + p = set.first; + if (!p || p.length !== 1) { + stop('parameter_set_a', set, 'value'); + } else if (p[0].string !== 'value') { + stop('expected_a_b', p[0], 'value', p[0].string); + } + name.first = [get, set]; + } else { + name = next_token; + i = property_name(); + if (typeof i !== 'string') { + stop('missing_property'); + } + advance(':'); + spaces(); + name.first = expression(10); + } + this.first.push(name); + if (seen[i] === true) { + warn('duplicate_a', next_token, i); + } + seen[i] = true; + tally_property(i); + if (next_token.id !== ',') { + break; + } + for (;;) { + comma(); + if (next_token.id !== ',') { + break; + } + warn('unexpected_a', next_token); + } + if (next_token.id === '}' && !option.es5) { + warn('unexpected_a', token); + } + } + step_out('}', this); + return this; + }); + + stmt('{', function () { + warn('statement_block'); + this.arity = 'statement'; + this.block = statements(); + this.disrupt = this.block.disrupt; + advance('}', this); + return this; + }); + + stmt('/*global', directive); + stmt('/*globals', directive); + stmt('/*jslint', directive); + stmt('/*member', directive); + stmt('/*members', directive); + stmt('/*property', directive); + stmt('/*properties', directive); + + stmt('var', function () { + +// JavaScript does not have block scope. It only has function scope. So, +// declaring a variable in a block can have unexpected consequences. + +// var.first will contain an array, the array containing name tokens +// and assignment tokens. + + var assign, id, name; + + if (funct['(vars)'] && !option.vars) { + warn('combine_var'); + } else if (funct !== global_funct) { + funct['(vars)'] = true; + } + this.arity = 'statement'; + this.first = []; + step_in('var'); + for (;;) { + name = next_token; + id = identifier(); + add_label(name, 'becoming'); + + if (next_token.id === '=') { + assign = next_token; + assign.first = name; + spaces(); + advance('='); + spaces(); + if (next_token.id === 'undefined') { + warn('unnecessary_initialize', token, id); + } + if (peek(0).id === '=' && next_token.identifier) { + stop('var_a_not'); + } + assign.second = expression(0); + assign.arity = 'infix'; + this.first.push(assign); + } else { + this.first.push(name); + } + if (funct[id] === 'becoming') { + funct[id] = 'unused'; + } + if (next_token.id !== ',') { + break; + } + comma(); + indent.wrap = false; + if (var_mode && next_token.line === token.line && + this.first.length === 1) { + var_mode = null; + indent.open = false; + indent.at -= option.indent; + } + spaces(); + edge(); + } + var_mode = null; + step_out(); + return this; + }); + + stmt('function', function () { + one_space(); + if (in_block) { + warn('function_block', token); + } + var name = next_token, id = identifier(); + add_label(name, 'unction'); + no_space(); + this.arity = 'statement'; + do_function(this, id); + if (next_token.id === '(' && next_token.line === token.line) { + stop('function_statement'); + } + return this; + }); + + prefix('function', function () { + if (!option.anon) { + one_space(); + } + var id = optional_identifier(); + if (id) { + no_space(); + } else { + id = ''; + } + do_function(this, id); + if (funct['(loopage)']) { + warn('function_loop'); + } + switch (next_token.id) { + case ';': + case '(': + case ')': + case ',': + case ']': + case '}': + case ':': + break; + case '.': + if (peek().string !== 'bind' || peek(1).id !== '(') { + warn('unexpected_a'); + } + break; + default: + stop('unexpected_a'); + } + this.arity = 'function'; + return this; + }); + + stmt('if', function () { + var paren = next_token; + one_space(); + advance('('); + step_in('control'); + no_space(); + edge(); + this.arity = 'statement'; + this.first = expected_condition(expected_relation(expression(0))); + no_space(); + step_out(')', paren); + one_space(); + this.block = block(true); + if (next_token.id === 'else') { + one_space(); + advance('else'); + one_space(); + this['else'] = next_token.id === 'if' || next_token.id === 'switch' + ? statement(true) + : block(true); + if (this['else'].disrupt && this.block.disrupt) { + this.disrupt = true; + } + } + return this; + }); + + stmt('try', function () { + +// try.first The catch variable +// try.second The catch clause +// try.third The finally clause +// try.block The try block + + var exception_variable, old_scope, paren; + if (option.adsafe) { + warn('adsafe_a', this); + } + one_space(); + this.arity = 'statement'; + this.block = block(false); + if (next_token.id === 'catch') { + one_space(); + advance('catch'); + one_space(); + paren = next_token; + advance('('); + step_in('control'); + no_space(); + edge(); + old_scope = scope; + scope = Object.create(old_scope); + exception_variable = next_token.string; + this.first = exception_variable; + if (!next_token.identifier) { + warn('expected_identifier_a', next_token); + } else { + add_label(next_token, 'exception'); + } + advance(); + no_space(); + step_out(')', paren); + one_space(); + this.second = block(false); + scope = old_scope; + } + if (next_token.id === 'finally') { + one_space(); + advance('finally'); + one_space(); + this.third = block(false); + } else if (!this.second) { + stop('expected_a_b', next_token, 'catch', artifact()); + } + return this; + }); + + labeled_stmt('while', function () { + one_space(); + var paren = next_token; + funct['(breakage)'] += 1; + funct['(loopage)'] += 1; + advance('('); + step_in('control'); + no_space(); + edge(); + this.arity = 'statement'; + this.first = expected_relation(expression(0)); + if (this.first.id !== 'true') { + expected_condition(this.first, bundle.unexpected_a); + } + no_space(); + step_out(')', paren); + one_space(); + this.block = block(true); + if (this.block.disrupt) { + warn('strange_loop', prev_token); + } + funct['(breakage)'] -= 1; + funct['(loopage)'] -= 1; + return this; + }); + + reserve('with'); + + labeled_stmt('switch', function () { + +// switch.first the switch expression +// switch.second the array of cases. A case is 'case' or 'default' token: +// case.first the array of case expressions +// case.second the array of statements +// If all of the arrays of statements are disrupt, then the switch is disrupt. + + var cases = [], + old_in_block = in_block, + particular, + the_case = next_token, + unbroken = true; + + function find_duplicate_case(value) { + if (are_similar(particular, value)) { + warn('duplicate_a', value); + } + } + + funct['(breakage)'] += 1; + one_space(); + advance('('); + no_space(); + step_in(); + this.arity = 'statement'; + this.first = expected_condition(expected_relation(expression(0))); + no_space(); + step_out(')', the_case); + one_space(); + advance('{'); + step_in(); + in_block = true; + this.second = []; + while (next_token.id === 'case') { + the_case = next_token; + cases.forEach(find_duplicate_case); + the_case.first = []; + the_case.arity = 'case'; + spaces(); + edge('case'); + advance('case'); + for (;;) { + one_space(); + particular = expression(0); + cases.forEach(find_duplicate_case); + cases.push(particular); + the_case.first.push(particular); + if (particular.id === 'NaN') { + warn('unexpected_a', particular); + } + no_space_only(); + advance(':'); + if (next_token.id !== 'case') { + break; + } + spaces(); + edge('case'); + advance('case'); + } + spaces(); + the_case.second = statements(); + if (the_case.second && the_case.second.length > 0) { + particular = the_case.second[the_case.second.length - 1]; + if (particular.disrupt) { + if (particular.id === 'break') { + unbroken = false; + } + } else { + warn('missing_a_after_b', next_token, 'break', 'case'); + } + } else { + warn('empty_case'); + } + this.second.push(the_case); + } + if (this.second.length === 0) { + warn('missing_a', next_token, 'case'); + } + if (next_token.id === 'default') { + spaces(); + the_case = next_token; + the_case.arity = 'case'; + edge('case'); + advance('default'); + no_space_only(); + advance(':'); + spaces(); + the_case.second = statements(); + if (the_case.second && the_case.second.length > 0) { + particular = the_case.second[the_case.second.length - 1]; + if (unbroken && particular.disrupt && particular.id !== 'break') { + this.disrupt = true; + } + } + this.second.push(the_case); + } + funct['(breakage)'] -= 1; + spaces(); + step_out('}', this); + in_block = old_in_block; + return this; + }); + + stmt('debugger', function () { + if (!option.debug) { + warn('unexpected_a', this); + } + this.arity = 'statement'; + return this; + }); + + labeled_stmt('do', function () { + funct['(breakage)'] += 1; + funct['(loopage)'] += 1; + one_space(); + this.arity = 'statement'; + this.block = block(true); + if (this.block.disrupt) { + warn('strange_loop', prev_token); + } + one_space(); + advance('while'); + var paren = next_token; + one_space(); + advance('('); + step_in(); + no_space(); + edge(); + this.first = expected_condition(expected_relation(expression(0)), bundle.unexpected_a); + no_space(); + step_out(')', paren); + funct['(breakage)'] -= 1; + funct['(loopage)'] -= 1; + return this; + }); + + labeled_stmt('for', function () { + + var blok, filter, ok = false, paren = next_token, value; + this.arity = 'statement'; + funct['(breakage)'] += 1; + funct['(loopage)'] += 1; + advance('('); + if (next_token.id === ';') { + no_space(); + advance(';'); + no_space(); + advance(';'); + no_space(); + advance(')'); + blok = block(true); + } else { + step_in('control'); + spaces(this, paren); + no_space(); + if (next_token.id === 'var') { + stop('move_var'); + } + edge(); + if (peek(0).id === 'in') { + this.forin = true; + value = next_token; + switch (funct[value.string]) { + case 'unused': + funct[value.string] = 'var'; + break; + case 'closure': + case 'var': + break; + default: + warn('bad_in_a', value); + } + advance(); + advance('in'); + this.first = value; + this.second = expression(20); + step_out(')', paren); + blok = block(true); + if (!option.forin) { + if (blok.length === 1 && typeof blok[0] === 'object' && + blok[0].string === 'if' && !blok[0]['else']) { + filter = blok[0].first; + while (filter.id === '&&') { + filter = filter.first; + } + switch (filter.id) { + case '===': + case '!==': + ok = filter.first.id === '[' + ? filter.first.first.string === this.second.string && + filter.first.second.string === this.first.string + : filter.first.id === 'typeof' && + filter.first.first.id === '[' && + filter.first.first.first.string === this.second.string && + filter.first.first.second.string === this.first.string; + break; + case '(': + ok = filter.first.id === '.' && (( + filter.first.first.string === this.second.string && + filter.first.second.string === 'hasOwnProperty' && + filter.second[0].string === this.first.string + ) || ( + filter.first.first.string === 'ADSAFE' && + filter.first.second.string === 'has' && + filter.second[0].string === this.second.string && + filter.second[1].string === this.first.string + ) || ( + filter.first.first.id === '.' && + filter.first.first.first.id === '.' && + filter.first.first.first.first.string === 'Object' && + filter.first.first.first.second.string === 'prototype' && + filter.first.first.second.string === 'hasOwnProperty' && + filter.first.second.string === 'call' && + filter.second[0].string === this.second.string && + filter.second[1].string === this.first.string + )); + break; + } + } + if (!ok) { + warn('for_if', this); + } + } + } else { + edge(); + this.first = []; + for (;;) { + this.first.push(expression(0, 'for')); + if (next_token.id !== ',') { + break; + } + comma(); + } + semicolon(); + edge(); + this.second = expected_relation(expression(0)); + if (this.second.id !== 'true') { + expected_condition(this.second, bundle.unexpected_a); + } + semicolon(token); + if (next_token.id === ';') { + stop('expected_a_b', next_token, ')', ';'); + } + this.third = []; + edge(); + for (;;) { + this.third.push(expression(0, 'for')); + if (next_token.id !== ',') { + break; + } + comma(); + } + no_space(); + step_out(')', paren); + one_space(); + blok = block(true); + } + } + if (blok.disrupt) { + warn('strange_loop', prev_token); + } + this.block = blok; + funct['(breakage)'] -= 1; + funct['(loopage)'] -= 1; + return this; + }); + + disrupt_stmt('break', function () { + var label = next_token.string; + this.arity = 'statement'; + if (funct['(breakage)'] === 0) { + warn('unexpected_a', this); + } + if (next_token.identifier && token.line === next_token.line) { + one_space_only(); + if (funct[label] !== 'label') { + warn('not_a_label', next_token); + } else if (scope[label].funct !== funct) { + warn('not_a_scope', next_token); + } + this.first = next_token; + advance(); + } + return this; + }); + + disrupt_stmt('continue', function () { + if (!option['continue']) { + warn('unexpected_a', this); + } + var label = next_token.string; + this.arity = 'statement'; + if (funct['(breakage)'] === 0) { + warn('unexpected_a', this); + } + if (next_token.identifier && token.line === next_token.line) { + one_space_only(); + if (funct[label] !== 'label') { + warn('not_a_label', next_token); + } else if (scope[label].funct !== funct) { + warn('not_a_scope', next_token); + } + this.first = next_token; + advance(); + } + return this; + }); + + disrupt_stmt('return', function () { + if (funct === global_funct && xmode !== 'scriptstring') { + warn('unexpected_a', this); + } + this.arity = 'statement'; + if (next_token.id !== ';' && next_token.line === token.line) { + one_space_only(); + if (next_token.id === '/' || next_token.id === '(regexp)') { + warn('wrap_regexp'); + } + this.first = expression(20); + } + if (peek(0).id === '}' && peek(1).id === 'else') { + warn('unexpected_else', this); + } + return this; + }); + + disrupt_stmt('throw', function () { + this.arity = 'statement'; + one_space_only(); + this.first = expression(20); + return this; + }); + + +// Superfluous reserved words + + reserve('class'); + reserve('const'); + reserve('enum'); + reserve('export'); + reserve('extends'); + reserve('import'); + reserve('super'); + +// Harmony reserved words + + reserve('implements'); + reserve('interface'); + reserve('let'); + reserve('package'); + reserve('private'); + reserve('protected'); + reserve('public'); + reserve('static'); + reserve('yield'); + + +// Parse JSON + + function json_value() { + + function json_object() { + var brace = next_token, object = {}; + advance('{'); + if (next_token.id !== '}') { + while (next_token.id !== '(end)') { + while (next_token.id === ',') { + warn('unexpected_a', next_token); + advance(','); + } + if (next_token.id !== '(string)') { + warn('expected_string_a'); + } + if (object[next_token.string] === true) { + warn('duplicate_a'); + } else if (next_token.string === '__proto__') { + warn('dangling_a'); + } else { + object[next_token.string] = true; + } + advance(); + advance(':'); + json_value(); + if (next_token.id !== ',') { + break; + } + advance(','); + if (next_token.id === '}') { + warn('unexpected_a', token); + break; + } + } + } + advance('}', brace); + } + + function json_array() { + var bracket = next_token; + advance('['); + if (next_token.id !== ']') { + while (next_token.id !== '(end)') { + while (next_token.id === ',') { + warn('unexpected_a', next_token); + advance(','); + } + json_value(); + if (next_token.id !== ',') { + break; + } + advance(','); + if (next_token.id === ']') { + warn('unexpected_a', token); + break; + } + } + } + advance(']', bracket); + } + + switch (next_token.id) { + case '{': + json_object(); + break; + case '[': + json_array(); + break; + case 'true': + case 'false': + case 'null': + case '(number)': + case '(string)': + advance(); + break; + case '-': + advance('-'); + no_space_only(); + advance('(number)'); + break; + default: + stop('unexpected_a'); + } + } + + +// CSS parsing. + + function css_name() { + if (next_token.identifier) { + advance(); + return true; + } + } + + + function css_number() { + if (next_token.id === '-') { + advance('-'); + no_space_only(); + } + if (next_token.id === '(number)') { + advance('(number)'); + return true; + } + } + + + function css_string() { + if (next_token.id === '(string)') { + advance(); + return true; + } + } + + function css_color() { + var i, number, paren, value; + if (next_token.identifier) { + value = next_token.string; + if (value === 'rgb' || value === 'rgba') { + advance(); + paren = next_token; + advance('('); + for (i = 0; i < 3; i += 1) { + if (i) { + comma(); + } + number = next_token.number; + if (next_token.id !== '(number)' || number < 0) { + warn('expected_positive_a', next_token); + advance(); + } else { + advance(); + if (next_token.id === '%') { + advance('%'); + if (number > 100) { + warn('expected_percent_a', token, number); + } + } else { + if (number > 255) { + warn('expected_small_a', token, number); + } + } + } + } + if (value === 'rgba') { + comma(); + number = next_token.number; + if (next_token.id !== '(number)' || number < 0 || number > 1) { + warn('expected_fraction_a', next_token); + } + advance(); + if (next_token.id === '%') { + warn('unexpected_a'); + advance('%'); + } + } + advance(')', paren); + return true; + } + if (css_colorData[next_token.string] === true) { + advance(); + return true; + } + } else if (next_token.id === '(color)') { + advance(); + return true; + } + return false; + } + + + function css_length() { + if (next_token.id === '-') { + advance('-'); + no_space_only(); + } + if (next_token.id === '(number)') { + advance(); + if (next_token.id !== '(string)' && + css_lengthData[next_token.string] === true) { + no_space_only(); + advance(); + } else if (+token.number !== 0) { + warn('expected_linear_a'); + } + return true; + } + return false; + } + + + function css_line_height() { + if (next_token.id === '-') { + advance('-'); + no_space_only(); + } + if (next_token.id === '(number)') { + advance(); + if (next_token.id !== '(string)' && + css_lengthData[next_token.string] === true) { + no_space_only(); + advance(); + } + return true; + } + return false; + } + + + function css_width() { + if (next_token.identifier) { + switch (next_token.string) { + case 'thin': + case 'medium': + case 'thick': + advance(); + return true; + } + } else { + return css_length(); + } + } + + + function css_margin() { + if (next_token.identifier) { + if (next_token.string === 'auto') { + advance(); + return true; + } + } else { + return css_length(); + } + } + + function css_attr() { + if (next_token.identifier && next_token.string === 'attr') { + advance(); + advance('('); + if (!next_token.identifier) { + warn('expected_name_a'); + } + advance(); + advance(')'); + return true; + } + return false; + } + + + function css_comma_list() { + while (next_token.id !== ';') { + if (!css_name() && !css_string()) { + warn('expected_name_a'); + } + if (next_token.id !== ',') { + return true; + } + comma(); + } + } + + + function css_counter() { + if (next_token.identifier && next_token.string === 'counter') { + advance(); + advance('('); + advance(); + if (next_token.id === ',') { + comma(); + if (next_token.id !== '(string)') { + warn('expected_string_a'); + } + advance(); + } + advance(')'); + return true; + } + if (next_token.identifier && next_token.string === 'counters') { + advance(); + advance('('); + if (!next_token.identifier) { + warn('expected_name_a'); + } + advance(); + if (next_token.id === ',') { + comma(); + if (next_token.id !== '(string)') { + warn('expected_string_a'); + } + advance(); + } + if (next_token.id === ',') { + comma(); + if (next_token.id !== '(string)') { + warn('expected_string_a'); + } + advance(); + } + advance(')'); + return true; + } + return false; + } + + + function css_radius() { + return css_length() && (next_token.id !== '(number)' || css_length()); + } + + + function css_shape() { + var i; + if (next_token.identifier && next_token.string === 'rect') { + advance(); + advance('('); + for (i = 0; i < 4; i += 1) { + if (!css_length()) { + warn('expected_number_a'); + break; + } + } + advance(')'); + return true; + } + return false; + } + + + function css_url() { + var c, url; + if (next_token.identifier && next_token.string === 'url') { + next_token = lex.range('(', ')'); + url = next_token.string; + c = url.charAt(0); + if (c === '"' || c === '\'') { + if (url.slice(-1) !== c) { + warn('bad_url_a'); + } else { + url = url.slice(1, -1); + if (url.indexOf(c) >= 0) { + warn('bad_url_a'); + } + } + } + if (!url) { + warn('missing_url'); + } + if (ux.test(url)) { + stop('bad_url_a'); + } + urls.push(url); + advance(); + return true; + } + return false; + } + + + css_any = [css_url, function () { + for (;;) { + if (next_token.identifier) { + switch (next_token.string.toLowerCase()) { + case 'url': + css_url(); + break; + case 'expression': + warn('unexpected_a'); + advance(); + break; + default: + advance(); + } + } else { + if (next_token.id === ';' || next_token.id === '!' || + next_token.id === '(end)' || next_token.id === '}') { + return true; + } + advance(); + } + } + }]; + + + function font_face() { + advance_identifier('font-family'); + advance(':'); + if (!css_name() && !css_string()) { + stop('expected_name_a'); + } + semicolon(); + advance_identifier('src'); + advance(':'); + while (true) { + if (next_token.string === 'local') { + advance_identifier('local'); + advance('('); + if (ux.test(next_token.string)) { + stop('bad_url_a'); + } + + if (!css_name() && !css_string()) { + stop('expected_name_a'); + } + advance(')'); + } else if (!css_url()) { + stop('expected_a_b', next_token, 'url', artifact()); + } + if (next_token.id !== ',') { + break; + } + comma(); + } + semicolon(); + } + + + css_border_style = [ + 'none', 'dashed', 'dotted', 'double', 'groove', + 'hidden', 'inset', 'outset', 'ridge', 'solid' + ]; + + css_break = [ + 'auto', 'always', 'avoid', 'left', 'right' + ]; + + css_media = { + 'all': true, + 'braille': true, + 'embossed': true, + 'handheld': true, + 'print': true, + 'projection': true, + 'screen': true, + 'speech': true, + 'tty': true, + 'tv': true + }; + + css_overflow = [ + 'auto', 'hidden', 'scroll', 'visible' + ]; + + css_attribute_data = { + background: [ + true, 'background-attachment', 'background-color', + 'background-image', 'background-position', 'background-repeat' + ], + 'background-attachment': ['scroll', 'fixed'], + 'background-color': ['transparent', css_color], + 'background-image': ['none', css_url], + 'background-position': [ + 2, [css_length, 'top', 'bottom', 'left', 'right', 'center'] + ], + 'background-repeat': [ + 'repeat', 'repeat-x', 'repeat-y', 'no-repeat' + ], + 'border': [true, 'border-color', 'border-style', 'border-width'], + 'border-bottom': [ + true, 'border-bottom-color', 'border-bottom-style', + 'border-bottom-width' + ], + 'border-bottom-color': css_color, + 'border-bottom-left-radius': css_radius, + 'border-bottom-right-radius': css_radius, + 'border-bottom-style': css_border_style, + 'border-bottom-width': css_width, + 'border-collapse': ['collapse', 'separate'], + 'border-color': ['transparent', 4, css_color], + 'border-left': [ + true, 'border-left-color', 'border-left-style', 'border-left-width' + ], + 'border-left-color': css_color, + 'border-left-style': css_border_style, + 'border-left-width': css_width, + 'border-radius': function () { + function count(separator) { + var n = 1; + if (separator) { + advance(separator); + } + if (!css_length()) { + return false; + } + while (next_token.id === '(number)') { + if (!css_length()) { + return false; + } + n += 1; + } + if (n > 4) { + warn('bad_style'); + } + return true; + } + + return count() && (next_token.id !== '/' || count('/')); + }, + 'border-right': [ + true, 'border-right-color', 'border-right-style', + 'border-right-width' + ], + 'border-right-color': css_color, + 'border-right-style': css_border_style, + 'border-right-width': css_width, + 'border-spacing': [2, css_length], + 'border-style': [4, css_border_style], + 'border-top': [ + true, 'border-top-color', 'border-top-style', 'border-top-width' + ], + 'border-top-color': css_color, + 'border-top-left-radius': css_radius, + 'border-top-right-radius': css_radius, + 'border-top-style': css_border_style, + 'border-top-width': css_width, + 'border-width': [4, css_width], + bottom: [css_length, 'auto'], + 'caption-side' : ['bottom', 'left', 'right', 'top'], + clear: ['both', 'left', 'none', 'right'], + clip: [css_shape, 'auto'], + color: css_color, + content: [ + 'open-quote', 'close-quote', 'no-open-quote', 'no-close-quote', + css_string, css_url, css_counter, css_attr + ], + 'counter-increment': [ + css_name, 'none' + ], + 'counter-reset': [ + css_name, 'none' + ], + cursor: [ + css_url, 'auto', 'crosshair', 'default', 'e-resize', 'help', 'move', + 'n-resize', 'ne-resize', 'nw-resize', 'pointer', 's-resize', + 'se-resize', 'sw-resize', 'w-resize', 'text', 'wait' + ], + direction: ['ltr', 'rtl'], + display: [ + 'block', 'compact', 'inline', 'inline-block', 'inline-table', + 'list-item', 'marker', 'none', 'run-in', 'table', 'table-caption', + 'table-cell', 'table-column', 'table-column-group', + 'table-footer-group', 'table-header-group', 'table-row', + 'table-row-group' + ], + 'empty-cells': ['show', 'hide'], + 'float': ['left', 'none', 'right'], + font: [ + 'caption', 'icon', 'menu', 'message-box', 'small-caption', + 'status-bar', true, 'font-size', 'font-style', 'font-weight', + 'font-family' + ], + 'font-family': css_comma_list, + 'font-size': [ + 'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', + 'xx-large', 'larger', 'smaller', css_length + ], + 'font-size-adjust': ['none', css_number], + 'font-stretch': [ + 'normal', 'wider', 'narrower', 'ultra-condensed', + 'extra-condensed', 'condensed', 'semi-condensed', + 'semi-expanded', 'expanded', 'extra-expanded' + ], + 'font-style': [ + 'normal', 'italic', 'oblique' + ], + 'font-variant': [ + 'normal', 'small-caps' + ], + 'font-weight': [ + 'normal', 'bold', 'bolder', 'lighter', css_number + ], + height: [css_length, 'auto'], + left: [css_length, 'auto'], + 'letter-spacing': ['normal', css_length], + 'line-height': ['normal', css_line_height], + 'list-style': [ + true, 'list-style-image', 'list-style-position', 'list-style-type' + ], + 'list-style-image': ['none', css_url], + 'list-style-position': ['inside', 'outside'], + 'list-style-type': [ + 'circle', 'disc', 'square', 'decimal', 'decimal-leading-zero', + 'lower-roman', 'upper-roman', 'lower-greek', 'lower-alpha', + 'lower-latin', 'upper-alpha', 'upper-latin', 'hebrew', 'katakana', + 'hiragana-iroha', 'katakana-oroha', 'none' + ], + margin: [4, css_margin], + 'margin-bottom': css_margin, + 'margin-left': css_margin, + 'margin-right': css_margin, + 'margin-top': css_margin, + 'marker-offset': [css_length, 'auto'], + 'max-height': [css_length, 'none'], + 'max-width': [css_length, 'none'], + 'min-height': css_length, + 'min-width': css_length, + opacity: css_number, + outline: [true, 'outline-color', 'outline-style', 'outline-width'], + 'outline-color': ['invert', css_color], + 'outline-style': [ + 'dashed', 'dotted', 'double', 'groove', 'inset', 'none', + 'outset', 'ridge', 'solid' + ], + 'outline-width': css_width, + overflow: css_overflow, + 'overflow-x': css_overflow, + 'overflow-y': css_overflow, + padding: [4, css_length], + 'padding-bottom': css_length, + 'padding-left': css_length, + 'padding-right': css_length, + 'padding-top': css_length, + 'page-break-after': css_break, + 'page-break-before': css_break, + position: ['absolute', 'fixed', 'relative', 'static'], + quotes: [8, css_string], + right: [css_length, 'auto'], + 'table-layout': ['auto', 'fixed'], + 'text-align': ['center', 'justify', 'left', 'right'], + 'text-decoration': [ + 'none', 'underline', 'overline', 'line-through', 'blink' + ], + 'text-indent': css_length, + 'text-shadow': ['none', 4, [css_color, css_length]], + 'text-transform': ['capitalize', 'uppercase', 'lowercase', 'none'], + top: [css_length, 'auto'], + 'unicode-bidi': ['normal', 'embed', 'bidi-override'], + 'vertical-align': [ + 'baseline', 'bottom', 'sub', 'super', 'top', 'text-top', 'middle', + 'text-bottom', css_length + ], + visibility: ['visible', 'hidden', 'collapse'], + 'white-space': [ + 'normal', 'nowrap', 'pre', 'pre-line', 'pre-wrap', 'inherit' + ], + width: [css_length, 'auto'], + 'word-spacing': ['normal', css_length], + 'word-wrap': ['break-word', 'normal'], + 'z-index': ['auto', css_number] + }; + + function style_attribute() { + var v; + while (next_token.id === '*' || next_token.id === '#' || + next_token.string === '_') { + if (!option.css) { + warn('unexpected_a'); + } + advance(); + } + if (next_token.id === '-') { + if (!option.css) { + warn('unexpected_a'); + } + advance('-'); + if (!next_token.identifier) { + warn('expected_nonstandard_style_attribute'); + } + advance(); + return css_any; + } + if (!next_token.identifier) { + warn('expected_style_attribute'); + } else { + if (Object.prototype.hasOwnProperty.call(css_attribute_data, + next_token.string)) { + v = css_attribute_data[next_token.string]; + } else { + v = css_any; + if (!option.css) { + warn('unrecognized_style_attribute_a'); + } + } + } + advance(); + return v; + } + + + function style_value(v) { + var i = 0, + n, + once, + match, + round, + start = 0, + vi; + switch (typeof v) { + case 'function': + return v(); + case 'string': + if (next_token.identifier && next_token.string === v) { + advance(); + return true; + } + return false; + } + for (;;) { + if (i >= v.length) { + return false; + } + vi = v[i]; + i += 1; + if (typeof vi === 'boolean') { + break; + } else if (typeof vi === 'number') { + n = vi; + vi = v[i]; + i += 1; + } else { + n = 1; + } + match = false; + while (n > 0) { + if (style_value(vi)) { + match = true; + n -= 1; + } else { + break; + } + } + if (match) { + return true; + } + } + start = i; + once = []; + for (;;) { + round = false; + for (i = start; i < v.length; i += 1) { + if (!once[i]) { + if (style_value(css_attribute_data[v[i]])) { + match = true; + round = true; + once[i] = true; + break; + } + } + } + if (!round) { + return match; + } + } + } + + function style_child() { + if (next_token.id === '(number)') { + advance(); + if (next_token.string === 'n' && next_token.identifier) { + no_space_only(); + advance(); + if (next_token.id === '+') { + no_space_only(); + advance('+'); + no_space_only(); + advance('(number)'); + } + } + return; + } + if (next_token.identifier && + (next_token.string === 'odd' || next_token.string === 'even')) { + advance(); + return; + } + warn('unexpected_a'); + } + + function substyle() { + var v; + for (;;) { + if (next_token.id === '}' || next_token.id === '(end)' || + (xquote && next_token.id === xquote)) { + return; + } + v = style_attribute(); + advance(':'); + if (next_token.identifier && next_token.string === 'inherit') { + advance(); + } else { + if (!style_value(v)) { + warn('unexpected_a'); + advance(); + } + } + if (next_token.id === '!') { + advance('!'); + no_space_only(); + if (next_token.identifier && next_token.string === 'important') { + advance(); + } else { + warn('expected_a_b', + next_token, 'important', artifact()); + } + } + if (next_token.id === '}' || next_token.id === xquote) { + warn('expected_a_b', next_token, ';', artifact()); + } else { + semicolon(); + } + } + } + + function style_selector() { + if (next_token.identifier) { + if (!Object.prototype.hasOwnProperty.call(html_tag, option.cap + ? next_token.string.toLowerCase() + : next_token.string)) { + warn('expected_tagname_a'); + } + advance(); + } else { + switch (next_token.id) { + case '>': + case '+': + advance(); + style_selector(); + break; + case ':': + advance(':'); + switch (next_token.string) { + case 'active': + case 'after': + case 'before': + case 'checked': + case 'disabled': + case 'empty': + case 'enabled': + case 'first-child': + case 'first-letter': + case 'first-line': + case 'first-of-type': + case 'focus': + case 'hover': + case 'last-child': + case 'last-of-type': + case 'link': + case 'only-of-type': + case 'root': + case 'target': + case 'visited': + advance_identifier(next_token.string); + break; + case 'lang': + advance_identifier('lang'); + advance('('); + if (!next_token.identifier) { + warn('expected_lang_a'); + } + advance(')'); + break; + case 'nth-child': + case 'nth-last-child': + case 'nth-last-of-type': + case 'nth-of-type': + advance_identifier(next_token.string); + advance('('); + style_child(); + advance(')'); + break; + case 'not': + advance_identifier('not'); + advance('('); + if (next_token.id === ':' && peek(0).string === 'not') { + warn('not'); + } + style_selector(); + advance(')'); + break; + default: + warn('expected_pseudo_a'); + } + break; + case '#': + advance('#'); + if (!next_token.identifier) { + warn('expected_id_a'); + } + advance(); + break; + case '*': + advance('*'); + break; + case '.': + advance('.'); + if (!next_token.identifier) { + warn('expected_class_a'); + } + advance(); + break; + case '[': + advance('['); + if (!next_token.identifier) { + warn('expected_attribute_a'); + } + advance(); + if (next_token.id === '=' || next_token.string === '~=' || + next_token.string === '$=' || + next_token.string === '|=' || + next_token.id === '*=' || + next_token.id === '^=') { + advance(); + if (next_token.id !== '(string)') { + warn('expected_string_a'); + } + advance(); + } + advance(']'); + break; + default: + stop('expected_selector_a'); + } + } + } + + function style_pattern() { + if (next_token.id === '{') { + warn('expected_style_pattern'); + } + for (;;) { + style_selector(); + if (next_token.id === '= 0) { + warn('unexpected_char_a_b', token, v.charAt(x), a); + } + ids[u] = true; + } else if (a === 'class' || a === 'type' || a === 'name') { + x = v.search(qx); + if (x >= 0) { + warn('unexpected_char_a_b', token, v.charAt(x), a); + } + ids[u] = true; + } else if (a === 'href' || a === 'background' || + a === 'content' || a === 'data' || + a.indexOf('src') >= 0 || a.indexOf('url') >= 0) { + if (option.safe && ux.test(v)) { + stop('bad_url_a', next_token, v); + } + urls.push(v); + } else if (a === 'for') { + if (option.adsafe) { + if (adsafe_id) { + if (v.slice(0, adsafe_id.length) !== adsafe_id) { + warn('adsafe_prefix_a', next_token, adsafe_id); + } else if (!/^[A-Z]+_[A-Z]+$/.test(v)) { + warn('adsafe_bad_id'); + } + } else { + warn('adsafe_bad_id'); + } + } + } else if (a === 'name') { + if (option.adsafe && v.indexOf('_') >= 0) { + warn('adsafe_name_a', next_token, v); + } + } + } + + function do_tag(name, attribute) { + var i, tag = html_tag[name], script, x; + src = false; + if (!tag) { + stop( + bundle.unrecognized_tag_a, + next_token, + name === name.toLowerCase() + ? name + : name + ' (capitalization error)' + ); + } + if (stack.length > 0) { + if (name === 'html') { + stop('unexpected_a', token, name); + } + x = tag.parent; + if (x) { + if (x.indexOf(' ' + stack[stack.length - 1].name + ' ') < 0) { + stop('tag_a_in_b', token, name, x); + } + } else if (!option.adsafe && !option.fragment) { + i = stack.length; + do { + if (i <= 0) { + stop('tag_a_in_b', token, name, 'body'); + } + i -= 1; + } while (stack[i].name !== 'body'); + } + } + switch (name) { + case 'div': + if (option.adsafe && stack.length === 1 && !adsafe_id) { + warn('adsafe_missing_id'); + } + break; + case 'script': + xmode = 'script'; + advance('>'); + if (attribute.lang) { + warn('lang', token); + } + if (option.adsafe && stack.length !== 1) { + warn('adsafe_placement', token); + } + if (attribute.src) { + if (option.adsafe && (!adsafe_may || !approved[attribute.src])) { + warn('adsafe_source', token); + } + } else { + step_in(next_token.from); + edge(); + use_strict(); + adsafe_top = true; + script = statements(); + +// JSLint is also the static analyzer for ADsafe. See www.ADsafe.org. + + if (option.adsafe) { + if (adsafe_went) { + stop('adsafe_script', token); + } + if (script.length !== 1 || + aint(script[0], 'id', '(') || + aint(script[0].first, 'id', '.') || + aint(script[0].first.first, 'string', 'ADSAFE') || + aint(script[0].second[0], 'string', adsafe_id)) { + stop('adsafe_id_go'); + } + switch (script[0].first.second.string) { + case 'id': + if (adsafe_may || adsafe_went || + script[0].second.length !== 1) { + stop('adsafe_id', next_token); + } + adsafe_may = true; + break; + case 'go': + if (adsafe_went) { + stop('adsafe_go'); + } + if (script[0].second.length !== 2 || + aint(script[0].second[1], 'id', 'function') || + !script[0].second[1].first || + aint(script[0].second[1].first[0], 'string', 'dom') || + script[0].second[1].first.length > 2 || + (script[0].second[1].first.length === 2 && + aint(script[0].second[1].first[1], 'string', 'lib'))) { + stop('adsafe_go', next_token); + } + adsafe_went = true; + break; + default: + stop('adsafe_id_go'); + } + } + indent = null; + } + xmode = 'html'; + advance(''); + styles(); + xmode = 'html'; + advance(''; + } + + function html() { + var attribute, attributes, is_empty, name, old_white = option.white, + quote, tag_name, tag, wmode; + xmode = 'html'; + xquote = ''; + stack = null; + for (;;) { + switch (next_token.string) { + case '<': + xmode = 'html'; + advance('<'); + attributes = {}; + tag_name = next_token; + name = tag_name.string; + advance_identifier(name); + if (option.cap) { + name = name.toLowerCase(); + } + tag_name.name = name; + if (!stack) { + stack = []; + do_begin(name); + } + tag = html_tag[name]; + if (typeof tag !== 'object') { + stop('unrecognized_tag_a', tag_name, name); + } + is_empty = tag.empty; + tag_name.type = name; + for (;;) { + if (next_token.id === '/') { + advance('/'); + if (next_token.id !== '>') { + warn('expected_a_b', next_token, '>', artifact()); + } + break; + } + if (next_token.id && next_token.id.charAt(0) === '>') { + break; + } + if (!next_token.identifier) { + if (next_token.id === '(end)' || next_token.id === '(error)') { + warn('expected_a_b', next_token, '>', artifact()); + } + warn('bad_name_a'); + } + option.white = false; + spaces(); + attribute = next_token.string; + option.white = old_white; + advance(); + if (!option.cap && attribute !== attribute.toLowerCase()) { + warn('attribute_case_a', token); + } + attribute = attribute.toLowerCase(); + xquote = ''; + if (Object.prototype.hasOwnProperty.call(attributes, attribute)) { + warn('duplicate_a', token, attribute); + } + if (attribute.slice(0, 2) === 'on') { + if (!option.on) { + warn('html_handlers'); + } + xmode = 'scriptstring'; + advance('='); + quote = next_token.id; + if (quote !== '"' && quote !== '\'') { + stop('expected_a_b', next_token, '"', artifact()); + } + xquote = quote; + wmode = option.white; + option.white = true; + advance(quote); + use_strict(); + statements(); + option.white = wmode; + if (next_token.id !== quote) { + stop('expected_a_b', next_token, quote, artifact()); + } + xmode = 'html'; + xquote = ''; + advance(quote); + tag = false; + } else if (attribute === 'style') { + xmode = 'scriptstring'; + advance('='); + quote = next_token.id; + if (quote !== '"' && quote !== '\'') { + stop('expected_a_b', next_token, '"', artifact()); + } + xmode = 'styleproperty'; + xquote = quote; + advance(quote); + substyle(); + xmode = 'html'; + xquote = ''; + advance(quote); + tag = false; + } else { + if (next_token.id === '=') { + advance('='); + tag = next_token.string; + if (!next_token.identifier && + next_token.id !== '"' && + next_token.id !== '\'' && + next_token.id !== '(string)' && + next_token.id !== '(string)' && + next_token.id !== '(color)') { + warn('expected_attribute_value_a', token, attribute); + } + advance(); + } else { + tag = true; + } + } + attributes[attribute] = tag; + do_attribute(attribute, tag); + } + do_tag(name, attributes); + if (!is_empty) { + stack.push(tag_name); + } + xmode = 'outer'; + advance('>'); + break; + case '') { + stop('expected_a_b', next_token, '>', artifact()); + } + xmode = 'outer'; + advance('>'); + break; + case '' || next_token.id === '(end)') { + break; + } + if (next_token.string.indexOf('--') >= 0) { + stop('unexpected_a', next_token, '--'); + } + if (next_token.string.indexOf('<') >= 0) { + stop('unexpected_a', next_token, '<'); + } + if (next_token.string.indexOf('>') >= 0) { + stop('unexpected_a', next_token, '>'); + } + } + xmode = 'outer'; + advance('>'); + break; + case '(end)': + if (stack.length !== 0) { + warn('missing_a', next_token, ''); + } + return; + default: + if (next_token.id === '(end)') { + stop('missing_a', next_token, + ''); + } else { + advance(); + } + } + if (stack && stack.length === 0 && (option.adsafe || + !option.fragment || next_token.id === '(end)')) { + break; + } + } + if (next_token.id !== '(end)') { + stop('unexpected_a'); + } + } + + +// The actual JSLINT function itself. + + itself = function JSLint(the_source, the_option) { + + var i, predef, tree; + JSLINT.errors = []; + JSLINT.tree = ''; + begin = prev_token = token = next_token = + Object.create(syntax['(begin)']); + predefined = {}; + add_to_predefined(standard); + property = {}; + if (the_option) { + option = Object.create(the_option); + predef = option.predef; + if (predef) { + if (Array.isArray(predef)) { + for (i = 0; i < predef.length; i += 1) { + predefined[predef[i]] = true; + } + } else if (typeof predef === 'object') { + add_to_predefined(predef); + } + } + do_safe(); + } else { + option = {}; + } + option.indent = +option.indent || 4; + option.maxerr = +option.maxerr || 50; + adsafe_id = ''; + adsafe_may = adsafe_top = adsafe_went = false; + approved = {}; + if (option.approved) { + for (i = 0; i < option.approved.length; i += 1) { + approved[option.approved[i]] = option.approved[i]; + } + } else { + approved.test = 'test'; + } + tab = ''; + for (i = 0; i < option.indent; i += 1) { + tab += ' '; + } + global_scope = scope = {}; + global_funct = funct = { + '(scope)': scope, + '(breakage)': 0, + '(loopage)': 0 + }; + functions = [funct]; + + comments_off = false; + ids = {}; + in_block = false; + indent = null; + json_mode = false; + lookahead = []; + node_js = false; + prereg = true; + src = false; + stack = null; + strict_mode = false; + urls = []; + var_mode = null; + warnings = 0; + xmode = ''; + lex.init(the_source); + + assume(); + + try { + advance(); + if (next_token.id === '(number)') { + stop('unexpected_a'); + } else if (next_token.string.charAt(0) === '<') { + html(); + if (option.adsafe && !adsafe_went) { + warn('adsafe_go', this); + } + } else { + switch (next_token.id) { + case '{': + case '[': + json_mode = true; + json_value(); + break; + case '@': + case '*': + case '#': + case '.': + case ':': + xmode = 'style'; + advance(); + if (token.id !== '@' || !next_token.identifier || + next_token.string !== 'charset' || token.line !== 1 || + token.from !== 1) { + stop('css'); + } + advance(); + if (next_token.id !== '(string)' && + next_token.string !== 'UTF-8') { + stop('css'); + } + advance(); + semicolon(); + styles(); + break; + + default: + if (option.adsafe && option.fragment) { + stop('expected_a_b', + next_token, '
    ', artifact()); + } + +// If the first token is a semicolon, ignore it. This is sometimes used when +// files are intended to be appended to files that may be sloppy. A sloppy +// file may be depending on semicolon insertion on its last line. + + step_in(1); + if (next_token.id === ';' && !node_js) { + semicolon(); + } + adsafe_top = true; + tree = statements(); + begin.first = tree; + JSLINT.tree = begin; + // infer_types(tree); + if (option.adsafe && (tree.length !== 1 || + aint(tree[0], 'id', '(') || + aint(tree[0].first, 'id', '.') || + aint(tree[0].first.first, 'string', 'ADSAFE') || + aint(tree[0].first.second, 'string', 'lib') || + tree[0].second.length !== 2 || + tree[0].second[0].id !== '(string)' || + aint(tree[0].second[1], 'id', 'function'))) { + stop('adsafe_lib'); + } + if (tree.disrupt) { + warn('weird_program', prev_token); + } + } + } + indent = null; + advance('(end)'); + } catch (e) { + if (e) { // ~~ + JSLINT.errors.push({ + reason : e.message, + line : e.line || next_token.line, + character : e.character || next_token.from + }, null); + } + } + return JSLINT.errors.length === 0; + }; + + +// Data summary. + + itself.data = function () { + var data = {functions: []}, + function_data, + globals, + i, + j, + kind, + members = [], + name, + the_function, + undef = [], + unused = []; + if (itself.errors.length) { + data.errors = itself.errors; + } + + if (json_mode) { + data.json = true; + } + + if (urls.length > 0) { + data.urls = urls; + } + + globals = Object.keys(global_scope).filter(function (value) { + return value.charAt(0) !== '(' && typeof standard[value] !== 'boolean'; + }); + if (globals.length > 0) { + data.globals = globals; + } + + for (i = 1; i < functions.length; i += 1) { + the_function = functions[i]; + function_data = {}; + for (j = 0; j < functionicity.length; j += 1) { + function_data[functionicity[j]] = []; + } + for (name in the_function) { + if (Object.prototype.hasOwnProperty.call(the_function, name)) { + if (name.charAt(0) !== '(') { + kind = the_function[name]; + if (kind === 'unction' || kind === 'unparam') { + kind = 'unused'; + } + if (Array.isArray(function_data[kind])) { + function_data[kind].push(name); + if (kind === 'unused') { + unused.push({ + name: name, + line: the_function['(line)'], + 'function': the_function['(name)'] + }); + } else if (kind === 'undef') { + undef.push({ + name: name, + line: the_function['(line)'], + 'function': the_function['(name)'] + }); + } + } + } + } + } + for (j = 0; j < functionicity.length; j += 1) { + if (function_data[functionicity[j]].length === 0) { + delete function_data[functionicity[j]]; + } + } + function_data.name = the_function['(name)']; + function_data.params = the_function['(params)']; + function_data.line = the_function['(line)']; + data.functions.push(function_data); + } + + if (unused.length > 0) { + data.unused = unused; + } + if (undef.length > 0) { + data['undefined'] = undef; + } + + members = []; + for (name in property) { + if (typeof property[name] === 'number') { + data.member = property; + break; + } + } + + return data; + }; + + + itself.report = function (errors_only) { + var data = itself.data(), err, evidence, i, italics, j, key, keys, + length, mem = '', name, names, not_first, output = [], snippets, + the_function, warning; + + function detail(h, value) { + var comma_needed, singularity; + if (Array.isArray(value)) { + output.push('
    ' + h + ' '); + value.sort().forEach(function (item) { + if (item !== singularity) { + singularity = item; + output.push((comma_needed ? ', ' : '') + singularity); + comma_needed = true; + } + }); + output.push('
    '); + } else if (value) { + output.push('
    ' + h + ' ' + value + '
    '); + } + } + + if (data.errors || data.unused || data['undefined']) { + err = true; + output.push('
    Error:'); + if (data.errors) { + for (i = 0; i < data.errors.length; i += 1) { + warning = data.errors[i]; + if (warning) { + evidence = warning.evidence || ''; + output.push('

    Problem' + (isFinite(warning.line) + ? ' at line ' + String(warning.line) + + ' character ' + String(warning.character) + : '') + + ': ' + warning.reason.entityify() + + '

    ' + + (evidence && (evidence.length > 80 + ? evidence.slice(0, 77) + '...' + : evidence).entityify()) + '

    '); + } + } + } + + if (data['undefined']) { + snippets = []; + for (i = 0; i < data['undefined'].length; i += 1) { + snippets[i] = '' + data['undefined'][i].name + ' ' + + String(data['undefined'][i].line) + ' ' + + data['undefined'][i]['function'] + ''; + } + output.push('

    Undefined variable: ' + snippets.join(', ') + '

    '); + } + if (data.unused) { + snippets = []; + for (i = 0; i < data.unused.length; i += 1) { + snippets[i] = '' + data.unused[i].name + ' ' + + String(data.unused[i].line) + ' ' + + data.unused[i]['function'] + ''; + } + output.push('

    Unused variable: ' + snippets.join(', ') + '

    '); + } + if (data.json) { + output.push('

    JSON: bad.

    '); + } + output.push('
    '); + } + + if (!errors_only) { + + output.push('
    '); + + if (data.urls) { + detail("URLs
    ", data.urls, '
    '); + } + + if (xmode === 'style') { + output.push('

    CSS.

    '); + } else if (data.json && !err) { + output.push('

    JSON: good.

    '); + } else if (data.globals) { + output.push('
    Global ' + + data.globals.sort().join(', ') + '
    '); + } else { + output.push('
    No new global variables introduced.
    '); + } + + for (i = 0; i < data.functions.length; i += 1) { + the_function = data.functions[i]; + names = []; + if (the_function.params) { + for (j = 0; j < the_function.params.length; j += 1) { + names[j] = the_function.params[j].string; + } + } + output.push('
    ' + + String(the_function.line) + ' ' + + the_function.name.entityify() + + '(' + names.join(', ') + ')
    '); + detail('Undefined', the_function['undefined']); + detail('Unused', the_function.unused); + detail('Closure', the_function.closure); + detail('Variable', the_function['var']); + detail('Exception', the_function.exception); + detail('Outer', the_function.outer); + detail('Global', the_function.global); + detail('Label', the_function.label); + } + + if (data.member) { + keys = Object.keys(data.member); + if (keys.length) { + keys = keys.sort(); + output.push('
    /*properties
    '); + mem = ' '; + italics = 0; + j = 0; + not_first = false; + for (i = 0; i < keys.length; i += 1) { + key = keys[i]; + if (data.member[key] > 0) { + if (not_first) { + mem += ', '; + } + name = ix.test(key) + ? key + : '\'' + key.entityify().replace(nx, sanitize) + '\''; + length += name.length + 2; + if (data.member[key] === 1) { + name = '' + name + ''; + italics += 1; + j = 1; + } + if (mem.length + name.length - (italics * 7) > 80) { + output.push(mem + '
    '); + mem = ' '; + italics = j; + } + mem += name; + j = 0; + not_first = true; + } + } + output.push(mem + '
    */
    '); + } + output.push('
    '); + } + } + return output.join(''); + }; + itself.jslint = itself; + + itself.edition = '2012-03-02'; + + return itself; +}()); diff --git a/build-tools/lib/jslint/linter.js b/build-tools/lib/jslint/linter.js new file mode 100644 index 0000000..1ba46e4 --- /dev/null +++ b/build-tools/lib/jslint/linter.js @@ -0,0 +1,45 @@ +/* original +var JSLINT = require("../lib/nodelint"); + */ +var JSLINT = require("./nodelint"); + +function addDefaults(options) { + 'use strict'; + ['node', 'es5'].forEach(function (opt) { + if (!options.hasOwnProperty(opt)) { + options[opt] = true; + } + }); + return options; +} + +exports.lint = function (script, options) { + 'use strict'; + // remove shebang + /*jslint regexp: true*/ + script = script.replace(/^\#\!.*/, ""); + + options = options || {}; + delete options.argv; + options = addDefaults(options); + + if (options.predef && !Array.isArray(options.predef)) { + options.predef = options.predef.split(',') + .filter(function (n) { return !!n; }); + } + + var ok = JSLINT(script, options), + result = { + ok: true, + errors: [] + }; + + if (!ok) { + result = JSLINT.data(); + result.ok = ok; + } + + result.options = options; + + return result; +}; diff --git a/build-tools/lib/jslint/nodelint.js b/build-tools/lib/jslint/nodelint.js new file mode 100644 index 0000000..a7bb701 --- /dev/null +++ b/build-tools/lib/jslint/nodelint.js @@ -0,0 +1,11 @@ +/*jslint + nomen: true + */ +var vm = require("vm"); +var fs = require("fs"); + +var ctx = vm.createContext(); + +vm.runInContext(fs.readFileSync(__dirname + "/jslint.js"), ctx); + +module.exports = ctx.JSLINT; diff --git a/build-tools/lib/jslint/nopt.js b/build-tools/lib/jslint/nopt.js new file mode 100644 index 0000000..6f77d04 --- /dev/null +++ b/build-tools/lib/jslint/nopt.js @@ -0,0 +1,552 @@ +// info about each config option. + +var debug = process.env.DEBUG_NOPT || process.env.NOPT_DEBUG + ? function () { console.error.apply(console, arguments) } + : function () {} + +var url = require("url") + , path = require("path") + , Stream = require("stream").Stream + , abbrev = require("./abbrev") + +module.exports = exports = nopt +exports.clean = clean + +exports.typeDefs = + { String : { type: String, validate: validateString } + , Boolean : { type: Boolean, validate: validateBoolean } + , url : { type: url, validate: validateUrl } + , Number : { type: Number, validate: validateNumber } + , path : { type: path, validate: validatePath } + , Stream : { type: Stream, validate: validateStream } + , Date : { type: Date, validate: validateDate } + } + +function nopt (types, shorthands, args, slice) { + args = args || process.argv + types = types || {} + shorthands = shorthands || {} + if (typeof slice !== "number") slice = 2 + + debug(types, shorthands, args, slice) + + args = args.slice(slice) + var data = {} + , key + , remain = [] + , cooked = args + , original = args.slice(0) + + parse(args, data, remain, types, shorthands) + // now data is full + clean(data, types, exports.typeDefs) + data.argv = {remain:remain,cooked:cooked,original:original} + data.argv.toString = function () { + return this.original.map(JSON.stringify).join(" ") + } + return data +} + +function clean (data, types, typeDefs) { + typeDefs = typeDefs || exports.typeDefs + var remove = {} + , typeDefault = [false, true, null, String, Number] + + Object.keys(data).forEach(function (k) { + if (k === "argv") return + var val = data[k] + , isArray = Array.isArray(val) + , type = types[k] + if (!isArray) val = [val] + if (!type) type = typeDefault + if (type === Array) type = typeDefault.concat(Array) + if (!Array.isArray(type)) type = [type] + + debug("val=%j", val) + debug("types=", type) + val = val.map(function (val) { + // if it's an unknown value, then parse false/true/null/numbers/dates + if (typeof val === "string") { + debug("string %j", val) + val = val.trim() + if ((val === "null" && ~type.indexOf(null)) + || (val === "true" && + (~type.indexOf(true) || ~type.indexOf(Boolean))) + || (val === "false" && + (~type.indexOf(false) || ~type.indexOf(Boolean)))) { + val = JSON.parse(val) + debug("jsonable %j", val) + } else if (~type.indexOf(Number) && !isNaN(val)) { + debug("convert to number", val) + val = +val + } else if (~type.indexOf(Date) && !isNaN(Date.parse(val))) { + debug("convert to date", val) + val = new Date(val) + } + } + + if (!types.hasOwnProperty(k)) { + return val + } + + // allow `--no-blah` to set 'blah' to null if null is allowed + if (val === false && ~type.indexOf(null) && + !(~type.indexOf(false) || ~type.indexOf(Boolean))) { + val = null + } + + var d = {} + d[k] = val + debug("prevalidated val", d, val, types[k]) + if (!validate(d, k, val, types[k], typeDefs)) { + if (exports.invalidHandler) { + exports.invalidHandler(k, val, types[k], data) + } else if (exports.invalidHandler !== false) { + debug("invalid: "+k+"="+val, types[k]) + } + return remove + } + debug("validated val", d, val, types[k]) + return d[k] + }).filter(function (val) { return val !== remove }) + + if (!val.length) delete data[k] + else if (isArray) { + debug(isArray, data[k], val) + data[k] = val + } else data[k] = val[0] + + debug("k=%s val=%j", k, val, data[k]) + }) +} + +function validateString (data, k, val) { + data[k] = String(val) +} + +function validatePath (data, k, val) { + data[k] = path.resolve(String(val)) + return true +} + +function validateNumber (data, k, val) { + debug("validate Number %j %j %j", k, val, isNaN(val)) + if (isNaN(val)) return false + data[k] = +val +} + +function validateDate (data, k, val) { + debug("validate Date %j %j %j", k, val, Date.parse(val)) + var s = Date.parse(val) + if (isNaN(s)) return false + data[k] = new Date(val) +} + +function validateBoolean (data, k, val) { + if (val instanceof Boolean) val = val.valueOf() + else if (typeof val === "string") { + if (!isNaN(val)) val = !!(+val) + else if (val === "null" || val === "false") val = false + else val = true + } else val = !!val + data[k] = val +} + +function validateUrl (data, k, val) { + val = url.parse(String(val)) + if (!val.host) return false + data[k] = val.href +} + +function validateStream (data, k, val) { + if (!(val instanceof Stream)) return false + data[k] = val +} + +function validate (data, k, val, type, typeDefs) { + // arrays are lists of types. + if (Array.isArray(type)) { + for (var i = 0, l = type.length; i < l; i ++) { + if (type[i] === Array) continue + if (validate(data, k, val, type[i], typeDefs)) return true + } + delete data[k] + return false + } + + // an array of anything? + if (type === Array) return true + + // NaN is poisonous. Means that something is not allowed. + if (type !== type) { + debug("Poison NaN", k, val, type) + delete data[k] + return false + } + + // explicit list of values + if (val === type) { + debug("Explicitly allowed %j", val) + // if (isArray) (data[k] = data[k] || []).push(val) + // else data[k] = val + data[k] = val + return true + } + + // now go through the list of typeDefs, validate against each one. + var ok = false + , types = Object.keys(typeDefs) + for (var i = 0, l = types.length; i < l; i ++) { + debug("test type %j %j %j", k, val, types[i]) + var t = typeDefs[types[i]] + if (t && type === t.type) { + var d = {} + ok = false !== t.validate(d, k, val) + val = d[k] + if (ok) { + // if (isArray) (data[k] = data[k] || []).push(val) + // else data[k] = val + data[k] = val + break + } + } + } + debug("OK? %j (%j %j %j)", ok, k, val, types[i]) + + if (!ok) delete data[k] + return ok +} + +function parse (args, data, remain, types, shorthands) { + debug("parse", args, data, remain) + + var key = null + , abbrevs = abbrev(Object.keys(types)) + , shortAbbr = abbrev(Object.keys(shorthands)) + + for (var i = 0; i < args.length; i ++) { + var arg = args[i] + debug("arg", arg) + + if (arg.match(/^-{2,}$/)) { + // done with keys. + // the rest are args. + remain.push.apply(remain, args.slice(i + 1)) + args[i] = "--" + break + } + if (arg.charAt(0) === "-") { + if (arg.indexOf("=") !== -1) { + var v = arg.split("=") + arg = v.shift() + v = v.join("=") + args.splice.apply(args, [i, 1].concat([arg, v])) + } + // see if it's a shorthand + // if so, splice and back up to re-parse it. + var shRes = resolveShort(arg, shorthands, shortAbbr, abbrevs) + debug("arg=%j shRes=%j", arg, shRes) + if (shRes) { + debug(arg, shRes) + args.splice.apply(args, [i, 1].concat(shRes)) + if (arg !== shRes[0]) { + i -- + continue + } + } + arg = arg.replace(/^-+/, "") + var no = false + while (arg.toLowerCase().indexOf("no-") === 0) { + no = !no + arg = arg.substr(3) + } + + if (abbrevs[arg]) arg = abbrevs[arg] + + var isArray = types[arg] === Array || + Array.isArray(types[arg]) && types[arg].indexOf(Array) !== -1 + + var val + , la = args[i + 1] + + var isBool = no || + types[arg] === Boolean || + Array.isArray(types[arg]) && types[arg].indexOf(Boolean) !== -1 || + (la === "false" && + (types[arg] === null || + Array.isArray(types[arg]) && ~types[arg].indexOf(null))) + + if (isBool) { + // just set and move along + val = !no + // however, also support --bool true or --bool false + if (la === "true" || la === "false") { + val = JSON.parse(la) + la = null + if (no) val = !val + i ++ + } + + // also support "foo":[Boolean, "bar"] and "--foo bar" + if (Array.isArray(types[arg]) && la) { + if (~types[arg].indexOf(la)) { + // an explicit type + val = la + i ++ + } else if ( la === "null" && ~types[arg].indexOf(null) ) { + // null allowed + val = null + i ++ + } else if ( !la.match(/^-{2,}[^-]/) && + !isNaN(la) && + ~types[arg].indexOf(Number) ) { + // number + val = +la + i ++ + } else if ( !la.match(/^-[^-]/) && ~types[arg].indexOf(String) ) { + // string + val = la + i ++ + } + } + + if (isArray) (data[arg] = data[arg] || []).push(val) + else data[arg] = val + + continue + } + + if (la && la.match(/^-{2,}$/)) { + la = undefined + i -- + } + + val = la === undefined ? true : la + if (isArray) (data[arg] = data[arg] || []).push(val) + else data[arg] = val + + i ++ + continue + } + remain.push(arg) + } +} + +function resolveShort (arg, shorthands, shortAbbr, abbrevs) { + // handle single-char shorthands glommed together, like + // npm ls -glp, but only if there is one dash, and only if + // all of the chars are single-char shorthands, and it's + // not a match to some other abbrev. + arg = arg.replace(/^-+/, '') + if (abbrevs[arg] && !shorthands[arg]) { + return null + } + if (shortAbbr[arg]) { + arg = shortAbbr[arg] + } else { + var singles = shorthands.___singles + if (!singles) { + singles = Object.keys(shorthands).filter(function (s) { + return s.length === 1 + }).reduce(function (l,r) { l[r] = true ; return l }, {}) + shorthands.___singles = singles + } + var chrs = arg.split("").filter(function (c) { + return singles[c] + }) + if (chrs.join("") === arg) return chrs.map(function (c) { + return shorthands[c] + }).reduce(function (l, r) { + return l.concat(r) + }, []) + } + + if (shorthands[arg] && !Array.isArray(shorthands[arg])) { + shorthands[arg] = shorthands[arg].split(/\s+/) + } + return shorthands[arg] +} + +if (module === require.main) { +var assert = require("assert") + , util = require("util") + + , shorthands = + { s : ["--loglevel", "silent"] + , d : ["--loglevel", "info"] + , dd : ["--loglevel", "verbose"] + , ddd : ["--loglevel", "silly"] + , noreg : ["--no-registry"] + , reg : ["--registry"] + , "no-reg" : ["--no-registry"] + , silent : ["--loglevel", "silent"] + , verbose : ["--loglevel", "verbose"] + , h : ["--usage"] + , H : ["--usage"] + , "?" : ["--usage"] + , help : ["--usage"] + , v : ["--version"] + , f : ["--force"] + , desc : ["--description"] + , "no-desc" : ["--no-description"] + , "local" : ["--no-global"] + , l : ["--long"] + , p : ["--parseable"] + , porcelain : ["--parseable"] + , g : ["--global"] + } + + , types = + { aoa: Array + , nullstream: [null, Stream] + , date: Date + , str: String + , browser : String + , cache : path + , color : ["always", Boolean] + , depth : Number + , description : Boolean + , dev : Boolean + , editor : path + , force : Boolean + , global : Boolean + , globalconfig : path + , group : [String, Number] + , gzipbin : String + , logfd : [Number, Stream] + , loglevel : ["silent","win","error","warn","info","verbose","silly"] + , long : Boolean + , "node-version" : [false, String] + , npaturl : url + , npat : Boolean + , "onload-script" : [false, String] + , outfd : [Number, Stream] + , parseable : Boolean + , pre: Boolean + , prefix: path + , proxy : url + , "rebuild-bundle" : Boolean + , registry : url + , searchopts : String + , searchexclude: [null, String] + , shell : path + , t: [Array, String] + , tag : String + , tar : String + , tmp : path + , "unsafe-perm" : Boolean + , usage : Boolean + , user : String + , username : String + , userconfig : path + , version : Boolean + , viewer: path + , _exit : Boolean + } + +; [["-v", {version:true}, []] + ,["---v", {version:true}, []] + ,["ls -s --no-reg connect -d", + {loglevel:"info",registry:null},["ls","connect"]] + ,["ls ---s foo",{loglevel:"silent"},["ls","foo"]] + ,["ls --registry blargle", {}, ["ls"]] + ,["--no-registry", {registry:null}, []] + ,["--no-color true", {color:false}, []] + ,["--no-color false", {color:true}, []] + ,["--no-color", {color:false}, []] + ,["--color false", {color:false}, []] + ,["--color --logfd 7", {logfd:7,color:true}, []] + ,["--color=true", {color:true}, []] + ,["--logfd=10", {logfd:10}, []] + ,["--tmp=/tmp -tar=gtar",{tmp:"/tmp",tar:"gtar"},[]] + ,["--tmp=tmp -tar=gtar", + {tmp:path.resolve(process.cwd(), "tmp"),tar:"gtar"},[]] + ,["--logfd x", {}, []] + ,["a -true -- -no-false", {true:true},["a","-no-false"]] + ,["a -no-false", {false:false},["a"]] + ,["a -no-no-true", {true:true}, ["a"]] + ,["a -no-no-no-false", {false:false}, ["a"]] + ,["---NO-no-No-no-no-no-nO-no-no"+ + "-No-no-no-no-no-no-no-no-no"+ + "-no-no-no-no-NO-NO-no-no-no-no-no-no"+ + "-no-body-can-do-the-boogaloo-like-I-do" + ,{"body-can-do-the-boogaloo-like-I-do":false}, []] + ,["we are -no-strangers-to-love "+ + "--you-know the-rules --and so-do-i "+ + "---im-thinking-of=a-full-commitment "+ + "--no-you-would-get-this-from-any-other-guy "+ + "--no-gonna-give-you-up "+ + "-no-gonna-let-you-down=true "+ + "--no-no-gonna-run-around false "+ + "--desert-you=false "+ + "--make-you-cry false "+ + "--no-tell-a-lie "+ + "--no-no-and-hurt-you false" + ,{"strangers-to-love":false + ,"you-know":"the-rules" + ,"and":"so-do-i" + ,"you-would-get-this-from-any-other-guy":false + ,"gonna-give-you-up":false + ,"gonna-let-you-down":false + ,"gonna-run-around":false + ,"desert-you":false + ,"make-you-cry":false + ,"tell-a-lie":false + ,"and-hurt-you":false + },["we", "are"]] + ,["-t one -t two -t three" + ,{t: ["one", "two", "three"]} + ,[]] + ,["-t one -t null -t three four five null" + ,{t: ["one", "null", "three"]} + ,["four", "five", "null"]] + ,["-t foo" + ,{t:["foo"]} + ,[]] + ,["--no-t" + ,{t:["false"]} + ,[]] + ,["-no-no-t" + ,{t:["true"]} + ,[]] + ,["-aoa one -aoa null -aoa 100" + ,{aoa:["one", null, 100]} + ,[]] + ,["-str 100" + ,{str:"100"} + ,[]] + ,["--color always" + ,{color:"always"} + ,[]] + ,["--no-nullstream" + ,{nullstream:null} + ,[]] + ,["--nullstream false" + ,{nullstream:null} + ,[]] + ,["--notadate 2011-01-25" + ,{notadate: "2011-01-25"} + ,[]] + ,["--date 2011-01-25" + ,{date: new Date("2011-01-25")} + ,[]] + ].forEach(function (test) { + var argv = test[0].split(/\s+/) + , opts = test[1] + , rem = test[2] + , actual = nopt(types, shorthands, argv, 0) + , parsed = actual.argv + delete actual.argv + console.log(util.inspect(actual, false, 2, true), parsed.remain) + for (var i in opts) { + var e = JSON.stringify(opts[i]) + , a = JSON.stringify(actual[i] === undefined ? null : actual[i]) + if (e && typeof e === "object") { + assert.deepEqual(e, a) + } else { + assert.equal(e, a) + } + } + assert.deepEqual(rem, parsed.remain) + }) +} diff --git a/build-tools/lib/jslint/nopt/LICENSE b/build-tools/lib/jslint/nopt/LICENSE new file mode 100644 index 0000000..05a4010 --- /dev/null +++ b/build-tools/lib/jslint/nopt/LICENSE @@ -0,0 +1,23 @@ +Copyright 2009, 2010, 2011 Isaac Z. Schlueter. +All rights reserved. + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/build-tools/lib/jslint/nopt/abbrev.js b/build-tools/lib/jslint/nopt/abbrev.js new file mode 100644 index 0000000..037de2d --- /dev/null +++ b/build-tools/lib/jslint/nopt/abbrev.js @@ -0,0 +1,106 @@ + +module.exports = exports = abbrev.abbrev = abbrev + +abbrev.monkeyPatch = monkeyPatch + +function monkeyPatch () { + Array.prototype.abbrev = function () { return abbrev(this) } + Object.prototype.abbrev = function () { return abbrev(Object.keys(this)) } +} + +function abbrev (list) { + if (arguments.length !== 1 || !Array.isArray(list)) { + list = Array.prototype.slice.call(arguments, 0) + } + for (var i = 0, l = list.length, args = [] ; i < l ; i ++) { + args[i] = typeof list[i] === "string" ? list[i] : String(list[i]) + } + + // sort them lexicographically, so that they're next to their nearest kin + args = args.sort(lexSort) + + // walk through each, seeing how much it has in common with the next and previous + var abbrevs = {} + , prev = "" + for (var i = 0, l = args.length ; i < l ; i ++) { + var current = args[i] + , next = args[i + 1] || "" + , nextMatches = true + , prevMatches = true + if (current === next) continue + for (var j = 0, cl = current.length ; j < cl ; j ++) { + var curChar = current.charAt(j) + nextMatches = nextMatches && curChar === next.charAt(j) + prevMatches = prevMatches && curChar === prev.charAt(j) + if (nextMatches || prevMatches) continue + else { + j ++ + break + } + } + prev = current + if (j === cl) { + abbrevs[current] = current + continue + } + for (var a = current.substr(0, j) ; j <= cl ; j ++) { + abbrevs[a] = current + a += current.charAt(j) + } + } + return abbrevs +} + +function lexSort (a, b) { + return a === b ? 0 : a > b ? 1 : -1 +} + + +// tests +if (module === require.main) { + +var assert = require("assert") + , sys +sys = require("util") + +console.log("running tests") +function test (list, expect) { + var actual = abbrev(list) + assert.deepEqual(actual, expect, + "abbrev("+sys.inspect(list)+") === " + sys.inspect(expect) + "\n"+ + "actual: "+sys.inspect(actual)) + actual = abbrev.apply(exports, list) + assert.deepEqual(abbrev.apply(exports, list), expect, + "abbrev("+list.map(JSON.stringify).join(",")+") === " + sys.inspect(expect) + "\n"+ + "actual: "+sys.inspect(actual)) +} + +test([ "ruby", "ruby", "rules", "rules", "rules" ], +{ rub: 'ruby' +, ruby: 'ruby' +, rul: 'rules' +, rule: 'rules' +, rules: 'rules' +}) +test(["fool", "foom", "pool", "pope"], +{ fool: 'fool' +, foom: 'foom' +, poo: 'pool' +, pool: 'pool' +, pop: 'pope' +, pope: 'pope' +}) +test(["a", "ab", "abc", "abcd", "abcde", "acde"], +{ a: 'a' +, ab: 'ab' +, abc: 'abc' +, abcd: 'abcd' +, abcde: 'abcde' +, ac: 'acde' +, acd: 'acde' +, acde: 'acde' +}) + +console.log("pass") + +} diff --git a/build-tools/lib/jslint/nopt/nopt.js b/build-tools/lib/jslint/nopt/nopt.js new file mode 100644 index 0000000..6f77d04 --- /dev/null +++ b/build-tools/lib/jslint/nopt/nopt.js @@ -0,0 +1,552 @@ +// info about each config option. + +var debug = process.env.DEBUG_NOPT || process.env.NOPT_DEBUG + ? function () { console.error.apply(console, arguments) } + : function () {} + +var url = require("url") + , path = require("path") + , Stream = require("stream").Stream + , abbrev = require("./abbrev") + +module.exports = exports = nopt +exports.clean = clean + +exports.typeDefs = + { String : { type: String, validate: validateString } + , Boolean : { type: Boolean, validate: validateBoolean } + , url : { type: url, validate: validateUrl } + , Number : { type: Number, validate: validateNumber } + , path : { type: path, validate: validatePath } + , Stream : { type: Stream, validate: validateStream } + , Date : { type: Date, validate: validateDate } + } + +function nopt (types, shorthands, args, slice) { + args = args || process.argv + types = types || {} + shorthands = shorthands || {} + if (typeof slice !== "number") slice = 2 + + debug(types, shorthands, args, slice) + + args = args.slice(slice) + var data = {} + , key + , remain = [] + , cooked = args + , original = args.slice(0) + + parse(args, data, remain, types, shorthands) + // now data is full + clean(data, types, exports.typeDefs) + data.argv = {remain:remain,cooked:cooked,original:original} + data.argv.toString = function () { + return this.original.map(JSON.stringify).join(" ") + } + return data +} + +function clean (data, types, typeDefs) { + typeDefs = typeDefs || exports.typeDefs + var remove = {} + , typeDefault = [false, true, null, String, Number] + + Object.keys(data).forEach(function (k) { + if (k === "argv") return + var val = data[k] + , isArray = Array.isArray(val) + , type = types[k] + if (!isArray) val = [val] + if (!type) type = typeDefault + if (type === Array) type = typeDefault.concat(Array) + if (!Array.isArray(type)) type = [type] + + debug("val=%j", val) + debug("types=", type) + val = val.map(function (val) { + // if it's an unknown value, then parse false/true/null/numbers/dates + if (typeof val === "string") { + debug("string %j", val) + val = val.trim() + if ((val === "null" && ~type.indexOf(null)) + || (val === "true" && + (~type.indexOf(true) || ~type.indexOf(Boolean))) + || (val === "false" && + (~type.indexOf(false) || ~type.indexOf(Boolean)))) { + val = JSON.parse(val) + debug("jsonable %j", val) + } else if (~type.indexOf(Number) && !isNaN(val)) { + debug("convert to number", val) + val = +val + } else if (~type.indexOf(Date) && !isNaN(Date.parse(val))) { + debug("convert to date", val) + val = new Date(val) + } + } + + if (!types.hasOwnProperty(k)) { + return val + } + + // allow `--no-blah` to set 'blah' to null if null is allowed + if (val === false && ~type.indexOf(null) && + !(~type.indexOf(false) || ~type.indexOf(Boolean))) { + val = null + } + + var d = {} + d[k] = val + debug("prevalidated val", d, val, types[k]) + if (!validate(d, k, val, types[k], typeDefs)) { + if (exports.invalidHandler) { + exports.invalidHandler(k, val, types[k], data) + } else if (exports.invalidHandler !== false) { + debug("invalid: "+k+"="+val, types[k]) + } + return remove + } + debug("validated val", d, val, types[k]) + return d[k] + }).filter(function (val) { return val !== remove }) + + if (!val.length) delete data[k] + else if (isArray) { + debug(isArray, data[k], val) + data[k] = val + } else data[k] = val[0] + + debug("k=%s val=%j", k, val, data[k]) + }) +} + +function validateString (data, k, val) { + data[k] = String(val) +} + +function validatePath (data, k, val) { + data[k] = path.resolve(String(val)) + return true +} + +function validateNumber (data, k, val) { + debug("validate Number %j %j %j", k, val, isNaN(val)) + if (isNaN(val)) return false + data[k] = +val +} + +function validateDate (data, k, val) { + debug("validate Date %j %j %j", k, val, Date.parse(val)) + var s = Date.parse(val) + if (isNaN(s)) return false + data[k] = new Date(val) +} + +function validateBoolean (data, k, val) { + if (val instanceof Boolean) val = val.valueOf() + else if (typeof val === "string") { + if (!isNaN(val)) val = !!(+val) + else if (val === "null" || val === "false") val = false + else val = true + } else val = !!val + data[k] = val +} + +function validateUrl (data, k, val) { + val = url.parse(String(val)) + if (!val.host) return false + data[k] = val.href +} + +function validateStream (data, k, val) { + if (!(val instanceof Stream)) return false + data[k] = val +} + +function validate (data, k, val, type, typeDefs) { + // arrays are lists of types. + if (Array.isArray(type)) { + for (var i = 0, l = type.length; i < l; i ++) { + if (type[i] === Array) continue + if (validate(data, k, val, type[i], typeDefs)) return true + } + delete data[k] + return false + } + + // an array of anything? + if (type === Array) return true + + // NaN is poisonous. Means that something is not allowed. + if (type !== type) { + debug("Poison NaN", k, val, type) + delete data[k] + return false + } + + // explicit list of values + if (val === type) { + debug("Explicitly allowed %j", val) + // if (isArray) (data[k] = data[k] || []).push(val) + // else data[k] = val + data[k] = val + return true + } + + // now go through the list of typeDefs, validate against each one. + var ok = false + , types = Object.keys(typeDefs) + for (var i = 0, l = types.length; i < l; i ++) { + debug("test type %j %j %j", k, val, types[i]) + var t = typeDefs[types[i]] + if (t && type === t.type) { + var d = {} + ok = false !== t.validate(d, k, val) + val = d[k] + if (ok) { + // if (isArray) (data[k] = data[k] || []).push(val) + // else data[k] = val + data[k] = val + break + } + } + } + debug("OK? %j (%j %j %j)", ok, k, val, types[i]) + + if (!ok) delete data[k] + return ok +} + +function parse (args, data, remain, types, shorthands) { + debug("parse", args, data, remain) + + var key = null + , abbrevs = abbrev(Object.keys(types)) + , shortAbbr = abbrev(Object.keys(shorthands)) + + for (var i = 0; i < args.length; i ++) { + var arg = args[i] + debug("arg", arg) + + if (arg.match(/^-{2,}$/)) { + // done with keys. + // the rest are args. + remain.push.apply(remain, args.slice(i + 1)) + args[i] = "--" + break + } + if (arg.charAt(0) === "-") { + if (arg.indexOf("=") !== -1) { + var v = arg.split("=") + arg = v.shift() + v = v.join("=") + args.splice.apply(args, [i, 1].concat([arg, v])) + } + // see if it's a shorthand + // if so, splice and back up to re-parse it. + var shRes = resolveShort(arg, shorthands, shortAbbr, abbrevs) + debug("arg=%j shRes=%j", arg, shRes) + if (shRes) { + debug(arg, shRes) + args.splice.apply(args, [i, 1].concat(shRes)) + if (arg !== shRes[0]) { + i -- + continue + } + } + arg = arg.replace(/^-+/, "") + var no = false + while (arg.toLowerCase().indexOf("no-") === 0) { + no = !no + arg = arg.substr(3) + } + + if (abbrevs[arg]) arg = abbrevs[arg] + + var isArray = types[arg] === Array || + Array.isArray(types[arg]) && types[arg].indexOf(Array) !== -1 + + var val + , la = args[i + 1] + + var isBool = no || + types[arg] === Boolean || + Array.isArray(types[arg]) && types[arg].indexOf(Boolean) !== -1 || + (la === "false" && + (types[arg] === null || + Array.isArray(types[arg]) && ~types[arg].indexOf(null))) + + if (isBool) { + // just set and move along + val = !no + // however, also support --bool true or --bool false + if (la === "true" || la === "false") { + val = JSON.parse(la) + la = null + if (no) val = !val + i ++ + } + + // also support "foo":[Boolean, "bar"] and "--foo bar" + if (Array.isArray(types[arg]) && la) { + if (~types[arg].indexOf(la)) { + // an explicit type + val = la + i ++ + } else if ( la === "null" && ~types[arg].indexOf(null) ) { + // null allowed + val = null + i ++ + } else if ( !la.match(/^-{2,}[^-]/) && + !isNaN(la) && + ~types[arg].indexOf(Number) ) { + // number + val = +la + i ++ + } else if ( !la.match(/^-[^-]/) && ~types[arg].indexOf(String) ) { + // string + val = la + i ++ + } + } + + if (isArray) (data[arg] = data[arg] || []).push(val) + else data[arg] = val + + continue + } + + if (la && la.match(/^-{2,}$/)) { + la = undefined + i -- + } + + val = la === undefined ? true : la + if (isArray) (data[arg] = data[arg] || []).push(val) + else data[arg] = val + + i ++ + continue + } + remain.push(arg) + } +} + +function resolveShort (arg, shorthands, shortAbbr, abbrevs) { + // handle single-char shorthands glommed together, like + // npm ls -glp, but only if there is one dash, and only if + // all of the chars are single-char shorthands, and it's + // not a match to some other abbrev. + arg = arg.replace(/^-+/, '') + if (abbrevs[arg] && !shorthands[arg]) { + return null + } + if (shortAbbr[arg]) { + arg = shortAbbr[arg] + } else { + var singles = shorthands.___singles + if (!singles) { + singles = Object.keys(shorthands).filter(function (s) { + return s.length === 1 + }).reduce(function (l,r) { l[r] = true ; return l }, {}) + shorthands.___singles = singles + } + var chrs = arg.split("").filter(function (c) { + return singles[c] + }) + if (chrs.join("") === arg) return chrs.map(function (c) { + return shorthands[c] + }).reduce(function (l, r) { + return l.concat(r) + }, []) + } + + if (shorthands[arg] && !Array.isArray(shorthands[arg])) { + shorthands[arg] = shorthands[arg].split(/\s+/) + } + return shorthands[arg] +} + +if (module === require.main) { +var assert = require("assert") + , util = require("util") + + , shorthands = + { s : ["--loglevel", "silent"] + , d : ["--loglevel", "info"] + , dd : ["--loglevel", "verbose"] + , ddd : ["--loglevel", "silly"] + , noreg : ["--no-registry"] + , reg : ["--registry"] + , "no-reg" : ["--no-registry"] + , silent : ["--loglevel", "silent"] + , verbose : ["--loglevel", "verbose"] + , h : ["--usage"] + , H : ["--usage"] + , "?" : ["--usage"] + , help : ["--usage"] + , v : ["--version"] + , f : ["--force"] + , desc : ["--description"] + , "no-desc" : ["--no-description"] + , "local" : ["--no-global"] + , l : ["--long"] + , p : ["--parseable"] + , porcelain : ["--parseable"] + , g : ["--global"] + } + + , types = + { aoa: Array + , nullstream: [null, Stream] + , date: Date + , str: String + , browser : String + , cache : path + , color : ["always", Boolean] + , depth : Number + , description : Boolean + , dev : Boolean + , editor : path + , force : Boolean + , global : Boolean + , globalconfig : path + , group : [String, Number] + , gzipbin : String + , logfd : [Number, Stream] + , loglevel : ["silent","win","error","warn","info","verbose","silly"] + , long : Boolean + , "node-version" : [false, String] + , npaturl : url + , npat : Boolean + , "onload-script" : [false, String] + , outfd : [Number, Stream] + , parseable : Boolean + , pre: Boolean + , prefix: path + , proxy : url + , "rebuild-bundle" : Boolean + , registry : url + , searchopts : String + , searchexclude: [null, String] + , shell : path + , t: [Array, String] + , tag : String + , tar : String + , tmp : path + , "unsafe-perm" : Boolean + , usage : Boolean + , user : String + , username : String + , userconfig : path + , version : Boolean + , viewer: path + , _exit : Boolean + } + +; [["-v", {version:true}, []] + ,["---v", {version:true}, []] + ,["ls -s --no-reg connect -d", + {loglevel:"info",registry:null},["ls","connect"]] + ,["ls ---s foo",{loglevel:"silent"},["ls","foo"]] + ,["ls --registry blargle", {}, ["ls"]] + ,["--no-registry", {registry:null}, []] + ,["--no-color true", {color:false}, []] + ,["--no-color false", {color:true}, []] + ,["--no-color", {color:false}, []] + ,["--color false", {color:false}, []] + ,["--color --logfd 7", {logfd:7,color:true}, []] + ,["--color=true", {color:true}, []] + ,["--logfd=10", {logfd:10}, []] + ,["--tmp=/tmp -tar=gtar",{tmp:"/tmp",tar:"gtar"},[]] + ,["--tmp=tmp -tar=gtar", + {tmp:path.resolve(process.cwd(), "tmp"),tar:"gtar"},[]] + ,["--logfd x", {}, []] + ,["a -true -- -no-false", {true:true},["a","-no-false"]] + ,["a -no-false", {false:false},["a"]] + ,["a -no-no-true", {true:true}, ["a"]] + ,["a -no-no-no-false", {false:false}, ["a"]] + ,["---NO-no-No-no-no-no-nO-no-no"+ + "-No-no-no-no-no-no-no-no-no"+ + "-no-no-no-no-NO-NO-no-no-no-no-no-no"+ + "-no-body-can-do-the-boogaloo-like-I-do" + ,{"body-can-do-the-boogaloo-like-I-do":false}, []] + ,["we are -no-strangers-to-love "+ + "--you-know the-rules --and so-do-i "+ + "---im-thinking-of=a-full-commitment "+ + "--no-you-would-get-this-from-any-other-guy "+ + "--no-gonna-give-you-up "+ + "-no-gonna-let-you-down=true "+ + "--no-no-gonna-run-around false "+ + "--desert-you=false "+ + "--make-you-cry false "+ + "--no-tell-a-lie "+ + "--no-no-and-hurt-you false" + ,{"strangers-to-love":false + ,"you-know":"the-rules" + ,"and":"so-do-i" + ,"you-would-get-this-from-any-other-guy":false + ,"gonna-give-you-up":false + ,"gonna-let-you-down":false + ,"gonna-run-around":false + ,"desert-you":false + ,"make-you-cry":false + ,"tell-a-lie":false + ,"and-hurt-you":false + },["we", "are"]] + ,["-t one -t two -t three" + ,{t: ["one", "two", "three"]} + ,[]] + ,["-t one -t null -t three four five null" + ,{t: ["one", "null", "three"]} + ,["four", "five", "null"]] + ,["-t foo" + ,{t:["foo"]} + ,[]] + ,["--no-t" + ,{t:["false"]} + ,[]] + ,["-no-no-t" + ,{t:["true"]} + ,[]] + ,["-aoa one -aoa null -aoa 100" + ,{aoa:["one", null, 100]} + ,[]] + ,["-str 100" + ,{str:"100"} + ,[]] + ,["--color always" + ,{color:"always"} + ,[]] + ,["--no-nullstream" + ,{nullstream:null} + ,[]] + ,["--nullstream false" + ,{nullstream:null} + ,[]] + ,["--notadate 2011-01-25" + ,{notadate: "2011-01-25"} + ,[]] + ,["--date 2011-01-25" + ,{date: new Date("2011-01-25")} + ,[]] + ].forEach(function (test) { + var argv = test[0].split(/\s+/) + , opts = test[1] + , rem = test[2] + , actual = nopt(types, shorthands, argv, 0) + , parsed = actual.argv + delete actual.argv + console.log(util.inspect(actual, false, 2, true), parsed.remain) + for (var i in opts) { + var e = JSON.stringify(opts[i]) + , a = JSON.stringify(actual[i] === undefined ? null : actual[i]) + if (e && typeof e === "object") { + assert.deepEqual(e, a) + } else { + assert.equal(e, a) + } + } + assert.deepEqual(rem, parsed.remain) + }) +} diff --git a/build-tools/lib/jslint/reporter.js b/build-tools/lib/jslint/reporter.js new file mode 100644 index 0000000..f95c8bd --- /dev/null +++ b/build-tools/lib/jslint/reporter.js @@ -0,0 +1,41 @@ +/*jslint forin: true */ + +var color = require("./color"); +var log = console.log; + +exports.report = function (file, lint, colorize) { + 'use strict'; + + var options = [], key, value, line, + i, len, pad, e, fileMessage; + + for (key in lint.options) { + value = lint.options[key]; + options.push(key + ": " + value); + } + + fileMessage = "\n" + ((colorize) ? color.bold(file) : file); + + if (!lint.ok) { + log(fileMessage); + len = lint.errors.length; + for (i = 0; i < len; i += 1) { + pad = "#" + String(i + 1); + while (pad.length < 3) { + pad = ' ' + pad; + } + e = lint.errors[i]; + if (e) { + line = ' // Line ' + e.line + ', Pos ' + e.character; + + log(pad + ' ' + ((colorize) ? color.yellow(e.reason) : e.reason)); + log(' ' + (e.evidence || '').replace(/^\s+|\s+$/, "") + + ((colorize) ? color.grey(line) : line)); + } + } + } else { + log(fileMessage + " is " + ((colorize) ? color.green('OK') : 'OK') + "."); + } + + return lint.ok; +}; diff --git a/build-tools/lib/less/LICENSE b/build-tools/lib/less/LICENSE new file mode 100644 index 0000000..40f3b78 --- /dev/null +++ b/build-tools/lib/less/LICENSE @@ -0,0 +1,179 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +Copyright (c) 2009-2010 Alexis Sellier diff --git a/build-tools/lib/less/browser.js b/build-tools/lib/less/browser.js new file mode 100644 index 0000000..cba4c3b --- /dev/null +++ b/build-tools/lib/less/browser.js @@ -0,0 +1,375 @@ +// +// browser.js - client-side engine +// + +var isFileProtocol = (location.protocol === 'file:' || + location.protocol === 'chrome:' || + location.protocol === 'chrome-extension:' || + location.protocol === 'resource:'); + +less.env = less.env || (location.hostname == '127.0.0.1' || + location.hostname == '0.0.0.0' || + location.hostname == 'localhost' || + location.port.length > 0 || + isFileProtocol ? 'development' + : 'production'); + +// Load styles asynchronously (default: false) +// +// This is set to `false` by default, so that the body +// doesn't start loading before the stylesheets are parsed. +// Setting this to `true` can result in flickering. +// +less.async = false; + +// Interval between watch polls +less.poll = less.poll || (isFileProtocol ? 1000 : 1500); + +// +// Watch mode +// +less.watch = function () { return this.watchMode = true }; +less.unwatch = function () { return this.watchMode = false }; + +if (less.env === 'development') { + less.optimization = 0; + + 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; +} + +var cache; + +try { + cache = (typeof(window.localStorage) === 'undefined') ? null : window.localStorage; +} catch (_) { + cache = null; +} + +// +// Get all tags with the 'rel' attribute set to "stylesheet/less" +// +var links = document.getElementsByTagName('link'); +var typePattern = /^text\/(x-)?less$/; + +less.sheets = []; + +for (var i = 0; i < links.length; i++) { + if (links[i].rel === 'stylesheet/less' || (links[i].rel.match(/stylesheet/) && + (links[i].type.match(typePattern)))) { + less.sheets.push(links[i]); + } +} + + +less.refresh = function (reload) { + var startTime, endTime; + startTime = endTime = new(Date); + + loadStyleSheets(function (root, sheet, env) { + if (env.local) { + log("loading " + sheet.href + " from cache."); + } else { + log("parsed " + sheet.href + " successfully."); + createCSS(root.toCSS(), sheet, env.lastModified); + } + log("css for " + sheet.href + " generated in " + (new(Date) - endTime) + 'ms'); + (env.remaining === 0) && log("css generated in " + (new(Date) - startTime) + 'ms'); + endTime = new(Date); + }, reload); + + loadStyles(); +}; +less.refreshStyles = loadStyles; + +less.refresh(less.env === 'development'); + +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) { + var css = tree.toCSS(); + var style = styles[i]; + try { + style.innerHTML = css; + } catch (_) { + style.styleSheets.cssText = css; + } + style.type = 'text/css'; + }); + } + } +} + +function loadStyleSheets(callback, reload) { + for (var i = 0; i < less.sheets.length; i++) { + loadStyleSheet(less.sheets[i], callback, reload, less.sheets.length - (i + 1)); + } +} + +function loadStyleSheet(sheet, callback, reload, remaining) { + var url = window.location.href.replace(/[#?].*$/, ''); + var href = sheet.href.replace(/\?.*$/, ''); + var css = cache && cache.getItem(href); + var timestamp = cache && cache.getItem(href + ':timestamp'); + var styles = { css: css, timestamp: timestamp }; + + // 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; + } else { + href = url.slice(0, url.lastIndexOf('/') + 1) + href; + } + } + + xhr(sheet.href, sheet.type, function (data, lastModified) { + 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 }); + } else { + // Use remote copy (re-parse) + try { + new(less.Parser)({ + optimization: less.optimization, + paths: [href.replace(/[\w\.-]+$/, '')], + mime: sheet.type + }).parse(data, function (e, root) { + if (e) { return error(e, href) } + try { + callback(root, sheet, { local: false, lastModified: lastModified, remaining: remaining }); + removeNode(document.getElementById('less-error-message:' + extractId(href))); + } catch (e) { + error(e, href); + } + }); + } catch (e) { + error(e, href); + } + } + }, function (status, url) { + throw new(Error)("Couldn't load " + url + " (" + status + ")"); + }); +} + +function extractId(href) { + return href.replace(/^[a-z]+:\/\/?[^\/]+/, '' ) // Remove protocol & domain + .replace(/^\//, '' ) // Remove root / + .replace(/\?.*$/, '' ) // Remove query + .replace(/\.[^\.\/]+$/, '' ) // Remove file extension + .replace(/[^\.\w-]+/g, '-') // Replace illegal characters + .replace(/\./g, ':'); // Replace dots with colons(for valid id) +} + +function createCSS(styles, sheet, lastModified) { + var css; + + // Strip the query-string + var href = sheet.href ? sheet.href.replace(/\?.*$/, '') : ''; + + // If there is no title set, use the filename, minus the extension + var id = 'less:' + (sheet.title || extractId(href)); + + // If the stylesheet doesn't exist, create a new node + if ((css = document.getElementById(id)) === null) { + css = document.createElement('style'); + css.type = 'text/css'; + css.media = sheet.media || 'screen'; + css.id = id; + document.getElementsByTagName('head')[0].appendChild(css); + } + + if (css.styleSheet) { // IE + try { + css.styleSheet.cssText = styles; + } catch (e) { + throw new(Error)("Couldn't reassign styleSheet.cssText."); + } + } else { + (function (node) { + if (css.childNodes.length > 0) { + if (css.firstChild.nodeValue !== node.nodeValue) { + css.replaceChild(node, css.firstChild); + } + } else { + css.appendChild(node); + } + })(document.createTextNode(styles)); + } + + // 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); + } +} + +function xhr(url, type, callback, errback) { + var xhr = getXMLHttpRequest(); + var async = isFileProtocol ? false : less.async; + + if (typeof(xhr.overrideMimeType) === 'function') { + xhr.overrideMimeType('text/css'); + } + xhr.open('GET', url, async); + xhr.setRequestHeader('Accept', type || 'text/x-less, text/css; q=0.9, */*; q=0.5'); + xhr.send(null); + + if (isFileProtocol) { + if (xhr.status === 0) { + callback(xhr.responseText); + } else { + errback(xhr.status, url); + } + } else if (async) { + xhr.onreadystatechange = function () { + if (xhr.readyState == 4) { + handleResponse(xhr, callback, errback); + } + }; + } else { + handleResponse(xhr, callback, errback); + } + + function handleResponse(xhr, callback, errback) { + if (xhr.status >= 200 && xhr.status < 300) { + callback(xhr.responseText, + xhr.getResponseHeader("Last-Modified")); + } else if (typeof(errback) === 'function') { + errback(xhr.status, url); + } + } +} + +function getXMLHttpRequest() { + if (window.XMLHttpRequest) { + return new(XMLHttpRequest); + } else { + try { + return new(ActiveXObject)("MSXML2.XMLHTTP.3.0"); + } catch (e) { + log("browser doesn't support AJAX."); + return null; + } + } +} + +function removeNode(node) { + return node && node.parentNode.removeChild(node); +} + +function log(str) { + if (less.env == 'development' && typeof(console) !== "undefined") { console.log('less: ' + str) } +} + +function error(e, href) { + var id = 'less-error-message:' + extractId(href); + + var template = ['
      ', + '
    • {0}
    • ', + '
    • {current}
    • ', + '
    • {2}
    • ', + '
    '].join('\n'); + + var elem = document.createElement('div'), timer, content; + + elem.id = id; + elem.className = "less-error-message"; + + content = '

    ' + (e.message || 'There is an error in your .less file') + + '

    ' + '

    ' + href + " "; + + if (e.extract) { + content += 'on line ' + e.line + ', column ' + (e.column + 1) + ':

    ' + + 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) + '' + + e.extract[1].slice(e.column) + ''); + } + elem.innerHTML = content; + + // CSS for error messages + createCSS([ + '.less-error-message ul, .less-error-message li {', + 'list-style-type: none;', + 'margin-right: 15px;', + 'padding: 4px 0;', + 'margin: 0;', + '}', + '.less-error-message label {', + 'font-size: 12px;', + 'margin-right: 15px;', + 'padding: 4px 0;', + 'color: #cc7777;', + '}', + '.less-error-message pre {', + 'color: #ee4444;', + 'padding: 4px 0;', + 'margin: 0;', + 'display: inline-block;', + '}', + '.less-error-message pre.ctx {', + 'color: #dd4444;', + '}', + '.less-error-message h3 {', + 'font-size: 20px;', + 'font-weight: bold;', + 'padding: 15px 0 5px 0;', + 'margin: 0;', + '}', + '.less-error-message a {', + 'color: #10a', + '}', + '.less-error-message .error {', + 'color: red;', + 'font-weight: bold;', + 'padding-bottom: 2px;', + 'border-bottom: 1px dashed red;', + '}' + ].join('\n'), { title: 'error-message' }); + + elem.style.cssText = [ + "font-family: Arial, sans-serif", + "border: 1px solid #e00", + "background-color: #eee", + "border-radius: 5px", + "-webkit-border-radius: 5px", + "-moz-border-radius: 5px", + "color: #e00", + "padding: 15px", + "margin-bottom: 15px" + ].join(';'); + + if (less.env == 'development') { + timer = setInterval(function () { + if (document.body) { + if (document.getElementById(id)) { + document.body.replaceChild(elem, document.getElementById(id)); + } else { + document.body.insertBefore(elem, document.body.firstChild); + } + clearInterval(timer); + } + }, 10); + } +} + diff --git a/build-tools/lib/less/functions.js b/build-tools/lib/less/functions.js new file mode 100644 index 0000000..fc9d86f --- /dev/null +++ b/build-tools/lib/less/functions.js @@ -0,0 +1,185 @@ +(function (tree) { + +tree.functions = { + rgb: function (r, g, b) { + 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); + return new(tree.Color)(rgb, a); + }, + hsl: function (h, s, l) { + return this.hsla(h, s, l, 1.0); + }, + hsla: function (h, s, l, a) { + h = (number(h) % 360) / 360; + s = number(s); l = number(l); a = number(a); + + var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s; + var m1 = l * 2 - m2; + + return this.rgba(hue(h + 1/3) * 255, + hue(h) * 255, + hue(h - 1/3) * 255, + a); + + function hue(h) { + h = h < 0 ? h + 1 : (h > 1 ? h - 1 : h); + if (h * 6 < 1) return m1 + (m2 - m1) * h * 6; + else if (h * 2 < 1) return m2; + else if (h * 3 < 2) return m1 + (m2 - m1) * (2/3 - h) * 6; + else return m1; + } + }, + hue: function (color) { + return new(tree.Dimension)(Math.round(color.toHSL().h)); + }, + saturation: function (color) { + return new(tree.Dimension)(Math.round(color.toHSL().s * 100), '%'); + }, + lightness: function (color) { + return new(tree.Dimension)(Math.round(color.toHSL().l * 100), '%'); + }, + alpha: function (color) { + return new(tree.Dimension)(color.toHSL().a); + }, + saturate: function (color, amount) { + var hsl = color.toHSL(); + + hsl.s += amount.value / 100; + hsl.s = clamp(hsl.s); + return hsla(hsl); + }, + desaturate: function (color, amount) { + var hsl = color.toHSL(); + + hsl.s -= amount.value / 100; + hsl.s = clamp(hsl.s); + return hsla(hsl); + }, + lighten: function (color, amount) { + var hsl = color.toHSL(); + + hsl.l += amount.value / 100; + hsl.l = clamp(hsl.l); + return hsla(hsl); + }, + darken: function (color, amount) { + var hsl = color.toHSL(); + + hsl.l -= amount.value / 100; + hsl.l = clamp(hsl.l); + return hsla(hsl); + }, + fadein: function (color, amount) { + var hsl = color.toHSL(); + + hsl.a += amount.value / 100; + hsl.a = clamp(hsl.a); + return hsla(hsl); + }, + fadeout: function (color, amount) { + var hsl = color.toHSL(); + + hsl.a -= amount.value / 100; + hsl.a = clamp(hsl.a); + return hsla(hsl); + }, + fade: function (color, amount) { + var hsl = color.toHSL(); + + hsl.a = amount.value / 100; + hsl.a = clamp(hsl.a); + return hsla(hsl); + }, + spin: function (color, amount) { + var hsl = color.toHSL(); + var hue = (hsl.h + amount.value) % 360; + + hsl.h = hue < 0 ? 360 + hue : hue; + + return hsla(hsl); + }, + // + // Copyright (c) 2006-2009 Hampton Catlin, Nathan Weizenbaum, and Chris Eppstein + // http://sass-lang.com + // + mix: function (color1, color2, weight) { + var p = weight.value / 100.0; + var w = p * 2 - 1; + var a = color1.toHSL().a - color2.toHSL().a; + + var w1 = (((w * a == -1) ? w : (w + a) / (1 + w * a)) + 1) / 2.0; + var w2 = 1 - w1; + + var rgb = [color1.rgb[0] * w1 + color2.rgb[0] * w2, + color1.rgb[1] * w1 + color2.rgb[1] * w2, + color1.rgb[2] * w1 + color2.rgb[2] * w2]; + + var alpha = color1.alpha * p + color2.alpha * (1 - p); + + return new(tree.Color)(rgb, alpha); + }, + greyscale: function (color) { + return this.desaturate(color, new(tree.Dimension)(100)); + }, + e: function (str) { + return new(tree.Anonymous)(str instanceof tree.JavaScript ? str.evaluated : str); + }, + escape: function (str) { + return new(tree.Anonymous)(encodeURI(str.value).replace(/=/g, "%3D").replace(/:/g, "%3A").replace(/#/g, "%23").replace(/;/g, "%3B").replace(/\(/g, "%28").replace(/\)/g, "%29")); + }, + '%': function (quoted /* arg, arg, ...*/) { + var args = Array.prototype.slice.call(arguments, 1), + str = quoted.value; + + for (var i = 0; i < args.length; i++) { + str = str.replace(/%[sda]/i, function(token) { + var value = token.match(/s/i) ? args[i].value : args[i].toCSS(); + return token.match(/[A-Z]$/) ? encodeURIComponent(value) : value; + }); + } + str = str.replace(/%%/g, '%'); + return new(tree.Quoted)('"' + str + '"', str); + }, + round: function (n) { + if (n instanceof tree.Dimension) { + return new(tree.Dimension)(Math.round(number(n)), n.unit); + } else if (typeof(n) === 'number') { + return Math.round(n); + } else { + throw { + error: "RuntimeError", + message: "math functions take numbers as parameters" + }; + } + }, + argb: function (color) { + return new(tree.Anonymous)(color.toARGB()); + + } +}; + +function hsla(hsla) { + return tree.functions.hsla(hsla.h, hsla.s, hsla.l, hsla.a); +} + +function number(n) { + if (n instanceof tree.Dimension) { + return parseFloat(n.unit == '%' ? n.value / 100 : n.value); + } else if (typeof(n) === 'number') { + return n; + } else { + throw { + error: "RuntimeError", + message: "color functions take numbers as parameters" + }; + } +} + +function clamp(val) { + return Math.min(1, Math.max(0, val)); +} + +})(require('less/tree')); diff --git a/build-tools/lib/less/index.js b/build-tools/lib/less/index.js new file mode 100644 index 0000000..3b4e928 --- /dev/null +++ b/build-tools/lib/less/index.js @@ -0,0 +1,143 @@ +var path = require('path'), + sys = require('sys'), + 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'), + render: function (input, options, callback) { + options = options || {}; + + if (typeof(options) === 'function') { + callback = options, options = {}; + } + + var parser = new(this.Parser)(options), + ee; + + if (callback) { + parser.parse(input, function (e, root) { + callback(e, root.toCSS(options)); + }); + } else { + ee = new(require('events').EventEmitter); + + process.nextTick(function () { + parser.parse(input, function (e, root) { + if (e) { ee.emit('error', e) } + else { ee.emit('success', root.toCSS(options)) } + }); + }); + return ee; + } + }, + writeError: function (ctx, options) { + var message = ""; + var extract = ctx.extract; + var error = []; + var stylize = options.color ? less.stylize : function (str) { return str }; + + options = options || {}; + + if (options.silent) { return } + + if (!ctx.index) { + return sys.error(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 (typeof(extract[2]) === 'string') { + error.push(stylize((ctx.line + 1) + ' ' + extract[2], 'grey')); + } + error = error.join('\n') + '\033[0m\n'; + + message += stylize(ctx.message, 'red'); + ctx.filename && (message += stylize(' in ', 'red') + ctx.filename); + + sys.error(message, error); + + if (ctx.callLine) { + sys.error(stylize('from ', 'red') + (ctx.filename || '')); + sys.error(stylize(ctx.callLine, 'grey') + ' ' + ctx.callExtract); + } + if (ctx.stack) { sys.error(stylize(ctx.stack, 'red')) } + } +}; + +['color', 'directive', 'operation', 'dimension', + 'keyword', 'variable', 'ruleset', 'element', + 'selector', 'quoted', 'expression', 'rule', + 'call', 'url', 'alpha', 'import', + 'mixin', 'comment', 'anonymous', 'value', 'javascript' +].forEach(function (n) { + require(path.join('less', 'tree', n)); +}); + +less.Parser.importer = function (file, paths, callback) { + var pathname; + + paths.unshift('.'); + + for (var i = 0; i < paths.length; i++) { + try { + pathname = path.join(paths[i], file); + fs.statSync(pathname); + break; + } catch (e) { + pathname = null; + } + } + + 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); + }); + }); + } else { + sys.error("file '" + file + "' wasn't found.\n"); + process.exit(1); + } +} + +require('less/functions'); + +for (var k in less) { exports[k] = less[k] } + +// 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'; +} +less.stylize = stylize; + diff --git a/build-tools/lib/less/parser.js b/build-tools/lib/less/parser.js new file mode 100644 index 0000000..fae248e --- /dev/null +++ b/build-tools/lib/less/parser.js @@ -0,0 +1,1115 @@ +var less, tree; + +if (typeof environment === "object" && ({}).toString.call(environment) === "[object Environment]") { + // Rhino + // Details on how to detect Rhino: https://github.com/ringo/ringojs/issues/88 + less = {}; + tree = less.tree = {}; + less.mode = 'rhino'; +} else if (typeof(window) === 'undefined') { + // Node.js + less = exports, + tree = require('less/tree'); + less.mode = 'rhino'; +} else { + // Browser + if (typeof(window.less) === 'undefined') { window.less = {} } + less = window.less, + tree = window.less.tree = {}; + less.mode = 'browser'; +} +// +// less.js - parser +// +// A relatively straight-forward predictive parser. +// There is no tokenization/lexing stage, the input is parsed +// in one sweep. +// +// To make the parser fast enough to run in the browser, several +// optimization had to be made: +// +// - Matching and slicing on a huge input is often cause of slowdowns. +// The solution is to chunkify the input into smaller strings. +// The chunks are stored in the `chunks` var, +// `j` holds the current chunk index, and `current` holds +// the index of the current chunk in relation to `input`. +// This gives us an almost 4x speed-up. +// +// - In many cases, we don't need to match individual tokens; +// for example, if a value doesn't hold any variables, operations +// or dynamic references, the parser can effectively 'skip' it, +// treating it as a literal. +// An example would be '1px solid #000' - which evaluates to itself, +// we don't need to know what the individual components are. +// The drawback, of course is that you don't get the benefits of +// syntax-checking on the CSS. This gives us a 50% speed-up in the parser, +// and a smaller speed-up in the code-gen. +// +// +// Token matching is done with the `$` function, which either takes +// a terminal string or regexp, or a non-terminal function to call. +// It also takes care of moving all the indices forwards. +// +// +less.Parser = function Parser(env) { + var input, // LeSS input string + i, // current index in `input` + j, // current chunk + temp, // temporarily holds a chunk's state, for backtracking + memo, // temporarily holds `i`, when backtracking + furthest, // furthest index the parser has gone to + chunks, // chunkified input + current, // index of current chunk, in `input` + parser; + + var that = this; + + // 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 + push: function (path, callback) { + var that = this; + this.queue.push(path); + + // + // Import a file asynchronously + // + less.Parser.importer(path, this.paths, function (root) { + that.queue.splice(that.queue.indexOf(path), 1); // Remove the path from the queue + that.files[path] = root; // Store the root + + callback(root); + + if (that.queue.length === 0) { finish() } // Call `finish` if we're done importing + }, env); + } + }; + + function save() { temp = chunks[j], memo = i, current = i } + function restore() { chunks[j] = temp, i = memo, current = i } + + function sync() { + if (i > current) { + chunks[j] = chunks[j].slice(i - current); + current = i; + } + } + // + // Parse from a token, regexp or string, and move forward if match + // + function $(tok) { + var match, args, length, c, index, endIndex, k, mem; + + // + // Non-terminal + // + if (tok instanceof Function) { + return tok.call(parser.parsers); + // + // Terminal + // + // Either match a single character in the input, + // or match a regexp in the current chunk (chunk[j]). + // + } else if (typeof(tok) === 'string') { + match = input.charAt(i) === tok ? tok : null; + length = 1; + sync (); + } else { + sync (); + + if (match = tok.exec(chunks[j])) { + length = match[0].length; + } else { + return null; + } + } + + // The match is confirmed, add the match length to `i`, + // and consume any extra white-space characters (' ' || '\n') + // which come after that. The reason for this is that LeSS's + // 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++ } + + if(typeof(match) === 'string') { + return match; + } else { + return match.length === 1 ? match[0] : match; + } + } + } + + // Same as $(), but don't change the state of the parser, + // just return the match. + function peek(tok) { + if (typeof(tok) === 'string') { + return input.charAt(i) === tok; + } else { + if (tok.test(chunks[j])) { + return true; + } else { + return false; + } + } + } + + this.env = env = env || {}; + + // The optimization level dictates the thoroughness of the parser, + // the lower the number, the less nodes it will create in the tree. + // This could matter for debugging, or if you want to access + // the individual nodes in the tree. + this.optimization = ('optimization' in this.env) ? this.env.optimization : 1; + + this.env.filename = this.env.filename || null; + + // + // The Parser + // + return parser = { + + imports: imports, + // + // Parse an input string into an abstract syntax tree, + // call `callback` when done. + // + parse: function (str, callback) { + var root, start, end, zone, line, lines, buff = [], c, error = null; + + i = j = current = furthest = 0; + chunks = []; + input = str.replace(/\r\n/g, '\n'); + + // Split the input into chunks. + chunks = (function (chunks) { + var j = 0, + skip = /[^"'`\{\}\/\(\)]+/g, + comment = /\/\*(?:[^*]|\*+[^\/*])*\*+\/|\/\/.*/g, + level = 0, + match, + chunk = chunks[0], + inParam, + inString; + + for (var i = 0, c, cc; i < input.length; i++) { + skip.lastIndex = i; + if (match = skip.exec(input)) { + if (match.index === i) { + i += match[0].length; + chunk.push(match[0]); + } + } + c = input.charAt(i); + comment.lastIndex = i; + + if (!inString && !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); + } + } + } + } + + 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); + } + } + if (level > 0) { + throw { + type: 'Syntax', + message: "Missing closing `}`", + filename: env.filename + }; + } + + return chunks.map(function (c) { return c.join('') });; + })([[]]); + + // 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; + + root.toCSS = (function (evaluate) { + var line, lines, column; + + return function (options, variables) { + var frames = []; + + options = options || {}; + // + // Allows setting variables with a hash, so: + // + // `{ color: new(tree.Color)('#f01') }` will become: + // + // new(tree.Rule)('@color', + // new(tree.Value)([ + // new(tree.Expression)([ + // new(tree.Color)('#f01') + // ]) + // ]) + // ) + // + if (typeof(variables) === 'object' && !Array.isArray(variables)) { + variables = Object.keys(variables).map(function (k) { + var value = variables[k]; + + if (! (value instanceof tree.Value)) { + if (! (value instanceof tree.Expression)) { + value = new(tree.Expression)([value]); + } + value = new(tree.Value)([value]); + } + return new(tree.Rule)('@' + k, value, false, 0); + }); + frames = [new(tree.Ruleset)(null, variables)]; + } + + try { + var css = evaluate.call(this, { frames: frames }) + .toCSS([], { compress: options.compress || false }); + } 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] + ] + }; + } + 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); + + // If `i` is smaller than the `input.length - 1`, + // it means the parser wasn't able to parse the whole + // string, so we've got a parsing error. + // + // We try to extract a \n delimited string, + // showing the line where the parse error occured. + // We split it up into two parts (the part which parsed, + // and the part which didn't), so we can color them differently. + if (i < input.length - 1) { + i = furthest; + lines = input.split('\n'); + line = (input.slice(0, i).match(/\n/g) || "").length + 1; + + for (var n = i, column = -1; n >= 0 && input.charAt(n) !== '\n'; n--) { column++ } + + error = { + name: "ParseError", + message: "Syntax Error on line " + line, + index: i, + filename: env.filename, + line: line, + column: column, + extract: [ + lines[line - 2], + lines[line - 1], + lines[line] + ] + }; + } + + if (this.imports.queue.length > 0) { + finish = function () { callback(error, root) }; + } else { + callback(error, root); + } + }, + + // + // Here in, the parsing rules/functions + // + // The basic structure of the syntax tree generated is as follows: + // + // Ruleset -> Rule -> Value -> Expression -> Entity + // + // Here's some LESS code: + // + // .class { + // color: #fff; + // border: 1px solid #000; + // width: @w + 4px; + // > .child {...} + // } + // + // And here's what the parse tree might look like: + // + // Ruleset (Selector '.class', [ + // Rule ("color", Value ([Expression [Color #fff]])) + // Rule ("border", Value ([Expression [Dimension 1px][Keyword "solid"][Color #000]])) + // Rule ("width", Value ([Expression [Operation "+" [Variable "@w"][Dimension 4px]]])) + // Ruleset (Selector [Element '>', '.child'], [...]) + // ]) + // + // In general, most rules will try to parse a token with the `$()` function, and if the return + // value is truly, will return a new node, of the relevant type. Sometimes, we need to check + // first, before parsing, that's when we use `peek()`. + // + parsers: { + // + // The `primary` rule is the *entry* and *exit* point of the parser. + // The rules here can appear at any level of the parse tree. + // + // The recursive nature of the grammar is an interplay between the `block` + // rule, which represents `{ ... }`, the `ruleset` rule, and this `primary` rule, + // as represented by this simplified grammar: + // + // primary → (ruleset | rule)+ + // ruleset → selector+ block + // block → '{' primary '}' + // + // Only at one point is the primary rule not called from the + // block rule: at the root level. + // + primary: function () { + var node, root = []; + + while ((node = $(this.mixin.definition) || $(this.rule) || $(this.ruleset) || + $(this.mixin.call) || $(this.comment) || $(this.directive)) + || $(/^[\s\n]+/)) { + node && root.push(node); + } + return root; + }, + + // We create a Comment node for CSS comments `/* */`, + // but keep the LeSS comments `//` silent, by just skipping + // over them. + comment: function () { + var comment; + + if (input.charAt(i) !== '/') return; + + if (input.charAt(i + 1) === '/') { + return new(tree.Comment)($(/^\/\/.*/), true); + } else if (comment = $(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/)) { + return new(tree.Comment)(comment); + } + }, + + // + // Entities are tokens which can be found inside an Expression + // + entities: { + // + // A string, which supports escaping " and ' + // + // "milky way" 'he\'s the one!' + // + quoted: function () { + var str, j = i, e; + + if (input.charAt(j) === '~') { j++, e = true } // Escaped strings + if (input.charAt(j) !== '"' && input.charAt(j) !== "'") return; + + e && $('~'); + + if (str = $(/^"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/)) { + return new(tree.Quoted)(str[0], str[1] || str[2], e); + } + }, + + // + // A catch-all word, such as: + // + // black border-collapse + // + keyword: function () { + var k; + if (k = $(/^[_A-Za-z-][_A-Za-z0-9-]*/)) { return new(tree.Keyword)(k) } + }, + + // + // A function call + // + // rgb(255, 0, 255) + // + // We also try to catch IE's `alpha()`, but let the `alpha` parser + // deal with the details. + // + // The arguments are parsed with the `entities.arguments` parser. + // + call: function () { + var name, args, index = i; + + if (! (name = /^([\w-]+|%)\(/.exec(chunks[j]))) return; + + name = name[1].toLowerCase(); + + if (name === 'url') { return null } + else { i += name.length } + + if (name === 'alpha') { return $(this.alpha) } + + $('('); // Parse the '(' and consume whitespace. + + args = $(this.entities.arguments); + + if (! $(')')) return; + + if (name) { return new(tree.Call)(name, args, index) } + }, + arguments: function () { + var args = [], arg; + + while (arg = $(this.expression)) { + args.push(arg); + if (! $(',')) { break } + } + return args; + }, + literal: function () { + return $(this.entities.dimension) || + $(this.entities.color) || + $(this.entities.quoted); + }, + + // + // Parse url() tokens + // + // We use a specific rule for urls, because they don't really behave like + // standard function calls. The difference is that the argument doesn't have + // to be enclosed within a string, so it can't be parsed as an Expression. + // + url: function () { + var value; + + 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; + + if ($(/^data:/)) { + obj = {}; + obj.mime = $(/^[^\/]+\/[^,;)]+/) || ''; + obj.charset = $(/^;\s*charset=[^,;)]+/) || ''; + obj.base64 = $(/^;\s*base64/) || ''; + obj.data = $(/^,\s*[^)]+/); + + if (obj.data) { return obj } + } + }, + + // + // A Variable entity, such as `@fink`, in + // + // width: @fink + 2px + // + // We use a different parser for variable definitions, + // see `parsers.variable`. + // + variable: function () { + var name, index = i; + + if (input.charAt(i) === '@' && (name = $(/^@@?[\w-]+/))) { + return new(tree.Variable)(name, index); + } + }, + + // + // A Hexadecimal color + // + // #4F3C2F + // + // `rgb` and `hsl` colors are parsed through the `entities.call` parser. + // + color: function () { + var rgb; + + if (input.charAt(i) === '#' && (rgb = $(/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})/))) { + return new(tree.Color)(rgb[1]); + } + }, + + // + // A Dimension, that is, a number and a unit + // + // 0.5em 95% + // + dimension: function () { + var value, c = input.charCodeAt(i); + if ((c > 57 || c < 45) || c === 47) return; + + if (value = $(/^(-?\d*\.?\d+)(px|%|em|rem|pc|ex|in|deg|s|ms|pt|cm|mm|rad|grad|turn)?/)) { + return new(tree.Dimension)(value[1], value[2]); + } + }, + + // + // JavaScript code to be evaluated + // + // `window.location.href` + // + javascript: function () { + var str, j = i, e; + + if (input.charAt(j) === '~') { j++, e = true } // Escaped strings + if (input.charAt(j) !== '`') { return } + + e && $('~'); + + if (str = $(/^`([^`]*)`/)) { + return new(tree.JavaScript)(str[1], i, e); + } + } + }, + + // + // The variable part of a variable definition. Used in the `rule` parser + // + // @fink: + // + variable: function () { + var name; + + if (input.charAt(i) === '@' && (name = $(/^(@[\w-]+)\s*:/))) { return name[1] } + }, + + // + // A font size/line-height shorthand + // + // small/12px + // + // We need to peek first, or we'll match on keywords and dimensions + // + shorthand: function () { + var a, b; + + if (! peek(/^[@\w.%-]+\/[@\w.-]+/)) return; + + if ((a = $(this.entity)) && $('/') && (b = $(this.entity))) { + return new(tree.Shorthand)(a, b); + } + }, + + // + // Mixins + // + mixin: { + // + // A Mixin call, with an optional argument list + // + // #mixins > .square(#fff); + // .rounded(4px, black); + // .button; + // + // The `while` loop is there because mixins can be + // namespaced, but we only support the child and descendant + // selector for now. + // + call: function () { + var elements = [], e, c, args, index = i, s = input.charAt(i); + + if (s !== '.' && s !== '#') { return } + + while (e = $(/^[#.](?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+/)) { + elements.push(new(tree.Element)(c, e)); + c = $('>'); + } + $('(') && (args = $(this.entities.arguments)) && $(')'); + + if (elements.length > 0 && ($(';') || peek('}'))) { + return new(tree.mixin.Call)(elements, args, index); + } + }, + + // + // A Mixin definition, with a list of parameters + // + // .rounded (@radius: 2px, @color) { + // ... + // } + // + // Until we have a finer grained state-machine, we have to + // do a look-ahead, to make sure we don't have a mixin call. + // See the `rule` function for more information. + // + // We start by matching `.rounded (`, and then proceed on to + // the argument list, which has optional default values. + // We store the parameters in `params`, with a `value` key, + // if there is a value, such as in the case of `@radius`. + // + // Once we've got our params list, and a closing `)`, we parse + // the `{...}` block. + // + definition: function () { + var name, params = [], match, ruleset, param, value; + + if ((input.charAt(i) !== '.' && input.charAt(i) !== '#') || + peek(/^[^{]*(;|})/)) return; + + 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)) { + params.push({ name: param.name, value: value }); + } else { + throw new(Error)("Expected value"); + } + } else { + params.push({ name: param.name }); + } + } else { + params.push({ value: param }); + } + if (! $(',')) { break } + } + if (! $(')')) throw new(Error)("Expected )"); + + ruleset = $(this.block); + + if (ruleset) { + return new(tree.mixin.Definition)(name, params, ruleset); + } + } + } + }, + + // + // Entities are the smallest recognized token, + // and can be found inside a rule's value. + // + entity: function () { + return $(this.entities.literal) || $(this.entities.variable) || $(this.entities.url) || + $(this.entities.call) || $(this.entities.keyword) || $(this.entities.javascript) || + $(this.comment); + }, + + // + // A Rule terminator. Note that we use `peek()` to check for '}', + // because the `block` rule will be expecting it, but we still need to make sure + // it's there, if ';' was ommitted. + // + end: function () { + return $(';') || peek('}'); + }, + + // + // IE's alpha function + // + // alpha(opacity=88) + // + alpha: function () { + var value; + + if (! $(/^\(opacity=/i)) return; + if (value = $(/^\d+/) || $(this.entities.variable)) { + if (! $(')')) throw new(Error)("missing closing ) for alpha()"); + return new(tree.Alpha)(value); + } + }, + + // + // A Selector Element + // + // div + // + h1 + // #socks + // input[type="text"] + // + // Elements are the building blocks for Selectors, + // they are made out of a `Combinator` (see combinator rule), + // and an element name, such as a tag a class, or `*`. + // + element: function () { + var e, t, c; + + 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) } + + if (c.value && c.value[0] === '&') { + return new(tree.Element)(c, null); + } + }, + + // + // Combinators combine elements together, in a Selector. + // + // Because our parser isn't white-space sensitive, special care + // has to be taken, when parsing the descendant combinator, ` `, + // as it's an empty space. We have to check the previous character + // in the input, to see if it's a ` ` character. More info on how + // we deal with this in *combinator.js*. + // + combinator: function () { + var match, c = input.charAt(i); + + if (c === '>' || c === '+' || c === '~') { + i++; + while (input.charAt(i) === ' ') { 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) === ' ') { + return new(tree.Combinator)(" "); + } else { + return new(tree.Combinator)(null); + } + }, + + // + // A CSS Selector + // + // .class > div + h1 + // li a:hover + // + // Selectors are made out of one or more Elements, see above. + // + selector: function () { + var sel, e, elements = [], c, match; + + while (e = $(this.element)) { + c = input.charAt(i); + elements.push(e) + if (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 ((op = $(/^[|~*$^]?=/)) && + (val = $(this.entities.quoted) || $(/^[\w-]+/))) { + attr = [key, op, val.toCSS ? val.toCSS() : val].join(''); + } else { attr = key } + } + + if (! $(']')) return; + + if (attr) { return "[" + attr + "]" } + }, + + // + // The `block` rule is used by `ruleset` and `mixin.definition`. + // It's a wrapper around the `primary` rule, with added `{}`. + // + block: function () { + var content; + + if ($('{') && (content = $(this.primary)) && $('}')) { + return content; + } + }, + + // + // div, .class, body > p {...} + // + ruleset: function () { + var selectors = [], s, rules, match; + save(); + + while (s = $(this.selector)) { + selectors.push(s); + $(this.comment); + if (! $(',')) { break } + $(this.comment); + } + + if (selectors.length > 0 && (rules = $(this.block))) { + return new(tree.Ruleset)(selectors, rules); + } else { + // Backtrack + furthest = i; + restore(); + } + }, + rule: function () { + var name, value, c = input.charAt(i), important, match; + save(); + + if (c === '.' || c === '#' || c === '&') { return } + + if (name = $(this.variable) || $(this.property)) { + if ((name.charAt(0) != '@') && (match = /^([^@+\/'"*`(;{}-]*);/.exec(chunks[j]))) { + i += match[0].length - 1; + value = new(tree.Anonymous)(match[1]); + } else if (name === "font") { + value = $(this.font); + } else { + value = $(this.value); + } + important = $(this.important); + + if (value && $(this.end)) { + return new(tree.Rule)(name, value, important, memo); + } else { + furthest = i; + restore(); + } + } + }, + + // + // An @import directive + // + // @import "lib"; + // + // Depending on our environemnt, importing is done differently: + // In the browser, it's an XHR request, in Node, it would be a + // file-system operation. The function used for importing is + // 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); + } + }, + + // + // A CSS Directive + // + // @charset "utf-8"; + // + directive: function () { + var name, value, rules, types; + + if (input.charAt(i) !== '@') return; + + if (value = $(this['import'])) { + return value; + } else if (name = $(/^@media|@page/) || $(/^@(?:-webkit-|-moz-)?keyframes/)) { + types = ($(/^[^{]+/) || '').trim(); + if (rules = $(this.block)) { + return new(tree.Directive)(name + " " + types, rules); + } + } else if (name = $(/^@[-a-z]+/)) { + if (name === '@font-face') { + if (rules = $(this.block)) { + return new(tree.Directive)(name, rules); + } + } else if ((value = $(this.entity)) && $(';')) { + return new(tree.Directive)(name, value); + } + } + }, + font: function () { + var value = [], expression = [], weight, shorthand, font, e; + + while (e = $(this.shorthand) || $(this.entity)) { + expression.push(e); + } + value.push(new(tree.Expression)(expression)); + + if ($(',')) { + while (e = $(this.expression)) { + value.push(e); + if (! $(',')) { break } + } + } + return new(tree.Value)(value); + }, + + // + // A Value is a comma-delimited list of Expressions + // + // font-family: Baskerville, Georgia, serif; + // + // In a Rule, a Value represents everything after the `:`, + // and before the `;`. + // + value: function () { + var e, expressions = [], important; + + while (e = $(this.expression)) { + expressions.push(e); + if (! $(',')) { break } + } + + if (expressions.length > 0) { + return new(tree.Value)(expressions); + } + }, + important: function () { + if (input.charAt(i) === '!') { + return $(/^! *important/); + } + }, + sub: function () { + var e; + + if ($('(') && (e = $(this.expression)) && $(')')) { + return e; + } + }, + multiplication: function () { + var m, a, op, operation; + if (m = $(this.operand)) { + while ((op = ($('/') || $('*'))) && (a = $(this.operand))) { + operation = new(tree.Operation)(op, [operation || m, a]); + } + return operation || m; + } + }, + addition: function () { + var m, a, op, operation; + if (m = $(this.multiplication)) { + while ((op = $(/^[-+]\s+/) || (input.charAt(i - 1) != ' ' && ($('+') || $('-')))) && + (a = $(this.multiplication))) { + operation = new(tree.Operation)(op, [operation || m, a]); + } + return operation || m; + } + }, + + // + // An operand is anything that can be part of an operation, + // such as a Color, or a Variable + // + operand: function () { + var negate, p = input.charAt(i + 1); + + if (input.charAt(i) === '-' && (p === '@' || p === '(')) { negate = $('-') } + var o = $(this.sub) || $(this.entities.dimension) || + $(this.entities.color) || $(this.entities.variable) || + $(this.entities.call); + return negate ? new(tree.Operation)('*', [new(tree.Dimension)(-1), o]) + : o; + }, + + // + // Expressions either represent mathematical operations, + // or white-space delimited Entities. + // + // 1px solid black + // @var * 2 + // + expression: function () { + var e, delim, entities = [], d; + + while (e = $(this.addition) || $(this.entity)) { + entities.push(e); + } + if (entities.length > 0) { + return new(tree.Expression)(entities); + } + }, + property: function () { + var name; + + if (name = $(/^(\*?-?[-a-z_0-9]+)\s*:/)) { + return name[1]; + } + } + } + }; +}; + +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) { + 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); + }; +} + diff --git a/build-tools/lib/less/rhino.js b/build-tools/lib/less/rhino.js new file mode 100644 index 0000000..ab1c886 --- /dev/null +++ b/build-tools/lib/less/rhino.js @@ -0,0 +1,60 @@ +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(); + parser.parse(input, function (e, root) { + if (e) { + print("Error: " + e); + quit(1); + } + callback(root, sheet, { local: false, lastModified: 0, remaining: remaining }); + }); + + // callback({}, sheet, { local: true, remaining: remaining }); +} + +function writeFile(filename, content) { + var fstream = new java.io.FileWriter(filename); + var out = new java.io.BufferedWriter(fstream); + out.write(content); + out.close(); +} + +// Command line integration via Rhino +(function (args) { + name = args[0]; + var output = args[1]; + + if (!name) { + print('No files present in the fileset; Check your pattern match in build.xml'); + quit(1); + } + path = name.split("/");path.pop();path=path.join("/") + + var input = readFile(name); + + if (!input) { + print('lesscss: couldn\'t open file ' + name); + quit(1); + } + + 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); + } else { + print(result); + } + quit(0); + } + }); + print("done"); +}(arguments)); diff --git a/build-tools/lib/less/tree.js b/build-tools/lib/less/tree.js new file mode 100644 index 0000000..eb08aa4 --- /dev/null +++ b/build-tools/lib/less/tree.js @@ -0,0 +1,13 @@ +require('less/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) { + 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); + } +}; diff --git a/build-tools/lib/less/tree/alpha.js b/build-tools/lib/less/tree/alpha.js new file mode 100644 index 0000000..551ccba --- /dev/null +++ b/build-tools/lib/less/tree/alpha.js @@ -0,0 +1,17 @@ +(function (tree) { + +tree.Alpha = function (val) { + this.value = val; +}; +tree.Alpha.prototype = { + toCSS: function () { + return "alpha(opacity=" + + (this.value.toCSS ? this.value.toCSS() : this.value) + ")"; + }, + eval: function (env) { + if (this.value.eval) { this.value = this.value.eval(env) } + return this; + } +}; + +})(require('less/tree')); diff --git a/build-tools/lib/less/tree/anonymous.js b/build-tools/lib/less/tree/anonymous.js new file mode 100644 index 0000000..89840d0 --- /dev/null +++ b/build-tools/lib/less/tree/anonymous.js @@ -0,0 +1,13 @@ +(function (tree) { + +tree.Anonymous = function (string) { + this.value = string.value || string; +}; +tree.Anonymous.prototype = { + toCSS: function () { + return this.value; + }, + eval: function () { return this } +}; + +})(require('less/tree')); diff --git a/build-tools/lib/less/tree/call.js b/build-tools/lib/less/tree/call.js new file mode 100644 index 0000000..4a72932 --- /dev/null +++ b/build-tools/lib/less/tree/call.js @@ -0,0 +1,45 @@ +(function (tree) { + +// +// A function call node. +// +tree.Call = function (name, args, index) { + this.name = name; + this.args = args; + this.index = index; +}; +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]. + // + // The *functions.js* file contains the built-in functions. + // + // The reason why we evaluate the arguments, is in the case where + // we try to pass a variable to a function, like: `saturate(@color)`. + // The function should receive the value, not the variable. + // + eval: function (env) { + var args = this.args.map(function (a) { return a.eval(env) }); + + if (this.name in tree.functions) { // 1. + try { + return tree.functions[this.name].apply(tree.functions, args); + } catch (e) { + throw { message: "error evaluating function `" + this.name + "`", + index: this.index }; + } + } else { // 2. + return new(tree.Anonymous)(this.name + + "(" + args.map(function (a) { return a.toCSS() }).join(', ') + ")"); + } + }, + + toCSS: function (env) { + return this.eval(env).toCSS(); + } +}; + +})(require('less/tree')); diff --git a/build-tools/lib/less/tree/color.js b/build-tools/lib/less/tree/color.js new file mode 100644 index 0000000..bb7646a --- /dev/null +++ b/build-tools/lib/less/tree/color.js @@ -0,0 +1,101 @@ +(function (tree) { +// +// RGB Colors - #ff0014, #eee +// +tree.Color = function (rgb, a) { + // + // The end goal here, is to parse the arguments + // into an integer triplet, such as `128, 255, 0` + // + // This facilitates operations and conversions. + // + if (Array.isArray(rgb)) { + this.rgb = rgb; + } else if (rgb.length == 6) { + this.rgb = rgb.match(/.{2}/g).map(function (c) { + return parseInt(c, 16); + }); + } else { + this.rgb = rgb.split('').map(function (c) { + return parseInt(c + c, 16); + }); + } + this.alpha = typeof(a) === 'number' ? a : 1; +}; +tree.Color.prototype = { + eval: function () { return this }, + + // + // If we have some transparency, the only way to represent it + // is via `rgba`. Otherwise, we use the hex representation, + // which has better compatibility with older browsers. + // Values are capped between `0` and `255`, rounded and zero-padded. + // + toCSS: function () { + if (this.alpha < 1.0) { + return "rgba(" + this.rgb.map(function (c) { + return Math.round(c); + }).concat(this.alpha).join(', ') + ")"; + } else { + return '#' + this.rgb.map(function (i) { + i = Math.round(i); + i = (i > 255 ? 255 : (i < 0 ? 0 : i)).toString(16); + return i.length === 1 ? '0' + i : i; + }).join(''); + } + }, + + // + // Operations have to be done per-channel, if not, + // channels will spill onto each other. Once we have + // our result, in the form of an integer triplet, + // we create a new Color node to hold the result. + // + operate: function (op, other) { + var result = []; + + if (! (other instanceof tree.Color)) { + other = other.toColor(); + } + + for (var c = 0; c < 3; c++) { + result[c] = tree.operate(op, this.rgb[c], other.rgb[c]); + } + return new(tree.Color)(result, this.alpha + other.alpha); + }, + + toHSL: function () { + var r = this.rgb[0] / 255, + g = this.rgb[1] / 255, + b = this.rgb[2] / 255, + a = this.alpha; + + var max = Math.max(r, g, b), min = Math.min(r, g, b); + var h, s, l = (max + min) / 2, d = max - min; + + if (max === min) { + h = s = 0; + } else { + s = l > 0.5 ? d / (2 - max - min) : d / (max + min); + + switch (max) { + case r: h = (g - b) / d + (g < b ? 6 : 0); break; + case g: h = (b - r) / d + 2; break; + case b: h = (r - g) / d + 4; break; + } + h /= 6; + } + return { h: h * 360, s: s, l: l, a: a }; + }, + toARGB: function () { + var argb = [Math.round(this.alpha * 255)].concat(this.rgb); + return '#' + argb.map(function (i) { + i = Math.round(i); + i = (i > 255 ? 255 : (i < 0 ? 0 : i)).toString(16); + return i.length === 1 ? '0' + i : i; + }).join(''); + } +}; + + +})(require('less/tree')); diff --git a/build-tools/lib/less/tree/comment.js b/build-tools/lib/less/tree/comment.js new file mode 100644 index 0000000..2d95dff --- /dev/null +++ b/build-tools/lib/less/tree/comment.js @@ -0,0 +1,14 @@ +(function (tree) { + +tree.Comment = function (value, silent) { + this.value = value; + this.silent = !!silent; +}; +tree.Comment.prototype = { + toCSS: function (env) { + return env.compress ? '' : this.value; + }, + eval: function () { return this } +}; + +})(require('less/tree')); diff --git a/build-tools/lib/less/tree/dimension.js b/build-tools/lib/less/tree/dimension.js new file mode 100644 index 0000000..41f3ca2 --- /dev/null +++ b/build-tools/lib/less/tree/dimension.js @@ -0,0 +1,34 @@ +(function (tree) { + +// +// A number with a unit +// +tree.Dimension = function (value, unit) { + this.value = parseFloat(value); + this.unit = unit || null; +}; + +tree.Dimension.prototype = { + eval: function () { return this }, + toColor: function () { + return new(tree.Color)([this.value, this.value, this.value]); + }, + toCSS: function () { + var css = this.value + this.unit; + return css; + }, + + // In an operation between two Dimensions, + // we default to the first Dimension's unit, + // so `1px + 2em` will yield `3px`. + // In the future, we could implement some unit + // conversions such that `100cm + 10mm` would yield + // `101cm`. + operate: function (op, other) { + return new(tree.Dimension) + (tree.operate(op, this.value, other.value), + this.unit || other.unit); + } +}; + +})(require('less/tree')); diff --git a/build-tools/lib/less/tree/directive.js b/build-tools/lib/less/tree/directive.js new file mode 100644 index 0000000..fbe9a93 --- /dev/null +++ b/build-tools/lib/less/tree/directive.js @@ -0,0 +1,33 @@ +(function (tree) { + +tree.Directive = function (name, value) { + this.name = name; + if (Array.isArray(value)) { + this.ruleset = new(tree.Ruleset)([], value); + } else { + this.value = value; + } +}; +tree.Directive.prototype = { + toCSS: function (ctx, env) { + if (this.ruleset) { + this.ruleset.root = true; + return this.name + (env.compress ? '{' : ' {\n ') + + this.ruleset.toCSS(ctx, env).trim().replace(/\n/g, '\n ') + + (env.compress ? '}': '\n}\n'); + } else { + return this.name + ' ' + this.value.toCSS() + ';\n'; + } + }, + eval: function (env) { + env.frames.unshift(this); + this.ruleset = this.ruleset && this.ruleset.eval(env); + env.frames.shift(); + return this; + }, + 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')); diff --git a/build-tools/lib/less/tree/element.js b/build-tools/lib/less/tree/element.js new file mode 100644 index 0000000..27cf822 --- /dev/null +++ b/build-tools/lib/less/tree/element.js @@ -0,0 +1,35 @@ +(function (tree) { + +tree.Element = function (combinator, value) { + this.combinator = combinator instanceof tree.Combinator ? + combinator : new(tree.Combinator)(combinator); + this.value = value ? value.trim() : ""; +}; +tree.Element.prototype.toCSS = function (env) { + return this.combinator.toCSS(env || {}) + this.value; +}; + +tree.Combinator = function (value) { + if (value === ' ') { + this.value = ' '; + } else if (value === '& ') { + this.value = '& '; + } else { + this.value = value ? value.trim() : ""; + } +}; +tree.Combinator.prototype.toCSS = function (env) { + return { + '' : '', + ' ' : ' ', + '&' : '', + '& ' : ' ', + ':' : ' :', + '::': '::', + '+' : env.compress ? '+' : ' + ', + '~' : env.compress ? '~' : ' ~ ', + '>' : env.compress ? '>' : ' > ' + }[this.value]; +}; + +})(require('less/tree')); diff --git a/build-tools/lib/less/tree/expression.js b/build-tools/lib/less/tree/expression.js new file mode 100644 index 0000000..f638a1b --- /dev/null +++ b/build-tools/lib/less/tree/expression.js @@ -0,0 +1,23 @@ +(function (tree) { + +tree.Expression = function (value) { this.value = value }; +tree.Expression.prototype = { + eval: function (env) { + if (this.value.length > 1) { + return new(tree.Expression)(this.value.map(function (e) { + return e.eval(env); + })); + } else if (this.value.length === 1) { + return this.value[0].eval(env); + } else { + return this; + } + }, + toCSS: function (env) { + return this.value.map(function (e) { + return e.toCSS(env); + }).join(' '); + } +}; + +})(require('less/tree')); diff --git a/build-tools/lib/less/tree/import.js b/build-tools/lib/less/tree/import.js new file mode 100644 index 0000000..427c109 --- /dev/null +++ b/build-tools/lib/less/tree/import.js @@ -0,0 +1,77 @@ +(function (tree) { +// +// CSS @import node +// +// The general strategy here is that we don't want to wait +// for the parsing to be completed, before we start importing +// the file. That's because in the context of a browser, +// most of the time will be spent waiting for the server to respond. +// +// On creation, we push the import path to our import queue, though +// `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) { + var that = this; + + this._path = path; + + // The '.less' extension is optional + if (path instanceof tree.Quoted) { + this.path = /\.(le?|c)ss(\?.*)?$/.test(path.value) ? path.value : path.value + '.less'; + } else { + this.path = path.value.value || path.value; + } + + 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; + }); + } +}; + +// +// The actual import node doesn't return anything, when converted to CSS. +// The reason is that it's used at the evaluation stage, so that the rules +// it imports can be treated like any other rules. +// +// In `eval`, we make sure all Import nodes get evaluated, recursively, so +// we end up with a flat structure, which can easily be imported in the parent +// ruleset. +// +tree.Import.prototype = { + toCSS: function () { + if (this.css) { + return "@import " + this._path.toCSS() + ';\n'; + } else { + return ""; + } + }, + eval: function (env) { + var ruleset; + + if (this.css) { + return this; + } else { + ruleset = new(tree.Ruleset)(null, 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; + } + } +}; + +})(require('less/tree')); diff --git a/build-tools/lib/less/tree/javascript.js b/build-tools/lib/less/tree/javascript.js new file mode 100644 index 0000000..4ec66b9 --- /dev/null +++ b/build-tools/lib/less/tree/javascript.js @@ -0,0 +1,51 @@ +(function (tree) { + +tree.JavaScript = function (string, index, escaped) { + this.escaped = escaped; + this.expression = string; + this.index = index; +}; +tree.JavaScript.prototype = { + eval: function (env) { + var result, + that = this, + context = {}; + + var expression = this.expression.replace(/@\{([\w-]+)\}/g, function (_, name) { + return tree.jsify(new(tree.Variable)('@' + name, that.index).eval(env)); + }); + + try { + expression = new(Function)('return (' + expression + ')'); + } catch (e) { + throw { message: "JavaScript evaluation error: `" + expression + "`" , + index: this.index }; + } + + for (var k in env.frames[0].variables()) { + context[k.slice(1)] = { + value: env.frames[0].variables()[k].value, + toJS: function () { + return this.value.eval(env).toCSS(); + } + }; + } + + try { + result = expression.call(context); + } catch (e) { + throw { message: "JavaScript evaluation error: '" + e.name + ': ' + e.message + "'" , + index: this.index }; + } + if (typeof(result) === 'string') { + return new(tree.Quoted)('"' + result + '"', result, this.escaped, this.index); + } else if (Array.isArray(result)) { + return new(tree.Anonymous)(result.join(', ')); + } else { + return new(tree.Anonymous)(result); + } + } +}; + +})(require('less/tree')); + diff --git a/build-tools/lib/less/tree/keyword.js b/build-tools/lib/less/tree/keyword.js new file mode 100644 index 0000000..a4431ba --- /dev/null +++ b/build-tools/lib/less/tree/keyword.js @@ -0,0 +1,9 @@ +(function (tree) { + +tree.Keyword = function (value) { this.value = value }; +tree.Keyword.prototype = { + eval: function () { return this }, + toCSS: function () { return this.value } +}; + +})(require('less/tree')); diff --git a/build-tools/lib/less/tree/mixin.js b/build-tools/lib/less/tree/mixin.js new file mode 100644 index 0000000..24cb8e4 --- /dev/null +++ b/build-tools/lib/less/tree/mixin.js @@ -0,0 +1,106 @@ +(function (tree) { + +tree.mixin = {}; +tree.mixin.Call = function (elements, args, index) { + this.selector = new(tree.Selector)(elements); + this.arguments = args; + this.index = index; +}; +tree.mixin.Call.prototype = { + eval: function (env) { + var mixins, args, rules = [], match = false; + + for (var 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 }; + } + } + } + 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 }; + } +}; + +tree.mixin.Definition = function (name, params, rules) { + this.name = name; + this.selectors = [new(tree.Selector)([new(tree.Element)(null, name)])]; + this.params = params; + this.arity = params.length; + this.rules = rules; + this._lookups = {}; + this.required = params.reduce(function (count, p) { + if (!p.name || (p.name && !p.value)) { return count + 1 } + else { return count } + }, 0); + this.parent = tree.Ruleset.prototype; + this.frames = []; +}; +tree.mixin.Definition.prototype = { + toCSS: function () { return "" }, + variable: function (name) { return this.parent.variable.call(this, name) }, + variables: function () { return this.parent.variables.call(this) }, + 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 = []; + + 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))); + } else { + throw { message: "wrong number of arguments for " + this.name + + ' (' + args.length + ' for ' + this.arity + ')' }; + } + } + } + for (var i = 0; i < Math.max(this.params.length, args && args.length); i++) { + _arguments.push(args[i] || this.params[i].value); + } + 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) + }); + }, + match: function (args, env) { + var argsLength = (args && args.length) || 0, len; + + if (argsLength < this.required) { 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()) { + return false; + } + } + } + return true; + } +}; + +})(require('less/tree')); diff --git a/build-tools/lib/less/tree/operation.js b/build-tools/lib/less/tree/operation.js new file mode 100644 index 0000000..d2e4d57 --- /dev/null +++ b/build-tools/lib/less/tree/operation.js @@ -0,0 +1,32 @@ +(function (tree) { + +tree.Operation = function (op, operands) { + this.op = op.trim(); + this.operands = operands; +}; +tree.Operation.prototype.eval = function (env) { + var a = this.operands[0].eval(env), + b = this.operands[1].eval(env), + temp; + + if (a instanceof tree.Dimension && b instanceof tree.Color) { + if (this.op === '*' || this.op === '+') { + temp = b, b = a, a = temp; + } else { + throw { name: "OperationError", + message: "Can't substract or divide a color from a number" }; + } + } + return a.operate(this.op, b); +}; + +tree.operate = function (op, a, b) { + switch (op) { + case '+': return a + b; + case '-': return a - b; + case '*': return a * b; + case '/': return a / b; + } +}; + +})(require('less/tree')); diff --git a/build-tools/lib/less/tree/quoted.js b/build-tools/lib/less/tree/quoted.js new file mode 100644 index 0000000..6ddfa40 --- /dev/null +++ b/build-tools/lib/less/tree/quoted.js @@ -0,0 +1,29 @@ +(function (tree) { + +tree.Quoted = function (str, content, escaped, i) { + this.escaped = escaped; + this.value = content || ''; + this.quote = str.charAt(0); + this.index = i; +}; +tree.Quoted.prototype = { + toCSS: function () { + if (this.escaped) { + return this.value; + } else { + return this.quote + this.value + this.quote; + } + }, + eval: function (env) { + var that = this; + var value = this.value.replace(/`([^`]+)`/g, function (_, exp) { + 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 new(tree.Quoted)(this.quote + value + this.quote, value, this.escaped, this.index); + } +}; + +})(require('less/tree')); diff --git a/build-tools/lib/less/tree/rule.js b/build-tools/lib/less/tree/rule.js new file mode 100644 index 0000000..18cc49b --- /dev/null +++ b/build-tools/lib/less/tree/rule.js @@ -0,0 +1,38 @@ +(function (tree) { + +tree.Rule = function (name, value, important, index) { + this.name = name; + this.value = (value instanceof tree.Value) ? value : new(tree.Value)([value]); + this.important = important ? ' ' + important.trim() : ''; + this.index = index; + + if (name.charAt(0) === '@') { + this.variable = true; + } else { this.variable = false } +}; +tree.Rule.prototype.toCSS = function (env) { + if (this.variable) { return "" } + else { + return this.name + (env.compress ? ':' : ': ') + + this.value.toCSS(env) + + this.important + ";"; + } +}; + +tree.Rule.prototype.eval = function (context) { + return new(tree.Rule)(this.name, this.value.eval(context), this.important, this.index); +}; + +tree.Shorthand = function (a, b) { + this.a = a; + this.b = b; +}; + +tree.Shorthand.prototype = { + toCSS: function (env) { + return this.a.toCSS(env) + "/" + this.b.toCSS(env); + }, + eval: function () { return this } +}; + +})(require('less/tree')); diff --git a/build-tools/lib/less/tree/ruleset.js b/build-tools/lib/less/tree/ruleset.js new file mode 100644 index 0000000..cc9a60a --- /dev/null +++ b/build-tools/lib/less/tree/ruleset.js @@ -0,0 +1,212 @@ +(function (tree) { + +tree.Ruleset = function (selectors, rules) { + this.selectors = selectors; + this.rules = rules; + this._lookups = {}; +}; +tree.Ruleset.prototype = { + eval: function (env) { + var ruleset = new(tree.Ruleset)(this.selectors, this.rules.slice(0)); + + ruleset.root = this.root; + + // 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))); + } + } + } + + // Store the frames around mixin definitions, + // so they can be evaluated like closures when the time comes. + for (var i = 0; i < ruleset.rules.length; i++) { + if (ruleset.rules[i] instanceof tree.mixin.Definition) { + ruleset.rules[i].frames = env.frames.slice(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))); + } + } + + // Evaluate everything else + for (var i = 0, rule; i < ruleset.rules.length; i++) { + rule = ruleset.rules[i]; + + if (! (rule instanceof tree.mixin.Definition)) { + ruleset.rules[i] = rule.eval ? rule.eval(env) : rule; + } + } + + // Pop the stack + env.frames.shift(); + + return ruleset; + }, + match: function (args) { + return !args || args.length === 0; + }, + variables: function () { + if (this._variables) { return this._variables } + else { + return this._variables = this.rules.reduce(function (hash, r) { + if (r instanceof tree.Rule && r.variable === true) { + hash[r.name] = r; + } + return hash; + }, {}); + } + }, + variable: function (name) { + return this.variables()[name]; + }, + rulesets: function () { + if (this._rulesets) { return this._rulesets } + else { + return this._rulesets = this.rules.filter(function (r) { + return (r instanceof tree.Ruleset) || (r instanceof tree.mixin.Definition); + }); + } + }, + find: function (selector, self) { + self = self || this; + var rules = [], rule, match, + key = selector.toCSS(); + + if (key in this._lookups) { return this._lookups[key] } + + this.rulesets().forEach(function (rule) { + if (rule !== self) { + for (var j = 0; j < rule.selectors.length; j++) { + if (match = selector.match(rule.selectors[j])) { + if (selector.elements.length > rule.selectors[j].elements.length) { + Array.prototype.push.apply(rules, rule.find( + new(tree.Selector)(selector.elements.slice(1)), self)); + } else { + rules.push(rule); + } + break; + } + } + } + }); + return this._lookups[key] = rules; + }, + // + // Entry point for code generation + // + // `context` holds an array of arrays. + // + toCSS: function (context, env) { + var css = [], // The CSS output + rules = [], // node.Rule instances + rulesets = [], // node.Ruleset instances + paths = [], // Current selectors + selector, // The fully rendered selector + rule; + + if (! this.root) { + if (context.length === 0) { + paths = this.selectors.map(function (s) { return [s] }); + } else { + 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)) { + rulesets.push(rule.toCSS(paths, env)); + } else if (rule instanceof tree.Comment) { + if (!rule.silent) { + if (this.root) { + rulesets.push(rule.toCSS(env)); + } else { + rules.push(rule.toCSS(env)); + } + } + } else { + if (rule.toCSS && !rule.variable) { + rules.push(rule.toCSS(env)); + } else if (rule.value && !rule.variable) { + rules.push(rule.value.toString()); + } + } + } + + rulesets = rulesets.join(''); + + // If this is the root node, we don't render + // a selector, or {}. + // Otherwise, only output if this ruleset has rules. + if (this.root) { + css.push(rules.join(env.compress ? '' : '\n')); + } else { + if (rules.length > 0) { + 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, + (env.compress ? '{' : ' {\n ') + + rules.join(env.compress ? '' : '\n ') + + (env.compress ? '}' : '\n}\n')); + } + } + css.push(rulesets); + + return css.join('') + (env.compress ? '\n' : ''); + }, + + joinSelectors: function (paths, context, selectors) { + for (var s = 0; s < selectors.length; s++) { + this.joinSelector(paths, context, selectors[s]); + } + }, + + joinSelector: function (paths, context, selector) { + var before = [], after = [], beforeElements = [], + afterElements = [], hasParentSelector = false, el; + + for (var i = 0; i < selector.elements.length; i++) { + el = selector.elements[i]; + if (el.combinator.value[0] === '&') { + hasParentSelector = true; + } + if (hasParentSelector) afterElements.push(el); + else beforeElements.push(el); + } + + if (! hasParentSelector) { + afterElements = beforeElements; + beforeElements = []; + } + + if (beforeElements.length > 0) { + before.push(new(tree.Selector)(beforeElements)); + } + + if (afterElements.length > 0) { + after.push(new(tree.Selector)(afterElements)); + } + + for (var c = 0; c < context.length; c++) { + paths.push(before.concat(context[c]).concat(after)); + } + } +}; +})(require('less/tree')); diff --git a/build-tools/lib/less/tree/selector.js b/build-tools/lib/less/tree/selector.js new file mode 100644 index 0000000..ddc6842 --- /dev/null +++ b/build-tools/lib/less/tree/selector.js @@ -0,0 +1,42 @@ +(function (tree) { + +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; + + if (len > olen) { + return value === other.elements[0].value; + } + + 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; + } + } + return true; + } + } + return false; +}; +tree.Selector.prototype.toCSS = function (env) { + if (this._css) { return this._css } + + return this._css = this.elements.map(function (e) { + if (typeof(e) === 'string') { + return ' ' + e.trim(); + } else { + return e.toCSS(env); + } + }).join(''); +}; + +})(require('less/tree')); diff --git a/build-tools/lib/less/tree/url.js b/build-tools/lib/less/tree/url.js new file mode 100644 index 0000000..f427070 --- /dev/null +++ b/build-tools/lib/less/tree/url.js @@ -0,0 +1,25 @@ +(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.prototype = { + toCSS: function () { + return "url(" + (this.attrs ? 'data:' + this.attrs.mime + this.attrs.charset + this.attrs.base64 + this.attrs.data + : this.value.toCSS()) + ")"; + }, + eval: function (ctx) { + return this.attrs ? this : new(tree.URL)(this.value.eval(ctx), this.paths); + } +}; + +})(require('less/tree')); diff --git a/build-tools/lib/less/tree/value.js b/build-tools/lib/less/tree/value.js new file mode 100644 index 0000000..922096c --- /dev/null +++ b/build-tools/lib/less/tree/value.js @@ -0,0 +1,24 @@ +(function (tree) { + +tree.Value = function (value) { + this.value = value; + this.is = 'value'; +}; +tree.Value.prototype = { + eval: function (env) { + if (this.value.length === 1) { + return this.value[0].eval(env); + } else { + return new(tree.Value)(this.value.map(function (v) { + return v.eval(env); + })); + } + }, + toCSS: function (env) { + return this.value.map(function (e) { + return e.toCSS(env); + }).join(env.compress ? ',' : ', '); + } +}; + +})(require('less/tree')); diff --git a/build-tools/lib/less/tree/variable.js b/build-tools/lib/less/tree/variable.js new file mode 100644 index 0000000..10f7c08 --- /dev/null +++ b/build-tools/lib/less/tree/variable.js @@ -0,0 +1,24 @@ +(function (tree) { + +tree.Variable = function (name, index) { this.name = name, this.index = index }; +tree.Variable.prototype = { + eval: function (env) { + var variable, v, name = this.name; + + if (name.indexOf('@@') == 0) { + name = '@' + new(tree.Variable)(name.slice(1)).eval(env).value; + } + + if (variable = tree.find(env.frames, function (frame) { + if (v = frame.variable(name)) { + return v.value.eval(env); + } + })) { return variable } + else { + throw { message: "variable " + name + " is undefined", + index: this.index }; + } + } +}; + +})(require('less/tree')); diff --git a/build-tools/lib/optimist/LICENSE b/build-tools/lib/optimist/LICENSE new file mode 100644 index 0000000..432d1ae --- /dev/null +++ b/build-tools/lib/optimist/LICENSE @@ -0,0 +1,21 @@ +Copyright 2010 James Halliday (mail@substack.net) + +This project is free software released under the MIT/X11 license: + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/build-tools/lib/optimist/index.js b/build-tools/lib/optimist/index.js new file mode 100644 index 0000000..4dc39f4 --- /dev/null +++ b/build-tools/lib/optimist/index.js @@ -0,0 +1,475 @@ +var path = require('path'); +var wordwrap = require('wordwrap'); + +/* Hack an instance of Argv with process.argv into Argv + so people can do + require('optimist')(['--beeble=1','-z','zizzle']).argv + to parse a list of args and + require('optimist').argv + to get a parsed version of process.argv. +*/ + +var inst = Argv(process.argv.slice(2)); +Object.keys(inst).forEach(function (key) { + Argv[key] = typeof inst[key] == 'function' + ? inst[key].bind(inst) + : inst[key]; +}); + +var exports = module.exports = Argv; +function Argv (args, cwd) { + var self = {}; + if (!cwd) cwd = process.cwd(); + + self.$0 = process.argv + .slice(0,2) + .map(function (x) { + var b = rebase(cwd, x); + return x.match(/^\//) && b.length < x.length + ? b : x + }) + .join(' ') + ; + + if (process.argv[1] == process.env._) { + self.$0 = process.env._.replace( + path.dirname(process.execPath) + '/', '' + ); + } + + var flags = { bools : {}, strings : {} }; + + self.boolean = function (bools) { + if (!Array.isArray(bools)) { + bools = [].slice.call(arguments); + } + + bools.forEach(function (name) { + flags.bools[name] = true; + }); + + return self; + }; + + self.string = function (strings) { + if (!Array.isArray(strings)) { + strings = [].slice.call(arguments); + } + + strings.forEach(function (name) { + flags.strings[name] = true; + }); + + return self; + }; + + var aliases = {}; + self.alias = function (x, y) { + if (typeof x === 'object') { + Object.keys(x).forEach(function (key) { + self.alias(key, x[key]); + }); + } + else if (Array.isArray(y)) { + y.forEach(function (yy) { + self.alias(x, yy); + }); + } + else { + var zs = (aliases[x] || []).concat(aliases[y] || []).concat(x, y); + aliases[x] = zs.filter(function (z) { return z != x }); + aliases[y] = zs.filter(function (z) { return z != y }); + } + + return self; + }; + + var demanded = {}; + self.demand = function (keys) { + if (typeof keys == 'number') { + if (!demanded._) demanded._ = 0; + demanded._ += keys; + } + else if (Array.isArray(keys)) { + keys.forEach(function (key) { + self.demand(key); + }); + } + else { + demanded[keys] = true; + } + + return self; + }; + + var usage; + self.usage = function (msg, opts) { + if (!opts && typeof msg === 'object') { + opts = msg; + msg = null; + } + + usage = msg; + + if (opts) self.options(opts); + + return self; + }; + + function fail (msg) { + self.showHelp(); + if (msg) console.error(msg); + process.exit(1); + } + + var checks = []; + self.check = function (f) { + checks.push(f); + return self; + }; + + var defaults = {}; + self.default = function (key, value) { + if (typeof key === 'object') { + Object.keys(key).forEach(function (k) { + self.default(k, key[k]); + }); + } + else { + defaults[key] = value; + } + + return self; + }; + + var descriptions = {}; + self.describe = function (key, desc) { + if (typeof key === 'object') { + Object.keys(key).forEach(function (k) { + self.describe(k, key[k]); + }); + } + else { + descriptions[key] = desc; + } + return self; + }; + + self.parse = function (args) { + return Argv(args).argv; + }; + + self.option = self.options = function (key, opt) { + if (typeof key === 'object') { + Object.keys(key).forEach(function (k) { + self.options(k, key[k]); + }); + } + else { + if (opt.alias) self.alias(key, opt.alias); + if (opt.demand) self.demand(key); + if (typeof opt.default !== 'undefined') { + self.default(key, opt.default); + } + + if (opt.boolean || opt.type === 'boolean') { + self.boolean(key); + } + if (opt.string || opt.type === 'string') { + self.string(key); + } + + var desc = opt.describe || opt.description || opt.desc; + if (desc) { + self.describe(key, desc); + } + } + + return self; + }; + + var wrap = null; + self.wrap = function (cols) { + wrap = cols; + return self; + }; + + self.showHelp = function (fn) { + if (!fn) fn = console.error; + fn(self.help()); + }; + + self.help = function () { + var keys = Object.keys( + Object.keys(descriptions) + .concat(Object.keys(demanded)) + .concat(Object.keys(defaults)) + .reduce(function (acc, key) { + if (key !== '_') acc[key] = true; + return acc; + }, {}) + ); + + var help = keys.length ? [ 'Options:' ] : []; + + if (usage) { + help.unshift(usage.replace(/\$0/g, self.$0), ''); + } + + var switches = keys.reduce(function (acc, key) { + acc[key] = [ key ].concat(aliases[key] || []) + .map(function (sw) { + return (sw.length > 1 ? '--' : '-') + sw + }) + .join(', ') + ; + return acc; + }, {}); + + var switchlen = longest(Object.keys(switches).map(function (s) { + return switches[s] || ''; + })); + + var desclen = longest(Object.keys(descriptions).map(function (d) { + return descriptions[d] || ''; + })); + + keys.forEach(function (key) { + var kswitch = switches[key]; + var desc = descriptions[key] || ''; + + if (wrap) { + desc = wordwrap(switchlen + 4, wrap)(desc) + .slice(switchlen + 4) + ; + } + + var spadding = new Array( + Math.max(switchlen - kswitch.length + 3, 0) + ).join(' '); + + var dpadding = new Array( + Math.max(desclen - desc.length + 1, 0) + ).join(' '); + + var type = null; + + if (flags.bools[key]) type = '[boolean]'; + if (flags.strings[key]) type = '[string]'; + + if (!wrap && dpadding.length > 0) { + desc += dpadding; + } + + var prelude = ' ' + kswitch + spadding; + var extra = [ + type, + demanded[key] + ? '[required]' + : null + , + defaults[key] !== undefined + ? '[default: ' + JSON.stringify(defaults[key]) + ']' + : null + , + ].filter(Boolean).join(' '); + + var body = [ desc, extra ].filter(Boolean).join(' '); + + if (wrap) { + var dlines = desc.split('\n'); + var dlen = dlines.slice(-1)[0].length + + (dlines.length === 1 ? prelude.length : 0) + + body = desc + (dlen + extra.length > wrap - 2 + ? '\n' + + new Array(wrap - extra.length + 1).join(' ') + + extra + : new Array(wrap - extra.length - dlen + 1).join(' ') + + extra + ); + } + + help.push(prelude + body); + }); + + help.push(''); + return help.join('\n'); + }; + + Object.defineProperty(self, 'argv', { + get : parseArgs, + enumerable : true, + }); + + function parseArgs () { + var argv = { _ : [], $0 : self.$0 }; + Object.keys(flags.bools).forEach(function (key) { + setArg(key, defaults[key] || false); + }); + + function setArg (key, val) { + var num = Number(val); + var value = typeof val !== 'string' || isNaN(num) ? val : num; + if (flags.strings[key]) value = val; + + setKey(argv, key.split('.'), value); + + (aliases[key] || []).forEach(function (x) { + argv[x] = argv[key]; + }); + } + + for (var i = 0; i < args.length; i++) { + var arg = args[i]; + + if (arg === '--') { + argv._.push.apply(argv._, args.slice(i + 1)); + break; + } + else if (arg.match(/^--.+=/)) { + var m = arg.match(/^--([^=]+)=(.*)/); + setArg(m[1], m[2]); + } + else if (arg.match(/^--no-.+/)) { + var key = arg.match(/^--no-(.+)/)[1]; + setArg(key, false); + } + else if (arg.match(/^--.+/)) { + var key = arg.match(/^--(.+)/)[1]; + var next = args[i + 1]; + if (next !== undefined && !next.match(/^-/) + && !flags.bools[key] + && (aliases[key] ? !flags.bools[aliases[key]] : true)) { + setArg(key, next); + i++; + } + else if (/true|false/.test(next)) { + setArg(key, next === 'true'); + i++; + } + else { + setArg(key, true); + } + } + else if (arg.match(/^-[^-]+/)) { + var letters = arg.slice(1,-1).split(''); + + var broken = false; + for (var j = 0; j < letters.length; j++) { + if (letters[j+1] && letters[j+1].match(/\W/)) { + setArg(letters[j], arg.slice(j+2)); + broken = true; + break; + } + else { + setArg(letters[j], true); + } + } + + if (!broken) { + var key = arg.slice(-1)[0]; + + if (args[i+1] && !args[i+1].match(/^-/) + && !flags.bools[key] + && (aliases[key] ? !flags.bools[aliases[key]] : true)) { + setArg(key, args[i+1]); + i++; + } + else if (args[i+1] && /true|false/.test(args[i+1])) { + setArg(key, args[i+1] === 'true'); + i++; + } + else { + setArg(key, true); + } + } + } + else { + var n = Number(arg); + argv._.push(flags.strings['_'] || isNaN(n) ? arg : n); + } + } + + Object.keys(defaults).forEach(function (key) { + if (!(key in argv)) { + argv[key] = defaults[key]; + if (key in aliases) { + argv[aliases[key]] = defaults[key]; + } + } + }); + + if (demanded._ && argv._.length < demanded._) { + fail('Not enough non-option arguments: got ' + + argv._.length + ', need at least ' + demanded._ + ); + } + + var missing = []; + Object.keys(demanded).forEach(function (key) { + if (!argv[key]) missing.push(key); + }); + + if (missing.length) { + fail('Missing required arguments: ' + missing.join(', ')); + } + + checks.forEach(function (f) { + try { + if (f(argv) === false) { + fail('Argument check failed: ' + f.toString()); + } + } + catch (err) { + fail(err) + } + }); + + return argv; + } + + function longest (xs) { + return Math.max.apply( + null, + xs.map(function (x) { return x.length }) + ); + } + + return self; +}; + +// rebase an absolute path to a relative one with respect to a base directory +// exported for tests +exports.rebase = rebase; +function rebase (base, dir) { + var ds = path.normalize(dir).split('/').slice(1); + var bs = path.normalize(base).split('/').slice(1); + + for (var i = 0; ds[i] && ds[i] == bs[i]; i++); + ds.splice(0, i); bs.splice(0, i); + + var p = path.normalize( + bs.map(function () { return '..' }).concat(ds).join('/') + ).replace(/\/$/,'').replace(/^$/, '.'); + return p.match(/^[.\/]/) ? p : './' + p; +}; + +function setKey (obj, keys, value) { + var o = obj; + keys.slice(0,-1).forEach(function (key) { + if (o[key] === undefined) o[key] = {}; + o = o[key]; + }); + + var key = keys[keys.length - 1]; + if (o[key] === undefined || typeof o[key] === 'boolean') { + o[key] = value; + } + else if (Array.isArray(o[key])) { + o[key].push(value); + } + else { + o[key] = [ o[key], value ]; + } +} diff --git a/build-tools/lib/uglify-js.js b/build-tools/lib/uglify-js.js new file mode 100644 index 0000000..972e9cf --- /dev/null +++ b/build-tools/lib/uglify-js.js @@ -0,0 +1,21 @@ +//convienence function(src, [options]); +function uglify(orig_code, options){ + options || (options = {}); + var jsp = uglify.parser; + var pro = uglify.uglify; + + var ast = jsp.parse(orig_code, options.strict_semicolons); // parse code and get the initial AST + ast = pro.ast_mangle(ast, options.mangle_options); // get a new AST with mangled names + ast = pro.ast_squeeze(ast, options.squeeze_options); // get an AST with compression optimizations + var final_code = pro.gen_code(ast, options.gen_options); // compressed code here + return final_code; +}; + +// Change path to clean up lib directory. +// by Youmin Ha +uglify.parser = require("./uglifyjs/parse-js"); +uglify.uglify = require("./uglifyjs/process"); +//uglify.parser = require("./lib/parse-js"); +//uglify.uglify = require("./lib/process"); + +module.exports = uglify diff --git a/build-tools/lib/uglifyjs/LICENSE b/build-tools/lib/uglifyjs/LICENSE new file mode 100644 index 0000000..50b533a --- /dev/null +++ b/build-tools/lib/uglifyjs/LICENSE @@ -0,0 +1,28 @@ +Copyright 2010 (c) Mihai Bazon +Based on parse-js (http://marijn.haverbeke.nl/parse-js/). + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above +copyright notice, this list of conditions and the following +disclaimer. + +* Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following +disclaimer in the documentation and/or other materials +provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR +TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF +THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. diff --git a/build-tools/lib/uglifyjs/parse-js.js b/build-tools/lib/uglifyjs/parse-js.js new file mode 100644 index 0000000..44dcc33 --- /dev/null +++ b/build-tools/lib/uglifyjs/parse-js.js @@ -0,0 +1,1342 @@ +/*********************************************************************** + + A JavaScript tokenizer / parser / beautifier / compressor. + + This version is suitable for Node.js. With minimal changes (the + exports stuff) it should work on any JS platform. + + This file contains the tokenizer/parser. It is a port to JavaScript + of parse-js [1], a JavaScript parser library written in Common Lisp + by Marijn Haverbeke. Thank you Marijn! + + [1] http://marijn.haverbeke.nl/parse-js/ + + Exported functions: + + - tokenizer(code) -- returns a function. Call the returned + function to fetch the next token. + + - parse(code) -- returns an AST of the given JavaScript code. + + -------------------------------- (C) --------------------------------- + + Author: Mihai Bazon + + http://mihai.bazon.net/blog + + Distributed under the BSD license: + + Copyright 2010 (c) Mihai Bazon + Based on parse-js (http://marijn.haverbeke.nl/parse-js/). + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above + copyright notice, this list of conditions and the following + disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF + THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + + ***********************************************************************/ + +/* -----[ Tokenizer (constants) ]----- */ + +var KEYWORDS = array_to_hash([ + "break", + "case", + "catch", + "const", + "continue", + "debugger", + "default", + "delete", + "do", + "else", + "finally", + "for", + "function", + "if", + "in", + "instanceof", + "new", + "return", + "switch", + "throw", + "try", + "typeof", + "var", + "void", + "while", + "with" +]); + +var RESERVED_WORDS = array_to_hash([ + "abstract", + "boolean", + "byte", + "char", + "class", + "double", + "enum", + "export", + "extends", + "final", + "float", + "goto", + "implements", + "import", + "int", + "interface", + "long", + "native", + "package", + "private", + "protected", + "public", + "short", + "static", + "super", + "synchronized", + "throws", + "transient", + "volatile" +]); + +var KEYWORDS_BEFORE_EXPRESSION = array_to_hash([ + "return", + "new", + "delete", + "throw", + "else", + "case" +]); + +var KEYWORDS_ATOM = array_to_hash([ + "false", + "null", + "true", + "undefined" +]); + +var OPERATOR_CHARS = array_to_hash(characters("+-*&%=<>!?|~^")); + +var RE_HEX_NUMBER = /^0x[0-9a-f]+$/i; +var RE_OCT_NUMBER = /^0[0-7]+$/; +var RE_DEC_NUMBER = /^\d*\.?\d*(?:e[+-]?\d*(?:\d\.?|\.?\d)\d*)?$/i; + +var OPERATORS = array_to_hash([ + "in", + "instanceof", + "typeof", + "new", + "void", + "delete", + "++", + "--", + "+", + "-", + "!", + "~", + "&", + "|", + "^", + "*", + "/", + "%", + ">>", + "<<", + ">>>", + "<", + ">", + "<=", + ">=", + "==", + "===", + "!=", + "!==", + "?", + "=", + "+=", + "-=", + "/=", + "*=", + "%=", + ">>=", + "<<=", + ">>>=", + "|=", + "^=", + "&=", + "&&", + "||" +]); + +var WHITESPACE_CHARS = array_to_hash(characters(" \u00a0\n\r\t\f\u000b\u200b\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000")); + +var PUNC_BEFORE_EXPRESSION = array_to_hash(characters("[{}(,.;:")); + +var PUNC_CHARS = array_to_hash(characters("[]{}(),;:")); + +var REGEXP_MODIFIERS = array_to_hash(characters("gmsiy")); + +/* -----[ Tokenizer ]----- */ + +// regexps adapted from http://xregexp.com/plugins/#unicode +var UNICODE = { + letter: new RegExp("[\\u0041-\\u005A\\u0061-\\u007A\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u0523\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0621-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971\\u0972\\u097B-\\u097F\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D28\\u0D2A-\\u0D39\\u0D3D\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC\\u0EDD\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8B\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10D0-\\u10FA\\u10FC\\u1100-\\u1159\\u115F-\\u11A2\\u11A8-\\u11F9\\u1200-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u1676\\u1681-\\u169A\\u16A0-\\u16EA\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u1900-\\u191C\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19A9\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u2094\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2C6F\\u2C71-\\u2C7D\\u2C80-\\u2CE4\\u2D00-\\u2D25\\u2D30-\\u2D65\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31B7\\u31F0-\\u31FF\\u3400\\u4DB5\\u4E00\\u9FC3\\uA000-\\uA48C\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA65F\\uA662-\\uA66E\\uA67F-\\uA697\\uA717-\\uA71F\\uA722-\\uA788\\uA78B\\uA78C\\uA7FB-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA90A-\\uA925\\uA930-\\uA946\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAC00\\uD7A3\\uF900-\\uFA2D\\uFA30-\\uFA6A\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"), + non_spacing_mark: new RegExp("[\\u0300-\\u036F\\u0483-\\u0487\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u065E\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07EB-\\u07F3\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0900-\\u0902\\u093C\\u0941-\\u0948\\u094D\\u0951-\\u0955\\u0962\\u0963\\u0981\\u09BC\\u09C1-\\u09C4\\u09CD\\u09E2\\u09E3\\u0A01\\u0A02\\u0A3C\\u0A41\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A70\\u0A71\\u0A75\\u0A81\\u0A82\\u0ABC\\u0AC1-\\u0AC5\\u0AC7\\u0AC8\\u0ACD\\u0AE2\\u0AE3\\u0B01\\u0B3C\\u0B3F\\u0B41-\\u0B44\\u0B4D\\u0B56\\u0B62\\u0B63\\u0B82\\u0BC0\\u0BCD\\u0C3E-\\u0C40\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0CBC\\u0CBF\\u0CC6\\u0CCC\\u0CCD\\u0CE2\\u0CE3\\u0D41-\\u0D44\\u0D4D\\u0D62\\u0D63\\u0DCA\\u0DD2-\\u0DD4\\u0DD6\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F71-\\u0F7E\\u0F80-\\u0F84\\u0F86\\u0F87\\u0F90-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102D-\\u1030\\u1032-\\u1037\\u1039\\u103A\\u103D\\u103E\\u1058\\u1059\\u105E-\\u1060\\u1071-\\u1074\\u1082\\u1085\\u1086\\u108D\\u109D\\u135F\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B7-\\u17BD\\u17C6\\u17C9-\\u17D3\\u17DD\\u180B-\\u180D\\u18A9\\u1920-\\u1922\\u1927\\u1928\\u1932\\u1939-\\u193B\\u1A17\\u1A18\\u1A56\\u1A58-\\u1A5E\\u1A60\\u1A62\\u1A65-\\u1A6C\\u1A73-\\u1A7C\\u1A7F\\u1B00-\\u1B03\\u1B34\\u1B36-\\u1B3A\\u1B3C\\u1B42\\u1B6B-\\u1B73\\u1B80\\u1B81\\u1BA2-\\u1BA5\\u1BA8\\u1BA9\\u1C2C-\\u1C33\\u1C36\\u1C37\\u1CD0-\\u1CD2\\u1CD4-\\u1CE0\\u1CE2-\\u1CE8\\u1CED\\u1DC0-\\u1DE6\\u1DFD-\\u1DFF\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2CEF-\\u2CF1\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA66F\\uA67C\\uA67D\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA825\\uA826\\uA8C4\\uA8E0-\\uA8F1\\uA926-\\uA92D\\uA947-\\uA951\\uA980-\\uA982\\uA9B3\\uA9B6-\\uA9B9\\uA9BC\\uAA29-\\uAA2E\\uAA31\\uAA32\\uAA35\\uAA36\\uAA43\\uAA4C\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uABE5\\uABE8\\uABED\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE26]"), + space_combining_mark: new RegExp("[\\u0903\\u093E-\\u0940\\u0949-\\u094C\\u094E\\u0982\\u0983\\u09BE-\\u09C0\\u09C7\\u09C8\\u09CB\\u09CC\\u09D7\\u0A03\\u0A3E-\\u0A40\\u0A83\\u0ABE-\\u0AC0\\u0AC9\\u0ACB\\u0ACC\\u0B02\\u0B03\\u0B3E\\u0B40\\u0B47\\u0B48\\u0B4B\\u0B4C\\u0B57\\u0BBE\\u0BBF\\u0BC1\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCC\\u0BD7\\u0C01-\\u0C03\\u0C41-\\u0C44\\u0C82\\u0C83\\u0CBE\\u0CC0-\\u0CC4\\u0CC7\\u0CC8\\u0CCA\\u0CCB\\u0CD5\\u0CD6\\u0D02\\u0D03\\u0D3E-\\u0D40\\u0D46-\\u0D48\\u0D4A-\\u0D4C\\u0D57\\u0D82\\u0D83\\u0DCF-\\u0DD1\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0F3E\\u0F3F\\u0F7F\\u102B\\u102C\\u1031\\u1038\\u103B\\u103C\\u1056\\u1057\\u1062-\\u1064\\u1067-\\u106D\\u1083\\u1084\\u1087-\\u108C\\u108F\\u109A-\\u109C\\u17B6\\u17BE-\\u17C5\\u17C7\\u17C8\\u1923-\\u1926\\u1929-\\u192B\\u1930\\u1931\\u1933-\\u1938\\u19B0-\\u19C0\\u19C8\\u19C9\\u1A19-\\u1A1B\\u1A55\\u1A57\\u1A61\\u1A63\\u1A64\\u1A6D-\\u1A72\\u1B04\\u1B35\\u1B3B\\u1B3D-\\u1B41\\u1B43\\u1B44\\u1B82\\u1BA1\\u1BA6\\u1BA7\\u1BAA\\u1C24-\\u1C2B\\u1C34\\u1C35\\u1CE1\\u1CF2\\uA823\\uA824\\uA827\\uA880\\uA881\\uA8B4-\\uA8C3\\uA952\\uA953\\uA983\\uA9B4\\uA9B5\\uA9BA\\uA9BB\\uA9BD-\\uA9C0\\uAA2F\\uAA30\\uAA33\\uAA34\\uAA4D\\uAA7B\\uABE3\\uABE4\\uABE6\\uABE7\\uABE9\\uABEA\\uABEC]"), + connector_punctuation: new RegExp("[\\u005F\\u203F\\u2040\\u2054\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFF3F]") +}; + +function is_letter(ch) { + return UNICODE.letter.test(ch); +}; + +function is_digit(ch) { + ch = ch.charCodeAt(0); + return ch >= 48 && ch <= 57; //XXX: find out if "UnicodeDigit" means something else than 0..9 +}; + +function is_alphanumeric_char(ch) { + return is_digit(ch) || is_letter(ch); +}; + +function is_unicode_combining_mark(ch) { + return UNICODE.non_spacing_mark.test(ch) || UNICODE.space_combining_mark.test(ch); +}; + +function is_unicode_connector_punctuation(ch) { + return UNICODE.connector_punctuation.test(ch); +}; + +function is_identifier_start(ch) { + return ch == "$" || ch == "_" || is_letter(ch); +}; + +function is_identifier_char(ch) { + return is_identifier_start(ch) + || is_unicode_combining_mark(ch) + || is_digit(ch) + || is_unicode_connector_punctuation(ch) + || ch == "\u200c" // zero-width non-joiner + || ch == "\u200d" // zero-width joiner (in my ECMA-262 PDF, this is also 200c) + ; +}; + +function parse_js_number(num) { + if (RE_HEX_NUMBER.test(num)) { + return parseInt(num.substr(2), 16); + } else if (RE_OCT_NUMBER.test(num)) { + return parseInt(num.substr(1), 8); + } else if (RE_DEC_NUMBER.test(num)) { + return parseFloat(num); + } +}; + +function JS_Parse_Error(message, line, col, pos) { + this.message = message; + this.line = line + 1; + this.col = col + 1; + this.pos = pos + 1; + this.stack = new Error().stack; +}; + +JS_Parse_Error.prototype.toString = function() { + return this.message + " (line: " + this.line + ", col: " + this.col + ", pos: " + this.pos + ")" + "\n\n" + this.stack; +}; + +function js_error(message, line, col, pos) { + throw new JS_Parse_Error(message, line, col, pos); +}; + +function is_token(token, type, val) { + return token.type == type && (val == null || token.value == val); +}; + +var EX_EOF = {}; + +function tokenizer($TEXT) { + + var S = { + text : $TEXT.replace(/\r\n?|[\n\u2028\u2029]/g, "\n").replace(/^\uFEFF/, ''), + pos : 0, + tokpos : 0, + line : 0, + tokline : 0, + col : 0, + tokcol : 0, + newline_before : false, + regex_allowed : false, + comments_before : [] + }; + + function peek() { return S.text.charAt(S.pos); }; + + function next(signal_eof, in_string) { + var ch = S.text.charAt(S.pos++); + if (signal_eof && !ch) + throw EX_EOF; + if (ch == "\n") { + S.newline_before = S.newline_before || !in_string; + ++S.line; + S.col = 0; + } else { + ++S.col; + } + return ch; + }; + + function eof() { + return !S.peek(); + }; + + function find(what, signal_eof) { + var pos = S.text.indexOf(what, S.pos); + if (signal_eof && pos == -1) throw EX_EOF; + return pos; + }; + + function start_token() { + S.tokline = S.line; + S.tokcol = S.col; + S.tokpos = S.pos; + }; + + function token(type, value, is_comment) { + S.regex_allowed = ((type == "operator" && !HOP(UNARY_POSTFIX, value)) || + (type == "keyword" && HOP(KEYWORDS_BEFORE_EXPRESSION, value)) || + (type == "punc" && HOP(PUNC_BEFORE_EXPRESSION, value))); + var ret = { + type : type, + value : value, + line : S.tokline, + col : S.tokcol, + pos : S.tokpos, + endpos : S.pos, + nlb : S.newline_before + }; + if (!is_comment) { + ret.comments_before = S.comments_before; + S.comments_before = []; + } + S.newline_before = false; + return ret; + }; + + function skip_whitespace() { + while (HOP(WHITESPACE_CHARS, peek())) + next(); + }; + + function read_while(pred) { + var ret = "", ch = peek(), i = 0; + while (ch && pred(ch, i++)) { + ret += next(); + ch = peek(); + } + return ret; + }; + + function parse_error(err) { + js_error(err, S.tokline, S.tokcol, S.tokpos); + }; + + function read_num(prefix) { + var has_e = false, after_e = false, has_x = false, has_dot = prefix == "."; + var num = read_while(function(ch, i){ + if (ch == "x" || ch == "X") { + if (has_x) return false; + return has_x = true; + } + if (!has_x && (ch == "E" || ch == "e")) { + if (has_e) return false; + return has_e = after_e = true; + } + if (ch == "-") { + if (after_e || (i == 0 && !prefix)) return true; + return false; + } + if (ch == "+") return after_e; + after_e = false; + if (ch == ".") { + if (!has_dot && !has_x) + return has_dot = true; + return false; + } + return is_alphanumeric_char(ch); + }); + if (prefix) + num = prefix + num; + var valid = parse_js_number(num); + if (!isNaN(valid)) { + return token("num", valid); + } else { + parse_error("Invalid syntax: " + num); + } + }; + + function read_escaped_char(in_string) { + var ch = next(true, in_string); + switch (ch) { + case "n" : return "\n"; + case "r" : return "\r"; + case "t" : return "\t"; + case "b" : return "\b"; + case "v" : return "\u000b"; + case "f" : return "\f"; + case "0" : return "\0"; + case "x" : return String.fromCharCode(hex_bytes(2)); + case "u" : return String.fromCharCode(hex_bytes(4)); + case "\n": return ""; + default : return ch; + } + }; + + function hex_bytes(n) { + var num = 0; + for (; n > 0; --n) { + var digit = parseInt(next(true), 16); + if (isNaN(digit)) + parse_error("Invalid hex-character pattern in string"); + num = (num << 4) | digit; + } + return num; + }; + + function read_string() { + return with_eof_error("Unterminated string constant", function(){ + var quote = next(), ret = ""; + for (;;) { + var ch = next(true); + if (ch == "\\") { + // read OctalEscapeSequence (XXX: deprecated if "strict mode") + // https://github.com/mishoo/UglifyJS/issues/178 + var octal_len = 0, first = null; + ch = read_while(function(ch){ + if (ch >= "0" && ch <= "7") { + if (!first) { + first = ch; + return ++octal_len; + } + else if (first <= "3" && octal_len <= 2) return ++octal_len; + else if (first >= "4" && octal_len <= 1) return ++octal_len; + } + return false; + }); + if (octal_len > 0) ch = String.fromCharCode(parseInt(ch, 8)); + else ch = read_escaped_char(true); + } + else if (ch == quote) break; + ret += ch; + } + return token("string", ret); + }); + }; + + function read_line_comment() { + next(); + var i = find("\n"), ret; + if (i == -1) { + ret = S.text.substr(S.pos); + S.pos = S.text.length; + } else { + ret = S.text.substring(S.pos, i); + S.pos = i; + } + return token("comment1", ret, true); + }; + + function read_multiline_comment() { + next(); + return with_eof_error("Unterminated multiline comment", function(){ + var i = find("*/", true), + text = S.text.substring(S.pos, i); + S.pos = i + 2; + S.line += text.split("\n").length - 1; + S.newline_before = text.indexOf("\n") >= 0; + + // https://github.com/mishoo/UglifyJS/issues/#issue/100 + if (/^@cc_on/i.test(text)) { + warn("WARNING: at line " + S.line); + warn("*** Found \"conditional comment\": " + text); + warn("*** UglifyJS DISCARDS ALL COMMENTS. This means your code might no longer work properly in Internet Explorer."); + } + + return token("comment2", text, true); + }); + }; + + function read_name() { + var backslash = false, name = "", ch; + while ((ch = peek()) != null) { + if (!backslash) { + if (ch == "\\") backslash = true, next(); + else if (is_identifier_char(ch)) name += next(); + else break; + } + else { + if (ch != "u") parse_error("Expecting UnicodeEscapeSequence -- uXXXX"); + ch = read_escaped_char(); + if (!is_identifier_char(ch)) parse_error("Unicode char: " + ch.charCodeAt(0) + " is not valid in identifier"); + name += ch; + backslash = false; + } + } + return name; + }; + + function read_regexp(regexp) { + return with_eof_error("Unterminated regular expression", function(){ + var prev_backslash = false, ch, in_class = false; + while ((ch = next(true))) if (prev_backslash) { + regexp += "\\" + ch; + prev_backslash = false; + } else if (ch == "[") { + in_class = true; + regexp += ch; + } else if (ch == "]" && in_class) { + in_class = false; + regexp += ch; + } else if (ch == "/" && !in_class) { + break; + } else if (ch == "\\") { + prev_backslash = true; + } else { + regexp += ch; + } + var mods = read_name(); + return token("regexp", [ regexp, mods ]); + }); + }; + + function read_operator(prefix) { + function grow(op) { + if (!peek()) return op; + var bigger = op + peek(); + if (HOP(OPERATORS, bigger)) { + next(); + return grow(bigger); + } else { + return op; + } + }; + return token("operator", grow(prefix || next())); + }; + + function handle_slash() { + next(); + var regex_allowed = S.regex_allowed; + switch (peek()) { + case "/": + S.comments_before.push(read_line_comment()); + S.regex_allowed = regex_allowed; + return next_token(); + case "*": + S.comments_before.push(read_multiline_comment()); + S.regex_allowed = regex_allowed; + return next_token(); + } + return S.regex_allowed ? read_regexp("") : read_operator("/"); + }; + + function handle_dot() { + next(); + return is_digit(peek()) + ? read_num(".") + : token("punc", "."); + }; + + function read_word() { + var word = read_name(); + return !HOP(KEYWORDS, word) + ? token("name", word) + : HOP(OPERATORS, word) + ? token("operator", word) + : HOP(KEYWORDS_ATOM, word) + ? token("atom", word) + : token("keyword", word); + }; + + function with_eof_error(eof_error, cont) { + try { + return cont(); + } catch(ex) { + if (ex === EX_EOF) parse_error(eof_error); + else throw ex; + } + }; + + function next_token(force_regexp) { + if (force_regexp != null) + return read_regexp(force_regexp); + skip_whitespace(); + start_token(); + var ch = peek(); + if (!ch) return token("eof"); + if (is_digit(ch)) return read_num(); + if (ch == '"' || ch == "'") return read_string(); + if (HOP(PUNC_CHARS, ch)) return token("punc", next()); + if (ch == ".") return handle_dot(); + if (ch == "/") return handle_slash(); + if (HOP(OPERATOR_CHARS, ch)) return read_operator(); + if (ch == "\\" || is_identifier_start(ch)) return read_word(); + parse_error("Unexpected character '" + ch + "'"); + }; + + next_token.context = function(nc) { + if (nc) S = nc; + return S; + }; + + return next_token; + +}; + +/* -----[ Parser (constants) ]----- */ + +var UNARY_PREFIX = array_to_hash([ + "typeof", + "void", + "delete", + "--", + "++", + "!", + "~", + "-", + "+" +]); + +var UNARY_POSTFIX = array_to_hash([ "--", "++" ]); + +var ASSIGNMENT = (function(a, ret, i){ + while (i < a.length) { + ret[a[i]] = a[i].substr(0, a[i].length - 1); + i++; + } + return ret; +})( + ["+=", "-=", "/=", "*=", "%=", ">>=", "<<=", ">>>=", "|=", "^=", "&="], + { "=": true }, + 0 +); + +var PRECEDENCE = (function(a, ret){ + for (var i = 0, n = 1; i < a.length; ++i, ++n) { + var b = a[i]; + for (var j = 0; j < b.length; ++j) { + ret[b[j]] = n; + } + } + return ret; +})( + [ + ["||"], + ["&&"], + ["|"], + ["^"], + ["&"], + ["==", "===", "!=", "!=="], + ["<", ">", "<=", ">=", "in", "instanceof"], + [">>", "<<", ">>>"], + ["+", "-"], + ["*", "/", "%"] + ], + {} +); + +var STATEMENTS_WITH_LABELS = array_to_hash([ "for", "do", "while", "switch" ]); + +var ATOMIC_START_TOKEN = array_to_hash([ "atom", "num", "string", "regexp", "name" ]); + +/* -----[ Parser ]----- */ + +function NodeWithToken(str, start, end) { + this.name = str; + this.start = start; + this.end = end; +}; + +NodeWithToken.prototype.toString = function() { return this.name; }; + +function parse($TEXT, exigent_mode, embed_tokens) { + + var S = { + input : typeof $TEXT == "string" ? tokenizer($TEXT, true) : $TEXT, + token : null, + prev : null, + peeked : null, + in_function : 0, + in_loop : 0, + labels : [] + }; + + S.token = next(); + + function is(type, value) { + return is_token(S.token, type, value); + }; + + function peek() { return S.peeked || (S.peeked = S.input()); }; + + function next() { + S.prev = S.token; + if (S.peeked) { + S.token = S.peeked; + S.peeked = null; + } else { + S.token = S.input(); + } + return S.token; + }; + + function prev() { + return S.prev; + }; + + function croak(msg, line, col, pos) { + var ctx = S.input.context(); + js_error(msg, + line != null ? line : ctx.tokline, + col != null ? col : ctx.tokcol, + pos != null ? pos : ctx.tokpos); + }; + + function token_error(token, msg) { + croak(msg, token.line, token.col); + }; + + function unexpected(token) { + if (token == null) + token = S.token; + token_error(token, "Unexpected token: " + token.type + " (" + token.value + ")"); + }; + + function expect_token(type, val) { + if (is(type, val)) { + return next(); + } + token_error(S.token, "Unexpected token " + S.token.type + ", expected " + type); + }; + + function expect(punc) { return expect_token("punc", punc); }; + + function can_insert_semicolon() { + return !exigent_mode && ( + S.token.nlb || is("eof") || is("punc", "}") + ); + }; + + function semicolon() { + if (is("punc", ";")) next(); + else if (!can_insert_semicolon()) unexpected(); + }; + + function as() { + return slice(arguments); + }; + + function parenthesised() { + expect("("); + var ex = expression(); + expect(")"); + return ex; + }; + + function add_tokens(str, start, end) { + return str instanceof NodeWithToken ? str : new NodeWithToken(str, start, end); + }; + + function maybe_embed_tokens(parser) { + if (embed_tokens) return function() { + var start = S.token; + var ast = parser.apply(this, arguments); + ast[0] = add_tokens(ast[0], start, prev()); + return ast; + }; + else return parser; + }; + + var statement = maybe_embed_tokens(function() { + if (is("operator", "/") || is("operator", "/=")) { + S.peeked = null; + S.token = S.input(S.token.value.substr(1)); // force regexp + } + switch (S.token.type) { + case "num": + case "string": + case "regexp": + case "operator": + case "atom": + return simple_statement(); + + case "name": + return is_token(peek(), "punc", ":") + ? labeled_statement(prog1(S.token.value, next, next)) + : simple_statement(); + + case "punc": + switch (S.token.value) { + case "{": + return as("block", block_()); + case "[": + case "(": + return simple_statement(); + case ";": + next(); + return as("block"); + default: + unexpected(); + } + + case "keyword": + switch (prog1(S.token.value, next)) { + case "break": + return break_cont("break"); + + case "continue": + return break_cont("continue"); + + case "debugger": + semicolon(); + return as("debugger"); + + case "do": + return (function(body){ + expect_token("keyword", "while"); + return as("do", prog1(parenthesised, semicolon), body); + })(in_loop(statement)); + + case "for": + return for_(); + + case "function": + return function_(true); + + case "if": + return if_(); + + case "return": + if (S.in_function == 0) + croak("'return' outside of function"); + return as("return", + is("punc", ";") + ? (next(), null) + : can_insert_semicolon() + ? null + : prog1(expression, semicolon)); + + case "switch": + return as("switch", parenthesised(), switch_block_()); + + case "throw": + if (S.token.nlb) + croak("Illegal newline after 'throw'"); + return as("throw", prog1(expression, semicolon)); + + case "try": + return try_(); + + case "var": + return prog1(var_, semicolon); + + case "const": + return prog1(const_, semicolon); + + case "while": + return as("while", parenthesised(), in_loop(statement)); + + case "with": + return as("with", parenthesised(), statement()); + + default: + unexpected(); + } + } + }); + + function labeled_statement(label) { + S.labels.push(label); + var start = S.token, stat = statement(); + if (exigent_mode && !HOP(STATEMENTS_WITH_LABELS, stat[0])) + unexpected(start); + S.labels.pop(); + return as("label", label, stat); + }; + + function simple_statement() { + return as("stat", prog1(expression, semicolon)); + }; + + function break_cont(type) { + var name; + if (!can_insert_semicolon()) { + name = is("name") ? S.token.value : null; + } + if (name != null) { + next(); + if (!member(name, S.labels)) + croak("Label " + name + " without matching loop or statement"); + } + else if (S.in_loop == 0) + croak(type + " not inside a loop or switch"); + semicolon(); + return as(type, name); + }; + + function for_() { + expect("("); + var init = null; + if (!is("punc", ";")) { + init = is("keyword", "var") + ? (next(), var_(true)) + : expression(true, true); + if (is("operator", "in")) { + if (init[0] == "var" && init[1].length > 1) + croak("Only one variable declaration allowed in for..in loop"); + return for_in(init); + } + } + return regular_for(init); + }; + + function regular_for(init) { + expect(";"); + var test = is("punc", ";") ? null : expression(); + expect(";"); + var step = is("punc", ")") ? null : expression(); + expect(")"); + return as("for", init, test, step, in_loop(statement)); + }; + + function for_in(init) { + var lhs = init[0] == "var" ? as("name", init[1][0]) : init; + next(); + var obj = expression(); + expect(")"); + return as("for-in", init, lhs, obj, in_loop(statement)); + }; + + var function_ = function(in_statement) { + var name = is("name") ? prog1(S.token.value, next) : null; + if (in_statement && !name) + unexpected(); + expect("("); + return as(in_statement ? "defun" : "function", + name, + // arguments + (function(first, a){ + while (!is("punc", ")")) { + if (first) first = false; else expect(","); + if (!is("name")) unexpected(); + a.push(S.token.value); + next(); + } + next(); + return a; + })(true, []), + // body + (function(){ + ++S.in_function; + var loop = S.in_loop; + S.in_loop = 0; + var a = block_(); + --S.in_function; + S.in_loop = loop; + return a; + })()); + }; + + function if_() { + var cond = parenthesised(), body = statement(), belse; + if (is("keyword", "else")) { + next(); + belse = statement(); + } + return as("if", cond, body, belse); + }; + + function block_() { + expect("{"); + var a = []; + while (!is("punc", "}")) { + if (is("eof")) unexpected(); + a.push(statement()); + } + next(); + return a; + }; + + var switch_block_ = curry(in_loop, function(){ + expect("{"); + var a = [], cur = null; + while (!is("punc", "}")) { + if (is("eof")) unexpected(); + if (is("keyword", "case")) { + next(); + cur = []; + a.push([ expression(), cur ]); + expect(":"); + } + else if (is("keyword", "default")) { + next(); + expect(":"); + cur = []; + a.push([ null, cur ]); + } + else { + if (!cur) unexpected(); + cur.push(statement()); + } + } + next(); + return a; + }); + + function try_() { + var body = block_(), bcatch, bfinally; + if (is("keyword", "catch")) { + next(); + expect("("); + if (!is("name")) + croak("Name expected"); + var name = S.token.value; + next(); + expect(")"); + bcatch = [ name, block_() ]; + } + if (is("keyword", "finally")) { + next(); + bfinally = block_(); + } + if (!bcatch && !bfinally) + croak("Missing catch/finally blocks"); + return as("try", body, bcatch, bfinally); + }; + + function vardefs(no_in) { + var a = []; + for (;;) { + if (!is("name")) + unexpected(); + var name = S.token.value; + next(); + if (is("operator", "=")) { + next(); + a.push([ name, expression(false, no_in) ]); + } else { + a.push([ name ]); + } + if (!is("punc", ",")) + break; + next(); + } + return a; + }; + + function var_(no_in) { + return as("var", vardefs(no_in)); + }; + + function const_() { + return as("const", vardefs()); + }; + + function new_() { + var newexp = expr_atom(false), args; + if (is("punc", "(")) { + next(); + args = expr_list(")"); + } else { + args = []; + } + return subscripts(as("new", newexp, args), true); + }; + + var expr_atom = maybe_embed_tokens(function(allow_calls) { + if (is("operator", "new")) { + next(); + return new_(); + } + if (is("punc")) { + switch (S.token.value) { + case "(": + next(); + return subscripts(prog1(expression, curry(expect, ")")), allow_calls); + case "[": + next(); + return subscripts(array_(), allow_calls); + case "{": + next(); + return subscripts(object_(), allow_calls); + } + unexpected(); + } + if (is("keyword", "function")) { + next(); + return subscripts(function_(false), allow_calls); + } + if (HOP(ATOMIC_START_TOKEN, S.token.type)) { + var atom = S.token.type == "regexp" + ? as("regexp", S.token.value[0], S.token.value[1]) + : as(S.token.type, S.token.value); + return subscripts(prog1(atom, next), allow_calls); + } + unexpected(); + }); + + function expr_list(closing, allow_trailing_comma, allow_empty) { + var first = true, a = []; + while (!is("punc", closing)) { + if (first) first = false; else expect(","); + if (allow_trailing_comma && is("punc", closing)) break; + if (is("punc", ",") && allow_empty) { + a.push([ "atom", "undefined" ]); + } else { + a.push(expression(false)); + } + } + next(); + return a; + }; + + function array_() { + return as("array", expr_list("]", !exigent_mode, true)); + }; + + function object_() { + var first = true, a = []; + while (!is("punc", "}")) { + if (first) first = false; else expect(","); + if (!exigent_mode && is("punc", "}")) + // allow trailing comma + break; + var type = S.token.type; + var name = as_property_name(); + if (type == "name" && (name == "get" || name == "set") && !is("punc", ":")) { + a.push([ as_name(), function_(false), name ]); + } else { + expect(":"); + a.push([ name, expression(false) ]); + } + } + next(); + return as("object", a); + }; + + function as_property_name() { + switch (S.token.type) { + case "num": + case "string": + return prog1(S.token.value, next); + } + return as_name(); + }; + + function as_name() { + switch (S.token.type) { + case "name": + case "operator": + case "keyword": + case "atom": + return prog1(S.token.value, next); + default: + unexpected(); + } + }; + + function subscripts(expr, allow_calls) { + if (is("punc", ".")) { + next(); + return subscripts(as("dot", expr, as_name()), allow_calls); + } + if (is("punc", "[")) { + next(); + return subscripts(as("sub", expr, prog1(expression, curry(expect, "]"))), allow_calls); + } + if (allow_calls && is("punc", "(")) { + next(); + return subscripts(as("call", expr, expr_list(")")), true); + } + return expr; + }; + + function maybe_unary(allow_calls) { + if (is("operator") && HOP(UNARY_PREFIX, S.token.value)) { + return make_unary("unary-prefix", + prog1(S.token.value, next), + maybe_unary(allow_calls)); + } + var val = expr_atom(allow_calls); + while (is("operator") && HOP(UNARY_POSTFIX, S.token.value) && !S.token.nlb) { + val = make_unary("unary-postfix", S.token.value, val); + next(); + } + return val; + }; + + function make_unary(tag, op, expr) { + if ((op == "++" || op == "--") && !is_assignable(expr)) + croak("Invalid use of " + op + " operator"); + return as(tag, op, expr); + }; + + function expr_op(left, min_prec, no_in) { + var op = is("operator") ? S.token.value : null; + if (op && op == "in" && no_in) op = null; + var prec = op != null ? PRECEDENCE[op] : null; + if (prec != null && prec > min_prec) { + next(); + var right = expr_op(maybe_unary(true), prec, no_in); + return expr_op(as("binary", op, left, right), min_prec, no_in); + } + return left; + }; + + function expr_ops(no_in) { + return expr_op(maybe_unary(true), 0, no_in); + }; + + function maybe_conditional(no_in) { + var expr = expr_ops(no_in); + if (is("operator", "?")) { + next(); + var yes = expression(false); + expect(":"); + return as("conditional", expr, yes, expression(false, no_in)); + } + return expr; + }; + + function is_assignable(expr) { + if (!exigent_mode) return true; + switch (expr[0]+"") { + case "dot": + case "sub": + case "new": + case "call": + return true; + case "name": + return expr[1] != "this"; + } + }; + + function maybe_assign(no_in) { + var left = maybe_conditional(no_in), val = S.token.value; + if (is("operator") && HOP(ASSIGNMENT, val)) { + if (is_assignable(left)) { + next(); + return as("assign", ASSIGNMENT[val], left, maybe_assign(no_in)); + } + croak("Invalid assignment"); + } + return left; + }; + + var expression = maybe_embed_tokens(function(commas, no_in) { + if (arguments.length == 0) + commas = true; + var expr = maybe_assign(no_in); + if (commas && is("punc", ",")) { + next(); + return as("seq", expr, expression(true, no_in)); + } + return expr; + }); + + function in_loop(cont) { + try { + ++S.in_loop; + return cont(); + } finally { + --S.in_loop; + } + }; + + return as("toplevel", (function(a){ + while (!is("eof")) + a.push(statement()); + return a; + })([])); + +}; + +/* -----[ Utilities ]----- */ + +function curry(f) { + var args = slice(arguments, 1); + return function() { return f.apply(this, args.concat(slice(arguments))); }; +}; + +function prog1(ret) { + if (ret instanceof Function) + ret = ret(); + for (var i = 1, n = arguments.length; --n > 0; ++i) + arguments[i](); + return ret; +}; + +function array_to_hash(a) { + var ret = {}; + for (var i = 0; i < a.length; ++i) + ret[a[i]] = true; + return ret; +}; + +function slice(a, start) { + return Array.prototype.slice.call(a, start || 0); +}; + +function characters(str) { + return str.split(""); +}; + +function member(name, array) { + for (var i = array.length; --i >= 0;) + if (array[i] == name) + return true; + return false; +}; + +function HOP(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +}; + +var warn = function() {}; + +/* -----[ Exports ]----- */ + +exports.tokenizer = tokenizer; +exports.parse = parse; +exports.slice = slice; +exports.curry = curry; +exports.member = member; +exports.array_to_hash = array_to_hash; +exports.PRECEDENCE = PRECEDENCE; +exports.KEYWORDS_ATOM = KEYWORDS_ATOM; +exports.RESERVED_WORDS = RESERVED_WORDS; +exports.KEYWORDS = KEYWORDS; +exports.ATOMIC_START_TOKEN = ATOMIC_START_TOKEN; +exports.OPERATORS = OPERATORS; +exports.is_alphanumeric_char = is_alphanumeric_char; +exports.set_logger = function(logger) { + warn = logger; +}; diff --git a/build-tools/lib/uglifyjs/process.js b/build-tools/lib/uglifyjs/process.js new file mode 100644 index 0000000..050d28b --- /dev/null +++ b/build-tools/lib/uglifyjs/process.js @@ -0,0 +1,2009 @@ +/*********************************************************************** + + A JavaScript tokenizer / parser / beautifier / compressor. + + This version is suitable for Node.js. With minimal changes (the + exports stuff) it should work on any JS platform. + + This file implements some AST processors. They work on data built + by parse-js. + + Exported functions: + + - ast_mangle(ast, options) -- mangles the variable/function names + in the AST. Returns an AST. + + - ast_squeeze(ast) -- employs various optimizations to make the + final generated code even smaller. Returns an AST. + + - gen_code(ast, options) -- generates JS code from the AST. Pass + true (or an object, see the code for some options) as second + argument to get "pretty" (indented) code. + + -------------------------------- (C) --------------------------------- + + Author: Mihai Bazon + + http://mihai.bazon.net/blog + + Distributed under the BSD license: + + Copyright 2010 (c) Mihai Bazon + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above + copyright notice, this list of conditions and the following + disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF + THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + + ***********************************************************************/ + +var jsp = require("./parse-js"), + slice = jsp.slice, + member = jsp.member, + PRECEDENCE = jsp.PRECEDENCE, + OPERATORS = jsp.OPERATORS; + +/* -----[ helper for AST traversal ]----- */ + +function ast_walker() { + function _vardefs(defs) { + return [ this[0], MAP(defs, function(def){ + var a = [ def[0] ]; + if (def.length > 1) + a[1] = walk(def[1]); + return a; + }) ]; + }; + function _block(statements) { + var out = [ this[0] ]; + if (statements != null) + out.push(MAP(statements, walk)); + return out; + }; + var walkers = { + "string": function(str) { + return [ this[0], str ]; + }, + "num": function(num) { + return [ this[0], num ]; + }, + "name": function(name) { + return [ this[0], name ]; + }, + "toplevel": function(statements) { + return [ this[0], MAP(statements, walk) ]; + }, + "block": _block, + "splice": _block, + "var": _vardefs, + "const": _vardefs, + "try": function(t, c, f) { + return [ + this[0], + MAP(t, walk), + c != null ? [ c[0], MAP(c[1], walk) ] : null, + f != null ? MAP(f, walk) : null + ]; + }, + "throw": function(expr) { + return [ this[0], walk(expr) ]; + }, + "new": function(ctor, args) { + return [ this[0], walk(ctor), MAP(args, walk) ]; + }, + "switch": function(expr, body) { + return [ this[0], walk(expr), MAP(body, function(branch){ + return [ branch[0] ? walk(branch[0]) : null, + MAP(branch[1], walk) ]; + }) ]; + }, + "break": function(label) { + return [ this[0], label ]; + }, + "continue": function(label) { + return [ this[0], label ]; + }, + "conditional": function(cond, t, e) { + return [ this[0], walk(cond), walk(t), walk(e) ]; + }, + "assign": function(op, lvalue, rvalue) { + return [ this[0], op, walk(lvalue), walk(rvalue) ]; + }, + "dot": function(expr) { + return [ this[0], walk(expr) ].concat(slice(arguments, 1)); + }, + "call": function(expr, args) { + return [ this[0], walk(expr), MAP(args, walk) ]; + }, + "function": function(name, args, body) { + return [ this[0], name, args.slice(), MAP(body, walk) ]; + }, + "debugger": function() { + return [ this[0] ]; + }, + "defun": function(name, args, body) { + return [ this[0], name, args.slice(), MAP(body, walk) ]; + }, + "if": function(conditional, t, e) { + return [ this[0], walk(conditional), walk(t), walk(e) ]; + }, + "for": function(init, cond, step, block) { + return [ this[0], walk(init), walk(cond), walk(step), walk(block) ]; + }, + "for-in": function(vvar, key, hash, block) { + return [ this[0], walk(vvar), walk(key), walk(hash), walk(block) ]; + }, + "while": function(cond, block) { + return [ this[0], walk(cond), walk(block) ]; + }, + "do": function(cond, block) { + return [ this[0], walk(cond), walk(block) ]; + }, + "return": function(expr) { + return [ this[0], walk(expr) ]; + }, + "binary": function(op, left, right) { + return [ this[0], op, walk(left), walk(right) ]; + }, + "unary-prefix": function(op, expr) { + return [ this[0], op, walk(expr) ]; + }, + "unary-postfix": function(op, expr) { + return [ this[0], op, walk(expr) ]; + }, + "sub": function(expr, subscript) { + return [ this[0], walk(expr), walk(subscript) ]; + }, + "object": function(props) { + return [ this[0], MAP(props, function(p){ + return p.length == 2 + ? [ p[0], walk(p[1]) ] + : [ p[0], walk(p[1]), p[2] ]; // get/set-ter + }) ]; + }, + "regexp": function(rx, mods) { + return [ this[0], rx, mods ]; + }, + "array": function(elements) { + return [ this[0], MAP(elements, walk) ]; + }, + "stat": function(stat) { + return [ this[0], walk(stat) ]; + }, + "seq": function() { + return [ this[0] ].concat(MAP(slice(arguments), walk)); + }, + "label": function(name, block) { + return [ this[0], name, walk(block) ]; + }, + "with": function(expr, block) { + return [ this[0], walk(expr), walk(block) ]; + }, + "atom": function(name) { + return [ this[0], name ]; + } + }; + + var user = {}; + var stack = []; + function walk(ast) { + if (ast == null) + return null; + try { + stack.push(ast); + var type = ast[0]; + var gen = user[type]; + if (gen) { + var ret = gen.apply(ast, ast.slice(1)); + if (ret != null) + return ret; + } + gen = walkers[type]; + return gen.apply(ast, ast.slice(1)); + } finally { + stack.pop(); + } + }; + + function dive(ast) { + if (ast == null) + return null; + try { + stack.push(ast); + return walkers[ast[0]].apply(ast, ast.slice(1)); + } finally { + stack.pop(); + } + }; + + function with_walkers(walkers, cont){ + var save = {}, i; + for (i in walkers) if (HOP(walkers, i)) { + save[i] = user[i]; + user[i] = walkers[i]; + } + var ret = cont(); + for (i in save) if (HOP(save, i)) { + if (!save[i]) delete user[i]; + else user[i] = save[i]; + } + return ret; + }; + + return { + walk: walk, + dive: dive, + with_walkers: with_walkers, + parent: function() { + return stack[stack.length - 2]; // last one is current node + }, + stack: function() { + return stack; + } + }; +}; + +/* -----[ Scope and mangling ]----- */ + +function Scope(parent) { + this.names = {}; // names defined in this scope + this.mangled = {}; // mangled names (orig.name => mangled) + this.rev_mangled = {}; // reverse lookup (mangled => orig.name) + this.cname = -1; // current mangled name + this.refs = {}; // names referenced from this scope + this.uses_with = false; // will become TRUE if with() is detected in this or any subscopes + this.uses_eval = false; // will become TRUE if eval() is detected in this or any subscopes + this.parent = parent; // parent scope + this.children = []; // sub-scopes + if (parent) { + this.level = parent.level + 1; + parent.children.push(this); + } else { + this.level = 0; + } +}; + +var base54 = (function(){ + var DIGITS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_"; + return function(num) { + var ret = ""; + do { + ret = DIGITS.charAt(num % 54) + ret; + num = Math.floor(num / 54); + } while (num > 0); + return ret; + }; +})(); + +Scope.prototype = { + has: function(name) { + for (var s = this; s; s = s.parent) + if (HOP(s.names, name)) + return s; + }, + has_mangled: function(mname) { + for (var s = this; s; s = s.parent) + if (HOP(s.rev_mangled, mname)) + return s; + }, + toJSON: function() { + return { + names: this.names, + uses_eval: this.uses_eval, + uses_with: this.uses_with + }; + }, + + next_mangled: function() { + // we must be careful that the new mangled name: + // + // 1. doesn't shadow a mangled name from a parent + // scope, unless we don't reference the original + // name from this scope OR from any sub-scopes! + // This will get slow. + // + // 2. doesn't shadow an original name from a parent + // scope, in the event that the name is not mangled + // in the parent scope and we reference that name + // here OR IN ANY SUBSCOPES! + // + // 3. doesn't shadow a name that is referenced but not + // defined (possibly global defined elsewhere). + for (;;) { + var m = base54(++this.cname), prior; + + // case 1. + prior = this.has_mangled(m); + if (prior && this.refs[prior.rev_mangled[m]] === prior) + continue; + + // case 2. + prior = this.has(m); + if (prior && prior !== this && this.refs[m] === prior && !prior.has_mangled(m)) + continue; + + // case 3. + if (HOP(this.refs, m) && this.refs[m] == null) + continue; + + // I got "do" once. :-/ + if (!is_identifier(m)) + continue; + + return m; + } + }, + set_mangle: function(name, m) { + this.rev_mangled[m] = name; + return this.mangled[name] = m; + }, + get_mangled: function(name, newMangle) { + if (this.uses_eval || this.uses_with) return name; // no mangle if eval or with is in use + var s = this.has(name); + if (!s) return name; // not in visible scope, no mangle + if (HOP(s.mangled, name)) return s.mangled[name]; // already mangled in this scope + if (!newMangle) return name; // not found and no mangling requested + return s.set_mangle(name, s.next_mangled()); + }, + references: function(name) { + return name && !this.parent || this.uses_with || this.uses_eval || this.refs[name]; + }, + define: function(name, type) { + if (name != null) { + if (type == "var" || !HOP(this.names, name)) + this.names[name] = type || "var"; + return name; + } + } +}; + +function ast_add_scope(ast) { + + var current_scope = null; + var w = ast_walker(), walk = w.walk; + var having_eval = []; + + function with_new_scope(cont) { + current_scope = new Scope(current_scope); + current_scope.labels = new Scope(); + var ret = current_scope.body = cont(); + ret.scope = current_scope; + current_scope = current_scope.parent; + return ret; + }; + + function define(name, type) { + return current_scope.define(name, type); + }; + + function reference(name) { + current_scope.refs[name] = true; + }; + + function _lambda(name, args, body) { + var is_defun = this[0] == "defun"; + return [ this[0], is_defun ? define(name, "defun") : name, args, with_new_scope(function(){ + if (!is_defun) define(name, "lambda"); + MAP(args, function(name){ define(name, "arg") }); + return MAP(body, walk); + })]; + }; + + function _vardefs(type) { + return function(defs) { + MAP(defs, function(d){ + define(d[0], type); + if (d[1]) reference(d[0]); + }); + }; + }; + + function _breacont(label) { + if (label) + current_scope.labels.refs[label] = true; + }; + + return with_new_scope(function(){ + // process AST + var ret = w.with_walkers({ + "function": _lambda, + "defun": _lambda, + "label": function(name, stat) { current_scope.labels.define(name) }, + "break": _breacont, + "continue": _breacont, + "with": function(expr, block) { + for (var s = current_scope; s; s = s.parent) + s.uses_with = true; + }, + "var": _vardefs("var"), + "const": _vardefs("const"), + "try": function(t, c, f) { + if (c != null) return [ + this[0], + MAP(t, walk), + [ define(c[0], "catch"), MAP(c[1], walk) ], + f != null ? MAP(f, walk) : null + ]; + }, + "name": function(name) { + if (name == "eval") + having_eval.push(current_scope); + reference(name); + } + }, function(){ + return walk(ast); + }); + + // the reason why we need an additional pass here is + // that names can be used prior to their definition. + + // scopes where eval was detected and their parents + // are marked with uses_eval, unless they define the + // "eval" name. + MAP(having_eval, function(scope){ + if (!scope.has("eval")) while (scope) { + scope.uses_eval = true; + scope = scope.parent; + } + }); + + // for referenced names it might be useful to know + // their origin scope. current_scope here is the + // toplevel one. + function fixrefs(scope, i) { + // do children first; order shouldn't matter + for (i = scope.children.length; --i >= 0;) + fixrefs(scope.children[i]); + for (i in scope.refs) if (HOP(scope.refs, i)) { + // find origin scope and propagate the reference to origin + for (var origin = scope.has(i), s = scope; s; s = s.parent) { + s.refs[i] = origin; + if (s === origin) break; + } + } + }; + fixrefs(current_scope); + + return ret; + }); + +}; + +/* -----[ mangle names ]----- */ + +function ast_mangle(ast, options) { + var w = ast_walker(), walk = w.walk, scope; + options = options || {}; + + function get_mangled(name, newMangle) { + if (!options.toplevel && !scope.parent) return name; // don't mangle toplevel + if (options.except && member(name, options.except)) + return name; + return scope.get_mangled(name, newMangle); + }; + + function get_define(name) { + if (options.defines) { + // we always lookup a defined symbol for the current scope FIRST, so declared + // vars trump a DEFINE symbol, but if no such var is found, then match a DEFINE value + if (!scope.has(name)) { + if (HOP(options.defines, name)) { + return options.defines[name]; + } + } + return null; + } + }; + + function _lambda(name, args, body) { + if (!options.no_functions) { + var is_defun = this[0] == "defun", extra; + if (name) { + if (is_defun) name = get_mangled(name); + else if (body.scope.references(name)) { + extra = {}; + if (!(scope.uses_eval || scope.uses_with)) + name = extra[name] = scope.next_mangled(); + else + extra[name] = name; + } + else name = null; + } + } + body = with_scope(body.scope, function(){ + args = MAP(args, function(name){ return get_mangled(name) }); + return MAP(body, walk); + }, extra); + return [ this[0], name, args, body ]; + }; + + function with_scope(s, cont, extra) { + var _scope = scope; + scope = s; + if (extra) for (var i in extra) if (HOP(extra, i)) { + s.set_mangle(i, extra[i]); + } + for (var i in s.names) if (HOP(s.names, i)) { + get_mangled(i, true); + } + var ret = cont(); + ret.scope = s; + scope = _scope; + return ret; + }; + + function _vardefs(defs) { + return [ this[0], MAP(defs, function(d){ + return [ get_mangled(d[0]), walk(d[1]) ]; + }) ]; + }; + + function _breacont(label) { + if (label) return [ this[0], scope.labels.get_mangled(label) ]; + }; + + return w.with_walkers({ + "function": _lambda, + "defun": function() { + // move function declarations to the top when + // they are not in some block. + var ast = _lambda.apply(this, arguments); + switch (w.parent()[0]) { + case "toplevel": + case "function": + case "defun": + return MAP.at_top(ast); + } + return ast; + }, + "label": function(label, stat) { + if (scope.labels.refs[label]) return [ + this[0], + scope.labels.get_mangled(label, true), + walk(stat) + ]; + return walk(stat); + }, + "break": _breacont, + "continue": _breacont, + "var": _vardefs, + "const": _vardefs, + "name": function(name) { + return get_define(name) || [ this[0], get_mangled(name) ]; + }, + "try": function(t, c, f) { + return [ this[0], + MAP(t, walk), + c != null ? [ get_mangled(c[0]), MAP(c[1], walk) ] : null, + f != null ? MAP(f, walk) : null ]; + }, + "toplevel": function(body) { + var self = this; + return with_scope(self.scope, function(){ + return [ self[0], MAP(body, walk) ]; + }); + } + }, function() { + return walk(ast_add_scope(ast)); + }); +}; + +/* -----[ + - compress foo["bar"] into foo.bar, + - remove block brackets {} where possible + - join consecutive var declarations + - various optimizations for IFs: + - if (cond) foo(); else bar(); ==> cond?foo():bar(); + - if (cond) foo(); ==> cond&&foo(); + - if (foo) return bar(); else return baz(); ==> return foo?bar():baz(); // also for throw + - if (foo) return bar(); else something(); ==> {if(foo)return bar();something()} + ]----- */ + +var warn = function(){}; + +function best_of(ast1, ast2) { + return gen_code(ast1).length > gen_code(ast2[0] == "stat" ? ast2[1] : ast2).length ? ast2 : ast1; +}; + +function last_stat(b) { + if (b[0] == "block" && b[1] && b[1].length > 0) + return b[1][b[1].length - 1]; + return b; +} + +function aborts(t) { + if (t) switch (last_stat(t)[0]) { + case "return": + case "break": + case "continue": + case "throw": + return true; + } +}; + +function boolean_expr(expr) { + return ( (expr[0] == "unary-prefix" + && member(expr[1], [ "!", "delete" ])) || + + (expr[0] == "binary" + && member(expr[1], [ "in", "instanceof", "==", "!=", "===", "!==", "<", "<=", ">=", ">" ])) || + + (expr[0] == "binary" + && member(expr[1], [ "&&", "||" ]) + && boolean_expr(expr[2]) + && boolean_expr(expr[3])) || + + (expr[0] == "conditional" + && boolean_expr(expr[2]) + && boolean_expr(expr[3])) || + + (expr[0] == "assign" + && expr[1] === true + && boolean_expr(expr[3])) || + + (expr[0] == "seq" + && boolean_expr(expr[expr.length - 1])) + ); +}; + +function empty(b) { + return !b || (b[0] == "block" && (!b[1] || b[1].length == 0)); +}; + +function is_string(node) { + return (node[0] == "string" || + node[0] == "unary-prefix" && node[1] == "typeof" || + node[0] == "binary" && node[1] == "+" && + (is_string(node[2]) || is_string(node[3]))); +}; + +var when_constant = (function(){ + + var $NOT_CONSTANT = {}; + + // this can only evaluate constant expressions. If it finds anything + // not constant, it throws $NOT_CONSTANT. + function evaluate(expr) { + switch (expr[0]) { + case "string": + case "num": + return expr[1]; + case "name": + case "atom": + switch (expr[1]) { + case "true": return true; + case "false": return false; + case "null": return null; + } + break; + case "unary-prefix": + switch (expr[1]) { + case "!": return !evaluate(expr[2]); + case "typeof": return typeof evaluate(expr[2]); + case "~": return ~evaluate(expr[2]); + case "-": return -evaluate(expr[2]); + case "+": return +evaluate(expr[2]); + } + break; + case "binary": + var left = expr[2], right = expr[3]; + switch (expr[1]) { + case "&&" : return evaluate(left) && evaluate(right); + case "||" : return evaluate(left) || evaluate(right); + case "|" : return evaluate(left) | evaluate(right); + case "&" : return evaluate(left) & evaluate(right); + case "^" : return evaluate(left) ^ evaluate(right); + case "+" : return evaluate(left) + evaluate(right); + case "*" : return evaluate(left) * evaluate(right); + case "/" : return evaluate(left) / evaluate(right); + case "%" : return evaluate(left) % evaluate(right); + case "-" : return evaluate(left) - evaluate(right); + case "<<" : return evaluate(left) << evaluate(right); + case ">>" : return evaluate(left) >> evaluate(right); + case ">>>" : return evaluate(left) >>> evaluate(right); + case "==" : return evaluate(left) == evaluate(right); + case "===" : return evaluate(left) === evaluate(right); + case "!=" : return evaluate(left) != evaluate(right); + case "!==" : return evaluate(left) !== evaluate(right); + case "<" : return evaluate(left) < evaluate(right); + case "<=" : return evaluate(left) <= evaluate(right); + case ">" : return evaluate(left) > evaluate(right); + case ">=" : return evaluate(left) >= evaluate(right); + case "in" : return evaluate(left) in evaluate(right); + case "instanceof" : return evaluate(left) instanceof evaluate(right); + } + } + throw $NOT_CONSTANT; + }; + + return function(expr, yes, no) { + try { + var val = evaluate(expr), ast; + switch (typeof val) { + case "string": ast = [ "string", val ]; break; + case "number": ast = [ "num", val ]; break; + case "boolean": ast = [ "name", String(val) ]; break; + default: throw new Error("Can't handle constant of type: " + (typeof val)); + } + return yes.call(expr, ast, val); + } catch(ex) { + if (ex === $NOT_CONSTANT) { + if (expr[0] == "binary" + && (expr[1] == "===" || expr[1] == "!==") + && ((is_string(expr[2]) && is_string(expr[3])) + || (boolean_expr(expr[2]) && boolean_expr(expr[3])))) { + expr[1] = expr[1].substr(0, 2); + } + else if (no && expr[0] == "binary" + && (expr[1] == "||" || expr[1] == "&&")) { + // the whole expression is not constant but the lval may be... + try { + var lval = evaluate(expr[2]); + expr = ((expr[1] == "&&" && (lval ? expr[3] : lval)) || + (expr[1] == "||" && (lval ? lval : expr[3])) || + expr); + } catch(ex2) { + // IGNORE... lval is not constant + } + } + return no ? no.call(expr, expr) : null; + } + else throw ex; + } + }; + +})(); + +function warn_unreachable(ast) { + if (!empty(ast)) + warn("Dropping unreachable code: " + gen_code(ast, true)); +}; + +function prepare_ifs(ast) { + var w = ast_walker(), walk = w.walk; + // In this first pass, we rewrite ifs which abort with no else with an + // if-else. For example: + // + // if (x) { + // blah(); + // return y; + // } + // foobar(); + // + // is rewritten into: + // + // if (x) { + // blah(); + // return y; + // } else { + // foobar(); + // } + function redo_if(statements) { + statements = MAP(statements, walk); + + for (var i = 0; i < statements.length; ++i) { + var fi = statements[i]; + if (fi[0] != "if") continue; + + if (fi[3] && walk(fi[3])) continue; + + var t = walk(fi[2]); + if (!aborts(t)) continue; + + var conditional = walk(fi[1]); + + var e_body = redo_if(statements.slice(i + 1)); + var e = e_body.length == 1 ? e_body[0] : [ "block", e_body ]; + + return statements.slice(0, i).concat([ [ + fi[0], // "if" + conditional, // conditional + t, // then + e // else + ] ]); + } + + return statements; + }; + + function redo_if_lambda(name, args, body) { + body = redo_if(body); + return [ this[0], name, args, body ]; + }; + + function redo_if_block(statements) { + return [ this[0], statements != null ? redo_if(statements) : null ]; + }; + + return w.with_walkers({ + "defun": redo_if_lambda, + "function": redo_if_lambda, + "block": redo_if_block, + "splice": redo_if_block, + "toplevel": function(statements) { + return [ this[0], redo_if(statements) ]; + }, + "try": function(t, c, f) { + return [ + this[0], + redo_if(t), + c != null ? [ c[0], redo_if(c[1]) ] : null, + f != null ? redo_if(f) : null + ]; + } + }, function() { + return walk(ast); + }); +}; + +function for_side_effects(ast, handler) { + var w = ast_walker(), walk = w.walk; + var $stop = {}, $restart = {}; + function stop() { throw $stop }; + function restart() { throw $restart }; + function found(){ return handler.call(this, this, w, stop, restart) }; + function unary(op) { + if (op == "++" || op == "--") + return found.apply(this, arguments); + }; + return w.with_walkers({ + "try": found, + "throw": found, + "return": found, + "new": found, + "switch": found, + "break": found, + "continue": found, + "assign": found, + "call": found, + "if": found, + "for": found, + "for-in": found, + "while": found, + "do": found, + "return": found, + "unary-prefix": unary, + "unary-postfix": unary, + "defun": found + }, function(){ + while (true) try { + walk(ast); + break; + } catch(ex) { + if (ex === $stop) break; + if (ex === $restart) continue; + throw ex; + } + }); +}; + +function ast_lift_variables(ast) { + var w = ast_walker(), walk = w.walk, scope; + function do_body(body, env) { + var _scope = scope; + scope = env; + body = MAP(body, walk); + var hash = {}, names = MAP(env.names, function(type, name){ + if (type != "var") return MAP.skip; + if (!env.references(name)) return MAP.skip; + hash[name] = true; + return [ name ]; + }); + if (names.length > 0) { + // looking for assignments to any of these variables. + // we can save considerable space by moving the definitions + // in the var declaration. + for_side_effects([ "block", body ], function(ast, walker, stop, restart) { + if (ast[0] == "assign" + && ast[1] === true + && ast[2][0] == "name" + && HOP(hash, ast[2][1])) { + // insert the definition into the var declaration + for (var i = names.length; --i >= 0;) { + if (names[i][0] == ast[2][1]) { + if (names[i][1]) // this name already defined, we must stop + stop(); + names[i][1] = ast[3]; // definition + names.push(names.splice(i, 1)[0]); + break; + } + } + // remove this assignment from the AST. + var p = walker.parent(); + if (p[0] == "seq") { + var a = p[2]; + a.unshift(0, p.length); + p.splice.apply(p, a); + } + else if (p[0] == "stat") { + p.splice(0, p.length, "block"); // empty statement + } + else { + stop(); + } + restart(); + } + stop(); + }); + body.unshift([ "var", names ]); + } + scope = _scope; + return body; + }; + function _vardefs(defs) { + var ret = null; + for (var i = defs.length; --i >= 0;) { + var d = defs[i]; + if (!d[1]) continue; + d = [ "assign", true, [ "name", d[0] ], d[1] ]; + if (ret == null) ret = d; + else ret = [ "seq", d, ret ]; + } + if (ret == null) { + if (w.parent()[0] == "for-in") + return [ "name", defs[0][0] ]; + return MAP.skip; + } + return [ "stat", ret ]; + }; + function _toplevel(body) { + return [ this[0], do_body(body, this.scope) ]; + }; + return w.with_walkers({ + "function": function(name, args, body){ + for (var i = args.length; --i >= 0 && !body.scope.references(args[i]);) + args.pop(); + if (!body.scope.references(name)) name = null; + return [ this[0], name, args, do_body(body, body.scope) ]; + }, + "defun": function(name, args, body){ + if (!scope.references(name)) return MAP.skip; + for (var i = args.length; --i >= 0 && !body.scope.references(args[i]);) + args.pop(); + return [ this[0], name, args, do_body(body, body.scope) ]; + }, + "var": _vardefs, + "toplevel": _toplevel + }, function(){ + return walk(ast_add_scope(ast)); + }); +}; + +function ast_squeeze(ast, options) { + options = defaults(options, { + make_seqs : true, + dead_code : true, + no_warnings : false, + keep_comps : true + }); + + var w = ast_walker(), walk = w.walk; + + function negate(c) { + var not_c = [ "unary-prefix", "!", c ]; + switch (c[0]) { + case "unary-prefix": + return c[1] == "!" && boolean_expr(c[2]) ? c[2] : not_c; + case "seq": + c = slice(c); + c[c.length - 1] = negate(c[c.length - 1]); + return c; + case "conditional": + return best_of(not_c, [ "conditional", c[1], negate(c[2]), negate(c[3]) ]); + case "binary": + var op = c[1], left = c[2], right = c[3]; + if (!options.keep_comps) switch (op) { + case "<=" : return [ "binary", ">", left, right ]; + case "<" : return [ "binary", ">=", left, right ]; + case ">=" : return [ "binary", "<", left, right ]; + case ">" : return [ "binary", "<=", left, right ]; + } + switch (op) { + case "==" : return [ "binary", "!=", left, right ]; + case "!=" : return [ "binary", "==", left, right ]; + case "===" : return [ "binary", "!==", left, right ]; + case "!==" : return [ "binary", "===", left, right ]; + case "&&" : return best_of(not_c, [ "binary", "||", negate(left), negate(right) ]); + case "||" : return best_of(not_c, [ "binary", "&&", negate(left), negate(right) ]); + } + break; + } + return not_c; + }; + + function make_conditional(c, t, e) { + var make_real_conditional = function() { + if (c[0] == "unary-prefix" && c[1] == "!") { + return e ? [ "conditional", c[2], e, t ] : [ "binary", "||", c[2], t ]; + } else { + return e ? best_of( + [ "conditional", c, t, e ], + [ "conditional", negate(c), e, t ] + ) : [ "binary", "&&", c, t ]; + } + }; + // shortcut the conditional if the expression has a constant value + return when_constant(c, function(ast, val){ + warn_unreachable(val ? e : t); + return (val ? t : e); + }, make_real_conditional); + }; + + function rmblock(block) { + if (block != null && block[0] == "block" && block[1]) { + if (block[1].length == 1) + block = block[1][0]; + else if (block[1].length == 0) + block = [ "block" ]; + } + return block; + }; + + function _lambda(name, args, body) { + return [ this[0], name, args, tighten(body, "lambda") ]; + }; + + // this function does a few things: + // 1. discard useless blocks + // 2. join consecutive var declarations + // 3. remove obviously dead code + // 4. transform consecutive statements using the comma operator + // 5. if block_type == "lambda" and it detects constructs like if(foo) return ... - rewrite like if (!foo) { ... } + function tighten(statements, block_type) { + statements = MAP(statements, walk); + + statements = statements.reduce(function(a, stat){ + if (stat[0] == "block") { + if (stat[1]) { + a.push.apply(a, stat[1]); + } + } else { + a.push(stat); + } + return a; + }, []); + + statements = (function(a, prev){ + statements.forEach(function(cur){ + if (prev && ((cur[0] == "var" && prev[0] == "var") || + (cur[0] == "const" && prev[0] == "const"))) { + prev[1] = prev[1].concat(cur[1]); + } else { + a.push(cur); + prev = cur; + } + }); + return a; + })([]); + + if (options.dead_code) statements = (function(a, has_quit){ + statements.forEach(function(st){ + if (has_quit) { + if (st[0] == "function" || st[0] == "defun") { + a.push(st); + } + else if (st[0] == "var" || st[0] == "const") { + if (!options.no_warnings) + warn("Variables declared in unreachable code"); + st[1] = MAP(st[1], function(def){ + if (def[1] && !options.no_warnings) + warn_unreachable([ "assign", true, [ "name", def[0] ], def[1] ]); + return [ def[0] ]; + }); + a.push(st); + } + else if (!options.no_warnings) + warn_unreachable(st); + } + else { + a.push(st); + if (member(st[0], [ "return", "throw", "break", "continue" ])) + has_quit = true; + } + }); + return a; + })([]); + + if (options.make_seqs) statements = (function(a, prev) { + statements.forEach(function(cur){ + if (prev && prev[0] == "stat" && cur[0] == "stat") { + prev[1] = [ "seq", prev[1], cur[1] ]; + } else { + a.push(cur); + prev = cur; + } + }); + if (a.length >= 2 + && a[a.length-2][0] == "stat" + && (a[a.length-1][0] == "return" || a[a.length-1][0] == "throw") + && a[a.length-1][1]) + { + a.splice(a.length - 2, 2, + [ a[a.length-1][0], + [ "seq", a[a.length-2][1], a[a.length-1][1] ]]); + } + return a; + })([]); + + // this increases jQuery by 1K. Probably not such a good idea after all.. + // part of this is done in prepare_ifs anyway. + // if (block_type == "lambda") statements = (function(i, a, stat){ + // while (i < statements.length) { + // stat = statements[i++]; + // if (stat[0] == "if" && !stat[3]) { + // if (stat[2][0] == "return" && stat[2][1] == null) { + // a.push(make_if(negate(stat[1]), [ "block", statements.slice(i) ])); + // break; + // } + // var last = last_stat(stat[2]); + // if (last[0] == "return" && last[1] == null) { + // a.push(make_if(stat[1], [ "block", stat[2][1].slice(0, -1) ], [ "block", statements.slice(i) ])); + // break; + // } + // } + // a.push(stat); + // } + // return a; + // })(0, []); + + return statements; + }; + + function make_if(c, t, e) { + return when_constant(c, function(ast, val){ + if (val) { + t = walk(t); + warn_unreachable(e); + return t || [ "block" ]; + } else { + e = walk(e); + warn_unreachable(t); + return e || [ "block" ]; + } + }, function() { + return make_real_if(c, t, e); + }); + }; + + function abort_else(c, t, e) { + var ret = [ [ "if", negate(c), e ] ]; + if (t[0] == "block") { + if (t[1]) ret = ret.concat(t[1]); + } else { + ret.push(t); + } + return walk([ "block", ret ]); + }; + + function make_real_if(c, t, e) { + c = walk(c); + t = walk(t); + e = walk(e); + + if (empty(t)) { + c = negate(c); + t = e; + e = null; + } else if (empty(e)) { + e = null; + } else { + // if we have both else and then, maybe it makes sense to switch them? + (function(){ + var a = gen_code(c); + var n = negate(c); + var b = gen_code(n); + if (b.length < a.length) { + var tmp = t; + t = e; + e = tmp; + c = n; + } + })(); + } + if (empty(e) && empty(t)) + return [ "stat", c ]; + var ret = [ "if", c, t, e ]; + if (t[0] == "if" && empty(t[3]) && empty(e)) { + ret = best_of(ret, walk([ "if", [ "binary", "&&", c, t[1] ], t[2] ])); + } + else if (t[0] == "stat") { + if (e) { + if (e[0] == "stat") + ret = best_of(ret, [ "stat", make_conditional(c, t[1], e[1]) ]); + else if (aborts(e)) + ret = abort_else(c, t, e); + } + else { + ret = best_of(ret, [ "stat", make_conditional(c, t[1]) ]); + } + } + else if (e && t[0] == e[0] && (t[0] == "return" || t[0] == "throw") && t[1] && e[1]) { + ret = best_of(ret, [ t[0], make_conditional(c, t[1], e[1] ) ]); + } + else if (e && aborts(t)) { + ret = [ [ "if", c, t ] ]; + if (e[0] == "block") { + if (e[1]) ret = ret.concat(e[1]); + } + else { + ret.push(e); + } + ret = walk([ "block", ret ]); + } + else if (t && aborts(e)) { + ret = abort_else(c, t, e); + } + return ret; + }; + + function _do_while(cond, body) { + return when_constant(cond, function(cond, val){ + if (!val) { + warn_unreachable(body); + return [ "block" ]; + } else { + return [ "for", null, null, null, walk(body) ]; + } + }); + }; + + return w.with_walkers({ + "sub": function(expr, subscript) { + if (subscript[0] == "string") { + var name = subscript[1]; + if (is_identifier(name)) + return [ "dot", walk(expr), name ]; + else if (/^[1-9][0-9]*$/.test(name) || name === "0") + return [ "sub", walk(expr), [ "num", parseInt(name, 10) ] ]; + } + }, + "if": make_if, + "toplevel": function(body) { + return [ "toplevel", tighten(body) ]; + }, + "switch": function(expr, body) { + var last = body.length - 1; + return [ "switch", walk(expr), MAP(body, function(branch, i){ + var block = tighten(branch[1]); + if (i == last && block.length > 0) { + var node = block[block.length - 1]; + if (node[0] == "break" && !node[1]) + block.pop(); + } + return [ branch[0] ? walk(branch[0]) : null, block ]; + }) ]; + }, + "function": _lambda, + "defun": _lambda, + "block": function(body) { + if (body) return rmblock([ "block", tighten(body) ]); + }, + "binary": function(op, left, right) { + return when_constant([ "binary", op, walk(left), walk(right) ], function yes(c){ + return best_of(walk(c), this); + }, function no() { + return function(){ + if(op != "==" && op != "!=") return; + var l = walk(left), r = walk(right); + if(l && l[0] == "unary-prefix" && l[1] == "!" && l[2][0] == "num") + left = ['num', +!l[2][1]]; + else if (r && r[0] == "unary-prefix" && r[1] == "!" && r[2][0] == "num") + right = ['num', +!r[2][1]]; + return ["binary", op, left, right]; + }() || this; + }); + }, + "conditional": function(c, t, e) { + return make_conditional(walk(c), walk(t), walk(e)); + }, + "try": function(t, c, f) { + return [ + "try", + tighten(t), + c != null ? [ c[0], tighten(c[1]) ] : null, + f != null ? tighten(f) : null + ]; + }, + "unary-prefix": function(op, expr) { + expr = walk(expr); + var ret = [ "unary-prefix", op, expr ]; + if (op == "!") + ret = best_of(ret, negate(expr)); + return when_constant(ret, function(ast, val){ + return walk(ast); // it's either true or false, so minifies to !0 or !1 + }, function() { return ret }); + }, + "name": function(name) { + switch (name) { + case "true": return [ "unary-prefix", "!", [ "num", 0 ]]; + case "false": return [ "unary-prefix", "!", [ "num", 1 ]]; + } + }, + "while": _do_while, + "assign": function(op, lvalue, rvalue) { + lvalue = walk(lvalue); + rvalue = walk(rvalue); + var okOps = [ '+', '-', '/', '*', '%', '>>', '<<', '>>>', '|', '^', '&' ]; + if (op === true && lvalue[0] === "name" && rvalue[0] === "binary" && + ~okOps.indexOf(rvalue[1]) && rvalue[2][0] === "name" && + rvalue[2][1] === lvalue[1]) { + return [ this[0], rvalue[1], lvalue, rvalue[3] ] + } + return [ this[0], op, lvalue, rvalue ]; + } + }, function() { + for (var i = 0; i < 2; ++i) { + ast = prepare_ifs(ast); + ast = walk(ast); + } + return ast; + }); +}; + +/* -----[ re-generate code from the AST ]----- */ + +var DOT_CALL_NO_PARENS = jsp.array_to_hash([ + "name", + "array", + "object", + "string", + "dot", + "sub", + "call", + "regexp", + "defun" +]); + +function make_string(str, ascii_only) { + var dq = 0, sq = 0; + str = str.replace(/[\\\b\f\n\r\t\x22\x27\u2028\u2029\0]/g, function(s){ + switch (s) { + case "\\": return "\\\\"; + case "\b": return "\\b"; + case "\f": return "\\f"; + case "\n": return "\\n"; + case "\r": return "\\r"; + case "\t": return "\\t"; + case "\u2028": return "\\u2028"; + case "\u2029": return "\\u2029"; + case '"': ++dq; return '"'; + case "'": ++sq; return "'"; + case "\0": return "\\0"; + } + return s; + }); + if (ascii_only) str = to_ascii(str); + if (dq > sq) return "'" + str.replace(/\x27/g, "\\'") + "'"; + else return '"' + str.replace(/\x22/g, '\\"') + '"'; +}; + +function to_ascii(str) { + return str.replace(/[\u0080-\uffff]/g, function(ch) { + var code = ch.charCodeAt(0).toString(16); + while (code.length < 4) code = "0" + code; + return "\\u" + code; + }); +}; + +var SPLICE_NEEDS_BRACKETS = jsp.array_to_hash([ "if", "while", "do", "for", "for-in", "with" ]); + +function gen_code(ast, options) { + options = defaults(options, { + indent_start : 0, + indent_level : 4, + quote_keys : false, + space_colon : false, + beautify : false, + ascii_only : false, + inline_script: false + }); + var beautify = !!options.beautify; + var indentation = 0, + newline = beautify ? "\n" : "", + space = beautify ? " " : ""; + + function encode_string(str) { + var ret = make_string(str, options.ascii_only); + if (options.inline_script) + ret = ret.replace(/<\x2fscript([>\/\t\n\f\r ])/gi, "<\\/script$1"); + return ret; + }; + + function make_name(name) { + name = name.toString(); + if (options.ascii_only) + name = to_ascii(name); + return name; + }; + + function indent(line) { + if (line == null) + line = ""; + if (beautify) + line = repeat_string(" ", options.indent_start + indentation * options.indent_level) + line; + return line; + }; + + function with_indent(cont, incr) { + if (incr == null) incr = 1; + indentation += incr; + try { return cont.apply(null, slice(arguments, 1)); } + finally { indentation -= incr; } + }; + + function add_spaces(a) { + if (beautify) + return a.join(" "); + var b = []; + for (var i = 0; i < a.length; ++i) { + var next = a[i + 1]; + b.push(a[i]); + if (next && + ((/[a-z0-9_\x24]$/i.test(a[i].toString()) && /^[a-z0-9_\x24]/i.test(next.toString())) || + (/[\+\-]$/.test(a[i].toString()) && /^[\+\-]/.test(next.toString())))) { + b.push(" "); + } + } + return b.join(""); + }; + + function add_commas(a) { + return a.join("," + space); + }; + + function parenthesize(expr) { + var gen = make(expr); + for (var i = 1; i < arguments.length; ++i) { + var el = arguments[i]; + if ((el instanceof Function && el(expr)) || expr[0] == el) + return "(" + gen + ")"; + } + return gen; + }; + + function best_of(a) { + if (a.length == 1) { + return a[0]; + } + if (a.length == 2) { + var b = a[1]; + a = a[0]; + return a.length <= b.length ? a : b; + } + return best_of([ a[0], best_of(a.slice(1)) ]); + }; + + function needs_parens(expr) { + if (expr[0] == "function" || expr[0] == "object") { + // dot/call on a literal function requires the + // function literal itself to be parenthesized + // only if it's the first "thing" in a + // statement. This means that the parent is + // "stat", but it could also be a "seq" and + // we're the first in this "seq" and the + // parent is "stat", and so on. Messy stuff, + // but it worths the trouble. + var a = slice(w.stack()), self = a.pop(), p = a.pop(); + while (p) { + if (p[0] == "stat") return true; + if (((p[0] == "seq" || p[0] == "call" || p[0] == "dot" || p[0] == "sub" || p[0] == "conditional") && p[1] === self) || + ((p[0] == "binary" || p[0] == "assign" || p[0] == "unary-postfix") && p[2] === self)) { + self = p; + p = a.pop(); + } else { + return false; + } + } + } + return !HOP(DOT_CALL_NO_PARENS, expr[0]); + }; + + function make_num(num) { + var str = num.toString(10), a = [ str.replace(/^0\./, ".") ], m; + if (Math.floor(num) === num) { + if (num >= 0) { + a.push("0x" + num.toString(16).toLowerCase(), // probably pointless + "0" + num.toString(8)); // same. + } else { + a.push("-0x" + (-num).toString(16).toLowerCase(), // probably pointless + "-0" + (-num).toString(8)); // same. + } + if ((m = /^(.*?)(0+)$/.exec(num))) { + a.push(m[1] + "e" + m[2].length); + } + } else if ((m = /^0?\.(0+)(.*)$/.exec(num))) { + a.push(m[2] + "e-" + (m[1].length + m[2].length), + str.substr(str.indexOf("."))); + } + return best_of(a); + }; + + var w = ast_walker(); + var make = w.walk; + return w.with_walkers({ + "string": encode_string, + "num": make_num, + "name": make_name, + "debugger": function(){ return "debugger" }, + "toplevel": function(statements) { + return make_block_statements(statements) + .join(newline + newline); + }, + "splice": function(statements) { + var parent = w.parent(); + if (HOP(SPLICE_NEEDS_BRACKETS, parent)) { + // we need block brackets in this case + return make_block.apply(this, arguments); + } else { + return MAP(make_block_statements(statements, true), + function(line, i) { + // the first line is already indented + return i > 0 ? indent(line) : line; + }).join(newline); + } + }, + "block": make_block, + "var": function(defs) { + return "var " + add_commas(MAP(defs, make_1vardef)) + ";"; + }, + "const": function(defs) { + return "const " + add_commas(MAP(defs, make_1vardef)) + ";"; + }, + "try": function(tr, ca, fi) { + var out = [ "try", make_block(tr) ]; + if (ca) out.push("catch", "(" + ca[0] + ")", make_block(ca[1])); + if (fi) out.push("finally", make_block(fi)); + return add_spaces(out); + }, + "throw": function(expr) { + return add_spaces([ "throw", make(expr) ]) + ";"; + }, + "new": function(ctor, args) { + args = args.length > 0 ? "(" + add_commas(MAP(args, function(expr){ + return parenthesize(expr, "seq"); + })) + ")" : ""; + return add_spaces([ "new", parenthesize(ctor, "seq", "binary", "conditional", "assign", function(expr){ + var w = ast_walker(), has_call = {}; + try { + w.with_walkers({ + "call": function() { throw has_call }, + "function": function() { return this } + }, function(){ + w.walk(expr); + }); + } catch(ex) { + if (ex === has_call) + return true; + throw ex; + } + }) + args ]); + }, + "switch": function(expr, body) { + return add_spaces([ "switch", "(" + make(expr) + ")", make_switch_block(body) ]); + }, + "break": function(label) { + var out = "break"; + if (label != null) + out += " " + make_name(label); + return out + ";"; + }, + "continue": function(label) { + var out = "continue"; + if (label != null) + out += " " + make_name(label); + return out + ";"; + }, + "conditional": function(co, th, el) { + return add_spaces([ parenthesize(co, "assign", "seq", "conditional"), "?", + parenthesize(th, "seq"), ":", + parenthesize(el, "seq") ]); + }, + "assign": function(op, lvalue, rvalue) { + if (op && op !== true) op += "="; + else op = "="; + return add_spaces([ make(lvalue), op, parenthesize(rvalue, "seq") ]); + }, + "dot": function(expr) { + var out = make(expr), i = 1; + if (expr[0] == "num") { + if (!/\./.test(expr[1])) + out += "."; + } else if (needs_parens(expr)) + out = "(" + out + ")"; + while (i < arguments.length) + out += "." + make_name(arguments[i++]); + return out; + }, + "call": function(func, args) { + var f = make(func); + if (f.charAt(0) != "(" && needs_parens(func)) + f = "(" + f + ")"; + return f + "(" + add_commas(MAP(args, function(expr){ + return parenthesize(expr, "seq"); + })) + ")"; + }, + "function": make_function, + "defun": make_function, + "if": function(co, th, el) { + var out = [ "if", "(" + make(co) + ")", el ? make_then(th) : make(th) ]; + if (el) { + out.push("else", make(el)); + } + return add_spaces(out); + }, + "for": function(init, cond, step, block) { + var out = [ "for" ]; + init = (init != null ? make(init) : "").replace(/;*\s*$/, ";" + space); + cond = (cond != null ? make(cond) : "").replace(/;*\s*$/, ";" + space); + step = (step != null ? make(step) : "").replace(/;*\s*$/, ""); + var args = init + cond + step; + if (args == "; ; ") args = ";;"; + out.push("(" + args + ")", make(block)); + return add_spaces(out); + }, + "for-in": function(vvar, key, hash, block) { + return add_spaces([ "for", "(" + + (vvar ? make(vvar).replace(/;+$/, "") : make(key)), + "in", + make(hash) + ")", make(block) ]); + }, + "while": function(condition, block) { + return add_spaces([ "while", "(" + make(condition) + ")", make(block) ]); + }, + "do": function(condition, block) { + return add_spaces([ "do", make(block), "while", "(" + make(condition) + ")" ]) + ";"; + }, + "return": function(expr) { + var out = [ "return" ]; + if (expr != null) out.push(make(expr)); + return add_spaces(out) + ";"; + }, + "binary": function(operator, lvalue, rvalue) { + var left = make(lvalue), right = make(rvalue); + // XXX: I'm pretty sure other cases will bite here. + // we need to be smarter. + // adding parens all the time is the safest bet. + if (member(lvalue[0], [ "assign", "conditional", "seq" ]) || + lvalue[0] == "binary" && PRECEDENCE[operator] > PRECEDENCE[lvalue[1]] || + lvalue[0] == "function" && needs_parens(this)) { + left = "(" + left + ")"; + } + if (member(rvalue[0], [ "assign", "conditional", "seq" ]) || + rvalue[0] == "binary" && PRECEDENCE[operator] >= PRECEDENCE[rvalue[1]] && + !(rvalue[1] == operator && member(operator, [ "&&", "||", "*" ]))) { + right = "(" + right + ")"; + } + else if (!beautify && options.inline_script && (operator == "<" || operator == "<<") + && rvalue[0] == "regexp" && /^script/i.test(rvalue[1])) { + right = " " + right; + } + return add_spaces([ left, operator, right ]); + }, + "unary-prefix": function(operator, expr) { + var val = make(expr); + if (!(expr[0] == "num" || (expr[0] == "unary-prefix" && !HOP(OPERATORS, operator + expr[1])) || !needs_parens(expr))) + val = "(" + val + ")"; + return operator + (jsp.is_alphanumeric_char(operator.charAt(0)) ? " " : "") + val; + }, + "unary-postfix": function(operator, expr) { + var val = make(expr); + if (!(expr[0] == "num" || (expr[0] == "unary-postfix" && !HOP(OPERATORS, operator + expr[1])) || !needs_parens(expr))) + val = "(" + val + ")"; + return val + operator; + }, + "sub": function(expr, subscript) { + var hash = make(expr); + if (needs_parens(expr)) + hash = "(" + hash + ")"; + return hash + "[" + make(subscript) + "]"; + }, + "object": function(props) { + var obj_needs_parens = needs_parens(this); + if (props.length == 0) + return obj_needs_parens ? "({})" : "{}"; + var out = "{" + newline + with_indent(function(){ + return MAP(props, function(p){ + if (p.length == 3) { + // getter/setter. The name is in p[0], the arg.list in p[1][2], the + // body in p[1][3] and type ("get" / "set") in p[2]. + return indent(make_function(p[0], p[1][2], p[1][3], p[2])); + } + var key = p[0], val = parenthesize(p[1], "seq"); + if (options.quote_keys) { + key = encode_string(key); + } else if ((typeof key == "number" || !beautify && +key + "" == key) + && parseFloat(key) >= 0) { + key = make_num(+key); + } else if (!is_identifier(key)) { + key = encode_string(key); + } + return indent(add_spaces(beautify && options.space_colon + ? [ key, ":", val ] + : [ key + ":", val ])); + }).join("," + newline); + }) + newline + indent("}"); + return obj_needs_parens ? "(" + out + ")" : out; + }, + "regexp": function(rx, mods) { + return "/" + rx + "/" + mods; + }, + "array": function(elements) { + if (elements.length == 0) return "[]"; + return add_spaces([ "[", add_commas(MAP(elements, function(el, i){ + if (!beautify && el[0] == "atom" && el[1] == "undefined") return i === elements.length - 1 ? "," : ""; + return parenthesize(el, "seq"); + })), "]" ]); + }, + "stat": function(stmt) { + return make(stmt).replace(/;*\s*$/, ";"); + }, + "seq": function() { + return add_commas(MAP(slice(arguments), make)); + }, + "label": function(name, block) { + return add_spaces([ make_name(name), ":", make(block) ]); + }, + "with": function(expr, block) { + return add_spaces([ "with", "(" + make(expr) + ")", make(block) ]); + }, + "atom": function(name) { + return make_name(name); + } + }, function(){ return make(ast) }); + + // The squeezer replaces "block"-s that contain only a single + // statement with the statement itself; technically, the AST + // is correct, but this can create problems when we output an + // IF having an ELSE clause where the THEN clause ends in an + // IF *without* an ELSE block (then the outer ELSE would refer + // to the inner IF). This function checks for this case and + // adds the block brackets if needed. + function make_then(th) { + if (th == null) return ";"; + if (th[0] == "do") { + // https://github.com/mishoo/UglifyJS/issues/#issue/57 + // IE croaks with "syntax error" on code like this: + // if (foo) do ... while(cond); else ... + // we need block brackets around do/while + return make_block([ th ]); + } + var b = th; + while (true) { + var type = b[0]; + if (type == "if") { + if (!b[3]) + // no else, we must add the block + return make([ "block", [ th ]]); + b = b[3]; + } + else if (type == "while" || type == "do") b = b[2]; + else if (type == "for" || type == "for-in") b = b[4]; + else break; + } + return make(th); + }; + + function make_function(name, args, body, keyword) { + var out = keyword || "function"; + if (name) { + out += " " + make_name(name); + } + out += "(" + add_commas(MAP(args, make_name)) + ")"; + out = add_spaces([ out, make_block(body) ]); + return needs_parens(this) ? "(" + out + ")" : out; + }; + + function must_has_semicolon(node) { + switch (node[0]) { + case "with": + case "while": + return empty(node[2]); // `with' or `while' with empty body? + case "for": + case "for-in": + return empty(node[4]); // `for' with empty body? + case "if": + if (empty(node[2]) && !node[3]) return true; // `if' with empty `then' and no `else' + if (node[3]) { + if (empty(node[3])) return true; // `else' present but empty + return must_has_semicolon(node[3]); // dive into the `else' branch + } + return must_has_semicolon(node[2]); // dive into the `then' branch + } + }; + + function make_block_statements(statements, noindent) { + for (var a = [], last = statements.length - 1, i = 0; i <= last; ++i) { + var stat = statements[i]; + var code = make(stat); + if (code != ";") { + if (!beautify && i == last && !must_has_semicolon(stat)) { + code = code.replace(/;+\s*$/, ""); + } + a.push(code); + } + } + return noindent ? a : MAP(a, indent); + }; + + function make_switch_block(body) { + var n = body.length; + if (n == 0) return "{}"; + return "{" + newline + MAP(body, function(branch, i){ + var has_body = branch[1].length > 0, code = with_indent(function(){ + return indent(branch[0] + ? add_spaces([ "case", make(branch[0]) + ":" ]) + : "default:"); + }, 0.5) + (has_body ? newline + with_indent(function(){ + return make_block_statements(branch[1]).join(newline); + }) : ""); + if (!beautify && has_body && i < n - 1) + code += ";"; + return code; + }).join(newline) + newline + indent("}"); + }; + + function make_block(statements) { + if (!statements) return ";"; + if (statements.length == 0) return "{}"; + return "{" + newline + with_indent(function(){ + return make_block_statements(statements).join(newline); + }) + newline + indent("}"); + }; + + function make_1vardef(def) { + var name = def[0], val = def[1]; + if (val != null) + name = add_spaces([ make_name(name), "=", parenthesize(val, "seq") ]); + return name; + }; + +}; + +function split_lines(code, max_line_length) { + var splits = [ 0 ]; + jsp.parse(function(){ + var next_token = jsp.tokenizer(code); + var last_split = 0; + var prev_token; + function current_length(tok) { + return tok.pos - last_split; + }; + function split_here(tok) { + last_split = tok.pos; + splits.push(last_split); + }; + function custom(){ + var tok = next_token.apply(this, arguments); + out: { + if (prev_token) { + if (prev_token.type == "keyword") break out; + } + if (current_length(tok) > max_line_length) { + switch (tok.type) { + case "keyword": + case "atom": + case "name": + case "punc": + split_here(tok); + break out; + } + } + } + prev_token = tok; + return tok; + }; + custom.context = function() { + return next_token.context.apply(this, arguments); + }; + return custom; + }()); + return splits.map(function(pos, i){ + return code.substring(pos, splits[i + 1] || code.length); + }).join("\n"); +}; + +/* -----[ Utilities ]----- */ + +function repeat_string(str, i) { + if (i <= 0) return ""; + if (i == 1) return str; + var d = repeat_string(str, i >> 1); + d += d; + if (i & 1) d += str; + return d; +}; + +function defaults(args, defs) { + var ret = {}; + if (args === true) + args = {}; + for (var i in defs) if (HOP(defs, i)) { + ret[i] = (args && HOP(args, i)) ? args[i] : defs[i]; + } + return ret; +}; + +function is_identifier(name) { + return /^[a-z_$][a-z0-9_$]*$/i.test(name) + && name != "this" + && !HOP(jsp.KEYWORDS_ATOM, name) + && !HOP(jsp.RESERVED_WORDS, name) + && !HOP(jsp.KEYWORDS, name); +}; + +function HOP(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +}; + +// some utilities + +var MAP; + +(function(){ + MAP = function(a, f, o) { + var ret = [], top = [], i; + function doit() { + var val = f.call(o, a[i], i); + if (val instanceof AtTop) { + val = val.v; + if (val instanceof Splice) { + top.push.apply(top, val.v); + } else { + top.push(val); + } + } + else if (val != skip) { + if (val instanceof Splice) { + ret.push.apply(ret, val.v); + } else { + ret.push(val); + } + } + }; + if (a instanceof Array) for (i = 0; i < a.length; ++i) doit(); + else for (i in a) if (HOP(a, i)) doit(); + return top.concat(ret); + }; + MAP.at_top = function(val) { return new AtTop(val) }; + MAP.splice = function(val) { return new Splice(val) }; + var skip = MAP.skip = {}; + function AtTop(val) { this.v = val }; + function Splice(val) { this.v = val }; +})(); + +/* -----[ Exports ]----- */ + +exports.ast_walker = ast_walker; +exports.ast_mangle = ast_mangle; +exports.ast_squeeze = ast_squeeze; +exports.ast_lift_variables = ast_lift_variables; +exports.gen_code = gen_code; +exports.ast_add_scope = ast_add_scope; +exports.set_logger = function(logger) { warn = logger }; +exports.make_string = make_string; +exports.split_lines = split_lines; +exports.MAP = MAP; + +// keep this last! +exports.ast_squeeze_more = require("./squeeze-more").ast_squeeze_more; diff --git a/build-tools/lib/uglifyjs/squeeze-more.js b/build-tools/lib/uglifyjs/squeeze-more.js new file mode 100644 index 0000000..fbf3733 --- /dev/null +++ b/build-tools/lib/uglifyjs/squeeze-more.js @@ -0,0 +1,69 @@ +var jsp = require("./parse-js"), + pro = require("./process"), + slice = jsp.slice, + member = jsp.member, + curry = jsp.curry, + MAP = pro.MAP, + PRECEDENCE = jsp.PRECEDENCE, + OPERATORS = jsp.OPERATORS; + +function ast_squeeze_more(ast) { + var w = pro.ast_walker(), walk = w.walk, scope; + function with_scope(s, cont) { + var save = scope, ret; + scope = s; + ret = cont(); + scope = save; + return ret; + }; + function _lambda(name, args, body) { + return [ this[0], name, args, with_scope(body.scope, curry(MAP, body, walk)) ]; + }; + return w.with_walkers({ + "toplevel": function(body) { + return [ this[0], with_scope(this.scope, curry(MAP, body, walk)) ]; + }, + "function": _lambda, + "defun": _lambda, + "new": function(ctor, args) { + if (ctor[0] == "name") { + if (ctor[1] == "Array" && !scope.has("Array")) { + if (args.length != 1) { + return [ "array", args ]; + } else { + return walk([ "call", [ "name", "Array" ], args ]); + } + } else if (ctor[1] == "Object" && !scope.has("Object")) { + if (!args.length) { + return [ "object", [] ]; + } else { + return walk([ "call", [ "name", "Object" ], args ]); + } + } else if ((ctor[1] == "RegExp" || ctor[1] == "Function" || ctor[1] == "Error") && !scope.has(ctor[1])) { + return walk([ "call", [ "name", ctor[1] ], args]); + } + } + }, + "call": function(expr, args) { + if (expr[0] == "dot" && expr[2] == "toString" && args.length == 0) { + // foo.toString() ==> foo+"" + return [ "binary", "+", expr[1], [ "string", "" ]]; + } + if (expr[0] == "name") { + if (expr[1] == "Array" && args.length != 1 && !scope.has("Array")) { + return [ "array", args ]; + } + if (expr[1] == "Object" && !args.length && !scope.has("Object")) { + return [ "object", [] ]; + } + if (expr[1] == "String" && !scope.has("String")) { + return [ "binary", "+", args[0], [ "string", "" ]]; + } + } + } + }, function() { + return walk(pro.ast_add_scope(ast)); + }); +}; + +exports.ast_squeeze_more = ast_squeeze_more; diff --git a/build-tools/lib/wordwrap/LICENSE b/build-tools/lib/wordwrap/LICENSE new file mode 100644 index 0000000..e65c0b2 --- /dev/null +++ b/build-tools/lib/wordwrap/LICENSE @@ -0,0 +1,4 @@ +Copyright 2011 James Halliday (mail@substack.net) + +This project is free software released under the MIT license: +http://www.opensource.org/licenses/mit-license.php diff --git a/build-tools/lib/wordwrap/index.js b/build-tools/lib/wordwrap/index.js new file mode 100644 index 0000000..c9bc945 --- /dev/null +++ b/build-tools/lib/wordwrap/index.js @@ -0,0 +1,76 @@ +var wordwrap = module.exports = function (start, stop, params) { + if (typeof start === 'object') { + params = start; + start = params.start; + stop = params.stop; + } + + if (typeof stop === 'object') { + params = stop; + start = start || params.start; + stop = undefined; + } + + if (!stop) { + stop = start; + start = 0; + } + + if (!params) params = {}; + var mode = params.mode || 'soft'; + var re = mode === 'hard' ? /\b/ : /(\S+\s+)/; + + return function (text) { + var chunks = text.toString() + .split(re) + .reduce(function (acc, x) { + if (mode === 'hard') { + for (var i = 0; i < x.length; i += stop - start) { + acc.push(x.slice(i, i + stop - start)); + } + } + else acc.push(x) + return acc; + }, []) + ; + + return chunks.reduce(function (lines, rawChunk) { + if (rawChunk === '') return lines; + + var chunk = rawChunk.replace(/\t/g, ' '); + + var i = lines.length - 1; + if (lines[i].length + chunk.length > stop) { + lines[i] = lines[i].replace(/\s+$/, ''); + + chunk.split(/\n/).forEach(function (c) { + lines.push( + new Array(start + 1).join(' ') + + c.replace(/^\s+/, '') + ); + }); + } + else if (chunk.match(/\n/)) { + var xs = chunk.split(/\n/); + lines[i] += xs.shift(); + xs.forEach(function (c) { + lines.push( + new Array(start + 1).join(' ') + + c.replace(/^\s+/, '') + ); + }); + } + else { + lines[i] += chunk; + } + + return lines; + }, [ new Array(start + 1).join(' ') ]).join('\n'); + }; +}; + +wordwrap.soft = wordwrap; + +wordwrap.hard = function (start, stop) { + return wordwrap(start, stop, { mode : 'hard' }); +}; diff --git a/build-tools/node_modules b/build-tools/node_modules new file mode 120000 index 0000000..7951405 --- /dev/null +++ b/build-tools/node_modules @@ -0,0 +1 @@ +lib \ No newline at end of file diff --git a/demos/tizen-winsets/configure.js b/demos/tizen-winsets/configure.js new file mode 100644 index 0000000..6ab2afb --- /dev/null +++ b/demos/tizen-winsets/configure.js @@ -0,0 +1,3 @@ +$( document ).bind( "mobileinit", function() { + $.support.scrollview = true; +}); diff --git a/demos/tizen-winsets/custom.css b/demos/tizen-winsets/custom.css new file mode 100644 index 0000000..fb9759d --- /dev/null +++ b/demos/tizen-winsets/custom.css @@ -0,0 +1,17 @@ +.my-check-button-style { + margin: 10px; +} +.my-check-inline-style { + display: inline; +} + +.ui-icon-test{ + background-size: 100% 100%; + background-image: url(test.png); +} + +.ui-icon-test2{ + background-position:0% 0%; + background-size:50% 50%; + background-image: url(test.png); +} diff --git a/demos/tizen-winsets/icon-tizen.png b/demos/tizen-winsets/icon-tizen.png new file mode 100644 index 0000000..b63d902 Binary files /dev/null and b/demos/tizen-winsets/icon-tizen.png differ diff --git a/demos/tizen-winsets/index.html b/demos/tizen-winsets/index.html new file mode 100755 index 0000000..85506cf --- /dev/null +++ b/demos/tizen-winsets/index.html @@ -0,0 +1,1152 @@ + + + + + + + + + + + + Tizen UI + + + + + + + + + +
    +
    +

    Tizen UI

    +
    +
    +

    +

    +
    + Select theme + + + + +
    + + +
    +
    + +
    +
    +

    Not Implemented

    +
    +
    +

    Not Implemented

    +
    +
    + +
    +
    +

    Slider

    +
    +
    +
      +
    • Normal Slider
    • +
    • +
    • Popup Slider
    • +
    • +
    • Icon Slider
    • +
    • +
    • +
    • Text Slider
    • +
    • +
    • +
    +
    +
    + +
    +
    +

    Optional Header

    +
    + +
    + +
    +
    + +

    Option header

    + TestBtn + + TestBtn + +
    +
    + + +
    +
    +
    +
    +

    Some content would be here

    +
    +
    + +
    +
    +

    Option header - 3 buttons

    +
    +
    + + + +
    +
    +
    +
    +

    Some content would be here

    +
    +
    + +
    +
    +

    Option header - 4 buttons

    +
    +
    + + + + +
    +
    +
    +
    +

    Some content would be here

    +
    +
    + +
    +
    +

    ControlBar

    +
    +
    + +
    +
    + + + +
    +
    +
    + +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    +

    Tabbar

    +
    +
    + +
    +
    +
    + +
    +
    +
    + +
    +
    +

    Tabbar

    +
    +
    + +
    +
    +
    + +
    +
    +
    + +
    +
    +

    Tabbar

    +
    +
    + +
    +
    +
    + +
    +
    +
    + +
    +
    +

    Tabbar

    +
    +
    + +
    +
    +
    + +
    +
    +
    + +
    +
    +

    Tabbar

    +
    +
    +
    + +
    +
    +
    +
    + +
    +
    +
    + +
    +
    +

    Tabbar

    +
    +
    +
    + +
    +
    +
    +
    +
      +
    • +
    • +
    • +
    • +
    • +
    +
    +
    +
    + + + + +
    +
    +
    + +
    +
    +
    +
    + +
    +
    +
    +
    +
    + + +
    +
    +

    Toolbar

    +
    +
    +
    + +
    +
    +
    +
    + +
    +
    +
    + +
    +
    +

    Toolbar

    +
    +
    +
    + +
    +
    +
    +
    + +
    +
    +
    + +
    +
    +

    Toolbar

    +
    +
    +
    + +
    +
    +
    +
    + +
    +
    +
    + +
    +
    +

    Toolbar

    +
    +
    +
    + +
    +
    +
    +
    + +
    +
    +
    + +
    +
    +

    Toolbar

    +
    +
    +
    + +
    +
    +
    +
    + +
    +
    +
    + +
    +
    +

    Toolbar

    +
    +
    +
    + +
    +
    +
    +
    +
      +
    • +
    • +
    • +
    • +
    • +
    +
    +
    +
    + + + + +
    +
    +

    Mixed Toolbar

    +
    +
    +

    Not Supported for winset

    +
    +
    + + + +
    +
    +

    Vertical Toolbar

    +
    +
    + +
    + +
    +
    +
    + + + +
    +
    +

    Vertical Toolbar

    +
    +
    + +
    + +
    +
    +
    + + + +
    +
    +

    Vertical Toolbar

    +
    +
    +
    +
    +
    + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +

    Extended Title

    +
    + +
    + +
    +
    +

    Extended Title 2 Button

    +
    +
    + + + + +
    +
    +
    +
    +
    + +
    +
    +
    + +
    +
    +

    Extended Title 3 Button

    +
    +
    + + + + + + +
    +
    +
    +
    +
    + +
    +
    +
    + +
    +
    +

    Extended Title 4 Button

    +
    +
    + + + + + + + + +
    +
    +
    +
    +
    + +
    +
    +
    + +
    +
    +

    Extended Footer style

    +
    +
    +

    test page

    +
    +
    +
    +
    + + + + + + +
    +
    + Edit +
    +
    + + + + + +
    +
    +

    No Contents

    +
    +
    +
    +

    Text Type

    +

    Text

    +
    +
    +
    + +
    +
    +

    No Contents

    +
    +
    +
    +

    Picture Type

    +

    Text

    +
    +
    +
    + +
    +
    +

    No Contents

    +
    +
    +
    +

    Multimedia Type

    +

    Text

    +
    +
    +
    + +
    +
    +

    No Contents

    +
    +
    +
    +

    Unnamed Type

    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + diff --git a/demos/tizen-winsets/main.js b/demos/tizen-winsets/main.js new file mode 100755 index 0000000..5f42b6f --- /dev/null +++ b/demos/tizen-winsets/main.js @@ -0,0 +1,230 @@ +$( document ).bind("pagecreate", function () { + /* Color widget demo */ + $("input[type='checkbox'][data-widget-type-list]").bind("change", function() { + var ls = $( this ).attr("data-widget-type-list").split(","), + page = $( this ).closest(":jqmData(role='page')"), + disabled = $( this ).is(":checked"); + + $.each(ls, function( idx, widgetType ) { + var ar = widgetType.split("-"); + + if ( ar.length === 2 ) { + page.find(":" + widgetType)[ar[1]]( "option", "disabled", disabled ); + } + }); + }); + + $("#checkHideInput").bind("change", function (e) { + $("#colorpickerbutton").colorpickerbutton("option", "hideInput", $("#checkHideInput").is(":checked")); + }); + + $('#scroller-demo').bind('pageshow', function ( e ) { + $page = $( e.target ); + /* + * many options cannot be set without subclassing since they're + * used in the _create method - it seems as if these are for + * internal use only and scrollDuration is only changable by + * chance. + */ + var $scroller2List = $('#scroller2').find('ul'); + $scroller2List.scrollview( 'option','scrollDuration','10000' ); + + // only works by manipulating css + // the only other way is to use attribute 'scroll-method="scroll"' in html + $('#scroller2 .ui-scrollbar').css( 'visibility','hidden' ); + + /* + * make toggle button switch scroll bars on and off + */ + var scrollBarVisible = $('#scroller2').find('.ui-scrollbar').css('visibility') === "visible"; + + var $toggleScrollBars = $('#toggleScrollBars'); + $toggleScrollBars.attr( "checked", scrollBarVisible ).checkboxradio("refresh"); + + /* the 'label' is the thing that is clicked, not the input element */ + var $label = $toggleScrollBars.siblings('label').attr( 'for', '#toggleScrollBars' ); + $label.bind("click", function () { + var $scrollBar = $('#scroller2').find('.ui-scrollbar'); + var scrollBarVisible = $scrollBar.css('visibility') === "visible"; + var newVisibility = scrollBarVisible ? "hidden" : "visible"; + $scrollBar.css( 'visibility', scrollBarVisible ? "hidden" : "visible" ); + }); + }); + + $("#demo-date").bind("date-changed", function ( e, newDate ) { + $("#selected-date1").text( newDate.toString() ); + }); + + $("#demo-date2").bind("date-changed", function ( e, newDate ) { + $("#selected-date2").text( newDate.toString() ); + }); + + $("#demo-date3").bind("date-changed", function ( e, newDate ) { + $("#selected-date3").text( newDate.toString() ); + }); + + $("#demo-date4").bind("date-changed", function ( e, newDate ) { + $("#selected-date4").text( newDate.toString() ); + }); + + $('#noti-demo').bind('vmouseup', function ( e ) { + $('#notification').notification('open'); + }); + + $('#noti-icon1').bind('vclick', function ( e ) { + $('#notification').notification('icon', './test/icon02.png'); + }); + + $('#noti-icon2').bind('vclick', function ( e ) { + $('#notification').notification('icon', './test/icon01.png'); + }); + + $('#imageslider-add').bind('vmouseup', function ( e ) { + $('#imageslider').imageslider('add', './test/10.jpg'); + $('#imageslider').imageslider('add', './test/11.jpg'); + $('#imageslider').imageslider('refresh'); + }); + + $('#imageslider-del').bind('vmouseup', function ( e ) { + $('#imageslider').imageslider('delete'); + }); + + $('#selectioninfo-demo').bind('vmouseup', function ( e ) { + $('#smallpopup_selectioninfo').notification( "text", + $("#dayselector1").find(".ui-checkbox-on").length + " items are selected" ); + $('#smallpopup_selectioninfo').notification('open'); + }); + + $('#groupindex-demo').bind('pageshow', function () { + $('#groupindex').scrolllistview(); + }); + + $("#showVolumeButton").bind("vclick", function ( e ) { + $("#myVolumeControl").volumecontrol("open"); + }); + + $("#volumecontrol_setBasicTone").bind("change", function ( e ) { + var basicTone = !($("#volumecontrol_setBasicTone").next('label') + .find(".ui-icon").hasClass("ui-icon-checkbox-on")); + + if ( basicTone ) { + $("#myVolumeControl").volumecontrol( "option", "basicTone", true ); + $("#myVolumeControl").volumecontrol( "option", "title", "Basic Tone" ); + } else { + $("#myVolumeControl").volumecontrol( "option", "basicTone", false ); + $("#myVolumeControl").volumecontrol( "option", "title", "Volume" ); + } + }); + + $("#myoptionheader").bind('collapse', function () { + console.log('option header was collapsed'); + }); + + $("#myoptionheader").bind('expand', function () { + console.log('option header was expanded'); + }); + + //day-selector codes... + $("#day-selector-check-all").live('vclick', function () { + $("#dayselector1").dayselector('selectAll'); + }); + + $("#day-selector-get-days").live('vclick', function () { + var valuesStr = $("#dayselector1").dayselector('value').join(', '); + $(".selectedDay").text( valuesStr ); + }); + + /* Gen list : Dummy DB load */ + $(".virtuallist_demo_page").live("pagecreate", function () { + /* ?_=ts code for no cache mechanism */ + $.getScript( "./virtuallist-db-demo.js", function ( data, textStatus ) { + $("ul").filter( function () { + return $( this ).data("role") == "virtuallistview"; + }).addClass("vlLoadSuccess"); + + $(".virtuallist_demo_page").die(); + $("ul.ui-virtual-list-container").virtuallistview("create"); + }); + }); + + /*Expandable list : Dummy DB load*/ + $("#genlist_extendable_page").live("pagecreate", function () { + /*?_=ts code for no cache mechanism*/ + $.getScript( "./virtuallist-db-demo.js", function ( data, textStatus ) { + $("ul").filter( function () { + return $( this ).data("role") == "extendablelist"; + }).addClass("elLoadSuccess"); + + $("#genlist-extendable-page").die(); + $("ul.ui-extendable-list-container").extendablelist("create"); + }); + }); + + /* Color widget demo */ + var clrWidgetsAreInit = false; + $("#colorwidgets-demo").bind("pageshow", function () { + if ( clrWidgetsAreInit ) { + return; + } + + $("#colorpicker").bind("colorchanged", function ( e, clr ) { + $("#colorpickerbutton").colorpickerbutton( "option", "color", clr ); + $("#colorpickerbutton-noform").colorpickerbutton( "option", "color", clr ); + $("#hsvpicker").hsvpicker( "option", "color", clr ); + $("#colortitle").colortitle( "option", "color", clr ); + $("#colorpalette").colorpalette( "option", "color", clr ); + }); + + $("#colorpickerbutton").bind("colorchanged", function ( e, clr ) { + $("#colorpicker").colorpicker( "option", "color", clr ); + $("#colorpickerbutton-noform").colorpickerbutton( "option", "color", clr ); + $("#hsvpicker").hsvpicker( "option", "color", clr ); + $("#colortitle").colortitle( "option", "color", clr ); + $("#colorpalette").colorpalette( "option", "color", clr ); + }); + + $("#colorpickerbutton-noform").bind("colorchanged", function ( e, clr ) { + $("#colorpicker").colorpicker( "option", "color", clr ); + $("#colorpickerbutton").colorpickerbutton( "option", "color", clr ); + $("#hsvpicker").hsvpicker( "option", "color", clr ); + $("#colortitle").colortitle( "option", "color", clr ); + $("#colorpalette").colorpalette( "option", "color", clr ); + }); + + $("#hsvpicker").bind("colorchanged", function ( e, clr ) { + $("#colorpicker").colorpicker( "option", "color", clr ); + $("#colorpickerbutton").colorpickerbutton( "option", "color", clr ); + $("#colorpickerbutton-noform").colorpickerbutton( "option", "color", clr ); + $("#colortitle").colortitle( "option", "color", clr ); + $("#colorpalette").colorpalette( "option", "color", clr ); + }); + + $("#colortitle").bind("colorchanged", function ( e, clr ) { + $("#colorpicker").colorpicker( "option", "color", clr ); + $("#colorpickerbutton").colorpickerbutton( "option", "color", clr ); + $("#colorpickerbutton-noform").colorpickerbutton( "option", "color", clr ); + $("#hsvpicker").hsvpicker( "option", "color", clr ); + $("#colorpalette").colorpalette( "option", "color", clr ); + }); + + $("#colorpalette").bind("colorchanged", function ( e, clr ) { + $("#colorpicker").colorpicker( "option", "color", clr ); + $("#colorpickerbutton").colorpickerbutton( "option", "color", clr ); + $("#colorpickerbutton-noform").colorpickerbutton( "option", "color", clr ); + $("#hsvpicker").hsvpicker( "option", "color", clr ); + $("#colortitle").colortitle( "option", "color", clr ); + }); + + $("#colorpalette").colorpalette("option", "color", "#45cc98"); + + clrWidgetsAreInit = true; + }); +}); + +$(document).ready( function () { + // add current datetime with browser language format + // NOTE: Globalize.* functions must be run after docoument ready. + $('#current_date').html(Globalize.culture().name + " -- " + + Globalize.format( new Date(), "F" )); + $('#html_font_size').html('html font size:' + $('html').css('font-size')); +}); diff --git a/demos/tizen-winsets/test.png b/demos/tizen-winsets/test.png new file mode 100755 index 0000000..973b0ea Binary files /dev/null and b/demos/tizen-winsets/test.png differ diff --git a/demos/tizen-winsets/tips/custom-globalize-culture/custom-globalize-culture.html b/demos/tizen-winsets/tips/custom-globalize-culture/custom-globalize-culture.html new file mode 100644 index 0000000..d9d750c --- /dev/null +++ b/demos/tizen-winsets/tips/custom-globalize-culture/custom-globalize-culture.html @@ -0,0 +1,12 @@ +
    +
    +

    Custom globalize culture

    +
    +
    +

    Loading custom globalize culture file

    +

    A predefined Globalize culture file is loaded by the loader in Tizen Web UI Framework, according to the current language. If you want to load additional culture file, you can create each culture files, and let to choose one of them to load it by using $.tizen.util.loadCustomGlobalizeCulture() API.

    +
    +
    + +
    + diff --git a/demos/tizen-winsets/tips/custom-globalize-culture/custom-globalize-culture.js b/demos/tizen-winsets/tips/custom-globalize-culture/custom-globalize-culture.js new file mode 100644 index 0000000..df7036c --- /dev/null +++ b/demos/tizen-winsets/tips/custom-globalize-culture/custom-globalize-culture.js @@ -0,0 +1,19 @@ +( function ( $ ) { + var customCultureFiles = { + "en" : "en.js", + "en-US" : "en.js", + "fr" : "fr.js" + }, + lang, + content = $( '#page-tips-custom-globalize-culture > :jqmData(role="content")' ); + + $.tizen.util.loadCustomGlobalizeCulture( customCultureFiles ); + + lang = Globalize.culture( ).name; + content.append( $( '
    ' ) + .text( "This is a text from custom globalize culture file (key:hello): " + Globalize.localize( 'hello' ) ) ); + content.append( + $( '
    ' ) + .text( "Current lang: " + lang + ", Custom culture file: " + customCultureFiles[lang] ) ); + content.trigger( "refresh" ); +} ) ( jQuery ); diff --git a/demos/tizen-winsets/tips/custom-globalize-culture/en.js b/demos/tizen-winsets/tips/custom-globalize-culture/en.js new file mode 100644 index 0000000..97574a1 --- /dev/null +++ b/demos/tizen-winsets/tips/custom-globalize-culture/en.js @@ -0,0 +1,17 @@ +( function ( ) { + + var cultureInfo = { + messages: { + "hello" : "hello", + "translate" : "translate" + } + }, + supportLang = [ "en", "en-US" ], + i, lang; + + for ( i in supportLang ) { + lang = supportLang[ i ]; + Globalize.addCultureInfo( lang, cultureInfo ); + } + +} ) ( ); diff --git a/demos/tizen-winsets/tips/custom-globalize-culture/fr.js b/demos/tizen-winsets/tips/custom-globalize-culture/fr.js new file mode 100644 index 0000000..7e43728 --- /dev/null +++ b/demos/tizen-winsets/tips/custom-globalize-culture/fr.js @@ -0,0 +1,10 @@ +( function ( ) { + + Globalize.addCultureInfo( "fr", { + messages: { + "hello" : "bonjour", + "translate" : "traduire" + } + } ); + +} ) ( ); diff --git a/demos/tizen-winsets/tips/generate-elements-dynamically.html b/demos/tizen-winsets/tips/generate-elements-dynamically.html new file mode 100755 index 0000000..8d19c68 --- /dev/null +++ b/demos/tizen-winsets/tips/generate-elements-dynamically.html @@ -0,0 +1,82 @@ +
    +
    +

    Generate elements dynamically

    +
    + + +
    +
    +
    Example #1 Trigger Create
    +
    Trigger Create after append element on HTML.
    +
    +

    + $( "#checkboxItems" ).append( newhtml) ;
    + $( "#checkboxItems" ).trigger( "create" );
    +

    +
    + +
    + +
    + +
    +
    +
    +
    Example #2 Call the widget Creator function.
    +
    + Call the widget's creator function after append element on HTML.
    + Usually, creator function is same to widget name. But, "button" widget is a little bit different. + Call buttonMarkup() or trigger "create" to the parent of button. +
    +
    +

    + /* Append new button */
    + var buttonTemplate = "<div data-role='button' data-inline='true' " + "data-icon='call' data-style='circle' " + "data-theme='s' class='newbutton'></div>";
    + $( buttonTemplate ).buttonMarkup().appendTo( "#buttonItems" );

    + + /* It's same to call ".buttonMarkup()". */
    + $( "#buttonItems" ).trigger( "create" ); +

    +
    + +
    +
    + +
    +
    +
    Add new Button item
    +
    +
    +
    +
    +
    Example #3 Append Listview on JQM.
    +
    + To add new <LI> element on JQM listview, insert items and call "refresh" to the listview.
    +
    +
    +

    + var listTemplate = "<li>Appended New Item</li>";
    + $( listTemplate ).appendTo( "#listview" );
    + $( "#listview" ).listview( "refresh");
    +

    +
    + +
      +
    • Test
    • +
    • Test
    • +
    • Test
    • +
    + +
    +
    +
    Add new item to Listview
    +
    +
    +
    +
    +
    diff --git a/demos/tizen-winsets/tips/generate-elements-dynamically.js b/demos/tizen-winsets/tips/generate-elements-dynamically.js new file mode 100755 index 0000000..415343e --- /dev/null +++ b/demos/tizen-winsets/tips/generate-elements-dynamically.js @@ -0,0 +1,33 @@ +var myArray = []; +function addCheckbox(){ + var newhtml, + i = myArray.length; + + myArray[myArray.length] = 'Item - ' + myArray.length; + newhtml = '' ; + newhtml += ''; + $( "#checkboxItems" ).append( newhtml ); + $( "#checkboxItems" ).trigger( "create" ); +} + + +$( '#bAdd' ).live( 'vclick', function () { + addCheckbox(); +} ); + +$( "#ButtonAdd" ).live( "vclick", function() { + /* Append new button */ + var buttonTemplate = "
    "; + $( buttonTemplate ).buttonMarkup().appendTo( "#buttonItems" ); + + /* Same works */ + /*$("#buttonItems").trigger("create");*/ +} ); + +$( "#ListAdd" ).live( "vclick", function() { + var listTemplate = "
  • Appended New Item
  • "; + $( listTemplate ).appendTo( "#listview" ); + $( "#listview" ).listview( "refresh"); +} ); diff --git a/demos/tizen-winsets/tips/list-sample/expandable.html b/demos/tizen-winsets/tips/list-sample/expandable.html new file mode 100644 index 0000000..bf980c7 --- /dev/null +++ b/demos/tizen-winsets/tips/list-sample/expandable.html @@ -0,0 +1,13 @@ +
    +
    +

    Single-Page Application

    +
    + +
    +
      +
    +
    + +
    +
    +
    diff --git a/demos/tizen-winsets/tips/list-sample/expandable.js b/demos/tizen-winsets/tips/list-sample/expandable.js new file mode 100644 index 0000000..cfaecac --- /dev/null +++ b/demos/tizen-winsets/tips/list-sample/expandable.js @@ -0,0 +1,22 @@ +$( document ).bind( "pagebeforeshow", function () { + var id = 0, + add_ex = function () { + var li = '
  • exp1 parent
  • ' + + '
  • exp1-sub 1
  • ' + + '
  • exp1-sub 2
  • '; + + $("#mylist").append( li ).trigger("create"); + }, + add_item = function () { + var li = '
  • exp1-sub 3
  • '; + + $("#mylist").append( li ).trigger("create"); + }; + + add_ex(); + $("#mylist").listview("refresh"); + + add_item(); + $("#mylist").listview("refresh"); + $("#exp1").expandablelist("refresh"); +}); diff --git a/demos/tizen-winsets/tips/list-sample/list-sample.html b/demos/tizen-winsets/tips/list-sample/list-sample.html new file mode 100644 index 0000000..4179413 --- /dev/null +++ b/demos/tizen-winsets/tips/list-sample/list-sample.html @@ -0,0 +1,21 @@ +
    +
    +

    Single-Page Application

    +
    + +
    +
      +
    +
    + +
    +
    + +
    +
    +
    diff --git a/demos/tizen-winsets/tips/list-sample/list-sample.js b/demos/tizen-winsets/tips/list-sample/list-sample.js new file mode 100644 index 0000000..5c4c9cf --- /dev/null +++ b/demos/tizen-winsets/tips/list-sample/list-sample.js @@ -0,0 +1,52 @@ +$( document ).bind( "pagecreate", function () { + var id = 0, + add_item = function () { + var li = '
  • ' + + 'Item ' + id + '' + + '
    delete
    '+ + '
  • '; + + id++; + + $("#mylist").append( li ).trigger("create"); + }; + + $("#add").bind( "vclick", function ( e ) { + add_item(); + $("#mylist").listview("refresh"); + }); + + $("#add2").bind( "vclick", function ( e ) { + var i; + + for ( i = 0; i < 20; i++ ) { + add_item(); + } + + $("#mylist").listview("refresh"); + }); + + $("#new").bind( "vclick", function ( e ) { + $("#mylist").html("").trigger("create"); + + add_item(); + $("#mylist").listview("refresh"); + }); + + $("#new2").bind( "vclick", function ( e ) { + var i; + + $("#mylist").html("").trigger("create"); + + for ( i = 0; i < 20; i++ ) { + add_item(); + } + + $("#mylist").listview("refresh"); + }); + + $("#mylist").delegate( ".ui-btn", "vclick", function ( e ) { + $( "#li" + this.id ).remove(); + $("#mylist").listview("refresh"); + }); +}); diff --git a/demos/tizen-winsets/tips/page-transition/transition-page.html b/demos/tizen-winsets/tips/page-transition/transition-page.html new file mode 100644 index 0000000..8a6cb33 --- /dev/null +++ b/demos/tizen-winsets/tips/page-transition/transition-page.html @@ -0,0 +1,12 @@ + +
    +
    +

    No Contents

    +
    +
    +
    +

    Picture Type

    +

    Text

    +
    +
    +
    diff --git a/demos/tizen-winsets/tips/page-transition/transition.html b/demos/tizen-winsets/tips/page-transition/transition.html new file mode 100644 index 0000000..1f55f4d --- /dev/null +++ b/demos/tizen-winsets/tips/page-transition/transition.html @@ -0,0 +1,20 @@ + +
    +
    +

    Transitions

    +
    +
    + +
    +
    diff --git a/demos/tizen-winsets/tips/two-line-text/two-line-text.html b/demos/tizen-winsets/tips/two-line-text/two-line-text.html new file mode 100755 index 0000000..49d3df2 --- /dev/null +++ b/demos/tizen-winsets/tips/two-line-text/two-line-text.html @@ -0,0 +1,35 @@ +
    +
    +

    Two line text sample

    +
    + +
    +

    short button or long text button

    +

    do not need to control width. because button control text width in case content area

    +

    Text Button Test
    +
    Text Button Test. long text line
    +
    +

    but some case, for example width fixed area or narrow width
    + browser change text to ellipsis

    +
    + + + + + + +

    +

    to make text in button, 2 line +

    Simple making step is ...

    + 1. first insert <br> tag between text

    + 2. then set fontsize to see text in small area
    +   ex> $( "#textposition" ).css("font-size", "12px");

    + 3. if element attribute or inner attributes has padding-top/bottom,
    + control this value because this value hide some text top/bottom
    +   ex> $( "#textposition" ).find("span").css("padding-top", "4px");

    + 4. last control height between line text using line-height
    +   ex> $( "#textposition" ).find("span").css("line-height", "14px");



    +

    +
    +
    +
    diff --git a/demos/tizen-winsets/tips/two-line-text/two-line-text.js b/demos/tizen-winsets/tips/two-line-text/two-line-text.js new file mode 100755 index 0000000..b06313b --- /dev/null +++ b/demos/tizen-winsets/tips/two-line-text/two-line-text.js @@ -0,0 +1,8 @@ +$( document ).bind( "pagebeforeshow", function( e ) { + if( $( "#textposition" ).length ) { + $( "#textposition" ).css( "font-size", "12px" ); + $( "#textposition" ).find( "span" ).css( "height", "32px" ); + $( "#textposition" ).find( "span" ).css("padding-top", "4px"); + $( "#textposition" ).find( "span" ).css("padding-bottom", "4px"); + } +}); diff --git a/demos/tizen-winsets/tizen-web-ui-fw b/demos/tizen-winsets/tizen-web-ui-fw new file mode 120000 index 0000000..c692543 --- /dev/null +++ b/demos/tizen-winsets/tizen-web-ui-fw @@ -0,0 +1 @@ +../../build/tizen-web-ui-fw \ No newline at end of file diff --git a/demos/tizen-winsets/widgets/auto-dividers.html b/demos/tizen-winsets/widgets/auto-dividers.html new file mode 100644 index 0000000..4a86f88 --- /dev/null +++ b/demos/tizen-winsets/widgets/auto-dividers.html @@ -0,0 +1,21 @@ +
    +
    +

    Listview auto-dividers

    +
    +
    +

    This gets auto-dividers based on link text, or just + text (for read-only lists).

    + +
    +
    + + diff --git a/demos/tizen-winsets/widgets/button/button.html b/demos/tizen-winsets/widgets/button/button.html new file mode 100755 index 0000000..fbc222e --- /dev/null +++ b/demos/tizen-winsets/widgets/button/button.html @@ -0,0 +1,47 @@ + + + + + + + + + + + + + +
    +
    +

    Buttons

    +
    +
    +
      +
    • Buttons Pages(not in list)
    • +
    • List item 1
      Text Button TesT
    • +
    • List item 2
      Call Icon
    • +
    • List item 3
      Longer Call Icon
    • +
    • List item 4
      Icon Text
    • +
    • List item 5
    • +
    • List item 6
    • +
    • List item 7
    • +
    • List item 8
    • +
    • List item 9
    • +
    • List item 10
    • +
    • List item 11
    • +
    • List item 12
      Delete
    • +
    • Custom
      T
    • +
    • Custom Width
      Test
    • +
    • Custom Width, Height
      Test
    • +
    • Custom Width, Height, Right
      Test
    • +
    • Circle-Custom
    • +
    • Custom Top
      tEST
    • +
    • Custom Bottom
      Test
    • +
    +
    +
    + + + diff --git a/demos/tizen-winsets/widgets/button/buttonNolist.html b/demos/tizen-winsets/widgets/button/buttonNolist.html new file mode 100644 index 0000000..1c24e8e --- /dev/null +++ b/demos/tizen-winsets/widgets/button/buttonNolist.html @@ -0,0 +1,78 @@ + + + + + + + + + + + + + +
    +
    +

    Buttons

    +
    +
    + *Default Button +
    Button
    + HTML Code: + +

    + *Inline Button, Inline Button With Icon
    +
    DataInline True
    +
    Icon Text
    +
    Icon Text
    +
    +

    + HTML Code: +

    + *Default Button (A tag) + A Tag Button + HTML Code: + +

    + *Button Icon Position top, bottom (with inline) +
    PositionTop

    +
    PositionBottom

    +
    PositionTop
    +
    PositionBottom

    + HTML Code: +

    + *Custom Button:
    +
    Custom
    +
    Custom Top
    +
    Custom Bottom
    +
    Custom width,height
    +

    + HTML Code: + + CSS Code:
    + +
    +
    + + + diff --git a/demos/tizen-winsets/widgets/checkbox/checkbox.html b/demos/tizen-winsets/widgets/checkbox/checkbox.html new file mode 100644 index 0000000..567c13f --- /dev/null +++ b/demos/tizen-winsets/widgets/checkbox/checkbox.html @@ -0,0 +1,54 @@ + + + + + + +
    + +
    +

    Check

    +
    + +
    +
    + + +

    First checkbox check value : + + (click the button! ) + +

    +

    Trigged When user clicks a checkbox : + + (This is updated when user clicks a checkbox ) + +

    + +
    + +
    + + + + + + + + + + + + + + + + +
    +
    +
    + + + + + diff --git a/demos/tizen-winsets/widgets/checkbox/checkbox.js b/demos/tizen-winsets/widgets/checkbox/checkbox.js new file mode 100644 index 0000000..53d1d61 --- /dev/null +++ b/demos/tizen-winsets/widgets/checkbox/checkbox.js @@ -0,0 +1,22 @@ +$( "#checkbox-demo" ).live("pagecreate", function () { + $( "#check-1" ).bind('vclick', function () { + console.log("clicked..."); + value = $( "#checkbox-1" ).prop( "checked" ); + // change checkbox property and update UI. + $( "#checkbox-1" ).prop( "checked", !value ); + $("#checkbox-1").checkboxradio( "refresh" ); + // show checkbox1 property + $( ".checked-value" ).text( $( "#checkbox-1" ).prop( "checked" ) ); + }); + + $( "#get-check-value" ).bind('vclick', function () { + $( ".checked-value" ).text( $( "#checkbox-1" ).prop( "checked" ) ); + }); + + $("input[type='checkbox']").bind( "change", function(event, ui) { + $( ".triggered-check" ).text( this.id + " is " + this.checked ); + }); + +}); + + diff --git a/demos/tizen-winsets/widgets/colorpicker.html b/demos/tizen-winsets/widgets/colorpicker.html new file mode 100755 index 0000000..90658df --- /dev/null +++ b/demos/tizen-winsets/widgets/colorpicker.html @@ -0,0 +1,53 @@ + + +
    +
    +

    Color widgets

    +
    +
    +
    +
    +
    Color title widget
    +
    +
    +
    +
    Color palette widget
    +
    +
    +
    +
    Color picker button
    +
    +
    +
    +
    Color picker button (form element)
    +
    +
    + + +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    Hue-Saturation-Value picker widget
    +
    +
    +
    +
    Hue-Saturation-Lightness picker widget
    +
    +
    +
    + +
    +
    + + + diff --git a/demos/tizen-winsets/widgets/ctxpopup.html b/demos/tizen-winsets/widgets/ctxpopup.html new file mode 100755 index 0000000..ab7b01a --- /dev/null +++ b/demos/tizen-winsets/widgets/ctxpopup.html @@ -0,0 +1,178 @@ +
    +
    +

    Contextual Popup

    +
    +
    +
    + +Touch me! + + +
    +
    + + +Icon+Text + + +
    +
    + + +3 Icons + +
    + +
    +
    +
    + + +6 Icons-Grid + +
    + + + + + + + + + + + +
    + + + + + Eeenie +
    + + + Mynie + + +
    +
    +
    +
    + +CopyPaste + +
    + +
    +
    +
    + +Text Only + + +
    +
    + + +Buttons + +
    +
    + + + + + + + + + + + +
    + Meenie + + Mynie + + Mo +
    + Catch-a + + Tiger + + By-the +
    +
    +
    + +
    +
    + +
    diff --git a/demos/tizen-winsets/widgets/ctxpopup.js b/demos/tizen-winsets/widgets/ctxpopup.js new file mode 100644 index 0000000..ee86683 --- /dev/null +++ b/demos/tizen-winsets/widgets/ctxpopup.js @@ -0,0 +1,9 @@ +$("#pop_js").live("vclick", function ( e ) { + if ( $(e.target).is(".ui-btn-ctxpopup-close") ) { + $(this).popupwindow("close"); + } + if ( $(e.target).is("#ctxpopup_update") ) { + $("#btn_js").text("Peekaboo!"); + $("#btn_js").buttonMarkup("refresh"); + } +}); diff --git a/demos/tizen-winsets/widgets/datefield.html b/demos/tizen-winsets/widgets/datefield.html new file mode 100644 index 0000000..090594f --- /dev/null +++ b/demos/tizen-winsets/widgets/datefield.html @@ -0,0 +1,44 @@ +
    +
    +

    Date/time picker

    +
    +
    +
      +
    • +
      + +
      +
      + Date/Time Picker(Custom) - (select a date first) +
      +
    • +
    • +
      + +
      +
      + Date/Time Picker - (select a date first) +
      +
    • +
    • +
      + +
      +
      + Date Picker - (select a date first) +
      +
    • +
    • +
      + +
      +
      + Time Picker - (select a date first) +
      +
    • +
    +
    +
    + + diff --git a/demos/tizen-winsets/widgets/day-selector.html b/demos/tizen-winsets/widgets/day-selector.html new file mode 100644 index 0000000..8a4851b --- /dev/null +++ b/demos/tizen-winsets/widgets/day-selector.html @@ -0,0 +1,53 @@ +
    +
    +

    Day selector

    +
    + +
    +

    With a legend (also API demo)

    +
    + Choose some days +
    + + + +

    The day(s) you selected are: + + (select a day first) + +

    +
    + +

    With a legend, with custom swatch

    +
    + Choose some days +
    +
    + +

    Without a legend

    +
    +
    +
    + +

    Without a legend, vertical layout

    + +

    Note that the checkboxes are visible as icons + (this is the default behaviour for vertical checkbox + controlgroups in jQuery Mobile).

    + +
    +
    + +
    + +

    With a legend, vertical layout

    + +
    + Choose some days +
    + +
    +
    + + + diff --git a/demos/tizen-winsets/widgets/entry.html b/demos/tizen-winsets/widgets/entry.html new file mode 100755 index 0000000..2c59421 --- /dev/null +++ b/demos/tizen-winsets/widgets/entry.html @@ -0,0 +1,70 @@ + + +
    +
    +

    Entry

    +
    + +
    +
    + + + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    +
    + + diff --git a/demos/tizen-winsets/widgets/fast-scroll.html b/demos/tizen-winsets/widgets/fast-scroll.html new file mode 100644 index 0000000..ad81285 --- /dev/null +++ b/demos/tizen-winsets/widgets/fast-scroll.html @@ -0,0 +1,60 @@ +
    +
    +

    Short cut scroll (aka fast scroll)

    +
    + +
    +
      +
    • A
    • +
    • Anton
    • +
    • Arabella
    • +
    • Art
    • +
    • B
    • +
    • Barry
    • +
    • Bibi
    • +
    • Billy
    • +
    • Bob
    • +
    • D
    • +
    • Daisy
    • +
    • Derek
    • +
    • Desmond
    • +
    • E
    • +
    • Eric
    • +
    • Ernie
    • +
    • Esme
    • +
    • F
    • +
    • Fay
    • +
    • Felicity
    • +
    • Francis
    • +
    • Frank
    • +
    • H
    • +
    • Harry
    • +
    • Herman
    • +
    • Horace
    • +
    • J
    • +
    • Jack
    • +
    • Jane
    • +
    • Jill
    • +
    • K
    • +
    • Katherine
    • +
    • Katy
    • +
    • Keith
    • +
    • L
    • +
    • Larry
    • +
    • Lee
    • +
    • Lola
    • +
    • M
    • +
    • Mark
    • +
    • Milly
    • +
    • Mort
    • +
    • N
    • +
    • Nigel
    • +
    • Norman
    • +
    • O
    • +
    • Organza
    • +
    • Orlando
    • +
    +
    +
    + + diff --git a/demos/tizen-winsets/widgets/font-effect.html b/demos/tizen-winsets/widgets/font-effect.html new file mode 100755 index 0000000..44ee4db --- /dev/null +++ b/demos/tizen-winsets/widgets/font-effect.html @@ -0,0 +1,17 @@ + +
    + +
    +

    Font - TODO : Add more samples

    + Home +
    + +
    +
    + bold +
    normal +
    italic + +
    +
    + diff --git a/demos/tizen-winsets/widgets/forms-all-native.html b/demos/tizen-winsets/widgets/forms-all-native.html new file mode 100755 index 0000000..9da7eeb --- /dev/null +++ b/demos/tizen-winsets/widgets/forms-all-native.html @@ -0,0 +1,199 @@ + +
    + +
    +

    Forms

    +
    + +
    +
    + +
    + +

    Native form elements & buttons

    + +

    Although the framework automatically enhances form elements and buttons into touch input optimized controls to streamline development, it's easy to tell jQuery Mobile to leave these elements alone so the standard, native control can be used instead.

    +

    Adding the data-role="none" attribute to any form or button element tells the framework to not apply any enhanced styles or scripting. The examples below all have this attribute in place to demonstrate the effect. You may need to write custom styles to lay out your form controls because we try to leave all the default styling intact.

    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    +
    + Choose as many snacks as you'd like: + + + + + + + + + + + +
    +
    + +
    +
    + Font styling: + + + + + + + + +
    +
    + +
    +
    + Choose a pet: + + + + + + + + + + + +
    +
    + +
    +
    + Layout view: + + + + + + +
    +
    + +
    + + +
    + +
    + + +
    + + + + +

    Button based button:

    + + +

    Input type="button" based button:

    + + +

    Input type="submit" based button:

    + + +

    Input type="reset" based button:

    + + +

    Input type="image" based button:

    + + +
    + +
    + +
    + +
    + + diff --git a/demos/tizen-winsets/widgets/forms-all.html b/demos/tizen-winsets/widgets/forms-all.html new file mode 100755 index 0000000..36dccb6 --- /dev/null +++ b/demos/tizen-winsets/widgets/forms-all.html @@ -0,0 +1,254 @@ + +
    + +
    +

    Forms

    + Home +
    + +
    +
    + +
    + +

    Form elements

    + +

    This page contains various progressive-enhancement driven form controls. Native elements are sometimes hidden from view, but their values are maintained so the form can be submitted normally.

    + +

    Browsers that don't support the custom controls will still deliver a usable experience, because all are based on native form elements.

    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    +
    + Choose as many snacks as you'd like: + + + + + + + + + + + +
    +
    + +
    +
    + Font styling: + + + + + + + + +
    +
    + +
    +
    + Choose a pet: + + + + + + + + + + + +
    +
    + +
    +
    + Layout view: + + + + + + +
    +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    +
    +
    +
    +
    +
    +
    +
    + + + +
    + + + +
    + diff --git a/demos/tizen-winsets/widgets/grid/css/namecard.css b/demos/tizen-winsets/widgets/grid/css/namecard.css new file mode 100755 index 0000000..0ef9d05 --- /dev/null +++ b/demos/tizen-winsets/widgets/grid/css/namecard.css @@ -0,0 +1,118 @@ +.ui-demo-namecard { + display : inline-block; + width : 5.1rem; + height : 6.1rem; + margin-right: 0.4rem; + margin-left: 0.4rem; + margin-bottom: 1.5rem; +} + +.ui-demo-rotation-namecard { + position : fixed; + width : 5.1rem; + height : 6.1rem; + margin-right: 0.3rem; + margin-left: 0.3rem; + margin-bottom: 1.5rem; +} + +.ui-demo-namecard-pic { + float : left; + padding-top : 0.2rem; + padding-left : 0.2rem; + padding-bottom: 0rem; +} + +.ui-demo-namecard-pic-img { + height : 5rem; + width : 5rem; +} + +.ui-demo-namecard-contents { + float : left; + height : 1rem; + margin: 0rem; +} + +.ui-demo-namecard-contents span { + font-style : italic; + color : #666; + border-bottom : 1px dashed; + margin-top: 0rem; +} + +.ui-demo-rotation-x-namecard { + width : 5.1rem; + height : 6.1rem; + display: block; + margin-right: 0.3rem; + margin-left: 0.3rem; + margin-bottom: 0.6rem; +} + +.ui-demo-namecard-contents-x { + height : 1rem; + margin: 0rem; +} + +.ui-demo-namecard-span-x { + color : gray; + font : normal 0.8rem Georgia, serif !important; + + width: 5rem; + display: block; + white-space : nowrap; + overflow : hidden !important; + text-overflow : ellipsis !important; + -o-text-overflow:ellipsis; + resize:horizontal; +} + +.ui-demo-namecard-contents span.name { + color : gray; + font : normal 0.8rem Georgia, serif !important; + + width: 5rem; + display: inline-block; + white-space : nowrap; + overflow : hidden !important; + text-overflow : ellipsis !important; + -o-text-overflow:ellipsis; + resize:horizontal; +} + +.ui-demo-rotation-list-namecard { + height : 70px; + display:block; + border-bottom-color: #444; +} + +.ui-demo-namecard-list-pic { + height : 2.7rem; + width : 2.7rem; + float : left; + padding-top : 0rem; + padding-left : 0.2rem; + padding-right : 1rem; + padding-bottom: 0rem; + border-width: 0; +} + +.ui-demo-namecard-list-pic-img { + height : 2.7rem; + width : 2.7rem; +} + +.ui-demo-namecard-list-contents { + height : 2.5rem; +} + +.ui-demo-namecard-list-contents span{ + left : 9.6rem; + font-weight : normal; + font-size : 1.2rem; + color : gray; + padding-top : 1rem; + font-family: Helvetica, Arial, sans-serif; + margin-top: 0rem; +} diff --git a/demos/tizen-winsets/widgets/grid/images/nba_76ers.jpg b/demos/tizen-winsets/widgets/grid/images/nba_76ers.jpg new file mode 100755 index 0000000..35db118 Binary files /dev/null and b/demos/tizen-winsets/widgets/grid/images/nba_76ers.jpg differ diff --git a/demos/tizen-winsets/widgets/grid/images/nba_bobcats.jpg b/demos/tizen-winsets/widgets/grid/images/nba_bobcats.jpg new file mode 100755 index 0000000..6572396 Binary files /dev/null and b/demos/tizen-winsets/widgets/grid/images/nba_bobcats.jpg differ diff --git a/demos/tizen-winsets/widgets/grid/images/nba_bucks.jpg b/demos/tizen-winsets/widgets/grid/images/nba_bucks.jpg new file mode 100755 index 0000000..8b420ae Binary files /dev/null and b/demos/tizen-winsets/widgets/grid/images/nba_bucks.jpg differ diff --git a/demos/tizen-winsets/widgets/grid/images/nba_bulls.jpg b/demos/tizen-winsets/widgets/grid/images/nba_bulls.jpg new file mode 100755 index 0000000..8c131e1 Binary files /dev/null and b/demos/tizen-winsets/widgets/grid/images/nba_bulls.jpg differ diff --git a/demos/tizen-winsets/widgets/grid/images/nba_cavaliers.jpg b/demos/tizen-winsets/widgets/grid/images/nba_cavaliers.jpg new file mode 100755 index 0000000..2a66daa Binary files /dev/null and b/demos/tizen-winsets/widgets/grid/images/nba_cavaliers.jpg differ diff --git a/demos/tizen-winsets/widgets/grid/images/nba_celtics.jpg b/demos/tizen-winsets/widgets/grid/images/nba_celtics.jpg new file mode 100755 index 0000000..363f65b Binary files /dev/null and b/demos/tizen-winsets/widgets/grid/images/nba_celtics.jpg differ diff --git a/demos/tizen-winsets/widgets/grid/images/nba_clippers.jpg b/demos/tizen-winsets/widgets/grid/images/nba_clippers.jpg new file mode 100755 index 0000000..9b042b9 Binary files /dev/null and b/demos/tizen-winsets/widgets/grid/images/nba_clippers.jpg differ diff --git a/demos/tizen-winsets/widgets/grid/images/nba_griz.jpg b/demos/tizen-winsets/widgets/grid/images/nba_griz.jpg new file mode 100755 index 0000000..c521cc9 Binary files /dev/null and b/demos/tizen-winsets/widgets/grid/images/nba_griz.jpg differ diff --git a/demos/tizen-winsets/widgets/grid/images/nba_hawks.jpg b/demos/tizen-winsets/widgets/grid/images/nba_hawks.jpg new file mode 100755 index 0000000..208be2d Binary files /dev/null and b/demos/tizen-winsets/widgets/grid/images/nba_hawks.jpg differ diff --git a/demos/tizen-winsets/widgets/grid/images/nba_heats.jpg b/demos/tizen-winsets/widgets/grid/images/nba_heats.jpg new file mode 100755 index 0000000..1c009d2 Binary files /dev/null and b/demos/tizen-winsets/widgets/grid/images/nba_heats.jpg differ diff --git a/demos/tizen-winsets/widgets/grid/images/nba_honets.jpg b/demos/tizen-winsets/widgets/grid/images/nba_honets.jpg new file mode 100755 index 0000000..b2aa7ee Binary files /dev/null and b/demos/tizen-winsets/widgets/grid/images/nba_honets.jpg differ diff --git a/demos/tizen-winsets/widgets/grid/images/nba_jazz.jpg b/demos/tizen-winsets/widgets/grid/images/nba_jazz.jpg new file mode 100755 index 0000000..1f1d221 Binary files /dev/null and b/demos/tizen-winsets/widgets/grid/images/nba_jazz.jpg differ diff --git a/demos/tizen-winsets/widgets/grid/images/nba_kings.jpg b/demos/tizen-winsets/widgets/grid/images/nba_kings.jpg new file mode 100755 index 0000000..fc0e9f9 Binary files /dev/null and b/demos/tizen-winsets/widgets/grid/images/nba_kings.jpg differ diff --git a/demos/tizen-winsets/widgets/grid/images/nba_knics.jpg b/demos/tizen-winsets/widgets/grid/images/nba_knics.jpg new file mode 100755 index 0000000..70c8796 Binary files /dev/null and b/demos/tizen-winsets/widgets/grid/images/nba_knics.jpg differ diff --git a/demos/tizen-winsets/widgets/grid/images/nba_lakers.jpg b/demos/tizen-winsets/widgets/grid/images/nba_lakers.jpg new file mode 100755 index 0000000..cb291b1 Binary files /dev/null and b/demos/tizen-winsets/widgets/grid/images/nba_lakers.jpg differ diff --git a/demos/tizen-winsets/widgets/grid/images/nba_magics.jpg b/demos/tizen-winsets/widgets/grid/images/nba_magics.jpg new file mode 100755 index 0000000..290b930 Binary files /dev/null and b/demos/tizen-winsets/widgets/grid/images/nba_magics.jpg differ diff --git a/demos/tizen-winsets/widgets/grid/images/nba_mavericks.jpg b/demos/tizen-winsets/widgets/grid/images/nba_mavericks.jpg new file mode 100755 index 0000000..f8816a8 Binary files /dev/null and b/demos/tizen-winsets/widgets/grid/images/nba_mavericks.jpg differ diff --git a/demos/tizen-winsets/widgets/grid/images/nba_nets.jpg b/demos/tizen-winsets/widgets/grid/images/nba_nets.jpg new file mode 100755 index 0000000..3d2600c Binary files /dev/null and b/demos/tizen-winsets/widgets/grid/images/nba_nets.jpg differ diff --git a/demos/tizen-winsets/widgets/grid/images/nba_nuggets.jpg b/demos/tizen-winsets/widgets/grid/images/nba_nuggets.jpg new file mode 100755 index 0000000..a01e78e Binary files /dev/null and b/demos/tizen-winsets/widgets/grid/images/nba_nuggets.jpg differ diff --git a/demos/tizen-winsets/widgets/grid/images/nba_pacers.jpg b/demos/tizen-winsets/widgets/grid/images/nba_pacers.jpg new file mode 100755 index 0000000..be98506 Binary files /dev/null and b/demos/tizen-winsets/widgets/grid/images/nba_pacers.jpg differ diff --git a/demos/tizen-winsets/widgets/grid/images/nba_pistons.jpg b/demos/tizen-winsets/widgets/grid/images/nba_pistons.jpg new file mode 100755 index 0000000..f13c851 Binary files /dev/null and b/demos/tizen-winsets/widgets/grid/images/nba_pistons.jpg differ diff --git a/demos/tizen-winsets/widgets/grid/images/nba_raptors.jpg b/demos/tizen-winsets/widgets/grid/images/nba_raptors.jpg new file mode 100755 index 0000000..eb8d431 Binary files /dev/null and b/demos/tizen-winsets/widgets/grid/images/nba_raptors.jpg differ diff --git a/demos/tizen-winsets/widgets/grid/images/nba_rockets.jpg b/demos/tizen-winsets/widgets/grid/images/nba_rockets.jpg new file mode 100755 index 0000000..8cf2f17 Binary files /dev/null and b/demos/tizen-winsets/widgets/grid/images/nba_rockets.jpg differ diff --git a/demos/tizen-winsets/widgets/grid/images/nba_sonics.jpg b/demos/tizen-winsets/widgets/grid/images/nba_sonics.jpg new file mode 100755 index 0000000..2104e42 Binary files /dev/null and b/demos/tizen-winsets/widgets/grid/images/nba_sonics.jpg differ diff --git a/demos/tizen-winsets/widgets/grid/images/nba_spurs.jpg b/demos/tizen-winsets/widgets/grid/images/nba_spurs.jpg new file mode 100755 index 0000000..060002d Binary files /dev/null and b/demos/tizen-winsets/widgets/grid/images/nba_spurs.jpg differ diff --git a/demos/tizen-winsets/widgets/grid/images/nba_suns.jpg b/demos/tizen-winsets/widgets/grid/images/nba_suns.jpg new file mode 100755 index 0000000..754769c Binary files /dev/null and b/demos/tizen-winsets/widgets/grid/images/nba_suns.jpg differ diff --git a/demos/tizen-winsets/widgets/grid/images/nba_timberwolves.jpg b/demos/tizen-winsets/widgets/grid/images/nba_timberwolves.jpg new file mode 100755 index 0000000..79476a8 Binary files /dev/null and b/demos/tizen-winsets/widgets/grid/images/nba_timberwolves.jpg differ diff --git a/demos/tizen-winsets/widgets/grid/images/nba_trail.jpg b/demos/tizen-winsets/widgets/grid/images/nba_trail.jpg new file mode 100755 index 0000000..57168c9 Binary files /dev/null and b/demos/tizen-winsets/widgets/grid/images/nba_trail.jpg differ diff --git a/demos/tizen-winsets/widgets/grid/images/nba_warriors.jpg b/demos/tizen-winsets/widgets/grid/images/nba_warriors.jpg new file mode 100755 index 0000000..45440c4 Binary files /dev/null and b/demos/tizen-winsets/widgets/grid/images/nba_warriors.jpg differ diff --git a/demos/tizen-winsets/widgets/grid/images/nba_wizards.jpg b/demos/tizen-winsets/widgets/grid/images/nba_wizards.jpg new file mode 100755 index 0000000..e98a491 Binary files /dev/null and b/demos/tizen-winsets/widgets/grid/images/nba_wizards.jpg differ diff --git a/demos/tizen-winsets/widgets/grid/js/virtualgrid-db-demo.js b/demos/tizen-winsets/widgets/grid/js/virtualgrid-db-demo.js new file mode 100755 index 0000000..1aef95b --- /dev/null +++ b/demos/tizen-winsets/widgets/grid/js/virtualgrid-db-demo.js @@ -0,0 +1,5244 @@ +/* + * jQuery Mobile Framework : Dummy data for Virtuallist demo + * Copyright (c) Lee, Wongi (wongi11.lee@samsung.com) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + */ + +/* Sample Data in JSON : NBA Player list more than 1,000. */ +var JSON_DATA = [{ + NAME : "Abdelnaby, Alaa", + ACTIVE : "1990 - 1994", + FROM : "College - Duke", + TEAM_LOGO : "./images/nba_hawks.jpg" +}, { + NAME : "Abdul-Aziz, Zaid", + ACTIVE : "1968 - 1977", + FROM : "College - Iowa State", + TEAM_LOGO : "./images/nba_suns.jpg" +}, { + NAME : "Abdul-Jabbar, Kareem", + ACTIVE : "1969 - 1988", + FROM : "College - UCLA", + TEAM_LOGO : "./images/nba_clippers.jpg" +}, { + NAME : "Abdul-Rauf, Mahmoud", + ACTIVE : "1990 - 2000", + FROM : "College - Louisiana State", + TEAM_LOGO : "./images/nba_hawks.jpg" +}, { + NAME : "Abdul-Wahad, Tariq", + ACTIVE : "1997 - 2002", + FROM : "College - San Jose State", + TEAM_LOGO : "./images/nba_76ers.jpg" +}, { + NAME : "Abdur-Rahim, Shareef", + ACTIVE : "2007 - 2007", + FROM : "College - California", + TEAM_LOGO : "./images/nba_knics.jpg" +}, { + NAME : "Abernethy, Tom", + ACTIVE : "1976 - 1980", + FROM : "College - Indiana", + TEAM_LOGO : "./images/nba_griz.jpg" +}, { + NAME : "Able, Forest Edward (Frosty)", + ACTIVE : "1956 - 1956", + FROM : "College - Western Kentucky; Louisville", + TEAM_LOGO : "./images/nba_nuggets.jpg" +}, { + NAME : "Abramovic, John Jr. (Brooms)", + ACTIVE : "1946 - 1947", + FROM : "College - Salem (NC)", + TEAM_LOGO : "./images/nba_suns.jpg" +}, { + NAME : "Acker, Alex", + ACTIVE : "2005 - 2008", + FROM : "College - Pepperdine", + TEAM_LOGO : "./images/nba_trail.jpg" +}, { + NAME : "Ackerman, Donald D. (Buddy)", + ACTIVE : "1953 - 1953", + FROM : "College - Long Island University", + TEAM_LOGO : "./images/nba_lakers.jpg" +}, { + NAME : "Acres, Mark", + ACTIVE : "1987 - 1992", + FROM : "College - Oral Roberts", + TEAM_LOGO : "./images/nba_knics.jpg" +}, { + NAME : "Acton, Charles R. (Bud)", + ACTIVE : "1967 - 1967", + FROM : "College - Alma; Hillsdale", + TEAM_LOGO : "./images/nba_jazz.jpg" +}, { + NAME : "Adams, Alvan", + ACTIVE : "1975 - 1987", + FROM : "College - Oklahoma", + TEAM_LOGO : "./images/nba_magics.jpg" +}, { + NAME : "Adams, Donald L. (Don)", + ACTIVE : "1970 - 1976", + FROM : "College - Northwestern", + TEAM_LOGO : "./images/nba_celtics.jpg" +}, { + NAME : "Adams, Hassan", + ACTIVE : "2006 - 2008", + FROM : "College - Arizona", + TEAM_LOGO : "./images/nba_cavaliers.jpg" +}, { + NAME : "Adams, Michael", + ACTIVE : "1985 - 1995", + FROM : "College - Boston College", + TEAM_LOGO : "./images/nba_honets.jpg" +}, { + NAME : "Addison, Rafael", + ACTIVE : "1986 - 1996", + FROM : "College - Syracuse", + TEAM_LOGO : "./images/nba_raptors.jpg" +}, { + NAME : "Adelman, Rick", + ACTIVE : "1968 - 1974", + FROM : "College - Loyola Marymount", + TEAM_LOGO : "./images/nba_timberwolves.jpg" +}, { + NAME : "Adrien, Jeff", + ACTIVE : "ACTIVE", + FROM : "College - Connecticut", + TEAM_LOGO : "./images/nba_honets.jpg" +}, { + NAME : "Afflalo, Arron", + ACTIVE : "ACTIVE", + FROM : "College - UCLA", + TEAM_LOGO : "./images/nba_lakers.jpg" +}, { + NAME : "Ager, Maurice", + ACTIVE : "2007 - 2010", + FROM : "College - Michigan State", + TEAM_LOGO : "./images/nba_bucks.jpg" +}, { + NAME : "Aguirre, Mark", + ACTIVE : "1981 - 1993", + FROM : "College - DePaul", + TEAM_LOGO : "./images/nba_pistons.jpg" +}, { + NAME : "Ahearn, Blake", + ACTIVE : "2007 - 2008", + FROM : "College - Missouri State", + TEAM_LOGO : "./images/nba_bulls.jpg" +}, { + NAME : "Ainge, Danny", + ACTIVE : "1981 - 1994", + FROM : "College - Brigham Young", + TEAM_LOGO : "./images/nba_kings.jpg" +}, { + NAME : "Ajinca, Alexis", + ACTIVE : "ACTIVE", + FROM : "From - Saint Etienne, France", + TEAM_LOGO : "./images/nba_warriors.jpg" +}, { + NAME : "Akin, Henry T.", + ACTIVE : "1966 - 1967", + FROM : "College - William Carey; Morehead State", + TEAM_LOGO : "./images/nba_nuggets.jpg" +}, { + NAME : "Alabi, Solomon", + ACTIVE : "ACTIVE", + FROM : "College - Florida State", + TEAM_LOGO : "./images/nba_trail.jpg" +}, { + NAME : "Alarie, Mark", + ACTIVE : "1986 - 1990", + FROM : "College - Duke", + TEAM_LOGO : "./images/nba_cavaliers.jpg" +}, { + NAME : "Alcorn, Gary R.", + ACTIVE : "1959 - 1960", + FROM : "College - Fresno City Coll. CA (J.C.); Fresno State", + TEAM_LOGO : "./images/nba_76ers.jpg" +}, { + NAME : "Aldrich, Cole", + ACTIVE : "ACTIVE", + FROM : "College - Kansas", + TEAM_LOGO : "./images/nba_clippers.jpg" +}, { + NAME : "Aldridge, LaMarcus", + ACTIVE : "ACTIVE", + FROM : "College - Texas", + TEAM_LOGO : "./images/nba_nuggets.jpg" +}, { + NAME : "Aleksinas, Chuck", + ACTIVE : "1984 - 1984", + FROM : "College - Kentucky; Connecticut", + TEAM_LOGO : "./images/nba_pacers.jpg" +}, { + NAME : "Alexander, Cory", + ACTIVE : "1995 - 2004", + FROM : "College - Virginia", + TEAM_LOGO : "./images/nba_honets.jpg" +}, { + NAME : "Alexander, Courtney", + ACTIVE : "2000 - 2002", + FROM : "College - Fresno State", + TEAM_LOGO : "./images/nba_mavericks.jpg" +}, { + NAME : "Alexander, Gary", + ACTIVE : "1993 - 1993", + FROM : "College - South Florida", + TEAM_LOGO : "./images/nba_bobcats.jpg" +}, { + NAME : "Alexander, Joe", + ACTIVE : "2008 - 2009", + FROM : "College - West Virginia", + TEAM_LOGO : "./images/nba_mavericks.jpg" +}, { + NAME : "Alexander, Victor", + ACTIVE : "1991 - 2001", + FROM : "College - Iowa State", + TEAM_LOGO : "./images/nba_magics.jpg" +}, { + NAME : "Alford, Steve", + ACTIVE : "1987 - 1990", + FROM : "College - Indiana", + TEAM_LOGO : "./images/nba_spurs.jpg" +}, { + NAME : "Allen, Jerome", + ACTIVE : "1995 - 1996", + FROM : "College - Pennsylvania", + TEAM_LOGO : "./images/nba_wizards.jpg" +}, { + NAME : "Allen, Lucius", + ACTIVE : "1969 - 1978", + FROM : "College - UCLA", + TEAM_LOGO : "./images/nba_warriors.jpg" +}, { + NAME : "Allen, Malik", + ACTIVE : "ACTIVE", + FROM : "College - Villanova", + TEAM_LOGO : "./images/nba_lakers.jpg" +}, { + NAME : "Allen, Randy", + ACTIVE : "1988 - 1989", + FROM : "College - Florida State", + TEAM_LOGO : "./images/nba_mavericks.jpg" +}, { + NAME : "Allen, Ray", + ACTIVE : "ACTIVE", + FROM : "College - Connecticut", + TEAM_LOGO : "./images/nba_mavericks.jpg" +}, { + NAME : "Allen, Robert J. (Bob)", + ACTIVE : "1968 - 1968", + FROM : "College - Marshall", + TEAM_LOGO : "./images/nba_rockets.jpg" +}, { + NAME : "Allen, Tony", + ACTIVE : "ACTIVE", + FROM : "College - Oklahoma State", + TEAM_LOGO : "./images/nba_nuggets.jpg" +}, { + NAME : "Allison, Odis Jr.", + ACTIVE : "1971 - 1971", + FROM : "College - Laney Coll. CA (J.C.); Nevada-Las Vegas", + TEAM_LOGO : "./images/nba_jazz.jpg" +}, { + NAME : "Allred, Lance", + ACTIVE : "2007 - 2007", + FROM : "College - Weber State", + TEAM_LOGO : "./images/nba_celtics.jpg" +}, { + NAME : "Allums, Darrell", + ACTIVE : "1980 - 1980", + FROM : "College - UCLA", + TEAM_LOGO : "./images/nba_hawks.jpg" +}, { + NAME : "Almond, Morris", + ACTIVE : "2007 - 2008", + FROM : "College - Rice", + TEAM_LOGO : "./images/nba_bobcats.jpg" +}, { + NAME : "Babbitt, Luke", + ACTIVE : "ACTIVE", + FROM : "College - Nevada-Reno", + TEAM_LOGO : "./images/nba_76ers.jpg" +}, { + NAME : "Babic, Milos", + ACTIVE : "1990 - 1991", + FROM : "College - Tennessee Tech", + TEAM_LOGO : "./images/nba_wizards.jpg" +}, { + NAME : "Bach, John William (Johnny)", + ACTIVE : "1948 - 1948", + FROM : "College - Fordham; Rochester; Brown", + TEAM_LOGO : "./images/nba_76ers.jpg" +}, { + NAME : "Baechtold, James E. (Jim)", + ACTIVE : "1952 - 1956", + FROM : "College - Eastern Kentucky", + TEAM_LOGO : "./images/nba_lakers.jpg" +}, { + NAME : "Bagaric, Dalibor", + ACTIVE : "2000 - 2002", + FROM : "From - Croatia", + TEAM_LOGO : "./images/nba_cavaliers.jpg" +}, { + NAME : "Bagley, John", + ACTIVE : "1982 - 1993", + FROM : "College - Boston College", + TEAM_LOGO : "./images/nba_pacers.jpg" +}, { + NAME : "Bailey, Augustus (Gus)", + ACTIVE : "1974 - 1979", + FROM : "College - Texas-El Paso", + TEAM_LOGO : "./images/nba_hawks.jpg" +}, { + NAME : "Bailey, Carl", + ACTIVE : "1981 - 1981", + FROM : "College - Tuskegee", + TEAM_LOGO : "./images/nba_kings.jpg" +}, { + NAME : "Bailey, James", + ACTIVE : "1979 - 1987", + FROM : "College - Rutgers", + TEAM_LOGO : "./images/nba_mavericks.jpg" +}, { + NAME : "Bailey, Thurl", + ACTIVE : "1983 - 1998", + FROM : "College - North Carolina State", + TEAM_LOGO : "./images/nba_heats.jpg" +}, { + NAME : "Bailey, Toby", + ACTIVE : "1998 - 1999", + FROM : "College - UCLA ''98", + TEAM_LOGO : "./images/nba_jazz.jpg" +}, { + NAME : "Baker, Mark", + ACTIVE : "1998 - 1998", + FROM : "College - Ohio State", + TEAM_LOGO : "./images/nba_lakers.jpg" +}, { + NAME : "Baker, Maurice", + ACTIVE : "2004 - 2004", + FROM : "College - Oklahoma State '02", + TEAM_LOGO : "./images/nba_heats.jpg" +}, { + NAME : "Baker, Norman Henry (Norm)", + ACTIVE : "1946 - 1946", + FROM : "College - No College", + TEAM_LOGO : "./images/nba_jazz.jpg" +}, { + NAME : "Baker, Vin", + ACTIVE : "1993 - 2005", + FROM : "College - Hartford", + TEAM_LOGO : "./images/nba_knics.jpg" +}, { + NAME : "Balkman, Renaldo", + ACTIVE : "ACTIVE", + FROM : "College - South Carolina", + TEAM_LOGO : "./images/nba_trail.jpg" +}, { + NAME : "Ball, Cedric", + ACTIVE : "1990 - 1990", + FROM : "College - North Carolina-Charlotte", + TEAM_LOGO : "./images/nba_pacers.jpg" +}, { + NAME : "Ballard, Greg", + ACTIVE : "1977 - 1988", + FROM : "College - Shasta Coll. CA (J.C.); Oregon", + TEAM_LOGO : "./images/nba_mavericks.jpg" +}, { + NAME : "Baltimore, Herschel David (Herk)", + ACTIVE : "1946 - 1946", + FROM : "College - Penn State", + TEAM_LOGO : "./images/nba_spurs.jpg" +}, { + NAME : "Banks, Gene", + ACTIVE : "1981 - 1986", + FROM : "College - Duke", + TEAM_LOGO : "./images/nba_raptors.jpg" +}, { + NAME : "Banks, Marcus", + ACTIVE : "ACTIVE", + FROM : "College - Nevada-Las Vegas", + TEAM_LOGO : "./images/nba_trail.jpg" +}, { + NAME : "Bannister, Ken", + ACTIVE : "1984 - 1990", + FROM : "College - Trinidad State JC CO; Indiana State; Saint Augustine College", + TEAM_LOGO : "./images/nba_griz.jpg" +}, { + NAME : "Bantom, Mike", + ACTIVE : "1973 - 1981", + FROM : "College - St. Joseph's (PA)", + TEAM_LOGO : "./images/nba_griz.jpg" +}, { + NAME : "Barber, John", + ACTIVE : "1956 - 1956", + FROM : "College - Los Angeles State", + TEAM_LOGO : "./images/nba_nets.jpg" +}, { + NAME : "Barbosa, Leandro", + ACTIVE : "ACTIVE", + FROM : "From - Sau Paulo, Brazil", + TEAM_LOGO : "./images/nba_jazz.jpg" +}, { + NAME : "Bardo, Stephen", + ACTIVE : "1991 - 1995", + FROM : "College - Illinois", + TEAM_LOGO : "./images/nba_heats.jpg" +}, { + NAME : "Barea, Jose", + ACTIVE : "ACTIVE", + FROM : "College - Northeastern", + TEAM_LOGO : "./images/nba_warriors.jpg" +}, { + NAME : "Bargnani, Andrea", + ACTIVE : "ACTIVE", + FROM : "From - Rome, Italy", + TEAM_LOGO : "./images/nba_hawks.jpg" +}, { + NAME : "Barker, Clifford E. (Cliff)", + ACTIVE : "1949 - 1951", + FROM : "College - Kentucky", + TEAM_LOGO : "./images/nba_bobcats.jpg" +}, { + NAME : "Barker, Thomas Kevin (Tom)", + ACTIVE : "1976 - 1978", + FROM : "College - Minnesota; Coll. of Southern Idaho (J.C.); Hawaii", + TEAM_LOGO : "./images/nba_cavaliers.jpg" +}, { + NAME : "Barkley, Charles", + ACTIVE : "1984 - 1999", + FROM : "College - Auburn", + TEAM_LOGO : "./images/nba_celtics.jpg" +}, { + NAME : "Barkley, Erick", + ACTIVE : "2000 - 2001", + FROM : "College - St. John''s '02", + TEAM_LOGO : "./images/nba_nets.jpg" +}, { + NAME : "Barksdale, Don Angelo", + ACTIVE : "1951 - 1954", + FROM : "College - Coll. of Marin CA (J.C.); UCLA", + TEAM_LOGO : "./images/nba_bobcats.jpg" +}, { + NAME : "Barnes, Harry J.", + ACTIVE : "1968 - 1968", + FROM : "College - Northeastern", + TEAM_LOGO : "./images/nba_nuggets.jpg" +}, { + NAME : "Barnes, Marvin Jerome", + ACTIVE : "1976 - 1979", + FROM : "College - Providence", + TEAM_LOGO : "./images/nba_knics.jpg" +}, { + NAME : "Barnes, Matt", + ACTIVE : "ACTIVE", + FROM : "College - UCLA", + TEAM_LOGO : "./images/nba_honets.jpg" +}, { + NAME : "Barnes, V. James (Jim, Bad News)", + ACTIVE : "1964 - 1970", + FROM : "College - Cameron; Texas-El Paso", + TEAM_LOGO : "./images/nba_lakers.jpg" +}, { + NAME : "Barnett, Dick", + ACTIVE : "1959 - 1973", + FROM : "College - Tennessee State", + TEAM_LOGO : "./images/nba_clippers.jpg" +}, { + NAME : "Barnett, James Franklin (Jim)", + ACTIVE : "1966 - 1976", + FROM : "College - Oregon", + TEAM_LOGO : "./images/nba_celtics.jpg" +}, { + NAME : "Barnhill, John Anthony (Rabbit)", + ACTIVE : "1962 - 1968", + FROM : "College - Tennessee State", + TEAM_LOGO : "./images/nba_nets.jpg" +}, { + NAME : "Barnhill, Norton", + ACTIVE : "1976 - 1976", + FROM : "College - Washington State", + TEAM_LOGO : "./images/nba_nuggets.jpg" +}, { + NAME : "Barnhorst, Leo A. (Barney)", + ACTIVE : "1949 - 1953", + FROM : "College - Notre Dame", + TEAM_LOGO : "./images/nba_bobcats.jpg" +}, { + NAME : "Barr, John E.", + ACTIVE : "1946 - 1946", + FROM : "College - Penn State", + TEAM_LOGO : "./images/nba_mavericks.jpg" +}, { + NAME : "Barr, Michael J. (Mike)", + ACTIVE : "1976 - 1976", + FROM : "College - Duquesne", + TEAM_LOGO : "./images/nba_wizards.jpg" +}, { + NAME : "Barr, Thomas L. (Moe)", + ACTIVE : "1970 - 1970", + FROM : "College - Duquesne", + TEAM_LOGO : "./images/nba_kings.jpg" +}, { + NAME : "Barrett, Andre", + ACTIVE : "2007 - 2007", + FROM : "College - Seton Hall", + TEAM_LOGO : "./images/nba_rockets.jpg" +}, { + NAME : "Barrett, Ernie Drew", + ACTIVE : "1953 - 1955", + FROM : "College - Kansas State", + TEAM_LOGO : "./images/nba_nuggets.jpg" +}, { + NAME : "Barron, Earl", + ACTIVE : "ACTIVE", + FROM : "College - Memphis", + TEAM_LOGO : "./images/nba_knics.jpg" +}, { + NAME : "Barros, Dana", + ACTIVE : "1989 - 2003", + FROM : "College - Boston College ''89", + TEAM_LOGO : "./images/nba_celtics.jpg" +}, { + NAME : "Barry, Brent", + ACTIVE : "2007 - 2008", + FROM : "College - Oregon State", + TEAM_LOGO : "./images/nba_timberwolves.jpg" +}, { + NAME : "Cabarkapa, Zarko", + ACTIVE : "2003 - 2005", + FROM : "From - Serbia & Montenegro", + TEAM_LOGO : "./images/nba_timberwolves.jpg" +}, { + NAME : "Cable, Byrum William (Barney)", + ACTIVE : "1958 - 1963", + FROM : "College - Bradley", + TEAM_LOGO : "./images/nba_rockets.jpg" +}, { + NAME : "Caffey, Jason", + ACTIVE : "1995 - 2002", + FROM : "College - Alabama ''95", + TEAM_LOGO : "./images/nba_sonics.jpg" +}, { + NAME : "Cage, Michael", + ACTIVE : "1984 - 1999", + FROM : "College - San Diego State", + TEAM_LOGO : "./images/nba_cavaliers.jpg" +}, { + NAME : "Calabrese, Gerald A. (Gerry)", + ACTIVE : "1950 - 1951", + FROM : "College - St. John's (N.Y.)", + TEAM_LOGO : "./images/nba_raptors.jpg" +}, { + NAME : "Calderon, Jose", + ACTIVE : "ACTIVE", + FROM : "From - Villanueva de la Serena, Spain", + TEAM_LOGO : "./images/nba_bucks.jpg" +}, { + NAME : "Caldwell, Adrian", + ACTIVE : "1989 - 1997", + FROM : "College - Navarro Coll. TX (J.C.); Southern Methodist; Lamar", + TEAM_LOGO : "./images/nba_pistons.jpg" +}, { + NAME : "Caldwell, James W. Jr. (Jim)", + ACTIVE : "1967 - 1967", + FROM : "College - Georgia Tech", + TEAM_LOGO : "./images/nba_sonics.jpg" +}, { + NAME : "Caldwell, Joe (Pogo)", + ACTIVE : "1964 - 1969", + FROM : "College - Arizona State", + TEAM_LOGO : "./images/nba_sonics.jpg" +}, { + NAME : "Calhoun, David L. (Corky)", + ACTIVE : "1972 - 1979", + FROM : "College - Pennsylvania", + TEAM_LOGO : "./images/nba_clippers.jpg" +}, { + NAME : "Calhoun, William C. (Bill)", + ACTIVE : "1948 - 1954", + FROM : "College - San Francisco City Coll. CA (J.C.)", + TEAM_LOGO : "./images/nba_rockets.jpg" +}, { + NAME : "Calip, Demetrius", + ACTIVE : "1991 - 1991", + FROM : "College - Michigan", + TEAM_LOGO : "./images/nba_trail.jpg" +}, { + NAME : "Callahan, Thomas Francis (Tom)", + ACTIVE : "1946 - 1946", + FROM : "College - Notre Dame; Rockhurst", + TEAM_LOGO : "./images/nba_lakers.jpg" +}, { + NAME : "Calloway, Rick", + ACTIVE : "1990 - 1990", + FROM : "College - Indiana; Kansas", + TEAM_LOGO : "./images/nba_lakers.jpg" +}, { + NAME : "Calverley, Ernest A. (Ernie)", + ACTIVE : "1946 - 1948", + FROM : "College - Rhode Island", + TEAM_LOGO : "./images/nba_nuggets.jpg" +}, { + NAME : "Calvin, Mack", + ACTIVE : "1976 - 1980", + FROM : "College - Long Beach City Coll. CA (J.C.); USC", + TEAM_LOGO : "./images/nba_griz.jpg" +}, { + NAME : "Cambridge, Dexter", + ACTIVE : "1992 - 1992", + FROM : "College - Lon Morris Coll. TX (J.C.); Texas", + TEAM_LOGO : "./images/nba_bucks.jpg" +}, { + NAME : "Camby, Marcus", + ACTIVE : "ACTIVE", + FROM : "College - Massachusetts", + TEAM_LOGO : "./images/nba_bulls.jpg" +}, { + NAME : "Campbell, Elden", + ACTIVE : "1990 - 2004", + FROM : "College - Clemson", + TEAM_LOGO : "./images/nba_warriors.jpg" +}, { + NAME : "Campbell, Tony", + ACTIVE : "1984 - 1994", + FROM : "College - Ohio State", + TEAM_LOGO : "./images/nba_nets.jpg" +}, { + NAME : "Cannon, Lawrence T. (Larry)", + ACTIVE : "1973 - 1973", + FROM : "College - La Salle", + TEAM_LOGO : "./images/nba_kings.jpg" +}, { + NAME : "Caracter, Derrick", + ACTIVE : "ACTIVE", + FROM : "College - Texas-El Paso", + TEAM_LOGO : "./images/nba_rockets.jpg" +}, { + NAME : "Cardinal, Brian", + ACTIVE : "ACTIVE", + FROM : "College - Purdue", + TEAM_LOGO : "./images/nba_heats.jpg" +}, { + NAME : "Carl, Howard Hershey (Howie)", + ACTIVE : "1961 - 1961", + FROM : "College - Illinois; DePaul", + TEAM_LOGO : "./images/nba_raptors.jpg" +}, { + NAME : "Carlisle, Chester G. (Chet)", + ACTIVE : "1946 - 1946", + FROM : "College - California", + TEAM_LOGO : "./images/nba_cavaliers.jpg" +}, { + NAME : "Carlisle, Geno", + ACTIVE : "2004 - 2004", + FROM : "College - California '99", + TEAM_LOGO : "./images/nba_heats.jpg" +}, { + NAME : "Carlisle, Rick", + ACTIVE : "1984 - 1989", + FROM : "College - Maine; Virginia", + TEAM_LOGO : "./images/nba_mavericks.jpg" +}, { + NAME : "Carlson, Alvin Harold", + ACTIVE : "1975 - 1975", + FROM : "College - USC; Oregon", + TEAM_LOGO : "./images/nba_bucks.jpg" +}, { + NAME : "Carlson, Don Vernon (Swede)", + ACTIVE : "1946 - 1950", + FROM : "College - Minnesota", + TEAM_LOGO : "./images/nba_kings.jpg" +}, { + NAME : "Carney, Robert Lee (Bob)", + ACTIVE : "1954 - 1954", + FROM : "College - Bradley", + TEAM_LOGO : "./images/nba_raptors.jpg" +}, { + NAME : "Carney, Rodney", + ACTIVE : "2007 - 2010", + FROM : "College - Memphis", + TEAM_LOGO : "./images/nba_raptors.jpg" +}, { + NAME : "Carpenter, Robert H. (Bob)", + ACTIVE : "1949 - 1950", + FROM : "College - Texas A&M-Commerce", + TEAM_LOGO : "./images/nba_knics.jpg" +}, { + NAME : "Carr, Antoine", + ACTIVE : "1984 - 1999", + FROM : "College - Wichita State", + TEAM_LOGO : "./images/nba_kings.jpg" +}, { + NAME : "Carr, Austin George", + ACTIVE : "1971 - 1980", + FROM : "College - Notre Dame", + TEAM_LOGO : "./images/nba_rockets.jpg" +}, { + NAME : "Carr, Chris", + ACTIVE : "1995 - 2000", + FROM : "College - Southern Illinois", + TEAM_LOGO : "./images/nba_bucks.jpg" +}, { + NAME : "Carr, Cory", + ACTIVE : "1998 - 1998", + FROM : "College - Texas Tech", + TEAM_LOGO : "./images/nba_hawks.jpg" +}, { + NAME : "Carr, Kenny", + ACTIVE : "1977 - 1986", + FROM : "College - North Carolina State", + TEAM_LOGO : "./images/nba_rockets.jpg" +}, { + NAME : "Carr, M.L.", + ACTIVE : "1976 - 1984", + FROM : "College - Guilford", + TEAM_LOGO : "./images/nba_heats.jpg" +}, { + NAME : "Carrington, Robert Frederick (Bob)", + ACTIVE : "1977 - 1979", + FROM : "College - Boston College", + TEAM_LOGO : "./images/nba_76ers.jpg" +}, { + NAME : "Carroll, DeMarre", + ACTIVE : "2009 - 2010", + FROM : "College - Missouri", + TEAM_LOGO : "./images/nba_magics.jpg" +}, { + NAME : "Carroll, Joe Barry", + ACTIVE : "1980 - 1990", + FROM : "College - Purdue", + TEAM_LOGO : "./images/nba_trail.jpg" +}, { + NAME : "Carroll, Matt", + ACTIVE : "ACTIVE", + FROM : "College - Notre Dame", + TEAM_LOGO : "./images/nba_nets.jpg" +}, { + NAME : "Carruth, Jimmy", + ACTIVE : "1996 - 1996", + FROM : "College - Virginia Tech", + TEAM_LOGO : "./images/nba_wizards.jpg" +}, { + NAME : "Carter, Anthony", + ACTIVE : "ACTIVE", + FROM : "College - Hawaii", + TEAM_LOGO : "./images/nba_kings.jpg" +}, { + NAME : "Carter, Butch", + ACTIVE : "1980 - 1985", + FROM : "College - Indiana", + TEAM_LOGO : "./images/nba_nets.jpg" +}, { + NAME : "Carter, Frederick James (Fred, Mad Dog)", + ACTIVE : "1969 - 1976", + FROM : "College - Mount St. Mary's", + TEAM_LOGO : "./images/nba_pistons.jpg" +}, { + NAME : "Carter, George", + ACTIVE : "1967 - 1967", + FROM : "College - St. Bonaventure", + TEAM_LOGO : "./images/nba_clippers.jpg" +}, { + NAME : "Carter, Howard", + ACTIVE : "1983 - 1984", + FROM : "College - Louisiana State", + TEAM_LOGO : "./images/nba_rockets.jpg" +}, { + NAME : "Carter, John D. (Jake)", + ACTIVE : "1949 - 1949", + FROM : "College - Texas A&M-Commerce", + TEAM_LOGO : "./images/nba_heats.jpg" +}, { + NAME : "Carter, Maurice", + ACTIVE : "2003 - 2003", + FROM : "College - Louisiana State ''99", + TEAM_LOGO : "./images/nba_magics.jpg" +}, { + NAME : "D'Antoni, Michael Andrew (Mike)", + ACTIVE : "1973 - 1976", + FROM : "College - Marshall", + TEAM_LOGO : "./images/nba_jazz.jpg" +}, { + NAME : "Dahler, Edward Jr. (Ed)", + ACTIVE : "1951 - 1951", + FROM : "College - Duquesne", + TEAM_LOGO : "./images/nba_trail.jpg" +}, { + NAME : "Dailey, Quintin", + ACTIVE : "1982 - 1991", + FROM : "College - San Francisco", + TEAM_LOGO : "./images/nba_magics.jpg" +}, { + NAME : "Dalembert, Samuel", + ACTIVE : "ACTIVE", + FROM : "College - Seton Hall", + TEAM_LOGO : "./images/nba_honets.jpg" +}, { + NAME : "Dallmar, Howard (Howie)", + ACTIVE : "1946 - 1948", + FROM : "College - Stanford; Pennsylvania", + TEAM_LOGO : "./images/nba_bulls.jpg" +}, { + NAME : "Dampier, Erick", + ACTIVE : "ACTIVE", + FROM : "College - Mississippi State", + TEAM_LOGO : "./images/nba_trail.jpg" +}, { + NAME : "Dampier, Louie (Lou)", + ACTIVE : "1976 - 1978", + FROM : "College - Kentucky", + TEAM_LOGO : "./images/nba_rockets.jpg" +}, { + NAME : "Dandridge, Robert L. Jr. (Bob)", + ACTIVE : "1969 - 1981", + FROM : "College - Norfolk State", + TEAM_LOGO : "./images/nba_jazz.jpg" +}, { + NAME : "Daniels, Antonio", + ACTIVE : "ACTIVE", + FROM : "College - Bowling Green", + TEAM_LOGO : "./images/nba_bobcats.jpg" +}, { + NAME : "Daniels, Erik", + ACTIVE : "2004 - 2004", + FROM : "College - Kentucky", + TEAM_LOGO : "./images/nba_griz.jpg" +}, { + NAME : "Daniels, Lloyd", + ACTIVE : "1992 - 1997", + FROM : "College - Mount San Antonio Coll. CA (J.C.)", + TEAM_LOGO : "./images/nba_nets.jpg" +}, { + NAME : "Daniels, Marquis", + ACTIVE : "ACTIVE", + FROM : "College - Auburn", + TEAM_LOGO : "./images/nba_76ers.jpg" +}, { + NAME : "Daniels, Mel", + ACTIVE : "1976 - 1976", + FROM : "College - Burlington Co. Coll. NJ (J.C.); New Mexico", + TEAM_LOGO : "./images/nba_warriors.jpg" +}, { + NAME : "Danilovic, Sasha", + ACTIVE : "1995 - 1996", + FROM : "College - Serbia", + TEAM_LOGO : "./images/nba_spurs.jpg" +}, { + NAME : "Dantley, Adrian", + ACTIVE : "1976 - 1990", + FROM : "College - Notre Dame", + TEAM_LOGO : "./images/nba_jazz.jpg" +}, { + NAME : "Darcey, Henry J. (Pete)", + ACTIVE : "1952 - 1952", + FROM : "College - Oklahoma State", + TEAM_LOGO : "./images/nba_bucks.jpg" +}, { + NAME : "Darden, James W. (Jimmy)", + ACTIVE : "1949 - 1949", + FROM : "College - Wyoming; Denver", + TEAM_LOGO : "./images/nba_heats.jpg" +}, { + NAME : "Dare, Yinka", + ACTIVE : "1994 - 1997", + FROM : "College - George Washington", + TEAM_LOGO : "./images/nba_clippers.jpg" +}, { + NAME : "Dark, Jesse L.", + ACTIVE : "1974 - 1974", + FROM : "College - Virginia Commonwealth", + TEAM_LOGO : "./images/nba_heats.jpg" +}, { + NAME : "Darrow, James K. (Jimmy)", + ACTIVE : "1961 - 1961", + FROM : "College - Bowling Green State", + TEAM_LOGO : "./images/nba_wizards.jpg" +}, { + NAME : "Daugherty, Brad", + ACTIVE : "1986 - 1993", + FROM : "College - North Carolina", + TEAM_LOGO : "./images/nba_sonics.jpg" +}, { + NAME : "David, Kornel", + ACTIVE : "1998 - 2000", + FROM : "College - Budapest AEH", + TEAM_LOGO : "./images/nba_bucks.jpg" +}, { + NAME : "Davidson, Jermareo", + ACTIVE : "2007 - 2008", + FROM : "College - Alabama", + TEAM_LOGO : "./images/nba_pacers.jpg" +}, { + NAME : "Davies, Robert Edris (Bob, Harrisburg Houdini)", + ACTIVE : "1948 - 1954", + FROM : "College - Franklin & Marshall; Seton Hall", + TEAM_LOGO : "./images/nba_bobcats.jpg" +}, { + NAME : "Davis, Antonio", + ACTIVE : "1993 - 2005", + FROM : "College - Texas-El Paso", + TEAM_LOGO : "./images/nba_bulls.jpg" +}, { + NAME : "Davis, Aubrey D.", + ACTIVE : "1946 - 1946", + FROM : "College - Oklahoma Baptist", + TEAM_LOGO : "./images/nba_trail.jpg" +}, { + NAME : "Davis, Baron", + ACTIVE : "ACTIVE", + FROM : "College - UCLA", + TEAM_LOGO : "./images/nba_wizards.jpg" +}, { + NAME : "Davis, Ben", + ACTIVE : "1996 - 1999", + FROM : "College - Arizona ''96", + TEAM_LOGO : "./images/nba_bucks.jpg" +}, { + NAME : "Davis, Brad", + ACTIVE : "1977 - 1991", + FROM : "College - Maryland", + TEAM_LOGO : "./images/nba_jazz.jpg" +}, { + NAME : "Davis, Brian", + ACTIVE : "1993 - 1993", + FROM : "College - Duke", + TEAM_LOGO : "./images/nba_cavaliers.jpg" +}, { + NAME : "Davis, Charles Lawrence (Charlie)", + ACTIVE : "1971 - 1973", + FROM : "College - Wake Forest", + TEAM_LOGO : "./images/nba_magics.jpg" +}, { + NAME : "Davis, Charlie E.", + ACTIVE : "1981 - 1989", + FROM : "College - Vanderbilt", + TEAM_LOGO : "./images/nba_jazz.jpg" +}, { + NAME : "Davis, Dale", + ACTIVE : "1991 - 2006", + FROM : "College - Clemson", + TEAM_LOGO : "./images/nba_pacers.jpg" +}, { + NAME : "Davis, Damon William (Monti)", + ACTIVE : "1980 - 1980", + FROM : "College - Tennessee State", + TEAM_LOGO : "./images/nba_timberwolves.jpg" +}, { + NAME : "Davis, Dwight E. (Double D)", + ACTIVE : "1972 - 1976", + FROM : "College - Houston", + TEAM_LOGO : "./images/nba_bulls.jpg" +}, { + NAME : "Davis, Ed", + ACTIVE : "ACTIVE", + FROM : "College - North Carolina", + TEAM_LOGO : "./images/nba_lakers.jpg" +}, { + NAME : "Davis, Edward J. (Mickey)", + ACTIVE : "1972 - 1976", + FROM : "College - Duquesne", + TEAM_LOGO : "./images/nba_wizards.jpg" +}, { + NAME : "Davis, Emanual", + ACTIVE : "1996 - 2002", + FROM : "College - Delaware State ''91", + TEAM_LOGO : "./images/nba_rockets.jpg" +}, { + NAME : "Davis, Glen", + ACTIVE : "ACTIVE", + FROM : "College - Louisiana State", + TEAM_LOGO : "./images/nba_lakers.jpg" +}, { + NAME : "Davis, Harry A.", + ACTIVE : "1978 - 1979", + FROM : "College - Florida State", + TEAM_LOGO : "./images/nba_heats.jpg" +}, { + NAME : "Davis, Hubert", + ACTIVE : "1992 - 2003", + FROM : "College - North Carolina ''92", + TEAM_LOGO : "./images/nba_nuggets.jpg" +}, { + NAME : "Davis, James R. (Red)", + ACTIVE : "1955 - 1955", + FROM : "College - St. John's (N.Y.)", + TEAM_LOGO : "./images/nba_hawks.jpg" +}, { + NAME : "Davis, James W. (Jim)", + ACTIVE : "1967 - 1974", + FROM : "College - Colorado", + TEAM_LOGO : "./images/nba_knics.jpg" +}, { + NAME : "Davis, Johnny", + ACTIVE : "1976 - 1985", + FROM : "College - Dayton", + TEAM_LOGO : "./images/nba_trail.jpg" +}, { + NAME : "Davis, Josh", + ACTIVE : "2003 - 2005", + FROM : "College - Wyoming", + TEAM_LOGO : "./images/nba_sonics.jpg" +}, { + NAME : "Davis, Mark", + ACTIVE : "1988 - 1988", + FROM : "College - Old Dominion", + TEAM_LOGO : "./images/nba_sonics.jpg" +}, { + NAME : "Davis, Mark", + ACTIVE : "1995 - 1999", + FROM : "College - Texas Tech", + TEAM_LOGO : "./images/nba_bucks.jpg" +}, { + NAME : "Davis, Melvyn Jerome (Mel, Killer)", + ACTIVE : "1973 - 1976", + FROM : "College - St. John's (N.Y.)", + TEAM_LOGO : "./images/nba_timberwolves.jpg" +}, { + NAME : "Davis, Michael", + ACTIVE : "1982 - 1982", + FROM : "College - Mercer Co. CC NJ; Maryland", + TEAM_LOGO : "./images/nba_spurs.jpg" +}, { + NAME : "Davis, Michael A. (Mike, Crusher)", + ACTIVE : "1969 - 1972", + FROM : "College - Virginia Union", + TEAM_LOGO : "./images/nba_heats.jpg" +}, { + NAME : "Eackles, Ledell", + ACTIVE : "1988 - 1997", + FROM : "College - San Jacinto Coll. TX (J.C.); New Orleans", + TEAM_LOGO : "./images/nba_mavericks.jpg" +}, { + NAME : "Eakins, James Scott (Jim, Jimbo)", + ACTIVE : "1976 - 1977", + FROM : "College - Brigham Young", + TEAM_LOGO : "./images/nba_lakers.jpg" +}, { + NAME : "Earl, Acie", + ACTIVE : "1993 - 1996", + FROM : "College - Iowa", + TEAM_LOGO : "./images/nba_bobcats.jpg" +}, { + NAME : "Earle, Edwin (Ed)", + ACTIVE : "1953 - 1953", + FROM : "College - Loyola (Chicago)", + TEAM_LOGO : "./images/nba_pistons.jpg" +}, { + NAME : "Eaton, Mark", + ACTIVE : "1982 - 1992", + FROM : "College - Cypress Coll. CA (J.C.); UCLA", + TEAM_LOGO : "./images/nba_timberwolves.jpg" +}, { + NAME : "Eaves, Jerry", + ACTIVE : "1982 - 1986", + FROM : "College - Louisville", + TEAM_LOGO : "./images/nba_suns.jpg" +}, { + NAME : "Ebanks, Devin", + ACTIVE : "ACTIVE", + FROM : "College - West Virginia", + TEAM_LOGO : "./images/nba_lakers.jpg" +}, { + NAME : "Ebben, William Edward (Bill)", + ACTIVE : "1957 - 1957", + FROM : "College - Detroit", + TEAM_LOGO : "./images/nba_sonics.jpg" +}, { + NAME : "Eberhard, Allen Dean (Al)", + ACTIVE : "1974 - 1977", + FROM : "College - Missouri", + TEAM_LOGO : "./images/nba_bobcats.jpg" +}, { + NAME : "Ebi, Ndudi", + ACTIVE : "2003 - 2004", + FROM : "High School - Westbury Christian HS (TX)", + TEAM_LOGO : "./images/nba_mavericks.jpg" +}, { + NAME : "Eddie, Patrick", + ACTIVE : "1991 - 1991", + FROM : "College - Arkansas State; Mississippi", + TEAM_LOGO : "./images/nba_griz.jpg" +}, { + NAME : "Eddleman, Thomas Dwight (Dike)", + ACTIVE : "1949 - 1952", + FROM : "College - Illinois", + TEAM_LOGO : "./images/nba_clippers.jpg" +}, { + NAME : "Edelin, Kenton Scott (Kent)", + ACTIVE : "1984 - 1984", + FROM : "College - Virginia", + TEAM_LOGO : "./images/nba_magics.jpg" +}, { + NAME : "Edmonson, Keith", + ACTIVE : "1982 - 1983", + FROM : "College - Purdue", + TEAM_LOGO : "./images/nba_spurs.jpg" +}, { + NAME : "Edney, Tyus", + ACTIVE : "1995 - 2000", + FROM : "College - UCLA", + TEAM_LOGO : "./images/nba_timberwolves.jpg" +}, { + NAME : "Edwards, Bill", + ACTIVE : "1993 - 1993", + FROM : "College - Wright State", + TEAM_LOGO : "./images/nba_clippers.jpg" +}, { + NAME : "Edwards, Blue", + ACTIVE : "1989 - 1998", + FROM : "College - Louisburg; East Carolina", + TEAM_LOGO : "./images/nba_kings.jpg" +}, { + NAME : "Edwards, Corsley", + ACTIVE : "2004 - 2004", + FROM : "College - Central Connecticut State '02", + TEAM_LOGO : "./images/nba_rockets.jpg" +}, { + NAME : "Edwards, Doug", + ACTIVE : "1993 - 1995", + FROM : "College - Florida State", + TEAM_LOGO : "./images/nba_griz.jpg" +}, { + NAME : "Edwards, Franklin", + ACTIVE : "1981 - 1987", + FROM : "College - Cleveland State", + TEAM_LOGO : "./images/nba_timberwolves.jpg" +}, { + NAME : "Edwards, James", + ACTIVE : "1977 - 1995", + FROM : "College - Washington", + TEAM_LOGO : "./images/nba_wizards.jpg" +}, { + NAME : "Edwards, Jay", + ACTIVE : "1989 - 1989", + FROM : "College - Indiana", + TEAM_LOGO : "./images/nba_jazz.jpg" +}, { + NAME : "Edwards, John", + ACTIVE : "2004 - 2005", + FROM : "College - Kent State", + TEAM_LOGO : "./images/nba_clippers.jpg" +}, { + NAME : "Edwards, Kevin", + ACTIVE : "1988 - 2000", + FROM : "College - Lakeland CC OH; DePaul", + TEAM_LOGO : "./images/nba_warriors.jpg" +}, { + NAME : "Egan, John Francis (Johnny)", + ACTIVE : "1961 - 1971", + FROM : "College - Providence", + TEAM_LOGO : "./images/nba_bobcats.jpg" +}, { + NAME : "Eggleston, Lonnie J.", + ACTIVE : "1948 - 1948", + FROM : "College - Oklahoma State", + TEAM_LOGO : "./images/nba_suns.jpg" +}, { + NAME : "Ehlers, Edwin S. (Eddie, Bulbs)", + ACTIVE : "1947 - 1948", + FROM : "College - Purdue", + TEAM_LOGO : "./images/nba_mavericks.jpg" +}, { + NAME : "Ehlo, Craig", + ACTIVE : "1983 - 1996", + FROM : "College - Odessa Coll. TX (J.C.); Washington State", + TEAM_LOGO : "./images/nba_spurs.jpg" +}, { + NAME : "Eichhorst, Richard A. (Dick)", + ACTIVE : "1961 - 1961", + FROM : "College - Southeast Missouri State", + TEAM_LOGO : "./images/nba_timberwolves.jpg" +}, { + NAME : "Eisley, Howard", + ACTIVE : "1994 - 2005", + FROM : "College - Boston College", + TEAM_LOGO : "./images/nba_spurs.jpg" +}, { + NAME : "Ekezie, Obinna", + ACTIVE : "1999 - 2004", + FROM : "College - Maryland", + TEAM_LOGO : "./images/nba_pacers.jpg" +}, { + NAME : "El-Amin, Khalid", + ACTIVE : "2000 - 2000", + FROM : "College - Connecticut ''01", + TEAM_LOGO : "./images/nba_sonics.jpg" +}, { + NAME : "Eliason, Donald Carlton (Don)", + ACTIVE : "1946 - 1946", + FROM : "College - Hamline", + TEAM_LOGO : "./images/nba_bucks.jpg" +}, { + NAME : "Elie, Mario", + ACTIVE : "1990 - 2000", + FROM : "College - American International", + TEAM_LOGO : "./images/nba_trail.jpg" +}, { + NAME : "Ellefson, E. Ray (Ray)", + ACTIVE : "1948 - 1950", + FROM : "College - Oklahoma State; Colorado; West Texas A&M", + TEAM_LOGO : "./images/nba_knics.jpg" +}, { + NAME : "Ellington, Wayne", + ACTIVE : "ACTIVE", + FROM : "College - North Carolina", + TEAM_LOGO : "./images/nba_nuggets.jpg" +}, { + NAME : "Elliott, Robert Alan (Bob)", + ACTIVE : "1978 - 1980", + FROM : "College - Arizona", + TEAM_LOGO : "./images/nba_raptors.jpg" +}, { + NAME : "Elliott, Sean", + ACTIVE : "1989 - 2000", + FROM : "College - Arizona", + TEAM_LOGO : "./images/nba_lakers.jpg" +}, { + NAME : "Ellis, Alexander (Boo)", + ACTIVE : "1958 - 1959", + FROM : "College - Niagara", + TEAM_LOGO : "./images/nba_clippers.jpg" +}, { + NAME : "Ellis, Dale", + ACTIVE : "1983 - 1999", + FROM : "College - Tennessee", + TEAM_LOGO : "./images/nba_nets.jpg" +}, { + NAME : "Ellis, Harold", + ACTIVE : "1993 - 1997", + FROM : "College - Morehouse", + TEAM_LOGO : "./images/nba_nuggets.jpg" +}, { + NAME : "Ellis, Joe", + ACTIVE : "1966 - 1973", + FROM : "College - San Francisco", + TEAM_LOGO : "./images/nba_wizards.jpg" +}, { + NAME : "Ellis, LaPhonso", + ACTIVE : "1992 - 2002", + FROM : "College - Notre Dame ''92", + TEAM_LOGO : "./images/nba_timberwolves.jpg" +}, { + NAME : "Ellis, LeRon", + ACTIVE : "1991 - 1995", + FROM : "College - Kentucky; Syracuse", + TEAM_LOGO : "./images/nba_nuggets.jpg" +}, { + NAME : "Ellis, Leroy", + ACTIVE : "1962 - 1975", + FROM : "College - St. John's (N.Y.)", + TEAM_LOGO : "./images/nba_clippers.jpg" +}, { + NAME : "Ellis, Maurice H. (Bo)", + ACTIVE : "1977 - 1979", + FROM : "College - Marquette", + TEAM_LOGO : "./images/nba_celtics.jpg" +}, { + NAME : "Ellis, Monta", + ACTIVE : "ACTIVE", + FROM : "High School - Lanier HS (Jackson, MS)", + TEAM_LOGO : "./images/nba_lakers.jpg" +}, { + NAME : "Ellison, Pervis", + ACTIVE : "1989 - 2000", + FROM : "College - Louisville", + TEAM_LOGO : "./images/nba_pacers.jpg" +}, { + NAME : "Elmore, Len", + ACTIVE : "1976 - 1983", + FROM : "College - Maryland", + TEAM_LOGO : "./images/nba_bulls.jpg" +}, { + NAME : "Elson, Francisco", + ACTIVE : "ACTIVE", + FROM : "College - California", + TEAM_LOGO : "./images/nba_kings.jpg" +}, { + NAME : "Fabel, Joseph (Joe)", + ACTIVE : "1946 - 1946", + FROM : "College - Pittsburgh", + TEAM_LOGO : "./images/nba_knics.jpg" +}, { + NAME : "Fairchild, John Russell", + ACTIVE : "1965 - 1965", + FROM : "College - Palomar Coll. CA (J.C.); Brigham Young", + TEAM_LOGO : "./images/nba_trail.jpg" +}, { + NAME : "Farbman, Philip M. (Phil)", + ACTIVE : "1948 - 1948", + FROM : "College - CCNY; Brooklyn College", + TEAM_LOGO : "./images/nba_pacers.jpg" +}, { + NAME : "Farley, Richard L. (Dick)", + ACTIVE : "1954 - 1958", + FROM : "College - Indiana", + TEAM_LOGO : "./images/nba_pacers.jpg" +}, { + NAME : "Farmar, Jordan", + ACTIVE : "ACTIVE", + FROM : "College - UCLA", + TEAM_LOGO : "./images/nba_raptors.jpg" +}, { + NAME : "Farmer, Desmon", + ACTIVE : "2006 - 2008", + FROM : "College - USC", + TEAM_LOGO : "./images/nba_sonics.jpg" +}, { + NAME : "Farmer, Don Michael (Mike)", + ACTIVE : "1958 - 1965", + FROM : "College - San Francisco", + TEAM_LOGO : "./images/nba_heats.jpg" +}, { + NAME : "Farmer, Jim", + ACTIVE : "1987 - 1993", + FROM : "College - Alabama", + TEAM_LOGO : "./images/nba_warriors.jpg" +}, { + NAME : "Farmer, Tony", + ACTIVE : "1997 - 1999", + FROM : "College - Nebraska", + TEAM_LOGO : "./images/nba_honets.jpg" +}, { + NAME : "Faught, Robert Edward (Bob)", + ACTIVE : "1946 - 1946", + FROM : "College - Notre Dame", + TEAM_LOGO : "./images/nba_sonics.jpg" +}, { + NAME : "Favors, Derrick", + ACTIVE : "ACTIVE", + FROM : "College - Georgia Tech", + TEAM_LOGO : "./images/nba_sonics.jpg" +}, { + NAME : "Fazekas, Nick", + ACTIVE : "2007 - 2007", + FROM : "College - Nevada-Reno", + TEAM_LOGO : "./images/nba_raptors.jpg" +}, { + NAME : "Fedor, Samuel David (Dave)", + ACTIVE : "1962 - 1962", + FROM : "College - Florida State", + TEAM_LOGO : "./images/nba_clippers.jpg" +}, { + NAME : "Feerick, Robert Joseph (Bob)", + ACTIVE : "1946 - 1949", + FROM : "College - Santa Clara", + TEAM_LOGO : "./images/nba_pistons.jpg" +}, { + NAME : "Feher, Raymond G. (Butch)", + ACTIVE : "1976 - 1976", + FROM : "College - Vanderbilt", + TEAM_LOGO : "./images/nba_nets.jpg" +}, { + NAME : "Feick, Jamie", + ACTIVE : "1996 - 2000", + FROM : "College - Michigan State ''96", + TEAM_LOGO : "./images/nba_rockets.jpg" +}, { + NAME : "Feiereisel, Ronald E. (Ron)", + ACTIVE : "1955 - 1955", + FROM : "College - DePaul", + TEAM_LOGO : "./images/nba_timberwolves.jpg" +}, { + NAME : "Feigenbaum, George", + ACTIVE : "1949 - 1952", + FROM : "College - Long Island University; Kentucky", + TEAM_LOGO : "./images/nba_76ers.jpg" +}, { + NAME : "Feitl, Dave", + ACTIVE : "1986 - 1991", + FROM : "College - Texas-El Paso", + TEAM_LOGO : "./images/nba_cavaliers.jpg" +}, { + NAME : "Felix, Noel", + ACTIVE : "2005 - 2005", + FROM : "College - Fresno State", + TEAM_LOGO : "./images/nba_hawks.jpg" +}, { + NAME : "Felix, Ray", + ACTIVE : "1953 - 1961", + FROM : "College - Long Island University", + TEAM_LOGO : "./images/nba_clippers.jpg" +}, { + NAME : "Felton, Raymond", + ACTIVE : "ACTIVE", + FROM : "College - North Carolina", + TEAM_LOGO : "./images/nba_kings.jpg" +}, { + NAME : "Fendley, John Phillip (Jake)", + ACTIVE : "1951 - 1952", + FROM : "College - Northwestern", + TEAM_LOGO : "./images/nba_spurs.jpg" +}, { + NAME : "Fenley, William Warren (Bill)", + ACTIVE : "1946 - 1946", + FROM : "College - Manhattan", + TEAM_LOGO : "./images/nba_bobcats.jpg" +}, { + NAME : "Ferguson, Desmond", + ACTIVE : "2003 - 2003", + FROM : "College - Detroit", + TEAM_LOGO : "./images/nba_jazz.jpg" +}, { + NAME : "Fernandez, Rudy", + ACTIVE : "ACTIVE", + FROM : "From - Palma de Mallorca, Spain", + TEAM_LOGO : "./images/nba_spurs.jpg" +}, { + NAME : "Fernsten, Eric", + ACTIVE : "1975 - 1983", + FROM : "College - San Francisco", + TEAM_LOGO : "./images/nba_spurs.jpg" +}, { + NAME : "Ferrari, Albert R. (Al)", + ACTIVE : "1955 - 1962", + FROM : "College - Michigan State", + TEAM_LOGO : "./images/nba_jazz.jpg" +}, { + NAME : "Ferreira, Rolando", + ACTIVE : "1988 - 1988", + FROM : "College - Houston", + TEAM_LOGO : "./images/nba_jazz.jpg" +}, { + NAME : "Ferrell, Duane", + ACTIVE : "1988 - 1998", + FROM : "College - Georgia Tech", + TEAM_LOGO : "./images/nba_cavaliers.jpg" +}, { + NAME : "Ferrin, C. Arnold Jr. (Arnie)", + ACTIVE : "1948 - 1950", + FROM : "College - Utah", + TEAM_LOGO : "./images/nba_nets.jpg" +}, { + NAME : "Ferry, Danny", + ACTIVE : "1990 - 2002", + FROM : "College - Duke ''89", + TEAM_LOGO : "./images/nba_raptors.jpg" +}, { + NAME : "Ferry, Robert Dean (Bob)", + ACTIVE : "1959 - 1968", + FROM : "College - St. Louis", + TEAM_LOGO : "./images/nba_nuggets.jpg" +}, { + NAME : "Fesenko, Kyrylo", + ACTIVE : "ACTIVE", + FROM : "From - Dnepropetrovsk, Ukraine", + TEAM_LOGO : "./images/nba_warriors.jpg" +}, { + NAME : "Fields, Kenny", + ACTIVE : "1984 - 1987", + FROM : "College - UCLA", + TEAM_LOGO : "./images/nba_pacers.jpg" +}, { + NAME : "Fields, Landry", + ACTIVE : "ACTIVE", + FROM : "College - Stanford", + TEAM_LOGO : "./images/nba_knics.jpg" +}, { + NAME : "Filipek, Ronald Stanley (Ron)", + ACTIVE : "1967 - 1967", + FROM : "College - Tennessee Tech", + TEAM_LOGO : "./images/nba_suns.jpg" +}, { + NAME : "Fillmore, Gregory Paul (Greg)", + ACTIVE : "1970 - 1971", + FROM : "College - Iowa Central CC; Cheyney", + TEAM_LOGO : "./images/nba_bulls.jpg" +}, { + NAME : "Finkel, Henry J. (Hank)", + ACTIVE : "1966 - 1974", + FROM : "College - St. Peter's; Dayton", + TEAM_LOGO : "./images/nba_celtics.jpg" +}, { + NAME : "Finley, Michael", + ACTIVE : "2007 - 2009", + FROM : "College - Wisconsin", + TEAM_LOGO : "./images/nba_pistons.jpg" +}, { + NAME : "Finn, Daniel Lawrence Jr. (Danny)", + ACTIVE : "1952 - 1954", + FROM : "College - St. John's (N.Y.)", + TEAM_LOGO : "./images/nba_knics.jpg" +}, { + NAME : "Fish, Matt", + ACTIVE : "1994 - 1996", + FROM : "College - Wilmington", + TEAM_LOGO : "./images/nba_nets.jpg" +}, { + NAME : "Fisher, Derek", + ACTIVE : "ACTIVE", + FROM : "College - Arkansas-Little Rock", + TEAM_LOGO : "./images/nba_honets.jpg" +}, { + NAME : "Fitch, Gerald", + ACTIVE : "2005 - 2005", + FROM : "College - Kentucky", + TEAM_LOGO : "./images/nba_raptors.jpg" +}, { + NAME : "Fitzgerald, Richard (Dick)", + ACTIVE : "1946 - 1947", + FROM : "College - Seton Hall", + TEAM_LOGO : "./images/nba_knics.jpg" +}, { + NAME : "Fitzgerald, Robert (Bob)", + ACTIVE : "1946 - 1948", + FROM : "College - Fordham", + TEAM_LOGO : "./images/nba_clippers.jpg" +}, { + NAME : "Fizer, Marcus", + ACTIVE : "2000 - 2005", + FROM : "College - Iowa State", + TEAM_LOGO : "./images/nba_pacers.jpg" +}, { + NAME : "Fleishman, Jerome (Jerry)", + ACTIVE : "1946 - 1952", + FROM : "College - N.Y.U.; Long Island University", + TEAM_LOGO : "./images/nba_celtics.jpg" +}, { + NAME : "Fleming, Albert Jr. (Al)", + ACTIVE : "1977 - 1977", + FROM : "College - Arizona", + TEAM_LOGO : "./images/nba_heats.jpg" +}, { + NAME : "Fleming, Edward R. (Ed)", + ACTIVE : "1955 - 1959", + FROM : "College - Niagara", + TEAM_LOGO : "./images/nba_timberwolves.jpg" +}, { + NAME : "Gabor, William A. (Billy, The Human Projectile)", + ACTIVE : "1949 - 1954", + FROM : "College - Syracuse", + TEAM_LOGO : "./images/nba_cavaliers.jpg" +}, { + NAME : "Gadzuric, Dan", + ACTIVE : "ACTIVE", + FROM : "College - UCLA", + TEAM_LOGO : "./images/nba_pistons.jpg" +}, { + NAME : "Gai, Deng", + ACTIVE : "2005 - 2005", + FROM : "College - Fairfield", + TEAM_LOGO : "./images/nba_cavaliers.jpg" +}, { + NAME : "Gainer, Elmer R.", + ACTIVE : "1947 - 1949", + FROM : "College - DePaul", + TEAM_LOGO : "./images/nba_pacers.jpg" +}, { + NAME : "Gaines, Corey", + ACTIVE : "1988 - 1994", + FROM : "College - UCLA; Loyola Marymount", + TEAM_LOGO : "./images/nba_honets.jpg" +}, { + NAME : "Gaines, Reece", + ACTIVE : "2003 - 2005", + FROM : "College - Louisville", + TEAM_LOGO : "./images/nba_bulls.jpg" +}, { + NAME : "Gaines, Sundiata", + ACTIVE : "ACTIVE", + FROM : "College - Georgia", + TEAM_LOGO : "./images/nba_bucks.jpg" +}, { + NAME : "Gale, Mike", + ACTIVE : "1976 - 1981", + FROM : "College - Elizabeth City State", + TEAM_LOGO : "./images/nba_76ers.jpg" +}, { + NAME : "Gallagher, Chad", + ACTIVE : "1993 - 1993", + FROM : "College - Creighton", + TEAM_LOGO : "./images/nba_nets.jpg" +}, { + NAME : "Gallatin, Harry", + ACTIVE : "1948 - 1957", + FROM : "College - Northeast Missouri State", + TEAM_LOGO : "./images/nba_timberwolves.jpg" +}, { + NAME : "Gallinari, Danilo", + ACTIVE : "ACTIVE", + FROM : "From - Milan, Italy", + TEAM_LOGO : "./images/nba_warriors.jpg" +}, { + NAME : "Gambee, Dave", + ACTIVE : "1958 - 1969", + FROM : "College - Oregon State", + TEAM_LOGO : "./images/nba_honets.jpg" +}, { + NAME : "Gamble, Kevin", + ACTIVE : "1987 - 1996", + FROM : "College - Lincoln Trail IL (J.C.); Iowa", + TEAM_LOGO : "./images/nba_bucks.jpg" +}, { + NAME : "Gantt, Robert M. Jr. (Bob)", + ACTIVE : "1946 - 1946", + FROM : "College - Duke", + TEAM_LOGO : "./images/nba_bulls.jpg" +}, { + NAME : "Garbajosa, Jorge", + ACTIVE : "2007 - 2007", + FROM : "From - Spain", + TEAM_LOGO : "./images/nba_mavericks.jpg" +}, { + NAME : "Garces, Ruben", + ACTIVE : "2000 - 2000", + FROM : "College - Providence", + TEAM_LOGO : "./images/nba_rockets.jpg" +}, { + NAME : "Garcia, Alex", + ACTIVE : "2003 - 2004", + FROM : "From - Brazil", + TEAM_LOGO : "./images/nba_bulls.jpg" +}, { + NAME : "Garcia, Francisco", + ACTIVE : "ACTIVE", + FROM : "College - Louisville", + TEAM_LOGO : "./images/nba_mavericks.jpg" +}, { + NAME : "Gardner, Earl Baker (Red)", + ACTIVE : "1948 - 1948", + FROM : "College - Wabash; DePauw", + TEAM_LOGO : "./images/nba_bulls.jpg" +}, { + NAME : "Gardner, Thomas", + ACTIVE : "2007 - 2008", + FROM : "College - Missouri", + TEAM_LOGO : "./images/nba_bulls.jpg" +}, { + NAME : "Gardner, Vern B.", + ACTIVE : "1949 - 1951", + FROM : "College - Wyoming; Utah", + TEAM_LOGO : "./images/nba_suns.jpg" +}, { + NAME : "Garfinkel, Jack (Dutch)", + ACTIVE : "1946 - 1948", + FROM : "College - St. John's (N.Y.)", + TEAM_LOGO : "./images/nba_knics.jpg" +}, { + NAME : "Garland, Gary J.", + ACTIVE : "1979 - 1979", + FROM : "College - DePaul", + TEAM_LOGO : "./images/nba_sonics.jpg" +}, { + NAME : "Garland, Winston", + ACTIVE : "1987 - 1994", + FROM : "College - Southeastern CC IA; Southwest Missouri State", + TEAM_LOGO : "./images/nba_warriors.jpg" +}, { + NAME : "Garmaker, Richard Eugene (Dick)", + ACTIVE : "1955 - 1960", + FROM : "College - Hibbing CC MN; Minnesota", + TEAM_LOGO : "./images/nba_cavaliers.jpg" +}, { + NAME : "Garner, Chris", + ACTIVE : "1997 - 2000", + FROM : "College - Memphis", + TEAM_LOGO : "./images/nba_celtics.jpg" +}, { + NAME : "Garnett, Bill", + ACTIVE : "1982 - 1985", + FROM : "College - Wyoming", + TEAM_LOGO : "./images/nba_lakers.jpg" +}, { + NAME : "Garnett, Kevin", + ACTIVE : "ACTIVE", + FROM : "High School - Farragut Academy HS (IL)", + TEAM_LOGO : "./images/nba_warriors.jpg" +}, { + NAME : "Garnett, Marlon", + ACTIVE : "1998 - 1998", + FROM : "College - Santa Clara", + TEAM_LOGO : "./images/nba_heats.jpg" +}, { + NAME : "Garrett, Calvin", + ACTIVE : "1980 - 1983", + FROM : "College - Austin Peay State; Oral Roberts", + TEAM_LOGO : "./images/nba_rockets.jpg" +}, { + NAME : "Garrett, Dean", + ACTIVE : "1996 - 2001", + FROM : "College - Indiana", + TEAM_LOGO : "./images/nba_kings.jpg" +}, { + NAME : "Garrett, Eldo (Dick)", + ACTIVE : "1969 - 1973", + FROM : "College - Southern Illinois", + TEAM_LOGO : "./images/nba_cavaliers.jpg" +}, { + NAME : "Garrett, Rowland G.", + ACTIVE : "1972 - 1976", + FROM : "College - Florida State", + TEAM_LOGO : "./images/nba_hawks.jpg" +}, { + NAME : "Garrick, Tom", + ACTIVE : "1988 - 1991", + FROM : "College - Rhode Island", + TEAM_LOGO : "./images/nba_bucks.jpg" +}, { + NAME : "Garris, John", + ACTIVE : "1983 - 1983", + FROM : "College - Michigan; Boston College", + TEAM_LOGO : "./images/nba_griz.jpg" +}, { + NAME : "Garris, Kiwane", + ACTIVE : "1997 - 1999", + FROM : "College - Illinois", + TEAM_LOGO : "./images/nba_celtics.jpg" +}, { + NAME : "Garrity, Pat", + ACTIVE : "2007 - 2007", + FROM : "College - Notre Dame", + TEAM_LOGO : "./images/nba_warriors.jpg" +}, { + NAME : "Garvin, James D. (Jim)", + ACTIVE : "1973 - 1973", + FROM : "College - Boston U.", + TEAM_LOGO : "./images/nba_suns.jpg" +}, { + NAME : "Gasol, Marc", + ACTIVE : "ACTIVE", + FROM : "From - Barcelona, Spain", + TEAM_LOGO : "./images/nba_bucks.jpg" +}, { + NAME : "Gasol, Pau", + ACTIVE : "ACTIVE", + FROM : "From - Barcelona, Spain", + TEAM_LOGO : "./images/nba_suns.jpg" +}, { + NAME : "Gates, Ben Frank (Frank, Needle)", + ACTIVE : "1949 - 1949", + FROM : "College - Sam Houston State", + TEAM_LOGO : "./images/nba_wizards.jpg" +}, { + NAME : "Gatling, Chris", + ACTIVE : "1991 - 2001", + FROM : "College - Pittsburgh; Old Dominion", + TEAM_LOGO : "./images/nba_warriors.jpg" +}, { + NAME : "Gattison, Kenny", + ACTIVE : "1986 - 1995", + FROM : "College - Old Dominion", + TEAM_LOGO : "./images/nba_wizards.jpg" +}, { + NAME : "Gay, Rudy", + ACTIVE : "ACTIVE", + FROM : "College - Connecticut", + TEAM_LOGO : "./images/nba_bobcats.jpg" +}, { + NAME : "Gayda, Edward C. (Ed)", + ACTIVE : "1950 - 1950", + FROM : "College - Washington State", + TEAM_LOGO : "./images/nba_mavericks.jpg" +}, { + NAME : "Gaze, Andrew", + ACTIVE : "1993 - 1998", + FROM : "College - Seton Hall", + TEAM_LOGO : "./images/nba_warriors.jpg" +}, { + NAME : "Geary, Reggie", + ACTIVE : "1996 - 1997", + FROM : "College - Arizona", + TEAM_LOGO : "./images/nba_heats.jpg" +}, { + NAME : "Gee, Alonzo", + ACTIVE : "ACTIVE", + FROM : "College - Alabama", + TEAM_LOGO : "./images/nba_nuggets.jpg" +}, { + NAME : "Geiger, Matt", + ACTIVE : "1992 - 2001", + FROM : "College - Auburn; Georgia Tech", + TEAM_LOGO : "./images/nba_bucks.jpg" +}, { + NAME : "Gelabale, Mickael", + ACTIVE : "2007 - 2007", + FROM : "From - France", + TEAM_LOGO : "./images/nba_rockets.jpg" +}, { + NAME : "Hackett, Rudolph (Rudy)", + ACTIVE : "1976 - 1976", + FROM : "College - Syracuse", + TEAM_LOGO : "./images/nba_jazz.jpg" +}, { + NAME : "Haddadi, Hamed", + ACTIVE : "ACTIVE", + FROM : "From - Ahvaz, Iran", + TEAM_LOGO : "./images/nba_cavaliers.jpg" +}, { + NAME : "Haffner, Scott", + ACTIVE : "1989 - 1990", + FROM : "College - Illinois; Evansville", + TEAM_LOGO : "./images/nba_heats.jpg" +}, { + NAME : "Hagan, Cliff", + ACTIVE : "1956 - 1965", + FROM : "College - Kentucky", + TEAM_LOGO : "./images/nba_cavaliers.jpg" +}, { + NAME : "Hagan, Glenn Kassabin", + ACTIVE : "1981 - 1981", + FROM : "College - St. Bonaventure", + TEAM_LOGO : "./images/nba_pistons.jpg" +}, { + NAME : "Hahn, Robert B. (Bob)", + ACTIVE : "1949 - 1949", + FROM : "College - North Carolina State", + TEAM_LOGO : "./images/nba_cavaliers.jpg" +}, { + NAME : "Hairston, Alan Leroy (Al)", + ACTIVE : "1968 - 1969", + FROM : "College - St. Clair Co. CC MI; Bowling Green State", + TEAM_LOGO : "./images/nba_timberwolves.jpg" +}, { + NAME : "Hairston, Happy", + ACTIVE : "1964 - 1974", + FROM : "College - N.Y.U.", + TEAM_LOGO : "./images/nba_magics.jpg" +}, { + NAME : "Hairston, Lindsay (Spider)", + ACTIVE : "1975 - 1975", + FROM : "College - Michigan State", + TEAM_LOGO : "./images/nba_pistons.jpg" +}, { + NAME : "Hairston, Malik", + ACTIVE : "2008 - 2009", + FROM : "College - Oregon", + TEAM_LOGO : "./images/nba_wizards.jpg" +}, { + NAME : "Haislip, Marcus", + ACTIVE : "2002 - 2009", + FROM : "College - Tennessee", + TEAM_LOGO : "./images/nba_pistons.jpg" +}, { + NAME : "Halbert, Charles P. (Chuck)", + ACTIVE : "1946 - 1950", + FROM : "College - West Texas A&M", + TEAM_LOGO : "./images/nba_bucks.jpg" +}, { + NAME : "Halbrook, Harvey Wade (Swede)", + ACTIVE : "1960 - 1961", + FROM : "College - Oregon State", + TEAM_LOGO : "./images/nba_pacers.jpg" +}, { + NAME : "Hale, William Bruce (Bruce)", + ACTIVE : "1948 - 1950", + FROM : "College - Santa Clara", + TEAM_LOGO : "./images/nba_bulls.jpg" +}, { + NAME : "Haley, Jack", + ACTIVE : "1988 - 1997", + FROM : "College - Golden West Coll. CA (J.C.); UCLA", + TEAM_LOGO : "./images/nba_jazz.jpg" +}, { + NAME : "Halimon, Shaler Jr.", + ACTIVE : "1968 - 1971", + FROM : "College - Imperial Valley Coll. CA (J.C.); Utah State", + TEAM_LOGO : "./images/nba_timberwolves.jpg" +}, { + NAME : "Hall, Mike", + ACTIVE : "2006 - 2006", + FROM : "College - George Washington", + TEAM_LOGO : "./images/nba_hawks.jpg" +}, { + NAME : "Halliburton, Jeffrey (Jeff)", + ACTIVE : "1971 - 1972", + FROM : "College - San Jacinto Coll. TX (J.C.); Drake", + TEAM_LOGO : "./images/nba_spurs.jpg" +}, { + NAME : "Ham, Darvin", + ACTIVE : "1996 - 2004", + FROM : "College - Texas Tech", + TEAM_LOGO : "./images/nba_clippers.jpg" +}, { + NAME : "Hamer, Steve", + ACTIVE : "1996 - 1996", + FROM : "College - Tennessee", + TEAM_LOGO : "./images/nba_kings.jpg" +}, { + NAME : "Hamilton, Dale B.", + ACTIVE : "1949 - 1949", + FROM : "College - Franklin (Ind.)", + TEAM_LOGO : "./images/nba_jazz.jpg" +}, { + NAME : "Hamilton, Dennis Eugene", + ACTIVE : "1967 - 1968", + FROM : "College - Arizona State", + TEAM_LOGO : "./images/nba_pistons.jpg" +}, { + NAME : "Hamilton, Ralph Albert (Ham)", + ACTIVE : "1948 - 1948", + FROM : "College - Indiana", + TEAM_LOGO : "./images/nba_bobcats.jpg" +}, { + NAME : "Hamilton, Richard", + ACTIVE : "ACTIVE", + FROM : "College - Connecticut", + TEAM_LOGO : "./images/nba_bulls.jpg" +}, { + NAME : "Hamilton, Roy Lee", + ACTIVE : "1979 - 1980", + FROM : "College - UCLA", + TEAM_LOGO : "./images/nba_timberwolves.jpg" +}, { + NAME : "Hamilton, Steve Absher", + ACTIVE : "1958 - 1959", + FROM : "College - Purdue; Morehead State", + TEAM_LOGO : "./images/nba_magics.jpg" +}, { + NAME : "Hamilton, Tang", + ACTIVE : "2001 - 2001", + FROM : "College - Mississippi State ''01", + TEAM_LOGO : "./images/nba_mavericks.jpg" +}, { + NAME : "Hamilton, Thomas", + ACTIVE : "1995 - 1999", + FROM : "College - No College", + TEAM_LOGO : "./images/nba_wizards.jpg" +}, { + NAME : "Hamilton, Zendon", + ACTIVE : "2000 - 2005", + FROM : "College - St. John's", + TEAM_LOGO : "./images/nba_bobcats.jpg" +}, { + NAME : "Hammink, Geert", + ACTIVE : "1993 - 1995", + FROM : "College - Louisiana State", + TEAM_LOGO : "./images/nba_bucks.jpg" +}, { + NAME : "Hammonds, Tom", + ACTIVE : "1989 - 2000", + FROM : "College - Georgia Tech", + TEAM_LOGO : "./images/nba_bobcats.jpg" +}, { + NAME : "Hancock, Darrin", + ACTIVE : "1994 - 1996", + FROM : "College - Garden City CC KS; Kansas", + TEAM_LOGO : "./images/nba_suns.jpg" +}, { + NAME : "Handlogten, Ben", + ACTIVE : "2003 - 2004", + FROM : "College - Western Michigan", + TEAM_LOGO : "./images/nba_honets.jpg" +}, { + NAME : "Hankins, Cecil O.", + ACTIVE : "1946 - 1947", + FROM : "College - Oklahoma State", + TEAM_LOGO : "./images/nba_trail.jpg" +}, { + NAME : "Hankinson, Phil", + ACTIVE : "1973 - 1974", + FROM : "College - Pennsylvania", + TEAM_LOGO : "./images/nba_sonics.jpg" +}, { + NAME : "Hannum, Alexander Murray (Alex)", + ACTIVE : "1949 - 1956", + FROM : "College - USC", + TEAM_LOGO : "./images/nba_heats.jpg" +}, { + NAME : "Hanrahan, Donald (Don)", + ACTIVE : "1952 - 1952", + FROM : "College - Loyola (Chicago)", + TEAM_LOGO : "./images/nba_bobcats.jpg" +}, { + NAME : "Hans, Rollen F. (Rolly)", + ACTIVE : "1953 - 1954", + FROM : "College - Los Angeles City Coll. CA (J.C.); Long Island University", + TEAM_LOGO : "./images/nba_wizards.jpg" +}, { + NAME : "Hansbrough, Tyler", + ACTIVE : "ACTIVE", + FROM : "College - North Carolina", + TEAM_LOGO : "./images/nba_pistons.jpg" +}, { + NAME : "Hansen, Bob", + ACTIVE : "1983 - 1991", + FROM : "College - Iowa", + TEAM_LOGO : "./images/nba_honets.jpg" +}, { + NAME : "Hansen, Glenn R.", + ACTIVE : "1975 - 1977", + FROM : "College - Utah State; Louisiana State", + TEAM_LOGO : "./images/nba_griz.jpg" +}, { + NAME : "Hansen, Lars", + ACTIVE : "1978 - 1978", + FROM : "College - Washington", + TEAM_LOGO : "./images/nba_nets.jpg" +}, { + NAME : "Hansen, Travis", + ACTIVE : "2003 - 2003", + FROM : "College - Brigham Young", + TEAM_LOGO : "./images/nba_suns.jpg" +}, { + NAME : "Hanson, Reggie", + ACTIVE : "1997 - 1997", + FROM : "College - Kentucky", + TEAM_LOGO : "./images/nba_cavaliers.jpg" +}, { + NAME : "Hanzlik, Bill", + ACTIVE : "1980 - 1989", + FROM : "College - Notre Dame", + TEAM_LOGO : "./images/nba_celtics.jpg" +}, { + NAME : "Harangody, Luke", + ACTIVE : "ACTIVE", + FROM : "College - Notre Dame", + TEAM_LOGO : "./images/nba_timberwolves.jpg" +}, { + NAME : "Hardaway, Anfernee", + ACTIVE : "2007 - 2007", + FROM : "College - Memphis", + TEAM_LOGO : "./images/nba_76ers.jpg" +}, { + NAME : "Hardaway, Tim", + ACTIVE : "1989 - 2002", + FROM : "College - Texas-El Paso ''89", + TEAM_LOGO : "./images/nba_suns.jpg" +}, { + NAME : "Harden, James", + ACTIVE : "ACTIVE", + FROM : "College - Arizona State", + TEAM_LOGO : "./images/nba_jazz.jpg" +}, { + NAME : "Harding, Reginald (Reggie)", + ACTIVE : "1963 - 1967", + FROM : "College - No College", + TEAM_LOGO : "./images/nba_sonics.jpg" +}, { + NAME : "Iavaroni, Marc", + ACTIVE : "1982 - 1988", + FROM : "College - Virginia", + TEAM_LOGO : "./images/nba_suns.jpg" +}, { + NAME : "Ibaka, Serge", + ACTIVE : "ACTIVE", + FROM : "From - Brazzaville, Republic of Congo", + TEAM_LOGO : "./images/nba_honets.jpg" +}, { + NAME : "Iguodala, Andre", + ACTIVE : "ACTIVE", + FROM : "College - Arizona", + TEAM_LOGO : "./images/nba_nets.jpg" +}, { + NAME : "Ilgauskas, Zydrunas", + ACTIVE : "ACTIVE", + FROM : "From - Kaunas, Lithuania", + TEAM_LOGO : "./images/nba_nets.jpg" +}, { + NAME : "Ilic, Mile", + ACTIVE : "2006 - 2006", + FROM : "From - Serbia & Montenegro", + TEAM_LOGO : "./images/nba_hawks.jpg" +}, { + NAME : "Ilunga-Mbenga, Didier", + ACTIVE : "ACTIVE", + FROM : "From - Kinshasa, DRC", + TEAM_LOGO : "./images/nba_clippers.jpg" +}, { + NAME : "Ilyasova, Ersan", + ACTIVE : "ACTIVE", + FROM : "From - Eskisehir, Turkey", + TEAM_LOGO : "./images/nba_rockets.jpg" +}, { + NAME : "Imhoff, Darrall Tucker (Big D)", + ACTIVE : "1960 - 1971", + FROM : "College - California", + TEAM_LOGO : "./images/nba_sonics.jpg" +}, { + NAME : "Ingelsby, Tom", + ACTIVE : "1973 - 1973", + FROM : "College - Villanova", + TEAM_LOGO : "./images/nba_honets.jpg" +}, { + NAME : "Ingram, Joel McCoy (McCoy)", + ACTIVE : "1957 - 1957", + FROM : "College - Jackson State", + TEAM_LOGO : "./images/nba_cavaliers.jpg" +}, { + NAME : "Irvin, Byron", + ACTIVE : "1989 - 1992", + FROM : "College - Arkansas; Missouri", + TEAM_LOGO : "./images/nba_nets.jpg" +}, { + NAME : "Issel, Dan", + ACTIVE : "1976 - 1984", + FROM : "College - Kentucky", + TEAM_LOGO : "./images/nba_knics.jpg" +}, { + NAME : "Iuzzolino, Mike", + ACTIVE : "1991 - 1992", + FROM : "College - Penn State; St. Francis (PA)", + TEAM_LOGO : "./images/nba_heats.jpg" +}, { + NAME : "Iverson, Allen", + ACTIVE : "2007 - 2009", + FROM : "College - Georgetown", + TEAM_LOGO : "./images/nba_knics.jpg" +}, { + NAME : "Ivey, Royal", + ACTIVE : "ACTIVE", + FROM : "College - Texas", + TEAM_LOGO : "./images/nba_jazz.jpg" +}, { + NAME : "Jack, Jarrett", + ACTIVE : "ACTIVE", + FROM : "College - Georgia Tech", + TEAM_LOGO : "./images/nba_bobcats.jpg" +}, { + NAME : "Jackson, Alvin (Al)", + ACTIVE : "1967 - 1967", + FROM : "College - Wilberforce", + TEAM_LOGO : "./images/nba_trail.jpg" +}, { + NAME : "Jackson, Anthony Eugene (Tony)", + ACTIVE : "1980 - 1980", + FROM : "College - Florida State", + TEAM_LOGO : "./images/nba_hawks.jpg" +}, { + NAME : "Jackson, Bobby", + ACTIVE : "2007 - 2008", + FROM : "College - Minnesota", + TEAM_LOGO : "./images/nba_timberwolves.jpg" +}, { + NAME : "Jackson, Cedric", + ACTIVE : "2009 - 2009", + FROM : "College - Cleveland State", + TEAM_LOGO : "./images/nba_lakers.jpg" +}, { + NAME : "Jackson, Darnell", + ACTIVE : "ACTIVE", + FROM : "College - Kansas", + TEAM_LOGO : "./images/nba_warriors.jpg" +}, { + NAME : "Jackson, Gregory (Greg)", + ACTIVE : "1974 - 1974", + FROM : "College - Guilford", + TEAM_LOGO : "./images/nba_pacers.jpg" +}, { + NAME : "Jackson, Jaren", + ACTIVE : "1989 - 2001", + FROM : "College - Georgetown", + TEAM_LOGO : "./images/nba_heats.jpg" +}, { + NAME : "Jackson, Jermaine", + ACTIVE : "1999 - 2005", + FROM : "College - Detroit", + TEAM_LOGO : "./images/nba_trail.jpg" +}, { + NAME : "Jackson, Jim", + ACTIVE : "1992 - 2005", + FROM : "College - Ohio State", + TEAM_LOGO : "./images/nba_pacers.jpg" +}, { + NAME : "Jackson, Lucious B. (Luke)", + ACTIVE : "1964 - 1971", + FROM : "College - Quincy; Texas Southern; Texas-Pan American", + TEAM_LOGO : "./images/nba_mavericks.jpg" +}, { + NAME : "Jackson, Luke", + ACTIVE : "2007 - 2007", + FROM : "College - Oregon", + TEAM_LOGO : "./images/nba_cavaliers.jpg" +}, { + NAME : "Jackson, Marc", + ACTIVE : "2000 - 2006", + FROM : "College - Temple", + TEAM_LOGO : "./images/nba_pacers.jpg" +}, { + NAME : "Jackson, Mark", + ACTIVE : "1987 - 2003", + FROM : "College - St. John''s (N.Y.) '87", + TEAM_LOGO : "./images/nba_bucks.jpg" +}, { + NAME : "Jackson, Michael", + ACTIVE : "1987 - 1989", + FROM : "College - Georgetown", + TEAM_LOGO : "./images/nba_pacers.jpg" +}, { + NAME : "Jackson, Myron", + ACTIVE : "1986 - 1986", + FROM : "College - Arkansas-Little Rock", + TEAM_LOGO : "./images/nba_honets.jpg" +}, { + NAME : "Jackson, Philip D. (Phil, Action)", + ACTIVE : "1967 - 1979", + FROM : "College - North Dakota", + TEAM_LOGO : "./images/nba_trail.jpg" +}, { + NAME : "Jackson, Ralph A. III", + ACTIVE : "1984 - 1984", + FROM : "College - UCLA", + TEAM_LOGO : "./images/nba_nets.jpg" +}, { + NAME : "Jackson, Randell", + ACTIVE : "1998 - 1999", + FROM : "College - Florida State", + TEAM_LOGO : "./images/nba_pacers.jpg" +}, { + NAME : "Jackson, Stanley", + ACTIVE : "1993 - 1993", + FROM : "College - Alabama-Birmingham", + TEAM_LOGO : "./images/nba_griz.jpg" +}, { + NAME : "Jackson, Stephen", + ACTIVE : "ACTIVE", + FROM : "High School - Oak Hill Academy (Mouth of Wilson, VA)", + TEAM_LOGO : "./images/nba_jazz.jpg" +}, { + NAME : "Jackson, Tracy", + ACTIVE : "1981 - 1983", + FROM : "College - Notre Dame", + TEAM_LOGO : "./images/nba_jazz.jpg" +}, { + NAME : "Jackson, Wardell", + ACTIVE : "1974 - 1974", + FROM : "College - Ohio State", + TEAM_LOGO : "./images/nba_heats.jpg" +}, { + NAME : "Jacobs, Winfred O. (Fred)", + ACTIVE : "1946 - 1946", + FROM : "College - Denver", + TEAM_LOGO : "./images/nba_bobcats.jpg" +}, { + NAME : "Jacobsen, Casey", + ACTIVE : "2007 - 2007", + FROM : "College - Stanford", + TEAM_LOGO : "./images/nba_celtics.jpg" +}, { + NAME : "Jacobson, Sam", + ACTIVE : "1998 - 2000", + FROM : "College - Minnesota", + TEAM_LOGO : "./images/nba_sonics.jpg" +}, { + NAME : "Jamerson, Dave", + ACTIVE : "1990 - 1993", + FROM : "College - Ohio U.", + TEAM_LOGO : "./images/nba_cavaliers.jpg" +}, { + NAME : "James, Aaron (A.J.)", + ACTIVE : "1974 - 1978", + FROM : "College - Grambling State", + TEAM_LOGO : "./images/nba_rockets.jpg" +}, { + NAME : "James, Damion", + ACTIVE : "ACTIVE", + FROM : "College - Texas", + TEAM_LOGO : "./images/nba_pistons.jpg" +}, { + NAME : "James, Harold Gene (Gene, Goose)", + ACTIVE : "1948 - 1950", + FROM : "College - Marshall", + TEAM_LOGO : "./images/nba_pistons.jpg" +}, { + NAME : "James, Henry", + ACTIVE : "1990 - 1997", + FROM : "College - South Plains Coll. TX (J.C.); St. Mary's (Tex.)", + TEAM_LOGO : "./images/nba_knics.jpg" +}, { + NAME : "James, Jerome", + ACTIVE : "2007 - 2008", + FROM : "College - Florida A&M", + TEAM_LOGO : "./images/nba_bucks.jpg" +}, { + NAME : "James, LeBron", + ACTIVE : "ACTIVE", + FROM : "High School - St. Vincent-St. Mary HS (OH)", + TEAM_LOGO : "./images/nba_honets.jpg" +}, { + NAME : "James, Mike", + ACTIVE : "2007 - 2009", + FROM : "College - Duquesne", + TEAM_LOGO : "./images/nba_76ers.jpg" +}, { + NAME : "James, Tim", + ACTIVE : "1999 - 2001", + FROM : "College - Miami (Fla.) ''99", + TEAM_LOGO : "./images/nba_bobcats.jpg" +}, { + NAME : "Jamison, Antawn", + ACTIVE : "ACTIVE", + FROM : "College - North Carolina", + TEAM_LOGO : "./images/nba_heats.jpg" +}, { + NAME : "Jamison, Harold", + ACTIVE : "1999 - 2001", + FROM : "College - Clemson ''99", + TEAM_LOGO : "./images/nba_cavaliers.jpg" +}, { + NAME : "Janisch, John Albert", + ACTIVE : "1946 - 1947", + FROM : "College - Valparaiso", + TEAM_LOGO : "./images/nba_nets.jpg" +}, { + NAME : "Janotta, Howard (Howie)", + ACTIVE : "1949 - 1949", + FROM : "College - Seton Hall", + TEAM_LOGO : "./images/nba_spurs.jpg" +}, { + NAME : "Jaric, Marko", + ACTIVE : "2007 - 2008", + FROM : "From - Belgrade, Serbia", + TEAM_LOGO : "./images/nba_warriors.jpg" +}, { + NAME : "Jaros, Anthony Joseph (Tony)", + ACTIVE : "1946 - 1950", + FROM : "College - Minnesota", + TEAM_LOGO : "./images/nba_celtics.jpg" +}, { + NAME : "Jasikevicius, Sarunas", + ACTIVE : "2005 - 2006", + FROM : "College - Maryland", + TEAM_LOGO : "./images/nba_nets.jpg" +}, { + NAME : "Jawai, Nathan", + ACTIVE : "2008 - 2009", + FROM : "From - Australia", + TEAM_LOGO : "./images/nba_wizards.jpg" +}, { + NAME : "Jeannette, Harry Edward (Buddy)", + ACTIVE : "1947 - 1949", + FROM : "College - Washington & Jefferson", + TEAM_LOGO : "./images/nba_clippers.jpg" +}, { + NAME : "Jeelani, Abdul Qadir (formerly Gary Cole)", + ACTIVE : "1979 - 1980", + FROM : "College - Wis.-Parkside", + TEAM_LOGO : "./images/nba_sonics.jpg" +}, { + NAME : "Jefferies, Chris", + ACTIVE : "2002 - 2003", + FROM : "College - Fresno State ''03", + TEAM_LOGO : "./images/nba_knics.jpg" +}, { + NAME : "Jeffers, Othyus", + ACTIVE : "ACTIVE", + FROM : "College - Robert Morris (Ill.)", + TEAM_LOGO : "./images/nba_nuggets.jpg" +}, { + NAME : "Jefferson, Al", + ACTIVE : "ACTIVE", + FROM : "High School - Prentiss HS (MS)", + TEAM_LOGO : "./images/nba_celtics.jpg" +}, { + NAME : "Jefferson, Dontell", + ACTIVE : "2008 - 2008", + FROM : "College - Arkansas", + TEAM_LOGO : "./images/nba_honets.jpg" +}, { + NAME : "Jefferson, Richard", + ACTIVE : "ACTIVE", + FROM : "College - Arizona", + TEAM_LOGO : "./images/nba_kings.jpg" +}, { + NAME : "Kachan, Edwin John (Whitey)", + ACTIVE : "1948 - 1948", + FROM : "College - DePaul", + TEAM_LOGO : "./images/nba_heats.jpg" +}, { + NAME : "Kaftan, George A. (The Golden Greek)", + ACTIVE : "1948 - 1952", + FROM : "College - Holy Cross", + TEAM_LOGO : "./images/nba_suns.jpg" +}, { + NAME : "Kalafat, Edward L. (Ed)", + ACTIVE : "1954 - 1956", + FROM : "College - Minnesota", + TEAM_LOGO : "./images/nba_pistons.jpg" +}, { + NAME : "Kaman, Chris", + ACTIVE : "ACTIVE", + FROM : "College - Central Michigan", + TEAM_LOGO : "./images/nba_76ers.jpg" +}, { + NAME : "Kaplowitz, Ralph (Kappy)", + ACTIVE : "1946 - 1947", + FROM : "College - N.Y.U.", + TEAM_LOGO : "./images/nba_celtics.jpg" +}, { + NAME : "Kapono, Jason", + ACTIVE : "ACTIVE", + FROM : "College - UCLA", + TEAM_LOGO : "./images/nba_clippers.jpg" +}, { + NAME : "Kappen, Anthony George (Tony)", + ACTIVE : "1946 - 1946", + FROM : "College - No College", + TEAM_LOGO : "./images/nba_mavericks.jpg" +}, { + NAME : "Karl, Coby", + ACTIVE : "2007 - 2009", + FROM : "College - Boise State", + TEAM_LOGO : "./images/nba_bulls.jpg" +}, { + NAME : "Karl, George Matthew", + ACTIVE : "1976 - 1977", + FROM : "College - North Carolina", + TEAM_LOGO : "./images/nba_griz.jpg" +}, { + NAME : "Kasid, Edward (Ed)", + ACTIVE : "1946 - 1946", + FROM : "College - No College", + TEAM_LOGO : "./images/nba_griz.jpg" +}, { + NAME : "Kasun, Mario", + ACTIVE : "2004 - 2005", + FROM : "From - Croatia", + TEAM_LOGO : "./images/nba_cavaliers.jpg" +}, { + NAME : "Katkaveck, Leo Frank", + ACTIVE : "1948 - 1949", + FROM : "College - North Carolina State", + TEAM_LOGO : "./images/nba_trail.jpg" +}, { + NAME : "Kauffman, Robert (Bob, Horse)", + ACTIVE : "1968 - 1974", + FROM : "College - Guilford", + TEAM_LOGO : "./images/nba_suns.jpg" +}, { + NAME : "Kautz, Wilbert (Wibs)", + ACTIVE : "1946 - 1946", + FROM : "College - Loyola (Chicago)", + TEAM_LOGO : "./images/nba_raptors.jpg" +}, { + NAME : "Kea, Clarence Leroy", + ACTIVE : "1980 - 1981", + FROM : "College - Lamar", + TEAM_LOGO : "./images/nba_sonics.jpg" +}, { + NAME : "Kearns, Michael Joseph", + ACTIVE : "1954 - 1954", + FROM : "College - Princeton", + TEAM_LOGO : "./images/nba_76ers.jpg" +}, { + NAME : "Kearns, Thomas Francis Jr. (Tommy)", + ACTIVE : "1958 - 1958", + FROM : "College - North Carolina", + TEAM_LOGO : "./images/nba_pistons.jpg" +}, { + NAME : "Keefe, Adam", + ACTIVE : "1992 - 2000", + FROM : "College - Stanford", + TEAM_LOGO : "./images/nba_raptors.jpg" +}, { + NAME : "Keeling, Harold A.", + ACTIVE : "1985 - 1985", + FROM : "College - Santa Clara", + TEAM_LOGO : "./images/nba_cavaliers.jpg" +}, { + NAME : "Keller, Kenneth W. (Ken)", + ACTIVE : "1946 - 1946", + FROM : "College - Vermont; St. John's (N.Y.)", + TEAM_LOGO : "./images/nba_jazz.jpg" +}, { + NAME : "Kelley, Rich", + ACTIVE : "1975 - 1985", + FROM : "College - Stanford", + TEAM_LOGO : "./images/nba_pistons.jpg" +}, { + NAME : "Kellogg, Clark", + ACTIVE : "1982 - 1986", + FROM : "College - Ohio State", + TEAM_LOGO : "./images/nba_pistons.jpg" +}, { + NAME : "Kelly, Gerard Allan (Jerry)", + ACTIVE : "1946 - 1947", + FROM : "College - Marshall", + TEAM_LOGO : "./images/nba_bucks.jpg" +}, { + NAME : "Kelly, Thomas Edward (Tom)", + ACTIVE : "1948 - 1948", + FROM : "College - N.Y.U.", + TEAM_LOGO : "./images/nba_bobcats.jpg" +}, { + NAME : "Kelser, Greg", + ACTIVE : "1979 - 1984", + FROM : "College - Michigan State", + TEAM_LOGO : "./images/nba_bobcats.jpg" +}, { + NAME : "Kelso, Ben", + ACTIVE : "1973 - 1973", + FROM : "College - Central Michigan", + TEAM_LOGO : "./images/nba_bobcats.jpg" +}, { + NAME : "Kemp, Shawn", + ACTIVE : "1989 - 2002", + FROM : "High School - Concord HS (IN) ''87", + TEAM_LOGO : "./images/nba_spurs.jpg" +}, { + NAME : "Kempton, Tim", + ACTIVE : "1986 - 1997", + FROM : "College - Notre Dame", + TEAM_LOGO : "./images/nba_cavaliers.jpg" +}, { + NAME : "Kendrick, Frank Edward", + ACTIVE : "1974 - 1974", + FROM : "College - Purdue", + TEAM_LOGO : "./images/nba_spurs.jpg" +}, { + NAME : "Kennedy, Eugene (Goo)", + ACTIVE : "1976 - 1976", + FROM : "College - Texas Christian", + TEAM_LOGO : "./images/nba_heats.jpg" +}, { + NAME : "Kennedy, Joseph A. (Joe)", + ACTIVE : "1968 - 1969", + FROM : "College - Duke", + TEAM_LOGO : "./images/nba_knics.jpg" +}, { + NAME : "Kennedy, William F. (Pickles)", + ACTIVE : "1960 - 1960", + FROM : "College - Temple", + TEAM_LOGO : "./images/nba_nets.jpg" +}, { + NAME : "Kenon, Larry", + ACTIVE : "1976 - 1982", + FROM : "College - Amarillo Coll. TX (J.C.); Memphis", + TEAM_LOGO : "./images/nba_hawks.jpg" +}, { + NAME : "Kenville, William McGill (Billy, The Kid)", + ACTIVE : "1953 - 1959", + FROM : "College - St. Bonaventure", + TEAM_LOGO : "./images/nba_sonics.jpg" +}, { + NAME : "Kerner, Jonathan", + ACTIVE : "1998 - 1998", + FROM : "College - East Carolina ''97", + TEAM_LOGO : "./images/nba_raptors.jpg" +}, { + NAME : "Kerr, Johnny", + ACTIVE : "1954 - 1965", + FROM : "College - Illinois", + TEAM_LOGO : "./images/nba_sonics.jpg" +}, { + NAME : "Kerr, Steve", + ACTIVE : "1988 - 2002", + FROM : "College - Arizona ''88", + TEAM_LOGO : "./images/nba_celtics.jpg" +}, { + NAME : "Kerris, John E. (Jack)", + ACTIVE : "1949 - 1952", + FROM : "College - Loyola (Chicago)", + TEAM_LOGO : "./images/nba_griz.jpg" +}, { + NAME : "Kersey, Jerome", + ACTIVE : "1984 - 2000", + FROM : "College - Longwood", + TEAM_LOGO : "./images/nba_celtics.jpg" +}, { + NAME : "Kessler, Alec", + ACTIVE : "1990 - 1993", + FROM : "College - Georgia", + TEAM_LOGO : "./images/nba_honets.jpg" +}, { + NAME : "Ketner, Lari", + ACTIVE : "1999 - 2000", + FROM : "College - Massachusetts", + TEAM_LOGO : "./images/nba_pacers.jpg" +}, { + NAME : "Keys, Randolph", + ACTIVE : "1988 - 1995", + FROM : "College - Southern Mississippi", + TEAM_LOGO : "./images/nba_griz.jpg" +}, { + NAME : "Khryapa, Viktor", + ACTIVE : "2007 - 2007", + FROM : "From - Russia", + TEAM_LOGO : "./images/nba_honets.jpg" +}, { + NAME : "Kidd, Jason", + ACTIVE : "ACTIVE", + FROM : "College - California", + TEAM_LOGO : "./images/nba_wizards.jpg" +}, { + NAME : "Kidd, Warren", + ACTIVE : "1993 - 1993", + FROM : "College - Middle Tennessee State", + TEAM_LOGO : "./images/nba_nuggets.jpg" +}, { + NAME : "Kiffin, Irvin A. Jr.", + ACTIVE : "1979 - 1979", + FROM : "College - Virginia Union; Oklahoma Baptist", + TEAM_LOGO : "./images/nba_hawks.jpg" +}, { + NAME : "Kiley, John F. (Jack)", + ACTIVE : "1951 - 1952", + FROM : "College - Syracuse", + TEAM_LOGO : "./images/nba_honets.jpg" +}, { + NAME : "Killum, Earnest (Ernie)", + ACTIVE : "1970 - 1970", + FROM : "College - Stetson", + TEAM_LOGO : "./images/nba_griz.jpg" +}, { + NAME : "Kilpatrick, Carl", + ACTIVE : "1979 - 1979", + FROM : "College - Kilgore Coll. TX (J.C.); Louisiana-Monroe", + TEAM_LOGO : "./images/nba_knics.jpg" +}, { + NAME : "Kimball, Toby", + ACTIVE : "1966 - 1974", + FROM : "College - Connecticut", + TEAM_LOGO : "./images/nba_timberwolves.jpg" +}, { + NAME : "Lacey, Sam", + ACTIVE : "1970 - 1982", + FROM : "College - New Mexico State", + TEAM_LOGO : "./images/nba_suns.jpg" +}, { + NAME : "LaCour, Fred", + ACTIVE : "1960 - 1962", + FROM : "College - San Francisco", + TEAM_LOGO : "./images/nba_trail.jpg" +}, { + NAME : "Laettner, Christian", + ACTIVE : "1992 - 2004", + FROM : "College - Duke", + TEAM_LOGO : "./images/nba_hawks.jpg" +}, { + NAME : "Lafayette, Oliver", + ACTIVE : "2009 - 2009", + FROM : "College - Houston", + TEAM_LOGO : "./images/nba_knics.jpg" +}, { + NAME : "LaFrentz, Raef", + ACTIVE : "2007 - 2007", + FROM : "College - Kansas", + TEAM_LOGO : "./images/nba_pacers.jpg" +}, { + NAME : "LaGarde, Thomas Joseph (Tom)", + ACTIVE : "1977 - 1984", + FROM : "College - North Carolina", + TEAM_LOGO : "./images/nba_heats.jpg" +}, { + NAME : "Laimbeer, Bill", + ACTIVE : "1980 - 1993", + FROM : "College - Owens CC OH; Notre Dame", + TEAM_LOGO : "./images/nba_warriors.jpg" +}, { + NAME : "Lalich, Peter T. (Pete)", + ACTIVE : "1946 - 1946", + FROM : "College - Ohio U.", + TEAM_LOGO : "./images/nba_warriors.jpg" +}, { + NAME : "Lamar, Dwight (Bo)", + ACTIVE : "1976 - 1976", + FROM : "College - Louisiana-Lafayette", + TEAM_LOGO : "./images/nba_cavaliers.jpg" +}, { + NAME : "Lambert, John Edward", + ACTIVE : "1975 - 1981", + FROM : "College - USC", + TEAM_LOGO : "./images/nba_warriors.jpg" +}, { + NAME : "Lamp, Jeff", + ACTIVE : "1981 - 1988", + FROM : "College - Virginia", + TEAM_LOGO : "./images/nba_cavaliers.jpg" +}, { + NAME : "Lampe, Maciej", + ACTIVE : "2003 - 2005", + FROM : "From - Poland", + TEAM_LOGO : "./images/nba_lakers.jpg" +}, { + NAME : "Lampley, Jimmy", + ACTIVE : "1986 - 1986", + FROM : "College - Vanderbilt; Arkansas-Little Rock", + TEAM_LOGO : "./images/nba_nuggets.jpg" +}, { + NAME : "Lampley, Sean", + ACTIVE : "2002 - 2003", + FROM : "College - California", + TEAM_LOGO : "./images/nba_magics.jpg" +}, { + NAME : "Landry, Carl", + ACTIVE : "ACTIVE", + FROM : "College - Purdue", + TEAM_LOGO : "./images/nba_cavaliers.jpg" +}, { + NAME : "Landry, Marcus", + ACTIVE : "2009 - 2009", + FROM : "College - Wisconsin", + TEAM_LOGO : "./images/nba_clippers.jpg" +}, { + NAME : "Landsberger, Mark", + ACTIVE : "1977 - 1983", + FROM : "College - Allan Hancock Coll. CA (J.C.); Minnesota; Arizona State", + TEAM_LOGO : "./images/nba_celtics.jpg" +}, { + NAME : "Lane, Jerome", + ACTIVE : "1988 - 1992", + FROM : "College - Pittsburgh", + TEAM_LOGO : "./images/nba_knics.jpg" +}, { + NAME : "Lang, Andrew", + ACTIVE : "1988 - 1999", + FROM : "College - Arkansas", + TEAM_LOGO : "./images/nba_spurs.jpg" +}, { + NAME : "Lang, Antonio", + ACTIVE : "1994 - 1999", + FROM : "College - Duke", + TEAM_LOGO : "./images/nba_timberwolves.jpg" +}, { + NAME : "Lang, James", + ACTIVE : "2006 - 2006", + FROM : "High School - Central Park Christian HS (AL)", + TEAM_LOGO : "./images/nba_hawks.jpg" +}, { + NAME : "Langdon, Trajan", + ACTIVE : "1999 - 2001", + FROM : "College - Duke", + TEAM_LOGO : "./images/nba_bobcats.jpg" +}, { + NAME : "Langford, Keith", + ACTIVE : "2007 - 2007", + FROM : "College - Kansas", + TEAM_LOGO : "./images/nba_sonics.jpg" +}, { + NAME : "Langhi, Dan", + ACTIVE : "2000 - 2003", + FROM : "College - Vanderbilt ''00", + TEAM_LOGO : "./images/nba_cavaliers.jpg" +}, { + NAME : "Lanier, Bob", + ACTIVE : "1970 - 1983", + FROM : "College - St. Bonaventure", + TEAM_LOGO : "./images/nba_clippers.jpg" +}, { + NAME : "Lantz, Stuart Burrell (Stu)", + ACTIVE : "1968 - 1975", + FROM : "College - Nebraska", + TEAM_LOGO : "./images/nba_kings.jpg" +}, { + NAME : "Larese, York Bruno", + ACTIVE : "1961 - 1961", + FROM : "College - North Carolina", + TEAM_LOGO : "./images/nba_trail.jpg" +}, { + NAME : "LaRue, Rusty", + ACTIVE : "1997 - 2003", + FROM : "College - Wake Forest", + TEAM_LOGO : "./images/nba_76ers.jpg" +}, { + NAME : "LaRusso, Rudolph A. (Rudy)", + ACTIVE : "1959 - 1968", + FROM : "College - Dartmouth", + TEAM_LOGO : "./images/nba_heats.jpg" +}, { + NAME : "Laskowski, John", + ACTIVE : "1975 - 1976", + FROM : "College - Indiana", + TEAM_LOGO : "./images/nba_pacers.jpg" +}, { + NAME : "Lasme, Stephane", + ACTIVE : "2007 - 2007", + FROM : "College - Massachusetts", + TEAM_LOGO : "./images/nba_trail.jpg" +}, { + NAME : "Lattin, David (Dave, Big Daddy)", + ACTIVE : "1967 - 1968", + FROM : "College - Texas-El Paso", + TEAM_LOGO : "./images/nba_suns.jpg" +}, { + NAME : "Lauderdale, Priest", + ACTIVE : "1996 - 1997", + FROM : "College - Central State (Ohio)", + TEAM_LOGO : "./images/nba_sonics.jpg" +}, { + NAME : "Laurel, Richard", + ACTIVE : "1977 - 1977", + FROM : "College - Hofstra", + TEAM_LOGO : "./images/nba_bucks.jpg" +}, { + NAME : "Lautenbach, Walter Henry (Walt)", + ACTIVE : "1949 - 1949", + FROM : "College - Wisconsin", + TEAM_LOGO : "./images/nba_warriors.jpg" +}, { + NAME : "Lavelli, Anthony (Tony)", + ACTIVE : "1949 - 1950", + FROM : "College - Yale", + TEAM_LOGO : "./images/nba_hawks.jpg" +}, { + NAME : "Lavoy, Robert William (Bob)", + ACTIVE : "1950 - 1953", + FROM : "College - Illinois; Western Kentucky", + TEAM_LOGO : "./images/nba_wizards.jpg" +}, { + NAME : "Law, Acie", + ACTIVE : "ACTIVE", + FROM : "College - Texas A&M", + TEAM_LOGO : "./images/nba_bulls.jpg" +}, { + NAME : "Lawal, Gani", + ACTIVE : "ACTIVE", + FROM : "College - Georgia Tech", + TEAM_LOGO : "./images/nba_celtics.jpg" +}, { + NAME : "Lawrence, Edmund (Ed)", + ACTIVE : "1980 - 1980", + FROM : "College - McNeese State", + TEAM_LOGO : "./images/nba_bulls.jpg" +}, { + NAME : "Lawson, Jason", + ACTIVE : "1997 - 1997", + FROM : "College - Villanova ''97", + TEAM_LOGO : "./images/nba_pistons.jpg" +}, { + NAME : "Lawson, Ty", + ACTIVE : "ACTIVE", + FROM : "College - North Carolina", + TEAM_LOGO : "./images/nba_mavericks.jpg" +}, { + NAME : "Layton, Dennis (Mo)", + ACTIVE : "1971 - 1977", + FROM : "College - Phoenix Coll. AZ (J.C.); USC", + TEAM_LOGO : "./images/nba_pistons.jpg" +}, { + NAME : "Leaks, Emanuel (Manny)", + ACTIVE : "1972 - 1973", + FROM : "College - Niagara", + TEAM_LOGO : "./images/nba_cavaliers.jpg" +}, { + NAME : "Lear, Harold C. Jr. (Hal, King)", + ACTIVE : "1956 - 1956", + FROM : "College - Temple", + TEAM_LOGO : "./images/nba_nuggets.jpg" +}, { + NAME : "Leavell, Allen", + ACTIVE : "1979 - 1988", + FROM : "College - Oklahoma City", + TEAM_LOGO : "./images/nba_wizards.jpg" +}, { + NAME : "Lebo, Jeff", + ACTIVE : "1989 - 1989", + FROM : "College - North Carolina", + TEAM_LOGO : "./images/nba_bucks.jpg" +}, { + NAME : "Leckner, Eric", + ACTIVE : "1988 - 1996", + FROM : "College - Wyoming", + TEAM_LOGO : "./images/nba_bobcats.jpg" +}, { + NAME : "Lee, Alfred (Butch)", + ACTIVE : "1978 - 1979", + FROM : "College - Marquette", + TEAM_LOGO : "./images/nba_wizards.jpg" +}, { + NAME : "Lee, Clyde", + ACTIVE : "1966 - 1975", + FROM : "College - Vanderbilt", + TEAM_LOGO : "./images/nba_spurs.jpg" +}, { + NAME : "Macaluso, Michael Emelius (Mike)", + ACTIVE : "1973 - 1973", + FROM : "College - Canisius", + TEAM_LOGO : "./images/nba_wizards.jpg" +}, { + NAME : "Macauley, Ed", + ACTIVE : "1949 - 1958", + FROM : "College - St. Louis", + TEAM_LOGO : "./images/nba_magics.jpg" +}, { + NAME : "MacCulloch, Todd", + ACTIVE : "1999 - 2002", + FROM : "College - Washington ''99", + TEAM_LOGO : "./images/nba_heats.jpg" +}, { + NAME : "MacGilvray, Ronald (Ronnie)", + ACTIVE : "1954 - 1954", + FROM : "College - St. John's (N.Y.)", + TEAM_LOGO : "./images/nba_lakers.jpg" +}, { + NAME : "Macijauskas, Arvydas", + ACTIVE : "2005 - 2005", + FROM : "From - Lithuania", + TEAM_LOGO : "./images/nba_spurs.jpg" +}, { + NAME : "Mack, Oliver (Ollie)", + ACTIVE : "1979 - 1981", + FROM : "College - San Jacinto Coll. TX (J.C.); East Carolina", + TEAM_LOGO : "./images/nba_bobcats.jpg" +}, { + NAME : "Mack, Sam", + ACTIVE : "1992 - 2001", + FROM : "College - Iowa State; Arizona State; Tyler JC TX; Houston", + TEAM_LOGO : "./images/nba_76ers.jpg" +}, { + NAME : "Mackey, Malcolm", + ACTIVE : "1993 - 1993", + FROM : "College - Georgia Tech", + TEAM_LOGO : "./images/nba_magics.jpg" +}, { + NAME : "Macklin, Rudy", + ACTIVE : "1981 - 1983", + FROM : "College - Louisiana State", + TEAM_LOGO : "./images/nba_celtics.jpg" +}, { + NAME : "Macknowski, John Andrew (Johnny, Whitey)", + ACTIVE : "1949 - 1950", + FROM : "College - Seton Hall", + TEAM_LOGO : "./images/nba_bulls.jpg" +}, { + NAME : "MacLean, Don", + ACTIVE : "1992 - 2000", + FROM : "College - UCLA", + TEAM_LOGO : "./images/nba_honets.jpg" +}, { + NAME : "Macon, Mark", + ACTIVE : "1991 - 1998", + FROM : "College - Temple", + TEAM_LOGO : "./images/nba_timberwolves.jpg" +}, { + NAME : "Macy, Kyle", + ACTIVE : "1980 - 1986", + FROM : "College - Purdue; Kentucky", + TEAM_LOGO : "./images/nba_pistons.jpg" +}, { + NAME : "Maddox, Jack C.", + ACTIVE : "1948 - 1948", + FROM : "College - West Texas A&M", + TEAM_LOGO : "./images/nba_honets.jpg" +}, { + NAME : "Maddox, Tito", + ACTIVE : "2002 - 2002", + FROM : "College - Fresno State ''04", + TEAM_LOGO : "./images/nba_warriors.jpg" +}, { + NAME : "Madkins, Gerald", + ACTIVE : "1993 - 1997", + FROM : "College - UCLA", + TEAM_LOGO : "./images/nba_trail.jpg" +}, { + NAME : "Madsen, Mark", + ACTIVE : "2007 - 2008", + FROM : "College - Stanford", + TEAM_LOGO : "./images/nba_nets.jpg" +}, { + NAME : "Mager, Norman Clifford (Norm)", + ACTIVE : "1950 - 1950", + FROM : "College - St. John's (N.Y.); CCNY", + TEAM_LOGO : "./images/nba_jazz.jpg" +}, { + NAME : "Maggette, Corey", + ACTIVE : "ACTIVE", + FROM : "College - Duke", + TEAM_LOGO : "./images/nba_timberwolves.jpg" +}, { + NAME : "Magley, Dave", + ACTIVE : "1982 - 1982", + FROM : "College - Kansas", + TEAM_LOGO : "./images/nba_wizards.jpg" +}, { + NAME : "Magloire, Jamaal", + ACTIVE : "ACTIVE", + FROM : "College - Kentucky", + TEAM_LOGO : "./images/nba_clippers.jpg" +}, { + NAME : "Mahinmi, Ian", + ACTIVE : "ACTIVE", + FROM : "From - Rouen, France", + TEAM_LOGO : "./images/nba_cavaliers.jpg" +}, { + NAME : "Mahnken, John E. (Long John; Stretch)", + ACTIVE : "1946 - 1952", + FROM : "College - Georgetown", + TEAM_LOGO : "./images/nba_warriors.jpg" +}, { + NAME : "Mahoney, Francis H. (Mo)", + ACTIVE : "1952 - 1953", + FROM : "College - Brown", + TEAM_LOGO : "./images/nba_nets.jpg" +}, { + NAME : "Mahorn, Rick", + ACTIVE : "1980 - 1998", + FROM : "College - Hampton", + TEAM_LOGO : "./images/nba_nets.jpg" +}, { + NAME : "Majerle, Dan", + ACTIVE : "1988 - 2001", + FROM : "College - Central Michigan", + TEAM_LOGO : "./images/nba_raptors.jpg" +}, { + NAME : "Major, Renaldo", + ACTIVE : "2006 - 2006", + FROM : "College - Fresno State", + TEAM_LOGO : "./images/nba_pistons.jpg" +}, { + NAME : "Malamed, Lionel", + ACTIVE : "1948 - 1948", + FROM : "College - CCNY", + TEAM_LOGO : "./images/nba_knics.jpg" +}, { + NAME : "Malone, Jeff", + ACTIVE : "1983 - 1995", + FROM : "College - Mississippi State", + TEAM_LOGO : "./images/nba_suns.jpg" +}, { + NAME : "Malone, Karl", + ACTIVE : "1985 - 2003", + FROM : "College - Louisiana Tech ''86", + TEAM_LOGO : "./images/nba_hawks.jpg" +}, { + NAME : "Malone, Moses", + ACTIVE : "1976 - 1994", + FROM : "College - No College", + TEAM_LOGO : "./images/nba_pacers.jpg" +}, { + NAME : "Maloney, Matt", + ACTIVE : "1996 - 2002", + FROM : "College - Pennsylvania", + TEAM_LOGO : "./images/nba_celtics.jpg" +}, { + NAME : "Malovic, Stephen L.", + ACTIVE : "1979 - 1979", + FROM : "College - USC; San Diego State", + TEAM_LOGO : "./images/nba_hawks.jpg" +}, { + NAME : "Manakas, Theodore (Ted)", + ACTIVE : "1973 - 1973", + FROM : "College - Princeton", + TEAM_LOGO : "./images/nba_suns.jpg" +}, { + NAME : "Mandic, John J.", + ACTIVE : "1948 - 1949", + FROM : "College - Oregon State", + TEAM_LOGO : "./images/nba_cavaliers.jpg" +}, { + NAME : "Mangiapane, Francis E. (Frank)", + ACTIVE : "1946 - 1946", + FROM : "College - N.Y.U.", + TEAM_LOGO : "./images/nba_mavericks.jpg" +}, { + NAME : "Manning, Danny", + ACTIVE : "1988 - 2002", + FROM : "College - Kansas ''88", + TEAM_LOGO : "./images/nba_nuggets.jpg" +}, { + NAME : "Manning, Edward R. (Ed)", + ACTIVE : "1967 - 1970", + FROM : "College - Jackson State", + TEAM_LOGO : "./images/nba_bobcats.jpg" +}, { + NAME : "Manning, Rich", + ACTIVE : "1995 - 1996", + FROM : "College - Syracuse; Washington", + TEAM_LOGO : "./images/nba_jazz.jpg" +}, { + NAME : "Mannion, Pace", + ACTIVE : "1983 - 1988", + FROM : "College - Utah", + TEAM_LOGO : "./images/nba_suns.jpg" +}, { + NAME : "Mantis, Nicholas (Nick)", + ACTIVE : "1959 - 1962", + FROM : "College - Northwestern", + TEAM_LOGO : "./images/nba_hawks.jpg" +}, { + NAME : "Maravich, Pete", + ACTIVE : "1970 - 1979", + FROM : "College - Louisiana State", + TEAM_LOGO : "./images/nba_nuggets.jpg" +}, { + NAME : "Maravich, Peter (Press)", + ACTIVE : "1946 - 1946", + FROM : "College - Davis & Elkins", + TEAM_LOGO : "./images/nba_clippers.jpg" +}, { + NAME : "Marble, Roy", + ACTIVE : "1989 - 1993", + FROM : "College - Iowa", + TEAM_LOGO : "./images/nba_rockets.jpg" +}, { + NAME : "Marbury, Stephon", + ACTIVE : "2007 - 2008", + FROM : "College - Georgia Tech", + TEAM_LOGO : "./images/nba_warriors.jpg" +}, { + NAME : "Marciulionis, Sarunas", + ACTIVE : "1989 - 1996", + FROM : "College - Vilnius (Lithuania)", + TEAM_LOGO : "./images/nba_76ers.jpg" +}, { + NAME : "Mariaschin, Saul George", + ACTIVE : "1947 - 1947", + FROM : "College - Bloomsburg; Syracuse; Harvard", + TEAM_LOGO : "./images/nba_spurs.jpg" +}, { + NAME : "Marin, John Warren (Jack)", + ACTIVE : "1966 - 1976", + FROM : "College - Duke", + TEAM_LOGO : "./images/nba_bucks.jpg" +}, { + NAME : "Marion, Shawn", + ACTIVE : "ACTIVE", + FROM : "College - UNLV", + TEAM_LOGO : "./images/nba_lakers.jpg" +}, { + NAME : "Markota, Damir", + ACTIVE : "2006 - 2006", + FROM : "From - Croatia", + TEAM_LOGO : "./images/nba_bulls.jpg" +}, { + NAME : "N'diaye, Mamadou", + ACTIVE : "2000 - 2004", + FROM : "College - Auburn", + TEAM_LOGO : "./images/nba_griz.jpg" +}, { + NAME : "Naber, Robert E. (Bob)", + ACTIVE : "1952 - 1952", + FROM : "College - Louisville", + TEAM_LOGO : "./images/nba_cavaliers.jpg" +}, { + NAME : "Nachamkin, Boris Alexander", + ACTIVE : "1954 - 1954", + FROM : "College - N.Y.U.", + TEAM_LOGO : "./images/nba_griz.jpg" +}, { + NAME : "Nachbar, Bostjan", + ACTIVE : "2007 - 2007", + FROM : "From - Slovenia", + TEAM_LOGO : "./images/nba_pistons.jpg" +}, { + NAME : "Nagel, Gerald R. (Jerry)", + ACTIVE : "1949 - 1949", + FROM : "College - Loyola (Chicago)", + TEAM_LOGO : "./images/nba_griz.jpg" +}, { + NAME : "Nagy, Frederick Karl (Fritz)", + ACTIVE : "1948 - 1948", + FROM : "College - North Carolina; Akron", + TEAM_LOGO : "./images/nba_griz.jpg" +}, { + NAME : "Nailon, Lee", + ACTIVE : "2000 - 2005", + FROM : "College - Texas Christian", + TEAM_LOGO : "./images/nba_nuggets.jpg" +}, { + NAME : "Najera, Eduardo", + ACTIVE : "ACTIVE", + FROM : "College - Oklahoma", + TEAM_LOGO : "./images/nba_sonics.jpg" +}, { + NAME : "Nance, Larry", + ACTIVE : "1981 - 1993", + FROM : "College - Clemson", + TEAM_LOGO : "./images/nba_heats.jpg" +}, { + NAME : "Napolitano, Paul Wally", + ACTIVE : "1948 - 1948", + FROM : "College - San Francisco", + TEAM_LOGO : "./images/nba_warriors.jpg" +}, { + NAME : "Nash, Charles Francis (Cotton)", + ACTIVE : "1964 - 1964", + FROM : "College - Kentucky", + TEAM_LOGO : "./images/nba_pacers.jpg" +}, { + NAME : "Nash, Robert Lee Jr. (Bob)", + ACTIVE : "1972 - 1978", + FROM : "College - San Jacinto Coll. TX (J.C.); Hawaii", + TEAM_LOGO : "./images/nba_heats.jpg" +}, { + NAME : "Nash, Steve", + ACTIVE : "ACTIVE", + FROM : "College - Santa Clara", + TEAM_LOGO : "./images/nba_sonics.jpg" +}, { + NAME : "Nater, Swen", + ACTIVE : "1976 - 1983", + FROM : "College - Cypress Coll. CA (J.C.); UCLA", + TEAM_LOGO : "./images/nba_lakers.jpg" +}, { + NAME : "Nathan, Howard", + ACTIVE : "1995 - 1995", + FROM : "College - Louisiana-Monroe", + TEAM_LOGO : "./images/nba_pistons.jpg" +}, { + NAME : "Natt, Calvin", + ACTIVE : "1979 - 1989", + FROM : "College - Louisiana-Monroe", + TEAM_LOGO : "./images/nba_kings.jpg" +}, { + NAME : "Natt, Kenny", + ACTIVE : "1980 - 1984", + FROM : "College - Louisiana-Monroe", + TEAM_LOGO : "./images/nba_sonics.jpg" +}, { + NAME : "Naulls, Willie", + ACTIVE : "1956 - 1965", + FROM : "College - UCLA", + TEAM_LOGO : "./images/nba_suns.jpg" +}, { + NAME : "Navarro, Juan Carlos", + ACTIVE : "2007 - 2007", + FROM : "From - Spain", + TEAM_LOGO : "./images/nba_76ers.jpg" +}, { + NAME : "Ndiaye, Hamady", + ACTIVE : "ACTIVE", + FROM : "College - Rutgers", + TEAM_LOGO : "./images/nba_spurs.jpg" +}, { + NAME : "Ndiaye, Makhtar", + ACTIVE : "1998 - 1998", + FROM : "College - North Carolina", + TEAM_LOGO : "./images/nba_cavaliers.jpg" +}, { + NAME : "Ndong, Boniface", + ACTIVE : "2005 - 2005", + FROM : "-", + TEAM_LOGO : "./images/nba_nets.jpg" +}, { + NAME : "Neal, Craig", + ACTIVE : "1988 - 1990", + FROM : "College - Georgia Tech", + TEAM_LOGO : "./images/nba_rockets.jpg" +}, { + NAME : "Neal, Gary", + ACTIVE : "ACTIVE", + FROM : "College - Towson", + TEAM_LOGO : "./images/nba_bulls.jpg" +}, { + NAME : "Neal, James Ellerbe (Jim)", + ACTIVE : "1953 - 1954", + FROM : "College - Wofford", + TEAM_LOGO : "./images/nba_kings.jpg" +}, { + NAME : "Neal, Lloyd", + ACTIVE : "1972 - 1978", + FROM : "College - Tennessee State", + TEAM_LOGO : "./images/nba_sonics.jpg" +}, { + NAME : "Nealy, Ed", + ACTIVE : "1982 - 1992", + FROM : "College - Kansas State", + TEAM_LOGO : "./images/nba_magics.jpg" +}, { + NAME : "Negratti, Albert Edward (Al)", + ACTIVE : "1946 - 1946", + FROM : "College - Seton Hall", + TEAM_LOGO : "./images/nba_clippers.jpg" +}, { + NAME : "Nelson, Barry G.", + ACTIVE : "1971 - 1971", + FROM : "College - Duquesne", + TEAM_LOGO : "./images/nba_bucks.jpg" +}, { + NAME : "Nelson, DeMarcus", + ACTIVE : "2008 - 2008", + FROM : "College - Duke", + TEAM_LOGO : "./images/nba_suns.jpg" +}, { + NAME : "Nelson, Donald Arvid (Don, Nellie)", + ACTIVE : "1962 - 1975", + FROM : "College - Iowa", + TEAM_LOGO : "./images/nba_pistons.jpg" +}, { + NAME : "Nelson, Jameer", + ACTIVE : "ACTIVE", + FROM : "College - Saint Joseph's", + TEAM_LOGO : "./images/nba_clippers.jpg" +}, { + NAME : "Nelson, Louis (Louie, Sweets)", + ACTIVE : "1973 - 1977", + FROM : "College - Washington", + TEAM_LOGO : "./images/nba_wizards.jpg" +}, { + NAME : "Nembhard, Ruben", + ACTIVE : "1996 - 1996", + FROM : "College - Weber State", + TEAM_LOGO : "./images/nba_bobcats.jpg" +}, { + NAME : "Nene", + ACTIVE : "ACTIVE", + FROM : "From - Sao Carlos, Brazil", + TEAM_LOGO : "./images/nba_sonics.jpg" +}, { + NAME : "Nesby, Tyrone", + ACTIVE : "1998 - 2001", + FROM : "College - Vincennes IN (J.C.); Nevada-Las Vegas", + TEAM_LOGO : "./images/nba_bucks.jpg" +}, { + NAME : "Nessley, Martin", + ACTIVE : "1987 - 1987", + FROM : "College - Duke", + TEAM_LOGO : "./images/nba_bucks.jpg" +}, { + NAME : "Nesterovic, Rasho", + ACTIVE : "2007 - 2009", + FROM : "From - Ljubljana, Slovenia", + TEAM_LOGO : "./images/nba_heats.jpg" +}, { + NAME : "Neumann, Johnny", + ACTIVE : "1976 - 1977", + FROM : "College - Mississippi", + TEAM_LOGO : "./images/nba_hawks.jpg" +}, { + NAME : "Neumann, Paul R.", + ACTIVE : "1961 - 1966", + FROM : "College - Stanford", + TEAM_LOGO : "./images/nba_wizards.jpg" +}, { + NAME : "Nevitt, Chuck", + ACTIVE : "1982 - 1993", + FROM : "College - North Carolina State", + TEAM_LOGO : "./images/nba_bucks.jpg" +}, { + NAME : "Newbern, Melvin", + ACTIVE : "1992 - 1992", + FROM : "College - Minnesota", + TEAM_LOGO : "./images/nba_nuggets.jpg" +}, { + NAME : "Newbill, Ivano", + ACTIVE : "1994 - 1997", + FROM : "College - Georgia Tech", + TEAM_LOGO : "./images/nba_celtics.jpg" +}, { + NAME : "Newble, Ira", + ACTIVE : "2007 - 2007", + FROM : "College - Miami (Ohio)", + TEAM_LOGO : "./images/nba_griz.jpg" +}, { + NAME : "Newlin, Mike", + ACTIVE : "1971 - 1981", + FROM : "College - Utah", + TEAM_LOGO : "./images/nba_bulls.jpg" +}, { + NAME : "Newman, Johnny", + ACTIVE : "1986 - 2001", + FROM : "College - Richmond", + TEAM_LOGO : "./images/nba_bulls.jpg" +}, { + NAME : "Newmark, David L. (Dave)", + ACTIVE : "1968 - 1969", + FROM : "College - Columbia", + TEAM_LOGO : "./images/nba_bucks.jpg" +}, { + NAME : "Nichols, Demetris", + ACTIVE : "2007 - 2008", + FROM : "College - Syracuse", + TEAM_LOGO : "./images/nba_lakers.jpg" +}, { + NAME : "Nichols, Jack Edward", + ACTIVE : "1948 - 1957", + FROM : "College - Washington; USC", + TEAM_LOGO : "./images/nba_suns.jpg" +}, { + NAME : "Nickerson, Gaylon", + ACTIVE : "1996 - 1996", + FROM : "College - Wichita State; Butler Co. CC PA; Kansas State; Northwestern O", + TEAM_LOGO : "./images/nba_raptors.jpg" +}, { + NAME : "O'Bannon, Charles", + ACTIVE : "1997 - 1998", + FROM : "College - UCLA", + TEAM_LOGO : "./images/nba_kings.jpg" +}, { + NAME : "O'Bannon, Ed", + ACTIVE : "1995 - 1996", + FROM : "College - UCLA", + TEAM_LOGO : "./images/nba_celtics.jpg" +}, { + NAME : "O'Koren, Mike", + ACTIVE : "1980 - 1987", + FROM : "College - North Carolina", + TEAM_LOGO : "./images/nba_timberwolves.jpg" +}, { + NAME : "O'Sullivan, Dan", + ACTIVE : "1990 - 1995", + FROM : "College - Fordham", + TEAM_LOGO : "./images/nba_pistons.jpg" +}, { + NAME : "O'Boyle, John W.", + ACTIVE : "1952 - 1952", + FROM : "College - Modesto JC CA; Colorado State", + TEAM_LOGO : "./images/nba_nets.jpg" +}, { + NAME : "O'Brien, Ralph E. (Buckshot)", + ACTIVE : "1951 - 1952", + FROM : "College - Butler", + TEAM_LOGO : "./images/nba_cavaliers.jpg" +}, { + NAME : "O'Brien, Robert (Bob)", + ACTIVE : "1947 - 1948", + FROM : "College - Kansas; Pepperdine", + TEAM_LOGO : "./images/nba_celtics.jpg" +}, { + NAME : "O'Bryant, Patrick", + ACTIVE : "2007 - 2009", + FROM : "College - Bradley", + TEAM_LOGO : "./images/nba_trail.jpg" +}, { + NAME : "O'Connell, Dermott F. (Dermie)", + ACTIVE : "1948 - 1949", + FROM : "College - Holy Cross", + TEAM_LOGO : "./images/nba_warriors.jpg" +}, { + NAME : "O'Donnell, Andrew J. (Andy)", + ACTIVE : "1949 - 1949", + FROM : "College - Loyola (Balt.)", + TEAM_LOGO : "./images/nba_trail.jpg" +}, { + NAME : "O'Grady, Francis David (Buddy)", + ACTIVE : "1946 - 1948", + FROM : "College - Georgetown", + TEAM_LOGO : "./images/nba_sonics.jpg" +}, { + NAME : "O'Keefe, Richard T. (Dick)", + ACTIVE : "1947 - 1950", + FROM : "College - Santa Clara", + TEAM_LOGO : "./images/nba_bobcats.jpg" +}, { + NAME : "O'Keefe, Thomas V. (Tommy)", + ACTIVE : "1950 - 1950", + FROM : "College - Notre Dame; Georgetown", + TEAM_LOGO : "./images/nba_nets.jpg" +}, { + NAME : "O'Malley, V. Grady (Grady)", + ACTIVE : "1969 - 1969", + FROM : "College - Manhattan", + TEAM_LOGO : "./images/nba_magics.jpg" +}, { + NAME : "O'Neal, Jermaine", + ACTIVE : "ACTIVE", + FROM : "High School - Eau Claire HS (SC)", + TEAM_LOGO : "./images/nba_bulls.jpg" +}, { + NAME : "O'Neal, Shaquille", + ACTIVE : "2007 - 2010", + FROM : "College - Louisiana State", + TEAM_LOGO : "./images/nba_nuggets.jpg" +}, { + NAME : "O'Neill, Mike", + ACTIVE : "1952 - 1952", + FROM : "College - California", + TEAM_LOGO : "./images/nba_bobcats.jpg" +}, { + NAME : "O'Shea, Kevin Christopher", + ACTIVE : "1950 - 1952", + FROM : "College - Notre Dame", + TEAM_LOGO : "./images/nba_spurs.jpg" +}, { + NAME : "O'Shields, Garland L. (Mule)", + ACTIVE : "1946 - 1946", + FROM : "College - Spartanburg Tech SC (J.C.); Tennessee", + TEAM_LOGO : "./images/nba_wizards.jpg" +}, { + NAME : "Oakley, Charles", + ACTIVE : "1985 - 2003", + FROM : "College - Virginia Union ''85", + TEAM_LOGO : "./images/nba_mavericks.jpg" +}, { + NAME : "Oberto, Fabricio", + ACTIVE : "2007 - 2010", + FROM : "From - Las Varillas, Argentina", + TEAM_LOGO : "./images/nba_pistons.jpg" +}, { + NAME : "Oden, Greg", + ACTIVE : "ACTIVE", + FROM : "College - Ohio State", + TEAM_LOGO : "./images/nba_raptors.jpg" +}, { + NAME : "Odom, Lamar", + ACTIVE : "ACTIVE", + FROM : "College - Rhode Island", + TEAM_LOGO : "./images/nba_kings.jpg" +}, { + NAME : "Ogden, Carlos (Bud)", + ACTIVE : "1969 - 1970", + FROM : "College - Santa Clara", + TEAM_LOGO : "./images/nba_spurs.jpg" +}, { + NAME : "Ogden, Ralph", + ACTIVE : "1970 - 1970", + FROM : "College - Santa Clara", + TEAM_LOGO : "./images/nba_kings.jpg" +}, { + NAME : "Ogg, Alan", + ACTIVE : "1990 - 1992", + FROM : "College - Alabama-Birmingham", + TEAM_LOGO : "./images/nba_bobcats.jpg" +}, { + NAME : "Ohl, Donald Jay (Don)", + ACTIVE : "1960 - 1969", + FROM : "College - Illinois", + TEAM_LOGO : "./images/nba_heats.jpg" +}, { + NAME : "Okafor, Emeka", + ACTIVE : "ACTIVE", + FROM : "College - Connecticut", + TEAM_LOGO : "./images/nba_rockets.jpg" +}, { + NAME : "Okur, Mehmet", + ACTIVE : "ACTIVE", + FROM : "From - Yalova, Turkey", + TEAM_LOGO : "./images/nba_nets.jpg" +}, { + NAME : "Olajuwon, Hakeem", + ACTIVE : "1984 - 2001", + FROM : "College - Houston ''84", + TEAM_LOGO : "./images/nba_rockets.jpg" +}, { + NAME : "Olberding, Mark", + ACTIVE : "1976 - 1986", + FROM : "College - Minnesota", + TEAM_LOGO : "./images/nba_bulls.jpg" +}, { + NAME : "Oldham, Jawann", + ACTIVE : "1980 - 1990", + FROM : "College - Seattle", + TEAM_LOGO : "./images/nba_celtics.jpg" +}, { + NAME : "Oldham, John O. (Johnny)", + ACTIVE : "1949 - 1950", + FROM : "College - Western Kentucky", + TEAM_LOGO : "./images/nba_griz.jpg" +}, { + NAME : "Oleynick, Frank (Magic)", + ACTIVE : "1975 - 1976", + FROM : "College - Seattle", + TEAM_LOGO : "./images/nba_knics.jpg" +}, { + NAME : "Olive, John", + ACTIVE : "1978 - 1979", + FROM : "College - Villanova", + TEAM_LOGO : "./images/nba_bulls.jpg" +}, { + NAME : "Oliver, Brian", + ACTIVE : "1990 - 1997", + FROM : "College - Georgia Tech", + TEAM_LOGO : "./images/nba_celtics.jpg" +}, { + NAME : "Oliver, Dean", + ACTIVE : "2001 - 2002", + FROM : "College - Iowa ''01", + TEAM_LOGO : "./images/nba_rockets.jpg" +}, { + NAME : "Oliver, Jimmy", + ACTIVE : "1991 - 1998", + FROM : "College - Purdue", + TEAM_LOGO : "./images/nba_mavericks.jpg" +}, { + NAME : "Ollie, Kevin", + ACTIVE : "2007 - 2009", + FROM : "College - Connecticut", + TEAM_LOGO : "./images/nba_raptors.jpg" +}, { + NAME : "Ollrich, Gene W. (Moe)", + ACTIVE : "1949 - 1949", + FROM : "College - Drake", + TEAM_LOGO : "./images/nba_hawks.jpg" +}, { + NAME : "Olowokandi, Michael", + ACTIVE : "1998 - 2006", + FROM : "College - U. of Pacific", + TEAM_LOGO : "./images/nba_hawks.jpg" +}, { + NAME : "Olsen, Enoch Eli III (Bud)", + ACTIVE : "1962 - 1968", + FROM : "College - Louisville", + TEAM_LOGO : "./images/nba_knics.jpg" +}, { + NAME : "Orms, Barry D.", + ACTIVE : "1968 - 1968", + FROM : "College - St. Louis", + TEAM_LOGO : "./images/nba_suns.jpg" +}, { + NAME : "Orr, John M. (Johnny)", + ACTIVE : "1949 - 1949", + FROM : "College - Beloit; Illinois", + TEAM_LOGO : "./images/nba_nets.jpg" +}, { + NAME : "Orr, Louis", + ACTIVE : "1980 - 1987", + FROM : "College - Syracuse", + TEAM_LOGO : "./images/nba_warriors.jpg" +}, { + NAME : "Ortiz, Jose", + ACTIVE : "1988 - 1989", + FROM : "College - Oregon State", + TEAM_LOGO : "./images/nba_bobcats.jpg" +}, { + NAME : "Osborne, Charles H. (Chuck)", + ACTIVE : "1961 - 1961", + FROM : "College - Western Kentucky", + TEAM_LOGO : "./images/nba_rockets.jpg" +}, { + NAME : "Osterkorn, Walter Raymond (Wally)", + ACTIVE : "1951 - 1954", + FROM : "College - Illinois", + TEAM_LOGO : "./images/nba_magics.jpg" +}, { + NAME : "Ostertag, Greg", + ACTIVE : "1995 - 2005", + FROM : "College - Kansas", + TEAM_LOGO : "./images/nba_bobcats.jpg" +}, { + NAME : "Othick, Matt", + ACTIVE : "1992 - 1992", + FROM : "College - Arizona", + TEAM_LOGO : "./images/nba_jazz.jpg" +}, { + NAME : "Pace, Joseph (Joe)", + ACTIVE : "1976 - 1977", + FROM : "College - Maryland East. Shore; Coppin State", + TEAM_LOGO : "./images/nba_warriors.jpg" +}, { + NAME : "Pachulia, Zaza", + ACTIVE : "ACTIVE", + FROM : "From - Tbilisi, Georgia", + TEAM_LOGO : "./images/nba_clippers.jpg" +}, { + NAME : "Pack, Robert", + ACTIVE : "1991 - 2003", + FROM : "College - USC", + TEAM_LOGO : "./images/nba_timberwolves.jpg" +}, { + NAME : "Paddio, Gerald", + ACTIVE : "1990 - 1993", + FROM : "College - Seminole JC OK; Kilgore Coll. TX (J.C.); Nevada-Las Vegas", + TEAM_LOGO : "./images/nba_warriors.jpg" +}, { + NAME : "Padgett, Scott", + ACTIVE : "1999 - 2006", + FROM : "College - Kentucky", + TEAM_LOGO : "./images/nba_timberwolves.jpg" +}, { + NAME : "Paine, Frederick Vincent Jr. (Fred)", + ACTIVE : "1948 - 1948", + FROM : "College - Westminster (PA)", + TEAM_LOGO : "./images/nba_bucks.jpg" +}, { + NAME : "Palacio, Milt", + ACTIVE : "1999 - 2005", + FROM : "College - Colorado State", + TEAM_LOGO : "./images/nba_bobcats.jpg" +}, { + NAME : "Palazzi, Togo Anthony", + ACTIVE : "1954 - 1959", + FROM : "College - Holy Cross", + TEAM_LOGO : "./images/nba_spurs.jpg" +}, { + NAME : "Palmer, James G. (Jim)", + ACTIVE : "1958 - 1960", + FROM : "College - Dayton", + TEAM_LOGO : "./images/nba_celtics.jpg" +}, { + NAME : "Palmer, John S. (Bud)", + ACTIVE : "1946 - 1948", + FROM : "College - Princeton", + TEAM_LOGO : "./images/nba_nuggets.jpg" +}, { + NAME : "Palmer, Walter", + ACTIVE : "1990 - 1992", + FROM : "College - Dartmouth", + TEAM_LOGO : "./images/nba_timberwolves.jpg" +}, { + NAME : "Panko, Andy", + ACTIVE : "2000 - 2000", + FROM : "College - Lebanon Valley", + TEAM_LOGO : "./images/nba_lakers.jpg" +}, { + NAME : "Pargo, Jannero", + ACTIVE : "ACTIVE", + FROM : "College - Arkansas", + TEAM_LOGO : "./images/nba_wizards.jpg" +}, { + NAME : "Parham, Estes Foster (Easy)", + ACTIVE : "1948 - 1950", + FROM : "College - Texas Wesleyan", + TEAM_LOGO : "./images/nba_nets.jpg" +}, { + NAME : "Parish, Robert", + ACTIVE : "1976 - 1996", + FROM : "College - Centenary", + TEAM_LOGO : "./images/nba_magics.jpg" +}, { + NAME : "Park, Medford R. (Med)", + ACTIVE : "1955 - 1959", + FROM : "College - Missouri", + TEAM_LOGO : "./images/nba_kings.jpg" +}, { + NAME : "Parker, Anthony", + ACTIVE : "ACTIVE", + FROM : "College - Bradley", + TEAM_LOGO : "./images/nba_magics.jpg" +}, { + NAME : "Parker, Robert S. Jr. (Sonny)", + ACTIVE : "1976 - 1981", + FROM : "College - Mineral Area Coll. MO (J.C.); Texas A&M", + TEAM_LOGO : "./images/nba_sonics.jpg" +}, { + NAME : "Parker, Smush", + ACTIVE : "2007 - 2007", + FROM : "College - Fordham", + TEAM_LOGO : "./images/nba_nets.jpg" +}, { + NAME : "Parker, Tony", + ACTIVE : "ACTIVE", + FROM : "From - Paris, France", + TEAM_LOGO : "./images/nba_magics.jpg" +}, { + NAME : "Parkinson, Jack Gordon", + ACTIVE : "1949 - 1949", + FROM : "College - Kentucky", + TEAM_LOGO : "./images/nba_mavericks.jpg" +}, { + NAME : "Parks, Cherokee", + ACTIVE : "1995 - 2003", + FROM : "College - Duke ''95", + TEAM_LOGO : "./images/nba_pistons.jpg" +}, { + NAME : "Parr, Jack", + ACTIVE : "1958 - 1958", + FROM : "College - Kansas State", + TEAM_LOGO : "./images/nba_trail.jpg" +}, { + NAME : "Parrack, Doyle Kenneth", + ACTIVE : "1946 - 1946", + FROM : "College - Oklahoma State", + TEAM_LOGO : "./images/nba_wizards.jpg" +}, { + NAME : "Parsley, Charles H. (Charlie)", + ACTIVE : "1949 - 1949", + FROM : "College - Western Kentucky", + TEAM_LOGO : "./images/nba_suns.jpg" +}, { + NAME : "Paspalj, Zarko", + ACTIVE : "1989 - 1989", + FROM : "College - No College", + TEAM_LOGO : "./images/nba_jazz.jpg" +}, { + NAME : "Passaglia, Martin Harold (Marty)", + ACTIVE : "1946 - 1948", + FROM : "College - Santa Clara", + TEAM_LOGO : "./images/nba_rockets.jpg" +}, { + NAME : "Pastushok, George A.", + ACTIVE : "1946 - 1946", + FROM : "College - Manhattan; St. John's (N.Y.)", + TEAM_LOGO : "./images/nba_pistons.jpg" +}, { + NAME : "Patrick, Myles", + ACTIVE : "1980 - 1980", + FROM : "College - Auburn", + TEAM_LOGO : "./images/nba_raptors.jpg" +}, { + NAME : "Patrick, Stanley A. (Stan)", + ACTIVE : "1949 - 1949", + FROM : "College - Santa Clara; Illinois", + TEAM_LOGO : "./images/nba_sonics.jpg" +}, { + NAME : "Patterson, Andrae", + ACTIVE : "1998 - 1999", + FROM : "College - Indiana", + TEAM_LOGO : "./images/nba_cavaliers.jpg" +}, { + NAME : "Patterson, George", + ACTIVE : "1967 - 1967", + FROM : "College - Toledo", + TEAM_LOGO : "./images/nba_rockets.jpg" +}, { + NAME : "Patterson, Patrick", + ACTIVE : "ACTIVE", + FROM : "College - Kentucky", + TEAM_LOGO : "./images/nba_trail.jpg" +}, { + NAME : "Patterson, Ruben", + ACTIVE : "2007 - 2007", + FROM : "College - Cincinnati", + TEAM_LOGO : "./images/nba_warriors.jpg" +}, { + NAME : "Patterson, Steven J. (Steve)", + ACTIVE : "1971 - 1975", + FROM : "College - UCLA", + TEAM_LOGO : "./images/nba_knics.jpg" +}, { + NAME : "Patterson, Tommie J. (Tommy)", + ACTIVE : "1972 - 1973", + FROM : "College - Ouachita Baptist", + TEAM_LOGO : "./images/nba_rockets.jpg" +}, { + NAME : "Patterson, Worthington R. (Worthy)", + ACTIVE : "1957 - 1957", + FROM : "College - Connecticut", + TEAM_LOGO : "./images/nba_lakers.jpg" +}, { + NAME : "Paul, Chris", + ACTIVE : "ACTIVE", + FROM : "College - Wake Forest", + TEAM_LOGO : "./images/nba_sonics.jpg" +}, { + NAME : "Paulk, Charles (Charlie)", + ACTIVE : "1968 - 1971", + FROM : "College - Tulsa; Northeastern State (Okla.)", + TEAM_LOGO : "./images/nba_warriors.jpg" +}, { + NAME : "Paulson, Gerald Arthur (Jerry)", + ACTIVE : "1957 - 1957", + FROM : "College - Manhattan", + TEAM_LOGO : "./images/nba_heats.jpg" +}, { + NAME : "Paultz, Billy", + ACTIVE : "1976 - 1984", + FROM : "College - Cameron; St. John's (N.Y.)", + TEAM_LOGO : "./images/nba_bucks.jpg" +}, { + NAME : "Pavlovic, Aleksandar", + ACTIVE : "ACTIVE", + FROM : "From - Bar, Montenegro", + TEAM_LOGO : "./images/nba_rockets.jpg" +}, { + NAME : "Paxson, James Edward Sr. (Jim)", + ACTIVE : "1956 - 1957", + FROM : "College - Dayton", + TEAM_LOGO : "./images/nba_jazz.jpg" +}, { + NAME : "Paxson, Jim", + ACTIVE : "1979 - 1989", + FROM : "College - Dayton", + TEAM_LOGO : "./images/nba_pacers.jpg" +}, { + NAME : "Paxson, John", + ACTIVE : "1983 - 1993", + FROM : "College - Notre Dame", + TEAM_LOGO : "./images/nba_hawks.jpg" +}, { + NAME : "Payak, John Jr. (Johnny)", + ACTIVE : "1949 - 1952", + FROM : "College - Bowling Green State", + TEAM_LOGO : "./images/nba_hawks.jpg" +}, { + NAME : "Payne, Kenny", + ACTIVE : "1989 - 1992", + FROM : "College - Louisville", + TEAM_LOGO : "./images/nba_raptors.jpg" +}, { + NAME : "Payne, Tom", + ACTIVE : "1971 - 1971", + FROM : "College - Kentucky", + TEAM_LOGO : "./images/nba_knics.jpg" +}, { + NAME : "Payton, Gary", + ACTIVE : "1990 - 2006", + FROM : "College - Oregon State", + TEAM_LOGO : "./images/nba_warriors.jpg" +}, { + NAME : "Payton, Melvin E. (Mel)", + ACTIVE : "1951 - 1952", + FROM : "College - Tulane", + TEAM_LOGO : "./images/nba_bulls.jpg" +}, { + NAME : "Quick, Robert L. (Bob)", + ACTIVE : "1968 - 1971", + FROM : "College - Xavier (Ohio)", + TEAM_LOGO : "./images/nba_rockets.jpg" +}, { + NAME : "Quinn, Chris", + ACTIVE : "ACTIVE", + FROM : "College - Notre Dame", + TEAM_LOGO : "./images/nba_jazz.jpg" +}, { + NAME : "Quinnett, Brian", + ACTIVE : "1989 - 1991", + FROM : "College - Washington State", + TEAM_LOGO : "./images/nba_timberwolves.jpg" +}, { + NAME : "Rackley, Luther Jr. (Luke)", + ACTIVE : "1969 - 1973", + FROM : "College - Xavier (Ohio)", + TEAM_LOGO : "./images/nba_76ers.jpg" +}, { + NAME : "Rader, Howard (Howie)", + ACTIVE : "1948 - 1948", + FROM : "College - Long Island University", + TEAM_LOGO : "./images/nba_griz.jpg" +}, { + NAME : "Radford, Mark", + ACTIVE : "1981 - 1982", + FROM : "College - Oregon State", + TEAM_LOGO : "./images/nba_bulls.jpg" +}, { + NAME : "Radford, Wayne", + ACTIVE : "1978 - 1978", + FROM : "College - Indiana", + TEAM_LOGO : "./images/nba_sonics.jpg" +}, { + NAME : "Radja, Dino", + ACTIVE : "1993 - 1996", + FROM : "College - Croatia", + TEAM_LOGO : "./images/nba_lakers.jpg" +}, { + NAME : "Radmanovic, Vladimir", + ACTIVE : "ACTIVE", + FROM : "From - Belgrade, Serbia", + TEAM_LOGO : "./images/nba_bucks.jpg" +}, { + NAME : "Radojevic, Aleksandar", + ACTIVE : "1999 - 2004", + FROM : "From - Serbia-Montenegro", + TEAM_LOGO : "./images/nba_celtics.jpg" +}, { + NAME : "Radovich, Frank Raymond", + ACTIVE : "1961 - 1961", + FROM : "College - Indiana", + TEAM_LOGO : "./images/nba_griz.jpg" +}, { + NAME : "Radovich, George Lewis (Moe)", + ACTIVE : "1952 - 1952", + FROM : "College - Wyoming", + TEAM_LOGO : "./images/nba_bulls.jpg" +}, { + NAME : "Radziszewski, Raymond A. (Ray)", + ACTIVE : "1957 - 1957", + FROM : "College - St. Joseph's (PA)", + TEAM_LOGO : "./images/nba_rockets.jpg" +}, { + NAME : "Ragelis, Raymond Ernest (Ray)", + ACTIVE : "1951 - 1951", + FROM : "College - Northwestern", + TEAM_LOGO : "./images/nba_wizards.jpg" +}, { + NAME : "Raiken, Sherwin H.", + ACTIVE : "1952 - 1952", + FROM : "College - Villanova", + TEAM_LOGO : "./images/nba_warriors.jpg" +}, { + NAME : "Rains, Ed", + ACTIVE : "1981 - 1982", + FROM : "College - South Alabama", + TEAM_LOGO : "./images/nba_bulls.jpg" +}, { + NAME : "Rakocevic, Igor", + ACTIVE : "2002 - 2002", + FROM : "College - No College", + TEAM_LOGO : "./images/nba_bucks.jpg" +}, { + NAME : "Rambis, Kurt", + ACTIVE : "1981 - 1994", + FROM : "College - Santa Clara", + TEAM_LOGO : "./images/nba_lakers.jpg" +}, { + NAME : "Ramos, Peter", + ACTIVE : "2004 - 2004", + FROM : "From - Puerto Rico", + TEAM_LOGO : "./images/nba_hawks.jpg" +}, { + NAME : "Ramsey, Calvin (Cal)", + ACTIVE : "1959 - 1960", + FROM : "College - N.Y.U.", + TEAM_LOGO : "./images/nba_trail.jpg" +}, { + NAME : "Ramsey, Frank", + ACTIVE : "1954 - 1963", + FROM : "College - Kentucky", + TEAM_LOGO : "./images/nba_jazz.jpg" +}, { + NAME : "Ramsey, Raymond Leroy (Ray)", + ACTIVE : "1948 - 1948", + FROM : "College - Bradley", + TEAM_LOGO : "./images/nba_magics.jpg" +}, { + NAME : "Randall, Mark", + ACTIVE : "1991 - 1994", + FROM : "College - Kansas", + TEAM_LOGO : "./images/nba_timberwolves.jpg" +}, { + NAME : "Randolph, Anthony", + ACTIVE : "ACTIVE", + FROM : "College - Louisiana State", + TEAM_LOGO : "./images/nba_wizards.jpg" +}, { + NAME : "Randolph, Shavlik", + ACTIVE : "2007 - 2009", + FROM : "College - Duke", + TEAM_LOGO : "./images/nba_raptors.jpg" +}, { + NAME : "Randolph, Zach", + ACTIVE : "ACTIVE", + FROM : "College - Michigan State", + TEAM_LOGO : "./images/nba_hawks.jpg" +}, { + NAME : "Rank, Wallace Aliifua (Wally)", + ACTIVE : "1980 - 1980", + FROM : "College - San Jose State", + TEAM_LOGO : "./images/nba_jazz.jpg" +}, { + NAME : "Ransey, Kelvin", + ACTIVE : "1980 - 1985", + FROM : "College - Ohio State", + TEAM_LOGO : "./images/nba_bulls.jpg" +}, { + NAME : "Ranzino, Samuel Salvadore (Sam)", + ACTIVE : "1951 - 1951", + FROM : "College - North Carolina State", + TEAM_LOGO : "./images/nba_hawks.jpg" +}, { + NAME : "Rasmussen, Blair", + ACTIVE : "1985 - 1992", + FROM : "College - Oregon", + TEAM_LOGO : "./images/nba_rockets.jpg" +}, { + NAME : "Ratkovicz, George", + ACTIVE : "1949 - 1954", + FROM : "College - No College", + TEAM_LOGO : "./images/nba_clippers.jpg" +}, { + NAME : "Ratleff, Ed", + ACTIVE : "1973 - 1977", + FROM : "College - Long Beach State", + TEAM_LOGO : "./images/nba_honets.jpg" +}, { + NAME : "Ratliff, Michael D. (Mike)", + ACTIVE : "1972 - 1973", + FROM : "College - Wis.-Eau Claire", + TEAM_LOGO : "./images/nba_trail.jpg" +}, { + NAME : "Ratliff, Theo", + ACTIVE : "ACTIVE", + FROM : "College - Wyoming", + TEAM_LOGO : "./images/nba_spurs.jpg" +}, { + NAME : "Rautins, Andy", + ACTIVE : "ACTIVE", + FROM : "College - Syracuse", + TEAM_LOGO : "./images/nba_magics.jpg" +}, { + NAME : "Rautins, Leo", + ACTIVE : "1983 - 1984", + FROM : "College - Minnesota; Syracuse", + TEAM_LOGO : "./images/nba_76ers.jpg" +}, { + NAME : "Ray, Allan", + ACTIVE : "2006 - 2006", + FROM : "College - Villanova", + TEAM_LOGO : "./images/nba_pistons.jpg" +}, { + NAME : "Ray, Clifford", + ACTIVE : "1971 - 1980", + FROM : "College - Oklahoma", + TEAM_LOGO : "./images/nba_suns.jpg" +}, { + NAME : "Ray, Donald L. (Don, Duck)", + ACTIVE : "1949 - 1949", + FROM : "College - Western Kentucky", + TEAM_LOGO : "./images/nba_heats.jpg" +}, { + NAME : "Ray, James E. (Jim)", + ACTIVE : "1956 - 1959", + FROM : "College - Toledo", + TEAM_LOGO : "./images/nba_lakers.jpg" +}, { + NAME : "Ray, James Earl", + ACTIVE : "1980 - 1982", + FROM : "College - Jacksonville", + TEAM_LOGO : "./images/nba_bucks.jpg" +}, { + NAME : "Raymond, Craig Milford", + ACTIVE : "1968 - 1968", + FROM : "College - Brigham Young", + TEAM_LOGO : "./images/nba_suns.jpg" +}, { + NAME : "Rea, Connie Mack", + ACTIVE : "1953 - 1953", + FROM : "College - Centenary; Vanderbilt", + TEAM_LOGO : "./images/nba_76ers.jpg" +}, { + NAME : "Reaves, Joe L.", + ACTIVE : "1973 - 1973", + FROM : "College - Bethel College (Tenn.)", + TEAM_LOGO : "./images/nba_pistons.jpg" +}, { + NAME : "Rebraca, Zeljko", + ACTIVE : "2001 - 2005", + FROM : "From - Serbia & Montenegro", + TEAM_LOGO : "./images/nba_nuggets.jpg" +}, { + NAME : "Recasner, Eldridge", + ACTIVE : "1994 - 2001", + FROM : "College - Washington", + TEAM_LOGO : "./images/nba_heats.jpg" +}, { + NAME : "Redd, Michael", + ACTIVE : "ACTIVE", + FROM : "College - Ohio State", + TEAM_LOGO : "./images/nba_bucks.jpg" +}, { + NAME : "Reddout, Franklin P. (Frank)", + ACTIVE : "1953 - 1953", + FROM : "College - Syracuse", + TEAM_LOGO : "./images/nba_magics.jpg" +}, { + NAME : "Redick, J.J.", + ACTIVE : "ACTIVE", + FROM : "College - Duke", + TEAM_LOGO : "./images/nba_raptors.jpg" +}, { + NAME : "Redmond, Marlon Bernard", + ACTIVE : "1978 - 1979", + FROM : "College - San Francisco", + TEAM_LOGO : "./images/nba_knics.jpg" +}, { + NAME : "Reed, Hubert F. (Hub)", + ACTIVE : "1958 - 1964", + FROM : "College - Oklahoma City", + TEAM_LOGO : "./images/nba_bucks.jpg" +}, { + NAME : "Reed, Justin", + ACTIVE : "2004 - 2006", + FROM : "College - Mississippi", + TEAM_LOGO : "./images/nba_bulls.jpg" +}, { + NAME : "Reed, Ronald Lee (Ron)", + ACTIVE : "1965 - 1966", + FROM : "College - Notre Dame", + TEAM_LOGO : "./images/nba_nets.jpg" +}, { + NAME : "Sabonis, Arvydas", + ACTIVE : "1995 - 2002", + FROM : "From - Lithuania", + TEAM_LOGO : "./images/nba_suns.jpg" +}, { + NAME : "Sadowski, Edward Frank (Ed, Big Ed)", + ACTIVE : "1946 - 1949", + FROM : "College - Seton Hall", + TEAM_LOGO : "./images/nba_trail.jpg" +}, { + NAME : "Sailors, Kenneth L. (Kenny)", + ACTIVE : "1946 - 1950", + FROM : "College - Wyoming", + TEAM_LOGO : "./images/nba_sonics.jpg" +}, { + NAME : "Salley, John", + ACTIVE : "1986 - 1999", + FROM : "College - Georgia Tech", + TEAM_LOGO : "./images/nba_timberwolves.jpg" +}, { + NAME : "Salmons, John", + ACTIVE : "ACTIVE", + FROM : "College - Miami (Fla.)", + TEAM_LOGO : "./images/nba_spurs.jpg" +}, { + NAME : "Salvadori, Kevin", + ACTIVE : "1996 - 1997", + FROM : "College - North Carolina", + TEAM_LOGO : "./images/nba_knics.jpg" +}, { + NAME : "Samake, Soumaila", + ACTIVE : "2000 - 2002", + FROM : "From - Republic of Mali", + TEAM_LOGO : "./images/nba_pacers.jpg" +}, { + NAME : "Samb, Cheikh", + ACTIVE : "2007 - 2008", + FROM : "From - Senegal", + TEAM_LOGO : "./images/nba_bulls.jpg" +}, { + NAME : "Sampson, Jamal", + ACTIVE : "2002 - 2006", + FROM : "College - California", + TEAM_LOGO : "./images/nba_knics.jpg" +}, { + NAME : "Sampson, Ralph", + ACTIVE : "1983 - 1991", + FROM : "College - Virginia", + TEAM_LOGO : "./images/nba_clippers.jpg" +}, { + NAME : "Samuels, Samardo", + ACTIVE : "ACTIVE", + FROM : "College - Louisville", + TEAM_LOGO : "./images/nba_nuggets.jpg" +}, { + NAME : "Sanchez, Pepe", + ACTIVE : "2000 - 2002", + FROM : "College - Temple ''00", + TEAM_LOGO : "./images/nba_lakers.jpg" +}, { + NAME : "Sanders, Frankie J. (Frankie J.)", + ACTIVE : "1978 - 1980", + FROM : "College - Southern University", + TEAM_LOGO : "./images/nba_nuggets.jpg" +}, { + NAME : "Sanders, Jeff", + ACTIVE : "1989 - 1992", + FROM : "College - Georgia Southern", + TEAM_LOGO : "./images/nba_raptors.jpg" +}, { + NAME : "Sanders, Larry", + ACTIVE : "ACTIVE", + FROM : "College - Virginia Commonwealth", + TEAM_LOGO : "./images/nba_suns.jpg" +}, { + NAME : "Sanders, Melvin", + ACTIVE : "2005 - 2005", + FROM : "College - Oklahoma State", + TEAM_LOGO : "./images/nba_trail.jpg" +}, { + NAME : "Sanders, Mike", + ACTIVE : "1982 - 1992", + FROM : "College - UCLA", + TEAM_LOGO : "./images/nba_knics.jpg" +}, { + NAME : "Sanders, Thomas Ernest (Satch)", + ACTIVE : "1960 - 1972", + FROM : "College - N.Y.U.", + TEAM_LOGO : "./images/nba_cavaliers.jpg" +}, { + NAME : "Santiago, Daniel", + ACTIVE : "2000 - 2004", + FROM : "College - St. Vincent", + TEAM_LOGO : "./images/nba_warriors.jpg" +}, { + NAME : "Santini, Robert (Bob)", + ACTIVE : "1955 - 1955", + FROM : "College - Iona", + TEAM_LOGO : "./images/nba_spurs.jpg" +}, { + NAME : "Sappleton, Wayne B.", + ACTIVE : "1984 - 1984", + FROM : "College - Loyola (Chicago)", + TEAM_LOGO : "./images/nba_bobcats.jpg" +}, { + NAME : "Sasser, Jason", + ACTIVE : "1996 - 1998", + FROM : "College - Texas Tech ''96", + TEAM_LOGO : "./images/nba_heats.jpg" +}, { + NAME : "Sasser, Jeryl", + ACTIVE : "2001 - 2002", + FROM : "College - Southern Methodist ''01", + TEAM_LOGO : "./images/nba_trail.jpg" +}, { + NAME : "Satterfield, Kenny", + ACTIVE : "2001 - 2002", + FROM : "College - Cincinnati ''03", + TEAM_LOGO : "./images/nba_raptors.jpg" +}, { + NAME : "Saul, Frank Benjamin Jr. (Pep)", + ACTIVE : "1949 - 1954", + FROM : "College - Seton Hall", + TEAM_LOGO : "./images/nba_hawks.jpg" +}, { + NAME : "Sauldsberry, Woodrow Jr. (Woody)", + ACTIVE : "1957 - 1965", + FROM : "College - Texas Southern", + TEAM_LOGO : "./images/nba_rockets.jpg" +}, { + NAME : "Saunders, James Frederick (Fred)", + ACTIVE : "1974 - 1977", + FROM : "College - Syracuse", + TEAM_LOGO : "./images/nba_clippers.jpg" +}, { + NAME : "Savage, Donald Joseph (Don)", + ACTIVE : "1951 - 1956", + FROM : "College - Le Moyne", + TEAM_LOGO : "./images/nba_timberwolves.jpg" +}, { + NAME : "Savovic, Predrag", + ACTIVE : "2002 - 2002", + FROM : "College - Hawaii ''02", + TEAM_LOGO : "./images/nba_nuggets.jpg" +}, { + NAME : "Sawyer, Alan Leigh", + ACTIVE : "1950 - 1950", + FROM : "College - UCLA", + TEAM_LOGO : "./images/nba_bobcats.jpg" +}, { + NAME : "Scalabrine, Brian", + ACTIVE : "ACTIVE", + FROM : "College - USC", + TEAM_LOGO : "./images/nba_clippers.jpg" +}, { + NAME : "Scales, Alex", + ACTIVE : "2005 - 2005", + FROM : "College - Oregon", + TEAM_LOGO : "./images/nba_pacers.jpg" +}, { + NAME : "Scales, DeWayne", + ACTIVE : "1980 - 1983", + FROM : "College - Louisiana State", + TEAM_LOGO : "./images/nba_knics.jpg" +}, { + NAME : "Schade, Frank", + ACTIVE : "1972 - 1972", + FROM : "College - Wis.-Eau Claire; Texas-El Paso", + TEAM_LOGO : "./images/nba_heats.jpg" +}, { + NAME : "Schadler, Bernard R. (Ben)", + ACTIVE : "1947 - 1947", + FROM : "College - Northwestern", + TEAM_LOGO : "./images/nba_trail.jpg" +}, { + NAME : "Schaefer, Herman H. (Herm)", + ACTIVE : "1948 - 1949", + FROM : "College - Indiana", + TEAM_LOGO : "./images/nba_celtics.jpg" +}, { + NAME : "Schafer, Robert Thomas (Bob)", + ACTIVE : "1955 - 1955", + FROM : "College - Villanova", + TEAM_LOGO : "./images/nba_bucks.jpg" +}, { + NAME : "Scharnus, Benedict Michael (Ben, Whitey)", + ACTIVE : "1946 - 1948", + FROM : "College - Seton Hall", + TEAM_LOGO : "./images/nba_trail.jpg" +}, { + NAME : "Schatzman, Marvin J. (Marv)", + ACTIVE : "1949 - 1949", + FROM : "College - St. Louis", + TEAM_LOGO : "./images/nba_nuggets.jpg" +}, { + NAME : "Schaus, Frederick Appleton (Fred)", + ACTIVE : "1949 - 1953", + FROM : "College - West Virginia", + TEAM_LOGO : "./images/nba_pacers.jpg" +}, { + NAME : "Schayes, Danny", + ACTIVE : "1981 - 1998", + FROM : "College - Syracuse", + TEAM_LOGO : "./images/nba_spurs.jpg" +}, { + NAME : "Schayes, Dolph", + ACTIVE : "1949 - 1963", + FROM : "College - N.Y.U.", + TEAM_LOGO : "./images/nba_pacers.jpg" +}, { + NAME : "Schectman, Oscar B. (Ossie)", + ACTIVE : "1946 - 1946", + FROM : "College - Long Island University", + TEAM_LOGO : "./images/nba_clippers.jpg" +}, { + NAME : "Scheffler, Steve", + ACTIVE : "1990 - 1996", + FROM : "College - Purdue", + TEAM_LOGO : "./images/nba_suns.jpg" +}, { + NAME : "Scheffler, Thomas Mark (Tom)", + ACTIVE : "1984 - 1984", + FROM : "College - Purdue", + TEAM_LOGO : "./images/nba_rockets.jpg" +}, { + NAME : "Schellhase, David Gene Jr. (Dave)", + ACTIVE : "1966 - 1967", + FROM : "College - Purdue", + TEAM_LOGO : "./images/nba_magics.jpg" +}, { + NAME : "Schenscher, Luke", + ACTIVE : "2005 - 2006", + FROM : "College - Georgia Tech", + TEAM_LOGO : "./images/nba_pacers.jpg" +}, { + NAME : "Scherer, Herbert Frederick (Herb)", + ACTIVE : "1950 - 1951", + FROM : "College - Long Island University", + TEAM_LOGO : "./images/nba_lakers.jpg" +}, { + NAME : "Schintzius, Dwayne", + ACTIVE : "1990 - 1998", + FROM : "College - Florida", + TEAM_LOGO : "./images/nba_timberwolves.jpg" +}, { + NAME : "Schlueter, Dale Wayne", + ACTIVE : "1968 - 1977", + FROM : "College - Colorado State", + TEAM_LOGO : "./images/nba_rockets.jpg" +}, { + NAME : "Tabak, Zan", + ACTIVE : "1994 - 2000", + FROM : "College - No College", + TEAM_LOGO : "./images/nba_suns.jpg" +}, { + NAME : "Tabuse, Yuta", + ACTIVE : "2004 - 2004", + FROM : "College - BYU-Hawaii", + TEAM_LOGO : "./images/nba_pistons.jpg" +}, { + NAME : "Taft, Chris", + ACTIVE : "2005 - 2005", + FROM : "College - Pittsburgh", + TEAM_LOGO : "./images/nba_warriors.jpg" +}, { + NAME : "Tannenbaum, Sidney (Sid)", + ACTIVE : "1947 - 1948", + FROM : "College - N.Y.U.", + TEAM_LOGO : "./images/nba_trail.jpg" +}, { + NAME : "Tarlac, Dragan", + ACTIVE : "2000 - 2000", + FROM : "College - Olympiakos (Greece)", + TEAM_LOGO : "./images/nba_jazz.jpg" +}, { + NAME : "Tarpley, Roy", + ACTIVE : "1986 - 1994", + FROM : "College - Michigan", + TEAM_LOGO : "./images/nba_pacers.jpg" +}, { + NAME : "Tatum, William Earl (Earl)", + ACTIVE : "1976 - 1979", + FROM : "College - Marquette", + TEAM_LOGO : "./images/nba_knics.jpg" +}, { + NAME : "Taylor, Anthony", + ACTIVE : "1988 - 1988", + FROM : "College - Oregon", + TEAM_LOGO : "./images/nba_griz.jpg" +}, { + NAME : "Taylor, Brian Dw.", + ACTIVE : "1976 - 1981", + FROM : "College - Princeton", + TEAM_LOGO : "./images/nba_mavericks.jpg" +}, { + NAME : "Taylor, Donell", + ACTIVE : "2005 - 2006", + FROM : "College - Alabama-Birmingham", + TEAM_LOGO : "./images/nba_spurs.jpg" +}, { + NAME : "Taylor, Fredrick Ollie (Fred)", + ACTIVE : "1970 - 1971", + FROM : "College - Texas-Pan American", + TEAM_LOGO : "./images/nba_sonics.jpg" +}, { + NAME : "Taylor, Jay", + ACTIVE : "1989 - 1989", + FROM : "College - Eastern Illinois", + TEAM_LOGO : "./images/nba_griz.jpg" +}, { + NAME : "Taylor, Jeff", + ACTIVE : "1982 - 1986", + FROM : "College - Texas Tech", + TEAM_LOGO : "./images/nba_trail.jpg" +}, { + NAME : "Taylor, Jermaine", + ACTIVE : "2009 - 2010", + FROM : "College - Central Florida", + TEAM_LOGO : "./images/nba_cavaliers.jpg" +}, { + NAME : "Taylor, Johnny", + ACTIVE : "1997 - 1999", + FROM : "College - Knoxville; Indian Hills CC IA; Tennessee-Chattanooga", + TEAM_LOGO : "./images/nba_jazz.jpg" +}, { + NAME : "Taylor, Leonard", + ACTIVE : "1989 - 1989", + FROM : "College - California", + TEAM_LOGO : "./images/nba_bucks.jpg" +}, { + NAME : "Taylor, Maurice", + ACTIVE : "1997 - 2006", + FROM : "College - Michigan", + TEAM_LOGO : "./images/nba_bulls.jpg" +}, { + NAME : "Taylor, Mike", + ACTIVE : "2008 - 2008", + FROM : "College - Iowa State", + TEAM_LOGO : "./images/nba_heats.jpg" +}, { + NAME : "Taylor, Roland Morris (Fatty)", + ACTIVE : "1976 - 1976", + FROM : "College - Edison CC FL; La Salle", + TEAM_LOGO : "./images/nba_jazz.jpg" +}, { + NAME : "Taylor, Vince", + ACTIVE : "1982 - 1982", + FROM : "College - Duke", + TEAM_LOGO : "./images/nba_sonics.jpg" +}, { + NAME : "Teagle, Terry", + ACTIVE : "1982 - 1992", + FROM : "College - Baylor", + TEAM_LOGO : "./images/nba_clippers.jpg" +}, { + NAME : "Teague, Jeff", + ACTIVE : "ACTIVE", + FROM : "College - Wake Forest", + TEAM_LOGO : "./images/nba_mavericks.jpg" +}, { + NAME : "Telfair, Sebastian", + ACTIVE : "ACTIVE", + FROM : "High School - Abraham Lincoln HS (Brooklyn, NY)", + TEAM_LOGO : "./images/nba_kings.jpg" +}, { + NAME : "Temple, Garrett", + ACTIVE : "ACTIVE", + FROM : "College - Louisiana State", + TEAM_LOGO : "./images/nba_wizards.jpg" +}, { + NAME : "Terrell, Ira Edmondson", + ACTIVE : "1976 - 1978", + FROM : "College - Southern Methodist", + TEAM_LOGO : "./images/nba_suns.jpg" +}, { + NAME : "Terry, Allen Charles (Chuck)", + ACTIVE : "1972 - 1976", + FROM : "College - Long Beach State", + TEAM_LOGO : "./images/nba_wizards.jpg" +}, { + NAME : "Terry, Carlos", + ACTIVE : "1980 - 1982", + FROM : "College - Winston-Salem State", + TEAM_LOGO : "./images/nba_sonics.jpg" +}, { + NAME : "Terry, Claude Lewis", + ACTIVE : "1976 - 1977", + FROM : "College - Stanford", + TEAM_LOGO : "./images/nba_timberwolves.jpg" +}, { + NAME : "Terry, Jason", + ACTIVE : "ACTIVE", + FROM : "College - Arizona", + TEAM_LOGO : "./images/nba_nets.jpg" +}, { + NAME : "Thabeet, Hasheem", + ACTIVE : "ACTIVE", + FROM : "College - Connecticut", + TEAM_LOGO : "./images/nba_bobcats.jpg" +}, { + NAME : "Thacker, Thomas Porter (Tom, Tack)", + ACTIVE : "1963 - 1967", + FROM : "College - Cincinnati", + TEAM_LOGO : "./images/nba_clippers.jpg" +}, { + NAME : "Theus, Reggie", + ACTIVE : "1978 - 1990", + FROM : "College - Nevada-Las Vegas", + TEAM_LOGO : "./images/nba_sonics.jpg" +}, { + NAME : "Thibeaux, Peter C.", + ACTIVE : "1984 - 1985", + FROM : "College - St. Mary's (CA)", + TEAM_LOGO : "./images/nba_celtics.jpg" +}, { + NAME : "Thieben, William Bernard (Bill)", + ACTIVE : "1956 - 1957", + FROM : "College - Hofstra", + TEAM_LOGO : "./images/nba_mavericks.jpg" +}, { + NAME : "Thigpen, Justus", + ACTIVE : "1972 - 1973", + FROM : "College - Charles Stewart Mott CC MI; Weber State", + TEAM_LOGO : "./images/nba_griz.jpg" +}, { + NAME : "Thirdkill, David", + ACTIVE : "1982 - 1986", + FROM : "College - Coll. of Southern Idaho (J.C.); Bradley", + TEAM_LOGO : "./images/nba_magics.jpg" +}, { + NAME : "Thomas, Billy", + ACTIVE : "2007 - 2007", + FROM : "College - Kansas", + TEAM_LOGO : "./images/nba_clippers.jpg" +}, { + NAME : "Thomas, Carl", + ACTIVE : "1991 - 1997", + FROM : "College - Eastern Michigan", + TEAM_LOGO : "./images/nba_bulls.jpg" +}, { + NAME : "Thomas, Charles", + ACTIVE : "1991 - 1991", + FROM : "College - Eastern Michigan", + TEAM_LOGO : "./images/nba_heats.jpg" +}, { + NAME : "Thomas, Etan", + ACTIVE : "ACTIVE", + FROM : "College - Syracuse", + TEAM_LOGO : "./images/nba_nuggets.jpg" +}, { + NAME : "Thomas, Irving", + ACTIVE : "1990 - 1990", + FROM : "College - Kentucky; Florida State", + TEAM_LOGO : "./images/nba_bulls.jpg" +}, { + NAME : "Thomas, Isiah", + ACTIVE : "1981 - 1993", + FROM : "College - Indiana", + TEAM_LOGO : "./images/nba_76ers.jpg" +}, { + NAME : "Thomas, Jamel", + ACTIVE : "1999 - 2000", + FROM : "College - Providence", + TEAM_LOGO : "./images/nba_kings.jpg" +}, { + NAME : "Thomas, Jamel", + ACTIVE : "1999 - 2000", + FROM : "College - Providence", + TEAM_LOGO : "./images/nba_76ers.jpg" +}, { + NAME : "Thomas, James", + ACTIVE : "2004 - 2005", + FROM : "College - Texas", + TEAM_LOGO : "./images/nba_bulls.jpg" +}, { + NAME : "Thomas, Jim", + ACTIVE : "1983 - 1990", + FROM : "College - Indiana", + TEAM_LOGO : "./images/nba_sonics.jpg" +}, { + NAME : "Thomas, John", + ACTIVE : "1997 - 2005", + FROM : "College - Minnesota", + TEAM_LOGO : "./images/nba_bobcats.jpg" +}, { + NAME : "Thomas, Joseph Randle (Joe)", + ACTIVE : "1970 - 1970", + FROM : "College - Marquette", + TEAM_LOGO : "./images/nba_bulls.jpg" +}, { + NAME : "Thomas, Kenny", + ACTIVE : "2007 - 2009", + FROM : "College - New Mexico", + TEAM_LOGO : "./images/nba_heats.jpg" +}, { + NAME : "Thomas, Kurt", + ACTIVE : "ACTIVE", + FROM : "College - Texas Christian", + TEAM_LOGO : "./images/nba_pistons.jpg" +}, { + NAME : "Udoh, Ekpe", + ACTIVE : "ACTIVE", + FROM : "College - Baylor", + TEAM_LOGO : "./images/nba_bulls.jpg" +}, { + NAME : "Udoka, Ime", + ACTIVE : "2007 - 2010", + FROM : "College - Portland State", + TEAM_LOGO : "./images/nba_sonics.jpg" +}, { + NAME : "Udrih, Beno", + ACTIVE : "ACTIVE", + FROM : "From - Sempeter, Slovenia", + TEAM_LOGO : "./images/nba_bucks.jpg" +}, { + NAME : "Ukic, Roko", + ACTIVE : "2008 - 2009", + FROM : "From - Split, Croatia", + TEAM_LOGO : "./images/nba_jazz.jpg" +}, { + NAME : "Unseld, Wes", + ACTIVE : "1968 - 1980", + FROM : "College - Louisville", + TEAM_LOGO : "./images/nba_kings.jpg" +}, { + NAME : "Uplinger, Harold F. (Hal)", + ACTIVE : "1953 - 1953", + FROM : "College - Long Island University", + TEAM_LOGO : "./images/nba_suns.jpg" +}, { + NAME : "Upshaw, Kelvin", + ACTIVE : "1988 - 1990", + FROM : "College - Northeastern State (Okla.); Utah", + TEAM_LOGO : "./images/nba_hawks.jpg" +}, { + NAME : "Uzoh, Ben", + ACTIVE : "ACTIVE", + FROM : "College - Tulsa", + TEAM_LOGO : "./images/nba_honets.jpg" +}, { + NAME : "Valentine, Darnell", + ACTIVE : "1981 - 1990", + FROM : "College - Kansas", + TEAM_LOGO : "./images/nba_celtics.jpg" +}, { + NAME : "Valentine, Ronnie L. (Ron)", + ACTIVE : "1980 - 1980", + FROM : "College - Old Dominion", + TEAM_LOGO : "./images/nba_griz.jpg" +}, { + NAME : "Vallely, John Stephen", + ACTIVE : "1970 - 1971", + FROM : "College - Orange Coast Coll. CA (J.C.); UCLA", + TEAM_LOGO : "./images/nba_bulls.jpg" +}, { + NAME : "Van Arsdale, Dick", + ACTIVE : "1965 - 1976", + FROM : "College - Indiana", + TEAM_LOGO : "./images/nba_spurs.jpg" +}, { + NAME : "Van Arsdale, Thomas Arthur (Tom)", + ACTIVE : "1965 - 1976", + FROM : "College - Indiana", + TEAM_LOGO : "./images/nba_kings.jpg" +}, { + NAME : "Van Breda Kolff, Jan", + ACTIVE : "1976 - 1982", + FROM : "College - Vanderbilt", + TEAM_LOGO : "./images/nba_timberwolves.jpg" +}, { + NAME : "Van Breda Kolff, Willem H. (Butch)", + ACTIVE : "1946 - 1949", + FROM : "College - Princeton; N.Y.U.", + TEAM_LOGO : "./images/nba_griz.jpg" +}, { + NAME : "Van Exel, Nick", + ACTIVE : "1993 - 2005", + FROM : "College - Cincinnati", + TEAM_LOGO : "./images/nba_lakers.jpg" +}, { + NAME : "Van Horn, Keith", + ACTIVE : "1997 - 2005", + FROM : "College - Utah", + TEAM_LOGO : "./images/nba_suns.jpg" +}, { + NAME : "Van Lier, Norm", + ACTIVE : "1969 - 1978", + FROM : "College - St. Francis (PA)", + TEAM_LOGO : "./images/nba_nets.jpg" +}, { + NAME : "Vance, Ellis Eugene (Gene)", + ACTIVE : "1947 - 1951", + FROM : "College - Illinois", + TEAM_LOGO : "./images/nba_heats.jpg" +}, { + NAME : "Vander Velden, Logan", + ACTIVE : "1995 - 1995", + FROM : "College - Wis.-Green Bay", + TEAM_LOGO : "./images/nba_suns.jpg" +}, { + NAME : "Vandeweghe, Ernest Maurice Jr. (Ernie, Doc)", + ACTIVE : "1949 - 1955", + FROM : "College - Colgate", + TEAM_LOGO : "./images/nba_honets.jpg" +}, { + NAME : "Vandeweghe, Kiki", + ACTIVE : "1980 - 1992", + FROM : "College - UCLA", + TEAM_LOGO : "./images/nba_bucks.jpg" +}, { + NAME : "Vanos, Nick", + ACTIVE : "1985 - 1986", + FROM : "College - Santa Clara", + TEAM_LOGO : "./images/nba_76ers.jpg" +}, { + NAME : "Vanterpool, David", + ACTIVE : "2000 - 2000", + FROM : "College - St. Bonaventure", + TEAM_LOGO : "./images/nba_sonics.jpg" +}, { + NAME : "Varda, Ratko", + ACTIVE : "2001 - 2001", + FROM : "From - Serbia & Montenegro", + TEAM_LOGO : "./images/nba_timberwolves.jpg" +}, { + NAME : "Varejao, Anderson", + ACTIVE : "ACTIVE", + FROM : "From - Santa Teresa, Brazil", + TEAM_LOGO : "./images/nba_sonics.jpg" +}, { + NAME : "Vasquez, Greivis", + ACTIVE : "ACTIVE", + FROM : "College - Maryland", + TEAM_LOGO : "./images/nba_kings.jpg" +}, { + NAME : "Vaughn, Charles (Chico)", + ACTIVE : "1962 - 1966", + FROM : "College - Southern Illinois", + TEAM_LOGO : "./images/nba_bulls.jpg" +}, { + NAME : "Vaughn, David", + ACTIVE : "1995 - 1998", + FROM : "College - Memphis", + TEAM_LOGO : "./images/nba_raptors.jpg" +}, { + NAME : "Vaughn, Jacque", + ACTIVE : "2007 - 2008", + FROM : "College - Kansas", + TEAM_LOGO : "./images/nba_lakers.jpg" +}, { + NAME : "Vaughn, Virgil V.", + ACTIVE : "1946 - 1946", + FROM : "College - Kentucky Wesleyan", + TEAM_LOGO : "./images/nba_wizards.jpg" +}, { + NAME : "Vaught, Loy", + ACTIVE : "1990 - 2000", + FROM : "College - Michigan", + TEAM_LOGO : "./images/nba_kings.jpg" +}, { + NAME : "Verga, Robert Bruce (Bob)", + ACTIVE : "1973 - 1973", + FROM : "College - Duke", + TEAM_LOGO : "./images/nba_bobcats.jpg" +}, { + NAME : "Verhoeven, Peter", + ACTIVE : "1981 - 1986", + FROM : "College - Fresno State", + TEAM_LOGO : "./images/nba_pacers.jpg" +}, { + NAME : "Vetra, Gundars", + ACTIVE : "1992 - 1992", + FROM : "College - No College", + TEAM_LOGO : "./images/nba_heats.jpg" +}, { + NAME : "Vianna, Joao", + ACTIVE : "1991 - 1991", + FROM : "College - Travajara (Brazil)", + TEAM_LOGO : "./images/nba_bulls.jpg" +}, { + NAME : "Villanueva, Charlie", + ACTIVE : "ACTIVE", + FROM : "College - Connecticut", + TEAM_LOGO : "./images/nba_pistons.jpg" +}, { + NAME : "Vincent, Jay", + ACTIVE : "1981 - 1989", + FROM : "College - Michigan State", + TEAM_LOGO : "./images/nba_kings.jpg" +}, { + NAME : "Vincent, Sam", + ACTIVE : "1985 - 1991", + FROM : "College - Michigan State", + TEAM_LOGO : "./images/nba_hawks.jpg" +}, { + NAME : "Vinicius, Marcus", + ACTIVE : "2007 - 2007", + FROM : "From - Brazil", + TEAM_LOGO : "./images/nba_knics.jpg" +}, { + NAME : "Vinson, Fred", + ACTIVE : "1994 - 1999", + FROM : "College - Georgia Tech", + TEAM_LOGO : "./images/nba_pistons.jpg" +}, { + NAME : "Voce, Gary", + ACTIVE : "1989 - 1989", + FROM : "College - Notre Dame", + TEAM_LOGO : "./images/nba_warriors.jpg" +}, { + NAME : "Volker, Floyd W.", + ACTIVE : "1949 - 1949", + FROM : "College - Wyoming", + TEAM_LOGO : "./images/nba_sonics.jpg" +}, { + NAME : "Volkov, Alexander", + ACTIVE : "1989 - 1991", + FROM : "College - Kiev Institute (Ukraine)", + TEAM_LOGO : "./images/nba_sonics.jpg" +}, { + NAME : "Von Nieda, Stanley L. Jr. (Whitey)", + ACTIVE : "1949 - 1949", + FROM : "College - Penn State", + TEAM_LOGO : "./images/nba_bulls.jpg" +}, { + NAME : "Voskuhl, Jake", + ACTIVE : "2007 - 2008", + FROM : "College - Connecticut", + TEAM_LOGO : "./images/nba_nets.jpg" +}, { + NAME : "Vranes, Danny", + ACTIVE : "1981 - 1987", + FROM : "College - Utah", + TEAM_LOGO : "./images/nba_sonics.jpg" +}, { + NAME : "Vranes, Slavko", + ACTIVE : "2003 - 2003", + FROM : "From - Serbia & Montenegro", + TEAM_LOGO : "./images/nba_knics.jpg" +}, { + NAME : "Vrankovic, Stojko", + ACTIVE : "1990 - 1998", + FROM : "College - Croatia", + TEAM_LOGO : "./images/nba_celtics.jpg" +}, { + NAME : "Vroman, Brett Grant", + ACTIVE : "1980 - 1980", + FROM : "College - UCLA; Nevada-Las Vegas", + TEAM_LOGO : "./images/nba_cavaliers.jpg" +}, { + NAME : "Vroman, Jackson", + ACTIVE : "2004 - 2005", + FROM : "College - Iowa State", + TEAM_LOGO : "./images/nba_honets.jpg" +}, { + NAME : "Vujacic, Sasha", + ACTIVE : "ACTIVE", + FROM : "From - Maribor, Slovenia", + TEAM_LOGO : "./images/nba_griz.jpg" +}, { + NAME : "Wade, Dwyane", + ACTIVE : "ACTIVE", + FROM : "College - Marquette", + TEAM_LOGO : "./images/nba_knics.jpg" +}, { + NAME : "Wade, Mark", + ACTIVE : "1987 - 1989", + FROM : "College - El Camino Coll. CA (J.C.); Oklahoma; Nevada-Las Vegas", + TEAM_LOGO : "./images/nba_raptors.jpg" +}, { + NAME : "Wafer, Von", + ACTIVE : "ACTIVE", + FROM : "College - Florida State", + TEAM_LOGO : "./images/nba_honets.jpg" +}, { + NAME : "Wager, Clinton B. (Clint)", + ACTIVE : "1949 - 1949", + FROM : "College - St. Mary's (Minn.)", + TEAM_LOGO : "./images/nba_rockets.jpg" +}, { + NAME : "Wagner, Dajuan", + ACTIVE : "2002 - 2006", + FROM : "College - Memphis", + TEAM_LOGO : "./images/nba_wizards.jpg" +}, { + NAME : "Wagner, Daniel Earnest (Danny)", + ACTIVE : "1949 - 1949", + FROM : "College - Schreiner Coll.; Texas", + TEAM_LOGO : "./images/nba_bulls.jpg" +}, { + NAME : "Wagner, Milt", + ACTIVE : "1987 - 1990", + FROM : "College - Louisville", + TEAM_LOGO : "./images/nba_griz.jpg" +}, { + NAME : "Waiters, Granville", + ACTIVE : "1983 - 1987", + FROM : "College - Ohio State", + TEAM_LOGO : "./images/nba_76ers.jpg" +}, { + NAME : "Wakefield, Andre", + ACTIVE : "1978 - 1979", + FROM : "College - Coll. of Southern Idaho (J.C.); Loyola (Chicago)", + TEAM_LOGO : "./images/nba_clippers.jpg" +}, { + NAME : "Walk, Neal", + ACTIVE : "1969 - 1976", + FROM : "College - Florida", + TEAM_LOGO : "./images/nba_mavericks.jpg" +}, { + NAME : "Walker, Andrew Martin (Andy)", + ACTIVE : "1976 - 1976", + FROM : "College - Niagara", + TEAM_LOGO : "./images/nba_cavaliers.jpg" +}, { + NAME : "Walker, Antoine", + ACTIVE : "2007 - 2007", + FROM : "College - Kentucky", + TEAM_LOGO : "./images/nba_magics.jpg" +}, { + NAME : "Walker, Bill", + ACTIVE : "ACTIVE", + FROM : "College - Kansas State", + TEAM_LOGO : "./images/nba_nuggets.jpg" +}, { + NAME : "Walker, Brady W.", + ACTIVE : "1948 - 1951", + FROM : "College - Brigham Young", + TEAM_LOGO : "./images/nba_pistons.jpg" +}, { + NAME : "Walker, Chet", + ACTIVE : "1962 - 1974", + FROM : "College - Bradley", + TEAM_LOGO : "./images/nba_mavericks.jpg" +}, { + NAME : "Walker, Darrell", + ACTIVE : "1983 - 1992", + FROM : "College - Westark CC; Arkansas", + TEAM_LOGO : "./images/nba_celtics.jpg" +}, { + NAME : "Walker, Foots", + ACTIVE : "1974 - 1983", + FROM : "College - Vincennes IN (J.C.); West Georgia", + TEAM_LOGO : "./images/nba_cavaliers.jpg" +}, { + NAME : "Walker, Horace", + ACTIVE : "1961 - 1961", + FROM : "College - Michigan State", + TEAM_LOGO : "./images/nba_warriors.jpg" +}, { + NAME : "Walker, James (Jimmy)", + ACTIVE : "1967 - 1975", + FROM : "College - Providence", + TEAM_LOGO : "./images/nba_mavericks.jpg" +}, { + NAME : "Walker, Kenny", + ACTIVE : "1986 - 1994", + FROM : "College - Kentucky", + TEAM_LOGO : "./images/nba_76ers.jpg" +}, { + NAME : "Walker, Phillip B. (Phil)", + ACTIVE : "1977 - 1977", + FROM : "College - Millersville", + TEAM_LOGO : "./images/nba_nuggets.jpg" +}, { + NAME : "Walker, Samaki", + ACTIVE : "1996 - 2005", + FROM : "College - Louisville", + TEAM_LOGO : "./images/nba_pistons.jpg" +}, { + NAME : "Walker, Wally", + ACTIVE : "1976 - 1983", + FROM : "College - Virginia", + TEAM_LOGO : "./images/nba_warriors.jpg" +}, { + NAME : "Wall, John", + ACTIVE : "ACTIVE", + FROM : "College - Kentucky", + TEAM_LOGO : "./images/nba_timberwolves.jpg" +}, { + NAME : "Wallace, Ben", + ACTIVE : "ACTIVE", + FROM : "College - Virginia Union", + TEAM_LOGO : "./images/nba_mavericks.jpg" +}, { + NAME : "Wallace, Gerald", + ACTIVE : "ACTIVE", + FROM : "College - Alabama", + TEAM_LOGO : "./images/nba_cavaliers.jpg" +}, { + NAME : "Wallace, John", + ACTIVE : "1996 - 2003", + FROM : "College - Syracuse ''96", + TEAM_LOGO : "./images/nba_spurs.jpg" +}, { + NAME : "Wallace, Michael John (Red)", + ACTIVE : "1946 - 1946", + FROM : "College - Scranton", + TEAM_LOGO : "./images/nba_honets.jpg" +}, { + NAME : "Wallace, Rasheed", + ACTIVE : "2007 - 2009", + FROM : "College - North Carolina", + TEAM_LOGO : "./images/nba_cavaliers.jpg" +}, { + NAME : "Waller, Dwight", + ACTIVE : "1968 - 1968", + FROM : "College - Tennessee State", + TEAM_LOGO : "./images/nba_pistons.jpg" +}, { + NAME : "Waller, Jamie", + ACTIVE : "1987 - 1987", + FROM : "College - Virginia Union", + TEAM_LOGO : "./images/nba_rockets.jpg" +}, { + NAME : "Walsh, James Patrick (Jim)", + ACTIVE : "1957 - 1957", + FROM : "College - Stanford", + TEAM_LOGO : "./images/nba_mavericks.jpg" +}, { + NAME : "Walsh, Matt", + ACTIVE : "2005 - 2005", + FROM : "College - Florida", + TEAM_LOGO : "./images/nba_honets.jpg" +}, { + NAME : "Walters, Rex", + ACTIVE : "1993 - 1999", + FROM : "College - De Anza Coll. CA (J.C.); Northwestern; Kansas", + TEAM_LOGO : "./images/nba_bobcats.jpg" +}, { + NAME : "Walther, Paul P. (Lefty)", + ACTIVE : "1949 - 1954", + FROM : "College - Tennessee", + TEAM_LOGO : "./images/nba_bobcats.jpg" +}, { + NAME : "Walthour, Isaac (Rabbit)", + ACTIVE : "1953 - 1953", + FROM : "College - No College", + TEAM_LOGO : "./images/nba_bucks.jpg" +}, { + NAME : "Walton, Bill", + ACTIVE : "1974 - 1986", + FROM : "College - UCLA", + TEAM_LOGO : "./images/nba_heats.jpg" +}, { + NAME : "Walton, Lloyd", + ACTIVE : "1976 - 1980", + FROM : "College - Moberly Area CC; Marquette", + TEAM_LOGO : "./images/nba_celtics.jpg" +}, { + NAME : "Walton, Luke", + ACTIVE : "ACTIVE", + FROM : "College - Arizona", + TEAM_LOGO : "./images/nba_timberwolves.jpg" +}, { + NAME : "Wang Zhizhi", + ACTIVE : "2000 - 2004", + FROM : "From - China", + TEAM_LOGO : "./images/nba_warriors.jpg" +}, { + NAME : "Wanzer, Robert Francis (Bobby)", + ACTIVE : "1948 - 1956", + FROM : "College - Colgate; Seton Hall", + TEAM_LOGO : "./images/nba_magics.jpg" +}, { + NAME : "Warbington, Perry", + ACTIVE : "1974 - 1974", + FROM : "College - Lake City CC FL; Georgia Southern", + TEAM_LOGO : "./images/nba_cavaliers.jpg" +}, { + NAME : "Ward, Charlie", + ACTIVE : "1994 - 2004", + FROM : "College - Florida State", + TEAM_LOGO : "./images/nba_sonics.jpg" +}, { + NAME : "Ward, Gerald W. (Gerry)", + ACTIVE : "1963 - 1966", + FROM : "College - Boston College", + TEAM_LOGO : "./images/nba_hawks.jpg" +}, { + NAME : "Ward, Henry Lorette", + ACTIVE : "1976 - 1976", + FROM : "College - Jackson State", + TEAM_LOGO : "./images/nba_cavaliers.jpg" +}, { + NAME : "Ware, James Edward (Jim)", + ACTIVE : "1966 - 1967", + FROM : "College - Oklahoma City", + TEAM_LOGO : "./images/nba_magics.jpg" +}, { + NAME : "Warley, Benjamin Vallintina (Ben)", + ACTIVE : "1962 - 1966", + FROM : "College - Tennessee State", + TEAM_LOGO : "./images/nba_rockets.jpg" +}, { + NAME : "Warlick, Robert Lee (Bob)", + ACTIVE : "1965 - 1968", + FROM : "College - Pueblo CC CO; Pepperdine; Denver", + TEAM_LOGO : "./images/nba_nets.jpg" +}, { + NAME : "Warner, Cornell", + ACTIVE : "1970 - 1976", + FROM : "College - Jackson State", + TEAM_LOGO : "./images/nba_trail.jpg" +}, { + NAME : "Warren, John II (Johnny)", + ACTIVE : "1969 - 1973", + FROM : "College - St. John's (N.Y.)", + TEAM_LOGO : "./images/nba_hawks.jpg" +}, { + NAME : "Yarbrough, Vincent", + ACTIVE : "2002 - 2002", + FROM : "College - Tennessee ''02", + TEAM_LOGO : "./images/nba_lakers.jpg" +}, { + NAME : "Yardley, George", + ACTIVE : "1953 - 1959", + FROM : "College - Stanford", + TEAM_LOGO : "./images/nba_76ers.jpg" +}, { + NAME : "Yates, Barry", + ACTIVE : "1971 - 1971", + FROM : "College - Nebraska; Maryland", + TEAM_LOGO : "./images/nba_pistons.jpg" +}, { + NAME : "Yates, Wayne E.", + ACTIVE : "1961 - 1961", + FROM : "College - Memphis", + TEAM_LOGO : "./images/nba_76ers.jpg" +}, { + NAME : "Yelverton, Charles W. (Charlie)", + ACTIVE : "1971 - 1971", + FROM : "College - Fordham", + TEAM_LOGO : "./images/nba_nuggets.jpg" +}, { + NAME : "Yonakor, Richard Robert (Rich)", + ACTIVE : "1981 - 1981", + FROM : "College - North Carolina", + TEAM_LOGO : "./images/nba_timberwolves.jpg" +}, { + NAME : "Young, Danny", + ACTIVE : "1984 - 1994", + FROM : "College - Wake Forest", + TEAM_LOGO : "./images/nba_warriors.jpg" +}, { + NAME : "Young, Korleone", + ACTIVE : "1998 - 1998", + FROM : "College - No College", + TEAM_LOGO : "./images/nba_griz.jpg" +}, { + NAME : "Young, Michael", + ACTIVE : "1984 - 1989", + FROM : "College - Houston", + TEAM_LOGO : "./images/nba_bucks.jpg" +}, { + NAME : "Young, Nick", + ACTIVE : "ACTIVE", + FROM : "College - USC", + TEAM_LOGO : "./images/nba_bobcats.jpg" +}, { + NAME : "Young, Perry", + ACTIVE : "1986 - 1986", + FROM : "College - Virginia Tech", + TEAM_LOGO : "./images/nba_sonics.jpg" +}, { + NAME : "Young, Sam", + ACTIVE : "ACTIVE", + FROM : "College - Pittsburgh", + TEAM_LOGO : "./images/nba_lakers.jpg" +}, { + NAME : "Young, Thaddeus", + ACTIVE : "ACTIVE", + FROM : "College - Georgia Tech", + TEAM_LOGO : "./images/nba_lakers.jpg" +}, { + NAME : "Young, Tim", + ACTIVE : "1999 - 1999", + FROM : "College - Stanford", + TEAM_LOGO : "./images/nba_lakers.jpg" +}, { + NAME : "Yue, Sun", + ACTIVE : "2008 - 2008", + FROM : "From - China", + TEAM_LOGO : "./images/nba_wizards.jpg" +}, { + NAME : "Zaslofsky, Max (Slats)", + ACTIVE : "1946 - 1955", + FROM : "College - Chicago; St. John's (N.Y.)", + TEAM_LOGO : "./images/nba_mavericks.jpg" +}, { + NAME : "Zawoluk, Robert Michael (Zeke)", + ACTIVE : "1952 - 1954", + FROM : "College - St. John's (N.Y.)", + TEAM_LOGO : "./images/nba_bucks.jpg" +}, { + NAME : "Zeller, David A. (Dave)", + ACTIVE : "1961 - 1961", + FROM : "College - Miami (Ohio)", + TEAM_LOGO : "./images/nba_trail.jpg" +}, { + NAME : "Zeller, Gary Lynn", + ACTIVE : "1970 - 1971", + FROM : "College - Drake", + TEAM_LOGO : "./images/nba_raptors.jpg" +}, { + NAME : "Zeller, Harry Raymond (Hank)", + ACTIVE : "1946 - 1946", + FROM : "College - Pittsburgh; Washington & Jefferson", + TEAM_LOGO : "./images/nba_warriors.jpg" +}, { + NAME : "Zeno, Anthony Michael (Tony)", + ACTIVE : "1979 - 1979", + FROM : "College - Arizona State", + TEAM_LOGO : "./images/nba_pacers.jpg" +}, { + NAME : "Zevenbergen, Phil", + ACTIVE : "1987 - 1987", + FROM : "College - Seattle Pacific; Edmonds CC WA; Washington", + TEAM_LOGO : "./images/nba_honets.jpg" +}, { + NAME : "Zidek, George", + ACTIVE : "1995 - 1997", + FROM : "College - UCLA", + TEAM_LOGO : "./images/nba_sonics.jpg" +}, { + NAME : "Zimmerman, Derrick", + ACTIVE : "2005 - 2005", + FROM : "College - Mississippi State", + TEAM_LOGO : "./images/nba_nuggets.jpg" +}, { + NAME : "Zoet, Jim", + ACTIVE : "1982 - 1982", + FROM : "College - Kent State", + TEAM_LOGO : "./images/nba_suns.jpg" +}, { + NAME : "Zopf, William Charles Jr. (Bill, Zip)", + ACTIVE : "1970 - 1970", + FROM : "College - Duquesne", + TEAM_LOGO : "./images/nba_hawks.jpg" +}, { + NAME : "Zunic, Matthew (Matt, Mad Matt)", + ACTIVE : "1948 - 1948", + FROM : "College - George Washington", + TEAM_LOGO : "./images/nba_clippers.jpg" +}]; diff --git a/demos/tizen-winsets/widgets/grid/virtualgrid-auto.html b/demos/tizen-winsets/widgets/grid/virtualgrid-auto.html new file mode 100755 index 0000000..ae2b470 --- /dev/null +++ b/demos/tizen-winsets/widgets/grid/virtualgrid-auto.html @@ -0,0 +1,33 @@ +
    +
    +

    Virtual Grid - Auto

    +
    +
    + +
    +
    +
    + +
    diff --git a/demos/tizen-winsets/widgets/grid/virtualgrid-list.html b/demos/tizen-winsets/widgets/grid/virtualgrid-list.html new file mode 100755 index 0000000..ae6b7c7 --- /dev/null +++ b/demos/tizen-winsets/widgets/grid/virtualgrid-list.html @@ -0,0 +1,36 @@ +
    +
    +

    Virtual Grid - List

    +
    +
    + +
    +
    + +
    diff --git a/demos/tizen-winsets/widgets/grid/virtualgrid-rotation.html b/demos/tizen-winsets/widgets/grid/virtualgrid-rotation.html new file mode 100755 index 0000000..8029e10 --- /dev/null +++ b/demos/tizen-winsets/widgets/grid/virtualgrid-rotation.html @@ -0,0 +1,35 @@ +
    +
    +

    Virtual Grid - Rotation

    +
    +
    + +
    +
    +
    + +
    diff --git a/demos/tizen-winsets/widgets/grid/virtualgrid-x.html b/demos/tizen-winsets/widgets/grid/virtualgrid-x.html new file mode 100755 index 0000000..8e769a6 --- /dev/null +++ b/demos/tizen-winsets/widgets/grid/virtualgrid-x.html @@ -0,0 +1,40 @@ +
    +
    +

    Virtual Grid - X

    +
    +
    + +
    +
    +
    + + +
    diff --git a/demos/tizen-winsets/widgets/grid/virtualgrid.html b/demos/tizen-winsets/widgets/grid/virtualgrid.html new file mode 100755 index 0000000..f3db2dc --- /dev/null +++ b/demos/tizen-winsets/widgets/grid/virtualgrid.html @@ -0,0 +1,36 @@ +
    +
    +

    Virtual Grid

    +
    +
    + +
    +
    +
    + +
    diff --git a/demos/tizen-winsets/widgets/handler.html b/demos/tizen-winsets/widgets/handler.html new file mode 100755 index 0000000..ac74293 --- /dev/null +++ b/demos/tizen-winsets/widgets/handler.html @@ -0,0 +1,118 @@ + +
    +
    +

    Handler Test

    +
    +
    + +
    +
    \ No newline at end of file diff --git a/demos/tizen-winsets/widgets/imageslider.html b/demos/tizen-winsets/widgets/imageslider.html new file mode 100644 index 0000000..5ac9181 --- /dev/null +++ b/demos/tizen-winsets/widgets/imageslider.html @@ -0,0 +1,27 @@ + +
    +
    +

    Image Slider

    +
    +
    +
    + + + + + + + + + +
    +
    +
    +
    + +
    +
    +
    diff --git a/demos/tizen-winsets/widgets/list/00_winset_icon_favorite_on.png b/demos/tizen-winsets/widgets/list/00_winset_icon_favorite_on.png new file mode 100644 index 0000000..1c024a5 Binary files /dev/null and b/demos/tizen-winsets/widgets/list/00_winset_icon_favorite_on.png differ diff --git a/demos/tizen-winsets/widgets/list/images/nba_76ers.jpg b/demos/tizen-winsets/widgets/list/images/nba_76ers.jpg new file mode 100755 index 0000000..35db118 Binary files /dev/null and b/demos/tizen-winsets/widgets/list/images/nba_76ers.jpg differ diff --git a/demos/tizen-winsets/widgets/list/images/nba_bobcats.jpg b/demos/tizen-winsets/widgets/list/images/nba_bobcats.jpg new file mode 100755 index 0000000..6572396 Binary files /dev/null and b/demos/tizen-winsets/widgets/list/images/nba_bobcats.jpg differ diff --git a/demos/tizen-winsets/widgets/list/images/nba_bucks.jpg b/demos/tizen-winsets/widgets/list/images/nba_bucks.jpg new file mode 100755 index 0000000..8b420ae Binary files /dev/null and b/demos/tizen-winsets/widgets/list/images/nba_bucks.jpg differ diff --git a/demos/tizen-winsets/widgets/list/images/nba_bulls.jpg b/demos/tizen-winsets/widgets/list/images/nba_bulls.jpg new file mode 100755 index 0000000..8c131e1 Binary files /dev/null and b/demos/tizen-winsets/widgets/list/images/nba_bulls.jpg differ diff --git a/demos/tizen-winsets/widgets/list/images/nba_cavaliers.jpg b/demos/tizen-winsets/widgets/list/images/nba_cavaliers.jpg new file mode 100755 index 0000000..2a66daa Binary files /dev/null and b/demos/tizen-winsets/widgets/list/images/nba_cavaliers.jpg differ diff --git a/demos/tizen-winsets/widgets/list/images/nba_celtics.jpg b/demos/tizen-winsets/widgets/list/images/nba_celtics.jpg new file mode 100755 index 0000000..363f65b Binary files /dev/null and b/demos/tizen-winsets/widgets/list/images/nba_celtics.jpg differ diff --git a/demos/tizen-winsets/widgets/list/images/nba_clippers.jpg b/demos/tizen-winsets/widgets/list/images/nba_clippers.jpg new file mode 100755 index 0000000..9b042b9 Binary files /dev/null and b/demos/tizen-winsets/widgets/list/images/nba_clippers.jpg differ diff --git a/demos/tizen-winsets/widgets/list/images/nba_griz.jpg b/demos/tizen-winsets/widgets/list/images/nba_griz.jpg new file mode 100755 index 0000000..c521cc9 Binary files /dev/null and b/demos/tizen-winsets/widgets/list/images/nba_griz.jpg differ diff --git a/demos/tizen-winsets/widgets/list/images/nba_hawks.jpg b/demos/tizen-winsets/widgets/list/images/nba_hawks.jpg new file mode 100755 index 0000000..208be2d Binary files /dev/null and b/demos/tizen-winsets/widgets/list/images/nba_hawks.jpg differ diff --git a/demos/tizen-winsets/widgets/list/images/nba_heats.jpg b/demos/tizen-winsets/widgets/list/images/nba_heats.jpg new file mode 100755 index 0000000..1c009d2 Binary files /dev/null and b/demos/tizen-winsets/widgets/list/images/nba_heats.jpg differ diff --git a/demos/tizen-winsets/widgets/list/images/nba_honets.jpg b/demos/tizen-winsets/widgets/list/images/nba_honets.jpg new file mode 100755 index 0000000..b2aa7ee Binary files /dev/null and b/demos/tizen-winsets/widgets/list/images/nba_honets.jpg differ diff --git a/demos/tizen-winsets/widgets/list/images/nba_jazz.jpg b/demos/tizen-winsets/widgets/list/images/nba_jazz.jpg new file mode 100755 index 0000000..1f1d221 Binary files /dev/null and b/demos/tizen-winsets/widgets/list/images/nba_jazz.jpg differ diff --git a/demos/tizen-winsets/widgets/list/images/nba_kings.jpg b/demos/tizen-winsets/widgets/list/images/nba_kings.jpg new file mode 100755 index 0000000..fc0e9f9 Binary files /dev/null and b/demos/tizen-winsets/widgets/list/images/nba_kings.jpg differ diff --git a/demos/tizen-winsets/widgets/list/images/nba_knics.jpg b/demos/tizen-winsets/widgets/list/images/nba_knics.jpg new file mode 100755 index 0000000..70c8796 Binary files /dev/null and b/demos/tizen-winsets/widgets/list/images/nba_knics.jpg differ diff --git a/demos/tizen-winsets/widgets/list/images/nba_lakers.jpg b/demos/tizen-winsets/widgets/list/images/nba_lakers.jpg new file mode 100755 index 0000000..cb291b1 Binary files /dev/null and b/demos/tizen-winsets/widgets/list/images/nba_lakers.jpg differ diff --git a/demos/tizen-winsets/widgets/list/images/nba_magics.jpg b/demos/tizen-winsets/widgets/list/images/nba_magics.jpg new file mode 100755 index 0000000..290b930 Binary files /dev/null and b/demos/tizen-winsets/widgets/list/images/nba_magics.jpg differ diff --git a/demos/tizen-winsets/widgets/list/images/nba_mavericks.jpg b/demos/tizen-winsets/widgets/list/images/nba_mavericks.jpg new file mode 100755 index 0000000..f8816a8 Binary files /dev/null and b/demos/tizen-winsets/widgets/list/images/nba_mavericks.jpg differ diff --git a/demos/tizen-winsets/widgets/list/images/nba_nets.jpg b/demos/tizen-winsets/widgets/list/images/nba_nets.jpg new file mode 100755 index 0000000..3d2600c Binary files /dev/null and b/demos/tizen-winsets/widgets/list/images/nba_nets.jpg differ diff --git a/demos/tizen-winsets/widgets/list/images/nba_nuggets.jpg b/demos/tizen-winsets/widgets/list/images/nba_nuggets.jpg new file mode 100755 index 0000000..a01e78e Binary files /dev/null and b/demos/tizen-winsets/widgets/list/images/nba_nuggets.jpg differ diff --git a/demos/tizen-winsets/widgets/list/images/nba_pacers.jpg b/demos/tizen-winsets/widgets/list/images/nba_pacers.jpg new file mode 100755 index 0000000..be98506 Binary files /dev/null and b/demos/tizen-winsets/widgets/list/images/nba_pacers.jpg differ diff --git a/demos/tizen-winsets/widgets/list/images/nba_pistons.jpg b/demos/tizen-winsets/widgets/list/images/nba_pistons.jpg new file mode 100755 index 0000000..f13c851 Binary files /dev/null and b/demos/tizen-winsets/widgets/list/images/nba_pistons.jpg differ diff --git a/demos/tizen-winsets/widgets/list/images/nba_raptors.jpg b/demos/tizen-winsets/widgets/list/images/nba_raptors.jpg new file mode 100755 index 0000000..eb8d431 Binary files /dev/null and b/demos/tizen-winsets/widgets/list/images/nba_raptors.jpg differ diff --git a/demos/tizen-winsets/widgets/list/images/nba_rockets.jpg b/demos/tizen-winsets/widgets/list/images/nba_rockets.jpg new file mode 100755 index 0000000..8cf2f17 Binary files /dev/null and b/demos/tizen-winsets/widgets/list/images/nba_rockets.jpg differ diff --git a/demos/tizen-winsets/widgets/list/images/nba_sonics.jpg b/demos/tizen-winsets/widgets/list/images/nba_sonics.jpg new file mode 100755 index 0000000..2104e42 Binary files /dev/null and b/demos/tizen-winsets/widgets/list/images/nba_sonics.jpg differ diff --git a/demos/tizen-winsets/widgets/list/images/nba_spurs.jpg b/demos/tizen-winsets/widgets/list/images/nba_spurs.jpg new file mode 100755 index 0000000..060002d Binary files /dev/null and b/demos/tizen-winsets/widgets/list/images/nba_spurs.jpg differ diff --git a/demos/tizen-winsets/widgets/list/images/nba_suns.jpg b/demos/tizen-winsets/widgets/list/images/nba_suns.jpg new file mode 100755 index 0000000..754769c Binary files /dev/null and b/demos/tizen-winsets/widgets/list/images/nba_suns.jpg differ diff --git a/demos/tizen-winsets/widgets/list/images/nba_timberwolves.jpg b/demos/tizen-winsets/widgets/list/images/nba_timberwolves.jpg new file mode 100755 index 0000000..79476a8 Binary files /dev/null and b/demos/tizen-winsets/widgets/list/images/nba_timberwolves.jpg differ diff --git a/demos/tizen-winsets/widgets/list/images/nba_trail.jpg b/demos/tizen-winsets/widgets/list/images/nba_trail.jpg new file mode 100755 index 0000000..57168c9 Binary files /dev/null and b/demos/tizen-winsets/widgets/list/images/nba_trail.jpg differ diff --git a/demos/tizen-winsets/widgets/list/images/nba_warriors.jpg b/demos/tizen-winsets/widgets/list/images/nba_warriors.jpg new file mode 100755 index 0000000..45440c4 Binary files /dev/null and b/demos/tizen-winsets/widgets/list/images/nba_warriors.jpg differ diff --git a/demos/tizen-winsets/widgets/list/images/nba_wizards.jpg b/demos/tizen-winsets/widgets/list/images/nba_wizards.jpg new file mode 100755 index 0000000..e98a491 Binary files /dev/null and b/demos/tizen-winsets/widgets/list/images/nba_wizards.jpg differ diff --git a/demos/tizen-winsets/widgets/list/list-bubble-sample1.png b/demos/tizen-winsets/widgets/list/list-bubble-sample1.png new file mode 100644 index 0000000..3c1d65e Binary files /dev/null and b/demos/tizen-winsets/widgets/list/list-bubble-sample1.png differ diff --git a/demos/tizen-winsets/widgets/list/list-bubble.html b/demos/tizen-winsets/widgets/list/list-bubble.html new file mode 100644 index 0000000..9fe3725 --- /dev/null +++ b/demos/tizen-winsets/widgets/list/list-bubble.html @@ -0,0 +1,18 @@ +
    +
    +

    bubble list (message bubble)

    +
    +
    +
      +
    • short left9:20 PM
    • +
    • But I have no choice. I have a big exam tomorrow. (bubble right)9:26 PM
    • + +
    • Don't worry... I'm free. You're gonna get sick. (bubble left)9:30 PM
    • +
    • 2010. 05. 20 (bubble date)
    • +
    • Sorry I'm late. (bubble right)9:26 PM
    • +
    • Don't worry... I'm free. You're gonna get sick. (bubble sos)9:30 PM
    • +
    • Picture test

      9:40 PM
    • +
    +
    +
    + diff --git a/demos/tizen-winsets/widgets/list/list-dialogue.html b/demos/tizen-winsets/widgets/list/list-dialogue.html new file mode 100755 index 0000000..2f9061a --- /dev/null +++ b/demos/tizen-winsets/widgets/list/list-dialogue.html @@ -0,0 +1,344 @@ +
    +
    +

    Dialog lists

    +
    +
    +
      + +
    • + 1line +
    • +
    • + 1line (with link) +
    • +
    • + 1line-sub + subtext +
    • +
    • + + 1line-sub (with link) + subtext + +
    • +
    • + 1line-setting + Sub text +
    • +
    • + 1line-btn1 +
      Text Button
      +
    • +
    • + 1line-btn2 +
      +
    • +
    • + 1line-toggle +
      +
    • +
    • + 1line-bigicon1 + +
    • +
    • + 1line-bigicon2 + + Sub text +
    • +
    • + 1line-bigicon4 + +
      Text Button
      +
    • +
    • + 1line-bigicon5 + +
      +
    • +
    • + 1line-bigicon6 + +
      +
    • +
    • +
      + 1line-check1 +
    • +
    • +
      + 1line-check2 +
      +
    • +
    • +
      + 1line-check3 + +
    • +
    • +
      + 1line-check4 + +
      +
    • +
    • +
      + 1line-radio1 +
    • +
    • +
      + 1line-radio3 +
      +
    • +
    • +
      + + 1line-radio4 +
    • +
    • +
      + + 1line-radio5 +
      +
    • + +
    • + 2line + Subtext +
    • + +
    • + 2line-sub-main + Subtext +
    • + +
    • + 2line-2sub + Subtext + Subtext2 +
    • + +
    • + 2line-btn1 + Subtext +
      button
      +
    • + +
    • + 2line-btn1 + Subtext +
      +
    • + +
    • + 2line-btn2 + Subtext +
      +
    • + +
    • + 2line-star1 + + Subtext + Subtext2 +
    • + +
    • + 2line-star2 + + Subtext + +
    • + +
    • + 2line-setting + Subtext +
    • + +
    • + 2line-toggle-setting + Subtext +
      +
    • + +
    • + 2line-btn-setting + Subtext +
      +
    • + +
    • + 2line-bigicon0 + Subtext +
      +
    • + +
    • + 2line-bigicon1 + Subtext + +
    • + +
    • + 2line-bigicon2 + Subtext + + Subtext2 +
    • + +
    • + 2line-bigicon3 + Subtext + +
    • + +
    • + 2line-bigicon4 + Subtext +
      + +
    • + +
    • + 2line-check1 + Subtext +
      +
    • + +
    • + 2line-check2 + Subtext +
      +
      +
    • + +
    • + 2line-check3 + Subtext +
      + +
    • + + +
    • + 2line-radio1 + Subtext +
      +
    • + +
    • + 2line-radio2 + Subtext +
      + +
    • + + +
    • + + 2line-colorbar1 + Subtext + + + + + Subtext2 +
      button
      +
    • + +
    • + + 2line-colorbar3 + Subtext +
      button
      +
    • + +
    • + + 2line-colorbar3 + Subtext +
      +
    • + +
    • + + 2line-colorbar3 + Subtext +
      + +
    • + +
    • + + 2line-bigicon8 + Subtext + +
    • + +
    • + 2line-thumb1 + Subtext + +
    • + +
    • + 2line-thumb2 + Subtext + +
    • + +
    • + Subtext + 2line-sub-main-bigicon1 + +
    • + +
    • + + 2line-bigicon-pgbar1 + Subtext + Subtext2 +
      Cancel
      +
      +
    • + +
    • + + 2line-bigicon-pgbar2 + Subtext +
      button
      +
    • + +
    • + + 2line-bigicon-pgbar2 + Subtext +
      +
    • + +
    • + + 2line-bigicon-pgbar3 + Subtext + Subtext2 +
      +
    • + +
    • +
      + + 2line-icon-bigicon-btn + Subtext +
      +
    • + +
    • + 2line-thumb3 + Subtext + +
    • + +
    +
    +
    + diff --git a/demos/tizen-winsets/widgets/list/list-divider_check.html b/demos/tizen-winsets/widgets/list/list-divider_check.html new file mode 100755 index 0000000..0210231 --- /dev/null +++ b/demos/tizen-winsets/widgets/list/list-divider_check.html @@ -0,0 +1,22 @@ +
    +
    +

    Normal Divider

    +
    +
    + +
    +
    + diff --git a/demos/tizen-winsets/widgets/list/list-divider_checkexpandable.html b/demos/tizen-winsets/widgets/list/list-divider_checkexpandable.html new file mode 100755 index 0000000..c624900 --- /dev/null +++ b/demos/tizen-winsets/widgets/list/list-divider_checkexpandable.html @@ -0,0 +1,22 @@ +
    +
    +

    Normal Divider

    +
    +
    + +
    +
    + diff --git a/demos/tizen-winsets/widgets/list/list-divider_expandable.html b/demos/tizen-winsets/widgets/list/list-divider_expandable.html new file mode 100755 index 0000000..debb032 --- /dev/null +++ b/demos/tizen-winsets/widgets/list/list-divider_expandable.html @@ -0,0 +1,22 @@ +
    +
    +

    Normal Divider

    +
    +
    + +
    +
    + diff --git a/demos/tizen-winsets/widgets/list/list-divider_groupped.html b/demos/tizen-winsets/widgets/list/list-divider_groupped.html new file mode 100755 index 0000000..65ed720 --- /dev/null +++ b/demos/tizen-winsets/widgets/list/list-divider_groupped.html @@ -0,0 +1,22 @@ +
    +
    +

    Normal Divider

    +
    +
    + +
    +
    + diff --git a/demos/tizen-winsets/widgets/list/list-divider_normal.html b/demos/tizen-winsets/widgets/list/list-divider_normal.html new file mode 100755 index 0000000..d13b96e --- /dev/null +++ b/demos/tizen-winsets/widgets/list/list-divider_normal.html @@ -0,0 +1,22 @@ +
    +
    +

    Normal Divider

    +
    +
    + +
    +
    + diff --git a/demos/tizen-winsets/widgets/list/list-email.html b/demos/tizen-winsets/widgets/list/list-email.html new file mode 100644 index 0000000..f7fbaef --- /dev/null +++ b/demos/tizen-winsets/widgets/list/list-email.html @@ -0,0 +1,179 @@ +
    +
    +

    Email lists

    +
    +
    +
      +
    • + +
      + email-name1-btn +
      3 >
      +
      + Subtext 01 + Subtext 02 + Subtext 03 +
    • +
    • + +
      + email-name2-btn +
      3 >
      +
      + Subtext 01 + Subtext 02 + Subtext 03 +
    • +
    • + +
      + email-name1 +
      + Subtext 01 + Subtext 02 + Subtext 03 +
    • +
    • + +
      + email-name2 +
      + Subtext 01 + Subtext 02 + Subtext 03 +
    • +
    • + +
      + email-name1-btn-warning +
      3 >
      + +
      + Subtext 01 + Subtext 02 + Subtext 03 +
    • +
    • + +
      + email-name2-btn-warning +
      3 >
      + +
      + Subtext 01 + Subtext 02 + Subtext 03 +
    • +
    • + +
      + email-name1-warning + +
      + Subtext 01 + Subtext 02 + Subtext 03 +
    • +
    • + +
      + email-name2-warning + +
      + Subtext 01 + Subtext 02 + Subtext 03 +
    • +
    • + +
      + email-name1-btn-attach +
      3 >
      + +
      + Subtext 01 + Subtext 02 + Subtext 03 +
    • +
    • + +
      + email-name2-btn-attach +
      3 >
      + +
      + Subtext 01 + Subtext 02 + Subtext 03 +
    • +
    • + +
      + email-name1-attach + +
      + Subtext 01 + Subtext 02 + Subtext 03 +
    • +
    • + +
      + email-name2-attach + +
      + Subtext 01 + Subtext 02 + Subtext 03 +
    • +
    • + +
      + email-name1-btn-warning-attach +
      3 >
      + + +
      + Subtext 01 + Subtext 02 + Subtext 03 +
    • +
    • + +
      + email-name2-btn-warning-attach +
      3 >
      + + +
      + Subtext 01 + Subtext 02 + Subtext 03 +
    • +
    • + +
      + email-name1-warning-attach + + +
      + Subtext 01 + Subtext 02 + Subtext 03 +
    • +
    • + +
      + email-name2-warning-attach + + +
      + Subtext 01 + Subtext 02 + Subtext 03 +
    • + +
    +
    +
    + diff --git a/demos/tizen-winsets/widgets/list/list-expandable.html b/demos/tizen-winsets/widgets/list/list-expandable.html new file mode 100755 index 0000000..2d4ef69 --- /dev/null +++ b/demos/tizen-winsets/widgets/list/list-expandable.html @@ -0,0 +1,43 @@ +
    +
    +

    expandable list

    +
    +
    +
      +
    • 1line
    • +
    • exp1-sub 1
    • +
    • exp1-sub 2
    • +
    • exp1-sub 3
    • +
    • exp1-sub 4
    • +
    • exp1-sub 5
    • +
    • exp1-sub 6
    • +
    • exp1-sub 7
    • +
    • exp1-sub 2 (exp2)
    • +
    • exp2-sub 1
    • +
    • exp2-sub 2
    • +
    • exp2-sub 3
    • +
    • + 2line + Subtext +
    • +
    • + 2line-sub-main + Subtext +
    • +
    • + 2line-radio1 + Subtext +
      +
    • +
    • + + 2line-colorbar3 + Subtext + + +
    • +
    +
    +
    +
    +
    diff --git a/demos/tizen-winsets/widgets/list/list-extendable.html b/demos/tizen-winsets/widgets/list/list-extendable.html new file mode 100755 index 0000000..6aa0e73 --- /dev/null +++ b/demos/tizen-winsets/widgets/list/list-extendable.html @@ -0,0 +1,20 @@ +
    + + + +
    +

    extendable list

    +
    +
    +
      +
    +
    +
    +
    +
    diff --git a/demos/tizen-winsets/widgets/list/list-multiline.html b/demos/tizen-winsets/widgets/list/list-multiline.html new file mode 100644 index 0000000..bbddd2b --- /dev/null +++ b/demos/tizen-winsets/widgets/list/list-multiline.html @@ -0,0 +1,20 @@ +
    + +
    +

    Multiline lists

    +
    + +
    +
      +
    • +

      3-4-1 Main item

      + Hundres of charities, hobby clubs and professional associations in the suburbs and thousands in the state could be forced to pay taxes for the first time next year. +
    • +
    • +

      3-4-5

      + Hundres of charities, hobby clubs and professional associations in the suburbs and thousands in the state could be forced to pay taxes for the first time next year. +
    • +
    +
    + +
    diff --git a/demos/tizen-winsets/widgets/list/list-normal.html b/demos/tizen-winsets/widgets/list/list-normal.html new file mode 100644 index 0000000..545bfdc --- /dev/null +++ b/demos/tizen-winsets/widgets/list/list-normal.html @@ -0,0 +1,341 @@ +
    +
    +

    Normal lists

    +
    +
    +
      + +
    • + 1line +
    • + +
    • + 1line-sub + subtext +
    • +
    • + 1line-setting + Sub text +
    • +
    • + 1line-btn1 +
      Text Button
      +
    • +
    • + 1line-btn2 +
      +
    • +
    • + 1line-toggle +
      +
    • + +
    • + 1line-bigicon1 + +
    • +
    • + 1line-bigicon2 + + Sub text +
    • +
    • + 1line-bigicon4 + +
      Text Button
      +
    • +
    • + 1line-bigicon5 + +
      +
    • +
    • + 1line-bigicon6 + +
      +
    • +
    • + 1line-check1 +
      +
    • +
    • + 1line-check2 +
      +
      +
    • +
    • + 1line-check3 +
      + +
    • +
    • + 1line-check4 +
      + +
      +
    • +
    • + 1line-radio1 +
      +
    • +
    • + 1line-radio3 +
      +
      +
    • +
    • + 1line-radio4 +
      + +
    • +
    • + 1line-radio5 +
      + +
      +
    • +
    • + 1line-radio6 + +
    • + +
    • + 2line + Subtext +
    • + +
    • + 2line-sub-main + Subtext +
    • + +
    • + 2line-2sub + Subtext + Subtext2 +
    • + +
    • + 2line-btn1 + Subtext +
      button
      +
    • + +
    • + 2line-btn1 + Subtext +
      +
    • + +
    • + 2line-btn2 + Subtext +
      +
    • + +
    • + 2line-star1 + + Subtext + Subtext2 +
    • + +
    • + 2line-star2 + + Subtext + +
    • + +
    • + 2line-setting + Subtext +
    • + +
    • + 2line-toggle-setting + Subtext +
      +
    • + +
    • + 2line-btn-setting + Subtext +
      +
    • + +
    • + 2line-bigicon0 + Subtext +
      +
    • + +
    • + 2line-bigicon1 + Subtext + +
    • + +
    • + 2line-bigicon2 + Subtext + + Subtext2 +
    • + +
    • + 2line-bigicon3 + Subtext + +
    • + +
    • + 2line-bigicon4 + Subtext +
      + +
    • + +
    • + 2line-check1 + Subtext +
      +
    • + +
    • + 2line-check2 + Subtext +
      +
      +
    • + +
    • + 2line-check3 + Subtext +
      + +
    • + + +
    • + 2line-radio1 + Subtext +
      +
    • + +
    • + 2line-radio2 + Subtext +
      + +
    • + + +
    • + + 2line-colorbar1 + Subtext + + + + + Subtext2 +
      button
      +
    • + +
    • + + 2line-colorbar2 + Subtext +
      button
      +
    • + +
    • + + 2line-colorbar2 + Subtext +
      +
    • + +
    • + + 2line-colorbar3 + Subtext +
      + +
    • + +
    • + + 2line-bigicon8 + Subtext + +
    • + +
    • + 2line-thumb1 + Subtext + +
    • + +
    • + 2line-thumb2 + Subtext + +
    • + +
    • + Subtext + 2line-sub-main-bigicon1 + +
    • + +
    • + + 2line-bigicon-pgbar1 + Subtext + Subtext2 +
      Cancel
      +
      +
    • + +
    • + + 2line-bigicon-pgbar2 + Subtext +
      button
      +
    • + +
    • + + 2line-bigicon-pgbar2 + Subtext +
      +
    • + +
    • + + 2line-bigicon-pgbar3 + Subtext + Subtext2 +
      +
    • + +
    • +
      + + 2line-icon-bigicon-btn + Subtext +
      +
    • + +
    • + 2line-thumb3 + Subtext + +
    • + +
    +
    +
    + diff --git a/demos/tizen-winsets/widgets/list/list-normal_anchor.html b/demos/tizen-winsets/widgets/list/list-normal_anchor.html new file mode 100755 index 0000000..0c98bdb --- /dev/null +++ b/demos/tizen-winsets/widgets/list/list-normal_anchor.html @@ -0,0 +1,459 @@ +
    +
    +

    Normal anchor lists

    +
    +
    + +
    +
    + diff --git a/demos/tizen-winsets/widgets/list/list-normal_anchor_h3.html b/demos/tizen-winsets/widgets/list/list-normal_anchor_h3.html new file mode 100755 index 0000000..8a94f64 --- /dev/null +++ b/demos/tizen-winsets/widgets/list/list-normal_anchor_h3.html @@ -0,0 +1,460 @@ +
    +
    +

    Normal anchor lists

    +
    +
    + +
    +
    + diff --git a/demos/tizen-winsets/widgets/list/list-normal_no_anchor.html b/demos/tizen-winsets/widgets/list/list-normal_no_anchor.html new file mode 100755 index 0000000..ca02d8c --- /dev/null +++ b/demos/tizen-winsets/widgets/list/list-normal_no_anchor.html @@ -0,0 +1,346 @@ +
    +
    +

    Normal lists

    +
    +
    +
      + +
    • + 1line +
    • + +
    • + 1line-sub + subtext +
    • + +
    • + 1line-btn1 +
      Text Button
      +
    • + +
    • + 1line-btn2 +
      +
    • + +
    • + 1line-toggle +
      +
    • + +
    • + + 1line-bigicon1 +
    • + +
    • + + 1line-bigicon2 + Sub text +
    • + +
    • + + 1line-bigicon4 +
      Text Button
      +
    • + +
    • + + 1line-bigicon5 +
      +
    • + +
    • + + 1line-bigicon6 +
      +
    • + +
    • + + 1line-check1 +
    • + +
    • +
      + 1line-check2 +
      +
    • + +
    • +
      + + 1line-check3 +
    • + +
    • +
      + + 1line-check4 +
      +
    • + +
    • +
      + 1line-radio1 +
    • + +
    • +
      + 1line-radio3 +
      +
    • + +
    • +
      + + 1line-radio4 +
    • + +
    • +
      + 1line-radio5 + +
      +
    • + +
    • +
      + 1line-radio + +
    • + +
    • + 2line + Subtext +
    • + +
    • + 2line-2sub + Subtext + Subtext2 +
    • + +
    • + 2line-btn1 + Subtext +
      button
      +
    • + +
    • + 2line-btn1 + Subtext +
      +
    • + +
    • + 2line-btn2 + Subtext +
      +
    • + +
    • + 2line-star1 + Subtext + + Subtext2 +
    • + +
    • + 2line-star2 + Subtext + +
    • + +
    • + 2line-setting + Subtext +
    • + +
    • + 2line-toggle-setting + Subtext +
      +
    • + +
    • + 2line-btn-setting + Subtext +
      +
    • + +
    • + 2line-bigicon0 + Subtext +
      +
    • + +
    • + + 2line-bigicon1 + Subtext +
    • + +
    • + + 2line-bigicon2 + Subtext + Subtext2 +
    • + +
    • + + 2line-bigicon3 + Subtext +
    • + +
    • + + 2line-bigicon4 + Subtext +
      +
    • + +
    • +
      + 2line-check + Subtext +
    • + +
    • +
      + 2line-check2 + Subtext +
      +
    • + +
    • +
      + + 2line-check3 + Subtext +
    • + +
    • +
      + 2line-radio1 + Subtext +
    • + +
    • +
      + + 2line-radio2 + Subtext +
    • + +
    • + + 2line-colorbar1 + Subtext + + + + +
      button
      +
    • + +
    • + + 2line-colorbar2 + + Subtext +
      button
      +
    • + +
    • + + 2line-colorbar2 + + Subtext +
      +
    • + +
    • + + + 2line-colorbar3 + Subtext +
      +
    • + +
    • + + 2line-bigicon8 + Subtext + +
    • + +
    • + 2line-thumb1 + Subtext + +
    • + +
    • + 2line-thumb2 + + Subtext + +
    • + +
    • + Subtext + 2line-sub-main-bigicon1 + +
    • + +
    • + + 2line-bigicon-pgbar1 + Subtext + Subtext2 +
      +
    • + +
    • + + 2line-bigicon-pgbar2 + Subtext +
      button
      +
    • + +
    • + + 2line-bigicon-pgbar2 + Subtext +
      +
    • + +
    • + + 2line-bigicon-pgbar3 + Subtext + Subtext2 +
      +
    • + +
    • +
      + + 2line-icon-bigicon-btn + Subtext +
      +
    • + +
    • + 2line-thumb3 + + Subtext + +
    • +
    +
    +
    diff --git a/demos/tizen-winsets/widgets/list/list-normal_no_anchor_h3.html b/demos/tizen-winsets/widgets/list/list-normal_no_anchor_h3.html new file mode 100755 index 0000000..808020e --- /dev/null +++ b/demos/tizen-winsets/widgets/list/list-normal_no_anchor_h3.html @@ -0,0 +1,346 @@ +
    +
    +

    Normal lists

    +
    +
    +
      + +
    • +

      1line

      +
    • + +
    • +

      1line-sub

      + subtext +
    • + +
    • +

      1line-btn1

      +
      Text Button
      +
    • + +
    • +

      1line-btn2

      +
      +
    • + +
    • +

      1line-toggle

      +
      +
    • + +
    • + +

      1line-bigicon1

      +
    • + +
    • + +

      1line-bigicon2

      + Sub text +
    • + +
    • + +

      1line-bigicon4

      +
      Text Button
      +
    • + +
    • + +

      1line-bigicon5

      +
      +
    • + +
    • + +

      1line-bigicon6

      +
      +
    • + +
    • + +

      1line-check1

      +
    • + +
    • +
      +

      1line-check2

      +
      +
    • + +
    • +
      + +

      1line-check3

      +
    • + +
    • +
      + +

      1line-check4

      +
      +
    • + +
    • +
      +

      1line-radio1

      +
    • + +
    • +
      +

      1line-radio3

      +
      +
    • + +
    • +
      + +

      1line-radio4

      +
    • + +
    • +
      +

      1line-radio5

      + +
      +
    • + +
    • +
      +

      1line-radio

      + +
    • + +
    • +

      2line

      + Subtext +
    • + +
    • +

      2line-2sub

      + Subtext + Subtext2 +
    • + +
    • +

      2line-btn1

      + Subtext +
      button
      +
    • + +
    • +

      2line-btn1

      + Subtext +
      +
    • + +
    • +

      2line-btn2

      + Subtext +
      +
    • + +
    • +

      2line-star1

      + Subtext + + Subtext2 +
    • + +
    • +

      2line-star

      + Subtext + +
    • + +
    • +

      2line-setting

      + Subtext +
    • + +
    • +

      2line-toggle-setting

      + Subtext +
      +
    • + +
    • +

      2line-btn-setting

      + Subtext +
      +
    • + +
    • +

      2line-bigicon0

      + Subtext +
      +
    • + +
    • + +

      2line-bigicon1

      + Subtext +
    • + +
    • + +

      2line-bigicon2

      + Subtext + Subtext2 +
    • + +
    • + +

      2line-bigicon3

      + Subtext +
    • + +
    • + +

      2line-bigicon4

      + Subtext +
      +
    • + +
    • +
      +

      2line-check

      + Subtext +
    • + +
    • +
      +

      2line-check2

      + Subtext +
      +
    • + +
    • +
      + +

      2line-check3

      + Subtext +
    • + +
    • +
      +

      2line-radio1

      + Subtext +
    • + +
    • +
      + +

      2line-radio2

      + Subtext +
    • + +
    • + +

      2line-colorbar1

      + Subtext + + + + +
      button
      +
    • + +
    • + +

      2line-colorbar2

      + + Subtext +
      button
      +
    • + +
    • + +

      2line-colorbar2

      + + Subtext +
      +
    • + +
    • + + +

      2line-colorbar3

      + Subtext +
      +
    • + +
    • + +

      2line-bigicon8

      + Subtext + +
    • + +
    • +

      2line-thumb1

      + Subtext + +
    • + +
    • +

      2line-thumb2

      + + Subtext + +
    • + +
    • + Subtext +

      2line-sub-main-bigicon1

      + +
    • + +
    • + +

      2line-bigicon-pgbar1

      + Subtext + Subtext2 +
      +
    • + +
    • + +

      2line-bigicon-pgbar2

      + Subtext +
      button
      +
    • + +
    • + +

      2line-bigicon-pgbar2

      + Subtext +
      +
    • + +
    • + +

      2line-bigicon-pgbar3

      + Subtext + Subtext2 +
      +
    • + +
    • +
      + +

      2line-icon-bigicon-btn

      + Subtext +
      +
    • + +
    • +

      2line-thumb3

      + + Subtext + +
    • +
    +
    +
    diff --git a/demos/tizen-winsets/widgets/list/list-radio.html b/demos/tizen-winsets/widgets/list/list-radio.html new file mode 100755 index 0000000..d209d47 --- /dev/null +++ b/demos/tizen-winsets/widgets/list/list-radio.html @@ -0,0 +1,59 @@ +
    +
    +

    Radio Button lists

    +
    +
    +
    +
      + + + +
    • + + Radio Item 4 +
      +
    • +
    • + + + Radio Item 5 +
    • +
    • + + Radio Item 6 +
    • +
    • + + Radio Item 7 +
    • +
    • + + Radio Item 8 +
    • +
    • + + Radio Item 9 +
      +
    • +
    • + + Radio Item 10 + +
    • +
    +
    +
    +
    + diff --git a/demos/tizen-winsets/widgets/list/list-swipe.html b/demos/tizen-winsets/widgets/list/list-swipe.html new file mode 100755 index 0000000..22b8a06 --- /dev/null +++ b/demos/tizen-winsets/widgets/list/list-swipe.html @@ -0,0 +1,107 @@ +
    +
    +

    Swipe lists

    +
    +
    +
      +
        +
      • +
        Twitter
        +
        Twitter
        +
        Facebook
        +
        Facebook
        +
        + 1line-leftsub1 +
        subtext
        +
        +
      • +
      • +
        Twitter
        +
        Twitter
        +
        Facebook
        +
        Facebook
        +
        + 1line +
        +
      • +
      • +
        Twitter
        +
        Twitter
        +
        Facebook
        +
        Facebook
        +
        + 1line-leftsub1 +
        subtext
        +
        +
      • +
      • +
        Twitter
        +
        Twitter
        +
        Facebook
        +
        Facebook
        +
        + 1line +
        +
      • +
      • +
        Twitter
        +
        Twitter
        +
        Facebook
        +
        Facebook
        +
        + 1line-leftsub1 +
        subtext
        +
        +
      • +
      • +
        Twitter
        +
        Twitter
        +
        Facebook
        +
        Facebook
        +
        + 1line +
        +
      • +
      • +
        Twitter
        +
        Twitter
        +
        Facebook
        +
        Facebook
        +
        + 1line-leftsub1 +
        subtext
        +
        +
      • +
      • +
        Twitter
        +
        Twitter
        +
        Facebook
        +
        Facebook
        +
        + 1line +
        +
      • +
      • +
        Twitter
        +
        Twitter
        +
        Facebook
        +
        Facebook
        +
        + 1line-leftsub1 +
        subtext
        +
        +
      • +
      • +
        Twitter
        +
        Twitter
        +
        Facebook
        +
        Facebook
        +
        + 1line +
        +
      • +
      +
    +
    +
    + diff --git a/demos/tizen-winsets/widgets/list/list.html b/demos/tizen-winsets/widgets/list/list.html new file mode 100755 index 0000000..1907922 --- /dev/null +++ b/demos/tizen-winsets/widgets/list/list.html @@ -0,0 +1,60 @@ + + + + + + + + + + + +
    +
    +

    +
    +
    + + +
    +
    + + + + diff --git a/demos/tizen-winsets/widgets/list/thumbnail.jpg b/demos/tizen-winsets/widgets/list/thumbnail.jpg new file mode 100644 index 0000000..7627ddc Binary files /dev/null and b/demos/tizen-winsets/widgets/list/thumbnail.jpg differ diff --git a/demos/tizen-winsets/widgets/list/virtuallist-db-demo.js b/demos/tizen-winsets/widgets/list/virtuallist-db-demo.js new file mode 100755 index 0000000..178bb15 --- /dev/null +++ b/demos/tizen-winsets/widgets/list/virtuallist-db-demo.js @@ -0,0 +1,1057 @@ +/* + * jQuery Mobile Framework : Dummy data for Virtuallist demo + * Copyright (c) Lee, Wongi (wongi11.lee@samsung.com) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + */ + +/* Sample Data in JSON : NBA Player list more than 1,000. */ +var JSON_DATA = [ +{NAME:"Abdelnaby, Alaa", ACTIVE:"1990 - 1994", FROM:"College - Duke", TEAM_LOGO:"./images/nba_hawks.jpg"}, +{NAME:"Abdul-Aziz, Zaid", ACTIVE:"1968 - 1977", FROM:"College - Iowa State", TEAM_LOGO:"./images/nba_suns.jpg"}, +{NAME:"Abdul-Jabbar, Kareem", ACTIVE:"1969 - 1988", FROM:"College - UCLA", TEAM_LOGO:"./images/nba_clippers.jpg"}, +{NAME:"Abdul-Rauf, Mahmoud", ACTIVE:"1990 - 2000", FROM:"College - Louisiana State", TEAM_LOGO:"./images/nba_hawks.jpg"}, +{NAME:"Abdul-Wahad, Tariq", ACTIVE:"1997 - 2002", FROM:"College - San Jose State", TEAM_LOGO:"./images/nba_76ers.jpg"}, +{NAME:"Abdur-Rahim, Shareef", ACTIVE:"2007 - 2007", FROM:"College - California", TEAM_LOGO:"./images/nba_knics.jpg"}, +{NAME:"Abernethy, Tom", ACTIVE:"1976 - 1980", FROM:"College - Indiana", TEAM_LOGO:"./images/nba_griz.jpg"}, +{NAME:"Able, Forest Edward (Frosty)", ACTIVE:"1956 - 1956", FROM:"College - Western Kentucky; Louisville", TEAM_LOGO:"./images/nba_nuggets.jpg"}, +{NAME:"Abramovic, John Jr. (Brooms)", ACTIVE:"1946 - 1947", FROM:"College - Salem (NC)", TEAM_LOGO:"./images/nba_suns.jpg"}, +{NAME:"Acker, Alex", ACTIVE:"2005 - 2008", FROM:"College - Pepperdine", TEAM_LOGO:"./images/nba_trail.jpg"}, +{NAME:"Ackerman, Donald D. (Buddy)", ACTIVE:"1953 - 1953", FROM:"College - Long Island University", TEAM_LOGO:"./images/nba_lakers.jpg"}, +{NAME:"Acres, Mark", ACTIVE:"1987 - 1992", FROM:"College - Oral Roberts", TEAM_LOGO:"./images/nba_knics.jpg"}, +{NAME:"Acton, Charles R. (Bud)", ACTIVE:"1967 - 1967", FROM:"College - Alma; Hillsdale", TEAM_LOGO:"./images/nba_jazz.jpg"}, +{NAME:"Adams, Alvan", ACTIVE:"1975 - 1987", FROM:"College - Oklahoma", TEAM_LOGO:"./images/nba_magics.jpg"}, +{NAME:"Adams, Donald L. (Don)", ACTIVE:"1970 - 1976", FROM:"College - Northwestern", TEAM_LOGO:"./images/nba_celtics.jpg"}, +{NAME:"Adams, Hassan", ACTIVE:"2006 - 2008", FROM:"College - Arizona", TEAM_LOGO:"./images/nba_cavaliers.jpg"}, +{NAME:"Adams, Michael", ACTIVE:"1985 - 1995", FROM:"College - Boston College", TEAM_LOGO:"./images/nba_honets.jpg"}, +{NAME:"Addison, Rafael", ACTIVE:"1986 - 1996", FROM:"College - Syracuse", TEAM_LOGO:"./images/nba_raptors.jpg"}, +{NAME:"Adelman, Rick", ACTIVE:"1968 - 1974", FROM:"College - Loyola Marymount", TEAM_LOGO:"./images/nba_timberwolves.jpg"}, +{NAME:"Adrien, Jeff", ACTIVE:"ACTIVE", FROM:"College - Connecticut", TEAM_LOGO:"./images/nba_honets.jpg"}, +{NAME:"Afflalo, Arron", ACTIVE:"ACTIVE", FROM:"College - UCLA", TEAM_LOGO:"./images/nba_lakers.jpg"}, +{NAME:"Ager, Maurice", ACTIVE:"2007 - 2010", FROM:"College - Michigan State", TEAM_LOGO:"./images/nba_bucks.jpg"}, +{NAME:"Aguirre, Mark", ACTIVE:"1981 - 1993", FROM:"College - DePaul", TEAM_LOGO:"./images/nba_pistons.jpg"}, +{NAME:"Ahearn, Blake", ACTIVE:"2007 - 2008", FROM:"College - Missouri State", TEAM_LOGO:"./images/nba_bulls.jpg"}, +{NAME:"Ainge, Danny", ACTIVE:"1981 - 1994", FROM:"College - Brigham Young", TEAM_LOGO:"./images/nba_kings.jpg"}, +{NAME:"Ajinca, Alexis", ACTIVE:"ACTIVE", FROM:"From - Saint Etienne, France", TEAM_LOGO:"./images/nba_warriors.jpg"}, +{NAME:"Akin, Henry T.", ACTIVE:"1966 - 1967", FROM:"College - William Carey; Morehead State", TEAM_LOGO:"./images/nba_nuggets.jpg"}, +{NAME:"Alabi, Solomon", ACTIVE:"ACTIVE", FROM:"College - Florida State", TEAM_LOGO:"./images/nba_trail.jpg"}, +{NAME:"Alarie, Mark", ACTIVE:"1986 - 1990", FROM:"College - Duke", TEAM_LOGO:"./images/nba_cavaliers.jpg"}, +{NAME:"Alcorn, Gary R.", ACTIVE:"1959 - 1960", FROM:"College - Fresno City Coll. CA (J.C.); Fresno State", TEAM_LOGO:"./images/nba_76ers.jpg"}, +{NAME:"Aldrich, Cole", ACTIVE:"ACTIVE", FROM:"College - Kansas", TEAM_LOGO:"./images/nba_clippers.jpg"}, +{NAME:"Aldridge, LaMarcus", ACTIVE:"ACTIVE", FROM:"College - Texas", TEAM_LOGO:"./images/nba_nuggets.jpg"}, +{NAME:"Aleksinas, Chuck", ACTIVE:"1984 - 1984", FROM:"College - Kentucky; Connecticut", TEAM_LOGO:"./images/nba_pacers.jpg"}, +{NAME:"Alexander, Cory", ACTIVE:"1995 - 2004", FROM:"College - Virginia", TEAM_LOGO:"./images/nba_honets.jpg"}, +{NAME:"Alexander, Courtney", ACTIVE:"2000 - 2002", FROM:"College - Fresno State", TEAM_LOGO:"./images/nba_mavericks.jpg"}, +{NAME:"Alexander, Gary", ACTIVE:"1993 - 1993", FROM:"College - South Florida", TEAM_LOGO:"./images/nba_bobcats.jpg"}, +{NAME:"Alexander, Joe", ACTIVE:"2008 - 2009", FROM:"College - West Virginia", TEAM_LOGO:"./images/nba_mavericks.jpg"}, +{NAME:"Alexander, Victor", ACTIVE:"1991 - 2001", FROM:"College - Iowa State", TEAM_LOGO:"./images/nba_magics.jpg"}, +{NAME:"Alford, Steve", ACTIVE:"1987 - 1990", FROM:"College - Indiana", TEAM_LOGO:"./images/nba_spurs.jpg"}, +{NAME:"Allen, Jerome", ACTIVE:"1995 - 1996", FROM:"College - Pennsylvania", TEAM_LOGO:"./images/nba_wizards.jpg"}, +{NAME:"Allen, Lucius", ACTIVE:"1969 - 1978", FROM:"College - UCLA", TEAM_LOGO:"./images/nba_warriors.jpg"}, +{NAME:"Allen, Malik", ACTIVE:"ACTIVE", FROM:"College - Villanova", TEAM_LOGO:"./images/nba_lakers.jpg"}, +{NAME:"Allen, Randy", ACTIVE:"1988 - 1989", FROM:"College - Florida State", TEAM_LOGO:"./images/nba_mavericks.jpg"}, +{NAME:"Allen, Ray", ACTIVE:"ACTIVE", FROM:"College - Connecticut", TEAM_LOGO:"./images/nba_mavericks.jpg"}, +{NAME:"Allen, Robert J. (Bob)", ACTIVE:"1968 - 1968", FROM:"College - Marshall", TEAM_LOGO:"./images/nba_rockets.jpg"}, +{NAME:"Allen, Tony", ACTIVE:"ACTIVE", FROM:"College - Oklahoma State", TEAM_LOGO:"./images/nba_nuggets.jpg"}, +{NAME:"Allison, Odis Jr.", ACTIVE:"1971 - 1971", FROM:"College - Laney Coll. CA (J.C.); Nevada-Las Vegas", TEAM_LOGO:"./images/nba_jazz.jpg"}, +{NAME:"Allred, Lance", ACTIVE:"2007 - 2007", FROM:"College - Weber State", TEAM_LOGO:"./images/nba_celtics.jpg"}, +{NAME:"Allums, Darrell", ACTIVE:"1980 - 1980", FROM:"College - UCLA", TEAM_LOGO:"./images/nba_hawks.jpg"}, +{NAME:"Almond, Morris", ACTIVE:"2007 - 2008", FROM:"College - Rice", TEAM_LOGO:"./images/nba_bobcats.jpg"}, +{NAME:"Babbitt, Luke", ACTIVE:"ACTIVE", FROM:"College - Nevada-Reno", TEAM_LOGO:"./images/nba_76ers.jpg"}, +{NAME:"Babic, Milos", ACTIVE:"1990 - 1991", FROM:"College - Tennessee Tech", TEAM_LOGO:"./images/nba_wizards.jpg"}, +{NAME:"Bach, John William (Johnny)", ACTIVE:"1948 - 1948", FROM:"College - Fordham; Rochester; Brown", TEAM_LOGO:"./images/nba_76ers.jpg"}, +{NAME:"Baechtold, James E. (Jim)", ACTIVE:"1952 - 1956", FROM:"College - Eastern Kentucky", TEAM_LOGO:"./images/nba_lakers.jpg"}, +{NAME:"Bagaric, Dalibor", ACTIVE:"2000 - 2002", FROM:"From - Croatia", TEAM_LOGO:"./images/nba_cavaliers.jpg"}, +{NAME:"Bagley, John", ACTIVE:"1982 - 1993", FROM:"College - Boston College", TEAM_LOGO:"./images/nba_pacers.jpg"}, +{NAME:"Bailey, Augustus (Gus)", ACTIVE:"1974 - 1979", FROM:"College - Texas-El Paso", TEAM_LOGO:"./images/nba_hawks.jpg"}, +{NAME:"Bailey, Carl", ACTIVE:"1981 - 1981", FROM:"College - Tuskegee", TEAM_LOGO:"./images/nba_kings.jpg"}, +{NAME:"Bailey, James", ACTIVE:"1979 - 1987", FROM:"College - Rutgers", TEAM_LOGO:"./images/nba_mavericks.jpg"}, +{NAME:"Bailey, Thurl", ACTIVE:"1983 - 1998", FROM:"College - North Carolina State", TEAM_LOGO:"./images/nba_heats.jpg"}, +{NAME:"Bailey, Toby", ACTIVE:"1998 - 1999", FROM:"College - UCLA ''98", TEAM_LOGO:"./images/nba_jazz.jpg"}, +{NAME:"Baker, Mark", ACTIVE:"1998 - 1998", FROM:"College - Ohio State", TEAM_LOGO:"./images/nba_lakers.jpg"}, +{NAME:"Baker, Maurice", ACTIVE:"2004 - 2004", FROM:"College - Oklahoma State '02", TEAM_LOGO:"./images/nba_heats.jpg"}, +{NAME:"Baker, Norman Henry (Norm)", ACTIVE:"1946 - 1946", FROM:"College - No College", TEAM_LOGO:"./images/nba_jazz.jpg"}, +{NAME:"Baker, Vin", ACTIVE:"1993 - 2005", FROM:"College - Hartford", TEAM_LOGO:"./images/nba_knics.jpg"}, +{NAME:"Balkman, Renaldo", ACTIVE:"ACTIVE", FROM:"College - South Carolina", TEAM_LOGO:"./images/nba_trail.jpg"}, +{NAME:"Ball, Cedric", ACTIVE:"1990 - 1990", FROM:"College - North Carolina-Charlotte", TEAM_LOGO:"./images/nba_pacers.jpg"}, +{NAME:"Ballard, Greg", ACTIVE:"1977 - 1988", FROM:"College - Shasta Coll. CA (J.C.); Oregon", TEAM_LOGO:"./images/nba_mavericks.jpg"}, +{NAME:"Baltimore, Herschel David (Herk)", ACTIVE:"1946 - 1946", FROM:"College - Penn State", TEAM_LOGO:"./images/nba_spurs.jpg"}, +{NAME:"Banks, Gene", ACTIVE:"1981 - 1986", FROM:"College - Duke", TEAM_LOGO:"./images/nba_raptors.jpg"}, +{NAME:"Banks, Marcus", ACTIVE:"ACTIVE", FROM:"College - Nevada-Las Vegas", TEAM_LOGO:"./images/nba_trail.jpg"}, +{NAME:"Bannister, Ken", ACTIVE:"1984 - 1990", FROM:"College - Trinidad State JC CO; Indiana State; Saint Augustine College", TEAM_LOGO:"./images/nba_griz.jpg"}, +{NAME:"Bantom, Mike", ACTIVE:"1973 - 1981", FROM:"College - St. Joseph's (PA)", TEAM_LOGO:"./images/nba_griz.jpg"}, +{NAME:"Barber, John", ACTIVE:"1956 - 1956", FROM:"College - Los Angeles State", TEAM_LOGO:"./images/nba_nets.jpg"}, +{NAME:"Barbosa, Leandro", ACTIVE:"ACTIVE", FROM:"From - Sau Paulo, Brazil", TEAM_LOGO:"./images/nba_jazz.jpg"}, +{NAME:"Bardo, Stephen", ACTIVE:"1991 - 1995", FROM:"College - Illinois", TEAM_LOGO:"./images/nba_heats.jpg"}, +{NAME:"Barea, Jose", ACTIVE:"ACTIVE", FROM:"College - Northeastern", TEAM_LOGO:"./images/nba_warriors.jpg"}, +{NAME:"Bargnani, Andrea", ACTIVE:"ACTIVE", FROM:"From - Rome, Italy", TEAM_LOGO:"./images/nba_hawks.jpg"}, +{NAME:"Barker, Clifford E. (Cliff)", ACTIVE:"1949 - 1951", FROM:"College - Kentucky", TEAM_LOGO:"./images/nba_bobcats.jpg"}, +{NAME:"Barker, Thomas Kevin (Tom)", ACTIVE:"1976 - 1978", FROM:"College - Minnesota; Coll. of Southern Idaho (J.C.); Hawaii", TEAM_LOGO:"./images/nba_cavaliers.jpg"}, +{NAME:"Barkley, Charles", ACTIVE:"1984 - 1999", FROM:"College - Auburn", TEAM_LOGO:"./images/nba_celtics.jpg"}, +{NAME:"Barkley, Erick", ACTIVE:"2000 - 2001", FROM:"College - St. John''s '02", TEAM_LOGO:"./images/nba_nets.jpg"}, +{NAME:"Barksdale, Don Angelo", ACTIVE:"1951 - 1954", FROM:"College - Coll. of Marin CA (J.C.); UCLA", TEAM_LOGO:"./images/nba_bobcats.jpg"}, +{NAME:"Barnes, Harry J.", ACTIVE:"1968 - 1968", FROM:"College - Northeastern", TEAM_LOGO:"./images/nba_nuggets.jpg"}, +{NAME:"Barnes, Marvin Jerome", ACTIVE:"1976 - 1979", FROM:"College - Providence", TEAM_LOGO:"./images/nba_knics.jpg"}, +{NAME:"Barnes, Matt", ACTIVE:"ACTIVE", FROM:"College - UCLA", TEAM_LOGO:"./images/nba_honets.jpg"}, +{NAME:"Barnes, V. James (Jim, Bad News)", ACTIVE:"1964 - 1970", FROM:"College - Cameron; Texas-El Paso", TEAM_LOGO:"./images/nba_lakers.jpg"}, +{NAME:"Barnett, Dick", ACTIVE:"1959 - 1973", FROM:"College - Tennessee State", TEAM_LOGO:"./images/nba_clippers.jpg"}, +{NAME:"Barnett, James Franklin (Jim)", ACTIVE:"1966 - 1976", FROM:"College - Oregon", TEAM_LOGO:"./images/nba_celtics.jpg"}, +{NAME:"Barnhill, John Anthony (Rabbit)", ACTIVE:"1962 - 1968", FROM:"College - Tennessee State", TEAM_LOGO:"./images/nba_nets.jpg"}, +{NAME:"Barnhill, Norton", ACTIVE:"1976 - 1976", FROM:"College - Washington State", TEAM_LOGO:"./images/nba_nuggets.jpg"}, +{NAME:"Barnhorst, Leo A. (Barney)", ACTIVE:"1949 - 1953", FROM:"College - Notre Dame", TEAM_LOGO:"./images/nba_bobcats.jpg"}, +{NAME:"Barr, John E.", ACTIVE:"1946 - 1946", FROM:"College - Penn State", TEAM_LOGO:"./images/nba_mavericks.jpg"}, +{NAME:"Barr, Michael J. (Mike)", ACTIVE:"1976 - 1976", FROM:"College - Duquesne", TEAM_LOGO:"./images/nba_wizards.jpg"}, +{NAME:"Barr, Thomas L. (Moe)", ACTIVE:"1970 - 1970", FROM:"College - Duquesne", TEAM_LOGO:"./images/nba_kings.jpg"}, +{NAME:"Barrett, Andre", ACTIVE:"2007 - 2007", FROM:"College - Seton Hall", TEAM_LOGO:"./images/nba_rockets.jpg"}, +{NAME:"Barrett, Ernie Drew", ACTIVE:"1953 - 1955", FROM:"College - Kansas State", TEAM_LOGO:"./images/nba_nuggets.jpg"}, +{NAME:"Barron, Earl", ACTIVE:"ACTIVE", FROM:"College - Memphis", TEAM_LOGO:"./images/nba_knics.jpg"}, +{NAME:"Barros, Dana", ACTIVE:"1989 - 2003", FROM:"College - Boston College ''89", TEAM_LOGO:"./images/nba_celtics.jpg"}, +{NAME:"Barry, Brent", ACTIVE:"2007 - 2008", FROM:"College - Oregon State", TEAM_LOGO:"./images/nba_timberwolves.jpg"}, +{NAME:"Cabarkapa, Zarko", ACTIVE:"2003 - 2005", FROM:"From - Serbia & Montenegro", TEAM_LOGO:"./images/nba_timberwolves.jpg"}, +{NAME:"Cable, Byrum William (Barney)", ACTIVE:"1958 - 1963", FROM:"College - Bradley", TEAM_LOGO:"./images/nba_rockets.jpg"}, +{NAME:"Caffey, Jason", ACTIVE:"1995 - 2002", FROM:"College - Alabama ''95", TEAM_LOGO:"./images/nba_sonics.jpg"}, +{NAME:"Cage, Michael", ACTIVE:"1984 - 1999", FROM:"College - San Diego State", TEAM_LOGO:"./images/nba_cavaliers.jpg"}, +{NAME:"Calabrese, Gerald A. (Gerry)", ACTIVE:"1950 - 1951", FROM:"College - St. John's (N.Y.)", TEAM_LOGO:"./images/nba_raptors.jpg"}, +{NAME:"Calderon, Jose", ACTIVE:"ACTIVE", FROM:"From - Villanueva de la Serena, Spain", TEAM_LOGO:"./images/nba_bucks.jpg"}, +{NAME:"Caldwell, Adrian", ACTIVE:"1989 - 1997", FROM:"College - Navarro Coll. TX (J.C.); Southern Methodist; Lamar", TEAM_LOGO:"./images/nba_pistons.jpg"}, +{NAME:"Caldwell, James W. Jr. (Jim)", ACTIVE:"1967 - 1967", FROM:"College - Georgia Tech", TEAM_LOGO:"./images/nba_sonics.jpg"}, +{NAME:"Caldwell, Joe (Pogo)", ACTIVE:"1964 - 1969", FROM:"College - Arizona State", TEAM_LOGO:"./images/nba_sonics.jpg"}, +{NAME:"Calhoun, David L. (Corky)", ACTIVE:"1972 - 1979", FROM:"College - Pennsylvania", TEAM_LOGO:"./images/nba_clippers.jpg"}, +{NAME:"Calhoun, William C. (Bill)", ACTIVE:"1948 - 1954", FROM:"College - San Francisco City Coll. CA (J.C.)", TEAM_LOGO:"./images/nba_rockets.jpg"}, +{NAME:"Calip, Demetrius", ACTIVE:"1991 - 1991", FROM:"College - Michigan", TEAM_LOGO:"./images/nba_trail.jpg"}, +{NAME:"Callahan, Thomas Francis (Tom)", ACTIVE:"1946 - 1946", FROM:"College - Notre Dame; Rockhurst", TEAM_LOGO:"./images/nba_lakers.jpg"}, +{NAME:"Calloway, Rick", ACTIVE:"1990 - 1990", FROM:"College - Indiana; Kansas", TEAM_LOGO:"./images/nba_lakers.jpg"}, +{NAME:"Calverley, Ernest A. (Ernie)", ACTIVE:"1946 - 1948", FROM:"College - Rhode Island", TEAM_LOGO:"./images/nba_nuggets.jpg"}, +{NAME:"Calvin, Mack", ACTIVE:"1976 - 1980", FROM:"College - Long Beach City Coll. CA (J.C.); USC", TEAM_LOGO:"./images/nba_griz.jpg"}, +{NAME:"Cambridge, Dexter", ACTIVE:"1992 - 1992", FROM:"College - Lon Morris Coll. TX (J.C.); Texas", TEAM_LOGO:"./images/nba_bucks.jpg"}, +{NAME:"Camby, Marcus", ACTIVE:"ACTIVE", FROM:"College - Massachusetts", TEAM_LOGO:"./images/nba_bulls.jpg"}, +{NAME:"Campbell, Elden", ACTIVE:"1990 - 2004", FROM:"College - Clemson", TEAM_LOGO:"./images/nba_warriors.jpg"}, +{NAME:"Campbell, Tony", ACTIVE:"1984 - 1994", FROM:"College - Ohio State", TEAM_LOGO:"./images/nba_nets.jpg"}, +{NAME:"Cannon, Lawrence T. (Larry)", ACTIVE:"1973 - 1973", FROM:"College - La Salle", TEAM_LOGO:"./images/nba_kings.jpg"}, +{NAME:"Caracter, Derrick", ACTIVE:"ACTIVE", FROM:"College - Texas-El Paso", TEAM_LOGO:"./images/nba_rockets.jpg"}, +{NAME:"Cardinal, Brian", ACTIVE:"ACTIVE", FROM:"College - Purdue", TEAM_LOGO:"./images/nba_heats.jpg"}, +{NAME:"Carl, Howard Hershey (Howie)", ACTIVE:"1961 - 1961", FROM:"College - Illinois; DePaul", TEAM_LOGO:"./images/nba_raptors.jpg"}, +{NAME:"Carlisle, Chester G. (Chet)", ACTIVE:"1946 - 1946", FROM:"College - California", TEAM_LOGO:"./images/nba_cavaliers.jpg"}, +{NAME:"Carlisle, Geno", ACTIVE:"2004 - 2004", FROM:"College - California '99", TEAM_LOGO:"./images/nba_heats.jpg"}, +{NAME:"Carlisle, Rick", ACTIVE:"1984 - 1989", FROM:"College - Maine; Virginia", TEAM_LOGO:"./images/nba_mavericks.jpg"}, +{NAME:"Carlson, Alvin Harold", ACTIVE:"1975 - 1975", FROM:"College - USC; Oregon", TEAM_LOGO:"./images/nba_bucks.jpg"}, +{NAME:"Carlson, Don Vernon (Swede)", ACTIVE:"1946 - 1950", FROM:"College - Minnesota", TEAM_LOGO:"./images/nba_kings.jpg"}, +{NAME:"Carney, Robert Lee (Bob)", ACTIVE:"1954 - 1954", FROM:"College - Bradley", TEAM_LOGO:"./images/nba_raptors.jpg"}, +{NAME:"Carney, Rodney", ACTIVE:"2007 - 2010", FROM:"College - Memphis", TEAM_LOGO:"./images/nba_raptors.jpg"}, +{NAME:"Carpenter, Robert H. (Bob)", ACTIVE:"1949 - 1950", FROM:"College - Texas A&M-Commerce", TEAM_LOGO:"./images/nba_knics.jpg"}, +{NAME:"Carr, Antoine", ACTIVE:"1984 - 1999", FROM:"College - Wichita State", TEAM_LOGO:"./images/nba_kings.jpg"}, +{NAME:"Carr, Austin George", ACTIVE:"1971 - 1980", FROM:"College - Notre Dame", TEAM_LOGO:"./images/nba_rockets.jpg"}, +{NAME:"Carr, Chris", ACTIVE:"1995 - 2000", FROM:"College - Southern Illinois", TEAM_LOGO:"./images/nba_bucks.jpg"}, +{NAME:"Carr, Cory", ACTIVE:"1998 - 1998", FROM:"College - Texas Tech", TEAM_LOGO:"./images/nba_hawks.jpg"}, +{NAME:"Carr, Kenny", ACTIVE:"1977 - 1986", FROM:"College - North Carolina State", TEAM_LOGO:"./images/nba_rockets.jpg"}, +{NAME:"Carr, M.L.", ACTIVE:"1976 - 1984", FROM:"College - Guilford", TEAM_LOGO:"./images/nba_heats.jpg"}, +{NAME:"Carrington, Robert Frederick (Bob)", ACTIVE:"1977 - 1979", FROM:"College - Boston College", TEAM_LOGO:"./images/nba_76ers.jpg"}, +{NAME:"Carroll, DeMarre", ACTIVE:"2009 - 2010", FROM:"College - Missouri", TEAM_LOGO:"./images/nba_magics.jpg"}, +{NAME:"Carroll, Joe Barry", ACTIVE:"1980 - 1990", FROM:"College - Purdue", TEAM_LOGO:"./images/nba_trail.jpg"}, +{NAME:"Carroll, Matt", ACTIVE:"ACTIVE", FROM:"College - Notre Dame", TEAM_LOGO:"./images/nba_nets.jpg"}, +{NAME:"Carruth, Jimmy", ACTIVE:"1996 - 1996", FROM:"College - Virginia Tech", TEAM_LOGO:"./images/nba_wizards.jpg"}, +{NAME:"Carter, Anthony", ACTIVE:"ACTIVE", FROM:"College - Hawaii", TEAM_LOGO:"./images/nba_kings.jpg"}, +{NAME:"Carter, Butch", ACTIVE:"1980 - 1985", FROM:"College - Indiana", TEAM_LOGO:"./images/nba_nets.jpg"}, +{NAME:"Carter, Frederick James (Fred, Mad Dog)", ACTIVE:"1969 - 1976", FROM:"College - Mount St. Mary's", TEAM_LOGO:"./images/nba_pistons.jpg"}, +{NAME:"Carter, George", ACTIVE:"1967 - 1967", FROM:"College - St. Bonaventure", TEAM_LOGO:"./images/nba_clippers.jpg"}, +{NAME:"Carter, Howard", ACTIVE:"1983 - 1984", FROM:"College - Louisiana State", TEAM_LOGO:"./images/nba_rockets.jpg"}, +{NAME:"Carter, John D. (Jake)", ACTIVE:"1949 - 1949", FROM:"College - Texas A&M-Commerce", TEAM_LOGO:"./images/nba_heats.jpg"}, +{NAME:"Carter, Maurice", ACTIVE:"2003 - 2003", FROM:"College - Louisiana State ''99", TEAM_LOGO:"./images/nba_magics.jpg"}, +{NAME:"D'Antoni, Michael Andrew (Mike)", ACTIVE:"1973 - 1976", FROM:"College - Marshall", TEAM_LOGO:"./images/nba_jazz.jpg"}, +{NAME:"Dahler, Edward Jr. (Ed)", ACTIVE:"1951 - 1951", FROM:"College - Duquesne", TEAM_LOGO:"./images/nba_trail.jpg"}, +{NAME:"Dailey, Quintin", ACTIVE:"1982 - 1991", FROM:"College - San Francisco", TEAM_LOGO:"./images/nba_magics.jpg"}, +{NAME:"Dalembert, Samuel", ACTIVE:"ACTIVE", FROM:"College - Seton Hall", TEAM_LOGO:"./images/nba_honets.jpg"}, +{NAME:"Dallmar, Howard (Howie)", ACTIVE:"1946 - 1948", FROM:"College - Stanford; Pennsylvania", TEAM_LOGO:"./images/nba_bulls.jpg"}, +{NAME:"Dampier, Erick", ACTIVE:"ACTIVE", FROM:"College - Mississippi State", TEAM_LOGO:"./images/nba_trail.jpg"}, +{NAME:"Dampier, Louie (Lou)", ACTIVE:"1976 - 1978", FROM:"College - Kentucky", TEAM_LOGO:"./images/nba_rockets.jpg"}, +{NAME:"Dandridge, Robert L. Jr. (Bob)", ACTIVE:"1969 - 1981", FROM:"College - Norfolk State", TEAM_LOGO:"./images/nba_jazz.jpg"}, +{NAME:"Daniels, Antonio", ACTIVE:"ACTIVE", FROM:"College - Bowling Green", TEAM_LOGO:"./images/nba_bobcats.jpg"}, +{NAME:"Daniels, Erik", ACTIVE:"2004 - 2004", FROM:"College - Kentucky", TEAM_LOGO:"./images/nba_griz.jpg"}, +{NAME:"Daniels, Lloyd", ACTIVE:"1992 - 1997", FROM:"College - Mount San Antonio Coll. CA (J.C.)", TEAM_LOGO:"./images/nba_nets.jpg"}, +{NAME:"Daniels, Marquis", ACTIVE:"ACTIVE", FROM:"College - Auburn", TEAM_LOGO:"./images/nba_76ers.jpg"}, +{NAME:"Daniels, Mel", ACTIVE:"1976 - 1976", FROM:"College - Burlington Co. Coll. NJ (J.C.); New Mexico", TEAM_LOGO:"./images/nba_warriors.jpg"}, +{NAME:"Danilovic, Sasha", ACTIVE:"1995 - 1996", FROM:"College - Serbia", TEAM_LOGO:"./images/nba_spurs.jpg"}, +{NAME:"Dantley, Adrian", ACTIVE:"1976 - 1990", FROM:"College - Notre Dame", TEAM_LOGO:"./images/nba_jazz.jpg"}, +{NAME:"Darcey, Henry J. (Pete)", ACTIVE:"1952 - 1952", FROM:"College - Oklahoma State", TEAM_LOGO:"./images/nba_bucks.jpg"}, +{NAME:"Darden, James W. (Jimmy)", ACTIVE:"1949 - 1949", FROM:"College - Wyoming; Denver", TEAM_LOGO:"./images/nba_heats.jpg"}, +{NAME:"Dare, Yinka", ACTIVE:"1994 - 1997", FROM:"College - George Washington", TEAM_LOGO:"./images/nba_clippers.jpg"}, +{NAME:"Dark, Jesse L.", ACTIVE:"1974 - 1974", FROM:"College - Virginia Commonwealth", TEAM_LOGO:"./images/nba_heats.jpg"}, +{NAME:"Darrow, James K. (Jimmy)", ACTIVE:"1961 - 1961", FROM:"College - Bowling Green State", TEAM_LOGO:"./images/nba_wizards.jpg"}, +{NAME:"Daugherty, Brad", ACTIVE:"1986 - 1993", FROM:"College - North Carolina", TEAM_LOGO:"./images/nba_sonics.jpg"}, +{NAME:"David, Kornel", ACTIVE:"1998 - 2000", FROM:"College - Budapest AEH", TEAM_LOGO:"./images/nba_bucks.jpg"}, +{NAME:"Davidson, Jermareo", ACTIVE:"2007 - 2008", FROM:"College - Alabama", TEAM_LOGO:"./images/nba_pacers.jpg"}, +{NAME:"Davies, Robert Edris (Bob, Harrisburg Houdini)", ACTIVE:"1948 - 1954", FROM:"College - Franklin & Marshall; Seton Hall", TEAM_LOGO:"./images/nba_bobcats.jpg"}, +{NAME:"Davis, Antonio", ACTIVE:"1993 - 2005", FROM:"College - Texas-El Paso", TEAM_LOGO:"./images/nba_bulls.jpg"}, +{NAME:"Davis, Aubrey D.", ACTIVE:"1946 - 1946", FROM:"College - Oklahoma Baptist", TEAM_LOGO:"./images/nba_trail.jpg"}, +{NAME:"Davis, Baron", ACTIVE:"ACTIVE", FROM:"College - UCLA", TEAM_LOGO:"./images/nba_wizards.jpg"}, +{NAME:"Davis, Ben", ACTIVE:"1996 - 1999", FROM:"College - Arizona ''96", TEAM_LOGO:"./images/nba_bucks.jpg"}, +{NAME:"Davis, Brad", ACTIVE:"1977 - 1991", FROM:"College - Maryland", TEAM_LOGO:"./images/nba_jazz.jpg"}, +{NAME:"Davis, Brian", ACTIVE:"1993 - 1993", FROM:"College - Duke", TEAM_LOGO:"./images/nba_cavaliers.jpg"}, +{NAME:"Davis, Charles Lawrence (Charlie)", ACTIVE:"1971 - 1973", FROM:"College - Wake Forest", TEAM_LOGO:"./images/nba_magics.jpg"}, +{NAME:"Davis, Charlie E.", ACTIVE:"1981 - 1989", FROM:"College - Vanderbilt", TEAM_LOGO:"./images/nba_jazz.jpg"}, +{NAME:"Davis, Dale", ACTIVE:"1991 - 2006", FROM:"College - Clemson", TEAM_LOGO:"./images/nba_pacers.jpg"}, +{NAME:"Davis, Damon William (Monti)", ACTIVE:"1980 - 1980", FROM:"College - Tennessee State", TEAM_LOGO:"./images/nba_timberwolves.jpg"}, +{NAME:"Davis, Dwight E. (Double D)", ACTIVE:"1972 - 1976", FROM:"College - Houston", TEAM_LOGO:"./images/nba_bulls.jpg"}, +{NAME:"Davis, Ed", ACTIVE:"ACTIVE", FROM:"College - North Carolina", TEAM_LOGO:"./images/nba_lakers.jpg"}, +{NAME:"Davis, Edward J. (Mickey)", ACTIVE:"1972 - 1976", FROM:"College - Duquesne", TEAM_LOGO:"./images/nba_wizards.jpg"}, +{NAME:"Davis, Emanual", ACTIVE:"1996 - 2002", FROM:"College - Delaware State ''91", TEAM_LOGO:"./images/nba_rockets.jpg"}, +{NAME:"Davis, Glen", ACTIVE:"ACTIVE", FROM:"College - Louisiana State", TEAM_LOGO:"./images/nba_lakers.jpg"}, +{NAME:"Davis, Harry A.", ACTIVE:"1978 - 1979", FROM:"College - Florida State", TEAM_LOGO:"./images/nba_heats.jpg"}, +{NAME:"Davis, Hubert", ACTIVE:"1992 - 2003", FROM:"College - North Carolina ''92", TEAM_LOGO:"./images/nba_nuggets.jpg"}, +{NAME:"Davis, James R. (Red)", ACTIVE:"1955 - 1955", FROM:"College - St. John's (N.Y.)", TEAM_LOGO:"./images/nba_hawks.jpg"}, +{NAME:"Davis, James W. (Jim)", ACTIVE:"1967 - 1974", FROM:"College - Colorado", TEAM_LOGO:"./images/nba_knics.jpg"}, +{NAME:"Davis, Johnny", ACTIVE:"1976 - 1985", FROM:"College - Dayton", TEAM_LOGO:"./images/nba_trail.jpg"}, +{NAME:"Davis, Josh", ACTIVE:"2003 - 2005", FROM:"College - Wyoming", TEAM_LOGO:"./images/nba_sonics.jpg"}, +{NAME:"Davis, Mark", ACTIVE:"1988 - 1988", FROM:"College - Old Dominion", TEAM_LOGO:"./images/nba_sonics.jpg"}, +{NAME:"Davis, Mark", ACTIVE:"1995 - 1999", FROM:"College - Texas Tech", TEAM_LOGO:"./images/nba_bucks.jpg"}, +{NAME:"Davis, Melvyn Jerome (Mel, Killer)", ACTIVE:"1973 - 1976", FROM:"College - St. John's (N.Y.)", TEAM_LOGO:"./images/nba_timberwolves.jpg"}, +{NAME:"Davis, Michael", ACTIVE:"1982 - 1982", FROM:"College - Mercer Co. CC NJ; Maryland", TEAM_LOGO:"./images/nba_spurs.jpg"}, +{NAME:"Davis, Michael A. (Mike, Crusher)", ACTIVE:"1969 - 1972", FROM:"College - Virginia Union", TEAM_LOGO:"./images/nba_heats.jpg"}, +{NAME:"Eackles, Ledell", ACTIVE:"1988 - 1997", FROM:"College - San Jacinto Coll. TX (J.C.); New Orleans", TEAM_LOGO:"./images/nba_mavericks.jpg"}, +{NAME:"Eakins, James Scott (Jim, Jimbo)", ACTIVE:"1976 - 1977", FROM:"College - Brigham Young", TEAM_LOGO:"./images/nba_lakers.jpg"}, +{NAME:"Earl, Acie", ACTIVE:"1993 - 1996", FROM:"College - Iowa", TEAM_LOGO:"./images/nba_bobcats.jpg"}, +{NAME:"Earle, Edwin (Ed)", ACTIVE:"1953 - 1953", FROM:"College - Loyola (Chicago)", TEAM_LOGO:"./images/nba_pistons.jpg"}, +{NAME:"Eaton, Mark", ACTIVE:"1982 - 1992", FROM:"College - Cypress Coll. CA (J.C.); UCLA", TEAM_LOGO:"./images/nba_timberwolves.jpg"}, +{NAME:"Eaves, Jerry", ACTIVE:"1982 - 1986", FROM:"College - Louisville", TEAM_LOGO:"./images/nba_suns.jpg"}, +{NAME:"Ebanks, Devin", ACTIVE:"ACTIVE", FROM:"College - West Virginia", TEAM_LOGO:"./images/nba_lakers.jpg"}, +{NAME:"Ebben, William Edward (Bill)", ACTIVE:"1957 - 1957", FROM:"College - Detroit", TEAM_LOGO:"./images/nba_sonics.jpg"}, +{NAME:"Eberhard, Allen Dean (Al)", ACTIVE:"1974 - 1977", FROM:"College - Missouri", TEAM_LOGO:"./images/nba_bobcats.jpg"}, +{NAME:"Ebi, Ndudi", ACTIVE:"2003 - 2004", FROM:"High School - Westbury Christian HS (TX)", TEAM_LOGO:"./images/nba_mavericks.jpg"}, +{NAME:"Eddie, Patrick", ACTIVE:"1991 - 1991", FROM:"College - Arkansas State; Mississippi", TEAM_LOGO:"./images/nba_griz.jpg"}, +{NAME:"Eddleman, Thomas Dwight (Dike)", ACTIVE:"1949 - 1952", FROM:"College - Illinois", TEAM_LOGO:"./images/nba_clippers.jpg"}, +{NAME:"Edelin, Kenton Scott (Kent)", ACTIVE:"1984 - 1984", FROM:"College - Virginia", TEAM_LOGO:"./images/nba_magics.jpg"}, +{NAME:"Edmonson, Keith", ACTIVE:"1982 - 1983", FROM:"College - Purdue", TEAM_LOGO:"./images/nba_spurs.jpg"}, +{NAME:"Edney, Tyus", ACTIVE:"1995 - 2000", FROM:"College - UCLA", TEAM_LOGO:"./images/nba_timberwolves.jpg"}, +{NAME:"Edwards, Bill", ACTIVE:"1993 - 1993", FROM:"College - Wright State", TEAM_LOGO:"./images/nba_clippers.jpg"}, +{NAME:"Edwards, Blue", ACTIVE:"1989 - 1998", FROM:"College - Louisburg; East Carolina", TEAM_LOGO:"./images/nba_kings.jpg"}, +{NAME:"Edwards, Corsley", ACTIVE:"2004 - 2004", FROM:"College - Central Connecticut State '02", TEAM_LOGO:"./images/nba_rockets.jpg"}, +{NAME:"Edwards, Doug", ACTIVE:"1993 - 1995", FROM:"College - Florida State", TEAM_LOGO:"./images/nba_griz.jpg"}, +{NAME:"Edwards, Franklin", ACTIVE:"1981 - 1987", FROM:"College - Cleveland State", TEAM_LOGO:"./images/nba_timberwolves.jpg"}, +{NAME:"Edwards, James", ACTIVE:"1977 - 1995", FROM:"College - Washington", TEAM_LOGO:"./images/nba_wizards.jpg"}, +{NAME:"Edwards, Jay", ACTIVE:"1989 - 1989", FROM:"College - Indiana", TEAM_LOGO:"./images/nba_jazz.jpg"}, +{NAME:"Edwards, John", ACTIVE:"2004 - 2005", FROM:"College - Kent State", TEAM_LOGO:"./images/nba_clippers.jpg"}, +{NAME:"Edwards, Kevin", ACTIVE:"1988 - 2000", FROM:"College - Lakeland CC OH; DePaul", TEAM_LOGO:"./images/nba_warriors.jpg"}, +{NAME:"Egan, John Francis (Johnny)", ACTIVE:"1961 - 1971", FROM:"College - Providence", TEAM_LOGO:"./images/nba_bobcats.jpg"}, +{NAME:"Eggleston, Lonnie J.", ACTIVE:"1948 - 1948", FROM:"College - Oklahoma State", TEAM_LOGO:"./images/nba_suns.jpg"}, +{NAME:"Ehlers, Edwin S. (Eddie, Bulbs)", ACTIVE:"1947 - 1948", FROM:"College - Purdue", TEAM_LOGO:"./images/nba_mavericks.jpg"}, +{NAME:"Ehlo, Craig", ACTIVE:"1983 - 1996", FROM:"College - Odessa Coll. TX (J.C.); Washington State", TEAM_LOGO:"./images/nba_spurs.jpg"}, +{NAME:"Eichhorst, Richard A. (Dick)", ACTIVE:"1961 - 1961", FROM:"College - Southeast Missouri State", TEAM_LOGO:"./images/nba_timberwolves.jpg"}, +{NAME:"Eisley, Howard", ACTIVE:"1994 - 2005", FROM:"College - Boston College", TEAM_LOGO:"./images/nba_spurs.jpg"}, +{NAME:"Ekezie, Obinna", ACTIVE:"1999 - 2004", FROM:"College - Maryland", TEAM_LOGO:"./images/nba_pacers.jpg"}, +{NAME:"El-Amin, Khalid", ACTIVE:"2000 - 2000", FROM:"College - Connecticut ''01", TEAM_LOGO:"./images/nba_sonics.jpg"}, +{NAME:"Eliason, Donald Carlton (Don)", ACTIVE:"1946 - 1946", FROM:"College - Hamline", TEAM_LOGO:"./images/nba_bucks.jpg"}, +{NAME:"Elie, Mario", ACTIVE:"1990 - 2000", FROM:"College - American International", TEAM_LOGO:"./images/nba_trail.jpg"}, +{NAME:"Ellefson, E. Ray (Ray)", ACTIVE:"1948 - 1950", FROM:"College - Oklahoma State; Colorado; West Texas A&M", TEAM_LOGO:"./images/nba_knics.jpg"}, +{NAME:"Ellington, Wayne", ACTIVE:"ACTIVE", FROM:"College - North Carolina", TEAM_LOGO:"./images/nba_nuggets.jpg"}, +{NAME:"Elliott, Robert Alan (Bob)", ACTIVE:"1978 - 1980", FROM:"College - Arizona", TEAM_LOGO:"./images/nba_raptors.jpg"}, +{NAME:"Elliott, Sean", ACTIVE:"1989 - 2000", FROM:"College - Arizona", TEAM_LOGO:"./images/nba_lakers.jpg"}, +{NAME:"Ellis, Alexander (Boo)", ACTIVE:"1958 - 1959", FROM:"College - Niagara", TEAM_LOGO:"./images/nba_clippers.jpg"}, +{NAME:"Ellis, Dale", ACTIVE:"1983 - 1999", FROM:"College - Tennessee", TEAM_LOGO:"./images/nba_nets.jpg"}, +{NAME:"Ellis, Harold", ACTIVE:"1993 - 1997", FROM:"College - Morehouse", TEAM_LOGO:"./images/nba_nuggets.jpg"}, +{NAME:"Ellis, Joe", ACTIVE:"1966 - 1973", FROM:"College - San Francisco", TEAM_LOGO:"./images/nba_wizards.jpg"}, +{NAME:"Ellis, LaPhonso", ACTIVE:"1992 - 2002", FROM:"College - Notre Dame ''92", TEAM_LOGO:"./images/nba_timberwolves.jpg"}, +{NAME:"Ellis, LeRon", ACTIVE:"1991 - 1995", FROM:"College - Kentucky; Syracuse", TEAM_LOGO:"./images/nba_nuggets.jpg"}, +{NAME:"Ellis, Leroy", ACTIVE:"1962 - 1975", FROM:"College - St. John's (N.Y.)", TEAM_LOGO:"./images/nba_clippers.jpg"}, +{NAME:"Ellis, Maurice H. (Bo)", ACTIVE:"1977 - 1979", FROM:"College - Marquette", TEAM_LOGO:"./images/nba_celtics.jpg"}, +{NAME:"Ellis, Monta", ACTIVE:"ACTIVE", FROM:"High School - Lanier HS (Jackson, MS)", TEAM_LOGO:"./images/nba_lakers.jpg"}, +{NAME:"Ellison, Pervis", ACTIVE:"1989 - 2000", FROM:"College - Louisville", TEAM_LOGO:"./images/nba_pacers.jpg"}, +{NAME:"Elmore, Len", ACTIVE:"1976 - 1983", FROM:"College - Maryland", TEAM_LOGO:"./images/nba_bulls.jpg"}, +{NAME:"Elson, Francisco", ACTIVE:"ACTIVE", FROM:"College - California", TEAM_LOGO:"./images/nba_kings.jpg"}, +{NAME:"Fabel, Joseph (Joe)", ACTIVE:"1946 - 1946", FROM:"College - Pittsburgh", TEAM_LOGO:"./images/nba_knics.jpg"}, +{NAME:"Fairchild, John Russell", ACTIVE:"1965 - 1965", FROM:"College - Palomar Coll. CA (J.C.); Brigham Young", TEAM_LOGO:"./images/nba_trail.jpg"}, +{NAME:"Farbman, Philip M. (Phil)", ACTIVE:"1948 - 1948", FROM:"College - CCNY; Brooklyn College", TEAM_LOGO:"./images/nba_pacers.jpg"}, +{NAME:"Farley, Richard L. (Dick)", ACTIVE:"1954 - 1958", FROM:"College - Indiana", TEAM_LOGO:"./images/nba_pacers.jpg"}, +{NAME:"Farmar, Jordan", ACTIVE:"ACTIVE", FROM:"College - UCLA", TEAM_LOGO:"./images/nba_raptors.jpg"}, +{NAME:"Farmer, Desmon", ACTIVE:"2006 - 2008", FROM:"College - USC", TEAM_LOGO:"./images/nba_sonics.jpg"}, +{NAME:"Farmer, Don Michael (Mike)", ACTIVE:"1958 - 1965", FROM:"College - San Francisco", TEAM_LOGO:"./images/nba_heats.jpg"}, +{NAME:"Farmer, Jim", ACTIVE:"1987 - 1993", FROM:"College - Alabama", TEAM_LOGO:"./images/nba_warriors.jpg"}, +{NAME:"Farmer, Tony", ACTIVE:"1997 - 1999", FROM:"College - Nebraska", TEAM_LOGO:"./images/nba_honets.jpg"}, +{NAME:"Faught, Robert Edward (Bob)", ACTIVE:"1946 - 1946", FROM:"College - Notre Dame", TEAM_LOGO:"./images/nba_sonics.jpg"}, +{NAME:"Favors, Derrick", ACTIVE:"ACTIVE", FROM:"College - Georgia Tech", TEAM_LOGO:"./images/nba_sonics.jpg"}, +{NAME:"Fazekas, Nick", ACTIVE:"2007 - 2007", FROM:"College - Nevada-Reno", TEAM_LOGO:"./images/nba_raptors.jpg"}, +{NAME:"Fedor, Samuel David (Dave)", ACTIVE:"1962 - 1962", FROM:"College - Florida State", TEAM_LOGO:"./images/nba_clippers.jpg"}, +{NAME:"Feerick, Robert Joseph (Bob)", ACTIVE:"1946 - 1949", FROM:"College - Santa Clara", TEAM_LOGO:"./images/nba_pistons.jpg"}, +{NAME:"Feher, Raymond G. (Butch)", ACTIVE:"1976 - 1976", FROM:"College - Vanderbilt", TEAM_LOGO:"./images/nba_nets.jpg"}, +{NAME:"Feick, Jamie", ACTIVE:"1996 - 2000", FROM:"College - Michigan State ''96", TEAM_LOGO:"./images/nba_rockets.jpg"}, +{NAME:"Feiereisel, Ronald E. (Ron)", ACTIVE:"1955 - 1955", FROM:"College - DePaul", TEAM_LOGO:"./images/nba_timberwolves.jpg"}, +{NAME:"Feigenbaum, George", ACTIVE:"1949 - 1952", FROM:"College - Long Island University; Kentucky", TEAM_LOGO:"./images/nba_76ers.jpg"}, +{NAME:"Feitl, Dave", ACTIVE:"1986 - 1991", FROM:"College - Texas-El Paso", TEAM_LOGO:"./images/nba_cavaliers.jpg"}, +{NAME:"Felix, Noel", ACTIVE:"2005 - 2005", FROM:"College - Fresno State", TEAM_LOGO:"./images/nba_hawks.jpg"}, +{NAME:"Felix, Ray", ACTIVE:"1953 - 1961", FROM:"College - Long Island University", TEAM_LOGO:"./images/nba_clippers.jpg"}, +{NAME:"Felton, Raymond", ACTIVE:"ACTIVE", FROM:"College - North Carolina", TEAM_LOGO:"./images/nba_kings.jpg"}, +{NAME:"Fendley, John Phillip (Jake)", ACTIVE:"1951 - 1952", FROM:"College - Northwestern", TEAM_LOGO:"./images/nba_spurs.jpg"}, +{NAME:"Fenley, William Warren (Bill)", ACTIVE:"1946 - 1946", FROM:"College - Manhattan", TEAM_LOGO:"./images/nba_bobcats.jpg"}, +{NAME:"Ferguson, Desmond", ACTIVE:"2003 - 2003", FROM:"College - Detroit", TEAM_LOGO:"./images/nba_jazz.jpg"}, +{NAME:"Fernandez, Rudy", ACTIVE:"ACTIVE", FROM:"From - Palma de Mallorca, Spain", TEAM_LOGO:"./images/nba_spurs.jpg"}, +{NAME:"Fernsten, Eric", ACTIVE:"1975 - 1983", FROM:"College - San Francisco", TEAM_LOGO:"./images/nba_spurs.jpg"}, +{NAME:"Ferrari, Albert R. (Al)", ACTIVE:"1955 - 1962", FROM:"College - Michigan State", TEAM_LOGO:"./images/nba_jazz.jpg"}, +{NAME:"Ferreira, Rolando", ACTIVE:"1988 - 1988", FROM:"College - Houston", TEAM_LOGO:"./images/nba_jazz.jpg"}, +{NAME:"Ferrell, Duane", ACTIVE:"1988 - 1998", FROM:"College - Georgia Tech", TEAM_LOGO:"./images/nba_cavaliers.jpg"}, +{NAME:"Ferrin, C. Arnold Jr. (Arnie)", ACTIVE:"1948 - 1950", FROM:"College - Utah", TEAM_LOGO:"./images/nba_nets.jpg"}, +{NAME:"Ferry, Danny", ACTIVE:"1990 - 2002", FROM:"College - Duke ''89", TEAM_LOGO:"./images/nba_raptors.jpg"}, +{NAME:"Ferry, Robert Dean (Bob)", ACTIVE:"1959 - 1968", FROM:"College - St. Louis", TEAM_LOGO:"./images/nba_nuggets.jpg"}, +{NAME:"Fesenko, Kyrylo", ACTIVE:"ACTIVE", FROM:"From - Dnepropetrovsk, Ukraine", TEAM_LOGO:"./images/nba_warriors.jpg"}, +{NAME:"Fields, Kenny", ACTIVE:"1984 - 1987", FROM:"College - UCLA", TEAM_LOGO:"./images/nba_pacers.jpg"}, +{NAME:"Fields, Landry", ACTIVE:"ACTIVE", FROM:"College - Stanford", TEAM_LOGO:"./images/nba_knics.jpg"}, +{NAME:"Filipek, Ronald Stanley (Ron)", ACTIVE:"1967 - 1967", FROM:"College - Tennessee Tech", TEAM_LOGO:"./images/nba_suns.jpg"}, +{NAME:"Fillmore, Gregory Paul (Greg)", ACTIVE:"1970 - 1971", FROM:"College - Iowa Central CC; Cheyney", TEAM_LOGO:"./images/nba_bulls.jpg"}, +{NAME:"Finkel, Henry J. (Hank)", ACTIVE:"1966 - 1974", FROM:"College - St. Peter's; Dayton", TEAM_LOGO:"./images/nba_celtics.jpg"}, +{NAME:"Finley, Michael", ACTIVE:"2007 - 2009", FROM:"College - Wisconsin", TEAM_LOGO:"./images/nba_pistons.jpg"}, +{NAME:"Finn, Daniel Lawrence Jr. (Danny)", ACTIVE:"1952 - 1954", FROM:"College - St. John's (N.Y.)", TEAM_LOGO:"./images/nba_knics.jpg"}, +{NAME:"Fish, Matt", ACTIVE:"1994 - 1996", FROM:"College - Wilmington", TEAM_LOGO:"./images/nba_nets.jpg"}, +{NAME:"Fisher, Derek", ACTIVE:"ACTIVE", FROM:"College - Arkansas-Little Rock", TEAM_LOGO:"./images/nba_honets.jpg"}, +{NAME:"Fitch, Gerald", ACTIVE:"2005 - 2005", FROM:"College - Kentucky", TEAM_LOGO:"./images/nba_raptors.jpg"}, +{NAME:"Fitzgerald, Richard (Dick)", ACTIVE:"1946 - 1947", FROM:"College - Seton Hall", TEAM_LOGO:"./images/nba_knics.jpg"}, +{NAME:"Fitzgerald, Robert (Bob)", ACTIVE:"1946 - 1948", FROM:"College - Fordham", TEAM_LOGO:"./images/nba_clippers.jpg"}, +{NAME:"Fizer, Marcus", ACTIVE:"2000 - 2005", FROM:"College - Iowa State", TEAM_LOGO:"./images/nba_pacers.jpg"}, +{NAME:"Fleishman, Jerome (Jerry)", ACTIVE:"1946 - 1952", FROM:"College - N.Y.U.; Long Island University", TEAM_LOGO:"./images/nba_celtics.jpg"}, +{NAME:"Fleming, Albert Jr. (Al)", ACTIVE:"1977 - 1977", FROM:"College - Arizona", TEAM_LOGO:"./images/nba_heats.jpg"}, +{NAME:"Fleming, Edward R. (Ed)", ACTIVE:"1955 - 1959", FROM:"College - Niagara", TEAM_LOGO:"./images/nba_timberwolves.jpg"}, +{NAME:"Gabor, William A. (Billy, The Human Projectile)", ACTIVE:"1949 - 1954", FROM:"College - Syracuse", TEAM_LOGO:"./images/nba_cavaliers.jpg"}, +{NAME:"Gadzuric, Dan", ACTIVE:"ACTIVE", FROM:"College - UCLA", TEAM_LOGO:"./images/nba_pistons.jpg"}, +{NAME:"Gai, Deng", ACTIVE:"2005 - 2005", FROM:"College - Fairfield", TEAM_LOGO:"./images/nba_cavaliers.jpg"}, +{NAME:"Gainer, Elmer R.", ACTIVE:"1947 - 1949", FROM:"College - DePaul", TEAM_LOGO:"./images/nba_pacers.jpg"}, +{NAME:"Gaines, Corey", ACTIVE:"1988 - 1994", FROM:"College - UCLA; Loyola Marymount", TEAM_LOGO:"./images/nba_honets.jpg"}, +{NAME:"Gaines, Reece", ACTIVE:"2003 - 2005", FROM:"College - Louisville", TEAM_LOGO:"./images/nba_bulls.jpg"}, +{NAME:"Gaines, Sundiata", ACTIVE:"ACTIVE", FROM:"College - Georgia", TEAM_LOGO:"./images/nba_bucks.jpg"}, +{NAME:"Gale, Mike", ACTIVE:"1976 - 1981", FROM:"College - Elizabeth City State", TEAM_LOGO:"./images/nba_76ers.jpg"}, +{NAME:"Gallagher, Chad", ACTIVE:"1993 - 1993", FROM:"College - Creighton", TEAM_LOGO:"./images/nba_nets.jpg"}, +{NAME:"Gallatin, Harry", ACTIVE:"1948 - 1957", FROM:"College - Northeast Missouri State", TEAM_LOGO:"./images/nba_timberwolves.jpg"}, +{NAME:"Gallinari, Danilo", ACTIVE:"ACTIVE", FROM:"From - Milan, Italy", TEAM_LOGO:"./images/nba_warriors.jpg"}, +{NAME:"Gambee, Dave", ACTIVE:"1958 - 1969", FROM:"College - Oregon State", TEAM_LOGO:"./images/nba_honets.jpg"}, +{NAME:"Gamble, Kevin", ACTIVE:"1987 - 1996", FROM:"College - Lincoln Trail IL (J.C.); Iowa", TEAM_LOGO:"./images/nba_bucks.jpg"}, +{NAME:"Gantt, Robert M. Jr. (Bob)", ACTIVE:"1946 - 1946", FROM:"College - Duke", TEAM_LOGO:"./images/nba_bulls.jpg"}, +{NAME:"Garbajosa, Jorge", ACTIVE:"2007 - 2007", FROM:"From - Spain", TEAM_LOGO:"./images/nba_mavericks.jpg"}, +{NAME:"Garces, Ruben", ACTIVE:"2000 - 2000", FROM:"College - Providence", TEAM_LOGO:"./images/nba_rockets.jpg"}, +{NAME:"Garcia, Alex", ACTIVE:"2003 - 2004", FROM:"From - Brazil", TEAM_LOGO:"./images/nba_bulls.jpg"}, +{NAME:"Garcia, Francisco", ACTIVE:"ACTIVE", FROM:"College - Louisville", TEAM_LOGO:"./images/nba_mavericks.jpg"}, +{NAME:"Gardner, Earl Baker (Red)", ACTIVE:"1948 - 1948", FROM:"College - Wabash; DePauw", TEAM_LOGO:"./images/nba_bulls.jpg"}, +{NAME:"Gardner, Thomas", ACTIVE:"2007 - 2008", FROM:"College - Missouri", TEAM_LOGO:"./images/nba_bulls.jpg"}, +{NAME:"Gardner, Vern B.", ACTIVE:"1949 - 1951", FROM:"College - Wyoming; Utah", TEAM_LOGO:"./images/nba_suns.jpg"}, +{NAME:"Garfinkel, Jack (Dutch)", ACTIVE:"1946 - 1948", FROM:"College - St. John's (N.Y.)", TEAM_LOGO:"./images/nba_knics.jpg"}, +{NAME:"Garland, Gary J.", ACTIVE:"1979 - 1979", FROM:"College - DePaul", TEAM_LOGO:"./images/nba_sonics.jpg"}, +{NAME:"Garland, Winston", ACTIVE:"1987 - 1994", FROM:"College - Southeastern CC IA; Southwest Missouri State", TEAM_LOGO:"./images/nba_warriors.jpg"}, +{NAME:"Garmaker, Richard Eugene (Dick)", ACTIVE:"1955 - 1960", FROM:"College - Hibbing CC MN; Minnesota", TEAM_LOGO:"./images/nba_cavaliers.jpg"}, +{NAME:"Garner, Chris", ACTIVE:"1997 - 2000", FROM:"College - Memphis", TEAM_LOGO:"./images/nba_celtics.jpg"}, +{NAME:"Garnett, Bill", ACTIVE:"1982 - 1985", FROM:"College - Wyoming", TEAM_LOGO:"./images/nba_lakers.jpg"}, +{NAME:"Garnett, Kevin", ACTIVE:"ACTIVE", FROM:"High School - Farragut Academy HS (IL)", TEAM_LOGO:"./images/nba_warriors.jpg"}, +{NAME:"Garnett, Marlon", ACTIVE:"1998 - 1998", FROM:"College - Santa Clara", TEAM_LOGO:"./images/nba_heats.jpg"}, +{NAME:"Garrett, Calvin", ACTIVE:"1980 - 1983", FROM:"College - Austin Peay State; Oral Roberts", TEAM_LOGO:"./images/nba_rockets.jpg"}, +{NAME:"Garrett, Dean", ACTIVE:"1996 - 2001", FROM:"College - Indiana", TEAM_LOGO:"./images/nba_kings.jpg"}, +{NAME:"Garrett, Eldo (Dick)", ACTIVE:"1969 - 1973", FROM:"College - Southern Illinois", TEAM_LOGO:"./images/nba_cavaliers.jpg"}, +{NAME:"Garrett, Rowland G.", ACTIVE:"1972 - 1976", FROM:"College - Florida State", TEAM_LOGO:"./images/nba_hawks.jpg"}, +{NAME:"Garrick, Tom", ACTIVE:"1988 - 1991", FROM:"College - Rhode Island", TEAM_LOGO:"./images/nba_bucks.jpg"}, +{NAME:"Garris, John", ACTIVE:"1983 - 1983", FROM:"College - Michigan; Boston College", TEAM_LOGO:"./images/nba_griz.jpg"}, +{NAME:"Garris, Kiwane", ACTIVE:"1997 - 1999", FROM:"College - Illinois", TEAM_LOGO:"./images/nba_celtics.jpg"}, +{NAME:"Garrity, Pat", ACTIVE:"2007 - 2007", FROM:"College - Notre Dame", TEAM_LOGO:"./images/nba_warriors.jpg"}, +{NAME:"Garvin, James D. (Jim)", ACTIVE:"1973 - 1973", FROM:"College - Boston U.", TEAM_LOGO:"./images/nba_suns.jpg"}, +{NAME:"Gasol, Marc", ACTIVE:"ACTIVE", FROM:"From - Barcelona, Spain", TEAM_LOGO:"./images/nba_bucks.jpg"}, +{NAME:"Gasol, Pau", ACTIVE:"ACTIVE", FROM:"From - Barcelona, Spain", TEAM_LOGO:"./images/nba_suns.jpg"}, +{NAME:"Gates, Ben Frank (Frank, Needle)", ACTIVE:"1949 - 1949", FROM:"College - Sam Houston State", TEAM_LOGO:"./images/nba_wizards.jpg"}, +{NAME:"Gatling, Chris", ACTIVE:"1991 - 2001", FROM:"College - Pittsburgh; Old Dominion", TEAM_LOGO:"./images/nba_warriors.jpg"}, +{NAME:"Gattison, Kenny", ACTIVE:"1986 - 1995", FROM:"College - Old Dominion", TEAM_LOGO:"./images/nba_wizards.jpg"}, +{NAME:"Gay, Rudy", ACTIVE:"ACTIVE", FROM:"College - Connecticut", TEAM_LOGO:"./images/nba_bobcats.jpg"}, +{NAME:"Gayda, Edward C. (Ed)", ACTIVE:"1950 - 1950", FROM:"College - Washington State", TEAM_LOGO:"./images/nba_mavericks.jpg"}, +{NAME:"Gaze, Andrew", ACTIVE:"1993 - 1998", FROM:"College - Seton Hall", TEAM_LOGO:"./images/nba_warriors.jpg"}, +{NAME:"Geary, Reggie", ACTIVE:"1996 - 1997", FROM:"College - Arizona", TEAM_LOGO:"./images/nba_heats.jpg"}, +{NAME:"Gee, Alonzo", ACTIVE:"ACTIVE", FROM:"College - Alabama", TEAM_LOGO:"./images/nba_nuggets.jpg"}, +{NAME:"Geiger, Matt", ACTIVE:"1992 - 2001", FROM:"College - Auburn; Georgia Tech", TEAM_LOGO:"./images/nba_bucks.jpg"}, +{NAME:"Gelabale, Mickael", ACTIVE:"2007 - 2007", FROM:"From - France", TEAM_LOGO:"./images/nba_rockets.jpg"}, +{NAME:"Hackett, Rudolph (Rudy)", ACTIVE:"1976 - 1976", FROM:"College - Syracuse", TEAM_LOGO:"./images/nba_jazz.jpg"}, +{NAME:"Haddadi, Hamed", ACTIVE:"ACTIVE", FROM:"From - Ahvaz, Iran", TEAM_LOGO:"./images/nba_cavaliers.jpg"}, +{NAME:"Haffner, Scott", ACTIVE:"1989 - 1990", FROM:"College - Illinois; Evansville", TEAM_LOGO:"./images/nba_heats.jpg"}, +{NAME:"Hagan, Cliff", ACTIVE:"1956 - 1965", FROM:"College - Kentucky", TEAM_LOGO:"./images/nba_cavaliers.jpg"}, +{NAME:"Hagan, Glenn Kassabin", ACTIVE:"1981 - 1981", FROM:"College - St. Bonaventure", TEAM_LOGO:"./images/nba_pistons.jpg"}, +{NAME:"Hahn, Robert B. (Bob)", ACTIVE:"1949 - 1949", FROM:"College - North Carolina State", TEAM_LOGO:"./images/nba_cavaliers.jpg"}, +{NAME:"Hairston, Alan Leroy (Al)", ACTIVE:"1968 - 1969", FROM:"College - St. Clair Co. CC MI; Bowling Green State", TEAM_LOGO:"./images/nba_timberwolves.jpg"}, +{NAME:"Hairston, Happy", ACTIVE:"1964 - 1974", FROM:"College - N.Y.U.", TEAM_LOGO:"./images/nba_magics.jpg"}, +{NAME:"Hairston, Lindsay (Spider)", ACTIVE:"1975 - 1975", FROM:"College - Michigan State", TEAM_LOGO:"./images/nba_pistons.jpg"}, +{NAME:"Hairston, Malik", ACTIVE:"2008 - 2009", FROM:"College - Oregon", TEAM_LOGO:"./images/nba_wizards.jpg"}, +{NAME:"Haislip, Marcus", ACTIVE:"2002 - 2009", FROM:"College - Tennessee", TEAM_LOGO:"./images/nba_pistons.jpg"}, +{NAME:"Halbert, Charles P. (Chuck)", ACTIVE:"1946 - 1950", FROM:"College - West Texas A&M", TEAM_LOGO:"./images/nba_bucks.jpg"}, +{NAME:"Halbrook, Harvey Wade (Swede)", ACTIVE:"1960 - 1961", FROM:"College - Oregon State", TEAM_LOGO:"./images/nba_pacers.jpg"}, +{NAME:"Hale, William Bruce (Bruce)", ACTIVE:"1948 - 1950", FROM:"College - Santa Clara", TEAM_LOGO:"./images/nba_bulls.jpg"}, +{NAME:"Haley, Jack", ACTIVE:"1988 - 1997", FROM:"College - Golden West Coll. CA (J.C.); UCLA", TEAM_LOGO:"./images/nba_jazz.jpg"}, +{NAME:"Halimon, Shaler Jr.", ACTIVE:"1968 - 1971", FROM:"College - Imperial Valley Coll. CA (J.C.); Utah State", TEAM_LOGO:"./images/nba_timberwolves.jpg"}, +{NAME:"Hall, Mike", ACTIVE:"2006 - 2006", FROM:"College - George Washington", TEAM_LOGO:"./images/nba_hawks.jpg"}, +{NAME:"Halliburton, Jeffrey (Jeff)", ACTIVE:"1971 - 1972", FROM:"College - San Jacinto Coll. TX (J.C.); Drake", TEAM_LOGO:"./images/nba_spurs.jpg"}, +{NAME:"Ham, Darvin", ACTIVE:"1996 - 2004", FROM:"College - Texas Tech", TEAM_LOGO:"./images/nba_clippers.jpg"}, +{NAME:"Hamer, Steve", ACTIVE:"1996 - 1996", FROM:"College - Tennessee", TEAM_LOGO:"./images/nba_kings.jpg"}, +{NAME:"Hamilton, Dale B.", ACTIVE:"1949 - 1949", FROM:"College - Franklin (Ind.)", TEAM_LOGO:"./images/nba_jazz.jpg"}, +{NAME:"Hamilton, Dennis Eugene", ACTIVE:"1967 - 1968", FROM:"College - Arizona State", TEAM_LOGO:"./images/nba_pistons.jpg"}, +{NAME:"Hamilton, Ralph Albert (Ham)", ACTIVE:"1948 - 1948", FROM:"College - Indiana", TEAM_LOGO:"./images/nba_bobcats.jpg"}, +{NAME:"Hamilton, Richard", ACTIVE:"ACTIVE", FROM:"College - Connecticut", TEAM_LOGO:"./images/nba_bulls.jpg"}, +{NAME:"Hamilton, Roy Lee", ACTIVE:"1979 - 1980", FROM:"College - UCLA", TEAM_LOGO:"./images/nba_timberwolves.jpg"}, +{NAME:"Hamilton, Steve Absher", ACTIVE:"1958 - 1959", FROM:"College - Purdue; Morehead State", TEAM_LOGO:"./images/nba_magics.jpg"}, +{NAME:"Hamilton, Tang", ACTIVE:"2001 - 2001", FROM:"College - Mississippi State ''01", TEAM_LOGO:"./images/nba_mavericks.jpg"}, +{NAME:"Hamilton, Thomas", ACTIVE:"1995 - 1999", FROM:"College - No College", TEAM_LOGO:"./images/nba_wizards.jpg"}, +{NAME:"Hamilton, Zendon", ACTIVE:"2000 - 2005", FROM:"College - St. John's", TEAM_LOGO:"./images/nba_bobcats.jpg"}, +{NAME:"Hammink, Geert", ACTIVE:"1993 - 1995", FROM:"College - Louisiana State", TEAM_LOGO:"./images/nba_bucks.jpg"}, +{NAME:"Hammonds, Tom", ACTIVE:"1989 - 2000", FROM:"College - Georgia Tech", TEAM_LOGO:"./images/nba_bobcats.jpg"}, +{NAME:"Hancock, Darrin", ACTIVE:"1994 - 1996", FROM:"College - Garden City CC KS; Kansas", TEAM_LOGO:"./images/nba_suns.jpg"}, +{NAME:"Handlogten, Ben", ACTIVE:"2003 - 2004", FROM:"College - Western Michigan", TEAM_LOGO:"./images/nba_honets.jpg"}, +{NAME:"Hankins, Cecil O.", ACTIVE:"1946 - 1947", FROM:"College - Oklahoma State", TEAM_LOGO:"./images/nba_trail.jpg"}, +{NAME:"Hankinson, Phil", ACTIVE:"1973 - 1974", FROM:"College - Pennsylvania", TEAM_LOGO:"./images/nba_sonics.jpg"}, +{NAME:"Hannum, Alexander Murray (Alex)", ACTIVE:"1949 - 1956", FROM:"College - USC", TEAM_LOGO:"./images/nba_heats.jpg"}, +{NAME:"Hanrahan, Donald (Don)", ACTIVE:"1952 - 1952", FROM:"College - Loyola (Chicago)", TEAM_LOGO:"./images/nba_bobcats.jpg"}, +{NAME:"Hans, Rollen F. (Rolly)", ACTIVE:"1953 - 1954", FROM:"College - Los Angeles City Coll. CA (J.C.); Long Island University", TEAM_LOGO:"./images/nba_wizards.jpg"}, +{NAME:"Hansbrough, Tyler", ACTIVE:"ACTIVE", FROM:"College - North Carolina", TEAM_LOGO:"./images/nba_pistons.jpg"}, +{NAME:"Hansen, Bob", ACTIVE:"1983 - 1991", FROM:"College - Iowa", TEAM_LOGO:"./images/nba_honets.jpg"}, +{NAME:"Hansen, Glenn R.", ACTIVE:"1975 - 1977", FROM:"College - Utah State; Louisiana State", TEAM_LOGO:"./images/nba_griz.jpg"}, +{NAME:"Hansen, Lars", ACTIVE:"1978 - 1978", FROM:"College - Washington", TEAM_LOGO:"./images/nba_nets.jpg"}, +{NAME:"Hansen, Travis", ACTIVE:"2003 - 2003", FROM:"College - Brigham Young", TEAM_LOGO:"./images/nba_suns.jpg"}, +{NAME:"Hanson, Reggie", ACTIVE:"1997 - 1997", FROM:"College - Kentucky", TEAM_LOGO:"./images/nba_cavaliers.jpg"}, +{NAME:"Hanzlik, Bill", ACTIVE:"1980 - 1989", FROM:"College - Notre Dame", TEAM_LOGO:"./images/nba_celtics.jpg"}, +{NAME:"Harangody, Luke", ACTIVE:"ACTIVE", FROM:"College - Notre Dame", TEAM_LOGO:"./images/nba_timberwolves.jpg"}, +{NAME:"Hardaway, Anfernee", ACTIVE:"2007 - 2007", FROM:"College - Memphis", TEAM_LOGO:"./images/nba_76ers.jpg"}, +{NAME:"Hardaway, Tim", ACTIVE:"1989 - 2002", FROM:"College - Texas-El Paso ''89", TEAM_LOGO:"./images/nba_suns.jpg"}, +{NAME:"Harden, James", ACTIVE:"ACTIVE", FROM:"College - Arizona State", TEAM_LOGO:"./images/nba_jazz.jpg"}, +{NAME:"Harding, Reginald (Reggie)", ACTIVE:"1963 - 1967", FROM:"College - No College", TEAM_LOGO:"./images/nba_sonics.jpg"}, +{NAME:"Iavaroni, Marc", ACTIVE:"1982 - 1988", FROM:"College - Virginia", TEAM_LOGO:"./images/nba_suns.jpg"}, +{NAME:"Ibaka, Serge", ACTIVE:"ACTIVE", FROM:"From - Brazzaville, Republic of Congo", TEAM_LOGO:"./images/nba_honets.jpg"}, +{NAME:"Iguodala, Andre", ACTIVE:"ACTIVE", FROM:"College - Arizona", TEAM_LOGO:"./images/nba_nets.jpg"}, +{NAME:"Ilgauskas, Zydrunas", ACTIVE:"ACTIVE", FROM:"From - Kaunas, Lithuania", TEAM_LOGO:"./images/nba_nets.jpg"}, +{NAME:"Ilic, Mile", ACTIVE:"2006 - 2006", FROM:"From - Serbia & Montenegro", TEAM_LOGO:"./images/nba_hawks.jpg"}, +{NAME:"Ilunga-Mbenga, Didier", ACTIVE:"ACTIVE", FROM:"From - Kinshasa, DRC", TEAM_LOGO:"./images/nba_clippers.jpg"}, +{NAME:"Ilyasova, Ersan", ACTIVE:"ACTIVE", FROM:"From - Eskisehir, Turkey", TEAM_LOGO:"./images/nba_rockets.jpg"}, +{NAME:"Imhoff, Darrall Tucker (Big D)", ACTIVE:"1960 - 1971", FROM:"College - California", TEAM_LOGO:"./images/nba_sonics.jpg"}, +{NAME:"Ingelsby, Tom", ACTIVE:"1973 - 1973", FROM:"College - Villanova", TEAM_LOGO:"./images/nba_honets.jpg"}, +{NAME:"Ingram, Joel McCoy (McCoy)", ACTIVE:"1957 - 1957", FROM:"College - Jackson State", TEAM_LOGO:"./images/nba_cavaliers.jpg"}, +{NAME:"Irvin, Byron", ACTIVE:"1989 - 1992", FROM:"College - Arkansas; Missouri", TEAM_LOGO:"./images/nba_nets.jpg"}, +{NAME:"Issel, Dan", ACTIVE:"1976 - 1984", FROM:"College - Kentucky", TEAM_LOGO:"./images/nba_knics.jpg"}, +{NAME:"Iuzzolino, Mike", ACTIVE:"1991 - 1992", FROM:"College - Penn State; St. Francis (PA)", TEAM_LOGO:"./images/nba_heats.jpg"}, +{NAME:"Iverson, Allen", ACTIVE:"2007 - 2009", FROM:"College - Georgetown", TEAM_LOGO:"./images/nba_knics.jpg"}, +{NAME:"Ivey, Royal", ACTIVE:"ACTIVE", FROM:"College - Texas", TEAM_LOGO:"./images/nba_jazz.jpg"}, +{NAME:"Jack, Jarrett", ACTIVE:"ACTIVE", FROM:"College - Georgia Tech", TEAM_LOGO:"./images/nba_bobcats.jpg"}, +{NAME:"Jackson, Alvin (Al)", ACTIVE:"1967 - 1967", FROM:"College - Wilberforce", TEAM_LOGO:"./images/nba_trail.jpg"}, +{NAME:"Jackson, Anthony Eugene (Tony)", ACTIVE:"1980 - 1980", FROM:"College - Florida State", TEAM_LOGO:"./images/nba_hawks.jpg"}, +{NAME:"Jackson, Bobby", ACTIVE:"2007 - 2008", FROM:"College - Minnesota", TEAM_LOGO:"./images/nba_timberwolves.jpg"}, +{NAME:"Jackson, Cedric", ACTIVE:"2009 - 2009", FROM:"College - Cleveland State", TEAM_LOGO:"./images/nba_lakers.jpg"}, +{NAME:"Jackson, Darnell", ACTIVE:"ACTIVE", FROM:"College - Kansas", TEAM_LOGO:"./images/nba_warriors.jpg"}, +{NAME:"Jackson, Gregory (Greg)", ACTIVE:"1974 - 1974", FROM:"College - Guilford", TEAM_LOGO:"./images/nba_pacers.jpg"}, +{NAME:"Jackson, Jaren", ACTIVE:"1989 - 2001", FROM:"College - Georgetown", TEAM_LOGO:"./images/nba_heats.jpg"}, +{NAME:"Jackson, Jermaine", ACTIVE:"1999 - 2005", FROM:"College - Detroit", TEAM_LOGO:"./images/nba_trail.jpg"}, +{NAME:"Jackson, Jim", ACTIVE:"1992 - 2005", FROM:"College - Ohio State", TEAM_LOGO:"./images/nba_pacers.jpg"}, +{NAME:"Jackson, Lucious B. (Luke)", ACTIVE:"1964 - 1971", FROM:"College - Quincy; Texas Southern; Texas-Pan American", TEAM_LOGO:"./images/nba_mavericks.jpg"}, +{NAME:"Jackson, Luke", ACTIVE:"2007 - 2007", FROM:"College - Oregon", TEAM_LOGO:"./images/nba_cavaliers.jpg"}, +{NAME:"Jackson, Marc", ACTIVE:"2000 - 2006", FROM:"College - Temple", TEAM_LOGO:"./images/nba_pacers.jpg"}, +{NAME:"Jackson, Mark", ACTIVE:"1987 - 2003", FROM:"College - St. John''s (N.Y.) '87", TEAM_LOGO:"./images/nba_bucks.jpg"}, +{NAME:"Jackson, Michael", ACTIVE:"1987 - 1989", FROM:"College - Georgetown", TEAM_LOGO:"./images/nba_pacers.jpg"}, +{NAME:"Jackson, Myron", ACTIVE:"1986 - 1986", FROM:"College - Arkansas-Little Rock", TEAM_LOGO:"./images/nba_honets.jpg"}, +{NAME:"Jackson, Philip D. (Phil, Action)", ACTIVE:"1967 - 1979", FROM:"College - North Dakota", TEAM_LOGO:"./images/nba_trail.jpg"}, +{NAME:"Jackson, Ralph A. III", ACTIVE:"1984 - 1984", FROM:"College - UCLA", TEAM_LOGO:"./images/nba_nets.jpg"}, +{NAME:"Jackson, Randell", ACTIVE:"1998 - 1999", FROM:"College - Florida State", TEAM_LOGO:"./images/nba_pacers.jpg"}, +{NAME:"Jackson, Stanley", ACTIVE:"1993 - 1993", FROM:"College - Alabama-Birmingham", TEAM_LOGO:"./images/nba_griz.jpg"}, +{NAME:"Jackson, Stephen", ACTIVE:"ACTIVE", FROM:"High School - Oak Hill Academy (Mouth of Wilson, VA)", TEAM_LOGO:"./images/nba_jazz.jpg"}, +{NAME:"Jackson, Tracy", ACTIVE:"1981 - 1983", FROM:"College - Notre Dame", TEAM_LOGO:"./images/nba_jazz.jpg"}, +{NAME:"Jackson, Wardell", ACTIVE:"1974 - 1974", FROM:"College - Ohio State", TEAM_LOGO:"./images/nba_heats.jpg"}, +{NAME:"Jacobs, Winfred O. (Fred)", ACTIVE:"1946 - 1946", FROM:"College - Denver", TEAM_LOGO:"./images/nba_bobcats.jpg"}, +{NAME:"Jacobsen, Casey", ACTIVE:"2007 - 2007", FROM:"College - Stanford", TEAM_LOGO:"./images/nba_celtics.jpg"}, +{NAME:"Jacobson, Sam", ACTIVE:"1998 - 2000", FROM:"College - Minnesota", TEAM_LOGO:"./images/nba_sonics.jpg"}, +{NAME:"Jamerson, Dave", ACTIVE:"1990 - 1993", FROM:"College - Ohio U.", TEAM_LOGO:"./images/nba_cavaliers.jpg"}, +{NAME:"James, Aaron (A.J.)", ACTIVE:"1974 - 1978", FROM:"College - Grambling State", TEAM_LOGO:"./images/nba_rockets.jpg"}, +{NAME:"James, Damion", ACTIVE:"ACTIVE", FROM:"College - Texas", TEAM_LOGO:"./images/nba_pistons.jpg"}, +{NAME:"James, Harold Gene (Gene, Goose)", ACTIVE:"1948 - 1950", FROM:"College - Marshall", TEAM_LOGO:"./images/nba_pistons.jpg"}, +{NAME:"James, Henry", ACTIVE:"1990 - 1997", FROM:"College - South Plains Coll. TX (J.C.); St. Mary's (Tex.)", TEAM_LOGO:"./images/nba_knics.jpg"}, +{NAME:"James, Jerome", ACTIVE:"2007 - 2008", FROM:"College - Florida A&M", TEAM_LOGO:"./images/nba_bucks.jpg"}, +{NAME:"James, LeBron", ACTIVE:"ACTIVE", FROM:"High School - St. Vincent-St. Mary HS (OH)", TEAM_LOGO:"./images/nba_honets.jpg"}, +{NAME:"James, Mike", ACTIVE:"2007 - 2009", FROM:"College - Duquesne", TEAM_LOGO:"./images/nba_76ers.jpg"}, +{NAME:"James, Tim", ACTIVE:"1999 - 2001", FROM:"College - Miami (Fla.) ''99", TEAM_LOGO:"./images/nba_bobcats.jpg"}, +{NAME:"Jamison, Antawn", ACTIVE:"ACTIVE", FROM:"College - North Carolina", TEAM_LOGO:"./images/nba_heats.jpg"}, +{NAME:"Jamison, Harold", ACTIVE:"1999 - 2001", FROM:"College - Clemson ''99", TEAM_LOGO:"./images/nba_cavaliers.jpg"}, +{NAME:"Janisch, John Albert", ACTIVE:"1946 - 1947", FROM:"College - Valparaiso", TEAM_LOGO:"./images/nba_nets.jpg"}, +{NAME:"Janotta, Howard (Howie)", ACTIVE:"1949 - 1949", FROM:"College - Seton Hall", TEAM_LOGO:"./images/nba_spurs.jpg"}, +{NAME:"Jaric, Marko", ACTIVE:"2007 - 2008", FROM:"From - Belgrade, Serbia", TEAM_LOGO:"./images/nba_warriors.jpg"}, +{NAME:"Jaros, Anthony Joseph (Tony)", ACTIVE:"1946 - 1950", FROM:"College - Minnesota", TEAM_LOGO:"./images/nba_celtics.jpg"}, +{NAME:"Jasikevicius, Sarunas", ACTIVE:"2005 - 2006", FROM:"College - Maryland", TEAM_LOGO:"./images/nba_nets.jpg"}, +{NAME:"Jawai, Nathan", ACTIVE:"2008 - 2009", FROM:"From - Australia", TEAM_LOGO:"./images/nba_wizards.jpg"}, +{NAME:"Jeannette, Harry Edward (Buddy)", ACTIVE:"1947 - 1949", FROM:"College - Washington & Jefferson", TEAM_LOGO:"./images/nba_clippers.jpg"}, +{NAME:"Jeelani, Abdul Qadir (formerly Gary Cole)", ACTIVE:"1979 - 1980", FROM:"College - Wis.-Parkside", TEAM_LOGO:"./images/nba_sonics.jpg"}, +{NAME:"Jefferies, Chris", ACTIVE:"2002 - 2003", FROM:"College - Fresno State ''03", TEAM_LOGO:"./images/nba_knics.jpg"}, +{NAME:"Jeffers, Othyus", ACTIVE:"ACTIVE", FROM:"College - Robert Morris (Ill.)", TEAM_LOGO:"./images/nba_nuggets.jpg"}, +{NAME:"Jefferson, Al", ACTIVE:"ACTIVE", FROM:"High School - Prentiss HS (MS)", TEAM_LOGO:"./images/nba_celtics.jpg"}, +{NAME:"Jefferson, Dontell", ACTIVE:"2008 - 2008", FROM:"College - Arkansas", TEAM_LOGO:"./images/nba_honets.jpg"}, +{NAME:"Jefferson, Richard", ACTIVE:"ACTIVE", FROM:"College - Arizona", TEAM_LOGO:"./images/nba_kings.jpg"}, +{NAME:"Kachan, Edwin John (Whitey)", ACTIVE:"1948 - 1948", FROM:"College - DePaul", TEAM_LOGO:"./images/nba_heats.jpg"}, +{NAME:"Kaftan, George A. (The Golden Greek)", ACTIVE:"1948 - 1952", FROM:"College - Holy Cross", TEAM_LOGO:"./images/nba_suns.jpg"}, +{NAME:"Kalafat, Edward L. (Ed)", ACTIVE:"1954 - 1956", FROM:"College - Minnesota", TEAM_LOGO:"./images/nba_pistons.jpg"}, +{NAME:"Kaman, Chris", ACTIVE:"ACTIVE", FROM:"College - Central Michigan", TEAM_LOGO:"./images/nba_76ers.jpg"}, +{NAME:"Kaplowitz, Ralph (Kappy)", ACTIVE:"1946 - 1947", FROM:"College - N.Y.U.", TEAM_LOGO:"./images/nba_celtics.jpg"}, +{NAME:"Kapono, Jason", ACTIVE:"ACTIVE", FROM:"College - UCLA", TEAM_LOGO:"./images/nba_clippers.jpg"}, +{NAME:"Kappen, Anthony George (Tony)", ACTIVE:"1946 - 1946", FROM:"College - No College", TEAM_LOGO:"./images/nba_mavericks.jpg"}, +{NAME:"Karl, Coby", ACTIVE:"2007 - 2009", FROM:"College - Boise State", TEAM_LOGO:"./images/nba_bulls.jpg"}, +{NAME:"Karl, George Matthew", ACTIVE:"1976 - 1977", FROM:"College - North Carolina", TEAM_LOGO:"./images/nba_griz.jpg"}, +{NAME:"Kasid, Edward (Ed)", ACTIVE:"1946 - 1946", FROM:"College - No College", TEAM_LOGO:"./images/nba_griz.jpg"}, +{NAME:"Kasun, Mario", ACTIVE:"2004 - 2005", FROM:"From - Croatia", TEAM_LOGO:"./images/nba_cavaliers.jpg"}, +{NAME:"Katkaveck, Leo Frank", ACTIVE:"1948 - 1949", FROM:"College - North Carolina State", TEAM_LOGO:"./images/nba_trail.jpg"}, +{NAME:"Kauffman, Robert (Bob, Horse)", ACTIVE:"1968 - 1974", FROM:"College - Guilford", TEAM_LOGO:"./images/nba_suns.jpg"}, +{NAME:"Kautz, Wilbert (Wibs)", ACTIVE:"1946 - 1946", FROM:"College - Loyola (Chicago)", TEAM_LOGO:"./images/nba_raptors.jpg"}, +{NAME:"Kea, Clarence Leroy", ACTIVE:"1980 - 1981", FROM:"College - Lamar", TEAM_LOGO:"./images/nba_sonics.jpg"}, +{NAME:"Kearns, Michael Joseph", ACTIVE:"1954 - 1954", FROM:"College - Princeton", TEAM_LOGO:"./images/nba_76ers.jpg"}, +{NAME:"Kearns, Thomas Francis Jr. (Tommy)", ACTIVE:"1958 - 1958", FROM:"College - North Carolina", TEAM_LOGO:"./images/nba_pistons.jpg"}, +{NAME:"Keefe, Adam", ACTIVE:"1992 - 2000", FROM:"College - Stanford", TEAM_LOGO:"./images/nba_raptors.jpg"}, +{NAME:"Keeling, Harold A.", ACTIVE:"1985 - 1985", FROM:"College - Santa Clara", TEAM_LOGO:"./images/nba_cavaliers.jpg"}, +{NAME:"Keller, Kenneth W. (Ken)", ACTIVE:"1946 - 1946", FROM:"College - Vermont; St. John's (N.Y.)", TEAM_LOGO:"./images/nba_jazz.jpg"}, +{NAME:"Kelley, Rich", ACTIVE:"1975 - 1985", FROM:"College - Stanford", TEAM_LOGO:"./images/nba_pistons.jpg"}, +{NAME:"Kellogg, Clark", ACTIVE:"1982 - 1986", FROM:"College - Ohio State", TEAM_LOGO:"./images/nba_pistons.jpg"}, +{NAME:"Kelly, Gerard Allan (Jerry)", ACTIVE:"1946 - 1947", FROM:"College - Marshall", TEAM_LOGO:"./images/nba_bucks.jpg"}, +{NAME:"Kelly, Thomas Edward (Tom)", ACTIVE:"1948 - 1948", FROM:"College - N.Y.U.", TEAM_LOGO:"./images/nba_bobcats.jpg"}, +{NAME:"Kelser, Greg", ACTIVE:"1979 - 1984", FROM:"College - Michigan State", TEAM_LOGO:"./images/nba_bobcats.jpg"}, +{NAME:"Kelso, Ben", ACTIVE:"1973 - 1973", FROM:"College - Central Michigan", TEAM_LOGO:"./images/nba_bobcats.jpg"}, +{NAME:"Kemp, Shawn", ACTIVE:"1989 - 2002", FROM:"High School - Concord HS (IN) ''87", TEAM_LOGO:"./images/nba_spurs.jpg"}, +{NAME:"Kempton, Tim", ACTIVE:"1986 - 1997", FROM:"College - Notre Dame", TEAM_LOGO:"./images/nba_cavaliers.jpg"}, +{NAME:"Kendrick, Frank Edward", ACTIVE:"1974 - 1974", FROM:"College - Purdue", TEAM_LOGO:"./images/nba_spurs.jpg"}, +{NAME:"Kennedy, Eugene (Goo)", ACTIVE:"1976 - 1976", FROM:"College - Texas Christian", TEAM_LOGO:"./images/nba_heats.jpg"}, +{NAME:"Kennedy, Joseph A. (Joe)", ACTIVE:"1968 - 1969", FROM:"College - Duke", TEAM_LOGO:"./images/nba_knics.jpg"}, +{NAME:"Kennedy, William F. (Pickles)", ACTIVE:"1960 - 1960", FROM:"College - Temple", TEAM_LOGO:"./images/nba_nets.jpg"}, +{NAME:"Kenon, Larry", ACTIVE:"1976 - 1982", FROM:"College - Amarillo Coll. TX (J.C.); Memphis", TEAM_LOGO:"./images/nba_hawks.jpg"}, +{NAME:"Kenville, William McGill (Billy, The Kid)", ACTIVE:"1953 - 1959", FROM:"College - St. Bonaventure", TEAM_LOGO:"./images/nba_sonics.jpg"}, +{NAME:"Kerner, Jonathan", ACTIVE:"1998 - 1998", FROM:"College - East Carolina ''97", TEAM_LOGO:"./images/nba_raptors.jpg"}, +{NAME:"Kerr, Johnny", ACTIVE:"1954 - 1965", FROM:"College - Illinois", TEAM_LOGO:"./images/nba_sonics.jpg"}, +{NAME:"Kerr, Steve", ACTIVE:"1988 - 2002", FROM:"College - Arizona ''88", TEAM_LOGO:"./images/nba_celtics.jpg"}, +{NAME:"Kerris, John E. (Jack)", ACTIVE:"1949 - 1952", FROM:"College - Loyola (Chicago)", TEAM_LOGO:"./images/nba_griz.jpg"}, +{NAME:"Kersey, Jerome", ACTIVE:"1984 - 2000", FROM:"College - Longwood", TEAM_LOGO:"./images/nba_celtics.jpg"}, +{NAME:"Kessler, Alec", ACTIVE:"1990 - 1993", FROM:"College - Georgia", TEAM_LOGO:"./images/nba_honets.jpg"}, +{NAME:"Ketner, Lari", ACTIVE:"1999 - 2000", FROM:"College - Massachusetts", TEAM_LOGO:"./images/nba_pacers.jpg"}, +{NAME:"Keys, Randolph", ACTIVE:"1988 - 1995", FROM:"College - Southern Mississippi", TEAM_LOGO:"./images/nba_griz.jpg"}, +{NAME:"Khryapa, Viktor", ACTIVE:"2007 - 2007", FROM:"From - Russia", TEAM_LOGO:"./images/nba_honets.jpg"}, +{NAME:"Kidd, Jason", ACTIVE:"ACTIVE", FROM:"College - California", TEAM_LOGO:"./images/nba_wizards.jpg"}, +{NAME:"Kidd, Warren", ACTIVE:"1993 - 1993", FROM:"College - Middle Tennessee State", TEAM_LOGO:"./images/nba_nuggets.jpg"}, +{NAME:"Kiffin, Irvin A. Jr.", ACTIVE:"1979 - 1979", FROM:"College - Virginia Union; Oklahoma Baptist", TEAM_LOGO:"./images/nba_hawks.jpg"}, +{NAME:"Kiley, John F. (Jack)", ACTIVE:"1951 - 1952", FROM:"College - Syracuse", TEAM_LOGO:"./images/nba_honets.jpg"}, +{NAME:"Killum, Earnest (Ernie)", ACTIVE:"1970 - 1970", FROM:"College - Stetson", TEAM_LOGO:"./images/nba_griz.jpg"}, +{NAME:"Kilpatrick, Carl", ACTIVE:"1979 - 1979", FROM:"College - Kilgore Coll. TX (J.C.); Louisiana-Monroe", TEAM_LOGO:"./images/nba_knics.jpg"}, +{NAME:"Kimball, Toby", ACTIVE:"1966 - 1974", FROM:"College - Connecticut", TEAM_LOGO:"./images/nba_timberwolves.jpg"}, +{NAME:"Lacey, Sam", ACTIVE:"1970 - 1982", FROM:"College - New Mexico State", TEAM_LOGO:"./images/nba_suns.jpg"}, +{NAME:"LaCour, Fred", ACTIVE:"1960 - 1962", FROM:"College - San Francisco", TEAM_LOGO:"./images/nba_trail.jpg"}, +{NAME:"Laettner, Christian", ACTIVE:"1992 - 2004", FROM:"College - Duke", TEAM_LOGO:"./images/nba_hawks.jpg"}, +{NAME:"Lafayette, Oliver", ACTIVE:"2009 - 2009", FROM:"College - Houston", TEAM_LOGO:"./images/nba_knics.jpg"}, +{NAME:"LaFrentz, Raef", ACTIVE:"2007 - 2007", FROM:"College - Kansas", TEAM_LOGO:"./images/nba_pacers.jpg"}, +{NAME:"LaGarde, Thomas Joseph (Tom)", ACTIVE:"1977 - 1984", FROM:"College - North Carolina", TEAM_LOGO:"./images/nba_heats.jpg"}, +{NAME:"Laimbeer, Bill", ACTIVE:"1980 - 1993", FROM:"College - Owens CC OH; Notre Dame", TEAM_LOGO:"./images/nba_warriors.jpg"}, +{NAME:"Lalich, Peter T. (Pete)", ACTIVE:"1946 - 1946", FROM:"College - Ohio U.", TEAM_LOGO:"./images/nba_warriors.jpg"}, +{NAME:"Lamar, Dwight (Bo)", ACTIVE:"1976 - 1976", FROM:"College - Louisiana-Lafayette", TEAM_LOGO:"./images/nba_cavaliers.jpg"}, +{NAME:"Lambert, John Edward", ACTIVE:"1975 - 1981", FROM:"College - USC", TEAM_LOGO:"./images/nba_warriors.jpg"}, +{NAME:"Lamp, Jeff", ACTIVE:"1981 - 1988", FROM:"College - Virginia", TEAM_LOGO:"./images/nba_cavaliers.jpg"}, +{NAME:"Lampe, Maciej", ACTIVE:"2003 - 2005", FROM:"From - Poland", TEAM_LOGO:"./images/nba_lakers.jpg"}, +{NAME:"Lampley, Jimmy", ACTIVE:"1986 - 1986", FROM:"College - Vanderbilt; Arkansas-Little Rock", TEAM_LOGO:"./images/nba_nuggets.jpg"}, +{NAME:"Lampley, Sean", ACTIVE:"2002 - 2003", FROM:"College - California", TEAM_LOGO:"./images/nba_magics.jpg"}, +{NAME:"Landry, Carl", ACTIVE:"ACTIVE", FROM:"College - Purdue", TEAM_LOGO:"./images/nba_cavaliers.jpg"}, +{NAME:"Landry, Marcus", ACTIVE:"2009 - 2009", FROM:"College - Wisconsin", TEAM_LOGO:"./images/nba_clippers.jpg"}, +{NAME:"Landsberger, Mark", ACTIVE:"1977 - 1983", FROM:"College - Allan Hancock Coll. CA (J.C.); Minnesota; Arizona State", TEAM_LOGO:"./images/nba_celtics.jpg"}, +{NAME:"Lane, Jerome", ACTIVE:"1988 - 1992", FROM:"College - Pittsburgh", TEAM_LOGO:"./images/nba_knics.jpg"}, +{NAME:"Lang, Andrew", ACTIVE:"1988 - 1999", FROM:"College - Arkansas", TEAM_LOGO:"./images/nba_spurs.jpg"}, +{NAME:"Lang, Antonio", ACTIVE:"1994 - 1999", FROM:"College - Duke", TEAM_LOGO:"./images/nba_timberwolves.jpg"}, +{NAME:"Lang, James", ACTIVE:"2006 - 2006", FROM:"High School - Central Park Christian HS (AL)", TEAM_LOGO:"./images/nba_hawks.jpg"}, +{NAME:"Langdon, Trajan", ACTIVE:"1999 - 2001", FROM:"College - Duke", TEAM_LOGO:"./images/nba_bobcats.jpg"}, +{NAME:"Langford, Keith", ACTIVE:"2007 - 2007", FROM:"College - Kansas", TEAM_LOGO:"./images/nba_sonics.jpg"}, +{NAME:"Langhi, Dan", ACTIVE:"2000 - 2003", FROM:"College - Vanderbilt ''00", TEAM_LOGO:"./images/nba_cavaliers.jpg"}, +{NAME:"Lanier, Bob", ACTIVE:"1970 - 1983", FROM:"College - St. Bonaventure", TEAM_LOGO:"./images/nba_clippers.jpg"}, +{NAME:"Lantz, Stuart Burrell (Stu)", ACTIVE:"1968 - 1975", FROM:"College - Nebraska", TEAM_LOGO:"./images/nba_kings.jpg"}, +{NAME:"Larese, York Bruno", ACTIVE:"1961 - 1961", FROM:"College - North Carolina", TEAM_LOGO:"./images/nba_trail.jpg"}, +{NAME:"LaRue, Rusty", ACTIVE:"1997 - 2003", FROM:"College - Wake Forest", TEAM_LOGO:"./images/nba_76ers.jpg"}, +{NAME:"LaRusso, Rudolph A. (Rudy)", ACTIVE:"1959 - 1968", FROM:"College - Dartmouth", TEAM_LOGO:"./images/nba_heats.jpg"}, +{NAME:"Laskowski, John", ACTIVE:"1975 - 1976", FROM:"College - Indiana", TEAM_LOGO:"./images/nba_pacers.jpg"}, +{NAME:"Lasme, Stephane", ACTIVE:"2007 - 2007", FROM:"College - Massachusetts", TEAM_LOGO:"./images/nba_trail.jpg"}, +{NAME:"Lattin, David (Dave, Big Daddy)", ACTIVE:"1967 - 1968", FROM:"College - Texas-El Paso", TEAM_LOGO:"./images/nba_suns.jpg"}, +{NAME:"Lauderdale, Priest", ACTIVE:"1996 - 1997", FROM:"College - Central State (Ohio)", TEAM_LOGO:"./images/nba_sonics.jpg"}, +{NAME:"Laurel, Richard", ACTIVE:"1977 - 1977", FROM:"College - Hofstra", TEAM_LOGO:"./images/nba_bucks.jpg"}, +{NAME:"Lautenbach, Walter Henry (Walt)", ACTIVE:"1949 - 1949", FROM:"College - Wisconsin", TEAM_LOGO:"./images/nba_warriors.jpg"}, +{NAME:"Lavelli, Anthony (Tony)", ACTIVE:"1949 - 1950", FROM:"College - Yale", TEAM_LOGO:"./images/nba_hawks.jpg"}, +{NAME:"Lavoy, Robert William (Bob)", ACTIVE:"1950 - 1953", FROM:"College - Illinois; Western Kentucky", TEAM_LOGO:"./images/nba_wizards.jpg"}, +{NAME:"Law, Acie", ACTIVE:"ACTIVE", FROM:"College - Texas A&M", TEAM_LOGO:"./images/nba_bulls.jpg"}, +{NAME:"Lawal, Gani", ACTIVE:"ACTIVE", FROM:"College - Georgia Tech", TEAM_LOGO:"./images/nba_celtics.jpg"}, +{NAME:"Lawrence, Edmund (Ed)", ACTIVE:"1980 - 1980", FROM:"College - McNeese State", TEAM_LOGO:"./images/nba_bulls.jpg"}, +{NAME:"Lawson, Jason", ACTIVE:"1997 - 1997", FROM:"College - Villanova ''97", TEAM_LOGO:"./images/nba_pistons.jpg"}, +{NAME:"Lawson, Ty", ACTIVE:"ACTIVE", FROM:"College - North Carolina", TEAM_LOGO:"./images/nba_mavericks.jpg"}, +{NAME:"Layton, Dennis (Mo)", ACTIVE:"1971 - 1977", FROM:"College - Phoenix Coll. AZ (J.C.); USC", TEAM_LOGO:"./images/nba_pistons.jpg"}, +{NAME:"Leaks, Emanuel (Manny)", ACTIVE:"1972 - 1973", FROM:"College - Niagara", TEAM_LOGO:"./images/nba_cavaliers.jpg"}, +{NAME:"Lear, Harold C. Jr. (Hal, King)", ACTIVE:"1956 - 1956", FROM:"College - Temple", TEAM_LOGO:"./images/nba_nuggets.jpg"}, +{NAME:"Leavell, Allen", ACTIVE:"1979 - 1988", FROM:"College - Oklahoma City", TEAM_LOGO:"./images/nba_wizards.jpg"}, +{NAME:"Lebo, Jeff", ACTIVE:"1989 - 1989", FROM:"College - North Carolina", TEAM_LOGO:"./images/nba_bucks.jpg"}, +{NAME:"Leckner, Eric", ACTIVE:"1988 - 1996", FROM:"College - Wyoming", TEAM_LOGO:"./images/nba_bobcats.jpg"}, +{NAME:"Lee, Alfred (Butch)", ACTIVE:"1978 - 1979", FROM:"College - Marquette", TEAM_LOGO:"./images/nba_wizards.jpg"}, +{NAME:"Lee, Clyde", ACTIVE:"1966 - 1975", FROM:"College - Vanderbilt", TEAM_LOGO:"./images/nba_spurs.jpg"}, +{NAME:"Macaluso, Michael Emelius (Mike)", ACTIVE:"1973 - 1973", FROM:"College - Canisius", TEAM_LOGO:"./images/nba_wizards.jpg"}, +{NAME:"Macauley, Ed", ACTIVE:"1949 - 1958", FROM:"College - St. Louis", TEAM_LOGO:"./images/nba_magics.jpg"}, +{NAME:"MacCulloch, Todd", ACTIVE:"1999 - 2002", FROM:"College - Washington ''99", TEAM_LOGO:"./images/nba_heats.jpg"}, +{NAME:"MacGilvray, Ronald (Ronnie)", ACTIVE:"1954 - 1954", FROM:"College - St. John's (N.Y.)", TEAM_LOGO:"./images/nba_lakers.jpg"}, +{NAME:"Macijauskas, Arvydas", ACTIVE:"2005 - 2005", FROM:"From - Lithuania", TEAM_LOGO:"./images/nba_spurs.jpg"}, +{NAME:"Mack, Oliver (Ollie)", ACTIVE:"1979 - 1981", FROM:"College - San Jacinto Coll. TX (J.C.); East Carolina", TEAM_LOGO:"./images/nba_bobcats.jpg"}, +{NAME:"Mack, Sam", ACTIVE:"1992 - 2001", FROM:"College - Iowa State; Arizona State; Tyler JC TX; Houston", TEAM_LOGO:"./images/nba_76ers.jpg"}, +{NAME:"Mackey, Malcolm", ACTIVE:"1993 - 1993", FROM:"College - Georgia Tech", TEAM_LOGO:"./images/nba_magics.jpg"}, +{NAME:"Macklin, Rudy", ACTIVE:"1981 - 1983", FROM:"College - Louisiana State", TEAM_LOGO:"./images/nba_celtics.jpg"}, +{NAME:"Macknowski, John Andrew (Johnny, Whitey)", ACTIVE:"1949 - 1950", FROM:"College - Seton Hall", TEAM_LOGO:"./images/nba_bulls.jpg"}, +{NAME:"MacLean, Don", ACTIVE:"1992 - 2000", FROM:"College - UCLA", TEAM_LOGO:"./images/nba_honets.jpg"}, +{NAME:"Macon, Mark", ACTIVE:"1991 - 1998", FROM:"College - Temple", TEAM_LOGO:"./images/nba_timberwolves.jpg"}, +{NAME:"Macy, Kyle", ACTIVE:"1980 - 1986", FROM:"College - Purdue; Kentucky", TEAM_LOGO:"./images/nba_pistons.jpg"}, +{NAME:"Maddox, Jack C.", ACTIVE:"1948 - 1948", FROM:"College - West Texas A&M", TEAM_LOGO:"./images/nba_honets.jpg"}, +{NAME:"Maddox, Tito", ACTIVE:"2002 - 2002", FROM:"College - Fresno State ''04", TEAM_LOGO:"./images/nba_warriors.jpg"}, +{NAME:"Madkins, Gerald", ACTIVE:"1993 - 1997", FROM:"College - UCLA", TEAM_LOGO:"./images/nba_trail.jpg"}, +{NAME:"Madsen, Mark", ACTIVE:"2007 - 2008", FROM:"College - Stanford", TEAM_LOGO:"./images/nba_nets.jpg"}, +{NAME:"Mager, Norman Clifford (Norm)", ACTIVE:"1950 - 1950", FROM:"College - St. John's (N.Y.); CCNY", TEAM_LOGO:"./images/nba_jazz.jpg"}, +{NAME:"Maggette, Corey", ACTIVE:"ACTIVE", FROM:"College - Duke", TEAM_LOGO:"./images/nba_timberwolves.jpg"}, +{NAME:"Magley, Dave", ACTIVE:"1982 - 1982", FROM:"College - Kansas", TEAM_LOGO:"./images/nba_wizards.jpg"}, +{NAME:"Magloire, Jamaal", ACTIVE:"ACTIVE", FROM:"College - Kentucky", TEAM_LOGO:"./images/nba_clippers.jpg"}, +{NAME:"Mahinmi, Ian", ACTIVE:"ACTIVE", FROM:"From - Rouen, France", TEAM_LOGO:"./images/nba_cavaliers.jpg"}, +{NAME:"Mahnken, John E. (Long John; Stretch)", ACTIVE:"1946 - 1952", FROM:"College - Georgetown", TEAM_LOGO:"./images/nba_warriors.jpg"}, +{NAME:"Mahoney, Francis H. (Mo)", ACTIVE:"1952 - 1953", FROM:"College - Brown", TEAM_LOGO:"./images/nba_nets.jpg"}, +{NAME:"Mahorn, Rick", ACTIVE:"1980 - 1998", FROM:"College - Hampton", TEAM_LOGO:"./images/nba_nets.jpg"}, +{NAME:"Majerle, Dan", ACTIVE:"1988 - 2001", FROM:"College - Central Michigan", TEAM_LOGO:"./images/nba_raptors.jpg"}, +{NAME:"Major, Renaldo", ACTIVE:"2006 - 2006", FROM:"College - Fresno State", TEAM_LOGO:"./images/nba_pistons.jpg"}, +{NAME:"Malamed, Lionel", ACTIVE:"1948 - 1948", FROM:"College - CCNY", TEAM_LOGO:"./images/nba_knics.jpg"}, +{NAME:"Malone, Jeff", ACTIVE:"1983 - 1995", FROM:"College - Mississippi State", TEAM_LOGO:"./images/nba_suns.jpg"}, +{NAME:"Malone, Karl", ACTIVE:"1985 - 2003", FROM:"College - Louisiana Tech ''86", TEAM_LOGO:"./images/nba_hawks.jpg"}, +{NAME:"Malone, Moses", ACTIVE:"1976 - 1994", FROM:"College - No College", TEAM_LOGO:"./images/nba_pacers.jpg"}, +{NAME:"Maloney, Matt", ACTIVE:"1996 - 2002", FROM:"College - Pennsylvania", TEAM_LOGO:"./images/nba_celtics.jpg"}, +{NAME:"Malovic, Stephen L.", ACTIVE:"1979 - 1979", FROM:"College - USC; San Diego State", TEAM_LOGO:"./images/nba_hawks.jpg"}, +{NAME:"Manakas, Theodore (Ted)", ACTIVE:"1973 - 1973", FROM:"College - Princeton", TEAM_LOGO:"./images/nba_suns.jpg"}, +{NAME:"Mandic, John J.", ACTIVE:"1948 - 1949", FROM:"College - Oregon State", TEAM_LOGO:"./images/nba_cavaliers.jpg"}, +{NAME:"Mangiapane, Francis E. (Frank)", ACTIVE:"1946 - 1946", FROM:"College - N.Y.U.", TEAM_LOGO:"./images/nba_mavericks.jpg"}, +{NAME:"Manning, Danny", ACTIVE:"1988 - 2002", FROM:"College - Kansas ''88", TEAM_LOGO:"./images/nba_nuggets.jpg"}, +{NAME:"Manning, Edward R. (Ed)", ACTIVE:"1967 - 1970", FROM:"College - Jackson State", TEAM_LOGO:"./images/nba_bobcats.jpg"}, +{NAME:"Manning, Rich", ACTIVE:"1995 - 1996", FROM:"College - Syracuse; Washington", TEAM_LOGO:"./images/nba_jazz.jpg"}, +{NAME:"Mannion, Pace", ACTIVE:"1983 - 1988", FROM:"College - Utah", TEAM_LOGO:"./images/nba_suns.jpg"}, +{NAME:"Mantis, Nicholas (Nick)", ACTIVE:"1959 - 1962", FROM:"College - Northwestern", TEAM_LOGO:"./images/nba_hawks.jpg"}, +{NAME:"Maravich, Pete", ACTIVE:"1970 - 1979", FROM:"College - Louisiana State", TEAM_LOGO:"./images/nba_nuggets.jpg"}, +{NAME:"Maravich, Peter (Press)", ACTIVE:"1946 - 1946", FROM:"College - Davis & Elkins", TEAM_LOGO:"./images/nba_clippers.jpg"}, +{NAME:"Marble, Roy", ACTIVE:"1989 - 1993", FROM:"College - Iowa", TEAM_LOGO:"./images/nba_rockets.jpg"}, +{NAME:"Marbury, Stephon", ACTIVE:"2007 - 2008", FROM:"College - Georgia Tech", TEAM_LOGO:"./images/nba_warriors.jpg"}, +{NAME:"Marciulionis, Sarunas", ACTIVE:"1989 - 1996", FROM:"College - Vilnius (Lithuania)", TEAM_LOGO:"./images/nba_76ers.jpg"}, +{NAME:"Mariaschin, Saul George", ACTIVE:"1947 - 1947", FROM:"College - Bloomsburg; Syracuse; Harvard", TEAM_LOGO:"./images/nba_spurs.jpg"}, +{NAME:"Marin, John Warren (Jack)", ACTIVE:"1966 - 1976", FROM:"College - Duke", TEAM_LOGO:"./images/nba_bucks.jpg"}, +{NAME:"Marion, Shawn", ACTIVE:"ACTIVE", FROM:"College - UNLV", TEAM_LOGO:"./images/nba_lakers.jpg"}, +{NAME:"Markota, Damir", ACTIVE:"2006 - 2006", FROM:"From - Croatia", TEAM_LOGO:"./images/nba_bulls.jpg"}, +{NAME:"N'diaye, Mamadou", ACTIVE:"2000 - 2004", FROM:"College - Auburn", TEAM_LOGO:"./images/nba_griz.jpg"}, +{NAME:"Naber, Robert E. (Bob)", ACTIVE:"1952 - 1952", FROM:"College - Louisville", TEAM_LOGO:"./images/nba_cavaliers.jpg"}, +{NAME:"Nachamkin, Boris Alexander", ACTIVE:"1954 - 1954", FROM:"College - N.Y.U.", TEAM_LOGO:"./images/nba_griz.jpg"}, +{NAME:"Nachbar, Bostjan", ACTIVE:"2007 - 2007", FROM:"From - Slovenia", TEAM_LOGO:"./images/nba_pistons.jpg"}, +{NAME:"Nagel, Gerald R. (Jerry)", ACTIVE:"1949 - 1949", FROM:"College - Loyola (Chicago)", TEAM_LOGO:"./images/nba_griz.jpg"}, +{NAME:"Nagy, Frederick Karl (Fritz)", ACTIVE:"1948 - 1948", FROM:"College - North Carolina; Akron", TEAM_LOGO:"./images/nba_griz.jpg"}, +{NAME:"Nailon, Lee", ACTIVE:"2000 - 2005", FROM:"College - Texas Christian", TEAM_LOGO:"./images/nba_nuggets.jpg"}, +{NAME:"Najera, Eduardo", ACTIVE:"ACTIVE", FROM:"College - Oklahoma", TEAM_LOGO:"./images/nba_sonics.jpg"}, +{NAME:"Nance, Larry", ACTIVE:"1981 - 1993", FROM:"College - Clemson", TEAM_LOGO:"./images/nba_heats.jpg"}, +{NAME:"Napolitano, Paul Wally", ACTIVE:"1948 - 1948", FROM:"College - San Francisco", TEAM_LOGO:"./images/nba_warriors.jpg"}, +{NAME:"Nash, Charles Francis (Cotton)", ACTIVE:"1964 - 1964", FROM:"College - Kentucky", TEAM_LOGO:"./images/nba_pacers.jpg"}, +{NAME:"Nash, Robert Lee Jr. (Bob)", ACTIVE:"1972 - 1978", FROM:"College - San Jacinto Coll. TX (J.C.); Hawaii", TEAM_LOGO:"./images/nba_heats.jpg"}, +{NAME:"Nash, Steve", ACTIVE:"ACTIVE", FROM:"College - Santa Clara", TEAM_LOGO:"./images/nba_sonics.jpg"}, +{NAME:"Nater, Swen", ACTIVE:"1976 - 1983", FROM:"College - Cypress Coll. CA (J.C.); UCLA", TEAM_LOGO:"./images/nba_lakers.jpg"}, +{NAME:"Nathan, Howard", ACTIVE:"1995 - 1995", FROM:"College - Louisiana-Monroe", TEAM_LOGO:"./images/nba_pistons.jpg"}, +{NAME:"Natt, Calvin", ACTIVE:"1979 - 1989", FROM:"College - Louisiana-Monroe", TEAM_LOGO:"./images/nba_kings.jpg"}, +{NAME:"Natt, Kenny", ACTIVE:"1980 - 1984", FROM:"College - Louisiana-Monroe", TEAM_LOGO:"./images/nba_sonics.jpg"}, +{NAME:"Naulls, Willie", ACTIVE:"1956 - 1965", FROM:"College - UCLA", TEAM_LOGO:"./images/nba_suns.jpg"}, +{NAME:"Navarro, Juan Carlos", ACTIVE:"2007 - 2007", FROM:"From - Spain", TEAM_LOGO:"./images/nba_76ers.jpg"}, +{NAME:"Ndiaye, Hamady", ACTIVE:"ACTIVE", FROM:"College - Rutgers", TEAM_LOGO:"./images/nba_spurs.jpg"}, +{NAME:"Ndiaye, Makhtar", ACTIVE:"1998 - 1998", FROM:"College - North Carolina", TEAM_LOGO:"./images/nba_cavaliers.jpg"}, +{NAME:"Ndong, Boniface", ACTIVE:"2005 - 2005", FROM:"-", TEAM_LOGO:"./images/nba_nets.jpg"}, +{NAME:"Neal, Craig", ACTIVE:"1988 - 1990", FROM:"College - Georgia Tech", TEAM_LOGO:"./images/nba_rockets.jpg"}, +{NAME:"Neal, Gary", ACTIVE:"ACTIVE", FROM:"College - Towson", TEAM_LOGO:"./images/nba_bulls.jpg"}, +{NAME:"Neal, James Ellerbe (Jim)", ACTIVE:"1953 - 1954", FROM:"College - Wofford", TEAM_LOGO:"./images/nba_kings.jpg"}, +{NAME:"Neal, Lloyd", ACTIVE:"1972 - 1978", FROM:"College - Tennessee State", TEAM_LOGO:"./images/nba_sonics.jpg"}, +{NAME:"Nealy, Ed", ACTIVE:"1982 - 1992", FROM:"College - Kansas State", TEAM_LOGO:"./images/nba_magics.jpg"}, +{NAME:"Negratti, Albert Edward (Al)", ACTIVE:"1946 - 1946", FROM:"College - Seton Hall", TEAM_LOGO:"./images/nba_clippers.jpg"}, +{NAME:"Nelson, Barry G.", ACTIVE:"1971 - 1971", FROM:"College - Duquesne", TEAM_LOGO:"./images/nba_bucks.jpg"}, +{NAME:"Nelson, DeMarcus", ACTIVE:"2008 - 2008", FROM:"College - Duke", TEAM_LOGO:"./images/nba_suns.jpg"}, +{NAME:"Nelson, Donald Arvid (Don, Nellie)", ACTIVE:"1962 - 1975", FROM:"College - Iowa", TEAM_LOGO:"./images/nba_pistons.jpg"}, +{NAME:"Nelson, Jameer", ACTIVE:"ACTIVE", FROM:"College - Saint Joseph's", TEAM_LOGO:"./images/nba_clippers.jpg"}, +{NAME:"Nelson, Louis (Louie, Sweets)", ACTIVE:"1973 - 1977", FROM:"College - Washington", TEAM_LOGO:"./images/nba_wizards.jpg"}, +{NAME:"Nembhard, Ruben", ACTIVE:"1996 - 1996", FROM:"College - Weber State", TEAM_LOGO:"./images/nba_bobcats.jpg"}, +{NAME:"Nene", ACTIVE:"ACTIVE", FROM:"From - Sao Carlos, Brazil", TEAM_LOGO:"./images/nba_sonics.jpg"}, +{NAME:"Nesby, Tyrone", ACTIVE:"1998 - 2001", FROM:"College - Vincennes IN (J.C.); Nevada-Las Vegas", TEAM_LOGO:"./images/nba_bucks.jpg"}, +{NAME:"Nessley, Martin", ACTIVE:"1987 - 1987", FROM:"College - Duke", TEAM_LOGO:"./images/nba_bucks.jpg"}, +{NAME:"Nesterovic, Rasho", ACTIVE:"2007 - 2009", FROM:"From - Ljubljana, Slovenia", TEAM_LOGO:"./images/nba_heats.jpg"}, +{NAME:"Neumann, Johnny", ACTIVE:"1976 - 1977", FROM:"College - Mississippi", TEAM_LOGO:"./images/nba_hawks.jpg"}, +{NAME:"Neumann, Paul R.", ACTIVE:"1961 - 1966", FROM:"College - Stanford", TEAM_LOGO:"./images/nba_wizards.jpg"}, +{NAME:"Nevitt, Chuck", ACTIVE:"1982 - 1993", FROM:"College - North Carolina State", TEAM_LOGO:"./images/nba_bucks.jpg"}, +{NAME:"Newbern, Melvin", ACTIVE:"1992 - 1992", FROM:"College - Minnesota", TEAM_LOGO:"./images/nba_nuggets.jpg"}, +{NAME:"Newbill, Ivano", ACTIVE:"1994 - 1997", FROM:"College - Georgia Tech", TEAM_LOGO:"./images/nba_celtics.jpg"}, +{NAME:"Newble, Ira", ACTIVE:"2007 - 2007", FROM:"College - Miami (Ohio)", TEAM_LOGO:"./images/nba_griz.jpg"}, +{NAME:"Newlin, Mike", ACTIVE:"1971 - 1981", FROM:"College - Utah", TEAM_LOGO:"./images/nba_bulls.jpg"}, +{NAME:"Newman, Johnny", ACTIVE:"1986 - 2001", FROM:"College - Richmond", TEAM_LOGO:"./images/nba_bulls.jpg"}, +{NAME:"Newmark, David L. (Dave)", ACTIVE:"1968 - 1969", FROM:"College - Columbia", TEAM_LOGO:"./images/nba_bucks.jpg"}, +{NAME:"Nichols, Demetris", ACTIVE:"2007 - 2008", FROM:"College - Syracuse", TEAM_LOGO:"./images/nba_lakers.jpg"}, +{NAME:"Nichols, Jack Edward", ACTIVE:"1948 - 1957", FROM:"College - Washington; USC", TEAM_LOGO:"./images/nba_suns.jpg"}, +{NAME:"Nickerson, Gaylon", ACTIVE:"1996 - 1996", FROM:"College - Wichita State; Butler Co. CC PA; Kansas State; Northwestern O", TEAM_LOGO:"./images/nba_raptors.jpg"}, +{NAME:"O'Bannon, Charles", ACTIVE:"1997 - 1998", FROM:"College - UCLA", TEAM_LOGO:"./images/nba_kings.jpg"}, +{NAME:"O'Bannon, Ed", ACTIVE:"1995 - 1996", FROM:"College - UCLA", TEAM_LOGO:"./images/nba_celtics.jpg"}, +{NAME:"O'Koren, Mike", ACTIVE:"1980 - 1987", FROM:"College - North Carolina", TEAM_LOGO:"./images/nba_timberwolves.jpg"}, +{NAME:"O'Sullivan, Dan", ACTIVE:"1990 - 1995", FROM:"College - Fordham", TEAM_LOGO:"./images/nba_pistons.jpg"}, +{NAME:"O'Boyle, John W.", ACTIVE:"1952 - 1952", FROM:"College - Modesto JC CA; Colorado State", TEAM_LOGO:"./images/nba_nets.jpg"}, +{NAME:"O'Brien, Ralph E. (Buckshot)", ACTIVE:"1951 - 1952", FROM:"College - Butler", TEAM_LOGO:"./images/nba_cavaliers.jpg"}, +{NAME:"O'Brien, Robert (Bob)", ACTIVE:"1947 - 1948", FROM:"College - Kansas; Pepperdine", TEAM_LOGO:"./images/nba_celtics.jpg"}, +{NAME:"O'Bryant, Patrick", ACTIVE:"2007 - 2009", FROM:"College - Bradley", TEAM_LOGO:"./images/nba_trail.jpg"}, +{NAME:"O'Connell, Dermott F. (Dermie)", ACTIVE:"1948 - 1949", FROM:"College - Holy Cross", TEAM_LOGO:"./images/nba_warriors.jpg"}, +{NAME:"O'Donnell, Andrew J. (Andy)", ACTIVE:"1949 - 1949", FROM:"College - Loyola (Balt.)", TEAM_LOGO:"./images/nba_trail.jpg"}, +{NAME:"O'Grady, Francis David (Buddy)", ACTIVE:"1946 - 1948", FROM:"College - Georgetown", TEAM_LOGO:"./images/nba_sonics.jpg"}, +{NAME:"O'Keefe, Richard T. (Dick)", ACTIVE:"1947 - 1950", FROM:"College - Santa Clara", TEAM_LOGO:"./images/nba_bobcats.jpg"}, +{NAME:"O'Keefe, Thomas V. (Tommy)", ACTIVE:"1950 - 1950", FROM:"College - Notre Dame; Georgetown", TEAM_LOGO:"./images/nba_nets.jpg"}, +{NAME:"O'Malley, V. Grady (Grady)", ACTIVE:"1969 - 1969", FROM:"College - Manhattan", TEAM_LOGO:"./images/nba_magics.jpg"}, +{NAME:"O'Neal, Jermaine", ACTIVE:"ACTIVE", FROM:"High School - Eau Claire HS (SC)", TEAM_LOGO:"./images/nba_bulls.jpg"}, +{NAME:"O'Neal, Shaquille", ACTIVE:"2007 - 2010", FROM:"College - Louisiana State", TEAM_LOGO:"./images/nba_nuggets.jpg"}, +{NAME:"O'Neill, Mike", ACTIVE:"1952 - 1952", FROM:"College - California", TEAM_LOGO:"./images/nba_bobcats.jpg"}, +{NAME:"O'Shea, Kevin Christopher", ACTIVE:"1950 - 1952", FROM:"College - Notre Dame", TEAM_LOGO:"./images/nba_spurs.jpg"}, +{NAME:"O'Shields, Garland L. (Mule)", ACTIVE:"1946 - 1946", FROM:"College - Spartanburg Tech SC (J.C.); Tennessee", TEAM_LOGO:"./images/nba_wizards.jpg"}, +{NAME:"Oakley, Charles", ACTIVE:"1985 - 2003", FROM:"College - Virginia Union ''85", TEAM_LOGO:"./images/nba_mavericks.jpg"}, +{NAME:"Oberto, Fabricio", ACTIVE:"2007 - 2010", FROM:"From - Las Varillas, Argentina", TEAM_LOGO:"./images/nba_pistons.jpg"}, +{NAME:"Oden, Greg", ACTIVE:"ACTIVE", FROM:"College - Ohio State", TEAM_LOGO:"./images/nba_raptors.jpg"}, +{NAME:"Odom, Lamar", ACTIVE:"ACTIVE", FROM:"College - Rhode Island", TEAM_LOGO:"./images/nba_kings.jpg"}, +{NAME:"Ogden, Carlos (Bud)", ACTIVE:"1969 - 1970", FROM:"College - Santa Clara", TEAM_LOGO:"./images/nba_spurs.jpg"}, +{NAME:"Ogden, Ralph", ACTIVE:"1970 - 1970", FROM:"College - Santa Clara", TEAM_LOGO:"./images/nba_kings.jpg"}, +{NAME:"Ogg, Alan", ACTIVE:"1990 - 1992", FROM:"College - Alabama-Birmingham", TEAM_LOGO:"./images/nba_bobcats.jpg"}, +{NAME:"Ohl, Donald Jay (Don)", ACTIVE:"1960 - 1969", FROM:"College - Illinois", TEAM_LOGO:"./images/nba_heats.jpg"}, +{NAME:"Okafor, Emeka", ACTIVE:"ACTIVE", FROM:"College - Connecticut", TEAM_LOGO:"./images/nba_rockets.jpg"}, +{NAME:"Okur, Mehmet", ACTIVE:"ACTIVE", FROM:"From - Yalova, Turkey", TEAM_LOGO:"./images/nba_nets.jpg"}, +{NAME:"Olajuwon, Hakeem", ACTIVE:"1984 - 2001", FROM:"College - Houston ''84", TEAM_LOGO:"./images/nba_rockets.jpg"}, +{NAME:"Olberding, Mark", ACTIVE:"1976 - 1986", FROM:"College - Minnesota", TEAM_LOGO:"./images/nba_bulls.jpg"}, +{NAME:"Oldham, Jawann", ACTIVE:"1980 - 1990", FROM:"College - Seattle", TEAM_LOGO:"./images/nba_celtics.jpg"}, +{NAME:"Oldham, John O. (Johnny)", ACTIVE:"1949 - 1950", FROM:"College - Western Kentucky", TEAM_LOGO:"./images/nba_griz.jpg"}, +{NAME:"Oleynick, Frank (Magic)", ACTIVE:"1975 - 1976", FROM:"College - Seattle", TEAM_LOGO:"./images/nba_knics.jpg"}, +{NAME:"Olive, John", ACTIVE:"1978 - 1979", FROM:"College - Villanova", TEAM_LOGO:"./images/nba_bulls.jpg"}, +{NAME:"Oliver, Brian", ACTIVE:"1990 - 1997", FROM:"College - Georgia Tech", TEAM_LOGO:"./images/nba_celtics.jpg"}, +{NAME:"Oliver, Dean", ACTIVE:"2001 - 2002", FROM:"College - Iowa ''01", TEAM_LOGO:"./images/nba_rockets.jpg"}, +{NAME:"Oliver, Jimmy", ACTIVE:"1991 - 1998", FROM:"College - Purdue", TEAM_LOGO:"./images/nba_mavericks.jpg"}, +{NAME:"Ollie, Kevin", ACTIVE:"2007 - 2009", FROM:"College - Connecticut", TEAM_LOGO:"./images/nba_raptors.jpg"}, +{NAME:"Ollrich, Gene W. (Moe)", ACTIVE:"1949 - 1949", FROM:"College - Drake", TEAM_LOGO:"./images/nba_hawks.jpg"}, +{NAME:"Olowokandi, Michael", ACTIVE:"1998 - 2006", FROM:"College - U. of Pacific", TEAM_LOGO:"./images/nba_hawks.jpg"}, +{NAME:"Olsen, Enoch Eli III (Bud)", ACTIVE:"1962 - 1968", FROM:"College - Louisville", TEAM_LOGO:"./images/nba_knics.jpg"}, +{NAME:"Orms, Barry D.", ACTIVE:"1968 - 1968", FROM:"College - St. Louis", TEAM_LOGO:"./images/nba_suns.jpg"}, +{NAME:"Orr, John M. (Johnny)", ACTIVE:"1949 - 1949", FROM:"College - Beloit; Illinois", TEAM_LOGO:"./images/nba_nets.jpg"}, +{NAME:"Orr, Louis", ACTIVE:"1980 - 1987", FROM:"College - Syracuse", TEAM_LOGO:"./images/nba_warriors.jpg"}, +{NAME:"Ortiz, Jose", ACTIVE:"1988 - 1989", FROM:"College - Oregon State", TEAM_LOGO:"./images/nba_bobcats.jpg"}, +{NAME:"Osborne, Charles H. (Chuck)", ACTIVE:"1961 - 1961", FROM:"College - Western Kentucky", TEAM_LOGO:"./images/nba_rockets.jpg"}, +{NAME:"Osterkorn, Walter Raymond (Wally)", ACTIVE:"1951 - 1954", FROM:"College - Illinois", TEAM_LOGO:"./images/nba_magics.jpg"}, +{NAME:"Ostertag, Greg", ACTIVE:"1995 - 2005", FROM:"College - Kansas", TEAM_LOGO:"./images/nba_bobcats.jpg"}, +{NAME:"Othick, Matt", ACTIVE:"1992 - 1992", FROM:"College - Arizona", TEAM_LOGO:"./images/nba_jazz.jpg"}, +{NAME:"Pace, Joseph (Joe)", ACTIVE:"1976 - 1977", FROM:"College - Maryland East. Shore; Coppin State", TEAM_LOGO:"./images/nba_warriors.jpg"}, +{NAME:"Pachulia, Zaza", ACTIVE:"ACTIVE", FROM:"From - Tbilisi, Georgia", TEAM_LOGO:"./images/nba_clippers.jpg"}, +{NAME:"Pack, Robert", ACTIVE:"1991 - 2003", FROM:"College - USC", TEAM_LOGO:"./images/nba_timberwolves.jpg"}, +{NAME:"Paddio, Gerald", ACTIVE:"1990 - 1993", FROM:"College - Seminole JC OK; Kilgore Coll. TX (J.C.); Nevada-Las Vegas", TEAM_LOGO:"./images/nba_warriors.jpg"}, +{NAME:"Padgett, Scott", ACTIVE:"1999 - 2006", FROM:"College - Kentucky", TEAM_LOGO:"./images/nba_timberwolves.jpg"}, +{NAME:"Paine, Frederick Vincent Jr. (Fred)", ACTIVE:"1948 - 1948", FROM:"College - Westminster (PA)", TEAM_LOGO:"./images/nba_bucks.jpg"}, +{NAME:"Palacio, Milt", ACTIVE:"1999 - 2005", FROM:"College - Colorado State", TEAM_LOGO:"./images/nba_bobcats.jpg"}, +{NAME:"Palazzi, Togo Anthony", ACTIVE:"1954 - 1959", FROM:"College - Holy Cross", TEAM_LOGO:"./images/nba_spurs.jpg"}, +{NAME:"Palmer, James G. (Jim)", ACTIVE:"1958 - 1960", FROM:"College - Dayton", TEAM_LOGO:"./images/nba_celtics.jpg"}, +{NAME:"Palmer, John S. (Bud)", ACTIVE:"1946 - 1948", FROM:"College - Princeton", TEAM_LOGO:"./images/nba_nuggets.jpg"}, +{NAME:"Palmer, Walter", ACTIVE:"1990 - 1992", FROM:"College - Dartmouth", TEAM_LOGO:"./images/nba_timberwolves.jpg"}, +{NAME:"Panko, Andy", ACTIVE:"2000 - 2000", FROM:"College - Lebanon Valley", TEAM_LOGO:"./images/nba_lakers.jpg"}, +{NAME:"Pargo, Jannero", ACTIVE:"ACTIVE", FROM:"College - Arkansas", TEAM_LOGO:"./images/nba_wizards.jpg"}, +{NAME:"Parham, Estes Foster (Easy)", ACTIVE:"1948 - 1950", FROM:"College - Texas Wesleyan", TEAM_LOGO:"./images/nba_nets.jpg"}, +{NAME:"Parish, Robert", ACTIVE:"1976 - 1996", FROM:"College - Centenary", TEAM_LOGO:"./images/nba_magics.jpg"}, +{NAME:"Park, Medford R. (Med)", ACTIVE:"1955 - 1959", FROM:"College - Missouri", TEAM_LOGO:"./images/nba_kings.jpg"}, +{NAME:"Parker, Anthony", ACTIVE:"ACTIVE", FROM:"College - Bradley", TEAM_LOGO:"./images/nba_magics.jpg"}, +{NAME:"Parker, Robert S. Jr. (Sonny)", ACTIVE:"1976 - 1981", FROM:"College - Mineral Area Coll. MO (J.C.); Texas A&M", TEAM_LOGO:"./images/nba_sonics.jpg"}, +{NAME:"Parker, Smush", ACTIVE:"2007 - 2007", FROM:"College - Fordham", TEAM_LOGO:"./images/nba_nets.jpg"}, +{NAME:"Parker, Tony", ACTIVE:"ACTIVE", FROM:"From - Paris, France", TEAM_LOGO:"./images/nba_magics.jpg"}, +{NAME:"Parkinson, Jack Gordon", ACTIVE:"1949 - 1949", FROM:"College - Kentucky", TEAM_LOGO:"./images/nba_mavericks.jpg"}, +{NAME:"Parks, Cherokee", ACTIVE:"1995 - 2003", FROM:"College - Duke ''95", TEAM_LOGO:"./images/nba_pistons.jpg"}, +{NAME:"Parr, Jack", ACTIVE:"1958 - 1958", FROM:"College - Kansas State", TEAM_LOGO:"./images/nba_trail.jpg"}, +{NAME:"Parrack, Doyle Kenneth", ACTIVE:"1946 - 1946", FROM:"College - Oklahoma State", TEAM_LOGO:"./images/nba_wizards.jpg"}, +{NAME:"Parsley, Charles H. (Charlie)", ACTIVE:"1949 - 1949", FROM:"College - Western Kentucky", TEAM_LOGO:"./images/nba_suns.jpg"}, +{NAME:"Paspalj, Zarko", ACTIVE:"1989 - 1989", FROM:"College - No College", TEAM_LOGO:"./images/nba_jazz.jpg"}, +{NAME:"Passaglia, Martin Harold (Marty)", ACTIVE:"1946 - 1948", FROM:"College - Santa Clara", TEAM_LOGO:"./images/nba_rockets.jpg"}, +{NAME:"Pastushok, George A.", ACTIVE:"1946 - 1946", FROM:"College - Manhattan; St. John's (N.Y.)", TEAM_LOGO:"./images/nba_pistons.jpg"}, +{NAME:"Patrick, Myles", ACTIVE:"1980 - 1980", FROM:"College - Auburn", TEAM_LOGO:"./images/nba_raptors.jpg"}, +{NAME:"Patrick, Stanley A. (Stan)", ACTIVE:"1949 - 1949", FROM:"College - Santa Clara; Illinois", TEAM_LOGO:"./images/nba_sonics.jpg"}, +{NAME:"Patterson, Andrae", ACTIVE:"1998 - 1999", FROM:"College - Indiana", TEAM_LOGO:"./images/nba_cavaliers.jpg"}, +{NAME:"Patterson, George", ACTIVE:"1967 - 1967", FROM:"College - Toledo", TEAM_LOGO:"./images/nba_rockets.jpg"}, +{NAME:"Patterson, Patrick", ACTIVE:"ACTIVE", FROM:"College - Kentucky", TEAM_LOGO:"./images/nba_trail.jpg"}, +{NAME:"Patterson, Ruben", ACTIVE:"2007 - 2007", FROM:"College - Cincinnati", TEAM_LOGO:"./images/nba_warriors.jpg"}, +{NAME:"Patterson, Steven J. (Steve)", ACTIVE:"1971 - 1975", FROM:"College - UCLA", TEAM_LOGO:"./images/nba_knics.jpg"}, +{NAME:"Patterson, Tommie J. (Tommy)", ACTIVE:"1972 - 1973", FROM:"College - Ouachita Baptist", TEAM_LOGO:"./images/nba_rockets.jpg"}, +{NAME:"Patterson, Worthington R. (Worthy)", ACTIVE:"1957 - 1957", FROM:"College - Connecticut", TEAM_LOGO:"./images/nba_lakers.jpg"}, +{NAME:"Paul, Chris", ACTIVE:"ACTIVE", FROM:"College - Wake Forest", TEAM_LOGO:"./images/nba_sonics.jpg"}, +{NAME:"Paulk, Charles (Charlie)", ACTIVE:"1968 - 1971", FROM:"College - Tulsa; Northeastern State (Okla.)", TEAM_LOGO:"./images/nba_warriors.jpg"}, +{NAME:"Paulson, Gerald Arthur (Jerry)", ACTIVE:"1957 - 1957", FROM:"College - Manhattan", TEAM_LOGO:"./images/nba_heats.jpg"}, +{NAME:"Paultz, Billy", ACTIVE:"1976 - 1984", FROM:"College - Cameron; St. John's (N.Y.)", TEAM_LOGO:"./images/nba_bucks.jpg"}, +{NAME:"Pavlovic, Aleksandar", ACTIVE:"ACTIVE", FROM:"From - Bar, Montenegro", TEAM_LOGO:"./images/nba_rockets.jpg"}, +{NAME:"Paxson, James Edward Sr. (Jim)", ACTIVE:"1956 - 1957", FROM:"College - Dayton", TEAM_LOGO:"./images/nba_jazz.jpg"}, +{NAME:"Paxson, Jim", ACTIVE:"1979 - 1989", FROM:"College - Dayton", TEAM_LOGO:"./images/nba_pacers.jpg"}, +{NAME:"Paxson, John", ACTIVE:"1983 - 1993", FROM:"College - Notre Dame", TEAM_LOGO:"./images/nba_hawks.jpg"}, +{NAME:"Payak, John Jr. (Johnny)", ACTIVE:"1949 - 1952", FROM:"College - Bowling Green State", TEAM_LOGO:"./images/nba_hawks.jpg"}, +{NAME:"Payne, Kenny", ACTIVE:"1989 - 1992", FROM:"College - Louisville", TEAM_LOGO:"./images/nba_raptors.jpg"}, +{NAME:"Payne, Tom", ACTIVE:"1971 - 1971", FROM:"College - Kentucky", TEAM_LOGO:"./images/nba_knics.jpg"}, +{NAME:"Payton, Gary", ACTIVE:"1990 - 2006", FROM:"College - Oregon State", TEAM_LOGO:"./images/nba_warriors.jpg"}, +{NAME:"Payton, Melvin E. (Mel)", ACTIVE:"1951 - 1952", FROM:"College - Tulane", TEAM_LOGO:"./images/nba_bulls.jpg"}, +{NAME:"Quick, Robert L. (Bob)", ACTIVE:"1968 - 1971", FROM:"College - Xavier (Ohio)", TEAM_LOGO:"./images/nba_rockets.jpg"}, +{NAME:"Quinn, Chris", ACTIVE:"ACTIVE", FROM:"College - Notre Dame", TEAM_LOGO:"./images/nba_jazz.jpg"}, +{NAME:"Quinnett, Brian", ACTIVE:"1989 - 1991", FROM:"College - Washington State", TEAM_LOGO:"./images/nba_timberwolves.jpg"}, +{NAME:"Rackley, Luther Jr. (Luke)", ACTIVE:"1969 - 1973", FROM:"College - Xavier (Ohio)", TEAM_LOGO:"./images/nba_76ers.jpg"}, +{NAME:"Rader, Howard (Howie)", ACTIVE:"1948 - 1948", FROM:"College - Long Island University", TEAM_LOGO:"./images/nba_griz.jpg"}, +{NAME:"Radford, Mark", ACTIVE:"1981 - 1982", FROM:"College - Oregon State", TEAM_LOGO:"./images/nba_bulls.jpg"}, +{NAME:"Radford, Wayne", ACTIVE:"1978 - 1978", FROM:"College - Indiana", TEAM_LOGO:"./images/nba_sonics.jpg"}, +{NAME:"Radja, Dino", ACTIVE:"1993 - 1996", FROM:"College - Croatia", TEAM_LOGO:"./images/nba_lakers.jpg"}, +{NAME:"Radmanovic, Vladimir", ACTIVE:"ACTIVE", FROM:"From - Belgrade, Serbia", TEAM_LOGO:"./images/nba_bucks.jpg"}, +{NAME:"Radojevic, Aleksandar", ACTIVE:"1999 - 2004", FROM:"From - Serbia-Montenegro", TEAM_LOGO:"./images/nba_celtics.jpg"}, +{NAME:"Radovich, Frank Raymond", ACTIVE:"1961 - 1961", FROM:"College - Indiana", TEAM_LOGO:"./images/nba_griz.jpg"}, +{NAME:"Radovich, George Lewis (Moe)", ACTIVE:"1952 - 1952", FROM:"College - Wyoming", TEAM_LOGO:"./images/nba_bulls.jpg"}, +{NAME:"Radziszewski, Raymond A. (Ray)", ACTIVE:"1957 - 1957", FROM:"College - St. Joseph's (PA)", TEAM_LOGO:"./images/nba_rockets.jpg"}, +{NAME:"Ragelis, Raymond Ernest (Ray)", ACTIVE:"1951 - 1951", FROM:"College - Northwestern", TEAM_LOGO:"./images/nba_wizards.jpg"}, +{NAME:"Raiken, Sherwin H.", ACTIVE:"1952 - 1952", FROM:"College - Villanova", TEAM_LOGO:"./images/nba_warriors.jpg"}, +{NAME:"Rains, Ed", ACTIVE:"1981 - 1982", FROM:"College - South Alabama", TEAM_LOGO:"./images/nba_bulls.jpg"}, +{NAME:"Rakocevic, Igor", ACTIVE:"2002 - 2002", FROM:"College - No College", TEAM_LOGO:"./images/nba_bucks.jpg"}, +{NAME:"Rambis, Kurt", ACTIVE:"1981 - 1994", FROM:"College - Santa Clara", TEAM_LOGO:"./images/nba_lakers.jpg"}, +{NAME:"Ramos, Peter", ACTIVE:"2004 - 2004", FROM:"From - Puerto Rico", TEAM_LOGO:"./images/nba_hawks.jpg"}, +{NAME:"Ramsey, Calvin (Cal)", ACTIVE:"1959 - 1960", FROM:"College - N.Y.U.", TEAM_LOGO:"./images/nba_trail.jpg"}, +{NAME:"Ramsey, Frank", ACTIVE:"1954 - 1963", FROM:"College - Kentucky", TEAM_LOGO:"./images/nba_jazz.jpg"}, +{NAME:"Ramsey, Raymond Leroy (Ray)", ACTIVE:"1948 - 1948", FROM:"College - Bradley", TEAM_LOGO:"./images/nba_magics.jpg"}, +{NAME:"Randall, Mark", ACTIVE:"1991 - 1994", FROM:"College - Kansas", TEAM_LOGO:"./images/nba_timberwolves.jpg"}, +{NAME:"Randolph, Anthony", ACTIVE:"ACTIVE", FROM:"College - Louisiana State", TEAM_LOGO:"./images/nba_wizards.jpg"}, +{NAME:"Randolph, Shavlik", ACTIVE:"2007 - 2009", FROM:"College - Duke", TEAM_LOGO:"./images/nba_raptors.jpg"}, +{NAME:"Randolph, Zach", ACTIVE:"ACTIVE", FROM:"College - Michigan State", TEAM_LOGO:"./images/nba_hawks.jpg"}, +{NAME:"Rank, Wallace Aliifua (Wally)", ACTIVE:"1980 - 1980", FROM:"College - San Jose State", TEAM_LOGO:"./images/nba_jazz.jpg"}, +{NAME:"Ransey, Kelvin", ACTIVE:"1980 - 1985", FROM:"College - Ohio State", TEAM_LOGO:"./images/nba_bulls.jpg"}, +{NAME:"Ranzino, Samuel Salvadore (Sam)", ACTIVE:"1951 - 1951", FROM:"College - North Carolina State", TEAM_LOGO:"./images/nba_hawks.jpg"}, +{NAME:"Rasmussen, Blair", ACTIVE:"1985 - 1992", FROM:"College - Oregon", TEAM_LOGO:"./images/nba_rockets.jpg"}, +{NAME:"Ratkovicz, George", ACTIVE:"1949 - 1954", FROM:"College - No College", TEAM_LOGO:"./images/nba_clippers.jpg"}, +{NAME:"Ratleff, Ed", ACTIVE:"1973 - 1977", FROM:"College - Long Beach State", TEAM_LOGO:"./images/nba_honets.jpg"}, +{NAME:"Ratliff, Michael D. (Mike)", ACTIVE:"1972 - 1973", FROM:"College - Wis.-Eau Claire", TEAM_LOGO:"./images/nba_trail.jpg"}, +{NAME:"Ratliff, Theo", ACTIVE:"ACTIVE", FROM:"College - Wyoming", TEAM_LOGO:"./images/nba_spurs.jpg"}, +{NAME:"Rautins, Andy", ACTIVE:"ACTIVE", FROM:"College - Syracuse", TEAM_LOGO:"./images/nba_magics.jpg"}, +{NAME:"Rautins, Leo", ACTIVE:"1983 - 1984", FROM:"College - Minnesota; Syracuse", TEAM_LOGO:"./images/nba_76ers.jpg"}, +{NAME:"Ray, Allan", ACTIVE:"2006 - 2006", FROM:"College - Villanova", TEAM_LOGO:"./images/nba_pistons.jpg"}, +{NAME:"Ray, Clifford", ACTIVE:"1971 - 1980", FROM:"College - Oklahoma", TEAM_LOGO:"./images/nba_suns.jpg"}, +{NAME:"Ray, Donald L. (Don, Duck)", ACTIVE:"1949 - 1949", FROM:"College - Western Kentucky", TEAM_LOGO:"./images/nba_heats.jpg"}, +{NAME:"Ray, James E. (Jim)", ACTIVE:"1956 - 1959", FROM:"College - Toledo", TEAM_LOGO:"./images/nba_lakers.jpg"}, +{NAME:"Ray, James Earl", ACTIVE:"1980 - 1982", FROM:"College - Jacksonville", TEAM_LOGO:"./images/nba_bucks.jpg"}, +{NAME:"Raymond, Craig Milford", ACTIVE:"1968 - 1968", FROM:"College - Brigham Young", TEAM_LOGO:"./images/nba_suns.jpg"}, +{NAME:"Rea, Connie Mack", ACTIVE:"1953 - 1953", FROM:"College - Centenary; Vanderbilt", TEAM_LOGO:"./images/nba_76ers.jpg"}, +{NAME:"Reaves, Joe L.", ACTIVE:"1973 - 1973", FROM:"College - Bethel College (Tenn.)", TEAM_LOGO:"./images/nba_pistons.jpg"}, +{NAME:"Rebraca, Zeljko", ACTIVE:"2001 - 2005", FROM:"From - Serbia & Montenegro", TEAM_LOGO:"./images/nba_nuggets.jpg"}, +{NAME:"Recasner, Eldridge", ACTIVE:"1994 - 2001", FROM:"College - Washington", TEAM_LOGO:"./images/nba_heats.jpg"}, +{NAME:"Redd, Michael", ACTIVE:"ACTIVE", FROM:"College - Ohio State", TEAM_LOGO:"./images/nba_bucks.jpg"}, +{NAME:"Reddout, Franklin P. (Frank)", ACTIVE:"1953 - 1953", FROM:"College - Syracuse", TEAM_LOGO:"./images/nba_magics.jpg"}, +{NAME:"Redick, J.J.", ACTIVE:"ACTIVE", FROM:"College - Duke", TEAM_LOGO:"./images/nba_raptors.jpg"}, +{NAME:"Redmond, Marlon Bernard", ACTIVE:"1978 - 1979", FROM:"College - San Francisco", TEAM_LOGO:"./images/nba_knics.jpg"}, +{NAME:"Reed, Hubert F. (Hub)", ACTIVE:"1958 - 1964", FROM:"College - Oklahoma City", TEAM_LOGO:"./images/nba_bucks.jpg"}, +{NAME:"Reed, Justin", ACTIVE:"2004 - 2006", FROM:"College - Mississippi", TEAM_LOGO:"./images/nba_bulls.jpg"}, +{NAME:"Reed, Ronald Lee (Ron)", ACTIVE:"1965 - 1966", FROM:"College - Notre Dame", TEAM_LOGO:"./images/nba_nets.jpg"}, +{NAME:"Sabonis, Arvydas", ACTIVE:"1995 - 2002", FROM:"From - Lithuania", TEAM_LOGO:"./images/nba_suns.jpg"}, +{NAME:"Sadowski, Edward Frank (Ed, Big Ed)", ACTIVE:"1946 - 1949", FROM:"College - Seton Hall", TEAM_LOGO:"./images/nba_trail.jpg"}, +{NAME:"Sailors, Kenneth L. (Kenny)", ACTIVE:"1946 - 1950", FROM:"College - Wyoming", TEAM_LOGO:"./images/nba_sonics.jpg"}, +{NAME:"Salley, John", ACTIVE:"1986 - 1999", FROM:"College - Georgia Tech", TEAM_LOGO:"./images/nba_timberwolves.jpg"}, +{NAME:"Salmons, John", ACTIVE:"ACTIVE", FROM:"College - Miami (Fla.)", TEAM_LOGO:"./images/nba_spurs.jpg"}, +{NAME:"Salvadori, Kevin", ACTIVE:"1996 - 1997", FROM:"College - North Carolina", TEAM_LOGO:"./images/nba_knics.jpg"}, +{NAME:"Samake, Soumaila", ACTIVE:"2000 - 2002", FROM:"From - Republic of Mali", TEAM_LOGO:"./images/nba_pacers.jpg"}, +{NAME:"Samb, Cheikh", ACTIVE:"2007 - 2008", FROM:"From - Senegal", TEAM_LOGO:"./images/nba_bulls.jpg"}, +{NAME:"Sampson, Jamal", ACTIVE:"2002 - 2006", FROM:"College - California", TEAM_LOGO:"./images/nba_knics.jpg"}, +{NAME:"Sampson, Ralph", ACTIVE:"1983 - 1991", FROM:"College - Virginia", TEAM_LOGO:"./images/nba_clippers.jpg"}, +{NAME:"Samuels, Samardo", ACTIVE:"ACTIVE", FROM:"College - Louisville", TEAM_LOGO:"./images/nba_nuggets.jpg"}, +{NAME:"Sanchez, Pepe", ACTIVE:"2000 - 2002", FROM:"College - Temple ''00", TEAM_LOGO:"./images/nba_lakers.jpg"}, +{NAME:"Sanders, Frankie J. (Frankie J.)", ACTIVE:"1978 - 1980", FROM:"College - Southern University", TEAM_LOGO:"./images/nba_nuggets.jpg"}, +{NAME:"Sanders, Jeff", ACTIVE:"1989 - 1992", FROM:"College - Georgia Southern", TEAM_LOGO:"./images/nba_raptors.jpg"}, +{NAME:"Sanders, Larry", ACTIVE:"ACTIVE", FROM:"College - Virginia Commonwealth", TEAM_LOGO:"./images/nba_suns.jpg"}, +{NAME:"Sanders, Melvin", ACTIVE:"2005 - 2005", FROM:"College - Oklahoma State", TEAM_LOGO:"./images/nba_trail.jpg"}, +{NAME:"Sanders, Mike", ACTIVE:"1982 - 1992", FROM:"College - UCLA", TEAM_LOGO:"./images/nba_knics.jpg"}, +{NAME:"Sanders, Thomas Ernest (Satch)", ACTIVE:"1960 - 1972", FROM:"College - N.Y.U.", TEAM_LOGO:"./images/nba_cavaliers.jpg"}, +{NAME:"Santiago, Daniel", ACTIVE:"2000 - 2004", FROM:"College - St. Vincent", TEAM_LOGO:"./images/nba_warriors.jpg"}, +{NAME:"Santini, Robert (Bob)", ACTIVE:"1955 - 1955", FROM:"College - Iona", TEAM_LOGO:"./images/nba_spurs.jpg"}, +{NAME:"Sappleton, Wayne B.", ACTIVE:"1984 - 1984", FROM:"College - Loyola (Chicago)", TEAM_LOGO:"./images/nba_bobcats.jpg"}, +{NAME:"Sasser, Jason", ACTIVE:"1996 - 1998", FROM:"College - Texas Tech ''96", TEAM_LOGO:"./images/nba_heats.jpg"}, +{NAME:"Sasser, Jeryl", ACTIVE:"2001 - 2002", FROM:"College - Southern Methodist ''01", TEAM_LOGO:"./images/nba_trail.jpg"}, +{NAME:"Satterfield, Kenny", ACTIVE:"2001 - 2002", FROM:"College - Cincinnati ''03", TEAM_LOGO:"./images/nba_raptors.jpg"}, +{NAME:"Saul, Frank Benjamin Jr. (Pep)", ACTIVE:"1949 - 1954", FROM:"College - Seton Hall", TEAM_LOGO:"./images/nba_hawks.jpg"}, +{NAME:"Sauldsberry, Woodrow Jr. (Woody)", ACTIVE:"1957 - 1965", FROM:"College - Texas Southern", TEAM_LOGO:"./images/nba_rockets.jpg"}, +{NAME:"Saunders, James Frederick (Fred)", ACTIVE:"1974 - 1977", FROM:"College - Syracuse", TEAM_LOGO:"./images/nba_clippers.jpg"}, +{NAME:"Savage, Donald Joseph (Don)", ACTIVE:"1951 - 1956", FROM:"College - Le Moyne", TEAM_LOGO:"./images/nba_timberwolves.jpg"}, +{NAME:"Savovic, Predrag", ACTIVE:"2002 - 2002", FROM:"College - Hawaii ''02", TEAM_LOGO:"./images/nba_nuggets.jpg"}, +{NAME:"Sawyer, Alan Leigh", ACTIVE:"1950 - 1950", FROM:"College - UCLA", TEAM_LOGO:"./images/nba_bobcats.jpg"}, +{NAME:"Scalabrine, Brian", ACTIVE:"ACTIVE", FROM:"College - USC", TEAM_LOGO:"./images/nba_clippers.jpg"}, +{NAME:"Scales, Alex", ACTIVE:"2005 - 2005", FROM:"College - Oregon", TEAM_LOGO:"./images/nba_pacers.jpg"}, +{NAME:"Scales, DeWayne", ACTIVE:"1980 - 1983", FROM:"College - Louisiana State", TEAM_LOGO:"./images/nba_knics.jpg"}, +{NAME:"Schade, Frank", ACTIVE:"1972 - 1972", FROM:"College - Wis.-Eau Claire; Texas-El Paso", TEAM_LOGO:"./images/nba_heats.jpg"}, +{NAME:"Schadler, Bernard R. (Ben)", ACTIVE:"1947 - 1947", FROM:"College - Northwestern", TEAM_LOGO:"./images/nba_trail.jpg"}, +{NAME:"Schaefer, Herman H. (Herm)", ACTIVE:"1948 - 1949", FROM:"College - Indiana", TEAM_LOGO:"./images/nba_celtics.jpg"}, +{NAME:"Schafer, Robert Thomas (Bob)", ACTIVE:"1955 - 1955", FROM:"College - Villanova", TEAM_LOGO:"./images/nba_bucks.jpg"}, +{NAME:"Scharnus, Benedict Michael (Ben, Whitey)", ACTIVE:"1946 - 1948", FROM:"College - Seton Hall", TEAM_LOGO:"./images/nba_trail.jpg"}, +{NAME:"Schatzman, Marvin J. (Marv)", ACTIVE:"1949 - 1949", FROM:"College - St. Louis", TEAM_LOGO:"./images/nba_nuggets.jpg"}, +{NAME:"Schaus, Frederick Appleton (Fred)", ACTIVE:"1949 - 1953", FROM:"College - West Virginia", TEAM_LOGO:"./images/nba_pacers.jpg"}, +{NAME:"Schayes, Danny", ACTIVE:"1981 - 1998", FROM:"College - Syracuse", TEAM_LOGO:"./images/nba_spurs.jpg"}, +{NAME:"Schayes, Dolph", ACTIVE:"1949 - 1963", FROM:"College - N.Y.U.", TEAM_LOGO:"./images/nba_pacers.jpg"}, +{NAME:"Schectman, Oscar B. (Ossie)", ACTIVE:"1946 - 1946", FROM:"College - Long Island University", TEAM_LOGO:"./images/nba_clippers.jpg"}, +{NAME:"Scheffler, Steve", ACTIVE:"1990 - 1996", FROM:"College - Purdue", TEAM_LOGO:"./images/nba_suns.jpg"}, +{NAME:"Scheffler, Thomas Mark (Tom)", ACTIVE:"1984 - 1984", FROM:"College - Purdue", TEAM_LOGO:"./images/nba_rockets.jpg"}, +{NAME:"Schellhase, David Gene Jr. (Dave)", ACTIVE:"1966 - 1967", FROM:"College - Purdue", TEAM_LOGO:"./images/nba_magics.jpg"}, +{NAME:"Schenscher, Luke", ACTIVE:"2005 - 2006", FROM:"College - Georgia Tech", TEAM_LOGO:"./images/nba_pacers.jpg"}, +{NAME:"Scherer, Herbert Frederick (Herb)", ACTIVE:"1950 - 1951", FROM:"College - Long Island University", TEAM_LOGO:"./images/nba_lakers.jpg"}, +{NAME:"Schintzius, Dwayne", ACTIVE:"1990 - 1998", FROM:"College - Florida", TEAM_LOGO:"./images/nba_timberwolves.jpg"}, +{NAME:"Schlueter, Dale Wayne", ACTIVE:"1968 - 1977", FROM:"College - Colorado State", TEAM_LOGO:"./images/nba_rockets.jpg"}, +{NAME:"Tabak, Zan", ACTIVE:"1994 - 2000", FROM:"College - No College", TEAM_LOGO:"./images/nba_suns.jpg"}, +{NAME:"Tabuse, Yuta", ACTIVE:"2004 - 2004", FROM:"College - BYU-Hawaii", TEAM_LOGO:"./images/nba_pistons.jpg"}, +{NAME:"Taft, Chris", ACTIVE:"2005 - 2005", FROM:"College - Pittsburgh", TEAM_LOGO:"./images/nba_warriors.jpg"}, +{NAME:"Tannenbaum, Sidney (Sid)", ACTIVE:"1947 - 1948", FROM:"College - N.Y.U.", TEAM_LOGO:"./images/nba_trail.jpg"}, +{NAME:"Tarlac, Dragan", ACTIVE:"2000 - 2000", FROM:"College - Olympiakos (Greece)", TEAM_LOGO:"./images/nba_jazz.jpg"}, +{NAME:"Tarpley, Roy", ACTIVE:"1986 - 1994", FROM:"College - Michigan", TEAM_LOGO:"./images/nba_pacers.jpg"}, +{NAME:"Tatum, William Earl (Earl)", ACTIVE:"1976 - 1979", FROM:"College - Marquette", TEAM_LOGO:"./images/nba_knics.jpg"}, +{NAME:"Taylor, Anthony", ACTIVE:"1988 - 1988", FROM:"College - Oregon", TEAM_LOGO:"./images/nba_griz.jpg"}, +{NAME:"Taylor, Brian Dw.", ACTIVE:"1976 - 1981", FROM:"College - Princeton", TEAM_LOGO:"./images/nba_mavericks.jpg"}, +{NAME:"Taylor, Donell", ACTIVE:"2005 - 2006", FROM:"College - Alabama-Birmingham", TEAM_LOGO:"./images/nba_spurs.jpg"}, +{NAME:"Taylor, Fredrick Ollie (Fred)", ACTIVE:"1970 - 1971", FROM:"College - Texas-Pan American", TEAM_LOGO:"./images/nba_sonics.jpg"}, +{NAME:"Taylor, Jay", ACTIVE:"1989 - 1989", FROM:"College - Eastern Illinois", TEAM_LOGO:"./images/nba_griz.jpg"}, +{NAME:"Taylor, Jeff", ACTIVE:"1982 - 1986", FROM:"College - Texas Tech", TEAM_LOGO:"./images/nba_trail.jpg"}, +{NAME:"Taylor, Jermaine", ACTIVE:"2009 - 2010", FROM:"College - Central Florida", TEAM_LOGO:"./images/nba_cavaliers.jpg"}, +{NAME:"Taylor, Johnny", ACTIVE:"1997 - 1999", FROM:"College - Knoxville; Indian Hills CC IA; Tennessee-Chattanooga", TEAM_LOGO:"./images/nba_jazz.jpg"}, +{NAME:"Taylor, Leonard", ACTIVE:"1989 - 1989", FROM:"College - California", TEAM_LOGO:"./images/nba_bucks.jpg"}, +{NAME:"Taylor, Maurice", ACTIVE:"1997 - 2006", FROM:"College - Michigan", TEAM_LOGO:"./images/nba_bulls.jpg"}, +{NAME:"Taylor, Mike", ACTIVE:"2008 - 2008", FROM:"College - Iowa State", TEAM_LOGO:"./images/nba_heats.jpg"}, +{NAME:"Taylor, Roland Morris (Fatty)", ACTIVE:"1976 - 1976", FROM:"College - Edison CC FL; La Salle", TEAM_LOGO:"./images/nba_jazz.jpg"}, +{NAME:"Taylor, Vince", ACTIVE:"1982 - 1982", FROM:"College - Duke", TEAM_LOGO:"./images/nba_sonics.jpg"}, +{NAME:"Teagle, Terry", ACTIVE:"1982 - 1992", FROM:"College - Baylor", TEAM_LOGO:"./images/nba_clippers.jpg"}, +{NAME:"Teague, Jeff", ACTIVE:"ACTIVE", FROM:"College - Wake Forest", TEAM_LOGO:"./images/nba_mavericks.jpg"}, +{NAME:"Telfair, Sebastian", ACTIVE:"ACTIVE", FROM:"High School - Abraham Lincoln HS (Brooklyn, NY)", TEAM_LOGO:"./images/nba_kings.jpg"}, +{NAME:"Temple, Garrett", ACTIVE:"ACTIVE", FROM:"College - Louisiana State", TEAM_LOGO:"./images/nba_wizards.jpg"}, +{NAME:"Terrell, Ira Edmondson", ACTIVE:"1976 - 1978", FROM:"College - Southern Methodist", TEAM_LOGO:"./images/nba_suns.jpg"}, +{NAME:"Terry, Allen Charles (Chuck)", ACTIVE:"1972 - 1976", FROM:"College - Long Beach State", TEAM_LOGO:"./images/nba_wizards.jpg"}, +{NAME:"Terry, Carlos", ACTIVE:"1980 - 1982", FROM:"College - Winston-Salem State", TEAM_LOGO:"./images/nba_sonics.jpg"}, +{NAME:"Terry, Claude Lewis", ACTIVE:"1976 - 1977", FROM:"College - Stanford", TEAM_LOGO:"./images/nba_timberwolves.jpg"}, +{NAME:"Terry, Jason", ACTIVE:"ACTIVE", FROM:"College - Arizona", TEAM_LOGO:"./images/nba_nets.jpg"}, +{NAME:"Thabeet, Hasheem", ACTIVE:"ACTIVE", FROM:"College - Connecticut", TEAM_LOGO:"./images/nba_bobcats.jpg"}, +{NAME:"Thacker, Thomas Porter (Tom, Tack)", ACTIVE:"1963 - 1967", FROM:"College - Cincinnati", TEAM_LOGO:"./images/nba_clippers.jpg"}, +{NAME:"Theus, Reggie", ACTIVE:"1978 - 1990", FROM:"College - Nevada-Las Vegas", TEAM_LOGO:"./images/nba_sonics.jpg"}, +{NAME:"Thibeaux, Peter C.", ACTIVE:"1984 - 1985", FROM:"College - St. Mary's (CA)", TEAM_LOGO:"./images/nba_celtics.jpg"}, +{NAME:"Thieben, William Bernard (Bill)", ACTIVE:"1956 - 1957", FROM:"College - Hofstra", TEAM_LOGO:"./images/nba_mavericks.jpg"}, +{NAME:"Thigpen, Justus", ACTIVE:"1972 - 1973", FROM:"College - Charles Stewart Mott CC MI; Weber State", TEAM_LOGO:"./images/nba_griz.jpg"}, +{NAME:"Thirdkill, David", ACTIVE:"1982 - 1986", FROM:"College - Coll. of Southern Idaho (J.C.); Bradley", TEAM_LOGO:"./images/nba_magics.jpg"}, +{NAME:"Thomas, Billy", ACTIVE:"2007 - 2007", FROM:"College - Kansas", TEAM_LOGO:"./images/nba_clippers.jpg"}, +{NAME:"Thomas, Carl", ACTIVE:"1991 - 1997", FROM:"College - Eastern Michigan", TEAM_LOGO:"./images/nba_bulls.jpg"}, +{NAME:"Thomas, Charles", ACTIVE:"1991 - 1991", FROM:"College - Eastern Michigan", TEAM_LOGO:"./images/nba_heats.jpg"}, +{NAME:"Thomas, Etan", ACTIVE:"ACTIVE", FROM:"College - Syracuse", TEAM_LOGO:"./images/nba_nuggets.jpg"}, +{NAME:"Thomas, Irving", ACTIVE:"1990 - 1990", FROM:"College - Kentucky; Florida State", TEAM_LOGO:"./images/nba_bulls.jpg"}, +{NAME:"Thomas, Isiah", ACTIVE:"1981 - 1993", FROM:"College - Indiana", TEAM_LOGO:"./images/nba_76ers.jpg"}, +{NAME:"Thomas, Jamel", ACTIVE:"1999 - 2000", FROM:"College - Providence", TEAM_LOGO:"./images/nba_kings.jpg"}, +{NAME:"Thomas, Jamel", ACTIVE:"1999 - 2000", FROM:"College - Providence", TEAM_LOGO:"./images/nba_76ers.jpg"}, +{NAME:"Thomas, James", ACTIVE:"2004 - 2005", FROM:"College - Texas", TEAM_LOGO:"./images/nba_bulls.jpg"}, +{NAME:"Thomas, Jim", ACTIVE:"1983 - 1990", FROM:"College - Indiana", TEAM_LOGO:"./images/nba_sonics.jpg"}, +{NAME:"Thomas, John", ACTIVE:"1997 - 2005", FROM:"College - Minnesota", TEAM_LOGO:"./images/nba_bobcats.jpg"}, +{NAME:"Thomas, Joseph Randle (Joe)", ACTIVE:"1970 - 1970", FROM:"College - Marquette", TEAM_LOGO:"./images/nba_bulls.jpg"}, +{NAME:"Thomas, Kenny", ACTIVE:"2007 - 2009", FROM:"College - New Mexico", TEAM_LOGO:"./images/nba_heats.jpg"}, +{NAME:"Thomas, Kurt", ACTIVE:"ACTIVE", FROM:"College - Texas Christian", TEAM_LOGO:"./images/nba_pistons.jpg"}, +{NAME:"Udoh, Ekpe", ACTIVE:"ACTIVE", FROM:"College - Baylor", TEAM_LOGO:"./images/nba_bulls.jpg"}, +{NAME:"Udoka, Ime", ACTIVE:"2007 - 2010", FROM:"College - Portland State", TEAM_LOGO:"./images/nba_sonics.jpg"}, +{NAME:"Udrih, Beno", ACTIVE:"ACTIVE", FROM:"From - Sempeter, Slovenia", TEAM_LOGO:"./images/nba_bucks.jpg"}, +{NAME:"Ukic, Roko", ACTIVE:"2008 - 2009", FROM:"From - Split, Croatia", TEAM_LOGO:"./images/nba_jazz.jpg"}, +{NAME:"Unseld, Wes", ACTIVE:"1968 - 1980", FROM:"College - Louisville", TEAM_LOGO:"./images/nba_kings.jpg"}, +{NAME:"Uplinger, Harold F. (Hal)", ACTIVE:"1953 - 1953", FROM:"College - Long Island University", TEAM_LOGO:"./images/nba_suns.jpg"}, +{NAME:"Upshaw, Kelvin", ACTIVE:"1988 - 1990", FROM:"College - Northeastern State (Okla.); Utah", TEAM_LOGO:"./images/nba_hawks.jpg"}, +{NAME:"Uzoh, Ben", ACTIVE:"ACTIVE", FROM:"College - Tulsa", TEAM_LOGO:"./images/nba_honets.jpg"}, +{NAME:"Valentine, Darnell", ACTIVE:"1981 - 1990", FROM:"College - Kansas", TEAM_LOGO:"./images/nba_celtics.jpg"}, +{NAME:"Valentine, Ronnie L. (Ron)", ACTIVE:"1980 - 1980", FROM:"College - Old Dominion", TEAM_LOGO:"./images/nba_griz.jpg"}, +{NAME:"Vallely, John Stephen", ACTIVE:"1970 - 1971", FROM:"College - Orange Coast Coll. CA (J.C.); UCLA", TEAM_LOGO:"./images/nba_bulls.jpg"}, +{NAME:"Van Arsdale, Dick", ACTIVE:"1965 - 1976", FROM:"College - Indiana", TEAM_LOGO:"./images/nba_spurs.jpg"}, +{NAME:"Van Arsdale, Thomas Arthur (Tom)", ACTIVE:"1965 - 1976", FROM:"College - Indiana", TEAM_LOGO:"./images/nba_kings.jpg"}, +{NAME:"Van Breda Kolff, Jan", ACTIVE:"1976 - 1982", FROM:"College - Vanderbilt", TEAM_LOGO:"./images/nba_timberwolves.jpg"}, +{NAME:"Van Breda Kolff, Willem H. (Butch)", ACTIVE:"1946 - 1949", FROM:"College - Princeton; N.Y.U.", TEAM_LOGO:"./images/nba_griz.jpg"}, +{NAME:"Van Exel, Nick", ACTIVE:"1993 - 2005", FROM:"College - Cincinnati", TEAM_LOGO:"./images/nba_lakers.jpg"}, +{NAME:"Van Horn, Keith", ACTIVE:"1997 - 2005", FROM:"College - Utah", TEAM_LOGO:"./images/nba_suns.jpg"}, +{NAME:"Van Lier, Norm", ACTIVE:"1969 - 1978", FROM:"College - St. Francis (PA)", TEAM_LOGO:"./images/nba_nets.jpg"}, +{NAME:"Vance, Ellis Eugene (Gene)", ACTIVE:"1947 - 1951", FROM:"College - Illinois", TEAM_LOGO:"./images/nba_heats.jpg"}, +{NAME:"Vander Velden, Logan", ACTIVE:"1995 - 1995", FROM:"College - Wis.-Green Bay", TEAM_LOGO:"./images/nba_suns.jpg"}, +{NAME:"Vandeweghe, Ernest Maurice Jr. (Ernie, Doc)", ACTIVE:"1949 - 1955", FROM:"College - Colgate", TEAM_LOGO:"./images/nba_honets.jpg"}, +{NAME:"Vandeweghe, Kiki", ACTIVE:"1980 - 1992", FROM:"College - UCLA", TEAM_LOGO:"./images/nba_bucks.jpg"}, +{NAME:"Vanos, Nick", ACTIVE:"1985 - 1986", FROM:"College - Santa Clara", TEAM_LOGO:"./images/nba_76ers.jpg"}, +{NAME:"Vanterpool, David", ACTIVE:"2000 - 2000", FROM:"College - St. Bonaventure", TEAM_LOGO:"./images/nba_sonics.jpg"}, +{NAME:"Varda, Ratko", ACTIVE:"2001 - 2001", FROM:"From - Serbia & Montenegro", TEAM_LOGO:"./images/nba_timberwolves.jpg"}, +{NAME:"Varejao, Anderson", ACTIVE:"ACTIVE", FROM:"From - Santa Teresa, Brazil", TEAM_LOGO:"./images/nba_sonics.jpg"}, +{NAME:"Vasquez, Greivis", ACTIVE:"ACTIVE", FROM:"College - Maryland", TEAM_LOGO:"./images/nba_kings.jpg"}, +{NAME:"Vaughn, Charles (Chico)", ACTIVE:"1962 - 1966", FROM:"College - Southern Illinois", TEAM_LOGO:"./images/nba_bulls.jpg"}, +{NAME:"Vaughn, David", ACTIVE:"1995 - 1998", FROM:"College - Memphis", TEAM_LOGO:"./images/nba_raptors.jpg"}, +{NAME:"Vaughn, Jacque", ACTIVE:"2007 - 2008", FROM:"College - Kansas", TEAM_LOGO:"./images/nba_lakers.jpg"}, +{NAME:"Vaughn, Virgil V.", ACTIVE:"1946 - 1946", FROM:"College - Kentucky Wesleyan", TEAM_LOGO:"./images/nba_wizards.jpg"}, +{NAME:"Vaught, Loy", ACTIVE:"1990 - 2000", FROM:"College - Michigan", TEAM_LOGO:"./images/nba_kings.jpg"}, +{NAME:"Verga, Robert Bruce (Bob)", ACTIVE:"1973 - 1973", FROM:"College - Duke", TEAM_LOGO:"./images/nba_bobcats.jpg"}, +{NAME:"Verhoeven, Peter", ACTIVE:"1981 - 1986", FROM:"College - Fresno State", TEAM_LOGO:"./images/nba_pacers.jpg"}, +{NAME:"Vetra, Gundars", ACTIVE:"1992 - 1992", FROM:"College - No College", TEAM_LOGO:"./images/nba_heats.jpg"}, +{NAME:"Vianna, Joao", ACTIVE:"1991 - 1991", FROM:"College - Travajara (Brazil)", TEAM_LOGO:"./images/nba_bulls.jpg"}, +{NAME:"Villanueva, Charlie", ACTIVE:"ACTIVE", FROM:"College - Connecticut", TEAM_LOGO:"./images/nba_pistons.jpg"}, +{NAME:"Vincent, Jay", ACTIVE:"1981 - 1989", FROM:"College - Michigan State", TEAM_LOGO:"./images/nba_kings.jpg"}, +{NAME:"Vincent, Sam", ACTIVE:"1985 - 1991", FROM:"College - Michigan State", TEAM_LOGO:"./images/nba_hawks.jpg"}, +{NAME:"Vinicius, Marcus", ACTIVE:"2007 - 2007", FROM:"From - Brazil", TEAM_LOGO:"./images/nba_knics.jpg"}, +{NAME:"Vinson, Fred", ACTIVE:"1994 - 1999", FROM:"College - Georgia Tech", TEAM_LOGO:"./images/nba_pistons.jpg"}, +{NAME:"Voce, Gary", ACTIVE:"1989 - 1989", FROM:"College - Notre Dame", TEAM_LOGO:"./images/nba_warriors.jpg"}, +{NAME:"Volker, Floyd W.", ACTIVE:"1949 - 1949", FROM:"College - Wyoming", TEAM_LOGO:"./images/nba_sonics.jpg"}, +{NAME:"Volkov, Alexander", ACTIVE:"1989 - 1991", FROM:"College - Kiev Institute (Ukraine)", TEAM_LOGO:"./images/nba_sonics.jpg"}, +{NAME:"Von Nieda, Stanley L. Jr. (Whitey)", ACTIVE:"1949 - 1949", FROM:"College - Penn State", TEAM_LOGO:"./images/nba_bulls.jpg"}, +{NAME:"Voskuhl, Jake", ACTIVE:"2007 - 2008", FROM:"College - Connecticut", TEAM_LOGO:"./images/nba_nets.jpg"}, +{NAME:"Vranes, Danny", ACTIVE:"1981 - 1987", FROM:"College - Utah", TEAM_LOGO:"./images/nba_sonics.jpg"}, +{NAME:"Vranes, Slavko", ACTIVE:"2003 - 2003", FROM:"From - Serbia & Montenegro", TEAM_LOGO:"./images/nba_knics.jpg"}, +{NAME:"Vrankovic, Stojko", ACTIVE:"1990 - 1998", FROM:"College - Croatia", TEAM_LOGO:"./images/nba_celtics.jpg"}, +{NAME:"Vroman, Brett Grant", ACTIVE:"1980 - 1980", FROM:"College - UCLA; Nevada-Las Vegas", TEAM_LOGO:"./images/nba_cavaliers.jpg"}, +{NAME:"Vroman, Jackson", ACTIVE:"2004 - 2005", FROM:"College - Iowa State", TEAM_LOGO:"./images/nba_honets.jpg"}, +{NAME:"Vujacic, Sasha", ACTIVE:"ACTIVE", FROM:"From - Maribor, Slovenia", TEAM_LOGO:"./images/nba_griz.jpg"}, +{NAME:"Wade, Dwyane", ACTIVE:"ACTIVE", FROM:"College - Marquette", TEAM_LOGO:"./images/nba_knics.jpg"}, +{NAME:"Wade, Mark", ACTIVE:"1987 - 1989", FROM:"College - El Camino Coll. CA (J.C.); Oklahoma; Nevada-Las Vegas", TEAM_LOGO:"./images/nba_raptors.jpg"}, +{NAME:"Wafer, Von", ACTIVE:"ACTIVE", FROM:"College - Florida State", TEAM_LOGO:"./images/nba_honets.jpg"}, +{NAME:"Wager, Clinton B. (Clint)", ACTIVE:"1949 - 1949", FROM:"College - St. Mary's (Minn.)", TEAM_LOGO:"./images/nba_rockets.jpg"}, +{NAME:"Wagner, Dajuan", ACTIVE:"2002 - 2006", FROM:"College - Memphis", TEAM_LOGO:"./images/nba_wizards.jpg"}, +{NAME:"Wagner, Daniel Earnest (Danny)", ACTIVE:"1949 - 1949", FROM:"College - Schreiner Coll.; Texas", TEAM_LOGO:"./images/nba_bulls.jpg"}, +{NAME:"Wagner, Milt", ACTIVE:"1987 - 1990", FROM:"College - Louisville", TEAM_LOGO:"./images/nba_griz.jpg"}, +{NAME:"Waiters, Granville", ACTIVE:"1983 - 1987", FROM:"College - Ohio State", TEAM_LOGO:"./images/nba_76ers.jpg"}, +{NAME:"Wakefield, Andre", ACTIVE:"1978 - 1979", FROM:"College - Coll. of Southern Idaho (J.C.); Loyola (Chicago)", TEAM_LOGO:"./images/nba_clippers.jpg"}, +{NAME:"Walk, Neal", ACTIVE:"1969 - 1976", FROM:"College - Florida", TEAM_LOGO:"./images/nba_mavericks.jpg"}, +{NAME:"Walker, Andrew Martin (Andy)", ACTIVE:"1976 - 1976", FROM:"College - Niagara", TEAM_LOGO:"./images/nba_cavaliers.jpg"}, +{NAME:"Walker, Antoine", ACTIVE:"2007 - 2007", FROM:"College - Kentucky", TEAM_LOGO:"./images/nba_magics.jpg"}, +{NAME:"Walker, Bill", ACTIVE:"ACTIVE", FROM:"College - Kansas State", TEAM_LOGO:"./images/nba_nuggets.jpg"}, +{NAME:"Walker, Brady W.", ACTIVE:"1948 - 1951", FROM:"College - Brigham Young", TEAM_LOGO:"./images/nba_pistons.jpg"}, +{NAME:"Walker, Chet", ACTIVE:"1962 - 1974", FROM:"College - Bradley", TEAM_LOGO:"./images/nba_mavericks.jpg"}, +{NAME:"Walker, Darrell", ACTIVE:"1983 - 1992", FROM:"College - Westark CC; Arkansas", TEAM_LOGO:"./images/nba_celtics.jpg"}, +{NAME:"Walker, Foots", ACTIVE:"1974 - 1983", FROM:"College - Vincennes IN (J.C.); West Georgia", TEAM_LOGO:"./images/nba_cavaliers.jpg"}, +{NAME:"Walker, Horace", ACTIVE:"1961 - 1961", FROM:"College - Michigan State", TEAM_LOGO:"./images/nba_warriors.jpg"}, +{NAME:"Walker, James (Jimmy)", ACTIVE:"1967 - 1975", FROM:"College - Providence", TEAM_LOGO:"./images/nba_mavericks.jpg"}, +{NAME:"Walker, Kenny", ACTIVE:"1986 - 1994", FROM:"College - Kentucky", TEAM_LOGO:"./images/nba_76ers.jpg"}, +{NAME:"Walker, Phillip B. (Phil)", ACTIVE:"1977 - 1977", FROM:"College - Millersville", TEAM_LOGO:"./images/nba_nuggets.jpg"}, +{NAME:"Walker, Samaki", ACTIVE:"1996 - 2005", FROM:"College - Louisville", TEAM_LOGO:"./images/nba_pistons.jpg"}, +{NAME:"Walker, Wally", ACTIVE:"1976 - 1983", FROM:"College - Virginia", TEAM_LOGO:"./images/nba_warriors.jpg"}, +{NAME:"Wall, John", ACTIVE:"ACTIVE", FROM:"College - Kentucky", TEAM_LOGO:"./images/nba_timberwolves.jpg"}, +{NAME:"Wallace, Ben", ACTIVE:"ACTIVE", FROM:"College - Virginia Union", TEAM_LOGO:"./images/nba_mavericks.jpg"}, +{NAME:"Wallace, Gerald", ACTIVE:"ACTIVE", FROM:"College - Alabama", TEAM_LOGO:"./images/nba_cavaliers.jpg"}, +{NAME:"Wallace, John", ACTIVE:"1996 - 2003", FROM:"College - Syracuse ''96", TEAM_LOGO:"./images/nba_spurs.jpg"}, +{NAME:"Wallace, Michael John (Red)", ACTIVE:"1946 - 1946", FROM:"College - Scranton", TEAM_LOGO:"./images/nba_honets.jpg"}, +{NAME:"Wallace, Rasheed", ACTIVE:"2007 - 2009", FROM:"College - North Carolina", TEAM_LOGO:"./images/nba_cavaliers.jpg"}, +{NAME:"Waller, Dwight", ACTIVE:"1968 - 1968", FROM:"College - Tennessee State", TEAM_LOGO:"./images/nba_pistons.jpg"}, +{NAME:"Waller, Jamie", ACTIVE:"1987 - 1987", FROM:"College - Virginia Union", TEAM_LOGO:"./images/nba_rockets.jpg"}, +{NAME:"Walsh, James Patrick (Jim)", ACTIVE:"1957 - 1957", FROM:"College - Stanford", TEAM_LOGO:"./images/nba_mavericks.jpg"}, +{NAME:"Walsh, Matt", ACTIVE:"2005 - 2005", FROM:"College - Florida", TEAM_LOGO:"./images/nba_honets.jpg"}, +{NAME:"Walters, Rex", ACTIVE:"1993 - 1999", FROM:"College - De Anza Coll. CA (J.C.); Northwestern; Kansas", TEAM_LOGO:"./images/nba_bobcats.jpg"}, +{NAME:"Walther, Paul P. (Lefty)", ACTIVE:"1949 - 1954", FROM:"College - Tennessee", TEAM_LOGO:"./images/nba_bobcats.jpg"}, +{NAME:"Walthour, Isaac (Rabbit)", ACTIVE:"1953 - 1953", FROM:"College - No College", TEAM_LOGO:"./images/nba_bucks.jpg"}, +{NAME:"Walton, Bill", ACTIVE:"1974 - 1986", FROM:"College - UCLA", TEAM_LOGO:"./images/nba_heats.jpg"}, +{NAME:"Walton, Lloyd", ACTIVE:"1976 - 1980", FROM:"College - Moberly Area CC; Marquette", TEAM_LOGO:"./images/nba_celtics.jpg"}, +{NAME:"Walton, Luke", ACTIVE:"ACTIVE", FROM:"College - Arizona", TEAM_LOGO:"./images/nba_timberwolves.jpg"}, +{NAME:"Wang Zhizhi", ACTIVE:"2000 - 2004", FROM:"From - China", TEAM_LOGO:"./images/nba_warriors.jpg"}, +{NAME:"Wanzer, Robert Francis (Bobby)", ACTIVE:"1948 - 1956", FROM:"College - Colgate; Seton Hall", TEAM_LOGO:"./images/nba_magics.jpg"}, +{NAME:"Warbington, Perry", ACTIVE:"1974 - 1974", FROM:"College - Lake City CC FL; Georgia Southern", TEAM_LOGO:"./images/nba_cavaliers.jpg"}, +{NAME:"Ward, Charlie", ACTIVE:"1994 - 2004", FROM:"College - Florida State", TEAM_LOGO:"./images/nba_sonics.jpg"}, +{NAME:"Ward, Gerald W. (Gerry)", ACTIVE:"1963 - 1966", FROM:"College - Boston College", TEAM_LOGO:"./images/nba_hawks.jpg"}, +{NAME:"Ward, Henry Lorette", ACTIVE:"1976 - 1976", FROM:"College - Jackson State", TEAM_LOGO:"./images/nba_cavaliers.jpg"}, +{NAME:"Ware, James Edward (Jim)", ACTIVE:"1966 - 1967", FROM:"College - Oklahoma City", TEAM_LOGO:"./images/nba_magics.jpg"}, +{NAME:"Warley, Benjamin Vallintina (Ben)", ACTIVE:"1962 - 1966", FROM:"College - Tennessee State", TEAM_LOGO:"./images/nba_rockets.jpg"}, +{NAME:"Warlick, Robert Lee (Bob)", ACTIVE:"1965 - 1968", FROM:"College - Pueblo CC CO; Pepperdine; Denver", TEAM_LOGO:"./images/nba_nets.jpg"}, +{NAME:"Warner, Cornell", ACTIVE:"1970 - 1976", FROM:"College - Jackson State", TEAM_LOGO:"./images/nba_trail.jpg"}, +{NAME:"Warren, John II (Johnny)", ACTIVE:"1969 - 1973", FROM:"College - St. John's (N.Y.)", TEAM_LOGO:"./images/nba_hawks.jpg"}, +{NAME:"Yarbrough, Vincent", ACTIVE:"2002 - 2002", FROM:"College - Tennessee ''02", TEAM_LOGO:"./images/nba_lakers.jpg"}, +{NAME:"Yardley, George", ACTIVE:"1953 - 1959", FROM:"College - Stanford", TEAM_LOGO:"./images/nba_76ers.jpg"}, +{NAME:"Yates, Barry", ACTIVE:"1971 - 1971", FROM:"College - Nebraska; Maryland", TEAM_LOGO:"./images/nba_pistons.jpg"}, +{NAME:"Yates, Wayne E.", ACTIVE:"1961 - 1961", FROM:"College - Memphis", TEAM_LOGO:"./images/nba_76ers.jpg"}, +{NAME:"Yelverton, Charles W. (Charlie)", ACTIVE:"1971 - 1971", FROM:"College - Fordham", TEAM_LOGO:"./images/nba_nuggets.jpg"}, +{NAME:"Yonakor, Richard Robert (Rich)", ACTIVE:"1981 - 1981", FROM:"College - North Carolina", TEAM_LOGO:"./images/nba_timberwolves.jpg"}, +{NAME:"Young, Danny", ACTIVE:"1984 - 1994", FROM:"College - Wake Forest", TEAM_LOGO:"./images/nba_warriors.jpg"}, +{NAME:"Young, Korleone", ACTIVE:"1998 - 1998", FROM:"College - No College", TEAM_LOGO:"./images/nba_griz.jpg"}, +{NAME:"Young, Michael", ACTIVE:"1984 - 1989", FROM:"College - Houston", TEAM_LOGO:"./images/nba_bucks.jpg"}, +{NAME:"Young, Nick", ACTIVE:"ACTIVE", FROM:"College - USC", TEAM_LOGO:"./images/nba_bobcats.jpg"}, +{NAME:"Young, Perry", ACTIVE:"1986 - 1986", FROM:"College - Virginia Tech", TEAM_LOGO:"./images/nba_sonics.jpg"}, +{NAME:"Young, Sam", ACTIVE:"ACTIVE", FROM:"College - Pittsburgh", TEAM_LOGO:"./images/nba_lakers.jpg"}, +{NAME:"Young, Thaddeus", ACTIVE:"ACTIVE", FROM:"College - Georgia Tech", TEAM_LOGO:"./images/nba_lakers.jpg"}, +{NAME:"Young, Tim", ACTIVE:"1999 - 1999", FROM:"College - Stanford", TEAM_LOGO:"./images/nba_lakers.jpg"}, +{NAME:"Yue, Sun", ACTIVE:"2008 - 2008", FROM:"From - China", TEAM_LOGO:"./images/nba_wizards.jpg"}, +{NAME:"Zaslofsky, Max (Slats)", ACTIVE:"1946 - 1955", FROM:"College - Chicago; St. John's (N.Y.)", TEAM_LOGO:"./images/nba_mavericks.jpg"}, +{NAME:"Zawoluk, Robert Michael (Zeke)", ACTIVE:"1952 - 1954", FROM:"College - St. John's (N.Y.)", TEAM_LOGO:"./images/nba_bucks.jpg"}, +{NAME:"Zeller, David A. (Dave)", ACTIVE:"1961 - 1961", FROM:"College - Miami (Ohio)", TEAM_LOGO:"./images/nba_trail.jpg"}, +{NAME:"Zeller, Gary Lynn", ACTIVE:"1970 - 1971", FROM:"College - Drake", TEAM_LOGO:"./images/nba_raptors.jpg"}, +{NAME:"Zeller, Harry Raymond (Hank)", ACTIVE:"1946 - 1946", FROM:"College - Pittsburgh; Washington & Jefferson", TEAM_LOGO:"./images/nba_warriors.jpg"}, +{NAME:"Zeno, Anthony Michael (Tony)", ACTIVE:"1979 - 1979", FROM:"College - Arizona State", TEAM_LOGO:"./images/nba_pacers.jpg"}, +{NAME:"Zevenbergen, Phil", ACTIVE:"1987 - 1987", FROM:"College - Seattle Pacific; Edmonds CC WA; Washington", TEAM_LOGO:"./images/nba_honets.jpg"}, +{NAME:"Zidek, George", ACTIVE:"1995 - 1997", FROM:"College - UCLA", TEAM_LOGO:"./images/nba_sonics.jpg"}, +{NAME:"Zimmerman, Derrick", ACTIVE:"2005 - 2005", FROM:"College - Mississippi State", TEAM_LOGO:"./images/nba_nuggets.jpg"}, +{NAME:"Zoet, Jim", ACTIVE:"1982 - 1982", FROM:"College - Kent State", TEAM_LOGO:"./images/nba_suns.jpg"}, +{NAME:"Zopf, William Charles Jr. (Bill, Zip)", ACTIVE:"1970 - 1970", FROM:"College - Duquesne", TEAM_LOGO:"./images/nba_hawks.jpg"}, +{NAME:"Zunic, Matthew (Matt, Mad Matt)", ACTIVE:"1948 - 1948", FROM:"College - George Washington", TEAM_LOGO:"./images/nba_clippers.jpg"} +]; \ No newline at end of file diff --git a/demos/tizen-winsets/widgets/list/virtuallist-normal.html b/demos/tizen-winsets/widgets/list/virtuallist-normal.html new file mode 100755 index 0000000..06379f8 --- /dev/null +++ b/demos/tizen-winsets/widgets/list/virtuallist-normal.html @@ -0,0 +1,13 @@ +
    +
    +

    Virtual List - Normal Style 1line

    +
    +
    + + +
      +
    +
    +
    diff --git a/demos/tizen-winsets/widgets/list/virtuallist-normal_3_1_14.html b/demos/tizen-winsets/widgets/list/virtuallist-normal_3_1_14.html new file mode 100755 index 0000000..7d65ed1 --- /dev/null +++ b/demos/tizen-winsets/widgets/list/virtuallist-normal_3_1_14.html @@ -0,0 +1,18 @@ + +
    +
    +

    Virtual List - Normal Style 1line-bigicon5

    +
    +
    + +
      +
    +
    +
    diff --git a/demos/tizen-winsets/widgets/list/virtuallist-normal_3_1_4.html b/demos/tizen-winsets/widgets/list/virtuallist-normal_3_1_4.html new file mode 100755 index 0000000..7ef26a4 --- /dev/null +++ b/demos/tizen-winsets/widgets/list/virtuallist-normal_3_1_4.html @@ -0,0 +1,15 @@ +
    +
    +

    Virtual List - Normal Style 1line-btn1

    +
    +
    + +
      +
    +
    +
    diff --git a/demos/tizen-winsets/widgets/list/virtuallist-normal_3_1_6.html b/demos/tizen-winsets/widgets/list/virtuallist-normal_3_1_6.html new file mode 100755 index 0000000..cbde96c --- /dev/null +++ b/demos/tizen-winsets/widgets/list/virtuallist-normal_3_1_6.html @@ -0,0 +1,16 @@ + +
    +
    +

    Virtual List - Normal Style 1line-toggle

    +
    +
    + +
      +
    +
    +
    diff --git a/demos/tizen-winsets/widgets/list/virtuallist-normal_3_2_7.html b/demos/tizen-winsets/widgets/list/virtuallist-normal_3_2_7.html new file mode 100755 index 0000000..f06d891 --- /dev/null +++ b/demos/tizen-winsets/widgets/list/virtuallist-normal_3_2_7.html @@ -0,0 +1,21 @@ + +
    +
    +

    Virtual List - Normal Style 2line-star1

    +
    +
    + + +
      +
    +
    +
    diff --git a/demos/tizen-winsets/widgets/listviewcontrols.html b/demos/tizen-winsets/widgets/listviewcontrols.html new file mode 100755 index 0000000..add7e2f --- /dev/null +++ b/demos/tizen-winsets/widgets/listviewcontrols.html @@ -0,0 +1,79 @@ + +
    +
    +

    Listview controls

    +
    +
    + + +
    +
    +
    +
    +
    +

    These are the controls which can operate over all of + the items in the listview. Note that if you filter the + list, these controls will only affect the currently-visible + items. Also note that we're using autodividers here too :)

    + +
    + + +
    +
    + +
      +
    • +
      + + +
      + Greg +
    • +
    • +
      + + +
      + Greta +
    • +
    • +
      + + +
      + Pete +
    • +
    • +
      + + +
      + Phil +
    • +
    • +
      + + +
      + Sue +
    • +
    +
    +
    +

    Web UI Framework - Widgets gallery

    +
    +
    + + diff --git a/demos/tizen-winsets/widgets/multibuttonentry-demo.js b/demos/tizen-winsets/widgets/multibuttonentry-demo.js new file mode 100755 index 0000000..7e648b1 --- /dev/null +++ b/demos/tizen-winsets/widgets/multibuttonentry-demo.js @@ -0,0 +1,63 @@ +( function ( $, window ) { + $( document ).ready( function () { + $( "#MBTaddItemTest" ).click( function () { + $( ":jqmData(role='multibuttonentry')" ).multibuttonentry( "add", "additem" ); + }); + + $( "#MBTremoveItemTest" ).click( function () { + $( ":jqmData(role='multibuttonentry')" ).multibuttonentry( "remove", 0 ); + }); + + $( "#MBTinputTextTest" ).click( function () { + $( ":jqmData(role='multibuttonentry')" ).multibuttonentry( "inputText", "Hello~~~" ); + }); + + $( "#MBTgetInputTextTest" ).click( function () { + var input = $( ":jqmData(role='multibuttonentry')" ).multibuttonentry( "inputText" ); + window.alert( "input String : " + input ); + }); + + $( "#MBTremoveAllItemTest" ).click( function () { + $( ":jqmData(role='multibuttonentry')" ).multibuttonentry( "remove" ); + }); + + $( "#MBTgetSelectedItemTest" ).click( function () { + var content = $( ":jqmData(role='multibuttonentry')" ).multibuttonentry( "select" ); + window.alert( "Select content : " + content ); + }); + + $( "#MBTselectItemTest" ).click( function () { + $( ":jqmData(role='multibuttonentry')" ).multibuttonentry( "select", 0 ); + }); + + $( "#MBTlengthTest" ).click( function () { + var length = $( ":jqmData(role='multibuttonentry')" ).multibuttonentry( "length" ); + window.alert( "length : " + length ); + }); + + $( "#MBTfocusInTest" ).click( function () { + $( ":jqmData(role='multibuttonentry')" ).multibuttonentry( "focusIn", 0 ); + }); + + $( "#MBTfocusOutTest" ).click( function () { + $( ":jqmData(role='multibuttonentry')" ).multibuttonentry( "focusOut", 0 ); + }); + + $( "#MBTdestroyTest" ).click( function () { + $( ":jqmData(role='multibuttonentry')" ).multibuttonentry( "destroy" ); + }); + + $( "#contentList a" ).click( function () { + var arg = $( this ).text(); + $( ":jqmData(role='multibuttonentry')" ).multibuttonentry( "add", arg ); + }); + + $( "#cancelBtn" ).click( function () { + $.mobile.changePage( "#multibuttonentry", { + transition: "reverse slide", + reverse: false, + changeHash: false + } ); + }); + }); +} ( jQuery, window ) ); \ No newline at end of file diff --git a/demos/tizen-winsets/widgets/multimediaview/multimediaview.html b/demos/tizen-winsets/widgets/multimediaview/multimediaview.html new file mode 100755 index 0000000..0d0409b --- /dev/null +++ b/demos/tizen-winsets/widgets/multimediaview/multimediaview.html @@ -0,0 +1,12 @@ + +
    +
    +

    Multimedia view

    +
    +
    + +
    +
    \ No newline at end of file diff --git a/demos/tizen-winsets/widgets/multimediaview/multimediaview_audio.html b/demos/tizen-winsets/widgets/multimediaview/multimediaview_audio.html new file mode 100755 index 0000000..ed1d333 --- /dev/null +++ b/demos/tizen-winsets/widgets/multimediaview/multimediaview_audio.html @@ -0,0 +1,13 @@ + +
    +
    +

    Audio Test

    +
    +
    + +
    +
    diff --git a/demos/tizen-winsets/widgets/multimediaview/multimediaview_video.html b/demos/tizen-winsets/widgets/multimediaview/multimediaview_video.html new file mode 100755 index 0000000..05fb102 --- /dev/null +++ b/demos/tizen-winsets/widgets/multimediaview/multimediaview_video.html @@ -0,0 +1,14 @@ + +
    +
    +

    Video Test

    +
    +
    + +
    +
    diff --git a/demos/tizen-winsets/widgets/navigationbar.html b/demos/tizen-winsets/widgets/navigationbar.html new file mode 100755 index 0000000..87cf9df --- /dev/null +++ b/demos/tizen-winsets/widgets/navigationbar.html @@ -0,0 +1,206 @@ + + + + + + + jQM Test Example + + + + + + + + +
    +
    +

    ControlBar

    +
    + +
    +
    + +
    +
    +
    + +
    +
    +

    Title Area

    +
    + + +
    + +
    +
    + Text1 +

    Title Area

    +
    + +
    +
    + +
    +
    +
    + +
    +
    + Text1 +

    Title Area

    + Text2 +
    + +
    +
    + +
    +
    +
    + +
    +
    + Text1 +

    Title Area

    + Text2 + Text3 +
    + +
    +
    + +
    +
    +
    + +
    +
    +

    Title Extend

    +
    + +
    +
    + +
    +
    +
    + +
    +
    + Text +

    Title Extend 2 Button

    + Text +
    +
    + + + + +
    +
    + +
    + +
    +
    + +
    +
    +
    + +
    +
    + Text +

    Title Extend 3 Button

    + Text +
    +
    + + + + + + +
    +
    + +
    + +
    +
    + +
    +
    +
    \ No newline at end of file diff --git a/demos/tizen-winsets/widgets/pagecontrol/pagecontrol-demo.js b/demos/tizen-winsets/widgets/pagecontrol/pagecontrol-demo.js new file mode 100644 index 0000000..a60a5f3 --- /dev/null +++ b/demos/tizen-winsets/widgets/pagecontrol/pagecontrol-demo.js @@ -0,0 +1,31 @@ +/** + * Pagecontrol sample code + * by Youmin Ha + */ + +(function($) { + +// Example: Set value change callback +$('#pagecontrol').live('pageshow', function() { + var i = 1; + for(i=1; i<=10; i++) { + $('#p'+i).bind("change", function(event, value) { + var log = 'Changed value to ' + value; + $("#txt").html(log); + }); + } +}); + + +// Example: Set value by random +$('#pagecontrol_btn_randomset').live('vclick', + function() { + var i; + for(i=1; i<=10; i++) { + $('#p'+i).trigger('change', + Math.floor(Math.random() * i + 1)); + } +}); + +})($); + diff --git a/demos/tizen-winsets/widgets/pagecontrol/pagecontrol.html b/demos/tizen-winsets/widgets/pagecontrol/pagecontrol.html new file mode 100644 index 0000000..da722bb --- /dev/null +++ b/demos/tizen-winsets/widgets/pagecontrol/pagecontrol.html @@ -0,0 +1,20 @@ +
    +
    +

    Pagecontrol (page indicator)

    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    here
    + Set each values randomly +
    +
    diff --git a/demos/tizen-winsets/widgets/pagelayout/backbutton-control.html b/demos/tizen-winsets/widgets/pagelayout/backbutton-control.html new file mode 100755 index 0000000..7db37e9 --- /dev/null +++ b/demos/tizen-winsets/widgets/pagelayout/backbutton-control.html @@ -0,0 +1,25 @@ + + + + + + + + + + diff --git a/demos/tizen-winsets/widgets/pagelayout/backbutton-control.js b/demos/tizen-winsets/widgets/pagelayout/backbutton-control.js new file mode 100755 index 0000000..f89cfb8 --- /dev/null +++ b/demos/tizen-winsets/widgets/pagelayout/backbutton-control.js @@ -0,0 +1,14 @@ +$( document ).bind("pagecreate", function () { + + $("#genBackToFooter").bind("vmousedown", function (e) { + $(".ui-page-active").find(".ui-footer").barlayout("addBackBtn"); + }); + + $("#genBackToFooter2").bind("vmousedown", function (e) { + $(".ui-page-active").find(".ui-header").barlayout("addBackBtn"); + }); + + $("#backButtonDemo5").bind("vmousedown", function (e) { + $(".ui-page-active").find(".ui-footer").hide(); + }); +}); diff --git a/demos/tizen-winsets/widgets/pagelayout/backbutton/back-button-to-header.html b/demos/tizen-winsets/widgets/pagelayout/backbutton/back-button-to-header.html new file mode 100755 index 0000000..7d70ee3 --- /dev/null +++ b/demos/tizen-winsets/widgets/pagelayout/backbutton/back-button-to-header.html @@ -0,0 +1,31 @@ + + + + + + +
    +
    +

    Back button to Header

    +
    + +
    +

    Case 6 :

    + Web Developer defines that back button will be attached to header
    + This page declared "data-add-back-btn=header" to page
    + 1. check and draw back button to header

    +
    +

    + <div data-role="page" data-add-back-btn="header">
    +     <div data-role="header" data-position="fixed">
    +         <h1>back button sample</h1>
    +     </div>
    +     <div data-role="content">
    +     </div>
    + </div>

    +

    + Go Back +
    +
    + + diff --git a/demos/tizen-winsets/widgets/pagelayout/backbutton/backbutton-normal.html b/demos/tizen-winsets/widgets/pagelayout/backbutton/backbutton-normal.html new file mode 100755 index 0000000..4f52ec0 --- /dev/null +++ b/demos/tizen-winsets/widgets/pagelayout/backbutton/backbutton-normal.html @@ -0,0 +1,31 @@ + + + + + + +
    +
    +

    Normal footer generate

    +
    + +
    +

    Case 1 :

    + Web Developer doesn't define footer in page
    + This page do not have <div> footer in html file
    + Framework automatically generate footer in case no footer definition in page


    +
    +

    + <div data-role="page">
    +     <div data-role="header" data-position="fixed">
    +         <h1>back button sample</h1>
    +     </div>
    +     <div data-role="content">
    +     </div>
    + </div>

    +

    +
    +
    + + + diff --git a/demos/tizen-winsets/widgets/pagelayout/backbutton/backbutton-normal2.html b/demos/tizen-winsets/widgets/pagelayout/backbutton/backbutton-normal2.html new file mode 100755 index 0000000..db5f118 --- /dev/null +++ b/demos/tizen-winsets/widgets/pagelayout/backbutton/backbutton-normal2.html @@ -0,0 +1,35 @@ + + + + + + +
    +
    +

    Defined normal footer

    +
    + +
    +

    Case 2 :

    + Web Developer defines footer in page
    + This page has <div> footer in html file
    + Framework gets tizen theme of footer and styling footer


    +
    +

    + <div data-role="page">
    +     <div data-role="header" data-position="fixed">
    +         <h1>back button sample</h1>
    +     </div>
    +     <div data-role="content">
    +     </div>
    +     <div data-role="footer">
    +     </div>
    + </div>

    +

    +
    + +
    +
    +
    + + diff --git a/demos/tizen-winsets/widgets/pagelayout/backbutton/backbutton-normal3.html b/demos/tizen-winsets/widgets/pagelayout/backbutton/backbutton-normal3.html new file mode 100755 index 0000000..cc09ca1 --- /dev/null +++ b/demos/tizen-winsets/widgets/pagelayout/backbutton/backbutton-normal3.html @@ -0,0 +1,32 @@ + + + + + + +
    +
    +

    Defined back button in page

    +
    + +
    +

    Case 3 :

    + Web Developer defines back button in page
    + This page does not have <div> footer in html file
    + but declared back button in page
    + Framework generates footer then attach back button to footer


    +
    +

    + <div data-role="page" data-add-back-btn="footer">
    +     <div data-role="header" data-position="fixed">
    +         <h1>back button sample</h1>
    +     </div>
    +     <div data-role="content">
    +     </div>
    + </div>

    +

    +
    + +
    + + diff --git a/demos/tizen-winsets/widgets/pagelayout/backbutton/dynamically-attatch-backbutton-to-footer.html b/demos/tizen-winsets/widgets/pagelayout/backbutton/dynamically-attatch-backbutton-to-footer.html new file mode 100755 index 0000000..7294a78 --- /dev/null +++ b/demos/tizen-winsets/widgets/pagelayout/backbutton/dynamically-attatch-backbutton-to-footer.html @@ -0,0 +1,48 @@ + + + + + + +
    +
    +

    Back button to Header

    +
    + +
    +

    Case 7 :

    + Web Developer declared only footer in page
    + but need to add back button dynamically
    + select footer and call barlayout("addBackBtn") API

    +
    +

    + <div data-role="page" data-add-back-btn="none">
    +     <div data-role="header" data-position="fixed">
    +         <h1>back button sample</h1>
    +     </div>
    +     <div data-role="content">
    +     </div>
    +     <div data-role="footer">
    +     </div>
    + </div>

    +

    + +
    +

    + <script>
    +   var $elFooter = $(".ui-page-active").find(".ui-footer");
    +   $elFooter.barlayout("addBackBtn");
    + </script>
    +

    +

    + + Generate backbutton to footer

    + Go Back +
    + +
    +
    +
    + + + diff --git a/demos/tizen-winsets/widgets/pagelayout/backbutton/dynamically-attatch-backbutton-to-header.html b/demos/tizen-winsets/widgets/pagelayout/backbutton/dynamically-attatch-backbutton-to-header.html new file mode 100755 index 0000000..0b4e640 --- /dev/null +++ b/demos/tizen-winsets/widgets/pagelayout/backbutton/dynamically-attatch-backbutton-to-header.html @@ -0,0 +1,48 @@ + + + + + + +
    +
    +

    Back button to Header

    +
    + +
    +

    Case 7 :

    + Web Developer declared only footer in page
    + but need to add back button dynamically in header
    + select header and call barlayout("addBackBtn") API

    +
    +

    + <div data-role="page" data-add-back-btn="none">
    +     <div data-role="header" data-position="fixed">
    +         <h1>back button sample</h1>
    +     </div>
    +     <div data-role="content">
    +     </div>
    +     <div data-role="footer">
    +     </div>
    + </div>

    +

    + +
    +

    + <script>
    +   var $elHeader = $(".ui-page-active").find(".ui-header");
    +   $elHeader.barlayout("addBackBtn");
    + </script>
    +

    +

    + + Generate backbutton to header

    + Go Back +
    + +
    +
    +
    + + + diff --git a/demos/tizen-winsets/widgets/pagelayout/backbutton/no-back-button.html b/demos/tizen-winsets/widgets/pagelayout/backbutton/no-back-button.html new file mode 100755 index 0000000..8583755 --- /dev/null +++ b/demos/tizen-winsets/widgets/pagelayout/backbutton/no-back-button.html @@ -0,0 +1,33 @@ + + + + + + +
    +
    +

    No back button

    +
    + +
    +

    Case 5 :

    + Web Developer defines that back button will not use in this page
    + This page declared that this page will not use back button
    + declared "data-add-back-btn=none" to page
    + 1. draw footer to page
    + 2. check and do not draw back button to page

    +
    +

    + <div data-role="page" data-add-back-btn="none">
    +     <div data-role="header" data-position="fixed">
    +         <h1>back button sample</h1>
    +     </div>
    +     <div data-role="content">
    +     </div>
    + </div>

    +

    + Go Back +
    +
    + + diff --git a/demos/tizen-winsets/widgets/pagelayout/backbutton/no-footer.html b/demos/tizen-winsets/widgets/pagelayout/backbutton/no-footer.html new file mode 100755 index 0000000..3701b61 --- /dev/null +++ b/demos/tizen-winsets/widgets/pagelayout/backbutton/no-footer.html @@ -0,0 +1,31 @@ + + + + + + +
    +
    +

    Defined normal footer

    +
    + +
    +

    Case 4 :

    + Web Developer defines that footer will not use in this page
    + This page declared that this page will not use footer (footer-exist)
    + 1. do not go to footerDraw routine

    +
    +

    + <div data-role="page" data-footer-exist="false">
    +     <div data-role="header" data-position="fixed">
    +         <h1>back button sample</h1>
    +     </div>
    +     <div data-role="content">
    +     </div>
    + </div>

    +

    + Go Back +
    +
    + + diff --git a/demos/tizen-winsets/widgets/pagelayout/barcontrol.html b/demos/tizen-winsets/widgets/pagelayout/barcontrol.html new file mode 100755 index 0000000..636a1ef --- /dev/null +++ b/demos/tizen-winsets/widgets/pagelayout/barcontrol.html @@ -0,0 +1,50 @@ + + + + + + +
    +
    +

    Update page

    +
    +
    +
    +

    Use case :
    + In case, web Developer controls tizen bar(header/footer) without transitioning other page, + and web Developer use scrollview + Content in page needs to be updated because of scrollable area changed according to content, and changed fixed area need to be hide/show +

    + +

    +

    + var $elPage = $( ".ui-page-active" );

    + $elPage.find( ".ui-header" ).hide();
    + $elPage.page( "refresh" );

    + + $elPage.find( ".ui-header" ).show();
    + $elPage.page( "refresh" );
    +

    +
    +
    Hide header
    +
    Show header

    + +
    +
    +
    +

    + var $elPage = $( ".ui-page-active" );

    + $elPage.find( ".ui-footer" ).hide();
    + $elPage.page( "refresh" );

    + + $elPage.find( ".ui-footer" ).show();
    + $elPage.page( "refresh" );
    +


    +
    + +
    Hide footer
    +
    Show footer
    +
    +
    + + diff --git a/demos/tizen-winsets/widgets/pagelayout/barcontrol.js b/demos/tizen-winsets/widgets/pagelayout/barcontrol.js new file mode 100755 index 0000000..f7549b4 --- /dev/null +++ b/demos/tizen-winsets/widgets/pagelayout/barcontrol.js @@ -0,0 +1,29 @@ +$( document ).bind( "pagecreate", function () { + $( "#hideheader" ).bind( "vclick", function ( e ) { + var $elPage = $( ".ui-page-active" ); + + $elPage.find( ".ui-header" ).hide(); + $elPage.page( "refresh" ); + }); + + $( "#showheader" ).bind( "vclick", function ( e ) { + var $elPage = $( ".ui-page-active" ); + + $elPage.find( ".ui-header" ).show(); + $elPage.page( "refresh" ); + }); + + $( "#hidefooter" ).bind( "vclick", function ( e ) { + var $elPage = $( ".ui-page-active" ); + + $elPage.find( ".ui-footer" ).hide(); + $elPage.page( "refresh" ); + }); + + $( "#showfooter" ).bind( "vclick", function ( e ) { + var $elPage = $( ".ui-page-active" ); + + $elPage.find( ".ui-footer" ).show(); + $elPage.page( "refresh" ); + }); +}); diff --git a/demos/tizen-winsets/widgets/pagelayout/ctrl-test.html b/demos/tizen-winsets/widgets/pagelayout/ctrl-test.html new file mode 100755 index 0000000..9fc408b --- /dev/null +++ b/demos/tizen-winsets/widgets/pagelayout/ctrl-test.html @@ -0,0 +1,39 @@ + + +
    +
    +

    Tizen UI

    +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    + +
    +
    +
    + + + diff --git a/demos/tizen-winsets/widgets/pagelayout/ctrl-test.js b/demos/tizen-winsets/widgets/pagelayout/ctrl-test.js new file mode 100755 index 0000000..826a032 --- /dev/null +++ b/demos/tizen-winsets/widgets/pagelayout/ctrl-test.js @@ -0,0 +1,6 @@ +/* test file for content div control, not completed yet */ +$( "#ctrlbar_5item" ).live( "click", function() { + var a; + $("#ctrlbar_5item").controlbar('enable', a); + $("#ctrlbar_5item").controlbar('disable', undefined); +}); diff --git a/demos/tizen-winsets/widgets/popupwindow/dialog-center-info.html b/demos/tizen-winsets/widgets/popupwindow/dialog-center-info.html new file mode 100644 index 0000000..b59f9cd --- /dev/null +++ b/demos/tizen-winsets/widgets/popupwindow/dialog-center-info.html @@ -0,0 +1,28 @@ + + + + + + + + + + + + + +
    + +
    +
    + +
    +
    + +
    + + diff --git a/demos/tizen-winsets/widgets/popupwindow/popup.html b/demos/tizen-winsets/widgets/popupwindow/popup.html new file mode 100644 index 0000000..d357cdc --- /dev/null +++ b/demos/tizen-winsets/widgets/popupwindow/popup.html @@ -0,0 +1,251 @@ + + + + + + + + + + + + + + + + + diff --git a/demos/tizen-winsets/widgets/popupwindow/popupwindow.js b/demos/tizen-winsets/widgets/popupwindow/popupwindow.js new file mode 100644 index 0000000..a4fead0 --- /dev/null +++ b/demos/tizen-winsets/widgets/popupwindow/popupwindow.js @@ -0,0 +1,13 @@ +$("#popupwindow-demo").bind("pageshow", function() { + $('#popupwindow-demo-transition-' + $("#popupContent2").popupwindow("option", "transition")) + .attr("checked", "true") + .checkboxradio("refresh"); + + $(this).find('#progressbar').progressbar('start'); +}); + +$('input[name=popupwindow-demo-transition-choice]').bind("change", function(e) { + $("#popupContent2").popupwindow("option", "transition", $(this).attr("id").split("-").pop()); +}); + + diff --git a/demos/tizen-winsets/widgets/progressbar.html b/demos/tizen-winsets/widgets/progressbar.html new file mode 100644 index 0000000..9523b3f --- /dev/null +++ b/demos/tizen-winsets/widgets/progressbar.html @@ -0,0 +1,21 @@ +
    +
    +

    Progress bar

    +
    +
    +
      +
    • Progress Bar
    • +
    • When you click progress bar, it starts updating values...
    • +
    • + +
    • Progress Pending
    • +
    • + +
    • Progress ~ing
    • +
    • +
      + Loading.. +
    • +
    +
    +
    diff --git a/demos/tizen-winsets/widgets/progressbar.js b/demos/tizen-winsets/widgets/progressbar.js new file mode 100644 index 0000000..fa6016f --- /dev/null +++ b/demos/tizen-winsets/widgets/progressbar.js @@ -0,0 +1,73 @@ +var progressbar_running; + +$("#progressbar-demo").live("pageshow", function ( e ) { + + $("#progressbarTest").bind("vclick", function ( e ) { + progressbar_running = !progressbar_running; + + // request animation frame + window.requestAnimFrame = (function () { + return window.requestAnimationFrame || + window.webkitRequestAnimationFrame || + window.mozRequestAnimationFrame || + window.oRequestAnimationFrame || + window.msRequestAnimationFrame || + function (animloop) { + return window.setTimeout(animloop, 1000 / 60); + }; + }()); + + window.cancelRequestAnimFrame = (function () { + return window.cancelAnimationFrame || + window.webkitCancelRequestAnimationFrame || + window.mozCancelRequestAnimationFrame || + window.oCancelRequestAnimationFrame || + window.msCancelRequestAnimationFrame || + clearTimeout; + }()); + + var request, + i = 0; + + // start and run the animloop + (function animloop() { + if ( !progressbar_running ) { + cancelRequestAnimFrame( request ); + return; + } + + $("#progressbar").progressbar( "option", "value", i++ ); + + request = requestAnimFrame( animloop ); + + if ( i > 100 ) { + cancelRequestAnimFrame( request ); + } + }()); + }); + + $("#pending").progress( "running", true ); + $("#progressing").progress( "running", true ); + + $("#pendingTest").bind("vclick", function ( e ) { + var running = $("#pending").progress( "running" ); + // start/stop progressing animation + $("#pending").progress( "running", !running ); + }); + + $("#progressingTest").bind("vclick", function ( e ) { + var running = $("#progressing").progress( "running" ); + // start/stop progressing animation + $("#progressing").progress( "running", !running ); + + if ( running ) { + $("#progressing").progress( "hide" ); + } + }); +}); + +$("#progressbar-demo").live("pagehide", function ( e ) { + progressbar_running = false; + $("#pending").progress( "running", false ); + $("#progressing").progress( "running", false ); +}); diff --git a/demos/tizen-winsets/widgets/radio/radio.html b/demos/tizen-winsets/widgets/radio/radio.html new file mode 100644 index 0000000..e00e61b --- /dev/null +++ b/demos/tizen-winsets/widgets/radio/radio.html @@ -0,0 +1,38 @@ +
    + +
    +

    Radio

    + +
    + +
    +
    +
    + Choose a pet: + + + + + + + + + + + +
    +

    Trigged When user clicks a radio button : + + (This is updated when user clicks a radio button ) + +

    + + + + + + + +
    +
    +
    diff --git a/demos/tizen-winsets/widgets/radio/radio.js b/demos/tizen-winsets/widgets/radio/radio.js new file mode 100644 index 0000000..2c97312 --- /dev/null +++ b/demos/tizen-winsets/widgets/radio/radio.js @@ -0,0 +1,9 @@ +$( "#radio-demo" ).live("pagecreate", function () { + $("input[type='radio']").bind( "change", function(event, ui) { + if( this.checked ) + $( ".triggered-radio" ).text( this.id + " is selected..." ); + }); + +}); + + diff --git a/demos/tizen-winsets/widgets/scroll_jump.html b/demos/tizen-winsets/widgets/scroll_jump.html new file mode 100644 index 0000000..36df906 --- /dev/null +++ b/demos/tizen-winsets/widgets/scroll_jump.html @@ -0,0 +1,40 @@ + +
    +
    +

    Scroll Jump

    +
    +
    +
      +
    • item00
    • +
    • item01
    • +
    • item02
    • +
    • item03
    • +
    • item04
    • +
    • item05
    • +
    • item06
    • +
    • item07
    • +
    • item08
    • +
    • item09
    • +
    • item10
    • +
    • item11
    • +
    • item12
    • +
    • item13
    • +
    • item14
    • +
    • item15
    • +
    • item16
    • +
    • item17
    • +
    • item18
    • +
    • item19
    • +
    • item20
    • +
    • item21
    • +
    • item22
    • +
    • item23
    • +
    • item24
    • +
    • item25
    • +
    • item26
    • +
    • item27
    • +
    • item28
    • +
    • item29
    • +
    +
    +
    diff --git a/demos/tizen-winsets/widgets/searchbar.html b/demos/tizen-winsets/widgets/searchbar.html new file mode 100755 index 0000000..b5ebc11 --- /dev/null +++ b/demos/tizen-winsets/widgets/searchbar.html @@ -0,0 +1,44 @@ + +
    +
    +

    Searchbar

    + + +
    + +
    +

    Hairston

    +

    Hansbrough

    +

    Allred

    +

    Hanrahan

    +

    Egan

    +

    Dare

    +

    Edmonson

    +

    Calip

    +

    Baker

    +

    Fazekas

    +

    Garrity

    +

    Hansen

    +

    Feigenbaum

    +

    Fillmore

    +

    Darden

    +

    Davis

    +

    Fitzgerald

    +

    Carr

    +

    Danilovic

    +

    Dark

    +

    Alexander

    +

    Allen

    +

    Edwards

    +

    Garrett

    +

    Gardner

    +

    Carroll

    +

    Garner

    +

    Finn

    +

    Edelin

    +

    Gay

    +
    + + +
    + diff --git a/demos/tizen-winsets/widgets/searchbar.js b/demos/tizen-winsets/widgets/searchbar.js new file mode 100755 index 0000000..c799739 --- /dev/null +++ b/demos/tizen-winsets/widgets/searchbar.js @@ -0,0 +1,20 @@ +$( "#searchbar-demo-page" ).bind( "pageshow", function(){ + + + $( "#search1" ).bind( "input change", function(){ + var regEx = ""; + + regEx = ".*" + $( "#search1" ).val(); + + $("#searchbar-content p").each(function(){ + if ( $( this ).text().search(new RegExp(regEx)) != -1) { + $( this ).show(); + } + else { + $( this ).hide(); + } + }); + }); + + /*searchbar-content*/ +}); \ No newline at end of file diff --git a/demos/tizen-winsets/widgets/segmentctrl.html b/demos/tizen-winsets/widgets/segmentctrl.html new file mode 100644 index 0000000..dd8ad26 --- /dev/null +++ b/demos/tizen-winsets/widgets/segmentctrl.html @@ -0,0 +1,79 @@ +
    + +
    +

    Segment Control

    +
    + +
    +
    +
    + segment toolbar segonly style with 2 buttons: + + + + +
    +
    + +
    +
    + segment toolbar segonly style with 3 buttons: + + + + + + +
    +
    + +
    +
    + segment toolbar segonly style with 4 buttons: + + + + + + + + +
    +
    +
    +
    + + + + +
    +
    + +
    +
    + + + + + + +
    +
    + +
    +
    + + + + + + + + +
    +
    + +
    + +
    +
    diff --git a/demos/tizen-winsets/widgets/selectioninfo.html b/demos/tizen-winsets/widgets/selectioninfo.html new file mode 100755 index 0000000..fbd0e38 --- /dev/null +++ b/demos/tizen-winsets/widgets/selectioninfo.html @@ -0,0 +1,18 @@ +
    +
    +
    +
    +

    Selection Info

    +
    + +
    +

    Selectioninfo Test

    +
    + Choose some days +
    + + +
    + +

    Click Here to Show Small Popup

    +
    diff --git a/demos/tizen-winsets/widgets/small-popup.html b/demos/tizen-winsets/widgets/small-popup.html new file mode 100644 index 0000000..52ec444 --- /dev/null +++ b/demos/tizen-winsets/widgets/small-popup.html @@ -0,0 +1,12 @@ + +
    +
    +

    Notification Demo

    +
    +
    +

    Notification

    +
    +
    +
    Show Smallpopup
    +
    +
    diff --git a/demos/tizen-winsets/widgets/switch/switch.html b/demos/tizen-winsets/widgets/switch/switch.html new file mode 100644 index 0000000..8f76143 --- /dev/null +++ b/demos/tizen-winsets/widgets/switch/switch.html @@ -0,0 +1,16 @@ +
    +
    +

    Switch

    +
    +
    +
    +

    +

    +

    Coordinated switches:

    +
    +
    +
    +
    +

    Web UI Framework - Widgets gallery

    +
    +
    diff --git a/demos/tizen-winsets/widgets/switch/switch.js b/demos/tizen-winsets/widgets/switch/switch.js new file mode 100644 index 0000000..8b2d855 --- /dev/null +++ b/demos/tizen-winsets/widgets/switch/switch.js @@ -0,0 +1,8 @@ +$("#switch-demo").live("pageshow", function(e) { + $("#switch-1-coord").bind("changed", function(e) { + $("#switch-2-coord").toggleswitch("option", "checked", $("#switch-1-coord").toggleswitch("option", "checked")); + }); + $("#switch-2-coord").bind("changed", function(e) { + $("#switch-1-coord").toggleswitch("option", "checked", $("#switch-2-coord").toggleswitch("option", "checked")); + }); +}); diff --git a/demos/tizen-winsets/widgets/test/01.jpg b/demos/tizen-winsets/widgets/test/01.jpg new file mode 100644 index 0000000..df471b3 Binary files /dev/null and b/demos/tizen-winsets/widgets/test/01.jpg differ diff --git a/demos/tizen-winsets/widgets/test/02.jpg b/demos/tizen-winsets/widgets/test/02.jpg new file mode 100644 index 0000000..7cd3f0f Binary files /dev/null and b/demos/tizen-winsets/widgets/test/02.jpg differ diff --git a/demos/tizen-winsets/widgets/test/03.jpg b/demos/tizen-winsets/widgets/test/03.jpg new file mode 100644 index 0000000..a976675 Binary files /dev/null and b/demos/tizen-winsets/widgets/test/03.jpg differ diff --git a/demos/tizen-winsets/widgets/test/04.jpg b/demos/tizen-winsets/widgets/test/04.jpg new file mode 100644 index 0000000..9305cd0 Binary files /dev/null and b/demos/tizen-winsets/widgets/test/04.jpg differ diff --git a/demos/tizen-winsets/widgets/test/05.jpg b/demos/tizen-winsets/widgets/test/05.jpg new file mode 100644 index 0000000..120cd41 Binary files /dev/null and b/demos/tizen-winsets/widgets/test/05.jpg differ diff --git a/demos/tizen-winsets/widgets/test/06.jpg b/demos/tizen-winsets/widgets/test/06.jpg new file mode 100644 index 0000000..11f4ef9 Binary files /dev/null and b/demos/tizen-winsets/widgets/test/06.jpg differ diff --git a/demos/tizen-winsets/widgets/test/07.jpg b/demos/tizen-winsets/widgets/test/07.jpg new file mode 100644 index 0000000..c7178f2 Binary files /dev/null and b/demos/tizen-winsets/widgets/test/07.jpg differ diff --git a/demos/tizen-winsets/widgets/test/08.jpg b/demos/tizen-winsets/widgets/test/08.jpg new file mode 100644 index 0000000..b6adfee Binary files /dev/null and b/demos/tizen-winsets/widgets/test/08.jpg differ diff --git a/demos/tizen-winsets/widgets/test/09.jpg b/demos/tizen-winsets/widgets/test/09.jpg new file mode 100644 index 0000000..33d4d66 Binary files /dev/null and b/demos/tizen-winsets/widgets/test/09.jpg differ diff --git a/demos/tizen-winsets/widgets/test/10.jpg b/demos/tizen-winsets/widgets/test/10.jpg new file mode 100644 index 0000000..7b556da Binary files /dev/null and b/demos/tizen-winsets/widgets/test/10.jpg differ diff --git a/demos/tizen-winsets/widgets/test/11.jpg b/demos/tizen-winsets/widgets/test/11.jpg new file mode 100644 index 0000000..a712a66 Binary files /dev/null and b/demos/tizen-winsets/widgets/test/11.jpg differ diff --git a/demos/tizen-winsets/widgets/test/ctxpopup_1.png b/demos/tizen-winsets/widgets/test/ctxpopup_1.png new file mode 100755 index 0000000..4ab53f2 Binary files /dev/null and b/demos/tizen-winsets/widgets/test/ctxpopup_1.png differ diff --git a/demos/tizen-winsets/widgets/test/ctxpopup_2.png b/demos/tizen-winsets/widgets/test/ctxpopup_2.png new file mode 100755 index 0000000..99946bb Binary files /dev/null and b/demos/tizen-winsets/widgets/test/ctxpopup_2.png differ diff --git a/demos/tizen-winsets/widgets/test/ctxpopup_3.png b/demos/tizen-winsets/widgets/test/ctxpopup_3.png new file mode 100755 index 0000000..586e1f3 Binary files /dev/null and b/demos/tizen-winsets/widgets/test/ctxpopup_3.png differ diff --git a/demos/tizen-winsets/widgets/test/ctxpopup_4.png b/demos/tizen-winsets/widgets/test/ctxpopup_4.png new file mode 100755 index 0000000..234a611 Binary files /dev/null and b/demos/tizen-winsets/widgets/test/ctxpopup_4.png differ diff --git a/demos/tizen-winsets/widgets/test/icon01.png b/demos/tizen-winsets/widgets/test/icon01.png new file mode 100755 index 0000000..f27e616 Binary files /dev/null and b/demos/tizen-winsets/widgets/test/icon01.png differ diff --git a/demos/tizen-winsets/widgets/test/icon02.png b/demos/tizen-winsets/widgets/test/icon02.png new file mode 100755 index 0000000..b8b7806 Binary files /dev/null and b/demos/tizen-winsets/widgets/test/icon02.png differ diff --git a/demos/tizen-winsets/widgets/test/nba_76ers.jpg b/demos/tizen-winsets/widgets/test/nba_76ers.jpg new file mode 100755 index 0000000..35db118 Binary files /dev/null and b/demos/tizen-winsets/widgets/test/nba_76ers.jpg differ diff --git a/demos/tizen-winsets/widgets/test/nba_bobcats.jpg b/demos/tizen-winsets/widgets/test/nba_bobcats.jpg new file mode 100755 index 0000000..6572396 Binary files /dev/null and b/demos/tizen-winsets/widgets/test/nba_bobcats.jpg differ diff --git a/demos/tizen-winsets/widgets/test/nba_bucks.jpg b/demos/tizen-winsets/widgets/test/nba_bucks.jpg new file mode 100755 index 0000000..8b420ae Binary files /dev/null and b/demos/tizen-winsets/widgets/test/nba_bucks.jpg differ diff --git a/demos/tizen-winsets/widgets/test/nba_bulls.jpg b/demos/tizen-winsets/widgets/test/nba_bulls.jpg new file mode 100755 index 0000000..8c131e1 Binary files /dev/null and b/demos/tizen-winsets/widgets/test/nba_bulls.jpg differ diff --git a/demos/tizen-winsets/widgets/test/nba_cavaliers.jpg b/demos/tizen-winsets/widgets/test/nba_cavaliers.jpg new file mode 100755 index 0000000..2a66daa Binary files /dev/null and b/demos/tizen-winsets/widgets/test/nba_cavaliers.jpg differ diff --git a/demos/tizen-winsets/widgets/test/nba_celtics.jpg b/demos/tizen-winsets/widgets/test/nba_celtics.jpg new file mode 100755 index 0000000..363f65b Binary files /dev/null and b/demos/tizen-winsets/widgets/test/nba_celtics.jpg differ diff --git a/demos/tizen-winsets/widgets/test/nba_clippers.jpg b/demos/tizen-winsets/widgets/test/nba_clippers.jpg new file mode 100755 index 0000000..9b042b9 Binary files /dev/null and b/demos/tizen-winsets/widgets/test/nba_clippers.jpg differ diff --git a/demos/tizen-winsets/widgets/test/nba_griz.jpg b/demos/tizen-winsets/widgets/test/nba_griz.jpg new file mode 100755 index 0000000..c521cc9 Binary files /dev/null and b/demos/tizen-winsets/widgets/test/nba_griz.jpg differ diff --git a/demos/tizen-winsets/widgets/test/nba_hawks.jpg b/demos/tizen-winsets/widgets/test/nba_hawks.jpg new file mode 100755 index 0000000..208be2d Binary files /dev/null and b/demos/tizen-winsets/widgets/test/nba_hawks.jpg differ diff --git a/demos/tizen-winsets/widgets/test/nba_heats.jpg b/demos/tizen-winsets/widgets/test/nba_heats.jpg new file mode 100755 index 0000000..1c009d2 Binary files /dev/null and b/demos/tizen-winsets/widgets/test/nba_heats.jpg differ diff --git a/demos/tizen-winsets/widgets/test/nba_honets.jpg b/demos/tizen-winsets/widgets/test/nba_honets.jpg new file mode 100755 index 0000000..b2aa7ee Binary files /dev/null and b/demos/tizen-winsets/widgets/test/nba_honets.jpg differ diff --git a/demos/tizen-winsets/widgets/test/nba_jazz.jpg b/demos/tizen-winsets/widgets/test/nba_jazz.jpg new file mode 100755 index 0000000..1f1d221 Binary files /dev/null and b/demos/tizen-winsets/widgets/test/nba_jazz.jpg differ diff --git a/demos/tizen-winsets/widgets/test/nba_kings.jpg b/demos/tizen-winsets/widgets/test/nba_kings.jpg new file mode 100755 index 0000000..fc0e9f9 Binary files /dev/null and b/demos/tizen-winsets/widgets/test/nba_kings.jpg differ diff --git a/demos/tizen-winsets/widgets/test/nba_knics.jpg b/demos/tizen-winsets/widgets/test/nba_knics.jpg new file mode 100755 index 0000000..70c8796 Binary files /dev/null and b/demos/tizen-winsets/widgets/test/nba_knics.jpg differ diff --git a/demos/tizen-winsets/widgets/test/nba_lakers.jpg b/demos/tizen-winsets/widgets/test/nba_lakers.jpg new file mode 100755 index 0000000..cb291b1 Binary files /dev/null and b/demos/tizen-winsets/widgets/test/nba_lakers.jpg differ diff --git a/demos/tizen-winsets/widgets/test/nba_magics.jpg b/demos/tizen-winsets/widgets/test/nba_magics.jpg new file mode 100755 index 0000000..290b930 Binary files /dev/null and b/demos/tizen-winsets/widgets/test/nba_magics.jpg differ diff --git a/demos/tizen-winsets/widgets/test/nba_mavericks.jpg b/demos/tizen-winsets/widgets/test/nba_mavericks.jpg new file mode 100755 index 0000000..f8816a8 Binary files /dev/null and b/demos/tizen-winsets/widgets/test/nba_mavericks.jpg differ diff --git a/demos/tizen-winsets/widgets/test/nba_nets.jpg b/demos/tizen-winsets/widgets/test/nba_nets.jpg new file mode 100755 index 0000000..3d2600c Binary files /dev/null and b/demos/tizen-winsets/widgets/test/nba_nets.jpg differ diff --git a/demos/tizen-winsets/widgets/test/nba_nuggets.jpg b/demos/tizen-winsets/widgets/test/nba_nuggets.jpg new file mode 100755 index 0000000..a01e78e Binary files /dev/null and b/demos/tizen-winsets/widgets/test/nba_nuggets.jpg differ diff --git a/demos/tizen-winsets/widgets/test/nba_pacers.jpg b/demos/tizen-winsets/widgets/test/nba_pacers.jpg new file mode 100755 index 0000000..be98506 Binary files /dev/null and b/demos/tizen-winsets/widgets/test/nba_pacers.jpg differ diff --git a/demos/tizen-winsets/widgets/test/nba_pistons.jpg b/demos/tizen-winsets/widgets/test/nba_pistons.jpg new file mode 100755 index 0000000..f13c851 Binary files /dev/null and b/demos/tizen-winsets/widgets/test/nba_pistons.jpg differ diff --git a/demos/tizen-winsets/widgets/test/nba_raptors.jpg b/demos/tizen-winsets/widgets/test/nba_raptors.jpg new file mode 100755 index 0000000..eb8d431 Binary files /dev/null and b/demos/tizen-winsets/widgets/test/nba_raptors.jpg differ diff --git a/demos/tizen-winsets/widgets/test/nba_rockets.jpg b/demos/tizen-winsets/widgets/test/nba_rockets.jpg new file mode 100755 index 0000000..8cf2f17 Binary files /dev/null and b/demos/tizen-winsets/widgets/test/nba_rockets.jpg differ diff --git a/demos/tizen-winsets/widgets/test/nba_sonics.jpg b/demos/tizen-winsets/widgets/test/nba_sonics.jpg new file mode 100755 index 0000000..2104e42 Binary files /dev/null and b/demos/tizen-winsets/widgets/test/nba_sonics.jpg differ diff --git a/demos/tizen-winsets/widgets/test/nba_spurs.jpg b/demos/tizen-winsets/widgets/test/nba_spurs.jpg new file mode 100755 index 0000000..060002d Binary files /dev/null and b/demos/tizen-winsets/widgets/test/nba_spurs.jpg differ diff --git a/demos/tizen-winsets/widgets/test/nba_suns.jpg b/demos/tizen-winsets/widgets/test/nba_suns.jpg new file mode 100755 index 0000000..754769c Binary files /dev/null and b/demos/tizen-winsets/widgets/test/nba_suns.jpg differ diff --git a/demos/tizen-winsets/widgets/test/nba_timberwolves.jpg b/demos/tizen-winsets/widgets/test/nba_timberwolves.jpg new file mode 100755 index 0000000..79476a8 Binary files /dev/null and b/demos/tizen-winsets/widgets/test/nba_timberwolves.jpg differ diff --git a/demos/tizen-winsets/widgets/test/nba_trail.jpg b/demos/tizen-winsets/widgets/test/nba_trail.jpg new file mode 100755 index 0000000..57168c9 Binary files /dev/null and b/demos/tizen-winsets/widgets/test/nba_trail.jpg differ diff --git a/demos/tizen-winsets/widgets/test/nba_warriors.jpg b/demos/tizen-winsets/widgets/test/nba_warriors.jpg new file mode 100755 index 0000000..45440c4 Binary files /dev/null and b/demos/tizen-winsets/widgets/test/nba_warriors.jpg differ diff --git a/demos/tizen-winsets/widgets/test/nba_wizards.jpg b/demos/tizen-winsets/widgets/test/nba_wizards.jpg new file mode 100755 index 0000000..e98a491 Binary files /dev/null and b/demos/tizen-winsets/widgets/test/nba_wizards.jpg differ diff --git a/demos/tizen-winsets/widgets/tickernoti.html b/demos/tizen-winsets/widgets/tickernoti.html new file mode 100644 index 0000000..c537c75 --- /dev/null +++ b/demos/tizen-winsets/widgets/tickernoti.html @@ -0,0 +1,16 @@ + +
    +
    + +

    Hello Tizen

    +

    Jobs

    +
    +
    +

    Notification

    +
    +
    +
    Show TickerNoti

    +
    Change Icon - Phone
    +
    Change Icon - Message

    +
    +
    diff --git a/libs/css/images/00_sweep_list_bg.png b/libs/css/images/00_sweep_list_bg.png new file mode 100644 index 0000000..d87592a Binary files /dev/null and b/libs/css/images/00_sweep_list_bg.png differ diff --git a/libs/css/images/ajax-loader.png b/libs/css/images/ajax-loader.png new file mode 100644 index 0000000..811a2cd Binary files /dev/null and b/libs/css/images/ajax-loader.png differ diff --git a/libs/css/images/icon-search-black.png b/libs/css/images/icon-search-black.png new file mode 100644 index 0000000..5721120 Binary files /dev/null and b/libs/css/images/icon-search-black.png differ diff --git a/libs/css/images/icons-18-black.png b/libs/css/images/icons-18-black.png new file mode 100644 index 0000000..1ecfd26 Binary files /dev/null and b/libs/css/images/icons-18-black.png differ diff --git a/libs/css/images/icons-18-white.png b/libs/css/images/icons-18-white.png new file mode 100644 index 0000000..0c70831 Binary files /dev/null and b/libs/css/images/icons-18-white.png differ diff --git a/libs/css/images/icons-36-black.png b/libs/css/images/icons-36-black.png new file mode 100644 index 0000000..4c72adf Binary files /dev/null and b/libs/css/images/icons-36-black.png differ diff --git a/libs/css/images/icons-36-white.png b/libs/css/images/icons-36-white.png new file mode 100644 index 0000000..84ea9fb Binary files /dev/null and b/libs/css/images/icons-36-white.png differ diff --git a/libs/css/jquery.mobile-1.0rc1.css b/libs/css/jquery.mobile-1.0rc1.css new file mode 100644 index 0000000..d2abe88 --- /dev/null +++ b/libs/css/jquery.mobile-1.0rc1.css @@ -0,0 +1,1749 @@ +/*! + * jQuery Mobile v1.0rc1 + * http://jquerymobile.com/ + * + * Copyright 2010, jQuery Project + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + */ +/*! +* jQuery Mobile Framework +* Copyright (c) jQuery Project +* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. +*/ + +/* Swatches */ + +/* A +-----------------------------------------------------------------------------------------------------------*/ + +.ui-bar-a { + border: 1px solid #2A2A2A /*{a-bar-border}*/; + background: #111111 /*{a-bar-background-color}*/; + color: #ffffff /*{a-bar-color}*/; + font-weight: bold; + text-shadow: 0 /*{a-bar-shadow-x}*/ -1px /*{a-bar-shadow-y}*/ 1px /*{a-bar-shadow-radius}*/ #000000 /*{a-bar-shadow-color}*/; + background-image: -webkit-gradient(linear, left top, left bottom, from(#3c3c3c /*{a-bar-background-start}*/), to(#111 /*{a-bar-background-end}*/)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, #3c3c3c /*{a-bar-background-start}*/, #111 /*{a-bar-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient(top, #3c3c3c /*{a-bar-background-start}*/, #111 /*{a-bar-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient(top, #3c3c3c /*{a-bar-background-start}*/, #111 /*{a-bar-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient(top, #3c3c3c /*{a-bar-background-start}*/, #111 /*{a-bar-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient(top, #3c3c3c /*{a-bar-background-start}*/, #111 /*{a-bar-background-end}*/); +} +.ui-bar-a, +.ui-bar-a input, +.ui-bar-a select, +.ui-bar-a textarea, +.ui-bar-a button { + font-family: Helvetica, Arial, sans-serif /*{a-bar-font}*/; +} +.ui-bar-a .ui-link-inherit { + color: #fff /*{a-bar-color}*/; +} +.ui-bar-a .ui-link { + color: #7cc4e7 /*{global-link-color}*/; + font-weight: bold; +} +.ui-body-a { + border: 1px solid #2A2A2A /*{a-body-border}*/; + background: #222222 /*{a-body-background-color}*/; + color: #fff /*{a-body-color}*/; + text-shadow: 0 /*{a-body-shadow-x}*/ 1px /*{a-body-shadow-y}*/ 0 /*{a-body-shadow-radius}*/ #000 /*{a-body-shadow-color}*/; + font-weight: normal; + background-image: -webkit-gradient(linear, left top, left bottom, from(#666 /*{a-body-background-start}*/), to(#222 /*{a-body-background-end}*/)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, #666 /*{a-body-background-start}*/, #222 /*{a-body-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient(top, #666 /*{a-body-background-start}*/, #222 /*{a-body-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient(top, #666 /*{a-body-background-start}*/, #222 /*{a-body-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient(top, #666 /*{a-body-background-start}*/, #222 /*{a-body-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient(top, #666 /*{a-body-background-start}*/, #222 /*{a-body-background-end}*/); +} +.ui-body-a, +.ui-body-a input, +.ui-body-a select, +.ui-body-a textarea, +.ui-body-a button { + font-family: Helvetica, Arial, sans-serif /*{a-body-font}*/; +} +.ui-body-a .ui-link-inherit { + color: #fff /*{a-body-color}*/; +} +.ui-body-a .ui-link { + color: #2489CE /*{global-link-color}*/; + font-weight: bold; +} +.ui-br { + border-bottom: rgb(130,130,130); + border-bottom: rgba(130,130,130,.3); + border-bottom-width: 1px; + border-bottom-style: solid; +} +.ui-btn-up-a { + border: 1px solid #222 /*{a-bup-border}*/; + background: #333333 /*{a-bup-background-color}*/; + font-weight: bold; + color: #fff /*{a-bup-color}*/; + text-shadow: 0 /*{a-bup-shadow-x}*/ -1px /*{a-bup-shadow-y}*/ 1px /*{a-bup-shadow-radius}*/ #000 /*{a-bup-shadow-color}*/; + background-image: -webkit-gradient(linear, left top, left bottom, from(#555 /*{a-bup-background-start}*/), to(#333 /*{a-bup-background-end}*/)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, #555 /*{a-bup-background-start}*/, #333 /*{a-bup-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient(top, #555 /*{a-bup-background-start}*/, #333 /*{a-bup-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient(top, #555 /*{a-bup-background-start}*/, #333 /*{a-bup-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient(top, #555 /*{a-bup-background-start}*/, #333 /*{a-bup-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient(top, #555 /*{a-bup-background-start}*/, #333 /*{a-bup-background-end}*/); +} +.ui-btn-up-a a.ui-link-inherit { + color: #fff /*{a-bup-color}*/; +} +.ui-btn-hover-a { + border: 1px solid #000 /*{a-bhover-border}*/; + background: #444444 /*{a-bhover-background-color}*/; + font-weight: bold; + color: #fff /*{a-bhover-color}*/; + text-shadow: 0 /*{a-bhover-shadow-x}*/ -1px /*{a-bhover-shadow-y}*/ 1px /*{a-bhover-shadow-radius}*/ #000 /*{a-bhover-shadow-color}*/; + background-image: -webkit-gradient(linear, left top, left bottom, from(#666 /*{a-bhover-background-start}*/), to(#444 /*{a-bhover-background-end}*/)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, #666 /*{a-bhover-background-start}*/, #444 /*{a-bhover-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient(top, #666 /*{a-bhover-background-start}*/, #444 /*{a-bhover-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient(top, #666 /*{a-bhover-background-start}*/, #444 /*{a-bhover-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient(top, #666 /*{a-bhover-background-start}*/, #444 /*{a-bhover-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient(top, #666 /*{a-bhover-background-start}*/, #444 /*{a-bhover-background-end}*/); +} +.ui-btn-hover-a a.ui-link-inherit { + color: #fff /*{a-bhover-color}*/; +} +.ui-btn-down-a { + border: 1px solid #000 /*{a-bdown-border}*/; + background: #3d3d3d /*{a-bdown-background-color}*/; + font-weight: bold; + color: #fff /*{a-bdown-color}*/; + text-shadow: 0 /*{a-bdown-shadow-x}*/ -1px /*{a-bdown-shadow-y}*/ 1px /*{a-bdown-shadow-radius}*/ #000 /*{a-bdown-shadow-color}*/; + background-image: -webkit-gradient(linear, left top, left bottom, from(#333 /*{a-bdown-background-start}*/), to(#5a5a5a /*{a-bdown-background-end}*/)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, #333 /*{a-bdown-background-start}*/, #5a5a5a /*{a-bdown-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient(top, #333 /*{a-bdown-background-start}*/, #5a5a5a /*{a-bdown-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient(top, #333 /*{a-bdown-background-start}*/, #5a5a5a /*{a-bdown-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient(top, #333 /*{a-bdown-background-start}*/, #5a5a5a /*{a-bdown-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient(top, #333 /*{a-bdown-background-start}*/, #5a5a5a /*{a-bdown-background-end}*/); +} +.ui-btn-down-a a.ui-link-inherit { + color: #fff /*{a-bdown-color}*/; +} +.ui-btn-up-a, +.ui-btn-hover-a, +.ui-btn-down-a { + font-family: Helvetica, Arial, sans-serif /*{a-button-font}*/; + text-decoration: none; +} + + +/* B +-----------------------------------------------------------------------------------------------------------*/ + +.ui-bar-b { + border: 1px solid #456f9a /*{b-bar-border}*/; + background: #5e87b0 /*{b-bar-background-color}*/; + color: #fff /*{b-bar-color}*/; + font-weight: bold; + text-shadow: 0 /*{b-bar-shadow-x}*/ -1px /*{b-bar-shadow-y}*/ 1px /*{b-bar-shadow-radius}*/ #254f7a /*{b-bar-shadow-color}*/; + background-image: -webkit-gradient(linear, left top, left bottom, from(#81a8ce /*{b-bar-background-start}*/), to(#5e87b0 /*{b-bar-background-end}*/)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, #81a8ce /*{b-bar-background-start}*/, #5e87b0 /*{b-bar-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient(top, #81a8ce /*{b-bar-background-start}*/, #5e87b0 /*{b-bar-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient(top, #81a8ce /*{b-bar-background-start}*/, #5e87b0 /*{b-bar-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient(top, #81a8ce /*{b-bar-background-start}*/, #5e87b0 /*{b-bar-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient(top, #81a8ce /*{b-bar-background-start}*/, #5e87b0 /*{b-bar-background-end}*/); +} +.ui-bar-b, +.ui-bar-b input, +.ui-bar-b select, +.ui-bar-b textarea, +.ui-bar-b button { + font-family: Helvetica, Arial, sans-serif /*{b-bar-font}*/; +} +.ui-bar-b .ui-link-inherit { + color: #fff /*{b-bar-color}*/; +} +.ui-bar-b .ui-link { + color: #7cc4e7 /*{global-link-color}*/; + font-weight: bold; +} + +.ui-body-b { + border: 1px solid #C6C6C6 /*{b-body-border}*/; + background: #cccccc /*{b-body-background-color}*/; + color: #333333 /*{b-body-color}*/; + text-shadow: 0 /*{b-body-shadow-x}*/ 1px /*{b-body-shadow-y}*/ 0 /*{b-body-shadow-radius}*/ #fff /*{b-body-shadow-color}*/; + font-weight: normal; + background-image: -webkit-gradient(linear, left top, left bottom, from(#e6e6e6 /*{b-body-background-start}*/), to(#ccc /*{b-body-background-end}*/)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, #e6e6e6 /*{b-body-background-start}*/, #ccc /*{b-body-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient(top, #e6e6e6 /*{b-body-background-start}*/, #ccc /*{b-body-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient(top, #e6e6e6 /*{b-body-background-start}*/, #ccc /*{b-body-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient(top, #e6e6e6 /*{b-body-background-start}*/, #ccc /*{b-body-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient(top, #e6e6e6 /*{b-body-background-start}*/, #ccc /*{b-body-background-end}*/); +} +.ui-body-b, +.ui-body-b input, +.ui-body-b select, +.ui-body-b textarea, +.ui-body-b button { + font-family: Helvetica, Arial, sans-serif /*{b-body-font}*/; +} +.ui-body-b .ui-link-inherit { + color: #333333 /*{b-body-color}*/; +} +.ui-body-b .ui-link { + color: #2489CE /*{global-link-color}*/; + font-weight: bold; +} +.ui-btn-up-b { + border: 1px solid #145072 /*{b-bup-border}*/; + background: #2567ab /*{b-bup-background-color}*/; + font-weight: bold; + color: #fff /*{b-bup-color}*/; + text-shadow: 0 /*{b-bup-shadow-x}*/ -1px /*{b-bup-shadow-y}*/ 1px /*{b-bup-shadow-radius}*/ #145072 /*{b-bup-shadow-color}*/; + background-image: -webkit-gradient(linear, left top, left bottom, from(#5f9cc5 /*{b-bup-background-start}*/), to(#396b9e /*{b-bup-background-end}*/)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, #5f9cc5 /*{b-bup-background-start}*/, #396b9e /*{b-bup-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient(top, #5f9cc5 /*{b-bup-background-start}*/, #396b9e /*{b-bup-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient(top, #5f9cc5 /*{b-bup-background-start}*/, #396b9e /*{b-bup-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient(top, #5f9cc5 /*{b-bup-background-start}*/, #396b9e /*{b-bup-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient(top, #5f9cc5 /*{b-bup-background-start}*/, #396b9e /*{b-bup-background-end}*/); +} +.ui-btn-up-b a.ui-link-inherit { + color: #fff /*{b-bup-color}*/; +} +.ui-btn-hover-b { + border: 1px solid #00516e /*{b-bhover-border}*/; + background: #4b88b6 /*{b-bhover-background-color}*/; + font-weight: bold; + color: #fff /*{b-bhover-color}*/; + text-shadow: 0 /*{b-bhover-shadow-x}*/ -1px /*{b-bhover-shadow-y}*/ 1px /*{b-bhover-shadow-radius}*/ #014D68 /*{b-bhover-shadow-color}*/; + background-image: -webkit-gradient(linear, left top, left bottom, from(#72b0d4 /*{b-bhover-background-start}*/), to(#4b88b6 /*{b-bhover-background-end}*/)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, #72b0d4 /*{b-bhover-background-start}*/, #4b88b6 /*{b-bhover-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient(top, #72b0d4 /*{b-bhover-background-start}*/, #4b88b6 /*{b-bhover-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient(top, #72b0d4 /*{b-bhover-background-start}*/, #4b88b6 /*{b-bhover-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient(top, #72b0d4 /*{b-bhover-background-start}*/, #4b88b6 /*{b-bhover-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient(top, #72b0d4 /*{b-bhover-background-start}*/, #4b88b6 /*{b-bhover-background-end}*/); +} +.ui-btn-hover-b a.ui-link-inherit { + color: #fff /*{b-bhover-color}*/; +} +.ui-btn-down-b { + border: 1px solid #225377 /*{b-bdown-border}*/; + background: #4e89c5 /*{b-bdown-background-color}*/; + font-weight: bold; + color: #fff /*{b-bdown-color}*/; + text-shadow: 0 /*{b-bdown-shadow-x}*/ -1px /*{b-bdown-shadow-y}*/ 1px /*{b-bdown-shadow-radius}*/ #225377 /*{b-bdown-shadow-color}*/; + background-image: -webkit-gradient(linear, left top, left bottom, from(#396b9e /*{b-bdown-background-start}*/), to(#4e89c5 /*{b-bdown-background-end}*/)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, #396b9e /*{b-bdown-background-start}*/, #4e89c5 /*{b-bdown-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient(top, #396b9e /*{b-bdown-background-start}*/, #4e89c5 /*{b-bdown-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient(top, #396b9e /*{b-bdown-background-start}*/, #4e89c5 /*{b-bdown-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient(top, #396b9e /*{b-bdown-background-start}*/, #4e89c5 /*{b-bdown-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient(top, #396b9e /*{b-bdown-background-start}*/, #4e89c5 /*{b-bdown-background-end}*/); +} +.ui-btn-down-b a.ui-link-inherit { + color: #fff /*{b-bdown-color}*/; +} +.ui-btn-up-b, +.ui-btn-hover-b, +.ui-btn-down-b { + font-family: Helvetica, Arial, sans-serif /*{b-button-font}*/; + text-decoration: none; +} + + +/* C +-----------------------------------------------------------------------------------------------------------*/ + +.ui-bar-c { + border: 1px solid #B3B3B3 /*{c-bar-border}*/; + background: #e9eaeb /*{c-bar-background-color}*/; + color: #3E3E3E /*{c-bar-color}*/; + font-weight: bold; + text-shadow: 0 /*{c-bar-shadow-x}*/ 1px /*{c-bar-shadow-y}*/ 1px /*{c-bar-shadow-radius}*/ #fff /*{c-bar-shadow-color}*/; + background-image: -webkit-gradient(linear, left top, left bottom, from(#f0f0f0 /*{c-bar-background-start}*/), to(#e9eaeb /*{c-bar-background-end}*/)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, #f0f0f0 /*{c-bar-background-start}*/, #e9eaeb /*{c-bar-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient(top, #f0f0f0 /*{c-bar-background-start}*/, #e9eaeb /*{c-bar-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient(top, #f0f0f0 /*{c-bar-background-start}*/, #e9eaeb /*{c-bar-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient(top, #f0f0f0 /*{c-bar-background-start}*/, #e9eaeb /*{c-bar-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient(top, #f0f0f0 /*{c-bar-background-start}*/, #e9eaeb /*{c-bar-background-end}*/); +} + +.ui-bar-c .ui-link { + color: #2489CE /*{global-link-color}*/; + font-weight: bold; +} + +.ui-bar-c, +.ui-bar-c input, +.ui-bar-c select, +.ui-bar-c textarea, +.ui-bar-c button { + font-family: Helvetica, Arial, sans-serif /*{c-bar-font}*/; +} +.ui-body-c { + border: 1px solid #B3B3B3 /*{c-body-border}*/; + color: #333333 /*{c-body-color}*/; + text-shadow: 0 /*{c-body-shadow-x}*/ 1px /*{c-body-shadow-y}*/ 0 /*{c-body-shadow-radius}*/ #fff /*{c-body-shadow-color}*/; + background: #f0f0f0 /*{c-body-background-color}*/; + background-image: -webkit-gradient(linear, left top, left bottom, from(#eee /*{c-body-background-start}*/), to(#ddd /*{c-body-background-end}*/)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, #eee /*{c-body-background-start}*/, #ddd /*{c-body-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient(top, #eee /*{c-body-background-start}*/, #ddd /*{c-body-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient(top, #eee /*{c-body-background-start}*/, #ddd /*{c-body-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient(top, #eee /*{c-body-background-start}*/, #ddd /*{c-body-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient(top, #eee /*{c-body-background-start}*/, #ddd /*{c-body-background-end}*/); +} +.ui-body-c, +.ui-body-c input, +.ui-body-c select, +.ui-body-c textarea, +.ui-body-c button { + font-family: Helvetica, Arial, sans-serif /*{c-body-font}*/; +} +.ui-body-c .ui-link-inherit { + color: #333333 /*{c-body-color}*/; +} +.ui-body-c .ui-link { + color: #2489CE /*{global-link-color}*/; + font-weight: bold; +} + +.ui-btn-up-c { + border: 1px solid #ccc /*{c-bup-border}*/; + background: #eee /*{c-bup-background-color}*/; + font-weight: bold; + color: #444 /*{c-bup-color}*/; + text-shadow: 0 /*{c-bup-shadow-x}*/ 1px /*{c-bup-shadow-y}*/ 1px /*{c-bup-shadow-radius}*/ #f6f6f6 /*{c-bup-shadow-color}*/; + background-image: -webkit-gradient(linear, left top, left bottom, from(#fdfdfd /*{c-bup-background-start}*/), to(#eee /*{c-bup-background-end}*/)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, #fdfdfd /*{c-bup-background-start}*/, #eee /*{c-bup-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient(top, #fdfdfd /*{c-bup-background-start}*/, #eee /*{c-bup-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient(top, #fdfdfd /*{c-bup-background-start}*/, #eee /*{c-bup-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient(top, #fdfdfd /*{c-bup-background-start}*/, #eee /*{c-bup-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient(top, #fdfdfd /*{c-bup-background-start}*/, #eee /*{c-bup-background-end}*/); +} +.ui-btn-up-c a.ui-link-inherit { + color: #2F3E46 /*{c-bup-color}*/; +} + +.ui-btn-hover-c { + border: 1px solid #bbb /*{c-bhover-border}*/; + background: #dadada /*{c-bhover-background-color}*/; + font-weight: bold; + color: #101010 /*{c-bhover-color}*/; + text-shadow: 0 /*{c-bhover-shadow-x}*/ 1px /*{c-bhover-shadow-y}*/ 1px /*{c-bhover-shadow-radius}*/ #fff /*{c-bhover-shadow-color}*/; + background-image: -webkit-gradient(linear, left top, left bottom, from(#ededed /*{c-bhover-background-start}*/), to(#dadada /*{c-bhover-background-end}*/)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, #ededed /*{c-bhover-background-start}*/, #dadada /*{c-bhover-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient(top, #ededed /*{c-bhover-background-start}*/, #dadada /*{c-bhover-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient(top, #ededed /*{c-bhover-background-start}*/, #dadada /*{c-bhover-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient(top, #ededed /*{c-bhover-background-start}*/, #dadada /*{c-bhover-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient(top, #ededed /*{c-bhover-background-start}*/, #dadada /*{c-bhover-background-end}*/); +} +.ui-btn-hover-c a.ui-link-inherit { + color: #2F3E46 /*{c-bhover-color}*/; +} +.ui-btn-down-c { + border: 1px solid #808080 /*{c-bdown-border}*/; + background: #fdfdfd /*{c-bdown-background-color}*/; + font-weight: bold; + color: #111111 /*{c-bdown-color}*/; + text-shadow: 0 /*{c-bdown-shadow-x}*/ 1px /*{c-bdown-shadow-y}*/ 1px /*{c-bdown-shadow-radius}*/ #ffffff /*{c-bdown-shadow-color}*/; + background-image: -webkit-gradient(linear, left top, left bottom, from(#eee /*{c-bdown-background-start}*/), to(#fdfdfd /*{c-bdown-background-end}*/)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, #eee /*{c-bdown-background-start}*/, #fdfdfd /*{c-bdown-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient(top, #eee /*{c-bdown-background-start}*/, #fdfdfd /*{c-bdown-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient(top, #eee /*{c-bdown-background-start}*/, #fdfdfd /*{c-bdown-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient(top, #eee /*{c-bdown-background-start}*/, #fdfdfd /*{c-bdown-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient(top, #eee /*{c-bdown-background-start}*/, #fdfdfd /*{c-bdown-background-end}*/); +} +.ui-btn-down-c a.ui-link-inherit { + color: #2F3E46 /*{c-bdown-color}*/; +} +.ui-btn-up-c, +.ui-btn-hover-c, +.ui-btn-down-c { + font-family: Helvetica, Arial, sans-serif /*{c-button-font}*/; + text-decoration: none; +} + + +/* D +-----------------------------------------------------------------------------------------------------------*/ + +.ui-bar-d { + border: 1px solid #ccc /*{d-bar-border}*/; + background: #bbb /*{d-bar-background-color}*/; + color: #333 /*{d-bar-color}*/; + text-shadow: 0 /*{d-bar-shadow-x}*/ 1px /*{d-bar-shadow-y}*/ 0 /*{d-bar-shadow-radius}*/ #eee /*{d-bar-shadow-color}*/; + background-image: -webkit-gradient(linear, left top, left bottom, from(#ddd /*{d-bar-background-start}*/), to(#bbb /*{d-bar-background-end}*/)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, #ddd /*{d-bar-background-start}*/, #bbb /*{d-bar-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient(top, #ddd /*{d-bar-background-start}*/, #bbb /*{d-bar-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient(top, #ddd /*{d-bar-background-start}*/, #bbb /*{d-bar-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient(top, #ddd /*{d-bar-background-start}*/, #bbb /*{d-bar-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient(top, #ddd /*{d-bar-background-start}*/, #bbb /*{d-bar-background-end}*/); +} +.ui-bar-d, +.ui-bar-d input, +.ui-bar-d select, +.ui-bar-d textarea, +.ui-bar-d button { + font-family: Helvetica, Arial, sans-serif /*{d-bar-font}*/; +} +.ui-bar-d .ui-link-inherit { + color: #333 /*{d-bar-color}*/; +} +.ui-bar-d .ui-link { + color: #2489CE /*{global-link-color}*/; + font-weight: bold; +} +.ui-body-d { + border: 1px solid #ccc /*{d-body-border}*/; + color: #333333 /*{d-body-color}*/; + text-shadow: 0 /*{d-body-shadow-x}*/ 1px /*{d-body-shadow-y}*/ 0 /*{d-body-shadow-radius}*/ #fff /*{d-body-shadow-color}*/; + background: #ffffff /*{d-body-background-color}*/; + background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#fff /*{d-body-background-end}*/)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, #fff /*{d-body-background-start}*/, #fff /*{d-body-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient(top, #fff /*{d-body-background-start}*/, #fff /*{d-body-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient(top, #fff /*{d-body-background-start}*/, #fff /*{d-body-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient(top, #fff /*{d-body-background-start}*/, #fff /*{d-body-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient(top, #fff /*{d-body-background-start}*/, #fff /*{d-body-background-end}*/); +} +.ui-body-d, +.ui-body-d input, +.ui-body-d select, +.ui-body-d textarea, +.ui-body-d button { + font-family: Helvetica, Arial, sans-serif /*{d-body-font}*/; +} +.ui-body-d .ui-link-inherit { + color: #333333 /*{d-body-color}*/; +} +.ui-body-d .ui-link { + color: #2489CE /*{global-link-color}*/; + font-weight: bold; +} +.ui-btn-up-d { + border: 1px solid #ccc /*{d-bup-border}*/; + background: #fff /*{d-bup-background-color}*/; + font-weight: bold; + color: #444 /*{d-bup-color}*/; + text-shadow: 0 /*{d-bup-shadow-x}*/ 1px /*{d-bup-shadow-y}*/ 1px /*{d-bup-shadow-radius}*/ #fff /*{d-bup-shadow-color}*/; + background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#fff /*{d-bup-background-end}*/)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, #fff /*{d-bup-background-start}*/, #fff /*{d-bup-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient(top, #fff /*{d-bup-background-start}*/, #fff /*{d-bup-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient(top, #fff /*{d-bup-background-start}*/, #fff /*{d-bup-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient(top, #fff /*{d-bup-background-start}*/, #fff /*{d-bup-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient(top, #fff /*{d-bup-background-start}*/, #fff /*{d-bup-background-end}*/); +} +.ui-btn-up-d a.ui-link-inherit { + color: #333 /*{d-bup-color}*/; +} +.ui-btn-hover-d { + border: 1px solid #aaa /*{d-bhover-border}*/; + background: #eeeeee /*{d-bhover-background-color}*/; + font-weight: bold; + color: #222 /*{d-bhover-color}*/; + cursor: pointer; + text-shadow: 0 /*{d-bhover-shadow-x}*/ 1px /*{d-bhover-shadow-y}*/ 1px /*{d-bhover-shadow-radius}*/ #fff /*{d-bhover-shadow-color}*/; + background-image: -webkit-gradient(linear, left top, left bottom, from(#fdfdfd), to(#eee /*{d-bhover-background-end}*/)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, #fdfdfd /*{d-bhover-background-start}*/, #eee /*{d-bhover-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient(top, #fdfdfd /*{d-bhover-background-start}*/, #eee /*{d-bhover-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient(top, #fdfdfd /*{d-bhover-background-start}*/, #eee /*{d-bhover-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient(top, #fdfdfd /*{d-bhover-background-start}*/, #eee /*{d-bhover-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient(top, #fdfdfd /*{d-bhover-background-start}*/, #eee /*{d-bhover-background-end}*/); +} +.ui-btn-hover-d a.ui-link-inherit { + color: #222 /*{d-bhover-color}*/; +} +.ui-btn-down-d { + border: 1px solid #aaaaaa /*{d-bdown-border}*/; + background: #ffffff /*{d-bdown-background-color}*/; + font-weight: bold; + color: #111 /*{d-bdown-color}*/; + text-shadow: 0 /*{d-bdown-shadow-x}*/ 1px /*{d-bdown-shadow-y}*/ 1px /*{d-bdown-shadow-radius}*/ #ffffff /*{d-bdown-shadow-color}*/; + background-image: -webkit-gradient(linear, left top, left bottom, from(#eee /*{d-bdown-background-start}*/), to(#fff /*{d-bdown-background-end}*/)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, #eee /*{d-bdown-background-start}*/, #fff /*{d-bdown-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient(top, #eee /*{d-bdown-background-start}*/, #fff /*{d-bdown-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient(top, #eee /*{d-bdown-background-start}*/, #fff /*{d-bdown-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient(top, #eee /*{d-bdown-background-start}*/, #fff /*{d-bdown-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient(top, #eee /*{d-bdown-background-start}*/, #fff /*{d-bdown-background-end}*/); +} +.ui-btn-down-d a.ui-link-inherit { + color: #111 /*{d-bdown-color}*/; +} +.ui-btn-up-d, +.ui-btn-hover-d, +.ui-btn-down-d { + font-family: Helvetica, Arial, sans-serif /*{d-button-font}*/; + text-decoration: none; +} + + +/* E +-----------------------------------------------------------------------------------------------------------*/ + +.ui-bar-e { + border: 1px solid #F7C942 /*{e-bar-border}*/; + background: #fadb4e /*{e-bar-background-color}*/; + color: #333 /*{e-bar-color}*/; + text-shadow: 0 /*{e-bar-shadow-x}*/ 1px /*{e-bar-shadow-y}*/ 0 /*{e-bar-shadow-radius}*/ #fff /*{e-bar-shadow-color}*/; + background-image: -webkit-gradient(linear, left top, left bottom, from(#fceda7 /*{e-bar-background-start}*/), to(#fadb4e /*{e-bar-background-end}*/)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, #fceda7 /*{e-bar-background-start}*/, #fadb4e /*{e-bar-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient(top, #fceda7 /*{e-bar-background-start}*/, #fadb4e /*{e-bar-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient(top, #fceda7 /*{e-bar-background-start}*/, #fadb4e /*{e-bar-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient(top, #fceda7 /*{e-bar-background-start}*/, #fadb4e /*{e-bar-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient(top, #fceda7 /*{e-bar-background-start}*/, #fadb4e /*{e-bar-background-end}*/); +} +.ui-bar-e, +.ui-bar-e input, +.ui-bar-e select, +.ui-bar-e textarea, +.ui-bar-e button { + font-family: Helvetica, Arial, sans-serif /*{e-bar-font}*/; +} +.ui-bar-e .ui-link-inherit { + color: #333 /*{e-bar-color}*/; +} +.ui-bar-e .ui-link { + color: #2489CE /*{global-link-color}*/; + font-weight: bold; +} +.ui-body-e { + border: 1px solid #F7C942 /*{e-body-border}*/; + color: #333333 /*{e-body-color}*/; + text-shadow: 0 /*{e-body-shadow-x}*/ 1px /*{e-body-shadow-y}*/ 0 /*{e-body-shadow-radius}*/ #fff /*{e-body-shadow-color}*/; + background: #faeb9e /*{e-body-background-color}*/; + background-image: -webkit-gradient(linear, left top, left bottom, from(#fff /*{e-body-background-start}*/), to(#faeb9e /*{e-body-background-end}*/)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, #fff /*{e-body-background-start}*/, #faeb9e /*{e-body-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient(top, #fff /*{e-body-background-start}*/, #faeb9e /*{e-body-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient(top, #fff /*{e-body-background-start}*/, #faeb9e /*{e-body-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient(top, #fff /*{e-body-background-start}*/, #faeb9e /*{e-body-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient(top, #fff /*{e-body-background-start}*/, #faeb9e /*{e-body-background-end}*/); +} +.ui-body-e, +.ui-body-e input, +.ui-body-e select, +.ui-body-e textarea, +.ui-body-e button { + font-family: Helvetica, Arial, sans-serif /*{e-body-font}*/; +} +.ui-body-e .ui-link-inherit { + color: #333333 /*{e-body-color}*/; +} +.ui-body-e .ui-link { + color: #2489CE /*{global-link-color}*/; + font-weight: bold; +} +.ui-btn-up-e { + border: 1px solid #F7C942 /*{e-bup-border}*/; + background: #fadb4e /*{e-bup-background-color}*/; + font-weight: bold; + color: #333 /*{e-bup-color}*/; + text-shadow: 0 /*{e-bup-shadow-x}*/ 1px /*{e-bup-shadow-y}*/ 0 /*{e-bup-shadow-radius}*/ #fff /*{e-bup-shadow-color}*/; + background-image: -webkit-gradient(linear, left top, left bottom, from(#fceda7 /*{e-bup-background-start}*/), to(#fadb4e /*{e-bup-background-end}*/)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, #fceda7 /*{e-bup-background-start}*/, #fadb4e /*{e-bup-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient(top, #fceda7 /*{e-bup-background-start}*/, #fadb4e /*{e-bup-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient(top, #fceda7 /*{e-bup-background-start}*/, #fadb4e /*{e-bup-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient(top, #fceda7 /*{e-bup-background-start}*/, #fadb4e /*{e-bup-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient(top, #fceda7 /*{e-bup-background-start}*/, #fadb4e /*{e-bup-background-end}*/); +} +.ui-btn-up-e a.ui-link-inherit { + color: #333 /*{e-bup-color}*/; +} +.ui-btn-hover-e { + border: 1px solid #e79952 /*{e-bhover-border}*/; + background: #fbe26f /*{e-bhover-background-color}*/; + font-weight: bold; + color: #111 /*{e-bhover-color}*/; + text-shadow: 0 /*{e-bhover-shadow-x}*/ 1px /*{e-bhover-shadow-y}*/ 1px /*{e-bhover-shadow-radius}*/ #fff /*{e-bhover-shadow-color}*/; + background-image: -webkit-gradient(linear, left top, left bottom, from(#fcf0b5 /*{e-bhover-background-start}*/), to(#fbe26f /*{e-bhover-background-end}*/)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, #fcf0b5 /*{e-bhover-background-start}*/, #fbe26f /*{e-bhover-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient(top, #fcf0b5 /*{e-bhover-background-start}*/, #fbe26f /*{e-bhover-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient(top, #fcf0b5 /*{e-bhover-background-start}*/, #fbe26f /*{e-bhover-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient(top, #fcf0b5 /*{e-bhover-background-start}*/, #fbe26f /*{e-bhover-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient(top, #fcf0b5 /*{e-bhover-background-start}*/, #fbe26f /*{e-bhover-background-end}*/); +} + +.ui-btn-hover-e a.ui-link-inherit { + color: #333 /*{e-bhover-color}*/; +} +.ui-btn-down-e { + border: 1px solid #F7C942 /*{e-bdown-border}*/; + background: #fceda7 /*{e-bdown-background-color}*/; + font-weight: bold; + color: #111 /*{e-bdown-color}*/; + text-shadow: 0 /*{e-bdown-shadow-x}*/ 1px /*{e-bdown-shadow-y}*/ 1px /*{e-bdown-shadow-radius}*/ #ffffff /*{e-bdown-shadow-color}*/; + background-image: -webkit-gradient(linear, left top, left bottom, from(#fadb4e /*{e-bdown-background-start}*/), to(#fceda7 /*{e-bdown-background-end}*/)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, #fadb4e /*{e-bdown-background-start}*/, #fceda7 /*{e-bdown-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient(top, #fadb4e /*{e-bdown-background-start}*/, #fceda7 /*{e-bdown-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient(top, #fadb4e /*{e-bdown-background-start}*/, #fceda7 /*{e-bdown-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient(top, #fadb4e /*{e-bdown-background-start}*/, #fceda7 /*{e-bdown-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient(top, #fadb4e /*{e-bdown-background-start}*/, #fceda7 /*{e-bdown-background-end}*/); +} +.ui-btn-down-e a.ui-link-inherit { + color: #333 /*{e-bdown-color}*/; +} +.ui-btn-up-e, +.ui-btn-hover-e, +.ui-btn-down-e { + font-family: Helvetica, Arial, sans-serif /*{e-button-font}*/; + text-decoration: none; +} + +/* Structure */ + +/* links within "buttons" +-----------------------------------------------------------------------------------------------------------*/ + +a.ui-link-inherit { + text-decoration: none !important; +} + +/* links and their different states +-----------------------------------------------------------------------------------------------------------*/ + +.ui-link{ + color: #2489CE /*{global-link-color}*/ +} + +.ui-link:hover{ + color: #2489CE /*{global-link-hover}*/ +} + +.ui-link:active{ + color: #2489CE /*{global-link-active}*/ +} + +.ui-link:visited{ + color: #2489CE /*{global-link-visited}*/ +} + +/* Active class used as the "on" state across all themes +-----------------------------------------------------------------------------------------------------------*/ + +.ui-btn-active { + border: 1px solid #155678 /*{global-active-border}*/; + background: #4596ce /*{global-active-background-color}*/; + font-weight: bold; + color: #fff /*{global-active-color}*/; + cursor: pointer; + text-shadow: 0 /*{global-active-shadow-x}*/ -1px /*{global-active-shadow-y}*/ 1px /*{global-active-shadow-radius}*/ #145072 /*{global-active-shadow-color}*/; + text-decoration: none; + background-image: -webkit-gradient(linear, left top, left bottom, from(#85bae4 /*{global-active-background-start}*/), to(#5393c5 /*{global-active-background-end}*/)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, #85bae4 /*{global-active-background-start}*/, #5393c5 /*{global-active-background-end}*/); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient(top, #85bae4 /*{global-active-background-start}*/, #5393c5 /*{global-active-background-end}*/); /* FF3.6 */ + background-image: -ms-linear-gradient(top, #85bae4 /*{global-active-background-start}*/, #5393c5 /*{global-active-background-end}*/); /* IE10 */ + background-image: -o-linear-gradient(top, #85bae4 /*{global-active-background-start}*/, #5393c5 /*{global-active-background-end}*/); /* Opera 11.10+ */ + background-image: linear-gradient(top, #85bae4 /*{global-active-background-start}*/, #5393c5 /*{global-active-background-end}*/); + outline: none; + font-family: Helvetica, Arial, sans-serif /*{global-active-font}*/; +} +.ui-btn-active a.ui-link-inherit { + color: #fff /*{global-active-color}*/; +} + + +/* button inner top highlight +-----------------------------------------------------------------------------------------------------------*/ + +.ui-btn-inner { + border-top: 1px solid #fff; + border-color: rgba(255,255,255,.3); +} + + +/* corner rounding classes +-----------------------------------------------------------------------------------------------------------*/ + +.ui-corner-tl { + -moz-border-radius-topleft: .6em /*{global-radii-blocks}*/; + -webkit-border-top-left-radius: .6em /*{global-radii-blocks}*/; + border-top-left-radius: .6em /*{global-radii-blocks}*/; +} +.ui-corner-tr { + -moz-border-radius-topright: .6em /*{global-radii-blocks}*/; + -webkit-border-top-right-radius: .6em /*{global-radii-blocks}*/; + border-top-right-radius: .6em /*{global-radii-blocks}*/; +} +.ui-corner-bl { + -moz-border-radius-bottomleft: .6em /*{global-radii-blocks}*/; + -webkit-border-bottom-left-radius: .6em /*{global-radii-blocks}*/; + border-bottom-left-radius: .6em /*{global-radii-blocks}*/; +} +.ui-corner-br { + -moz-border-radius-bottomright: .6em /*{global-radii-blocks}*/; + -webkit-border-bottom-right-radius: .6em /*{global-radii-blocks}*/; + border-bottom-right-radius: .6em /*{global-radii-blocks}*/; +} +.ui-corner-top { + -moz-border-radius-topleft: .6em /*{global-radii-blocks}*/; + -webkit-border-top-left-radius: .6em /*{global-radii-blocks}*/; + border-top-left-radius: .6em /*{global-radii-blocks}*/; + -moz-border-radius-topright: .6em /*{global-radii-blocks}*/; + -webkit-border-top-right-radius: .6em /*{global-radii-blocks}*/; + border-top-right-radius: .6em /*{global-radii-blocks}*/; +} +.ui-corner-bottom { + -moz-border-radius-bottomleft: .6em /*{global-radii-blocks}*/; + -webkit-border-bottom-left-radius: .6em /*{global-radii-blocks}*/; + border-bottom-left-radius: .6em /*{global-radii-blocks}*/; + -moz-border-radius-bottomright: .6em /*{global-radii-blocks}*/; + -webkit-border-bottom-right-radius: .6em /*{global-radii-blocks}*/; + border-bottom-right-radius: .6em /*{global-radii-blocks}*/; + } +.ui-corner-right { + -moz-border-radius-topright: .6em /*{global-radii-blocks}*/; + -webkit-border-top-right-radius: .6em /*{global-radii-blocks}*/; + border-top-right-radius: .6em /*{global-radii-blocks}*/; + -moz-border-radius-bottomright: .6em /*{global-radii-blocks}*/; + -webkit-border-bottom-right-radius: .6em /*{global-radii-blocks}*/; + border-bottom-right-radius: .6em /*{global-radii-blocks}*/; +} +.ui-corner-left { + -moz-border-radius-topleft: .6em /*{global-radii-blocks}*/; + -webkit-border-top-left-radius: .6em /*{global-radii-blocks}*/; + border-top-left-radius: .6em /*{global-radii-blocks}*/; + -moz-border-radius-bottomleft: .6em /*{global-radii-blocks}*/; + -webkit-border-bottom-left-radius: .6em /*{global-radii-blocks}*/; + border-bottom-left-radius: .6em /*{global-radii-blocks}*/; +} +.ui-corner-all { + -moz-border-radius: .6em /*{global-radii-blocks}*/; + -webkit-border-radius: .6em /*{global-radii-blocks}*/; + border-radius: .6em /*{global-radii-blocks}*/; +} +.ui-corner-none { + -moz-border-radius: 0; + -webkit-border-radius: 0; + border-radius: 0; +} + +/* Interaction cues +-----------------------------------------------------------------------------------------------------------*/ +.ui-disabled { + opacity: .3; +} +.ui-disabled, +.ui-disabled a { + cursor: default; +} + +/* Icons +-----------------------------------------------------------------------------------------------------------*/ + +.ui-icon, +.ui-icon-searchfield:after { + background: #666 /*{global-icon-color}*/; + background: rgba(0,0,0,.4) /*{global-icon-disc}*/; + background-image: url(images/icons-18-white.png) /*{global-icon-set}*/; + background-repeat: no-repeat; + -moz-border-radius: 9px; + -webkit-border-radius: 9px; + border-radius: 9px; +} + + +/* Alt icon color +-----------------------------------------------------------------------------------------------------------*/ + +.ui-icon-alt { + background: #fff; + background: rgba(255,255,255,.3); + background-image: url(images/icons-18-black.png); + background-repeat: no-repeat; +} + +/* HD/"retina" sprite +-----------------------------------------------------------------------------------------------------------*/ + +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (min--moz-device-pixel-ratio: 1.5), + only screen and (min-resolution: 240dpi) { + + .ui-icon-plus, .ui-icon-minus, .ui-icon-delete, .ui-icon-arrow-r, + .ui-icon-arrow-l, .ui-icon-arrow-u, .ui-icon-arrow-d, .ui-icon-check, + .ui-icon-gear, .ui-icon-refresh, .ui-icon-forward, .ui-icon-back, + .ui-icon-grid, .ui-icon-star, .ui-icon-alert, .ui-icon-info, .ui-icon-home, .ui-icon-search, .ui-icon-searchfield:after, + .ui-icon-checkbox-off, .ui-icon-checkbox-on, .ui-icon-radio-off, .ui-icon-radio-on { + background-image: url(images/icons-36-white.png); + -moz-background-size: 776px 18px; + -o-background-size: 776px 18px; + -webkit-background-size: 776px 18px; + background-size: 776px 18px; + } + .ui-icon-alt { + background-image: url(images/icons-36-black.png); + } +} + +/* plus minus */ +.ui-icon-plus { + background-position: -0 50%; +} +.ui-icon-minus { + background-position: -36px 50%; +} + +/* delete/close */ +.ui-icon-delete { + background-position: -72px 50%; +} + +/* arrows */ +.ui-icon-arrow-r { + background-position: -108px 50%; +} +.ui-icon-arrow-l { + background-position: -144px 50%; +} +.ui-icon-arrow-u { + background-position: -180px 50%; +} +.ui-icon-arrow-d { + background-position: -216px 50%; +} + +/* misc */ +.ui-icon-check { + background-position: -252px 50%; +} +.ui-icon-gear { + background-position: -288px 50%; +} +.ui-icon-refresh { + background-position: -324px 50%; +} +.ui-icon-forward { + background-position: -360px 50%; +} +.ui-icon-back { + background-position: -396px 50%; +} +.ui-icon-grid { + background-position: -432px 50%; +} +.ui-icon-star { + background-position: -468px 50%; +} +.ui-icon-alert { + background-position: -504px 50%; +} +.ui-icon-info { + background-position: -540px 50%; +} +.ui-icon-home { + background-position: -576px 50%; +} +.ui-icon-search, +.ui-icon-searchfield:after { + background-position: -612px 50%; +} +.ui-icon-checkbox-off { + background-position: -684px 50%; +} +.ui-icon-checkbox-on { + background-position: -648px 50%; +} +.ui-icon-radio-off { + background-position: -756px 50%; +} +.ui-icon-radio-on { + background-position: -720px 50%; +} + + +/* checks,radios */ +.ui-checkbox .ui-icon { + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; +} +.ui-icon-checkbox-off, +.ui-icon-radio-off { + background-color: transparent; +} +.ui-checkbox-on .ui-icon, +.ui-radio-on .ui-icon { + background-color: #4596ce /*{global-active-background-color}*/; /* NOTE: this hex should match the active state color. It's repeated here for cascade */ +} + +/* loading icon */ +.ui-icon-loading { + background-image: url(images/ajax-loader.png); + width: 40px; + height: 40px; + -moz-border-radius: 20px; + -webkit-border-radius: 20px; + border-radius: 20px; + background-size: 35px 35px; +} + + +/* Button corner classes +-----------------------------------------------------------------------------------------------------------*/ + +.ui-btn-corner-tl { + -moz-border-radius-topleft: 1em /*{global-radii-buttons}*/; + -webkit-border-top-left-radius: 1em /*{global-radii-buttons}*/; + border-top-left-radius: 1em /*{global-radii-buttons}*/; +} +.ui-btn-corner-tr { + -moz-border-radius-topright: 1em /*{global-radii-buttons}*/; + -webkit-border-top-right-radius: 1em /*{global-radii-buttons}*/; + border-top-right-radius: 1em /*{global-radii-buttons}*/; +} +.ui-btn-corner-bl { + -moz-border-radius-bottomleft: 1em /*{global-radii-buttons}*/; + -webkit-border-bottom-left-radius: 1em /*{global-radii-buttons}*/; + border-bottom-left-radius: 1em /*{global-radii-buttons}*/; +} +.ui-btn-corner-br { + -moz-border-radius-bottomright: 1em /*{global-radii-buttons}*/; + -webkit-border-bottom-right-radius: 1em /*{global-radii-buttons}*/; + border-bottom-right-radius: 1em /*{global-radii-buttons}*/; +} +.ui-btn-corner-top { + -moz-border-radius-topleft: 1em /*{global-radii-buttons}*/; + -webkit-border-top-left-radius: 1em /*{global-radii-buttons}*/; + border-top-left-radius: 1em /*{global-radii-buttons}*/; + -moz-border-radius-topright: 1em /*{global-radii-buttons}*/; + -webkit-border-top-right-radius: 1em /*{global-radii-buttons}*/; + border-top-right-radius: 1em /*{global-radii-buttons}*/; +} +.ui-btn-corner-bottom { + -moz-border-radius-bottomleft: 1em /*{global-radii-buttons}*/; + -webkit-border-bottom-left-radius: 1em /*{global-radii-buttons}*/; + border-bottom-left-radius: 1em /*{global-radii-buttons}*/; + -moz-border-radius-bottomright: 1em /*{global-radii-buttons}*/; + -webkit-border-bottom-right-radius: 1em /*{global-radii-buttons}*/; + border-bottom-right-radius: 1em /*{global-radii-buttons}*/; +} +.ui-btn-corner-right { + -moz-border-radius-topright: 1em /*{global-radii-buttons}*/; + -webkit-border-top-right-radius: 1em /*{global-radii-buttons}*/; + border-top-right-radius: 1em /*{global-radii-buttons}*/; + -moz-border-radius-bottomright: 1em /*{global-radii-buttons}*/; + -webkit-border-bottom-right-radius: 1em /*{global-radii-buttons}*/; + border-bottom-right-radius: 1em /*{global-radii-buttons}*/; +} +.ui-btn-corner-left { + -moz-border-radius-topleft: 1em /*{global-radii-buttons}*/; + -webkit-border-top-left-radius: 1em /*{global-radii-buttons}*/; + border-top-left-radius: 1em /*{global-radii-buttons}*/; + -moz-border-radius-bottomleft: 1em /*{global-radii-buttons}*/; + -webkit-border-bottom-left-radius: 1em /*{global-radii-buttons}*/; + border-bottom-left-radius: 1em /*{global-radii-buttons}*/; +} +.ui-btn-corner-all { + -moz-border-radius: 1em /*{global-radii-buttons}*/; + -webkit-border-radius: 1em /*{global-radii-buttons}*/; + border-radius: 1em /*{global-radii-buttons}*/; +} + +/* radius clip workaround for cleaning up corner trapping */ +.ui-corner-tl, +.ui-corner-tr, +.ui-corner-bl, +.ui-corner-br, +.ui-corner-top, +.ui-corner-bottom, +.ui-corner-right, +.ui-corner-left, +.ui-corner-all, +.ui-btn-corner-tl, +.ui-btn-corner-tr, +.ui-btn-corner-bl, +.ui-btn-corner-br, +.ui-btn-corner-top, +.ui-btn-corner-bottom, +.ui-btn-corner-right, +.ui-btn-corner-left, +.ui-btn-corner-all { + -webkit-background-clip: padding-box; + -moz-background-clip: padding; + background-clip: padding-box; +} + +/* Overlay / modal +-----------------------------------------------------------------------------------------------------------*/ + +.ui-overlay { + background: #666; + opacity: .5; + filter: Alpha(Opacity=50); + position: absolute; + width: 100%; + height: 100%; +} +.ui-overlay-shadow { + -moz-box-shadow: 0px 0px 12px rgba(0,0,0,.6); + -webkit-box-shadow: 0px 0px 12px rgba(0,0,0,.6); + box-shadow: 0px 0px 12px rgba(0,0,0,.6); +} +.ui-shadow { + -moz-box-shadow: 0px 1px 4px /*{global-box-shadow-size}*/ rgba(0,0,0,.3) /*{global-box-shadow-color}*/; + -webkit-box-shadow: 0px 1px 4px /*{global-box-shadow-size}*/ rgba(0,0,0,.3) /*{global-box-shadow-color}*/; + box-shadow: 0px 1px 4px /*{global-box-shadow-size}*/ rgba(0,0,0,.3) /*{global-box-shadow-color}*/; +} +.ui-bar-a .ui-shadow, +.ui-bar-b .ui-shadow , +.ui-bar-c .ui-shadow { + -moz-box-shadow: 0px 1px 0 rgba(255,255,255,.3); + -webkit-box-shadow: 0px 1px 0 rgba(255,255,255,.3); + box-shadow: 0px 1px 0 rgba(255,255,255,.3); +} +.ui-shadow-inset { + -moz-box-shadow: inset 0px 1px 4px rgba(0,0,0,.2); + -webkit-box-shadow: inset 0px 1px 4px rgba(0,0,0,.2); + box-shadow: inset 0px 1px 4px rgba(0,0,0,.2); +} +.ui-icon-shadow { + -moz-box-shadow: 0px 1px 0 rgba(255,255,255,.4); + -webkit-box-shadow: 0px 1px 0 rgba(255,255,255,.4); + box-shadow: 0px 1px 0 rgba(255,255,255,.4); +} + +/* Focus state - set here for specificity +-----------------------------------------------------------------------------------------------------------*/ + +.ui-focus { + -moz-box-shadow: 0px 0px 12px #387bbe /*{global-active-background-color}*/; + -webkit-box-shadow: 0px 0px 12px #387bbe /*{global-active-background-color}*/; + box-shadow: 0px 0px 12px #387bbe /*{global-active-background-color}*/; +} + +/* unset box shadow in browsers that don't do it right +-----------------------------------------------------------------------------------------------------------*/ + +.ui-mobile-nosupport-boxshadow * { + -moz-box-shadow: none !important; + -webkit-box-shadow: none !important; + box-shadow: none !important; +} + +/* ...and bring back focus */ +.ui-mobile-nosupport-boxshadow .ui-focus { + outline-width: 2px; +}/* +* jQuery Mobile Framework +* Copyright (c) jQuery Project +* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. +*/ + +/* some unsets - more probably needed */ +.ui-mobile, .ui-mobile body { height: 100%; } +.ui-mobile fieldset, .ui-page { padding: 0; margin: 0; } +.ui-mobile a img, .ui-mobile fieldset { border: 0; } + +/* responsive page widths */ +.ui-mobile-viewport { margin: 0; overflow-x: hidden; -webkit-text-size-adjust: none; -ms-text-size-adjust:none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } + +/* "page" containers - full-screen views, one should always be in view post-pageload */ +.ui-mobile [data-role=page], .ui-mobile [data-role=dialog], .ui-page { top: 0; left: 0; width: 100%; min-height: 100%; position: absolute; display: none; border: 0; } +.ui-mobile .ui-page-active { display: block; overflow: visible; } + +/* on ios4, setting focus on the page element causes flashing during transitions when there is an outline, so we turn off outlines */ +.ui-page { outline: none; } + +/* native overflow scrolling */ +.ui-page.ui-mobile-touch-overflow, +.ui-mobile-touch-overflow.ui-native-fixed .ui-content { + overflow: auto; + height: 100%; + -webkit-overflow-scrolling: touch; + -moz-overflow-scrolling: touch; + -o-overflow-scrolling: touch; + -ms-overflow-scrolling: touch; + overflow-scrolling: touch; +} +.ui-page.ui-mobile-touch-overflow, +.ui-page.ui-mobile-touch-overflow * { + /* some level of transform keeps elements from blinking out of visibility on iOS */ + -webkit-transform: rotateY(0); +} +.ui-page.ui-mobile-pre-transition { + display: block; +} + +/* loading screen */ +.ui-loading .ui-mobile-viewport { overflow: hidden !important; } +.ui-loading .ui-loader { display: block; } +.ui-loading .ui-page { overflow: hidden; } +.ui-loader { display: none; position: absolute; opacity: .85; z-index: 100; left: 50%; width: 200px; margin-left: -130px; margin-top: -35px; padding: 10px 30px; } +.ui-loader h1 { font-size: 15px; text-align: center; } +.ui-loader .ui-icon { position: static; display: block; opacity: .9; margin: 0 auto; width: 35px; height: 35px; background-color: transparent; } + +/*fouc*/ +.ui-mobile-rendering > * { visibility: hidden; } + +/*headers, content panels*/ +.ui-bar, .ui-body { position: relative; padding: .4em 15px; overflow: hidden; display: block; clear:both; } +.ui-bar { font-size: 16px; margin: 0; } +.ui-bar h1, .ui-bar h2, .ui-bar h3, .ui-bar h4, .ui-bar h5, .ui-bar h6 { margin: 0; padding: 0; font-size: 16px; display: inline-block; } + +.ui-header, .ui-footer { display: block; } +.ui-page .ui-header, .ui-page .ui-footer { position: relative; } +.ui-header .ui-btn-left { position: absolute; left: 10px; top: .4em; } +.ui-header .ui-btn-right { position: absolute; right: 10px; top: .4em; } +.ui-header .ui-title, .ui-footer .ui-title { min-height: 1.1em; text-align: center; font-size: 16px; display: block; margin: .6em 90px .8em; padding: 0; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; outline: 0 !important; } + +/*content area*/ +.ui-content { border-width: 0; overflow: visible; overflow-x: hidden; padding: 15px; } +.ui-page-fullscreen .ui-content { padding:0; } + +/* native fixed headers and footers */ +.ui-mobile-touch-overflow.ui-page.ui-native-fixed, +.ui-mobile-touch-overflow.ui-page.ui-native-fullscreen { + overflow: visible; +} +.ui-mobile-touch-overflow.ui-native-fixed .ui-header, +.ui-mobile-touch-overflow.ui-native-fixed .ui-footer { + position: fixed; + left: 0; + right: 0; + top: 0; + z-index: 200; +} +.ui-mobile-touch-overflow.ui-page.ui-native-fixed .ui-footer { + top: auto; + bottom: 0; +} +.ui-mobile-touch-overflow.ui-native-fixed .ui-content { + padding-top: 2.5em; + padding-bottom: 3em; + top: 0; + bottom: 0; + height: auto; + position: absolute; +} +.ui-mobile-touch-overflow.ui-native-fullscreen .ui-content { + padding-top: 0; + padding-bottom: 0; +} +.ui-mobile-touch-overflow.ui-native-fullscreen .ui-header, +.ui-mobile-touch-overflow.ui-native-fullscreen .ui-footer { + opacity: .9; +} +.ui-native-bars-hidden { + display: none; +} + +/* icons sizing */ +.ui-icon { width: 18px; height: 18px; } + +/* fullscreen class on ui-content div */ +.ui-fullscreen { } +.ui-fullscreen img { max-width: 100%; } + +/* non-js content hiding */ +.ui-nojs { position: absolute; left: -9999px; } +/* +* jQuery Mobile Framework +* Copyright (c) jQuery Project +* Dual licensed under the MIT (MIT-LICENSE.txt) or GPL (GPL-LICENSE.txt) licenses. +*/ +.spin { + -webkit-transform: rotate(360deg); + -webkit-animation-name: spin; + -webkit-animation-duration: 1s; + -webkit-animation-iteration-count: infinite; + -webkit-animation-timing-function: linear; +} +@-webkit-keyframes spin { + from {-webkit-transform: rotate(0deg);} + to {-webkit-transform: rotate(360deg);} +} + +/* Transitions from jQtouch (with small modifications): http://www.jqtouch.com/ +Built by David Kaneda and maintained by Jonathan Stark. +*/ +.in, .out { + -webkit-animation-timing-function: ease-in-out; + -webkit-animation-duration: 350ms; +} + + +.slide.out { + -webkit-transform: translateX(-100%); + -webkit-animation-name: slideouttoleft; +} + +.slide.in { + -webkit-transform: translateX(0); + -webkit-animation-name: slideinfromright; +} + +.slide.out.reverse { + -webkit-transform: translateX(100%); + -webkit-animation-name: slideouttoright; +} + +.slide.in.reverse { + -webkit-transform: translateX(0); + -webkit-animation-name: slideinfromleft; +} + +.slideup.out { + -webkit-animation-name: dontmove; + z-index: 0; +} + +.slideup.in { + -webkit-transform: translateY(0); + -webkit-animation-name: slideinfrombottom; + z-index: 10; +} + +.slideup.in.reverse { + z-index: 0; + -webkit-animation-name: dontmove; +} + +.slideup.out.reverse { + -webkit-transform: translateY(100%); + z-index: 10; + -webkit-animation-name: slideouttobottom; +} + +.slidedown.out { + -webkit-animation-name: dontmove; + z-index: 0; +} + +.slidedown.in { + -webkit-transform: translateY(0); + -webkit-animation-name: slideinfromtop; + z-index: 10; +} + +.slidedown.in.reverse { + z-index: 0; + -webkit-animation-name: dontmove; +} + +.slidedown.out.reverse { + -webkit-transform: translateY(-100%); + z-index: 10; + -webkit-animation-name: slideouttotop; +} + +@-webkit-keyframes slideinfromright { + from { -webkit-transform: translateX(100%); } + to { -webkit-transform: translateX(0); } +} + +@-webkit-keyframes slideinfromleft { + from { -webkit-transform: translateX(-100%); } + to { -webkit-transform: translateX(0); } +} + +@-webkit-keyframes slideouttoleft { + from { -webkit-transform: translateX(0); } + to { -webkit-transform: translateX(-100%); } +} + +@-webkit-keyframes slideouttoright { + from { -webkit-transform: translateX(0); } + to { -webkit-transform: translateX(100%); } +} + +@-webkit-keyframes slideinfromtop { + from { -webkit-transform: translateY(-100%); } + to { -webkit-transform: translateY(0); } +} + +@-webkit-keyframes slideinfrombottom { + from { -webkit-transform: translateY(100%); } + to { -webkit-transform: translateY(0); } +} + +@-webkit-keyframes slideouttobottom { + from { -webkit-transform: translateY(0); } + to { -webkit-transform: translateY(100%); } +} + +@-webkit-keyframes slideouttotop { + from { -webkit-transform: translateY(0); } + to { -webkit-transform: translateY(-100%); } +} +@-webkit-keyframes fadein { + from { opacity: 0; } + to { opacity: 1; } +} + +@-webkit-keyframes fadeout { + from { opacity: 1; } + to { opacity: 0; } +} + +.fade.out { + z-index: 0; + -webkit-animation-name: fadeout; +} + +.fade.in { + opacity: 1; + z-index: 10; + -webkit-animation-name: fadein; +} + +/* The properties in this rule are only necessary for the 'flip' transition. + * We need specify the perspective to create a projection matrix. This will add + * some depth as the element flips. The depth number represents the distance of + * the viewer from the z-plane. According to the CSS3 spec, 1000 is a moderate + * value. + */ +.viewport-flip { + -webkit-perspective: 1000; + position: absolute; +} + +.ui-mobile-viewport-transitioning, +.ui-mobile-viewport-transitioning .ui-page { + width: 100%; + height: 100%; + overflow: hidden; +} + +.flip { + -webkit-animation-duration: .65s; + -webkit-backface-visibility:hidden; + -webkit-transform:translateX(0); /* Needed to work around an iOS 3.1 bug that causes listview thumbs to disappear when -webkit-visibility:hidden is used. */ +} + +.flip.out { + -webkit-transform: rotateY(-180deg) scale(.8); + -webkit-animation-name: flipouttoleft; +} + +.flip.in { + -webkit-transform: rotateY(0) scale(1); + -webkit-animation-name: flipinfromleft; +} + +/* Shake it all about */ + +.flip.out.reverse { + -webkit-transform: rotateY(180deg) scale(.8); + -webkit-animation-name: flipouttoright; +} + +.flip.in.reverse { + -webkit-transform: rotateY(0) scale(1); + -webkit-animation-name: flipinfromright; +} + +@-webkit-keyframes flipinfromright { + from { -webkit-transform: rotateY(-180deg) scale(.8); } + to { -webkit-transform: rotateY(0) scale(1); } +} + +@-webkit-keyframes flipinfromleft { + from { -webkit-transform: rotateY(180deg) scale(.8); } + to { -webkit-transform: rotateY(0) scale(1); } +} + +@-webkit-keyframes flipouttoleft { + from { -webkit-transform: rotateY(0) scale(1); } + to { -webkit-transform: rotateY(-180deg) scale(.8); } +} + +@-webkit-keyframes flipouttoright { + from { -webkit-transform: rotateY(0) scale(1); } + to { -webkit-transform: rotateY(180deg) scale(.8); } +} + + +/* Hackish, but reliable. */ + +@-webkit-keyframes dontmove { + from { opacity: 1; } + to { opacity: 1; } +} + +.pop { + -webkit-transform-origin: 50% 50%; +} + +.pop.in { + -webkit-transform: scale(1); + opacity: 1; + -webkit-animation-name: popin; + z-index: 10; +} + +.pop.in.reverse { + z-index: 0; + -webkit-animation-name: dontmove; +} + +.pop.out.reverse { + -webkit-transform: scale(.2); + opacity: 0; + -webkit-animation-name: popout; + z-index: 10; +} + +@-webkit-keyframes popin { + from { + -webkit-transform: scale(.2); + opacity: 0; + } + to { + -webkit-transform: scale(1); + opacity: 1; + } +} + +@-webkit-keyframes popout { + from { + -webkit-transform: scale(1); + opacity: 1; + } + to { + -webkit-transform: scale(.2); + opacity: 0; + } +}/* +* jQuery Mobile Framework +* Copyright (c) jQuery Project +* Dual licensed under the MIT (MIT-LICENSE.txt) or GPL (GPL-LICENSE.txt) licenses. +*/ + +/* content configurations. */ +.ui-grid-a, .ui-grid-b, .ui-grid-c, .ui-grid-d { overflow: hidden; } +.ui-block-a, .ui-block-b, .ui-block-c, .ui-block-d, .ui-block-e { margin: 0; padding: 0; border: 0; float: left; min-height:1px;} + +/* grid solo: 100 - single item fallback */ +.ui-grid-solo .ui-block-a { width: 100%; float: none; } + +/* grid a: 50/50 */ +.ui-grid-a .ui-block-a, .ui-grid-a .ui-block-b { width: 50%; } +.ui-grid-a .ui-block-a { clear: left; } + +/* grid b: 33/33/33 */ +.ui-grid-b .ui-block-a, .ui-grid-b .ui-block-b, .ui-grid-b .ui-block-c { width: 33.333%; } +.ui-grid-b .ui-block-a { clear: left; } + +/* grid c: 25/25/25/25 */ +.ui-grid-c .ui-block-a, .ui-grid-c .ui-block-b, .ui-grid-c .ui-block-c, .ui-grid-c .ui-block-d { width: 25%; } +.ui-grid-c .ui-block-a { clear: left; } + +/* grid d: 20/20/20/20/20 */ +.ui-grid-d .ui-block-a, .ui-grid-d .ui-block-b, .ui-grid-d .ui-block-c, .ui-grid-d .ui-block-d, .ui-grid-d .ui-block-e { width: 20%; } +.ui-grid-d .ui-block-a { clear: left; } +/* +* jQuery Mobile Framework +* Copyright (c) jQuery Project +* Dual licensed under the MIT (MIT-LICENSE.txt) or GPL (GPL-LICENSE.txt) licenses. +*/ +/* fixed page header & footer configuration */ +.ui-header, .ui-footer, .ui-page-fullscreen .ui-header, .ui-page-fullscreen .ui-footer { position: absolute; overflow: hidden; width: 100%; border-left-width: 0; border-right-width: 0; } +.ui-header-fixed, .ui-footer-fixed { + z-index: 1000; + -webkit-transform: translateZ(0); /* Force header/footer rendering to go through the same rendering pipeline as native page scrolling. */ +} +.ui-footer-duplicate, .ui-page-fullscreen .ui-fixed-inline { display: none; } +.ui-page-fullscreen .ui-header, .ui-page-fullscreen .ui-footer { opacity: .9; } +/* +* jQuery Mobile Framework +* Copyright (c) jQuery Project +* Dual licensed under the MIT (MIT-LICENSE.txt) or GPL (GPL-LICENSE.txt) licenses. +*/ +.ui-navbar { overflow: hidden; } +.ui-navbar ul, .ui-navbar-expanded ul { list-style:none; padding: 0; margin: 0; position: relative; display: block; border: 0;} +.ui-navbar-collapsed ul { float: left; width: 75%; margin-right: -2px; } +.ui-navbar-collapsed .ui-navbar-toggle { float: left; width: 25%; } +.ui-navbar li.ui-navbar-truncate { position: absolute; left: -9999px; top: -9999px; } +.ui-navbar li .ui-btn, .ui-navbar .ui-navbar-toggle .ui-btn { display: block; font-size: 12px; text-align: center; margin: 0; border-right-width: 0; } +.ui-navbar li .ui-btn { margin-right: -1px; } +.ui-navbar li .ui-btn:last-child { margin-right: 0; } +.ui-header .ui-navbar li .ui-btn, .ui-header .ui-navbar .ui-navbar-toggle .ui-btn, +.ui-footer .ui-navbar li .ui-btn, .ui-footer .ui-navbar .ui-navbar-toggle .ui-btn { border-top-width: 0; border-bottom-width: 0; } +.ui-navbar .ui-btn-inner { padding-left: 2px; padding-right: 2px; } +.ui-navbar-noicons li .ui-btn .ui-btn-inner, .ui-navbar-noicons .ui-navbar-toggle .ui-btn-inner { padding-top: .8em; padding-bottom: .9em; } +/*expanded page styles*/ +.ui-navbar-expanded .ui-btn { margin: 0; font-size: 14px; } +.ui-navbar-expanded .ui-btn-inner { padding-left: 5px; padding-right: 5px; } +.ui-navbar-expanded .ui-btn-icon-top .ui-btn-inner { padding: 45px 5px 15px; text-align: center; } +.ui-navbar-expanded .ui-btn-icon-top .ui-icon { top: 15px; } +.ui-navbar-expanded .ui-btn-icon-bottom .ui-btn-inner { padding: 15px 5px 45px; text-align: center; } +.ui-navbar-expanded .ui-btn-icon-bottom .ui-icon { bottom: 15px; } +.ui-navbar-expanded li .ui-btn .ui-btn-inner { min-height: 2.5em; } +.ui-navbar-expanded .ui-navbar-noicons .ui-btn .ui-btn-inner { padding-top: 1.8em; padding-bottom: 1.9em; } +/* +* jQuery Mobile Framework +* Copyright (c) jQuery Project +* Dual licensed under the MIT (MIT-LICENSE.txt) or GPL (GPL-LICENSE.txt) licenses. +*/ +.ui-btn { display: block; text-align: center; cursor:pointer; position: relative; margin: .5em 5px; padding: 0; } +.ui-btn:focus, .ui-btn:active { outline: none; } +.ui-header .ui-btn, .ui-footer .ui-btn, .ui-bar .ui-btn { display: inline-block; font-size: 13px; margin: 0; } +.ui-btn-inline { display: inline-block; } +.ui-btn-inner { padding: .6em 25px; display: block; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; position: relative; zoom: 1; } +.ui-header .ui-btn-inner, .ui-footer .ui-btn-inner, .ui-bar .ui-btn-inner { padding: .4em 8px .5em; } +.ui-btn-icon-notext { width: 24px; height: 24px; } +.ui-btn-icon-notext .ui-btn-inner { padding: 2px 1px 2px 3px; } +.ui-btn-icon-notext .ui-btn-text { position: absolute; left: -999px; } +.ui-btn-icon-left .ui-btn-inner { padding-left: 33px; } +.ui-header .ui-btn-icon-left .ui-btn-inner, +.ui-footer .ui-btn-icon-left .ui-btn-inner, +.ui-bar .ui-btn-icon-left .ui-btn-inner { padding-left: 27px; } +.ui-btn-icon-right .ui-btn-inner { padding-right: 33px; } +.ui-header .ui-btn-icon-right .ui-btn-inner, +.ui-footer .ui-btn-icon-right .ui-btn-inner, +.ui-bar .ui-btn-icon-right .ui-btn-inner { padding-right: 27px; } +.ui-btn-icon-top .ui-btn-inner { padding-top: 33px; } +.ui-header .ui-btn-icon-top .ui-btn-inner, +.ui-footer .ui-btn-icon-top .ui-btn-inner, +.ui-bar .ui-btn-icon-top .ui-btn-inner { padding-top: 27px; } +.ui-btn-icon-bottom .ui-btn-inner { padding-bottom: 33px; } +.ui-header .ui-btn-icon-bottom .ui-btn-inner, +.ui-footer .ui-btn-icon-bottom .ui-btn-inner, +.ui-bar .ui-btn-icon-bottom .ui-btn-inner { padding-bottom: 27px; } + +/*btn icon positioning*/ +.ui-btn-icon-notext .ui-icon { display: block; } +.ui-btn-icon-left .ui-icon, .ui-btn-icon-right .ui-icon { position: absolute; top: 50%; margin-top: -9px; } +.ui-btn-icon-top .ui-icon, .ui-btn-icon-bottom .ui-icon { position: absolute; left: 50%; margin-left: -9px; } +.ui-btn-icon-left .ui-icon { left: 10px; } +.ui-btn-icon-right .ui-icon { right: 10px; } +.ui-btn-icon-top .ui-icon { top: 10px; } +.ui-btn-icon-bottom .ui-icon { bottom: 10px; } +.ui-header .ui-btn-icon-left .ui-icon, +.ui-footer .ui-btn-icon-left .ui-icon, +.ui-bar .ui-btn-icon-left .ui-icon { left: 4px; } +.ui-header .ui-btn-icon-right .ui-icon, +.ui-footer .ui-btn-icon-right .ui-icon, +.ui-bar .ui-btn-icon-right .ui-icon { right: 4px; } +.ui-header .ui-btn-icon-top .ui-icon, +.ui-footer .ui-btn-icon-top .ui-icon, +.ui-bar .ui-btn-icon-top .ui-icon { top: 4px; } +.ui-header .ui-btn-icon-bottom .ui-icon, +.ui-footer .ui-btn-icon-bottom .ui-icon, +.ui-bar .ui-btn-icon-bottom .ui-icon { bottom: 4px; } + +/*hiding native button,inputs */ +.ui-btn-hidden { position: absolute; top: 0; left: 0; width: 100%; height: 100%; -webkit-appearance: button; opacity: .1; cursor: pointer; background: transparent; font-size: 1px; border: none; line-height: 999px; } +/* +* jQuery Mobile Framework +* Copyright (c) jQuery Project +* Dual licensed under the MIT (MIT-LICENSE.txt) or GPL (GPL-LICENSE.txt) licenses. +*/ +.ui-collapsible { margin: .5em 0; } +.ui-collapsible-heading { font-size: 16px; display: block; margin: 0 -8px; padding: 0; border-width: 0 0 1px 0; position: relative; } +.ui-collapsible-heading a { text-align: left; margin: 0; } +.ui-collapsible-heading a .ui-btn-inner { padding-left: 40px; } +.ui-collapsible-heading a span.ui-btn { position: absolute; left: 6px; top: 50%; margin: -12px 0 0 0; width: 20px; height: 20px; padding: 1px 0px 1px 2px; text-indent: -9999px; } +.ui-collapsible-heading a span.ui-btn .ui-btn-inner { padding: 10px 0; } +.ui-collapsible-heading a span.ui-btn .ui-icon { left: 0; margin-top: -10px; } +.ui-collapsible-heading-status { position:absolute; left:-9999px; } +.ui-collapsible-content { + display: block; + margin: 0 -8px; + padding: 10px 16px; + border-top: none; /* Overrides ui-btn-up-* */ + background-image: none; /* Overrides ui-btn-up-* */ + font-weight: normal; /* Overrides ui-btn-up-* */ +} +.ui-collapsible-content-collapsed { display: none; } + +.ui-collapsible-set { margin: .5em 0; } +.ui-collapsible-set .ui-collapsible { margin: -1px 0 0; } +/* +* jQuery Mobile Framework +* Copyright (c) jQuery Project +* Dual licensed under the MIT (MIT-LICENSE.txt) or GPL (GPL-LICENSE.txt) licenses. +*/ +.ui-controlgroup, fieldset.ui-controlgroup { padding: 0; margin: .5em 0 1em; } +.ui-bar .ui-controlgroup { margin: 0 .3em; } +.ui-controlgroup-label { font-size: 16px; line-height: 1.4; font-weight: normal; margin: 0 0 .3em; } +.ui-controlgroup-controls { display: block; width: 95%;} +.ui-controlgroup li { list-style: none; } +.ui-controlgroup-vertical .ui-btn, +.ui-controlgroup-vertical .ui-checkbox, .ui-controlgroup-vertical .ui-radio { margin: 0; border-bottom-width: 0; } +.ui-controlgroup-vertical .ui-controlgroup-last { border-bottom-width: 1px; } +.ui-controlgroup-horizontal { padding: 0; } +.ui-controlgroup-horizontal .ui-btn { display: inline-block; margin: 0 -5px 0 0; } +.ui-controlgroup-horizontal .ui-checkbox, .ui-controlgroup-horizontal .ui-radio { float: left; margin: 0 -1px 0 0; } +.ui-controlgroup-horizontal .ui-checkbox .ui-btn, .ui-controlgroup-horizontal .ui-radio .ui-btn, +.ui-controlgroup-horizontal .ui-checkbox:last-child, .ui-controlgroup-horizontal .ui-radio:last-child { margin-right: 0; } +.ui-controlgroup-horizontal .ui-controlgroup-last { margin-right: 0; } +.ui-controlgroup .ui-checkbox label, .ui-controlgroup .ui-radio label { font-size: 16px; } +/* conflicts with listview.. +.ui-controlgroup .ui-btn-icon-notext { width: 30px; height: 30px; text-indent: -9999px; } +.ui-controlgroup .ui-btn-icon-notext .ui-btn-inner { padding: 5px 6px 5px 5px; } +*/ + +@media all and (min-width: 450px){ + .ui-controlgroup-label { vertical-align: top; display: inline-block; width: 20%; margin: 0 2% 0 0; } + .ui-controlgroup-controls { width: 60%; display: inline-block; } +} /* +* jQuery Mobile Framework +* Copyright (c) jQuery Project +* Dual licensed under the MIT (MIT-LICENSE.txt) or GPL (GPL-LICENSE.txt) licenses. +*/ +.ui-dialog { min-height: 480px; } +.ui-dialog .ui-header, .ui-dialog .ui-content, .ui-dialog .ui-footer { margin: 15px; position: relative; } +.ui-dialog .ui-header, .ui-dialog .ui-footer { z-index: 10; width: auto; } +.ui-dialog .ui-content, .ui-dialog .ui-footer { margin-top: -15px; }/* +* jQuery Mobile Framework +* Copyright (c) jQuery Project +* Dual licensed under the MIT (MIT-LICENSE.txt) or GPL (GPL-LICENSE.txt) licenses. +*/ +.ui-checkbox, .ui-radio { position:relative; margin: .2em 0 .5em; z-index: 1; } +.ui-checkbox .ui-btn, .ui-radio .ui-btn { margin: 0; text-align: left; z-index: 2; } +.ui-checkbox .ui-btn-inner, .ui-radio .ui-btn-inner { white-space: normal; } +.ui-checkbox .ui-btn-icon-left .ui-btn-inner,.ui-radio .ui-btn-icon-left .ui-btn-inner { padding-left: 45px; } +.ui-checkbox .ui-btn-icon-right .ui-btn-inner, .ui-radio .ui-btn-icon-right .ui-btn-inner { padding-right: 45px; } +.ui-checkbox .ui-icon, .ui-radio .ui-icon { top: 1.1em; } +.ui-checkbox .ui-btn-icon-left .ui-icon, .ui-radio .ui-btn-icon-left .ui-icon {left: 15px; } +.ui-checkbox .ui-btn-icon-right .ui-icon, .ui-radio .ui-btn-icon-right .ui-icon {right: 15px; } +/* input, label positioning */ +.ui-checkbox input,.ui-radio input { position:absolute; left:20px; top:50%; width: 10px; height: 10px; margin:-5px 0 0 0; outline: 0 !important; z-index: 1; }/* +* jQuery Mobile Framework +* Copyright (c) jQuery Project +* Dual licensed under the MIT (MIT-LICENSE.txt) or GPL (GPL-LICENSE.txt) licenses. +*/ +.ui-field-contain { padding: 1.5em 0; margin: 0; border-bottom-width: 1px; overflow: visible; } +.ui-field-contain:first-child { border-top-width: 0; } +@media all and (min-width: 450px){ + .ui-field-contain { border-width: 0; padding: 0; margin: 1em 0; } +} /* +* jQuery Mobile Framework +* Copyright (c) jQuery Project +* Dual licensed under the MIT (MIT-LICENSE.txt) or GPL (GPL-LICENSE.txt) licenses. +*/ +.ui-select { display: block; position: relative; } +.ui-select select { position: absolute; left: -9999px; top: -9999px; } +.ui-select .ui-btn { overflow: hidden; } +.ui-select .ui-btn select { cursor: pointer; -webkit-appearance: button; left: 0; top:0; width: 100%; min-height: 1.5em; min-height: 100%; height: 3em; max-height: 100%; opacity: 0; -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; filter: alpha(opacity=0); z-index: 2; } +@-moz-document url-prefix() {.ui-select .ui-btn select { opacity: 0.0001; }} +.ui-select .ui-btn select.ui-select-nativeonly { opacity: 1; text-indent: 0; } + +.ui-select .ui-btn-icon-right .ui-btn-inner { padding-right: 45px; } +.ui-select .ui-btn-icon-right .ui-icon { right: 15px; } + +/* labels */ +label.ui-select { font-size: 16px; line-height: 1.4; font-weight: normal; margin: 0 0 .3em; display: block; } + +/*listbox*/ +.ui-select .ui-btn-text, .ui-selectmenu .ui-btn-text { display: block; min-height: 1em; } +.ui-select .ui-btn-text { text-overflow: ellipsis; overflow: hidden;} + +.ui-selectmenu { position: absolute; padding: 0; z-index: 100 !important; width: 80%; max-width: 350px; padding: 6px; } +.ui-selectmenu .ui-listview { margin: 0; } +.ui-selectmenu .ui-btn.ui-li-divider { cursor: default; } +.ui-selectmenu-hidden { top: -9999px; left: -9999px; } +.ui-selectmenu-screen { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 99; } +.ui-screen-hidden, .ui-selectmenu-list .ui-li .ui-icon { display: none; } +.ui-selectmenu-list .ui-li .ui-icon { display: block; } +.ui-li.ui-selectmenu-placeholder { display: none; } +.ui-selectmenu .ui-header .ui-title { margin: 0.6em 46px 0.8em; } + +@media all and (min-width: 450px){ + label.ui-select { vertical-align: top; display: inline-block; width: 20%; margin: 0 2% 0 0; } + .ui-select { width: 60%; display: inline-block; } +} + +/* when no placeholder is defined in a multiple select, the header height doesn't even extend past the close button. this shim's content in there */ +.ui-selectmenu .ui-header h1:after { content: '.'; visibility: hidden; }/* +* jQuery Mobile Framework +* Copyright (c) jQuery Project +* Dual licensed under the MIT (MIT-LICENSE.txt) or GPL (GPL-LICENSE.txt) licenses. +*/ +label.ui-input-text { font-size: 16px; line-height: 1.4; display: block; font-weight: normal; margin: 0 0 .3em; } +input.ui-input-text, textarea.ui-input-text { background-image: none; padding: .4em; line-height: 1.4; font-size: 16px; display: block; width: 95%; } +input.ui-input-text { -webkit-appearance: none; } +textarea.ui-input-text { height: 50px; -webkit-transition: height 200ms linear; -moz-transition: height 200ms linear; -o-transition: height 200ms linear; transition: height 200ms linear; } +.ui-input-search { padding: 0 30px; width: 77%; background-image: none; position: relative; } +.ui-icon-searchfield:after { position: absolute; left: 7px; top: 50%; margin-top: -9px; content: ""; width: 18px; height: 18px; opacity: .5; } +.ui-input-search input.ui-input-text { border: none; width: 98%; padding: .4em 0; margin: 0; display: block; background: transparent none; outline: 0 !important; } +.ui-input-search .ui-input-clear { position: absolute; right: 0; top: 50%; margin-top: -14px; } +.ui-input-search .ui-input-clear-hidden { display: none; } + +/* orientation adjustments - incomplete!*/ +@media all and (min-width: 450px){ + label.ui-input-text { vertical-align: top; display: inline-block; width: 20%; margin: 0 2% 0 0 } + input.ui-input-text, + textarea.ui-input-text, + .ui-input-search { width: 60%; display: inline-block; } + .ui-input-search { width: 50%; } + .ui-input-search input.ui-input-text { width: 98%; /*echos rule from above*/ } +}/* +* jQuery Mobile Framework +* Copyright (c) jQuery Project +* Dual licensed under the MIT (MIT-LICENSE.txt) or GPL (GPL-LICENSE.txt) licenses. +*/ +.ui-listview { margin: 0; counter-reset: listnumbering; } +.ui-content .ui-listview { margin: -15px; } +.ui-content .ui-listview-inset { margin: 1em 0; } +.ui-listview, .ui-li { list-style:none; padding:0; } +.ui-li, .ui-li.ui-field-contain { display: block; margin:0; position: relative; overflow: visible; text-align: left; border-width: 0; border-top-width: 1px; } +.ui-li .ui-btn-text { position: relative; z-index: 1; } +.ui-li .ui-btn-text a.ui-link-inherit { text-overflow: ellipsis; overflow: hidden; white-space: nowrap; } +.ui-li-divider, .ui-li-static { padding: .5em 15px; font-size: 14px; font-weight: bold; } +.ui-li-divider { counter-reset: listnumbering; } +ol.ui-listview .ui-link-inherit:before, ol.ui-listview .ui-li-static:before, .ui-li-dec { font-size: .8em; display: inline-block; padding-right: .3em; font-weight: normal;counter-increment: listnumbering; content: counter(listnumbering) ". "; } +ol.ui-listview .ui-li-jsnumbering:before { content: "" !important; } /* to avoid chance of duplication */ +.ui-listview-inset .ui-li { border-right-width: 1px; border-left-width: 1px; } +.ui-li:last-child, .ui-li.ui-field-contain:last-child { border-bottom-width: 1px; } +.ui-li>.ui-btn-inner { display: block; position: relative; padding: 0; } +.ui-li .ui-btn-inner a.ui-link-inherit, .ui-li-static.ui-li { padding: .7em 15px .7em 15px; display: block; } +.ui-li-has-thumb .ui-btn-inner a.ui-link-inherit, .ui-li-static.ui-li-has-thumb { min-height: 60px; padding-left: 100px; } +.ui-li-has-icon .ui-btn-inner a.ui-link-inherit, .ui-li-static.ui-li-has-icon { min-height: 20px; padding-left: 40px; } +.ui-li-has-count .ui-btn-inner a.ui-link-inherit, .ui-li-static.ui-li-has-count { padding-right: 45px; } +.ui-li-has-arrow .ui-btn-inner a.ui-link-inherit, .ui-li-static.ui-li-has-arrow { padding-right: 30px; } +.ui-li-has-arrow.ui-li-has-count .ui-btn-inner a.ui-link-inherit, .ui-li-static.ui-li-has-arrow.ui-li-has-count { padding-right: 75px; } +.ui-li-heading { font-size: 16px; font-weight: bold; display: block; margin: .6em 0; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; } +.ui-li-desc { font-size: 12px; font-weight: normal; display: block; margin: -.5em 0 .6em; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; } +.ui-li-thumb, .ui-li-icon { position: absolute; left: 1px; top: 0; max-height: 80px; max-width: 80px; } +.ui-li-icon { max-height: 40px; max-width: 40px; left: 10px; top: .9em; } +.ui-li-thumb, .ui-li-icon, .ui-li-content { float: left; margin-right: 10px; } + +.ui-li-aside { float: right; width: 50%; text-align: right; margin: .3em 0; } +@media all and (min-width: 480px){ + .ui-li-aside { width: 45%; } +} +.ui-li-divider { cursor: default; } +.ui-li-has-alt .ui-btn-inner a.ui-link-inherit, .ui-li-static.ui-li-has-alt { padding-right: 95px; } +.ui-li-has-count .ui-li-count { position: absolute; font-size: 11px; font-weight: bold; padding: .2em .5em; top: 50%; margin-top: -.9em; right: 38px; } +.ui-li-divider .ui-li-count, .ui-li-static .ui-li-count { right: 10px; } +.ui-li-has-alt .ui-li-count { right: 55px; } +.ui-li-link-alt { position: absolute; width: 40px; height: 100%; border-width: 0; border-left-width: 1px; top: 0; right: 0; margin: 0; padding: 0; z-index: 2; } +.ui-li-link-alt .ui-btn { overflow: hidden; position: absolute; right: 8px; top: 50%; margin: -11px 0 0 0; border-bottom-width: 1px; z-index: -1;} +.ui-li-link-alt .ui-btn-inner { padding: 0; height: 100%; position: absolute; width: 100%; top: 0; left: 0;} +.ui-li-link-alt .ui-btn .ui-icon { right: 50%; margin-right: -9px; } + +.ui-listview * .ui-btn-inner > .ui-btn > .ui-btn-inner { border-top: 0px; } + +.ui-listview-filter { border-width: 0; overflow: hidden; margin: -15px -15px 15px -15px } +.ui-listview-filter .ui-input-search { margin: 5px; width: auto; display: block; } + +.ui-listview-filter-inset { margin: -15px -5px -15px -5px; background: transparent; } +.ui-li.ui-screen-hidden{display:none;} +/* Odd iPad positioning issue. */ +@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) { + .ui-li .ui-btn-text { overflow: visible; } +}/* +* jQuery Mobile Framework +* Copyright (c) jQuery Project +* Dual licensed under the MIT (MIT-LICENSE.txt) or GPL (GPL-LICENSE.txt) licenses. +*/ +label.ui-slider { display: block; } +input.ui-slider-input { display: inline-block; width: 50px; } +select.ui-slider-switch { display: none; } +div.ui-slider { position: relative; display: inline-block; overflow: visible; height: 15px; padding: 0; margin: 0 2% 0 20px; top: 4px; width: 66%; } +a.ui-slider-handle { position: absolute; z-index: 10; top: 50%; width: 28px; height: 28px; margin-top: -15px; margin-left: -15px; } +a.ui-slider-handle .ui-btn-inner { padding-left: 0; padding-right: 0; } +@media all and (min-width: 480px){ + label.ui-slider { vertical-align: top; display: inline-block; width: 20%; margin: 0 2% 0 0; } + div.ui-slider { width: 45%; } +} + +div.ui-slider-switch { height: 32px; overflow: hidden; margin-left: 0; } +div.ui-slider-inneroffset { margin-left: 50%; position: absolute; top: 1px; height: 100%; width: 50%; } +a.ui-slider-handle-snapping { -webkit-transition: left 100ms linear; } +div.ui-slider-labelbg { position: absolute; top:0; margin: 0; border-width: 0; } +div.ui-slider-switch div.ui-slider-labelbg-a { width: 60%; height: 100%; left: 0; } +div.ui-slider-switch div.ui-slider-labelbg-b { width: 60%; height: 100%; right: 0; } +.ui-slider-switch-a div.ui-slider-labelbg-a, .ui-slider-switch-b div.ui-slider-labelbg-b { z-index: -1; } +.ui-slider-switch-a div.ui-slider-labelbg-b, .ui-slider-switch-b div.ui-slider-labelbg-a { z-index: 0; } + +div.ui-slider-switch a.ui-slider-handle { z-index: 20; width: 101%; height: 32px; margin-top: -18px; margin-left: -101%; } +span.ui-slider-label { width: 100%; position: absolute;height: 32px; font-size: 16px; text-align: center; line-height: 2; background: none; border-color: transparent; } +span.ui-slider-label-a { left: -100%; margin-right: -1px } +span.ui-slider-label-b { right: -100%; margin-left: -1px } diff --git a/libs/css/jquery.mobile-1.0rc1.min.css b/libs/css/jquery.mobile-1.0rc1.min.css new file mode 100644 index 0000000..40d4b8f --- /dev/null +++ b/libs/css/jquery.mobile-1.0rc1.min.css @@ -0,0 +1,12 @@ +/*! + * jQuery Mobile v1.0rc1 + * http://jquerymobile.com/ + * + * Copyright 2010, jQuery Project + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + *//*! +* jQuery Mobile Framework +* Copyright (c) jQuery Project +* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. +*/.ui-bar-a{border:1px solid #2a2a2a;background:#111;color:#fff;font-weight:bold;text-shadow:0 -1px 1px #000;background-image:-webkit-gradient(linear,left top,left bottom,from(#3c3c3c),to(#111));background-image:-webkit-linear-gradient(top,#3c3c3c,#111);background-image:-moz-linear-gradient(top,#3c3c3c,#111);background-image:-ms-linear-gradient(top,#3c3c3c,#111);background-image:-o-linear-gradient(top,#3c3c3c,#111);background-image:linear-gradient(top,#3c3c3c,#111)}.ui-bar-a,.ui-bar-a input,.ui-bar-a select,.ui-bar-a textarea,.ui-bar-a button{font-family:Helvetica,Arial,sans-serif}.ui-bar-a .ui-link-inherit{color:#fff}.ui-bar-a .ui-link{color:#7cc4e7;font-weight:bold}.ui-body-a{border:1px solid #2a2a2a;background:#222;color:#fff;text-shadow:0 1px 0 #000;font-weight:normal;background-image:-webkit-gradient(linear,left top,left bottom,from(#666),to(#222));background-image:-webkit-linear-gradient(top,#666,#222);background-image:-moz-linear-gradient(top,#666,#222);background-image:-ms-linear-gradient(top,#666,#222);background-image:-o-linear-gradient(top,#666,#222);background-image:linear-gradient(top,#666,#222)}.ui-body-a,.ui-body-a input,.ui-body-a select,.ui-body-a textarea,.ui-body-a button{font-family:Helvetica,Arial,sans-serif}.ui-body-a .ui-link-inherit{color:#fff}.ui-body-a .ui-link{color:#2489ce;font-weight:bold}.ui-br{border-bottom:#828282;border-bottom:rgba(130,130,130,.3);border-bottom-width:1px;border-bottom-style:solid}.ui-btn-up-a{border:1px solid #222;background:#333;font-weight:bold;color:#fff;text-shadow:0 -1px 1px #000;background-image:-webkit-gradient(linear,left top,left bottom,from(#555),to(#333));background-image:-webkit-linear-gradient(top,#555,#333);background-image:-moz-linear-gradient(top,#555,#333);background-image:-ms-linear-gradient(top,#555,#333);background-image:-o-linear-gradient(top,#555,#333);background-image:linear-gradient(top,#555,#333)}.ui-btn-up-a a.ui-link-inherit{color:#fff}.ui-btn-hover-a{border:1px solid #000;background:#444;font-weight:bold;color:#fff;text-shadow:0 -1px 1px #000;background-image:-webkit-gradient(linear,left top,left bottom,from(#666),to(#444));background-image:-webkit-linear-gradient(top,#666,#444);background-image:-moz-linear-gradient(top,#666,#444);background-image:-ms-linear-gradient(top,#666,#444);background-image:-o-linear-gradient(top,#666,#444);background-image:linear-gradient(top,#666,#444)}.ui-btn-hover-a a.ui-link-inherit{color:#fff}.ui-btn-down-a{border:1px solid #000;background:#3d3d3d;font-weight:bold;color:#fff;text-shadow:0 -1px 1px #000;background-image:-webkit-gradient(linear,left top,left bottom,from(#333),to(#5a5a5a));background-image:-webkit-linear-gradient(top,#333,#5a5a5a);background-image:-moz-linear-gradient(top,#333,#5a5a5a);background-image:-ms-linear-gradient(top,#333,#5a5a5a);background-image:-o-linear-gradient(top,#333,#5a5a5a);background-image:linear-gradient(top,#333,#5a5a5a)}.ui-btn-down-a a.ui-link-inherit{color:#fff}.ui-btn-up-a,.ui-btn-hover-a,.ui-btn-down-a{font-family:Helvetica,Arial,sans-serif;text-decoration:none}.ui-bar-b{border:1px solid #456f9a;background:#5e87b0;color:#fff;font-weight:bold;text-shadow:0 -1px 1px #254f7a;background-image:-webkit-gradient(linear,left top,left bottom,from(#81a8ce),to(#5e87b0));background-image:-webkit-linear-gradient(top,#81a8ce,#5e87b0);background-image:-moz-linear-gradient(top,#81a8ce,#5e87b0);background-image:-ms-linear-gradient(top,#81a8ce,#5e87b0);background-image:-o-linear-gradient(top,#81a8ce,#5e87b0);background-image:linear-gradient(top,#81a8ce,#5e87b0)}.ui-bar-b,.ui-bar-b input,.ui-bar-b select,.ui-bar-b textarea,.ui-bar-b button{font-family:Helvetica,Arial,sans-serif}.ui-bar-b .ui-link-inherit{color:#fff}.ui-bar-b .ui-link{color:#7cc4e7;font-weight:bold}.ui-body-b{border:1px solid #c6c6c6;background:#ccc;color:#333;text-shadow:0 1px 0 #fff;font-weight:normal;background-image:-webkit-gradient(linear,left top,left bottom,from(#e6e6e6),to(#ccc));background-image:-webkit-linear-gradient(top,#e6e6e6,#ccc);background-image:-moz-linear-gradient(top,#e6e6e6,#ccc);background-image:-ms-linear-gradient(top,#e6e6e6,#ccc);background-image:-o-linear-gradient(top,#e6e6e6,#ccc);background-image:linear-gradient(top,#e6e6e6,#ccc)}.ui-body-b,.ui-body-b input,.ui-body-b select,.ui-body-b textarea,.ui-body-b button{font-family:Helvetica,Arial,sans-serif}.ui-body-b .ui-link-inherit{color:#333}.ui-body-b .ui-link{color:#2489ce;font-weight:bold}.ui-btn-up-b{border:1px solid #145072;background:#2567ab;font-weight:bold;color:#fff;text-shadow:0 -1px 1px #145072;background-image:-webkit-gradient(linear,left top,left bottom,from(#5f9cc5),to(#396b9e));background-image:-webkit-linear-gradient(top,#5f9cc5,#396b9e);background-image:-moz-linear-gradient(top,#5f9cc5,#396b9e);background-image:-ms-linear-gradient(top,#5f9cc5,#396b9e);background-image:-o-linear-gradient(top,#5f9cc5,#396b9e);background-image:linear-gradient(top,#5f9cc5,#396b9e)}.ui-btn-up-b a.ui-link-inherit{color:#fff}.ui-btn-hover-b{border:1px solid #00516e;background:#4b88b6;font-weight:bold;color:#fff;text-shadow:0 -1px 1px #014d68;background-image:-webkit-gradient(linear,left top,left bottom,from(#72b0d4),to(#4b88b6));background-image:-webkit-linear-gradient(top,#72b0d4,#4b88b6);background-image:-moz-linear-gradient(top,#72b0d4,#4b88b6);background-image:-ms-linear-gradient(top,#72b0d4,#4b88b6);background-image:-o-linear-gradient(top,#72b0d4,#4b88b6);background-image:linear-gradient(top,#72b0d4,#4b88b6)}.ui-btn-hover-b a.ui-link-inherit{color:#fff}.ui-btn-down-b{border:1px solid #225377;background:#4e89c5;font-weight:bold;color:#fff;text-shadow:0 -1px 1px #225377;background-image:-webkit-gradient(linear,left top,left bottom,from(#396b9e),to(#4e89c5));background-image:-webkit-linear-gradient(top,#396b9e,#4e89c5);background-image:-moz-linear-gradient(top,#396b9e,#4e89c5);background-image:-ms-linear-gradient(top,#396b9e,#4e89c5);background-image:-o-linear-gradient(top,#396b9e,#4e89c5);background-image:linear-gradient(top,#396b9e,#4e89c5)}.ui-btn-down-b a.ui-link-inherit{color:#fff}.ui-btn-up-b,.ui-btn-hover-b,.ui-btn-down-b{font-family:Helvetica,Arial,sans-serif;text-decoration:none}.ui-bar-c{border:1px solid #b3b3b3;background:#e9eaeb;color:#3e3e3e;font-weight:bold;text-shadow:0 1px 1px #fff;background-image:-webkit-gradient(linear,left top,left bottom,from(#f0f0f0),to(#e9eaeb));background-image:-webkit-linear-gradient(top,#f0f0f0,#e9eaeb);background-image:-moz-linear-gradient(top,#f0f0f0,#e9eaeb);background-image:-ms-linear-gradient(top,#f0f0f0,#e9eaeb);background-image:-o-linear-gradient(top,#f0f0f0,#e9eaeb);background-image:linear-gradient(top,#f0f0f0,#e9eaeb)}.ui-bar-c .ui-link{color:#2489ce;font-weight:bold}.ui-bar-c,.ui-bar-c input,.ui-bar-c select,.ui-bar-c textarea,.ui-bar-c button{font-family:Helvetica,Arial,sans-serif}.ui-body-c{border:1px solid #b3b3b3;color:#333;text-shadow:0 1px 0 #fff;background:#f0f0f0;background-image:-webkit-gradient(linear,left top,left bottom,from(#eee),to(#ddd));background-image:-webkit-linear-gradient(top,#eee,#ddd);background-image:-moz-linear-gradient(top,#eee,#ddd);background-image:-ms-linear-gradient(top,#eee,#ddd);background-image:-o-linear-gradient(top,#eee,#ddd);background-image:linear-gradient(top,#eee,#ddd)}.ui-body-c,.ui-body-c input,.ui-body-c select,.ui-body-c textarea,.ui-body-c button{font-family:Helvetica,Arial,sans-serif}.ui-body-c .ui-link-inherit{color:#333}.ui-body-c .ui-link{color:#2489ce;font-weight:bold}.ui-btn-up-c{border:1px solid #ccc;background:#eee;font-weight:bold;color:#444;text-shadow:0 1px 1px #f6f6f6;background-image:-webkit-gradient(linear,left top,left bottom,from(#fdfdfd),to(#eee));background-image:-webkit-linear-gradient(top,#fdfdfd,#eee);background-image:-moz-linear-gradient(top,#fdfdfd,#eee);background-image:-ms-linear-gradient(top,#fdfdfd,#eee);background-image:-o-linear-gradient(top,#fdfdfd,#eee);background-image:linear-gradient(top,#fdfdfd,#eee)}.ui-btn-up-c a.ui-link-inherit{color:#2f3e46}.ui-btn-hover-c{border:1px solid #bbb;background:#dadada;font-weight:bold;color:#101010;text-shadow:0 1px 1px #fff;background-image:-webkit-gradient(linear,left top,left bottom,from(#ededed),to(#dadada));background-image:-webkit-linear-gradient(top,#ededed,#dadada);background-image:-moz-linear-gradient(top,#ededed,#dadada);background-image:-ms-linear-gradient(top,#ededed,#dadada);background-image:-o-linear-gradient(top,#ededed,#dadada);background-image:linear-gradient(top,#ededed,#dadada)}.ui-btn-hover-c a.ui-link-inherit{color:#2f3e46}.ui-btn-down-c{border:1px solid #808080;background:#fdfdfd;font-weight:bold;color:#111;text-shadow:0 1px 1px #fff;background-image:-webkit-gradient(linear,left top,left bottom,from(#eee),to(#fdfdfd));background-image:-webkit-linear-gradient(top,#eee,#fdfdfd);background-image:-moz-linear-gradient(top,#eee,#fdfdfd);background-image:-ms-linear-gradient(top,#eee,#fdfdfd);background-image:-o-linear-gradient(top,#eee,#fdfdfd);background-image:linear-gradient(top,#eee,#fdfdfd)}.ui-btn-down-c a.ui-link-inherit{color:#2f3e46}.ui-btn-up-c,.ui-btn-hover-c,.ui-btn-down-c{font-family:Helvetica,Arial,sans-serif;text-decoration:none}.ui-bar-d{border:1px solid #ccc;background:#bbb;color:#333;text-shadow:0 1px 0 #eee;background-image:-webkit-gradient(linear,left top,left bottom,from(#ddd),to(#bbb));background-image:-webkit-linear-gradient(top,#ddd,#bbb);background-image:-moz-linear-gradient(top,#ddd,#bbb);background-image:-ms-linear-gradient(top,#ddd,#bbb);background-image:-o-linear-gradient(top,#ddd,#bbb);background-image:linear-gradient(top,#ddd,#bbb)}.ui-bar-d,.ui-bar-d input,.ui-bar-d select,.ui-bar-d textarea,.ui-bar-d button{font-family:Helvetica,Arial,sans-serif}.ui-bar-d .ui-link-inherit{color:#333}.ui-bar-d .ui-link{color:#2489ce;font-weight:bold}.ui-body-d{border:1px solid #ccc;color:#333;text-shadow:0 1px 0 #fff;background:#fff;background-image:-webkit-gradient(linear,left top,left bottom,from(#fff),to(#fff));background-image:-webkit-linear-gradient(top,#fff,#fff);background-image:-moz-linear-gradient(top,#fff,#fff);background-image:-ms-linear-gradient(top,#fff,#fff);background-image:-o-linear-gradient(top,#fff,#fff);background-image:linear-gradient(top,#fff,#fff)}.ui-body-d,.ui-body-d input,.ui-body-d select,.ui-body-d textarea,.ui-body-d button{font-family:Helvetica,Arial,sans-serif}.ui-body-d .ui-link-inherit{color:#333}.ui-body-d .ui-link{color:#2489ce;font-weight:bold}.ui-btn-up-d{border:1px solid #ccc;background:#fff;font-weight:bold;color:#444;text-shadow:0 1px 1px #fff;background-image:-webkit-gradient(linear,left top,left bottom,from(#fff),to(#fff));background-image:-webkit-linear-gradient(top,#fff,#fff);background-image:-moz-linear-gradient(top,#fff,#fff);background-image:-ms-linear-gradient(top,#fff,#fff);background-image:-o-linear-gradient(top,#fff,#fff);background-image:linear-gradient(top,#fff,#fff)}.ui-btn-up-d a.ui-link-inherit{color:#333}.ui-btn-hover-d{border:1px solid #aaa;background:#eee;font-weight:bold;color:#222;cursor:pointer;text-shadow:0 1px 1px #fff;background-image:-webkit-gradient(linear,left top,left bottom,from(#fdfdfd),to(#eee));background-image:-webkit-linear-gradient(top,#fdfdfd,#eee);background-image:-moz-linear-gradient(top,#fdfdfd,#eee);background-image:-ms-linear-gradient(top,#fdfdfd,#eee);background-image:-o-linear-gradient(top,#fdfdfd,#eee);background-image:linear-gradient(top,#fdfdfd,#eee)}.ui-btn-hover-d a.ui-link-inherit{color:#222}.ui-btn-down-d{border:1px solid #aaa;background:#fff;font-weight:bold;color:#111;text-shadow:0 1px 1px #fff;background-image:-webkit-gradient(linear,left top,left bottom,from(#eee),to(#fff));background-image:-webkit-linear-gradient(top,#eee,#fff);background-image:-moz-linear-gradient(top,#eee,#fff);background-image:-ms-linear-gradient(top,#eee,#fff);background-image:-o-linear-gradient(top,#eee,#fff);background-image:linear-gradient(top,#eee,#fff)}.ui-btn-down-d a.ui-link-inherit{color:#111}.ui-btn-up-d,.ui-btn-hover-d,.ui-btn-down-d{font-family:Helvetica,Arial,sans-serif;text-decoration:none}.ui-bar-e{border:1px solid #f7c942;background:#fadb4e;color:#333;text-shadow:0 1px 0 #fff;background-image:-webkit-gradient(linear,left top,left bottom,from(#fceda7),to(#fadb4e));background-image:-webkit-linear-gradient(top,#fceda7,#fadb4e);background-image:-moz-linear-gradient(top,#fceda7,#fadb4e);background-image:-ms-linear-gradient(top,#fceda7,#fadb4e);background-image:-o-linear-gradient(top,#fceda7,#fadb4e);background-image:linear-gradient(top,#fceda7,#fadb4e)}.ui-bar-e,.ui-bar-e input,.ui-bar-e select,.ui-bar-e textarea,.ui-bar-e button{font-family:Helvetica,Arial,sans-serif}.ui-bar-e .ui-link-inherit{color:#333}.ui-bar-e .ui-link{color:#2489ce;font-weight:bold}.ui-body-e{border:1px solid #f7c942;color:#333;text-shadow:0 1px 0 #fff;background:#faeb9e;background-image:-webkit-gradient(linear,left top,left bottom,from(#fff),to(#faeb9e));background-image:-webkit-linear-gradient(top,#fff,#faeb9e);background-image:-moz-linear-gradient(top,#fff,#faeb9e);background-image:-ms-linear-gradient(top,#fff,#faeb9e);background-image:-o-linear-gradient(top,#fff,#faeb9e);background-image:linear-gradient(top,#fff,#faeb9e)}.ui-body-e,.ui-body-e input,.ui-body-e select,.ui-body-e textarea,.ui-body-e button{font-family:Helvetica,Arial,sans-serif}.ui-body-e .ui-link-inherit{color:#333}.ui-body-e .ui-link{color:#2489ce;font-weight:bold}.ui-btn-up-e{border:1px solid #f7c942;background:#fadb4e;font-weight:bold;color:#333;text-shadow:0 1px 0 #fff;background-image:-webkit-gradient(linear,left top,left bottom,from(#fceda7),to(#fadb4e));background-image:-webkit-linear-gradient(top,#fceda7,#fadb4e);background-image:-moz-linear-gradient(top,#fceda7,#fadb4e);background-image:-ms-linear-gradient(top,#fceda7,#fadb4e);background-image:-o-linear-gradient(top,#fceda7,#fadb4e);background-image:linear-gradient(top,#fceda7,#fadb4e)}.ui-btn-up-e a.ui-link-inherit{color:#333}.ui-btn-hover-e{border:1px solid #e79952;background:#fbe26f;font-weight:bold;color:#111;text-shadow:0 1px 1px #fff;background-image:-webkit-gradient(linear,left top,left bottom,from(#fcf0b5),to(#fbe26f));background-image:-webkit-linear-gradient(top,#fcf0b5,#fbe26f);background-image:-moz-linear-gradient(top,#fcf0b5,#fbe26f);background-image:-ms-linear-gradient(top,#fcf0b5,#fbe26f);background-image:-o-linear-gradient(top,#fcf0b5,#fbe26f);background-image:linear-gradient(top,#fcf0b5,#fbe26f)}.ui-btn-hover-e a.ui-link-inherit{color:#333}.ui-btn-down-e{border:1px solid #f7c942;background:#fceda7;font-weight:bold;color:#111;text-shadow:0 1px 1px #fff;background-image:-webkit-gradient(linear,left top,left bottom,from(#fadb4e),to(#fceda7));background-image:-webkit-linear-gradient(top,#fadb4e,#fceda7);background-image:-moz-linear-gradient(top,#fadb4e,#fceda7);background-image:-ms-linear-gradient(top,#fadb4e,#fceda7);background-image:-o-linear-gradient(top,#fadb4e,#fceda7);background-image:linear-gradient(top,#fadb4e,#fceda7)}.ui-btn-down-e a.ui-link-inherit{color:#333}.ui-btn-up-e,.ui-btn-hover-e,.ui-btn-down-e{font-family:Helvetica,Arial,sans-serif;text-decoration:none}a.ui-link-inherit{text-decoration:none!important}.ui-link{color:#2489ce}.ui-link:hover{color:#2489ce}.ui-link:active{color:#2489ce}.ui-link:visited{color:#2489ce}.ui-btn-active{border:1px solid #155678;background:#4596ce;font-weight:bold;color:#fff;cursor:pointer;text-shadow:0 -1px 1px #145072;text-decoration:none;background-image:-webkit-gradient(linear,left top,left bottom,from(#85bae4),to(#5393c5));background-image:-webkit-linear-gradient(top,#85bae4,#5393c5);background-image:-moz-linear-gradient(top,#85bae4,#5393c5);background-image:-ms-linear-gradient(top,#85bae4,#5393c5);background-image:-o-linear-gradient(top,#85bae4,#5393c5);background-image:linear-gradient(top,#85bae4,#5393c5);outline:0;font-family:Helvetica,Arial,sans-serif}.ui-btn-active a.ui-link-inherit{color:#fff}.ui-btn-inner{border-top:1px solid #fff;border-color:rgba(255,255,255,.3)}.ui-corner-tl{-moz-border-radius-topleft:.6em;-webkit-border-top-left-radius:.6em;border-top-left-radius:.6em}.ui-corner-tr{-moz-border-radius-topright:.6em;-webkit-border-top-right-radius:.6em;border-top-right-radius:.6em}.ui-corner-bl{-moz-border-radius-bottomleft:.6em;-webkit-border-bottom-left-radius:.6em;border-bottom-left-radius:.6em}.ui-corner-br{-moz-border-radius-bottomright:.6em;-webkit-border-bottom-right-radius:.6em;border-bottom-right-radius:.6em}.ui-corner-top{-moz-border-radius-topleft:.6em;-webkit-border-top-left-radius:.6em;border-top-left-radius:.6em;-moz-border-radius-topright:.6em;-webkit-border-top-right-radius:.6em;border-top-right-radius:.6em}.ui-corner-bottom{-moz-border-radius-bottomleft:.6em;-webkit-border-bottom-left-radius:.6em;border-bottom-left-radius:.6em;-moz-border-radius-bottomright:.6em;-webkit-border-bottom-right-radius:.6em;border-bottom-right-radius:.6em}.ui-corner-right{-moz-border-radius-topright:.6em;-webkit-border-top-right-radius:.6em;border-top-right-radius:.6em;-moz-border-radius-bottomright:.6em;-webkit-border-bottom-right-radius:.6em;border-bottom-right-radius:.6em}.ui-corner-left{-moz-border-radius-topleft:.6em;-webkit-border-top-left-radius:.6em;border-top-left-radius:.6em;-moz-border-radius-bottomleft:.6em;-webkit-border-bottom-left-radius:.6em;border-bottom-left-radius:.6em}.ui-corner-all{-moz-border-radius:.6em;-webkit-border-radius:.6em;border-radius:.6em}.ui-corner-none{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.ui-disabled{opacity:.3}.ui-disabled,.ui-disabled a{cursor:default}.ui-icon,.ui-icon-searchfield:after{background:#666;background:rgba(0,0,0,.4);background-image:url(images/icons-18-white.png);background-repeat:no-repeat;-moz-border-radius:9px;-webkit-border-radius:9px;border-radius:9px}.ui-icon-alt{background:#fff;background:rgba(255,255,255,.3);background-image:url(images/icons-18-black.png);background-repeat:no-repeat}@media only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (min--moz-device-pixel-ratio:1.5),only screen and (min-resolution:240dpi){.ui-icon-plus,.ui-icon-minus,.ui-icon-delete,.ui-icon-arrow-r,.ui-icon-arrow-l,.ui-icon-arrow-u,.ui-icon-arrow-d,.ui-icon-check,.ui-icon-gear,.ui-icon-refresh,.ui-icon-forward,.ui-icon-back,.ui-icon-grid,.ui-icon-star,.ui-icon-alert,.ui-icon-info,.ui-icon-home,.ui-icon-search,.ui-icon-searchfield:after,.ui-icon-checkbox-off,.ui-icon-checkbox-on,.ui-icon-radio-off,.ui-icon-radio-on{background-image:url(images/icons-36-white.png);-moz-background-size:776px 18px;-o-background-size:776px 18px;-webkit-background-size:776px 18px;background-size:776px 18px}.ui-icon-alt{background-image:url(images/icons-36-black.png)}}.ui-icon-plus{background-position:-0 50%}.ui-icon-minus{background-position:-36px 50%}.ui-icon-delete{background-position:-72px 50%}.ui-icon-arrow-r{background-position:-108px 50%}.ui-icon-arrow-l{background-position:-144px 50%}.ui-icon-arrow-u{background-position:-180px 50%}.ui-icon-arrow-d{background-position:-216px 50%}.ui-icon-check{background-position:-252px 50%}.ui-icon-gear{background-position:-288px 50%}.ui-icon-refresh{background-position:-324px 50%}.ui-icon-forward{background-position:-360px 50%}.ui-icon-back{background-position:-396px 50%}.ui-icon-grid{background-position:-432px 50%}.ui-icon-star{background-position:-468px 50%}.ui-icon-alert{background-position:-504px 50%}.ui-icon-info{background-position:-540px 50%}.ui-icon-home{background-position:-576px 50%}.ui-icon-search,.ui-icon-searchfield:after{background-position:-612px 50%}.ui-icon-checkbox-off{background-position:-684px 50%}.ui-icon-checkbox-on{background-position:-648px 50%}.ui-icon-radio-off{background-position:-756px 50%}.ui-icon-radio-on{background-position:-720px 50%}.ui-checkbox .ui-icon{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px}.ui-icon-checkbox-off,.ui-icon-radio-off{background-color:transparent}.ui-checkbox-on .ui-icon,.ui-radio-on .ui-icon{background-color:#4596ce}.ui-icon-loading{background-image:url(images/ajax-loader.png);width:40px;height:40px;-moz-border-radius:20px;-webkit-border-radius:20px;border-radius:20px;background-size:35px 35px}.ui-btn-corner-tl{-moz-border-radius-topleft:1em;-webkit-border-top-left-radius:1em;border-top-left-radius:1em}.ui-btn-corner-tr{-moz-border-radius-topright:1em;-webkit-border-top-right-radius:1em;border-top-right-radius:1em}.ui-btn-corner-bl{-moz-border-radius-bottomleft:1em;-webkit-border-bottom-left-radius:1em;border-bottom-left-radius:1em}.ui-btn-corner-br{-moz-border-radius-bottomright:1em;-webkit-border-bottom-right-radius:1em;border-bottom-right-radius:1em}.ui-btn-corner-top{-moz-border-radius-topleft:1em;-webkit-border-top-left-radius:1em;border-top-left-radius:1em;-moz-border-radius-topright:1em;-webkit-border-top-right-radius:1em;border-top-right-radius:1em}.ui-btn-corner-bottom{-moz-border-radius-bottomleft:1em;-webkit-border-bottom-left-radius:1em;border-bottom-left-radius:1em;-moz-border-radius-bottomright:1em;-webkit-border-bottom-right-radius:1em;border-bottom-right-radius:1em}.ui-btn-corner-right{-moz-border-radius-topright:1em;-webkit-border-top-right-radius:1em;border-top-right-radius:1em;-moz-border-radius-bottomright:1em;-webkit-border-bottom-right-radius:1em;border-bottom-right-radius:1em}.ui-btn-corner-left{-moz-border-radius-topleft:1em;-webkit-border-top-left-radius:1em;border-top-left-radius:1em;-moz-border-radius-bottomleft:1em;-webkit-border-bottom-left-radius:1em;border-bottom-left-radius:1em}.ui-btn-corner-all{-moz-border-radius:1em;-webkit-border-radius:1em;border-radius:1em}.ui-corner-tl,.ui-corner-tr,.ui-corner-bl,.ui-corner-br,.ui-corner-top,.ui-corner-bottom,.ui-corner-right,.ui-corner-left,.ui-corner-all,.ui-btn-corner-tl,.ui-btn-corner-tr,.ui-btn-corner-bl,.ui-btn-corner-br,.ui-btn-corner-top,.ui-btn-corner-bottom,.ui-btn-corner-right,.ui-btn-corner-left,.ui-btn-corner-all{-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}.ui-overlay{background:#666;opacity:.5;filter:Alpha(Opacity=50);position:absolute;width:100%;height:100%}.ui-overlay-shadow{-moz-box-shadow:0 0 12px rgba(0,0,0,.6);-webkit-box-shadow:0 0 12px rgba(0,0,0,.6);box-shadow:0 0 12px rgba(0,0,0,.6)}.ui-shadow{-moz-box-shadow:0 1px 4px rgba(0,0,0,.3);-webkit-box-shadow:0 1px 4px rgba(0,0,0,.3);box-shadow:0 1px 4px rgba(0,0,0,.3)}.ui-bar-a .ui-shadow,.ui-bar-b .ui-shadow,.ui-bar-c .ui-shadow{-moz-box-shadow:0 1px 0 rgba(255,255,255,.3);-webkit-box-shadow:0 1px 0 rgba(255,255,255,.3);box-shadow:0 1px 0 rgba(255,255,255,.3)}.ui-shadow-inset{-moz-box-shadow:inset 0 1px 4px rgba(0,0,0,.2);-webkit-box-shadow:inset 0 1px 4px rgba(0,0,0,.2);box-shadow:inset 0 1px 4px rgba(0,0,0,.2)}.ui-icon-shadow{-moz-box-shadow:0 1px 0 rgba(255,255,255,.4);-webkit-box-shadow:0 1px 0 rgba(255,255,255,.4);box-shadow:0 1px 0 rgba(255,255,255,.4)}.ui-focus{-moz-box-shadow:0 0 12px #387bbe;-webkit-box-shadow:0 0 12px #387bbe;box-shadow:0 0 12px #387bbe}.ui-mobile-nosupport-boxshadow *{-moz-box-shadow:none!important;-webkit-box-shadow:none!important;box-shadow:none!important}.ui-mobile-nosupport-boxshadow .ui-focus{outline-width:2px}.ui-mobile,.ui-mobile body{height:100%}.ui-mobile fieldset,.ui-page{padding:0;margin:0}.ui-mobile a img,.ui-mobile fieldset{border:0}.ui-mobile-viewport{margin:0;overflow-x:hidden;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.ui-mobile [data-role=page],.ui-mobile [data-role=dialog],.ui-page{top:0;left:0;width:100%;min-height:100%;position:absolute;display:none;border:0}.ui-mobile .ui-page-active{display:block;overflow:visible}.ui-page{outline:0}.ui-page.ui-mobile-touch-overflow,.ui-mobile-touch-overflow.ui-native-fixed .ui-content{overflow:auto;height:100%;-webkit-overflow-scrolling:touch;-moz-overflow-scrolling:touch;-o-overflow-scrolling:touch;-ms-overflow-scrolling:touch;overflow-scrolling:touch}.ui-page.ui-mobile-touch-overflow,.ui-page.ui-mobile-touch-overflow *{-webkit-transform:rotateY(0)}.ui-page.ui-mobile-pre-transition{display:block}.ui-loading .ui-mobile-viewport{overflow:hidden!important}.ui-loading .ui-loader{display:block}.ui-loading .ui-page{overflow:hidden}.ui-loader{display:none;position:absolute;opacity:.85;z-index:100;left:50%;width:200px;margin-left:-130px;margin-top:-35px;padding:10px 30px}.ui-loader h1{font-size:15px;text-align:center}.ui-loader .ui-icon{position:static;display:block;opacity:.9;margin:0 auto;width:35px;height:35px;background-color:transparent}.ui-mobile-rendering>*{visibility:hidden}.ui-bar,.ui-body{position:relative;padding:.4em 15px;overflow:hidden;display:block;clear:both}.ui-bar{font-size:16px;margin:0}.ui-bar h1,.ui-bar h2,.ui-bar h3,.ui-bar h4,.ui-bar h5,.ui-bar h6{margin:0;padding:0;font-size:16px;display:inline-block}.ui-header,.ui-footer{display:block}.ui-page .ui-header,.ui-page .ui-footer{position:relative}.ui-header .ui-btn-left{position:absolute;left:10px;top:.4em}.ui-header .ui-btn-right{position:absolute;right:10px;top:.4em}.ui-header .ui-title,.ui-footer .ui-title{min-height:1.1em;text-align:center;font-size:16px;display:block;margin:.6em 90px .8em;padding:0;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;outline:0!important}.ui-content{border-width:0;overflow:visible;overflow-x:hidden;padding:15px}.ui-page-fullscreen .ui-content{padding:0}.ui-mobile-touch-overflow.ui-page.ui-native-fixed,.ui-mobile-touch-overflow.ui-page.ui-native-fullscreen{overflow:visible}.ui-mobile-touch-overflow.ui-native-fixed .ui-header,.ui-mobile-touch-overflow.ui-native-fixed .ui-footer{position:fixed;left:0;right:0;top:0;z-index:200}.ui-mobile-touch-overflow.ui-page.ui-native-fixed .ui-footer{top:auto;bottom:0}.ui-mobile-touch-overflow.ui-native-fixed .ui-content{padding-top:2.5em;padding-bottom:3em;top:0;bottom:0;height:auto;position:absolute}.ui-mobile-touch-overflow.ui-native-fullscreen .ui-content{padding-top:0;padding-bottom:0}.ui-mobile-touch-overflow.ui-native-fullscreen .ui-header,.ui-mobile-touch-overflow.ui-native-fullscreen .ui-footer{opacity:.9}.ui-native-bars-hidden{display:none}.ui-icon{width:18px;height:18px}.ui-fullscreen img{max-width:100%}.ui-nojs{position:absolute;left:-9999px}.spin{-webkit-transform:rotate(360deg);-webkit-animation-name:spin;-webkit-animation-duration:1s;-webkit-animation-iteration-count:infinite;-webkit-animation-timing-function:linear}@-webkit-keyframes spin{from{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(360deg)}}.in,.out{-webkit-animation-timing-function:ease-in-out;-webkit-animation-duration:350ms}.slide.out{-webkit-transform:translateX(-100%);-webkit-animation-name:slideouttoleft}.slide.in{-webkit-transform:translateX(0);-webkit-animation-name:slideinfromright}.slide.out.reverse{-webkit-transform:translateX(100%);-webkit-animation-name:slideouttoright}.slide.in.reverse{-webkit-transform:translateX(0);-webkit-animation-name:slideinfromleft}.slideup.out{-webkit-animation-name:dontmove;z-index:0}.slideup.in{-webkit-transform:translateY(0);-webkit-animation-name:slideinfrombottom;z-index:10}.slideup.in.reverse{z-index:0;-webkit-animation-name:dontmove}.slideup.out.reverse{-webkit-transform:translateY(100%);z-index:10;-webkit-animation-name:slideouttobottom}.slidedown.out{-webkit-animation-name:dontmove;z-index:0}.slidedown.in{-webkit-transform:translateY(0);-webkit-animation-name:slideinfromtop;z-index:10}.slidedown.in.reverse{z-index:0;-webkit-animation-name:dontmove}.slidedown.out.reverse{-webkit-transform:translateY(-100%);z-index:10;-webkit-animation-name:slideouttotop}@-webkit-keyframes slideinfromright{from{-webkit-transform:translateX(100%)}to{-webkit-transform:translateX(0)}}@-webkit-keyframes slideinfromleft{from{-webkit-transform:translateX(-100%)}to{-webkit-transform:translateX(0)}}@-webkit-keyframes slideouttoleft{from{-webkit-transform:translateX(0)}to{-webkit-transform:translateX(-100%)}}@-webkit-keyframes slideouttoright{from{-webkit-transform:translateX(0)}to{-webkit-transform:translateX(100%)}}@-webkit-keyframes slideinfromtop{from{-webkit-transform:translateY(-100%)}to{-webkit-transform:translateY(0)}}@-webkit-keyframes slideinfrombottom{from{-webkit-transform:translateY(100%)}to{-webkit-transform:translateY(0)}}@-webkit-keyframes slideouttobottom{from{-webkit-transform:translateY(0)}to{-webkit-transform:translateY(100%)}}@-webkit-keyframes slideouttotop{from{-webkit-transform:translateY(0)}to{-webkit-transform:translateY(-100%)}}@-webkit-keyframes fadein{from{opacity:0}to{opacity:1}}@-webkit-keyframes fadeout{from{opacity:1}to{opacity:0}}.fade.out{z-index:0;-webkit-animation-name:fadeout}.fade.in{opacity:1;z-index:10;-webkit-animation-name:fadein}.viewport-flip{-webkit-perspective:1000;position:absolute}.ui-mobile-viewport-transitioning,.ui-mobile-viewport-transitioning .ui-page{width:100%;height:100%;overflow:hidden}.flip{-webkit-animation-duration:.65s;-webkit-backface-visibility:hidden;-webkit-transform:translateX(0)}.flip.out{-webkit-transform:rotateY(-180deg) scale(.8);-webkit-animation-name:flipouttoleft}.flip.in{-webkit-transform:rotateY(0) scale(1);-webkit-animation-name:flipinfromleft}.flip.out.reverse{-webkit-transform:rotateY(180deg) scale(.8);-webkit-animation-name:flipouttoright}.flip.in.reverse{-webkit-transform:rotateY(0) scale(1);-webkit-animation-name:flipinfromright}@-webkit-keyframes flipinfromright{from{-webkit-transform:rotateY(-180deg) scale(.8)}to{-webkit-transform:rotateY(0) scale(1)}}@-webkit-keyframes flipinfromleft{from{-webkit-transform:rotateY(180deg) scale(.8)}to{-webkit-transform:rotateY(0) scale(1)}}@-webkit-keyframes flipouttoleft{from{-webkit-transform:rotateY(0) scale(1)}to{-webkit-transform:rotateY(-180deg) scale(.8)}}@-webkit-keyframes flipouttoright{from{-webkit-transform:rotateY(0) scale(1)}to{-webkit-transform:rotateY(180deg) scale(.8)}}@-webkit-keyframes dontmove{from{opacity:1}to{opacity:1}}.pop{-webkit-transform-origin:50% 50%}.pop.in{-webkit-transform:scale(1);opacity:1;-webkit-animation-name:popin;z-index:10}.pop.in.reverse{z-index:0;-webkit-animation-name:dontmove}.pop.out.reverse{-webkit-transform:scale(.2);opacity:0;-webkit-animation-name:popout;z-index:10}@-webkit-keyframes popin{from{-webkit-transform:scale(.2);opacity:0}to{-webkit-transform:scale(1);opacity:1}}@-webkit-keyframes popout{from{-webkit-transform:scale(1);opacity:1}to{-webkit-transform:scale(.2);opacity:0}}.ui-grid-a,.ui-grid-b,.ui-grid-c,.ui-grid-d{overflow:hidden}.ui-block-a,.ui-block-b,.ui-block-c,.ui-block-d,.ui-block-e{margin:0;padding:0;border:0;float:left;min-height:1px}.ui-grid-solo .ui-block-a{width:100%;float:none}.ui-grid-a .ui-block-a,.ui-grid-a .ui-block-b{width:50%}.ui-grid-a .ui-block-a{clear:left}.ui-grid-b .ui-block-a,.ui-grid-b .ui-block-b,.ui-grid-b .ui-block-c{width:33.333%}.ui-grid-b .ui-block-a{clear:left}.ui-grid-c .ui-block-a,.ui-grid-c .ui-block-b,.ui-grid-c .ui-block-c,.ui-grid-c .ui-block-d{width:25%}.ui-grid-c .ui-block-a{clear:left}.ui-grid-d .ui-block-a,.ui-grid-d .ui-block-b,.ui-grid-d .ui-block-c,.ui-grid-d .ui-block-d,.ui-grid-d .ui-block-e{width:20%}.ui-grid-d .ui-block-a{clear:left}.ui-header,.ui-footer,.ui-page-fullscreen .ui-header,.ui-page-fullscreen .ui-footer{position:absolute;overflow:hidden;width:100%;border-left-width:0;border-right-width:0}.ui-header-fixed,.ui-footer-fixed{z-index:1000;-webkit-transform:translateZ(0)}.ui-footer-duplicate,.ui-page-fullscreen .ui-fixed-inline{display:none}.ui-page-fullscreen .ui-header,.ui-page-fullscreen .ui-footer{opacity:.9}.ui-navbar{overflow:hidden}.ui-navbar ul,.ui-navbar-expanded ul{list-style:none;padding:0;margin:0;position:relative;display:block;border:0}.ui-navbar-collapsed ul{float:left;width:75%;margin-right:-2px}.ui-navbar-collapsed .ui-navbar-toggle{float:left;width:25%}.ui-navbar li.ui-navbar-truncate{position:absolute;left:-9999px;top:-9999px}.ui-navbar li .ui-btn,.ui-navbar .ui-navbar-toggle .ui-btn{display:block;font-size:12px;text-align:center;margin:0;border-right-width:0}.ui-navbar li .ui-btn{margin-right:-1px}.ui-navbar li .ui-btn:last-child{margin-right:0}.ui-header .ui-navbar li .ui-btn,.ui-header .ui-navbar .ui-navbar-toggle .ui-btn,.ui-footer .ui-navbar li .ui-btn,.ui-footer .ui-navbar .ui-navbar-toggle .ui-btn{border-top-width:0;border-bottom-width:0}.ui-navbar .ui-btn-inner{padding-left:2px;padding-right:2px}.ui-navbar-noicons li .ui-btn .ui-btn-inner,.ui-navbar-noicons .ui-navbar-toggle .ui-btn-inner{padding-top:.8em;padding-bottom:.9em}.ui-navbar-expanded .ui-btn{margin:0;font-size:14px}.ui-navbar-expanded .ui-btn-inner{padding-left:5px;padding-right:5px}.ui-navbar-expanded .ui-btn-icon-top .ui-btn-inner{padding:45px 5px 15px;text-align:center}.ui-navbar-expanded .ui-btn-icon-top .ui-icon{top:15px}.ui-navbar-expanded .ui-btn-icon-bottom .ui-btn-inner{padding:15px 5px 45px;text-align:center}.ui-navbar-expanded .ui-btn-icon-bottom .ui-icon{bottom:15px}.ui-navbar-expanded li .ui-btn .ui-btn-inner{min-height:2.5em}.ui-navbar-expanded .ui-navbar-noicons .ui-btn .ui-btn-inner{padding-top:1.8em;padding-bottom:1.9em}.ui-btn{display:block;text-align:center;cursor:pointer;position:relative;margin:.5em 5px;padding:0}.ui-btn:focus,.ui-btn:active{outline:0}.ui-header .ui-btn,.ui-footer .ui-btn,.ui-bar .ui-btn{display:inline-block;font-size:13px;margin:0}.ui-btn-inline{display:inline-block}.ui-btn-inner{padding:.6em 25px;display:block;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;position:relative;zoom:1}.ui-header .ui-btn-inner,.ui-footer .ui-btn-inner,.ui-bar .ui-btn-inner{padding:.4em 8px .5em}.ui-btn-icon-notext{width:24px;height:24px}.ui-btn-icon-notext .ui-btn-inner{padding:2px 1px 2px 3px}.ui-btn-icon-notext .ui-btn-text{position:absolute;left:-999px}.ui-btn-icon-left .ui-btn-inner{padding-left:33px}.ui-header .ui-btn-icon-left .ui-btn-inner,.ui-footer .ui-btn-icon-left .ui-btn-inner,.ui-bar .ui-btn-icon-left .ui-btn-inner{padding-left:27px}.ui-btn-icon-right .ui-btn-inner{padding-right:33px}.ui-header .ui-btn-icon-right .ui-btn-inner,.ui-footer .ui-btn-icon-right .ui-btn-inner,.ui-bar .ui-btn-icon-right .ui-btn-inner{padding-right:27px}.ui-btn-icon-top .ui-btn-inner{padding-top:33px}.ui-header .ui-btn-icon-top .ui-btn-inner,.ui-footer .ui-btn-icon-top .ui-btn-inner,.ui-bar .ui-btn-icon-top .ui-btn-inner{padding-top:27px}.ui-btn-icon-bottom .ui-btn-inner{padding-bottom:33px}.ui-header .ui-btn-icon-bottom .ui-btn-inner,.ui-footer .ui-btn-icon-bottom .ui-btn-inner,.ui-bar .ui-btn-icon-bottom .ui-btn-inner{padding-bottom:27px}.ui-btn-icon-notext .ui-icon{display:block}.ui-btn-icon-left .ui-icon,.ui-btn-icon-right .ui-icon{position:absolute;top:50%;margin-top:-9px}.ui-btn-icon-top .ui-icon,.ui-btn-icon-bottom .ui-icon{position:absolute;left:50%;margin-left:-9px}.ui-btn-icon-left .ui-icon{left:10px}.ui-btn-icon-right .ui-icon{right:10px}.ui-btn-icon-top .ui-icon{top:10px}.ui-btn-icon-bottom .ui-icon{bottom:10px}.ui-header .ui-btn-icon-left .ui-icon,.ui-footer .ui-btn-icon-left .ui-icon,.ui-bar .ui-btn-icon-left .ui-icon{left:4px}.ui-header .ui-btn-icon-right .ui-icon,.ui-footer .ui-btn-icon-right .ui-icon,.ui-bar .ui-btn-icon-right .ui-icon{right:4px}.ui-header .ui-btn-icon-top .ui-icon,.ui-footer .ui-btn-icon-top .ui-icon,.ui-bar .ui-btn-icon-top .ui-icon{top:4px}.ui-header .ui-btn-icon-bottom .ui-icon,.ui-footer .ui-btn-icon-bottom .ui-icon,.ui-bar .ui-btn-icon-bottom .ui-icon{bottom:4px}.ui-btn-hidden{position:absolute;top:0;left:0;width:100%;height:100%;-webkit-appearance:button;opacity:.1;cursor:pointer;background:transparent;font-size:1px;border:0;line-height:999px}.ui-collapsible{margin:.5em 0}.ui-collapsible-heading{font-size:16px;display:block;margin:0 -8px;padding:0;border-width:0 0 1px 0;position:relative}.ui-collapsible-heading a{text-align:left;margin:0}.ui-collapsible-heading a .ui-btn-inner{padding-left:40px}.ui-collapsible-heading a span.ui-btn{position:absolute;left:6px;top:50%;margin:-12px 0 0 0;width:20px;height:20px;padding:1px 0 1px 2px;text-indent:-9999px}.ui-collapsible-heading a span.ui-btn .ui-btn-inner{padding:10px 0}.ui-collapsible-heading a span.ui-btn .ui-icon{left:0;margin-top:-10px}.ui-collapsible-heading-status{position:absolute;left:-9999px}.ui-collapsible-content{display:block;margin:0 -8px;padding:10px 16px;border-top:0;background-image:none;font-weight:normal}.ui-collapsible-content-collapsed{display:none}.ui-collapsible-set{margin:.5em 0}.ui-collapsible-set .ui-collapsible{margin:-1px 0 0}.ui-controlgroup,fieldset.ui-controlgroup{padding:0;margin:.5em 0 1em}.ui-bar .ui-controlgroup{margin:0 .3em}.ui-controlgroup-label{font-size:16px;line-height:1.4;font-weight:normal;margin:0 0 .3em}.ui-controlgroup-controls{display:block;width:95%}.ui-controlgroup li{list-style:none}.ui-controlgroup-vertical .ui-btn,.ui-controlgroup-vertical .ui-checkbox,.ui-controlgroup-vertical .ui-radio{margin:0;border-bottom-width:0}.ui-controlgroup-vertical .ui-controlgroup-last{border-bottom-width:1px}.ui-controlgroup-horizontal{padding:0}.ui-controlgroup-horizontal .ui-btn{display:inline-block;margin:0 -5px 0 0}.ui-controlgroup-horizontal .ui-checkbox,.ui-controlgroup-horizontal .ui-radio{float:left;margin:0 -1px 0 0}.ui-controlgroup-horizontal .ui-checkbox .ui-btn,.ui-controlgroup-horizontal .ui-radio .ui-btn,.ui-controlgroup-horizontal .ui-checkbox:last-child,.ui-controlgroup-horizontal .ui-radio:last-child{margin-right:0}.ui-controlgroup-horizontal .ui-controlgroup-last{margin-right:0}.ui-controlgroup .ui-checkbox label,.ui-controlgroup .ui-radio label{font-size:16px}@media all and (min-width:450px){.ui-controlgroup-label{vertical-align:top;display:inline-block;width:20%;margin:0 2% 0 0}.ui-controlgroup-controls{width:60%;display:inline-block}}.ui-dialog{min-height:480px}.ui-dialog .ui-header,.ui-dialog .ui-content,.ui-dialog .ui-footer{margin:15px;position:relative}.ui-dialog .ui-header,.ui-dialog .ui-footer{z-index:10;width:auto}.ui-dialog .ui-content,.ui-dialog .ui-footer{margin-top:-15px}.ui-checkbox,.ui-radio{position:relative;margin:.2em 0 .5em;z-index:1}.ui-checkbox .ui-btn,.ui-radio .ui-btn{margin:0;text-align:left;z-index:2}.ui-checkbox .ui-btn-inner,.ui-radio .ui-btn-inner{white-space:normal}.ui-checkbox .ui-btn-icon-left .ui-btn-inner,.ui-radio .ui-btn-icon-left .ui-btn-inner{padding-left:45px}.ui-checkbox .ui-btn-icon-right .ui-btn-inner,.ui-radio .ui-btn-icon-right .ui-btn-inner{padding-right:45px}.ui-checkbox .ui-icon,.ui-radio .ui-icon{top:1.1em}.ui-checkbox .ui-btn-icon-left .ui-icon,.ui-radio .ui-btn-icon-left .ui-icon{left:15px}.ui-checkbox .ui-btn-icon-right .ui-icon,.ui-radio .ui-btn-icon-right .ui-icon{right:15px}.ui-checkbox input,.ui-radio input{position:absolute;left:20px;top:50%;width:10px;height:10px;margin:-5px 0 0 0;outline:0!important;z-index:1}.ui-field-contain{padding:1.5em 0;margin:0;border-bottom-width:1px;overflow:visible}.ui-field-contain:first-child{border-top-width:0}@media all and (min-width:450px){.ui-field-contain{border-width:0;padding:0;margin:1em 0}}.ui-select{display:block;position:relative}.ui-select select{position:absolute;left:-9999px;top:-9999px}.ui-select .ui-btn{overflow:hidden}.ui-select .ui-btn select{cursor:pointer;-webkit-appearance:button;left:0;top:0;width:100%;min-height:1.5em;min-height:100%;height:3em;max-height:100%;opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0);z-index:2}@-moz-document url-prefix(){.ui-select .ui-btn select{opacity:.0001}}.ui-select .ui-btn select.ui-select-nativeonly{opacity:1;text-indent:0}.ui-select .ui-btn-icon-right .ui-btn-inner{padding-right:45px}.ui-select .ui-btn-icon-right .ui-icon{right:15px}label.ui-select{font-size:16px;line-height:1.4;font-weight:normal;margin:0 0 .3em;display:block}.ui-select .ui-btn-text,.ui-selectmenu .ui-btn-text{display:block;min-height:1em}.ui-select .ui-btn-text{text-overflow:ellipsis;overflow:hidden}.ui-selectmenu{position:absolute;padding:0;z-index:100!important;width:80%;max-width:350px;padding:6px}.ui-selectmenu .ui-listview{margin:0}.ui-selectmenu .ui-btn.ui-li-divider{cursor:default}.ui-selectmenu-hidden{top:-9999px;left:-9999px}.ui-selectmenu-screen{position:absolute;top:0;left:0;width:100%;height:100%;z-index:99}.ui-screen-hidden,.ui-selectmenu-list .ui-li .ui-icon{display:none}.ui-selectmenu-list .ui-li .ui-icon{display:block}.ui-li.ui-selectmenu-placeholder{display:none}.ui-selectmenu .ui-header .ui-title{margin:.6em 46px .8em}@media all and (min-width:450px){label.ui-select{vertical-align:top;display:inline-block;width:20%;margin:0 2% 0 0}.ui-select{width:60%;display:inline-block}}.ui-selectmenu .ui-header h1:after{content:'.';visibility:hidden}label.ui-input-text{font-size:16px;line-height:1.4;display:block;font-weight:normal;margin:0 0 .3em}input.ui-input-text,textarea.ui-input-text{background-image:none;padding:.4em;line-height:1.4;font-size:16px;display:block;width:95%}input.ui-input-text{-webkit-appearance:none}textarea.ui-input-text{height:50px;-webkit-transition:height 200ms linear;-moz-transition:height 200ms linear;-o-transition:height 200ms linear;transition:height 200ms linear}.ui-input-search{padding:0 30px;width:77%;background-image:none;position:relative}.ui-icon-searchfield:after{position:absolute;left:7px;top:50%;margin-top:-9px;content:"";width:18px;height:18px;opacity:.5}.ui-input-search input.ui-input-text{border:0;width:98%;padding:.4em 0;margin:0;display:block;background:transparent none;outline:0!important}.ui-input-search .ui-input-clear{position:absolute;right:0;top:50%;margin-top:-14px}.ui-input-search .ui-input-clear-hidden{display:none}@media all and (min-width:450px){label.ui-input-text{vertical-align:top;display:inline-block;width:20%;margin:0 2% 0 0}input.ui-input-text,textarea.ui-input-text,.ui-input-search{width:60%;display:inline-block}.ui-input-search{width:50%}.ui-input-search input.ui-input-text{width:98%}}.ui-listview{margin:0;counter-reset:listnumbering}.ui-content .ui-listview{margin:-15px}.ui-content .ui-listview-inset{margin:1em 0}.ui-listview,.ui-li{list-style:none;padding:0}.ui-li,.ui-li.ui-field-contain{display:block;margin:0;position:relative;overflow:visible;text-align:left;border-width:0;border-top-width:1px}.ui-li .ui-btn-text{position:relative;z-index:1}.ui-li .ui-btn-text a.ui-link-inherit{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.ui-li-divider,.ui-li-static{padding:.5em 15px;font-size:14px;font-weight:bold}.ui-li-divider{counter-reset:listnumbering}ol.ui-listview .ui-link-inherit:before,ol.ui-listview .ui-li-static:before,.ui-li-dec{font-size:.8em;display:inline-block;padding-right:.3em;font-weight:normal;counter-increment:listnumbering;content:counter(listnumbering) ". "}ol.ui-listview .ui-li-jsnumbering:before{content:""!important}.ui-listview-inset .ui-li{border-right-width:1px;border-left-width:1px}.ui-li:last-child,.ui-li.ui-field-contain:last-child{border-bottom-width:1px}.ui-li>.ui-btn-inner{display:block;position:relative;padding:0}.ui-li .ui-btn-inner a.ui-link-inherit,.ui-li-static.ui-li{padding:.7em 15px .7em 15px;display:block}.ui-li-has-thumb .ui-btn-inner a.ui-link-inherit,.ui-li-static.ui-li-has-thumb{min-height:60px;padding-left:100px}.ui-li-has-icon .ui-btn-inner a.ui-link-inherit,.ui-li-static.ui-li-has-icon{min-height:20px;padding-left:40px}.ui-li-has-count .ui-btn-inner a.ui-link-inherit,.ui-li-static.ui-li-has-count{padding-right:45px}.ui-li-has-arrow .ui-btn-inner a.ui-link-inherit,.ui-li-static.ui-li-has-arrow{padding-right:30px}.ui-li-has-arrow.ui-li-has-count .ui-btn-inner a.ui-link-inherit,.ui-li-static.ui-li-has-arrow.ui-li-has-count{padding-right:75px}.ui-li-heading{font-size:16px;font-weight:bold;display:block;margin:.6em 0;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.ui-li-desc{font-size:12px;font-weight:normal;display:block;margin:-.5em 0 .6em;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.ui-li-thumb,.ui-li-icon{position:absolute;left:1px;top:0;max-height:80px;max-width:80px}.ui-li-icon{max-height:40px;max-width:40px;left:10px;top:.9em}.ui-li-thumb,.ui-li-icon,.ui-li-content{float:left;margin-right:10px}.ui-li-aside{float:right;width:50%;text-align:right;margin:.3em 0}@media all and (min-width:480px){.ui-li-aside{width:45%}}.ui-li-divider{cursor:default}.ui-li-has-alt .ui-btn-inner a.ui-link-inherit,.ui-li-static.ui-li-has-alt{padding-right:95px}.ui-li-has-count .ui-li-count{position:absolute;font-size:11px;font-weight:bold;padding:.2em .5em;top:50%;margin-top:-.9em;right:38px}.ui-li-divider .ui-li-count,.ui-li-static .ui-li-count{right:10px}.ui-li-has-alt .ui-li-count{right:55px}.ui-li-link-alt{position:absolute;width:40px;height:100%;border-width:0;border-left-width:1px;top:0;right:0;margin:0;padding:0;z-index:2}.ui-li-link-alt .ui-btn{overflow:hidden;position:absolute;right:8px;top:50%;margin:-11px 0 0 0;border-bottom-width:1px;z-index:-1}.ui-li-link-alt .ui-btn-inner{padding:0;height:100%;position:absolute;width:100%;top:0;left:0}.ui-li-link-alt .ui-btn .ui-icon{right:50%;margin-right:-9px}.ui-listview * .ui-btn-inner>.ui-btn>.ui-btn-inner{border-top:0}.ui-listview-filter{border-width:0;overflow:hidden;margin:-15px -15px 15px -15px}.ui-listview-filter .ui-input-search{margin:5px;width:auto;display:block}.ui-listview-filter-inset{margin:-15px -5px -15px -5px;background:transparent}.ui-li.ui-screen-hidden{display:none}@media only screen and (min-device-width:768px) and (max-device-width:1024px){.ui-li .ui-btn-text{overflow:visible}}label.ui-slider{display:block}input.ui-slider-input{display:inline-block;width:50px}select.ui-slider-switch{display:none}div.ui-slider{position:relative;display:inline-block;overflow:visible;height:15px;padding:0;margin:0 2% 0 20px;top:4px;width:66%}a.ui-slider-handle{position:absolute;z-index:10;top:50%;width:28px;height:28px;margin-top:-15px;margin-left:-15px}a.ui-slider-handle .ui-btn-inner{padding-left:0;padding-right:0}@media all and (min-width:480px){label.ui-slider{vertical-align:top;display:inline-block;width:20%;margin:0 2% 0 0}div.ui-slider{width:45%}}div.ui-slider-switch{height:32px;overflow:hidden;margin-left:0}div.ui-slider-inneroffset{margin-left:50%;position:absolute;top:1px;height:100%;width:50%}a.ui-slider-handle-snapping{-webkit-transition:left 100ms linear}div.ui-slider-labelbg{position:absolute;top:0;margin:0;border-width:0}div.ui-slider-switch div.ui-slider-labelbg-a{width:60%;height:100%;left:0}div.ui-slider-switch div.ui-slider-labelbg-b{width:60%;height:100%;right:0}.ui-slider-switch-a div.ui-slider-labelbg-a,.ui-slider-switch-b div.ui-slider-labelbg-b{z-index:-1}.ui-slider-switch-a div.ui-slider-labelbg-b,.ui-slider-switch-b div.ui-slider-labelbg-a{z-index:0}div.ui-slider-switch a.ui-slider-handle{z-index:20;width:101%;height:32px;margin-top:-18px;margin-left:-101%}span.ui-slider-label{width:100%;position:absolute;height:32px;font-size:16px;text-align:center;line-height:2;background:0;border-color:transparent}span.ui-slider-label-a{left:-100%;margin-right:-1px}span.ui-slider-label-b{right:-100%;margin-left:-1px} \ No newline at end of file diff --git a/libs/js/globalize/.gitignore b/libs/js/globalize/.gitignore new file mode 100644 index 0000000..a4f14d9 --- /dev/null +++ b/libs/js/globalize/.gitignore @@ -0,0 +1,7 @@ +.project +*~ +*.diff +*.patch +.DS_Store +generator/bin +generator/obj diff --git a/libs/js/globalize/.npmignore b/libs/js/globalize/.npmignore new file mode 100644 index 0000000..dba9ccc --- /dev/null +++ b/libs/js/globalize/.npmignore @@ -0,0 +1 @@ +generator/ diff --git a/libs/js/globalize/LICENSE b/libs/js/globalize/LICENSE new file mode 100644 index 0000000..9c8b022 --- /dev/null +++ b/libs/js/globalize/LICENSE @@ -0,0 +1,21 @@ +Copyright Software Freedom Conservancy, Inc. +http://jquery.org/license + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/libs/js/globalize/README.md b/libs/js/globalize/README.md new file mode 100644 index 0000000..19152a0 --- /dev/null +++ b/libs/js/globalize/README.md @@ -0,0 +1,810 @@ +# Globalize + +A JavaScript library for globalization and localization. Enables complex +culture-aware number and date parsing and formatting, including the raw +culture information for hundreds of different languages and countries, as well +as an extensible system for localization. + +
    + + + +

    Why Globalization?

    +

    +Each language, and the countries that speak that language, have different +expectations when it comes to how numbers (including currency and percentages) +and dates should appear. Obviously, each language has different names for the +days of the week and the months of the year. But they also have different +expectations for the structure of dates, such as what order the day, month and +year are in. In number formatting, not only does the character used to +delineate number groupings and the decimal portion differ, but the placement of +those characters differ as well. +

    +

    +A user using an application should be able to read and write dates and numbers +in the format they are accustomed to. This library makes this possible, +providing an API to convert user-entered number and date strings - in their +own format - into actual numbers and dates, and conversely, to format numbers +and dates into that string format. +

    + + +

    What is a Culture?

    +

    +Globalize defines roughly 350 cultures. Part of the reason for this large +number, besides there being a lot of cultures in the world, is because for +some languages, expectations differ among the countries that speak it. +English, for example, is an official language in dozens of countries. Despite +the language being English, the expected date formatting still greatly differs +between them. +

    +

    +So, it does not seem useful to define cultures by their language alone. Nor +is it useful to define a culture by its country alone, as many countries have +several official languages, spoken by sizable populations. Therefore, cultures +are defined as a combination of the language and the country speaking it. Each +culture is given a unique code that is a combination of an ISO 639 two-letter +lowercase culture code for the language, and a two-letter uppercase code for +the country or region. For example, "en-US" is the culture code for English in +the United States. +

    +

    +Yet, it is perhaps unreasonable to expect application developers to cater to +every possible language/country combination perfectly. It is important then to +define so-called "neutral" cultures based on each language. These cultures +define the most likely accepted set of rules by anyone speaking that language, +whatever the country. Neutral cultures are defined only by their language code. +For example, "es" is the neutral culture for Spanish. +

    + + +

    Globalize.addCultureInfo( cultureName, extendCultureName, info )

    +

    +This method allows you to create a new culture based on an existing culture or +add to existing culture info. If the optional argument

    extendCultureName
    +is not supplied, it will extend the existing culture if it exists or create a new +culture based on the default culture if it doesn't exist. If cultureName is not +supplied, it will add the supplied info to the current culture. See .culture(). +

    + + + +

    Globalize.cultures

    +

    +A mapping of culture codes to culture objects. For example, +Globalize.cultures.fr is an object representing the complete culture +definition for the neutral French culture. Note that the main globalize.js file +alone only includes a neutral English culture. To get additional cultures, you +must include one or more of the culture scripts that come with it. You +can see in the section Defining Culture Information +below which fields are defined in each culture. +

    + + +

    Globalize.culture( selector )

    +

    +An application that supports globalization and/or localization will need to +have a way to determine the user's preference. Attempting to automatically +determine the appropriate culture is useful, but it is good practice to always +offer the user a choice, by whatever means. +

    +

    +Whatever your mechanism, it is likely that you will have to correlate the +user's preferences with the list of cultures supported in the app. This +method allows you to select the best match given the culture scripts that you +have included and to set the Globalize culture to the culture which the user +prefers. +

    +

    +If you pass an array of names instead of a single name string, the first +culture for which there is a match (that culture's script has been referenced) +will be used. If none match, the search restarts using the corresponding +neutral cultures. For example, if the application has included only the neutral +"fr" culture, any of these would select it: +

    +Globalize.culture( "fr" );
    +console.log( Globalize.culture().name ) // "fr"
    +
    +Globalize.culture( "fr-FR" );
    +console.log( Globalize.culture().name ) // "fr-FR"
    +
    +Globalize.culture([ "es-MX", "fr-FR" ]);
    +console.log( Globalize.culture().name ) // "es-MX"
    +
    + +In any case, if no match is found, the neutral English culture "en" is selected +by default. + +If you don't pass a selector, .culture() will return the current Globalize +culture. +

    +

    +Each culture string may also follow the pattern defined in +RFC2616 sec 14.4. That is, a culture name may include a "quality" value +that indicates an estimate of the user's preference for the language. + +

    +Globalize.culture( "fr;q=0.4, es;q=0.5, he" );
    +
    +In this example, the neutral Hebrew culture "he" is given top priority (an +unspecified quality is equal to 1). If that language is not an exact match for +any of the cultures available in Globalize.cultures, then "es" is the next +highest priority with 0.5, etc. If none of these match, just like with the array +syntax, the search starts over and the same rules are applied to the +corresponding neutral language culture for each. If still none match, the +neutral English culture "en" is used. +

    + + +

    Globalize.findClosestCulture( selector )

    +

    +Just like .culture( selector ), but it just returns the matching culture, if +any, without setting it to the current Globalize culture, returned by +.culture(). +

    + + +

    Globalize.format( value, format, culture )

    +

    +Formats a date or number according to the given format string and the given +culture (or the current culture if not specified). See the sections +Number Formatting and +Date Formatting below for details on the available +formats. +

    +// assuming a culture with number grouping of 3 digits,
    +// using "," separator and "." decimal symbol.
    +Globalize.format( 1234.567, "n" ); // "1,234.57"
    +Globalize.format( 1234.567, "n1" ); // "1,234.6"
    +Globalize.format( 1234.567, "n0" ); // "1,235"
    +
    +// assuming a culture with "/" as the date separator symbol
    +Globalize.format( new Date(1955,10,5), "yyyy/MM/dd" ); // "1955/11/05"
    +Globalize.format( new Date(1955,10,5), "dddd MMMM d, yyyy" ); // "Saturday November 5, 1955"
    +
    +

    + + +

    Globalize.localize( key, culture )

    +

    +Gets or sets a localized value. This method allows you to extend the +information available to a particular culture, and to easily retrieve it +without worrying about finding the most appropriate culture. For example, to +define the word "translate" in French: +

    +Globalize.addCultureInfo( "fr", {
    +	messages: {
    +		"translate": "traduire"
    +	}
    +});
    +console.log( Globalize.localize( "translate", "fr" ) ); // "traduire"
    +
    +Note that localize() will find the closest match available per the same +semantics as the Globalize.findClosestCulture() method. If there is no +match, the translation given is for the neutral English culture "en" by +default. +

    + + + +

    Globalize.parseInt( value, radix, culture )

    +

    +Parses a string representing a whole number in the given radix (10 by default), +taking into account any formatting rules followed by the given culture (or the +current culture, if not specified). +

    +// assuming a culture where "," is the group separator
    +// and "." is the decimal separator
    +Globalize.parseInt( "1,234.56" ); // 1234
    +// assuming a culture where "." is the group separator
    +// and "," is the decimal separator
    +Globalize.parseInt( "1.234,56" ); // 1234
    +
    +

    + + +

    Globalize.parseFloat( value, radix, culture )

    +

    +Parses a string representing a floating point number in the given radix (10 by +default), taking into account any formatting rules followed by the given +culture (or the current culture, if not specified). +

    +// assuming a culture where "," is the group separator
    +// and "." is the decimal separator
    +Globalize.parseFloat( "1,234.56" ); // 1234.56
    +// assuming a culture where "." is the group separator
    +// and "," is the decimal separator
    +Globalize.parseFloat( "1.234,56" ); // 1234.56
    +
    +

    + + +

    Globalize.parseDate( value, formats, culture )

    +

    +Parses a string representing a date into a JavaScript Date object, taking into +account the given possible formats (or the given culture's set of default +formats if not given). As before, the current culture is used if one is not +specified. +

    +Globalize.culture( "en" );
    +Globalize.parseDate( "1/2/2003" ); // Thu Jan 02 2003
    +Globalize.culture( "fr" );
    +Globalize.parseDate( "1/2/2003" ); // Sat Feb 01 2003
    +
    +

    + + +

    Utilizing and Extending Cultures

    +

    +The culture information included with each culture is mostly necessary for the +parsing and formatting methods, but not all of it. For example, the Native and +English names for each culture is given, as well as a boolean indicating +whether the language is right-to-left. This may be useful information for your +own purposes. You may also add to the culture information directly if so +desired. +

    +

    +As an example, in the U.S., the word "billion" means the number 1,000,000,000 +(9 zeros). But in other countries, that number is "1000 million" or a +"milliard", and a billion is 1,000,000,000,000 (12 zeros). If you needed to +provide functionality to your app or custom plugin that needed to know how many +zeros are in a "billion", you could extend the culture information as follows: +

    +// define additional culture information for a possibly existing culture
    +Globalize.addCultureInfo( "fr", {
    +	numberFormat: {
    +		billionZeroes: 12
    +	}
    +});
    +
    +Using this mechanism, the "fr" culture will be created if it does not exist. +And if it does, the given values will be added to it. +

    + + +

    Defining Culture Information

    +

    +Each culture is defined in its own script with the naming scheme +globalize.culture.<name>.js. You may include any number of these scripts, +making them available in the Globalize.cultures mapping. Including one of +these scripts does NOT automatically make it the current culture selected in the +Globalize.culture property. +

    +

    +The neutral English culture is defined directly in globalize.js, and set +both to the properties "en" and "default" of the Globalize.cultures mapping. +Extensive comments describe the purpose of each of the fields defined. +

    +

    +Looking at the source code of the scripts for each culture, you will notice +that each script uses Globalize.addCultureInfo() to have the "default" neutral +English culture "en", as a common basis, and defines only the properties that +differ from neutral English. +

    +

    +The neutral English culture is listed here along with the comments: +

    +Globalize.cultures[ "default" ] = {
    +	// A unique name for the culture in the form
    +	// <language code>-<country/region code>
    +	name: "English",
    +	// the name of the culture in the English language
    +	englishName: "English",
    +	// the name of the culture in its own language
    +	nativeName: "English",
    +	// whether the culture uses right-to-left text
    +	isRTL: false,
    +	// "language" is used for so-called "specific" cultures.
    +	// For example, the culture "es-CL" means Spanish in Chili.
    +	// It represents the Spanish-speaking culture as it is in Chili,
    +	// which might have different formatting rules or even translations
    +	// than Spanish in Spain. A "neutral" culture is one that is not
    +	// specific to a region. For example, the culture "es" is the generic
    +	// Spanish culture, which may be a more generalized version of the language
    +	// that may or may not be what a specific culture expects.
    +	// For a specific culture like "es-CL", the "language" field refers to the
    +	// neutral, generic culture information for the language it is using.
    +	// This is not always a simple matter of the string before the dash.
    +	// For example, the "zh-Hans" culture is neutral (Simplified Chinese).
    +	// And the "zh-SG" culture is Simplified Chinese in Singapore, whose
    +	// language field is "zh-CHS", not "zh".
    +	// This field should be used to navigate from a specific culture to its
    +	// more general, neutral culture. If a culture is already as general as it
    +	// can get, the language may refer to itself.
    +	language: "en",
    +	// "numberFormat" defines general number formatting rules, like the digits
    +	// in each grouping, the group separator, and how negative numbers are
    +	// displayed.
    +	numberFormat: {
    +		// [negativePattern]
    +		// Note, numberFormat.pattern has no "positivePattern" unlike percent
    +		// and currency, but is still defined as an array for consistency with
    +		// them.
    +		//	  negativePattern: one of "(n)|-n|- n|n-|n -"
    +		pattern: [ "-n" ],
    +		// number of decimal places normally shown
    +		decimals: 2,
    +		// string that separates number groups, as in 1,000,000
    +		",": ",",
    +		// string that separates a number from the fractional portion,
    +		// as in 1.99
    +		".": ".",
    +		// array of numbers indicating the size of each number group.
    +		groupSizes: [ 3 ],
    +		// symbol used for positive numbers
    +		"+": "+",
    +		// symbol used for negative numbers
    +		"-": "-",
    +		percent: {
    +			// [negativePattern, positivePattern]
    +			//	   negativePattern: one of "-n %|-n%|-%n|%-n|%n-|n-%|n%-|-% n|n %-|% n-|% -n|n- %"
    +			//	   positivePattern: one of "n %|n%|%n|% n"
    +			pattern: [ "-n %", "n %" ],
    +			// number of decimal places normally shown
    +			decimals: 2,
    +			// array of numbers indicating the size of each number group.
    +			groupSizes: [ 3 ],
    +			// string that separates number groups, as in 1,000,000
    +			",": ",",
    +			// string that separates a number from the fractional portion, as in 1.99
    +			".": ".",
    +			// symbol used to represent a percentage
    +			symbol: "%"
    +		},
    +		currency: {
    +			// [negativePattern, positivePattern]
    +			//	   negativePattern: one of "($n)|-$n|$-n|$n-|(n$)|-n$|n-$|n$-|-n $|-$ n|n $-|$ n-|$ -n|n- $|($ n)|(n $)"
    +			//	   positivePattern: one of "$n|n$|$ n|n $"
    +			pattern: [ "($n)", "$n" ],
    +			// number of decimal places normally shown
    +			decimals: 2,
    +			// array of numbers indicating the size of each number group.
    +			groupSizes: [ 3 ],
    +			// string that separates number groups, as in 1,000,000
    +			",": ",",
    +			// string that separates a number from the fractional portion, as in 1.99
    +			".": ".",
    +			// symbol used to represent currency
    +			symbol: "$"
    +		}
    +	},
    +	// "calendars" property defines all the possible calendars used by this
    +	// culture. There should be at least one defined with name "standard" which
    +	// is the default calendar used by the culture.
    +	// A calendar contains information about how dates are formatted,
    +	// information about the calendar's eras, a standard set of the date
    +	// formats, translations for day and month names, and if the calendar is
    +	// not based on the Gregorian calendar, conversion functions to and from
    +	// the Gregorian calendar.
    +	calendars: {
    +		standard: {
    +			// name that identifies the type of calendar this is
    +			name: "Gregorian_USEnglish",
    +			// separator of parts of a date (e.g. "/" in 11/05/1955)
    +			"/": "/",
    +			// separator of parts of a time (e.g. ":" in 05:44 PM)
    +			":": ":",
    +			// the first day of the week (0 = Sunday, 1 = Monday, etc)
    +			firstDay: 0,
    +			days: {
    +				// full day names
    +				names: [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ],
    +				// abbreviated day names
    +				namesAbbr: [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ],
    +				// shortest day names
    +				namesShort: [ "Su", "Mo", "Tu", "We", "Th", "Fr", "Sa" ]
    +			},
    +			months: [
    +				// full month names (13 months for lunar calendars -- 13th month should be "" if not lunar)
    +				names: [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" ],
    +				// abbreviated month names
    +				namesAbbr: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "" ]
    +			],
    +			// AM and PM designators in one of these forms:
    +			// The usual view, and the upper and lower case versions
    +			//		[standard,lowercase,uppercase]
    +			// The culture does not use AM or PM (likely all standard date
    +			// formats use 24 hour time)
    +			//		null
    +			AM: [ "AM", "am", "AM" ],
    +			PM: [ "PM", "pm", "PM" ],
    +			eras: [
    +				// eras in reverse chronological order.
    +				// name: the name of the era in this culture (e.g. A.D., C.E.)
    +				// start: when the era starts in ticks, null if it is the
    +				//		  earliest supported era.
    +				// offset: offset in years from gregorian calendar
    +				{"name":"A.D.","start":null,"offset":0}
    +			],
    +			// when a two digit year is given, it will never be parsed as a
    +			// four digit year greater than this year (in the appropriate era
    +			// for the culture)
    +			// Set it as a full year (e.g. 2029) or use an offset format
    +			// starting from the current year: "+19" would correspond to 2029
    +			// if the current year is 2010.
    +			twoDigitYearMax: 2029,
    +			// set of predefined date and time patterns used by the culture.
    +			// These represent the format someone in this culture would expect
    +			// to see given the portions of the date that are shown.
    +			patterns: {
    +				// short date pattern
    +				d: "M/d/yyyy",
    +				// long date pattern
    +				D: "dddd, MMMM dd, yyyy",
    +				// short time pattern
    +				t: "h:mm tt",
    +				// long time pattern
    +				T: "h:mm:ss tt",
    +				// long date, short time pattern
    +				f: "dddd, MMMM dd, yyyy h:mm tt",
    +				// long date, long time pattern
    +				F: "dddd, MMMM dd, yyyy h:mm:ss tt",
    +				// month/day pattern
    +				M: "MMMM dd",
    +				// month/year pattern
    +				Y: "yyyy MMMM",
    +				// S is a sortable format that does not vary by culture
    +				S: "yyyy\u0027-\u0027MM\u0027-\u0027dd\u0027T\u0027HH\u0027:\u0027mm\u0027:\u0027ss"
    +			}
    +			// optional fields for each calendar:
    +			/*
    +			monthsGenitive:
    +				Same as months but used when the day preceeds the month.
    +				Omit if the culture has no genitive distinction in month names.
    +				For an explanation of genitive months, see
    +				http://blogs.msdn.com/michkap/archive/2004/12/25/332259.aspx
    +			convert:
    +				Allows for the support of non-gregorian based calendars. This
    +				"convert" object defines two functions to convert a date to and
    +				from a gregorian calendar date:
    +					fromGregorian( date )
    +						Given the date as a parameter, return an array with
    +						parts [ year, month, day ] corresponding to the
    +						non-gregorian based year, month, and day for the
    +						calendar.
    +					toGregorian( year, month, day )
    +						Given the non-gregorian year, month, and day, return a
    +						new Date() object set to the corresponding date in the
    +						gregorian calendar.
    +			*/
    +		}
    +	},
    +	// Map of messages used by .localize()
    +	messages: {}
    +}
    +
    +

    +

    +Each culture can have several possible calendars. The calendar named "standard" +is the default calendar used by that culture. You may change the calendar in +use by setting the "calendar" field. Take a look at the calendars defined by +each culture by looking at the script or enumerating its calendars collection. +

    +// switch to a non-standard calendar
    +Globalize.culture().calendar = Globalize.culture().calendars.SomeOtherCalendar;
    +// back to the standard calendar
    +Globalize.culture().calendar = Globalize.culture().calendars.standard;
    +
    + +

    + + +

    Number Formatting

    +

    +When formatting a number with format(), the main purpose is to convert the +number into a human readable string using the culture's standard grouping and +decimal rules. The rules between cultures can vary a lot. For example, in some +cultures, the grouping of numbers is done unevenly. In the "te-IN" culture +(Telugu in India), groups have 3 digits and then 2 digits. The number 1000000 +(one million) is written as "10,00,000". Some cultures do not group numbers at +all. +

    +

    +There are four main types of number formatting: +

      +
    • n for number
    • +
    • d for decimal digits
    • +
    • p for percentage
    • +
    • c for currency
    • +
    +Even within the same culture, the formatting rules can vary between these four +types of numbers. For example, the expected number of decimal places may differ +from the number format to the currency format. Each format token may also be +followed by a number. The number determines how many decimal places to display +for all the format types except decimal, for which it means the minimum number +of digits to display, zero padding it if necessary. Also note that the way +negative numbers are represented in each culture can vary, such as what the +negative sign is, and whether the negative sign appears before or after the +number. This is especially apparent with currency formatting, where many +cultures use parentheses instead of a negative sign. +
    +// just for example - will vary by culture
    +Globalize.format( 123.45, "n" ); // 123.45
    +Globalize.format( 123.45, "n0" ); // 123
    +Globalize.format( 123.45, "n1" ); // 123.5
    +
    +Globalize.format( 123.45, "d" ); // 123
    +Globalize.format( 12, "d3" ); // 012
    +
    +Globalize.format( 123.45, "c" ); // $123.45
    +Globalize.format( 123.45, "c0" ); // $123
    +Globalize.format( 123.45, "c1" ); // $123.5
    +Globalize.format( -123.45, "c" ); // ($123.45)
    +
    +Globalize.format( 0.12345, "p" ); // 12.35 %
    +Globalize.format( 0.12345, "p0" ); // 12 %
    +Globalize.format( 0.12345, "p4" ); // 12.3450 %
    +
    +Parsing with parseInt and parseFloat also accepts any of these formats. +

    + + +

    Date Formatting

    +

    +Date formatting varies wildly by culture, not just in the spelling of month and +day names, and the date separator, but by the expected order of the various +date components, whether to use a 12 or 24 hour clock, and how months and days +are abbreviated. Many cultures even include "genitive" month names, which are +different from the typical names and are used only in certain cases. +

    +

    +Also, each culture has a set of "standard" or "typical" formats. For example, +in "en-US", when displaying a date in its fullest form, it looks like +"Saturday, November 05, 1955". Note the non-abbreviated day and month name, the +zero padded date, and four digit year. So, Globalize expects a certain set +of "standard" formatting strings for dates in the "patterns" property of the +"standard" calendar of each culture, that describe specific formats for the +culture. The third column shows example values in the neutral English culture +"en-US"; see the second table for the meaning tokens used in date formats. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FormatMeaning"en-US"
    fLong Date, Short Timedddd, MMMM dd, yyyy h:mm tt
    FLong Date, Long Timedddd, MMMM dd, yyyy h:mm:ss tt
    tShort Timeh:mm tt
    TLong Timeh:mm:ss tt
    dShort DateM/d/yyyy
    DLong Datedddd, MMMM dd, yyyy
    YMonth/YearMMMM, yyyy
    MMonth/Dayyyyy MMMM
    +

    +

    +In addition to these standard formats, there is the "S" format. This is a +sortable format that is identical in every culture: +"yyyy'-'MM'-'dd'T'HH':'mm':'ss". +

    +

    +When more specific control is needed over the formatting, you may use any +format you wish by specifying the following custom tokens: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    TokenMeaningExample
    dDay of month (no leading zero)5
    ddDay of month (leading zero)05
    dddDay name (abbreviated)Sat
    ddddDay name (full)Saturday
    MMonth of year (no leading zero)9
    MMMonth of year (leading zero)09
    MMMMonth name (abbreviated)Sept
    MMMMMonth name (full)September
    yyYear (two digits)55
    yyyyYear (four digits)1955
    'literal'Literal Text'of the clock'
    \'Single Quote'o'\''clock'
    mMinutes (no leading zero)9
    mmMinutes (leading zero)09
    hHours (12 hour time, no leading zero)6
    hhHours (12 hour time, leading zero)06
    HHours (24 hour time, no leading zero)5 (5am) 15 (3pm)
    HHHours (24 hour time, leading zero)05 (5am) 15 (3pm)
    sSeconds (no leading zero)9
    ssSeconds (leading zero)09
    fDeciseconds1
    ffCentiseconds11
    fffMilliseconds111
    tAM/PM indicator (first letter)A or P
    ttAM/PM indicator (full)AM or PM
    zTimezone offset (hours only, no leading zero)-8
    zzTimezone offset (hours only, leading zero)-08
    zzzTimezone offset (full hours/minutes)-08:00
    g or ggEra nameA.D.
    +

    + + +

    Generating Culture Files

    + +The Globalize culture files are generated JavaScript containing metadata and +functions based on culture info in the Microsoft .Net Framework 4. + +

    Requirements

    + +
    + +

    Building the generator

    + +1. Open a Windows Command Prompt ( Start -> Run... -> cmd ) +1. Change directory to root of Globalize project (where README.md file is located) +1. >"C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild" generator\generator.csproj + +

    Running the generator

    + +1. Open a Windows Command Prompt +1. Change directory to root of Globalize project (where README.md file is located) +1. >"generator\bin\Debug\generator.exe" diff --git a/libs/js/globalize/examples/browser/browser.css b/libs/js/globalize/examples/browser/browser.css new file mode 100644 index 0000000..3b8bc5b --- /dev/null +++ b/libs/js/globalize/examples/browser/browser.css @@ -0,0 +1,80 @@ +body { + font-family: Arial +} +a { + color: #6D929B; +} +input { + width: 100px; + margin: 5px; +} +.results { + border-collapse: collapse; +} +.results td { + border: 1px solid #C1DAD7; + padding: 2px 2px 2px 2px; + color: #6D929B; + font-size: x-small; + white-space: nowrap; + text-align: center; +} +.results th { + border: 1px solid #C1DAD7; + letter-spacing: 2px; + text-align: center; + padding: 6px 6px 6px 12px; + white-space: nowrap; +} +table { + width: 100%; +} +fieldset.info { + width: 45%; + float: left; +} +.info td { + font-size: x-small; +} + +.tab { + margin-top: 5px; + margin-right: 5px; + padding: 2px; + cursor: pointer; + background-color: #EEEEEE; +} + +.active { + border: 1px solid black; + float: left; +} + +.inactive { + float: left; +} + +.tab.active { + font-weight: bold; + border: 1px solid black; + float: left; +} + +div.inactive { + display: none; +} + +div.active { + clear: both; + min-width: 100%; +} + +.pane { + margin-top: 10px; + clear: both; +} + +#intro { + font-size: x-small; + margin-bottom: 10px; +} \ No newline at end of file diff --git a/libs/js/globalize/examples/browser/browser.js b/libs/js/globalize/examples/browser/browser.js new file mode 100644 index 0000000..a639435 --- /dev/null +++ b/libs/js/globalize/examples/browser/browser.js @@ -0,0 +1,115 @@ +(function( $ ) { + +$(function() { + + // setup sample data + window.numbers = [ + 0, 1, 10, 100, 1000, 10000, 0.1, 0.12, 0.123, 0.1234, 0.12345, 1000.123, 10000.12345, + -1, -10, -100, -1000, -10000, -0.1, -0.12, -0.123, -0.1234, -0.12345, -1000.123, -10000.12345 + ]; + window.formats = [ + "n", "n1", "n3", "d", "d2", "d3", "p", "p1", "p3", "c", "c0" + ]; + window.dates = $.map([ + "Jan 1, 1970 1:34 PM", "Dec 31, 1970 1:34 PM", "Apr 1, 1999 1:34 PM", "Dec 31, 1999 1:34 PM", "Jan 1, 2000 1:34 PM", "Nov 5, 1955 1:34 PM" + ], function(d) { return d instanceof Date ? d : new Date(Date.parse(d)); } ); + + window.dateFormats = [ + "d", "D", "f", "F", "M", "S", "t", "T", "Y" + ]; + + // add template extensions to format numbers and dates declaratively + $.extend( $.tmplcmd, { + demoFormat: { + _default: [0,0], + prefix: "_.push(Globalize.format(numbers[$2],formats[$1]));" + }, + demoDateFormat: { + _default: [0,0], + prefix: "_.push(Globalize.format(dates[$2],typeof $1 === 'number' ? dateFormats[$1] : $1));" + } + }); + + // activate tabs + $(".tab").click(function() { + $(".active").removeClass("active").addClass("inactive"); + $("#" + this.id + "content").removeClass("inactive").addClass("active"); + $(this).removeClass("inactive").addClass("active"); + }); + + // fill cultures dropdown with the available cultures + $.each(sortByName(Globalize.cultures), function(i, culture) { + $("
    + + + + + + + + diff --git a/libs/js/jquery-geo-1.0a4/docs/what/index.html b/libs/js/jquery-geo-1.0a4/docs/what/index.html new file mode 100755 index 0000000..01225db --- /dev/null +++ b/libs/js/jquery-geo-1.0a4/docs/what/index.html @@ -0,0 +1,51 @@ + + + + + + + what? | jQuery Geo + + + + + + + + + + + +
    +
    +

    what?

    +
    + +
    +

    open-source

    +

    + jQuery Geo is a jQuery plugin, which means it is 100% JavaScript that ties into the popular jQuery library. It helps make interacting with various web mapping servers and tile sets such as Open Street Map, WMS and Esri ArcGIS Server as simple as possible. +

    +

    + Internally, Applied Geographics, Inc. has been developing a JavaScript mapping component over the last four years or so and are proud to give our reasearch to the open-source community. +

    +

    + Our intention is to be a simple & fast approach to a decent percentage of the spatial web's needs. +

    +

    widget

    +

    + The primary component of our geospatial plugin is a single user interface widget that pulls in tiled or dynamic map images from map servers. By default, this component targets Open Street Map tiles but can be easilly configured to use other WMS layers or cached tile sets.

    +
    +

    The map widget includes only what is required to show mapping data and handle direct user interaction with the map. The rest can be handled programmatically by the web developer and any other UI framework they choose, e.g., showing and hiding services, changing the widget's mode and hooking into an external zoom bar.

    +

    geo

    +

    Apart from the widget, jQuery Geo has useful geospatial functions in the $.geo namespace. These functions help you calculate bounding boxes, measure the distance between geometries, determine if one geometry contains another, and other functions you might find in the well-known Java Topology Suite. They are all implemented in JavaScript and are included with the rest of jQuery Geo.

    +
    +
    + + + + + + + + diff --git a/libs/js/jquery-geo-1.0a4/favicon.ico b/libs/js/jquery-geo-1.0a4/favicon.ico new file mode 100755 index 0000000..5717d04 Binary files /dev/null and b/libs/js/jquery-geo-1.0a4/favicon.ico differ diff --git a/libs/js/jquery-geo-1.0a4/grunt.js b/libs/js/jquery-geo-1.0a4/grunt.js new file mode 100755 index 0000000..a61de90 --- /dev/null +++ b/libs/js/jquery-geo-1.0a4/grunt.js @@ -0,0 +1,7 @@ +config.init( { + lint: { + files: [ "js/jquery.geo.core.js" ] + } +} ); + +task.registerTask( "default", "lint" ); diff --git a/libs/js/jquery-geo-1.0a4/index.html b/libs/js/jquery-geo-1.0a4/index.html new file mode 100755 index 0000000..f9a80ca --- /dev/null +++ b/libs/js/jquery-geo-1.0a4/index.html @@ -0,0 +1,387 @@ + + + + + jQuery Geo + + + + + + + +
    +
    + +

    jQuery Geowrite less, map more

    +
    +
    +
    +
    + + +

    jQuery Geo - an interactive mapping plugin

    + +

    jQuery Geo, an open-source geospatial mapping project from Applied Geographics, provides a streamlined JavaScript API for a large percentage of your online mapping needs. Whether you just want to display a map on a wep page as quickly as possible or you are a more advanced GIS user, jQuery Geo can help!

    + +

    This project is considered alpha only because it does not yet fully implement the feature set of our scheduled beta release. Alpha releases are stable and should not change much as we port technology from our internal library to the open source one.

    + +

    You can check back here, follow @jQueryGeo on Twitter for release announcements. Also, head over to the lead developer's Twitter account, @ryanttb, for development info, links, or to ask questions.

    + +

    Download

    +

    Using jQuery Geo requires adding one element, including one script (apart from jQuery itself) and calling one function. The following copy-and-paste snippet will help you get started.

    +
    <div id="map" style="height: 320px;"></div>
    +<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
    +<script src="http://code.jquerygeo.com/jquery.geo-1.0a4.min.js"></script>
    +<script>$(function() { $( "#map" ).geomap( ); });</script>
    + +

    code.jquerygeo.com is on the CloudFlare Content Delivery Network (CDN) so our minified, gzipped library will get to your client as fast as possible!

    + +

    Alpha 4 released!

    + + +

    It's been a long three months but we're very happy to announce the release of jQuery Geo 1.0a4! Here are some highlights and details:

    + +

    At the service level

    + +

    In alpha 3, you could append and interact with shapes on the map. In alpha 4, this is extended to services! Service-level shapes have their own shapeStyle apart from the map's and hide when their service is hidden.

    + +

    More modes!

    + +

    There are new modes to let you measure distance & area, and a static mode for when you want to display a map but not let users interact with it. Apart from the three new built-in modes, you can also create custom modes to help organize your app.

    + +

    What's that? CSS labels!

    + +

    You can now give any shape a label when you append it. You can style the label from your regular style sheet using the .geo-label class which opens labeling up to all the design power of CSS3. There's even more potential if you put a class or id on your map service because you can target labels on different services using CSS rules. Also, labels can be any HTML which opens them up to new features in HTML5!

    + +

    More service src options

    + +

    The old getUrl property has been renamed to src (see Breaking below) and you can now set it to a string template. jQuery Geo will stick your tile row, column, zoom, or image bbox in for you. Services defined as a string are a little easier on the eyes than a function and can be stored as JSON data.

    + +

    You can still use a function and the function can now return a jQuery Promise to delay loading of the map image or tile. Want to calculate a Mandlebrot image in a JavaScript web worker without blocking user interaction? Return a new jQuery.Deferred() and call resolve when you're done!

    + +

    Mobile

    + +

    This version has better mobile support including pinch zoom on iOS and Android 3+ as well as other bug fixes for mobile devices.

    + +

    Don't worry about $.geo.proj so much

    + +

    You can now send either geodetic (lon, lat) or projected (x, y) coordinates to any library function and it will return accordingly if you stay on the default web mercator projection. You should still set it to null or implement the (to|from)GeodeticPos functions if you need to change projections.

    + +

    Breaking

    + +

    There is one deprecation (a service object property will be renamed in beta) and one minor breaking change.

    + +

    To align this API with HTML itself, the getUrl property on service objects will be renamed to src. Using either src or getUrl will work for this alpha release but getUrl will be removed for beta. Please update any map services to use the new src property when you're defining them.

    + +

    Also on service objects, the initial opacity and visibility are in a property of the service object itself named style. Your old services will still function but ones you may expect to be hidden initially will be visible until you update the service object.

    + +

    To exemplify both of these changes, instead of:

    {
    +  type: "tiled",
    +  getUrl: function( view ) { return ""; },
    +  visibility: "hidden"
    +}
    you should write:
    {
    +  type: "tiled",
    +  src: function( view ) { return ""; },
    +  style: { visibility: "hidden" }
    +}

    + +

    Everything else

    + +

    With over 60 commits, there are more features and bug fixes to write about. If you dare to click the link below (or read the README file on the project's GitHub page) you can get a better idea of what went into this build. This is the last alpha release (!) and the path to beta will add unit testing, a better build process, and smaller, more refined source code. Thanks for all your support!

    + + Show changelog + + + +

    Alpha 3 released!

    + + +

    jQuery Geo 1.0 Alpha 3 is mostly about sketching!

    +
      +
    • new modes: drawPoint, drawLineString, and drawPolygon allow users to draw on your map
    • +
    • new event: shape triggers anytime a user draws a feature
    • +
    • new style option: drawStyle lets you change how the shapes look while being drawn
    • +
    +

    It's also about geometry functions!

    +
      +
    • $.geo's center, height/width, expandBy, scaleBy & reaspect functions operate on bounding boxes
    • +
    • $.geo's bbox, distance, contains & centroid functions operate on geometries
    • +
    +

    Many examples have more class and now link to jsFiddles to further explain what's going on!

    +

    And a tiny bit about size

    +

    jQuery Geo is now hosted on a CDN with gzip enabled bringing the entire library to your neighborhood at under 18k.

    +

    Breaking

    +

    There are some minor breaking changes to make the API more consistent.

    +
      +
    • The getPixelSize function is now a read-only option named pixelSize:
      $( "#map" ).geomap( "option", "pixelSize" );
    • +
    • The shapeStyle function is also now an option, e.g.:
      $( "#map" ).geomap( "option", "shapeStyle", { color: "red" } );
    • +
    • + The boolean visible property on service objects is now the visibility property found in CSS and geomap styles and can be "visible" or "hidden": +
      $( "#map" ).geomap( { services: [ { id: "roads", visibility: "hidden", ... } ] } );
      +
    • +
    + +

    Edge

    +

    The links above will always point to the latest stable release. However, you can test the most recently committed docs, code & demos by heading over to the test release.

    + Test docs & demos + +

    Thanks!

    + +
      +
    • + + +
    • + +
    • + + +
    • + +
    • + + +
    • + +
    • + + +
    • + +
    • + + +
    • +
    + + +
    +
    + + + + + + + diff --git a/libs/js/jquery-geo-1.0a4/js/excanvas.js b/libs/js/jquery-geo-1.0a4/js/excanvas.js new file mode 100755 index 0000000..f40af96 --- /dev/null +++ b/libs/js/jquery-geo-1.0a4/js/excanvas.js @@ -0,0 +1,1417 @@ +// Copyright 2006 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +// Known Issues: +// +// * Patterns only support repeat. +// * Radial gradient are not implemented. The VML version of these look very +// different from the canvas one. +// * Clipping paths are not implemented. +// * Coordsize. The width and height attribute have higher priority than the +// width and height style values which isn't correct. +// * Painting mode isn't implemented. +// * Canvas width/height should is using content-box by default. IE in +// Quirks mode will draw the canvas using border-box. Either change your +// doctype to HTML5 +// (http://www.whatwg.org/specs/web-apps/current-work/#the-doctype) +// or use Box Sizing Behavior from WebFX +// (http://webfx.eae.net/dhtml/boxsizing/boxsizing.html) +// * Non uniform scaling does not correctly scale strokes. +// * Optimize. There is always room for speed improvements. + +// Only add this code if we do not already have a canvas implementation +if (!document.createElement('canvas').getContext) { + + (function () { + + // alias some functions to make (compiled) code shorter + var m = Math; + var mr = m.round; + var ms = m.sin; + var mc = m.cos; + var abs = m.abs; + var sqrt = m.sqrt; + + // this is used for sub pixel precision + var Z = 10; + var Z2 = Z / 2; + + var IE_VERSION = +navigator.userAgent.match(/MSIE ([\d.]+)?/)[1]; + + /** + * This funtion is assigned to the elements as element.getContext(). + * @this {HTMLElement} + * @return {CanvasRenderingContext2D_} + */ + function getContext() { + return this.context_ || + (this.context_ = new CanvasRenderingContext2D_(this)); + } + + var slice = Array.prototype.slice; + + /** + * Binds a function to an object. The returned function will always use the + * passed in {@code obj} as {@code this}. + * + * Example: + * + * g = bind(f, obj, a, b) + * g(c, d) // will do f.call(obj, a, b, c, d) + * + * @param {Function} f The function to bind the object to + * @param {Object} obj The object that should act as this when the function + * is called + * @param {*} var_args Rest arguments that will be used as the initial + * arguments when the function is called + * @return {Function} A new function that has bound this + */ + function bind(f, obj, var_args) { + var a = slice.call(arguments, 2); + return function () { + return f.apply(obj, a.concat(slice.call(arguments))); + }; + } + + function encodeHtmlAttribute(s) { + return String(s).replace(/&/g, '&').replace(/"/g, '"'); + } + + function addNamespace(doc, prefix, urn) { + if (!doc.namespaces[prefix]) { + doc.namespaces.add(prefix, urn, '#default#VML'); + } + } + + function addNamespacesAndStylesheet(doc) { + addNamespace(doc, 'g_vml_', 'urn:schemas-microsoft-com:vml'); + addNamespace(doc, 'g_o_', 'urn:schemas-microsoft-com:office:office'); + + // Setup default CSS. Only add one style sheet per document + if (!doc.styleSheets['ex_canvas_']) { + var ss = doc.createStyleSheet(); + ss.owningElement.id = 'ex_canvas_'; + ss.cssText = 'canvas{display:inline-block;overflow:hidden;' + + // default size is 300x150 in Gecko and Opera + 'text-align:left;width:300px;height:150px}'; + } + } + + // Add namespaces and stylesheet at startup. + addNamespacesAndStylesheet(document); + + var G_vmlCanvasManager_ = { + init: function (opt_doc) { + var doc = opt_doc || document; + // Create a dummy element so that IE will allow canvas elements to be + // recognized. + doc.createElement('canvas'); + doc.attachEvent('onreadystatechange', bind(this.init_, this, doc)); + }, + + init_: function (doc) { + // find all canvas elements + var els = doc.getElementsByTagName('canvas'); + for (var i = 0; i < els.length; i++) { + this.initElement(els[i]); + } + }, + + /** + * Public initializes a canvas element so that it can be used as canvas + * element from now on. This is called automatically before the page is + * loaded but if you are creating elements using createElement you need to + * make sure this is called on the element. + * @param {HTMLElement} el The canvas element to initialize. + * @return {HTMLElement} the element that was created. + */ + initElement: function (el) { + if (!el.getContext) { + el.getContext = getContext; + + // Add namespaces and stylesheet to document of the element. + addNamespacesAndStylesheet(el.ownerDocument); + + // Remove fallback content. There is no way to hide text nodes so we + // just remove all childNodes. We could hide all elements and remove + // text nodes but who really cares about the fallback content. + el.innerHTML = ''; + + // do not use inline function because that will leak memory + el.attachEvent('onpropertychange', onPropertyChange); + el.attachEvent('onresize', onResize); + + var attrs = el.attributes; + if (attrs.width && attrs.width.specified) { + // TODO: use runtimeStyle and coordsize + // el.getContext().setWidth_(attrs.width.nodeValue); + el.style.width = attrs.width.nodeValue + 'px'; + } else { + el.width = el.clientWidth; + } + if (attrs.height && attrs.height.specified) { + // TODO: use runtimeStyle and coordsize + // el.getContext().setHeight_(attrs.height.nodeValue); + el.style.height = attrs.height.nodeValue + 'px'; + } else { + el.height = el.clientHeight; + } + //el.getContext().setCoordsize_() + } + return el; + } + }; + + function onPropertyChange(e) { + var el = e.srcElement; + + switch (e.propertyName) { + case 'width': + el.getContext().clearRect(); + el.style.width = el.attributes.width.nodeValue + 'px'; + // In IE8 this does not trigger onresize. + el.firstChild.style.width = el.clientWidth + 'px'; + break; + case 'height': + el.getContext().clearRect(); + el.style.height = el.attributes.height.nodeValue + 'px'; + el.firstChild.style.height = el.clientHeight + 'px'; + break; + } + } + + function onResize(e) { + var el = e.srcElement; + if (el.firstChild) { + el.firstChild.style.width = el.clientWidth + 'px'; + el.firstChild.style.height = el.clientHeight + 'px'; + } + } + + G_vmlCanvasManager_.init(); + + // precompute "00" to "FF" + var decToHex = []; + for (var i = 0; i < 16; i++) { + for (var j = 0; j < 16; j++) { + decToHex[i * 16 + j] = i.toString(16) + j.toString(16); + } + } + + function createMatrixIdentity() { + return [ + [1, 0, 0], + [0, 1, 0], + [0, 0, 1] + ]; + } + + function matrixMultiply(m1, m2) { + var result = createMatrixIdentity(); + + for (var x = 0; x < 3; x++) { + for (var y = 0; y < 3; y++) { + var sum = 0; + + for (var z = 0; z < 3; z++) { + sum += m1[x][z] * m2[z][y]; + } + + result[x][y] = sum; + } + } + return result; + } + + function copyState(o1, o2) { + o2.fillStyle = o1.fillStyle; + o2.lineCap = o1.lineCap; + o2.lineJoin = o1.lineJoin; + o2.lineWidth = o1.lineWidth; + o2.miterLimit = o1.miterLimit; + o2.shadowBlur = o1.shadowBlur; + o2.shadowColor = o1.shadowColor; + o2.shadowOffsetX = o1.shadowOffsetX; + o2.shadowOffsetY = o1.shadowOffsetY; + o2.strokeStyle = o1.strokeStyle; + o2.globalAlpha = o1.globalAlpha; + o2.font = o1.font; + o2.textAlign = o1.textAlign; + o2.textBaseline = o1.textBaseline; + o2.arcScaleX_ = o1.arcScaleX_; + o2.arcScaleY_ = o1.arcScaleY_; + o2.lineScale_ = o1.lineScale_; + } + + // var colorData = { + // aliceblue: '#F0F8FF', + // antiquewhite: '#FAEBD7', + // aquamarine: '#7FFFD4', + // azure: '#F0FFFF', + // beige: '#F5F5DC', + // bisque: '#FFE4C4', + // black: '#000000', + // blanchedalmond: '#FFEBCD', + // 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', + // darkgreen: '#006400', + // darkgrey: '#A9A9A9', + // 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', + // gainsboro: '#DCDCDC', + // ghostwhite: '#F8F8FF', + // gold: '#FFD700', + // goldenrod: '#DAA520', + // grey: '#808080', + // 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', + // lightgreen: '#90EE90', + // lightgrey: '#D3D3D3', + // lightpink: '#FFB6C1', + // lightsalmon: '#FFA07A', + // lightseagreen: '#20B2AA', + // lightskyblue: '#87CEFA', + // lightslategray: '#778899', + // lightslategrey: '#778899', + // lightsteelblue: '#B0C4DE', + // lightyellow: '#FFFFE0', + // limegreen: '#32CD32', + // linen: '#FAF0E6', + // magenta: '#FF00FF', + // mediumaquamarine: '#66CDAA', + // mediumblue: '#0000CD', + // mediumorchid: '#BA55D3', + // mediumpurple: '#9370DB', + // mediumseagreen: '#3CB371', + // mediumslateblue: '#7B68EE', + // mediumspringgreen: '#00FA9A', + // mediumturquoise: '#48D1CC', + // mediumvioletred: '#C71585', + // midnightblue: '#191970', + // mintcream: '#F5FFFA', + // mistyrose: '#FFE4E1', + // moccasin: '#FFE4B5', + // navajowhite: '#FFDEAD', + // oldlace: '#FDF5E6', + // olivedrab: '#6B8E23', + // orange: '#FFA500', + // orangered: '#FF4500', + // orchid: '#DA70D6', + // palegoldenrod: '#EEE8AA', + // palegreen: '#98FB98', + // paleturquoise: '#AFEEEE', + // palevioletred: '#DB7093', + // papayawhip: '#FFEFD5', + // peachpuff: '#FFDAB9', + // peru: '#CD853F', + // pink: '#FFC0CB', + // plum: '#DDA0DD', + // powderblue: '#B0E0E6', + // rosybrown: '#BC8F8F', + // royalblue: '#4169E1', + // saddlebrown: '#8B4513', + // salmon: '#FA8072', + // sandybrown: '#F4A460', + // seagreen: '#2E8B57', + // seashell: '#FFF5EE', + // sienna: '#A0522D', + // skyblue: '#87CEEB', + // slateblue: '#6A5ACD', + // slategray: '#708090', + // slategrey: '#708090', + // snow: '#FFFAFA', + // springgreen: '#00FF7F', + // steelblue: '#4682B4', + // tan: '#D2B48C', + // thistle: '#D8BFD8', + // tomato: '#FF6347', + // turquoise: '#40E0D0', + // violet: '#EE82EE', + // wheat: '#F5DEB3', + // whitesmoke: '#F5F5F5', + // yellowgreen: '#9ACD32' + // }; + + + function getRgbHslContent(styleString) { + var start = styleString.indexOf('(', 3); + var end = styleString.indexOf(')', start + 1); + var parts = styleString.substring(start + 1, end).split(','); + // add alpha if needed + if (parts.length != 4 || styleString.charAt(3) != 'a') { + parts[3] = 1; + } + return parts; + } + + function percent(s) { + return parseFloat(s) / 100; + } + + function clamp(v, min, max) { + return Math.min(max, Math.max(min, v)); + } + + function hslToRgb(parts) { + var r, g, b, h, s, l; + h = parseFloat(parts[0]) / 360 % 360; + if (h < 0) + h++; + s = clamp(percent(parts[1]), 0, 1); + l = clamp(percent(parts[2]), 0, 1); + if (s == 0) { + r = g = b = l; // achromatic + } else { + var q = l < 0.5 ? l * (1 + s) : l + s - l * s; + var p = 2 * l - q; + r = hueToRgb(p, q, h + 1 / 3); + g = hueToRgb(p, q, h); + b = hueToRgb(p, q, h - 1 / 3); + } + + return '#' + decToHex[Math.floor(r * 255)] + + decToHex[Math.floor(g * 255)] + + decToHex[Math.floor(b * 255)]; + } + + function hueToRgb(m1, m2, h) { + if (h < 0) + h++; + if (h > 1) + h--; + + if (6 * h < 1) + return m1 + (m2 - m1) * 6 * h; + else if (2 * h < 1) + return m2; + else if (3 * h < 2) + return m1 + (m2 - m1) * (2 / 3 - h) * 6; + else + return m1; + } + + var processStyleCache = {}; + + function processStyle(styleString) { + if (styleString in processStyleCache) { + return processStyleCache[styleString]; + } + + var str, alpha = 1; + + styleString = String(styleString); + if (styleString.charAt(0) == '#') { + str = styleString; + } else if (/^rgb/.test(styleString)) { + var parts = getRgbHslContent(styleString); + var str = '#', n; + for (var i = 0; i < 3; i++) { + if (parts[i].indexOf('%') != -1) { + n = Math.floor(percent(parts[i]) * 255); + } else { + n = +parts[i]; + } + str += decToHex[clamp(n, 0, 255)]; + } + alpha = +parts[3]; + } else if (/^hsl/.test(styleString)) { + var parts = getRgbHslContent(styleString); + str = hslToRgb(parts); + alpha = parts[3]; + } else { + str = /*colorData[styleString] ||*/styleString; + } + return processStyleCache[styleString] = { color: str, alpha: alpha }; + } + + var DEFAULT_STYLE = { + style: 'normal', + variant: 'normal', + weight: 'normal', + size: 10, + family: 'sans-serif' + }; + + // Internal text style cache + // var fontStyleCache = {}; + + // function processFontStyle(styleString) { + // if (fontStyleCache[styleString]) { + // return fontStyleCache[styleString]; + // } + + // var el = document.createElement('div'); + // var style = el.style; + // try { + // style.font = styleString; + // } catch (ex) { + // // Ignore failures to set to invalid font. + // } + + // return fontStyleCache[styleString] = { + // style: style.fontStyle || DEFAULT_STYLE.style, + // variant: style.fontVariant || DEFAULT_STYLE.variant, + // weight: style.fontWeight || DEFAULT_STYLE.weight, + // size: style.fontSize || DEFAULT_STYLE.size, + // family: style.fontFamily || DEFAULT_STYLE.family + // }; + // } + + // function getComputedStyle(style, element) { + // var computedStyle = {}; + + // for (var p in style) { + // computedStyle[p] = style[p]; + // } + + // // Compute the size + // var canvasFontSize = parseFloat(element.currentStyle.fontSize), + // fontSize = parseFloat(style.size); + + // if (typeof style.size == 'number') { + // computedStyle.size = style.size; + // } else if (style.size.indexOf('px') != -1) { + // computedStyle.size = fontSize; + // } else if (style.size.indexOf('em') != -1) { + // computedStyle.size = canvasFontSize * fontSize; + // } else if(style.size.indexOf('%') != -1) { + // computedStyle.size = (canvasFontSize / 100) * fontSize; + // } else if (style.size.indexOf('pt') != -1) { + // computedStyle.size = fontSize / .75; + // } else { + // computedStyle.size = canvasFontSize; + // } + + // // Different scaling between normal text and VML text. This was found using + // // trial and error to get the same size as non VML text. + // computedStyle.size *= 0.981; + + // return computedStyle; + // } + + // function buildStyle(style) { + // return style.style + ' ' + style.variant + ' ' + style.weight + ' ' + + // style.size + 'px ' + style.family; + // } + + var lineCapMap = { + 'butt': 'flat', + 'round': 'round' + }; + + function processLineCap(lineCap) { + return lineCapMap[lineCap] || 'square'; + } + + /** + * This class implements CanvasRenderingContext2D interface as described by + * the WHATWG. + * @param {HTMLElement} canvasElement The element that the 2D context should + * be associated with + */ + function CanvasRenderingContext2D_(canvasElement) { + this.m_ = createMatrixIdentity(); + + this.mStack_ = []; + this.aStack_ = []; + this.currentPath_ = []; + + // Canvas context properties + this.strokeStyle = '#000'; + this.fillStyle = '#000'; + + this.lineWidth = 1; + this.lineJoin = 'miter'; + this.lineCap = 'butt'; + this.miterLimit = Z * 1; + this.globalAlpha = 1; + //this.font = '10px sans-serif'; + //this.textAlign = 'left'; + //this.textBaseline = 'alphabetic'; + this.canvas = canvasElement; + + var cssText = 'width:' + canvasElement.clientWidth + 'px;height:' + + canvasElement.clientHeight + 'px;overflow:hidden;position:absolute'; + var el = canvasElement.ownerDocument.createElement('div'); + el.style.cssText = cssText; + canvasElement.appendChild(el); + + var overlayEl = el.cloneNode(false); + // Use a non transparent background. + overlayEl.style.backgroundColor = 'red'; + overlayEl.style.filter = 'alpha(opacity=0)'; + canvasElement.appendChild(overlayEl); + + this.element_ = el; + this.arcScaleX_ = 1; + this.arcScaleY_ = 1; + this.lineScale_ = 1; + } + + var contextPrototype = CanvasRenderingContext2D_.prototype; + contextPrototype.clearRect = function () { + if (this.textMeasureEl_) { + this.textMeasureEl_.removeNode(true); + this.textMeasureEl_ = null; + } + this.element_.innerHTML = ''; + }; + + contextPrototype.beginPath = function () { + // TODO: Branch current matrix so that save/restore has no effect + // as per safari docs. + this.currentPath_ = []; + }; + + contextPrototype.moveTo = function (aX, aY) { + var p = getCoords(this, aX, aY); + this.currentPath_.push({ type: 'moveTo', x: p.x, y: p.y }); + this.currentX_ = p.x; + this.currentY_ = p.y; + }; + + contextPrototype.lineTo = function (aX, aY) { + var p = getCoords(this, aX, aY); + this.currentPath_.push({ type: 'lineTo', x: p.x, y: p.y }); + + this.currentX_ = p.x; + this.currentY_ = p.y; + }; + + contextPrototype.bezierCurveTo = function(aCP1x, aCP1y, + aCP2x, aCP2y, + aX, aY) { + var p = getCoords(this, aX, aY); + var cp1 = getCoords(this, aCP1x, aCP1y); + var cp2 = getCoords(this, aCP2x, aCP2y); + bezierCurveTo(this, cp1, cp2, p); + }; + + // Helper function that takes the already fixed cordinates. + function bezierCurveTo(self, cp1, cp2, p) { + self.currentPath_.push({ + type: 'bezierCurveTo', + cp1x: cp1.x, + cp1y: cp1.y, + cp2x: cp2.x, + cp2y: cp2.y, + x: p.x, + y: p.y + }); + self.currentX_ = p.x; + self.currentY_ = p.y; + } + + contextPrototype.quadraticCurveTo = function(aCPx, aCPy, aX, aY) { + // the following is lifted almost directly from + // http://developer.mozilla.org/en/docs/Canvas_tutorial:Drawing_shapes + + var cp = getCoords(this, aCPx, aCPy); + var p = getCoords(this, aX, aY); + + var cp1 = { + x: this.currentX_ + 2.0 / 3.0 * (cp.x - this.currentX_), + y: this.currentY_ + 2.0 / 3.0 * (cp.y - this.currentY_) + }; + var cp2 = { + x: cp1.x + (p.x - this.currentX_) / 3.0, + y: cp1.y + (p.y - this.currentY_) / 3.0 + }; + + bezierCurveTo(this, cp1, cp2, p); + }; + + contextPrototype.arc = function (aX, aY, aRadius, + aStartAngle, aEndAngle, aClockwise) { + aRadius *= Z; + var arcType = aClockwise ? 'at' : 'wa'; + + var xStart = aX + mc(aStartAngle) * aRadius - Z2; + var yStart = aY + ms(aStartAngle) * aRadius - Z2; + + var xEnd = aX + mc(aEndAngle) * aRadius - Z2; + var yEnd = aY + ms(aEndAngle) * aRadius - Z2; + + // IE won't render arches drawn counter clockwise if xStart == xEnd. + if (xStart == xEnd && !aClockwise) { + xStart += 0.125; // Offset xStart by 1/80 of a pixel. Use something + // that can be represented in binary + } + + var p = getCoords(this, aX, aY); + var pStart = getCoords(this, xStart, yStart); + var pEnd = getCoords(this, xEnd, yEnd); + + this.currentPath_.push({ type: arcType, + x: p.x, + y: p.y, + radius: aRadius, + xStart: pStart.x, + yStart: pStart.y, + xEnd: pEnd.x, + yEnd: pEnd.y + }); + + }; + + // contextPrototype.rect = function(aX, aY, aWidth, aHeight) { + // this.moveTo(aX, aY); + // this.lineTo(aX + aWidth, aY); + // this.lineTo(aX + aWidth, aY + aHeight); + // this.lineTo(aX, aY + aHeight); + // this.closePath(); + // }; + + // contextPrototype.strokeRect = function(aX, aY, aWidth, aHeight) { + // var oldPath = this.currentPath_; + // this.beginPath(); + + // this.moveTo(aX, aY); + // this.lineTo(aX + aWidth, aY); + // this.lineTo(aX + aWidth, aY + aHeight); + // this.lineTo(aX, aY + aHeight); + // this.closePath(); + // this.stroke(); + + // this.currentPath_ = oldPath; + // }; + + // contextPrototype.fillRect = function(aX, aY, aWidth, aHeight) { + // var oldPath = this.currentPath_; + // this.beginPath(); + + // this.moveTo(aX, aY); + // this.lineTo(aX + aWidth, aY); + // this.lineTo(aX + aWidth, aY + aHeight); + // this.lineTo(aX, aY + aHeight); + // this.closePath(); + // this.fill(); + + // this.currentPath_ = oldPath; + // }; + + // contextPrototype.createLinearGradient = function(aX0, aY0, aX1, aY1) { + // var gradient = new CanvasGradient_('gradient'); + // gradient.x0_ = aX0; + // gradient.y0_ = aY0; + // gradient.x1_ = aX1; + // gradient.y1_ = aY1; + // return gradient; + // }; + + // contextPrototype.createRadialGradient = function(aX0, aY0, aR0, + // aX1, aY1, aR1) { + // var gradient = new CanvasGradient_('gradientradial'); + // gradient.x0_ = aX0; + // gradient.y0_ = aY0; + // gradient.r0_ = aR0; + // gradient.x1_ = aX1; + // gradient.y1_ = aY1; + // gradient.r1_ = aR1; + // return gradient; + // }; + + // contextPrototype.drawImage = function(image, var_args) { + // var dx, dy, dw, dh, sx, sy, sw, sh; + + // // to find the original width we overide the width and height + // var oldRuntimeWidth = image.runtimeStyle.width; + // var oldRuntimeHeight = image.runtimeStyle.height; + // image.runtimeStyle.width = 'auto'; + // image.runtimeStyle.height = 'auto'; + + // // get the original size + // var w = image.width; + // var h = image.height; + + // // and remove overides + // image.runtimeStyle.width = oldRuntimeWidth; + // image.runtimeStyle.height = oldRuntimeHeight; + + // if (arguments.length == 3) { + // dx = arguments[1]; + // dy = arguments[2]; + // sx = sy = 0; + // sw = dw = w; + // sh = dh = h; + // } else if (arguments.length == 5) { + // dx = arguments[1]; + // dy = arguments[2]; + // dw = arguments[3]; + // dh = arguments[4]; + // sx = sy = 0; + // sw = w; + // sh = h; + // } else if (arguments.length == 9) { + // sx = arguments[1]; + // sy = arguments[2]; + // sw = arguments[3]; + // sh = arguments[4]; + // dx = arguments[5]; + // dy = arguments[6]; + // dw = arguments[7]; + // dh = arguments[8]; + // } else { + // throw Error('Invalid number of arguments'); + // } + + // var d = getCoords(this, dx, dy); + + // var w2 = sw / 2; + // var h2 = sh / 2; + + // var vmlStr = []; + + // var W = 10; + // var H = 10; + + // // For some reason that I've now forgotten, using divs didn't work + // vmlStr.push(' ' , + // '', + // ''); + + // this.element_.insertAdjacentHTML('BeforeEnd', vmlStr.join('')); + // }; + + contextPrototype.stroke = function (aFill) { + var lineStr = []; + var lineOpen = false; + + var W = 10; + var H = 10; + + lineStr.push(''); + + if (!aFill) { + appendStroke(this, lineStr); + } else { + appendFill(this, lineStr, min, max); + } + + lineStr.push(''); + + this.element_.insertAdjacentHTML('beforeEnd', lineStr.join('')); + }; + + function appendStroke(ctx, lineStr) { + var a = processStyle(ctx.strokeStyle); + var color = a.color; + var opacity = a.alpha * ctx.globalAlpha; + var lineWidth = ctx.lineScale_ * ctx.lineWidth; + + // VML cannot correctly render a line if the width is less than 1px. + // In that case, we dilute the color to make the line look thinner. + if (lineWidth < 1) { + opacity *= lineWidth; + } + + lineStr.push( + '' + ); + } + + function appendFill(ctx, lineStr, min, max) { + var fillStyle = ctx.fillStyle; + var arcScaleX = ctx.arcScaleX_; + var arcScaleY = ctx.arcScaleY_; + var width = max.x - min.x; + var height = max.y - min.y; + // if (fillStyle instanceof CanvasGradient_) { + // // TODO: Gradients transformed with the transformation matrix. + // var angle = 0; + // var focus = {x: 0, y: 0}; + + // // additional offset + // var shift = 0; + // // scale factor for offset + // var expansion = 1; + + // if (fillStyle.type_ == 'gradient') { + // var x0 = fillStyle.x0_ / arcScaleX; + // var y0 = fillStyle.y0_ / arcScaleY; + // var x1 = fillStyle.x1_ / arcScaleX; + // var y1 = fillStyle.y1_ / arcScaleY; + // var p0 = getCoords(ctx, x0, y0); + // var p1 = getCoords(ctx, x1, y1); + // var dx = p1.x - p0.x; + // var dy = p1.y - p0.y; + // angle = Math.atan2(dx, dy) * 180 / Math.PI; + + // // The angle should be a non-negative number. + // if (angle < 0) { + // angle += 360; + // } + + // // Very small angles produce an unexpected result because they are + // // converted to a scientific notation string. + // if (angle < 1e-6) { + // angle = 0; + // } + // } else { + // var p0 = getCoords(ctx, fillStyle.x0_, fillStyle.y0_); + // focus = { + // x: (p0.x - min.x) / width, + // y: (p0.y - min.y) / height + // }; + + // width /= arcScaleX * Z; + // height /= arcScaleY * Z; + // var dimension = m.max(width, height); + // shift = 2 * fillStyle.r0_ / dimension; + // expansion = 2 * fillStyle.r1_ / dimension - shift; + // } + + // // We need to sort the color stops in ascending order by offset, + // // otherwise IE won't interpret it correctly. + // var stops = fillStyle.colors_; + // stops.sort(function(cs1, cs2) { + // return cs1.offset - cs2.offset; + // }); + + // var length = stops.length; + // var color1 = stops[0].color; + // var color2 = stops[length - 1].color; + // var opacity1 = stops[0].alpha * ctx.globalAlpha; + // var opacity2 = stops[length - 1].alpha * ctx.globalAlpha; + + // var colors = []; + // for (var i = 0; i < length; i++) { + // var stop = stops[i]; + // colors.push(stop.offset * expansion + shift + ' ' + stop.color); + // } + + // // When colors attribute is used, the meanings of opacity and o:opacity2 + // // are reversed. + // lineStr.push(''); + // } else if (fillStyle instanceof CanvasPattern_) { + // if (width && height) { + // var deltaLeft = -min.x; + // var deltaTop = -min.y; + // lineStr.push(''); + // } + // } else { + var a = processStyle(ctx.fillStyle); + var color = a.color; + var opacity = a.alpha * ctx.globalAlpha; + lineStr.push(''); + // } + } + + contextPrototype.fill = function () { + this.stroke(true); + }; + + contextPrototype.closePath = function () { + this.currentPath_.push({ type: 'close' }); + }; + + function getCoords(ctx, aX, aY) { + var m = ctx.m_; + return { + x: Z * (aX * m[0][0] + aY * m[1][0] + m[2][0]) - Z2, + y: Z * (aX * m[0][1] + aY * m[1][1] + m[2][1]) - Z2 + }; + }; + + contextPrototype.save = function () { + var o = {}; + copyState(this, o); + this.aStack_.push(o); + this.mStack_.push(this.m_); + this.m_ = matrixMultiply(createMatrixIdentity(), this.m_); + }; + + contextPrototype.restore = function () { + if (this.aStack_.length) { + copyState(this.aStack_.pop(), this); + this.m_ = this.mStack_.pop(); + } + }; + + function matrixIsFinite(m) { + return isFinite(m[0][0]) && isFinite(m[0][1]) && + isFinite(m[1][0]) && isFinite(m[1][1]) && + isFinite(m[2][0]) && isFinite(m[2][1]); + } + + function setM(ctx, m, updateLineScale) { + if (!matrixIsFinite(m)) { + return; + } + ctx.m_ = m; + + if (updateLineScale) { + // Get the line scale. + // Determinant of this.m_ means how much the area is enlarged by the + // transformation. So its square root can be used as a scale factor + // for width. + var det = m[0][0] * m[1][1] - m[0][1] * m[1][0]; + ctx.lineScale_ = sqrt(abs(det)); + } + } + + contextPrototype.translate = function (aX, aY) { + var m1 = [ + [1, 0, 0], + [0, 1, 0], + [aX, aY, 1] + ]; + + setM(this, matrixMultiply(m1, this.m_), false); + }; + + // contextPrototype.rotate = function(aRot) { + // var c = mc(aRot); + // var s = ms(aRot); + + // var m1 = [ + // [c, s, 0], + // [-s, c, 0], + // [0, 0, 1] + // ]; + + // setM(this, matrixMultiply(m1, this.m_), false); + // }; + + contextPrototype.scale = function (aX, aY) { + this.arcScaleX_ *= aX; + this.arcScaleY_ *= aY; + var m1 = [ + [aX, 0, 0], + [0, aY, 0], + [0, 0, 1] + ]; + + setM(this, matrixMultiply(m1, this.m_), true); + }; + + // contextPrototype.transform = function(m11, m12, m21, m22, dx, dy) { + // var m1 = [ + // [m11, m12, 0], + // [m21, m22, 0], + // [dx, dy, 1] + // ]; + + // setM(this, matrixMultiply(m1, this.m_), true); + // }; + + // contextPrototype.setTransform = function(m11, m12, m21, m22, dx, dy) { + // var m = [ + // [m11, m12, 0], + // [m21, m22, 0], + // [dx, dy, 1] + // ]; + + // setM(this, m, true); + // }; + + /** + * The text drawing function. + * The maxWidth argument isn't taken in account, since no browser supports + * it yet. + */ + // contextPrototype.drawText_ = function(text, x, y, maxWidth, stroke) { + // var m = this.m_, + // delta = 1000, + // left = 0, + // right = delta, + // offset = {x: 0, y: 0}, + // lineStr = []; + + // var fontStyle = getComputedStyle(processFontStyle(this.font), + // this.element_); + + // var fontStyleString = buildStyle(fontStyle); + + // var elementStyle = this.element_.currentStyle; + // var textAlign = this.textAlign.toLowerCase(); + // switch (textAlign) { + // case 'left': + // case 'center': + // case 'right': + // break; + // case 'end': + // textAlign = elementStyle.direction == 'ltr' ? 'right' : 'left'; + // break; + // case 'start': + // textAlign = elementStyle.direction == 'rtl' ? 'right' : 'left'; + // break; + // default: + // textAlign = 'left'; + // } + + // // 1.75 is an arbitrary number, as there is no info about the text baseline + // switch (this.textBaseline) { + // case 'hanging': + // case 'top': + // offset.y = fontStyle.size / 1.75; + // break; + // case 'middle': + // break; + // default: + // case null: + // case 'alphabetic': + // case 'ideographic': + // case 'bottom': + // offset.y = -fontStyle.size / 2.25; + // break; + // } + + // switch(textAlign) { + // case 'right': + // left = delta; + // right = 0.05; + // break; + // case 'center': + // left = right = delta / 2; + // break; + // } + + // var d = getCoords(this, x + offset.x, y + offset.y); + + // lineStr.push(''); + + // if (stroke) { + // appendStroke(this, lineStr); + // } else { + // // TODO: Fix the min and max params. + // appendFill(this, lineStr, {x: -left, y: 0}, + // {x: right, y: fontStyle.size}); + // } + + // var skewM = m[0][0].toFixed(3) + ',' + m[1][0].toFixed(3) + ',' + + // m[0][1].toFixed(3) + ',' + m[1][1].toFixed(3) + ',0,0'; + + // var skewOffset = mr(d.x / Z) + ',' + mr(d.y / Z); + + // lineStr.push('', + // '', + // ''); + + // this.element_.insertAdjacentHTML('beforeEnd', lineStr.join('')); + // }; + + // contextPrototype.fillText = function(text, x, y, maxWidth) { + // this.drawText_(text, x, y, maxWidth, false); + // }; + + // contextPrototype.strokeText = function(text, x, y, maxWidth) { + // this.drawText_(text, x, y, maxWidth, true); + // }; + + // contextPrototype.measureText = function(text) { + // if (!this.textMeasureEl_) { + // var s = ''; + // this.element_.insertAdjacentHTML('beforeEnd', s); + // this.textMeasureEl_ = this.element_.lastChild; + // } + // var doc = this.element_.ownerDocument; + // this.textMeasureEl_.innerHTML = ''; + // this.textMeasureEl_.style.font = this.font; + // // Don't use innerHTML or innerText because they allow markup/whitespace. + // this.textMeasureEl_.appendChild(doc.createTextNode(text)); + // return {width: this.textMeasureEl_.offsetWidth}; + // }; + + /******** STUBS ********/ + // contextPrototype.clip = function() { + // // TODO: Implement + // }; + + // contextPrototype.arcTo = function() { + // // TODO: Implement + // }; + + // contextPrototype.createPattern = function(image, repetition) { + // return new CanvasPattern_(image, repetition); + // }; + + // // Gradient / Pattern Stubs + // function CanvasGradient_(aType) { + // this.type_ = aType; + // this.x0_ = 0; + // this.y0_ = 0; + // this.r0_ = 0; + // this.x1_ = 0; + // this.y1_ = 0; + // this.r1_ = 0; + // this.colors_ = []; + // } + + // CanvasGradient_.prototype.addColorStop = function(aOffset, aColor) { + // aColor = processStyle(aColor); + // this.colors_.push({offset: aOffset, + // color: aColor.color, + // alpha: aColor.alpha}); + // }; + + // function CanvasPattern_(image, repetition) { + // assertImageIsValid(image); + // switch (repetition) { + // case 'repeat': + // case null: + // case '': + // this.repetition_ = 'repeat'; + // break + // case 'repeat-x': + // case 'repeat-y': + // case 'no-repeat': + // this.repetition_ = repetition; + // break; + // default: + // throwException('SYNTAX_ERR'); + // } + + // this.src_ = image.src; + // this.width_ = image.width; + // this.height_ = image.height; + // } + + function throwException(s) { + throw new DOMException_(s); + } + + // function assertImageIsValid(img) { + // if (!img || img.nodeType != 1 || img.tagName != 'IMG') { + // throwException('TYPE_MISMATCH_ERR'); + // } + // if (img.readyState != 'complete') { + // throwException('INVALID_STATE_ERR'); + // } + // } + + function DOMException_(s) { + this.code = this[s]; + this.message = s + ': DOM Exception ' + this.code; + } + var p = DOMException_.prototype = new Error; + p.INDEX_SIZE_ERR = 1; + p.DOMSTRING_SIZE_ERR = 2; + p.HIERARCHY_REQUEST_ERR = 3; + p.WRONG_DOCUMENT_ERR = 4; + p.INVALID_CHARACTER_ERR = 5; + p.NO_DATA_ALLOWED_ERR = 6; + p.NO_MODIFICATION_ALLOWED_ERR = 7; + p.NOT_FOUND_ERR = 8; + p.NOT_SUPPORTED_ERR = 9; + p.INUSE_ATTRIBUTE_ERR = 10; + p.INVALID_STATE_ERR = 11; + p.SYNTAX_ERR = 12; + p.INVALID_MODIFICATION_ERR = 13; + p.NAMESPACE_ERR = 14; + p.INVALID_ACCESS_ERR = 15; + p.VALIDATION_ERR = 16; + p.TYPE_MISMATCH_ERR = 17; + + // set up externs + G_vmlCanvasManager = G_vmlCanvasManager_; + CanvasRenderingContext2D = CanvasRenderingContext2D_; + //CanvasGradient = CanvasGradient_; + //CanvasPattern = CanvasPattern_; + DOMException = DOMException_; + })(); + +} // if diff --git a/libs/js/jquery-geo-1.0a4/js/jquery.geo.core.js b/libs/js/jquery-geo-1.0a4/js/jquery.geo.core.js new file mode 100755 index 0000000..28f7e08 --- /dev/null +++ b/libs/js/jquery-geo-1.0a4/js/jquery.geo.core.js @@ -0,0 +1,1002 @@ +(function ($, window, undefined) { + var pos_oo = Number.POSITIVE_INFINITY, + neg_oo = Number.NEGATIVE_INFINITY; + + $.geo = { + // + // utility functions + // + + _allCoordinates: function (geom) { + // return array of all positions in all geometries of geom + // not in JTS + var geometries = this._flatten(geom), + curGeom = 0, + result = []; + + for (; curGeom < geometries.length; curGeom++) { + var coordinates = geometries[curGeom].coordinates, + isArray = coordinates && $.isArray(coordinates[0]), + isDblArray = isArray && $.isArray(coordinates[0][0]), + isTriArray = isDblArray && $.isArray(coordinates[0][0][0]), + i, j, k; + + if (!isTriArray) { + if (!isDblArray) { + if (!isArray) { + coordinates = [coordinates]; + } + coordinates = [coordinates]; + } + coordinates = [coordinates]; + } + + for (i = 0; i < coordinates.length; i++) { + for (j = 0; j < coordinates[i].length; j++) { + for (k = 0; k < coordinates[i][j].length; k++) { + result.push(coordinates[i][j][k]); + } + } + } + } + return result; + }, + + _isGeodetic: function( coords ) { + // returns true if the first coordinate it can find is geodetic + + while ( $.isArray( coords ) ) { + if ( coords.length > 1 && ! $.isArray( coords[ 0 ] ) ) { + return ( coords[ 0 ] >= -180 && coords[ 0 ] <= 180 && coords[ 1 ] >= -85 && coords[ 1 ] <= 85 ); + } else { + coords = coords[ 0 ]; + } + } + + return false; + }, + + // + // bbox functions + // + + center: function (bbox, _ignoreGeo /* Internal Use Only */) { + // Envelope.centre in JTS + // bbox only, use centroid for geom + var wasGeodetic = false; + if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( bbox ) ) { + wasGeodetic = true; + bbox = $.geo.proj.fromGeodetic(bbox); + } + + var center = [(bbox[0] + bbox[2]) / 2, (bbox[1] + bbox[3]) / 2]; + return wasGeodetic ? $.geo.proj.toGeodetic(center) : center; + }, + + expandBy: function (bbox, dx, dy, _ignoreGeo /* Internal Use Only */) { + var wasGeodetic = false; + if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( bbox ) ) { + wasGeodetic = true; + bbox = $.geo.proj.fromGeodetic(bbox); + } + + bbox = [bbox[0] - dx, bbox[1] - dy, bbox[2] + dx, bbox[3] + dy]; + return wasGeodetic ? $.geo.proj.toGeodetic(bbox) : bbox; + }, + + height: function (bbox, _ignoreGeo /* Internal Use Only */ ) { + if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( bbox ) ) { + bbox = $.geo.proj.fromGeodetic(bbox); + } + + return bbox[3] - bbox[1]; + }, + + _in: function(bbox1, bbox2) { + return bbox1[0] <= bbox2[0] && + bbox1[1] <= bbox2[1] && + bbox1[2] >= bbox2[2] && + bbox1[3] >= bbox2[3]; + }, + + _bboxDisjoint: function( bbox1, bbox2 ) { + return bbox2[ 0 ] > bbox1[ 2 ] || + bbox2[ 2 ] < bbox1[ 0 ] || + bbox2[ 1 ] > bbox1[ 3 ] || + bbox2[ 3 ] < bbox1[ 1 ]; + }, + + reaspect: function (bbox, ratio, _ignoreGeo /* Internal Use Only */ ) { + // not in JTS + var wasGeodetic = false; + if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( bbox ) ) { + wasGeodetic = true; + bbox = $.geo.proj.fromGeodetic(bbox); + } + + var width = this.width(bbox, true), + height = this.height(bbox, true), + center = this.center(bbox, true), + dx, dy; + + if (width != 0 && height != 0 && ratio > 0) { + if (width / height > ratio) { + dx = width / 2; + dy = dx / ratio; + } else { + dy = height / 2; + dx = dy * ratio; + } + + bbox = [center[0] - dx, center[1] - dy, center[0] + dx, center[1] + dy]; + } + + return wasGeodetic ? $.geo.proj.toGeodetic(bbox) : bbox; + }, + + recenter: function( bbox, center, _ignoreGeo /* Internal Use Only */ ) { + // not in JTS + var wasGeodetic = false; + if ( !_ignoreGeo && $.geo.proj ) { + if ( this._isGeodetic( bbox ) ) { + wasGeodetic = true; + bbox = $.geo.proj.fromGeodetic(bbox); + } + + if ( this._isGeodetic( center ) ) { + center = $.geo.proj.fromGeodetic(center); + } + } + + var halfWidth = ( bbox[ 2 ] - bbox[ 0 ] ) / 2, + halfHeight = ( bbox[ 3 ] - bbox[ 1 ] ) / 2; + + bbox = [ + center[ 0 ] - halfWidth, + center[ 1 ] - halfHeight, + center[ 0 ] + halfWidth, + center[ 1 ] + halfHeight + ]; + + return wasGeodetic ? $.geo.proj.toGeodetic(bbox) : bbox; + }, + + scaleBy: function ( bbox, scale, _ignoreGeo /* Internal Use Only */ ) { + // not in JTS + var wasGeodetic = false; + if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( bbox ) ) { + wasGeodetic = true; + bbox = $.geo.proj.fromGeodetic(bbox); + } + + var c = this.center(bbox, true), + dx = (bbox[2] - bbox[0]) * scale / 2, + dy = (bbox[3] - bbox[1]) * scale / 2; + + bbox = [c[0] - dx, c[1] - dy, c[0] + dx, c[1] + dy]; + + return wasGeodetic ? $.geo.proj.toGeodetic(bbox) : bbox; + }, + + width: function (bbox, _ignoreGeo /* Internal Use Only */ ) { + if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( bbox ) ) { + bbox = $.geo.proj.fromGeodetic(bbox); + } + + return bbox[2] - bbox[0]; + }, + + // + // geometry functions + // + + // bbox (Geometry.getEnvelope in JTS) + + bbox: function ( geom, _ignoreGeo /* Internal Use Only */ ) { + if ( !geom ) { + return undefined; + } else if ( geom.bbox ) { + result = ( !_ignoreGeo && $.geo.proj && this._isGeodetic( geom.bbox ) ) ? $.geo.proj.fromGeodetic( geom.bbox ) : geom.bbox; + } else { + result = [ pos_oo, pos_oo, neg_oo, neg_oo ]; + + var coordinates = this._allCoordinates( geom ), + curCoord = 0; + + if ( coordinates.length == 0 ) { + return undefined; + } + + var wasGeodetic = false; + if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( coordinates ) ) { + wasGeodetic = true; + coordinates = $.geo.proj.fromGeodetic( coordinates ); + } + + for ( ; curCoord < coordinates.length; curCoord++ ) { + result[0] = Math.min(coordinates[curCoord][0], result[0]); + result[1] = Math.min(coordinates[curCoord][1], result[1]); + result[2] = Math.max(coordinates[curCoord][0], result[2]); + result[3] = Math.max(coordinates[curCoord][1], result[3]); + } + } + + return wasGeodetic ? $.geo.proj.toGeodetic(result) : result; + }, + + // centroid + + centroid: function( geom, _ignoreGeo /* Internal Use Only */ ) { + switch (geom.type) { + case "Point": + return $.extend({}, geom); + + case "LineString": + case "Polygon": + var a = 0, + c = [0, 0], + coords = $.merge( [ ], geom.type == "Polygon" ? geom.coordinates[0] : geom.coordinates ), + i = 1, j, n; + + var wasGeodetic = false; + if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( coords ) ) { + wasGeodetic = true; + coords = $.geo.proj.fromGeodetic(coords); + } + + //if (coords[0][0] != coords[coords.length - 1][0] || coords[0][1] != coords[coords.length - 1][1]) { + // coords.push(coords[0]); + //} + + for (; i <= coords.length; i++) { + j = i % coords.length; + n = (coords[i - 1][0] * coords[j][1]) - (coords[j][0] * coords[i - 1][1]); + a += n; + c[0] += (coords[i - 1][0] + coords[j][0]) * n; + c[1] += (coords[i - 1][1] + coords[j][1]) * n; + } + + if (a == 0) { + if (coords.length > 0) { + c[0] = coords[0][0]; + c[1] = coords[0][1]; + return { type: "Point", coordinates: wasGeodetic ? $.geo.proj.toGeodetic(c) : c }; + } else { + return undefined; + } + } + + a *= 3; + c[0] /= a; + c[1] /= a; + + return { type: "Point", coordinates: wasGeodetic ? $.geo.proj.toGeodetic(c) : c }; + } + return undefined; + }, + + // contains + + contains: function (geom1, geom2) { + if (geom1.type != "Polygon") { + return false; + } + + switch (geom2.type) { + case "Point": + return this._containsPolygonPoint(geom1.coordinates, geom2.coordinates); + + case "LineString": + return this._containsPolygonLineString(geom1.coordinates, geom2.coordinates); + + case "Polygon": + return this._containsPolygonLineString(geom1.coordinates, geom2.coordinates[0]); + + default: + return false; + } + }, + + _containsPolygonPoint: function (polygonCoordinates, pointCoordinate) { + if (polygonCoordinates.length == 0 || polygonCoordinates[0].length < 4) { + return false; + } + + var rayCross = 0, + a = polygonCoordinates[0][0], + i = 1, + b, + x; + + for (; i < polygonCoordinates[0].length; i++) { + b = polygonCoordinates[0][i]; + + if ((a[1] <= pointCoordinate[1] && pointCoordinate[1] < b[1]) || (b[1] <= pointCoordinate[1] && pointCoordinate[1] < a[1]) && (pointCoordinate[0] < a[0] || pointCoordinate[0] < b[0])) { + x = a[0] + (b[0] - a[0]) * (pointCoordinate[1] - a[1]) / (b[1] - a[1]); + + if (x > pointCoordinate[0]) { + rayCross++; + } + } + + a = b; + } + + return rayCross % 2 == 1; + }, + + _containsPolygonLineString: function (polygonCoordinates, lineStringCoordinates) { + for (var i = 0; i < lineStringCoordinates.length; i++) { + if (!this._containsPolygonPoint(polygonCoordinates, lineStringCoordinates[i])) { + return false; + } + } + return true; + }, + + // distance + + distance: function ( geom1, geom2, _ignoreGeo /* Internal Use Only */ ) { + var geom1CoordinatesProjected = ( !_ignoreGeo && $.geo.proj && this._isGeodetic( geom1.coordinates ) ) ? $.geo.proj.fromGeodetic(geom1.coordinates) : geom1.coordinates, + geom2CoordinatesProjected = ( !_ignoreGeo && $.geo.proj && this._isGeodetic( geom2.coordinates ) ) ? $.geo.proj.fromGeodetic(geom2.coordinates) : geom2.coordinates; + + switch (geom1.type) { + case "Point": + switch (geom2.type) { + case "Point": + return this._distancePointPoint(geom2CoordinatesProjected, geom1CoordinatesProjected); + case "LineString": + return this._distanceLineStringPoint(geom2CoordinatesProjected, geom1CoordinatesProjected); + case "Polygon": + return this._containsPolygonPoint(geom2CoordinatesProjected, geom1CoordinatesProjected) ? 0 : this._distanceLineStringPoint(geom2CoordinatesProjected[0], geom1CoordinatesProjected); + default: + return undefined; + } + break; + + case "LineString": + switch (geom2.type) { + case "Point": + return this._distanceLineStringPoint(geom1CoordinatesProjected, geom2CoordinatesProjected); + case "LineString": + return this._distanceLineStringLineString(geom1CoordinatesProjected, geom2CoordinatesProjected); + case "Polygon": + return this._containsPolygonLineString(geom2CoordinatesProjected, geom1CoordinatesProjected) ? 0 : this._distanceLineStringLineString(geom2CoordinatesProjected[0], geom1CoordinatesProjected); + default: + return undefined; + } + break; + + case "Polygon": + switch (geom2.type) { + case "Point": + return this._containsPolygonPoint(geom1CoordinatesProjected, geom2CoordinatesProjected) ? 0 : this._distanceLineStringPoint(geom1CoordinatesProjected[0], geom2CoordinatesProjected); + case "LineString": + return this._containsPolygonLineString(geom1CoordinatesProjected, geom2CoordinatesProjected) ? 0 : this._distanceLineStringLineString(geom1CoordinatesProjected[0], geom2CoordinatesProjected); + case "Polygon": + return this._containsPolygonLineString(geom1CoordinatesProjected, geom2CoordinatesProjected[0]) ? 0 : this._distanceLineStringLineString(geom1CoordinatesProjected[0], geom2CoordinatesProjected[0]); + default: + return undefined; + } + break; + } + }, + + _distancePointPoint: function (coordinate1, coordinate2) { + var dx = coordinate2[0] - coordinate1[0], + dy = coordinate2[1] - coordinate1[1]; + return Math.sqrt((dx * dx) + (dy * dy)); + }, + + _distanceLineStringPoint: function (lineStringCoordinates, pointCoordinate) { + var minDist = pos_oo; + + if (lineStringCoordinates.length > 0) { + var a = lineStringCoordinates[0], + + apx = pointCoordinate[0] - a[0], + apy = pointCoordinate[1] - a[1]; + + if (lineStringCoordinates.length == 1) { + return Math.sqrt(apx * apx + apy * apy); + } else { + for (var i = 1; i < lineStringCoordinates.length; i++) { + var b = lineStringCoordinates[i], + + abx = b[0] - a[0], + aby = b[1] - a[1], + bpx = pointCoordinate[0] - b[0], + bpy = pointCoordinate[1] - b[1], + + d = this._distanceSegmentPoint(abx, aby, apx, apy, bpx, bpy); + + if (d == 0) { + return 0; + } + + if (d < minDist) { + minDist = d; + } + + a = b; + apx = bpx; + apy = bpy; + } + } + } + + return Math.sqrt(minDist); + }, + + _distanceSegmentPoint: function (abx, aby, apx, apy, bpx, bpy) { + var dot1 = abx * apx + aby * apy; + + if (dot1 <= 0) { + return apx * apx + apy * apy; + } + + var dot2 = abx * abx + aby * aby; + + if (dot1 >= dot2) { + return bpx * bpx + bpy * bpy; + } + + return apx * apx + apy * apy - dot1 * dot1 / dot2; + }, + + _distanceLineStringLineString: function (lineStringCoordinates1, lineStringCoordinates2) { + var minDist = pos_oo; + for (var i = 0; i < lineStringCoordinates2.length; i++) { + minDist = Math.min(minDist, this._distanceLineStringPoint(lineStringCoordinates1, lineStringCoordinates2[i])); + } + return minDist; + }, + + // buffer + + _buffer: function( geom, distance, _ignoreGeo /* Internal Use Only */ ) { + var wasGeodetic = false, + coords = geom.coordinates; + + if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( geom.coordinates ) ) { + wasGeodetic = true; + coords = $.geo.proj.fromGeodetic( geom.coordinates ); + } + + switch ( geom.type ) { + case "Point": + var resultCoords = [], + slices = 180, + i = 0, + a; + + for ( ; i <= slices; i++ ) { + a = ( i * 360 / slices ) * ( Math.PI / 180 ); + resultCoords.push( [ + coords[ 0 ] + Math.cos( a ) * distance, + coords[ 1 ] + Math.sin( a ) * distance + ] ); + } + + return { + type: "Polygon", + coordinates: [ ( wasGeodetic ? $.geo.proj.toGeodetic( resultCoords ) : resultCoords ) ] + }; + + break; + + default: + return undefined; + } + }, + + + // + // feature + // + + _flatten: function (geom) { + // return an array of all basic geometries + // not in JTS + var geometries = [], + curGeom = 0; + switch (geom.type) { + case "Feature": + $.merge(geometries, this._flatten(geom.geometry)); + break; + + case "FeatureCollection": + for (; curGeom < geom.features.length; curGeom++) { + $.merge(geometries, this._flatten(geom.features[curGeom].geometry)); + } + break; + + case "GeometryCollection": + for (; curGeom < geom.geometries.length; curGeom++) { + $.merge(geometries, this._flatten(geom.geometries[curGeom])); + } + break; + + default: + geometries[0] = geom; + break; + } + return geometries; + }, + + length: function( geom, _ignoreGeo /* Internal Use Only */ ) { + var sum = 0, + lineStringCoordinates, + i = 1, dx, dy; + + switch ( geom.type ) { + case "Point": + return 0; + + case "LineString": + lineStringCoordinates = geom.coordinates; + break; + + case "Polygon": + lineStringCoordinates = geom.coordinates[ 0 ]; + break; + } + + if ( lineStringCoordinates ) { + if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( lineStringCoordinates ) ) { + lineStringCoordinates = $.geo.proj.fromGeodetic( lineStringCoordinates ); + } + + for ( ; i < lineStringCoordinates.length; i++ ) { + dx = lineStringCoordinates[ i ][0] - lineStringCoordinates[ i - 1 ][0]; + dy = lineStringCoordinates[ i ][1] - lineStringCoordinates[ i - 1 ][1]; + sum += Math.sqrt((dx * dx) + (dy * dy)); + } + + return sum; + } + + // return undefined; + }, + + area: function( geom, _ignoreGeo /* Internal Use Only */ ) { + var sum = 0, + polygonCoordinates, + i = 1, j; + + switch ( geom.type ) { + case "Point": + case "LineString": + return 0; + + case "Polygon": + polygonCoordinates = geom.coordinates[ 0 ]; + break; + } + + if ( polygonCoordinates ) { + if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( polygonCoordinates ) ) { + polygonCoordinates = $.geo.proj.fromGeodetic( polygonCoordinates ); + } + + for ( ; i <= polygonCoordinates.length; i++) { + j = i % polygonCoordinates.length; + sum += ( polygonCoordinates[ i - 1 ][ 0 ] - polygonCoordinates[ j ][ 0 ] ) * ( polygonCoordinates[ i - 1 ][ 1 ] + polygonCoordinates[ j ][ 1 ] ) / 2; + } + + return Math.abs( sum ); + } + }, + + pointAlong: function( geom, percentage, _ignoreGeo /* Internal Use Only */ ) { + var totalLength = 0, + previousPercentageSum = 0, + percentageSum = 0, + remainderPercentageSum, + len, + lineStringCoordinates, + segmentLengths = [], + i = 1, dx, dy, + c, c0, c1, + wasGeodetic = false; + + switch ( geom.type ) { + case "Point": + return $.extend( { }, geom ); + + case "LineString": + lineStringCoordinates = geom.coordinates; + break; + + case "Polygon": + lineStringCoordinates = geom.coordinates[ 0 ]; + break; + } + + if ( lineStringCoordinates ) { + if ( percentage === 0 ) { + return { + type: "Point", + coordinates: [ lineStringCoordinates[ 0 ][ 0 ], lineStringCoordinates[ 0 ][ 1 ] ] + }; + } else if ( percentage === 1 ) { + i = lineStringCoordinates.length - 1; + return { + type: "Point", + coordinates: [ lineStringCoordinates[ i ][ 0 ], lineStringCoordinates[ i ][ 1 ] ] + }; + } else { + if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( lineStringCoordinates ) ) { + wasGeodetic = true; + lineStringCoordinates = $.geo.proj.fromGeodetic( lineStringCoordinates ); + } + + for ( ; i < lineStringCoordinates.length; i++ ) { + dx = lineStringCoordinates[ i ][ 0 ] - lineStringCoordinates[ i - 1 ][ 0 ]; + dy = lineStringCoordinates[ i ][ 1 ] - lineStringCoordinates[ i - 1 ][ 1 ]; + len = Math.sqrt((dx * dx) + (dy * dy)); + segmentLengths.push( len ); + totalLength += len; + } + + for ( i = 0; i < segmentLengths.length && percentageSum < percentage; i++ ) { + previousPercentageSum = percentageSum; + percentageSum += ( segmentLengths[ i ] / totalLength ); + } + + remainderPercentageSum = percentage - previousPercentageSum; + + c0 = lineStringCoordinates[ i - 1 ]; + c1 = lineStringCoordinates[ i ]; + + c = [ + c0[ 0 ] + ( remainderPercentageSum * ( c1[ 0 ] - c0[ 0 ] ) ), + c0[ 1 ] + ( remainderPercentageSum * ( c1[ 1 ] - c0[ 1 ] ) ) + ]; + + return { + type: "Point", + coordinates: wasGeodetic ? $.geo.proj.toGeodetic(c) : c + }; + } + } + }, + + // + // WKT functions + // + + _WKT: (function () { + function pointToString(value) { + return "POINT " + pointToUntaggedString(value.coordinates); + } + + function pointToUntaggedString(coordinates) { + if (!(coordinates && coordinates.length)) { + return "EMPTY"; + } else { + return "(" + coordinates.join(" ") + ")"; + } + } + + function lineStringToString(value) { + return "LINESTRING " + lineStringToUntaggedString(value.coordinates); + } + + function lineStringToUntaggedString(coordinates) { + if (!(coordinates && coordinates.length)) { + return "EMPTY"; + } else { + var points = [] + + for (var i = 0; i < coordinates.length; i++) { + points.push(coordinates[i].join(" ")); + } + + return "(" + points + ")"; + } + } + + function polygonToString(value) { + return "POLYGON " + polygonToUntaggedString(value.coordinates); + } + + function polygonToUntaggedString(coordinates) { + if (!(coordinates && coordinates.length)) { + return "EMTPY"; + } else { + var lineStrings = []; + + for (var i = 0; i < coordinates.length; i++) { + lineStrings.push(lineStringToUntaggedString(coordinates[i])); + } + + return "(" + lineStrings + ")"; + } + } + + function multiPointToString(value) { + return "MULTIPOINT " + lineStringToUntaggedString(value.coordinates); + } + + function multiLineStringToString(value) { + return "MULTILINSTRING " + polygonToUntaggedString(value.coordinates); + } + + function multiPolygonToString(value) { + return "MULTIPOLYGON " + multiPolygonToUntaggedString(value.coordinates); + } + + function multiPolygonToUntaggedString(coordinates) { + if (!(coordinates && coordinates.length)) { + return "EMPTY"; + } else { + var polygons = []; + for (var i = 0; i < coordinates.length; i++) { + polygons.push(polygonToUntaggedString(coordinates[i])); + } + return "(" + polygons + ")"; + } + } + + function geometryCollectionToString(value) { + return "GEOMETRYCOLLECTION " + geometryCollectionToUntaggedString(value.geometries); + } + + function geometryCollectionToUntaggedString(geometries) { + if (!(geometries && geometries.length)) { + return "EMPTY"; + } else { + var geometryText = []; + for (var i = 0; i < geometries.length; i++) { + geometryText.push(stringify(geometries[i])); + } + return "(" + geometries + ")"; + } + } + + function stringify(value) { + if (!(value && value.type)) { + return ""; + } else { + switch (value.type) { + case "Point": + return pointToString(value); + + case "LineString": + return lineStringToString(value); + + case "Polygon": + return polygonToString(value); + + case "MultiPoint": + return multiPointToString(value); + + case "MultiLineString": + return multiLineStringToString(value); + + case "MultiPolygon": + return multiPolygonToString(value); + + case "GeometryCollection": + return geometryCollectionToString(value); + + default: + return ""; + } + } + } + + function pointParseUntagged(wkt) { + var pointString = wkt.match( /\(\s*([\d\.-]+)\s+([\d\.-]+)\s*\)/ ); + return pointString && pointString.length > 2 ? { + type: "Point", + coordinates: [ + parseFloat(pointString[1]), + parseFloat(pointString[2]) + ] + } : null; + } + + function lineStringParseUntagged(wkt) { + var lineString = wkt.match( /\s*\((.*)\)/ ), + coords = [], + pointStrings, + pointParts, + i = 0; + + if ( lineString.length > 1 ) { + pointStrings = lineString[ 1 ].match( /[\d\.-]+\s+[\d\.-]+/g ); + + for ( ; i < pointStrings.length; i++ ) { + pointParts = pointStrings[ i ].match( /\s*([\d\.-]+)\s+([\d\.-]+)\s*/ ); + coords[ i ] = [ parseFloat( pointParts[ 1 ] ), parseFloat( pointParts[ 2 ] ) ]; + } + + return { + type: "LineString", + coordinates: coords + }; + } else { + return null + } + } + + function polygonParseUntagged(wkt) { + var polygon = wkt.match( /\s*\(\s*\((.*)\)\s*\)/ ), + coords = [], + pointStrings, + pointParts, + i = 0; + + if ( polygon.length > 1 ) { + pointStrings = polygon[ 1 ].match( /[\d\.-]+\s+[\d\.-]+/g ); + + for ( ; i < pointStrings.length; i++ ) { + pointParts = pointStrings[ i ].match( /\s*([\d\.-]+)\s+([\d\.-]+)\s*/ ); + coords[ i ] = [ parseFloat( pointParts[ 1 ] ), parseFloat( pointParts[ 2 ] ) ]; + } + + return { + type: "Polygon", + coordinates: [ coords ] + }; + } else { + return null; + } + } + + function parse(wkt) { + wkt = $.trim(wkt); + + var typeIndex = wkt.indexOf( " " ), + untagged = wkt.substr( typeIndex + 1 ); + + switch (wkt.substr(0, typeIndex).toUpperCase()) { + case "POINT": + return pointParseUntagged( untagged ); + + case "LINESTRING": + return lineStringParseUntagged( untagged ); + + case "POLYGON": + return polygonParseUntagged( untagged ); + + default: + return null; + } + } + + return { + stringify: stringify, + + parse: parse + }; + })(), + + // + // projection functions + // + + proj: (function () { + var halfPi = 1.5707963267948966192, + quarterPi = 0.7853981633974483096, + radiansPerDegree = 0.0174532925199432958, + degreesPerRadian = 57.295779513082320877, + semiMajorAxis = 6378137; + + return { + fromGeodeticPos: function (coordinate) { + if (!coordinate) { + debugger; + } + return [ + semiMajorAxis * coordinate[ 0 ] * radiansPerDegree, + semiMajorAxis * Math.log(Math.tan(quarterPi + coordinate[ 1 ] * radiansPerDegree / 2)) + ]; + }, + + fromGeodetic: function ( coordinates ) { + if ( ! $.geo._isGeodetic( coordinates ) ) { + return coordinates; + } + + var isMultiPointOrLineString = $.isArray(coordinates[ 0 ]), + fromGeodeticPos = this.fromGeodeticPos; + + if (!isMultiPointOrLineString && coordinates.length == 4) { + // bbox + var min = fromGeodeticPos([ coordinates[ 0 ], coordinates[ 1 ] ]), + max = fromGeodeticPos([ coordinates[ 2 ], coordinates[ 3 ] ]); + return [ min[ 0 ], min[ 1 ], max[ 0 ], max[ 1 ] ]; + } else { + // geometry + var isMultiLineStringOrPolygon = isMultiPointOrLineString && $.isArray(coordinates[ 0 ][ 0 ]), + isMultiPolygon = isMultiLineStringOrPolygon && $.isArray(coordinates[ 0 ][ 0 ][ 0 ]), + result = [ ], + i, j, k; + + if (!isMultiPolygon) { + if (!isMultiLineStringOrPolygon) { + if (!isMultiPointOrLineString) { + coordinates = [ coordinates ]; + } + coordinates = [ coordinates ]; + } + coordinates = [ coordinates ]; + } + + for ( i = 0; i < coordinates.length; i++ ) { + result[ i ] = [ ]; + for ( j = 0; j < coordinates[ i ].length; j++ ) { + result[ i ][ j ] = [ ]; + for ( k = 0; k < coordinates[ i ][ j ].length; k++ ) { + result[ i ][ j ][ k ] = fromGeodeticPos(coordinates[ i ][ j ][ k ]); + } + } + } + + return isMultiPolygon ? result : isMultiLineStringOrPolygon ? result[ 0 ] : isMultiPointOrLineString ? result[ 0 ][ 0 ] : result[ 0 ][ 0 ][ 0 ]; + } + }, + + toGeodeticPos: function (coordinate) { + return [ + (coordinate[ 0 ] / semiMajorAxis) * degreesPerRadian, + (halfPi - 2 * Math.atan(1 / Math.exp(coordinate[ 1 ] / semiMajorAxis))) * degreesPerRadian + ]; + }, + + toGeodetic: function (coordinates) { + if ( $.geo._isGeodetic( coordinates ) ) { + return coordinates; + } + + var isMultiPointOrLineString = $.isArray(coordinates[ 0 ]), + toGeodeticPos = this.toGeodeticPos; + + if (!isMultiPointOrLineString && coordinates.length == 4) { + // bbox + var min = toGeodeticPos([ coordinates[ 0 ], coordinates[ 1 ] ]), + max = toGeodeticPos([ coordinates[ 2 ], coordinates[ 3 ] ]); + return [ min[ 0 ], min[ 1 ], max[ 0 ], max[ 1 ] ]; + } else { + // geometry + var isMultiLineStringOrPolygon = isMultiPointOrLineString && $.isArray(coordinates[ 0 ][ 0 ]), + isMultiPolygon = isMultiLineStringOrPolygon && $.isArray(coordinates[ 0 ][ 0 ][ 0 ]), + result = [ ]; + + if (!isMultiPolygon) { + if (!isMultiLineStringOrPolygon) { + if (!isMultiPointOrLineString) { + coordinates = [ coordinates ]; + } + coordinates = [ coordinates ]; + } + coordinates = [ coordinates ]; + } + + for ( i = 0; i < coordinates.length; i++ ) { + result[ i ] = [ ]; + for ( j = 0; j < coordinates[ i ].length; j++ ) { + result[ i ][ j ] = [ ]; + for ( k = 0; k < coordinates[ i ][ j ].length; k++ ) { + result[ i ][ j ][ k ] = toGeodeticPos(coordinates[ i ][ j ][ k ]); + } + } + } + + return isMultiPolygon ? result : isMultiLineStringOrPolygon ? result[ 0 ] : isMultiPointOrLineString ? result[ 0 ][ 0 ] : result[ 0 ][ 0 ][ 0 ]; + } + } + } + })(), + + // + // service types (defined in other files) + // + + _serviceTypes: {} + } +})(jQuery, this); + diff --git a/libs/js/jquery-geo-1.0a4/js/jquery.geo.geographics.js b/libs/js/jquery-geo-1.0a4/js/jquery.geo.geographics.js new file mode 100755 index 0000000..889eb67 --- /dev/null +++ b/libs/js/jquery-geo-1.0a4/js/jquery.geo.geographics.js @@ -0,0 +1,284 @@ +(function ($, undefined) { + + var _ieVersion = (function () { + var v = 5, div = document.createElement("div"), a = div.all || []; + while (div.innerHTML = "", a[0]) { } + return v > 6 ? v : !v; + } ()); + + $.widget("geo.geographics", { + _$elem: undefined, + _options: {}, + _trueCanvas: true, + + _width: 0, + _height: 0, + + _$canvas: undefined, + _context: undefined, + _$labelsContainer: undefined, + + options: { + style: { + borderRadius: "8px", + color: "#7f0000", + //fill: undefined, + fillOpacity: .2, + height: "8px", + opacity: 1, + //stroke: undefined, + strokeOpacity: 1, + strokeWidth: "2px", + visibility: "visible", + width: "8px" + } + }, + + _create: function () { + this._$elem = this.element; + this._options = this.options; + + this._$elem.css({ display: "inline-block", overflow: "hidden", textAlign: "left" }); + + if (this._$elem.css("position") == "static") { + this._$elem.css("position", "relative"); + } + + this._$elem.addClass( "geo-graphics" ); + + this._width = this._$elem.width(); + this._height = this._$elem.height(); + + if (!(this._width && this._height)) { + this._width = parseInt(this._$elem.css("width")); + this._height = parseInt(this._$elem.css("height")); + } + + var posCss = 'position:absolute;left:0;top:0;margin:0;padding:0;', + sizeCss = 'width:' + this._width + 'px;height:' + this._height + 'px;', + sizeAttr = 'width="' + this._width + '" height="' + this._height + '"'; + + if (document.createElement('canvas').getContext) { + this._$elem.append(''); + this._$canvas = this._$elem.children(':last'); + this._context = this._$canvas[0].getContext("2d"); + } else if (_ieVersion <= 8) { + this._trueCanvas = false; + this._$elem.append( '
    '); + this._$canvas = this._$elem.children(':last'); + + G_vmlCanvasManager.initElement(this._$canvas[0]); + this._context = this._$canvas[0].getContext("2d"); + this._$canvas.children().css({ backgroundColor: "transparent", width: this._width, height: this._height }); + } + + this._$elem.append('
    '); + this._$labelsContainer = this._$elem.children(':last'); + }, + + _setOption: function (key, value) { + if (key == "style") { + value = $.extend({}, this._options.style, value); + } + $.Widget.prototype._setOption.apply(this, arguments); + }, + + destroy: function () { + $.Widget.prototype.destroy.apply(this, arguments); + this._$elem.html(""); + this._$elem.removeClass( "geo-graphics" ); + }, + + clear: function () { + this._context.clearRect(0, 0, this._width, this._height); + this._$labelsContainer.html(""); + }, + + drawArc: function (coordinates, startAngle, sweepAngle, style) { + style = this._getGraphicStyle(style); + + if (style.visibility != "hidden" && style.opacity > 0 && style.widthValue > 0 && style.heightValue > 0) { + var r = Math.min(style.widthValue, style.heightValue) / 2; + + startAngle = (startAngle * Math.PI / 180); + sweepAngle = (sweepAngle * Math.PI / 180); + + this._context.save(); + this._context.translate(coordinates[0], coordinates[1]); + if (style.widthValue > style.heightValue) { + this._context.scale(style.widthValue / style.heightValue, 1); + } else { + this._context.scale(1, style.heightValue / style.widthValue); + } + + this._context.beginPath(); + this._context.arc(0, 0, r, startAngle, sweepAngle, false); + + if (this._trueCanvas) { + this._context.restore(); + } + + if (style.doFill) { + this._context.fillStyle = style.fill; + this._context.globalAlpha = style.opacity * style.fillOpacity; + this._context.fill(); + } + + if (style.doStroke) { + this._context.lineJoin = "round"; + this._context.lineWidth = style.strokeWidthValue; + this._context.strokeStyle = style.stroke; + + this._context.globalAlpha = style.opacity * style.strokeOpacity; + this._context.stroke(); + } + + if (!this._trueCanvas) { + this._context.restore(); + } + } + }, + + drawPoint: function (coordinates, style) { + var style = this._getGraphicStyle(style); + if (style.widthValue == style.heightValue && style.heightValue == style.borderRadiusValue) { + this.drawArc(coordinates, 0, 360, style); + } else if (style.visibility != "hidden" && style.opacity > 0) { + style.borderRadiusValue = Math.min(Math.min(style.widthValue, style.heightValue) / 2, style.borderRadiusValue); + coordinates[0] -= style.widthValue / 2; + coordinates[1] -= style.heightValue / 2; + this._context.beginPath(); + this._context.moveTo(coordinates[0] + style.borderRadiusValue, coordinates[1]); + this._context.lineTo(coordinates[0] + style.widthValue - style.borderRadiusValue, coordinates[1]); + this._context.quadraticCurveTo(coordinates[0] + style.widthValue, coordinates[1], coordinates[0] + style.widthValue, coordinates[1] + style.borderRadiusValue); + this._context.lineTo(coordinates[0] + style.widthValue, coordinates[1] + style.heightValue - style.borderRadiusValue); + this._context.quadraticCurveTo(coordinates[0] + style.widthValue, coordinates[1] + style.heightValue, coordinates[0] + style.widthValue - style.borderRadiusValue, coordinates[1] + style.heightValue); + this._context.lineTo(coordinates[0] + style.borderRadiusValue, coordinates[1] + style.heightValue); + this._context.quadraticCurveTo(coordinates[0], coordinates[1] + style.heightValue, coordinates[0], coordinates[1] + style.heightValue - style.borderRadiusValue); + this._context.lineTo(coordinates[0], coordinates[1] + style.borderRadiusValue); + this._context.quadraticCurveTo(coordinates[0], coordinates[1], coordinates[0] + style.borderRadiusValue, coordinates[1]); + this._context.closePath(); + + if (style.doFill) { + this._context.fillStyle = style.fill; + this._context.globalAlpha = style.opacity * style.fillOpacity; + this._context.fill(); + } + + if (style.doStroke) { + this._context.lineJoin = "round"; + this._context.lineWidth = style.strokeWidthValue; + this._context.strokeStyle = style.stroke; + + this._context.globalAlpha = style.opacity * style.strokeOpacity; + + this._context.stroke(); + } + } + }, + + drawLineString: function (coordinates, style) { + this._drawLines([coordinates], false, style); + }, + + drawPolygon: function (coordinates, style) { + this._drawLines(coordinates, true, style); + }, + + drawBbox: function (bbox, style) { + this._drawLines([[ + [bbox[0], bbox[1]], + [bbox[0], bbox[3]], + [bbox[2], bbox[3]], + [bbox[2], bbox[1]], + [bbox[0], bbox[1]] + ]], true, style); + }, + + drawLabel: function( coordinates, label ) { + this._$labelsContainer.append( '
    ' + label + '
    '); + }, + + resize: function( ) { + this._width = this._$elem.width(); + this._height = this._$elem.height(); + + if (!(this._width && this._height)) { + this._width = parseInt(this._$elem.css("width")); + this._height = parseInt(this._$elem.css("height")); + } + + if ( this._trueCanvas ) { + this._$canvas[0].width = this._width; + this._$canvas[0].height = this._height; + } else { + } + + this._$labelsContainer.css( { + width: this._width, + height: this._height + } ); + }, + + _getGraphicStyle: function (style) { + function safeParse(value) { + value = parseInt(value); + return (+value + '') === value ? +value : value; + } + + style = $.extend({}, this._options.style, style); + style.borderRadiusValue = safeParse(style.borderRadius); + style.fill = style.fill || style.color; + style.doFill = style.fill && style.fillOpacity > 0; + style.stroke = style.stroke || style.color; + style.strokeWidthValue = safeParse(style.strokeWidth); + style.doStroke = style.stroke && style.strokeOpacity > 0 && style.strokeWidthValue > 0; + style.widthValue = safeParse(style.width); + style.heightValue = safeParse(style.height); + return style; + }, + + _drawLines: function (coordinates, close, style) { + if (!coordinates || !coordinates.length || coordinates[0].length < 2) { + return; + } + + var style = this._getGraphicStyle(style), + i, j; + + if (style.visibility != "hidden" && style.opacity > 0) { + this._context.beginPath(); + this._context.moveTo(coordinates[0][0][0], coordinates[0][0][1]); + + for (i = 0; i < coordinates.length; i++) { + for (j = 0; j < coordinates[i].length; j++) { + this._context.lineTo(coordinates[i][j][0], coordinates[i][j][1]); + } + } + + if (close) { + this._context.closePath(); + } + + if (close && style.doFill) { + this._context.fillStyle = style.fill; + this._context.globalAlpha = style.opacity * style.fillOpacity; + this._context.fill(); + } + + if (style.doStroke) { + this._context.lineCap = this._context.lineJoin = "round"; + this._context.lineWidth = style.strokeWidthValue; + this._context.strokeStyle = style.stroke; + + this._context.globalAlpha = style.opacity * style.strokeOpacity; + this._context.stroke(); + } + } + } + }); + + +})(jQuery); + + diff --git a/libs/js/jquery-geo-1.0a4/js/jquery.geo.geomap.js b/libs/js/jquery-geo-1.0a4/js/jquery.geo.geomap.js new file mode 100755 index 0000000..47ad52e --- /dev/null +++ b/libs/js/jquery-geo-1.0a4/js/jquery.geo.geomap.js @@ -0,0 +1,1864 @@ +(function ($, undefined) { + var _ieVersion = (function () { + var v = 5, div = document.createElement("div"), a = div.all || []; + while (div.innerHTML = "", a[0]) { } + return v > 6 ? v : !v; + } ()), + + _defaultOptions = { + bbox: [-180, -85, 180, 85], + bboxMax: [-180, -85, 180, 85], + center: [0, 0], + cursors: { + "static": "default", + pan: "url(data:image/vnd.microsoft.icon;base64,AAACAAEAICACAAgACAAwAQAAFgAAACgAAAAgAAAAQAAAAAEAAQAAAAAAAAEAAAAAAAAAAAAAAgAAAAAAAAAAAAAA////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD8AAAA/AAAAfwAAAP+AAAH/gAAB/8AAA//AAAd/wAAGf+AAAH9gAADbYAAA2yAAAZsAAAGbAAAAGAAAAAAAAA//////////////////////////////////////////////////////////////////////////////////////gH///4B///8Af//+AD///AA///wAH//4AB//8AAf//AAD//5AA///gAP//4AD//8AF///AB///5A////5///8=), move", + zoom: "crosshair", + drawPoint: "crosshair", + drawLineString: "crosshair", + drawPolygon: "crosshair", + measureLength: "crosshair", + measureArea: "crosshair" + }, + measureLabels: { + length: "{{=length.toFixed( 2 )}} m", + area: "{{=area.toFixed( 2 )}} sq m" + }, + drawStyle: {}, + shapeStyle: {}, + mode: "pan", + pannable: true, + scroll: "default", + services: [ + { + "class": "osm", + type: "tiled", + src: function (view) { + return "http://tile.openstreetmap.org/" + view.zoom + "/" + view.tile.column + "/" + view.tile.row + ".png"; + }, + attr: "© OpenStreetMap & contributors, CC-BY-SA" + } + ], + tilingScheme: { + tileWidth: 256, + tileHeight: 256, + levels: 18, + basePixelSize: 156543.03392799936, + origin: [-20037508.342787, 20037508.342787] + }, + axisLayout: "map", + zoom: 0, + pixelSize: 0 + }; + + $.widget("geo.geomap", { + // private widget members + _$elem: undefined, //< map div for maps, service div for services + _map: undefined, //< only defined in services + _created: false, + + _contentBounds: {}, + + _$resizeContainer: undefined, //< all elements that should match _contentBounds' size + + _$eventTarget: undefined, + _$contentFrame: undefined, + _$existingChildren: undefined, + _$attrList: undefined, + _$servicesContainer: undefined, + + _$panContainer: undefined, //< all non-service elements that move while panning + _$shapesContainer: undefined, + _$drawContainer: undefined, + _$measureContainer: undefined, + _$measureLabel: undefined, + + _dpi: 96, + + _currentServices: [], //< internal copy + + _center: undefined, + _pixelSize: undefined, + _centerMax: undefined, + _pixelSizeMax: undefined, + + _userGeodetic: true, + + _wheelTimeout: null, + _wheelLevel: 0, + + _zoomFactor: 2, //< determines what a zoom level means + + _fullZoomFactor: 2, //< interactiveScale factor needed to zoom a whole level + _partialZoomFactor: 1.18920711500273, //< interactiveScale factor needed to zoom a fraction of a level (the fourth root of 2) + + _mouseDown: undefined, + _inOp: undefined, + _toolPan: undefined, + _shiftZoom: undefined, + _anchor: undefined, + _current: undefined, + _downDate: undefined, + _moveDate: undefined, + _clickDate: undefined, + _lastMove: undefined, + _lastDrag: undefined, + + _windowHandler: null, + _resizeTimeout: null, + + _panning: undefined, + _velocity: undefined, + _friction: undefined, + + _supportTouch: undefined, + _softDblClick: undefined, + _isTap: undefined, + _isDbltap: undefined, + + _isMultiTouch: undefined, + _multiTouchAnchor: undefined, //< TouchList + _multiTouchAnchorBbox: undefined, //< bbox + _multiTouchCurrentBbox: undefined, //< bbox + + _drawTimeout: null, //< used in drawPoint mode so we don't send two shape events on dbltap + _drawPixels: [], //< an array of coordinate arrays for drawing lines & polygons, in pixel coordinates + _drawCoords: [], + + _graphicShapes: [], //< an array of objects containing style object refs & GeoJSON object refs + + _initOptions: {}, + + _options: {}, + + options: $.extend({}, _defaultOptions), + + _createWidget: function (options, element) { + this._$elem = $(element); + + if (this._$elem.is(".geo-service")) { + var $contentFrame = this._$elem.closest( ".geo-content-frame" ); + this._$elem.append('
    '); + this._$shapesContainer = this._$elem.children(':last'); + this._graphicShapes = []; + $.Widget.prototype._createWidget.apply(this, arguments); + return; + } + + this._$elem.addClass("geo-map"); + + this._initOptions = options || {}; + + this._forcePosition(this._$elem); + + this._$elem.css("text-align", "left"); + + var size = this._findMapSize(); + this._contentBounds = { + x: parseInt(this._$elem.css("padding-left")), + y: parseInt(this._$elem.css("padding-top")), + width: size["width"], + height: size["height"] + }; + + this._createChildren(); + + this._center = this._centerMax = [0, 0]; + + this.options["pixelSize"] = this._pixelSize = this._pixelSizeMax = 156543.03392799936; + + this._mouseDown = + this._inOp = + this._toolPan = + this._shiftZoom = + this._panning = + this._isTap = + this._isDbltap = false; + + this._anchor = [ 0, 0 ]; + this._current = [ 0, 0 ]; + this._lastMove = [ 0, 0 ]; + this._lastDrag = [ 0, 0 ]; + this._velocity = [ 0, 0 ]; + + this._friction = [.8, .8]; + + this._downDate = + this._moveDate = + this._clickDate = 0; + + this._drawPixels = []; + this._drawCoords = []; + this._graphicShapes = []; + + + $.Widget.prototype._createWidget.apply(this, arguments); + }, + + _create: function () { + this._options = this.options; + + if (this._$elem.is(".geo-service")) { + this._map = this._$elem.data( "geoMap" ); + this._$shapesContainer.geographics( ); + this._options["shapeStyle"] = this._$shapesContainer.geographics("option", "style"); + return; + } + + this._map = this; + + this._supportTouch = "ontouchend" in document; + this._softDblClick = this._supportTouch || _ieVersion == 7; + + var geomap = this, + touchStartEvent = this._supportTouch ? "touchstart" : "mousedown", + touchStopEvent = this._supportTouch ? "touchend touchcancel" : "mouseup", + touchMoveEvent = this._supportTouch ? "touchmove" : "mousemove"; + + $(document).keydown($.proxy(this._document_keydown, this)); + + this._$eventTarget.dblclick($.proxy(this._eventTarget_dblclick, this)); + + this._$eventTarget.bind(touchStartEvent, $.proxy(this._eventTarget_touchstart, this)); + + var dragTarget = (this._$eventTarget[0].setCapture) ? this._$eventTarget : $(document); + dragTarget.bind(touchMoveEvent, $.proxy(this._dragTarget_touchmove, this)); + dragTarget.bind(touchStopEvent, $.proxy(this._dragTarget_touchstop, this)); + + this._$eventTarget.mousewheel($.proxy(this._eventTarget_mousewheel, this)); + + this._windowHandler = function () { + if (geomap._resizeTimeout) { + clearTimeout(geomap._resizeTimeout); + } + geomap._resizeTimeout = setTimeout(function () { + if (geomap._created) { + geomap._$elem.geomap("resize"); + } + }, 500); + }; + + $(window).resize(this._windowHandler); + + this._$drawContainer.geographics({ style: this._initOptions.drawStyle || {} }); + this._options["drawStyle"] = this._$drawContainer.geographics("option", "style"); + + this._$shapesContainer.geographics( { style: this._initOptions.shapeStyle || { } } ); + this._options["shapeStyle"] = this._$shapesContainer.geographics("option", "style"); + + if (this._initOptions) { + if (this._initOptions.tilingScheme) { + this._setOption("tilingScheme", this._initOptions.tilingScheme, false); + } + if ( this._initOptions.services ) { + // jQuery UI Widget Factory merges user services with our default, we want to clobber the default + this._options[ "services" ] = $.merge( [ ], this._initOptions.services ); + } + if (this._initOptions.bbox) { + this._setOption("bbox", this._initOptions.bbox, false); + } + if (this._initOptions.center) { + this._setOption("center", this._initOptions.center, false); + } + if (this._initOptions.zoom !== undefined) { + this._setZoom(this._initOptions.zoom, false, false); + } + } + + $.template( "geoMeasureLength", this._options[ "measureLabels" ].length ); + $.template( "geoMeasureArea", this._options[ "measureLabels" ].area ); + + this._$eventTarget.css("cursor", this._options["cursors"][this._options["mode"]]); + + this._createServices(); + this._refresh(); + + this._created = true; + }, + + _setOption: function (key, value, refresh) { + if ( key == "pixelSize" ) { + return; + } + + refresh = (refresh === undefined || refresh); + + if ( this._$elem.is( ".geo-map" ) ) { + this._panFinalize(); + } + + switch (key) { + case "bbox": + this._userGeodetic = $.geo.proj && $.geo._isGeodetic( value ); + if ( this._userGeodetic ) { + value = $.geo.proj.fromGeodetic( value ); + } + + this._setBbox(value, false, refresh); + value = this._getBbox(); + break; + + case "center": + this._userGeodetic = $.geo.proj && $.geo._isGeodetic( value ); + if ( this._userGeodetic ) { + value = $.geo.proj.fromGeodetic( value ); + } + + this._setCenterAndSize( value, this._pixelSize, false, refresh ); + break; + + case "measureLabels": + value = $.extend( this._options[ "measureLabels" ], value ); + $.template( "geoMeasureLength", value.length ); + $.template( "geoMeasureArea", value.area ); + break; + + case "drawStyle": + if (this._$drawContainer) { + this._$drawContainer.geographics("option", "style", value); + value = this._$drawContainer.geographics("option", "style"); + } + break; + + case "shapeStyle": + if (this._$shapesContainer) { + this._$shapesContainer.geographics("option", "style", value); + value = this._$shapesContainer.geographics("option", "style"); + } + break; + + case "mode": + this._resetDrawing( ); + this._$eventTarget.css("cursor", this._options["cursors"][value]); + break; + + case "zoom": + this._setZoom(value, false, refresh); + break; + } + + $.Widget.prototype._setOption.apply(this, arguments); + + switch ( key ) { + case "bbox": + case "center": + if ( this._userGeodetic ) { + this._options[ "bbox" ] = $.geo.proj.toGeodetic( this._options[ "bbox" ] ); + this._options[ "center" ] = $.geo.proj.toGeodetic( this._center ); + } + break; + + case "tilingScheme": + if ( value != null ) { + this._pixelSizeMax = this._getPixelSize( 0 ); + this._centerMax = [ + value.origin[ 0 ] + this._pixelSizeMax * value.tileWidth / 2, + value.origin[ 1 ] + this._pixelSizeMax * value.tileHeight / 2 + ]; + } + break; + + case "bboxMax": + this._pixelSizeMax = this._getPixelSize( 0 ); + + if ( $.geo.proj && $.geo._isGeodetic( value ) ) { + this._centerMax = $.geo.center( $.geo.proj.fromGeodetic( value ) ); + } else { + this._centerMax = $.geo.center( value ); + } + break; + + case "services": + this._createServices(); + if (refresh) { + this._refresh(); + } + break; + + case "shapeStyle": + if ( refresh ) { + this._$shapesContainer.geographics("clear"); + this._refreshShapes( this._$shapesContainer, this._graphicShapes, this._graphicShapes, this._graphicShapes ); + } + break; + } + }, + + destroy: function () { + if ( this._$elem.is(".geo-service") ) { + this._$shapesContainer.geographics("destroy"); + this._$shapesContainer = undefined; + } else { + this._created = false; + + $(window).unbind("resize", this._windowHandler); + + for ( var i = 0; i < this._currentServices.length; i++ ) { + this._currentServices[ i ].serviceContainer.geomap("destroy"); + $.geo["_serviceTypes"][this._currentServices[i].type].destroy(this, this._$servicesContainer, this._currentServices[i]); + } + + this._$shapesContainer.geographics("destroy"); + this._$shapesContainer = undefined; + this._$drawContainer.geographics("destroy"); + this._$drawContainer = undefined; + + this._$existingChildren.detach(); + this._$elem.html(""); + this._$elem.append(this._$existingChildren); + this._$elem.removeClass("geo-map"); + } + + $.Widget.prototype.destroy.apply(this, arguments); + }, + + toMap: function (p) { + p = this._toMap(p); + return this._userGeodetic ? $.geo.proj.toGeodetic(p) : p; + }, + + toPixel: function ( p, _center /* Internal Use Only */, _pixelSize /* Internal Use Only */ ) { + return this._toPixel( $.geo.proj ? $.geo.proj.fromGeodetic( p ) : p, _center, _pixelSize ); + }, + + opacity: function ( value, _serviceContainer ) { + if ( this._$elem.is( ".geo-service" ) ) { + this._$elem.closest( ".geo-map" ).geomap( "opacity", value, this._$elem ); + } else { + if ( value >= 0 || value <= 1 ) { + for ( var i = 0; i < this._currentServices.length; i++ ) { + var service = this._currentServices[ i ]; + if ( !_serviceContainer || service.serviceContainer[ 0 ] == _serviceContainer[ 0 ] ) { + service.style.opacity = value; + $.geo[ "_serviceTypes" ][ service.type ].opacity( this, service ); + } + } + } + } + }, + + toggle: function ( value, _serviceContainer ) { + if ( this._$elem.is( ".geo-service" ) ) { + this._$elem.closest( ".geo-map" ).geomap( "toggle", value, this._$elem ); + } else { + + for ( var i = 0; i < this._currentServices.length; i++ ) { + var service = this._currentServices[ i ]; + + if ( !_serviceContainer || service.serviceContainer[ 0 ] == _serviceContainer[ 0 ] ) { + if ( value === undefined ) { + // toggle visibility + value = ( service.style.visibility !== "visible" ); + } + + service.style.visibility = ( value ? "visible" : "hidden" ); + + service.serviceContainer.toggle( value ); + + if ( value ) { + $.geo[ "_serviceTypes" ][ service.type ].refresh( this, service ); + } + } + } + } + }, + + zoom: function (numberOfLevels) { + if (numberOfLevels != null) { + this._setZoom(this._options["zoom"] + numberOfLevels, false, true); + } + }, + + refresh: function () { + this._refresh(); + }, + + resize: function () { + var size = this._findMapSize(), + dx = size["width"]/2 - this._contentBounds.width/2, + dy = size["height"]/2 - this._contentBounds.height/2, + i; + + this._contentBounds = { + x: parseInt(this._$elem.css("padding-left")), + y: parseInt(this._$elem.css("padding-top")), + width: size["width"], + height: size["height"] + }; + + this._$resizeContainer.css( { + width: size["width"], + height: size["height"] + } ); + + for (i = 0; i < this._currentServices.length; i++) { + $.geo["_serviceTypes"][this._currentServices[i].type].resize(this, this._currentServices[i]); + } + + this._$elem.find( ".geo-graphics" ).css( { + width: size["width"], + height: size["height"] + }).geographics( "resize" ); + + for (i = 0; i < this._drawPixels.length; i++) { + this._drawPixels[i][0] += dx; + this._drawPixels[i][1] += dy; + } + + this._setCenterAndSize(this._center, this._pixelSize, false, true); + }, + + append: function ( shape, style, label, refresh ) { + if ( shape && $.isPlainObject( shape ) ) { + var shapes, arg, i, realStyle, realLabel, realRefresh; + + if ( shape.type == "FeatureCollection" ) { + shapes = shape.features; + } else { + shapes = $.isArray( shape ) ? shape : [ shape ]; + } + + for ( i = 1; i < arguments.length; i++ ) { + arg = arguments[ i ]; + + if ( typeof arg === "object" ) { + realStyle = arg; + } else if ( typeof arg === "number" || typeof arg === "string" ) { + realLabel = arg; + } else if ( typeof arg === "boolean" ) { + realRefresh = arg; + } + } + + for ( i = 0; i < shapes.length; i++ ) { + if ( shapes[ i ].type != "Point" ) { + var bbox = $.geo.bbox( shapes[ i ] ); + if ( $.geo.proj && $.geo._isGeodetic( bbox ) ) { + bbox = $.geo.proj.fromGeodetic( bbox ); + } + $.data( shapes[ i ], "geoBbox", bbox ); + } + + this._graphicShapes.push( { + shape: shapes[ i ], + style: realStyle, + label: realLabel + } ); + } + + if ( realRefresh === undefined || realRefresh ) { + this._refresh( ); + } + } + }, + + empty: function ( refresh ) { + for ( var i = 0; i < this._graphicShapes.length; i++ ) { + $.removeData( this._graphicShapes[ i ].shape, "geoBbox" ); + } + + this._graphicShapes = []; + + if ( refresh === undefined || refresh ) { + this._refresh(); + } + }, + + find: function ( selector, pixelTolerance ) { + var isPoint = $.isPlainObject( selector ), + searchPixel = isPoint ? this._map.toPixel( selector.coordinates ) : undefined, + mapTol = this._map._pixelSize * pixelTolerance, + result = [], + graphicShape, + geometries, + curGeom, + i = 0; + + for ( ; i < this._graphicShapes.length; i++ ) { + graphicShape = this._graphicShapes[ i ]; + + if ( isPoint ) { + if ( graphicShape.shape.type == "Point" ) { + if ( $.geo.distance( graphicShape.shape, selector ) <= mapTol ) { + result.push( graphicShape.shape ); + } + } else { + var bbox = $.data( graphicShape.shape, "geoBbox" ), + bboxPolygon = { + type: "Polygon", + coordinates: [ [ + [bbox[0], bbox[1]], + [bbox[0], bbox[3]], + [bbox[2], bbox[3]], + [bbox[2], bbox[1]], + [bbox[0], bbox[1]] + ] ] + }, + projectedPoint = { + type: "Point", + coordinates: $.geo.proj && $.geo._isGeodetic( selector.coordinates ) ? $.geo.proj.fromGeodetic( selector.coordinates ) : selector.coordinates + }; + + if ( $.geo.distance( bboxPolygon, projectedPoint, true ) <= mapTol ) { + geometries = $.geo._flatten( graphicShape.shape ); + for ( curGeom = 0; curGeom < geometries.length; curGeom++ ) { + if ( $.geo.distance( geometries[ curGeom ], selector ) <= mapTol ) { + result.push( graphicShape.shape ); + break; + } + } + } + } + } else { + result.push( graphicShape.shape ); + } + } + + if ( this._$elem.is( ".geo-map" ) ) { + this._$elem.find( ".geo-service" ).each( function( ) { + result = $.merge( result, $( this ).geomap( "find", selector, pixelTolerance ) ); + } ); + } + + return result; + }, + + remove: function ( shape, refresh ) { + for ( var i = 0; i < this._graphicShapes.length; i++ ) { + if ( this._graphicShapes[ i ].shape == shape ) { + $.removeData( shape, "geoBbox" ); + var rest = this._graphicShapes.slice( i + 1 ); + this._graphicShapes.length = i; + this._graphicShapes.push.apply( this._graphicShapes, rest ); + break; + } + } + + if ( refresh === undefined || refresh ) { + this._refresh(); + } + }, + + _getBbox: function (center, pixelSize) { + center = center || this._center; + pixelSize = pixelSize || this._pixelSize; + + // calculate the internal bbox + var halfWidth = this._contentBounds[ "width" ] / 2 * pixelSize, + halfHeight = this._contentBounds[ "height" ] / 2 * pixelSize; + return [ center[ 0 ] - halfWidth, center[ 1 ] - halfHeight, center[ 0 ] + halfWidth, center[ 1 ] + halfHeight ]; + }, + + _setBbox: function (value, trigger, refresh) { + var center = [value[0] + (value[2] - value[0]) / 2, value[1] + (value[3] - value[1]) / 2], + pixelSize = Math.max($.geo.width(value, true) / this._contentBounds.width, $.geo.height(value, true) / this._contentBounds.height); + + if (this._options["tilingScheme"]) { + var zoom = this._getZoom( center, pixelSize ); + pixelSize = this._getPixelSize( zoom ); + } else { + if ( this._getZoom( center, pixelSize ) < 0 ) { + pixelSize = this._pixelSizeMax; + } + } + + this._setCenterAndSize(center, pixelSize, trigger, refresh); + }, + + _getBboxMax: function () { + // calculate the internal bboxMax + var halfWidth = this._contentBounds["width"] / 2 * this._pixelSizeMax, + halfHeight = this._contentBounds["height"] / 2 * this._pixelSizeMax; + return [this._centerMax[0] - halfWidth, this._centerMax[1] - halfHeight, this._centerMax[0] + halfWidth, this._centerMax[1] + halfHeight]; + }, + + _getCenter: function () { + return this._center; + }, + + _getContentBounds: function () { + return this._contentBounds; + }, + + _getServicesContainer: function () { + return this._$servicesContainer; + }, + + _getZoom: function ( center, pixelSize ) { + center = center || this._center; + pixelSize = pixelSize || this._pixelSize; + + // calculate the internal zoom level, vs. public zoom property + var tilingScheme = this._options["tilingScheme"]; + if ( tilingScheme ) { + if ( tilingScheme.pixelSizes != null ) { + var roundedPixelSize = Math.floor(pixelSize * 1000), + levels = tilingScheme.pixelSizes.length, + i = levels - 1; + + for ( ; i >= 0; i-- ) { + if ( Math.floor( tilingScheme.pixelSizes[ i ] * 1000 ) >= roundedPixelSize ) { + return i; + } + } + + return 0; + } else { + return Math.max( Math.round( Math.log( tilingScheme.basePixelSize / pixelSize) / Math.log( 2 ) ), 0 ); + } + } else { + var ratio = this._contentBounds["width"] / this._contentBounds["height"], + bbox = $.geo.reaspect( this._getBbox( center, pixelSize ), ratio, true ), + bboxMax = $.geo.reaspect(this._getBboxMax(), ratio, true); + + return Math.max( Math.round( Math.log($.geo.width(bboxMax, true) / $.geo.width(bbox, true)) / Math.log(this._zoomFactor) ), 0 ); + } + }, + + _setZoom: function ( value, trigger, refresh ) { + value = Math.max( value, 0 ); + + this._setCenterAndSize( this._center, this._getPixelSize( value ), trigger, refresh ); + }, + + _createChildren: function () { + this._$existingChildren = this._$elem.children().detach(); + + this._forcePosition(this._$existingChildren); + + this._$existingChildren.css("-moz-user-select", "none"); + + var contentSizeCss = "width:" + this._contentBounds["width"] + "px; height:" + this._contentBounds["height"] + "px; margin:0; padding:0;", + contentPosCss = "position:absolute; left:0; top:0;"; + + this._$elem.prepend('
    '); + this._$eventTarget = this._$contentFrame = this._$elem.children(':first'); + + this._$contentFrame.append('
    '); + this._$servicesContainer = this._$contentFrame.children(':last'); + + this._$contentFrame.append('
    '); + this._$shapesContainer = this._$contentFrame.children(':last'); + + this._$contentFrame.append( '
      ' ); + this._$attrList = this._$contentFrame.children( ":last" ); + + this._$contentFrame.append('
      '); + this._$drawContainer = this._$contentFrame.children(':last'); + + this._$contentFrame.append('
      '); + this._$measureContainer = this._$contentFrame.children(':last'); + this._$measureLabel = this._$measureContainer.children(); + + this._$panContainer = $( [ this._$shapesContainer[ 0 ], this._$drawContainer[ 0 ], this._$measureContainer[ 0 ] ] ); + + this._$resizeContainer = $( [ this._$contentFrame[ 0 ], this._$servicesContainer[ 0 ], this._$eventTarget[ 0 ], this._$measureContainer[ 0 ] ] ); + + this._$contentFrame.append(this._$existingChildren); + + if ( ! $("#geo-measure-style").length ) { + $("head").prepend( '' ); + } + }, + + _createServices: function () { + var service, i; + + for ( i = 0; i < this._currentServices.length; i++ ) { + this._currentServices[ i ].serviceContainer.geomap( "destroy" ); + $.geo[ "_serviceTypes" ][ this._currentServices[ i ].type ].destroy( this, this._$servicesContainer, this._currentServices[ i ] ); + } + + this._currentServices = [ ]; + this._$servicesContainer.html( "" ); + this._$attrList.html( "" ); + + for ( i = 0; i < this._options[ "services" ].length; i++ ) { + service = this._currentServices[ i ] = $.extend( { }, this._options[ "services" ][ i ] ); + + // default the service style property on our copy + service.style = $.extend( { + visibility: "visible", + opacity: 1 + }, service.style ); + + var idString = service.id ? ' id="' + service.id + '"' : "", + classString = 'class="geo-service ' + ( service["class"] ? service["class"] : '' ) + '"', + scHtml = '
      ', + servicesContainer; + + this._$servicesContainer.append( scHtml ); + serviceContainer = this._$servicesContainer.children( ":last" ); + this._currentServices[ i ].serviceContainer = serviceContainer; + + $.geo[ "_serviceTypes" ][ service.type ].create( this, serviceContainer, service, i ); + + serviceContainer.data( "geoMap", this ).geomap(); + + if ( service.attr ) { + this._$attrList.append( '
    • ' + service.attr + '
    • ' ); + } + } + + this._$attrList.find( "a" ).css( { + position: "relative", + zIndex: 100 + } ); + }, + + _refreshDrawing: function ( ) { + this._$drawContainer.geographics("clear"); + + if ( this._drawPixels.length > 0 ) { + var mode = this._options[ "mode" ], + pixels = this._drawPixels, + coords = this._drawCoords, + label, + labelShape, + labelPixel, + widthOver, + heightOver; + + switch ( mode ) { + case "measureLength": + mode = "drawLineString"; + labelShape = { + type: "LineString", + coordinates: coords + }; + label = $.render( { length: $.geo.length( labelShape, true ) }, "geoMeasureLength" ); + labelPixel = $.merge( [], pixels[ pixels.length - 1 ] ); + break; + + case "measureArea": + mode = "drawPolygon"; + + labelShape = { + type: "Polygon", + coordinates: [ $.merge( [ ], coords ) ] + }; + labelShape.coordinates[ 0 ].push( coords[ 0 ] ); + + label = $.render( { area: $.geo.area( labelShape, true ) }, "geoMeasureArea" ); + labelPixel = $.merge( [], pixels[ pixels.length - 1 ] ); + pixels = [ pixels ]; + break; + + case "drawPolygon": + pixels = [ pixels ]; + break; + } + + this._$drawContainer.geographics( mode, pixels ); + + if ( label ) { + this._$measureLabel.html( label ); + + widthOver = this._contentBounds.width - ( this._$measureLabel.outerWidth( true ) + labelPixel[ 0 ] ); + heightOver = this._contentBounds.height - ( this._$measureLabel.outerHeight( true ) + labelPixel[ 1 ] ); + + if ( widthOver < 0 ) { + labelPixel[ 0 ] += widthOver; + } + + if ( heightOver < 0 ) { + labelPixel[ 1 ] += heightOver; + } + + this._$measureLabel.css( { + left: labelPixel[ 0 ], + top: labelPixel[ 1 ] + } ).show(); + } + } + }, + + _resetDrawing: function () { + this._drawPixels = []; + this._drawCoords = []; + this._$drawContainer.geographics("clear"); + this._$measureLabel.hide(); + }, + + _refreshShapes: function (geographics, shapes, styles, labels, center, pixelSize) { + var i, mgi, + shape, + shapeBbox, + style, + label, + hasLabel, + labelPixel, + bbox = this._map._getBbox(center, pixelSize); + + for (i = 0; i < shapes.length; i++) { + shape = shapes[i].shape || shapes[i]; + shape = shape.geometry || shape; + shapeBbox = $.data(shape, "geoBbox"); + + if ( shapeBbox && $.geo._bboxDisjoint( bbox, shapeBbox ) ) { + continue; + } + + style = $.isArray(styles) ? styles[i].style : styles; + label = $.isArray(labels) ? labels[i].label : labels; + hasLabel = ( label !== undefined ); + labelPixel = undefined; + + switch (shape.type) { + case "Point": + labelPixel = this._map.toPixel( shape.coordinates, center, pixelSize ); + this._$shapesContainer.geographics("drawPoint", labelPixel, style); + break; + case "LineString": + this._$shapesContainer.geographics("drawLineString", this._map.toPixel(shape.coordinates, center, pixelSize), style); + if ( hasLabel ) { + labelPixel = this._map.toPixel( $.geo.pointAlong( shape, .5 ).coordinates, center, pixelSize ); + } + break; + case "Polygon": + this._$shapesContainer.geographics("drawPolygon", this._map.toPixel(shape.coordinates, center, pixelSize), style); + if ( hasLabel ) { + labelPixel = this._map.toPixel( $.geo.centroid( shape ).coordinates, center, pixelSize ); + } + break; + case "MultiPoint": + for (mgi = 0; mgi < shape.coordinates.length; mgi++) { + this._$shapesContainer.geographics("drawPoint", this._map.toPixel(shape.coordinates[mgi], center, pixelSize), style); + } + if ( hasLabel ) { + labelPixel = this._map.toPixel( $.geo.centroid( shape ).coordinates, center, pixelSize ); + } + break; + case "MultiLineString": + for (mgi = 0; mgi < shape.coordinates.length; mgi++) { + this._$shapesContainer.geographics("drawLineString", this._map.toPixel(shape.coordinates[mgi], center, pixelSize), style); + } + if ( hasLabel ) { + labelPixel = this._map.toPixel( $.geo.centroid( shape ).coordinates, center, pixelSize ); + } + break; + case "MultiPolygon": + for (mgi = 0; mgi < shape.coordinates.length; mgi++) { + this._$shapesContainer.geographics("drawPolygon", this._map.toPixel(shape.coordinates[mgi], center, pixelSize), style); + } + if ( hasLabel ) { + labelPixel = this._map.toPixel( $.geo.centroid( shape ).coordinates, center, pixelSize ); + } + break; + + case "GeometryCollection": + this._refreshShapes(geographics, shape.geometries, style, label, center, pixelSize); + break; + } + + if ( hasLabel && labelPixel ) { + this._$shapesContainer.geographics( "drawLabel", labelPixel, label ); + } + } + }, + + _findMapSize: function () { + // really, really attempt to find a size for this thing + // even if it's hidden (look at parents) + var size = { width: 0, height: 0 }, + sizeContainer = this._$elem; + + while (sizeContainer.size() && !(size["width"] > 0 && size["height"] > 0)) { + size = { width: sizeContainer.width(), height: sizeContainer.height() }; + if (size["width"] <= 0 || size["height"] <= 0) { + size = { width: parseInt(sizeContainer.css("width")), height: parseInt(sizeContainer.css("height")) }; + } + sizeContainer = sizeContainer.parent(); + } + return size; + }, + + _forcePosition: function (elem) { + var cssPosition = elem.css("position"); + if (cssPosition != "relative" && cssPosition != "absolute" && cssPosition != "fixed") { + elem.css("position", "relative"); + } + }, + + _getPixelSize: function ( zoom ) { + var tilingScheme = this._options["tilingScheme"]; + if (tilingScheme != null) { + if (zoom === 0) { + return tilingScheme.pixelSizes != null ? tilingScheme.pixelSizes[0] : tilingScheme.basePixelSize; + } + + zoom = Math.round(zoom); + zoom = Math.max(zoom, 0); + var levels = tilingScheme.pixelSizes != null ? tilingScheme.pixelSizes.length : tilingScheme.levels; + zoom = Math.min(zoom, levels - 1); + + if (tilingScheme.pixelSizes != null) { + return tilingScheme.pixelSizes[zoom]; + } else { + return tilingScheme.basePixelSize / Math.pow(2, zoom); + } + } else { + var bbox = $.geo.scaleBy( this._getBboxMax(), 1 / Math.pow( this._zoomFactor, zoom ), true ); + return Math.max( $.geo.width( bbox, true ) / this._contentBounds.width, $.geo.height( bbox, true ) / this._contentBounds.height ); + } + }, + + _getZoomCenterAndSize: function ( anchor, zoomDelta, full ) { + var zoomFactor = ( full ? this._fullZoomFactor : this._partialZoomFactor ), + scale = Math.pow( zoomFactor, -zoomDelta ), + pixelSize, + zoomLevel; + + if ( this._options[ "tilingScheme" ] ) { + zoomLevel = this._getZoom(this._center, this._pixelSize * scale); + pixelSize = this._getPixelSize(zoomLevel); + } else { + pixelSize = this._pixelSize * scale; + + if ( this._getZoom( this._center, pixelSize ) < 0 ) { + pixelSize = this._pixelSizeMax; + } + } + + var ratio = pixelSize / this._pixelSize, + anchorMapCoord = this._toMap(anchor), + centerDelta = [(this._center[0] - anchorMapCoord[0]) * ratio, (this._center[1] - anchorMapCoord[1]) * ratio], + scaleCenter = [anchorMapCoord[0] + centerDelta[0], anchorMapCoord[1] + centerDelta[1]]; + + return { pixelSize: pixelSize, center: scaleCenter }; + }, + + _mouseWheelFinish: function () { + this._wheelTimeout = null; + + if (this._wheelLevel != 0) { + var wheelCenterAndSize = this._getZoomCenterAndSize( this._anchor, this._wheelLevel, this._options[ "tilingScheme" ] != null ); + + this._setCenterAndSize(wheelCenterAndSize.center, wheelCenterAndSize.pixelSize, true, true); + + this._wheelLevel = 0; + } else { + this._refresh(); + } + }, + + _panEnd: function () { + this._velocity = [ + (this._velocity[0] > 0 ? Math.floor(this._velocity[0] * this._friction[0]) : Math.ceil(this._velocity[0] * this._friction[0])), + (this._velocity[1] > 0 ? Math.floor(this._velocity[1] * this._friction[1]) : Math.ceil(this._velocity[1] * this._friction[1])) + ]; + + if (Math.abs(this._velocity[0]) < 4 && Math.abs(this._velocity[1]) < 4) { + this._panFinalize(); + } else { + this._current = [ + this._current[0] + this._velocity[0], + this._current[1] + this._velocity[1] + ]; + + this._panMove(); + setTimeout($.proxy(this._panEnd, this), 30); + } + }, + + _panFinalize: function () { + if (this._panning) { + this._velocity = [0, 0]; + + var dx = this._current[0] - this._anchor[0], + dy = this._current[1] - this._anchor[1], + image = this._options[ "axisLayout" ] === "image", + dxMap = -dx * this._pixelSize, + dyMap = ( image ? -1 : 1 ) * dy * this._pixelSize; + + this._$panContainer.css({ left: 0, top: 0 }); + + this._$servicesContainer.find( ".geo-shapes-container" ).css( { left: 0, top: 0 } ); + + this._setCenterAndSize([this._center[0] + dxMap, this._center[1] + dyMap], this._pixelSize, true, true); + + this._$eventTarget.css("cursor", this._options["cursors"][this._options["mode"]]); + + this._inOp = false; + this._anchor = this._current; + this._mouseDown = this._toolPan = this._panning = false; + } + }, + + _panMove: function () { + if ( ! this._options[ "pannable" ] ) { + return; + } + + var dx = this._current[0] - this._lastDrag[0], + dy = this._current[1] - this._lastDrag[1], + i = 0, + service, + translateObj; + + if (this._toolPan || dx > 3 || dx < -3 || dy > 3 || dy < -3) { + if (!this._toolPan) { + this._toolPan = true; + this._$eventTarget.css("cursor", this._options["cursors"]["pan"]); + } + + if (this._mouseDown) { + this._velocity = [dx, dy]; + } + + if (dx != 0 || dy != 0) { + this._panning = true; + this._lastDrag = this._current; + + translateObj = { + left: function (index, value) { + return parseInt(value) + dx; + }, + top: function (index, value) { + return parseInt(value) + dy; + } + }; + + for ( i = 0; i < this._currentServices.length; i++ ) { + service = this._currentServices[ i ]; + $.geo[ "_serviceTypes" ][ service.type ].interactivePan( this, service, dx, dy ); + + service.serviceContainer.find( ".geo-shapes-container" ).css( translateObj ); + } + + this._$panContainer.css( translateObj ); + + //this._refreshDrawing(); + } + } + }, + + _refresh: function () { + var service, + i = 0; + + if ( this._$elem.is( ".geo-map" ) ) { + for ( ; i < this._currentServices.length; i++ ) { + service = this._currentServices[ i ]; + + if ( !this._mouseDown && $.geo[ "_serviceTypes" ][ service.type ] !== null ) { + $.geo[ "_serviceTypes" ][ service.type ].refresh( this, service ); + service.serviceContainer.geomap( "refresh" ); + } + } + } + + if ( this._$shapesContainer ) { + this._$shapesContainer.geographics( "clear" ); + if ( this._graphicShapes.length > 0 ) { + this._refreshShapes( this._$shapesContainer, this._graphicShapes, this._graphicShapes, this._graphicShapes ); + } + } + }, + + _setCenterAndSize: function (center, pixelSize, trigger, refresh) { + if ( ! $.isArray( center ) || center.length != 2 || typeof center[ 0 ] !== "number" || typeof center[ 1 ] !== "number" ) { + return; + } + + // the final call during any extent change + if (this._pixelSize != pixelSize) { + this._$elem.find( ".geo-shapes-container" ).geographics("clear"); + for (var i = 0; i < this._currentServices.length; i++) { + var service = this._currentServices[i]; + $.geo["_serviceTypes"][service.type].interactiveScale(this, service, center, pixelSize); + } + } + + this._center = $.merge( [ ], center ); + this._options["pixelSize"] = this._pixelSize = pixelSize; + + if ( this._userGeodetic ) { + this._options["bbox"] = $.geo.proj.toGeodetic( this._getBbox() ); + this._options["center"] = $.geo.proj.toGeodetic( this._center ); + } else { + this._options["bbox"] = this._getBbox(); + this._options["center"] = $.merge( [ ], center ); + } + + this._options["zoom"] = this._getZoom(); + + if (this._drawCoords.length > 0) { + this._drawPixels = this._toPixel(this._drawCoords); + } + + if (trigger) { + this._trigger("bboxchange", window.event, { bbox: $.merge( [ ], this._options["bbox"] ) }); + } + + if (refresh) { + this._refresh(); + this._refreshDrawing(); + } + }, + + _toMap: function (p, center, pixelSize) { + // ignores $.geo.proj + + center = center || this._center; + pixelSize = pixelSize || this._pixelSize; + + var isMultiPointOrLineString = $.isArray( p[ 0 ] ), + isMultiLineStringOrPolygon = isMultiPointOrLineString && $.isArray( p[ 0 ][ 0 ] ), + isMultiPolygon = isMultiLineStringOrPolygon && $.isArray( p[ 0 ][ 0 ][ 0 ] ), + width = this._contentBounds["width"], + height = this._contentBounds["height"], + halfWidth = width / 2 * pixelSize, + halfHeight = height / 2 * pixelSize, + bbox = [center[0] - halfWidth, center[1] - halfHeight, center[0] + halfWidth, center[1] + halfHeight], + xRatio = $.geo.width(bbox, true) / width, + yRatio = $.geo.height(bbox, true) / height, + yOffset, + image = this._options[ "axisLayout" ] === "image", + result = [], + i, j, k; + + if ( !isMultiPolygon ) { + if ( !isMultiLineStringOrPolygon ) { + if ( !isMultiPointOrLineString ) { + p = [ p ]; + } + p = [ p ]; + } + p = [ p ]; + } + + for ( i = 0; i < p.length; i++ ) { + result[ i ] = [ ]; + for ( j = 0; j < p[ i ].length; j++ ) { + result[ i ][ j ] = [ ]; + for ( k = 0; k < p[ i ][ j ].length; k++ ) { + yOffset = (p[ i ][ j ][ k ][1] * yRatio); + result[ i ][ j ][ k ] = [ + bbox[ 0 ] + ( p[ i ][ j ][ k ][ 0 ] * xRatio ), + image ? bbox[ 1 ] + yOffset : bbox[ 3 ] - yOffset + ]; + } + } + } + + return isMultiPolygon ? result : isMultiLineStringOrPolygon ? result[ 0 ] : isMultiPointOrLineString ? result[ 0 ][ 0 ] : result[ 0 ][ 0 ][ 0 ]; + }, + + _toPixel: function (p, center, pixelSize) { + // ignores $.geo.proj + + center = center || this._center; + pixelSize = pixelSize || this._pixelSize; + + var isMultiPointOrLineString = $.isArray( p[ 0 ] ), + isMultiLineStringOrPolygon = isMultiPointOrLineString && $.isArray( p[ 0 ][ 0 ] ), + isMultiPolygon = isMultiLineStringOrPolygon && $.isArray( p[ 0 ][ 0 ][ 0 ] ), + width = this._contentBounds["width"], + height = this._contentBounds["height"], + halfWidth = width / 2 * pixelSize, + halfHeight = height / 2 * pixelSize, + bbox = [center[0] - halfWidth, center[1] - halfHeight, center[0] + halfWidth, center[1] + halfHeight], + bboxWidth = $.geo.width(bbox, true), + bboxHeight = $.geo.height(bbox, true), + image = this._options[ "axisLayout" ] === "image", + xRatio = width / bboxWidth, + yRatio = height / bboxHeight, + result = [ ], + i, j, k; + + if ( !isMultiPolygon ) { + if ( !isMultiLineStringOrPolygon ) { + if ( !isMultiPointOrLineString ) { + p = [ p ]; + } + p = [ p ]; + } + p = [ p ]; + } + + for ( i = 0; i < p.length; i++ ) { + result[ i ] = [ ]; + for ( j = 0; j < p[ i ].length; j++ ) { + result[ i ][ j ] = [ ]; + for ( k = 0; k < p[ i ][ j ].length; k++ ) { + result[ i ][ j ][ k ] = [ + Math.round( ( p[ i ][ j ][ k ][ 0 ] - bbox[ 0 ] ) * xRatio ), + Math.round( ( image ? p[ i ][ j ][ k ][ 1 ] - bbox[ 1 ] : bbox[ 3 ] - p[ i ][ j ][ k ][ 1 ] ) * yRatio ) + ]; + } + } + } + + return isMultiPolygon ? result : isMultiLineStringOrPolygon ? result[ 0 ] : isMultiPointOrLineString ? result[ 0 ][ 0 ] : result[ 0 ][ 0 ][ 0 ]; + }, + + _zoomTo: function (coord, zoom, trigger, refresh) { + zoom = zoom < 0 ? 0 : zoom; + + var pixelSize = this._getPixelSize( zoom ); + + this._setCenterAndSize( coord, pixelSize, trigger, refresh ); + }, + + _document_keydown: function (e) { + var len = this._drawCoords.length; + if (len > 0 && e.which == 27) { + if (len <= 2) { + this._resetDrawing(); + this._inOp = false; + } else { + this._drawCoords[len - 2] = $.merge( [], this._drawCoords[ len - 1 ] ); + this._drawPixels[len - 2] = $.merge( [], this._drawPixels[ len - 1 ] ); + + this._drawCoords.length--; + this._drawPixels.length--; + + this._refreshDrawing(); + } + } + }, + + _eventTarget_dblclick_zoom: function(e) { + this._trigger("dblclick", e, { type: "Point", coordinates: this.toMap(this._current) }); + if (!e.isDefaultPrevented()) { + var centerAndSize = this._getZoomCenterAndSize(this._current, 1, true ); + this._setCenterAndSize(centerAndSize.center, centerAndSize.pixelSize, true, true); + } + }, + + _eventTarget_dblclick: function (e) { + if ( this._options[ "mode" ] === "static" ) { + return; + } + + this._panFinalize(); + + if (this._drawTimeout) { + window.clearTimeout(this._drawTimeout); + this._drawTimeout = null; + } + + var offset = $(e.currentTarget).offset(); + + switch (this._options["mode"]) { + case "drawLineString": + if ( this._drawCoords.length > 1 && ! ( this._drawCoords[0][0] == this._drawCoords[1][0] && + this._drawCoords[0][1] == this._drawCoords[1][1] ) ) { + this._drawCoords.length--; + this._trigger( "shape", e, { + type: "LineString", + coordinates: this._userGeodetic ? $.geo.proj.toGeodetic(this._drawCoords) : this._drawCoords + } ); + } else { + this._eventTarget_dblclick_zoom(e); + } + this._resetDrawing(); + break; + + case "drawPolygon": + if ( this._drawCoords.length > 1 && ! ( this._drawCoords[0][0] == this._drawCoords[1][0] && + this._drawCoords[0][1] == this._drawCoords[1][1] ) ) { + var endIndex = this._drawCoords.length - 1; + if (endIndex > 2) { + this._drawCoords[endIndex] = $.merge( [], this._drawCoords[0] ); + this._trigger( "shape", e, { + type: "Polygon", + coordinates: [ this._userGeodetic ? $.geo.proj.toGeodetic(this._drawCoords) : this._drawCoords ] + } ); + } + } else { + this._eventTarget_dblclick_zoom(e); + } + this._resetDrawing(); + break; + + case "measureLength": + case "measureArea": + this._resetDrawing(); + break; + + default: + this._eventTarget_dblclick_zoom(e); + break; + } + + this._inOp = false; + }, + + _eventTarget_touchstart: function (e) { + if ( this._options[ "mode" ] === "static" ) { + return; + } + + if ( !this._supportTouch && e.which != 1 ) { + return; + } + + this._panFinalize(); + this._mouseWheelFinish(); + + var offset = $(e.currentTarget).offset(), + touches = e.originalEvent.changedTouches; + + if ( this._supportTouch ) { + this._multiTouchAnchor = $.merge( [ ], touches ); + + this._isMultiTouch = this._multiTouchAnchor.length > 1; + + if ( this._isMultiTouch ) { + this._multiTouchCurrentBbox = [ + touches[0].pageX - offset.left, + touches[0].pageY - offset.top, + touches[1].pageX - offset.left, + touches[1].pageY - offset.top + ]; + + this._multiTouchAnchorBbox = $.merge( [ ], this._multiTouchCurrentBbox ); + + this._current = $.geo.center( this._multiTouchCurrentBbox, true ); + } else { + this._multiTouchCurrentBbox = [ + touches[0].pageX - offset.left, + touches[0].pageY - offset.top, + NaN, + NaN + ]; + + this._current = [ touches[0].pageX - offset.left, touches[0].pageY - offset.top ]; + } + } else { + this._current = [e.pageX - offset.left, e.pageY - offset.top]; + } + + if (this._softDblClick) { + var downDate = $.now(); + if (downDate - this._downDate < 750) { + if (this._isTap) { + var dx = this._current[0] - this._anchor[0], + dy = this._current[1] - this._anchor[1], + distance = Math.sqrt((dx * dx) + (dy * dy)); + if (distance > 8) { + this._isTap = false; + } else { + this._current = $.merge( [ ], this._anchor ); + } + } + + if (this._isDbltap) { + this._isDbltap = false; + } else { + this._isDbltap = this._isTap; + } + } else { + this._isDbltap = false; + } + this._isTap = true; + this._downDate = downDate; + } + + this._mouseDown = true; + this._anchor = $.merge( [ ], this._current ); + + if (!this._inOp && e.shiftKey) { + this._shiftZoom = true; + this._$eventTarget.css("cursor", this._options["cursors"]["zoom"]); + } else if ( !this._isMultiTouch && this._options[ "pannable" ] ) { + this._inOp = true; + + switch (this._options["mode"]) { + case "zoom": + break; + + default: + this._lastDrag = this._current; + + if (e.currentTarget.setCapture) { + e.currentTarget.setCapture(); + } + + break; + } + } + + e.preventDefault(); + return false; + }, + + _dragTarget_touchmove: function (e) { + if ( this._options[ "mode" ] === "static" ) { + return; + } + + var offset = this._$eventTarget.offset(), + drawCoordsLen = this._drawCoords.length, + touches = e.originalEvent.changedTouches, + current, + service, + i = 0; + + if ( this._supportTouch ) { + if ( !this._isMultiTouch && touches[ 0 ].identifier !== this._multiTouchAnchor[ 0 ].identifier ) { + // switch to multitouch + this._mouseDown = false; + this._dragTarget_touchstop( e ); + + this._isMultiTouch = true; + + this._multiTouchAnchor.push( touches[ 0 ] ); + + this._multiTouchCurrentBbox = [ + this._multiTouchCurrentBbox[ 0 ], + this._multiTouchCurrentBbox[ 1 ], + this._multiTouchAnchor[1].pageX - offset.left, + this._multiTouchAnchor[1].pageY - offset.top + ]; + + this._multiTouchAnchorBbox = $.merge( [ ], this._multiTouchCurrentBbox ); + + this._mouseDown = true; + this._anchor = this._current = $.geo.center( this._multiTouchCurrentBbox, true ); + + return false; + } + + if ( this._isMultiTouch ) { + for ( ; i < touches.length; i++ ) { + if ( touches[ i ].identifier === this._multiTouchAnchor[ 0 ].identifier ) { + this._multiTouchCurrentBbox[ 0 ] = touches[ i ].pageX - offset.left; + this._multiTouchCurrentBbox[ 1 ] = touches[ i ].pageY - offset.top; + } else if ( touches[ i ].identifier === this._multiTouchAnchor[ 1 ].identifier ) { + this._multiTouchCurrentBbox[ 2 ] = touches[ i ].pageX - offset.left; + this._multiTouchCurrentBbox[ 3 ] = touches[ i ].pageY - offset.top; + } + } + + current = $.geo.center( this._multiTouchCurrentBbox, true ); + + var currentWidth = this._multiTouchCurrentBbox[ 2 ] - this._multiTouchCurrentBbox[ 0 ], + anchorWidth = this._multiTouchAnchorBbox[ 2 ] - this._multiTouchAnchorBbox[ 0 ], + ratioWidth = currentWidth / anchorWidth; + + this._wheelLevel = Math.abs( Math.floor( ( 1 - ratioWidth ) * 10 ) ); + if ( Math.abs( currentWidth ) < Math.abs( anchorWidth ) ) { + this._wheelLevel = - this._wheelLevel; + } + + var pinchCenterAndSize = this._getZoomCenterAndSize( this._anchor, this._wheelLevel, false ); + this._$elem.find( ".geo-shapes-container" ).geographics("clear"); + + for ( i = 0; i < this._currentServices.length; i++ ) { + service = this._currentServices[ i ]; + $.geo[ "_serviceTypes" ][ service.type ].interactiveScale( this, service, pinchCenterAndSize.center, pinchCenterAndSize.pixelSize ); + } + + if (this._graphicShapes.length > 0 && this._graphicShapes.length < 256) { + this._refreshShapes(this._$shapesContainer, this._graphicShapes, this._graphicShapes, this._graphicShapes, pinchCenterAndSize.center, pinchCenterAndSize.pixelSize); + } + + + if (this._drawCoords.length > 0) { + this._drawPixels = this._toPixel(this._drawCoords, pinchCenterAndSize.center, pinchCenterAndSize.pixelSize); + this._refreshDrawing(); + } + + current = $.geo.center( this._multiTouchCurrentBbox, true ); + } else { + current = [e.originalEvent.changedTouches[0].pageX - offset.left, e.originalEvent.changedTouches[0].pageY - offset.top]; + } + } else { + current = [e.pageX - offset.left, e.pageY - offset.top]; + } + + if (current[0] === this._lastMove[0] && current[1] === this._lastMove[1]) { + if ( this._inOp ) { + e.preventDefault(); + return false; + } + } + + if ( _ieVersion == 7 ) { + this._isDbltap = this._isTap = false; + } + + if (this._mouseDown) { + this._current = current; + this._moveDate = $.now(); + } + + if ( this._isMultiTouch ) { + e.preventDefault( ); + this._isDbltap = this._isTap = false; + return false; + } + + var mode = this._shiftZoom ? "zoom" : this._options["mode"]; + + switch (mode) { + case "zoom": + if ( this._mouseDown ) { + this._$drawContainer.geographics( "clear" ); + this._$drawContainer.geographics( "drawBbox", [ + this._anchor[ 0 ], + this._anchor[ 1 ], + current[ 0 ], + current[ 1 ] + ] ); + } else { + this._trigger("move", e, { type: "Point", coordinates: this.toMap(current) }); + } + break; + + case "drawLineString": + case "drawPolygon": + case "measureLength": + case "measureArea": + if (this._mouseDown || this._toolPan) { + this._panMove(); + } else { + if (drawCoordsLen > 0) { + this._drawCoords[drawCoordsLen - 1] = this._toMap(current); + this._drawPixels[drawCoordsLen - 1] = current; + + this._refreshDrawing(); + } + + this._trigger("move", e, { type: "Point", coordinates: this.toMap(current) }); + } + break; + + default: + if (this._mouseDown || this._toolPan) { + this._panMove(); + } else { + this._trigger("move", e, { type: "Point", coordinates: this.toMap(current) }); + } + break; + } + + this._lastMove = current; + + if ( this._inOp ) { + e.preventDefault(); + return false; + } + }, + + _dragTarget_touchstop: function (e) { + if ( this._options[ "mode" ] === "static" ) { + return; + } + + if (!this._mouseDown && _ieVersion == 7) { + // ie7 doesn't appear to trigger dblclick on this._$eventTarget, + // we fake regular click here to cause soft dblclick + this._eventTarget_touchstart(e); + } + + var mouseWasDown = this._mouseDown, + wasToolPan = this._toolPan, + offset = this._$eventTarget.offset(), + mode = this._shiftZoom ? "zoom" : this._options["mode"], + current, i, clickDate, + dx, dy; + + if (this._supportTouch) { + current = [e.originalEvent.changedTouches[0].pageX - offset.left, e.originalEvent.changedTouches[0].pageY - offset.top]; + } else { + current = [e.pageX - offset.left, e.pageY - offset.top]; + } + + if (this._softDblClick) { + if (this._isTap) { + var dx = current[0] - this._anchor[0], + dy = current[1] - this._anchor[1], + distance = Math.sqrt((dx * dx) + (dy * dy)); + if (distance <= 8) { + current = $.merge( [ ], this._anchor ); + } + } + } + + dx = current[0] - this._anchor[0]; + dy = current[1] - this._anchor[1]; + + this._$eventTarget.css("cursor", this._options["cursors"][this._options["mode"]]); + + this._shiftZoom = this._mouseDown = this._toolPan = false; + + if ( this._isMultiTouch ) { + e.preventDefault( ); + this._isMultiTouch = false; + + var pinchCenterAndSize = this._getZoomCenterAndSize( this._anchor, this._wheelLevel, false ); + + this._setCenterAndSize(pinchCenterAndSize.center, pinchCenterAndSize.pixelSize, true, true); + + this._wheelLevel = 0; + + return false; + } + + if (document.releaseCapture) { + document.releaseCapture(); + } + + if (mouseWasDown) { + clickDate = $.now(); + this._current = current; + + switch (mode) { + case "zoom": + if ( dx > 0 || dy > 0 ) { + var minSize = this._pixelSize * 6, + bboxCoords = this._toMap( [ [ + Math.min( this._anchor[ 0 ], current[ 0 ] ), + Math.max( this._anchor[ 1 ], current[ 1 ] ) + ], [ + Math.max( this._anchor[ 0 ], current[ 0 ] ), + Math.min( this._anchor[ 1 ], current[ 1 ] ) + ] + ] ), + bbox = [ + bboxCoords[0][0], + bboxCoords[0][1], + bboxCoords[1][0], + bboxCoords[1][1] + ]; + + if ( ( bbox[2] - bbox[0] ) < minSize && ( bbox[3] - bbox[1] ) < minSize ) { + bbox = $.geo.scaleBy( this._getBbox( $.geo.center( bbox, true ) ), .5, true ); + } + + this._setBbox(bbox, true, true); + } + + this._resetDrawing(); + break; + + case "drawPoint": + if (this._drawTimeout) { + window.clearTimeout(this._drawTimeout); + this._drawTimeout = null; + } + + if (wasToolPan) { + this._panFinalize(); + } else { + if (clickDate - this._clickDate > 100) { + var geomap = this; + this._drawTimeout = setTimeout(function () { + if (geomap._drawTimeout) { + geomap._trigger("shape", e, { type: "Point", coordinates: geomap.toMap(current) }); + geomap._inOp = false; + geomap._drawTimeout = null; + } + }, 250); + } + } + break; + + case "drawLineString": + case "drawPolygon": + case "measureLength": + case "measureArea": + if (wasToolPan) { + this._panFinalize(); + } else { + i = (this._drawCoords.length == 0 ? 0 : this._drawCoords.length - 1); + + this._drawCoords[i] = this._toMap(current); + this._drawPixels[i] = current; + + if (i < 2 || !(this._drawCoords[i][0] == this._drawCoords[i-1][0] && + this._drawCoords[i][1] == this._drawCoords[i-1][1])) { + this._drawCoords[i + 1] = this._toMap(current); + this._drawPixels[i + 1] = current; + } + + this._refreshDrawing(); + } + break; + + default: + if (wasToolPan) { + this._panEnd(); + } else { + if (clickDate - this._clickDate > 100) { + this._trigger("click", e, { type: "Point", coordinates: this.toMap(current) }); + this._inOp = false; + } + } + break; + } + + this._clickDate = clickDate; + + if (this._softDblClick && this._isDbltap) { + this._isDbltap = this._isTap = false; + this._$eventTarget.trigger("dblclick", e); + } + } + + if ( this._inOp ) { + e.preventDefault(); + return false; + } + }, + + _eventTarget_mousewheel: function (e, delta) { + if ( this._options[ "mode" ] === "static" || this._options[ "scroll" ] === "off" ) { + return; + } + + e.preventDefault(); + + this._panFinalize(); + + if ( this._mouseDown ) { + return false; + } + + if (delta != 0) { + if (this._wheelTimeout) { + window.clearTimeout(this._wheelTimeout); + this._wheelTimeout = null; + } else { + var offset = $(e.currentTarget).offset(); + this._anchor = [e.pageX - offset.left, e.pageY - offset.top]; + } + + this._wheelLevel += delta; + + var wheelCenterAndSize = this._getZoomCenterAndSize( this._anchor, this._wheelLevel, this._options[ "tilingScheme" ] != null ), + service, + i = 0; + + this._$elem.find( ".geo-shapes-container" ).geographics("clear"); + + for ( ; i < this._currentServices.length; i++ ) { + service = this._currentServices[ i ]; + $.geo["_serviceTypes"][service.type].interactiveScale(this, service, wheelCenterAndSize.center, wheelCenterAndSize.pixelSize); + } + + if (this._graphicShapes.length > 0 && this._graphicShapes.length < 256) { + this._refreshShapes(this._$shapesContainer, this._graphicShapes, this._graphicShapes, this._graphicShapes, wheelCenterAndSize.center, wheelCenterAndSize.pixelSize); + } + + if (this._drawCoords.length > 0) { + this._drawPixels = this._toPixel(this._drawCoords, wheelCenterAndSize.center, wheelCenterAndSize.pixelSize); + this._refreshDrawing(); + } + + var geomap = this; + this._wheelTimeout = window.setTimeout(function () { + geomap._mouseWheelFinish(); + }, 1000); + } + + return false; + } + } + ); +})(jQuery); + + diff --git a/libs/js/jquery-geo-1.0a4/js/jquery.geo.head.js b/libs/js/jquery-geo-1.0a4/js/jquery.geo.head.js new file mode 100755 index 0000000..9f9faaf --- /dev/null +++ b/libs/js/jquery-geo-1.0a4/js/jquery.geo.head.js @@ -0,0 +1,23 @@ +// excanvas +// Copyright 2006 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/* + * AppGeo/geo + * (c) 2007-2011, Applied Geographics, Inc. All rights reserved. + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + */ + + diff --git a/libs/js/jquery-geo-1.0a4/js/jquery.geo.shingled.js b/libs/js/jquery-geo-1.0a4/js/jquery.geo.shingled.js new file mode 100755 index 0000000..a883dbe --- /dev/null +++ b/libs/js/jquery-geo-1.0a4/js/jquery.geo.shingled.js @@ -0,0 +1,272 @@ +(function ($, undefined) { + $.geo._serviceTypes.shingled = (function () { + return { + create: function (map, serviceContainer, service, index) { + var serviceState = $.data(service, "geoServiceState"); + + if ( !serviceState ) { + serviceState = { + loadCount: 0 + }; + + var scHtml = '
      '; + + serviceContainer.append(scHtml); + + serviceState.serviceContainer = serviceContainer.children(":last"); + $.data(service, "geoServiceState", serviceState); + } + + return serviceState.serviceContainer; + }, + + destroy: function (map, serviceContainer, service) { + var serviceState = $.data(service, "geoServiceState"); + + serviceState.serviceContainer.remove(); + + $.removeData(service, "geoServiceState"); + }, + + interactivePan: function (map, service, dx, dy) { + var serviceState = $.data(service, "geoServiceState"); + + if ( serviceState ) { + this._cancelUnloaded(map, service); + + var serviceContainer = serviceState.serviceContainer, + pixelSize = map._pixelSize, + scaleContainer = serviceContainer.children("[data-pixelSize='" + pixelSize + "']"), + panContainer = scaleContainer.children("div"); + + if ( !panContainer.length ) { + scaleContainer.children("img").wrap('
      '); + panContainer = scaleContainer.children("div"); + } + + panContainer.css( { + left: function (index, value) { + return parseInt(value) + dx; + }, + top: function (index, value) { + return parseInt(value) + dy; + } + } ); + + // until pan/zoom rewrite, remove all containers not in this scale + serviceContainer.children(":not([data-pixelSize='" + pixelSize + "'])").remove(); + } + }, + + interactiveScale: function (map, service, center, pixelSize) { + var serviceState = $.data(service, "geoServiceState"); + + if ( serviceState ) { + this._cancelUnloaded(map, service); + + var serviceContainer = serviceState.serviceContainer, + + contentBounds = map._getContentBounds(), + mapWidth = contentBounds["width"], + mapHeight = contentBounds["height"], + + halfWidth = mapWidth / 2, + halfHeight = mapHeight / 2, + + bbox = [center[0] - halfWidth, center[1] - halfHeight, center[0] + halfWidth, center[1] + halfHeight]; + + serviceContainer.children().each(function (i) { + var $scaleContainer = $(this), + scalePixelSize = $scaleContainer.attr("data-pixelSize"), + ratio = scalePixelSize / pixelSize; + + $scaleContainer.css( { + width: mapWidth * ratio, + height: mapHeight * ratio } ).children("img").each(function (i) { + var $img = $(this), + imgCenter = $img.data("center"), + x = (Math.round((imgCenter[0] - center[0]) / scalePixelSize) - halfWidth) * ratio, + y = (Math.round((center[1] - imgCenter[1]) / scalePixelSize) - halfHeight) * ratio; + + $img.css({ left: x + "px", top: y + "px" }); + }); + }); + } + }, + + refresh: function (map, service) { + var serviceState = $.data(service, "geoServiceState"); + + this._cancelUnloaded(map, service); + + if ( serviceState && service && service.style.visibility === "visible" && !( serviceState.serviceContainer.is( ":hidden" ) ) ) { + + var bbox = map._getBbox(), + pixelSize = map._pixelSize, + + serviceObj = this, + serviceContainer = serviceState.serviceContainer, + + contentBounds = map._getContentBounds(), + mapWidth = contentBounds["width"], + mapHeight = contentBounds["height"], + + halfWidth = mapWidth / 2, + halfHeight = mapHeight / 2, + + scaleContainer = serviceContainer.children('[data-pixelSize="' + pixelSize + '"]'), + + opacity = service.style.opacity, + + $img; + + if ( !scaleContainer.size() ) { + serviceContainer.append('
      '); + scaleContainer = serviceContainer.children(":last"); + } + + scaleContainer.children("img").each(function (i) { + var $thisimg = $(this), + imgCenter = $thisimg.data("center"), + center = map._getCenter(), + x = Math.round((imgCenter[0] - center[0]) / pixelSize) - halfWidth, + y = Math.round((center[1] - imgCenter[1]) / pixelSize) - halfHeight; + + $thisimg.css({ left: x + "px", top: y + "px" }); + }); + + if (opacity < 1) { + serviceContainer.find("img").attr("data-keepAlive", "0"); + } + + var urlProp = ( service.hasOwnProperty("src") ? "src" : "getUrl" ), + urlArgs = { + bbox: bbox, + width: mapWidth, + height: mapHeight, + zoom: map._getZoom(), + tile: null, + index: 0 + }, + isFunc = $.isFunction( service[ urlProp ] ), + imageUrl; + + + if ( isFunc ) { + imageUrl = service[ urlProp ]( urlArgs ); + } else { + $.template( "geoSrc", service[ urlProp ] ); + imageUrl = $.render( urlArgs, "geoSrc" ); + } + + serviceState.loadCount++; + //this._map._requestQueued(); + + scaleContainer.append(''); + $img = scaleContainer.children(":last").data("center", map._getCenter()); + + if ( typeof imageUrl === "string" ) { + serviceObj._loadImage( $img, imageUrl, pixelSize, serviceState, serviceContainer, opacity ); + } else { + // assume Deferred + imageUrl.done( function( url ) { + serviceObj._loadImage( $img, url, pixelSize, serviceState, serviceContainer, opacity ); + } ).fail( function( ) { + $img.remove( ); + serviceState.loadCount--; + } ); + } + + } + }, + + resize: function (map, service) { + var serviceState = $.data(service, "geoServiceState"); + + if ( serviceState && service && service.style.visibility === "visible" ) { + this._cancelUnloaded(map, service); + + var serviceContainer = serviceState.serviceContainer, + + contentBounds = map._getContentBounds(), + mapWidth = contentBounds["width"], + mapHeight = contentBounds["height"], + + halfWidth = mapWidth / 2, + halfHeight = mapHeight / 2, + + scaleContainer = serviceContainer.children(); + + scaleContainer.attr("data-pixelSize", "0"); + scaleContainer.css({ + left: halfWidth + 'px', + top: halfHeight + 'px' + }); + } + }, + + opacity: function ( map, service ) { + var serviceState = $.data( service, "geoServiceState" ); + serviceState.serviceContainer.find( "img" ).stop( true ).fadeTo( "fast", service.style.opacity ); + }, + + toggle: function (map, service) { + var serviceState = $.data(service, "geoServiceState"); + serviceState.serviceContainer.css("display", service.style.visibility === "visible" ? "block" : "none"); + }, + + _cancelUnloaded: function (map, service) { + var serviceState = $.data(service, "geoServiceState"); + + if (serviceState && serviceState.loadCount > 0) { + serviceState.serviceContainer.find("img:hidden").remove(); + while (serviceState.loadCount > 0) { + serviceState.loadCount--; + } + } + }, + + _loadImage: function ( $img, url, pixelSize, serviceState, serviceContainer, opacity ) { + $img.load(function (e) { + if (opacity < 1) { + $(e.target).fadeTo(0, opacity); + } else { + $(e.target).show(); + } + + serviceState.loadCount--; + + if (serviceState.loadCount <= 0) { + serviceContainer.children(':not([data-pixelSize="' + pixelSize + '"])').remove(); + + var panContainer = serviceContainer.find('[data-pixelSize="' + pixelSize + '"]>div'); + if (panContainer.size() > 0) { + var panContainerPos = panContainer.position(); + + panContainer.children("img").each(function (i) { + var $thisimg = $(this), + x = panContainerPos.left + parseInt($thisimg.css("left")), + y = panContainerPos.top + parseInt($thisimg.css("top")); + + $thisimg.css({ left: x + "px", top: y + "px" }); + }).unwrap(); + + panContainer.remove(); + } + + serviceState.loadCount = 0; + } + }).error(function (e) { + $(e.target).remove(); + serviceState.loadCount--; + + if (serviceState.loadCount <= 0) { + serviceContainer.children(":not([data-pixelSize='" + pixelSize + "'])").remove(); + serviceState.loadCount = 0; + } + }).attr("src", url); + } + } + })(); +})(jQuery); + diff --git a/libs/js/jquery-geo-1.0a4/js/jquery.geo.tiled.js b/libs/js/jquery-geo-1.0a4/js/jquery.geo.tiled.js new file mode 100755 index 0000000..e99b2ea --- /dev/null +++ b/libs/js/jquery-geo-1.0a4/js/jquery.geo.tiled.js @@ -0,0 +1,441 @@ +(function ($, undefined) { + $.geo._serviceTypes.tiled = (function () { + return { + create: function (map, serviceContainer, service, index) { + var serviceState = $.data(service, "geoServiceState"); + + if ( !serviceState ) { + serviceState = { + loadCount: 0, + reloadTiles: false + }; + + var scHtml = '
      '; + + serviceContainer.append(scHtml); + + serviceState.serviceContainer = serviceContainer.children( ":last" ); + + $.data(service, "geoServiceState", serviceState); + } + + return serviceState.serviceContainer; + }, + + destroy: function (map, serviceContainer, service) { + var serviceState = $.data(service, "geoServiceState"); + + serviceState.serviceContainer.remove(); + + $.removeData(service, "geoServiceState"); + }, + + interactivePan: function ( map, service, dx, dy ) { + var serviceState = $.data( service, "geoServiceState" ); + + if ( serviceState ) { + this._cancelUnloaded( map, service ); + + serviceState.serviceContainer.children( ).css( "-moz-transition", "").css( { + webkitTransition: "", + transition: "", + left: function ( index, value ) { + return parseInt( value ) + dx; + }, + top: function ( index, value ) { + return parseInt( value ) + dy; + } + }); + + if ( service && service.style.visibility === "visible" ) { + var pixelSize = map._pixelSize, + + serviceObj = this, + serviceContainer = serviceState.serviceContainer, + scaleContainer = serviceContainer.children("[data-pixelSize='" + pixelSize + "']"), + + /* same as refresh 1 */ + contentBounds = map._getContentBounds(), + mapWidth = contentBounds["width"], + mapHeight = contentBounds["height"], + + image = map.options[ "axisLayout" ] === "image", + ySign = image ? +1 : -1, + + tilingScheme = map.options["tilingScheme"], + tileWidth = tilingScheme.tileWidth, + tileHeight = tilingScheme.tileHeight, + /* end same as refresh 1 */ + + halfWidth = mapWidth / 2 * pixelSize, + halfHeight = mapHeight / 2 * pixelSize, + + currentPosition = scaleContainer.position(), + scaleOriginParts = scaleContainer.data("scaleOrigin").split(","), + totalDx = parseInt(scaleOriginParts[0]) - currentPosition.left, + totalDy = parseInt(scaleOriginParts[1]) - currentPosition.top, + + mapCenterOriginal = map._getCenter(), + mapCenter = [ + mapCenterOriginal[0] + totalDx * pixelSize, + mapCenterOriginal[1] + ySign * totalDy * pixelSize + ], + + /* same as refresh 2 */ + tileX = Math.floor(((mapCenter[0] - halfWidth) - tilingScheme.origin[0]) / (pixelSize * tileWidth)), + tileY = Math.max( Math.floor(( image ? (mapCenter[1] - halfHeight) - tilingScheme.origin[1] : tilingScheme.origin[1] - (mapCenter[1] + halfHeight)) / (pixelSize * tileHeight)), 0 ), + tileX2 = Math.ceil(((mapCenter[0] + halfWidth) - tilingScheme.origin[0]) / (pixelSize * tileWidth)), + tileY2 = Math.ceil(( image ? (mapCenter[1] + halfHeight) - tilingScheme.origin[1] : tilingScheme.origin[1] - (mapCenter[1] - halfHeight)) / (pixelSize * tileHeight)), + + bboxMax = map._getBboxMax(), + pixelSizeAtZero = map._getPixelSize(0), + ratio = pixelSizeAtZero / pixelSize, + fullXAtScale = Math.floor((bboxMax[0] - tilingScheme.origin[0]) / (pixelSizeAtZero * tileWidth)) * ratio, + fullYAtScale = Math.floor((tilingScheme.origin[1] + ySign * bboxMax[3]) / (pixelSizeAtZero * tileHeight)) * ratio, + + fullXMinX = tilingScheme.origin[0] + (fullXAtScale * tileWidth) * pixelSize, + fullYMinOrMaxY = tilingScheme.origin[1] + ySign * (fullYAtScale * tileHeight) * pixelSize, + /* end same as refresh 2 */ + + serviceLeft = Math.round((fullXMinX - (mapCenterOriginal[0] - halfWidth)) / pixelSize), + serviceTop = Math.round(( image ? fullYMinOrMaxY - (mapCenterOriginal[1] - halfHeight) : (mapCenterOriginal[1] + halfHeight) - fullYMinOrMaxY ) / pixelSize), + + opacity = service.style.opacity, + + x, y; + + for ( x = tileX; x < tileX2; x++ ) { + for ( y = tileY; y < tileY2; y++ ) { + var tileStr = "" + x + "," + y, + $img = scaleContainer.children("[data-tile='" + tileStr + "']").removeAttr("data-dirty"); + + if ( $img.size( ) === 0 ) { + /* same as refresh 3 */ + var bottomLeft = [ + tilingScheme.origin[0] + (x * tileWidth) * pixelSize, + tilingScheme.origin[1] + ySign * (y * tileHeight) * pixelSize + ], + + topRight = [ + tilingScheme.origin[0] + ((x + 1) * tileWidth - 1) * pixelSize, + tilingScheme.origin[1] + ySign * ((y + 1) * tileHeight - 1) * pixelSize + ], + + tileBbox = [bottomLeft[0], bottomLeft[1], topRight[0], topRight[1]], + + urlProp = ( service.hasOwnProperty("src") ? "src" : "getUrl" ), + urlArgs = { + bbox: tileBbox, + width: tileWidth, + height: tileHeight, + zoom: map._getZoom(), + tile: { + row: y, + column: x + }, + index: Math.abs(y + x) + }, + isFunc = $.isFunction( service[ urlProp ] ), + imageUrl; + + if ( isFunc ) { + imageUrl = service[ urlProp ]( urlArgs ); + } else { + $.template( "geoSrc", service[ urlProp ] ); + imageUrl = $.render( urlArgs, "geoSrc" ); + } + /* end same as refresh 3 */ + + serviceState.loadCount++; + //this._map._requestQueued(); + + if ( serviceState.reloadTiles && $img.size() > 0 ) { + $img.attr( "src", imageUrl ); + } else { + /* same as refresh 4 */ + var imgMarkup = ""; + + scaleContainer.append( imgMarkup ); + $img = scaleContainer.children(":last"); + } + + if ( typeof imageUrl === "string" ) { + serviceObj._loadImage( $img, imageUrl, pixelSize, serviceState, serviceContainer, opacity ); + } else { + // assume Deferred + imageUrl.done( function( url ) { + serviceObj._loadImage( $img, url, pixelSize, serviceState, serviceContainer, opacity ); + } ).fail( function( ) { + $img.remove( ); + serviceState.loadCount--; + } ); + } + + /* end same as refresh 4 */ + } + } + } + } + } + }, + + interactiveScale: function (map, service, center, pixelSize) { + var serviceState = $.data( service, "geoServiceState" ); + + if ( serviceState && service && service.style.visibility === "visible" ) { + this._cancelUnloaded(map, service); + + var serviceContainer = serviceState.serviceContainer, + + tilingScheme = map.options["tilingScheme"], + tileWidth = tilingScheme.tileWidth, + tileHeight = tilingScheme.tileHeight; + + + serviceContainer.children( ).each( function ( i ) { + var $scaleContainer = $(this), + scaleRatio = $scaleContainer.attr("data-pixelSize") / pixelSize, + transitionCss = ""; //"width .25s ease-in, height .25s ease-in, left .25s ease-in, top .25s ease-in"; + + scaleRatio = Math.round(scaleRatio * 1000) / 1000; + + + var scaleOriginParts = $scaleContainer.data("scaleOrigin").split(","), + oldMapCoord = map._toMap([scaleOriginParts[0], scaleOriginParts[1]]), + newPixelPoint = map._toPixel(oldMapCoord, center, pixelSize); + + $scaleContainer.css( "-moz-transition", transitionCss ).css( { + webkitTransition: transitionCss, + transition: transitionCss, + left: Math.round(newPixelPoint[0]) + "px", + top: Math.round(newPixelPoint[1]) + "px", + width: tileWidth * scaleRatio, + height: tileHeight * scaleRatio + } ); + + if ( $("body")[0].filters !== undefined ) { + $scaleContainer.children().each( function ( i ) { + $( this ).css( "filter", "progid:DXImageTransform.Microsoft.Matrix(FilterType=bilinear,M11=" + scaleRatio + ",M22=" + scaleRatio + ",sizingmethod='auto expand')" ); + } ); + } + }); + } + }, + + refresh: function (map, service) { + var serviceState = $.data( service, "geoServiceState" ); + + this._cancelUnloaded(map, service); + + if ( serviceState && service && service.style.visibility === "visible" && !( serviceState.serviceContainer.is( ":hidden" ) ) ) { + + var bbox = map._getBbox(), + pixelSize = map._pixelSize, + + serviceObj = this, + $serviceContainer = serviceState.serviceContainer, + + contentBounds = map._getContentBounds(), + mapWidth = contentBounds["width"], + mapHeight = contentBounds["height"], + + image = map.options[ "axisLayout" ] === "image", + ySign = image ? +1 : -1, + + tilingScheme = map.options["tilingScheme"], + tileWidth = tilingScheme.tileWidth, + tileHeight = tilingScheme.tileHeight, + + tileX = Math.floor((bbox[0] - tilingScheme.origin[0]) / (pixelSize * tileWidth)), + tileY = Math.max( Math.floor( ( image ? bbox[1] - tilingScheme.origin[1] : tilingScheme.origin[1] - bbox[ 3 ] ) / (pixelSize * tileHeight) ), 0 ), + tileX2 = Math.ceil((bbox[2] - tilingScheme.origin[0]) / (pixelSize * tileWidth)), + tileY2 = Math.ceil( ( image ? bbox[3] - tilingScheme.origin[1] : tilingScheme.origin[1] - bbox[ 1 ] ) / (pixelSize * tileHeight) ), + + bboxMax = map._getBboxMax(), + pixelSizeAtZero = map._getPixelSize(0), + ratio = pixelSizeAtZero / pixelSize, + fullXAtScale = Math.floor((bboxMax[0] - tilingScheme.origin[0]) / (pixelSizeAtZero * tileWidth)) * ratio, + fullYAtScale = Math.floor((tilingScheme.origin[1] + ySign * bboxMax[3]) / (pixelSizeAtZero * tileHeight)) * ratio, + + fullXMinX = tilingScheme.origin[0] + (fullXAtScale * tileWidth) * pixelSize, + fullYMinOrMaxY = tilingScheme.origin[1] + ySign * (fullYAtScale * tileHeight) * pixelSize, + + serviceLeft = Math.round((fullXMinX - bbox[0]) / pixelSize), + serviceTop = Math.round( ( image ? fullYMinOrMaxY - bbox[1] : bbox[3] - fullYMinOrMaxY ) / pixelSize), + + scaleContainers = $serviceContainer.children().show(), + scaleContainer = scaleContainers.filter("[data-pixelSize='" + pixelSize + "']").appendTo($serviceContainer), + + opacity = service.style.opacity, + + x, y; + + if (serviceState.reloadTiles) { + scaleContainers.find("img").attr("data-dirty", "true"); + } + + if (!scaleContainer.size()) { + $serviceContainer.append("
      "); + scaleContainer = $serviceContainer.children(":last").data("scaleOrigin", (serviceLeft % tileWidth) + "," + (serviceTop % tileHeight)); + } else { + scaleContainer.css({ + left: (serviceLeft % tileWidth) + "px", + top: (serviceTop % tileHeight) + "px" + }).data("scaleOrigin", (serviceLeft % tileWidth) + "," + (serviceTop % tileHeight)); + + scaleContainer.children().each(function (i) { + var + $img = $(this), + tile = $img.attr("data-tile").split(","); + + $img.css({ + left: Math.round(((parseInt(tile[0]) - fullXAtScale) * 100) + (serviceLeft - (serviceLeft % tileWidth)) / tileWidth * 100) + "%", + top: Math.round(((parseInt(tile[1]) - fullYAtScale) * 100) + (serviceTop - (serviceTop % tileHeight)) / tileHeight * 100) + "%" + }); + + if (opacity < 1) { + $img.fadeTo(0, opacity); + } + }); + } + + for (x = tileX; x < tileX2; x++) { + for (y = tileY; y < tileY2; y++) { + var tileStr = "" + x + "," + y, + $img = scaleContainer.children("[data-tile='" + tileStr + "']").removeAttr("data-dirty"); + + if ($img.size() === 0 || serviceState.reloadTiles) { + var bottomLeft = [ + tilingScheme.origin[0] + (x * tileWidth) * pixelSize, + tilingScheme.origin[1] + ySign * (y * tileHeight) * pixelSize + ], + + topRight = [ + tilingScheme.origin[0] + ((x + 1) * tileWidth - 1) * pixelSize, + tilingScheme.origin[1] + ySign * ((y + 1) * tileHeight - 1) * pixelSize + ], + + tileBbox = [bottomLeft[0], bottomLeft[1], topRight[0], topRight[1]], + + urlProp = ( service.hasOwnProperty( "src" ) ? "src" : "getUrl" ), + urlArgs = { + bbox: tileBbox, + width: tileWidth, + height: tileHeight, + zoom: map._getZoom(), + tile: { + row: y, + column: x + }, + index: Math.abs(y + x) + }, + isFunc = $.isFunction( service[ urlProp ] ), + imageUrl; + + if ( isFunc ) { + imageUrl = service[ urlProp ]( urlArgs ); + } else { + $.template( "geoSrc", service[ urlProp ] ); + imageUrl = $.render( urlArgs, "geoSrc" ); + } + + serviceState.loadCount++; + //this._map._requestQueued(); + + if (serviceState.reloadTiles && $img.size() > 0) { + $img.attr("src", imageUrl); + } else { + var imgMarkup = ""; + + scaleContainer.append(imgMarkup); + $img = scaleContainer.children(":last"); + } + + if ( typeof imageUrl === "string" ) { + serviceObj._loadImage( $img, imageUrl, pixelSize, serviceState, $serviceContainer, opacity ); + } else { + // assume Deferred + imageUrl.done( function( url ) { + serviceObj._loadImage( $img, url, pixelSize, serviceState, $serviceContainer, opacity ); + } ).fail( function( ) { + $img.remove( ); + serviceState.loadCount--; + } ); + } + } + } + } + + scaleContainers.find("[data-dirty]").remove(); + serviceState.reloadTiles = false; + } + }, + + resize: function (map, service) { + }, + + opacity: function ( map, service ) { + var serviceState = $.data( service, "geoServiceState" ); + serviceState.serviceContainer.find( "img" ).stop( true ).fadeTo( "fast", service.style.opacity ); + }, + + toggle: function ( map, service ) { + var serviceState = $.data( service, "geoServiceState" ); + serviceState.serviceContainer.css( "display", service.style.visibility === "visible" ? "block" : "none" ); + }, + + _cancelUnloaded: function (map, service) { + var serviceState = $.data( service, "geoServiceState" ); + + if (serviceState && serviceState.loadCount > 0) { + serviceState.serviceContainer.find("img:hidden").remove(); + while (serviceState.loadCount > 0) { + serviceState.loadCount--; + } + } + }, + + _loadImage: function ( $img, url, pixelSize, serviceState, serviceContainer, opacity ) { + $img.load(function (e) { + if (opacity < 1) { + $(e.target).fadeTo(0, opacity); + } else { + $(e.target).show(); + } + + serviceState.loadCount--; + + if (serviceState.loadCount <= 0) { + serviceContainer.children(":not([data-pixelSize='" + pixelSize + "'])").remove(); + serviceState.loadCount = 0; + } + }).error(function (e) { + $(e.target).remove(); + serviceState.loadCount--; + + if (serviceState.loadCount <= 0) { + serviceContainer.children(":not([data-pixelSize='" + pixelSize + "'])").remove(); + serviceState.loadCount = 0; + } + }).attr("src", url); + } + }; + })(); +})(jQuery); + diff --git a/libs/js/jquery-geo-1.0a4/js/jquery.mousewheel.js b/libs/js/jquery-geo-1.0a4/js/jquery.mousewheel.js new file mode 100755 index 0000000..38b6095 --- /dev/null +++ b/libs/js/jquery-geo-1.0a4/js/jquery.mousewheel.js @@ -0,0 +1,84 @@ +/*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net) + * Licensed under the MIT License (LICENSE.txt). + * + * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers. + * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix. + * Thanks to: Seamus Leahy for adding deltaX and deltaY + * + * Version: 3.0.6 + * + * Requires: 1.2.2+ + */ + +(function($) { + +var types = ['DOMMouseScroll', 'mousewheel']; + +if ($.event.fixHooks) { + for ( var i=types.length; i; ) { + $.event.fixHooks[ types[--i] ] = $.event.mouseHooks; + } +} + +$.event.special.mousewheel = { + setup: function() { + if ( this.addEventListener ) { + for ( var i=types.length; i; ) { + this.addEventListener( types[--i], handler, false ); + } + } else { + this.onmousewheel = handler; + } + }, + + teardown: function() { + if ( this.removeEventListener ) { + for ( var i=types.length; i; ) { + this.removeEventListener( types[--i], handler, false ); + } + } else { + this.onmousewheel = null; + } + } +}; + +$.fn.extend({ + mousewheel: function(fn) { + return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel"); + }, + + unmousewheel: function(fn) { + return this.unbind("mousewheel", fn); + } +}); + + +function handler(event) { + var orgEvent = event || window.event, args = [].slice.call( arguments, 1 ), delta = 0, returnValue = true, deltaX = 0, deltaY = 0; + event = $.event.fix(orgEvent); + event.type = "mousewheel"; + + // Old school scrollwheel delta + if ( orgEvent.wheelDelta ) { delta = orgEvent.wheelDelta/120; } + if ( orgEvent.detail ) { delta = -orgEvent.detail/3; } + + // New school multidimensional scroll (touchpads) deltas + deltaY = delta; + + // Gecko + if ( orgEvent.axis !== undefined && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) { + deltaY = 0; + deltaX = -1*delta; + } + + // Webkit + if ( orgEvent.wheelDeltaY !== undefined ) { deltaY = orgEvent.wheelDeltaY/120; } + if ( orgEvent.wheelDeltaX !== undefined ) { deltaX = -1*orgEvent.wheelDeltaX/120; } + + // Add event and delta to the front of the arguments + args.unshift(event, delta, deltaX, deltaY); + + return ($.event.dispatch || $.event.handle).apply(this, args); +} + +})(jQuery); diff --git a/libs/js/jquery-geo-1.0a4/js/jquery.mousewheel.min.js b/libs/js/jquery-geo-1.0a4/js/jquery.mousewheel.min.js new file mode 100755 index 0000000..3390202 --- /dev/null +++ b/libs/js/jquery-geo-1.0a4/js/jquery.mousewheel.min.js @@ -0,0 +1,12 @@ +/*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net) + * Licensed under the MIT License (LICENSE.txt). + * + * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers. + * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix. + * Thanks to: Seamus Leahy for adding deltaX and deltaY + * + * Version: 3.0.6 + * + * Requires: 1.2.2+ + */ +(function(a){function d(b){var c=b||window.event,d=[].slice.call(arguments,1),e=0,f=!0,g=0,h=0;return b=a.event.fix(c),b.type="mousewheel",c.wheelDelta&&(e=c.wheelDelta/120),c.detail&&(e=-c.detail/3),h=e,c.axis!==undefined&&c.axis===c.HORIZONTAL_AXIS&&(h=0,g=-1*e),c.wheelDeltaY!==undefined&&(h=c.wheelDeltaY/120),c.wheelDeltaX!==undefined&&(g=-1*c.wheelDeltaX/120),d.unshift(b,e,g,h),(a.event.dispatch||a.event.handle).apply(this,d)}var b=["DOMMouseScroll","mousewheel"];if(a.event.fixHooks)for(var c=b.length;c;)a.event.fixHooks[b[--c]]=a.event.mouseHooks;a.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=b.length;a;)this.addEventListener(b[--a],d,!1);else this.onmousewheel=d},teardown:function(){if(this.removeEventListener)for(var a=b.length;a;)this.removeEventListener(b[--a],d,!1);else this.onmousewheel=null}},a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery) diff --git a/libs/js/jquery-geo-1.0a4/js/jquery.ui.widget.js b/libs/js/jquery-geo-1.0a4/js/jquery.ui.widget.js new file mode 100755 index 0000000..75e0b36 --- /dev/null +++ b/libs/js/jquery-geo-1.0a4/js/jquery.ui.widget.js @@ -0,0 +1,278 @@ +/*! + * jQuery UI Widget @VERSION + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Widget + */ + +if ( ! $.widget ) { + +(function( $, undefined ) { + +// jQuery 1.4+ +if ( $.cleanData ) { + var _cleanData = $.cleanData; + $.cleanData = function( elems ) { + for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) { + try { + $( elem ).triggerHandler( "remove" ); + // http://bugs.jquery.com/ticket/8235 + } catch( e ) {} + } + _cleanData( elems ); + }; +} else { + var _remove = $.fn.remove; + $.fn.remove = function( selector, keepData ) { + return this.each(function() { + if ( !keepData ) { + if ( !selector || $.filter( selector, [ this ] ).length ) { + $( "*", this ).add( [ this ] ).each(function() { + try { + $( this ).triggerHandler( "remove" ); + // http://bugs.jquery.com/ticket/8235 + } catch( e ) {} + }); + } + } + return _remove.call( $(this), selector, keepData ); + }); + }; +} + +$.widget = function( name, base, prototype ) { + var namespace = name.split( "." )[ 0 ], + fullName; + name = name.split( "." )[ 1 ]; + fullName = namespace + "-" + name; + + if ( !prototype ) { + prototype = base; + base = $.Widget; + } + + // create selector for plugin + $.expr[ ":" ][ fullName ] = function( elem ) { + return !!$.data( elem, name ); + }; + + $[ namespace ] = $[ namespace ] || {}; + $[ namespace ][ name ] = function( options, element ) { + // allow instantiation without initializing for simple inheritance + if ( arguments.length ) { + this._createWidget( options, element ); + } + }; + + var basePrototype = new base(); + // we need to make the options hash a property directly on the new instance + // otherwise we'll modify the options hash on the prototype that we're + // inheriting from +// $.each( basePrototype, function( key, val ) { +// if ( $.isPlainObject(val) ) { +// basePrototype[ key ] = $.extend( {}, val ); +// } +// }); + basePrototype.options = $.extend( true, {}, basePrototype.options ); + $[ namespace ][ name ].prototype = $.extend( true, basePrototype, { + namespace: namespace, + widgetName: name, + widgetEventPrefix: $[ namespace ][ name ].prototype.widgetEventPrefix || name, + widgetBaseClass: fullName + }, prototype ); + + $.widget.bridge( name, $[ namespace ][ name ] ); +}; + +$.widget.bridge = function( name, object ) { + $.fn[ name ] = function( options ) { + var isMethodCall = typeof options === "string", + args = Array.prototype.slice.call( arguments, 1 ), + returnValue = this; + + // allow multiple hashes to be passed on init + options = !isMethodCall && args.length ? + $.extend.apply( null, [ true, options ].concat(args) ) : + options; + + // prevent calls to internal methods + if ( isMethodCall && options.charAt( 0 ) === "_" ) { + return returnValue; + } + + if ( isMethodCall ) { + this.each(function() { + var instance = $.data( this, name ), + methodValue = instance && $.isFunction( instance[options] ) ? + instance[ options ].apply( instance, args ) : + instance; + // TODO: add this back in 1.9 and use $.error() (see #5972) +// if ( !instance ) { +// throw "cannot call methods on " + name + " prior to initialization; " + +// "attempted to call method '" + options + "'"; +// } +// if ( !$.isFunction( instance[options] ) ) { +// throw "no such method '" + options + "' for " + name + " widget instance"; +// } +// var methodValue = instance[ options ].apply( instance, args ); + if ( methodValue !== instance && methodValue !== undefined ) { + returnValue = methodValue; + return false; + } + }); + } else { + this.each(function() { + var instance = $.data( this, name ); + if ( instance ) { + instance.option( options || {} )._init(); + } else { + $.data( this, name, new object( options, this ) ); + } + }); + } + + return returnValue; + }; +}; + +$.Widget = function( options, element ) { + // allow instantiation without initializing for simple inheritance + if ( arguments.length ) { + this._createWidget( options, element ); + } +}; + +$.Widget.prototype = { + widgetName: "widget", + widgetEventPrefix: "", + options: { + disabled: false + }, + _createWidget: function( options, element ) { + // $.widget.bridge stores the plugin instance, but we do it anyway + // so that it's stored even before the _create function runs + $.data( element, this.widgetName, this ); + this.element = $( element ); + this.options = $.extend( true, {}, + this.options, + this._getCreateOptions(), + options ); + + var self = this; + this.element.bind( "remove." + this.widgetName, function() { + self.destroy(); + }); + + this._create(); + this._trigger( "create" ); + this._init(); + }, + _getCreateOptions: function() { + return $.metadata && $.metadata.get( this.element[0] )[ this.widgetName ]; + }, + _create: function() {}, + _init: function() {}, + + destroy: function() { + this.element + .unbind( "." + this.widgetName ) + .removeData( this.widgetName ); + this.widget() + .unbind( "." + this.widgetName ) + .removeAttr( "aria-disabled" ) + .removeClass( + this.widgetBaseClass + "-disabled " + + "ui-state-disabled" ); + }, + + widget: function() { + return this.element; + }, + + option: function( key, value ) { + var options = key; + + if ( arguments.length === 0 ) { + // don't return a reference to the internal hash + return $.extend( {}, this.options ); + } + + if (typeof key === "string" ) { + if ( value === undefined ) { + return this.options[ key ]; + } + options = {}; + options[ key ] = value; + } + + this._setOptions( options ); + + return this; + }, + _setOptions: function( options ) { + var self = this; + $.each( options, function( key, value ) { + self._setOption( key, value ); + }); + + return this; + }, + _setOption: function( key, value ) { + this.options[ key ] = value; + + if ( key === "disabled" ) { + this.widget() + [ value ? "addClass" : "removeClass"]( + this.widgetBaseClass + "-disabled" + " " + + "ui-state-disabled" ) + .attr( "aria-disabled", value ); + } + + return this; + }, + + enable: function() { + return this._setOption( "disabled", false ); + }, + disable: function() { + return this._setOption( "disabled", true ); + }, + + _trigger: function( type, event, data ) { + var prop, orig, + callback = this.options[ type ]; + + data = data || {}; + event = $.Event( event ); + event.type = ( type === this.widgetEventPrefix ? + type : + this.widgetEventPrefix + type ).toLowerCase(); + // the original event may come from any element + // so we need to reset the target on the new event + event.target = this.element[ 0 ]; + + // copy original event properties over to the new event + orig = event.originalEvent; + if ( orig ) { + for ( prop in orig ) { + if ( !( prop in event ) ) { + event[ prop ] = orig[ prop ]; + } + } + } + + this.element.trigger( event, data ); + + return !( $.isFunction(callback) && + callback.call( this.element[0], event, data ) === false || + event.isDefaultPrevented() ); + } +}; + +})( jQuery ); + +} + diff --git a/libs/js/jquery-geo-1.0a4/js/jsrender.js b/libs/js/jquery-geo-1.0a4/js/jsrender.js new file mode 100755 index 0000000..5998650 --- /dev/null +++ b/libs/js/jquery-geo-1.0a4/js/jsrender.js @@ -0,0 +1,573 @@ +/*! JsRender v1.0pre - (jsrender.js version: does not require jQuery): http://github.com/BorisMoore/jsrender */ +/* + * Optimized version of jQuery Templates, fosr rendering to string, using 'codeless' markup. + * + * Copyright 2011, Boris Moore + * Released under the MIT License. + */ +window.JsViews || window.jQuery && jQuery.views || (function( window, undefined ) { + +var $, _$, JsViews, viewsNs, tmplEncode, render, rTag, registerTags, registerHelpers, extend, + FALSE = false, TRUE = true, + jQuery = window.jQuery, document = window.document, + htmlExpr = /^[^<]*(<[\w\W]+>)[^>]*$|\{\{\! /, + rPath = /^(true|false|null|[\d\.]+)|(\w+|\$(view|data|ctx|(\w+)))([\w\.]*)|((['"])(?:\\\1|.)*\7)$/g, + rParams = /(\$?[\w\.\[\]]+)(?:(\()|\s*(===|!==|==|!=|<|>|<=|>=)\s*|\s*(\=)\s*)?|(\,\s*)|\\?(\')|\\?(\")|(\))|(\s+)/g, + rNewLine = /\r?\n/g, + rUnescapeQuotes = /\\(['"])/g, + rEscapeQuotes = /\\?(['"])/g, + rBuildHash = /\x08([^\x08]+)\x08/g, + autoName = 0, + escapeMapForHtml = { + "&": "&", + "<": "<", + ">": ">" + }, + htmlSpecialChar = /[\x00"&'<>]/g, + slice = Array.prototype.slice; + +if ( jQuery ) { + + //////////////////////////////////////////////////////////////////////////////////////////////// + // jQuery is loaded, so make $ the jQuery object + $ = jQuery; + + $.fn.extend({ + // Use first wrapped element as template markup. + // Return string obtained by rendering the template against data. + render: function( data, context, parentView, path ) { + return render( data, this[0], context, parentView, path ); + }, + + // Consider the first wrapped element as a template declaration, and get the compiled template or store it as a named template. + template: function( name, context ) { + return $.template( name, this[0], context ); + } + }); + +} else { + + //////////////////////////////////////////////////////////////////////////////////////////////// + // jQuery is not loaded. Make $ the JsViews object + + // Map over the $ in case of overwrite + _$ = window.$; + + window.JsViews = JsViews = window.$ = $ = { + extend: function( target, source ) { + var name; + for ( name in source ) { + target[ name ] = source[ name ]; + } + return target; + }, + isArray: Array.isArray || function( obj ) { + return Object.prototype.toString.call( obj ) === "[object Array]"; + }, + noConflict: function() { + if ( window.$ === JsViews ) { + window.$ = _$; + } + return JsViews; + } + }; +} + +extend = $.extend; + +//================= +// View constructor +//================= + +function View( context, path, parentView, data, template ) { + // Returns a view data structure for a new rendered instance of a template. + // The content field is a hierarchical array of strings and nested views. + + parentView = parentView || { viewsCount:0, ctx: viewsNs.helpers }; + + var parentContext = parentView && parentView.ctx; + + return { + jsViews: "v1.0pre", + path: path || "", + // inherit context from parentView, merged with new context. + itemNumber: ++parentView.viewsCount || 1, + viewsCount: 0, + tmpl: template, + data: data || parentView.data || {}, + // Set additional context on this view (which will modify the context inherited from the parent, and be inherited by child views) + ctx : context && context === parentContext + ? parentContext + : (parentContext ? extend( extend( {}, parentContext ), context ) : context||{}), + // If no jQuery, extend does not support chained copies - so limit to two parameters + parent: parentView + }; +} +extend( $, { + views: viewsNs = { + templates: {}, + tags: { + "if": function() { + var ifTag = this, + view = ifTag._view; + view.onElse = function( presenter, args ) { + var i = 0, + l = args.length; + while ( l && !args[ i++ ]) { + // Only render content if args.length === 0 (i.e. this is an else with no condition) or if a condition argument is truey + if ( i === l ) { + return ""; + } + } + view.onElse = undefined; // If condition satisfied, so won't run 'else'. + return render( view.data, presenter.tmpl, view.ctx, view); + }; + return view.onElse( this, arguments ); + }, + "else": function() { + var view = this._view; + return view.onElse ? view.onElse( this, arguments ) : ""; + }, + each: function() { + var i, + self = this, + result = "", + args = arguments, + l = args.length, + content = self.tmpl, + view = self._view; + for ( i = 0; i < l; i++ ) { + result += args[ i ] ? render( args[ i ], content, self.ctx || view.ctx, view, self._path, self._ctor ) : ""; + } + return l ? result + // If no data parameter, use the current $data from view, and render once + : result + render( view.data, content, view.ctx, view, self._path, self.tag ); + }, + "=": function( value ) { + return value; + }, + "*": function( value ) { + return value; + } + }, + helpers: { + not: function( value ) { + return !value; + } + }, + allowCode: FALSE, + debugMode: TRUE, + err: function( e ) { + return viewsNs.debugMode ? ("
      Error: " + (e.message || e) + ". "): '""'; + }, + +//=============== +// setDelimiters +//=============== + + setDelimiters: function( openTag, closeTag ) { + // Set or modify the delimiter characters for tags: "{{" and "}}" + var firstCloseChar = closeTag.charAt( 0 ), + secondCloseChar = closeTag.charAt( 1 ); + openTag = "\\" + openTag.charAt( 0 ) + "\\" + openTag.charAt( 1 ); + closeTag = "\\" + firstCloseChar + "\\" + secondCloseChar; + + // Build regex with new delimiters + // {{ + rTag = openTag + // # tag (followed by space,! or }) or equals or code + + "(?:(?:(\\#)?(\\w+(?=[!\\s\\" + firstCloseChar + "]))" + "|(?:(\\=)|(\\*)))" + // params + + "\\s*((?:[^\\" + firstCloseChar + "]|\\" + firstCloseChar + "(?!\\" + secondCloseChar + "))*?)" + // encoding + + "(!(\\w*))?" + // closeBlock + + "|(?:\\/([\\w\\$\\.\\[\\]]+)))" + // }} + + closeTag; + + // Default rTag: # tag equals code params encoding closeBlock + // /\{\{(?:(?:(\#)?(\w+(?=[\s\}!]))|(?:(\=)|(\*)))((?:[^\}]|\}(?!\}))*?)(!(\w*))?|(?:\/([\w\$\.\[\]]+)))\}\}/g; + + rTag = new RegExp( rTag, "g" ); + }, + + +//=============== +// registerTags +//=============== + + // Register declarative tag. + registerTags: registerTags = function( name, tagFn ) { + var key; + if ( typeof name === "object" ) { + for ( key in name ) { + registerTags( key, name[ key ]); + } + } else { + // Simple single property case. + viewsNs.tags[ name ] = tagFn; + } + return this; + }, + +//=============== +// registerHelpers +//=============== + + // Register helper function for use in markup. + registerHelpers: registerHelpers = function( name, helper ) { + if ( typeof name === "object" ) { + // Object representation where property name is path and property value is value. + // TODO: We've discussed an "objectchange" event to capture all N property updates here. See TODO note above about propertyChanges. + var key; + for ( key in name ) { + registerHelpers( key, name[ key ]); + } + } else { + // Simple single property case. + viewsNs.helpers[ name ] = helper; + } + return this; + }, + +//=============== +// tmpl.encode +//=============== + + encode: function( encoding, text ) { + return text + ? ( tmplEncode[ encoding || "html" ] || tmplEncode.html)( text ) // HTML encoding is the default + : ""; + }, + + encoders: tmplEncode = { + "none": function( text ) { + return text; + }, + "html": function( text ) { + // HTML encoding helper: Replace < > & and ' and " by corresponding entities. + // Implementation, from Mike Samuel + return String( text ).replace( htmlSpecialChar, replacerForHtml ); + } + //TODO add URL encoding, and perhaps other encoding helpers... + }, + +//=============== +// renderTag +//=============== + + renderTag: function( tag, view, encode, content, tagProperties ) { + // This is a tag call, with arguments: "tag", view, encode, content, presenter [, params...] + var ret, ctx, name, + args = arguments, + presenters = viewsNs.presenters; + hash = tagProperties._hash, + tagFn = viewsNs.tags[ tag ]; + + if ( !tagFn ) { + return ""; + } + + content = content && view.tmpl.nested[ content - 1 ]; + tagProperties.tmpl = tagProperties.tmpl || content || undefined; + // Set the tmpl property to the content of the block tag, unless set as an override property on the tag + + if ( presenters && presenters[ tag ]) { + ctx = extend( extend( {}, tagProperties.ctx ), tagProperties ); + delete ctx.ctx; + delete ctx._path; + delete ctx.tmpl; + tagProperties.ctx = ctx; + tagProperties._ctor = tag + (hash ? "=" + hash.slice( 0, -1 ) : ""); + + tagProperties = extend( extend( {}, tagFn ), tagProperties ); + tagFn = viewsNs.tags.each; // Use each to render the layout template against the data + } + + tagProperties._encode = encode; + tagProperties._view = view; + ret = tagFn.apply( tagProperties, args.length > 5 ? slice.call( args, 5 ) : [view.data] ); + return ret || (ret === undefined ? "" : ret.toString()); // (If ret is the value 0 or false or null, will render to string) + } + }, + +//=============== +// render +//=============== + + render: render = function( data, tmpl, context, parentView, path, tagName ) { + // Render template against data as a tree of subviews (nested template), or as a string (top-level template). + // tagName parameter for internal use only. Used for rendering templates registered as tags (which may have associated presenter objects) + var i, l, dataItem, arrayView, content, result = ""; + + if ( arguments.length === 2 && data.jsViews ) { + parentView = data; + context = parentView.ctx; + data = parentView.data; + } + tmpl = $.template( tmpl ); + if ( !tmpl ) { + return ""; // Could throw... + } + + if ( $.isArray( data )) { + // Create a view item for the array, whose child views correspond to each data item. + arrayView = new View( context, path, parentView, data); + l = data.length; + for ( i = 0, l = data.length; i < l; i++ ) { + dataItem = data[ i ]; + content = dataItem ? tmpl( dataItem, new View( context, path, arrayView, dataItem, tmpl, this )) : ""; + result += viewsNs.activeViews ? "" + content + "" : content; + } + } else { + result += tmpl( data, new View( context, path, parentView, data, tmpl )); + } + + return viewsNs.activeViews + // If in activeView mode, include annotations + ? "" + result + "" + // else return just the string result + : result; + }, + +//=============== +// template +//=============== + + template: function( name, tmpl ) { + // Set: + // Use $.template( name, tmpl ) to cache a named template, + // where tmpl is a template string, a script element or a jQuery instance wrapping a script element, etc. + // Use $( "selector" ).template( name ) to provide access by name to a script block template declaration. + + // Get: + // Use $.template( name ) to access a cached template. + // Also $( selectorToScriptBlock ).template(), or $.template( null, templateString ) + // will return the compiled template, without adding a name reference. + // If templateString is not a selector, $.template( templateString ) is equivalent + // to $.template( null, templateString ). To ensure a string is treated as a template, + // include an HTML element, an HTML comment, or a template comment tag. + + if (tmpl) { + // Compile template and associate with name + if ( "" + tmpl === tmpl ) { // type string + // This is an HTML string being passed directly in. + tmpl = compile( tmpl ); + } else if ( jQuery && tmpl instanceof $ ) { + tmpl = tmpl[0]; + } + if ( tmpl ) { + if ( jQuery && tmpl.nodeType ) { + // If this is a template block, use cached copy, or generate tmpl function and cache. + tmpl = $.data( tmpl, "tmpl" ) || $.data( tmpl, "tmpl", compile( tmpl.innerHTML )); + } + viewsNs.templates[ tmpl._name = tmpl._name || name || "_" + autoName++ ] = tmpl; + } + return tmpl; + } + // Return named compiled template + return name + ? "" + name !== name // not type string + ? (name._name + ? name // already compiled + : $.template( null, name )) + : viewsNs.templates[ name ] || + // If not in map, treat as a selector. (If integrated with core, use quickExpr.exec) + $.template( null, htmlExpr.test( name ) ? name : try$( name )) + : null; + } +}); + +viewsNs.setDelimiters( "{{", "}}" ); + +//================= +// compile template +//================= + +// Generate a reusable function that will serve to render a template against data +// (Compile AST then build template function) + +function parsePath( all, comp, object, viewDataCtx, viewProperty, path, string, quot ) { + return object + ? ((viewDataCtx + ? viewProperty + ? ("$view." + viewProperty) + : object + :("$data." + object) + ) + ( path || "" )) + : string || (comp || ""); +} + +function compile( markup ) { + var newNode, + loc = 0, + stack = [], + topNode = [], + content = topNode, + current = [,,topNode]; + + function pushPreceedingContent( shift ) { + shift -= loc; + if ( shift ) { + content.push( markup.substr( loc, shift ).replace( rNewLine,"\\n")); + } + } + + function parseTag( all, isBlock, tagName, equals, code, params, useEncode, encode, closeBlock, index ) { + // rTag : # tagName equals code params encode closeBlock + // /\{\{(?:(?:(\#)?(\w+(?=[\s\}!]))|(?:(\=)|(\*)))((?:[^\}]|\}(?!\}))*?)(!(\w*))?|(?:\/([\w\$\.\[\]]+)))\}\}/g; + + // Build abstract syntax tree: [ tagName, params, content, encode ] + var named, + hash = "", + parenDepth = 0, + quoted = FALSE, // boolean for string content in double qoutes + aposed = FALSE; // or in single qoutes + + function parseParams( all, path, paren, comp, eq, comma, apos, quot, rightParen, space, index ) { + // path paren eq comma apos quot rtPrn space + // /(\$?[\w\.\[\]]+)(?:(\()|(===)|(\=))?|(\,\s*)|\\?(\')|\\?(\")|(\))|(\s+)/g + + return aposed + // within single-quoted string + ? ( aposed = !apos, (aposed ? all : '"')) + : quoted + // within double-quoted string + ? ( quoted = !quot, (quoted ? all : '"')) + : comp + // comparison + ? ( path.replace( rPath, parsePath ) + comp) + : eq + // named param + ? parenDepth ? "" :( named = TRUE, '\b' + path + ':') + : paren + // function + ? (parenDepth++, path.replace( rPath, parsePath ) + '(') + : rightParen + // function + ? (parenDepth--, ")") + : path + // path + ? path.replace( rPath, parsePath ) + : comma + ? "," + : space + ? (parenDepth + ? "" + : named + ? ( named = FALSE, "\b") + : "," + ) + : (aposed = apos, quoted = quot, '"'); + } + + tagName = tagName || equals; + pushPreceedingContent( index ); + if ( code ) { + if ( viewsNs.allowCode ) { + content.push([ "*", params.replace( rUnescapeQuotes, "$1" )]); + } + } else if ( tagName ) { + if ( tagName === "else" ) { + current = stack.pop(); + content = current[ 2 ]; + isBlock = TRUE; + } + params = (params + ? (params + " ") + .replace( rParams, parseParams ) + .replace( rBuildHash, function( all, keyValue, index ) { + hash += keyValue + ","; + return ""; + }) + : ""); + params = params.slice( 0, -1 ); + newNode = [ + tagName, + useEncode ? encode || "none" : "", + isBlock && [], + "{" + hash + "_hash:'" + hash + "',_path:'" + params + "'}", + params + ]; + + if ( isBlock ) { + stack.push( current ); + current = newNode; + } + content.push( newNode ); + } else if ( closeBlock ) { + current = stack.pop(); + } + loc = index + all.length; // location marker - parsed up to here + if ( !current ) { + throw "Expected block tag"; + } + content = current[ 2 ]; + } + markup = markup.replace( rEscapeQuotes, "\\$1" ); + markup.replace( rTag, parseTag ); + pushPreceedingContent( markup.length ); + return buildTmplFunction( topNode ); +} + +// Build javascript compiled template function, from AST +function buildTmplFunction( nodes ) { + var ret, node, i, + nested = [], + l = nodes.length, + code = "try{var views=" + + (jQuery ? "jQuery" : "JsViews") + + '.views,tag=views.renderTag,enc=views.encode,html=views.encoders.html,$ctx=$view && $view.ctx,result=""+\n\n'; + + for ( i = 0; i < l; i++ ) { + node = nodes[ i ]; + if ( node[ 0 ] === "*" ) { + code = code.slice( 0, i ? -1 : -3 ) + ";" + node[ 1 ] + ( i + 1 < l ? "result+=" : "" ); + } else if ( "" + node === node ) { // type string + code += '"' + node + '"+'; + } else { + var tag = node[ 0 ], + encode = node[ 1 ], + content = node[ 2 ], + obj = node[ 3 ], + params = node[ 4 ], + paramsOrEmptyString = params + '||"")+'; + + if( content ) { + nested.push( buildTmplFunction( content )); + } + code += tag === "=" + ? (!encode || encode === "html" + ? "html(" + paramsOrEmptyString + : encode === "none" + ? ("(" + paramsOrEmptyString) + : ('enc("' + encode + '",' + paramsOrEmptyString) + ) + : 'tag("' + tag + '",$view,"' + ( encode || "" ) + '",' + + (content ? nested.length : '""') // For block tags, pass in the key (nested.length) to the nested content template + + "," + obj + (params ? "," : "") + params + ")+"; + } + } + ret = new Function( "$data, $view", code.slice( 0, -1) + ";return result;\n\n}catch(e){return views.err(e);}" ); + ret.nested = nested; + return ret; +} + +//========================== Private helper functions, used by code above ========================== + +function replacerForHtml( ch ) { + // Original code from Mike Samuel + return escapeMapForHtml[ ch ] + // Intentional assignment that caches the result of encoding ch. + || ( escapeMapForHtml[ ch ] = "&#" + ch.charCodeAt( 0 ) + ";" ); +} + +function try$( selector ) { + // If selector is valid, return jQuery object, otherwise return (invalid) selector string + try { + return $( selector ); + } catch( e) {} + return selector; +} +})( window ); diff --git a/libs/js/jquery-mobile-1.1.0/GPL-LICENSE.txt b/libs/js/jquery-mobile-1.1.0/GPL-LICENSE.txt new file mode 100644 index 0000000..11dddd0 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/GPL-LICENSE.txt @@ -0,0 +1,278 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. diff --git a/libs/js/jquery-mobile-1.1.0/LICENSE-INFO.min.txt b/libs/js/jquery-mobile-1.1.0/LICENSE-INFO.min.txt new file mode 100644 index 0000000..5f585c2 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/LICENSE-INFO.min.txt @@ -0,0 +1 @@ +/*! jQuery Mobile v@VERSION jquerymobile.com | jquery.org/license */ \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/LICENSE-INFO.txt b/libs/js/jquery-mobile-1.1.0/LICENSE-INFO.txt new file mode 100644 index 0000000..4b99089 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/LICENSE-INFO.txt @@ -0,0 +1,9 @@ +/* +* jQuery Mobile Framework v@VERSION +* http://jquerymobile.com +* +* Copyright 2011 (c) jQuery Project +* Dual licensed under the MIT or GPL Version 2 licenses. +* http://jquery.org/license +* +*/ diff --git a/libs/js/jquery-mobile-1.1.0/MIT-LICENSE.txt b/libs/js/jquery-mobile-1.1.0/MIT-LICENSE.txt new file mode 100644 index 0000000..5327046 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/MIT-LICENSE.txt @@ -0,0 +1,20 @@ +Copyright (c) 2011 John Resig, http://jquery.com/ + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/libs/js/jquery-mobile-1.1.0/Makefile b/libs/js/jquery-mobile-1.1.0/Makefile new file mode 100644 index 0000000..ddcfa01 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/Makefile @@ -0,0 +1,218 @@ +# Helper Variables +# The command to replace the @VERSION in the files with the actual version +HEAD_SHA = $(shell git log -1 --format=format:"%H") +VER = sed "s/v@VERSION/$$(git log -1 --format=format:"Git Build: SHA1: %H <> Date: %cd")/" +VER_MIN = "/*! jQuery Mobile v$$(git log -1 --format=format:"Git Build: SHA1: %H <> Date: %cd") jquerymobile.com | jquery.org/license */" +VER_OFFICIAL = $(shell cat version.txt) +SED_VER_REPLACE = 's/__version__/"${VER_OFFICIAL}"/g' +SED_VER_API = sed ${SED_VER_REPLACE} +SED_INPLACE_EXT = "whyunowork" +deploy: VER = sed "s/v@VERSION/${VER_OFFICIAL} ${HEAD_SHA}/" +deploy: VER_MIN = "/*! jQuery Mobile v${VER_OFFICIAL} ${HEAD_SHA} jquerymobile.com | jquery.org/license */" + +# The output folder for the finished files +OUTPUT = compiled + +# The name of the files +NAME = jquery.mobile +BASE_NAME = jquery.mobile +THEME_FILENAME = jquery.mobile.theme +STRUCTURE = jquery.mobile.structure +deploy: NAME = jquery.mobile-${VER_OFFICIAL} +deploy: THEME_FILENAME = jquery.mobile.theme-${VER_OFFICIAL} +deploy: STRUCTURE = jquery.mobile.structure-${VER_OFFICIAL} + +# The CSS theme being used +THEME = default + +# If node is available then use node to run r.js +# otherwise use good old rhino/java +NODE ?= /usr/local/bin/node +HAS_NODE = $(shell if test -x ${NODE} ;then echo true; fi) + +ifeq ($(HAS_NODE), true) + RUN_JS = @@${NODE} +else + RUN_JS = @@java -XX:ReservedCodeCacheSize=64m -classpath build/js.jar:build/google-compiler-20111003.jar org.mozilla.javascript.tools.shell.Main +endif + +# Build Targets + +# When no build target is specified, all gets ran +all: css js zip notify + +clean: + # ------------------------------------------------- + # Cleaning build output + @@rm -rf ${OUTPUT} + @@rm -rf tmp + +# Create the output directory. +init: + @@mkdir -p ${OUTPUT} + +# Build and minify the CSS files +css: init + # Build the CSS file with the theme included + ${RUN_JS} \ + external/r.js/dist/r.js \ + -o cssIn=css/themes/default/jquery.mobile.css \ + optimizeCss=standard.keepComments.keepLines \ + out=${OUTPUT}/${NAME}.compiled.css + @@cat LICENSE-INFO.txt | ${VER} > ${OUTPUT}/${NAME}.css + @@cat ${OUTPUT}/${NAME}.compiled.css >> ${OUTPUT}/${NAME}.css + @@echo ${VER_MIN} > ${OUTPUT}/${NAME}.min.css + @@java -XX:ReservedCodeCacheSize=64m \ + -jar build/yuicompressor-2.4.6.jar \ + --type css ${OUTPUT}/${NAME}.compiled.css >> ${OUTPUT}/${NAME}.min.css + @@rm ${OUTPUT}/${NAME}.compiled.css + # Build the CSS Structure-only file + ${RUN_JS} \ + external/r.js/dist/r.js \ + -o cssIn=css/structure/jquery.mobile.structure.css \ + out=${OUTPUT}/${STRUCTURE}.compiled.css + @@cat LICENSE-INFO.txt | ${VER} > ${OUTPUT}/${STRUCTURE}.css + @@cat ${OUTPUT}/${STRUCTURE}.compiled.css >> ${OUTPUT}/${STRUCTURE}.css + # ..... and then minify it + @@echo ${VER_MIN} > ${OUTPUT}/${STRUCTURE}.min.css + @@java -XX:ReservedCodeCacheSize=64m \ + -jar build/yuicompressor-2.4.6.jar \ + --type css ${OUTPUT}/${STRUCTURE}.compiled.css >> ${OUTPUT}/${STRUCTURE}.min.css + @@rm ${OUTPUT}/${STRUCTURE}.compiled.css + # Build the theme only file + @@cat LICENSE-INFO.txt | ${VER} > ${OUTPUT}/${THEME_FILENAME}.css + @@cat css/themes/default/jquery.mobile.theme.css >> ${OUTPUT}/${THEME_FILENAME}.css + # ..... and then minify it + @@echo ${VER_MIN} > ${OUTPUT}/${THEME_FILENAME}.min.css + @@java -XX:ReservedCodeCacheSize=64m \ + -jar build/yuicompressor-2.4.6.jar \ + --type css ${OUTPUT}/${THEME_FILENAME}.css >> ${OUTPUT}/${THEME_FILENAME}.min.css + # Copy in the images + @@cp -R css/themes/${THEME}/images ${OUTPUT}/ + # Css portion is complete. + # ------------------------------------------------- + + +docs: init js css + # Create the Demos/Docs/Tests/Tools + # ... Create staging directories + @@mkdir -p tmp/demos/js + @@mkdir -p tmp/demos/css/themes/${THEME} + # ... Copy script files + @@cp compiled/*.js tmp/demos/js + @@cp js/jquery.js tmp/demos/js + # ... Copy html files + @@cp index.html tmp/demos + @@cp -r docs tmp/demos + # ... Copy css and images + @@cp compiled/*.css tmp/demos/css/themes/${THEME} + @@cp -r compiled/images tmp/demos/css/themes/${THEME} + # ... replace "js/" with "js/jquery.mobile.js" + @@ # NOTE the deletion here is required by gnu/bsd sed differences + @@find tmp/demos -name "*.html" -exec sed -i${SED_INPLACE_EXT} -e 's@js/"@js/jquery.mobile.js"@' {} \; + @@find tmp/demos -name "*${SED_INPLACE_EXT}" -exec rm {} \; + # ... Move and zip up the the whole folder + @@rm -f ${OUTPUT}/${BASE_NAME}.docs.zip + @@cd tmp/demos && zip -rq ../../${OUTPUT}/${NAME}.docs.zip * + @@rm -rf ${OUTPUT}/demos && mv -f tmp/demos ${OUTPUT} + # Finish by removing the temporary files + @@rm -rf tmp + # ------------------------------------------------- + +# Build and minify the JS files +js: init + # Build the JavaScript file + ${RUN_JS} \ + external/r.js/dist/r.js \ + -o baseUrl="js" \ + name=jquery.mobile \ + exclude=jquery,../external/requirejs/order,../external/requirejs/depend,../external/requirejs/text,../external/requirejs/text!../version.txt \ + out=${OUTPUT}/${NAME}.compiled.js \ + pragmasOnSave.jqmBuildExclude=true \ + wrap.startFile=build/wrap.start \ + wrap.endFile=build/wrap.end \ + findNestedDependencies=true \ + skipModuleInsertion=true \ + optimize=none + @@cat LICENSE-INFO.txt | ${VER} > ${OUTPUT}/${NAME}.js + @@cat ${OUTPUT}/${NAME}.compiled.js | ${SED_VER_API} >> ${OUTPUT}/${NAME}.js + @@rm ${OUTPUT}/${NAME}.compiled.js + ## ..... and then minify it + ##@@echo ${VER_MIN} > ${OUTPUT}/${NAME}.min.js + ##@@java -XX:ReservedCodeCacheSize=64m \ + ## -jar build/google-compiler-20111003.jar \ + ## --js ${OUTPUT}/${NAME}.js \ + ## --js_output_file ${OUTPUT}/${NAME}.compiled.js + ##@@cat ${OUTPUT}/${NAME}.compiled.js >> ${OUTPUT}/${NAME}.min.js + ##@@rm ${OUTPUT}/${NAME}.compiled.js + # ------------------------------------------------- + + +# Output a message saying the process is complete +notify: init + @@echo "The files have been built and are in: " $$(pwd)/${OUTPUT} + # ------------------------------------------------- + + +# Zip up the jQm files without docs +zip: init css js + # Packaging up the files into a zip archive + @@mkdir tmp + @@cp -R ${OUTPUT} tmp/${NAME} + # ... And remove the Zipped docs so they aren't included twice (for deploy scripts) + @@rm -rf tmp/${NAME}/*.zip + @@cd tmp; zip -rq ../${OUTPUT}/${NAME}.zip ${NAME} + @@rm -rf tmp + # ------------------------------------------------- + +# ------------------------------------------------- +# ------------------------------------------------- +# ------------------------------------------------- +# +# For jQuery Team Use Only +# +# ------------------------------------------------- +# NOTE the clean (which removes previous build output) has been removed to prevent a gap in service +build_latest: css docs js zip + # ... Copy over the lib js, avoid the compiled stuff, to get the defines for tests/unit/* + @@ # TODO centralize list of built files + @@find js -name "*.js" -not -name "*.docs.js" -not -name "*.mobile.js" | xargs -L1 -I FILENAME cp FILENAME ${OUTPUT}/demos/js/ + +# Push the latest git version to the CDN. This is done on a post commit hook +deploy_latest: + # Time to put these on the CDN + @@scp -qr ${OUTPUT}/* jqadmin@code.origin.jquery.com:/var/www/html/code.jquery.com/mobile/latest/ + # ------------------------------------------------- + +# TODO target name preserved to avoid issues during refactor, latest -> deploy_latest +latest: build_latest deploy_latest + +# Push the nightly backups. This is done on a server cronjob +deploy_nightlies: + # Time to put these on the CDN + @@scp -qr ${OUTPUT} jqadmin@code.origin.jquery.com:/var/www/html/code.jquery.com/mobile/nightlies/$$(date "+%Y%m%d") + # ------------------------------------------------- + +# Deploy a finished release. This is manually done. +deploy: init css js docs zip + # Deploying all the files to the CDN + @@mkdir tmp + @@cp -R ${OUTPUT} tmp/${VER_OFFICIAL} + @@scp -qr tmp/* jqadmin@code.origin.jquery.com:/var/www/html/code.jquery.com/mobile/ + @@rm -rf tmp/${VER_OFFICIAL} + @@mv ${OUTPUT}/demos tmp/${VER_OFFICIAL} + # Create the Demos/Docs/Tests/Tools for jQueryMobile.com + # ... By first replacing the paths + @@ # TODO update jQuery Version replacement on deploy + @@find tmp/${VER_OFFICIAL} -type f \ + \( -name '*.html' -o -name '*.php' \) \ + -exec perl -pi -e \ + 's|src="(.*)${BASE_NAME}.js"|src="//code.jquery.com/mobile/${VER_OFFICIAL}/${NAME}.min.js"|g;s|href="(.*)${BASE_NAME}.css"|href="//code.jquery.com/mobile/${VER_OFFICIAL}/${NAME}.min.css"|g;s|src="(.*)jquery.js"|src="//code.jquery.com/jquery-1.7.1.min.js"|g' {} \; + # ... So they can be copied to jquerymobile.com + @@scp -qr tmp/* jqadmin@jquerymobile.com:/srv/jquerymobile.com/htdocs/demos/ + # Do some cleanup to wrap it up + @@rm -rf tmp + @@rm -rf ${OUTPUT} + # ------------------------------------------------- + + diff --git a/libs/js/jquery-mobile-1.1.0/README.md b/libs/js/jquery-mobile-1.1.0/README.md new file mode 100644 index 0000000..e5607ce --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/README.md @@ -0,0 +1,111 @@ +jQuery Mobile Framework +======================= +[Official Site: http://jquerymobile.com](http://jquerymobile.com) + +[Demos and Documentation](http://jquerymobile.com/test/) + +How to build your own jQuery Mobile CSS and JS files +==================================================== +Clone this repo and build the js and css files (you'll need Git and Make installed): + + git clone git://github.com/jquery/jquery-mobile.git + cd jquery-mobile + make + +A full version and a minified version of the jQuery Mobile JavaScript and CSS files will be created +in a folder named "compiled". There is also now a Structure only css file so you can add your own theme on top of it. + +How to build a self-contained version of the Docs/Demos +======================================================= +Once you have your own cloned repo on your computer: + + make docs + +The docs will be built and available in the compiled/demos folder. You can move this folder to your web server or +other location. It has no dependencies on anything other than a basic HTML web server. + + +Submitting bugs +=============== +If you think you've found a bug, please report it by following these instructions: + +1. Visit the [Issue tracker: https://github.com/jquery/jquery-mobile/issues](https://github.com/jquery/jquery-mobile/issues) +2. Create an issue explaining the problem and expected result + - Be sure to include any relevant information for reproducing the issue + - Include information such as: + * Browser/device (with version #) + * The version of the jQuery Mobile code you're running + * If you are running from a git version, include the date and/or hash number + - Make sure that the bug still exists at http://jquerymobile.com/test/ as it may be fixed already + - You can use the CDN hosted JS and CSS files to test in your own code by using: + * [JS](http://code.jquery.com/mobile/latest/jquery.mobile.min.js) + * [CSS](http://code.jquery.com/mobile/latest/jquery.mobile.min.css) + - Include a link to some code of the bug in action. You can use either of these services to host your code + * [jsbin](http://jsbin.com) + * [jsfiddle](http://jsfiddle.net) +3. Submit the issue. + +Recommended: [JS Bin issue template with instructions](http://jsbin.com/omacox/edit) + +Submitting patches +================== +To contribute code and bug fixes to jQuery Mobile: fork this project on Github, make changes to the code in your fork, +and then send a "pull request" to notify the team of updates that are ready to be reviewed for inclusion. + +Detailed instructions can be found at [jQuery Mobile Patching](https://gist.github.com/1294035) + +Running the jQuery Mobile demos & docs locally +============================================== +To preview locally, you'll need to clone a local copy of this repository and point your Apache & PHP webserver at its +root directory (a webserver is required, as PHP and .htaccess are used for combining development files). + +If you don't currently have a webserver running locally, there are a few options. + +If you're on a Mac, you can try dropping jQuery Mobile into your sites folder and turning on Web Sharing via System +Prefs. From there, you'll find a URL where you can browse folders in your sites directory from a browser. + +Another quick way to get up and running is to download and install MAMP for Mac OSX. Once installed, just open MAMP, +click preferences, go to the Apache tab, and select your local jQuery Mobile folder as the root. Then you can open a +browser to http://localhost:8888 to preview the code. + +Another alternative is XAMPP (Mac, Windows). You need to actually modify Apache's httpd.conf to point to your checkout: +[Instructions](http://www.apachefriends.org/en/xampp.html) + +You need the following Apache modules loaded: + +* Rewrite (mod\_rewrite.so) +* Expire (mod\_expires.so) +* Header (mod\_headers.so) + +Alternatively, with the addition of async loading, you can use the python simple http server from the project root: + + $ python -m SimpleHTTPServer 8000 + +And in your browser visit [localhost:8000](http://localhost:8000/tests/unit/core/). NOTE: The docs will not load as they are dependent on the "/js/" includes which require php. For other development work such as unit tests and custom test pages using + + + +will allow you to load modules asynchronously without php. Please note that the example above assumes it's inclusion in a page at the root of the directory in which the simple http server was run. + +AMD Support in Development +========================== + +Please bear in mind that async loading is not supported for production and is primarily used for the project's build process. As a result developers should expect an initial flash of unstyled content, which will not occur when the library is compiled. + +If you find dependency bugs when using the async loading support for development please log them in the github issue tracker. + +Building With A Custom Theme +============================ +To use a custom theme in your own build, you'll need Make installed. You can find the themes in the CSS/Themes folder. +To create a new theme: + +1. Copy the `Default` folder from CSS/Themes to a new folder in the same location. The name of the folder will be the +theme's name. For testing locally, make sure the index.php file is copied as well. +2. Edit the `jquery.mobile.theme.css` file so it contains your custom fonts and colors. +3. Once you are done editing your files and saving them, open a terminal. +4. Navigate to the jQuery-Mobile folder's root. +5. Run the following command to build jQuery-Mobile (THEME is the name of the folder for your theme from step 1.): + + make THEME=YourThemeName + +6. The compiled files will be located in the "compiled" folder in the root of jQuery-Mobile. diff --git a/libs/js/jquery-mobile-1.1.0/build/branch-preview.sh b/libs/js/jquery-mobile-1.1.0/build/branch-preview.sh new file mode 100755 index 0000000..355f710 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/build/branch-preview.sh @@ -0,0 +1,46 @@ +#!/bin/bash +# determine the project root +output="branches" +index_page="$output/index.html" + +function log { + echo "[branches preview] $1" +} + +# Make the output directory if it doesnt exist +mkdir -p "$output" + +branches=$(git ls-remote --heads origin | cut -f2 -s | sed 's@refs/heads/@@') + +log "fetching to get new branches" +git fetch origin + +echo "jQm Branches Preview" > "$index_page" +echo "

      jQuery Mobile Branches Live Previews


      " >> "$index_page" +echo "Updated: $(date)" >> "$index_page" +echo "
        " >> "$index_page" +# Loop through the array to export each branch +for branch in $branches; do + # skip master + if [ $branch = "master" ]; then + continue + fi + + # TODO shell escape the $branch value it safe for executing + log "archiving ref $branch" + git archive -o "$output/$branch.tar" "origin/$branch" + mkdir -p "$output/$branch" + + log "untarring $branch.tar into $output/$branch/" + tar -C "$output/$branch" -xf "$output/$branch.tar" + + # Manipulate the commit message + # TODO add commit and description + echo "
      • Branch: $branch
      • " >> "$index_page" +done + +# close out the list +echo "
      " >> "$index_page" + +# close out the index file +echo "" >> "$index_page" diff --git a/libs/js/jquery-mobile-1.1.0/build/docs.build.js b/libs/js/jquery-mobile-1.1.0/build/docs.build.js new file mode 100644 index 0000000..3d61c2c --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/build/docs.build.js @@ -0,0 +1,55 @@ +({ + appDir: "..", + baseUrl: "js", + dir: "../compiled/demos", + + optimize: "none", + + //Finds require() dependencies inside a require() or define call. + findNestedDependencies: true, + + //If skipModuleInsertion is false, then files that do not use define() + //to define modules will get a define() placeholder inserted for them. + //Also, require.pause/resume calls will be inserted. + //Set it to true to avoid this. This is useful if you are building code that + //does not use require() in the built project or in the JS files, but you + //still want to use the optimization tool from RequireJS to concatenate modules + //together. + skipModuleInsertion: true, + + modules: [ + { + name: "jquery.mobile.docs", + exclude: [ + "jquery", + "../external/requirejs/depend", + "../external/requirejs/order", + "../external/requirejs/text", + "../external/requirejs/text!../version.txt" + ] + }, + { + name: "jquery.mobile", + exclude: [ + "jquery", + "../external/requirejs/depend", + "../external/requirejs/order", + "../external/requirejs/text", + "../external/requirejs/text!../version.txt" + ] + } + ], + + pragmasOnSave: { + jqmBuildExclude: true + }, + + //File paths are relative to the build file, or if running a commmand + //line build, the current directory. + wrap: { + startFile: "wrap.start", + endFile: "wrap.end" + }, + + dirExclusionRegExp: /^\.|^build|^compiled|^tmp/ +}) \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/build/filter.js b/libs/js/jquery-mobile-1.1.0/build/filter.js new file mode 100644 index 0000000..0a3aef3 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/build/filter.js @@ -0,0 +1,43 @@ +// This file is used by the AMD web builder service. +// When the micro modules are used the version is pulled as a text module. +// When building with r.js we need to replace the version token by its value since we strip the AMD layer with the pragma. + +var fs = require( 'fs' ), + path = require( 'path' ), + buildDir = __dirname, + copyrightVersionRegExp = /@VERSION/g, + apiVersionRegExp = /__version__/g, + copyrightBaseName = "../LICENSE-INFO", + copyrightRegFile = copyrightBaseName + ".txt", + copyrightMinFile = copyrightBaseName + ".min.txt"; + +module.exports = function ( contents, ext, callback ) { + fs.readFile( path.join( buildDir, "../version.txt" ), "utf8", + function( err, version ) { + var copyrightFile; + if ( err ) { + callback( err ); + } else { + version = version.trim(); + + if ( /^\.min/.test( ext ) ) { + copyrightFile = copyrightMinFile; + } else { + copyrightFile = copyrightRegFile; + } + fs.readFile( path.join( buildDir, copyrightFile ), "utf8", + function( err, copyright ) { + if ( err ) { + callback( err ); + } else { + contents = copyright.replace( copyrightVersionRegExp, version ) + "\n" + contents; + contents = contents.replace( apiVersionRegExp, '"' + version + '"' ); + + callback( null, contents ); + } + } + ) + } + } + ) +}; \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/build/google-compiler-20111003.jar b/libs/js/jquery-mobile-1.1.0/build/google-compiler-20111003.jar new file mode 100644 index 0000000..a30d445 Binary files /dev/null and b/libs/js/jquery-mobile-1.1.0/build/google-compiler-20111003.jar differ diff --git a/libs/js/jquery-mobile-1.1.0/build/js.jar b/libs/js/jquery-mobile-1.1.0/build/js.jar new file mode 100644 index 0000000..2369f99 Binary files /dev/null and b/libs/js/jquery-mobile-1.1.0/build/js.jar differ diff --git a/libs/js/jquery-mobile-1.1.0/build/wrap.end b/libs/js/jquery-mobile-1.1.0/build/wrap.end new file mode 100644 index 0000000..c28a09e --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/build/wrap.end @@ -0,0 +1,2 @@ + +})); diff --git a/libs/js/jquery-mobile-1.1.0/build/wrap.start b/libs/js/jquery-mobile-1.1.0/build/wrap.start new file mode 100644 index 0000000..39a106c --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/build/wrap.start @@ -0,0 +1,12 @@ +(function ( root, doc, factory ) { + if ( typeof define === "function" && define.amd ) { + // AMD. Register as an anonymous module. + define( [ "jquery" ], function ( $ ) { + factory( $, root, doc ); + return $.mobile; + }); + } else { + // Browser globals + factory( root.jQuery, root, doc ); + } +}( this, document, function ( $, window, document, undefined ) { \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/build/yuicompressor-2.4.6.jar b/libs/js/jquery-mobile-1.1.0/build/yuicompressor-2.4.6.jar new file mode 100644 index 0000000..61f6318 Binary files /dev/null and b/libs/js/jquery-mobile-1.1.0/build/yuicompressor-2.4.6.jar differ diff --git a/libs/js/jquery-mobile-1.1.0/combine.php b/libs/js/jquery-mobile-1.1.0/combine.php new file mode 100644 index 0000000..cac1eea --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/combine.php @@ -0,0 +1,22 @@ + * { visibility: hidden; } + +/*headers, content panels*/ +.ui-bar, .ui-body { position: relative; padding: .4em 15px; overflow: hidden; display: block; clear:both; } +.ui-bar { font-size: 16px; margin: 0; } +.ui-bar h1, .ui-bar h2, .ui-bar h3, .ui-bar h4, .ui-bar h5, .ui-bar h6 { margin: 0; padding: 0; font-size: 16px; display: inline-block; } + +.ui-header, .ui-footer { position: relative; border-left-width: 0; border-right-width: 0; } +.ui-header .ui-btn-left, +.ui-header .ui-btn-right, +.ui-footer .ui-btn-left, +.ui-footer .ui-btn-right { position: absolute; top: 3px; } +.ui-header .ui-btn-left, +.ui-footer .ui-btn-left { left: 5px; } +.ui-header .ui-btn-right, +.ui-footer .ui-btn-right { right: 5px; } +.ui-footer .ui-btn-icon-notext, +.ui-header .ui-btn-icon-notext { top: 6px; } +.ui-header .ui-title, .ui-footer .ui-title { min-height: 1.1em; text-align: center; font-size: 16px; display: block; margin: .6em 30% .8em; padding: 0; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; outline: 0 !important; } +.ui-footer .ui-title { margin: .6em 15px .8em; } + +/*content area*/ +.ui-content { border-width: 0; overflow: visible; overflow-x: hidden; padding: 15px; } + +/* icons sizing */ +.ui-icon { width: 18px; height: 18px; } + +/* non-js content hiding */ +.ui-nojs { position: absolute; left: -9999px; } + +/* accessible content hiding */ +.ui-hide-label label, +.ui-hidden-accessible { position: absolute !important; left: -9999px; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); } diff --git a/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.dialog.css b/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.dialog.css new file mode 100644 index 0000000..6f0e651 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.dialog.css @@ -0,0 +1,30 @@ +.ui-dialog { + background: none !important; /* this is to ensure that dialog theming does not apply (by default at least) on the page div */ +} +.ui-dialog-contain { width: 92.5%; max-width: 500px; margin: 10% auto 15px auto; padding: 0; } +.ui-dialog .ui-header { + margin-top: 15%; + border: none; + overflow: hidden; +} +.ui-dialog .ui-header, +.ui-dialog .ui-content, +.ui-dialog .ui-footer { + display: block; + position: relative; + width: auto; +} +.ui-dialog .ui-header, +.ui-dialog .ui-footer { + z-index: 10; + padding: 0; +} +.ui-dialog .ui-footer { + padding: 0 15px; +} +.ui-dialog .ui-content { + padding: 15px; +} +.ui-dialog { + margin-top: -15px; +} diff --git a/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.fixedToolbar.css b/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.fixedToolbar.css new file mode 100644 index 0000000..b81d9d0 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.fixedToolbar.css @@ -0,0 +1,40 @@ +/* fixed page header & footer configuration */ +.ui-header-fixed, +.ui-footer-fixed { + left: 0; + right: 0; + width: 100%; + position: fixed; + z-index: 1000; +} +.ui-header-fixed { + top: 0; +} +.ui-footer-fixed { + bottom: 0; +} +.ui-header-fullscreen, +.ui-footer-fullscreen { + opacity: .9; +} +.ui-page-header-fixed { + padding-top: 2.5em; +} +.ui-page-footer-fixed { + padding-bottom: 3em; +} +.ui-page-header-fullscreen .ui-content, +.ui-page-footer-fullscreen .ui-content { + padding: 0; +} +.ui-fixed-hidden { + position: absolute; +} +.ui-page-header-fullscreen .ui-fixed-hidden, +.ui-page-footer-fullscreen .ui-fixed-hidden { + left: -99999em; +} +.ui-header-fixed .ui-btn, +.ui-footer-fixed .ui-btn { + z-index: 10; +} diff --git a/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.forms.checkboxradio.css b/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.forms.checkboxradio.css new file mode 100644 index 0000000..d5ec896 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.forms.checkboxradio.css @@ -0,0 +1,24 @@ +.ui-checkbox, .ui-radio { position: relative; clear: both; margin: .2em 0 .5em; z-index: 1; } +.ui-checkbox .ui-btn, .ui-radio .ui-btn { margin: 0; text-align: left; z-index: 2; } +.ui-checkbox .ui-btn-inner, .ui-radio .ui-btn-inner { white-space: normal; } +.ui-checkbox .ui-btn-icon-left .ui-btn-inner,.ui-radio .ui-btn-icon-left .ui-btn-inner { padding-left: 45px; } +.ui-checkbox .ui-mini.ui-btn-icon-left .ui-btn-inner,.ui-radio .ui-mini.ui-btn-icon-left .ui-btn-inner { padding-left: 36px; } + +.ui-checkbox .ui-btn-icon-right .ui-btn-inner, .ui-radio .ui-btn-icon-right .ui-btn-inner { padding-right: 45px; } +.ui-checkbox .ui-mini.ui-btn-icon-right .ui-btn-inner, .ui-radio .ui-mini.ui-btn-icon-right .ui-btn-inner { padding-right: 36px; } + +.ui-checkbox .ui-btn-icon-top .ui-btn-inner,.ui-radio .ui-btn-icon-top .ui-btn-inner { padding-right: 0; padding-left: 0; text-align: center; } +.ui-checkbox .ui-btn-icon-bottom .ui-btn-inner, .ui-radio .ui-btn-icon-bottom .ui-btn-inner { padding-right: 0; padding-left: 0; text-align: center; } + +.ui-checkbox .ui-icon, .ui-radio .ui-icon { top: 1.1em; } +.ui-checkbox .ui-btn-icon-left .ui-icon, .ui-radio .ui-btn-icon-left .ui-icon { left: 15px; } +.ui-checkbox .ui-mini.ui-btn-icon-left .ui-icon, .ui-radio .ui-mini.ui-btn-icon-left .ui-icon { left: 9px; } +.ui-checkbox .ui-btn-icon-right .ui-icon, .ui-radio .ui-btn-icon-right .ui-icon { right: 15px; } +.ui-checkbox .ui-mini.ui-btn-icon-right .ui-icon, .ui-radio .ui-mini.ui-btn-icon-right .ui-icon { right: 9px; } +.ui-checkbox .ui-btn-icon-top .ui-icon, .ui-radio .ui-btn-icon-top .ui-icon { top: 10px; } +.ui-checkbox .ui-btn-icon-bottom .ui-icon, .ui-radio .ui-btn-icon-bottom .ui-icon { top: auto; bottom: 10px; } +.ui-checkbox .ui-btn-icon-right .ui-icon, .ui-radio .ui-btn-icon-right .ui-icon { right: 15px; } +.ui-checkbox .ui-mini.ui-btn-icon-right .ui-icon, .ui-radio .ui-mini.ui-btn-icon-right .ui-icon { right: 9px; } + +/* input, label positioning */ +.ui-checkbox input,.ui-radio input { position:absolute; left:20px; top:50%; width: 10px; height: 10px; margin:-5px 0 0 0; outline: 0 !important; z-index: 1; } \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.forms.fieldcontain.css b/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.forms.fieldcontain.css new file mode 100644 index 0000000..da40101 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.forms.fieldcontain.css @@ -0,0 +1,18 @@ +.ui-field-contain, fieldset.ui-field-contain { padding: .8em 0; margin: 0; border-width: 0 0 1px 0; overflow: visible; } +.ui-field-contain:first-child { border-top-width: 0; } +.ui-header .ui-field-contain-left, +.ui-header .ui-field-contain-right { + position: absolute; + top: 0; + width: 25%; +} +.ui-header .ui-field-contain-left { + left: 1em; +} +.ui-header .ui-field-contain-right { + right: 1em; +} + +@media all and (min-width: 450px){ + .ui-field-contain, .ui-mobile fieldset.ui-field-contain { border-width: 0; padding: 0; margin: 1em 0; } +} \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.forms.select.css b/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.forms.select.css new file mode 100644 index 0000000..db8356f --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.forms.select.css @@ -0,0 +1,41 @@ +.ui-select { display: block; position: relative; } +.ui-select select { position: absolute; left: -9999px; top: -9999px; } +.ui-select .ui-btn { overflow: hidden; opacity: 1; margin: 0; } +/* Fixes #2588 — When Windows Phone 7.5 (Mango) tries to calculate a numeric opacity for a select—including “inherit”—without explicitly specifying an opacity on the parent to give it context, a bug appears where clicking elsewhere on the page after opening the select will open the select again. */ +.ui-select .ui-btn select { cursor: pointer; -webkit-appearance: button; left: 0; top:0; width: 100%; min-height: 1.5em; min-height: 100%; height: 3em; max-height: 100%; opacity: 0; -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; filter: alpha(opacity=0); z-index: 2; } + +.ui-select .ui-disabled { opacity: .3; } + +@-moz-document url-prefix() {.ui-select .ui-btn select { opacity: 0.0001; }} +.ui-select .ui-btn select.ui-select-nativeonly { opacity: 1; text-indent: 0; } + +.ui-select .ui-btn-icon-right .ui-btn-inner { padding-right: 45px; } +.ui-select .ui-btn-icon-right .ui-icon { right: 15px; } +.ui-select .ui-mini.ui-btn-icon-right .ui-icon { right: 7px; } + + +/* labels */ +label.ui-select { font-size: 16px; line-height: 1.4; font-weight: normal; margin: 0 0 .3em; display: block; } + +/*listbox*/ +.ui-select .ui-btn-text, .ui-selectmenu .ui-btn-text { display: block; min-height: 1em; overflow: hidden !important; +/* This !important is required for iPad Safari specifically. See https://github.com/jquery/jquery-mobile/issues/2647 */ } +.ui-select .ui-btn-text { text-overflow: ellipsis; } + +.ui-selectmenu { position: absolute; padding: 0; z-index: 1100 !important; width: 80%; max-width: 350px; padding: 6px; } +.ui-selectmenu .ui-listview { margin: 0; } +.ui-selectmenu .ui-btn.ui-li-divider { cursor: default; } +.ui-selectmenu-hidden { top: -9999px; left: -9999px; } +.ui-selectmenu-screen { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 99; } +.ui-screen-hidden, .ui-selectmenu-list .ui-li .ui-icon { display: none; } +.ui-selectmenu-list .ui-li .ui-icon { display: block; } +.ui-li.ui-selectmenu-placeholder { display: none; } +.ui-selectmenu .ui-header .ui-title { margin: 0.6em 46px 0.8em; } + +@media all and (min-width: 450px){ + .ui-field-contain label.ui-select { vertical-align: top; display: inline-block; width: 20%; margin: 0 2% 0 0; } + .ui-field-contain .ui-select { width: 60%; display: inline-block; } +} + +/* when no placeholder is defined in a multiple select, the header height doesn't even extend past the close button. this shim's content in there */ +.ui-selectmenu .ui-header h1:after { content: '.'; visibility: hidden; } \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.forms.slider.css b/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.forms.slider.css new file mode 100644 index 0000000..80035db --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.forms.slider.css @@ -0,0 +1,35 @@ +label.ui-slider { font-size: 16px; line-height: 1.4; font-weight: normal; margin: 0 0 .3em; display: block; } +input.ui-slider-input, +.ui-field-contain input.ui-slider-input { display: inline-block; width: 50px; } +select.ui-slider-switch { display: none; } +div.ui-slider { position: relative; display: inline-block; overflow: visible; height: 15px; padding: 0; margin: 0 2% 0 20px; top: 4px; width: 65%; } +div.ui-slider-mini { height: 12px; margin-left: 10px; } +div.ui-slider-bg { border: none; height: 100%; padding-right: 8px; } +.ui-controlgroup a.ui-slider-handle, a.ui-slider-handle { position: absolute; z-index: 1; top: 50%; width: 28px; height: 28px; margin-top: -15px; margin-left: -15px; outline: 0; } +a.ui-slider-handle .ui-btn-inner { padding: 0; height: 100%; } +div.ui-slider-mini a.ui-slider-handle { height: 14px; width: 14px; margin: -8px 0 0 -7px; } +div.ui-slider-mini a.ui-slider-handle .ui-btn-inner { height: 30px; width: 30px; padding: 0; margin: -9px 0 0 -9px; } + +@media all and (min-width: 450px){ + .ui-field-contain label.ui-slider { vertical-align: top; display: inline-block; width: 20%; margin: 0 2% 0 0; } + .ui-field-contain div.ui-slider { width: 43%; } + .ui-field-contain div.ui-slider-switch { width: 5.5em; } +} + +div.ui-slider-switch { height: 32px; margin-left: 0; width: 5.8em; } +a.ui-slider-handle-snapping { -webkit-transition: left 70ms linear; -moz-transition: left 70ms linear; } +div.ui-slider-switch .ui-slider-handle { margin-top: 1px; } +.ui-slider-inneroffset { margin: 0 16px; position: relative; z-index: 1; } + +div.ui-slider-switch.ui-slider-mini { width: 5em; height: 29px; } +div.ui-slider-switch.ui-slider-mini .ui-slider-inneroffset { margin: 0 15px 0 14px; } +div.ui-slider-switch.ui-slider-mini .ui-slider-handle { width: 25px; height: 25px; margin: 1px 0 0 -13px; } +div.ui-slider-switch.ui-slider-mini a.ui-slider-handle .ui-btn-inner { height: 30px; width: 30px; padding: 0; margin: 0; } + +span.ui-slider-label { position: absolute; text-align: center; width: 100%; overflow: hidden; font-size: 16px; top: 0; line-height: 2; min-height: 100%; border-width: 0; white-space: nowrap; } +.ui-slider-mini span.ui-slider-label { font-size: 14px; } + +span.ui-slider-label-a { z-index: 1; left: 0; text-indent: -1.5em; } +span.ui-slider-label-b { z-index: 0; right: 0; text-indent: 1.5em;} + +.ui-slider-inline { width: 120px; display: inline-block; } diff --git a/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.forms.textinput.css b/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.forms.textinput.css new file mode 100644 index 0000000..3452bb4 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.forms.textinput.css @@ -0,0 +1,28 @@ +label.ui-input-text { font-size: 16px; line-height: 1.4; display: block; font-weight: normal; margin: 0 0 .3em; } +input.ui-input-text, textarea.ui-input-text { background-image: none; padding: .4em; line-height: 1.4; font-size: 16px; display: block; width: 97%; outline: 0; } +.ui-header input.ui-input-text, +.ui-footer input.ui-input-text { margin-left: 1.25%; padding: .4em 1%; width: 95.5% } /* Note that padding left/right on text inputs is factored into how the element is displayed in Firefox, but does not actually pad the text inside it. */ + input.ui-input-text { -webkit-appearance: none; } +textarea.ui-input-text { height: 50px; -webkit-transition: height 200ms linear; -moz-transition: height 200ms linear; -o-transition: height 200ms linear; transition: height 200ms linear; } +.ui-input-search { padding: 0 30px; background-image: none; position: relative; } +.ui-icon-searchfield:after { position: absolute; left: 7px; top: 50%; margin-top: -9px; content: ""; width: 18px; height: 18px; opacity: .5; } +.ui-input-search input.ui-input-text { border: none; width: 98%; padding: .4em 0; margin: 0; display: block; background: transparent none; outline: 0 !important; } +.ui-input-search .ui-input-clear { position: absolute; right: 0; top: 50%; margin-top: -13px; } +.ui-mini .ui-input-clear { right: -3px; } + +.ui-input-search .ui-input-clear-hidden { display: none; } +input.ui-mini, .ui-mini input, textarea.ui-mini { font-size: 14px; } +textarea.ui-mini { height: 45px; } + +/* orientation adjustments - incomplete!*/ +@media all and (min-width: 450px){ + .ui-field-contain label.ui-input-text { vertical-align: top; display: inline-block; width: 20%; margin: 0 2% 0 0 } + .ui-field-contain input.ui-input-text, + .ui-field-contain textarea.ui-input-text, + .ui-field-contain .ui-input-search { width: 60%; display: inline-block; } + .ui-field-contain .ui-input-search { width: 50%; } + .ui-hide-label input.ui-input-text, + .ui-hide-label textarea.ui-input-text, + .ui-hide-label .ui-input-search { padding: .4em; width: 97%; } + .ui-input-search input.ui-input-text { width: 98%; /*echos rule from above*/ } +} \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.grid.css b/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.grid.css new file mode 100644 index 0000000..39a3850 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.grid.css @@ -0,0 +1,22 @@ +/* content configurations. */ +.ui-grid-a, .ui-grid-b, .ui-grid-c, .ui-grid-d { overflow: hidden; } +.ui-block-a, .ui-block-b, .ui-block-c, .ui-block-d, .ui-block-e { margin: 0; padding: 0; border: 0; float: left; min-height:1px;} + +/* grid solo: 100 - single item fallback */ +.ui-grid-solo .ui-block-a { width: 100%; float: none; } + +/* grid a: 50/50 */ +.ui-grid-a .ui-block-a, .ui-grid-a .ui-block-b { width: 50%; } +.ui-grid-a .ui-block-a { clear: left; } + +/* grid b: 33/33/33 */ +.ui-grid-b .ui-block-a, .ui-grid-b .ui-block-b, .ui-grid-b .ui-block-c { width: 33.333%; } +.ui-grid-b .ui-block-a { clear: left; } + +/* grid c: 25/25/25/25 */ +.ui-grid-c .ui-block-a, .ui-grid-c .ui-block-b, .ui-grid-c .ui-block-c, .ui-grid-c .ui-block-d { width: 25%; } +.ui-grid-c .ui-block-a { clear: left; } + +/* grid d: 20/20/20/20/20 */ +.ui-grid-d .ui-block-a, .ui-grid-d .ui-block-b, .ui-grid-d .ui-block-c, .ui-grid-d .ui-block-d, .ui-grid-d .ui-block-e { width: 20%; } +.ui-grid-d .ui-block-a { clear: left; } diff --git a/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.listview.css b/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.listview.css new file mode 100644 index 0000000..8bbda67 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.listview.css @@ -0,0 +1,51 @@ +.ui-listview { margin: 0; counter-reset: listnumbering; } +.ui-content .ui-listview { margin: -15px; } +.ui-content .ui-listview-inset { margin: 1em 0; } +.ui-listview, .ui-li { list-style:none; padding:0; } +.ui-li, .ui-li.ui-field-contain { display: block; margin:0; position: relative; overflow: visible; text-align: left; border-width: 0; border-top-width: 1px; } +.ui-li .ui-btn-text a.ui-link-inherit { text-overflow: ellipsis; overflow: hidden; white-space: nowrap; } +.ui-li-divider, .ui-li-static { padding: .5em 15px; font-size: 14px; font-weight: bold; } +.ui-li-divider { counter-reset: listnumbering; } +ol.ui-listview .ui-link-inherit:before, ol.ui-listview .ui-li-static:before, .ui-li-dec { font-size: .8em; display: inline-block; padding-right: .3em; font-weight: normal;counter-increment: listnumbering; content: counter(listnumbering) ". "; } +ol.ui-listview .ui-li-jsnumbering:before { content: "" !important; } /* to avoid chance of duplication */ +.ui-listview-inset .ui-li { border-right-width: 1px; border-left-width: 1px; } +.ui-li:last-child, .ui-li.ui-field-contain:last-child { border-bottom-width: 1px; } +.ui-li>.ui-btn-inner { display: block; position: relative; padding: 0; } +.ui-li .ui-btn-inner a.ui-link-inherit, .ui-li-static.ui-li { padding: .7em 15px .7em 15px; display: block; } +.ui-li-has-thumb .ui-btn-inner a.ui-link-inherit, .ui-li-static.ui-li-has-thumb { min-height: 60px; padding-left: 100px; } +.ui-li-has-icon .ui-btn-inner a.ui-link-inherit, .ui-li-static.ui-li-has-icon { min-height: 20px; padding-left: 40px; } +.ui-li-has-count .ui-btn-inner a.ui-link-inherit, .ui-li-static.ui-li-has-count { padding-right: 45px; } +.ui-li-has-arrow .ui-btn-inner a.ui-link-inherit, .ui-li-static.ui-li-has-arrow { padding-right: 30px; } +.ui-li-has-arrow.ui-li-has-count .ui-btn-inner a.ui-link-inherit, .ui-li-static.ui-li-has-arrow.ui-li-has-count { padding-right: 75px; } +.ui-li-has-count .ui-btn-text { padding-right: 15px; } +.ui-li-heading { font-size: 16px; font-weight: bold; display: block; margin: .6em 0; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; } +.ui-li-desc { font-size: 12px; font-weight: normal; display: block; margin: -.5em 0 .6em; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; } +.ui-li-thumb, .ui-listview .ui-li-icon { position: absolute; left: 1px; top: 0; max-height: 80px; max-width: 80px; } +.ui-listview .ui-li-icon { max-height: 40px; max-width: 40px; left: 10px; top: .9em; } +.ui-li-thumb, .ui-listview .ui-li-icon, .ui-li-content { float: left; margin-right: 10px; } + +.ui-li-aside { float: right; width: 50%; text-align: right; margin: .3em 0; } +@media all and (min-width: 480px){ + .ui-li-aside { width: 45%; } +} +.ui-li-divider { cursor: default; } +.ui-li-has-alt .ui-btn-inner a.ui-link-inherit, .ui-li-static.ui-li-has-alt { padding-right: 95px; } +.ui-li-has-count .ui-li-count { position: absolute; font-size: 11px; font-weight: bold; padding: .2em .5em; top: 50%; margin-top: -.9em; right: 48px; } +.ui-li-divider .ui-li-count, .ui-li-static .ui-li-count { right: 10px; } +.ui-li-has-alt .ui-li-count { right: 55px; } +.ui-li-link-alt { position: absolute; width: 40px; height: 100%; border-width: 0; border-left-width: 1px; top: 0; right: 0; margin: 0; padding: 0; z-index: 2; } +.ui-li-link-alt .ui-btn { overflow: hidden; position: absolute; right: 8px; top: 50%; margin: -11px 0 0 0; border-bottom-width: 1px; z-index: -1;} +.ui-li-link-alt .ui-btn-inner { padding: 0; height: 100%; position: absolute; width: 100%; top: 0; left: 0;} +.ui-li-link-alt .ui-btn .ui-icon { right: 50%; margin-right: -9px; } + +.ui-listview * .ui-btn-inner > .ui-btn > .ui-btn-inner { border-top: 0px; } + +.ui-listview-filter { border-width: 0; overflow: hidden; margin: -15px -15px 15px -15px } +.ui-listview-filter .ui-input-search { margin: 5px; width: auto; display: block; } + +.ui-listview-filter-inset { margin: -15px -5px -15px -5px; background: transparent; } +.ui-li.ui-screen-hidden{display:none;} +/* Odd iPad positioning issue. */ +@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) { + .ui-li .ui-btn-text { overflow: visible; } +} \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.navbar.css b/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.navbar.css new file mode 100644 index 0000000..7c9640b --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.navbar.css @@ -0,0 +1,21 @@ +.ui-navbar { overflow: hidden; } +.ui-navbar ul, .ui-navbar-expanded ul { list-style:none; padding: 0; margin: 0; position: relative; display: block; border: 0;} +.ui-navbar-collapsed ul { float: left; width: 75%; margin-right: -2px; } +.ui-navbar-collapsed .ui-navbar-toggle { float: left; width: 25%; } +.ui-navbar li.ui-navbar-truncate { position: absolute; left: -9999px; top: -9999px; } +.ui-navbar li .ui-btn, .ui-navbar .ui-navbar-toggle .ui-btn { display: block; font-size: 12px; text-align: center; margin: 0; border-right-width: 0; max-width: 100%; } +.ui-navbar li .ui-btn { margin-right: -1px; } +.ui-navbar li .ui-btn:last-child { margin-right: 0; } +.ui-header .ui-navbar li .ui-btn, .ui-header .ui-navbar .ui-navbar-toggle .ui-btn, +.ui-footer .ui-navbar li .ui-btn, .ui-footer .ui-navbar .ui-navbar-toggle .ui-btn { border-top-width: 0; border-bottom-width: 0; } +.ui-navbar .ui-btn-inner { padding-left: 2px; padding-right: 2px; } +.ui-navbar-noicons li .ui-btn .ui-btn-inner, .ui-navbar-noicons .ui-navbar-toggle .ui-btn-inner { padding-top: .8em; padding-bottom: .9em; } +/*expanded page styles*/ +.ui-navbar-expanded .ui-btn { margin: 0; font-size: 14px; } +.ui-navbar-expanded .ui-btn-inner { padding-left: 5px; padding-right: 5px; } +.ui-navbar-expanded .ui-btn-icon-top .ui-btn-inner { padding: 45px 5px 15px; text-align: center; } +.ui-navbar-expanded .ui-btn-icon-top .ui-icon { top: 15px; } +.ui-navbar-expanded .ui-btn-icon-bottom .ui-btn-inner { padding: 15px 5px 45px; text-align: center; } +.ui-navbar-expanded .ui-btn-icon-bottom .ui-icon { bottom: 15px; } +.ui-navbar-expanded li .ui-btn .ui-btn-inner { min-height: 2.5em; } +.ui-navbar-expanded .ui-navbar-noicons .ui-btn .ui-btn-inner { padding-top: 1.8em; padding-bottom: 1.9em; } diff --git a/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.structure.css b/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.structure.css new file mode 100644 index 0000000..131eb9d --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.structure.css @@ -0,0 +1,24 @@ +@import url( "jquery.mobile.core.css" ); +@import url( "jquery.mobile.transition.css" ); +@import url( "jquery.mobile.transition.fade.css" ); +@import url( "jquery.mobile.transition.pop.css" ); +@import url( "jquery.mobile.transition.slide.css" ); +@import url( "jquery.mobile.transition.slidefade.css" ); +@import url( "jquery.mobile.transition.slidedown.css" ); +@import url( "jquery.mobile.transition.slideup.css" ); +@import url( "jquery.mobile.transition.flip.css" ); +@import url( "jquery.mobile.transition.turn.css" ); +@import url( "jquery.mobile.transition.flow.css" ); +@import url( "jquery.mobile.grid.css" ); +@import url( "jquery.mobile.fixedToolbar.css" ); +@import url( "jquery.mobile.navbar.css" ); +@import url( "jquery.mobile.button.css" ); +@import url( "jquery.mobile.collapsible.css" ); +@import url( "jquery.mobile.controlgroup.css" ); +@import url( "jquery.mobile.dialog.css" ); +@import url( "jquery.mobile.forms.checkboxradio.css" ); +@import url( "jquery.mobile.forms.fieldcontain.css" ); +@import url( "jquery.mobile.forms.select.css" ); +@import url( "jquery.mobile.forms.textinput.css" ); +@import url( "jquery.mobile.listview.css" ); +@import url( "jquery.mobile.forms.slider.css" ); \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.transition.css b/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.transition.css new file mode 100644 index 0000000..7bccb84 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.transition.css @@ -0,0 +1,21 @@ +/* Transitions originally inspired by those from jQtouch, nice work, folks */ +.ui-mobile-viewport-transitioning, +.ui-mobile-viewport-transitioning .ui-page { + width: 100%; + height: 100%; + overflow: hidden; +} + +.in { + -webkit-animation-timing-function: ease-out; + -webkit-animation-duration: 350ms; + -moz-animation-timing-function: ease-out; + -moz-animation-duration: 350ms; +} + +.out { + -webkit-animation-timing-function: ease-in; + -webkit-animation-duration: 225ms; + -moz-animation-timing-function: ease-in; + -moz-animation-duration: 225; +} \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.transition.fade.css b/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.transition.fade.css new file mode 100644 index 0000000..c039249 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.transition.fade.css @@ -0,0 +1,35 @@ +@-webkit-keyframes fadein { + from { opacity: 0; } + to { opacity: 1; } +} + +@-moz-keyframes fadein { + from { opacity: 0; } + to { opacity: 1; } +} + +@-webkit-keyframes fadeout { + from { opacity: 1; } + to { opacity: 0; } +} + +@-moz-keyframes fadeout { + from { opacity: 1; } + to { opacity: 0; } +} + +.fade.out { + opacity: 0; + -webkit-animation-duration: 125ms; + -webkit-animation-name: fadeout; + -moz-animation-duration: 125ms; + -moz-animation-name: fadeout; +} + +.fade.in { + opacity: 1; + -webkit-animation-duration: 225ms; + -webkit-animation-name: fadein; + -moz-animation-duration: 225ms; + -moz-animation-name: fadein; +} \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.transition.flip.css b/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.transition.flip.css new file mode 100644 index 0000000..3c4a54f --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.transition.flip.css @@ -0,0 +1,79 @@ +/* The properties in this rule are only necessary for the 'flip' transition. + * We need specify the perspective to create a projection matrix. This will add + * some depth as the element flips. The depth number represents the distance of + * the viewer from the z-plane. According to the CSS3 spec, 1000 is a moderate + * value. + */ + +.viewport-flip { + -webkit-perspective: 1000; + -moz-perspective: 1000; + position: absolute; +} +.flip { + -webkit-backface-visibility:hidden; + -webkit-transform:translateX(0); /* Needed to work around an iOS 3.1 bug that causes listview thumbs to disappear when -webkit-visibility:hidden is used. */ + -moz-backface-visibility:hidden; + -moz-transform:translateX(0); +} + +.flip.out { + -webkit-transform: rotateY(-90deg) scale(.9); + -webkit-animation-name: flipouttoleft; + -webkit-animation-duration: 175ms; + -moz-transform: rotateY(-90deg) scale(.9); + -moz-animation-name: flipouttoleft; + -moz-animation-duration: 175ms; +} + +.flip.in { + -webkit-animation-name: flipintoright; + -webkit-animation-duration: 225ms; + -moz-animation-name: flipintoright; + -moz-animation-duration: 225ms; +} + +.flip.out.reverse { + -webkit-transform: rotateY(90deg) scale(.9); + -webkit-animation-name: flipouttoright; + -moz-transform: rotateY(90deg) scale(.9); + -moz-animation-name: flipouttoright; +} + +.flip.in.reverse { + -webkit-animation-name: flipintoleft; + -moz-animation-name: flipintoleft; +} + +@-webkit-keyframes flipouttoleft { + from { -webkit-transform: rotateY(0); } + to { -webkit-transform: rotateY(-90deg) scale(.9); } +} +@-moz-keyframes flipouttoleft { + from { -moz-transform: rotateY(0); } + to { -moz-transform: rotateY(-90deg) scale(.9); } +} +@-webkit-keyframes flipouttoright { + from { -webkit-transform: rotateY(0) ; } + to { -webkit-transform: rotateY(90deg) scale(.9); } +} +@-moz-keyframes flipouttoright { + from { -moz-transform: rotateY(0); } + to { -moz-transform: rotateY(90deg) scale(.9); } +} +@-webkit-keyframes flipintoleft { + from { -webkit-transform: rotateY(-90deg) scale(.9); } + to { -webkit-transform: rotateY(0); } +} +@-moz-keyframes flipintoleft { + from { -moz-transform: rotateY(-90deg) scale(.9); } + to { -moz-transform: rotateY(0); } +} +@-webkit-keyframes flipintoright { + from { -webkit-transform: rotateY(90deg) scale(.9); } + to { -webkit-transform: rotateY(0); } +} +@-moz-keyframes flipintoright { + from { -moz-transform: rotateY(90deg) scale(.9); } + to { -moz-transform: rotateY(0); } +} \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.transition.flow.css b/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.transition.flow.css new file mode 100644 index 0000000..6339642 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.transition.flow.css @@ -0,0 +1,89 @@ +/* flow transition */ +.flow { + -webkit-transform-origin: 50% 30%; + -moz-transform-origin: 50% 30%; + -webkit-box-shadow: 0 0 20px rgba(0,0,0,.4); + -moz-box-shadow: 0 0 20px rgba(0,0,0,.4); +} +.ui-dialog.flow { + -webkit-transform-origin: none; + -moz-transform-origin: none; + -webkit-box-shadow: none; + -moz-box-shadow: none; +} +.flow.out { + -webkit-transform: translateX(-100%) scale(.7); + -webkit-animation-name: flowouttoleft; + -webkit-animation-timing-function: ease; + -webkit-animation-duration: 350ms; + -moz-transform: translateX(-100%) scale(.7); + -moz-animation-name: flowouttoleft; + -moz-animation-timing-function: ease; + -moz-animation-duration: 350ms; +} + +.flow.in { + -webkit-transform: translateX(0) scale(1); + -webkit-animation-name: flowinfromright; + -webkit-animation-timing-function: ease; + -webkit-animation-duration: 350ms; + -moz-transform: translateX(0) scale(1); + -moz-animation-name: flowinfromright; + -moz-animation-timing-function: ease; + -moz-animation-duration: 350ms; +} + +.flow.out.reverse { + -webkit-transform: translateX(100%); + -webkit-animation-name: flowouttoright; + -moz-transform: translateX(100%); + -moz-animation-name: flowouttoright; +} + +.flow.in.reverse { + -webkit-animation-name: flowinfromleft; + -moz-animation-name: flowinfromleft; +} + +@-webkit-keyframes flowouttoleft { + 0% { -webkit-transform: translateX(0) scale(1); } + 60%, 70% { -webkit-transform: translateX(0) scale(.7); } + 100% { -webkit-transform: translateX(-100%) scale(.7); } +} +@-moz-keyframes flowouttoleft { + 0% { -moz-transform: translateX(0) scale(1); } + 60%, 70% { -moz-transform: translateX(0) scale(.7); } + 100% { -moz-transform: translateX(-100%) scale(.7); } +} + +@-webkit-keyframes flowouttoright { + 0% { -webkit-transform: translateX(0) scale(1); } + 60%, 70% { -webkit-transform: translateX(0) scale(.7); } + 100% { -webkit-transform: translateX(100%) scale(.7); } +} +@-moz-keyframes flowouttoright { + 0% { -moz-transform: translateX(0) scale(1); } + 60%, 70% { -moz-transform: translateX(0) scale(.7); } + 100% { -moz-transform: translateX(100%) scale(.7); } +} + +@-webkit-keyframes flowinfromleft { + 0% { -webkit-transform: translateX(-100%) scale(.7); } + 30%, 40% { -webkit-transform: translateX(0) scale(.7); } + 100% { -webkit-transform: translateX(0) scale(1); } +} +@-moz-keyframes flowinfromleft { + 0% { -moz-transform: translateX(-100%) scale(.7); } + 30%, 40% { -moz-transform: translateX(0) scale(.7); } + 100% { -moz-transform: translateX(0) scale(1); } +} +@-webkit-keyframes flowinfromright { + 0% { -webkit-transform: translateX(100%) scale(.7); } + 30%, 40% { -webkit-transform: translateX(0) scale(.7); } + 100% { -webkit-transform: translateX(0) scale(1); } +} +@-moz-keyframes flowinfromright { + 0% { -moz-transform: translateX(100%) scale(.7); } + 30%, 40% { -moz-transform: translateX(0) scale(.7); } + 100% { -moz-transform: translateX(0) scale(1); } +} \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.transition.pop.css b/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.transition.pop.css new file mode 100644 index 0000000..625689e --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.transition.pop.css @@ -0,0 +1,78 @@ +.pop { + -webkit-transform-origin: 50% 50%; + -moz-transform-origin: 50% 50%; +} + +.pop.in { + -webkit-transform: scale(1); + -moz-transform: scale(1); + opacity: 1; + -webkit-animation-name: popin; + -moz-animation-name: popin; + -webkit-animation-duration: 350ms; + -moz-animation-duration: 350ms; +} + +.pop.out { + -webkit-animation-name: fadeout; + -moz-animation-name: fadeout; + opacity: 0; + -webkit-animation-duration: 100ms; + -moz-animation-duration: 100ms; +} + +.pop.in.reverse { + -webkit-animation-name: fadein; + -moz-animation-name: fadein; +} + +.pop.out.reverse { + -webkit-transform: scale(.8); + -moz-transform: scale(.8); + -webkit-animation-name: popout; + -moz-animation-name: popout; +} + +@-webkit-keyframes popin { + from { + -webkit-transform: scale(.8); + opacity: 0; + } + to { + -webkit-transform: scale(1); + opacity: 1; + } +} + +@-moz-keyframes popin { + from { + -moz-transform: scale(.8); + opacity: 0; + } + to { + -moz-transform: scale(1); + opacity: 1; + } +} + +@-webkit-keyframes popout { + from { + -webkit-transform: scale(1); + opacity: 1; + } + to { + -webkit-transform: scale(.8); + opacity: 0; + } +} + +@-moz-keyframes popout { + from { + -moz-transform: scale(1); + opacity: 1; + } + to { + -moz-transform: scale(.8); + opacity: 0; + } +} \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.transition.slide.css b/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.transition.slide.css new file mode 100644 index 0000000..17c924a --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.transition.slide.css @@ -0,0 +1,36 @@ +@import url("jquery.mobile.transition.slidein.keyframes.css"); +@import url("jquery.mobile.transition.slideout.keyframes.css"); + +.slide.out, .slide.in { + -webkit-animation-timing-function: ease-out; + -webkit-animation-duration: 350ms; + -moz-animation-timing-function: ease-out; + -moz-animation-duration: 350ms; +} +.slide.out { + -webkit-transform: translateX(-100%); + -webkit-animation-name: slideouttoleft; + -moz-transform: translateX(-100%); + -moz-animation-name: slideouttoleft; +} + +.slide.in { + -webkit-transform: translateX(0); + -webkit-animation-name: slideinfromright; + -moz-transform: translateX(0); + -moz-animation-name: slideinfromright; +} + +.slide.out.reverse { + -webkit-transform: translateX(100%); + -webkit-animation-name: slideouttoright; + -moz-transform: translateX(100%); + -moz-animation-name: slideouttoright; +} + +.slide.in.reverse { + -webkit-transform: translateX(0); + -webkit-animation-name: slideinfromleft; + -moz-transform: translateX(0); + -moz-animation-name: slideinfromleft; +} \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.transition.slidedown.css b/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.transition.slidedown.css new file mode 100644 index 0000000..b7809d0 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.transition.slidedown.css @@ -0,0 +1,50 @@ +/* slide down */ +.slidedown.out { + -webkit-animation-name: fadeout; + -moz-animation-name: fadeout; + -webkit-animation-duration: 100ms; + -moz-animation-duration: 100ms; +} + +.slidedown.in { + -webkit-transform: translateY(0); + -webkit-animation-name: slideinfromtop; + -moz-transform: translateY(0); + -moz-animation-name: slideinfromtop; + -webkit-animation-duration: 250ms; + -moz-animation-duration: 250ms; +} + +.slidedown.in.reverse { + -webkit-animation-name: fadein; + -moz-animation-name: fadein; + -webkit-animation-duration: 150ms; + -moz-animation-duration: 150ms; +} + +.slidedown.out.reverse { + -webkit-transform: translateY(-100%); + -moz-transform: translateY(-100%); + -webkit-animation-name: slideouttotop; + -moz-animation-name: slideouttotop; + -webkit-animation-duration: 200ms; + -moz-animation-duration: 200ms; +} + +@-webkit-keyframes slideinfromtop { + from { -webkit-transform: translateY(-100%); } + to { -webkit-transform: translateY(0); } +} +@-moz-keyframes slideinfromtop { + from { -moz-transform: translateY(-100%); } + to { -moz-transform: translateY(0); } +} + +@-webkit-keyframes slideouttotop { + from { -webkit-transform: translateY(0); } + to { -webkit-transform: translateY(-100%); } +} +@-moz-keyframes slideouttotop { + from { -moz-transform: translateY(0); } + to { -moz-transform: translateY(-100%); } +} \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.transition.slidefade.css b/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.transition.slidefade.css new file mode 100644 index 0000000..7ef5a67 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.transition.slidefade.css @@ -0,0 +1,38 @@ +@import url("jquery.mobile.transition.fade.css"); +@import url("jquery.mobile.transition.slideout.keyframes.css"); + +.slidefade.out { + -webkit-transform: translateX(-100%); + -webkit-animation-name: slideouttoleft; + -moz-transform: translateX(-100%); + -moz-animation-name: slideouttoleft; + -webkit-animation-duration: 225ms; + -moz-animation-duration: 225ms; +} + +.slidefade.in { + -webkit-transform: translateX(0); + -webkit-animation-name: fadein; + -moz-transform: translateX(0); + -moz-animation-name: fadein; + -webkit-animation-duration: 200ms; + -moz-animation-duration: 200ms; +} + +.slidefade.out.reverse { + -webkit-transform: translateX(100%); + -webkit-animation-name: slideouttoright; + -moz-transform: translateX(100%); + -moz-animation-name: slideouttoright; + -webkit-animation-duration: 200ms; + -moz-animation-duration: 200ms; +} + +.slidefade.in.reverse { + -webkit-transform: translateX(0); + -webkit-animation-name: fadein; + -moz-transform: translateX(0); + -moz-animation-name: fadein; + -webkit-animation-duration: 200ms; + -moz-animation-duration: 200ms; +} \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.transition.slidein.keyframes.css b/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.transition.slidein.keyframes.css new file mode 100644 index 0000000..76a9fcb --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.transition.slidein.keyframes.css @@ -0,0 +1,18 @@ +/* keyframes for slidein from sides */ +@-webkit-keyframes slideinfromright { + from { -webkit-transform: translateX(100%); } + to { -webkit-transform: translateX(0); } +} +@-moz-keyframes slideinfromright { + from { -moz-transform: translateX(100%); } + to { -moz-transform: translateX(0); } +} + +@-webkit-keyframes slideinfromleft { + from { -webkit-transform: translateX(-100%); } + to { -webkit-transform: translateX(0); } +} +@-moz-keyframes slideinfromleft { + from { -moz-transform: translateX(-100%); } + to { -moz-transform: translateX(0); } +} \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.transition.slideout.keyframes.css b/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.transition.slideout.keyframes.css new file mode 100644 index 0000000..9bea170 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.transition.slideout.keyframes.css @@ -0,0 +1,18 @@ +/* keyframes for slideout to sides */ +@-webkit-keyframes slideouttoleft { + from { -webkit-transform: translateX(0); } + to { -webkit-transform: translateX(-100%); } +} +@-moz-keyframes slideouttoleft { + from { -moz-transform: translateX(0); } + to { -moz-transform: translateX(-100%); } +} + +@-webkit-keyframes slideouttoright { + from { -webkit-transform: translateX(0); } + to { -webkit-transform: translateX(100%); } +} +@-moz-keyframes slideouttoright { + from { -moz-transform: translateX(0); } + to { -moz-transform: translateX(100%); } +} diff --git a/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.transition.slideup.css b/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.transition.slideup.css new file mode 100644 index 0000000..e607aad --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.transition.slideup.css @@ -0,0 +1,50 @@ +/* slide up */ +.slideup.out { + -webkit-animation-name: fadeout; + -moz-animation-name: fadeout; + -webkit-animation-duration: 100ms; + -moz-animation-duration: 100ms; +} + +.slideup.in { + -webkit-transform: translateY(0); + -webkit-animation-name: slideinfrombottom; + -moz-transform: translateY(0); + -moz-animation-name: slideinfrombottom; + -webkit-animation-duration: 250ms; + -moz-animation-duration: 250ms; +} + +.slideup.in.reverse { + -webkit-animation-name: fadein; + -moz-animation-name: fadein; + -webkit-animation-duration: 150ms; + -moz-animation-duration: 150ms; +} + +.slideup.out.reverse { + -webkit-transform: translateY(100%); + -moz-transform: translateY(100%); + -webkit-animation-name: slideouttobottom; + -moz-animation-name: slideouttobottom; + -webkit-animation-duration: 200ms; + -moz-animation-duration: 200ms; +} + +@-webkit-keyframes slideinfrombottom { + from { -webkit-transform: translateY(100%); } + to { -webkit-transform: translateY(0); } +} +@-moz-keyframes slideinfrombottom { + from { -moz-transform: translateY(100%); } + to { -moz-transform: translateY(0); } +} + +@-webkit-keyframes slideouttobottom { + from { -webkit-transform: translateY(0); } + to { -webkit-transform: translateY(100%); } +} +@-moz-keyframes slideouttobottom { + from { -moz-transform: translateY(0); } + to { -moz-transform: translateY(100%); } +} \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.transition.turn.css b/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.transition.turn.css new file mode 100644 index 0000000..086fc2b --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/css/structure/jquery.mobile.transition.turn.css @@ -0,0 +1,83 @@ +/* The properties in this rule are only necessary for the 'flip' transition. + * We need specify the perspective to create a projection matrix. This will add + * some depth as the element flips. The depth number represents the distance of + * the viewer from the z-plane. According to the CSS3 spec, 1000 is a moderate + * value. + */ + +.viewport-turn { + -webkit-perspective: 1000; + -moz-perspective: 1000; + position: absolute; +} +.turn { + -webkit-backface-visibility:hidden; + -webkit-transform:translateX(0); /* Needed to work around an iOS 3.1 bug that causes listview thumbs to disappear when -webkit-visibility:hidden is used. */ + -webkit-transform-origin: 0; + + -moz-backface-visibility:hidden; + -moz-transform:translateX(0); /* Needed to work around an iOS 3.1 bug that causes listview thumbs to disappear when -webkit-visibility:hidden is used. */ + -moz-transform-origin: 0; +} + +.turn.out { + -webkit-transform: rotateY(-90deg) scale(.9); + -webkit-animation-name: flipouttoleft; + -moz-transform: rotateY(-90deg) scale(.9); + -moz-animation-name: flipouttoleft; + -webkit-animation-duration: 125ms; + -moz-animation-duration: 125ms; +} + +.turn.in { + -webkit-animation-name: flipintoright; + -moz-animation-name: flipintoright; + -webkit-animation-duration: 250ms; + -moz-animation-duration: 250ms; + +} + +.turn.out.reverse { + -webkit-transform: rotateY(90deg) scale(.9); + -webkit-animation-name: flipouttoright; + -moz-transform: rotateY(90deg) scale(.9); + -moz-animation-name: flipouttoright; +} + +.turn.in.reverse { + -webkit-animation-name: flipintoleft; + -moz-animation-name: flipintoleft; +} + +@-webkit-keyframes flipouttoleft { + from { -webkit-transform: rotateY(0); } + to { -webkit-transform: rotateY(-90deg) scale(.9); } +} +@-moz-keyframes flipouttoleft { + from { -moz-transform: rotateY(0); } + to { -moz-transform: rotateY(-90deg) scale(.9); } +} +@-webkit-keyframes flipouttoright { + from { -webkit-transform: rotateY(0) ; } + to { -webkit-transform: rotateY(90deg) scale(.9); } +} +@-moz-keyframes flipouttoright { + from { -moz-transform: rotateY(0); } + to { -moz-transform: rotateY(90deg) scale(.9); } +} +@-webkit-keyframes flipintoleft { + from { -webkit-transform: rotateY(-90deg) scale(.9); } + to { -webkit-transform: rotateY(0); } +} +@-moz-keyframes flipintoleft { + from { -moz-transform: rotateY(-90deg) scale(.9); } + to { -moz-transform: rotateY(0); } +} +@-webkit-keyframes flipintoright { + from { -webkit-transform: rotateY(90deg) scale(.9); } + to { -webkit-transform: rotateY(0); } +} +@-moz-keyframes flipintoright { + from { -moz-transform: rotateY(90deg) scale(.9); } + to { -moz-transform: rotateY(0); } +} diff --git a/libs/js/jquery-mobile-1.1.0/css/themes/default/images/ajax-loader.gif b/libs/js/jquery-mobile-1.1.0/css/themes/default/images/ajax-loader.gif new file mode 100644 index 0000000..fd1a189 Binary files /dev/null and b/libs/js/jquery-mobile-1.1.0/css/themes/default/images/ajax-loader.gif differ diff --git a/libs/js/jquery-mobile-1.1.0/css/themes/default/images/ajax-loader.png b/libs/js/jquery-mobile-1.1.0/css/themes/default/images/ajax-loader.png new file mode 100644 index 0000000..13b208d Binary files /dev/null and b/libs/js/jquery-mobile-1.1.0/css/themes/default/images/ajax-loader.png differ diff --git a/libs/js/jquery-mobile-1.1.0/css/themes/default/images/icons-18-black.png b/libs/js/jquery-mobile-1.1.0/css/themes/default/images/icons-18-black.png new file mode 100644 index 0000000..ce1b758 Binary files /dev/null and b/libs/js/jquery-mobile-1.1.0/css/themes/default/images/icons-18-black.png differ diff --git a/libs/js/jquery-mobile-1.1.0/css/themes/default/images/icons-18-white.png b/libs/js/jquery-mobile-1.1.0/css/themes/default/images/icons-18-white.png new file mode 100644 index 0000000..1ab0127 Binary files /dev/null and b/libs/js/jquery-mobile-1.1.0/css/themes/default/images/icons-18-white.png differ diff --git a/libs/js/jquery-mobile-1.1.0/css/themes/default/images/icons-36-black.png b/libs/js/jquery-mobile-1.1.0/css/themes/default/images/icons-36-black.png new file mode 100644 index 0000000..1a59d7c Binary files /dev/null and b/libs/js/jquery-mobile-1.1.0/css/themes/default/images/icons-36-black.png differ diff --git a/libs/js/jquery-mobile-1.1.0/css/themes/default/images/icons-36-white.png b/libs/js/jquery-mobile-1.1.0/css/themes/default/images/icons-36-white.png new file mode 100644 index 0000000..5647bdc Binary files /dev/null and b/libs/js/jquery-mobile-1.1.0/css/themes/default/images/icons-36-white.png differ diff --git a/libs/js/jquery-mobile-1.1.0/css/themes/default/index.php b/libs/js/jquery-mobile-1.1.0/css/themes/default/index.php new file mode 100644 index 0000000..431474d --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/css/themes/default/index.php @@ -0,0 +1,7 @@ +View Source'), + src = src = $('
      ').append( $(this).clone() ).html(), + page = $( "
      " + + "
      " + + "Close"+ + "
      jQuery Mobile Source Excerpt
      "+ + "
      "+ + "
      "+ + "
      " ) + .appendTo( "body" ) + .page(); + + $('View Source') + .buttonMarkup({ + icon: 'arrow-u', + iconpos: 'notext' + }) + .click(function(){ + var codeblock = $('
      '); + src = src.replace(/&/gmi, '&').replace(/"/gmi, '"').replace(/>/gmi, '>').replace(/' , { + 'class': "ui-footer ui-bar-e", + style: "overflow: auto; padding:10px 15px;", + 'data-ajax-warning': true + }); + + message + .append( "

      Note: Navigation may not work if viewed locally

      " ) + .append( "

      The AJAX-based navigation used throughout the jQuery Mobile docs may need to be viewed on a web server to work in certain browsers. If you see an error message when you click a link, try a different browser or view help.

      " ); + + $( document ).bind( "pagecreate", function( event ) { + $( event.target ).append( message ); + }); + }); + }); +} diff --git a/libs/js/jquery-mobile-1.1.0/docs/about/accessibility.html b/libs/js/jquery-mobile-1.1.0/docs/about/accessibility.html new file mode 100644 index 0000000..b8891d2 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/about/accessibility.html @@ -0,0 +1,70 @@ + + + + + + jQuery Mobile Docs - Accessibility + + + + + + + + + + +
      + +
      +

      Accessibility

      + Home + Search +
      + +
      + + +
      + +

      Accessibility

      +

      jQuery Mobile is built upon standard, semantic HTML, allowing pages to be accessible to the broadest range of devices possible. For A-Grade browsers, many of the components in jQuery Mobile leverage techniques such as focus management, keyboard navigation, and HTML attributes specified in the W3C's WAI-ARIA specification.

      + +

      By utilizing these techniques, we do our best to ensure an accessible experience to users with disabilities such as blindness, who may use screen readers (like VoiceOver, on Apple's iPhone device) or other assistive technology to access the web.

      + +
      + +
      + +
      + +

      More in this section

      + + +
      +
      + + +
      + + + + + +
      + +
      + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/about/features.html b/libs/js/jquery-mobile-1.1.0/docs/about/features.html new file mode 100644 index 0000000..06ce295 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/about/features.html @@ -0,0 +1,77 @@ + + + + + + jQuery Mobile Docs - Features + + + + + + + + + + +
      + +
      +

      Features

      + Home + Search +
      + +
      + +
      + +

      Key features:

      +
        +
      • Built on jQuery core for familiar and consistent jQuery syntax and minimal learning curve and leverages jQuery UI code and patterns.
      • +
      • Compatible with all major mobile, tablet, e-reader & desktop platforms - iOS, Android, Blackberry, Palm WebOS, Nokia/Symbian, Windows Phone 7, MeeGo, Opera Mobile/Mini, Firefox Mobile, Kindle, Nook, and all modern browsers with graded levels of support.
      • +
      • Lightweight size and minimal image dependencies for speed.
      • +
      • Modular architecture for creating custom builds that are optimized to only include the features needed for a particular application
      • +
      • HTML5 Markup-driven configuration of pages and behavior for fast development and minimal required scripting.
      • +
      • Progressive enhancement approach brings core content and functionality to all mobile, tablet and desktop platforms and a rich, installed application-like experience on newer mobile platforms.
      • +
      • Responsive design techniques and tools allow the same underlying codebase to automatically scale from smartphone to desktop-sized screens
      • +
      • Powerful Ajax-powered navigation system to enable animated page transitions while maintaining back button, bookmarking and and clean URLs though pushState.
      • +
      • Accessibility features such as WAI-ARIA are also included to ensure that the pages work for screen readers (e.g. VoiceOver in iOS) and other assistive technologies.
      • +
      • Touch and mouse event support streamline the process of supporting touch, mouse, and cursor focus-based user input methods with a simple API.
      • +
      • Unified UI widgets for common controls enhance native controls with touch-optimized, themable controls that are platform-agnostic and easy to use.
      • +
      • Powerful theming framework and the ThemeRoller application make highly-branded experiences easy to build.
      • + +
      + +
      + +
      + +
      + +

      More in this section

      + + +
      +
      + +
      + + + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/about/getting-started.html b/libs/js/jquery-mobile-1.1.0/docs/about/getting-started.html new file mode 100644 index 0000000..17416e3 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/about/getting-started.html @@ -0,0 +1,171 @@ + + + + + + jQuery Mobile Docs - Quick start + + + + + + + + + + +
      + +
      +

      Quick start guide

      + + + Home + Search +
      + +
      + +
      + +

      Getting Started with jQuery Mobile

      + +

      jQuery Mobile provides a set of touch-friendly UI widgets and an AJAX-powered navigation system to support animated page transitions. Building your first jQuery Mobile page is easy, here's how:

      + +

      Create a basic page template

      +

      Pop open your favorite text editor, paste in the page template below, save and open in a browser. You are now a mobile developer!

      +

      Here's what's in the template. In the head, a meta viewport tag sets the screen width to the pixel width of the device and references to jQuery, jQuery Mobile and the mobile theme stylesheet from the CDN add all the styles and scripts. jQuery Mobile 1.1 works with both 1.6.4 and 1.7.1 versions of jQuery core.

      +

      In the body, a div with a data-role of page is the wrapper used to delineate a page, and the header bar (data-role="header") and content region (data-role="content") are added inside to create a basic page (these are both optional). These data- attributes are HTML5 attributes are used throughout jQuery Mobile to transform basic markup into an enhanced and styled widget.

      + +
      
      +<!DOCTYPE html> 
      +<html> 
      +	<head> 
      +	<title>My Page</title> 
      +	<meta name="viewport" content="width=device-width, initial-scale=1"> 
      +	<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
      +	<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
      +	<script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
      +</head> 
      +<body> 
      +
      +<div data-role="page">
      +
      +	<div data-role="header">
      +		<h1>My Title</h1>
      +	</div><!-- /header -->
      +
      +	<div data-role="content">	
      +		<p>Hello world</p>		
      +	</div><!-- /content -->
      +
      +</div><!-- /page -->
      +
      +</body>
      +</html>
      +
      + + +

      Add your content

      +

      Inside your content container, you can add any standard HTML elements - headings, lists, paragraphs, etc. You can write your own custom styles to create custom layouts by adding an additional stylesheet to the head after the jQuery Mobile stylesheet.

      + +

      Make a listview

      +

      jQuery Mobile includes a diverse set of common listviews that are coded as lists with a data-role="listview" added. Here is a simple linked list that has a role of listview. We're going to make this look like an inset module by adding a data-inset="true" and add a dynamic search filter with the data-filter="true" attributes.

      + +
      
      +<ul data-role="listview" data-inset="true" data-filter="true">
      +	<li><a href="#">Acura</a></li>
      +	<li><a href="#">Audi</a></li>
      +	<li><a href="#">BMW</a></li>
      +	<li><a href="#">Cadillac</a></li>
      +	<li><a href="#">Ferrari</a></li>
      +</ul>
      +
      +
      + + + + + +

      Add a slider

      +

      The framework contains a full set of form elements that automatically are enhanced into touch-friendly styled widgets. Here's a slider made with the new HTML5 input type of range, no data-role needed. Be sure to wrap these in a form element and always properly associate a label to every form element.

      + +
      
      +<form>
      +   <label for="slider-0">Input slider:</label>
      +   <input type="range" name="slider" id="slider-0" value="25" min="0" max="100"  />
      +</form>
      +
      + +
      + + +
      + + + +

      Make a button

      +

      There are a few ways to make buttons, but lets turn a link into a button so it's easy to click. Just start with a link and add a data-role="button" attribute to it. You can add an icon with the data-icon attribute and optionally set its position with the data-iconpos attribute.

      + +
      
      +<a href="#" data-role="button" data-icon="star">Star button</a>
      +
      + + Star button + + + +

      Play with theme swatches

      +

      jQuery Mobile has a robust theme framework that supports up to 26 sets of toolbar, content and button colors, called a "swatch". Just add a data-theme="e" attribute to any of the widgets on this page: page, header, list, input for the slider, or button to turn it yellow. Try different swatch letters in default theme from a-e to mix and match swatches.

      +

      Cool party trick: add the theme swatch to the page and see how all the widgets inside the content will automatically inherit the theme (headers don't inherit, they default to swatch A).

      + +<a href="#" data-role="button" data-icon="star" data-theme="a">Button</a> + + data-theme="a" + data-theme="b" + data-theme="c" + data-theme="d" + data-theme="e" + +

      When you're ready to build a custom theme, use ThemeRoller to drag and drop, then download a custom theme.

      + +

      Go forth and build stuff

      +

      This is just scratching the surface of all the cool things you can build with jQuery Mobile with little effort. Be sure to explore linking pages, adding animated page transitions, and creating dialogs. Use the data-attribute reference to try out some of the other data- attributes you can play with.

      + +

      More of a developer? Great, forget everything we just covered (kidding). If you don't want to use the data- attribute configuration system, you can take full control of everything and call plugins directly because these are all just standard jQuery plugins built with the UI widget factory. Be sure to dig into global configuration, events, and methods. Then read up on scripting pages, generating dynamic pages, and building PhoneGap apps.

      +
      + +
      + +
      + +

      More in this section

      + + +
      +
      + +
      + + + + +
      + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/about/index.html b/libs/js/jquery-mobile-1.1.0/docs/about/index.html new file mode 100644 index 0000000..5b6720a --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/about/index.html @@ -0,0 +1,40 @@ + + + + + + jQuery UI Mobile Framework - About + + + + + + + + + + +
      + +
      +

      About jQuery Mobile

      + Home + Search +
      + + + +
      + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/about/intro.html b/libs/js/jquery-mobile-1.1.0/docs/about/intro.html new file mode 100644 index 0000000..0487c5e --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/about/intro.html @@ -0,0 +1,70 @@ + + + + + + jQuery Mobile Docs - Intro + + + + + + + + + + +
      + +
      +

      Introduction

      + Home + Search +
      + +
      + +
      + +

      jQuery Mobile Overview

      + +

      jQuery’s mobile strategy can be summarized simply: A unified user interface system that works seamlessly across all popular mobile device platforms, built on the rock-solid jQuery and jQuery UI foundation. Focused on a feature-rich but lightweight codebase built on progressive enhancement with a flexible, theming system and ThemeRoller tool.

      +

      The framework includes an Ajax navigation system that brings animated page transitions and a core set of UI widgets: pages, dialogs, toolbars, listviews, buttons with icons, form elements, accordions, collapsibles, and more.

      + +

      The critical difference with our approach is the wide variety of mobile platforms we’re targeting with jQuery Mobile so no browser or device is left behind. We've also focused on making jQuery Mobile easy to learn with a simple, markup-based system to applying behavior and theming. For more advanced developers, there is a rich API of global configuration options, events, and methods to apply scripting, generate dynamic pages, and even build native apps with tools like PhoneGap.

      + +

      To make this broad support possible, all pages in jQuery Mobile are built on a foundation of clean, semantic HTML to ensure compatibility with pretty much any web-enabled device. In devices that interpret CSS and JavaScript, jQuery Mobile applies progressive enhancement techniques to unobtrusively transform the semantic page into a rich, interactive experience that leverages the power of jQuery and CSS. Accessibility features such as WAI-ARIA are tightly integrated throughout the framework to provide support for screen readers and other assistive technologies.

      + + +
      + +
      + +
      + +

      More in this section

      + + +
      +
      + +
      + + + + +
      + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/about/platforms.html b/libs/js/jquery-mobile-1.1.0/docs/about/platforms.html new file mode 100644 index 0000000..e36acf8 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/about/platforms.html @@ -0,0 +1,108 @@ + + + + + + jQuery Mobile Docs - Supported platforms + + + + + + + + + + +
      + +
      +

      Supported platforms

      + Home + Search +
      + +
      + + +
      +

      jQuery Mobile Supported Platforms

      +

      jQuery Mobile has broad support for the vast majority of all modern desktop, smartphone, tablet, and e-reader platforms. In addition, feature phones and older browsers are supported because of our progressive enhancement approach. We're very proud of our commitment to universal accessibility through our broad support for all popular platforms.

      + +

      We use a 3-level graded platform support system: A (full), B (full minus Ajax), C (basic HTML). The visual fidelity of the experience and smoothness of page transitions are highly dependent on the CSS rendering capabilities of the device and platform so not all A grade experience will be pixel-perfect but that's the nature of the web.

      + +

      A-grade - Full enhanced experience with Ajax-based animated page transitions.

      +
        +
      • Apple iOS 3.2-5.0 - Tested on the original iPad (4.3 / 5.0), iPad 2 (4.3), original iPhone (3.1), iPhone 3 (3.2), 3GS (4.3), 4 (4.3 / 5.0), and 4S (5.0)
      • +
      • Android 2.1-2.3 - Tested on the HTC Incredible (2.2), original Droid (2.2), HTC Aria (2.1), Google Nexus S (2.3). Functional on 1.5 & 1.6 but performance may be sluggish, tested on Google G1 (1.5)
      • +
      • Android 3.1 (Honeycomb)  - Tested on the Samsung Galaxy Tab 10.1 and Motorola XOOM
      • +
      • Android 4.0 (ICS)  - Tested on a Galaxy Nexus. Note: transition performance can be poor on upgraded devices
      • +
      • Windows Phone 7-7.5 - Tested on the HTC Surround (7.0) HTC Trophy (7.5), LG-E900 (7.5), Nokia Lumia 800
      • +
      • Blackberry 6.0 - Tested on the Torch 9800 and Style 9670
      • +
      • Blackberry 7 - Tested on BlackBerry® Torch 9810
      • +
      • Blackberry Playbook (1.0-2.0) - Tested on PlayBook
      • +
      • Palm WebOS (1.4-2.0) - Tested on the Palm Pixi (1.4), Pre (1.4), Pre 2 (2.0)
      • +
      • Palm WebOS 3.0 - Tested on HP TouchPad
      • +
      • Firebox Mobile (10 Beta) - Tested on Android 2.3 device
      • +
      • Chrome for Android (Beta) - Tested on Android 4.0 device
      • +
      • Skyfire 4.1 - Tested on Android 2.3 device
      • +
      • Opera Mobile 11.5: Tested on Android 2.3
      • +
      • Meego 1.2 - Tested on Nokia 950 and N9
      • +
      • Samsung bada 2.0 - Tested on a Samsung Wave 3, Dolphin browser
      • +
      • UC Browser - Tested on Android 2.3 device
      • +
      • Kindle 3 and Fire - Tested on the built-in WebKit browser for each
      • +
      • Nook Color 1.4.1 - Tested on original Nook Color, not Nook Tablet
      • +
      • Chrome Desktop 11-17 - Tested on OS X 10.7 and Windows 7
      • +
      • Safari Desktop 4-5 - Tested on OS X 10.7 and Windows 7
      • +
      • Firefox Desktop 4-9 - Tested on OS X 10.7 and Windows 7
      • +
      • Internet Explorer 7-9 - Tested on Windows XP, Vista and 7
      • +
      • Opera Desktop 10-11 - Tested on OS X 10.7 and Windows 7
      • +
      +

      B-grade - Enhanced experience except without Ajax navigation features.

      +
        +
      • Blackberry 5.0: Tested on the Storm 2 9550, Bold 9770
      • +
      • Opera Mini (5.0-6.5) - Tested on iOS 3.2/4.3 and Android 2.3
      • +
      • Nokia Symbian^3 - Tested on Nokia N8 (Symbian^3), C7 (Symbian^3), also works on N97 (Symbian^1)
      • +
      +

      C-grade - Basic, non-enhanced HTML experience that is still functional

      +
        +
      • Blackberry 4.x - Tested on the Curve 8330
      • +
      • Windows Mobile - Tested on the HTC Leo (WinMo 5.2)
      • +
      • All older smartphone platforms and featurephones - Any device that doesn't support media queries will receive the basic, C grade experience
      • +
      + + +
      + +
      + +
      + +

      More in this section

      + + +
      +
      + +
      + + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/api/data-attributes.html b/libs/js/jquery-mobile-1.1.0/docs/api/data-attributes.html new file mode 100644 index 0000000..38e23c6 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/api/data-attributes.html @@ -0,0 +1,530 @@ + + + + + + jQuery Mobile Docs - Data Attribute Reference + + + + + + + + + + +
      + +
      +

      Data Attributes

      + Home + Search +
      + +
      + +
      +

      Data- attribute reference

      +

      The jQuery Mobile framework uses HTML5 data- attributes to allow for markup-based initialization and configuration of widgets. These attributes are completely optional; calling plugins manually and passing options directly is also supported. To avoid naming conflicts with other plugins or frameworks that also use data- attributes, set a custom namespace by modifying the ns global option.

      + + + +

      Button

      +

      Links with data-role="button". Input-based buttons and button elements are auto-enhanced, no data-role required

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      data-cornerstrue | false
      data-iconhome | delete | plus | arrow-u | arrow-d | check | gear | grid | star | custom | arrow-r | arrow-l | minus | refresh | forward | back | alert | info | search
      data-iconposleft | right | top | bottom | notext
      data-iconshadowtrue | false
      data-inlinetrue | false
      data-minitrue | false - Compact sized version
      data-shadowtrue | false
      data-themeswatch letter (a-z)
      +

      Multiple buttons can be wrapped in a container with a data-role="controlgroup" attribute for a vertically grouped set. Add the data-type="horizontal" attribute for the buttons to sit side-by-side.

      + + +

      Checkbox

      +

      Pairs of labels and inputs with type="checkbox" are auto-enhanced, no data-role required

      + + + + + + + + + + + + + +
      data-minitrue | false - Compact sized version
      data-rolenone (prevents auto-enhancement to use native control)
      data-themeswatch letter (a-z) - Added to the form element
      + +

      Collapsible

      +

      A heading and content wrapped in a container with the data-role="collapsible"

      + + + + + + + + + + + + + + + + + + + + + +
      data-collapsedtrue | false
      data-content-themeswatch letter (a-z)
      data-iconposleft | right | top | bottom | notext
      data-minitrue | false - Compact sized version
      data-themeswatch letter (a-z)
      + +

      Collapsible set

      +

      A number of collapsibles wrapped in a container with the data-role="collapsible-set"

      + + + + + + + + + + + + + + + + + +
      data-content-themeswatch letter (a-z) - Sets all collapsibles in set
      data-iconposleft | right | top | bottom | notext
      data-minitrue | false - Compact sized version
      data-themeswatch letter (a-z) - Sets all collapsibles in set
      + +

      Content

      +

      Container with data-role="content"

      + + + + + +
      data-themeswatch letter (a-z)
      + +

      Dialog

      +

      Page with data-role="page" linked to with data-rel="dialog" on the anchor.

      + + + + + + + + + + + + + + + + + + + + + +
      data-close-btn-textstring (text for the close button, dialog only)
      data-dom-cachetrue | false
      data-overlay-themeswatch letter (a-z) - overlay theme when the page is opened in a dialog
      data-themeswatch letter (a-z)
      data-titlestring (title used when page is shown)
      + +

      Enhancement

      +

      Container with data-enhance="false" or data-ajax="false"

      + + + + + + + + + +
      data-enhancetrue | false
      data-ajaxtrue | false
      +

      Any DOM elements inside a data-enhance="false" container, save for data-role="page|dialog" elements, will be ignored during initial enhancement and subsequent create events provided that the $.mobile.ignoreContentEnabled flag is set prior to the enhancement (eg in a mobileinit binding).

      + +

      Any link or form elements inside data-enhance="false" containers will be ignored by the framework's navigation functionality when $.mobile.ignoreContentEnabled is set to true.

      + +

      Field container

      +

      Container with data-role="fieldcontain" wrapped around label/form element pair

      + +

      Flip toggle switch

      +

      Select with data-role="slider", two options only

      + + + + + + + + + + + + + + + + + +
      data-minitrue | false - Compact sized version
      data-rolenone (prevents auto-enhancement to use native control)
      data-themeswatch letter (a-z) - Added to the form element
      data-track-themeswatch letter (a-z) - Added to the form element
      + +

      Footer

      +

      Container with data-role="footer"

      + + + + + + + + + + + + + + + + + +
      data-idstring (unique id, useful in persistent footers)
      data-positionfixed
      data-fullscreentrue (used in conjunction with fixed toolbars)
      data-themeswatch letter (a-z)
      + +

      Header

      +

      Container with data-role="header"

      + + + + + + + + + + + + + +
      data-positionfixed
      data-fullscreentrue (used in conjunction with fixed toolbars)
      data-themeswatch letter (a-z)
      + +

      Link

      +

      Links, including those with a data-role="button", and form submit buttons share these attributes

      + + + + + + + + + + + + + + + + + + + + + + + + + +
      data-ajaxtrue | false
      data-directionreverse (reverse page transition animation)
      data-dom-cachetrue | false
      data-prefetchtrue | false
      data-relback (to move one step back in history)
      + dialog (to open link styled as dialog, not tracked in history)
      + external (for linking to another domain)
      data-transitionslide | slideup | slidedown | pop | fade | flip
      + +

      Listview

      +

      OL or UL with data-role="listview"

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      data-count-themeswatch letter (a-z)
      data-divider-themeswatch letter (a-z)
      data-filtertrue | false
      data-filter-placeholderstring
      data-filter-themeswatch letter (a-z)
      data-insettrue | false
      data-split-iconhome | delete | plus | arrow-u | arrow-d | check | gear | grid | star | custom | arrow-r | arrow-l | minus | refresh | forward | back | alert | info | search
      data-split-themeswatch letter (a-z) +
      data-themeswatch letter (a-z)
      + +

      Listview item

      +

      LI within a listview

      + + + + + + + + + + + + + + + + + +
      data-filtertextstring (filter by this value instead of inner text)
      data-iconhome | delete | plus | arrow-u | arrow-d | check | gear | grid | star | custom | arrow-r | arrow-l | minus | refresh | forward | back | alert | info | search
      data-rolelist-divider
      data-themeswatch letter (a-z) - can also be set on individual LIs
      +

      Navbar

      +

      A number of LIs wrapped in a container with data-role="navbar"

      + + + + + + + + + + + + + +
      data-iconhome | delete | plus | arrow-u | arrow-d | check | gear | grid | star | custom | arrow-r | arrow-l | minus | refresh | forward | back | alert | info | search
      data-iconposleft | right | top | bottom | notext
      data-themeswatch letter (a-z) - can also be set on individual LIs
      +

      Page

      +

      Container with data-role="page"

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      data-add-back-btntrue | false (auto add back button, header only)
      data-back-btn-textstring
      data-back-btn-themeswatch letter (a-z)
      data-close-btn-textstring (text for the close button, dialog only)
      data-dom-cachetrue | false
      data-fullscreentrue (used in conjunction with fixed toolbars)

      Deprecated in 1.1 - use on header and footer instead.

      data-overlay-themeswatch letter (a-z) - overlay theme when the page is opened in a dialog
      data-themeswatch letter (a-z)
      data-titlestring (title used when page is shown)
      + +

      Radio button

      +

      Pairs of labels and inputs with type="radio" are auto-enhanced, no data-role required

      + + + + + + + + + + + + + +
      data-minitrue | false - Compact sized version
      data-rolenone (prevents auto-enhancement to use native control)
      data-themeswatch letter (a-z) - Added to the form element
      + +

      Select

      +

      All select form elements are auto-enhanced, no data-role required

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      data-iconhome | delete | plus | arrow-u | arrow-d | check | gear | grid | star | custom | arrow-r | arrow-l | minus | refresh | forward | back | alert | info | search
      data-iconposleft | right | top | bottom | notext
      data-inlinetrue | false
      data-minitrue | false - Compact sized version
      data-native-menutrue | false
      data-overlay-themeswatch letter (a-z) - overlay theme for non-native selects
      data-placeholdertrue | false - Add to the Option
      data-rolenone (prevents auto-enhancement to use native control)
      data-themeswatch letter (a-z) - Added to the form element
      +

      Multiple selects can be wrapped in a fieldset with a data-role="controlgroup" attribute for a vertically grouped set. Add the data-type="horizontal" attribute for the selects to sit side-by-side.

      + +

      Slider

      +

      Inputs with type="range" are auto-enhanced, no data-role required

      + + + + + + + + + + + + + + + + + + + + + +
      data-highlighttrue | false - Adds an active state fill on track to handle
      data-minitrue | false - Compact sized version
      data-rolenone (prevents auto-enhancement to use native control)
      data-themeswatch letter (a-z) - Added to the form element
      data-track-themeswatch letter (a-z) - Added to the form element
      + +

      Text input & Textarea

      +

      Input type="text|number|search|etc." or textarea elements are auto-enhanced, no data-role required

      + + + + + + + + + + + + + +
      data-minitrue | false - Compact sized version
      data-rolenone (prevents auto-enhancement to use native control)
      data-themeswatch letter (a-z) - Added to the form element
      + +
      + +
      + +
      + +

      More in this section

      + + +
      +
      + +
      + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/api/events-nav.html b/libs/js/jquery-mobile-1.1.0/docs/api/events-nav.html new file mode 100644 index 0000000..01e8201 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/api/events-nav.html @@ -0,0 +1,557 @@ + + + + + + jQuery Mobile Docs - Events + + + + + + + + + + +
      + +
      +

      Events

      + Home + Search +
      + +
      +
      + +

      Framework, Page, and Navigation Events

      +

      jQuery Mobile's widget and navigation system has a full set of events at each stage of the page load and page change process that can be tapped into to take full control. This page will highlight the most commonly used events and what they do, and also provide chronologies of when these events are triggered during load and transitions.

      + + +

      Framework events

      + +

      When jQuery Mobile initializes, it triggers an event on the document that is specifically designed for overriding framework and plugin defaults. That event is called mobileinit, and by binding to it, you can ensure that any global or plugin configuration options are overridden to any value you'd like before they are used by the framework's initial execution.

      + + +
      +				
      +$(document).bind("mobileinit", function(){
      +  //apply overrides here
      +});
      +				
      +			
      + +

      The tricky aspect of mobileinit is that you need to bind to it before jQuery Mobile executes, so a typical mobileinit workflow would occur in a script that is referenced after jQuery itself, but before jQuery Mobile.

      + +

      It should be noted that while you can bind to other events from within a mobileinit callback, it is likely that you'll get undesirable results in doing so. This is because many events, such as the page events below, are intended for external developers to use after jQuery Mobile's plugins have loaded.

      + +

      Page creation events

      + +

      In a jQuery Mobile application, each view is known as a page. Pages generally begin as a regular HTML element with a data-role="page" attribute, and the framework's page widget enhances that element into a jQuery Mobile page control. In the process of enhancing that page, the widget dispatches several events that allow you to access that page and its child elements at different stages of creation.

      + +

      These events are:

      + +
      +
      pagecreate
      + +
      This event is triggered on a page when it is first initialized by the page plugin. pagecreate is the most useful event for progressively enhancing a page's markup when it first loads, and because of this, many of jQuery Mobile's standard widgets bind to pagecreate to enhance markup within pages as well! If you bind to pagecreate in any script that is referenced after the jQuery Mobile framework, any native jQuery Mobile widgets in that page will be enhanced before your event callback executes. In other words, you'll be dealing with enhanced jQuery Mobile components.
      + +
      pagebeforecreate
      + +
      This event is triggered on a page element just before it is created by the page plugin. While the pagecreate event generally allows you to work with a page after its markup has been enhanced by jQuery Mobile, pagebeforecreate gives you access when the markup has not yet been enhanced. pagebeforecreate is useful for modifying markup before jQuery Mobile's widgets
      + +
      pageinit
      + +
      pageinit is very similar to pagecreate, except that none of jQuery Mobile's standard widgets bind to it, and it is guaranteed to execute after all bound pagecreate callbacks have finished. If you need to bind to a page creation-time event via a script that is referenced before jQuery Mobile, binding to pageinit will ensure that you deal with enhanced page controls (whereas pagecreate will not, in that specific case.)
      + + +
      + + +

      Page navigation events

      +

      After pages are created, they are often shown and hidden one or many times throughout the use of a jQuery Mobile app. For A-grade browsers with Ajax navigation support, the jQM navigation model manages these page behaviors and dispatches useful events at different steps in the process of showing, hiding, and changing.

      + +

      Page showing events

      +

      The page showing events (pagebeforeshow and pageshow) are guaranteed to fire every time a page is shown, whether you're opening a single page, or transitioning between two pages. The target of the event is the page that is being shown.

      + +
      + +
      pagebeforeshow
      +
      An event triggered on a page before it is shown.
      + + +
      pageshow
      +
      An event triggered on the page after it is shown.
      +
      + +

      Page hiding events

      +

      The page hiding events (pagebeforehide and pagehide) only fire when transitioning between two pages, when an outgoing page is being hidden in favor of a new one. The target of the event is the page that is being shown.

      +
      +
      pagebeforehide
      +
      An event triggered on a page before it is hidden.
      + + +
      pagehide
      +
      An event triggered on a page after it is hidden.
      + +
      + + +

      When a single page is being shown, and no page is hidden, only the pagebeforeshow and pageshow events will fire, and in that order.

      + +

      During a transition between two pages, all 4 of the events above will fire, in this order:

      + + + + + + + + +

      Chronology

      + + + + +

      Here is an overview of the event chronology for a page change

      + + + + + + +

      You can bind to these events like you would with other jQuery events, using live() or bind().

      + +
      +

      Important: Use pageInit(), not $(document).ready()

      +

      The first thing you learn in jQuery is to call code inside the $(document).ready() function so everything will execute as soon as the DOM is loaded. However, in jQuery Mobile, Ajax is used to load the contents of each page into the DOM as you navigate, and the DOM ready handler only executes for the first page. To execute code whenever a new page is loaded and created, you can bind to the pageinit event. This event is explained in detail at the bottom of this page.

      + +

       

      +
      +

      Important: pageCreate() vs pageInit()

      +

      Prior to Beta 2 the recommendation to users wishing to manipulate jQuery Mobile enhanced page and child widget markup was to bind to the pagecreate event. In Beta 2 an internal change was made to decouple each of the widgets by binding to the pagecreate event in place of direct calls to the widget methods. As a result, users binding to the pagecreate from within mobileinit would find their binding executing before the markup had been enhanced by each of the plugins. In keeping with the lifecycle of the jQuery UI Widget Factory, the initialization method is invoked after the create method, so the pageinit event provides the correct timing for post enhancement manipulation of the DOM and/or Javascript objects.

      +
      + + + +

      Page load events

      +

      Whenever an external page is loaded into the application DOM, 2 events are fired. The first is pagebeforeload. The 2nd event will be either pageload or pageloadfailed.

      +
      +
      pagebeforeload
      +

      Triggered before any load request is made. Callbacks bound to this event can call preventDefault() on the event to indicate that they are handling the load request. Callbacks that do this *MUST* make sure they call resolve() or reject() on the deferred object reference contained in the data object passed to the callback.

      +

      The data object, passed as the 2nd arg to the callback function contains the following properties:

      +
        +
      • url (string) +
          +
        • The absolute or relative URL that was passed into $.mobile.loadPage() by the caller.
        • +
        +
      • +
      • absUrl (string) +
          +
        • The absolute version of the url. If url was relative, it is resolved against the url used to load the current active page.
        • +
        +
      • +
      • dataUrl (string) +
          +
        • The filtered version of absUrl to be used when identifying the page and updating the browser location when the page is made active.
        • +
        +
      • +
      • deferred (object) +
          +
        • Callbacks that call preventDefault() on the event, *MUST* call resolve() or reject() on this object so that changePage() requests resume processing. Deferred object observers expect the deferred object to be resolved like this:

          +
          
          +$( document ).bind( "pagebeforeload", function( event, data ){
          +
          +	// Let the framework know we're going to handle the load.
          +
          +	event.preventDefault();
          +
          +	// ... load the document then insert it into the DOM ...
          +	// at some point, either in this callback, or through
          +	// some other async means, call resolve, passing in
          +	// the following args, plus a jQuery collection object
          +	// containing the DOM element for the page.
          +
          +	data.deferred.resolve( data.absUrl, data.options, page );
          +
          +});
          +

          or rejected like this: +

          
          +$( document ).bind( "pagebeforeload", function( event, data ){
          +
          +	// Let the framework know we're going to handle the load.
          +
          +	event.preventDefault();
          +
          +	// ... load the document then insert it into the DOM ...
          +	// at some point, if the load fails, either in this
          +	// callback, or through some other async means, call
          +	// reject like this:
          +
          +	data.deferred.reject( data.absUrl, data.options );
          +
          +});
          +
        • +
        +
      • +
      • options (object) +
          +
        • This object contains the options that were passed into $.mobile.loadPage().
        • +
        +
      • +
      +
      +
      pageload
      +
      Triggered after the page is successfully loaded and inserted into the DOM. Callbacks bound to this event will be passed a data object as its 2nd arg. This object contains the following information: +
        +
      • url (string) +
          +
        • The absolute or relative URL that was passed into $.mobile.loadPage() by the caller.
        • +
        +
      • +
      • absUrl (string) +
          +
        • The absolute version of the url. If url was relative, it is resolved against the url used to load the current active page.
        • +
        +
      • +
      • dataUrl (string) +
          +
        • The filtered version of absUrl to be used when identifying the page and updating the browser location when the page is made active.
        • +
        +
      • +
      • options (object) +
          +
        • This object contains the options that were passed into $.mobile.loadPage().
        • +
        +
      • +
      • xhr (object) +
          +
        • The jQuery XMLHttpRequest object used when attempting to load the page. This is what gets passed as the 3rd argument to the framework's $.ajax() success callback.
        • +
        +
      • +
      • textStatus (null or string) +
          +
        • According to the jQuery Core documentation, this will be a string describing the status. This is what gets passed as the 2nd argument to the framework's $.ajax() error callback.
        • +
        +
      • +
      +
      +
      pageloadfailed
      +
      Triggered if the page load request failed. By default, after dispatching this event, the framework will display a page failed message and call reject() on the deferred object contained within the event's data object. Callbacks can prevent this default behavior from executing by calling preventDefault() on the event. +

      The data object, passed as the 2nd arg to the callback function contains the following properties:

      +
        +
      • url (string) +
          +
        • The absolute or relative URL that was passed into $.mobile.loadPage() by the caller.
        • +
        +
      • +
      • absUrl (string) +
          +
        • The absolute version of the url. If url was relative, it is resolved against the url used to load the current active page.
        • +
        +
      • +
      • dataUrl (string) +
          +
        • The filtered version of absUrl to be used when identifying the page and updating the browser location when the page is made active.
        • +
        +
      • +
      • deferred (object) +
          +
        • Callbacks that call preventDefault() on the event, *MUST* call resolve() or reject() on this object so that changePage() requests resume processing. Deferred object observers expect the deferred object to be resolved like this:

          +
          
          +$( document ).bind( "pageloadfailed", function( event, data ){
          +
          +	// Let the framework know we're going to handle things.
          +
          +	event.preventDefault();
          +
          +	// ... attempt to load some other page ...
          +	// at some point, either in this callback, or through
          +	// some other async means, call resolve, passing in
          +	// the following args, plus a jQuery collection object
          +	// containing the DOM element for the page.
          +
          +	data.deferred.resolve( data.absUrl, data.options, page );
          +
          +});
          +

          or rejected like this: +

          
          +$( document ).bind( "pageloadfailed", function( event, data ){
          +
          +	// Let the framework know we're going to handle things.
          +
          +	event.preventDefault();
          +
          +	// ... attempt to load some other page ...
          +	// at some point, if the load fails, either in this
          +	// callback, or through some other async means, call
          +	// reject like this:
          +
          +	data.deferred.reject( data.absUrl, data.options );
          +
          +});
          +
        • +
        +
      • +
      • options (object) +
          +
        • This object contains the options that were passed into $.mobile.loadPage().
        • +
        +
      • +
      • xhr (object) +
          +
        • The jQuery XMLHttpRequest object used when attempting to load the page. This is what gets passed as the first argument to the framework's $.ajax() error callback.
        • +
        +
      • +
      • textStatus (null or string) +
          +
        • According to the jQuery Core documentation, possible values for this property, aside from null, are "timeout", "error", "abort", and "parsererror". This is what gets passed as the 2nd argument to the framework's $.ajax() error callback.
        • +
        +
      • +
      • errorThrown (null, string, object) +
          +
        • According to the jQuery Core documentation, this property may be an exception object if one occured, or if an HTTP error occured this will be set to the textual portion of the HTTP status. This is what gets passed as the 3rd argument to the framework's $.ajax() error callback.
        • +
        +
      • +
      +
      +
      +

      Page change events

      +

      Navigating between pages in the application is usually accomplished through a call to $.mobile.changePage(). This function is responsible for making sure that the page we are navigating to is loaded and inserted into the DOM, and then kicking off the transition animations between the current active page, and the page the caller wants to to make active. During this process, which is usually asynchronous, changePage() will fire off 2 events. The first is pagebeforechange. The second event depends on the success or failure of the change request. It will either be pagechange or pagechangefailed.

      +
      +
      pagebeforechange
      +
      This event is triggered prior to any page loading or transition. Callbacks can prevent execution of the changePage() function by calling preventDefault on the event object passed into the callback. The callback also recieves a data object as its 2nd arg. The data object has the following properties: +
        +
      • toPage (object or string) +
          +
        • This property represents the page the caller wishes to make active. It can be either a jQuery collection object containing the page DOM element, or an absolute/relative url to an internal or external page. The value exactly matches the 1st arg to the changePage() call that triggered the event.
        • +
        +
      • +
      • options (object) +
          +
        • This object contains the configuration options to be used for the current changePage() call.
        • +
        +
      • +
      +

      It should be noted that callbacks can modify both the toPage and options properties to alter the behavior of the current changePage() call. So for example, the toPage can be mapped to a different url from within a callback to do a sort of redirect.

      +
      +
      pagechange
      +
      This event is triggered after the changePage() request has finished loading the page into the DOM and all page transition animations have completed. Note that any pageshow or pagehide events will have fired *BEFORE* this event is triggered. Callbacks for this particular event will be passed a data object as the 2nd arg. The properties for this object are as follows: +
        +
      • toPage (object or string) +
          +
        • This property represents the page the caller wishes to make active. It can be either a jQuery collection object containing the page DOM element, or an absolute/relative url to an internal or external page. The value exactly matches the 1st arg to the changePage() call that triggered the event.
        • +
        +
      • +
      • options (object) +
          +
        • This object contains the configuration options to be used for the current changePage() call.
        • +
        +
      • +
      +
      +
      pagechangefailed
      +
      This event is triggered when the changePage() request fails to load the page. Callbacks for this particular event will be passed a data object as the 2nd arg. The properties for this object are as follows: +
        +
      • toPage (object or string) +
          +
        • This property represents the page the caller wishes to make active. It can be either a jQuery collection object containing the page DOM element, or an absolute/relative url to an internal or external page. The value exactly matches the 1st arg to the changePage() call that triggered the event.
        • +
        +
      • +
      • options (object) +
          +
        • This object contains the configuration options to be used for the current changePage() call.
        • +
        +
      • +
      +
      +
      +

      Page transition events

      +

      Page transitions are used to animate the change from the current active page (fromPage) to a new page (toPage). Events are triggered before and after these transitions so that observers can be notified whenever pages are shown or hidden. The events triggered are as follows:

      +
      +
      pagebeforeshow
      +
      Triggered on the "toPage" we are transitioning to, before the actual transition animation is kicked off. Callbacks for this event will recieve a data object as their 2nd arg. This data object has the following properties on it: +
        +
      • prevPage (object) +
          +
        • A jQuery collection object that contains the page DOM element that we are transitioning away from. Note that this collection is empty when the first page is transitioned in during application startup.
        • +
        +
      • +
      +
      + +
      pagebeforehide
      +
      Triggered on the "fromPage" we are transitioning away from, before the actual transition animation is kicked off. Callbacks for this event will recieve a data object as their 2nd arg. This data object has the following properties on it: +
        +
      • nextPage (object) +
          +
        • A jQuery collection object that contains the page DOM element that we are transitioning to.
        • +
        +
      • +
      +

      Note that this event will not be dispatched during the transition of the first page at application startup since there is no previously active page.

      +
      + +
      pageshow
      +
      Triggered on the "toPage" after the transition animation has completed. Callbacks for this event will recieve a data object as their 2nd arg. This data object has the following properties on it: +
        +
      • prevPage (object) +
          +
        • A jQuery collection object that contains the page DOM element that we just transitioned away from. Note that this collection is empty when the first page is transitioned in during application startup.
        • +
        +
      • +
      +
      + +
      pagehide
      +
      Triggered on the "fromPage" after the transition animation has completed. Callbacks for this event will recieve a data object as their 2nd arg. This data object has the following properties on it: +
        +
      • nextPage (object) +
          +
        • A jQuery collection object that contains the page DOM element that we just transitioned to.
        • +
        +
      • +
      +

      Note that this event will not be dispatched during the transition of the first page at application startup since there is no previously active page.

      +
      + +
      + +

      You can access the prevPage or nextPage properties via the second argument of a bound callback function. For example:

      +
      
      +$( 'div' ).live( 'pageshow',function(event, ui){
      +  alert( 'This page was just hidden: '+ ui.prevPage);
      +});
      +
      +$( 'div' ).live( 'pagehide',function(event, ui){
      +  alert( 'This page was just shown: '+ ui.nextPage);
      +});
      +
      +

      Also, for these handlers to be invoked during the initial page load, you must bind them before jQuery Mobile executes. This can be done in the mobileinit handler, as described on the global config page. +

      Page initialization events

      + +

      Internally, jQuery Mobile auto-initializes plugins based on the markup conventions found in a given "page". For example, an input element with a type of range will automatically generate a custom slider control.

      + +

      This auto-initialization is controlled by the "page" plugin, which dispatches events before and after it executes, allowing you to manipulate a page either pre-or-post initialization, or even provide your own intialization behavior and prevent the auto-initializations from occuring. Note that these events will only fire once per "page", as opposed to the show/hide events, which fire every time a page is shown and hidden.

      + +
      +
      pagebeforecreate
      +
      +

      Triggered on the page being initialized, before most plugin auto-initialization occurs.

      +
      
      +$( '#aboutPage' ).live( 'pagebeforecreate',function(event){
      +  alert( 'This page was just inserted into the dom!' );
      +});
      +
      +

      Note that by binding to pagebeforecreate, you can manipulate markup before jQuery Mobile's default widgets are auto-initialized. For example, say you want to add data-attributes via JavaScript instead of in the HTML source, this is the event you'd use.

      + +
      
      +$( '#aboutPage' ).live( 'pagebeforecreate',function(event){
      +  // manipulate this page before its widgets are auto-initialized
      +});
      +
      +
      + +
      pagecreate
      +
      +

      Triggered when the page has been created in the DOM (via ajax or other) but before all widgets have had an opportunity to enhance the contained markup. This event is most useful for user's wishing to create their own custom widgets for child markup enhancement as the jquery mobile widgets do.

      +
      
      +$( '#aboutPage' ).live( 'pagecreate',function(event){
      +  ( ":jqmData(role='sweet-plugin')" ).sweetPlugin();
      +});
      +
      +
      + +
      pageinit
      +
      +

      Triggered on the page being initialized, after initialization occurs. We recommend binding to this event instead of DOM ready() because this will work regardless of whether the page is loaded directly or if the content is pulled into another page as part of the Ajax navigation system.

      +
      
      +$( '#aboutPage' ).live( 'pageinit',function(event){
      +  alert( 'This page was just enhanced by jQuery Mobile!' );
      +});
      +
      +
      +
      + + + +

      Page remove events

      +

      By default, the framework removes any non active dynamically loaded external pages from the DOM as soon as the user navigates away to a different page. The pageremove event is dispatched just before the framework attempts to remove the a page from the DOM.

      +
      +
      pageremove
      +
      This event is triggered just before the framework attempts to remove an external page from the DOM. Event callbacks can call preventDefault on the event object to prevent the page from being removed. +
      +
      + + +
      + +
      + +
      + +

      More in this section

      + + +
      +
      + +
      + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/api/events.html b/libs/js/jquery-mobile-1.1.0/docs/api/events.html new file mode 100644 index 0000000..b9e2004 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/api/events.html @@ -0,0 +1,514 @@ + + + + + + jQuery Mobile Docs - Events + + + + + + + + + + +
      + +
      +

      Events

      + Home + Search +
      + +
      +
      + +

      jQuery Mobile offers several custom events that build upon native events to create useful hooks for development. Note that these events employ various touch, mouse, and window events, depending on event existence, so you can bind to them for use in both handheld and desktop environments. You can bind to these events like you would with other jQuery events, using live() or bind().

      + +
      +

      Important: Use $(document).bind('pageinit'), not $(document).ready()

      +

      The first thing you learn in jQuery is to call code inside the $(document).ready() function so everything will execute as soon as the DOM is loaded. However, in jQuery Mobile, Ajax is used to load the contents of each page into the DOM as you navigate, and the DOM ready handler only executes for the first page. To execute code whenever a new page is loaded and created, you can bind to the pageinit event. This event is explained in detail at the bottom of this page.

      + +

       

      +
      +

      Important: $(document).bind('pagecreate') vs $(document).bind('pageinit')

      +

      Prior to Beta 2 the recommendation to users wishing to manipulate jQuery Mobile enhanced page and child widget markup was to bind to the pagecreate event. In Beta 2 an internal change was made to decouple each of the widgets by binding to the pagecreate event in place of direct calls to the widget methods. As a result, users binding to the pagecreate in mobileinit would find their binding executing before the markup had been enhanced by each of the plugins. In keeping with the lifecycle of the jQuery UI Widget Factory, the initialization method is invoked after the create method, so the pageinit event provides the correct timing for post enhancement manipulation of the DOM and/or Javascript objects. + + In short, if you were previously using pagecreate to manipulate the enhanced markup before the page was shown, it's very likely you'll want to migrate to 'pageinit'. +

      + +

      Touch events

      +
      +
      tap
      +
      Triggers after a quick, complete touch event.
      + +
      taphold
      +
      Triggers after a held complete touch event (close to one second).
      + +
      swipe
      +

      Triggers when a horizontal drag of 30px or more (and less than 20px vertically) occurs within 1 second duration but these can be configured:

      +
        +
      • scrollSupressionThreshold (default: 10px) – More than this horizontal displacement, and we will suppress scrolling
      • +
      • durationThreshold (default: 1000ms) – More time than this, and it isn’t a swipe
      • +
      • horizontalDistanceThreshold (default: 30px) – Swipe horizontal displacement must be more than this.
      • +
      • verticalDistanceThreshold (default: 75px) – Swipe vertical displacement must be less than this.
      • +
      +
      + +
      swipeleft
      +
      Triggers when a swipe event occurred moving in the left direction.
      + +
      swiperight
      +
      Triggers when a swipe event occurred moving in the right direction.
      +
      + +

      Virtual mouse events

      +

      We provide a set of "virtual" mouse events that attempt to abstract away mouse and touch events. This allows the developer to register listeners for the basic mouse events, such as mousedown, mousemove, mouseup, and click, and the plugin will take care of registering the correct listeners behind the scenes to invoke the listener at the fastest possible time for that device. In touch environments, the plugin retains the order of event firing that is seen in traditional mouse environments, so for example, vmouseup is always dispatched before vmousedown, and vmousedown before vclick, etc. The virtual mouse events also normalize how coordinate information is extracted from the event, so in touch based environments, coordinates are available from the pageX, pageY, screenX, screenY, clientX, and clientY properties, directly on the event object.

      +
      +
      vmouseover
      +
      Normalized event for handling touch or mouseover events
      + +
      vmousedown
      +
      Normalized event for handling touchstart or mousedown events
      + +
      vmousemove
      +
      Normalized event for handling touchmove or mousemove events
      + +
      vmouseup
      +
      Normalized event for handling touchend or mouseup events
      + +
      vclick
      +
      Normalized event for handling touchend or mouse click events. On touch devices, this event is dispatched *AFTER* vmouseup.
      + +
      vmousecancel
      +
      Normalized event for handling touch or mouse mousecancel events
      +
      + +
      +

      Warning: Use vclick with caution

      +

      Use vclick with caution on touch devices. Webkit based browsers synthesize mousedown, mouseup, and click events roughly 300ms after the touchend event is dispatched. The target of the synthesized mouse events are calculated at the time they are dispatched and are based on the location of the touch events and, in some cases, the implementation specific heuristics which leads to different target calculations on different devices and even different OS versions for the same device. This means the target element within the original touch events could be different from the target element within the synthesized mouse events.

      +

      We recommend using click instead of vclick anytime the action being triggered has the possibility of changing the content underneath the point that was touched on screen. This includes page transitions and other behaviors such as collapse/expand that could result in the screen shifting or content being completely replaced.

      +
      +

       

      +
      +

      Canceling an elements default click behavior

      +

      Applications can call preventDefault() on a vclick event to cancel an element's default click behavior. On mouse based devices, calling preventDefault() on a vclick event equates to calling preventDefault() on the real click event during the bubble event phase. On touch based devices, it's a bit more complicated since the actual click event is dispatched about 300ms after the vclick event is dispatched. For touch devices, calling preventDefault() on a vclick event triggers some code in the vmouse plugin that attempts to catch the next click event that gets dispatched by the browser, during the capture event phase, and calls preventDefault() and stopPropagation() on it. As mentioned in the warning above, it is sometimes difficult to match up a touch event with its corresponding mouse event because the targets can differ. For this reason, the vmouse plugin also falls back to attempting to identify a corresponding click event by coordinates. There are still cases where both target and coordinate identification fail, which results in the click event being dispatched and either triggering the default action of the element, or in the case where content has been shifted or replaced, triggering a click on a different element. If this happens on a regular basis for a given element/control, we suggest you use click for triggering your action.

      +
      + +

      Orientation change event

      +
      +
      orientationchange
      +
      Triggers when a device orientation changes (by turning it vertically or horizontally). When bound to this event, your callback function can leverage a second argument, which contains an orientation property equal to either "portrait" or "landscape". These values are also added as classes to the HTML element, allowing you to leverage them in your CSS selectors. Note that we currently bind to the resize event when orientationchange is not natively supported, or when $.mobile.orientationChangeEnabled is set to false.
      +
      +

      orientationchange timing

      + +

      The timing of the orientationchange with relation to the change of the client height and width is different between browsers, though the current implementation will give you the correct value for event.orientation derived from window.orientation. This means that if your bindings are dependent on the height and width values you may want to disable orientationChange all together with $.mobile.orientationChangeEnabled = false to let the fallback resize code trigger your bindings.

      +
      +
      + +

      Scroll events

      +
      +
      scrollstart
      +
      Triggers when a scroll begins. Note that iOS devices freeze DOM manipulation during scroll, queuing them to apply when the scroll finishes. We're currently investigating ways to allow DOM manipulations to apply before a scroll starts.
      +
      +
      +
      scrollstop
      +
      Triggers when a scroll finishes.
      +
      + +

      Page load events

      +

      Whenever an external page is loaded into the application DOM, 2 events are fired. The first is pagebeforeload. The 2nd event will be either pageload or pageloadfailed.

      +
      +
      pagebeforeload
      +

      Triggered before any load request is made. Callbacks bound to this event can call preventDefault() on the event to indicate that they are handling the load request. Callbacks that do this *MUST* make sure they call resolve() or reject() on the deferred object reference contained in the data object passed to the callback.

      +

      The data object, passed as the 2nd arg to the callback function contains the following properties:

      +
        +
      • url (string) +
          +
        • The absolute or relative URL that was passed into $.mobile.loadPage() by the caller.
        • +
        +
      • +
      • absUrl (string) +
          +
        • The absolute version of the url. If url was relative, it is resolved against the url used to load the current active page.
        • +
        +
      • +
      • dataUrl (string) +
          +
        • The filtered version of absUrl to be used when identifying the page and updating the browser location when the page is made active.
        • +
        +
      • +
      • deferred (object) +
          +
        • Callbacks that call preventDefault() on the event, *MUST* call resolve() or reject() on this object so that changePage() requests resume processing. Deferred object observers expect the deferred object to be resolved like this:

          +
          
          +$( document ).bind( "pagebeforeload", function( event, data ){
          +
          +	// Let the framework know we're going to handle the load.
          +
          +	event.preventDefault();
          +
          +	// ... load the document then insert it into the DOM ...
          +	// at some point, either in this callback, or through
          +	// some other async means, call resolve, passing in
          +	// the following args, plus a jQuery collection object
          +	// containing the DOM element for the page.
          +
          +	data.deferred.resolve( data.absUrl, data.options, page );
          +
          +});
          +

          or rejected like this: +

          
          +$( document ).bind( "pagebeforeload", function( event, data ){
          +
          +	// Let the framework know we're going to handle the load.
          +
          +	event.preventDefault();
          +
          +	// ... load the document then insert it into the DOM ...
          +	// at some point, if the load fails, either in this
          +	// callback, or through some other async means, call
          +	// reject like this:
          +
          +	data.deferred.reject( data.absUrl, data.options );
          +
          +});
          +
        • +
        +
      • +
      • options (object) +
          +
        • This object contains the options that were passed into $.mobile.loadPage().
        • +
        +
      • +
      +
      +
      pageload
      +
      Triggered after the page is successfully loaded and inserted into the DOM. Callbacks bound to this event will be passed a data object as its 2nd arg. This object contains the following information: +
        +
      • url (string) +
          +
        • The absolute or relative URL that was passed into $.mobile.loadPage() by the caller.
        • +
        +
      • +
      • absUrl (string) +
          +
        • The absolute version of the url. If url was relative, it is resolved against the url used to load the current active page.
        • +
        +
      • +
      • dataUrl (string) +
          +
        • The filtered version of absUrl to be used when identifying the page and updating the browser location when the page is made active.
        • +
        +
      • +
      • options (object) +
          +
        • This object contains the options that were passed into $.mobile.loadPage().
        • +
        +
      • +
      • xhr (object) +
          +
        • The jQuery XMLHttpRequest object used when attempting to load the page. This is what gets passed as the 3rd argument to the framework's $.ajax() success callback.
        • +
        +
      • +
      • textStatus (null or string) +
          +
        • According to the jQuery Core documentation, this will be a string describing the status. This is what gets passed as the 2nd argument to the framework's $.ajax() error callback.
        • +
        +
      • +
      +
      +
      pageloadfailed
      +
      Triggered if the page load request failed. By default, after dispatching this event, the framework will display a page failed message and call reject() on the deferred object contained within the event's data object. Callbacks can prevent this default behavior from executing by calling preventDefault() on the event. +

      The data object, passed as the 2nd arg to the callback function contains the following properties:

      +
        +
      • url (string) +
          +
        • The absolute or relative URL that was passed into $.mobile.loadPage() by the caller.
        • +
        +
      • +
      • absUrl (string) +
          +
        • The absolute version of the url. If url was relative, it is resolved against the url used to load the current active page.
        • +
        +
      • +
      • dataUrl (string) +
          +
        • The filtered version of absUrl to be used when identifying the page and updating the browser location when the page is made active.
        • +
        +
      • +
      • deferred (object) +
          +
        • Callbacks that call preventDefault() on the event, *MUST* call resolve() or reject() on this object so that changePage() requests resume processing. Deferred object observers expect the deferred object to be resolved like this:

          +
          
          +$( document ).bind( "pageloadfailed", function( event, data ){
          +
          +	// Let the framework know we're going to handle things.
          +
          +	event.preventDefault();
          +
          +	// ... attempt to load some other page ...
          +	// at some point, either in this callback, or through
          +	// some other async means, call resolve, passing in
          +	// the following args, plus a jQuery collection object
          +	// containing the DOM element for the page.
          +
          +	data.deferred.resolve( data.absUrl, data.options, page );
          +
          +});
          +

          or rejected like this: +

          
          +$( document ).bind( "pageloadfailed", function( event, data ){
          +
          +	// Let the framework know we're going to handle things.
          +
          +	event.preventDefault();
          +
          +	// ... attempt to load some other page ...
          +	// at some point, if the load fails, either in this
          +	// callback, or through some other async means, call
          +	// reject like this:
          +
          +	data.deferred.reject( data.absUrl, data.options );
          +
          +});
          +
        • +
        +
      • +
      • options (object) +
          +
        • This object contains the options that were passed into $.mobile.loadPage().
        • +
        +
      • +
      • xhr (object) +
          +
        • The jQuery XMLHttpRequest object used when attempting to load the page. This is what gets passed as the first argument to the framework's $.ajax() error callback.
        • +
        +
      • +
      • textStatus (null or string) +
          +
        • According to the jQuery Core documentation, possible values for this property, aside from null, are "timeout", "error", "abort", and "parsererror". This is what gets passed as the 2nd argument to the framework's $.ajax() error callback.
        • +
        +
      • +
      • errorThrown (null, string, object) +
          +
        • According to the jQuery Core documentation, this property may be an exception object if one occured, or if an HTTP error occured this will be set to the textual portion of the HTTP status. This is what gets passed as the 3rd argument to the framework's $.ajax() error callback.
        • +
        +
      • +
      +
      +
      +

      Page change events

      +

      Navigating between pages in the application is usually accomplished through a call to $.mobile.changePage(). This function is responsible for making sure that the page we are navigating to is loaded and inserted into the DOM, and then kicking off the transition animations between the current active page, and the page the caller wants to to make active. During this process, which is usually asynchronous, changePage() will fire off 2 events. The first is pagebeforechange. The second event depends on the success or failure of the change request. It will either be pagechange or pagechangefailed.

      +
      +
      pagebeforechange
      +
      This event is triggered prior to any page loading or transition. Callbacks can prevent execution of the changePage() function by calling preventDefault on the event object passed into the callback. The callback also recieves a data object as its 2nd arg. The data object has the following properties: +
        +
      • toPage (object or string) +
          +
        • This property represents the page the caller wishes to make active. It can be either a jQuery collection object containing the page DOM element, or an absolute/relative url to an internal or external page. The value exactly matches the 1st arg to the changePage() call that triggered the event.
        • +
        +
      • +
      • options (object) +
          +
        • This object contains the configuration options to be used for the current changePage() call.
        • +
        +
      • +
      +

      It should be noted that callbacks can modify both the toPage and options properties to alter the behavior of the current changePage() call. So for example, the toPage can be mapped to a different url from within a callback to do a sort of redirect.

      +
      +
      pagechange
      +
      This event is triggered after the changePage() request has finished loading the page into the DOM and all page transition animations have completed. Note that any pageshow or pagehide events will have fired *BEFORE* this event is triggered. Callbacks for this particular event will be passed a data object as the 2nd arg. The properties for this object are as follows: +
        +
      • toPage (object or string) +
          +
        • This property represents the page the caller wishes to make active. It can be either a jQuery collection object containing the page DOM element, or an absolute/relative url to an internal or external page. The value exactly matches the 1st arg to the changePage() call that triggered the event.
        • +
        +
      • +
      • options (object) +
          +
        • This object contains the configuration options to be used for the current changePage() call.
        • +
        +
      • +
      +
      +
      pagechangefailed
      +
      This event is triggered when the changePage() request fails to load the page. Callbacks for this particular event will be passed a data object as the 2nd arg. The properties for this object are as follows: +
        +
      • toPage (object or string) +
          +
        • This property represents the page the caller wishes to make active. It can be either a jQuery collection object containing the page DOM element, or an absolute/relative url to an internal or external page. The value exactly matches the 1st arg to the changePage() call that triggered the event.
        • +
        +
      • +
      • options (object) +
          +
        • This object contains the configuration options to be used for the current changePage() call.
        • +
        +
      • +
      +
      +
      +

      Page transition events

      +

      Page transitions are used to animate the change from the current active page (fromPage) to a new page (toPage). Events are triggered before and after these transitions so that observers can be notified whenever pages are shown or hidden. The events triggered are as follows:

      +
      +
      pagebeforeshow
      +
      Triggered on the "toPage" we are transitioning to, before the actual transition animation is kicked off. Callbacks for this event will recieve a data object as their 2nd arg. This data object has the following properties on it: +
        +
      • prevPage (object) +
          +
        • A jQuery collection object that contains the page DOM element that we are transitioning away from. Note that this collection is empty when the first page is transitioned in during application startup.
        • +
        +
      • +
      +
      + +
      pagebeforehide
      +
      Triggered on the "fromPage" we are transitioning away from, before the actual transition animation is kicked off. Callbacks for this event will recieve a data object as their 2nd arg. This data object has the following properties on it: +
        +
      • nextPage (object) +
          +
        • A jQuery collection object that contains the page DOM element that we are transitioning to.
        • +
        +
      • +
      +

      Note that this event will not be dispatched during the transition of the first page at application startup since there is no previously active page.

      +
      + +
      pageshow
      +
      Triggered on the "toPage" after the transition animation has completed. Callbacks for this event will recieve a data object as their 2nd arg. This data object has the following properties on it: +
        +
      • prevPage (object) +
          +
        • A jQuery collection object that contains the page DOM element that we just transitioned away from. Note that this collection is empty when the first page is transitioned in during application startup.
        • +
        +
      • +
      +
      + +
      pagehide
      +
      Triggered on the "fromPage" after the transition animation has completed. Callbacks for this event will recieve a data object as their 2nd arg. This data object has the following properties on it: +
        +
      • nextPage (object) +
          +
        • A jQuery collection object that contains the page DOM element that we just transitioned to.
        • +
        +
      • +
      +

      Note that this event will not be dispatched during the transition of the first page at application startup since there is no previously active page.

      +
      + +
      + +

      You can access the prevPage or nextPage properties via the second argument of a bound callback function. For example:

      +
      
      +$( 'div' ).live( 'pageshow',function(event, ui){
      +  alert( 'This page was just hidden: '+ ui.prevPage);
      +});
      +
      +$( 'div' ).live( 'pagehide',function(event, ui){
      +  alert( 'This page was just shown: '+ ui.nextPage);
      +});
      +
      +

      Also, for these handlers to be invoked during the initial page load, you must bind them before jQuery Mobile executes. This can be done in the mobileinit handler, as described on the global config page. +

      Page initialization events

      + +

      Internally, jQuery Mobile auto-initializes plugins based on the markup conventions found in a given "page". For example, an input element with a type of range will automatically generate a custom slider control.

      + +

      This auto-initialization is controlled by the "page" plugin, which dispatches events before and after it executes, allowing you to manipulate a page either pre-or-post initialization, or even provide your own intialization behavior and prevent the auto-initializations from occuring. Note that these events will only fire once per "page", as opposed to the show/hide events, which fire every time a page is shown and hidden.

      + +
      +
      pagebeforecreate
      +
      +

      Triggered on the page being initialized, before most plugin auto-initialization occurs.

      +
      
      +$( '#aboutPage' ).live( 'pagebeforecreate',function(event){
      +  alert( 'This page was just inserted into the dom!' );
      +});
      +
      +

      Note that by binding to pagebeforecreate, you can manipulate markup before jQuery Mobile's default widgets are auto-initialized. For example, say you want to add data-attributes via JavaScript instead of in the HTML source, this is the event you'd use.

      + +
      
      +$( '#aboutPage' ).live( 'pagebeforecreate',function(event){
      +  // manipulate this page before its widgets are auto-initialized
      +});
      +
      +
      + +
      pagecreate
      +
      +

      Triggered when the page has been created in the DOM (via ajax or other) but before all widgets have had an opportunity to enhance the contained markup. This event is most useful for user's wishing to create their own custom widgets for child markup enhancement as the jquery mobile widgets do.

      +
      
      +$( '#aboutPage' ).live( 'pagecreate',function(event){
      +  ( ":jqmData(role='sweet-plugin')" ).sweetPlugin();
      +});
      +
      +
      + +
      pageinit
      +
      +

      Triggered on the page being initialized, after initialization occurs. We recommend binding to this event instead of DOM ready() because this will work regardless of whether the page is loaded directly or if the content is pulled into another page as part of the Ajax navigation system.

      +
      
      +$( '#aboutPage' ).live( 'pageinit',function(event){
      +  alert( 'This page was just enhanced by jQuery Mobile!' );
      +});
      +
      +
      +
      + + + +

      Page remove events

      +

      By default, the framework removes any non active dynamically loaded external pages from the DOM as soon as the user navigates away to a different page. The pageremove event is dispatched just before the framework attempts to remove the a page from the DOM.

      +
      +
      pageremove
      +
      This event is triggered just before the framework attempts to remove an external page from the DOM. Event callbacks can call preventDefault on the event object to prevent the page from being removed. +
      +
      + +

      Layout events

      +

      Some components within the framework, such as collapsible and listview search, dynamically hide and show content based on user events. This hiding/showing of content affects the size of the page and may result in the browser adjusting/scrolling the viewport to accommodate the new page size. Since this has the potential to affect other components such as fixed headers and footers, components like collapsible and listview trigger a custom updatelayout event to notify other components that they may need to adjust their layouts in response to their content changes. Developers who are building dynamic applications that inject, hide, or remove content from the page, or manipulate it in any way that affects the dimensions of the page, can also manually trigger this updatelayout event to ensure components on the page update in response to the changes.

      +
      +
      updatelayout
      +
      This event is triggered by components within the framework that dynamically show/hide content, and is meant as a generic mechanism to notify other components that they may need to update their size or position. Within the framework, this event is fired on the component element whose content was shown/hidden, and bubbles all the way up to the document element. +
      
      +$( '#foo' ).hide().trigger( 'updatelayout' );
      +
      +
      +
      + +

      Animation Events

      +

      jQuery Mobile exposes the animationComplete plugin, which you can utilize after adding or removing a class that applies a CSS transition.

      + +
      + +
      + +
      + +

      More in this section

      + + +
      +
      + +
      + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/api/globalconfig.html b/libs/js/jquery-mobile-1.1.0/docs/api/globalconfig.html new file mode 100644 index 0000000..b2ce8c4 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/api/globalconfig.html @@ -0,0 +1,181 @@ + + + + + + jQuery Mobile Docs - Configuring default settings + + + + + + + + + + +
      + +
      +

      Configuring Defaults

      + Home + Search +
      + +
      +
      + +

      Working with jQuery Mobile's Auto-initialization

      +

      Unlike other jQuery projects, such as jQuery and jQuery UI, jQuery Mobile automatically applies many markup enhancements as soon as it loads (long before the document.ready event fires). These enhancements are applied based on jQuery Mobile's default settings, which are designed to work with common scenarios. If changes to the settings are needed, they are easy to configure.

      + +

      The mobileinit event

      +

      When jQuery Mobile starts, it triggers a mobileinit event on the document object. To override default settings, bind to mobileinit.

      + +
      +				
      +$(document).bind("mobileinit", function(){
      +  //apply overrides here
      +});
      +				
      +			
      + +

      Because the mobileinit event is triggered immediately, you'll need to bind your event handler before jQuery Mobile is loaded. Link to your JavaScript files in the following order:

      + +
      +				
      +<script src="jquery.js"></script>
      +<script src="custom-scripting.js"></script>
      +<script src="jquery-mobile.js"></script>
      +				
      +			
      + +

      You can override default settings by extending the $.mobile object using jQuery's $.extend method.

      + +
      +				
      +$(document).bind("mobileinit", function(){
      +  $.extend(  $.mobile , {
      +    foo: bar
      +  });
      +});
      +				
      +			
      + +

      Alternatively, you can set them using object property notation.

      +
      +				
      +$(document).bind("mobileinit", function(){
      +  $.mobile.foo = bar;
      +});
      +				
      +			
      + +

      To explore the effects of global configuration options, see the config test pages.

      + +

      Configurable options

      +

      The following defaults are configurable via the $.mobile object:

      + +
      +
      activeBtnClass string, default: "ui-btn-active"
      +
      The CSS class used for "active" button state.
      + +
      activePageClass string, default: "ui-page-active"
      +
      The CSS class used for the page currently in view or in a transition.
      + +
      ajaxEnabled boolean, default: true
      +
      jQuery Mobile will automatically handle link clicks and form submissions through Ajax, when possible. If false, URL hash listening will be disabled as well, and URLs will load as ordinary HTTP requests.
      + +
      allowCrossDomainPages boolean, default: false
      +
      When jQuery Mobile attempts to load an external page, the request runs through $.mobile.loadPage(). This will only allow cross-domain requests if $.mobile.allowCrossDomainPages is set to true. Because the jQuery Mobile framework tracks what page is being viewed within the browser's location hash, it is possible for a cross-site scripting (XSS) attack to occur if the XSS code in question can manipulate the hash and set it to a cross-domain URL of its choice. This is the main reason that the default setting for $.mobile.allowCrossDomainPages is set to false. In PhoneGap apps that must "phone home" by loading assets off a remote server, both the $.support.cors AND $.mobile.allowCrossDomainPages must be set to true.
      + +
      autoInitializePage boolean, default: true
      +
      When the DOM is ready, the framework should automatically call $.mobile.initializePage. If false, the page will not initialize and will be visually hidden until $.mobile.initializePage is manually called.
      + +
      buttonMarkup.hoverDelay integer, default: 200
      +
      Set the delay for touch devices to add the hover and down classes on touch interactions for buttons throughout the framework. Reducing the delay here results in a more responsive feeling ui, but will often result in the downstate being applied during page scrolling.
      + +
      defaultDialogTransition string, default: 'pop'
      +
      Set the default transition for dialog changes that use Ajax. Set to 'none' for no transitions.
      + +
      defaultPageTransition string, default: 'fade'
      +
      Set the default transition for page changes that use Ajax. Note: default changed from 'slide' to 'fade' in 1.1. Set to 'none' for no transitions.
      + +
      gradeA function that returns a boolean, default: a function returning the value of $.support.mediaquery
      +
      Any support conditions that must be met in order to proceed.
      + +
      hashListeningEnabled boolean, default: true
      +
      jQuery Mobile will automatically listen and handle changes to the location.hash. Disabling this will prevent jQuery Mobile from handling hash changes, which allows you to handle them yourself or use simple deep-links within a document that scroll to a particular ID.
      + +
      ignoreContentEnabled boolean, default: false
      +
      Warning: Setting this property to true will cause performance degradation on enhancement. Once set, all automatic enhancements made by the framework to each enhanceable element of the user's markup will first check for a data-enhance=false parent node. If one is found the markup will be ignored. This setting and the accompanying data attribute provide a mechanism through which users can prevent enhancement over large sections of markup.
      + +
      linkBindingEnabled boolean, default: true
      +
      jQuery Mobile will automatically bind the clicks on anchor tags in your document. Setting this options to false will prevent all anchor click handling including the addition of active button state and alternate link bluring. This should only be used when attempting to delegate the click management to another library or custom code.
      + +
      loadingMessage string, default: "loading"
      +
      Set the text that appears when a page is loading. If set to false, the message will not appear at all.
      + +
      loadingMessageTextVisible boolean, default: false
      +
      Whether the text should be visible when a loading message is shown. The text is always visible for loading errors.
      + +
      loadingMessageTheme string, default: "a"
      +
      The theme that the loading message box uses when text is visible.
      + +
      minScrollBack string, default: 250
      +
      Minimum scroll distance that will be remembered when returning to a page.
      + +
      ns string, default: ""
      +
      The namespace used in data- attributes (e.g., data-role). Can be set to any string, including a blank string which is the default. When using, it's clearest if you include a trailing dash, such as "mynamespace-" which maps to data-mynamespace-foo="...". +

      If you use data- namespacing, you will need to update/override one selector in the theme CSS. The following data selectors should incorporate the namespace you're using: +

      
      +.ui-mobile [data-mynamespace-role=page], .ui-mobile [data-mynamespace-role=dialog], .ui-page { ...
      +		
      +

      +
      + +
      pageLoadErrorMessage string, default: "Error Loading Page"
      +
      Set the text that appears when a page fails to load through Ajax.
      + +
      pageLoadErrorMessageTheme string, default: "e"
      +
      Set the theme that the error message box uses.
      + +
      pushStateEnabled boolean, default: true
      +
      Enhancement to use history.replaceState in supported browsers, to convert the hash-based Ajax URL into the full document path. Note that we recommend disabling this feature if Ajax is disabled or if extensive use of external links are used.
      + +
      subPageUrlKey string, default: "ui-page"
      +
      The url parameter used for referencing widget-generated sub-pages (such as those generated by nested listviews). Translates to example.html&ui-page=subpageIdentifier. The hash segment before &ui-page= is used by the framework for making an Ajax request to the URL where the sub-page exists.
      + +
      touchOverflowEnabled boolean, default: false
      +
      Enable smoother page transitions and true fixed toolbars in devices that support both the overflow: and overflow-scrolling: touch; CSS properties. Note: Deprecated for 1.1.0.
      + +
      +
      + +
      + +
      + +

      More in this section

      + + +
      +
      + +
      + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/api/index.html b/libs/js/jquery-mobile-1.1.0/docs/api/index.html new file mode 100644 index 0000000..95573ab --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/api/index.html @@ -0,0 +1,40 @@ + + + + + + jQuery UI Mobile Framework - API + + + + + + + + + + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/api/mediahelpers.html b/libs/js/jquery-mobile-1.1.0/docs/api/mediahelpers.html new file mode 100644 index 0000000..abd2c15 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/api/mediahelpers.html @@ -0,0 +1,133 @@ + + + + + + jQuery Mobile Docs - Responsive Layout Helpers + + + + + + + + + + +
      + +
      +

      Responsive Layout Helpers

      + Home + Search +
      + +
      + +
      +

      Media Query Helper Classes

      +

      Note: This feature was deprecated in beta, and removed in 1.0rc1. We recommend using CSS3 Media Queries instead. To support older versions of Internet Explorer, check out respond.js, a fast & lightweight polyfill for min/max-width CSS3 Media Queries.

      +

      If you still need this feature, you can find the code here: jquery.mobile.media.classes.js

      + +

      jQuery Mobile adds classes to the HTML element that mimic browser orientation and common min/max-width CSS media queries. These classes are updated on load, resize and orientationchange, allowing you to key off these classes in your CSS, to create responsive layouts - even in browsers that don't support media queries!

      + +

      Orientation Classes

      + +

      The HTML element will always have a class of either "portrait" or "landscape", depending on the orientation of the browser or device. You can utilize these in your CSS like this:

      +
      +			
      +.portrait {
      +	/* portrait orientation changes go here! */
      +}
      +.landscape {
      +	/* landscape orientation changes go here! */
      +}			
      +			
      +			
      + +

      Min/Max Width Breakpoint Classes

      +

      By default, we create min and max breakpoint classes at the following widths: 320,480,768,1024. These translate to classes that look like this: "min-width-320px", "max-width-480px", and are meant to be used as a replacement of (or in addition to) the media query equivalents they mimic.

      +
      +			
      +.myelement { 
      +	float: none;
      +}			
      +.min-width-480px .myelement {
      +	float: left;
      +}		
      +			
      +
      + +

      Many plugins in jQuery Mobile leverage these width breakpoints. For example, form elements float beside their labels when the browser is wider than 480 pixels. The CSS to support this behavior for form text inputs looks like this:

      + +
      +			
      +label.ui-input-text { 
      +	display: block; 
      +}
      +.min-width-480px label.ui-input-text { 
      +	display: inline-block; 
      +}
      +			
      +
      + +

      Adding Width Breakpoints

      +

      To utilize width breakpoints of your own, jQuery Mobile exposes the $.mobile.addResolutionBreakpoints function, which accepts either a single number or array of numbers that will be added to the min/max breakpoints whenever they apply.

      +
      +			
      +//add a min/max class for 1200 pixel widths			
      +$.mobile.addResolutionBreakpoints(1200);
      +
      +//add min/max classes for 1200, and 1440 pixel widths			
      +$.mobile.addResolutionBreakpoints([1200, 1440]);
      +			
      +
      + +

      Running Media Queries

      +

      jQuery Mobile provides a function that allows you to test whether a particular CSS Media Query applies. Simple call $.mobile.media() and pass a media type or query. If the browser supports that type or query, and it currently applies, the function will return true. If not, it'll return false.

      + +
      +			
      +//test for screen media type
      +$.mobile.media("screen");
      +
      +//test  a min-width media query
      +$.mobile.media("screen and (min-width: 480px)");
      +
      +//test for iOS retina display
      +$.mobile.media("screen and (-webkit-min-device-pixel-ratio: 2)");
      +
      +			
      +
      + +
      + + + +
      + + + +
      + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/api/methods.html b/libs/js/jquery-mobile-1.1.0/docs/api/methods.html new file mode 100644 index 0000000..363f3bc --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/api/methods.html @@ -0,0 +1,597 @@ + + + + + + jQuery Mobile Docs - Methods + + + + + + + + + + +
      + +
      +

      Methods

      + Home + Search +
      + +
      +
      + +

      jQuery Mobile exposes several methods and properties on the $.mobile object for use in your applications.

      + + +
      +
      $.mobile.changePage (method)
      +
      Programmatically change from one page to another. This method is used internally for the page loading and transitioning that occurs as a result of clicking a link or submitting a form, when those features are enabled.
      + +
      + +
      +
      · Arguments
      +
      to (string or object, required) +
        +
      • String: Absolute or relative URL. ("about/us.html")
      • +
      • Object: jQuery collection object. ($("#about"))
      • +
      +
      + +
      options (object, optional) +
        +
      • Properties: +
          +
        • allowSamePageTransition (boolean, default: false) By default, changePage() ignores requests to change to the current active page. Setting this option to true, allows the request to execute. Developers should note that some of the page transitions assume that the fromPage and toPage of a changePage request are different, so they may not animate as expected. Developers are responsible for either providing a proper transition, or turning it off for this specific case.
        • +
        • changeHash (boolean, default: true) Decides if the hash in the location bar should be updated.
        • +
        • data (object or string, default: undefined) The data to send with an Ajax page request. +
            +
          • Used only when the 'to' argument of changePage() is a URL.
          • +
          +
        • +
        • dataUrl (string, default: undefined) The URL to use when updating the browser location upon changePage completion. + If not specified, the value of the data-url attribute of the page element is used.
        • +
        • pageContainer (jQuery collection, default: $.mobile.pageContainer) Specifies the element that should contain the page.
        • +
        • reloadPage (boolean, default: false) Forces a reload of a page, even if it is already in the DOM of the page container. +
            +
          • Used only when the 'to' argument of changePage() is a URL.
          • +
          +
        • +
        • reverse (boolean, default: false) Decides what direction the transition will run when showing the page.
        • +
        • showLoadMsg (boolean, default: true) Decides whether or not to show the loading message when loading external pages.
        • +
        • role (string, default: undefined) The data-role value to be used when displaying the page. By default this is undefined which means rely on the value of the @data-role attribute defined on the element.
        • +
        • transition (string, default: $.mobile.defaultPageTransition) The transition to use when showing the page.
        • +
        • type (string, default: "get") Specifies the method ("get" or "post") to use when making a page request. +
            +
          • Used only when the 'to' argument of changePage() is a URL.
          • +
          +
        • +
        +
      • +
      +
      + +
      +
      + +
      Examples: +
      +			
      +//transition to the "about us" page with a slideup transition
      +$.mobile.changePage( "about/us.html", { transition: "slideup"} );
      +
      +//transition to the "search results" page, using data from a form with an ID of "search"" 	
      +$.mobile.changePage( "searchresults.php", {
      +	type: "post",
      +	data: $("form#search").serialize()
      +});
      +
      +//transition to the "confirm" page with a "pop" transition without tracking it in history	
      +$.mobile.changePage( "../alerts/confirm.html", {
      +	transition: "pop",
      +	reverse: false,
      +	changeHash: false
      +});
      +
      +			
      +			
      + +
      + + +
      $.mobile.loadPage (method)
      +
      Load an external page, enhance its content, and insert it into the DOM. This method is called internally by the changePage() function when its first argument is a URL. This function does not affect the current active page so it can be used to load pages in the background. The function returns a deferred promise object that gets resolved after the page has been enhanced and inserted into the document.
      + +
      + +
      +
      · Arguments
      +
      url (string or object, required) A relative or absolute URL.
      + +
      options (object, optional) +
        +
      • Properties: +
          +
        • data (object or string, default: undefined) The data to send with an Ajax page request.
        • +
        • loadMsgDelay (number (in ms), default: 50) Forced delay before the loading message is shown. This is meant to allow time for a page that has already been visited to be fetched from cache without a loading message.
        • +
        • pageContainer (jQuery collection, default: $.mobile.pageContainer) Specifies the element that should contain the page after it is loaded.
        • +
        • reloadPage (boolean, default: false) Forces a reload of a page, even if it is already in the DOM of the page container.
        • +
        • role (string, default: undefined) The data-role value to be used when displaying the page. By default this is undefined which means rely on the value of the @data-role attribute defined on the element.
        • +
        • type (string, default: "get") Specifies the method ("get" or "post") to use when making a page request. +
        • +
        +
      • +
      +
      + +
      +
      + +
      Examples: +
      +			
      +//load the "about us" page into the DOM
      +$.mobile.loadPage( "about/us.html" );
      +
      +//load a "search results" page, using data from a form with an ID of "search"" 	
      +$.mobile.loadPage( "searchresults.php", {
      +	type: "post",
      +	data: $("form#search").serialize()
      +});
      +			
      +			
      + +
      + +
      $.fn.jqmData(), $.fn.jqmRemoveData() (method)
      +
      When working with jQuery Mobile, jqmData and jqmRemoveData should be used in place of jQuery core's data and removeData methods (note that this includes $.fn.data, $.fn.removeData, and the $.data, $.removeData, and $.hasData utilities), as they automatically incorporate getting and setting of namespaced data attributes (even if no namespace is currently in use).
      +
      +
      +
      · Arguments:
      +
      See jQuery's data and removeData methods
      + Note: Calling jqmData() with no argument will return undefined. This behavior is subject to change in future versions. +
      · Also:
      +
      When finding elements by their jQuery Mobile data attribute, please use the custom selector :jqmData(), as it automatically incorporates namespaced data attributes into the lookup when they are in use. For example, instead of calling $("div[data-role='page']"), you should use $("div:jqmData(role='page')"), which internally maps to $("div[data-"+ $.mobile.ns +"role='page']") without forcing you to concatenate a namespace into your selectors manually.
      +
      +
      + + +
      $.fn.jqmEnhanceable() (method)
      +
      For users that wish to respect data-enhance=false parent elements during manual enhancement or custom plugin authoring jQuery Mobile provides the $.fn.jqmEnhanceable filter method.
      +
      +
      +
      · Settings:
      +
      If, and only if, $.mobile.ignoreContentEnabled is set to true, this method will traverse the parent nodes for each DOM element in the jQuery object and where it finds a data-enhance=false parent the child will be removed from the set.
      +
      · Warning:
      +
      The operation of traversing all parent elements can be expensive for even small jQuery object sets.
      +
      +
      + +
      $.fn.jqmHijackable() (method)
      +
      For users that wish to respect data-ajax=false parent elements during custom form and link binding jQuery Mobile provides the $.fn.jqmHijackable filter method.
      +
      +
      +
      · Settings:
      +
      If, and only if, $.mobile.ignoreContentEnabled is set to true, this method will traverse the parent nodes for each DOM element in the jQuery object and where it finds a data-ajax=false parent the child form or link will be removed from the set.
      +
      · Warning:
      +
      The operation of traversing all parent elements can be expensive for even small jQuery object sets.
      +
      +
      + +
      $.mobile.showPageLoadingMsg (method)
      +
      Show the page loading message, which is configurable via $.mobile.loadingMessage.
      +
      +
      +
      · Arguments
      +
      theme (string, default: "a") The theme swatch for the message.
      +
      msgText (string, default: "loading") The text of the message.
      +
      textonly (boolean, default: false) If true, the "spinner" image will be hidden when the message is shown.
      +
      +
      +
      Examples: +
      +			
      +//cue the page loader
      +$.mobile.showPageLoadingMsg();
      +
      +//use theme swatch "b", a custom message, and no spinner
      +$.mobile.showPageLoadingMsg("b", "This is only a test", true);
      +			
      +			
      + +
      + + + + +
      $.mobile.hidePageLoadingMsg (method)
      +
      Hide the page loading message, which is configurable via $.mobile.loadingMessage.
      + +
      Example: +
      +			
      +//hide the page loader
      +$.mobile.hidePageLoadingMsg();
      +			
      +			
      + +
      + +
      $.mobile.fixedToolbars.show (method)
      +
      Utility method for displaying the fixed header and/or footer of the current active page within the viewport. Note that fixed headers/footers are never really hidden. Toggling the show/hide state of a toolbar is really toggling whether or not they are inline within the page content, or displayed within the viewport as if they were fixed.
      +
      +
      +
      · Arguments
      +
      immediately (boolean, optional) If true, any fixed header or footer for the current active page is displayed immediately within the viewport. If false or unspecified, the fixed header/footer will fade-in after a 100 millisecond delay. Note that other events such as a document resize or scroll event can result in an additional delay before the start of the header/footer display animation.
      +
      +
      +
      Example: +
      +			
      +// Show fixed header/footer with a fade animation.
      +$.mobile.fixedToolbars.show();
      +
      +// Show fixed header/footer immediately.
      +$.mobile.fixedToolbars.show(true);
      +			
      +			
      + +
      + +
      $.mobile.fixedToolbars.hide (method)
      +
      Utility method for hiding the fixed header and/or footer of the current active page.
      +
      +
      +
      · Arguments
      +
      immediately (boolean, optional) If true, any fixed header or footer for the current active page is immediately placed inline (back in flow) with the page content, which means it will scroll along with the content and will only be visible when viewing the top or bottom of the page within the viewport. If false or unspecified, the fixed header/footer will fade-out after a 100 millisecond delay. Note that other events such as a document resize or scroll event can result in the header/footer being immediately hidden.
      +
      +
      +
      Example: +
      +			
      +// Hide fixed header/footer with a fade animation.
      +$.mobile.fixedToolbars.hide();
      +
      +// Hide fixed header/footer immediately.
      +$.mobile.fixedToolbars.hide(true);
      +			
      +			
      + +
      + +
      $.mobile.path.parseUrl (method)
      +
      Utility method for parsing a URL and its relative variants into an object that makes accessing the components of the URL easy. When parsing relative variants, the resulting object will contain empty string values for missing components (like protocol, host, etc). Also, when parsing URLs that have no authority, such as tel: urls, the pathname property of the object will contain the data after the protocol/scheme colon.
      + +
      + +
      +
      · Arguments
      +
      url (string, required) A relative or absolute URL.
      + +
      · Return Value
      +
      +

      This function returns an object that contains the various components of the URL as strings. The properties on the object mimic the browser's location object:

      +
      +
      hash
      +
      The fragment conponent of the URL, including the leading '#' character.
      +
      host
      +
      The host and port number of the URL.
      +
      hostname
      +
      The name of the host within the URL.
      +
      href
      +
      The original URL that was parsed.
      +
      pathname
      +
      The path of the file or directory referenced by the URL.
      +
      port
      +
      The port specified within the URL. Most URLs rely on the default port for the protocol used, so this may be an empty string most of the time.
      +
      protocol
      +
      The protocol for the URL including the trailing ':' character.
      +
      search
      +
      The query component of the URL including the leading '?' character.
      +
      +

      But it also contains additional properties that provide access to additional components as well as some common forms of the URL developers access:

      +
      +
      authority
      +
      The username, password, and host components of the URL
      +
      directory
      +
      The directory component of the pathname, minus any filename.
      +
      domain
      +
      The protocol and authority components of the URL.
      +
      filename
      +
      The filename within the pathname component, minus the directory.
      +
      hrefNoHash
      +
      The original URL minus the fragment (hash) components.
      +
      hrefNoSearch
      +
      The original URL minus the query (search) and fragment (hash) components.
      +
      password
      +
      The password contained within the authority component.
      +
      username
      +
      The username contained within the authority component.
      +
      +
      + +
      +
      + +
      Examples: +
      +			
      +// Parsing the Url below results an object that is returned with the
      +// following properties:
      +//
      +//  obj.href:         http://jblas:password@mycompany.com:8080/mail/inbox?msg=1234&type=unread#msg-content
      +//  obj.hrefNoHash:   http://jblas:password@mycompany.com:8080/mail/inbox?msg=1234&type=unread
      +//  obj.hrefNoSearch: http://jblas:password@mycompany.com:8080/mail/inbox
      +//  obj.domain:       http://jblas:password@mycompany.com:8080
      +//  obj.protocol:     http:
      +//  obj.authority:    jblas:password@mycompany.com:8080
      +//  obj.username:     jblas
      +//  obj.password:     password
      +//  obj.host:         mycompany.com:8080
      +//  obj.hostname:     mycompany.com
      +//  obj.port:         8080
      +//  obj.pathname:     /mail/inbox
      +//  obj.directory:    /mail/
      +//  obj.filename:     inbox
      +//  obj.search:       ?msg=1234&type=unread
      +//  obj.hash:         #msg-content
      +
      +var obj = $.mobile.path.parseUrl("http://jblas:password@mycompany.com:8080/mail/inbox?msg=1234");
      +			
      +			
      + +
      + + +
      $.mobile.path.makePathAbsolute (method)
      +
      Utility method for converting a relative file or directory path into an absolute path.
      +
      +
      +
      · Arguments
      +
      relPath (string, required) A relative file or directory path.
      +
      absPath (string, required) An absolute file or relative path to resolve against.
      + +
      · Return Value
      +
      This function returns a string that is an absolute version of the relative path passed in.
      + +
      +
      +
      Examples: +
      +			
      +// Returns: /a/b/c/file.html
      +var absPath = $.mobile.path.makePathAbsolute("file.html", "/a/b/c/bar.html");
      +
      +// Returns: /a/foo/file.html
      +var absPath = $.mobile.path.makePathAbsolute("../../foo/file.html", "/a/b/c/bar.html");
      +
      +			
      +			
      +
      + + +
      $.mobile.path.makeUrlAbsolute (method)
      +
      Utility method for converting a relative URL to an absolute URL.
      +
      + +
      +
      Arguments
      +
      relUrl (string, required) A relative URL.
      +
      absUrl (string, required) An absolute URL to resolve against.
      + +
      Return Value
      +
      This function returns a string that is an absolute version of the relative URL passed in.
      + +
      +
      +
      Examples: +
      +			
      +// Returns: http://foo.com/a/b/c/file.html
      +var absUrl = $.mobile.path.makeUrlAbsolute("file.html", "http://foo.com/a/b/c/test.html");
      +
      +// Returns: http://foo.com/a/foo/file.html
      +var absUrl = $.mobile.path.makeUrlAbsolute("../../foo/file.html", "http://foo.com/a/b/c/test.html");
      +
      +// Returns: http://foo.com/bar/file.html
      +var absUrl = $.mobile.path.makeUrlAbsolute("//foo.com/bar/file.html", "http://foo.com/a/b/c/test.html");
      +
      +// Returns: http://foo.com/a/b/c/test.html?a=1&b=2
      +var absUrl = $.mobile.path.makeUrlAbsolute("?a=1&b=2", "http://foo.com/a/b/c/test.html");
      +
      +// Returns: http://foo.com/a/b/c/test.html#bar
      +var absUrl = $.mobile.path.makeUrlAbsolute("#bar", "http://foo.com/a/b/c/test.html");
      +
      +			
      +			
      + +
      + + +
      $.mobile.path.isSameDomain (method)
      +
      Utility method for comparing the domain of 2 URLs.
      +
      + +
      +
      · Arguments
      +
      url1 (string, required) A relative URL.
      +
      url2 (string, required) An absolute URL to resolve against.
      + +
      Return Value
      +
      This function returns a boolean true if the domains match, false if they don't.
      + +
      +
      +
      Examples: +
      +			
      +// Returns: true
      +var same = $.mobile.path.isSameDomain("http://foo.com/a/file.html", "http://foo.com/a/b/c/test.html");
      +
      +// Returns: false
      +var same = $.mobile.path.isSameDomain("file://foo.com/a/file.html", "http://foo.com/a/b/c/test.html");
      +
      +// Returns: false
      +var same = $.mobile.path.isSameDomain("https://foo.com/a/file.html", "http://foo.com/a/b/c/test.html");
      +
      +// Returns: false
      +var same = $.mobile.path.isSameDomain("http://foo.com/a/file.html", "http://bar.com/a/b/c/test.html");
      +
      +			
      +			
      + +
      + + +
      $.mobile.path.isRelativeUrl (method)
      +
      Utility method for determining if a URL is a relative variant.
      +
      + +
      +
      · Arguments
      +
      url (string, required) A relative or absolute URL.
      + +
      · Return Value
      +
      This function returns a boolean true if the URL is relative, false if it is absolute.
      + +
      +
      +
      Examples: +
      +			
      +// Returns: false
      +var isRel = $.mobile.path.isRelativeUrl("http://foo.com/a/file.html");
      +
      +// Returns: true
      +var isRel = $.mobile.path.isRelativeUrl("//foo.com/a/file.html");
      +
      +// Returns: true
      +var isRel = $.mobile.path.isRelativeUrl("/a/file.html");
      +
      +// Returns: true
      +var isRel = $.mobile.path.isRelativeUrl("file.html");
      +
      +// Returns: true
      +var isRel = $.mobile.path.isRelativeUrl("?a=1&b=2");
      +
      +// Returns: true
      +var isRel = $.mobile.path.isRelativeUrl("#foo");
      +
      +
      +			
      +			
      + +
      + + +
      $.mobile.path.isAbsoluteUrl (method)
      +
      Utility method for determining if a URL is absolute.
      +
      + +
      +
      · Arguments
      +
      url (string, required) A relative or absolute URL.
      + +
      · Return Value
      +
      This function returns a boolean true if the URL is absolute, false if not.
      + +
      +
      +
      Examples: +
      +			
      +// Returns: true
      +var isAbs = $.mobile.path.isAbsoluteUrl("http://foo.com/a/file.html");
      +
      +// Returns: false
      +var isAbs = $.mobile.path.isAbsoluteUrl("//foo.com/a/file.html");
      +
      +// Returns: false
      +var isAbs = $.mobile.path.isAbsoluteUrl("/a/file.html");
      +
      +// Returns: false
      +var isAbs = $.mobile.path.isAbsoluteUrl("file.html");
      +
      +// Returns: false
      +var isAbs = $.mobile.path.isAbsoluteUrl("?a=1&b=2");
      +
      +// Returns: false
      +var isAbs = $.mobile.path.isAbsoluteUrl("#foo");
      +
      +
      +			
      +			
      + +
      + + +
      $.mobile.base (methods, properties)
      +
      Utilities for working with generated base element. TODO: document as public API is finalized.
      + + + +
      $.mobile.silentScroll (method)
      +
      Scroll to a particular Y position without triggering scroll event listeners.
      +
      +
      +
      · Arguments:
      +
      yPos (number, defaults to 0). Pass any number to scroll to that Y location.
      +
      +
      + +
      Examples: +
      +			
      +//scroll to Y 100px
      +$.mobile.silentScroll(100);
      +			
      +			
      + +
      + + + + + +
      $.mobile.activePage (property)
      +
      Reference to the page currently in view.
      + + + + +
      +
      + +
      + +
      + +

      More in this section

      + + +
      +
      + +
      + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/api/themes.html b/libs/js/jquery-mobile-1.1.0/docs/api/themes.html new file mode 100644 index 0000000..6224fab --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/api/themes.html @@ -0,0 +1,291 @@ + + + + + + jQuery Mobile Framework - Static Containers, States + + + + + + + + + + +
      + +
      +

      Themes

      + Home + Search +
      + +
      + +
      +

      Theming overview

      + +

      The theming system used in jQuery Mobile is similar to the ThemeRoller system in jQuery UI with a few important improvements:

      + +
        +
      • It takes advantage of CSS3 properties to add rounded corners, box and text shadow and gradients instead of images, allowing the theme file to be very lightweight and reducing server requests.
      • +
      • Themes include multiple color "swatches" — each consisting of a header bar, content body, and button states that can be freely mixed and matched to create visual texture — to make richer designs possible.
      • +
      • Open-ended theming allows for up to 26 unique swatches per theme, to add almost unlimited variety to designs.
      • +
      • All backgrounds now use CSS3 gradients to dramatically reduce file size and number of server requests.
      • +
      • There is a simplified icon set in a sprite to reduce image weight.
      • +
      + +

      ThemeRoller

      + Themroller Mobile Logo + The easiest way to create custom themes is with the ThemeRoller tool. It allows you to build a theme, then download a custom CSS file, ready to be dropped into your project. + +

      Themes & swatches

      + +

      The theme system separates color and texture from structural styles that define things like padding and dimensions. This allows theme colors and textures to be defined once in the stylesheet and to be mixed, matched, and combined to achieve a wide range of visual effects.

      + +

      Each theme includes several global settings, including font family, drop shadows for overlays, and corner radius values for buttons and boxes. In addition, the theme can include multiple color swatches, each with color values for bars, content blocks, buttons and list items, and font text-shadow.

      + +

      The default theme includes 5 swatches that are given letters (a, b, c, d, e) for quick reference. To make mapping of color swatches consistent across our widgets, we have followed the convention that swatch "a" is the highest level of visual priority (black in our default theme), "b" is secondary level (blue) and "c" is the baseline level (gray) that we use by default in many situations, "d" for an alternate secondary level and "e" as an accent swatch. Themes may have additional swatches for accent colors or specific situations. For example, you could add a new theme swatch "f" that has a red bar and button for use in error situations.

      + +

      Most theme changes can be done using ThemeRoller, but it's also simple to manually edit the base swatches in the default theme and/or add additional swatches by editing the theme CSS file. Just copy a block of swatch styles, rename the classes with the new swatch letter name, and tweak colors as you see fit.

      + + +

      Bars

      +

      The default theme contains the following five bar styles:

      + +
      +
      Bar A - Link
      +
      Bar B - Link
      +
      Bar C - Link
      +
      Bar D - Link
      +
      Bar E - Link
      +
      + +

      By default, the framework assigns the "a" swatch to all headers and footers, because these are typically given high visual priority in an application. To set the color of a bar to a different swatch color, simply add the data-theme attribute to your header or footer and specify an alternate swatch letter ('b' or 'd', for example) and the specified theme swatch color will be applied. Learn more about toolbar theming.

      + + + +

      Content Blocks

      +

      The default theme also includes color swatch values for use in content blocks, designed to coordinate with the header color swatches in the theme.

      + +
      +
      Block A - Link
      +
      Block B - Link
      +
      Block C - Link
      +
      Block D - Link
      +
      Block E - Link
      +
      + + +

      If a theme isn't specified on a content block, the framework will default to "c" to maximize contrast against the default header "a", as shown here:

      + +
      + Back +

      Default Header

      +
      +
      +

      Default Theme Content Header

      +

      This is the default content color swatch and a preview of a link.

      + + +
      + Cache settings: + + + + +
      + Button +
      + + + +

      Learn more about content theming.

      + + +

      Lists & Buttons

      +

      Each swatch also includes default styles for interactive elements like list items and buttons.

      + + + + + + + + + + + +

      A button is included for each swatch in the theme. Each button has styles for normal, hover/focus and pressed states.

      + + + + +

      By default, any button that's placed in a bar is automatically assigned a swatch letter that matches its parent bar or content box. Thus, the button is visually integrated into the parent theme as shown here:

      + +
      + + + + + +
      + +

      This default behavior makes it easy to ripple a theme change through a page by setting a theme swatch on a parent because you know the buttons will maintain the same relative visual weight across themes. Since form elements use the button styles, they will also adapt to their parent container.

      + +

      If you want to add visual emphasis to a button, an alternate swatch color can be set by adding a data-theme="a" to the anchor. Once an alternate swatch color is set on a button in the markup, the framework won't override that color if the parent theme is changed, because you made a conscious decision to set it.

      + +
      +
      +
      + A + B + C + D + E +
      +
      +
      +
      + A + B + C + D + E +
      +
      +
      +
      + A + B + C + D + E +
      +
      +
      +
      + A + B + C + D + E +
      +
      +
      +
      + A + B + C + D + E +
      +
      + +
      + +

      Learn more about list theming and button theming.

      + +

      Global "Active" state

      +

      The jQuery Mobile framework uses a swatch called "active" (bright blue in the default theme) to consistently indicate the selected state, regardless of the individual swatch of the given widget. We apply this in navigation and form controls whenever there is a need to indicate what is currently selected. Because this theme swatch is designed for clear, consistent user feedback, it cannot be overridden via the markup; it is set once in the theme and applied by the framework whenever a selected or active state is needed. The styling for this state is in the theme stylesheet under the ui-btn-active style rules.

      + +
      + Active is used for the on state of these toggles: + + + + +
      + + +

      Icons

      +

      There is a core set of standard icons included in the framework that can be assigned to any button. To minimize the download size of the core icons, jQuery Mobile only includes these icons in white and automatically adds a semi-transparent black circle behind the icon to make sure it has good contrast on all background colors.

      + +

      Theme classes

      +

      Assigning color swatches through the data-theme attribute is one way to leverage the theme system, but it's also possible to apply any of the theme swatches directly to your markup through classes to apply the colors, textures and font formatting of your theme to any markup. This is especially useful when creating your own custom layout elements or UI widgets. Here are a few common theme classes, but many more are available in the theme stylesheet:

      +
      +
      ui-bar-(a-z)
      +
      Applies the toolbar theme styles for the selected swatch letter. Commonly used in conjunction with ui-bar structural class to add the standard bar padding styles.
      +
      ui-body-(a-z)
      +
      Applies the content body theme styles for the selected swatch letter. Commonly used in conjunction with ui-body structural class to add the standard content block padding styles.
      +
      ui-btn-up-(a-z)
      +
      Applies the button/clickable element theme styles for the selected swatch letter. Commonly used in with the ui-btn-hover-(a-z) and ui-btn-down-(a-z) interaction class states to provide visual feedback and ui-btn-active to indicate the selected or "on" state.
      +
      ui-corner-all
      +
      Applies the theme's global border-radius for rounded corners and is used for container or grouped items in the framework (inset lists, radiobutton sets). There are additional classes for all the possible combinations of rounded corners, for example: ui-corner-tl (top left only), -top (both top corners), -left (both left corners), etc. A second full set of corner classes is provided for buttons so these can have a different corner radius. These use classes with a similar naming convention, but with "btn-corner" instead of "corner", like this: .ui-btn-corner-all.
      +
      ui-shadow
      +
      Applies the theme's global drop shadow to any element using CSS box-shadow property.
      +
      ui-disabled
      +
      Applies the disabled look and feel which essentially reduces the opacity of any element with this class to 30%, hides the cursor, and sets pointer-events: none; which prevents any interaction in many modern browsers.
      +
      + +

      Overriding themes

      +

      The themes are meant as a solid starting point, but are meant to be customized. Since everything is controlled by CSS, it's easy to use a web inspector tool to identify the style properties you want to modify. The set of of theme classes (global) and semantic structural classes (widget-specific) added to elements provide a rich set of possible selectors to target style overrides against. We recommend adding an external stylesheet to the head, placed after the structure and theme stylesheet references, that contain all your style overrides. This allows you to easily update to newer versions of the library because overrides are kept separate from the library code.

      + + +

      Learn more about theming individual components:

      + +
      + +
      + +
      + +

      More in this section

      + + +
      +
      + +
      + + + +
      + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/buttons/api-buttons.html b/libs/js/jquery-mobile-1.1.0/docs/buttons/api-buttons.html new file mode 100644 index 0000000..d2d0cb2 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/buttons/api-buttons.html @@ -0,0 +1,45 @@ + + + + + + jQuery Mobile Docs - Buttons + + + + + + + + + + +
      + +
      +

      Button API

      + Home + Search +
      + +
      + +

      Dependencies

      +

      To be documented

      + +

      Options

      +

      To be documented

      + +

      Methods

      +

      To be documented

      + +

      Known Issues

      +

      To be documented

      + + + +
      +
      + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/buttons/buttons-events.html b/libs/js/jquery-mobile-1.1.0/docs/buttons/buttons-events.html new file mode 100644 index 0000000..410d7ae --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/buttons/buttons-events.html @@ -0,0 +1,92 @@ + + + + + + jQuery Mobile Docs - Button events + + + + + + + + + + +
      + +
      +

      Button basics

      + Home + Search +
      + +
      +
      + +
      + +

      Button basics

      + + + +

      Bind events directly to the a, input, or button element. Use jQuery Mobile's virtual events, or bind standard JavaScript events, like change, focus, blur, etc.:

      +
       
      +$( ".myButton" ).bind( "click", function(event, ui) {
      +  ...
      +});
      +
      + +

      The form button plugin has the following custom events:

      + +
      + +
      create triggered when a form button is created
      +
      + +
      
      +$('[type='submit']').button({
      +   create: function(event, ui) { ... }
      +});		
      +			
      +
      + +
      + +
      +
      + +
      + +
      + +

      More in this section

      + + +
      +
      + +
      + + + +
      + + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/buttons/buttons-grouped.html b/libs/js/jquery-mobile-1.1.0/docs/buttons/buttons-grouped.html new file mode 100644 index 0000000..df3f48b --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/buttons/buttons-grouped.html @@ -0,0 +1,112 @@ + + + + + + jQuery Mobile Docs - Grouped Buttons + + + + + + + + + + +
      + +
      +

      Grouped

      + Home + Search +
      + +
      +
      + +

      Grouped buttons

      +

      Occasionally, you may want to visually group a set of buttons together to form a single block that looks contained like a navigation component. To get this effect, wrap a set of buttons in a container with the data-role="controlgroup" attribute — the framework will create a vertical button group, remove all margins and drop shadows between the buttons, and only round the first and last buttons of the set to create the effect that they are grouped together.

      +
      
      +<div data-role="controlgroup">
      +<a href="index.html" data-role="button">Yes</a>
      +<a href="index.html" data-role="button">No</a>
      +<a href="index.html" data-role="button">Maybe</a>
      +</div>
      +
      + +

      By default, grouped buttons are presented as a vertical list:

      + +
      + Yes + No + Maybe +
      + +

      By adding the data-type="horizontal" attribute to the controlgroup container, you can swap to a horizontal-style group that floats the buttons side-by-side and sets the width to only be large enough to fit the content. (Be aware that these will wrap to multiple lines if the number of buttons or the overall text length is too wide for the screen.) + +

      Horizontal grouped buttons:

      +
      + Yes + No + Maybe +
      + +

      Mini horizontal grouped buttons by adding data-mini="true to the controlgroup:

      +
      + Yes + No + Maybe +
      + +

      Horizontal grouped buttons with icons:

      +
      + Add + Delete +
      + +

      Mini horizontal grouped buttons with icons by adding data-mini="true to the controlgroup::

      +
      + Add + Delete +
      + +

      Horizontal grouped buttons, icon only:

      +
      + Up + Down + Delete +
      + + +
      + +
      + +
      + +

      More in this section

      + + +
      +
      + +
      + + + +
      + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/buttons/buttons-icons.html b/libs/js/jquery-mobile-1.1.0/docs/buttons/buttons-icons.html new file mode 100644 index 0000000..f58205d --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/buttons/buttons-icons.html @@ -0,0 +1,247 @@ + + + + + + jQuery Mobile Docs - Button icons + + + + + + + + + + +
      + +
      +

      Button icons

      + Home + Search +
      + +
      +
      + +

      Adding Icons to Buttons

      +

      The jQuery Mobile framework includes a selected set of icons most often needed for mobile apps. To minimize download size, jQuery Mobile includes a single white icon sprite, and automatically adds a semi-transparent black circle behind the icon to ensure that it has good contrast on any background color.

      + + +

      An icon can be added to a button by adding a data-icon attribute on the anchor specifying the icon to display. For example, the following markup:

      + + + <a href="index.html" data-role="button" data-icon="delete">Delete</a> + + +

      Creates this button with an icon:

      + Delete + +

      A more compact button with the data-inline="true" attribute added to the button:

      + Delete + +

      Icon set

      + +

      The following data-icon attributes can be referenced to create the icons shown below:

      + +

      Left arrow - data-icon="arrow-l"

      + My button +

      Right arrow - data-icon="arrow-r"

      + My button +

      Up arrow - data-icon="arrow-u"

      + My button +

      Down arrow - data-icon="arrow-d"

      + My button +

      Delete - data-icon="delete"

      + My button +

      Plus - data-icon="plus"

      + My button +

      Minus - data-icon="minus"

      + My button +

      Check - data-icon="check"

      + My button +

      Gear - data-icon="gear"

      + My button +

      Refresh - data-icon="refresh"

      + My button +

      Forward - data-icon="forward"

      + My button +

      Back - data-icon="back"

      + My button +

      Grid - data-icon="grid"

      + My button +

      Star - data-icon="star"

      + My button +

      Alert - data-icon="alert"

      + My button +

      Info - data-icon="info"

      + My button +

      Home - data-icon="home"

      + My button +

      Search - data-icon="search"

      + My button + + +

      Icon positioning

      +

      By default, all icons in buttons are placed to the left of the button text.

      + Delete + +

      This default may be overridden using the data-iconpos attribute to set the icon to the right, above (top) or below (bottom) the text. For example, the markup:

      + + +<a href="index.html" data-role="button" data-icon="delete" data-iconpos="right">Delete</a> + + +

      Creates this button with right-aligned icon:

      + Delete + +

      Icons can also be positioned above the text by specifying data-iconpos="top"

      + Delete + +

      Or icons can also be positioned below the text by specifying data-iconpos="bottom"

      + Delete + +

      You can also create an icon-only button, by setting the data-iconpos attribute to notext. The button plugin will hide the text on-screen, but add it as a title attribute on the link to provide context for screen readers and devices that support tooltips. For example, replacing data-iconpos="right" on the previous example with data-iconpos="notext":

      + + +<a href="index.html" data-role="button" data-icon="delete" data-iconpos="notext">Delete</a> + + +

      Creates this icon-only button:

      + Delete + + + +

      Mini & Inline

      +

      The mini and inline attributes can be added to produce more compact buttons:

      + Delete + Delete + Delete + Delete + Delete + + +

      Custom Icons

      +

      To use custom icons, specify a data-icon value that has a unique name like myapp-email and the button plugin will generate a class by prefixing ui-icon- to the data-icon value and apply it to the button: ui-icon-myapp-email.

      +

      You can then write a CSS rule in your stylesheet that targets the ui-icon-myapp-email class to specify the icon background source. To maintain visual consistency with the rest of the icons, create a white icon 18x18 pixels saved as a PNG-8 with alpha transparency.

      +

      In this example, we're just pointing to a standalone icon image, but you could just as easily use an icon sprite and specify the positioning instead, just like the icon sprite we use in the framework.

      + +
      .ui-icon-myapp-email {
      +	background-image: url("app-icon-email.png");
      +}
      + +

      This will create the standard resolution icon, but many devices now have very high resolution displays, like the retina display on the iPhone 4. To add a HD icon, create an icon that is 36x36 pixels (exactly double the 18 pixel size), and add second rule that uses the -webkit-min-device-pixel-ratio: 2 media query to target a rule only to high resolution displays. Specify the background image for the HD icon file and set the background size to 18x18 pixels which will fit the 36 pixel icon into the same 18 pixel space. The media query block can wrap multiple icon rules:

      +
      
      +@media only screen and (-webkit-min-device-pixel-ratio: 2) {
      +	.ui-icon-myapp-email {
      +		background-image: url("app-icon-email-highres.png");
      +		background-size: 18px 18px;
      +	}
      +	...more HD icon rules go here...
      +}
      +
      + +

      Icons and themes

      +

      The semi-transparent black circle behind the white icon ensures good contrast on any background color so it works well with the jQuery Mobile theming system. Here are examples of the same icons sitting on top of a range of different color swatches with themed buttons.

      + + +

      Swatch "A" themed buttons

      + + + +

      Swatch "B" themed buttons

      + + + +

      Swatch "C" themed buttons

      + + +
      + +
      + +
      + +

      More in this section

      + + +
      +
      + +
      + + + +
      + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/buttons/buttons-inline.html b/libs/js/jquery-mobile-1.1.0/docs/buttons/buttons-inline.html new file mode 100644 index 0000000..8e6d62a --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/buttons/buttons-inline.html @@ -0,0 +1,99 @@ + + + + + + jQuery Mobile Docs - Inline buttons + + + + + + + + + + +
      + +
      +

      Inline buttons

      + Home + Search +
      + +
      +
      +

      Inline buttons

      +

      By default, all buttons in the body content are styled as block-level element so they fill the width of the screen:

      + + Button + + +

      However, if you want a more compact button that is only as wide as the text and icons inside, add the data-inline="true" attribute to the button:

      + + + Button + +

      If you have multiple buttons that should sit side-by-side on the same line, add the data-inline="true" attribute to each button. This will style the buttons to be the width of their content and float the buttons so they sit on the same line.

      + +
      
      +<a href="index.html" data-role="button" data-inline="true">Cancel</a>
      +<a href="index.html" data-role="button" data-inline="true" data-theme="b">Save</a>
      +
      + +

      The result is this:

      + + Cancel + Save + +

      Adding the data-mini="true" to the inline buttons creates a more compact version:

      + + Cancel + Save + + +

      If you want buttons to sit side-by-side but stretch to fill the width of the screen, you can use the content column grids to put normal full-width buttons into 2- or 3-columns.

      + +

      Icon example

      +

      When an icon is added to an inline button, the button will grow wider to accommodate the icon:

      + + Cancel + Save + +

      A mini version of the same:

      + + Cancel + Save + +

      + +
      + +
      + +

      More in this section

      + + +
      +
      + +
      + + + +
      + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/buttons/buttons-methods.html b/libs/js/jquery-mobile-1.1.0/docs/buttons/buttons-methods.html new file mode 100644 index 0000000..6ef4a06 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/buttons/buttons-methods.html @@ -0,0 +1,98 @@ + + + + + + jQuery Mobile Docs - Button methods + + + + + + + + + + +
      + +
      +

      Button basics

      + Home + Search +
      + +
      +
      + +
      + +

      Button basics

      + + + +

      The following methods apply only to form buttons. Link-based buttons do not have any associated methods.

      + +
      + +
      enable enable a disabled form button
      +
      +
      
      +$('[type='submit']').button('enable');			
      +				
      +
      + +
      disable disable a form button
      +
      +
      
      +$('[type='submit']').button('disable');			
      +				
      +
      + +
      refresh update the form button
      +
      +

      If you manipulate a form button via JavaScript, you must call the refresh method on it to update the visual styling.

      + +
      		
      +$('[type='submit']').button('refresh');
      +				
      +
      + +
      + +
      +
      + +
      + +
      + +

      More in this section

      + + +
      +
      + +
      + + + +
      + + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/buttons/buttons-options.html b/libs/js/jquery-mobile-1.1.0/docs/buttons/buttons-options.html new file mode 100644 index 0000000..f0754cd --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/buttons/buttons-options.html @@ -0,0 +1,153 @@ + + + + + + jQuery Mobile Docs - Button options + + + + + + + + + + +
      + +
      +

      Button basics

      + Home + Search +
      + +
      +
      + +
      + +

      Button basics

      + + + +

      The following options apply to all buttons:

      + +
      +
      corners boolean
      +
      +

      default: true

      +

      Applies the theme button border-radius if set to true. This option is also exposed as a data attribute: data-corners="false"

      +
      $('a').buttonMarkup({ corners: "false" });
      + No rounded corners +
      +
      icon string
      +
      +

      default: null

      +

      Applies an icon from the icon set. This option is also exposed as a data attribute: data-icon="star"

      +
      $('a').buttonMarkup({ icon: "star" });
      + Star icon +
      + +
      iconpos string
      +
      +

      default: "left"

      +

      Positions the icon in the button. Possible values: left, right, top, bottom, none, notext. The notext value will display an icon-only button with no text feedback. This option is also exposed as a data attribute: data-iconpos="left"

      +
      $('a').buttonMarkup({ iconpos: "right" });
      + Star icon +
      + +
      iconshadow boolean
      +
      +

      default: true

      +

      Applies the theme shadow to the button's icon if set to true. This option is also exposed as a data attribute: data-iconshadow="false"

      +
      $('a').buttonMarkup({ iconshadow: "false" });
      + No icon shadow +
      + +
      inline boolean
      +
      +

      default: null (false)

      +

      If set to true, this will make the button act like an inline button so the width is determined by the button's text. By default, this is null (false) so the button is full width, regardless of the feedback content. Possible values: true, false. This option is also exposed as a data attribute: data-inline="true"

      +
      $('a').buttonMarkup({ inline: "true" });
      + Inline +
      + +
      mini boolean
      +
      +

      default: null (false)

      +

      If set to true, this will display a more compact version of the button that uses less vertical height. Possible values: true, false. This option is also exposed as a data attribute: data-mini="true"

      +
      $('a').buttonMarkup({ mini: "true" });
      + Inline +
      + +
      shadow boolean
      +
      +

      default: true

      +

      Applies the drop shadow style to the button if set to true. This option is also exposed as a data attribute: data-shadow="false"

      +
      $('a').buttonMarkup({ shadow: "false" });
      + No button shadow +
      + +
      theme string
      +
      +

      default: null, inherited from parent

      +

      Sets the color scheme (swatch) for all instances of this widget. It accepts a single letter from a-z that maps to the swatches included in your theme. By default, it will inherit the same swatch color as it's parent container if not explicitly set. This option is also exposed as a data attribute: data-theme="a"

      +
      $('a').buttonMarkup({ theme: "a" });
      + Theme A +
      +
      + +
      +

      The following option applies only to form buttons, which are automatically initialized by the framework:

      +
      + +
      +
      initSelector CSS selector string
      +
      +

      default: "button, [type='button'], [type='submit'], [type='reset'], [type='image']"

      +

      This is used to define the selectors (element types, data roles, etc.) that will automatically be initialized as form buttons. To change which elements are initialized, bind this option to the mobileinit event:

      +
      $( document ).bind( "mobileinit", function(){
      +   $.mobile.button.prototype.options.initSelector = ".myButtons";
      +});
      +
      +
      +
      + + +
      +
      + +
      + +
      + +

      More in this section

      + + +
      +
      + +
      + + + +
      + + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/buttons/buttons-themes.html b/libs/js/jquery-mobile-1.1.0/docs/buttons/buttons-themes.html new file mode 100644 index 0000000..0c11ef4 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/buttons/buttons-themes.html @@ -0,0 +1,130 @@ + + + + + + jQuery Mobile Docs - Theming buttons + + + + + + + + + + +
      + +
      +

      Theming buttons

      + Home + Search +
      + +
      +
      + +

      Theming buttons

      + +

      jQuery Mobile has a rich theming system that gives you full control of how buttons are styled. When a link is added to a container, it is automatically assigned a theme swatch letter that matches its parent bar or content box to visually integrate the button into the parent container, like a chameleon. So a button placed inside a content container with a theme of "a" (black in the default theme) will be automatically assigned the button theme of "a" (charcoal in the default theme). Here are examples of the button theme pairings in the default theme. All buttons have the same HTML markup:

      + +

      A swatch

      Button
      +

      B swatch

      Button
      +

      C swatch

      Button
      +

      D swatch

      Button
      +

      E swatch

      Button
      + +

      Assigning theme swatches

      +

      Buttons can be manually assigned any of the button color swatches from the theme to add visual contrast with the container they sit inside by adding the data-theme attribute on the button markup and specifying a swatch letter.

      + +
      			
      +<a href="index.html" data-role="button" data-theme="a">Theme a</a>			
      +
      + +

      Here are 5 buttons with icons that have a different swatch letter assigned via the data-theme attribute.

      + + Theme a + Theme b + Theme c + Theme d + Theme e + +

      Theme variations

      + +

      "a" theme on container with themed buttons inside

      + + +

      "b" theme on container with themed buttons inside

      + + +

      "c" theme on container with themed buttons inside

      + + +

      "d" theme on container with themed buttons inside

      + + +

      "e" theme on container with themed buttons inside

      + + +
      + +
      + +
      + +

      More in this section

      + + +
      +
      + +
      + + + +
      + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/buttons/buttons-types.html b/libs/js/jquery-mobile-1.1.0/docs/buttons/buttons-types.html new file mode 100644 index 0000000..b74a2a9 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/buttons/buttons-types.html @@ -0,0 +1,119 @@ + + + + + + jQuery Mobile Docs - Button types + + + + + + + + + + +
      + +
      +

      Button basics

      + Home + Search +
      + +
      +
      + +

      Button basics

      + + + + +

      Buttons are coded with standard HTML anchor and input elements, then enhanced by jQuery Mobile to make them more attractive and useable on a mobile device. Use anchor links (a elements) to mark up navigation buttons, and input or button elements for form submission.

      +

      View the data- attribute reference to see all the possible attributes for buttons including adding icons or displaying them inline or grouped.

      + +

      Styling links as buttons

      + +

      In the main content block of a page, you can style any anchor link as a button by adding the data-role="button" attribute. The framework will enhance the link with markup and classes to style the link as a button. For example, this markup:

      + + +<a href="index.html" data-role="button">Link button</a> + + +

      Produces this link-based button:

      + Link button + +

      Note: Links styled like buttons have all the same visual options as true form-based buttons below, but there are a few important differences. Link-based buttons aren't part of the button plugin and only just use the underlying buttonMarkup plugin to generate the button styles so the form button methods (enable, disable, refresh) aren't supported. If you need to disable a link-based button (or any element), it's possible to apply the disabled class ui-disabled yourself with JavaScript to achieve the same effect.

      + +

      Mini size

      + +

      For a more compact version that is useful in toolbars and tight spaces, add the data-mini="true" attribute to the button to create a mini version.

      + +
      	
      +<a href="index.html" data-role="button" data-mini="true">Link button</a>
      +
      + +

      This will produce a search input that a not as tall as the standard version and has a smaller text size.

      + Link button + + + +

      Form buttons

      +

      For ease of styling, the framework automatically converts any button or input element with a type of submit, reset, button, or image into a custom styled button — there is no need to add the data-role="button" attribute. However, if needed, you can directly call the button plugin on any selector, just like any jQuery plugin:

      + + +$('[type='submit']').button(); + + +

      To preserve events bound to the original button or input, the framework hides the original element by making it transparent and positioning it over the new button markup. When a user clicks on the the custom-styled button, they're actually clicking on the original element. To prevent a form button from being converted into an enhanced button, add the data-role="none" attribute and hte native control will be rendered.

      + +

      Button based button:

      + + +

      Input type="button" based button:

      + + +

      Input type="submit" based button:

      + + +

      Input type="reset" based button:

      + + +

      Input type="image" based button:

      + + +
      + +
      + +
      + +

      More in this section

      + + +
      +
      + +
      + + + +
      + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/buttons/index.html b/libs/js/jquery-mobile-1.1.0/docs/buttons/index.html new file mode 100644 index 0000000..5453ead --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/buttons/index.html @@ -0,0 +1,43 @@ + + + + + + jQuery Mobile Docs - Buttons + + + + + + + + + + +
      + +
      +

      Buttons

      + Home + Search +
      + +
      +

      Buttons are core widgets in jQuery Mobile, and are used within a wide range of other plugins.

      + + +
      +
      + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/config/dialogTransition.html b/libs/js/jquery-mobile-1.1.0/docs/config/dialogTransition.html new file mode 100644 index 0000000..971f6ef --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/config/dialogTransition.html @@ -0,0 +1,44 @@ + + + + + + jQuery Mobile Docs - Configuration + + + + + + + + + + + + + + +
      + +
      +

      Config applied

      + Home + Search +
      + +
      + +

      defaultDialogTransition is now "flip"

      +

      To test, hit the button below and browse the docs. Note that if a link causes a refresh, this setting will be lost and the default settings will be seen.

      + Browse docs + Or open a basic dialog + +
      +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/config/iOSFullscreen.html b/libs/js/jquery-mobile-1.1.0/docs/config/iOSFullscreen.html new file mode 100644 index 0000000..ba8fb85 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/config/iOSFullscreen.html @@ -0,0 +1,50 @@ + + + + + + + + + + jQuery Mobile Docs - Configuration + + + + + + + + + + + + + + + +
      + +
      +

      jQuery Mobile

      + Home + Search +
      + +
      + +

      Fullscreen docs in iOS

      +

      First, hit Add to Home Screen to create a new shortcut icon on the home screen. Next, open the new shortcut and hit the button below to browse the docs as a fullscreen web app.

      + Browse docs + +
      +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/config/index.html b/libs/js/jquery-mobile-1.1.0/docs/config/index.html new file mode 100644 index 0000000..529879e --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/config/index.html @@ -0,0 +1,86 @@ + + + + + + jQuery Mobile Docs - Configuration + + + + + + + + + + + + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/config/jq17b1.html b/libs/js/jquery-mobile-1.1.0/docs/config/jq17b1.html new file mode 100644 index 0000000..0c68342 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/config/jq17b1.html @@ -0,0 +1,37 @@ + + + + + + jQuery Mobile Docs - Configuration + + + + + + + + + + + +
      + +
      +

      jQuery version

      + Home + Search +
      + +
      + +

      jQuery core version 1.7 Beta 1

      +

      To test, hit the button below and browse the docs. Note that if a link causes a refresh, this setting will be lost and the default settings will be seen.

      + Browse docs + + +
      +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/config/loadingMessage.html b/libs/js/jquery-mobile-1.1.0/docs/config/loadingMessage.html new file mode 100644 index 0000000..4a7e769 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/config/loadingMessage.html @@ -0,0 +1,43 @@ + + + + + + jQuery Mobile Docs - Configuration + + + + + + + + + + + + + +
      + +
      +

      Config applied

      + Home + Search +
      + +
      + +

      loadingMessage is now disabled

      +

      To test, hit the button below and browse the docs. Note that if a link causes a refresh, this setting will be lost and the default settings will be seen.

      + Browse docs + + +
      +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/config/loadingMessageTextVisible.html b/libs/js/jquery-mobile-1.1.0/docs/config/loadingMessageTextVisible.html new file mode 100644 index 0000000..0373212 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/config/loadingMessageTextVisible.html @@ -0,0 +1,84 @@ + + + + + + jQuery Mobile Docs - Configuration + + + + + + + + + + + + +
      + + +
      +

      Config applied

      + Home + Search +
      + +
      + +

      loadingMessage text is now visible

      +

      To test, hit the button below and browse the docs. Note that if a link causes a refresh, this setting will be lost and the default settings will be seen.

      + Browse docs + +

      To display the loading message on demand:

      +
      $.mobile.showPageLoadingMsg();
      +

      Click the buttons below to show and hide the loading message with the default options.

      +
      + + +
      + +

      Theming the loading message

      +

      To display the loading message with a different theme and message:

      +
      $.mobile.showPageLoadingMsg("a", "Loading theme a...");
      +

      The theme and message can be changed on the fly by calling the method again. Click the buttons below to see the loading message with the indicated theme.

      +
      + + + + + + +
      + +

      Text only messages

      +

      To display the loading message with no spinner:

      +
      $.mobile.showPageLoadingMsg("a", "No spinner", true);
      +

      Click the button below to see the loading message with no spinner.

      +
      + + +
      + + +
      +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/config/minScrollBack.html b/libs/js/jquery-mobile-1.1.0/docs/config/minScrollBack.html new file mode 100644 index 0000000..44d580f --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/config/minScrollBack.html @@ -0,0 +1,43 @@ + + + + + + jQuery Mobile Docs - Configuration + + + + + + + + + + + + + +
      + +
      +

      Config applied

      + Home + Search +
      + +
      + +

      minScrollBack is now set to 999 (disabled)

      +

      To test, hit the button below and browse the docs. Note that if a link causes a refresh, this setting will be lost and the default settings will be seen.

      + Browse docs + + +
      +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/config/pageLoadErrorMessage.html b/libs/js/jquery-mobile-1.1.0/docs/config/pageLoadErrorMessage.html new file mode 100644 index 0000000..116724b --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/config/pageLoadErrorMessage.html @@ -0,0 +1,45 @@ + + + + + + jQuery Mobile Docs - Configuration + + + + + + + + + + + + + + +
      + +
      +

      Config applied

      + Home + Search +
      + +
      + +

      pageLoadErrorMessage is now "Yikes, we broke the internet!"

      +

      To test, hit the button below and browse the docs. Note that if a link causes a refresh, this setting will be lost and the default settings will be seen.

      + Browse docs + Or try this broken link + + +
      +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/config/pageTransition.html b/libs/js/jquery-mobile-1.1.0/docs/config/pageTransition.html new file mode 100644 index 0000000..aa0d849 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/config/pageTransition.html @@ -0,0 +1,43 @@ + + + + + + jQuery Mobile Docs - Configuration + + + + + + + + + + + + + + +
      + +
      +

      Config applied

      + Home + Search +
      + +
      + +

      defaultPageTransition is now "flow"

      +

      To test, hit the button below and browse the docs. Note that if a link causes a refresh, this setting will be lost and the default settings will be seen.

      + Browse docs + +
      +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/config/pushState.html b/libs/js/jquery-mobile-1.1.0/docs/config/pushState.html new file mode 100644 index 0000000..58e68ce --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/config/pushState.html @@ -0,0 +1,44 @@ + + + + + + jQuery Mobile Docs - Configuration + + + + + + + + + + + + + + +
      + +
      +

      Config applied

      + Home + Search +
      + +
      + +

      pushStateEnabled is now disabled

      +

      To test, hit the button below and browse the docs. Note that if a link causes a refresh, this setting will be lost and the default settings will be seen.

      + Browse docs + + +
      +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/config/touchOverflow.html b/libs/js/jquery-mobile-1.1.0/docs/config/touchOverflow.html new file mode 100644 index 0000000..1474ac0 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/config/touchOverflow.html @@ -0,0 +1,51 @@ + + + + + + jQuery Mobile Docs - Configuration + + + + + + + + + + + + + + +
      + +
      +

      Config applied

      + Home + Search +
      + +
      + +

      touchOverflowEnabled is now active

      +

      The toolbar on this page should now be fixed, like a native toolbar. To test, hit the button below and browse the docs. Note that if a link causes a refresh, this setting will be lost and the default settings will be seen.

      + Browse docs + touchOverflow docs + +

      Some good pages to test out:

      + Fixed toolbars + Fullscreen toolbars + Fixed persistent footer + Dialogs & transitions + + +
      +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/content/api-content.html b/libs/js/jquery-mobile-1.1.0/docs/content/api-content.html new file mode 100644 index 0000000..9b049ad --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/content/api-content.html @@ -0,0 +1,42 @@ + + + + + + jQuery Mobile Docs - Content formatting + + + + + + + + + +
      + +
      +

      Content formatting API

      +
      + +
      + +

      Dependencies

      +

      To be documented

      + +

      Options

      +

      To be documented

      + +

      Methods

      +

      To be documented

      + +

      Known Issues

      +

      To be documented

      + + + +
      +
      + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/content/content-collapsible-events.html b/libs/js/jquery-mobile-1.1.0/docs/content/content-collapsible-events.html new file mode 100644 index 0000000..cb88093 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/content/content-collapsible-events.html @@ -0,0 +1,109 @@ + + + + + + jQuery Mobile Docs - Collapsible Content + + + + + + + + + + +
      + +
      +

      Collapsible

      + Home + Search +
      + +
      +
      +

      Collapsible content

      + + + +

      Bind events directly to the container, typically a div element. Use jQuery Mobile's virtual events, or bind standard JavaScript events, like change, focus, blur, etc.:

      +
      
      +$( ".selector" ).bind( "collapse", function(event, ui) {
      +  ...
      +});
      +
      + +

      The collapsible plugin has the following custom events:

      + +
      + +
      create triggered when a collapsible is created
      +
      + +
      
      +$( ".selector" ).collapsible({
      +   create: function(event, ui) { ... }
      +});
      +			
      +
      + +
      collapse triggered when a collapsible is collapsed
      +
      + +
      
      +$( ".selector" ).collapsible({
      +   collapse: function(event, ui) { ... }
      +});
      +			
      +
      + +
      expand triggered when a collapsible is expanded
      +
      + +
      
      +$( ".selector" ).collapsible({
      +   expand: function(event, ui) { ... }
      +});
      +			
      +
      + +
      + +
      + +
      + +
      + +

      More in this section

      + + +
      +
      + +
      + + + +
      + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/content/content-collapsible-methods.html b/libs/js/jquery-mobile-1.1.0/docs/content/content-collapsible-methods.html new file mode 100644 index 0000000..f37e7b1 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/content/content-collapsible-methods.html @@ -0,0 +1,67 @@ + + + + + + jQuery Mobile Docs - Collapsible Content + + + + + + + + + + +
      + +
      +

      Collapsible

      + Home + Search +
      + +
      +
      +

      Collapsible content

      + + + +

      The collapsible plugin has no public methods.

      +
      + +
      + +
      + +

      More in this section

      + + +
      +
      + +
      + + + +
      + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/content/content-collapsible-options.html b/libs/js/jquery-mobile-1.1.0/docs/content/content-collapsible-options.html new file mode 100644 index 0000000..a4dac07 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/content/content-collapsible-options.html @@ -0,0 +1,178 @@ + + + + + + jQuery Mobile Docs - Collapsible Content + + + + + + + + + + +
      + +
      +

      Collapsible

      + Home + Search +
      + +
      +
      +

      Collapsible content

      + + + +

      The collapsible plugin has the following options:

      + +
      +
      collapsed boolean
      +
      +

      default: true

      +

      When false, the container is initially expanded with a minus icon in the header. To set the value for all instances of this widget, bind this option to the mobileinit event:

      +
      $( document ).bind( "mobileinit", function(){
      +    $.mobile.collapsible.prototype.options.collapsed = false;
      +});
      +
      +

      This option is also exposed as a data attribute: data-collapsed="false".

      +
      + +
      collapseCueText string
      +
      +

      default: " click to collapse contents"

      +

      This text is used to provide audible feedback for users with screen reader software. To set the value for all instances of this widget, bind this option to the mobileinit event:

      +
      $( document ).bind( "mobileinit", function(){
      +    $.mobile.collapsible.prototype.options.collapseCueText = " collapse with a click";
      +});
      +
      +
      + +
      contentTheme string
      +
      +

      default: null, inherited from parent

      +

      Sets the color scheme (swatch) for the collapsible content block. It accepts a single letter from a-z that maps to the swatches included in your theme. To set the value for all instances of this widget, bind this option to the mobileinit event:

      +
      $( document ).bind( "mobileinit", function(){
      +    $.mobile.collapsible.prototype.options.contentTheme = "a";
      +});
      +
      +

      This option is also exposed as a data attribute: data-content-theme="a".

      +
      + +
      expandCueText string
      +
      +

      default: " click to expand contents"

      +

      This text is used to provide audible feedback for users with screen reader software. To set the value for all instances of this widget, bind this option to the mobileinit event:

      +
      $( document ).bind( "mobileinit", function(){
      +    $.mobile.collapsible.prototype.options.expandCueText = " expand with a click";
      +});
      +
      +
      + +
      heading string
      +
      +

      default: "h1,h2,h3,h4,h5,h6,legend"

      +

      Within the collapsible container, the first immediate child element that matches this selector will be used as the header for the collapsible. To change the selector, bind this option to the mobileinit event:

      +
      $( document ).bind( "mobileinit", function(){
      +    $.mobile.collapsible.prototype.options.heading = ".mycollapsibleheading";
      +});
      +
      +
      + +
      iconpos string
      +
      +

      default: "left"

      +

      Positions the icon in the collapsible header. Possible values: left, right, top, bottom, none, notext.

      +
      $( document ).bind( "mobileinit", function(){
      +    $.mobile.collapsible.prototype.options.iconpos = "right";
      +});
      +
      +

      This option is also exposed as a data attribute: data-iconpos="right".

      +
      + + + +
      initSelector CSS selector string
      +
      +

      default: ":jqmData(role='collapsible')"

      +

      This is used to define the selectors (element types, data roles, etc.) that will automatically be initialized as collapsibles. To change which elements are initialized, bind this option to the mobileinit event:

      +
      $( document ).bind( "mobileinit", function(){
      +    $.mobile.collapsible.prototype.options.initSelector = ".mycollapsible";
      +});
      +
      +
      + +
      mini boolean
      +
      +

      default: false

      +

      Sets the size of the element to a more compact, mini version. If the value is false for an individual collapsible container, but that container is part of a collapsible set, then the value is inherited from the parent collapsible set. To set the value for all instances of this widget, bind this option to the mobileinit event:

      +
      $( document ).bind( "mobileinit", function(){
      +    $.mobile.collapsible.prototype.options.mini = true;
      +});
      +
      +

      This option is also exposed as a data attribute: data-mini="true".

      +
      +
      theme string
      +
      +

      default: null, inherited from parent

      +

      Sets the color scheme (swatch) for the collapsible. It accepts a single letter from a-z that maps to the swatches included in your theme. To set the value for all instances of this widget, bind this option to the mobileinit event:

      +
      $( document ).bind( "mobileinit", function(){
      +    $.mobile.collapsible.prototype.options.theme = "a";
      +});
      +
      +

      This option is also exposed as a data attribute: data-theme="a".

      +
      + + +
      +
      + +
      + +
      + +

      More in this section

      + + +
      +
      + +
      + + + +
      + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/content/content-collapsible-set-events.html b/libs/js/jquery-mobile-1.1.0/docs/content/content-collapsible-set-events.html new file mode 100644 index 0000000..ad0a542 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/content/content-collapsible-set-events.html @@ -0,0 +1,89 @@ + + + + + + jQuery Mobile Docs - Collapsible Content + + + + + + + + + + +
      + +
      +

      Collapsible set

      + Home + Search +
      + +
      +
      +

      Collapsible sets

      + + + +

      Bind events directly to the set container, typically a div element. Use jQuery Mobile's virtual events, or bind standard JavaScript events, like change, focus, blur, etc.:

      +
      
      +$( ".selector" ).bind( "create", function(event, ui) {
      +  ...
      +});
      +
      + +

      The collapsible set plugin has the following custom event:

      + +
      + +
      create triggered when a collapsible set is created
      +
      + +
      
      +$( ".selector" ).collapsibleset({
      +   create: function(event, ui) { ... }
      +});
      +			
      +
      + +
      + +
      + +
      + +
      + +

      More in this section

      + + +
      +
      + +
      + + + +
      + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/content/content-collapsible-set-methods.html b/libs/js/jquery-mobile-1.1.0/docs/content/content-collapsible-set-methods.html new file mode 100644 index 0000000..0ff8095 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/content/content-collapsible-set-methods.html @@ -0,0 +1,80 @@ + + + + + + jQuery Mobile Docs - Collapsible Sets + + + + + + + + + + +
      + +
      +

      Collapsible set

      + Home + Search +
      + +
      +
      +

      Collapsible sets

      + + + +

      The collapsible set plugin has the following method:

      + +
      +
      refresh update the collapsible set
      +
      +

      If you manipulate a collapsible set via JavaScript (e.g. add new collapsible containers), you must call the refresh method on it to update the visual styling.

      + +
      
      +$('.selector').collapsibleset('refresh');
      +				
      +
      + +
      + +
      + +
      + +
      + +

      More in this section

      + + +
      +
      + +
      + + + +
      + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/content/content-collapsible-set-options.html b/libs/js/jquery-mobile-1.1.0/docs/content/content-collapsible-set-options.html new file mode 100644 index 0000000..26f4bda --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/content/content-collapsible-set-options.html @@ -0,0 +1,112 @@ + + + + + + jQuery Mobile Docs - Collapsible Sets + + + + + + + + + + +
      + +
      +

      Collapsible set

      + Home + Search +
      + +
      +
      +

      Collapsible sets

      + + + +

      The collapsible plugin has the following options:

      + +
      +
      iconpos string
      +
      +

      default: "left"

      +

      Positions the icons in the collapsible headers. Possible values: left, right, top, bottom, none, notext.

      +
      $( document ).bind( "mobileinit", function(){
      +    $.mobile.collapsibleset.prototype.options.iconpos = "right";
      +});
      +
      +

      This option is also exposed as a data attribute: data-iconpos="right".

      +
      + +
      initSelector CSS selector string
      +
      +

      default: ":jqmData(role='collapsible-set')"

      +

      This is used to define the selectors (element types, data roles, etc.) that will automatically be initialized as collapsible sets. To change which elements are initialized, bind this option to the mobileinit event:

      +
      $( document ).bind( "mobileinit", function(){
      +    $.mobile.collapsibleset.prototype.options.initSelector = ".mycollapsibleset";
      +});
      +
      +
      + +
      mini boolean
      +
      +

      default: false

      +

      Sets the size of the element to a more compact, mini version. To set the value for all instances of this widget, bind this option to the mobileinit event:

      +
      $( document ).bind( "mobileinit", function(){
      +    $.mobile.collapsibleset.prototype.options.mini = true;
      +});
      +
      +

      This option is also exposed as a data attribute: data-mini="true".

      +
      +
      theme string
      +
      +

      default: null, inherited from parent

      +

      Sets the color scheme (swatch) for the collapsible set. It accepts a single letter from a-z that maps to the swatches included in your theme. To set the value for all instances of this widget, bind this option to the mobileinit event:

      +
      $( document ).bind( "mobileinit", function(){
      +    $.mobile.collapsibleset.prototype.options.theme = "a";
      +});
      +
      +

      This option is also exposed as a data attribute: data-theme="a".

      +
      + +
      +
      + +
      + +
      + +

      More in this section

      + + +
      +
      + +
      + + + +
      + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/content/content-collapsible-set.html b/libs/js/jquery-mobile-1.1.0/docs/content/content-collapsible-set.html new file mode 100644 index 0000000..7481b2e --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/content/content-collapsible-set.html @@ -0,0 +1,198 @@ + + + + + + jQuery Mobile Docs - Collapsible Content + + + + + + + + + + +
      + +
      +

      Collapsible set

      + Home + Search +
      + +
      +
      +

      Collapsible set (accordion)

      + + + +

      Collapsible sets start with the exact same markup as individual collapsibles. By adding a parent wrapper with a data-role="collapsible-set" attribute around a number of collapsibles, the framework will style these to looks like a visually grouped widget and make it behave like an accordion so only one section can be open at a time. View the data- attribute reference to see all the possible attributes you can add to collapsible sets.

      +

      By default, all the sections will be collapsed. To set a section to be open when the page loads, add the data-collapsed="false" attribute to the heading of the section you want expanded.

      + +
      		
      +<div data-role="collapsible-set">
      +
      +	<div data-role="collapsible" data-collapsed="false">
      +	<h3>Section 1</h3>
      +	<p>I'm the collapsible set content for section B.</p>
      +	</div>
      +	
      +	<div data-role="collapsible">
      +	<h3>Section 2</h3>
      +	<p>I'm the collapsible set content for section B.</p>
      +	</div>
      +	
      +</div>
      +	
      + + +

      Here is an example of a collapsible set with 5 sections.

      + +
      +
      +

      Section 1

      +

      I'm the collapsible content in a set so this feels like an accordion. I'm open by default because I have the data-collapsed="false" attribute.

      +
      +
      +

      Section 2

      +

      I'm the collapsible content in a set so this feels like an accordion. I'm hidden by default because I have the "collapsed" state; you need to expand the header to see me.

      +
      +
      +

      Section 3

      +

      I'm the collapsible content in a set so this feels like an accordion. I'm hidden by default because I have the "collapsed" state; you need to expand the header to see me.

      +
      +
      +

      Section 4

      +

      I'm the collapsible content in a set so this feels like an accordion. I'm hidden by default because I have the "collapsed" state; you need to expand the header to see me.

      +
      +
      +

      Section 5

      +

      I'm the collapsible content in a set so this feels like an accordion. I'm hidden by default because I have the "collapsed" state; you need to expand the header to see me.

      +
      +
      + +

      Mini collapsible sets

      + +

      For a more compact version that is useful in tight spaces, add the data-mini="true" attribute to the element to create a mini version.

      + +
      +
      +

      Section 1

      +

      Collapsible content

      +
      +
      +

      Section 2

      +

      Collapsible content

      + +
      +
      +

      Section 3

      +

      Collapsible content

      +
      +
      + +

      Icon positioning

      +

      Collapsible headings’ default icon positioing can be overridden by using the data-iconpos attribute, either at the collapsible-set level or on an individual collapsible basis.

      + +
      +
      +

      Section 1

      +

      Inherits icon positioning from data-iconpos="right" attribute on parent.

      +
      +
      +

      Section 2

      +

      data-iconpos="left"

      +
      +
      +

      Section 3

      +

      data-iconpos="bottom"

      +
      +
      +

      Section 4

      +

      data-iconpos="top"

      +
      +
      + + + +

      Theming collapsible content

      +

      The standard data-theme attribute can be used to set the color of each collapsible in a set. To provide a clearer visual grouping of the content with the headers, add the data-content-theme attribute with a swatch letter. This adds a themed background color and border to the content block. For consistent theming, add these attributes to the parent collapsible set.

      + + +
      		
      +<div data-role="collapsible-set" data-theme="c" data-content-theme="d">
      +
      + + +
      +
      +

      Section 1

      +

      Collapsible content

      +
      +
      +

      Section 2

      +

      Collapsible content

      + +
      +
      +

      Section 3

      +

      Collapsible content

      +
      +
      + +

      Theming individual sections

      +

      To have individual sections in a group styled differently, add data-theme and data-content-theme attributes to specific collapsibles.

      + +
      +
      +

      Section header, swatch B

      +

      Collapsible content, swatch B

      +
      +
      +

      Section header, swatch A

      +

      Collapsible content, swatch A

      +
      +
      +

      Section header, swatch E

      +

      Collapsible content, swatch D

      +
      +
      + +
      + +
      + +
      + +

      More in this section

      + + +
      +
      + +
      + + + +
      + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/content/content-collapsible.html b/libs/js/jquery-mobile-1.1.0/docs/content/content-collapsible.html new file mode 100644 index 0000000..02379f4 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/content/content-collapsible.html @@ -0,0 +1,226 @@ + + + + + + jQuery Mobile Docs - Collapsible Content + + + + + + + + + + +
      + +
      +

      Collapsible

      + Home + Search +
      + +
      +
      +

      Collapsible content

      + + + +

      To create a collapsible block of content, create a container and add the data-role="collapsible" attribute. Using data-content-theme attribute allows you to set a theme for the content of the collapsible. View the data- attribute reference to see all the possible attributes you can add to collapsibles.

      + +

      Directly inside this container, add any header element (H1-H6). The framework will style the header to look like a clickable button and add a "+" icon to the left to indicate it's expandable.

      + +

      After the header, add any HTML markup you want to be collapsible. The framework will wrap this markup in a container that will be hidden/shown when the heading is clicked.

      + +

      By default, the content will be collapsed.

      +
      		
      +<div data-role="collapsible">
      +   <h3>I'm a header</h3>
      +   <p>I'm the collapsible content. By default I'm closed, but you can click the header to open me.</p>
      +</div>
      +
      + + +
      +

      I'm a header

      +

      I'm the collapsible content. By default I'm closed, but you can click the header to open me.

      +
      + +

      Expanding collapsibles on load

      + +

      To expand the content when the page loads, add the data-collapsed="false" attribute to the wrapper.

      + + +<div data-role="collapsible" data-collapsed="false"> + + +

      This code will create a collapsible widget like this:

      + + +
      +

      I'm a header

      +

      I'm the collapsible content. I'm expanded by default because I have the "collapsed" state set to false.

      +
      + +

      Mini collapsibles

      + +

      For a more compact version that is useful in toolbars and tight spaces, add the data-mini="true" attribute to the element to create a mini version.

      + + + <div data-role="collapsible" data-mini="true"> + + +

      This code will create a mini collapsible widget:

      + +
      +

      I'm a mini header

      +

      I'm the collapsible content. I'm expanded by default because I have the "collapsed" state set to false.

      +
      + +

      Icon positioning

      +

      Collapsible headings’ default icon positioing can be overridden by using the data-iconpos attribute. In the below case, data-iconpos="right".

      + +
      +

      I'm a header

      +

      data-iconpos="right"

      +
      + + +

      Theming collapsible content

      + + +

      Collapsible content is minimally styled — we add only a bit of margin between the bar and content, and the header adopts the default Theme styles of the container it sits within.

      + +

      To provide a stronger visual connection between the collapsible header and content, add the data-content-theme attribute to the wrapper and specify a theme swatch letter. This will apply the swatch's border and flat background color (not the gradient) to the content block and changes the corner rounding to square off the bottom of the header and round the bottom of the content block instead to visually group these elements.

      + +
      		
      +<div data-role="collapsible" data-content-theme="c">
      +   <h3>Header swatch A</h3>
      +   <p>I'm the collapsible content with a themed content block set to "C".</p>
      +</div>
      +
      + +
      +

      Header swatch

      +

      I'm the collapsible content with a themed content block set to "C".

      +
      + +

      Theming collapsible headers

      +

      To set the theme on a collapsible header button, add the data-theme attribute to the wrapper and specify a swatch letter. Note that you can mix and match swatch letters between the header and content with these theme attributes.

      + +
      		
      +<div data-role="collapsible" data-theme="a" data-content-theme="a">
      +   <h3>Header swatch A</h3>
      +   <p>I'm the collapsible content with a themed content block set to "A".</p>
      +</div>
      +
      + +
      +

      Header swatch A

      +

      I'm the collapsible content with a themed content block set to "A".

      +
      + + + +
      +

      Header swatch B

      +

      I'm the collapsible content with a themed content block set to "D".

      +
      + + + +

      Nested Collapsibles

      + +

      Collapsibles can be nested inside each other if needed. In this example, we're setting the content theme to provide clearer visual connection between the levels.

      +
      +

      I'm a header

      +

      I'm the collapsible content. By default I'm open and displayed on the page, but you can click the header to hide me.

      + +
      +

      I'm a nested collapsible with a child collapsible

      +

      I'm a child collapsible.

      +
      +

      Nested inside again.

      +

      Three levels deep now.

      +
      +
      + + +
      +

      Section 3: Form elements

      +
      +
      + + +
      +
      + + +
      +
      +
      +
      +
      +
      +
      + +
      +

      Section 4: Collapsed list

      +

      Here is an inset list:

      + +
      +
      + + + +

      Collapsible sets (accordions)

      +

      It's possible to combine multiple collapsibles into a grouped sets that acts like an accordion widget.

      + + +
      + +
      + +
      + +

      More in this section

      + + +
      +
      + +
      + + + +
      + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/content/content-grids.html b/libs/js/jquery-mobile-1.1.0/docs/content/content-grids.html new file mode 100644 index 0000000..0ebb3fa --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/content/content-grids.html @@ -0,0 +1,193 @@ + + + + + + jQuery Mobile Docs - Content Grids + + + + + + + + + + +
      + +
      +

      Layout grids

      + Home + Search +
      + +
      +
      + +

      Using multiple column layouts isn't generally recommended on a mobile device because of the narrow screen width, but there are times where you may need to place small elements side-by-side (like buttons or navigation tabs, for example).

      + +

      The jQuery Mobile framework provides a simple way to build CSS-based columns through a block style class convention called ui-grid.

      + +

      There are four preset configurations layouts that can be used in any situation that requires columns:

      +
        +
      • two-column (using the ui-grid-a class)
      • +
      • three-column (using the ui-grid-b class)
      • +
      • four-column (using the ui-grid-c class)
      • +
      • five-column (using the ui-grid-d class)
      • +
      + +

      Grids are 100% width, completely invisible (no borders or backgrounds) and don't have padding or margins, so they shouldn't interfere with the styles of elements placed inside them.

      +

      Within the grid container, child elements are assigned ui-block-a/b/c/d in a sequential manner which makes each "block" element float side-by-side, forming the grid. The ui-block-a class essentially clears the floats which will start a new line (see multiple row grids, below).

      + +

      Two column grids

      +

      To build a two-column (50/50%) layout, start with a container with a class of ui-grid-a, and add two child containers inside it classed with ui-block-a for the first column and ui-block-b for the second:

      + +
      
      +<div class="ui-grid-a">
      +	<div class="ui-block-a"><strong>I'm Block A</strong> and text inside will wrap</div>
      +	<div class="ui-block-b"><strong>I'm Block B</strong> and text inside will wrap</div>
      +</div><!-- /grid-a -->
      +
      + + + +

      The above markup produces the following content layout:

      + +
      +
      I'm Block A and text inside will wrap.
      +
      I'm Block B and text inside will wrap.
      +
      + +

      As you see above, by default grid blocks have no visual styling; they simply present content side-by-side.

      + +

      Grid classes can be applied to any container. In this next example, we add ui-grid-a to a fieldset, and apply the ui-block classes to the two buttons inside to stretch them each to 50% of the screen width:

      + +
      
      +<fieldset class="ui-grid-a">
      +	<div class="ui-block-a"><button type="submit" data-theme="c">Cancel</button></div>
      +	<div class="ui-block-b"><button type="submit" data-theme="b">Submit</button></div>	   
      +</fieldset>
      +
      + +
      +
      +
      +
      + + +

      Theme classes (not data-theme attributes) from the theming system can be added to an element, including grids. On the blocks below, we're adding two classes: ui-bar to add the default bar padding and ui-bar-e to apply the background gradient and font styling for the "e" toolbar theme swatch. For illustration purposes, an inline style="height:120px" attribute is also added to each grid to set each to a standard height.

      + +
      +
      Block A
      +
      Block B
      +
      + +

      Three-column grids

      +

      The other grid layout configuration uses class=ui-grid-b on the parent, and 3 child container elements, each with its respective ui-block-a/b/c class, to create a three-column layout (33/33/33%). Note: These blocks are also styled with theme classes so the grid layout is clearly visible.

      + +
      
      +<div class="ui-grid-b">
      +	<div class="ui-block-a">Block A</div>
      +	<div class="ui-block-b">Block B</div>
      +	<div class="ui-block-c">Block C</div>
      +</div><!-- /grid-b -->
      +
      + +

      This will produce a 33/33/33% grid for our content.

      + +
      +
      Block A
      +
      Block B
      +
      Block C
      +
      + +

      And an example of a 3 column grid with buttons inside:

      + +
      +
      +
      +
      +
      + +

      Four-column grids

      + +

      A four-column, 25/25/25/25% grid is created by specifying class=ui-grid-c on the parent and adding a fourth block. Note: These blocks are also styled with theme classes so the grid layout is clearly visible.

      + +
      +
      A
      +
      B
      +
      C
      +
      D
      +
      + +

      Five-column grids

      +

      A five-column, 20/20/20/20/20% grid is created by specifying class=ui-grid-d on the parent and adding a fourth block. Note: These blocks are also styled with theme classes so the grid layout is clearly visible.

      + +
      +
      A
      +
      B
      +
      C
      +
      D
      +
      E
      +
      + +

      Multiple row grids

      + +

      Grids are designed to wrap to multiple rows of items. For example, if you specify a 3-column grid (ui-grid-b) on a container that has nine child blocks, it will wrap to 3 rows of 3 items each. There is a CSS rule to clear the floats and start a new line when the class=ui-block-a is seen so make sure to assign block classes in a repeating sequence (a, b, c, a, b, c, etc.) that maps to the grid type:

      + +
      +
      A
      +
      B
      +
      C
      +
      A
      +
      B
      +
      C
      +
      A
      +
      B
      +
      C
      +
      + + +

      Grids in toolbars

      +

      Grids are helpful for creating layouts within a toolbar. Here's a footer with a 3 column grid.

      + +
      +

      Settings

      +
      +
      +
      +
      + + +
      + +
      + +
      + +

      More in this section

      + + +
      +
      + +
      + + + +
      + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/content/content-html.html b/libs/js/jquery-mobile-1.1.0/docs/content/content-html.html new file mode 100644 index 0000000..9ad3b42 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/content/content-html.html @@ -0,0 +1,144 @@ + + + + + + jQuery Mobile Docs - HTML formatting + + + + + + + + + + +
      + +
      +

      HTML Formatting

      + Home + Search +
      + +
      +
      + + + + + +

      The default approach to styling content in jQuery Mobile is simple: Use a light hand. Our goal is to let the browser's native rendering take precedence; we add a bit of padding for more comfortable readability, and use the theming system to apply the font family and colors.

      +

      Taking a light hand with content styling gives designers and developers a clean slate to work with, instead of fighting against a lot of complex style overhead.

      + +

      Default HTML markup styling

      +

      By default, jQuery Mobile themes use standard HTML styles and sizes for standard markup elements like headers, paragraph content, block quotes, anchor links, standard ordered, unordered and definition lists, and tables — as shown in the examples below:

      +
      + +

      H1 Heading

      +

      H2 Heading

      +

      H3 Heading

      +

      H4 Heading

      +
      H5 Heading
      +
      H6 Heading
      + +

      This is a paragraph that contains strong, emphasized and linked text. Here is more text so you can see how HTML markup works in content. Here is more text so you can see how HTML markup works in content.

      + +
      How about some blockquote action with a cite
      + +

      This is another paragraph of text so you can see how HTML markup works in content. This is another paragraph of text so you can see how HTML markup works in content. This is another paragraph of text so you can see how HTML markup works in content.

      + +

      We add a few styles to tables and fieldsets to make them more legible, which are easily overridden with customs styles.

      + +
        +
      • Unordered list item 1
      • +
      • Unordered list item 1
      • +
      • Unordered list item 1
      • +
      + +
        +
      1. Ordered list item 1
      2. +
      3. Ordered list item 1
      4. +
      5. Ordered list item 1
      6. +
      + +
      +
      Definition term
      +
      I'm the definition text
      +
      Definition term
      +
      I'm the definition text
      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Travel Itinerary
      Flight:From:To:
      Total: 3 flights
      JetBlue 983Boston (BOS)New York (JFK)
      JetBlue 354San Francisco (SFO)Los Angeles (LAX)
      JetBlue 465New York (JFK)Portland (PDX)
      + + +
      + +
      + +
      + +

      More in this section

      + + +
      +
      + +
      + + + +
      + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/content/content-themes.html b/libs/js/jquery-mobile-1.1.0/docs/content/content-themes.html new file mode 100644 index 0000000..80fce68 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/content/content-themes.html @@ -0,0 +1,144 @@ + + + + + + jQuery Mobile Docs - Content Themes + + + + + + + + + + +
      + +
      +

      Theming content

      + Home + Search +
      + +
      +
      +

      Theming the content area

      +

      The main content area of a page (container with the data-role="content" attribute) should be themed by adding the data-theme attribute to the data-role="page" container to ensure that the background colors are applied to the full page, regardless of the content length. (If you add the data-theme attribute to the content container, the background color will stop after the content. So there may be a gap in color between the content and fixed footer.)

      +

      Additionally, the content area of a collapsible can be themed to match the theme of the collapsible header using the data-content-theme attribute.

      + + +<div data-role="page" data-theme="a" data-content-theme="a"> + + +

      Theming collapsible blocks

      +

      To set the color of the collapsible header, add the data-theme attribute to the collapsible container. The icon and body are not currently themable through data attributes, but can be styled directly with custom css.

      + + +<div data-role="collapsible" data-collapsed="true" data-theme="a"> + +

      Themed examples

      + +

      A theme swatch on content & collapsible

      +
      +

      H1 Heading

      +

      This is a paragraph that contains strong, emphasized and linked text. Here is more text so you can see how HTML markup works in content. Here is more text so you can see how HTML markup works in content.

      +
      +

      I'm a themed collapsible

      +

      I have data-theme attribute set manually on my container to set the color to match the content block I'm in.

      +
      +
      +

      I'm a themed collapsible with a themed content

      +

      I have data-content-theme attribute set manually on my container to set the color to match the content block I'm in.

      +
      +
      + +

      B theme swatch on content & collapsible

      +
      +

      H1 Heading

      +

      This is a paragraph that contains strong, emphasized and linked text. Here is more text so you can see how HTML markup works in content. Here is more text so you can see how HTML markup works in content.

      +
      +

      I'm a themed collapsible

      +

      I have data-theme attribute set manually on my container to set the color to match the content block I'm in.

      +
      +
      +

      I'm a themed collapsible with a themed content

      +

      I have data-content-theme attribute set manually on my container to set the color to match the content block I'm in.

      +
      +
      + +

      C theme swatch on content & collapsible

      +
      +

      H1 Heading

      +

      This is a paragraph that contains strong, emphasized and linked text. Here is more text so you can see how HTML markup works in content. Here is more text so you can see how HTML markup works in content.

      +
      +

      I'm a themed collapsible

      +

      I have data-theme attribute set manually on my container to set the color to match the content block I'm in.

      +
      +
      +

      I'm a themed collapsible with a themed content

      +

      I have data-content-theme attribute set manually on my container to set the color to match the content block I'm in.

      +
      +
      + +

      D theme swatch on content & collapsible

      +
      +

      H1 Heading

      +

      This is a paragraph that contains strong, emphasized and linked text. Here is more text so you can see how HTML markup works in content. Here is more text so you can see how HTML markup works in content.

      +
      +

      I'm a themed collapsible

      +

      I have data-theme attribute set manually on my container to set the color to match the content block I'm in.

      +
      +
      +

      I'm a themed collapsible with a themed content

      +

      I have data-content-theme attribute set manually on my container to set the color to match the content block I'm in.

      +
      +
      + +

      E theme swatch on content & collapsible

      +
      +

      H1 Heading

      +

      This is a paragraph that contains strong, emphasized and linked text. Here is more text so you can see how HTML markup works in content. Here is more text so you can see how HTML markup works in content.

      +
      +

      I'm a themed collapsible

      +

      I have data-theme attribute set manually on my container to set the color to match the content block I'm in.

      +
      +
      +

      I'm a themed collapsible with a themed content

      +

      I have data-content-theme attribute set manually on my container to set the color to match the content block I'm in.

      +
      +
      + + +
      + +
      + +
      + +

      More in this section

      + + +
      +
      + +
      + + + +
      + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/content/index.html b/libs/js/jquery-mobile-1.1.0/docs/content/index.html new file mode 100644 index 0000000..1854e03 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/content/index.html @@ -0,0 +1,45 @@ + + + + + + jQuery Mobile Docs - Content formatting + + + + + + + + + + +
      + +
      +

      Content formatting

      + Home + Search +
      + +
      + +

      The content of pages in jQuery Mobile is completely open-ended, but the jQuery Mobile framework provides a number of helpful tools and widgets — such as collapsible panels and multiple-column grid layouts — to make it easy to format your content for mobile devices.

      + + + + + + +
      +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/forms/checkboxes/events.html b/libs/js/jquery-mobile-1.1.0/docs/forms/checkboxes/events.html new file mode 100644 index 0000000..388bc06 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/forms/checkboxes/events.html @@ -0,0 +1,104 @@ + + + + + + jQuery Mobile Docs - Checkboxes + + + + + + + + + + +
      + +
      +

      Checkboxes

      + Home + Search +
      + +
      +
      + +
      + +

      Checkboxes

      + + + +

      Bind events directly to the input element. Use jQuery Mobile's virtual events, or bind standard JavaScript events, like change, focus, blur, etc.:

      +
       
      +$("input[type='checkbox']").bind( "change", function(event, ui) {
      +  ...
      +});
      +
      + +

      The checkbox plugin has the following custom events:

      + +
      + +
      create triggered when a checkbox is created
      +
      + +
      
      +$("input[type='checkbox']").checkboxradio({
      +   create: function(event, ui) { ... }
      +});		
      +			
      +
      + + +
      + +
      +
      + + + +
      + + + +
      + + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/forms/checkboxes/index.html b/libs/js/jquery-mobile-1.1.0/docs/forms/checkboxes/index.html new file mode 100644 index 0000000..94a9b11 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/forms/checkboxes/index.html @@ -0,0 +1,189 @@ + + + + + + jQuery Mobile Docs - Checkboxes + + + + + + + + + + +
      + +
      +

      Checkboxes

      + Home + Search +
      + +
      +
      + +
      + +

      Checkboxes

      + + + +

      Checkboxes are used to provide a list of options where more than one can be selected. Traditional desktop checkboxes are not optimized for touch input so in jQuery Mobile, we style the label for the checkboxes so they are larger and look clickable. A custom set of icons are added to the label to provide additional visual feedback.

      + +

      Both the radio and checkbox controls below use standard input/label markup, but are styled to be more touch-friendly. The styled control you see is actually the label element, which sits over the real input, so if images fail to load, you'll still have a functional control. In most browsers, clicking the label automatically triggers a click on the input, but we've had to trigger the update manually for a few mobile browsers that don't do this natively. On the desktop, these controls are keyboard and screen-reader accessible. View the data- attribute reference to see all the possible attributes you can add to checkboxes.

      + +

      To create a single checkbox, add an input with a type="checkbox" attribute and a corresponding label. If the input isn’t wrapped in its corresponding label, be sure to set the for attribute of the label to match the ID of the input so they are semantically associated.

      + +
      	
      +<label><input type="checkbox" name="checkbox-1" /> I agree </label>
      +			
      +<input type="checkbox" name="checkbox-0" id="checkbox-0" class="custom" />
      +<label for="checkbox-0">I agree</label>
      +		
      + +

      The above snippets will produce two basic checkboxes. The default styles will set the width of the element to 100% of the parent container.

      + + + + + + + +

      Mini version

      + +

      For a more compact version that is useful in toolbars and tight spaces, add the data-mini="true" attribute to the element to create a mini version.

      + +
      	
      +<input type="checkbox" name="checkbox-0" id="checkbox-mini-0" class="custom" data-mini="true" />
      +<label for="checkbox-mini-0">I agree</label>
      +
      + +

      This will produce a select that is not as tall as the standard version and has a smaller text size.

      + + + + +

      Field containers & Legends

      +

      Because checkboxes use the label element for the text displayed next to the checkbox form element, we recommend wrapping the checkbox in a fieldset element that has a legend which acts as the title for the question. Add the data-role="controlgroup" attribute to the fieldset so it can be styled in a parallel way as text inputs, selects or other form elements.

      + +

      Wrap the fieldset in a div with data-role="fieldcontain" attribute so it can be styled in a parallel way as text inputs, selects or other form elements.

      + + +
      	
      +<div data-role="fieldcontain">
      +    <fieldset data-role="controlgroup">
      +	   <legend>Agree to the terms:</legend>
      +	   <input type="checkbox" name="checkbox-1" id="checkbox-1" class="custom" />
      +	   <label for="checkbox-1">I agree</label>
      +    </fieldset>
      +</div>
      +
      + +
      +
      + Agree to the terms: + + +
      +
      + + + +

      Vertically grouped checkboxes

      + +

      Typically, there are multiple checkboxes listed under a question title. To visually integrate multiple checkboxes into a grouped button set, the framework will automatically remove all margins between buttons and round only the top and bottom corners of the set if there is a data-role="controlgroup" attribute on the fie.

      + +
      +
      + Choose as many snacks as you'd like: + + + + + + + + + + + +
      +
      + +

      Horizontal toggle sets

      + +

      Checkboxes can also be used for grouped button sets where more than one button can be selected at once, such as the bold, italic and underline button group seen in word processors. To make a horizontal button set, add the data-type="horizontal" to the fieldset.

      + + +<fieldset data-role="controlgroup" data-type="horizontal"> + + +

      The framework will float the labels so they sit side-by-side on a line, hide the checkbox icons and only round the left and right edges of the group.

      + +
      +
      + Font styling: + + + + + + + + +
      +
      + + + + +
      + +
      + + + +
      + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/forms/checkboxes/methods.html b/libs/js/jquery-mobile-1.1.0/docs/forms/checkboxes/methods.html new file mode 100644 index 0000000..ad1947d --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/forms/checkboxes/methods.html @@ -0,0 +1,108 @@ + + + + + + jQuery Mobile Docs - Checkboxes + + + + + + + + + + +
      + +
      +

      Checkboxes

      + Home + Search +
      + +
      +
      + +
      + +

      Checkboxes

      + + + +

      The checkbox has the following methods:

      + +
      + +
      enable enable a disabled checkbox
      +
      +
      
      + $("input[type='checkbox']").checkboxradio('enable');
      +				
      +
      + +
      disable disable a select.
      +
      +
      
      +$("input[type='checkbox']").checkboxradio('disable');
      +				
      +
      + +
      refresh update the custom select
      +
      + If you manipulate a checkbox via JavaScript, you must call the refresh method on it to update the visual styling. +
      
      +$("input[type='checkbox']:first").attr("checked",true).checkboxradio("refresh");
      +				
      +
      + +
      + +
      +
      + + + +
      + + + +
      + + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/forms/checkboxes/options.html b/libs/js/jquery-mobile-1.1.0/docs/forms/checkboxes/options.html new file mode 100644 index 0000000..2af0192 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/forms/checkboxes/options.html @@ -0,0 +1,98 @@ + + + + + + jQuery Mobile Docs - Checkboxes + + + + + + + + + + +
      + +
      +

      Checkboxes

      + Home + Search +
      + +
      +
      + +
      + +

      Checkboxes

      + + + +

      The checkbox has the following options:

      + +
      +
      mini boolean
      +
      +

      default: false

      +

      Sets the size of the element to a more compact, mini version. This option is also exposed as a data attribute: data-mini="true"

      +
      $("input[type='checkbox']").checkboxradio({ mini: "true" });
      +
      +
      theme string
      +
      +

      default: null, inherited from parent

      +

      Sets the color scheme (swatch) for all instances of this widget. It accepts a single letter from a-z that maps to the swatches included in your theme. By default, it will inherit the same swatch color as it's parent container if not explicitly set. This option is also exposed as a data attribute: data-theme="a"

      +
      $("input[type='checkbox']").checkboxradio({ theme: "a" });
      +
      + +
      + +
      +
      + + + +
      + + + +
      + + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/forms/docs-forms.html b/libs/js/jquery-mobile-1.1.0/docs/forms/docs-forms.html new file mode 100644 index 0000000..a342942 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/forms/docs-forms.html @@ -0,0 +1,267 @@ + + + + + + jQuery Mobile Docs - Forms + + + + + + + + + + +
      + +
      +

      Forms

      + Home + Search +
      + +
      +
      +

      jQuery Mobile provides a complete set of finger-friendly form elements that are based on native HTML form elements.

      + +

      Form structure

      + +

      All forms should be wrapped in a form tag that has an action and method that will handle the form data processing on the server.

      + + +<form action="form.php" method="post"> +... +</form> + + + +

      Markup conventions

      +

      When constructing forms to be used in jQuery Mobile, most of the standard guidelines used to create forms that submit via ordinary HTTP POST or GET still apply. Additionally, the id attributes of form controls need to be not only unique on a given page, but also unique across the pages in a site. This is because jQuery Mobile's single-page navigation model allows many different "pages" to be present in the DOM at the same time. You must be careful to use unique id attributes so there will be only one of each in the DOM. Be sure to pair them properly with label elements via the for attribute.

      + +

      Mini sized elements

      + +

      For a more compact version of all form elements and buttons, add the data-mini="true" attribute to the element to create a mini version. This is useful in toolbars and tight spaces but is still finger-friendly. It's possible to add this attribute to a fieldcontainer to set this on a number of elements at once.

      + +
      
      +<label for="basic">Text Input:</label>
      +<input type="text" name="name" id="basic" data-mini="true" />
      +	
      + +

      This will produce an input that is not as tall as the standard version and has a smaller text size.

      + + + +

      Hiding labels accessibly

      +

      For the sake of accessibility, jQuery Mobile requires that all form elements be paired with a meaningful label. To hide labels in a way that leaves them visible to assistive technologies—for example, when letting an element’s placeholder attribute serve as a label—apply the helper class ui-hidden-accessible to the label itself:

      + +
      +<label for="username" class="ui-hidden-accessible">Username:</label>
      +<input type="text" name="username" id="username" value="" placeholder="Username"/>
      +
      +
      + +

      To hide labels within a field container and adjust the layout accordingly, add the class ui-hide-label to the field container as in the following:

      + + +
      +<div data-role="fieldcontain" class="ui-hide-label">
      +	<label for="username">Username:</label>
      +	<input type="text" name="username" id="username" value="" placeholder="Username"/>
      +</div>
      +
      +
      + +

      Both of the above examples will render as:

      +
      + + +
      + +

      While the label will no longer be visible, it will be available to assisitive technologies such as screen readers.

      + + +

      Disabling form elements

      +

      All jQuery Mobile widgets can be disabled in the markup by adding the standard disabled attribute to the element, just like you would with native controls. Each form widget also has standard disable and enable methods that are documented with each form widget. Here are a few examples of disabled widgets:

      + +
      + + +
      + +
      +
      + Gender: + + + + + +
      +
      + +
      + + +
      + +
      + + +
      + +
      + + +
      + +

      Note that you can disable buttons created from button or input-based markup, but not links with a role of button. Links don't have a parallel disabled feature in HTML, but if you need to disable a link-based button (or any element), it's possible to apply the disabled class ui-disabled yourself with JavaScript to achieve the same effect.

      + +

      Field containers

      +

      To improve the styling of labels and form elements on wider screens, wrap a div or fieldset with the data-role="fieldcontain" attribute around each label/form element. This framework aligns the input and associated label side-by-side, and breaks to stacked block-level elements below ~480px. The framework will also add a thin bottom border to act as a field separator.

      + +

      Forms in toolbars

      +

      While all form elements are now tested to work correctly within static toolbars as of jQuery Mobile 1.1, we recommend extensive testing when using form elements within fixed toolbars or within any position: fixed elements. This can potentially trigger a number of unpredictable issues in various mobile browsers, Android 2.2/2.3 in particular (detailed in Known issues in Android 2.2/2.3).

      + +

      For example:

      +
      
      +<div data-role="fieldcontain">
      +<label for="name">Text Input:</label>
      +<input type="text" name="name" id="name" value="" />
      +</div>
      +
      + +

      Will render as:

      + +
      + + +
      + +

      For additional examples, see the form elements gallery

      + + +

      Auto-initialization of form elements

      +

      By default, jQuery Mobile will automatically enhance certain native form controls into rich touch-friendly components. This is handled internally by finding form elements by tag name and running a plugin method on them. For instance, a select element will be found and initialized with the "selectmenu" plugin, while an input element with a type="checkbox" will be enhanced with the "checkboxradio" plugin. Once initialized, you can address these enhanced components programmatically through their jQuery UI widget API methods. See options, methods, and events listed on each form plugin's documentation page for details.

      + +

      Initializing groups of dynamically-injected form elements

      +

      If you should generate new markup client-side or load in content via AJAX and inject it into a page, you can trigger the create event to handle the auto-initialization for all the plugins contained within the new markup. This can be triggered on any element (even the page div itself), saving you the task of manually initializing each plugin (see below).

      + +

      For example, if a block of HTML markup (say a login form) was loaded in through Ajax, trigger the create event to automatically transform all the widgets it contains (inputs and buttons in this case) into the enhanced versions. The code for this scenario would be:

      + + + $( ...new markup that contains widgets... ).appendTo( ".ui-page" ).trigger( "create" ); + + +

      Refreshing form elements

      + +

      In jQuery Mobile, some enhanced form controls are simply styled (inputs), but others are custom controls (selects, sliders) built from, and kept in sync with, the native control. To programmatically update a form control with JavaScript, first manipulate the native control, then use the refresh method to tell the enhanced control to update itself to match the new state. Here are some examples of how to update common form controls, then call the refresh method:

      +

      Checkboxes:

      + + +$("input[type='checkbox']").prop("checked",true).checkboxradio("refresh"); + + +

      Radios:

      + +$("input[type='radio']").prop("checked",true).checkboxradio("refresh"); + + +

      Selects:

      +
      +var myselect = $("#selectfoo");
      +myselect[0].selectedIndex = 3;
      +myselect.selectmenu("refresh");
      +
      + +

      Sliders:

      + +$("input[type='range']").val(60).slider("refresh"); + + +

      Flip switches (they use slider):

      + +
      +var myswitch = $("#selectbar");
      +myswitch[0].selectedIndex = 1;
      +myswitch.slider("refresh");
      +
      + +

      Preventing auto-initialization of form elements

      +

      If you'd prefer that a particular form control be left untouched by jQuery Mobile, simply give that element the attribute data-role="none". For example:

      +
      
      +<label for="foo">
      +<select name="foo" id="foo"  data-role="none">
      +	<option value="a" >A</option>
      +	<option value="b" >B</option>
      +	<option value="c" >C</option>
      +</select>
      +
      + + +

      If you'd like to prevent auto-initialization without adding attributes to your markup, you can customize the selector that is used for preventing auto-initialization by setting the page plugin's keepNative option (which defaults to [data-role="none"]). Be sure to configure this option inside an event handler bound to the mobileinit event, so that it applies to the first page as well as subsequent pages that are loaded.

      +
      
      +$(document).bind('mobileinit',function(){
      +	$.mobile.page.prototype.options.keepNative = "select, input.foo, textarea.bar";
      +});
      +		
      + +

      Alternately you can use the data-enhance="false" data attribute on a parent element with $.mobile.ignoreContentEnabled set to true. Beware though, this will incur a performance penalty for each and every element in the page that would otherwise be enhanced as jQuery Mobile must traverse the set of parents to look for those elements.

      + +

      One special case is that of selects. The above sample will prevent any and all augmentation from taking place on select elements in the page if select is included. If you wish to retain the native performance and appearance of the menu itself and benefit from the visual augmentation of the select button by jQuery Mobile, you can set $.mobile.selectmenu.prototype.options.nativeMenu to true in a mobileinit callback as a global setting or use data-native-menu="true" on a case by case basis.

      + + +

      File Inputs

      +

      Using a multipart form with a file input is not supported by ajax. In this case you should decorate the parent form with data-ajax="false" to ensure the form is submitted properly to the server.

      + + +
      + + + +
      + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/forms/forms-all-compare.html b/libs/js/jquery-mobile-1.1.0/docs/forms/forms-all-compare.html new file mode 100644 index 0000000..6e4dafb --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/forms/forms-all-compare.html @@ -0,0 +1,263 @@ + + + + + + jQuery Mobile Docs - Form element size comparison + + + + + + + + + + +
      + +
      +

      Form sizes

      + Home + Search +
      + +
      +
      + +
      + +

      Form size comparison

      + +

      All form controls accept a data-mini="true" attribute that renders a smaller version of the enhanced element. In the case of grouped buttons, the data-mini="true" attribute can be added to the containing controlgroup.

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Search

      + + + + + +

      Text

      + + + + + +

      Textarea

      + + + + + +

      Switch

      + + + + + +

      Slider

      + + + + + +

      Select

      + + + + + +

      Checkbox

      +
      + + + + + + +
      +
      +
      + + + + + + +
      +

      Checkbox

      +
      + + + + + + +
      +
      +
      + + + + + + +
      +

      Radio buttons

      +
      + + + + + + +
      +
      +
      + + + + + + +
      +

      Radio toggle

      +
      + + + + +
      +
      +
      + + + + +
      +

      Radio toggle

      + + + +
      + +
      +
      + + + +
      + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/forms/forms-all-mini.html b/libs/js/jquery-mobile-1.1.0/docs/forms/forms-all-mini.html new file mode 100644 index 0000000..b838066 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/forms/forms-all-mini.html @@ -0,0 +1,245 @@ + + + + + + jQuery Mobile Docs - Gallery of Form Controls + + + + + + + + + + +
      + +
      +

      Mini forms

      + Home + Search +
      + +
      +
      + +
      + +

      Mini form elements

      + +

      All form controls accept a data-mini="true" attribute that renders a smaller version of the standard-sized form elements. In the case of grouped buttons, the data-mini="true" attribute can be added to the containing controlgroup. Compare mini and normal form elements side-by-side.

      + +
      + + +
      + +
      + + +
      + +
      + + +
      + +
      + + +
      + +
      + + +
      + +
      +
      + Choose as many snacks as you'd like: + + + + + + + + + + + +
      +
      + +
      +
      + Font styling: + + + + + + + + +
      +
      + +
      +
      + Choose a pet: + + + + + + + + + + + +
      +
      + +
      +
      + Layout view: + + + + + + +
      +
      + +
      + + +
      + +
      + + +
      + +
      + + +
      + +
      +
      +
      +
      +
      +
      +
      +
      + + + +
      + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/forms/forms-all-native.html b/libs/js/jquery-mobile-1.1.0/docs/forms/forms-all-native.html new file mode 100644 index 0000000..726be46 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/forms/forms-all-native.html @@ -0,0 +1,250 @@ + + + + + + jQuery Mobile Docs - Native Form Controls + + + + + + + + + + +
      + +
      +

      Forms

      + Home + Search +
      + +
      +
      + +
      + +

      Native form elements & buttons

      + +

      Although the framework automatically enhances form elements and buttons into touch input optimized controls to streamline development, it's easy to tell jQuery Mobile to leave these elements alone so the standard, native control can be used instead.

      +

      Adding the data-role="none" attribute to any form or button element tells the framework to not apply any enhanced styles or scripting. The examples below all have this attribute in place to demonstrate the effect. You may need to write custom styles to lay out your form controls because we try to leave all the default styling intact.

      + +
      + + +
      + +
      + + +
      + +
      + + +
      + +
      + + +
      + +
      + + +
      + +
      +
      + Choose as many snacks as you'd like: + + + + + + + + + + + +
      +
      + +
      +
      + Font styling: + + + + + + + + +
      +
      + +
      +
      + Choose a pet: + + + + + + + + + + + +
      +
      + +
      +
      + Layout view: + + + + + + +
      +
      + +
      + + +
      + +
      + + +
      + + + + +

      Button based button:

      + + +

      Input type="button" based button:

      + + +

      Input type="submit" based button:

      + + +

      Input type="reset" based button:

      + + +

      Input type="image" based button:

      + + +
      + +
      + + + +
      + + + +
      + + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/forms/forms-all.html b/libs/js/jquery-mobile-1.1.0/docs/forms/forms-all.html new file mode 100644 index 0000000..8749ead --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/forms/forms-all.html @@ -0,0 +1,247 @@ + + + + + + jQuery Mobile Docs - Gallery of Form Controls + + + + + + + + + + +
      + +
      +

      Forms

      + Home + Search +
      + +
      +
      + +
      + +

      Form elements

      + +

      This page contains various progressive-enhancement driven form controls. Native elements are sometimes hidden from view, but their values are maintained so the form can be submitted normally. Browsers that don't support the custom controls will still deliver a usable experience because all are based on native form elements.

      + +

      There is a complete set of mini-sized form elements which are useful for toolbars or tighter spaces. Compare mini and normal form elements side-by-side.

      + +
      + + +
      + +
      + + +
      + +
      + + +
      + +
      + + +
      + +
      + + +
      + +
      +
      + Choose as many snacks as you'd like: + + + + + + + + + + + +
      +
      + +
      +
      + Font styling: + + + + + + + + +
      +
      + +
      +
      + Choose a pet: + + + + + + + + + + + +
      +
      + +
      +
      + Layout view: + + + + + + +
      +
      + +
      + + +
      + +
      + + +
      + +
      + + +
      + +
      +
      +
      +
      +
      +
      +
      +
      + + + +
      + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/forms/forms-sample-response.php b/libs/js/jquery-mobile-1.1.0/docs/forms/forms-sample-response.php new file mode 100755 index 0000000..0a4fce6 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/forms/forms-sample-response.php @@ -0,0 +1,81 @@ + + + + + + jQuery Mobile Docs - Sample form response + + + + + + + + + +
      + +
      +

      Sample form response

      + Home + Search +
      + +
      +
      + +
      + +

      You Chose:

      + +
      + + " . $_REQUEST['shipping'] . "

      "; + ?> + +
      + + Change shipping method + +
      + +
      + + + +
      + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/forms/forms-sample-selfsubmit.php b/libs/js/jquery-mobile-1.1.0/docs/forms/forms-sample-selfsubmit.php new file mode 100755 index 0000000..440097e --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/forms/forms-sample-selfsubmit.php @@ -0,0 +1,80 @@ + + + + + + jQuery Mobile Docs - Sample Form Submit to Self + + + + + + + + + +
      + +
      +

      Sample form submit to self

      + Home + Search +
      + +
      +
      + +
      + +
      + Testing +
      + + /> + /> +
      +
      + +
      + + + +
      + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/forms/forms-sample.html b/libs/js/jquery-mobile-1.1.0/docs/forms/forms-sample.html new file mode 100644 index 0000000..4c1291e --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/forms/forms-sample.html @@ -0,0 +1,114 @@ + + + + + + jQuery Mobile Docs - Sample Form Submit + + + + + + + + + + +
      + +
      +

      Forms

      + Home + Search +
      + +
      +
      + +

      Ajax form submission

      + +

      In jQuery Mobile, form submissions are automatically handled using Ajax whenever possible, creating a smooth transition between the form and the result page. To ensure your form submits as intended, be sure to specify action and method properties on your form element. When unspecified, the method will default to get, and the action will default to the current page's relative path (found via $.mobile.path.get())

      +

      Forms also accept attributes for transitions just like anchors, such as data-transition="pop" and data-direction="reverse". To submit a form without Ajax, you can either disable Ajax form handling globally, or per form via the data-ajax="false" attribute. The target attribute (as in target="_blank") is respected on forms as well, and will default to the browser's handling of that target when the form submits. Note that unlike anchors, the rel attribute is not allowed on forms.

      + + +

      Default Ajax form example

      +

      This demonstrates automated ajax handling of form submissions. The form below is configured to send a GET request to forms-sample-response.php. On submit, jQuery Mobile will make sure that the Url specified is able to be retrieved via Ajax, and handle it appropriately. Keep in mind that just like ordinary HTTP form submissions, jQuery Mobile allows GET result pages to be bookmarked by updating the URL hash when the response returns successfully. Also like ordinary form submissions, POST requests do not contain query parameters in the hash, so they are not bookmarkable.

      +
      +
      +
      + + +
      + +
      +
      + +

      Non-Ajax form example

      + +

      To prevent form submissions from being automatically handled with Ajax, add the data-ajax="false" attribute to the form element. You can also turn off Ajax form handling completely via the ajaxEnabled global config option.

      + +

      The form below is identical to the one above except for the addition of the data-ajax="false" attribute. When the submit button is pressed, it will result in a full page refresh.

      +
      +
      +
      + + +
      + +
      +
      + +

      Self-submitting Forms

      +

      You can submit forms to the same URL you're currently viewing by setting the form's action attribute to that URL. This page demonstrates.

      +

      When a POST request is submitted to a page that's already in the DOM (which would commonly happen when submitting a form to the same URL currently in view), the response URL will be identical to that existing page, as POST requests do not append query string parameters to the URL. In this situation, jQuery Mobile will replace the page that submitted the form with the page returned in the response body.

      + +
      + + + +
      + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/forms/forms-themes.html b/libs/js/jquery-mobile-1.1.0/docs/forms/forms-themes.html new file mode 100644 index 0000000..4a1df74 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/forms/forms-themes.html @@ -0,0 +1,408 @@ + + + + + + jQuery Mobile Docs - Theming Forms + + + + + + + + + + +
      + +
      +

      Theming forms

      + Home + Search +
      + +
      +
      + +

      Form themes

      +

      jQuery Mobile has a rich theming system that gives you full control of how pages and forms are styled. By default all form elements inside a container will automatically adopt the same theme color swatch as their parent. This allows form elements to blend into their layouts with minimal work. The data-theme attribute can be applied to any individual form element to apply any of the lettered theme color swatches to create contrast and emphasis in your designs.

      + +

      All the form elements in the examples below use the same HTML code with no theme swatch specified on the individual form elements. The only difference between each example block code is a data-theme swatch color assigned to each parent container. This illustrates the way form elements automatically adopt the theme swatch of their parent.

      + + +

      Body swatch A

      +
      + +
      + + +
      + +
      + + +
      + +
      + + +
      + + +
      +
      + Font styling: + + + + + + + + +
      +
      + +
      +
      + Choose a pet: + + + + + + + + + + + +
      +
      + +
      + + +
      + +
      + +

      Body swatch B

      +
      + +
      + + +
      + +
      + + +
      + +
      + + +
      + + +
      +
      + Font styling: + + + + + + + + +
      +
      + +
      +
      + Choose a pet: + + + + + + + + + + + +
      +
      + +
      + + +
      + + +
      + + +

      Body swatch C

      +
      + +
      + + +
      + +
      + + +
      + +
      + + +
      + + +
      +
      + Font styling: + + + + + + + + +
      +
      + +
      +
      + Choose a pet: + + + + + + + + + + + +
      +
      + +
      + + +
      + + +
      + + + +

      Body swatch D

      +
      + +
      + + +
      + +
      + + +
      + +
      + + +
      + + +
      +
      + Font styling: + + + + + + + + +
      +
      + +
      +
      + Choose a pet: + + + + + + + + + + + +
      +
      + +
      + + +
      + + +
      + + +

      Body swatch E

      +
      + +
      + + +
      + +
      + + +
      + +
      + + +
      + + +
      +
      + Font styling: + + + + + + + + +
      +
      + +
      +
      + Choose a pet: + + + + + + + + + + + +
      +
      + +
      + + +
      + + +
      + + + +
      + + + +
      + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/forms/index.html b/libs/js/jquery-mobile-1.1.0/docs/forms/index.html new file mode 100644 index 0000000..23f75b8 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/forms/index.html @@ -0,0 +1,50 @@ + + + + + + jQuery Mobile Docs - Forms + + + + + + + + + + +
      + +
      +

      Form elements

      + Home + Search +
      + +
      + +

      All form elements begin with standard HTML controls that are enhanced to make them more attractive and easy to use. In browsers that don't support the custom controls, they will still have a usable experience because these are all based on native form elements.

      + + + +
      +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/forms/plugin-eventsmethods.html b/libs/js/jquery-mobile-1.1.0/docs/forms/plugin-eventsmethods.html new file mode 100644 index 0000000..52c0b4d --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/forms/plugin-eventsmethods.html @@ -0,0 +1,73 @@ + + + + + + jQuery Mobile Docs - Form Plugin Methods + + + + + + + + + + +
      + +
      +

      Form Plugin Methods

      + Home + Search +
      + +
      +
      + +
      +

      We've retired this page.

      + +

      Plugin events and methods are now documented separately for each component (see links on the left).

      +
      + + + +
      + + + +
      + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/forms/radiobuttons/events.html b/libs/js/jquery-mobile-1.1.0/docs/forms/radiobuttons/events.html new file mode 100644 index 0000000..b721f44 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/forms/radiobuttons/events.html @@ -0,0 +1,106 @@ + + + + + + jQuery Mobile Docs - Radio buttons + + + + + + + + + + +
      + +
      +

      Radio buttons

      + Home + Search +
      + +
      +
      + +
      + +

      Radio buttons

      + + + + +

      Bind events directly to the input element. Use jQuery Mobile's virtual events, or bind standard JavaScript events, like change, focus, blur, etc.:

      +
       
      +$("input[type='radio']").bind( "change", function(event, ui) {
      +  ...
      +});
      +
      + +

      The radio button plugin has the following custom events:

      + +
      + +
      create triggered when a radio button is created
      +
      + + +
      
      +$("input[type='radio']").checkboxradio({
      +   create: function(event, ui) { ... }
      +});		
      +			
      +
      + + +
      + +
      +
      + + + +
      + + + +
      + + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/forms/radiobuttons/index.html b/libs/js/jquery-mobile-1.1.0/docs/forms/radiobuttons/index.html new file mode 100644 index 0000000..a3f9532 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/forms/radiobuttons/index.html @@ -0,0 +1,225 @@ + + + + + + jQuery Mobile Docs - Radio Buttons + + + + + + + + + + +
      + +
      +

      Radio buttons

      + Home + Search +
      + +
      +
      + +
      + +

      Radio buttons

      + + + +

      Radio buttons are used to provide a list of options where only a single item can be selected. Traditional desktop radio buttons are not optimized for touch input so jQuery Mobile styles the label for the radio buttons so they are larger and look clickable. A custom set of icons are added to the label to provide additional visual feedback.

      + +

      Both the radio and checkbox controls below use standard input/label markup, but are styled to be more touch-friendly. The styled control you see is actually the label element, which sits over the real input, so if images fail to load, you'll still have a functional control. In most browsers, clicking the label automatically triggers a click on the input, but we've had to trigger the update manually for a few mobile browsers that don't do this natively. On the desktop, these controls are keyboard and screen-reader accessible. View the data- attribute reference to see all the possible attributes you can add to radio buttons.

      + +

      Vertically grouped radio buttons

      + +

      To create a set of radio buttons, add an input with a type="radio" attribute and a corresponding label. Set the for attribute of the label to match the ID of the input so they are semantically associated.

      + +

      The label element is displayed next to the radio form element. Wrap the radio buttons in a fieldset element that has a legend which acts as the title for the question.

      + +

      To visually integrate multiple radio buttons into a vertically grouped button set, the framework will automatically remove all margins between buttons and round only the top and bottom corners of the set if there is a data-role="controlgroup" attribute on the container.

      + +
      	
      +<fieldset data-role="controlgroup">
      +	<legend>Choose a pet:</legend>
      +     	<input type="radio" name="radio-choice-1" id="radio-choice-1" value="choice-1" checked="checked" />
      +     	<label for="radio-choice-1">Cat</label>
      +
      +     	<input type="radio" name="radio-choice-1" id="radio-choice-2" value="choice-2"  />
      +     	<label for="radio-choice-2">Dog</label>
      +
      +     	<input type="radio" name="radio-choice-1" id="radio-choice-3" value="choice-3"  />
      +     	<label for="radio-choice-3">Hamster</label>
      +
      +     	<input type="radio" name="radio-choice-1" id="radio-choice-4" value="choice-4"  />
      +     	<label for="radio-choice-4">Lizard</label>
      +</fieldset>
      +
      + + +

      This will produce a vertically grouped radio button set. The default styles set the width of the button group to 100% of the parent container and stacks the label on a separate line.

      + + +
      + Choose a pet: + + + + + + + + + + + +
      + +

      Mini version

      + +

      For a more compact version that is useful in toolbars and tight spaces, add the data-mini="true" attribute to the element to create a mini version.

      + +
      			
      +<fieldset data-role="controlgroup" data-mini="true">
      +
      +    	<input type="radio" name="radio-choice-1" id="radio-mini-1" value="choice-1" checked="checked" />
      +
      +    	<label for="radio-mini-1">Credit</label>
      +    	<input type="radio" name="radio-choice-1" id="radio-mini-2" value="choice-2"  />
      +
      +    	<label for="radio-mini-2">Debit</label>
      +    	<input type="radio" name="radio-choice-1" id="radio-mini-3" value="choice-3"  />
      +
      +    	<label for="radio-mini-3">Cash</label>
      +</fieldset>
      +
      + +

      This will produce a radio button that is not as tall as the standard version and has a smaller text size.

      + +
      + + + + + + +
      + +

      Field containers

      + +

      Optionally wrap the radiobuttons in a container with the data-role="fieldcontain" attribute to help visually group it in a longer form.

      +
      	
      +<div data-role="fieldcontain">
      +    <fieldset data-role="controlgroup">
      +    	<legend>Choose a pet:</legend>
      +         	<input type="radio" name="radio-choice-1" id="radio-choice-1" value="choice-1" checked="checked" />
      +         	<label for="radio-choice-1">Cat</label>
      +
      +         	<input type="radio" name="radio-choice-1" id="radio-choice-2" value="choice-2"  />
      +         	<label for="radio-choice-2">Dog</label>
      +
      +         	<input type="radio" name="radio-choice-1" id="radio-choice-3" value="choice-3"  />
      +         	<label for="radio-choice-3">Hamster</label>
      +
      +         	<input type="radio" name="radio-choice-1" id="radio-choice-4" value="choice-4"  />
      +         	<label for="radio-choice-4">Lizard</label>
      +    </fieldset>
      +</div>
      +	
      + + +

      To visually integrate multiple radio buttons into a vertically grouped button set, the framework will automatically remove all margins between buttons and round only the top and bottom corners of the set if there is a data-role="controlgroup" attribute on the container.

      + +
      +
      + Choose a pet: + + + + + + + + + + + +
      +
      +

      Horizontal radio button sets

      + +

      Radio buttons can also be used for grouped button sets where only a single button can be selected at once, such as a view switcher control. To make a horizontal radio button set, add the data-type="horizontal" to the fieldset.

      + + + <fieldset data-role="controlgroup" data-type="horizontal" > + + +
      +
      + Layout view: + + + + + + +
      +
      + +

      The labels float so they sit side-by-side on a line. The radio button icons are hidden and only the left and right edges of the group are rounded.

      + + + + + + +
      + +
      + + + +
      + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/forms/radiobuttons/methods.html b/libs/js/jquery-mobile-1.1.0/docs/forms/radiobuttons/methods.html new file mode 100644 index 0000000..2037a2f --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/forms/radiobuttons/methods.html @@ -0,0 +1,108 @@ + + + + + + jQuery Mobile Docs - Radio buttons + + + + + + + + + + +
      + +
      +

      Radio buttons

      + Home + Search +
      + +
      +
      + +
      + +

      Radio buttons

      + + + +

      The radio button has the following methods:

      + +
      + +
      enable enable a disabled radio button
      +
      +
      
      + $("input[type='radio']").checkboxradio('enable');
      +				
      +
      + +
      disable disable a select.
      +
      +
      
      +$("input[type='radio']").checkboxradio('disable');
      +				
      +
      + +
      refresh update the custom select
      +
      + If you manipulate a radio button via JavaScript, you must call the refresh method on it to update the visual styling. +
      
      +$("input[type='radio']:first").attr("checked",true).checkboxradio("refresh");
      +				
      +
      + +
      + +
      +
      + + + +
      + + + +
      + + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/forms/radiobuttons/options.html b/libs/js/jquery-mobile-1.1.0/docs/forms/radiobuttons/options.html new file mode 100644 index 0000000..1ab813a --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/forms/radiobuttons/options.html @@ -0,0 +1,98 @@ + + + + + + jQuery Mobile Docs - Radio buttons + + + + + + + + + + +
      + +
      +

      Radio buttons

      + Home + Search +
      + +
      +
      + +
      + +

      Radio buttons

      + + + +

      The radio button has the following options:

      + +
      +
      mini boolean
      +
      +

      default: false

      +

      Sets the size of the element to a more compact, mini version. This option is also exposed as a data attribute: data-mini="true"

      +
      $("input[type='radio']").checkboxradio({ mini: "true" });
      +
      +
      theme string
      +
      +

      default: null, inherited from parent

      +

      Sets the color scheme (swatch) for all instances of this widget. It accepts a single letter from a-z that maps to the swatches included in your theme. By default, it will inherit the same swatch color as it's parent container if not explicitly set. This option is also exposed as a data attribute: data-theme="a"

      +
      $("input[type='radio']").checkboxradio({ theme: "a" });
      +
      + +
      + +
      +
      + + + +
      + + + +
      + + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/forms/search/events.html b/libs/js/jquery-mobile-1.1.0/docs/forms/search/events.html new file mode 100644 index 0000000..d1ab345 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/forms/search/events.html @@ -0,0 +1,103 @@ + + + + + + jQuery Mobile Docs - Search Input events + + + + + + + + + + +
      + +
      +

      Search input

      + Home + Search +
      + +
      +
      + +
      + +

      Search input

      + + + +

      Bind events directly to the input element. Use jQuery Mobile's virtual events, or bind standard JavaScript events, like change, focus, blur, etc.:

      +
       
      +$(".mySearchInput").bind( "change", function(event, ui) {
      +  ...
      +});
      +
      + +

      The text input plugin has the following custom events:

      + +
      + +
      create triggered when a text input is created
      +
      + +
      
      +$( ".selector" ).textinput({
      +   create: function(event, ui) { ... }
      +});		
      +			
      +
      + +
      + +
      +
      + + + +
      + + + +
      + + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/forms/search/index.html b/libs/js/jquery-mobile-1.1.0/docs/forms/search/index.html new file mode 100644 index 0000000..610646b --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/forms/search/index.html @@ -0,0 +1,141 @@ + + + + + + jQuery Mobile Docs - Search input + + + + + + + + + + +
      + +
      +

      Search input

      + Home + Search +
      + +
      +
      + +
      + +

      Search input

      + + + +

      Search inputs are a new HTML type that is styled with pill-shaped corners and adds a "x" icon to clear the field once you start typing. Start with an input with a type="search" attribute in your markup. View the data- attribute reference to see all the possible attributes you can add to search inputs.

      + +

      Set the for attribute of the label to match the ID of the input so they are semantically associated. It's possible to accessibly hide the label if it's not desired in the page layout, but we require that it is present in the markup for semantic and accessibility reasons.

      + +
      	
      +<label for="search-basic">Search Input:</label>
      +<input type="search" name="search" id="searc-basic" value="" />
      +
      + +

      This will produce a basic search input. The default styles set the width of the input to 100% of the parent container and stack the label on a separate line.

      + + + +

      Mini version

      + +

      For a more compact version that is useful in toolbars and tight spaces, add the data-mini="true" attribute to the element to create a mini version.

      + +
      	
      +<label for="search-basic">Search Input:</label>
      +<input type="search" name="search" id="searc-basic" value="" data-mini="true" />
      +
      + +

      This will produce a search input that is not as tall as the standard version and has a smaller text size.

      + + + +

      Field containers

      + +

      Optionally wrap the search input in a container with the data-role="fieldcontain" attribute to help visually group it in a longer form.

      + +
      	
      +<div data-role="fieldcontain">
      +    <label for="search">Search Input:</label>
      +    <input type="search" name="password" id="search" value="" />
      +</div>
      +
      + +

      The search input is now displayed like this:

      +
      + + +
      + +

      Theming

      +

      The data-theme attribute can be added to the search input to set the theme to any swatch letter.

      +
      + + +
      + +

      Setting the clear button text

      +

      The text for the button used to clear the search input of text can be configured for all search inputs by binding to the mobileinit event and setting the $.mobile.textinput.prototype.options.clearSearchButtonText property to a string of your choosing.

      + +

      Calling the textinput plugin

      + +

      This plugin will auto-initialize on any page that contains a text input with the type="search" attribute without any need for a data-role attribute in the markup. However, if needed, you can directly call the textinput plugin on a selector, just like any jQuery plugin:

      +
      
      +$('.mySearchInput').textinput();			
      +
      + + +
      + +
      + + + +
      + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/forms/search/methods.html b/libs/js/jquery-mobile-1.1.0/docs/forms/search/methods.html new file mode 100644 index 0000000..34930af --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/forms/search/methods.html @@ -0,0 +1,100 @@ + + + + + + jQuery Mobile Docs - Search Input methods + + + + + + + + + + +
      + +
      +

      Search input

      + Home + Search +
      + +
      +
      + +
      + +

      Search input

      + + + +

      The text input plugin has the following methods:

      + +
      + +
      enable enable a disabled text input
      +
      +
      
      +$('.selector').textinput('enable');			
      +				
      +
      + +
      disable disable a text input
      +
      +
      
      +$('.selector').textinput('disable');			
      +				
      +
      + +
      + +
      +
      + + + +
      + + + +
      + + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/forms/search/options.html b/libs/js/jquery-mobile-1.1.0/docs/forms/search/options.html new file mode 100644 index 0000000..1357e70 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/forms/search/options.html @@ -0,0 +1,113 @@ + + + + + + jQuery Mobile Docs - Text Search options + + + + + + + + + + +
      + +
      +

      Search input

      + Home + Search +
      + +
      +
      + +
      + +

      Search input

      + + + +

      The text input plugin has the following options:

      + +
      +
      initSelector CSS selector string
      +
      +

      default: "input[type='text'], input[type='search'], :jqmData(type='search'), input[type='number'], :jqmData(type='number'), input[type='password'], input[type='email'], input[type='url'], input[type='tel'], textarea, input:not([type])"

      +

      This is used to define the selectors (element types, data roles, etc.) that will automatically be initialized as textinputs. To change which elements are initialized, bind this option to the mobileinit event:

      +
      $( document ).bind( "mobileinit", function(){
      +   $.mobile.textinput.prototype.options.initSelector = ".myInputs";
      +});
      +
      +
      +
      mini boolean
      +
      +

      default: false

      +

      Sets the size of the element to a more compact, mini version. This option is also exposed as a data attribute: data-mini="true"

      +
      $('.selector').textinput({ mini: "true" });
      +
      theme string
      +
      +

      default: null, inherited from parent

      +

      Sets the color scheme (swatch) for all instances of this widget. It accepts a single letter from a-z that maps to the swatches included in your theme. By default, it will inherit the same swatch color as it's parent container if not explicitly set. This option is also exposed as a data attribute: data-theme="a"

      +
      $('.selector').textinput({ theme: "a" });
      +
      + +
      clearSearchButtonText string
      +
      +

      default: "clear text"

      +

      Sets the text used for the button that clears the search input of text.

      +
      $('.selector').textinput({ clearSearchButtonText: "custom value" });
      +
      + +
      + +
      +
      + + + +
      + + + +
      + + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/forms/selects/custom.html b/libs/js/jquery-mobile-1.1.0/docs/forms/selects/custom.html new file mode 100644 index 0000000..fcfe9a2 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/forms/selects/custom.html @@ -0,0 +1,424 @@ + + + + + + jQuery Mobile Docs - Select + + + + + + + + + + +
      + +
      +

      Select Menus

      + Home + Search +
      + +
      +
      + +

      Select menus

      + + + +

      Custom select menus

      +

      The framework is capable of building a custom menu based on the select element's list of options. We recommend using a custom menu when multiple selections are required, or when the menu itself must be styled with CSS.

      + +

      You can optionally use custom-styled select menus instead of the native OS menu. The custom menu supports disabled options and multiple selection (whereas native mobile OS support for both is inconsistent), adds an elegant way to handle placeholder values, and restores missing functionality on certain platforms such as optgroup support on Android (all explained below). In addition, the framework applies the custom button's theme to the menu to better match the look and feel and provide visual consistency across platforms. Lastly, custom menus often look better on desktop browsers because native desktop menus are smaller than their mobile counterparts and tend to look disproportionate.

      + +

      Keep in mind that there is overhead involved in parsing the native select to build a custom menu. If there are a lot of selects on a page, or a select has a long list of options, this can impact the performance of the page, so we recommend using custom menus sparingly.

      + +

      To use custom menus on a specific select, just add the data-native-menu="false" attribute. Alternately, this can also programmatically set the select menu's nativeMenu configuration option to false in a callback bound to the mobileinit event to achieve the same effect. This will globally make all selects use the custom menu by default. The following must be included in the page after jQuery is loaded but before jQuery Mobile is loaded.

      + + + +
      +$(document).bind('mobileinit',function(){
      +   $.mobile.selectmenu.prototype.options.nativeMenu = false;
      +});
      +
      +
      + +

      When the select has a small number of options that will fit on the device's screen, the menu will appear as a small overlay with a pop transition:

      + +
      + + +
      + +

      When it has too many options to show on the device's screen, the framework will automatically create a new "page" populated with a standard list view for the options. This allows us to use the native scrolling included on the device for moving through a long list. The text inside the label is used as the title for this page.

      + + +
      + + +
      + +

      Disabled options

      +

      jQuery Mobile will automatically disable and style option tags with the disabled attribute. In the demo below, the second option "Rush: 3 days" has been set to disabled.

      + +
      + + +
      + +

      Placeholder options

      +

      It's common for developers to include a "null" option in their select element to force a user to choose an option. If a placeholder option is present in your markup, jQuery Mobile will hide them in the overlay menu, showing only valid choices to the user, and display the placeholder text inside the menu as a header. A placeholder option is added when the framework finds:

      +
        +
      • An option with no value attribute (or an empty value attribute)
      • +
      • An option with no text node
      • +
      • An option with a data-placeholder="true" attribute. (This allows you to use an option that has a value and a textnode as a placeholder option).
      • +
      + +

      You can disable this feature through the selectmenu plugin's hidePlaceholderMenuItems option, like this:

      +
      +	
      +$.mobile.selectmenu.prototype.options.hidePlaceholderMenuItems = false;
      +	
      +	
      + +

      Examples of various placeholder options:

      + + +
      + + +
      + + +
      + + +
      + + +
      + + +
      + + +

      Multiple selects

      +

      If the multiple attribute is present in your markup, jQuery Mobile will enhance the element with a few extra considerations:

      + +
        +
      • A header element will be created inside the menu and display the placeholder text and a close button.
      • +
      • Clicking on an item inside the overlay menu will not close the widget.
      • +
      • A ghosted, unchecked icon will appear adjacent to each unselected item. When the item is selected the icon will change to a checkbox. Neither icon will appear inside a single select box.
      • +
      • Once 2+ items are selected, a counter element with the total number of selected items will appear inside the button.
      • +
      • The text of each selected item will appear inside the button as a list. If the button is not wide enough to display the entire list, it is truncated with an ellipses.
      • +
      • If no items are selected, the button's text will default to the placeholder text.
      • +
      • If no placeholder element exists, the default button text will be blank and the header will appear with just a close button. Because this isn't a friendly user experience, we recommended that you always specify a placeholder element when using multiple select boxes.
      • +
      + +
      + + +
      + +

      When a select is large enough to where the menu will open in a new page, the placeholder text is displayed in the button when no items are selected, and the label text is displayed in the menu's header. This differs from smaller overlay menus where the placeholder text is displayed in both the button and the header, and from full-page single selects where the placeholder text is not used at all.

      + +
      + + +
      + + + + + +

      Optgroup support

      +

      If a select menu contains optgroup elements, jQuery Mobile will create a divider & group items based on the label attribute's text:

      + +
      + + +
      + + +

      Theming selects

      +

      You can specify any jQuery Mobile button data- attribute on a select element, too. In this example, we're setting the theme, icon and inline properties:

      + +
      + + +
      + +

      The data-overlay-theme attribute can be added to a select element to set the color of the overlay layer for the dialog-based custom select menus and the outer border of the smaller custom menus. By default, the content block colors for swatch A will be used for the overlays.

      + +
      + + +
      + +
      + + +
      + + +
      + + + +
      + + + +
      + + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/forms/selects/events.html b/libs/js/jquery-mobile-1.1.0/docs/forms/selects/events.html new file mode 100644 index 0000000..5d6f410 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/forms/selects/events.html @@ -0,0 +1,105 @@ + + + + + + jQuery Mobile Docs - Select events + + + + + + + + + + +
      + +
      +

      Select Menus

      + Home + Search +
      + +
      +
      + +
      + +

      Select menus

      + + + + +

      Bind events directly to the select element. Use jQuery Mobile's virtual events, or bind standard JavaScript events, like change, focus, blur, etc.:

      +
       
      +$(".mySelect").bind( "change", function(event, ui) {
      +  ...
      +});
      +
      + +

      The select menu plugin has the following custom events:

      + +
      + +
      create triggered when a select menu is created
      +
      + +
      
      +$( ".selector" ).selectmenu({
      +   create: function(event, ui) { ... }
      +});		
      +			
      +
      + + +
      + +
      +
      + + + +
      + + + +
      + + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/forms/selects/index.html b/libs/js/jquery-mobile-1.1.0/docs/forms/selects/index.html new file mode 100644 index 0000000..e3dcf21 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/forms/selects/index.html @@ -0,0 +1,418 @@ + + + + + + jQuery Mobile Docs - Select + + + + + + + + + + +
      + +
      +

      Select Menus

      + Home + Search +
      + +
      +
      + +
      + +

      Select menus

      + + + +

      The select menu is based on a native select element, which is hidden from view and replaced with a custom-styled select button that matches the look and feel of the jQuery Mobile framework. The select menu is ARIA-enabled and keyboard accessible on the desktop as well. View the data- attribute reference to see all the possible attributes you can add to selects.

      + +

      By default, the framework leverages the native OS options menu to use with the custom button. When the button is clicked, the native OS menu will open. When a value is selected and the menu closes, the custom button's text is updated to match the selected value. Please note that the framework also offers the possibility of having custom (non-native) select menus; see details at the bottom of this page and on the custom select menu page.

      + +

      To add a select menu to your page, start with a standard select element populated with a set of option elements. Set the for attribute of the label to match the ID of the select so they are semantically associated. It's possible to accessibly hide the label if it's not desired in the page layout, but we require that it is present in the markup for semantic and accessibility reasons.

      + +

      The framework will find all select elements and automatically enhance them into select menus, no need to apply a data-role attribute. To prevent the automatic enhancement of a select, add data-role="none" attribute to the select.

      + +
      
      +<label for="select-choice-0" class="select">Shipping method:</label>
      +<select name="select-choice-0" id="select-choice-1">
      +   <option value="standard">Standard: 7 day</option>
      +   <option value="rush">Rush: 3 days</option>
      +   <option value="express">Express: next day</option>
      +   <option value="overnight">Overnight</option>
      +</select>
      +
      + +

      This will produce a basic select menu. The default styles set the width of the input to 100% of the parent container and stacks the label on a separate line.

      + + + + +

      Mini version

      + +

      For a more compact version that is useful in toolbars and tight spaces, add the data-mini="true" attribute to the element to create a mini version.

      + +
      	
      +<label for="select-choice-min" class="select">Shipping method:</label>
      +<select name="select-choice-min" id="select-choice-1" data-mini="true">
      +   <option value="standard">Standard: 7 day</option>
      +   <option value="rush">Rush: 3 days</option>
      +   <option value="express">Express: next day</option>
      +   <option value="overnight">Overnight</option>
      +</select> 
      +
      + +

      This will produce a select that a not as tall as the standard version and has a smaller text size.

      + + + +

      Field containers

      +

      Optionally wrap the selects in a container with the data-role="fieldcontain" attribute to help visually group it in a longer form.

      +
      
      +<div data-role="fieldcontain">
      +   <label for="select-choice-1" class="select">Shipping method:</label>
      +   <select name="select-choice-1" id="select-choice-1">
      +      <option value="standard">Standard: 7 day</option>
      +      <option value="rush">Rush: 3 days</option>
      +      <option value="express">Express: next day</option>
      +      <option value="overnight">Overnight</option>
      +   </select>
      +</div>
      +
      + +

      The select input is now displayed like this:

      + + +
      + + +
      + +

      An example of a select with a long list of options:

      + +
      + + +
      + +

      Optgroups

      +

      The following example organizes the options into optgroup elements. Support for this feature in mobile selects is a bit spotty, but is improving.

      + +
      + + +
      + + + +

      Vertically grouped select inputs

      + +

      To create a grouped set of select inputs, first add select and a corresponding label. Set the for attribute of the label to match the ID of the select so they are semantically associated.

      + +

      Because the label element will be associated with each individual select input, we recommend wrapping the selects in a fieldset element that has a legend which acts as the combined label for the grouped inputs.

      + +

      Lastly, one needs to wrap the fieldset in a div with data-role="controlgroup" attribute, so it can be styled as a group.

      + +
      	
      +<div data-role="fieldcontain">
      +<fieldset data-role="controlgroup">
      +	<legend>Date of Birth:</legend>
      +
      +    <label for="select-choice-month">Month</label>
      +<select name="select-choice-month" id="select-choice-month">
      +	<option>Month</option>
      +	<option value="jan">January</option>
      +	<!-- etc. -->
      +</select>
      +
      +	<label for="select-choice-day">Day</label>
      +<select name="select-choice-day" id="select-choice-day">
      +	<option>Day</option>
      +	<option value="1">1</option>
      +	<!-- etc. -->
      +</select>
      +
      +<label for="select-choice-year">Year</label>
      +<select name="select-choice-year" id="select-choice-year">
      +	<option>Year</option>
      +	<option value="2011">2011</option>
      +	<!-- etc. -->
      +</select>
      +</fieldset>
      +</div>
      +
      + +
      +
      + Date of Birth: + + + + + + + + + +
      + +
      + +

      Horizontally grouped select inputs

      +

      Select inputs can also be used for grouped sets with more than one related selections. To make a horizontal button set, add the data-type="horizontal" to the fieldset. Note that the buttons which trigger the select will resize depending on the currently selected option’s value. Note that browsers without support for display: inline-block; will group the selects vertically, as above.

      + + +<fieldset data-role="controlgroup" data-type="horizontal"> + + +
      + Date of Birth: + + + + + + + + + +
      + +

      Calling the select menu plugin

      +

      The select menu plugin will auto initialize on any page that contains a select menu, without any need for a data-role attribute in the markup. However, you can directly call the select menu plugin on any selector, just like any normal jQuery plugin:

      +
      
      +$('select').selectmenu();			
      +
      + +
      + + +

      Theming selects

      +

      You can specify any jQuery Mobile button data- attribute on a select element, too. In this example, we're setting the theme, icon and inline properties:

      + +
      + + +
      + + +

      Custom select menus

      +

      For the sake of advanced styling, the framework also offers a method of generating custom menus from existing select menu markup instead of the native OS menu. The custom menu supports disabled options and multiple selection (whereas native mobile OS support for both is inconsistent), adds an elegant way to handle placeholder values, and restores missing functionality on certain platforms such as optgroup support on Android. + +

      +

      + +
      + + + +
      + + + +
      + + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/forms/selects/methods.html b/libs/js/jquery-mobile-1.1.0/docs/forms/selects/methods.html new file mode 100644 index 0000000..030183a --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/forms/selects/methods.html @@ -0,0 +1,126 @@ + + + + + + jQuery Mobile Docs - Select methods + + + + + + + + + + +
      + +
      +

      Select Menus

      + Home + Search +
      + +
      +
      + +
      + +

      Select menus

      + + + +

      The select menu plugin has the following methods:

      + +
      + +
      close close an open select menu
      +
      +
      
      +$('select').selectmenu('close');			
      +				
      +
      + +
      enable enable a disabled select
      +
      +
      
      +$('select').selectmenu('enable');			
      +				
      +
      + +
      disable disable a select.
      +
      +
      
      +$('select').selectmenu('disable');			
      +				
      +
      + +
      open open a closed select menu (custom menus only)
      +
      +
      
      +$('select').selectmenu('open');			
      +				
      +
      + +
      refresh update the custom select
      +
      + This is used to update the custom select to reflect the native select element's value.If the number of options in the select are different than the number of items in the custom menu, it'll rebuild the custom menu. Also, if you pass a true argument you can force the rebuild to happen. +
      
      +//refresh value			
      +$('select').selectmenu('refresh');
      +
      +//refresh and force rebuild
      +$('select').selectmenu('refresh', true);
      +				
      +
      + +
      + +
      +
      + + + +
      + + + +
      + + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/forms/selects/options.html b/libs/js/jquery-mobile-1.1.0/docs/forms/selects/options.html new file mode 100644 index 0000000..c90cfd1 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/forms/selects/options.html @@ -0,0 +1,173 @@ + + + + + + jQuery Mobile Docs - Select options + + + + + + + + + + +
      + +
      +

      Select Menus

      + Home + Search +
      + +
      +
      + +
      + +

      Select menus

      + + + +

      The select menu plugin has the following options:

      + + +
      + +
      corners boolean
      +
      +

      default: true

      +

      Applies the theme button border-radius to the select button if set to true. This option is also exposed as a data attribute: data-corners="false"

      +
      $('select').selectmenu({ corners: "false" });
      +
      +
      icon string
      +
      +

      default: "arrow-down"

      +

      Applies an icon from the icon set to the custom button. This option is also exposed as a data attribute: data-icon="star"

      +
      $('select').selectmenu({ icon: "star" });
      +
      + +
      iconpos string
      +
      +

      default: "right"

      +

      Position of the icon in the select button. Possible values: left, right, none, notext. The notext value will display the select as an icon-only button with no text feedback. This option is also exposed as a data attribute: data-iconpos="left"

      +
      $('select').selectmenu({ iconpos: "left" });
      +
      + +
      iconshadow boolean
      +
      +

      default: true

      +

      Applies the theme shadow to the select button if set to true. This option is also exposed as a data attribute: data-iconshadow="false"

      +
      $('select').selectmenu({ iconshadow: "false" });
      +
      + +
      initSelector CSS selector string
      +
      +

      default: "select:not(:jqmData(role='slider'))"

      +

      This is used to define the selectors (element types, data roles, etc.) that will automatically be initialized as select menus. To change which elements are initialized, bind this option to the mobileinit event:

      +
      $( document ).bind( "mobileinit", function(){
      +	$.mobile.selectmenu.prototype.options.initSelector = ".myselect";
      +});
      +
      +
      + +
      inline boolean
      +
      +

      default: null (false)

      +

      If set to true, this will make the select button act like an inline button so the width is determined by the button's text. By default, this is null (false) so the select button is full width, regardless of the feedback content. Possible values: true, false. This option is also exposed as a data attribute: data-inline="true"

      +
      $('select').selectmenu({ inline: "true" });
      +
      + +
      mini boolean
      +
      +

      default: false

      +

      Sets the size of the element to a more compact, mini version. This option is also exposed as a data attribute: data-mini="true"

      +
      $('select').selectmenu({ mini: "true" });
      + +
      nativeMenu boolean
      +
      +

      default: true

      +

      When set to true, clicking the custom-styled select menu will open the native select menu which is best for performance. If set to false, the custom select menu style will be used instead of the native menu. This option is also exposed as a data attribute: data-native-menu="false"

      +
      $('select').selectmenu({ nativeMenu: "false" });
      +
      + +
      overlayTheme string
      +
      +

      default: a

      +

      Sets the color of the overlay layer for the dialog-based custom select menus and the outer border of the smaller custom menus. It accepts a single letter from a-z that maps to the swatches included in your theme. By default, the content block colors for swatch A will be used for the overlays. This option is also exposed as a data attribute: ui-body-d

      +
      $('select').selectmenu({ overlayTheme: "d" });
      +
      + +
      preventFocusZoom boolean
      +
      +

      default: true on iOS platforms

      +

      This option disables page zoom temporarily when a custom select is focused, which prevents iOS devices from zooming the page into the select. By default, iOS often zooms into form controls, and the behavior is often unnecessary and intrusive in mobile-optimized layouts. This option is also exposed as a data attribute: data-prevent-focus-zoom="true"

      +
      $('select').selectmenu({ preventFocusZoom: true });
      +
      + + +
      shadow boolean
      +
      +

      default: true

      +

      Applies the drop shadow style to the select button if set to true. This option is also exposed as a data attribute: data-shadow="false"

      +
      $('select').selectmenu({ shadow: "false" });
      +
      + +
      theme string
      +
      +

      default: null, inherited from parent

      +

      Sets the color scheme (swatch) for all instances of this widget. It accepts a single letter from a-z that maps to the swatches included in your theme. By default, it will inherit the same swatch color as it's parent container if not explicitly set. This option is also exposed as a data attribute: data-theme="a"

      +
      $('select').selectmenu({ theme: "a" });
      +
      + +
      + +
      +
      + + + +
      + + + +
      + + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/forms/slider/events.html b/libs/js/jquery-mobile-1.1.0/docs/forms/slider/events.html new file mode 100644 index 0000000..0e28ead --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/forms/slider/events.html @@ -0,0 +1,104 @@ + + + + + + jQuery Mobile Docs - Slider events + + + + + + + + + + +
      + +
      +

      Slider

      + Home + Search +
      + +
      +
      + +
      + +

      Slider

      + + + +

      Bind events directly to the input element. Use jQuery Mobile's virtual events, or bind standard JavaScript events, like change, focus, blur, etc.:

      +
       
      +$( ".selector" ).bind( "change", function(event, ui) {
      +  ...
      +});
      +
      + +

      The slider plugin has the following custom event:

      + +
      + +
      create triggered when a slider is created
      +
      + +
      
      +$( ".selector" ).slider({
      +   create: function(event, ui) { ... }
      +});		
      +			
      +
      + + +
      + +
      +
      + + + +
      + + + +
      + + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/forms/slider/index.html b/libs/js/jquery-mobile-1.1.0/docs/forms/slider/index.html new file mode 100644 index 0000000..79cc947 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/forms/slider/index.html @@ -0,0 +1,179 @@ + + + + + + jQuery Mobile Docs - Slider + + + + + + + + + + +
      + +
      +

      Slider

      + Home + Search +
      + +
      +
      + +
      +

      Slider

      + + + +

      To add a slider widget to your page, use a standard input with the type="range" attribute. The input's value is used to configure the starting position of the handle and the value is populated in the text input. Specify min and max attribute values to set the slider's range. If you want to constrain input to specific increments, add the step attribute. Set the value attribute to define the initial value. The framework will parse these attributes to configure the slider widget. View the data- attribute reference to see all the possible attributes you can add to sliders.

      + +

      As you drag the slider's handle, the framework will update the native input's value (and vice-versa) so they are always in sync; this ensures that the value is submitted with the form.

      +

      Set the for attribute of the label to match the ID of the input so they are semantically associated. It's possible to accessibly hide the label if it's not desired in the page layout, but we require that it is present in the markup for semantic and accessibility reasons.

      + +

      The framework will find all input elements with a type="range" and automatically enhance them into a slider with an accompanying input without any need to apply a data-role attribute. To prevent the automatic enhancement of this input into a slider, add data-role="none" attribute to the input and wrap them in a div with the data-role="fieldcontain" attribute to group them. In this example, the acceptable range is 0-100.

      + +
      
      +<label for="slider-0">Input slider:</label>
      +<input type="range" name="slider" id="slider-0" value="60" min="0" max="100" />
      +
      + +

      The default slider with these settings is displayed like this:

      + + + +

      Step increment

      + +

      To force the slider to snap to a specific increment, add the step attribute to the input. By default, the step is 1, but in this example, the step is 50 and the maximum value is 500.

      + +
      
      +<label for="slider-step">Input slider:</label>
      +<input type="range" name="slider" id="slider-step" value="150" min="0" max="500" step="50" />
      +
      + +

      This will produce an input that snaps to increments of 50. If a value is added to the input that isn't valid with the step increment, the value will be reset on blur to the closest step.

      + + + + +

      Fill highlight

      + +

      To have a highlight fill on the track up to the slider handle position, add the data-highlight="true" attribute to the input. The fill uses active state swatch.

      + +
      
      +<label for="slider-fill">Input slider:</label>
      +<input type="range" name="slider" id="slider-fill" value="60" min="0" max="100" data-highlight="true" />
      +
      + + + + + +

      Mini version

      + +

      For a more compact version that is useful in toolbars and tight spaces, add the data-mini="true" attribute to the element to create a mini version.

      + +
      
      +<label for="slider-0">Input slider:</label>
      +<input type="range" name="slider" id="slider-0" value="25" min="0" max="100" data-highlight="true" data-mini="true" />
      +
      + +

      This will produce an input that is not as tall as the standard version and has a smaller text size.

      + + + +

      Field containers

      + +

      Optionally wrap the slider markup in a container with the data-role="fieldcontain" attribute to help visually group it in a longer form. In this example, the step attribute is omitted to allow any whole number value to be selected.

      + + +
      
      +<div data-role="fieldcontain">
      +   <label for="slider">Input slider:</label>
      +   <input type="range" name="slider" id="slider" value="25" min="0" max="100"  />
      +</div>
      +
      + +

      The slider is now displayed like this:

      +
      + + +
      + +

      Sliders also respond to key commands. Right Arrow, Up Arrow and Page Up keys increase the value; Left Arrow, Down Arrow and Page Down keys decrease it. To move the slider to its minimum or maximum value, use the Home or End key, respectively.

      + + +

      Calling the slider plugin

      + +

      This plugin will auto initialize on any page that contains a text input with the type="range" attribute. However, if needed you can directly call the slider plugin on any selector, just like any jQuery plugin:

      +
      
      +$('input').slider();
      +
      + + +

      Theming the slider

      +

      To set the theme swatch for the slider, add a data-theme attribute to the input which will apply the theme to both the input, handle and track. The track swatch can be set separately by adding the data-track-theme attribute to apply the down state version of the selected button swatch.

      + +
      
      +<div data-role="fieldcontain">
      +	<label for="slider-2">Input slider:</label>
      +	<input type="range" name="slider-2" id="slider-2" value="25" min="0" max="100" data-theme="a" data-track-theme="b" />
      +</div>
      +		
      + +

      This will produce a themed slider:

      +
      + + +
      +
      +
      + + + +
      + + + +
      + + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/forms/slider/methods.html b/libs/js/jquery-mobile-1.1.0/docs/forms/slider/methods.html new file mode 100644 index 0000000..7cffa6d --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/forms/slider/methods.html @@ -0,0 +1,108 @@ + + + + + + jQuery Mobile Docs - Slider methods + + + + + + + + + + +
      + +
      +

      Slider

      + Home + Search +
      + +
      +
      + +
      + +

      Slider

      + + + +

      The slider plugin has the following methods:

      + +
      +
      enable enable a disabled slider
      +
      +
      
      +$('.selector').slider('enable');			
      +				
      +
      + +
      disable disable a slider
      +
      +
      
      +$('.selector').slider('disable');			
      +				
      +
      + +
      refresh update the slider
      +
      +

      If you manipulate a slider via JavaScript, you must call the refresh method on it to update the visual styling.

      + +
      			
      +$('.selector').slider('refresh');
      +				
      +
      + +
      + +
      +
      + + + +
      + + + +
      + + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/forms/slider/options.html b/libs/js/jquery-mobile-1.1.0/docs/forms/slider/options.html new file mode 100644 index 0000000..d641094 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/forms/slider/options.html @@ -0,0 +1,131 @@ + + + + + + jQuery Mobile Docs - Slider options + + + + + + + + + + +
      + +
      +

      Slider

      + Home + Search +
      + +
      +
      + +
      + +

      Slider

      + + + +

      The slider plugin has the following options:

      + +
      +
      disabled string
      +
      +

      default: false

      +

      Sets the default state of the slider to disabled when "true".

      +
      $('.selector').slider({ disabled: "true" });
      +
      + +
      highlight boolean
      +
      +

      default: false

      +

      Sets an active state fill on the track from the left edge to the slider handle when set to "true".

      +
      $('.selector').slider({ highlight: "true" });
      +
      + +
      initSelector CSS selector string
      +
      +

      default: "input[type='range'], :jqmData(type='range'), :jqmData(role='slider')"

      +

      This is used to define the selectors (element types, data roles, etc.) that will automatically be initialized as sliders. To change which elements are initialized, bind this option to the mobileinit event:

      +
      $( document ).bind( "mobileinit", function(){
      +   $.mobile.slider.prototype.options.initSelector = ".myslider";
      +});
      +
      +
      + +
      mini boolean
      +
      +

      default: false

      +

      Sets the size of the element to a more compact, mini version. This option is also exposed as a data attribute: data-mini="true"

      +
      $('.selector').slider({ mini: "true" });
      +
      + +
      theme string
      +
      +

      default: null, inherited from parent

      +

      Sets the color scheme (swatch) for all instances of this widget. It accepts a single letter from a-z that maps to the swatches included in your theme. By default, it will inherit the same swatch color as its parent container if not explicitly set. This option is also exposed as a data attribute: data-theme="a"

      +
      $('.selector').slider({ theme: "a" });
      +
      + +
      trackTheme string
      +
      +

      default: null, inherited from parent

      +

      Sets the color scheme (swatch) for the slider's track, specifically. It accepts a single letter from a-z that maps to the swatches included in your theme.

      +
      $('.selector').slider({ trackTheme: "a" });
      +

      This option can be overridden in the markup by assigning a data attribute to the input, e.g. data-track-theme="a".

      +
      + +
      + +
      +
      + + + +
      + + + +
      + + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/forms/switch/events.html b/libs/js/jquery-mobile-1.1.0/docs/forms/switch/events.html new file mode 100644 index 0000000..005d230 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/forms/switch/events.html @@ -0,0 +1,104 @@ + + + + + + jQuery Mobile Docs - Slider events + + + + + + + + + + +
      + +
      +

      Flip Toggle Switch

      + Home + Search +
      + +
      +
      + +
      + +

      Flip toggle switch

      + + + +

      Bind events directly to the select element. Use jQuery Mobile's virtual events, or bind standard JavaScript events, like change, focus, blur, etc.:

      +
       
      +$( ".selector" ).bind( "change", function(event, ui) {
      +  ...
      +});
      +
      + +

      The slider plugin has the following custom event:

      + +
      + +
      create triggered when a slider is created
      +
      + +
      
      +$( ".selector" ).slider({
      +   create: function(event, ui) { ... }
      +});		
      +			
      +
      + + +
      + +
      +
      + + + +
      + + + +
      + + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/forms/switch/index.html b/libs/js/jquery-mobile-1.1.0/docs/forms/switch/index.html new file mode 100644 index 0000000..a3a59f7 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/forms/switch/index.html @@ -0,0 +1,210 @@ + + + + + + jQuery Mobile Docs - Switch + + + + + + + + + + +
      + +
      +

      Flip Toggle Switch

      + Home + Search +
      + +
      +
      + +
      +

      Flip toggle switch

      + + + +

      A binary "flip" switch is a common UI element on mobile devices that is used for binary on/off or true/false data input. You can either drag the flip handle like a slider or tap one side of the switch.

      + +

      To create a flip toggle, start with a select with two options. The first option will be styled as the "on" state switch and the second will be styled as the "off" state so write your options accordingly. View the data- attribute reference to see all the possible attributes you can add to flip switches.

      + +

      Set the for attribute of the label to match the ID of the input so they are semantically associated. It's possible to accessibly hide the label if it's not desired in the page layout, but we require that it is present in the markup for semantic and accessibility reasons.

      + +
      	
      +<label for="flip-a">Select slider:</label>
      +<select name="slider" id="flip-a" data-role="slider">
      +	<option value="off">Off</option>
      +	<option value="on">On</option>
      +</select> 
      +
      + +

      This will produce a basic flip toggle switch input. The default styles set the width of the switch to 100% of the parent container and stack the label on a separate line.

      + + + + + +

      Longer Labels

      +

      The control is proportionally scaled, so to use longer labels one can just add a line of CSS setting the switch to the desired width. For example, given the following markup:

      +
      
      +<div class="containing-element">
      +	<label for="flip-min">Flip switch:</label>
      +	<select name="slider" id="flip-min" data-role="slider">
      +		<option value="off">Switch Off</option>
      +		<option value="on">Switch On</option>
      +	</select>
      +</div>
      +
      + +

      .containing-element .ui-slider-switch { width: 9em } will produce:

      + + + +
      + + +
      + +

      As some default styles hinge on fieldcontains, note that you may have to ensure that custom styles apply to switches within fieldcontains by using .ui-field-contain div.ui-slider-switch { width: […]; }.

      + +

      Mini version

      + +

      For a more compact version that is useful in toolbars and tight spaces, add the data-mini="true" attribute to the element to create a mini version.

      + +
      	
      +<label for="flip-a">Select slider:</label>
      +<select name="slider" id="flip-a" data-role="slider" data-mini="true">
      +	<option value="off">Off</option>
      +	<option value="on">On</option>
      +</select>
      +
      + +

      This will produce a flip switch that is not as tall as the standard version and has a smaller text size.

      + + + + +

      Field containers

      +

      Optionally wrap the switch markup in a container with the data-role="fieldcontain" attribute to help visually group it in a longer form.

      + +
      	
      +<div data-role="fieldcontain">
      +<label for="flip-b">Flip switch:</label>
      +	<select name="slider" id="flip-b" data-role="slider">
      +		<option value="no">No</option>
      +		<option value="yes">Yes</option>
      +	</select> 
      +</div>
      +
      +

      The flip toggle switch is now displayed like this:

      +
      + + +
      + + +

      Theming the flip switch

      + +

      Like all form elements, this widget will automatically inherit the theme from its parent container. To choose a specific theme color swatch, specify the data-theme attribute on the select and specify a swatch letter.

      + +
      	
      +<div data-role="fieldcontain">
      +	<label for="flip-c">Flip switch:</label>
      +	<select name="slider" id="flip-c" data-role="slider" data-theme="a">
      +		<option value="no">No</option>
      +		<option value="yes">Yes</option>
      +	</select> 
      +</div>
      +
      +

      This results in a switch with the A swatch colors for the handle. Note that the lefthand "on" state gets the active state color.

      +
      + + +
      + +

      Here is a E swatch variation:

      +
      + + +
      + +

      Calling the switch plugin

      + +

      This plugin will auto-initialize on any page that contains a select with the data-role="slider" attribute. However, if needed you can directly call the slider plugin on any selector, just like any jQuery plugin:

      +
      
      +$('select').slider();			
      +
      + +
      +
      + + + +
      + + + +
      + + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/forms/switch/methods.html b/libs/js/jquery-mobile-1.1.0/docs/forms/switch/methods.html new file mode 100644 index 0000000..59834e5 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/forms/switch/methods.html @@ -0,0 +1,108 @@ + + + + + + jQuery Mobile Docs - Slider methods + + + + + + + + + + +
      + +
      +

      Flip Toggle Switch

      + Home + Search +
      + +
      +
      + +
      + +

      Flip toggle switch

      + + + +

      The slider plugin has the following methods:

      + +
      +
      enable enable a disabled slider
      +
      +
      
      +$('.selector').slider('enable');			
      +				
      +
      + +
      disable disable a slider
      +
      +
      
      +$('.selector').slider('disable');			
      +				
      +
      + +
      refresh update the slider
      +
      +

      If you manipulate a slider via JavaScript, you must call the refresh method on it to update the visual styling.

      + +
      			
      +$('.selector').slider('refresh');
      +				
      +
      + +
      + +
      +
      + + + +
      + + + +
      + + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/forms/switch/options.html b/libs/js/jquery-mobile-1.1.0/docs/forms/switch/options.html new file mode 100644 index 0000000..862b548 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/forms/switch/options.html @@ -0,0 +1,123 @@ + + + + + + jQuery Mobile Docs - Slider options + + + + + + + + + + +
      + +
      +

      Flip Toggle Switch

      + Home + Search +
      + +
      +
      + +
      + +

      Flip toggle switch

      + + + +

      The slider plugin has the following options:

      + +
      +
      disabled string
      +
      +

      default: false

      +

      Sets the default state of the slider to disabled when "true".

      +
      $('.selector').slider({ disabled: "true" });
      +
      + +
      initSelector CSS selector string
      +
      +

      default: "input[type='range'], :jqmData(type='range'), :jqmData(role='slider')"

      +

      This is used to define the selectors (element types, data roles, etc.) that will automatically be initialized as sliders. To change which elements are initialized, bind this option to the mobileinit event:

      +
      $( document ).bind( "mobileinit", function(){
      +   $.mobile.slider.prototype.options.initSelector = ".myslider";
      +});
      +
      + +
      mini boolean
      +
      +

      default: false

      +

      Sets the size of the element to a more compact, mini version. This option is also exposed as a data attribute: data-mini="true"

      +
      $('.selector').slider({ mini: "true" });
      +
      + +
      theme string
      +
      +

      default: null, inherited from parent

      +

      Sets the color scheme (swatch) for all instances of this widget. It accepts a single letter from a-z that maps to the swatches included in your theme. By default, it will inherit the same swatch color as it's parent container if not explicitly set. This option is also exposed as a data attribute: data-theme="a"

      +
      $('.selector').slider({ theme: "a" });
      +
      + +
      trackTheme string
      +
      +

      default: null, inherited from parent

      +

      Sets the color scheme (swatch) for the slider's track, specifically. It accepts a single letter from a-z that maps to the swatches included in your theme.

      +
      $('.selector').slider({ trackTheme: "a" });
      +

      This option can be overridden in the markup by assigning a data attribute to the input, e.g. data-track-theme="a".

      +
      + +
      + +
      +
      + + + +
      + + + +
      + + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/forms/textinputs/events.html b/libs/js/jquery-mobile-1.1.0/docs/forms/textinputs/events.html new file mode 100644 index 0000000..b4020d5 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/forms/textinputs/events.html @@ -0,0 +1,103 @@ + + + + + + jQuery Mobile Docs - Text Input events + + + + + + + + + + +
      + +
      +

      Text inputs

      + Home + Search +
      + +
      +
      + +
      + +

      Text inputs

      + + + +

      Bind events directly to the input element. Use jQuery Mobile's virtual events, or bind standard JavaScript events, like change, focus, blur, etc.:

      +
       
      +$( ".selector" ).bind( "change", function(event, ui) {
      +  ...
      +});
      +
      + +

      The text input plugin has the following custom events:

      + +
      + +
      create triggered when a text input is created
      +
      + +
      
      +$( ".selector" ).textinput({
      +   create: function(event, ui) { ... }
      +});		
      +			
      +
      + +
      + +
      +
      + + + +
      + + + +
      + + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/forms/textinputs/index.html b/libs/js/jquery-mobile-1.1.0/docs/forms/textinputs/index.html new file mode 100644 index 0000000..fd88c35 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/forms/textinputs/index.html @@ -0,0 +1,244 @@ + + + + + + jQuery Mobile Docs - Text inputs + + + + + + + + + + +
      + +
      +

      Text inputs

      + Home + Search +
      + +
      +
      + +
      + +

      Text inputs & Textareas

      + + + +

      Text inputs and textareas are coded with standard HTML elements, then enhanced by jQuery Mobile to make them more attractive and useable on a mobile device. View the data- attribute reference to see all the possible attributes you can add to text inputs.

      + +

      Text inputs

      +

      To collect standard alphanumeric text, use an input with a type="text" attribute. Set the for attribute of the label to match the ID of the input so they are semantically associated. It's possible to accessibly hide the label if it's not desired in the page layout, but we require that it is present in the markup for semantic and accessibility reasons.

      + +
      	
      +    <label for="basic">Text Input:</label>
      +    <input type="text" name="name" id="basic" value=""  />
      +
      + +

      This will produce a basic text input. The default styles set the width of the input to 100% of the parent container and stack the label on a separate line.

      + + + + +

      Mini version

      + +

      For a more compact version that is useful in toolbars and tight spaces, add the data-mini="true" attribute to the element to create a mini version.

      + +
      	
      +<label for="basic">Text Input:</label>
      +<input type="text" name="name" id="basic" value="" data-mini="true" />
      +
      + +

      This will produce an input that is not as tall as the standard version and has a smaller text size.

      + + + +

      Field containers

      + +

      Optionally wrap the text input in a container with the data-role="fieldcontain" attribute to help visually group it in a longer form.

      + +
      	
      +<div data-role="fieldcontain">
      +    <label for="name">Text Input:</label>
      +    <input type="text" name="name" id="name" value=""  />
      +</div>	
      +
      + +

      The text input is now displayed like this:

      +
      + + +
      + + +

      More text input types

      +

      In jQuery Mobile, you can use existing and new HTML5 input types such as password, email, tel, number, and more. Some type values are rendered differently across browsers. For example, Chrome renders the range input as a slider. jQuery Mobile standardizes the appearance of range and search by dynamically changing their type to text. You can configure which input types are degraded to text with the page plugin's options.

      + +

      One major advantage of using these more specific input types if that on mobile devices, specialized keyboards that speed data entry are offered in place of the standard text keyboard. Try the following inputs on a mobile device to see which display custom keyboards on various platforms.

      + +
      + + +
      + +
      + + +
      + +
      + + +
      + +
      + + +
      + +
      + + +
      + +
      + + +
      + +
      + + +
      + +
      + + +
      + +
      + + +
      + +
      + + +
      + +
      + + +
      + +
      + + +
      + +
      + + +
      + + + +

      Textareas

      +

      For multi-line text inputs, use a textarea element. The framework will auto-grow the height of the textarea to avoid the need for an internal scrollbar.

      +

      Set the for attribute of the label to match the ID of the textarea so they are semantically associated, and wrap them in a div with the data-role="fieldcontain" attribute to group them.

      + +
      	
      +<label for="textarea-a">Textarea:</label>
      +<textarea name="textarea" id="textarea-a">
      +I'm a basic textarea. If this is pre-populated with content, the height will be automatically adjusted to fit without needing to scroll. That is a pretty handy usability feature.
      +</textarea>
      +
      + +

      This will produce a basic textarea with the width set to 100% of the parent container and the label stacked on a separate line. The textarea will grow to fit new lines as you type:

      + + + +
      	
      +<div data-role="fieldcontain">
      +<label for="textarea">Textarea:</label>
      +	<textarea name="textarea" id="textarea"></textarea>
      +</div>
      +
      + +

      The textarea is displayed like this and will grow to fit new lines as you type:

      +
      + + +
      + + +

      Calling the textinput plugin

      + +

      This plugin will auto initialize on any page that contains a textarea or any of the text input types listed above without any need for a data-role attribute in the markup. However, if needed, you can directly call the textinput plugin on any selector, just like any jQuery plugin:

      +
      
      +$('input').textinput();			
      +			
      + + +

      Degraded input types

      +

      jQuery Mobile degrades several HTML5 input types back to type=text or type=number after adding enhanced controls. For example, inputs with a type of range are enhanced with a custom slider control, and their type is set to number to offer a usable form input alongside that slider. Inputs with a type of search are degraded back to type=text after we add our own themable search input styling.

      +

      The page plugin contains a list of input types that are set to either true which means they'll degrade to type=text, false which means they'll be left alone, or a string such as "number", which means they'll be converted to that type (such as the case of type=range).

      + +

      You can configure which types are changed via the page plugin's degradeInputs option, which can be manipulated externally via $.mobile.page.prototype.options.degradeInputs, which has properties: color, date, datetime, "datetime-local", email, month, number, range, search, tel, time, url, and week. Be sure to configure this inside an event handler bound to the mobileinit event, so that it applies to the first page as well as subsequent pages that are loaded.

      + + +
      + +
      + + + +
      + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/forms/textinputs/methods.html b/libs/js/jquery-mobile-1.1.0/docs/forms/textinputs/methods.html new file mode 100644 index 0000000..d3dadd4 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/forms/textinputs/methods.html @@ -0,0 +1,100 @@ + + + + + + jQuery Mobile Docs - Text Input methods + + + + + + + + + + +
      + +
      +

      Text inputs

      + Home + Search +
      + +
      +
      + +
      + +

      Text inputs

      + + + +

      The text input plugin has the following methods:

      + +
      + +
      enable enable a disabled text input
      +
      +
      
      +$('.selector').textinput('enable');			
      +				
      +
      + +
      disable disable a text input
      +
      +
      
      +$('.selector').textinput('disable');			
      +				
      +
      + +
      + +
      +
      + + + +
      + + + +
      + + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/forms/textinputs/options.html b/libs/js/jquery-mobile-1.1.0/docs/forms/textinputs/options.html new file mode 100644 index 0000000..cee3e49 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/forms/textinputs/options.html @@ -0,0 +1,117 @@ + + + + + + jQuery Mobile Docs - Text Input options + + + + + + + + + + +
      + +
      +

      Text inputs

      + Home + Search +
      + +
      +
      + +
      + +

      Text inputs

      + + + +

      The text input plugin has the following options:

      + +
      +
      initSelector CSS selector string
      +
      +

      default: "input[type='text'], input[type='search'], :jqmData(type='search'), input[type='number'], :jqmData(type='number'), input[type='password'], input[type='email'], input[type='url'], input[type='tel'], textarea, input:not([type])"

      +

      This is used to define the selectors (element types, data roles, etc.) that will automatically be initialized as textinputs. To change which elements are initialized, bind this option to the mobileinit event:

      +
      $( document ).bind( "mobileinit", function(){
      +   $.mobile.textinput.prototype.options.initSelector = ".myInputs";
      +});
      +
      +
      + +
      mini boolean
      +
      +

      default: false

      +

      Sets the size of the element to a more compact, mini version. This option is also exposed as a data attribute: data-mini="true"

      +
      $('.selector').textinput({ mini: "true" });
      +
      + +
      preventFocusZoom boolean
      +
      +

      default: true on iOS platforms

      +

      This option disables page zoom temporarily when a custom input is focused, which prevents iOS devices from zooming the page into the input. By default, iOS often zooms into form controls, and the behavior is often unnecessary and intrusive in mobile-optimized layouts. This option is also exposed as a data attribute: data-prevent-focus-zoom="true"

      +
      $('input').textinput({ preventFocusZoom: true });
      +
      + + +
      theme string
      +
      +

      default: null, inherited from parent

      +

      Sets the color scheme (swatch) for all instances of this widget. It accepts a single letter from a-z that maps to the swatches included in your theme. By default, it will inherit the same swatch color as it's parent container if not explicitly set. This option is also exposed as a data attribute: data-theme="a"

      +
      $('.selector').textinput({ theme: "a" });
      +
      + +
      + +
      +
      + + + +
      + + + +
      + + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/index.html b/libs/js/jquery-mobile-1.1.0/docs/index.html new file mode 100644 index 0000000..ae0cec3 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/index.html @@ -0,0 +1,33 @@ + + + + + + jQuery UI Mobile Framework - Documentation + + + + + + + + + + +
      + +
      +

      jQuery Mobile Docs

      + Home +
      + +
      + +

      Nothing to see here folks.

      +View the documentation home page + +
      + +
      + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/lists/docs-lists.html b/libs/js/jquery-mobile-1.1.0/docs/lists/docs-lists.html new file mode 100644 index 0000000..b99612a --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/lists/docs-lists.html @@ -0,0 +1,177 @@ + + + + + + jQuery Mobile Docs - Lists Overview + + + + + + + + + + +
      + +
      +

      Lists

      + Home + Search +
      + +
      +
      +

      List views

      + + + +

      Basic linked lists

      +

      A list view is coded as a simple unordered list containing linked list items with a data-role="listview" attribute. jQuery Mobile will apply all the necessary styles to transform the list into a mobile-friendly list view with right arrow indicator that fills the full width of the browser window. When you tap on the list item, the framework will trigger a click on the first link inside the list item, issue an AJAX request for the URL in the link, create the new page in the DOM, then kick off a page transition. View the data- attribute reference to see all the possible attributes you can add to listviews.

      +

      Here is the HTML markup for a basic linked list.

      + +
      
      +<ul data-role="listview" data-theme="g">
      +	<li><a href="acura.html">Acura</a></li>
      +	<li><a href="audi.html">Audi</a></li>
      +	<li><a href="bmw.html">BMW</a></li>
      +</ul>
      +
      + + Basic list example + +

      Style note on non-inset lists: all standard, non-inset lists have a -15px margin to negate the 15px of padding on the content area to make lists fill to the edges of the screen. If you add other widgets above or below a list, the negative margin may make these elements overlap so you'll need to add additional spacing in your custom CSS.

      +

      Nested lists

      +

      By nesting child ul or ol inside list items, you can create nested lists. When a list item with a child list is clicked, the framework will generate a new ui-page populated with the title of the parent in the header and the list of child elements. These dynamic nested lists are styled with the "b" theme swatch (blue in the default theme) to indicate that you are in a secondary level of navigation. Lists can be nested multiple levels deep and all pages and linking will be automatically handled by the framework.

      +

      To set the swatch color of the child list views, set the data-theme attribute on each list inside.

      + Nested list example + +

      Numbered lists

      +

      Lists can also be created from ordered lists (ol) which is useful when presenting items that are in a sequence such as search results or a movie queue. When the enhanced markup is applied to the list view, jQuery Mobile will try to first use CSS to add numbers to the list and, if not supported, will fall back to injecting numbers with JavaScript.

      + + Numbered list example + +

      Read-only lists

      +

      List views can also be used to display a non-interactive list of items, usually as an inset list. This list is built from an unordered or ordered list that don't have linked list items. The framework defaults to styling these list with the "c" theme swatch and sets the text size to a smaller size than the clickable lists to save a bit of space.

      + + Read-only list example + +

      Split button lists

      +

      In cases where there is more than one possible action per list item, a split button can be used to offer two independently clickable items -- the list item and a small arrow icon in the far right. To make a split list item, simply add a second link inside the li and the framework will add a vertical divider line, style the link as an icon-only arrow button, and set the title attribute of the link to the text the link for accessibility.

      +

      You can set the icon for the right split icon by specifying a data-split-icon attribute with the icon name you want. The theme swatch color of the split button can be set by specifying a swatch letter in the data-split-theme attribute

      + + Split list example + + +

      List dividers

      +

      List items can be turned into dividers to organize and group the list items. This is done by adding the data-role="list-divider" to any list item. These items are styled with the bar swatch "b" by default (blue in the default theme) but you can specify a theme for dividers by adding the data-dividertheme attribute to the list element (ul or ol) and specifying a theme swatch letter.

      + + List divider example + + +

      Search filter

      +

      jQuery Mobile provides a very easy way to filter a list with a simple client-side search feature. To make a list filterable, simply add the data-filter="true" attribute to the list. The framework will then append a search box above the list and add the behavior to filter out list items that don't contain the current search string as the user types. The input's placeholder text defaults to "Filter items...". To configure the placeholder text in the search input, you can either bind to the mobileinit event and set the $.mobile.listview.prototype.options.filterPlaceholder option to a string of your choosing, or use the data-attribute data-filter-placeholder on your listview. By default the search box will inherit its theme from its parent. The search box theme can be configured using the data-attribute data-filter-theme on your listview.

      + + Search filter example + +

      If you want to change the way in which list items are filtered, ie fuzzy search or matching from the beginning of the string, you can configure the callback used internally by defining $.mobile.listview.prototype.options.filterCallback during mobileinit or after the widget has been created with $("#mylist").listview('option', 'filterCallback', yourFilterFunction). Any function defined for the callback will be provided two arguments. First, the text of the current list item and second, the value being searched for. A truthy value will result in a hidden list item. The default callback which filters entries without the searchValue as a substring is described below: +

      + +
      function( text, searchValue ){
      +  return text.toLowerCase().indexOf( searchValue ) === -1;
      +};
      + +

      To filter list items by values other than the text, add a data-filtertext attribute to the list item. The value of this attribute will be passed as the first argument to the filterCallback function instead of the text.

      + + Hidden data filter example + +

      Text formatting & counts

      +

      The framework includes text formatting conventions for common list patterns like header/descriptions, secondary information and counts through semantic HTML markup.

      + +
        +
      • To add a count indicator to the right of the list item, wrap the number in an element with a class of ui-li-count
      • +
      • To add text hierarchy, use headings to increase font emphasis and use paragraphs to reduce emphasis.
      • +
      • Supplemental information can be added to the right of each list item by wrapping content in an element with a class of ui-li-aside
      • +
      + List with count bubbles + List with text formatting + +

      Thumbnails & icons

      +

      To add thumbnails to the left of a list item, simply add an image inside a list item as the first child element. The framework will scale the image to 80 pixels square. To use standard 16x16 pixel icons in list items, add the class of ui-li-icon to the image element.

      + List with thumbnail images + List with icon images + +

      Inset lists

      +

      If lists are embedded in a page with other types of content, an inset list packages the list into a block that sits inside the content area with a bit of margin and rounded corners (theme controlled). By adding the data-inset="true" attribute to the list (ul or ol), applies the inset appearance.

      + + Inset list example + +

      Calling the listview plugin

      +

      You can directly call the listview plugin on any selector, just like any jQuery plugin:

      + $('#mylist').listview(); + +

      Updating lists

      +

      If you add items to a listview, you'll need to call the refresh() method on it to update the styles and create any nested lists that are added. For example:

      + $('#mylist').listview('refresh'); + +

      Note that the refresh() method only affects new nodes appended to a list. This is done for performance reasons. Any list items already enhanced will be ignored by the refresh process. This means that if you change the contents or attributes on an already enhanced list item, these won't be reflected. If you want a list item to be updated, replace it with fresh markup before calling refresh.

      + + +
      + + + +
      + + + +
      + + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/lists/images/album-af.jpg b/libs/js/jquery-mobile-1.1.0/docs/lists/images/album-af.jpg new file mode 100755 index 0000000..e2e34fd Binary files /dev/null and b/libs/js/jquery-mobile-1.1.0/docs/lists/images/album-af.jpg differ diff --git a/libs/js/jquery-mobile-1.1.0/docs/lists/images/album-ag.jpg b/libs/js/jquery-mobile-1.1.0/docs/lists/images/album-ag.jpg new file mode 100755 index 0000000..0276634 Binary files /dev/null and b/libs/js/jquery-mobile-1.1.0/docs/lists/images/album-ag.jpg differ diff --git a/libs/js/jquery-mobile-1.1.0/docs/lists/images/album-bb.jpg b/libs/js/jquery-mobile-1.1.0/docs/lists/images/album-bb.jpg new file mode 100755 index 0000000..e23683a Binary files /dev/null and b/libs/js/jquery-mobile-1.1.0/docs/lists/images/album-bb.jpg differ diff --git a/libs/js/jquery-mobile-1.1.0/docs/lists/images/album-bk.jpg b/libs/js/jquery-mobile-1.1.0/docs/lists/images/album-bk.jpg new file mode 100755 index 0000000..58ec190 Binary files /dev/null and b/libs/js/jquery-mobile-1.1.0/docs/lists/images/album-bk.jpg differ diff --git a/libs/js/jquery-mobile-1.1.0/docs/lists/images/album-hc.jpg b/libs/js/jquery-mobile-1.1.0/docs/lists/images/album-hc.jpg new file mode 100755 index 0000000..cc099d1 Binary files /dev/null and b/libs/js/jquery-mobile-1.1.0/docs/lists/images/album-hc.jpg differ diff --git a/libs/js/jquery-mobile-1.1.0/docs/lists/images/album-k.jpg b/libs/js/jquery-mobile-1.1.0/docs/lists/images/album-k.jpg new file mode 100755 index 0000000..ce6cfc2 Binary files /dev/null and b/libs/js/jquery-mobile-1.1.0/docs/lists/images/album-k.jpg differ diff --git a/libs/js/jquery-mobile-1.1.0/docs/lists/images/album-mg.jpg b/libs/js/jquery-mobile-1.1.0/docs/lists/images/album-mg.jpg new file mode 100755 index 0000000..c3850e3 Binary files /dev/null and b/libs/js/jquery-mobile-1.1.0/docs/lists/images/album-mg.jpg differ diff --git a/libs/js/jquery-mobile-1.1.0/docs/lists/images/album-ok.jpg b/libs/js/jquery-mobile-1.1.0/docs/lists/images/album-ok.jpg new file mode 100755 index 0000000..90a08f7 Binary files /dev/null and b/libs/js/jquery-mobile-1.1.0/docs/lists/images/album-ok.jpg differ diff --git a/libs/js/jquery-mobile-1.1.0/docs/lists/images/album-p.jpg b/libs/js/jquery-mobile-1.1.0/docs/lists/images/album-p.jpg new file mode 100755 index 0000000..3dcce6a Binary files /dev/null and b/libs/js/jquery-mobile-1.1.0/docs/lists/images/album-p.jpg differ diff --git a/libs/js/jquery-mobile-1.1.0/docs/lists/images/album-rh.jpg b/libs/js/jquery-mobile-1.1.0/docs/lists/images/album-rh.jpg new file mode 100755 index 0000000..614969a Binary files /dev/null and b/libs/js/jquery-mobile-1.1.0/docs/lists/images/album-rh.jpg differ diff --git a/libs/js/jquery-mobile-1.1.0/docs/lists/images/album-ws.jpg b/libs/js/jquery-mobile-1.1.0/docs/lists/images/album-ws.jpg new file mode 100755 index 0000000..33cf555 Binary files /dev/null and b/libs/js/jquery-mobile-1.1.0/docs/lists/images/album-ws.jpg differ diff --git a/libs/js/jquery-mobile-1.1.0/docs/lists/images/album-xx.jpg b/libs/js/jquery-mobile-1.1.0/docs/lists/images/album-xx.jpg new file mode 100755 index 0000000..78409fe Binary files /dev/null and b/libs/js/jquery-mobile-1.1.0/docs/lists/images/album-xx.jpg differ diff --git a/libs/js/jquery-mobile-1.1.0/docs/lists/images/de.png b/libs/js/jquery-mobile-1.1.0/docs/lists/images/de.png new file mode 100755 index 0000000..ac4a977 Binary files /dev/null and b/libs/js/jquery-mobile-1.1.0/docs/lists/images/de.png differ diff --git a/libs/js/jquery-mobile-1.1.0/docs/lists/images/fi.png b/libs/js/jquery-mobile-1.1.0/docs/lists/images/fi.png new file mode 100755 index 0000000..14ec091 Binary files /dev/null and b/libs/js/jquery-mobile-1.1.0/docs/lists/images/fi.png differ diff --git a/libs/js/jquery-mobile-1.1.0/docs/lists/images/gb.png b/libs/js/jquery-mobile-1.1.0/docs/lists/images/gb.png new file mode 100644 index 0000000..ff701e1 Binary files /dev/null and b/libs/js/jquery-mobile-1.1.0/docs/lists/images/gb.png differ diff --git a/libs/js/jquery-mobile-1.1.0/docs/lists/images/gf.png b/libs/js/jquery-mobile-1.1.0/docs/lists/images/gf.png new file mode 100755 index 0000000..8332c4e Binary files /dev/null and b/libs/js/jquery-mobile-1.1.0/docs/lists/images/gf.png differ diff --git a/libs/js/jquery-mobile-1.1.0/docs/lists/images/sj.png b/libs/js/jquery-mobile-1.1.0/docs/lists/images/sj.png new file mode 100755 index 0000000..160b6b5 Binary files /dev/null and b/libs/js/jquery-mobile-1.1.0/docs/lists/images/sj.png differ diff --git a/libs/js/jquery-mobile-1.1.0/docs/lists/images/us.png b/libs/js/jquery-mobile-1.1.0/docs/lists/images/us.png new file mode 100755 index 0000000..10f451f Binary files /dev/null and b/libs/js/jquery-mobile-1.1.0/docs/lists/images/us.png differ diff --git a/libs/js/jquery-mobile-1.1.0/docs/lists/index.html b/libs/js/jquery-mobile-1.1.0/docs/lists/index.html new file mode 100644 index 0000000..d5a1216 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/lists/index.html @@ -0,0 +1,72 @@ + + + + + + jQuery Mobile Docs - Lists + + + + + + + + + + +
      + +
      +

      Lists

      + Home + Search +
      + +
      + +

      Lists are used for data display, navigation, result lists, and data entry so jQuery Mobile includes a wide range of list types and formatting examples to cover most common design patterns.

      + + + + + +
      + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/lists/lists-all-full.html b/libs/js/jquery-mobile-1.1.0/docs/lists/lists-all-full.html new file mode 100644 index 0000000..5eade10 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/lists/lists-all-full.html @@ -0,0 +1,174 @@ + + + + + + jQuery Mobile Docs - Lists + + + + + + + + + + +
      + +
      +

      Linked list samples

      + Home + Search +
      + +
      + + + + +
      + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/lists/lists-count.html b/libs/js/jquery-mobile-1.1.0/docs/lists/lists-count.html new file mode 100644 index 0000000..d8e2e4e --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/lists/lists-count.html @@ -0,0 +1,83 @@ + + + + + + jQuery Mobile Docs - Lists Count Bubbles + + + + + + + + + + + + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/lists/lists-divider.html b/libs/js/jquery-mobile-1.1.0/docs/lists/lists-divider.html new file mode 100644 index 0000000..0c75c5f --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/lists/lists-divider.html @@ -0,0 +1,114 @@ + + + + + + jQuery Mobile Docs - List Dividers + + + + + + + + + + + + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/lists/lists-events.html b/libs/js/jquery-mobile-1.1.0/docs/lists/lists-events.html new file mode 100644 index 0000000..6a7fec4 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/lists/lists-events.html @@ -0,0 +1,108 @@ + + + + + + jQuery Mobile Docs - Lists Overview + + + + + + + + + + +
      + +
      +

      Lists

      + Home + Search +
      + +
      +
      +

      List views

      + + + +

      Bind events directly to the ol or ul element. Use jQuery Mobile's virtual events, or bind standard JavaScript events, like change, focus, blur, etc.:

      +
      
      +$( ".selector" ).bind( "change", function(event, ui) {
      +  ...
      +});
      +
      + +

      The listview plugin has the following custom event:

      + +
      + +
      create triggered when a listview is created
      +
      + +
      
      +$( ".selector" ).listview({
      +   create: function(event, ui) { ... }
      +});
      +			
      +
      + +
      + +
      + + + +
      + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/lists/lists-formatting.html b/libs/js/jquery-mobile-1.1.0/docs/lists/lists-formatting.html new file mode 100644 index 0000000..4451adf --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/lists/lists-formatting.html @@ -0,0 +1,135 @@ + + + + + + jQuery Mobile Docs - List Formatting + + + + + + + + + + +
      + +
      +

      List formatting

      + Home + Search +
      + +
      + + + + +
      + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/lists/lists-forms-inset.html b/libs/js/jquery-mobile-1.1.0/docs/lists/lists-forms-inset.html new file mode 100644 index 0000000..51b2751 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/lists/lists-forms-inset.html @@ -0,0 +1,249 @@ + + + + + + jQuery Mobile Docs - Inset Lists with Forms + + + + + + + + + + +
      + +
      +

      Inset with Forms

      + Home + Search +
      + +
      +
      +
      +
        +
      • + + +
      • +
      • + + +
      • +
      • + + +
      • +
      • + + +
      • +
      • + + +
      • +
      • +
        + Choose as many snacks as you'd like: + + + + + + + + + + + +
        +
      • + +
      • +
        + Font styling: + + + + + + + + +
        +
      • +
      • +
        + Choose a pet: + + + + + + + + + + + +
        +
      • + + +
      • +
        + Layout view: + + + + +
        +
      • + +
      • + + +
      • + +
      • + + +
      • + +
      • + + +
      • + +
      • +
        +
        +
        +
        +
      • + +
      + + + +
      + +
      + + + +
      + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/lists/lists-forms.html b/libs/js/jquery-mobile-1.1.0/docs/lists/lists-forms.html new file mode 100644 index 0000000..06855e7 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/lists/lists-forms.html @@ -0,0 +1,249 @@ + + + + + + jQuery Mobile Docs - Lists with Forms + + + + + + + + + + +
      + +
      +

      Lists with Forms

      + Home + Search +
      + +
      +
      +
      +
        +
      • + + +
      • +
      • + + +
      • +
      • + + +
      • +
      • + + +
      • +
      • + + +
      • +
      • +
        + Choose as many snacks as you'd like: + + + + + + + + + + + +
        +
      • + +
      • +
        + Font styling: + + + + + + + + +
        +
      • +
      • +
        + Choose a pet: + + + + + + + + + + + +
        +
      • + + +
      • +
        + Layout view: + + + + + + +
        +
      • + +
      • + + +
      • + +
      • + + +
      • + +
      • + + +
      • + +
      • +
        +
        +
        +
        +
      • + +
      + +
      + +
      + + + +
      + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/lists/lists-icons.html b/libs/js/jquery-mobile-1.1.0/docs/lists/lists-icons.html new file mode 100644 index 0000000..c9e57c7 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/lists/lists-icons.html @@ -0,0 +1,89 @@ + + + + + + jQuery Mobile Docs - List Icons + + + + + + + + + + + + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/lists/lists-inset.html b/libs/js/jquery-mobile-1.1.0/docs/lists/lists-inset.html new file mode 100644 index 0000000..de68e93 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/lists/lists-inset.html @@ -0,0 +1,175 @@ + + + + + + jQuery Mobile Docs - Lists with Form Controls + + + + + + + + + + +
      + +
      +

      Inset list samples

      + Home + Search +
      + +
      + + + + +
      + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/lists/lists-methods.html b/libs/js/jquery-mobile-1.1.0/docs/lists/lists-methods.html new file mode 100644 index 0000000..62bec22 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/lists/lists-methods.html @@ -0,0 +1,108 @@ + + + + + + jQuery Mobile Docs - Lists Overview + + + + + + + + + + +
      + +
      +

      Lists

      + Home + Search +
      + +
      +
      +

      List views

      + + + +

      The listview plugin has the following methods:

      + +
      +
      childPages retrieve the sub-pages
      +
      +

      This method returns a jQuery object containing all the immediate child pages of a nested list.

      + +
      
      +$('.selector').listview('childPages');
      +				
      +
      + +
      refresh update the listview
      +
      +

      If you manipulate a listview via JavaScript (e.g. add new LI elements), you must call the refresh method on it to update the visual styling.

      + +
      
      +$('.selector').listview('refresh');
      +				
      +
      + +
      + +
      + + + +
      + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/lists/lists-nested.html b/libs/js/jquery-mobile-1.1.0/docs/lists/lists-nested.html new file mode 100644 index 0000000..d35f893 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/lists/lists-nested.html @@ -0,0 +1,194 @@ + + + + + + jQuery Mobile Docs - Nested Lists + + + + + + + + + + +
      + +
      +

      Nested list

      + Home + Search +
      + +
      +
      + +
      + + + +
      + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/lists/lists-ol.html b/libs/js/jquery-mobile-1.1.0/docs/lists/lists-ol.html new file mode 100644 index 0000000..60e5864 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/lists/lists-ol.html @@ -0,0 +1,98 @@ + + + + + + jQuery Mobile Docs - Ordered Lists + + + + + + + + + + + + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/lists/lists-options.html b/libs/js/jquery-mobile-1.1.0/docs/lists/lists-options.html new file mode 100644 index 0000000..bd043fb --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/lists/lists-options.html @@ -0,0 +1,222 @@ + + + + + + jQuery Mobile Docs - Lists Overview + + + + + + + + + + +
      + +
      +

      Lists

      + Home + Search +
      + +
      +
      +

      List views

      + + + +

      The listview plugin has the following options:

      + +
      +
      countTheme string
      +
      +

      default: "c"

      +

      Sets the color scheme (swatch) for list item count bubbles. It accepts a single letter from a-z that maps to the swatches included in your theme. To set the value for all instances of this widget, bind this option to the mobileinit event:

      +
      $( document ).bind( "mobileinit", function(){
      +    $.mobile.listview.prototype.options.countTheme = "a";
      +});
      +
      +

      This option is also exposed as a data attribute: data-count-theme="a".

      +
      + +
      dividerTheme string
      +
      +

      default: "b"

      +

      Sets the color scheme (swatch) for list dividers. It accepts a single letter from a-z that maps to the swatches included in your theme. To set the value for all instances of this widget, bind this option to the mobileinit event:

      +
      $( document ).bind( "mobileinit", function(){
      +    $.mobile.listview.prototype.options.dividerTheme = "a";
      +});
      +
      +

      This option is also exposed as a data attribute: data-dividertheme="a".

      +
      + +
      filter boolean
      +
      +

      default: false

      +

      Adds a search filter bar to listviews. To set the value for all instances of this widget, bind this option to the mobileinit event:

      +
      $( document ).bind( "mobileinit", function(){
      +    $.mobile.listview.prototype.options.filter = true;
      +});
      +
      +

      This option is also exposed as a data attribute: data-filter="true".

      +
      + +
      filterCallback function
      +
      +

      The function to determine which rows to hide when the search filter textbox changes. The function accepts two arguments -- the text of the list item (or data-filtertext value if present), and the search string. Return true to hide the item, false to leave it visible. To set the value for all instances of this widget, bind this option to the mobileinit event:

      +
      $( document ).bind( "mobileinit", function(){
      +    $.mobile.listview.prototype.options.filterCallback = function( text, searchValue ) {
      +        // only show items that *begin* with the search string
      +        return text.toLowerCase().substring( 0, searchValue.length ) !== searchValue;
      +    };
      +});
      +
      +
      + +
      filterPlaceholder string
      +
      +

      default: "Filter items..."

      +

      The placeholder text used in search filter bars. To set the value for all instances of this widget, bind this option to the mobileinit event:

      +
      $( document ).bind( "mobileinit", function(){
      +    $.mobile.listview.prototype.options.filterPlaceholder = "Search...";
      +});
      +
      +

      This option is also exposed as a data attribute: data-filter-placeholder="Search...".

      +
      + +
      filterTheme string
      +
      +

      default: "c"

      +

      Sets the color scheme (swatch) for the search filter bar. It accepts a single letter from a-z that maps to the swatches included in your theme. To set the value for all instances of this widget, bind this option to the mobileinit event:

      +
      $( document ).bind( "mobileinit", function(){
      +    $.mobile.listview.prototype.options.filterTheme = "a";
      +});
      +
      +

      This option is also exposed as a data attribute: data-filter-theme="a".

      +
      + +
      headerTheme string
      +
      +

      default: "b"

      +

      Sets the color scheme (swatch) for headers of nested list sub pages. It accepts a single letter from a-z that maps to the swatches included in your theme. To set the value for all instances of this widget, bind this option to the mobileinit event:

      +
      $( document ).bind( "mobileinit", function(){
      +    $.mobile.listview.prototype.options.headerTheme = "a";
      +});
      +
      +

      This option is also exposed as a data attribute: data-header-theme="a".

      +
      + +
      initSelector CSS selector string
      +
      +

      default: ":jqmData(role='listview')"

      +

      This is used to define the selectors (element types, data roles, etc.) that will automatically be initialized as list views. To change which elements are initialized, bind this option to the mobileinit event:

      +
      $( document ).bind( "mobileinit", function(){
      +    $.mobile.listview.prototype.options.initSelector = ".mylistview";
      +});
      +
      +
      + +
      inset boolean
      +
      +

      default: false

      +

      Adds inset list styles. To set the value for all instances of this widget, bind this option to the mobileinit event:

      +
      $( document ).bind( "mobileinit", function(){
      +    $.mobile.listview.prototype.options.inset = true;
      +});
      +
      +

      This option is also exposed as a data attribute: data-inset="true".

      +
      + +
      splitIcon string
      +
      +

      default: "arrow-r"

      +

      Applies an icon from the icon set to all split list buttons. To set the value for all instances of this widget, bind this option to the mobileinit event:

      +
      $( document ).bind( "mobileinit", function(){
      +    $.mobile.listview.prototype.options.splitIcon = "a";
      +});
      +
      +

      This option is also exposed as a data attribute: data-split-icon="a".

      +
      + +
      splitTheme string
      +
      +

      default: "b"

      +

      Sets the color scheme (swatch) for split list buttons. It accepts a single letter from a-z that maps to the swatches included in your theme. To set the value for all instances of this widget, bind this option to the mobileinit event:

      +
      $( document ).bind( "mobileinit", function(){
      +    $.mobile.listview.prototype.options.splitTheme = "a";
      +});
      +
      +

      This option is also exposed as a data attribute: data-split-theme="a".

      +
      + +
      theme string
      +
      +

      default: null, inherited from parent

      +

      Sets the color scheme (swatch) for this widget. It accepts a single letter from a-z that maps to the swatches included in your theme. By default, it will inherit the same swatch color as its parent container if not explicitly set. To set the value for all instances of this widget, bind this option to the mobileinit event:

      +
      $( document ).bind( "mobileinit", function(){
      +    $.mobile.listview.prototype.options.theme = "a";
      +});
      +
      +

      This option is also exposed as a data attribute: data-theme="a".

      +
      + +
      + +
      + + + +
      + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/lists/lists-performance.html b/libs/js/jquery-mobile-1.1.0/docs/lists/lists-performance.html new file mode 100644 index 0000000..c197f4e --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/lists/lists-performance.html @@ -0,0 +1,578 @@ + + + + + + jQuery Mobile Docs - List Performance Test + + + + + + + + + + +
      + +
      +

      500 item list

      + Home + Search +
      + +
      +
      + +
      + + + +
      + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/lists/lists-readonly-inset.html b/libs/js/jquery-mobile-1.1.0/docs/lists/lists-readonly-inset.html new file mode 100644 index 0000000..512b95a --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/lists/lists-readonly-inset.html @@ -0,0 +1,171 @@ + + + + + + jQuery Mobile Docs - Readonly Inset Lists + + + + + + + + + + +
      + +
      +

      Readonly Inset Lists

      + Home + Search +
      + +
      +
      +

      Simple list

      + +
        +
      • Acura
      • +
      • Audi
      • +
      • BMW
      • +
      • Cadillac
      • +
      • Ferrari
      • +
      + +

      Count bubbles

      +
        +
      • Inbox 12
      • +
      • Outbox 0
      • +
      • Drafts 4
      • +
      • Sent 328
      • +
      • Trash 62
      • +
      + +

      Numbered list

      +
        +
      1. The Godfather
      2. +
      3. Inception
      4. +
      5. The Good, the Bad and the Ugly
      6. +
      7. Pulp Fiction
      8. +
      9. Schindler's List
      10. +
      + +

      Divided, formatted content

      +
        +
      • +

        Stephen Weber

        +

        You've been invited to a meeting at Filament Group in Boston, MA

        +

        Hey Stephen, if you're available at 10am tomorrow, we've got a meeting with the jQuery team.

        +

        6:24PM

        +
      • +
      • +

        jQuery Team

        +

        Boston Conference Planning

        +

        In preparation for the upcoming conference in Boston, we need to start gathering a list of sponsors and speakers.

        +

        9:18AM

        +
      • +
      + + + + +

      Icon list

      +
        +
      • FranceFrance 4
      • +
      • GermanyGermany 4
      • +
      • Great BritainGreat Britain 0
      • +
      • FinlandFinland 12
      • +
      • NorwayNorway 328
      • +
      • United StatesUnited States 62
      • +
      + +

      Thumbnail list

      + +
        +
      • + +

        Broken Bells

        +

        Broken Bells

        +
      • +
      • + +

        Warning

        +

        Hot Chip

        +
      • +
      • + +

        Wolfgang Amadeus Phoenix

        +

        Phoenix

        +
      • +
      + +

      Divided, filterable list

      +
        +
      • A
      • +
      • Adam Kinkaid
      • +
      • Alex Wickerham
      • +
      • Avery Johnson
      • +
      • B
      • +
      • Bob Cabot
      • +
      • C
      • +
      • Caleb Booth
      • +
      • Christopher Adams
      • +
      + + + + + + +
      + + + +
      + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/lists/lists-readonly.html b/libs/js/jquery-mobile-1.1.0/docs/lists/lists-readonly.html new file mode 100644 index 0000000..8082149 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/lists/lists-readonly.html @@ -0,0 +1,173 @@ + + + + + + jQuery Mobile Docs - Inset Readonly Lists + + + + + + + + + + +
      + + + +
      +

      Readonly lists

      + Home + Search +
      + +
      +
      +

      Here is a variety of full-width lists that are read-only. If a list has the data-role="listview" attribute, but the contents aren't linked, it will display as read-only. These look like normal lists, except they don't have a right arrow and the text is set to a smaller size to save space.

      + +

      Simple list

      + +
        +
      • Acura
      • +
      • Audi
      • +
      • BMW
      • +
      • Cadillac
      • +
      • Ferrari
      • +
      + +

      Count bubbles

      +
        +
      • Inbox 12
      • +
      • Outbox 0
      • +
      • Drafts 4
      • +
      • Sent 328
      • +
      • Trash 62
      • +
      + +

      Numbered list

      +
        +
      1. The Godfather
      2. +
      3. Inception
      4. +
      5. The Good, the Bad and the Ugly
      6. +
      7. Pulp Fiction
      8. +
      9. Schindler's List
      10. +
      + +

      Divided, formatted content

      +
        +
      • +

        Stephen Weber

        +

        You've been invited to a meeting at Filament Group in Boston, MA

        +

        Hey Stephen, if you're available at 10am tomorrow, we've got a meeting with the jQuery team.

        +

        6:24PM

        +
      • +
      • +

        jQuery Team

        +

        Boston Conference Planning

        +

        In preparation for the upcoming conference in Boston, we need to start gathering a list of sponsors and speakers.

        +

        9:18AM

        +
      • +
      + + + + +

      Icon list

      +
        +
      • FranceFrance 4
      • +
      • GermanyGermany 4
      • +
      • Great BritainGreat Britain 0
      • +
      • FinlandFinland 12
      • +
      • NorwayNorway 328
      • +
      • United StatesUnited States 62
      • +
      + +

      Thumbnail list

      + +
        +
      • + +

        Broken Bells

        +

        Broken Bells

        +
      • +
      • + +

        Warning

        +

        Hot Chip

        +
      • +
      • + +

        Wolfgang Amadeus Phoenix

        +

        Phoenix

        +
      • +
      + +

      Divided, filterable list

      +
        +
      • A
      • +
      • Adam Kinkaid
      • +
      • Alex Wickerham
      • +
      • Avery Johnson
      • +
      • B
      • +
      • Bob Cabot
      • +
      • C
      • +
      • Caleb Booth
      • +
      • Christopher Adams
      • +
      + + +
      + + + +
      + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/lists/lists-search-filtertext.html b/libs/js/jquery-mobile-1.1.0/docs/lists/lists-search-filtertext.html new file mode 100644 index 0000000..45c77d8 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/lists/lists-search-filtertext.html @@ -0,0 +1,94 @@ + + + + + + jQuery Mobile Docs - Filtered Lists Using Hidden Data + + + + + + + + + + +
      + +
      +

      Search hidden data

      + Home + Search +
      + +
      +
      +

      By default, the listview filter simply searches against the content in each list item. If you want the filter to search against different content, add the data-filtertext attribute to the item and populate it with one or many keywords and phrases that should be used to match against. Note that if this attribute is added, the contents of the list item are ignored.

      +

      This attribute is useful for dealing with allowing for ticker symbols and full company names to be searched, or for covering common spellings and abbreviations for countries.

      + +
      		
      +<li data-filtertext="NASDAQ:AAPL Apple Inc."><a href="#">Apple</a></li>
      +<li data-filtertext="USA U.S.A. United States of America"><a href="#">United States</a></li>
      +
      + + +
      + + + +
      + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/lists/lists-search-inset.html b/libs/js/jquery-mobile-1.1.0/docs/lists/lists-search-inset.html new file mode 100644 index 0000000..ea12c48 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/lists/lists-search-inset.html @@ -0,0 +1,100 @@ + + + + + + jQuery Mobile Docs - Filtered Inset Lists + + + + + + + + + + + + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/lists/lists-search-with-dividers.html b/libs/js/jquery-mobile-1.1.0/docs/lists/lists-search-with-dividers.html new file mode 100644 index 0000000..ccae6b6 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/lists/lists-search-with-dividers.html @@ -0,0 +1,113 @@ + + + + + jQuery Mobile Docs - Filtered Lists with Dividers + + + + + + + + + + + + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/lists/lists-search.html b/libs/js/jquery-mobile-1.1.0/docs/lists/lists-search.html new file mode 100644 index 0000000..5e75dcc --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/lists/lists-search.html @@ -0,0 +1,100 @@ + + + + + + jQuery Mobile Docs - Filtered Lists + + + + + + + + + + + + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/lists/lists-split-purchase.html b/libs/js/jquery-mobile-1.1.0/docs/lists/lists-split-purchase.html new file mode 100644 index 0000000..87681f9 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/lists/lists-split-purchase.html @@ -0,0 +1,35 @@ + + + + + + jQuery Mobile Docs - Sample Dialog + + + + + + + + + + + +
      + +
      +

      Purchase?

      +
      + +
      +

      This album costs $10.99 and includes 9 tracks.

      +

      Your download will begin immediately on your mobile device and all tracks will by added your your library next time you sync.

      + Purchase album + No thanks + +
      + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/lists/lists-split.html b/libs/js/jquery-mobile-1.1.0/docs/lists/lists-split.html new file mode 100644 index 0000000..b461be0 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/lists/lists-split.html @@ -0,0 +1,147 @@ + + + + + + jQuery Mobile Docs - Split Button Lists + + + + + + + + + + + + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/lists/lists-themes.html b/libs/js/jquery-mobile-1.1.0/docs/lists/lists-themes.html new file mode 100644 index 0000000..e41c289 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/lists/lists-themes.html @@ -0,0 +1,264 @@ + + + + + + jQuery Mobile Docs - Theming Lists + + + + + + + + + + +
      + +
      +

      Theming lists

      + Home + Search +
      + +
      +
      + +

      All the standard button swatches can be applied to lists. The framework assigns a default list theme swatch of "c" (silver in the default theme) and swatch "b" (blue in default theme) for dividers. Below is a default themed list.

      + + +<ul data-role="listview" data-inset="true"> + + + +

      Theming list items

      +

      The list item color scheme can be changed to any button color theme swatch by adding the data-theme attribute to the list, and setting the letter theme swatch. Here is the same list above with the "a" swatch applied.

      + + +<ul data-role="listview" data-inset="true" data-theme="d"> + + + + +

      data-theme attributes also work at the LI-level, for styling a single item.

      + + + +

      Theming dividers

      + +

      The theme for list dividers can be set by adding the data-divider-theme to the list and specifying a swatch letter. Here is an example of the same list above with swatch "d" set on the dividers.

      + + +<ul data-role="listview" data-inset="true" data-theme="d" data-divider-theme="e"> + + + + +

      Theming count bubbles

      + +

      The theme for count bubbles can be set by adding the data-count-theme to the list and specifying a swatch letter. Here is an example with swatch "e" set on the dividers.

      + + +<ul data-role="listview" data-inset="true" data-theme="d" data-divider-theme="e" data-count-theme="b"> + + + + +

      Theming icons

      + +

      The default icon for each list item is arrow-r. To override this, set the data-icon attribute on the desired list item to the name of a standard icon. To prevent icons from appearing altogether, set the data-icon attribute to "false".

      +
      +
      +<li data-icon="info"><a href="#">Notices</a></li>
      +<li data-icon="alert"><a href="#">Alerts</a></li>
      +<li data-icon="false"><a href="#">No icon</a></li>
      +
      +
      + + + +

      Theming split buttons

      + +

      For split lists which a second button, the framework default to "b" for the theme swatch (blue in the default theme) Here is a default split list:

      + + + + +<ul data-role="listview" data-inset="true" data-split-theme="a"> + +

      To specify the color swatch for the icon button on the right, add the data-split-theme to the list and specify a swatch letter. This attribute can also be added to individual split inside list items by adding a data-theme attribute to specific links (see second list item).

      + + +

      The icon for the split theme can set at the list level by adding the data-split-icon to the list and specifying a standard icon. This attribute can also be added to individual split inside list items by adding a data-icon attribute to specific links (see second list item).

      + + +<ul data-role="listview" data-inset="true" data-split-theme="d" data-split-icon="delete"> + + + + + + +

      Examples of all basic list swatches

      + +

      A swatch

      + + +

      B swatch

      + + +

      C swatch

      + + +

      D swatch

      + + +

      E swatch

      + + + +
      + + + +
      + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/lists/lists-thumbnails.html b/libs/js/jquery-mobile-1.1.0/docs/lists/lists-thumbnails.html new file mode 100644 index 0000000..1cc6a14 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/lists/lists-thumbnails.html @@ -0,0 +1,135 @@ + + + + + + jQuery Mobile Docs - Lists with Thumbnails + + + + + + + + + + + + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/lists/lists-ul.html b/libs/js/jquery-mobile-1.1.0/docs/lists/lists-ul.html new file mode 100644 index 0000000..e23106c --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/lists/lists-ul.html @@ -0,0 +1,100 @@ + + + + + + jQuery Mobile Docs - Basic Lists + + + + + + + + + + + + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/nav.html b/libs/js/jquery-mobile-1.1.0/docs/nav.html new file mode 100644 index 0000000..46e86d9 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/nav.html @@ -0,0 +1,296 @@ + + + + + + jQuery UI Mobile Framework - Documentation + + + + + + + + + + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/pages/dialog-alt.html b/libs/js/jquery-mobile-1.1.0/docs/pages/dialog-alt.html new file mode 100644 index 0000000..275f0b7 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/pages/dialog-alt.html @@ -0,0 +1,33 @@ + + + + + + jQuery Mobile Framework - Dialog Example + + + + + + + + + + +
      +
      +

      Dialog

      + +
      + +
      +

      I'm colorful

      +

      This is a regular page, styled as a dialog. To create a dialog, just link to a normal page and include a transition and data-rel="dialog" attribute.

      + Good for you + Don't care, really +
      +
      + + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/pages/dialog-buttons.html b/libs/js/jquery-mobile-1.1.0/docs/pages/dialog-buttons.html new file mode 100644 index 0000000..0a36872 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/pages/dialog-buttons.html @@ -0,0 +1,33 @@ + + + + + + jQuery Mobile Framework - Dialog Example + + + + + + + + + + +
      + + + +
      + + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/pages/dialog-overlay.html b/libs/js/jquery-mobile-1.1.0/docs/pages/dialog-overlay.html new file mode 100644 index 0000000..81fb765 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/pages/dialog-overlay.html @@ -0,0 +1,32 @@ + + + + + + jQuery Mobile Framework - Dialog Example + + + + + + + + + + +
      +
      +

      Dialog

      +
      + +
      +

      Custom overlay

      +

      This dialog adds data-overlay-theme="e" to the page container to set the overlay swatch color.

      + I like it +
      + +
      + + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/pages/dialog-success.html b/libs/js/jquery-mobile-1.1.0/docs/pages/dialog-success.html new file mode 100644 index 0000000..512c466 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/pages/dialog-success.html @@ -0,0 +1,31 @@ + + + + + + jQuery Mobile Framework - Dialog Example + + + + + + + + + + +
      + + +
      +

      Flickr upload:

      +

      Photos posted successfully

      + + View photo page + Done +
      +
      + + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/pages/dialog-with-select.html b/libs/js/jquery-mobile-1.1.0/docs/pages/dialog-with-select.html new file mode 100644 index 0000000..2401afe --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/pages/dialog-with-select.html @@ -0,0 +1,118 @@ + + + + + + jQuery Mobile Framework - Dialog Example with Select + + + + + + + + + + + +
      + +
      +

      Dialog select test

      +
      + + +
      + + + + + + + +
      + +
      +

      Sample Dialogs

      +
      + +
      + +
      +
      + + +
      + +
      + + +
      + + Real Submit Would go here +
      + Cancel +
      +
      + + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/pages/dialog.html b/libs/js/jquery-mobile-1.1.0/docs/pages/dialog.html new file mode 100644 index 0000000..2594781 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/pages/dialog.html @@ -0,0 +1,34 @@ + + + + + + jQuery Mobile Framework - Dialog Example + + + + + + + + + + +
      + +
      +

      Dialog

      + +
      + +
      +

      Delete page?

      +

      This is a regular page, styled as a dialog. To create a dialog, just link to a normal page and include a transition and data-rel="dialog" attribute.

      + Sounds good + Cancel +
      +
      + + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/pages/docs-links-urltest/index.html b/libs/js/jquery-mobile-1.1.0/docs/pages/docs-links-urltest/index.html new file mode 100644 index 0000000..e5aea72 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/pages/docs-links-urltest/index.html @@ -0,0 +1,28 @@ + + + + + + jQuery Mobile Framework - Test URL Example + + + + + + + + + + +
      +
      +

      URL Test Page

      +
      +
      +

      This is a regular page that updated the url with a different value than was requested.

      +
      +
      + + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/pages/dynamic-samples/animals.html b/libs/js/jquery-mobile-1.1.0/docs/pages/dynamic-samples/animals.html new file mode 100644 index 0000000..62a8fe9 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/pages/dynamic-samples/animals.html @@ -0,0 +1,27 @@ + + + + + +Animals + + + + + + + + +
      +

      Animals

      +
      +

      All your favorites from aardvarks to zebras.

      +
        +
      • Pets
      • +
      • Farm Animals
      • +
      • Wild Animals
      • +
      +
      +
      + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/pages/dynamic-samples/category.php b/libs/js/jquery-mobile-1.1.0/docs/pages/dynamic-samples/category.php new file mode 100644 index 0000000..72c8947 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/pages/dynamic-samples/category.php @@ -0,0 +1,150 @@ + array( + name => "Animals", + description => "All your favorites from aardvarks to zebras.", + items => array( + array( + name => "Pets", + ), + array( + name => "Farm Animals", + ), + array( + name => "Wild Animals", + ) + ) + ), + colors => array( + name => "Colors", + description => "Fresh colors from the magic rainbow.", + items => array( + array( + name => "Blue", + ), + array( + name => "Green", + ), + array( + name => "Orange", + ), + array( + name => "Purple", + ), + array( + name => "Red", + ), + array( + name => "Yellow", + ), + array( + name => "Violet", + ) + ) + ), + vehicles => array( + name => "Vehicles", + description => "Everything from cars to planes.", + items => array( + array( + name => "Cars", + ), + array( + name => "Planes", + ), + array( + name => "Construction", + ) + ) + ) +); + +// Get the name of the category to display from +// the query params for the script. + +$category_name = ''; +if ( $_GET[ 'id' ] ) { + $category_name = $_GET[ 'id' ]; +} + +// Now get the category data, by name, from our in-memory +// dictionary. This is the part where a script normally fetches +// the data from a database. + +$category_obj = $category_data[ $category_name ]; + +// Now figure out how the script is being called. If it's being +// called via XmlHttpRequest, then send the data back as JSON. +// If not, then send it back as a list in an HTML document. + +if( $_SERVER[ "HTTP_X_REQUESTED_WITH" ] && $_SERVER[ "HTTP_X_REQUESTED_WITH" ] ==="XMLHttpRequest" ) { + // Data should be written out as JSON. + header("Content-type: application/json"); + if ( !$category_obj ) { + echo 'null'; + } else { + echo '{"name":"' . $category_obj[ 'name' ] + . '","description":"' . $category_obj[ 'description' ] + . '","items":['; + + $arr = $category_obj[ 'items' ]; + $count = count($arr); + for ( $i = 0; $i < $count; $i++ ) { + if ( $i ) { + echo ","; + } + echo '{"name":"' . $arr[ $i ][ 'name' ] . '"}'; + } + echo "]}"; + } +} else { + // Data should be written out as HTML. + header("Content-type: text/html"); +?> + + + + + +Vehicles + + + + + +
      +

      +
      + +

      No matches found.

      + +

      +
        +" . $arr[ $i ][ 'name' ] . "\n"; + } +?> +
      + +
      +
      + + + + + + + +Colors + + + + + + + + +
      +

      Colors

      +
      +

      Fresh colors from the magic rainbow.

      +
        +
      • Blue
      • +
      • Green
      • +
      • Orange
      • +
      • Purple
      • +
      • Red
      • +
      • Yellow
      • +
      • Violet
      • +
      +
      +
      + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/pages/dynamic-samples/index.html b/libs/js/jquery-mobile-1.1.0/docs/pages/dynamic-samples/index.html new file mode 100644 index 0000000..4120c2c --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/pages/dynamic-samples/index.html @@ -0,0 +1,26 @@ + + + + + +Dynamic Page Samples + + + + + + + + +
      +

      Categories

      + +
      + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/pages/dynamic-samples/sample-reuse-page-external.html b/libs/js/jquery-mobile-1.1.0/docs/pages/dynamic-samples/sample-reuse-page-external.html new file mode 100644 index 0000000..18bf164 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/pages/dynamic-samples/sample-reuse-page-external.html @@ -0,0 +1,121 @@ + + + + + +changePage JSON Sample + + + + + + + + + +
      +

      Categories

      +
      +

      Select a Category Below:

      + +
      +
      +
      +

      +
      +
      + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/pages/dynamic-samples/sample-reuse-page.html b/libs/js/jquery-mobile-1.1.0/docs/pages/dynamic-samples/sample-reuse-page.html new file mode 100644 index 0000000..202bffd --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/pages/dynamic-samples/sample-reuse-page.html @@ -0,0 +1,197 @@ + + + + + +changePage JSON Sample + + + + + + + + +
      +

      Categories

      +
      +

      Select a Category Below:

      + +
      + +
      +
      +

      +
      +
      + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/pages/dynamic-samples/vehicles.html b/libs/js/jquery-mobile-1.1.0/docs/pages/dynamic-samples/vehicles.html new file mode 100644 index 0000000..cd1824e --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/pages/dynamic-samples/vehicles.html @@ -0,0 +1,27 @@ + + + + + +Vehicles + + + + + + + + +
      +

      Vehicles

      +
      +

      Everything from cars to planes.

      +
        +
      • Cars
      • +
      • Planes
      • +
      • Destruction
      • +
      +
      +
      + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/pages/index.html b/libs/js/jquery-mobile-1.1.0/docs/pages/index.html new file mode 100644 index 0000000..39c2891 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/pages/index.html @@ -0,0 +1,52 @@ + + + + + + jQuery Mobile Docs - Pages + + + + + + + + + + +
      + +
      +

      Pages

      + Home + Search +
      + +
      + +

      jQuery Mobile includes automatic AJAX page loading of external pages with back button history support, a set of animated page transitions and simple tools for displaying pages as dialogs.

      + + + + + +
      +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/pages/multipage-template.html b/libs/js/jquery-mobile-1.1.0/docs/pages/multipage-template.html new file mode 100755 index 0000000..acd9643 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/pages/multipage-template.html @@ -0,0 +1,83 @@ + + + + + + + Multi-page template + + + + + + + + + +
      + +
      +

      Multi-page

      +
      + +
      +

      One

      + +

      I have an id of "one" on my page container. I'm first in the source order so I'm shown when the page loads.

      + +

      This is a multi-page boilerplate template that you can copy to build your first jQuery Mobile page. This template contains multiple "page" containers inside, unlike a single page template that has just one page within it.

      +

      Just view the source and copy the code to get started. All the CSS and JS is linked to the jQuery CDN versions so this is super easy to set up. Remember to include a meta viewport tag in the head to set the zoom level.

      +

      You link to internal pages by referring to the ID of the page you want to show. For example, to link to the page with an ID of "two", my link would have a href="#two" in the code.

      + +

      Show internal pages:

      +

      Show page "two"

      +

      Show page "popup" (as a dialog)

      +
      + +
      +

      Page Footer

      +
      +
      + + + +
      + +
      +

      Two

      +
      + +
      +

      Two

      +

      I have an id of "two" on my page container. I'm the second page container in this multi-page template.

      +

      Notice that the theme is different for this page because we've added a few data-theme swatch assigments here to show off how flexible it is. You can add any content or widget to these pages, but we're keeping these simple.

      +

      Back to page "one"

      + +
      + +
      +

      Page Footer

      +
      +
      + + + + + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/pages/page-anatomy.html b/libs/js/jquery-mobile-1.1.0/docs/pages/page-anatomy.html new file mode 100644 index 0000000..7ca9e95 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/pages/page-anatomy.html @@ -0,0 +1,225 @@ + + + + + + jQuery Mobile Docs - Anatomy of a Page + + + + + + + + + + +
      + +
      +

      Anatomy of a Page

      + Home + Search +
      + +
      +
      +

      The jQuery Mobile "page" structure is optimized to support either single pages, or local internal linked "pages" within a page.

      + +

      The goal of this model is to allow developers to create websites using best practices — where ordinary links will "just work" without any special configuration — while creating a rich, native-like experience that can't be achieved with standard HTTP requests.

      + +

      Mobile page structure

      + +

      A jQuery Mobile site must start with an HTML5 'doctype' to take full advantage of all of the framework's features. (Older devices with browsers that don't understand HTML5 will safely ignore the 'doctype' and various custom attributes.)

      +

      In the 'head', references to jQuery, jQuery Mobile and the mobile theme CSS are all required to start things off. jQuery Mobile 1.1 works with both 1.6.4 and 1.7.1 versions of jQuery core. We recommend linking to the files hosted on the jQuery CDN for best performance:

      + +
      
      +<!DOCTYPE html> 
      +<html> 
      +	<head> 
      +	<title>Page Title</title> 
      +	
      +	<meta name="viewport" content="width=device-width, initial-scale=1"> 
      +
      +	<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
      +	<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
      +	<script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
      +</head> 
      +
      +<body> 
      +...content goes here...
      +</body>
      +</html>
      +
      + +

      Viewport meta tag

      +

      Note above that there is a meta viewport tag in the head to specify how the browser should display the page zoom level and dimensions. If this isn't set, many mobile browsers will use a "virtual" page width around 900 pixels to make it work well with existing desktop sites but the screens may look zoomed out and too wide. By setting the viewport attributes to content="width=device-width, initial-scale=1", the width will be set to the pixel width of the device screen.

      + +
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      + +

      These settings do not disable the user's ability to zoom the pages, which is nice from an accessibility perspective. There is a minor issue in iOS that doesn't properly set the width when changing orientations with these viewport settings, but this will hopefully be fixed in a future release. You can set other viewport values to disable zooming if required since this is part of your page content, not the library.

      + +

      Inside the body: Pages

      +

      Inside the <body> tag, each view or "page" on the mobile device is identified with an element (usually a div) with the data-role="page" attribute. View the data- attribute reference to see all the possible attributes you can add to pages.

      + +
      +
      <div data-role="page"> 
      +	...
      +</div> 
      +
      +
      + +

      Within the "page" container, any valid HTML markup can be used, but for typical pages in jQuery Mobile, the immediate children of a "page" are divs with data-roles of "header", "content", and "footer".

      + +
      +
      <div data-role="page"> 
      +	<div data-role="header">...</div> 
      +	<div data-role="content">...</div> 
      +	<div data-role="footer">...</div> 
      +</div> 
      +
      +
      + + +

      Putting it together: Basic single page template

      + +

      Putting it all together, this is the standard boilerplate page template you should start with on a project:

      + +
      
      +<!DOCTYPE html> 
      +<html> 
      +	<head> 
      +	<title>Page Title</title> 
      +	
      +	<meta name="viewport" content="width=device-width, initial-scale=1"> 
      +
      +	<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
      +	<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
      +	<script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
      +</head> 
      +<body> 
      +
      +<div data-role="page">
      +
      +	<div data-role="header">
      +		<h1>Page Title</h1>
      +	</div><!-- /header -->
      +
      +	<div data-role="content">	
      +		<p>Page content goes here.</p>		
      +	</div><!-- /content -->
      +
      +	<div data-role="footer">
      +		<h4>Page Footer</h4>
      +	</div><!-- /footer -->
      +</div><!-- /page -->
      +
      +</body>
      +</html>
      +
      + + View boilerplate template + + +

      Multi-page template structure

      + +

      A single HTML document can contain multiple 'pages' that are loaded together by stacking multiple divs with a data-role of "page". Each 'page' block needs a unique ID (id="foo") that will be used to link internally between 'pages' (href="#foo"). When a link is clicked, the framework will look for an internal 'page' with the ID and transition it into view.

      + +

      Here is an example of a 2 "page" site built with two jQuery Mobile divs navigated by linking to an ID placed on each page wrapper. Note that the IDs on the page wrappers are only needed to support the internal page linking, and are optional if each page is a separate HTML document. Here is what two pages look inside the body element.

      + +
      
      +<body> 
      +
      +<!-- Start of first page -->
      +<div data-role="page" id="foo">
      +
      +	<div data-role="header">
      +		<h1>Foo</h1>
      +	</div><!-- /header -->
      +
      +	<div data-role="content">	
      +		<p>I'm first in the source order so I'm shown as the page.</p>		
      +		<p>View internal page called <a href="#bar">bar</a></p>	
      +	</div><!-- /content -->
      +
      +	<div data-role="footer">
      +		<h4>Page Footer</h4>
      +	</div><!-- /footer -->
      +</div><!-- /page -->
      +
      +
      +<!-- Start of second page -->
      +<div data-role="page" id="bar">
      +
      +	<div data-role="header">
      +		<h1>Bar</h1>
      +	</div><!-- /header -->
      +
      +	<div data-role="content">	
      +		<p>I'm the second in the source order so I'm hidden when the page loads. I'm just shown if a link that references my ID is beeing clicked.</p>		
      +		<p><a href="#foo">Back to foo</a></p>	
      +	</div><!-- /content -->
      +
      +	<div data-role="footer">
      +		<h4>Page Footer</h4>
      +	</div><!-- /footer -->
      +</div><!-- /page -->
      +</body>
      +
      + + View multi-page template + +

      + +

      PLEASE NOTE: Since we are using the hash to track navigation history for all the Ajax 'pages', it's not currently possible to deep link to an anchor (index.html#foo) on a page in jQuery Mobile, because the framework will look for a 'page' with an ID of #foo instead of the native behavior of scrolling to the content with that ID.

      + + +

      Conventions, not requirements

      + +

      Although the page structure outlined above is a recommended approach for a standard web app built with jQuery Mobile, the framework is very flexible with document structure. The page, header, content, and footer data-role elements are optional and are mostly helpful for providing some basic formatting and structure. The page wrapper that used to be required for auto-initialization to work is now optional for single page documents, so there isn't any required markup at all. For a web page with a custom layout, all of these structural elements can be omitted and the Ajax navigation and all widgets will work just like they do in the boilerplate structure. Behind the scenes, the framework will inject the page wrapper if it's not included in the markup because it’s needed for managing pages, but the starting markup can now be extremely simple.

      + +

      Note that in a multi-page setup, you are required to have page wrappers in your markup in order to group the content into multiple pages.

      + + + + +
      + + + +
      + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/pages/page-cache.html b/libs/js/jquery-mobile-1.1.0/docs/pages/page-cache.html new file mode 100644 index 0000000..c51107c --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/pages/page-cache.html @@ -0,0 +1,125 @@ + + + + + + jQuery Mobile Docs - Prefetching & caching pages + + + + + + + + + + +
      + +
      +

      Prefetching & caching pages

      + Home + Search +
      + +
      +
      + + +

      Prefetching pages

      + +

      Usually, it's a good idea to store your app's pages in several single-page templates instead of one large multi-page template. This minimizes the size of the page's DOM.

      + +

      When using single-page templates, you can prefetch pages into the DOM so that they're available instantly when the user visits them. To prefetch a page, add the data-prefetch attribute to a link that points to the page. jQuery Mobile then loads the target page in the background after the primary page has loaded and the pagecreate event has triggered. For example:

      + +
      
      +<a href="prefetchThisPage.html" data-prefetch> ... </a>
      +
      + +

      You can prefetch as many linked pages as you like. Just add data-prefetch to all the links you want to prefetch.

      + +

      Alternatively, you can prefetch a page programmatically using $.mobile.loadPage():

      + +
      
      +$.mobile.loadPage( pageUrl, { showLoadMsg: false } );
      +
      + +

      Another advantage of prefetching a page is that the user doesn't see the Ajax loading message when visiting the prefetched page. The Ajax loading message only appears if the framework hasn't finished prefetching the page by the time the link is followed.

      + +

      Prefetching pages naturally creates additional HTTP requests and uses bandwidth, so it's wise to use this feature only in situations where it's highly likely that the prefetched page will be visited. A common scenario is a photo gallery, where you can prefetch the "previous" and "next" photo pages so that the user can move quickly between photos.

      + + +

      DOM size management

      + +

      For animated page transitions to work, the pages you're transitioning from and to both need to be in the DOM. However, keeping old pages in the DOM quickly fills the browser's memory, and can cause some mobile browsers to slow down or even crash.

      + +

      jQuery Mobile therefore has a simple mechanism to keep the DOM tidy. Whenever it loads a page via Ajax, jQuery Mobile flags the page to be removed from the DOM when you navigate away from it later (technically, on the pagehide event). If you revisit a removed page, the browser may be able to retrieve the page's HTML file from its cache. If not, it refetches the file from the server. (In the case of nested list views, jQuery Mobile removes all the pages that make up the nested list once you navigate to a page that's not part of the list.)

      + +

      Pages inside a multi-page template aren't affected by this feature at all - jQuery Mobile only removes pages loaded via Ajax.

      + + +

      Caching pages in the DOM

      + +

      If you prefer, you can tell jQuery Mobile to keep previously-visited pages in the DOM instead of removing them. This lets you cache pages so that they're available instantly if the user returns to them.

      + +

      To keep all previously-visited pages in the DOM, set the domCache option on the page plugin to true, like this:

      + +
      
      +$.mobile.page.prototype.options.domCache = true;
      +
      + +

      Alternatively, to cache just a particular page, you can add the data-dom-cache="true" attribute to the page's container:

      + +
      
      +<div data-role="page" id="cacheMe" data-dom-cache="true">
      +
      + +

      You can also cache a page programmatically like this:

      + +
      
      +pageContainerElement.page({ domCache: true });
      +
      + +

      The drawback of DOM caching is that the DOM can get very large, resulting in slowdowns and memory issues on some devices. If you enable DOM caching, take care to manage the DOM yourself and test thoroughly on a range of devices.

      + + +
      + + + +
      + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/pages/page-customtransitions.html b/libs/js/jquery-mobile-1.1.0/docs/pages/page-customtransitions.html new file mode 100644 index 0000000..6e6df97 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/pages/page-customtransitions.html @@ -0,0 +1,297 @@ + + + + + + jQuery Mobile Docs - Transitions + + + + + + + + + + +
      + +
      +

      Transitions

      + Home + Search +
      + +
      +
      + +

      Creating custom CSS-based transitions

      + + +

      To create a custom CSS transition, select a class name that corresponds to the name of your transition, for example "slide", and then define your "in" and "out" CSS rules to take advantage of transitions or animation keyframes:

      + +
      
      +		.slide.in {
      +		 	-webkit-transform: translateX(0);
      +			-moz-transform: translateX(0);
      +			-webkit-animation-name: slideinfromright;
      +			-moz-animation-name: slideinfromright;
      +		}
      +			
      +		.slide.out {
      +			-webkit-transform: translateX(-100%);
      +			-moz-transform: translateX(-100%);
      +			-webkit-animation-name: slideouttoleft;
      +			-moz-animation-name: slideouttoleft;
      +		}
      +
      +		@-webkit-keyframes slideinfromright {
      +			from { -webkit-transform: translateX(100%); }
      +			to { -webkit-transform: translateX(0); }
      +		}
      +		
      +		@-webkit-keyframes slideouttoleft {
      +			from { -webkit-transform: translateX(0); }
      +			to { -webkit-transform: translateX(-100%); }
      +		}
      +	
      +		@-moz-keyframes slideinfromright {
      +			from { -moz-transform: translateX(100%); }
      +			to { -moz-transform: translateX(0); }
      +		}
      +		
      +		@-moz-keyframes slideouttoleft {
      +			from { -moz-transform: translateX(0); }
      +			to { -moz-transform: translateX(-100%); }
      +		}
      +		
      +				
      + +

      During a CSS-based page transition, jQuery Mobile will place the class name of the transition on both the "from" and "to" pages involved in the transition. It then places an "out" class on the "from" page, and "in" class on the "to" page. The presence of these classes on the "from" and "to" page elements then triggers the animation CSS rules defined above. As of jQuery Mobile version 1.1, animation class additions are queued, rather than simultaneous, producing an out-then-in sequence, which is friendlier for mobile rendering than our previous simultaneous transition sequence.

      + +

      If your transition supports a reverse direction, you need to create CSS rules that use the reverse class in addition to the transition class name and the "in" and "out" classes:

      + +
      
      +		.slide.in.reverse {
      +			-webkit-transform: translateX(0);
      +			-moz-transform: translateX(0);
      +			-webkit-animation-name: slideinfromleft;
      +			-moz-animation-name: slideinfromleft;
      +		}
      +
      +		.slide.out.reverse {
      +			-webkit-transform: translateX(100%);
      +			-moz-transform: translateX(100%);
      +			-webkit-animation-name: slideouttoright;
      +			-moz-animation-name: slideouttoright;
      +		}
      +
      +		@-webkit-keyframes slideinfromleft {
      +			from { -webkit-transform: translateX(-100%); }
      +			to { -webkit-transform: translateX(0); }
      +		}
      +
      +		@-webkit-keyframes slideouttoright {
      +			from { -webkit-transform: translateX(0); }
      +			to { -webkit-transform: translateX(100%); }
      +		}
      +		
      +		@-moz-keyframes slideinfromleft {
      +			from { -moz-transform: translateX(-100%); }
      +			to { -moz-transform: translateX(0); }
      +		}
      +
      +		@-moz-keyframes slideouttoright {
      +			from { -moz-transform: translateX(0); }
      +			to { -moz-transform: translateX(100%); }
      +		}
      +		
      +				
      + +

      After the CSS rules are in place, you simply specify the name of your transition within the @data-transition attribute of a navigation link:

      + +
      <a href="#page2" data-transition="slide">Page 2</a>
      +				
      + +

      When the user clicks on the navigation link, jQuery Mobile will invoke your transition when it navigates to the page mentioned within the link.

      + +

      In case you were wondering why none of the CSS rules above specified any easing or duration, it's because the CSS for jQuery Mobile defines the default easing and duration in the following rules:

      + +
      
      +		.in {
      +			-webkit-animation-timing-function: ease-out;
      +			-webkit-animation-duration: 350ms;
      +			-moz-animation-timing-function: ease-out;
      +			-moz-animation-duration: 350ms;
      +		}
      +
      +		.out {
      +			-webkit-animation-timing-function: ease-in;
      +			-webkit-animation-duration: 225ms;
      +			-moz-animation-timing-function: ease-in;
      +			-moz-animation-duration: 225;
      +		}
      +				
      + +

      If you need to specify a different easing or duration, simply add the appropriate CSS3 property to your custom page transition rules.

      + + +

      Creating custom JavaScript-based transitions

      + +

      When a user clicks on a link within a page, jQuery Mobile checks if the link specifies a @data-transition attribute. The value of this attribute is the name of the transition to use when displaying the page referred to by the link. If there is no @data-transition attribute, the transition name specified by the configuration option $.mobile.defaultPageTransition is used for pages, and $.mobile.defaultDialogTransition is used for dialogs.

      + +

      After the new page is loaded, the $.mobile.transitionHandlers dictionary is used to see if any transition handler function is registered for the given transition name. If a handler is found, that handler is invoked to start and manage the transition. If no handler is found the handler specified by the configuration option $.mobile.defaultTransitionHandler is invoked.

      + +

      By default, the $.mobile.transitionHandlers dictionary is only populated with a single handler entry called "default". This handler plays a dual purpose of either executing a "none" transition, which removes the "ui-page-active" class from the page we are transitioning "from", and places it on the page we are transitioning "to", or a Queued CSS3 Animated Transition, such as the one explained above. If the transition is "none", it will be instantaneous; no animation, no fanfare.

      + +

      The $.mobile.defaultTransitionHandler points to a handler function that assumes the name is a CSS class name, and implements the "Pure CSS3 Based Transitions" section above.

      + +

      The default transition handler is available on the $.mobile namespace:

      + +
      
      +$.mobile.transitionHandlers[ "default" ];
      +		
      + +

      Transition Handlers

      + +

      A transition handler is a function with the following call signature:

      + +
      
      +function myTransitionHandler(name, reverse, $to, $from)
      +{
      +    var deferred = new $.Deferred();
      +
      +    // Perform any actions or set-up necessary to kick-off
      +    // your transition here. The only requirement is that
      +    // whenever the transition completes, your code calls
      +    // deferred.resolve(name, reverse, $to, $from).
      +
      +    // Return a promise.
      +    return deferred.promise();
      +}
      +		
      + +

      Your handler must create a Deferred object and return a promise to the caller. The promise is used to communicate to the caller when your transition is actually complete. It is up to you to call deferred.resolve() at the correct time. If you are new to Deferred objects, you can find documentation here.

      + +

      Registering and Invoking Your Transition Handler

      + +

      Once you have created a transition handler function, you need to tell jQuery Mobile about it. To do this, simply add your handler to the $.mobile.transitionHandlers dictionary. Remember, the key used should be the name of your transition. This name is also the same name that will be used within the @data-transition attribute of any navigation links.

      + +
      
      +// Define your transition handler:
      +
      +function myTransitionHandler(name, reverse, $to, $from)
      +{
      +    var deferred = new $.Deferred();
      +
      +    // Perform any actions or set-up necessary to kick-off
      +    // your transition here. The only requirement is that
      +    // whenever the transition completes, your code calls
      +    // deferred.resolve(name, reverse, $to, $from).
      +
      +    // Return a promise.
      +    return deferred.promise();
      +}
      +
      +// Register it with jQuery Mobile:
      +
      +$.mobile.transitionHandlers["myTransition"] = myTransitionHandler;
      +		
      + +

      Once you've registered your handler, you can invoke your transition by placing a data-transition attribute on a link:

      + +
      <a href="#page2" data-transition="myTransition">Page 2</a>
      +		
      + +

      When the user clicks the link above, your transition handler will be invoked after the page is loaded and it is ready to be shown.

      + +

      Overriding a CSS Transition With Your Own Handler

      + +

      As previously mentioned the default transition handler assumes that any transition name other than "none" is a CSS class to be placed on the "from" and "to" elements to kick off a CSS3 animation. If you would like to override one of these built-in CSS transitions, you simply register your own handler with the same name as the CSS page transition you want to override. So for example, if I wanted to override the built-in "slide" CSS transition with my own JavaScript based transition, I would simply do the following:

      + +
      // Define your transition handler:
      +
      +function myTransitionHandler(name, reverse, $to, $from)
      +{
      +    var deferred = new $.Deferred();
      +
      +    // Perform any actions or set-up necessary to kick-off
      +    // your transition here. The only requirement is that
      +    // whenever the transition completes, your code calls
      +    // deferred.resolve(name, reverse, $to, $from).
      +
      +    // Return a promise.
      +    return deferred.promise();
      +}
      +
      +// Register it with jQuery Mobile:
      +
      +$.mobile.transitionHandlers["slide"] = myTransitionHandler;
      +		
      + +

      Once you do this, anytime the "slide" transition is invoked, your handler, instead of the default one, will be called to perform the transition.

      + +

      Overriding the Default Transition Handler

      + +

      The $.mobile.css3TransitionHandler function is the default transition handler that gets invoked when a transition name is used and not found in the $.mobile.transitionHandlers dictionary. If you want to install your own custom default handler, you simply set the $.mobile.defaultTransitionHandler to your handler:

      + +
      // Define your default transition handler:
      +
      +function myTransitionHandler(name, reverse, $to, $from)
      +{
      +    var deferred = new $.Deferred();
      +
      +    // Perform any actions or set-up necessary to kick-off
      +    // your transition here. The only requirement is that
      +    // whenever the transition completes, your code calls
      +    // deferred.resolve(name, reverse, $to, $from).
      +
      +    // Return a promise.
      +    return deferred.promise();
      +}
      +
      +$.mobile.defaultTransitionHandler = myTransitionHandler;
      +		
      + +

      Once you do this, your handler will be invoked any time a transition name is used but not found within the $.mobile.transitionHandlers dictionary.

      + +

      A model for Custom transition handler development

      +

      Transition handlers involve a number of critical operations, such as hiding any existing page, showing the new page, scrolling either to the top or a remembered scroll position on that new page, setting focus on the new page, and any animation and timing sequences you'd like to add. During development, we would recommend using jquery.mobile.transitions.js as a coding reference.

      + +

      Transitions and scroll position

      +

      One of the key things jQuery Mobile does is store your scroll position before starting a transition so it can restore you to the same place once you return to the page when hitting the Back button or closing a dialog. Here are the same buttons from the top to test the scrolling logic.

      + + +
      + + + +
      + + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/pages/page-dialogs.html b/libs/js/jquery-mobile-1.1.0/docs/pages/page-dialogs.html new file mode 100644 index 0000000..bf9b8ad --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/pages/page-dialogs.html @@ -0,0 +1,129 @@ + + + + + + jQuery Mobile Docs - Dialogs + + + + + + + + + + +
      + +
      +

      Dialogs

      + Home + Search +
      + +
      +
      +

      Creating dialogs

      +

      Any page can be presented as a modal dialog by adding the data-rel="dialog" attribute to the page anchor link. When the "dialog" attribute is applied, the framework adds styles to add rounded corners, margins around the page and a dark background to make the "dialog" appear to be suspended above the page.

      + +

      + + <a href="foo.html" data-rel="dialog">Open dialog</a> + +

      + + Open dialog + + + +

      Transitions

      +

      By default, the dialog will open with a 'pop' transition. Like all pages, you can specify any page transition you want on the dialog by adding the data-transition attribute to the link. To make it feel more dialog-like, we recommend specifying a transition of "pop", "slideup" or "flip".

      + + +<a href="foo.html" data-rel="dialog" data-transition="pop">Open dialog</a> + + + + + +

      Closing dialogs

      +

      When any link is clicked within in a dialog, the framework will automatically close the dialog and transition to the requested page, just as if the dialog were a normal page. To create a "cancel" button in a dialog, just link to the page that triggered the dialog to open and add the data-rel="back" attribute to your link. This pattern of linking to the previous page is also usable in non-JS devices as well.

      +

      For JavaScript-generated links, you can simply set the href attribute to "#" and use the data-rel="back" attribute. You can also call the dialog's close() method to programmatically close dialogs, for example: $('.ui-dialog').dialog('close').

      + +

      Setting the close button text

      +

      Just like the page plugin, you can set a dialog's close button text through an option or data attribute. The option can be configured for all dialogs by binding to the mobileinit event and setting the $.mobile.dialog.prototype.options.closeBtnText property to a string of your choosing, or you can place the data attribute data-close-btn-text to configure the text from your markup.

      + +

      History & Back button behavior

      +

      Since dialogs are typically used to support actions within a page, the framework does not include dialogs in the hash state history tracking. This means that dialogs will not appear in your browsing history chronology when the Back button is clicked. For example, if you are on a page, click a link to open a dialog, close the dialog, then navigate to another page, if you were to click the browser's Back button at that point you will navigate back to the first page, not the dialog.

      + +

      Styling & theming

      +

      Dialogs can be styled with different theme swatches, just like any page by adding data-theme attributes to the header, content, or footer containers. Here is an example of a different dialog design:

      + An alternate color scheme + +

      Dialogs appear to be floating above an overlay layer. This overlay adopts the swatch A content color by default, but the data-overlay-theme attribute can be added to the page wrapper to set the overlay to any swatch letter. Here is an example of a dialog with the overlay set to swatch e:

      + Custom overlay swatch + + +

      Dialogs can also be used more like a control sheet to offer multiple buttons if you simply remove the top margin from the dialog's inner container element. For example, if your dialog page had a class of my-dialog, you could add this CSS to pin that dialog to the top: .ui-dialog.my-dialog .ui-dialog-contain { margin-top: 0 }, or you could just apply that style to all dialogs with .ui-dialog .ui-dialog-contain { margin-top: 0 }.

      + Share photos... + +

      Dialog width and margins

      +

      For the sake of readability, dialogs have a default max-width of 500 pixels (plus 15px padding on each side). There is also a 10% top margin to give dialogs larger top margin on larger screens, but collapse to a small margin on smartphones. To override these styles, add the following CSS override rule to your stylesheet and tweak as needed:

      + +
      +.ui-dialog .ui-header, 
      +.ui-dialog .ui-content, 
      +.ui-dialog .ui-footer { 
      +	max-width: 500px; 
      +	margin: 10% auto 15px auto; 
      +}
      +
      + + + + + +
      + + + +
      + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/pages/page-dynamic.html b/libs/js/jquery-mobile-1.1.0/docs/pages/page-dynamic.html new file mode 100644 index 0000000..deac20a --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/pages/page-dynamic.html @@ -0,0 +1,300 @@ + + + + + + jQuery Mobile Docs - Dynamically Injecting Pages + + + + + + + + + + +
      + +
      +

      Dynamically Injecting Pages

      + Home + Search +
      + +
      +
      +

      jQuery Mobile and Dynamic Page Generation

      +

      jQuery Mobile allows pages to be pulled into the DOM dynamically via its default click hijacking behavior, or through manual calls to $.mobile.changePage(). This is great for applications that generate HTML pages/fragments on the server-side, but there are sometimes cases where an application needs to dynamically generate page content on the client-side from JSON or some other format. This may be necessary for bandwidth/performance reasons, or because it is the data format of choice for the server they are interacting with.

      +

      For applications that need to generate page markup on the client-side, it's important to know about the notifications that are triggered during a $.mobile.changePage() call because they can be used as hooks into the navigation system that will allow you to generate your content at the appropriate time.

      +

      A call to changePage() will usually trigger the following event notifications:

      +
        +
      • pagebeforechange +
          +
        • Fired off before any page loading or transition.
        • +
        • NOTE: This event was formerly known as "beforechangepage".
        • +
        +
      • +
      • pagechange +
          +
        • Fired off after all page loading and transitions.
        • +
        • NOTE: this event was formerly known as "changepage".
        • +
        +
      • +
      • pagechangefailed +
          +
        • Fired off if an error has occurred while attempting to dynamically load a new page.
        • +
        +
      • +
      +

      These notifications are triggered on the parent container element ($.mobile.pageContainer) of pages, and will bubble all the way up to the document element and window.

      +

      For applications wishing to inject pages, or radically modify the content of an existing page, based on some non-HTML data, such as JSON or in-memory JS object, the pagebeforechange event is very useful since it gives you a hook for analyzing the URL or page element the application is being asked to load or switch to, and short-circuit the default changePage() behavior by simply calling preventDefault() on the pagebeforechange event.

      +

      To illustrate this technique, take a look at this working sample. In this sample, the main page starts off with a list of categories that the user can navigate into. The actual items in each category are stored in a JavaScript object in memory, for illustrative purposes, but the data can really come from anywhere.

      +
      
      +var categoryData = {
      +	animals: {
      +		name: "Animals",
      +		description: "All your favorites from aardvarks to zebras.",
      +		items: [
      +			{
      +				name: "Pets"
      +			},
      +			{
      +				name: "Farm Animals"
      +			},
      +			{
      +				name: "Wild Animals"
      +			}
      +		]
      +	},
      +	colors: {
      +		name: "Colors",
      +		description: "Fresh colors from the magic rainbow.",
      +		items: [
      +			{
      +				name: "Blue"
      +			},
      +			{
      +				name: "Green"
      +			},
      +			{
      +				name: "Orange"
      +			},
      +			{
      +				name: "Purple"
      +			},
      +			{
      +				name: "Red"
      +			},
      +			{
      +				name: "Yellow"
      +			},
      +			{
      +				name: "Violet"
      +			}
      +		]
      +	},
      +	vehicles: {
      +		name: "Vehicles",
      +		description: "Everything from cars to planes.",
      +		items: [
      +			{
      +				name: "Cars"
      +			},
      +			{
      +				name: "Planes"
      +			},
      +			{
      +				name: "Construction"
      +			}
      +		]
      +	}
      +};
      +
      +

      The application uses links with urls that contain a hash that tells the application what category items to display:

      +
      +
      +  	<h2>Select a Category Below:</h2>
      +  	<ul data-role="listview" data-inset="true">
      +    	<li><a href="#category-items?category=animals">Animals</a></li>
      +    	<li><a href="#category-items?category=colors">Colors</a></li>
      +    	<li><a href="#category-items?category=vehicles">Vehicles</a></li>
      +    </ul>
      +
      +
      +

      Internally, when the user clicks on one of these links, the application intercepts the internal $.mobile.changePage() call that is invoked by the frameworks' default link hijacking behavior. It then analyzes the URL for the page about to be loaded, and then decides whether or not it should handle the loading itself, or to let the normal changePage() code handle things.

      +

      The application was able to insert itself into the changePage() flow by binding to the pagebeforechange event at the document level:

      +
      +
      +// Listen for any attempts to call changePage().
      +$(document).bind( "pagebeforechange", function( e, data ) {
      +
      +	// We only want to handle changePage() calls where the caller is
      +	// asking us to load a page by URL.
      +	if ( typeof data.toPage === "string" ) {
      +
      +		// We are being asked to load a page by URL, but we only
      +		// want to handle URLs that request the data for a specific
      +		// category.
      +		var u = $.mobile.path.parseUrl( data.toPage ),
      +			re = /^#category-item/;
      +
      +		if ( u.hash.search(re) !== -1 ) {
      +
      +			// We're being asked to display the items for a specific category.
      +			// Call our internal method that builds the content for the category
      +			// on the fly based on our in-memory category data structure.
      +			showCategory( u, data.options );
      +
      +			// Make sure to tell changePage() we've handled this call so it doesn't
      +			// have to do anything.
      +			e.preventDefault();
      +		}
      +	}
      +});
      +
      +
      +

      So why listen at the document level? In short, because of deep-linking. We need our binding to be active before the jQuery Mobile framework initializes and decides how to process the initial URL that invoked the application.

      +

      When the callback for the pagebeforechange binding is invoked, the 2nd argument to the callback will be a data object that contains the arguments that were passed to the initial $.mobile.changePage() call. The properties of this object are as follows:

      +
        +
      • toPage +
          +
        • Can be either a jQuery collection object containing the page to be transitioned to, OR a URL reference for a page to be loaded/transitioned to.
        • +
        +
      • +
      • options +
          +
        • Object containing the options that were passed in by the caller of the $.mobile.changePage() function.
        • +
        • A list of the options can be found here.
        • +
        +
      • +
      +

      For our sample application, we are only interested in changePage() calls where URLs are initially passed in, so the first thing our callback does is check the type for the toPage. Next, with the help of some URL parsing utilities, it checks to make sure if the URL contains a hash that we are interested in handling ourselves. If so, it then calls an application function called showCategory() which will dynamically create the content for the category specified by the URL hash, and then it calls preventDefault() on the event.

      +

      Calling preventDefault() on a pagebeforechange event causes the originating $.mobile.changePage() call to exit without performing any work. Calling the preventDefault() method on the event is the equivalent of telling jQuery Mobile that you have handled the changePage() request yourself.

      +

      If preventDefault() is not called, changePage() will continue on processing as it normally does. One thing to point out about the data object that is passed into our callback, is that any changes you make to the toPage property, or options properties, will affect changePage() processing if preventDefault() is not called. So for example, if we wanted to redirect or map a specific URL to another internal/external page, our callback could simply set the data.toPage property in the callback to the URL or DOM element of the page to redirect to. Likewise, we could set, or un-set any option from within our callback, and changePage() would use the new settings.

      +

      So now that we know how to intercept changePage() calls, let's take a closer look at how this sample actually generates the markup for a page. Our example actually uses, or we should say, re-uses the same page to display each of the categories. Each time one of our special links is clicked, the function showCategory() gets invoked:

      +
      
      +// Load the data for a specific category, based on
      +// the URL passed in. Generate markup for the items in the
      +// category, inject it into an embedded page, and then make
      +// that page the current active page.
      +function showCategory( urlObj, options )
      +{
      +	var categoryName = urlObj.hash.replace( /.*category=/, "" ),
      +
      +		// Get the object that represents the category we
      +		// are interested in. Note, that at this point we could
      +		// instead fire off an ajax request to fetch the data, but
      +		// for the purposes of this sample, it's already in memory.
      +		category = categoryData[ categoryName ],
      +
      +		// The pages we use to display our content are already in
      +		// the DOM. The id of the page we are going to write our
      +		// content into is specified in the hash before the '?'.
      +		pageSelector = urlObj.hash.replace( /\?.*$/, "" );
      +
      +	if ( category ) {
      +		// Get the page we are going to dump our content into.
      +		var $page = $( pageSelector ),
      +
      +			// Get the header for the page.
      +			$header = $page.children( ":jqmData(role=header)" ),
      +
      +			// Get the content area element for the page.
      +			$content = $page.children( ":jqmData(role=content)" ),
      +
      +			// The markup we are going to inject into the content
      +			// area of the page.
      +			markup = "<p>" + category.description + "</p><ul data-role='listview' data-inset='true'>",
      +
      +			// The array of items for this category.
      +			cItems = category.items,
      +
      +			// The number of items in the category.
      +			numItems = cItems.length;
      +
      +		// Generate a list item for each item in the category
      +		// and add it to our markup.
      +		for ( var i = 0; i < numItems; i++ ) {
      +			markup += "<li>" + cItems[i].name + "</li>";
      +		}
      +		markup += "</ul>";
      +
      +		// Find the h1 element in our header and inject the name of
      +		// the category into it.
      +		$header.find( "h1" ).html( category.name );
      +
      +		// Inject the category items markup into the content element.
      +		$content.html( markup );
      +
      +		// Pages are lazily enhanced. We call page() on the page
      +		// element to make sure it is always enhanced before we
      +		// attempt to enhance the listview markup we just injected.
      +		// Subsequent calls to page() are ignored since a page/widget
      +		// can only be enhanced once.
      +		$page.page();
      +
      +		// Enhance the listview we just injected.
      +		$content.find( ":jqmData(role=listview)" ).listview();
      +
      +		// We don't want the data-url of the page we just modified
      +		// to be the url that shows up in the browser's location field,
      +		// so set the dataUrl option to the URL for the category
      +		// we just loaded.
      +		options.dataUrl = urlObj.href;
      +
      +		// Now call changePage() and tell it to switch to
      +		// the page we just modified.
      +		$.mobile.changePage( $page, options );
      +	}
      +}
      +
      +

      In our sample app, the hash of the URL we handle contains 2 parts:

      +
      
      +#category-items?category=vehicles
      +
      +

      The first part, before the '?' is actually the id of the page to write content into, the part after the '?' is info the app uses to figure out what data it should use when generating the markup for the page. The first thing showCategory() does is deconstruct this hash to extract out the id of the page to write content into, and the name of the category it should use to get the correct set of data from our in-memory JavaScript category object. After it figures out what category data to use, it then generates the markup for the category, and then injects it into the header and content area of the page, wiping out any other markup that previously existed in those elements.

      +

      After it injects the markup, it then calls the appropriate jQuery Mobile widget calls to enhance the list markup it just injected. This is what turns the normal list markup into a fully styled listview with all its behaviors.

      +

      Once that's done, it then calls $.mobile.changePage(), passing it the DOM element of the page we just modified, to tell the framework that it wants to show that page.

      +

      Now an interesting problem here is that jQuery Mobile typically updates the browser's location hash with the URL associated with the page it is showing. Because we are re-using the same page for each category, this wouldn't be ideal, because the URL for that page has no specific category info associated with it. To get around this problem, showCategory() simply sets the dataUrl property on the options object it passes into changePage() to tell it to display our original URL instead.

      +

      That's the sample in a nutshell. It should be noted that this particular sample and its usage is not a very good example of an app that degrades gracefully when JavaScript is turned off. That means it probably won't work very well on C-Grade browsers. We will be posting other examples that demonstrate how to degrade gracefully in the future. Check this page for updates.

      +
      + + + + +
      + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/pages/page-links.html b/libs/js/jquery-mobile-1.1.0/docs/pages/page-links.html new file mode 100644 index 0000000..a5f41b3 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/pages/page-links.html @@ -0,0 +1,147 @@ + + + + + + jQuery Mobile Docs - Linking Pages + + + + + + + + + + +
      + +
      +

      Linking pages

      + Home + Search +
      + +
      +
      +

      Linking pages

      + +

      jQuery Mobile is designed to work with simple page linking conventions. Essentially, you can link pages and assets as you normally would, and jQuery Mobile will automatically handle page requests in a single-page model, using Ajax when possible. When Ajax isn't possible (such as a non-same-domain url, or if specified using certain attributes on the link), a normal http request is used instead.

      + +

      The goal of this model is to allow developers to create websites using best practices — where ordinary links will "just work" without any special configuration — while creating a rich, native-like experience that can't be achieved with standard HTTP requests.

      + +

      Default link behavior: Ajax

      + +

      To enable animated page transitions, all links that point to an external page (ex. products.html) will be loaded via Ajax. To do this unobtrusively, the framework parses the link's href to formulate an Ajax request (Hijax) and displays the loading spinner. All this happens automatically by jQuery Mobile.

      + +

      If the Ajax request is successful, the new page content is added to the DOM, all mobile widgets are auto-initialized, then the new page is animated into view with a page transition.

      + +

      If the Ajax request fails, the framework will display a small error message overlay (styled in the "e" swatch) that disappears after a brief time so this doesn't break the navigation flow. View an example of the error message.

      + +

      Note: You cannot link to a multipage document with Ajax navigation active because the framework will only load the first page it finds, not the full set of internal pages. In these cases, you must link without Ajax (see next section) for a full page refresh to prevent potential hash collisions. There is currently a subpage plugin that makes it possible to load in multi-page documents.

      + + +

      Linking without Ajax

      + +

      Links that point to other domains or that have rel="external", data-ajax="false" or target attributes will not be loaded with Ajax. Instead, these links will cause a full page refresh with no animated transition. Both attributes (rel="external" and data-ajax="false") have the same effect, but a different semantic meaning: rel="external" should be used when linking to another site or domain, while data-ajax="false" is useful for simply opting a page within your domain from being loaded via Ajax. Because of security restrictions, the framework always opts links to external domains out of the Ajax behavior.

      +

      In version 1.1, we've added support for using data-ajax="false" on a parent container which allows you to excluded a large number of links from the Ajax navigation system. This avoids the need to add this attribute to every link in a container.

      +

      Note: When building a jQuery Mobile application where the Ajax navigation system is disabled globally or frequently disabled on individual links, we recommend disabling the $.mobile.pushStateEnabled global configuration option to avoid inconsistent navigation behavior in some browsers.

      + + + +

      Linking within a multi-page document

      + +

      A single HTML document can contain one or many 'page' containers simply by stacking multiple divs with a data-role of "page". This allows you to build a small site or application within a single HTML document; jQuery Mobile will simply display the first 'page' it finds in the source order when the page loads.

      + +

      If a link in a multi-page document points to an anchor (#foo), the framework will look for a page wrapper with that ID (id="foo"). If it finds a page in the HTML document, it will transition the new page into view. You can seamlessly navigate between local, internal "pages" and external pages in jQuery Mobile. Both will look the same to the end user except that external pages will display the Ajax spinner while loading. In either situation, jQuery Mobile updates the page's URL hash to enable Back button support, deep-linking and bookmarking.

      + +

      It's important to note that if you are linking from a mobile page that was loaded via Ajax to a page that contains multiple internal pages, you need to add a rel="external" or data-ajax="false" to the link. This tells the framework to do a full page reload to clear out the Ajax hash in the URL. This is critical because Ajax pages use the hash (#) to track the Ajax history, while multiple internal pages use the hash to indicate internal pages so there will be conflicts in the hash between these two modes.

      + +

      For example, a link to a page containing multiple internal pages would look like this:

      + + <a href="multipage.html" rel="external">Multi-page link</a> + + + +

      "Back" button links

      +

      If you use the attribute data-rel="back" on an anchor, any clicks on that anchor will mimic the back button, going back one history entry and ignoring the anchor's default href. This is particularly useful when generating "back" buttons with JavaScript, such as a button to close a dialog. + When using this feature in your source markup, although browsers that support this feature will not use the specified href attribute, be sure to still provide a meaningful value that actually points to the URL of the referring page to allow the feature to work for users in C-Grade browsers. If users can reach this page from more than one referring pages, specify a sensible href so that the navigation remains logical for all users. + Also, please keep in mind that if you just want a reverse transition without actually going back in history, you should use the data-direction="reverse" attribute instead. + Note: data-direction="reverse" is meant to simply run the backwards version of the transition that will run on that page change, while data-rel="back" makes the link functionally equivalent to the browser's back button and all the standard back button logic applies. Adding data-direction="reverse" to a link with data-rel="back" will not reverse the reversed page transition and produce the "normal" version of the transition. +

      + + +

      Redirects and linking to directories

      + +

      When linking to directory indexes (such as href="typesofcats/" instead of href="typesofcats/index.html"), you must provide a trailing slash. This is because jQuery Mobile assumes the section after the last "/" character in a url is a filename, and it will remove that section when creating base urls from which future pages will be referenced.

      + +

      However, you can work around this issue by returning your page div with a data-url attribute already specified. When you do this, jQuery Mobile will use that attribute's value for updating the URL, instead of the url used to request that page. This also allows you to return urls that change as the result of a redirect, for example, you might post a form to "/login.html" but return a page from the url "/account" after a successful submission. This tool allows you to take control of the jQuery Mobile history stack in these situations. Here's an example:

      + +

      The following link points to "docs-links-urltest/index.html": Test Link which is a directory with an index page. The return page will update the hash as "/docs/pages/docs-links-urltest/" with a trailing slash. This is done via the data-url attribute in that page's source. Keep in mind that the value will replace the entire hash, and it is up to you to replace it with a URL that actually resolves to the correct page when requested via refresh or deep link.

      + +

      Learn more about the technical details of the navigation model and Ajax, hashes and history in jQuery mobile.

      + + + +

      Link examples

      +

      All standard HTML link types are supported in jQuery Mobile in addition to the types outlined above. Here is a sampler of many common link types:

      + + + + +
      + + + +
      + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/pages/page-navmodel.html b/libs/js/jquery-mobile-1.1.0/docs/pages/page-navmodel.html new file mode 100644 index 0000000..d267f82 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/pages/page-navmodel.html @@ -0,0 +1,182 @@ + + + + + + jQuery Mobile Docs - Ajax, hashes & history + + + + + + + + + + +
      + +
      +

      Ajax, hashes & history

      + Home + Search +
      + +
      +
      +

      jQuery Mobile's navigation model

      + +

      A "page" in jQuery Mobile consists of an element (usually a div) with a data-role attribute set to "page", which generally contains div elements with roles of "header", "content", and "footer", each containing common markup, forms, and custom jQuery Mobile widgets.

      + +

      The basic workflow with page loading is as follows: first, a page is requested with a normal HTTP request, and subsequent "pages" are then requested and injected into that page's DOM. Because of this, the DOM may have a number of "pages" in it at a time, each of which can be re-visited by linking to its data-url attribute.

      + +

      When a url is initially requested, there may be one or more "pages" in the response, and only the first one will be shown. The advantage of storing more than one "page" is that it allows you to pre-fetch static pages that are likely to be visited.

      + +

      Hash and Ajax driven page navigation

      + +

      By default all navigation within jQuery Mobile is based on changes and updates to location.hash. Whenever possible, page changes will use a smooth transition between the current "page" and the next, whether it is either already present in the DOM, or is automatically loaded via Ajax.

      + +

      Hash values created by jQuery Mobile are normalized as full paths relative to the URL of the first "real" page that was loaded. The hash is always maintained as a valid URL, so any "page" in jQuery mobile can be bookmarked or referenced in a link. To retrieve a non-hash-based URL, simply remove the # from the address and refresh the page.

      + +

      In general, hash changes are created whenever a link is clicked in jQuery mobile. When a link is clicked, jQuery mobile will make sure that the link is referencing a local URL, and if so, it'll prevent the link's default click behavior from occurring and request the referenced url via Ajax instead. When the page returns successfully, it will set the location.hash to the new page's relative url.

      + +

      Hash changes that occur independently of a click, such as when a user clicks the back button, are handled through the hashchange event, which is bound to the window object using Ben Alman's hashchange special event plugin (included in jQuery Mobile). When a hash change occurs (and also when the first page loads), the hashchange event handler will send the location.hash to the $.mobile.changePage() function, which in turn either loads or reveals the referenced page.

      + + +

      Once the referenced page is present in the DOM, the $.mobile.changePage() function applies a transition between the current active page and the new page. Page transitions happen through adding and removing classes that apply CSS animations. For example, in a slide-left transition, the exiting page is given the classes "slideleft" and "out", and the entering page is given the classes "slideleft" and "in", as well as a class of "ui-page-active" to mark it as the new "active" page being viewed. When the animation is complete, the "in" and "out" classes are removed, and the exited page loses its "ui-page-active" class.

      + +

      pushState plugin

      + +

      There is an optional feature that converts the longer, hash-based URLs mentioned in the previous section into the full document path which is cleaner and makes the Ajax tracking transparent in the URL structure. This is built as an enhancement on top of the hash-based URL system for Ajax links. Note that despite the name, this feature technically converts hash-based urls by using history.replaceState (not history.pushState) in the current release because this works more reliably across our target platforms. For browsers that do not support history.replaceState, or if this feature is disabled, hash-based URLs will be used instead.

      + +

      Since the plugin initializes when the DOM is fully loaded you can enable and disable it manually by setting $.mobile.pushStateEnabled global configuration option to false anytime before document ready.

      + +
      +

      Important: rel="external" and $.mobile.ajaxEnabled=false

      +

      Slightly different implementations of the replaceState API in various browsers can cause odd behavior in specific scenarios. For example, some browser implementations (including desktop browsers) implement the popstate event differently when linking externally and moving back to a page onto which state has already been pushed/replaced. When building a jQuery Mobile application where the ajax navigation is being explicitly disabled, either through the frequent use of rel="external" on links or by disabling Ajax navigation completely via the $.mobile.ajaxEnabled=false, we recommend disabling the pushState feature to fall back to the hash based navigation for more consistent behavior.

      +
      + +

      changePage

      + +

      Within the framework, page changes - both for pages already in the DOM and for pages that need to be loaded via Ajax - use the $.mobile.changePage() function. $.mobile.changePage() contains all of the logic for finding pages to transition to and from, and how to handle various response conditions such as a page not found. $.mobile.changePage() can be called externally and accepts the following arguments (to, transition, back, changeHash). The to argument can accept either a string (such as a file url or local element's ID), an array (in which the first array item is any local page you'd like to transition from, and the second array item is the to page), or an object (with expected properties: url, type ("get" or "post"), and data (for serialized parameters)), the latter of which is useful for loading pages that expect form data. The transition argument accepts a string representing a named transition, such as "slide". The back argument accepts a boolean representing whether the transition should go forward or in reverse. Lastly, the changeHash argument accepts a boolean for whether you'd like the url to be updated upon a successful page change.

      + +

      The $.mobile.changePage() function is used in a number of places in jQuery Mobile. For example, when a link is clicked, its href attribute is normalized and then $.mobile.changePage() handles the rest. When forms are submitted, jQuery Mobile simply gathers a few of the form's attributes, serializes its data, and once again, $.mobile.changePage() is used to handle the submission and response. Also, links that create dialogs use $.mobile.changePage()to open a referenced page without updating the hash, which is useful for keeping dialogs out of history tracking.

      + +

      Base element

      + +

      Another key ingredient to jQuery Mobile's page navigation model is the base element, which is injected into the head and modified on every page change to ensure that any assets (images, CSS, JS, etc.) referenced on that page will be requested from a proper path. In browsers that don't support dynamic updates to the base element (such as Firefox 3.6), jQuery Mobile loops through all of the referenced assets on the page and prefixes their href and src attributes with the base path.

      + + +

      Developer explanation of base url management:

      + +

      jQuery Mobile manages http requests using a combination of generated absolute URL paths and manipulating a generated <base> element's href attribute. The combination of these two approaches allows us to create URLs that contain full path information for loading pages, and a base element to properly direct asset requests made by those loaded pages (such as images and stylesheets).

      + +

      TODO: update description of internal base and urlHistory objects

      + +

      Data-url storage

      + +

      The navigation model maintains a data-url attribute on all data-role="page" elements. This data-url attribute is used to track the origin of the page element. Pages embedded within the main application document all have their data-url parameter set to the ID of their element with data-role="page". The only exception to this is the first-page in the document. The first-page is special because it can be addressed by its id if it has one, or by the document or base URL (with no hash fragment).

      + +

      Pages that are external to the application document get pulled in dynamically via ajax, and their data-url is set to the site relative path to the external page. If you are running in an environment where loading an external page from a different domain is allowed, then the data-url is set to the absolute URL.

      + +

      Auto-generated pages and sub-hash urls

      + +

      Some plugins may choose to dynamically break a page's content into separate navigable pages, which can then be reached via deep links. One example of this would be the Listview plugin, which will break a nested UL (or OL) into separate pages, which are each given a data-url attribute so they can be linked to like any normal "page" in jQuery Mobile. However, in order to link to these pages, the page that generates them must first be requested from the server. To make this work, pages that are auto-generated by plugins use the following special data-url structure: + <div data-url="page.html&subpageidentifier">

      + +

      So, for example, a page generated by the listview plugin may have a data-url attribute like this: data-url="artists.html&ui-page=listview-1"

      + +

      When a page is requested, jQuery Mobile knows to split the URL at "&ui-page" and make an HTTP request to the portion of the URL before that key. In the case of the listview example mentioned above, the URL would look like this: http://example.com/artists.html&ui-page=listview-1 + ...and jQuery Mobile would request artists.html, which would then generate its sub-pages, creating the div with data-url="artists.html&ui-page=listview-1", which it will then display as the active page.

      + +

      Note that the data-url attribute of the element contains the full URL path, not just the portion after &ui-page=. This allows jQuery Mobile to use a single consistent mechanism that matches URLs to page data-url attributes.

      + +

      Cases when Ajax navigation will not be used

      + +

      Under certain conditions, normal http requests will be used instead of Ajax requests. One case where this is true is when linking to pages on external websites. You can also specify that a normal http request be made through the following link attributes:

      + +
        +
      • rel=external

      • +
      • target (with any value, such as "_blank")

      • + +

      Form submissions

      + +

      Form submissions are handled automatically through the navigation model as well. Visit the forms section for more information.

      + +

      Using the Application Cache

      + +

      When using the application cache with jQuery Mobile there is at least one important issue to consider. Some browsers, when making requests to the cache will report an http status of 0 on success. This causes jQuery Core's $.ajax to trigger error handlers. The suggested workaround for users leveraging the application cache is to use a jQuery ajax pre-filter. Something like the following (credit to jammus for the snippet):

      + +
      
      +
      +$.ajaxPrefilter( function(options, originalOptions, jqXHR) {
      +	if ( applicationCache &&
      +		 applicationCache.status != applicationCache.UNCACHED &&
      +		 applicationCache.status != applicationCache.OBSOLETE ) {
      +		 // the important bit
      +		 options.isLocal = true;
      +	}
      +});
      +
      +			
      + +

      Setting isLocal to true for your ajax requests will alert jQuery Core that it should handle the 0 return values differently. Local requests exhibit similar behavior (ie 0 statuses), and Core will then fall back to determining success based on the presence of content in the xhr responseText attribute.

      + +

      One important issue to note with the above is that it will set isLocal to true for all requests made via ajax regardless of whether they are in the manifest or not so long as the cache is valid. This works for now because Core only consults the isLocal value when the status is in fact 0 which doesn't affect uncached results. There is no long term guarantee that isLocal will remain isolated in its purpose for handling 0 status values. If that changes it may break your application.

      + +

      Known limitations

      + +

      The non-standard environment created by jQuery Mobile's page navigation model introduces some conditions of which you should be aware when building pages:

      + +
        +
      • When linking to directories, without a filename url, (such as href="typesofcats/" instead of href="typesofcats/index.html"), you must provide a trailing slash. This is because jQuery Mobile assumes the section after the last "/" character in a url is a filename, and it will remove that section when creating base urls from which future pages will be referenced.

      • +
      • Documents loaded via Ajax will select the first page in the DOM of that document to be loaded as a JQM page element. As a result the developer must make sure to manage the ID attributes of the loaded page and child elements to prevent confusion when manipulating the DOM.

      • +
      • If you link to multipage document, you must use a data-ajax="false" attribute on the link to cause a full page refresh due to the limitation above where we only load the first page node in an Ajax request due to potential hash collisions. There is currently a subpage plugin that makes it possible to load in multi-page documents.

      • +
      • Any unique assets referenced by pages in a jQuery Mobile-driven site should be placed inside the "page" element (the element with a data-role attribute of "page"). For example, links to styles and scripts that are specific to a particular page can be referenced inside that div. However, a better approach is to use jQuery Mobile's page events to trigger specific scripting when certain pages load. Note: you can return a page from the server with a data-url already specified in the markup, and jQuery Mobile will use that for the hash update. This allows you to ensure directory paths resolve with a trailing slash and will therefore be used in the base url path for future requests.

      • +
      • Conversely, any non-unique assets (those used site-wide) should be referenced in the <head> section of an HTML document, or at the very least, outside of the "page" element, to prevent running scripts more than once.

      • +
      • The "ui-page" key name used in sub-hash url references can be set to any value you'd like, so as to blend into your URL structure. This value is stored in jQuery.mobile.subPageUrlKey.

      • +
      • When traveling back to a previously loaded jQuery Mobile document from an external or internal document with the push state plugin enabled, some browsers load and trigger the popstate event on the wrong document or for the wrong reasons (two edge cases recorded so far). If you are regularly linking to external documents and find the application behaving erratically try disabling pushstate support.

      • +
      • jQuery Mobile does not support query parameter passing to internal/embedded pages but there are two plugins that you can add to your project to support this feature. There is a lightweight page params plugin and a more fully featured jQuery Mobile router plugin for use with backbone.js or spine.js.

      • +
      • Since we use the URL hash to preserve Back button behavior, using page anchors to jump down to a position on the page isn't supported by using the traditional anchor link (#foo). Use the silentScroll method to scroll to a particular Y position without triggering scroll event listeners. You can pass in a yPos arguments to scroll to that Y location.

      • +
      + + +
      + + + +
      + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/pages/page-scripting.html b/libs/js/jquery-mobile-1.1.0/docs/pages/page-scripting.html new file mode 100644 index 0000000..18cef74 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/pages/page-scripting.html @@ -0,0 +1,156 @@ + + + + + + jQuery Mobile Docs - Scripting pages + + + + + + + + + + +
      + +
      +

      Scripting pages

      + Home + Search +
      + +
      +
      +

      Scripting pages in jQuery Mobile

      +

      Since jQuery Mobile uses an Ajax-powered navigation system, there are a few helpful things to know when writing scripts that manipulate your content. You can explore the mobile API in more detail by reading up on global configuration options, events, and methods or dig into the technical details of the Ajax navigation model.

      + +

      Scripts & styles in the head

      + +

      When the user clicks a link in a jQuery Mobile-driven site, the default behavior of the navigation system is to use that link's href to formulate an Ajax request (instead of allowing the browser's default link behavior of requesting that href with full page load). When that Ajax request goes out, the framework will receive its entire text content, but it will only inject the contents of the response's body element (or more specifically the data-role="page" element, if it's provided), meaning nothing in the head of the page will be used (with the exception of the page title, which is fetched specifically). Please note that script's loaded dynamically in this fashion do not guarantee a load order in the same way they would if the page was loaded via a normal http request.

      + +

      This means that any scripts and styles referenced the head of a page won't have any effect when a page is loaded via Ajax, but they will execute if the page is requested normally via HTTP. When scripting jQuery Mobile sites, both scenarios need to be considered. The reason that the head of a page is ignored when requested via Ajax is that the potential of re-executing the same JavaScript is very high (it's common to reference the same scripts in every page of a site). Due to the complexity of attempting to work around that issue, we leave the task of executing page-specific scripts to the developer, and assume head scripts are only expected to execute once per browsing session.

      + +

      The simplest approach when building a jQuery Mobile site is to reference the same set of stylesheets and scripts in the head of every page. If you need to load in specific scripts or styles for a particular page, we recommend binding logic to the pageInit event (details below) to run necessary code when a specific page is created (which can be determined by its id attribute, or a number of other ways). Following this approach will ensure that the code executes if the page is loaded directly or is pulled in and shown via Ajax.

      + +

      Another approach for page-specific scripting would be to include scripts at the end of the body element when no data-role=page element is defined, or inside the first data-role=page element. If you include your custom scripting this way, be aware that these scripts will execute when that page is loaded via Ajax or regular HTTP, so if these scripts are the same on every page, you'll likely run into problems. If you're including scripts this way, we'd recommend enclosing your page content in a data-role="page" element, and placing scripts that are referenced on every page outside of that element. Scripts that are unique to that page can be placed in that element, to ensure that they execute when the page is fetched via Ajax.

      + +

      pageinit = DOM ready

      + +

      One of the first things people learn in jQuery is to use the $(document).ready() function for executing DOM-specific code as soon as the DOM is ready (which often occurs long before the onload event). However, in jQuery Mobile site and apps, pages are requested and injected into the same DOM as the user navigates, so the DOM ready event is not as useful, as it only executes for the first page. To execute code whenever a new page is loaded and created in jQuery Mobile, you can bind to the pageinit event.

      + +

      The pageinit event is triggered on a page when it is initialized, right after initialization occurs. Most of jQuery Mobile's official widgets auto-initialize themselves based on this event, and you can set up your code to do the same.

      +
      
      +$( document ).delegate("#aboutPage", "pageinit", function() {
      +  alert('A page with an ID of "aboutPage" was just created by jQuery Mobile!');
      +});
      +
      + +

      If you'd like to manipulate a page's contents before the pageinit event fires and widgets are auto-initialized, you can instead bind to the pagebeforecreate event:

      + +
      
      +$( document ).delegate("#aboutPage", "pagebeforecreate", function() {
      +  alert('A page with an ID of "aboutPage" is about to be created by jQuery Mobile!');
      +});
      +
      + +

      Important note: pageCreate() vs pageInit()

      +

      Prior to Beta 2 the recommendation to users wishing to manipulate jQuery Mobile enhanced page and child widget markup was to bind to the pagecreate event. In Beta 2 an internal change was made to decouple each of the widgets by binding to the pagecreate event in place of direct calls to the widget methods. As a result, users binding to the pagecreate in mobileinit would find their binding executing before the markup had been enhanced by each of the plugins. In keeping with the lifecycle of the jQuery UI Widget Factory, the initialization method is invoked after the create method, so the pageinit event provides the correct timing for post enhancement manipulation of the DOM and/or Javascript objects. + + In short, if you were previously using pagecreate to manipulate the enhanced markup before the page was shown, it's very likely you'll want to migrate to 'pageinit'. +

      + + +

      Changing pages

      +

      If you want to change the current active page with JavaScript, you can use the changePage method. There are a lot of methods and properties that you can set when changing pages, but here are two simple examples:

      +
      
      +//transition to the "about us" page with a slideup transition
      +$.mobile.changePage( "about/us.html", { transition: "slideup"} );
      +
      +//transition to the "search results" page, using data from a form with an ID of "search"" 	
      +$.mobile.changePage( "searchresults.php", {
      +	type: "post",
      +	data: $("form#search").serialize()
      +});
      +
      + +

      Loading pages

      +

      To load an external page, enhance its content, and insert it into the DOM, use the loadPage method. There are a lot of methods and properties that you can set when loading pages, but here is a simple example:

      +
      
      +//load the "about us" page into the DOM
      +$.mobile.loadPage( "about/us.html" );
      +
      + +

      Enhancing new markup

      +

      The page plugin dispatches a pageInit event, which most widgets use to auto-initialize themselves. As long as a widget plugin script is referenced, it will automatically enhance any instances of the widgets it finds on the page.

      +

      However, if you generate new markup client-side or load in content via Ajax and inject it into a page, you can trigger the create event to handle the auto-initialization for all the plugins contained within the new markup. This can be triggered on any element (even the page div itself), saving you the task of manually initializing each plugin (listview button, select, etc.).

      +

      For example, if a block of HTML markup (say a login form) was loaded in through Ajax, trigger the create event to automatically transform all the widgets it contains (inputs and buttons in this case) into the enhanced versions. The code for this scenario would be:

      +
      $( ...new markup that contains widgets... ).appendTo( ".ui-page" ).trigger( "create" );
      +
      + +

      Create vs. refresh: An important distinction

      +

      Note that there is an important difference between the create event and refresh method that some widgets have. The create event is suited for enhancing raw markup that contains one or more widgets. The refresh method should be used on existing (already enhanced) widgets that have been manipulated programmatically and need the UI be updated to match.

      + +

      For example, if you had a page where you dynamically appended a new unordered list with data-role=listview attribute after page creation, triggering create on a parent element of that list would transform it into a listview styled widget. If more list items were then programmatically added, calling the listview’s refresh method would update just those new list items to the enhanced state and leave the existing list items untouched.

      + + +

      Scrolling to a position within a page

      +

      Since we use the URL hash to preserve Back button behavior, using page anchors to jump down to a position on the page isn't supported by using the traditional anchor link (#foo). Use the silentScroll method to scroll to a particular Y position without triggering scroll event listeners. You can pass in a yPos arguments to scroll to that Y location. For example:

      +
      
      +//scroll to Y 300px
      +$.mobile.silentScroll(300);
      +
      + +

      Binding to mouse and touch events

      +

      One inportant consideration in mobile is handling mouse and touch events. These events differ significantly across mobile platforms, but the common denominator is that click events will work everywhere, but usually after a significant delay of 500-700ms. This delay is necessary for the browser to wait for double tap, scroll and extended hold tap events to potentially occur. To avoid this delay, it's possible to bind to touch events (ex. touchstart) but the issue with this approach is that some mobile platforms (WP7, Blackberry) don't support touch. To compound this issue, some platforms will emit both touch and mouse events so if you bind to both types, duplicate events will be fired for a single interaction.

      +

      Our solution is to create a set of virtual events that normalize mouse and touch events. This allows the developer to register listeners for the basic mouse events, such as mousedown, mousemove, mouseup, and click, and the plugin will take care of registering the correct listeners behind the scenes to invoke the listener at the fastest possible time for that device. This still retains the order of event firing in the traditional mouse environment, should multiple handlers be registered on the same element for different events. The virtual mouse system exposes the following virtual events to jQuery bind methods: vmouseover, vmousedown, vmousemove, vmouseup, vclick, and vmousecancel

      + + +

      Passing parameters between pages

      +

      jQuery Mobile does not support query parameter passing to internal/embedded pages. For example, if the framework sees a link to "#somePage?someId=1" it interpret that as "#somePage" and navigate to the internal page div with an ID of somePage and apply a data-url of #somePage?someId=1 to that page container. Subsequent calls to other params such as "#somePage?someId=2" will find the same div because jQuery Mobile refers to the data-url on the div which is only set once and will remain at #somePage?someId=1.

      + +

      There are two plugins that you can add to your project if query parameters are needed between pages. There is a lightweight page params plugin and a more fully featured jQuery Mobile router plugin for use with backbone.js or spine.js.

      + + + +
      + + + +
      + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/pages/page-template.html b/libs/js/jquery-mobile-1.1.0/docs/pages/page-template.html new file mode 100755 index 0000000..88e15ec --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/pages/page-template.html @@ -0,0 +1,34 @@ + + + + + + + Single page template + + + + + + + +
      + +
      +

      Single page

      +
      + +
      +

      This is a single page boilerplate template that you can copy to build your first jQuery Mobile page. Each link or form from here will pull a new page in via Ajax to support the animated page transitions.

      +

      Just view the source and copy the code to get started. All the CSS and JS is linked to the jQuery CDN versions so this is super easy to set up. Remember to include a meta viewport tag in the head to set the zoom level.

      +

      This template is standard HTML document with a single "page" container inside, unlike a multi-page template that has multiple pages within it. We strongly recommend building your site or app as a series of separate pages like this because it's cleaner, more lightweight and works better without JavaScript.

      +
      + +
      +

      Footer content

      +
      + +
      + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/pages/page-titles.html b/libs/js/jquery-mobile-1.1.0/docs/pages/page-titles.html new file mode 100644 index 0000000..a7aad70 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/pages/page-titles.html @@ -0,0 +1,82 @@ + + + + + + jQuery Mobile Docs - Page titles + + + + + + + + + + +
      + +
      +

      Page titles

      + Home + Search +
      + +
      +
      + +

      Titles in Ajax navigation

      + +

      When you load the first page of a jQuery Mobile based site, then click a link or submit a form, Ajax is used to pull in the content of the requested page. Having both pages in the DOM is essential to enable the animated page transitions, but one downside of this approach is that the page title is always that of the first page, not the subsequent page you’re viewing.

      +

      To remedy this, jQuery Mobile automatically parses the title of the page pulled via Ajax and changes the title attribute of the parent document to match.

      + +

      Titles in multi-page templates

      + +

      On multi-page documents, we follow a similiar convention, but since all the pages share a common title, we have a data-title attribute that can be added to each page container within a multi-page template to manually define a title. The title of the HTML document will be automatically updated to match the data-title of the page currently in view.

      + +
      
      +<div data-role="page" id="foo" data-title="Page Foo">
      +
      +</div><!-- /page -->
      +
      + + +
      + + + +
      + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/pages/page-transitions-dialog.html b/libs/js/jquery-mobile-1.1.0/docs/pages/page-transitions-dialog.html new file mode 100644 index 0000000..88d6562 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/pages/page-transitions-dialog.html @@ -0,0 +1,34 @@ + + + + + + jQuery Mobile Framework - Dialog + + + + + + + + + + +
      + +
      +

      Dialog

      +
      + +
      +

      That was an animated page transition effect to a dialog that we added with a data-transition attribute on the link.

      +

      Since it uses CSS animations, this should be hardware accelerated on many devices. To see transitions, 3D transform support is required so if you only saw a fade transition that's the reason.

      + + Take me back +
      +
      + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/pages/page-transitions-page.html b/libs/js/jquery-mobile-1.1.0/docs/pages/page-transitions-page.html new file mode 100644 index 0000000..daf9100 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/pages/page-transitions-page.html @@ -0,0 +1,69 @@ + + + + + + jQuery Mobile Framework - Page + + + + + + + + + + + + +
      +
      +

      Page

      +
      + +
      +

      That was an animated page transition effect to a page that we added with a data-transition attribute on the link. This uses a different background theme swatch to see how that looks with the transitions.

      +

      Since it uses CSS animations, this should be hardware accelerated on many devices. To see transitions, 3D transform support is required so if you only saw a fade transition that's the reason.

      + +
      +

      Here's a few form elements

      + +

      These are here to see if this slows down rendering.

      + +
      + + +
      + +
      + + +
      + +
      + + +
      + +
      + + +
      + +
      + + Take me back +
      + +
      +
      + + +
      +
      +
      + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/pages/page-transitions.html b/libs/js/jquery-mobile-1.1.0/docs/pages/page-transitions.html new file mode 100644 index 0000000..01932f2 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/pages/page-transitions.html @@ -0,0 +1,174 @@ + + + + + + jQuery Mobile Docs - Transitions + + + + + + + + + + +
      + +
      +

      Transitions

      + Home + Search +
      + +
      +
      +

      Page transitions

      + +

      The jQuery Mobile framework includes a set of CSS-based transition effects that can be applied to any page link or form submission with Ajax navigation:

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      fade

      dialogpage

      pop

      dialogpage

      flip

      dialogpage

      turn

      dialogpage

      flow

      dialogpage

      slidefade

      dialogpage

      slide

      dialogpage

      slideup

      dialogpage

      slidedown

      dialogpage

      none

      dialogpage
      + + +

      Only seeing fade transitions? To view all transition types, you must be on a browser that supports 3D transforms. By default, devices that lack 3D support (such as Android 2.x) will fallback to "fade" for all transition types. This behavior is configurable (see below).

      + +

      Transitions were originally inspired by jQtouch They've since been rebuilt, but props to David Kaneda and Jonathan Stark for the initial guidance.

      + +

      Setting a transition on a link or form submit

      +

      By default, the framework applies a fade transition. To set a custom transition effect, add the data-transition attribute to the link.

      + + +<a href="index.html" data-transition="pop">I'll pop</a> + + +

      When the Back button is pressed, the framework will automatically apply the reverse version of the transition that was used to show the page. To specify that the reverse version of a transition should be used, add the data-direction="reverse" attribute to a link.

      + +

      Global configuration of transitions

      + +

      Set the defaultPageTransition global option if you'd prefer a different default transition. Dialogs have a different option called defaultDialogTransition that can also set configured.

      + + +

      Browser support and performance

      +

      All transitions are built with CSS keyframe animations and include both -webkit vendor prefixed rules for iOS, Blackberry, Android, Safari and Chrome browsers and -moz rules for Firefox browsers. Support for keyframe animations and transition smoothness is determined by the browser version and hardware and will safely fall back to no transition if animations aren't supported. To proactively exclude transition in situations with poor performance, we exclude browsers that lack 3D transforms and provide a fallback transition and apply a max width for when transitions are applied.

      + +

      Defining fallback transitions for non-3D support

      +

      By default, all transitions except fade require 3D transform support. Devices that lack 3D support will fall back to a fade transition, regardless of the transition specified. We do this to proactively exclude poorly-performing platforms like Android 2.x from advanced transitions and ensure they still have a smooth experience. Note that there are platforms such as Android 3.0 that technically support 3D transforms, but still have poor animation performance so this won't guarantee that every browser will be 100% flicker-free but we try to target this responsibly.

      + +

      The fallback transition for browsers that don't support 3D transforms can be configured for each transition type, but by default we specify "fade" as the fallback. For example, this will set the fallback transition for the slideout transition to "none":

      + $.mobile.transitionFallbacks.slideout = "none" + +

      Setting a max width for transitions

      +

      By default, transitions can be disabled (set to "none") when the window width is greater than a certain pixel width. This feature is useful because transitions can be distracting or perform poorly on larger screens. This value is configurable via the global option $.mobile.maxTransitionWidth, which defaults to false. The option accepts any number representing a pixel width or false value. If it's not false, the handler will use a "none" transition when the window width is wider than the specified value.

      + + + + + +

      Creating custom transitions

      + +

      jQuery Mobile allows for the addition of custom transitions to the $.mobile.transitionHandlers dictionary so you can expand the selection of transitions on your site or app. + + + + + +

      + + + +
      + + + +
      + + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/pages/pages-themes.html b/libs/js/jquery-mobile-1.1.0/docs/pages/pages-themes.html new file mode 100644 index 0000000..92f8876 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/pages/pages-themes.html @@ -0,0 +1,150 @@ + + + + + + jQuery Mobile Docs - Theming Pages + + + + + + + + + + +
      + +
      +

      Theming pages

      + Home + Search +
      + +
      +
      + + + +

      Page Theming

      + +

      jQuery Mobile has a rich theming system that gives you full control of how pages are styled. There is detailed theming documentation within each page widget, but let's look at a few high-level examples of how theming is applied.

      + +

      The data-theme attribute can be applied to the header and footer containers to apply any of the lettered theme color swatches. While the data-theme attribute could be added to the content container, we recommend adding it instead to div or container that has been assigned the data-role="page" attribute to ensure that the background color is applied to the full page. When this is done, all widgets on the page will also inherit the theme specified in the page container. However, headers and footers will default to theme "a". If you want to have a page with, for example, only theme "b" for all its elements, including its header and footer, you will need to specify data-theme="b" to the page div as well as the header and footer divs.

      + +

      The default Theme mixes styles from multiple swatches to create visual texture and present the various elements in optimal contrast to one another:

      + +
      +

      Default Theme

      +
      + +
      +

      Default Theme Content Header

      +

      This is the default content color swatch and a preview of a link.

      + + Button +
      + +

      And each of the five "swatches" applies its style consistently across all page elements, as shown below:

      + +

      Swatch A

      +
      +

      Header A

      +
      + + +
      +

      Header

      +

      This is content color swatch "A" and a preview of a link.

      + Button +
      + + +

      Swatch B

      +
      +

      Header B

      +
      +
      +

      Header

      +

      This is content color swatch "B" and a preview of a link.

      + Button +
      + +

      Swatch C

      +
      +

      Header C

      +
      +
      +

      Header

      +

      This is content color swatch "C" and a preview of a link.

      + Button +
      + +

      Swatch D

      +
      +

      Header D

      +
      +
      +

      Header

      +

      This is content color swatch "D" and a preview of a link.

      + Button +
      + +

      Swatch E

      +
      +

      Header E

      +
      +
      +

      Header

      +

      This is content color swatch "E" and a preview of a link.

      + Button +
      + +
      + + + +
      + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/pages/pages-themes/theme-a.html b/libs/js/jquery-mobile-1.1.0/docs/pages/pages-themes/theme-a.html new file mode 100644 index 0000000..9aae998 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/pages/pages-themes/theme-a.html @@ -0,0 +1,163 @@ + + + + + + jQuery Mobile Docs - Theming Pages + + + + + + + + + + +
      + +
      +

      Theming pages

      + Home + Search +
      + +
      +
      + + + +

      Theme A Sample Page

      + +

      This is an example of data-theme="a" applied to the same element as data-role="page", showing how the theme is inherited by widgets throughout the page.

      + +
      + + +
      + +
      + + +
      + +
      + + +
      + +
      +
      + Font styling: + + + + + + + + +
      +
      + +
      +
      + Choose a pet: + + + + + + + + + + + +
      +
      + +
      + + +
      + +

      Collapsible Sets

      +
      +
      +

      Section 1

      +

      I'm the collapsible content in a set so this feels like an accordion. I'm visible by default because I have the data-collapsed="false" attribute; to collapse me, either click my header or expand another header in my set.

      +
      +
      +

      Section 2

      +

      I'm the collapsible content in a set so this feels like an accordion. I'm hidden by default because I have the "collapsed" state; you need to expand the header to see me.

      + +
      +
      +

      Section 3

      +

      I'm the collapsible content in a set so this feels like an accordion. I'm hidden by default because I have the "collapsed" state; you need to expand the header to see me.

      + +
      +
      + +

      Inset List

      + + +
      + + + + +
      + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/pages/pages-themes/theme-b.html b/libs/js/jquery-mobile-1.1.0/docs/pages/pages-themes/theme-b.html new file mode 100644 index 0000000..7803d1d --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/pages/pages-themes/theme-b.html @@ -0,0 +1,163 @@ + + + + + + jQuery Mobile Docs - Theming Pages + + + + + + + + + + +
      + +
      +

      Theming pages

      + Home + Search +
      + +
      +
      + + + +

      Theme B Sample Page

      + +

      This is an example of data-theme="b" applied to the same element as data-role="page", showing how the theme is inherited by widgets throughout the page.

      + +
      + + +
      + +
      + + +
      + +
      + + +
      + +
      +
      + Font styling: + + + + + + + + +
      +
      + +
      +
      + Choose a pet: + + + + + + + + + + + +
      +
      + +
      + + +
      + +

      Collapsible Sets

      +
      +
      +

      Section 1

      +

      I'm the collapsible content in a set so this feels like an accordion. I'm visible by default because I have the data-collapsed="false" attribute; to collapse me, either click my header or expand another header in my set.

      +
      +
      +

      Section 2

      +

      I'm the collapsible content in a set so this feels like an accordion. I'm hidden by default because I have the "collapsed" state; you need to expand the header to see me.

      + +
      +
      +

      Section 3

      +

      I'm the collapsible content in a set so this feels like an accordion. I'm hidden by default because I have the "collapsed" state; you need to expand the header to see me.

      + +
      +
      + +

      Inset List

      + + +
      + + + +
      + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/pages/pages-themes/theme-c.html b/libs/js/jquery-mobile-1.1.0/docs/pages/pages-themes/theme-c.html new file mode 100644 index 0000000..2bbdd2f --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/pages/pages-themes/theme-c.html @@ -0,0 +1,163 @@ + + + + + + jQuery Mobile Docs - Theming Pages + + + + + + + + + + +
      + +
      +

      Theming pages

      + Home + Search +
      + +
      +
      + + + +

      Theme C Sample Page

      + +

      This is an example of data-theme="c" applied to the same element as data-role="page", showing how the theme is inherited by widgets throughout the page.

      + +
      + + +
      + +
      + + +
      + +
      + + +
      + +
      +
      + Font styling: + + + + + + + + +
      +
      + +
      +
      + Choose a pet: + + + + + + + + + + + +
      +
      + +
      + + +
      + +

      Collapsible Sets

      +
      +
      +

      Section 1

      +

      I'm the collapsible content in a set so this feels like an accordion. I'm visible by default because I have the data-collapsed="false" attribute; to collapse me, either click my header or expand another header in my set.

      +
      +
      +

      Section 2

      +

      I'm the collapsible content in a set so this feels like an accordion. I'm hidden by default because I have the "collapsed" state; you need to expand the header to see me.

      + +
      +
      +

      Section 3

      +

      I'm the collapsible content in a set so this feels like an accordion. I'm hidden by default because I have the "collapsed" state; you need to expand the header to see me.

      + +
      +
      + +

      Inset List

      + + +
      + + + +
      + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/pages/pages-themes/theme-d.html b/libs/js/jquery-mobile-1.1.0/docs/pages/pages-themes/theme-d.html new file mode 100644 index 0000000..91e2136 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/pages/pages-themes/theme-d.html @@ -0,0 +1,163 @@ + + + + + + jQuery Mobile Docs - Theming Pages + + + + + + + + + + +
      + +
      +

      Theming pages

      + Home + Search +
      + +
      +
      + + + +

      Theme D Sample Page

      + +

      This is an example of data-theme="d" applied to the same element as data-role="page", showing how the theme is inherited by widgets throughout the page.

      + +
      + + +
      + +
      + + +
      + +
      + + +
      + +
      +
      + Font styling: + + + + + + + + +
      +
      + +
      +
      + Choose a pet: + + + + + + + + + + + +
      +
      + +
      + + +
      + +

      Collapsible Sets

      +
      +
      +

      Section 1

      +

      I'm the collapsible content in a set so this feels like an accordion. I'm visible by default because I have the data-collapsed="false" attribute; to collapse me, either click my header or expand another header in my set.

      +
      +
      +

      Section 2

      +

      I'm the collapsible content in a set so this feels like an accordion. I'm hidden by default because I have the "collapsed" state; you need to expand the header to see me.

      + +
      +
      +

      Section 3

      +

      I'm the collapsible content in a set so this feels like an accordion. I'm hidden by default because I have the "collapsed" state; you need to expand the header to see me.

      + +
      +
      + +

      Inset List

      + + +
      + + + +
      + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/pages/pages-themes/theme-e.html b/libs/js/jquery-mobile-1.1.0/docs/pages/pages-themes/theme-e.html new file mode 100644 index 0000000..b06458a --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/pages/pages-themes/theme-e.html @@ -0,0 +1,163 @@ + + + + + + jQuery Mobile Docs - Theming Pages + + + + + + + + + + +
      + +
      +

      Theming pages

      + Home + Search +
      + +
      +
      + + + +

      Theme E Sample Page

      + +

      This is an example of data-theme="e" applied to the same element as data-role="page", showing how the theme is inherited by widgets throughout the page.

      + +
      + + +
      + +
      + + +
      + +
      + + +
      + +
      +
      + Font styling: + + + + + + + + +
      +
      + +
      +
      + Choose a pet: + + + + + + + + + + + +
      +
      + +
      + + +
      + +

      Collapsible Sets

      +
      +
      +

      Section 1

      +

      I'm the collapsible content in a set so this feels like an accordion. I'm visible by default because I have the data-collapsed="false" attribute; to collapse me, either click my header or expand another header in my set.

      +
      +
      +

      Section 2

      +

      I'm the collapsible content in a set so this feels like an accordion. I'm hidden by default because I have the "collapsed" state; you need to expand the header to see me.

      + +
      +
      +

      Section 3

      +

      I'm the collapsible content in a set so this feels like an accordion. I'm hidden by default because I have the "collapsed" state; you need to expand the header to see me.

      + +
      +
      + +

      Inset List

      + + +
      + + + +
      + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/pages/phonegap.html b/libs/js/jquery-mobile-1.1.0/docs/pages/phonegap.html new file mode 100644 index 0000000..51a53b3 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/pages/phonegap.html @@ -0,0 +1,115 @@ + + + + + + jQuery Mobile Docs - Phonegap + + + + + + + + + + +
      + +
      +

      PhoneGap apps

      + Home + Search +
      + +
      +
      + + +

      Building PhoneGap apps with jQuery Mobile

      + +

      PhoneGap is an HTML5 app platform that allows developers to author native applications with web technologies and get access to APIs and app stores. Applications are built as normal HTML pages and packaged up to run as a native application within a UIWebView or WebView (a chromeless browser, referred to hereafter as a webview). Since PhoneGap is frequently used in conjunction with jQuery Mobile, we wanted to offer a few tips and recommendations to help you get staretd.

      + +

      The initial application document is loaded by the PhoneGap application by a local file:// URL. This means that if you want to pull in pages from your company's remote server (phone home) you will have to refer to them with absolute URLs to your server. Because your document originates from a file:// URL, loading pages or assets from your remote server is considered a cross-domain request that can be blocked in certain scenarios.

      + +

      Your ability to access cross-domain pages from within a Phone Gap jQuery Mobile application is controlled by two key things: $.support.cors and $.mobile.allowCrossDomainPages, and can also be influenced by the white list feature in later builds of PhoneGap.

      + +

      $.support.cors

      + +

      In jQuery core, there is a $.support.cors boolean that indicates whether or not jQuery thinks the browser supports the W3C "Cross-Origin Resource Sharing" feature to support cross-domain requests.

      + +

      Since jQuery Mobile relies on jQuery core's $.ajax() functionality, $.support.cors must be set to true to tell $.ajax to load cross-domain pages. We've heard reports that webviews on some platforms, like BlackBerry, support cross-domain loading, but that jQuery core incorrectly sets $.support.cors value to false which disables cross-domain $.ajax() requests and will cause the page or assets to fail to load.

      + +

      $.mobile.buttonMarkup.hoverDelay

      + +

      If you find that the button down/hover state (lists, buttons, links etc) feels sluggish the $.mobile.buttonMarkup.hoverDelay setting might be of use. It will decrease the time between the touch event and the application of the relevant class but will also result in a higher chance that the same class will be applied even when the user is scrolling (eg, over a long list of links).

      + +

      $.mobile.allowCrossDomainPages

      + +

      When jQuery Mobile attempts to load an external page, the request runs through $.mobile.loadPage(). This will only allow cross-domain requests if the $.mobile.allowCrossDomainPages configuration option is set to true. Because the jQuery Mobile framework tracks what page is being viewed within the browser's location hash, it is possible for a cross-site scripting (XSS) attack to occur if the XSS code in question can manipulate the hash and set it to a cross-domain URL of its choice. This is the main reason that the default setting for $.mobile.allowCrossDomainPages is set to false.

      + +

      So in PhoneGap apps that must "phone home" by loading assets off a remote server, both the $.support.cors AND $.mobile.allowCrossDomainPages must be set to true. The $.mobile.allowCrossDomainPages option must be set before any cross-domain request is made so we recommend wrapping this in a mobileinit handler:

      + +
      $( document ).bind( "mobileinit", function() {
      +    // Make your jQuery Mobile framework configuration changes here!
      +
      +    $.mobile.allowCrossDomainPages = true;
      +});
      + +

      PhoneGap White Listing

      + +

      PhoneGap 1.0 introduced the idea of white-listing servers that its internal webview is allowed to make cross-domain requests to. You can find info about it here on the PhoneGap wiki:

      + +

      However, not all platforms support this white-listing feature so check the PhoneGap documentation for details. Older versions of PhoneGap prior to 1.0 defaulted to allowing cross-domain requests to any server.

      + +

      Still having issues?

      + +

      Here are a few more tips that aren't specifically related to PhoneGap but are good to know:

      + +

      We recommend disabling the pushState feature for installed apps because there are edge cases where this feature can cause unexpected navigation behavior and since URLs aren't visible in a webview, it's not worth keeping this active in these situations.

      + +

      Android enforces a timeout when loading URLs in a webview which may be too short for your needs. You can change this timeout by editing a Java class generated by the Eclipse plugin for Android:

      + + super.setIntegerProperty("loadUrlTimeoutValue", 60000); + + + +
      + + + + +
      + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/pages/touchoverflow.html b/libs/js/jquery-mobile-1.1.0/docs/pages/touchoverflow.html new file mode 100644 index 0000000..e552a84 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/pages/touchoverflow.html @@ -0,0 +1,127 @@ + + + + + + jQuery Mobile Docs - touchOverflow + + + + + + + + + + +
      + +
      +

      touchOverflow

      + Home + Search +
      + +
      +
      + +
      +

      touchOverflowEnabled: Deprecated in 1.1.0

      + +

      Prior to jQuery Mobile 1.1, true fixed toolbar support was contingent on native browser support for the CSS property overflow-scrolling: touch, which is currently only supported in iOS5. As of version 1.1, jQuery Mobile no longer uses this CSS property at all. We've removed all internal usage of this property in the framework, but we've left it defined globally on the $.mobile object to reduce the risk that its removal will cause trouble with existing applications. This property is flagged for removal, so please update your code to no longer use it. The support test for this property, however, remains defined under $.support and we have no plans to remove that test at this time.

      +
      + +

      touchOverflow: Improved page transitions and true fixed toolbars

      + +

      Currently, both the page you're viewing and the one you're navigating to are sitting next to each other in the viewport, which lets us leverage native scrolling for the broadest possible device support. The downside to this approach is that since both pages share the same viewport, when a page transition starts, we must first scroll to the top of the document, then start animating to ensure that the pages are lined up vertically. If you hit the Back button, we need to scroll up, transition, then restore the previous scroll position. Since mobile browsers are pretty slow, these scroll movements can detract from the flow of the experience.

      + +

      The way to really improve this situation is to have both pages in separate containers, each with its own internal scroll bar. The means no more scrolling the document or needing to restore scroll positions for a smoother experience. It also has the benefit of making fixed toolbars very easy to implement by simply placing them outside the containers with internal scrolling.

      + +

      How it works

      + +

      To leverage iOS5′s support for a touch-targeted version of overflow:auto which allows for internal scrolling regions with the native momentum scrolling, we've added a feature called touchOverflow that leverages these new CSS capabilities to enable us to bring both true “fixed” toolbars and super smooth transitions to iOS5, all by using web standards and very little additional code.

      + +

      A feature called touchOverflowEnabled is designed to leverage the upcoming wave of browsers that support overflow scrolling in CSS. Note that this feature is off by default to give us more time to test and debug this for best performance but we hope to turn it on by default at a later point. Here's how to enable this global option:

      + +
      <script>
      +$(document).bind("mobileinit", function(){
      +  $.mobile.touchOverflowEnabled = true;
      +});
      +</script>
      + +

      When this feature is activated, the framework looks for browser support for both the overflow: and -webkit-overflow-scrolling:touch CSS properties. In browsers that support both, it switches to a dual page container model with native overflow: scrolling within each, which brings true fixed toolbars smooth transitions. Coupled with iOS’s already excellent hardware-accelerated transitions, it's now possible to build interfaces that are very close to native performance.

      + +

      To demo this feature, check out this page in iOS5.

      + +

      A few downsides

      + +

      Nothing is perfect, especially a new feature, so there are a few downsides to keep in mind. When activating this feature:

      + +
        +
      • Sometimes child elements like lists and forms wouldn't render when embedded in a page with overflow: in iOS5. This was a pretty random phenomenon but is not acceptable so we've added a translate-z CSS property which forces iOS to render the contents. The downside with this fix is that when a transform is applied, all elements are set to position:relative which can cause issues in your layout.
      • +
      • The -webkit-overflow-scrolling:touch property seems to disable the events to scroll you to the top of the page when the time is tapped in the status bar. We hope Apple fixes this because it's a very useful feature.
      • +
      • When overflow: and -webkit-overflow-scrolling:touch properties are set, iOS appears to ignore any overflow:hidden properties on the parent, which is the page in our case. So if you have an image or code block that is wider than the viewport, horizontal scrolling will be seen.
      • +
      • When this feature is active, we are disabling user zoom by manipulating the meta viewport tag because both the toolbars and page content can easily be zoomed to an odd size and it's very difficult to zoom back out. Even though we believe in allowing users to zoom the page, alleviating the usability concerns we have with fixed toolbars and overflow containers is more important.
      • +
      • Scroll position can be lost when going back to a page that has been re-loaded. If DOM caching is on, this shouldn't be as much of an issue.
      • +
      • This is still an experimental feature, so not all the kinks have been worked out yet. Use with caution and test thoroughly.
      • +
      + + + +

      Don’t other mobile platforms already support overflow?

      +

      Yes, but there’s a catch. Both Android Honeycomb and the Blackberry PlayBook support overflow: properties, but we found in testing that their implementation of overflow wasn't smooth enough, so pages would stutter and hang during scrolling, leading to an unusable experience. We're working with device makers to ensure that they are included when performance improves.

      +

      More importantly, targeting overflow correctly is a major issue. If we simply placed an overflow: auto CSS rule on the pages, other popular mobile platforms like older versions of Android and iOS would essentially just clip off the content and make it effectively inaccessible (yes, you can do a two-finger scroll gesture in iOS but nobody knows that). The smart thing about Apple’s implementation for iOS5 is that they added an additional CSS property -webkit-overflow-scrolling:touch that allows us to test for this touch scrolling property and, if supported, add in the overflow rules for just those browsers. This is the only safe way to target overflow without resorting to complex and unmaintainable user agent detection.

      +

      We will be working with device and browser makers to encourage support for both these CSS-based properties because we strongly believe that this a critical piece needed to build rich mobile web apps. The project will add any vendor-prefixed additions to touch scrolling property if, for example, Opera, Firefox or Microsoft added this support. Once people see how much better page transitions and fixed toolbars are on iOS5, we’re hoping this will be supported quickly by other browsers. JS-based scroller scripts may still have a place in this new world as a polyfill for browsers that don’t yet support these new CSS capabilities but we see this as a brief, interim tool in the evolution of the mobile web.

      + + + +

      Debugging touchOverflow

      +

      Generally touchOverflow is only enabled on devices that support touch-scrolling of overflow areas, not desktop browsers. This can make it difficult to debug problems with the touchOverflow feature. To enable touchOverflow on all browsers, use the following code: + +

      <script>
      +$(document).bind("mobileinit", function() {
      +  $.support.touchOverflow = true;
      +  $.mobile.touchOverflowEnabled = true;
      +});
      +</script>
      + + +
      + + + +
      + + + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/pages/transition-success.html b/libs/js/jquery-mobile-1.1.0/docs/pages/transition-success.html new file mode 100644 index 0000000..23eac4a --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/pages/transition-success.html @@ -0,0 +1,33 @@ + + + + + + jQuery Mobile Framework - Dialog Example + + + + + + + + + + +
      + +
      +

      Ta-da!

      +
      + +
      +

      That was an animated page transition effect that we added with a data-transition attribute on the link.

      +

      Since it uses CSS transforms, this should be hardware accelerated on many mobile devices.

      +

      What do you think?

      + I like it +
      +
      + + + + diff --git a/libs/js/jquery-mobile-1.1.0/docs/toolbars/bars-fixed-events.html b/libs/js/jquery-mobile-1.1.0/docs/toolbars/bars-fixed-events.html new file mode 100644 index 0000000..d65dbc0 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/toolbars/bars-fixed-events.html @@ -0,0 +1,84 @@ + + + + + + jQuery Mobile Framework - Fixed Toolbars + + + + + + + + + + +
      + +
      + +

      Fixed toolbars

      + Home + Search +
      + +
      +
      +

      Fixed toolbars

      + + + +

      The fixedtoolbar plugin has the following custom events:

      + +
      + +
      create triggered when a fixed toolbar is created
      +
      + +
      
      +$( ".selector" ).fixedtoolbar({
      +   create: function(event, ui) { ... }
      +});		
      +						
      +
      + + +
      + +
      + +
      + +

      More in this section

      + + +
      +
      + +
      + + + +
      + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/toolbars/bars-fixed-forms-a.html b/libs/js/jquery-mobile-1.1.0/docs/toolbars/bars-fixed-forms-a.html new file mode 100644 index 0000000..1c732e7 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/toolbars/bars-fixed-forms-a.html @@ -0,0 +1,299 @@ + + + + + + jQuery Mobile Framework - Fixed Toolbars + + + + + + + + + + +
      + +
      + +
      +
      +
      +

      2,146 Songs

      +
      +
      + +
      +
      + +
      +
      +
      + + +
      +
      + +
      +
      +
      + +
      + +
      +
      + + +
      + + + +
      + + + +
      + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/toolbars/bars-fixed-forms-b.html b/libs/js/jquery-mobile-1.1.0/docs/toolbars/bars-fixed-forms-b.html new file mode 100644 index 0000000..3550110 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/toolbars/bars-fixed-forms-b.html @@ -0,0 +1,129 @@ + + + + + + jQuery Mobile Framework - Fixed Toolbars + + + + + + + + + + +
      + +
      +
      + + +
      +
      + +
      +
      +

      Forms in fixed toolbar demos

      +

      These pages are designed to test fixed toolbars and form elements: + demo app, + text inputs, + search inputs, + radio toggles, + checkbox toggles, + slider, + select, and + buttons. +

      + +

      Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

      + + +

      Embedded form

      + +
      + +
      + + +
      + +
      + + +
      + +
      + + +
      + +
      + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      +
      +
      + +

      A bit more text

      + +

      Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

      +
      + + + +
      + + + +
      + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/toolbars/bars-fixed-forms-c.html b/libs/js/jquery-mobile-1.1.0/docs/toolbars/bars-fixed-forms-c.html new file mode 100644 index 0000000..5404cd4 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/toolbars/bars-fixed-forms-c.html @@ -0,0 +1,129 @@ + + + + + + jQuery Mobile Framework - Fixed Toolbars + + + + + + + + + + +
      + +
      +
      + + +
      +
      + +
      +
      +

      Forms in fixed toolbar demos

      +

      These pages are designed to test fixed toolbars and form elements: + demo app, + text inputs, + search inputs, + radio toggles, + checkbox toggles, + slider, + select, and + buttons. +

      + +

      Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

      + + +

      Embedded form

      + +
      + +
      + + +
      + +
      + + +
      + +
      + + +
      + +
      + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      +
      +
      + +

      A bit more text

      + +

      Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

      +
      + + + +
      + + + +
      + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/toolbars/bars-fixed-forms-d.html b/libs/js/jquery-mobile-1.1.0/docs/toolbars/bars-fixed-forms-d.html new file mode 100644 index 0000000..59e3be1 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/toolbars/bars-fixed-forms-d.html @@ -0,0 +1,153 @@ + + + + + + jQuery Mobile Framework - Fixed Toolbars + + + + + + + + + + +
      + +
      +
      +
      + Choose a pet: + + + + + + + + + + + +
      +
      +
      + +
      +
      +

      Forms in fixed toolbar demos

      +

      These pages are designed to test fixed toolbars and form elements: + demo app, + text inputs, + search inputs, + radio toggles, + checkbox toggles, + slider, + select, and + buttons. +

      + +

      Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

      + + +

      Embedded form

      + +
      + +
      + + +
      + +
      + + +
      + +
      + + +
      + +
      + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      +
      +
      + +

      A bit more text

      + +

      Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

      +
      + + + +
      + + + +
      + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/toolbars/bars-fixed-forms-e.html b/libs/js/jquery-mobile-1.1.0/docs/toolbars/bars-fixed-forms-e.html new file mode 100644 index 0000000..74300cf --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/toolbars/bars-fixed-forms-e.html @@ -0,0 +1,153 @@ + + + + + + jQuery Mobile Framework - Fixed Toolbars + + + + + + + + + + +
      + +
      +
      +
      + Choose as many snacks as you'd like: + + + + + + + + + + + +
      +
      +
      + +
      +
      +

      Forms in fixed toolbar demos

      +

      These pages are designed to test fixed toolbars and form elements: + demo app, + text inputs, + search inputs, + radio toggles, + checkbox toggles, + slider, + select, and + buttons. +

      + +

      Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

      + + +

      Embedded form

      + +
      + +
      + + +
      + +
      + + +
      + +
      + + +
      + +
      + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      +
      +
      + +

      A bit more text

      + +

      Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

      +
      + + + +
      + + + +
      + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/toolbars/bars-fixed-forms-f.html b/libs/js/jquery-mobile-1.1.0/docs/toolbars/bars-fixed-forms-f.html new file mode 100644 index 0000000..5ba4cf5 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/toolbars/bars-fixed-forms-f.html @@ -0,0 +1,129 @@ + + + + + + jQuery Mobile Framework - Fixed Toolbars + + + + + + + + + + +
      + +
      +
      + + +
      +
      + +
      +
      +

      Forms in fixed toolbar demos

      +

      These pages are designed to test fixed toolbars and form elements: + demo app, + text inputs, + search inputs, + radio toggles, + checkbox toggles, + slider, + select, and + buttons. +

      + +

      Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

      + + +

      Embedded form

      + +
      + +
      + + +
      + +
      + + +
      + +
      + + +
      + +
      + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      +
      +
      + +

      A bit more text

      + +

      Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

      +
      + + + +
      + + + +
      + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/toolbars/bars-fixed-forms-g.html b/libs/js/jquery-mobile-1.1.0/docs/toolbars/bars-fixed-forms-g.html new file mode 100644 index 0000000..efbfc18 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/toolbars/bars-fixed-forms-g.html @@ -0,0 +1,231 @@ + + + + + + jQuery Mobile Framework - Fixed Toolbars + + + + + + + + + + +
      + +
      +
      + + +
      +
      + +
      +
      +

      Forms in fixed toolbar demos

      +

      These pages are designed to test fixed toolbars and form elements: + demo app, + text inputs, + search inputs, + radio toggles, + checkbox toggles, + slider, + select, and + buttons. +

      + +

      Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

      + + +

      Embedded form

      + +
      + +
      + + +
      + +
      + + +
      + +
      + + +
      + +
      + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      +
      +
      + +

      A bit more text

      + +

      Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

      +
      + + + +
      + + + +
      + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/toolbars/bars-fixed-forms-h.html b/libs/js/jquery-mobile-1.1.0/docs/toolbars/bars-fixed-forms-h.html new file mode 100644 index 0000000..a4710c4 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/toolbars/bars-fixed-forms-h.html @@ -0,0 +1,135 @@ + + + + + + jQuery Mobile Framework - Fixed Toolbars + + + + + + + + + + +
      + +
      +
      + Link + + + + +
      +
      + +
      +
      +

      Forms in fixed toolbar demos

      +

      These pages are designed to test fixed toolbars and form elements: + demo app, + text inputs, + search inputs, + radio toggles, + checkbox toggles, + slider, + select, and + buttons. +

      + +

      Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

      + + +

      Embedded form

      + +
      + +
      + + +
      + +
      + + +
      + +
      + + +
      + +
      + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      +
      +
      + +

      A bit more text

      + +

      Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

      +
      + + + +
      + + + +
      + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/toolbars/bars-fixed-forms.html b/libs/js/jquery-mobile-1.1.0/docs/toolbars/bars-fixed-forms.html new file mode 100644 index 0000000..bb82528 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/toolbars/bars-fixed-forms.html @@ -0,0 +1,45 @@ + + + + + + jQuery Mobile Framework - Fixed Toolbars + + + + + + + + + + + + +
      + +
      + + + + + + +

      Fixed + Forms

      +
      + + + +
      + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/toolbars/bars-fixed-methods.html b/libs/js/jquery-mobile-1.1.0/docs/toolbars/bars-fixed-methods.html new file mode 100644 index 0000000..912fa32 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/toolbars/bars-fixed-methods.html @@ -0,0 +1,134 @@ + + + + + + jQuery Mobile Framework - Fixed Toolbars + + + + + + + + + + +
      + +
      + +

      Fixed toolbars

      + Home + Search +
      + +
      +
      +

      Fixed toolbars

      + + + + + + + + +

      The fixedtoolbar plugin has the following methods:

      + +
      + +
      show show the toolbar
      +
      +
      
      +		    $("[data-position='fixed']").fixedtoolbar('show');
      +		   				
      + +
      +

      Note:Prior to version 1.1, the following syntax was used to show the toolbars, but it is no longer supported:

      +
      
      +$.mobile.fixedToolbars
      +   .show(true);
      +
      + + +
      + +
      + +
      hide hide the toolbar (if it's not a fullscreen toolbar, it'll toggle back to static positioning, which may or may not be hidden from view depending on scroll)
      +
      +
      
      +$("[data-position='fixed']").fixedtoolbar('hide');
      +		   				
      +
      + +
      toggle calls either the show or the hide method, depending on whether the toolbar is visible.
      +
      +
      
      +$("[data-position='fixed']").fixedtoolbar('toggle');
      +		   				
      +
      + +
      updatePagePadding update the padding (either top or bottom, depending on if the toolbar is a header or a footer) of the page element parent of the toolbar to match the height of the toolbar.
      +
      +
      
      +$("[data-position='fixed']").fixedtoolbar('updatePagePadding');
      +		   				
      + +

      There is also an updatelayout event that can be used to trigger the toolbars to re-position. Developers who are building dynamic applications that inject content into the current page can also manually trigger this updatelayout event to ensure components on the page update in response to the new content that was just added. This event is used internally in the collapsible and listview filter plugins and is powerful because it's not toolbar-specific -- any widget can be built to listen for the updatelayout event to update the widget in response.

      +
      + +
      destroy destroy at fixedtoolbar (restore the element to its initial state)
      +
      +
      
      +$("[data-position='fixed']").fixedtoolbar('destroy');
      +		   				
      +
      + + +
      + + + + + + +
      + +
      + +
      + +

      More in this section

      + + +
      +
      + +
      + + + +
      + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/toolbars/bars-fixed-options.html b/libs/js/jquery-mobile-1.1.0/docs/toolbars/bars-fixed-options.html new file mode 100644 index 0000000..12367f6 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/toolbars/bars-fixed-options.html @@ -0,0 +1,177 @@ + + + + + + jQuery Mobile Framework - Fixed Toolbars + + + + + + + + + + +
      + +
      + +

      Fixed toolbars

      + Home + Search +
      + +
      +
      +

      Fixed toolbars

      + + + +

      The fixedtoolbar plugin has the following options:

      + + +
      + +
      visibleOnPageShow boolean
      +
      +

      default: true

      +

      This determines whether the toolbar is visible or not when its parent page is shown. This option is also exposed as a data attribute: data-visible-on-page-show="false"

      +
      $("[data-role=header]").fixedtoolbar({ visibleOnPageShow: false });
      +
      + +
      disablePageZoom boolean
      +
      +

      default: true

      +

      This determines whether user-scaling should be disabled on pages that contain fixed toolbars. This option is also exposed as a data attribute: data-disable-page-zoom="false"

      +
      $("[data-role=header]").fixedtoolbar({ disablePageZoom: false });
      +
      + +
      transition string
      +
      +

      default: "slide" (which ends up using slideup and slidedown)

      +

      The transition that should be used for showing and hiding a fixed toolbar. Possible values are "none", "fade", and "slide" (or you can write a CSS transition of your own and use that too). This option is also exposed as a data attribute: data-transition="fade"

      +
      $("[data-role=header]").fixedtoolbar({ transition: "fade" });
      +
      + +
      fullscreen boolean
      +
      +

      default: false

      +

      Fullscreen fixed toolbars sit on top of the content at all times when they are visible, and unlike regular fixed toolbars, fullscreen toolbars do not fall back to static positioning when toggled, instead they disappear from the screen entirely. Fullscreen toolbars are ideal for more immersive interfaces, like a photo viewer that is meant to fill the entire screen with the photo itself and no distractions. This page demonstrates toolbars that use the fullscreen option. This option is also exposed as a data attribute: data-fullscreen="true"

      +
      $("[data-role=header]").fixedtoolbar({ fullscreen: true });
      + +

      Note:While the data-attribute syntax for this option has not changed, it is now only supported on the toolbar element itself, and not the page element.

      + +
      + +
      tapToggle boolean
      +
      +

      default: true

      +

      Enable or disable the user's ability to toggle toolbar visibility with a tap on the screen (or a click, for mouse users). This option is also exposed as a data attribute: data-tap-toggle="true"

      +
      $("[data-role=header]").fixedtoolbar({ tapToggle: true });
      + +
      +

      Note: This behavior was formerly configurable as follows, but as of version 1.1 this syntax is no longer supported: +

      	
      +$.mobile.fixedToolbars
      +   .setTouchToggleEnabled(false);
      +
      + +
      + +
      + + + +
      tapToggleBlacklist string
      +
      +

      default: "a, .ui-header-fixed, .ui-footer-fixed"

      +

      A list of jQuery selectors that, when tapped, will not cause the toolbars to be toggled.

      +
      $("[data-role=header]").fixedtoolbar({ tapToggleBlacklist: "a, input, select, textarea, .ui-header-fixed, .ui-footer-fixed" });
      +
      + +
      hideDuringFocus string
      +
      +

      default: "input, select, textarea"

      +

      A list of jQuery selectors that should cause the toolbars to hide while focused, except if they are in a fixed toolbar.

      +
      $("[data-role=header]").fixedtoolbar({ hideDuringFocus: "input, select, textarea" });
      +
      + + +
      updatePagePadding boolean
      +
      +

      default: true

      +

      Since toolbars can vary in height depending on the content they contain, this option automatically updates the padding on the page element to ensure that fixed toolbars have adequate space in the document when they are statically positioned, and when scrolled to the top or bottom of the page. When enabled, the padding updates during many operations, such as pageshow, during page transitions, and on resize and orientationchange. As an optimization, we would recommend that you consider disabling this option and adding a rule to your CSS to set the padding of the page div to match the EM height of your toolbars, such as .ui-page-header-fixed { padding-top: 4.5em; }. This option is also exposed as a data attribute: data-update-page-paddinge="false"

      +
      $("[data-role=header]").fixedtoolbar({ updatePagePadding: false });
      +
      + + +
      supportBlacklist function
      +
      +

      default: function that returns a boolean value

      +

      CSS position: fixed support is very difficult to test; in fact, at the time of version 1.1 release, there was no known way to reasonably test for fixed support without turning up false positives or negatives in certain popular browsers. This option is a function that attempts to opt-out some popular platforms that are known to be troublesome with position: fixed . Often, these platforms support position: fixed partially, which can be worse than not supporting it at all. If overriding this option with your own blacklist logic, you simply need to provide a function that returns a true or false result when called upon initialization. You must set it on mobileinit, so that it applies when the plugin is initially created.

      +
      
      +$( document ).bind("mobileinit", function(){
      +  $.mobile.fixedtoolbar.prototype.options.supportBlacklist = function(){
      +    var result;
      +    // logic to determine whether result should be true or false
      +    return result;
      +  };
      +})
      +
      + + +
      initSelector CSS selector string
      +
      +

      default: ":jqmData(position='fixed')"

      +

      This is used to define the selectors (element types, data roles, etc.) that will automatically be initialized as fixed toolbars. To change which elements are initialized, bind this option to the mobileinit event:

      +
      $( document ).bind( "mobileinit", function(){
      +	$.mobile.fixedtoolbar.prototype.options.initSelector = ".myselector";
      +});
      +
      +
      + + + +
      + + +
      + +
      + +
      + +

      More in this section

      + + +
      +
      + +
      + + + +
      + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/toolbars/bars-fixed.html b/libs/js/jquery-mobile-1.1.0/docs/toolbars/bars-fixed.html new file mode 100644 index 0000000..24b4387 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/toolbars/bars-fixed.html @@ -0,0 +1,231 @@ + + + + + + jQuery Mobile Framework - Fixed Toolbars + + + + + + + + + + +
      + +
      +

      Fixed toolbars

      + Home + Search +
      + +
      +
      +

      Fixed toolbars

      + + + + +

      In browsers that support CSS position: fixed (most desktop browsers, iOS5+, Android 2.2+, BlackBerry 6, and others), toolbars that use the "fixedtoolbar" plugin will be fixed to the top or bottom of the viewport, while the page content scrolls freely in between. In browsers that don't support fixed positioning, the toolbars will remain positioned in flow, at the top or bottom of the page.

      + +

      To enable this behavior on a header or footer, add the data-position="fixed" attribute to a jQuery Mobile header or footer element.

      + +

      Fixed header markup example:

      +
      	
      +<div data-role="header" data-position="fixed">
      +	<h1>Fixed Header!</h1>
      +</div>
      +		
      + +

      Fixed footer markup example:

      +
      	
      +<div data-role="footer" data-position="fixed">
      +	<h1>Fixed Footer!</h1>
      +</div>
      +		
      + +

      Fullscreen Toolbars

      +

      Fullscreen fixed toolbars sit on top of the content at all times when they are visible, and unlike regular fixed toolbars, fullscreen toolbars do not fall back to static positioning when toggled. Instead they disappear from the screen entirely. Fullscreen toolbars are ideal for more immersive interfaces, like a photo viewer that is meant to fill the entire screen with the photo itself and no distractions.

      + +

      To enable this option on a fixed header or footer, add the data-fullscreen attribute to the element.

      + +
      	
      +<div data-role="header" data-position="fixed" data-fullscreen="true">
      +	<h1>Fixed Header!</h1>
      +</div>
      +				
      + + +

      Forms in toolbars

      + +

      While all form elements are now tested to work correctly within static toolbars as of jQuery Mobile 1.1, we recommend extensive testing when using form elements within fixed toolbars or within any position: fixed elements. This can potentially trigger a number of unpredictable issues in various mobile browsers, Android 2.2/2.3 in particular (detailed in Known issues in Android 2.2/2.3, below).

      + +

      Changes in jQuery Mobile 1.1

      + +

      Prior to version 1.1, jQuery Mobile used dynamically re-positioned toolbars for the fixed header effect because very few mobile browsers supported the position:fixed CSS property, and simulating fixed support through the use of "fake" JavaScript overflow-scrolling behavior would have reduced our browser support reach, in addition to feeling unnatural on certain platforms. This behavior was not ideal, and jQuery Mobile 1.1 took a new approach to fixed toolbars that allows much broader support. The framework now offers true fixed toolbars on many popular platforms, while gracefully degrading non-supporting platforms to static positioning.

      + +

      Polyfilling older platforms

      +

      The fixed toolbar plugin degrades gracefully in platforms that do not support CSS position:fixed properly, such as iOS4.3. If you still need to support fixed toolbars on that platform (with the show/hide behavior) included in previous releases, Filament Group has developed a polyfill that you can use.

      + + + +

      Just include the CSS and JS files after your references to jQuery Mobile and Fixed toolbars will work similar to jQuery Mobile 1.0 in iOS4.3, with the inclusion of the new API for the 1.1 fixedtoolbar plugin.

      + +

      If you have any improvements to suggest, fork the gist on github and let us know!

      + +

      Known issue with form controls inside fixed toolbars, and programatic scroll

      +

      An obscure issue exists in iOS5 and some Android platforms where form controls placed inside fixed-positioned containers can lose their hit area when the window is programatically scrolled (using window.scrollTo for example). This is not an issue specific to jQuery Mobile, but because of it, we recommend not programatically scrolling a document when using form controls inside jQuery Mobile fixed toolbars. This ticket from the Device Bugs project tracker explains this problem in more detail.

      + + +

      Known issues in Android 2.2/2.3

      +

      Android 2.2/2.3’s implementation of position: fixed; can, in conjunction with seemingly unrelated styles and markup patterns, cause a number of strange issues, particularly in the case of position: absolute elements inside of position: fixed elements. While we’ve done our best to work around a number of these unique bugs within the scope of the library, custom styles may cause a number of issues.

      +
        +
      • Form elements elsewhere on the page—select menus in particular—can fail to respond to user interaction when an empty absolute positioned element is placed within a fixed position element. In rare cases—and specific to Android 2.2—this can cause entire pages to fail to respond to user interaction. This can seemingly be solved by adding any character to the absolute positioned element, including a non-breaking space, and in some cases even whitespace.
      • +
      • The above-described issue can also be triggered by an absolute positioned image inside of a fixed position element, but only when that image is using something other than its inherent dimensions. If a height or width is specified on the image using CSS, or the image src is invalid (thus having no inherent height and width), this issue can occur. If an image that is inherently, say, 50x50 pixels is placed in a fixed element and left at its inherent dimensions, this issue does not seem to occur.
      • +
      • When a position: fixed element appears anywhere on a page, most 2D CSS transforms will fail. Oddly, only translate transforms seem unaffected by this. Even more oddly, this issue is solved by setting a CSS opacity of .9 or below on the parent of the fixed element.
      • +
      • Combinations of position: fixed and overflow properties are best avoided, as both have been known to cause unpredictable issues in older versions of Android OS.
      • +
      • Any element that triggers the on-screen keyboard, when placed inside a position: fixed element, will fail to respond to user input when using anything other than the default keyboard. This includes Swype, XT9 or, it seems, any input method apart from the standard non-predictive keyboard.
      • +
      + +

      While we will continue to try to find ways to mitigate these bugs as best we can, we currently advise against implementing fixed toolbars containing complicated user styles and form elements without extensive testing in all versions of Android’s native browser.

      + +

      The following pages are designed to test fixed toolbars and form elements: + demo app, + text inputs, + search inputs, + radio toggles, + checkbox toggles, + slider, + select, and + buttons.

      + + +
      +

      No longer supported: touchOverflowEnabled

      + +

      Prior to jQuery Mobile 1.1, true fixed toolbar support was contingent on native browser support for the CSS property overflow-scrolling: touch, which is currently only supported in iOS5. As of version 1.1, jQuery Mobile no longer uses this CSS property at all. We've removed all internal usage of this property in the framework, but we've left it defined globally on the $.mobile object to reduce the risk that its removal will cause trouble with existing applications. This property is flagged for removal, so please update your code to no longer use it. The support test for this property, however, remains defined under $.support and we have no plans to remove that test at this time.

      +
      +
      + + +

      The rest of the page is just sample content to make the page very long

      + +

      Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

      + +

      Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

      + + +

      And an inset list

      + + + +
      +

      Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

      + +

      Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

      + + +

      Embedded form

      + +
      + +
      + + +
      + +
      + + +
      + +
      + + +
      + +
      + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      +
      +
      + +

      A bit more text

      + +

      Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

      + + + + +
      + +
      + +
      + +

      More in this section

      + + +
      +
      + +
      + +
      +

      Fixed Footer

      +
      + +
      + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/toolbars/bars-fullscreen.html b/libs/js/jquery-mobile-1.1.0/docs/toolbars/bars-fullscreen.html new file mode 100644 index 0000000..683f7b8 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/toolbars/bars-fullscreen.html @@ -0,0 +1,68 @@ + + + + + + jQuery Mobile Framework - Fullscreen Fixed toolbars + + + + + + + + + + +
      + +
      +

      Fullscreen fixed header

      + Home + Search +
      + +
      +
      + Photo Run + +

      This page demonstrates the "fullscreen" toolbar mode. This toolbar treatment is used in special cases where you want the content to fill the whole screen, and you want the header and footer toolbars to appear and disappear when the page is clicked responsively — a common scenario for photo, image or video viewers.

      + +

      To enable this toolbar feature type, you apply the data-fullscreen="true" attribute and the data-position="fixed" attribute to both the header and footer div elements, or whichever you want to be full-screen.

      + +

      Keep in mind that the toolbars in this mode will sit over page content, so not all content will be accessible with the toolbars open, just as shown in this demo.

      + + +
      + +
      + +
      + +

      More in this section

      + + +
      +
      + +
      + + + +
      + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/toolbars/bars-themes.html b/libs/js/jquery-mobile-1.1.0/docs/toolbars/bars-themes.html new file mode 100644 index 0000000..fe91b34 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/toolbars/bars-themes.html @@ -0,0 +1,177 @@ + + + + + + jQuery Mobile Framework - Theming Toolbars + + + + + + + + + + +
      + +
      +

      Bar theming

      + Home + Search +
      + + +
      +
      +

      Both the header and footer bars will be styled by default with the theme's "a" color swatch (black in the default theme) because these bars are typically primary in the visual hierarchy of a page.

      + + +

      Theming headers and footers

      +

      To set the header or footer bars to a different color in your theme, add the data-theme attribute and specify the letter of the theme swatch (a, b, c, etc.). For example, this will set the bar to swatch "b" (blue in the default theme):

      + +
      +
      +<div data-role="header" data-theme="b"> 
      +	<h1>Page Title</h1> 
      +</div> 
      +
      +
      + + +

      Theming buttons in toolbars

      + +

      Any link added inside the header block will be automatically styled as a button that matches the color of the bar's theme swatch. To make a button stand out as a primary call to action, the data-theme attribute can be used to specify a contrasting button color from a different theme swatch. For example, if we set the header to theme "c" (light gray), both buttons would be styled as the "c" button by default. If we wanted the Save button to visually pop, we can override the color by setting the data-theme attribute to "b" (blue in our default theme) on the Save button's anchor.

      + +
      +
      +<a href="add-user.php" data-theme="b">Save</a> 
      +
      +
      + + + +

      Theme variations

      +

      This is a demo of the variation that can be achieved by tweaking the theme swatches and buttons inside the headers and footers.

      +

      Headers

      + + +
      +

      Bar theme "a"

      + New +
      + +
      + Cancel +

      Bar theme "a"

      + Save +
      + +
      +

      Bar theme "b"

      + New +
      + +
      + Cancel +

      Bar theme "b"

      + Save +
      + +
      +

      Bar theme "c"

      + New +
      + +
      + Cancel +

      Bar theme "c"

      + Save +
      + +
      +

      Bar theme "d"

      + New +
      + +
      + Cancel +

      Bar theme "d"

      + Save +
      + +

      Footers

      +

      These are examples of a footer with link buttons inside. Note that footers do not have the same prescriptive markup conventions as headers with button slots so use layout grids or custom styles to achieve the design you want.

      + + + +
      + left + right + up + down +
      + +
      + left + right + up + down +
      + +
      + left + right + up + down +
      + +
      + left + right + up + down +
      + +
      + left + right + up + down +
      + + +
      + +
      + +
      + +

      More in this section

      + + +
      +
      + +
      + + + +
      + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/toolbars/docs-bars.html b/libs/js/jquery-mobile-1.1.0/docs/toolbars/docs-bars.html new file mode 100644 index 0000000..ffed0e5 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/toolbars/docs-bars.html @@ -0,0 +1,85 @@ + + + + + + jQuery Mobile Docs - Toolbar Basics + + + + + + + + + + +
      + +
      +

      Toolbar basics

      + Home + Search +
      + +
      +
      +

      Toolbar types

      + +

      In jQuery Mobile, there are two standard types of toolbars: Headers and Footers.

      + +
      • The Header bar serves as the page title, is usually the first element inside each mobile page, and typically contains a page title and up to two buttons.
      • + +
      • The Footer bar is usually the last element inside each mobile page, and tends to be more freeform than the header in terms of content and functionality, but typically contains a combination of text and buttons.
      • +
      + +

      It's very common to have a horizontal navigation or tab bar inside the header or footer; jQuery Mobile includes a navbar widget that turns an unordered list of links into a horizontal button bar, which works well in these instances.

      + +

      View the data- attribute reference to see all the possible attributes you can add to toolbars.

      + + +

      Toolbar positioning options

      + +

      Header and footers can be positioned on the page in a few different ways. By default, the toolbars use the "inline" positioning mode. In this mode, the headers and footer sit in the natural document flow (the default HTML behavior), which ensures that they are visible on all devices, regardless of JavaScript and CSS positioning support.

      + +

      A "fixed" positioning mode fixes the toolbars to either the top or bottom of the viewport on browsers that support CSS fixed positioning (which includes most desktop browsers, iOS5+, Android 2.2+, BlackBerry 6, and others). In browsers that don't support fixed positioning, the toolbars will fall back to static, inline position in the page.

      +

      When tap-toggling is enabled, tapping the screen will toggle the visibility of the fixed toolbars. Tapping the page when the toolbars aren't visible brings them into view. Tapping again hides them until you tap again. This gives users the option to hide the toolbars until needed to maximize screen real estate. One caveat is that fixed toolbars never truly hide, but toggle between fixed and static positioning. This means that if you're at the top of a page, you can't tap-toggle a header toolbar out of view, as it instead toggles into its spot in the document flow at the top of the page. The same goes for fixed footers when scrolled to the very bottom of a document.

      +

      To set this behavior on a header or footer, add the data-position="fixed" attribute to the header or footer element.

      + +

      A "fullscreen" position mode works just like the fixed mode except that the toolbars overlay the page content, rather than reserving a place in the document when not in fixed mode. This is useful for immersive apps like photo or video viewers where you want the content to fill the whole screen and toolbars can be hidden or summoned to appear by tapping the screen. Keep in mind that the toolbars in this mode will sit over page content so this is best used for specific situations.

      + + + +
      + +
      + +
      + +

      More in this section

      + + +
      +
      + +
      + + + +
      + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/toolbars/docs-footers.html b/libs/js/jquery-mobile-1.1.0/docs/toolbars/docs-footers.html new file mode 100644 index 0000000..0a30d2a --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/toolbars/docs-footers.html @@ -0,0 +1,153 @@ + + + + + + jQuery Mobile Docs - Footer Configuration + + + + + + + + + + +
      + +
      +

      Footers

      + Home + Search +
      + +
      +
      +

      Footer bar structure

      + +

      The footer bar has the same basic structure as the header except it uses the data-role attribute value of footer.

      + +
      +
      +<div data-role="footer"> 
      +	<h4>Footer content</h4> 
      +</div> 
      +
      +
      + + +

      The footer toolbar will be be themed with the "a" swatch by default (black in the default theme) but you can easily set the theme swatch color.

      + +
      +

      Footer content

      +
      + +

      The page footer is very similar to the header in terms of options and configuration. The primary difference is that the footer is designed to be less structured than the header to allow for more flexibility, so the framework doesn't automatically place buttons to the left or right based on source order as it does in the header.

      +

      Since footers do not have the same prescriptive markup conventions as headers, we recommend using layout grids or writing custom styles to achieve the design you want.

      + + + +

      Adding buttons

      + +

      Any link or valid button markup added to the footer will automatically be turned into a button. To save space, buttons in toolbars are automatically set to inline styling so the button is only as wide as the text and icons it contains.

      + +

      By default, toolbars don't have any padding to accommodate nav bars and other widgets. To include padding on the bar, add a class="ui-bar" to the footer.

      + + +
      
      +<div data-role="footer" class="ui-bar">
      +	<a href="index.html" data-role="button" data-icon="plus">Add</a>
      +	<a href="index.html" data-role="button" data-icon="arrow-u">Up</a>
      +	<a href="index.html" data-role="button" data-icon="arrow-d">Down</a>
      +</div>
      +
      + +

      This creates this toolbar with buttons sitting in a row

      + +
      + Add + Up + Down +
      + +

      Note that .ui-bar should not be added to header or footer bars that span the full width of the page, as the additional padding will cause a full-width element to break out of its parent container. To add padding inside of a full-width toolbar, wrap the toolbar's contents in an element and apply the padding to that element.

      + +

      To group buttons together into a button set, wrap the links in a wrapper with data-role="controlgroup" and data-type="horizontal" attributes.

      + +<div data-role="controlgroup" data-type="horizontal"> + +

      This creates a grouped set of buttons:

      + +
      +
      + Add + Up + Down +
      +
      + + + +

      Adding form elements

      + +

      Forms elements and other content can also be added to toolbars. Here is an example of a select menu inside a footer bar. We recommend using mini-sized form elements in toolbars by adding the data-mini="true" attribute:

      + + +
      + + +
      + + + + + + +

      Fixed & Persistent footers

      +

      In situations where the footer is a global navigation element, you may want it to appear fixed so it doesn't scroll out of view. It's also possible to make a fixed toolbar persistent so it appears to not move between page transitions. This can be accomplished by using the persistent footer feature included in jQuery Mobile.

      + +

      To make a footer persistent between transitions, add the data-id attribute to the footer of all relevant pages and use the same id value for each. For example, by adding data-id="myfooter" to the current page and the target page, the framework will keep the footer anchors in the same spot during the page animation. This effect will only work correctly if the header and footer toolbars are set to data-position="fixed" so they are in view during the transition.

      + + + + + +
      + +
      + +
      + +

      More in this section

      + + +
      +
      + +
      + + + +
      + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/toolbars/docs-headers.html b/libs/js/jquery-mobile-1.1.0/docs/toolbars/docs-headers.html new file mode 100644 index 0000000..90e5aa3 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/toolbars/docs-headers.html @@ -0,0 +1,216 @@ + + + + + + jQuery Mobile Docs - Header Bars + + + + + + + + + + +
      + +
      +

      Headers

      + Home + Search +
      + +
      +
      +

      Header structure

      +

      The header is a toolbar at the top of the page that usually contains the page title text and optional buttons positioned to the the left and/or right of the title for navigation or actions. Headers can optionally be positioned as fixed so they remain at the top of the screen at all times instead of scrolling with the page.

      + +

      The title text is normally an H1 heading element but it's possible to use any heading level (H1-H6) to allow for semantic flexibility. For example, a page containing multiple mobile 'pages' may use a H1 element on the home 'page' and a H2 element on the secondary pages. All heading levels are styled identically by default to maintain visual consistency.

      + +
      +
      +<div data-role="header"> 
      +	<h1>Page Title</h1> 
      +</div> 
      +
      +
      + +

      Default header features

      +

      The header toolbar is themed with the "a" swatch by default (black in the default theme) but you can easily set the theme swatch color.

      + + + +
      +

      Page title

      +
      + + +

      Adding buttons

      + + + + + +

      In the standard header configuration, there are slots for buttons on either side of the text heading. Each button is typically an anchor element, but any valid button markup will work. To save space, buttons in toolbars are set to inline styling so the button is only as wide as the text and icons it contains.

      + + + + +

      Default button positioning

      + +

      The header plugin looks for immediate children of the header container, and automatically sets the first link in the left button slot and the second link in the right. In this example, the 'Cancel' button will appear in the left slot and 'Save' will appear in the right slot based on their sequence in the source order.

      + + +
      			
      +<div data-role="header" data-position="inline">
      +	<a href="index.html" data-icon="delete">Cancel</a>
      +	<h1>Edit Contact</h1>
      +	<a href="index.html" data-icon="check">Save</a>
      +</div>
      +
      + + +
      + Cancel +

      Edit Contact

      + Save +
      + +

      Making buttons visually stand out

      + +

      Buttons automatically adopt the swatch color of the bar they sit in, so a link in a header bar with the "a" color will also be styled as "a" colored buttons. It's simple to make a button visually stand out. Here, we add the data-theme attribute and set the color swatch for the button to "b" to make the "Save" button pop.

      + +
      			
      +<div data-role="header" data-position="inline">
      +	<a href="index.html" data-icon="delete">Cancel</a>
      +	<h1>Edit Contact</h1>
      +	<a href="index.html" data-icon="check" data-theme="b">Save</a>
      +</div>
      +
      + + +
      + Cancel +

      Edit Contact

      + Save +
      + +

      Controlling button position with classes

      + +

      The button position can also be controlled by adding classes to the button anchors, rather than relying on source order. This is especially useful if you only want a button in the right slot. To specify the button position, add the class of ui-btn-left or ui-btn-right to the anchor.

      + + + + +
      +
      
      +<div data-role="header" data-position="inline"> 
      +	<h1>Page Title</h1>
      +	<a href="index.html" data-icon="gear" class="ui-btn-right">Options</a>
      +</div>
      +
      +
      + +
      +

      Page Title

      + Options +
      + + +

      Adding buttons to toolbars without heading

      + +

      The heading in the header bar has some margin that will give the bar its height. If you choose not to use a heading, you will need to add an element with class="ui-title" so that the bar can get the height and display correctly.

      + + +
      +
      
      +<div data-role="header" data-position="inline"> 
      +	<a href="index.html" data-icon="gear" class="ui-btn-right">Options</a>
      +	<span class="ui-title" />
      +</div>
      +	
      +
      +
      + +
      + Options + +
      + + + +

      Adding Back buttons

      + +

      jQuery Mobile has a feature to automatically create and append "back" buttons to any header, though it is disabled by default. This is primarily useful in chromeless installed applications, such as those running in a native app webview. The framework automatically generates a "back" button on a header when the page plugin's addBackBtn option is true. This can also be set via markup if the page div has a data-add-back-btn="true" attribute.

      + + +

      If you use the attribute data-rel="back" on an anchor, any clicks on that anchor will mimic the back button, going back one history entry and ignoring the anchor's default href. This is particularly useful when linking back to a named page, such as a link that says "home", or when generating "back" buttons with JavaScript, such as a button to close a dialog. When using this feature in your source markup, be sure to provide a meaningful href that actually points to the URL of the referring page. This will allow the feature to work for users in C-Grade browsers.

      +

      If you just want a reverse transition without actually going back in history, you should use the data-direction="reverse" attribute.

      + +

      Customizing the back button text

      + +

      If you'd like to configure the back button text, you can either use the data-back-btn-text="previous" attribute on your page element, or set it programmatically via the page plugin's options:
      $.mobile.page.prototype.options.backBtnText = "previous";

      + +

      Default back button style

      +

      If you'd like to configure the back button role-theme, you can use:
      $.mobile.page.prototype.options.backBtnTheme = "a";
      + If you're doing this programmatically, set this option inside the mobileinit event handler.

      + +

      Custom header configurations

      +

      If you need to to create a header that doesn't follow the default configuration, simply wrap your custom styled markup in any container, such as div. The plugin won't apply the automatic button logic to the wrapped content inside the header container so you can write custom styles for laying out the content in your header.

      + +

      It's also possible to create custom bars without using the header data-role at all. For example, start with any container and add the ui-bar class to apply standard bar padding and add the ui-bar-b class to assign the bar swatch styles from your theme. (The "b" can be any swatch letter.)

      + +
      
      +<div class="ui-bar ui-bar-b">
      +	<h3>I'm just a div with bar classes and a <a href="#" data-role="button">Button</a></h3>
      +</div>
      +			
      + +

      This will produce this bar:

      +
      +

      I'm just a div with bar classes and a mini inline Button

      +
      + +

      Note that .ui-bar should not be added to header or footer bars that span the full width of the page, as the additional padding will cause a full-width element to break out of its parent container. To add padding inside of a full-width toolbar, wrap the toolbar's contents in an element and apply the padding to that element instead.

      + +

      By writing some simple styles, it's easy to build message bars like this:

      + +
      + +

      This is an alert message.

      And here's some additional text in a paragraph.

      +
      +
      + +
      + +
      + +

      More in this section

      + + +
      +
      + +
      + + + +
      + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/toolbars/docs-navbar.html b/libs/js/jquery-mobile-1.1.0/docs/toolbars/docs-navbar.html new file mode 100644 index 0000000..1f65ba2 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/toolbars/docs-navbar.html @@ -0,0 +1,318 @@ + + + + + + jQuery Mobile Docs - Navbar + + + + + + + + + + +
      + +
      +

      Navbar

      + Home + Search +
      + +
      +
      +

      Simple navbar

      + +

      jQuery Mobile has a very basic navbar widget that is useful for providing up to 5 buttons with optional icons in a bar, typically within a header or footer. There is also a persistent navbar variation that works more like a tab bar that stays fixed as you navigate across pages.

      +

      A navbar is coded as an unordered list of links wrapped in a container element that has the data-role="navbar" attribute. To set one of the links to the active (selected) state, add class="ui-btn-active" to the anchor. In this example, we have a two-button navbar in the footer with the "One" item set to active:

      + +
      
      +<div data-role="navbar">
      +	<ul>
      +		<li><a href="a.html" class="ui-btn-active">One</a></li>
      +		<li><a href="b.html">Two</a></li>
      +	</ul>
      +</div><!-- /navbar -->
      +
      + +

      The navbar items are set to divide the space evenly so in this case, each button is 1/2 the width of the browser window:

      + + +
      + +
      + + +

      Adding a third item will automatically make each button 1/3 the width of the browser window:

      + + +
      + +
      + + +

      Adding a fourth more item will automatically make each button 1/4 the width of the browser window:

      + + +
      + +
      + + +

      The navbar maxes out with 5 items, each 1/5 the width of the browser window:

      + + +
      + +
      + + +

      If more than 5 items are added, the navbar will simply wrap to multiple lines:

      + +
      + +
      + +

      Navbars with 1 item will simply render as 100%.

      + +
      + +
      + +

      Navbars in headers

      + +

      If you want to add a navbar to the top of the page, you can still have a page title and buttons. Just add the navbar container inside the header block, right after the title and buttons in the source order.

      + +
      +

      I'm a header

      + Options + +
      + +
      +
      + +

      Navbars in footers

      + +

      If you want to add a navbar to the bottom of the page so it acts more like a tab bar, simply wrap the navbar in a container with a data-role="footer"

      +
      
      +<div data-role="footer">		
      +	<div data-role="navbar">
      +		<ul>
      +			<li><a href="#">One</a></li>
      +			<li><a href="#">Two</a></li>
      +			<li><a href="#">Three</a></li>
      +		</ul>
      +	</div><!-- /navbar -->
      +</div><!-- /footer -->
      +
      +
      +
      + +
      +
      + +

      Icons in navbars

      + +

      Icons can be added to navbar items by adding the data-icon attribute specifying a standard mobile icon to each anchor. By default, icons are added above the text (data-iconpos="top"). The following examples add icons to a navbar in a footer.

      + +
      +
      + +
      +
      + +

      The icon position is set on the navbar container instead of for individual links within for visual consistency. For example, to place the icons below the labels, add the data-iconpos="bottom" attribute to the navbar container.

      +
      
      +<div data-role="navbar" data-iconpos="bottom">
      +
      +

      This will result in a bottom icon alignment:

      +
      +
      + +
      +
      + +

      The icon position can be set to data-iconpos="left":

      + +
      +
      + +
      +
      + +

      Or the icon position can be set to data-iconpos="right":

      + +
      +
      + +
      +
      + +

      Using 3rd party icon sets

      + +

      You can add any of the popular icon libraries like Glyphish to achieve the iOS style tab that has large icons stacked on top of text labels. All that is required is a bit of custom styles to link to the icons and position them in the navbar. Here is an example using Glyphish icons and custom styles (view page source for styles) in our navbar:

      + + + + + + +

      Icons by Joseph Wain / glyphish.com. Licensed under the Creative Commons Attribution 3.0 United States License.

      + + +

      Theming navbars

      + +

      Navbars inherit the theme swatch from their parent container, just like buttons. If a navbar is placed in the header or footer toolbar, it will inherit the default toolbar swatch (A) for bars unless you set this in the markup.

      +

      Here are a few examples of navbars in various container swatches that automatically inherit their parent's swatch letter. Note that in these examples, instead of using a data-theme attribute, we're manually adding the swatch classes to apply the body swatch (ui-body-a) and the class to add the standard body padding (ui-body), but the inheritance works the same way:

      + +
      +

      Swatch A

      +
      + +
      +
      + +
      +

      Swatch B

      +
      + +
      +
      + +

      To set the theme color for a navbar item, add the data-theme attribute to the individual links and specify a theme swatch. Note that applying a theme swatch to the navbar container is not supported.

      +
      +
      + +
      +
      + + +
      + +
      + +
      + +

      More in this section

      + + +
      +
      + +
      + + + +
      + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/toolbars/footer-persist-a.html b/libs/js/jquery-mobile-1.1.0/docs/toolbars/footer-persist-a.html new file mode 100644 index 0000000..91b7f74 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/toolbars/footer-persist-a.html @@ -0,0 +1,114 @@ + + + + + + jQuery Mobile Framework - Persistent footer A + + + + + + + + + + +
      + +
      +

      Friends

      + Home + Search +
      + + + +
      +
      + +
      +
      + +
      + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/toolbars/footer-persist-b.html b/libs/js/jquery-mobile-1.1.0/docs/toolbars/footer-persist-b.html new file mode 100644 index 0000000..85fddb1 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/toolbars/footer-persist-b.html @@ -0,0 +1,140 @@ + + + + + + jQuery Mobile Framework - Persistent footer B + + + + + + + + + + + + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/toolbars/footer-persist-c.html b/libs/js/jquery-mobile-1.1.0/docs/toolbars/footer-persist-c.html new file mode 100644 index 0000000..3a11873 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/toolbars/footer-persist-c.html @@ -0,0 +1,121 @@ + + + + + + jQuery Mobile Framework - Persistent footer C + + + + + + + + + + +
      + +
      +

      Inbox

      + Home + Search +
      + +
      + + +
      + +
      + +

      More in this section

      + + +
      +
      + +
      + +
      +
      + +
      +
      + +
      + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/toolbars/footer-persist-d.html b/libs/js/jquery-mobile-1.1.0/docs/toolbars/footer-persist-d.html new file mode 100644 index 0000000..572b819 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/toolbars/footer-persist-d.html @@ -0,0 +1,92 @@ + + + + + + jQuery Mobile Framework - Persistent footer C + + + + + + + + + +
      + +
      +

      Info

      + Home + Search +
      + +
      +
      +

      About persistent toolbars

      +

      These pages are a demo of persistent toolbars. Click on any of the links in the footer, and you'll see the page content transition, but both the persistent header and footer on these pages remains in place durning the animation to a new HTML page.

      +

      To tell the framework to apply the persistent behavior, add a data-id attribute to the footer of all HTML pages in the navigation set to the same ID. It's that simple: if the page you're navigating to has a header or footer with the same data-id, the toolbars will appear fixed outside of the transition. Each of these pages has a different transition to test out how this works.

      + +

      Typically, the persistent toolbar technique will be combined with fixed positioning. In this example, the footer also has a navbar, like this:

      + +
      	
      +<div data-role="footer" data-id="foo1" data-position="fixed">
      +	<div data-role="navbar">
      +		<ul>
      +			<li><a href="a.html">Friends</a></li>
      +			<li><a href="b.html">Albums</a></li>
      +			<li><a href="c.html">Emails</a></li>
      +			<li><a href="d.html" >Info</a></li>
      +		</ul>
      +	</div><!-- /navbar -->
      +</div><!-- /footer -->
      +
      +

      To set the active state of an item in a persistent toolbar, add a class of ui-state-persist in addition to ui-btn-active to the corresponding anchor.

      + +
      	
      +<li><a href="d.html" class="ui-btn-active ui-state-persist">Info</a></li>
      +
      + +

      A note about transitions

      +

      The slide, slideup, slidedown, fade or none page transitions all work great with persistent fixed toolbars. However, intensive 3D transitions like flip, turn, and flow can cause positioning and animation performance issues with this technique so we don't recommend using them.

      + +
      + +
      + +
      + +

      More in this section

      + + +
      +
      + +
      + +
      +
      + +
      +
      + +
      + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/toolbars/glyphish-icons/09-chat2.png b/libs/js/jquery-mobile-1.1.0/docs/toolbars/glyphish-icons/09-chat2.png new file mode 100644 index 0000000..1ccc85f Binary files /dev/null and b/libs/js/jquery-mobile-1.1.0/docs/toolbars/glyphish-icons/09-chat2.png differ diff --git a/libs/js/jquery-mobile-1.1.0/docs/toolbars/glyphish-icons/100-coffee.png b/libs/js/jquery-mobile-1.1.0/docs/toolbars/glyphish-icons/100-coffee.png new file mode 100644 index 0000000..355cede Binary files /dev/null and b/libs/js/jquery-mobile-1.1.0/docs/toolbars/glyphish-icons/100-coffee.png differ diff --git a/libs/js/jquery-mobile-1.1.0/docs/toolbars/glyphish-icons/18-envelope.png b/libs/js/jquery-mobile-1.1.0/docs/toolbars/glyphish-icons/18-envelope.png new file mode 100644 index 0000000..11a8d1c Binary files /dev/null and b/libs/js/jquery-mobile-1.1.0/docs/toolbars/glyphish-icons/18-envelope.png differ diff --git a/libs/js/jquery-mobile-1.1.0/docs/toolbars/glyphish-icons/19-gear.png b/libs/js/jquery-mobile-1.1.0/docs/toolbars/glyphish-icons/19-gear.png new file mode 100644 index 0000000..d54828a Binary files /dev/null and b/libs/js/jquery-mobile-1.1.0/docs/toolbars/glyphish-icons/19-gear.png differ diff --git a/libs/js/jquery-mobile-1.1.0/docs/toolbars/glyphish-icons/21-skull.png b/libs/js/jquery-mobile-1.1.0/docs/toolbars/glyphish-icons/21-skull.png new file mode 100644 index 0000000..aeee693 Binary files /dev/null and b/libs/js/jquery-mobile-1.1.0/docs/toolbars/glyphish-icons/21-skull.png differ diff --git a/libs/js/jquery-mobile-1.1.0/docs/toolbars/glyphish-icons/30-key.png b/libs/js/jquery-mobile-1.1.0/docs/toolbars/glyphish-icons/30-key.png new file mode 100644 index 0000000..99a1f6b Binary files /dev/null and b/libs/js/jquery-mobile-1.1.0/docs/toolbars/glyphish-icons/30-key.png differ diff --git a/libs/js/jquery-mobile-1.1.0/docs/toolbars/glyphish-icons/34-coffee.png b/libs/js/jquery-mobile-1.1.0/docs/toolbars/glyphish-icons/34-coffee.png new file mode 100644 index 0000000..f9cd35f Binary files /dev/null and b/libs/js/jquery-mobile-1.1.0/docs/toolbars/glyphish-icons/34-coffee.png differ diff --git a/libs/js/jquery-mobile-1.1.0/docs/toolbars/glyphish-icons/88-beermug.png b/libs/js/jquery-mobile-1.1.0/docs/toolbars/glyphish-icons/88-beermug.png new file mode 100644 index 0000000..b338946 Binary files /dev/null and b/libs/js/jquery-mobile-1.1.0/docs/toolbars/glyphish-icons/88-beermug.png differ diff --git a/libs/js/jquery-mobile-1.1.0/docs/toolbars/glyphish-icons/Read me first - license.txt b/libs/js/jquery-mobile-1.1.0/docs/toolbars/glyphish-icons/Read me first - license.txt new file mode 100644 index 0000000..b6be14a --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/toolbars/glyphish-icons/Read me first - license.txt @@ -0,0 +1,13 @@ +Created by Joseph Wain (see http://penandthink.com) at and probably downloaded from http://glyphish.com + +This work is licensed under the Creative Commons Attribution 3.0 United States License. To view a copy of this license, visit http://creativecommons.org/licenses/by/3.0/us/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA. + +You are free to share it and to remix it remix under the following conditions: + +* You must attribute the work in the manner specified by the author (SEE BELOW). +* For any reuse or distribution, you must make clear to others the license terms of this work. +* The above conditions can be waived if you get permission from the copyright holder (send me an email!). + +ATTRIBUTION -- a note reading "icons by Joseph Wain / glyphish.com" or similar, plus a link back to glyphish.com from your app's website, is the preferred form of attribution. Also acceptable would be, like, a link from within your iPhone application, or from the iTunes store page, but those aren't as useful to other people. If none of these work for you, please contact hello@glyphish.com and we can work something out. + +USE WITHOUT ATTRIBUTION -- If attribution is not possible, workable or desirable for your application, contact hello@glyphish.com for commercial non-attributed licensing terms. \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/docs/toolbars/images/photo-run.jpeg b/libs/js/jquery-mobile-1.1.0/docs/toolbars/images/photo-run.jpeg new file mode 100644 index 0000000..182617f Binary files /dev/null and b/libs/js/jquery-mobile-1.1.0/docs/toolbars/images/photo-run.jpeg differ diff --git a/libs/js/jquery-mobile-1.1.0/docs/toolbars/index.html b/libs/js/jquery-mobile-1.1.0/docs/toolbars/index.html new file mode 100644 index 0000000..98f7432 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/docs/toolbars/index.html @@ -0,0 +1,45 @@ + + + + + + jQuery Mobile Docs - Toolbars + + + + + + + + + + +
      + +
      +

      Toolbars

      + Home + Search +
      + +
      + +

      Toolbars are used for headers, footers, and utility bars throughout mobile sites and applications. jQuery Mobile provides a standard set of bars and navigation tools to cover most standard scenarios.

      + + + + +
      +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/experiments/scrollview/index.html b/libs/js/jquery-mobile-1.1.0/experiments/scrollview/index.html new file mode 100644 index 0000000..cbf5f58 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/experiments/scrollview/index.html @@ -0,0 +1,67 @@ + + + + + + jQuery Mobile: Scrollview Demos and Tests + + + + + + + + + + + + + +
      +
      +

      jQuery Mobile Framework

      +

      A few examples tweaked to make use of the scrollview component.

      +

      Alpha Release

      +
      + + +
      + + diff --git a/libs/js/jquery-mobile-1.1.0/experiments/scrollview/jquery.easing.1.3.js b/libs/js/jquery-mobile-1.1.0/experiments/scrollview/jquery.easing.1.3.js new file mode 100644 index 0000000..ef74321 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/experiments/scrollview/jquery.easing.1.3.js @@ -0,0 +1,205 @@ +/* + * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ + * + * Uses the built in easing capabilities added In jQuery 1.1 + * to offer multiple easing options + * + * TERMS OF USE - jQuery Easing + * + * Open source under the BSD License. + * + * Copyright © 2008 George McGinley Smith + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * Neither the name of the author nor the names of contributors may be used to endorse + * or promote products derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * +*/ + +// t: current time, b: begInnIng value, c: change In value, d: duration +jQuery.easing['jswing'] = jQuery.easing['swing']; + +jQuery.extend( jQuery.easing, +{ + def: 'easeOutQuad', + swing: function (x, t, b, c, d) { + //alert(jQuery.easing.default); + return jQuery.easing[jQuery.easing.def](x, t, b, c, d); + }, + easeInQuad: function (x, t, b, c, d) { + return c*(t/=d)*t + b; + }, + easeOutQuad: function (x, t, b, c, d) { + return -c *(t/=d)*(t-2) + b; + }, + easeInOutQuad: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return c/2*t*t + b; + return -c/2 * ((--t)*(t-2) - 1) + b; + }, + easeInCubic: function (x, t, b, c, d) { + return c*(t/=d)*t*t + b; + }, + easeOutCubic: function (x, t, b, c, d) { + return c*((t=t/d-1)*t*t + 1) + b; + }, + easeInOutCubic: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return c/2*t*t*t + b; + return c/2*((t-=2)*t*t + 2) + b; + }, + easeInQuart: function (x, t, b, c, d) { + return c*(t/=d)*t*t*t + b; + }, + easeOutQuart: function (x, t, b, c, d) { + return -c * ((t=t/d-1)*t*t*t - 1) + b; + }, + easeInOutQuart: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return c/2*t*t*t*t + b; + return -c/2 * ((t-=2)*t*t*t - 2) + b; + }, + easeInQuint: function (x, t, b, c, d) { + return c*(t/=d)*t*t*t*t + b; + }, + easeOutQuint: function (x, t, b, c, d) { + return c*((t=t/d-1)*t*t*t*t + 1) + b; + }, + easeInOutQuint: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b; + return c/2*((t-=2)*t*t*t*t + 2) + b; + }, + easeInSine: function (x, t, b, c, d) { + return -c * Math.cos(t/d * (Math.PI/2)) + c + b; + }, + easeOutSine: function (x, t, b, c, d) { + return c * Math.sin(t/d * (Math.PI/2)) + b; + }, + easeInOutSine: function (x, t, b, c, d) { + return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b; + }, + easeInExpo: function (x, t, b, c, d) { + return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b; + }, + easeOutExpo: function (x, t, b, c, d) { + return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b; + }, + easeInOutExpo: function (x, t, b, c, d) { + if (t==0) return b; + if (t==d) return b+c; + if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b; + return c/2 * (-Math.pow(2, -10 * --t) + 2) + b; + }, + easeInCirc: function (x, t, b, c, d) { + return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b; + }, + easeOutCirc: function (x, t, b, c, d) { + return c * Math.sqrt(1 - (t=t/d-1)*t) + b; + }, + easeInOutCirc: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b; + return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b; + }, + easeInElastic: function (x, t, b, c, d) { + var s=1.70158;var p=0;var a=c; + if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; + if (a < Math.abs(c)) { a=c; var s=p/4; } + else var s = p/(2*Math.PI) * Math.asin (c/a); + return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; + }, + easeOutElastic: function (x, t, b, c, d) { + var s=1.70158;var p=0;var a=c; + if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; + if (a < Math.abs(c)) { a=c; var s=p/4; } + else var s = p/(2*Math.PI) * Math.asin (c/a); + return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; + }, + easeInOutElastic: function (x, t, b, c, d) { + var s=1.70158;var p=0;var a=c; + if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5); + if (a < Math.abs(c)) { a=c; var s=p/4; } + else var s = p/(2*Math.PI) * Math.asin (c/a); + if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; + return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b; + }, + easeInBack: function (x, t, b, c, d, s) { + if (s == undefined) s = 1.70158; + return c*(t/=d)*t*((s+1)*t - s) + b; + }, + easeOutBack: function (x, t, b, c, d, s) { + if (s == undefined) s = 1.70158; + return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; + }, + easeInOutBack: function (x, t, b, c, d, s) { + if (s == undefined) s = 1.70158; + if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; + return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; + }, + easeInBounce: function (x, t, b, c, d) { + return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b; + }, + easeOutBounce: function (x, t, b, c, d) { + if ((t/=d) < (1/2.75)) { + return c*(7.5625*t*t) + b; + } else if (t < (2/2.75)) { + return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; + } else if (t < (2.5/2.75)) { + return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; + } else { + return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; + } + }, + easeInOutBounce: function (x, t, b, c, d) { + if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b; + return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b; + } +}); + +/* + * + * TERMS OF USE - EASING EQUATIONS + * + * Open source under the BSD License. + * + * Copyright © 2001 Robert Penner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * Neither the name of the author nor the names of contributors may be used to endorse + * or promote products derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/experiments/scrollview/jquery.mobile.scrollview.css b/libs/js/jquery-mobile-1.1.0/experiments/scrollview/jquery.mobile.scrollview.css new file mode 100644 index 0000000..f7e0552 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/experiments/scrollview/jquery.mobile.scrollview.css @@ -0,0 +1,66 @@ +@charset "utf-8"; + +.ui-scrollview-clip { + position: relative; +} + +.ui-scrollview-view { +} + +.ui-scrolllistview .ui-li-divider { + z-index: 10; +} + +.ui-scrollbar { + position: absolute; + overflow: hidden; + + opacity: 0; + -webkit-transition: opacity 500ms; + -moz-transition: opacity 500ms; + transition: opacity 500ms; +} + +.ui-scrollbar-visible { + opacity: 1; +} + +.ui-scrollbar-y { + top: 2px; + right: 2px; + bottom: 8px; + width: 5px; +} + +.ui-scrollbar-x { + right: 8px; + bottom: 2px; + left: 2px; + height: 5px; +} + +.ui-scrollbar-track { + position: relative; + width: 100%; + height: 100%; +} + +.ui-scrollbar-thumb { + position: absolute; + top: 0; + left: 0; + background-color: rgba(0, 0, 0, 0.3); + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + border-radius: 2px; +} + +.ui-scrollbar-y .ui-scrollbar-thumb { + width: 5px; + height: 100%; +} + +.ui-scrollbar-x .ui-scrollbar-thumb { + width: 100%; + height: 5px; +} diff --git a/libs/js/jquery-mobile-1.1.0/experiments/scrollview/jquery.mobile.scrollview.js b/libs/js/jquery-mobile-1.1.0/experiments/scrollview/jquery.mobile.scrollview.js new file mode 100644 index 0000000..b190c70 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/experiments/scrollview/jquery.mobile.scrollview.js @@ -0,0 +1,802 @@ +/* +* jQuery Mobile Framework : scrollview plugin +* Copyright (c) 2010 Adobe Systems Incorporated - Kin Blas (jblas@adobe.com) +* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. +* Note: Code is in draft form and is subject to change +*/ +(function($,window,document,undefined){ + +jQuery.widget( "mobile.scrollview", jQuery.mobile.widget, { + options: { + fps: 60, // Frames per second in msecs. + direction: null, // "x", "y", or null for both. + + scrollDuration: 2000, // Duration of the scrolling animation in msecs. + overshootDuration: 250, // Duration of the overshoot animation in msecs. + snapbackDuration: 500, // Duration of the snapback animation in msecs. + + moveThreshold: 10, // User must move this many pixels in any direction to trigger a scroll. + moveIntervalThreshold: 150, // Time between mousemoves must not exceed this threshold. + + scrollMethod: "translate", // "translate", "position", "scroll" + + startEventName: "scrollstart", + updateEventName: "scrollupdate", + stopEventName: "scrollstop", + + eventType: $.support.touch ? "touch" : "mouse", + + showScrollBars: true, + + pagingEnabled: false, + delayedClickSelector: "a,input,textarea,select,button,.ui-btn", + delayedClickEnabled: false + }, + + _makePositioned: function($ele) + { + if ($ele.css("position") == "static") + $ele.css("position", "relative"); + }, + + _create: function() + { + this._$clip = $(this.element).addClass("ui-scrollview-clip"); + var $child = this._$clip.children(); + if ($child.length > 1) { + $child = this._$clip.wrapInner("
      ").children(); + } + this._$view = $child.addClass("ui-scrollview-view"); + + this._$clip.css("overflow", this.options.scrollMethod === "scroll" ? "scroll" : "hidden"); + this._makePositioned(this._$clip); + + this._$view.css("overflow", "hidden"); + + // Turn off our faux scrollbars if we are using native scrolling + // to position the view. + + this.options.showScrollBars = this.options.scrollMethod === "scroll" ? false : this.options.showScrollBars; + + // We really don't need this if we are using a translate transformation + // for scrolling. We set it just in case the user wants to switch methods + // on the fly. + + this._makePositioned(this._$view); + this._$view.css({ left: 0, top: 0 }); + + this._sx = 0; + this._sy = 0; + + var direction = this.options.direction; + this._hTracker = (direction !== "y") ? new MomentumTracker(this.options) : null; + this._vTracker = (direction !== "x") ? new MomentumTracker(this.options) : null; + + this._timerInterval = 1000/this.options.fps; + this._timerID = 0; + + var self = this; + this._timerCB = function(){ self._handleMomentumScroll(); }; + + this._addBehaviors(); + }, + + _startMScroll: function(speedX, speedY) + { + this._stopMScroll(); + this._showScrollBars(); + + var keepGoing = false; + var duration = this.options.scrollDuration; + + this._$clip.trigger(this.options.startEventName); + + var ht = this._hTracker; + if (ht) + { + var c = this._$clip.width(); + var v = this._$view.width(); + ht.start(this._sx, speedX, duration, (v > c) ? -(v - c) : 0, 0); + keepGoing = !ht.done(); + } + + var vt = this._vTracker; + if (vt) + { + var c = this._$clip.height(); + var v = this._$view.height(); + vt.start(this._sy, speedY, duration, (v > c) ? -(v - c) : 0, 0); + keepGoing = keepGoing || !vt.done(); + } + + if (keepGoing) + this._timerID = setTimeout(this._timerCB, this._timerInterval); + else + this._stopMScroll(); + }, + + _stopMScroll: function() + { + if (this._timerID) + { + this._$clip.trigger(this.options.stopEventName); + clearTimeout(this._timerID); + } + this._timerID = 0; + + if (this._vTracker) + this._vTracker.reset(); + + if (this._hTracker) + this._hTracker.reset(); + + this._hideScrollBars(); + }, + + _handleMomentumScroll: function() + { + var keepGoing = false; + var v = this._$view; + + var x = 0, y = 0; + + var vt = this._vTracker; + if (vt) + { + vt.update(); + y = vt.getPosition(); + keepGoing = !vt.done(); + } + + var ht = this._hTracker; + if (ht) + { + ht.update(); + x = ht.getPosition(); + keepGoing = keepGoing || !ht.done(); + } + + this._setScrollPosition(x, y); + this._$clip.trigger(this.options.updateEventName, [ { x: x, y: y } ]); + + if (keepGoing) + this._timerID = setTimeout(this._timerCB, this._timerInterval); + else + this._stopMScroll(); + }, + + _setScrollPosition: function(x, y) + { + this._sx = x; + this._sy = y; + + var $v = this._$view; + + var sm = this.options.scrollMethod; + + switch (sm) + { + case "translate": + setElementTransform($v, x + "px", y + "px"); + break; + case "position": + $v.css({left: x + "px", top: y + "px"}); + break; + case "scroll": + var c = this._$clip[0]; + c.scrollLeft = -x; + c.scrollTop = -y; + break; + } + + var $vsb = this._$vScrollBar; + var $hsb = this._$hScrollBar; + + if ($vsb) + { + var $sbt = $vsb.find(".ui-scrollbar-thumb"); + if (sm === "translate") + setElementTransform($sbt, "0px", -y/$v.height() * $sbt.parent().height() + "px"); + else + $sbt.css("top", -y/$v.height()*100 + "%"); + } + + if ($hsb) + { + var $sbt = $hsb.find(".ui-scrollbar-thumb"); + if (sm === "translate") + setElementTransform($sbt, -x/$v.width() * $sbt.parent().width() + "px", "0px"); + else + $sbt.css("left", -x/$v.width()*100 + "%"); + } + }, + + scrollTo: function(x, y, duration) + { + this._stopMScroll(); + if (!duration) + return this._setScrollPosition(x, y); + + x = -x; + y = -y; + + var self = this; + var start = getCurrentTime(); + var efunc = $.easing["easeOutQuad"]; + var sx = this._sx; + var sy = this._sy; + var dx = x - sx; + var dy = y - sy; + var tfunc = function(){ + var elapsed = getCurrentTime() - start; + if (elapsed >= duration) + { + self._timerID = 0; + self._setScrollPosition(x, y); + } + else + { + var ec = efunc(elapsed/duration, elapsed, 0, 1, duration); + self._setScrollPosition(sx + (dx * ec), sy + (dy * ec)); + self._timerID = setTimeout(tfunc, self._timerInterval); + } + }; + + this._timerID = setTimeout(tfunc, this._timerInterval); + }, + + getScrollPosition: function() + { + return { x: -this._sx, y: -this._sy }; + }, + + _getScrollHierarchy: function() + { + var svh = []; + this._$clip.parents(".ui-scrollview-clip").each(function(){ + var d = $(this).jqmData("scrollview"); + if (d) svh.unshift(d); + }); + return svh; + }, + + _getAncestorByDirection: function(dir) + { + var svh = this._getScrollHierarchy(); + var n = svh.length; + while (0 < n--) + { + var sv = svh[n]; + var svdir = sv.options.direction; + + if (!svdir || svdir == dir) + return sv; + } + return null; + }, + + _handleDragStart: function(e, ex, ey) + { + // Stop any scrolling of elements in our parent hierarcy. + $.each(this._getScrollHierarchy(),function(i,sv){ sv._stopMScroll(); }); + this._stopMScroll(); + + var c = this._$clip; + var v = this._$view; + + if (this.options.delayedClickEnabled) { + this._$clickEle = $(e.target).closest(this.options.delayedClickSelector); + } + this._lastX = ex; + this._lastY = ey; + this._doSnapBackX = false; + this._doSnapBackY = false; + this._speedX = 0; + this._speedY = 0; + this._directionLock = ""; + this._didDrag = false; + + if (this._hTracker) + { + var cw = parseInt(c.css("width"), 10); + var vw = parseInt(v.css("width"), 10); + this._maxX = cw - vw; + if (this._maxX > 0) this._maxX = 0; + if (this._$hScrollBar) + this._$hScrollBar.find(".ui-scrollbar-thumb").css("width", (cw >= vw ? "100%" : Math.floor(cw/vw*100)+ "%")); + } + + if (this._vTracker) + { + var ch = parseInt(c.css("height"), 10); + var vh = parseInt(v.css("height"), 10); + this._maxY = ch - vh; + if (this._maxY > 0) this._maxY = 0; + if (this._$vScrollBar) + this._$vScrollBar.find(".ui-scrollbar-thumb").css("height", (ch >= vh ? "100%" : Math.floor(ch/vh*100)+ "%")); + } + + var svdir = this.options.direction; + + this._pageDelta = 0; + this._pageSize = 0; + this._pagePos = 0; + + if (this.options.pagingEnabled && (svdir === "x" || svdir === "y")) + { + this._pageSize = svdir === "x" ? cw : ch; + this._pagePos = svdir === "x" ? this._sx : this._sy; + this._pagePos -= this._pagePos % this._pageSize; + } + this._lastMove = 0; + this._enableTracking(); + + // If we're using mouse events, we need to prevent the default + // behavior to suppress accidental selection of text, etc. We + // can't do this on touch devices because it will disable the + // generation of "click" events. + // + // XXX: We should test if this has an effect on links! - kin + + if (this.options.eventType == "mouse" || this.options.delayedClickEnabled) + e.preventDefault(); + e.stopPropagation(); + }, + + _propagateDragMove: function(sv, e, ex, ey, dir) + { + this._hideScrollBars(); + this._disableTracking(); + sv._handleDragStart(e,ex,ey); + sv._directionLock = dir; + sv._didDrag = this._didDrag; + }, + + _handleDragMove: function(e, ex, ey) + { + this._lastMove = getCurrentTime(); + + var v = this._$view; + + var dx = ex - this._lastX; + var dy = ey - this._lastY; + var svdir = this.options.direction; + + if (!this._directionLock) + { + var x = Math.abs(dx); + var y = Math.abs(dy); + var mt = this.options.moveThreshold; + + if (x < mt && y < mt) { + return false; + } + + var dir = null; + var r = 0; + if (x < y && (x/y) < 0.5) { + dir = "y"; + } + else if (x > y && (y/x) < 0.5) { + dir = "x"; + } + + if (svdir && dir && svdir != dir) + { + // This scrollview can't handle the direction the user + // is attempting to scroll. Find an ancestor scrollview + // that can handle the request. + + var sv = this._getAncestorByDirection(dir); + if (sv) + { + this._propagateDragMove(sv, e, ex, ey, dir); + return false; + } + } + + this._directionLock = svdir ? svdir : (dir ? dir : "none"); + } + + var newX = this._sx; + var newY = this._sy; + + if (this._directionLock !== "y" && this._hTracker) + { + var x = this._sx; + this._speedX = dx; + newX = x + dx; + + // Simulate resistance. + + this._doSnapBackX = false; + if (newX > 0 || newX < this._maxX) + { + if (this._directionLock === "x") + { + var sv = this._getAncestorByDirection("x"); + if (sv) + { + this._setScrollPosition(newX > 0 ? 0 : this._maxX, newY); + this._propagateDragMove(sv, e, ex, ey, dir); + return false; + } + } + newX = x + (dx/2); + this._doSnapBackX = true; + } + } + + if (this._directionLock !== "x" && this._vTracker) + { + var y = this._sy; + this._speedY = dy; + newY = y + dy; + + // Simulate resistance. + + this._doSnapBackY = false; + if (newY > 0 || newY < this._maxY) + { + if (this._directionLock === "y") + { + var sv = this._getAncestorByDirection("y"); + if (sv) + { + this._setScrollPosition(newX, newY > 0 ? 0 : this._maxY); + this._propagateDragMove(sv, e, ex, ey, dir); + return false; + } + } + + newY = y + (dy/2); + this._doSnapBackY = true; + } + + } + + if (this.options.pagingEnabled && (svdir === "x" || svdir === "y")) + { + if (this._doSnapBackX || this._doSnapBackY) + this._pageDelta = 0; + else + { + var opos = this._pagePos; + var cpos = svdir === "x" ? newX : newY; + var delta = svdir === "x" ? dx : dy; + + this._pageDelta = (opos > cpos && delta < 0) ? this._pageSize : ((opos < cpos && delta > 0) ? -this._pageSize : 0); + } + } + + this._didDrag = true; + this._lastX = ex; + this._lastY = ey; + + this._setScrollPosition(newX, newY); + + this._showScrollBars(); + + // Call preventDefault() to prevent touch devices from + // scrolling the main window. + + // e.preventDefault(); + + return false; + }, + + _handleDragStop: function(e) + { + var l = this._lastMove; + var t = getCurrentTime(); + var doScroll = l && (t - l) <= this.options.moveIntervalThreshold; + + var sx = (this._hTracker && this._speedX && doScroll) ? this._speedX : (this._doSnapBackX ? 1 : 0); + var sy = (this._vTracker && this._speedY && doScroll) ? this._speedY : (this._doSnapBackY ? 1 : 0); + + var svdir = this.options.direction; + if (this.options.pagingEnabled && (svdir === "x" || svdir === "y") && !this._doSnapBackX && !this._doSnapBackY) + { + var x = this._sx; + var y = this._sy; + if (svdir === "x") + x = -this._pagePos + this._pageDelta; + else + y = -this._pagePos + this._pageDelta; + + this.scrollTo(x, y, this.options.snapbackDuration); + } + else if (sx || sy) + this._startMScroll(sx, sy); + else + this._hideScrollBars(); + + this._disableTracking(); + + if (!this._didDrag && this.options.delayedClickEnabled && this._$clickEle.length) { + this._$clickEle + .trigger("mousedown") + //.trigger("focus") + .trigger("mouseup") + .trigger("click"); + } + + // If a view scrolled, then we need to absorb + // the event so that links etc, underneath our + // cursor/finger don't fire. + + return this._didDrag ? false : undefined; + }, + + _enableTracking: function() + { + $(document).bind(this._dragMoveEvt, this._dragMoveCB); + $(document).bind(this._dragStopEvt, this._dragStopCB); + }, + + _disableTracking: function() + { + $(document).unbind(this._dragMoveEvt, this._dragMoveCB); + $(document).unbind(this._dragStopEvt, this._dragStopCB); + }, + + _showScrollBars: function() + { + var vclass = "ui-scrollbar-visible"; + if (this._$vScrollBar) this._$vScrollBar.addClass(vclass); + if (this._$hScrollBar) this._$hScrollBar.addClass(vclass); + }, + + _hideScrollBars: function() + { + var vclass = "ui-scrollbar-visible"; + if (this._$vScrollBar) this._$vScrollBar.removeClass(vclass); + if (this._$hScrollBar) this._$hScrollBar.removeClass(vclass); + }, + + _addBehaviors: function() + { + var self = this; + if (this.options.eventType === "mouse") + { + this._dragStartEvt = "mousedown"; + this._dragStartCB = function(e){ return self._handleDragStart(e, e.clientX, e.clientY); }; + + this._dragMoveEvt = "mousemove"; + this._dragMoveCB = function(e){ return self._handleDragMove(e, e.clientX, e.clientY); }; + + this._dragStopEvt = "mouseup"; + this._dragStopCB = function(e){ return self._handleDragStop(e); }; + } + else // "touch" + { + this._dragStartEvt = "touchstart"; + this._dragStartCB = function(e) + { + var t = e.originalEvent.targetTouches[0]; + return self._handleDragStart(e, t.pageX, t.pageY); + }; + + this._dragMoveEvt = "touchmove"; + this._dragMoveCB = function(e) + { + var t = e.originalEvent.targetTouches[0]; + return self._handleDragMove(e, t.pageX, t.pageY); + }; + + this._dragStopEvt = "touchend"; + this._dragStopCB = function(e){ return self._handleDragStop(e); }; + } + + this._$view.bind(this._dragStartEvt, this._dragStartCB); + + if (this.options.showScrollBars) + { + var $c = this._$clip; + var prefix = "
      "; + if (this._vTracker) + { + $c.append(prefix + "y" + suffix); + this._$vScrollBar = $c.children(".ui-scrollbar-y"); + } + if (this._hTracker) + { + $c.append(prefix + "x" + suffix); + this._$hScrollBar = $c.children(".ui-scrollbar-x"); + } + } + } +}); + +function setElementTransform($ele, x, y) +{ + var v = "translate3d(" + x + "," + y + ", 0px)"; + $ele.css({ + "-moz-transform": v, + "-webkit-transform": v, + "transform": v + }); +} + + +function MomentumTracker(options) +{ + this.options = $.extend({}, options); + this.easing = "easeOutQuad"; + this.reset(); +} + +var tstates = { + scrolling: 0, + overshot: 1, + snapback: 2, + done: 3 +}; + +function getCurrentTime() { return (new Date()).getTime(); } + +$.extend(MomentumTracker.prototype, { + start: function(pos, speed, duration, minPos, maxPos) + { + this.state = (speed != 0) ? ((pos < minPos || pos > maxPos) ? tstates.snapback : tstates.scrolling) : tstates.done; + this.pos = pos; + this.speed = speed; + this.duration = (this.state == tstates.snapback) ? this.options.snapbackDuration : duration; + this.minPos = minPos; + this.maxPos = maxPos; + + this.fromPos = (this.state == tstates.snapback) ? this.pos : 0; + this.toPos = (this.state == tstates.snapback) ? ((this.pos < this.minPos) ? this.minPos : this.maxPos) : 0; + + this.startTime = getCurrentTime(); + }, + + reset: function() + { + this.state = tstates.done; + this.pos = 0; + this.speed = 0; + this.minPos = 0; + this.maxPos = 0; + this.duration = 0; + }, + + update: function() + { + var state = this.state; + if (state == tstates.done) + return this.pos; + + var duration = this.duration; + var elapsed = getCurrentTime() - this.startTime; + elapsed = elapsed > duration ? duration : elapsed; + + if (state == tstates.scrolling || state == tstates.overshot) + { + var dx = this.speed * (1 - $.easing[this.easing](elapsed/duration, elapsed, 0, 1, duration)); + + var x = this.pos + dx; + + var didOverShoot = (state == tstates.scrolling) && (x < this.minPos || x > this.maxPos); + if (didOverShoot) + x = (x < this.minPos) ? this.minPos : this.maxPos; + + this.pos = x; + + if (state == tstates.overshot) + { + if (elapsed >= duration) + { + this.state = tstates.snapback; + this.fromPos = this.pos; + this.toPos = (x < this.minPos) ? this.minPos : this.maxPos; + this.duration = this.options.snapbackDuration; + this.startTime = getCurrentTime(); + elapsed = 0; + } + } + else if (state == tstates.scrolling) + { + if (didOverShoot) + { + this.state = tstates.overshot; + this.speed = dx / 2; + this.duration = this.options.overshootDuration; + this.startTime = getCurrentTime(); + } + else if (elapsed >= duration) + this.state = tstates.done; + } + } + else if (state == tstates.snapback) + { + if (elapsed >= duration) + { + this.pos = this.toPos; + this.state = tstates.done; + } + else + this.pos = this.fromPos + ((this.toPos - this.fromPos) * $.easing[this.easing](elapsed/duration, elapsed, 0, 1, duration)); + } + + return this.pos; + }, + + done: function() { return this.state == tstates.done; }, + getPosition: function(){ return this.pos; } +}); + +jQuery.widget( "mobile.scrolllistview", jQuery.mobile.scrollview, { + options: { + direction: "y" + }, + + _create: function() { + $.mobile.scrollview.prototype._create.call(this); + + // Cache the dividers so we don't have to search for them everytime the + // view is scrolled. + // + // XXX: Note that we need to update this cache if we ever support lists + // that can dynamically update their content. + + this._$dividers = this._$view.find(":jqmData(role='list-divider')"); + this._lastDivider = null; + }, + + _setScrollPosition: function(x, y) + { + // Let the view scroll like it normally does. + + $.mobile.scrollview.prototype._setScrollPosition.call(this, x, y); + + y = -y; + + // Find the dividers for the list. + + var $divs = this._$dividers; + var cnt = $divs.length; + var d = null; + var dy = 0; + var nd = null; + + for (var i = 0; i < cnt; i++) + { + nd = $divs.get(i); + var t = nd.offsetTop; + if (y >= t) + { + d = nd; + dy = t; + } + else if (d) + break; + } + + // If we found a divider to move position it at the top of the + // clip view. + + if (d) + { + var h = d.offsetHeight; + var mxy = (d != nd) ? nd.offsetTop : (this._$view.get(0).offsetHeight); + if (y + h >= mxy) + y = (mxy - h) - dy; + else + y = y - dy; + + // XXX: Need to convert this over to using $().css() and supporting the non-transform case. + + var ld = this._lastDivider; + if (ld && d != ld) { + setElementTransform($(ld), 0, 0); + } + setElementTransform($(d), 0, y + "px"); + this._lastDivider = d; + + } + } +}); + +})(jQuery,window,document); // End Component diff --git a/libs/js/jquery-mobile-1.1.0/experiments/scrollview/lists-divider.html b/libs/js/jquery-mobile-1.1.0/experiments/scrollview/lists-divider.html new file mode 100644 index 0000000..636e6ff --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/experiments/scrollview/lists-divider.html @@ -0,0 +1,152 @@ + + + + + + jQuery Mobile Docs - Lists + + + + + + + + + + + + + +
      + +
      +

      List dividers

      +
      + + +
      + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/experiments/scrollview/scrollview-direction.html b/libs/js/jquery-mobile-1.1.0/experiments/scrollview/scrollview-direction.html new file mode 100644 index 0000000..505f3be --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/experiments/scrollview/scrollview-direction.html @@ -0,0 +1,779 @@ + + + + + + jQuery Mobile Docs - Lists + + + + + + + + + + + + + +
      + +
      +

      Scroll View Direction Locking

      +
      + +
      +

      Scrollview

      +

      To turn an element into a scrollview, simply add a data-scroll="true" to the element. By default, a scrollview can scroll in both the horizontal and vertical directions. If the user drags the view horizontally (left or right), or vertically (up or down), scrolling will be locked so that it only scrolls in that one dimension. If the user drags the view diagonally, he will be able to scroll in both directions at the same time.

      +
      +
      a
      +
      b
      +
      c
      +
      d
      +
      e
      +
      f
      +
      g
      +
      h
      +
      i
      +
      j
      +
      k
      +
      l
      +
      m
      +
      n
      +
      o
      +
      p
      +
      q
      +
      r
      +
      s
      +
      t
      +
      u
      +
      v
      +
      w
      +
      x
      +
      y
      +
      z
      +
      0
      +
      1
      +
      2
      +
      3
      +
      4
      +
      5
      +
      6
      +
      7
      +
      8
      +
      9
      +
      a
      +
      b
      +
      c
      +
      d
      +
      e
      +
      f
      +
      g
      +
      h
      +
      i
      +
      j
      +
      k
      +
      l
      +
      m
      +
      n
      +
      o
      +
      p
      +
      q
      +
      r
      +
      s
      +
      t
      +
      u
      +
      v
      +
      w
      +
      x
      +
      y
      +
      z
      +
      0
      +
      1
      +
      2
      +
      3
      +
      4
      +
      5
      +
      6
      +
      7
      +
      8
      +
      9
      +
      a
      +
      b
      +
      c
      +
      d
      +
      e
      +
      f
      +
      g
      +
      h
      +
      i
      +
      j
      +
      k
      +
      l
      +
      m
      +
      n
      +
      o
      +
      p
      +
      q
      +
      r
      +
      s
      +
      t
      +
      u
      +
      v
      +
      w
      +
      x
      +
      y
      +
      z
      +
      0
      +
      1
      +
      2
      +
      3
      +
      4
      +
      5
      +
      6
      +
      7
      +
      8
      +
      9
      +
      a
      +
      b
      +
      c
      +
      d
      +
      e
      +
      f
      +
      g
      +
      h
      +
      i
      +
      j
      +
      k
      +
      l
      +
      m
      +
      n
      +
      o
      +
      p
      +
      q
      +
      r
      +
      s
      +
      t
      +
      u
      +
      v
      +
      w
      +
      x
      +
      y
      +
      z
      +
      0
      +
      1
      +
      2
      +
      3
      +
      4
      +
      5
      +
      6
      +
      7
      +
      8
      +
      9
      +
      a
      +
      b
      +
      c
      +
      d
      +
      e
      +
      f
      +
      g
      +
      h
      +
      i
      +
      j
      +
      k
      +
      l
      +
      m
      +
      n
      +
      o
      +
      p
      +
      q
      +
      r
      +
      s
      +
      t
      +
      u
      +
      v
      +
      w
      +
      x
      +
      y
      +
      +

      When there are nested scrollviews, if the user drags in a single dimension and hits either end of the view, the drag will be propagated up to the next outer scrollview that can handle a drag in that dimension. So for example, if you drag the scrollview above so that it reaches the top of its view, the entire page will start to scroll upward if you continue dragging. This is because the drag was propagated from the scrollview with the letters in it, out to the scrollview containing the entire content for the page.

      +

      Horizontal Scrollview

      +

      A scrollview can be set up so that it only scrolls in the horizontal direction. Simply place a data-scroll="x" on the element you want to scroll:

      +
      +
      a
      +
      b
      +
      c
      +
      d
      +
      e
      +
      f
      +
      g
      +
      h
      +
      i
      +
      j
      +
      k
      +
      l
      +
      m
      +
      n
      +
      o
      +
      p
      +
      q
      +
      r
      +
      s
      +
      t
      +
      u
      +
      v
      +
      w
      +
      x
      +
      y
      +
      z
      +
      0
      +
      1
      +
      2
      +
      3
      +
      4
      +
      5
      +
      6
      +
      7
      +
      8
      +
      9
      +
      a
      +
      b
      +
      c
      +
      d
      +
      e
      +
      f
      +
      g
      +
      h
      +
      i
      +
      j
      +
      k
      +
      l
      +
      m
      +
      n
      +
      o
      +
      p
      +
      q
      +
      r
      +
      s
      +
      t
      +
      u
      +
      v
      +
      w
      +
      x
      +
      y
      +
      z
      +
      0
      +
      1
      +
      2
      +
      3
      +
      4
      +
      5
      +
      6
      +
      7
      +
      8
      +
      9
      +
      a
      +
      b
      +
      c
      +
      d
      +
      e
      +
      f
      +
      g
      +
      h
      +
      i
      +
      j
      +
      k
      +
      l
      +
      m
      +
      n
      +
      o
      +
      p
      +
      q
      +
      r
      +
      s
      +
      t
      +
      u
      +
      v
      +
      w
      +
      x
      +
      y
      +
      z
      +
      0
      +
      1
      +
      2
      +
      3
      +
      4
      +
      5
      +
      6
      +
      7
      +
      8
      +
      9
      +
      a
      +
      b
      +
      c
      +
      d
      +
      e
      +
      f
      +
      g
      +
      h
      +
      i
      +
      j
      +
      k
      +
      l
      +
      m
      +
      n
      +
      o
      +
      p
      +
      q
      +
      r
      +
      s
      +
      t
      +
      u
      +
      v
      +
      w
      +
      x
      +
      y
      +
      z
      +
      0
      +
      1
      +
      2
      +
      3
      +
      4
      +
      5
      +
      6
      +
      7
      +
      8
      +
      9
      +
      a
      +
      b
      +
      c
      +
      d
      +
      e
      +
      f
      +
      g
      +
      h
      +
      i
      +
      j
      +
      k
      +
      l
      +
      m
      +
      n
      +
      o
      +
      p
      +
      q
      +
      r
      +
      s
      +
      t
      +
      u
      +
      v
      +
      w
      +
      x
      +
      y
      +
      +

      Vertical Scrollview

      +

      A scrollview can be set up so that it only scrolls in the vertical direction. Simply place a data-scroll="y" on the element you want to scroll:

      +
      +
      a
      +
      b
      +
      c
      +
      d
      +
      e
      +
      f
      +
      g
      +
      h
      +
      i
      +
      j
      +
      k
      +
      l
      +
      m
      +
      n
      +
      o
      +
      p
      +
      q
      +
      r
      +
      s
      +
      t
      +
      u
      +
      v
      +
      w
      +
      x
      +
      y
      +
      z
      +
      0
      +
      1
      +
      2
      +
      3
      +
      4
      +
      5
      +
      6
      +
      7
      +
      8
      +
      9
      +
      a
      +
      b
      +
      c
      +
      d
      +
      e
      +
      f
      +
      g
      +
      h
      +
      i
      +
      j
      +
      k
      +
      l
      +
      m
      +
      n
      +
      o
      +
      p
      +
      q
      +
      r
      +
      s
      +
      t
      +
      u
      +
      v
      +
      w
      +
      x
      +
      y
      +
      z
      +
      0
      +
      1
      +
      2
      +
      3
      +
      4
      +
      5
      +
      6
      +
      7
      +
      8
      +
      9
      +
      a
      +
      b
      +
      c
      +
      d
      +
      e
      +
      f
      +
      g
      +
      h
      +
      i
      +
      j
      +
      k
      +
      l
      +
      m
      +
      n
      +
      o
      +
      p
      +
      q
      +
      r
      +
      s
      +
      t
      +
      u
      +
      v
      +
      w
      +
      x
      +
      y
      +
      z
      +
      0
      +
      1
      +
      2
      +
      3
      +
      4
      +
      5
      +
      6
      +
      7
      +
      8
      +
      9
      +
      a
      +
      b
      +
      c
      +
      d
      +
      e
      +
      f
      +
      g
      +
      h
      +
      i
      +
      j
      +
      k
      +
      l
      +
      m
      +
      n
      +
      o
      +
      p
      +
      q
      +
      r
      +
      s
      +
      t
      +
      u
      +
      v
      +
      w
      +
      x
      +
      y
      +
      z
      +
      0
      +
      1
      +
      2
      +
      3
      +
      4
      +
      5
      +
      6
      +
      7
      +
      8
      +
      9
      +
      a
      +
      b
      +
      c
      +
      d
      +
      e
      +
      f
      +
      g
      +
      h
      +
      i
      +
      j
      +
      k
      +
      l
      +
      m
      +
      n
      +
      o
      +
      p
      +
      q
      +
      r
      +
      s
      +
      t
      +
      u
      +
      v
      +
      w
      +
      x
      +
      y
      +
      +

      Scrollview Paging

      +

      A scrollview can be set up so that it scrolls by pages. This feature is only enabled for horizontal or vertical scrollviews. Use data-scroll="xp" or data-scroll="yp" to turn on paging. The following scrollview pages horizontally.

      +
      +
      a
      +
      b
      +
      c
      +
      d
      +
      e
      +
      f
      +
      g
      +
      h
      +
      i
      +
      j
      +
      k
      +
      l
      +
      m
      +
      n
      +
      o
      +
      p
      +
      q
      +
      r
      +
      s
      +
      t
      +
      u
      +
      v
      +
      w
      +
      x
      +
      y
      +
      z
      +
      0
      +
      1
      +
      2
      +
      3
      +
      4
      +
      5
      +
      6
      +
      7
      +
      8
      +
      9
      +
      a
      +
      b
      +
      c
      +
      d
      +
      e
      +
      f
      +
      g
      +
      h
      +
      i
      +
      j
      +
      k
      +
      l
      +
      m
      +
      n
      +
      o
      +
      p
      +
      q
      +
      r
      +
      s
      +
      t
      +
      u
      +
      v
      +
      w
      +
      x
      +
      y
      +
      z
      +
      0
      +
      1
      +
      2
      +
      3
      +
      4
      +
      5
      +
      6
      +
      7
      +
      8
      +
      9
      +
      a
      +
      b
      +
      c
      +
      d
      +
      e
      +
      f
      +
      g
      +
      h
      +
      i
      +
      j
      +
      k
      +
      l
      +
      m
      +
      n
      +
      o
      +
      p
      +
      q
      +
      r
      +
      s
      +
      t
      +
      u
      +
      v
      +
      w
      +
      x
      +
      y
      +
      z
      +
      0
      +
      1
      +
      2
      +
      3
      +
      4
      +
      5
      +
      6
      +
      7
      +
      8
      +
      9
      +
      a
      +
      b
      +
      c
      +
      d
      +
      e
      +
      f
      +
      g
      +
      h
      +
      i
      +
      j
      +
      k
      +
      l
      +
      m
      +
      n
      +
      o
      +
      p
      +
      q
      +
      r
      +
      s
      +
      t
      +
      u
      +
      v
      +
      w
      +
      x
      +
      y
      +
      z
      +
      0
      +
      1
      +
      2
      +
      3
      +
      4
      +
      5
      +
      6
      +
      7
      +
      8
      +
      9
      +
      a
      +
      b
      +
      c
      +
      d
      +
      e
      +
      f
      +
      g
      +
      h
      +
      i
      +
      j
      +
      k
      +
      l
      +
      m
      +
      n
      +
      o
      +
      p
      +
      q
      +
      r
      +
      s
      +
      t
      +
      u
      +
      v
      +
      w
      +
      x
      +
      y
      +
      +

      Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

      +

      Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

      +

      Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

      +

       

      +

      +
      +
      + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/experiments/scrollview/scrollview-nested.html b/libs/js/jquery-mobile-1.1.0/experiments/scrollview/scrollview-nested.html new file mode 100644 index 0000000..e4107c7 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/experiments/scrollview/scrollview-nested.html @@ -0,0 +1,166 @@ + + + + + + jQuery Mobile Docs - Lists + + + + + + + + + + + + + +
      + +
      +

      Nested Scrollviews

      +
      + +
      +

      Example 1

      +

      In the following example the #4 is actually a vertical scrollview embedded within a horizontal scrollview.

      +
      +
      +
      1
      +
      2
      +
      3
      +
      +
      +
      4
      +
      A
      +
      B
      +
      +
      +
      C
      +
      @
      +
      #
      +
      $
      +
      %
      +
      &
      +
      *
      +
      +
      +
      D
      +
      E
      +
      F
      +
      +
      +
      5
      +
      6
      +
      7
      +
      +
      +

      Example 2

      +

      In the following example the #4 is actually a nested horizontal scrollview embedded within a horizontal scrollview. The idea here is that if you drag-scroll the nested scrollview, once it reaches either end of its view, it should start scrolling the outer view.

      +
      +
      +
      1
      +
      2
      +
      3
      +
      +
      +
      4
      +
      A
      +
      B
      +
      C
      +
      D
      +
      E
      +
      F
      +
      +
      +
      5
      +
      6
      +
      7
      +
      +
      +

      Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

      +

      Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

      +

      Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

      +

       

      +

      +
      +
      + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/experiments/scrollview/scrollview.js b/libs/js/jquery-mobile-1.1.0/experiments/scrollview/scrollview.js new file mode 100644 index 0000000..cac968e --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/experiments/scrollview/scrollview.js @@ -0,0 +1,55 @@ +function ResizePageContentHeight(page) { + var $page = $(page), + $content = $page.children( ".ui-content" ), + hh = $page.children( ".ui-header" ).outerHeight() || 0, + fh = $page.children( ".ui-footer" ).outerHeight() || 0, + pt = parseFloat($content.css( "padding-top" )), + pb = parseFloat($content.css( "padding-bottom" )), + wh = window.innerHeight; + + $content.height(wh - (hh + fh) - (pt + pb)); +} + +$( ":jqmData(role='page')" ).live( "pageshow", function(event) { + var $page = $( this ); + + // For the demos that use this script, we want the content area of each + // page to be scrollable in the 'y' direction. + + $page.find( ".ui-content" ).attr( "data-" + $.mobile.ns + "scroll", "y" ); + + // This code that looks for [data-scroll] will eventually be folded + // into the jqm page processing code when scrollview support is "official" + // instead of "experimental". + + $page.find( ":jqmData(scroll):not(.ui-scrollview-clip)" ).each(function () { + var $this = $( this ); + // XXX: Remove this check for ui-scrolllistview once we've + // integrated list divider support into the main scrollview class. + if ( $this.hasClass( "ui-scrolllistview" ) ) { + $this.scrolllistview(); + } else { + var st = $this.jqmData( "scroll" ) + "", + paging = st && st.search(/^[xy]p$/) != -1, + dir = st && st.search(/^[xy]/) != -1 ? st.charAt(0) : null, + + opts = { + direction: dir || undefined, + paging: paging || undefined, + scrollMethod: $this.jqmData("scroll-method") || undefined + }; + + $this.scrollview( opts ); + } + }); + + // For the demos, we want to make sure the page being shown has a content + // area that is sized to fit completely within the viewport. This should + // also handle the case where pages are loaded dynamically. + + ResizePageContentHeight( event.target ); +}); + +$( window ).bind( "orientationchange", function( event ) { + ResizePageContentHeight( $( ".ui-page" ) ); +}); \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/experiments/scrollview/sv-test-01.html b/libs/js/jquery-mobile-1.1.0/experiments/scrollview/sv-test-01.html new file mode 100644 index 0000000..e9734ad --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/experiments/scrollview/sv-test-01.html @@ -0,0 +1,253 @@ + + + + + +Scrollview Test 1 - Form Element Event Test + + + + + + + + +
      +
      +

      Form Element Event Test

      +
      + + +
      +

      The form elements on this page are wrapped by a special div that has event handlers for touchstart, touchmove and touchstop. The checkboxes below control how the event within these handlers is treated when they fire. Use this page to figure out how the various event treatments impact the form elements on you mobile device, then add to the notes at the bottom of the page.

      +

      All scrolling on this page is performed by the native viewport, there are no scrollviews on this page.

      +
      +
      + + + + + + + + + + + + +
      +
      +
      +
      +

      Form elements

      +
      + + +
      +
      + + +
      +
      + + +
      +
      + + +
      +
      + + +
      +
      +
      + Choose as many snacks as you'd like: + + + + + + + + +
      +
      +
      +
      + Font styling: + + + + + + +
      +
      +
      +
      + Choose a pet: + + + + + + + + +
      +
      +
      +
      + Layout view: + + + + + + +
      +
      +
      + + +
      +
      + + +
      +
      +
      +
      + +
      +
      + +
      +
      +
      +
      +
      +

      Notes

      +
        +
      • iOS +
          +
        • None
        • +
        +
      • +
      • Android +
          +
        • HTC Incredible - Android 2.1 (HTC Sense) +
            +
          • Calling preventDefault() on the touchstart event prevents te following elements from working properly: +
              +
            • Textfield
            • +
            • Textarea
            • +
            • Checkbox
            • +
            • Radio
            • +
            • Button
            • +
            +
          • +
          +
        • +
        • Motorola Droid X - Android 2.2 ()
        • +
        +
      • +
      • Black Berry OS 6 +
          +
        • None
        • +
        +
      • +
      +
      + +
      + + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/experiments/scrollview/sv-test-02.html b/libs/js/jquery-mobile-1.1.0/experiments/scrollview/sv-test-02.html new file mode 100644 index 0000000..a4ab487 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/experiments/scrollview/sv-test-02.html @@ -0,0 +1,241 @@ + + + + + + Scrollview Test 02 - Scrollview Events Test + + + + + + + + + + + + + +
      +
      +

      Scroll View Events Test

      +
      + + +
      +

      Test

      +

      This page wraps the _handleDragStart, _handleDragMove, and _handleDragStop events of the scrollview widget so that the checkboxes below can determine how the native event is treated. You can use this page to figure out what events need to be caught and what special treatment is necessary to prevent native scrolling. You can also test the effect of that treatment on form elements within the sample scrollview.

      +
      + + +
      + +
      + + +
      + +
      +
      + + + + + + + + + + + + +
      +
      +
      +
      + + +
      +
      + + +
      +
      + + +
      +
      + + +
      +
      +
      + + + + +
      +
      + +

      Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

      +

      Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

      +

      Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

      +

      Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

      +

      Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

      +

       

      +

      +
      +

      Disabling Native Scrolling

      +

      In order to get faux scrolling to work, we need to prevent the native viewport scrolling from happening. Unfortunately the way you prevent this from happening differs on some mobile webkit platforms. Below is a table that shows what event needs to be caught, and what methods (preventDefault() and/or stopPropagation()) need to be called on that event to prevent native scrolling. + + + + + + + + + + + +
      Device/OSD-PDD-SPM-PDM-SPU-PDU-SP
      iOS 3.2X
      DroidX/Android 2.2X
      HTC Incredible/Android 2.1XX
      BB Torch/OS 6X
      +

      Notes

      +
        +
      • The HTC Incredible seems to have a bug that triggers occassionally, where timers will be suspended until the viewport is scrolled.
      • +
      • On Android devices, calling preventDefault() on the touchstart event, prevents form elements from getting click events and focus.
      • +
      • On iOS, clicking and dragging within a form element (like textfield/textarea) will always cause the viewport to scroll, event if preventDefault() and stopPropagation() are called on both touchstart and touchmove events.
      • +
      +

      Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

      +

      Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

      +

      Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

      +

      Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

      +

      Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

      +

       

      +

      +
      + +
      + + + + diff --git a/libs/js/jquery-mobile-1.1.0/external/qunit.css b/libs/js/jquery-mobile-1.1.0/external/qunit.css new file mode 100644 index 0000000..705ec9c --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/external/qunit.css @@ -0,0 +1,231 @@ +/** + * QUnit - A JavaScript Unit Testing Framework + * + * http://docs.jquery.com/QUnit + * + * Copyright (c) 2011 John Resig, Jörn Zaefferer + * Dual licensed under the MIT (MIT-LICENSE.txt) + * or GPL (GPL-LICENSE.txt) licenses. + */ + +/** Font Family and Sizes */ + +#qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult { + font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif; +} + +#qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; } +#qunit-tests { font-size: smaller; } + + +/** Resets */ + +#qunit-tests, #qunit-tests ol, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult { + margin: 0; + padding: 0; +} + + +/** Header */ + +#qunit-header { + padding: 0.5em 0 0.5em 1em; + + color: #8699a4; + background-color: #0d3349; + + font-size: 1.5em; + line-height: 1em; + font-weight: normal; + + border-radius: 15px 15px 0 0; + -moz-border-radius: 15px 15px 0 0; + -webkit-border-top-right-radius: 15px; + -webkit-border-top-left-radius: 15px; +} + +#qunit-header a { + text-decoration: none; + color: #c2ccd1; +} + +#qunit-header a:hover, +#qunit-header a:focus { + color: #fff; +} + +#qunit-banner { + height: 5px; +} + +#qunit-testrunner-toolbar { + padding: 0.5em 0 0.5em 2em; + color: #5E740B; + background-color: #eee; +} + +#qunit-userAgent { + padding: 0.5em 0 0.5em 2.5em; + background-color: #2b81af; + color: #fff; + text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px; +} + + +/** Tests: Pass/Fail */ + +#qunit-tests { + list-style-position: inside; +} + +#qunit-tests li { + padding: 0.4em 0.5em 0.4em 2.5em; + border-bottom: 1px solid #fff; + list-style-position: inside; +} + +#qunit-tests.hidepass li.pass, #qunit-tests.hidepass li.running { + display: none; +} + +#qunit-tests li strong { + cursor: pointer; +} + +#qunit-tests li a { + padding: 0.5em; + color: #c2ccd1; + text-decoration: none; +} +#qunit-tests li a:hover, +#qunit-tests li a:focus { + color: #000; +} + +#qunit-tests ol { + margin-top: 0.5em; + padding: 0.5em; + + background-color: #fff; + + border-radius: 15px; + -moz-border-radius: 15px; + -webkit-border-radius: 15px; + + box-shadow: inset 0px 2px 13px #999; + -moz-box-shadow: inset 0px 2px 13px #999; + -webkit-box-shadow: inset 0px 2px 13px #999; +} + +#qunit-tests table { + border-collapse: collapse; + margin-top: .2em; +} + +#qunit-tests th { + text-align: right; + vertical-align: top; + padding: 0 .5em 0 0; +} + +#qunit-tests td { + vertical-align: top; +} + +#qunit-tests pre { + margin: 0; + white-space: pre-wrap; + word-wrap: break-word; +} + +#qunit-tests del { + background-color: #e0f2be; + color: #374e0c; + text-decoration: none; +} + +#qunit-tests ins { + background-color: #ffcaca; + color: #500; + text-decoration: none; +} + +/*** Test Counts */ + +#qunit-tests b.counts { color: black; } +#qunit-tests b.passed { color: #5E740B; } +#qunit-tests b.failed { color: #710909; } + +#qunit-tests li li { + margin: 0.5em; + padding: 0.4em 0.5em 0.4em 0.5em; + background-color: #fff; + border-bottom: none; + list-style-position: inside; +} + +/*** Passing Styles */ + +#qunit-tests li li.pass { + color: #5E740B; + background-color: #fff; + border-left: 26px solid #C6E746; +} + +#qunit-tests .pass { color: #528CE0; background-color: #D2E0E6; } +#qunit-tests .pass .test-name { color: #366097; } + +#qunit-tests .pass .test-actual, +#qunit-tests .pass .test-expected { color: #999999; } + +#qunit-banner.qunit-pass { background-color: #C6E746; } + +/*** Failing Styles */ + +#qunit-tests li li.fail { + color: #710909; + background-color: #fff; + border-left: 26px solid #EE5757; + white-space: pre; +} + +#qunit-tests > li:last-child { + border-radius: 0 0 15px 15px; + -moz-border-radius: 0 0 15px 15px; + -webkit-border-bottom-right-radius: 15px; + -webkit-border-bottom-left-radius: 15px; +} + +#qunit-tests .fail { color: #000000; background-color: #EE5757; } +#qunit-tests .fail .test-name, +#qunit-tests .fail .module-name { color: #000000; } + +#qunit-tests .fail .test-actual { color: #EE5757; } +#qunit-tests .fail .test-expected { color: green; } + +#qunit-banner.qunit-fail { background-color: #EE5757; } + + +/** Result */ + +#qunit-testresult { + padding: 0.5em 0.5em 0.5em 2.5em; + + color: #2b81af; + background-color: #D2E0E6; + + border-bottom: 1px solid white; +} + +/** Fixture */ + +#qunit-fixture { + position: absolute; + top: -10000px; + left: -10000px; +} + +[data-nstest-role='page'], [data-nstest-role='dialog'] { + position: absolute !important; + top: -10000px !important; +} diff --git a/libs/js/jquery-mobile-1.1.0/external/qunit.js b/libs/js/jquery-mobile-1.1.0/external/qunit.js new file mode 100644 index 0000000..193d52d --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/external/qunit.js @@ -0,0 +1,1552 @@ +/** + * QUnit - A JavaScript Unit Testing Framework + * + * http://docs.jquery.com/QUnit + * + * Copyright (c) 2011 John Resig, Jörn Zaefferer + * Dual licensed under the MIT (MIT-LICENSE.txt) + * or GPL (GPL-LICENSE.txt) licenses. + */ + +(function(window) { + +var defined = { + setTimeout: typeof window.setTimeout !== "undefined", + sessionStorage: (function() { + try { + return !!sessionStorage.getItem; + } catch(e) { + return false; + } + })() +}; + +var testId = 0; + +var Test = function(name, testName, expected, testEnvironmentArg, async, callback) { + this.name = name; + this.testName = testName; + this.expected = expected; + this.testEnvironmentArg = testEnvironmentArg; + this.async = async; + this.callback = callback; + this.assertions = []; +}; +Test.prototype = { + init: function() { + var tests = id("qunit-tests"); + if (tests) { + var b = document.createElement("strong"); + b.innerHTML = "Running " + this.name; + var li = document.createElement("li"); + li.appendChild( b ); + li.className = "running"; + li.id = this.id = "test-output" + testId++; + tests.appendChild( li ); + } + }, + setup: function() { + if (this.module != config.previousModule) { + if ( config.previousModule ) { + runLoggingCallbacks('moduleDone', QUnit, { + name: config.previousModule, + failed: config.moduleStats.bad, + passed: config.moduleStats.all - config.moduleStats.bad, + total: config.moduleStats.all + } ); + } + config.previousModule = this.module; + config.moduleStats = { all: 0, bad: 0 }; + runLoggingCallbacks( 'moduleStart', QUnit, { + name: this.module + } ); + } + + config.current = this; + this.testEnvironment = extend({ + setup: function() {}, + teardown: function() {} + }, this.moduleTestEnvironment); + if (this.testEnvironmentArg) { + extend(this.testEnvironment, this.testEnvironmentArg); + } + + runLoggingCallbacks( 'testStart', QUnit, { + name: this.testName, + module: this.module + }); + + // allow utility functions to access the current test environment + // TODO why?? + QUnit.current_testEnvironment = this.testEnvironment; + + try { + if ( !config.pollution ) { + saveGlobal(); + } + + this.testEnvironment.setup.call(this.testEnvironment); + } catch(e) { + QUnit.ok( false, "Setup failed on " + this.testName + ": " + e.message ); + } + }, + run: function() { + if ( this.async ) { + QUnit.stop(); + } + + if ( config.notrycatch ) { + this.callback.call(this.testEnvironment); + return; + } + try { + this.callback.call(this.testEnvironment); + } catch(e) { + fail("Test " + this.testName + " died, exception and test follows", e, this.callback); + QUnit.ok( false, "Died on test #" + (this.assertions.length + 1) + ": " + e.message + " - " + QUnit.jsDump.parse(e) ); + // else next test will carry the responsibility + saveGlobal(); + + // Restart the tests if they're blocking + if ( config.blocking ) { + start(); + } + } + }, + teardown: function() { + try { + this.testEnvironment.teardown.call(this.testEnvironment); + checkPollution(); + } catch(e) { + QUnit.ok( false, "Teardown failed on " + this.testName + ": " + e.message ); + } + }, + finish: function() { + if ( this.expected && this.expected != this.assertions.length ) { + QUnit.ok( false, "Expected " + this.expected + " assertions, but " + this.assertions.length + " were run" ); + } + + var good = 0, bad = 0, + tests = id("qunit-tests"); + + config.stats.all += this.assertions.length; + config.moduleStats.all += this.assertions.length; + + if ( tests ) { + var ol = document.createElement("ol"); + + for ( var i = 0; i < this.assertions.length; i++ ) { + var assertion = this.assertions[i]; + + var li = document.createElement("li"); + li.className = assertion.result ? "pass" : "fail"; + li.innerHTML = assertion.message || (assertion.result ? "okay" : "failed"); + ol.appendChild( li ); + + if ( assertion.result ) { + good++; + } else { + bad++; + config.stats.bad++; + config.moduleStats.bad++; + } + } + + // store result when possible + if ( QUnit.config.reorder && defined.sessionStorage ) { + if (bad) { + sessionStorage.setItem("qunit-" + this.module + "-" + this.testName, bad); + } else { + sessionStorage.removeItem("qunit-" + this.module + "-" + this.testName); + } + } + + if (bad == 0) { + ol.style.display = "none"; + } + + var b = document.createElement("strong"); + b.innerHTML = this.name + " (" + bad + ", " + good + ", " + this.assertions.length + ")"; + + var a = document.createElement("a"); + a.innerHTML = "Rerun"; + a.href = QUnit.url({ filter: getText([b]).replace(/\([^)]+\)$/, "").replace(/(^\s*|\s*$)/g, "") }); + + addEvent(b, "click", function() { + var next = b.nextSibling.nextSibling, + display = next.style.display; + next.style.display = display === "none" ? "block" : "none"; + }); + + addEvent(b, "dblclick", function(e) { + var target = e && e.target ? e.target : window.event.srcElement; + if ( target.nodeName.toLowerCase() == "span" || target.nodeName.toLowerCase() == "b" ) { + target = target.parentNode; + } + if ( window.location && target.nodeName.toLowerCase() === "strong" ) { + window.location = QUnit.url({ filter: getText([target]).replace(/\([^)]+\)$/, "").replace(/(^\s*|\s*$)/g, "") }); + } + }); + + var li = id(this.id); + li.className = bad ? "fail" : "pass"; + li.removeChild( li.firstChild ); + li.appendChild( b ); + li.appendChild( a ); + li.appendChild( ol ); + + } else { + for ( var i = 0; i < this.assertions.length; i++ ) { + if ( !this.assertions[i].result ) { + bad++; + config.stats.bad++; + config.moduleStats.bad++; + } + } + } + + try { + QUnit.reset(); + } catch(e) { + fail("reset() failed, following Test " + this.testName + ", exception and reset fn follows", e, QUnit.reset); + } + + runLoggingCallbacks( 'testDone', QUnit, { + name: this.testName, + module: this.module, + failed: bad, + passed: this.assertions.length - bad, + total: this.assertions.length + } ); + }, + + queue: function() { + var test = this; + synchronize(function() { + test.init(); + }); + function run() { + // each of these can by async + synchronize(function() { + test.setup(); + }); + synchronize(function() { + test.run(); + }); + synchronize(function() { + test.teardown(); + }); + synchronize(function() { + test.finish(); + }); + } + // defer when previous test run passed, if storage is available + var bad = QUnit.config.reorder && defined.sessionStorage && +sessionStorage.getItem("qunit-" + this.module + "-" + this.testName); + if (bad) { + run(); + } else { + synchronize(run); + }; + } + +}; + +var QUnit = { + + // call on start of module test to prepend name to all tests + module: function(name, testEnvironment) { + config.currentModule = name; + config.currentModuleTestEnviroment = testEnvironment; + }, + + asyncTest: function(testName, expected, callback) { + if ( arguments.length === 2 ) { + callback = expected; + expected = 0; + } + + QUnit.test(testName, expected, callback, true); + }, + + test: function(testName, expected, callback, async) { + var name = '' + testName + '', testEnvironmentArg; + + if ( arguments.length === 2 ) { + callback = expected; + expected = null; + } + // is 2nd argument a testEnvironment? + if ( expected && typeof expected === 'object') { + testEnvironmentArg = expected; + expected = null; + } + + if ( config.currentModule ) { + name = '' + config.currentModule + ": " + name; + } + + if ( !validTest(config.currentModule + ": " + testName) ) { + return; + } + + var test = new Test(name, testName, expected, testEnvironmentArg, async, callback); + test.module = config.currentModule; + test.moduleTestEnvironment = config.currentModuleTestEnviroment; + test.queue(); + }, + + /** + * Specify the number of expected assertions to gurantee that failed test (no assertions are run at all) don't slip through. + */ + expect: function(asserts) { + config.current.expected = asserts; + }, + + /** + * Asserts true. + * @example ok( "asdfasdf".length > 5, "There must be at least 5 chars" ); + */ + ok: function(a, msg) { + a = !!a; + var details = { + result: a, + message: msg + }; + msg = escapeInnerText(msg); + runLoggingCallbacks( 'log', QUnit, details ); + config.current.assertions.push({ + result: a, + message: msg + }); + }, + + /** + * Checks that the first two arguments are equal, with an optional message. + * Prints out both actual and expected values. + * + * Prefered to ok( actual == expected, message ) + * + * @example equal( format("Received {0} bytes.", 2), "Received 2 bytes." ); + * + * @param Object actual + * @param Object expected + * @param String message (optional) + */ + equal: function(actual, expected, message) { + QUnit.push(expected == actual, actual, expected, message); + }, + + notEqual: function(actual, expected, message) { + QUnit.push(expected != actual, actual, expected, message); + }, + + deepEqual: function(actual, expected, message) { + QUnit.push(QUnit.equiv(actual, expected), actual, expected, message); + }, + + notDeepEqual: function(actual, expected, message) { + QUnit.push(!QUnit.equiv(actual, expected), actual, expected, message); + }, + + strictEqual: function(actual, expected, message) { + QUnit.push(expected === actual, actual, expected, message); + }, + + notStrictEqual: function(actual, expected, message) { + QUnit.push(expected !== actual, actual, expected, message); + }, + + raises: function(block, expected, message) { + var actual, ok = false; + + if (typeof expected === 'string') { + message = expected; + expected = null; + } + + try { + block(); + } catch (e) { + actual = e; + } + + if (actual) { + // we don't want to validate thrown error + if (!expected) { + ok = true; + // expected is a regexp + } else if (QUnit.objectType(expected) === "regexp") { + ok = expected.test(actual); + // expected is a constructor + } else if (actual instanceof expected) { + ok = true; + // expected is a validation function which returns true is validation passed + } else if (expected.call({}, actual) === true) { + ok = true; + } + } + + QUnit.ok(ok, message); + }, + + start: function(count) { + config.semaphore -= count || 1; + if (config.semaphore > 0) { + // don't start until equal number of stop-calls + return; + } + if (config.semaphore < 0) { + // ignore if start is called more often then stop + config.semaphore = 0; + } + // A slight delay, to avoid any current callbacks + if ( defined.setTimeout ) { + window.setTimeout(function() { + if (config.semaphore > 0) { + return; + } + if ( config.timeout ) { + clearTimeout(config.timeout); + } + + config.blocking = false; + process(); + }, 13); + } else { + config.blocking = false; + process(); + } + }, + + stop: function(count) { + config.semaphore += count || 1; + config.blocking = true; + + if ( config.testTimeout && defined.setTimeout ) { + clearTimeout(config.timeout); + config.timeout = window.setTimeout(function() { + QUnit.ok( false, "Test timed out" ); + config.semaphore = 1; + QUnit.start(); + }, config.testTimeout); + } + } +}; + +//We want access to the constructor's prototype +(function() { + function F(){}; + F.prototype = QUnit; + QUnit = new F(); + //Make F QUnit's constructor so that we can add to the prototype later + QUnit.constructor = F; +})(); + +// Backwards compatibility, deprecated +QUnit.equals = QUnit.equal; +QUnit.same = QUnit.deepEqual; + +// Maintain internal state +var config = { + // The queue of tests to run + queue: [], + + // block until document ready + blocking: true, + + // when enabled, show only failing tests + // gets persisted through sessionStorage and can be changed in UI via checkbox + hidepassed: false, + + // by default, run previously failed tests first + // very useful in combination with "Hide passed tests" checked + reorder: true, + + // by default, modify document.title when suite is done + altertitle: true, + + urlConfig: ['noglobals', 'notrycatch'], + + //logging callback queues + begin: [], + done: [], + log: [], + testStart: [], + testDone: [], + moduleStart: [], + moduleDone: [] +}; + +// Load paramaters +(function() { + var location = window.location || { search: "", protocol: "file:" }, + params = location.search.slice( 1 ).split( "&" ), + length = params.length, + urlParams = {}, + current; + + if ( params[ 0 ] ) { + for ( var i = 0; i < length; i++ ) { + current = params[ i ].split( "=" ); + current[ 0 ] = decodeURIComponent( current[ 0 ] ); + // allow just a key to turn on a flag, e.g., test.html?noglobals + current[ 1 ] = current[ 1 ] ? decodeURIComponent( current[ 1 ] ) : true; + urlParams[ current[ 0 ] ] = current[ 1 ]; + } + } + + QUnit.urlParams = urlParams; + config.filter = urlParams.filter; + + // Figure out if we're running the tests from a server or not + QUnit.isLocal = !!(location.protocol === 'file:'); +})(); + +// Expose the API as global variables, unless an 'exports' +// object exists, in that case we assume we're in CommonJS +if ( typeof exports === "undefined" || typeof require === "undefined" ) { + extend(window, QUnit); + window.QUnit = QUnit; +} else { + extend(exports, QUnit); + exports.QUnit = QUnit; +} + +// define these after exposing globals to keep them in these QUnit namespace only +extend(QUnit, { + config: config, + + // Initialize the configuration options + init: function() { + extend(config, { + stats: { all: 0, bad: 0 }, + moduleStats: { all: 0, bad: 0 }, + started: +new Date, + updateRate: 1000, + blocking: false, + autostart: true, + autorun: false, + filter: "", + queue: [], + semaphore: 0 + }); + + var tests = id( "qunit-tests" ), + banner = id( "qunit-banner" ), + result = id( "qunit-testresult" ); + + if ( tests ) { + tests.innerHTML = ""; + } + + if ( banner ) { + banner.className = ""; + } + + if ( result ) { + result.parentNode.removeChild( result ); + } + + if ( tests ) { + result = document.createElement( "p" ); + result.id = "qunit-testresult"; + result.className = "result"; + tests.parentNode.insertBefore( result, tests ); + result.innerHTML = 'Running...
       '; + } + }, + + /** + * Resets the test setup. Useful for tests that modify the DOM. + * + * If jQuery is available, uses jQuery's html(), otherwise just innerHTML. + */ + reset: function() { + if ( window.jQuery ) { + jQuery( "#qunit-fixture" ).html( config.fixture ); + } else { + var main = id( 'qunit-fixture' ); + if ( main ) { + main.innerHTML = config.fixture; + } + } + }, + + /** + * Trigger an event on an element. + * + * @example triggerEvent( document.body, "click" ); + * + * @param DOMElement elem + * @param String type + */ + triggerEvent: function( elem, type, event ) { + if ( document.createEvent ) { + event = document.createEvent("MouseEvents"); + event.initMouseEvent(type, true, true, elem.ownerDocument.defaultView, + 0, 0, 0, 0, 0, false, false, false, false, 0, null); + elem.dispatchEvent( event ); + + } else if ( elem.fireEvent ) { + elem.fireEvent("on"+type); + } + }, + + // Safe object type checking + is: function( type, obj ) { + return QUnit.objectType( obj ) == type; + }, + + objectType: function( obj ) { + if (typeof obj === "undefined") { + return "undefined"; + + // consider: typeof null === object + } + if (obj === null) { + return "null"; + } + + var type = Object.prototype.toString.call( obj ) + .match(/^\[object\s(.*)\]$/)[1] || ''; + + switch (type) { + case 'Number': + if (isNaN(obj)) { + return "nan"; + } else { + return "number"; + } + case 'String': + case 'Boolean': + case 'Array': + case 'Date': + case 'RegExp': + case 'Function': + return type.toLowerCase(); + } + if (typeof obj === "object") { + return "object"; + } + return undefined; + }, + + push: function(result, actual, expected, message) { + var details = { + result: result, + message: message, + actual: actual, + expected: expected + }; + + message = escapeInnerText(message) || (result ? "okay" : "failed"); + message = '' + message + ""; + expected = escapeInnerText(QUnit.jsDump.parse(expected)); + actual = escapeInnerText(QUnit.jsDump.parse(actual)); + var output = message + ''; + if (actual != expected) { + output += ''; + output += ''; + } + if (!result) { + var source = sourceFromStacktrace(); + if (source) { + details.source = source; + output += ''; + } + } + output += "
      Expected:
      ' + expected + '
      Result:
      ' + actual + '
      Diff:
      ' + QUnit.diff(expected, actual) +'
      Source:
      ' + escapeInnerText(source) + '
      "; + + runLoggingCallbacks( 'log', QUnit, details ); + + config.current.assertions.push({ + result: !!result, + message: output + }); + }, + + url: function( params ) { + params = extend( extend( {}, QUnit.urlParams ), params ); + var querystring = "?", + key; + for ( key in params ) { + querystring += encodeURIComponent( key ) + "=" + + encodeURIComponent( params[ key ] ) + "&"; + } + return window.location.pathname + querystring.slice( 0, -1 ); + }, + + extend: extend, + id: id, + addEvent: addEvent +}); + +//QUnit.constructor is set to the empty F() above so that we can add to it's prototype later +//Doing this allows us to tell if the following methods have been overwritten on the actual +//QUnit object, which is a deprecated way of using the callbacks. +extend(QUnit.constructor.prototype, { + // Logging callbacks; all receive a single argument with the listed properties + // run test/logs.html for any related changes + begin: registerLoggingCallback('begin'), + // done: { failed, passed, total, runtime } + done: registerLoggingCallback('done'), + // log: { result, actual, expected, message } + log: registerLoggingCallback('log'), + // testStart: { name } + testStart: registerLoggingCallback('testStart'), + // testDone: { name, failed, passed, total } + testDone: registerLoggingCallback('testDone'), + // moduleStart: { name } + moduleStart: registerLoggingCallback('moduleStart'), + // moduleDone: { name, failed, passed, total } + moduleDone: registerLoggingCallback('moduleDone') +}); + +if ( typeof document === "undefined" || document.readyState === "complete" ) { + config.autorun = true; +} + +QUnit.load = function() { + runLoggingCallbacks( 'begin', QUnit, {} ); + + // Initialize the config, saving the execution queue + var oldconfig = extend({}, config); + QUnit.init(); + extend(config, oldconfig); + + config.blocking = false; + + var urlConfigHtml = '', len = config.urlConfig.length; + for ( var i = 0, val; i < len, val = config.urlConfig[i]; i++ ) { + config[val] = QUnit.urlParams[val]; + urlConfigHtml += ''; + } + + var userAgent = id("qunit-userAgent"); + if ( userAgent ) { + userAgent.innerHTML = navigator.userAgent; + } + var banner = id("qunit-header"); + if ( banner ) { + banner.innerHTML = ' ' + banner.innerHTML + ' ' + urlConfigHtml; + addEvent( banner, "change", function( event ) { + var params = {}; + params[ event.target.name ] = event.target.checked ? true : undefined; + window.location = QUnit.url( params ); + }); + } + + var toolbar = id("qunit-testrunner-toolbar"); + if ( toolbar ) { + var filter = document.createElement("input"); + filter.type = "checkbox"; + filter.id = "qunit-filter-pass"; + addEvent( filter, "click", function() { + var ol = document.getElementById("qunit-tests"); + if ( filter.checked ) { + ol.className = ol.className + " hidepass"; + } else { + var tmp = " " + ol.className.replace( /[\n\t\r]/g, " " ) + " "; + ol.className = tmp.replace(/ hidepass /, " "); + } + if ( defined.sessionStorage ) { + if (filter.checked) { + sessionStorage.setItem("qunit-filter-passed-tests", "true"); + } else { + sessionStorage.removeItem("qunit-filter-passed-tests"); + } + } + }); + if ( config.hidepassed || defined.sessionStorage && sessionStorage.getItem("qunit-filter-passed-tests") ) { + filter.checked = true; + var ol = document.getElementById("qunit-tests"); + ol.className = ol.className + " hidepass"; + } + toolbar.appendChild( filter ); + + var label = document.createElement("label"); + label.setAttribute("for", "qunit-filter-pass"); + label.innerHTML = "Hide passed tests"; + toolbar.appendChild( label ); + } + + var main = id('qunit-fixture'); + if ( main ) { + config.fixture = main.innerHTML; + } + + if (config.autostart) { + QUnit.start(); + } +}; + +addEvent(window, "load", QUnit.load); + +function done() { + config.autorun = true; + + // Log the last module results + if ( config.currentModule ) { + runLoggingCallbacks( 'moduleDone', QUnit, { + name: config.currentModule, + failed: config.moduleStats.bad, + passed: config.moduleStats.all - config.moduleStats.bad, + total: config.moduleStats.all + } ); + } + + var banner = id("qunit-banner"), + tests = id("qunit-tests"), + runtime = +new Date - config.started, + passed = config.stats.all - config.stats.bad, + html = [ + 'Tests completed in ', + runtime, + ' milliseconds.
      ', + '', + passed, + ' tests of ', + config.stats.all, + ' passed, ', + config.stats.bad, + ' failed.' + ].join(''); + + if ( banner ) { + banner.className = (config.stats.bad ? "qunit-fail" : "qunit-pass"); + } + + if ( tests ) { + id( "qunit-testresult" ).innerHTML = html; + } + + if ( config.altertitle && typeof document !== "undefined" && document.title ) { + // show ✖ for good, ✔ for bad suite result in title + // use escape sequences in case file gets loaded with non-utf-8-charset + document.title = [ + (config.stats.bad ? "\u2716" : "\u2714"), + document.title.replace(/^[\u2714\u2716] /i, "") + ].join(" "); + } + + runLoggingCallbacks( 'done', QUnit, { + failed: config.stats.bad, + passed: passed, + total: config.stats.all, + runtime: runtime + } ); +} + +function validTest( name ) { + var filter = config.filter, + run = false; + + if ( !filter ) { + return true; + } + + var not = filter.charAt( 0 ) === "!"; + if ( not ) { + filter = filter.slice( 1 ); + } + + if ( name.indexOf( filter ) !== -1 ) { + return !not; + } + + if ( not ) { + run = true; + } + + return run; +} + +// so far supports only Firefox, Chrome and Opera (buggy) +// could be extended in the future to use something like https://github.com/csnover/TraceKit +function sourceFromStacktrace() { + try { + throw new Error(); + } catch ( e ) { + if (e.stacktrace) { + // Opera + return e.stacktrace.split("\n")[6]; + } else if (e.stack) { + // Firefox, Chrome + return e.stack.split("\n")[4]; + } else if (e.sourceURL) { + // Safari, PhantomJS + // TODO sourceURL points at the 'throw new Error' line above, useless + //return e.sourceURL + ":" + e.line; + } + } +} + +function escapeInnerText(s) { + if (!s) { + return ""; + } + s = s + ""; + return s.replace(/[\&<>]/g, function(s) { + switch(s) { + case "&": return "&"; + case "<": return "<"; + case ">": return ">"; + default: return s; + } + }); +} + +function synchronize( callback ) { + config.queue.push( callback ); + + if ( config.autorun && !config.blocking ) { + process(); + } +} + +function process() { + var start = (new Date()).getTime(); + + while ( config.queue.length && !config.blocking ) { + if ( config.updateRate <= 0 || (((new Date()).getTime() - start) < config.updateRate) ) { + config.queue.shift()(); + } else { + window.setTimeout( process, 13 ); + break; + } + } + if (!config.blocking && !config.queue.length) { + done(); + } +} + +function saveGlobal() { + config.pollution = []; + + if ( config.noglobals ) { + for ( var key in window ) { + config.pollution.push( key ); + } + } +} + +function checkPollution( name ) { + var old = config.pollution; + saveGlobal(); + + var newGlobals = diff( config.pollution, old ); + if ( newGlobals.length > 0 ) { + ok( false, "Introduced global variable(s): " + newGlobals.join(", ") ); + } + + var deletedGlobals = diff( old, config.pollution ); + if ( deletedGlobals.length > 0 ) { + ok( false, "Deleted global variable(s): " + deletedGlobals.join(", ") ); + } +} + +// returns a new Array with the elements that are in a but not in b +function diff( a, b ) { + var result = a.slice(); + for ( var i = 0; i < result.length; i++ ) { + for ( var j = 0; j < b.length; j++ ) { + if ( result[i] === b[j] ) { + result.splice(i, 1); + i--; + break; + } + } + } + return result; +} + +function fail(message, exception, callback) { + if ( typeof console !== "undefined" && console.error && console.warn ) { + console.error(message); + console.error(exception); + console.warn(callback.toString()); + + } else if ( window.opera && opera.postError ) { + opera.postError(message, exception, callback.toString); + } +} + +function extend(a, b) { + for ( var prop in b ) { + if ( b[prop] === undefined ) { + delete a[prop]; + } else { + a[prop] = b[prop]; + } + } + + return a; +} + +function addEvent(elem, type, fn) { + if ( elem.addEventListener ) { + elem.addEventListener( type, fn, false ); + } else if ( elem.attachEvent ) { + elem.attachEvent( "on" + type, fn ); + } else { + fn(); + } +} + +function id(name) { + return !!(typeof document !== "undefined" && document && document.getElementById) && + document.getElementById( name ); +} + +function registerLoggingCallback(key){ + return function(callback){ + config[key].push( callback ); + }; +} + +// Supports deprecated method of completely overwriting logging callbacks +function runLoggingCallbacks(key, scope, args) { + //debugger; + var callbacks; + if ( QUnit.hasOwnProperty(key) ) { + QUnit[key].call(scope, args); + } else { + callbacks = config[key]; + for( var i = 0; i < callbacks.length; i++ ) { + callbacks[i].call( scope, args ); + } + } +} + +// Test for equality any JavaScript type. +// Author: Philippe Rathé +QUnit.equiv = function () { + + var innerEquiv; // the real equiv function + var callers = []; // stack to decide between skip/abort functions + var parents = []; // stack to avoiding loops from circular referencing + + // Call the o related callback with the given arguments. + function bindCallbacks(o, callbacks, args) { + var prop = QUnit.objectType(o); + if (prop) { + if (QUnit.objectType(callbacks[prop]) === "function") { + return callbacks[prop].apply(callbacks, args); + } else { + return callbacks[prop]; // or undefined + } + } + } + + var callbacks = function () { + + // for string, boolean, number and null + function useStrictEquality(b, a) { + if (b instanceof a.constructor || a instanceof b.constructor) { + // to catch short annotaion VS 'new' annotation of a + // declaration + // e.g. var i = 1; + // var j = new Number(1); + return a == b; + } else { + return a === b; + } + } + + return { + "string" : useStrictEquality, + "boolean" : useStrictEquality, + "number" : useStrictEquality, + "null" : useStrictEquality, + "undefined" : useStrictEquality, + + "nan" : function(b) { + return isNaN(b); + }, + + "date" : function(b, a) { + return QUnit.objectType(b) === "date" + && a.valueOf() === b.valueOf(); + }, + + "regexp" : function(b, a) { + return QUnit.objectType(b) === "regexp" + && a.source === b.source && // the regex itself + a.global === b.global && // and its modifers + // (gmi) ... + a.ignoreCase === b.ignoreCase + && a.multiline === b.multiline; + }, + + // - skip when the property is a method of an instance (OOP) + // - abort otherwise, + // initial === would have catch identical references anyway + "function" : function() { + var caller = callers[callers.length - 1]; + return caller !== Object && typeof caller !== "undefined"; + }, + + "array" : function(b, a) { + var i, j, loop; + var len; + + // b could be an object literal here + if (!(QUnit.objectType(b) === "array")) { + return false; + } + + len = a.length; + if (len !== b.length) { // safe and faster + return false; + } + + // track reference to avoid circular references + parents.push(a); + for (i = 0; i < len; i++) { + loop = false; + for (j = 0; j < parents.length; j++) { + if (parents[j] === a[i]) { + loop = true;// dont rewalk array + } + } + if (!loop && !innerEquiv(a[i], b[i])) { + parents.pop(); + return false; + } + } + parents.pop(); + return true; + }, + + "object" : function(b, a) { + var i, j, loop; + var eq = true; // unless we can proove it + var aProperties = [], bProperties = []; // collection of + // strings + + // comparing constructors is more strict than using + // instanceof + if (a.constructor !== b.constructor) { + return false; + } + + // stack constructor before traversing properties + callers.push(a.constructor); + // track reference to avoid circular references + parents.push(a); + + for (i in a) { // be strict: don't ensures hasOwnProperty + // and go deep + loop = false; + for (j = 0; j < parents.length; j++) { + if (parents[j] === a[i]) + loop = true; // don't go down the same path + // twice + } + aProperties.push(i); // collect a's properties + + if (!loop && !innerEquiv(a[i], b[i])) { + eq = false; + break; + } + } + + callers.pop(); // unstack, we are done + parents.pop(); + + for (i in b) { + bProperties.push(i); // collect b's properties + } + + // Ensures identical properties name + return eq + && innerEquiv(aProperties.sort(), bProperties + .sort()); + } + }; + }(); + + innerEquiv = function() { // can take multiple arguments + var args = Array.prototype.slice.apply(arguments); + if (args.length < 2) { + return true; // end transition + } + + return (function(a, b) { + if (a === b) { + return true; // catch the most you can + } else if (a === null || b === null || typeof a === "undefined" + || typeof b === "undefined" + || QUnit.objectType(a) !== QUnit.objectType(b)) { + return false; // don't lose time with error prone cases + } else { + return bindCallbacks(a, callbacks, [ b, a ]); + } + + // apply transition with (1..n) arguments + })(args[0], args[1]) + && arguments.callee.apply(this, args.splice(1, + args.length - 1)); + }; + + return innerEquiv; + +}(); + +/** + * jsDump Copyright (c) 2008 Ariel Flesler - aflesler(at)gmail(dot)com | + * http://flesler.blogspot.com Licensed under BSD + * (http://www.opensource.org/licenses/bsd-license.php) Date: 5/15/2008 + * + * @projectDescription Advanced and extensible data dumping for Javascript. + * @version 1.0.0 + * @author Ariel Flesler + * @link {http://flesler.blogspot.com/2008/05/jsdump-pretty-dump-of-any-javascript.html} + */ +QUnit.jsDump = (function() { + function quote( str ) { + return '"' + str.toString().replace(/"/g, '\\"') + '"'; + }; + function literal( o ) { + return o + ''; + }; + function join( pre, arr, post ) { + var s = jsDump.separator(), + base = jsDump.indent(), + inner = jsDump.indent(1); + if ( arr.join ) + arr = arr.join( ',' + s + inner ); + if ( !arr ) + return pre + post; + return [ pre, inner + arr, base + post ].join(s); + }; + function array( arr, stack ) { + var i = arr.length, ret = Array(i); + this.up(); + while ( i-- ) + ret[i] = this.parse( arr[i] , undefined , stack); + this.down(); + return join( '[', ret, ']' ); + }; + + var reName = /^function (\w+)/; + + var jsDump = { + parse:function( obj, type, stack ) { //type is used mostly internally, you can fix a (custom)type in advance + stack = stack || [ ]; + var parser = this.parsers[ type || this.typeOf(obj) ]; + type = typeof parser; + var inStack = inArray(obj, stack); + if (inStack != -1) { + return 'recursion('+(inStack - stack.length)+')'; + } + //else + if (type == 'function') { + stack.push(obj); + var res = parser.call( this, obj, stack ); + stack.pop(); + return res; + } + // else + return (type == 'string') ? parser : this.parsers.error; + }, + typeOf:function( obj ) { + var type; + if ( obj === null ) { + type = "null"; + } else if (typeof obj === "undefined") { + type = "undefined"; + } else if (QUnit.is("RegExp", obj)) { + type = "regexp"; + } else if (QUnit.is("Date", obj)) { + type = "date"; + } else if (QUnit.is("Function", obj)) { + type = "function"; + } else if (typeof obj.setInterval !== undefined && typeof obj.document !== "undefined" && typeof obj.nodeType === "undefined") { + type = "window"; + } else if (obj.nodeType === 9) { + type = "document"; + } else if (obj.nodeType) { + type = "node"; + } else if (typeof obj === "object" && typeof obj.length === "number" && obj.length >= 0) { + type = "array"; + } else { + type = typeof obj; + } + return type; + }, + separator:function() { + return this.multiline ? this.HTML ? '
      ' : '\n' : this.HTML ? ' ' : ' '; + }, + indent:function( extra ) {// extra can be a number, shortcut for increasing-calling-decreasing + if ( !this.multiline ) + return ''; + var chr = this.indentChar; + if ( this.HTML ) + chr = chr.replace(/\t/g,' ').replace(/ /g,' '); + return Array( this._depth_ + (extra||0) ).join(chr); + }, + up:function( a ) { + this._depth_ += a || 1; + }, + down:function( a ) { + this._depth_ -= a || 1; + }, + setParser:function( name, parser ) { + this.parsers[name] = parser; + }, + // The next 3 are exposed so you can use them + quote:quote, + literal:literal, + join:join, + // + _depth_: 1, + // This is the list of parsers, to modify them, use jsDump.setParser + parsers:{ + window: '[Window]', + document: '[Document]', + error:'[ERROR]', //when no parser is found, shouldn't happen + unknown: '[Unknown]', + 'null':'null', + 'undefined':'undefined', + 'function':function( fn ) { + var ret = 'function', + name = 'name' in fn ? fn.name : (reName.exec(fn)||[])[1];//functions never have name in IE + if ( name ) + ret += ' ' + name; + ret += '('; + + ret = [ ret, QUnit.jsDump.parse( fn, 'functionArgs' ), '){'].join(''); + return join( ret, QUnit.jsDump.parse(fn,'functionCode'), '}' ); + }, + array: array, + nodelist: array, + arguments: array, + object:function( map, stack ) { + var ret = [ ]; + QUnit.jsDump.up(); + for ( var key in map ) { + var val = map[key]; + ret.push( QUnit.jsDump.parse(key,'key') + ': ' + QUnit.jsDump.parse(val, undefined, stack)); + } + QUnit.jsDump.down(); + return join( '{', ret, '}' ); + }, + node:function( node ) { + var open = QUnit.jsDump.HTML ? '<' : '<', + close = QUnit.jsDump.HTML ? '>' : '>'; + + var tag = node.nodeName.toLowerCase(), + ret = open + tag; + + for ( var a in QUnit.jsDump.DOMAttrs ) { + var val = node[QUnit.jsDump.DOMAttrs[a]]; + if ( val ) + ret += ' ' + a + '=' + QUnit.jsDump.parse( val, 'attribute' ); + } + return ret + close + open + '/' + tag + close; + }, + functionArgs:function( fn ) {//function calls it internally, it's the arguments part of the function + var l = fn.length; + if ( !l ) return ''; + + var args = Array(l); + while ( l-- ) + args[l] = String.fromCharCode(97+l);//97 is 'a' + return ' ' + args.join(', ') + ' '; + }, + key:quote, //object calls it internally, the key part of an item in a map + functionCode:'[code]', //function calls it internally, it's the content of the function + attribute:quote, //node calls it internally, it's an html attribute value + string:quote, + date:quote, + regexp:literal, //regex + number:literal, + 'boolean':literal + }, + DOMAttrs:{//attributes to dump from nodes, name=>realName + id:'id', + name:'name', + 'class':'className' + }, + HTML:false,//if true, entities are escaped ( <, >, \t, space and \n ) + indentChar:' ',//indentation unit + multiline:true //if true, items in a collection, are separated by a \n, else just a space. + }; + + return jsDump; +})(); + +// from Sizzle.js +function getText( elems ) { + var ret = "", elem; + + for ( var i = 0; elems[i]; i++ ) { + elem = elems[i]; + + // Get the text from text nodes and CDATA nodes + if ( elem.nodeType === 3 || elem.nodeType === 4 ) { + ret += elem.nodeValue; + + // Traverse everything else, except comment nodes + } else if ( elem.nodeType !== 8 ) { + ret += getText( elem.childNodes ); + } + } + + return ret; +}; + +//from jquery.js +function inArray( elem, array ) { + if ( array.indexOf ) { + return array.indexOf( elem ); + } + + for ( var i = 0, length = array.length; i < length; i++ ) { + if ( array[ i ] === elem ) { + return i; + } + } + + return -1; +} + +/* + * Javascript Diff Algorithm + * By John Resig (http://ejohn.org/) + * Modified by Chu Alan "sprite" + * + * Released under the MIT license. + * + * More Info: + * http://ejohn.org/projects/javascript-diff-algorithm/ + * + * Usage: QUnit.diff(expected, actual) + * + * QUnit.diff("the quick brown fox jumped over", "the quick fox jumps over") == "the quick brown fox jumped jumps over" + */ +QUnit.diff = (function() { + function diff(o, n) { + var ns = {}; + var os = {}; + + for (var i = 0; i < n.length; i++) { + if (ns[n[i]] == null) + ns[n[i]] = { + rows: [], + o: null + }; + ns[n[i]].rows.push(i); + } + + for (var i = 0; i < o.length; i++) { + if (os[o[i]] == null) + os[o[i]] = { + rows: [], + n: null + }; + os[o[i]].rows.push(i); + } + + for (var i in ns) { + if (ns[i].rows.length == 1 && typeof(os[i]) != "undefined" && os[i].rows.length == 1) { + n[ns[i].rows[0]] = { + text: n[ns[i].rows[0]], + row: os[i].rows[0] + }; + o[os[i].rows[0]] = { + text: o[os[i].rows[0]], + row: ns[i].rows[0] + }; + } + } + + for (var i = 0; i < n.length - 1; i++) { + if (n[i].text != null && n[i + 1].text == null && n[i].row + 1 < o.length && o[n[i].row + 1].text == null && + n[i + 1] == o[n[i].row + 1]) { + n[i + 1] = { + text: n[i + 1], + row: n[i].row + 1 + }; + o[n[i].row + 1] = { + text: o[n[i].row + 1], + row: i + 1 + }; + } + } + + for (var i = n.length - 1; i > 0; i--) { + if (n[i].text != null && n[i - 1].text == null && n[i].row > 0 && o[n[i].row - 1].text == null && + n[i - 1] == o[n[i].row - 1]) { + n[i - 1] = { + text: n[i - 1], + row: n[i].row - 1 + }; + o[n[i].row - 1] = { + text: o[n[i].row - 1], + row: i - 1 + }; + } + } + + return { + o: o, + n: n + }; + } + + return function(o, n) { + o = o.replace(/\s+$/, ''); + n = n.replace(/\s+$/, ''); + var out = diff(o == "" ? [] : o.split(/\s+/), n == "" ? [] : n.split(/\s+/)); + + var str = ""; + + var oSpace = o.match(/\s+/g); + if (oSpace == null) { + oSpace = [" "]; + } + else { + oSpace.push(" "); + } + var nSpace = n.match(/\s+/g); + if (nSpace == null) { + nSpace = [" "]; + } + else { + nSpace.push(" "); + } + + if (out.n.length == 0) { + for (var i = 0; i < out.o.length; i++) { + str += '' + out.o[i] + oSpace[i] + ""; + } + } + else { + if (out.n[0].text == null) { + for (n = 0; n < out.o.length && out.o[n].text == null; n++) { + str += '' + out.o[n] + oSpace[n] + ""; + } + } + + for (var i = 0; i < out.n.length; i++) { + if (out.n[i].text == null) { + str += '' + out.n[i] + nSpace[i] + ""; + } + else { + var pre = ""; + + for (n = out.n[i].row + 1; n < out.o.length && out.o[n].text == null; n++) { + pre += '' + out.o[n] + oSpace[n] + ""; + } + str += " " + out.n[i].text + nSpace[i] + pre; + } + } + } + + return str; + }; +})(); + +})(this); diff --git a/libs/js/jquery-mobile-1.1.0/external/r.js/dist/r.js b/libs/js/jquery-mobile-1.1.0/external/r.js/dist/r.js new file mode 100644 index 0000000..9741071 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/external/r.js/dist/r.js @@ -0,0 +1,9862 @@ +/** + * @license r.js 1.0.7+ Fri, 30 Mar 2012 00:24:35 GMT Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ + +/* + * This is a bootstrap script to allow running RequireJS in the command line + * in either a Java/Rhino or Node environment. It is modified by the top-level + * dist.js file to inject other files to completely enable this file. It is + * the shell of the r.js file. + */ + +/*jslint evil: true, nomen: true */ +/*global readFile: true, process: false, Packages: false, print: false, +console: false, java: false, module: false, requirejsVars */ + +var requirejs, require, define; +(function (console, args, readFileFunc) { + + var fileName, env, fs, vm, path, exec, rhinoContext, dir, nodeRequire, + nodeDefine, exists, reqMain, loadedOptimizedLib, + version = '1.0.7+ Fri, 30 Mar 2012 00:24:35 GMT', + jsSuffixRegExp = /\.js$/, + commandOption = '', + useLibLoaded = {}, + //Used by jslib/rhino/args.js + rhinoArgs = args, + readFile = typeof readFileFunc !== 'undefined' ? readFileFunc : null; + + function showHelp() { + console.log('See https://github.com/jrburke/r.js for usage.'); + } + + if (typeof Packages !== 'undefined') { + env = 'rhino'; + + fileName = args[0]; + + if (fileName && fileName.indexOf('-') === 0) { + commandOption = fileName.substring(1); + fileName = args[1]; + } + + //Set up execution context. + rhinoContext = Packages.org.mozilla.javascript.ContextFactory.getGlobal().enterContext(); + + exec = function (string, name) { + return rhinoContext.evaluateString(this, string, name, 0, null); + }; + + exists = function (fileName) { + return (new java.io.File(fileName)).exists(); + }; + + //Define a console.log for easier logging. Don't + //get fancy though. + if (typeof console === 'undefined') { + console = { + log: function () { + print.apply(undefined, arguments); + } + }; + } + } else if (typeof process !== 'undefined') { + env = 'node'; + + //Get the fs module via Node's require before it + //gets replaced. Used in require/node.js + fs = require('fs'); + vm = require('vm'); + path = require('path'); + nodeRequire = require; + nodeDefine = define; + reqMain = require.main; + + //Temporarily hide require and define to allow require.js to define + //them. + require = undefined; + define = undefined; + + readFile = function (path) { + return fs.readFileSync(path, 'utf8'); + }; + + exec = function (string, name) { + return vm.runInThisContext(this.requirejsVars.require.makeNodeWrapper(string), + name ? fs.realpathSync(name) : ''); + }; + + exists = function (fileName) { + return path.existsSync(fileName); + }; + + + fileName = process.argv[2]; + + if (fileName && fileName.indexOf('-') === 0) { + commandOption = fileName.substring(1); + fileName = process.argv[3]; + } + } + + /** vim: et:ts=4:sw=4:sts=4 + * @license RequireJS 1.0.7 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ +/*jslint strict: false, plusplus: false, sub: true */ +/*global window, navigator, document, importScripts, jQuery, setTimeout, opera */ + + +(function () { + //Change this version number for each release. + var version = "1.0.7", + commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg, + cjsRequireRegExp = /require\(\s*["']([^'"\s]+)["']\s*\)/g, + currDirRegExp = /^\.\//, + jsSuffixRegExp = /\.js$/, + ostring = Object.prototype.toString, + ap = Array.prototype, + aps = ap.slice, + apsp = ap.splice, + isBrowser = !!(typeof window !== "undefined" && navigator && document), + isWebWorker = !isBrowser && typeof importScripts !== "undefined", + //PS3 indicates loaded and complete, but need to wait for complete + //specifically. Sequence is "loading", "loaded", execution, + // then "complete". The UA check is unfortunate, but not sure how + //to feature test w/o causing perf issues. + readyRegExp = isBrowser && navigator.platform === 'PLAYSTATION 3' ? + /^complete$/ : /^(complete|loaded)$/, + defContextName = "_", + //Oh the tragedy, detecting opera. See the usage of isOpera for reason. + isOpera = typeof opera !== "undefined" && opera.toString() === "[object Opera]", + empty = {}, + contexts = {}, + globalDefQueue = [], + interactiveScript = null, + checkLoadedDepth = 0, + useInteractive = false, + reservedDependencies = { + require: true, + module: true, + exports: true + }, + req, cfg = {}, currentlyAddingScript, s, head, baseElement, scripts, script, + src, subPath, mainScript, dataMain, globalI, ctx, jQueryCheck, checkLoadedTimeoutId; + + function isFunction(it) { + return ostring.call(it) === "[object Function]"; + } + + function isArray(it) { + return ostring.call(it) === "[object Array]"; + } + + /** + * Simple function to mix in properties from source into target, + * but only if target does not already have a property of the same name. + * This is not robust in IE for transferring methods that match + * Object.prototype names, but the uses of mixin here seem unlikely to + * trigger a problem related to that. + */ + function mixin(target, source, force) { + for (var prop in source) { + if (!(prop in empty) && (!(prop in target) || force)) { + target[prop] = source[prop]; + } + } + return req; + } + + /** + * Constructs an error with a pointer to an URL with more information. + * @param {String} id the error ID that maps to an ID on a web page. + * @param {String} message human readable error. + * @param {Error} [err] the original error, if there is one. + * + * @returns {Error} + */ + function makeError(id, msg, err) { + var e = new Error(msg + '\nhttp://requirejs.org/docs/errors.html#' + id); + if (err) { + e.originalError = err; + } + return e; + } + + /** + * Used to set up package paths from a packagePaths or packages config object. + * @param {Object} pkgs the object to store the new package config + * @param {Array} currentPackages an array of packages to configure + * @param {String} [dir] a prefix dir to use. + */ + function configurePackageDir(pkgs, currentPackages, dir) { + var i, location, pkgObj; + + for (i = 0; (pkgObj = currentPackages[i]); i++) { + pkgObj = typeof pkgObj === "string" ? { name: pkgObj } : pkgObj; + location = pkgObj.location; + + //Add dir to the path, but avoid paths that start with a slash + //or have a colon (indicates a protocol) + if (dir && (!location || (location.indexOf("/") !== 0 && location.indexOf(":") === -1))) { + location = dir + "/" + (location || pkgObj.name); + } + + //Create a brand new object on pkgs, since currentPackages can + //be passed in again, and config.pkgs is the internal transformed + //state for all package configs. + pkgs[pkgObj.name] = { + name: pkgObj.name, + location: location || pkgObj.name, + //Remove leading dot in main, so main paths are normalized, + //and remove any trailing .js, since different package + //envs have different conventions: some use a module name, + //some use a file name. + main: (pkgObj.main || "main") + .replace(currDirRegExp, '') + .replace(jsSuffixRegExp, '') + }; + } + } + + /** + * jQuery 1.4.3-1.5.x use a readyWait/ready() pairing to hold DOM + * ready callbacks, but jQuery 1.6 supports a holdReady() API instead. + * At some point remove the readyWait/ready() support and just stick + * with using holdReady. + */ + function jQueryHoldReady($, shouldHold) { + if ($.holdReady) { + $.holdReady(shouldHold); + } else if (shouldHold) { + $.readyWait += 1; + } else { + $.ready(true); + } + } + + if (typeof define !== "undefined") { + //If a define is already in play via another AMD loader, + //do not overwrite. + return; + } + + if (typeof requirejs !== "undefined") { + if (isFunction(requirejs)) { + //Do not overwrite and existing requirejs instance. + return; + } else { + cfg = requirejs; + requirejs = undefined; + } + } + + //Allow for a require config object + if (typeof require !== "undefined" && !isFunction(require)) { + //assume it is a config object. + cfg = require; + require = undefined; + } + + /** + * Creates a new context for use in require and define calls. + * Handle most of the heavy lifting. Do not want to use an object + * with prototype here to avoid using "this" in require, in case it + * needs to be used in more super secure envs that do not want this. + * Also there should not be that many contexts in the page. Usually just + * one for the default context, but could be extra for multiversion cases + * or if a package needs a special context for a dependency that conflicts + * with the standard context. + */ + function newContext(contextName) { + var context, resume, + config = { + waitSeconds: 7, + baseUrl: "./", + paths: {}, + pkgs: {}, + catchError: {} + }, + defQueue = [], + specified = { + "require": true, + "exports": true, + "module": true + }, + urlMap = {}, + defined = {}, + loaded = {}, + waiting = {}, + waitAry = [], + urlFetched = {}, + managerCounter = 0, + managerCallbacks = {}, + plugins = {}, + //Used to indicate which modules in a build scenario + //need to be full executed. + needFullExec = {}, + fullExec = {}, + resumeDepth = 0; + + /** + * Trims the . and .. from an array of path segments. + * It will keep a leading path segment if a .. will become + * the first path segment, to help with module name lookups, + * which act like paths, but can be remapped. But the end result, + * all paths that use this function should look normalized. + * NOTE: this method MODIFIES the input array. + * @param {Array} ary the array of path segments. + */ + function trimDots(ary) { + var i, part; + for (i = 0; (part = ary[i]); i++) { + if (part === ".") { + ary.splice(i, 1); + i -= 1; + } else if (part === "..") { + if (i === 1 && (ary[2] === '..' || ary[0] === '..')) { + //End of the line. Keep at least one non-dot + //path segment at the front so it can be mapped + //correctly to disk. Otherwise, there is likely + //no path mapping for a path starting with '..'. + //This can still fail, but catches the most reasonable + //uses of .. + break; + } else if (i > 0) { + ary.splice(i - 1, 2); + i -= 2; + } + } + } + } + + /** + * Given a relative module name, like ./something, normalize it to + * a real name that can be mapped to a path. + * @param {String} name the relative name + * @param {String} baseName a real name that the name arg is relative + * to. + * @returns {String} normalized name + */ + function normalize(name, baseName) { + var pkgName, pkgConfig; + + //Adjust any relative paths. + if (name && name.charAt(0) === ".") { + //If have a base name, try to normalize against it, + //otherwise, assume it is a top-level require that will + //be relative to baseUrl in the end. + if (baseName) { + if (config.pkgs[baseName]) { + //If the baseName is a package name, then just treat it as one + //name to concat the name with. + baseName = [baseName]; + } else { + //Convert baseName to array, and lop off the last part, + //so that . matches that "directory" and not name of the baseName's + //module. For instance, baseName of "one/two/three", maps to + //"one/two/three.js", but we want the directory, "one/two" for + //this normalization. + baseName = baseName.split("/"); + baseName = baseName.slice(0, baseName.length - 1); + } + + name = baseName.concat(name.split("/")); + trimDots(name); + + //Some use of packages may use a . path to reference the + //"main" module name, so normalize for that. + pkgConfig = config.pkgs[(pkgName = name[0])]; + name = name.join("/"); + if (pkgConfig && name === pkgName + '/' + pkgConfig.main) { + name = pkgName; + } + } else if (name.indexOf("./") === 0) { + // No baseName, so this is ID is resolved relative + // to baseUrl, pull off the leading dot. + name = name.substring(2); + } + } + return name; + } + + /** + * Creates a module mapping that includes plugin prefix, module + * name, and path. If parentModuleMap is provided it will + * also normalize the name via require.normalize() + * + * @param {String} name the module name + * @param {String} [parentModuleMap] parent module map + * for the module name, used to resolve relative names. + * + * @returns {Object} + */ + function makeModuleMap(name, parentModuleMap) { + var index = name ? name.indexOf("!") : -1, + prefix = null, + parentName = parentModuleMap ? parentModuleMap.name : null, + originalName = name, + normalizedName, url, pluginModule; + + if (index !== -1) { + prefix = name.substring(0, index); + name = name.substring(index + 1, name.length); + } + + if (prefix) { + prefix = normalize(prefix, parentName); + } + + //Account for relative paths if there is a base name. + if (name) { + if (prefix) { + pluginModule = defined[prefix]; + if (pluginModule && pluginModule.normalize) { + //Plugin is loaded, use its normalize method. + normalizedName = pluginModule.normalize(name, function (name) { + return normalize(name, parentName); + }); + } else { + normalizedName = normalize(name, parentName); + } + } else { + //A regular module. + normalizedName = normalize(name, parentName); + + url = urlMap[normalizedName]; + if (!url) { + //Calculate url for the module, if it has a name. + //Use name here since nameToUrl also calls normalize, + //and for relative names that are outside the baseUrl + //this causes havoc. Was thinking of just removing + //parentModuleMap to avoid extra normalization, but + //normalize() still does a dot removal because of + //issue #142, so just pass in name here and redo + //the normalization. Paths outside baseUrl are just + //messy to support. + url = context.nameToUrl(name, null, parentModuleMap); + + //Store the URL mapping for later. + urlMap[normalizedName] = url; + } + } + } + + return { + prefix: prefix, + name: normalizedName, + parentMap: parentModuleMap, + url: url, + originalName: originalName, + fullName: prefix ? prefix + "!" + (normalizedName || '') : normalizedName + }; + } + + /** + * Determine if priority loading is done. If so clear the priorityWait + */ + function isPriorityDone() { + var priorityDone = true, + priorityWait = config.priorityWait, + priorityName, i; + if (priorityWait) { + for (i = 0; (priorityName = priorityWait[i]); i++) { + if (!loaded[priorityName]) { + priorityDone = false; + break; + } + } + if (priorityDone) { + delete config.priorityWait; + } + } + return priorityDone; + } + + function makeContextModuleFunc(func, relModuleMap, enableBuildCallback) { + return function () { + //A version of a require function that passes a moduleName + //value for items that may need to + //look up paths relative to the moduleName + var args = aps.call(arguments, 0), lastArg; + if (enableBuildCallback && + isFunction((lastArg = args[args.length - 1]))) { + lastArg.__requireJsBuild = true; + } + args.push(relModuleMap); + return func.apply(null, args); + }; + } + + /** + * Helper function that creates a require function object to give to + * modules that ask for it as a dependency. It needs to be specific + * per module because of the implication of path mappings that may + * need to be relative to the module name. + */ + function makeRequire(relModuleMap, enableBuildCallback, altRequire) { + var modRequire = makeContextModuleFunc(altRequire || context.require, relModuleMap, enableBuildCallback); + + mixin(modRequire, { + nameToUrl: makeContextModuleFunc(context.nameToUrl, relModuleMap), + toUrl: makeContextModuleFunc(context.toUrl, relModuleMap), + defined: makeContextModuleFunc(context.requireDefined, relModuleMap), + specified: makeContextModuleFunc(context.requireSpecified, relModuleMap), + isBrowser: req.isBrowser + }); + return modRequire; + } + + /* + * Queues a dependency for checking after the loader is out of a + * "paused" state, for example while a script file is being loaded + * in the browser, where it may have many modules defined in it. + */ + function queueDependency(manager) { + context.paused.push(manager); + } + + function execManager(manager) { + var i, ret, err, errFile, errModuleTree, + cb = manager.callback, + map = manager.map, + fullName = map.fullName, + args = manager.deps, + listeners = manager.listeners, + execCb = config.requireExecCb || req.execCb, + cjsModule; + + //Call the callback to define the module, if necessary. + if (cb && isFunction(cb)) { + if (config.catchError.define) { + try { + ret = execCb(fullName, manager.callback, args, defined[fullName]); + } catch (e) { + err = e; + } + } else { + ret = execCb(fullName, manager.callback, args, defined[fullName]); + } + + if (fullName) { + //If setting exports via "module" is in play, + //favor that over return value and exports. After that, + //favor a non-undefined return value over exports use. + cjsModule = manager.cjsModule; + if (cjsModule && + cjsModule.exports !== undefined && + //Make sure it is not already the exports value + cjsModule.exports !== defined[fullName]) { + ret = defined[fullName] = manager.cjsModule.exports; + } else if (ret === undefined && manager.usingExports) { + //exports already set the defined value. + ret = defined[fullName]; + } else { + //Use the return value from the function. + defined[fullName] = ret; + //If this module needed full execution in a build + //environment, mark that now. + if (needFullExec[fullName]) { + fullExec[fullName] = true; + } + } + } + } else if (fullName) { + //May just be an object definition for the module. Only + //worry about defining if have a module name. + ret = defined[fullName] = cb; + + //If this module needed full execution in a build + //environment, mark that now. + if (needFullExec[fullName]) { + fullExec[fullName] = true; + } + } + + //Clean up waiting. Do this before error calls, and before + //calling back listeners, so that bookkeeping is correct + //in the event of an error and error is reported in correct order, + //since the listeners will likely have errors if the + //onError function does not throw. + if (waiting[manager.id]) { + delete waiting[manager.id]; + manager.isDone = true; + context.waitCount -= 1; + if (context.waitCount === 0) { + //Clear the wait array used for cycles. + waitAry = []; + } + } + + //Do not need to track manager callback now that it is defined. + delete managerCallbacks[fullName]; + + //Allow instrumentation like the optimizer to know the order + //of modules executed and their dependencies. + if (req.onResourceLoad && !manager.placeholder) { + req.onResourceLoad(context, map, manager.depArray); + } + + if (err) { + errFile = (fullName ? makeModuleMap(fullName).url : '') || + err.fileName || err.sourceURL; + errModuleTree = err.moduleTree; + err = makeError('defineerror', 'Error evaluating ' + + 'module "' + fullName + '" at location "' + + errFile + '":\n' + + err + '\nfileName:' + errFile + + '\nlineNumber: ' + (err.lineNumber || err.line), err); + err.moduleName = fullName; + err.moduleTree = errModuleTree; + return req.onError(err); + } + + //Let listeners know of this manager's value. + for (i = 0; (cb = listeners[i]); i++) { + cb(ret); + } + + return undefined; + } + + /** + * Helper that creates a callack function that is called when a dependency + * is ready, and sets the i-th dependency for the manager as the + * value passed to the callback generated by this function. + */ + function makeArgCallback(manager, i) { + return function (value) { + //Only do the work if it has not been done + //already for a dependency. Cycle breaking + //logic in forceExec could mean this function + //is called more than once for a given dependency. + if (!manager.depDone[i]) { + manager.depDone[i] = true; + manager.deps[i] = value; + manager.depCount -= 1; + if (!manager.depCount) { + //All done, execute! + execManager(manager); + } + } + }; + } + + function callPlugin(pluginName, depManager) { + var map = depManager.map, + fullName = map.fullName, + name = map.name, + plugin = plugins[pluginName] || + (plugins[pluginName] = defined[pluginName]), + load; + + //No need to continue if the manager is already + //in the process of loading. + if (depManager.loading) { + return; + } + depManager.loading = true; + + load = function (ret) { + depManager.callback = function () { + return ret; + }; + execManager(depManager); + + loaded[depManager.id] = true; + + //The loading of this plugin + //might have placed other things + //in the paused queue. In particular, + //a loader plugin that depends on + //a different plugin loaded resource. + resume(); + }; + + //Allow plugins to load other code without having to know the + //context or how to "complete" the load. + load.fromText = function (moduleName, text) { + /*jslint evil: true */ + var hasInteractive = useInteractive; + + //Indicate a the module is in process of loading. + loaded[moduleName] = false; + context.scriptCount += 1; + + //Indicate this is not a "real" module, so do not track it + //for builds, it does not map to a real file. + context.fake[moduleName] = true; + + //Turn off interactive script matching for IE for any define + //calls in the text, then turn it back on at the end. + if (hasInteractive) { + useInteractive = false; + } + + req.exec(text); + + if (hasInteractive) { + useInteractive = true; + } + + //Support anonymous modules. + context.completeLoad(moduleName); + }; + + //No need to continue if the plugin value has already been + //defined by a build. + if (fullName in defined) { + load(defined[fullName]); + } else { + //Use parentName here since the plugin's name is not reliable, + //could be some weird string with no path that actually wants to + //reference the parentName's path. + plugin.load(name, makeRequire(map.parentMap, true, function (deps, cb) { + var moduleDeps = [], + i, dep, depMap; + //Convert deps to full names and hold on to them + //for reference later, when figuring out if they + //are blocked by a circular dependency. + for (i = 0; (dep = deps[i]); i++) { + depMap = makeModuleMap(dep, map.parentMap); + deps[i] = depMap.fullName; + if (!depMap.prefix) { + moduleDeps.push(deps[i]); + } + } + depManager.moduleDeps = (depManager.moduleDeps || []).concat(moduleDeps); + return context.require(deps, cb); + }), load, config); + } + } + + /** + * Adds the manager to the waiting queue. Only fully + * resolved items should be in the waiting queue. + */ + function addWait(manager) { + if (!waiting[manager.id]) { + waiting[manager.id] = manager; + waitAry.push(manager); + context.waitCount += 1; + } + } + + /** + * Function added to every manager object. Created out here + * to avoid new function creation for each manager instance. + */ + function managerAdd(cb) { + this.listeners.push(cb); + } + + function getManager(map, shouldQueue) { + var fullName = map.fullName, + prefix = map.prefix, + plugin = prefix ? plugins[prefix] || + (plugins[prefix] = defined[prefix]) : null, + manager, created, pluginManager, prefixMap; + + if (fullName) { + manager = managerCallbacks[fullName]; + } + + if (!manager) { + created = true; + manager = { + //ID is just the full name, but if it is a plugin resource + //for a plugin that has not been loaded, + //then add an ID counter to it. + id: (prefix && !plugin ? + (managerCounter++) + '__p@:' : '') + + (fullName || '__r@' + (managerCounter++)), + map: map, + depCount: 0, + depDone: [], + depCallbacks: [], + deps: [], + listeners: [], + add: managerAdd + }; + + specified[manager.id] = true; + + //Only track the manager/reuse it if this is a non-plugin + //resource. Also only track plugin resources once + //the plugin has been loaded, and so the fullName is the + //true normalized value. + if (fullName && (!prefix || plugins[prefix])) { + managerCallbacks[fullName] = manager; + } + } + + //If there is a plugin needed, but it is not loaded, + //first load the plugin, then continue on. + if (prefix && !plugin) { + prefixMap = makeModuleMap(prefix); + + //Clear out defined and urlFetched if the plugin was previously + //loaded/defined, but not as full module (as in a build + //situation). However, only do this work if the plugin is in + //defined but does not have a module export value. + if (prefix in defined && !defined[prefix]) { + delete defined[prefix]; + delete urlFetched[prefixMap.url]; + } + + pluginManager = getManager(prefixMap, true); + pluginManager.add(function (plugin) { + //Create a new manager for the normalized + //resource ID and have it call this manager when + //done. + var newMap = makeModuleMap(map.originalName, map.parentMap), + normalizedManager = getManager(newMap, true); + + //Indicate this manager is a placeholder for the real, + //normalized thing. Important for when trying to map + //modules and dependencies, for instance, in a build. + manager.placeholder = true; + + normalizedManager.add(function (resource) { + manager.callback = function () { + return resource; + }; + execManager(manager); + }); + }); + } else if (created && shouldQueue) { + //Indicate the resource is not loaded yet if it is to be + //queued. + loaded[manager.id] = false; + queueDependency(manager); + addWait(manager); + } + + return manager; + } + + function main(inName, depArray, callback, relModuleMap) { + var moduleMap = makeModuleMap(inName, relModuleMap), + name = moduleMap.name, + fullName = moduleMap.fullName, + manager = getManager(moduleMap), + id = manager.id, + deps = manager.deps, + i, depArg, depName, depPrefix, cjsMod; + + if (fullName) { + //If module already defined for context, or already loaded, + //then leave. Also leave if jQuery is registering but it does + //not match the desired version number in the config. + if (fullName in defined || loaded[id] === true || + (fullName === "jquery" && config.jQuery && + config.jQuery !== callback().fn.jquery)) { + return; + } + + //Set specified/loaded here for modules that are also loaded + //as part of a layer, where onScriptLoad is not fired + //for those cases. Do this after the inline define and + //dependency tracing is done. + specified[id] = true; + loaded[id] = true; + + //If module is jQuery set up delaying its dom ready listeners. + if (fullName === "jquery" && callback) { + jQueryCheck(callback()); + } + } + + //Attach real depArray and callback to the manager. Do this + //only if the module has not been defined already, so do this after + //the fullName checks above. IE can call main() more than once + //for a module. + manager.depArray = depArray; + manager.callback = callback; + + //Add the dependencies to the deps field, and register for callbacks + //on the dependencies. + for (i = 0; i < depArray.length; i++) { + depArg = depArray[i]; + //There could be cases like in IE, where a trailing comma will + //introduce a null dependency, so only treat a real dependency + //value as a dependency. + if (depArg) { + //Split the dependency name into plugin and name parts + depArg = makeModuleMap(depArg, (name ? moduleMap : relModuleMap)); + depName = depArg.fullName; + depPrefix = depArg.prefix; + + //Fix the name in depArray to be just the name, since + //that is how it will be called back later. + depArray[i] = depName; + + //Fast path CommonJS standard dependencies. + if (depName === "require") { + deps[i] = makeRequire(moduleMap); + } else if (depName === "exports") { + //CommonJS module spec 1.1 + deps[i] = defined[fullName] = {}; + manager.usingExports = true; + } else if (depName === "module") { + //CommonJS module spec 1.1 + manager.cjsModule = cjsMod = deps[i] = { + id: name, + uri: name ? context.nameToUrl(name, null, relModuleMap) : undefined, + exports: defined[fullName] + }; + } else if (depName in defined && !(depName in waiting) && + (!(fullName in needFullExec) || + (fullName in needFullExec && fullExec[depName]))) { + //Module already defined, and not in a build situation + //where the module is a something that needs full + //execution and this dependency has not been fully + //executed. See r.js's requirePatch.js for more info + //on fullExec. + deps[i] = defined[depName]; + } else { + //Mark this dependency as needing full exec if + //the current module needs full exec. + if (fullName in needFullExec) { + needFullExec[depName] = true; + //Reset state so fully executed code will get + //picked up correctly. + delete defined[depName]; + urlFetched[depArg.url] = false; + } + + //Either a resource that is not loaded yet, or a plugin + //resource for either a plugin that has not + //loaded yet. + manager.depCount += 1; + manager.depCallbacks[i] = makeArgCallback(manager, i); + getManager(depArg, true).add(manager.depCallbacks[i]); + } + } + } + + //Do not bother tracking the manager if it is all done. + if (!manager.depCount) { + //All done, execute! + execManager(manager); + } else { + addWait(manager); + } + } + + /** + * Convenience method to call main for a define call that was put on + * hold in the defQueue. + */ + function callDefMain(args) { + main.apply(null, args); + } + + /** + * jQuery 1.4.3+ supports ways to hold off calling + * calling jQuery ready callbacks until all scripts are loaded. Be sure + * to track it if the capability exists.. Also, since jQuery 1.4.3 does + * not register as a module, need to do some global inference checking. + * Even if it does register as a module, not guaranteed to be the precise + * name of the global. If a jQuery is tracked for this context, then go + * ahead and register it as a module too, if not already in process. + */ + jQueryCheck = function (jqCandidate) { + if (!context.jQuery) { + var $ = jqCandidate || (typeof jQuery !== "undefined" ? jQuery : null); + + if ($) { + //If a specific version of jQuery is wanted, make sure to only + //use this jQuery if it matches. + if (config.jQuery && $.fn.jquery !== config.jQuery) { + return; + } + + if ("holdReady" in $ || "readyWait" in $) { + context.jQuery = $; + + //Manually create a "jquery" module entry if not one already + //or in process. Note this could trigger an attempt at + //a second jQuery registration, but does no harm since + //the first one wins, and it is the same value anyway. + callDefMain(["jquery", [], function () { + return jQuery; + }]); + + //Ask jQuery to hold DOM ready callbacks. + if (context.scriptCount) { + jQueryHoldReady($, true); + context.jQueryIncremented = true; + } + } + } + } + }; + + function findCycle(manager, traced) { + var fullName = manager.map.fullName, + depArray = manager.depArray, + fullyLoaded = true, + i, depName, depManager, result; + + if (manager.isDone || !fullName || !loaded[fullName]) { + return result; + } + + //Found the cycle. + if (traced[fullName]) { + return manager; + } + + traced[fullName] = true; + + //Trace through the dependencies. + if (depArray) { + for (i = 0; i < depArray.length; i++) { + //Some array members may be null, like if a trailing comma + //IE, so do the explicit [i] access and check if it has a value. + depName = depArray[i]; + if (!loaded[depName] && !reservedDependencies[depName]) { + fullyLoaded = false; + break; + } + depManager = waiting[depName]; + if (depManager && !depManager.isDone && loaded[depName]) { + result = findCycle(depManager, traced); + if (result) { + break; + } + } + } + if (!fullyLoaded) { + //Discard the cycle that was found, since it cannot + //be forced yet. Also clear this module from traced. + result = undefined; + delete traced[fullName]; + } + } + + return result; + } + + function forceExec(manager, traced) { + var fullName = manager.map.fullName, + depArray = manager.depArray, + i, depName, depManager, prefix, prefixManager, value; + + + if (manager.isDone || !fullName || !loaded[fullName]) { + return undefined; + } + + if (fullName) { + if (traced[fullName]) { + return defined[fullName]; + } + + traced[fullName] = true; + } + + //Trace through the dependencies. + if (depArray) { + for (i = 0; i < depArray.length; i++) { + //Some array members may be null, like if a trailing comma + //IE, so do the explicit [i] access and check if it has a value. + depName = depArray[i]; + if (depName) { + //First, make sure if it is a plugin resource that the + //plugin is not blocked. + prefix = makeModuleMap(depName).prefix; + if (prefix && (prefixManager = waiting[prefix])) { + forceExec(prefixManager, traced); + } + depManager = waiting[depName]; + if (depManager && !depManager.isDone && loaded[depName]) { + value = forceExec(depManager, traced); + manager.depCallbacks[i](value); + } + } + } + } + + return defined[fullName]; + } + + /** + * Checks if all modules for a context are loaded, and if so, evaluates the + * new ones in right dependency order. + * + * @private + */ + function checkLoaded() { + var waitInterval = config.waitSeconds * 1000, + //It is possible to disable the wait interval by using waitSeconds of 0. + expired = waitInterval && (context.startTime + waitInterval) < new Date().getTime(), + noLoads = "", hasLoadedProp = false, stillLoading = false, + cycleDeps = [], + i, prop, err, manager, cycleManager, moduleDeps; + + //If there are items still in the paused queue processing wait. + //This is particularly important in the sync case where each paused + //item is processed right away but there may be more waiting. + if (context.pausedCount > 0) { + return undefined; + } + + //Determine if priority loading is done. If so clear the priority. If + //not, then do not check + if (config.priorityWait) { + if (isPriorityDone()) { + //Call resume, since it could have + //some waiting dependencies to trace. + resume(); + } else { + return undefined; + } + } + + //See if anything is still in flight. + for (prop in loaded) { + if (!(prop in empty)) { + hasLoadedProp = true; + if (!loaded[prop]) { + if (expired) { + noLoads += prop + " "; + } else { + stillLoading = true; + if (prop.indexOf('!') === -1) { + //No reason to keep looking for unfinished + //loading. If the only stillLoading is a + //plugin resource though, keep going, + //because it may be that a plugin resource + //is waiting on a non-plugin cycle. + cycleDeps = []; + break; + } else { + moduleDeps = managerCallbacks[prop] && managerCallbacks[prop].moduleDeps; + if (moduleDeps) { + cycleDeps.push.apply(cycleDeps, moduleDeps); + } + } + } + } + } + } + + //Check for exit conditions. + if (!hasLoadedProp && !context.waitCount) { + //If the loaded object had no items, then the rest of + //the work below does not need to be done. + return undefined; + } + if (expired && noLoads) { + //If wait time expired, throw error of unloaded modules. + err = makeError("timeout", "Load timeout for modules: " + noLoads); + err.requireType = "timeout"; + err.requireModules = noLoads; + err.contextName = context.contextName; + return req.onError(err); + } + + //If still loading but a plugin is waiting on a regular module cycle + //break the cycle. + if (stillLoading && cycleDeps.length) { + for (i = 0; (manager = waiting[cycleDeps[i]]); i++) { + if ((cycleManager = findCycle(manager, {}))) { + forceExec(cycleManager, {}); + break; + } + } + + } + + //If still waiting on loads, and the waiting load is something + //other than a plugin resource, or there are still outstanding + //scripts, then just try back later. + if (!expired && (stillLoading || context.scriptCount)) { + //Something is still waiting to load. Wait for it, but only + //if a timeout is not already in effect. + if ((isBrowser || isWebWorker) && !checkLoadedTimeoutId) { + checkLoadedTimeoutId = setTimeout(function () { + checkLoadedTimeoutId = 0; + checkLoaded(); + }, 50); + } + return undefined; + } + + //If still have items in the waiting cue, but all modules have + //been loaded, then it means there are some circular dependencies + //that need to be broken. + //However, as a waiting thing is fired, then it can add items to + //the waiting cue, and those items should not be fired yet, so + //make sure to redo the checkLoaded call after breaking a single + //cycle, if nothing else loaded then this logic will pick it up + //again. + if (context.waitCount) { + //Cycle through the waitAry, and call items in sequence. + for (i = 0; (manager = waitAry[i]); i++) { + forceExec(manager, {}); + } + + //If anything got placed in the paused queue, run it down. + if (context.paused.length) { + resume(); + } + + //Only allow this recursion to a certain depth. Only + //triggered by errors in calling a module in which its + //modules waiting on it cannot finish loading, or some circular + //dependencies that then may add more dependencies. + //The value of 5 is a bit arbitrary. Hopefully just one extra + //pass, or two for the case of circular dependencies generating + //more work that gets resolved in the sync node case. + if (checkLoadedDepth < 5) { + checkLoadedDepth += 1; + checkLoaded(); + } + } + + checkLoadedDepth = 0; + + //Check for DOM ready, and nothing is waiting across contexts. + req.checkReadyState(); + + return undefined; + } + + /** + * Resumes tracing of dependencies and then checks if everything is loaded. + */ + resume = function () { + var manager, map, url, i, p, args, fullName; + + //Any defined modules in the global queue, intake them now. + context.takeGlobalQueue(); + + resumeDepth += 1; + + if (context.scriptCount <= 0) { + //Synchronous envs will push the number below zero with the + //decrement above, be sure to set it back to zero for good measure. + //require() calls that also do not end up loading scripts could + //push the number negative too. + context.scriptCount = 0; + } + + //Make sure any remaining defQueue items get properly processed. + while (defQueue.length) { + args = defQueue.shift(); + if (args[0] === null) { + return req.onError(makeError('mismatch', 'Mismatched anonymous define() module: ' + args[args.length - 1])); + } else { + callDefMain(args); + } + } + + //Skip the resume of paused dependencies + //if current context is in priority wait. + if (!config.priorityWait || isPriorityDone()) { + while (context.paused.length) { + p = context.paused; + context.pausedCount += p.length; + //Reset paused list + context.paused = []; + + for (i = 0; (manager = p[i]); i++) { + map = manager.map; + url = map.url; + fullName = map.fullName; + + //If the manager is for a plugin managed resource, + //ask the plugin to load it now. + if (map.prefix) { + callPlugin(map.prefix, manager); + } else { + //Regular dependency. + if (!urlFetched[url] && !loaded[fullName]) { + (config.requireLoad || req.load)(context, fullName, url); + + //Mark the URL as fetched, but only if it is + //not an empty: URL, used by the optimizer. + //In that case we need to be sure to call + //load() for each module that is mapped to + //empty: so that dependencies are satisfied + //correctly. + if (url.indexOf('empty:') !== 0) { + urlFetched[url] = true; + } + } + } + } + + //Move the start time for timeout forward. + context.startTime = (new Date()).getTime(); + context.pausedCount -= p.length; + } + } + + //Only check if loaded when resume depth is 1. It is likely that + //it is only greater than 1 in sync environments where a factory + //function also then calls the callback-style require. In those + //cases, the checkLoaded should not occur until the resume + //depth is back at the top level. + if (resumeDepth === 1) { + checkLoaded(); + } + + resumeDepth -= 1; + + return undefined; + }; + + //Define the context object. Many of these fields are on here + //just to make debugging easier. + context = { + contextName: contextName, + config: config, + defQueue: defQueue, + waiting: waiting, + waitCount: 0, + specified: specified, + loaded: loaded, + urlMap: urlMap, + urlFetched: urlFetched, + scriptCount: 0, + defined: defined, + paused: [], + pausedCount: 0, + plugins: plugins, + needFullExec: needFullExec, + fake: {}, + fullExec: fullExec, + managerCallbacks: managerCallbacks, + makeModuleMap: makeModuleMap, + normalize: normalize, + /** + * Set a configuration for the context. + * @param {Object} cfg config object to integrate. + */ + configure: function (cfg) { + var paths, prop, packages, pkgs, packagePaths, requireWait; + + //Make sure the baseUrl ends in a slash. + if (cfg.baseUrl) { + if (cfg.baseUrl.charAt(cfg.baseUrl.length - 1) !== "/") { + cfg.baseUrl += "/"; + } + } + + //Save off the paths and packages since they require special processing, + //they are additive. + paths = config.paths; + packages = config.packages; + pkgs = config.pkgs; + + //Mix in the config values, favoring the new values over + //existing ones in context.config. + mixin(config, cfg, true); + + //Adjust paths if necessary. + if (cfg.paths) { + for (prop in cfg.paths) { + if (!(prop in empty)) { + paths[prop] = cfg.paths[prop]; + } + } + config.paths = paths; + } + + packagePaths = cfg.packagePaths; + if (packagePaths || cfg.packages) { + //Convert packagePaths into a packages config. + if (packagePaths) { + for (prop in packagePaths) { + if (!(prop in empty)) { + configurePackageDir(pkgs, packagePaths[prop], prop); + } + } + } + + //Adjust packages if necessary. + if (cfg.packages) { + configurePackageDir(pkgs, cfg.packages); + } + + //Done with modifications, assing packages back to context config + config.pkgs = pkgs; + } + + //If priority loading is in effect, trigger the loads now + if (cfg.priority) { + //Hold on to requireWait value, and reset it after done + requireWait = context.requireWait; + + //Allow tracing some require calls to allow the fetching + //of the priority config. + context.requireWait = false; + //But first, call resume to register any defined modules that may + //be in a data-main built file before the priority config + //call. + resume(); + + context.require(cfg.priority); + + //Trigger a resume right away, for the case when + //the script with the priority load is done as part + //of a data-main call. In that case the normal resume + //call will not happen because the scriptCount will be + //at 1, since the script for data-main is being processed. + resume(); + + //Restore previous state. + context.requireWait = requireWait; + config.priorityWait = cfg.priority; + } + + //If a deps array or a config callback is specified, then call + //require with those args. This is useful when require is defined as a + //config object before require.js is loaded. + if (cfg.deps || cfg.callback) { + context.require(cfg.deps || [], cfg.callback); + } + }, + + requireDefined: function (moduleName, relModuleMap) { + return makeModuleMap(moduleName, relModuleMap).fullName in defined; + }, + + requireSpecified: function (moduleName, relModuleMap) { + return makeModuleMap(moduleName, relModuleMap).fullName in specified; + }, + + require: function (deps, callback, relModuleMap) { + var moduleName, fullName, moduleMap; + if (typeof deps === "string") { + if (isFunction(callback)) { + //Invalid call + return req.onError(makeError("requireargs", "Invalid require call")); + } + + //Synchronous access to one module. If require.get is + //available (as in the Node adapter), prefer that. + //In this case deps is the moduleName and callback is + //the relModuleMap + if (req.get) { + return req.get(context, deps, callback); + } + + //Just return the module wanted. In this scenario, the + //second arg (if passed) is just the relModuleMap. + moduleName = deps; + relModuleMap = callback; + + //Normalize module name, if it contains . or .. + moduleMap = makeModuleMap(moduleName, relModuleMap); + fullName = moduleMap.fullName; + + if (!(fullName in defined)) { + return req.onError(makeError("notloaded", "Module name '" + + moduleMap.fullName + + "' has not been loaded yet for context: " + + contextName)); + } + return defined[fullName]; + } + + //Call main but only if there are dependencies or + //a callback to call. + if (deps && deps.length || callback) { + main(null, deps, callback, relModuleMap); + } + + //If the require call does not trigger anything new to load, + //then resume the dependency processing. + if (!context.requireWait) { + while (!context.scriptCount && context.paused.length) { + resume(); + } + } + return context.require; + }, + + /** + * Internal method to transfer globalQueue items to this context's + * defQueue. + */ + takeGlobalQueue: function () { + //Push all the globalDefQueue items into the context's defQueue + if (globalDefQueue.length) { + //Array splice in the values since the context code has a + //local var ref to defQueue, so cannot just reassign the one + //on context. + apsp.apply(context.defQueue, + [context.defQueue.length - 1, 0].concat(globalDefQueue)); + globalDefQueue = []; + } + }, + + /** + * Internal method used by environment adapters to complete a load event. + * A load event could be a script load or just a load pass from a synchronous + * load call. + * @param {String} moduleName the name of the module to potentially complete. + */ + completeLoad: function (moduleName) { + var args; + + context.takeGlobalQueue(); + + while (defQueue.length) { + args = defQueue.shift(); + + if (args[0] === null) { + args[0] = moduleName; + break; + } else if (args[0] === moduleName) { + //Found matching define call for this script! + break; + } else { + //Some other named define call, most likely the result + //of a build layer that included many define calls. + callDefMain(args); + args = null; + } + } + if (args) { + callDefMain(args); + } else { + //A script that does not call define(), so just simulate + //the call for it. Special exception for jQuery dynamic load. + callDefMain([moduleName, [], + moduleName === "jquery" && typeof jQuery !== "undefined" ? + function () { + return jQuery; + } : null]); + } + + //Doing this scriptCount decrement branching because sync envs + //need to decrement after resume, otherwise it looks like + //loading is complete after the first dependency is fetched. + //For browsers, it works fine to decrement after, but it means + //the checkLoaded setTimeout 50 ms cost is taken. To avoid + //that cost, decrement beforehand. + if (req.isAsync) { + context.scriptCount -= 1; + } + resume(); + if (!req.isAsync) { + context.scriptCount -= 1; + } + }, + + /** + * Converts a module name + .extension into an URL path. + * *Requires* the use of a module name. It does not support using + * plain URLs like nameToUrl. + */ + toUrl: function (moduleNamePlusExt, relModuleMap) { + var index = moduleNamePlusExt.lastIndexOf("."), + ext = null; + + if (index !== -1) { + ext = moduleNamePlusExt.substring(index, moduleNamePlusExt.length); + moduleNamePlusExt = moduleNamePlusExt.substring(0, index); + } + + return context.nameToUrl(moduleNamePlusExt, ext, relModuleMap); + }, + + /** + * Converts a module name to a file path. Supports cases where + * moduleName may actually be just an URL. + */ + nameToUrl: function (moduleName, ext, relModuleMap) { + var paths, pkgs, pkg, pkgPath, syms, i, parentModule, url, + config = context.config; + + //Normalize module name if have a base relative module name to work from. + moduleName = normalize(moduleName, relModuleMap && relModuleMap.fullName); + + //If a colon is in the URL, it indicates a protocol is used and it is just + //an URL to a file, or if it starts with a slash or ends with .js, it is just a plain file. + //The slash is important for protocol-less URLs as well as full paths. + if (req.jsExtRegExp.test(moduleName)) { + //Just a plain path, not module name lookup, so just return it. + //Add extension if it is included. This is a bit wonky, only non-.js things pass + //an extension, this method probably needs to be reworked. + url = moduleName + (ext ? ext : ""); + } else { + //A module that needs to be converted to a path. + paths = config.paths; + pkgs = config.pkgs; + + syms = moduleName.split("/"); + //For each module name segment, see if there is a path + //registered for it. Start with most specific name + //and work up from it. + for (i = syms.length; i > 0; i--) { + parentModule = syms.slice(0, i).join("/"); + if (paths[parentModule]) { + syms.splice(0, i, paths[parentModule]); + break; + } else if ((pkg = pkgs[parentModule])) { + //If module name is just the package name, then looking + //for the main module. + if (moduleName === pkg.name) { + pkgPath = pkg.location + '/' + pkg.main; + } else { + pkgPath = pkg.location; + } + syms.splice(0, i, pkgPath); + break; + } + } + + //Join the path parts together, then figure out if baseUrl is needed. + url = syms.join("/") + (ext || ".js"); + url = (url.charAt(0) === '/' || url.match(/^\w+:/) ? "" : config.baseUrl) + url; + } + + return config.urlArgs ? url + + ((url.indexOf('?') === -1 ? '?' : '&') + + config.urlArgs) : url; + } + }; + + //Make these visible on the context so can be called at the very + //end of the file to bootstrap + context.jQueryCheck = jQueryCheck; + context.resume = resume; + + return context; + } + + /** + * Main entry point. + * + * If the only argument to require is a string, then the module that + * is represented by that string is fetched for the appropriate context. + * + * If the first argument is an array, then it will be treated as an array + * of dependency string names to fetch. An optional function callback can + * be specified to execute when all of those dependencies are available. + * + * Make a local req variable to help Caja compliance (it assumes things + * on a require that are not standardized), and to give a short + * name for minification/local scope use. + */ + req = requirejs = function (deps, callback) { + + //Find the right context, use default + var contextName = defContextName, + context, config; + + // Determine if have config object in the call. + if (!isArray(deps) && typeof deps !== "string") { + // deps is a config object + config = deps; + if (isArray(callback)) { + // Adjust args if there are dependencies + deps = callback; + callback = arguments[2]; + } else { + deps = []; + } + } + + if (config && config.context) { + contextName = config.context; + } + + context = contexts[contextName] || + (contexts[contextName] = newContext(contextName)); + + if (config) { + context.configure(config); + } + + return context.require(deps, callback); + }; + + /** + * Support require.config() to make it easier to cooperate with other + * AMD loaders on globally agreed names. + */ + req.config = function (config) { + return req(config); + }; + + /** + * Export require as a global, but only if it does not already exist. + */ + if (!require) { + require = req; + } + + /** + * Global require.toUrl(), to match global require, mostly useful + * for debugging/work in the global space. + */ + req.toUrl = function (moduleNamePlusExt) { + return contexts[defContextName].toUrl(moduleNamePlusExt); + }; + + req.version = version; + + //Used to filter out dependencies that are already paths. + req.jsExtRegExp = /^\/|:|\?|\.js$/; + s = req.s = { + contexts: contexts, + //Stores a list of URLs that should not get async script tag treatment. + skipAsync: {} + }; + + req.isAsync = req.isBrowser = isBrowser; + if (isBrowser) { + head = s.head = document.getElementsByTagName("head")[0]; + //If BASE tag is in play, using appendChild is a problem for IE6. + //When that browser dies, this can be removed. Details in this jQuery bug: + //http://dev.jquery.com/ticket/2709 + baseElement = document.getElementsByTagName("base")[0]; + if (baseElement) { + head = s.head = baseElement.parentNode; + } + } + + /** + * Any errors that require explicitly generates will be passed to this + * function. Intercept/override it if you want custom error handling. + * @param {Error} err the error object. + */ + req.onError = function (err) { + throw err; + }; + + /** + * Does the request to load a module for the browser case. + * Make this a separate function to allow other environments + * to override it. + * + * @param {Object} context the require context to find state. + * @param {String} moduleName the name of the module. + * @param {Object} url the URL to the module. + */ + req.load = function (context, moduleName, url) { + req.resourcesReady(false); + + context.scriptCount += 1; + req.attach(url, context, moduleName); + + //If tracking a jQuery, then make sure its ready callbacks + //are put on hold to prevent its ready callbacks from + //triggering too soon. + if (context.jQuery && !context.jQueryIncremented) { + jQueryHoldReady(context.jQuery, true); + context.jQueryIncremented = true; + } + }; + + function getInteractiveScript() { + var scripts, i, script; + if (interactiveScript && interactiveScript.readyState === 'interactive') { + return interactiveScript; + } + + scripts = document.getElementsByTagName('script'); + for (i = scripts.length - 1; i > -1 && (script = scripts[i]); i--) { + if (script.readyState === 'interactive') { + return (interactiveScript = script); + } + } + + return null; + } + + /** + * The function that handles definitions of modules. Differs from + * require() in that a string for the module should be the first argument, + * and the function to execute after dependencies are loaded should + * return a value to define the module corresponding to the first argument's + * name. + */ + define = function (name, deps, callback) { + var node, context; + + //Allow for anonymous functions + if (typeof name !== 'string') { + //Adjust args appropriately + callback = deps; + deps = name; + name = null; + } + + //This module may not have dependencies + if (!isArray(deps)) { + callback = deps; + deps = []; + } + + //If no name, and callback is a function, then figure out if it a + //CommonJS thing with dependencies. + if (!deps.length && isFunction(callback)) { + //Remove comments from the callback string, + //look for require calls, and pull them into the dependencies, + //but only if there are function args. + if (callback.length) { + callback + .toString() + .replace(commentRegExp, "") + .replace(cjsRequireRegExp, function (match, dep) { + deps.push(dep); + }); + + //May be a CommonJS thing even without require calls, but still + //could use exports, and module. Avoid doing exports and module + //work though if it just needs require. + //REQUIRES the function to expect the CommonJS variables in the + //order listed below. + deps = (callback.length === 1 ? ["require"] : ["require", "exports", "module"]).concat(deps); + } + } + + //If in IE 6-8 and hit an anonymous define() call, do the interactive + //work. + if (useInteractive) { + node = currentlyAddingScript || getInteractiveScript(); + if (node) { + if (!name) { + name = node.getAttribute("data-requiremodule"); + } + context = contexts[node.getAttribute("data-requirecontext")]; + } + } + + //Always save off evaluating the def call until the script onload handler. + //This allows multiple modules to be in a file without prematurely + //tracing dependencies, and allows for anonymous module support, + //where the module name is not known until the script onload event + //occurs. If no context, use the global queue, and get it processed + //in the onscript load callback. + (context ? context.defQueue : globalDefQueue).push([name, deps, callback]); + + return undefined; + }; + + define.amd = { + multiversion: true, + plugins: true, + jQuery: true + }; + + /** + * Executes the text. Normally just uses eval, but can be modified + * to use a more environment specific call. + * @param {String} text the text to execute/evaluate. + */ + req.exec = function (text) { + return eval(text); + }; + + /** + * Executes a module callack function. Broken out as a separate function + * solely to allow the build system to sequence the files in the built + * layer in the right sequence. + * + * @private + */ + req.execCb = function (name, callback, args, exports) { + return callback.apply(exports, args); + }; + + + /** + * Adds a node to the DOM. Public function since used by the order plugin. + * This method should not normally be called by outside code. + */ + req.addScriptToDom = function (node) { + //For some cache cases in IE 6-8, the script executes before the end + //of the appendChild execution, so to tie an anonymous define + //call to the module name (which is stored on the node), hold on + //to a reference to this node, but clear after the DOM insertion. + currentlyAddingScript = node; + if (baseElement) { + head.insertBefore(node, baseElement); + } else { + head.appendChild(node); + } + currentlyAddingScript = null; + }; + + /** + * callback for script loads, used to check status of loading. + * + * @param {Event} evt the event from the browser for the script + * that was loaded. + * + * @private + */ + req.onScriptLoad = function (evt) { + //Using currentTarget instead of target for Firefox 2.0's sake. Not + //all old browsers will be supported, but this one was easy enough + //to support and still makes sense. + var node = evt.currentTarget || evt.srcElement, contextName, moduleName, + context; + + if (evt.type === "load" || (node && readyRegExp.test(node.readyState))) { + //Reset interactive script so a script node is not held onto for + //to long. + interactiveScript = null; + + //Pull out the name of the module and the context. + contextName = node.getAttribute("data-requirecontext"); + moduleName = node.getAttribute("data-requiremodule"); + context = contexts[contextName]; + + contexts[contextName].completeLoad(moduleName); + + //Clean up script binding. Favor detachEvent because of IE9 + //issue, see attachEvent/addEventListener comment elsewhere + //in this file. + if (node.detachEvent && !isOpera) { + //Probably IE. If not it will throw an error, which will be + //useful to know. + node.detachEvent("onreadystatechange", req.onScriptLoad); + } else { + node.removeEventListener("load", req.onScriptLoad, false); + } + } + }; + + /** + * Attaches the script represented by the URL to the current + * environment. Right now only supports browser loading, + * but can be redefined in other environments to do the right thing. + * @param {String} url the url of the script to attach. + * @param {Object} context the context that wants the script. + * @param {moduleName} the name of the module that is associated with the script. + * @param {Function} [callback] optional callback, defaults to require.onScriptLoad + * @param {String} [type] optional type, defaults to text/javascript + * @param {Function} [fetchOnlyFunction] optional function to indicate the script node + * should be set up to fetch the script but do not attach it to the DOM + * so that it can later be attached to execute it. This is a way for the + * order plugin to support ordered loading in IE. Once the script is fetched, + * but not executed, the fetchOnlyFunction will be called. + */ + req.attach = function (url, context, moduleName, callback, type, fetchOnlyFunction) { + var node; + if (isBrowser) { + //In the browser so use a script tag + callback = callback || req.onScriptLoad; + node = context && context.config && context.config.xhtml ? + document.createElementNS("http://www.w3.org/1999/xhtml", "html:script") : + document.createElement("script"); + node.type = type || (context && context.config.scriptType) || + "text/javascript"; + node.charset = "utf-8"; + //Use async so Gecko does not block on executing the script if something + //like a long-polling comet tag is being run first. Gecko likes + //to evaluate scripts in DOM order, even for dynamic scripts. + //It will fetch them async, but only evaluate the contents in DOM + //order, so a long-polling script tag can delay execution of scripts + //after it. But telling Gecko we expect async gets us the behavior + //we want -- execute it whenever it is finished downloading. Only + //Helps Firefox 3.6+ + //Allow some URLs to not be fetched async. Mostly helps the order! + //plugin + node.async = !s.skipAsync[url]; + + if (context) { + node.setAttribute("data-requirecontext", context.contextName); + } + node.setAttribute("data-requiremodule", moduleName); + + //Set up load listener. Test attachEvent first because IE9 has + //a subtle issue in its addEventListener and script onload firings + //that do not match the behavior of all other browsers with + //addEventListener support, which fire the onload event for a + //script right after the script execution. See: + //https://connect.microsoft.com/IE/feedback/details/648057/script-onload-event-is-not-fired-immediately-after-script-execution + //UNFORTUNATELY Opera implements attachEvent but does not follow the script + //script execution mode. + if (node.attachEvent && !isOpera) { + //Probably IE. IE (at least 6-8) do not fire + //script onload right after executing the script, so + //we cannot tie the anonymous define call to a name. + //However, IE reports the script as being in "interactive" + //readyState at the time of the define call. + useInteractive = true; + + + if (fetchOnlyFunction) { + //Need to use old school onreadystate here since + //when the event fires and the node is not attached + //to the DOM, the evt.srcElement is null, so use + //a closure to remember the node. + node.onreadystatechange = function (evt) { + //Script loaded but not executed. + //Clear loaded handler, set the real one that + //waits for script execution. + if (node.readyState === 'loaded') { + node.onreadystatechange = null; + node.attachEvent("onreadystatechange", callback); + fetchOnlyFunction(node); + } + }; + } else { + node.attachEvent("onreadystatechange", callback); + } + } else { + node.addEventListener("load", callback, false); + } + node.src = url; + + //Fetch only means waiting to attach to DOM after loaded. + if (!fetchOnlyFunction) { + req.addScriptToDom(node); + } + + return node; + } else if (isWebWorker) { + //In a web worker, use importScripts. This is not a very + //efficient use of importScripts, importScripts will block until + //its script is downloaded and evaluated. However, if web workers + //are in play, the expectation that a build has been done so that + //only one script needs to be loaded anyway. This may need to be + //reevaluated if other use cases become common. + importScripts(url); + + //Account for anonymous modules + context.completeLoad(moduleName); + } + return null; + }; + + //Look for a data-main script attribute, which could also adjust the baseUrl. + if (isBrowser) { + //Figure out baseUrl. Get it from the script tag with require.js in it. + scripts = document.getElementsByTagName("script"); + + for (globalI = scripts.length - 1; globalI > -1 && (script = scripts[globalI]); globalI--) { + //Set the "head" where we can append children by + //using the script's parent. + if (!head) { + head = script.parentNode; + } + + //Look for a data-main attribute to set main script for the page + //to load. If it is there, the path to data main becomes the + //baseUrl, if it is not already set. + if ((dataMain = script.getAttribute('data-main'))) { + if (!cfg.baseUrl) { + //Pull off the directory of data-main for use as the + //baseUrl. + src = dataMain.split('/'); + mainScript = src.pop(); + subPath = src.length ? src.join('/') + '/' : './'; + + //Set final config. + cfg.baseUrl = subPath; + //Strip off any trailing .js since dataMain is now + //like a module name. + dataMain = mainScript.replace(jsSuffixRegExp, ''); + } + + //Put the data-main script in the files to load. + cfg.deps = cfg.deps ? cfg.deps.concat(dataMain) : [dataMain]; + + break; + } + } + } + + //See if there is nothing waiting across contexts, and if not, trigger + //resourcesReady. + req.checkReadyState = function () { + var contexts = s.contexts, prop; + for (prop in contexts) { + if (!(prop in empty)) { + if (contexts[prop].waitCount) { + return; + } + } + } + req.resourcesReady(true); + }; + + /** + * Internal function that is triggered whenever all scripts/resources + * have been loaded by the loader. Can be overridden by other, for + * instance the domReady plugin, which wants to know when all resources + * are loaded. + */ + req.resourcesReady = function (isReady) { + var contexts, context, prop; + + //First, set the public variable indicating that resources are loading. + req.resourcesDone = isReady; + + if (req.resourcesDone) { + //If jQuery with DOM ready delayed, release it now. + contexts = s.contexts; + for (prop in contexts) { + if (!(prop in empty)) { + context = contexts[prop]; + if (context.jQueryIncremented) { + jQueryHoldReady(context.jQuery, false); + context.jQueryIncremented = false; + } + } + } + } + }; + + //FF < 3.6 readyState fix. Needed so that domReady plugin + //works well in that environment, since require.js is normally + //loaded via an HTML script tag so it will be there before window load, + //where the domReady plugin is more likely to be loaded after window load. + req.pageLoaded = function () { + if (document.readyState !== "complete") { + document.readyState = "complete"; + } + }; + if (isBrowser) { + if (document.addEventListener) { + if (!document.readyState) { + document.readyState = "loading"; + window.addEventListener("load", req.pageLoaded, false); + } + } + } + + //Set up default context. If require was a configuration object, use that as base config. + req(cfg); + + //If modules are built into require.js, then need to make sure dependencies are + //traced. Use a setTimeout in the browser world, to allow all the modules to register + //themselves. In a non-browser env, assume that modules are not built into require.js, + //which seems odd to do on the server. + if (req.isAsync && typeof setTimeout !== "undefined") { + ctx = s.contexts[(cfg.context || defContextName)]; + //Indicate that the script that includes require() is still loading, + //so that require()'d dependencies are not traced until the end of the + //file is parsed (approximated via the setTimeout call). + ctx.requireWait = true; + setTimeout(function () { + ctx.requireWait = false; + + if (!ctx.scriptCount) { + ctx.resume(); + } + req.checkReadyState(); + }, 0); + } +}()); + + + if (env === 'rhino') { + /** + * @license RequireJS rhino Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ + +/*jslint strict: false */ +/*global require: false, java: false, load: false */ + +(function () { + + require.load = function (context, moduleName, url) { + //Indicate a the module is in process of loading. + context.scriptCount += 1; + + load(url); + + //Support anonymous modules. + context.completeLoad(moduleName); + }; + +}()); + } else if (env === 'node') { + this.requirejsVars = { + require: require, + requirejs: require, + define: define, + nodeRequire: nodeRequire + }; + require.nodeRequire = nodeRequire; + + /** + * @license RequireJS node Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ + +/*jslint regexp: false, strict: false */ +/*global require: false, define: false, requirejsVars: false, process: false */ + +/** + * This adapter assumes that x.js has loaded it and set up + * some variables. This adapter just allows limited RequireJS + * usage from within the requirejs directory. The general + * node adapater is r.js. + */ + +(function () { + var nodeReq = requirejsVars.nodeRequire, + req = requirejsVars.require, + def = requirejsVars.define, + fs = nodeReq('fs'), + path = nodeReq('path'), + vm = nodeReq('vm'); + + //Supply an implementation that allows synchronous get of a module. + req.get = function (context, moduleName, relModuleMap) { + if (moduleName === "require" || moduleName === "exports" || moduleName === "module") { + req.onError(new Error("Explicit require of " + moduleName + " is not allowed.")); + } + + var ret, + moduleMap = context.makeModuleMap(moduleName, relModuleMap); + + //Normalize module name, if it contains . or .. + moduleName = moduleMap.fullName; + + if (moduleName in context.defined) { + ret = context.defined[moduleName]; + } else { + if (ret === undefined) { + //Try to dynamically fetch it. + req.load(context, moduleName, moduleMap.url); + //The above call is sync, so can do the next thing safely. + ret = context.defined[moduleName]; + } + } + + return ret; + }; + + //Add wrapper around the code so that it gets the requirejs + //API instead of the Node API, and it is done lexically so + //that it survives later execution. + req.makeNodeWrapper = function (contents) { + return '(function (require, requirejs, define) { ' + + contents + + '\n}(requirejsVars.require, requirejsVars.requirejs, requirejsVars.define));'; + }; + + requirejsVars.nodeLoad = req.load = function (context, moduleName, url) { + var contents, err; + + //Indicate a the module is in process of loading. + context.scriptCount += 1; + + if (path.existsSync(url)) { + contents = fs.readFileSync(url, 'utf8'); + + contents = req.makeNodeWrapper(contents); + try { + vm.runInThisContext(contents, fs.realpathSync(url)); + } catch (e) { + err = new Error('Evaluating ' + url + ' as module "' + + moduleName + '" failed with error: ' + e); + err.originalError = e; + err.moduleName = moduleName; + err.fileName = url; + return req.onError(err); + } + } else { + def(moduleName, function () { + try { + return (context.config.nodeRequire || req.nodeRequire)(moduleName); + } catch (e) { + err = new Error('Calling node\'s require("' + + moduleName + '") failed with error: ' + e); + err.originalError = e; + err.moduleName = moduleName; + return req.onError(err); + } + }); + } + + //Support anonymous modules. + context.completeLoad(moduleName); + + return undefined; + }; + + //Override to provide the function wrapper for define/require. + req.exec = function (text) { + /*jslint evil: true */ + text = req.makeNodeWrapper(text); + return eval(text); + }; + + //Hold on to the original execCb to use in useLib calls. + requirejsVars.nodeRequireExecCb = require.execCb; +}()); + + } + + //Support a default file name to execute. Useful for hosted envs + //like Joyent where it defaults to a server.js as the only executed + //script. But only do it if this is not an optimization run. + if (commandOption !== 'o' && (!fileName || !jsSuffixRegExp.test(fileName))) { + fileName = 'main.js'; + } + + /** + * Loads the library files that can be used for the optimizer, or for other + * tasks. + */ + function loadLib() { + /** + * @license Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ + +/*jslint strict: false */ +/*global Packages: false, process: false, window: false, navigator: false, + document: false, define: false */ + +/** + * A plugin that modifies any /env/ path to be the right path based on + * the host environment. Right now only works for Node, Rhino and browser. + */ +(function () { + var pathRegExp = /(\/|^)env\/|\{env\}/, + env = 'unknown'; + + if (typeof Packages !== 'undefined') { + env = 'rhino'; + } else if (typeof process !== 'undefined') { + env = 'node'; + } else if (typeof window !== "undefined" && navigator && document) { + env = 'browser'; + } + + define('env', { + load: function (name, req, load, config) { + //Allow override in the config. + if (config.env) { + env = config.env; + } + + name = name.replace(pathRegExp, function (match, prefix) { + if (match.indexOf('{') === -1) { + return prefix + env + '/'; + } else { + return env; + } + }); + + req([name], function (mod) { + load(mod); + }); + } + }); +}()); +if(env === 'node') { +/** + * @license Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ + +/*jslint strict: false */ +/*global define: false, process: false */ + +define('node/args', function () { + //Do not return the "node" or "r.js" arguments + var args = process.argv.slice(2); + + //Ignore any command option used for rq.js + if (args[0] && args[0].indexOf('-' === 0)) { + args = args.slice(1); + } + + return args; +}); + +} + +if(env === 'rhino') { +/** + * @license Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ + +/*jslint strict: false */ +/*global define: false, process: false */ + +var jsLibRhinoArgs = (typeof rhinoArgs !== 'undefined' && rhinoArgs) || [].concat(Array.prototype.slice.call(arguments, 0)); + +define('rhino/args', function () { + var args = jsLibRhinoArgs; + + //Ignore any command option used for rq.js + if (args[0] && args[0].indexOf('-' === 0)) { + args = args.slice(1); + } + + return args; +}); + +} + +if(env === 'node') { +/** + * @license RequireJS Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ + +/*jslint strict: false */ +/*global define: false, console: false */ + +define('node/load', ['fs'], function (fs) { + function load(fileName) { + var contents = fs.readFileSync(fileName, 'utf8'); + process.compile(contents, fileName); + } + + return load; +}); + +} + +if(env === 'rhino') { +/** + * @license RequireJS Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ + +/*jslint strict: false */ +/*global define: false, load: false */ + +define('rhino/load', function () { + return load; +}); + +} + +if(env === 'node') { +/** + * @license Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ + +/*jslint plusplus: false, octal:false, strict: false */ +/*global define: false, process: false */ + +define('node/file', ['fs', 'path'], function (fs, path) { + + var isWindows = process.platform === 'win32', + windowsDriveRegExp = /^[a-zA-Z]\:\/$/, + file; + + function frontSlash(path) { + return path.replace(/\\/g, '/'); + } + + function exists(path) { + if (isWindows && path.charAt(path.length - 1) === '/' && + path.charAt(path.length - 2) !== ':') { + path = path.substring(0, path.length - 1); + } + + try { + fs.statSync(path); + return true; + } catch (e) { + return false; + } + } + + function mkDir(dir) { + if (!exists(dir) && (!isWindows || !windowsDriveRegExp.test(dir))) { + fs.mkdirSync(dir, 511); + } + } + + function mkFullDir(dir) { + var parts = dir.split('/'), + currDir = '', + first = true; + + parts.forEach(function (part) { + //First part may be empty string if path starts with a slash. + currDir += part + '/'; + first = false; + + if (part) { + mkDir(currDir); + } + }); + } + + file = { + backSlashRegExp: /\\/g, + exclusionRegExp: /^\./, + getLineSeparator: function () { + return '/'; + }, + + exists: function (fileName) { + return exists(fileName); + }, + + parent: function (fileName) { + var parts = fileName.split('/'); + parts.pop(); + return parts.join('/'); + }, + + /** + * Gets the absolute file path as a string, normalized + * to using front slashes for path separators. + * @param {String} fileName + */ + absPath: function (fileName) { + return frontSlash(path.normalize(frontSlash(fs.realpathSync(fileName)))); + }, + + normalize: function (fileName) { + return frontSlash(path.normalize(fileName)); + }, + + isFile: function (path) { + return fs.statSync(path).isFile(); + }, + + isDirectory: function (path) { + return fs.statSync(path).isDirectory(); + }, + + getFilteredFileList: function (/*String*/startDir, /*RegExp*/regExpFilters, /*boolean?*/makeUnixPaths) { + //summary: Recurses startDir and finds matches to the files that match regExpFilters.include + //and do not match regExpFilters.exclude. Or just one regexp can be passed in for regExpFilters, + //and it will be treated as the "include" case. + //Ignores files/directories that start with a period (.) unless exclusionRegExp + //is set to another value. + var files = [], topDir, regExpInclude, regExpExclude, dirFileArray, + i, stat, filePath, ok, dirFiles, fileName; + + topDir = startDir; + + regExpInclude = regExpFilters.include || regExpFilters; + regExpExclude = regExpFilters.exclude || null; + + if (file.exists(topDir)) { + dirFileArray = fs.readdirSync(topDir); + for (i = 0; i < dirFileArray.length; i++) { + fileName = dirFileArray[i]; + filePath = path.join(topDir, fileName); + stat = fs.statSync(filePath); + if (stat.isFile()) { + if (makeUnixPaths) { + //Make sure we have a JS string. + if (filePath.indexOf("/") === -1) { + filePath = frontSlash(filePath); + } + } + + ok = true; + if (regExpInclude) { + ok = filePath.match(regExpInclude); + } + if (ok && regExpExclude) { + ok = !filePath.match(regExpExclude); + } + + if (ok && (!file.exclusionRegExp || + !file.exclusionRegExp.test(fileName))) { + files.push(filePath); + } + } else if (stat.isDirectory() && + (!file.exclusionRegExp || !file.exclusionRegExp.test(fileName))) { + dirFiles = this.getFilteredFileList(filePath, regExpFilters, makeUnixPaths); + files.push.apply(files, dirFiles); + } + } + } + + return files; //Array + }, + + copyDir: function (/*String*/srcDir, /*String*/destDir, /*RegExp?*/regExpFilter, /*boolean?*/onlyCopyNew) { + //summary: copies files from srcDir to destDir using the regExpFilter to determine if the + //file should be copied. Returns a list file name strings of the destinations that were copied. + regExpFilter = regExpFilter || /\w/; + + //Normalize th directory names, but keep front slashes. + //path module on windows now returns backslashed paths. + srcDir = frontSlash(path.normalize(srcDir)); + destDir = frontSlash(path.normalize(destDir)); + + var fileNames = file.getFilteredFileList(srcDir, regExpFilter, true), + copiedFiles = [], i, srcFileName, destFileName; + + for (i = 0; i < fileNames.length; i++) { + srcFileName = fileNames[i]; + destFileName = srcFileName.replace(srcDir, destDir); + + if (file.copyFile(srcFileName, destFileName, onlyCopyNew)) { + copiedFiles.push(destFileName); + } + } + + return copiedFiles.length ? copiedFiles : null; //Array or null + }, + + copyFile: function (/*String*/srcFileName, /*String*/destFileName, /*boolean?*/onlyCopyNew) { + //summary: copies srcFileName to destFileName. If onlyCopyNew is set, it only copies the file if + //srcFileName is newer than destFileName. Returns a boolean indicating if the copy occurred. + var parentDir; + + //logger.trace("Src filename: " + srcFileName); + //logger.trace("Dest filename: " + destFileName); + + //If onlyCopyNew is true, then compare dates and only copy if the src is newer + //than dest. + if (onlyCopyNew) { + if (file.exists(destFileName) && fs.statSync(destFileName).mtime.getTime() >= fs.statSync(srcFileName).mtime.getTime()) { + return false; //Boolean + } + } + + //Make sure destination dir exists. + parentDir = path.dirname(destFileName); + if (!file.exists(parentDir)) { + mkFullDir(parentDir); + } + + fs.writeFileSync(destFileName, fs.readFileSync(srcFileName, 'binary'), 'binary'); + + return true; //Boolean + }, + + /** + * Renames a file. May fail if "to" already exists or is on another drive. + */ + renameFile: function (from, to) { + return fs.renameSync(from, to); + }, + + /** + * Reads a *text* file. + */ + readFile: function (/*String*/path, /*String?*/encoding) { + if (encoding === 'utf-8') { + encoding = 'utf8'; + } + if (!encoding) { + encoding = 'utf8'; + } + + var text = fs.readFileSync(path, encoding); + + //Hmm, would not expect to get A BOM, but it seems to happen, + //remove it just in case. + if (text.indexOf('\uFEFF') === 0) { + text = text.substring(1, text.length); + } + + return text; + }, + + saveUtf8File: function (/*String*/fileName, /*String*/fileContents) { + //summary: saves a *text* file using UTF-8 encoding. + file.saveFile(fileName, fileContents, "utf8"); + }, + + saveFile: function (/*String*/fileName, /*String*/fileContents, /*String?*/encoding) { + //summary: saves a *text* file. + var parentDir; + + if (encoding === 'utf-8') { + encoding = 'utf8'; + } + if (!encoding) { + encoding = 'utf8'; + } + + //Make sure destination directories exist. + parentDir = path.dirname(fileName); + if (!file.exists(parentDir)) { + mkFullDir(parentDir); + } + + fs.writeFileSync(fileName, fileContents, encoding); + }, + + deleteFile: function (/*String*/fileName) { + //summary: deletes a file or directory if it exists. + var files, i, stat; + if (file.exists(fileName)) { + stat = fs.statSync(fileName); + if (stat.isDirectory()) { + files = fs.readdirSync(fileName); + for (i = 0; i < files.length; i++) { + this.deleteFile(path.join(fileName, files[i])); + } + fs.rmdirSync(fileName); + } else { + fs.unlinkSync(fileName); + } + } + } + }; + + return file; + +}); + +} + +if(env === 'rhino') { +/** + * @license RequireJS Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ +//Helper functions to deal with file I/O. + +/*jslint plusplus: false, strict: false */ +/*global java: false, define: false */ + +define('rhino/file', function () { + var file = { + backSlashRegExp: /\\/g, + + exclusionRegExp: /^\./, + + getLineSeparator: function () { + return file.lineSeparator; + }, + + lineSeparator: java.lang.System.getProperty("line.separator"), //Java String + + exists: function (fileName) { + return (new java.io.File(fileName)).exists(); + }, + + parent: function (fileName) { + return file.absPath((new java.io.File(fileName)).getParentFile()); + }, + + normalize: function (fileName) { + return file.absPath(fileName); + }, + + isFile: function (path) { + return (new java.io.File(path)).isFile(); + }, + + isDirectory: function (path) { + return (new java.io.File(path)).isDirectory(); + }, + + /** + * Gets the absolute file path as a string, normalized + * to using front slashes for path separators. + * @param {java.io.File||String} file + */ + absPath: function (fileObj) { + if (typeof fileObj === "string") { + fileObj = new java.io.File(fileObj); + } + return (fileObj.getAbsolutePath() + "").replace(file.backSlashRegExp, "/"); + }, + + getFilteredFileList: function (/*String*/startDir, /*RegExp*/regExpFilters, /*boolean?*/makeUnixPaths, /*boolean?*/startDirIsJavaObject) { + //summary: Recurses startDir and finds matches to the files that match regExpFilters.include + //and do not match regExpFilters.exclude. Or just one regexp can be passed in for regExpFilters, + //and it will be treated as the "include" case. + //Ignores files/directories that start with a period (.) unless exclusionRegExp + //is set to another value. + var files = [], topDir, regExpInclude, regExpExclude, dirFileArray, + i, fileObj, filePath, ok, dirFiles; + + topDir = startDir; + if (!startDirIsJavaObject) { + topDir = new java.io.File(startDir); + } + + regExpInclude = regExpFilters.include || regExpFilters; + regExpExclude = regExpFilters.exclude || null; + + if (topDir.exists()) { + dirFileArray = topDir.listFiles(); + for (i = 0; i < dirFileArray.length; i++) { + fileObj = dirFileArray[i]; + if (fileObj.isFile()) { + filePath = fileObj.getPath(); + if (makeUnixPaths) { + //Make sure we have a JS string. + filePath = String(filePath); + if (filePath.indexOf("/") === -1) { + filePath = filePath.replace(/\\/g, "/"); + } + } + + ok = true; + if (regExpInclude) { + ok = filePath.match(regExpInclude); + } + if (ok && regExpExclude) { + ok = !filePath.match(regExpExclude); + } + + if (ok && (!file.exclusionRegExp || + !file.exclusionRegExp.test(fileObj.getName()))) { + files.push(filePath); + } + } else if (fileObj.isDirectory() && + (!file.exclusionRegExp || !file.exclusionRegExp.test(fileObj.getName()))) { + dirFiles = this.getFilteredFileList(fileObj, regExpFilters, makeUnixPaths, true); + files.push.apply(files, dirFiles); + } + } + } + + return files; //Array + }, + + copyDir: function (/*String*/srcDir, /*String*/destDir, /*RegExp?*/regExpFilter, /*boolean?*/onlyCopyNew) { + //summary: copies files from srcDir to destDir using the regExpFilter to determine if the + //file should be copied. Returns a list file name strings of the destinations that were copied. + regExpFilter = regExpFilter || /\w/; + + var fileNames = file.getFilteredFileList(srcDir, regExpFilter, true), + copiedFiles = [], i, srcFileName, destFileName; + + for (i = 0; i < fileNames.length; i++) { + srcFileName = fileNames[i]; + destFileName = srcFileName.replace(srcDir, destDir); + + if (file.copyFile(srcFileName, destFileName, onlyCopyNew)) { + copiedFiles.push(destFileName); + } + } + + return copiedFiles.length ? copiedFiles : null; //Array or null + }, + + copyFile: function (/*String*/srcFileName, /*String*/destFileName, /*boolean?*/onlyCopyNew) { + //summary: copies srcFileName to destFileName. If onlyCopyNew is set, it only copies the file if + //srcFileName is newer than destFileName. Returns a boolean indicating if the copy occurred. + var destFile = new java.io.File(destFileName), srcFile, parentDir, + srcChannel, destChannel; + + //logger.trace("Src filename: " + srcFileName); + //logger.trace("Dest filename: " + destFileName); + + //If onlyCopyNew is true, then compare dates and only copy if the src is newer + //than dest. + if (onlyCopyNew) { + srcFile = new java.io.File(srcFileName); + if (destFile.exists() && destFile.lastModified() >= srcFile.lastModified()) { + return false; //Boolean + } + } + + //Make sure destination dir exists. + parentDir = destFile.getParentFile(); + if (!parentDir.exists()) { + if (!parentDir.mkdirs()) { + throw "Could not create directory: " + parentDir.getAbsolutePath(); + } + } + + //Java's version of copy file. + srcChannel = new java.io.FileInputStream(srcFileName).getChannel(); + destChannel = new java.io.FileOutputStream(destFileName).getChannel(); + destChannel.transferFrom(srcChannel, 0, srcChannel.size()); + srcChannel.close(); + destChannel.close(); + + return true; //Boolean + }, + + /** + * Renames a file. May fail if "to" already exists or is on another drive. + */ + renameFile: function (from, to) { + return (new java.io.File(from)).renameTo((new java.io.File(to))); + }, + + readFile: function (/*String*/path, /*String?*/encoding) { + //A file read function that can deal with BOMs + encoding = encoding || "utf-8"; + var fileObj = new java.io.File(path), + input = new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(fileObj), encoding)), + stringBuffer, line; + try { + stringBuffer = new java.lang.StringBuffer(); + line = input.readLine(); + + // Byte Order Mark (BOM) - The Unicode Standard, version 3.0, page 324 + // http://www.unicode.org/faq/utf_bom.html + + // Note that when we use utf-8, the BOM should appear as "EF BB BF", but it doesn't due to this bug in the JDK: + // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4508058 + if (line && line.length() && line.charAt(0) === 0xfeff) { + // Eat the BOM, since we've already found the encoding on this file, + // and we plan to concatenating this buffer with others; the BOM should + // only appear at the top of a file. + line = line.substring(1); + } + while (line !== null) { + stringBuffer.append(line); + stringBuffer.append(file.lineSeparator); + line = input.readLine(); + } + //Make sure we return a JavaScript string and not a Java string. + return String(stringBuffer.toString()); //String + } finally { + input.close(); + } + }, + + saveUtf8File: function (/*String*/fileName, /*String*/fileContents) { + //summary: saves a file using UTF-8 encoding. + file.saveFile(fileName, fileContents, "utf-8"); + }, + + saveFile: function (/*String*/fileName, /*String*/fileContents, /*String?*/encoding) { + //summary: saves a file. + var outFile = new java.io.File(fileName), outWriter, parentDir, os; + + parentDir = outFile.getAbsoluteFile().getParentFile(); + if (!parentDir.exists()) { + if (!parentDir.mkdirs()) { + throw "Could not create directory: " + parentDir.getAbsolutePath(); + } + } + + if (encoding) { + outWriter = new java.io.OutputStreamWriter(new java.io.FileOutputStream(outFile), encoding); + } else { + outWriter = new java.io.OutputStreamWriter(new java.io.FileOutputStream(outFile)); + } + + os = new java.io.BufferedWriter(outWriter); + try { + os.write(fileContents); + } finally { + os.close(); + } + }, + + deleteFile: function (/*String*/fileName) { + //summary: deletes a file or directory if it exists. + var fileObj = new java.io.File(fileName), files, i; + if (fileObj.exists()) { + if (fileObj.isDirectory()) { + files = fileObj.listFiles(); + for (i = 0; i < files.length; i++) { + this.deleteFile(files[i]); + } + } + fileObj["delete"](); + } + } + }; + + return file; +}); + +} +/** + * @license Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ + +/*jslint plusplus: true */ +/*global define */ + +define('lang', function () { + 'use strict'; + + var lang = { + backSlashRegExp: /\\/g, + ostring: Object.prototype.toString, + + isArray: Array.isArray || function (it) { + return lang.ostring.call(it) === "[object Array]"; + }, + + isFunction: function(it) { + return lang.ostring.call(it) === "[object Function]"; + }, + + isRegExp: function(it) { + return it && it instanceof RegExp; + }, + + _mixin: function(dest, source, override){ + var name; + for (name in source) { + if(source.hasOwnProperty(name) + && (override || !dest.hasOwnProperty(name))) { + dest[name] = source[name]; + } + } + + return dest; // Object + }, + + /** + * mixin({}, obj1, obj2) is allowed. If the last argument is a boolean, + * then the source objects properties are force copied over to dest. + */ + mixin: function(dest){ + var parameters = Array.prototype.slice.call(arguments), + override, i, l; + + if (!dest) { dest = {}; } + + if (parameters.length > 2 && typeof arguments[parameters.length-1] === 'boolean') { + override = parameters.pop(); + } + + for (i = 1, l = parameters.length; i < l; i++) { + lang._mixin(dest, parameters[i], override); + } + return dest; // Object + }, + + delegate: (function () { + // boodman/crockford delegation w/ cornford optimization + function TMP() {} + return function (obj, props) { + TMP.prototype = obj; + var tmp = new TMP(); + TMP.prototype = null; + if (props) { + lang.mixin(tmp, props); + } + return tmp; // Object + }; + }()) + }; + return lang; +}); + +if(env === 'node') { +/** + * @license RequireJS Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ + +/*jslint strict: false */ +/*global define: false, console: false */ + +define('node/print', function () { + function print(msg) { + console.log(msg); + } + + return print; +}); + +} + +if(env === 'rhino') { +/** + * @license RequireJS Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ + +/*jslint strict: false */ +/*global define: false, print: false */ + +define('rhino/print', function () { + return print; +}); + +} +/** + * @license RequireJS Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ + +/*jslint nomen: false, strict: false */ +/*global define: false */ + +define('logger', ['env!env/print'], function (print) { + var logger = { + TRACE: 0, + INFO: 1, + WARN: 2, + ERROR: 3, + SILENT: 4, + level: 0, + logPrefix: "", + + logLevel: function( level ) { + this.level = level; + }, + + trace: function (message) { + if (this.level <= this.TRACE) { + this._print(message); + } + }, + + info: function (message) { + if (this.level <= this.INFO) { + this._print(message); + } + }, + + warn: function (message) { + if (this.level <= this.WARN) { + this._print(message); + } + }, + + error: function (message) { + if (this.level <= this.ERROR) { + this._print(message); + } + }, + + _print: function (message) { + this._sysPrint((this.logPrefix ? (this.logPrefix + " ") : "") + message); + }, + + _sysPrint: function (message) { + print(message); + } + }; + + return logger; +}); +//Just a blank file to use when building the optimizer with the optimizer, +//so that the build does not attempt to inline some env modules, +//like Node's fs and path. + +//Just a blank file to use when building the optimizer with the optimizer, +//so that the build does not attempt to inline some env modules, +//like Node's fs and path. + +define('uglifyjs/parse-js', ["require", "exports", "module"], function(require, exports, module) { +/*********************************************************************** + + A JavaScript tokenizer / parser / beautifier / compressor. + + This version is suitable for Node.js. With minimal changes (the + exports stuff) it should work on any JS platform. + + This file contains the tokenizer/parser. It is a port to JavaScript + of parse-js [1], a JavaScript parser library written in Common Lisp + by Marijn Haverbeke. Thank you Marijn! + + [1] http://marijn.haverbeke.nl/parse-js/ + + Exported functions: + + - tokenizer(code) -- returns a function. Call the returned + function to fetch the next token. + + - parse(code) -- returns an AST of the given JavaScript code. + + -------------------------------- (C) --------------------------------- + + Author: Mihai Bazon + + http://mihai.bazon.net/blog + + Distributed under the BSD license: + + Copyright 2010 (c) Mihai Bazon + Based on parse-js (http://marijn.haverbeke.nl/parse-js/). + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above + copyright notice, this list of conditions and the following + disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF + THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + + ***********************************************************************/ + +/* -----[ Tokenizer (constants) ]----- */ + +var KEYWORDS = array_to_hash([ + "break", + "case", + "catch", + "const", + "continue", + "default", + "delete", + "do", + "else", + "finally", + "for", + "function", + "if", + "in", + "instanceof", + "new", + "return", + "switch", + "throw", + "try", + "typeof", + "var", + "void", + "while", + "with" +]); + +var RESERVED_WORDS = array_to_hash([ + "abstract", + "boolean", + "byte", + "char", + "class", + "debugger", + "double", + "enum", + "export", + "extends", + "final", + "float", + "goto", + "implements", + "import", + "int", + "interface", + "long", + "native", + "package", + "private", + "protected", + "public", + "short", + "static", + "super", + "synchronized", + "throws", + "transient", + "volatile" +]); + +var KEYWORDS_BEFORE_EXPRESSION = array_to_hash([ + "return", + "new", + "delete", + "throw", + "else", + "case" +]); + +var KEYWORDS_ATOM = array_to_hash([ + "false", + "null", + "true", + "undefined" +]); + +var OPERATOR_CHARS = array_to_hash(characters("+-*&%=<>!?|~^")); + +var RE_HEX_NUMBER = /^0x[0-9a-f]+$/i; +var RE_OCT_NUMBER = /^0[0-7]+$/; +var RE_DEC_NUMBER = /^\d*\.?\d*(?:e[+-]?\d*(?:\d\.?|\.?\d)\d*)?$/i; + +var OPERATORS = array_to_hash([ + "in", + "instanceof", + "typeof", + "new", + "void", + "delete", + "++", + "--", + "+", + "-", + "!", + "~", + "&", + "|", + "^", + "*", + "/", + "%", + ">>", + "<<", + ">>>", + "<", + ">", + "<=", + ">=", + "==", + "===", + "!=", + "!==", + "?", + "=", + "+=", + "-=", + "/=", + "*=", + "%=", + ">>=", + "<<=", + ">>>=", + "|=", + "^=", + "&=", + "&&", + "||" +]); + +var WHITESPACE_CHARS = array_to_hash(characters(" \u00a0\n\r\t\f\u000b\u200b\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000")); + +var PUNC_BEFORE_EXPRESSION = array_to_hash(characters("[{}(,.;:")); + +var PUNC_CHARS = array_to_hash(characters("[]{}(),;:")); + +var REGEXP_MODIFIERS = array_to_hash(characters("gmsiy")); + +/* -----[ Tokenizer ]----- */ + +// regexps adapted from http://xregexp.com/plugins/#unicode +var UNICODE = { + letter: new RegExp("[\\u0041-\\u005A\\u0061-\\u007A\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u0523\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0621-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971\\u0972\\u097B-\\u097F\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D28\\u0D2A-\\u0D39\\u0D3D\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC\\u0EDD\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8B\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10D0-\\u10FA\\u10FC\\u1100-\\u1159\\u115F-\\u11A2\\u11A8-\\u11F9\\u1200-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u1676\\u1681-\\u169A\\u16A0-\\u16EA\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u1900-\\u191C\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19A9\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u2094\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2C6F\\u2C71-\\u2C7D\\u2C80-\\u2CE4\\u2D00-\\u2D25\\u2D30-\\u2D65\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31B7\\u31F0-\\u31FF\\u3400\\u4DB5\\u4E00\\u9FC3\\uA000-\\uA48C\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA65F\\uA662-\\uA66E\\uA67F-\\uA697\\uA717-\\uA71F\\uA722-\\uA788\\uA78B\\uA78C\\uA7FB-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA90A-\\uA925\\uA930-\\uA946\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAC00\\uD7A3\\uF900-\\uFA2D\\uFA30-\\uFA6A\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"), + non_spacing_mark: new RegExp("[\\u0300-\\u036F\\u0483-\\u0487\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u065E\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07EB-\\u07F3\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0900-\\u0902\\u093C\\u0941-\\u0948\\u094D\\u0951-\\u0955\\u0962\\u0963\\u0981\\u09BC\\u09C1-\\u09C4\\u09CD\\u09E2\\u09E3\\u0A01\\u0A02\\u0A3C\\u0A41\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A70\\u0A71\\u0A75\\u0A81\\u0A82\\u0ABC\\u0AC1-\\u0AC5\\u0AC7\\u0AC8\\u0ACD\\u0AE2\\u0AE3\\u0B01\\u0B3C\\u0B3F\\u0B41-\\u0B44\\u0B4D\\u0B56\\u0B62\\u0B63\\u0B82\\u0BC0\\u0BCD\\u0C3E-\\u0C40\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0CBC\\u0CBF\\u0CC6\\u0CCC\\u0CCD\\u0CE2\\u0CE3\\u0D41-\\u0D44\\u0D4D\\u0D62\\u0D63\\u0DCA\\u0DD2-\\u0DD4\\u0DD6\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F71-\\u0F7E\\u0F80-\\u0F84\\u0F86\\u0F87\\u0F90-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102D-\\u1030\\u1032-\\u1037\\u1039\\u103A\\u103D\\u103E\\u1058\\u1059\\u105E-\\u1060\\u1071-\\u1074\\u1082\\u1085\\u1086\\u108D\\u109D\\u135F\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B7-\\u17BD\\u17C6\\u17C9-\\u17D3\\u17DD\\u180B-\\u180D\\u18A9\\u1920-\\u1922\\u1927\\u1928\\u1932\\u1939-\\u193B\\u1A17\\u1A18\\u1A56\\u1A58-\\u1A5E\\u1A60\\u1A62\\u1A65-\\u1A6C\\u1A73-\\u1A7C\\u1A7F\\u1B00-\\u1B03\\u1B34\\u1B36-\\u1B3A\\u1B3C\\u1B42\\u1B6B-\\u1B73\\u1B80\\u1B81\\u1BA2-\\u1BA5\\u1BA8\\u1BA9\\u1C2C-\\u1C33\\u1C36\\u1C37\\u1CD0-\\u1CD2\\u1CD4-\\u1CE0\\u1CE2-\\u1CE8\\u1CED\\u1DC0-\\u1DE6\\u1DFD-\\u1DFF\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2CEF-\\u2CF1\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA66F\\uA67C\\uA67D\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA825\\uA826\\uA8C4\\uA8E0-\\uA8F1\\uA926-\\uA92D\\uA947-\\uA951\\uA980-\\uA982\\uA9B3\\uA9B6-\\uA9B9\\uA9BC\\uAA29-\\uAA2E\\uAA31\\uAA32\\uAA35\\uAA36\\uAA43\\uAA4C\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uABE5\\uABE8\\uABED\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE26]"), + space_combining_mark: new RegExp("[\\u0903\\u093E-\\u0940\\u0949-\\u094C\\u094E\\u0982\\u0983\\u09BE-\\u09C0\\u09C7\\u09C8\\u09CB\\u09CC\\u09D7\\u0A03\\u0A3E-\\u0A40\\u0A83\\u0ABE-\\u0AC0\\u0AC9\\u0ACB\\u0ACC\\u0B02\\u0B03\\u0B3E\\u0B40\\u0B47\\u0B48\\u0B4B\\u0B4C\\u0B57\\u0BBE\\u0BBF\\u0BC1\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCC\\u0BD7\\u0C01-\\u0C03\\u0C41-\\u0C44\\u0C82\\u0C83\\u0CBE\\u0CC0-\\u0CC4\\u0CC7\\u0CC8\\u0CCA\\u0CCB\\u0CD5\\u0CD6\\u0D02\\u0D03\\u0D3E-\\u0D40\\u0D46-\\u0D48\\u0D4A-\\u0D4C\\u0D57\\u0D82\\u0D83\\u0DCF-\\u0DD1\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0F3E\\u0F3F\\u0F7F\\u102B\\u102C\\u1031\\u1038\\u103B\\u103C\\u1056\\u1057\\u1062-\\u1064\\u1067-\\u106D\\u1083\\u1084\\u1087-\\u108C\\u108F\\u109A-\\u109C\\u17B6\\u17BE-\\u17C5\\u17C7\\u17C8\\u1923-\\u1926\\u1929-\\u192B\\u1930\\u1931\\u1933-\\u1938\\u19B0-\\u19C0\\u19C8\\u19C9\\u1A19-\\u1A1B\\u1A55\\u1A57\\u1A61\\u1A63\\u1A64\\u1A6D-\\u1A72\\u1B04\\u1B35\\u1B3B\\u1B3D-\\u1B41\\u1B43\\u1B44\\u1B82\\u1BA1\\u1BA6\\u1BA7\\u1BAA\\u1C24-\\u1C2B\\u1C34\\u1C35\\u1CE1\\u1CF2\\uA823\\uA824\\uA827\\uA880\\uA881\\uA8B4-\\uA8C3\\uA952\\uA953\\uA983\\uA9B4\\uA9B5\\uA9BA\\uA9BB\\uA9BD-\\uA9C0\\uAA2F\\uAA30\\uAA33\\uAA34\\uAA4D\\uAA7B\\uABE3\\uABE4\\uABE6\\uABE7\\uABE9\\uABEA\\uABEC]"), + connector_punctuation: new RegExp("[\\u005F\\u203F\\u2040\\u2054\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFF3F]") +}; + +function is_letter(ch) { + return UNICODE.letter.test(ch); +}; + +function is_digit(ch) { + ch = ch.charCodeAt(0); + return ch >= 48 && ch <= 57; //XXX: find out if "UnicodeDigit" means something else than 0..9 +}; + +function is_alphanumeric_char(ch) { + return is_digit(ch) || is_letter(ch); +}; + +function is_unicode_combining_mark(ch) { + return UNICODE.non_spacing_mark.test(ch) || UNICODE.space_combining_mark.test(ch); +}; + +function is_unicode_connector_punctuation(ch) { + return UNICODE.connector_punctuation.test(ch); +}; + +function is_identifier_start(ch) { + return ch == "$" || ch == "_" || is_letter(ch); +}; + +function is_identifier_char(ch) { + return is_identifier_start(ch) + || is_unicode_combining_mark(ch) + || is_digit(ch) + || is_unicode_connector_punctuation(ch) + || ch == "\u200c" // zero-width non-joiner + || ch == "\u200d" // zero-width joiner (in my ECMA-262 PDF, this is also 200c) + ; +}; + +function parse_js_number(num) { + if (RE_HEX_NUMBER.test(num)) { + return parseInt(num.substr(2), 16); + } else if (RE_OCT_NUMBER.test(num)) { + return parseInt(num.substr(1), 8); + } else if (RE_DEC_NUMBER.test(num)) { + return parseFloat(num); + } +}; + +function JS_Parse_Error(message, line, col, pos) { + this.message = message; + this.line = line + 1; + this.col = col + 1; + this.pos = pos + 1; + this.stack = new Error().stack; +}; + +JS_Parse_Error.prototype.toString = function() { + return this.message + " (line: " + this.line + ", col: " + this.col + ", pos: " + this.pos + ")" + "\n\n" + this.stack; +}; + +function js_error(message, line, col, pos) { + throw new JS_Parse_Error(message, line, col, pos); +}; + +function is_token(token, type, val) { + return token.type == type && (val == null || token.value == val); +}; + +var EX_EOF = {}; + +function tokenizer($TEXT) { + + var S = { + text : $TEXT.replace(/\r\n?|[\n\u2028\u2029]/g, "\n").replace(/^\uFEFF/, ''), + pos : 0, + tokpos : 0, + line : 0, + tokline : 0, + col : 0, + tokcol : 0, + newline_before : false, + regex_allowed : false, + comments_before : [] + }; + + function peek() { return S.text.charAt(S.pos); }; + + function next(signal_eof, in_string) { + var ch = S.text.charAt(S.pos++); + if (signal_eof && !ch) + throw EX_EOF; + if (ch == "\n") { + S.newline_before = S.newline_before || !in_string; + ++S.line; + S.col = 0; + } else { + ++S.col; + } + return ch; + }; + + function eof() { + return !S.peek(); + }; + + function find(what, signal_eof) { + var pos = S.text.indexOf(what, S.pos); + if (signal_eof && pos == -1) throw EX_EOF; + return pos; + }; + + function start_token() { + S.tokline = S.line; + S.tokcol = S.col; + S.tokpos = S.pos; + }; + + function token(type, value, is_comment) { + S.regex_allowed = ((type == "operator" && !HOP(UNARY_POSTFIX, value)) || + (type == "keyword" && HOP(KEYWORDS_BEFORE_EXPRESSION, value)) || + (type == "punc" && HOP(PUNC_BEFORE_EXPRESSION, value))); + var ret = { + type : type, + value : value, + line : S.tokline, + col : S.tokcol, + pos : S.tokpos, + endpos : S.pos, + nlb : S.newline_before + }; + if (!is_comment) { + ret.comments_before = S.comments_before; + S.comments_before = []; + } + S.newline_before = false; + return ret; + }; + + function skip_whitespace() { + while (HOP(WHITESPACE_CHARS, peek())) + next(); + }; + + function read_while(pred) { + var ret = "", ch = peek(), i = 0; + while (ch && pred(ch, i++)) { + ret += next(); + ch = peek(); + } + return ret; + }; + + function parse_error(err) { + js_error(err, S.tokline, S.tokcol, S.tokpos); + }; + + function read_num(prefix) { + var has_e = false, after_e = false, has_x = false, has_dot = prefix == "."; + var num = read_while(function(ch, i){ + if (ch == "x" || ch == "X") { + if (has_x) return false; + return has_x = true; + } + if (!has_x && (ch == "E" || ch == "e")) { + if (has_e) return false; + return has_e = after_e = true; + } + if (ch == "-") { + if (after_e || (i == 0 && !prefix)) return true; + return false; + } + if (ch == "+") return after_e; + after_e = false; + if (ch == ".") { + if (!has_dot && !has_x) + return has_dot = true; + return false; + } + return is_alphanumeric_char(ch); + }); + if (prefix) + num = prefix + num; + var valid = parse_js_number(num); + if (!isNaN(valid)) { + return token("num", valid); + } else { + parse_error("Invalid syntax: " + num); + } + }; + + function read_escaped_char(in_string) { + var ch = next(true, in_string); + switch (ch) { + case "n" : return "\n"; + case "r" : return "\r"; + case "t" : return "\t"; + case "b" : return "\b"; + case "v" : return "\u000b"; + case "f" : return "\f"; + case "0" : return "\0"; + case "x" : return String.fromCharCode(hex_bytes(2)); + case "u" : return String.fromCharCode(hex_bytes(4)); + case "\n": return ""; + default : return ch; + } + }; + + function hex_bytes(n) { + var num = 0; + for (; n > 0; --n) { + var digit = parseInt(next(true), 16); + if (isNaN(digit)) + parse_error("Invalid hex-character pattern in string"); + num = (num << 4) | digit; + } + return num; + }; + + function read_string() { + return with_eof_error("Unterminated string constant", function(){ + var quote = next(), ret = ""; + for (;;) { + var ch = next(true); + if (ch == "\\") { + // read OctalEscapeSequence (XXX: deprecated if "strict mode") + // https://github.com/mishoo/UglifyJS/issues/178 + var octal_len = 0, first = null; + ch = read_while(function(ch){ + if (ch >= "0" && ch <= "7") { + if (!first) { + first = ch; + return ++octal_len; + } + else if (first <= "3" && octal_len <= 2) return ++octal_len; + else if (first >= "4" && octal_len <= 1) return ++octal_len; + } + return false; + }); + if (octal_len > 0) ch = String.fromCharCode(parseInt(ch, 8)); + else ch = read_escaped_char(true); + } + else if (ch == quote) break; + ret += ch; + } + return token("string", ret); + }); + }; + + function read_line_comment() { + next(); + var i = find("\n"), ret; + if (i == -1) { + ret = S.text.substr(S.pos); + S.pos = S.text.length; + } else { + ret = S.text.substring(S.pos, i); + S.pos = i; + } + return token("comment1", ret, true); + }; + + function read_multiline_comment() { + next(); + return with_eof_error("Unterminated multiline comment", function(){ + var i = find("*/", true), + text = S.text.substring(S.pos, i); + S.pos = i + 2; + S.line += text.split("\n").length - 1; + S.newline_before = text.indexOf("\n") >= 0; + + // https://github.com/mishoo/UglifyJS/issues/#issue/100 + if (/^@cc_on/i.test(text)) { + warn("WARNING: at line " + S.line); + warn("*** Found \"conditional comment\": " + text); + warn("*** UglifyJS DISCARDS ALL COMMENTS. This means your code might no longer work properly in Internet Explorer."); + } + + return token("comment2", text, true); + }); + }; + + function read_name() { + var backslash = false, name = "", ch; + while ((ch = peek()) != null) { + if (!backslash) { + if (ch == "\\") backslash = true, next(); + else if (is_identifier_char(ch)) name += next(); + else break; + } + else { + if (ch != "u") parse_error("Expecting UnicodeEscapeSequence -- uXXXX"); + ch = read_escaped_char(); + if (!is_identifier_char(ch)) parse_error("Unicode char: " + ch.charCodeAt(0) + " is not valid in identifier"); + name += ch; + backslash = false; + } + } + return name; + }; + + function read_regexp(regexp) { + return with_eof_error("Unterminated regular expression", function(){ + var prev_backslash = false, ch, in_class = false; + while ((ch = next(true))) if (prev_backslash) { + regexp += "\\" + ch; + prev_backslash = false; + } else if (ch == "[") { + in_class = true; + regexp += ch; + } else if (ch == "]" && in_class) { + in_class = false; + regexp += ch; + } else if (ch == "/" && !in_class) { + break; + } else if (ch == "\\") { + prev_backslash = true; + } else { + regexp += ch; + } + var mods = read_name(); + return token("regexp", [ regexp, mods ]); + }); + }; + + function read_operator(prefix) { + function grow(op) { + if (!peek()) return op; + var bigger = op + peek(); + if (HOP(OPERATORS, bigger)) { + next(); + return grow(bigger); + } else { + return op; + } + }; + return token("operator", grow(prefix || next())); + }; + + function handle_slash() { + next(); + var regex_allowed = S.regex_allowed; + switch (peek()) { + case "/": + S.comments_before.push(read_line_comment()); + S.regex_allowed = regex_allowed; + return next_token(); + case "*": + S.comments_before.push(read_multiline_comment()); + S.regex_allowed = regex_allowed; + return next_token(); + } + return S.regex_allowed ? read_regexp("") : read_operator("/"); + }; + + function handle_dot() { + next(); + return is_digit(peek()) + ? read_num(".") + : token("punc", "."); + }; + + function read_word() { + var word = read_name(); + return !HOP(KEYWORDS, word) + ? token("name", word) + : HOP(OPERATORS, word) + ? token("operator", word) + : HOP(KEYWORDS_ATOM, word) + ? token("atom", word) + : token("keyword", word); + }; + + function with_eof_error(eof_error, cont) { + try { + return cont(); + } catch(ex) { + if (ex === EX_EOF) parse_error(eof_error); + else throw ex; + } + }; + + function next_token(force_regexp) { + if (force_regexp != null) + return read_regexp(force_regexp); + skip_whitespace(); + start_token(); + var ch = peek(); + if (!ch) return token("eof"); + if (is_digit(ch)) return read_num(); + if (ch == '"' || ch == "'") return read_string(); + if (HOP(PUNC_CHARS, ch)) return token("punc", next()); + if (ch == ".") return handle_dot(); + if (ch == "/") return handle_slash(); + if (HOP(OPERATOR_CHARS, ch)) return read_operator(); + if (ch == "\\" || is_identifier_start(ch)) return read_word(); + parse_error("Unexpected character '" + ch + "'"); + }; + + next_token.context = function(nc) { + if (nc) S = nc; + return S; + }; + + return next_token; + +}; + +/* -----[ Parser (constants) ]----- */ + +var UNARY_PREFIX = array_to_hash([ + "typeof", + "void", + "delete", + "--", + "++", + "!", + "~", + "-", + "+" +]); + +var UNARY_POSTFIX = array_to_hash([ "--", "++" ]); + +var ASSIGNMENT = (function(a, ret, i){ + while (i < a.length) { + ret[a[i]] = a[i].substr(0, a[i].length - 1); + i++; + } + return ret; +})( + ["+=", "-=", "/=", "*=", "%=", ">>=", "<<=", ">>>=", "|=", "^=", "&="], + { "=": true }, + 0 +); + +var PRECEDENCE = (function(a, ret){ + for (var i = 0, n = 1; i < a.length; ++i, ++n) { + var b = a[i]; + for (var j = 0; j < b.length; ++j) { + ret[b[j]] = n; + } + } + return ret; +})( + [ + ["||"], + ["&&"], + ["|"], + ["^"], + ["&"], + ["==", "===", "!=", "!=="], + ["<", ">", "<=", ">=", "in", "instanceof"], + [">>", "<<", ">>>"], + ["+", "-"], + ["*", "/", "%"] + ], + {} +); + +var STATEMENTS_WITH_LABELS = array_to_hash([ "for", "do", "while", "switch" ]); + +var ATOMIC_START_TOKEN = array_to_hash([ "atom", "num", "string", "regexp", "name" ]); + +/* -----[ Parser ]----- */ + +function NodeWithToken(str, start, end) { + this.name = str; + this.start = start; + this.end = end; +}; + +NodeWithToken.prototype.toString = function() { return this.name; }; + +function parse($TEXT, exigent_mode, embed_tokens) { + + var S = { + input : typeof $TEXT == "string" ? tokenizer($TEXT, true) : $TEXT, + token : null, + prev : null, + peeked : null, + in_function : 0, + in_loop : 0, + labels : [] + }; + + S.token = next(); + + function is(type, value) { + return is_token(S.token, type, value); + }; + + function peek() { return S.peeked || (S.peeked = S.input()); }; + + function next() { + S.prev = S.token; + if (S.peeked) { + S.token = S.peeked; + S.peeked = null; + } else { + S.token = S.input(); + } + return S.token; + }; + + function prev() { + return S.prev; + }; + + function croak(msg, line, col, pos) { + var ctx = S.input.context(); + js_error(msg, + line != null ? line : ctx.tokline, + col != null ? col : ctx.tokcol, + pos != null ? pos : ctx.tokpos); + }; + + function token_error(token, msg) { + croak(msg, token.line, token.col); + }; + + function unexpected(token) { + if (token == null) + token = S.token; + token_error(token, "Unexpected token: " + token.type + " (" + token.value + ")"); + }; + + function expect_token(type, val) { + if (is(type, val)) { + return next(); + } + token_error(S.token, "Unexpected token " + S.token.type + ", expected " + type); + }; + + function expect(punc) { return expect_token("punc", punc); }; + + function can_insert_semicolon() { + return !exigent_mode && ( + S.token.nlb || is("eof") || is("punc", "}") + ); + }; + + function semicolon() { + if (is("punc", ";")) next(); + else if (!can_insert_semicolon()) unexpected(); + }; + + function as() { + return slice(arguments); + }; + + function parenthesised() { + expect("("); + var ex = expression(); + expect(")"); + return ex; + }; + + function add_tokens(str, start, end) { + return str instanceof NodeWithToken ? str : new NodeWithToken(str, start, end); + }; + + function maybe_embed_tokens(parser) { + if (embed_tokens) return function() { + var start = S.token; + var ast = parser.apply(this, arguments); + ast[0] = add_tokens(ast[0], start, prev()); + return ast; + }; + else return parser; + }; + + var statement = maybe_embed_tokens(function() { + if (is("operator", "/") || is("operator", "/=")) { + S.peeked = null; + S.token = S.input(S.token.value.substr(1)); // force regexp + } + switch (S.token.type) { + case "num": + case "string": + case "regexp": + case "operator": + case "atom": + return simple_statement(); + + case "name": + return is_token(peek(), "punc", ":") + ? labeled_statement(prog1(S.token.value, next, next)) + : simple_statement(); + + case "punc": + switch (S.token.value) { + case "{": + return as("block", block_()); + case "[": + case "(": + return simple_statement(); + case ";": + next(); + return as("block"); + default: + unexpected(); + } + + case "keyword": + switch (prog1(S.token.value, next)) { + case "break": + return break_cont("break"); + + case "continue": + return break_cont("continue"); + + case "debugger": + semicolon(); + return as("debugger"); + + case "do": + return (function(body){ + expect_token("keyword", "while"); + return as("do", prog1(parenthesised, semicolon), body); + })(in_loop(statement)); + + case "for": + return for_(); + + case "function": + return function_(true); + + case "if": + return if_(); + + case "return": + if (S.in_function == 0) + croak("'return' outside of function"); + return as("return", + is("punc", ";") + ? (next(), null) + : can_insert_semicolon() + ? null + : prog1(expression, semicolon)); + + case "switch": + return as("switch", parenthesised(), switch_block_()); + + case "throw": + if (S.token.nlb) + croak("Illegal newline after 'throw'"); + return as("throw", prog1(expression, semicolon)); + + case "try": + return try_(); + + case "var": + return prog1(var_, semicolon); + + case "const": + return prog1(const_, semicolon); + + case "while": + return as("while", parenthesised(), in_loop(statement)); + + case "with": + return as("with", parenthesised(), statement()); + + default: + unexpected(); + } + } + }); + + function labeled_statement(label) { + S.labels.push(label); + var start = S.token, stat = statement(); + if (exigent_mode && !HOP(STATEMENTS_WITH_LABELS, stat[0])) + unexpected(start); + S.labels.pop(); + return as("label", label, stat); + }; + + function simple_statement() { + return as("stat", prog1(expression, semicolon)); + }; + + function break_cont(type) { + var name; + if (!can_insert_semicolon()) { + name = is("name") ? S.token.value : null; + } + if (name != null) { + next(); + if (!member(name, S.labels)) + croak("Label " + name + " without matching loop or statement"); + } + else if (S.in_loop == 0) + croak(type + " not inside a loop or switch"); + semicolon(); + return as(type, name); + }; + + function for_() { + expect("("); + var init = null; + if (!is("punc", ";")) { + init = is("keyword", "var") + ? (next(), var_(true)) + : expression(true, true); + if (is("operator", "in")) + return for_in(init); + } + return regular_for(init); + }; + + function regular_for(init) { + expect(";"); + var test = is("punc", ";") ? null : expression(); + expect(";"); + var step = is("punc", ")") ? null : expression(); + expect(")"); + return as("for", init, test, step, in_loop(statement)); + }; + + function for_in(init) { + var lhs = init[0] == "var" ? as("name", init[1][0]) : init; + next(); + var obj = expression(); + expect(")"); + return as("for-in", init, lhs, obj, in_loop(statement)); + }; + + var function_ = function(in_statement) { + var name = is("name") ? prog1(S.token.value, next) : null; + if (in_statement && !name) + unexpected(); + expect("("); + return as(in_statement ? "defun" : "function", + name, + // arguments + (function(first, a){ + while (!is("punc", ")")) { + if (first) first = false; else expect(","); + if (!is("name")) unexpected(); + a.push(S.token.value); + next(); + } + next(); + return a; + })(true, []), + // body + (function(){ + ++S.in_function; + var loop = S.in_loop; + S.in_loop = 0; + var a = block_(); + --S.in_function; + S.in_loop = loop; + return a; + })()); + }; + + function if_() { + var cond = parenthesised(), body = statement(), belse; + if (is("keyword", "else")) { + next(); + belse = statement(); + } + return as("if", cond, body, belse); + }; + + function block_() { + expect("{"); + var a = []; + while (!is("punc", "}")) { + if (is("eof")) unexpected(); + a.push(statement()); + } + next(); + return a; + }; + + var switch_block_ = curry(in_loop, function(){ + expect("{"); + var a = [], cur = null; + while (!is("punc", "}")) { + if (is("eof")) unexpected(); + if (is("keyword", "case")) { + next(); + cur = []; + a.push([ expression(), cur ]); + expect(":"); + } + else if (is("keyword", "default")) { + next(); + expect(":"); + cur = []; + a.push([ null, cur ]); + } + else { + if (!cur) unexpected(); + cur.push(statement()); + } + } + next(); + return a; + }); + + function try_() { + var body = block_(), bcatch, bfinally; + if (is("keyword", "catch")) { + next(); + expect("("); + if (!is("name")) + croak("Name expected"); + var name = S.token.value; + next(); + expect(")"); + bcatch = [ name, block_() ]; + } + if (is("keyword", "finally")) { + next(); + bfinally = block_(); + } + if (!bcatch && !bfinally) + croak("Missing catch/finally blocks"); + return as("try", body, bcatch, bfinally); + }; + + function vardefs(no_in) { + var a = []; + for (;;) { + if (!is("name")) + unexpected(); + var name = S.token.value; + next(); + if (is("operator", "=")) { + next(); + a.push([ name, expression(false, no_in) ]); + } else { + a.push([ name ]); + } + if (!is("punc", ",")) + break; + next(); + } + return a; + }; + + function var_(no_in) { + return as("var", vardefs(no_in)); + }; + + function const_() { + return as("const", vardefs()); + }; + + function new_() { + var newexp = expr_atom(false), args; + if (is("punc", "(")) { + next(); + args = expr_list(")"); + } else { + args = []; + } + return subscripts(as("new", newexp, args), true); + }; + + var expr_atom = maybe_embed_tokens(function(allow_calls) { + if (is("operator", "new")) { + next(); + return new_(); + } + if (is("punc")) { + switch (S.token.value) { + case "(": + next(); + return subscripts(prog1(expression, curry(expect, ")")), allow_calls); + case "[": + next(); + return subscripts(array_(), allow_calls); + case "{": + next(); + return subscripts(object_(), allow_calls); + } + unexpected(); + } + if (is("keyword", "function")) { + next(); + return subscripts(function_(false), allow_calls); + } + if (HOP(ATOMIC_START_TOKEN, S.token.type)) { + var atom = S.token.type == "regexp" + ? as("regexp", S.token.value[0], S.token.value[1]) + : as(S.token.type, S.token.value); + return subscripts(prog1(atom, next), allow_calls); + } + unexpected(); + }); + + function expr_list(closing, allow_trailing_comma, allow_empty) { + var first = true, a = []; + while (!is("punc", closing)) { + if (first) first = false; else expect(","); + if (allow_trailing_comma && is("punc", closing)) break; + if (is("punc", ",") && allow_empty) { + a.push([ "atom", "undefined" ]); + } else { + a.push(expression(false)); + } + } + next(); + return a; + }; + + function array_() { + return as("array", expr_list("]", !exigent_mode, true)); + }; + + function object_() { + var first = true, a = []; + while (!is("punc", "}")) { + if (first) first = false; else expect(","); + if (!exigent_mode && is("punc", "}")) + // allow trailing comma + break; + var type = S.token.type; + var name = as_property_name(); + if (type == "name" && (name == "get" || name == "set") && !is("punc", ":")) { + a.push([ as_name(), function_(false), name ]); + } else { + expect(":"); + a.push([ name, expression(false) ]); + } + } + next(); + return as("object", a); + }; + + function as_property_name() { + switch (S.token.type) { + case "num": + case "string": + return prog1(S.token.value, next); + } + return as_name(); + }; + + function as_name() { + switch (S.token.type) { + case "name": + case "operator": + case "keyword": + case "atom": + return prog1(S.token.value, next); + default: + unexpected(); + } + }; + + function subscripts(expr, allow_calls) { + if (is("punc", ".")) { + next(); + return subscripts(as("dot", expr, as_name()), allow_calls); + } + if (is("punc", "[")) { + next(); + return subscripts(as("sub", expr, prog1(expression, curry(expect, "]"))), allow_calls); + } + if (allow_calls && is("punc", "(")) { + next(); + return subscripts(as("call", expr, expr_list(")")), true); + } + return expr; + }; + + function maybe_unary(allow_calls) { + if (is("operator") && HOP(UNARY_PREFIX, S.token.value)) { + return make_unary("unary-prefix", + prog1(S.token.value, next), + maybe_unary(allow_calls)); + } + var val = expr_atom(allow_calls); + while (is("operator") && HOP(UNARY_POSTFIX, S.token.value) && !S.token.nlb) { + val = make_unary("unary-postfix", S.token.value, val); + next(); + } + return val; + }; + + function make_unary(tag, op, expr) { + if ((op == "++" || op == "--") && !is_assignable(expr)) + croak("Invalid use of " + op + " operator"); + return as(tag, op, expr); + }; + + function expr_op(left, min_prec, no_in) { + var op = is("operator") ? S.token.value : null; + if (op && op == "in" && no_in) op = null; + var prec = op != null ? PRECEDENCE[op] : null; + if (prec != null && prec > min_prec) { + next(); + var right = expr_op(maybe_unary(true), prec, no_in); + return expr_op(as("binary", op, left, right), min_prec, no_in); + } + return left; + }; + + function expr_ops(no_in) { + return expr_op(maybe_unary(true), 0, no_in); + }; + + function maybe_conditional(no_in) { + var expr = expr_ops(no_in); + if (is("operator", "?")) { + next(); + var yes = expression(false); + expect(":"); + return as("conditional", expr, yes, expression(false, no_in)); + } + return expr; + }; + + function is_assignable(expr) { + if (!exigent_mode) return true; + switch (expr[0]+"") { + case "dot": + case "sub": + case "new": + case "call": + return true; + case "name": + return expr[1] != "this"; + } + }; + + function maybe_assign(no_in) { + var left = maybe_conditional(no_in), val = S.token.value; + if (is("operator") && HOP(ASSIGNMENT, val)) { + if (is_assignable(left)) { + next(); + return as("assign", ASSIGNMENT[val], left, maybe_assign(no_in)); + } + croak("Invalid assignment"); + } + return left; + }; + + var expression = maybe_embed_tokens(function(commas, no_in) { + if (arguments.length == 0) + commas = true; + var expr = maybe_assign(no_in); + if (commas && is("punc", ",")) { + next(); + return as("seq", expr, expression(true, no_in)); + } + return expr; + }); + + function in_loop(cont) { + try { + ++S.in_loop; + return cont(); + } finally { + --S.in_loop; + } + }; + + return as("toplevel", (function(a){ + while (!is("eof")) + a.push(statement()); + return a; + })([])); + +}; + +/* -----[ Utilities ]----- */ + +function curry(f) { + var args = slice(arguments, 1); + return function() { return f.apply(this, args.concat(slice(arguments))); }; +}; + +function prog1(ret) { + if (ret instanceof Function) + ret = ret(); + for (var i = 1, n = arguments.length; --n > 0; ++i) + arguments[i](); + return ret; +}; + +function array_to_hash(a) { + var ret = {}; + for (var i = 0; i < a.length; ++i) + ret[a[i]] = true; + return ret; +}; + +function slice(a, start) { + return Array.prototype.slice.call(a, start || 0); +}; + +function characters(str) { + return str.split(""); +}; + +function member(name, array) { + for (var i = array.length; --i >= 0;) + if (array[i] == name) + return true; + return false; +}; + +function HOP(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +}; + +var warn = function() {}; + +/* -----[ Exports ]----- */ + +exports.tokenizer = tokenizer; +exports.parse = parse; +exports.slice = slice; +exports.curry = curry; +exports.member = member; +exports.array_to_hash = array_to_hash; +exports.PRECEDENCE = PRECEDENCE; +exports.KEYWORDS_ATOM = KEYWORDS_ATOM; +exports.RESERVED_WORDS = RESERVED_WORDS; +exports.KEYWORDS = KEYWORDS; +exports.ATOMIC_START_TOKEN = ATOMIC_START_TOKEN; +exports.OPERATORS = OPERATORS; +exports.is_alphanumeric_char = is_alphanumeric_char; +exports.set_logger = function(logger) { + warn = logger; +}; + +}); +define('uglifyjs/squeeze-more', ["require", "exports", "module", "./parse-js", "./process"], function(require, exports, module) { + +var jsp = require("./parse-js"), + pro = require("./process"), + slice = jsp.slice, + member = jsp.member, + curry = jsp.curry, + MAP = pro.MAP, + PRECEDENCE = jsp.PRECEDENCE, + OPERATORS = jsp.OPERATORS; + +function ast_squeeze_more(ast) { + var w = pro.ast_walker(), walk = w.walk, scope; + function with_scope(s, cont) { + var save = scope, ret; + scope = s; + ret = cont(); + scope = save; + return ret; + }; + function _lambda(name, args, body) { + return [ this[0], name, args, with_scope(body.scope, curry(MAP, body, walk)) ]; + }; + return w.with_walkers({ + "toplevel": function(body) { + return [ this[0], with_scope(this.scope, curry(MAP, body, walk)) ]; + }, + "function": _lambda, + "defun": _lambda, + "new": function(ctor, args) { + if (ctor[0] == "name") { + if (ctor[1] == "Array" && !scope.has("Array")) { + if (args.length != 1) { + return [ "array", args ]; + } else { + return walk([ "call", [ "name", "Array" ], args ]); + } + } else if (ctor[1] == "Object" && !scope.has("Object")) { + if (!args.length) { + return [ "object", [] ]; + } else { + return walk([ "call", [ "name", "Object" ], args ]); + } + } else if ((ctor[1] == "RegExp" || ctor[1] == "Function" || ctor[1] == "Error") && !scope.has(ctor[1])) { + return walk([ "call", [ "name", ctor[1] ], args]); + } + } + }, + "call": function(expr, args) { + if (expr[0] == "dot" && expr[2] == "toString" && args.length == 0) { + // foo.toString() ==> foo+"" + return [ "binary", "+", expr[1], [ "string", "" ]]; + } + if (expr[0] == "name") { + if (expr[1] == "Array" && args.length != 1 && !scope.has("Array")) { + return [ "array", args ]; + } + if (expr[1] == "Object" && !args.length && !scope.has("Object")) { + return [ "object", [] ]; + } + if (expr[1] == "String" && !scope.has("String")) { + return [ "binary", "+", args[0], [ "string", "" ]]; + } + } + } + }, function() { + return walk(pro.ast_add_scope(ast)); + }); +}; + +exports.ast_squeeze_more = ast_squeeze_more; + +});define('uglifyjs/process', ["require", "exports", "module", "./parse-js", "./squeeze-more"], function(require, exports, module) { + +/*********************************************************************** + + A JavaScript tokenizer / parser / beautifier / compressor. + + This version is suitable for Node.js. With minimal changes (the + exports stuff) it should work on any JS platform. + + This file implements some AST processors. They work on data built + by parse-js. + + Exported functions: + + - ast_mangle(ast, options) -- mangles the variable/function names + in the AST. Returns an AST. + + - ast_squeeze(ast) -- employs various optimizations to make the + final generated code even smaller. Returns an AST. + + - gen_code(ast, options) -- generates JS code from the AST. Pass + true (or an object, see the code for some options) as second + argument to get "pretty" (indented) code. + + -------------------------------- (C) --------------------------------- + + Author: Mihai Bazon + + http://mihai.bazon.net/blog + + Distributed under the BSD license: + + Copyright 2010 (c) Mihai Bazon + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above + copyright notice, this list of conditions and the following + disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF + THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + + ***********************************************************************/ + +var jsp = require("./parse-js"), + slice = jsp.slice, + member = jsp.member, + PRECEDENCE = jsp.PRECEDENCE, + OPERATORS = jsp.OPERATORS; + +/* -----[ helper for AST traversal ]----- */ + +function ast_walker() { + function _vardefs(defs) { + return [ this[0], MAP(defs, function(def){ + var a = [ def[0] ]; + if (def.length > 1) + a[1] = walk(def[1]); + return a; + }) ]; + }; + function _block(statements) { + var out = [ this[0] ]; + if (statements != null) + out.push(MAP(statements, walk)); + return out; + }; + var walkers = { + "string": function(str) { + return [ this[0], str ]; + }, + "num": function(num) { + return [ this[0], num ]; + }, + "name": function(name) { + return [ this[0], name ]; + }, + "toplevel": function(statements) { + return [ this[0], MAP(statements, walk) ]; + }, + "block": _block, + "splice": _block, + "var": _vardefs, + "const": _vardefs, + "try": function(t, c, f) { + return [ + this[0], + MAP(t, walk), + c != null ? [ c[0], MAP(c[1], walk) ] : null, + f != null ? MAP(f, walk) : null + ]; + }, + "throw": function(expr) { + return [ this[0], walk(expr) ]; + }, + "new": function(ctor, args) { + return [ this[0], walk(ctor), MAP(args, walk) ]; + }, + "switch": function(expr, body) { + return [ this[0], walk(expr), MAP(body, function(branch){ + return [ branch[0] ? walk(branch[0]) : null, + MAP(branch[1], walk) ]; + }) ]; + }, + "break": function(label) { + return [ this[0], label ]; + }, + "continue": function(label) { + return [ this[0], label ]; + }, + "conditional": function(cond, t, e) { + return [ this[0], walk(cond), walk(t), walk(e) ]; + }, + "assign": function(op, lvalue, rvalue) { + return [ this[0], op, walk(lvalue), walk(rvalue) ]; + }, + "dot": function(expr) { + return [ this[0], walk(expr) ].concat(slice(arguments, 1)); + }, + "call": function(expr, args) { + return [ this[0], walk(expr), MAP(args, walk) ]; + }, + "function": function(name, args, body) { + return [ this[0], name, args.slice(), MAP(body, walk) ]; + }, + "defun": function(name, args, body) { + return [ this[0], name, args.slice(), MAP(body, walk) ]; + }, + "if": function(conditional, t, e) { + return [ this[0], walk(conditional), walk(t), walk(e) ]; + }, + "for": function(init, cond, step, block) { + return [ this[0], walk(init), walk(cond), walk(step), walk(block) ]; + }, + "for-in": function(vvar, key, hash, block) { + return [ this[0], walk(vvar), walk(key), walk(hash), walk(block) ]; + }, + "while": function(cond, block) { + return [ this[0], walk(cond), walk(block) ]; + }, + "do": function(cond, block) { + return [ this[0], walk(cond), walk(block) ]; + }, + "return": function(expr) { + return [ this[0], walk(expr) ]; + }, + "binary": function(op, left, right) { + return [ this[0], op, walk(left), walk(right) ]; + }, + "unary-prefix": function(op, expr) { + return [ this[0], op, walk(expr) ]; + }, + "unary-postfix": function(op, expr) { + return [ this[0], op, walk(expr) ]; + }, + "sub": function(expr, subscript) { + return [ this[0], walk(expr), walk(subscript) ]; + }, + "object": function(props) { + return [ this[0], MAP(props, function(p){ + return p.length == 2 + ? [ p[0], walk(p[1]) ] + : [ p[0], walk(p[1]), p[2] ]; // get/set-ter + }) ]; + }, + "regexp": function(rx, mods) { + return [ this[0], rx, mods ]; + }, + "array": function(elements) { + return [ this[0], MAP(elements, walk) ]; + }, + "stat": function(stat) { + return [ this[0], walk(stat) ]; + }, + "seq": function() { + return [ this[0] ].concat(MAP(slice(arguments), walk)); + }, + "label": function(name, block) { + return [ this[0], name, walk(block) ]; + }, + "with": function(expr, block) { + return [ this[0], walk(expr), walk(block) ]; + }, + "atom": function(name) { + return [ this[0], name ]; + } + }; + + var user = {}; + var stack = []; + function walk(ast) { + if (ast == null) + return null; + try { + stack.push(ast); + var type = ast[0]; + var gen = user[type]; + if (gen) { + var ret = gen.apply(ast, ast.slice(1)); + if (ret != null) + return ret; + } + gen = walkers[type]; + return gen.apply(ast, ast.slice(1)); + } finally { + stack.pop(); + } + }; + + function dive(ast) { + if (ast == null) + return null; + try { + stack.push(ast); + return walkers[ast[0]].apply(ast, ast.slice(1)); + } finally { + stack.pop(); + } + }; + + function with_walkers(walkers, cont){ + var save = {}, i; + for (i in walkers) if (HOP(walkers, i)) { + save[i] = user[i]; + user[i] = walkers[i]; + } + var ret = cont(); + for (i in save) if (HOP(save, i)) { + if (!save[i]) delete user[i]; + else user[i] = save[i]; + } + return ret; + }; + + return { + walk: walk, + dive: dive, + with_walkers: with_walkers, + parent: function() { + return stack[stack.length - 2]; // last one is current node + }, + stack: function() { + return stack; + } + }; +}; + +/* -----[ Scope and mangling ]----- */ + +function Scope(parent) { + this.names = {}; // names defined in this scope + this.mangled = {}; // mangled names (orig.name => mangled) + this.rev_mangled = {}; // reverse lookup (mangled => orig.name) + this.cname = -1; // current mangled name + this.refs = {}; // names referenced from this scope + this.uses_with = false; // will become TRUE if with() is detected in this or any subscopes + this.uses_eval = false; // will become TRUE if eval() is detected in this or any subscopes + this.parent = parent; // parent scope + this.children = []; // sub-scopes + if (parent) { + this.level = parent.level + 1; + parent.children.push(this); + } else { + this.level = 0; + } +}; + +var base54 = (function(){ + var DIGITS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_"; + return function(num) { + var ret = ""; + do { + ret = DIGITS.charAt(num % 54) + ret; + num = Math.floor(num / 54); + } while (num > 0); + return ret; + }; +})(); + +Scope.prototype = { + has: function(name) { + for (var s = this; s; s = s.parent) + if (HOP(s.names, name)) + return s; + }, + has_mangled: function(mname) { + for (var s = this; s; s = s.parent) + if (HOP(s.rev_mangled, mname)) + return s; + }, + toJSON: function() { + return { + names: this.names, + uses_eval: this.uses_eval, + uses_with: this.uses_with + }; + }, + + next_mangled: function() { + // we must be careful that the new mangled name: + // + // 1. doesn't shadow a mangled name from a parent + // scope, unless we don't reference the original + // name from this scope OR from any sub-scopes! + // This will get slow. + // + // 2. doesn't shadow an original name from a parent + // scope, in the event that the name is not mangled + // in the parent scope and we reference that name + // here OR IN ANY SUBSCOPES! + // + // 3. doesn't shadow a name that is referenced but not + // defined (possibly global defined elsewhere). + for (;;) { + var m = base54(++this.cname), prior; + + // case 1. + prior = this.has_mangled(m); + if (prior && this.refs[prior.rev_mangled[m]] === prior) + continue; + + // case 2. + prior = this.has(m); + if (prior && prior !== this && this.refs[m] === prior && !prior.has_mangled(m)) + continue; + + // case 3. + if (HOP(this.refs, m) && this.refs[m] == null) + continue; + + // I got "do" once. :-/ + if (!is_identifier(m)) + continue; + + return m; + } + }, + set_mangle: function(name, m) { + this.rev_mangled[m] = name; + return this.mangled[name] = m; + }, + get_mangled: function(name, newMangle) { + if (this.uses_eval || this.uses_with) return name; // no mangle if eval or with is in use + var s = this.has(name); + if (!s) return name; // not in visible scope, no mangle + if (HOP(s.mangled, name)) return s.mangled[name]; // already mangled in this scope + if (!newMangle) return name; // not found and no mangling requested + return s.set_mangle(name, s.next_mangled()); + }, + references: function(name) { + return name && !this.parent || this.uses_with || this.uses_eval || this.refs[name]; + }, + define: function(name, type) { + if (name != null) { + if (type == "var" || !HOP(this.names, name)) + this.names[name] = type || "var"; + return name; + } + } +}; + +function ast_add_scope(ast) { + + var current_scope = null; + var w = ast_walker(), walk = w.walk; + var having_eval = []; + + function with_new_scope(cont) { + current_scope = new Scope(current_scope); + current_scope.labels = new Scope(); + var ret = current_scope.body = cont(); + ret.scope = current_scope; + current_scope = current_scope.parent; + return ret; + }; + + function define(name, type) { + return current_scope.define(name, type); + }; + + function reference(name) { + current_scope.refs[name] = true; + }; + + function _lambda(name, args, body) { + var is_defun = this[0] == "defun"; + return [ this[0], is_defun ? define(name, "defun") : name, args, with_new_scope(function(){ + if (!is_defun) define(name, "lambda"); + MAP(args, function(name){ define(name, "arg") }); + return MAP(body, walk); + })]; + }; + + function _vardefs(type) { + return function(defs) { + MAP(defs, function(d){ + define(d[0], type); + if (d[1]) reference(d[0]); + }); + }; + }; + + function _breacont(label) { + if (label) + current_scope.labels.refs[label] = true; + }; + + return with_new_scope(function(){ + // process AST + var ret = w.with_walkers({ + "function": _lambda, + "defun": _lambda, + "label": function(name, stat) { current_scope.labels.define(name) }, + "break": _breacont, + "continue": _breacont, + "with": function(expr, block) { + for (var s = current_scope; s; s = s.parent) + s.uses_with = true; + }, + "var": _vardefs("var"), + "const": _vardefs("const"), + "try": function(t, c, f) { + if (c != null) return [ + this[0], + MAP(t, walk), + [ define(c[0], "catch"), MAP(c[1], walk) ], + f != null ? MAP(f, walk) : null + ]; + }, + "name": function(name) { + if (name == "eval") + having_eval.push(current_scope); + reference(name); + } + }, function(){ + return walk(ast); + }); + + // the reason why we need an additional pass here is + // that names can be used prior to their definition. + + // scopes where eval was detected and their parents + // are marked with uses_eval, unless they define the + // "eval" name. + MAP(having_eval, function(scope){ + if (!scope.has("eval")) while (scope) { + scope.uses_eval = true; + scope = scope.parent; + } + }); + + // for referenced names it might be useful to know + // their origin scope. current_scope here is the + // toplevel one. + function fixrefs(scope, i) { + // do children first; order shouldn't matter + for (i = scope.children.length; --i >= 0;) + fixrefs(scope.children[i]); + for (i in scope.refs) if (HOP(scope.refs, i)) { + // find origin scope and propagate the reference to origin + for (var origin = scope.has(i), s = scope; s; s = s.parent) { + s.refs[i] = origin; + if (s === origin) break; + } + } + }; + fixrefs(current_scope); + + return ret; + }); + +}; + +/* -----[ mangle names ]----- */ + +function ast_mangle(ast, options) { + var w = ast_walker(), walk = w.walk, scope; + options = options || {}; + + function get_mangled(name, newMangle) { + if (!options.toplevel && !scope.parent) return name; // don't mangle toplevel + if (options.except && member(name, options.except)) + return name; + return scope.get_mangled(name, newMangle); + }; + + function get_define(name) { + if (options.defines) { + // we always lookup a defined symbol for the current scope FIRST, so declared + // vars trump a DEFINE symbol, but if no such var is found, then match a DEFINE value + if (!scope.has(name)) { + if (HOP(options.defines, name)) { + return options.defines[name]; + } + } + return null; + } + }; + + function _lambda(name, args, body) { + if (!options.no_functions) { + var is_defun = this[0] == "defun", extra; + if (name) { + if (is_defun) name = get_mangled(name); + else if (body.scope.references(name)) { + extra = {}; + if (!(scope.uses_eval || scope.uses_with)) + name = extra[name] = scope.next_mangled(); + else + extra[name] = name; + } + else name = null; + } + } + body = with_scope(body.scope, function(){ + args = MAP(args, function(name){ return get_mangled(name) }); + return MAP(body, walk); + }, extra); + return [ this[0], name, args, body ]; + }; + + function with_scope(s, cont, extra) { + var _scope = scope; + scope = s; + if (extra) for (var i in extra) if (HOP(extra, i)) { + s.set_mangle(i, extra[i]); + } + for (var i in s.names) if (HOP(s.names, i)) { + get_mangled(i, true); + } + var ret = cont(); + ret.scope = s; + scope = _scope; + return ret; + }; + + function _vardefs(defs) { + return [ this[0], MAP(defs, function(d){ + return [ get_mangled(d[0]), walk(d[1]) ]; + }) ]; + }; + + function _breacont(label) { + if (label) return [ this[0], scope.labels.get_mangled(label) ]; + }; + + return w.with_walkers({ + "function": _lambda, + "defun": function() { + // move function declarations to the top when + // they are not in some block. + var ast = _lambda.apply(this, arguments); + switch (w.parent()[0]) { + case "toplevel": + case "function": + case "defun": + return MAP.at_top(ast); + } + return ast; + }, + "label": function(label, stat) { + if (scope.labels.refs[label]) return [ + this[0], + scope.labels.get_mangled(label, true), + walk(stat) + ]; + return walk(stat); + }, + "break": _breacont, + "continue": _breacont, + "var": _vardefs, + "const": _vardefs, + "name": function(name) { + return get_define(name) || [ this[0], get_mangled(name) ]; + }, + "try": function(t, c, f) { + return [ this[0], + MAP(t, walk), + c != null ? [ get_mangled(c[0]), MAP(c[1], walk) ] : null, + f != null ? MAP(f, walk) : null ]; + }, + "toplevel": function(body) { + var self = this; + return with_scope(self.scope, function(){ + return [ self[0], MAP(body, walk) ]; + }); + } + }, function() { + return walk(ast_add_scope(ast)); + }); +}; + +/* -----[ + - compress foo["bar"] into foo.bar, + - remove block brackets {} where possible + - join consecutive var declarations + - various optimizations for IFs: + - if (cond) foo(); else bar(); ==> cond?foo():bar(); + - if (cond) foo(); ==> cond&&foo(); + - if (foo) return bar(); else return baz(); ==> return foo?bar():baz(); // also for throw + - if (foo) return bar(); else something(); ==> {if(foo)return bar();something()} + ]----- */ + +var warn = function(){}; + +function best_of(ast1, ast2) { + return gen_code(ast1).length > gen_code(ast2[0] == "stat" ? ast2[1] : ast2).length ? ast2 : ast1; +}; + +function last_stat(b) { + if (b[0] == "block" && b[1] && b[1].length > 0) + return b[1][b[1].length - 1]; + return b; +} + +function aborts(t) { + if (t) switch (last_stat(t)[0]) { + case "return": + case "break": + case "continue": + case "throw": + return true; + } +}; + +function boolean_expr(expr) { + return ( (expr[0] == "unary-prefix" + && member(expr[1], [ "!", "delete" ])) || + + (expr[0] == "binary" + && member(expr[1], [ "in", "instanceof", "==", "!=", "===", "!==", "<", "<=", ">=", ">" ])) || + + (expr[0] == "binary" + && member(expr[1], [ "&&", "||" ]) + && boolean_expr(expr[2]) + && boolean_expr(expr[3])) || + + (expr[0] == "conditional" + && boolean_expr(expr[2]) + && boolean_expr(expr[3])) || + + (expr[0] == "assign" + && expr[1] === true + && boolean_expr(expr[3])) || + + (expr[0] == "seq" + && boolean_expr(expr[expr.length - 1])) + ); +}; + +function empty(b) { + return !b || (b[0] == "block" && (!b[1] || b[1].length == 0)); +}; + +function is_string(node) { + return (node[0] == "string" || + node[0] == "unary-prefix" && node[1] == "typeof" || + node[0] == "binary" && node[1] == "+" && + (is_string(node[2]) || is_string(node[3]))); +}; + +var when_constant = (function(){ + + var $NOT_CONSTANT = {}; + + // this can only evaluate constant expressions. If it finds anything + // not constant, it throws $NOT_CONSTANT. + function evaluate(expr) { + switch (expr[0]) { + case "string": + case "num": + return expr[1]; + case "name": + case "atom": + switch (expr[1]) { + case "true": return true; + case "false": return false; + case "null": return null; + } + break; + case "unary-prefix": + switch (expr[1]) { + case "!": return !evaluate(expr[2]); + case "typeof": return typeof evaluate(expr[2]); + case "~": return ~evaluate(expr[2]); + case "-": return -evaluate(expr[2]); + case "+": return +evaluate(expr[2]); + } + break; + case "binary": + var left = expr[2], right = expr[3]; + switch (expr[1]) { + case "&&" : return evaluate(left) && evaluate(right); + case "||" : return evaluate(left) || evaluate(right); + case "|" : return evaluate(left) | evaluate(right); + case "&" : return evaluate(left) & evaluate(right); + case "^" : return evaluate(left) ^ evaluate(right); + case "+" : return evaluate(left) + evaluate(right); + case "*" : return evaluate(left) * evaluate(right); + case "/" : return evaluate(left) / evaluate(right); + case "%" : return evaluate(left) % evaluate(right); + case "-" : return evaluate(left) - evaluate(right); + case "<<" : return evaluate(left) << evaluate(right); + case ">>" : return evaluate(left) >> evaluate(right); + case ">>>" : return evaluate(left) >>> evaluate(right); + case "==" : return evaluate(left) == evaluate(right); + case "===" : return evaluate(left) === evaluate(right); + case "!=" : return evaluate(left) != evaluate(right); + case "!==" : return evaluate(left) !== evaluate(right); + case "<" : return evaluate(left) < evaluate(right); + case "<=" : return evaluate(left) <= evaluate(right); + case ">" : return evaluate(left) > evaluate(right); + case ">=" : return evaluate(left) >= evaluate(right); + case "in" : return evaluate(left) in evaluate(right); + case "instanceof" : return evaluate(left) instanceof evaluate(right); + } + } + throw $NOT_CONSTANT; + }; + + return function(expr, yes, no) { + try { + var val = evaluate(expr), ast; + switch (typeof val) { + case "string": ast = [ "string", val ]; break; + case "number": ast = [ "num", val ]; break; + case "boolean": ast = [ "name", String(val) ]; break; + default: throw new Error("Can't handle constant of type: " + (typeof val)); + } + return yes.call(expr, ast, val); + } catch(ex) { + if (ex === $NOT_CONSTANT) { + if (expr[0] == "binary" + && (expr[1] == "===" || expr[1] == "!==") + && ((is_string(expr[2]) && is_string(expr[3])) + || (boolean_expr(expr[2]) && boolean_expr(expr[3])))) { + expr[1] = expr[1].substr(0, 2); + } + else if (no && expr[0] == "binary" + && (expr[1] == "||" || expr[1] == "&&")) { + // the whole expression is not constant but the lval may be... + try { + var lval = evaluate(expr[2]); + expr = ((expr[1] == "&&" && (lval ? expr[3] : lval)) || + (expr[1] == "||" && (lval ? lval : expr[3])) || + expr); + } catch(ex2) { + // IGNORE... lval is not constant + } + } + return no ? no.call(expr, expr) : null; + } + else throw ex; + } + }; + +})(); + +function warn_unreachable(ast) { + if (!empty(ast)) + warn("Dropping unreachable code: " + gen_code(ast, true)); +}; + +function prepare_ifs(ast) { + var w = ast_walker(), walk = w.walk; + // In this first pass, we rewrite ifs which abort with no else with an + // if-else. For example: + // + // if (x) { + // blah(); + // return y; + // } + // foobar(); + // + // is rewritten into: + // + // if (x) { + // blah(); + // return y; + // } else { + // foobar(); + // } + function redo_if(statements) { + statements = MAP(statements, walk); + + for (var i = 0; i < statements.length; ++i) { + var fi = statements[i]; + if (fi[0] != "if") continue; + + if (fi[3] && walk(fi[3])) continue; + + var t = walk(fi[2]); + if (!aborts(t)) continue; + + var conditional = walk(fi[1]); + + var e_body = statements.slice(i + 1); + var e = e_body.length == 1 ? e_body[0] : [ "block", e_body ]; + + var ret = statements.slice(0, i).concat([ [ + fi[0], // "if" + conditional, // conditional + t, // then + e // else + ] ]); + + return redo_if(ret); + } + + return statements; + }; + + function redo_if_lambda(name, args, body) { + body = redo_if(body); + return [ this[0], name, args, body ]; + }; + + function redo_if_block(statements) { + return [ this[0], statements != null ? redo_if(statements) : null ]; + }; + + return w.with_walkers({ + "defun": redo_if_lambda, + "function": redo_if_lambda, + "block": redo_if_block, + "splice": redo_if_block, + "toplevel": function(statements) { + return [ this[0], redo_if(statements) ]; + }, + "try": function(t, c, f) { + return [ + this[0], + redo_if(t), + c != null ? [ c[0], redo_if(c[1]) ] : null, + f != null ? redo_if(f) : null + ]; + } + }, function() { + return walk(ast); + }); +}; + +function for_side_effects(ast, handler) { + var w = ast_walker(), walk = w.walk; + var $stop = {}, $restart = {}; + function stop() { throw $stop }; + function restart() { throw $restart }; + function found(){ return handler.call(this, this, w, stop, restart) }; + function unary(op) { + if (op == "++" || op == "--") + return found.apply(this, arguments); + }; + return w.with_walkers({ + "try": found, + "throw": found, + "return": found, + "new": found, + "switch": found, + "break": found, + "continue": found, + "assign": found, + "call": found, + "if": found, + "for": found, + "for-in": found, + "while": found, + "do": found, + "return": found, + "unary-prefix": unary, + "unary-postfix": unary, + "defun": found + }, function(){ + while (true) try { + walk(ast); + break; + } catch(ex) { + if (ex === $stop) break; + if (ex === $restart) continue; + throw ex; + } + }); +}; + +function ast_lift_variables(ast) { + var w = ast_walker(), walk = w.walk, scope; + function do_body(body, env) { + var _scope = scope; + scope = env; + body = MAP(body, walk); + var hash = {}, names = MAP(env.names, function(type, name){ + if (type != "var") return MAP.skip; + if (!env.references(name)) return MAP.skip; + hash[name] = true; + return [ name ]; + }); + if (names.length > 0) { + // looking for assignments to any of these variables. + // we can save considerable space by moving the definitions + // in the var declaration. + for_side_effects([ "block", body ], function(ast, walker, stop, restart) { + if (ast[0] == "assign" + && ast[1] === true + && ast[2][0] == "name" + && HOP(hash, ast[2][1])) { + // insert the definition into the var declaration + for (var i = names.length; --i >= 0;) { + if (names[i][0] == ast[2][1]) { + if (names[i][1]) // this name already defined, we must stop + stop(); + names[i][1] = ast[3]; // definition + names.push(names.splice(i, 1)[0]); + break; + } + } + // remove this assignment from the AST. + var p = walker.parent(); + if (p[0] == "seq") { + var a = p[2]; + a.unshift(0, p.length); + p.splice.apply(p, a); + } + else if (p[0] == "stat") { + p.splice(0, p.length, "block"); // empty statement + } + else { + stop(); + } + restart(); + } + stop(); + }); + body.unshift([ "var", names ]); + } + scope = _scope; + return body; + }; + function _vardefs(defs) { + var ret = null; + for (var i = defs.length; --i >= 0;) { + var d = defs[i]; + if (!d[1]) continue; + d = [ "assign", true, [ "name", d[0] ], d[1] ]; + if (ret == null) ret = d; + else ret = [ "seq", d, ret ]; + } + if (ret == null) { + if (w.parent()[0] == "for-in") + return [ "name", defs[0][0] ]; + return MAP.skip; + } + return [ "stat", ret ]; + }; + function _toplevel(body) { + return [ this[0], do_body(body, this.scope) ]; + }; + return w.with_walkers({ + "function": function(name, args, body){ + for (var i = args.length; --i >= 0 && !body.scope.references(args[i]);) + args.pop(); + if (!body.scope.references(name)) name = null; + return [ this[0], name, args, do_body(body, body.scope) ]; + }, + "defun": function(name, args, body){ + if (!scope.references(name)) return MAP.skip; + for (var i = args.length; --i >= 0 && !body.scope.references(args[i]);) + args.pop(); + return [ this[0], name, args, do_body(body, body.scope) ]; + }, + "var": _vardefs, + "toplevel": _toplevel + }, function(){ + return walk(ast_add_scope(ast)); + }); +}; + +function ast_squeeze(ast, options) { + options = defaults(options, { + make_seqs : true, + dead_code : true, + no_warnings : false, + keep_comps : true + }); + + var w = ast_walker(), walk = w.walk; + + function negate(c) { + var not_c = [ "unary-prefix", "!", c ]; + switch (c[0]) { + case "unary-prefix": + return c[1] == "!" && boolean_expr(c[2]) ? c[2] : not_c; + case "seq": + c = slice(c); + c[c.length - 1] = negate(c[c.length - 1]); + return c; + case "conditional": + return best_of(not_c, [ "conditional", c[1], negate(c[2]), negate(c[3]) ]); + case "binary": + var op = c[1], left = c[2], right = c[3]; + if (!options.keep_comps) switch (op) { + case "<=" : return [ "binary", ">", left, right ]; + case "<" : return [ "binary", ">=", left, right ]; + case ">=" : return [ "binary", "<", left, right ]; + case ">" : return [ "binary", "<=", left, right ]; + } + switch (op) { + case "==" : return [ "binary", "!=", left, right ]; + case "!=" : return [ "binary", "==", left, right ]; + case "===" : return [ "binary", "!==", left, right ]; + case "!==" : return [ "binary", "===", left, right ]; + case "&&" : return best_of(not_c, [ "binary", "||", negate(left), negate(right) ]); + case "||" : return best_of(not_c, [ "binary", "&&", negate(left), negate(right) ]); + } + break; + } + return not_c; + }; + + function make_conditional(c, t, e) { + var make_real_conditional = function() { + if (c[0] == "unary-prefix" && c[1] == "!") { + return e ? [ "conditional", c[2], e, t ] : [ "binary", "||", c[2], t ]; + } else { + return e ? best_of( + [ "conditional", c, t, e ], + [ "conditional", negate(c), e, t ] + ) : [ "binary", "&&", c, t ]; + } + }; + // shortcut the conditional if the expression has a constant value + return when_constant(c, function(ast, val){ + warn_unreachable(val ? e : t); + return (val ? t : e); + }, make_real_conditional); + }; + + function rmblock(block) { + if (block != null && block[0] == "block" && block[1]) { + if (block[1].length == 1) + block = block[1][0]; + else if (block[1].length == 0) + block = [ "block" ]; + } + return block; + }; + + function _lambda(name, args, body) { + return [ this[0], name, args, tighten(body, "lambda") ]; + }; + + // this function does a few things: + // 1. discard useless blocks + // 2. join consecutive var declarations + // 3. remove obviously dead code + // 4. transform consecutive statements using the comma operator + // 5. if block_type == "lambda" and it detects constructs like if(foo) return ... - rewrite like if (!foo) { ... } + function tighten(statements, block_type) { + statements = MAP(statements, walk); + + statements = statements.reduce(function(a, stat){ + if (stat[0] == "block") { + if (stat[1]) { + a.push.apply(a, stat[1]); + } + } else { + a.push(stat); + } + return a; + }, []); + + statements = (function(a, prev){ + statements.forEach(function(cur){ + if (prev && ((cur[0] == "var" && prev[0] == "var") || + (cur[0] == "const" && prev[0] == "const"))) { + prev[1] = prev[1].concat(cur[1]); + } else { + a.push(cur); + prev = cur; + } + }); + return a; + })([]); + + if (options.dead_code) statements = (function(a, has_quit){ + statements.forEach(function(st){ + if (has_quit) { + if (st[0] == "function" || st[0] == "defun") { + a.push(st); + } + else if (st[0] == "var" || st[0] == "const") { + if (!options.no_warnings) + warn("Variables declared in unreachable code"); + st[1] = MAP(st[1], function(def){ + if (def[1] && !options.no_warnings) + warn_unreachable([ "assign", true, [ "name", def[0] ], def[1] ]); + return [ def[0] ]; + }); + a.push(st); + } + else if (!options.no_warnings) + warn_unreachable(st); + } + else { + a.push(st); + if (member(st[0], [ "return", "throw", "break", "continue" ])) + has_quit = true; + } + }); + return a; + })([]); + + if (options.make_seqs) statements = (function(a, prev) { + statements.forEach(function(cur){ + if (prev && prev[0] == "stat" && cur[0] == "stat") { + prev[1] = [ "seq", prev[1], cur[1] ]; + } else { + a.push(cur); + prev = cur; + } + }); + if (a.length >= 2 + && a[a.length-2][0] == "stat" + && (a[a.length-1][0] == "return" || a[a.length-1][0] == "throw") + && a[a.length-1][1]) + { + a.splice(a.length - 2, 2, + [ a[a.length-1][0], + [ "seq", a[a.length-2][1], a[a.length-1][1] ]]); + } + return a; + })([]); + + // this increases jQuery by 1K. Probably not such a good idea after all.. + // part of this is done in prepare_ifs anyway. + // if (block_type == "lambda") statements = (function(i, a, stat){ + // while (i < statements.length) { + // stat = statements[i++]; + // if (stat[0] == "if" && !stat[3]) { + // if (stat[2][0] == "return" && stat[2][1] == null) { + // a.push(make_if(negate(stat[1]), [ "block", statements.slice(i) ])); + // break; + // } + // var last = last_stat(stat[2]); + // if (last[0] == "return" && last[1] == null) { + // a.push(make_if(stat[1], [ "block", stat[2][1].slice(0, -1) ], [ "block", statements.slice(i) ])); + // break; + // } + // } + // a.push(stat); + // } + // return a; + // })(0, []); + + return statements; + }; + + function make_if(c, t, e) { + return when_constant(c, function(ast, val){ + if (val) { + t = walk(t); + warn_unreachable(e); + return t || [ "block" ]; + } else { + e = walk(e); + warn_unreachable(t); + return e || [ "block" ]; + } + }, function() { + return make_real_if(c, t, e); + }); + }; + + function make_real_if(c, t, e) { + c = walk(c); + t = walk(t); + e = walk(e); + + if (empty(t)) { + c = negate(c); + t = e; + e = null; + } else if (empty(e)) { + e = null; + } else { + // if we have both else and then, maybe it makes sense to switch them? + (function(){ + var a = gen_code(c); + var n = negate(c); + var b = gen_code(n); + if (b.length < a.length) { + var tmp = t; + t = e; + e = tmp; + c = n; + } + })(); + } + if (empty(e) && empty(t)) + return [ "stat", c ]; + var ret = [ "if", c, t, e ]; + if (t[0] == "if" && empty(t[3]) && empty(e)) { + ret = best_of(ret, walk([ "if", [ "binary", "&&", c, t[1] ], t[2] ])); + } + else if (t[0] == "stat") { + if (e) { + if (e[0] == "stat") { + ret = best_of(ret, [ "stat", make_conditional(c, t[1], e[1]) ]); + } + } + else { + ret = best_of(ret, [ "stat", make_conditional(c, t[1]) ]); + } + } + else if (e && t[0] == e[0] && (t[0] == "return" || t[0] == "throw") && t[1] && e[1]) { + ret = best_of(ret, [ t[0], make_conditional(c, t[1], e[1] ) ]); + } + else if (e && aborts(t)) { + ret = [ [ "if", c, t ] ]; + if (e[0] == "block") { + if (e[1]) ret = ret.concat(e[1]); + } + else { + ret.push(e); + } + ret = walk([ "block", ret ]); + } + else if (t && aborts(e)) { + ret = [ [ "if", negate(c), e ] ]; + if (t[0] == "block") { + if (t[1]) ret = ret.concat(t[1]); + } else { + ret.push(t); + } + ret = walk([ "block", ret ]); + } + return ret; + }; + + function _do_while(cond, body) { + return when_constant(cond, function(cond, val){ + if (!val) { + warn_unreachable(body); + return [ "block" ]; + } else { + return [ "for", null, null, null, walk(body) ]; + } + }); + }; + + return w.with_walkers({ + "sub": function(expr, subscript) { + if (subscript[0] == "string") { + var name = subscript[1]; + if (is_identifier(name)) + return [ "dot", walk(expr), name ]; + else if (/^[1-9][0-9]*$/.test(name) || name === "0") + return [ "sub", walk(expr), [ "num", parseInt(name, 10) ] ]; + } + }, + "if": make_if, + "toplevel": function(body) { + return [ "toplevel", tighten(body) ]; + }, + "switch": function(expr, body) { + var last = body.length - 1; + return [ "switch", walk(expr), MAP(body, function(branch, i){ + var block = tighten(branch[1]); + if (i == last && block.length > 0) { + var node = block[block.length - 1]; + if (node[0] == "break" && !node[1]) + block.pop(); + } + return [ branch[0] ? walk(branch[0]) : null, block ]; + }) ]; + }, + "function": _lambda, + "defun": _lambda, + "block": function(body) { + if (body) return rmblock([ "block", tighten(body) ]); + }, + "binary": function(op, left, right) { + return when_constant([ "binary", op, walk(left), walk(right) ], function yes(c){ + return best_of(walk(c), this); + }, function no() { + return function(){ + if(op != "==" && op != "!=") return; + var l = walk(left), r = walk(right); + if(l && l[0] == "unary-prefix" && l[1] == "!" && l[2][0] == "num") + left = ['num', +!l[2][1]]; + else if (r && r[0] == "unary-prefix" && r[1] == "!" && r[2][0] == "num") + right = ['num', +!r[2][1]]; + return ["binary", op, left, right]; + }() || this; + }); + }, + "conditional": function(c, t, e) { + return make_conditional(walk(c), walk(t), walk(e)); + }, + "try": function(t, c, f) { + return [ + "try", + tighten(t), + c != null ? [ c[0], tighten(c[1]) ] : null, + f != null ? tighten(f) : null + ]; + }, + "unary-prefix": function(op, expr) { + expr = walk(expr); + var ret = [ "unary-prefix", op, expr ]; + if (op == "!") + ret = best_of(ret, negate(expr)); + return when_constant(ret, function(ast, val){ + return walk(ast); // it's either true or false, so minifies to !0 or !1 + }, function() { return ret }); + }, + "name": function(name) { + switch (name) { + case "true": return [ "unary-prefix", "!", [ "num", 0 ]]; + case "false": return [ "unary-prefix", "!", [ "num", 1 ]]; + } + }, + "while": _do_while, + "assign": function(op, lvalue, rvalue) { + lvalue = walk(lvalue); + rvalue = walk(rvalue); + var okOps = [ '+', '-', '/', '*', '%', '>>', '<<', '>>>', '|', '^', '&' ]; + if (op === true && lvalue[0] === "name" && rvalue[0] === "binary" && + ~okOps.indexOf(rvalue[1]) && rvalue[2][0] === "name" && + rvalue[2][1] === lvalue[1]) { + return [ this[0], rvalue[1], lvalue, rvalue[3] ] + } + return [ this[0], op, lvalue, rvalue ]; + } + }, function() { + for (var i = 0; i < 2; ++i) { + ast = prepare_ifs(ast); + ast = walk(ast); + } + return ast; + }); +}; + +/* -----[ re-generate code from the AST ]----- */ + +var DOT_CALL_NO_PARENS = jsp.array_to_hash([ + "name", + "array", + "object", + "string", + "dot", + "sub", + "call", + "regexp", + "defun" +]); + +function make_string(str, ascii_only) { + var dq = 0, sq = 0; + str = str.replace(/[\\\b\f\n\r\t\x22\x27\u2028\u2029\0]/g, function(s){ + switch (s) { + case "\\": return "\\\\"; + case "\b": return "\\b"; + case "\f": return "\\f"; + case "\n": return "\\n"; + case "\r": return "\\r"; + case "\t": return "\\t"; + case "\u2028": return "\\u2028"; + case "\u2029": return "\\u2029"; + case '"': ++dq; return '"'; + case "'": ++sq; return "'"; + case "\0": return "\\0"; + } + return s; + }); + if (ascii_only) str = to_ascii(str); + if (dq > sq) return "'" + str.replace(/\x27/g, "\\'") + "'"; + else return '"' + str.replace(/\x22/g, '\\"') + '"'; +}; + +function to_ascii(str) { + return str.replace(/[\u0080-\uffff]/g, function(ch) { + var code = ch.charCodeAt(0).toString(16); + while (code.length < 4) code = "0" + code; + return "\\u" + code; + }); +}; + +var SPLICE_NEEDS_BRACKETS = jsp.array_to_hash([ "if", "while", "do", "for", "for-in", "with" ]); + +function gen_code(ast, options) { + options = defaults(options, { + indent_start : 0, + indent_level : 4, + quote_keys : false, + space_colon : false, + beautify : false, + ascii_only : false, + inline_script: false + }); + var beautify = !!options.beautify; + var indentation = 0, + newline = beautify ? "\n" : "", + space = beautify ? " " : ""; + + function encode_string(str) { + var ret = make_string(str, options.ascii_only); + if (options.inline_script) + ret = ret.replace(/<\x2fscript([>\/\t\n\f\r ])/gi, "<\\/script$1"); + return ret; + }; + + function make_name(name) { + name = name.toString(); + if (options.ascii_only) + name = to_ascii(name); + return name; + }; + + function indent(line) { + if (line == null) + line = ""; + if (beautify) + line = repeat_string(" ", options.indent_start + indentation * options.indent_level) + line; + return line; + }; + + function with_indent(cont, incr) { + if (incr == null) incr = 1; + indentation += incr; + try { return cont.apply(null, slice(arguments, 1)); } + finally { indentation -= incr; } + }; + + function add_spaces(a) { + if (beautify) + return a.join(" "); + var b = []; + for (var i = 0; i < a.length; ++i) { + var next = a[i + 1]; + b.push(a[i]); + if (next && + ((/[a-z0-9_\x24]$/i.test(a[i].toString()) && /^[a-z0-9_\x24]/i.test(next.toString())) || + (/[\+\-]$/.test(a[i].toString()) && /^[\+\-]/.test(next.toString())))) { + b.push(" "); + } + } + return b.join(""); + }; + + function add_commas(a) { + return a.join("," + space); + }; + + function parenthesize(expr) { + var gen = make(expr); + for (var i = 1; i < arguments.length; ++i) { + var el = arguments[i]; + if ((el instanceof Function && el(expr)) || expr[0] == el) + return "(" + gen + ")"; + } + return gen; + }; + + function best_of(a) { + if (a.length == 1) { + return a[0]; + } + if (a.length == 2) { + var b = a[1]; + a = a[0]; + return a.length <= b.length ? a : b; + } + return best_of([ a[0], best_of(a.slice(1)) ]); + }; + + function needs_parens(expr) { + if (expr[0] == "function" || expr[0] == "object") { + // dot/call on a literal function requires the + // function literal itself to be parenthesized + // only if it's the first "thing" in a + // statement. This means that the parent is + // "stat", but it could also be a "seq" and + // we're the first in this "seq" and the + // parent is "stat", and so on. Messy stuff, + // but it worths the trouble. + var a = slice(w.stack()), self = a.pop(), p = a.pop(); + while (p) { + if (p[0] == "stat") return true; + if (((p[0] == "seq" || p[0] == "call" || p[0] == "dot" || p[0] == "sub" || p[0] == "conditional") && p[1] === self) || + ((p[0] == "binary" || p[0] == "assign" || p[0] == "unary-postfix") && p[2] === self)) { + self = p; + p = a.pop(); + } else { + return false; + } + } + } + return !HOP(DOT_CALL_NO_PARENS, expr[0]); + }; + + function make_num(num) { + var str = num.toString(10), a = [ str.replace(/^0\./, ".") ], m; + if (Math.floor(num) === num) { + if (num >= 0) { + a.push("0x" + num.toString(16).toLowerCase(), // probably pointless + "0" + num.toString(8)); // same. + } else { + a.push("-0x" + (-num).toString(16).toLowerCase(), // probably pointless + "-0" + (-num).toString(8)); // same. + } + if ((m = /^(.*?)(0+)$/.exec(num))) { + a.push(m[1] + "e" + m[2].length); + } + } else if ((m = /^0?\.(0+)(.*)$/.exec(num))) { + a.push(m[2] + "e-" + (m[1].length + m[2].length), + str.substr(str.indexOf("."))); + } + return best_of(a); + }; + + var w = ast_walker(); + var make = w.walk; + return w.with_walkers({ + "string": encode_string, + "num": make_num, + "name": make_name, + "toplevel": function(statements) { + return make_block_statements(statements) + .join(newline + newline); + }, + "splice": function(statements) { + var parent = w.parent(); + if (HOP(SPLICE_NEEDS_BRACKETS, parent)) { + // we need block brackets in this case + return make_block.apply(this, arguments); + } else { + return MAP(make_block_statements(statements, true), + function(line, i) { + // the first line is already indented + return i > 0 ? indent(line) : line; + }).join(newline); + } + }, + "block": make_block, + "var": function(defs) { + return "var " + add_commas(MAP(defs, make_1vardef)) + ";"; + }, + "const": function(defs) { + return "const " + add_commas(MAP(defs, make_1vardef)) + ";"; + }, + "try": function(tr, ca, fi) { + var out = [ "try", make_block(tr) ]; + if (ca) out.push("catch", "(" + ca[0] + ")", make_block(ca[1])); + if (fi) out.push("finally", make_block(fi)); + return add_spaces(out); + }, + "throw": function(expr) { + return add_spaces([ "throw", make(expr) ]) + ";"; + }, + "new": function(ctor, args) { + args = args.length > 0 ? "(" + add_commas(MAP(args, function(expr){ + return parenthesize(expr, "seq"); + })) + ")" : ""; + return add_spaces([ "new", parenthesize(ctor, "seq", "binary", "conditional", "assign", function(expr){ + var w = ast_walker(), has_call = {}; + try { + w.with_walkers({ + "call": function() { throw has_call }, + "function": function() { return this } + }, function(){ + w.walk(expr); + }); + } catch(ex) { + if (ex === has_call) + return true; + throw ex; + } + }) + args ]); + }, + "switch": function(expr, body) { + return add_spaces([ "switch", "(" + make(expr) + ")", make_switch_block(body) ]); + }, + "break": function(label) { + var out = "break"; + if (label != null) + out += " " + make_name(label); + return out + ";"; + }, + "continue": function(label) { + var out = "continue"; + if (label != null) + out += " " + make_name(label); + return out + ";"; + }, + "conditional": function(co, th, el) { + return add_spaces([ parenthesize(co, "assign", "seq", "conditional"), "?", + parenthesize(th, "seq"), ":", + parenthesize(el, "seq") ]); + }, + "assign": function(op, lvalue, rvalue) { + if (op && op !== true) op += "="; + else op = "="; + return add_spaces([ make(lvalue), op, parenthesize(rvalue, "seq") ]); + }, + "dot": function(expr) { + var out = make(expr), i = 1; + if (expr[0] == "num") { + if (!/\./.test(expr[1])) + out += "."; + } else if (needs_parens(expr)) + out = "(" + out + ")"; + while (i < arguments.length) + out += "." + make_name(arguments[i++]); + return out; + }, + "call": function(func, args) { + var f = make(func); + if (f.charAt(0) != "(" && needs_parens(func)) + f = "(" + f + ")"; + return f + "(" + add_commas(MAP(args, function(expr){ + return parenthesize(expr, "seq"); + })) + ")"; + }, + "function": make_function, + "defun": make_function, + "if": function(co, th, el) { + var out = [ "if", "(" + make(co) + ")", el ? make_then(th) : make(th) ]; + if (el) { + out.push("else", make(el)); + } + return add_spaces(out); + }, + "for": function(init, cond, step, block) { + var out = [ "for" ]; + init = (init != null ? make(init) : "").replace(/;*\s*$/, ";" + space); + cond = (cond != null ? make(cond) : "").replace(/;*\s*$/, ";" + space); + step = (step != null ? make(step) : "").replace(/;*\s*$/, ""); + var args = init + cond + step; + if (args == "; ; ") args = ";;"; + out.push("(" + args + ")", make(block)); + return add_spaces(out); + }, + "for-in": function(vvar, key, hash, block) { + return add_spaces([ "for", "(" + + (vvar ? make(vvar).replace(/;+$/, "") : make(key)), + "in", + make(hash) + ")", make(block) ]); + }, + "while": function(condition, block) { + return add_spaces([ "while", "(" + make(condition) + ")", make(block) ]); + }, + "do": function(condition, block) { + return add_spaces([ "do", make(block), "while", "(" + make(condition) + ")" ]) + ";"; + }, + "return": function(expr) { + var out = [ "return" ]; + if (expr != null) out.push(make(expr)); + return add_spaces(out) + ";"; + }, + "binary": function(operator, lvalue, rvalue) { + var left = make(lvalue), right = make(rvalue); + // XXX: I'm pretty sure other cases will bite here. + // we need to be smarter. + // adding parens all the time is the safest bet. + if (member(lvalue[0], [ "assign", "conditional", "seq" ]) || + lvalue[0] == "binary" && PRECEDENCE[operator] > PRECEDENCE[lvalue[1]] || + lvalue[0] == "function" && needs_parens(this)) { + left = "(" + left + ")"; + } + if (member(rvalue[0], [ "assign", "conditional", "seq" ]) || + rvalue[0] == "binary" && PRECEDENCE[operator] >= PRECEDENCE[rvalue[1]] && + !(rvalue[1] == operator && member(operator, [ "&&", "||", "*" ]))) { + right = "(" + right + ")"; + } + else if (!beautify && options.inline_script && (operator == "<" || operator == "<<") + && rvalue[0] == "regexp" && /^script/i.test(rvalue[1])) { + right = " " + right; + } + return add_spaces([ left, operator, right ]); + }, + "unary-prefix": function(operator, expr) { + var val = make(expr); + if (!(expr[0] == "num" || (expr[0] == "unary-prefix" && !HOP(OPERATORS, operator + expr[1])) || !needs_parens(expr))) + val = "(" + val + ")"; + return operator + (jsp.is_alphanumeric_char(operator.charAt(0)) ? " " : "") + val; + }, + "unary-postfix": function(operator, expr) { + var val = make(expr); + if (!(expr[0] == "num" || (expr[0] == "unary-postfix" && !HOP(OPERATORS, operator + expr[1])) || !needs_parens(expr))) + val = "(" + val + ")"; + return val + operator; + }, + "sub": function(expr, subscript) { + var hash = make(expr); + if (needs_parens(expr)) + hash = "(" + hash + ")"; + return hash + "[" + make(subscript) + "]"; + }, + "object": function(props) { + var obj_needs_parens = needs_parens(this); + if (props.length == 0) + return obj_needs_parens ? "({})" : "{}"; + var out = "{" + newline + with_indent(function(){ + return MAP(props, function(p){ + if (p.length == 3) { + // getter/setter. The name is in p[0], the arg.list in p[1][2], the + // body in p[1][3] and type ("get" / "set") in p[2]. + return indent(make_function(p[0], p[1][2], p[1][3], p[2])); + } + var key = p[0], val = parenthesize(p[1], "seq"); + if (options.quote_keys) { + key = encode_string(key); + } else if ((typeof key == "number" || !beautify && +key + "" == key) + && parseFloat(key) >= 0) { + key = make_num(+key); + } else if (!is_identifier(key)) { + key = encode_string(key); + } + return indent(add_spaces(beautify && options.space_colon + ? [ key, ":", val ] + : [ key + ":", val ])); + }).join("," + newline); + }) + newline + indent("}"); + return obj_needs_parens ? "(" + out + ")" : out; + }, + "regexp": function(rx, mods) { + return "/" + rx + "/" + mods; + }, + "array": function(elements) { + if (elements.length == 0) return "[]"; + return add_spaces([ "[", add_commas(MAP(elements, function(el, i){ + if (!beautify && el[0] == "atom" && el[1] == "undefined") return i === elements.length - 1 ? "," : ""; + return parenthesize(el, "seq"); + })), "]" ]); + }, + "stat": function(stmt) { + return make(stmt).replace(/;*\s*$/, ";"); + }, + "seq": function() { + return add_commas(MAP(slice(arguments), make)); + }, + "label": function(name, block) { + return add_spaces([ make_name(name), ":", make(block) ]); + }, + "with": function(expr, block) { + return add_spaces([ "with", "(" + make(expr) + ")", make(block) ]); + }, + "atom": function(name) { + return make_name(name); + } + }, function(){ return make(ast) }); + + // The squeezer replaces "block"-s that contain only a single + // statement with the statement itself; technically, the AST + // is correct, but this can create problems when we output an + // IF having an ELSE clause where the THEN clause ends in an + // IF *without* an ELSE block (then the outer ELSE would refer + // to the inner IF). This function checks for this case and + // adds the block brackets if needed. + function make_then(th) { + if (th == null) return ";"; + if (th[0] == "do") { + // https://github.com/mishoo/UglifyJS/issues/#issue/57 + // IE croaks with "syntax error" on code like this: + // if (foo) do ... while(cond); else ... + // we need block brackets around do/while + return make_block([ th ]); + } + var b = th; + while (true) { + var type = b[0]; + if (type == "if") { + if (!b[3]) + // no else, we must add the block + return make([ "block", [ th ]]); + b = b[3]; + } + else if (type == "while" || type == "do") b = b[2]; + else if (type == "for" || type == "for-in") b = b[4]; + else break; + } + return make(th); + }; + + function make_function(name, args, body, keyword) { + var out = keyword || "function"; + if (name) { + out += " " + make_name(name); + } + out += "(" + add_commas(MAP(args, make_name)) + ")"; + out = add_spaces([ out, make_block(body) ]); + return needs_parens(this) ? "(" + out + ")" : out; + }; + + function must_has_semicolon(node) { + switch (node[0]) { + case "with": + case "while": + return empty(node[2]); // `with' or `while' with empty body? + case "for": + case "for-in": + return empty(node[4]); // `for' with empty body? + case "if": + if (empty(node[2]) && !node[3]) return true; // `if' with empty `then' and no `else' + if (node[3]) { + if (empty(node[3])) return true; // `else' present but empty + return must_has_semicolon(node[3]); // dive into the `else' branch + } + return must_has_semicolon(node[2]); // dive into the `then' branch + } + }; + + function make_block_statements(statements, noindent) { + for (var a = [], last = statements.length - 1, i = 0; i <= last; ++i) { + var stat = statements[i]; + var code = make(stat); + if (code != ";") { + if (!beautify && i == last && !must_has_semicolon(stat)) { + code = code.replace(/;+\s*$/, ""); + } + a.push(code); + } + } + return noindent ? a : MAP(a, indent); + }; + + function make_switch_block(body) { + var n = body.length; + if (n == 0) return "{}"; + return "{" + newline + MAP(body, function(branch, i){ + var has_body = branch[1].length > 0, code = with_indent(function(){ + return indent(branch[0] + ? add_spaces([ "case", make(branch[0]) + ":" ]) + : "default:"); + }, 0.5) + (has_body ? newline + with_indent(function(){ + return make_block_statements(branch[1]).join(newline); + }) : ""); + if (!beautify && has_body && i < n - 1) + code += ";"; + return code; + }).join(newline) + newline + indent("}"); + }; + + function make_block(statements) { + if (!statements) return ";"; + if (statements.length == 0) return "{}"; + return "{" + newline + with_indent(function(){ + return make_block_statements(statements).join(newline); + }) + newline + indent("}"); + }; + + function make_1vardef(def) { + var name = def[0], val = def[1]; + if (val != null) + name = add_spaces([ make_name(name), "=", parenthesize(val, "seq") ]); + return name; + }; + +}; + +function split_lines(code, max_line_length) { + var splits = [ 0 ]; + jsp.parse(function(){ + var next_token = jsp.tokenizer(code); + var last_split = 0; + var prev_token; + function current_length(tok) { + return tok.pos - last_split; + }; + function split_here(tok) { + last_split = tok.pos; + splits.push(last_split); + }; + function custom(){ + var tok = next_token.apply(this, arguments); + out: { + if (prev_token) { + if (prev_token.type == "keyword") break out; + } + if (current_length(tok) > max_line_length) { + switch (tok.type) { + case "keyword": + case "atom": + case "name": + case "punc": + split_here(tok); + break out; + } + } + } + prev_token = tok; + return tok; + }; + custom.context = function() { + return next_token.context.apply(this, arguments); + }; + return custom; + }()); + return splits.map(function(pos, i){ + return code.substring(pos, splits[i + 1] || code.length); + }).join("\n"); +}; + +/* -----[ Utilities ]----- */ + +function repeat_string(str, i) { + if (i <= 0) return ""; + if (i == 1) return str; + var d = repeat_string(str, i >> 1); + d += d; + if (i & 1) d += str; + return d; +}; + +function defaults(args, defs) { + var ret = {}; + if (args === true) + args = {}; + for (var i in defs) if (HOP(defs, i)) { + ret[i] = (args && HOP(args, i)) ? args[i] : defs[i]; + } + return ret; +}; + +function is_identifier(name) { + return /^[a-z_$][a-z0-9_$]*$/i.test(name) + && name != "this" + && !HOP(jsp.KEYWORDS_ATOM, name) + && !HOP(jsp.RESERVED_WORDS, name) + && !HOP(jsp.KEYWORDS, name); +}; + +function HOP(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +}; + +// some utilities + +var MAP; + +(function(){ + MAP = function(a, f, o) { + var ret = [], top = [], i; + function doit() { + var val = f.call(o, a[i], i); + if (val instanceof AtTop) { + val = val.v; + if (val instanceof Splice) { + top.push.apply(top, val.v); + } else { + top.push(val); + } + } + else if (val != skip) { + if (val instanceof Splice) { + ret.push.apply(ret, val.v); + } else { + ret.push(val); + } + } + }; + if (a instanceof Array) for (i = 0; i < a.length; ++i) doit(); + else for (i in a) if (HOP(a, i)) doit(); + return top.concat(ret); + }; + MAP.at_top = function(val) { return new AtTop(val) }; + MAP.splice = function(val) { return new Splice(val) }; + var skip = MAP.skip = {}; + function AtTop(val) { this.v = val }; + function Splice(val) { this.v = val }; +})(); + +/* -----[ Exports ]----- */ + +exports.ast_walker = ast_walker; +exports.ast_mangle = ast_mangle; +exports.ast_squeeze = ast_squeeze; +exports.ast_lift_variables = ast_lift_variables; +exports.gen_code = gen_code; +exports.ast_add_scope = ast_add_scope; +exports.set_logger = function(logger) { warn = logger }; +exports.make_string = make_string; +exports.split_lines = split_lines; +exports.MAP = MAP; + +// keep this last! +exports.ast_squeeze_more = require("./squeeze-more").ast_squeeze_more; + +});define('uglifyjs/index', ["require", "exports", "module", "./parse-js", "./process"], function(require, exports, module) { + +//convienence function(src, [options]); +function uglify(orig_code, options){ + options || (options = {}); + var jsp = uglify.parser; + var pro = uglify.uglify; + + var ast = jsp.parse(orig_code, options.strict_semicolons); // parse code and get the initial AST + ast = pro.ast_mangle(ast, options.mangle_options); // get a new AST with mangled names + ast = pro.ast_squeeze(ast, options.squeeze_options); // get an AST with compression optimizations + var final_code = pro.gen_code(ast, options.gen_options); // compressed code here + return final_code; +}; + +uglify.parser = require("./parse-js"); +uglify.uglify = require("./process"); + +module.exports = uglify + +});/** + * @license Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ + +/*jslint plusplus: false, strict: false */ +/*global define: false */ + +define('parse', ['./uglifyjs/index'], function (uglify) { + var parser = uglify.parser, + processor = uglify.uglify, + ostring = Object.prototype.toString, + isArray; + + if (Array.isArray) { + isArray = Array.isArray; + } else { + isArray = function (it) { + return ostring.call(it) === "[object Array]"; + }; + } + + /** + * Determines if the AST node is an array literal + */ + function isArrayLiteral(node) { + return node[0] === 'array'; + } + + /** + * Determines if the AST node is an object literal + */ + function isObjectLiteral(node) { + return node[0] === 'object'; + } + + /** + * Converts a regular JS array of strings to an AST node that + * represents that array. + * @param {Array} ary + * @param {Node} an AST node that represents an array of strings. + */ + function toAstArray(ary) { + var output = [ + 'array', + [] + ], + i, item; + + for (i = 0; (item = ary[i]); i++) { + output[1].push([ + 'string', + item + ]); + } + + return output; + } + + /** + * Validates a node as being an object literal (like for i18n bundles) + * or an array literal with just string members. If an array literal, + * only return array members that are full strings. So the caller of + * this function should use the return value as the new value for the + * node. + * + * This function does not need to worry about comments, they are not + * present in this AST. + * + * @param {Node} node an AST node. + * + * @returns {Node} an AST node to use for the valid dependencies. + * If null is returned, then it means the input node was not a valid + * dependency. + */ + function validateDeps(node) { + var newDeps = ['array', []], + arrayArgs, i, dep; + + if (!node) { + return null; + } + + if (isObjectLiteral(node) || node[0] === 'function') { + return node; + } + + //Dependencies can be an object literal or an array. + if (!isArrayLiteral(node)) { + return null; + } + + arrayArgs = node[1]; + + for (i = 0; i < arrayArgs.length; i++) { + dep = arrayArgs[i]; + if (dep[0] === 'string') { + newDeps[1].push(dep); + } + } + return newDeps[1].length ? newDeps : null; + } + + /** + * Gets dependencies from a node, but only if it is an array literal, + * and only if the dependency is a string literal. + * + * This function does not need to worry about comments, they are not + * present in this AST. + * + * @param {Node} node an AST node. + * + * @returns {Array} of valid dependencies. + * If null is returned, then it means the input node was not a valid + * array literal, or did not have any string literals.. + */ + function getValidDeps(node) { + var newDeps = [], + arrayArgs, i, dep; + + if (!node) { + return null; + } + + if (isObjectLiteral(node) || node[0] === 'function') { + return null; + } + + //Dependencies can be an object literal or an array. + if (!isArrayLiteral(node)) { + return null; + } + + arrayArgs = node[1]; + + for (i = 0; i < arrayArgs.length; i++) { + dep = arrayArgs[i]; + if (dep[0] === 'string') { + newDeps.push(dep[1]); + } + } + return newDeps.length ? newDeps : null; + } + + /** + * Main parse function. Returns a string of any valid require or define/require.def + * calls as part of one JavaScript source string. + * @param {String} moduleName the module name that represents this file. + * It is used to create a default define if there is not one already for the file. + * This allows properly tracing dependencies for builds. Otherwise, if + * the file just has a require() call, the file dependencies will not be + * properly reflected: the file will come before its dependencies. + * @param {String} moduleName + * @param {String} fileName + * @param {String} fileContents + * @param {Object} options optional options. insertNeedsDefine: true will + * add calls to require.needsDefine() if appropriate. + * @returns {String} JS source string or null, if no require or define/require.def + * calls are found. + */ + function parse(moduleName, fileName, fileContents, options) { + options = options || {}; + + //Set up source input + var moduleDeps = [], + result = '', + moduleList = [], + needsDefine = true, + astRoot = parser.parse(fileContents), + i, moduleCall, depString; + + parse.recurse(astRoot, function (callName, config, name, deps) { + //If name is an array, it means it is an anonymous module, + //so adjust args appropriately. An anonymous module could + //have a FUNCTION as the name type, but just ignore those + //since we just want to find dependencies. + if (name && isArrayLiteral(name)) { + deps = name; + name = null; + } + + if (!(deps = getValidDeps(deps))) { + deps = []; + } + + //Get the name as a string literal, if it is available. + if (name && name[0] === 'string') { + name = name[1]; + } else { + name = null; + } + + if (callName === 'define' && (!name || name === moduleName)) { + needsDefine = false; + } + + if (!name) { + //If there is no module name, the dependencies are for + //this file/default module name. + moduleDeps = moduleDeps.concat(deps); + } else { + moduleList.push({ + name: name, + deps: deps + }); + } + + //If define was found, no need to dive deeper, unless + //the config explicitly wants to dig deeper. + return !options.findNestedDependencies; + }, options); + + if (options.insertNeedsDefine && needsDefine) { + result += 'require.needsDefine("' + moduleName + '");'; + } + + if (moduleDeps.length || moduleList.length) { + for (i = 0; (moduleCall = moduleList[i]); i++) { + if (result) { + result += '\n'; + } + + //If this is the main module for this file, combine any + //"anonymous" dependencies (could come from a nested require + //call) with this module. + if (moduleCall.name === moduleName) { + moduleCall.deps = moduleCall.deps.concat(moduleDeps); + moduleDeps = []; + } + + depString = moduleCall.deps.length ? '["' + moduleCall.deps.join('","') + '"]' : '[]'; + result += 'define("' + moduleCall.name + '",' + depString + ');'; + } + if (moduleDeps.length) { + if (result) { + result += '\n'; + } + depString = moduleDeps.length ? '["' + moduleDeps.join('","') + '"]' : '[]'; + result += 'define("' + moduleName + '",' + depString + ');'; + } + } + + return result ? result : null; + } + + //Add some private methods to object for use in derived objects. + parse.isArray = isArray; + parse.isObjectLiteral = isObjectLiteral; + parse.isArrayLiteral = isArrayLiteral; + + /** + * Handles parsing a file recursively for require calls. + * @param {Array} parentNode the AST node to start with. + * @param {Function} onMatch function to call on a parse match. + * @param {Object} [options] This is normally the build config options if + * it is passed. + * @param {Function} [recurseCallback] function to call on each valid + * node, defaults to parse.parseNode. + */ + parse.recurse = function (parentNode, onMatch, options, recurseCallback) { + var hasHas = options && options.has, + i, node; + + recurseCallback = recurseCallback || this.parseNode; + + if (isArray(parentNode)) { + for (i = 0; i < parentNode.length; i++) { + node = parentNode[i]; + if (isArray(node)) { + //If has config is in play, if calls have been converted + //by this point to be true/false values. So, if + //options has a 'has' value, skip if branches that have + //literal false values. + + //uglify returns if constructs in an array: + //[0]: 'if' + //[1]: the condition, ['name', true | false] for the has replaced case. + //[2]: the block to process if true + //[3]: the block to process if false + //For if/else if/else, the else if is in the [3], + //so only ever have to deal with this structure. + if (hasHas && node[0] === 'if' && node[1] && node[1][0] === 'name' && + (node[1][1] === 'true' || node[1][1] === 'false')) { + if (node[1][1] === 'true') { + this.recurse([node[2]], onMatch, options, recurseCallback); + } else { + this.recurse([node[3]], onMatch, options, recurseCallback); + } + } else { + if (recurseCallback(node, onMatch)) { + //The onMatch indicated parsing should + //stop for children of this node. + continue; + } + this.recurse(node, onMatch, options, recurseCallback); + } + } + } + } + }; + + /** + * Determines if the file defines require(). + * @param {String} fileName + * @param {String} fileContents + * @returns {Boolean} + */ + parse.definesRequire = function (fileName, fileContents) { + var astRoot = parser.parse(fileContents); + return this.nodeHasRequire(astRoot); + }; + + /** + * Finds require("") calls inside a CommonJS anonymous module wrapped in a + * define(function(require, exports, module){}) wrapper. These dependencies + * will be added to a modified define() call that lists the dependencies + * on the outside of the function. + * @param {String} fileName + * @param {String} fileContents + * @returns {Array} an array of module names that are dependencies. Always + * returns an array, but could be of length zero. + */ + parse.getAnonDeps = function (fileName, fileContents) { + var astRoot = parser.parse(fileContents), + defFunc = this.findAnonDefineFactory(astRoot); + + return parse.getAnonDepsFromNode(defFunc); + }; + + /** + * Finds require("") calls inside a CommonJS anonymous module wrapped + * in a define function, given an AST node for the definition function. + * @param {Node} node the AST node for the definition function. + * @returns {Array} and array of dependency names. Can be of zero length. + */ + parse.getAnonDepsFromNode = function (node) { + var deps = [], + funcArgLength; + + if (node) { + this.findRequireDepNames(node, deps); + + //If no deps, still add the standard CommonJS require, exports, module, + //in that order, to the deps, but only if specified as function args. + //In particular, if exports is used, it is favored over the return + //value of the function, so only add it if asked. + funcArgLength = node[2] && node[2].length; + if (funcArgLength) { + deps = (funcArgLength > 1 ? ["require", "exports", "module"] : + ["require"]).concat(deps); + } + } + return deps; + }; + + /** + * Finds the function in define(function (require, exports, module){}); + * @param {Array} node + * @returns {Boolean} + */ + parse.findAnonDefineFactory = function (node) { + var callback, i, n, call, args; + + if (isArray(node)) { + if (node[0] === 'call') { + call = node[1]; + args = node[2]; + if ((call[0] === 'name' && call[1] === 'define') || + (call[0] === 'dot' && call[1][1] === 'require' && call[2] === 'def')) { + + //There should only be one argument and it should be a function, + //or a named module with function as second arg + if (args.length === 1 && args[0][0] === 'function') { + return args[0]; + } else if (args.length === 2 && args[0][0] === 'string' && + args[1][0] === 'function') { + return args[1]; + } + } + } + + //Check child nodes + for (i = 0; i < node.length; i++) { + n = node[i]; + if ((callback = this.findAnonDefineFactory(n))) { + return callback; + } + } + } + + return null; + }; + + /** + * Finds any config that is passed to requirejs. + * @param {String} fileName + * @param {String} fileContents + * + * @returns {Object} a config object. Will be null if no config. + * Can throw an error if the config in the file cannot be evaluated in + * a build context to valid JavaScript. + */ + parse.findConfig = function (fileName, fileContents) { + /*jslint evil: true */ + //This is a litle bit inefficient, it ends up with two uglifyjs parser + //calls. Can revisit later, but trying to build out larger functional + //pieces first. + var foundConfig = null, + astRoot = parser.parse(fileContents); + + parse.recurse(astRoot, function (configNode) { + var jsConfig; + + if (!foundConfig && configNode) { + jsConfig = parse.nodeToString(configNode); + foundConfig = eval('(' + jsConfig + ')'); + return foundConfig; + } + return undefined; + }, null, parse.parseConfigNode); + + return foundConfig; + }; + + /** + * Finds all dependencies specified in dependency arrays and inside + * simplified commonjs wrappers. + * @param {String} fileName + * @param {String} fileContents + * + * @returns {Array} an array of dependency strings. The dependencies + * have not been normalized, they may be relative IDs. + */ + parse.findDependencies = function (fileName, fileContents, options) { + //This is a litle bit inefficient, it ends up with two uglifyjs parser + //calls. Can revisit later, but trying to build out larger functional + //pieces first. + var dependencies = [], + astRoot = parser.parse(fileContents); + + parse.recurse(astRoot, function (callName, config, name, deps) { + //Normalize the input args. + if (name && isArrayLiteral(name)) { + deps = name; + name = null; + } + + if ((deps = getValidDeps(deps))) { + dependencies = dependencies.concat(deps); + } + }, options); + + return dependencies; + }; + + /** + * Finds only CJS dependencies, ones that are the form require('stringLiteral') + */ + parse.findCjsDependencies = function (fileName, fileContents, options) { + //This is a litle bit inefficient, it ends up with two uglifyjs parser + //calls. Can revisit later, but trying to build out larger functional + //pieces first. + var dependencies = [], + astRoot = parser.parse(fileContents); + + parse.recurse(astRoot, function (dep) { + dependencies.push(dep); + }, options, function (node, onMatch) { + + var call, args; + + if (!isArray(node)) { + return false; + } + + if (node[0] === 'call') { + call = node[1]; + args = node[2]; + + if (call) { + //A require('') use. + if (call[0] === 'name' && call[1] === 'require' && + args[0][0] === 'string') { + return onMatch(args[0][1]); + } + } + } + + return false; + + }); + + return dependencies; + }; + + /** + * Determines if define(), require({}|[]) or requirejs was called in the + * file. Also finds out if define() is declared and if define.amd is called. + */ + parse.usesAmdOrRequireJs = function (fileName, fileContents, options) { + var astRoot = parser.parse(fileContents), + uses; + + parse.recurse(astRoot, function (prop) { + if (!uses) { + uses = {}; + } + uses[prop] = true; + }, options, parse.findAmdOrRequireJsNode); + + return uses; + }; + + /** + * Determines if require(''), exports.x =, module.exports =, + * __dirname, __filename are used. So, not strictly traditional CommonJS, + * also checks for Node variants. + */ + parse.usesCommonJs = function (fileName, fileContents, options) { + var uses = null, + assignsExports = false, + astRoot = parser.parse(fileContents); + + parse.recurse(astRoot, function (prop) { + if (prop === 'varExports') { + assignsExports = true; + } else if (prop !== 'exports' || !assignsExports) { + if (!uses) { + uses = {}; + } + uses[prop] = true; + } + }, options, function (node, onMatch) { + + var call, args; + + if (!isArray(node)) { + return false; + } + + if (node[0] === 'name' && (node[1] === '__dirname' || node[1] === '__filename')) { + return onMatch(node[1].substring(2)); + } else if (node[0] === 'var' && node[1] && node[1][0] && node[1][0][0] === 'exports') { + //Hmm, a variable assignment for exports, so does not use cjs exports. + return onMatch('varExports'); + } else if (node[0] === 'assign' && node[2] && node[2][0] === 'dot') { + args = node[2][1]; + + if (args) { + //An exports or module.exports assignment. + if (args[0] === 'name' && args[1] === 'module' && + node[2][2] === 'exports') { + return onMatch('moduleExports'); + } else if (args[0] === 'name' && args[1] === 'exports') { + return onMatch('exports'); + } + } + } else if (node[0] === 'call') { + call = node[1]; + args = node[2]; + + if (call) { + //A require('') use. + if (call[0] === 'name' && call[1] === 'require' && + args[0][0] === 'string') { + return onMatch('require'); + } + } + } + + return false; + + }); + + return uses; + }; + + + parse.findRequireDepNames = function (node, deps) { + var moduleName, i, n, call, args; + + if (isArray(node)) { + if (node[0] === 'call') { + call = node[1]; + args = node[2]; + + if (call && call[0] === 'name' && call[1] === 'require') { + moduleName = args[0]; + if (moduleName[0] === 'string') { + deps.push(moduleName[1]); + } + } + + + } + + //Check child nodes + for (i = 0; i < node.length; i++) { + n = node[i]; + this.findRequireDepNames(n, deps); + } + } + }; + + /** + * Determines if a given node contains a require() definition. + * @param {Array} node + * @returns {Boolean} + */ + parse.nodeHasRequire = function (node) { + if (this.isDefineNode(node)) { + return true; + } + + if (isArray(node)) { + for (var i = 0, n; i < node.length; i++) { + n = node[i]; + if (this.nodeHasRequire(n)) { + return true; + } + } + } + + return false; + }; + + /** + * Is the given node the actual definition of define(). Actually uses + * the definition of define.amd to find require. + * @param {Array} node + * @returns {Boolean} + */ + parse.isDefineNode = function (node) { + //Actually look for the define.amd = assignment, since + //that is more indicative of RequireJS vs a plain require definition. + var assign; + if (!node) { + return null; + } + + if (node[0] === 'assign' && node[1] === true) { + assign = node[2]; + if (assign[0] === 'dot' && assign[1][0] === 'name' && + assign[1][1] === 'define' && assign[2] === 'amd') { + return true; + } + } + return false; + }; + + /** + * Determines if a specific node is a valid require or define/require.def call. + * @param {Array} node + * @param {Function} onMatch a function to call when a match is found. + * It is passed the match name, and the config, name, deps possible args. + * The config, name and deps args are not normalized. + * + * @returns {String} a JS source string with the valid require/define call. + * Otherwise null. + */ + parse.parseNode = function (node, onMatch) { + var call, name, config, deps, args, cjsDeps; + + if (!isArray(node)) { + return false; + } + + if (node[0] === 'call') { + call = node[1]; + args = node[2]; + + if (call) { + if (call[0] === 'name' && + (call[1] === 'require' || call[1] === 'requirejs')) { + + //It is a plain require() call. + config = args[0]; + deps = args[1]; + if (isArrayLiteral(config)) { + deps = config; + config = null; + } + + if (!(deps = validateDeps(deps))) { + return null; + } + + return onMatch("require", null, null, deps); + + } else if (call[0] === 'name' && call[1] === 'define') { + + //A define call + name = args[0]; + deps = args[1]; + //Only allow define calls that match what is expected + //in an AMD call: + //* first arg should be string, array, function or object + //* second arg optional, or array, function or object. + //This helps weed out calls to a non-AMD define, but it is + //not completely robust. Someone could create a define + //function that still matches this shape, but this is the + //best that is possible, and at least allows UglifyJS, + //which does create its own internal define in one file, + //to be inlined. + if (((name[0] === 'string' || isArrayLiteral(name) || + name[0] === 'function' || isObjectLiteral(name))) && + (!deps || isArrayLiteral(deps) || + deps[0] === 'function' || isObjectLiteral(deps) || + // allow define(['dep'], factory) pattern + (isArrayLiteral(name) && deps[0] === 'name' && args.length === 2))) { + + //If first arg is a function, could be a commonjs wrapper, + //look inside for commonjs dependencies. + //Also, if deps is a function look for commonjs deps. + if (name && name[0] === 'function') { + cjsDeps = parse.getAnonDepsFromNode(name); + if (cjsDeps.length) { + name = toAstArray(cjsDeps); + } + } else if (deps && deps[0] === 'function') { + cjsDeps = parse.getAnonDepsFromNode(deps); + if (cjsDeps.length) { + deps = toAstArray(cjsDeps); + } + } + + return onMatch("define", null, name, deps); + } + } + } + } + + return false; + }; + + /** + * Looks for define(), require({} || []), requirejs({} || []) calls. + */ + parse.findAmdOrRequireJsNode = function (node, onMatch) { + var call, args, configNode, type; + + if (!isArray(node)) { + return false; + } + + if (node[0] === 'defun' && node[1] === 'define') { + type = 'declaresDefine'; + } else if (node[0] === 'assign' && node[2] && node[2][2] === 'amd' && + node[2][1] && node[2][1][0] === 'name' && + node[2][1][1] === 'define') { + type = 'defineAmd'; + } else if (node[0] === 'call') { + call = node[1]; + args = node[2]; + + if (call) { + if ((call[0] === 'dot' && + (call[1] && call[1][0] === 'name' && + (call[1][1] === 'require' || call[1][1] === 'requirejs')) && + call[2] === 'config')) { + //A require.config() or requirejs.config() call. + type = call[1][1] + 'Config'; + } else if (call[0] === 'name' && + (call[1] === 'require' || call[1] === 'requirejs')) { + //A require() or requirejs() config call. + //Only want ones that start with an object or an array. + configNode = args[0]; + if (configNode[0] === 'object' || configNode[0] === 'array') { + type = call[1]; + } + } else if (call[0] === 'name' && call[1] === 'define') { + //A define call. + type = 'define'; + } + } + } + + if (type) { + return onMatch(type); + } + + return false; + }; + + /** + * Determines if a specific node is a valid require/requirejs config + * call. That includes calls to require/requirejs.config(). + * @param {Array} node + * @param {Function} onMatch a function to call when a match is found. + * It is passed the match name, and the config, name, deps possible args. + * The config, name and deps args are not normalized. + * + * @returns {String} a JS source string with the valid require/define call. + * Otherwise null. + */ + parse.parseConfigNode = function (node, onMatch) { + var call, configNode, args; + + if (!isArray(node)) { + return false; + } + + if (node[0] === 'call') { + call = node[1]; + args = node[2]; + + if (call) { + //A require.config() or requirejs.config() call. + if ((call[0] === 'dot' && + (call[1] && call[1][0] === 'name' && + (call[1][1] === 'require' || call[1][1] === 'requirejs')) && + call[2] === 'config') || + //A require() or requirejs() config call. + + (call[0] === 'name' && + (call[1] === 'require' || call[1] === 'requirejs')) + ) { + //It is a plain require() call. + configNode = args[0]; + + if (configNode[0] !== 'object') { + return null; + } + + return onMatch(configNode); + + } + } + } + + return false; + }; + + /** + * Converts an AST node into a JS source string. Does not maintain formatting + * or even comments from original source, just returns valid JS source. + * @param {Array} node + * @returns {String} a JS source string. + */ + parse.nodeToString = function (node) { + return processor.gen_code(node, true); + }; + + return parse; +}); +/** + * @license Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ + +/*jslint regexp: false, strict: false, plusplus: false */ +/*global define: false */ + +define('pragma', ['parse', 'logger'], function (parse, logger) { + + function Temp() {} + + function create(obj, mixin) { + Temp.prototype = obj; + var temp = new Temp(), prop; + + //Avoid any extra memory hanging around + Temp.prototype = null; + + if (mixin) { + for (prop in mixin) { + if (mixin.hasOwnProperty(prop) && !(prop in temp)) { + temp[prop] = mixin[prop]; + } + } + } + + return temp; // Object + } + + var pragma = { + conditionalRegExp: /(exclude|include)Start\s*\(\s*["'](\w+)["']\s*,(.*)\)/, + useStrictRegExp: /['"]use strict['"];/g, + hasRegExp: /has\s*\(\s*['"]([^'"]+)['"]\s*\)/g, + nsRegExp: /(^|[^\.])(requirejs|require|define)\s*\(/, + nsWrapRegExp: /\/\*requirejs namespace: true \*\//, + apiDefRegExp: /var requirejs, require, define;/, + defineCheckRegExp: /typeof\s+define\s*===\s*["']function["']\s*&&\s*define\s*\.\s*amd/g, + defineJQueryRegExp: /typeof\s+define\s*===\s*["']function["']\s*&&\s*define\s*\.\s*amd\s*&&\s*define\s*\.\s*amd\s*\.\s*jQuery/g, + defineHasRegExp: /typeof\s+define\s*==(=)?\s*['"]function['"]\s*&&\s*typeof\s+define\.amd\s*==(=)?\s*['"]object['"]\s*&&\s*define\.amd/g, + defineTernaryRegExp: /typeof\s+define\s*===\s*['"]function["']\s*&&\s*define\s*\.\s*amd\s*\?\s*define/, + amdefineRegExp: /if\s*\(\s*typeof define\s*\!==\s*'function'\s*\)\s*\{\s*[^\{\}]+amdefine[^\{\}]+\}/g, + + removeStrict: function (contents, config) { + return config.useStrict ? contents : contents.replace(pragma.useStrictRegExp, ''); + }, + + namespace: function (fileContents, ns, onLifecycleName) { + if (ns) { + //Namespace require/define calls + fileContents = fileContents.replace(pragma.nsRegExp, '$1' + ns + '.$2('); + + //Namespace define ternary use: + fileContents = fileContents.replace(pragma.defineTernaryRegExp, + "typeof " + ns + ".define === 'function' && " + ns + ".define.amd ? " + ns + ".define"); + + //Namespace define jquery use: + fileContents = fileContents.replace(pragma.defineJQueryRegExp, + "typeof " + ns + ".define === 'function' && " + ns + ".define.amd && " + ns + ".define.amd.jQuery"); + + //Namespace has.js define use: + fileContents = fileContents.replace(pragma.defineHasRegExp, + "typeof " + ns + ".define === 'function' && typeof " + ns + ".define.amd === 'object' && " + ns + ".define.amd"); + + //Namespace define checks. + //Do this one last, since it is a subset of the more specific + //checks above. + fileContents = fileContents.replace(pragma.defineCheckRegExp, + "typeof " + ns + ".define === 'function' && " + ns + ".define.amd"); + + //Check for require.js with the require/define definitions + if (pragma.apiDefRegExp.test(fileContents) && + fileContents.indexOf("if (typeof " + ns + " === 'undefined')") === -1) { + //Wrap the file contents in a typeof check, and a function + //to contain the API globals. + fileContents = "var " + ns + ";(function () { if (typeof " + + ns + " === 'undefined') {\n" + + ns + ' = {};\n' + + fileContents + + "\n" + + ns + ".requirejs = requirejs;" + + ns + ".require = require;" + + ns + ".define = define;\n" + + "}\n}());"; + } + + //Finally, if the file wants a special wrapper because it ties + //in to the requirejs internals in a way that would not fit + //the above matches, do that. Look for /*requirejs namespace: true*/ + if (pragma.nsWrapRegExp.test(fileContents)) { + //Remove the pragma. + fileContents = fileContents.replace(pragma.nsWrapRegExp, ''); + + //Alter the contents. + fileContents = '(function () {\n' + + 'var require = ' + ns + '.require,' + + 'requirejs = ' + ns + '.requirejs,' + + 'define = ' + ns + '.define;\n' + + fileContents + + '\n}());' + } + } + + return fileContents; + }, + + /** + * processes the fileContents for some //>> conditional statements + */ + process: function (fileName, fileContents, config, onLifecycleName, pluginCollector) { + /*jslint evil: true */ + var foundIndex = -1, startIndex = 0, lineEndIndex, conditionLine, + matches, type, marker, condition, isTrue, endRegExp, endMatches, + endMarkerIndex, shouldInclude, startLength, lifecycleHas, deps, + i, dep, moduleName, + lifecyclePragmas, pragmas = config.pragmas, hasConfig = config.has, + //Legacy arg defined to help in dojo conversion script. Remove later + //when dojo no longer needs conversion: + kwArgs = pragmas; + + //Mix in a specific lifecycle scoped object, to allow targeting + //some pragmas/has tests to only when files are saved, or at different + //lifecycle events. Do not bother with kwArgs in this section, since + //the old dojo kwArgs were for all points in the build lifecycle. + if (onLifecycleName) { + lifecyclePragmas = config['pragmas' + onLifecycleName]; + lifecycleHas = config['has' + onLifecycleName]; + + if (lifecyclePragmas) { + pragmas = create(pragmas || {}, lifecyclePragmas); + } + + if (lifecycleHas) { + hasConfig = create(hasConfig || {}, lifecycleHas); + } + } + + //Replace has references if desired + if (hasConfig) { + fileContents = fileContents.replace(pragma.hasRegExp, function (match, test) { + if (test in hasConfig) { + return !!hasConfig[test]; + } + return match; + }); + } + + if (!config.skipPragmas) { + + while ((foundIndex = fileContents.indexOf("//>>", startIndex)) !== -1) { + //Found a conditional. Get the conditional line. + lineEndIndex = fileContents.indexOf("\n", foundIndex); + if (lineEndIndex === -1) { + lineEndIndex = fileContents.length - 1; + } + + //Increment startIndex past the line so the next conditional search can be done. + startIndex = lineEndIndex + 1; + + //Break apart the conditional. + conditionLine = fileContents.substring(foundIndex, lineEndIndex + 1); + matches = conditionLine.match(pragma.conditionalRegExp); + if (matches) { + type = matches[1]; + marker = matches[2]; + condition = matches[3]; + isTrue = false; + //See if the condition is true. + try { + isTrue = !!eval("(" + condition + ")"); + } catch (e) { + throw "Error in file: " + + fileName + + ". Conditional comment: " + + conditionLine + + " failed with this error: " + e; + } + + //Find the endpoint marker. + endRegExp = new RegExp('\\/\\/\\>\\>\\s*' + type + 'End\\(\\s*[\'"]' + marker + '[\'"]\\s*\\)', "g"); + endMatches = endRegExp.exec(fileContents.substring(startIndex, fileContents.length)); + if (endMatches) { + endMarkerIndex = startIndex + endRegExp.lastIndex - endMatches[0].length; + + //Find the next line return based on the match position. + lineEndIndex = fileContents.indexOf("\n", endMarkerIndex); + if (lineEndIndex === -1) { + lineEndIndex = fileContents.length - 1; + } + + //Should we include the segment? + shouldInclude = ((type === "exclude" && !isTrue) || (type === "include" && isTrue)); + + //Remove the conditional comments, and optionally remove the content inside + //the conditional comments. + startLength = startIndex - foundIndex; + fileContents = fileContents.substring(0, foundIndex) + + (shouldInclude ? fileContents.substring(startIndex, endMarkerIndex) : "") + + fileContents.substring(lineEndIndex + 1, fileContents.length); + + //Move startIndex to foundIndex, since that is the new position in the file + //where we need to look for more conditionals in the next while loop pass. + startIndex = foundIndex; + } else { + throw "Error in file: " + + fileName + + ". Cannot find end marker for conditional comment: " + + conditionLine; + + } + } + } + } + + //If need to find all plugin resources to optimize, do that now, + //before namespacing, since the namespacing will change the API + //names. + //If there is a plugin collector, scan the file for plugin resources. + if (config.optimizeAllPluginResources && pluginCollector) { + try { + deps = parse.findDependencies(fileName, fileContents); + if (deps.length) { + for (i = 0; (dep = deps[i]); i++) { + if (dep.indexOf('!') !== -1) { + (pluginCollector[moduleName] || + (pluginCollector[moduleName] = [])).push(dep); + } + } + } + } catch (eDep) { + logger.error('Parse error looking for plugin resources in ' + + fileName + ', skipping.'); + } + } + + //Strip amdefine use for node-shared modules. + fileContents = fileContents.replace(pragma.amdefineRegExp, ''); + + //Do namespacing + if (onLifecycleName === 'OnSave' && config.namespace) { + fileContents = pragma.namespace(fileContents, config.namespace, onLifecycleName); + } + + + return pragma.removeStrict(fileContents, config); + } + }; + + return pragma; +}); +if(env === 'node') { +/** + * @license Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ + +/*jslint strict: false */ +/*global define: false */ + +define('node/optimize', {}); + +} + +if(env === 'rhino') { +/** + * @license Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ + +/*jslint strict: false, plusplus: false */ +/*global define: false, java: false, Packages: false */ + +define('rhino/optimize', ['logger'], function (logger) { + + //Add .reduce to Rhino so UglifyJS can run in Rhino, + //inspired by https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/reduce + //but rewritten for brevity, and to be good enough for use by UglifyJS. + if (!Array.prototype.reduce) { + Array.prototype.reduce = function (fn /*, initialValue */) { + var i = 0, + length = this.length, + accumulator; + + if (arguments.length >= 2) { + accumulator = arguments[1]; + } else { + do { + if (i in this) { + accumulator = this[i++]; + break; + } + } + while (true); + } + + for (; i < length; i++) { + if (i in this) { + accumulator = fn.call(undefined, accumulator, this[i], i, this); + } + } + + return accumulator; + }; + } + + var JSSourceFilefromCode, optimize; + + //Bind to Closure compiler, but if it is not available, do not sweat it. + try { + JSSourceFilefromCode = java.lang.Class.forName('com.google.javascript.jscomp.JSSourceFile').getMethod('fromCode', [java.lang.String, java.lang.String]); + } catch (e) {} + + //Helper for closure compiler, because of weird Java-JavaScript interactions. + function closurefromCode(filename, content) { + return JSSourceFilefromCode.invoke(null, [filename, content]); + } + + optimize = { + closure: function (fileName, fileContents, keepLines, config) { + config = config || {}; + var jscomp = Packages.com.google.javascript.jscomp, + flags = Packages.com.google.common.flags, + //Fake extern + externSourceFile = closurefromCode("fakeextern.js", " "), + //Set up source input + jsSourceFile = closurefromCode(String(fileName), String(fileContents)), + options, option, FLAG_compilation_level, compiler, + Compiler = Packages.com.google.javascript.jscomp.Compiler, + result; + + logger.trace("Minifying file: " + fileName); + + //Set up options + options = new jscomp.CompilerOptions(); + for (option in config.CompilerOptions) { + // options are false by default and jslint wanted an if statement in this for loop + if (config.CompilerOptions[option]) { + options[option] = config.CompilerOptions[option]; + } + + } + options.prettyPrint = keepLines || options.prettyPrint; + + FLAG_compilation_level = jscomp.CompilationLevel[config.CompilationLevel || 'SIMPLE_OPTIMIZATIONS']; + FLAG_compilation_level.setOptionsForCompilationLevel(options); + + //Trigger the compiler + Compiler.setLoggingLevel(Packages.java.util.logging.Level[config.loggingLevel || 'WARNING']); + compiler = new Compiler(); + + result = compiler.compile(externSourceFile, jsSourceFile, options); + if (!result.success) { + logger.error('Cannot closure compile file: ' + fileName + '. Skipping it.'); + } else { + fileContents = compiler.toSource(); + } + + return fileContents; + } + }; + + return optimize; +}); +} +/** + * @license Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ + +/*jslint plusplus: false, nomen: false, regexp: false */ +/*global define: false */ + +define('optimize', [ 'lang', 'logger', 'env!env/optimize', 'env!env/file', 'parse', + 'pragma', 'uglifyjs/index'], +function (lang, logger, envOptimize, file, parse, + pragma, uglify) { + + var optimize, + cssImportRegExp = /\@import\s+(url\()?\s*([^);]+)\s*(\))?([\w, ]*)(;)?/g, + cssUrlRegExp = /\url\(\s*([^\)]+)\s*\)?/g; + + /** + * If an URL from a CSS url value contains start/end quotes, remove them. + * This is not done in the regexp, since my regexp fu is not that strong, + * and the CSS spec allows for ' and " in the URL if they are backslash escaped. + * @param {String} url + */ + function cleanCssUrlQuotes(url) { + //Make sure we are not ending in whitespace. + //Not very confident of the css regexps above that there will not be ending + //whitespace. + url = url.replace(/\s+$/, ""); + + if (url.charAt(0) === "'" || url.charAt(0) === "\"") { + url = url.substring(1, url.length - 1); + } + + return url; + } + + /** + * Inlines nested stylesheets that have @import calls in them. + * @param {String} fileName the file name + * @param {String} fileContents the file contents + * @param {String} cssImportIgnore comma delimited string of files to ignore + * @param {Object} included an object used to track the files already imported + */ + function flattenCss(fileName, fileContents, cssImportIgnore, included) { + //Find the last slash in the name. + fileName = fileName.replace(lang.backSlashRegExp, "/"); + var endIndex = fileName.lastIndexOf("/"), + //Make a file path based on the last slash. + //If no slash, so must be just a file name. Use empty string then. + filePath = (endIndex !== -1) ? fileName.substring(0, endIndex + 1) : "", + //store a list of merged files + importList = []; + + //Make sure we have a delimited ignore list to make matching faster + if (cssImportIgnore && cssImportIgnore.charAt(cssImportIgnore.length - 1) !== ",") { + cssImportIgnore += ","; + } + + fileContents = fileContents.replace(cssImportRegExp, function (fullMatch, urlStart, importFileName, urlEnd, mediaTypes) { + //Only process media type "all" or empty media type rules. + if (mediaTypes && ((mediaTypes.replace(/^\s\s*/, '').replace(/\s\s*$/, '')) !== "all")) { + return fullMatch; + } + + importFileName = cleanCssUrlQuotes(importFileName); + + //Ignore the file import if it is part of an ignore list. + if (cssImportIgnore && cssImportIgnore.indexOf(importFileName + ",") !== -1) { + return fullMatch; + } + + //Make sure we have a unix path for the rest of the operation. + importFileName = importFileName.replace(lang.backSlashRegExp, "/"); + + try { + //if a relative path, then tack on the filePath. + //If it is not a relative path, then the readFile below will fail, + //and we will just skip that import. + var fullImportFileName = importFileName.charAt(0) === "/" ? importFileName : filePath + importFileName, + importContents = file.readFile(fullImportFileName), i, + importEndIndex, importPath, fixedUrlMatch, colonIndex, parts, flat; + + //Skip the file if it has already been included. + if (included[fullImportFileName]) { + return ''; + } + included[fullImportFileName] = true; + + //Make sure to flatten any nested imports. + flat = flattenCss(fullImportFileName, importContents, cssImportIgnore, included); + importContents = flat.fileContents; + + if (flat.importList.length) { + importList.push.apply(importList, flat.importList); + } + + //Make the full import path + importEndIndex = importFileName.lastIndexOf("/"); + + //Make a file path based on the last slash. + //If no slash, so must be just a file name. Use empty string then. + importPath = (importEndIndex !== -1) ? importFileName.substring(0, importEndIndex + 1) : ""; + + //fix url() on relative import (#5) + importPath = importPath.replace(/^\.\//, ''); + + //Modify URL paths to match the path represented by this file. + importContents = importContents.replace(cssUrlRegExp, function (fullMatch, urlMatch) { + fixedUrlMatch = cleanCssUrlQuotes(urlMatch); + fixedUrlMatch = fixedUrlMatch.replace(lang.backSlashRegExp, "/"); + + //Only do the work for relative URLs. Skip things that start with / or have + //a protocol. + colonIndex = fixedUrlMatch.indexOf(":"); + if (fixedUrlMatch.charAt(0) !== "/" && (colonIndex === -1 || colonIndex > fixedUrlMatch.indexOf("/"))) { + //It is a relative URL, tack on the path prefix + urlMatch = importPath + fixedUrlMatch; + } else { + logger.trace(importFileName + "\n URL not a relative URL, skipping: " + urlMatch); + } + + //Collapse .. and . + parts = urlMatch.split("/"); + for (i = parts.length - 1; i > 0; i--) { + if (parts[i] === ".") { + parts.splice(i, 1); + } else if (parts[i] === "..") { + if (i !== 0 && parts[i - 1] !== "..") { + parts.splice(i - 1, 2); + i -= 1; + } + } + } + + return "url(" + parts.join("/") + ")"; + }); + + importList.push(fullImportFileName); + return importContents; + } catch (e) { + logger.warn(fileName + "\n Cannot inline css import, skipping: " + importFileName); + return fullMatch; + } + }); + + return { + importList : importList, + fileContents : fileContents + }; + } + + optimize = { + licenseCommentRegExp: /\/\*[\s\S]*?\*\//g, + + /** + * Optimizes a file that contains JavaScript content. Optionally collects + * plugin resources mentioned in a file, and then passes the content + * through an minifier if one is specified via config.optimize. + * + * @param {String} fileName the name of the file to optimize + * @param {String} outFileName the name of the file to use for the + * saved optimized content. + * @param {Object} config the build config object. + * @param {String} [moduleName] the module name to use for the file. + * Used for plugin resource collection. + * @param {Array} [pluginCollector] storage for any plugin resources + * found. + */ + jsFile: function (fileName, outFileName, config, moduleName, pluginCollector) { + var parts = (config.optimize + "").split('.'), + optimizerName = parts[0], + keepLines = parts[1] === 'keepLines', + fileContents; + + fileContents = file.readFile(fileName); + + fileContents = optimize.js(fileName, fileContents, optimizerName, + keepLines, config, pluginCollector); + + file.saveUtf8File(outFileName, fileContents); + }, + + /** + * Optimizes a file that contains JavaScript content. Optionally collects + * plugin resources mentioned in a file, and then passes the content + * through an minifier if one is specified via config.optimize. + * + * @param {String} fileName the name of the file that matches the + * fileContents. + * @param {String} fileContents the string of JS to optimize. + * @param {String} [optimizerName] optional name of the optimizer to + * use. 'uglify' is default. + * @param {Boolean} [keepLines] whether to keep line returns in the optimization. + * @param {Object} [config] the build config object. + * @param {Array} [pluginCollector] storage for any plugin resources + * found. + */ + js: function (fileName, fileContents, optimizerName, keepLines, config, pluginCollector) { + var licenseContents = '', + optFunc, match, comment; + + config = config || {}; + + //Apply pragmas/namespace renaming + fileContents = pragma.process(fileName, fileContents, config, 'OnSave', pluginCollector); + + //Optimize the JS files if asked. + if (optimizerName && optimizerName !== 'none') { + optFunc = envOptimize[optimizerName] || optimize.optimizers[optimizerName]; + if (!optFunc) { + throw new Error('optimizer with name of "' + + optimizerName + + '" not found for this environment'); + } + + if (config.preserveLicenseComments) { + //Pull out any license comments for prepending after optimization. + optimize.licenseCommentRegExp.lastIndex = 0; + while ((match = optimize.licenseCommentRegExp.exec(fileContents))) { + comment = match[0]; + //Only keep the comments if they are license comments. + if (comment.indexOf('@license') !== -1 || + comment.indexOf('/*!') === 0) { + licenseContents += comment + '\n'; + } + } + } + + fileContents = licenseContents + optFunc(fileName, fileContents, keepLines, + config[optimizerName]); + } + + return fileContents; + }, + + /** + * Optimizes one CSS file, inlining @import calls, stripping comments, and + * optionally removes line returns. + * @param {String} fileName the path to the CSS file to optimize + * @param {String} outFileName the path to save the optimized file. + * @param {Object} config the config object with the optimizeCss and + * cssImportIgnore options. + */ + cssFile: function (fileName, outFileName, config) { + + //Read in the file. Make sure we have a JS string. + var originalFileContents = file.readFile(fileName), + flat = flattenCss(fileName, originalFileContents, config.cssImportIgnore, {}), + fileContents = flat.fileContents, + startIndex, endIndex, buildText; + + //Do comment removal. + try { + if (config.optimizeCss.indexOf(".keepComments") === -1) { + startIndex = -1; + //Get rid of comments. + while ((startIndex = fileContents.indexOf("/*")) !== -1) { + endIndex = fileContents.indexOf("*/", startIndex + 2); + if (endIndex === -1) { + throw "Improper comment in CSS file: " + fileName; + } + fileContents = fileContents.substring(0, startIndex) + fileContents.substring(endIndex + 2, fileContents.length); + } + } + //Get rid of newlines. + if (config.optimizeCss.indexOf(".keepLines") === -1) { + fileContents = fileContents.replace(/[\r\n]/g, ""); + fileContents = fileContents.replace(/\s+/g, " "); + fileContents = fileContents.replace(/\{\s/g, "{"); + fileContents = fileContents.replace(/\s\}/g, "}"); + } else { + //Remove multiple empty lines. + fileContents = fileContents.replace(/(\r\n)+/g, "\r\n"); + fileContents = fileContents.replace(/(\n)+/g, "\n"); + } + } catch (e) { + fileContents = originalFileContents; + logger.error("Could not optimized CSS file: " + fileName + ", error: " + e); + } + + file.saveUtf8File(outFileName, fileContents); + + //text output to stdout and/or written to build.txt file + buildText = "\n"+ outFileName.replace(config.dir, "") +"\n----------------\n"; + flat.importList.push(fileName); + buildText += flat.importList.map(function(path){ + return path.replace(config.dir, ""); + }).join("\n"); + return buildText +"\n"; + }, + + /** + * Optimizes CSS files, inlining @import calls, stripping comments, and + * optionally removes line returns. + * @param {String} startDir the path to the top level directory + * @param {Object} config the config object with the optimizeCss and + * cssImportIgnore options. + */ + css: function (startDir, config) { + var buildText = "", + i, fileName, fileList; + if (config.optimizeCss.indexOf("standard") !== -1) { + fileList = file.getFilteredFileList(startDir, /\.css$/, true); + if (fileList) { + for (i = 0; i < fileList.length; i++) { + fileName = fileList[i]; + logger.trace("Optimizing (" + config.optimizeCss + ") CSS file: " + fileName); + buildText += optimize.cssFile(fileName, fileName, config); + } + } + } + return buildText; + }, + + optimizers: { + uglify: function (fileName, fileContents, keepLines, config) { + var parser = uglify.parser, + processor = uglify.uglify, + ast; + + config = config || {}; + + logger.trace("Uglifying file: " + fileName); + + try { + ast = parser.parse(fileContents, config.strict_semicolons); + ast = processor.ast_mangle(ast, config); + ast = processor.ast_squeeze(ast, config); + + fileContents = processor.gen_code(ast, config); + } catch (e) { + logger.error('Cannot uglify file: ' + fileName + '. Skipping it. Error is:\n' + e.toString()); + } + return fileContents; + } + } + }; + + return optimize; +}); +/** + * @license RequireJS Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ +/* + * This file patches require.js to communicate with the build system. + */ + +/*jslint nomen: false, plusplus: false, regexp: false, strict: false */ +/*global require: false, define: true */ + +//NOT asking for require as a dependency since the goal is to modify the +//global require below +define('requirePatch', [ 'env!env/file', 'pragma', 'parse'], +function (file, pragma, parse) { + + var allowRun = true; + + //This method should be called when the patches to require should take hold. + return function () { + if (!allowRun) { + return; + } + allowRun = false; + + var layer, + pluginBuilderRegExp = /(["']?)pluginBuilder(["']?)\s*[=\:]\s*["']([^'"\s]+)["']/, + oldDef; + + + /** Print out some extrs info about the module tree that caused the error. **/ + require.onError = function (err) { + + var msg = '\nIn module tree:\n', + standardIndent = ' ', + tree = err.moduleTree, + i, j, mod; + + if (tree && tree.length > 0) { + for (i = tree.length - 1; i > -1 && (mod = tree[i]); i--) { + for (j = tree.length - i; j > -1; j--) { + msg += standardIndent; + } + msg += mod + '\n'; + } + + err = new Error(err.toString() + msg); + } + + throw err; + }; + + //Stored cached file contents for reuse in other layers. + require._cachedFileContents = {}; + + /** Reset state for each build layer pass. */ + require._buildReset = function () { + var oldContext = require.s.contexts._; + + //Clear up the existing context. + delete require.s.contexts._; + + //Set up new context, so the layer object can hold onto it. + require({}); + + layer = require._layer = { + buildPathMap: {}, + buildFileToModule: {}, + buildFilePaths: [], + pathAdded: {}, + modulesWithNames: {}, + needsDefine: {}, + existingRequireUrl: "", + context: require.s.contexts._ + }; + + //Return the previous context in case it is needed, like for + //the basic config object. + return oldContext; + }; + + require._buildReset(); + + /** + * Makes sure the URL is something that can be supported by the + * optimization tool. + * @param {String} url + * @returns {Boolean} + */ + require._isSupportedBuildUrl = function (url) { + //Ignore URLs with protocols, hosts or question marks, means either network + //access is needed to fetch it or it is too dynamic. Note that + //on Windows, full paths are used for some urls, which include + //the drive, like c:/something, so need to test for something other + //than just a colon. + return url.indexOf("://") === -1 && url.indexOf("?") === -1 && + url.indexOf('empty:') !== 0 && url.indexOf('//') !== 0; + }; + + //Override define() to catch modules that just define an object, so that + //a dummy define call is not put in the build file for them. They do + //not end up getting defined via require.execCb, so we need to catch them + //at the define call. + oldDef = define; + + //This function signature does not have to be exact, just match what we + //are looking for. + define = function (name, obj) { + if (typeof name === "string" && !layer.needsDefine[name]) { + layer.modulesWithNames[name] = true; + } + return oldDef.apply(require, arguments); + }; + + define.amd = oldDef.amd; + + //Add some utilities for plugins + require._readFile = file.readFile; + require._fileExists = function (path) { + return file.exists(path); + }; + + function normalizeUrlWithBase(context, moduleName, url) { + //Adjust the URL if it was not transformed to use baseUrl. + if (require.jsExtRegExp.test(moduleName)) { + url = (context.config.dir || context.config.dirBaseUrl) + url; + } + return url; + } + + //Override load so that the file paths can be collected. + require.load = function (context, moduleName, url) { + /*jslint evil: true */ + var contents, pluginBuilderMatch, builderName; + + context.scriptCount += 1; + + //Only handle urls that can be inlined, so that means avoiding some + //URLs like ones that require network access or may be too dynamic, + //like JSONP + if (require._isSupportedBuildUrl(url)) { + //Adjust the URL if it was not transformed to use baseUrl. + url = normalizeUrlWithBase(context, moduleName, url); + + //Save the module name to path and path to module name mappings. + layer.buildPathMap[moduleName] = url; + layer.buildFileToModule[url] = moduleName; + + if (moduleName in context.plugins) { + //plugins need to have their source evaled as-is. + context.needFullExec[moduleName] = true; + } + + try { + if (url in require._cachedFileContents && + (!context.needFullExec[moduleName] || context.fullExec[moduleName])) { + contents = require._cachedFileContents[url]; + } else { + //Load the file contents, process for conditionals, then + //evaluate it. + contents = file.readFile(url); + + //If there is a read filter, run it now. + if (context.config.onBuildRead) { + contents = context.config.onBuildRead(moduleName, url, contents); + } + + contents = pragma.process(url, contents, context.config, 'OnExecute'); + + //Find out if the file contains a require() definition. Need to know + //this so we can inject plugins right after it, but before they are needed, + //and to make sure this file is first, so that define calls work. + //This situation mainly occurs when the build is done on top of the output + //of another build, where the first build may include require somewhere in it. + try { + if (!layer.existingRequireUrl && parse.definesRequire(url, contents)) { + layer.existingRequireUrl = url; + } + } catch (e1) { + throw new Error('Parse error using UglifyJS ' + + 'for file: ' + url + '\n' + e1); + } + + if (moduleName in context.plugins) { + //This is a loader plugin, check to see if it has a build extension, + //otherwise the plugin will act as the plugin builder too. + pluginBuilderMatch = pluginBuilderRegExp.exec(contents); + if (pluginBuilderMatch) { + //Load the plugin builder for the plugin contents. + builderName = context.normalize(pluginBuilderMatch[3], moduleName); + contents = file.readFile(context.nameToUrl(builderName)); + } + } + + //Parse out the require and define calls. + //Do this even for plugins in case they have their own + //dependencies that may be separate to how the pluginBuilder works. + try { + if (!context.needFullExec[moduleName]) { + contents = parse(moduleName, url, contents, { + insertNeedsDefine: true, + has: context.config.has, + findNestedDependencies: context.config.findNestedDependencies + }); + } + } catch (e2) { + throw new Error('Parse error using UglifyJS ' + + 'for file: ' + url + '\n' + e2); + } + + require._cachedFileContents[url] = contents; + } + + if (contents) { + eval(contents); + } + + //Need to close out completion of this module + //so that listeners will get notified that it is available. + try { + context.completeLoad(moduleName); + } catch (e) { + //Track which module could not complete loading. + (e.moduleTree || (e.moduleTree = [])).push(moduleName); + throw e; + } + + } catch (eOuter) { + if (!eOuter.fileName) { + eOuter.fileName = url; + } + throw eOuter; + } + } else { + //With unsupported URLs still need to call completeLoad to + //finish loading. + context.completeLoad(moduleName); + } + + //Mark the module loaded. + context.loaded[moduleName] = true; + }; + + + //Called when execManager runs for a dependency. Used to figure out + //what order of execution. + require.onResourceLoad = function (context, map) { + var fullName = map.fullName, + url; + + //Ignore "fake" modules, usually generated by plugin code, since + //they do not map back to a real file to include in the optimizer, + //or it will be included, but in a different form. + if (context.fake[fullName]) { + return; + } + + //A plugin. + if (map.prefix) { + if (!layer.pathAdded[fullName]) { + layer.buildFilePaths.push(fullName); + //For plugins the real path is not knowable, use the name + //for both module to file and file to module mappings. + layer.buildPathMap[fullName] = fullName; + layer.buildFileToModule[fullName] = fullName; + layer.modulesWithNames[fullName] = true; + layer.pathAdded[fullName] = true; + } + } else if (map.url && require._isSupportedBuildUrl(map.url)) { + //If the url has not been added to the layer yet, and it + //is from an actual file that was loaded, add it now. + url = normalizeUrlWithBase(context, map.fullName, map.url); + if (!layer.pathAdded[url] && layer.buildPathMap[fullName]) { + //Remember the list of dependencies for this layer. + layer.buildFilePaths.push(url); + layer.pathAdded[url] = true; + } + } + }; + + //Called by output of the parse() function, when a file does not + //explicitly call define, probably just require, but the parse() + //function normalizes on define() for dependency mapping and file + //ordering works correctly. + require.needsDefine = function (moduleName) { + layer.needsDefine[moduleName] = true; + }; + + //Marks module has having a name, and optionally executes the + //callback, but only if it meets certain criteria. + require.execCb = function (name, cb, args, exports) { + if (!layer.needsDefine[name]) { + layer.modulesWithNames[name] = true; + } + if (cb.__requireJsBuild || layer.context.needFullExec[name]) { + return cb.apply(exports, args); + } + return undefined; + }; + }; +}); +/** + * @license RequireJS Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ + +/*jslint plusplus: false, regexp: false, strict: false */ +/*global define: false, console: false */ + +define('commonJs', ['env!env/file', 'uglifyjs/index'], function (file, uglify) { + var commonJs = { + depRegExp: /require\s*\(\s*["']([\w-_\.\/]+)["']\s*\)/g, + + //Set this to false in non-rhino environments. If rhino, then it uses + //rhino's decompiler to remove comments before looking for require() calls, + //otherwise, it will use a crude regexp approach to remove comments. The + //rhino way is more robust, but he regexp is more portable across environments. + useRhino: true, + + //Set to false if you do not want this file to log. Useful in environments + //like node where you want the work to happen without noise. + useLog: true, + + convertDir: function (commonJsPath, savePath) { + var fileList, i, + jsFileRegExp = /\.js$/, + fileName, convertedFileName, fileContents; + + //Get list of files to convert. + fileList = file.getFilteredFileList(commonJsPath, /\w/, true); + + //Normalize on front slashes and make sure the paths do not end in a slash. + commonJsPath = commonJsPath.replace(/\\/g, "/"); + savePath = savePath.replace(/\\/g, "/"); + if (commonJsPath.charAt(commonJsPath.length - 1) === "/") { + commonJsPath = commonJsPath.substring(0, commonJsPath.length - 1); + } + if (savePath.charAt(savePath.length - 1) === "/") { + savePath = savePath.substring(0, savePath.length - 1); + } + + //Cycle through all the JS files and convert them. + if (!fileList || !fileList.length) { + if (commonJs.useLog) { + if (commonJsPath === "convert") { + //A request just to convert one file. + console.log('\n\n' + commonJs.convert(savePath, file.readFile(savePath))); + } else { + console.log("No files to convert in directory: " + commonJsPath); + } + } + } else { + for (i = 0; (fileName = fileList[i]); i++) { + convertedFileName = fileName.replace(commonJsPath, savePath); + + //Handle JS files. + if (jsFileRegExp.test(fileName)) { + fileContents = file.readFile(fileName); + fileContents = commonJs.convert(fileName, fileContents); + file.saveUtf8File(convertedFileName, fileContents); + } else { + //Just copy the file over. + file.copyFile(fileName, convertedFileName, true); + } + } + } + }, + + /** + * Removes the comments from a string. + * + * @param {String} fileContents + * @param {String} fileName mostly used for informative reasons if an error. + * + * @returns {String} a string of JS with comments removed. + */ + removeComments: function (fileContents, fileName) { + //Uglify's ast generation removes comments, so just convert to ast, + //then back to source code to get rid of comments. + return uglify.uglify.gen_code(uglify.parser.parse(fileContents), true); + }, + + /** + * Regexp for testing if there is already a require.def call in the file, + * in which case do not try to convert it. + */ + defRegExp: /define\s*\(\s*("|'|\[|function)/, + + /** + * Regexp for testing if there is a require([]) or require(function(){}) + * call, indicating the file is already in requirejs syntax. + */ + rjsRegExp: /require\s*\(\s*(\[|function)/, + + /** + * Does the actual file conversion. + * + * @param {String} fileName the name of the file. + * + * @param {String} fileContents the contents of a file :) + * + * @param {Boolean} skipDeps if true, require("") dependencies + * will not be searched, but the contents will just be wrapped in the + * standard require, exports, module dependencies. Only usable in sync + * environments like Node where the require("") calls can be resolved on + * the fly. + * + * @returns {String} the converted contents + */ + convert: function (fileName, fileContents, skipDeps) { + //Strip out comments. + try { + var deps = [], depName, match, + //Remove comments + tempContents = commonJs.removeComments(fileContents, fileName); + + //First see if the module is not already RequireJS-formatted. + if (commonJs.defRegExp.test(tempContents) || commonJs.rjsRegExp.test(tempContents)) { + return fileContents; + } + + //Reset the regexp to start at beginning of file. Do this + //since the regexp is reused across files. + commonJs.depRegExp.lastIndex = 0; + + if (!skipDeps) { + //Find dependencies in the code that was not in comments. + while ((match = commonJs.depRegExp.exec(tempContents))) { + depName = match[1]; + if (depName) { + deps.push('"' + depName + '"'); + } + } + } + + //Construct the wrapper boilerplate. + fileContents = 'define(["require", "exports", "module"' + + (deps.length ? ', ' + deps.join(",") : '') + '], ' + + 'function(require, exports, module) {\n' + + fileContents + + '\n});\n'; + } catch (e) { + console.log("COULD NOT CONVERT: " + fileName + ", so skipping it. Error was: " + e); + return fileContents; + } + + return fileContents; + } + }; + + return commonJs; +}); +/** + * @license Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ + +/*jslint plusplus: true, nomen: true */ +/*global define, require */ + + +define('build', [ 'lang', 'logger', 'env!env/file', 'parse', 'optimize', 'pragma', + 'env!env/load', 'requirePatch'], +function (lang, logger, file, parse, optimize, pragma, + load, requirePatch) { + 'use strict'; + + var build, buildBaseConfig, + endsWithSemiColonRegExp = /;\s*$/; + + buildBaseConfig = { + appDir: "", + pragmas: {}, + paths: {}, + optimize: "uglify", + optimizeCss: "standard.keepLines", + inlineText: true, + isBuild: true, + optimizeAllPluginResources: false, + findNestedDependencies: false, + preserveLicenseComments: true, + //By default, all files/directories are copied, unless + //they match this regexp, by default just excludes .folders + dirExclusionRegExp: file.dirExclusionRegExp + }; + + /** + * Some JS may not be valid if concatenated with other JS, in particular + * the style of omitting semicolons and rely on ASI. Add a semicolon in + * those cases. + */ + function addSemiColon(text) { + if (endsWithSemiColonRegExp.test(text)) { + return text; + } else { + return text + ";"; + } + } + + /** + * If the path looks like an URL, throw an error. This is to prevent + * people from using URLs with protocols in the build config, since + * the optimizer is not set up to do network access. However, be + * sure to allow absolute paths on Windows, like C:\directory. + */ + function disallowUrls(path) { + if ((path.indexOf('://') !== -1 || path.indexOf('//') === 0) && path !== 'empty:') { + throw new Error('Path is not supported: ' + path + + '\nOptimizer can only handle' + + ' local paths. Download the locally if necessary' + + ' and update the config to use a local path.\n' + + 'http://requirejs.org/docs/errors.html#pathnotsupported'); + } + } + + function endsWithSlash(dirName) { + if (dirName.charAt(dirName.length - 1) !== "/") { + dirName += "/"; + } + disallowUrls(dirName); + return dirName; + } + + //Method used by plugin writeFile calls, defined up here to avoid + //jslint warning about "making a function in a loop". + function makeWriteFile(anonDefRegExp, namespaceWithDot, layer) { + function writeFile(name, contents) { + logger.trace('Saving plugin-optimized file: ' + name); + file.saveUtf8File(name, contents); + } + + writeFile.asModule = function (moduleName, fileName, contents) { + writeFile(fileName, + build.toTransport(anonDefRegExp, namespaceWithDot, moduleName, fileName, contents, layer)); + }; + + return writeFile; + } + + /** + * Main API entry point into the build. The args argument can either be + * an array of arguments (like the onese passed on a command-line), + * or it can be a JavaScript object that has the format of a build profile + * file. + * + * If it is an object, then in addition to the normal properties allowed in + * a build profile file, the object should contain one other property: + * + * The object could also contain a "buildFile" property, which is a string + * that is the file path to a build profile that contains the rest + * of the build profile directives. + * + * This function does not return a status, it should throw an error if + * there is a problem completing the build. + */ + build = function (args) { + var buildFile, cmdConfig; + + if (!args || lang.isArray(args)) { + if (!args || args.length < 1) { + logger.error("build.js buildProfile.js\n" + + "where buildProfile.js is the name of the build file (see example.build.js for hints on how to make a build file)."); + return undefined; + } + + //Next args can include a build file path as well as other build args. + //build file path comes first. If it does not contain an = then it is + //a build file path. Otherwise, just all build args. + if (args[0].indexOf("=") === -1) { + buildFile = args[0]; + args.splice(0, 1); + } + + //Remaining args are options to the build + cmdConfig = build.convertArrayToObject(args); + cmdConfig.buildFile = buildFile; + } else { + cmdConfig = args; + } + + return build._run(cmdConfig); + }; + + build._run = function (cmdConfig) { + var buildFileContents = "", + pluginCollector = {}, + buildPaths, fileName, fileNames, + prop, paths, i, + baseConfig, config, + modules, builtModule, srcPath, buildContext, + destPath, moduleName, moduleMap, parentModuleMap, context, + resources, resource, pluginProcessed = {}, plugin; + + //Can now run the patches to require.js to allow it to be used for + //build generation. Do it here instead of at the top of the module + //because we want normal require behavior to load the build tool + //then want to switch to build mode. + requirePatch(); + + config = build.createConfig(cmdConfig); + paths = config.paths; + + if (config.logLevel) { + logger.logLevel(config.logLevel); + } + + if (!config.out && !config.cssIn) { + //This is not just a one-off file build but a full build profile, with + //lots of files to process. + + //First copy all the baseUrl content + file.copyDir((config.appDir || config.baseUrl), config.dir, /\w/, true); + + //Adjust baseUrl if config.appDir is in play, and set up build output paths. + buildPaths = {}; + if (config.appDir) { + //All the paths should be inside the appDir, so just adjust + //the paths to use the dirBaseUrl + for (prop in paths) { + if (paths.hasOwnProperty(prop)) { + buildPaths[prop] = paths[prop].replace(config.baseUrl, config.dirBaseUrl); + } + } + } else { + //If no appDir, then make sure to copy the other paths to this directory. + for (prop in paths) { + if (paths.hasOwnProperty(prop)) { + //Set up build path for each path prefix. + buildPaths[prop] = paths[prop] === 'empty:' ? 'empty:' : prop.replace(/\./g, "/"); + + //Make sure source path is fully formed with baseUrl, + //if it is a relative URL. + srcPath = paths[prop]; + if (srcPath.indexOf('/') !== 0 && srcPath.indexOf(':') === -1) { + srcPath = config.baseUrl + srcPath; + } + + destPath = config.dirBaseUrl + buildPaths[prop]; + + //Skip empty: paths + if (srcPath !== 'empty:') { + //If the srcPath is a directory, copy the whole directory. + if (file.exists(srcPath) && file.isDirectory(srcPath)) { + //Copy files to build area. Copy all files (the /\w/ regexp) + file.copyDir(srcPath, destPath, /\w/, true); + } else { + //Try a .js extension + srcPath += '.js'; + destPath += '.js'; + file.copyFile(srcPath, destPath); + } + } + } + } + } + } + + //Figure out source file location for each module layer. Do this by seeding require + //with source area configuration. This is needed so that later the module layers + //can be manually copied over to the source area, since the build may be + //require multiple times and the above copyDir call only copies newer files. + require({ + baseUrl: config.baseUrl, + paths: paths, + packagePaths: config.packagePaths, + packages: config.packages + }); + buildContext = require.s.contexts._; + modules = config.modules; + + if (modules) { + modules.forEach(function (module) { + if (module.name) { + module._sourcePath = buildContext.nameToUrl(module.name); + //If the module does not exist, and this is not a "new" module layer, + //as indicated by a true "create" property on the module, and + //it is not a plugin-loaded resource, then throw an error. + if (!file.exists(module._sourcePath) && !module.create && + module.name.indexOf('!') === -1) { + throw new Error("ERROR: module path does not exist: " + + module._sourcePath + " for module named: " + module.name + + ". Path is relative to: " + file.absPath('.')); + } + } + }); + } + + if (config.out) { + //Just set up the _buildPath for the module layer. + require(config); + if (!config.cssIn) { + config.modules[0]._buildPath = config.out; + } + } else if (!config.cssIn) { + //Now set up the config for require to use the build area, and calculate the + //build file locations. Pass along any config info too. + baseConfig = { + baseUrl: config.dirBaseUrl, + paths: buildPaths + }; + + lang.mixin(baseConfig, config); + require(baseConfig); + + if (modules) { + modules.forEach(function (module) { + if (module.name) { + module._buildPath = buildContext.nameToUrl(module.name, null); + if (!module.create) { + file.copyFile(module._sourcePath, module._buildPath); + } + } + }); + } + } + + //Run CSS optimizations before doing JS module tracing, to allow + //things like text loader plugins loading CSS to get the optimized + //CSS. + if (config.optimizeCss && config.optimizeCss !== "none" && config.dir) { + buildFileContents += optimize.css(config.dir, config); + } + + if (modules) { + //For each module layer, call require to calculate dependencies. + modules.forEach(function (module) { + module.layer = build.traceDependencies(module, config); + }); + + //Now build up shadow layers for anything that should be excluded. + //Do this after tracing dependencies for each module, in case one + //of those modules end up being one of the excluded values. + modules.forEach(function (module) { + if (module.exclude) { + module.excludeLayers = []; + module.exclude.forEach(function (exclude, i) { + //See if it is already in the list of modules. + //If not trace dependencies for it. + module.excludeLayers[i] = build.findBuildModule(exclude, modules) || + {layer: build.traceDependencies({name: exclude}, config)}; + }); + } + }); + + modules.forEach(function (module) { + if (module.exclude) { + //module.exclude is an array of module names. For each one, + //get the nested dependencies for it via a matching entry + //in the module.excludeLayers array. + module.exclude.forEach(function (excludeModule, i) { + var excludeLayer = module.excludeLayers[i].layer, map = excludeLayer.buildPathMap, prop; + for (prop in map) { + if (map.hasOwnProperty(prop)) { + build.removeModulePath(prop, map[prop], module.layer); + } + } + }); + } + if (module.excludeShallow) { + //module.excludeShallow is an array of module names. + //shallow exclusions are just that module itself, and not + //its nested dependencies. + module.excludeShallow.forEach(function (excludeShallowModule) { + var path = module.layer.buildPathMap[excludeShallowModule]; + if (path) { + build.removeModulePath(excludeShallowModule, path, module.layer); + } + }); + } + + //Flatten them and collect the build output for each module. + builtModule = build.flattenModule(module, module.layer, config); + + //Save it to a temp file for now, in case there are other layers that + //contain optimized content that should not be included in later + //layer optimizations. See issue #56. + file.saveUtf8File(module._buildPath + '-temp', builtModule.text); + buildFileContents += builtModule.buildText; + }); + + //Now move the build layers to their final position. + modules.forEach(function (module) { + var finalPath = module._buildPath; + if (file.exists(finalPath)) { + file.deleteFile(finalPath); + } + file.renameFile(finalPath + '-temp', finalPath); + }); + } + + //Do other optimizations. + if (config.out && !config.cssIn) { + //Just need to worry about one JS file. + fileName = config.modules[0]._buildPath; + optimize.jsFile(fileName, fileName, config); + } else if (!config.cssIn) { + //Normal optimizations across modules. + + //JS optimizations. + fileNames = file.getFilteredFileList(config.dir, /\.js$/, true); + for (i = 0; (fileName = fileNames[i]); i++) { + //Generate the module name from the config.dir root. + moduleName = fileName.replace(config.dir, ''); + //Get rid of the extension + moduleName = moduleName.substring(0, moduleName.length - 3); + optimize.jsFile(fileName, fileName, config, moduleName, pluginCollector); + } + + //Normalize all the plugin resources. + context = require.s.contexts._; + + for (moduleName in pluginCollector) { + if (pluginCollector.hasOwnProperty(moduleName)) { + parentModuleMap = context.makeModuleMap(moduleName); + resources = pluginCollector[moduleName]; + for (i = 0; (resource = resources[i]); i++) { + moduleMap = context.makeModuleMap(resource, parentModuleMap); + if (!context.plugins[moduleMap.prefix]) { + //Set the value in context.plugins so it + //will be evaluated as a full plugin. + context.plugins[moduleMap.prefix] = true; + + //Do not bother if the plugin is not available. + if (!file.exists(require.toUrl(moduleMap.prefix + '.js'))) { + continue; + } + + //Rely on the require in the build environment + //to be synchronous + context.require([moduleMap.prefix]); + + //Now that the plugin is loaded, redo the moduleMap + //since the plugin will need to normalize part of the path. + moduleMap = context.makeModuleMap(resource, parentModuleMap); + } + + //Only bother with plugin resources that can be handled + //processed by the plugin, via support of the writeFile + //method. + if (!pluginProcessed[moduleMap.fullName]) { + //Only do the work if the plugin was really loaded. + //Using an internal access because the file may + //not really be loaded. + plugin = context.defined[moduleMap.prefix]; + if (plugin && plugin.writeFile) { + plugin.writeFile( + moduleMap.prefix, + moduleMap.name, + require, + makeWriteFile( + config.anonDefRegExp, + config.namespaceWithDot + ), + context.config + ); + } + + pluginProcessed[moduleMap.fullName] = true; + } + } + + } + } + + //console.log('PLUGIN COLLECTOR: ' + JSON.stringify(pluginCollector, null, " ")); + + + //All module layers are done, write out the build.txt file. + file.saveUtf8File(config.dir + "build.txt", buildFileContents); + } + + //If just have one CSS file to optimize, do that here. + if (config.cssIn) { + buildFileContents += optimize.cssFile(config.cssIn, config.out, config); + } + + //Print out what was built into which layers. + if (buildFileContents) { + logger.info(buildFileContents); + return buildFileContents; + } + + return ''; + }; + + /** + * Converts command line args like "paths.foo=../some/path" + * result.paths = { foo: '../some/path' } where prop = paths, + * name = paths.foo and value = ../some/path, so it assumes the + * name=value splitting has already happened. + */ + function stringDotToObj(result, prop, name, value) { + if (!result[prop]) { + result[prop] = {}; + } + name = name.substring((prop + '.').length, name.length); + result[prop][name] = value; + } + + //Used by convertArrayToObject to convert some things from prop.name=value + //to a prop: { name: value} + build.dotProps = [ + 'paths.', + 'wrap.', + 'pragmas.', + 'pragmasOnSave.', + 'has.', + 'hasOnSave.', + 'wrap.', + 'uglify.', + 'closure.' + ]; + + build.hasDotPropMatch = function (prop) { + return build.dotProps.some(function (dotProp) { + return prop.indexOf(dotProp) === 0; + }); + }; + + /** + * Converts an array that has String members of "name=value" + * into an object, where the properties on the object are the names in the array. + * Also converts the strings "true" and "false" to booleans for the values. + * member name/value pairs, and converts some comma-separated lists into + * arrays. + * @param {Array} ary + */ + build.convertArrayToObject = function (ary) { + var result = {}, i, separatorIndex, prop, value, + needArray = { + "include": true, + "exclude": true, + "excludeShallow": true + }; + + for (i = 0; i < ary.length; i++) { + separatorIndex = ary[i].indexOf("="); + if (separatorIndex === -1) { + throw "Malformed name/value pair: [" + ary[i] + "]. Format should be name=value"; + } + + value = ary[i].substring(separatorIndex + 1, ary[i].length); + if (value === "true") { + value = true; + } else if (value === "false") { + value = false; + } + + prop = ary[i].substring(0, separatorIndex); + + //Convert to array if necessary + if (needArray[prop]) { + value = value.split(","); + } + + if (build.hasDotPropMatch(prop)) { + stringDotToObj(result, prop.split('.')[0], prop, value); + } else { + result[prop] = value; + } + } + return result; //Object + }; + + build.makeAbsPath = function (path, absFilePath) { + //Add abspath if necessary. If path starts with a slash or has a colon, + //then already is an abolute path. + if (path.indexOf('/') !== 0 && path.indexOf(':') === -1) { + path = absFilePath + + (absFilePath.charAt(absFilePath.length - 1) === '/' ? '' : '/') + + path; + path = file.normalize(path); + } + return path.replace(lang.backSlashRegExp, '/'); + }; + + build.makeAbsObject = function (props, obj, absFilePath) { + var i, prop; + if (obj) { + for (i = 0; (prop = props[i]); i++) { + if (obj.hasOwnProperty(prop)) { + obj[prop] = build.makeAbsPath(obj[prop], absFilePath); + } + } + } + }; + + /** + * For any path in a possible config, make it absolute relative + * to the absFilePath passed in. + */ + build.makeAbsConfig = function (config, absFilePath) { + var props, prop, i; + + props = ["appDir", "dir", "baseUrl"]; + for (i = 0; (prop = props[i]); i++) { + if (config[prop]) { + //Add abspath if necessary, make sure these paths end in + //slashes + if (prop === "baseUrl") { + config.originalBaseUrl = config.baseUrl; + if (config.appDir) { + //If baseUrl with an appDir, the baseUrl is relative to + //the appDir, *not* the absFilePath. appDir and dir are + //made absolute before baseUrl, so this will work. + config.baseUrl = build.makeAbsPath(config.originalBaseUrl, config.appDir); + } else { + //The dir output baseUrl is same as regular baseUrl, both + //relative to the absFilePath. + config.baseUrl = build.makeAbsPath(config[prop], absFilePath); + } + } else { + config[prop] = build.makeAbsPath(config[prop], absFilePath); + } + + config[prop] = endsWithSlash(config[prop]); + } + } + + //Do not allow URLs for paths resources. + if (config.paths) { + for (prop in config.paths) { + if (config.paths.hasOwnProperty(prop)) { + config.paths[prop] = build.makeAbsPath(config.paths[prop], + (config.baseUrl || absFilePath)); + } + } + } + + build.makeAbsObject(["out", "cssIn"], config, absFilePath); + build.makeAbsObject(["startFile", "endFile"], config.wrap, absFilePath); + }; + + build.nestedMix = { + paths: true, + has: true, + hasOnSave: true, + pragmas: true, + pragmasOnSave: true + }; + + /** + * Mixes additional source config into target config, and merges some + * nested config, like paths, correctly. + */ + function mixConfig(target, source) { + var prop, value; + + for (prop in source) { + if (source.hasOwnProperty(prop)) { + //If the value of the property is a plain object, then + //allow a one-level-deep mixing of it. + value = source[prop]; + if (typeof value === 'object' && value && + !lang.isArray(value) && !lang.isFunction(value) && + !lang.isRegExp(value)) { + target[prop] = lang.mixin({}, target[prop], value, true); + } else { + target[prop] = value; + } + } + } + } + + /** + * Creates a config object for an optimization build. + * It will also read the build profile if it is available, to create + * the configuration. + * + * @param {Object} cfg config options that take priority + * over defaults and ones in the build file. These options could + * be from a command line, for instance. + * + * @param {Object} the created config object. + */ + build.createConfig = function (cfg) { + /*jslint evil: true */ + var config = {}, buildFileContents, buildFileConfig, mainConfig, + mainConfigFile, prop, buildFile, absFilePath; + + //Make sure all paths are relative to current directory. + absFilePath = file.absPath('.'); + build.makeAbsConfig(cfg, absFilePath); + build.makeAbsConfig(buildBaseConfig, absFilePath); + + lang.mixin(config, buildBaseConfig); + lang.mixin(config, cfg, true); + + if (config.buildFile) { + //A build file exists, load it to get more config. + buildFile = file.absPath(config.buildFile); + + //Find the build file, and make sure it exists, if this is a build + //that has a build profile, and not just command line args with an in=path + if (!file.exists(buildFile)) { + throw new Error("ERROR: build file does not exist: " + buildFile); + } + + absFilePath = config.baseUrl = file.absPath(file.parent(buildFile)); + + //Load build file options. + buildFileContents = file.readFile(buildFile); + try { + buildFileConfig = eval("(" + buildFileContents + ")"); + build.makeAbsConfig(buildFileConfig, absFilePath); + + if (!buildFileConfig.out && !buildFileConfig.dir) { + buildFileConfig.dir = (buildFileConfig.baseUrl || config.baseUrl) + "/build/"; + } + + } catch (e) { + throw new Error("Build file " + buildFile + " is malformed: " + e); + } + } + + mainConfigFile = config.mainConfigFile || (buildFileConfig && buildFileConfig.mainConfigFile); + if (mainConfigFile) { + mainConfigFile = build.makeAbsPath(mainConfigFile, absFilePath); + try { + mainConfig = parse.findConfig(mainConfigFile, file.readFile(mainConfigFile)); + } catch (configError) { + throw new Error('The config in mainConfigFile ' + + mainConfigFile + + ' cannot be used because it cannot be evaluated' + + ' correctly while running in the optimizer. Try only' + + ' using a config that is also valid JSON, or do not use' + + ' mainConfigFile and instead copy the config values needed' + + ' into a build file or command line arguments given to the optimizer.'); + } + if (mainConfig) { + //If no baseUrl, then use the directory holding the main config. + if (!mainConfig.baseUrl) { + mainConfig.baseUrl = mainConfigFile.substring(0, mainConfigFile.lastIndexOf('/')); + } + build.makeAbsConfig(mainConfig, mainConfigFile); + mixConfig(config, mainConfig); + } + } + + //Mix in build file config, but only after mainConfig has been mixed in. + if (buildFileConfig) { + mixConfig(config, buildFileConfig); + } + + //Re-apply the override config values. Command line + //args should take precedence over build file values. + mixConfig(config, cfg); + + + //Set final output dir + if (config.hasOwnProperty("baseUrl")) { + if (config.appDir) { + config.dirBaseUrl = build.makeAbsPath(config.originalBaseUrl, config.dir); + } else { + config.dirBaseUrl = config.dir || config.baseUrl; + } + //Make sure dirBaseUrl ends in a slash, since it is + //concatenated with other strings. + config.dirBaseUrl = endsWithSlash(config.dirBaseUrl); + } + + //Check for errors in config + if (config.cssIn && !config.out) { + throw new Error("ERROR: 'out' option missing."); + } + if (!config.cssIn && !config.baseUrl) { + throw new Error("ERROR: 'baseUrl' option missing."); + } + if (!config.out && !config.dir) { + throw new Error('Missing either an "out" or "dir" config value. ' + + 'If using "appDir" for a full project optimization, ' + + 'use "dir". If you want to optimize to one file, ' + + 'use "out".'); + } + if (config.appDir && config.out) { + throw new Error('"appDir" is not compatible with "out". Use "dir" ' + + 'instead. appDir is used to copy whole projects, ' + + 'where "out" is used to just optimize to one file.'); + } + if (config.out && config.dir) { + throw new Error('The "out" and "dir" options are incompatible.' + + ' Use "out" if you are targeting a single file for' + + ' for optimization, and "dir" if you want the appDir' + + ' or baseUrl directories optimized.'); + } + + if ((config.name || config.include) && !config.modules) { + //Just need to build one file, but may be part of a whole appDir/ + //baseUrl copy, but specified on the command line, so cannot do + //the modules array setup. So create a modules section in that + //case. + config.modules = [ + { + name: config.name, + out: config.out, + include: config.include, + exclude: config.exclude, + excludeShallow: config.excludeShallow + } + ]; + } + + if (config.out && !config.cssIn) { + //Just one file to optimize. + + //Does not have a build file, so set up some defaults. + //Optimizing CSS should not be allowed, unless explicitly + //asked for on command line. In that case the only task is + //to optimize a CSS file. + if (!cfg.optimizeCss) { + config.optimizeCss = "none"; + } + } + + //Do not allow URLs for paths resources. + if (config.paths) { + for (prop in config.paths) { + if (config.paths.hasOwnProperty(prop)) { + disallowUrls(config.paths[prop]); + } + } + } + + //Get any wrap text. + try { + if (config.wrap) { + if (config.wrap === true) { + //Use default values. + config.wrap = { + start: '(function () {', + end: '}());' + }; + } else { + config.wrap.start = config.wrap.start || + file.readFile(build.makeAbsPath(config.wrap.startFile, absFilePath)); + config.wrap.end = config.wrap.end || + file.readFile(build.makeAbsPath(config.wrap.endFile, absFilePath)); + } + } + } catch (wrapError) { + throw new Error('Malformed wrap config: need both start/end or ' + + 'startFile/endFile: ' + wrapError.toString()); + } + + + //Set up proper info for namespaces and using namespaces in transport + //wrappings. + config.namespaceWithDot = config.namespace ? config.namespace + '.' : ''; + config.anonDefRegExp = build.makeAnonDefRegExp(config.namespaceWithDot); + + //Do final input verification + if (config.context) { + throw new Error('The build argument "context" is not supported' + + ' in a build. It should only be used in web' + + ' pages.'); + } + + //Set file.fileExclusionRegExp if desired + if ('fileExclusionRegExp' in config) { + if (typeof config.fileExclusionRegExp === "string") { + file.exclusionRegExp = new RegExp(config.fileExclusionRegExp); + } else { + file.exclusionRegExp = config.fileExclusionRegExp; + } + } else if ('dirExclusionRegExp' in config) { + //Set file.dirExclusionRegExp if desired, this is the old + //name for fileExclusionRegExp before 1.0.2. Support for backwards + //compatibility + file.exclusionRegExp = config.dirExclusionRegExp; + } + + return config; + }; + + /** + * finds the module being built/optimized with the given moduleName, + * or returns null. + * @param {String} moduleName + * @param {Array} modules + * @returns {Object} the module object from the build profile, or null. + */ + build.findBuildModule = function (moduleName, modules) { + var i, module; + for (i = 0; (module = modules[i]); i++) { + if (module.name === moduleName) { + return module; + } + } + return null; + }; + + /** + * Removes a module name and path from a layer, if it is supposed to be + * excluded from the layer. + * @param {String} moduleName the name of the module + * @param {String} path the file path for the module + * @param {Object} layer the layer to remove the module/path from + */ + build.removeModulePath = function (module, path, layer) { + var index = layer.buildFilePaths.indexOf(path); + if (index !== -1) { + layer.buildFilePaths.splice(index, 1); + } + + //Take it out of the specified modules. Specified modules are mostly + //used to find require modifiers. + delete layer.specified[module]; + }; + + /** + * Uses the module build config object to trace the dependencies for the + * given module. + * + * @param {Object} module the module object from the build config info. + * @param {Object} the build config object. + * + * @returns {Object} layer information about what paths and modules should + * be in the flattened module. + */ + build.traceDependencies = function (module, config) { + var include, override, layer, context, baseConfig, oldContext; + + //Reset some state set up in requirePatch.js, and clean up require's + //current context. + oldContext = require._buildReset(); + + //Grab the reset layer and context after the reset, but keep the + //old config to reuse in the new context. + baseConfig = oldContext.config; + layer = require._layer; + context = layer.context; + + //Put back basic config, use a fresh object for it. + //WARNING: probably not robust for paths and packages/packagePaths, + //since those property's objects can be modified. But for basic + //config clone it works out. + require(lang.delegate(baseConfig)); + + logger.trace("\nTracing dependencies for: " + (module.name || module.out)); + include = module.name && !module.create ? [module.name] : []; + if (module.include) { + include = include.concat(module.include); + } + + //If there are overrides to basic config, set that up now.; + if (module.override) { + override = lang.delegate(baseConfig); + lang.mixin(override, module.override, true); + require(override); + } + + //Figure out module layer dependencies by calling require to do the work. + require(include); + + //Pull out the layer dependencies. + layer.specified = context.specified; + + //Reset config + if (module.override) { + require(baseConfig); + } + + return layer; + }; + + /** + * Uses the module build config object to create an flattened version + * of the module, with deep dependencies included. + * + * @param {Object} module the module object from the build config info. + * + * @param {Object} layer the layer object returned from build.traceDependencies. + * + * @param {Object} the build config object. + * + * @returns {Object} with two properties: "text", the text of the flattened + * module, and "buildText", a string of text representing which files were + * included in the flattened module text. + */ + build.flattenModule = function (module, layer, config) { + var buildFileContents = "", + namespace = config.namespace ? config.namespace + '.' : '', + context = layer.context, + anonDefRegExp = config.anonDefRegExp, + path, reqIndex, fileContents, currContents, + i, moduleName, + parts, builder, writeApi; + + //Use override settings, particularly for pragmas + if (module.override) { + config = lang.delegate(config); + lang.mixin(config, module.override, true); + } + + //Start build output for the module. + buildFileContents += "\n" + + (config.dir ? module._buildPath.replace(config.dir, "") : module._buildPath) + + "\n----------------\n"; + + //If there was an existing file with require in it, hoist to the top. + if (layer.existingRequireUrl) { + reqIndex = layer.buildFilePaths.indexOf(layer.existingRequireUrl); + if (reqIndex !== -1) { + layer.buildFilePaths.splice(reqIndex, 1); + layer.buildFilePaths.unshift(layer.existingRequireUrl); + } + } + + //Write the built module to disk, and build up the build output. + fileContents = ""; + for (i = 0; (path = layer.buildFilePaths[i]); i++) { + moduleName = layer.buildFileToModule[path]; + + //Figure out if the module is a result of a build plugin, and if so, + //then delegate to that plugin. + parts = context.makeModuleMap(moduleName); + builder = parts.prefix && context.defined[parts.prefix]; + if (builder) { + if (builder.write) { + writeApi = function (input) { + fileContents += "\n" + addSemiColon(input); + if (config.onBuildWrite) { + fileContents = config.onBuildWrite(moduleName, path, fileContents); + } + }; + writeApi.asModule = function (moduleName, input) { + fileContents += "\n" + + addSemiColon( + build.toTransport(anonDefRegExp, namespace, moduleName, path, input, layer)); + if (config.onBuildWrite) { + fileContents = config.onBuildWrite(moduleName, path, fileContents); + } + }; + builder.write(parts.prefix, parts.name, writeApi); + } + } else { + currContents = file.readFile(path); + + if (config.onBuildRead) { + currContents = config.onBuildRead(moduleName, path, currContents); + } + + if (config.namespace) { + currContents = pragma.namespace(currContents, config.namespace); + } + + currContents = build.toTransport(anonDefRegExp, namespace, moduleName, path, currContents, layer); + + if (config.onBuildWrite) { + currContents = config.onBuildWrite(moduleName, path, currContents); + } + + //Semicolon is for files that are not well formed when + //concatenated with other content. + fileContents += "\n" + addSemiColon(currContents); + } + + buildFileContents += path.replace(config.dir, "") + "\n"; + //Some files may not have declared a require module, and if so, + //put in a placeholder call so the require does not try to load them + //after the module is processed. + //If we have a name, but no defined module, then add in the placeholder. + if (moduleName && !layer.modulesWithNames[moduleName] && !config.skipModuleInsertion) { + //If including jquery, register the module correctly, otherwise + //register an empty function. For jquery, make sure jQuery is + //a real object, and perhaps not some other file mapping, like + //to zepto. + if (moduleName === 'jquery') { + fileContents += '\n(function () {\n' + + 'var jq = typeof jQuery !== "undefined" && jQuery;\n' + + namespace + + 'define("jquery", [], function () { return jq; });\n' + + '}());\n'; + } else { + fileContents += '\n' + namespace + 'define("' + moduleName + '", function(){});\n'; + } + } + } + + return { + text: config.wrap ? + config.wrap.start + fileContents + config.wrap.end : + fileContents, + buildText: buildFileContents + }; + }; + + /** + * Creates the regexp to find anonymous defines. + * @param {String} namespace an optional namespace to use. The namespace + * should *include* a trailing dot. So a valid value would be 'foo.' + * @returns {RegExp} + */ + build.makeAnonDefRegExp = function (namespace) { + //This regexp is not bullet-proof, and it has one optional part to + //avoid issues with some Dojo transition modules that use a + //define(\n//begin v1.x content + //for a comment. + return new RegExp('(^|[^\\.])(' + (namespace || '').replace(/\./g, '\\.') + + 'define|define)\\s*\\(\\s*(\\/\\/[^\\n\\r]*[\\r\\n])?(\\[|function|[\\w\\d_\\-\\$]+\\s*\\)|\\{|["\']([^"\']+)["\'])(\\s*,\\s*f)?'); + }; + + build.leadingCommaRegExp = /^\s*,/; + + build.toTransport = function (anonDefRegExp, namespace, moduleName, path, contents, layer) { + + //If anonymous module, insert the module name. + return contents.replace(anonDefRegExp, function (match, start, callName, possibleComment, suffix, namedModule, namedFuncStart) { + //A named module with either listed dependencies or an object + //literal for a value. Skip it. If named module, only want ones + //whose next argument is a function literal to scan for + //require('') dependecies. + if (namedModule && !namedFuncStart) { + return match; + } + + //Only mark this module as having a name if not a named module, + //or if a named module and the name matches expectations. + if (layer && (!namedModule || namedModule === moduleName)) { + layer.modulesWithNames[moduleName] = true; + } + + var deps = null; + + //Look for CommonJS require calls inside the function if this is + //an anonymous define call that just has a function registered. + //Also look if a named define function but has a factory function + //as the second arg that should be scanned for dependencies. + if (suffix.indexOf('f') !== -1 || (namedModule)) { + deps = parse.getAnonDeps(path, contents); + + if (deps.length) { + deps = deps.map(function (dep) { + return "'" + dep + "'"; + }); + } else { + deps = []; + } + } + + return start + namespace + "define('" + (namedModule || moduleName) + "'," + + (deps ? ('[' + deps.toString() + '],') : '') + + (namedModule ? namedFuncStart.replace(build.leadingCommaRegExp, '') : suffix); + }); + + }; + + return build; +}); + + } + + + /** + * Sets the default baseUrl for requirejs to be directory of top level + * script. + */ + function setBaseUrl(fileName) { + //Use the file name's directory as the baseUrl if available. + dir = fileName.replace(/\\/g, '/'); + if (dir.indexOf('/') !== -1) { + dir = dir.split('/'); + dir.pop(); + dir = dir.join('/'); + exec("require({baseUrl: '" + dir + "'});"); + } + } + + //If in Node, and included via a require('requirejs'), just export and + //THROW IT ON THE GROUND! + if (env === 'node' && reqMain !== module) { + setBaseUrl(path.resolve(reqMain ? reqMain.filename : '.')); + + //Create a method that will run the optimzer given an object + //config. + requirejs.optimize = function (config, callback) { + if (!loadedOptimizedLib) { + loadLib(); + loadedOptimizedLib = true; + } + + //Create the function that will be called once build modules + //have been loaded. + var runBuild = function (build, logger) { + //Make sure config has a log level, and if not, + //make it "silent" by default. + config.logLevel = config.hasOwnProperty('logLevel') ? + config.logLevel : logger.SILENT; + + var result = build(config); + + //Reset build internals on each run. + requirejs._buildReset(); + + if (callback) { + callback(result); + } + }; + + //Enable execution of this callback in a build setting. + //Normally, once requirePatch is run, by default it will + //not execute callbacks, unless this property is set on + //the callback. + runBuild.__requireJsBuild = true; + + requirejs({ + context: 'build' + }, ['build', 'logger'], runBuild); + }; + + requirejs.tools = { + useLib: function (contextName, callback) { + if (!callback) { + callback = contextName; + contextName = 'uselib'; + } + + if (!useLibLoaded[contextName]) { + loadLib(); + useLibLoaded[contextName] = true; + } + + var req = requirejs({ + context: contextName, + requireLoad: requirejsVars.nodeLoad, + requireExecCb: requirejsVars.nodeRequireExecCb + }); + + req(['build'], function () { + callback(req); + }); + } + }; + + requirejs.define = define; + + module.exports = requirejs; + return; + } + + if (commandOption === 'o') { + //Do the optimizer work. + loadLib(); + + /** + * @license Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ + +/* + * Create a build.js file that has the build options you want and pass that + * build file to this file to do the build. See example.build.js for more information. + */ + +/*jslint strict: false, nomen: false */ +/*global require: false */ + +require({ + baseUrl: require.s.contexts._.config.baseUrl, + //Use a separate context than the default context so that the + //build can use the default context. + context: 'build', + catchError: { + define: true + } +}, ['env!env/args', 'build'], +function (args, build) { + build(args); +}); + + + } else if (commandOption === 'v') { + console.log('r.js: ' + version + ', RequireJS: ' + this.requirejsVars.require.version); + } else if (commandOption === 'convert') { + loadLib(); + + this.requirejsVars.require(['env!env/args', 'commonJs', 'env!env/print'], + function (args, commonJs, print) { + + var srcDir, outDir; + srcDir = args[0]; + outDir = args[1]; + + if (!srcDir || !outDir) { + print('Usage: path/to/commonjs/modules output/dir'); + return; + } + + commonJs.convertDir(args[0], args[1]); + }); + } else { + //Just run an app + + //Load the bundled libraries for use in the app. + if (commandOption === 'lib') { + loadLib(); + } + + setBaseUrl(fileName); + + if (exists(fileName)) { + exec(readFile(fileName), fileName); + } else { + showHelp(); + } + } + +}((typeof console !== 'undefined' ? console : undefined), + (typeof Packages !== 'undefined' ? Array.prototype.slice.call(arguments, 0) : []), + (typeof readFile !== 'undefined' ? readFile : undefined))); diff --git a/libs/js/jquery-mobile-1.1.0/external/requirejs/depend.js b/libs/js/jquery-mobile-1.1.0/external/requirejs/depend.js new file mode 100644 index 0000000..8de7760 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/external/requirejs/depend.js @@ -0,0 +1,27 @@ +/** @license + * Plugin to load JS files that have dependencies but aren't wrapped into + * `define` calls. + * Author: Miller Medeiros + * Version: 0.1.0 (2011/12/13) + * Released under the MIT license + */ +define(function () { + + var rParts = /^(.*)\[([^\]]*)\]$/; + + return { + + //example: depend!bar[jquery,lib/foo] + load : function(name, req, onLoad, config){ + var parts = rParts.exec(name); + + req(parts[2].split(','), function(){ + req([parts[1]], function(mod){ + onLoad(mod); + }); + }); + } + + }; + +}); \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/external/requirejs/order.js b/libs/js/jquery-mobile-1.1.0/external/requirejs/order.js new file mode 100644 index 0000000..574286c --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/external/requirejs/order.js @@ -0,0 +1,180 @@ +/** + * @license RequireJS order 1.0.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ +/*jslint nomen: false, plusplus: false, strict: false */ +/*global require: false, define: false, window: false, document: false, + setTimeout: false */ + +//Specify that requirejs optimizer should wrap this code in a closure that +//maps the namespaced requirejs API to non-namespaced local variables. +/*requirejs namespace: true */ + +(function () { + + //Sadly necessary browser inference due to differences in the way + //that browsers load and execute dynamically inserted javascript + //and whether the script/cache method works when ordered execution is + //desired. Currently, Gecko and Opera do not load/fire onload for scripts with + //type="script/cache" but they execute injected scripts in order + //unless the 'async' flag is present. + //However, this is all changing in latest browsers implementing HTML5 + //spec. With compliant browsers .async true by default, and + //if false, then it will execute in order. Favor that test first for forward + //compatibility. + var testScript = typeof document !== "undefined" && + typeof window !== "undefined" && + document.createElement("script"), + + supportsInOrderExecution = testScript && (testScript.async || + ((window.opera && + Object.prototype.toString.call(window.opera) === "[object Opera]") || + //If Firefox 2 does not have to be supported, then + //a better check may be: + //('mozIsLocallyAvailable' in window.navigator) + ("MozAppearance" in document.documentElement.style))), + + //This test is true for IE browsers, which will load scripts but only + //execute them once the script is added to the DOM. + supportsLoadSeparateFromExecute = testScript && + testScript.readyState === 'uninitialized', + + readyRegExp = /^(complete|loaded)$/, + cacheWaiting = [], + cached = {}, + scriptNodes = {}, + scriptWaiting = []; + + //Done with the test script. + testScript = null; + + //Callback used by the type="script/cache" callback that indicates a script + //has finished downloading. + function scriptCacheCallback(evt) { + var node = evt.currentTarget || evt.srcElement, i, + moduleName, resource; + + if (evt.type === "load" || readyRegExp.test(node.readyState)) { + //Pull out the name of the module and the context. + moduleName = node.getAttribute("data-requiremodule"); + + //Mark this cache request as loaded + cached[moduleName] = true; + + //Find out how many ordered modules have loaded + for (i = 0; (resource = cacheWaiting[i]); i++) { + if (cached[resource.name]) { + resource.req([resource.name], resource.onLoad); + } else { + //Something in the ordered list is not loaded, + //so wait. + break; + } + } + + //If just loaded some items, remove them from cacheWaiting. + if (i > 0) { + cacheWaiting.splice(0, i); + } + + //Remove this script tag from the DOM + //Use a setTimeout for cleanup because some older IE versions vomit + //if removing a script node while it is being evaluated. + setTimeout(function () { + node.parentNode.removeChild(node); + }, 15); + } + } + + /** + * Used for the IE case, where fetching is done by creating script element + * but not attaching it to the DOM. This function will be called when that + * happens so it can be determined when the node can be attached to the + * DOM to trigger its execution. + */ + function onFetchOnly(node) { + var i, loadedNode, resourceName; + + //Mark this script as loaded. + node.setAttribute('data-orderloaded', 'loaded'); + + //Cycle through waiting scripts. If the matching node for them + //is loaded, and is in the right order, add it to the DOM + //to execute the script. + for (i = 0; (resourceName = scriptWaiting[i]); i++) { + loadedNode = scriptNodes[resourceName]; + if (loadedNode && + loadedNode.getAttribute('data-orderloaded') === 'loaded') { + delete scriptNodes[resourceName]; + require.addScriptToDom(loadedNode); + } else { + break; + } + } + + //If just loaded some items, remove them from waiting. + if (i > 0) { + scriptWaiting.splice(0, i); + } + } + + define({ + version: '1.0.0', + + load: function (name, req, onLoad, config) { + var url = req.nameToUrl(name, null), + node, context; + + //Make sure the async attribute is not set for any pathway involving + //this script. + require.s.skipAsync[url] = true; + if (supportsInOrderExecution || config.isBuild) { + //Just a normal script tag append, but without async attribute + //on the script. + req([name], onLoad); + } else if (supportsLoadSeparateFromExecute) { + //Just fetch the URL, but do not execute it yet. The + //non-standards IE case. Really not so nice because it is + //assuming and touching requrejs internals. OK though since + //ordered execution should go away after a long while. + context = require.s.contexts._; + + if (!context.urlFetched[url] && !context.loaded[name]) { + //Indicate the script is being fetched. + context.urlFetched[url] = true; + + //Stuff from require.load + require.resourcesReady(false); + context.scriptCount += 1; + + //Fetch the script now, remember it. + node = require.attach(url, context, name, null, null, onFetchOnly); + scriptNodes[name] = node; + scriptWaiting.push(name); + } + + //Do a normal require for it, once it loads, use it as return + //value. + req([name], onLoad); + } else { + //Credit to LABjs author Kyle Simpson for finding that scripts + //with type="script/cache" allow scripts to be downloaded into + //browser cache but not executed. Use that + //so that subsequent addition of a real type="text/javascript" + //tag will cause the scripts to be executed immediately in the + //correct order. + if (req.specified(name)) { + req([name], onLoad); + } else { + cacheWaiting.push({ + name: name, + req: req, + onLoad: onLoad + }); + require.attach(url, null, name, scriptCacheCallback, "script/cache"); + } + } + } + }); +}()); diff --git a/libs/js/jquery-mobile-1.1.0/external/requirejs/require.js b/libs/js/jquery-mobile-1.1.0/external/requirejs/require.js new file mode 100644 index 0000000..4d0d055 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/external/requirejs/require.js @@ -0,0 +1,2053 @@ +/** vim: et:ts=4:sw=4:sts=4 + * @license RequireJS 1.0.6 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ +/*jslint strict: false, plusplus: false, sub: true */ +/*global window, navigator, document, importScripts, jQuery, setTimeout, opera */ + +var requirejs, require, define; +(function () { + //Change this version number for each release. + var version = "1.0.6", + commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg, + cjsRequireRegExp = /require\(\s*["']([^'"\s]+)["']\s*\)/g, + currDirRegExp = /^\.\//, + jsSuffixRegExp = /\.js$/, + ostring = Object.prototype.toString, + ap = Array.prototype, + aps = ap.slice, + apsp = ap.splice, + isBrowser = !!(typeof window !== "undefined" && navigator && document), + isWebWorker = !isBrowser && typeof importScripts !== "undefined", + //PS3 indicates loaded and complete, but need to wait for complete + //specifically. Sequence is "loading", "loaded", execution, + // then "complete". The UA check is unfortunate, but not sure how + //to feature test w/o causing perf issues. + readyRegExp = isBrowser && navigator.platform === 'PLAYSTATION 3' ? + /^complete$/ : /^(complete|loaded)$/, + defContextName = "_", + //Oh the tragedy, detecting opera. See the usage of isOpera for reason. + isOpera = typeof opera !== "undefined" && opera.toString() === "[object Opera]", + empty = {}, + contexts = {}, + globalDefQueue = [], + interactiveScript = null, + checkLoadedDepth = 0, + useInteractive = false, + reservedDependencies = { + require: true, + module: true, + exports: true + }, + req, cfg = {}, currentlyAddingScript, s, head, baseElement, scripts, script, + src, subPath, mainScript, dataMain, globalI, ctx, jQueryCheck, checkLoadedTimeoutId; + + function isFunction(it) { + return ostring.call(it) === "[object Function]"; + } + + function isArray(it) { + return ostring.call(it) === "[object Array]"; + } + + /** + * Simple function to mix in properties from source into target, + * but only if target does not already have a property of the same name. + * This is not robust in IE for transferring methods that match + * Object.prototype names, but the uses of mixin here seem unlikely to + * trigger a problem related to that. + */ + function mixin(target, source, force) { + for (var prop in source) { + if (!(prop in empty) && (!(prop in target) || force)) { + target[prop] = source[prop]; + } + } + return req; + } + + /** + * Constructs an error with a pointer to an URL with more information. + * @param {String} id the error ID that maps to an ID on a web page. + * @param {String} message human readable error. + * @param {Error} [err] the original error, if there is one. + * + * @returns {Error} + */ + function makeError(id, msg, err) { + var e = new Error(msg + '\nhttp://requirejs.org/docs/errors.html#' + id); + if (err) { + e.originalError = err; + } + return e; + } + + /** + * Used to set up package paths from a packagePaths or packages config object. + * @param {Object} pkgs the object to store the new package config + * @param {Array} currentPackages an array of packages to configure + * @param {String} [dir] a prefix dir to use. + */ + function configurePackageDir(pkgs, currentPackages, dir) { + var i, location, pkgObj; + + for (i = 0; (pkgObj = currentPackages[i]); i++) { + pkgObj = typeof pkgObj === "string" ? { name: pkgObj } : pkgObj; + location = pkgObj.location; + + //Add dir to the path, but avoid paths that start with a slash + //or have a colon (indicates a protocol) + if (dir && (!location || (location.indexOf("/") !== 0 && location.indexOf(":") === -1))) { + location = dir + "/" + (location || pkgObj.name); + } + + //Create a brand new object on pkgs, since currentPackages can + //be passed in again, and config.pkgs is the internal transformed + //state for all package configs. + pkgs[pkgObj.name] = { + name: pkgObj.name, + location: location || pkgObj.name, + //Remove leading dot in main, so main paths are normalized, + //and remove any trailing .js, since different package + //envs have different conventions: some use a module name, + //some use a file name. + main: (pkgObj.main || "main") + .replace(currDirRegExp, '') + .replace(jsSuffixRegExp, '') + }; + } + } + + /** + * jQuery 1.4.3-1.5.x use a readyWait/ready() pairing to hold DOM + * ready callbacks, but jQuery 1.6 supports a holdReady() API instead. + * At some point remove the readyWait/ready() support and just stick + * with using holdReady. + */ + function jQueryHoldReady($, shouldHold) { + if ($.holdReady) { + $.holdReady(shouldHold); + } else if (shouldHold) { + $.readyWait += 1; + } else { + $.ready(true); + } + } + + if (typeof define !== "undefined") { + //If a define is already in play via another AMD loader, + //do not overwrite. + return; + } + + if (typeof requirejs !== "undefined") { + if (isFunction(requirejs)) { + //Do not overwrite and existing requirejs instance. + return; + } else { + cfg = requirejs; + requirejs = undefined; + } + } + + //Allow for a require config object + if (typeof require !== "undefined" && !isFunction(require)) { + //assume it is a config object. + cfg = require; + require = undefined; + } + + /** + * Creates a new context for use in require and define calls. + * Handle most of the heavy lifting. Do not want to use an object + * with prototype here to avoid using "this" in require, in case it + * needs to be used in more super secure envs that do not want this. + * Also there should not be that many contexts in the page. Usually just + * one for the default context, but could be extra for multiversion cases + * or if a package needs a special context for a dependency that conflicts + * with the standard context. + */ + function newContext(contextName) { + var context, resume, + config = { + waitSeconds: 7, + baseUrl: "./", + paths: {}, + pkgs: {}, + catchError: {} + }, + defQueue = [], + specified = { + "require": true, + "exports": true, + "module": true + }, + urlMap = {}, + defined = {}, + loaded = {}, + waiting = {}, + waitAry = [], + urlFetched = {}, + managerCounter = 0, + managerCallbacks = {}, + plugins = {}, + //Used to indicate which modules in a build scenario + //need to be full executed. + needFullExec = {}, + fullExec = {}, + resumeDepth = 0; + + /** + * Trims the . and .. from an array of path segments. + * It will keep a leading path segment if a .. will become + * the first path segment, to help with module name lookups, + * which act like paths, but can be remapped. But the end result, + * all paths that use this function should look normalized. + * NOTE: this method MODIFIES the input array. + * @param {Array} ary the array of path segments. + */ + function trimDots(ary) { + var i, part; + for (i = 0; (part = ary[i]); i++) { + if (part === ".") { + ary.splice(i, 1); + i -= 1; + } else if (part === "..") { + if (i === 1 && (ary[2] === '..' || ary[0] === '..')) { + //End of the line. Keep at least one non-dot + //path segment at the front so it can be mapped + //correctly to disk. Otherwise, there is likely + //no path mapping for a path starting with '..'. + //This can still fail, but catches the most reasonable + //uses of .. + break; + } else if (i > 0) { + ary.splice(i - 1, 2); + i -= 2; + } + } + } + } + + /** + * Given a relative module name, like ./something, normalize it to + * a real name that can be mapped to a path. + * @param {String} name the relative name + * @param {String} baseName a real name that the name arg is relative + * to. + * @returns {String} normalized name + */ + function normalize(name, baseName) { + var pkgName, pkgConfig; + + //Adjust any relative paths. + if (name && name.charAt(0) === ".") { + //If have a base name, try to normalize against it, + //otherwise, assume it is a top-level require that will + //be relative to baseUrl in the end. + if (baseName) { + if (config.pkgs[baseName]) { + //If the baseName is a package name, then just treat it as one + //name to concat the name with. + baseName = [baseName]; + } else { + //Convert baseName to array, and lop off the last part, + //so that . matches that "directory" and not name of the baseName's + //module. For instance, baseName of "one/two/three", maps to + //"one/two/three.js", but we want the directory, "one/two" for + //this normalization. + baseName = baseName.split("/"); + baseName = baseName.slice(0, baseName.length - 1); + } + + name = baseName.concat(name.split("/")); + trimDots(name); + + //Some use of packages may use a . path to reference the + //"main" module name, so normalize for that. + pkgConfig = config.pkgs[(pkgName = name[0])]; + name = name.join("/"); + if (pkgConfig && name === pkgName + '/' + pkgConfig.main) { + name = pkgName; + } + } else if (name.indexOf("./") === 0) { + // No baseName, so this is ID is resolved relative + // to baseUrl, pull off the leading dot. + name = name.substring(2); + } + } + return name; + } + + /** + * Creates a module mapping that includes plugin prefix, module + * name, and path. If parentModuleMap is provided it will + * also normalize the name via require.normalize() + * + * @param {String} name the module name + * @param {String} [parentModuleMap] parent module map + * for the module name, used to resolve relative names. + * + * @returns {Object} + */ + function makeModuleMap(name, parentModuleMap) { + var index = name ? name.indexOf("!") : -1, + prefix = null, + parentName = parentModuleMap ? parentModuleMap.name : null, + originalName = name, + normalizedName, url, pluginModule; + + if (index !== -1) { + prefix = name.substring(0, index); + name = name.substring(index + 1, name.length); + } + + if (prefix) { + prefix = normalize(prefix, parentName); + } + + //Account for relative paths if there is a base name. + if (name) { + if (prefix) { + pluginModule = defined[prefix]; + if (pluginModule && pluginModule.normalize) { + //Plugin is loaded, use its normalize method. + normalizedName = pluginModule.normalize(name, function (name) { + return normalize(name, parentName); + }); + } else { + normalizedName = normalize(name, parentName); + } + } else { + //A regular module. + normalizedName = normalize(name, parentName); + + url = urlMap[normalizedName]; + if (!url) { + //Calculate url for the module, if it has a name. + //Use name here since nameToUrl also calls normalize, + //and for relative names that are outside the baseUrl + //this causes havoc. Was thinking of just removing + //parentModuleMap to avoid extra normalization, but + //normalize() still does a dot removal because of + //issue #142, so just pass in name here and redo + //the normalization. Paths outside baseUrl are just + //messy to support. + url = context.nameToUrl(name, null, parentModuleMap); + + //Store the URL mapping for later. + urlMap[normalizedName] = url; + } + } + } + + return { + prefix: prefix, + name: normalizedName, + parentMap: parentModuleMap, + url: url, + originalName: originalName, + fullName: prefix ? prefix + "!" + (normalizedName || '') : normalizedName + }; + } + + /** + * Determine if priority loading is done. If so clear the priorityWait + */ + function isPriorityDone() { + var priorityDone = true, + priorityWait = config.priorityWait, + priorityName, i; + if (priorityWait) { + for (i = 0; (priorityName = priorityWait[i]); i++) { + if (!loaded[priorityName]) { + priorityDone = false; + break; + } + } + if (priorityDone) { + delete config.priorityWait; + } + } + return priorityDone; + } + + function makeContextModuleFunc(func, relModuleMap, enableBuildCallback) { + return function () { + //A version of a require function that passes a moduleName + //value for items that may need to + //look up paths relative to the moduleName + var args = aps.call(arguments, 0), lastArg; + if (enableBuildCallback && + isFunction((lastArg = args[args.length - 1]))) { + lastArg.__requireJsBuild = true; + } + args.push(relModuleMap); + return func.apply(null, args); + }; + } + + /** + * Helper function that creates a require function object to give to + * modules that ask for it as a dependency. It needs to be specific + * per module because of the implication of path mappings that may + * need to be relative to the module name. + */ + function makeRequire(relModuleMap, enableBuildCallback, altRequire) { + var modRequire = makeContextModuleFunc(altRequire || context.require, relModuleMap, enableBuildCallback); + + mixin(modRequire, { + nameToUrl: makeContextModuleFunc(context.nameToUrl, relModuleMap), + toUrl: makeContextModuleFunc(context.toUrl, relModuleMap), + defined: makeContextModuleFunc(context.requireDefined, relModuleMap), + specified: makeContextModuleFunc(context.requireSpecified, relModuleMap), + isBrowser: req.isBrowser + }); + return modRequire; + } + + /* + * Queues a dependency for checking after the loader is out of a + * "paused" state, for example while a script file is being loaded + * in the browser, where it may have many modules defined in it. + */ + function queueDependency(manager) { + context.paused.push(manager); + } + + function execManager(manager) { + var i, ret, err, errFile, errModuleTree, + cb = manager.callback, + map = manager.map, + fullName = map.fullName, + args = manager.deps, + listeners = manager.listeners, + cjsModule; + + //Call the callback to define the module, if necessary. + if (cb && isFunction(cb)) { + if (config.catchError.define) { + try { + ret = req.execCb(fullName, manager.callback, args, defined[fullName]); + } catch (e) { + err = e; + } + } else { + ret = req.execCb(fullName, manager.callback, args, defined[fullName]); + } + + if (fullName) { + //If setting exports via "module" is in play, + //favor that over return value and exports. After that, + //favor a non-undefined return value over exports use. + cjsModule = manager.cjsModule; + if (cjsModule && + cjsModule.exports !== undefined && + //Make sure it is not already the exports value + cjsModule.exports !== defined[fullName]) { + ret = defined[fullName] = manager.cjsModule.exports; + } else if (ret === undefined && manager.usingExports) { + //exports already set the defined value. + ret = defined[fullName]; + } else { + //Use the return value from the function. + defined[fullName] = ret; + //If this module needed full execution in a build + //environment, mark that now. + if (needFullExec[fullName]) { + fullExec[fullName] = true; + } + } + } + } else if (fullName) { + //May just be an object definition for the module. Only + //worry about defining if have a module name. + ret = defined[fullName] = cb; + + //If this module needed full execution in a build + //environment, mark that now. + if (needFullExec[fullName]) { + fullExec[fullName] = true; + } + } + + //Clean up waiting. Do this before error calls, and before + //calling back listeners, so that bookkeeping is correct + //in the event of an error and error is reported in correct order, + //since the listeners will likely have errors if the + //onError function does not throw. + if (waiting[manager.id]) { + delete waiting[manager.id]; + manager.isDone = true; + context.waitCount -= 1; + if (context.waitCount === 0) { + //Clear the wait array used for cycles. + waitAry = []; + } + } + + //Do not need to track manager callback now that it is defined. + delete managerCallbacks[fullName]; + + //Allow instrumentation like the optimizer to know the order + //of modules executed and their dependencies. + if (req.onResourceLoad && !manager.placeholder) { + req.onResourceLoad(context, map, manager.depArray); + } + + if (err) { + errFile = (fullName ? makeModuleMap(fullName).url : '') || + err.fileName || err.sourceURL; + errModuleTree = err.moduleTree; + err = makeError('defineerror', 'Error evaluating ' + + 'module "' + fullName + '" at location "' + + errFile + '":\n' + + err + '\nfileName:' + errFile + + '\nlineNumber: ' + (err.lineNumber || err.line), err); + err.moduleName = fullName; + err.moduleTree = errModuleTree; + return req.onError(err); + } + + //Let listeners know of this manager's value. + for (i = 0; (cb = listeners[i]); i++) { + cb(ret); + } + + return undefined; + } + + /** + * Helper that creates a callack function that is called when a dependency + * is ready, and sets the i-th dependency for the manager as the + * value passed to the callback generated by this function. + */ + function makeArgCallback(manager, i) { + return function (value) { + //Only do the work if it has not been done + //already for a dependency. Cycle breaking + //logic in forceExec could mean this function + //is called more than once for a given dependency. + if (!manager.depDone[i]) { + manager.depDone[i] = true; + manager.deps[i] = value; + manager.depCount -= 1; + if (!manager.depCount) { + //All done, execute! + execManager(manager); + } + } + }; + } + + function callPlugin(pluginName, depManager) { + var map = depManager.map, + fullName = map.fullName, + name = map.name, + plugin = plugins[pluginName] || + (plugins[pluginName] = defined[pluginName]), + load; + + //No need to continue if the manager is already + //in the process of loading. + if (depManager.loading) { + return; + } + depManager.loading = true; + + load = function (ret) { + depManager.callback = function () { + return ret; + }; + execManager(depManager); + + loaded[depManager.id] = true; + + //The loading of this plugin + //might have placed other things + //in the paused queue. In particular, + //a loader plugin that depends on + //a different plugin loaded resource. + resume(); + }; + + //Allow plugins to load other code without having to know the + //context or how to "complete" the load. + load.fromText = function (moduleName, text) { + /*jslint evil: true */ + var hasInteractive = useInteractive; + + //Indicate a the module is in process of loading. + loaded[moduleName] = false; + context.scriptCount += 1; + + //Indicate this is not a "real" module, so do not track it + //for builds, it does not map to a real file. + context.fake[moduleName] = true; + + //Turn off interactive script matching for IE for any define + //calls in the text, then turn it back on at the end. + if (hasInteractive) { + useInteractive = false; + } + + req.exec(text); + + if (hasInteractive) { + useInteractive = true; + } + + //Support anonymous modules. + context.completeLoad(moduleName); + }; + + //No need to continue if the plugin value has already been + //defined by a build. + if (fullName in defined) { + load(defined[fullName]); + } else { + //Use parentName here since the plugin's name is not reliable, + //could be some weird string with no path that actually wants to + //reference the parentName's path. + plugin.load(name, makeRequire(map.parentMap, true, function (deps, cb) { + var moduleDeps = [], + i, dep, depMap; + //Convert deps to full names and hold on to them + //for reference later, when figuring out if they + //are blocked by a circular dependency. + for (i = 0; (dep = deps[i]); i++) { + depMap = makeModuleMap(dep, map.parentMap); + deps[i] = depMap.fullName; + if (!depMap.prefix) { + moduleDeps.push(deps[i]); + } + } + depManager.moduleDeps = (depManager.moduleDeps || []).concat(moduleDeps); + return context.require(deps, cb); + }), load, config); + } + } + + /** + * Adds the manager to the waiting queue. Only fully + * resolved items should be in the waiting queue. + */ + function addWait(manager) { + if (!waiting[manager.id]) { + waiting[manager.id] = manager; + waitAry.push(manager); + context.waitCount += 1; + } + } + + /** + * Function added to every manager object. Created out here + * to avoid new function creation for each manager instance. + */ + function managerAdd(cb) { + this.listeners.push(cb); + } + + function getManager(map, shouldQueue) { + var fullName = map.fullName, + prefix = map.prefix, + plugin = prefix ? plugins[prefix] || + (plugins[prefix] = defined[prefix]) : null, + manager, created, pluginManager, prefixMap; + + if (fullName) { + manager = managerCallbacks[fullName]; + } + + if (!manager) { + created = true; + manager = { + //ID is just the full name, but if it is a plugin resource + //for a plugin that has not been loaded, + //then add an ID counter to it. + id: (prefix && !plugin ? + (managerCounter++) + '__p@:' : '') + + (fullName || '__r@' + (managerCounter++)), + map: map, + depCount: 0, + depDone: [], + depCallbacks: [], + deps: [], + listeners: [], + add: managerAdd + }; + + specified[manager.id] = true; + + //Only track the manager/reuse it if this is a non-plugin + //resource. Also only track plugin resources once + //the plugin has been loaded, and so the fullName is the + //true normalized value. + if (fullName && (!prefix || plugins[prefix])) { + managerCallbacks[fullName] = manager; + } + } + + //If there is a plugin needed, but it is not loaded, + //first load the plugin, then continue on. + if (prefix && !plugin) { + prefixMap = makeModuleMap(prefix); + + //Clear out defined and urlFetched if the plugin was previously + //loaded/defined, but not as full module (as in a build + //situation). However, only do this work if the plugin is in + //defined but does not have a module export value. + if (prefix in defined && !defined[prefix]) { + delete defined[prefix]; + delete urlFetched[prefixMap.url]; + } + + pluginManager = getManager(prefixMap, true); + pluginManager.add(function (plugin) { + //Create a new manager for the normalized + //resource ID and have it call this manager when + //done. + var newMap = makeModuleMap(map.originalName, map.parentMap), + normalizedManager = getManager(newMap, true); + + //Indicate this manager is a placeholder for the real, + //normalized thing. Important for when trying to map + //modules and dependencies, for instance, in a build. + manager.placeholder = true; + + normalizedManager.add(function (resource) { + manager.callback = function () { + return resource; + }; + execManager(manager); + }); + }); + } else if (created && shouldQueue) { + //Indicate the resource is not loaded yet if it is to be + //queued. + loaded[manager.id] = false; + queueDependency(manager); + addWait(manager); + } + + return manager; + } + + function main(inName, depArray, callback, relModuleMap) { + var moduleMap = makeModuleMap(inName, relModuleMap), + name = moduleMap.name, + fullName = moduleMap.fullName, + manager = getManager(moduleMap), + id = manager.id, + deps = manager.deps, + i, depArg, depName, depPrefix, cjsMod; + + if (fullName) { + //If module already defined for context, or already loaded, + //then leave. Also leave if jQuery is registering but it does + //not match the desired version number in the config. + if (fullName in defined || loaded[id] === true || + (fullName === "jquery" && config.jQuery && + config.jQuery !== callback().fn.jquery)) { + return; + } + + //Set specified/loaded here for modules that are also loaded + //as part of a layer, where onScriptLoad is not fired + //for those cases. Do this after the inline define and + //dependency tracing is done. + specified[id] = true; + loaded[id] = true; + + //If module is jQuery set up delaying its dom ready listeners. + if (fullName === "jquery" && callback) { + jQueryCheck(callback()); + } + } + + //Attach real depArray and callback to the manager. Do this + //only if the module has not been defined already, so do this after + //the fullName checks above. IE can call main() more than once + //for a module. + manager.depArray = depArray; + manager.callback = callback; + + //Add the dependencies to the deps field, and register for callbacks + //on the dependencies. + for (i = 0; i < depArray.length; i++) { + depArg = depArray[i]; + //There could be cases like in IE, where a trailing comma will + //introduce a null dependency, so only treat a real dependency + //value as a dependency. + if (depArg) { + //Split the dependency name into plugin and name parts + depArg = makeModuleMap(depArg, (name ? moduleMap : relModuleMap)); + depName = depArg.fullName; + depPrefix = depArg.prefix; + + //Fix the name in depArray to be just the name, since + //that is how it will be called back later. + depArray[i] = depName; + + //Fast path CommonJS standard dependencies. + if (depName === "require") { + deps[i] = makeRequire(moduleMap); + } else if (depName === "exports") { + //CommonJS module spec 1.1 + deps[i] = defined[fullName] = {}; + manager.usingExports = true; + } else if (depName === "module") { + //CommonJS module spec 1.1 + manager.cjsModule = cjsMod = deps[i] = { + id: name, + uri: name ? context.nameToUrl(name, null, relModuleMap) : undefined, + exports: defined[fullName] + }; + } else if (depName in defined && !(depName in waiting) && + (!(fullName in needFullExec) || + (fullName in needFullExec && fullExec[depName]))) { + //Module already defined, and not in a build situation + //where the module is a something that needs full + //execution and this dependency has not been fully + //executed. See r.js's requirePatch.js for more info + //on fullExec. + deps[i] = defined[depName]; + } else { + //Mark this dependency as needing full exec if + //the current module needs full exec. + if (fullName in needFullExec) { + needFullExec[depName] = true; + //Reset state so fully executed code will get + //picked up correctly. + delete defined[depName]; + urlFetched[depArg.url] = false; + } + + //Either a resource that is not loaded yet, or a plugin + //resource for either a plugin that has not + //loaded yet. + manager.depCount += 1; + manager.depCallbacks[i] = makeArgCallback(manager, i); + getManager(depArg, true).add(manager.depCallbacks[i]); + } + } + } + + //Do not bother tracking the manager if it is all done. + if (!manager.depCount) { + //All done, execute! + execManager(manager); + } else { + addWait(manager); + } + } + + /** + * Convenience method to call main for a define call that was put on + * hold in the defQueue. + */ + function callDefMain(args) { + main.apply(null, args); + } + + /** + * jQuery 1.4.3+ supports ways to hold off calling + * calling jQuery ready callbacks until all scripts are loaded. Be sure + * to track it if the capability exists.. Also, since jQuery 1.4.3 does + * not register as a module, need to do some global inference checking. + * Even if it does register as a module, not guaranteed to be the precise + * name of the global. If a jQuery is tracked for this context, then go + * ahead and register it as a module too, if not already in process. + */ + jQueryCheck = function (jqCandidate) { + if (!context.jQuery) { + var $ = jqCandidate || (typeof jQuery !== "undefined" ? jQuery : null); + + if ($) { + //If a specific version of jQuery is wanted, make sure to only + //use this jQuery if it matches. + if (config.jQuery && $.fn.jquery !== config.jQuery) { + return; + } + + if ("holdReady" in $ || "readyWait" in $) { + context.jQuery = $; + + //Manually create a "jquery" module entry if not one already + //or in process. Note this could trigger an attempt at + //a second jQuery registration, but does no harm since + //the first one wins, and it is the same value anyway. + callDefMain(["jquery", [], function () { + return jQuery; + }]); + + //Ask jQuery to hold DOM ready callbacks. + if (context.scriptCount) { + jQueryHoldReady($, true); + context.jQueryIncremented = true; + } + } + } + } + }; + + function findCycle(manager, traced) { + var fullName = manager.map.fullName, + depArray = manager.depArray, + fullyLoaded = true, + i, depName, depManager, result; + + if (manager.isDone || !fullName || !loaded[fullName]) { + return result; + } + + //Found the cycle. + if (traced[fullName]) { + return manager; + } + + traced[fullName] = true; + + //Trace through the dependencies. + if (depArray) { + for (i = 0; i < depArray.length; i++) { + //Some array members may be null, like if a trailing comma + //IE, so do the explicit [i] access and check if it has a value. + depName = depArray[i]; + if (!loaded[depName] && !reservedDependencies[depName]) { + fullyLoaded = false; + break; + } + depManager = waiting[depName]; + if (depManager && !depManager.isDone && loaded[depName]) { + result = findCycle(depManager, traced); + if (result) { + break; + } + } + } + if (!fullyLoaded) { + //Discard the cycle that was found, since it cannot + //be forced yet. Also clear this module from traced. + result = undefined; + delete traced[fullName]; + } + } + + return result; + } + + function forceExec(manager, traced) { + var fullName = manager.map.fullName, + depArray = manager.depArray, + i, depName, depManager, prefix, prefixManager, value; + + + if (manager.isDone || !fullName || !loaded[fullName]) { + return undefined; + } + + if (fullName) { + if (traced[fullName]) { + return defined[fullName]; + } + + traced[fullName] = true; + } + + //Trace through the dependencies. + if (depArray) { + for (i = 0; i < depArray.length; i++) { + //Some array members may be null, like if a trailing comma + //IE, so do the explicit [i] access and check if it has a value. + depName = depArray[i]; + if (depName) { + //First, make sure if it is a plugin resource that the + //plugin is not blocked. + prefix = makeModuleMap(depName).prefix; + if (prefix && (prefixManager = waiting[prefix])) { + forceExec(prefixManager, traced); + } + depManager = waiting[depName]; + if (depManager && !depManager.isDone && loaded[depName]) { + value = forceExec(depManager, traced); + manager.depCallbacks[i](value); + } + } + } + } + + return defined[fullName]; + } + + /** + * Checks if all modules for a context are loaded, and if so, evaluates the + * new ones in right dependency order. + * + * @private + */ + function checkLoaded() { + var waitInterval = config.waitSeconds * 1000, + //It is possible to disable the wait interval by using waitSeconds of 0. + expired = waitInterval && (context.startTime + waitInterval) < new Date().getTime(), + noLoads = "", hasLoadedProp = false, stillLoading = false, + cycleDeps = [], + i, prop, err, manager, cycleManager, moduleDeps; + + //If there are items still in the paused queue processing wait. + //This is particularly important in the sync case where each paused + //item is processed right away but there may be more waiting. + if (context.pausedCount > 0) { + return undefined; + } + + //Determine if priority loading is done. If so clear the priority. If + //not, then do not check + if (config.priorityWait) { + if (isPriorityDone()) { + //Call resume, since it could have + //some waiting dependencies to trace. + resume(); + } else { + return undefined; + } + } + + //See if anything is still in flight. + for (prop in loaded) { + if (!(prop in empty)) { + hasLoadedProp = true; + if (!loaded[prop]) { + if (expired) { + noLoads += prop + " "; + } else { + stillLoading = true; + if (prop.indexOf('!') === -1) { + //No reason to keep looking for unfinished + //loading. If the only stillLoading is a + //plugin resource though, keep going, + //because it may be that a plugin resource + //is waiting on a non-plugin cycle. + cycleDeps = []; + break; + } else { + moduleDeps = managerCallbacks[prop] && managerCallbacks[prop].moduleDeps; + if (moduleDeps) { + cycleDeps.push.apply(cycleDeps, moduleDeps); + } + } + } + } + } + } + + //Check for exit conditions. + if (!hasLoadedProp && !context.waitCount) { + //If the loaded object had no items, then the rest of + //the work below does not need to be done. + return undefined; + } + if (expired && noLoads) { + //If wait time expired, throw error of unloaded modules. + err = makeError("timeout", "Load timeout for modules: " + noLoads); + err.requireType = "timeout"; + err.requireModules = noLoads; + err.contextName = context.contextName; + return req.onError(err); + } + + //If still loading but a plugin is waiting on a regular module cycle + //break the cycle. + if (stillLoading && cycleDeps.length) { + for (i = 0; (manager = waiting[cycleDeps[i]]); i++) { + if ((cycleManager = findCycle(manager, {}))) { + forceExec(cycleManager, {}); + break; + } + } + + } + + //If still waiting on loads, and the waiting load is something + //other than a plugin resource, or there are still outstanding + //scripts, then just try back later. + if (!expired && (stillLoading || context.scriptCount)) { + //Something is still waiting to load. Wait for it, but only + //if a timeout is not already in effect. + if ((isBrowser || isWebWorker) && !checkLoadedTimeoutId) { + checkLoadedTimeoutId = setTimeout(function () { + checkLoadedTimeoutId = 0; + checkLoaded(); + }, 50); + } + return undefined; + } + + //If still have items in the waiting cue, but all modules have + //been loaded, then it means there are some circular dependencies + //that need to be broken. + //However, as a waiting thing is fired, then it can add items to + //the waiting cue, and those items should not be fired yet, so + //make sure to redo the checkLoaded call after breaking a single + //cycle, if nothing else loaded then this logic will pick it up + //again. + if (context.waitCount) { + //Cycle through the waitAry, and call items in sequence. + for (i = 0; (manager = waitAry[i]); i++) { + forceExec(manager, {}); + } + + //If anything got placed in the paused queue, run it down. + if (context.paused.length) { + resume(); + } + + //Only allow this recursion to a certain depth. Only + //triggered by errors in calling a module in which its + //modules waiting on it cannot finish loading, or some circular + //dependencies that then may add more dependencies. + //The value of 5 is a bit arbitrary. Hopefully just one extra + //pass, or two for the case of circular dependencies generating + //more work that gets resolved in the sync node case. + if (checkLoadedDepth < 5) { + checkLoadedDepth += 1; + checkLoaded(); + } + } + + checkLoadedDepth = 0; + + //Check for DOM ready, and nothing is waiting across contexts. + req.checkReadyState(); + + return undefined; + } + + /** + * Resumes tracing of dependencies and then checks if everything is loaded. + */ + resume = function () { + var manager, map, url, i, p, args, fullName; + + //Any defined modules in the global queue, intake them now. + context.takeGlobalQueue(); + + resumeDepth += 1; + + if (context.scriptCount <= 0) { + //Synchronous envs will push the number below zero with the + //decrement above, be sure to set it back to zero for good measure. + //require() calls that also do not end up loading scripts could + //push the number negative too. + context.scriptCount = 0; + } + + //Make sure any remaining defQueue items get properly processed. + while (defQueue.length) { + args = defQueue.shift(); + if (args[0] === null) { + return req.onError(makeError('mismatch', 'Mismatched anonymous define() module: ' + args[args.length - 1])); + } else { + callDefMain(args); + } + } + + //Skip the resume of paused dependencies + //if current context is in priority wait. + if (!config.priorityWait || isPriorityDone()) { + while (context.paused.length) { + p = context.paused; + context.pausedCount += p.length; + //Reset paused list + context.paused = []; + + for (i = 0; (manager = p[i]); i++) { + map = manager.map; + url = map.url; + fullName = map.fullName; + + //If the manager is for a plugin managed resource, + //ask the plugin to load it now. + if (map.prefix) { + callPlugin(map.prefix, manager); + } else { + //Regular dependency. + if (!urlFetched[url] && !loaded[fullName]) { + req.load(context, fullName, url); + + //Mark the URL as fetched, but only if it is + //not an empty: URL, used by the optimizer. + //In that case we need to be sure to call + //load() for each module that is mapped to + //empty: so that dependencies are satisfied + //correctly. + if (url.indexOf('empty:') !== 0) { + urlFetched[url] = true; + } + } + } + } + + //Move the start time for timeout forward. + context.startTime = (new Date()).getTime(); + context.pausedCount -= p.length; + } + } + + //Only check if loaded when resume depth is 1. It is likely that + //it is only greater than 1 in sync environments where a factory + //function also then calls the callback-style require. In those + //cases, the checkLoaded should not occur until the resume + //depth is back at the top level. + if (resumeDepth === 1) { + checkLoaded(); + } + + resumeDepth -= 1; + + return undefined; + }; + + //Define the context object. Many of these fields are on here + //just to make debugging easier. + context = { + contextName: contextName, + config: config, + defQueue: defQueue, + waiting: waiting, + waitCount: 0, + specified: specified, + loaded: loaded, + urlMap: urlMap, + urlFetched: urlFetched, + scriptCount: 0, + defined: defined, + paused: [], + pausedCount: 0, + plugins: plugins, + needFullExec: needFullExec, + fake: {}, + fullExec: fullExec, + managerCallbacks: managerCallbacks, + makeModuleMap: makeModuleMap, + normalize: normalize, + /** + * Set a configuration for the context. + * @param {Object} cfg config object to integrate. + */ + configure: function (cfg) { + var paths, prop, packages, pkgs, packagePaths, requireWait; + + //Make sure the baseUrl ends in a slash. + if (cfg.baseUrl) { + if (cfg.baseUrl.charAt(cfg.baseUrl.length - 1) !== "/") { + cfg.baseUrl += "/"; + } + } + + //Save off the paths and packages since they require special processing, + //they are additive. + paths = config.paths; + packages = config.packages; + pkgs = config.pkgs; + + //Mix in the config values, favoring the new values over + //existing ones in context.config. + mixin(config, cfg, true); + + //Adjust paths if necessary. + if (cfg.paths) { + for (prop in cfg.paths) { + if (!(prop in empty)) { + paths[prop] = cfg.paths[prop]; + } + } + config.paths = paths; + } + + packagePaths = cfg.packagePaths; + if (packagePaths || cfg.packages) { + //Convert packagePaths into a packages config. + if (packagePaths) { + for (prop in packagePaths) { + if (!(prop in empty)) { + configurePackageDir(pkgs, packagePaths[prop], prop); + } + } + } + + //Adjust packages if necessary. + if (cfg.packages) { + configurePackageDir(pkgs, cfg.packages); + } + + //Done with modifications, assing packages back to context config + config.pkgs = pkgs; + } + + //If priority loading is in effect, trigger the loads now + if (cfg.priority) { + //Hold on to requireWait value, and reset it after done + requireWait = context.requireWait; + + //Allow tracing some require calls to allow the fetching + //of the priority config. + context.requireWait = false; + //But first, call resume to register any defined modules that may + //be in a data-main built file before the priority config + //call. + resume(); + + context.require(cfg.priority); + + //Trigger a resume right away, for the case when + //the script with the priority load is done as part + //of a data-main call. In that case the normal resume + //call will not happen because the scriptCount will be + //at 1, since the script for data-main is being processed. + resume(); + + //Restore previous state. + context.requireWait = requireWait; + config.priorityWait = cfg.priority; + } + + //If a deps array or a config callback is specified, then call + //require with those args. This is useful when require is defined as a + //config object before require.js is loaded. + if (cfg.deps || cfg.callback) { + context.require(cfg.deps || [], cfg.callback); + } + }, + + requireDefined: function (moduleName, relModuleMap) { + return makeModuleMap(moduleName, relModuleMap).fullName in defined; + }, + + requireSpecified: function (moduleName, relModuleMap) { + return makeModuleMap(moduleName, relModuleMap).fullName in specified; + }, + + require: function (deps, callback, relModuleMap) { + var moduleName, fullName, moduleMap; + if (typeof deps === "string") { + if (isFunction(callback)) { + //Invalid call + return req.onError(makeError("requireargs", "Invalid require call")); + } + + //Synchronous access to one module. If require.get is + //available (as in the Node adapter), prefer that. + //In this case deps is the moduleName and callback is + //the relModuleMap + if (req.get) { + return req.get(context, deps, callback); + } + + //Just return the module wanted. In this scenario, the + //second arg (if passed) is just the relModuleMap. + moduleName = deps; + relModuleMap = callback; + + //Normalize module name, if it contains . or .. + moduleMap = makeModuleMap(moduleName, relModuleMap); + fullName = moduleMap.fullName; + + if (!(fullName in defined)) { + return req.onError(makeError("notloaded", "Module name '" + + moduleMap.fullName + + "' has not been loaded yet for context: " + + contextName)); + } + return defined[fullName]; + } + + //Call main but only if there are dependencies or + //a callback to call. + if (deps && deps.length || callback) { + main(null, deps, callback, relModuleMap); + } + + //If the require call does not trigger anything new to load, + //then resume the dependency processing. + if (!context.requireWait) { + while (!context.scriptCount && context.paused.length) { + resume(); + } + } + return context.require; + }, + + /** + * Internal method to transfer globalQueue items to this context's + * defQueue. + */ + takeGlobalQueue: function () { + //Push all the globalDefQueue items into the context's defQueue + if (globalDefQueue.length) { + //Array splice in the values since the context code has a + //local var ref to defQueue, so cannot just reassign the one + //on context. + apsp.apply(context.defQueue, + [context.defQueue.length - 1, 0].concat(globalDefQueue)); + globalDefQueue = []; + } + }, + + /** + * Internal method used by environment adapters to complete a load event. + * A load event could be a script load or just a load pass from a synchronous + * load call. + * @param {String} moduleName the name of the module to potentially complete. + */ + completeLoad: function (moduleName) { + var args; + + context.takeGlobalQueue(); + + while (defQueue.length) { + args = defQueue.shift(); + + if (args[0] === null) { + args[0] = moduleName; + break; + } else if (args[0] === moduleName) { + //Found matching define call for this script! + break; + } else { + //Some other named define call, most likely the result + //of a build layer that included many define calls. + callDefMain(args); + args = null; + } + } + if (args) { + callDefMain(args); + } else { + //A script that does not call define(), so just simulate + //the call for it. Special exception for jQuery dynamic load. + callDefMain([moduleName, [], + moduleName === "jquery" && typeof jQuery !== "undefined" ? + function () { + return jQuery; + } : null]); + } + + //Doing this scriptCount decrement branching because sync envs + //need to decrement after resume, otherwise it looks like + //loading is complete after the first dependency is fetched. + //For browsers, it works fine to decrement after, but it means + //the checkLoaded setTimeout 50 ms cost is taken. To avoid + //that cost, decrement beforehand. + if (req.isAsync) { + context.scriptCount -= 1; + } + resume(); + if (!req.isAsync) { + context.scriptCount -= 1; + } + }, + + /** + * Converts a module name + .extension into an URL path. + * *Requires* the use of a module name. It does not support using + * plain URLs like nameToUrl. + */ + toUrl: function (moduleNamePlusExt, relModuleMap) { + var index = moduleNamePlusExt.lastIndexOf("."), + ext = null; + + if (index !== -1) { + ext = moduleNamePlusExt.substring(index, moduleNamePlusExt.length); + moduleNamePlusExt = moduleNamePlusExt.substring(0, index); + } + + return context.nameToUrl(moduleNamePlusExt, ext, relModuleMap); + }, + + /** + * Converts a module name to a file path. Supports cases where + * moduleName may actually be just an URL. + */ + nameToUrl: function (moduleName, ext, relModuleMap) { + var paths, pkgs, pkg, pkgPath, syms, i, parentModule, url, + config = context.config; + + //Normalize module name if have a base relative module name to work from. + moduleName = normalize(moduleName, relModuleMap && relModuleMap.fullName); + + //If a colon is in the URL, it indicates a protocol is used and it is just + //an URL to a file, or if it starts with a slash or ends with .js, it is just a plain file. + //The slash is important for protocol-less URLs as well as full paths. + if (req.jsExtRegExp.test(moduleName)) { + //Just a plain path, not module name lookup, so just return it. + //Add extension if it is included. This is a bit wonky, only non-.js things pass + //an extension, this method probably needs to be reworked. + url = moduleName + (ext ? ext : ""); + } else { + //A module that needs to be converted to a path. + paths = config.paths; + pkgs = config.pkgs; + + syms = moduleName.split("/"); + //For each module name segment, see if there is a path + //registered for it. Start with most specific name + //and work up from it. + for (i = syms.length; i > 0; i--) { + parentModule = syms.slice(0, i).join("/"); + if (paths[parentModule]) { + syms.splice(0, i, paths[parentModule]); + break; + } else if ((pkg = pkgs[parentModule])) { + //If module name is just the package name, then looking + //for the main module. + if (moduleName === pkg.name) { + pkgPath = pkg.location + '/' + pkg.main; + } else { + pkgPath = pkg.location; + } + syms.splice(0, i, pkgPath); + break; + } + } + + //Join the path parts together, then figure out if baseUrl is needed. + url = syms.join("/") + (ext || ".js"); + url = (url.charAt(0) === '/' || url.match(/^\w+:/) ? "" : config.baseUrl) + url; + } + + return config.urlArgs ? url + + ((url.indexOf('?') === -1 ? '?' : '&') + + config.urlArgs) : url; + } + }; + + //Make these visible on the context so can be called at the very + //end of the file to bootstrap + context.jQueryCheck = jQueryCheck; + context.resume = resume; + + return context; + } + + /** + * Main entry point. + * + * If the only argument to require is a string, then the module that + * is represented by that string is fetched for the appropriate context. + * + * If the first argument is an array, then it will be treated as an array + * of dependency string names to fetch. An optional function callback can + * be specified to execute when all of those dependencies are available. + * + * Make a local req variable to help Caja compliance (it assumes things + * on a require that are not standardized), and to give a short + * name for minification/local scope use. + */ + req = requirejs = function (deps, callback) { + + //Find the right context, use default + var contextName = defContextName, + context, config; + + // Determine if have config object in the call. + if (!isArray(deps) && typeof deps !== "string") { + // deps is a config object + config = deps; + if (isArray(callback)) { + // Adjust args if there are dependencies + deps = callback; + callback = arguments[2]; + } else { + deps = []; + } + } + + if (config && config.context) { + contextName = config.context; + } + + context = contexts[contextName] || + (contexts[contextName] = newContext(contextName)); + + if (config) { + context.configure(config); + } + + return context.require(deps, callback); + }; + + /** + * Support require.config() to make it easier to cooperate with other + * AMD loaders on globally agreed names. + */ + req.config = function (config) { + return req(config); + }; + + /** + * Export require as a global, but only if it does not already exist. + */ + if (!require) { + require = req; + } + + /** + * Global require.toUrl(), to match global require, mostly useful + * for debugging/work in the global space. + */ + req.toUrl = function (moduleNamePlusExt) { + return contexts[defContextName].toUrl(moduleNamePlusExt); + }; + + req.version = version; + + //Used to filter out dependencies that are already paths. + req.jsExtRegExp = /^\/|:|\?|\.js$/; + s = req.s = { + contexts: contexts, + //Stores a list of URLs that should not get async script tag treatment. + skipAsync: {} + }; + + req.isAsync = req.isBrowser = isBrowser; + if (isBrowser) { + head = s.head = document.getElementsByTagName("head")[0]; + //If BASE tag is in play, using appendChild is a problem for IE6. + //When that browser dies, this can be removed. Details in this jQuery bug: + //http://dev.jquery.com/ticket/2709 + baseElement = document.getElementsByTagName("base")[0]; + if (baseElement) { + head = s.head = baseElement.parentNode; + } + } + + /** + * Any errors that require explicitly generates will be passed to this + * function. Intercept/override it if you want custom error handling. + * @param {Error} err the error object. + */ + req.onError = function (err) { + throw err; + }; + + /** + * Does the request to load a module for the browser case. + * Make this a separate function to allow other environments + * to override it. + * + * @param {Object} context the require context to find state. + * @param {String} moduleName the name of the module. + * @param {Object} url the URL to the module. + */ + req.load = function (context, moduleName, url) { + req.resourcesReady(false); + + context.scriptCount += 1; + req.attach(url, context, moduleName); + + //If tracking a jQuery, then make sure its ready callbacks + //are put on hold to prevent its ready callbacks from + //triggering too soon. + if (context.jQuery && !context.jQueryIncremented) { + jQueryHoldReady(context.jQuery, true); + context.jQueryIncremented = true; + } + }; + + function getInteractiveScript() { + var scripts, i, script; + if (interactiveScript && interactiveScript.readyState === 'interactive') { + return interactiveScript; + } + + scripts = document.getElementsByTagName('script'); + for (i = scripts.length - 1; i > -1 && (script = scripts[i]); i--) { + if (script.readyState === 'interactive') { + return (interactiveScript = script); + } + } + + return null; + } + + /** + * The function that handles definitions of modules. Differs from + * require() in that a string for the module should be the first argument, + * and the function to execute after dependencies are loaded should + * return a value to define the module corresponding to the first argument's + * name. + */ + define = function (name, deps, callback) { + var node, context; + + //Allow for anonymous functions + if (typeof name !== 'string') { + //Adjust args appropriately + callback = deps; + deps = name; + name = null; + } + + //This module may not have dependencies + if (!isArray(deps)) { + callback = deps; + deps = []; + } + + //If no name, and callback is a function, then figure out if it a + //CommonJS thing with dependencies. + if (!deps.length && isFunction(callback)) { + //Remove comments from the callback string, + //look for require calls, and pull them into the dependencies, + //but only if there are function args. + if (callback.length) { + callback + .toString() + .replace(commentRegExp, "") + .replace(cjsRequireRegExp, function (match, dep) { + deps.push(dep); + }); + + //May be a CommonJS thing even without require calls, but still + //could use exports, and module. Avoid doing exports and module + //work though if it just needs require. + //REQUIRES the function to expect the CommonJS variables in the + //order listed below. + deps = (callback.length === 1 ? ["require"] : ["require", "exports", "module"]).concat(deps); + } + } + + //If in IE 6-8 and hit an anonymous define() call, do the interactive + //work. + if (useInteractive) { + node = currentlyAddingScript || getInteractiveScript(); + if (node) { + if (!name) { + name = node.getAttribute("data-requiremodule"); + } + context = contexts[node.getAttribute("data-requirecontext")]; + } + } + + //Always save off evaluating the def call until the script onload handler. + //This allows multiple modules to be in a file without prematurely + //tracing dependencies, and allows for anonymous module support, + //where the module name is not known until the script onload event + //occurs. If no context, use the global queue, and get it processed + //in the onscript load callback. + (context ? context.defQueue : globalDefQueue).push([name, deps, callback]); + + return undefined; + }; + + define.amd = { + multiversion: true, + plugins: true, + jQuery: true + }; + + /** + * Executes the text. Normally just uses eval, but can be modified + * to use a more environment specific call. + * @param {String} text the text to execute/evaluate. + */ + req.exec = function (text) { + return eval(text); + }; + + /** + * Executes a module callack function. Broken out as a separate function + * solely to allow the build system to sequence the files in the built + * layer in the right sequence. + * + * @private + */ + req.execCb = function (name, callback, args, exports) { + return callback.apply(exports, args); + }; + + + /** + * Adds a node to the DOM. Public function since used by the order plugin. + * This method should not normally be called by outside code. + */ + req.addScriptToDom = function (node) { + //For some cache cases in IE 6-8, the script executes before the end + //of the appendChild execution, so to tie an anonymous define + //call to the module name (which is stored on the node), hold on + //to a reference to this node, but clear after the DOM insertion. + currentlyAddingScript = node; + if (baseElement) { + head.insertBefore(node, baseElement); + } else { + head.appendChild(node); + } + currentlyAddingScript = null; + }; + + /** + * callback for script loads, used to check status of loading. + * + * @param {Event} evt the event from the browser for the script + * that was loaded. + * + * @private + */ + req.onScriptLoad = function (evt) { + //Using currentTarget instead of target for Firefox 2.0's sake. Not + //all old browsers will be supported, but this one was easy enough + //to support and still makes sense. + var node = evt.currentTarget || evt.srcElement, contextName, moduleName, + context; + + if (evt.type === "load" || (node && readyRegExp.test(node.readyState))) { + //Reset interactive script so a script node is not held onto for + //to long. + interactiveScript = null; + + //Pull out the name of the module and the context. + contextName = node.getAttribute("data-requirecontext"); + moduleName = node.getAttribute("data-requiremodule"); + context = contexts[contextName]; + + contexts[contextName].completeLoad(moduleName); + + //Clean up script binding. Favor detachEvent because of IE9 + //issue, see attachEvent/addEventListener comment elsewhere + //in this file. + if (node.detachEvent && !isOpera) { + //Probably IE. If not it will throw an error, which will be + //useful to know. + node.detachEvent("onreadystatechange", req.onScriptLoad); + } else { + node.removeEventListener("load", req.onScriptLoad, false); + } + } + }; + + /** + * Attaches the script represented by the URL to the current + * environment. Right now only supports browser loading, + * but can be redefined in other environments to do the right thing. + * @param {String} url the url of the script to attach. + * @param {Object} context the context that wants the script. + * @param {moduleName} the name of the module that is associated with the script. + * @param {Function} [callback] optional callback, defaults to require.onScriptLoad + * @param {String} [type] optional type, defaults to text/javascript + * @param {Function} [fetchOnlyFunction] optional function to indicate the script node + * should be set up to fetch the script but do not attach it to the DOM + * so that it can later be attached to execute it. This is a way for the + * order plugin to support ordered loading in IE. Once the script is fetched, + * but not executed, the fetchOnlyFunction will be called. + */ + req.attach = function (url, context, moduleName, callback, type, fetchOnlyFunction) { + var node; + if (isBrowser) { + //In the browser so use a script tag + callback = callback || req.onScriptLoad; + node = context && context.config && context.config.xhtml ? + document.createElementNS("http://www.w3.org/1999/xhtml", "html:script") : + document.createElement("script"); + node.type = type || (context && context.config.scriptType) || + "text/javascript"; + node.charset = "utf-8"; + //Use async so Gecko does not block on executing the script if something + //like a long-polling comet tag is being run first. Gecko likes + //to evaluate scripts in DOM order, even for dynamic scripts. + //It will fetch them async, but only evaluate the contents in DOM + //order, so a long-polling script tag can delay execution of scripts + //after it. But telling Gecko we expect async gets us the behavior + //we want -- execute it whenever it is finished downloading. Only + //Helps Firefox 3.6+ + //Allow some URLs to not be fetched async. Mostly helps the order! + //plugin + node.async = !s.skipAsync[url]; + + if (context) { + node.setAttribute("data-requirecontext", context.contextName); + } + node.setAttribute("data-requiremodule", moduleName); + + //Set up load listener. Test attachEvent first because IE9 has + //a subtle issue in its addEventListener and script onload firings + //that do not match the behavior of all other browsers with + //addEventListener support, which fire the onload event for a + //script right after the script execution. See: + //https://connect.microsoft.com/IE/feedback/details/648057/script-onload-event-is-not-fired-immediately-after-script-execution + //UNFORTUNATELY Opera implements attachEvent but does not follow the script + //script execution mode. + if (node.attachEvent && !isOpera) { + //Probably IE. IE (at least 6-8) do not fire + //script onload right after executing the script, so + //we cannot tie the anonymous define call to a name. + //However, IE reports the script as being in "interactive" + //readyState at the time of the define call. + useInteractive = true; + + + if (fetchOnlyFunction) { + //Need to use old school onreadystate here since + //when the event fires and the node is not attached + //to the DOM, the evt.srcElement is null, so use + //a closure to remember the node. + node.onreadystatechange = function (evt) { + //Script loaded but not executed. + //Clear loaded handler, set the real one that + //waits for script execution. + if (node.readyState === 'loaded') { + node.onreadystatechange = null; + node.attachEvent("onreadystatechange", callback); + fetchOnlyFunction(node); + } + }; + } else { + node.attachEvent("onreadystatechange", callback); + } + } else { + node.addEventListener("load", callback, false); + } + node.src = url; + + //Fetch only means waiting to attach to DOM after loaded. + if (!fetchOnlyFunction) { + req.addScriptToDom(node); + } + + return node; + } else if (isWebWorker) { + //In a web worker, use importScripts. This is not a very + //efficient use of importScripts, importScripts will block until + //its script is downloaded and evaluated. However, if web workers + //are in play, the expectation that a build has been done so that + //only one script needs to be loaded anyway. This may need to be + //reevaluated if other use cases become common. + importScripts(url); + + //Account for anonymous modules + context.completeLoad(moduleName); + } + return null; + }; + + //Look for a data-main script attribute, which could also adjust the baseUrl. + if (isBrowser) { + //Figure out baseUrl. Get it from the script tag with require.js in it. + scripts = document.getElementsByTagName("script"); + + for (globalI = scripts.length - 1; globalI > -1 && (script = scripts[globalI]); globalI--) { + //Set the "head" where we can append children by + //using the script's parent. + if (!head) { + head = script.parentNode; + } + + //Look for a data-main attribute to set main script for the page + //to load. If it is there, the path to data main becomes the + //baseUrl, if it is not already set. + if ((dataMain = script.getAttribute('data-main'))) { + if (!cfg.baseUrl) { + //Pull off the directory of data-main for use as the + //baseUrl. + src = dataMain.split('/'); + mainScript = src.pop(); + subPath = src.length ? src.join('/') + '/' : './'; + + //Set final config. + cfg.baseUrl = subPath; + //Strip off any trailing .js since dataMain is now + //like a module name. + dataMain = mainScript.replace(jsSuffixRegExp, ''); + } + + //Put the data-main script in the files to load. + cfg.deps = cfg.deps ? cfg.deps.concat(dataMain) : [dataMain]; + + break; + } + } + } + + //See if there is nothing waiting across contexts, and if not, trigger + //resourcesReady. + req.checkReadyState = function () { + var contexts = s.contexts, prop; + for (prop in contexts) { + if (!(prop in empty)) { + if (contexts[prop].waitCount) { + return; + } + } + } + req.resourcesReady(true); + }; + + /** + * Internal function that is triggered whenever all scripts/resources + * have been loaded by the loader. Can be overridden by other, for + * instance the domReady plugin, which wants to know when all resources + * are loaded. + */ + req.resourcesReady = function (isReady) { + var contexts, context, prop; + + //First, set the public variable indicating that resources are loading. + req.resourcesDone = isReady; + + if (req.resourcesDone) { + //If jQuery with DOM ready delayed, release it now. + contexts = s.contexts; + for (prop in contexts) { + if (!(prop in empty)) { + context = contexts[prop]; + if (context.jQueryIncremented) { + jQueryHoldReady(context.jQuery, false); + context.jQueryIncremented = false; + } + } + } + } + }; + + //FF < 3.6 readyState fix. Needed so that domReady plugin + //works well in that environment, since require.js is normally + //loaded via an HTML script tag so it will be there before window load, + //where the domReady plugin is more likely to be loaded after window load. + req.pageLoaded = function () { + if (document.readyState !== "complete") { + document.readyState = "complete"; + } + }; + if (isBrowser) { + if (document.addEventListener) { + if (!document.readyState) { + document.readyState = "loading"; + window.addEventListener("load", req.pageLoaded, false); + } + } + } + + //Set up default context. If require was a configuration object, use that as base config. + req(cfg); + + //If modules are built into require.js, then need to make sure dependencies are + //traced. Use a setTimeout in the browser world, to allow all the modules to register + //themselves. In a non-browser env, assume that modules are not built into require.js, + //which seems odd to do on the server. + if (req.isAsync && typeof setTimeout !== "undefined") { + ctx = s.contexts[(cfg.context || defContextName)]; + //Indicate that the script that includes require() is still loading, + //so that require()'d dependencies are not traced until the end of the + //file is parsed (approximated via the setTimeout call). + ctx.requireWait = true; + setTimeout(function () { + ctx.requireWait = false; + + if (!ctx.scriptCount) { + ctx.resume(); + } + req.checkReadyState(); + }, 0); + } +}()); diff --git a/libs/js/jquery-mobile-1.1.0/external/requirejs/text.js b/libs/js/jquery-mobile-1.1.0/external/requirejs/text.js new file mode 100644 index 0000000..6ef7422 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/external/requirejs/text.js @@ -0,0 +1,283 @@ +/** + * @license RequireJS text 1.0.2 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ +/*jslint regexp: false, nomen: false, plusplus: false, strict: false */ +/*global require: false, XMLHttpRequest: false, ActiveXObject: false, + define: false, window: false, process: false, Packages: false, + java: false, location: false */ + +(function () { + var progIds = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.4.0'], + xmlRegExp = /^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im, + bodyRegExp = /]*>\s*([\s\S]+)\s*<\/body>/im, + hasLocation = typeof location !== 'undefined' && location.href, + defaultProtocol = hasLocation && location.protocol && location.protocol.replace(/\:/, ''), + defaultHostName = hasLocation && location.hostname, + defaultPort = hasLocation && (location.port || undefined), + buildMap = []; + + define(function () { + var text, get, fs; + + if (typeof window !== "undefined" && window.navigator && window.document) { + get = function (url, callback) { + var xhr = text.createXhr(); + xhr.open('GET', url, true); + xhr.onreadystatechange = function (evt) { + //Do not explicitly handle errors, those should be + //visible via console output in the browser. + if (xhr.readyState === 4) { + callback(xhr.responseText); + } + }; + xhr.send(null); + }; + } else if (typeof process !== "undefined" && + process.versions && + !!process.versions.node) { + //Using special require.nodeRequire, something added by r.js. + fs = require.nodeRequire('fs'); + + get = function (url, callback) { + callback(fs.readFileSync(url, 'utf8')); + }; + } else if (typeof Packages !== 'undefined') { + //Why Java, why is this so awkward? + get = function (url, callback) { + var encoding = "utf-8", + file = new java.io.File(url), + lineSeparator = java.lang.System.getProperty("line.separator"), + input = new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(file), encoding)), + stringBuffer, line, + content = ''; + try { + stringBuffer = new java.lang.StringBuffer(); + line = input.readLine(); + + // Byte Order Mark (BOM) - The Unicode Standard, version 3.0, page 324 + // http://www.unicode.org/faq/utf_bom.html + + // Note that when we use utf-8, the BOM should appear as "EF BB BF", but it doesn't due to this bug in the JDK: + // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4508058 + if (line && line.length() && line.charAt(0) === 0xfeff) { + // Eat the BOM, since we've already found the encoding on this file, + // and we plan to concatenating this buffer with others; the BOM should + // only appear at the top of a file. + line = line.substring(1); + } + + stringBuffer.append(line); + + while ((line = input.readLine()) !== null) { + stringBuffer.append(lineSeparator); + stringBuffer.append(line); + } + //Make sure we return a JavaScript string and not a Java string. + content = String(stringBuffer.toString()); //String + } finally { + input.close(); + } + callback(content); + }; + } + + text = { + version: '1.0.2', + + strip: function (content) { + //Strips declarations so that external SVG and XML + //documents can be added to a document without worry. Also, if the string + //is an HTML document, only the part inside the body tag is returned. + if (content) { + content = content.replace(xmlRegExp, ""); + var matches = content.match(bodyRegExp); + if (matches) { + content = matches[1]; + } + } else { + content = ""; + } + return content; + }, + + jsEscape: function (content) { + return content.replace(/(['\\])/g, '\\$1') + .replace(/[\f]/g, "\\f") + .replace(/[\b]/g, "\\b") + .replace(/[\n]/g, "\\n") + .replace(/[\t]/g, "\\t") + .replace(/[\r]/g, "\\r"); + }, + + createXhr: function () { + //Would love to dump the ActiveX crap in here. Need IE 6 to die first. + var xhr, i, progId; + if (typeof XMLHttpRequest !== "undefined") { + return new XMLHttpRequest(); + } else { + for (i = 0; i < 3; i++) { + progId = progIds[i]; + try { + xhr = new ActiveXObject(progId); + } catch (e) {} + + if (xhr) { + progIds = [progId]; // so faster next time + break; + } + } + } + + if (!xhr) { + throw new Error("createXhr(): XMLHttpRequest not available"); + } + + return xhr; + }, + + get: get, + + /** + * Parses a resource name into its component parts. Resource names + * look like: module/name.ext!strip, where the !strip part is + * optional. + * @param {String} name the resource name + * @returns {Object} with properties "moduleName", "ext" and "strip" + * where strip is a boolean. + */ + parseName: function (name) { + var strip = false, index = name.indexOf("."), + modName = name.substring(0, index), + ext = name.substring(index + 1, name.length); + + index = ext.indexOf("!"); + if (index !== -1) { + //Pull off the strip arg. + strip = ext.substring(index + 1, ext.length); + strip = strip === "strip"; + ext = ext.substring(0, index); + } + + return { + moduleName: modName, + ext: ext, + strip: strip + }; + }, + + xdRegExp: /^((\w+)\:)?\/\/([^\/\\]+)/, + + /** + * Is an URL on another domain. Only works for browser use, returns + * false in non-browser environments. Only used to know if an + * optimized .js version of a text resource should be loaded + * instead. + * @param {String} url + * @returns Boolean + */ + useXhr: function (url, protocol, hostname, port) { + var match = text.xdRegExp.exec(url), + uProtocol, uHostName, uPort; + if (!match) { + return true; + } + uProtocol = match[2]; + uHostName = match[3]; + + uHostName = uHostName.split(':'); + uPort = uHostName[1]; + uHostName = uHostName[0]; + + return (!uProtocol || uProtocol === protocol) && + (!uHostName || uHostName === hostname) && + ((!uPort && !uHostName) || uPort === port); + }, + + finishLoad: function (name, strip, content, onLoad, config) { + content = strip ? text.strip(content) : content; + if (config.isBuild) { + buildMap[name] = content; + } + onLoad(content); + }, + + load: function (name, req, onLoad, config) { + //Name has format: some.module.filext!strip + //The strip part is optional. + //if strip is present, then that means only get the string contents + //inside a body tag in an HTML string. For XML/SVG content it means + //removing the declarations so the content can be inserted + //into the current doc without problems. + + // Do not bother with the work if a build and text will + // not be inlined. + if (config.isBuild && !config.inlineText) { + onLoad(); + return; + } + + var parsed = text.parseName(name), + nonStripName = parsed.moduleName + '.' + parsed.ext, + url = req.toUrl(nonStripName), + useXhr = (config && config.text && config.text.useXhr) || + text.useXhr; + + //Load the text. Use XHR if possible and in a browser. + if (!hasLocation || useXhr(url, defaultProtocol, defaultHostName, defaultPort)) { + text.get(url, function (content) { + text.finishLoad(name, parsed.strip, content, onLoad, config); + }); + } else { + //Need to fetch the resource across domains. Assume + //the resource has been optimized into a JS module. Fetch + //by the module name + extension, but do not include the + //!strip part to avoid file system issues. + req([nonStripName], function (content) { + text.finishLoad(parsed.moduleName + '.' + parsed.ext, + parsed.strip, content, onLoad, config); + }); + } + }, + + write: function (pluginName, moduleName, write, config) { + if (moduleName in buildMap) { + var content = text.jsEscape(buildMap[moduleName]); + write.asModule(pluginName + "!" + moduleName, + "define(function () { return '" + + content + + "';});\n"); + } + }, + + writeFile: function (pluginName, moduleName, req, write, config) { + var parsed = text.parseName(moduleName), + nonStripName = parsed.moduleName + '.' + parsed.ext, + //Use a '.js' file name so that it indicates it is a + //script that can be loaded across domains. + fileName = req.toUrl(parsed.moduleName + '.' + + parsed.ext) + '.js'; + + //Leverage own load() method to load plugin value, but only + //write out values that do not have the strip argument, + //to avoid any potential issues with ! in file names. + text.load(nonStripName, req, function (value) { + //Use own write() method to construct full module value. + //But need to create shell that translates writeFile's + //write() to the right interface. + var textWrite = function (contents) { + return write(fileName, contents); + }; + textWrite.asModule = function (moduleName, contents) { + return write.asModule(moduleName, fileName, contents); + }; + + text.write(pluginName, nonStripName, textWrite, config); + }, config); + } + }; + + return text; + }); +}()); diff --git a/libs/js/jquery-mobile-1.1.0/index.html b/libs/js/jquery-mobile-1.1.0/index.html new file mode 100644 index 0000000..8eb9690 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/index.html @@ -0,0 +1,76 @@ + + + + + + jQuery Mobile: Demos and Documentation + + + + + + + + +
      +
      +

      1.1.0 Final Release

      + + +
      + +
      +

      jQuery Mobile Framework

      +

      A Touch-Optimized UI Framework built with jQuery and HTML5.

      +
      + + +

      Welcome. jQuery Mobile is the easiest way to build sites and apps that are accessible on all popular smartphone, tablet and desktop devices. For jQuery 1.6.4 and 1.7.1.

      + + + +
      + + + + + +
      + + + +
      + + diff --git a/libs/js/jquery-mobile-1.1.0/js/index.php b/libs/js/jquery-mobile-1.1.0/js/index.php new file mode 100644 index 0000000..5cb07fc --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/js/index.php @@ -0,0 +1,54 @@ + to avoid XSS via location.hash (#9521) + quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/, + + // Check if a string has a non-whitespace character in it + rnotwhite = /\S/, + + // Used for trimming whitespace + trimLeft = /^\s+/, + trimRight = /\s+$/, + + // Check for digits + rdigit = /\d/, + + // Match a standalone tag + rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/, + + // JSON RegExp + rvalidchars = /^[\],:{}\s]*$/, + rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, + rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, + rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, + + // Useragent RegExp + rwebkit = /(webkit)[ \/]([\w.]+)/, + ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/, + rmsie = /(msie) ([\w.]+)/, + rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/, + + // Matches dashed string for camelizing + rdashAlpha = /-([a-z]|[0-9])/ig, + rmsPrefix = /^-ms-/, + + // Used by jQuery.camelCase as callback to replace() + fcamelCase = function( all, letter ) { + return ( letter + "" ).toUpperCase(); + }, + + // Keep a UserAgent string for use with jQuery.browser + userAgent = navigator.userAgent, + + // For matching the engine and version of the browser + browserMatch, + + // The deferred used on DOM ready + readyList, + + // The ready event handler + DOMContentLoaded, + + // Save a reference to some core methods + toString = Object.prototype.toString, + hasOwn = Object.prototype.hasOwnProperty, + push = Array.prototype.push, + slice = Array.prototype.slice, + trim = String.prototype.trim, + indexOf = Array.prototype.indexOf, + + // [[Class]] -> type pairs + class2type = {}; + +jQuery.fn = jQuery.prototype = { + constructor: jQuery, + init: function( selector, context, rootjQuery ) { + var match, elem, ret, doc; + + // Handle $(""), $(null), or $(undefined) + if ( !selector ) { + return this; + } + + // Handle $(DOMElement) + if ( selector.nodeType ) { + this.context = this[0] = selector; + this.length = 1; + return this; + } + + // The body element only exists once, optimize finding it + if ( selector === "body" && !context && document.body ) { + this.context = document; + this[0] = document.body; + this.selector = selector; + this.length = 1; + return this; + } + + // Handle HTML strings + if ( typeof selector === "string" ) { + // Are we dealing with HTML string or an ID? + if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { + // Assume that strings that start and end with <> are HTML and skip the regex check + match = [ null, selector, null ]; + + } else { + match = quickExpr.exec( selector ); + } + + // Verify a match, and that no context was specified for #id + if ( match && (match[1] || !context) ) { + + // HANDLE: $(html) -> $(array) + if ( match[1] ) { + context = context instanceof jQuery ? context[0] : context; + doc = (context ? context.ownerDocument || context : document); + + // If a single string is passed in and it's a single tag + // just do a createElement and skip the rest + ret = rsingleTag.exec( selector ); + + if ( ret ) { + if ( jQuery.isPlainObject( context ) ) { + selector = [ document.createElement( ret[1] ) ]; + jQuery.fn.attr.call( selector, context, true ); + + } else { + selector = [ doc.createElement( ret[1] ) ]; + } + + } else { + ret = jQuery.buildFragment( [ match[1] ], [ doc ] ); + selector = (ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment).childNodes; + } + + return jQuery.merge( this, selector ); + + // HANDLE: $("#id") + } else { + elem = document.getElementById( match[2] ); + + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + if ( elem && elem.parentNode ) { + // Handle the case where IE and Opera return items + // by name instead of ID + if ( elem.id !== match[2] ) { + return rootjQuery.find( selector ); + } + + // Otherwise, we inject the element directly into the jQuery object + this.length = 1; + this[0] = elem; + } + + this.context = document; + this.selector = selector; + return this; + } + + // HANDLE: $(expr, $(...)) + } else if ( !context || context.jquery ) { + return (context || rootjQuery).find( selector ); + + // HANDLE: $(expr, context) + // (which is just equivalent to: $(context).find(expr) + } else { + return this.constructor( context ).find( selector ); + } + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( jQuery.isFunction( selector ) ) { + return rootjQuery.ready( selector ); + } + + if (selector.selector !== undefined) { + this.selector = selector.selector; + this.context = selector.context; + } + + return jQuery.makeArray( selector, this ); + }, + + // Start with an empty selector + selector: "", + + // The current version of jQuery being used + jquery: "1.6.4", + + // The default length of a jQuery object is 0 + length: 0, + + // The number of elements contained in the matched element set + size: function() { + return this.length; + }, + + toArray: function() { + return slice.call( this, 0 ); + }, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function( num ) { + return num == null ? + + // Return a 'clean' array + this.toArray() : + + // Return just the object + ( num < 0 ? this[ this.length + num ] : this[ num ] ); + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function( elems, name, selector ) { + // Build a new jQuery matched element set + var ret = this.constructor(); + + if ( jQuery.isArray( elems ) ) { + push.apply( ret, elems ); + + } else { + jQuery.merge( ret, elems ); + } + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + + ret.context = this.context; + + if ( name === "find" ) { + ret.selector = this.selector + (this.selector ? " " : "") + selector; + } else if ( name ) { + ret.selector = this.selector + "." + name + "(" + selector + ")"; + } + + // Return the newly-formed element set + return ret; + }, + + // Execute a callback for every element in the matched set. + // (You can seed the arguments with an array of args, but this is + // only used internally.) + each: function( callback, args ) { + return jQuery.each( this, callback, args ); + }, + + ready: function( fn ) { + // Attach the listeners + jQuery.bindReady(); + + // Add the callback + readyList.done( fn ); + + return this; + }, + + eq: function( i ) { + return i === -1 ? + this.slice( i ) : + this.slice( i, +i + 1 ); + }, + + first: function() { + return this.eq( 0 ); + }, + + last: function() { + return this.eq( -1 ); + }, + + slice: function() { + return this.pushStack( slice.apply( this, arguments ), + "slice", slice.call(arguments).join(",") ); + }, + + map: function( callback ) { + return this.pushStack( jQuery.map(this, function( elem, i ) { + return callback.call( elem, i, elem ); + })); + }, + + end: function() { + return this.prevObject || this.constructor(null); + }, + + // For internal use only. + // Behaves like an Array's method, not like a jQuery method. + push: push, + sort: [].sort, + splice: [].splice +}; + +// Give the init function the jQuery prototype for later instantiation +jQuery.fn.init.prototype = jQuery.fn; + +jQuery.extend = jQuery.fn.extend = function() { + var options, name, src, copy, copyIsArray, clone, + target = arguments[0] || {}, + i = 1, + length = arguments.length, + deep = false; + + // Handle a deep copy situation + if ( typeof target === "boolean" ) { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target !== "object" && !jQuery.isFunction(target) ) { + target = {}; + } + + // extend jQuery itself if only one argument is passed + if ( length === i ) { + target = this; + --i; + } + + for ( ; i < length; i++ ) { + // Only deal with non-null/undefined values + if ( (options = arguments[ i ]) != null ) { + // Extend the base object + for ( name in options ) { + src = target[ name ]; + copy = options[ name ]; + + // Prevent never-ending loop + if ( target === copy ) { + continue; + } + + // Recurse if we're merging plain objects or arrays + if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { + if ( copyIsArray ) { + copyIsArray = false; + clone = src && jQuery.isArray(src) ? src : []; + + } else { + clone = src && jQuery.isPlainObject(src) ? src : {}; + } + + // Never move original objects, clone them + target[ name ] = jQuery.extend( deep, clone, copy ); + + // Don't bring in undefined values + } else if ( copy !== undefined ) { + target[ name ] = copy; + } + } + } + } + + // Return the modified object + return target; +}; + +jQuery.extend({ + noConflict: function( deep ) { + if ( window.$ === jQuery ) { + window.$ = _$; + } + + if ( deep && window.jQuery === jQuery ) { + window.jQuery = _jQuery; + } + + return jQuery; + }, + + // Is the DOM ready to be used? Set to true once it occurs. + isReady: false, + + // A counter to track how many items to wait for before + // the ready event fires. See #6781 + readyWait: 1, + + // Hold (or release) the ready event + holdReady: function( hold ) { + if ( hold ) { + jQuery.readyWait++; + } else { + jQuery.ready( true ); + } + }, + + // Handle when the DOM is ready + ready: function( wait ) { + // Either a released hold or an DOMready/load event and not yet ready + if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) { + // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). + if ( !document.body ) { + return setTimeout( jQuery.ready, 1 ); + } + + // Remember that the DOM is ready + jQuery.isReady = true; + + // If a normal DOM Ready event fired, decrement, and wait if need be + if ( wait !== true && --jQuery.readyWait > 0 ) { + return; + } + + // If there are functions bound, to execute + readyList.resolveWith( document, [ jQuery ] ); + + // Trigger any bound ready events + if ( jQuery.fn.trigger ) { + jQuery( document ).trigger( "ready" ).unbind( "ready" ); + } + } + }, + + bindReady: function() { + if ( readyList ) { + return; + } + + readyList = jQuery._Deferred(); + + // Catch cases where $(document).ready() is called after the + // browser event has already occurred. + if ( document.readyState === "complete" ) { + // Handle it asynchronously to allow scripts the opportunity to delay ready + return setTimeout( jQuery.ready, 1 ); + } + + // Mozilla, Opera and webkit nightlies currently support this event + if ( document.addEventListener ) { + // Use the handy event callback + document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); + + // A fallback to window.onload, that will always work + window.addEventListener( "load", jQuery.ready, false ); + + // If IE event model is used + } else if ( document.attachEvent ) { + // ensure firing before onload, + // maybe late but safe also for iframes + document.attachEvent( "onreadystatechange", DOMContentLoaded ); + + // A fallback to window.onload, that will always work + window.attachEvent( "onload", jQuery.ready ); + + // If IE and not a frame + // continually check to see if the document is ready + var toplevel = false; + + try { + toplevel = window.frameElement == null; + } catch(e) {} + + if ( document.documentElement.doScroll && toplevel ) { + doScrollCheck(); + } + } + }, + + // See test/unit/core.js for details concerning isFunction. + // Since version 1.3, DOM methods and functions like alert + // aren't supported. They return false on IE (#2968). + isFunction: function( obj ) { + return jQuery.type(obj) === "function"; + }, + + isArray: Array.isArray || function( obj ) { + return jQuery.type(obj) === "array"; + }, + + // A crude way of determining if an object is a window + isWindow: function( obj ) { + return obj && typeof obj === "object" && "setInterval" in obj; + }, + + isNaN: function( obj ) { + return obj == null || !rdigit.test( obj ) || isNaN( obj ); + }, + + type: function( obj ) { + return obj == null ? + String( obj ) : + class2type[ toString.call(obj) ] || "object"; + }, + + isPlainObject: function( obj ) { + // Must be an Object. + // Because of IE, we also have to check the presence of the constructor property. + // Make sure that DOM nodes and window objects don't pass through, as well + if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { + return false; + } + + try { + // Not own constructor property must be Object + if ( obj.constructor && + !hasOwn.call(obj, "constructor") && + !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { + return false; + } + } catch ( e ) { + // IE8,9 Will throw exceptions on certain host objects #9897 + return false; + } + + // Own properties are enumerated firstly, so to speed up, + // if last one is own, then all properties are own. + + var key; + for ( key in obj ) {} + + return key === undefined || hasOwn.call( obj, key ); + }, + + isEmptyObject: function( obj ) { + for ( var name in obj ) { + return false; + } + return true; + }, + + error: function( msg ) { + throw msg; + }, + + parseJSON: function( data ) { + if ( typeof data !== "string" || !data ) { + return null; + } + + // Make sure leading/trailing whitespace is removed (IE can't handle it) + data = jQuery.trim( data ); + + // Attempt to parse using the native JSON parser first + if ( window.JSON && window.JSON.parse ) { + return window.JSON.parse( data ); + } + + // Make sure the incoming data is actual JSON + // Logic borrowed from http://json.org/json2.js + if ( rvalidchars.test( data.replace( rvalidescape, "@" ) + .replace( rvalidtokens, "]" ) + .replace( rvalidbraces, "")) ) { + + return (new Function( "return " + data ))(); + + } + jQuery.error( "Invalid JSON: " + data ); + }, + + // Cross-browser xml parsing + parseXML: function( data ) { + var xml, tmp; + try { + if ( window.DOMParser ) { // Standard + tmp = new DOMParser(); + xml = tmp.parseFromString( data , "text/xml" ); + } else { // IE + xml = new ActiveXObject( "Microsoft.XMLDOM" ); + xml.async = "false"; + xml.loadXML( data ); + } + } catch( e ) { + xml = undefined; + } + if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { + jQuery.error( "Invalid XML: " + data ); + } + return xml; + }, + + noop: function() {}, + + // Evaluates a script in a global context + // Workarounds based on findings by Jim Driscoll + // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context + globalEval: function( data ) { + if ( data && rnotwhite.test( data ) ) { + // We use execScript on Internet Explorer + // We use an anonymous function so that context is window + // rather than jQuery in Firefox + ( window.execScript || function( data ) { + window[ "eval" ].call( window, data ); + } )( data ); + } + }, + + // Convert dashed to camelCase; used by the css and data modules + // Microsoft forgot to hump their vendor prefix (#9572) + camelCase: function( string ) { + return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); + }, + + nodeName: function( elem, name ) { + return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase(); + }, + + // args is for internal usage only + each: function( object, callback, args ) { + var name, i = 0, + length = object.length, + isObj = length === undefined || jQuery.isFunction( object ); + + if ( args ) { + if ( isObj ) { + for ( name in object ) { + if ( callback.apply( object[ name ], args ) === false ) { + break; + } + } + } else { + for ( ; i < length; ) { + if ( callback.apply( object[ i++ ], args ) === false ) { + break; + } + } + } + + // A special, fast, case for the most common use of each + } else { + if ( isObj ) { + for ( name in object ) { + if ( callback.call( object[ name ], name, object[ name ] ) === false ) { + break; + } + } + } else { + for ( ; i < length; ) { + if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) { + break; + } + } + } + } + + return object; + }, + + // Use native String.trim function wherever possible + trim: trim ? + function( text ) { + return text == null ? + "" : + trim.call( text ); + } : + + // Otherwise use our own trimming functionality + function( text ) { + return text == null ? + "" : + text.toString().replace( trimLeft, "" ).replace( trimRight, "" ); + }, + + // results is for internal usage only + makeArray: function( array, results ) { + var ret = results || []; + + if ( array != null ) { + // The window, strings (and functions) also have 'length' + // The extra typeof function check is to prevent crashes + // in Safari 2 (See: #3039) + // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930 + var type = jQuery.type( array ); + + if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) { + push.call( ret, array ); + } else { + jQuery.merge( ret, array ); + } + } + + return ret; + }, + + inArray: function( elem, array ) { + if ( !array ) { + return -1; + } + + if ( indexOf ) { + return indexOf.call( array, elem ); + } + + for ( var i = 0, length = array.length; i < length; i++ ) { + if ( array[ i ] === elem ) { + return i; + } + } + + return -1; + }, + + merge: function( first, second ) { + var i = first.length, + j = 0; + + if ( typeof second.length === "number" ) { + for ( var l = second.length; j < l; j++ ) { + first[ i++ ] = second[ j ]; + } + + } else { + while ( second[j] !== undefined ) { + first[ i++ ] = second[ j++ ]; + } + } + + first.length = i; + + return first; + }, + + grep: function( elems, callback, inv ) { + var ret = [], retVal; + inv = !!inv; + + // Go through the array, only saving the items + // that pass the validator function + for ( var i = 0, length = elems.length; i < length; i++ ) { + retVal = !!callback( elems[ i ], i ); + if ( inv !== retVal ) { + ret.push( elems[ i ] ); + } + } + + return ret; + }, + + // arg is for internal usage only + map: function( elems, callback, arg ) { + var value, key, ret = [], + i = 0, + length = elems.length, + // jquery objects are treated as arrays + isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ; + + // Go through the array, translating each of the items to their + if ( isArray ) { + for ( ; i < length; i++ ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret[ ret.length ] = value; + } + } + + // Go through every key on the object, + } else { + for ( key in elems ) { + value = callback( elems[ key ], key, arg ); + + if ( value != null ) { + ret[ ret.length ] = value; + } + } + } + + // Flatten any nested arrays + return ret.concat.apply( [], ret ); + }, + + // A global GUID counter for objects + guid: 1, + + // Bind a function to a context, optionally partially applying any + // arguments. + proxy: function( fn, context ) { + if ( typeof context === "string" ) { + var tmp = fn[ context ]; + context = fn; + fn = tmp; + } + + // Quick check to determine if target is callable, in the spec + // this throws a TypeError, but we will just return undefined. + if ( !jQuery.isFunction( fn ) ) { + return undefined; + } + + // Simulated bind + var args = slice.call( arguments, 2 ), + proxy = function() { + return fn.apply( context, args.concat( slice.call( arguments ) ) ); + }; + + // Set the guid of unique handler to the same of original handler, so it can be removed + proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++; + + return proxy; + }, + + // Mutifunctional method to get and set values to a collection + // The value/s can optionally be executed if it's a function + access: function( elems, key, value, exec, fn, pass ) { + var length = elems.length; + + // Setting many attributes + if ( typeof key === "object" ) { + for ( var k in key ) { + jQuery.access( elems, k, key[k], exec, fn, value ); + } + return elems; + } + + // Setting one attribute + if ( value !== undefined ) { + // Optionally, function values get executed if exec is true + exec = !pass && exec && jQuery.isFunction(value); + + for ( var i = 0; i < length; i++ ) { + fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass ); + } + + return elems; + } + + // Getting an attribute + return length ? fn( elems[0], key ) : undefined; + }, + + now: function() { + return (new Date()).getTime(); + }, + + // Use of jQuery.browser is frowned upon. + // More details: http://docs.jquery.com/Utilities/jQuery.browser + uaMatch: function( ua ) { + ua = ua.toLowerCase(); + + var match = rwebkit.exec( ua ) || + ropera.exec( ua ) || + rmsie.exec( ua ) || + ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) || + []; + + return { browser: match[1] || "", version: match[2] || "0" }; + }, + + sub: function() { + function jQuerySub( selector, context ) { + return new jQuerySub.fn.init( selector, context ); + } + jQuery.extend( true, jQuerySub, this ); + jQuerySub.superclass = this; + jQuerySub.fn = jQuerySub.prototype = this(); + jQuerySub.fn.constructor = jQuerySub; + jQuerySub.sub = this.sub; + jQuerySub.fn.init = function init( selector, context ) { + if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) { + context = jQuerySub( context ); + } + + return jQuery.fn.init.call( this, selector, context, rootjQuerySub ); + }; + jQuerySub.fn.init.prototype = jQuerySub.fn; + var rootjQuerySub = jQuerySub(document); + return jQuerySub; + }, + + browser: {} +}); + +// Populate the class2type map +jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) { + class2type[ "[object " + name + "]" ] = name.toLowerCase(); +}); + +browserMatch = jQuery.uaMatch( userAgent ); +if ( browserMatch.browser ) { + jQuery.browser[ browserMatch.browser ] = true; + jQuery.browser.version = browserMatch.version; +} + +// Deprecated, use jQuery.browser.webkit instead +if ( jQuery.browser.webkit ) { + jQuery.browser.safari = true; +} + +// IE doesn't match non-breaking spaces with \s +if ( rnotwhite.test( "\xA0" ) ) { + trimLeft = /^[\s\xA0]+/; + trimRight = /[\s\xA0]+$/; +} + +// All jQuery objects should point back to these +rootjQuery = jQuery(document); + +// Cleanup functions for the document ready method +if ( document.addEventListener ) { + DOMContentLoaded = function() { + document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); + jQuery.ready(); + }; + +} else if ( document.attachEvent ) { + DOMContentLoaded = function() { + // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). + if ( document.readyState === "complete" ) { + document.detachEvent( "onreadystatechange", DOMContentLoaded ); + jQuery.ready(); + } + }; +} + +// The DOM ready check for Internet Explorer +function doScrollCheck() { + if ( jQuery.isReady ) { + return; + } + + try { + // If IE is used, use the trick by Diego Perini + // http://javascript.nwbox.com/IEContentLoaded/ + document.documentElement.doScroll("left"); + } catch(e) { + setTimeout( doScrollCheck, 1 ); + return; + } + + // and execute any waiting functions + jQuery.ready(); +} + +return jQuery; + +})(); + + +var // Promise methods + promiseMethods = "done fail isResolved isRejected promise then always pipe".split( " " ), + // Static reference to slice + sliceDeferred = [].slice; + +jQuery.extend({ + // Create a simple deferred (one callbacks list) + _Deferred: function() { + var // callbacks list + callbacks = [], + // stored [ context , args ] + fired, + // to avoid firing when already doing so + firing, + // flag to know if the deferred has been cancelled + cancelled, + // the deferred itself + deferred = { + + // done( f1, f2, ...) + done: function() { + if ( !cancelled ) { + var args = arguments, + i, + length, + elem, + type, + _fired; + if ( fired ) { + _fired = fired; + fired = 0; + } + for ( i = 0, length = args.length; i < length; i++ ) { + elem = args[ i ]; + type = jQuery.type( elem ); + if ( type === "array" ) { + deferred.done.apply( deferred, elem ); + } else if ( type === "function" ) { + callbacks.push( elem ); + } + } + if ( _fired ) { + deferred.resolveWith( _fired[ 0 ], _fired[ 1 ] ); + } + } + return this; + }, + + // resolve with given context and args + resolveWith: function( context, args ) { + if ( !cancelled && !fired && !firing ) { + // make sure args are available (#8421) + args = args || []; + firing = 1; + try { + while( callbacks[ 0 ] ) { + callbacks.shift().apply( context, args ); + } + } + finally { + fired = [ context, args ]; + firing = 0; + } + } + return this; + }, + + // resolve with this as context and given arguments + resolve: function() { + deferred.resolveWith( this, arguments ); + return this; + }, + + // Has this deferred been resolved? + isResolved: function() { + return !!( firing || fired ); + }, + + // Cancel + cancel: function() { + cancelled = 1; + callbacks = []; + return this; + } + }; + + return deferred; + }, + + // Full fledged deferred (two callbacks list) + Deferred: function( func ) { + var deferred = jQuery._Deferred(), + failDeferred = jQuery._Deferred(), + promise; + // Add errorDeferred methods, then and promise + jQuery.extend( deferred, { + then: function( doneCallbacks, failCallbacks ) { + deferred.done( doneCallbacks ).fail( failCallbacks ); + return this; + }, + always: function() { + return deferred.done.apply( deferred, arguments ).fail.apply( this, arguments ); + }, + fail: failDeferred.done, + rejectWith: failDeferred.resolveWith, + reject: failDeferred.resolve, + isRejected: failDeferred.isResolved, + pipe: function( fnDone, fnFail ) { + return jQuery.Deferred(function( newDefer ) { + jQuery.each( { + done: [ fnDone, "resolve" ], + fail: [ fnFail, "reject" ] + }, function( handler, data ) { + var fn = data[ 0 ], + action = data[ 1 ], + returned; + if ( jQuery.isFunction( fn ) ) { + deferred[ handler ](function() { + returned = fn.apply( this, arguments ); + if ( returned && jQuery.isFunction( returned.promise ) ) { + returned.promise().then( newDefer.resolve, newDefer.reject ); + } else { + newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] ); + } + }); + } else { + deferred[ handler ]( newDefer[ action ] ); + } + }); + }).promise(); + }, + // Get a promise for this deferred + // If obj is provided, the promise aspect is added to the object + promise: function( obj ) { + if ( obj == null ) { + if ( promise ) { + return promise; + } + promise = obj = {}; + } + var i = promiseMethods.length; + while( i-- ) { + obj[ promiseMethods[i] ] = deferred[ promiseMethods[i] ]; + } + return obj; + } + }); + // Make sure only one callback list will be used + deferred.done( failDeferred.cancel ).fail( deferred.cancel ); + // Unexpose cancel + delete deferred.cancel; + // Call given func if any + if ( func ) { + func.call( deferred, deferred ); + } + return deferred; + }, + + // Deferred helper + when: function( firstParam ) { + var args = arguments, + i = 0, + length = args.length, + count = length, + deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ? + firstParam : + jQuery.Deferred(); + function resolveFunc( i ) { + return function( value ) { + args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value; + if ( !( --count ) ) { + // Strange bug in FF4: + // Values changed onto the arguments object sometimes end up as undefined values + // outside the $.when method. Cloning the object into a fresh array solves the issue + deferred.resolveWith( deferred, sliceDeferred.call( args, 0 ) ); + } + }; + } + if ( length > 1 ) { + for( ; i < length; i++ ) { + if ( args[ i ] && jQuery.isFunction( args[ i ].promise ) ) { + args[ i ].promise().then( resolveFunc(i), deferred.reject ); + } else { + --count; + } + } + if ( !count ) { + deferred.resolveWith( deferred, args ); + } + } else if ( deferred !== firstParam ) { + deferred.resolveWith( deferred, length ? [ firstParam ] : [] ); + } + return deferred.promise(); + } +}); + + + +jQuery.support = (function() { + + var div = document.createElement( "div" ), + documentElement = document.documentElement, + all, + a, + select, + opt, + input, + marginDiv, + support, + fragment, + body, + testElementParent, + testElement, + testElementStyle, + tds, + events, + eventName, + i, + isSupported; + + // Preliminary tests + div.setAttribute("className", "t"); + div.innerHTML = "
      a"; + + + all = div.getElementsByTagName( "*" ); + a = div.getElementsByTagName( "a" )[ 0 ]; + + // Can't get basic test support + if ( !all || !all.length || !a ) { + return {}; + } + + // First batch of supports tests + select = document.createElement( "select" ); + opt = select.appendChild( document.createElement("option") ); + input = div.getElementsByTagName( "input" )[ 0 ]; + + support = { + // IE strips leading whitespace when .innerHTML is used + leadingWhitespace: ( div.firstChild.nodeType === 3 ), + + // Make sure that tbody elements aren't automatically inserted + // IE will insert them into empty tables + tbody: !div.getElementsByTagName( "tbody" ).length, + + // Make sure that link elements get serialized correctly by innerHTML + // This requires a wrapper element in IE + htmlSerialize: !!div.getElementsByTagName( "link" ).length, + + // Get the style information from getAttribute + // (IE uses .cssText instead) + style: /top/.test( a.getAttribute("style") ), + + // Make sure that URLs aren't manipulated + // (IE normalizes it by default) + hrefNormalized: ( a.getAttribute( "href" ) === "/a" ), + + // Make sure that element opacity exists + // (IE uses filter instead) + // Use a regex to work around a WebKit issue. See #5145 + opacity: /^0.55$/.test( a.style.opacity ), + + // Verify style float existence + // (IE uses styleFloat instead of cssFloat) + cssFloat: !!a.style.cssFloat, + + // Make sure that if no value is specified for a checkbox + // that it defaults to "on". + // (WebKit defaults to "" instead) + checkOn: ( input.value === "on" ), + + // Make sure that a selected-by-default option has a working selected property. + // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) + optSelected: opt.selected, + + // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) + getSetAttribute: div.className !== "t", + + // Will be defined later + submitBubbles: true, + changeBubbles: true, + focusinBubbles: false, + deleteExpando: true, + noCloneEvent: true, + inlineBlockNeedsLayout: false, + shrinkWrapBlocks: false, + reliableMarginRight: true + }; + + // Make sure checked status is properly cloned + input.checked = true; + support.noCloneChecked = input.cloneNode( true ).checked; + + // Make sure that the options inside disabled selects aren't marked as disabled + // (WebKit marks them as disabled) + select.disabled = true; + support.optDisabled = !opt.disabled; + + // Test to see if it's possible to delete an expando from an element + // Fails in Internet Explorer + try { + delete div.test; + } catch( e ) { + support.deleteExpando = false; + } + + if ( !div.addEventListener && div.attachEvent && div.fireEvent ) { + div.attachEvent( "onclick", function() { + // Cloning a node shouldn't copy over any + // bound event handlers (IE does this) + support.noCloneEvent = false; + }); + div.cloneNode( true ).fireEvent( "onclick" ); + } + + // Check if a radio maintains it's value + // after being appended to the DOM + input = document.createElement("input"); + input.value = "t"; + input.setAttribute("type", "radio"); + support.radioValue = input.value === "t"; + + input.setAttribute("checked", "checked"); + div.appendChild( input ); + fragment = document.createDocumentFragment(); + fragment.appendChild( div.firstChild ); + + // WebKit doesn't clone checked state correctly in fragments + support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; + + div.innerHTML = ""; + + // Figure out if the W3C box model works as expected + div.style.width = div.style.paddingLeft = "1px"; + + body = document.getElementsByTagName( "body" )[ 0 ]; + // We use our own, invisible, body unless the body is already present + // in which case we use a div (#9239) + testElement = document.createElement( body ? "div" : "body" ); + testElementStyle = { + visibility: "hidden", + width: 0, + height: 0, + border: 0, + margin: 0, + background: "none" + }; + if ( body ) { + jQuery.extend( testElementStyle, { + position: "absolute", + left: "-1000px", + top: "-1000px" + }); + } + for ( i in testElementStyle ) { + testElement.style[ i ] = testElementStyle[ i ]; + } + testElement.appendChild( div ); + testElementParent = body || documentElement; + testElementParent.insertBefore( testElement, testElementParent.firstChild ); + + // Check if a disconnected checkbox will retain its checked + // value of true after appended to the DOM (IE6/7) + support.appendChecked = input.checked; + + support.boxModel = div.offsetWidth === 2; + + if ( "zoom" in div.style ) { + // Check if natively block-level elements act like inline-block + // elements when setting their display to 'inline' and giving + // them layout + // (IE < 8 does this) + div.style.display = "inline"; + div.style.zoom = 1; + support.inlineBlockNeedsLayout = ( div.offsetWidth === 2 ); + + // Check if elements with layout shrink-wrap their children + // (IE 6 does this) + div.style.display = ""; + div.innerHTML = "
      "; + support.shrinkWrapBlocks = ( div.offsetWidth !== 2 ); + } + + div.innerHTML = "
      t
      "; + tds = div.getElementsByTagName( "td" ); + + // Check if table cells still have offsetWidth/Height when they are set + // to display:none and there are still other visible table cells in a + // table row; if so, offsetWidth/Height are not reliable for use when + // determining if an element has been hidden directly using + // display:none (it is still safe to use offsets if a parent element is + // hidden; don safety goggles and see bug #4512 for more information). + // (only IE 8 fails this test) + isSupported = ( tds[ 0 ].offsetHeight === 0 ); + + tds[ 0 ].style.display = ""; + tds[ 1 ].style.display = "none"; + + // Check if empty table cells still have offsetWidth/Height + // (IE < 8 fail this test) + support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); + div.innerHTML = ""; + + // Check if div with explicit width and no margin-right incorrectly + // gets computed margin-right based on width of container. For more + // info see bug #3333 + // Fails in WebKit before Feb 2011 nightlies + // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right + if ( document.defaultView && document.defaultView.getComputedStyle ) { + marginDiv = document.createElement( "div" ); + marginDiv.style.width = "0"; + marginDiv.style.marginRight = "0"; + div.appendChild( marginDiv ); + support.reliableMarginRight = + ( parseInt( ( document.defaultView.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0; + } + + // Remove the body element we added + testElement.innerHTML = ""; + testElementParent.removeChild( testElement ); + + // Technique from Juriy Zaytsev + // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/ + // We only care about the case where non-standard event systems + // are used, namely in IE. Short-circuiting here helps us to + // avoid an eval call (in setAttribute) which can cause CSP + // to go haywire. See: https://developer.mozilla.org/en/Security/CSP + if ( div.attachEvent ) { + for( i in { + submit: 1, + change: 1, + focusin: 1 + } ) { + eventName = "on" + i; + isSupported = ( eventName in div ); + if ( !isSupported ) { + div.setAttribute( eventName, "return;" ); + isSupported = ( typeof div[ eventName ] === "function" ); + } + support[ i + "Bubbles" ] = isSupported; + } + } + + // Null connected elements to avoid leaks in IE + testElement = fragment = select = opt = body = marginDiv = div = input = null; + + return support; +})(); + +// Keep track of boxModel +jQuery.boxModel = jQuery.support.boxModel; + + + + +var rbrace = /^(?:\{.*\}|\[.*\])$/, + rmultiDash = /([A-Z])/g; + +jQuery.extend({ + cache: {}, + + // Please use with caution + uuid: 0, + + // Unique for each copy of jQuery on the page + // Non-digits removed to match rinlinejQuery + expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ), + + // The following elements throw uncatchable exceptions if you + // attempt to add expando properties to them. + noData: { + "embed": true, + // Ban all objects except for Flash (which handle expandos) + "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", + "applet": true + }, + + hasData: function( elem ) { + elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; + + return !!elem && !isEmptyDataObject( elem ); + }, + + data: function( elem, name, data, pvt /* Internal Use Only */ ) { + if ( !jQuery.acceptData( elem ) ) { + return; + } + + var thisCache, ret, + internalKey = jQuery.expando, + getByName = typeof name === "string", + + // We have to handle DOM nodes and JS objects differently because IE6-7 + // can't GC object references properly across the DOM-JS boundary + isNode = elem.nodeType, + + // Only DOM nodes need the global jQuery cache; JS object data is + // attached directly to the object so GC can occur automatically + cache = isNode ? jQuery.cache : elem, + + // Only defining an ID for JS objects if its cache already exists allows + // the code to shortcut on the same path as a DOM node with no cache + id = isNode ? elem[ jQuery.expando ] : elem[ jQuery.expando ] && jQuery.expando; + + // Avoid doing any more work than we need to when trying to get data on an + // object that has no data at all + if ( (!id || (pvt && id && (cache[ id ] && !cache[ id ][ internalKey ]))) && getByName && data === undefined ) { + return; + } + + if ( !id ) { + // Only DOM nodes need a new unique ID for each element since their data + // ends up in the global cache + if ( isNode ) { + elem[ jQuery.expando ] = id = ++jQuery.uuid; + } else { + id = jQuery.expando; + } + } + + if ( !cache[ id ] ) { + cache[ id ] = {}; + + // TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery + // metadata on plain JS objects when the object is serialized using + // JSON.stringify + if ( !isNode ) { + cache[ id ].toJSON = jQuery.noop; + } + } + + // An object can be passed to jQuery.data instead of a key/value pair; this gets + // shallow copied over onto the existing cache + if ( typeof name === "object" || typeof name === "function" ) { + if ( pvt ) { + cache[ id ][ internalKey ] = jQuery.extend(cache[ id ][ internalKey ], name); + } else { + cache[ id ] = jQuery.extend(cache[ id ], name); + } + } + + thisCache = cache[ id ]; + + // Internal jQuery data is stored in a separate object inside the object's data + // cache in order to avoid key collisions between internal data and user-defined + // data + if ( pvt ) { + if ( !thisCache[ internalKey ] ) { + thisCache[ internalKey ] = {}; + } + + thisCache = thisCache[ internalKey ]; + } + + if ( data !== undefined ) { + thisCache[ jQuery.camelCase( name ) ] = data; + } + + // TODO: This is a hack for 1.5 ONLY. It will be removed in 1.6. Users should + // not attempt to inspect the internal events object using jQuery.data, as this + // internal data object is undocumented and subject to change. + if ( name === "events" && !thisCache[name] ) { + return thisCache[ internalKey ] && thisCache[ internalKey ].events; + } + + // Check for both converted-to-camel and non-converted data property names + // If a data property was specified + if ( getByName ) { + + // First Try to find as-is property data + ret = thisCache[ name ]; + + // Test for null|undefined property data + if ( ret == null ) { + + // Try to find the camelCased property + ret = thisCache[ jQuery.camelCase( name ) ]; + } + } else { + ret = thisCache; + } + + return ret; + }, + + removeData: function( elem, name, pvt /* Internal Use Only */ ) { + if ( !jQuery.acceptData( elem ) ) { + return; + } + + var thisCache, + + // Reference to internal data cache key + internalKey = jQuery.expando, + + isNode = elem.nodeType, + + // See jQuery.data for more information + cache = isNode ? jQuery.cache : elem, + + // See jQuery.data for more information + id = isNode ? elem[ jQuery.expando ] : jQuery.expando; + + // If there is already no cache entry for this object, there is no + // purpose in continuing + if ( !cache[ id ] ) { + return; + } + + if ( name ) { + + thisCache = pvt ? cache[ id ][ internalKey ] : cache[ id ]; + + if ( thisCache ) { + + // Support interoperable removal of hyphenated or camelcased keys + if ( !thisCache[ name ] ) { + name = jQuery.camelCase( name ); + } + + delete thisCache[ name ]; + + // If there is no data left in the cache, we want to continue + // and let the cache object itself get destroyed + if ( !isEmptyDataObject(thisCache) ) { + return; + } + } + } + + // See jQuery.data for more information + if ( pvt ) { + delete cache[ id ][ internalKey ]; + + // Don't destroy the parent cache unless the internal data object + // had been the only thing left in it + if ( !isEmptyDataObject(cache[ id ]) ) { + return; + } + } + + var internalCache = cache[ id ][ internalKey ]; + + // Browsers that fail expando deletion also refuse to delete expandos on + // the window, but it will allow it on all other JS objects; other browsers + // don't care + // Ensure that `cache` is not a window object #10080 + if ( jQuery.support.deleteExpando || !cache.setInterval ) { + delete cache[ id ]; + } else { + cache[ id ] = null; + } + + // We destroyed the entire user cache at once because it's faster than + // iterating through each key, but we need to continue to persist internal + // data if it existed + if ( internalCache ) { + cache[ id ] = {}; + // TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery + // metadata on plain JS objects when the object is serialized using + // JSON.stringify + if ( !isNode ) { + cache[ id ].toJSON = jQuery.noop; + } + + cache[ id ][ internalKey ] = internalCache; + + // Otherwise, we need to eliminate the expando on the node to avoid + // false lookups in the cache for entries that no longer exist + } else if ( isNode ) { + // IE does not allow us to delete expando properties from nodes, + // nor does it have a removeAttribute function on Document nodes; + // we must handle all of these cases + if ( jQuery.support.deleteExpando ) { + delete elem[ jQuery.expando ]; + } else if ( elem.removeAttribute ) { + elem.removeAttribute( jQuery.expando ); + } else { + elem[ jQuery.expando ] = null; + } + } + }, + + // For internal use only. + _data: function( elem, name, data ) { + return jQuery.data( elem, name, data, true ); + }, + + // A method for determining if a DOM node can handle the data expando + acceptData: function( elem ) { + if ( elem.nodeName ) { + var match = jQuery.noData[ elem.nodeName.toLowerCase() ]; + + if ( match ) { + return !(match === true || elem.getAttribute("classid") !== match); + } + } + + return true; + } +}); + +jQuery.fn.extend({ + data: function( key, value ) { + var data = null; + + if ( typeof key === "undefined" ) { + if ( this.length ) { + data = jQuery.data( this[0] ); + + if ( this[0].nodeType === 1 ) { + var attr = this[0].attributes, name; + for ( var i = 0, l = attr.length; i < l; i++ ) { + name = attr[i].name; + + if ( name.indexOf( "data-" ) === 0 ) { + name = jQuery.camelCase( name.substring(5) ); + + dataAttr( this[0], name, data[ name ] ); + } + } + } + } + + return data; + + } else if ( typeof key === "object" ) { + return this.each(function() { + jQuery.data( this, key ); + }); + } + + var parts = key.split("."); + parts[1] = parts[1] ? "." + parts[1] : ""; + + if ( value === undefined ) { + data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); + + // Try to fetch any internally stored data first + if ( data === undefined && this.length ) { + data = jQuery.data( this[0], key ); + data = dataAttr( this[0], key, data ); + } + + return data === undefined && parts[1] ? + this.data( parts[0] ) : + data; + + } else { + return this.each(function() { + var $this = jQuery( this ), + args = [ parts[0], value ]; + + $this.triggerHandler( "setData" + parts[1] + "!", args ); + jQuery.data( this, key, value ); + $this.triggerHandler( "changeData" + parts[1] + "!", args ); + }); + } + }, + + removeData: function( key ) { + return this.each(function() { + jQuery.removeData( this, key ); + }); + } +}); + +function dataAttr( elem, key, data ) { + // If nothing was found internally, try to fetch any + // data from the HTML5 data-* attribute + if ( data === undefined && elem.nodeType === 1 ) { + + var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); + + data = elem.getAttribute( name ); + + if ( typeof data === "string" ) { + try { + data = data === "true" ? true : + data === "false" ? false : + data === "null" ? null : + !jQuery.isNaN( data ) ? parseFloat( data ) : + rbrace.test( data ) ? jQuery.parseJSON( data ) : + data; + } catch( e ) {} + + // Make sure we set the data so it isn't changed later + jQuery.data( elem, key, data ); + + } else { + data = undefined; + } + } + + return data; +} + +// TODO: This is a hack for 1.5 ONLY to allow objects with a single toJSON +// property to be considered empty objects; this property always exists in +// order to make sure JSON.stringify does not expose internal metadata +function isEmptyDataObject( obj ) { + for ( var name in obj ) { + if ( name !== "toJSON" ) { + return false; + } + } + + return true; +} + + + + +function handleQueueMarkDefer( elem, type, src ) { + var deferDataKey = type + "defer", + queueDataKey = type + "queue", + markDataKey = type + "mark", + defer = jQuery.data( elem, deferDataKey, undefined, true ); + if ( defer && + ( src === "queue" || !jQuery.data( elem, queueDataKey, undefined, true ) ) && + ( src === "mark" || !jQuery.data( elem, markDataKey, undefined, true ) ) ) { + // Give room for hard-coded callbacks to fire first + // and eventually mark/queue something else on the element + setTimeout( function() { + if ( !jQuery.data( elem, queueDataKey, undefined, true ) && + !jQuery.data( elem, markDataKey, undefined, true ) ) { + jQuery.removeData( elem, deferDataKey, true ); + defer.resolve(); + } + }, 0 ); + } +} + +jQuery.extend({ + + _mark: function( elem, type ) { + if ( elem ) { + type = (type || "fx") + "mark"; + jQuery.data( elem, type, (jQuery.data(elem,type,undefined,true) || 0) + 1, true ); + } + }, + + _unmark: function( force, elem, type ) { + if ( force !== true ) { + type = elem; + elem = force; + force = false; + } + if ( elem ) { + type = type || "fx"; + var key = type + "mark", + count = force ? 0 : ( (jQuery.data( elem, key, undefined, true) || 1 ) - 1 ); + if ( count ) { + jQuery.data( elem, key, count, true ); + } else { + jQuery.removeData( elem, key, true ); + handleQueueMarkDefer( elem, type, "mark" ); + } + } + }, + + queue: function( elem, type, data ) { + if ( elem ) { + type = (type || "fx") + "queue"; + var q = jQuery.data( elem, type, undefined, true ); + // Speed up dequeue by getting out quickly if this is just a lookup + if ( data ) { + if ( !q || jQuery.isArray(data) ) { + q = jQuery.data( elem, type, jQuery.makeArray(data), true ); + } else { + q.push( data ); + } + } + return q || []; + } + }, + + dequeue: function( elem, type ) { + type = type || "fx"; + + var queue = jQuery.queue( elem, type ), + fn = queue.shift(), + defer; + + // If the fx queue is dequeued, always remove the progress sentinel + if ( fn === "inprogress" ) { + fn = queue.shift(); + } + + if ( fn ) { + // Add a progress sentinel to prevent the fx queue from being + // automatically dequeued + if ( type === "fx" ) { + queue.unshift("inprogress"); + } + + fn.call(elem, function() { + jQuery.dequeue(elem, type); + }); + } + + if ( !queue.length ) { + jQuery.removeData( elem, type + "queue", true ); + handleQueueMarkDefer( elem, type, "queue" ); + } + } +}); + +jQuery.fn.extend({ + queue: function( type, data ) { + if ( typeof type !== "string" ) { + data = type; + type = "fx"; + } + + if ( data === undefined ) { + return jQuery.queue( this[0], type ); + } + return this.each(function() { + var queue = jQuery.queue( this, type, data ); + + if ( type === "fx" && queue[0] !== "inprogress" ) { + jQuery.dequeue( this, type ); + } + }); + }, + dequeue: function( type ) { + return this.each(function() { + jQuery.dequeue( this, type ); + }); + }, + // Based off of the plugin by Clint Helfers, with permission. + // http://blindsignals.com/index.php/2009/07/jquery-delay/ + delay: function( time, type ) { + time = jQuery.fx ? jQuery.fx.speeds[time] || time : time; + type = type || "fx"; + + return this.queue( type, function() { + var elem = this; + setTimeout(function() { + jQuery.dequeue( elem, type ); + }, time ); + }); + }, + clearQueue: function( type ) { + return this.queue( type || "fx", [] ); + }, + // Get a promise resolved when queues of a certain type + // are emptied (fx is the type by default) + promise: function( type, object ) { + if ( typeof type !== "string" ) { + object = type; + type = undefined; + } + type = type || "fx"; + var defer = jQuery.Deferred(), + elements = this, + i = elements.length, + count = 1, + deferDataKey = type + "defer", + queueDataKey = type + "queue", + markDataKey = type + "mark", + tmp; + function resolve() { + if ( !( --count ) ) { + defer.resolveWith( elements, [ elements ] ); + } + } + while( i-- ) { + if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) || + ( jQuery.data( elements[ i ], queueDataKey, undefined, true ) || + jQuery.data( elements[ i ], markDataKey, undefined, true ) ) && + jQuery.data( elements[ i ], deferDataKey, jQuery._Deferred(), true ) )) { + count++; + tmp.done( resolve ); + } + } + resolve(); + return defer.promise(); + } +}); + + + + +var rclass = /[\n\t\r]/g, + rspace = /\s+/, + rreturn = /\r/g, + rtype = /^(?:button|input)$/i, + rfocusable = /^(?:button|input|object|select|textarea)$/i, + rclickable = /^a(?:rea)?$/i, + rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i, + nodeHook, boolHook; + +jQuery.fn.extend({ + attr: function( name, value ) { + return jQuery.access( this, name, value, true, jQuery.attr ); + }, + + removeAttr: function( name ) { + return this.each(function() { + jQuery.removeAttr( this, name ); + }); + }, + + prop: function( name, value ) { + return jQuery.access( this, name, value, true, jQuery.prop ); + }, + + removeProp: function( name ) { + name = jQuery.propFix[ name ] || name; + return this.each(function() { + // try/catch handles cases where IE balks (such as removing a property on window) + try { + this[ name ] = undefined; + delete this[ name ]; + } catch( e ) {} + }); + }, + + addClass: function( value ) { + var classNames, i, l, elem, + setClass, c, cl; + + if ( jQuery.isFunction( value ) ) { + return this.each(function( j ) { + jQuery( this ).addClass( value.call(this, j, this.className) ); + }); + } + + if ( value && typeof value === "string" ) { + classNames = value.split( rspace ); + + for ( i = 0, l = this.length; i < l; i++ ) { + elem = this[ i ]; + + if ( elem.nodeType === 1 ) { + if ( !elem.className && classNames.length === 1 ) { + elem.className = value; + + } else { + setClass = " " + elem.className + " "; + + for ( c = 0, cl = classNames.length; c < cl; c++ ) { + if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) { + setClass += classNames[ c ] + " "; + } + } + elem.className = jQuery.trim( setClass ); + } + } + } + } + + return this; + }, + + removeClass: function( value ) { + var classNames, i, l, elem, className, c, cl; + + if ( jQuery.isFunction( value ) ) { + return this.each(function( j ) { + jQuery( this ).removeClass( value.call(this, j, this.className) ); + }); + } + + if ( (value && typeof value === "string") || value === undefined ) { + classNames = (value || "").split( rspace ); + + for ( i = 0, l = this.length; i < l; i++ ) { + elem = this[ i ]; + + if ( elem.nodeType === 1 && elem.className ) { + if ( value ) { + className = (" " + elem.className + " ").replace( rclass, " " ); + for ( c = 0, cl = classNames.length; c < cl; c++ ) { + className = className.replace(" " + classNames[ c ] + " ", " "); + } + elem.className = jQuery.trim( className ); + + } else { + elem.className = ""; + } + } + } + } + + return this; + }, + + toggleClass: function( value, stateVal ) { + var type = typeof value, + isBool = typeof stateVal === "boolean"; + + if ( jQuery.isFunction( value ) ) { + return this.each(function( i ) { + jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); + }); + } + + return this.each(function() { + if ( type === "string" ) { + // toggle individual class names + var className, + i = 0, + self = jQuery( this ), + state = stateVal, + classNames = value.split( rspace ); + + while ( (className = classNames[ i++ ]) ) { + // check each className given, space seperated list + state = isBool ? state : !self.hasClass( className ); + self[ state ? "addClass" : "removeClass" ]( className ); + } + + } else if ( type === "undefined" || type === "boolean" ) { + if ( this.className ) { + // store className if set + jQuery._data( this, "__className__", this.className ); + } + + // toggle whole className + this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; + } + }); + }, + + hasClass: function( selector ) { + var className = " " + selector + " "; + for ( var i = 0, l = this.length; i < l; i++ ) { + if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) { + return true; + } + } + + return false; + }, + + val: function( value ) { + var hooks, ret, + elem = this[0]; + + if ( !arguments.length ) { + if ( elem ) { + hooks = jQuery.valHooks[ elem.nodeName.toLowerCase() ] || jQuery.valHooks[ elem.type ]; + + if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { + return ret; + } + + ret = elem.value; + + return typeof ret === "string" ? + // handle most common string cases + ret.replace(rreturn, "") : + // handle cases where value is null/undef or number + ret == null ? "" : ret; + } + + return undefined; + } + + var isFunction = jQuery.isFunction( value ); + + return this.each(function( i ) { + var self = jQuery(this), val; + + if ( this.nodeType !== 1 ) { + return; + } + + if ( isFunction ) { + val = value.call( this, i, self.val() ); + } else { + val = value; + } + + // Treat null/undefined as ""; convert numbers to string + if ( val == null ) { + val = ""; + } else if ( typeof val === "number" ) { + val += ""; + } else if ( jQuery.isArray( val ) ) { + val = jQuery.map(val, function ( value ) { + return value == null ? "" : value + ""; + }); + } + + hooks = jQuery.valHooks[ this.nodeName.toLowerCase() ] || jQuery.valHooks[ this.type ]; + + // If set returns undefined, fall back to normal setting + if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { + this.value = val; + } + }); + } +}); + +jQuery.extend({ + valHooks: { + option: { + get: function( elem ) { + // attributes.value is undefined in Blackberry 4.7 but + // uses .value. See #6932 + var val = elem.attributes.value; + return !val || val.specified ? elem.value : elem.text; + } + }, + select: { + get: function( elem ) { + var value, + index = elem.selectedIndex, + values = [], + options = elem.options, + one = elem.type === "select-one"; + + // Nothing was selected + if ( index < 0 ) { + return null; + } + + // Loop through all the selected options + for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) { + var option = options[ i ]; + + // Don't return options that are disabled or in a disabled optgroup + if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) && + (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) { + + // Get the specific value for the option + value = jQuery( option ).val(); + + // We don't need an array for one selects + if ( one ) { + return value; + } + + // Multi-Selects return an array + values.push( value ); + } + } + + // Fixes Bug #2551 -- select.val() broken in IE after form.reset() + if ( one && !values.length && options.length ) { + return jQuery( options[ index ] ).val(); + } + + return values; + }, + + set: function( elem, value ) { + var values = jQuery.makeArray( value ); + + jQuery(elem).find("option").each(function() { + this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0; + }); + + if ( !values.length ) { + elem.selectedIndex = -1; + } + return values; + } + } + }, + + attrFn: { + val: true, + css: true, + html: true, + text: true, + data: true, + width: true, + height: true, + offset: true + }, + + attrFix: { + // Always normalize to ensure hook usage + tabindex: "tabIndex" + }, + + attr: function( elem, name, value, pass ) { + var nType = elem.nodeType; + + // don't get/set attributes on text, comment and attribute nodes + if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { + return undefined; + } + + if ( pass && name in jQuery.attrFn ) { + return jQuery( elem )[ name ]( value ); + } + + // Fallback to prop when attributes are not supported + if ( !("getAttribute" in elem) ) { + return jQuery.prop( elem, name, value ); + } + + var ret, hooks, + notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); + + // Normalize the name if needed + if ( notxml ) { + name = jQuery.attrFix[ name ] || name; + + hooks = jQuery.attrHooks[ name ]; + + if ( !hooks ) { + // Use boolHook for boolean attributes + if ( rboolean.test( name ) ) { + hooks = boolHook; + + // Use nodeHook if available( IE6/7 ) + } else if ( nodeHook ) { + hooks = nodeHook; + } + } + } + + if ( value !== undefined ) { + + if ( value === null ) { + jQuery.removeAttr( elem, name ); + return undefined; + + } else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) { + return ret; + + } else { + elem.setAttribute( name, "" + value ); + return value; + } + + } else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) { + return ret; + + } else { + + ret = elem.getAttribute( name ); + + // Non-existent attributes return null, we normalize to undefined + return ret === null ? + undefined : + ret; + } + }, + + removeAttr: function( elem, name ) { + var propName; + if ( elem.nodeType === 1 ) { + name = jQuery.attrFix[ name ] || name; + + jQuery.attr( elem, name, "" ); + elem.removeAttribute( name ); + + // Set corresponding property to false for boolean attributes + if ( rboolean.test( name ) && (propName = jQuery.propFix[ name ] || name) in elem ) { + elem[ propName ] = false; + } + } + }, + + attrHooks: { + type: { + set: function( elem, value ) { + // We can't allow the type property to be changed (since it causes problems in IE) + if ( rtype.test( elem.nodeName ) && elem.parentNode ) { + jQuery.error( "type property can't be changed" ); + } else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) { + // Setting the type on a radio button after the value resets the value in IE6-9 + // Reset value to it's default in case type is set after value + // This is for element creation + var val = elem.value; + elem.setAttribute( "type", value ); + if ( val ) { + elem.value = val; + } + return value; + } + } + }, + // Use the value property for back compat + // Use the nodeHook for button elements in IE6/7 (#1954) + value: { + get: function( elem, name ) { + if ( nodeHook && jQuery.nodeName( elem, "button" ) ) { + return nodeHook.get( elem, name ); + } + return name in elem ? + elem.value : + null; + }, + set: function( elem, value, name ) { + if ( nodeHook && jQuery.nodeName( elem, "button" ) ) { + return nodeHook.set( elem, value, name ); + } + // Does not return so that setAttribute is also used + elem.value = value; + } + } + }, + + propFix: { + tabindex: "tabIndex", + readonly: "readOnly", + "for": "htmlFor", + "class": "className", + maxlength: "maxLength", + cellspacing: "cellSpacing", + cellpadding: "cellPadding", + rowspan: "rowSpan", + colspan: "colSpan", + usemap: "useMap", + frameborder: "frameBorder", + contenteditable: "contentEditable" + }, + + prop: function( elem, name, value ) { + var nType = elem.nodeType; + + // don't get/set properties on text, comment and attribute nodes + if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { + return undefined; + } + + var ret, hooks, + notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); + + if ( notxml ) { + // Fix name and attach hooks + name = jQuery.propFix[ name ] || name; + hooks = jQuery.propHooks[ name ]; + } + + if ( value !== undefined ) { + if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { + return ret; + + } else { + return (elem[ name ] = value); + } + + } else { + if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { + return ret; + + } else { + return elem[ name ]; + } + } + }, + + propHooks: { + tabIndex: { + get: function( elem ) { + // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set + // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ + var attributeNode = elem.getAttributeNode("tabindex"); + + return attributeNode && attributeNode.specified ? + parseInt( attributeNode.value, 10 ) : + rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? + 0 : + undefined; + } + } + } +}); + +// Add the tabindex propHook to attrHooks for back-compat +jQuery.attrHooks.tabIndex = jQuery.propHooks.tabIndex; + +// Hook for boolean attributes +boolHook = { + get: function( elem, name ) { + // Align boolean attributes with corresponding properties + // Fall back to attribute presence where some booleans are not supported + var attrNode; + return jQuery.prop( elem, name ) === true || ( attrNode = elem.getAttributeNode( name ) ) && attrNode.nodeValue !== false ? + name.toLowerCase() : + undefined; + }, + set: function( elem, value, name ) { + var propName; + if ( value === false ) { + // Remove boolean attributes when set to false + jQuery.removeAttr( elem, name ); + } else { + // value is true since we know at this point it's type boolean and not false + // Set boolean attributes to the same name and set the DOM property + propName = jQuery.propFix[ name ] || name; + if ( propName in elem ) { + // Only set the IDL specifically if it already exists on the element + elem[ propName ] = true; + } + + elem.setAttribute( name, name.toLowerCase() ); + } + return name; + } +}; + +// IE6/7 do not support getting/setting some attributes with get/setAttribute +if ( !jQuery.support.getSetAttribute ) { + + // Use this for any attribute in IE6/7 + // This fixes almost every IE6/7 issue + nodeHook = jQuery.valHooks.button = { + get: function( elem, name ) { + var ret; + ret = elem.getAttributeNode( name ); + // Return undefined if nodeValue is empty string + return ret && ret.nodeValue !== "" ? + ret.nodeValue : + undefined; + }, + set: function( elem, value, name ) { + // Set the existing or create a new attribute node + var ret = elem.getAttributeNode( name ); + if ( !ret ) { + ret = document.createAttribute( name ); + elem.setAttributeNode( ret ); + } + return (ret.nodeValue = value + ""); + } + }; + + // Set width and height to auto instead of 0 on empty string( Bug #8150 ) + // This is for removals + jQuery.each([ "width", "height" ], function( i, name ) { + jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { + set: function( elem, value ) { + if ( value === "" ) { + elem.setAttribute( name, "auto" ); + return value; + } + } + }); + }); +} + + +// Some attributes require a special call on IE +if ( !jQuery.support.hrefNormalized ) { + jQuery.each([ "href", "src", "width", "height" ], function( i, name ) { + jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { + get: function( elem ) { + var ret = elem.getAttribute( name, 2 ); + return ret === null ? undefined : ret; + } + }); + }); +} + +if ( !jQuery.support.style ) { + jQuery.attrHooks.style = { + get: function( elem ) { + // Return undefined in the case of empty string + // Normalize to lowercase since IE uppercases css property names + return elem.style.cssText.toLowerCase() || undefined; + }, + set: function( elem, value ) { + return (elem.style.cssText = "" + value); + } + }; +} + +// Safari mis-reports the default selected property of an option +// Accessing the parent's selectedIndex property fixes it +if ( !jQuery.support.optSelected ) { + jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, { + get: function( elem ) { + var parent = elem.parentNode; + + if ( parent ) { + parent.selectedIndex; + + // Make sure that it also works with optgroups, see #5701 + if ( parent.parentNode ) { + parent.parentNode.selectedIndex; + } + } + return null; + } + }); +} + +// Radios and checkboxes getter/setter +if ( !jQuery.support.checkOn ) { + jQuery.each([ "radio", "checkbox" ], function() { + jQuery.valHooks[ this ] = { + get: function( elem ) { + // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified + return elem.getAttribute("value") === null ? "on" : elem.value; + } + }; + }); +} +jQuery.each([ "radio", "checkbox" ], function() { + jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], { + set: function( elem, value ) { + if ( jQuery.isArray( value ) ) { + return (elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0); + } + } + }); +}); + + + + +var rnamespaces = /\.(.*)$/, + rformElems = /^(?:textarea|input|select)$/i, + rperiod = /\./g, + rspaces = / /g, + rescape = /[^\w\s.|`]/g, + fcleanup = function( nm ) { + return nm.replace(rescape, "\\$&"); + }; + +/* + * A number of helper functions used for managing events. + * Many of the ideas behind this code originated from + * Dean Edwards' addEvent library. + */ +jQuery.event = { + + // Bind an event to an element + // Original by Dean Edwards + add: function( elem, types, handler, data ) { + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + if ( handler === false ) { + handler = returnFalse; + } else if ( !handler ) { + // Fixes bug #7229. Fix recommended by jdalton + return; + } + + var handleObjIn, handleObj; + + if ( handler.handler ) { + handleObjIn = handler; + handler = handleObjIn.handler; + } + + // Make sure that the function being executed has a unique ID + if ( !handler.guid ) { + handler.guid = jQuery.guid++; + } + + // Init the element's event structure + var elemData = jQuery._data( elem ); + + // If no elemData is found then we must be trying to bind to one of the + // banned noData elements + if ( !elemData ) { + return; + } + + var events = elemData.events, + eventHandle = elemData.handle; + + if ( !events ) { + elemData.events = events = {}; + } + + if ( !eventHandle ) { + elemData.handle = eventHandle = function( e ) { + // Discard the second event of a jQuery.event.trigger() and + // when an event is called after a page has unloaded + return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ? + jQuery.event.handle.apply( eventHandle.elem, arguments ) : + undefined; + }; + } + + // Add elem as a property of the handle function + // This is to prevent a memory leak with non-native events in IE. + eventHandle.elem = elem; + + // Handle multiple events separated by a space + // jQuery(...).bind("mouseover mouseout", fn); + types = types.split(" "); + + var type, i = 0, namespaces; + + while ( (type = types[ i++ ]) ) { + handleObj = handleObjIn ? + jQuery.extend({}, handleObjIn) : + { handler: handler, data: data }; + + // Namespaced event handlers + if ( type.indexOf(".") > -1 ) { + namespaces = type.split("."); + type = namespaces.shift(); + handleObj.namespace = namespaces.slice(0).sort().join("."); + + } else { + namespaces = []; + handleObj.namespace = ""; + } + + handleObj.type = type; + if ( !handleObj.guid ) { + handleObj.guid = handler.guid; + } + + // Get the current list of functions bound to this event + var handlers = events[ type ], + special = jQuery.event.special[ type ] || {}; + + // Init the event handler queue + if ( !handlers ) { + handlers = events[ type ] = []; + + // Check for a special event handler + // Only use addEventListener/attachEvent if the special + // events handler returns false + if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { + // Bind the global event handler to the element + if ( elem.addEventListener ) { + elem.addEventListener( type, eventHandle, false ); + + } else if ( elem.attachEvent ) { + elem.attachEvent( "on" + type, eventHandle ); + } + } + } + + if ( special.add ) { + special.add.call( elem, handleObj ); + + if ( !handleObj.handler.guid ) { + handleObj.handler.guid = handler.guid; + } + } + + // Add the function to the element's handler list + handlers.push( handleObj ); + + // Keep track of which events have been used, for event optimization + jQuery.event.global[ type ] = true; + } + + // Nullify elem to prevent memory leaks in IE + elem = null; + }, + + global: {}, + + // Detach an event or set of events from an element + remove: function( elem, types, handler, pos ) { + // don't do events on text and comment nodes + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + if ( handler === false ) { + handler = returnFalse; + } + + var ret, type, fn, j, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType, + elemData = jQuery.hasData( elem ) && jQuery._data( elem ), + events = elemData && elemData.events; + + if ( !elemData || !events ) { + return; + } + + // types is actually an event object here + if ( types && types.type ) { + handler = types.handler; + types = types.type; + } + + // Unbind all events for the element + if ( !types || typeof types === "string" && types.charAt(0) === "." ) { + types = types || ""; + + for ( type in events ) { + jQuery.event.remove( elem, type + types ); + } + + return; + } + + // Handle multiple events separated by a space + // jQuery(...).unbind("mouseover mouseout", fn); + types = types.split(" "); + + while ( (type = types[ i++ ]) ) { + origType = type; + handleObj = null; + all = type.indexOf(".") < 0; + namespaces = []; + + if ( !all ) { + // Namespaced event handlers + namespaces = type.split("."); + type = namespaces.shift(); + + namespace = new RegExp("(^|\\.)" + + jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)"); + } + + eventType = events[ type ]; + + if ( !eventType ) { + continue; + } + + if ( !handler ) { + for ( j = 0; j < eventType.length; j++ ) { + handleObj = eventType[ j ]; + + if ( all || namespace.test( handleObj.namespace ) ) { + jQuery.event.remove( elem, origType, handleObj.handler, j ); + eventType.splice( j--, 1 ); + } + } + + continue; + } + + special = jQuery.event.special[ type ] || {}; + + for ( j = pos || 0; j < eventType.length; j++ ) { + handleObj = eventType[ j ]; + + if ( handler.guid === handleObj.guid ) { + // remove the given handler for the given type + if ( all || namespace.test( handleObj.namespace ) ) { + if ( pos == null ) { + eventType.splice( j--, 1 ); + } + + if ( special.remove ) { + special.remove.call( elem, handleObj ); + } + } + + if ( pos != null ) { + break; + } + } + } + + // remove generic event handler if no more handlers exist + if ( eventType.length === 0 || pos != null && eventType.length === 1 ) { + if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) { + jQuery.removeEvent( elem, type, elemData.handle ); + } + + ret = null; + delete events[ type ]; + } + } + + // Remove the expando if it's no longer used + if ( jQuery.isEmptyObject( events ) ) { + var handle = elemData.handle; + if ( handle ) { + handle.elem = null; + } + + delete elemData.events; + delete elemData.handle; + + if ( jQuery.isEmptyObject( elemData ) ) { + jQuery.removeData( elem, undefined, true ); + } + } + }, + + // Events that are safe to short-circuit if no handlers are attached. + // Native DOM events should not be added, they may have inline handlers. + customEvent: { + "getData": true, + "setData": true, + "changeData": true + }, + + trigger: function( event, data, elem, onlyHandlers ) { + // Event object or event type + var type = event.type || event, + namespaces = [], + exclusive; + + if ( type.indexOf("!") >= 0 ) { + // Exclusive events trigger only for the exact event (no namespaces) + type = type.slice(0, -1); + exclusive = true; + } + + if ( type.indexOf(".") >= 0 ) { + // Namespaced trigger; create a regexp to match event type in handle() + namespaces = type.split("."); + type = namespaces.shift(); + namespaces.sort(); + } + + if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) { + // No jQuery handlers for this event type, and it can't have inline handlers + return; + } + + // Caller can pass in an Event, Object, or just an event type string + event = typeof event === "object" ? + // jQuery.Event object + event[ jQuery.expando ] ? event : + // Object literal + new jQuery.Event( type, event ) : + // Just the event type (string) + new jQuery.Event( type ); + + event.type = type; + event.exclusive = exclusive; + event.namespace = namespaces.join("."); + event.namespace_re = new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)"); + + // triggerHandler() and global events don't bubble or run the default action + if ( onlyHandlers || !elem ) { + event.preventDefault(); + event.stopPropagation(); + } + + // Handle a global trigger + if ( !elem ) { + // TODO: Stop taunting the data cache; remove global events and always attach to document + jQuery.each( jQuery.cache, function() { + // internalKey variable is just used to make it easier to find + // and potentially change this stuff later; currently it just + // points to jQuery.expando + var internalKey = jQuery.expando, + internalCache = this[ internalKey ]; + if ( internalCache && internalCache.events && internalCache.events[ type ] ) { + jQuery.event.trigger( event, data, internalCache.handle.elem ); + } + }); + return; + } + + // Don't do events on text and comment nodes + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + // Clean up the event in case it is being reused + event.result = undefined; + event.target = elem; + + // Clone any incoming data and prepend the event, creating the handler arg list + data = data != null ? jQuery.makeArray( data ) : []; + data.unshift( event ); + + var cur = elem, + // IE doesn't like method names with a colon (#3533, #8272) + ontype = type.indexOf(":") < 0 ? "on" + type : ""; + + // Fire event on the current element, then bubble up the DOM tree + do { + var handle = jQuery._data( cur, "handle" ); + + event.currentTarget = cur; + if ( handle ) { + handle.apply( cur, data ); + } + + // Trigger an inline bound script + if ( ontype && jQuery.acceptData( cur ) && cur[ ontype ] && cur[ ontype ].apply( cur, data ) === false ) { + event.result = false; + event.preventDefault(); + } + + // Bubble up to document, then to window + cur = cur.parentNode || cur.ownerDocument || cur === event.target.ownerDocument && window; + } while ( cur && !event.isPropagationStopped() ); + + // If nobody prevented the default action, do it now + if ( !event.isDefaultPrevented() ) { + var old, + special = jQuery.event.special[ type ] || {}; + + if ( (!special._default || special._default.call( elem.ownerDocument, event ) === false) && + !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) { + + // Call a native DOM method on the target with the same name name as the event. + // Can't use an .isFunction)() check here because IE6/7 fails that test. + // IE<9 dies on focus to hidden element (#1486), may want to revisit a try/catch. + try { + if ( ontype && elem[ type ] ) { + // Don't re-trigger an onFOO event when we call its FOO() method + old = elem[ ontype ]; + + if ( old ) { + elem[ ontype ] = null; + } + + jQuery.event.triggered = type; + elem[ type ](); + } + } catch ( ieError ) {} + + if ( old ) { + elem[ ontype ] = old; + } + + jQuery.event.triggered = undefined; + } + } + + return event.result; + }, + + handle: function( event ) { + event = jQuery.event.fix( event || window.event ); + // Snapshot the handlers list since a called handler may add/remove events. + var handlers = ((jQuery._data( this, "events" ) || {})[ event.type ] || []).slice(0), + run_all = !event.exclusive && !event.namespace, + args = Array.prototype.slice.call( arguments, 0 ); + + // Use the fix-ed Event rather than the (read-only) native event + args[0] = event; + event.currentTarget = this; + + for ( var j = 0, l = handlers.length; j < l; j++ ) { + var handleObj = handlers[ j ]; + + // Triggered event must 1) be non-exclusive and have no namespace, or + // 2) have namespace(s) a subset or equal to those in the bound event. + if ( run_all || event.namespace_re.test( handleObj.namespace ) ) { + // Pass in a reference to the handler function itself + // So that we can later remove it + event.handler = handleObj.handler; + event.data = handleObj.data; + event.handleObj = handleObj; + + var ret = handleObj.handler.apply( this, args ); + + if ( ret !== undefined ) { + event.result = ret; + if ( ret === false ) { + event.preventDefault(); + event.stopPropagation(); + } + } + + if ( event.isImmediatePropagationStopped() ) { + break; + } + } + } + return event.result; + }, + + props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), + + fix: function( event ) { + if ( event[ jQuery.expando ] ) { + return event; + } + + // store a copy of the original event object + // and "clone" to set read-only properties + var originalEvent = event; + event = jQuery.Event( originalEvent ); + + for ( var i = this.props.length, prop; i; ) { + prop = this.props[ --i ]; + event[ prop ] = originalEvent[ prop ]; + } + + // Fix target property, if necessary + if ( !event.target ) { + // Fixes #1925 where srcElement might not be defined either + event.target = event.srcElement || document; + } + + // check if target is a textnode (safari) + if ( event.target.nodeType === 3 ) { + event.target = event.target.parentNode; + } + + // Add relatedTarget, if necessary + if ( !event.relatedTarget && event.fromElement ) { + event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement; + } + + // Calculate pageX/Y if missing and clientX/Y available + if ( event.pageX == null && event.clientX != null ) { + var eventDocument = event.target.ownerDocument || document, + doc = eventDocument.documentElement, + body = eventDocument.body; + + event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0); + event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0); + } + + // Add which for key events + if ( event.which == null && (event.charCode != null || event.keyCode != null) ) { + event.which = event.charCode != null ? event.charCode : event.keyCode; + } + + // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs) + if ( !event.metaKey && event.ctrlKey ) { + event.metaKey = event.ctrlKey; + } + + // Add which for click: 1 === left; 2 === middle; 3 === right + // Note: button is not normalized, so don't use it + if ( !event.which && event.button !== undefined ) { + event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) )); + } + + return event; + }, + + // Deprecated, use jQuery.guid instead + guid: 1E8, + + // Deprecated, use jQuery.proxy instead + proxy: jQuery.proxy, + + special: { + ready: { + // Make sure the ready event is setup + setup: jQuery.bindReady, + teardown: jQuery.noop + }, + + live: { + add: function( handleObj ) { + jQuery.event.add( this, + liveConvert( handleObj.origType, handleObj.selector ), + jQuery.extend({}, handleObj, {handler: liveHandler, guid: handleObj.handler.guid}) ); + }, + + remove: function( handleObj ) { + jQuery.event.remove( this, liveConvert( handleObj.origType, handleObj.selector ), handleObj ); + } + }, + + beforeunload: { + setup: function( data, namespaces, eventHandle ) { + // We only want to do this special case on windows + if ( jQuery.isWindow( this ) ) { + this.onbeforeunload = eventHandle; + } + }, + + teardown: function( namespaces, eventHandle ) { + if ( this.onbeforeunload === eventHandle ) { + this.onbeforeunload = null; + } + } + } + } +}; + +jQuery.removeEvent = document.removeEventListener ? + function( elem, type, handle ) { + if ( elem.removeEventListener ) { + elem.removeEventListener( type, handle, false ); + } + } : + function( elem, type, handle ) { + if ( elem.detachEvent ) { + elem.detachEvent( "on" + type, handle ); + } + }; + +jQuery.Event = function( src, props ) { + // Allow instantiation without the 'new' keyword + if ( !this.preventDefault ) { + return new jQuery.Event( src, props ); + } + + // Event object + if ( src && src.type ) { + this.originalEvent = src; + this.type = src.type; + + // Events bubbling up the document may have been marked as prevented + // by a handler lower down the tree; reflect the correct value. + this.isDefaultPrevented = (src.defaultPrevented || src.returnValue === false || + src.getPreventDefault && src.getPreventDefault()) ? returnTrue : returnFalse; + + // Event type + } else { + this.type = src; + } + + // Put explicitly provided properties onto the event object + if ( props ) { + jQuery.extend( this, props ); + } + + // timeStamp is buggy for some events on Firefox(#3843) + // So we won't rely on the native value + this.timeStamp = jQuery.now(); + + // Mark it as fixed + this[ jQuery.expando ] = true; +}; + +function returnFalse() { + return false; +} +function returnTrue() { + return true; +} + +// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding +// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +jQuery.Event.prototype = { + preventDefault: function() { + this.isDefaultPrevented = returnTrue; + + var e = this.originalEvent; + if ( !e ) { + return; + } + + // if preventDefault exists run it on the original event + if ( e.preventDefault ) { + e.preventDefault(); + + // otherwise set the returnValue property of the original event to false (IE) + } else { + e.returnValue = false; + } + }, + stopPropagation: function() { + this.isPropagationStopped = returnTrue; + + var e = this.originalEvent; + if ( !e ) { + return; + } + // if stopPropagation exists run it on the original event + if ( e.stopPropagation ) { + e.stopPropagation(); + } + // otherwise set the cancelBubble property of the original event to true (IE) + e.cancelBubble = true; + }, + stopImmediatePropagation: function() { + this.isImmediatePropagationStopped = returnTrue; + this.stopPropagation(); + }, + isDefaultPrevented: returnFalse, + isPropagationStopped: returnFalse, + isImmediatePropagationStopped: returnFalse +}; + +// Checks if an event happened on an element within another element +// Used in jQuery.event.special.mouseenter and mouseleave handlers +var withinElement = function( event ) { + + // Check if mouse(over|out) are still within the same parent element + var related = event.relatedTarget, + inside = false, + eventType = event.type; + + event.type = event.data; + + if ( related !== this ) { + + if ( related ) { + inside = jQuery.contains( this, related ); + } + + if ( !inside ) { + + jQuery.event.handle.apply( this, arguments ); + + event.type = eventType; + } + } +}, + +// In case of event delegation, we only need to rename the event.type, +// liveHandler will take care of the rest. +delegate = function( event ) { + event.type = event.data; + jQuery.event.handle.apply( this, arguments ); +}; + +// Create mouseenter and mouseleave events +jQuery.each({ + mouseenter: "mouseover", + mouseleave: "mouseout" +}, function( orig, fix ) { + jQuery.event.special[ orig ] = { + setup: function( data ) { + jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig ); + }, + teardown: function( data ) { + jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement ); + } + }; +}); + +// submit delegation +if ( !jQuery.support.submitBubbles ) { + + jQuery.event.special.submit = { + setup: function( data, namespaces ) { + if ( !jQuery.nodeName( this, "form" ) ) { + jQuery.event.add(this, "click.specialSubmit", function( e ) { + // Avoid triggering error on non-existent type attribute in IE VML (#7071) + var elem = e.target, + type = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.type : ""; + + if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) { + trigger( "submit", this, arguments ); + } + }); + + jQuery.event.add(this, "keypress.specialSubmit", function( e ) { + var elem = e.target, + type = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.type : ""; + + if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) { + trigger( "submit", this, arguments ); + } + }); + + } else { + return false; + } + }, + + teardown: function( namespaces ) { + jQuery.event.remove( this, ".specialSubmit" ); + } + }; + +} + +// change delegation, happens here so we have bind. +if ( !jQuery.support.changeBubbles ) { + + var changeFilters, + + getVal = function( elem ) { + var type = jQuery.nodeName( elem, "input" ) ? elem.type : "", + val = elem.value; + + if ( type === "radio" || type === "checkbox" ) { + val = elem.checked; + + } else if ( type === "select-multiple" ) { + val = elem.selectedIndex > -1 ? + jQuery.map( elem.options, function( elem ) { + return elem.selected; + }).join("-") : + ""; + + } else if ( jQuery.nodeName( elem, "select" ) ) { + val = elem.selectedIndex; + } + + return val; + }, + + testChange = function testChange( e ) { + var elem = e.target, data, val; + + if ( !rformElems.test( elem.nodeName ) || elem.readOnly ) { + return; + } + + data = jQuery._data( elem, "_change_data" ); + val = getVal(elem); + + // the current data will be also retrieved by beforeactivate + if ( e.type !== "focusout" || elem.type !== "radio" ) { + jQuery._data( elem, "_change_data", val ); + } + + if ( data === undefined || val === data ) { + return; + } + + if ( data != null || val ) { + e.type = "change"; + e.liveFired = undefined; + jQuery.event.trigger( e, arguments[1], elem ); + } + }; + + jQuery.event.special.change = { + filters: { + focusout: testChange, + + beforedeactivate: testChange, + + click: function( e ) { + var elem = e.target, type = jQuery.nodeName( elem, "input" ) ? elem.type : ""; + + if ( type === "radio" || type === "checkbox" || jQuery.nodeName( elem, "select" ) ) { + testChange.call( this, e ); + } + }, + + // Change has to be called before submit + // Keydown will be called before keypress, which is used in submit-event delegation + keydown: function( e ) { + var elem = e.target, type = jQuery.nodeName( elem, "input" ) ? elem.type : ""; + + if ( (e.keyCode === 13 && !jQuery.nodeName( elem, "textarea" ) ) || + (e.keyCode === 32 && (type === "checkbox" || type === "radio")) || + type === "select-multiple" ) { + testChange.call( this, e ); + } + }, + + // Beforeactivate happens also before the previous element is blurred + // with this event you can't trigger a change event, but you can store + // information + beforeactivate: function( e ) { + var elem = e.target; + jQuery._data( elem, "_change_data", getVal(elem) ); + } + }, + + setup: function( data, namespaces ) { + if ( this.type === "file" ) { + return false; + } + + for ( var type in changeFilters ) { + jQuery.event.add( this, type + ".specialChange", changeFilters[type] ); + } + + return rformElems.test( this.nodeName ); + }, + + teardown: function( namespaces ) { + jQuery.event.remove( this, ".specialChange" ); + + return rformElems.test( this.nodeName ); + } + }; + + changeFilters = jQuery.event.special.change.filters; + + // Handle when the input is .focus()'d + changeFilters.focus = changeFilters.beforeactivate; +} + +function trigger( type, elem, args ) { + // Piggyback on a donor event to simulate a different one. + // Fake originalEvent to avoid donor's stopPropagation, but if the + // simulated event prevents default then we do the same on the donor. + // Don't pass args or remember liveFired; they apply to the donor event. + var event = jQuery.extend( {}, args[ 0 ] ); + event.type = type; + event.originalEvent = {}; + event.liveFired = undefined; + jQuery.event.handle.call( elem, event ); + if ( event.isDefaultPrevented() ) { + args[ 0 ].preventDefault(); + } +} + +// Create "bubbling" focus and blur events +if ( !jQuery.support.focusinBubbles ) { + jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { + + // Attach a single capturing handler while someone wants focusin/focusout + var attaches = 0; + + jQuery.event.special[ fix ] = { + setup: function() { + if ( attaches++ === 0 ) { + document.addEventListener( orig, handler, true ); + } + }, + teardown: function() { + if ( --attaches === 0 ) { + document.removeEventListener( orig, handler, true ); + } + } + }; + + function handler( donor ) { + // Donor event is always a native one; fix it and switch its type. + // Let focusin/out handler cancel the donor focus/blur event. + var e = jQuery.event.fix( donor ); + e.type = fix; + e.originalEvent = {}; + jQuery.event.trigger( e, null, e.target ); + if ( e.isDefaultPrevented() ) { + donor.preventDefault(); + } + } + }); +} + +jQuery.each(["bind", "one"], function( i, name ) { + jQuery.fn[ name ] = function( type, data, fn ) { + var handler; + + // Handle object literals + if ( typeof type === "object" ) { + for ( var key in type ) { + this[ name ](key, data, type[key], fn); + } + return this; + } + + if ( arguments.length === 2 || data === false ) { + fn = data; + data = undefined; + } + + if ( name === "one" ) { + handler = function( event ) { + jQuery( this ).unbind( event, handler ); + return fn.apply( this, arguments ); + }; + handler.guid = fn.guid || jQuery.guid++; + } else { + handler = fn; + } + + if ( type === "unload" && name !== "one" ) { + this.one( type, data, fn ); + + } else { + for ( var i = 0, l = this.length; i < l; i++ ) { + jQuery.event.add( this[i], type, handler, data ); + } + } + + return this; + }; +}); + +jQuery.fn.extend({ + unbind: function( type, fn ) { + // Handle object literals + if ( typeof type === "object" && !type.preventDefault ) { + for ( var key in type ) { + this.unbind(key, type[key]); + } + + } else { + for ( var i = 0, l = this.length; i < l; i++ ) { + jQuery.event.remove( this[i], type, fn ); + } + } + + return this; + }, + + delegate: function( selector, types, data, fn ) { + return this.live( types, data, fn, selector ); + }, + + undelegate: function( selector, types, fn ) { + if ( arguments.length === 0 ) { + return this.unbind( "live" ); + + } else { + return this.die( types, null, fn, selector ); + } + }, + + trigger: function( type, data ) { + return this.each(function() { + jQuery.event.trigger( type, data, this ); + }); + }, + + triggerHandler: function( type, data ) { + if ( this[0] ) { + return jQuery.event.trigger( type, data, this[0], true ); + } + }, + + toggle: function( fn ) { + // Save reference to arguments for access in closure + var args = arguments, + guid = fn.guid || jQuery.guid++, + i = 0, + toggler = function( event ) { + // Figure out which function to execute + var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i; + jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 ); + + // Make sure that clicks stop + event.preventDefault(); + + // and execute the function + return args[ lastToggle ].apply( this, arguments ) || false; + }; + + // link all the functions, so any of them can unbind this click handler + toggler.guid = guid; + while ( i < args.length ) { + args[ i++ ].guid = guid; + } + + return this.click( toggler ); + }, + + hover: function( fnOver, fnOut ) { + return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); + } +}); + +var liveMap = { + focus: "focusin", + blur: "focusout", + mouseenter: "mouseover", + mouseleave: "mouseout" +}; + +jQuery.each(["live", "die"], function( i, name ) { + jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) { + var type, i = 0, match, namespaces, preType, + selector = origSelector || this.selector, + context = origSelector ? this : jQuery( this.context ); + + if ( typeof types === "object" && !types.preventDefault ) { + for ( var key in types ) { + context[ name ]( key, data, types[key], selector ); + } + + return this; + } + + if ( name === "die" && !types && + origSelector && origSelector.charAt(0) === "." ) { + + context.unbind( origSelector ); + + return this; + } + + if ( data === false || jQuery.isFunction( data ) ) { + fn = data || returnFalse; + data = undefined; + } + + types = (types || "").split(" "); + + while ( (type = types[ i++ ]) != null ) { + match = rnamespaces.exec( type ); + namespaces = ""; + + if ( match ) { + namespaces = match[0]; + type = type.replace( rnamespaces, "" ); + } + + if ( type === "hover" ) { + types.push( "mouseenter" + namespaces, "mouseleave" + namespaces ); + continue; + } + + preType = type; + + if ( liveMap[ type ] ) { + types.push( liveMap[ type ] + namespaces ); + type = type + namespaces; + + } else { + type = (liveMap[ type ] || type) + namespaces; + } + + if ( name === "live" ) { + // bind live handler + for ( var j = 0, l = context.length; j < l; j++ ) { + jQuery.event.add( context[j], "live." + liveConvert( type, selector ), + { data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } ); + } + + } else { + // unbind live handler + context.unbind( "live." + liveConvert( type, selector ), fn ); + } + } + + return this; + }; +}); + +function liveHandler( event ) { + var stop, maxLevel, related, match, handleObj, elem, j, i, l, data, close, namespace, ret, + elems = [], + selectors = [], + events = jQuery._data( this, "events" ); + + // Make sure we avoid non-left-click bubbling in Firefox (#3861) and disabled elements in IE (#6911) + if ( event.liveFired === this || !events || !events.live || event.target.disabled || event.button && event.type === "click" ) { + return; + } + + if ( event.namespace ) { + namespace = new RegExp("(^|\\.)" + event.namespace.split(".").join("\\.(?:.*\\.)?") + "(\\.|$)"); + } + + event.liveFired = this; + + var live = events.live.slice(0); + + for ( j = 0; j < live.length; j++ ) { + handleObj = live[j]; + + if ( handleObj.origType.replace( rnamespaces, "" ) === event.type ) { + selectors.push( handleObj.selector ); + + } else { + live.splice( j--, 1 ); + } + } + + match = jQuery( event.target ).closest( selectors, event.currentTarget ); + + for ( i = 0, l = match.length; i < l; i++ ) { + close = match[i]; + + for ( j = 0; j < live.length; j++ ) { + handleObj = live[j]; + + if ( close.selector === handleObj.selector && (!namespace || namespace.test( handleObj.namespace )) && !close.elem.disabled ) { + elem = close.elem; + related = null; + + // Those two events require additional checking + if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) { + event.type = handleObj.preType; + related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0]; + + // Make sure not to accidentally match a child element with the same selector + if ( related && jQuery.contains( elem, related ) ) { + related = elem; + } + } + + if ( !related || related !== elem ) { + elems.push({ elem: elem, handleObj: handleObj, level: close.level }); + } + } + } + } + + for ( i = 0, l = elems.length; i < l; i++ ) { + match = elems[i]; + + if ( maxLevel && match.level > maxLevel ) { + break; + } + + event.currentTarget = match.elem; + event.data = match.handleObj.data; + event.handleObj = match.handleObj; + + ret = match.handleObj.origHandler.apply( match.elem, arguments ); + + if ( ret === false || event.isPropagationStopped() ) { + maxLevel = match.level; + + if ( ret === false ) { + stop = false; + } + if ( event.isImmediatePropagationStopped() ) { + break; + } + } + } + + return stop; +} + +function liveConvert( type, selector ) { + return (type && type !== "*" ? type + "." : "") + selector.replace(rperiod, "`").replace(rspaces, "&"); +} + +jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + + "change select submit keydown keypress keyup error").split(" "), function( i, name ) { + + // Handle event binding + jQuery.fn[ name ] = function( data, fn ) { + if ( fn == null ) { + fn = data; + data = null; + } + + return arguments.length > 0 ? + this.bind( name, data, fn ) : + this.trigger( name ); + }; + + if ( jQuery.attrFn ) { + jQuery.attrFn[ name ] = true; + } +}); + + + +/*! + * Sizzle CSS Selector Engine + * Copyright 2011, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * More information: http://sizzlejs.com/ + */ +(function(){ + +var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, + done = 0, + toString = Object.prototype.toString, + hasDuplicate = false, + baseHasDuplicate = true, + rBackslash = /\\/g, + rNonWord = /\W/; + +// Here we check if the JavaScript engine is using some sort of +// optimization where it does not always call our comparision +// function. If that is the case, discard the hasDuplicate value. +// Thus far that includes Google Chrome. +[0, 0].sort(function() { + baseHasDuplicate = false; + return 0; +}); + +var Sizzle = function( selector, context, results, seed ) { + results = results || []; + context = context || document; + + var origContext = context; + + if ( context.nodeType !== 1 && context.nodeType !== 9 ) { + return []; + } + + if ( !selector || typeof selector !== "string" ) { + return results; + } + + var m, set, checkSet, extra, ret, cur, pop, i, + prune = true, + contextXML = Sizzle.isXML( context ), + parts = [], + soFar = selector; + + // Reset the position of the chunker regexp (start from head) + do { + chunker.exec( "" ); + m = chunker.exec( soFar ); + + if ( m ) { + soFar = m[3]; + + parts.push( m[1] ); + + if ( m[2] ) { + extra = m[3]; + break; + } + } + } while ( m ); + + if ( parts.length > 1 && origPOS.exec( selector ) ) { + + if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { + set = posProcess( parts[0] + parts[1], context ); + + } else { + set = Expr.relative[ parts[0] ] ? + [ context ] : + Sizzle( parts.shift(), context ); + + while ( parts.length ) { + selector = parts.shift(); + + if ( Expr.relative[ selector ] ) { + selector += parts.shift(); + } + + set = posProcess( selector, set ); + } + } + + } else { + // Take a shortcut and set the context if the root selector is an ID + // (but not if it'll be faster if the inner selector is an ID) + if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML && + Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) { + + ret = Sizzle.find( parts.shift(), context, contextXML ); + context = ret.expr ? + Sizzle.filter( ret.expr, ret.set )[0] : + ret.set[0]; + } + + if ( context ) { + ret = seed ? + { expr: parts.pop(), set: makeArray(seed) } : + Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML ); + + set = ret.expr ? + Sizzle.filter( ret.expr, ret.set ) : + ret.set; + + if ( parts.length > 0 ) { + checkSet = makeArray( set ); + + } else { + prune = false; + } + + while ( parts.length ) { + cur = parts.pop(); + pop = cur; + + if ( !Expr.relative[ cur ] ) { + cur = ""; + } else { + pop = parts.pop(); + } + + if ( pop == null ) { + pop = context; + } + + Expr.relative[ cur ]( checkSet, pop, contextXML ); + } + + } else { + checkSet = parts = []; + } + } + + if ( !checkSet ) { + checkSet = set; + } + + if ( !checkSet ) { + Sizzle.error( cur || selector ); + } + + if ( toString.call(checkSet) === "[object Array]" ) { + if ( !prune ) { + results.push.apply( results, checkSet ); + + } else if ( context && context.nodeType === 1 ) { + for ( i = 0; checkSet[i] != null; i++ ) { + if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) { + results.push( set[i] ); + } + } + + } else { + for ( i = 0; checkSet[i] != null; i++ ) { + if ( checkSet[i] && checkSet[i].nodeType === 1 ) { + results.push( set[i] ); + } + } + } + + } else { + makeArray( checkSet, results ); + } + + if ( extra ) { + Sizzle( extra, origContext, results, seed ); + Sizzle.uniqueSort( results ); + } + + return results; +}; + +Sizzle.uniqueSort = function( results ) { + if ( sortOrder ) { + hasDuplicate = baseHasDuplicate; + results.sort( sortOrder ); + + if ( hasDuplicate ) { + for ( var i = 1; i < results.length; i++ ) { + if ( results[i] === results[ i - 1 ] ) { + results.splice( i--, 1 ); + } + } + } + } + + return results; +}; + +Sizzle.matches = function( expr, set ) { + return Sizzle( expr, null, null, set ); +}; + +Sizzle.matchesSelector = function( node, expr ) { + return Sizzle( expr, null, null, [node] ).length > 0; +}; + +Sizzle.find = function( expr, context, isXML ) { + var set; + + if ( !expr ) { + return []; + } + + for ( var i = 0, l = Expr.order.length; i < l; i++ ) { + var match, + type = Expr.order[i]; + + if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { + var left = match[1]; + match.splice( 1, 1 ); + + if ( left.substr( left.length - 1 ) !== "\\" ) { + match[1] = (match[1] || "").replace( rBackslash, "" ); + set = Expr.find[ type ]( match, context, isXML ); + + if ( set != null ) { + expr = expr.replace( Expr.match[ type ], "" ); + break; + } + } + } + } + + if ( !set ) { + set = typeof context.getElementsByTagName !== "undefined" ? + context.getElementsByTagName( "*" ) : + []; + } + + return { set: set, expr: expr }; +}; + +Sizzle.filter = function( expr, set, inplace, not ) { + var match, anyFound, + old = expr, + result = [], + curLoop = set, + isXMLFilter = set && set[0] && Sizzle.isXML( set[0] ); + + while ( expr && set.length ) { + for ( var type in Expr.filter ) { + if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) { + var found, item, + filter = Expr.filter[ type ], + left = match[1]; + + anyFound = false; + + match.splice(1,1); + + if ( left.substr( left.length - 1 ) === "\\" ) { + continue; + } + + if ( curLoop === result ) { + result = []; + } + + if ( Expr.preFilter[ type ] ) { + match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); + + if ( !match ) { + anyFound = found = true; + + } else if ( match === true ) { + continue; + } + } + + if ( match ) { + for ( var i = 0; (item = curLoop[i]) != null; i++ ) { + if ( item ) { + found = filter( item, match, i, curLoop ); + var pass = not ^ !!found; + + if ( inplace && found != null ) { + if ( pass ) { + anyFound = true; + + } else { + curLoop[i] = false; + } + + } else if ( pass ) { + result.push( item ); + anyFound = true; + } + } + } + } + + if ( found !== undefined ) { + if ( !inplace ) { + curLoop = result; + } + + expr = expr.replace( Expr.match[ type ], "" ); + + if ( !anyFound ) { + return []; + } + + break; + } + } + } + + // Improper expression + if ( expr === old ) { + if ( anyFound == null ) { + Sizzle.error( expr ); + + } else { + break; + } + } + + old = expr; + } + + return curLoop; +}; + +Sizzle.error = function( msg ) { + throw "Syntax error, unrecognized expression: " + msg; +}; + +var Expr = Sizzle.selectors = { + order: [ "ID", "NAME", "TAG" ], + + match: { + ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, + CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, + NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/, + ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/, + TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/, + CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/, + POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/, + PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ + }, + + leftMatch: {}, + + attrMap: { + "class": "className", + "for": "htmlFor" + }, + + attrHandle: { + href: function( elem ) { + return elem.getAttribute( "href" ); + }, + type: function( elem ) { + return elem.getAttribute( "type" ); + } + }, + + relative: { + "+": function(checkSet, part){ + var isPartStr = typeof part === "string", + isTag = isPartStr && !rNonWord.test( part ), + isPartStrNotTag = isPartStr && !isTag; + + if ( isTag ) { + part = part.toLowerCase(); + } + + for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { + if ( (elem = checkSet[i]) ) { + while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {} + + checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ? + elem || false : + elem === part; + } + } + + if ( isPartStrNotTag ) { + Sizzle.filter( part, checkSet, true ); + } + }, + + ">": function( checkSet, part ) { + var elem, + isPartStr = typeof part === "string", + i = 0, + l = checkSet.length; + + if ( isPartStr && !rNonWord.test( part ) ) { + part = part.toLowerCase(); + + for ( ; i < l; i++ ) { + elem = checkSet[i]; + + if ( elem ) { + var parent = elem.parentNode; + checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false; + } + } + + } else { + for ( ; i < l; i++ ) { + elem = checkSet[i]; + + if ( elem ) { + checkSet[i] = isPartStr ? + elem.parentNode : + elem.parentNode === part; + } + } + + if ( isPartStr ) { + Sizzle.filter( part, checkSet, true ); + } + } + }, + + "": function(checkSet, part, isXML){ + var nodeCheck, + doneName = done++, + checkFn = dirCheck; + + if ( typeof part === "string" && !rNonWord.test( part ) ) { + part = part.toLowerCase(); + nodeCheck = part; + checkFn = dirNodeCheck; + } + + checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML ); + }, + + "~": function( checkSet, part, isXML ) { + var nodeCheck, + doneName = done++, + checkFn = dirCheck; + + if ( typeof part === "string" && !rNonWord.test( part ) ) { + part = part.toLowerCase(); + nodeCheck = part; + checkFn = dirNodeCheck; + } + + checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML ); + } + }, + + find: { + ID: function( match, context, isXML ) { + if ( typeof context.getElementById !== "undefined" && !isXML ) { + var m = context.getElementById(match[1]); + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + return m && m.parentNode ? [m] : []; + } + }, + + NAME: function( match, context ) { + if ( typeof context.getElementsByName !== "undefined" ) { + var ret = [], + results = context.getElementsByName( match[1] ); + + for ( var i = 0, l = results.length; i < l; i++ ) { + if ( results[i].getAttribute("name") === match[1] ) { + ret.push( results[i] ); + } + } + + return ret.length === 0 ? null : ret; + } + }, + + TAG: function( match, context ) { + if ( typeof context.getElementsByTagName !== "undefined" ) { + return context.getElementsByTagName( match[1] ); + } + } + }, + preFilter: { + CLASS: function( match, curLoop, inplace, result, not, isXML ) { + match = " " + match[1].replace( rBackslash, "" ) + " "; + + if ( isXML ) { + return match; + } + + for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { + if ( elem ) { + if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) { + if ( !inplace ) { + result.push( elem ); + } + + } else if ( inplace ) { + curLoop[i] = false; + } + } + } + + return false; + }, + + ID: function( match ) { + return match[1].replace( rBackslash, "" ); + }, + + TAG: function( match, curLoop ) { + return match[1].replace( rBackslash, "" ).toLowerCase(); + }, + + CHILD: function( match ) { + if ( match[1] === "nth" ) { + if ( !match[2] ) { + Sizzle.error( match[0] ); + } + + match[2] = match[2].replace(/^\+|\s*/g, ''); + + // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' + var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec( + match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" || + !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); + + // calculate the numbers (first)n+(last) including if they are negative + match[2] = (test[1] + (test[2] || 1)) - 0; + match[3] = test[3] - 0; + } + else if ( match[2] ) { + Sizzle.error( match[0] ); + } + + // TODO: Move to normal caching system + match[0] = done++; + + return match; + }, + + ATTR: function( match, curLoop, inplace, result, not, isXML ) { + var name = match[1] = match[1].replace( rBackslash, "" ); + + if ( !isXML && Expr.attrMap[name] ) { + match[1] = Expr.attrMap[name]; + } + + // Handle if an un-quoted value was used + match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" ); + + if ( match[2] === "~=" ) { + match[4] = " " + match[4] + " "; + } + + return match; + }, + + PSEUDO: function( match, curLoop, inplace, result, not ) { + if ( match[1] === "not" ) { + // If we're dealing with a complex expression, or a simple one + if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) { + match[3] = Sizzle(match[3], null, null, curLoop); + + } else { + var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); + + if ( !inplace ) { + result.push.apply( result, ret ); + } + + return false; + } + + } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { + return true; + } + + return match; + }, + + POS: function( match ) { + match.unshift( true ); + + return match; + } + }, + + filters: { + enabled: function( elem ) { + return elem.disabled === false && elem.type !== "hidden"; + }, + + disabled: function( elem ) { + return elem.disabled === true; + }, + + checked: function( elem ) { + return elem.checked === true; + }, + + selected: function( elem ) { + // Accessing this property makes selected-by-default + // options in Safari work properly + if ( elem.parentNode ) { + elem.parentNode.selectedIndex; + } + + return elem.selected === true; + }, + + parent: function( elem ) { + return !!elem.firstChild; + }, + + empty: function( elem ) { + return !elem.firstChild; + }, + + has: function( elem, i, match ) { + return !!Sizzle( match[3], elem ).length; + }, + + header: function( elem ) { + return (/h\d/i).test( elem.nodeName ); + }, + + text: function( elem ) { + var attr = elem.getAttribute( "type" ), type = elem.type; + // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) + // use getAttribute instead to test this case + return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null ); + }, + + radio: function( elem ) { + return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type; + }, + + checkbox: function( elem ) { + return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type; + }, + + file: function( elem ) { + return elem.nodeName.toLowerCase() === "input" && "file" === elem.type; + }, + + password: function( elem ) { + return elem.nodeName.toLowerCase() === "input" && "password" === elem.type; + }, + + submit: function( elem ) { + var name = elem.nodeName.toLowerCase(); + return (name === "input" || name === "button") && "submit" === elem.type; + }, + + image: function( elem ) { + return elem.nodeName.toLowerCase() === "input" && "image" === elem.type; + }, + + reset: function( elem ) { + var name = elem.nodeName.toLowerCase(); + return (name === "input" || name === "button") && "reset" === elem.type; + }, + + button: function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && "button" === elem.type || name === "button"; + }, + + input: function( elem ) { + return (/input|select|textarea|button/i).test( elem.nodeName ); + }, + + focus: function( elem ) { + return elem === elem.ownerDocument.activeElement; + } + }, + setFilters: { + first: function( elem, i ) { + return i === 0; + }, + + last: function( elem, i, match, array ) { + return i === array.length - 1; + }, + + even: function( elem, i ) { + return i % 2 === 0; + }, + + odd: function( elem, i ) { + return i % 2 === 1; + }, + + lt: function( elem, i, match ) { + return i < match[3] - 0; + }, + + gt: function( elem, i, match ) { + return i > match[3] - 0; + }, + + nth: function( elem, i, match ) { + return match[3] - 0 === i; + }, + + eq: function( elem, i, match ) { + return match[3] - 0 === i; + } + }, + filter: { + PSEUDO: function( elem, match, i, array ) { + var name = match[1], + filter = Expr.filters[ name ]; + + if ( filter ) { + return filter( elem, i, match, array ); + + } else if ( name === "contains" ) { + return (elem.textContent || elem.innerText || Sizzle.getText([ elem ]) || "").indexOf(match[3]) >= 0; + + } else if ( name === "not" ) { + var not = match[3]; + + for ( var j = 0, l = not.length; j < l; j++ ) { + if ( not[j] === elem ) { + return false; + } + } + + return true; + + } else { + Sizzle.error( name ); + } + }, + + CHILD: function( elem, match ) { + var type = match[1], + node = elem; + + switch ( type ) { + case "only": + case "first": + while ( (node = node.previousSibling) ) { + if ( node.nodeType === 1 ) { + return false; + } + } + + if ( type === "first" ) { + return true; + } + + node = elem; + + case "last": + while ( (node = node.nextSibling) ) { + if ( node.nodeType === 1 ) { + return false; + } + } + + return true; + + case "nth": + var first = match[2], + last = match[3]; + + if ( first === 1 && last === 0 ) { + return true; + } + + var doneName = match[0], + parent = elem.parentNode; + + if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) { + var count = 0; + + for ( node = parent.firstChild; node; node = node.nextSibling ) { + if ( node.nodeType === 1 ) { + node.nodeIndex = ++count; + } + } + + parent.sizcache = doneName; + } + + var diff = elem.nodeIndex - last; + + if ( first === 0 ) { + return diff === 0; + + } else { + return ( diff % first === 0 && diff / first >= 0 ); + } + } + }, + + ID: function( elem, match ) { + return elem.nodeType === 1 && elem.getAttribute("id") === match; + }, + + TAG: function( elem, match ) { + return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match; + }, + + CLASS: function( elem, match ) { + return (" " + (elem.className || elem.getAttribute("class")) + " ") + .indexOf( match ) > -1; + }, + + ATTR: function( elem, match ) { + var name = match[1], + result = Expr.attrHandle[ name ] ? + Expr.attrHandle[ name ]( elem ) : + elem[ name ] != null ? + elem[ name ] : + elem.getAttribute( name ), + value = result + "", + type = match[2], + check = match[4]; + + return result == null ? + type === "!=" : + type === "=" ? + value === check : + type === "*=" ? + value.indexOf(check) >= 0 : + type === "~=" ? + (" " + value + " ").indexOf(check) >= 0 : + !check ? + value && result !== false : + type === "!=" ? + value !== check : + type === "^=" ? + value.indexOf(check) === 0 : + type === "$=" ? + value.substr(value.length - check.length) === check : + type === "|=" ? + value === check || value.substr(0, check.length + 1) === check + "-" : + false; + }, + + POS: function( elem, match, i, array ) { + var name = match[2], + filter = Expr.setFilters[ name ]; + + if ( filter ) { + return filter( elem, i, match, array ); + } + } + } +}; + +var origPOS = Expr.match.POS, + fescape = function(all, num){ + return "\\" + (num - 0 + 1); + }; + +for ( var type in Expr.match ) { + Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) ); + Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) ); +} + +var makeArray = function( array, results ) { + array = Array.prototype.slice.call( array, 0 ); + + if ( results ) { + results.push.apply( results, array ); + return results; + } + + return array; +}; + +// Perform a simple check to determine if the browser is capable of +// converting a NodeList to an array using builtin methods. +// Also verifies that the returned array holds DOM nodes +// (which is not the case in the Blackberry browser) +try { + Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType; + +// Provide a fallback method if it does not work +} catch( e ) { + makeArray = function( array, results ) { + var i = 0, + ret = results || []; + + if ( toString.call(array) === "[object Array]" ) { + Array.prototype.push.apply( ret, array ); + + } else { + if ( typeof array.length === "number" ) { + for ( var l = array.length; i < l; i++ ) { + ret.push( array[i] ); + } + + } else { + for ( ; array[i]; i++ ) { + ret.push( array[i] ); + } + } + } + + return ret; + }; +} + +var sortOrder, siblingCheck; + +if ( document.documentElement.compareDocumentPosition ) { + sortOrder = function( a, b ) { + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) { + return a.compareDocumentPosition ? -1 : 1; + } + + return a.compareDocumentPosition(b) & 4 ? -1 : 1; + }; + +} else { + sortOrder = function( a, b ) { + // The nodes are identical, we can exit early + if ( a === b ) { + hasDuplicate = true; + return 0; + + // Fallback to using sourceIndex (in IE) if it's available on both nodes + } else if ( a.sourceIndex && b.sourceIndex ) { + return a.sourceIndex - b.sourceIndex; + } + + var al, bl, + ap = [], + bp = [], + aup = a.parentNode, + bup = b.parentNode, + cur = aup; + + // If the nodes are siblings (or identical) we can do a quick check + if ( aup === bup ) { + return siblingCheck( a, b ); + + // If no parents were found then the nodes are disconnected + } else if ( !aup ) { + return -1; + + } else if ( !bup ) { + return 1; + } + + // Otherwise they're somewhere else in the tree so we need + // to build up a full list of the parentNodes for comparison + while ( cur ) { + ap.unshift( cur ); + cur = cur.parentNode; + } + + cur = bup; + + while ( cur ) { + bp.unshift( cur ); + cur = cur.parentNode; + } + + al = ap.length; + bl = bp.length; + + // Start walking down the tree looking for a discrepancy + for ( var i = 0; i < al && i < bl; i++ ) { + if ( ap[i] !== bp[i] ) { + return siblingCheck( ap[i], bp[i] ); + } + } + + // We ended someplace up the tree so do a sibling check + return i === al ? + siblingCheck( a, bp[i], -1 ) : + siblingCheck( ap[i], b, 1 ); + }; + + siblingCheck = function( a, b, ret ) { + if ( a === b ) { + return ret; + } + + var cur = a.nextSibling; + + while ( cur ) { + if ( cur === b ) { + return -1; + } + + cur = cur.nextSibling; + } + + return 1; + }; +} + +// Utility function for retreiving the text value of an array of DOM nodes +Sizzle.getText = function( elems ) { + var ret = "", elem; + + for ( var i = 0; elems[i]; i++ ) { + elem = elems[i]; + + // Get the text from text nodes and CDATA nodes + if ( elem.nodeType === 3 || elem.nodeType === 4 ) { + ret += elem.nodeValue; + + // Traverse everything else, except comment nodes + } else if ( elem.nodeType !== 8 ) { + ret += Sizzle.getText( elem.childNodes ); + } + } + + return ret; +}; + +// Check to see if the browser returns elements by name when +// querying by getElementById (and provide a workaround) +(function(){ + // We're going to inject a fake input element with a specified name + var form = document.createElement("div"), + id = "script" + (new Date()).getTime(), + root = document.documentElement; + + form.innerHTML = ""; + + // Inject it into the root element, check its status, and remove it quickly + root.insertBefore( form, root.firstChild ); + + // The workaround has to do additional checks after a getElementById + // Which slows things down for other browsers (hence the branching) + if ( document.getElementById( id ) ) { + Expr.find.ID = function( match, context, isXML ) { + if ( typeof context.getElementById !== "undefined" && !isXML ) { + var m = context.getElementById(match[1]); + + return m ? + m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? + [m] : + undefined : + []; + } + }; + + Expr.filter.ID = function( elem, match ) { + var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); + + return elem.nodeType === 1 && node && node.nodeValue === match; + }; + } + + root.removeChild( form ); + + // release memory in IE + root = form = null; +})(); + +(function(){ + // Check to see if the browser returns only elements + // when doing getElementsByTagName("*") + + // Create a fake element + var div = document.createElement("div"); + div.appendChild( document.createComment("") ); + + // Make sure no comments are found + if ( div.getElementsByTagName("*").length > 0 ) { + Expr.find.TAG = function( match, context ) { + var results = context.getElementsByTagName( match[1] ); + + // Filter out possible comments + if ( match[1] === "*" ) { + var tmp = []; + + for ( var i = 0; results[i]; i++ ) { + if ( results[i].nodeType === 1 ) { + tmp.push( results[i] ); + } + } + + results = tmp; + } + + return results; + }; + } + + // Check to see if an attribute returns normalized href attributes + div.innerHTML = ""; + + if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && + div.firstChild.getAttribute("href") !== "#" ) { + + Expr.attrHandle.href = function( elem ) { + return elem.getAttribute( "href", 2 ); + }; + } + + // release memory in IE + div = null; +})(); + +if ( document.querySelectorAll ) { + (function(){ + var oldSizzle = Sizzle, + div = document.createElement("div"), + id = "__sizzle__"; + + div.innerHTML = "

      "; + + // Safari can't handle uppercase or unicode characters when + // in quirks mode. + if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { + return; + } + + Sizzle = function( query, context, extra, seed ) { + context = context || document; + + // Only use querySelectorAll on non-XML documents + // (ID selectors don't work in non-HTML documents) + if ( !seed && !Sizzle.isXML(context) ) { + // See if we find a selector to speed up + var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query ); + + if ( match && (context.nodeType === 1 || context.nodeType === 9) ) { + // Speed-up: Sizzle("TAG") + if ( match[1] ) { + return makeArray( context.getElementsByTagName( query ), extra ); + + // Speed-up: Sizzle(".CLASS") + } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) { + return makeArray( context.getElementsByClassName( match[2] ), extra ); + } + } + + if ( context.nodeType === 9 ) { + // Speed-up: Sizzle("body") + // The body element only exists once, optimize finding it + if ( query === "body" && context.body ) { + return makeArray( [ context.body ], extra ); + + // Speed-up: Sizzle("#ID") + } else if ( match && match[3] ) { + var elem = context.getElementById( match[3] ); + + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + if ( elem && elem.parentNode ) { + // Handle the case where IE and Opera return items + // by name instead of ID + if ( elem.id === match[3] ) { + return makeArray( [ elem ], extra ); + } + + } else { + return makeArray( [], extra ); + } + } + + try { + return makeArray( context.querySelectorAll(query), extra ); + } catch(qsaError) {} + + // qSA works strangely on Element-rooted queries + // We can work around this by specifying an extra ID on the root + // and working up from there (Thanks to Andrew Dupont for the technique) + // IE 8 doesn't work on object elements + } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { + var oldContext = context, + old = context.getAttribute( "id" ), + nid = old || id, + hasParent = context.parentNode, + relativeHierarchySelector = /^\s*[+~]/.test( query ); + + if ( !old ) { + context.setAttribute( "id", nid ); + } else { + nid = nid.replace( /'/g, "\\$&" ); + } + if ( relativeHierarchySelector && hasParent ) { + context = context.parentNode; + } + + try { + if ( !relativeHierarchySelector || hasParent ) { + return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra ); + } + + } catch(pseudoError) { + } finally { + if ( !old ) { + oldContext.removeAttribute( "id" ); + } + } + } + } + + return oldSizzle(query, context, extra, seed); + }; + + for ( var prop in oldSizzle ) { + Sizzle[ prop ] = oldSizzle[ prop ]; + } + + // release memory in IE + div = null; + })(); +} + +(function(){ + var html = document.documentElement, + matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector; + + if ( matches ) { + // Check to see if it's possible to do matchesSelector + // on a disconnected node (IE 9 fails this) + var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ), + pseudoWorks = false; + + try { + // This should fail with an exception + // Gecko does not error, returns false instead + matches.call( document.documentElement, "[test!='']:sizzle" ); + + } catch( pseudoError ) { + pseudoWorks = true; + } + + Sizzle.matchesSelector = function( node, expr ) { + // Make sure that attribute selectors are quoted + expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); + + if ( !Sizzle.isXML( node ) ) { + try { + if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) { + var ret = matches.call( node, expr ); + + // IE 9's matchesSelector returns false on disconnected nodes + if ( ret || !disconnectedMatch || + // As well, disconnected nodes are said to be in a document + // fragment in IE 9, so check for that + node.document && node.document.nodeType !== 11 ) { + return ret; + } + } + } catch(e) {} + } + + return Sizzle(expr, null, null, [node]).length > 0; + }; + } +})(); + +(function(){ + var div = document.createElement("div"); + + div.innerHTML = "
      "; + + // Opera can't find a second classname (in 9.6) + // Also, make sure that getElementsByClassName actually exists + if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) { + return; + } + + // Safari caches class attributes, doesn't catch changes (in 3.2) + div.lastChild.className = "e"; + + if ( div.getElementsByClassName("e").length === 1 ) { + return; + } + + Expr.order.splice(1, 0, "CLASS"); + Expr.find.CLASS = function( match, context, isXML ) { + if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { + return context.getElementsByClassName(match[1]); + } + }; + + // release memory in IE + div = null; +})(); + +function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + + if ( elem ) { + var match = false; + + elem = elem[dir]; + + while ( elem ) { + if ( elem.sizcache === doneName ) { + match = checkSet[elem.sizset]; + break; + } + + if ( elem.nodeType === 1 && !isXML ){ + elem.sizcache = doneName; + elem.sizset = i; + } + + if ( elem.nodeName.toLowerCase() === cur ) { + match = elem; + break; + } + + elem = elem[dir]; + } + + checkSet[i] = match; + } + } +} + +function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + + if ( elem ) { + var match = false; + + elem = elem[dir]; + + while ( elem ) { + if ( elem.sizcache === doneName ) { + match = checkSet[elem.sizset]; + break; + } + + if ( elem.nodeType === 1 ) { + if ( !isXML ) { + elem.sizcache = doneName; + elem.sizset = i; + } + + if ( typeof cur !== "string" ) { + if ( elem === cur ) { + match = true; + break; + } + + } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { + match = elem; + break; + } + } + + elem = elem[dir]; + } + + checkSet[i] = match; + } + } +} + +if ( document.documentElement.contains ) { + Sizzle.contains = function( a, b ) { + return a !== b && (a.contains ? a.contains(b) : true); + }; + +} else if ( document.documentElement.compareDocumentPosition ) { + Sizzle.contains = function( a, b ) { + return !!(a.compareDocumentPosition(b) & 16); + }; + +} else { + Sizzle.contains = function() { + return false; + }; +} + +Sizzle.isXML = function( elem ) { + // documentElement is verified for cases where it doesn't yet exist + // (such as loading iframes in IE - #4833) + var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; + + return documentElement ? documentElement.nodeName !== "HTML" : false; +}; + +var posProcess = function( selector, context ) { + var match, + tmpSet = [], + later = "", + root = context.nodeType ? [context] : context; + + // Position selectors must be done after the filter + // And so must :not(positional) so we move all PSEUDOs to the end + while ( (match = Expr.match.PSEUDO.exec( selector )) ) { + later += match[0]; + selector = selector.replace( Expr.match.PSEUDO, "" ); + } + + selector = Expr.relative[selector] ? selector + "*" : selector; + + for ( var i = 0, l = root.length; i < l; i++ ) { + Sizzle( selector, root[i], tmpSet ); + } + + return Sizzle.filter( later, tmpSet ); +}; + +// EXPOSE +jQuery.find = Sizzle; +jQuery.expr = Sizzle.selectors; +jQuery.expr[":"] = jQuery.expr.filters; +jQuery.unique = Sizzle.uniqueSort; +jQuery.text = Sizzle.getText; +jQuery.isXMLDoc = Sizzle.isXML; +jQuery.contains = Sizzle.contains; + + +})(); + + +var runtil = /Until$/, + rparentsprev = /^(?:parents|prevUntil|prevAll)/, + // Note: This RegExp should be improved, or likely pulled from Sizzle + rmultiselector = /,/, + isSimple = /^.[^:#\[\.,]*$/, + slice = Array.prototype.slice, + POS = jQuery.expr.match.POS, + // methods guaranteed to produce a unique set when starting from a unique set + guaranteedUnique = { + children: true, + contents: true, + next: true, + prev: true + }; + +jQuery.fn.extend({ + find: function( selector ) { + var self = this, + i, l; + + if ( typeof selector !== "string" ) { + return jQuery( selector ).filter(function() { + for ( i = 0, l = self.length; i < l; i++ ) { + if ( jQuery.contains( self[ i ], this ) ) { + return true; + } + } + }); + } + + var ret = this.pushStack( "", "find", selector ), + length, n, r; + + for ( i = 0, l = this.length; i < l; i++ ) { + length = ret.length; + jQuery.find( selector, this[i], ret ); + + if ( i > 0 ) { + // Make sure that the results are unique + for ( n = length; n < ret.length; n++ ) { + for ( r = 0; r < length; r++ ) { + if ( ret[r] === ret[n] ) { + ret.splice(n--, 1); + break; + } + } + } + } + } + + return ret; + }, + + has: function( target ) { + var targets = jQuery( target ); + return this.filter(function() { + for ( var i = 0, l = targets.length; i < l; i++ ) { + if ( jQuery.contains( this, targets[i] ) ) { + return true; + } + } + }); + }, + + not: function( selector ) { + return this.pushStack( winnow(this, selector, false), "not", selector); + }, + + filter: function( selector ) { + return this.pushStack( winnow(this, selector, true), "filter", selector ); + }, + + is: function( selector ) { + return !!selector && ( typeof selector === "string" ? + jQuery.filter( selector, this ).length > 0 : + this.filter( selector ).length > 0 ); + }, + + closest: function( selectors, context ) { + var ret = [], i, l, cur = this[0]; + + // Array + if ( jQuery.isArray( selectors ) ) { + var match, selector, + matches = {}, + level = 1; + + if ( cur && selectors.length ) { + for ( i = 0, l = selectors.length; i < l; i++ ) { + selector = selectors[i]; + + if ( !matches[ selector ] ) { + matches[ selector ] = POS.test( selector ) ? + jQuery( selector, context || this.context ) : + selector; + } + } + + while ( cur && cur.ownerDocument && cur !== context ) { + for ( selector in matches ) { + match = matches[ selector ]; + + if ( match.jquery ? match.index( cur ) > -1 : jQuery( cur ).is( match ) ) { + ret.push({ selector: selector, elem: cur, level: level }); + } + } + + cur = cur.parentNode; + level++; + } + } + + return ret; + } + + // String + var pos = POS.test( selectors ) || typeof selectors !== "string" ? + jQuery( selectors, context || this.context ) : + 0; + + for ( i = 0, l = this.length; i < l; i++ ) { + cur = this[i]; + + while ( cur ) { + if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) { + ret.push( cur ); + break; + + } else { + cur = cur.parentNode; + if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) { + break; + } + } + } + } + + ret = ret.length > 1 ? jQuery.unique( ret ) : ret; + + return this.pushStack( ret, "closest", selectors ); + }, + + // Determine the position of an element within + // the matched set of elements + index: function( elem ) { + + // No argument, return index in parent + if ( !elem ) { + return ( this[0] && this[0].parentNode ) ? this.prevAll().length : -1; + } + + // index in selector + if ( typeof elem === "string" ) { + return jQuery.inArray( this[0], jQuery( elem ) ); + } + + // Locate the position of the desired element + return jQuery.inArray( + // If it receives a jQuery object, the first element is used + elem.jquery ? elem[0] : elem, this ); + }, + + add: function( selector, context ) { + var set = typeof selector === "string" ? + jQuery( selector, context ) : + jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ), + all = jQuery.merge( this.get(), set ); + + return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ? + all : + jQuery.unique( all ) ); + }, + + andSelf: function() { + return this.add( this.prevObject ); + } +}); + +// A painfully simple check to see if an element is disconnected +// from a document (should be improved, where feasible). +function isDisconnected( node ) { + return !node || !node.parentNode || node.parentNode.nodeType === 11; +} + +jQuery.each({ + parent: function( elem ) { + var parent = elem.parentNode; + return parent && parent.nodeType !== 11 ? parent : null; + }, + parents: function( elem ) { + return jQuery.dir( elem, "parentNode" ); + }, + parentsUntil: function( elem, i, until ) { + return jQuery.dir( elem, "parentNode", until ); + }, + next: function( elem ) { + return jQuery.nth( elem, 2, "nextSibling" ); + }, + prev: function( elem ) { + return jQuery.nth( elem, 2, "previousSibling" ); + }, + nextAll: function( elem ) { + return jQuery.dir( elem, "nextSibling" ); + }, + prevAll: function( elem ) { + return jQuery.dir( elem, "previousSibling" ); + }, + nextUntil: function( elem, i, until ) { + return jQuery.dir( elem, "nextSibling", until ); + }, + prevUntil: function( elem, i, until ) { + return jQuery.dir( elem, "previousSibling", until ); + }, + siblings: function( elem ) { + return jQuery.sibling( elem.parentNode.firstChild, elem ); + }, + children: function( elem ) { + return jQuery.sibling( elem.firstChild ); + }, + contents: function( elem ) { + return jQuery.nodeName( elem, "iframe" ) ? + elem.contentDocument || elem.contentWindow.document : + jQuery.makeArray( elem.childNodes ); + } +}, function( name, fn ) { + jQuery.fn[ name ] = function( until, selector ) { + var ret = jQuery.map( this, fn, until ), + // The variable 'args' was introduced in + // https://github.com/jquery/jquery/commit/52a0238 + // to work around a bug in Chrome 10 (Dev) and should be removed when the bug is fixed. + // http://code.google.com/p/v8/issues/detail?id=1050 + args = slice.call(arguments); + + if ( !runtil.test( name ) ) { + selector = until; + } + + if ( selector && typeof selector === "string" ) { + ret = jQuery.filter( selector, ret ); + } + + ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret; + + if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) { + ret = ret.reverse(); + } + + return this.pushStack( ret, name, args.join(",") ); + }; +}); + +jQuery.extend({ + filter: function( expr, elems, not ) { + if ( not ) { + expr = ":not(" + expr + ")"; + } + + return elems.length === 1 ? + jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] : + jQuery.find.matches(expr, elems); + }, + + dir: function( elem, dir, until ) { + var matched = [], + cur = elem[ dir ]; + + while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { + if ( cur.nodeType === 1 ) { + matched.push( cur ); + } + cur = cur[dir]; + } + return matched; + }, + + nth: function( cur, result, dir, elem ) { + result = result || 1; + var num = 0; + + for ( ; cur; cur = cur[dir] ) { + if ( cur.nodeType === 1 && ++num === result ) { + break; + } + } + + return cur; + }, + + sibling: function( n, elem ) { + var r = []; + + for ( ; n; n = n.nextSibling ) { + if ( n.nodeType === 1 && n !== elem ) { + r.push( n ); + } + } + + return r; + } +}); + +// Implement the identical functionality for filter and not +function winnow( elements, qualifier, keep ) { + + // Can't pass null or undefined to indexOf in Firefox 4 + // Set to 0 to skip string check + qualifier = qualifier || 0; + + if ( jQuery.isFunction( qualifier ) ) { + return jQuery.grep(elements, function( elem, i ) { + var retVal = !!qualifier.call( elem, i, elem ); + return retVal === keep; + }); + + } else if ( qualifier.nodeType ) { + return jQuery.grep(elements, function( elem, i ) { + return (elem === qualifier) === keep; + }); + + } else if ( typeof qualifier === "string" ) { + var filtered = jQuery.grep(elements, function( elem ) { + return elem.nodeType === 1; + }); + + if ( isSimple.test( qualifier ) ) { + return jQuery.filter(qualifier, filtered, !keep); + } else { + qualifier = jQuery.filter( qualifier, filtered ); + } + } + + return jQuery.grep(elements, function( elem, i ) { + return (jQuery.inArray( elem, qualifier ) >= 0) === keep; + }); +} + + + + +var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g, + rleadingWhitespace = /^\s+/, + rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig, + rtagName = /<([\w:]+)/, + rtbody = /", "" ], + legend: [ 1, "
      ", "
      " ], + thead: [ 1, "", "
      " ], + tr: [ 2, "", "
      " ], + td: [ 3, "", "
      " ], + col: [ 2, "", "
      " ], + area: [ 1, "", "" ], + _default: [ 0, "", "" ] + }; + +wrapMap.optgroup = wrapMap.option; +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; + +// IE can't serialize and ' ); + + iframe_doc.close(); + + // Update the Iframe's hash, for great justice. + iframe.location.hash = hash; + } + }; + + })(); + // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + // ^^^^^^^^^^^^^^^^^^^ REMOVE IF NOT SUPPORTING IE6/7/8 ^^^^^^^^^^^^^^^^^^^ + // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + return self; + })(); + +})(jQuery,this); diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.init.js b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.init.js new file mode 100644 index 0000000..93c03e8 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.init.js @@ -0,0 +1,193 @@ +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +//>>description: Global initialization of the library. +//>>label: Init +//>>group: Core + + +define( [ "jquery", "./jquery.mobile.core", "./jquery.mobile.support", "./jquery.mobile.navigation", + "./jquery.mobile.navigation.pushstate", "../external/requirejs/depend!./jquery.mobile.hashchange[jquery]" ], function( $ ) { +//>>excludeEnd("jqmBuildExclude"); +( function( $, window, undefined ) { + var $html = $( "html" ), + $head = $( "head" ), + $window = $( window ); + + // trigger mobileinit event - useful hook for configuring $.mobile settings before they're used + $( window.document ).trigger( "mobileinit" ); + + // support conditions + // if device support condition(s) aren't met, leave things as they are -> a basic, usable experience, + // otherwise, proceed with the enhancements + if ( !$.mobile.gradeA() ) { + return; + } + + // override ajaxEnabled on platforms that have known conflicts with hash history updates + // or generally work better browsing in regular http for full page refreshes (BB5, Opera Mini) + if ( $.mobile.ajaxBlacklist ) { + $.mobile.ajaxEnabled = false; + } + + // Add mobile, initial load "rendering" classes to docEl + $html.addClass( "ui-mobile ui-mobile-rendering" ); + + // This is a fallback. If anything goes wrong (JS errors, etc), or events don't fire, + // this ensures the rendering class is removed after 5 seconds, so content is visible and accessible + setTimeout( hideRenderingClass, 5000 ); + + // loading div which appears during Ajax requests + // will not appear if $.mobile.loadingMessage is false + var loaderClass = "ui-loader", + $loader = $( "

      " ); + + // For non-fixed supportin browsers. Position at y center (if scrollTop supported), above the activeBtn (if defined), or just 100px from top + function fakeFixLoader(){ + var activeBtn = $( "." + $.mobile.activeBtnClass ).first(); + + $loader + .css({ + top: $.support.scrollTop && $window.scrollTop() + $window.height() / 2 || + activeBtn.length && activeBtn.offset().top || 100 + }); + } + + // check position of loader to see if it appears to be "fixed" to center + // if not, use abs positioning + function checkLoaderPosition(){ + var offset = $loader.offset(), + scrollTop = $window.scrollTop(), + screenHeight = $.mobile.getScreenHeight(); + + if( offset.top < scrollTop || (offset.top - scrollTop) > screenHeight ) { + $loader.addClass( "ui-loader-fakefix" ); + fakeFixLoader(); + $window + .unbind( "scroll", checkLoaderPosition ) + .bind( "scroll", fakeFixLoader ); + } + } + + //remove initial build class (only present on first pageshow) + function hideRenderingClass(){ + $html.removeClass( "ui-mobile-rendering" ); + } + + $.extend($.mobile, { + // turn on/off page loading message. + showPageLoadingMsg: function( theme, msgText, textonly ) { + $html.addClass( "ui-loading" ); + + if ( $.mobile.loadingMessage ) { + // text visibility from argument takes priority + var textVisible = textonly || $.mobile.loadingMessageTextVisible; + + theme = theme || $.mobile.loadingMessageTheme, + + $loader + .attr( "class", loaderClass + " ui-corner-all ui-body-" + ( theme || "a" ) + " ui-loader-" + ( textVisible ? "verbose" : "default" ) + ( textonly ? " ui-loader-textonly" : "" ) ) + .find( "h1" ) + .text( msgText || $.mobile.loadingMessage ) + .end() + .appendTo( $.mobile.pageContainer ); + + checkLoaderPosition(); + $window.bind( "scroll", checkLoaderPosition ); + } + }, + + hidePageLoadingMsg: function() { + $html.removeClass( "ui-loading" ); + + if( $.mobile.loadingMessage ){ + $loader.removeClass( "ui-loader-fakefix" ); + } + + $( window ).unbind( "scroll", fakeFixLoader ); + $( window ).unbind( "scroll", checkLoaderPosition ); + }, + + // find and enhance the pages in the dom and transition to the first page. + initializePage: function() { + // find present pages + var $pages = $( ":jqmData(role='page'), :jqmData(role='dialog')" ); + + // if no pages are found, create one with body's inner html + if ( !$pages.length ) { + $pages = $( "body" ).wrapInner( "
      " ).children( 0 ); + } + + // add dialogs, set data-url attrs + $pages.each(function() { + var $this = $(this); + + // unless the data url is already set set it to the pathname + if ( !$this.jqmData("url") ) { + $this.attr( "data-" + $.mobile.ns + "url", $this.attr( "id" ) || location.pathname + location.search ); + } + }); + + // define first page in dom case one backs out to the directory root (not always the first page visited, but defined as fallback) + $.mobile.firstPage = $pages.first(); + + // define page container + $.mobile.pageContainer = $pages.first().parent().addClass( "ui-mobile-viewport" ); + + // alert listeners that the pagecontainer has been determined for binding + // to events triggered on it + $window.trigger( "pagecontainercreate" ); + + // cue page loading message + $.mobile.showPageLoadingMsg(); + + //remove initial build class (only present on first pageshow) + hideRenderingClass(); + + // if hashchange listening is disabled or there's no hash deeplink, change to the first page in the DOM + if ( !$.mobile.hashListeningEnabled || !$.mobile.path.stripHash( location.hash ) ) { + $.mobile.changePage( $.mobile.firstPage, { transition: "none", reverse: true, changeHash: false, fromHashChange: true } ); + } + // otherwise, trigger a hashchange to load a deeplink + else { + $window.trigger( "hashchange", [ true ] ); + } + } + }); + + // initialize events now, after mobileinit has occurred + $.mobile._registerInternalEvents(); + + // check which scrollTop value should be used by scrolling to 1 immediately at domready + // then check what the scroll top is. Android will report 0... others 1 + // note that this initial scroll won't hide the address bar. It's just for the check. + $(function() { + window.scrollTo( 0, 1 ); + + // 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; + + + // 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 ){ + $( ":jqmData(role='controlgroup')", e.target ) + .jqmEnhanceable() + .controlgroup({ excludeInvisible: false }); + }); + } + + //dom-ready inits + if( $.mobile.autoInitializePage ){ + $.mobile.initializePage(); + } + + // window load event + // hide iOS browser chrome on load + $window.load( $.mobile.silentScroll ); + }); +}( jQuery, this )); +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +}); +//>>excludeEnd("jqmBuildExclude"); diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.js b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.js new file mode 100644 index 0000000..dd73b6a --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.js @@ -0,0 +1,41 @@ +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +//>>group: exclude + +define([ + 'require', + './jquery.mobile.navigation', + './jquery.mobile.navigation.pushstate', + './jquery.mobile.transition.pop', + './jquery.mobile.transition.slide', + './jquery.mobile.transition.slidedown', + './jquery.mobile.transition.slideup', + './jquery.mobile.transition.flip', + './jquery.mobile.transition.flow', + './jquery.mobile.transition.turn', + './jquery.mobile.degradeInputs', + './jquery.mobile.dialog', + './jquery.mobile.page.sections', + './jquery.mobile.collapsible', + './jquery.mobile.collapsibleSet', + './jquery.mobile.fieldContain', + './jquery.mobile.grid', + './jquery.mobile.navbar', + './jquery.mobile.listview', + './jquery.mobile.listview.filter', + './jquery.mobile.nojs', + './jquery.mobile.forms.checkboxradio', + './jquery.mobile.forms.button', + './jquery.mobile.forms.slider', + './jquery.mobile.forms.textinput', + './jquery.mobile.forms.select.custom', + './jquery.mobile.forms.select', + './jquery.mobile.buttonMarkup', + './jquery.mobile.controlGroup', + './jquery.mobile.links', + './jquery.mobile.fixedToolbar', + './jquery.mobile.zoom', + './jquery.mobile.zoom.iosorientationfix' +], function( require ) { + require( [ './jquery.mobile.init' ], function() {} ); +}); +//>>excludeEnd("jqmBuildExclude"); \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.links.js b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.links.js new file mode 100644 index 0000000..ff9aa62 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.links.js @@ -0,0 +1,26 @@ +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +//>>description: Adds classes to links. +//>>label: Link Classes +//>>group: Utilities + + +define( [ "jquery" ], function( $ ) { +//>>excludeEnd("jqmBuildExclude"); +(function( $, undefined ) { + +$( document ).bind( "pagecreate create", function( e ){ + + //links within content areas, tests included with page + $( e.target ) + .find( "a" ) + .jqmEnhanceable() + .not( ".ui-btn, .ui-link-inherit, :jqmData(role='none'), :jqmData(role='nojs')" ) + .addClass( "ui-link" ); + +}); + +})( jQuery ); + +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +}); +//>>excludeEnd("jqmBuildExclude"); diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.listview.filter.js b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.listview.filter.js new file mode 100644 index 0000000..a2420d8 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.listview.filter.js @@ -0,0 +1,119 @@ +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +//>>description: Extends the listview to add a search box to filter lists +//>>label: Listview: Filter +//>>group: Widgets + + +define( [ "jquery", "./jquery.mobile.listview", "./jquery.mobile.forms.textinput" ], function( $ ) { +//>>excludeEnd("jqmBuildExclude"); +(function( $, undefined ) { + +$.mobile.listview.prototype.options.filter = false; +$.mobile.listview.prototype.options.filterPlaceholder = "Filter items..."; +$.mobile.listview.prototype.options.filterTheme = "c"; +$.mobile.listview.prototype.options.filterCallback = function( text, searchValue ){ + return text.toLowerCase().indexOf( searchValue ) === -1; +}; + +$( document ).delegate( ":jqmData(role='listview')", "listviewcreate", function() { + + var list = $( this ), + listview = list.data( "listview" ); + + if ( !listview.options.filter ) { + return; + } + + var wrapper = $( "
      ", { + "class": "ui-listview-filter ui-bar-" + listview.options.filterTheme, + "role": "search" + }), + search = $( "", { + placeholder: listview.options.filterPlaceholder + }) + .attr( "data-" + $.mobile.ns + "type", "search" ) + .jqmData( "lastval", "" ) + .bind( "keyup change", function() { + + var $this = $(this), + val = this.value.toLowerCase(), + listItems = null, + lastval = $this.jqmData( "lastval" ) + "", + childItems = false, + itemtext = "", + item; + + // Change val as lastval for next execution + $this.jqmData( "lastval" , val ); + if ( val.length < lastval.length || val.indexOf(lastval) !== 0 ) { + + // Removed chars or pasted something totally different, check all items + listItems = list.children(); + } else { + + // Only chars added, not removed, only use visible subset + listItems = list.children( ":not(.ui-screen-hidden)" ); + } + + if ( val ) { + + // This handles hiding regular rows without the text we search for + // and any list dividers without regular rows shown under it + + for ( var i = listItems.length - 1; i >= 0; i-- ) { + item = $( listItems[ i ] ); + itemtext = item.jqmData( "filtertext" ) || item.text(); + + if ( item.is( "li:jqmData(role=list-divider)" ) ) { + + item.toggleClass( "ui-filter-hidequeue" , !childItems ); + + // New bucket! + childItems = false; + + } else if ( listview.options.filterCallback( itemtext, val ) ) { + + //mark to be hidden + item.toggleClass( "ui-filter-hidequeue" , true ); + } else { + + // There's a shown item in the bucket + childItems = true; + } + } + + // Show items, not marked to be hidden + listItems + .filter( ":not(.ui-filter-hidequeue)" ) + .toggleClass( "ui-screen-hidden", false ); + + // Hide items, marked to be hidden + listItems + .filter( ".ui-filter-hidequeue" ) + .toggleClass( "ui-screen-hidden", true ) + .toggleClass( "ui-filter-hidequeue", false ); + + } else { + + //filtervalue is empty => show all + listItems.toggleClass( "ui-screen-hidden", false ); + } + listview._refreshCorners(); + }) + .appendTo( wrapper ) + .textinput(); + + if ( listview.options.inset ) { + wrapper.addClass( "ui-listview-filter-inset" ); + } + + wrapper.bind( "submit", function() { + return false; + }) + .insertBefore( list ); +}); + +})( jQuery ); +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +}); +//>>excludeEnd("jqmBuildExclude"); diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.listview.js b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.listview.js new file mode 100644 index 0000000..f3fabfa --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.listview.js @@ -0,0 +1,414 @@ +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +//>>description: Applies listview styling of various types (standard, numbered, split button, etc.) +//>>label: Listview +//>>group: Widgets +//>>css: ../css/themes/default/jquery.mobile.theme.css, ../css/structure/jquery.mobile.listview.css + +define( [ "jquery", "./jquery.mobile.widget", "./jquery.mobile.buttonMarkup", "./jquery.mobile.page", "./jquery.mobile.page.sections" ], function( $ ) { +//>>excludeEnd("jqmBuildExclude"); +(function( $, undefined ) { + +//Keeps track of the number of lists per page UID +//This allows support for multiple nested list in the same page +//https://github.com/jquery/jquery-mobile/issues/1617 +var listCountPerPage = {}; + +$.widget( "mobile.listview", $.mobile.widget, { + + options: { + theme: null, + countTheme: "c", + headerTheme: "b", + dividerTheme: "b", + splitIcon: "arrow-r", + splitTheme: "b", + mini: false, + inset: false, + initSelector: ":jqmData(role='listview')" + }, + + _create: function() { + var t = this, + listviewClasses = ""; + + listviewClasses += t.options.inset ? " ui-listview-inset ui-corner-all ui-shadow " : ""; + listviewClasses += t.element.jqmData( "mini" ) || t.options.mini === true ? " ui-mini" : ""; + + // create listview markup + t.element.addClass(function( i, orig ) { + return orig + " ui-listview " + listviewClasses; + }); + + t.refresh( true ); + }, + + _removeCorners: function( li, which ) { + var top = "ui-corner-top ui-corner-tr ui-corner-tl", + bot = "ui-corner-bottom ui-corner-br ui-corner-bl"; + + li = li.add( li.find( ".ui-btn-inner, .ui-li-link-alt, .ui-li-thumb" ) ); + + if ( which === "top" ) { + li.removeClass( top ); + } else if ( which === "bottom" ) { + li.removeClass( bot ); + } else { + li.removeClass( top + " " + bot ); + } + }, + + _refreshCorners: function( create ) { + var $li, + $visibleli, + $topli, + $bottomli; + + if ( this.options.inset ) { + $li = this.element.children( "li" ); + // at create time the li are not visible yet so we need to rely on .ui-screen-hidden + $visibleli = create?$li.not( ".ui-screen-hidden" ):$li.filter( ":visible" ); + + this._removeCorners( $li ); + + // Select the first visible li element + $topli = $visibleli.first() + .addClass( "ui-corner-top" ); + + $topli.add( $topli.find( ".ui-btn-inner" ) + .not( ".ui-li-link-alt span:first-child" ) ) + .addClass( "ui-corner-top" ) + .end() + .find( ".ui-li-link-alt, .ui-li-link-alt span:first-child" ) + .addClass( "ui-corner-tr" ) + .end() + .find( ".ui-li-thumb" ) + .not(".ui-li-icon") + .addClass( "ui-corner-tl" ); + + // Select the last visible li element + $bottomli = $visibleli.last() + .addClass( "ui-corner-bottom" ); + + $bottomli.add( $bottomli.find( ".ui-btn-inner" ) ) + .find( ".ui-li-link-alt" ) + .addClass( "ui-corner-br" ) + .end() + .find( ".ui-li-thumb" ) + .not(".ui-li-icon") + .addClass( "ui-corner-bl" ); + } + if ( !create ) { + this.element.trigger( "updatelayout" ); + } + }, + + // This is a generic utility method for finding the first + // node with a given nodeName. It uses basic DOM traversal + // to be fast and is meant to be a substitute for simple + // $.fn.closest() and $.fn.children() calls on a single + // element. Note that callers must pass both the lowerCase + // and upperCase version of the nodeName they are looking for. + // The main reason for this is that this function will be + // called many times and we want to avoid having to lowercase + // the nodeName from the element every time to ensure we have + // a match. Note that this function lives here for now, but may + // be moved into $.mobile if other components need a similar method. + _findFirstElementByTagName: function( ele, nextProp, lcName, ucName ) + { + var dict = {}; + dict[ lcName ] = dict[ ucName ] = true; + while ( ele ) { + if ( dict[ ele.nodeName ] ) { + return ele; + } + ele = ele[ nextProp ]; + } + return null; + }, + _getChildrenByTagName: function( ele, lcName, ucName ) + { + var results = [], + dict = {}; + dict[ lcName ] = dict[ ucName ] = true; + ele = ele.firstChild; + while ( ele ) { + if ( dict[ ele.nodeName ] ) { + results.push( ele ); + } + ele = ele.nextSibling; + } + return $( results ); + }, + + _addThumbClasses: function( containers ) + { + var i, img, len = containers.length; + for ( i = 0; i < len; i++ ) { + img = $( this._findFirstElementByTagName( containers[ i ].firstChild, "nextSibling", "img", "IMG" ) ); + if ( img.length ) { + img.addClass( "ui-li-thumb" ); + $( this._findFirstElementByTagName( img[ 0 ].parentNode, "parentNode", "li", "LI" ) ).addClass( img.is( ".ui-li-icon" ) ? "ui-li-has-icon" : "ui-li-has-thumb" ); + } + } + }, + + refresh: function( create ) { + this.parentPage = this.element.closest( ".ui-page" ); + this._createSubPages(); + + var o = this.options, + $list = this.element, + self = this, + dividertheme = $list.jqmData( "dividertheme" ) || o.dividerTheme, + listsplittheme = $list.jqmData( "splittheme" ), + listspliticon = $list.jqmData( "spliticon" ), + li = this._getChildrenByTagName( $list[ 0 ], "li", "LI" ), + counter = $.support.cssPseudoElement || !$.nodeName( $list[ 0 ], "ol" ) ? 0 : 1, + itemClassDict = {}, + item, itemClass, itemTheme, + a, last, splittheme, countParent, icon, imgParents, img, linkIcon; + + if ( counter ) { + $list.find( ".ui-li-dec" ).remove(); + } + + if ( !o.theme ) { + o.theme = $.mobile.getInheritedTheme( this.element, "c" ); + } + + for ( var pos = 0, numli = li.length; pos < numli; pos++ ) { + item = li.eq( pos ); + itemClass = "ui-li"; + + // If we're creating the element, we update it regardless + if ( create || !item.hasClass( "ui-li" ) ) { + itemTheme = item.jqmData("theme") || o.theme; + a = this._getChildrenByTagName( item[ 0 ], "a", "A" ); + + if ( a.length ) { + icon = item.jqmData("icon"); + + item.buttonMarkup({ + wrapperEls: "div", + shadow: false, + corners: false, + iconpos: "right", + icon: a.length > 1 || icon === false ? false : icon || "arrow-r", + theme: itemTheme + }); + + if ( ( icon != false ) && ( a.length == 1 ) ) { + item.addClass( "ui-li-has-arrow" ); + } + + a.first().removeClass( "ui-link" ).addClass( "ui-link-inherit" ); + + if ( a.length > 1 ) { + itemClass += " ui-li-has-alt"; + + last = a.last(); + splittheme = listsplittheme || last.jqmData( "theme" ) || o.splitTheme; + linkIcon = last.jqmData("icon"); + + last.appendTo(item) + .attr( "title", last.getEncodedText() ) + .addClass( "ui-li-link-alt" ) + .empty() + .buttonMarkup({ + shadow: false, + corners: false, + theme: itemTheme, + icon: false, + iconpos: false + }) + .find( ".ui-btn-inner" ) + .append( + $( document.createElement( "span" ) ).buttonMarkup({ + shadow: true, + corners: true, + theme: splittheme, + iconpos: "notext", + // link icon overrides list item icon overrides ul element overrides options + icon: linkIcon || icon || listspliticon || o.splitIcon + }) + ); + } + } else if ( item.jqmData( "role" ) === "list-divider" ) { + + itemClass += " ui-li-divider ui-bar-" + dividertheme; + item.attr( "role", "heading" ); + + //reset counter when a divider heading is encountered + if ( counter ) { + counter = 1; + } + + } else { + itemClass += " ui-li-static ui-body-" + itemTheme; + } + } + + if ( counter && itemClass.indexOf( "ui-li-divider" ) < 0 ) { + countParent = item.is( ".ui-li-static:first" ) ? item : item.find( ".ui-link-inherit" ); + + countParent.addClass( "ui-li-jsnumbering" ) + .prepend( "" + (counter++) + ". " ); + } + + // Instead of setting item class directly on the list item and its + // btn-inner at this point in time, push the item into a dictionary + // that tells us what class to set on it so we can do this after this + // processing loop is finished. + + if ( !itemClassDict[ itemClass ] ) { + itemClassDict[ itemClass ] = []; + } + + itemClassDict[ itemClass ].push( item[ 0 ] ); + } + + // Set the appropriate listview item classes on each list item + // and their btn-inner elements. The main reason we didn't do this + // in the for-loop above is because we can eliminate per-item function overhead + // by calling addClass() and children() once or twice afterwards. This + // can give us a significant boost on platforms like WP7.5. + + for ( itemClass in itemClassDict ) { + $( itemClassDict[ itemClass ] ).addClass( itemClass ).children( ".ui-btn-inner" ).addClass( itemClass ); + } + + $list.find( "h1, h2, h3, h4, h5, h6" ).addClass( "ui-li-heading" ) + .end() + + .find( "p, dl" ).addClass( "ui-li-desc" ) + .end() + + .find( ".ui-li-aside" ).each(function() { + var $this = $(this); + $this.prependTo( $this.parent() ); //shift aside to front for css float + }) + .end() + + .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" ); + + // 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 + // can place the appropriate classes on the image and list item. + // Note that we used to use something like: + // + // li.find(">img:eq(0), .ui-link-inherit>img:eq(0)").each( ... ); + // + // But executing a find() like that on Windows Phone 7.5 took a + // really long time. Walking things manually with the code below + // allows the 400 listview item page to load in about 3 seconds as + // opposed to 30 seconds. + + this._addThumbClasses( li ); + this._addThumbClasses( $list.find( ".ui-link-inherit" ) ); + + this._refreshCorners( create ); + }, + + //create a string for ID/subpage url creation + _idStringEscape: function( str ) { + return str.replace(/[^a-zA-Z0-9]/g, '-'); + }, + + _createSubPages: function() { + var parentList = this.element, + parentPage = parentList.closest( ".ui-page" ), + parentUrl = parentPage.jqmData( "url" ), + parentId = parentUrl || parentPage[ 0 ][ $.expando ], + parentListId = parentList.attr( "id" ), + o = this.options, + dns = "data-" + $.mobile.ns, + self = this, + persistentFooterID = parentPage.find( ":jqmData(role='footer')" ).jqmData( "id" ), + hasSubPages; + + if ( typeof listCountPerPage[ parentId ] === "undefined" ) { + listCountPerPage[ parentId ] = -1; + } + + parentListId = parentListId || ++listCountPerPage[ parentId ]; + + $( parentList.find( "li>ul, li>ol" ).toArray().reverse() ).each(function( i ) { + var self = this, + list = $( this ), + listId = list.attr( "id" ) || parentListId + "-" + i, + parent = list.parent(), + nodeEls = $( list.prevAll().toArray().reverse() ), + nodeEls = nodeEls.length ? nodeEls : $( "" + $.trim(parent.contents()[ 0 ].nodeValue) + "" ), + 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, + newPage, anchor; + + //define hasSubPages for use in later removal + hasSubPages = true; + + newPage = list.detach() + .wrap( "
      " ) + .parent() + .before( "
      " + title + "
      " ) + .after( persistentFooterID ? $( "
      ") : "" ) + .parent() + .appendTo( $.mobile.pageContainer ); + + newPage.page(); + + anchor = parent.find('a:first'); + + if ( !anchor.length ) { + anchor = $( "" ).html( nodeEls || title ).prependTo( parent.empty() ); + } + + anchor.attr( "href", "#" + id ); + + }).listview(); + + // on pagehide, remove any nested pages along with the parent page, as long as they aren't active + // and aren't embedded + if( hasSubPages && + parentPage.is( ":jqmData(external-page='true')" ) && + parentPage.data("page").options.domCache === false ) { + + var newRemove = function( e, ui ){ + var nextPage = ui.nextPage, npURL; + + if( ui.nextPage ){ + npURL = nextPage.jqmData( "url" ); + if( npURL.indexOf( parentUrl + "&" + $.mobile.subPageUrlKey ) !== 0 ){ + self.childPages().remove(); + parentPage.remove(); + } + } + }; + + // unbind the original page remove and replace with our specialized version + parentPage + .unbind( "pagehide.remove" ) + .bind( "pagehide.remove", newRemove); + } + }, + + // TODO sort out a better way to track sub pages of the listview this is brittle + childPages: function(){ + var parentUrl = this.parentPage.jqmData( "url" ); + + return $( ":jqmData(url^='"+ parentUrl + "&" + $.mobile.subPageUrlKey +"')"); + } +}); + +//auto self-init widgets +$( document ).bind( "pagecreate create", function( e ){ + $.mobile.listview.prototype.enhanceWithin( e.target ); +}); + +})( jQuery ); +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +}); +//>>excludeEnd("jqmBuildExclude"); diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.media.js b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.media.js new file mode 100644 index 0000000..f2302e5 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.media.js @@ -0,0 +1,52 @@ +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +//>>description: A workaround for browsers without window.matchMedia +//>>label: matchMedia Polyfill +//>>group: Utilities + + +define( [ "jquery", "./jquery.mobile.core" ], function( $ ) { +//>>excludeEnd("jqmBuildExclude"); +(function( $, undefined ) { + +var $window = $( window ), + $html = $( "html" ); + +/* $.mobile.media method: pass a CSS media type or query and get a bool return + note: this feature relies on actual media query support for media queries, though types will work most anywhere + examples: + $.mobile.media('screen') // tests for screen media type + $.mobile.media('screen and (min-width: 480px)') // tests for screen media type with window width > 480px + $.mobile.media('@media screen and (-webkit-min-device-pixel-ratio: 2)') // tests for webkit 2x pixel ratio (iPhone 4) +*/ +$.mobile.media = (function() { + // TODO: use window.matchMedia once at least one UA implements it + var cache = {}, + testDiv = $( "
      " ), + fakeBody = $( "" ).append( testDiv ); + + return function( query ) { + if ( !( query in cache ) ) { + var styleBlock = document.createElement( "style" ), + cssrule = "@media " + query + " { #jquery-mediatest { position:absolute; } }"; + + //must set type for IE! + styleBlock.type = "text/css"; + + if ( styleBlock.styleSheet ){ + styleBlock.styleSheet.cssText = cssrule; + } else { + styleBlock.appendChild( document.createTextNode(cssrule) ); + } + + $html.prepend( fakeBody ).prepend( styleBlock ); + cache[ query ] = testDiv.css( "position" ) === "absolute"; + fakeBody.add( styleBlock ).remove(); + } + return cache[ query ]; + }; +})(); + +})(jQuery); +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +}); +//>>excludeEnd("jqmBuildExclude"); diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.navbar.js b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.navbar.js new file mode 100644 index 0000000..42c2f12 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.navbar.js @@ -0,0 +1,65 @@ +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +//>>description: Formats groups of links as horizontal navigation bars. +//>>label: Navbars +//>>group: Widgets +//>>css: ../css/themes/default/jquery.mobile.theme.css, ../css/structure/jquery.mobile.navbar.css + + +define( [ "jquery", "./jquery.mobile.widget", "./jquery.mobile.buttonMarkup", "./jquery.mobile.grid" ], function( $ ) { +//>>excludeEnd("jqmBuildExclude"); +(function( $, undefined ) { + +$.widget( "mobile.navbar", $.mobile.widget, { + options: { + iconpos: "top", + grid: null, + initSelector: ":jqmData(role='navbar')" + }, + + _create: function(){ + + var $navbar = this.element, + $navbtns = $navbar.find( "a" ), + iconpos = $navbtns.filter( ":jqmData(icon)" ).length ? + this.options.iconpos : undefined; + + $navbar.addClass( "ui-navbar" ) + .attr( "role","navigation" ) + .find( "ul" ) + .jqmEnhanceable() + .grid({ grid: this.options.grid }); + + if ( !iconpos ) { + $navbar.addClass( "ui-navbar-noicons" ); + } + + $navbtns.buttonMarkup({ + corners: false, + shadow: false, + inline: true, + iconpos: iconpos + }); + + $navbar.delegate( "a", "vclick", function( event ) { + if( !$(event.target).hasClass("ui-disabled") ) { + $navbtns.removeClass( $.mobile.activeBtnClass ); + $( this ).addClass( $.mobile.activeBtnClass ); + } + }); + + // Buttons in the navbar with ui-state-persist class should regain their active state before page show + $navbar.closest( ".ui-page" ).bind( "pagebeforeshow", function() { + $navbtns.filter( ".ui-state-persist" ).addClass( $.mobile.activeBtnClass ); + }); + } +}); + +//auto self-init widgets +$( document ).bind( "pagecreate create", function( e ){ + $.mobile.navbar.prototype.enhanceWithin( e.target ); +}); + +})( jQuery ); +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +}); +//>>excludeEnd("jqmBuildExclude"); diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.navigation.js b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.navigation.js new file mode 100644 index 0000000..ad2f67c --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.navigation.js @@ -0,0 +1,1456 @@ +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +//>>description: Applies the AJAX navigation system to links and forms to enable page transitions +//>>label: AJAX Navigation System +//>>group: Navigation + +define( [ + "jquery", + "./jquery.mobile.core", + "./jquery.mobile.event", + "../external/requirejs/depend!./jquery.mobile.hashchange[jquery]", + "./jquery.mobile.page", + "./jquery.mobile.transition" ], function( $ ) { +//>>excludeEnd("jqmBuildExclude"); +( function( $, undefined ) { + + //define vars for interal use + var $window = $( window ), + $html = $( 'html' ), + $head = $( 'head' ), + + //url path helpers for use in relative url management + path = { + + // This scary looking regular expression parses an absolute URL or its relative + // variants (protocol, site, document, query, and hash), into the various + // components (protocol, host, path, query, fragment, etc that make up the + // URL as well as some other commonly used sub-parts. When used with RegExp.exec() + // or String.match, it parses the URL into a results array that looks like this: + // + // [0]: http://jblas:password@mycompany.com:8080/mail/inbox?msg=1234&type=unread#msg-content + // [1]: http://jblas:password@mycompany.com:8080/mail/inbox?msg=1234&type=unread + // [2]: http://jblas:password@mycompany.com:8080/mail/inbox + // [3]: http://jblas:password@mycompany.com:8080 + // [4]: http: + // [5]: // + // [6]: jblas:password@mycompany.com:8080 + // [7]: jblas:password + // [8]: jblas + // [9]: password + // [10]: mycompany.com:8080 + // [11]: mycompany.com + // [12]: 8080 + // [13]: /mail/inbox + // [14]: /mail/ + // [15]: inbox + // [16]: ?msg=1234&type=unread + // [17]: #msg-content + // + urlParseRE: /^(((([^:\/#\?]+:)?(?:(\/\/)((?:(([^:@\/#\?]+)(?:\:([^:@\/#\?]+))?)@)?(([^:\/#\?\]\[]+|\[[^\/\]@#?]+\])(?:\:([0-9]+))?))?)?)?((\/?(?:[^\/\?#]+\/+)*)([^\?#]*)))?(\?[^#]+)?)(#.*)?/, + + //Parse a URL into a structure that allows easy access to + //all of the URL components by name. + parseUrl: function( url ) { + // If we're passed an object, we'll assume that it is + // a parsed url object and just return it back to the caller. + if ( $.type( url ) === "object" ) { + return url; + } + + var matches = path.urlParseRE.exec( url || "" ) || []; + + // Create an object that allows the caller to access the sub-matches + // by name. Note that IE returns an empty string instead of undefined, + // like all other browsers do, so we normalize everything so its consistent + // no matter what browser we're running on. + return { + href: matches[ 0 ] || "", + hrefNoHash: matches[ 1 ] || "", + hrefNoSearch: matches[ 2 ] || "", + domain: matches[ 3 ] || "", + protocol: matches[ 4 ] || "", + doubleSlash: matches[ 5 ] || "", + authority: matches[ 6 ] || "", + username: matches[ 8 ] || "", + password: matches[ 9 ] || "", + host: matches[ 10 ] || "", + hostname: matches[ 11 ] || "", + port: matches[ 12 ] || "", + pathname: matches[ 13 ] || "", + directory: matches[ 14 ] || "", + filename: matches[ 15 ] || "", + search: matches[ 16 ] || "", + hash: matches[ 17 ] || "" + }; + }, + + //Turn relPath into an asbolute path. absPath is + //an optional absolute path which describes what + //relPath is relative to. + makePathAbsolute: function( relPath, absPath ) { + if ( relPath && relPath.charAt( 0 ) === "/" ) { + return relPath; + } + + relPath = relPath || ""; + absPath = absPath ? absPath.replace( /^\/|(\/[^\/]*|[^\/]+)$/g, "" ) : ""; + + var absStack = absPath ? absPath.split( "/" ) : [], + relStack = relPath.split( "/" ); + for ( var i = 0; i < relStack.length; i++ ) { + var d = relStack[ i ]; + switch ( d ) { + case ".": + break; + case "..": + if ( absStack.length ) { + absStack.pop(); + } + break; + default: + absStack.push( d ); + break; + } + } + return "/" + absStack.join( "/" ); + }, + + //Returns true if both urls have the same domain. + isSameDomain: function( absUrl1, absUrl2 ) { + return path.parseUrl( absUrl1 ).domain === path.parseUrl( absUrl2 ).domain; + }, + + //Returns true for any relative variant. + isRelativeUrl: function( url ) { + // All relative Url variants have one thing in common, no protocol. + return path.parseUrl( url ).protocol === ""; + }, + + //Returns true for an absolute url. + isAbsoluteUrl: function( url ) { + return path.parseUrl( url ).protocol !== ""; + }, + + //Turn the specified realtive URL into an absolute one. This function + //can handle all relative variants (protocol, site, document, query, fragment). + makeUrlAbsolute: function( relUrl, absUrl ) { + if ( !path.isRelativeUrl( relUrl ) ) { + return relUrl; + } + + var relObj = path.parseUrl( relUrl ), + absObj = path.parseUrl( absUrl ), + protocol = relObj.protocol || absObj.protocol, + doubleSlash = relObj.protocol ? relObj.doubleSlash : ( relObj.doubleSlash || absObj.doubleSlash ), + authority = relObj.authority || absObj.authority, + hasPath = relObj.pathname !== "", + pathname = path.makePathAbsolute( relObj.pathname || absObj.filename, absObj.pathname ), + search = relObj.search || ( !hasPath && absObj.search ) || "", + hash = relObj.hash; + + return protocol + doubleSlash + authority + pathname + search + hash; + }, + + //Add search (aka query) params to the specified url. + addSearchParams: function( url, params ) { + var u = path.parseUrl( url ), + p = ( typeof params === "object" ) ? $.param( params ) : params, + s = u.search || "?"; + return u.hrefNoSearch + s + ( s.charAt( s.length - 1 ) !== "?" ? "&" : "" ) + p + ( u.hash || "" ); + }, + + convertUrlToDataUrl: function( absUrl ) { + var u = path.parseUrl( absUrl ); + if ( path.isEmbeddedPage( u ) ) { + // For embedded pages, remove the dialog hash key as in getFilePath(), + // otherwise the Data Url won't match the id of the embedded Page. + return u.hash.split( dialogHashKey )[0].replace( /^#/, "" ); + } else if ( path.isSameDomain( u, documentBase ) ) { + return u.hrefNoHash.replace( documentBase.domain, "" ); + } + return absUrl; + }, + + //get path from current hash, or from a file path + get: function( newPath ) { + if( newPath === undefined ) { + newPath = location.hash; + } + return path.stripHash( newPath ).replace( /[^\/]*\.[^\/*]+$/, '' ); + }, + + //return the substring of a filepath before the sub-page key, for making a server request + getFilePath: function( path ) { + var splitkey = '&' + $.mobile.subPageUrlKey; + return path && path.split( splitkey )[0].split( dialogHashKey )[0]; + }, + + //set location hash to path + set: function( path ) { + location.hash = path; + }, + + //test if a given url (string) is a path + //NOTE might be exceptionally naive + isPath: function( url ) { + return ( /\// ).test( url ); + }, + + //return a url path with the window's location protocol/hostname/pathname removed + clean: function( url ) { + return url.replace( documentBase.domain, "" ); + }, + + //just return the url without an initial # + stripHash: function( url ) { + return url.replace( /^#/, "" ); + }, + + //remove the preceding hash, any query params, and dialog notations + cleanHash: function( hash ) { + return path.stripHash( hash.replace( /\?.*$/, "" ).replace( dialogHashKey, "" ) ); + }, + + //check whether a url is referencing the same domain, or an external domain or different protocol + //could be mailto, etc + isExternal: function( url ) { + var u = path.parseUrl( url ); + return u.protocol && u.domain !== documentUrl.domain ? true : false; + }, + + hasProtocol: function( url ) { + return ( /^(:?\w+:)/ ).test( url ); + }, + + //check if the specified url refers to the first page in the main application document. + isFirstPageUrl: function( url ) { + // We only deal with absolute paths. + var u = path.parseUrl( path.makeUrlAbsolute( url, documentBase ) ), + + // Does the url have the same path as the document? + samePath = u.hrefNoHash === documentUrl.hrefNoHash || ( documentBaseDiffers && u.hrefNoHash === documentBase.hrefNoHash ), + + // Get the first page element. + fp = $.mobile.firstPage, + + // Get the id of the first page element if it has one. + fpId = fp && fp[0] ? fp[0].id : undefined; + + // The url refers to the first page if the path matches the document and + // it either has no hash value, or the hash is exactly equal to the id of the + // first page element. + return samePath && ( !u.hash || u.hash === "#" || ( fpId && u.hash.replace( /^#/, "" ) === fpId ) ); + }, + + isEmbeddedPage: function( url ) { + var u = path.parseUrl( url ); + + //if the path is absolute, then we need to compare the url against + //both the documentUrl and the documentBase. The main reason for this + //is that links embedded within external documents will refer to the + //application document, whereas links embedded within the application + //document will be resolved against the document base. + if ( u.protocol !== "" ) { + return ( u.hash && ( u.hrefNoHash === documentUrl.hrefNoHash || ( documentBaseDiffers && u.hrefNoHash === documentBase.hrefNoHash ) ) ); + } + return (/^#/).test( u.href ); + } + }, + + //will be defined when a link is clicked and given an active class + $activeClickedLink = null, + + //urlHistory is purely here to make guesses at whether the back or forward button was clicked + //and provide an appropriate transition + urlHistory = { + // Array of pages that are visited during a single page load. + // Each has a url and optional transition, title, and pageUrl (which represents the file path, in cases where URL is obscured, such as dialogs) + stack: [], + + //maintain an index number for the active page in the stack + activeIndex: 0, + + //get active + getActive: function() { + return urlHistory.stack[ urlHistory.activeIndex ]; + }, + + getPrev: function() { + return urlHistory.stack[ urlHistory.activeIndex - 1 ]; + }, + + getNext: function() { + return urlHistory.stack[ urlHistory.activeIndex + 1 ]; + }, + + // addNew is used whenever a new page is added + addNew: function( url, transition, title, pageUrl, role ) { + //if there's forward history, wipe it + if( urlHistory.getNext() ) { + urlHistory.clearForward(); + } + + urlHistory.stack.push( {url : url, transition: transition, title: title, pageUrl: pageUrl, role: role } ); + + urlHistory.activeIndex = urlHistory.stack.length - 1; + }, + + //wipe urls ahead of active index + clearForward: function() { + urlHistory.stack = urlHistory.stack.slice( 0, urlHistory.activeIndex + 1 ); + }, + + directHashChange: function( opts ) { + var back , forward, newActiveIndex, prev = this.getActive(); + + // check if url isp in history and if it's ahead or behind current page + $.each( urlHistory.stack, function( i, historyEntry ) { + + //if the url is in the stack, it's a forward or a back + if( opts.currentUrl === historyEntry.url ) { + //define back and forward by whether url is older or newer than current page + back = i < urlHistory.activeIndex; + forward = !back; + newActiveIndex = i; + } + }); + + // save new page index, null check to prevent falsey 0 result + this.activeIndex = newActiveIndex !== undefined ? newActiveIndex : this.activeIndex; + + if( back ) { + ( opts.either || opts.isBack )( true ); + } else if( forward ) { + ( opts.either || opts.isForward )( false ); + } + }, + + //disable hashchange event listener internally to ignore one change + //toggled internally when location.hash is updated to match the url of a successful page load + ignoreNextHashChange: false + }, + + //define first selector to receive focus when a page is shown + focusable = "[tabindex],a,button:visible,select:visible,input", + + //queue to hold simultanious page transitions + pageTransitionQueue = [], + + //indicates whether or not page is in process of transitioning + isPageTransitioning = false, + + //nonsense hash change key for dialogs, so they create a history entry + dialogHashKey = "&ui-state=dialog", + + //existing base tag? + $base = $head.children( "base" ), + + //tuck away the original document URL minus any fragment. + documentUrl = path.parseUrl( location.href ), + + //if the document has an embedded base tag, documentBase is set to its + //initial value. If a base tag does not exist, then we default to the documentUrl. + documentBase = $base.length ? path.parseUrl( path.makeUrlAbsolute( $base.attr( "href" ), documentUrl.href ) ) : documentUrl, + + //cache the comparison once. + documentBaseDiffers = ( documentUrl.hrefNoHash !== documentBase.hrefNoHash ); + + //base element management, defined depending on dynamic base tag support + var base = $.support.dynamicBaseTag ? { + + //define base element, for use in routing asset urls that are referenced in Ajax-requested markup + element: ( $base.length ? $base : $( "", { href: documentBase.hrefNoHash } ).prependTo( $head ) ), + + //set the generated BASE element's href attribute to a new page's base path + set: function( href ) { + base.element.attr( "href", path.makeUrlAbsolute( href, documentBase ) ); + }, + + //set the generated BASE element's href attribute to a new page's base path + reset: function() { + base.element.attr( "href", documentBase.hrefNoHash ); + } + + } : undefined; + +/* + internal utility functions +--------------------------------------*/ + + + //direct focus to the page title, or otherwise first focusable element + $.mobile.focusPage = function ( page ) { + var autofocus = page.find("[autofocus]"), + pageTitle = page.find( ".ui-title:eq(0)" ); + + if( autofocus.length ) { + autofocus.focus(); + return; + } + + if( pageTitle.length ) { + pageTitle.focus(); + } + else{ + page.focus(); + } + } + + //remove active classes after page transition or error + function removeActiveLinkClass( forceRemoval ) { + if( !!$activeClickedLink && ( !$activeClickedLink.closest( '.ui-page-active' ).length || forceRemoval ) ) { + $activeClickedLink.removeClass( $.mobile.activeBtnClass ); + } + $activeClickedLink = null; + } + + function releasePageTransitionLock() { + isPageTransitioning = false; + if( pageTransitionQueue.length > 0 ) { + $.mobile.changePage.apply( null, pageTransitionQueue.pop() ); + } + } + + // Save the last scroll distance per page, before it is hidden + var setLastScrollEnabled = true, + setLastScroll, delayedSetLastScroll; + + setLastScroll = function() { + // this barrier prevents setting the scroll value based on the browser + // scrolling the window based on a hashchange + if( !setLastScrollEnabled ) { + return; + } + + var active = $.mobile.urlHistory.getActive(); + + if( active ) { + var lastScroll = $window.scrollTop(); + + // Set active page's lastScroll prop. + // If the location we're scrolling to is less than minScrollBack, let it go. + active.lastScroll = lastScroll < $.mobile.minScrollBack ? $.mobile.defaultHomeScroll : lastScroll; + } + }; + + // bind to scrollstop to gather scroll position. The delay allows for the hashchange + // event to fire and disable scroll recording in the case where the browser scrolls + // to the hash targets location (sometimes the top of the page). once pagechange fires + // getLastScroll is again permitted to operate + delayedSetLastScroll = function() { + setTimeout( setLastScroll, 100 ); + }; + + // disable an scroll setting when a hashchange has been fired, this only works + // because the recording of the scroll position is delayed for 100ms after + // the browser might have changed the position because of the hashchange + $window.bind( $.support.pushState ? "popstate" : "hashchange", function() { + setLastScrollEnabled = false; + }); + + // handle initial hashchange from chrome :( + $window.one( $.support.pushState ? "popstate" : "hashchange", function() { + setLastScrollEnabled = true; + }); + + // wait until the mobile page container has been determined to bind to pagechange + $window.one( "pagecontainercreate", function(){ + // once the page has changed, re-enable the scroll recording + $.mobile.pageContainer.bind( "pagechange", function() { + + setLastScrollEnabled = true; + + // remove any binding that previously existed on the get scroll + // which may or may not be different than the scroll element determined for + // this page previously + $window.unbind( "scrollstop", delayedSetLastScroll ); + + // determine and bind to the current scoll element which may be the window + // or in the case of touch overflow the element with touch overflow + $window.bind( "scrollstop", delayedSetLastScroll ); + }); + }); + + // bind to scrollstop for the first page as "pagechange" won't be fired in that case + $window.bind( "scrollstop", delayedSetLastScroll ); + + //function for transitioning between two existing pages + function transitionPages( toPage, fromPage, transition, reverse ) { + + if( fromPage ) { + //trigger before show/hide events + fromPage.data( "page" )._trigger( "beforehide", null, { nextPage: toPage } ); + } + + toPage.data( "page" )._trigger( "beforeshow", null, { prevPage: fromPage || $( "" ) } ); + + //clear page loader + $.mobile.hidePageLoadingMsg(); + + // If transition is defined, check if css 3D transforms are supported, and if not, if a fallback is specified + if( transition && !$.support.cssTransform3d && $.mobile.transitionFallbacks[ transition ] ){ + transition = $.mobile.transitionFallbacks[ transition ]; + } + + //find the transition handler for the specified transition. If there + //isn't one in our transitionHandlers dictionary, use the default one. + //call the handler immediately to kick-off the transition. + var th = $.mobile.transitionHandlers[ transition || "default" ] || $.mobile.defaultTransitionHandler, + promise = th( transition, reverse, toPage, fromPage ); + + promise.done(function() { + + //trigger show/hide events + if( fromPage ) { + fromPage.data( "page" )._trigger( "hide", null, { nextPage: toPage } ); + } + + //trigger pageshow, define prevPage as either fromPage or empty jQuery obj + toPage.data( "page" )._trigger( "show", null, { prevPage: fromPage || $( "" ) } ); + }); + + return promise; + } + + //simply set the active page's minimum height to screen height, depending on orientation + function getScreenHeight(){ + // 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(); + } + + $.mobile.getScreenHeight = getScreenHeight; + + //simply set the active page's minimum height to screen height, depending on orientation + function resetActivePageHeight(){ + var aPage = $( "." + $.mobile.activePageClass ), + aPagePadT = parseFloat( aPage.css( "padding-top" ) ), + aPagePadB = parseFloat( aPage.css( "padding-bottom" ) ); + + aPage.css( "min-height", getScreenHeight() - aPagePadT - aPagePadB ); + } + + //shared page enhancements + function enhancePage( $page, role ) { + // If a role was specified, make sure the data-role attribute + // on the page element is in sync. + if( role ) { + $page.attr( "data-" + $.mobile.ns + "role", role ); + } + + //run page plugin + $page.page(); + } + +/* exposed $.mobile methods */ + + //animation complete callback + $.fn.animationComplete = function( callback ) { + if( $.support.cssTransitions ) { + return $( this ).one( 'webkitAnimationEnd animationend', callback ); + } + else{ + // defer execution for consistency between webkit/non webkit + setTimeout( callback, 0 ); + return $( this ); + } + }; + + //expose path object on $.mobile + $.mobile.path = path; + + //expose base object on $.mobile + $.mobile.base = base; + + //history stack + $.mobile.urlHistory = urlHistory; + + $.mobile.dialogHashKey = dialogHashKey; + + + + //enable cross-domain page support + $.mobile.allowCrossDomainPages = false; + + //return the original document url + $.mobile.getDocumentUrl = function(asParsedObject) { + return asParsedObject ? $.extend( {}, documentUrl ) : documentUrl.href; + }; + + //return the original document base url + $.mobile.getDocumentBase = function(asParsedObject) { + return asParsedObject ? $.extend( {}, documentBase ) : documentBase.href; + }; + + $.mobile._bindPageRemove = function() { + var page = $(this); + + // when dom caching is not enabled or the page is embedded bind to remove the page on hide + if( !page.data("page").options.domCache + && page.is(":jqmData(external-page='true')") ) { + + page.bind( 'pagehide.remove', function() { + var $this = $( this ), + prEvent = new $.Event( "pageremove" ); + + $this.trigger( prEvent ); + + if( !prEvent.isDefaultPrevented() ){ + $this.removeWithDependents(); + } + }); + } + }; + + // Load a page into the DOM. + $.mobile.loadPage = function( url, options ) { + // This function uses deferred notifications to let callers + // know when the page is done loading, or if an error has occurred. + var deferred = $.Deferred(), + + // The default loadPage options with overrides specified by + // the caller. + settings = $.extend( {}, $.mobile.loadPage.defaults, options ), + + // The DOM element for the page after it has been loaded. + page = null, + + // If the reloadPage option is true, and the page is already + // in the DOM, dupCachedPage will be set to the page element + // so that it can be removed after the new version of the + // page is loaded off the network. + dupCachedPage = null, + + // determine the current base url + findBaseWithDefault = function(){ + var closestBase = ( $.mobile.activePage && getClosestBaseUrl( $.mobile.activePage ) ); + return closestBase || documentBase.hrefNoHash; + }, + + // The absolute version of the URL passed into the function. This + // version of the URL may contain dialog/subpage params in it. + absUrl = path.makeUrlAbsolute( url, findBaseWithDefault() ); + + + // If the caller provided data, and we're using "get" request, + // append the data to the URL. + if ( settings.data && settings.type === "get" ) { + absUrl = path.addSearchParams( absUrl, settings.data ); + settings.data = undefined; + } + + // If the caller is using a "post" request, reloadPage must be true + if( settings.data && settings.type === "post" ){ + settings.reloadPage = true; + } + + // The absolute version of the URL minus any dialog/subpage params. + // In otherwords the real URL of the page to be loaded. + var fileUrl = path.getFilePath( absUrl ), + + // The version of the Url actually stored in the data-url attribute of + // the page. For embedded pages, it is just the id of the page. For pages + // within the same domain as the document base, it is the site relative + // path. For cross-domain pages (Phone Gap only) the entire absolute Url + // used to load the page. + dataUrl = path.convertUrlToDataUrl( absUrl ); + + // Make sure we have a pageContainer to work with. + settings.pageContainer = settings.pageContainer || $.mobile.pageContainer; + + // Check to see if the page already exists in the DOM. + page = settings.pageContainer.children( ":jqmData(url='" + dataUrl + "')" ); + + // If we failed to find the page, check to see if the url is a + // reference to an embedded page. If so, it may have been dynamically + // injected by a developer, in which case it would be lacking a data-url + // attribute and in need of enhancement. + if ( page.length === 0 && dataUrl && !path.isPath( dataUrl ) ) { + page = settings.pageContainer.children( "#" + dataUrl ) + .attr( "data-" + $.mobile.ns + "url", dataUrl ); + } + + // If we failed to find a page in the DOM, check the URL to see if it + // refers to the first page in the application. If it isn't a reference + // to the first page and refers to non-existent embedded page, error out. + if ( page.length === 0 ) { + if ( $.mobile.firstPage && path.isFirstPageUrl( fileUrl ) ) { + // Check to make sure our cached-first-page is actually + // in the DOM. Some user deployed apps are pruning the first + // page from the DOM for various reasons, we check for this + // case here because we don't want a first-page with an id + // falling through to the non-existent embedded page error + // case. If the first-page is not in the DOM, then we let + // things fall through to the ajax loading code below so + // that it gets reloaded. + if ( $.mobile.firstPage.parent().length ) { + page = $( $.mobile.firstPage ); + } + } else if ( path.isEmbeddedPage( fileUrl ) ) { + deferred.reject( absUrl, options ); + return deferred.promise(); + } + } + + // Reset base to the default document base. + if ( base ) { + base.reset(); + } + + // If the page we are interested in is already in the DOM, + // and the caller did not indicate that we should force a + // reload of the file, we are done. Otherwise, track the + // existing page as a duplicated. + if ( page.length ) { + if ( !settings.reloadPage ) { + enhancePage( page, settings.role ); + deferred.resolve( absUrl, options, page ); + return deferred.promise(); + } + dupCachedPage = page; + } + + var mpc = settings.pageContainer, + pblEvent = new $.Event( "pagebeforeload" ), + triggerData = { url: url, absUrl: absUrl, dataUrl: dataUrl, deferred: deferred, options: settings }; + + // Let listeners know we're about to load a page. + mpc.trigger( pblEvent, triggerData ); + + // If the default behavior is prevented, stop here! + if( pblEvent.isDefaultPrevented() ){ + return deferred.promise(); + } + + if ( settings.showLoadMsg ) { + + // This configurable timeout allows cached pages a brief delay to load without showing a message + var loadMsgDelay = setTimeout(function(){ + $.mobile.showPageLoadingMsg(); + }, settings.loadMsgDelay ), + + // Shared logic for clearing timeout and removing message. + hideMsg = function(){ + + // Stop message show timer + clearTimeout( loadMsgDelay ); + + // Hide loading message + $.mobile.hidePageLoadingMsg(); + }; + } + + if ( !( $.mobile.allowCrossDomainPages || path.isSameDomain( documentUrl, absUrl ) ) ) { + deferred.reject( absUrl, options ); + } else { + // Load the new page. + $.ajax({ + url: fileUrl, + type: settings.type, + data: settings.data, + dataType: "html", + success: function( html, textStatus, xhr ) { + //pre-parse html to check for a data-url, + //use it as the new fileUrl, base path, etc + var all = $( "
      " ), + + //page title regexp + newPageTitle = html.match( /]*>([^<]*)/ ) && RegExp.$1, + + // TODO handle dialogs again + pageElemRegex = new RegExp( "(<[^>]+\\bdata-" + $.mobile.ns + "role=[\"']?page[\"']?[^>]*>)" ), + dataUrlRegex = new RegExp( "\\bdata-" + $.mobile.ns + "url=[\"']?([^\"'>]*)[\"']?" ); + + + // data-url must be provided for the base tag so resource requests can be directed to the + // correct url. loading into a temprorary element makes these requests immediately + if( pageElemRegex.test( html ) + && RegExp.$1 + && dataUrlRegex.test( RegExp.$1 ) + && RegExp.$1 ) { + url = fileUrl = path.getFilePath( RegExp.$1 ); + } + + if ( base ) { + base.set( fileUrl ); + } + + //workaround to allow scripts to execute when included in page divs + all.get( 0 ).innerHTML = html; + page = all.find( ":jqmData(role='page'), :jqmData(role='dialog')" ).first(); + + //if page elem couldn't be found, create one and insert the body element's contents + if( !page.length ){ + page = $( "
      " + html.split( /<\/?body[^>]*>/gmi )[1] + "
      " ); + } + + if ( newPageTitle && !page.jqmData( "title" ) ) { + if ( ~newPageTitle.indexOf( "&" ) ) { + newPageTitle = $( "
      " + newPageTitle + "
      " ).text(); + } + page.jqmData( "title", newPageTitle ); + } + + //rewrite src and href attrs to use a base url + if( !$.support.dynamicBaseTag ) { + var newPath = path.get( fileUrl ); + page.find( "[src], link[href], a[rel='external'], :jqmData(ajax='false'), a[target]" ).each(function() { + var thisAttr = $( this ).is( '[href]' ) ? 'href' : + $(this).is('[src]') ? 'src' : 'action', + thisUrl = $( this ).attr( thisAttr ); + + // XXX_jblas: We need to fix this so that it removes the document + // base URL, and then prepends with the new page URL. + //if full path exists and is same, chop it - helps IE out + thisUrl = thisUrl.replace( location.protocol + '//' + location.host + location.pathname, '' ); + + if( !/^(\w+:|#|\/)/.test( thisUrl ) ) { + $( this ).attr( thisAttr, newPath + thisUrl ); + } + }); + } + + //append to page and enhance + // TODO taging a page with external to make sure that embedded pages aren't removed + // by the various page handling code is bad. Having page handling code in many + // places is bad. Solutions post 1.0 + page + .attr( "data-" + $.mobile.ns + "url", path.convertUrlToDataUrl( fileUrl ) ) + .attr( "data-" + $.mobile.ns + "external-page", true ) + .appendTo( settings.pageContainer ); + + // wait for page creation to leverage options defined on widget + page.one( 'pagecreate', $.mobile._bindPageRemove ); + + enhancePage( page, settings.role ); + + // Enhancing the page may result in new dialogs/sub pages being inserted + // into the DOM. If the original absUrl refers to a sub-page, that is the + // real page we are interested in. + if ( absUrl.indexOf( "&" + $.mobile.subPageUrlKey ) > -1 ) { + page = settings.pageContainer.children( ":jqmData(url='" + dataUrl + "')" ); + } + + //bind pageHide to removePage after it's hidden, if the page options specify to do so + + // Remove loading message. + if ( settings.showLoadMsg ) { + hideMsg(); + } + + // Add the page reference and xhr to our triggerData. + triggerData.xhr = xhr; + triggerData.textStatus = textStatus; + triggerData.page = page; + + // Let listeners know the page loaded successfully. + settings.pageContainer.trigger( "pageload", triggerData ); + + deferred.resolve( absUrl, options, page, dupCachedPage ); + }, + error: function( xhr, textStatus, errorThrown ) { + //set base back to current path + if( base ) { + base.set( path.get() ); + } + + // Add error info to our triggerData. + triggerData.xhr = xhr; + triggerData.textStatus = textStatus; + triggerData.errorThrown = errorThrown; + + var plfEvent = new $.Event( "pageloadfailed" ); + + // Let listeners know the page load failed. + settings.pageContainer.trigger( plfEvent, triggerData ); + + // If the default behavior is prevented, stop here! + // Note that it is the responsibility of the listener/handler + // that called preventDefault(), to resolve/reject the + // deferred object within the triggerData. + if( plfEvent.isDefaultPrevented() ){ + return; + } + + // Remove loading message. + if ( settings.showLoadMsg ) { + + // Remove loading message. + hideMsg(); + + // show error message + $.mobile.showPageLoadingMsg( $.mobile.pageLoadErrorMessageTheme, $.mobile.pageLoadErrorMessage, true ); + + // hide after delay + setTimeout( $.mobile.hidePageLoadingMsg, 1500 ); + } + + deferred.reject( absUrl, options ); + } + }); + } + + return deferred.promise(); + }; + + $.mobile.loadPage.defaults = { + type: "get", + data: undefined, + reloadPage: false, + role: undefined, // By default we rely on the role defined by the @data-role attribute. + showLoadMsg: false, + pageContainer: undefined, + loadMsgDelay: 50 // This delay allows loads that pull from browser cache to occur without showing the loading message. + }; + + // Show a specific page in the page container. + $.mobile.changePage = function( toPage, options ) { + // If we are in the midst of a transition, queue the current request. + // We'll call changePage() once we're done with the current transition to + // service the request. + if( isPageTransitioning ) { + pageTransitionQueue.unshift( arguments ); + return; + } + + var settings = $.extend( {}, $.mobile.changePage.defaults, options ); + + // Make sure we have a pageContainer to work with. + settings.pageContainer = settings.pageContainer || $.mobile.pageContainer; + + // Make sure we have a fromPage. + settings.fromPage = settings.fromPage || $.mobile.activePage; + + var mpc = settings.pageContainer, + pbcEvent = new $.Event( "pagebeforechange" ), + triggerData = { toPage: toPage, options: settings }; + + // Let listeners know we're about to change the current page. + mpc.trigger( pbcEvent, triggerData ); + + // If the default behavior is prevented, stop here! + if( pbcEvent.isDefaultPrevented() ){ + return; + } + + // We allow "pagebeforechange" observers to modify the toPage in the trigger + // data to allow for redirects. Make sure our toPage is updated. + + toPage = triggerData.toPage; + + // Set the isPageTransitioning flag to prevent any requests from + // entering this method while we are in the midst of loading a page + // or transitioning. + + isPageTransitioning = true; + + // If the caller passed us a url, call loadPage() + // to make sure it is loaded into the DOM. We'll listen + // to the promise object it returns so we know when + // it is done loading or if an error ocurred. + if ( typeof toPage == "string" ) { + $.mobile.loadPage( toPage, settings ) + .done(function( url, options, newPage, dupCachedPage ) { + isPageTransitioning = false; + options.duplicateCachedPage = dupCachedPage; + $.mobile.changePage( newPage, options ); + }) + .fail(function( url, options ) { + isPageTransitioning = false; + + //clear out the active button state + removeActiveLinkClass( true ); + + //release transition lock so navigation is free again + releasePageTransitionLock(); + settings.pageContainer.trigger( "pagechangefailed", triggerData ); + }); + return; + } + + // If we are going to the first-page of the application, we need to make + // sure settings.dataUrl is set to the application document url. This allows + // us to avoid generating a document url with an id hash in the case where the + // first-page of the document has an id attribute specified. + if ( toPage[ 0 ] === $.mobile.firstPage[ 0 ] && !settings.dataUrl ) { + settings.dataUrl = documentUrl.hrefNoHash; + } + + // The caller passed us a real page DOM element. Update our + // internal state and then trigger a transition to the page. + var fromPage = settings.fromPage, + url = ( settings.dataUrl && path.convertUrlToDataUrl( settings.dataUrl ) ) || toPage.jqmData( "url" ), + // The pageUrl var is usually the same as url, except when url is obscured as a dialog url. pageUrl always contains the file path + pageUrl = url, + fileUrl = path.getFilePath( url ), + active = urlHistory.getActive(), + activeIsInitialPage = urlHistory.activeIndex === 0, + historyDir = 0, + pageTitle = document.title, + isDialog = settings.role === "dialog" || toPage.jqmData( "role" ) === "dialog"; + + // By default, we prevent changePage requests when the fromPage and toPage + // are the same element, but folks that generate content manually/dynamically + // and reuse pages want to be able to transition to the same page. To allow + // this, they will need to change the default value of allowSamePageTransition + // to true, *OR*, pass it in as an option when they manually call changePage(). + // It should be noted that our default transition animations assume that the + // formPage and toPage are different elements, so they may behave unexpectedly. + // It is up to the developer that turns on the allowSamePageTransitiona option + // to either turn off transition animations, or make sure that an appropriate + // animation transition is used. + if( fromPage && fromPage[0] === toPage[0] && !settings.allowSamePageTransition ) { + isPageTransitioning = false; + mpc.trigger( "pagechange", triggerData ); + return; + } + + // We need to make sure the page we are given has already been enhanced. + enhancePage( toPage, settings.role ); + + // If the changePage request was sent from a hashChange event, check to see if the + // page is already within the urlHistory stack. If so, we'll assume the user hit + // the forward/back button and will try to match the transition accordingly. + if( settings.fromHashChange ) { + urlHistory.directHashChange({ + currentUrl: url, + isBack: function() { historyDir = -1; }, + isForward: function() { historyDir = 1; } + }); + } + + // Kill the keyboard. + // XXX_jblas: We need to stop crawling the entire document to kill focus. Instead, + // we should be tracking focus with a delegate() handler so we already have + // the element in hand at this point. + // Wrap this in a try/catch block since IE9 throw "Unspecified error" if document.activeElement + // is undefined when we are in an IFrame. + try { + if(document.activeElement && document.activeElement.nodeName.toLowerCase() != 'body') { + $(document.activeElement).blur(); + } else { + $( "input:focus, textarea:focus, select:focus" ).blur(); + } + } catch(e) {} + + // If we're displaying the page as a dialog, we don't want the url + // for the dialog content to be used in the hash. Instead, we want + // to append the dialogHashKey to the url of the current page. + if ( isDialog && active ) { + // on the initial page load active.url is undefined and in that case should + // be an empty string. Moving the undefined -> empty string back into + // urlHistory.addNew seemed imprudent given undefined better represents + // the url state + url = ( active.url || "" ) + dialogHashKey; + } + + // Set the location hash. + if( settings.changeHash !== false && url ) { + //disable hash listening temporarily + urlHistory.ignoreNextHashChange = true; + //update hash and history + path.set( url ); + } + + // if title element wasn't found, try the page div data attr too + // If this is a deep-link or a reload ( active === undefined ) then just use pageTitle + var newPageTitle = ( !active )? pageTitle : toPage.jqmData( "title" ) || toPage.children(":jqmData(role='header')").find(".ui-title" ).getEncodedText(); + if( !!newPageTitle && pageTitle == document.title ) { + pageTitle = newPageTitle; + } + if ( !toPage.jqmData( "title" ) ) { + toPage.jqmData( "title", pageTitle ); + } + + // Make sure we have a transition defined. + settings.transition = settings.transition + || ( ( historyDir && !activeIsInitialPage ) ? active.transition : undefined ) + || ( isDialog ? $.mobile.defaultDialogTransition : $.mobile.defaultPageTransition ); + + //add page to history stack if it's not back or forward + if( !historyDir ) { + urlHistory.addNew( url, settings.transition, pageTitle, pageUrl, settings.role ); + } + + //set page title + document.title = urlHistory.getActive().title; + + //set "toPage" as activePage + $.mobile.activePage = toPage; + + // If we're navigating back in the URL history, set reverse accordingly. + settings.reverse = settings.reverse || historyDir < 0; + + transitionPages( toPage, fromPage, settings.transition, settings.reverse ) + .done(function( name, reverse, $to, $from, alreadyFocused ) { + removeActiveLinkClass(); + + //if there's a duplicateCachedPage, remove it from the DOM now that it's hidden + if ( settings.duplicateCachedPage ) { + settings.duplicateCachedPage.remove(); + } + + // Send focus to the newly shown page. Moved from promise .done binding in transitionPages + // itself to avoid ie bug that reports offsetWidth as > 0 (core check for visibility) + // despite visibility: hidden addresses issue #2965 + // https://github.com/jquery/jquery-mobile/issues/2965 + if( !alreadyFocused ){ + $.mobile.focusPage( toPage ); + } + + releasePageTransitionLock(); + + // Let listeners know we're all done changing the current page. + mpc.trigger( "pagechange", triggerData ); + }); + }; + + $.mobile.changePage.defaults = { + transition: undefined, + reverse: false, + changeHash: true, + fromHashChange: false, + role: undefined, // By default we rely on the role defined by the @data-role attribute. + duplicateCachedPage: undefined, + pageContainer: undefined, + showLoadMsg: true, //loading message shows by default when pages are being fetched during changePage + dataUrl: undefined, + fromPage: undefined, + allowSamePageTransition: false + }; + +/* Event Bindings - hashchange, submit, and click */ + function findClosestLink( ele ) + { + while ( ele ) { + // Look for the closest element with a nodeName of "a". + // Note that we are checking if we have a valid nodeName + // before attempting to access it. This is because the + // node we get called with could have originated from within + // an embedded SVG document where some symbol instance elements + // don't have nodeName defined on them, or strings are of type + // SVGAnimatedString. + if ( ( typeof ele.nodeName === "string" ) && ele.nodeName.toLowerCase() == "a" ) { + break; + } + ele = ele.parentNode; + } + return ele; + } + + // The base URL for any given element depends on the page it resides in. + function getClosestBaseUrl( ele ) + { + // Find the closest page and extract out its url. + var url = $( ele ).closest( ".ui-page" ).jqmData( "url" ), + base = documentBase.hrefNoHash; + + if ( !url || !path.isPath( url ) ) { + url = base; + } + + return path.makeUrlAbsolute( url, base); + } + + + //The following event bindings should be bound after mobileinit has been triggered + //the following function is called in the init file + $.mobile._registerInternalEvents = function(){ + + //bind to form submit events, handle with Ajax + $( document ).delegate( "form", "submit", function( event ) { + var $this = $( this ); + + if( !$.mobile.ajaxEnabled || + // test that the form is, itself, ajax false + $this.is(":jqmData(ajax='false')") || + // test that $.mobile.ignoreContentEnabled is set and + // the form or one of it's parents is ajax=false + !$this.jqmHijackable().length ) { + return; + } + + var type = $this.attr( "method" ), + target = $this.attr( "target" ), + url = $this.attr( "action" ); + + // If no action is specified, browsers default to using the + // URL of the document containing the form. Since we dynamically + // pull in pages from external documents, the form should submit + // to the URL for the source document of the page containing + // the form. + if ( !url ) { + // Get the @data-url for the page containing the form. + url = getClosestBaseUrl( $this ); + if ( url === documentBase.hrefNoHash ) { + // The url we got back matches the document base, + // which means the page must be an internal/embedded page, + // so default to using the actual document url as a browser + // would. + url = documentUrl.hrefNoSearch; + } + } + + url = path.makeUrlAbsolute( url, getClosestBaseUrl($this) ); + + //external submits use regular HTTP + if( path.isExternal( url ) || target ) { + return; + } + + $.mobile.changePage( + url, + { + type: type && type.length && type.toLowerCase() || "get", + data: $this.serialize(), + transition: $this.jqmData( "transition" ), + direction: $this.jqmData( "direction" ), + reloadPage: true + } + ); + event.preventDefault(); + }); + + //add active state on vclick + $( 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 ) { + return; + } + + var link = findClosestLink( event.target ); + + // split from the previous return logic to avoid find closest where possible + // TODO teach $.mobile.hijackable to operate on raw dom elements so the link wrapping + // can be avoided + if ( !$(link).jqmHijackable().length ) { + return; + } + + if ( link ) { + if ( path.parseUrl( link.getAttribute( "href" ) || "#" ).hash !== "#" ) { + removeActiveLinkClass( true ); + $activeClickedLink = $( link ).closest( ".ui-btn" ).not( ".ui-disabled" ); + $activeClickedLink.addClass( $.mobile.activeBtnClass ); + $( "." + $.mobile.activePageClass + " .ui-btn" ).not( link ).blur(); + + // By caching the href value to data and switching the href to a #, we can avoid address bar showing in iOS. The click handler resets the href during its initial steps if this data is present + $( link ) + .jqmData( "href", $( link ).attr( "href" ) ) + .attr( "href", "#" ); + } + } + }); + + // click routing - direct to HTTP or Ajax, accordingly + $( document ).bind( "click", function( event ) { + if( !$.mobile.linkBindingEnabled ){ + return; + } + + var link = findClosestLink( event.target ), $link = $( link ), httpCleanup; + + // If there is no link associated with the click or its not a left + // click we want to ignore the click + // TODO teach $.mobile.hijackable to operate on raw dom elements so the link wrapping + // can be avoided + if ( !link || event.which > 1 || !$link.jqmHijackable().length ) { + return; + } + + //remove active link class if external (then it won't be there if you come back) + httpCleanup = function(){ + window.setTimeout( function() { removeActiveLinkClass( true ); }, 200 ); + }; + + // If there's data cached for the real href value, set the link's href back to it again. This pairs with an address bar workaround from the vclick handler + if( $link.jqmData( "href" ) ){ + $link.attr( "href", $link.jqmData( "href" ) ); + } + + //if there's a data-rel=back attr, go back in history + if( $link.is( ":jqmData(rel='back')" ) ) { + window.history.back(); + return false; + } + + var baseUrl = getClosestBaseUrl( $link ), + + //get href, if defined, otherwise default to empty hash + href = path.makeUrlAbsolute( $link.attr( "href" ) || "#", baseUrl ); + + //if ajax is disabled, exit early + if( !$.mobile.ajaxEnabled && !path.isEmbeddedPage( href ) ){ + httpCleanup(); + //use default click handling + return; + } + + // XXX_jblas: Ideally links to application pages should be specified as + // an url to the application document with a hash that is either + // the site relative path or id to the page. But some of the + // internal code that dynamically generates sub-pages for nested + // lists and select dialogs, just write a hash in the link they + // create. This means the actual URL path is based on whatever + // the current value of the base tag is at the time this code + // is called. For now we are just assuming that any url with a + // hash in it is an application page reference. + if ( href.search( "#" ) != -1 ) { + href = href.replace( /[^#]*#/, "" ); + if ( !href ) { + //link was an empty hash meant purely + //for interaction, so we ignore it. + event.preventDefault(); + return; + } else if ( path.isPath( href ) ) { + //we have apath so make it the href we want to load. + href = path.makeUrlAbsolute( href, baseUrl ); + } else { + //we have a simple id so use the documentUrl as its base. + href = path.makeUrlAbsolute( "#" + href, documentUrl.hrefNoHash ); + } + } + + // Should we handle this link, or let the browser deal with it? + var useDefaultUrlHandling = $link.is( "[rel='external']" ) || $link.is( ":jqmData(ajax='false')" ) || $link.is( "[target]" ), + + // Some embedded browsers, like the web view in Phone Gap, allow cross-domain XHR + // requests if the document doing the request was loaded via the file:// protocol. + // This is usually to allow the application to "phone home" and fetch app specific + // data. We normally let the browser handle external/cross-domain urls, but if the + // allowCrossDomainPages option is true, we will allow cross-domain http/https + // requests to go through our page loading logic. + isCrossDomainPageLoad = ( $.mobile.allowCrossDomainPages && documentUrl.protocol === "file:" && href.search( /^https?:/ ) != -1 ), + + //check for protocol or rel and its not an embedded page + //TODO overlap in logic from isExternal, rel=external check should be + // moved into more comprehensive isExternalLink + isExternal = useDefaultUrlHandling || ( path.isExternal( href ) && !isCrossDomainPageLoad ); + + if( isExternal ) { + httpCleanup(); + //use default click handling + return; + } + + //use ajax + var transition = $link.jqmData( "transition" ), + direction = $link.jqmData( "direction" ), + reverse = ( direction && direction === "reverse" ) || + // deprecated - remove by 1.0 + $link.jqmData( "back" ), + + //this may need to be more specific as we use data-rel more + role = $link.attr( "data-" + $.mobile.ns + "rel" ) || undefined; + + $.mobile.changePage( href, { transition: transition, reverse: reverse, role: role } ); + event.preventDefault(); + }); + + //prefetch pages when anchors with data-prefetch are encountered + $( document ).delegate( ".ui-page", "pageshow.prefetch", function() { + var urls = []; + $( this ).find( "a:jqmData(prefetch)" ).each(function(){ + var $link = $(this), + url = $link.attr( "href" ); + + if ( url && $.inArray( url, urls ) === -1 ) { + urls.push( url ); + + $.mobile.loadPage( url, {role: $link.attr("data-" + $.mobile.ns + "rel")} ); + } + }); + }); + + $.mobile._handleHashChange = function( hash ) { + //find first page via hash + var to = path.stripHash( hash ), + //transition is false if it's the first page, undefined otherwise (and may be overridden by default) + transition = $.mobile.urlHistory.stack.length === 0 ? "none" : undefined, + + // default options for the changPage calls made after examining the current state + // of the page and the hash + changePageOptions = { + transition: transition, + changeHash: false, + fromHashChange: true + }; + + //if listening is disabled (either globally or temporarily), or it's a dialog hash + if( !$.mobile.hashListeningEnabled || urlHistory.ignoreNextHashChange ) { + urlHistory.ignoreNextHashChange = false; + return; + } + + // special case for dialogs + if( urlHistory.stack.length > 1 && to.indexOf( dialogHashKey ) > -1 ) { + + // If current active page is not a dialog skip the dialog and continue + // in the same direction + if(!$.mobile.activePage.is( ".ui-dialog" )) { + //determine if we're heading forward or backward and continue accordingly past + //the current dialog + urlHistory.directHashChange({ + currentUrl: to, + isBack: function() { window.history.back(); }, + isForward: function() { window.history.forward(); } + }); + + // prevent changePage() + return; + } else { + // if the current active page is a dialog and we're navigating + // to a dialog use the dialog objected saved in the stack + urlHistory.directHashChange({ + currentUrl: to, + + // regardless of the direction of the history change + // do the following + either: function( isBack ) { + var active = $.mobile.urlHistory.getActive(); + + to = active.pageUrl; + + // make sure to set the role, transition and reversal + // as most of this is lost by the domCache cleaning + $.extend( changePageOptions, { + role: active.role, + transition: active.transition, + reverse: isBack + }); + } + }); + } + } + + //if to is defined, load it + if ( to ) { + // At this point, 'to' can be one of 3 things, a cached page element from + // a history stack entry, an id, or site-relative/absolute URL. If 'to' is + // an id, we need to resolve it against the documentBase, not the location.href, + // since the hashchange could've been the result of a forward/backward navigation + // that crosses from an external page/dialog to an internal page/dialog. + to = ( typeof to === "string" && !path.isPath( to ) ) ? ( path.makeUrlAbsolute( '#' + to, documentBase ) ) : to; + $.mobile.changePage( to, changePageOptions ); + } else { + //there's no hash, go to the first page in the dom + $.mobile.changePage( $.mobile.firstPage, changePageOptions ); + } + }; + + //hashchange event handler + $window.bind( "hashchange", function( e, triggered ) { + $.mobile._handleHashChange( location.hash ); + }); + + //set page min-heights to be device specific + $( document ).bind( "pageshow", resetActivePageHeight ); + $( window ).bind( "throttledresize", resetActivePageHeight ); + + };//_registerInternalEvents callback + +})( jQuery ); +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +}); +//>>excludeEnd("jqmBuildExclude"); diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.navigation.pushstate.js b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.navigation.pushstate.js new file mode 100644 index 0000000..85a524e --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.navigation.pushstate.js @@ -0,0 +1,163 @@ +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +//>>description: history.pushState support, layered on top of hashchange. +//>>label: Pushstate Support +//>>group: Navigation + +define( [ "jquery", "./jquery.mobile.navigation", "../external/requirejs/depend!./jquery.mobile.hashchange[jquery]" ], function( $ ) { +//>>excludeEnd("jqmBuildExclude"); +( function( $, window ) { + // For now, let's Monkeypatch this onto the end of $.mobile._registerInternalEvents + // Scope self to pushStateHandler so we can reference it sanely within the + // methods handed off as event handlers + var pushStateHandler = {}, + self = pushStateHandler, + $win = $( window ), + url = $.mobile.path.parseUrl( location.href ); + + $.extend( pushStateHandler, { + // TODO move to a path helper, this is rather common functionality + initialFilePath: (function() { + return url.pathname + url.search; + })(), + + initialHref: url.hrefNoHash, + + state: function() { + return { + hash: location.hash || "#" + self.initialFilePath, + title: document.title, + + // persist across refresh + initialHref: self.initialHref + }; + }, + + resetUIKeys: function( url ) { + var dialog = $.mobile.dialogHashKey, + subkey = "&" + $.mobile.subPageUrlKey, + dialogIndex = url.indexOf( dialog ); + + if( dialogIndex > -1 ) { + url = url.slice( 0, dialogIndex ) + "#" + url.slice( dialogIndex ); + } else if( url.indexOf( subkey ) > -1 ) { + url = url.split( subkey ).join( "#" + subkey ); + } + + return url; + }, + + hashValueAfterReset: function( url ) { + var resetUrl = self.resetUIKeys( url ); + return $.mobile.path.parseUrl( resetUrl ).hash; + }, + + // TODO sort out a single barrier to hashchange functionality + nextHashChangePrevented: function( value ) { + $.mobile.urlHistory.ignoreNextHashChange = value; + self.onHashChangeDisabled = value; + }, + + // on hash change we want to clean up the url + // NOTE this takes place *after* the vanilla navigation hash change + // handling has taken place and set the state of the DOM + onHashChange: function( e ) { + // disable this hash change + if( self.onHashChangeDisabled ){ + return; + } + + var href, state, + hash = location.hash, + isPath = $.mobile.path.isPath( hash ), + resolutionUrl = isPath ? location.href : $.mobile.getDocumentUrl(); + + hash = isPath ? hash.replace( "#", "" ) : hash; + + + // propulate the hash when its not available + state = self.state(); + + // make the hash abolute with the current href + href = $.mobile.path.makeUrlAbsolute( hash, resolutionUrl ); + + if ( isPath ) { + href = self.resetUIKeys( href ); + } + + // replace the current url with the new href and store the state + // Note that in some cases we might be replacing an url with the + // same url. We do this anyways because we need to make sure that + // all of our history entries have a state object associated with + // them. This allows us to work around the case where window.history.back() + // is called to transition from an external page to an embedded page. + // In that particular case, a hashchange event is *NOT* generated by the browser. + // Ensuring each history entry has a state object means that onPopState() + // will always trigger our hashchange callback even when a hashchange event + // is not fired. + history.replaceState( state, document.title, href ); + }, + + // on popstate (ie back or forward) we need to replace the hash that was there previously + // cleaned up by the additional hash handling + onPopState: function( e ) { + var poppedState = e.originalEvent.state, + timeout, fromHash, toHash, hashChanged; + + // if there's no state its not a popstate we care about, eg chrome's initial popstate + if( poppedState ) { + // the active url in the history stack will still be from the previous state + // so we can use it to verify if a hashchange will be fired from the popstate + fromHash = self.hashValueAfterReset( $.mobile.urlHistory.getActive().url ); + + // the hash stored in the state popped off the stack will be our currenturl or + // the url to which we wish to navigate + toHash = self.hashValueAfterReset( poppedState.hash.replace("#", "") ); + + // if the hashes of the urls are different we must assume that the browser + // will fire a hashchange + hashChanged = fromHash !== toHash; + + // unlock hash handling once the hashchange caused be the popstate has fired + if( hashChanged ) { + $win.one( "hashchange.pushstate", function() { + self.nextHashChangePrevented( false ); + }); + } + + // enable hash handling for the the _handleHashChange call + self.nextHashChangePrevented( false ); + + // change the page based on the hash + $.mobile._handleHashChange( poppedState.hash ); + + // only prevent another hash change handling if a hash change will be fired + // by the browser + if( hashChanged ) { + // disable hash handling until one of the above timers fires + self.nextHashChangePrevented( true ); + } + } + }, + + init: function() { + $win.bind( "hashchange", self.onHashChange ); + + // Handle popstate events the occur through history changes + $win.bind( "popstate", self.onPopState ); + + // if there's no hash, we need to replacestate for returning to home + if ( location.hash === "" ) { + history.replaceState( self.state(), document.title, location.href ); + } + } + }); + + $( function() { + if( $.mobile.pushStateEnabled && $.support.pushState ){ + pushStateHandler.init(); + } + }); +})( jQuery, this ); +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +}); +//>>excludeEnd("jqmBuildExclude"); diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.nojs.js b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.nojs.js new file mode 100644 index 0000000..7137ebd --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.nojs.js @@ -0,0 +1,18 @@ +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +//>>description: Adds class to make elements hidden to A grade browsers +//>>label: “nojs” Classes +//>>group: Utilities + +define( [ "jquery" ], function( $ ) { +//>>excludeEnd("jqmBuildExclude"); +(function( $, undefined ) { + +$( document ).bind( "pagecreate create", function( e ){ + $( ":jqmData(role='nojs')", e.target ).addClass( "ui-nojs" ); + +}); + +})( jQuery ); +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +}); +//>>excludeEnd("jqmBuildExclude"); diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.page.js b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.page.js new file mode 100644 index 0000000..d2bd195 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.page.js @@ -0,0 +1,63 @@ +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +//>>description: Basic page definition and formatting. +//>>label: Page Creation +//>>group: Core + +define( [ "jquery", "./jquery.mobile.widget" ], function( $ ) { +//>>excludeEnd("jqmBuildExclude"); +(function( $, undefined ) { + +$.widget( "mobile.page", $.mobile.widget, { + options: { + theme: "c", + domCache: false, + keepNativeDefault: ":jqmData(role='none'), :jqmData(role='nojs')" + }, + + _create: function() { + + var self = this; + + // if false is returned by the callbacks do not create the page + if( self._trigger( "beforecreate" ) === false ){ + return false; + } + + self.element + .attr( "tabindex", "0" ) + .addClass( "ui-page ui-body-" + self.options.theme ) + .bind( "pagebeforehide", function(){ + self.removeContainerBackground(); + } ) + .bind( "pagebeforeshow", function(){ + self.setContainerBackground(); + } ); + + }, + + removeContainerBackground: function(){ + $.mobile.pageContainer.removeClass( "ui-overlay-" + $.mobile.getInheritedTheme( this.element.parent() ) ); + }, + + // set the page container background to the page theme + setContainerBackground: function( theme ){ + if( this.options.theme ){ + $.mobile.pageContainer.addClass( "ui-overlay-" + ( theme || this.options.theme ) ); + } + }, + + keepNativeSelector: function() { + var options = this.options, + keepNativeDefined = options.keepNative && $.trim(options.keepNative); + + if( keepNativeDefined && options.keepNative !== options.keepNativeDefault ){ + return [options.keepNative, options.keepNativeDefault].join(", "); + } + + return options.keepNativeDefault; + } +}); +})( jQuery ); +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +}); +//>>excludeEnd("jqmBuildExclude"); diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.page.sections.js b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.page.sections.js new file mode 100644 index 0000000..e0a718d --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.page.sections.js @@ -0,0 +1,97 @@ +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +//>>description: Theming and layout of headers, footers, and content areas +//>>label: Page Sections +//>>group: Core + +define( [ "jquery", "./jquery.mobile.page", "./jquery.mobile.core", "./jquery.mobile.buttonMarkup" ], function( $ ) { +//>>excludeEnd("jqmBuildExclude"); +(function( $, undefined ) { + +$.mobile.page.prototype.options.backBtnText = "Back"; +$.mobile.page.prototype.options.addBackBtn = false; +$.mobile.page.prototype.options.backBtnTheme = null; +$.mobile.page.prototype.options.headerTheme = "a"; +$.mobile.page.prototype.options.footerTheme = "a"; +$.mobile.page.prototype.options.contentTheme = null; + +$( document ).delegate( ":jqmData(role='page'), :jqmData(role='dialog')", "pagecreate", function( e ) { + + var $page = $( this ), + o = $page.data( "page" ).options, + pageRole = $page.jqmData( "role" ), + pageTheme = o.theme; + + $( ":jqmData(role='header'), :jqmData(role='footer'), :jqmData(role='content')", this ) + .jqmEnhanceable() + .each(function() { + + var $this = $( this ), + role = $this.jqmData( "role" ), + theme = $this.jqmData( "theme" ), + contentTheme = theme || o.contentTheme || ( pageRole === "dialog" && pageTheme ), + $headeranchors, + leftbtn, + rightbtn, + backBtn; + + $this.addClass( "ui-" + role ); + + //apply theming and markup modifications to page,header,content,footer + if ( role === "header" || role === "footer" ) { + + var thisTheme = theme || ( role === "header" ? o.headerTheme : o.footerTheme ) || pageTheme; + + $this + //add theme class + .addClass( "ui-bar-" + thisTheme ) + // Add ARIA role + .attr( "role", role === "header" ? "banner" : "contentinfo" ); + + if( role === "header") { + // Right,left buttons + $headeranchors = $this.children( "a" ); + leftbtn = $headeranchors.hasClass( "ui-btn-left" ); + rightbtn = $headeranchors.hasClass( "ui-btn-right" ); + + leftbtn = leftbtn || $headeranchors.eq( 0 ).not( ".ui-btn-right" ).addClass( "ui-btn-left" ).length; + + rightbtn = rightbtn || $headeranchors.eq( 1 ).addClass( "ui-btn-right" ).length; + } + + // Auto-add back btn on pages beyond first view + if ( o.addBackBtn && + role === "header" && + $( ".ui-page" ).length > 1 && + $page.jqmData( "url" ) !== $.mobile.path.stripHash( location.hash ) && + !leftbtn ) { + + backBtn = $( "
      "+ o.backBtnText +"" ) + // If theme is provided, override default inheritance + .attr( "data-"+ $.mobile.ns +"theme", o.backBtnTheme || thisTheme ) + .prependTo( $this ); + } + + // Page title + $this.children( "h1, h2, h3, h4, h5, h6" ) + .addClass( "ui-title" ) + // Regardless of h element number in src, it becomes h1 for the enhanced page + .attr({ + "role": "heading", + "aria-level": "1" + }); + + } else if ( role === "content" ) { + if ( contentTheme ) { + $this.addClass( "ui-body-" + ( contentTheme ) ); + } + + // Add ARIA role + $this.attr( "role", "main" ); + } + }); +}); + +})( jQuery ); +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +}); +//>>excludeEnd("jqmBuildExclude"); diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.support.js b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.support.js new file mode 100644 index 0000000..58483b4 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.support.js @@ -0,0 +1,168 @@ +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +//>>description: Assorted tests to qualify browsers by detecting features +//>>label: Support Tests +//>>group: Core +//>>required: true + +define( [ "jquery", "./jquery.mobile.media", "./jquery.mobile.core" ], function( $ ) { +//>>excludeEnd("jqmBuildExclude"); +(function( $, undefined ) { + +var fakeBody = $( "" ).prependTo( "html" ), + fbCSS = fakeBody[ 0 ].style, + vendors = [ "Webkit", "Moz", "O" ], + webos = "palmGetResource" in window, //only used to rule out scrollTop + operamini = window.operamini && ({}).toString.call( window.operamini ) === "[object OperaMini]", + bb = window.blackberry; //only used to rule out box shadow, as it's filled opaque on BB + +// thx Modernizr +function propExists( prop ) { + var uc_prop = prop.charAt( 0 ).toUpperCase() + prop.substr( 1 ), + props = ( prop + " " + vendors.join( uc_prop + " " ) + uc_prop ).split( " " ); + + for ( var v in props ){ + if ( fbCSS[ props[ v ] ] !== undefined ) { + return true; + } + } +} + +function validStyle( prop, value, check_vend ) { + var div = document.createElement('div'), + uc = function( txt ) { + return txt.charAt( 0 ).toUpperCase() + txt.substr( 1 ) + }, + vend_pref = function( vend ) { + return "-" + vend.charAt( 0 ).toLowerCase() + vend.substr( 1 ) + "-"; + }, + check_style = function( vend ) { + var vend_prop = vend_pref( vend ) + prop + ": " + value + ";", + uc_vend = uc( vend ), + propStyle = uc_vend + uc( prop ); + + div.setAttribute( "style", vend_prop ); + + if( !!div.style[ propStyle ] ) { + ret = true; + } + }, + check_vends = check_vend ? [ check_vend ] : vendors, + ret; + + for( i = 0; i < check_vends.length; i++ ) { + check_style( check_vends[i] ); + } + return !!ret; +} + +// Thanks to Modernizr src for this test idea. `perspective` check is limited to Moz to prevent a false positive for 3D transforms on Android. +function transform3dTest() { + var prop = "transform-3d"; + return validStyle( 'perspective', '10px', 'moz' ) || $.mobile.media( "(-" + vendors.join( "-" + prop + "),(-" ) + "-" + prop + "),(" + prop + ")" ); +} + +// Test for dynamic-updating base tag support ( allows us to avoid href,src attr rewriting ) +function baseTagTest() { + var fauxBase = location.protocol + "//" + location.host + location.pathname + "ui-dir/", + base = $( "head base" ), + fauxEle = null, + href = "", + link, rebase; + + if ( !base.length ) { + base = fauxEle = $( "", { "href": fauxBase }).appendTo( "head" ); + } else { + href = base.attr( "href" ); + } + + link = $( "" ).prependTo( fakeBody ); + rebase = link[ 0 ].href; + base[ 0 ].href = href || location.pathname; + + if ( fauxEle ) { + fauxEle.remove(); + } + return rebase.indexOf( fauxBase ) === 0; +} + + +// non-UA-based IE version check by James Padolsey, modified by jdalton - from http://gist.github.com/527683 +// allows for inclusion of IE 6+, including Windows Mobile 7 +$.extend( $.mobile, { browser: {} } ); +$.mobile.browser.ie = (function() { + var v = 3, + div = document.createElement( "div" ), + a = div.all || []; + + // added {} to silence closure compiler warnings. registering my dislike of all things + // overly clever here for future reference + while ( div.innerHTML = "", a[ 0 ] ){}; + + return v > 4 ? v : !v; +})(); + + +$.extend( $.support, { + orientation: "orientation" in window && "onorientationchange" in window, + touch: "ontouchend" in document, + cssTransitions: "WebKitTransitionEvent" in window || validStyle( 'transition', 'height 100ms linear' ), + pushState: "pushState" in history && "replaceState" in history, + mediaquery: $.mobile.media( "only all" ), + cssPseudoElement: !!propExists( "content" ), + touchOverflow: !!propExists( "overflowScrolling" ), + cssTransform3d: transform3dTest(), + boxShadow: !!propExists( "boxShadow" ) && !bb, + scrollTop: ( "pageXOffset" in window || "scrollTop" in document.documentElement || "scrollTop" in fakeBody[ 0 ] ) && !webos && !operamini, + dynamicBaseTag: baseTagTest() +}); + +fakeBody.remove(); + + +// $.mobile.ajaxBlacklist is used to override ajaxEnabled on platforms that have known conflicts with hash history updates (BB5, Symbian) +// or that generally work better browsing in regular http for full page refreshes (Opera Mini) +// Note: This detection below is used as a last resort. +// We recommend only using these detection methods when all other more reliable/forward-looking approaches are not possible +var nokiaLTE7_3 = (function(){ + + var ua = window.navigator.userAgent; + + //The following is an attempt to match Nokia browsers that are running Symbian/s60, with webkit, version 7.3 or older + return ua.indexOf( "Nokia" ) > -1 && + ( ua.indexOf( "Symbian/3" ) > -1 || ua.indexOf( "Series60/5" ) > -1 ) && + ua.indexOf( "AppleWebKit" ) > -1 && + ua.match( /(BrowserNG|NokiaBrowser)\/7\.[0-3]/ ); +})(); + +// Support conditions that must be met in order to proceed +// default enhanced qualifications are media query support OR IE 7+ +$.mobile.gradeA = function(){ + return $.support.mediaquery || $.mobile.browser.ie && $.mobile.browser.ie >= 7; +}; + +$.mobile.ajaxBlacklist = + // BlackBerry browsers, pre-webkit + window.blackberry && !window.WebKitPoint || + // Opera Mini + operamini || + // Symbian webkits pre 7.3 + nokiaLTE7_3; + +// Lastly, this workaround is the only way we've found so far to get pre 7.3 Symbian webkit devices +// to render the stylesheets when they're referenced before this script, as we'd recommend doing. +// This simply reappends the CSS in place, which for some reason makes it apply +if ( nokiaLTE7_3 ) { + $(function() { + $( "head link[rel='stylesheet']" ).attr( "rel", "alternate stylesheet" ).attr( "rel", "stylesheet" ); + }); +} + +// For ruling out shadows via css +if ( !$.support.boxShadow ) { + $( "html" ).addClass( "ui-mobile-nosupport-boxshadow" ); +} + +})( jQuery ); +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +}); +//>>excludeEnd("jqmBuildExclude"); diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.support.orientation.js b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.support.orientation.js new file mode 100644 index 0000000..0991383 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.support.orientation.js @@ -0,0 +1,15 @@ +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +//>>description: Feature test for orientation +//>>label: Orientation support test +//>>group: Core + +define( [ "jquery" ], function( jQuery ) { +//>>excludeEnd("jqmBuildExclude"); + (function( $, undefined ) { + $.extend( $.support, { + orientation: "orientation" in window && "onorientationchange" in window + }); + }( jQuery )); +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +}); +//>>excludeEnd("jqmBuildExclude"); diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.support.touch.js b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.support.touch.js new file mode 100644 index 0000000..9cba62a --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.support.touch.js @@ -0,0 +1,20 @@ +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +//>>description: Touch feature test +//>>label: Touch support test +//>>group: Core + +define( [ "jquery" ], function( jQuery ) { +//>>excludeEnd("jqmBuildExclude"); + (function( $, undefined ) { + var support = { + touch: "ontouchend" in document + }; + + $.mobile = $.mobile || {}; + $.mobile.support = $.mobile.support || {}; + $.extend( $.support, support ); + $.extend( $.mobile.support, support ); + }( jQuery )); +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +}); +//>>excludeEnd("jqmBuildExclude"); diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.transition.flip.js b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.transition.flip.js new file mode 100644 index 0000000..143c6c2 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.transition.flip.js @@ -0,0 +1,20 @@ +/* +* fallback transition for flip in non-3D supporting browsers (which tend to handle complex transitions poorly in general +*/ + +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +//>>description: Animation styles and fallback transition definition for non-3D supporting browsers +//>>label: Flip Transition +//>>group: Transitions +//>>css: ../css/structure/jquery.mobile.transition.flip.css + +define( [ "jquery", "./jquery.mobile.transition" ], function( $ ) { +//>>excludeEnd("jqmBuildExclude"); +(function( $, window, undefined ) { + +$.mobile.transitionFallbacks.flip = "fade"; + +})( jQuery, this ); +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +}); +//>>excludeEnd("jqmBuildExclude"); \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.transition.flow.js b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.transition.flow.js new file mode 100644 index 0000000..2d1a2d9 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.transition.flow.js @@ -0,0 +1,20 @@ +/* +* fallback transition for flow in non-3D supporting browsers (which tend to handle complex transitions poorly in general +*/ + +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +//>>description: Animation styles and fallback transition definition for non-3D supporting browsers +//>>label: Flow Transition +//>>group: Transitions +//>>css: ../css/structure/jquery.mobile.transition.flow.css + +define( [ "jquery", "./jquery.mobile.transition" ], function( $ ) { +//>>excludeEnd("jqmBuildExclude"); +(function( $, window, undefined ) { + +$.mobile.transitionFallbacks.flow = "fade"; + +})( jQuery, this ); +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +}); +//>>excludeEnd("jqmBuildExclude"); \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.transition.js b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.transition.js new file mode 100644 index 0000000..9a099dc --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.transition.js @@ -0,0 +1,153 @@ + +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +//>>description: Animated page change core logic and sequence handlers +//>>label: Transition Core +//>>group: Transitions +//>>css: ../css/themes/default/jquery.mobile.theme.css, ../css/structure/jquery.mobile.transition.css + +define( [ "jquery", "./jquery.mobile.core" ], function( $ ) { +//>>excludeEnd("jqmBuildExclude"); +(function( $, window, undefined ) { + +var createHandler = function( sequential ){ + + // Default to sequential + if( sequential === undefined ){ + sequential = true; + } + + return function( name, reverse, $to, $from ) { + + var deferred = new $.Deferred(), + reverseClass = reverse ? " reverse" : "", + 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", + toggleViewportClass = function(){ + $.mobile.pageContainer.toggleClass( "ui-mobile-viewport-transitioning viewport-" + name ); + }, + scrollPage = function(){ + // By using scrollTo instead of silentScroll, we can keep things better in order + // Just to be precautios, disable scrollstart listening like silentScroll would + $.event.special.scrollstart.enabled = false; + + window.scrollTo( 0, toScroll ); + + // reenable scrollstart listening like silentScroll would + setTimeout(function() { + $.event.special.scrollstart.enabled = true; + }, 150 ); + }, + cleanFrom = function(){ + $from + .removeClass( $.mobile.activePageClass + " out in reverse " + name ) + .height( "" ); + }, + startOut = function(){ + // if it's not sequential, call the doneOut transition to start the TO page animating in simultaneously + if( !sequential ){ + doneOut(); + } + else { + $from.animationComplete( doneOut ); + } + + // 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() ) + .addClass( name + " out" + reverseClass ); + }, + + doneOut = function() { + + if ( $from && sequential ) { + cleanFrom(); + } + + startIn(); + }, + + startIn = function(){ + + $to.addClass( $.mobile.activePageClass ); + + // Send focus to page as it is now display: block + $.mobile.focusPage( $to ); + + // Set to page height + $to.height( screenHeight + toScroll ); + + scrollPage(); + + if( !none ){ + $to.animationComplete( doneIn ); + } + + $to.addClass( name + " in" + reverseClass ); + + if( none ){ + doneIn(); + } + + }, + + doneIn = function() { + + if ( !sequential ) { + + if( $from ){ + cleanFrom(); + } + } + + $to + .removeClass( "out in reverse " + name ) + .height( "" ); + + toggleViewportClass(); + + // 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 ){ + scrollPage(); + } + + deferred.resolve( name, reverse, $to, $from, true ); + }; + + toggleViewportClass(); + + if ( $from && !none ) { + startOut(); + } + else { + doneOut(); + } + + return deferred.promise(); + }; +} + +// generate the handlers from the above +var sequentialHandler = createHandler(), + simultaneousHandler = createHandler( false ); + +// Make our transition handler the public default. +$.mobile.defaultTransitionHandler = sequentialHandler; + +//transition handler dictionary for 3rd party transitions +$.mobile.transitionHandlers = { + "default": $.mobile.defaultTransitionHandler, + "sequential": sequentialHandler, + "simultaneous": simultaneousHandler +}; + +$.mobile.transitionFallbacks = {}; + +})( jQuery, this ); +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +}); +//>>excludeEnd("jqmBuildExclude"); \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.transition.pop.js b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.transition.pop.js new file mode 100644 index 0000000..bbb8f78 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.transition.pop.js @@ -0,0 +1,20 @@ +/* +* fallback transition for pop in non-3D supporting browsers (which tend to handle complex transitions poorly in general +*/ + +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +//>>description: Animation styles and fallback transition definition for non-3D supporting browsers +//>>label: Pop Transition +//>>group: Transitions +//>>css: ../css/structure/jquery.mobile.transition.pop.css + +define( [ "jquery", "./jquery.mobile.transition" ], function( $ ) { +//>>excludeEnd("jqmBuildExclude"); +(function( $, window, undefined ) { + +$.mobile.transitionFallbacks.pop = "fade"; + +})( jQuery, this ); +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +}); +//>>excludeEnd("jqmBuildExclude"); \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.transition.slide.js b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.transition.slide.js new file mode 100644 index 0000000..60fda61 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.transition.slide.js @@ -0,0 +1,24 @@ +/* +* fallback transition for slide in non-3D supporting browsers (which tend to handle complex transitions poorly in general +*/ + +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +//>>description: Animation styles and fallback transition definition for non-3D supporting browsers +//>>label: Slide Transition +//>>group: Transitions +//>>css: ../css/structure/jquery.mobile.transition.slide.css + +define( [ "jquery", "./jquery.mobile.transition" ], function( $ ) { +//>>excludeEnd("jqmBuildExclude"); +(function( $, window, undefined ) { + +// Use the simultaneous transition handler for slide transitions +$.mobile.transitionHandlers.slide = $.mobile.transitionHandlers.simultaneous; + +// Set the slide transition's fallback to "fade" +$.mobile.transitionFallbacks.slide = "fade"; + +})( jQuery, this ); +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +}); +//>>excludeEnd("jqmBuildExclude"); \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.transition.slidedown.js b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.transition.slidedown.js new file mode 100644 index 0000000..cfbbac2 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.transition.slidedown.js @@ -0,0 +1,20 @@ +/* +* fallback transition for slidedown in non-3D supporting browsers (which tend to handle complex transitions poorly in general +*/ + +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +//>>description: Animation styles and fallback transition definition for non-3D supporting browsers +//>>label: Slidedown Transition +//>>group: Transitions +//>>css: ../css/structure/jquery.mobile.transition.slidedown.css + +define( [ "jquery", "./jquery.mobile.transition" ], function( $ ) { +//>>excludeEnd("jqmBuildExclude"); +(function( $, window, undefined ) { + +$.mobile.transitionFallbacks.slidedown = "fade"; + +})( jQuery, this ); +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +}); +//>>excludeEnd("jqmBuildExclude"); \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.transition.slidefade.js b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.transition.slidefade.js new file mode 100644 index 0000000..17c47dc --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.transition.slidefade.js @@ -0,0 +1,21 @@ +/* +* fallback transition for slidefade in non-3D supporting browsers (which tend to handle complex transitions poorly in general +*/ + +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +//>>description: Animation styles and fallback transition definition for non-3D supporting browsers +//>>label: Slidefade Transition +//>>group: Transitions +//>>css: ../css/structure/jquery.mobile.transition.slidefade.css + +define( [ "jquery", "./jquery.mobile.transition" ], function( $ ) { +//>>excludeEnd("jqmBuildExclude"); +(function( $, window, undefined ) { + +// Set the slide transition's fallback to "fade" +$.mobile.transitionFallbacks.slidefade = "fade"; + +})( jQuery, this ); +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +}); +//>>excludeEnd("jqmBuildExclude"); \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.transition.slideup.js b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.transition.slideup.js new file mode 100644 index 0000000..aac741f --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.transition.slideup.js @@ -0,0 +1,20 @@ +/* +* fallback transition for slideup in non-3D supporting browsers (which tend to handle complex transitions poorly in general +*/ + +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +//>>description: Animation styles and fallback transition definition for non-3D supporting browsers +//>>label: Slideup Transition +//>>group: Transitions +//>>css: ../css/structure/jquery.mobile.transition.slideup.css + +define( [ "jquery", "./jquery.mobile.transition" ], function( $ ) { +//>>excludeEnd("jqmBuildExclude"); +(function( $, window, undefined ) { + +$.mobile.transitionFallbacks.slideup = "fade"; + +})( jQuery, this ); +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +}); +//>>excludeEnd("jqmBuildExclude"); \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.transition.turn.js b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.transition.turn.js new file mode 100644 index 0000000..5a30b1f --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.transition.turn.js @@ -0,0 +1,20 @@ +/* +* fallback transition for turn in non-3D supporting browsers (which tend to handle complex transitions poorly in general +*/ + +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +//>>description: Animation styles and fallback transition definition for non-3D supporting browsers +//>>label: Turn Transition +//>>group: Transitions +//>>css: ../css/structure/jquery.mobile.transition.turn.css + +define( [ "jquery", "./jquery.mobile.transition" ], function( $ ) { +//>>excludeEnd("jqmBuildExclude"); +(function( $, window, undefined ) { + +$.mobile.transitionFallbacks.turn = "fade"; + +})( jQuery, this ); +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +}); +//>>excludeEnd("jqmBuildExclude"); \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.vmouse.js b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.vmouse.js new file mode 100644 index 0000000..6e9b504 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.vmouse.js @@ -0,0 +1,510 @@ + +// This plugin is an experiment for abstracting away the touch and mouse +// events so that developers don't have to worry about which method of input +// the device their document is loaded on supports. +// +// The idea here is to allow the developer to register listeners for the +// basic mouse events, such as mousedown, mousemove, mouseup, and click, +// and the plugin will take care of registering the correct listeners +// behind the scenes to invoke the listener at the fastest possible time +// for that device, while still retaining the order of event firing in +// the traditional mouse environment, should multiple handlers be registered +// on the same element for different events. +// +// The current version exposes the following virtual events to jQuery bind methods: +// "vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel" + +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +//>>description: Normalizes touch/mouse events. +//>>label: Virtual Mouse (vmouse) Bindings +//>>group: Core + +define( [ "jquery" ], function( $ ) { +//>>excludeEnd("jqmBuildExclude"); +(function( $, window, document, undefined ) { + +var dataPropertyName = "virtualMouseBindings", + touchTargetPropertyName = "virtualTouchID", + virtualEventNames = "vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel".split( " " ), + touchEventProps = "clientX clientY pageX pageY screenX screenY".split( " " ), + mouseHookProps = $.event.mouseHooks ? $.event.mouseHooks.props : [], + mouseEventProps = $.event.props.concat( mouseHookProps ), + activeDocHandlers = {}, + resetTimerID = 0, + startX = 0, + startY = 0, + didScroll = false, + clickBlockList = [], + blockMouseTriggers = false, + blockTouchTriggers = false, + eventCaptureSupported = "addEventListener" in document, + $document = $( document ), + nextTouchID = 1, + lastTouchID = 0; + +$.vmouse = { + moveDistanceThreshold: 10, + clickDistanceThreshold: 10, + resetTimerDuration: 1500 +}; + +function getNativeEvent( event ) { + + while ( event && typeof event.originalEvent !== "undefined" ) { + event = event.originalEvent; + } + return event; +} + +function createVirtualEvent( event, eventType ) { + + var t = event.type, + oe, props, ne, prop, ct, touch, i, j; + + event = $.Event(event); + event.type = eventType; + + oe = event.originalEvent; + props = $.event.props; + + // addresses separation of $.event.props in to $.event.mouseHook.props and Issue 3280 + // https://github.com/jquery/jquery-mobile/issues/3280 + if ( t.search( /^(mouse|click)/ ) > -1 ) { + props = mouseEventProps; + } + + // copy original event properties over to the new event + // this would happen if we could call $.event.fix instead of $.Event + // but we don't have a way to force an event to be fixed multiple times + if ( oe ) { + for ( i = props.length, prop; i; ) { + prop = props[ --i ]; + event[ prop ] = oe[ prop ]; + } + } + + // make sure that if the mouse and click virtual events are generated + // without a .which one is defined + if ( t.search(/mouse(down|up)|click/) > -1 && !event.which ){ + event.which = 1; + } + + if ( t.search(/^touch/) !== -1 ) { + ne = getNativeEvent( oe ); + t = ne.touches; + ct = ne.changedTouches; + touch = ( t && t.length ) ? t[0] : ( (ct && ct.length) ? ct[ 0 ] : undefined ); + + if ( touch ) { + for ( j = 0, len = touchEventProps.length; j < len; j++){ + prop = touchEventProps[ j ]; + event[ prop ] = touch[ prop ]; + } + } + } + + return event; +} + +function getVirtualBindingFlags( element ) { + + var flags = {}, + b, k; + + while ( element ) { + + b = $.data( element, dataPropertyName ); + + for ( k in b ) { + if ( b[ k ] ) { + flags[ k ] = flags.hasVirtualBinding = true; + } + } + element = element.parentNode; + } + return flags; +} + +function getClosestElementWithVirtualBinding( element, eventType ) { + var b; + while ( element ) { + + b = $.data( element, dataPropertyName ); + + if ( b && ( !eventType || b[ eventType ] ) ) { + return element; + } + element = element.parentNode; + } + return null; +} + +function enableTouchBindings() { + blockTouchTriggers = false; +} + +function disableTouchBindings() { + blockTouchTriggers = true; +} + +function enableMouseBindings() { + lastTouchID = 0; + clickBlockList.length = 0; + blockMouseTriggers = false; + + // When mouse bindings are enabled, our + // touch bindings are disabled. + disableTouchBindings(); +} + +function disableMouseBindings() { + // When mouse bindings are disabled, our + // touch bindings are enabled. + enableTouchBindings(); +} + +function startResetTimer() { + clearResetTimer(); + resetTimerID = setTimeout(function(){ + resetTimerID = 0; + enableMouseBindings(); + }, $.vmouse.resetTimerDuration ); +} + +function clearResetTimer() { + if ( resetTimerID ){ + clearTimeout( resetTimerID ); + resetTimerID = 0; + } +} + +function triggerVirtualEvent( eventType, event, flags ) { + var ve; + + if ( ( flags && flags[ eventType ] ) || + ( !flags && getClosestElementWithVirtualBinding( event.target, eventType ) ) ) { + + ve = createVirtualEvent( event, eventType ); + + $( event.target).trigger( ve ); + } + + return ve; +} + +function mouseEventCallback( event ) { + var touchID = $.data(event.target, touchTargetPropertyName); + + if ( !blockMouseTriggers && ( !lastTouchID || lastTouchID !== touchID ) ){ + var ve = triggerVirtualEvent( "v" + event.type, event ); + if ( ve ) { + if ( ve.isDefaultPrevented() ) { + event.preventDefault(); + } + if ( ve.isPropagationStopped() ) { + event.stopPropagation(); + } + if ( ve.isImmediatePropagationStopped() ) { + event.stopImmediatePropagation(); + } + } + } +} + +function handleTouchStart( event ) { + + var touches = getNativeEvent( event ).touches, + target, flags; + + if ( touches && touches.length === 1 ) { + + target = event.target; + flags = getVirtualBindingFlags( target ); + + if ( flags.hasVirtualBinding ) { + + lastTouchID = nextTouchID++; + $.data( target, touchTargetPropertyName, lastTouchID ); + + clearResetTimer(); + + disableMouseBindings(); + didScroll = false; + + var t = getNativeEvent( event ).touches[ 0 ]; + startX = t.pageX; + startY = t.pageY; + + triggerVirtualEvent( "vmouseover", event, flags ); + triggerVirtualEvent( "vmousedown", event, flags ); + } + } +} + +function handleScroll( event ) { + if ( blockTouchTriggers ) { + return; + } + + if ( !didScroll ) { + triggerVirtualEvent( "vmousecancel", event, getVirtualBindingFlags( event.target ) ); + } + + didScroll = true; + startResetTimer(); +} + +function handleTouchMove( event ) { + if ( blockTouchTriggers ) { + return; + } + + var t = getNativeEvent( event ).touches[ 0 ], + didCancel = didScroll, + moveThreshold = $.vmouse.moveDistanceThreshold; + didScroll = didScroll || + ( Math.abs(t.pageX - startX) > moveThreshold || + Math.abs(t.pageY - startY) > moveThreshold ), + flags = getVirtualBindingFlags( event.target ); + + if ( didScroll && !didCancel ) { + triggerVirtualEvent( "vmousecancel", event, flags ); + } + + triggerVirtualEvent( "vmousemove", event, flags ); + startResetTimer(); +} + +function handleTouchEnd( event ) { + if ( blockTouchTriggers ) { + return; + } + + disableTouchBindings(); + + var flags = getVirtualBindingFlags( event.target ), + t; + triggerVirtualEvent( "vmouseup", event, flags ); + + if ( !didScroll ) { + var ve = triggerVirtualEvent( "vclick", event, flags ); + if ( ve && ve.isDefaultPrevented() ) { + // The target of the mouse events that follow the touchend + // event don't necessarily match the target used during the + // touch. This means we need to rely on coordinates for blocking + // any click that is generated. + t = getNativeEvent( event ).changedTouches[ 0 ]; + clickBlockList.push({ + touchID: lastTouchID, + x: t.clientX, + y: t.clientY + }); + + // Prevent any mouse events that follow from triggering + // virtual event notifications. + blockMouseTriggers = true; + } + } + triggerVirtualEvent( "vmouseout", event, flags); + didScroll = false; + + startResetTimer(); +} + +function hasVirtualBindings( ele ) { + var bindings = $.data( ele, dataPropertyName ), + k; + + if ( bindings ) { + for ( k in bindings ) { + if ( bindings[ k ] ) { + return true; + } + } + } + return false; +} + +function dummyMouseHandler(){} + +function getSpecialEventObject( eventType ) { + var realType = eventType.substr( 1 ); + + return { + setup: function( data, namespace ) { + // If this is the first virtual mouse binding for this element, + // add a bindings object to its data. + + if ( !hasVirtualBindings( this ) ) { + $.data( this, dataPropertyName, {}); + } + + // If setup is called, we know it is the first binding for this + // eventType, so initialize the count for the eventType to zero. + var bindings = $.data( this, dataPropertyName ); + bindings[ eventType ] = true; + + // If this is the first virtual mouse event for this type, + // register a global handler on the document. + + activeDocHandlers[ eventType ] = ( activeDocHandlers[ eventType ] || 0 ) + 1; + + if ( activeDocHandlers[ eventType ] === 1 ) { + $document.bind( realType, mouseEventCallback ); + } + + // Some browsers, like Opera Mini, won't dispatch mouse/click events + // for elements unless they actually have handlers registered on them. + // To get around this, we register dummy handlers on the elements. + + $( this ).bind( realType, dummyMouseHandler ); + + // For now, if event capture is not supported, we rely on mouse handlers. + if ( eventCaptureSupported ) { + // If this is the first virtual mouse binding for the document, + // register our touchstart handler on the document. + + activeDocHandlers[ "touchstart" ] = ( activeDocHandlers[ "touchstart" ] || 0) + 1; + + if (activeDocHandlers[ "touchstart" ] === 1) { + $document.bind( "touchstart", handleTouchStart ) + .bind( "touchend", handleTouchEnd ) + + // On touch platforms, touching the screen and then dragging your finger + // causes the window content to scroll after some distance threshold is + // exceeded. On these platforms, a scroll prevents a click event from being + // dispatched, and on some platforms, even the touchend is suppressed. To + // mimic the suppression of the click event, we need to watch for a scroll + // event. Unfortunately, some platforms like iOS don't dispatch scroll + // events until *AFTER* the user lifts their finger (touchend). This means + // we need to watch both scroll and touchmove events to figure out whether + // or not a scroll happenens before the touchend event is fired. + + .bind( "touchmove", handleTouchMove ) + .bind( "scroll", handleScroll ); + } + } + }, + + teardown: function( data, namespace ) { + // If this is the last virtual binding for this eventType, + // remove its global handler from the document. + + --activeDocHandlers[ eventType ]; + + if ( !activeDocHandlers[ eventType ] ) { + $document.unbind( realType, mouseEventCallback ); + } + + if ( eventCaptureSupported ) { + // If this is the last virtual mouse binding in existence, + // remove our document touchstart listener. + + --activeDocHandlers[ "touchstart" ]; + + if ( !activeDocHandlers[ "touchstart" ] ) { + $document.unbind( "touchstart", handleTouchStart ) + .unbind( "touchmove", handleTouchMove ) + .unbind( "touchend", handleTouchEnd ) + .unbind( "scroll", handleScroll ); + } + } + + var $this = $( this ), + bindings = $.data( this, dataPropertyName ); + + // teardown may be called when an element was + // removed from the DOM. If this is the case, + // jQuery core may have already stripped the element + // of any data bindings so we need to check it before + // using it. + if ( bindings ) { + bindings[ eventType ] = false; + } + + // Unregister the dummy event handler. + + $this.unbind( realType, dummyMouseHandler ); + + // If this is the last virtual mouse binding on the + // element, remove the binding data from the element. + + if ( !hasVirtualBindings( this ) ) { + $this.removeData( dataPropertyName ); + } + } + }; +} + +// Expose our custom events to the jQuery bind/unbind mechanism. + +for ( var i = 0; i < virtualEventNames.length; i++ ){ + $.event.special[ virtualEventNames[ i ] ] = getSpecialEventObject( virtualEventNames[ i ] ); +} + +// Add a capture click handler to block clicks. +// Note that we require event capture support for this so if the device +// doesn't support it, we punt for now and rely solely on mouse events. +if ( eventCaptureSupported ) { + document.addEventListener( "click", function( e ){ + var cnt = clickBlockList.length, + target = e.target, + x, y, ele, i, o, touchID; + + if ( cnt ) { + x = e.clientX; + y = e.clientY; + threshold = $.vmouse.clickDistanceThreshold; + + // The idea here is to run through the clickBlockList to see if + // the current click event is in the proximity of one of our + // vclick events that had preventDefault() called on it. If we find + // one, then we block the click. + // + // Why do we have to rely on proximity? + // + // Because the target of the touch event that triggered the vclick + // can be different from the target of the click event synthesized + // by the browser. The target of a mouse/click event that is syntehsized + // from a touch event seems to be implementation specific. For example, + // some browsers will fire mouse/click events for a link that is near + // a touch event, even though the target of the touchstart/touchend event + // says the user touched outside the link. Also, it seems that with most + // browsers, the target of the mouse/click event is not calculated until the + // time it is dispatched, so if you replace an element that you touched + // with another element, the target of the mouse/click will be the new + // element underneath that point. + // + // Aside from proximity, we also check to see if the target and any + // of its ancestors were the ones that blocked a click. This is necessary + // because of the strange mouse/click target calculation done in the + // Android 2.1 browser, where if you click on an element, and there is a + // mouse/click handler on one of its ancestors, the target will be the + // innermost child of the touched element, even if that child is no where + // near the point of touch. + + ele = target; + + while ( ele ) { + for ( i = 0; i < cnt; i++ ) { + o = clickBlockList[ i ]; + touchID = 0; + + if ( ( ele === target && Math.abs( o.x - x ) < threshold && Math.abs( o.y - y ) < threshold ) || + $.data( ele, touchTargetPropertyName ) === o.touchID ) { + // XXX: We may want to consider removing matches from the block list + // instead of waiting for the reset timer to fire. + e.preventDefault(); + e.stopPropagation(); + return; + } + } + ele = ele.parentNode; + } + } + }, true); +} +})( jQuery, window, document ); +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +}); +//>>excludeEnd("jqmBuildExclude"); diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.widget.js b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.widget.js new file mode 100644 index 0000000..37b6fdf --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.widget.js @@ -0,0 +1,75 @@ +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +//>>description: Widget factory extentions for mobile. +//>>label: Widget Factory +//>>group: Core +//>>css: ../css/themes/default/jquery.mobile.theme.css + +define( [ "jquery", "../external/requirejs/depend!./jquery.ui.widget[jquery]" ], function( $ ) { +//>>excludeEnd("jqmBuildExclude"); +(function( $, undefined ) { + +$.widget( "mobile.widget", { + // decorate the parent _createWidget to trigger `widgetinit` for users + // who wish to do post post `widgetcreate` alterations/additions + // + // TODO create a pull request for jquery ui to trigger this event + // in the original _createWidget + _createWidget: function() { + $.Widget.prototype._createWidget.apply( this, arguments ); + this._trigger( 'init' ); + }, + + _getCreateOptions: function() { + + var elem = this.element, + options = {}; + + $.each( this.options, function( option ) { + + var value = elem.jqmData( option.replace( /[A-Z]/g, function( c ) { + return "-" + c.toLowerCase(); + }) + ); + + if ( value !== undefined ) { + options[ option ] = value; + } + }); + + return options; + }, + + enhanceWithin: function( target, useKeepNative ) { + this.enhance( $( this.options.initSelector, $( target )), useKeepNative ); + }, + + enhance: function( targets, useKeepNative ) { + var page, keepNative, $widgetElements = $( targets ), self = this; + + // if ignoreContentEnabled is set to true the framework should + // only enhance the selected elements when they do NOT have a + // parent with the data-namespace-ignore attribute + $widgetElements = $.mobile.enhanceable( $widgetElements ); + + if ( useKeepNative && $widgetElements.length ) { + // TODO remove dependency on the page widget for the keepNative. + // Currently the keepNative value is defined on the page prototype so + // the method is as well + page = $.mobile.closestPageData( $widgetElements ); + keepNative = (page && page.keepNativeSelector()) || ""; + + $widgetElements = $widgetElements.not( keepNative ); + } + + $widgetElements[ this.widgetName ](); + }, + + raise: function( msg ) { + throw "Widget [" + this.widgetName + "]: " + msg; + } +}); + +})( jQuery ); +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +}); +//>>excludeEnd("jqmBuildExclude"); diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.zoom.iosorientationfix.js b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.zoom.iosorientationfix.js new file mode 100644 index 0000000..846f546 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.zoom.iosorientationfix.js @@ -0,0 +1,44 @@ +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +//>>description: Fixes the orientation change bug in iOS when switching between landspace and portrait +//>>label: iOS Orientation Change Fix +//>>group: Utilities + +define( [ "jquery", "./jquery.mobile.core", "./jquery.mobile.zoom" ], function( $ ) { +//>>excludeEnd("jqmBuildExclude"); +( function( $, window ) { + + // This fix addresses an iOS bug, so return early if the UA claims it's something else. + if( !(/iPhone|iPad|iPod/.test( navigator.platform ) && navigator.userAgent.indexOf( "AppleWebKit" ) > -1 ) ){ + return; + } + + var zoom = $.mobile.zoom, + evt, x, y, z, aig; + + function checkTilt( e ){ + evt = e.originalEvent; + aig = evt.accelerationIncludingGravity; + + x = Math.abs( aig.x ); + y = Math.abs( aig.y ); + z = Math.abs( aig.z ); + + // If portrait orientation and in one of the danger zones + if( !window.orientation && ( x > 7 || ( ( z > 6 && y < 8 || z < 8 && y > 6 ) && x > 5 ) ) ){ + if( zoom.enabled ){ + zoom.disable(); + } + } + else if( !zoom.enabled ){ + zoom.enable(); + } + } + + $( window ) + .bind( "orientationchange.iosorientationfix", zoom.enable ) + .bind( "devicemotion.iosorientationfix", checkTilt ); + +}( jQuery, this )); +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +}); +//>>excludeEnd("jqmBuildExclude"); diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.zoom.js b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.zoom.js new file mode 100644 index 0000000..171c4d5 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.zoom.js @@ -0,0 +1,43 @@ +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +//>>description: Utility methods for enabling and disabling user scaling (pinch zoom) +//>>label: Zoom Handling +//>>group: Utilities + +define( [ "jquery", "./jquery.mobile.core" ], function( $ ) { +//>>excludeEnd("jqmBuildExclude"); +( function( $ ) { + var meta = $( "meta[name=viewport]" ), + initialContent = meta.attr( "content" ), + disabledZoom = initialContent + ",maximum-scale=1, user-scalable=no", + enabledZoom = initialContent + ",maximum-scale=10, user-scalable=yes", + disabledInitially = /(user-scalable[\s]*=[\s]*no)|(maximum-scale[\s]*=[\s]*1)[$,\s]/.test( initialContent ); + + $.mobile.zoom = $.extend( {}, { + enabled: !disabledInitially, + locked: false, + disable: function( lock ) { + if( !disabledInitially && !$.mobile.zoom.locked ){ + meta.attr( "content", disabledZoom ); + $.mobile.zoom.enabled = false; + $.mobile.zoom.locked = lock || false; + } + }, + enable: function( unlock ) { + if( !disabledInitially && ( !$.mobile.zoom.locked || unlock === true ) ){ + meta.attr( "content", enabledZoom ); + $.mobile.zoom.enabled = true; + $.mobile.zoom.locked = false; + } + }, + restore: function() { + if( !disabledInitially ){ + meta.attr( "content", initialContent ); + $.mobile.zoom.enabled = true; + } + } + }); + +}( jQuery )); +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +}); +//>>excludeEnd("jqmBuildExclude"); diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.tag.inserter.js b/libs/js/jquery-mobile-1.1.0/js/jquery.tag.inserter.js new file mode 100644 index 0000000..fb81544 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/js/jquery.tag.inserter.js @@ -0,0 +1,31 @@ +(function() { + // Insert a script tag pointing at the desired version of jQuery + + // Get the version from the url + var jqueryRE = /[\\?&]jquery=([^&#]*)/, + results = jqueryRE.exec( location.search ), + version = "", + jq, + myScriptTag = document.getElementsByTagName( "script" )[document.getElementsByTagName( "script" ).length - 1], + baseUrl = myScriptTag.src.replace( /(.*)\/.*$/, "$1/" ), + url = baseUrl + "jquery-1.7.1.js"; + + if( results ) { + version = decodeURIComponent(results[results.length - 1].replace(/\+/g, " ")); + } + + switch( version ) { + case "1.6.4": + url = baseUrl + "jquery-1.6.4.js"; + break; + case "git": + url = "http://code.jquery.com/jquery-git.js"; + break; + } + + document.write( "" ); + + if ( parseInt( version.replace( /\./g, "" ), 10 ) < 170 && window.define && window.define.amd ) { + document.write( '' ); + } +}()); \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.ui.widget.js b/libs/js/jquery-mobile-1.1.0/js/jquery.ui.widget.js new file mode 100644 index 0000000..86e83a0 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/js/jquery.ui.widget.js @@ -0,0 +1,263 @@ +/*! + * jQuery UI Widget @VERSION + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Widget + */ + +(function( $, undefined ) { + +// jQuery 1.4+ +if ( $.cleanData ) { + var _cleanData = $.cleanData; + $.cleanData = function( elems ) { + for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) { + $( elem ).triggerHandler( "remove" ); + } + _cleanData( elems ); + }; +} else { + var _remove = $.fn.remove; + $.fn.remove = function( selector, keepData ) { + return this.each(function() { + if ( !keepData ) { + if ( !selector || $.filter( selector, [ this ] ).length ) { + $( "*", this ).add( [ this ] ).each(function() { + $( this ).triggerHandler( "remove" ); + }); + } + } + return _remove.call( $(this), selector, keepData ); + }); + }; +} + +$.widget = function( name, base, prototype ) { + var namespace = name.split( "." )[ 0 ], + fullName; + name = name.split( "." )[ 1 ]; + fullName = namespace + "-" + name; + + if ( !prototype ) { + prototype = base; + base = $.Widget; + } + + // create selector for plugin + $.expr[ ":" ][ fullName ] = function( elem ) { + return !!$.data( elem, name ); + }; + + $[ namespace ] = $[ namespace ] || {}; + $[ namespace ][ name ] = function( options, element ) { + // allow instantiation without initializing for simple inheritance + if ( arguments.length ) { + this._createWidget( options, element ); + } + }; + + var basePrototype = new base(); + // we need to make the options hash a property directly on the new instance + // otherwise we'll modify the options hash on the prototype that we're + // inheriting from +// $.each( basePrototype, function( key, val ) { +// if ( $.isPlainObject(val) ) { +// basePrototype[ key ] = $.extend( {}, val ); +// } +// }); + basePrototype.options = $.extend( true, {}, basePrototype.options ); + $[ namespace ][ name ].prototype = $.extend( true, basePrototype, { + namespace: namespace, + widgetName: name, + widgetEventPrefix: $[ namespace ][ name ].prototype.widgetEventPrefix || name, + widgetBaseClass: fullName + }, prototype ); + + $.widget.bridge( name, $[ namespace ][ name ] ); +}; + +$.widget.bridge = function( name, object ) { + $.fn[ name ] = function( options ) { + var isMethodCall = typeof options === "string", + args = Array.prototype.slice.call( arguments, 1 ), + returnValue = this; + + // allow multiple hashes to be passed on init + options = !isMethodCall && args.length ? + $.extend.apply( null, [ true, options ].concat(args) ) : + options; + + // prevent calls to internal methods + if ( isMethodCall && options.charAt( 0 ) === "_" ) { + return returnValue; + } + + if ( isMethodCall ) { + this.each(function() { + var instance = $.data( this, name ); + if ( !instance ) { + throw "cannot call methods on " + name + " prior to initialization; " + + "attempted to call method '" + options + "'"; + } + if ( !$.isFunction( instance[options] ) ) { + throw "no such method '" + options + "' for " + name + " widget instance"; + } + var methodValue = instance[ options ].apply( instance, args ); + if ( methodValue !== instance && methodValue !== undefined ) { + returnValue = methodValue; + return false; + } + }); + } else { + this.each(function() { + var instance = $.data( this, name ); + if ( instance ) { + instance.option( options || {} )._init(); + } else { + $.data( this, name, new object( options, this ) ); + } + }); + } + + return returnValue; + }; +}; + +$.Widget = function( options, element ) { + // allow instantiation without initializing for simple inheritance + if ( arguments.length ) { + this._createWidget( options, element ); + } +}; + +$.Widget.prototype = { + widgetName: "widget", + widgetEventPrefix: "", + options: { + disabled: false + }, + _createWidget: function( options, element ) { + // $.widget.bridge stores the plugin instance, but we do it anyway + // so that it's stored even before the _create function runs + $.data( element, this.widgetName, this ); + this.element = $( element ); + this.options = $.extend( true, {}, + this.options, + this._getCreateOptions(), + options ); + + var self = this; + this.element.bind( "remove." + this.widgetName, function() { + self.destroy(); + }); + + this._create(); + this._trigger( "create" ); + this._init(); + }, + _getCreateOptions: function() { + var options = {}; + if ( $.metadata ) { + options = $.metadata.get( element )[ this.widgetName ]; + } + return options; + }, + _create: function() {}, + _init: function() {}, + + destroy: function() { + this.element + .unbind( "." + this.widgetName ) + .removeData( this.widgetName ); + this.widget() + .unbind( "." + this.widgetName ) + .removeAttr( "aria-disabled" ) + .removeClass( + this.widgetBaseClass + "-disabled " + + "ui-state-disabled" ); + }, + + widget: function() { + return this.element; + }, + + option: function( key, value ) { + var options = key; + + if ( arguments.length === 0 ) { + // don't return a reference to the internal hash + return $.extend( {}, this.options ); + } + + if (typeof key === "string" ) { + if ( value === undefined ) { + return this.options[ key ]; + } + options = {}; + options[ key ] = value; + } + + this._setOptions( options ); + + return this; + }, + _setOptions: function( options ) { + var self = this; + $.each( options, function( key, value ) { + self._setOption( key, value ); + }); + + return this; + }, + _setOption: function( key, value ) { + this.options[ key ] = value; + + if ( key === "disabled" ) { + this.widget() + [ value ? "addClass" : "removeClass"]( + this.widgetBaseClass + "-disabled" + " " + + "ui-state-disabled" ) + .attr( "aria-disabled", value ); + } + + return this; + }, + + enable: function() { + return this._setOption( "disabled", false ); + }, + disable: function() { + return this._setOption( "disabled", true ); + }, + + _trigger: function( type, event, data ) { + var callback = this.options[ type ]; + + event = $.Event( event ); + event.type = ( type === this.widgetEventPrefix ? + type : + this.widgetEventPrefix + type ).toLowerCase(); + data = data || {}; + + // copy original event properties over to the new event + // this would happen if we could call $.event.fix instead of $.Event + // but we don't have a way to force an event to be fixed multiple times + if ( event.originalEvent ) { + for ( var i = $.event.props.length, prop; i; ) { + prop = $.event.props[ --i ]; + event[ prop ] = event.originalEvent[ prop ]; + } + } + + this.element.trigger( event, data ); + + return !( $.isFunction(callback) && + callback.call( this.element[0], event, data ) === false || + event.isDefaultPrevented() ); + } +}; + +})( jQuery ); diff --git a/libs/js/jquery-mobile-1.1.0/tests/functional/addrbar.html b/libs/js/jquery-mobile-1.1.0/tests/functional/addrbar.html new file mode 100644 index 0000000..ebe18df --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/functional/addrbar.html @@ -0,0 +1,50 @@ + + + + + + jQuery Mobile: Event Logger + + + + + + + + + + + + + + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/functional/button-markup.html b/libs/js/jquery-mobile-1.1.0/tests/functional/button-markup.html new file mode 100644 index 0000000..cbcaa35 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/functional/button-markup.html @@ -0,0 +1,131 @@ + + + + + + jQuery Mobile Button Markup Tester + + + + + + + + + +
      +
      +

      jQuery Mobile Widget Option Tester

      +
      +
      + Sample Link + + + + + +
      +
      + + +
      +
      +
      + + +
      +
      +
      + + +
      +
      +
      + + +
      +
      +
      + + +
      +
      +
      + + +
      +
      +
      + + +
      +
      +
      + + +
      +
      +
      + + +
      +
      +
      + + +
      +
      +
      + + +
      +
      +
      + + +
      +
      +
      + + +
      +
      +
      + + +
      +
      + +
      + +
      +
      + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/functional/eventlogger.html b/libs/js/jquery-mobile-1.1.0/tests/functional/eventlogger.html new file mode 100644 index 0000000..1486f2e --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/functional/eventlogger.html @@ -0,0 +1,40 @@ + + + + + + jQuery Mobile: Event Logger + + + + + + + + + + +
      +
      +

      Event Logger

      +
      + +
      +

      Touch events on this page will log out below, prepending to the top as they arrive.

      + +
        + +
      + +
      +
      + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/functional/gridlayout.html b/libs/js/jquery-mobile-1.1.0/tests/functional/gridlayout.html new file mode 100644 index 0000000..286386a --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/functional/gridlayout.html @@ -0,0 +1,67 @@ + + + + + jQuery Mobile: Grid Layout + + + + + + + + + + +
      +
      +

      Grid Layout

      +
      + +
      +

      Touch events on this page will log out below, prepending to the top as they arrive.

      + +
      +
      + Button 1 +
      +
      + Button 2 +
      +
      + Button 3 +
      +
      + Button 4 +
      +
      + Button 5 +
      +
      + + Show all button + +
        + +
      + +
      +
      + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/functional/orientation.html b/libs/js/jquery-mobile-1.1.0/tests/functional/orientation.html new file mode 100644 index 0000000..9052490 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/functional/orientation.html @@ -0,0 +1,46 @@ + + + + + + jQuery Mobile: Orientation + + + + + + + + + +
      +

      Orientation Test

      +
      +

      The current device orientation is displayed below. It should *ALWAYS* be correct!

      +
      Orientation Not Supported!
      +
      +
      + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/jquery.testHelper.js b/libs/js/jquery-mobile-1.1.0/tests/jquery.testHelper.js new file mode 100644 index 0000000..b010263 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/jquery.testHelper.js @@ -0,0 +1,246 @@ +/* + * mobile support unit tests + */ + +(function( $ ) { + $.testHelper = { + // This function takes sets of files to load asynchronously. Each set will be loaded after + // the previous set has completed loading. That is, each require and it's dependencies in a + // set will be loaded asynchronously, but each set will be run in serial. + asyncLoad: function( seq ) { + require({ + baseUrl: "../../../js" + }); + + function loadSeq( seq, i ){ + if( !seq[i] ){ + $( document ).ready( function() { + var $fixture = $( '#qunit-fixture' ); + if ( $fixture.length ) { + QUnit.config.fixture = $fixture.html(); + } + QUnit.start(); + }); + return; + } + + require( seq[i], function() { + loadSeq(seq, i + 1); + }); + } + + // stop qunit from running the tests until everything is in the page + QUnit.config.autostart = false; + + loadSeq( seq, 0 ); + }, + + excludeFileProtocol: function(callback){ + var message = "Tests require script reload and cannot be run via file: protocol"; + + if (location.protocol == "file:") { + test(message, function(){ + ok(false, message); + }); + } else { + callback(); + } + }, + + // TODO prevent test suite loads when the browser doesn't support push state + // and push-state false is defined. + setPushState: function() { + if( $.support.pushState && location.search.indexOf( "push-state" ) >= 0 ) { + $.support.pushState = false; + } + }, + + reloads: {}, + + reloadModule: function(libName){ + var deferred = $.Deferred(), + context; + + // where a module loader isn't defined use the old way + if( !window.require ) { + this.reloadLib( libName ); + deferred.resolve(); + return deferred; + } + + if(this.reloads[libName] === undefined) { + this.reloads[libName] = { + count: 0 + }; + } + + //Clear internal cache of module inside of require + context = require.s.contexts._; + delete context.defined[libName]; + delete context.specified[libName]; + delete context.loaded[libName]; + delete context.urlFetched[require.toUrl(libName + '.js')]; + + require( + { + baseUrl: "../../../js" + }, [libName], + function() { + deferred.resolve(); + } + ); + + return deferred; + }, + + reloadLib: function(libName){ + if(this.reloads[libName] === undefined) { + this.reloads[libName] = { + lib: $("script[src$='" + libName + "']"), + count: 0 + }; + } + + var lib = this.reloads[libName].lib.clone(), + src = lib.attr('src'); + + //NOTE append "cache breaker" to force reload + lib.attr('src', src + "?" + this.reloads[libName].count++); + $("body").append(lib); + }, + + rerunQunit: function(){ + var self = this; + QUnit.init(); + $("script:not([src*='.\/'])").each(function(i, elem){ + var src = elem.src.split("/"); + self.reloadLib(src[src.length - 1]); + }); + QUnit.start(); + }, + + alterExtend: function(extraExtension){ + var extendFn = $.extend; + + $.extend = function(object, extension){ + // NOTE extend the object as normal + var result = extendFn.apply(this, arguments); + + // NOTE add custom extensions + result = extendFn(result, extraExtension); + return result; + }; + }, + + hideActivePageWhenComplete: function() { + if( $('#qunit-testresult').length > 0 ) { + $('.ui-page-active').css('display', 'none'); + } else { + setTimeout($.testHelper.hideActivePageWhenComplete, 500); + } + }, + + openPage: function(hash){ + location.href = location.href.split('#')[0] + hash; + }, + + sequence: function(fns, interval){ + $.each(fns, function(i, fn){ + setTimeout(fn, i * interval); + }); + }, + + pageSequence: function( fns ){ + this.eventSequence( "pagechange", fns ); + }, + + eventSequence: function( event, fns, timedOut ){ + var seq = []; + $.each(fns, function( i, fn ) { + seq.push( fn ); + if( i !== fns.length - 1) seq.push( event ); + }); + + this.eventCascade( seq ); + }, + + eventCascade: function( sequence, timedOut ) { + var fn = sequence.shift(), + event = sequence.shift(), + self = this; + + if( fn === undefined ) { + return; + } + + if( event ){ + // if a pagechange or defined event is never triggered + // continue in the sequence to alert possible failures + var warnTimer = setTimeout(function() { + self.eventCascade( sequence, true ); + }, 2000); + + // bind the recursive call to the event + $.mobile.pageContainer.one(event, function() { + clearTimeout( warnTimer ); + + // Let the current stack unwind before we fire off the next item in the sequence. + // TODO setTimeout(self.pageSequence, 0, sequence); + setTimeout(function(){ self.eventCascade(sequence); }, 0); + }); + } + + // invoke the function which should, in some fashion, + // trigger the next event + fn( timedOut ); + }, + + deferredSequence: function(fns) { + var fn = fns.shift(), + deferred = $.Deferred(), + self = this, res; + + if (fn) { + res = fn(); + if ( res && $.type( res.done ) === "function" ) { + res.done(function() { + self.deferredSequence( fns ).done(function() { + deferred.resolve(); + }); + }); + } else { + self.deferredSequence( fns ).done(function() { + deferred.resolve(); + }); + } + } else { + deferred.resolve(); + } + return deferred; + }, + + decorate: function(opts){ + var thisVal = opts.self || window; + + return function(){ + var returnVal; + opts.before && opts.before.apply(thisVal, arguments); + returnVal = opts.fn.apply(thisVal, arguments); + opts.after && opts.after.apply(thisVal, arguments); + + return returnVal; + }; + }, + + assertUrlLocation: function( args ) { + var parts = $.mobile.path.parseUrl( location.href ), + pathnameOnward = location.href.replace( parts.domain, "" ); + + if( $.support.pushState ) { + same( pathnameOnward, args.hashOrPush || args.push, args.report ); + } else { + same( parts.hash, "#" + (args.hashOrPush || args.hash), args.report ); + } + } + }; +})(jQuery); diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/button/button_core.js b/libs/js/jquery-mobile-1.1.0/tests/unit/button/button_core.js new file mode 100644 index 0000000..b2fb8d6 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/button/button_core.js @@ -0,0 +1,58 @@ +/* + * mobile button unit tests + */ +(function($){ + $.mobile.page.prototype.options.keepNative = "button.should-be-native"; + + test( "button elements in the keepNative set shouldn't be enhanced", function() { + same( $("button.should-be-native").siblings("div.ui-slider").length, 0 ); + }); + + test( "button elements should be enhanced", function() { + ok( $("#enhanced").hasClass( "ui-btn-hidden" ) ); + }); + + test( "button markup text value should be changed on refresh", function() { + var textValueButton = $("#text"), valueButton = $("#value"); + + // the value shouldn't change unless it's been altered + textValueButton.button( 'refresh' ); + same( textValueButton.siblings().text(), "foo" ); + + // use the text where it's provided + same( textValueButton.siblings().text(), "foo" ); + textValueButton.text( "bar" ).button( 'refresh' ); + same( textValueButton.siblings().text(), "bar" ); + + // use the val if it's provided where the text isn't + same( valueButton.siblings().text(), "foo" ); + valueButton.val( "bar" ).button( 'refresh' ); + same( valueButton.siblings().text(), "bar" ); + + // prefer the text to the value + textValueButton.text( "bar" ).val( "baz" ).button( 'refresh' ); + same( textValueButton.siblings().text(), "bar" ); + }); + + // Issue 2877 + test( "verify the button placeholder is added many times", function() { + var $form = $( "#hidden-element-addition-form" ), count = 3; + expect( count * 2 ); + + for( var x = 0; x < count; x++ ) { + $( "#hidden-element-addition" ).trigger( "vclick" ); + same( $form.find( "input[type='hidden']" ).length, 1, "hidden form input should be added" ); + + $form.trigger( "submit" ); + same( $form.find( "[type='hidden']" ).length, 0, "hidden form input is removed" ); + } + }); + + test( "theme should be inherited", function() { + var $inherited = $( "#theme-check" ), + $explicit = $( "#theme-check-explicit" ); + + ok( $inherited.closest("div").hasClass( "ui-btn-up-a" ), "should inherit from page" ); + ok( $explicit.closest("div").hasClass( "ui-btn-up-b" ), "should not inherit" ); + }); +})( jQuery ); \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/button/index.html b/libs/js/jquery-mobile-1.1.0/tests/unit/button/index.html new file mode 100644 index 0000000..ad806f7 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/button/index.html @@ -0,0 +1,52 @@ + + + + + + jQuery Mobile Button Test Suite + + + + + + + + + + + + + + + +

      jQuery Mobile Button Test Suite

      +

      +

      +
        +
      + +
      +
      + + + + +
      + foo +
      + + +
      +
      + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/buttonMarkup/buttonMarkup_core.js b/libs/js/jquery-mobile-1.1.0/tests/unit/buttonMarkup/buttonMarkup_core.js new file mode 100644 index 0000000..3cf8980 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/buttonMarkup/buttonMarkup_core.js @@ -0,0 +1,100 @@ +/* + * mobile buttonMarkup tests + */ +(function($){ + module("jquery.mobile.buttonMarkup.js"); + + test( "header buttons should have the header class", function() { + var headerButton1 = $("#header-button-1"), + headerButton2 = $("#header-button-2"); + + ok((headerButton1.hasClass("ui-btn-left") && + headerButton2.hasClass("ui-btn-right")), "first header button should have class 'ui-btn-left' and the second one should have 'ui-btn-right'"); + }); + + test( "control group buttons should be enhanced inside a footer", function(){ + var group, linkCount; + + group = $("#control-group-footer"); + linkCount = group.find( "a" ).length; + + same( group.find("a.ui-btn").length, linkCount, "all 4 links should be buttons"); + same( group.find("a > span.ui-corner-left").length, 1, "only 1 left cornered button"); + same( group.find("a > span.ui-corner-right").length, 1, "only 1 right cornered button"); + same( group.find("a > span:not(.ui-corner-left):not(.ui-corner-right)").length, linkCount - 2, "only 2 buttons are cornered"); + }); + + test( "control group buttons should respect theme-related data attributes", function(){ + var group = $("#control-group-content"); + + ok(!group.find('[data-shadow=false]').hasClass("ui-shadow"), + "buttons with data-shadow=false should not have the ui-shadow class"); + ok(!group.find('[data-corners=false]').hasClass("ui-btn-corner-all"), + "buttons with data-corners=false should not have the ui-btn-corner-all class"); + ok(!group.find('[data-iconshadow=false] .ui-icon').hasClass("ui-icon-shadow"), + "buttons with data-iconshadow=false should not have the ui-icon-shadow class on their icons"); + }); + + // Test for issue #3046 and #3054: + test( "mousedown on SVG elements should not throw an exception", function(){ + var svg = $("#embedded-svg"), + success = true, + rect; + ok(svg.length > 0, "found embedded svg document" ); + if ( svg.length > 0 ) { + rect = $( "rect", svg ); + ok(rect.length > 0, "found rect" ); + try { + rect.trigger("mousedown"); + } catch ( ex ) { + success = false; + } + ok( success, "mousedown executed without exception"); + } + }); + + test( "Elements with “data-mini='true'” should have “ui-mini” class attached to enhanced element.", function(){ + var $mini = $("#mini"), + $full = $("#full"), + $minicontrol = $('#mini-control'); + + ok( $full.not('.ui-mini'), "Original element does not have data attribute, enhanced version does not recieve .ui-mini."); + ok( $mini.is('.ui-mini'), "Original element has data attribute, enhanced version recieves .ui-mini." ); + ok( $minicontrol.is('.ui-mini'), "Controlgroup has data attribute and recieves .ui-mini."); + }); + + test( "Ensure icon positioning defaults to left, and can be overridden with “data-iconpos”", function() { + var posdefault = $("#iconpos1"), + posleft = $("#iconpos2"), + posright = $("#iconpos3"); + + ok( posdefault.hasClass("ui-btn-icon-left"), "Button with unspecified icon position gets .ui-btn-icon-left" ); + ok( posleft.hasClass("ui-btn-icon-left"), "Button with left icon positioning specified .ui-btn-icon-left" ); + ok( posright.hasClass("ui-btn-icon-right"), "Button with right icon positioning specified .ui-btn-icon-right" ); + + }); + + asyncTest( "ui-btn-* should be applied based on a setting", function() { + // force touch support so the timeout is set + $.support.touch = true; + + var $btn = $( "#hover-delay" ); + + $.testHelper.sequence([ + function() { + $btn.trigger( "vmousedown" ); + }, + + function() { + ok( $btn.attr("class").indexOf( "ui-btn-down" ) == -1, "button doesn't have the down class yet" ); + }, + + function() { + ok( $btn.attr("class").indexOf( "ui-btn-down" ) >= 0, "button has the down class yet" ); + start(); + } + // the value is split and some padding is added to make sure that the last check fires + // after the hoverDelay has expired + ], $.mobile.buttonMarkup.hoverDelay / 2 + 50 ); + }); +})(jQuery); diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/buttonMarkup/index.html b/libs/js/jquery-mobile-1.1.0/tests/unit/buttonMarkup/index.html new file mode 100644 index 0000000..efae48d --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/buttonMarkup/index.html @@ -0,0 +1,78 @@ + + + + + jQuery Mobile Button Markup Test Suite + + + + + + + + + + + + + + + +

      jQuery Mobile Button Markup Test Suite

      +

      +

      +
        +
      + +
      + +
      + + No shadow + No corners + No shadow or corners + No iconshadow + + + + + + Fullsize + Mini + +
      + Yes +
      + + Default iconpos + Left iconpos + Right iconpos + +
      + +
      + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/checkboxradio/checkboxradio_core.js b/libs/js/jquery-mobile-1.1.0/tests/unit/checkboxradio/checkboxradio_core.js new file mode 100644 index 0000000..463107b --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/checkboxradio/checkboxradio_core.js @@ -0,0 +1,273 @@ +/* + * mobile checkboxradio unit tests + */ +(function($){ + module( 'jquery.mobile.forms.checkboxradio.js' ); + + test( "widget can be disabled and enabled", function(){ + var input = $( "#checkbox-1" ), + button = input.parent().find( ".ui-btn" ); + + input.checkboxradio( "disable" ); + input.checkboxradio( "enable" ); + ok( !input.attr( "disabled" ), "start input as enabled" ); + ok( !input.parent().hasClass( "ui-disabled" ), "no disabled styles" ); + ok( !input.attr( "checked" ), "not checked before click" ); + button.trigger( "click" ); + ok( input.attr( "checked" ), "checked after click" ); + ok( button.hasClass( "ui-checkbox-on" ), "active styles after click" ); + button.trigger( "click" ); + + input.checkboxradio( "disable" ); + ok( input.attr( "disabled" ), "input disabled" ); + ok( input.parent().hasClass( "ui-disabled" ), "disabled styles" ); + ok( !input.attr( "checked" ), "not checked before click" ); + button.trigger( "click" ); + ok( !input.attr( "checked" ), "not checked after click" ); + ok( !button.hasClass( "ui-checkbox-on" ), "no active styles after click" ); + }); + + test( "clicking a checkbox within a controlgroup does not affect checkboxes with the same name in the same controlgroup", function(){ + var input1 = $("#checkbox-31"); + var button1 = input1.parent().find(".ui-btn"); + var input2 = $("#checkbox-32"); + var button2 = input2.parent().find(".ui-btn"); + + ok(!input1.attr("checked"), "input1 not checked before click"); + ok(!input2.attr("checked"), "input2 not checked before click"); + + button1.trigger("click"); + ok(input1.attr("checked"), "input1 checked after click on input1"); + ok(!input2.attr("checked"), "input2 not checked after click on input1"); + + button2.trigger("click"); + ok(input1.attr("checked"), "input1 not changed after click on input2"); + ok(input2.attr("checked"), "input2 checked after click on input2"); + }); + + asyncTest( "change events fired on checkbox for both check and uncheck", function(){ + var $checkbox = $( "#checkbox-2" ), + $checkboxLabel = $checkbox.parent().find( ".ui-btn" ); + + $checkbox.unbind( "change" ); + + expect( 1 ); + + $checkbox.one('change', function(){ + ok( true, "change fired on click to check the box" ); + }); + + $checkboxLabel.trigger( "click" ); + + //test above will be triggered twice, and the start here once + $checkbox.one('change', function(){ + start(); + }); + + $checkboxLabel.trigger( "click" ); + }); + + asyncTest( "radio button labels should update the active button class to last clicked and clear checked", function(){ + var $radioBtns = $( '#radio-active-btn-test input' ), + singleActiveAndChecked = function(){ + same( $( "#radio-active-btn-test .ui-radio-on" ).length, 1, "there should be only one active button" ); + // Use the .checked property, not the checked attribute which is not dynamic + var numChecked = 0; + $( "#radio-active-btn-test input" ).each(function(i, e) { + if( e.checked ) { + numChecked++; + } + }); + same( numChecked, 1, "there should be only one checked" ); + }; + + $.testHelper.sequence([ + function(){ + $radioBtns.last().siblings( 'label' ).click(); + }, + + function(){ + ok( $radioBtns.last().prop( 'checked' ), "last input is checked" ); + ok( $radioBtns.last().siblings( 'label' ).hasClass( 'ui-radio-on' ), + "last input label is an active button" ); + + ok( !$radioBtns.first().prop( 'checked' ), "first input label is not active" ); + ok( !$radioBtns.first().siblings( 'label' ).hasClass( 'ui-radio-on' ), + "first input label is not active" ); + + singleActiveAndChecked(); + + $radioBtns.first().siblings( 'label' ).click(); + }, + + function(){ + ok( $radioBtns.first().prop( 'checked' )); + ok( $radioBtns.first().siblings( 'label' ).hasClass( 'ui-radio-on' ), + "first input label is an active button" ); + + ok( !$radioBtns.last().prop( 'checked' )); + ok( !$radioBtns.last().siblings( 'label' ).hasClass( 'ui-radio-on' ), + "last input label is not active" ); + + singleActiveAndChecked(); + + start(); + } + ], 500); + + }); + + test( "checkboxradio controls will create when inside a container that receives a 'create' event", function(){ + ok( !$("#enhancetest").appendTo(".ui-page-active").find(".ui-checkbox").length, "did not have enhancements applied" ); + ok( $("#enhancetest").trigger("create").find(".ui-checkbox").length, "enhancements applied" ); + }); + + $.mobile.page.prototype.options.keepNative = "input.should-be-native"; + + // not testing the positive case here since's it's obviously tested elsewhere + test( "checkboxradio elements in the keepNative set shouldn't be enhanced", function() { + ok( !$("input.should-be-native").parent().is("div.ui-checkbox") ); + }); + + test( "Elements with \u201cdata-mini='true'\u201d should have \u201cui-mini\u201d class attached to enhanced element.", function(){ + var full = document.getElementById("radio-full"), + $fulllbl = $('[for="radio-full"]'), + mini = document.getElementById("radio-mini"), + $minilbl = $('[for="radio-mini"]'), + minictrl = $("#mini-control"); + + ok( !full.getAttribute('data-nstest-mini') && !$fulllbl.hasClass('ui-mini'), "Original element does not have data attribute, enhanced version does not recieve .ui-mini."); + ok( mini.getAttribute('data-nstest-mini'), "Original element has data attribute, enhanced version recieves .ui-mini." ); + }); + + asyncTest( "clicking the label triggers a click on the element", function() { + var clicked = false; + + expect( 1 ); + + $( "#checkbox-click-triggered" ).one('click', function() { + clicked = true; + }); + + $.testHelper.sequence([ + function() { + $( "[for='checkbox-click-triggered']" ).click(); + }, + + function() { + ok(clicked, "click was fired on input"); + start(); + } + ], 2000); + }); + + asyncTest( "clicking the label triggers a change on the element", function() { + var changed = false; + + expect( 1 ); + + $( "#checkbox-change-triggered" ).one('change', function() { + changed = true; + }); + + $.testHelper.sequence([ + function() { + $( "[for='checkbox-change-triggered']" ).click(); + }, + + function() { + ok(changed, "change was fired on input"); + start(); + } + ], 2000); + }); + + + test( "theme should be inherited", function() { + var $inherited = $( "#checkbox-inherit-theme" ), + $explicit = $( "#checkbox-explicit-theme" ); + + ok( $inherited.siblings("label").hasClass( "ui-btn-up-a" ), "should inherit from page" ); + ok( $explicit.siblings("label").hasClass( "ui-btn-up-b" ), "should not inherit" ); + }); + + asyncTest( "form submission should include radio button values", function() { + var $form = $( "#radio-form" ), $input = $form.find("input").first(); + + $.testHelper.pageSequence([ + function() { + $input.click(); + $form.submit(); + }, + + function( timeout ){ + ok( location.search.indexOf("radio1=1") >= 0, "the radio was checked" ); + + // if the changepage in the previous function failed don't go back + if( !timeout ){ + window.history.back(); + } + }, + + function(){ + start(); + } + ]); + }); + + asyncTest( "form submission should include checkbox button values", function() { + var $form = $( "#check-form" ), $inputs = $form.find("input"); + + $.testHelper.pageSequence([ + function() { + $inputs.click(); + $form.submit(); + }, + + function( timeout ){ + ok( location.search.indexOf("checkbox-form=on") >= 0, "the first checkbox was checked" ); + ok( location.search.indexOf("checkbox-form-2=on") >= 0, "the second checkbox was checked" ); + // if the changepage in the previous function failed don't go back + if( !timeout ){ + window.history.back(); + } + }, + + function(){ + start(); + } + ]); + }); + + test( "nested label checkbox still renders", function() { + var $checkbox = $( "#checkbox-nested-label" ); + + try { + $checkbox.checkboxradio(); + } catch (e) { + ok( false, "checkboxradio exception raised: " + e.toString()); + } + + ok( $checkbox.parent().hasClass("ui-checkbox"), "enhancement has occured"); + }); + + test( "nested label (no [for]) checkbox still renders", function() { + var $checkbox = $( "#checkbox-nested-label-no-for" ); + + try { + $checkbox.checkboxradio(); + } catch (e) { + ok( false, "checkboxradio exception raised: " + e.toString()); + } + + ok( $checkbox.parent().hasClass("ui-checkbox"), "enhancement has occured"); + }); + + test( "Icon positioning", function() { + var bottomicon = $("[for='bottomicon']") + topicon = $("[for='topicon']"); + + ok( bottomicon.hasClass("ui-btn-icon-bottom"), "Icon position set on label adds the appropriate class." ); + ok( topicon.hasClass("ui-btn-icon-top"), "Icon position set on input adds the appropriate class to the label." ); + }); +})(jQuery); diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/checkboxradio/form-result.html b/libs/js/jquery-mobile-1.1.0/tests/unit/checkboxradio/form-result.html new file mode 100644 index 0000000..a963e0e --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/checkboxradio/form-result.html @@ -0,0 +1,2 @@ +
      +
      diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/checkboxradio/index.html b/libs/js/jquery-mobile-1.1.0/tests/unit/checkboxradio/index.html new file mode 100644 index 0000000..a6a09af --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/checkboxradio/index.html @@ -0,0 +1,202 @@ + + + + + jQuery Mobile Checkboxradio Test Suite + + + + + + + + + + + + + + + +

      jQuery Mobile Checkbockradio Test Suite

      +

      +

      +
        +
      + +
      +
      + +
      +
      + Agree to the terms: + + +
      +
      + +
      +
      + Agree to the terms: + + +
      +
      + +
      +
      + Agree to the terms 3.1: + + +
      +
      + Agree to the terms 3.2: + + +
      +
      +
      + +
      +
      + Choose a pet: + + + + + + + + + + + +
      +
      + +
      + + + + + + +
      + + + + +
      +
      + + +
      +
      + Agree to the terms: + + +
      +
      + +
      +
      + Agree to the terms: + + + + + + + + + +
      +
      + +
      +
      + Agree to the terms: + + +
      + +
      + Agree to the terms: + + +
      +
      + +
      +
      + + + + + +
      +
      + +
      +
      + Check one: + + +
      +
      + + +
      +
      +
      + Font styling: + + + + + +
      +
      +
      + +
      + +
      + + +
      + +
      +
      + +
      +
      + +
      +
      + +
      +
      + +
      +
      + +
      +
      + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/collapsible/collapsible_core.js b/libs/js/jquery-mobile-1.1.0/tests/unit/collapsible/collapsible_core.js new file mode 100644 index 0000000..b8c222f --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/collapsible/collapsible_core.js @@ -0,0 +1,216 @@ +/* + * mobile listview unit tests + */ + +// TODO split out into seperate test files +(function( $ ){ + module( "Collapsible section", {}); + + asyncTest( "The page should enhanced correctly", function(){ + $.testHelper.pageSequence([ + function(){ + $.testHelper.openPage( "#basic-collapsible-test" ); + }, + + function() { + var $page = $( "#basic-collapsible-test" ); + ok($page.find( ".ui-content >:eq(0)" ).hasClass( "ui-collapsible" ), ".ui-collapsible class added to collapsible elements" ); + ok($page.find( ".ui-content >:eq(0) >:header" ).hasClass( "ui-collapsible-heading" ), ".ui-collapsible-heading class added to collapsible heading" ); + ok($page.find( ".ui-content >:eq(0) > div" ).hasClass( "ui-collapsible-content" ), ".ui-collapsible-content class added to collapsible content" ); + ok($page.find( ".ui-content >:eq(0)" ).hasClass( "ui-collapsible-collapsed" ), ".ui-collapsible-collapsed added to collapsed elements" ); + ok(!$page.find( ".ui-content >:eq(1)" ).hasClass( "ui-collapsible-collapsed" ), ".ui-collapsible-collapsed not added to expanded elements" ); + ok($page.find( ".ui-collapsible.ui-collapsible-collapsed" ).find( ".ui-collapsible-heading-toggle > .ui-btn-inner" ).hasClass( "ui-corner-top ui-corner-bottom" ), "Collapsible header button should have class ui-corner-all" ); + start(); + } + ]); + }); + + asyncTest( "Expand/Collapse", function(){ + $.testHelper.pageSequence([ + function(){ + $.testHelper.openPage( "#basic-collapsible-test" ); + }, + + function() { + ok($( "#basic-collapsible-test .ui-collapsible" ).eq(0).hasClass( "ui-collapsible-collapsed" ), "First collapsible should be collapsed"); + $( "#basic-collapsible-test .ui-collapsible-heading-toggle" ).eq(0).click(); + ok(!$( "#basic-collapsible-test .ui-collapsible" ).eq(0).hasClass( "ui-collapsible-collapsed" ), "First collapsible should be expanded after click"); + $( "#basic-collapsible-test .ui-collapsible-heading-toggle" ).eq(0).click(); + ok($( "#basic-collapsible-test .ui-collapsible" ).eq(0).hasClass( "ui-collapsible-collapsed" ), "First collapsible should be collapsed"); + start(); + } + ]); + }); + + module( "Collapsible set", {}); + + asyncTest( "The page should enhanced correctly", function(){ + $.testHelper.pageSequence([ + function(){ + $.testHelper.openPage( "#basic-collapsible-set-test" ); + }, + + function() { + var $page = $( "#basic-collapsible-set-test" ); + + ok($page.find( ".ui-content >:eq(0)" ).hasClass( "ui-collapsible-set" ), ".ui-collapsible-set class added to collapsible set" ); + ok($page.find( ".ui-content >:eq(0) > div" ).hasClass( "ui-collapsible" ), ".ui-collapsible class added to collapsible elements" ); + $page.find( ".ui-collapsible-set" ).each(function() { + var $this = $( this ); + ok($this.find( ".ui-collapsible" ).first().find( ".ui-collapsible-heading-toggle > .ui-btn-inner" ).hasClass( "ui-corner-top" ), "First collapsible header button should have class ui-corner-top" ); + ok($this.find( ".ui-collapsible" ).last().find( ".ui-collapsible-heading-toggle > .ui-btn-inner" ).hasClass( "ui-corner-bottom" ), "Last collapsible header button should have class ui-corner-bottom" ); + }); + + start(); + } + ]); + }); + + asyncTest( "Collapsible set with only one collapsible", function() { + $.testHelper.pageSequence([ + function(){ + $.testHelper.openPage( "#collapsible-set-with-lonely-collapsible-test" ); + }, + + function() { + var $page = $( "#collapsible-set-with-lonely-collapsible-test" ); + $page.find( ".ui-collapsible-set" ).each(function() { + var $this = $( this ); + ok($this.find( ".ui-collapsible" ).first().find( ".ui-collapsible-heading-toggle > .ui-btn-inner" ).hasClass( "ui-corner-top" ), "First collapsible header button should have class ui-corner-top" ); + ok($this.find( ".ui-collapsible" ).last().find( ".ui-collapsible-heading-toggle > .ui-btn-inner" ).hasClass( "ui-corner-bottom" ), "Last collapsible header button should have class ui-corner-bottom" ); + }); + + start(); + } + ]); + }); + + asyncTest( "Section expanded by default", function(){ + $.testHelper.pageSequence([ + function(){ + $.testHelper.openPage( "#basic-collapsible-set-test" ); + }, + + function() { + equals($( "#basic-collapsible-set-test .ui-content >:eq(0) .ui-collapsible-collapsed" ).length, 2, "There should be 2 section collapsed" ); + ok(!$( "#basic-collapsible-set-test .ui-content >:eq(0) >:eq(1)" ).hasClass( "ui-collapsible-collapsed" ), "Section B should be expanded" ); + start(); + } + ]); + }); + + asyncTest( "Expand/Collapse", function(){ + $.testHelper.pageSequence([ + function(){ + $.testHelper.openPage( "#basic-collapsible-set-test" ); + }, + + function() { + ok($( "#basic-collapsible-set-test .ui-collapsible" ).eq(0).hasClass( "ui-collapsible-collapsed" ), "First collapsible should be collapsed"); + $( "#basic-collapsible-set-test .ui-collapsible-heading-toggle" ).eq(0).click(); + ok(!$( "#basic-collapsible-set-test .ui-collapsible" ).eq(0).hasClass( "ui-collapsible-collapsed" ), "First collapsible should be expanded after click"); + $( "#basic-collapsible-set-test .ui-collapsible-heading-toggle" ).eq(0).click(); + ok($( "#basic-collapsible-set-test .ui-collapsible" ).hasClass( "ui-collapsible-collapsed" ), "All collapsible should be collapsed"); + start(); + } + ]); + }); + + asyncTest( "Collapsible Set with dynamic content", function(){ + $.testHelper.pageSequence([ + function(){ + $.testHelper.openPage( "#collapsible-set-with-dynamic-content" ); + }, + + function() { + var set = $( ".ui-page-active" ).find( ".ui-collapsible-set" ); + for ( var i = 0; i < 3; i++ ) { + $( '

      Collapsible Item ' + i + '

      ' ).appendTo( set ); + } + set.collapsibleset( "refresh" ); + equal( set.find( ".ui-collapsible" ).length, 3, "The 3 collapsibles should be enhanced" ); + ok( set.find( ".ui-collapsible" ).eq( 0 ).find( "a" ).hasClass( "ui-corner-top" ), "The 1st collapsible should have top corners" ); + ok( !set.find( ".ui-collapsible" ).eq( 0 ).find( "a" ).hasClass( "ui-corner-bottom" ), "The 1st collapsible should NOT have bottom corners" ); + ok( !set.find( ".ui-collapsible" ).eq( 1 ).find( "a" ).hasClass( "ui-corner-top" ), "The 2nd collapsible should NOT have top corners" ); + ok( !set.find( ".ui-collapsible" ).eq( 1 ).find( "a" ).hasClass( "ui-corner-bottom" ), "The 2nd collapsible should NOT have bottom corners" ); + ok( set.find( ".ui-collapsible" ).eq( 2 ).find( "a" ).hasClass( "ui-corner-bottom" ), "The 3rd collapsible should have bottom corners" ); + ok( !set.find( ".ui-collapsible" ).eq( 2 ).find( "a" ).hasClass( "ui-corner-top" ), "The 3rd collapsible should NOT have top corners" ); + start(); + } + ]); + }); + + asyncTest( "Collapsible Set with static and dynamic content", function(){ + $.testHelper.pageSequence([ + function(){ + $.testHelper.openPage( "#collapsible-set-with-static-and-dynamic-content" ); + }, + + function() { + var set = $( ".ui-page-active" ).find( ".ui-collapsible-set" ); + for ( var i = 0; i < 2; i++ ) { + $( '

      Collapsible Item ' + i + '

      ' ).appendTo( set ); + } + set.collapsibleset( "refresh" ); + equal( set.find( ".ui-collapsible" ).length, 3, "The 3 collapsibles should be enhanced" ); + ok( set.find( ".ui-collapsible" ).eq( 0 ).find( "a" ).hasClass( "ui-corner-top" ), "The 1st collapsible should have top corners" ); + ok( !set.find( ".ui-collapsible" ).eq( 0 ).find( "a" ).hasClass( "ui-corner-bottom" ), "The 1st collapsible should NOT have bottom corners" ); + ok( !set.find( ".ui-collapsible" ).eq( 1 ).find( "a" ).hasClass( "ui-corner-top" ), "The 2nd collapsible should NOT have top corners" ); + ok( !set.find( ".ui-collapsible" ).eq( 1 ).find( "a" ).hasClass( "ui-corner-bottom" ), "The 2nd collapsible should NOT have bottom corners" ); + ok( set.find( ".ui-collapsible" ).eq( 2 ).find( "a" ).hasClass( "ui-corner-bottom" ), "The 3rd collapsible should have bottom corners" ); + ok( !set.find( ".ui-collapsible" ).eq( 2 ).find( "a" ).hasClass( "ui-corner-top" ), "The 3rd collapsible should NOT have top corners" ); + start(); + } + ]); + }); + + module( "Theming", {}); + + asyncTest( "Collapsible", 6, function(){ + $.testHelper.pageSequence([ + function(){ + $.testHelper.openPage( "#collapsible-with-theming" ); + }, + + function() { + var collapsibles = $.mobile.activePage.find( ".ui-collapsible" ); + ok( collapsibles.eq(0).find( ".ui-collapsible-heading-toggle" ).hasClass( "ui-btn-up-a" ), "Heading of first collapsible should have class ui-btn-up-a"); + ok( !collapsibles.eq(0).find( ".ui-collapsible-content" ).hasClass( "ui-btn-up-a" ), "Content of first collapsible should NOT have class ui-btn-up-a"); + ok( collapsibles.eq(1).find( ".ui-collapsible-heading-toggle" ).hasClass( "ui-btn-up-b" ), "Heading of second collapsible should have class ui-btn-up-b"); + ok( collapsibles.eq(1).find( ".ui-collapsible-content" ).hasClass( "ui-body-b" ), "Content of second collapsible should have class ui-btn-up-b"); + ok( collapsibles.eq(2).find( ".ui-collapsible-heading-toggle" ).hasClass( "ui-btn-up-c" ), "Heading of third collapsible should have class ui-btn-up-c"); + ok( collapsibles.eq(2).find( ".ui-collapsible-content" ).hasClass( "ui-body-c" ), "Content of third collapsible should have class ui-btn-up-c"); + start(); + } + ]); + }); + + + asyncTest( "Collapsible Set", function(){ + $.testHelper.pageSequence([ + function(){ + $.testHelper.openPage( "#collapsible-set-with-theming" ); + }, + + function() { + var collapsibles = $.mobile.activePage.find( ".ui-collapsible" ); + ok( collapsibles.eq(0).find( ".ui-collapsible-heading-toggle" ).hasClass( "ui-btn-up-a" ), "Heading of first collapsible should have class ui-btn-up-a"); + ok( !collapsibles.eq(0).find( ".ui-collapsible-content" ).is( ".ui-body-a,.ui-body-b,.ui-body-c" ), "Content of first collapsible should NOT have class ui-btn-up-[a,b,c]"); + ok( collapsibles.eq(0).find( ".ui-collapsible-content" ).hasClass( "ui-body-d" ), "Content of first collapsible should NOT have class ui-btn-up-d"); + ok( collapsibles.eq(1).find( ".ui-collapsible-heading-toggle" ).hasClass( "ui-btn-up-b" ), "Heading of second collapsible should have class ui-btn-up-b"); + ok( !collapsibles.eq(1).find( ".ui-collapsible-content" ).is( ".ui-body-a,.ui-body-c,.ui-body-d" ), "Content of second collapsible should NOT have class ui-btn-up-[a,c,d]"); + ok( collapsibles.eq(1).find( ".ui-collapsible-content" ).hasClass( "ui-body-b" ), "Content of second collapsible should have class ui-btn-up-b"); + ok( collapsibles.eq(2).find( ".ui-collapsible-heading-toggle" ).hasClass( "ui-btn-up-d" ), "Heading of third collapsible should have class ui-btn-up-d"); + ok( !collapsibles.eq(2).find( ".ui-collapsible-content" ).is( ".ui-body-a,.ui-body-b,.ui-body-c" ), "Content of third collapsible should NOT have class ui-btn-up-[a,b,c]"); + ok( collapsibles.eq(2).find( ".ui-collapsible-content" ).hasClass( "ui-body-d" ), "Content of third collapsible should have class ui-btn-up-d"); + ok( !collapsibles.eq(2).find( ".ui-collapsible-content" ).hasClass( "ui-collapsible-content-collapsed" ), "Content of third collapsible should NOT have class ui-collapsible-content-collapsed"); + ok( collapsibles.eq(3).find( ".ui-collapsible-heading-toggle" ).hasClass( "ui-btn-up-d" ), "Heading of fourth collapsible should have class ui-btn-up-d"); + ok( !collapsibles.eq(3).find( ".ui-collapsible-content" ).is( ".ui-body-a,.ui-body-b,.ui-body-c" ), "Content of fourth collapsible should NOT have class ui-btn-up-[a,b,c]"); + ok( collapsibles.eq(3).find( ".ui-collapsible-content" ).hasClass( "ui-body-d" ), "Content of fourth collapsible should have class ui-btn-up-d"); + start(); + } + ]); + }); + + +})( jQuery ); diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/collapsible/index.html b/libs/js/jquery-mobile-1.1.0/tests/unit/collapsible/index.html new file mode 100644 index 0000000..cf42f4c --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/collapsible/index.html @@ -0,0 +1,203 @@ + + + + + + jQuery Mobile Collapsible Integration Test + + + + + + + + + + + + + + +

      jQuery Mobile Collapsible Integration Test

      +

      +

      +
        +
      + +
      +
      +

      Basic collapsible

      +
      +
      +
      +

      Section A

      + +

      I'm the collapsible content in a set so this feels like an accordion. I'm hidden by default because I + have the "collapsed" state; you need to expand the header to see me.

      + +
      +
      +

      Section B

      + +

      I'm the collapsible content in a set so this feels like an accordion. I'm hidden by default because I + have the "collapsed" state; you need to expand the header to see me.

      + +
      +
      +
      + +
      +
      +

      Basic collapsible

      +
      +
      +
      +
      +

      Section A

      + +

      I'm the collapsible content in a set so this feels like an accordion. I'm hidden by default because I + have the "collapsed" state; you need to expand the header to see me.

      + +
      +
      +

      Section B

      + +

      I'm the collapsible content in a set so this feels like an accordion. I'm hidden by default because I + have the "collapsed" state; you need to expand the header to see me.

      + +
      +
      +

      Section C

      + +

      I'm the collapsible content in a set so this feels like an accordion. I'm hidden by default because I + have the "collapsed" state; you need to expand the header to see me.

      + +
      +
      +
      +
      + +
      +
      +

      Basic collapsible

      +
      +
      +
      +
      +

      Section D

      + +

      I'm the collapsible content in a set so this feels like an accordion. I'm hidden by default because I + have the "collapsed" state; you need to expand the header to see me.

      +
      +
      + +
      +

      Section E

      + +

      I'm the collapsible content in a set so this feels like an accordion. I'm hidden by default because I + have the "collapsed" state; you need to expand the header to see me.

      +
      +
      +
      + +
      +
      +

      Themed collapsibles

      +
      +
      +
      +

      Section A

      + +

      I'm the collapsible content in a set so this feels like an accordion. I'm hidden by default because I + have the "collapsed" state; you need to expand the header to see me.

      +
      +
      +

      Section B

      + +

      I'm the collapsible content in a set so this feels like an accordion. I'm hidden by default because I + have the "collapsed" state; you need to expand the header to see me.

      +
      +
      +

      Section B

      + +

      I'm the collapsible content in a set so this feels like an accordion. I'm hidden by default because I + have the "collapsed" state; you need to expand the header to see me.

      +
      + +
      +
      + +
      +
      +

      Themed collapsibles

      +
      +
      +
      +
      +

      Section A

      + +

      I'm the collapsible content in a set so this feels like an accordion. I'm hidden by default because I + have the "collapsed" state; you need to expand the header to see me.

      +
      +
      +

      Section B

      + +

      I'm the collapsible content in a set so this feels like an accordion. I'm hidden by default because I + have the "collapsed" state; you need to expand the header to see me.

      +
      +
      +

      Section C

      + +

      I'm the collapsible content in a set so this feels like an accordion. I'm hidden by default because I + have the "collapsed" state; you need to expand the header to see me.

      +
      +
      +

      Section D

      + +

      I'm the collapsible content in a set so this feels like an accordion. I'm hidden by default because I + have the "collapsed" state; you need to expand the header to see me.

      +
      +
      + +
      +
      + +
      +
      +

      Collapsible Set with dynamic content

      +
      +
      +
      +
      +
      + +
      +
      +

      Collapsible Set with dynamic content

      +
      +
      +
      +
      +

      Section A

      + +

      I'm the collapsible content in a set so this feels like an accordion. I'm hidden by default because I + have the "collapsed" state; you need to expand the header to see me.

      +
      +
      +
      +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/controlgroup/controlgroup_core.js b/libs/js/jquery-mobile-1.1.0/tests/unit/controlgroup/controlgroup_core.js new file mode 100644 index 0000000..eaf97fc --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/controlgroup/controlgroup_core.js @@ -0,0 +1,147 @@ +/* + * mobile checkboxradio unit tests + */ +(function($){ + module( 'vertical controlgroup, no refresh' , { + setup: function() { + this.vcontrolgroup = $( "#vertical-controlgroup" ); + } + }); + + test( "vertical controlgroup classes", function() { + var buttons = this.vcontrolgroup.find( ".ui-btn" ), + middlebuttons = buttons.filter(function(index) { return index > 0 && index < (length-1)}), + length = buttons.length; + + ok( !buttons.hasClass( "ui-btn-corner-all" ), "no button should have class 'ui-btn-corner-all'"); + ok( buttons.first().hasClass( "ui-corner-top" ), "first button should have class 'ui-corner-top'" ); + ok( !middlebuttons.hasClass( "ui-corner-top" ), "middle buttons should not have class 'ui-corner-top'" ); + ok( !middlebuttons.hasClass( "ui-corner-bottom" ), "middle buttons should not have class 'ui-corner-bottom'" ); + ok( buttons.last().hasClass( "ui-corner-bottom"), "last button should have class 'ui-corner-bottom'" ); + }); + + module( 'vertical controlgroup, refresh', { + setup: function() { + this.vcontrolgroup = $( "#vertical-controlgroup" ); + this.vcontrolgroup.find( ".ui-btn" ).show(); + this.vcontrolgroup.controlgroup(); + } + }); + + test( "vertical controlgroup after first button was hidden", function() { + //https://github.com/jquery/jquery-mobile/issues/1929 + + //We hide the first button and refresh + this.vcontrolgroup.find( ".ui-btn" ).first().hide(); + this.vcontrolgroup.controlgroup(); + + var buttons = this.vcontrolgroup.find( ".ui-btn" ).filter( ":visible" ), + middlebuttons = buttons.filter(function(index) { return index > 0 && index < (length-1)}), + length = buttons.length; + + ok( buttons.first().hasClass( "ui-corner-top" ), "first visible button should have class 'ui-corner-top'" ); + ok( !middlebuttons.hasClass( "ui-corner-top" ), "middle buttons should not have class 'ui-corner-top'" ); + ok( !middlebuttons.hasClass( "ui-corner-bottom" ), "middle buttons should not have class 'ui-corner-bottom'" ); + ok( buttons.last().hasClass( "ui-corner-bottom"), "last visible button should have class 'ui-corner-bottom'" ); + }); + + test( "vertical controlgroup after last button was hidden", function() { + //https://github.com/jquery/jquery-mobile/issues/1929 + + //We hide the last button and refresh + this.vcontrolgroup.find( ".ui-btn" ).last().hide(); + this.vcontrolgroup.controlgroup(); + + var buttons = this.vcontrolgroup.find( ".ui-btn" ).filter( ":visible" ), + middlebuttons = buttons.filter(function(index) { return index > 0 && index < (length-1)}), + length = buttons.length; + + ok( buttons.first().hasClass( "ui-corner-top" ), "first visible button should have class 'ui-corner-top'" ); + ok( !middlebuttons.hasClass( "ui-corner-top" ), "middle buttons should not have class 'ui-corner-top'" ); + ok( !middlebuttons.hasClass( "ui-corner-bottom" ), "middle buttons should not have class 'ui-corner-bottom'" ); + ok( buttons.last().hasClass( "ui-corner-bottom"), "last visible button should have class 'ui-corner-bottom'" ); + }); + + module( 'horizontal controlgroup, no refresh', { + setup: function() { + this.hcontrolgroup = $( "#horizontal-controlgroup" ); + } + }); + + test( "horizontal controlgroup classes", function() { + var buttons = this.hcontrolgroup.find( ".ui-btn" ), + middlebuttons = buttons.filter(function(index) { return index > 0 && index < (length-1)}), + length = buttons.length; + + ok( !buttons.hasClass( "ui-btn-corner-all" ), "no button should have class 'ui-btn-corner-all'"); + ok( buttons.first().hasClass( "ui-corner-left" ), "first button should have class 'ui-corner-left'" ); + ok( !middlebuttons.hasClass( "ui-corner-left" ), "middle buttons should not have class 'ui-corner-left'" ); + ok( !middlebuttons.hasClass( "ui-corner-right" ), "middle buttons should not have class 'ui-corner-right'" ); + ok( buttons.last().hasClass( "ui-corner-right"), "last button should have class 'ui-corner-right'" ); + }); + + module( 'horizontal controlgroup, refresh', { + setup: function() { + this.hcontrolgroup = $( "#horizontal-controlgroup" ); + this.hcontrolgroup.find( ".ui-btn" ).show(); + this.hcontrolgroup.controlgroup(); + } + }); + + test( "horizontal controlgroup after first button was hidden", function() { + //We hide the first button and refresh + this.hcontrolgroup.find( ".ui-btn" ).first().hide(); + this.hcontrolgroup.controlgroup(); + + var buttons = this.hcontrolgroup.find( ".ui-btn" ).filter( ":visible" ), + middlebuttons = buttons.filter(function(index) { return index > 0 && index < (length-1)}), + length = buttons.length; + + ok( buttons.first().hasClass( "ui-corner-left" ), "first visible button should have class 'ui-corner-left'" ); + ok( !middlebuttons.hasClass( "ui-corner-left" ), "middle buttons should not have class 'ui-corner-left'" ); + ok( !middlebuttons.hasClass( "ui-corner-right" ), "middle buttons should not have class 'ui-corner-right'" ); + ok( buttons.last().hasClass( "ui-corner-right"), "last visible button should have class 'ui-corner-right'" ); + }); + + test( "horizontal controlgroup after last button was hidden", function() { + //We hide the last button and refresh + this.hcontrolgroup.find( ".ui-btn" ).last().hide(); + this.hcontrolgroup.controlgroup(); + + var buttons = this.hcontrolgroup.find( ".ui-btn" ).filter( ":visible" ), + middlebuttons = buttons.filter(function(index) { return index > 0 && index < (length-1)}), + length = buttons.length; + + ok( buttons.first().hasClass( "ui-corner-left" ), "first visible button should have class 'ui-corner-left'" ); + ok( !middlebuttons.hasClass( "ui-corner-left" ), "middle buttons should not have class 'ui-corner-left'" ); + ok( !middlebuttons.hasClass( "ui-corner-right" ), "middle buttons should not have class 'ui-corner-right'" ); + ok( buttons.last().hasClass( "ui-corner-right"), "last visible button should have class 'ui-corner-right'" ); + }); + + + test( "controlgroups will create when inside a container that receives a 'create' event", function(){ + ok( !$("#enhancetest").appendTo(".ui-page-active").find(".ui-controlgroup").length, "did not have enhancements applied" ); + ok( $("#enhancetest").trigger("create").find(".ui-controlgroup").length, "enhancements applied" ); + }); + + test( "controlgroups in ignored containers aren't enhanced", function() { + var $unenhancedFieldSet = $( "#unenhanced-fieldset" ), + $enhancedFieldSet = $( "#enhanced-fieldset" ); + + $.mobile.ignoreContentEnabled = true; + + // attempt to enhance the controlgroup + $unenhancedFieldSet.parent().trigger("create"); + + same( $unenhancedFieldSet.length, 1, "the fieldset test fixtures exist" ); + ok( !$unenhancedFieldSet.is(".ui-controlgroup"), "there is no control group" ); + + // attempt to enhance the controlgroup + $enhancedFieldSet.parent().trigger("create"); + + same( $enhancedFieldSet.length, 1, "the fieldset test fixtures exist" ); + ok( $enhancedFieldSet.is(".ui-controlgroup"), "there is a control group" ); + + $.mobile.ignoreContentEnabled = false; + }); +})(jQuery); diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/controlgroup/index.html b/libs/js/jquery-mobile-1.1.0/tests/unit/controlgroup/index.html new file mode 100644 index 0000000..add115e --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/controlgroup/index.html @@ -0,0 +1,104 @@ + + + + + + jQuery Mobile Controlgroup Test Suite + + + + + + + + + + + + + + + +

      jQuery Mobile Controlgroup Test Suite

      +

      +

      +
        +
      + +
      +
      + +
      +
      + Choose a pet: + + + + + + + + + + + +
      +
      + +
      +
      + Font styling: + + + + + + + + + + + +
      +
      + +
      +
      + +
      +
      + + + + + +
      +
      + +
      +
      + + + + + +
      +
      + +
      +
      +
      +
      + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/core/core.js b/libs/js/jquery-mobile-1.1.0/tests/unit/core/core.js new file mode 100644 index 0000000..1b60562 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/core/core.js @@ -0,0 +1,190 @@ +/* + * mobile core unit tests + */ + +(function($){ + var libName = "jquery.mobile.core", + setGradeA = function(value, version) { + $.support.mediaquery = value; + $.mobile.browser.ie = version; + }, + extendFn = $.extend; + + module(libName, { + setup: function(){ + // NOTE reset for gradeA tests + $('html').removeClass('ui-mobile'); + + // NOTE reset for pageLoading tests + $('.ui-loader').remove(); + }, + teardown: function(){ + $.extend = extendFn; + } + }); + + $.testHelper.excludeFileProtocol(function(){ + asyncTest( "grade A browser either supports media queries or is IE 7+", function(){ + setGradeA(false, 6); + $.testHelper.deferredSequence([ + function() { + return $.testHelper.reloadModule(libName); + }, + + function() { + ok(!$.mobile.gradeA()); + }, + + function() { + setGradeA(true, 8); + return $.testHelper.reloadModule(libName); + }, + + function() { + ok($.mobile.gradeA()); + start(); + } + ]); + }); + }); + + function clearNSNormalizeDictionary() + { + var dict = $.mobile.nsNormalizeDict; + for ( var prop in dict ) { + delete dict[ prop ]; + } + } + + test( "$.mobile.nsNormalize works properly with namespace defined (test default)", function(){ + // Start with a fresh namespace property cache, just in case + // the previous test mucked with namespaces. + clearNSNormalizeDictionary(); + + equal($.mobile.nsNormalize("foo"), "nstestFoo", "appends ns and initcaps"); + equal($.mobile.nsNormalize("fooBar"), "nstestFooBar", "leaves capped strings intact"); + equal($.mobile.nsNormalize("foo-bar"), "nstestFooBar", "changes dashed strings"); + equal($.mobile.nsNormalize("foo-bar-bak"), "nstestFooBarBak", "changes multiple dashed strings"); + + // Reset the namespace property cache for the next test. + clearNSNormalizeDictionary(); + }); + + test( "$.mobile.nsNormalize works properly with an empty namespace", function(){ + var realNs = $.mobile.ns; + + $.mobile.ns = ""; + + // Start with a fresh namespace property cache, just in case + // the previous test mucked with namespaces. + clearNSNormalizeDictionary(); + + equal($.mobile.nsNormalize("foo"), "foo", "leaves uncapped and undashed"); + equal($.mobile.nsNormalize("fooBar"), "fooBar", "leaves capped strings intact"); + equal($.mobile.nsNormalize("foo-bar"), "fooBar", "changes dashed strings"); + equal($.mobile.nsNormalize("foo-bar-bak"), "fooBarBak", "changes multiple dashed strings"); + + $.mobile.ns = realNs; + + // Reset the namespace property cache for the next test. + clearNSNormalizeDictionary(); + }); + + //data tests + test( "$.fn.jqmData and $.fn.jqmRemoveData methods are working properly", function(){ + var data; + + same( $("body").jqmData("foo", true), $("body"), "setting data returns the element" ); + + same( $("body").jqmData("foo"), true, "getting data returns the right value" ); + + same( $("body").data($.mobile.nsNormalize("foo")), true, "data was set using namespace" ); + + same( $("body").jqmData("foo", undefined), true, "getting data still returns the value if there's an undefined second arg" ); + + data = $.extend( {}, $("body").data() ); + delete data[ $.expando ]; //discard the expando for that test + same( data , { "nstestFoo": true }, "passing .data() no arguments returns a hash with all set properties" ); + + same( $("body").jqmData(), undefined, "passing no arguments returns undefined" ); + + same( $("body").jqmData(undefined), undefined, "passing a single undefined argument returns undefined" ); + + same( $("body").jqmData(undefined, undefined), undefined, "passing 2 undefined arguments returns undefined" ); + + same( $("body").jqmRemoveData("foo"), $("body"), "jqmRemoveData returns the element" ); + + same( $("body").jqmData("foo"), undefined, "jqmRemoveData properly removes namespaced data" ); + + }); + + + test( "$.jqmData and $.jqmRemoveData methods are working properly", function(){ + same( $.jqmData(document.body, "foo", true), true, "setting data returns the value" ); + + same( $.jqmData(document.body, "foo"), true, "getting data returns the right value" ); + + same( $.data(document.body, $.mobile.nsNormalize("foo")), true, "data was set using namespace" ); + + same( $.jqmData(document.body, "foo", undefined), true, "getting data still returns the value if there's an undefined second arg" ); + + same( $.jqmData(document.body), undefined, "passing no arguments returns undefined" ); + + same( $.jqmData(document.body, undefined), undefined, "passing a single undefined argument returns undefined" ); + + same( $.jqmData(document.body, undefined, undefined), undefined, "passing 2 undefined arguments returns undefined" ); + + same( $.jqmRemoveData(document.body, "foo"), undefined, "jqmRemoveData returns the undefined value" ); + + same( $("body").jqmData("foo"), undefined, "jqmRemoveData properly removes namespaced data" ); + + }); + + test( "addDependents works properly", function() { + same( $("#parent").jqmData('dependents'), undefined ); + $( "#parent" ).addDependents( $("#dependent") ); + same( $("#parent").jqmData('dependents').length, 1 ); + }); + + test( "removeWithDependents removes the parent element and ", function(){ + $( "#parent" ).addDependents( $("#dependent") ); + same($( "#parent, #dependent" ).length, 2); + $( "#parent" ).removeWithDependents(); + same($( "#parent, #dependent" ).length, 0); + }); + + test( "$.fn.getEncodedText should return the encoded value where $.fn.text doesn't", function() { + same( $("#encoded").text(), "foo>"); + same( $("#encoded").getEncodedText(), "foo>"); + same( $("#unencoded").getEncodedText(), "var foo;"); + }); + + test( "closestPageData returns the parent's page data", function() { + var pageChild = $( "#page-child" ); + + $( "#parent-page" ).data( "page", { foo: "bar" } ); + same( $.mobile.closestPageData( pageChild ).foo, "bar" ); + }); + + test( "closestPageData returns the parent dialog's page data", function() { + var dialogChild = $( "#dialog-child" ); + + $( "#parent-dialog" ).data( "page", { foo: "bar" } ); + same( $.mobile.closestPageData(dialogChild).foo, "bar" ); + }); + + test( "test that $.fn.jqmHijackable works", function() { + $.mobile.ignoreContentEnabled = true; + + same( $( "#hijacked-link" ).jqmHijackable().length, 1, + "a link without any association to data-ajax=false should be included"); + + same( $( "#unhijacked-link-by-parent" ).jqmHijackable().length, 0, + "a link with a data-ajax=false parent should be excluded"); + + same( $( "#unhijacked-link-by-attr" ).jqmHijackable().length, 0, + "a link with data-ajax=false should be excluded"); + + $.mobile.ignoreContentEnabled = false; + }); +})(jQuery); \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/core/core_scroll.js b/libs/js/jquery-mobile-1.1.0/tests/unit/core/core_scroll.js new file mode 100644 index 0000000..d1b8ef0 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/core/core_scroll.js @@ -0,0 +1,63 @@ +/* + * mobile core unit tests + */ + +(function($){ + var libName = "jquery.mobile.core", + scrollTimeout = 20, // TODO expose timing as an attribute + scrollStartEnabledTimeout = 150; + + module(libName, { + setup: function(){ + $("
      ").appendTo("body"); + }, + + teardown: function(){ + $("#scroll-testing").remove(); + } + }); + + var scrollUp = function( pos ){ + $(window).scrollTop(1000); + ok($(window).scrollTop() > 0, $(window).scrollTop()); + $.mobile.silentScroll(pos); + }; + + asyncTest( "silent scroll scrolls the page to the top by default", function(){ + scrollUp(); + + setTimeout(function(){ + same($(window).scrollTop(), 0); + start(); + }, scrollTimeout); + }); + + asyncTest( "silent scroll scrolls the page to the passed y position", function(){ + var pos = 10; + scrollUp(pos); + + setTimeout(function(){ + same($(window).scrollTop(), pos); + start(); + }, scrollTimeout); + }); + + test( "silent scroll is async", function(){ + scrollUp(); + ok($(window).scrollTop() != 0, "scrolltop position should not be zero"); + start(); + }); + + asyncTest( "scrolling marks scrollstart as disabled for 150 ms", function(){ + $.event.special.scrollstart.enabled = true; + scrollUp(); + ok(!$.event.special.scrollstart.enabled); + + setTimeout(function(){ + ok($.event.special.scrollstart.enabled); + start(); + }, scrollStartEnabledTimeout); + }); + + //TODO test that silentScroll is called on window load +})(jQuery); diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/core/index.html b/libs/js/jquery-mobile-1.1.0/tests/unit/core/index.html new file mode 100644 index 0000000..4cad369 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/core/index.html @@ -0,0 +1,65 @@ + + + + + + jQuery Mobile Core Test Suite + + + + + + + + + + + + + + +

      jQuery Mobile Core Test Suite

      +

      +

      +
        +
      + +
      +
      + +
      +
      +
      +
      foo>
      +
      + +
      +
      +
      + +
      +
      +
      +
      + +
      + + +
      + +
      + +
      + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/degradeInputs/degradeInputs.js b/libs/js/jquery-mobile-1.1.0/tests/unit/degradeInputs/degradeInputs.js new file mode 100644 index 0000000..98659a9 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/degradeInputs/degradeInputs.js @@ -0,0 +1,43 @@ +/* + * degradeInputs unit tests + */ + +(function($){ + module('jquery.mobile.degradeInputs.js'); + + test('keepNative elements should not be degraded', function() { + same($('input#not-to-be-degraded').attr("type"), "range"); + }); + + asyncTest('should degrade input type to a different type, as specified in page options', function(){ + var degradeInputs = $.mobile.page.prototype.options.degradeInputs; + + expect( degradeInputs.length ); + + // NOTE the initial page is already enhanced (or expected to be) so we load the dialog to enhance it + // and _expect_ that the default page will remain "unreaped". This will break if that assumption changes + $.testHelper.pageSequence([ + function() { + $.mobile.changePage( "#dialog" ); + }, + + function() { + $.each(degradeInputs, function( oldType, newType ) { + if (newType === false) { + newType = oldType; + } + + $('#page-test-container').html('').trigger("create"); + + same($('#page-test-container input').attr("type"), newType, "type attr on page is: " + newType); + + $('#dialog-test-container').html('').trigger("create"); + + same($('#dialog-test-container input').attr("type"), newType, "type attr on dialog is: " + newType); + }); + + start(); + } + ]); + }); +})(jQuery); \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/degradeInputs/index.html b/libs/js/jquery-mobile-1.1.0/tests/unit/degradeInputs/index.html new file mode 100644 index 0000000..45a2fb4 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/degradeInputs/index.html @@ -0,0 +1,48 @@ + + + + + + jQuery Mobile Degrade Inputs Test Suite + + + + + + + + + + + + + +

      jQuery Mobile Degrade Inputs Test Suite

      +

      +

      +
        +
      + +
      + + + +
      +
      + +
      + +
      + +
      +
      + +
      + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/dialog/dialog_count.js b/libs/js/jquery-mobile-1.1.0/tests/unit/dialog/dialog_count.js new file mode 100644 index 0000000..53a9316 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/dialog/dialog_count.js @@ -0,0 +1,13 @@ +/* + * mobile dialog unit tests + */ +(function($) { + + test( "When the page loads, any dialogs in the page should be initialized", function() { + expect( 1 ); + + ok( $( "#foo-dialog" ).is( ".ui-dialog" ), "When a dialog is the first element in a page, it is created as a dialog widget." ); + }); + + +})( jQuery ); diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/dialog/dialog_events.js b/libs/js/jquery-mobile-1.1.0/tests/unit/dialog/dialog_events.js new file mode 100644 index 0000000..15628ba --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/dialog/dialog_events.js @@ -0,0 +1,146 @@ +/* + * mobile dialog unit tests + */ +(function($) { + module( "jquery.mobile.dialog.js", { + setup: function() { + $.mobile.page.prototype.options.contentTheme = "d"; + } + }); + + asyncTest( "dialog hash is added when the dialog is opened and removed when closed", function() { + expect( 2 ); + + $.testHelper.pageSequence([ + function() { + $.mobile.changePage( $( "#mypage" ) ); + }, + + function() { + //bring up the dialog + $( "#foo-dialog-link" ).click(); + }, + + function() { + var fooDialog = $( "#foo-dialog" ); + + // make sure the dialog came up + ok( /&ui-state=dialog/.test(location.hash), "ui-state=dialog =~ location.hash", "dialog open" ); + + // close the dialog + $( ".ui-dialog" ).dialog( "close" ); + }, + + function() { + ok( !/&ui-state=dialog/.test(location.hash), "ui-state=dialog !~ location.hash" ); + start(); + } + ]); + }); + + asyncTest( "dialog element with no theming", function() { + expect(4); + + $.testHelper.pageSequence([ + function() { + $.mobile.changePage( $( "#mypage" ) ); + }, + + function() { + //bring up the dialog + $( "#link-a" ).click(); + }, + + function() { + var dialog = $( "#dialog-a" ); + + // Assert dialog theme inheritance (issue 1375): + ok( dialog.hasClass( "ui-body-c" ), "Expected explicit theme ui-body-c" ); + ok( dialog.find( ":jqmData(role=header)" ).hasClass( "ui-bar-" + $.mobile.page.prototype.options.footerTheme ), "Expected header to inherit from $.mobile.page.prototype.options.headerTheme" ); + ok( dialog.find( ":jqmData(role=content)" ).hasClass( "ui-body-" + $.mobile.page.prototype.options.contentTheme ), "Expect content to inherit from $.mobile.page.prototype.options.contentTheme" ); + ok( dialog.find( ":jqmData(role=footer)" ).hasClass( "ui-bar-" + $.mobile.page.prototype.options.footerTheme ), "Expected footer to inherit from $.mobile.page.prototype.options.footerTheme" ); + + start(); + } + ]); + }); + + asyncTest( "dialog element with data-theme", function() { + // Reset fallback theme for content + $.mobile.page.prototype.options.contentTheme = null; + + expect(5); + + $.testHelper.pageSequence([ + function() { + $.mobile.changePage( $( "#mypage" ) ); + }, + + function() { + //bring up the dialog + $( "#link-b" ).click(); + }, + + function() { + var dialog = $( "#dialog-b" ); + + // Assert dialog theme inheritance (issue 1375): + ok( dialog.hasClass( "ui-body-e" ), "Expected explicit theme ui-body-e" ); + ok( !dialog.hasClass( "ui-overlay-b" ), "Expected no theme ui-overlay-b" ); + ok( dialog.find( ":jqmData(role=header)" ).hasClass( "ui-bar-" + $.mobile.page.prototype.options.footerTheme ), "Expected header to inherit from $.mobile.page.prototype.options.headerTheme" ); + ok( dialog.find( ":jqmData(role=content)" ).hasClass( "ui-body-e" ), "Expect content to inherit from data-theme" ); + ok( dialog.find( ":jqmData(role=footer)" ).hasClass( "ui-bar-" + $.mobile.page.prototype.options.footerTheme ), "Expected footer to inherit from $.mobile.page.prototype.options.footerTheme" ); + + start(); + } + ]); + }); + + asyncTest( "dialog element with data-theme & data-overlay-theme", function() { + expect(5); + + $.testHelper.pageSequence([ + function() { + $.mobile.changePage( $( "#mypage" ) ); + }, + + function() { + //bring up the dialog + $( "#link-c" ).click(); + }, + + function() { + var dialog = $( "#dialog-c" ); + + // Assert dialog theme inheritance (issue 1375): + ok( dialog.hasClass( "ui-body-e" ), "Expected explicit theme ui-body-e" ); + ok( dialog.hasClass( "ui-overlay-b" ), "Expected explicit theme ui-overlay-b" ); + ok( dialog.find( ":jqmData(role=header)" ).hasClass( "ui-bar-" + $.mobile.page.prototype.options.footerTheme ), "Expected header to inherit from $.mobile.page.prototype.options.headerTheme" ); + ok( dialog.find( ":jqmData(role=content)" ).hasClass( "ui-body-" + $.mobile.page.prototype.options.contentTheme ), "Expect content to inherit from $.mobile.page.prototype.options.contentTheme" ); + ok( dialog.find( ":jqmData(role=footer)" ).hasClass( "ui-bar-" + $.mobile.page.prototype.options.footerTheme ), "Expected footer to inherit from $.mobile.page.prototype.options.footerTheme" ); + + start(); + } + ]); + }); + + + asyncTest( "page container is updated to dialog overlayTheme at pagebeforeshow", function(){ + + expect( 1 ); + + var pageTheme = "ui-overlay-" + $.mobile.activePage.dialog( "option", "overlayTheme" ); + + $.mobile.pageContainer.removeClass( pageTheme ); + + $.mobile.activePage + .bind( "pagebeforeshow", function(){ + ok( $.mobile.pageContainer.hasClass( pageTheme ), "Page container has the same theme as the dialog overlayTheme on pagebeforeshow" ); + start(); + }) + .trigger( "pagebeforeshow" ); + + } ); + + +})( jQuery ); diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/dialog/index-count.html b/libs/js/jquery-mobile-1.1.0/tests/unit/dialog/index-count.html new file mode 100644 index 0000000..88d7e01 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/dialog/index-count.html @@ -0,0 +1,63 @@ + + + + + + jQuery Mobile Dialog Test Suite + + + + + + + + + + + + + + + + +

      jQuery Mobile Dialog Test Suite

      +

      +

      +
        +
      + +
      + +
      +
      +

      Dialog

      +
      +
      + +
      +
      + footer +
      +
      + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/dialog/index.html b/libs/js/jquery-mobile-1.1.0/tests/unit/dialog/index.html new file mode 100644 index 0000000..50c8f68 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/dialog/index.html @@ -0,0 +1,102 @@ + + + + + + jQuery Mobile Dialog Test Suite + + + + + + + + + + + + + + + + +

      jQuery Mobile Dialog Test Suite

      +

      +

      +
        +
      + + + +
      +
      +

      Dialog

      +
      +
      + foo +
      +
      + footer +
      +
      + +
      +
      +

      No theme set

      +
      +
      + Some text here.... +
      +
      + footer +
      +
      + +
      +
      +

      data-nstest-theme set

      +
      +
      + Some text here.... +
      +
      + footer +
      +
      + +
      +
      +

      data-nstest-theme & data-nstest-overlay-theme set

      +
      +
      + Some text here.... +
      +
      + footer +
      +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/event/event_core.js b/libs/js/jquery-mobile-1.1.0/tests/unit/event/event_core.js new file mode 100644 index 0000000..23e6f59 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/event/event_core.js @@ -0,0 +1,551 @@ +/* + * mobile event unit tests + */ + +(function($){ + var libName = "jquery.mobile.event.js", + absFn = Math.abs, + originalEventFn = $.Event.prototype.originalEvent, + preventDefaultFn = $.Event.prototype.preventDefault, + events = ("touchstart touchmove touchend orientationchange tap taphold " + + "swipe swipeleft swiperight scrollstart scrollstop").split( " " ); + + module(libName, { + setup: function(){ + + // ensure bindings are removed + $.each(events + "vmouseup vmousedown".split(" "), function(i, name){ + $("#qunit-fixture").unbind(); + }); + + //NOTE unmock + Math.abs = absFn; + $.Event.prototype.originalEvent = originalEventFn; + $.Event.prototype.preventDefault = preventDefaultFn; + + // make sure the event objects respond to touches to simulate + // the collections existence in non touch enabled test browsers + $.Event.prototype.touches = [{pageX: 1, pageY: 1 }]; + + $($.mobile.pageContainer).unbind( "throttledresize" ); + } + }); + + $.testHelper.excludeFileProtocol(function(){ + test( "new events defined on the jquery object", function(){ + $.each(events, function( i, name ) { + delete $.fn[name]; + same($.fn[name], undefined); + }); + + $.testHelper.reloadLib(libName); + + $.each(events, function( i, name ) { + ok($.fn[name] !== undefined, name + " is not undefined"); + }); + }); + }); + + asyncTest( "defined event functions bind a closure when passed", function(){ + expect( 1 ); + + $('#qunit-fixture').bind(events[0], function(){ + ok(true, "event fired"); + start(); + }); + + $('#qunit-fixture').trigger(events[0]); + }); + + asyncTest( "defined event functions trigger the event with no arguments", function(){ + expect( 1 ); + + $('#qunit-fixture').bind('touchstart', function(){ + ok(true, "event fired"); + start(); + }); + + $('#qunit-fixture').touchstart(); + }); + + test( "defining event functions sets the attrFn to true", function(){ + $.each(events, function(i, name){ + ok($.attrFn[name], "attribute function is true"); + }); + }); + + test( "scrollstart enabled defaults to true", function(){ + $.event.special.scrollstart.enabled = false; + $.testHelper.reloadLib(libName); + ok($.event.special.scrollstart.enabled, "scrollstart enabled"); + }); + + asyncTest( "scrollstart setup binds a function that returns when its disabled", function(){ + expect( 1 ); + $.event.special.scrollstart.enabled = false; + + $( "#qunit-fixture" ).bind("scrollstart", function(){ + ok(false, "scrollstart fired"); + }); + + $( "#qunit-fixture" ).bind("touchmove", function(){ + ok(true, "touchmove fired"); + start(); + }); + + $( "#qunit-fixture" ).trigger("touchmove"); + }); + + asyncTest( "scrollstart setup binds a function that triggers scroll start when enabled", function(){ + $.event.special.scrollstart.enabled = true; + + $( "#qunit-fixture" ).bind("scrollstart", function(){ + ok(true, "scrollstart fired"); + start(); + }); + + $( "#qunit-fixture" ).trigger("touchmove"); + }); + + asyncTest( "scrollstart setup binds a function that triggers scroll stop after 50 ms", function(){ + var triggered = false; + $.event.special.scrollstart.enabled = true; + + $( "#qunit-fixture" ).bind("scrollstop", function(){ + triggered = true; + }); + + ok(!triggered, "not triggered"); + + $( "#qunit-fixture" ).trigger("touchmove"); + + setTimeout(function(){ + ok(triggered, "triggered"); + start(); + }, 50); + }); + + var forceTouchSupport = function(){ + $.support.touch = true; + $.testHelper.reloadLib(libName); + + //mock originalEvent information + $.Event.prototype.originalEvent = { + touches: [{ 'pageX' : 0 }, { 'pageY' : 0 }] + }; + }; + + asyncTest( "long press fires tap hold after 750 ms", function(){ + var taphold = false, + target; + + forceTouchSupport(); + + $( "#qunit-fixture" ).bind("taphold", function( e ){ + taphold = true; + target = e.target; + }); + + $( "#qunit-fixture" ).trigger("vmousedown"); + + setTimeout(function(){ + ok( taphold ); + equal( target, $( "#qunit-fixture" ).get( 0 ), "taphold target should be #qunit-fixture" ); + start(); + }, 751); + }); + + //NOTE used to simulate movement when checked + //TODO find a better way ... + var mockAbs = function(value){ + Math.abs = function(){ + return value; + }; + }; + + asyncTest( "move prevents taphold", function(){ + expect( 1 ); + var taphold = false; + + forceTouchSupport(); + mockAbs(100); + + //NOTE record taphold event + $( "#qunit-fixture" ).bind("taphold", function(){ + ok(false, "taphold fired"); + taphold = true; + }); + + //NOTE start the touch events + $( "#qunit-fixture" ).trigger("vmousedown"); + + //NOTE fire touchmove to push back taphold + setTimeout(function(){ + $( "#qunit-fixture" ).trigger("vmousecancel"); + }, 100); + + //NOTE verify that the taphold hasn't been fired + // with the normal timing + setTimeout(function(){ + ok(!taphold, "taphold not fired"); + start(); + }, 751); + }); + + asyncTest( "tap event fired without movement", function(){ + expect( 1 ); + var tap = false, + checkTap = function(){ + ok(true, "tap fired"); + }; + + forceTouchSupport(); + + //NOTE record the tap event + $( "#qunit-fixture" ).bind("tap", checkTap); + + $( "#qunit-fixture" ).trigger("vmousedown"); + $( "#qunit-fixture" ).trigger("vmouseup"); + $( "#qunit-fixture" ).trigger("vclick"); + + setTimeout(function(){ + start(); + }, 400); + }); + + asyncTest( "tap event not fired when there is movement", function(){ + expect( 1 ); + var tap = false; + forceTouchSupport(); + + //NOTE record tap event + $( "#qunit-fixture" ).bind("tap", function(){ + ok(false, "tap fired"); + tap = true; + }); + + //NOTE make sure movement is recorded + mockAbs(100); + + //NOTE start and move right away + $( "#qunit-fixture" ).trigger("touchstart"); + $( "#qunit-fixture" ).trigger("touchmove"); + + //NOTE end touch sequence after 20 ms + setTimeout(function(){ + $( "#qunit-fixture" ).trigger("touchend"); + }, 20); + + setTimeout(function(){ + ok(!tap, "not tapped"); + start(); + }, 40); + }); + + asyncTest( "tap event propagates up DOM tree", function(){ + var tap = 0, + $qf = $( "#qunit-fixture" ), + $doc = $( document ), + docTapCB = function(){ + same(++tap, 2, "document tap callback called once after #qunit-fixture callback"); + }; + + $qf.bind( "tap", function() { + same(++tap, 1, "#qunit-fixture tap callback called once"); + }); + + $doc.bind( "tap", docTapCB ); + + $qf.trigger( "vmousedown" ) + .trigger( "vmouseup" ) + .trigger( "vclick" ); + + // tap binding should be triggered twice, once for + // #qunit-fixture, and a second time for document. + same( tap, 2, "final tap callback count is 2" ); + + $doc.unbind( "tap", docTapCB ); + + start(); + }); + + asyncTest( "stopPropagation() prevents tap from propagating up DOM tree", function(){ + var tap = 0, + $qf = $( "#qunit-fixture" ), + $doc = $( document ), + docTapCB = function(){ + ok(false, "tap should NOT be triggered on document"); + }; + + $qf.bind( "tap", function(e) { + same(++tap, 1, "tap callback 1 triggered once on #qunit-fixture"); + e.stopPropagation(); + }) + .bind( "tap", function(e) { + same(++tap, 2, "tap callback 2 triggered once on #qunit-fixture"); + }); + + $doc.bind( "tap", docTapCB); + + $qf.trigger( "vmousedown" ) + .trigger( "vmouseup" ) + .trigger( "vclick" ); + + // tap binding should be triggered twice. + same( tap, 2, "final tap count is 2" ); + + $doc.unbind( "tap", docTapCB ); + + start(); + }); + + asyncTest( "stopImmediatePropagation() prevents tap propagation and execution of 2nd handler", function(){ + var tap = 0, + $cf = $( "#qunit-fixture" ); + $doc = $( document ), + docTapCB = function(){ + ok(false, "tap should NOT be triggered on document"); + }; + + // Bind 2 tap callbacks on qunit-fixture. Only the first + // one should ever be called. + $cf.bind( "tap", function(e) { + same(++tap, 1, "tap callback 1 triggered once on #qunit-fixture"); + e.stopImmediatePropagation(); + }) + .bind( "tap", function(e) { + ok(false, "tap callback 2 should NOT be triggered on #qunit-fixture"); + }); + + $doc.bind( "tap", docTapCB); + + $cf.trigger( "vmousedown" ) + .trigger( "vmouseup" ) + .trigger( "vclick" ); + + // tap binding should be triggered once. + same( tap, 1, "final tap count is 1" ); + + $doc.unbind( "tap", docTapCB ); + + start(); + }); + + var swipeTimedTest = function(opts){ + var swipe = false; + + forceTouchSupport(); + + $( "#qunit-fixture" ).bind('swipe', function(){ + swipe = true; + }); + + //NOTE bypass the trigger source check + $.Event.prototype.originalEvent = { + touches: false + }; + + $( "#qunit-fixture" ).trigger("touchstart"); + + //NOTE make sure the coordinates are calculated within range + // to be registered as a swipe + mockAbs(opts.coordChange); + + setTimeout(function(){ + $( "#qunit-fixture" ).trigger("touchmove"); + $( "#qunit-fixture" ).trigger("touchend"); + }, opts.timeout + 100); + + setTimeout(function(){ + same(swipe, opts.expected, "swipe expected"); + start(); + }, opts.timeout + 200); + + stop(); + }; + + test( "swipe fired when coordinate change in less than a second", function(){ + swipeTimedTest({ timeout: 10, coordChange: 35, expected: true }); + }); + + test( "swipe not fired when coordinate change takes more than a second", function(){ + swipeTimedTest({ timeout: 1000, coordChange: 35, expected: false }); + }); + + test( "swipe not fired when coordinate change <= 30", function(){ + swipeTimedTest({ timeout: 1000, coordChange: 30, expected: false }); + }); + + test( "swipe not fired when coordinate change >= 75", function(){ + swipeTimedTest({ timeout: 1000, coordChange: 75, expected: false }); + }); + + asyncTest( "scrolling prevented when coordinate change > 10", function(){ + expect( 1 ); + + forceTouchSupport(); + + // ensure the swipe custome event is setup + $( "#qunit-fixture" ).bind('swipe', function(){}); + + //NOTE bypass the trigger source check + $.Event.prototype.originalEvent = { + touches: false + }; + + $.Event.prototype.preventDefault = function(){ + ok(true, "prevent default called"); + start(); + }; + + mockAbs(11); + + $( "#qunit-fixture" ).trigger("touchstart"); + $( "#qunit-fixture" ).trigger("touchmove"); + }); + + asyncTest( "move handler returns when touchstart has been fired since touchstop", function(){ + expect( 1 ); + + // bypass triggered event check + $.Event.prototype.originalEvent = { + touches: false + }; + + forceTouchSupport(); + + // ensure the swipe custome event is setup + $( "#qunit-fixture" ).bind('swipe', function(){}); + + $( "#qunit-fixture" ).trigger("touchstart"); + $( "#qunit-fixture" ).trigger("touchend"); + + $( "#qunit-fixture" ).bind("touchmove", function(){ + ok(true, "touchmove bound functions are fired"); + start(); + }); + + Math.abs = function(){ + ok(false, "shouldn't compare coordinates"); + }; + + $( "#qunit-fixture" ).trigger("touchmove"); + }); + + var nativeSupportTest = function(opts){ + $.support.orientation = opts.orientationSupport; + same($.event.special.orientationchange[opts.method](), opts.returnValue); + }; + + test( "orientation change setup should do nothing when natively supported", function(){ + nativeSupportTest({ + method: 'setup', + orientationSupport: true, + returnValue: false + }); + }); + + test( "orientation change setup should bind resize when not supported natively", function(){ + nativeSupportTest({ + method: 'setup', + orientationSupport: false, + returnValue: undefined //NOTE result of bind function call + }); + }); + + test( "orientation change teardown should do nothing when natively supported", function(){ + nativeSupportTest({ + method: 'teardown', + orientationSupport: true, + returnValue: false + }); + }); + + test( "orientation change teardown should unbind resize when not supported natively", function(){ + nativeSupportTest({ + method: 'teardown', + orientationSupport: false, + returnValue: undefined //NOTE result of unbind function call + }); + }); + + /* The following 4 tests are async so that the throttled event triggers don't interfere with subsequent tests */ + + asyncTest( "throttledresize event proxies resize events", function(){ + $( window ).one( "throttledresize", function(){ + ok( true, "throttledresize called"); + start(); + }); + + $( window ).trigger( "resize" ); + }); + + asyncTest( "throttledresize event prevents resize events from firing more frequently than 250ms", function(){ + var called = 0; + + $(window).bind( "throttledresize", function(){ + called++; + }); + + // NOTE 250 ms * 3 = 750ms which is plenty of time + // for the events to trigger before the next test, but + // not so much time that the second resize will be triggered + // before the call to same() is made + $.testHelper.sequence([ + function(){ + $(window).trigger( "resize" ).trigger( "resize" ); + }, + + // verify that only one throttled resize was called after 250ms + function(){ same( called, 1 ); }, + + function(){ + start(); + } + ], 250); + }); + + asyncTest( "throttledresize event promises that a held call will execute only once after throttled timeout", function(){ + var called = 0; + + expect( 2 ); + + $.testHelper.eventSequence( "throttledresize", [ + // ignore the first call + $.noop, + + function(){ + ok( true, "second throttled resize should run" ); + }, + + function(timedOut){ + ok( timedOut, "third throttled resize should not run"); + start(); + } + ]); + + $.mobile.pageContainer + .trigger( "resize" ) + .trigger( "resize" ) + .trigger( "resize" ); + }); + + asyncTest( "mousedown mouseup and click events should add a which when its not defined", function() { + var whichDefined = function( event ){ + same(event.which, 1); + }; + + $( document ).bind( "vclick", whichDefined); + $( document ).trigger( "click" ); + + $( document ).bind( "vmousedown", whichDefined); + $( document ).trigger( "mousedown" ); + + $( document ).bind( "vmouseup", function( event ){ + same(event.which, 1); + start(); + }); + + $( document ).trigger( "mouseup" ); + }); +})(jQuery); diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/event/index.html b/libs/js/jquery-mobile-1.1.0/tests/unit/event/index.html new file mode 100644 index 0000000..b1c46a4 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/event/index.html @@ -0,0 +1,42 @@ + + + + + + jQuery Mobile Event Test Suite + + + + + + + + + + + + + + + + + + + + +

      jQuery Mobile Event Test Suite

      +

      +

      +
        +
      + +
      + +
      + +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/fieldContain/fieldContain_events.js b/libs/js/jquery-mobile-1.1.0/tests/unit/fieldContain/fieldContain_events.js new file mode 100644 index 0000000..75066bf --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/fieldContain/fieldContain_events.js @@ -0,0 +1,29 @@ +/* + * mobile dialog unit tests + */ +(function($){ + module('jquery.mobile.fieldContain.js'); + + test( "Field container contains appropriate css styles", function(){ + ok($('#test-fieldcontain').hasClass('ui-field-contain ui-body ui-br'), 'A fieldcontain element must contain styles "ui-field-contain ui-body ui-br"'); + }); + + test( "Field container will create when inside a container that receives a 'create' event", function(){ + ok( !$("#enhancetest").appendTo(".ui-page-active").find(".ui-field-contain").length, "did not have enhancements applied" ); + ok( $("#enhancetest").trigger("create").find(".ui-field-contain").length, "enhancements applied" ); + }); + + test( "field containers inside ignore container should not be enhanced", function() { + var $ignored = $( "#ignored-fieldcontain" ), $enhanced = $( "#enhanced-fieldcontain" ); + + $.mobile.ignoreContentEnabled = true; + + $( "#ignore-container-tests" ).trigger( "create" ); + + same( $ignored.attr( "class" ), undefined, "ignored div does not have field contain class" ); + ok( $enhanced.hasClass( "ui-field-contain" ), "enhanced div has field contain class" ); + + $.mobile.ignoreContentEnabled = false; + + }); +})(jQuery); diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/fieldContain/index.html b/libs/js/jquery-mobile-1.1.0/tests/unit/fieldContain/index.html new file mode 100644 index 0000000..1be5157 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/fieldContain/index.html @@ -0,0 +1,66 @@ + + + + + jQuery Mobile FieldContain Integration Test + + + + + + + + + + + + + + + + +

      jQuery Mobile FieldContainer Test Suite

      +

      +

      +
        +
      + +
      + + +
      + + +
      + +
      + +
      +
      +
      +
      + +
      +
      +
      +
      +
      + +
      +
      +
      +
      +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/fixedToolbar/fixedToolbar.js b/libs/js/jquery-mobile-1.1.0/tests/unit/fixedToolbar/fixedToolbar.js new file mode 100644 index 0000000..d03ae0a --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/fixedToolbar/fixedToolbar.js @@ -0,0 +1,360 @@ +/* + * mobile Fixed Toolbar unit tests + */ +(function($){ + module('jquery.mobile.fixedToolbar.js'); + + $( "html" ).height( screen.height * 3 ); + + function scrollDown(){ + window.scrollTo(0,screen.height ); + } + + function scrollUp(){ + window.scrollTo(0,0); + } + + module("jquery.mobile.fixedToolbar.js", {setup: function() { + var startTimeout; + + // swallow the inital page change + stop(); + $(document).one("pagechange", function() { + clearTimeout(startTimeout); + }); + + startTimeout = setTimeout(start, 1000); + }}); + + + test( "Fixed Header Structural Classes are applied correctly", function(){ + + //footer + ok( !$('#classes-test-a').hasClass('ui-header-fixed'), 'An ordinary header should not have fixed classes'); + ok( $('#classes-test-b').hasClass('ui-header-fixed'), 'An header with data-position=fixed should have ui-header-fixed class'); + ok( $('#classes-test-c').hasClass('ui-header-fullscreen'), 'An header with data-position=fixed and data-fullscreen should have ui-header-fullscreen class'); + + //footer + ok( !$('#classes-test-d').hasClass('ui-footer-fixed'), 'An ordinary footer should not have fixed classes'); + ok( $('#classes-test-e').hasClass('ui-footer-fixed'), 'A footer with data-position=fixed should have ui-footer-fixed class"'); + ok( $('#classes-test-f').hasClass('ui-footer-fullscreen'), 'A footer with data-position=fixed and data-fullscreen should have ui-footer-fullscreen class'); + + //parent + ok( $('#classes-test-b').closest( ".ui-page" ).hasClass( "ui-page-header-fixed" ), "Parent page of a fixed header has class ui-page-header-fixed" ); + ok( $('#classes-test-e').closest( ".ui-page" ).hasClass( "ui-page-footer-fixed" ), "Parent page of a fixed footer has class ui-page-header-fixed" ); + ok( $('#classes-test-c').closest( ".ui-page" ).hasClass( "ui-page-header-fullscreen" ), "Parent page of a fullscreen header has class ui-page-header-fullscreen" ); + ok( $('#classes-test-f').closest( ".ui-page" ).hasClass( "ui-page-footer-fullscreen" ), "Parent page of a fullscreen footer has class ui-page-header-fullscreen" ); + + + }); + + asyncTest( "Fixed header and footer transition classes are applied correctly", function(){ + + expect( 6 ); + + $.testHelper.sequence([ + function(){ + $( '#classes-test-b, #classes-test-g, #classes-test-e,#classes-test-h,#classes-test-i,#classes-test-j, #classes-test-k' ).fixedtoolbar( "hide" ); + scrollDown(); + }, + + function(){ + //show first + $( '#classes-test-b, #classes-test-g, #classes-test-e,#classes-test-h,#classes-test-i,#classes-test-j, #classes-test-k' ).fixedtoolbar( "show" ); + }, + + function() { + + ok( $( '#classes-test-g' ).hasClass('slidedown'), 'The slidedown class should be applied by default'); + ok( $( '#classes-test-k' ).hasClass('in'), 'The "in" class should be applied for fade transitions'); + ok( !$( '#classes-test-h' ).hasClass('slidedown'), 'The slidedown class should not be applied when the header has a data-transition of "none"'); + + ok( !$( '#classes-test-h' ).hasClass('in'), 'The "in" class should not be applied when the header has a data-transition of "none"'); + ok( $( '#classes-test-i' ).hasClass('slidedown'), 'The "slidedown" class should be applied when the header has a data-transition of "slide"'); + ok( $( '#classes-test-j' ).hasClass('slideup'), 'The "slideup" class should be applied when the footer has a data-transition of "slide"'); + + }, + + function(){ + scrollUp(); + start(); + } + ], 1000); + + }); + + test( "User zooming is disabled when the header is visible and disablePageZoom is true", function(){ + $.mobile.zoom.enable(); + var defaultZoom = $.mobile.fixedtoolbar.prototype.options.disablePageZoom; + $( ".ui-page-active .ui-header-fixed" ).fixedtoolbar("option", "disablePageZoom", true ); + + $( ".ui-page-active" ).trigger( "pagebeforeshow" ); + ok( !$.mobile.zoom.enabled, "Viewport scaling is disabled before page show." ); + $( ".ui-page-active .ui-header-fixed" ).fixedtoolbar("option", "disablePageZoom", defaultZoom ); + $.mobile.zoom.enable(); + }); + + test( "Meta viewport content is restored to previous state, and zooming renabled, after pagebeforehide", function(){ + $.mobile.zoom.enable( true ); + var defaultZoom = $.mobile.fixedtoolbar.prototype.options.disablePageZoom; + $( ".ui-page-active .ui-header-fixed" ).fixedtoolbar("option", "disablePageZoom", true ); + + $( ".ui-page-active" ).trigger( "pagebeforeshow" ); + ok( !$.mobile.zoom.enabled, "Viewport scaling is disabled before page show." ); + $( ".ui-page-active" ).trigger( "pagebeforehide" ); + ok( $.mobile.zoom.enabled, "Viewport scaling is enabled." ); + $( ".ui-page-active .ui-header-fixed" ).fixedtoolbar("option", "disablePageZoom", defaultZoom ); + $.mobile.zoom.enable( true ); + }); + + test( "User zooming is not disabled when the header is visible and disablePageZoom is false", function(){ + $.mobile.zoom.enable( true ); + var defaultZoom = $.mobile.fixedtoolbar.prototype.options.disablePageZoom; + $( ".ui-page :jqmData(position='fixed')" ).fixedtoolbar( "option", "disablePageZoom", false ); + + $( ".ui-page-active" ).trigger( "pagebeforeshow" ); + + ok( $.mobile.zoom.enabled, "Viewport scaling is not disabled before page show." ); + + $( ".ui-page :jqmData(position='fixed')" ).fixedtoolbar( "option", "disablePageZoom", defaultZoom ); + + $.mobile.zoom.enable( true ); + }); + + + asyncTest( "The hide method is working properly", function() { + + expect( 2 ); + + $.testHelper.sequence([ + function(){ + $( '#classes-test-g' ).fixedtoolbar( "show" ); + scrollDown(); + }, + + function() { + $( '#classes-test-g' ).fixedtoolbar( "hide" ); + + ok( $( '#classes-test-g' ).hasClass('out'), 'The out class should be applied when hide is called'); + }, + + function() { + ok( $( '#classes-test-g' ).hasClass('ui-fixed-hidden'), 'The toolbar has the ui-fixed-hidden class applied after hide'); + $( '#classes-test-g' ).fixedtoolbar( "show" ); + + }, + + function(){ + scrollUp(); + start(); + } + + ], 500); + }); + + + + asyncTest( "The show method is working properly", function() { + + expect( 2 ); + + $.testHelper.sequence([ + function(){ + scrollDown(); + }, + + function() { + $( '#classes-test-g' ).fixedtoolbar( "hide" ); + }, + + function() { + $( '#classes-test-g' ).fixedtoolbar( "show" ); + + ok( $( '#classes-test-g' ).hasClass('in'), 'The in class should be applied when show is called'); + }, + + function() { + ok( !$( '#classes-test-g' ).hasClass('ui-fixed-hidden'), 'The toolbar does not have the ui-fixed-hidden class applied after show'); + + }, + + function(){ + scrollUp(); + start(); + } + ], 500); + }); + + + asyncTest( "The toggle method is working properly", function() { + + expect( 3 ); + + $.testHelper.sequence([ + function(){ + scrollDown(); + }, + + function(){ + $( '#classes-test-g' ).fixedtoolbar( "show" ); + }, + + function() { + ok( !$( '#classes-test-g' ).hasClass('ui-fixed-hidden'), 'The toolbar does not have the ui-fixed-hidden class'); + $( '#classes-test-g' ).fixedtoolbar( "toggle" ); + }, + + function() { + ok( $( '#classes-test-g' ).hasClass('ui-fixed-hidden'), 'The toolbar does have the ui-fixed-hidden class'); + $( '#classes-test-g' ).fixedtoolbar( "toggle" ); + }, + + function() { + ok( !$( '#classes-test-g' ).hasClass('ui-fixed-hidden'), 'The toolbar does not have the ui-fixed-hidden class'); + + }, + + function(){ + scrollUp(); + start(); + } + + ], 500); + }); + + + asyncTest( "The persistent headers and footers are working properly", function() { + + expect( 3 ); + + $( "#persist-test-b, #persist-test-a" ).page(); + + var nextpageheader = $( "#persist-test-b .ui-header-fixed" ), + nextpagefooter = $( "#persist-test-b .ui-footer-fixed" ); + + + $.testHelper.pageSequence([ + function(){ + ok( nextpageheader.length && nextpagefooter.length, "next page has fixed header and fixed footer" ); + $.mobile.changePage( "#persist-test-a" ); + }, + + function(){ + $( "#persist-test-b" ) + .one( "pagebeforeshow", function(){ + ok( nextpageheader.parent( ".ui-mobile-viewport" ).length, "fixed header and footer are now a child of page container" ); + }); + + $.mobile.changePage( "#persist-test-b" ); + }, + + function() { + ok( nextpageheader.parent( ".ui-page" ).length, "fixed header and footer are now a child of page again" ); + $.mobile.changePage( "#default" ); + }, + + start + ]); + }); + + asyncTest( "The persistent headers should work without a footer", function() { + + expect( 3 ); + + $( "#persist-test-c, #persist-test-d" ).page(); + + var nextpageheader = $( "#persist-test-d .ui-header-fixed" ); + + $.testHelper.pageSequence([ + function(){ + ok( nextpageheader.length, "next page has fixed header and fixed footer" ); + $.mobile.changePage( "#persist-test-c" ); + }, + + function(){ + $( "#persist-test-d" ) + .one( "pagebeforeshow", function(){ + same( nextpageheader.parent()[0], $.mobile.pageContainer[0], "fixed header is now a child of page container" ); + }); + + $.mobile.changePage( "#persist-test-d" ); + }, + + function() { + same( nextpageheader.parent()[0], $.mobile.activePage[0], "fixed header is now a child of page again" ); + $.mobile.changePage( "#default" ); + }, + + start + ]); + }); + + asyncTest( "The persistent footers should work without a header", function() { + + expect( 3 ); + + $( "#persist-test-e, #persist-test-f" ).page(); + + var nextpagefooter = $( "#persist-test-f .ui-footer-fixed" ); + + $.testHelper.pageSequence([ + function(){ + ok( nextpagefooter.length, "next page has fixed footer and fixed footer" ); + $.mobile.changePage( "#persist-test-e" ); + }, + + function(){ + $( "#persist-test-f" ) + .one( "pagebeforeshow", function(){ + same( nextpagefooter.parent()[0], $.mobile.pageContainer[0], "fixed footer is now a child of page container" ); + }); + + $.mobile.changePage( "#persist-test-f" ); + }, + + function() { + same( nextpagefooter.parent()[0], $.mobile.activePage[0], "fixed footer is now a child of page again" ); + $.mobile.changePage( "#default" ); + }, + + start + ]); + }); + + + var asyncTestFooterAndHeader = function( pageSelector, areHidden ) { + $.testHelper.pageSequence([ + function() { + $.mobile.changePage( pageSelector ); + }, + + function() { + var $footer = $.mobile.activePage.find( ".ui-footer" ), + $header = $.mobile.activePage.find( ".ui-header" ), + hidden = areHidden ? "hidden" : "visible"; + + equal( $footer.length, 1, "there should be one footer" ); + equal( $header.length, 1, "there should be one header" ); + + equal( $footer.hasClass( "ui-fixed-hidden" ), areHidden, "the footer should be " + hiddenStr ); + equal( $header.hasClass( "ui-fixed-hidden" ), areHidden, "the header should be " + hiddenStr ); + + $.mobile.changePage( "#default" ); + }, + + start + ]); + }; + + asyncTest( "data-visible-on-page-show hides toolbars when false", function() { + asyncTestFooterAndHeader( "#page-show-visible-false", false ); + }); + + asyncTest( "data-visible-on-page-show shows toolbars when explicitly true", function() { + asyncTestFooterAndHeader( "#page-show-visible-true", true ); + }); + + asyncTest( "data-visible-on-page-show shows toolbars when undefined", function() { + asyncTestFooterAndHeader( "#page-show-visible-undefined", true ); + }); +})(jQuery); diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/fixedToolbar/index.html b/libs/js/jquery-mobile-1.1.0/tests/unit/fixedToolbar/index.html new file mode 100644 index 0000000..d65a471 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/fixedToolbar/index.html @@ -0,0 +1,98 @@ + + + + + jQuery Mobile Fixed Toolbar Integration Test + + + + + + + + + + + + + + + + +

      jQuery Mobile FieldContainer Test Suite

      +

      +

      +
        +
      + +
      + +
      +
      +
      +
      +
      +
      + + +
      +
      +
      +
      +
      +
      + + + +
      +
      +
      +
      + +
      +
      +
      +
      + +
      +
      +
      + +
      +
      +
      + +
      +
      +
      + +
      +
      +
      + +
      +
      +

      foo

      +
      +
      +

      foo

      +
      +
      + +
      +
      +
      +
      + +
      +
      +
      +
      + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/index.html b/libs/js/jquery-mobile-1.1.0/tests/unit/index.html new file mode 100644 index 0000000..c53dd96 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/index.html @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/init/dialog-load-test.html b/libs/js/jquery-mobile-1.1.0/tests/unit/init/dialog-load-test.html new file mode 100644 index 0000000..716bdd6 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/init/dialog-load-test.html @@ -0,0 +1,45 @@ + + + + + jQuery Mobile Init Test Suite + + + + + + + + + + + + + + + +

      jQuery Mobile Init Test Suite

      +

      +

      +
        +
      + +
      + + +
      + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/init/index.html b/libs/js/jquery-mobile-1.1.0/tests/unit/init/index.html new file mode 100644 index 0000000..15854a6 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/init/index.html @@ -0,0 +1,36 @@ + + + + + jQuery Mobile Init Test Suite + + + + + + + + + + + + + + + + + +

      jQuery Mobile Init Test Suite

      +

      +

      +
        +
      + +
      +
      + +
      +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/init/init_core.js b/libs/js/jquery-mobile-1.1.0/tests/unit/init/init_core.js new file mode 100644 index 0000000..5c452bc --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/init/init_core.js @@ -0,0 +1,271 @@ +/* + * mobile init tests + */ +(function($){ + var mobilePage = undefined, + libName = 'jquery.mobile.init.js', + coreLib = 'jquery.mobile.core.js', + extendFn = $.extend, + originalLoadingMessage = $.mobile.loadingMessage, + setGradeA = function(value) { $.mobile.gradeA = function(){ return value; }; }, + reloadCoreNSandInit = function(){ + $.testHelper.reloadLib(coreLib); + $.testHelper.reloadLib("jquery.setNamespace.js"); + $.testHelper.reloadLib(libName); + }; + + + module(libName, { + setup: function(){ + // NOTE reset for gradeA tests + $('html').removeClass('ui-mobile'); + + // TODO add post reload callback + $('.ui-loader').remove(); + }, + teardown: function(){ + $.extend = extendFn; + + // NOTE reset for showPageLoadingMsg/hidePageLoadingMsg tests + $('.ui-loader').remove(); + + // clear the classes added by reloading the init + $("html").attr('class', ''); + + $.mobile.loadingMessage = originalLoadingMessage; + } + }); + + // NOTE important to use $.fn.one here to make sure library reloads don't fire + // the event before the test check below + $(document).one("mobileinit", function(){ + mobilePage = $.mobile.page; + }); + + // NOTE for the following two tests see index html for the binding + test( "mobile.page is available when mobile init is fired", function(){ + ok( mobilePage !== undefined, "$.mobile.page is defined" ); + }); + + $.testHelper.excludeFileProtocol(function(){ + asyncTest( "loading the init library triggers mobilinit on the document", function(){ + var initFired = false; + expect( 1 ); + + $(window.document).one('mobileinit', function(event){ + initFired = true; + }); + + $.testHelper.reloadLib(libName); + + setTimeout(function(){ + ok(initFired, "init fired"); + start(); + }, 1000); + }); + + test( "enhancments are skipped when the browser is not grade A", function(){ + setGradeA(false); + $.testHelper.reloadLib(libName); + + //NOTE easiest way to check for enhancements, not the most obvious + ok(!$("html").hasClass("ui-mobile"), "html elem doesn't have class ui-mobile"); + }); + + test( "enhancments are added when the browser is grade A", function(){ + setGradeA(true); + $.testHelper.reloadLib(libName); + + ok($("html").hasClass("ui-mobile"), "html elem has class mobile"); + }); + + asyncTest( "useFastClick is configurable via mobileinit", function(){ + $(document).one( "mobileinit", function(){ + $.mobile.useFastClick = false; + start(); + }); + + $.testHelper.reloadLib(libName); + + same( $.mobile.useFastClick, false , "fast click is set to false after init" ); + $.mobile.useFastClick = true; + }); + + + + var findFirstPage = function() { + return $(":jqmData(role='page')").first(); + }; + + test( "active page and start page should be set to the fist page in the selected set", function(){ + expect( 2 ); + $.testHelper.reloadLib(libName); + var firstPage = findFirstPage(); + + same($.mobile.firstPage[0], firstPage[0]); + same($.mobile.activePage[0], firstPage[0]); + }); + + test( "mobile viewport class is defined on the first page's parent", function(){ + expect( 1 ); + $.testHelper.reloadLib(libName); + var firstPage = findFirstPage(); + + ok(firstPage.parent().hasClass("ui-mobile-viewport"), "first page has viewport"); + }); + + test( "mobile page container is the first page's parent", function(){ + expect( 1 ); + $.testHelper.reloadLib(libName); + var firstPage = findFirstPage(); + + same($.mobile.pageContainer[0], firstPage.parent()[0]); + }); + + asyncTest( "hashchange triggered on document ready with single argument: true", function(){ + $.testHelper.sequence([ + function(){ + location.hash = "#foo"; + }, + + // delay the bind until the first hashchange + function(){ + $(window).one("hashchange", function(ev, arg){ + same(arg, true); + start(); + }); + }, + + function(){ + $.testHelper.reloadLib(libName); + } + ], 1000); + }); + + test( "pages without a data-url attribute have it set to their id", function(){ + same($("#foo").jqmData('url'), "foo"); + }); + + test( "pages with a data-url attribute are left with the original value", function(){ + same($("#bar").jqmData('url'), "bak"); + }); + + asyncTest( "showPageLoadingMsg doesn't add the dialog to the page when loading message is false", function(){ + expect( 1 ); + $.mobile.loadingMessage = false; + $.mobile.showPageLoadingMsg(); + + setTimeout(function(){ + ok(!$(".ui-loader").length, "no ui-loader element"); + start(); + }, 500); + }); + + asyncTest( "hidePageLoadingMsg doesn't add the dialog to the page when loading message is false", function(){ + expect( 1 ); + $.mobile.loadingMessage = true; + $.mobile.hidePageLoadingMsg(); + + setTimeout(function(){ + same($(".ui-loading").length, 0, "page should not be in the loading state"); + start(); + }, 500); + }); + + asyncTest( "showPageLoadingMsg adds the dialog to the page when loadingMessage is true", function(){ + expect( 1 ); + $.mobile.loadingMessage = true; + $.mobile.showPageLoadingMsg(); + + setTimeout(function(){ + same($(".ui-loading").length, 1, "page should be in the loading state"); + start(); + }, 500); + }); + + asyncTest( "page loading should contain default loading message", function(){ + expect( 1 ); + reloadCoreNSandInit(); + $.mobile.showPageLoadingMsg(); + + setTimeout(function(){ + same($(".ui-loader h1").text(), "loading"); + start(); + }, 500); + }); + + asyncTest( "page loading should contain custom loading message", function(){ + $.mobile.loadingMessage = "foo"; + $.testHelper.reloadLib(libName); + $.mobile.showPageLoadingMsg(); + + setTimeout(function(){ + same($(".ui-loader h1").text(), "foo"); + start(); + }, 500); + }); + + asyncTest( "page loading should contain custom loading message when set during runtime", function(){ + $.mobile.loadingMessage = "bar"; + $.mobile.showPageLoadingMsg(); + + setTimeout(function(){ + same($(".ui-loader h1").text(), "bar"); + start(); + }, 500); + }); + + + + // NOTE: the next two tests work on timeouts that assume a page will be created within 2 seconds + // it'd be great to get these using a more reliable callback or event + + asyncTest( "page does auto-initialize at domready when autoinitialize option is true (default) ", function(){ + + $( "
      ", { "data-nstest-role": "page", "id": "autoinit-on" } ).prependTo( "body" ) + + $(document).one("mobileinit", function(){ + $.mobile.autoInitializePage = true; + }); + + location.hash = ""; + + reloadCoreNSandInit(); + + setTimeout(function(){ + same( $( "#autoinit-on.ui-page" ).length, 1 ); + + start(); + }, 2000); + }); + + + asyncTest( "page does not initialize at domready when autoinitialize option is false ", function(){ + $(document).one("mobileinit", function(){ + $.mobile.autoInitializePage = false; + }); + + $( "
      ", { "data-nstest-role": "page", "id": "autoinit-off" } ).prependTo( "body" ) + + location.hash = ""; + + + reloadCoreNSandInit(); + + setTimeout(function(){ + same( $( "#autoinit-off.ui-page" ).length, 0 ); + + $(document).bind("mobileinit", function(){ + $.mobile.autoInitializePage = true; + }); + + reloadCoreNSandInit(); + + start(); + }, 2000); + }); + + + + }); +})(jQuery); diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/init/init_core_nopage.js b/libs/js/jquery-mobile-1.1.0/tests/unit/init/init_core_nopage.js new file mode 100644 index 0000000..193af25 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/init/init_core_nopage.js @@ -0,0 +1,12 @@ +/* + * mobile init tests + */ +(function($){ + + + test( "page element is generated when not present in initial markup", function(){ + ok( $( ".ui-page" ).length, 1 ); + }); + + +})(jQuery); diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/init/init_dialog.js b/libs/js/jquery-mobile-1.1.0/tests/unit/init/init_dialog.js new file mode 100644 index 0000000..0479388 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/init/init_dialog.js @@ -0,0 +1,16 @@ +/* + * mobile init dialog tests + */ +(function($){ + module( "jquery.mobile.init dialog load tests" ); + + // issue #3275 + test( "A document containing no pages and a dialog role div will enhance the div as a page", function() { + ok( $("#foo").hasClass( "ui-page" ), "the div has the page class" ); + + // NOTE this will fail when/if we decide to render it as a dialog + ok( !$("#foo").hasClass( "ui-dialog" ), "the div does NOT have the dialog page class" ); + }); + + //NOTE the opposite case is tested everyewhere else in the suite :D +})( jQuery ); \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/init/nopage.html b/libs/js/jquery-mobile-1.1.0/tests/unit/init/nopage.html new file mode 100644 index 0000000..4decaae --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/init/nopage.html @@ -0,0 +1,31 @@ + + + + + jQuery Mobile Init Test Suite + + + + + + + + + + + + + + +

      jQuery Mobile Init Test Suite

      +

      +

      +
        +
      + + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/jquery.setNameSpace.js b/libs/js/jquery-mobile-1.1.0/tests/unit/jquery.setNameSpace.js new file mode 100644 index 0000000..c4c9f22 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/jquery.setNameSpace.js @@ -0,0 +1,4 @@ +//set namespace for unit test markp +$( document ).bind( "mobileinit", function(){ + $.mobile.ns = "nstest-"; +}); \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/kitchensink/index.html b/libs/js/jquery-mobile-1.1.0/tests/unit/kitchensink/index.html new file mode 100644 index 0000000..f390407 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/kitchensink/index.html @@ -0,0 +1,421 @@ + + + + + jQuery Mobile Kitchen Sink Test Suite + + + + + + + + + + + + + + + + + + +

      jQuery Mobile Kitchen Sink Test Suite

      +

      +

      +
        +
      + +
      +
      +

      Fixed toolbars

      + Home + Search +
      + +
      + +

      Form Elements in Fieldcontains

      +
      + + +
      + +
      + + +
      + +
      + + +
      + +
      + + +
      + +
      + + +
      + +
      +
      + Choose as many snacks as you'd like: + + + + + + + + + + + +
      +
      + +
      +
      + Font styling: + + + + + + + + +
      +
      + +
      +
      + Choose a pet: + + + + + + + + + + + +
      +
      + +
      +
      + Layout view: + + + + + + +
      +
      + +
      + + +
      + +
      + + +
      + +
      + + +
      + +
      + + +

      Mini Form Elements

      + + + + + + + + + + + + + +
      + + +
      + +
      +
      + + + Choose as many snacks as you'd like: + + + + + + + + + + + +
      +
      + +
      +
      + + Font styling: + + + + + + + + +
      +
      + +
      + + + + + +
      + +
      +
      + + + Choose a pet: + + + + + + + + + + + +
      +
      + +
      +
      + Layout view: + + + + + + +
      +
      + +
      + + +
      + +
      + + +
      + +
      + + +
      + + + + +

      Simple list

      + + + +

      Mini list

      + + +

      Individual mini item

      + + + + + +

      Count bubbles

      + + +

      Numbered list

      +
        +
      1. The Godfather
      2. +
      3. Inception
      4. +
      5. The Good, the Bad and the Ugly
      6. +
      7. Pulp Fiction
      8. +
      9. Schindler's List
      10. +
      + +

      Divided, formatted content

      + + + + +

      Icon list

      + + +

      Thumbnail, split button list

      + + + +

      Divided, filterable list

      + + +
      + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/kitchensink/kitchensink_core.js b/libs/js/jquery-mobile-1.1.0/tests/unit/kitchensink/kitchensink_core.js new file mode 100644 index 0000000..8f31310 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/kitchensink/kitchensink_core.js @@ -0,0 +1,13 @@ +/* + * Kitchen Sink Tests + */ +(function($){ + module("kitchen sink class test"); + + test( "Nothing on the page has a class that contains `undefined`.", function(){ + var undefClass = $(".ui-page").find("[class*='undefined']"); + + ok( undefClass.length == 0 ); + }); + +})(jQuery); diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/listview/cache-tests/cached-nested.html b/libs/js/jquery-mobile-1.1.0/tests/unit/listview/cache-tests/cached-nested.html new file mode 100644 index 0000000..c6fbcdf --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/listview/cache-tests/cached-nested.html @@ -0,0 +1,55 @@ + + + + + + +
      +
      +

      Basic multiple lists view

      +
      +
      +
        +
      • Item 1
      • +
      • Item 2
      • +
      • Item 3 +
          +
        • Item A-3-0
        • +
        • Item A-3-1
        • +
        • Item A-3-2
        • +
        +
      • +
      +
        +
      • Item 1
      • +
      • Item 2
      • +
      • Item 3 +
          +
        • Item B-3-0 +
            +
          • Item B-3-0-0
          • +
          • Item B-3-0-1 +
              +
            • Item B-3-0-1-0
            • +
            • Item B-3-0-1-1
            • +
            • Item B-3-0-1-2
            • +
            +
          • +
          • Item B-3-0-2
          • +
          +
        • +
        • Item B-3-1 +
            +
          • Item B-3-1-0
          • +
          • Item B-3-1-1
          • +
          • Item B-3-1-2
          • +
          +
        • +
        • Item B-3-2
        • +
        +
      • +
      +
      +
      + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/listview/cache-tests/clear.html b/libs/js/jquery-mobile-1.1.0/tests/unit/listview/cache-tests/clear.html new file mode 100644 index 0000000..c86bd96 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/listview/cache-tests/clear.html @@ -0,0 +1,13 @@ + + + + + + +
      +
      + cleared +
      +
      + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/listview/cache-tests/uncached-nested.html b/libs/js/jquery-mobile-1.1.0/tests/unit/listview/cache-tests/uncached-nested.html new file mode 100644 index 0000000..4a3e8d6 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/listview/cache-tests/uncached-nested.html @@ -0,0 +1,55 @@ + + + + + + +
      +
      +

      Basic multiple lists view

      +
      +
      +
        +
      • Item 1
      • +
      • Item 2
      • +
      • Item 3 +
          +
        • Item A-3-0
        • +
        • Item A-3-1
        • +
        • Item A-3-2
        • +
        +
      • +
      +
        +
      • Item 1
      • +
      • Item 2
      • +
      • Item 3 +
          +
        • Item B-3-0 +
            +
          • Item B-3-0-0
          • +
          • Item B-3-0-1 +
              +
            • Item B-3-0-1-0
            • +
            • Item B-3-0-1-1
            • +
            • Item B-3-0-1-2
            • +
            +
          • +
          • Item B-3-0-2
          • +
          +
        • +
        • Item B-3-1 +
            +
          • Item B-3-1-0
          • +
          • Item B-3-1-1
          • +
          • Item B-3-1-2
          • +
          +
        • +
        • Item B-3-2
        • +
        +
      • +
      +
      +
      + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/listview/index.html b/libs/js/jquery-mobile-1.1.0/tests/unit/listview/index.html new file mode 100644 index 0000000..0317c4a --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/listview/index.html @@ -0,0 +1,363 @@ + + + + + + jQuery Mobile Listview Integration Test + + + + + + + + + + + + + + + +

      jQuery Mobile Listview Integration Test

      +

      +

      +
        +
      + + +
      +
      +

      Basic List View

      +
      + + +
      + + + + +
      +
      +

      Basic List View

      +
      +
      +
        +
      • Groups of animals +
          +
        • pod of whales
        • +
        • quiver of cobras
        • +
        • troop of baboons
        • +
        +
      • +
      • + + More animals + + +
          +
        • Shoal of Bass
        • +
        • Rhumba of rattlesnakes
        • +
        +
      • +
      +
      +
      + + +
      +
      +

      Basic multiple lists view

      +
      +
      +
        +
      • Item 1
      • +
      • Item 2
      • +
      • Item 3 +
          +
        • Item A-3-0
        • +
        • Item A-3-1
        • +
        • Item A-3-2
        • +
        +
      • +
      +
        +
      • Item 1
      • +
      • Item 2
      • +
      • Item 3 +
          +
        • Item B-3-0 +
            +
          • Item B-3-0-0
          • +
          • Item B-3-0-1 +
              +
            • Item B-3-0-1-0
            • +
            • Item B-3-0-1-1
            • +
            • Item B-3-0-1-2
            • +
            +
          • +
          • Item B-3-0-2
          • +
          +
        • +
        • Item B-3-1 +
            +
          • Item B-3-1-0
          • +
          • Item B-3-1-1
          • +
          • Item B-3-1-2
          • +
          +
        • +
        • Item B-3-2
        • +
        +
      • +
      +
      +
      + + +
      +
      +

      Basic List View

      +
      +
      +
        +
      1. Number 1
      2. +
      3. Number 2
      4. +
      5. Number 3
      6. +
      +
      +
      + +
      +
      +

      Numbered List

      +
      +
      + + +
      +
      +

      Basic List View

      +
      +
      +
        +
      • Read
      • +
      • Only
      • +
      • List
      • +
      • View
      • +
      +
      +
      + + +
      +
      +

      Split List View

      +
      + +
      + +
      +
      +

      Split List view 1

      +
      +
      + +
      +
      +

      Split List view 2

      +
      +
      + + +
      +
      +

      List Divider Test

      +
      +
      +
        +
      • a is for aquaman
      • +
      • b is for batman
      • +
      • This is a list divider
      • +
      • c is for catwoman
      • +
      • This is another list divider
      • +
      • d is for darkwing
      • +
      +
      +
      + + +
      +
      +

      Split List View

      +
      +
      +
        +
      • a is for aquaman
      • +
      • b is for batman
      • +
      • c is for catwoman
      • +
      • d is for darkwing
      • +
      +
      +
      + + +
      +
      +

      Split List View

      +
      +
      +
        +
      • a
      • +
      • a is for aquaman
      • +
      • b
      • +
      • b is for batman
      • +
      • c
      • +
      • c is for catwoman
      • +
      • d
      • +
      • d is for darkwing
      • +
      +
      +
      + + +
      +
      +

      Inset Filter List View

      +
      +
      +
        +
      • a is for aquaman
      • +
      • b is for batman
      • +
      • c is for catwoman
      • +
      • d is for darkwing
      • +
      +
      +
      + + +
      +
        +
        + + +
        +
        +

        Basic List View

        +
        +
        +
          +
        • Item 1
        • +
        • Item 2
        • +
        • Item 3
        • +
        • Item 4
        • +
        +
        +
        + + +
        +
        +

        Basic List View

        +
        +
        +
          +
        +
        +
        + +
        + +
        + +
        +
          +
        • foo
        • +
        +
        + +
        +
        +

        Right padding on item 1 is OK (75px).

        +

        Right padding on items 2 & 3 should probably be around 30 or 35 (not 25).

        +

        Right padding on item 4 should be 15px to match the left side.

        +
          +
        1. Link LI with counter --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------123
        2. +
        3. Link LI without counter -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
        4. +
        5. Page1 Link LI without counter -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
        6. +
        7. Static LI with counter ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------123
        8. +
        9. Static LI without counter ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
        10. +
        +
        +
        + + +
        +
          +
        • foo
        • +
        • bar
        • +
        +
        + +
        +
          +
        • foo
        • +
        • bar
        • +
        +
        + + + + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/listview/listview_core.js b/libs/js/jquery-mobile-1.1.0/tests/unit/listview/listview_core.js new file mode 100755 index 0000000..7652c8b --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/listview/listview_core.js @@ -0,0 +1,857 @@ +/* + * mobile listview unit tests + */ + +// TODO split out into seperate test files +(function($){ + var home = $.mobile.path.parseUrl( location.href ).pathname + location.search, + insetVal = $.mobile.listview.prototype.options.inset; + + $.mobile.defaultTransition = "none"; + + module( "Basic Linked list", { + setup: function(){ + if( location.hash != "#basic-linked-test" ){ + stop(); + + $(document).one("pagechange", function() { + start(); + }); + + $.mobile.changePage( home ); + } + }, + + teardown: function() { + $.mobile.listview.prototype.options.inset = insetVal; + } + }); + + asyncTest( "The page should enhanced correctly", function(){ + setTimeout(function() { + ok($('#basic-linked-test .ui-li').length, ".ui-li classes added to li elements"); + start(); + }, 800); + }); + + asyncTest( "Slides to the listview page when the li a is clicked", function() { + $.testHelper.pageSequence([ + function(){ + $.mobile.changePage("#basic-linked-test"); + }, + + function(){ + $('#basic-linked-test li a').first().click(); + }, + + function(){ + ok($('#basic-link-results').hasClass('ui-page-active')); + start(); + } + ]); + }); + + asyncTest( "Slides back to main page when back button is clicked", function() { + $.testHelper.pageSequence([ + function(){ + $.mobile.changePage("#basic-link-results"); + }, + + function(){ + window.history.back(); + }, + + function(){ + ok($('#basic-linked-test').hasClass('ui-page-active')); + start(); + } + ]); + }); + + asyncTest( "Presence of ui-li-has- classes", function(){ + $.testHelper.pageSequence( [ + function() { + $.mobile.changePage( "#ui-li-has-test" ); + }, + + function() { + var page = $( ".ui-page-active" ), + items = page.find( "li" ); + + ok( items.eq( 0 ).hasClass( "ui-li-has-count"), "First LI should have ui-li-has-count class" ); + ok( items.eq( 0 ).hasClass( "ui-li-has-arrow"), "First LI should have ui-li-has-arrow class" ); + ok( !items.eq( 1 ).hasClass( "ui-li-has-count"), "Second LI should NOT have ui-li-has-count class" ); + ok( items.eq( 1 ).hasClass( "ui-li-has-arrow"), "Second LI should have ui-li-has-arrow class" ); + ok( !items.eq( 2 ).hasClass( "ui-li-has-count"), "Third LI should NOT have ui-li-has-count class" ); + ok( !items.eq( 2 ).hasClass( "ui-li-has-arrow"), "Third LI should NOT have ui-li-has-arrow class" ); + ok( items.eq( 3 ).hasClass( "ui-li-has-count"), "Fourth LI should have ui-li-has-count class" ); + ok( !items.eq( 3 ).hasClass( "ui-li-has-arrow"), "Fourth LI should NOT have ui-li-has-arrow class" ); + ok( !items.eq( 4 ).hasClass( "ui-li-has-count"), "Fifth LI should NOT have ui-li-has-count class" ); + ok( !items.eq( 4 ).hasClass( "ui-li-has-arrow"), "Fifth LI should NOT have ui-li-has-arrow class" ); + start(); + } + ]); + }); + + module('Nested List Test'); + + asyncTest( "Changes page to nested list test and enhances", function() { + $.testHelper.pageSequence([ + function(){ + $.mobile.changePage("#nested-list-test"); + }, + + function(){ + ok($('#nested-list-test').hasClass('ui-page-active'), "makes nested list test page active"); + ok($(':jqmData(url="nested-list-test&ui-page=0-0")').length == 1, "Adds first UL to the page"); + ok($(':jqmData(url="nested-list-test&ui-page=0-1")').length == 1, "Adds second nested UL to the page"); + start(); + } + ]); + }); + + asyncTest( "change to nested page when the li a is clicked", function() { + + $.testHelper.pageSequence([ + function(){ + $.mobile.changePage("#nested-list-test"); + }, + + function(){ + $('.ui-page-active li:eq(1) a:eq(0)').click(); + }, + + function(){ + var $new_page = $(':jqmData(url="nested-list-test&ui-page=0-0")'); + + ok($new_page.hasClass('ui-page-active'), 'Makes the nested page the active page.'); + ok($('.ui-listview', $new_page).find(":contains('Rhumba of rattlesnakes')").length == 1, "The current page should have the proper text in the list."); + ok($('.ui-listview', $new_page).find(":contains('Shoal of Bass')").length == 1, "The current page should have the proper text in the list."); + start(); + } + ]); + }); + + asyncTest( "should go back to top level when the back button is clicked", function() { + $.testHelper.pageSequence([ + function(){ + $.mobile.changePage("#nested-list-test&ui-page=0-0"); + }, + + function(){ + window.history.back(); + }, + + function(){ + ok($('#nested-list-test').hasClass('ui-page-active'), 'Transitions back to the parent nested page'); + start(); + } + ]); + }); + + test( "nested list title should use first text node, regardless of line breaks", function(){ + // NOTE this is a super fragile reference to the nested page, any change to the list will break it + ok($(":jqmData(url='nested-list-test&ui-page=0-0') .ui-title").text() === "More animals", 'Text should be "More animals"'); + }); + + asyncTest( "Multiple nested lists on a page with same labels", function() { + $.testHelper.pageSequence([ + function(){ + // https://github.com/jquery/jquery-mobile/issues/1617 + $.mobile.changePage("#nested-lists-test"); + }, + + function(){ + // Click on the link of the third li element + $('.ui-page-active li:eq(2) a:eq(0)').click(); + }, + + function(){ + equal($('.ui-page-active .ui-content .ui-listview li').text(), "Item A-3-0Item A-3-1Item A-3-2", 'Text should be "Item A-3-0Item A-3-1Item A-3-2"'); + start(); + } + ]); + }); + + module('Ordered Lists'); + + asyncTest( "changes to the numbered list page and enhances it", function() { + $.testHelper.pageSequence([ + function(){ + $.mobile.changePage("#numbered-list-test"); + }, + + function(){ + var $new_page = $('#numbered-list-test'); + ok($new_page.hasClass('ui-page-active'), "Makes the new page active when the hash is changed."); + ok($('.ui-link-inherit', $new_page).first().text() == "Number 1", "The text of the first LI should be Number 1"); + start(); + } + ]); + }); + + asyncTest( "changes to number 1 page when the li a is clicked", function() { + $.testHelper.pageSequence([ + function(){ + $('#numbered-list-test li a').first().click(); + }, + + function(){ + ok($('#numbered-list-results').hasClass('ui-page-active'), "The new numbered page was transitioned correctly."); + start(); + } + ]); + }); + + asyncTest( "takes us back to the numbered list when the back button is clicked", function() { + $.testHelper.pageSequence([ + function(){ + $.mobile.changePage('#numbered-list-test'); + }, + + function(){ + $.mobile.changePage('#numbered-list-results'); + }, + + function(){ + window.history.back(); + }, + + function(){ + ok($('#numbered-list-test').hasClass('ui-page-active')); + start(); + } + ]); + }); + + module('Read only list'); + + asyncTest( "changes to the read only page when hash is changed", function() { + $.testHelper.pageSequence([ + function(){ + $.mobile.changePage("#read-only-list-test"); + }, + + function(){ + var $new_page = $('#read-only-list-test'); + ok($new_page.hasClass('ui-page-active'), "makes the read only page the active page"); + ok($('li', $new_page).first().text() === "Read", "The first LI has the proper text."); + start(); + } + ]); + }); + + module('Split view list'); + + asyncTest( "changes the page to the split view list and enhances it correctly.", function() { + $.testHelper.pageSequence([ + function(){ + $.mobile.changePage("#split-list-test"); + }, + + function(){ + var $new_page = $('#split-list-test'); + ok($('.ui-li-link-alt', $new_page).length == 3); + ok($('.ui-link-inherit', $new_page).length == 3); + start(); + } + ]); + }); + + asyncTest( "change the page to the split view page 1 when the first link is clicked", function() { + $.testHelper.pageSequence([ + function(){ + $.mobile.changePage("#split-list-test"); + }, + + function(){ + $('.ui-page-active .ui-li a:eq(0)').click(); + }, + + function(){ + ok($('#split-list-link1').hasClass('ui-page-active')); + start(); + } + ]); + }); + + asyncTest( "Slide back to the parent list view when the back button is clicked", function() { + $.testHelper.pageSequence([ + function(){ + $.mobile.changePage("#split-list-test"); + }, + + function(){ + $('.ui-page-active .ui-listview a:eq(0)').click(); + }, + + function(){ + history.back(); + }, + + function(){ + ok($('#split-list-test').hasClass('ui-page-active')); + start(); + } + ]); + }); + + asyncTest( "Clicking on the icon (the second link) should take the user to other a href of this LI", function() { + $.testHelper.pageSequence([ + function(){ + $.mobile.changePage("#split-list-test"); + }, + + function(){ + $('.ui-page-active .ui-li-link-alt:eq(0)').click(); + }, + + function(){ + ok($('#split-list-link2').hasClass('ui-page-active')); + start(); + } + ]); + }); + + module( "List Dividers" ); + + asyncTest( "Makes the list divider page the active page and enhances it correctly.", function() { + $.testHelper.pageSequence([ + function(){ + $.mobile.changePage("#list-divider-test"); + }, + + function(){ + var $new_page = $('#list-divider-test'); + ok($new_page.find('.ui-li-divider').length == 2); + ok($new_page.hasClass('ui-page-active')); + start(); + } + ]); + }); + + module( "Search Filter"); + + var searchFilterId = "#search-filter-test"; + + + asyncTest( "Filter downs results when the user enters information", function() { + var $searchPage = $(searchFilterId); + $.testHelper.pageSequence([ + function() { + $.mobile.changePage(searchFilterId); + }, + + function() { + $searchPage.find('input').val('at'); + $searchPage.find('input').trigger('change'); + + same($searchPage.find('li.ui-screen-hidden').length, 2); + start(); + } + ]); + }); + + asyncTest( "Redisplay results when user removes values", function() { + var $searchPage = $(searchFilterId); + $.testHelper.pageSequence([ + function() { + $.mobile.changePage(searchFilterId); + }, + + function() { + $searchPage.find('input').val('a'); + $searchPage.find('input').trigger('change'); + + same($searchPage.find("li[style^='display: none;']").length, 0); + start(); + } + ]); + }); + + asyncTest( "Filter works fine with \\W- or regexp-special-characters", function() { + var $searchPage = $(searchFilterId); + $.testHelper.pageSequence([ + function() { + $.mobile.changePage(searchFilterId); + }, + + function() { + $searchPage.find('input').val('*'); + $searchPage.find('input').trigger('change'); + + same($searchPage.find('li.ui-screen-hidden').length, 4); + start(); + } + ]); + }); + + test( "Refresh applies thumb styling", function(){ + var ul = $('.ui-page-active ul'); + + ul.append("
      • "); + ok(!ul.find("#fiz img").hasClass("ui-li-thumb")); + ul.listview('refresh'); + ok(ul.find("#fiz img").hasClass("ui-li-thumb")); + }); + + asyncTest( "Filter downs results and dividers when the user enters information", function() { + var $searchPage = $("#search-filter-with-dividers-test"); + $.testHelper.pageSequence([ + function() { + $.mobile.changePage("#search-filter-with-dividers-test"); + }, + + // wait for the page to become active/enhanced + function(){ + $searchPage.find('input').val('at'); + $searchPage.find('input').trigger('change'); + setTimeout(function() { + //there should be four hidden list entries + same($searchPage.find('li.ui-screen-hidden').length, 4); + + //there should be two list entries that are list dividers and hidden + same($searchPage.find('li.ui-screen-hidden:jqmData(role=list-divider)').length, 2); + + //there should be two list entries that are not list dividers and hidden + same($searchPage.find('li.ui-screen-hidden:not(:jqmData(role=list-divider))').length, 2); + start(); + }, 1000); + } + ]); + }); + + asyncTest( "Redisplay results when user removes values", function() { + $.testHelper.pageSequence([ + function() { + $.mobile.changePage("#search-filter-with-dividers-test"); + }, + + function() { + $('.ui-page-active input').val('a'); + $('.ui-page-active input').trigger('change'); + + setTimeout(function() { + same($('.ui-page-active input').val(), 'a'); + same($('.ui-page-active li[style^="display: none;"]').length, 0); + start(); + }, 1000); + } + ]); + }); + + asyncTest( "Dividers are hidden when preceding hidden rows and shown when preceding shown rows", function () { + $.testHelper.pageSequence([ + function() { + $.mobile.changePage("#search-filter-with-dividers-test"); + }, + + function() { + var $page = $('.ui-page-active'); + + $page.find('input').val('at'); + $page.find('input').trigger('change'); + + setTimeout(function() { + same($page.find('li:jqmData(role=list-divider):hidden').length, 2); + same($page.find('li:jqmData(role=list-divider):hidden + li:not(:jqmData(role=list-divider)):hidden').length, 2); + same($page.find('li:jqmData(role=list-divider):not(:hidden) + li:not(:jqmData(role=list-divider)):not([:hidden)').length, 2); + start(); + }, 1000); + } + ]); + }); + + asyncTest( "Inset List View should refresh corner classes after filtering", 4 * 2, function () { + var checkClasses = function() { + var $page = $( ".ui-page-active" ), + $li = $page.find( "li:visible" ); + ok($li.first().hasClass( "ui-corner-top" ), $li.length+" li elements: First visible element should have class ui-corner-top"); + ok($li.last().hasClass( "ui-corner-bottom" ), $li.length+" li elements: Last visible element should have class ui-corner-bottom"); + }; + + $.testHelper.pageSequence([ + function() { + $.mobile.changePage("#search-filter-inset-test"); + }, + + function() { + var $page = $('.ui-page-active'); + $.testHelper.sequence([ + function() { + checkClasses(); + + $page.find('input').val('man'); + $page.find('input').trigger('change'); + }, + + function() { + checkClasses(); + + $page.find('input').val('at'); + $page.find('input').trigger('change'); + }, + + function() { + checkClasses(); + + $page.find('input').val('catwoman'); + $page.find('input').trigger('change'); + }, + + function() { + checkClasses(); + start(); + } + ], 50); + } + ]); + }); + + module( "Programmatically generated list items", { + setup: function(){ + var item, + data = [ + { + id: 1, + label: "Item 1" + }, + { + id: 2, + label: "Item 2" + }, + { + id: 3, + label: "Item 3" + }, + { + id: 4, + label: "Item 4" + } + ]; + + $( "#programmatically-generated-list-items" ).html(""); + + for ( var i = 0, len = data.length; i < len; i++ ) { + item = $( '
      • ' ); + label = $( "" + data[i].label + "").appendTo( item ); + $( "#programmatically-generated-list-items" ).append( item ); + } + } + }); + + asyncTest( "Corner styling on programmatically created list items", function() { + // https://github.com/jquery/jquery-mobile/issues/1470 + $.testHelper.pageSequence([ + function() { + $.mobile.changePage( "#programmatically-generated-list" ); + }, + function() { + ok(!$( "#programmatically-generated-list-items li:first-child" ).hasClass( "ui-corner-bottom" ), "First list item should not have class ui-corner-bottom" ); + start(); + } + ]); + }); + + module("Programmatic list items manipulation"); + + asyncTest("Removing list items", 4, function() { + $.testHelper.pageSequence([ + function() { + $.mobile.changePage("#removing-items-from-list-test"); + }, + + function() { + var ul = $('#removing-items-from-list-test ul'); + ul.find("li").first().remove(); + equal(ul.find("li").length, 3, "There should be only 3 list items left"); + + ul.listview('refresh'); + ok(ul.find("li").first().hasClass("ui-corner-top"), "First list item should have class ui-corner-top"); + + ul.find("li").last().remove(); + equal(ul.find("li").length, 2, "There should be only 2 list items left"); + + ul.listview('refresh'); + ok(ul.find("li").last().hasClass("ui-corner-bottom"), "Last list item should have class ui-corner-bottom"); + start(); + } + ]); + }); + + module("Rounded corners"); + + asyncTest("Top and bottom corners rounded in inset list", 14, function() { + $.testHelper.pageSequence([ + function() { + $.mobile.changePage("#corner-rounded-test"); + }, + + function() { + var ul = $('#corner-rounded-test ul'); + + for( var t = 0; t<3; t++){ + ul.append("
      • Item " + t + "
      • "); + ul.listview('refresh'); + equals(ul.find(".ui-corner-top").length, 1, "There should be only one element with class ui-corner-top"); + equals(ul.find("li:visible").first()[0], ul.find(".ui-corner-top")[0], "First list item should have class ui-corner-top in list with " + ul.find("li").length + " item(s)"); + equals(ul.find(".ui-corner-bottom").length, 1, "There should be only one element with class ui-corner-bottom"); + equals(ul.find("li:visible").last()[0], ul.find(".ui-corner-bottom")[0], "Last list item should have class ui-corner-bottom in list with " + ul.find("li").length + " item(s)"); + } + + ul.find( "li" ).first().hide(); + ul.listview( "refresh" ); + equals(ul.find("li:visible").first()[0], ul.find(".ui-corner-top")[0], "First visible list item should have class ui-corner-top"); + + ul.find( "li" ).last().hide(); + ul.listview( "refresh" ); + equals(ul.find("li:visible").last()[0], ul.find(".ui-corner-bottom")[0], "Last visible list item should have class ui-corner-bottom"); + + start(); + } + ]); + }); + + test( "Listview will create when inside a container that receives a 'create' event", function(){ + ok( !$("#enhancetest").appendTo(".ui-page-active").find(".ui-listview").length, "did not have enhancements applied" ); + ok( $("#enhancetest").trigger("create").find(".ui-listview").length, "enhancements applied" ); + }); + + module( "Cached Linked List" ); + + var findNestedPages = function(selector){ + return $( selector + " #topmost" ).listview( 'childPages' ); + }; + + asyncTest( "nested pages are removed from the dom by default", function(){ + $.testHelper.pageSequence([ + function(){ + //reset for relative url refs + $.mobile.changePage( home ); + }, + + function(){ + $.mobile.changePage( "cache-tests/uncached-nested.html" ); + }, + + function(){ + ok( findNestedPages( "#uncached-nested-list" ).length > 0, "verify that there are nested pages" ); + $.mobile.changePage( home ); + }, + + function() { + $.mobile.changePage( "cache-tests/clear.html" ); + }, + + function(){ + same( findNestedPages( "#uncached-nested-list" ).length, 0 ); + start(); + } + ]); + }); + + asyncTest( "nested pages preserved when parent page is cached", function(){ + + $.testHelper.pageSequence([ + function(){ + //reset for relative url refs + $.mobile.changePage( home ); + }, + + function(){ + $.mobile.changePage( "cache-tests/cached-nested.html" ); + }, + + function(){ + ok( findNestedPages( "#cached-nested-list" ).length > 0, "verify that there are nested pages" ); + $.mobile.changePage( home ); + }, + + function() { + $.mobile.changePage( "cache-tests/clear.html" ); + }, + + function(){ + ok( findNestedPages( "#cached-nested-list" ).length > 0, "nested pages remain" ); + start(); + } + ]); + }); + + asyncTest( "parent page is not removed when visiting a sub page", function(){ + $.testHelper.pageSequence([ + function(){ + //reset for relative url refs + $.mobile.changePage( home ); + }, + + function(){ + $.mobile.changePage( "cache-tests/cached-nested.html" ); + }, + + function(){ + same( $("#cached-nested-list").length, 1 ); + $.mobile.changePage( home ); + }, + + function() { + $.mobile.changePage( "cache-tests/clear.html" ); + }, + + function(){ + same( $("#cached-nested-list").length, 1 ); + start(); + } + ]); + }); + + asyncTest( "filterCallback can be altered after widget creation", function(){ + var listPage = $( "#search-filter-test" ); + expect( listPage.find("li").length ); + + $.testHelper.pageSequence( [ + function(){ + //reset for relative url refs + $.mobile.changePage( home ); + }, + + function() { + $.mobile.changePage( "#search-filter-test" ); + }, + + function() { + // set the listview instance callback + listPage.find( "ul" ).listview( "option", "filterCallback", function() { + ok(true, "custom callback invoked"); + }); + + // trigger a change in the search filter + listPage.find( "input" ).val( "foo" ).trigger( "change" ); + + //NOTE beware a poossible issue with timing here + start(); + } + ]); + }); + + asyncTest( "nested pages hash key is always in the hash (replaceState)", function(){ + $.testHelper.pageSequence([ + function(){ + //reset for relative url refs + $.mobile.changePage( home ); + }, + + function(){ + // https://github.com/jquery/jquery-mobile/issues/1617 + $.mobile.changePage("#nested-lists-test"); + }, + + function(){ + // Click on the link of the third li element + $('.ui-page-active li:eq(2) a:eq(0)').click(); + }, + + function(){ + ok( location.hash.search($.mobile.subPageUrlKey) >= 0 ); + start(); + } + ]); + }); + + asyncTest( "embedded listview page with nested pages is not removed from the dom", function() { + $.testHelper.pageSequence([ + function() { + // open the nested list page + same( $("div#nested-list-test").length, 1 ); + $( "a#nested-list-test-anchor" ).click(); + }, + + function() { + // go back to the origin page + window.history.back(); + }, + + function() { + // make sure the page is still in place + same( $("div#nested-list-test").length, 1 ); + start(); + } + ]); + }); + + + asyncTest( "list inherits theme from parent", function() { + $.testHelper.pageSequence([ + function() { + $.mobile.changePage("#list-theme-inherit"); + }, + + function() { + var theme = $.mobile.activePage.jqmData('theme'); + ok( $.mobile.activePage.find("ul > li").hasClass("ui-body-b"), "theme matches the parent"); + window.history.back(); + }, + + start + ]); + }); + + asyncTest( "list filter is inset from prototype options value", function() { + $.mobile.listview.prototype.options.inset = true; + $("#list-inset-filter-prototype").page(); + + $.testHelper.pageSequence([ + function() { + $.mobile.changePage("#list-inset-filter-prototype"); + }, + + function( timedOut) { + ok( !timedOut ); + same( $.mobile.activePage.find("form.ui-listview-filter-inset").length, 1, "form is inset"); + window.history.back(); + }, + + start + ]); + }); + + asyncTest( "list filter is inset from data attr value", function() { + $.mobile.listview.prototype.options.inset = false; + $("#list-inset-filter-data-attr").page(); + + $.testHelper.pageSequence([ + function() { + $.mobile.changePage("#list-inset-filter-data-attr"); + }, + + function( timedOut) { + ok( !timedOut ); + same( $.mobile.activePage.find("form.ui-listview-filter-inset").length, 1, "form is inset"); + window.history.back(); + }, + + start + ]); + }); + + asyncTest( "split list items respect the icon", function() { + $.testHelper.pageSequence([ + function() { + $.mobile.changePage("#split-list-icon"); + }, + + function() { + $.mobile.activePage.find("li").each(function(i, elem){ + var $elem = $(elem), + order = [ "star", "plug", "delete", "plug" ]; + + same( $elem.find("span.ui-icon-" + order[i]).length, 1, "there should be one " + order[i] + " icon" ); + }); + + window.history.back(); + }, + + start + ]); + }); +})(jQuery); diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/listview/listview_pushstate.js b/libs/js/jquery-mobile-1.1.0/tests/unit/listview/listview_pushstate.js new file mode 100644 index 0000000..6af09e7 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/listview/listview_pushstate.js @@ -0,0 +1,15 @@ +(function($) { + asyncTest( "nested pages hash key is always in the hash on default page with no id (replaceState) ", function(){ + $.testHelper.pageSequence([ + function(){ + // Click on the link of the third li element + $('.ui-page-active li:eq(2) a:eq(0)').click(); + }, + + function(){ + ok( location.hash.search($.mobile.subPageUrlKey) >= 0 ); + start(); + } + ]); + }); +})(jQuery); \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/listview/pushstate-tests.html b/libs/js/jquery-mobile-1.1.0/tests/unit/listview/pushstate-tests.html new file mode 100644 index 0000000..acf4234 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/listview/pushstate-tests.html @@ -0,0 +1,87 @@ + + + + + + jQuery Mobile Listview Integration Test + + + + + + + + + + + + + + + +

        jQuery Mobile Listview Integration Test

        +

        +

        +
          +
        + +
        +
        +

        Basic multiple lists view

        +
        +
        +
          +
        • Item 1
        • +
        • Item 2
        • +
        • Item 3 +
            +
          • Item A-3-0
          • +
          • Item A-3-1
          • +
          • Item A-3-2
          • +
          +
        • +
        +
          +
        • Item 1
        • +
        • Item 2
        • +
        • Item 3 +
            +
          • Item B-3-0 +
              +
            • Item B-3-0-0
            • +
            • Item B-3-0-1 +
                +
              • Item B-3-0-1-0
              • +
              • Item B-3-0-1-1
              • +
              • Item B-3-0-1-2
              • +
              +
            • +
            • Item B-3-0-2
            • +
            +
          • +
          • Item B-3-1 +
              +
            • Item B-3-1-0
            • +
            • Item B-3-1-1
            • +
            • Item B-3-1-2
            • +
            +
          • +
          • Item B-3-2
          • +
          +
        • +
        +
        +
        + + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/ls.php b/libs/js/jquery-mobile-1.1.0/tests/unit/ls.php new file mode 100644 index 0000000..577bfec --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/ls.php @@ -0,0 +1,20 @@ + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/media/index.html b/libs/js/jquery-mobile-1.1.0/tests/unit/media/index.html new file mode 100644 index 0000000..52c39a5 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/media/index.html @@ -0,0 +1,40 @@ + + + + + + jQuery Mobile Media Test Suite + + + + + + + + + + + + + + + +

        jQuery Mobile Media Test Suite

        +

        +

        +
          +
        + +
        + + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/media/media_core.js b/libs/js/jquery-mobile-1.1.0/tests/unit/media/media_core.js new file mode 100644 index 0000000..68eca0c --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/media/media_core.js @@ -0,0 +1,39 @@ +/* + * mobile media unit tests + */ + +(function($){ + var cssFn = $.fn.css, + widthFn = $.fn.width; + + // make sure original definitions are reset + module('jquery.mobile.media.js', { + setup: function(){ + $(document).trigger('mobileinit.htmlclass'); + }, + teardown: function(){ + $.fn.css = cssFn; + $.fn.width = widthFn; + } + }); + + test( "media query check returns true when the position is absolute", function(){ + $.fn.css = function(){ return "absolute"; }; + same($.mobile.media("screen 1"), true); + }); + + test( "media query check returns false when the position is not absolute", function(){ + $.fn.css = function(){ return "not absolute"; }; + same($.mobile.media("screen 2"), false); + }); + + test( "media query check is cached", function(){ + $.fn.css = function(){ return "absolute"; }; + same($.mobile.media("screen 3"), true); + + $.fn.css = function(){ return "not absolute"; }; + same($.mobile.media("screen 3"), true); + }); + + +})(jQuery); \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/navbar/index.html b/libs/js/jquery-mobile-1.1.0/tests/unit/navbar/index.html new file mode 100644 index 0000000..9c83c95 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/navbar/index.html @@ -0,0 +1,63 @@ + + + + + + jQuery Mobile Navigation Test Suite + + + + + + + + + + + + +

        jQuery Mobile Navigation Test Suite

        +

        +

        +
          +
        +
        +
        + +
        +
        + +
        +
        +
        +
          +
        • +
        • +
        +
        +
        + +
        +
        +
          +
        • +
        • +
        +
        +
        +
        + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/navbar/navbar_core.js b/libs/js/jquery-mobile-1.1.0/tests/unit/navbar/navbar_core.js new file mode 100644 index 0000000..f80bb5d --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/navbar/navbar_core.js @@ -0,0 +1,31 @@ +/* + * mobile navbar unit tests + */ +(function($){ + test( "navbar button gets active button class when clicked", function() { + var link = $("#disabled-btn-click a:not(.ui-disabled)").first(); + + link.click(); + ok( link.hasClass($.mobile.activeBtnClass), "link has active button class" ); + }); + + test( "disabled navbar button doesn't add active button class when clicked", function() { + var link = $("#disabled-btn-click a.ui-disabled").first(); + + link.click(); + ok( !link.hasClass($.mobile.activeBtnClass), "link doesn't have active button class" ); + }); + + test( "grids inside an ignored container do not enhance", function() { + var $ignored = $( "#ignored-grid" ), $enhanced = $( "#enhanced-grid" ); + + $.mobile.ignoreContentEnabled = true; + + $("#foo").trigger( "create" ); + + same( $ignored.attr( "class" ), undefined, "ignored list doesn't have the grid theme" ); + same( $enhanced.attr( "class" ).indexOf("ui-grid"), 0, "enhanced list has the grid theme" ); + + $.mobile.ignoreContentEnabled = false; + }); +})(jQuery); \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/base-tests.html b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/base-tests.html new file mode 100644 index 0000000..7d1649e --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/base-tests.html @@ -0,0 +1,72 @@ + + + + + + jQuery Mobile Navigation Test Suite + + + + + + + + + + + + + + + + + + +

        jQuery Mobile Navigation Base Tag Test Suite

        +

        +

        +
          +
        + +
        + + + + + + +
        + +
        + + + + + + +
        + +
        +
        +
        + + +
        +
        +
        + + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/base-tests/app-base/base-page-1.html b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/base-tests/app-base/base-page-1.html new file mode 100644 index 0000000..b417713 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/base-tests/app-base/base-page-1.html @@ -0,0 +1,14 @@ + + + + + + + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/base-tests/app-base/base-page-2.html b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/base-tests/app-base/base-page-2.html new file mode 100644 index 0000000..ac84a98 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/base-tests/app-base/base-page-2.html @@ -0,0 +1,14 @@ + + + + + + + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/base-tests/content/content-page-1.html b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/base-tests/content/content-page-1.html new file mode 100644 index 0000000..68cef02 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/base-tests/content/content-page-1.html @@ -0,0 +1,19 @@ + + + + + + + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/base-tests/content/content-page-2.html b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/base-tests/content/content-page-2.html new file mode 100644 index 0000000..76c9bbd --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/base-tests/content/content-page-2.html @@ -0,0 +1,14 @@ + + + + + + + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/cached-external.html b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/cached-external.html new file mode 100644 index 0000000..5ebcf06 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/cached-external.html @@ -0,0 +1,10 @@ + + + + + + +
        +
        + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/data-url-tests/data-url.html b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/data-url-tests/data-url.html new file mode 100644 index 0000000..bece3f8 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/data-url-tests/data-url.html @@ -0,0 +1,10 @@ + + + + + +
        + This text intentionally left blank +
        + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/data-url-tests/nested.html b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/data-url-tests/nested.html new file mode 100644 index 0000000..da75dbc --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/data-url-tests/nested.html @@ -0,0 +1,8 @@ + + + + + +
        + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/data-url-tests/non-data-url.html b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/data-url-tests/non-data-url.html new file mode 100644 index 0000000..e0a299f --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/data-url-tests/non-data-url.html @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/data-url-tests/reverse-attr.html b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/data-url-tests/reverse-attr.html new file mode 100644 index 0000000..379577f --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/data-url-tests/reverse-attr.html @@ -0,0 +1,8 @@ + + + + + +
        + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/data-url-tests/single-quotes.html b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/data-url-tests/single-quotes.html new file mode 100644 index 0000000..74afd7f --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/data-url-tests/single-quotes.html @@ -0,0 +1,8 @@ + + + + + +
        + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/dialog-param-test/dialog-param.html b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/dialog-param-test/dialog-param.html new file mode 100644 index 0000000..5c13d5f --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/dialog-param-test/dialog-param.html @@ -0,0 +1,18 @@ + + + + + + +

        jQuery Mobile Navigation Test Suite

        +

        +

        +
          +
        + + + + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/external.html b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/external.html new file mode 100644 index 0000000..c9a011d --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/external.html @@ -0,0 +1,9 @@ + + + + + + +
        + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/file.html b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/file.html new file mode 100644 index 0000000..5109dee --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/file.html @@ -0,0 +1,11 @@ + + + + + + +
        +
        doc rel test one
        +
        + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/form-tests/changepage-data.html b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/form-tests/changepage-data.html new file mode 100644 index 0000000..2305c20 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/form-tests/changepage-data.html @@ -0,0 +1,8 @@ + + + + + +
        + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/form-tests/form-no-action.html b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/form-tests/form-no-action.html new file mode 100644 index 0000000..1b4ff7c --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/form-tests/form-no-action.html @@ -0,0 +1,15 @@ + + + + + +
        +
        +
        + + +
        +
        +
        + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/index.html b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/index.html new file mode 100644 index 0000000..ce2fcbc --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/index.html @@ -0,0 +1,302 @@ + + + + + + jQuery Mobile Navigation Test Suite + + + + + + + + + + + + + + + + + + +

        jQuery Mobile Navigation Test Suite

        +

        +

        +
          +
        + +
        +
        + +
        + + +
        + + + +
        +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        +
        +
        + +
        +
        + +
        +
        +
        + +
        + +
        + +
        +
        + + + + + +
        +
        +

        Dialog

        +
        +
        + +
        +
        + Dialog +
        +
        + +
        +
        + Page 2 +
        +
        + +
        + Go Back +
        + + +
        +
        + Dialog +
        +
        + +
        +
        + Dialog 2 +
        +
        + +
        +
        + +
        + +
        + + + +
        + test + test + test +
        + +
        +

        Title Heading

        +
        + +
        +

        Title Heading

        +
        + + + + + +
        + + go + go + go + go + go + go + + + + go + go + go + go + go + go + + + + go + go + go + go + go + go + + + + go + go + go + go + go + go + +
        + +
        +
        page didn't change!
        +
        + + + +
        +
        + page2 +
        +
        + + + + + +
        + foo +
        + +
        + + + + + + + + + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/navigation_base.js b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/navigation_base.js new file mode 100644 index 0000000..544691b --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/navigation_base.js @@ -0,0 +1,206 @@ +/* + * mobile navigation base tag unit tests + */ +(function($){ + var baseDir = $.mobile.path.parseUrl($("base").attr("href")).directory, + contentDir = $.mobile.path.makePathAbsolute("../content/", baseDir), + home = location.pathname + location.search; + + module('jquery.mobile.navigation.js - base tag', { + setup: function(){ + if ( location.hash ) { + stop(); + $(document).one("pagechange", function() { + start(); + } ); + location.hash = ""; + } + } + }); + + asyncTest( "can navigate between internal and external pages", function(){ + $.testHelper.pageSequence([ + function(){ + // Navigate from default internal page to another internal page. + $.testHelper.openPage( "#internal-page-2" ); + }, + + function(){ + // Verify that we are on the 2nd internal page. + $.testHelper.assertUrlLocation({ + push: home + "#internal-page-2", + hash: "internal-page-2", + report: "navigate to internal page" + }); + + // Navigate to a page that is in the base directory. Note that the application + // document and this new page are *NOT* in the same directory. + $("#internal-page-2 .bp1").click(); + }, + + function(){ + // Verify that we are on the expected page. + $.testHelper.assertUrlLocation({ + hashOrPush: baseDir + "base-page-1.html", + report: "navigate from internal page to page in base directory" + }); + + // Navigate to another page in the same directory as the current page. + $("#base-page-1 .bp2").click(); + }, + + function(){ + // Verify that we are on the expected page. + $.testHelper.assertUrlLocation({ + hashOrPush: baseDir + "base-page-2.html", + report: "navigate from base directory page to another base directory page" + }); + + // Navigate to another page in a directory that is the sibling of the base. + $("#base-page-2 .cp1").click(); + }, + + function(){ + // Verify that we are on the expected page. + $.testHelper.assertUrlLocation({ + hashOrPush: contentDir + "content-page-1.html", + report: "navigate from base directory page to a page in a different directory hierarchy" + }); + + // Navigate to another page in a directory that is the sibling of the base. + $("#content-page-1 .cp2").click(); + }, + + function(){ + // Verify that we are on the expected page. + $.testHelper.assertUrlLocation({ + hashOrPush: contentDir + "content-page-2.html", + report: "navigate to another page within the same non-base directory hierarchy" + }); + + // Navigate to an internal page. + $("#content-page-2 .ip1").click(); + }, + + function(){ + // Verify that we are on the expected page. + // the hash based nav result (hash:) is dictate by the fact that #internal-page-1 + // is the original root page element + $.testHelper.assertUrlLocation({ + hashOrPush: home, + report: "navigate from a page in a non-base directory to an internal page" + }); + + // Try calling changePage() directly with a relative path. + $.mobile.changePage("base-page-1.html"); + }, + + function(){ + // Verify that we are on the expected page. + $.testHelper.assertUrlLocation({ + hashOrPush: baseDir + "base-page-1.html", + report: "call changePage() with a filename (no path)" + }); + + // Try calling changePage() directly with a relative path. + $.mobile.changePage("../content/content-page-1.html"); + }, + + function(){ + // Verify that we are on the expected page. + $.testHelper.assertUrlLocation({ + hashOrPush: contentDir + "content-page-1.html", + report: "call changePage() with a relative path containing up-level references" + }); + + // Try calling changePage() with an id + $.mobile.changePage("content-page-2.html"); + }, + + function(){ + // Verify that we are on the expected page. + $.testHelper.assertUrlLocation({ + hashOrPush: contentDir + "content-page-2.html", + report: "call changePage() with a relative path should resolve relative to current page" + }); + + // test that an internal page works + $("a.ip2").click(); + }, + + function(){ + // Verify that we are on the expected page. + $.testHelper.assertUrlLocation({ + hash: "internal-page-2", + push: home + "#internal-page-2", + report: "call changePage() with a page id" + }); + + // Try calling changePage() with an id + $.mobile.changePage("internal-page-1"); + }, + + function(){ + // Verify that we are on the expected page. + $.testHelper.assertUrlLocation({ + hash: "internal-page-2", + push: home + "#internal-page-2", + report: "calling changePage() with a page id that is not prefixed with '#' should not change page" + }); + + // Previous load should have failed and left us on internal-page-2. + start(); + } + ]); + }); + + asyncTest( "internal form with no action submits to document URL", function(){ + $.testHelper.pageSequence([ + // open our test page + function(){ + $.testHelper.openPage( "#internal-no-action-form-page" ); + }, + + function(){ + $( "#internal-no-action-form-page form" ).eq( 0 ).submit(); + }, + + function(){ + $.testHelper.assertUrlLocation({ + hashOrPush: location.pathname + "?foo=1&bar=2", + report: "hash should match document url and not base url" + }); + + start(); + } + ]); + }); + + asyncTest( "external page form with no action submits to external page URL", function(){ + $.testHelper.pageSequence([ + function(){ + // Go to an external page that has a form. + $("#internal-page-1 .cp1").click(); + }, + + function(){ + // Make sure we actually navigated to the external page. + $.testHelper.assertUrlLocation({ + hashOrPush: contentDir + "content-page-1.html", + report: "should be on content-page-1.html" + }); + + // Now submit the form in the external page. + $("#content-page-1 form").eq(0).submit(); + }, + + function(){ + $.testHelper.assertUrlLocation({ + hashOrPush: contentDir + "content-page-1.html?foo=1&bar=2", + report: "hash should match page url and not document url" + }); + + start(); + }]); + }); +})(jQuery); diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/navigation_core.js b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/navigation_core.js new file mode 100644 index 0000000..f62c3d1 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/navigation_core.js @@ -0,0 +1,1216 @@ +/* + * mobile navigation unit tests + */ +(function($){ + // TODO move siteDirectory over to the nav path helper + var changePageFn = $.mobile.changePage, + originalTitle = document.title, + originalLinkBinding = $.mobile.linkBindingEnabled, + siteDirectory = location.pathname.replace( /[^/]+$/, "" ), + home = $.mobile.path.parseUrl(location.pathname).directory, + homeWithSearch = home + location.search, + navigateTestRoot = function(){ + $.testHelper.openPage( "#" + location.pathname + location.search ); + }; + + module('jquery.mobile.navigation.js', { + setup: function(){ + $.mobile.changePage = changePageFn; + document.title = originalTitle; + + var pageReset = function( hash ) { + hash = hash || ""; + + stop(); + + $(document).one( "pagechange", function() { + start(); + }); + + location.hash = "#" + hash; + }; + + // force the page reset for hash based tests + if ( location.hash && !$.support.pushState ) { + pageReset(); + } + + // force the page reset for all pushstate tests + if ( $.support.pushState ) { + pageReset( homeWithSearch ); + } + + + $.mobile.urlHistory.stack = []; + $.mobile.urlHistory.activeIndex = 0; + $.Event.prototype.which = undefined; + $.mobile.linkBindingEnabled = originalLinkBinding; + } + }); + + asyncTest( "window.history.back() from external to internal page", function(){ + + $.testHelper.pageSequence([ + + // open our test page + function(){ + $.testHelper.openPage("#active-state-page1"); + }, + + function(){ + ok( $.mobile.activePage[0] === $( "#active-state-page1" )[ 0 ], "successful navigation to internal page." ); + + //location.hash = siteDirectory + "external.html"; + $.mobile.changePage("external.html"); + }, + + function(){ + ok( $.mobile.activePage[0] !== $( "#active-state-page1" )[ 0 ], "successful navigation to external page." ); + + window.history.back(); + }, + + function(){ + ok( $.mobile.activePage[0] === $( "#active-state-page1" )[ 0 ], "successful navigation back to internal page." ); + + start(); + } + ]); + }); + + asyncTest( "external page is removed from the DOM after pagehide", function(){ + $.testHelper.pageSequence([ + navigateTestRoot, + + function(){ + $.mobile.changePage( "external.html" ); + }, + + // page is pulled and displayed in the dom + function(){ + same( $( "#external-test" ).length, 1 ); + window.history.back(); + }, + + // external-test is *NOT* cached in the dom after transitioning away + function(){ + same( $( "#external-test" ).length, 0 ); + start(); + } + ]); + }); + + asyncTest( "preventDefault on pageremove event can prevent external page from being removed from the DOM", function(){ + var preventRemoval = true, + removeCallback = function( e ) { + if ( preventRemoval ) { + e.preventDefault(); + } + }; + + $( document ).bind( "pageremove", removeCallback ); + + $.testHelper.pageSequence([ + navigateTestRoot, + + function(){ + $.mobile.changePage( "external.html" ); + }, + + // page is pulled and displayed in the dom + function(){ + same( $( "#external-test" ).length, 1 ); + window.history.back(); + }, + + // external-test *IS* cached in the dom after transitioning away + function(){ + same( $( "#external-test" ).length, 1 ); + + // Switch back to the page again! + $.mobile.changePage( "external.html" ); + }, + + // page is still present and displayed in the dom + function(){ + same( $( "#external-test" ).length, 1 ); + + // Now turn off our removal prevention. + preventRemoval = false; + + window.history.back(); + }, + + // external-test is *NOT* cached in the dom after transitioning away + function(){ + same( $( "#external-test" ).length, 0 ); + $( document ).unbind( "pageremove", removeCallback ); + start(); + } + ]); + }); + + asyncTest( "external page is cached in the DOM after pagehide", function(){ + $.testHelper.pageSequence([ + navigateTestRoot, + + function(){ + $.mobile.changePage( "cached-external.html" ); + }, + + // page is pulled and displayed in the dom + function(){ + same( $( "#external-test-cached" ).length, 1 ); + window.history.back(); + }, + + // external test page is cached in the dom after transitioning away + function(){ + same( $( "#external-test-cached" ).length, 1 ); + start(); + } + ]); + }); + + asyncTest( "external page is cached in the DOM after pagehide when option is set globally", function(){ + $.testHelper.pageSequence([ + navigateTestRoot, + + function(){ + $.mobile.page.prototype.options.domCache = true; + $.mobile.changePage( "external.html" ); + }, + + // page is pulled and displayed in the dom + function(){ + same( $( "#external-test" ).length, 1 ); + window.history.back(); + }, + + // external test page is cached in the dom after transitioning away + function(){ + same( $( "#external-test" ).length, 1 ); + $.mobile.page.prototype.options.domCache = false; + $( "#external-test" ).remove(); + start(); + }]); + }); + + asyncTest( "page last scroll distance is remembered while navigating to and from pages", function(){ + $.testHelper.pageSequence([ + function(){ + $( "body" ).height( $( window ).height() + 500 ); + $.mobile.changePage( "external.html" ); + }, + + function(){ + // wait for the initial scroll to 0 + setTimeout( function() { + window.scrollTo( 0, 300 ); + same( $(window).scrollTop(), 300, "scrollTop is 300 after setting it" ); + }, 300); + + // wait for the scrollstop to fire and for the scroll to be + // recorded 100 ms afterward (see changes made to handle hash + // scrolling in some browsers) + setTimeout( navigateTestRoot, 500 ); + }, + + function(){ + history.back(); + }, + + function(){ + // Give the silentScroll function some time to kick in. + setTimeout(function() { + same( $(window).scrollTop(), 300, "scrollTop is 300 after returning to the page" ); + $( "body" ).height( "" ); + start(); + }, 300 ); + } + ]); + }); + + asyncTest( "forms with data attribute ajax set to false will not call changePage", function(){ + var called = false; + var newChangePage = function(){ + called = true; + }; + + $.testHelper.sequence([ + // avoid initial page load triggering changePage early + function(){ + $.mobile.changePage = newChangePage; + + $('#non-ajax-form').one('submit', function(event){ + ok(true, 'submit callbacks are fired'); + event.preventDefault(); + }).submit(); + }, + + function(){ + ok(!called, "change page should not be called"); + start(); + }], 1000); + }); + + asyncTest( "forms with data attribute ajax not set or set to anything but false will call changePage", function(){ + var called = 0, + newChangePage = function(){ + called++; + }; + + $.testHelper.sequence([ + // avoid initial page load triggering changePage early + function(){ + $.mobile.changePage = newChangePage; + $('#ajax-form, #rand-ajax-form').submit(); + }, + + function(){ + ok(called >= 2, "change page should be called at least twice"); + start(); + }], 300); + }); + + + asyncTest( "anchors with no href attribute will do nothing when clicked", function(){ + var fired = false; + + $(window).bind("hashchange.temp", function(){ + fired = true; + }); + + $( "test" ).appendTo( $.mobile.firstPage ).click(); + + setTimeout(function(){ + same(fired, false, "hash shouldn't change after click"); + $(window).unbind("hashchange.temp"); + start(); + }, 500); + }); + + test( "urlHistory is working properly", function(){ + + //urlHistory + same( $.type( $.mobile.urlHistory.stack ), "array", "urlHistory.stack is an array" ); + + //preload the stack + $.mobile.urlHistory.stack[0] = { url: "foo", transition: "bar" }; + $.mobile.urlHistory.stack[1] = { url: "baz", transition: "shizam" }; + $.mobile.urlHistory.stack[2] = { url: "shizoo", transition: "shizaah" }; + + //active index + same( $.mobile.urlHistory.activeIndex , 0, "urlHistory.activeIndex is 0" ); + + //getActive + same( $.type( $.mobile.urlHistory.getActive() ) , "object", "active item is an object" ); + same( $.mobile.urlHistory.getActive().url , "foo", "active item has url foo" ); + same( $.mobile.urlHistory.getActive().transition , "bar", "active item has transition bar" ); + + //get prev / next + same( $.mobile.urlHistory.getPrev(), undefined, "urlHistory.getPrev() is undefined when active index is 0" ); + $.mobile.urlHistory.activeIndex = 1; + same( $.mobile.urlHistory.getPrev().url, "foo", "urlHistory.getPrev() has url foo when active index is 1" ); + $.mobile.urlHistory.activeIndex = 0; + same( $.mobile.urlHistory.getNext().url, "baz", "urlHistory.getNext() has url baz when active index is 0" ); + + //add new + $.mobile.urlHistory.activeIndex = 2; + $.mobile.urlHistory.addNew("test"); + same( $.mobile.urlHistory.stack.length, 4, "urlHistory.addNew() adds an item after the active index" ); + same( $.mobile.urlHistory.activeIndex, 3, "urlHistory.addNew() moves the activeIndex to the newly added item" ); + + //clearForward + $.mobile.urlHistory.activeIndex = 0; + $.mobile.urlHistory.clearForward(); + same( $.mobile.urlHistory.stack.length, 1, "urlHistory.clearForward() clears the url stack after the active index" ); + }); + + //url listening + function testListening( prop ){ + var stillListening = false; + $(document).bind("pagebeforehide", function(){ + stillListening = true; + }); + location.hash = "foozball"; + setTimeout(function(){ + ok( prop == stillListening, prop + " = false disables default hashchange event handler"); + location.hash = ""; + prop = true; + start(); + }, 1000); + } + + asyncTest( "ability to disable our hash change event listening internally", function(){ + testListening( ! $.mobile.urlHistory.ignoreNextHashChange ); + }); + + asyncTest( "ability to disable our hash change event listening globally", function(){ + testListening( $.mobile.hashListeningEnabled ); + }); + + var testDataUrlHash = function( linkSelector, matches ) { + $.testHelper.pageSequence([ + function(){ window.location.hash = ""; }, + function(){ $(linkSelector).click(); }, + function(){ + $.testHelper.assertUrlLocation( + $.extend(matches, { + report: "url or hash should match" + }) + ); + + start(); + } + ]); + + stop(); + }; + + test( "when loading a page where data-url is not defined on a sub element hash defaults to the url", function(){ + testDataUrlHash( "#non-data-url a", {hashOrPush: siteDirectory + "data-url-tests/non-data-url.html"} ); + }); + + test( "data url works for nested paths", function(){ + var url = "foo/bar.html"; + testDataUrlHash( "#nested-data-url a", {hash: url, push: home + url} ); + }); + + test( "data url works for single quoted paths and roles", function(){ + var url = "foo/bar/single.html"; + testDataUrlHash( "#single-quotes-data-url a", {hash: url, push: home + url} ); + }); + + test( "data url works when role and url are reversed on the page element", function(){ + var url = "foo/bar/reverse.html"; + testDataUrlHash( "#reverse-attr-data-url a", {hash: url, push: home + url} ); + }); + + asyncTest( "last entry choosen amongst multiple identical url history stack entries on hash change", function(){ + // make sure the stack is clear after initial page load an any other delayed page loads + // TODO better browser state management + $.mobile.urlHistory.stack = []; + $.mobile.urlHistory.activeIndex = 0; + + $.testHelper.pageSequence([ + function(){ $.testHelper.openPage("#dup-history-first"); }, + function(){ $("#dup-history-first a").click(); }, + function(){ $("#dup-history-second a:first").click(); }, + function(){ $("#dup-history-first a").click(); }, + function(){ $("#dup-history-second a:last").click(); }, + function(){ $("#dup-history-dialog a:contains('Close')").click(); }, + function(){ + + // fourth page (third index) in the stack to account for first page being hash manipulation, + // the third page is dup-history-second which has two entries in history + // the test is to make sure the index isn't 1 in this case, or the first entry for dup-history-second + same($.mobile.urlHistory.activeIndex, 3, "should be the fourth page in the stack"); + start(); + }]); + }); + + asyncTest( "going back from a page entered from a dialog skips the dialog and goes to the previous page", function(){ + $.testHelper.pageSequence([ + // setup + function(){ $.testHelper.openPage("#skip-dialog-first"); }, + + // transition to the dialog + function(){ $("#skip-dialog-first a").click(); }, + + // transition to the second page + function(){ $("#skip-dialog a").click(); }, + + // transition past the dialog via data-rel=back link on the second page + function(){ $("#skip-dialog-second a").click(); }, + + // make sure we're at the first page and not the dialog + function(){ + $.testHelper.assertUrlLocation({ + hash: "skip-dialog-first", + push: homeWithSearch + "#skip-dialog-first", + report: "should be the first page in the sequence" + }); + + start(); + }]); + }); + + asyncTest( "going forward from a page entered from a dialog skips the dialog and goes to the next page", function(){ + $.testHelper.pageSequence([ + // setup + function(){ $.testHelper.openPage("#skip-dialog-first"); }, + + // transition to the dialog + function(){ $("#skip-dialog-first a").click(); }, + + // transition to the second page + function(){ $("#skip-dialog a").click(); }, + + // transition to back past the dialog + function(){ window.history.back(); }, + + // transition to the second page past the dialog through history + function(){ window.history.forward(); }, + + // make sure we're on the second page and not the dialog + function(){ + $.testHelper.assertUrlLocation({ + hash: "skip-dialog-second", + push: homeWithSearch + "#skip-dialog-second", + report: "should be the second page after the dialog" + }); + + start(); + }]); + }); + + asyncTest( "going back from a dialog triggered from a dialog should result in the first dialog ", function(){ + $.testHelper.pageSequence([ + // setup + function(){ $.testHelper.openPage("#nested-dialog-page"); }, + + // transition to the dialog + function(){ $("#nested-dialog-page a").click(); }, + + // transition to the second dialog + function(){ $("#nested-dialog-first a").click(); }, + + // transition to back to the first dialog + function(){ window.history.back(); }, + + // make sure we're on first dialog + function(){ + same($(".ui-page-active")[0], $("#nested-dialog-first")[0], "should be the first dialog"); + start(); + }]); + }); + + asyncTest( "loading a relative file path after an embeded page works", function(){ + $.testHelper.pageSequence([ + // transition second page + function(){ $.testHelper.openPage("#relative-after-embeded-page-first"); }, + + // transition second page + function(){ $("#relative-after-embeded-page-first a").click(); }, + + // transition to the relative ajax loaded page + function(){ $("#relative-after-embeded-page-second a").click(); }, + + // make sure the page was loaded properly via ajax + function(){ + // data attribute intentionally left without namespace + same($(".ui-page-active").data("other"), "for testing", "should be relative ajax loaded page"); + start(); + }]); + }); + + asyncTest( "Page title updates properly when clicking back to previous page", function(){ + $.testHelper.pageSequence([ + function(){ + $.testHelper.openPage("#relative-after-embeded-page-first"); + }, + + function(){ + window.history.back(); + }, + + function(){ + same(document.title, "jQuery Mobile Navigation Test Suite"); + start(); + } + ]); + }); + + asyncTest( "Page title updates properly when clicking a link back to first page", function(){ + var title = document.title; + + $.testHelper.pageSequence([ + function(){ + $.testHelper.openPage("#ajax-title-page"); + }, + + function(){ + $("#titletest1").click(); + }, + + function(){ + same(document.title, "Title Tag"); + $.mobile.activePage.find("#title-check-link").click(); + }, + + function(){ + same(document.title, title); + start(); + } + ]); + }); + + asyncTest( "Page title updates properly from title tag when loading an external page", function(){ + $.testHelper.pageSequence([ + function(){ + $.testHelper.openPage("#ajax-title-page"); + }, + + function(){ + $("#titletest1").click(); + }, + + function(){ + same(document.title, "Title Tag"); + start(); + } + ]); + }); + + asyncTest( "Page title updates properly from data-title attr when loading an external page", function(){ + $.testHelper.pageSequence([ + function(){ + $.testHelper.openPage("#ajax-title-page"); + }, + + function(){ + $("#titletest2").click(); + }, + + function(){ + same(document.title, "Title Attr"); + start(); + } + ]); + }); + + asyncTest( "Page title updates properly from heading text in header when loading an external page", function(){ + $.testHelper.pageSequence([ + function(){ + $.testHelper.openPage("#ajax-title-page"); + }, + + function(){ + $("#titletest3").click(); + }, + + function(){ + same(document.title, "Title Heading"); + start(); + } + ]); + }); + + asyncTest( "Page links to the current active page result in the same active page", function(){ + $.testHelper.pageSequence([ + function(){ + $.testHelper.openPage("#self-link"); + }, + + function(){ + $("a[href='#self-link']").click(); + }, + + function(){ + same($.mobile.activePage[0], $("#self-link")[0], "self-link page is still the active page" ); + start(); + } + ]); + }); + + asyncTest( "links on subdirectory pages with query params append the params and load the page", function(){ + $.testHelper.pageSequence([ + function(){ + $.testHelper.openPage("#data-url-tests/non-data-url.html"); + }, + + function(){ + $("#query-param-anchor").click(); + }, + + function(){ + $.testHelper.assertUrlLocation({ + hashOrPush: home + "data-url-tests/non-data-url.html?foo=bar", + report: "the hash or url has query params" + }); + + ok($(".ui-page-active").jqmData("url").indexOf("?foo=bar") > -1, "the query params are in the data url"); + start(); + } + ]); + }); + + asyncTest( "identical query param link doesn't add additional set of query params", function(){ + $.testHelper.pageSequence([ + function(){ + $.testHelper.openPage("#data-url-tests/non-data-url.html"); + }, + + function(){ + $("#query-param-anchor").click(); + }, + + function(){ + $.testHelper.assertUrlLocation({ + hashOrPush: home + "data-url-tests/non-data-url.html?foo=bar", + report: "the hash or url has query params" + }); + + $("#query-param-anchor").click(); + }, + + function(){ + $.testHelper.assertUrlLocation({ + hashOrPush: home + "data-url-tests/non-data-url.html?foo=bar", + report: "the hash or url still has query params" + }); + + start(); + } + ]); + }); + + // Special handling inside navigation because query params must be applied to the hash + // or absolute reference and dialogs apply extra information int the hash that must be removed + asyncTest( "query param link from a dialog to itself should be a not add another dialog", function(){ + var firstDialogLoc; + + $.testHelper.pageSequence([ + // open our test page + function(){ + $.testHelper.openPage("#dialog-param-link"); + }, + + // navigate to the subdirectory page with the query link + function(){ + $("#dialog-param-link a").click(); + }, + + // navigate to the query param self reference link + function(){ + $("#dialog-param-link-page a").click(); + }, + + // attempt to navigate to the same link + function(){ + // store the current hash for comparison (with one dialog hash key) + firstDialogLoc = location.hash || location.href; + $("#dialog-param-link-page a").click(); + }, + + function(){ + same(location.hash || location.href, firstDialogLoc, "additional dialog hash key not added"); + start(); + } + ]); + }); + + asyncTest( "query data passed as string to changePage is appended to URL", function(){ + $.testHelper.pageSequence([ + // open our test page + function(){ + $.mobile.changePage( "form-tests/changepage-data.html", { + data: "foo=1&bar=2" + } ); + }, + + function(){ + $.testHelper.assertUrlLocation({ + hashOrPush: home + "form-tests/changepage-data.html?foo=1&bar=2", + report: "the hash or url still has query params" + }); + + start(); + } + ]); + }); + + asyncTest( "query data passed as object to changePage is appended to URL", function(){ + $.testHelper.pageSequence([ + // open our test page + function(){ + $.mobile.changePage( "form-tests/changepage-data.html", { + data: { + foo: 3, + bar: 4 + } + } ); + }, + + function(){ + $.testHelper.assertUrlLocation({ + hashOrPush: home + "form-tests/changepage-data.html?foo=3&bar=4", + report: "the hash or url still has query params" + }); + + start(); + } + ]); + }); + + asyncTest( "refresh of a dialog url should not duplicate page", function(){ + $.testHelper.pageSequence([ + // open our test page + function(){ + same($(".foo-class").length, 1, "should only have one instance of foo-class in the document"); + location.hash = "#foo&ui-state=dialog"; + }, + + function(){ + $.testHelper.assertUrlLocation({ + hash: "foo&ui-state=dialog", + push: homeWithSearch + "#foo&ui-state=dialog", + report: "hash should match what was loaded" + }); + + same( $(".foo-class").length, 1, "should only have one instance of foo-class in the document" ); + start(); + } + ]); + }); + + asyncTest( "internal form with no action submits to document URL", function(){ + $.testHelper.pageSequence([ + // open our test page + function(){ + $.testHelper.openPage("#internal-no-action-form-page"); + }, + + function(){ + $("#internal-no-action-form-page form").eq(0).submit(); + }, + + function(){ + $.testHelper.assertUrlLocation({ + hashOrPush: home + "?foo=1&bar=2", + report: "hash should match what was loaded" + }); + + start(); + } + ]); + }); + + asyncTest( "external page containing form with no action submits to page URL", function(){ + $.testHelper.pageSequence([ + // open our test page + function(){ + $.testHelper.openPage("#internal-no-action-form-page"); + }, + + function(){ + $("#internal-no-action-form-page a").eq(0).click(); + }, + + function(){ + $("#external-form-no-action-page form").eq(0).submit(); + }, + + function(){ + $.testHelper.assertUrlLocation({ + hashOrPush: home + "form-tests/form-no-action.html?foo=1&bar=2", + report: "hash should match page url and not document url" + }); + + start(); + } + ]); + }); + + asyncTest( "handling of active button state when navigating", 1, function(){ + + $.testHelper.pageSequence([ + // open our test page + function(){ + $.testHelper.openPage("#active-state-page1"); + }, + + function(){ + $("#active-state-page1 a").eq(0).click(); + }, + + function(){ + $("#active-state-page2 a").eq(0).click(); + }, + + function(){ + ok(!$("#active-state-page1 a").hasClass( $.mobile.activeBtnClass ), "No button should not have class " + $.mobile.activeBtnClass ); + start(); + } + ]); + }); + + // issue 2444 https://github.com/jquery/jquery-mobile/issues/2444 + // results from preventing spurious hash changes + asyncTest( "dialog should return to its parent page when open and closed multiple times", function() { + $.testHelper.pageSequence([ + // open our test page + function(){ + $.testHelper.openPage("#default-trans-dialog"); + }, + + function(){ + $.mobile.activePage.find( "a" ).click(); + }, + + function(){ + window.history.back(); + }, + + function(){ + same( $.mobile.activePage[0], $( "#default-trans-dialog" )[0] ); + $.mobile.activePage.find( "a" ).click(); + }, + + function(){ + window.history.back(); + }, + + function(){ + same( $.mobile.activePage[0], $( "#default-trans-dialog" )[0] ); + start(); + } + ]); + }); + + asyncTest( "clicks with middle mouse button are ignored", function() { + $.testHelper.pageSequence([ + function() { + $.testHelper.openPage( "#odd-clicks-page" ); + }, + + function() { + $( "#right-or-middle-click" ).click(); + }, + + // make sure the page is opening first without the mocked button click value + // only necessary to prevent issues with test specific fixtures + function() { + same($.mobile.activePage[0], $("#odd-clicks-page-dest")[0]); + $.testHelper.openPage( "#odd-clicks-page" ); + + // mock the which value to simulate a middle click + $.Event.prototype.which = 2; + }, + + function() { + $( "#right-or-middle-click" ).click(); + }, + + function( timeout ) { + ok( timeout, "page event handler timed out due to ignored click" ); + ok($.mobile.activePage[0] !== $("#odd-clicks-page-dest")[0], "pages are not the same"); + start(); + } + ]); + }); + + asyncTest( "disabling link binding disables navigation via links and highlighting", function() { + $.mobile.linkBindingEnabled = false; + + $.testHelper.pageSequence([ + function() { + $.testHelper.openPage("#bar"); + }, + + function() { + $.mobile.activePage.find( "a" ).click(); + }, + + function( timeout ) { + ok( !$.mobile.activePage.find( "a" ).hasClass( $.mobile.activeBtnClass ), "vlick handler doesn't add the activebtn class" ); + ok( timeout, "no page change was fired" ); + start(); + } + ]); + }); + + asyncTest( "handling of button active state when navigating by clicking back button", 1, function(){ + $.testHelper.pageSequence([ + // open our test page + function(){ + $.testHelper.openPage("#active-state-page1"); + }, + + function(){ + $("#active-state-page1 a").eq(0).click(); + }, + + function(){ + $("#active-state-page2 a").eq(1).click(); + }, + + function(){ + $("#active-state-page1 a").eq(0).click(); + }, + + function(){ + ok(!$("#active-state-page2 a").hasClass( $.mobile.activeBtnClass ), "No button should not have class " + $.mobile.activeBtnClass ); + start(); + } + ]); + }); + + asyncTest( "can navigate to dynamically injected page with dynamically injected link", function(){ + $.testHelper.pageSequence([ + // open our test page + function(){ + $.testHelper.openPage("#inject-links-page"); + }, + + function(){ + var $ilpage = $( "#inject-links-page" ), + $link = $( "injected-test-page link" ); + + // Make sure we actually navigated to the expected page. + ok( $.mobile.activePage[ 0 ] == $ilpage[ 0 ], "navigated successfully to #inject-links-page" ); + + // Now dynamically insert a page. + $ilpage.parent().append( "
        testing...
        " ); + + // Now inject a link to this page dynamically and attempt to navigate + // to the page we just inserted. + $link.appendTo( $ilpage ).click(); + }, + + function(){ + // Make sure we actually navigated to the expected page. + ok( $.mobile.activePage[ 0 ] == $( "#injected-test-page" )[ 0 ], "navigated successfully to #injected-test-page" ); + + start(); + } + ]); + }); + + asyncTest( "application url with dialogHashKey loads application's first page", function(){ + $.testHelper.pageSequence([ + // open our test page + function(){ + // Navigate to any page except the first page of the application. + $.testHelper.openPage("#foo"); + }, + + function(){ + ok( $.mobile.activePage[ 0 ] === $( "#foo" )[ 0 ], "navigated successfully to #foo" ); + + // Now navigate to an hash that contains just a dialogHashKey. + $.mobile.changePage("#" + $.mobile.dialogHashKey); + }, + + function(){ + // Make sure we actually navigated to the first page. + ok( $.mobile.activePage[ 0 ] === $.mobile.firstPage[ 0 ], "navigated successfully to first-page" ); + + // Now make sure opening the page didn't result in page duplication. + ok( $.mobile.firstPage.hasClass( "first-page" ), "first page has expected class" ); + same( $( ".first-page" ).length, 1, "first page was not duplicated" ); + + start(); + } + ]); + }); + + asyncTest( "navigate to non-existent internal page throws pagechangefailed", function(){ + var pagechangefailed = false, + pageChangeFailedCB = function( e ) { + pagechangefailed = true; + } + + $( document ).bind( "pagechangefailed", pageChangeFailedCB ); + + $.testHelper.pageSequence([ + // open our test page + function(){ + // Make sure there's only one copy of the first-page in the DOM to begin with. + ok( $.mobile.firstPage.hasClass( "first-page" ), "first page has expected class" ); + same( $( ".first-page" ).length, 1, "first page was not duplicated" ); + + // Navigate to any page except the first page of the application. + $.testHelper.openPage("#foo"); + }, + + function(){ + var $foo = $( "#foo" ); + ok( $.mobile.activePage[ 0 ] === $foo[ 0 ], "navigated successfully to #foo" ); + same( pagechangefailed, false, "no page change failures" ); + + // Now navigate to a non-existent page. + $foo.find( "#bad-internal-page-link" ).click(); + }, + + function(){ + // Make sure a pagechangefailed event was triggered. + same( pagechangefailed, true, "pagechangefailed dispatched" ); + + // Make sure we didn't navigate away from #foo. + ok( $.mobile.activePage[ 0 ] === $( "#foo" )[ 0 ], "did not navigate away from #foo" ); + + // Now make sure opening the page didn't result in page duplication. + same( $( ".first-page" ).length, 1, "first page was not duplicated" ); + + $( document ).unbind( "pagechangefailed", pageChangeFailedCB ); + + start(); + } + ]); + }); + + asyncTest( "prefetched links with data rel dialog result in a dialog", function() { + $.testHelper.pageSequence([ + // open our test page + function(){ + // Navigate to any page except the first page of the application. + $.testHelper.openPage("#prefetched-dialog-page"); + }, + + function() { + $("#prefetched-dialog-link").click(); + }, + + function() { + ok( $.mobile.activePage.is(".ui-dialog"), "prefetched page is rendered as a dialog" ); + start(); + } + ]); + }); + + asyncTest( "first page gets reloaded if pruned from the DOM", function(){ + var hideCallbackTriggered = false; + + function hideCallback( e, data ) + { + var page = e.target; + ok( ( page === $.mobile.firstPage[ 0 ] ), "hide called with prevPage set to firstPage"); + if ( page === $.mobile.firstPage[ 0 ] ) { + $( page ).remove(); + } + hideCallbackTriggered = true; + } + + $(document).bind('pagehide', hideCallback); + + $.testHelper.pageSequence([ + function(){ + // Make sure the first page is actually in the DOM. + ok( $.mobile.firstPage.parent().length !== 0, "first page is currently in the DOM" ); + + // Make sure the first page is the active page. + ok( $.mobile.activePage[ 0 ] === $.mobile.firstPage[ 0 ], "first page is the active page" ); + + // Now make sure the first page has an id that we can use to reload it. + ok( $.mobile.firstPage[ 0 ].id, "first page has an id" ); + + // Make sure there is only one first page in the DOM. + same( $( ".first-page" ).length, 1, "only one instance of the first page in the DOM" ); + + // Navigate to any page except the first page of the application. + $.testHelper.openPage("#foo"); + }, + + function(){ + // Make sure the active page is #foo. + ok( $.mobile.activePage[ 0 ] === $( "#foo" )[ 0 ], "navigated successfully to #foo" ); + + // Make sure our hide callback was triggered. + ok( hideCallbackTriggered, "hide callback was triggered" ); + + // Make sure the first page was actually pruned from the document. + ok( $.mobile.firstPage.parent().length === 0, "first page was pruned from the DOM" ); + same( $( ".first-page" ).length, 0, "no instance of the first page in the DOM" ); + + // Remove our hideCallback. + $(document).unbind('pagehide', hideCallback); + + // Navigate back to the first page! + $.testHelper.openPage( "#" + $.mobile.firstPage[0].id ); + }, + + function(){ + var firstPage = $( ".first-page" ); + + // We should only have one first page in the document at any time! + same( firstPage.length, 1, "single instance of first page recreated in the DOM" ); + + // Make sure the first page in the DOM is actually a different DOM element than the original + // one we started with. + ok( $.mobile.firstPage[ 0 ] !== firstPage[ 0 ], "first page is a new DOM element"); + + // Make sure we actually navigated to the new first page. + ok( $.mobile.activePage[ 0 ] === firstPage[ 0 ], "navigated successfully to new first-page"); + + // Reset the $.mobile.firstPage for subsequent tests. + // XXX: Should we just get rid of the new one and restore the old? + $.mobile.firstPage = $.mobile.activePage; + + start(); + } + ]); + }); + + asyncTest( "test that clicks are ignored where data-ajax='false' parents exist", function() { + var $disabledByParent = $( "#unhijacked-link-by-parent" ), + $disabledByAttr = $( "#unhijacked-link-by-attr" ); + + $.mobile.ignoreContentEnabled = true; + + $.testHelper.pageSequence([ + function() { + $.mobile.changePage( "#link-hijacking-test" ); + }, + + function() { + $( "#hijacked-link" ).trigger( 'click' ); + }, + + function() { + ok( $.mobile.activePage.is("#link-hijacking-destination"), "nav works for links to hijacking destination" ); + window.history.back(); + }, + + function() { + $disabledByParent.trigger( 'click' ); + }, + + function() { + ok( $.mobile.activePage.is("#link-hijacking-test"), "click should be ignored keeping the active mobile page the same as before" ); + }, + + function() { + $disabledByAttr.trigger( 'click' ); + }, + + function() { + ok( $.mobile.activePage.is("#link-hijacking-test"), "click should be ignored keeping the active mobile page the same as before" ); + + $.mobile.ignoreContentEnabled = false; + start(); + } + ]); + }); + + asyncTest( "test that *vclicks* are ignored where data-ajax='false' parents exist", function() { + var $disabledByParent = $( "#unhijacked-link-by-parent" ), + $disabledByAttr = $( "#unhijacked-link-by-attr" ), + $hijacked = $( "#hijacked-link" ); + + $.mobile.ignoreContentEnabled = true; + + $.testHelper.pageSequence([ + function() { + $.mobile.changePage( "#link-hijacking-test" ); + }, + + function() { + // force the active button class + $hijacked.addClass( $.mobile.activeBtnClass ); + $hijacked.trigger( 'vclick' ); + ok( $hijacked.hasClass( $.mobile.activeBtnClass ), "active btn class is added to the link per normal" ); + + $disabledByParent.trigger( 'vclick' ); + ok( !$disabledByParent.hasClass( $.mobile.activeBtnClass ), "active button class is never added to the link" ); + + $disabledByAttr.trigger( 'vclick' ); + ok( !$disabledByAttr.hasClass( $.mobile.activeBtnClass ), "active button class is never added to the link" ); + + $.mobile.ignoreContentEnabled = false; + start(); + } + ]); + }); +})(jQuery); diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/navigation_dialog_pushstate.js b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/navigation_dialog_pushstate.js new file mode 100644 index 0000000..a056f64 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/navigation_dialog_pushstate.js @@ -0,0 +1,16 @@ +(function($) { + asyncTest( "dialog ui-state should be part of the hash", function(){ + $.testHelper.sequence([ + function() { + // open the test page + $.mobile.activePage.find( "a" ).click(); + }, + + function() { + // verify that the hash contains the dialogHashKey + ok( location.hash.search($.mobile.dialogHashKey) >= 0 ); + start(); + } + ]); + }); +})(jQuery); \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/navigation_helpers.js b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/navigation_helpers.js new file mode 100644 index 0000000..88533b7 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/navigation_helpers.js @@ -0,0 +1,218 @@ +/* + * mobile navigation unit tests + */ +(function($){ + var siteDirectory = location.pathname.replace(/[^/]+$/, ""); + + module('jquery.mobile.navigation.js', { + setup: function(){ + if ( location.hash ) { + stop(); + $(document).one("pagechange", function() { + start(); + } ); + location.hash = ""; + } + } + }); + + test( "path.get method is working properly", function(){ + window.location.hash = "foo"; + same($.mobile.path.get(), "foo", "get method returns location.hash minus hash character"); + same($.mobile.path.get( "#foo/bar/baz.html" ), "foo/bar/", "get method with hash arg returns path with no filename or hash prefix"); + same($.mobile.path.get( "#foo/bar/baz.html/" ), "foo/bar/baz.html/", "last segment of hash is retained if followed by a trailing slash"); + }); + + test( "path.isPath method is working properly", function(){ + ok(!$.mobile.path.isPath('bar'), "anything without a slash is not a path"); + ok($.mobile.path.isPath('bar/'), "anything with a slash is a path"); + ok($.mobile.path.isPath('/bar'), "anything with a slash is a path"); + ok($.mobile.path.isPath('a/r'), "anything with a slash is a path"); + ok($.mobile.path.isPath('/'), "anything with a slash is a path"); + }); + + test( "path.getFilePath method is working properly", function(){ + same($.mobile.path.getFilePath("foo.html" + "&" + $.mobile.subPageUrlKey ), "foo.html", "returns path without sub page key"); + }); + + test( "path.set method is working properly", function(){ + $.mobile.urlHistory.ignoreNextHashChange = false; + $.mobile.path.set("foo"); + same("foo", window.location.hash.replace(/^#/,""), "sets location.hash properly"); + }); + + test( "path.makeUrlAbsolute is working properly", function(){ + var mua = $.mobile.path.makeUrlAbsolute, + p1 = "http://jqm.com/", + p2 = "http://jqm.com/?foo=1&bar=2", + p3 = "http://jqm.com/#spaz", + p4 = "http://jqm.com/?foo=1&bar=2#spaz", + + p5 = "http://jqm.com/test.php", + p6 = "http://jqm.com/test.php?foo=1&bar=2", + p7 = "http://jqm.com/test.php#spaz", + p8 = "http://jqm.com/test.php?foo=1&bar=2#spaz", + + p9 = "http://jqm.com/dir1/dir2/", + p10 = "http://jqm.com/dir1/dir2/?foo=1&bar=2", + p11 = "http://jqm.com/dir1/dir2/#spaz", + p12 = "http://jqm.com/dir1/dir2/?foo=1&bar=2#spaz", + + p13 = "http://jqm.com/dir1/dir2/test.php", + p14 = "http://jqm.com/dir1/dir2/test.php?foo=1&bar=2", + p15 = "http://jqm.com/dir1/dir2/test.php#spaz", + p16 = "http://jqm.com/dir1/dir2/test.php?foo=1&bar=2#spaz"; + + // Test URL conversion against an absolute URL to the site root. + // directory tests + same( mua( "http://jqm.com/", p1 ), "http://jqm.com/", "absolute root - absolute root" ); + same( mua( "//jqm.com/", p1 ), "http://jqm.com/", "protocol relative root - absolute root" ); + same( mua( "/", p1 ), "http://jqm.com/", "site relative root - absolute root" ); + + same( mua( "http://jqm.com/?foo=1&bar=2", p1 ), "http://jqm.com/?foo=1&bar=2", "absolute root with query - absolute root" ); + same( mua( "//jqm.com/?foo=1&bar=2", p1 ), "http://jqm.com/?foo=1&bar=2", "protocol relative root with query - absolute root" ); + same( mua( "/?foo=1&bar=2", p1 ), "http://jqm.com/?foo=1&bar=2", "site relative root with query - absolute root" ); + same( mua( "?foo=1&bar=2", p1 ), "http://jqm.com/?foo=1&bar=2", "query relative - absolute root" ); + + same( mua( "http://jqm.com/#spaz", p1 ), "http://jqm.com/#spaz", "absolute root with fragment - absolute root" ); + same( mua( "//jqm.com/#spaz", p1 ), "http://jqm.com/#spaz", "protocol relative root with fragment - absolute root" ); + same( mua( "/#spaz", p1 ), "http://jqm.com/#spaz", "site relative root with fragment - absolute root" ); + same( mua( "#spaz", p1 ), "http://jqm.com/#spaz", "fragment relative - absolute root" ); + + same( mua( "http://jqm.com/?foo=1&bar=2#spaz", p1 ), "http://jqm.com/?foo=1&bar=2#spaz", "absolute root with query and fragment - absolute root" ); + same( mua( "//jqm.com/?foo=1&bar=2#spaz", p1 ), "http://jqm.com/?foo=1&bar=2#spaz", "protocol relative root with query and fragment - absolute root" ); + same( mua( "/?foo=1&bar=2#spaz", p1 ), "http://jqm.com/?foo=1&bar=2#spaz", "site relative root with query and fragment - absolute root" ); + same( mua( "?foo=1&bar=2#spaz", p1 ), "http://jqm.com/?foo=1&bar=2#spaz", "query relative and fragment - absolute root" ); + + // file tests + same( mua( "http://jqm.com/test.php", p1 ), "http://jqm.com/test.php", "absolute file at root - absolute root" ); + same( mua( "//jqm.com/test.php", p1 ), "http://jqm.com/test.php", "protocol relative file at root - absolute root" ); + same( mua( "/test.php", p1 ), "http://jqm.com/test.php", "site relative file at root - absolute root" ); + same( mua( "test.php", p1 ), "http://jqm.com/test.php", "document relative file at root - absolute root" ); + + same( mua( "http://jqm.com/test.php?foo=1&bar=2", p1 ), "http://jqm.com/test.php?foo=1&bar=2", "absolute file at root with query - absolute root" ); + same( mua( "//jqm.com/test.php?foo=1&bar=2", p1 ), "http://jqm.com/test.php?foo=1&bar=2", "protocol relative file at root with query - absolute root" ); + same( mua( "/test.php?foo=1&bar=2", p1 ), "http://jqm.com/test.php?foo=1&bar=2", "site relative file at root with query - absolute root" ); + same( mua( "test.php?foo=1&bar=2", p1 ), "http://jqm.com/test.php?foo=1&bar=2", "document relative file at root with query - absolute root" ); + + same( mua( "http://jqm.com/test.php#spaz", p1 ), "http://jqm.com/test.php#spaz", "absolute file at root with fragment - absolute root" ); + same( mua( "//jqm.com/test.php#spaz", p1 ), "http://jqm.com/test.php#spaz", "protocol relative file at root with fragment - absolute root" ); + same( mua( "/test.php#spaz", p1 ), "http://jqm.com/test.php#spaz", "site relative file at root with fragment - absolute root" ); + same( mua( "test.php#spaz", p1 ), "http://jqm.com/test.php#spaz", "file at root with fragment - absolute root" ); + + same( mua( "http://jqm.com/test.php?foo=1&bar=2#spaz", p1 ), "http://jqm.com/test.php?foo=1&bar=2#spaz", "absolute file at root with query and fragment - absolute root" ); + same( mua( "//jqm.com/test.php?foo=1&bar=2#spaz", p1 ), "http://jqm.com/test.php?foo=1&bar=2#spaz", "protocol relative file at root with query and fragment - absolute root" ); + same( mua( "/test.php?foo=1&bar=2#spaz", p1 ), "http://jqm.com/test.php?foo=1&bar=2#spaz", "site relative file at root with query and fragment - absolute root" ); + same( mua( "test.php?foo=1&bar=2#spaz", p1 ), "http://jqm.com/test.php?foo=1&bar=2#spaz", "query relative file at root fragment - absolute root" ); + + // Test URL conversion against an absolute URL to a file at the site root. + + same( mua( "http://jqm.com/", p5 ), "http://jqm.com/", "absolute root - absolute root" ); + same( mua( "//jqm.com/", p5 ), "http://jqm.com/", "protocol relative root - absolute root" ); + same( mua( "/", p5 ), "http://jqm.com/", "site relative root - absolute root" ); + + same( mua( "http://jqm.com/?foo=1&bar=2", p5 ), "http://jqm.com/?foo=1&bar=2", "absolute root with query - absolute root" ); + same( mua( "//jqm.com/?foo=1&bar=2", p5 ), "http://jqm.com/?foo=1&bar=2", "protocol relative root with query - absolute root" ); + same( mua( "/?foo=1&bar=2", p5 ), "http://jqm.com/?foo=1&bar=2", "site relative root with query - absolute root" ); + same( mua( "?foo=1&bar=2", p5 ), "http://jqm.com/test.php?foo=1&bar=2", "query relative - absolute root" ); + + same( mua( "http://jqm.com/#spaz", p5 ), "http://jqm.com/#spaz", "absolute root with fragment - absolute root" ); + same( mua( "//jqm.com/#spaz", p5 ), "http://jqm.com/#spaz", "protocol relative root with fragment - absolute root" ); + same( mua( "/#spaz", p5 ), "http://jqm.com/#spaz", "site relative root with fragment - absolute root" ); + same( mua( "#spaz", p5 ), "http://jqm.com/test.php#spaz", "fragment relative - absolute root" ); + + same( mua( "http://jqm.com/?foo=1&bar=2#spaz", p5 ), "http://jqm.com/?foo=1&bar=2#spaz", "absolute root with query and fragment - absolute root" ); + same( mua( "//jqm.com/?foo=1&bar=2#spaz", p5 ), "http://jqm.com/?foo=1&bar=2#spaz", "protocol relative root with query and fragment - absolute root" ); + same( mua( "/?foo=1&bar=2#spaz", p5 ), "http://jqm.com/?foo=1&bar=2#spaz", "site relative root with query and fragment - absolute root" ); + same( mua( "?foo=1&bar=2#spaz", p5 ), "http://jqm.com/test.php?foo=1&bar=2#spaz", "query relative and fragment - absolute root" ); + }); + + // https://github.com/jquery/jquery-mobile/issues/2362 + test( "ipv6 host support", function(){ + // http://www.ietf.org/rfc/rfc2732.txt ipv6 examples for tests + // most definitely not comprehensive + var ipv6_1 = "http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html", + ipv6_2 = "http://[1080:0:0:0:8:800:200C:417A]/index.html", + ipv6_3 = "http://[3ffe:2a00:100:7031::1]", + ipv6_4 = "http://[1080::8:800:200C:417A]/foo", + ipv6_5 = "http://[::192.9.5.5]/ipng", + ipv6_6 = "http://[::FFFF:129.144.52.38]:80/index.html", + ipv6_7 = "http://[2010:836B:4179::836B:4179]", + fromIssue = "http://[3fff:cafe:babe::]:443/foo"; + + same( $.mobile.path.parseUrl(ipv6_1).host, "[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80"); + same( $.mobile.path.parseUrl(ipv6_1).hostname, "[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]"); + same( $.mobile.path.parseUrl(ipv6_2).host, "[1080:0:0:0:8:800:200C:417A]"); + same( $.mobile.path.parseUrl(ipv6_3).host, "[3ffe:2a00:100:7031::1]"); + same( $.mobile.path.parseUrl(ipv6_4).host, "[1080::8:800:200C:417A]"); + same( $.mobile.path.parseUrl(ipv6_5).host, "[::192.9.5.5]"); + same( $.mobile.path.parseUrl(ipv6_6).host, "[::FFFF:129.144.52.38]:80"); + same( $.mobile.path.parseUrl(ipv6_6).hostname, "[::FFFF:129.144.52.38]"); + same( $.mobile.path.parseUrl(ipv6_7).host, "[2010:836B:4179::836B:4179]"); + same( $.mobile.path.parseUrl(fromIssue).host, "[3fff:cafe:babe::]:443"); + same( $.mobile.path.parseUrl(fromIssue).hostname, "[3fff:cafe:babe::]"); + }); + + test( "path.clean is working properly", function(){ + var localroot = location.protocol + "//" + location.host + location.pathname, + remoteroot = "http://google.com/", + fakepath = "#foo/bar/baz.html", + pathWithParam = localroot + "bar?baz=" + localroot, + localpath = localroot + fakepath, + remotepath = remoteroot + fakepath; + + same( $.mobile.path.clean( localpath ), location.pathname + fakepath, "removes location protocol, host, and portfrom same-domain path"); + same( $.mobile.path.clean( remotepath ), remotepath, "does nothing to an external domain path"); + same( $.mobile.path.clean( pathWithParam ), location.pathname + "bar?baz=" + localroot, "doesn't remove params with localroot value"); + }); + + test( "path.stripHash is working properly", function(){ + same( $.mobile.path.stripHash( "#bar" ), "bar", "returns a hash without the # prefix"); + }); + + test( "path.hasProtocol is working properly", function(){ + same( $.mobile.path.hasProtocol( "tel:5559999" ), true, "value in tel protocol format has protocol" ); + same( $.mobile.path.hasProtocol( location.href ), true, "location href has protocol" ); + same( $.mobile.path.hasProtocol( "foo/bar/baz.html" ), false, "simple directory path has no protocol" ); + same( $.mobile.path.hasProtocol( "file://foo/bar/baz.html" ), true, "simple directory path with file:// has protocol" ); + }); + + test( "path.isRelativeUrl is working properly", function(){ + same( $.mobile.path.isRelativeUrl("http://company.com/"), false, "absolute url is not relative" ); + same( $.mobile.path.isRelativeUrl("//company.com/"), true, "protocol relative url is relative" ); + same( $.mobile.path.isRelativeUrl("/"), true, "site relative url is relative" ); + + same( $.mobile.path.isRelativeUrl("http://company.com/test.php"), false, "absolute url is not relative" ); + same( $.mobile.path.isRelativeUrl("//company.com/test.php"), true, "protocol relative url is relative" ); + same( $.mobile.path.isRelativeUrl("/test.php"), true, "site relative url is relative" ); + same( $.mobile.path.isRelativeUrl("test.php"), true, "document relative url is relative" ); + + same( $.mobile.path.isRelativeUrl("http://company.com/dir1/dir2/test.php?foo=1&bar=2#frag"), false, "absolute url is not relative" ); + same( $.mobile.path.isRelativeUrl("//company.com/dir1/dir2/test.php?foo=1&bar=2#frag"), true, "protocol relative url is relative" ); + same( $.mobile.path.isRelativeUrl("/dir1/dir2/test.php?foo=1&bar=2#frag"), true, "site relative url is relative" ); + same( $.mobile.path.isRelativeUrl("dir1/dir2/test.php?foo=1&bar=2#frag"), true, "document relative path url is relative" ); + same( $.mobile.path.isRelativeUrl("test.php?foo=1&bar=2#frag"), true, "document relative file url is relative" ); + same( $.mobile.path.isRelativeUrl("?foo=1&bar=2#frag"), true, "query relative url is relative" ); + same( $.mobile.path.isRelativeUrl("#frag"), true, "fragments are relative" ); + }); + + test( "path.isExternal is working properly", function(){ + same( $.mobile.path.isExternal( location.href ), false, "same domain is not external" ); + same( $.mobile.path.isExternal( "http://example.com" ), true, "example.com is external" ); + same($.mobile.path.isExternal("mailto:"), true, "mailto protocol"); + same($.mobile.path.isExternal("http://foo.com"), true, "http protocol"); + same($.mobile.path.isExternal("http://www.foo.com"), true, "http protocol with www"); + same($.mobile.path.isExternal("tel:16178675309"), true, "tel protocol"); + same($.mobile.path.isExternal("foo.html"), false, "filename"); + same($.mobile.path.isExternal("foo/foo/foo.html"), false, "file path"); + same($.mobile.path.isExternal("../../index.html"), false, "relative parent path"); + same($.mobile.path.isExternal("/foo"), false, "root-relative path"); + same($.mobile.path.isExternal("foo"), false, "simple string"); + same($.mobile.path.isExternal("#foo"), false, "local id reference"); + }); + + test( "path.cleanHash", function(){ + same( $.mobile.path.cleanHash( "#anything/atall?akjfdjjf" ), "anything/atall", "removes query param"); + same( $.mobile.path.cleanHash( "#nothing/atall" ), "nothing/atall", "removes query param"); + }); +})(jQuery); \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/navigation_paths.js b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/navigation_paths.js new file mode 100644 index 0000000..017a943 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/navigation_paths.js @@ -0,0 +1,178 @@ +/* + * mobile navigation path unit tests + */ +(function($){ + var url = $.mobile.path.parseUrl( location.href ), + home = location.href.replace( url.domain, "" ); + + var testPageLoad = function(testPageAnchorSelector, expectedTextValue){ + expect( 2 ); + + $.testHelper.pageSequence([ + function(){ + // reset before each test, all tests expect original page + // for relative urls + $.testHelper.openPage( "#" + home); + }, + + // open our test page + function(){ + $.testHelper.openPage("#pathing-tests"); + }, + + // navigate to the linked page + function(){ + var page = $.mobile.activePage; + + // check that the reset page isn't still open + equal("", page.find(".reset-value").text()); + + //click he test page link to execute the path + page.find("a" + testPageAnchorSelector).click(); + }, + + // verify that the page has changed and the expected text value is present + function(){ + same($.mobile.activePage.find(".test-value").text(), expectedTextValue); + start(); + } + ]); + }; + + // all of these alterations assume location.pathname will be a directory + // this is required to prevent the tests breaking in a subdirectory + // TODO could potentially be fragile since the tests could be running while + // the urls are being updated + $(function(){ + $("a.site-rel").each(function(i, elem){ + var $elem = $(elem); + $elem.attr("href", location.pathname + $(elem).attr("href")); + }); + + $('a.protocol-rel').each(function(i, elem){ + var $elem = $(elem); + $elem.attr("href", "//" + location.host + location.pathname + $(elem).attr("href")); + }); + + $('a.absolute').each(function(i, elem){ + var $elem = $(elem); + $elem.attr("href", + location.protocol + "//" + location.host + + location.pathname + $(elem).attr("href")); + }); + }); + + + //Doc relative tests + module("document relative paths"); + + asyncTest( "file reference no nesting", function(){ + testPageLoad("#doc-rel-test-one", "doc rel test one"); + }); + + asyncTest( "file reference with nesting", function(){ + testPageLoad("#doc-rel-test-two", "doc rel test two"); + }); + + asyncTest( "file reference with double nesting", function(){ + testPageLoad("#doc-rel-test-three", "doc rel test three"); + }); + + asyncTest( "dir refrence with nesting", function(){ + testPageLoad("#doc-rel-test-four", "doc rel test four"); + }); + + asyncTest( "file refrence with parent dir", function(){ + testPageLoad("#doc-rel-test-five", "doc rel test five"); + }); + + asyncTest( "dir refrence with parent dir", function(){ + testPageLoad("#doc-rel-test-six", "doc rel test six"); + }); + + + // Site relative tests + // NOTE does not test root path or non nested references + module("site relative paths"); + + asyncTest( "file reference no nesting", function(){ + testPageLoad("#site-rel-test-one", "doc rel test one"); + }); + + asyncTest( "file reference with nesting", function(){ + testPageLoad("#site-rel-test-two", "doc rel test two"); + }); + + asyncTest( "file reference with double nesting", function(){ + testPageLoad("#site-rel-test-three", "doc rel test three"); + }); + + asyncTest( "dir refrence with nesting", function(){ + testPageLoad("#site-rel-test-four", "doc rel test four"); + }); + + asyncTest( "file refrence with parent dir", function(){ + testPageLoad("#site-rel-test-five", "doc rel test five"); + }); + + asyncTest( "dir refrence with parent dir", function(){ + testPageLoad("#site-rel-test-six", "doc rel test six"); + }); + + + // Protocol relative tests + // NOTE does not test root path or non nested references + module("protocol relative paths"); + + asyncTest( "file reference no nesting", function(){ + testPageLoad("#protocol-rel-test-one", "doc rel test one"); + }); + + asyncTest( "file reference with nesting", function(){ + testPageLoad("#protocol-rel-test-two", "doc rel test two"); + }); + + asyncTest( "file reference with double nesting", function(){ + testPageLoad("#protocol-rel-test-three", "doc rel test three"); + }); + + asyncTest( "dir refrence with nesting", function(){ + testPageLoad("#protocol-rel-test-four", "doc rel test four"); + }); + + asyncTest( "file refrence with parent dir", function(){ + testPageLoad("#protocol-rel-test-five", "doc rel test five"); + }); + + asyncTest( "dir refrence with parent dir", function(){ + testPageLoad("#protocol-rel-test-six", "doc rel test six"); + }); + + // absolute tests + // NOTE does not test root path or non nested references + module("abolute paths"); + + asyncTest( "file reference no nesting", function(){ + testPageLoad("#absolute-test-one", "doc rel test one"); + }); + + asyncTest( "file reference with nesting", function(){ + testPageLoad("#absolute-test-two", "doc rel test two"); + }); + + asyncTest( "file reference with double nesting", function(){ + testPageLoad("#absolute-test-three", "doc rel test three"); + }); + + asyncTest( "dir refrence with nesting", function(){ + testPageLoad("#absolute-test-four", "doc rel test four"); + }); + + asyncTest( "file refrence with parent dir", function(){ + testPageLoad("#absolute-test-five", "doc rel test five"); + }); + + asyncTest( "dir refrence with parent dir", function(){ + testPageLoad("#absolute-test-six", "doc rel test six"); + }); +})(jQuery); \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/navigation_transitions.js b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/navigation_transitions.js new file mode 100644 index 0000000..9b16f0a --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/navigation_transitions.js @@ -0,0 +1,243 @@ +/* + * mobile navigation unit tests + */ +(function($){ + var perspective, + transitioning = "ui-mobile-viewport-transitioning", + animationCompleteFn = $.fn.animationComplete, + defaultMaxTrans = $.mobile.maxTransitionWidth, + + //TODO centralize class names? + transitionTypes = "in out fade slide flip reverse pop", + + isTransitioning = function(page){ + return $.grep(transitionTypes.split(" "), function(className, i){ + return page.hasClass(className); + }).length > 0; + }, + + isTransitioningIn = function(page){ + return page.hasClass("in") && isTransitioning(page); + }, + + disableMaxTransWidth = function(){ + $.mobile.maxTransitionWidth = false; + }, + + enableMaxTransWidth = function(){ + $.mobile.maxTransitionWidth = defaultMaxTrans; + }, + + //animationComplete callback queue + fromQueue = [], + toQueue = [], + + resetQueues = function(){ + fromQueue = []; + toQueue = []; + }, + + onFromComplete = function( f ){ + fromQueue.push( f ); + }, + + onToComplete = function( f ){ + toQueue.push( f ); + }, + + + //wipe all urls + clearUrlHistory = function(){ + $.mobile.urlHistory.stack = []; + $.mobile.urlHistory.activeIndex = 0; + }; + + + if( !$.support.cssTransform3d ) { + perspective = "viewport-fade"; + } else { + perspective = "viewport-flip"; + } + + module('jquery.mobile.navigation.js', { + setup: function(){ + + + // disable this option so we can test transitions regardless of window width + disableMaxTransWidth(); + + //stub to allow callback before function is returned to transition handler + $.fn.animationComplete = function( callback ){ + animationCompleteFn.call( this, function(){ + var queue = $(this).is(".out") ? fromQueue : toQueue; + for( var i = 0, il = queue.length; i < il; i++ ){ + queue.pop()( this ); + } + callback(); + }); + + return this; + }; + + resetQueues(); + clearUrlHistory(); + + if ( location.hash !== "#harmless-default-page" ) { + stop(); + + $(document).one("pagechange", function() { + start(); + } ); + + location.hash = "#harmless-default-page"; + } + }, + + teardown: function(){ + // unmock animation complete + $.fn.animationComplete = animationCompleteFn; + enableMaxTransWidth(); + } + }); + + /* + NOTES: + Our default transition handler now has either one or two animationComplete calls - two if there are two pages in play (from and to) + To is required, so each async function must call start() onToComplete, not onFromComplete. + */ + asyncTest( "changePage applies perspective class to mobile viewport for flip", function(){ + expect(1); + + $.testHelper.pageSequence([ + function() { + $.mobile.changePage("#foo"); + }, + + function() { + onToComplete( function( el ) { + console.log( $("body").attr("class") ); + ok($("body").hasClass(perspective), "has viewport-flip or viewport-fade based on 3d transform"); + start(); + }); + + $("#foo > a").first().click(); + } + ]); + }); + + asyncTest( "changePage applies transition class to mobile viewport for default transition", function(){ + expect(1); + $.testHelper.pageSequence([ + function() { + $.mobile.changePage("#baz"); + }, + + function() { + onToComplete( function( el ){ + ok($("body").hasClass(transitioning), "has transitioning class"); + start(); + }); + + $("#baz > a").click(); + } + ]); + }); + + asyncTest( "explicit transition preferred for page navigation reversal (ie back)", function(){ + expect( 1 ); + + onToComplete(function(){ + $("#flip-trans > a").click(); + onToComplete(function(){ + $("#fade-trans > a").click(); + onToComplete(function(){ + ok($("#flip-trans").hasClass("fade"), "has fade class"); + start(); + }); + }); + }); + + $("#fade-trans > a").click(); + }); + + asyncTest( "default transition is fade", function(){ + onToComplete(function(){ + ok($("#no-trans").hasClass("fade"), "has fade class"); + start(); + }) + + $("#default-trans > a").click(); + }); + + asyncTest( "changePage queues requests", function(){ + expect(4) + var firstPage = $("#foo"), + secondPage = $("#bar"); + + $.mobile.changePage(firstPage); + $.mobile.changePage(secondPage); + + onToComplete(function(){ + ok(isTransitioningIn(firstPage), "first page begins transition"); + ok(!isTransitioningIn(secondPage), "second page doesn't transition yet"); + onToComplete(function(){ + ok(!isTransitioningIn(firstPage), "first page transition should be complete"); + ok(isTransitioningIn(secondPage), "second page should begin transitioning"); + start(); + + }); + }); + }); + + asyncTest( "default transition is pop for a dialog", function(){ + var defaultTransition = "pop"; + + if( !$.support.cssTransform3d ){ + defaultTransition = "fade"; + } + + expect( 1 ); + onToComplete(function(){ + ok( $("#no-trans-dialog").hasClass(defaultTransition), "has pop class" ); + start(); + }); + + $("#default-trans-dialog > a").click(); + }); + + test( "animationComplete return value", function(){ + $.fn.animationComplete = animationCompleteFn; + equals($("#foo").animationComplete(function(){})[0], $("#foo")[0]); + }); + + + // reusable function for a few tests below + function testTransitionMaxWidth( val, expected ){ + expect( 1 ); + + $.mobile.maxTransitionWidth = val; + + var transitionOccurred = false; + + onToComplete(function(){ + transitionOccurred = true; + }); + + + return setTimeout(function(){ + ok( transitionOccurred === expected, (expected ? "" : "no ") + "transition occurred" ); + start(); + }, 5000); + + $.mobile.changePage( $(".ui-page:not(.ui-page-active)").first() ); + + } + + asyncTest( "maxTransitionWidth property disables transitions when value is less than browser width", function(){ + testTransitionMaxWidth( $( window ).width() - 1, false ); + }); + + asyncTest( "maxTransitionWidth property disables transitions when value is false", function(){ + testTransitionMaxWidth( false, false ); + }); +})(jQuery); diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/path-tests/file.html b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/path-tests/file.html new file mode 100644 index 0000000..98e20d5 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/path-tests/file.html @@ -0,0 +1,11 @@ + + + + + + +
        +
        doc rel test two
        +
        + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/path-tests/parent-ref.html b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/path-tests/parent-ref.html new file mode 100644 index 0000000..d4b6242 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/path-tests/parent-ref.html @@ -0,0 +1,11 @@ + + + + + + +
        +
        doc rel test five
        +
        + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/path-tests/parent/index.html b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/path-tests/parent/index.html new file mode 100644 index 0000000..3fc4f33 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/path-tests/parent/index.html @@ -0,0 +1,11 @@ + + + + + + +
        +
        doc rel test six
        +
        + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/path-tests/sub-dir/file.html b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/path-tests/sub-dir/file.html new file mode 100644 index 0000000..93aad52 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/path-tests/sub-dir/file.html @@ -0,0 +1,11 @@ + + + + + + +
        +
        doc rel test three
        +
        + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/path-tests/sub-dir/index.html b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/path-tests/sub-dir/index.html new file mode 100644 index 0000000..8ef666a --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/path-tests/sub-dir/index.html @@ -0,0 +1,11 @@ + + + + + + +
        +
        doc rel test four
        +
        + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/prefetched-dialog.html b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/prefetched-dialog.html new file mode 100644 index 0000000..bea1799 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/prefetched-dialog.html @@ -0,0 +1,10 @@ + + + + + Title Tag + + +
        + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/prefetched.html b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/prefetched.html new file mode 100644 index 0000000..de66a40 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/prefetched.html @@ -0,0 +1,12 @@ + + + + + Title Tag + + + +
        + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/push-state-dialog-tests.html b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/push-state-dialog-tests.html new file mode 100644 index 0000000..8fcfabd --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/push-state-dialog-tests.html @@ -0,0 +1,40 @@ + + + + + + jQuery Mobile Navigation Test Suite + + + + + + + + + + + + + + + + + +

        jQuery Mobile Navigation Test Suite

        +

        +

        +
          +
        + + + +
        +
        +

        Dialog

        +
        +
        + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/push-state-disabled-base-tests.html b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/push-state-disabled-base-tests.html new file mode 100644 index 0000000..b2b499e --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/push-state-disabled-base-tests.html @@ -0,0 +1,11 @@ + + + + + + + + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/push-state-disabled-tests.html b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/push-state-disabled-tests.html new file mode 100644 index 0000000..27b6eb5 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/push-state-disabled-tests.html @@ -0,0 +1,11 @@ + + + + + + + + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/title1.html b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/title1.html new file mode 100644 index 0000000..eb83eae --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/title1.html @@ -0,0 +1,13 @@ + + + + + Title Tag + + + + + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/title2.html b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/title2.html new file mode 100644 index 0000000..9545c53 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/title2.html @@ -0,0 +1,12 @@ + + + + + + + + +
        + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/title3.html b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/title3.html new file mode 100644 index 0000000..714df82 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/title3.html @@ -0,0 +1,13 @@ + + + + + + + +
        +

        Title Heading

        +
        + + + \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/transition-tests.html b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/transition-tests.html new file mode 100644 index 0000000..8444dad --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/navigation/transition-tests.html @@ -0,0 +1,285 @@ + + + + + + jQuery Mobile Navigation Test Suite + + + + + + + + + + + + + + + + +

        jQuery Mobile Navigation Test Suite

        +

        +

        +
          +
        + +
        +
        + +
        + + +
        + + + +
        +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        +
        +
        + +
        +
        + +
        +
        +
        + +
        + +
        + +
        +
        + + + + + +
        +
        +

        Dialog

        +
        +
        + +
        +
        + Dialog +
        +
        + +
        +
        + Page 2 +
        +
        + +
        + Go Back +
        + + +
        +
        + Dialog +
        +
        + +
        +
        + Dialog 2 +
        +
        + +
        +
        + +
        + +
        + + + +
        + test + test + test +
        + +
        +

        Title Heading

        +
        + +
        +

        Title Heading

        +
        + + + + + +
        + + go + go + go + go + go + go + + + + go + go + go + go + go + go + + + + go + go + go + go + go + go + + + + go + go + go + go + go + go + +
        + +
        +
        page didn't change!
        +
        + + + +
        +
        + page2 +
        +
        + + + + + +
        + foo +
        + +
        + + + + + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/page-sections/index.html b/libs/js/jquery-mobile-1.1.0/tests/unit/page-sections/index.html new file mode 100644 index 0000000..c413111 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/page-sections/index.html @@ -0,0 +1,82 @@ + + + + + + jQuery Mobile Page Test Suite + + + + + + + + + + + + + + + +

        jQuery Mobile Page Test Suite

        +

        +

        +
          +
        + +
        +
        +
        +
        + foo +
        + foo +
        + +
        +
        + foo +
        + + foo +
        + +
        +
        + foo +
        + + foo +
        +
        +
        + +
        +
        +
        + foo +
        + foo +
        +
        + +
        +
        +
        + foo +
        + foo +
        +
        + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/page-sections/page_core.js b/libs/js/jquery-mobile-1.1.0/tests/unit/page-sections/page_core.js new file mode 100644 index 0000000..75f0765 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/page-sections/page_core.js @@ -0,0 +1,54 @@ +/* + * mobile page unit tests + */ +(function($){ + var libName = 'jquery.mobile.page.sections'; + + module(libName); + + test( "nested header anchors aren't altered", function(){ + ok(!$('.ui-header > div > a').hasClass('ui-btn')); + }); + + test( "nested footer anchors aren't altered", function(){ + ok(!$('.ui-footer > div > a').hasClass('ui-btn')); + }); + + test( "nested bar anchors aren't styled", function(){ + ok(!$('.ui-bar > div > a').hasClass('ui-btn')); + }); + + test( "unnested footer anchors are styled", function(){ + ok($('.ui-footer > a').hasClass('ui-btn')); + }); + + test( "unnested bar anchors are styled", function(){ + ok($('.ui-bar > a').hasClass('ui-btn')); + }); + + test( "no auto-generated back button exists on first page", function(){ + ok( !$(".ui-header > :jqmData(rel='back')").length ); + }); + + test( "sections inside an ignored container do not enhance", function() { + var $ignored = $( "#ignored-header" ), $enhanced = $( "#enhanced-header" ); + + $.mobile.ignoreContentEnabled = true; + + $ignored + .parent() + .attr( "data-" + $.mobile.ns + "role", "page" ) + .page() + .trigger( "pagecreate" ); + same( $ignored.attr( "class" ), undefined, "ignored header has no class" ); + + $enhanced + .parent() + .attr( "data-" + $.mobile.ns + "role", "page" ) + .page() + .trigger( "pagecreate" ); + same( $enhanced.attr( "class" ).indexOf("ui-header"), 0, "enhanced header has classes" ); + + $.mobile.ignoreContentEnabled = false; + }); +})(jQuery); diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/page/index.html b/libs/js/jquery-mobile-1.1.0/tests/unit/page/index.html new file mode 100644 index 0000000..b6cc81d --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/page/index.html @@ -0,0 +1,49 @@ + + + + + + jQuery Mobile Page Test Suite + + + + + + + + + + + + + + + +

        jQuery Mobile Page Test Suite

        +

        +

        +
          +
        + +
        +
        +
        + +
        + +
        + +
        + +
        + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/page/page_core.js b/libs/js/jquery-mobile-1.1.0/tests/unit/page/page_core.js new file mode 100644 index 0000000..234df61 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/page/page_core.js @@ -0,0 +1,157 @@ +/* + * mobile page unit tests + */ +(function($){ + var libName = 'jquery.mobile.page', + themedefault = $.mobile.page.prototype.options.theme, + keepNative = $.mobile.page.prototype.options.keepNative; + + module(libName, { + setup: function() { + $.mobile.page.prototype.options.keepNative = keepNative; + } + }); + + var eventStack = [], + etargets = [], + cEvents=[], + cTargets=[]; + + $( document ).bind( "pagebeforecreate pagecreate", function( e ){ + eventStack.push( e.type ); + etargets.push( e.target ); + }); + + $( "#c" ).live( "pagebeforecreate", function( e ){ + cEvents.push( e.type ); + cTargets.push( e.target ); + return false; + }); + + test( "pagecreate event fires when page is created", function(){ + ok( eventStack[0] === "pagecreate" || eventStack[1] === "pagecreate" ); + }); + + test( "pagebeforecreate event fires when page is created", function(){ + ok( eventStack[0] === "pagebeforecreate" || eventStack[1] === "pagebeforecreate" ); + }); + + test( "pagebeforecreate fires before pagecreate", function(){ + ok( eventStack[0] === "pagebeforecreate" ); + }); + + test( "target of pagebeforecreate event was div #a", function(){ + ok( $( etargets[0] ).is("#a") ); + }); + + test( "target of pagecreate event was div #a" , function(){ + ok( $( etargets[0] ).is("#a") ); + }); + + test( "page element has ui-page class" , function(){ + ok( $( "#a" ).hasClass( "ui-page" ) ); + }); + + test( "page element has default body theme when not overidden" , function(){ + ok( $( "#a" ).hasClass( "ui-body-" + themedefault ) ); + }); + + test( "B page has non-default theme matching its data-theme attr" , function(){ + $( "#b" ).page(); + var btheme = $( "#b" ).jqmData( "theme" ); + ok( $( "#b" ).hasClass( "ui-body-" + btheme ) ); + }); + + test( "Binding to pagebeforecreate and returning false prevents pagecreate event from firing" , function(){ + $( "#c" ).page(); + + ok( cEvents[0] === "pagebeforecreate" ); + ok( !cTargets[1] ); + }); + + test( "Binding to pagebeforecreate and returning false prevents classes from being applied to page" , function(){ + $( "#c" ).page(); + + ok( !$( "#c" ).hasClass( "ui-body-" + themedefault ) ); + ok( !$( "#c" ).hasClass( "ui-page" ) ); + }); + + test( "keepNativeSelector returns the default where keepNative is not different", function() { + var pageProto = $.mobile.page.prototype; + pageProto.options.keepNative = pageProto.options.keepNativeDefault; + + same(pageProto.keepNativeSelector(), pageProto.options.keepNativeDefault); + }); + + test( "keepNativeSelector returns the default where keepNative is empty, undefined, whitespace", function() { + var pageProto = $.mobile.page.prototype; + + pageProto.options.keepNative = ""; + same(pageProto.keepNativeSelector(), pageProto.options.keepNativeDefault); + + pageProto.options.keepNative = undefined; + same(pageProto.keepNativeSelector(), pageProto.options.keepNativeDefault); + + pageProto.options.keepNative = " "; + same(pageProto.keepNativeSelector(), pageProto.options.keepNativeDefault); + }); + + test( "keepNativeSelector returns a selector joined with the default", function() { + var pageProto = $.mobile.page.prototype; + + pageProto.options.keepNative = "foo, bar"; + same(pageProto.keepNativeSelector(), "foo, bar, " + pageProto.options.keepNativeDefault); + }); + + test( "links inside an ignored container do not enhance", function() { + var $ignored = $( "#ignored-link" ), $enhanced = $( "#enhanced-link" ); + + $.mobile.ignoreContentEnabled = true; + + $ignored.parent().trigger( "create" ); + same( $ignored.attr( "class" ), undefined, "ignored link doesn't have link class" ); + + $enhanced.parent().trigger( "create" ); + same( $enhanced.attr( "class" ).indexOf("ui-link"), 0, "enhanced link has link class" ); + + $.mobile.ignoreContentEnabled = false; + }); + + + asyncTest( "page container is updated to page theme at pagebeforeshow", function(){ + + expect( 1 ); + + var pageTheme = "ui-overlay-" + $.mobile.activePage.page( "option", "theme" ); + + $.mobile.pageContainer.removeClass( pageTheme ); + + $.mobile.activePage + .bind( "pagebeforeshow", function(){ + ok( $.mobile.pageContainer.hasClass( pageTheme ), "Page container has the same theme as the page on pagebeforeshow" ); + start(); + }) + .trigger( "pagebeforeshow" ); + + } ); + + asyncTest( "page container is updated to page theme at pagebeforeshow", function(){ + + expect( 1 ); + + var pageTheme = "ui-overlay-" + $.mobile.activePage.page( "option", "theme" ); + + $.mobile.pageContainer.addClass( pageTheme ); + + $.mobile.activePage + .bind( "pagebeforehide", function(){ + ok( !$.mobile.pageContainer.hasClass( pageTheme ), "Page container does not have the same theme as the page on pagebeforeshow" ); + start(); + }) + .trigger( "pagebeforehide" ); + + } ); + + + +})(jQuery); diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/runner.js b/libs/js/jquery-mobile-1.1.0/tests/unit/runner.js new file mode 100644 index 0000000..4505996 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/runner.js @@ -0,0 +1,89 @@ +$(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( results ) { + // 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() { + self.dir = dir; + self.$frameElem.one( "load", self.onFrameLoad ); + self.$frameElem.attr( "src", template.replace("{{testdir}}", dir).replace( "{{jquery.version}}", $.fn.jquery ) ); + }); + }); + + // 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; + }; + + // get the test directories + $.get( "ls.php", (new Runner()).exec ); +}); diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/select/cached-dom-cache-true.html b/libs/js/jquery-mobile-1.1.0/tests/unit/select/cached-dom-cache-true.html new file mode 100755 index 0000000..b5e719d --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/select/cached-dom-cache-true.html @@ -0,0 +1,65 @@ + + + + + + +
        +
        + + +
        +
        + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/select/cached-tests.html b/libs/js/jquery-mobile-1.1.0/tests/unit/select/cached-tests.html new file mode 100644 index 0000000..627bc3d --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/select/cached-tests.html @@ -0,0 +1,38 @@ + + + + + + jQuery Mobile Select Events Test Suite + + + + + + + + + + + + + + + +

        jQuery Mobile Select Event Test Suite

        +

        +

        +
          +
        +
        + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/select/cached.html b/libs/js/jquery-mobile-1.1.0/tests/unit/select/cached.html new file mode 100644 index 0000000..0ca8691 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/select/cached.html @@ -0,0 +1,65 @@ + + + + + + +
        +
        + + +
        +
        + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/select/defineKeepNative.js b/libs/js/jquery-mobile-1.1.0/tests/unit/select/defineKeepNative.js new file mode 100644 index 0000000..ed60f68 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/select/defineKeepNative.js @@ -0,0 +1,4 @@ +$(document).bind("mobileinit", function() { + $.mobile.page.prototype.options.keepNative = "select.should-be-native"; +}); + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/select/index.html b/libs/js/jquery-mobile-1.1.0/tests/unit/select/index.html new file mode 100644 index 0000000..f7fb780 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/select/index.html @@ -0,0 +1,405 @@ + + + + + + jQuery Mobile Select Events Test Suite + + + + + + + + + + + + + + + +

        jQuery Mobile Select Event Test Suite

        +

        +

        +
          +
        + +
        +
        + +
        + +
        + + +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        + + +
        + +
        + + +
        + +
        + + +
        + +
        + + +
        + +
        + + + +
        + +
        + +
        + + + + + + + + + + + + + + + +
        + +
        + + +
        + + +
        + +
        + + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/select/select_cached.js b/libs/js/jquery-mobile-1.1.0/tests/unit/select/select_cached.js new file mode 100644 index 0000000..1493dff --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/select/select_cached.js @@ -0,0 +1,137 @@ +/* + * mobile select unit tests + */ + +(function($){ + var resetHash; + + resetHash = function(timeout){ + $.testHelper.openPage( location.hash.indexOf("#default") >= 0 ? "#" : "#default" ); + }; + + // https://github.com/jquery/jquery-mobile/issues/2181 + asyncTest( "dialog sized select should alter the value of its parent select", function(){ + var selectButton, value; + + $.testHelper.pageSequence([ + resetHash, + + function(){ + $.mobile.changePage( "cached.html" ); + }, + + function(){ + ok( $.mobile.activePage.is("#dialog-select-parent-cache-test"), "cached page appears" ); + selectButton = $( "#cached-page-select" ).siblings( 'a' ); + selectButton.click(); + }, + + function(){ + ok( $.mobile.activePage.hasClass('ui-dialog'), "the dialog came up" ); + var option = $.mobile.activePage.find( "li a" ).not(":contains('" + selectButton.text() + "')").last(); + value = $.trim(option.text()); + option.click(); + }, + + function(){ + same( value, $.trim(selectButton.text()), "the selected value is propogated back to the button text" ); + start(); + } + ]); + }); + + // https://github.com/jquery/jquery-mobile/issues/2181 + asyncTest( "dialog sized select should prevent the removal of its parent page from the dom", function(){ + var selectButton, parentPageId; + + expect( 2 ); + + $.testHelper.pageSequence([ + resetHash, + + function(){ + $.mobile.changePage( "cached.html" ); + }, + + function(){ + selectButton = $.mobile.activePage.find( "#cached-page-select" ).siblings( 'a' ); + parentPageId = $.mobile.activePage.attr( 'id' ); + same( $("#" + parentPageId).length, 1, "establish the parent page exists" ); + selectButton.click(); + }, + + function(){ + same( $( "#" + parentPageId).length, 1, "make sure parent page is still there after opening the dialog" ); + $.mobile.activePage.find( "li a" ).last().click(); + }, + + start + ]); + }); + + asyncTest( "dialog sized select shouldn't rebind its parent page remove handler when closing, if the parent page domCache option is true", function(){ + expect( 3 ); + + $.testHelper.pageSequence([ + resetHash, + + function(){ + $.mobile.changePage( "cached-dom-cache-true.html" ); + }, + + function(){ + $.mobile.activePage.find( "#domcache-page-select" ).siblings( 'a' ).click(); + }, + + function(){ + ok( $.mobile.activePage.hasClass('ui-dialog'), "the dialog came up" ); + $.mobile.activePage.find( "li a" ).last().click(); + }, + + function(){ + ok( $.mobile.activePage.is( "#dialog-select-parent-domcache-test" ), "the dialog closed" ); + $.mobile.changePage( $( "#default" ) ); + }, + + function(){ + same( $("#dialog-select-parent-domcache-test").length, 1, "make sure the select parent page is still cached in the dom after changing page" ); + start(); + } + ]); + }); + + asyncTest( "menupage is removed when the parent page is removed", function(){ + var dialogCount = $(":jqmData(role='dialog')").length; + $.testHelper.pageSequence([ + resetHash, + + function(){ + $.mobile.changePage( "uncached-dom-cached-false.html" ); + }, + + function(){ + // for performance reason we don't initially create the menu dialog now + same( $(":jqmData(role='dialog')").length, dialogCount); + + // manually trigger dialog opening + $( "#domcache-uncached-page-select" ).data( 'selectmenu' ).open(); + }, + + function(){ + // check if dialog was successfully created + same( $(":jqmData(role='dialog')").length, dialogCount + 1 ); + $( "#domcache-uncached-page-select" ).data( 'selectmenu' ).close(); + }, + + function(){ + // navigate to parent(initial) page + window.history.back(); + }, + + function() { + same( $(":jqmData(role='dialog')").length, dialogCount ); + start(); + } + ]); + }); +})(jQuery); \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/select/select_core.js b/libs/js/jquery-mobile-1.1.0/tests/unit/select/select_core.js new file mode 100644 index 0000000..8f1ed6d --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/select/select_core.js @@ -0,0 +1,387 @@ +/* + * mobile select unit tests + */ + +(function($){ + var libName = "jquery.mobile.forms.select", + originalDefaultDialogTrans = $.mobile.defaultDialogTransition, + originalDefTransitionHandler = $.mobile.defaultTransitionHandler, + originalGetEncodedText = $.fn.getEncodedText, + resetHash, closeDialog; + + resetHash = function(timeout){ + $.testHelper.openPage( location.hash.indexOf("#default") >= 0 ? "#" : "#default" ); + }; + + closeDialog = function(timeout){ + $.mobile.activePage.find("li a").first().click(); + }; + + module(libName, { + teardown: function(){ + $.mobile.defaultDialogTransition = originalDefaultDialogTrans; + $.mobile.defaultTransitionHandler = originalDefTransitionHandler; + + $.fn.getEncodedText = originalGetEncodedText; + window.encodedValueIsDefined = undefined; + } + }); + + asyncTest( "placeholder correctly gets ui-selectmenu-placeholder class after rebuilding", function(){ + $.testHelper.sequence([ + function(){ + // bring up the optgroup menu + ok($("#optgroup-and-placeholder-container a").length > 0, "there is in fact a button in the page"); + $("#optgroup-and-placeholder-container a").trigger("click"); + }, + + function(){ + //select the first menu item + $("#optgroup-and-placeholder-menu a:first").click(); + }, + + function(){ + ok($("#optgroup-and-placeholder-menu li:first").hasClass("ui-selectmenu-placeholder"), "the placeholder item has the ui-selectmenu-placeholder class"); + start(); + } + ], 1000); + }); + + asyncTest( "firing a click at least 400 ms later on the select screen overlay does close it", function(){ + $.testHelper.sequence([ + function(){ + // bring up the smaller choice menu + ok($("#select-choice-few-container a").length > 0, "there is in fact a button in the page"); + $("#select-choice-few-container a").trigger("click"); + }, + + function(){ + //select the first menu item + $("#select-choice-few-menu a:first").click(); + }, + + function(){ + same($("#select-choice-few-menu").parent(".ui-selectmenu-hidden").length, 1); + start(); + } + ], 1000); + }); + + asyncTest( "a large select menu should use the default dialog transition", function(){ + var select; + + $.testHelper.pageSequence([ + resetHash, + + function(timeout){ + select = $("#select-choice-many-container-1 a"); + + //set to something else + $.mobile.defaultTransitionHandler = $.testHelper.decorate({ + fn: $.mobile.defaultTransitionHandler, + + before: function(name){ + same(name, $.mobile.defaultDialogTransition); + } + }); + + // bring up the dialog + select.trigger("click"); + }, + + closeDialog, + + start + ]); + }); + + asyncTest( "custom select menu always renders screen from the left", function(){ + var select; + + expect( 1 ); + + $.testHelper.sequence([ + resetHash, + + function(){ + select = $("ul#select-offscreen-menu"); + $("#select-offscreen-container a").trigger("click"); + }, + + function(){ + ok(select.offset().left >= 30, "offset from the left is greater than or equal to 30px" ); + start(); + } + ], 1000); + }); + + asyncTest( "selecting an item from a dialog sized custom select menu leaves no dialog hash key", function(){ + var dialogHashKey = "ui-state=dialog"; + + $.testHelper.pageSequence([ + resetHash, + + function(timeout){ + $("#select-choice-many-container-hash-check a").click(); + }, + + function(){ + ok(location.hash.indexOf(dialogHashKey) > -1); + closeDialog(); + }, + + function(){ + same(location.hash.indexOf(dialogHashKey), -1); + start(); + } + ]); + }); + + asyncTest( "dialog sized select menu opened many times remains a dialog", function(){ + var dialogHashKey = "ui-state=dialog", + + openDialogSequence = [ + resetHash, + + function(){ + $("#select-choice-many-container-many-clicks a").click(); + }, + + function(){ + ok(location.hash.indexOf(dialogHashKey) > -1, "hash should have the dialog hash key"); + closeDialog(); + } + ], + + sequence = openDialogSequence.concat(openDialogSequence).concat([start]); + + $.testHelper.sequence(sequence, 1000); + }); + + test( "make sure the label for the select gets the ui-select class", function(){ + ok( $( "#native-select-choice-few-container label" ).hasClass( "ui-select" ), "created label has ui-select class" ); + }); + + module("Non native menus", { + setup: function() { + $.mobile.selectmenu.prototype.options.nativeMenu = false; + }, + teardown: function() { + $.mobile.selectmenu.prototype.options.nativeMenu = true; + } + }); + + asyncTest( "a large select option should not overflow", function(){ + // https://github.com/jquery/jquery-mobile/issues/1338 + var menu, select; + + $.testHelper.sequence([ + resetHash, + + function(){ + select = $("#select-long-option-label"); + // bring up the dialog + select.trigger("click"); + }, + + function() { + menu = $(".ui-selectmenu-list"); + + equal(menu.width(), menu.find("li:nth-child(2) .ui-btn-text").width(), "ui-btn-text element should not overflow"); + start(); + } + ], 500); + }); + + asyncTest( "using custom refocuses the button after close", function() { + var select, button, triggered = false; + + expect( 1 ); + + $.testHelper.sequence([ + resetHash, + + function() { + select = $("#select-choice-focus-test"); + button = select.find( "a" ); + button.trigger( "click" ); + }, + + function() { + // NOTE this is called twice per triggered click + button.focus(function() { + triggered = true; + }); + + $(".ui-selectmenu-screen:not(.ui-screen-hidden)").trigger("click"); + }, + + function(){ + ok(triggered, "focus is triggered"); + start(); + } + ], 5000); + }); + + asyncTest( "selected items are highlighted", function(){ + $.testHelper.sequence([ + resetHash, + + function(){ + // bring up the smaller choice menu + ok($("#select-choice-few-container a").length > 0, "there is in fact a button in the page"); + $("#select-choice-few-container a").trigger("click"); + }, + + function(){ + var firstMenuChoice = $("#select-choice-few-menu li:first"); + ok( firstMenuChoice.hasClass( $.mobile.activeBtnClass ), + "default menu choice has the active button class" ); + + $("#select-choice-few-menu a:last").click(); + }, + + function(){ + // bring up the menu again + $("#select-choice-few-container a").trigger("click"); + }, + + function(){ + var lastMenuChoice = $("#select-choice-few-menu li:last"); + ok( lastMenuChoice.hasClass( $.mobile.activeBtnClass ), + "previously slected item has the active button class" ); + + // close the dialog + lastMenuChoice.find( "a" ).click(); + }, + + start + ], 1000); + }); + + test( "enabling and disabling", function(){ + var select = $( "select" ).first(), button; + + button = select.siblings( "a" ).first(); + + select.selectmenu( 'disable' ); + same( select.attr('disabled'), "disabled", "select is disabled" ); + ok( button.hasClass("ui-disabled"), "disabled class added" ); + same( button.attr('aria-disabled'), "true", "select is disabled" ); + same( select.selectmenu( 'option', 'disabled' ), true, "disbaled option set" ); + + select.selectmenu( 'enable' ); + same( select.attr('disabled'), undefined, "select is disabled" ); + ok( !button.hasClass("ui-disabled"), "disabled class added" ); + same( button.attr('aria-disabled'), "false", "select is disabled" ); + same( select.selectmenu( 'option', 'disabled' ), false, "disbaled option set" ); + }); + + asyncTest( "adding options and refreshing a custom select changes the options list", function(){ + var select = $( "#custom-refresh-opts-list" ), + button = select.siblings( "a" ).find( ".ui-btn-inner" ), + text = "foo"; + + $.testHelper.sequence([ + // bring up the dialog + function() { + button.click(); + }, + + function() { + same( $( ".ui-selectmenu.in ul" ).text(), "default" ); + $( ".ui-selectmenu-screen" ).click(); + }, + + function() { + select.find( "option" ).remove(); //remove the loading message + select.append(''); + select.selectmenu( 'refresh' ); + }, + + function() { + button.click(); + }, + + function() { + same( $( ".ui-selectmenu.in ul" ).text(), text ); + $( ".ui-selectmenu-screen" ).click(); + }, + + start + ], 500); + }); + + test( "theme defined on select is used", function(){ + var select = $("select#non-parent-themed"); + + ok( select.siblings( "a" ).hasClass("ui-btn-up-" + select.jqmData('theme'))); + }); + + test( "select without theme defined inherits theme from parent", function() { + var select = $("select#parent-themed"); + + ok( select + .siblings( "a" ) + .hasClass("ui-btn-up-" + select.parents(":jqmData(role='page')").jqmData('theme'))); + }); + + // issue #2547 + test( "custom select list item links have encoded option text values", function() { + $( "#encoded-option" ).data( 'selectmenu' )._buildList(); + same(window.encodedValueIsDefined, undefined); + }); + + // not testing the positive case here since's it's obviously tested elsewhere + test( "select elements in the keepNative set shouldn't be enhanced", function() { + ok( !$("#keep-native").parent().is("div.ui-btn") ); + }); + + asyncTest( "dialog size select title should match the label", function() { + var $select = $( "#select-choice-many-1" ), + $label = $select.parent().siblings( "label" ), + $button = $select.siblings( "a" ); + + $.testHelper.pageSequence([ + function() { + $button.click(); + }, + + function() { + same($.mobile.activePage.find( ".ui-title" ).text(), $label.text()); + window.history.back(); + }, + + start + ]); + }); + + asyncTest( "dialog size select title should match the label when changed after the dialog markup is added to the DOM", function() { + var $select = $( "#select-choice-many-1" ), + $label = $select.parent().siblings( "label" ), + $button = $select.siblings( "a" ); + + $label.text( "foo" ); + + $.testHelper.pageSequence([ + function() { + $label.text( "foo" ); + $button.click(); + }, + + function() { + same($.mobile.activePage.find( ".ui-title" ).text(), $label.text()); + window.history.back(); + }, + + start + ]); + }); + + test( "a disabled custom select should still be enhanced as custom", function() { + $("#select-disabled-enhancetest").selectmenu("enable").siblings("a").click(); + + var menu = $(".ui-selectmenu").not( ".ui-selectmenu-hidden" ); + ok( menu.text().indexOf("disabled enhance test") > -1, "the right select is showing" ); + }); +})(jQuery); diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/select/select_events.js b/libs/js/jquery-mobile-1.1.0/tests/unit/select/select_events.js new file mode 100644 index 0000000..355a142 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/select/select_events.js @@ -0,0 +1,34 @@ +/* + * mobile select unit tests + */ + +(function($){ + var libName = "jquery.mobile.forms.select"; + + $(document).bind('mobileinit', function(){ + $.mobile.selectmenu.prototype.options.nativeMenu = false; + }); + + module(libName,{ + setup: function(){ + $.testHelper.openPage( location.hash.indexOf("#default") >= 0 ? "#" : "#default" ); + } + }); + + test( "selects marked with data-native-menu=true should use a div as their button", function(){ + same($("#select-choice-native-container div.ui-btn").length, 1); + }); + + test( "selects marked with data-native-menu=true should not have a custom menu", function(){ + same($("#select-choice-native-container ul").length, 0); + }); + + test( "selects marked with data-native-menu=true should sit inside the button", function(){ + same($("#select-choice-native-container div.ui-btn select").length, 1); + }); + + test( "select controls will create when inside a container that receives a 'create' event", function(){ + ok( !$("#enhancetest").appendTo(".ui-page-active").find(".ui-select").length, "did not have enhancements applied" ); + ok( $("#enhancetest").trigger("create").find(".ui-select").length, "enhancements applied" ); + }); +})(jQuery); diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/select/select_native.js b/libs/js/jquery-mobile-1.1.0/tests/unit/select/select_native.js new file mode 100644 index 0000000..fdabe85 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/select/select_native.js @@ -0,0 +1,122 @@ +/* + * mobile select unit tests + */ + +(function($){ + module("jquery.mobile.forms.select native"); + + test( "native menu selections alter the button text", function(){ + var select = $( "#native-select-choice-few" ), setAndCheck; + + setAndCheck = function(key){ + var text; + + select.val( key ).selectmenu( 'refresh' ); + text = select.find( "option[value='" + key + "']" ).text(); + same( select.parent().find(".ui-btn-text").text(), text ); + }; + + setAndCheck( 'rush' ); + setAndCheck( 'standard' ); + }); + + asyncTest( "selecting a value removes the related buttons down state", function(){ + var select = $( "#native-select-choice-few" ); + + $.testHelper.sequence([ + function() { + // click the native menu parent button + select.parent().trigger( 'vmousedown' ); + }, + + function() { + ok( select.parent().hasClass("ui-btn-down-c"), "button down class added" ); + }, + + function() { + // trigger a change on the select + select.trigger( "change" ); + }, + + function() { + ok( !select.parent().hasClass("ui-btn-down-c"), "button down class removed" ); + start(); + } + ], 300); + }); + + // issue https://github.com/jquery/jquery-mobile/issues/2410 + test( "adding options and refreshing a custom select defaults the text", function() { + var select = $( "#custom-refresh" ), + button = select.siblings( "a" ).find( ".ui-btn-inner" ), + text = "foo"; + + same($.trim(button.text()), "default"); + select.find( "option" ).remove(); //remove the loading message + select.append(''); + select.selectmenu( 'refresh' ); + same($.trim(button.text()), text); + }); + + // issue 2424 + test( "native selects should provide open and close as a no-op", function() { + // exception will prevent test success if undef + $( "#native-refresh" ).selectmenu( 'open' ); + $( "#native-refresh" ).selectmenu( 'close' ); + ok( true ); + }); + + asyncTest( "The preventFocusZoom option is working as expected", function() { + + var zoomoptiondefault = $.mobile.selectmenu.prototype.options.preventFocusZoom; + $.mobile.selectmenu.prototype.options.preventFocusZoom = true; + + $(document) + .one("vmousedown.test", function(){ + ok( $.mobile.zoom.enabled === false, "zoom is disabled on vmousedown" ); + }) + .one("mouseup.test", function(){ + ok( $.mobile.zoom.enabled === true, "zoom is enabled on mouseup" ); + $.mobile.selectmenu.prototype.options.preventFocusZoom = zoomoptiondefault; + $(document).unbind(".test"); + $( "#select-choice-native" ).selectmenu( "option", "preventFocusZoom", zoomoptiondefault ) + start(); + }); + + $( "#select-choice-native" ) + .selectmenu( "option", "preventFocusZoom", true ) + .parent() + .trigger( "vmousedown" ) + .trigger( "mouseup" ); + + + + + }); + + asyncTest( "The preventFocusZoom option does not manipulate zoom when it is false", function() { + + var zoomstate = $.mobile.zoom.enabled, + zoomoptiondefault = $.mobile.selectmenu.prototype.options.preventFocusZoom; + + + $(document) + .one("vmousedown.test", function(){ + ok( $.mobile.zoom.enabled === zoomstate, "zoom is unaffected on vmousedown" ); + }) + .one("mouseup.test", function(){ + ok( $.mobile.zoom.enabled === zoomstate, "zoom is unaffected on mouseup" ); + $(document).unbind(".test"); + $( "#select-choice-native" ).selectmenu( "option", "preventFocusZoom", zoomoptiondefault ); + start(); + + }); + + $( "#select-choice-native" ) + .selectmenu( "option", "preventFocusZoom", false ) + .parent() + .trigger( "vmousedown" ) + .trigger( "mouseup" ); + + }); +})(jQuery); \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/select/suite.html b/libs/js/jquery-mobile-1.1.0/tests/unit/select/suite.html new file mode 100644 index 0000000..9545af3 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/select/suite.html @@ -0,0 +1,297 @@ + + + + + + +
        +
        + +
        + +
        + +
        + +
        + +
        + +
        + + +
        + +
        + + +
        + +
        + + +
        + +
        + + +
        + +
        + + + +
        + +
        + +
        +
        + + + +
        + +
        + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/select/uncached-dom-cached-false.html b/libs/js/jquery-mobile-1.1.0/tests/unit/select/uncached-dom-cached-false.html new file mode 100644 index 0000000..2977c2a --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/select/uncached-dom-cached-false.html @@ -0,0 +1,65 @@ + + + + + + +
        +
        + + +
        +
        + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/slider/index.html b/libs/js/jquery-mobile-1.1.0/tests/unit/slider/index.html new file mode 100644 index 0000000..f251711 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/slider/index.html @@ -0,0 +1,99 @@ + + + + + + jQuery Mobile Slider Test Suite + + + + + + + + + + + + + + + +

        jQuery Mobile Slider Test Suite

        +

        +

        +
          +
        + +
        +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        + + +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        + + +
        + +
        + + +
        + +
        + + +
        +
        + +
        + +
        + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/slider/slider_core.js b/libs/js/jquery-mobile-1.1.0/tests/unit/slider/slider_core.js new file mode 100644 index 0000000..d19e9a3 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/slider/slider_core.js @@ -0,0 +1,47 @@ +/* + * mobile slider unit tests + */ +(function($){ + $.mobile.page.prototype.options.keepNative = "input.should-be-native"; + + // not testing the positive case here since's it's obviously tested elsewhere + test( "slider elements in the keepNative set shouldn't be enhanced", function() { + same( $("input.should-be-native").siblings("div.ui-slider").length, 0 ); + }); + + test( "refresh should force val to nearest step", function() { + var slider = $( "#step-slider" ), + step = parseInt(slider.attr( "step" ), 10); + + slider.val( step + 1 ); + + slider.slider( 'refresh' ); + + ok( step > 1, "the step is greater than one" ); + ok( slider.val() > 0, "the value has been altered" ); + same( slider.val() % step, 0, "value has 'snapped' to a step" ); + }); + + test( "empty string value results defaults to slider min value", function() { + var slider = $( "#empty-string-val-slider" ); + same( slider.attr('min'), "10", "slider min is greater than 0" ); + same( slider.val( '' ).slider( 'refresh' ).val(), slider.attr('min'), "val is equal to min attr"); + }); + + test( "flip toggle switch title should be current selected value attr", function() { + var slider = $( "#slider-switch" ); + + same(slider.siblings(".ui-slider").find("a").attr('title'), + $(slider.find("option")[slider[0].selectedIndex]).text(), + "verify that the link title is set to the selected option text"); + }); + + test( "data-highlight works properly", function() { + var $highlighted = $("#background-slider"), $unhighlighted = $("#no-background-slider"); + + same( $highlighted.siblings( ".ui-slider" ).find( ".ui-slider-bg" ).length, 1, + "highlighted slider should have a div for the track bg" ); + same( $unhighlighted.siblings( ".ui-slider" ).find( ".ui-slider-bg" ).length, 0, + "unhighlighted slider _not_ should have a div for the track bg" ); + }); +})( jQuery ); \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/slider/slider_events.js b/libs/js/jquery-mobile-1.1.0/tests/unit/slider/slider_events.js new file mode 100644 index 0000000..cc54566 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/slider/slider_events.js @@ -0,0 +1,376 @@ +/* + * mobile slider unit tests + */ + +(function($){ + var onChangeCnt = 0; + window.onChangeCounter = function() { + onChangeCnt++; + }; + + module('jquery.mobile.slider.js', { + setup: function() { + // force the value to be an increment of 10 when we aren't testing the rounding + $("#stepped").val( 20 ); + } + }); + + var keypressTest = function(opts){ + var slider = $(opts.selector), + val = window.parseFloat(slider.val()), + handle = slider.siblings('.ui-slider').find('.ui-slider-handle'); + + expect( opts.keyCodes.length ); + + $.each(opts.keyCodes, function(i, elem){ + + // stub the keycode value and trigger the keypress + $.Event.prototype.keyCode = $.mobile.keyCode[elem]; + handle.trigger('keydown'); + + val += opts.increment; + same(val, window.parseFloat(slider.val(), 10), "new value is " + opts.increment + " different"); + }); + }; + + test( "slider should move right with up, right, and page up keypress", function(){ + keypressTest({ + selector: '#range-slider-up', + keyCodes: ['UP', 'RIGHT', 'PAGE_UP'], + increment: 1 + }); + }); + + test( "slider should move left with down, left, and page down keypress", function(){ + keypressTest({ + selector: '#range-slider-down', + keyCodes: ['DOWN', 'LEFT', 'PAGE_DOWN'], + increment: -1 + }); + }); + + test( "slider should move to range minimum on end keypress", function(){ + var selector = "#range-slider-end", + initialVal = window.parseFloat($(selector).val(), 10), + max = window.parseFloat($(selector).attr('max'), 10); + + keypressTest({ + selector: selector, + keyCodes: ['END'], + increment: max - initialVal + }); + }); + + test( "slider should move to range minimum on end keypress", function(){ + var selector = "#range-slider-home", + initialVal = window.parseFloat($(selector).val(), 10); + + keypressTest({ + selector: selector, + keyCodes: ['HOME'], + increment: 0 - initialVal + }); + }); + + test( "slider should move positive by steps on keypress", function(){ + keypressTest({ + selector: "#stepped", + keyCodes: ['RIGHT'], + increment: 10 + }); + }); + + test( "slider should move negative by steps on keypress", function(){ + keypressTest({ + selector: "#stepped", + keyCodes: ['LEFT'], + increment: -10 + }); + }); + + test( "slider should validate input value on blur", function(){ + var slider = $("#range-slider-up"); + slider.focus(); + slider.val(200); + same(slider.val(), "200"); + slider.blur(); + same(slider.val(), slider.attr('max')); + }); + + test( "slider should not validate input on keyup", function(){ + var slider = $("#range-slider-up"); + slider.focus(); + slider.val(200); + same(slider.val(), "200"); + slider.keyup(); + same(slider.val(), "200"); + }); + + test( "input type should degrade to number when slider is created", function(){ + same($("#range-slider-up").attr( "type" ), "number"); + }); + + // generic switch test function + var sliderSwitchTest = function(opts){ + var slider = $("#slider-switch"), + handle = slider.siblings('.ui-slider').find('a'), + switchValues = { + 'off' : 0, + 'on' : 1 + }; + + // One for the select and one for the aria-valuenow + expect( opts.keyCodes.length * 2 ); + + $.each(opts.keyCodes, function(i, elem){ + // reset the values + slider[0].selectedIndex = switchValues[opts.start]; + handle.attr({'aria-valuenow' : opts.start }); + + // stub the keycode and trigger the event + $.Event.prototype.keyCode = $.mobile.keyCode[elem]; + handle.trigger('keydown'); + + same(handle.attr('aria-valuenow'), opts.finish, "handle value is " + opts.finish); + same(slider[0].selectedIndex, switchValues[opts.finish], "select input has correct index"); + }); + }; + + test( "switch should select on with up, right, page up and end", function(){ + sliderSwitchTest({ + start: 'off', + finish: 'on', + keyCodes: ['UP', 'RIGHT', 'PAGE_UP', 'END'] + }); + }); + + test( "switch should select off with down, left, page down and home", function(){ + sliderSwitchTest({ + start: 'on', + finish: 'off', + keyCodes: ['DOWN', 'LEFT', 'PAGE_DOWN', 'HOME'] + }); + }); + + test( "onchange should not be called on create", function(){ + equals(onChangeCnt, 0, "onChange should not have been called"); + }); + + test( "onchange should be called onchange", function(){ + onChangeCnt = 0; + $( "#onchange" ).slider( "refresh", 50 ); + equals(onChangeCnt, 1, "onChange should have been called once"); + }); + + test( "slider controls will create when inside a container that receives a 'create' event", function(){ + ok( !$("#enhancetest").appendTo(".ui-page-active").find(".ui-slider").length, "did not have enhancements applied" ); + ok( $("#enhancetest").trigger("create").find(".ui-slider").length, "enhancements applied" ); + }); + + var createEvent = function( name, target, x, y ) { + var event = $.Event( name ); + event.target = target; + event.pageX = x; + event.pageY = y; + return event; + }; + + test( "toggle switch should fire one change event when clicked", function(){ + var control = $( "#slider-switch" ), + widget = control.data( "slider" ), + slider = widget.slider, + handle = widget.handle, + changeCount = 0, + changeFunc = function( e ) { + ok( control[0].selectedIndex !== currentValue, "change event should only be triggered if the value changes"); + ++changeCount; + }, + event = null, + offset = handle.offset(), + currentValue = control[0].selectedIndex; + + control.bind( "change", changeFunc ); + + // The toggle switch actually updates on mousedown and mouseup events, so we go through + // the motions of generating all the events that happen during a click to make sure that + // during all of those events, the value only changes once. + + slider.trigger( createEvent( "mousedown", handle[ 0 ], offset.left + 10, offset.top + 10 ) ); + slider.trigger( createEvent( "mouseup", handle[ 0 ], offset.left + 10, offset.top + 10 ) ); + slider.trigger( createEvent( "click", handle[ 0 ], offset.left + 10, offset.top + 10 ) ); + + control.unbind( "change", changeFunc ); + + ok( control[0].selectedIndex !== currentValue, "value did change"); + same( changeCount, 1, "change event should be fired once during a click" ); + }); + + var assertLeftCSS = function( obj, opts ) { + var integerLeft, compare, css, threshold; + + css = obj.css('left'); + threshold = opts.pxThreshold || 0; + + if( css.indexOf( "px" ) > -1 ) { + // parse the actual pixel value returned by the left css value + // and the pixels passed in for comparison + integerLeft = Math.round( parseFloat( css.replace("px", "") ) ), + compare = parseInt( opts.pixels.replace( "px", "" ), 10 ); + + // check that the pixel value provided is within a given threshold; default is 0px + ok( compare >= integerLeft - threshold && compare <= integerLeft + threshold, opts.message ); + } else { + equal( css, opts.percent, opts.message ); + } + }; + + asyncTest( "toggle switch handle should snap in the old position if dragged less than half of the slider width, in the new position if dragged more than half of the slider width", function() { + var control = $( "#slider-switch" ), + widget = control.data( "slider" ), + slider = widget.slider, + handle = widget.handle, + width = handle.width(), + offset = null; + + $.testHelper.sequence([ + function() { + // initialize the switch + control.val('on').slider('refresh'); + }, + + function() { + assertLeftCSS(handle, { + percent: '100%', + pixels: handle.parent().css('width'), + message: 'handle starts on the right side' + }); + + // simulate dragging less than a half + offset = handle.offset(); + slider.trigger( createEvent( "mousedown", handle[ 0 ], offset.left + width - 10, offset.top + 10 ) ); + slider.trigger( createEvent( "mousemove", handle[ 0 ], offset.left + width - 20, offset.top + 10 ) ); + slider.trigger( createEvent( "mouseup", handle[ 0 ], offset.left + width - 20, offset.top + 10 ) ); + }, + + function() { + assertLeftCSS(handle, { + percent: '100%', + pixels: handle.parent().css('width'), + message: 'handle ends on the right side' + }); + + // initialize the switch + control.val('on').slider('refresh'); + }, + + function() { + assertLeftCSS(handle, { + percent: '100%', + pixels: handle.parent().css('width'), + message: 'handle starts on the right side' + }); + + // simulate dragging more than a half + offset = handle.offset(); + slider.trigger( createEvent( "mousedown", handle[ 0 ], offset.left + 10, offset.top + 10 ) ); + slider.trigger( createEvent( "mousemove", handle[ 0 ], offset.left - ( width / 2 + 10 ), offset.top + 10 ) ); + slider.trigger( createEvent( "mouseup", handle[ 0 ], offset.left - ( width / 2 + 10 ), offset.top + 10 ) ); + }, + + function() { + assertLeftCSS(handle, { + percent: '0%', + pixels: '0px', + message: 'handle ends on the left side' + }); + + start(); + } + ], 500); + }); + + asyncTest( "toggle switch handle should not move if user is dragging and value is changed", function() { + var control = $( "#slider-switch" ), + widget = control.data( "slider" ), + slider = widget.slider, + handle = widget.handle, + width = handle.width(), + offset = null; + + $.testHelper.sequence([ + function() { + // initialize the switch + control.val('on').slider('refresh'); + }, + + function() { + assertLeftCSS(handle, { + percent: '100%', + pixels: handle.parent().css('width'), + message: 'handle starts on the right side' + }); + + // simulate dragging more than a half + offset = handle.offset(); + slider.trigger( createEvent( "mousedown", handle[ 0 ], offset.left + 10, offset.top + 10 ) ); + slider.trigger( createEvent( "mousemove", handle[ 0 ], offset.left - ( width / 2 ), offset.top + 10 ) ); + }, + + function() { + var min, max; + if( handle.css('left').indexOf("%") > -1 ){ + min = "0%"; + max = "100%"; + } else { + min = "0px"; + max = handle.parent().css( 'width' ); + } + + notEqual(handle.css('left'), min, 'handle is not on the left side'); + notEqual(handle.css('left'), max, 'handle is not on the right side'); + + // reset slider state so it is ready for other tests + slider.trigger( createEvent( "mouseup", handle[ 0 ], offset.left - ( width / 2 ), offset.top + 10 ) ); + + start(); + } + ], 500); + }); + + asyncTest( "toggle switch should refresh when disabled", function() { + var control = $( "#slider-switch" ), + handle = control.data( "slider" ).handle; + + $.testHelper.sequence([ + function() { + // set the initial value + control.val('off').slider('refresh'); + }, + + function() { + assertLeftCSS(handle, { + percent: '0%', + pixels: '0px', + message: 'handle starts on the left side' + }); + + // disable and change value + control.slider('disable'); + control.val('on').slider('refresh'); + }, + + function() { + assertLeftCSS(handle, { + percent: '100%', + pixels: handle.parent().css( 'width' ), + message: 'handle ends on the right side' + }); + + // reset slider state so it is ready for other tests + control.slider('enable'); + + start(); + } + ], 500); + }); +})(jQuery); \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/support/index.html b/libs/js/jquery-mobile-1.1.0/tests/unit/support/index.html new file mode 100644 index 0000000..dac7fb2 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/support/index.html @@ -0,0 +1,41 @@ + + + + + + jQuery Mobile Support Test Suite + + + + + + + + + + + + + + + + +

        jQuery Mobile Support Test Suite

        +

        +

        +
          +
        + +
        + + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/support/support_core.js b/libs/js/jquery-mobile-1.1.0/tests/unit/support/support_core.js new file mode 100644 index 0000000..27b3e7c --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/support/support_core.js @@ -0,0 +1,116 @@ +/* + * mobile support unit tests + */ + +$.testHelper.excludeFileProtocol(function(){ + var prependToFn = $.fn.prependTo, + moduleName = "jquery.mobile.support"; + + module(moduleName, { + teardown: function(){ + //NOTE undo any mocking + $.fn.prependTo = prependToFn; + } + }); + + // NOTE following two tests have debatable value as they only + // prevent property name changes and improper attribute checks + asyncTest( "detects functionality from basic affirmative properties and attributes", function(){ + // TODO expose properties for less brittle tests + $.extend(window, { + WebKitTransitionEvent: true, + }); + + window.history.pushState = function(){}; + window.history.replaceState = function(){}; + + $.mobile.media = function(){ return true; }; + + $.testHelper.reloadModule( moduleName ).done( function() { + ok($.support.cssTransitions, "css transitions are supported" ); + ok($.support.pushState, "push state is supported" ); + ok($.support.mediaquery, "media queries are supported" ); + start(); + }); + }); + + asyncTest( "detects orientation change", function() { + $.extend(window, { + orientation: true, + onorientationchange: true + }); + + $.testHelper.reloadModule( "jquery.mobile.support.orientation" ).done( function() { + ok($.support.orientation, "orientation is supported" ); + start(); + }); + }); + + asyncTest( "detects touch", function() { + document.ontouchend = true; + + $.testHelper.reloadModule( "jquery.mobile.support.touch" ).done( function() { + ok( $.mobile.support.touch, "touch is supported" ); + ok( $.support.touch, "touch is supported" ); + start(); + }); + }); + + asyncTest( "detects functionality from basic negative properties and attributes (where possible)", function(){ + delete window["orientation"]; + + $.testHelper.reloadModule( "jquery.mobile.support.orientation" ).done( function() { + ok(!$.support.orientation, "orientation is not supported" ); + start(); + }); + }); + + // NOTE mocks prependTo to simulate base href updates or lack thereof + var mockBaseCheck = function( url ){ + var prependToFn = $.fn.prependTo; + + $.fn.prependTo = function( selector ){ + var result = prependToFn.call(this, selector); + if(this[0].href && this[0].href.indexOf("testurl") != -1) + result = [{href: url}]; + return result; + }; + }; + + asyncTest( "detects dynamic base tag when new base element added and base href updates", function(){ + mockBaseCheck(location.protocol + '//' + location.host + location.pathname + "ui-dir/"); + $.testHelper.reloadModule( moduleName ).done( function() { + ok($.support.dynamicBaseTag); + start(); + }); + }); + + asyncTest( "detects no dynamic base tag when new base element added and base href unchanged", function(){ + mockBaseCheck('testurl'); + $.testHelper.reloadModule( moduleName ).done( function() { + ok(!$.support.dynamicBaseTag); + start(); + }); + }); + + asyncTest( "jQM's IE browser check properly detects IE versions", function(){ + $.testHelper.reloadModule( moduleName ).done( function() { + //here we're just comparing our version to what the conditional compilation finds + var ie = !!$.browser.msie, //get a boolean + version = parseInt( $.browser.version, 10), + jqmdetectedver = $.mobile.browser.ie; + + if( ie ){ + deepEqual(version, jqmdetectedver, "It's IE and the version is correct"); + } + else{ + deepEqual(ie, jqmdetectedver, "It's not IE"); + } + start(); + }); + }); + + + //TODO propExists testing, refactor propExists into mockable method + //TODO scrollTop testing, refactor scrollTop logic into mockable method +}); diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/swarminject.js b/libs/js/jquery-mobile-1.1.0/tests/unit/swarminject.js new file mode 100755 index 0000000..db69326 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/swarminject.js @@ -0,0 +1,9 @@ +// load testswarm agent +(function() { + var url = window.location.search; + url = decodeURIComponent( url.slice( url.indexOf("swarmURL=") + 9 ) ); + if ( !url || url.indexOf("http") !== 0 ) { + return; + } + document.write(""); +})(); diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/textinput/external.html b/libs/js/jquery-mobile-1.1.0/tests/unit/textinput/external.html new file mode 100644 index 0000000..2d10dd6 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/textinput/external.html @@ -0,0 +1,38 @@ + + + + + +
        + +
        + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/textinput/index.html b/libs/js/jquery-mobile-1.1.0/tests/unit/textinput/index.html new file mode 100644 index 0000000..7b21eb1 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/textinput/index.html @@ -0,0 +1,60 @@ + + + + + + jQuery Mobile Textinput Test Suite + + + + + + + + + + + + + + +

        jQuery Mobile Textinput Test Suite

        +

        +

        +
          +
        + +
        + + + + + + + + + external + + +
        + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/textinput/settings.js b/libs/js/jquery-mobile-1.1.0/tests/unit/textinput/settings.js new file mode 100644 index 0000000..0e68422 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/textinput/settings.js @@ -0,0 +1,3 @@ +$( document ).bind("mobileinit", function(){ + $.mobile.textinput.prototype.options.clearSearchButtonText = "custom value"; +}); diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/textinput/textinput_core.js b/libs/js/jquery-mobile-1.1.0/tests/unit/textinput/textinput_core.js new file mode 100644 index 0000000..78c1e3e --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/textinput/textinput_core.js @@ -0,0 +1,66 @@ +/* + * mobile textinput unit tests + */ +(function($){ + module( "jquery.mobile.forms.textinput.js" ); + + test( "inputs without type specified are enhanced", function(){ + ok( $( "#typeless-input" ).hasClass( "ui-input-text" ) ); + }); + + $.mobile.page.prototype.options.keepNative = "textarea.should-be-native"; + + // not testing the positive case here since's it's obviously tested elsewhere + test( "textarea in the keepNative set shouldn't be enhanced", function() { + ok( !$("textarea.should-be-native").is("ui-input-text") ); + }); + + asyncTest( "textarea should autogrow on document ready", function() { + var test = $( "#init-autogrow" ); + + setTimeout(function() { + ok( $( "#reference-autogrow" )[0].clientHeight < test[0].clientHeight, "the height is greater than the reference text area with no content" ); + ok( test[0].clientHeight > 100, "autogrow text area's height is greater than any style padding"); + start(); + }, 400); + }); + + asyncTest( "textarea should autogrow when text is added via the keyboard", function() { + var test = $( "#keyup-autogrow" ), + originalHeight = test[0].clientHeight; + + test.keyup(function() { + setTimeout(function() { + ok( test[0].clientHeight > originalHeight, "the height is greater than original with no content" ); + ok( test[0].clientHeight > 100, "autogrow text area's height is greater any style/padding"); + start(); + }, 400); + }); + + test.val("foo\n\n\n\n\n\n\n\n\n\n\n\n\n\n").trigger("keyup"); + }); + + asyncTest( "text area should auto grow when the parent page is loaded via ajax", function() { + $.testHelper.pageSequence([ + function() { + $("#external").click(); + }, + + function() { + setTimeout(function() { + ok($.mobile.activePage.find( "textarea" )[0].clientHeight > 100, "text area's height has grown"); + window.history.back(); + }, 1000); + }, + + function() { + start(); + } + ]); + }); + + // NOTE init binding to alter the setting is in settings.js + test( "'clear text' button for search inputs should use configured text", function(){ + strictEqual( $( "#search-input" ).closest( ".ui-input-search" ).find( ".ui-input-clear" ).attr( "title" ), "custom value" ); + }); +})(jQuery); \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/widget/index.html b/libs/js/jquery-mobile-1.1.0/tests/unit/widget/index.html new file mode 100644 index 0000000..f42080e --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/widget/index.html @@ -0,0 +1,80 @@ + + + + + + jQuery Mobile Widget Test Suite + + + + + + + + + + + + + + + +

        jQuery Mobile Widget Test Suite

        +

        +

        +
          +
        + +
        + +
        +
        +
        ...
        +
        +
        + +
        + +
        + +
        +
        +
        +
        +
        + + + + + + + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/widget/widget_core.js b/libs/js/jquery-mobile-1.1.0/tests/unit/widget/widget_core.js new file mode 100644 index 0000000..520bccd --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/widget/widget_core.js @@ -0,0 +1,52 @@ +/* + * mobile widget unit tests + */ +(function($){ + module('jquery.mobile.widget.js'); + + test( "getting data from creation options", function(){ + var expected = "bizzle"; + + $.mobile.widget.prototype.options = { "fooBar" : true }; + $.mobile.widget.prototype.element = $("
        "); + same($.mobile.widget.prototype._getCreateOptions()["fooBar"], + expected); + }); + + test( "getting no data when the options are empty", function(){ + var expected = {}; + + $.mobile.widget.prototype.options = {}; + $.mobile.widget.prototype.element = $("
        "); + same($.mobile.widget.prototype._getCreateOptions(), + expected); + }); + + test( "getting no data when the element has none", function(){ + var expected = {}; + + $.mobile.widget.prototype.options = { "fooBar" : true }; + $.mobile.widget.prototype.element = $("
        "); + same($.mobile.widget.prototype._getCreateOptions(), + expected); + }); + + test( "elements embedded in sub page elements are excluded on create when they match the keep native selector", function() { + // uses default keep native of data-role=none + $("#enhance-prevented") + .append('') + .trigger("create"); + + ok( !$("#unenhanced").hasClass( "ui-input-text" ), "doesn't have the ui input text class (unenhanced)"); + }); + + test( "elements embedded in sub page elements are included on create when they don't match the keep native selector", function() { + + // uses default keep native of data-role=none + $("#enhance-allowed") + .append('') + .trigger("create"); + + ok( $("#enhanced").hasClass( "ui-input-text" ), "has the ui input text class (unenhanced)"); + }); +})(jQuery); \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/widget/widget_init.js b/libs/js/jquery-mobile-1.1.0/tests/unit/widget/widget_init.js new file mode 100644 index 0000000..6f14626 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/widget/widget_init.js @@ -0,0 +1,45 @@ +/* + * mobile widget unit tests + */ +(function($){ + var widgetInitialized = false; + + module( 'jquery.mobile.widget.js' ); + + $( "#foo" ).live( 'pageinit', function(){ + // ordering sensitive here, the value has to be set after the call + // so that if the widget factory says that its not yet initialized, + // which is an exception, the value won't be set + $( "#foo-slider" ).slider( 'refresh' ); + widgetInitialized = true; + }); + + test( "page is enhanced before init is fired", function() { + ok( widgetInitialized ); + }); + + test( "elements within an ignore container are not enhanced when ignoreContentEnabled is true ", function() { + $.mobile.ignoreContentEnabled = true; + + $.mobile.collapsible.prototype.enhanceWithin( $("#ignored") ); + + ok( !$( "#ignored-collapsible" ).hasClass( "ui-collapsible" ), "ignored element doesn't have ui-collapsible" ); + + $.mobile.collapsible.prototype.enhanceWithin( $("#not-ignored") ); + + ok( $( "#collapsible" ).hasClass( "ui-collapsible" ), "identical unignored elements are enahanced" ); + + $.mobile.ignoreContentEnabled = false; + }); + + test( "siblings without ignore parent are enhanced", function() { + $.mobile.ignoreContentEnabled = true; + + $.mobile.collapsible.prototype.enhanceWithin( $("#many-ignored") ); + + ok( !$( "#many-ignored-collapsible" ).hasClass( "ui-collapsible" ), "sibling ignored element doesn't have ui-collapsible" ); + ok( $( "#many-enhanced-collapsible" ).hasClass( "ui-collapsible" ), "sibling unignored elements are enahanced" ); + + $.mobile.ignoreContentEnabled = false; + }); +})( jQuery ); \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/zoom/index.html b/libs/js/jquery-mobile-1.1.0/tests/unit/zoom/index.html new file mode 100644 index 0000000..84eb44a --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/zoom/index.html @@ -0,0 +1,46 @@ + + + + + jQuery Mobile Zoom Maniplation Integration Test + + + + + + + + + + + + + + + + +

        jQuery Mobile FieldContainer Test Suite

        +

        +

        +
          +
        + +
        + + +
        + + + + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/zoom/initial-disable.html b/libs/js/jquery-mobile-1.1.0/tests/unit/zoom/initial-disable.html new file mode 100644 index 0000000..0b9eaab --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/zoom/initial-disable.html @@ -0,0 +1,46 @@ + + + + + jQuery Mobile Zoom Maniplation Integration Test + + + + + + + + + + + + + + + + +

        jQuery Mobile FieldContainer Test Suite

        +

        +

        +
          +
        + +
        + + +
        + + + + + diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/zoom/zoom-initial-disable.js b/libs/js/jquery-mobile-1.1.0/tests/unit/zoom/zoom-initial-disable.js new file mode 100644 index 0000000..5dcb239 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/zoom/zoom-initial-disable.js @@ -0,0 +1,9 @@ +/* + * mobile zoom + */ +(function($){ + test( "User zooming will not enable when calling enable() method if zooming was disabled in page source", function(){ + $.mobile.zoom.enable(); + ok( !$.mobile.zoom.enabled ); + }); +})(jQuery); \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/tests/unit/zoom/zoom.js b/libs/js/jquery-mobile-1.1.0/tests/unit/zoom/zoom.js new file mode 100644 index 0000000..0f7a8f7 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tests/unit/zoom/zoom.js @@ -0,0 +1,99 @@ +/* + * mobile Fixed Toolbar unit tests + */ +(function($){ + module('jquery.mobile.fixedToolbar.js'); + + var defaultMeta = $( "meta[name=viewport]" ).attr("content"); + + + test( "User zooming is enabled by default", function(){ + ok( $.mobile.zoom.enabled === true, "property is true" ); + }); + + test( "The zoom lock is disabled by default", function(){ + ok( $.mobile.zoom.locked === false, "property is false" ); + }); + + + test( "Meta viewport content is manipulated with maximum-scale", function(){ + $.mobile.zoom.disable(); + ok( $( "meta[name=viewport]" ).attr( "content" ).match( /,maximum-scale=1, user-scalable=no/ ), "The meta viewport tag's content contains maximum-scale=1, user-scalable=yes after enable is called" ); + + $.mobile.zoom.enable(); + ok( $( "meta[name=viewport]" ).attr( "content" ).match( /,maximum-scale=10, user-scalable=yes/ ), "The meta viewport tag's content contains maximum-scale=1, user-scalable=yes0, user-scalable=no after enable is called" ); + + }); + + test( "Meta viewport content restore method restores it back to original value", function(){ + $.mobile.zoom.disable(); + ok( $( "meta[name=viewport]" ).attr( "content" ).match( /,maximum-scale=1, user-scalable=no/ ), "The meta viewport tag's content contains maximum-scale=1, user-scalable=yes after enable is called" ); + + $.mobile.zoom.restore(); + ok( $( "meta[name=viewport]" ).attr( "content" ) === defaultMeta, "The meta viewport tag's content matches its default state" ); + + }); + + + + test( "When locked, the enable method does nothing", function(){ + //enabled it first + $.mobile.zoom.locked = false; + $.mobile.zoom.disable(); + $.mobile.zoom.locked = true; + $.mobile.zoom.enable(); + + ok( $( "meta[name=viewport]" ).attr( "content" ).match( /,maximum-scale=1, user-scalable=no/ ), "The meta viewport tag's content contains maximum-scale=1, user-scalable=yes after enable is called" ); + $.mobile.zoom.locked = false; + $.mobile.zoom.enable(); + + }); + + test( "When locked, the disable method does nothing", function(){ + //enabled it first + $.mobile.zoom.locked = false; + $.mobile.zoom.enable(); + $.mobile.zoom.locked = true; + $.mobile.zoom.disable(); + + ok( $( "meta[name=viewport]" ).attr( "content" ).match( /,maximum-scale=10, user-scalable=yes/ ), "The meta viewport tag's content contains maximum-scale=1, user-scalable=yes0, user-scalable=no after disable is called" ); + + $.mobile.zoom.locked = false; + $.mobile.zoom.enable(); + + }); + + test( "When locked, the enable method with a true 'unlock' argument works", function(){ + //enabled it first + $.mobile.zoom.locked = false; + $.mobile.zoom.disable(); + $.mobile.zoom.locked = true; + $.mobile.zoom.enable( true ); + + ok( $( "meta[name=viewport]" ).attr( "content" ).match( /,maximum-scale=10, user-scalable=yes/ ), "The meta viewport tag's content contains maximum-scale=1, user-scalable=yes0, user-scalable=no after enable is called" ); + ok( $.mobile.zoom.locked === false, "The locked property is false again" ); + + $.mobile.zoom.locked = false; + $.mobile.zoom.enable(); + + }); + + + test( "When locked, the disable method with a true 'lock' argument works", function(){ + //enabled it first + $.mobile.zoom.locked = false; + $.mobile.zoom.enable(); + + $.mobile.zoom.disable( true ); + + ok( $( "meta[name=viewport]" ).attr( "content" ).match( /,maximum-scale=1, user-scalable=no/ ), "The meta viewport tag's content contains maximum-scale=1, user-scalable=yes after disable is called" ); + ok( $.mobile.zoom.locked === true, "The locked property is true" ); + + $.mobile.zoom.locked = false; + $.mobile.zoom.enable(); + + }); + + + +})(jQuery); diff --git a/libs/js/jquery-mobile-1.1.0/tools/config-props.html b/libs/js/jquery-mobile-1.1.0/tools/config-props.html new file mode 100644 index 0000000..7d74114 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tools/config-props.html @@ -0,0 +1,73 @@ + + + + + +Configuration Properties + + + + + + + + +
        +

        Configuration Properties

        +
        +

        Below is a dump of the non-function/object properties of the $.mobile and $.support objects. These properties typically control how the jQuery Mobile framework behaves on the various devices/platforms. You can use this page to quickly assess the default support configuration calculated by both jQuery Core and jQuery Mobile.

        +
        +
        + + diff --git a/libs/js/jquery-mobile-1.1.0/tools/index.html b/libs/js/jquery-mobile-1.1.0/tools/index.html new file mode 100644 index 0000000..e9ba683 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tools/index.html @@ -0,0 +1,33 @@ + + + + +jQuery Mobile Tools + + + + + + + + + diff --git a/libs/js/jquery-mobile-1.1.0/tools/log-page-events.html b/libs/js/jquery-mobile-1.1.0/tools/log-page-events.html new file mode 100644 index 0000000..8176d58 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tools/log-page-events.html @@ -0,0 +1,24 @@ + + + + + +Page Event Logger Bookmarklet + + + +

        Page Event Logger Bookmarklet

        +

        A simple bookmarklet for logging jQuery Mobile page events. To use, bookmark the following link:

        + +

        For platforms that don't allow bookmarking of javascript: urls, you can copy/paste the following source for the bookmarklet directly into the browser's location bar then hit enter or hit the "go" button on your keypad:

        +

        + +

        +

        NOTE: Some browsers like Chrome will strip off the javascript: prefix from the string above when you paste it into the location bar. Make sure what you pasted is prefixed by javascript: before attempting to load the bookmarklet.

        + + + diff --git a/libs/js/jquery-mobile-1.1.0/tools/log-page-events.js b/libs/js/jquery-mobile-1.1.0/tools/log-page-events.js new file mode 100644 index 0000000..c5ed9f9 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tools/log-page-events.js @@ -0,0 +1,108 @@ +/*! + * jQuery Mobile v@VERSION + * http://jquerymobile.com/ + * + * Copyright 2011, jQuery Project + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + */ + +// This is code that can be used as a simple bookmarklet for debugging +// page loading and navigation in pages that use the jQuery Mobile framework. +// All messages are sent to the browser's console.log so to see the messages, +// you need to make sure you enable the console/log in your browser. + +(function($, window, document) { + if ( typeof $ === "undefined" ) { + alert( "log-page-events.js requires jQuery core!" ); + return; + } + + var pageEvents = "mobileinit pagebeforechange pagechange pagechangefailed pagebeforeload pageload pageloadfailed pagebeforecreate pagecreate pageinit pagebeforeshow pageshow pagebeforehide pagehide pageremove"; + + function getElementDesc( ele ) + { + var result = []; + if ( ele ) { + result.push( ele.nodeName.toLowerCase() ); + var c = ele.className; + if ( c ) { + c = c.replace( /^\s+|\s+$/, "" ).replace( /\s+/, " " ); + if (c) { + result.push( "." + c.split( " " ).join( "." ) ); + } + } + if ( ele.id ){ + result.push( "#" + ele.id ) + } + } + return result.join( "" ); + } + + function debugLog( msg ) + { + console.log( msg ); + } + + function getNativeEvent( event ) { + + while ( event && typeof event.originalEvent !== "undefined" ) { + event = event.originalEvent; + } + return event; + } + + function logEvent( event, data ) + { + var result = event.type + " (" + (new Date).getTime() + ")\n"; + + switch( event.type ) + { + case "pagebeforechange": + case "pagechange": + case "pagechangefailed": + result += "\tpage: "; + if ( typeof data.toPage === "string" ) { + result += data.toPage; + } else { + result += getElementDesc( data.toPage[ 0 ] ) + "\n\tdata-url: " + data.toPage.jqmData( "url" ); + } + result += "\n\n" + break; + case "pagebeforeload": + case "pageloadfailed": + result += "\turl: " + data.url + "\n\tabsUrl: " + data.absUrl + "\n\n"; + break; + case "pageload": + result += "\turl: " + data.url + "\n\tabsUrl: " + data.absUrl + "\n\tpage: " + getElementDesc( data.page[ 0 ] ) + "\n\n"; + break; + case "pagebeforeshow": + case "pageshow": + case "pagebeforehide": + case "pagehide": + result += "\tpage: " + getElementDesc( event.target ) + "\n"; + result += "\tdata-url: " + $( event.target ).jqmData( "url" ) + "\n\n"; + break; + case "pagebeforecreate": + case "pagecreate": + case "pageinit": + result += "\telement: " + getElementDesc( event.target ) + "\n\n"; + break; + case "hashchange": + result += "\tlocation: " + location.href + "\n\n"; + break; + case "popstate": + var e = getNativeEvent( event ); + result += "\tlocation: " + location.href + "\n"; + result += "\tstate.hash: " + ( e.state && e.state.hash ? e.state.hash + "\n\n" : "" ); + break; + } + + debugLog( result ); + } + + // Now add our logger. + $( document ).bind( pageEvents, logEvent ); + $( window ).bind( "hashchange popstate", logEvent ); + +})( jQuery, window, document ); \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/tools/page-change-time.html b/libs/js/jquery-mobile-1.1.0/tools/page-change-time.html new file mode 100644 index 0000000..1cd7cf3 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tools/page-change-time.html @@ -0,0 +1,24 @@ + + + + + +Page Change Timing Bookmarklet + + + +

        Page Change Timing Bookmarklet

        +

        A simple bookmarklet for timing the load, enhanement, and transition of a jQuery Mobile changePage() request. To use, bookmark the following link:

        + +

        For platforms that don't allow bookmarking of javascript: urls, you can copy/paste the following source for the bookmarklet directly into the browser's location bar then hit enter or hit the "go" button on your keypad:

        +

        + +

        +

        NOTE: Some browsers like Chrome will strip off the javascript: prefix from the string above when you paste it into the location bar. Make sure what you pasted is prefixed by javascript: before attempting to load the bookmarklet.

        + + + diff --git a/libs/js/jquery-mobile-1.1.0/tools/page-change-time.js b/libs/js/jquery-mobile-1.1.0/tools/page-change-time.js new file mode 100644 index 0000000..81ce57a --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/tools/page-change-time.js @@ -0,0 +1,61 @@ +/*! + * jQuery Mobile v@VERSION + * http://jquerymobile.com/ + * + * Copyright 2011, jQuery Project + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + */ + +// This is code that can be used as a simple bookmarklet for timing +// the load, enhancment, and transition of a changePage() request. + +(function( $, window, undefined ) { + + + function getTime() { + return ( new Date() ).getTime(); + } + + var startChange, stopChange, startLoad, stopLoad, startEnhance, stopEnhance, startTransition, stopTransition, lock = 0; + + $( document ) + .bind( "pagebeforechange", function( e, data) { + if ( typeof data.toPage === "string" ) { + startChange = stopChange = startLoad = stopLoad = startEnhance = stopEnhance = startTransition = stopTransition = getTime(); + } + }) + .bind( "pagebeforeload", function() { + startLoad = stopLoad = getTime(); + }) + .bind( "pagebeforecreate", function() { + if ( ++lock === 1 ) { + stopLoad = startEnhance = stopEnhance = getTime(); + } + }) + .bind( "pageinit", function() { + if ( --lock === 0 ) { + stopEnhance = getTime(); + } + }) + .bind( "pagebeforeshow", function() { + startTransition = stopTransition = getTime(); + }) + .bind( "pageshow", function() { + stopTransition = getTime(); + }) + .bind( "pagechange", function( e, data ) { + if ( typeof data.toPage === "object" ) { + stopChange = getTime(); + + alert("load + processing: " + ( stopLoad - startLoad ) + + "\nenhance: " + ( stopEnhance - startEnhance ) + + "\ntransition: " + ( stopTransition - startTransition ) + + "\ntotalTime: " + ( stopChange - startChange ) ); + + startChange = stopChange = startLoad = stopLoad = startEnhance = stopEnhance = startTransition = stopTransition = 0; + } + }); + + +})( jQuery, window ); \ No newline at end of file diff --git a/libs/js/jquery-mobile-1.1.0/version.txt b/libs/js/jquery-mobile-1.1.0/version.txt new file mode 100644 index 0000000..9084fa2 --- /dev/null +++ b/libs/js/jquery-mobile-1.1.0/version.txt @@ -0,0 +1 @@ +1.1.0 diff --git a/libs/js/jquery.easing.1.3.js b/libs/js/jquery.easing.1.3.js new file mode 100644 index 0000000..ef74321 --- /dev/null +++ b/libs/js/jquery.easing.1.3.js @@ -0,0 +1,205 @@ +/* + * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ + * + * Uses the built in easing capabilities added In jQuery 1.1 + * to offer multiple easing options + * + * TERMS OF USE - jQuery Easing + * + * Open source under the BSD License. + * + * Copyright © 2008 George McGinley Smith + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * Neither the name of the author nor the names of contributors may be used to endorse + * or promote products derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * +*/ + +// t: current time, b: begInnIng value, c: change In value, d: duration +jQuery.easing['jswing'] = jQuery.easing['swing']; + +jQuery.extend( jQuery.easing, +{ + def: 'easeOutQuad', + swing: function (x, t, b, c, d) { + //alert(jQuery.easing.default); + return jQuery.easing[jQuery.easing.def](x, t, b, c, d); + }, + easeInQuad: function (x, t, b, c, d) { + return c*(t/=d)*t + b; + }, + easeOutQuad: function (x, t, b, c, d) { + return -c *(t/=d)*(t-2) + b; + }, + easeInOutQuad: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return c/2*t*t + b; + return -c/2 * ((--t)*(t-2) - 1) + b; + }, + easeInCubic: function (x, t, b, c, d) { + return c*(t/=d)*t*t + b; + }, + easeOutCubic: function (x, t, b, c, d) { + return c*((t=t/d-1)*t*t + 1) + b; + }, + easeInOutCubic: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return c/2*t*t*t + b; + return c/2*((t-=2)*t*t + 2) + b; + }, + easeInQuart: function (x, t, b, c, d) { + return c*(t/=d)*t*t*t + b; + }, + easeOutQuart: function (x, t, b, c, d) { + return -c * ((t=t/d-1)*t*t*t - 1) + b; + }, + easeInOutQuart: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return c/2*t*t*t*t + b; + return -c/2 * ((t-=2)*t*t*t - 2) + b; + }, + easeInQuint: function (x, t, b, c, d) { + return c*(t/=d)*t*t*t*t + b; + }, + easeOutQuint: function (x, t, b, c, d) { + return c*((t=t/d-1)*t*t*t*t + 1) + b; + }, + easeInOutQuint: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b; + return c/2*((t-=2)*t*t*t*t + 2) + b; + }, + easeInSine: function (x, t, b, c, d) { + return -c * Math.cos(t/d * (Math.PI/2)) + c + b; + }, + easeOutSine: function (x, t, b, c, d) { + return c * Math.sin(t/d * (Math.PI/2)) + b; + }, + easeInOutSine: function (x, t, b, c, d) { + return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b; + }, + easeInExpo: function (x, t, b, c, d) { + return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b; + }, + easeOutExpo: function (x, t, b, c, d) { + return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b; + }, + easeInOutExpo: function (x, t, b, c, d) { + if (t==0) return b; + if (t==d) return b+c; + if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b; + return c/2 * (-Math.pow(2, -10 * --t) + 2) + b; + }, + easeInCirc: function (x, t, b, c, d) { + return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b; + }, + easeOutCirc: function (x, t, b, c, d) { + return c * Math.sqrt(1 - (t=t/d-1)*t) + b; + }, + easeInOutCirc: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b; + return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b; + }, + easeInElastic: function (x, t, b, c, d) { + var s=1.70158;var p=0;var a=c; + if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; + if (a < Math.abs(c)) { a=c; var s=p/4; } + else var s = p/(2*Math.PI) * Math.asin (c/a); + return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; + }, + easeOutElastic: function (x, t, b, c, d) { + var s=1.70158;var p=0;var a=c; + if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; + if (a < Math.abs(c)) { a=c; var s=p/4; } + else var s = p/(2*Math.PI) * Math.asin (c/a); + return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; + }, + easeInOutElastic: function (x, t, b, c, d) { + var s=1.70158;var p=0;var a=c; + if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5); + if (a < Math.abs(c)) { a=c; var s=p/4; } + else var s = p/(2*Math.PI) * Math.asin (c/a); + if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; + return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b; + }, + easeInBack: function (x, t, b, c, d, s) { + if (s == undefined) s = 1.70158; + return c*(t/=d)*t*((s+1)*t - s) + b; + }, + easeOutBack: function (x, t, b, c, d, s) { + if (s == undefined) s = 1.70158; + return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; + }, + easeInOutBack: function (x, t, b, c, d, s) { + if (s == undefined) s = 1.70158; + if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; + return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; + }, + easeInBounce: function (x, t, b, c, d) { + return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b; + }, + easeOutBounce: function (x, t, b, c, d) { + if ((t/=d) < (1/2.75)) { + return c*(7.5625*t*t) + b; + } else if (t < (2/2.75)) { + return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; + } else if (t < (2.5/2.75)) { + return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; + } else { + return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; + } + }, + easeInOutBounce: function (x, t, b, c, d) { + if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b; + return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b; + } +}); + +/* + * + * TERMS OF USE - EASING EQUATIONS + * + * Open source under the BSD License. + * + * Copyright © 2001 Robert Penner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * Neither the name of the author nor the names of contributors may be used to endorse + * or promote products derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ \ No newline at end of file diff --git a/libs/js/jquery.mobile.loadstructure.js b/libs/js/jquery.mobile.loadstructure.js new file mode 100644 index 0000000..55457b4 --- /dev/null +++ b/libs/js/jquery.mobile.loadstructure.js @@ -0,0 +1,22 @@ +jQuery.extend( jQuery.mobile, +{ + loadStructure: function(widgetname) { + var ret = undefined, + theScriptTag = $("script[data-framework-version][data-framework-root][data-framework-theme]"), + frameworkRootPath = theScriptTag.attr("data-framework-root") + "/" + + theScriptTag.attr("data-framework-version") + "/", + protoPath = frameworkRootPath + "proto-html" + "/" + + theScriptTag.attr("data-framework-theme"); + + $.ajax({ + url: protoPath + "/" + widgetname + ".prototype.html", + async: false, + dataType: "html" + }) + .success(function(data, textStatus, jqXHR) { + ret = $("
        ").html(data.replace(/\$\{FRAMEWORK_ROOT\}/g, frameworkRootPath)); + }); + + return ret; + } +}); diff --git a/libs/js/jquery.tmpl.js b/libs/js/jquery.tmpl.js new file mode 100644 index 0000000..7e850f9 --- /dev/null +++ b/libs/js/jquery.tmpl.js @@ -0,0 +1,484 @@ +/*! + * jQuery Templates Plugin 1.0.0pre + * http://github.com/jquery/jquery-tmpl + * Requires jQuery 1.4.2 + * + * Copyright Software Freedom Conservancy, Inc. + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + */ +(function( jQuery, undefined ){ + var oldManip = jQuery.fn.domManip, tmplItmAtt = "_tmplitem", htmlExpr = /^[^<]*(<[\w\W]+>)[^>]*$|\{\{\! /, + newTmplItems = {}, wrappedItems = {}, appendToTmplItems, topTmplItem = { key: 0, data: {} }, itemKey = 0, cloneIndex = 0, stack = []; + + function newTmplItem( options, parentItem, fn, data ) { + // Returns a template item data structure for a new rendered instance of a template (a 'template item'). + // The content field is a hierarchical array of strings and nested items (to be + // removed and replaced by nodes field of dom elements, once inserted in DOM). + var newItem = { + data: data || (data === 0 || data === false) ? data : (parentItem ? parentItem.data : {}), + _wrap: parentItem ? parentItem._wrap : null, + tmpl: null, + parent: parentItem || null, + nodes: [], + calls: tiCalls, + nest: tiNest, + wrap: tiWrap, + html: tiHtml, + update: tiUpdate + }; + if ( options ) { + jQuery.extend( newItem, options, { nodes: [], parent: parentItem }); + } + if ( fn ) { + // Build the hierarchical content to be used during insertion into DOM + newItem.tmpl = fn; + newItem._ctnt = newItem._ctnt || newItem.tmpl( jQuery, newItem ); + newItem.key = ++itemKey; + // Keep track of new template item, until it is stored as jQuery Data on DOM element + (stack.length ? wrappedItems : newTmplItems)[itemKey] = newItem; + } + return newItem; + } + + // Override appendTo etc., in order to provide support for targeting multiple elements. (This code would disappear if integrated in jquery core). + jQuery.each({ + appendTo: "append", + prependTo: "prepend", + insertBefore: "before", + insertAfter: "after", + replaceAll: "replaceWith" + }, function( name, original ) { + jQuery.fn[ name ] = function( selector ) { + var ret = [], insert = jQuery( selector ), elems, i, l, tmplItems, + parent = this.length === 1 && this[0].parentNode; + + appendToTmplItems = newTmplItems || {}; + if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) { + insert[ original ]( this[0] ); + ret = this; + } else { + for ( i = 0, l = insert.length; i < l; i++ ) { + cloneIndex = i; + elems = (i > 0 ? this.clone(true) : this).get(); + jQuery( insert[i] )[ original ]( elems ); + ret = ret.concat( elems ); + } + cloneIndex = 0; + ret = this.pushStack( ret, name, insert.selector ); + } + tmplItems = appendToTmplItems; + appendToTmplItems = null; + jQuery.tmpl.complete( tmplItems ); + return ret; + }; + }); + + jQuery.fn.extend({ + // Use first wrapped element as template markup. + // Return wrapped set of template items, obtained by rendering template against data. + tmpl: function( data, options, parentItem ) { + return jQuery.tmpl( this[0], data, options, parentItem ); + }, + + // Find which rendered template item the first wrapped DOM element belongs to + tmplItem: function() { + return jQuery.tmplItem( this[0] ); + }, + + // Consider the first wrapped element as a template declaration, and get the compiled template or store it as a named template. + template: function( name ) { + return jQuery.template( name, this[0] ); + }, + + domManip: function( args, table, callback, options ) { + if ( args[0] && jQuery.isArray( args[0] )) { + var dmArgs = jQuery.makeArray( arguments ), elems = args[0], elemsLength = elems.length, i = 0, tmplItem; + while ( i < elemsLength && !(tmplItem = jQuery.data( elems[i++], "tmplItem" ))) {} + if ( tmplItem && cloneIndex ) { + dmArgs[2] = function( fragClone ) { + // Handler called by oldManip when rendered template has been inserted into DOM. + jQuery.tmpl.afterManip( this, fragClone, callback ); + }; + } + oldManip.apply( this, dmArgs ); + } else { + oldManip.apply( this, arguments ); + } + cloneIndex = 0; + if ( !appendToTmplItems ) { + jQuery.tmpl.complete( newTmplItems ); + } + return this; + } + }); + + jQuery.extend({ + // Return wrapped set of template items, obtained by rendering template against data. + tmpl: function( tmpl, data, options, parentItem ) { + var ret, topLevel = !parentItem; + if ( topLevel ) { + // This is a top-level tmpl call (not from a nested template using {{tmpl}}) + parentItem = topTmplItem; + tmpl = jQuery.template[tmpl] || jQuery.template( null, tmpl ); + wrappedItems = {}; // Any wrapped items will be rebuilt, since this is top level + } else if ( !tmpl ) { + // The template item is already associated with DOM - this is a refresh. + // Re-evaluate rendered template for the parentItem + tmpl = parentItem.tmpl; + newTmplItems[parentItem.key] = parentItem; + parentItem.nodes = []; + if ( parentItem.wrapped ) { + updateWrapped( parentItem, parentItem.wrapped ); + } + // Rebuild, without creating a new template item + return jQuery( build( parentItem, null, parentItem.tmpl( jQuery, parentItem ) )); + } + if ( !tmpl ) { + return []; // Could throw... + } + if ( typeof data === "function" ) { + data = data.call( parentItem || {} ); + } + if ( options && options.wrapped ) { + updateWrapped( options, options.wrapped ); + } + ret = jQuery.isArray( data ) ? + jQuery.map( data, function( dataItem ) { + return dataItem ? newTmplItem( options, parentItem, tmpl, dataItem ) : null; + }) : + [ newTmplItem( options, parentItem, tmpl, data ) ]; + return topLevel ? jQuery( build( parentItem, null, ret ) ) : ret; + }, + + // Return rendered template item for an element. + tmplItem: function( elem ) { + var tmplItem; + if ( elem instanceof jQuery ) { + elem = elem[0]; + } + while ( elem && elem.nodeType === 1 && !(tmplItem = jQuery.data( elem, "tmplItem" )) && (elem = elem.parentNode) ) {} + return tmplItem || topTmplItem; + }, + + // Set: + // Use $.template( name, tmpl ) to cache a named template, + // where tmpl is a template string, a script element or a jQuery instance wrapping a script element, etc. + // Use $( "selector" ).template( name ) to provide access by name to a script block template declaration. + + // Get: + // Use $.template( name ) to access a cached template. + // Also $( selectorToScriptBlock ).template(), or $.template( null, templateString ) + // will return the compiled template, without adding a name reference. + // If templateString includes at least one HTML tag, $.template( templateString ) is equivalent + // to $.template( null, templateString ) + template: function( name, tmpl ) { + if (tmpl) { + // Compile template and associate with name + if ( typeof tmpl === "string" ) { + // This is an HTML string being passed directly in. + tmpl = buildTmplFn( tmpl ); + } else if ( tmpl instanceof jQuery ) { + tmpl = tmpl[0] || {}; + } + if ( tmpl.nodeType ) { + // If this is a template block, use cached copy, or generate tmpl function and cache. + tmpl = jQuery.data( tmpl, "tmpl" ) || jQuery.data( tmpl, "tmpl", buildTmplFn( tmpl.innerHTML )); + // Issue: In IE, if the container element is not a script block, the innerHTML will remove quotes from attribute values whenever the value does not include white space. + // This means that foo="${x}" will not work if the value of x includes white space: foo="${x}" -> foo=value of x. + // To correct this, include space in tag: foo="${ x }" -> foo="value of x" + } + return typeof name === "string" ? (jQuery.template[name] = tmpl) : tmpl; + } + // Return named compiled template + return name ? (typeof name !== "string" ? jQuery.template( null, name ): + (jQuery.template[name] || + // If not in map, and not containing at least on HTML tag, treat as a selector. + // (If integrated with core, use quickExpr.exec) + jQuery.template( null, htmlExpr.test( name ) ? name : jQuery( name )))) : null; + }, + + encode: function( text ) { + // Do HTML encoding replacing < > & and ' and " by corresponding entities. + return ("" + text).split("<").join("<").split(">").join(">").split('"').join(""").split("'").join("'"); + } + }); + + jQuery.extend( jQuery.tmpl, { + tag: { + "tmpl": { + _default: { $2: "null" }, + open: "if($notnull_1){__=__.concat($item.nest($1,$2));}" + // tmpl target parameter can be of type function, so use $1, not $1a (so not auto detection of functions) + // This means that {{tmpl foo}} treats foo as a template (which IS a function). + // Explicit parens can be used if foo is a function that returns a template: {{tmpl foo()}}. + }, + "wrap": { + _default: { $2: "null" }, + open: "$item.calls(__,$1,$2);__=[];", + close: "call=$item.calls();__=call._.concat($item.wrap(call,__));" + }, + "each": { + _default: { $2: "$index, $value" }, + open: "if($notnull_1){$.each($1a,function($2){with(this){", + close: "}});}" + }, + "if": { + open: "if(($notnull_1) && $1a){", + close: "}" + }, + "else": { + _default: { $1: "true" }, + open: "}else if(($notnull_1) && $1a){" + }, + "html": { + // Unecoded expression evaluation. + open: "if($notnull_1){__.push($1a);}" + }, + "=": { + // Encoded expression evaluation. Abbreviated form is ${}. + _default: { $1: "$data" }, + open: "if($notnull_1){__.push($.encode($1a));}" + }, + "!": { + // Comment tag. Skipped by parser + open: "" + } + }, + + // This stub can be overridden, e.g. in jquery.tmplPlus for providing rendered events + complete: function( items ) { + newTmplItems = {}; + }, + + // Call this from code which overrides domManip, or equivalent + // Manage cloning/storing template items etc. + afterManip: function afterManip( elem, fragClone, callback ) { + // Provides cloned fragment ready for fixup prior to and after insertion into DOM + var content = fragClone.nodeType === 11 ? + jQuery.makeArray(fragClone.childNodes) : + fragClone.nodeType === 1 ? [fragClone] : []; + + // Return fragment to original caller (e.g. append) for DOM insertion + callback.call( elem, fragClone ); + + // Fragment has been inserted:- Add inserted nodes to tmplItem data structure. Replace inserted element annotations by jQuery.data. + storeTmplItems( content ); + cloneIndex++; + } + }); + + //========================== Private helper functions, used by code above ========================== + + function build( tmplItem, nested, content ) { + // Convert hierarchical content into flat string array + // and finally return array of fragments ready for DOM insertion + var frag, ret = content ? jQuery.map( content, function( item ) { + return (typeof item === "string") ? + // Insert template item annotations, to be converted to jQuery.data( "tmplItem" ) when elems are inserted into DOM. + (tmplItem.key ? item.replace( /(<\w+)(?=[\s>])(?![^>]*_tmplitem)([^>]*)/g, "$1 " + tmplItmAtt + "=\"" + tmplItem.key + "\" $2" ) : item) : + // This is a child template item. Build nested template. + build( item, tmplItem, item._ctnt ); + }) : + // If content is not defined, insert tmplItem directly. Not a template item. May be a string, or a string array, e.g. from {{html $item.html()}}. + tmplItem; + if ( nested ) { + return ret; + } + + // top-level template + ret = ret.join(""); + + // Support templates which have initial or final text nodes, or consist only of text + // Also support HTML entities within the HTML markup. + ret.replace( /^\s*([^<\s][^<]*)?(<[\w\W]+>)([^>]*[^>\s])?\s*$/, function( all, before, middle, after) { + frag = jQuery( middle ).get(); + + storeTmplItems( frag ); + if ( before ) { + frag = unencode( before ).concat(frag); + } + if ( after ) { + frag = frag.concat(unencode( after )); + } + }); + return frag ? frag : unencode( ret ); + } + + function unencode( text ) { + // Use createElement, since createTextNode will not render HTML entities correctly + var el = document.createElement( "div" ); + el.innerHTML = text; + return jQuery.makeArray(el.childNodes); + } + + // Generate a reusable function that will serve to render a template against data + function buildTmplFn( markup ) { + return new Function("jQuery","$item", + // Use the variable __ to hold a string array while building the compiled template. (See https://github.com/jquery/jquery-tmpl/issues#issue/10). + "var $=jQuery,call,__=[],$data=$item.data;" + + + // Introduce the data as local variables using with(){} + "with($data){__.push('" + + + // Convert the template into pure JavaScript + jQuery.trim(markup) + .replace( /([\\'])/g, "\\$1" ) + .replace( /[\r\t\n]/g, " " ) + .replace( /\$\{([^\}]*)\}/g, "{{= $1}}" ) + .replace( /\{\{(\/?)(\w+|.)(?:\(((?:[^\}]|\}(?!\}))*?)?\))?(?:\s+(.*?)?)?(\(((?:[^\}]|\}(?!\}))*?)\))?\s*\}\}/g, + function( all, slash, type, fnargs, target, parens, args ) { + var tag = jQuery.tmpl.tag[ type ], def, expr, exprAutoFnDetect; + if ( !tag ) { + throw "Unknown template tag: " + type; + } + def = tag._default || []; + if ( parens && !/\w$/.test(target)) { + target += parens; + parens = ""; + } + if ( target ) { + target = unescape( target ); + args = args ? ("," + unescape( args ) + ")") : (parens ? ")" : ""); + // Support for target being things like a.toLowerCase(); + // In that case don't call with template item as 'this' pointer. Just evaluate... + expr = parens ? (target.indexOf(".") > -1 ? target + unescape( parens ) : ("(" + target + ").call($item" + args)) : target; + exprAutoFnDetect = parens ? expr : "(typeof(" + target + ")==='function'?(" + target + ").call($item):(" + target + "))"; + } else { + exprAutoFnDetect = expr = def.$1 || "null"; + } + fnargs = unescape( fnargs ); + return "');" + + tag[ slash ? "close" : "open" ] + .split( "$notnull_1" ).join( target ? "typeof(" + target + ")!=='undefined' && (" + target + ")!=null" : "true" ) + .split( "$1a" ).join( exprAutoFnDetect ) + .split( "$1" ).join( expr ) + .split( "$2" ).join( fnargs || def.$2 || "" ) + + "__.push('"; + }) + + "');}return __;" + ); + } + function updateWrapped( options, wrapped ) { + // Build the wrapped content. + options._wrap = build( options, true, + // Suport imperative scenario in which options.wrapped can be set to a selector or an HTML string. + jQuery.isArray( wrapped ) ? wrapped : [htmlExpr.test( wrapped ) ? wrapped : jQuery( wrapped ).html()] + ).join(""); + } + + function unescape( args ) { + return args ? args.replace( /\\'/g, "'").replace(/\\\\/g, "\\" ) : null; + } + function outerHtml( elem ) { + var div = document.createElement("div"); + div.appendChild( elem.cloneNode(true) ); + return div.innerHTML; + } + + // Store template items in jQuery.data(), ensuring a unique tmplItem data data structure for each rendered template instance. + function storeTmplItems( content ) { + var keySuffix = "_" + cloneIndex, elem, elems, newClonedItems = {}, i, l, m; + for ( i = 0, l = content.length; i < l; i++ ) { + if ( (elem = content[i]).nodeType !== 1 ) { + continue; + } + elems = elem.getElementsByTagName("*"); + for ( m = elems.length - 1; m >= 0; m-- ) { + processItemKey( elems[m] ); + } + processItemKey( elem ); + } + function processItemKey( el ) { + var pntKey, pntNode = el, pntItem, tmplItem, key; + // Ensure that each rendered template inserted into the DOM has its own template item, + if ( (key = el.getAttribute( tmplItmAtt ))) { + while ( pntNode.parentNode && (pntNode = pntNode.parentNode).nodeType === 1 && !(pntKey = pntNode.getAttribute( tmplItmAtt ))) { } + if ( pntKey !== key ) { + // The next ancestor with a _tmplitem expando is on a different key than this one. + // So this is a top-level element within this template item + // Set pntNode to the key of the parentNode, or to 0 if pntNode.parentNode is null, or pntNode is a fragment. + pntNode = pntNode.parentNode ? (pntNode.nodeType === 11 ? 0 : (pntNode.getAttribute( tmplItmAtt ) || 0)) : 0; + if ( !(tmplItem = newTmplItems[key]) ) { + // The item is for wrapped content, and was copied from the temporary parent wrappedItem. + tmplItem = wrappedItems[key]; + tmplItem = newTmplItem( tmplItem, newTmplItems[pntNode]||wrappedItems[pntNode] ); + tmplItem.key = ++itemKey; + newTmplItems[itemKey] = tmplItem; + } + if ( cloneIndex ) { + cloneTmplItem( key ); + } + } + el.removeAttribute( tmplItmAtt ); + } else if ( cloneIndex && (tmplItem = jQuery.data( el, "tmplItem" )) ) { + // This was a rendered element, cloned during append or appendTo etc. + // TmplItem stored in jQuery data has already been cloned in cloneCopyEvent. We must replace it with a fresh cloned tmplItem. + cloneTmplItem( tmplItem.key ); + newTmplItems[tmplItem.key] = tmplItem; + pntNode = jQuery.data( el.parentNode, "tmplItem" ); + pntNode = pntNode ? pntNode.key : 0; + } + if ( tmplItem ) { + pntItem = tmplItem; + // Find the template item of the parent element. + // (Using !=, not !==, since pntItem.key is number, and pntNode may be a string) + while ( pntItem && pntItem.key != pntNode ) { + // Add this element as a top-level node for this rendered template item, as well as for any + // ancestor items between this item and the item of its parent element + pntItem.nodes.push( el ); + pntItem = pntItem.parent; + } + // Delete content built during rendering - reduce API surface area and memory use, and avoid exposing of stale data after rendering... + delete tmplItem._ctnt; + delete tmplItem._wrap; + // Store template item as jQuery data on the element + jQuery.data( el, "tmplItem", tmplItem ); + } + function cloneTmplItem( key ) { + key = key + keySuffix; + tmplItem = newClonedItems[key] = + (newClonedItems[key] || newTmplItem( tmplItem, newTmplItems[tmplItem.parent.key + keySuffix] || tmplItem.parent )); + } + } + } + + //---- Helper functions for template item ---- + + function tiCalls( content, tmpl, data, options ) { + if ( !content ) { + return stack.pop(); + } + stack.push({ _: content, tmpl: tmpl, item:this, data: data, options: options }); + } + + function tiNest( tmpl, data, options ) { + // nested template, using {{tmpl}} tag + return jQuery.tmpl( jQuery.template( tmpl ), data, options, this ); + } + + function tiWrap( call, wrapped ) { + // nested template, using {{wrap}} tag + var options = call.options || {}; + options.wrapped = wrapped; + // Apply the template, which may incorporate wrapped content, + return jQuery.tmpl( jQuery.template( call.tmpl ), call.data, options, call.item ); + } + + function tiHtml( filter, textOnly ) { + var wrapped = this._wrap; + return jQuery.map( + jQuery( jQuery.isArray( wrapped ) ? wrapped.join("") : wrapped ).filter( filter || "*" ), + function(e) { + return textOnly ? + e.innerText || e.textContent : + e.outerHTML || outerHtml(e); + }); + } + + function tiUpdate() { + var coll = this.nodes; + jQuery.tmpl( null, null, null, this).insertBefore( coll[0] ); + jQuery( coll ).remove(); + } +})( jQuery ); diff --git a/libs/patch/.gitignore b/libs/patch/.gitignore new file mode 100644 index 0000000..a6c7c28 --- /dev/null +++ b/libs/patch/.gitignore @@ -0,0 +1 @@ +*.js diff --git a/libs/patch/0001-JQM-fix-vclick-trigger-twice-after-pageChange.patch b/libs/patch/0001-JQM-fix-vclick-trigger-twice-after-pageChange.patch new file mode 100644 index 0000000..996499e --- /dev/null +++ b/libs/patch/0001-JQM-fix-vclick-trigger-twice-after-pageChange.patch @@ -0,0 +1,28 @@ +From f95cf2987e50119260db1763a1b52b4bc34d57b2 Mon Sep 17 00:00:00 2001 +From: "wongi11.lee" +Date: Thu, 21 Jun 2012 17:35:28 +0900 +Subject: [PATCH] JQM:fix vclick trigger twice after pageChange. + +Signed-off-by: Wongi Lee +--- + .../jquery-mobile-1.1.0/js/jquery.mobile.vmouse.js | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.vmouse.js b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.vmouse.js +index 6e9b504..b608460 100644 +--- a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.vmouse.js ++++ b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.vmouse.js +@@ -195,6 +195,10 @@ function triggerVirtualEvent( eventType, event, flags ) { + function mouseEventCallback( event ) { + var touchID = $.data(event.target, touchTargetPropertyName); + ++ if ( ( $.support.touch === true ) && ( touchID === undefined ) ) { ++ return; ++ } ++ + if ( !blockMouseTriggers && ( !lastTouchID || lastTouchID !== touchID ) ){ + var ve = triggerVirtualEvent( "v" + event.type, event ); + if ( ve ) { +-- +1.7.9.5 + diff --git a/libs/patch/0002-JQM-nolabel-n-favorite-class-for-check-support.patch b/libs/patch/0002-JQM-nolabel-n-favorite-class-for-check-support.patch new file mode 100644 index 0000000..e09c283 --- /dev/null +++ b/libs/patch/0002-JQM-nolabel-n-favorite-class-for-check-support.patch @@ -0,0 +1,41 @@ +From 2807a575905be49a8445aea0b1759a88339f4e16 Mon Sep 17 00:00:00 2001 +From: Koeun Choi +Date: Fri, 15 Jun 2012 17:11:51 +0900 +Subject: [PATCH] JQM:nolabel n favorite class for check support + +Signed-off-by: Koeun Choi +--- + .../js/jquery.mobile.forms.checkboxradio.js | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.forms.checkboxradio.js b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.forms.checkboxradio.js +index eb4731b..b373431 100644 +--- a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.forms.checkboxradio.js ++++ b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.forms.checkboxradio.js +@@ -43,6 +43,12 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, { + return; + } + ++ // Support fake label ++ if ( label.length == 0 ) { ++ label = $( "" ); ++ } ++ + // Expose for other methods + $.extend( this, { + label: label, +@@ -70,6 +76,10 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, { + var wrapper = document.createElement('div'); + wrapper.className = 'ui-' + inputtype; + ++ if ( input.hasClass( "favorite" ) ) { ++ wrapper.className += ' favorite'; ++ } ++ + input.add( label ).wrapAll( wrapper ); + + label.bind({ +-- +1.7.9.5 + diff --git a/libs/patch/0003-JQM-trigger-the-pageshow-event-after-transitionPages.patch b/libs/patch/0003-JQM-trigger-the-pageshow-event-after-transitionPages.patch new file mode 100644 index 0000000..efee893 --- /dev/null +++ b/libs/patch/0003-JQM-trigger-the-pageshow-event-after-transitionPages.patch @@ -0,0 +1,27 @@ +From c9edd80183fa459dff180d7f51e9cd03143473b4 Mon Sep 17 00:00:00 2001 +From: Minkyu Kang +Date: Mon, 11 Jun 2012 15:19:06 +0900 +Subject: [PATCH] JQM:trigger the pageshow event after transitionPages + function at none transition + +Signed-off-by: Minkyu Kang +--- + .../js/jquery.mobile.transition.js | 2 +- + 1 file changed, 1 insertions(+), 1 deletions(-) + +diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.transition.js b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.transition.js +index 9a099dc..4476bfd 100644 +--- a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.transition.js ++++ b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.transition.js +@@ -89,7 +89,7 @@ var createHandler = function( sequential ){ + $to.addClass( name + " in" + reverseClass ); + + if( none ){ +- doneIn(); ++ setTimeout( doneIn, 0 ); + } + + }, +-- +1.7.9.5 + diff --git a/libs/patch/0004-JQM-move-pagelayout-to-winset.patch b/libs/patch/0004-JQM-move-pagelayout-to-winset.patch new file mode 100644 index 0000000..dbc5ab2 --- /dev/null +++ b/libs/patch/0004-JQM-move-pagelayout-to-winset.patch @@ -0,0 +1,68 @@ +From 12f7cdd3e6a427c777eb5b4c48b33fdd0ba1ef15 Mon Sep 17 00:00:00 2001 +From: Jun Jinhyuk +Date: Thu, 5 Jul 2012 01:00:43 -0400 +Subject: [PATCH] JQM move pagelayout to winset + +Change-Id: I38777266f0e4d30bce2db5057e2675f35221096a +--- + .../js/jquery.mobile.fixedToolbar.js | 2 +- + .../js/jquery.mobile.page.sections.js | 16 ++-------------- + 2 files changed, 3 insertions(+), 15 deletions(-) + mode change 100644 => 100755 libs/js/jquery-mobile-1.1.0/js/jquery.mobile.page.sections.js + +diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.fixedToolbar.js b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.fixedToolbar.js +index 0f9c23d..6a40ac5 100644 +--- a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.fixedToolbar.js ++++ b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.fixedToolbar.js +@@ -65,7 +65,7 @@ define( [ "jquery", "./jquery.mobile.widget", "./jquery.mobile.core", "./jquery. + + return false; + }, +- initSelector: ":jqmData(position='fixed')" ++ initSelector: ":jqmData(position='dummy')" + }, + + _create: function() { +diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.page.sections.js b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.page.sections.js +old mode 100644 +new mode 100755 +index e0a718d..e78af6a +--- a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.page.sections.js ++++ b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.page.sections.js +@@ -8,11 +8,12 @@ define( [ "jquery", "./jquery.mobile.page", "./jquery.mobile.core", "./jquery.mo + (function( $, undefined ) { + + $.mobile.page.prototype.options.backBtnText = "Back"; +-$.mobile.page.prototype.options.addBackBtn = false; ++$.mobile.page.prototype.options.addBackBtn = "footer"; + $.mobile.page.prototype.options.backBtnTheme = null; + $.mobile.page.prototype.options.headerTheme = "a"; + $.mobile.page.prototype.options.footerTheme = "a"; + $.mobile.page.prototype.options.contentTheme = null; ++$.mobile.page.prototype.options.footerExist = true; + + $( document ).delegate( ":jqmData(role='page'), :jqmData(role='dialog')", "pagecreate", function( e ) { + +@@ -58,19 +59,6 @@ $( document ).delegate( ":jqmData(role='page'), :jqmData(role='dialog')", "pagec + rightbtn = rightbtn || $headeranchors.eq( 1 ).addClass( "ui-btn-right" ).length; + } + +- // Auto-add back btn on pages beyond first view +- if ( o.addBackBtn && +- role === "header" && +- $( ".ui-page" ).length > 1 && +- $page.jqmData( "url" ) !== $.mobile.path.stripHash( location.hash ) && +- !leftbtn ) { +- +- backBtn = $( ""+ o.backBtnText +"" ) +- // If theme is provided, override default inheritance +- .attr( "data-"+ $.mobile.ns +"theme", o.backBtnTheme || thisTheme ) +- .prependTo( $this ); +- } +- + // Page title + $this.children( "h1, h2, h3, h4, h5, h6" ) + .addClass( "ui-title" ) +-- +1.7.4.1 + diff --git a/libs/patch/0005-JQM-Fix-bug-on-live-firing-custom-events.patch b/libs/patch/0005-JQM-Fix-bug-on-live-firing-custom-events.patch new file mode 100644 index 0000000..f319944 --- /dev/null +++ b/libs/patch/0005-JQM-Fix-bug-on-live-firing-custom-events.patch @@ -0,0 +1,29 @@ +From 3548a6e0000943da605e6cbb00c1ec51ba82cf12 Mon Sep 17 00:00:00 2001 +From: Youmin Ha +Date: Tue, 5 Jun 2012 16:47:59 +0900 +Subject: [PATCH] JQM:Fix bug on live firing custom events + +Signed-off-by: Youmin Ha +--- + .../jquery-mobile-1.1.0/js/jquery.mobile.event.js | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.event.js b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.event.js +index f9d1744..0dc5428 100644 +--- a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.event.js ++++ b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.event.js +@@ -28,6 +28,11 @@ var supportTouch = $.support.touch, + function triggerCustomEvent( obj, eventType, event ) { + var originalType = event.type; + event.type = eventType; ++ ++ // event.liveFired is already set by basic events, e.g. vclick, which is fired already. ++ // To fire this custom event, event.liveFired must be cleared. ++ event.liveFired = undefined; ++ + $.event.handle.call( obj, event ); + event.type = originalType; + } +-- +1.7.9.5 + diff --git a/libs/patch/0006-JQM-Apply-Tizen-button-style.patch b/libs/patch/0006-JQM-Apply-Tizen-button-style.patch new file mode 100644 index 0000000..b244a82 --- /dev/null +++ b/libs/patch/0006-JQM-Apply-Tizen-button-style.patch @@ -0,0 +1,105 @@ +From 3fea934afc1252e6476750d86e450a61e6d8b816 Mon Sep 17 00:00:00 2001 +From: wongi11.lee +Date: Fri, 8 Jun 2012 19:58:19 +0900 +Subject: [PATCH] JQM:Apply Tizen button style. + +Signed-off-by: Wongi Lee +Signed-off-by: Hyunjung Kim +--- + .../js/jquery.mobile.buttonMarkup.js | 59 ++++++++++++++++++++ + 1 files changed, 59 insertions(+), 0 deletions(-) + +diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.buttonMarkup.js b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.buttonMarkup.js +index c5f32b4..d1b992b 100644 +--- a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.buttonMarkup.js ++++ b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.buttonMarkup.js +@@ -1,3 +1,22 @@ ++/* ++* "buttons" plugin - for making button-like links ++*/ ++ ++/* ++ * Button Markup modified for TIZEN style. ++ * ++ * HTML Attributes: ++ * ++ * data-role: button ++ * data-style: circle, nobg, edit ++ * ++ * Examples: ++ * ++ *
        ++ *
        ++ *
        ++ */ ++ + //>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); + //>>description: Applies button styling to links + //>>label: Buttons: Link-based +@@ -74,6 +93,63 @@ $.fn.buttonMarkup = function( options ) { + buttonClass += o.shadow ? " ui-shadow" : ""; + buttonClass += o.corners ? " ui-btn-corner-all" : ""; + ++ // To distinguish real buttons ++ if( el.jqmData("role") == "button" || e.tagName == "BUTTON" || e.tagName == "A" ){ ++ buttonClass += " ui-btn-box-" + o.theme; ++ } ++ ++ /* TIZEN style markup */ ++ buttonStyle = el.jqmData("style"); ++ ++ if ( buttonStyle == "circle" ) { ++ /* style : no text, Icon only */ ++ buttonClass += " ui-btn-corner-circle"; ++ buttonClass += " ui-btn-icon_only"; ++ } else if ( buttonStyle == "nobg" ) { ++ /* style : no text, Icon only, no bg */ ++ buttonClass += " ui-btn-icon-nobg"; ++ buttonClass += " ui-btn-icon_only"; ++ } else if ( buttonStyle == "edit" ) { ++ buttonClass += " ui-btn-edit"; ++ } ++ ++ if ( o.icon ) { ++ if ( $(el).text().length > 0 ) { ++ /* o.iconpos == "right" ? ++ textClass += " ui-btn-text-padding-right" : ++ textClass += " ui-btn-text-padding-left"; */ ++ ++ switch ( o.iconpos ) { ++ case "right" : ++ case "left" : ++ case "top" : ++ case "bottom" : ++ textClass += " ui-btn-text-padding-" + o.iconpos; ++ break; ++ default: ++ textClass += " ui-btn-text-padding-left"; ++ break; ++ } ++ ++ innerClass += " ui-btn-hastxt"; ++ } else { ++ if ( buttonStyle == "circle" ) { ++ /* style : no text, Icon only */ ++ innerClass += " ui-btn-corner-circle"; ++ } else if ( buttonStyle == "nobg" ) { ++ /* style : no text, Icon only, no bg */ ++ innerClass += " ui-btn-icon-nobg"; ++ } ++ ++ buttonClass += " ui-btn-icon_only"; ++ innerClass += " ui-btn-icon-only"; ++ } ++ } else { ++ if ( $(el).text().length > 0 ) { ++ innerClass += " ui-btn-hastxt"; ++ } ++ } ++ + if ( o.mini !== undefined ) { + // Used to control styling in headers/footers, where buttons default to `mini` style. + buttonClass += o.mini ? " ui-mini" : " ui-fullsize"; +-- +1.7.0.4 + diff --git a/libs/patch/0007-JQM-remove-search-from-forms.textinput.patch b/libs/patch/0007-JQM-remove-search-from-forms.textinput.patch new file mode 100644 index 0000000..0d19286 --- /dev/null +++ b/libs/patch/0007-JQM-remove-search-from-forms.textinput.patch @@ -0,0 +1,91 @@ +From c70b1f818389c9703af17bb59e1f78f4eefa7c65 Mon Sep 17 00:00:00 2001 +From: wongi11.lee +Date: Fri, 29 Jun 2012 13:24:49 +0900 +Subject: [PATCH] JQM remove 'search' from forms.textinput. + +Change-Id: I3de28a38dad8cfcc40a6e98273107e5beabb836e +Signed-off-by: wongi11.lee +--- + .../js/jquery.mobile.forms.textinput.js | 49 +++---------------- + 1 files changed, 8 insertions(+), 41 deletions(-) + +diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.forms.textinput.js b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.forms.textinput.js +index f444522..a06d54d 100644 +--- a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.forms.textinput.js ++++ b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.forms.textinput.js +@@ -13,8 +13,7 @@ $.widget( "mobile.textinput", $.mobile.widget, { + theme: null, + // This option defaults to true on iOS devices. + preventFocusZoom: /iPhone|iPad|iPod/.test( navigator.platform ) && navigator.userAgent.indexOf( "AppleWebKit" ) > -1, +- initSelector: "input[type='text'], input[type='search'], :jqmData(type='search'), input[type='number'], :jqmData(type='number'), input[type='password'], input[type='email'], input[type='url'], input[type='tel'], textarea, input[type='time'], input[type='date'], input[type='month'], input[type='week'], input[type='datetime'], input[type='datetime-local'], input[type='color'], input:not([type])", +- clearSearchButtonText: "clear text" ++ initSelector: "input[type='text'], input[type='number'], :jqmData(type='number'), input[type='password'], input[type='email'], input[type='url'], input[type='tel'], textarea, input[type='time'], input[type='date'], input[type='month'], input[type='week'], input[type='datetime'], input[type='datetime-local'], input[type='color'], input:not([type])" + }, + + _create: function() { +@@ -46,41 +45,7 @@ $.widget( "mobile.textinput", $.mobile.widget, { + } + + +- //"search" input widget +- if ( input.is( "[type='search'],:jqmData(type='search')" ) ) { +- +- focusedEl = input.wrap( "" ).parent(); +- clearbtn = $( "" + o.clearSearchButtonText + "" ) +- .bind('click', function( event ) { +- input +- .val( "" ) +- .focus() +- .trigger( "change" ); +- clearbtn.addClass( "ui-input-clear-hidden" ); +- event.preventDefault(); +- }) +- .appendTo( focusedEl ) +- .buttonMarkup({ +- icon: "delete", +- iconpos: "notext", +- corners: true, +- shadow: true, +- mini: mini +- }); +- +- function toggleClear() { +- setTimeout(function() { +- clearbtn.toggleClass( "ui-input-clear-hidden", !input.val() ); +- }, 0); +- } +- +- toggleClear(); +- +- input.bind('paste cut keyup focus change blur', toggleClear); +- +- } else { +- input.addClass( "ui-corner-all ui-shadow-inset" + themeclass + miniclass ); +- } ++ input.addClass( "ui-corner-all ui-shadow-inset" + themeclass + miniclass ); + + input.focus(function() { + focusedEl.addClass( $.mobile.focusClass ); +@@ -133,13 +98,15 @@ $.widget( "mobile.textinput", $.mobile.widget, { + }, + + disable: function(){ +- ( this.element.attr( "disabled", true ).is( "[type='search'],:jqmData(type='search')" ) ? +- this.element.parent() : this.element ).addClass( "ui-disabled" ); ++ if ( this.element.attr( "disabled", true ) ) { ++ this.element.addClass( "ui-disabled" ); ++ } + }, + + enable: function(){ +- ( this.element.attr( "disabled", false).is( "[type='search'],:jqmData(type='search')" ) ? +- this.element.parent() : this.element ).removeClass( "ui-disabled" ); ++ if ( this.element.attr( "disabled", false) ) { ++ this.element.removeClass( "ui-disabled" ); ++ } + } + }); + +-- +1.7.0.4 + diff --git a/libs/patch/0008-JQM-remove-auto-populated-right-arrow-button.patch b/libs/patch/0008-JQM-remove-auto-populated-right-arrow-button.patch new file mode 100644 index 0000000..f70c25c --- /dev/null +++ b/libs/patch/0008-JQM-remove-auto-populated-right-arrow-button.patch @@ -0,0 +1,30 @@ +From c0960209ffd4540404d680331f54bdac872476ac Mon Sep 17 00:00:00 2001 +From: wongi11.lee +Date: Fri, 29 Jun 2012 14:25:03 +0900 +Subject: [PATCH] JQM remove auto populated right-arrow button. + +Change-Id: I57c6583aee484c8dedb4a49f12e9dfa2b1bf6b85 +Signed-off-by: wongi11.lee +--- + .../js/jquery.mobile.listview.js | 5 +++++ + 1 files changed, 5 insertions(+), 0 deletions(-) + +diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.listview.js b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.listview.js +index f3fabfa..4ccdd73 100644 +--- a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.listview.js ++++ b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.listview.js +@@ -188,6 +188,11 @@ $.widget( "mobile.listview", $.mobile.widget, { + if ( a.length ) { + icon = item.jqmData("icon"); + ++ /* Remove auto populated right-arrow button. */ ++ if ( icon === undefined ) { ++ icon = false; ++ } ++ + item.buttonMarkup({ + wrapperEls: "div", + shadow: false, +-- +1.7.0.4 + diff --git a/libs/patch/0009-JQM-change-button-hoverDelay-to-0-to-improve-respons.patch b/libs/patch/0009-JQM-change-button-hoverDelay-to-0-to-improve-respons.patch new file mode 100644 index 0000000..b0f0b85 --- /dev/null +++ b/libs/patch/0009-JQM-change-button-hoverDelay-to-0-to-improve-respons.patch @@ -0,0 +1,27 @@ +From b4ca5396f3d90e5f7ce05fba7f4d4182a6921e4b Mon Sep 17 00:00:00 2001 +From: wongi11.lee +Date: Mon, 2 Jul 2012 16:01:35 +0900 +Subject: [PATCH] JQM change button hoverDelay to 0 to improve response. + +Change-Id: Ie37bc90d86a94a2ea48819386a76fe976b91aa79 +Signed-off-by: wongi11.lee +--- + .../jquery-mobile-1.1.0/js/jquery.mobile.core.js | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.core.js b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.core.js +index 7bde672..9007c36 100644 +--- a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.core.js ++++ b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.core.js +@@ -87,7 +87,7 @@ define( [ "jquery", "../external/requirejs/text!../version.txt", "./jquery.mobil + orientationChangeEnabled: true, + + buttonMarkup: { +- hoverDelay: 200 ++ hoverDelay: 0 + }, + + // TODO might be useful upstream in jquery itself ? +-- +1.7.0.4 + diff --git a/libs/patch/0010-JQM-Prevent-blinking-on-page-transition.patch b/libs/patch/0010-JQM-Prevent-blinking-on-page-transition.patch new file mode 100644 index 0000000..6479b70 --- /dev/null +++ b/libs/patch/0010-JQM-Prevent-blinking-on-page-transition.patch @@ -0,0 +1,41 @@ +From bf9dc02776446faee9e5587360584d9d9b9b135e Mon Sep 17 00:00:00 2001 +From: Youmin Ha +Date: Tue, 3 Jul 2012 15:07:07 +0900 +Subject: [PATCH] JQM:Prevent blinking on page transition + +Signed-off-by: Minkyu Kang +Signed-off-by: Youmin Ha +--- + .../js/jquery.mobile.transition.js | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.transition.js b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.transition.js +index 56f93a6..e5555e8 100644 +--- a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.transition.js ++++ b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.transition.js +@@ -29,6 +29,15 @@ var createHandler = function( sequential ){ + $.mobile.pageContainer.toggleClass( "ui-mobile-viewport-transitioning viewport-" + name ); + }, + scrollPage = function(){ ++ // Prevent blinking on page scrolling in Tizen/Android devices. ++ // 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(); ++ if( st === toScroll || ( $.mobile.defaultHomeScroll === toScroll && st == 0 ) ) { ++ return; ++ } ++ + // By using scrollTo instead of silentScroll, we can keep things better in order + // Just to be precautios, disable scrollstart listening like silentScroll would + $.event.special.scrollstart.enabled = false; +@@ -150,4 +159,4 @@ $.mobile.transitionFallbacks = {}; + })( jQuery, this ); + //>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); + }); +-//>>excludeEnd("jqmBuildExclude"); +\ No newline at end of file ++//>>excludeEnd("jqmBuildExclude"); +-- +1.7.9.5 + diff --git a/libs/patch/0011-JQM-add-refresh-api-to-page.patch b/libs/patch/0011-JQM-add-refresh-api-to-page.patch new file mode 100644 index 0000000..238642c --- /dev/null +++ b/libs/patch/0011-JQM-add-refresh-api-to-page.patch @@ -0,0 +1,46 @@ +From 15b17c830a4d9737b23da195e23ed02aabcf2c36 Mon Sep 17 00:00:00 2001 +From: Jun Jinhyuk +Date: Fri, 6 Jul 2012 07:15:19 -0400 +Subject: [PATCH] JQM add refresh api to page + +--- + .../jquery-mobile-1.1.0/js/jquery.mobile.page.js | 12 ++++++++---- + 1 files changed, 8 insertions(+), 4 deletions(-) + +diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.page.js b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.page.js +index d2bd195..85c77fe 100644 +--- a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.page.js ++++ b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.page.js +@@ -15,9 +15,9 @@ $.widget( "mobile.page", $.mobile.widget, { + }, + + _create: function() { +- ++ + var self = this; +- ++ + // if false is returned by the callbacks do not create the page + if( self._trigger( "beforecreate" ) === false ){ + return false; +@@ -34,11 +34,15 @@ $.widget( "mobile.page", $.mobile.widget, { + } ); + + }, +- ++ ++ refresh : function() { ++ $( ".ui-page-active" ).children( ".ui-content" ).trigger("updatelayout", ["external"]); ++ }, ++ + removeContainerBackground: function(){ + $.mobile.pageContainer.removeClass( "ui-overlay-" + $.mobile.getInheritedTheme( this.element.parent() ) ); + }, +- ++ + // set the page container background to the page theme + setContainerBackground: function( theme ){ + if( this.options.theme ){ +-- +1.7.4.1 + diff --git a/libs/patch/0012-JQM-set-default-page-transition-to-none.patch b/libs/patch/0012-JQM-set-default-page-transition-to-none.patch new file mode 100644 index 0000000..71a6477 --- /dev/null +++ b/libs/patch/0012-JQM-set-default-page-transition-to-none.patch @@ -0,0 +1,26 @@ +From 55dcac86989fdc737ea6894ca136bb250bdc5f95 Mon Sep 17 00:00:00 2001 +From: Minkyu Kang +Date: Tue, 17 Jul 2012 09:12:49 +0900 +Subject: [PATCH] JQM: set default page transition to none + +Signed-off-by: Minkyu Kang +--- + .../jquery-mobile-1.1.0/js/jquery.mobile.core.js | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.core.js b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.core.js +index 9007c36..ae576b1 100644 +--- a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.core.js ++++ b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.core.js +@@ -44,7 +44,7 @@ define( [ "jquery", "../external/requirejs/text!../version.txt", "./jquery.mobil + linkBindingEnabled: true, + + // Set default page transition - 'none' for no transitions +- defaultPageTransition: "fade", ++ defaultPageTransition: "none", + + // Set maximum window width for transitions to apply - 'false' for no limit + maxTransitionWidth: false, +-- +1.7.9.5 + diff --git a/libs/patch/0013-JQM-remove-filter-Placeholder-of-listview.patch b/libs/patch/0013-JQM-remove-filter-Placeholder-of-listview.patch new file mode 100644 index 0000000..f585b71 --- /dev/null +++ b/libs/patch/0013-JQM-remove-filter-Placeholder-of-listview.patch @@ -0,0 +1,27 @@ +From 731daf9729c9163dd0db78d72acc0c21ff334ca8 Mon Sep 17 00:00:00 2001 +From: Minkyu Kang +Date: Mon, 20 Aug 2012 15:48:11 +0900 +Subject: [PATCH] JQM: remove filter Placeholder of listview + +Change-Id: I03d5e62e33d3e1fe7455e9b30d2cc479c092503f +Signed-off-by: Minkyu Kang +--- + .../js/jquery.mobile.listview.filter.js | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.listview.filter.js b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.listview.filter.js +index a2420d8..929b221 100644 +--- a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.listview.filter.js ++++ b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.listview.filter.js +@@ -9,7 +9,7 @@ define( [ "jquery", "./jquery.mobile.listview", "./jquery.mobile.forms.textinput + (function( $, undefined ) { + + $.mobile.listview.prototype.options.filter = false; +-$.mobile.listview.prototype.options.filterPlaceholder = "Filter items..."; ++$.mobile.listview.prototype.options.filterPlaceholder = ""; + $.mobile.listview.prototype.options.filterTheme = "c"; + $.mobile.listview.prototype.options.filterCallback = function( text, searchValue ){ + return text.toLowerCase().indexOf( searchValue ) === -1; +-- +1.7.9.5 + diff --git a/libs/patch/0014-JQM-Add-default-theme-on-buttonMarkup.patch b/libs/patch/0014-JQM-Add-default-theme-on-buttonMarkup.patch new file mode 100644 index 0000000..501ed5a --- /dev/null +++ b/libs/patch/0014-JQM-Add-default-theme-on-buttonMarkup.patch @@ -0,0 +1,34 @@ +From b0b89011ffeb68fc9a207f67558048217912025c Mon Sep 17 00:00:00 2001 +From: Youmin Ha +Date: Wed, 25 Jul 2012 10:15:08 +0900 +Subject: [PATCH] JQM: Add default theme on buttonMarkup + +Signed-off-by: Youmin Ha +--- + .../js/jquery.mobile.buttonMarkup.js | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.buttonMarkup.js b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.buttonMarkup.js +index d523ad9..9ca2366 100644 +--- a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.buttonMarkup.js ++++ b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.buttonMarkup.js +@@ -38,7 +38,7 @@ $.fn.buttonMarkup = function( options ) { + o = $.extend( {}, $.fn.buttonMarkup.defaults, { + icon: options.icon !== undefined ? options.icon : el.jqmData( "icon" ), + iconpos: options.iconpos !== undefined ? options.iconpos : el.jqmData( "iconpos" ), +- theme: options.theme !== undefined ? options.theme : el.jqmData( "theme" ) || $.mobile.getInheritedTheme( el, "c" ), ++ 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" ), +@@ -235,6 +235,7 @@ $.fn.buttonMarkup = function( options ) { + }; + + $.fn.buttonMarkup.defaults = { ++ theme: "c", + corners: true, + shadow: true, + iconshadow: true, +-- +1.7.9.5 + diff --git a/libs/patch/0015-JQM-If-height-of-textarea-is-bigger-than-window.inne.patch b/libs/patch/0015-JQM-If-height-of-textarea-is-bigger-than-window.inne.patch new file mode 100644 index 0000000..25291e7 --- /dev/null +++ b/libs/patch/0015-JQM-If-height-of-textarea-is-bigger-than-window.inne.patch @@ -0,0 +1,27 @@ +From c8f2ce6d45c42d572ef96cc166a64c8d60bc5ef8 Mon Sep 17 00:00:00 2001 +From: Minkyu Kang +Date: Thu, 9 Aug 2012 17:36:11 +0900 +Subject: [PATCH] JQM: If height of textarea is bigger than + window.innerHeight/2, don't grow up anymore + +Signed-off-by: Minkyu Kang +--- + .../js/jquery.mobile.forms.textinput.js | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.forms.textinput.js b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.forms.textinput.js +index f444522..681b9b4 100644 +--- a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.forms.textinput.js ++++ b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.forms.textinput.js +@@ -73,7 +73,7 @@ $.widget( "mobile.textinput", $.mobile.widget, { + var scrollHeight = input[ 0 ].scrollHeight, + clientHeight = input[ 0 ].clientHeight; + +- if ( clientHeight < scrollHeight ) { ++ if ( clientHeight < scrollHeight && window.innerHeight / 2 > scrollHeight ) { + input.height(scrollHeight + extraLineHeight); + } + }, +-- +1.7.9.5 + diff --git a/libs/patch/0016-JQM-generate-checkbox-radio-has-class-in-list.patch b/libs/patch/0016-JQM-generate-checkbox-radio-has-class-in-list.patch new file mode 100644 index 0000000..9f3ebcf --- /dev/null +++ b/libs/patch/0016-JQM-generate-checkbox-radio-has-class-in-list.patch @@ -0,0 +1,47 @@ +From cdada84aa4444504a17346146a8b08c9e633eaaa Mon Sep 17 00:00:00 2001 +From: Jun Jinhyuk +Date: Tue, 21 Aug 2012 14:45:17 +0900 +Subject: [PATCH] JQM generate checkbox radio has class in list + +Change-Id: Ie958c0a960d14494f476e2354677fcc588b7a32c +--- + .../js/jquery.mobile.listview.js | 16 ++++++++++++++++ + 1 files changed, 16 insertions(+), 0 deletions(-) + +diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.listview.js b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.listview.js +index 4ccdd73..a290e32 100644 +--- a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.listview.js ++++ b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.listview.js +@@ -151,6 +151,19 @@ $.widget( "mobile.listview", $.mobile.widget, { + } + } + }, ++ ++ _addCheckboxRadioClasses: function( containers ) ++ { ++ var i, inputAttr, len = containers.length; ++ for ( i = 0; i < len; i++ ) { ++ inputAttr = $( containers[ i ] ).find( "input" ); ++ if ( inputAttr.attr( "type" ) == "checkbox" ) { ++ $( containers[ i ] ).addClass( "ui-li-has-checkbox" ); ++ } else if ( inputAttr.attr( "type" ) == "radio" ) { ++ $( containers[ i ] ).addClass( "ui-li-has-radio" ); ++ } ++ } ++ }, + + refresh: function( create ) { + this.parentPage = this.element.closest( ".ui-page" ); +@@ -313,6 +326,9 @@ $.widget( "mobile.listview", $.mobile.widget, { + this._addThumbClasses( li ); + this._addThumbClasses( $list.find( ".ui-link-inherit" ) ); + ++ this._addCheckboxRadioClasses( li ); ++ this._addCheckboxRadioClasses( $list.find( ".ui-link-inherit" ) ); ++ + this._refreshCorners( create ); + }, + +-- +1.7.4.1 + diff --git a/libs/patch/0016-apply-tizen-default-button-order-in-title-bar-ui-btn.patch b/libs/patch/0016-apply-tizen-default-button-order-in-title-bar-ui-btn.patch new file mode 100644 index 0000000..3038d34 --- /dev/null +++ b/libs/patch/0016-apply-tizen-default-button-order-in-title-bar-ui-btn.patch @@ -0,0 +1,31 @@ +From ea0849395563ced0fab0ce5d4b0c947b49b4b152 Mon Sep 17 00:00:00 2001 +From: Koeun Choi +Date: Fri, 17 Aug 2012 21:05:05 +0900 +Subject: [PATCH] apply tizen default button order in title bar: ui-btn-right. + +Change-Id: I3ad4b706982090e2b1efa28227fe8e40ac9ee039 +--- + .../js/jquery.mobile.page.sections.js | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.page.sections.js b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.page.sections.js +index e78af6a..5e289b5 100755 +--- a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.page.sections.js ++++ b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.page.sections.js +@@ -54,9 +54,13 @@ $( document ).delegate( ":jqmData(role='page'), :jqmData(role='dialog')", "pagec + leftbtn = $headeranchors.hasClass( "ui-btn-left" ); + rightbtn = $headeranchors.hasClass( "ui-btn-right" ); + ++ // when button position is not declared, make it "right" button on Tizen. ++ rightbtn = $headeranchors.not( ".ui-btn-left" ).addClass( "ui-btn-right" ); ++ /* + leftbtn = leftbtn || $headeranchors.eq( 0 ).not( ".ui-btn-right" ).addClass( "ui-btn-left" ).length; + + rightbtn = rightbtn || $headeranchors.eq( 1 ).addClass( "ui-btn-right" ).length; ++ */ + } + + // Page title +-- +1.7.9.5 + diff --git a/libs/patch/0018-JQM-listview-patch-select-right-button.patch b/libs/patch/0018-JQM-listview-patch-select-right-button.patch new file mode 100644 index 0000000..d75726a --- /dev/null +++ b/libs/patch/0018-JQM-listview-patch-select-right-button.patch @@ -0,0 +1,50 @@ +From 707a5c7b76fdfb108c7b54316384763f37a0b303 Mon Sep 17 00:00:00 2001 +From: Jun Jinhyuk +Date: Tue, 4 Sep 2012 15:51:58 +0900 +Subject: [PATCH] JQM listview patch select right button + +Change-Id: Ic5b8e01303750c03a3ce681a45d591214683e4a7 +--- + .../js/jquery.mobile.listview.js | 19 ++++++++++++++++++- + 1 files changed, 18 insertions(+), 1 deletions(-) + +diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.listview.js b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.listview.js +index a290e32..671bc84 100644 +--- a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.listview.js ++++ b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.listview.js +@@ -164,7 +164,21 @@ $.widget( "mobile.listview", $.mobile.widget, { + } + } + }, +- ++ ++ _addRightBtnClasses: function( containers ) ++ { ++ 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" ); ++ if ( btnAttr.length ) { ++ if ( btnAttr.jqmData( "style" ) == "circle" ) { ++ $( containers[ i ] ).addClass( "ui-li-has-right-circle-btn" ); ++ } else { ++ $( containers[ i ] ).addClass( "ui-li-has-right-btn" ); ++ } ++ } ++ } ++ }, + refresh: function( create ) { + this.parentPage = this.element.closest( ".ui-page" ); + this._createSubPages(); +@@ -329,6 +343,9 @@ $.widget( "mobile.listview", $.mobile.widget, { + this._addCheckboxRadioClasses( li ); + this._addCheckboxRadioClasses( $list.find( ".ui-link-inherit" ) ); + ++ this._addRightBtnClasses( li ); ++ this._addRightBtnClasses( $list.find( ".ui-link-inherit" ) ); ++ + this._refreshCorners( create ); + }, + +-- +1.7.4.1 + diff --git a/libs/patch/README.txt b/libs/patch/README.txt new file mode 100644 index 0000000..ac27bd2 --- /dev/null +++ b/libs/patch/README.txt @@ -0,0 +1,38 @@ +======================================================== +How to create your patches for the libraries under libs/ +======================================================== + + 1. Run libs/patch/prepare-patch.sh + +This script does followings; + * Create a temporary branch and move to it. + * Apply existing patches under libs/patch/ into the temporary branch. + + + 2. Change library code in libs/ + +Edit code under libs/ that you want to fix. + + + 3. Apply changed code into git + +Run git add, git commit to remember your code. +Write your commit message to descrbe well about your patch. The commit message will be the name of patch file. + + + 4. Run libs/patch/create-patch.sh + +This script does followings; + * Extract your commit as a patch file, and save it into libs/patch/. + * Move to original branch, and delete temporary branch. + +Whenever you want to cancel the patching, just run create-patch.sh with --cancel option. +With this option, any commits and temporary branch will be deleted. + + + 5. Add your patch file into git + +Now your patch file is found in libs/patch/. Add your patch file into git. + +WARNING: Do not add other patch files into git! Only your new patch must be added. + diff --git a/libs/patch/create-patch.sh b/libs/patch/create-patch.sh new file mode 100755 index 0000000..97020fd --- /dev/null +++ b/libs/patch/create-patch.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +cd `dirname $0`/../../ +CWD=`pwd` +LIB_DIR=${CWD}/libs +PATCH_DIR=$LIB_DIR/patch + +CURRENT_BRANCH="`git branch --no-color 2>/dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`" +PATCH_BRANCH="temp-patch" +ORIG_BRANCH_FILE="${CWD}/.current_branch.txt" +ORIG_BRANCH="`cat $ORIG_BRANCH_FILE 2>/dev/null`" + +function reset_branch +{ + if test -n "$1"; then ret=$1; else ret=1; fi; + echo "Restore to original git branch." + git checkout ${ORIG_BRANCH} + git branch -D ${PATCH_BRANCH} + rm -f $ORIG_BRANCH_FILE + exit $ret +} + +# Make sure if current branch is PATCH_BRANCH +test ! -f "$ORIG_BRANCH_FILE" && echo "ERROR: Original branch file ($ORIG_BRANCH_FILE) is not found!" && exit 1 +test "${CURRENT_BRANCH}" != "$PATCH_BRANCH" && echo "ERROR: Current branch is not '$PATCH_BRANCH'." && exit 1 + +# Extract patch files from latest commit +git format-patch -N --output-directory ${PATCH_DIR} ${ORIG_BRANCH} + +# Reset branch to original branch +reset_branch 0 + +# Done. Notice howto +echo "" +echo "Creating your patch is done. Your patch is in ${PATCH_DIR}. Check your patch and add to git." diff --git a/libs/patch/prepare-patch.sh b/libs/patch/prepare-patch.sh new file mode 100755 index 0000000..41b6c7d --- /dev/null +++ b/libs/patch/prepare-patch.sh @@ -0,0 +1,58 @@ +#!/bin/bash + +cd `dirname $0`/../../ +CWD=`pwd` +LIB_DIR=${CWD}/libs +PATCH_DIR=$LIB_DIR/patch + +CURRENT_BRANCH="`git branch --no-color 2>/dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`" +PATCH_BRANCH=temp-patch +CURRENT_BRANCH_FILE=${CWD}/.current_branch.txt + +function reset_branch +{ + echo "Reset git to original git branch..." + test -f "$CURRENT_BRANCH_FILE" && CURRENT_BRANCH="`cat $CURRENT_BRANCH_FILE`" + git checkout ${CURRENT_BRANCH} + test -e ".git/rebase-apply" && git am --abort + git branch -D ${PATCH_BRANCH} + rm -f $CURRENT_BRANCH_FILE + exit 1 +} + +# If --cancel option is given, just reset git and exit. +test "$1" == "--cancel" && reset_branch + +# If current branch file is already exist, reset and exit. +test -f "$CURRENT_BRANCH_FILE" && reset_branch + +# Remember current branch name to a file +echo "${CURRENT_BRANCH}" > $CURRENT_BRANCH_FILE + +# Make sure if current git is clear. +#test -n "`git status -s`" && echo "ERROR: Current git is not clean. Type 'git status' and clean your git up first." && exit 1 + +# Reset git +#git reset --hard HEAD + +# Create a temporary branch +git branch ${PATCH_BRANCH} || reset_branch +git checkout ${PATCH_BRANCH} || reset_branch + +# Apply existing patches into libs/ +cd ${LIB_DIR} +#for patch in `find ${PATCH_DIR} -name '*.patch' -type f`; do +# patch -p0 < ${patch} || reset_branch +#done +git am $PATCH_DIR/*.patch + +# Make a temporary commit on $PATCH_BRANCH +#git add -f -u . || reset_branch +#git commit -m 'Temporary commit applying existing patches' || reset_branch + + +# Done. Notice howto +echo "" +echo "Set up for patch is done. Current temporary git branch name is '${PATCH_BRANCH}', and a temporary commit is created. (This commit and branch will be removed.)" +echo "Go change your source, add&commit into git, and run create-patch.sh to make your commit to a patch file in $PATCH_DIR." + diff --git a/packaging/upload-to-private-project.sh b/packaging/upload-to-private-project.sh new file mode 100755 index 0000000..d96c0d2 --- /dev/null +++ b/packaging/upload-to-private-project.sh @@ -0,0 +1,57 @@ +#!/bin/bash + +cd `dirname $0`/../ +SRCROOT=`pwd` + +PROJECT=web-ui-fw +VERSION=`grep 'Version:' packaging/web-ui-fw.spec | awk '{print $2}'` +TARNAME=$PROJECT-$VERSION + +OBS_USER=$1 +OBS_LOCAL=home:$OBS_USER +OBSDIR_ROOT=$HOME/obs +OBSDIR_USER=$OBSDIR_ROOT/$OBS_LOCAL +OBSDIR_PROJECT=$OBSDIR_USER/$PROJECT + +if test ! -n "$OBS_USER"; then + echo "Error: No OBS account is given." + echo "USAGE: $0 [--upload]" + echo "" + echo "${HOME}/obs/home:/web-ui-fw direcory will be created." + echo "NOTE:" + echo " If --upload option is given, OBS build request will be done to your home project." + echo " Otherwise, local OBS will be run." + exit 1 +fi + +### OBS +test -d "$OBSDIR_ROOT" || mkdir -p $OBSDIR_ROOT +cd $OBSDIR_ROOT +test -d "$OBSDIR_USER" || osc co $OBS_LOCAL/$PROJECT || ( echo "Error: Failed to checkout $OBS_LOCAL/$PROJECT"; exit 1 ) +cd $OBSDIR_USER +test -d $OBSDIR_PROJECT || osc mkpac $PROJECT + +### Make tarball and spec into obs project dir +cd $OBSDIR_PROJECT +osc rm --force * +rm -rf $OBSDIR_PROJECT/* +cd $SRCROOT +git archive --format=tar --prefix=$TARNAME/ HEAD | gzip > $OBSDIR_PROJECT/$TARNAME.tar.gz +cp -av ./packaging/$PROJECT.spec $OBSDIR_PROJECT/ +cd $OBSDIR_PROJECT + +echo "Complete." +echo "If you want to build locally, run following command:" +echo "cd $OBSDIR_PROJECT; osc build standard --no-verify --local-package --clean" +echo "" + +### Build +if test "$2" == "--upload"; then + osc add * + osc ci +else + #rpmbuild -ba packaging/*.spec + cd $OBSDIR_PROJECT + osc build standard --no-verify --local-package --clean +fi + diff --git a/packaging/web-ui-fw.spec b/packaging/web-ui-fw.spec new file mode 100644 index 0000000..2db3408 --- /dev/null +++ b/packaging/web-ui-fw.spec @@ -0,0 +1,281 @@ +Name: web-ui-fw +Version: 0.1.45 +Release: 0 +Summary: Tizen Web UI Framework Library +Group: Development/Other +License: MIT +BuildArch: noarch +BuildRequires: make +BuildRequires: nodejs +%ifarch %{arm} +BuildRequires: nodejs-x86-arm +%endif + +Source0: %{name}-%{version}.tar.gz + +%description +Tizen Web UI Framework library and theme packages + +%prep +%setup -q + +%build +make all + +%install +make DESTDIR=%{buildroot} install + +%post + +%files +/usr/share/tizen-web-ui-fw/*/js +/usr/share/tizen-web-ui-fw/latest + +############################### +%package -n web-ui-fw-theme-tizen-gray +BuildArch: noarch +Summary: Tizen Web UI Framework Theme : tizen-gray +%Description -n web-ui-fw-theme-tizen-gray + Tizen Web UI Framework Theme : tizen-gray + +############################### +%package -n web-ui-fw-theme-tizen-black +BuildArch: noarch +Summary: Tizen Web UI Framework Theme : tizen-black +%Description -n web-ui-fw-theme-tizen-black + Tizen Web UI Framework Theme : tizen-black +%files -n web-ui-fw-theme-tizen-black +/usr/share/tizen-web-ui-fw/*/themes/tizen-black + +############################### +%package -n web-ui-fw-theme-tizen-white +BuildArch: noarch +Summary: Tizen Web UI Framework Theme : tizen-white +%Description -n web-ui-fw-theme-tizen-white + Tizen Web UI Framework Theme : tizen-white +%files -n web-ui-fw-theme-tizen-white +/usr/share/tizen-web-ui-fw/*/themes/tizen-white + +############################### +%package -n web-ui-fw-theme-default +BuildArch: noarch +Summary: Tizen Web UI Framework Theme : default +%Description -n web-ui-fw-theme-default + Tizen Web UI Framework Theme : default +%files -n web-ui-fw-theme-default +/usr/share/tizen-web-ui-fw/*/themes/default + +############################### +%package -n web-ui-fw-devel +BuildArch: noarch +Summary: Tizen Web UI Framework Developer's files +%Description -n web-ui-fw-devel + Tizen Web UI Framework Developer's files +%files -n web-ui-fw-devel +/usr/share/tizen-web-ui-fw/bin +/usr/share/tizen-web-ui-fw/template + +############################### +%package -n web-ui-fw-demo-tizen-winsets +BuildArch: noarch +Summary: Tizen Web UI Framework Demo Application: tizen winset demo +%Description -n web-ui-fw-demo-tizen-winsets + Tizen Web UI Framework Demo Application: tizen winset demo +%files -n web-ui-fw-demo-tizen-winsets +/usr/share/tizen-web-ui-fw/demos/tizen-winsets + + +############################### +%changelog + +* Fri Sep 05 2012 Minkyu Kang 0.1.45 +- FIX: + - controlbar: set correct controlbar width of last element + - slider: get popup enable value correctly + - use Date.now() instead of (new Data()).getTime() + - popupwindow: fix the background color of popup scroller + - listview: add padding-left to expandable list + - add ellipsis for title area support + +* Fri Aug 31 2012 Minkyu Kang 0.1.44 +- FIX: + - swipelist: show list items correctly + - datetimepicker: set last day, if day is overflowed +- Spec changes: + - controlbar: update icons + +* Tue Aug 29 2012 Minkyu Kang 0.1.43 +- FIX: + - notification: fix typo +- Spec changes: + - controlbar: update icons + +* Tue Aug 28 2012 Minkyu Kang 0.1.42 +- FIX: + - multimediaview: video progress bar display normally for too samll + - segmentcontrol: remove media query + - scrollview: add outer scroll condition + - datetimepicker: modify triangle size + - popupwindow: set the screen height explicitly + - notification: add multiline text +- Spec changes: + - mutibuttonentry: support new GUI + - virtualgrid: support new GUI + +* Mon Aug 27 2012 Jinhyuk Jun 0.1.41 +- FIX: + - radio/check button : button size bug fix + +* Fri Aug 24 2012 Minkyu Kang 0.1.40 +- FIX: + - build error fixed + +* Fri Aug 24 2012 Minkyu Kang 0.1.39 +- FIX: + - listview: style fix, remove filter placeholder + - controlbar: divide styles + - scrollview: don't skip dragging when click button or inputbox + - slider: trim the text on text slider +- Spec changes: + - remove gray and blue theme + - add white and black theme + - support new GUI guide + +* Mon Aug 20 2012 Minkyu Kang 0.1.38 +- FIX: + - fix coment of version tag + +* Fri Aug 17 2012 Minkyu Kang 0.1.37 +- FIX : + - button: fix alignment + - listview: adjust the main text width + - virtualgrid: refactoring +- Spec changes: + - transition: support JQM 1.1.0 transitions + - scrollview: support the outer scroll + - notification: remove interval feature + +* Tue Aug 14 2012 Youmin Ha 0.1.36 +- FIX : + - checkboxRadio: Add left/right padding + - button: custom button & icon position + - virtuallist: remove 'recreate' test +- Spec changes: + - header/footer: enable/disable support + +* Fri Aug 10 2012 Minkyu Kang 0.1.35 +- FIX : + - expandablelist: modify show animation + - virtualgrid: Redesign programming interface + - popupwindow: code clean and fixed issues + - pagelayout: fix content height + - license file update + - virtuallist: Change programming interface + - datetimepicker: getting days correctly + - searchbar: set to hidden when cancel button is hide + - White theme title font tuning +- Spec changes: + - default theme tizen-gray to tizen-white + - set default page transition to none + +* Mon Aug 02 2012 Jinhyuk Jun 0.1.34 +- FIX : + - Back Button : enlarge backbutton click size for white theme +- Feature : + - Expandable List : Add refresh api +* Mon Aug 02 2012 Jinhyuk Jun 0.1.33 +- FIX : + - click event touch threshold tuning + +* Mon Aug 02 2012 Jinhyuk Jun 0.1.32 +- FIX : + - Add back button highlight effect for white theme + +* Mon Aug 01 2012 Jinhyuk Jun 0.1.31 +- FIX : + - IME checkroutine update, improve relayout on resize event + - Add highlight effect for radio button list + - Scrollview : fix condition of updatelayout event +- Feature : progressing : add show/hide api + +* Mon Jul 27 2012 Koeun Choi 0.1.30 +- FIX : virtuallist, virtualgrid: Clean up temporary jquery.template object to clear cache + add default theme option on buttonMarkup for tizen theme + [searchbar] first fix : focus/blur fixed + back button does not work when long press + scrollview: don't auto scrolling if resizing area is too large +- Feature : notification : add api to set the icon at tickernoti + demo : update the list sample demo + Support tizen default theme + +* Mon Jul 23 2012 Youmin Ha 0.1.29 +- Improvements & Bugfixes + - HOTFIX: Revert template function with jquery.template + +* Thu Jul 19 2012 Youmin Ha 0.1.28 +- Improvements & Bugfixes + - Fix #WEB-1028: memory leak on virtuallist/virtualgrid +- Spec changes + - $.tizen.loadTheme() function accepts theme name as arguement + - Scrollview supports 'updatelayout' callback + +* Tue Jul 17 2012 Youmin Ha 0.1.27 +- Improvements & Bugfixes + - Revert 'preventing long-press popup' patch, to fix backbutton to work in SocialMagazine + +* Tue Jul 17 2012 Youmin Ha 0.1.26 +- Improvements & Bugfixes + - Add tizen-white theme package, to make rpm build to be finished + +* Tue Jul 17 2012 Youmin Ha 0.1.25 +- Improvements & Bugfixes + - Set 'slide' as default page transition effect, by JQM patch + +* Fri Jul 13 2012 Youmin Ha 0.1.24 +- Improvements & Bugfixes + - Fix IME show/hide algorithm + - Fix error on virtualgrid: link _set_scrollbar_size() function to the one in virtuallist + +* Wed Jul 11 2012 Youmin Ha 0.1.23 +- Improvements & Bugfixes + - Fix notification position + - Fix unit tests + + Fri Jul 6 2012 Youmin Ha 0.1.22 +- Spec changes + - JQM 1.1 upgrade +- Improvements & Bugfixes + - Transform3D support on scrollview + - Page layout supports IME control + - Mapview supports pinch zoom on JQM 1.1 + - Fix wrong character on button in minified version + - Virtualgrid supports scrollbar + - Lots of bugfixes + +* Fri Jun 22 2012 Youmin Ha 0.1.20 +- Spec changes + - Support 'latest' version (by symlink) for tizen-web-ui-fw.js path. + - imageslider : supports 'resize' event. + - listview : listview has 1px padding-bottom. + - loader : Change global namespace, from S to $.tizen. + - loader : Move loadCustomGlobalizeCulture() into $.tizen.util namespace. +- Improvements & Bugfixes + - Scrollview : supports 'translate3d', instead of 'translate'. + - notification : reset timer when 'show' or 'refresh' event. + - JQM patch : Fix vclick event triggered twice. +- Etc. + - Add & fix unit tests. + +* Thu Jun 14 2012 Youmin Ha 0.1.19 +- Spec changes + - mapview : new widget. + - notification : add .refresh() API. + - pagecontrol : add .value([val]) API, and change an attribute name 'data-initVal' to 'data-value'. +- Improvements & Bugfixes + - Support minified CSS. + - loader : Fix & refactor 'loading globalize culture file' routine. + - JQM Patch : Calculate min-height of window in javascript code, and remove predefined min-height value from CSS. + - Many more bugfixes. +- Etc. + - Add many unit tests. + - Fix test coverage instrumentation tool to work with current source code. diff --git a/src/loader/loader.js b/src/loader/loader.js new file mode 100644 index 0000000..827282a --- /dev/null +++ b/src/loader/loader.js @@ -0,0 +1,439 @@ +/** + * loader.js + * + * Youmin Ha + */ + +( function ($, Globalize, window, undefined) { + + var tizen = { + libFileName : "tizen-web-ui-fw(.min)?.js", + + frameworkData : { + rootDir: '/usr/lib/tizen-web-ui-fw', + version: '0.1', + theme: "tizen-white", + viewportScale: false, + defaultFontSize: 16, + minified: false + }, + + util : { + loadScriptSync : function ( scriptPath, successCB, errorCB ) { + $.ajax( { + url: scriptPath, + dataType: 'script', + async: false, + crossDomain: false, + success: successCB, + error: function ( jqXHR, textStatus, errorThrown ) { + if ( errorCB ) { + errorCB( jqXHR, textStatus, errorThrown ); + } else { + var ignoreStatusList = [ 404 ]; // 404: not found + if ( -1 == $.inArray( jqXHR.status, ignoreStatusList ) ) { + window.alert( 'Error while loading ' + scriptPath + '\n' + jqXHR.status + ':' + jqXHR.statusText ); + } else { + console.log( 'Error while loading ' + scriptPath + '\n' + jqXHR.status + ':' + jqXHR.statusText ); + } + } + } + } ); + }, + getScaleFactor: function ( ) { + var factor = navigator.scale, + width = 0, + defaultWidth = 720; + + if ( !factor ) { + width = screen.width < screen.height ? screen.width : screen.height; + factor = width / defaultWidth; + if ( factor > 1 ) { + // NOTE: some targets(e.g iPad) need to set scale equal or less than 1.0 + factor = 1; + } + } + console.log( "ScaleFactor: " + factor ); + return factor; + }, + isMobileBrowser: function ( ) { + var mobileIdx = window.navigator.appVersion.indexOf("Mobile"), + isMobile = -1 < mobileIdx; + return isMobile; + } + }, + + css : { + cacheBust: ( document.location.href.match( /debug=true/ ) ) ? + '?cacheBust=' + ( new Date( ) ).getTime( ) : + '', + addElementToHead : function ( elem ) { + var head = document.getElementsByTagName( 'head' )[0]; + if( head ) { + $( head ).prepend( elem ); + } + }, + makeLink : function ( href ) { + var cssLink = document.createElement( 'link' ); + cssLink.setAttribute( 'rel', 'stylesheet' ); + cssLink.setAttribute( 'href', href ); + cssLink.setAttribute( 'name', 'tizen-theme' ); + return cssLink; + }, + load: function ( path ) { + var head = document.getElementsByTagName( 'head' )[0], + cssLinks = head.getElementsByTagName( 'link' ), + idx, + l = null; + // Find css link element + for ( idx = 0; idx < cssLinks.length; idx++ ) { + if( cssLinks[idx].getAttribute( 'name' ) == "tizen-theme" ) { + l = cssLinks[idx]; + break; + } + } + if ( l ) { // Found the link element! + l.setAttribute( 'href', path ); + } else { + this.addElementToHead( this.makeLink( path ) ); + } + } + }, + + getParams: function ( ) { + /* Get data-* params from + +* They create a config.js file to specify which of their own JS, CSS files + need to be loaded, other app config etc. For example: + + S.load( + 'src/app_manage.js', + 'src/theme.js', + ); + + /* link custom stylesheet */ + S.css.load( + 'src/app_manage.css', + 'src/theme.css' + ); + + In this case, 'S' is an arbitrary namespace I picked for + our framework; the load() function is defined in bootstrap.js, and + simply loads the remaining framework JavaScript files, followed by + the specified JS files (relative to the application root + directory) in order. + + Note that as config.js is loaded after jQuery but before jQuery Mobile: + this is so it can hook into jQuery Mobile configuration (via + $.mobile.* properties) and also bind to the pagecreate event for + the first page. Therefore, it shouldn't directly reference any + framework functions. + +What happens when the app loads: + +* bootstrap.js is loaded + +* The auto-run function in bootstrap.js is called once the DOM is ready. + This does the following: + + - Hides the element until everything is loaded + + - Sets a default root location for the framework files (tizen-web-ui-fw in + this demo, but could be an absolute file:// path) + + - Sets a default version of the framework to load (0.1) + + - Sets a default theme to load (default) + + - Finds the bootstrap.js + + + + + + + +
        +
        +

        Web UI Framework - Template application

        +
        +
        +

        This application is an empty starting point.

        +
        +
        + + diff --git a/src/template/tizen/config.xml.in b/src/template/tizen/config.xml.in new file mode 100644 index 0000000..53eccfe --- /dev/null +++ b/src/template/tizen/config.xml.in @@ -0,0 +1,26 @@ + + + + + @APP_NAME@ + + + + + + + + + + + diff --git a/src/template/tizen/icon.png b/src/template/tizen/icon.png new file mode 100644 index 0000000..5c3d764 Binary files /dev/null and b/src/template/tizen/icon.png differ diff --git a/src/template/w3c/config.xml.in b/src/template/w3c/config.xml.in new file mode 100644 index 0000000..6bdb6fc --- /dev/null +++ b/src/template/w3c/config.xml.in @@ -0,0 +1,26 @@ + + + + + @APP_NAME@ + + + + + + + + + + + diff --git a/src/template/w3c/icon.png b/src/template/w3c/icon.png new file mode 100644 index 0000000..5c3d764 Binary files /dev/null and b/src/template/w3c/icon.png differ diff --git a/src/themes/Makefile b/src/themes/Makefile new file mode 100644 index 0000000..c321dba --- /dev/null +++ b/src/themes/Makefile @@ -0,0 +1,17 @@ +THEMES = tizen/tizen-* +export THEME_OUTPUT_ROOT ?= ../build/ + +all: themes + +themes: + # Make themes... + @for theme in ${THEMES}; do \ + make -C $$theme || exit $?; \ + done + +clean: + # Clean themes... + @for theme in ${THEMES}; do \ + make -C $$theme clean; \ + done + diff --git a/src/themes/tizen/common/jquery.mobile.button.less b/src/themes/tizen/common/jquery.mobile.button.less new file mode 100755 index 0000000..5f83a78 --- /dev/null +++ b/src/themes/tizen/common/jquery.mobile.button.less @@ -0,0 +1,309 @@ +/* +* jQuery Mobile Framework +* Copyright (c) jQuery Project +* Dual licensed under the MIT (MIT-LICENSE.txt) or GPL (GPL-LICENSE.txt) licenses. +*/ + +@import "config.less"; + +/* Button colors are defined in config.less + +/* Edit button size */ +@height_buttonEdit: 74 * @unit_base; +@width_buttonEdit: @height_buttonEdit; + +.ui-btn { display: block; text-align: center; cursor:pointer; position: relative; /*margin: .2em 0px;*/ padding: 0; vertical-align: middle; } /* wongi_1018 : For button align. */ +.ui-btn:focus, .ui-btn:active { outline: none; } +.ui-header .ui-btn, .ui-footer .ui-btn, .ui-bar .ui-btn { display: inline-block; font-size: 13 * @unit_base; margin: 0; } +.ui-btn-inline { display: inline-block; } +.ui-btn-inner { padding: .5em 36 * @unit_base; display: block; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; position: relative; zoom: 1; } +.ui-header .ui-btn-inner, .ui-footer .ui-btn-inner, .ui-bar .ui-btn-inner { padding: 0.7em 0 0.7em; } /* wongi_1024 : Button text middle align */ +.ui-header .ui-btn-inner.ui-btn-icon-only , .ui-footer .ui-btn-inner, .ui-bar .ui-btn-inner.ui-btn-icon-only { padding: .4em 8 * @unit_base .5em; } /* wongi_1024 : Button text middle align */ +.ui-btn-icon-notext { width: 24 * @unit_base; height: 24 * @unit_base; } +.ui-btn-icon-notext .ui-btn-inner { padding: 2 * @unit_base 1 * @unit_base 2 * @unit_base 3 * @unit_base; } +.ui-btn-icon-notext .ui-btn-text { position: absolute; left: -999 * @unit_base; } +.ui-btn-icon-left .ui-btn-inner { padding-left: 33 * @unit_base; } +.ui-header .ui-btn-icon-left .ui-btn-inner, +.ui-footer .ui-btn-icon-left .ui-btn-inner, +.ui-bar .ui-btn-icon-left .ui-btn-inner { padding-left: 27 * @unit_base; } +.ui-btn-icon-right .ui-btn-inner { padding-right: 33 * @unit_base; } +.ui-header .ui-btn-icon-right .ui-btn-inner, +.ui-footer .ui-btn-icon-right .ui-btn-inner, +.ui-bar .ui-btn-icon-right .ui-btn-inner { padding-right: 27 * @unit_base; } +.ui-btn-icon-top .ui-btn-inner { padding-top: 27 * @unit_base; } +.ui-header .ui-btn-icon-top .ui-btn-inner, +.ui-footer .ui-btn-icon-top .ui-btn-inner, +.ui-bar .ui-btn-icon-top .ui-btn-inner { padding-top: 27 * @unit_base; } +.ui-btn-icon-bottom .ui-btn-inner { padding-bottom: 33 * @unit_base; } +.ui-header .ui-btn-icon-bottom .ui-btn-inner, +.ui-footer .ui-btn-icon-bottom .ui-btn-inner, +.ui-bar .ui-btn-icon-bottom .ui-btn-inner { padding-bottom: 27 * @unit_base; } + +/*btn icon positioning*/ +.ui-btn-icon-notext .ui-icon { display: block; } + +.ui-btn-icon-left .ui-icon, .ui-btn-icon-right .ui-icon, .ui-btn-icon-circle .ui-icon { position: absolute; /*top: 50%; margin-top: -9px;*/ } /* wongi_1018 : do not use. No more use 18px default icons. */ + + +.ui-btn-icon-top .ui-icon, .ui-btn-icon-bottom .ui-icon { position: absolute; left: 50%; margin-left: -9px; } +.ui-btn-icon-left .ui-icon { left: /*10px;*/ 0 * @unit_base; } /* wongi_1018 : with 64px icon, left 10 -> 0 for good looking. */ +.ui-btn-icon-circle .ui-icon {left: 0 * @unit_base;} /* wongi_1018 : for circle icon center positioning. */ +.ui-btn-icon-right .ui-icon { right: 10 * @unit_base; } +.ui-btn-icon-top .ui-icon { top: 0 * @unit_base; margin-top: 0; } +.ui-btn-icon-bottom .ui-icon { bottom: 0 * @unit_base; } +.ui-header .ui-btn-icon-left .ui-icon, +.ui-footer .ui-btn-icon-left .ui-icon, +.ui-bar .ui-btn-icon-left .ui-icon { left: @style-back-btn-left; } /* SLP Default Footer : Jinhyuk */ +.ui-header .ui-btn-icon-right .ui-icon, +.ui-footer .ui-btn-icon-right .ui-icon, +.ui-bar .ui-btn-icon-right .ui-icon { right: 4 * @unit_base; } +.ui-header .ui-btn-icon-top .ui-icon, +.ui-footer .ui-btn-icon-top .ui-icon, +.ui-bar .ui-btn-icon-top .ui-icon { top: 4 * @unit_base; } +.ui-header .ui-btn-icon-bottom .ui-icon, +.ui-footer .ui-btn-icon-bottom .ui-icon, +.ui-bar .ui-btn-icon-bottom .ui-icon { bottom: 4 * @unit_base; } + +/*hiding native button,inputs */ +.ui-btn-hidden { position: absolute; top: 0; left: 0; width: 100%; height: 100%; -webkit-appearance: button; opacity: .1; cursor: pointer; background: transparent; font-size: 1 * @unit_base; border: none; line-height: 999 * @unit_base; } + +.ui-btn-text +{ + /*padding-left : 80px;*/ //wongi_1017 + margin-left: auto; + margin-right: auto; + padding:0 1px; /* Webkit width(ellipsis) problem workaround */ +} + +.ui-li .ui-btn.ui-btn-icon_only +{ + top: 50%; + margin-top: -32 * @unit_base; +} + +.ui-li .ui-btn .ui-btn-inner.ui-btn-hastxt +{ + padding: 0.2em 0.5em; +} +.ui-btn-icon-top .ui-btn-inner.ui-btn-hastxt, .ui-li .ui-btn-icon-top .ui-btn-inner.ui-btn-hastxt +{ + padding-top: 52 * @unit_base; +} +.ui-btn-icon-bottom .ui-btn-inner.ui-btn-hastxt, .ui-li .ui-btn-icon-bottom .ui-btn-inner.ui-btn-hastxt +{ + padding-bottom: 52 * @unit_base; +} +/* white theme, delete button padding */ +.ui-li .ui-btn.ui-btn-edit .ui-btn-inner.ui-btn-hastxt +{ + .LESSbutton_edit_padding; +} + +/* wongi_1017 : Icons */ +/* icons sizing */ +.ui-btn .ui-icon { width: 64 * @unit_base; height: 64 * @unit_base; } +.ui-btn.ui-btn-edit .ui-icon { width: @width_buttonEdit; height: @height_buttonEdit; } + +/* Padding for Icon with text */ +.ui-btn .ui-btn-text.ui-btn-text-padding-left { padding-left: 44 * @unit_base; } +.ui-btn .ui-btn-text.ui-btn-text-padding-right { padding-right: 48 * @unit_base; } +.ui-btn .ui-btn-text.ui-btn-text-padding-top {padding-top: 32 * @unit_base;} +.ui-icon +{ + z-index: 10; + background-repeat: no-repeat; + vertical-align: middle; + background-position: 0% 0%; + background-size: 100%; +} +.ui-btn-box.s .ui-icon +{ + position: absolute; +} +.ui-btn-box-s.ui-btn-icon-left .ui-icon, .ui-btn-box-s.ui-btn-icon-right .ui-icon +{ + margin-top: -64 * @unit_base / 2; + top: 50%; +} +.ui-btn-box-s.ui-btn-icon-top .ui-icon, .ui-btn-box-s.ui-btn-icon-bottom .ui-icon +{ + margin-left: -64 * @unit_base / 2; + left: 50%; +} +.tizen-icon-common +{ + /* Overlap original property */ + width: 64 * @unit_base; height: 64 * @unit_base; + /* margin-top : 50 */ + /* top : -32 * @unit_base; */ +} + +.ui-icon-bg {.tizen-icon-common; background-image: url(images/00_btn_circle_bg_normal.png); z-index:0; } +.ui-icon-reveal {.tizen-icon-common; background-image: url(images/00_button_reveal.png); } +.ui-icon-reveal-left {.tizen-icon-common; background-image: url(images/00_button_reveal_left.png); } +.ui-icon-closed {.tizen-icon-common; background-image: url(images/00_button_expand_closed.png); } +.ui-icon-opened {.tizen-icon-common; background-image: url(images/00_button_expand_opened.png); } +.ui-icon-info {.tizen-icon-common; background-image: url(images/00_button_info.png); } +.ui-icon-rename {.tizen-icon-common; background-image: url(images/00_button_rename.png); } +.ui-icon-call {.tizen-icon-common; background-image: url(images/00_button_call.png); } +.ui-icon-warning {.tizen-icon-common; background-image: url(images/00_button_warning.png); } +.ui-icon-plus {.tizen-icon-common; background-image: url(images/00_button_plus_normal.png); } +.ui-icon-minus {.tizen-icon-common; background-image: url(images/00_button_minus_normal.png); } +.ui-icon-cancel {.tizen-icon-common; background-image: url(images/00_button_cancel.png); } +.ui-icon-send {.tizen-icon-common; background-image: url(images/00_button_send.png); } +.ui-icon-favorite {.tizen-icon-common; background-image: url(images/00_winset_icon_favorite_on.png); } +.ui-icon-editexpand {.tizen-icon-common; background-image: url(images/00_button_icon_expand.png); top : -@height_buttonEdit/2; } +.ui-icon-editminus {.tizen-icon-common; background-image: url(images/00_button_icon_minus.png); top : -@height_buttonEdit/2;} +.ui-icon-editplus {.tizen-icon-common; background-image: url(images/00_button_icon_plus.png); top : -@height_buttonEdit/2;} + +/* Header back btn : Jinjyuk */ +.ui-btn-up-s .ui-icon-header-back-btn{ + width: 56 * @unit_base; + height: 56 * @unit_base; + + background-repeat: no-repeat; + background-size: 100% 100%; + + .LESSbtn-arrow-position; + background-image: url(images/00_winset_Back.png); +} + +.ui-btn-down-s, .ui-btn-hover-s { + .ui-icon-header-back-btn{ + width: 56 * @unit_base; + height: 56 * @unit_base; + + background-repeat: no-repeat; + background-size: 100% 100%; + + .LESSbtn-arrow-position; + background-image: url(images/00_winset_Back.png); + } +} + +.ui-header { + .ui-btn-down-s, .ui-btn-hover-s, .ui-btn-up-s { + .ui-icon-header-back-btn { + top : @style-back-btn-arrow-top; + } + } +} + +.ui-icon-header-back-btn{ + .LESSbackground-size(48 * @unit_base, 38 * @unit_base); + width: 48 * @unit_base; + height: 38 * @unit_base; +} + +.ui-icon-expandable-divider-opened { + width: 42 * @unit_base; + height: 42 * @unit_base; + + position : absolute; + right : 28 * @unit_base; + top : 0 * @unit_base; + + background-repeat: no-repeat; + background-size: 100% 100%; + + background-image: url(images/00_indexlist_icon_opened.png); + +} + +.ui-icon-expandable-divider-closed { + width: 42 * @unit_base; + height: 42 * @unit_base; + + position : absolute; + right : 28 * @unit_base; + top : 0 * @unit_base; + + background-repeat: no-repeat; + background-size: 100% 100%; + + background-image: url(images/00_indexlist_icon_closed.png); + +} + + +/* Pressed images */ +.ui-btn-down-s .ui-icon-bg, .ui-btn-down-s.ui-tizen-icon-bg {.tizen-icon-common; background-image: url(images/00_btn_circle_bg_press.png); z-index:0; } +.ui-btn-down-s .ui-icon-reveal {.tizen-icon-common; background-image: url(images/00_button_reveal_press.png); } +.ui-btn-down-s .ui-icon-reveal-left {.tizen-icon-common; background-image: url(images/00_button_reveal_left_press.png); } +.ui-btn-down-s .ui-icon-closed {.tizen-icon-common; background-image: url(images/00_button_expand_closed_press.png); } +.ui-btn-down-s .ui-icon-opened {.tizen-icon-common; background-image: url(images/00_button_expand_opened_press.png); } +.ui-btn-down-s .ui-icon-info {.tizen-icon-common; background-image: url(images/00_button_info_press.png); } +.ui-btn-down-s .ui-icon-rename {.tizen-icon-common; background-image: url(images/00_button_rename_press.png); } +.ui-btn-down-s .ui-icon-call {.tizen-icon-common; background-image: url(images/00_button_call_press.png); } +.ui-btn-down-s .ui-icon-warning {.tizen-icon-common; background-image: url(images/00_button_warning_press.png); } +.ui-btn-down-s .ui-icon-plus {.tizen-icon-common; background-image: url(images/00_button_plus_press.png); } +.ui-btn-down-s .ui-icon-minus {.tizen-icon-common; background-image: url(images/00_button_minus_press.png); } +.ui-btn-down-s .ui-icon-cancel {.tizen-icon-common; background-image: url(images/00_button_cancel_press.png); } +.ui-btn-down-s .ui-icon-send {.tizen-icon-common; background-image: url(images/00_button_send_press.png); } +.ui-btn-down-s .ui-icon-favorite {.tizen-icon-common; background-image: url(images/00_winset_icon_favorite_off.png); } +.ui-btn-down-s .ui-icon-editexpand {.tizen-icon-common; background-image: url(images/00_button_icon_expand_press.png); top : -@height_buttonEdit/2;} +.ui-btn-down-s .ui-icon-editminus {.tizen-icon-common; background-image: url(images/00_button_icon_minus_press.png); top : -@height_buttonEdit/2;} +.ui-btn-down-s .ui-icon-editplus {.tizen-icon-common; background-image: url(images/00_button_icon_plus_press.png); top : -@height_buttonEdit/2;} + +.ui-btn-inner.ui-btn-icon-only +{ + padding: 32 * @unit_base 32 * @unit_base; +} + +.ui-btn-icon-only .ui-btn-text +{ + left: -9999px; + display: none; +} + +.ui-btn-edit .ui-btn-inner.ui-btn-icon-only +{ + padding: @width_buttonEdit/2 @height_buttonEdit/2; +} + +/* Circle Icon BG : data-iconbg = "circle" */ +.ui-btn-corner-all.ui-btn-corner-circle +{ + .LESSborder-radius-all(1.0em); //wongi_1018 +} + +/* No BG button : data-iconbg = "nobg" */ +.ui-btn.ui-btn-icon-nobg, .ui-btn .ui-btn-icon-nobg +{ + background: transparent; + background-color: transparent; + border: none; +} + +/* Contact Edit Style */ +.ui-btn.ui-btn-edit .ui-btn-text +{ + color: @color_button_EditText; +} + +.ui-btn.ui-btn-edit.ui-btn-hover-s, .ui-btn.ui-btn-edit.ui-btn-up-s, .ui-btn.ui-btn-edit.ui-btn-down-s +{ font-size: 0.6em; } + +.ui-btn.ui-btn-edit.ui-btn-down-s .ui-btn-text +{ + color: @color_button_EditTextPress; +} + +.ui-btn.ui-btn-edit +{ + .LESSbutton_edit_style; + position: absolute; + top: 0 * @unit_base; + margin-top: 0 * @unit_base; +} + +.ui-btn.ui-btn-edit.ui-btn-down-s +{ + .LESSbutton_editpress_style; +} + +.ui-btn-box-s +{ + .LESSbutton_box_style; +} + diff --git a/src/themes/tizen/common/jquery.mobile.collapsible.css b/src/themes/tizen/common/jquery.mobile.collapsible.css new file mode 100644 index 0000000..11f2682 --- /dev/null +++ b/src/themes/tizen/common/jquery.mobile.collapsible.css @@ -0,0 +1,25 @@ +/* +* jQuery Mobile Framework +* Copyright (c) jQuery Project +* Dual licensed under the MIT (MIT-LICENSE.txt) or GPL (GPL-LICENSE.txt) licenses. +*/ +.ui-collapsible { margin: .5em 0; } +.ui-collapsible-heading { font-size: 16px; display: block; margin: 0 -8px; padding: 0; border-width: 0 0 1px 0; position: relative; } +.ui-collapsible-heading a { text-align: left; margin: 0; } +.ui-collapsible-heading a .ui-btn-inner { padding-left: 40px; } +.ui-collapsible-heading a span.ui-btn { position: absolute; left: 6px; top: 50%; margin: -12px 0 0 0; width: 20px; height: 20px; padding: 1px 0px 1px 2px; text-indent: -9999px; } +.ui-collapsible-heading a span.ui-btn .ui-btn-inner { padding: 10px 0; } +.ui-collapsible-heading a span.ui-btn .ui-icon { left: 0; margin-top: -10px; } +.ui-collapsible-heading-status { position:absolute; left:-9999px; } +.ui-collapsible-content { + display: block; + margin: 0 -8px; + padding: 10px 16px; + border-top: none; /* Overrides ui-btn-up-* */ + background-image: none; /* Overrides ui-btn-up-* */ + font-weight: normal; /* Overrides ui-btn-up-* */ +} +.ui-collapsible-content-collapsed { display: none; } + +.ui-collapsible-set { margin: .5em 0; } +.ui-collapsible-set .ui-collapsible { margin: -1px 0 0; } diff --git a/src/themes/tizen/common/jquery.mobile.controlgroup.less b/src/themes/tizen/common/jquery.mobile.controlgroup.less new file mode 100755 index 0000000..b1e7dd3 --- /dev/null +++ b/src/themes/tizen/common/jquery.mobile.controlgroup.less @@ -0,0 +1,91 @@ +@import "config.less"; + +.ui-controlgroup, +fieldset.ui-controlgroup { + padding: 0; + margin: .5em 0 1em; +} +.ui-bar .ui-controlgroup { + margin: 0 .3em; +} +.ui-controlgroup-label { + font-size: 1em; + line-height: 1.4; + font-weight: normal; + margin: 0 0 .3em; +} + +.ui-controlgroup-controls { + display: block; +} +.ui-controlgroup { + li { + list-style: none; + } + .ui-btn-inner { + white-space: nowrap; + } + .ui-checkbox label, .ui-radio { + label { + font-size: 1em; + } + } + .ui-radio { + width: 25%; + overflow: hidden; + label { + text-align: center; + white-space: nowrap; + } + } + .ui-radio-off, .ui-radio-on { + width: 100%; + border-right-width: 1px; + border-right-color: @color_controlgroup_btn_border; + border-right-style: solid; + border-left-width: 1px; + border-left-color: @color_controlgroup_btn_border; + border-left-style: solid; + } + .ui-corner-left { + border-left-width: 0px; + } + .ui-corner-right { + border-right-width: 0px; + } +} +.ui-controlgroup-vertical { + .ui-btn, .ui-checkbox, .ui-radio { + margin: 0; + border-bottom-width: 0; + } + .ui-controlgroup-last { + border-bottom-width: 1px; + } + + .ui-radio { + width : 100%; + } + + .ui-radio label { + text-align :left; + .ui-btn-inner { + margin-left : 16 * @unit_base; + margin-right : 16 * @unit_base; + } + } +} +.ui-controlgroup-horizontal { + padding: 0; + .ui-btn { + display: inline-block; + margin: 0 -5px 0 0; + } + .ui-checkbox, .ui-radio { + float: left; + margin: 0 -1px 0 0; + } + .ui-controlgroup-last { + margin-right: 0; + } +} diff --git a/src/themes/tizen/common/jquery.mobile.core.less b/src/themes/tizen/common/jquery.mobile.core.less new file mode 100755 index 0000000..8f33494 --- /dev/null +++ b/src/themes/tizen/common/jquery.mobile.core.less @@ -0,0 +1,133 @@ +/* +* jQuery Mobile Framework +* Copyright (c) jQuery Project +* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. +*/ + +/*** less definitions ***/ +@import "config.less"; +/************************/ + + +/* some unsets - more probably needed */ +.ui-mobile, .ui-mobile body { height: 100%; font-size: @font_size_default; } +.ui-mobile fieldset, .ui-page { padding: 0; margin: 0; } +.ui-mobile a img, .ui-mobile fieldset { border: 0; } + +/* responsive page widths */ +.ui-mobile-viewport { margin: 0; overflow-x: hidden; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } + +/* "page" containers - full-screen views, one should always be in view post-pageload */ +.ui-mobile [data-role=page], .ui-mobile [data-role=dialog], .ui-page { top: 0; left: 0; width: 100%; min-height: 100%; position: absolute; display: none; border: 0; } +.ui-mobile .ui-page-active { display: block; overflow: visible; } + +/* on ios4, setting focus on the page element causes flashing during transitions when there is an outline, so we turn off outlines */ +.ui-page { outline: none; } + +.ui-mobile, .ui-mobile .ui-page { + background: @color_bg; + color : @color_text; +} + +/* native overflow scrolling */ +.ui-page.ui-mobile-touch-overflow, +.ui-mobile-touch-overflow.ui-native-fixed .ui-content { + overflow: auto; + height: 100%; + -webkit-overflow-scrolling: touch; + -moz-overflow-scrolling: touch; + -o-overflow-scrolling: touch; + -ms-overflow-scrolling: touch; + overflow-scrolling: touch; +} +.ui-page.ui-mobile-touch-overflow, +.ui-page.ui-mobile-touch-overflow * { + /* some level of transform keeps elements from blinking out of visibility on iOS */ + -webkit-transform: rotateY(0); +} +.ui-page.ui-mobile-pre-transition { + display: block; +} + +/* loading screen */ +.ui-loading .ui-mobile-viewport { overflow: hidden !important; } +.ui-loading .ui-loader { display: block; } +.ui-loading .ui-page { overflow: hidden; } +.ui-loader { display: none; position: absolute; opacity: .85; z-index: @z_base_loader; left: 50%; width: 200px; margin-left: -130px; margin-top: -35px; padding: 10px 30px; } +.ui-loader h1 { font-size: 32 * @unit_base; text-align: center; } +.ui-loader .ui-icon { position: static; display: block; opacity: .9; margin: 0 auto; width: 35px; height: 35px; background-color: transparent; } + +/*fouc*/ +.ui-mobile-rendering > * { visibility: hidden; } + +/*headers, content panels*/ +.ui-bar, .ui-body { position: relative; padding: .4em 15px; overflow: hidden; display: block; clear:both; } +.ui-bar { font-size: 16px; margin: 0; } +.ui-bar h1, .ui-bar h2, .ui-bar h3, .ui-bar h4, .ui-bar h5, .ui-bar h6 { margin: 0; padding: 0; font-size: 16px; display: inline-block; } + +.ui-header, .ui-footer { display: block; } +.ui-page .ui-header, .ui-page .ui-footer { + position : fixed; /*position: relative;*/ + z-index : @z_base_header_footer; +} +/* Title button packing order */ +.ui-header .ui-btn-left { + top: .4em; + float: left; +} +.ui-header .ui-btn-right { + float: right; + top: .4em; +} +.ui-header .ui-title, .ui-footer .ui-title { min-height: 1.1em; text-align: center; font-size: 16px; display: block; margin: .6em 90px .8em; padding: 0; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; outline: 0 !important; } + +/*content area*/ +.ui-content { border-width: 0; overflow: visible; overflow-x: hidden; padding: 15px; } +.ui-page-fullscreen .ui-content { padding:0; } + +/* native fixed headers and footers */ +.ui-mobile-touch-overflow.ui-page.ui-native-fixed, +.ui-mobile-touch-overflow.ui-page.ui-native-fullscreen { + overflow: visible; +} +.ui-mobile-touch-overflow.ui-native-fixed .ui-header, +.ui-mobile-touch-overflow.ui-native-fixed .ui-footer { + position: fixed; + left: 0; + right: 0; + top: 0; + z-index: 200; +} +.ui-mobile-touch-overflow.ui-page.ui-native-fixed .ui-footer { + top: auto; + bottom: 0; +} +.ui-mobile-touch-overflow.ui-native-fixed .ui-content { + padding-top: 2.5em; + padding-bottom: 3em; + top: 0; + bottom: 0; + height: auto; + position: absolute; +} +.ui-mobile-touch-overflow.ui-native-fullscreen .ui-content { + padding-top: 0; + padding-bottom: 0; +} +.ui-mobile-touch-overflow.ui-native-fullscreen .ui-header, +.ui-mobile-touch-overflow.ui-native-fullscreen .ui-footer { + opacity: .9; +} +.ui-native-bars-hidden { + display: none; +} + +/* icons sizing */ +.ui-icon { width: 18px; height: 18px; } + +/* fullscreen class on ui-content div */ +.ui-fullscreen { } +.ui-fullscreen img { max-width: 100%; } + +/* non-js content hiding */ +.ui-nojs { position: absolute; left: -9999px; } diff --git a/src/themes/tizen/common/jquery.mobile.dialog.less b/src/themes/tizen/common/jquery.mobile.dialog.less new file mode 100755 index 0000000..d9d33b3 --- /dev/null +++ b/src/themes/tizen/common/jquery.mobile.dialog.less @@ -0,0 +1,41 @@ +@import "config.less"; + +.ui-dialog { + + min-height: 480px; + + .ui-header, + .ui-content, + .ui-footer { + margin: 15px; + position: relative; + } + .ui-header, + .ui-footer { + z-index: 10; + width: auto; + } + .ui-header .ui-btn-left { + width: 0px; + border-width: 0px; + } + + .center_info { + + .LESSdisplaybox(); + .LESSbox-orient(vertical); + .LESSbox-align(center); + .LESSbox-pack(center); + + .popup-text { + font-size: 42px; + background: #213c49; + width: 100%; + p { + text-align: center; + padding: 22px 16px; + } + } + } + +} diff --git a/src/themes/tizen/common/jquery.mobile.forms.checkboxradio.less b/src/themes/tizen/common/jquery.mobile.forms.checkboxradio.less new file mode 100755 index 0000000..d61bfed --- /dev/null +++ b/src/themes/tizen/common/jquery.mobile.forms.checkboxradio.less @@ -0,0 +1,181 @@ +/* +* jQuery Mobile Framework +* Copyright (c) jQuery Project +* Dual licensed under the MIT (MIT-LICENSE.txt) or GPL (GPL-LICENSE.txt) licenses. +*/ +@import "config.less"; + +.ui-checkbox .ui-btn-inner, .ui-radio .ui-btn-inner { white-space: normal; } +//.ui-checkbox .ui-btn-icon-left .ui-btn-inner,.ui-radio .ui-btn-icon-left .ui-btn-inner { padding-left: 2.313em; } +//.ui-checkbox .ui-btn-icon-right .ui-btn-inner, .ui-radio .ui-btn-icon-right .ui-btn-inner { padding-right: 2.313em; } +//.ui-checkbox .ui-btn-icon-left .ui-icon, .ui-radio .ui-btn-icon-left .ui-icon {left: 15px; } +//.ui-checkbox .ui-btn-icon-right .ui-icon, .ui-radio .ui-btn-icon-right .ui-icon {right: 15px; } + +.ui-icon-radio-off { + background-color: transparent; +} + +//font size: 42.... +@checkbox-icon-left: (16*@unit_base); //16 + +@checkbox-radio-all-height: (80*@unit_base); //on-off style is the biggest. + +@checkbox-radio-size-width: (42*@unit_base); +@checkbox-radio-size-height: (42*@unit_base); + +@favorite-size-width: (64*@unit_base); +@favorite-size-height: (64*@unit_base); + +@checkbox-radio-icon-internal-bottom: (-@checkbox-radio-size-height/2); //-icon size/2 (42/2) +@favorite-icon-internal-bottom: (-@favorite-size-height/2); //-icon size/2 (64/2) + +@icon-left-margin: (16*@unit_base); +@checkbox-radio-label-left: (@checkbox-radio-size-width + 2*@icon-left-margin); //16+42+16 +@favorite-label-left: (@favorite-size-width + 2*@icon-left-margin); //16+64+16 + +.ui-checkbox, .ui-radio { + height: @checkbox-radio-all-height; + position: relative; + margin: 0; + z-index: 1; + + //clear btn basic setting + .LESSclear-btn-basic-setting(); + input { + position: absolute; + left: -10000px; + height: 100%; + outline: 0 !important; + z-index: 0; + } + .ui-btn { + height: 100%; + margin: 0; + text-align: left; + z-index: 2; + } + .ui-btn.ui-btn-icon-left { + display: block; + .ui-btn-inner { + display: inline-block; + line-height: @checkbox-radio-all-height; + padding: 0 16*@unit_base 0 16*@unit_base; + .ui-btn-text { + display: inline-block; + vertical-align: middle; + margin-left: 40 * @unit_base; + } + .ui-icon { + position: absolute; + top: 50%; + left: 16 * @unit_base; + width: @checkbox-radio-size-width; + height: @checkbox-radio-size-height; + margin-top: @checkbox-radio-icon-internal-bottom; + } + } + } +} +.ui-checkbox.favorite { + input { + position: absolute; + left: -10000px; + height: 100%; + outline: 0 !important; + z-index: 1; + } + + .ui-btn.ui-btn-icon-left { + display: block; + .ui-btn-inner { + display: inline-block; + line-height: @checkbox-radio-all-height; + padding: 0 0 0 16*@unit_base; + .ui-btn-text { + display: inline-block; + vertical-align: middle; + margin-left: @favorite-label-left; + } + .ui-icon { + position: absolute; + top: 50%; + width: @favorite-size-width; + height: @favorite-size-height; + margin-top: @favorite-icon-internal-bottom; + } + } + } +} + +/* put img inside of checkbox(normal, favorite, on&off style) */ +@checkbox-radio-size-width: (42*@unit_base); +@checkbox-radio-size-height: (42*@unit_base); + +@favorite-size-width: (64*@unit_base); +@favorite-size-height: (64*@unit_base); + +.ui-icon-checkbox-off, .ui-icon-checkbox-on, +.favorite .ui-icon-checkbox-off, .favorite .ui-icon-checkbox-on, +.ui-icon-checkbox-on-press, .ui-icon-checkbox-off-press, +.ui-icon-radio-off, .ui-icon-radio-on, +.ui-icon-radio-on-press, .ui-icon-radio-off-press { + background-size: 100% 100%; + background-color: transparent; +} +.ui-icon-checkbox-off { + width: @checkbox-radio-size-width; + height: @checkbox-radio-size-height; + background-image: url(images/00_check_bg.png); +} +.ui-icon-checkbox-on { + width: @checkbox-radio-size-width; + height: @checkbox-radio-size-height; + background-image: url(images/00_check_checking.png), url(images/00_check_bg.png); + background-repeat: no-repeat; +} +.ui-icon-checkbox-off-press { + width: @checkbox-radio-size-width; + height: @checkbox-radio-size-height; + background-image: url(images/00_check_bg_press.png); +} +.ui-icon-checkbox-on-press { + width: @checkbox-radio-size-width; + height: @checkbox-radio-size-height; + background-image: url(images/00_check_checking.png), url(images/00_check_bg_press.png); + background-repeat: no-repeat; +} +.favorite { + .ui-icon-checkbox-off, + .ui-icon-checkbox-off-press { + width: @favorite-size-width; + height: @favorite-size-height; + background-image: url(images/00_winset_icon_favorite_off.png); + } + .ui-icon-checkbox-on, + .ui-icon-checkbox-on-press { + width: @favorite-size-width; + height: @favorite-size-height; + background-image: url(images/00_winset_icon_favorite_on.png); + } +} + +.ui-icon-radio-off { + width: @checkbox-radio-size-width; + height: @checkbox-radio-size-height; + background-image: url(images/00_button_radio_normal2.png); +} +.ui-icon-radio-on { + width: @checkbox-radio-size-width; + height: @checkbox-radio-size-height; + background-image: url(images/00_button_radio_normal1.png); +} +.ui-icon-radio-on-press { + width: @checkbox-radio-size-width; + height: @checkbox-radio-size-height; + background-image: url(images/00_button_radio_press2.png); +} +.ui-icon-radio-off-press { + width: @checkbox-radio-size-width; + height: @checkbox-radio-size-height; + background-image: url(images/00_button_radio_press1.png); +} diff --git a/src/themes/tizen/common/jquery.mobile.forms.fieldcontain.css b/src/themes/tizen/common/jquery.mobile.forms.fieldcontain.css new file mode 100644 index 0000000..c4b2648 --- /dev/null +++ b/src/themes/tizen/common/jquery.mobile.forms.fieldcontain.css @@ -0,0 +1,10 @@ +/* +* jQuery Mobile Framework +* Copyright (c) jQuery Project +* Dual licensed under the MIT (MIT-LICENSE.txt) or GPL (GPL-LICENSE.txt) licenses. +*/ +.ui-field-contain { padding: 1.5em 0; margin: 0; border-bottom-width: 1px; overflow: visible; } +.ui-field-contain:first-child { border-top-width: 0; } +@media all { + .ui-field-contain { border-width: 0; padding: 0; margin: 0.8em 0; } +} diff --git a/src/themes/tizen/common/jquery.mobile.forms.select.css b/src/themes/tizen/common/jquery.mobile.forms.select.css new file mode 100644 index 0000000..623d819 --- /dev/null +++ b/src/themes/tizen/common/jquery.mobile.forms.select.css @@ -0,0 +1,39 @@ +/* +* jQuery Mobile Framework +* Copyright (c) jQuery Project +* Dual licensed under the MIT (MIT-LICENSE.txt) or GPL (GPL-LICENSE.txt) licenses. +*/ +.ui-select { display: block; position: relative; } +.ui-select select { position: absolute; left: -9999px; top: -9999px; } +.ui-select .ui-btn { overflow: hidden; } +.ui-select .ui-btn select { cursor: pointer; -webkit-appearance: button; left: 0; top:0; width: 100%; min-height: 1.5em; min-height: 100%; height: 3em; max-height: 100%; opacity: 0; -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; filter: alpha(opacity=0); z-index: 2; } +@-moz-document url-prefix() {.ui-select .ui-btn select { opacity: 0.0001; }} +.ui-select .ui-btn select.ui-select-nativeonly { opacity: 1; text-indent: 0; } + +.ui-select .ui-btn-icon-right .ui-btn-inner { padding-right: 45px; } +.ui-select .ui-btn-icon-right .ui-icon { right: 15px; } + +/* labels */ +label.ui-select { font-size: 16px; line-height: 1.4; font-weight: normal; margin: 0 0 .3em; display: block; } + +/*listbox*/ +.ui-select .ui-btn-text, .ui-selectmenu .ui-btn-text { display: block; min-height: 1em; } +.ui-select .ui-btn-text { text-overflow: ellipsis; overflow: hidden;} + +.ui-selectmenu { position: absolute; padding: 0; z-index: 100 !important; width: 80%; max-width: 350px; padding: 6px; } +.ui-selectmenu .ui-listview { margin: 0; } +.ui-selectmenu .ui-btn.ui-li-divider { cursor: default; } +.ui-selectmenu-hidden { top: -9999px; left: -9999px; } +.ui-selectmenu-screen { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 99; } +.ui-screen-hidden, .ui-selectmenu-list .ui-li .ui-icon { display: none; } +.ui-selectmenu-list .ui-li .ui-icon { display: block; } +.ui-li.ui-selectmenu-placeholder { display: none; } +.ui-selectmenu .ui-header .ui-title { margin: 0.6em 46px 0.8em; } + +@media all and (min-width: 450px){ + label.ui-select { vertical-align: top; display: inline-block; width: 20%; margin: 0 2% 0 0; } + .ui-select { width: 60%; display: inline-block; } +} + +/* when no placeholder is defined in a multiple select, the header height doesn't even extend past the close button. this shim's content in there */ +.ui-selectmenu .ui-header h1:after { content: '.'; visibility: hidden; } \ No newline at end of file diff --git a/src/themes/tizen/common/jquery.mobile.forms.textinput.less b/src/themes/tizen/common/jquery.mobile.forms.textinput.less new file mode 100755 index 0000000..4efdf16 --- /dev/null +++ b/src/themes/tizen/common/jquery.mobile.forms.textinput.less @@ -0,0 +1,173 @@ +@import "config.less"; +@search-bar-padding: (16*@unit_base); + +label.ui-input-text { + font-size: 32 * @unit_base; + line-height: 1.4; + display: block; + font-weight: normal; + margin: 0 0 .3em; +} +input.ui-input-text, textarea.ui-input-text { + background-image: none; + padding: .4em; + line-height: 1.4; + font-size: 32 * @unit_base; + display: block; + width: 95%; +} +input.ui-input-text { -webkit-appearance: none; } +textarea.ui-input-text { + height: 50*@unit_base; + -webkit-transition: height 200ms linear; + -moz-transition: height 200ms linear; + -o-transition: height 200ms linear; + transition: height 200ms linear; +} + +.ui-input-search { + padding: 0 0; + position: relative; + input.ui-input-text { + border: none; + background: transparent none; + outline: 0 !important; + } + .ui-btn-down-s, .ui-btn-up-s, .ui-btn-hover-s { + border: none; + background: transparent none; + } + .ui-btn-icon-notext.ui-input-clear { + width: 38 * @unit_base; + height: 38 * @unit_base; + .ui-btn-inner { padding: 0; } + } + .ui-icon-deleteSearch { + width: 38 * @unit_base; + height: 38 * @unit_base; + } + + .ui-input-clear { + position: absolute; + right: 0; + top: 0; + vertical-align: middle; + margin: 16 * @unit_base; + } + .ui-input-clear-hidden { display: none; } +} + +.ui-image-search { + position: absolute; + top: 0; + left: 0; + width : 100%; + margin: 16 * @unit_base; +} + +.ui-image-searchfield:after { + margin-left: 58 * @unit_base; + content: "Search"; + color: @color_searchbar_default_text; +} + +/* orientation adjustments - incomplete!*/ +@media all and (min-width: 720*@unit_base){ + label.ui-input-text { + vertical-align: top; + display: inline-block; + width: 20%; + margin: 0 2% 0 0 + } + input.ui-input-text, + textarea.ui-input-text, + .ui-input-search { width: 60%; display: inline-block; } + .ui-input-search input.ui-input-text { width: 85%; /*echos rule from above*/ } +} + +/* search bar */ +.ui-body-s > div > .ui-field-contain > .input-search-bar, +.ui-body-s > .ui-field-contain > .input-search-bar { + margin : -48*@unit_base -15*@unit_base -32*@unit_base -15*@unit_base; +} /* Need to confirm exact concept : Jinhyuk */ + +.input-search-bar { + position : relative; /* In case searchbar in header : Jinhyuk */ + + background-color: @color_searchbar_bg; + padding: @search-bar-padding; + vertical-align: middle; + .ui-corner-all { + .LESSborder-radius-all(.3em); + } + .ui-input-search { + font-size : 32 * @unit_base; + display: inline-block; + position: relative; + width: 70%; + padding: 0; + background-color: @color_searchbar_input_field_bg; + .ui-input-text { + height: 74 * @unit_base; + padding : 0px; + margin-left : 10 * @unit_base; + } + } + .ui-input-search-default { + width: 70%; + -webkit-transition: width 400ms linear; + -moz-transition: width 400ms linear; + -o-transition: width 400ms linear; + transition: width 400ms linear; + } + .ui-input-search-wide { + width: 100%; + -webkit-transition: width 400ms linear; + -moz-transition: width 400ms linear; + -o-transition: width 400ms linear; + transition: width 400ms linear; + } + .ui-btn-icon-cancel { + display: inline-block; + position: absolute; + left: 70%; + + vertical-align: middle; + margin-left : 10 * @unit_base; + margin-right : 10 * @unit_base; + padding : 0px; + + height : 74 * @unit_base; + + border-color : none; + .ui-btn-text{ + font-size : 32 * @unit_base; + } + .ui-btn-inner { + padding-top : 18 * @unit_base; + padding-bottom : 18 * @unit_base; + } + } + + .ui-btn-icon-cancel.ui-input-cancel { + width: 26%; + -webkit-transition: all 400ms linear; + -moz-transition: all 400ms linear; + -o-transition: all 400ms linear; + transition: all 400ms linear; + } + .ui-btn-cancel-hide { + left: 100%; + visibility: hidden; + } + .ui-btn-cancel-show { + left: 70%; + visibility: visible; + } +} + +.ui-header .input-search-bar { + padding-top : 16 * @unit_base; + padding-bottom : 16 * @unit_base; +} + diff --git a/src/themes/tizen/common/jquery.mobile.grids.css b/src/themes/tizen/common/jquery.mobile.grids.css new file mode 100644 index 0000000..162cb83 --- /dev/null +++ b/src/themes/tizen/common/jquery.mobile.grids.css @@ -0,0 +1,28 @@ +/* +* jQuery Mobile Framework +* Copyright (c) jQuery Project +* Dual licensed under the MIT (MIT-LICENSE.txt) or GPL (GPL-LICENSE.txt) licenses. +*/ + +/* content configurations. */ +.ui-grid-a, .ui-grid-b, .ui-grid-c, .ui-grid-d { overflow: hidden; } +.ui-block-a, .ui-block-b, .ui-block-c, .ui-block-d, .ui-block-e { margin: 0; padding: 0; border: 0; float: left; min-height:1px;} + +/* grid solo: 100 - single item fallback */ +.ui-grid-solo .ui-block-a { width: 100%; float: none; } + +/* grid a: 50/50 */ +.ui-grid-a .ui-block-a, .ui-grid-a .ui-block-b { width: 50%; } +.ui-grid-a .ui-block-a { clear: left; } + +/* grid b: 33/33/33 */ +.ui-grid-b .ui-block-a, .ui-grid-b .ui-block-b, .ui-grid-b .ui-block-c { width: 33.333%; } +.ui-grid-b .ui-block-a { clear: left; } + +/* grid c: 25/25/25/25 */ +.ui-grid-c .ui-block-a, .ui-grid-c .ui-block-b, .ui-grid-c .ui-block-c, .ui-grid-c .ui-block-d { width: 25%; } +.ui-grid-c .ui-block-a { clear: left; } + +/* grid d: 20/20/20/20/20 */ +.ui-grid-d .ui-block-a, .ui-grid-d .ui-block-b, .ui-grid-d .ui-block-c, .ui-grid-d .ui-block-d, .ui-grid-d .ui-block-e { width: 20%; } +.ui-grid-d .ui-block-a { clear: left; } diff --git a/src/themes/tizen/common/jquery.mobile.headerfooter.less b/src/themes/tizen/common/jquery.mobile.headerfooter.less new file mode 100644 index 0000000..3488d91 --- /dev/null +++ b/src/themes/tizen/common/jquery.mobile.headerfooter.less @@ -0,0 +1,15 @@ +/* +* jQuery Mobile Framework +* Copyright (c) jQuery Project +* Dual licensed under the MIT (MIT-LICENSE.txt) or GPL (GPL-LICENSE.txt) licenses. +*/ +/* fixed page header & footer configuration */ +@import "config.less"; + +.ui-header, .ui-footer, .ui-page-fullscreen .ui-header, .ui-page-fullscreen .ui-footer { position: absolute; overflow: hidden; width: 100%; border-left-width: 0; border-right-width: 0; } +.ui-header-fixed, .ui-footer-fixed { + z-index: @z_base_header_footer; + -webkit-transform: translateZ(0); /* Force header/footer rendering to go through the same rendering pipeline as native page scrolling. */ +} +.ui-footer-duplicate, .ui-page-fullscreen .ui-fixed-inline { display: none; } +.ui-page-fullscreen .ui-header, .ui-page-fullscreen .ui-footer { opacity: .9; } diff --git a/src/themes/tizen/common/jquery.mobile.listview.less b/src/themes/tizen/common/jquery.mobile.listview.less new file mode 100755 index 0000000..c9a1d73 --- /dev/null +++ b/src/themes/tizen/common/jquery.mobile.listview.less @@ -0,0 +1,712 @@ +/* +* jQuery Mobile Framework +* Copyright (c) jQuery Project +* Dual licensed under the MIT (MIT-LICENSE.txt) or GPL (GPL-LICENSE.txt) licenses. +*/ + +/*** less definitions ***/ + +@import "config.less"; + +/* Using font size */ +@list-font-size-main: 44 * @unit_base; +@list-font-size-sub: 32 * @unit_base; +@list-font-size-divider: 32 * @unit_base; // NOTE: defined in dialogue group + +/* +@list-dialogue-font-size-main: 38 * @unit_base; +@list-dialogue-font-size-sub: 32 * @unit_base; +*/ + +@list-font-weight: normal; + +/* +@list-li-height: 112 * @unit_base; + +@list-li-2line-height: 128 * @unit_base; +@list-li-3line-height: 160 * @unit_base; +@list-li-top-padding: 10 * @unit_base; +@list-li-main-line-height: 60 * @unit_base; +@list-li-sub-line-height: 48 * @unit_base; +*/ +@list-smallicon-size: 32 * @unit_base; +@list-li-padding-horizontal: 16 * @unit_base; +/* +@list-li-divider-height: 32 * @unit_base; + +*/ +@list-bigicon-size: 64 * @unit_base; +@list-bigicon-size2: 72 * @unit_base; +/* +@list-checkbox-size: 42 * @unit_base; +@list-progressbar-height: 16 * @unit_base; +*/ + + +// Bubble +@list-li-bubble-font-size: 38 * @unit_base; +@list-li-bubble-time-font-size: 26 * @unit_base; +@list-li-bubble-date-font-size: @list-li-bubble-time-font-size; +@list-li-bubble-corner-radius: 9 * @unit_base; // TODO: fit to 9px (picked from bg images) + +@list-li-sub-left-width: 187 * @unit_base; +@list-li-main-right-padding: 187 * @unit_base; + +//Email +@list-li-email-top-padding: 8 * @unit_base; +@list-li-email-subline-top-padding: 4 * @unit_base; +@list-li-email-sub-line-height: 40 * @unit_base; +@list-email-icon-width: 56 * @unit_base; +@list-email-icon-height: 60 * @unit_base; + +@list-email-icon-top-padding: 16 * @unit_base; +@list-email-attach-icon-width: 40 * @unit_base; +@list-email-attach-icon-height: 40 * @unit_base; +@list-email-warning-icon-width: 30 * @unit_base; +@list-email-warning-icon-height: 30 * @unit_base; +@list-email-text-padding-left: 60 * @unit_base; + +/************************/ + +.ui-listview { + margin: 0; + counter-reset: listnumbering; + border-top-width: 1px; + border-top-style: solid; + + li.ui-btn > .ui-btn-hastxt > .ui-btn-text.ui-btn-text-padding-right { + padding-right: 0 * @unit_base; // Clear default button padding-right + } + + &> .ui-li { + // list item separator line + border-bottom-width: 1px; + border-bottom-style: solid; + + border-top-width: 0px; + } + + &> .ui-li:not(.ui-li-divider) { + &:not(.ui-li-static) { + min-height : 112 * @unit_base; + } + } + + &> .ui-li.ui-li-has-multiline:not(.ui-li-divider) { + &:not(.ui-li-static) { + min-height : 128 * @unit_base; + } + } +} + +.ui-content { + .ui-listview { + margin-left: -16 * @unit_base; + margin-right: -16 * @unit_base; + padding-bottom: 1px; + + .ui-listview { + margin: 0; + } + + } + .ui-listview-inset { + margin: 1em 0; + } +} +.ui-listview, +.ui-li { + list-style:none; + padding:0; + + font-size : @list-font-size-main; +} +.ui-li, +.ui-li.ui-field-contain { + display: block; + margin:0; + position: relative; + overflow: visible; + text-align: left; +} +.ui-li { + h3 { + margin-top : 0px; + margin-bottom : 0px; + + font-size : @list-font-size-main; + min-height : 52 * @unit_base; + font-weight : normal; + } + + form { + display : inline-block; + } + .ui-btn { + top: 50%; + margin-top: -0.8em; + } + .ui-btn-text { + position: relative; + a.ui-link-inherit { + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + } + } + &:last-child, + &.ui-field-contain:last-child { + border-bottom-width: 1px; + } + &>.ui-btn-inner { + display: block; + position: relative; + padding: 0; + border-width:0; + } + + &>.ui-btn-inner.ui-btn-hastxt { + padding: 0px 0px; + } + + .ui-btn-inner a.ui-link-inherit, + &.ui-li-static { + padding-top : 30 * @unit_base; + padding-bottom : 30 * @unit_base; + padding-left : 16 * @unit_base; + padding-right : 16 * @unit_base; + display: block; + + overflow:hidden; + white-space : nowrap; + text-overflow : ellipsis; + } + + .ui-toggleswitch { + &:last-child { + top : 50%; + margin-top : -40 * @unit_base; + + display : inline-block; + position : absolute; + + right : 16 * @unit_base; + } + } + + [data-role="button"] { + &:last-child { + position : absolute; + right : 16 * @unit_base; + } + } + + .ui-radio, + .ui-checkbox { + &:first-child{ + position : absolute; + top : 50%; + margin-top : -30 * @unit_base; + + left : 16 * @unit_base; + + width : 60 * @unit_base; + height : 60 * @unit_base; + + .ui-btn-inner { + padding : 10 * @unit_base 10 * @unit_base 10 * @unit_base 10 * @unit_base; + line-height : 40 * @unit_base; + + color : transparent; + + .ui-icon { + left : 5 * @unit_base; + } + } + } + } + + img.ui-li-bigicon { + position : absolute; + + top : 50%; + margin-top : -36 * @unit_base; + + &:first-child { + left : 16 * @unit_base; + } + + &:nth-child(2) { + left : 92 * @unit_base; + } + + &:last-child { + right : 16 * @unit_base; + } + } + + .ui-li-color-bar + img.ui-li-bigicon:nth-child(2) { + left : 16 * @unit_base; + } + + .ui-li-color-bar { + position : absolute; + width : 12 * @unit_base; + height : 20 * @unit_base; + + top : 0 * @unit_base; + left : 0 * @unit_base; + + background-color : rgba(0, 0, 0, 1); + } +} + +li.ui-li-thumbnail-right { + img.ui-li-bigicon.ui-li-thumb { + left : auto; + right : 16 * @unit_base; + } +} + +.ui-li.ui-li-has-multiline { + .ui-btn-inner a.ui-link-inherit, + &.ui-li-static { + padding-top : 10 * @unit_base; + padding-bottom : 58 * @unit_base; + + min-height : 60 * @unit_base; + } + + a { + overflow:hidden; + white-space : nowrap; + text-overflow : ellipsis; + padding-right : 16 * @unit_base; /* ellipsis for normal text */ + } +} + + +/********************************************/ +/*************** Divider ********************/ +/********************************************/ +.ui-li-divider { + cursor: default; + + counter-reset: listnumbering; + font-weight: bold; + font-size: @list-font-size-divider; + padding-left: 16 * @unit_base; + padding-top: 8 * @unit_base; + padding-bottom: 8 * @unit_base; +} + +.ui-listview .ui-li-divider { + &[data-style="dialogue"] { + height: 32 * @unit_base; + padding : 0px; + + .LESSdialogue-divider; + background : @color_bg; + } + + &[data-style="check"] { + height: 60 * @unit_base; + padding-top : 0px; + padding-bottom : 0px; + + padding-left : 92 * @unit_base; + line-height : 60 * @unit_base; + } + + &[data-style="checkexpandable"] { + height: 60 * @unit_base; + padding-top : 0px; + padding-bottom : 0px; + + padding-left : 92 * @unit_base; + line-height : 60 * @unit_base; + } + + &[data-style="expandable"] { + height: 60 * @unit_base; + padding-top : 0px; + padding-bottom : 0px; + + line-height : 60 * @unit_base; + } +} + +.ui-divider-expand-div { + position : absolute; + + width : 98 * @unit_base; + height : 42 * @unit_base; + top : 10 * @unit_base; + right : 0px; + + border-left-width : 1px; + border-left-style : solid; + border-left-color : @color_list_divider_expand_div; +} + + +.ui-li-has-thumb:not(.ui-li-thumbnail-right) { + .ui-btn-inner a.ui-link-inherit, + &.ui-li-static { + min-height: 60 * @unit_base; + padding-left: 104 * @unit_base; + } + .ui-li-text-sub { + padding-left: 104 * @unit_base; + padding-right: 16 * @unit_base; /* ellipsis for sub text */ + } +} + +.ui-li-has-checkbox, +.ui-li-has-radio{ + .ui-btn-inner a.ui-link-inherit, + &.ui-li-static { + min-height: 60 * @unit_base; + padding-left: 92 * @unit_base; + } + .ui-li-text-sub { + padding-left: 92 * @unit_base; + } +} + +.ui-li-has-thumb.ui-li-has-checkbox, +.ui-li-has-thumb.ui-li-has-radio { + .ui-btn-inner a.ui-link-inherit, + &.ui-li-static { + min-height: 60 * @unit_base; + padding-left: 180 * @unit_base; + } + + .ui-li-text-sub { + padding-left: 180 * @unit_base; + } +} + +.ui-li.ui-li-has-right-circle-btn { + .ui-btn-inner a { + padding-right : 96 * @unit_base; + } +} + +.ui-li.ui-li-has-right-btn { + .ui-btn-inner a { + padding-right : 256 * @unit_base; + } +} + +.ui-li.ui-li-thumbnail-right { + .ui-btn-inner a { + padding-right : 104 * @unit_base; + } +} +.ui-li.ui-li-static.ui-li-has-right-circle-btn { + padding-right : 96 * @unit_base; +} + +.ui-li.ui-li-static.ui-li-has-right-btn { + padding-right : 256 * @unit_base; +} + +.ui-li.ui-li-static.ui-li-thumbnail-right { + padding-right : 104 * @unit_base; +} + +.ui-li-has-icon { + .ui-btn-inner a.ui-link-inherit, + &.ui-li-static { + min-height: 20px; + padding-left: 40px; + } + .ui-li-text-sub { + padding-left: 40px; + } +} + +.ui-li-heading { + font-size: 16px; + font-weight: bold; + display: block; + margin: .6em 0; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; +} + +.ui-li-thumb, +.ui-li-icon { + position: absolute; + left: 1px; + top: 0; + max-height: @list-bigicon-size2; + max-width: @list-bigicon-size2; +} + +.ui-listview * .ui-btn-inner > .ui-btn > .ui-btn-inner { + border-top: 0px; +} + +.ui-li-sub, +.ui-li-sub-setting { + float: right; + text-align: right; + font-size: @font_size_list_sub_text; + margin: .3em 0; +} + +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +/* ~~~~~~~~~~~~~~ NEW LIST STYLE ~~~~~~~~~ */ +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +.ui-li-text-sub { + float: right; + text-align: right; + font-size: @font_size_list_sub_text; + color: @color_list_sub_text_default; + + position : absolute; + right : 16 * @unit_base; + top : 16 * @unit_base; + + overflow:hidden; + white-space : nowrap; + text-overflow : ellipsis; + width : 95%; + + > img { + position : relative; + width: @list-smallicon-size; + height: @list-smallicon-size; + margin: 0 @list-li-padding-horizontal 0 @list-li-padding-horizontal; + } +} + +.ui-li-text-sub2 { + float: right; + text-align: right; + font-size: @font_size_list_sub_text; + color: @color_list_sub_text_default; + + position : absolute; + right : 16 * @unit_base; + top : 16 * @unit_base; + + overflow:hidden; + white-space : nowrap; + text-overflow : ellipsis; + width : 60%; + + > img { + width: @list-smallicon-size; + height: @list-smallicon-size; + margin: 0 0 0 @list-li-padding-horizontal; + } +} +/* +li:not(.ui-li-has-multiline) .ui-li-text-sub { + position : absolute; + right : 16 * @unit_base; + top: 22 * @unit_base; + margin-top: 0px; +}*/ +.ui-li-has-multiline .ui-li-text-sub { + position : absolute; + + text-align: left; + right : auto; + left : 16 * @unit_base; + top: 70 * @unit_base; + margin-top: 0px; + + overflow:hidden; + white-space : nowrap; + text-overflow : ellipsis; + + /* ellipsis for multiline list */ + width : 90%; +} + +.ui-li-icon-sub-right, +.ui-li-icon-sub { + position: absolute; + left: auto; + width: @list-smallicon-size; + height: @list-smallicon-size; + margin: 0 0; +} +.ui-li-icon-sub-right { + right : 16 * @unit_base; +} + + + +// ========= +// Dialogue +// ========= +.ui-listview { + &> li.ui-li-dialogue { + margin-left: @style_list_li_dialogue_margin_left; + margin-right : @style_list_li_dialogue_margin_left; + border-left: @style_list_li_dialogue_border_left_width @color_dialogue_editor_border solid; + //margin-left: @style_list_li_dialogue_margin_left; + border-top-width: 0px; + + .LESSdialogue-border-style; + } + + &> 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 { + &:not(.ui-li-expanded){ + background : @color_list_dialogue_bg; + } + } + &> li.ui-li-dialogue.ui-li-expanded { + padding-left : 44 * @unit_base; + min-height : 52 * @unit_base; + } + + + &> li.ui-li-dialogue.ui-li-divider { + height: 32 * @unit_base; + padding : 0px; + } + + &> li.ui-li-group-title { + padding-top : 32 * @unit_base; + } + + &> li.ui-li-group-title span { + padding-left : 16 * @unit_base; + } + &> li.ui-li-dialogue-divider { + .LESSdialogue-divider; + } +} + +// ========= +// bubble li +// ========= +.ui-listview { + .ui-li-bubble-left, + .ui-li-bubble-right, + .ui-li-bubble-sos { + img { + position: relative; + min-width: 160 * @unit_base; + min-height: 160 * @unit_base; + } + } + .ui-li-bubble-left { + word-wrap: break-word; + .LESSborder-radius-topright(@list-li-bubble-corner-radius); + .LESSborder-radius-bottomright(@list-li-bubble-corner-radius); + font-size: @list-li-bubble-font-size; + p, span { + font-size: @list-li-bubble-font-size; + } + //margin: 12px 20% 12px 0%; + margin-top: 12 * @unit_base; + margin-bottom: 12 * @unit_base; + margin-left: 0; + margin-right: auto; + max-width: 80%; + min-width: 30%; + padding: 16px 22px 16px 16px; + } + .ui-li-bubble-right { + word-wrap: break-word; + .LESSborder-radius-topleft(@list-li-bubble-corner-radius); + .LESSborder-radius-bottomleft(@list-li-bubble-corner-radius); + margin: 12px 0% 12px 20%; + padding: 16px 16px 16px 22px; + } + .ui-li-bubble-sos { + } + .ui-li-bubble-date { + height: 40 * @unit_base; + font-size: @list-li-bubble-date-font-size; + margin: 12px 0%; // no horizontal margin + padding: 0% 16px; + padding-top: 15px; + text-align: @style_list_bubble_date_text_align; + } + span.ui-li-bubble-time { + margin-left: 12px; + font-size: @list-li-bubble-time-font-size; + display: inline-block; + } +} + +// Expandable list animation + +@-webkit-keyframes ui-expand-show { + from { + -webkit-transform-origin: 0% 0%; + -webkit-transform: rotateX(90deg) skewX(30deg) translateZ(0); + } to { + -webkit-transform-origin: 0% 0%; + -webkit-transform: rotateX(0deg) skewX(0deg) translateZ(0); + } +} +.ui-listview { + .ui-li-expandable { + } + .ui-li-expandable-shown { + // Down arrow + .LESSimg-expanded-icon; + } + .ui-li-expandable-hidden { + // Right arrow + .LESSimg-expand-icon; + } + .ui-li-expanded { + overflow: hidden; + } + .ui-li-expand-transition-show { + visibility: visible; + -webkit-animation: ui-expand-show 0.4s 1 ease-out; + } + .ui-li-expand-transition-hide { + visibility: hidden; + height: 0px !important; + min-height: 0px !important; + padding-top: 0px; + padding-bottom: 0px; + border: 0px; + -webkit-transition: all 0.2s ease; + -moz-transition: all 0.2s ease; + -o-transition: all 0.2s ease; + transition: all 0.2s ease; + } +} + + +.LESSimg-expand-icon(@right:@list-li-padding-horizontal, @size:@list-bigicon-size) { + .ui-li-expand-icon { + background-image: url(images/00_button_expand_closed.png); + background-size: 100%; + position: absolute; + top: 50%; + width: 64 * @unit_base; + height: 64 * @unit_base; + margin-top: -(@size/2); + right: 16 * @unit_base; + } +} + +.LESSimg-expanded-icon(@right:@list-li-padding-horizontal, @size:@list-bigicon-size) { + .ui-li-expanded-icon { + background-image: url(images/00_button_expand_opened.png); + background-size: 100%; + position: absolute; + top: 50%; + width: 64 * @unit_base; + height: 64 * @unit_base; + margin-top: -(@size/2); + right: 16 * @unit_base; + } +} diff --git a/src/themes/tizen/common/jquery.mobile.navbar.css b/src/themes/tizen/common/jquery.mobile.navbar.css new file mode 100644 index 0000000..83f5208 --- /dev/null +++ b/src/themes/tizen/common/jquery.mobile.navbar.css @@ -0,0 +1,26 @@ +/* +* jQuery Mobile Framework +* Copyright (c) jQuery Project +* Dual licensed under the MIT (MIT-LICENSE.txt) or GPL (GPL-LICENSE.txt) licenses. +*/ +.ui-navbar { overflow: hidden; } +.ui-navbar ul, .ui-navbar-expanded ul { list-style:none; padding: 0; margin: 0; position: relative; display: block; border: 0;} +.ui-navbar-collapsed ul { float: left; width: 75%; margin-right: -2px; } +.ui-navbar-collapsed .ui-navbar-toggle { float: left; width: 25%; } +.ui-navbar li.ui-navbar-truncate { position: absolute; left: -9999px; top: -9999px; } +.ui-navbar li .ui-btn, .ui-navbar .ui-navbar-toggle .ui-btn { display: block; font-size: 12px; text-align: center; margin: 0; border-right-width: 0; } +.ui-navbar li .ui-btn { margin-right: -1px; } +.ui-navbar li .ui-btn:last-child { margin-right: 0; } +.ui-header .ui-navbar li .ui-btn, .ui-header .ui-navbar .ui-navbar-toggle .ui-btn, +.ui-footer .ui-navbar li .ui-btn, .ui-footer .ui-navbar .ui-navbar-toggle .ui-btn { border-top-width: 0; border-bottom-width: 0; } +.ui-navbar .ui-btn-inner { padding-left: 2px; padding-right: 2px; } +.ui-navbar-noicons li .ui-btn .ui-btn-inner, .ui-navbar-noicons .ui-navbar-toggle .ui-btn-inner { padding-top: .8em; padding-bottom: .9em; } +/*expanded page styles*/ +.ui-navbar-expanded .ui-btn { margin: 0; font-size: 14px; } +.ui-navbar-expanded .ui-btn-inner { padding-left: 5px; padding-right: 5px; } +.ui-navbar-expanded .ui-btn-icon-top .ui-btn-inner { padding: 45px 5px 15px; text-align: center; } +.ui-navbar-expanded .ui-btn-icon-top .ui-icon { top: 15px; } +.ui-navbar-expanded .ui-btn-icon-bottom .ui-btn-inner { padding: 15px 5px 45px; text-align: center; } +.ui-navbar-expanded .ui-btn-icon-bottom .ui-icon { bottom: 15px; } +.ui-navbar-expanded li .ui-btn .ui-btn-inner { min-height: 2.5em; } +.ui-navbar-expanded .ui-navbar-noicons .ui-btn .ui-btn-inner { padding-top: 1.8em; padding-bottom: 1.9em; } diff --git a/src/themes/tizen/common/jquery.mobile.segmentctrl.less b/src/themes/tizen/common/jquery.mobile.segmentctrl.less new file mode 100755 index 0000000..b2516a8 --- /dev/null +++ b/src/themes/tizen/common/jquery.mobile.segmentctrl.less @@ -0,0 +1,31 @@ +@import "config.less"; + +.ui-controlgroup .ui-radio-on, +.ui-controlgroup .ui-radio-off.ui-btn-hover-s.ui-btn-down-s { + background : @color_segmentcontrol_btn_normal; +} +.ui-controlgroup .ui-radio-off { + background: @color_segmentcontrol_btn_press; +} + +.ui-controlgroup .ui-btn-inner .ui-corner-left .ui-controlgroup-first { +-moz-border-radius: .3em ; +-webkit-border-radius: .3em ; +border-radius: .3em ; +} + +.ui-controlgroup .ui-btn-inner .ui-corner-right .ui-controlgroup-last { +-moz-border-radius: .3em ; +-webkit-border-radius: .3em ; +border-radius: .3em ; +} + +.ui-controlgroup .ui-radio-off.ui-btn-hover-s.ui-btn-down-s .ui-btn-inner, +.ui-controlgroup .ui-radio-on .ui-btn-inner { + color: @color_segmentcontrol_Seg_text_pressed; +} + +.ui-controlgroup .ui-radio-off .ui-btn-inner{ + color: @color_segmentcontrol_Seg_text; +} + diff --git a/src/themes/tizen/common/jquery.mobile.theme.less b/src/themes/tizen/common/jquery.mobile.theme.less new file mode 100755 index 0000000..d01bda5 --- /dev/null +++ b/src/themes/tizen/common/jquery.mobile.theme.less @@ -0,0 +1,1516 @@ +/*! +* jQuery Mobile Framework +* Copyright (c) jQuery Project +* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. +*/ + +@import "config.less"; +/* Swatches */ + +/* S +-----------------------------------------------------------------------------------------------------------*/ + +/*************************************************************************** + Header / Footer + NavigationBar +***************************************************************************/ +.ui-bar-s { + border: none; + background: @color_bar_bg; + color: @color_bar_title_text; + font-family: Helvetica, Arial, sans-serif; + font-weight: bold; + font-size : 36 * @unit_base; + + .ui-link-inherit { + color: @color_bar_title_text; + } + + .ui-btn.ui-btn-back.ui-btn-down-s { + .ui-btn-inner { + background : @color_bar_back_btn_press; + } + } + + > .ui-btn.ui-btn-footer-right{ + position : absolute; + font-size : 32 * @unit_base; + + width : 104 * @unit_base; + height : 74 * @unit_base; + top : 20 * @unit_base; + + border-style : none; + border-width : 0px; + } + + > .ui-btn.ui-btn-back { + position : absolute; + font-size : 32 * @unit_base; + border-style : none; + border-width : 0px; + .LESSbtn-back; + } + + > .ui-btn.ui-btn-footer-right { + left : 10 * @unit_base; + } + + .ui-btn.ui-btn-footer-right .ui-btn-inner { + padding : 0; + + width : 104 * @unit_base; + height : 74 * @unit_base; + } + + .ui-btn.ui-btn-back .ui-btn-inner { + padding : 0; + + .LESSbtn-back-inner; + } + + + + .ui-btn.ui-btn-footer-right.ui-btn-down-s{ + .ui-btn-inner { + background : @color_bar_btn_press; + } + } + .ui-btn.ui-btn-footer-right{ + .ui-btn-inner { + .ui-btn-text { + line-height : 74 * @unit_base; + } + } + } + + .ui-field-contain { + margin-left : auto; + margin-right : auto; + height : 74 * @unit_base; + + font-size : 28 * @unit_base; + + .ui-extended-controlgroup { + position : absolute; + display : inline; + + margin-top : 0 * @unit_base; + margin-bottom : 0 * @unit_base; + + label { + .LESSextended-controlgroup-border; + } + + .ui-radio { + height : 74 * @unit_base; + .ui-btn { + width : 100%; + } + + .ui-btn-inner { + .ui-btn-text { + text-align : center; + font-weight : bold; + } + } + + .ui-radio-off { + background: @color_bar_seg_btn_normal; + .ui-btn-text{ + color : @color_bar_seg_text_normal; + } + } + .ui-radio-on, + .ui-radio-off.ui-btn-hover-s.ui-btn-down-s{ + background : @color_bar_seg_btn_press; + .ui-btn-text{ + color : @color_bar_seg_text_press; + } + } + } + } + .ui-title-extended-controlgroup { + top : 5 * @unit_base; // scale change + } + .ui-footer-extended-controlgroup { + .ui-btn-inner { + line-height : 74 * @unit_base; + padding : 0 * @unit_base; + } + } + } + + .ui-title-extended-controlgroup-4btn { + width : @style-title-extended-4btn-width; + .ui-radio { + width : @style-title-extended-4btn-radio-width; + } + } + .ui-title-extended-controlgroup-3btn { + width : @style-title-extended-3btn-width; + .ui-radio { + width : @style-title-extended-3btn-radio-width; + } + } + .ui-title-extended-controlgroup-2btn { + width : @style-title-extended-2btn-width; + .ui-radio { + width : @style-title-extended-2btn-radio-width; + } + } + + .ui-footer-extended-controlgroup-4btn { + width : 682 * @unit_base; + .ui-radio { + width : 170 * @unit_base; + } + } + .ui-footer-extended-controlgroup-3btn { + width : 432 * @unit_base; + .ui-radio { + width : 143 * @unit_base; + } + } + .ui-footer-extended-controlgroup-2btn { + width : 328 * @unit_base; + .ui-radio { + width : 163 * @unit_base; + } + } +} + +.ui-header.ui-bar-s{ + position : fixed; + top : 0px; + background : @color_bar_title_bg; + + min-height : 100 * @unit_base; + + img { + display: inline-block; + height: 32 * @unit_base; + width: 32 * @unit_base; + margin-left: 16 * @unit_base; + //margin-right: 16 * @unit_base; /* Title's left margin covers this. */ + //vertical-align: middle; + } + + .ui-title { + display: inline-block; + color : @color_bar_title_text; + min-height: @style-title-min-height; + font-size : @style-title-font-size; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + outline: 0 !important; + + .LESStitle-diff-style; /* different title style */ + } + + .ui-btn{ + font-size : 28 * @unit_base; + height : 74 * @unit_base; + } + + .ui-btn.ui-btn-left, + .ui-btn.ui-btn-right { + width : 114 * @unit_base; + } + + > .ui-btn{ + position : absolute; + top : 20 * @unit_base; + margin-top : 0px; + font-size : 28 * @unit_base; + height : 60 * @unit_base; + + background: none; + color : @color_bar_title_text; + + + border-left-style: solid; + border-left-width : 1px; + border-left-color : @color_bar_title_btn_border; + + font-weight : bold; + -webkit-border-radius : 0px; + + span.ui-btn-inner { + padding-top : 13 * @unit_base; + padding-bottom : 13 * @unit_base; + } + span.ui-btn-inner.ui-btn-icon-only { + padding-top : 0 * @unit_base; + padding-bottom : 0 * @unit_base; + } + } + + > .ui-btn.ui-btn-right:nth-child(2) { + right : 0px; + } + + > .ui-btn.ui-btn-right:nth-child(3) { + right : 118 * @unit_base; + } + + > .ui-btn.ui-btn-right:nth-child(4) { + right : 236 * @unit_base; + } + + > .ui-btn.ui-btn-down-s { + background : @color_bar_btn_press; + color : @color_bar_title_text; + } + + > img + h1 + a.ui-btn.ui-btn-right:nth-child(3) { + right : 0px; + } + + > img + h1 + a.ui-btn.ui-btn-right:nth-child(4) { + right : 118 * @unit_base; + } + + > img + h1 + a.ui-btn.ui-btn-right:nth-child(5) { + right : 236 * @unit_base; + } +} + +.ui-header.ui-bar-s.ui-title-extended-height { + height : 136 * @unit_base; + + a { + top : 50 * @unit_base; + } + + .ui-title { + font-size : 28 * @unit_base; + top : 0 * @unit_base; + + padding-top : 11 * @unit_base; + margin-top : 0 * @unit_base; + margin-bottom : 0 * @unit_base; + } + + .ui-title-extended-segment-style { + left : 0 * @unit_base; + margin-top : 0 * @unit_base; + top : @style-title-extended-margin; // scale change + } +} + +.ui-header.ui-bar-s .ui-btn.ui-btn-back .ui-btn-inner { + border-style : none; + border-width : 0px; +} + +.ui-header.ui-bar-s.ui-title-controlbar-height, +.ui-footer.ui-bar-s { + height : 114 * @unit_base; +} + +.ui-footer.ui-bar-s.ui-footer-fixed { + background : @color_bar_footer_bg; + + height : 114 * @unit_base; + .ui-title{ + font-size : 32 * @unit_base; + } +} +.ui-footer.ui-bar-s .ui-title-extended-controlgroup-4btn { + margin-top : 20 * @unit_base; +} + +.ui-footer.ui-bar-s { + > .ui-btn { + background-color : @color_bar_btn_bg; + .LESSback-btn-background; + } + + > .ui-btn.ui-btn-down-s { + .ui-btn-inner { + background : @color_bar_back_btn_press; + } + } + + > .ui-btn-back { + background-color : @color_bar_back_btn_bg; + .LESSback-btn-background; + } +} + +/*************************************************************************** + Header / Footer + NavigationBar +***************************************************************************/ +/*************************************************************************** + Content Top calculate +***************************************************************************/ +.ui-title-content-normal-height, +.ui-title-content-option-header-collapsed-1line-height { + position : relative; + top : 100 * @unit_base; +} + +.ui-title-content-no-height { + position : relative; + top : 0 * @unit_base; +} + +.ui-title-content-extended-height { + position : relative; + top : 136 * @unit_base; +} + +.ui-title-content-option-header-expanded-1line-height { + position : relative; + top : 195 * @unit_base; +} + +.ui-title-content-search { + position : relative; + top : 206 * @unit_base; +} + +.ui-title-content-optionheader-search { + position : relative; + top : 219 * @unit_base; +} + +.ui-title-content-controlbar-height { + position : relative; + top : 115 * @unit_base; +} +/*************************************************************************** + Content Top calculate +***************************************************************************/ + +// NOTE: This class is applied to almost all JQM widgets! +.ui-body-s { + border: 1px solid #2a2a2a; + background: @color_bg; + color: @color_text; + font-weight: normal; + + font-family: Helvetica, Arial, sans-serif; + + .ui-link-inherit { color: #fff; } + .ui-link { + /* ui-body-link */ + color: #2489CE; + font-weight: bold; + &:hover { color: #2489CE; } + &:active { color: #2489CE; } + &:visited { color: #2489CE; } + } +} + +.ui-br { +} +.ui-btn-up-s { + font-weight: bold; + a.ui-link-inherit { + color: @color_button_text_normal; + } + .LESSbutton_up_style; + .LESSbutton_text1_style; +} +.ui-btn-hover-s { + font-weight: bold; + a.ui-link-inherit { + color: @color_button_text_normal; + } + .LESSbutton_hover_style; + .LESSbutton_text1_style; +} + +.ui-btn-hover-s.ui-btn-corner-circle{ + .LESScirclebutton_hover_style; +} + +.ui-btn-down-s { + font-weight: bold; + a.ui-link-inherit { + color: @color_button_text_normal; + } + .LESSbutton_down_style; + .LESSbutton_text1_style; +} +.ui-btn-up-s, +.ui-btn-hover-s, +.ui-btn-down-s { + font-family: Helvetica, Arial, sans-serif; + text-decoration: none; +} + +.ui-btn-down-s.ui-btn-corner-circle{ + .LESScirclebutton_press_style; +} + +.ui-listview { + border-top-color: @color_list_border_bottom; + &> .ui-li { + border-bottom-color: @color_list_border_bottom; + } + & > .ui-li-static { + background-color: @color_bg; + } + li.ui-btn-up-s, li.ui-btn-hover-s { + background: none; + background-color: @color_bg; + color: @color_text; + } + li.ui-btn-down-s { + background: none; + background-color: @color_list_press; + color: @color_text; + } + /* listview: fonts for li with a link */ + li.ui-btn-up-s > .ui-li > .ui-btn-text > a.ui-link-inherit, + li.ui-btn-hover-s > .ui-li > .ui-btn-text > a.ui-link-inherit, + li.ui-btn-down-s > .ui-li > .ui-btn-text > a.ui-link-inherit { + color: @color_text; + } + /* listview divider */ + /* NOTE: this divider has no swatch tag! */ + li.ui-li-divider { + background: @color_list_divider_bg; + color: @color_list_divider_text; + } + /* subitem */ + .ui-li-sub { color: @color_text_sub; } + .ui-li-sub-setting { color: @color_text_setting; } + + // expandable list + .ui-li-expandable { + + } + &> .ui-li-expanded { + background-color: @color_list_expandable_expanded_bg; + } + &> .ui-li-expanded .ui-li-expanded { // 3rd~ more depth + background-color: @color_list_expandable_expanded_bg; + } + + // bubble + .ui-li-static { + &.ui-li-bubble-left { + // Color is picked from 00_MessageBubble_BG_receive.png + background-color: @color_list_bubble_left_bg; + .LESSbox-shadow(2px, 3px, 3px, @color_list_bubble_box_shadow); + color: @color_list_bubble_left_text; + } + &.ui-li-bubble-right { + // Color is picked from 00_MessageBubble_BG_sent.png + background-color: @color_list_bubble_right_bg; + .LESSbox-shadow(2px, 3px, 3px, @color_list_bubble_box_shadow); + color: @color_list_bubble_right_text; + } + &.ui-li-bubble-sos { + color: @color_list_bubble_sos_text; + } + &.ui-li-bubble-date { + background-color: @color_list_bubble_date_bg; + color: @color_list_bubble_date_text; + } + } + span.ui-li-bubble-time { + color: @color_list_bubble_time_text; + } +} + +/* Structure */ +/* links within "buttons" +-----------------------------------------------------------------------------------------------------------*/ + +a.ui-link-inherit { + text-decoration: none !important; +} + + +/* Active class used as the "on" state across all themes +-----------------------------------------------------------------------------------------------------------*/ + +/* button default color for active state */ +.ui-btn-active { + /* global-active */ + color: @color_button_text_normal; + cursor: pointer; + text-decoration: none; + background: @color_button_press; + outline: none; + //font-family: Helvetica, Arial, sans-serif; + + a.ui-link-inherit { + color: @color_button_text_normal; + } +} + +/* button inner top highlight +-----------------------------------------------------------------------------------------------------------*/ + +.ui-btn-inner { + //border : none; +} + +/*************************************************************************** + ControlBar +***************************************************************************/ +.ui-controlbar-s, .ui-controlbar-left, .ui-controlbar-right { + border: 1px solid @color_controlbar_btn_border; + background: @color_controlbar_bg; + color: @color_controlbar_btn_text; + font-family: Helvetica, Arial, sans-serif; + font-weight: bold; + font-size : 36 * @unit_base; + + .ui-link-inherit, .ui-link { + color: @color_controlbar_btn_text; + font-weight: bold; + &:hover { color: @color_controlbar_btn_text; } + &:active { color: @color_controlbar_btn_text; } + &:visited { color: @color_controlbar_btn_text; } + } + + .ui-btn-text, .ui-btn { + color: @color_controlbar_btn_text; + font-weight: bold; + text-decoration : none; + } + + .ui-btn-down-s, .ui-btn-active { + color: @color_controlbar_btn_text; + } +} + +.ui-controlbar-s.ui-navbar { + position : absolute; + + height : 114 * @unit_base; /* temporary value */ + width : 100%; + left : 0px; + + border-top : none; + border-bottom : none; + + z-index: 50; + + li .ui-btn, .ui-navbar-toggle .ui-btn{ + font-size : 26 * @unit_base; + } + + .ui-btn , .ui-btn-icon-top, .ui-btn-hover-s, .ui-btn-active, .ui-btn-up-s{ + .ui-btn-inner{ + padding-top : 79 * @unit_base; + } + } + .ui-btn { + .ui-icon { + left : 50%; + top : 12 * @unit_base; + margin-left : -1.3em; + + width : 56 * @unit_base; + height: 56 * @unit_base; + } + .ui-btn-text { + padding-left : 0px; + } + } + .ui-btn.ui-ctrlbar-icononly { + padding-top : 20 * @unit_base; + } + .ui-btn-inner { + z-index : 200; + } + .ui-btn-inner.ui-navbar-textonly { + font-size : 28 * @unit_base; + + padding-top : 44 * @unit_base; + padding-bottom : 45 * @unit_base; + } +} + +.ui-landscape-controlbar.ui-controlbar-s.ui-navbar { + .ui-btn { + .ui-icon { + left : 20%; + top : 30 * @unit_base; + margin-left : -1.3em; + } + + .ui-btn-text { + padding-left : 35%; + } + + .ui-navbar-textonly .ui-btn-text { + padding-left : 0px; + } + } + + .ui-ctrlbar-icononly.ui-btn { + padding-top : 0px; + + .ui-icon { + left : 50%; + top : 30 * @unit_base; + margin-left : -29 * @unit_base; + } + } + + .ui-btn , .ui-btn-icon-top, .ui-btn-hover-s, .ui-btn-active, .ui-btn-up-s{ + .ui-btn-inner:not(.ui-btn-icon-only) { + padding-top : 40 * @unit_base; + padding-bottom : 39 * @unit_base; + } + } +} + +.ui-tabbar-s { + .ui-btn { + background: @color_controlbar_tabbbar_bg; + } + + .ui-btn-active, .ui-btn-show-style, + .ui-btn.ui-btn-hover-s.ui-btn-down-s { + background: @color_controlbar_btn_press; + border-left-style: solid; + border-right-style:solid; + border-left-color: @color_controlbar_btn_border; + border-right-color: @color_controlbar_btn_border; + border-left-width: 1px; + border-right-width: 1px; + } + + .ui-btn-animation { + background: @color_controlbar_btn_press; + border-left-style: solid; + border-right-style: solid; + border-left-color: @color_controlbar_btn_border; + border-right-color: @color_controlbar_btn_border; + border-left-width: 1px; + border-right-width: 1px; + position : absolute; + top : 0px; + height : 123 * @unit_base; + z-index : 100; + } + + .ui-btn-hide-style { + background: @color_bar_footer_bg; + border : none; + } +} + +.ui-toolbar-s { + .ui-btn, .ui-btn-up-s { + background: @color_controlbar_toolbbar_bg; + + border-left-width : 1px; + border-right-width : 1px; + border-color : @color_controlbar_btn_border; + border-style : solid; + } + + .ui-btn-down-s { + background : @color_controlbar_btn_press; + } +} + +.ui-header .ui-navbar.ui-tabbar-s, +.ui-header .ui-navbar.ui-toolbar-s { + a { + width : 100%; + height : 100%; + } +} + +.ui-controlbar-left.ui-navbar, .ui-controlbar-right.ui-navbar { + position : fixed; + z-index: 50; + + li .ui-btn, .ui-navbar-toggle .ui-btn{ + font-size : 20 * @unit_base; + } + .ui-btn { + width : 100%; + margin :0px 0em; + + background: @color_controlbar_bg; + } + + .ui-btn-down-s, .ui-btn-active{ + color: @color_controlbar_btn_text; + } + + li .ui-btn, .ui-navbar-toggle .ui-btn{ + font-size : 20 * @unit_base; + } + + .ui-btn-inner { + z-index : 200; + + padding-top : 126 * @unit_base; + .ui-icon { + left : 23%; + top : 35 * @unit_base; + width : 70 * @unit_base; + height: 70 * @unit_base; + } + .ui-btn-text.ui-btn-text-padding-left { + padding-left : 0px; + } + } + + .ui-btn-animation { + position : fixed; + + background: @color_controlbar_bg; + border-bottom-style: solid; + border-top-style: solid; + border-bottom-color: @color_controlbar_btn_border; + border-top-color: @color_controlbar_btn_border; + border-bottom-width: 1px; + border-top-width: 1px; + + z-index : 100; + } +} + +.ui-controlbar-left { + left : 0px; + float : left; +} + +.ui-controlbar-right { + right : 0px; + float :right; +} + +.ui-btn-ani-startposition { +} + +.ui-btn-ani-endposition { + -webkit-transition-property : left; + -webkit-transition: all 0.3s ease-in-out; +} + +.ui-btn-ani-verticalstartposition { +} + +.ui-btn-ani-verticalendposition { + -webkit-transition-property : top; + -webkit-transition: all 0.3s ease-in-out; +} +/*************************************************************************** + ControlBar +***************************************************************************/ + + +/* corner rounding classes +-----------------------------------------------------------------------------------------------------------*/ + +.ui-corner-tl { + .LESSborder-radius-topleft(@style-corner-radius); +} +.ui-corner-tr { + .LESSborder-radius-topright(@style-corner-radius); +} +.ui-corner-bl { + .LESSborder-radius-bottomleft(@style-corner-radius); +} +.ui-corner-br { + .LESSborder-radius-bottomright(@style-corner-radius); +} +.ui-corner-top { + .LESSborder-radius-topleft(@style-corner-radius); + .LESSborder-radius-topright(@style-corner-radius); +} +.ui-corner-bottom { + .LESSborder-radius-bottomleft(@style-corner-radius); + .LESSborder-radius-bottomright(@style-corner-radius); +} +.ui-corner-right { + .LESSborder-radius-topright(@style-corner-radius); + .LESSborder-radius-bottomright(@style-corner-radius); +} +.ui-corner-left { + .LESSborder-radius-topleft(@style-corner-radius); + .LESSborder-radius-bottomleft(@style-corner-radius); +} +.ui-corner-all { + //.LESSborder-radius-all(@style-corner-radius); +} +.ui-corner-none { + .LESSborder-radius-all(0); +} + +/* Interaction cues +-----------------------------------------------------------------------------------------------------------*/ +.ui-disabled { + opacity: .3; +} +.ui-disabled, +.ui-disabled a { + cursor: default; +} + +/* Icons +-----------------------------------------------------------------------------------------------------------*/ + +.ui-icon { + /* global-icon */ + background-image: url(images/icons-18-white.png); + background-repeat: no-repeat; + // no radius for checkbox + //.LESSborder-radius-all(9px); +} + +.ui-image-search { + background-image: url(images/00_search_icon.png); + background-repeat: no-repeat; + .LESSbackground-size(42 * @unit_base, 42 * @unit_base); +} + +.ui-icon-deleteSearch { + background-image: url(images/00_field_btn_Clear.png); + background-repeat: no-repeat; + .LESSbackground-size(38 * @unit_base, 38 * @unit_base); +} + + +/* Alt icon color +-----------------------------------------------------------------------------------------------------------*/ + +.ui-icon-alt { + background: #fff; + background: rgba(255,255,255,.3); + background-image: url(images/icons-18-black.png); + background-repeat: no-repeat; +} + +/* HD/"retina" sprite +-----------------------------------------------------------------------------------------------------------*/ + +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (min--moz-device-pixel-ratio: 1.5), + only screen and (min-resolution: 240dpi) { + + .ui-icon-plus, .ui-icon-minus, .ui-icon-delete, .ui-icon-arrow-r, + .ui-icon-arrow-l, .ui-icon-arrow-u, .ui-icon-arrow-d, .ui-icon-check, + .ui-icon-gear, .ui-icon-refresh, .ui-icon-forward, .ui-icon-back, + .ui-icon-grid, .ui-icon-star, .ui-icon-alert, .ui-icon-info, .ui-icon-home, .ui-icon-search, .ui-icon-searchfield:after, + .ui-icon-checkbox-off, .ui-icon-checkbox-on, .ui-icon-radio-off, .ui-icon-radio-on { + background-image: url(images/icons-36-white.png); + .LESSbackground-size(776px, 18px); + } + .ui-icon-alt { + background-image: url(images/icons-36-black.png); + } +} + +/* plus minus */ +.ui-icon-plus { + background-position: -0 50%; +} +.ui-icon-minus { + /*background-position: -36px 50%;*/ /* wongi_1018: Same name make problem. Later, origianl icons will be removed. */ +} + +/* arrows */ +.ui-icon-arrow-r { + background-position: -108px 50%; +} +.ui-icon-arrow-l { + background-position: -144px 50%; +} +.ui-icon-arrow-u { + background-position: -180px 50%; +} +.ui-icon-arrow-d { + background-position: -216px 50%; +} + +/* misc */ +.ui-icon-check { + background-position: -252px 50%; +} +.ui-icon-gear { + background-position: -288px 50%; +} +.ui-icon-refresh { + background-position: -324px 50%; +} +.ui-icon-forward { + background-position: -360px 50%; +} +.ui-icon-back { + background-position: -396px 50%; +} +.ui-icon-grid { + background-position: -432px 50%; +} +.ui-icon-star { + background-position: -468px 50%; +} +.ui-icon-alert { + background-position: -504px 50%; +} +.ui-icon-info { + background-position: -540px 50%; +} +.ui-icon-home { + background-position: -576px 50%; +} + +/* checks,radios */ +.ui-checkbox .ui-icon { + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; +} +//.ui-icon-checkbox-off, +.ui-icon-radio-off { + background-color: transparent; +} +.ui-checkbox-on .ui-icon, +.ui-radio-on .ui-icon { + /*Do not need bg color for icons.. + background-color: #4596ce;*/ /* NOTE: this hex should match the active state color. It's repeated here for cascade */ +} + +/* loading icon */ +.ui-icon-loading { + background-image: url(images/ajax-loader.png); + width: 40px; + height: 40px; + .LESSborder-radius-all(20px); +} + +/* Add ctrl bar *//* TIZEN Default Footer */ + .ui-icon-ctrlbar-account_sign-up, .ui-icon-ctrlbar-accounts, .ui-icon-ctrlbar-add-to-bookmarks, .ui-icon-ctrlbar-add-to-calendar, .ui-icon-ctrlbar-alarm, + .ui-icon-ctrlbar-albums, .ui-icon-ctrlbar-area, .ui-icon-ctrlbar-artist, .ui-icon-ctrlbar-attach, .ui-icon-ctrlbar-back, + .ui-icon-ctrlbar-backward, .ui-icon-ctrlbar-bluetooth_preview, .ui-icon-ctrlbar-bookmarks, .ui-icon-ctrlbar-brightness, .ui-icon-ctrlbar-calendar, + .ui-icon-ctrlbar-call, .ui-icon-ctrlbar-camera, .ui-icon-ctrlbar-category, .ui-icon-ctrlbar-change_group, .ui-icon-ctrlbar-chat, + .ui-icon-ctrlbar-check, .ui-icon-ctrlbar-compose, .ui-icon-ctrlbar-composer, .ui-icon-ctrlbar-contacts, .ui-icon-ctrlbar-copy, + .ui-icon-ctrlbar-create, .ui-icon-ctrlbar-create_folder, .ui-icon-ctrlbar-delete, .ui-icon-ctrlbar-dialer, .ui-icon-ctrlbar-DM, + .ui-icon-ctrlbar-edit, .ui-icon-ctrlbar-editor, .ui-icon-ctrlbar-eng_eng_result, .ui-icon-ctrlbar-exchangs_register, .ui-icon-ctrlbar-Externalstorage, + .ui-icon-ctrlbar-favorite, .ui-icon-ctrlbar-features, .ui-icon-ctrlbar-forward, .ui-icon-ctrlbar-genre, .ui-icon-ctrlbar-help, + .ui-icon-ctrlbar-home, .ui-icon-ctrlbar-info, .ui-icon-ctrlbar-length, .ui-icon-ctrlbar-list_by, .ui-icon-ctrlbar-logs, + .ui-icon-ctrlbar-map, .ui-icon-ctrlbar-memolist, .ui-icon-ctrlbar-MemoryCard, .ui-icon-ctrlbar-mention, .ui-icon-ctrlbar-menu, + .ui-icon-ctrlbar-more, .ui-icon-ctrlbar-move, .ui-icon-ctrlbar-multiview, .ui-icon-ctrlbar-multiview_02, .ui-icon-ctrlbar-multiview_03, + .ui-icon-ctrlbar-multiview_04, .ui-icon-ctrlbar-multiview_05, .ui-icon-ctrlbar-multiview_06, .ui-icon-ctrlbar-multiview_07, .ui-icon-ctrlbar-multiview_08, + .ui-icon-ctrlbar-multiview_09, .ui-icon-ctrlbar-music_albums, .ui-icon-ctrlbar-pause, .ui-icon-ctrlbar-phone, .ui-icon-ctrlbar-Play, + .ui-icon-ctrlbar-playlists, .ui-icon-ctrlbar-receive, .ui-icon-ctrlbar-reply, .ui-icon-ctrlbar-save, .ui-icon-ctrlbar-save_to_calender, + .ui-icon-ctrlbar-scrap, .ui-icon-ctrlbar-search, .ui-icon-ctrlbar-send, .ui-icon-ctrlbar-set_as, .ui-icon-ctrlbar-settings, + .ui-icon-ctrlbar-setup_wizard_previous, .ui-icon-ctrlbar-share, .ui-icon-ctrlbar-songs, .ui-icon-ctrlbar-stop_watch, .ui-icon-ctrlbar-store, + .ui-icon-ctrlbar-synchronise_start_sync, .ui-icon-ctrlbar-synchronise_stop_01, .ui-icon-ctrlbar-synchronise_stop_02, .ui-icon-ctrlbar-synchronise_stop_03, .ui-icon-ctrlbar-view_result, + .ui-icon-ctrlbar-tag, .ui-icon-ctrlbar-temp, .ui-icon-ctrlbar-timeline, .ui-icon-ctrlbar-timer, .ui-icon-ctrlbar-today, + .ui-icon-ctrlbar-top, .ui-icon-ctrlbar-trim, .ui-icon-ctrlbar-TTS, .ui-icon-ctrlbar-update, .ui-icon-ctrlbar-upload_export, + .ui-icon-ctrlbar-volume, .ui-icon-ctrlbar-world_clock, .ui-icon-ctrlbar-year, .ui-icon-ctrlbar-add_tag, .ui-icon-ctrlbar-add_to_contact, + .ui-icon-ctrlbar-close, .ui-icon-ctrlbar-groups, .ui-icon-ctrlbar-year, .ui-icon-ctrlbar-unread_message, .ui-icon-ctrlbar-weight, + .ui-icon-ctrlbar-3Dview, .ui-icon-ctrlbar-cancel, .ui-icon-ctrlbar-done, .ui-icon-ctrlbar-lock, .ui-icon-ctrlbar-next, + .ui-icon-ctrlbar-previous, .ui-icon-ctrlbar-print, .ui-icon-ctrlbar-Ringtone, .ui-icon-ctrlbar-Save_the_word, .ui-icon-ctrlbar-Save_in_memo, + .ui-icon-ctrlbar-scan, .ui-icon-ctrlbar-unlock, .ui-icon-ctrlbar-videocall, .ui-icon-ctrlbar-Voice_command, .ui-icon-ctrlbar-Add-buddy_to_chat, + .ui-icon-ctrlbar-add_tag, .ui-icon-ctrlbar-Chat, .ui-icon-ctrlbar-view_file_history + { + background-color : transparent; + + -moz-border-radius: 0px; + -webkit-border-radius: 0px; + border-radius: 0px; + background-size: 100% 100%; + + -moz-box-shadow: 0px 0px 0 rgba(255,255,255,.4); + -webkit-box-shadow: 0px 0px 0 rgba(255,255,255,.4); + box-shadow: 0px 0px 0 rgba(255,255,255,.4); + } + + .ui-icon-ctrlbar-account_sign-up { + background-image: url(images/controlbar/01_controlbar_icon_account_sign-up.png); + } + .ui-icon-ctrlbar-accounts { + background-image: url(images/controlbar/01_controlbar_icon_accounts.png); + } + .ui-icon-ctrlbar-add-to-bookmarks { + background-image: url(images/controlbar/01_controlbar_icon_add-to-bookmarks.png); + } + .ui-icon-ctrlbar-add-to-calendar { + background-image: url(images/controlbar/01_controlbar_icon_add-to-calendar.png); + } + .ui-icon-ctrlbar-alarm { + background-image: url(images/controlbar/01_controlbar_icon_alarm.png); + } + .ui-icon-ctrlbar-albums { + background-image: url(images/controlbar/01_controlbar_icon_albums.png); + } + .ui-icon-ctrlbar-area { + background-image: url(images/controlbar/01_controlbar_icon_area.png); + } + .ui-icon-ctrlbar-artist { + background-image: url(images/controlbar/01_controlbar_icon_artist.png); + } + .ui-icon-ctrlbar-attach { + background-image: url(images/controlbar/01_controlbar_icon_attach.png); + } + .ui-icon-ctrlbar-back { + background-image: url(images/controlbar/01_controlbar_icon_back.png); + } + .ui-icon-ctrlbar-backward { + background-image: url(images/controlbar/01_controlbar_icon_backward.png); + } + .ui-icon-ctrlbar-bluetooth_preview { + background-image: url(images/controlbar/01_controlbar_icon_bluetooth_preview.png); + } + .ui-icon-ctrlbar-bookmarks { + background-image: url(images/controlbar/01_controlbar_icon_bookmarks.png); + } + .ui-icon-ctrlbar-brightness { + background-image: url(images/controlbar/01_controlbar_icon_brightness.png); + } + .ui-icon-ctrlbar-calendar { + background-image: url(images/controlbar/01_controlbar_icon_calendar.png); + } + .ui-icon-ctrlbar-call { + background-image: url(images/controlbar/01_controlbar_icon_call.png); + } + .ui-icon-ctrlbar-camera { + background-image: url(images/controlbar/01_controlbar_icon_camera.png); + } + .ui-icon-ctrlbar-category { + background-image: url(images/controlbar/01_controlbar_icon_category.png); + } + .ui-icon-ctrlbar-change_group { + background-image: url(images/controlbar/01_controlbar_icon_change_group.png); + } + .ui-icon-ctrlbar-chat { + background-image: url(images/controlbar/01_controlbar_icon_chat.png); + } + .ui-icon-ctrlbar-check { + background-image: url(images/controlbar/01_controlbar_icon_check.png); + } + .ui-icon-ctrlbar-compose { + background-image: url(images/controlbar/01_controlbar_icon_compose.png); + } + .ui-icon-ctrlbar-composer { + background-image: url(images/controlbar/01_controlbar_icon_composer.png); + } + .ui-icon-ctrlbar-contacts { + background-image: url(images/controlbar/01_controlbar_icon_contacts.png); + } + .ui-icon-ctrlbar-copy { + background-image: url(images/controlbar/01_controlbar_icon_copy.png); + } + .ui-icon-ctrlbar-create { + background-image: url(images/controlbar/01_controlbar_icon_create.png); + } + .ui-icon-ctrlbar-create_folder { + background-image: url(images/controlbar/01_controlbar_icon_create_folder.png); + } + .ui-icon-ctrlbar-delete { + background-image: url(images/controlbar/01_controlbar_icon_delete.png); + } + .ui-icon-ctrlbar-dialer { + background-image: url(images/controlbar/01_controlbar_icon_dialer.png); + } + .ui-icon-ctrlbar-DM { + background-image: url(images/controlbar/01_controlbar_icon_DM.png); + } + .ui-icon-ctrlbar-edit { + background-image: url(images/controlbar/01_controlbar_icon_edit.png); + } + .ui-icon-ctrlbar-editor { + background-image: url(images/controlbar/01_controlbar_icon_editor.png); + } + .ui-icon-ctrlbar-eng_eng_result { + background-image: url(images/controlbar/01_controlbar_icon_eng_eng_result.png); + } + .ui-icon-ctrlbar-exchangs_register { + background-image: url(images/controlbar/01_controlbar_icon_exchangs_register.png); + } + .ui-icon-ctrlbar-Externalstorage { + background-image: url(images/controlbar/01_controlbar_icon_Externalstorage.png); + } + .ui-icon-ctrlbar-favorite { + background-image: url(images/controlbar/01_controlbar_icon_favorite.png); + } + .ui-icon-ctrlbar-features { + background-image: url(images/controlbar/01_controlbar_icon_features.png); + } + .ui-icon-ctrlbar-forward { + background-image: url(images/controlbar/01_controlbar_icon_forward.png); + } + .ui-icon-ctrlbar-genre { + background-image: url(images/controlbar/01_controlbar_icon_genre.png); + } + .ui-icon-ctrlbar-help { + background-image: url(images/controlbar/01_controlbar_icon_help.png); + } + .ui-icon-ctrlbar-home { + background-image: url(images/controlbar/01_controlbar_icon_home.png); + } + .ui-icon-ctrlbar-info { + background-image: url(images/controlbar/01_controlbar_icon_info.png); + } + .ui-icon-ctrlbar-length { + background-image: url(images/controlbar/01_controlbar_icon_length.png); + } + .ui-icon-ctrlbar-list_by { + background-image: url(images/controlbar/01_controlbar_icon_list_by.png); + } + .ui-icon-ctrlbar-logs { + background-image: url(images/controlbar/01_controlbar_icon_logs.png); + } + .ui-icon-ctrlbar-map { + background-image: url(images/controlbar/01_controlbar_icon_map.png); + } + .ui-icon-ctrlbar-memolist { + background-image: url(images/controlbar/01_controlbar_icon_memolist.png); + } + .ui-icon-ctrlbar-MemoryCard { + background-image: url(images/controlbar/01_controlbar_icon_MemoryCard.png); + } + .ui-icon-ctrlbar-mention { + background-image: url(images/controlbar/01_controlbar_icon_mention.png); + } + .ui-icon-ctrlbar-menu { + background-image: url(images/controlbar/01_controlbar_icon_menu.png); + } + .ui-icon-ctrlbar-more { + background-image: url(images/controlbar/01_controlbar_icon_more.png); + } + .ui-icon-ctrlbar-move { + background-image: url(images/controlbar/01_controlbar_icon_move.png); + } + .ui-icon-ctrlbar-multiview { + background-image: url(images/controlbar/01_controlbar_icon_multiview.png); + } + .ui-icon-ctrlbar-multiview_02 { + background-image: url(images/controlbar/01_controlbar_icon_multiview_02.png); + } + .ui-icon-ctrlbar-multiview_03 { + background-image: url(images/controlbar/01_controlbar_icon_multiview_03.png); + } + .ui-icon-ctrlbar-multiview_04 { + background-image: url(images/controlbar/01_controlbar_icon_multiview_04.png); + } + .ui-icon-ctrlbar-multiview_05 { + background-image: url(images/controlbar/01_controlbar_icon_multiview_05.png); + } + .ui-icon-ctrlbar-multiview_06 { + background-image: url(images/controlbar/01_controlbar_icon_multiview_06.png); + } + .ui-icon-ctrlbar-multiview_07 { + background-image: url(images/controlbar/01_controlbar_icon_multiview_07.png); + } + .ui-icon-ctrlbar-multiview_08 { + background-image: url(images/controlbar/01_controlbar_icon_multiview_08.png); + } + .ui-icon-ctrlbar-multiview_09 { + background-image: url(images/controlbar/01_controlbar_icon_multiview_09.png); + } + .ui-icon-ctrlbar-music_albums { + background-image: url(images/controlbar/01_controlbar_icon_music_albums.png); + } + .ui-icon-ctrlbar-pause { + background-image: url(images/controlbar/01_controlbar_icon_pause.png); + } + .ui-icon-ctrlbar-phone { + background-image: url(images/controlbar/01_controlbar_icon_phone.png); + } + .ui-icon-ctrlbar-Play { + background-image: url(images/controlbar/01_controlbar_icon_Play.png); + } + .ui-icon-ctrlbar-playlists { + background-image: url(images/controlbar/01_controlbar_icon_playlists.png); + } + .ui-icon-ctrlbar-receive { + background-image: url(images/controlbar/01_controlbar_icon_receive.png); + } + .ui-icon-ctrlbar-reply { + background-image: url(images/controlbar/01_controlbar_icon_reply.png); + } + .ui-icon-ctrlbar-save { + background-image: url(images/controlbar/01_controlbar_icon_save.png); + } + .ui-icon-ctrlbar-save_to_calender { + background-image: url(images/controlbar/01_controlbar_icon_save_to_calender.png); + } + .ui-icon-ctrlbar-scrap { + background-image: url(images/controlbar/01_controlbar_icon_scrap.png); + } + .ui-icon-ctrlbar-search { + background-image: url(images/controlbar/01_controlbar_icon_search.png); + } + .ui-icon-ctrlbar-send { + background-image: url(images/controlbar/01_controlbar_icon_send.png); + } + .ui-icon-ctrlbar-set_as { + background-image: url(images/controlbar/01_controlbar_icon_set_as.png); + } + .ui-icon-ctrlbar-settings { + background-image: url(images/controlbar/01_controlbar_icon_settings.png); + } + .ui-icon-ctrlbar-setup_wizard_previous { + background-image: url(images/controlbar/01_controlbar_icon_setup_wizard_previous.png); + } + .ui-icon-ctrlbar-share { + background-image: url(images/controlbar/01_controlbar_icon_share.png); + } + .ui-icon-ctrlbar-songs { + background-image: url(images/controlbar/01_controlbar_icon_songs.png); + } + .ui-icon-ctrlbar-stop_watch { + background-image: url(images/controlbar/01_controlbar_icon_stop_watch.png); + } + .ui-icon-ctrlbar-store { + background-image: url(images/controlbar/01_controlbar_icon_store.png); + } + .ui-icon-ctrlbar-synchronise_start_sync { + background-image: url(images/controlbar/01_controlbar_icon_synchronise_start_sync.png); + } + .ui-icon-ctrlbar-synchronise_stop_01 { + background-image: url(images/controlbar/01_controlbar_icon_synchronise_stop_01.png); + } + .ui-icon-ctrlbar-synchronise_stop_02 { + background-image: url(images/controlbar/01_controlbar_icon_synchronise_stop_02.png); + } + .ui-icon-ctrlbar-synchronise_stop_03 { + background-image: url(images/controlbar/01_controlbar_icon_synchronise_stop_03.png); + } + .ui-icon-ctrlbar-synchronise_view_result { + background-image: url(images/controlbar/01_controlbar_icon_synchronise_view_result.png); + } + .ui-icon-ctrlbar-tag { + background-image: url(images/controlbar/01_controlbar_icon_tag.png); + } + .ui-icon-ctrlbar-temp { + background-image: url(images/controlbar/01_controlbar_icon_temp.png); + } + .ui-icon-ctrlbar-timeline { + background-image: url(images/controlbar/01_controlbar_icon_timeline.png); + } + .ui-icon-ctrlbar-timer { + background-image: url(images/controlbar/01_controlbar_icon_timer.png); + } + .ui-icon-ctrlbar-today { + background-image: url(images/controlbar/01_controlbar_icon_today.png); + } + .ui-icon-ctrlbar-top { + background-image: url(images/controlbar/01_controlbar_icon_top.png); + } + .ui-icon-ctrlbar-trim { + background-image: url(images/controlbar/01_controlbar_icon_trim.png); + } + .ui-icon-ctrlbar-TTS { + background-image: url(images/controlbar/01_controlbar_icon_TTS.png); + } + .ui-icon-ctrlbar-update { + background-image: url(images/controlbar/01_controlbar_icon_update.png); + } + .ui-icon-ctrlbar-upload_export { + background-image: url(images/controlbar/01_controlbar_icon_upload_export.png); + } + .ui-icon-ctrlbar-volume { + background-image: url(images/controlbar/01_controlbar_icon_volume.png); + } + .ui-icon-ctrlbar-world_clock { + background-image: url(images/controlbar/01_controlbar_icon_world_clock.png); + } + .ui-icon-ctrlbar-year { + background-image: url(images/controlbar/01_controlbar_icon_year.png); + } + .ui-icon-ctrlbar-add_tag { + background-image: url(images/controlbar/01_controlbar_icon_add_tag.png); + } + .ui-icon-ctrlbar-add_to_contact { + background-image: url(images/controlbar/01_controlbar_icon_add_to_contact.png); + } + .ui-icon-ctrlbar-close { + background-image: url(images/controlbar/01_controlbar_icon_close.png); + } + .ui-icon-ctrlbar-groups { + background-image: url(images/controlbar/01_controlbar_icon_groups.png); + } + .ui-icon-ctrlbar-unread_message { + background-image: url(images/controlbar/01_controlbar_icon_unread_message.png); + } + .ui-icon-ctrlbar-weight { + background-image: url(images/controlbar/01_controlbar_icon_weight.png); + } + .ui-icon-ctrlbar-3Dview { + background-image: url(images/controlbar/01_controlbar_icon_3Dview.png); + } + .ui-icon-ctrlbar-cancel { + background-image: url(images/controlbar/01_controlbar_icon_cancel.png); + } + .ui-icon-ctrlbar-done { + background-image: url(images/controlbar/01_controlbar_icon_done.png); + } + .ui-icon-ctrlbar-lock { + background-image: url(images/controlbar/01_controlbar_icon_lock.png); + } + .ui-icon-ctrlbar-next { + background-image: url(images/controlbar/01_controlbar_icon_next.png); + } + .ui-icon-ctrlbar-previous { + background-image: url(images/controlbar/01_controlbar_icon_previous.png); + } + .ui-icon-ctrlbar-print { + background-image: url(images/controlbar/01_controlbar_icon_print.png); + } + .ui-icon-ctrlbar-Ringtone { + background-image: url(images/controlbar/01_controlbar_icon_Ringtone.png); + } + .ui-icon-ctrlbar-Save_the_word { + background-image: url(images/controlbar/01_controlbar_icon_Save_the_word.png); + } + .ui-icon-ctrlbar-Save_in_memo { + background-image: url(images/controlbar/01_controlbar_icon_Save_in_memo.png); + } + .ui-icon-ctrlbar-scan { + background-image: url(images/controlbar/01_controlbar_icon_scan.png); + } + .ui-icon-ctrlbar-unlock { + background-image: url(images/controlbar/01_controlbar_icon_unlock.png); + } + .ui-icon-ctrlbar-videocall { + background-image: url(images/controlbar/01_controlbar_icon_videocall.png); + } + .ui-icon-ctrlbar-Voice_command { + background-image: url(images/controlbar/01_controlbar_icon_Voice_command.png); + } + .ui-icon-ctrlbar-Add_buddy_to_chat { + background-image: url(images/controlbar/01_controlbar_icon_Add_buddy_to_chat.png); + } + .ui-icon-ctrlbar-add_tag { + background-image: url(images/controlbar/01_controlbar_icon_add_tag.png); + } + .ui-icon-ctrlbar-Chat { + background-image: url(images/controlbar/01_controlbar_icon_Chat.png); + } + .ui-icon-ctrlbar-view_file_history { + background-image: url(images/controlbar/01_controlbar_icon_view_file_history.png); + } +/* ---------------------------------------------- */ + + + + + + + + +/* Button corner classes +-----------------------------------------------------------------------------------------------------------*/ + +.ui-btn-corner-tl { + .LESSborder-radius-topleft(1em); +} +.ui-btn-corner-tr { + .LESSborder-radius-topright(1em); +} +.ui-btn-corner-bl { + .LESSborder-radius-bottomleft(1em); +} +.ui-btn-corner-br { + .LESSborder-radius-bottomright(1em); +} +.ui-btn-corner-top { + .LESSborder-radius-topleft(1em); + .LESSborder-radius-topright(1em); +} +.ui-btn-corner-bottom { + .LESSborder-radius-bottomleft(1em); + .LESSborder-radius-bottomright(1em); +} +.ui-btn-corner-right { + .LESSborder-radius-topright(1em); + .LESSborder-radius-bottomright(1em); +} +.ui-btn-corner-left { + .LESSborder-radius-topleft(1em); + .LESSborder-radius-bottomleft(1em); +} +.ui-btn-corner-all { + .LESSborder-radius-all(0.2em); //wongi_1013 +} + +/* radius clip workaround for cleaning up corner trapping */ +.ui-corner-tl, +.ui-corner-tr, +.ui-corner-bl, +.ui-corner-br, +.ui-corner-top, +.ui-corner-bottom, +.ui-corner-right, +.ui-corner-left, +.ui-corner-all, +.ui-btn-corner-tl, +.ui-btn-corner-tr, +.ui-btn-corner-bl, +.ui-btn-corner-br, +.ui-btn-corner-top, +.ui-btn-corner-bottom, +.ui-btn-corner-right, +.ui-btn-corner-left, +.ui-btn-corner-all { + -webkit-background-clip: padding-box; + -moz-background-clip: padding; + background-clip: padding-box; +} + +/* Overlay / modal +-----------------------------------------------------------------------------------------------------------*/ + +.ui-overlay { + background: #666; + opacity: .5; + filter: Alpha(Opacity=50); + position: absolute; + width: 100%; + height: 100%; +} +.ui-overlay-shadow { + //.LESSbox-shadow(0px, 0px, 12px, rgba(0,0,0,.6)); +} +.ui-shadow { + //.LESSbox-shadow(0px, 1px, 4px, rgba(0,0,0,.3)); +} +.ui-bar-a .ui-shadow, +.ui-bar-b .ui-shadow , +.ui-bar-c .ui-shadow { + //.LESSbox-shadow(0px, 1px, 0, rgba(255,255,255,.3)); +} +.ui-shadow-inset { + //-moz-box-shadow: inset 0px 1px 4px rgba(0,0,0,.2); + //-webkit-box-shadow: inset 0px 1px 4px rgba(0,0,0,.2); + //box-shadow: inset 0px 1px 4px rgba(0,0,0,.2); +} +.ui-icon-shadow { + //.LESSbox-shadow(0px, 1px, 0, rgba(255,255,255,.4)); +} + +/* Focus state - set here for specificity +-----------------------------------------------------------------------------------------------------------*/ + +.ui-focus { + /* global-active-background-color */ + //.LESSbox-shadow(0px, 1px, 12px, #387bbe); + outline-color : #008cd2; +} + +/* unset box shadow in browsers that don't do it right +-----------------------------------------------------------------------------------------------------------*/ + +.ui-mobile-nosupport-boxshadow * { + -moz-box-shadow: none !important; + -webkit-box-shadow: none !important; + box-shadow: none !important; +} + +/* ...and bring back focus */ +.ui-mobile-nosupport-boxshadow .ui-focus { + outline-width: 2px; +} diff --git a/src/themes/tizen/common/jquery.mobile.tizen.colorpalette.less b/src/themes/tizen/common/jquery.mobile.tizen.colorpalette.less new file mode 100755 index 0000000..76ea2f8 --- /dev/null +++ b/src/themes/tizen/common/jquery.mobile.tizen.colorpalette.less @@ -0,0 +1,90 @@ +@import "config.less"; + +@todons-selected-color: #d9931a; +@todons-selected-color-disabled: #999999; + +@colorpalette-choice-total-width: 54 * @unit_base; +@colorpalette-choice-total-height: 54 * @unit_base; +@colorpalette-item-border-width: 4 * @unit_base; +@colorpalette-item-border-color: #c0c0c0; +@colorpalette-preview-total-width: 304 * @unit_base; +@colorpalette-preview-total-height: 109 * @unit_base; + +@colorpalette-choice-actual-width: @colorpalette-choice-total-width - 2 * @colorpalette-item-border-width; +@colorpalette-choice-actual-height: @colorpalette-choice-total-height - 2 * @colorpalette-item-border-width; +@colorpalette-preview-actual-width: @colorpalette-preview-total-width - 2 * @colorpalette-item-border-width; +@colorpalette-preview-actual-height: @colorpalette-preview-total-height - 2 * @colorpalette-item-border-width; + +.todons-colorpalette-disabled { + .colorpalette-table { + .colorpalette-choice-active { + border-color: @todons-selected-color-disabled !important; + } + } +} + +.ui-colorpalette { + display: table; + padding-left: 24 * @unit_base; + padding-right: 24 * @unit_base; + padding-top: 15 * @unit_base; + padding-bottom: 15 * @unit_base; + + .colorpalette-preview-container { + padding-top: 48 * @unit_base; + padding-bottom: 39 * @unit_base; + display: table; + margin: auto; + + .colorpalette-preview { + display: table; + margin: auto; + width: @colorpalette-preview-actual-width; + height: @colorpalette-preview-actual-height; + border: @colorpalette-item-border-color @colorpalette-item-border-width solid; + } + } + + .colorpalette-table { + .colorpalette-bottom-row { + display: table-row; + } + + .colorpalette-normal-row { + .colorpalette-bottom-row; + } + + .colorpalette-choice-container-left { + display: table-cell; + } + + .colorpalette-choice-container-rest { + .colorpalette-choice-container-left; + padding-left: 38 * @unit_base; + } + + .colorpalette-normal-row .colorpalette-choice-container-left { + padding-bottom: 16 * @unit_base; + } + + .colorpalette-choice { + width: @colorpalette-choice-actual-width; + height: @colorpalette-choice-actual-width; + border-width: @colorpalette-item-border-width; + border-style: solid; + border-color: @colorpalette-item-border-color; + -moz-border-radius: 0.2em; + -webkit-border-radius: 0.2em; + bordert-radius: 0.2em; + } + + .colorpalette-choice-active { + border-color: @todons-selected-color; + } + } + .LESSpalette_background_style; +} + +label.colorpickerbutton_label.ui-input-text { + display:block !important; +} diff --git a/src/themes/tizen/common/jquery.mobile.tizen.colorpicker.less b/src/themes/tizen/common/jquery.mobile.tizen.colorpicker.less new file mode 100755 index 0000000..73488fa --- /dev/null +++ b/src/themes/tizen/common/jquery.mobile.tizen.colorpicker.less @@ -0,0 +1,123 @@ +/* Own CSS */ +@import "config.less"; + +/* @selector-size should be an odd number, in order to pixel-perfectly center on a given colour */ +@colorpicker-selector-size: 72 * @unit_base; +@colorpicker-selector-border-width: 5 * @unit_base; +@colorpicker-clrchannel-hs-width: 256 * @unit_base; +@colorpicker-clrchannel-hs-height: 256 * @unit_base; +@colorpicker-clrchannel-l-width: 18 * @unit_base; +@colorpicker-clrchannel-l-height: 256 * @unit_base; + +@colorpicker-selector-total-size: @colorpicker-selector-size + 2 * @colorpicker-selector-border-width; +@colorpicker-clrchannel-hs-padding: @colorpicker-selector-total-size / 2; +@colorpicker-clrchannel-l-hpadding: + ~`Math.max(0, + parseInt("@{colorpicker-selector-total-size}") - + parseInt("@{colorpicker-clrchannel-l-width}")) / 2 + "px"`; +@colorpicker-clrchannel-l-selector-left: + ~`Math.max(0, + parseInt("@{colorpicker-clrchannel-l-width}") - + parseInt("@{colorpicker-selector-total-size}")) / 2 + "px"`; + +.ui-colorpicker { + display: table; + + .colorpicker-hs-container { + position: relative; + display: table-cell; + float: left; + + width: @colorpicker-clrchannel-hs-width; + height: @colorpicker-clrchannel-hs-height; + padding: @colorpicker-clrchannel-hs-padding; + + .colorpicker-hs-mask { + position: absolute; + width: @colorpicker-clrchannel-hs-width; + height: @colorpicker-clrchannel-hs-height; + } + + .colorpicker-hs-selector { + position: absolute; + width: @colorpicker-selector-size; + height: @colorpicker-selector-size; + border: @colorpicker-selector-border-width solid black; + } + } + + .colorpicker-l-container { + position: relative; + float: left; + + width: @colorpicker-clrchannel-l-width; + height: @colorpicker-clrchannel-l-height; + padding-left: @colorpicker-clrchannel-l-hpadding; + padding-right: @colorpicker-clrchannel-l-hpadding; + padding-top: @colorpicker-clrchannel-hs-padding; + padding-bottom: @colorpicker-clrchannel-hs-padding; + + .colorpicker-l-mask { + position: absolute; + width: @colorpicker-clrchannel-l-width; + height: @colorpicker-clrchannel-l-height; + left: ( @colorpicker-selector-size + ( @colorpicker-selector-border-width * 2 ) - @colorpicker-clrchannel-l-width ) / 2; + } + + .colorpicker-l-selector { + left: @colorpicker-clrchannel-l-selector-left; + position: absolute; + width: @colorpicker-selector-size; + height: @colorpicker-selector-size; + border: @colorpicker-selector-border-width solid black; + } + } +} + +.ui-colorpicker .colorpicker-hs-container .sat-gradient { + background: none; /* Old browsers */ + background: -webkit-gradient(linear, left top, left bottom, + color-stop(0%,rgba(128,128,128,0)), + color-stop(100%,rgba(128,128,128,1))); /* Chrome,Safari4+ */ + background: -moz-linear-gradient(top, + rgba(128,128,128,0) 0%, + rgba(128,128,128,1) 100%); /* FF3.6+ */ + background: -webkit-linear-gradient(top, + rgba(128,128,128,0) 0%, + rgba(128,128,128,1) 100%); /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(top, + rgba(128,128,128,0) 0%, + rgba(128,128,128,1) 100%); /* Opera11.10+ */ + background: -ms-linear-gradient(top, + rgba(128,128,128,0) 0%, + rgba(128,128,128,1) 100%); /* IE10+ */ + background: linear-gradient(top, + rgba(128,128,128,0) 0%, + rgba(128,128,128,1) 100%); /* W3C */ + /* filter: progid:DXImageTransform.Microsoft.gradient (startColorstr='#00808080', endColorstr="#808080", GradientType = 0); */ +} + +.ui-colorpicker .colorpicker-l-container .l-gradient { + background: none; /* Old browsers */ + background: -webkit-gradient(linear, left top, left bottom, + color-stop(0%,rgba(0,0,0,1)), + color-stop(100%,rgba(255,255,255,1))); /* Chrome,Safari4+ */ + background: -moz-linear-gradient(top, + rgba(0,0,0,1) 0%, + rgba(255,255,255,1) 100%); /* FF3.6+ */ + background: -webkit-linear-gradient(top, + rgba(0,0,0,1) 0%, + rgba(255,255,255,1) 100%); /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(top, + rgba(0,0,0,1) 0%, + rgba(255,255,255,1) 100%); /* Opera11.10+ */ + background: -ms-linear-gradient(top, + rgba(0,0,0,1) 0%, + rgba(255,255,255,1) 100%); /* IE10+ */ + background: linear-gradient(top, + rgba(0,0,0,1) 0%, + rgba(255,255,255,1) 100%); /* W3C */ + /* filter: progid:DXImageTransform.Microsoft.gradient (startColorstr='#000000', endColorstr="#ffffff", GradientType = 0); */ +} + + diff --git a/src/themes/tizen/common/jquery.mobile.tizen.colorpickerbutton.less b/src/themes/tizen/common/jquery.mobile.tizen.colorpickerbutton.less new file mode 100755 index 0000000..bd10cb1 --- /dev/null +++ b/src/themes/tizen/common/jquery.mobile.tizen.colorpickerbutton.less @@ -0,0 +1,11 @@ +/* Need to add !important below, because these classes are added before jqm enhancement */ +@import "config.less"; + +.ui-colorpickerbutton-input { + max-width: 150 * @unit_base; + display: inline-block !important; +} + +.ui-colorpickerbutton-input-hidden { + display: none !important; +} diff --git a/src/themes/tizen/common/jquery.mobile.tizen.colortitle.less b/src/themes/tizen/common/jquery.mobile.tizen.colortitle.less new file mode 100755 index 0000000..707327f --- /dev/null +++ b/src/themes/tizen/common/jquery.mobile.tizen.colortitle.less @@ -0,0 +1,16 @@ +@import "config.less"; + +@colortitle-vpadding: 15 * @unit_base; + +.ui-colortitle { + h1 { + margin-left: 10 * @unit_base; + } + .LESScolortitle_background_style; +} + +.todons-colortitle-disabled { + h1 { + color: #888888; + } +} diff --git a/src/themes/tizen/common/jquery.mobile.tizen.ctxpopup.less b/src/themes/tizen/common/jquery.mobile.tizen.ctxpopup.less new file mode 100755 index 0000000..c8c69a1 --- /dev/null +++ b/src/themes/tizen/common/jquery.mobile.tizen.ctxpopup.less @@ -0,0 +1,217 @@ +@import "config.less"; + +@border_radius: .3em; + +.ui-ctxpopup { + display: table; + + .ui-ctxpopup-row .ui-triangle-top { + top: 2px; + } + + .ui-ctxpopup-row .ui-triangle-left { + left: 2px; + } + + .ui-ctxpopup-row .ui-triangle-right { + right: 2px; + } + + .ui-ctxpopup-row .ui-triangle-bottom { + bottom: 2px; + } + + .ui-ctxpopup-row { + display: table-row; + + .ui-ctxpopup-cell { + display: table-cell; + } + + .ui-popupwindow-padding { + background: @color_ctxpopup_background; + border: none; + -webkit-box-shadow: 0 * @unit_base 0 * @unit_base 12 * @unit_base rgba( 0, 0, 0, .6 ); + box-shadow: 0 * @unit_base 0 * @unit_base 12 * @unit_base rgba( 0, 0, 0, .6 ); + -webkit-border-radius: @border_radius; + border-radius: @border_radius; + } + + } + + .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; + } + + .ui-listview li:first-child { + border-top-left-radius: @border_radius; + border-top-right-radius: @border_radius; + } + + .ui-listview { + min-width: 386 * @unit_base; + max-width: 620 * @unit_base; + border: none; + } + + .ui-listview > .ui-li { + color: @color_ctxpopup_text; + border-bottom-color: @color_ctxpopup_border_bottom; + padding: 0 7 * @unit_base; + } + + .ui-listview li.ui-btn-up-s > .ui-li > .ui-btn-text > a.ui-link-inherit, .ui-listview li.ui-btn-hover-s > .ui-li > .ui-btn-text > a.ui-link-inherit, .ui-listview li.ui-btn-down-s > .ui-li > .ui-btn-text > a.ui-link-inherit { + color: @color_ctxpopup_text; + } + + .ui-listview > .ui-li:last-child { + border: none; + } + + .horizontal { + color: @color_ctxpopup_text; + max-width: 648 * @unit_base; + + .icon .ui-btn { + padding: 0; + background: transparent; + + .ui-btn-icon-only { + width: 128 * @unit_base; + height: 92 * @unit_base; + padding: 0; + } + + .ui-icon { + top: 0; + height: inherit; + width: inherit; + margin: 0; + background-position: center; + .LESSbackground-size( 48 * @unit_base, 48 * @unit_base ); + } + } + + .text { + padding: 0 20 * @unit_base; + min-width: 128 * @unit_base; + } + + + a.ui-link { + color: @color_ctxpopup_text; + text-decoration: none; + } + + table { + border: none; + border-spacing: 0; + } + + td { + * { + display: -moz-box; + -moz-box-pack: center; + display: -webkit-box; + -webkit-box-pack: center; + display: box; + box-pack: center; + } + + border-left: 1px solid @color_ctxpopup_border_left; + border-right: 1px solid @color_ctxpopup_border_right; + border-top: 1px solid @color_ctxpopup_border_right; + border-bottom: 1px solid @color_ctxpopup_border_left; + } + + td:first-of-type { + border-left: none; + } + + td:last-of-type { + border-right: none; + } + + tr:first-of-type > td { + border-top: none; + } + + tr:last-of-type > td { + border-bottom: none; + } + + tr:first-of-type > td:first-of-type { + border-top-left-radius: @border_radius; + } + + tr:first-of-type > td:last-of-type { + border-top-right-radius: @border_radius; + } + + tr:last-of-type > td:first-of-type { + border-bottom-left-radius: @border_radius; + } + + tr:last-of-type > td:last-of-type { + border-bottom-right-radius: @border_radius; + } + + ul { + padding: 0; + display: inline-block; + list-style: none; + vertical-align: middle; + margin: 0; + } + + li { + line-height: 92 * @unit_base; + min-height: 92 * @unit_base; + min-width: 128 * @unit_base; + + float: left; + display: inline-block; + border-left: 1px solid @color_ctxpopup_border_left; + border-right: 1px solid @color_ctxpopup_border_right; + text-align: center; + } + + li:first-of-type { + border-top-left-radius: @border_radius; + border-bottom-left-radius: @border_radius; + + border-left: none; + } + + li:last-of-type { + border-top-right-radius: @border_radius; + border-bottom-right-radius: @border_radius; + + border-right: none; + margin-right: 0; + } + + li:active, td:active { + background: @color_bar_back_btn_press; + } + } + + .button { + table .ui-btn { + margin: 8 * @unit_base; + padding: 0; + height: 74 * @unit_base; + width: 172 * @unit_base; + } + } + +} diff --git a/src/themes/tizen/common/jquery.mobile.tizen.datetimepicker.less b/src/themes/tizen/common/jquery.mobile.tizen.datetimepicker.less new file mode 100755 index 0000000..85cd031 --- /dev/null +++ b/src/themes/tizen/common/jquery.mobile.tizen.datetimepicker.less @@ -0,0 +1,98 @@ +@import "config.less"; + +.ui-datefield { + .ui-datefield-seperator { + display: inline-block; + min-width: 30 * @unit_base; + text-align: center; + } + + .date,.time,.ui-datefield-tab { + display: inline-block; + } + + .ui-datefield-tab { + min-width: 60 * @unit_base; + } +} + +.ui-datetime { + margin: 0; + height: 72 * @unit_base; +} + +.ui-datetime-text-main { + position: relative; + font-size: @font_size_list_main_text; + top: 28 * @unit_base; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + max-width: 90%; + padding-top: 0.3em; +} + +.ui-datetime-text-main .ui-datefield-period.ui-btn { + margin-top: -0.3em; + height: 56 * @unit_base; + right: auto; + position: relative; +} + +.ui-datetime-text-sub { + position: absolute; + top: 10 * @unit_base; + color: @color_list_sub_text_default; + font-size: @font_size_list_sub_text; +} + +.ui-datetimepicker-selector { + ul { + padding: 0; + display: inline; + list-style: none; + vertical-align: middle; + margin: 0; + + li { + font-size: 44 * @unit_base; + float: left; + padding: 30 * @unit_base 8 * @unit_base 0 8 * @unit_base; + max-width: 120 * @unit_base; + min-width: 120 * @unit_base; + + a.ui-link { + text-decoration: none; + color: @color_ctxpopup_timepicker_text; + } + + a.ui-link:hover { + color: @color_ctxpopup_timepicker_text; + } + } + + li.current { + a.ui-link { + color: @color_ctxpopup_timepicker_text_focus; + } + } + } +} + +.ui-datetimepicker { + left: 0 !important; + padding: 0; + + .ui-popupwindow-padding { + background: @color_timepicker_selector_color !important; + border-radius: 0 !important; + -webkit-border-radius: 0 !important; + box-shadow: 0px 0px 12px rgba(0, 0, 0, 0.6) !important; + border-width: 0 !important; + text-align: center !important; + + div { + height: 106 * @unit_base; + } + } +} diff --git a/src/themes/tizen/common/jquery.mobile.tizen.dayselector.less b/src/themes/tizen/common/jquery.mobile.tizen.dayselector.less new file mode 100755 index 0000000..9d38574 --- /dev/null +++ b/src/themes/tizen/common/jquery.mobile.tizen.dayselector.less @@ -0,0 +1,90 @@ + +@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.8em 0px; + } + } + .ui-checkbox-off { + background : @color_dayselector_Btn_normal; + .ui-btn-text { + color : @color_dayselector_Btn_Mon_to_Fri; + } + } + + .ui-checkbox-off.ui-btn-down-s.ui-btn-hover-s { + background : @color_dayselector_Btn_press; + } + + .ui-checkbox-on { + background : @color_dayselector_Btn_press; + .ui-btn-text { + color : @color_dayselector_Btn_Mon_to_Fri; + } + } + + .ui-checkbox-on.ui-btn-down-s.ui-btn-hover-s { + background : @color_dayselector_Btn_normal; + } + .ui-dayselector-label-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 : 90 * @unit_base; + + .ui-btn { + width : 94 * @unit_base; + } + .ui-btn.ui-corner-left { + border-top-left-radius : 5 * @unit_base; + border-bottom-left-radius : 5 * @unit_base; + } + .ui-btn.ui-corner-right { + border-top-right-radius : 5 * @unit_base; + border-bottom-right-radius : 5 * @unit_base; + } + } + .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 : 128 * @unit_base; + .ui-btn-text { + margin-left : 16 * @unit_base; + } + } +} diff --git a/src/themes/tizen/common/jquery.mobile.tizen.hsvpicker.less b/src/themes/tizen/common/jquery.mobile.tizen.hsvpicker.less new file mode 100755 index 0000000..e72e6c0 --- /dev/null +++ b/src/themes/tizen/common/jquery.mobile.tizen.hsvpicker.less @@ -0,0 +1,93 @@ +@import "config.less"; + +@hsvpicker-clrchannel-masks-width: 300 * @unit_base; +@hsvpicker-clrchannel-masks-height: 38 * @unit_base; +@hsvpicker-clrchannel-selector-width: 10 * @unit_base; +@hsvpicker-clrchannel-selector-height: 50 * @unit_base; +@hsvpicker-clrchannel-selector-border-width: 5 * @unit_base; +@hsvpicker-clrchannel-masks-container-hpadding: 12 * @unit_base; +@hsvpicker-clrchannel-masks-container-vpadding: 16 * @unit_base; + +@hsvpicker-clrchannel-selector-actual-height: @hsvpicker-clrchannel-selector-height - + 2 * @hsvpicker-clrchannel-selector-border-width; + +@hsvpicker-clrchannel-masks-container-actual-hpadding: + @hsvpicker-clrchannel-selector-width / 2 + + @hsvpicker-clrchannel-selector-border-width; +@hsvpicker-clrchannel-masks-container-actual-vpadding: + (@hsvpicker-clrchannel-selector-actual-height - @hsvpicker-clrchannel-masks-height) / 2 + + @hsvpicker-clrchannel-selector-border-width; +@hsvpicker-clrchannel-masks-container-hmargin: + ~`Math.max(0, + (parseInt("@{hsvpicker-clrchannel-masks-container-hpadding}") - + parseInt("@{hsvpicker-clrchannel-masks-container-actual-hpadding}"))) + "px"`; +@hsvpicker-clrchannel-masks-container-vmargin: + ~`Math.max(0, + (parseInt("@{hsvpicker-clrchannel-masks-container-vpadding}") - + parseInt("@{hsvpicker-clrchannel-masks-container-actual-vpadding}"))) + "px"`; + +.ui-hsvpicker { + .hsvpicker-clrchannel-container { + display: table; + padding-top: 5 * @unit_base; + padding-bottom: 5 * @unit_base; + padding-left: 27 * @unit_base; + padding-right: 27 * @unit_base; + + .hsvpicker-arrow-btn-container { + display: table-cell; + vertical-align: middle; + } + + .hsvpicker-arrow-btn { + float: left; + } + + .hsvpicker-clrchannel-masks-container { + float: left; + position: relative; + width: @hsvpicker-clrchannel-masks-width; + height: @hsvpicker-clrchannel-masks-height; + + margin-left: @hsvpicker-clrchannel-masks-container-hmargin; + margin-right: @hsvpicker-clrchannel-masks-container-hmargin; + margin-top: @hsvpicker-clrchannel-masks-container-vmargin; + margin-bottom: @hsvpicker-clrchannel-masks-container-vmargin; + + padding-left: @hsvpicker-clrchannel-masks-container-actual-hpadding; + padding-right: @hsvpicker-clrchannel-masks-container-actual-hpadding; + padding-top: @hsvpicker-clrchannel-masks-container-actual-vpadding; + padding-bottom: @hsvpicker-clrchannel-masks-container-actual-vpadding; + + .hsvpicker-clrchannel-mask { + position: absolute; + width: @hsvpicker-clrchannel-masks-width; + height: @hsvpicker-clrchannel-masks-height; + } + + .hsvpicker-clrchannel-mask-black { + background: #000000; + } + + .hsvpicker-clrchannel-mask-white { + background: #ffffff; + } + + .hsvpicker-clrchannel-selector { + position: absolute; + left: 0 * @unit_base; + top: 0 * @unit_base; + width: @hsvpicker-clrchannel-selector-width; + height: @hsvpicker-clrchannel-selector-actual-height; + border: @hsvpicker-clrchannel-selector-border-width solid black; + } + } + } + .LESShsvpicker_background_style; +} + +.ui-popupwindow .colorpickerbutton-popup-container-style { + display: table; + width : 50%; + margin : 0 auto; +} diff --git a/src/themes/tizen/common/jquery.mobile.tizen.huegradient.css b/src/themes/tizen/common/jquery.mobile.tizen.huegradient.css new file mode 100755 index 0000000..2e86f35 --- /dev/null +++ b/src/themes/tizen/common/jquery.mobile.tizen.huegradient.css @@ -0,0 +1,104 @@ +.tizen-huegradient { + background: none; /* Old browsers */ + background: -webkit-gradient(linear, left top, right top, + color-stop( 0% ,rgba(255, 0, 0,1)), + color-stop( 16.666666667%,rgba(255,255, 0,1)), + color-stop( 33.333333333%,rgba(0 ,255, 0,1)), + color-stop( 50% ,rgba(0 ,255,255,1)), + color-stop( 66.666666667%,rgba(0 , 0,255,1)), + color-stop( 83.333333333%,rgba(255, 0,255,1)), + color-stop(100% ,rgba(255, 0, 0,1))); /* Chrome,Safari4+ */ + background: -moz-linear-gradient(left, + rgba(255, 0, 0,1) 0%, + rgba(255,255, 0,1) 16.666666667%, + rgba( 0,255, 0,1) 33.333333333%, + rgba( 0,255,255,1) 50%, + rgba( 0, 0,255,1) 66.666666667%, + rgba(255, 0,255,1) 83.333333333%, + rgba(255, 0, 0,1) 100%); + background: -webkit-linear-gradient(left, + rgba(255, 0, 0,1) 0%, + rgba(255,255, 0,1) 16.666666667%, + rgba( 0,255, 0,1) 33.333333333%, + rgba( 0,255,255,1) 50%, + rgba( 0, 0,255,1) 66.666666667%, + rgba(255, 0,255,1) 83.333333333%, + rgba(255, 0, 0,1) 100%); + background: -o-linear-gradient(left, + rgba(255, 0, 0,1) 0%, + rgba(255,255, 0,1) 16.666666667%, + rgba( 0,255, 0,1) 33.333333333%, + rgba( 0,255,255,1) 50%, + rgba( 0, 0,255,1) 66.666666667%, + rgba(255, 0,255,1) 83.333333333%, + rgba(255, 0, 0,1) 100%); + background: -ms-linear-gradient(left, + rgba(255, 0, 0,1) 0%, + rgba(255,255, 0,1) 16.666666667%, + rgba( 0,255, 0,1) 33.333333333%, + rgba( 0,255,255,1) 50%, + rgba( 0, 0,255,1) 66.666666667%, + rgba(255, 0,255,1) 83.333333333%, + rgba(255, 0, 0,1) 100%); + background: linear-gradient(left, + rgba(255, 0, 0,1) 0%, + rgba(255,255, 0,1) 16.666666667%, + rgba( 0,255, 0,1) 33.333333333%, + rgba( 0,255,255,1) 50%, + rgba( 0, 0,255,1) 66.666666667%, + rgba(255, 0,255,1) 83.333333333%, + rgba(255, 0, 0,1) 100%); +} + +/* Full-saturation magic grayscale values were taken from the Gimp */ +.tizen-huegradient-disabled { + background: none; /* Old browsers */ + background: -webkit-gradient(linear, left top, right top, + color-stop( 0% ,rgba( 54, 54, 54,1)), + color-stop( 16.666666667%,rgba(237,237,237,1)), + color-stop( 33.333333333%,rgba(182,182,182,1)), + color-stop( 50% ,rgba(201,201,201,1)), + color-stop( 66.666666667%,rgba( 18, 18, 18,1)), + color-stop( 83.333333333%,rgba( 73, 73, 73,1)), + color-stop(100% ,rgba( 54, 54, 54,1))); /* Chrome,Safari4+ */ + background: -moz-linear-gradient(left, + rgba( 54, 54, 54,1) 0%, + rgba(237,237,237,1) 16.666666667%, + rgba(182,182,182,1) 33.333333333%, + rgba(201,201,201,1) 50%, + rgba( 18, 18, 18,1) 66.666666667%, + rgba( 73, 73, 73,1) 83.333333333%, + rgba( 54, 54, 54,1) 100%); + background: -webkit-linear-gradient(left, + rgba( 54, 54, 54,1) 0%, + rgba(237,237,237,1) 16.666666667%, + rgba(182,182,182,1) 33.333333333%, + rgba(201,201,201,1) 50%, + rgba( 18, 18, 18,1) 66.666666667%, + rgba( 73, 73, 73,1) 83.333333333%, + rgba( 54, 54, 54,1) 100%); + background: -o-linear-gradient(left, + rgba( 54, 54, 54,1) 0%, + rgba(237,237,237,1) 16.666666667%, + rgba(182,182,182,1) 33.333333333%, + rgba(201,201,201,1) 50%, + rgba( 18, 18, 18,1) 66.666666667%, + rgba( 73, 73, 73,1) 83.333333333%, + rgba( 54, 54, 54,1) 100%); + background: -ms-linear-gradient(left, + rgba( 54, 54, 54,1) 0%, + rgba(237,237,237,1) 16.666666667%, + rgba(182,182,182,1) 33.333333333%, + rgba(201,201,201,1) 50%, + rgba( 18, 18, 18,1) 66.666666667%, + rgba( 73, 73, 73,1) 83.333333333%, + rgba( 54, 54, 54,1) 100%); + background: linear-gradient(left, + rgba( 54, 54, 54,1) 0%, + rgba(237,237,237,1) 16.666666667%, + rgba(182,182,182,1) 33.333333333%, + rgba(201,201,201,1) 50%, + rgba( 18, 18, 18,1) 66.666666667%, + rgba( 73, 73, 73,1) 83.333333333%, + rgba( 54, 54, 54,1) 100%); +} diff --git a/src/themes/tizen/common/jquery.mobile.tizen.imageslider.less b/src/themes/tizen/common/jquery.mobile.tizen.imageslider.less new file mode 100644 index 0000000..448711b --- /dev/null +++ b/src/themes/tizen/common/jquery.mobile.tizen.imageslider.less @@ -0,0 +1,13 @@ +@import "config.less"; + +.ui-imageslider { + position: relative; + width: 100%; +} + +.ui-imageslider-bg { + display: none; + position: absolute; + text-align: center; + width: 100%; +} diff --git a/src/themes/tizen/common/jquery.mobile.tizen.less b/src/themes/tizen/common/jquery.mobile.tizen.less new file mode 100644 index 0000000..583c0e2 --- /dev/null +++ b/src/themes/tizen/common/jquery.mobile.tizen.less @@ -0,0 +1,145 @@ +/* + * Common definition for theme + */ + +@font_size_default: 36px; // Default unit font size. DO NOT USE THIS VALUE IN WIDGET CSS! +@rem_base: (1rem/@font_size_default); + +@em_base: 1em/@font_size_default; // WARNING: Don't use em unit! This value is to be removed. +@px_base: 1px; + +@unit_base: @rem_base; + +@font_family: Helvetica, Arial, sans-serif; + +/****************************** + z-index order collection + ******************************/ +@z_base_maximum: 2147483647; +@z_base_loader: 100; +@z_base_header_footer: 1000; +@z_base_smallpopup: @z_base_header_footer + 100; +@z_base_popup: @z_base_smallpopup + 100; +@z_base_tickernoti: @z_base_maximum - 100; + + +/****************************** + Global LESS mixin collection + ******************************/ + +// Mixin : background ************************ +.LESSbackground-img-with-gradient(@from: top, @startcolor: #3c3c3c, @endcolor: #111) { + background-image: -webkit-gradient(linear, left top, left bottom, from(@startcolor), to(@endcolor)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(@from, @startcolor, @endcolor); + background-image: -moz-linear-gradient(@from, @startcolor, @endcolor); + background-image: -ms-linear-gradient(@from, @startcolor, @endcolor); + background-image: -o-linear-gradient(@from, @startcolor, @endcolor); + background-image: linear-gradient(@from, @startcolor, @endcolor); +} +.LESSbackground-size(@width, @height) { + -moz-background-size: @width @height; + -o-background-size: @width @height; + -webkit-background-size: @width @height; + background-size: @width @height; +} + +// Mixin : border *************************** +.LESSborder-image(@url:url, @width:width, @height:height, @repeat:repeat) { + -moz-border-image: url(@url) @width @height @repeat; + -webkit-border-image: url(@url) @width @height @repeat; + -o-border-image: url(@url) @width @height @repeat; + border-image: url(@url) @width @height @repeat; +} +.LESSborder-radius-topleft(@radius) { + -moz-border-radius-topleft: @radius; + -webkit-border-top-left-radius: @radius; + border-top-left-radius: @radius; +} +.LESSborder-radius-topright(@radius) { + -moz-border-radius-topright: @radius; + -webkit-border-top-right-radius: @radius; + border-top-right-radius: @radius; +} +.LESSborder-radius-bottomleft(@radius) { + -moz-border-radius-bottomleft: @radius; + -webkit-border-bottom-left-radius: @radius; + border-bottom-left-radius: @radius; +} +.LESSborder-radius-bottomright(@radius) { + -moz-border-radius-bottomright: @radius; + -webkit-border-bottom-right-radius: @radius; + border-bottom-right-radius: @radius; +} +.LESSborder-radius-all(@radius) { + -moz-border-radius: @radius; + -webkit-border-radius: @radius; + bordert-radius: @radius; +} + +// Mixin : box *************************** +.LESSbox-shadow(@hshadow, @vshadow, @blur, @color) { + -moz-box-shadow: @hshadow @vshadow @blur @color; + -webkit-box-shadow: @hshadow @vshadow @blur @color; + box-shadow: @hshadow @vshadow @blur @color; +} +.LESSdisplaybox() { + display:-moz-box; + display:-webkit-box; + display:box; +} +//position: vertical, horizental +.LESSbox-orient(@position) { + -moz-box-orient: @position; + -webkit-box-orient: @position; + box-orient: @position; +} + +//position: start, center, end +.LESSbox-pack(@position) { + -moz-box-pack: @position; + -webkit-box-pack: @position; + box-pack: @position; +} + +//position: start, center, end +.LESSbox-align(@position) { + -moz-box-align: @position; + -webkit-box-align: @position; + box-align: @position; +} + +// Mixin : Utility ************************************ +//CAUTION!!! - you MUST call this function inside of your winset structure. +//DO NOT CALL GLOBALLY!! +.LESSclear-btn-basic-setting() { + .ui-btn-corner-all { + .LESSborder-radius-all(0); + } + .ui-btn-inner { + border-top: 0; + } + .ui-btn-up-s { + border: 0; + background: transparent; + font-weight: normal; + } + .ui-btn-hover-s { + border: 0; + background: transparent; + font-weight: normal; + } + .ui-btn-down-s { + border: 0; + background: transparent; + font-weight: normal; + } +} + +// Mixin : transform +.LESStransform(@method) { + transform: @method; + -ms-transform: @method; + -moz-transform: @method; + -webkit-transform: @method; + -o-transform: @method; +} diff --git a/src/themes/tizen/common/jquery.mobile.tizen.multibuttonentry.less b/src/themes/tizen/common/jquery.mobile.tizen.multibuttonentry.less new file mode 100755 index 0000000..e737ffa --- /dev/null +++ b/src/themes/tizen/common/jquery.mobile.tizen.multibuttonentry.less @@ -0,0 +1,98 @@ +@import "config.less"; + +.ui-multibuttonentry { + display : table; + background-color : @color_multibuttonentry_bg; + outline : none; +} + +.ui-multibuttonentry .ui-multibuttonentry-label { + display : inline-block; + text-align : center; + position : relative; + margin-left : .3em; + margin-right : .3em; + padding : .6em 0em; + color : @color_multibuttonentry_input_text; + font-weight : bold; + text-align : center; + font-size : 1em; + background-color : @color_multibuttonentry_bg; +} + +.ui-multibuttonentry-input { + display : inline-block; + outline : none; + position : relative; + border : 0 !important; + padding : 0 !important; + margin : .5em; + color : @color_multibuttonentry_input_text; + text-align : left; + font-size : 1em; + background-color : @color_multibuttonentry_bg; +} + +.ui-multibuttonentry div, .ui-multibuttonentry a { + display : inline-block; + text-align : center; + cursor : pointer; + position : relative; + margin-left : .3em; + margin-right : .3em; + margin-bottom : .3em; + margin-top : .3em; + padding : .2em .5em; + font-size : 1em; + text-shadow : 0 .1em .1em rgba(0,0,0,.3); + -webkit-border-radius : .5em; + -moz-border-radius : .5em; + border-radius : 1.5em; + -webkit-box-shadow : 0 .1em .1em rgba(0,0,0,.2); + -moz-box-shadow : 0 .1em .1em rgba(0,0,0,.2); + box-shadow : 0 .1em .1em rgba(0,0,0,.2); + color : @color_multibuttonentry_block_text; +} + +a.ui-multibuttonentry-link-base { + float : right; + font-size : 1em; + font-weight : bold; + text-decoration : none; + border : solid 2px @color_multibuttonentry_link_bg; +} + +a.ui-multibuttonentry-link { + color : @color_multibuttonentry_link !important; + background-color : @color_multibuttonentry_link_bg; +} + +a.ui-multibuttonentry-link-dim { + color : @color_multibuttonentry_link_bg !important; + background-color : @color_multibuttonentry_bg; +} + +div.ui-multibuttonentry-block { + border : solid 2px @color_multibuttonentry_block_border; + background-color : @color_multibuttonentry_block_bg; +} + +div.ui-multibuttonentry-sblock { + border : solid 2px @color_multibuttonentry_press_border; + background : @color_multibuttonentry_press_bg; +} + +.ui-multibuttonentry .ui-multibuttonentry-desclabel { + display : inline-block; + outline : none; + position : relative; + border : 0; + color : @color_multibuttonentry_input_text; + text-align : left; + font-size : 1em; + background-color : @color_multibuttonentry_bg; +} + +.ui-multibuttonentry-focus-button { + background-image : url(./images/00_button_expand_opened.png); + } diff --git a/src/themes/tizen/common/jquery.mobile.tizen.multimediaview.less b/src/themes/tizen/common/jquery.mobile.tizen.multimediaview.less new file mode 100755 index 0000000..4fd7ed5 --- /dev/null +++ b/src/themes/tizen/common/jquery.mobile.tizen.multimediaview.less @@ -0,0 +1,192 @@ +@import "config.less"; + +.ui-multimediaview { + background-color : @color_multimediaview_bg; + overflow : hidden; +} + +.ui-multimediaview-wrap { + width : 100%; + margin : 0; + padding : 0; + border : 0; +} + +.ui-multimediaview-fullscreen { + position : absolute !important; + z-index : @z_base_header_footer + 100 !important; +} + +.ui-multimediaview-audio { + background-color : @color_multimediaview_bg !important; +} + +.ui-multimediaview-control span { + display : inline-block; +} + +.ui-multimediaview-control span.ui-play-icon { + background-image : url(./images/00_button_play.png); +} + +.ui-multimediaview-control span.ui-pause-icon { + background-image : url(./images/00_button_pause.png); +} + +.ui-multimediaview-control span.ui-volume-icon { + background-image : url(./images/00_slider_btn_volume02.png); +} + +.ui-multimediaview-control span.ui-mute-icon { + background-image : url(./images/00_slider_btn_volume01.png); +} + +.ui-multimediaview-control span.ui-fullscreen-on { + background-image : url(./images/00_button_fullscreen_on.png); +} + +.ui-multimediaview-control span.ui-fullscreen-off { + background-image : url(./images/00_button_fullscreen_off.png); +} + +.ui-multimediaview-control { + position : absolute; + display : block; + z-index : @z_base_header_footer + 101 !important; + padding : 0; + margin : 0; + outline : 0; + border : 0; + background-color : @color_multimediaview_control_bg; + height : 84 * @unit_base; +} + +.ui-multimediaview-control span.ui-button { + background-position : center center; + background-size : 80%; + background-repeat : no-repeat; + width : 74 * @unit_base; + height : 74 * @unit_base; + -webkit-border-radius : 6 * @unit_base; + -moz-border-radius : 6 * @unit_base; + border-radius : 6 * @unit_base; + background-color : @color_multimediaview_button_bg; + margin : 4 * @unit_base; +} + +.ui-multimediaview-control .ui-playpausebutton { + background-color : transparent !important; + float : left; +} + +.ui-multimediaview-control .ui-timestamplabel { + text-align : center; + color : @color_multimediaview_timestamp_text; + float : left; +} + +.ui-multimediaview-control .ui-timestamplabel p { + margin-top : -6 * @unit_base; + margin-left : 4 * @unit_base; + padding : 0; + text-align : center; + font-size : 22 * @unit_base; + line-height : 28 * @unit_base; + text-align : left; +} + +.ui-multimediaview-control .ui-durationlabel { + text-align : center; + color : @color_multimediaview_duration_text; + float : right; +} + +.ui-multimediaview-control .ui-durationlabel p { + margin-top : -6 * @unit_base; + margin-right : 4 * @unit_base; + padding : 0; + text-align : center; + font-size : 22 * @unit_base; + line-height : 28 * @unit_base; + text-align : right; +} + +.ui-multimediaview-control .ui-seekbar { + margin-top : 16 * @unit_base; + padding-left : 4 * @unit_base; + padding-right : 4 * @unit_base; + height : 16 * @unit_base; + float : left; +} + +.ui-multimediaview-control .ui-seekbar .ui-duration { + margin : 0; + padding : 0; + width : 100%; + height : 16 * @unit_base; + background-color : @color_multimediaview_bar_gray; + -webkit-border-radius : 3 * @unit_base; + -moz-border-radius : 3 * @unit_base; + border-radius : 3 * @unit_base; +} + +.ui-multimediaview-control .ui-seekbar .ui-currenttime { + margin : 0; + padding : 0; + height : 16 * @unit_base; + position : absolute; + background-color : @color_multimediaview_bar_active; + -webkit-border-radius : 3 * @unit_base; + -moz-border-radius : 3 * @unit_base; + border-radius : 3 * @unit_base; +} + +.ui-multimediaview-control .ui-volumecontrol { + width : 220 * @unit_base; + height : 100%; + float : left; +} + +.ui-multimediaview-control .ui-volumecontrol .ui-volumebar { + height : 100%; + padding-top : 35 * @unit_base; + padding-left : 40 * @unit_base; + display : block; +} + +.ui-multimediaview-control .ui-volumecontrol .ui-volumebar .ui-guide { + width : 160 * @unit_base; + height : 16 * @unit_base; + position : absolute; + background-color : white; + -webkit-border-radius : 3 * @unit_base; + -moz-border-radius : 3 * @unit_base; + border-radius : 3 * @unit_base; + background-color : @color_multimediaview_bar_gray; +} + +.ui-multimediaview-control .ui-volumecontrol .ui-volumebar .ui-value { + margin : 0; + padding : 0; + height : 16 * @unit_base; + position : absolute; + -webkit-border-radius : 3 * @unit_base; + -moz-border-radius : 3 * @unit_base; + border-radius : 3 * @unit_base; + background-color : @color_multimediaview_bar_active; +} + +.ui-multimediaview-control .ui-volumecontrol .ui-volumebar .ui-handler { + margin : 0; + padding : 0; + width : 30 * @unit_base; + height : 30 * @unit_base; + position : absolute; + -webkit-border-radius : 5 * @unit_base; + -moz-border-radius : 5 * @unit_base; + border-radius : 5 * @unit_base; + background-color : @color_multimediaview_bar_handle; + background : -webkit-gradient(linear, left top, left bottom, from(#FFFFFF), to(#E6E6E6)); + background : -moz-linear-gradient(top, #FFFFFF, #E6E6E6); + border : solid 1px rgb(213, 213, 213); +} \ No newline at end of file diff --git a/src/themes/tizen/common/jquery.mobile.tizen.nocontents.less b/src/themes/tizen/common/jquery.mobile.tizen.nocontents.less new file mode 100644 index 0000000..6326708 --- /dev/null +++ b/src/themes/tizen/common/jquery.mobile.tizen.nocontents.less @@ -0,0 +1,48 @@ +@import "config.less"; + +@img-width: 314 * @unit_base; +@img-height: 310 * @unit_base; + +.ui-nocontents { + position: relative; + left: 0; + width: 100%; + height: 508 * @unit_base; +} + +.ui-nocontents-icon-text, +.ui-nocontents-icon-picture, +.ui-nocontents-icon-multimedia, +.ui-nocontents-icon-unnamed { + position: absolute; + display: block; + width: @img-width; + height: @img-height; + + background: url(images/00_Nocontents_text.png) no-repeat; + .LESSbackground-size(@img-width, @img-height); +} + +.ui-nocontents-icon-picture { + background: url(images/00_Nocontents_picture.png) no-repeat; + .LESSbackground-size(@img-width, @img-height); +} + +.ui-nocontents-icon-multimedia { + background: url(images/00_Nocontents_multimedia.png) no-repeat; + .LESSbackground-size(@img-width, @img-height); +} + +.ui-nocontents-icon-unnamed { + background: url(images/00_Nocontents_unnamed.png) no-repeat; + .LESSbackground-size(@img-width, @img-height); +} + +.ui-nocontents-text { + position: absolute; + margin: 0; + height: 46 * @unit_base; + width: 100%; + text-align: center; + color: @color_nocontents_text; +} diff --git a/src/themes/tizen/common/jquery.mobile.tizen.notification.less b/src/themes/tizen/common/jquery.mobile.tizen.notification.less new file mode 100644 index 0000000..9bb6496 --- /dev/null +++ b/src/themes/tizen/common/jquery.mobile.tizen.notification.less @@ -0,0 +1,164 @@ +@import "config.less"; + +/* tickernoti */ + +@ticker-height: 100 * @unit_base; + +@-webkit-keyframes ui-ticker-show { + from { + opacity: 0; + -webkit-transform: translateY(-@ticker-height); + top: -@ticker-height; + } to { + opacity: 1; + -webkit-transform: translateY(0); + top: 0; + } +} + +@-webkit-keyframes ui-ticker-hide { + from { + opacity: 1; + -webkit-transform: translateY(0); + top: 0; + } to { + opacity: 0; + -webkit-transform: translateY(-@ticker-height); + top: -@ticker-height; + } +} + +.ui-ticker { + position: fixed; + display: none; + left: 0; + width: 100%; + height: @ticker-height; + z-index: @z_base_tickernoti; + background: @color_ticker_bg; +} + +.ui-ticker.fix{ + display: block; +} + +.ui-ticker.show { + display: block; + -webkit-animation: ui-ticker-show 0.8s 1 ease; + top: 0; +} + +.ui-ticker.hide { + display: block; + -webkit-animation: ui-ticker-hide 0.8s 1 ease; + top: -@ticker-height; +} + +.ui-ticker-btn { + position: relative; + height: 54 * @unit_base; + margin-top: 23 * @unit_base; + margin-left: 16 * @unit_base; + margin-right: 16 * @unit_base; + vertical-align: middle; + float: right; + + .ui-btn-inner { + padding: 0.3em 0.7em; + background: @color_ticker_btn; + } +} + +.ui-ticker-icon { + position: absolute; + top: 0; + height: 64 * @unit_base; + width: 64 * @unit_base; + margin-top: 18 * @unit_base; + margin-bottom: 18 * @unit_base; + margin-left: 16 * @unit_base; + margin-right: 16 * @unit_base; + vertical-align: middle; +} + +.ui-ticker-text1-bg { + position: absolute; + top: 0; + height: 32 * @unit_base; + left: 96 * @unit_base; + margin-top: 16 * @unit_base; + color: @color_ticker_text1; +} + +.ui-ticker-text2-bg { + position: absolute; + top: 0; + height: 32 * @unit_base; + left: 96 * @unit_base; + margin-top: 52 * @unit_base; + font-size: 0.9em; + color: @color_ticker_text2; +} + +/* smallpopup */ + +@smallpopup-height: 48 * @unit_base; + +@-webkit-keyframes ui-smallpopup-show { + from { + opacity: 0; + -webkit-transform: scaleY(0); + } to { + opacity: 1; + -webkit-transform: scaleY(1); + } +} + +@-webkit-keyframes ui-smallpopup-hide { + from { + opacity: 1; + left: 0; + -webkit-transform: scaleY(1); + } to { + opacity: 0; + height: 0; + left: 0; + -webkit-transform: scaleY(0); + } +} + +.ui-smallpopup { + position: fixed; + display: none; + left: 0; + width: 100%; + z-index: @z_base_smallpopup; + background: @color_smallpopup_bg; + vertical-align: middle; +} + +.ui-smallpopup.fix { + display: block; +} + +.ui-smallpopup.show { + display: block; + + -webkit-animation: ui-smallpopup-show 0.5s 1 ease; +} + +.ui-smallpopup.hide { + display: block; + left: -100%; + + -webkit-animation: ui-smallpopup-hide 0.5s 1 ease; +} + +.ui-smallpopup-text-bg { + position: relative; + margin-top: 6 * @unit_base; + margin-bottom: 6 * @unit_base; + margin-left: 16 * @unit_base; + margin-right: 16 * @unit_base; + color: @color_smallpopup_text; +} diff --git a/src/themes/tizen/common/jquery.mobile.tizen.optionheader.less b/src/themes/tizen/common/jquery.mobile.tizen.optionheader.less new file mode 100755 index 0000000..74af122 --- /dev/null +++ b/src/themes/tizen/common/jquery.mobile.tizen.optionheader.less @@ -0,0 +1,156 @@ +@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; + } + } + } +} diff --git a/src/themes/tizen/common/jquery.mobile.tizen.pagecontrol.less b/src/themes/tizen/common/jquery.mobile.tizen.pagecontrol.less new file mode 100644 index 0000000..a453192 --- /dev/null +++ b/src/themes/tizen/common/jquery.mobile.tizen.pagecontrol.less @@ -0,0 +1,54 @@ +/* + * pagrcontrol stylesheet + * by Youmin Ha + */ + +@import "config.less"; + +div.pagecontrol { + text-align: center; + + .LESSpagecontrolIconCommonProperties(@imgUrl) { + background-image: url(@imgUrl); + background-size: 52 * @unit_base; + + // Transition + -webkit-transition: background 0.5s ease; + -moz-transition: background 0.5s ease; + -o-transition: background 0.5s ease; + transition: background 0.5s ease; + } + .LESSpagecontrolIconMargin(@l, @r) { + margin-left: @l * @unit_base; + margin-right: @r * @unit_base; + } + + &> div.page_n { + display: inline-block; + border: 0; + width: 52 * @unit_base; + height: 52 * @unit_base; + } + + &> div.page_n_margin_44 { .LESSpagecontrolIconMargin(22, 22); } + // NOTE: Reduces 2 picels for each margin, to show properly with Tizen emulator. + &> div.page_n_margin_35 { .LESSpagecontrolIconMargin(17, 16; } + &> div.page_n_margin_26 { .LESSpagecontrolIconMargin(12, 12); } + &> div.page_n_margin_19 { .LESSpagecontrolIconMargin(9, 8); } + + + &> div.page_n_dot { + .LESSpagecontrolIconCommonProperties('images/00_mainmenu_page_bar_001.png'); + } + &> div.page_n_1 { .LESSpagecontrolIconCommonProperties('images/00_mainmenu_page_bar_01.png'); } + &> div.page_n_2 { .LESSpagecontrolIconCommonProperties('images/00_mainmenu_page_bar_02.png'); } + &> div.page_n_3 { .LESSpagecontrolIconCommonProperties('images/00_mainmenu_page_bar_03.png'); } + &> div.page_n_4 { .LESSpagecontrolIconCommonProperties('images/00_mainmenu_page_bar_04.png'); } + &> div.page_n_5 { .LESSpagecontrolIconCommonProperties('images/00_mainmenu_page_bar_05.png'); } + &> div.page_n_6 { .LESSpagecontrolIconCommonProperties('images/00_mainmenu_page_bar_06.png'); } + &> div.page_n_7 { .LESSpagecontrolIconCommonProperties('images/00_mainmenu_page_bar_07.png'); } + &> div.page_n_8 { .LESSpagecontrolIconCommonProperties('images/00_mainmenu_page_bar_08.png'); } + &> div.page_n_9 { .LESSpagecontrolIconCommonProperties('images/00_mainmenu_page_bar_09.png'); } + &> div.page_n_10 { .LESSpagecontrolIconCommonProperties('images/00_mainmenu_page_bar_10.png'); } + +} diff --git a/src/themes/tizen/common/jquery.mobile.tizen.popupwindow.less b/src/themes/tizen/common/jquery.mobile.tizen.popupwindow.less new file mode 100644 index 0000000..ffdc4de --- /dev/null +++ b/src/themes/tizen/common/jquery.mobile.tizen.popupwindow.less @@ -0,0 +1,659 @@ +@import "config.less"; + +/* Resource color mapping table + +@color_popup_title_bg: popup_title_bg.png +@color_popup_text_bg: popup_bg.png +@color_popup_button_bg: popup_button_bg.png +@color_popup_font: Popup title & default +@color_popup_text_font: Popup text + +*/ + + +@popupwindow-text-padding-vert: 22 * @unit_base; +@popupwindow-text-padding-hori: 16 * @unit_base; + + +.ui-popupwindow-screen { + background: #000000; + opacity: 0; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: @z_base_popup; +} + +.ui-popupwindow { + + position: absolute; + z-index: (@z_base_popup + 1) !important; + color: @color_popup_font; + + //FIXME : remove background & padding if there is no padding. + .LESSpopup_padding_style; + background: @color_popup_text_bg; + + // --------- common style in popup window ------------- // + .popup-title { + width: 100%; + height: 100%; + font-size: @font_size_popup_basic_style_title; + background: @color_popup_title_bg; + p { + margin: 0*@unit_base 0*@unit_base; + padding: 13*@unit_base 0*@unit_base; + } + } + + .popup-text { + width: 100%; + color: @color_popup_text_font; + font-size: @font_size_popup_info_style; + background: @color_popup_text_bg; + p { + text-align: center; + padding: @popupwindow-text-padding-vert @popupwindow-text-padding-hori; + } + } + // ----------------------------------------------------- // + + .center_info { + + .LESSdisplaybox(); + .LESSbox-orient(vertical); + .LESSbox-align(center); + .LESSbox-pack(center); + + // .popup-text + } + + .center_title { + .LESSdisplaybox(); + .LESSbox-orient(vertical); + .LESSbox-align(center); + .LESSbox-pack(center); + + text-align: center; + + // .popup-title + // .popup-text + } + + .center_basic_1btn { + + .LESSdisplaybox(); + .LESSbox-orient(vertical); + .LESSbox-align(center); + .LESSbox-pack(center); + + text-align: center; + + // .popup-text + + .popup-button-bg { + font-size: @font_size_popup_button_text; + background: @color_popup_button_bg; + width: 100%; + padding-top: 11*@unit_base; + padding-bottom: 11*@unit_base; + vertical-align: middle; + + .ui-btn { + width: 402*@unit_base; + height: 74*@unit_base; + margin:auto; + + } + } + } + .center_basic_2btn { + + .LESSdisplaybox(); + .LESSbox-orient(vertical); + .LESSbox-align(center); + .LESSbox-pack(center); + + text-align: center; + + // .popup-text + + .popup-button-bg { + font-size: @font_size_popup_button_text; + background: @color_popup_button_bg; + width: 100%; + padding-top: 11*@unit_base; + padding-bottom: 11*@unit_base; + vertical-align: middle; + + .ui-btn { + width: 274*@unit_base; + height: 74*@unit_base; + margin-top: 0*@unit_base; + margin-bottom: 0*@unit_base; + margin-left: 5*@unit_base; + margin-right: 5*@unit_base; + + display: inline-block; + } + } + } + .center_basic_3btn { + + .LESSdisplaybox(); + .LESSbox-orient(vertical); + .LESSbox-align(center); + .LESSbox-pack(center); + + text-align: center; + + // .popup-text + + .popup-button-bg { + font-size: @font_size_popup_button_text; + background: @color_popup_button_bg; + width: 100%; + padding-top: 11*@unit_base; + padding-bottom: 11*@unit_base; + vertical-align: middle; + + .ui-btn { + width: 186*@unit_base; + height: 74*@unit_base; + margin-top: 0*@unit_base; + margin-bottom: 0*@unit_base; + margin-left: 5*@unit_base; + margin-right: 5*@unit_base; + + display: inline-block; + } + } + } + .center_title_1btn { + + .LESSdisplaybox(); + .LESSbox-orient(vertical); + .LESSbox-align(center); + .LESSbox-pack(center); + + text-align: center; + + // .popup-title + // .popup-text + + .popup-button-bg { + font-size: @font_size_popup_button_text; + background: @color_popup_button_bg; + width: 100%; + padding-top: 11*@unit_base; + padding-bottom: 11*@unit_base; + vertical-align: middle; + + .ui-btn { + width: 402*@unit_base; + height: 74*@unit_base; + margin:auto; + + } + } + } + .center_title_2btn { + + .LESSdisplaybox(); + .LESSbox-orient(vertical); + .LESSbox-align(center); + .LESSbox-pack(center); + + text-align: center; + + // .popup-title + // .popup-text + + .popup-button-bg { + font-size: @font_size_popup_button_text; + background: @color_popup_button_bg; + width: 100%; + padding-top: 11*@unit_base; + padding-bottom: 11*@unit_base; + vertical-align: middle; + + .ui-btn { + width: 274*@unit_base; + height: 74*@unit_base; + margin-top: 0*@unit_base; + margin-bottom: 0*@unit_base; + margin-left: 5*@unit_base; + margin-right: 5*@unit_base; + + display: inline-block; + } + } + } + .center_title_3btn { + + .LESSdisplaybox(); + .LESSbox-orient(vertical); + .LESSbox-align(center); + .LESSbox-pack(center); + + text-align: center; + + // .popup-title + // .popup-text + + .popup-button-bg { + font-size: @font_size_popup_button_text; + background: @color_popup_button_bg; + width: 100%; + padding-top: 11*@unit_base; + padding-bottom: 11*@unit_base; + vertical-align: middle; + + .ui-btn { + width: 186*@unit_base; + height: 74*@unit_base; + margin-top: 0*@unit_base; + margin-bottom: 0*@unit_base; + margin-left: 5*@unit_base; + margin-right: 5*@unit_base; + + display: inline-block; + } + } + } + .center_button_vertical { + + .LESSdisplaybox(); + .LESSbox-orient(vertical); + .LESSbox-align(center); + .LESSbox-pack(center); + + text-align: center; + + // .popup-text + + .popup-button-bg { + font-size: @font_size_popup_button_text; + background: @color_popup_button_bg; + width: 100%; + padding-top: 1px; + padding-bottom: 16*@unit_base; + vertical-align: middle; + + .ui-btn { + width: 356*@unit_base; + height: 74*@unit_base; + margin-top: 16*@unit_base; + margin-bottom: 0*@unit_base; + margin-left: auto; + margin-right: auto; + } + } + } + .center_checkbox { + + .LESSdisplaybox(); + .LESSbox-orient(vertical); + .LESSbox-align(center); + .LESSbox-pack(center); + + text-align: center; + + // .popup-text + + .popup-check-bg { + font-size: @font_size_popup_info_style; + background: @color_popup_text_bg; + width: 100%; + padding-top: 0*@unit_base; + padding-bottom: 22*@unit_base; + vertical-align: middle; + + .ui-checkbox { + .ui-btn { + text-align: center; + background: @color_popup_text_bg; + border: 0*@unit_base; + + .ui-btn-inner { + border: 0*@unit_base; + } + } + } + } + + .popup-button-bg { + font-size: @font_size_popup_button_text; + background: @color_popup_button_bg; + width: 100%; + padding-top: 11*@unit_base; + padding-bottom: 11*@unit_base; + vertical-align: middle; + + .ui-btn { + width: 274*@unit_base; + height: 74*@unit_base; + margin-top: 0*@unit_base; + margin-bottom: 0*@unit_base; + margin-left: 5*@unit_base; + margin-right: 5*@unit_base; + + display: inline-block; + } + } + } + .center_liststyle_1btn { + + .LESSdisplaybox(); + .LESSbox-orient(vertical); + .LESSbox-align(center); + .LESSbox-pack(center); + + text-align: center; + + // .popup-title + + .popup-scroller-bg { + width: 100%; + overflow: hidden; + background: @color_popup_scroller_bg; + + .ui-listview { + height: 512*@unit_base; + } + } + .popup-button-bg { + font-size: @font_size_popup_button_text; + background: @color_popup_button_bg; + width: 100%; + padding-top: 11*@unit_base; + padding-bottom: 11*@unit_base; + vertical-align: middle; + + .ui-btn { + width: 402*@unit_base; + height: 74*@unit_base; + margin:auto; + + } + } + } + .center_liststyle_2btn { + + .LESSdisplaybox(); + .LESSbox-orient(vertical); + .LESSbox-align(center); + .LESSbox-pack(center); + + text-align: center; + + // .popup-title + + .popup-scroller-bg { + width: 100%; + overflow: hidden; + background: black; + + .ui-listview { + height: 512*@unit_base; + } + } + .popup-button-bg { + font-size: @font_size_popup_button_text; + background: @color_popup_button_bg; + width: 100%; + padding-top: 11*@unit_base; + padding-bottom: 11*@unit_base; + vertical-align: middle; + + .ui-btn { + width: 274*@unit_base; + height: 74*@unit_base; + margin-top: 0*@unit_base; + margin-bottom: 0*@unit_base; + margin-left: 5*@unit_base; + margin-right: 5*@unit_base; + + display: inline-block; + } + } + } + .center_liststyle_3btn { + + .LESSdisplaybox(); + .LESSbox-orient(vertical); + .LESSbox-align(center); + .LESSbox-pack(center); + + text-align: center; + + // .popup-title + + .popup-scroller-bg { + width: 100%; + overflow: hidden; + background: black; + + .ui-listview { + height: 512*@unit_base; + } + } + .popup-button-bg { + font-size: @font_size_popup_button_text; + background: @color_popup_button_bg; + width: 100%; + padding-top: 11*@unit_base; + padding-bottom: 11*@unit_base; + vertical-align: middle; + + .ui-btn { + width: 186*@unit_base; + height: 74*@unit_base; + margin-top: 0*@unit_base; + margin-bottom: 0*@unit_base; + margin-left: 5*@unit_base; + margin-right: 5*@unit_base; + + display: inline-block; + } + } + } + + .center_progressbar { + + .LESSdisplaybox(); + .LESSbox-orient(vertical); + .LESSbox-align(center); + .LESSbox-pack(center); + + text-align: center; + + .popup-text { + font-size: @font_size_popup_center_progressbar_title; + font-color: @color_popup_center_progressbar_title; + background: @color_popup_text_bg; + width: 100%; + height: 70*@unit_base; + p { + height: 100%; + text-align: center; + padding: 22*@unit_base 16*@unit_base 0*@unit_base 16*@unit_base; + } + } + + .popup-text-bottom-bg { + font-size: @font_size_popup_center_progressbar_title; + font-color: @color_popup_center_progressbar_title; + background: @color_popup_text_bg; + width: 100%; + vertical-align: middle; + + .text-left { + width: 40%; + height: 48*@unit_base; + padding: 0*@unit_base 16*@unit_base 0*@unit_base 16*@unit_base; + text-align: left; + + display: inline-block; + } + .text-right { + width: 40%; + height: 48*@unit_base; + padding: 0*@unit_base 16*@unit_base 0*@unit_base 16*@unit_base; + text-align: right; + + display: inline-block; + } + + } + + .popup-button-bg { + font-size: @font_size_popup_button_text; + background: @color_popup_button_bg; + width: 100%; + padding-top: 11*@unit_base; + padding-bottom: 11*@unit_base; + vertical-align: middle; + + .ui-btn { + width: 402*@unit_base; + height: 74*@unit_base; + margin:auto; + + } + } + + .popup-progress-bg { + background: @color_popup_text_bg; + width: 100%; + height: 100%; + } + } + + .centertext_progressbar { + + .LESSdisplaybox(); + .LESSbox-orient(vertical); + .LESSbox-align(center); + .LESSbox-pack(center); + + text-align: center; + + .popup-text { + font-size: @font_size_popup_center_progressbar_title; + font-color: @color_popup_center_progressbar_title; + background: @color_popup_text_bg; + width: 100%; + padding-top: 22*@unit_base; + padding-bottom: 16*@unit_base; + p { + text-align: center; + } + } + + .popup-text-bottom-bg { + font-size: @font_size_popup_center_progressbar_title; + font-color: @color_popup_center_progressbar_title; + background: @color_popup_text_bg; + width: 100%; + vertical-align: middle; + + .text-left { + width: 40%; + height: 40*@unit_base; + padding: 16*@unit_base 16*@unit_base 22*@unit_base 16*@unit_base; + text-align: left; + + display: inline-block; + } + .text-right { + width: 40%; + height: 40*@unit_base; + padding: 16*@unit_base 16*@unit_base 22*@unit_base 16*@unit_base; + text-align: right; + + display: inline-block; + } + + } + + .popup-button-bg { + font-size: @font_size_popup_button_text; + background: @color_popup_button_bg; + width: 100%; + padding-top: 11*@unit_base; + padding-bottom: 11*@unit_base; + vertical-align: middle; + + .ui-btn { + width: 402*@unit_base; + height: 74*@unit_base; + margin:auto; + + } + } + + .popup-progress-bg { + background: @color_popup_text_bg; + width: 100%; + height: 100%; + } + } + .ui-btn{ + .LESSpopup_button_style; + } + .ui-btn.ui-btn-hover-s{ + .LESSpopup_button_hover_style; + } + .ui-btn.ui-btn-down-s{ + .LESSpopup_button_press_style; + } +} +.ui-popupwindow > .ui-volumecontrol { + + display: table; + margin: auto; + background: rgba(0, 0, 0, 0.666667); + width: 416*@unit_base; + height: 676*@unit_base; + padding-top: 22*@unit_base; + + h1 { + font-size: @font_size_popup_info_style; + display: table; + margin: auto; + color: #c0c0c0; + } + + .ui-volumecontrol-icon { + display: table; + width: 100%; + height: 128*@unit_base; + padding-top: 21*@unit_base; + padding-bottom: 21*@unit_base; + padding-left: 165*@unit_base; + padding-right: 165*@unit_base; + } + + .ui-volumecontrol-indicator { + display: table; + width: 100%; + height: 420*@unit_base; + padding-left: 68*@unit_base; + padding-right: 68*@unit_base; + } + + .ui-corner-all { + -moz-border-radius: 0.3em !important; + -webkit-border-radius: 0.3em !important; + border-radius: 0.3em !important; + } +} + +.ui-popupwindow-corner-all { + -moz-border-radius: 0em !important; + -webkit-border-radius: 0em !important; + border-radius: 0em !important; +} diff --git a/src/themes/tizen/common/jquery.mobile.tizen.progress.less b/src/themes/tizen/common/jquery.mobile.tizen.progress.less new file mode 100644 index 0000000..3e2226e --- /dev/null +++ b/src/themes/tizen/common/jquery.mobile.tizen.progress.less @@ -0,0 +1,93 @@ +@import "config.less"; + +/* Progress - circle style */ +@img-height: 64 * @unit_base; +@img-width: 64 * @unit_base; +@bar-vmargin: 16 * @unit_base; +@bar-hmargin: 1 * @unit_base; + +@-webkit-keyframes ui-rotate-animation { + from { + -webkit-transform: rotate(0deg); + } to { + -webkit-transform: rotate(360deg); + } +} + +.ui-progress-container-circle { + position: absolute; + right: 16 * @unit_base; + top: 25%; +} + +.ui-progress-circle { + position: relative; + top: 0; + + height: @img-height; + width: @img-width; + + background: url(images/00_winset_list_process_01.png) no-repeat; + .LESSbackground-size(@img-width, @img-height); +} +.ui-progress-circle-running { + -webkit-animation: ui-rotate-animation 1s infinite linear; +} + +/* Progress - pending style */ +@bar-height: 16 * @unit_base; +@bar-margin: 16 * @unit_base; +@color_progress_bar1: rgb(0, 140, 210); + +@-webkit-keyframes ui-move-animation { + from { + -webkit-transform: translateY(-@bar-height * 2); + } to { + -webkit-transform: translateY(0); + } +} + +.ui-progress-container-pending { + position: relative; + margin-left: @bar-margin; + margin-right: @bar-margin; + height: @bar-height; + overflow: hidden; +} + +.ui-progress-pending { + position: relative; + top: 0; + width: 100%; + height: @bar-height * 3; + padding-top: 0; + padding-bottom: 0; + + background: -webkit-linear-gradient(-45deg, + transparent, + transparent 25%, + @color_progress_bar1 25%, + @color_progress_bar1 50%, + transparent 50%, + transparent 75%, + @color_progress_bar1 75%); + + background: -webkit-gradient(linear, + left top, + right bottom, + color-stop(0%, rgba(0,0,0,0)), + color-stop(25%, rgba(0,0,0,0)), + color-stop(25%, @color_progress_bar1), + color-stop(50%, @color_progress_bar1), + color-stop(50%, rgba(0,0,0,0)), + color-stop(75%, rgba(0,0,0,0)), + color-stop(75%, @color_progress_bar1)); + + background-color: @color_progress_bar0; + + .LESSbackground-size(@bar-height * 2, @bar-height * 2); +} +.ui-progress-pending-running { + -webkit-animation: ui-move-animation 0.5s infinite linear; +} + diff --git a/src/themes/tizen/common/jquery.mobile.tizen.progressbar.less b/src/themes/tizen/common/jquery.mobile.tizen.progressbar.less new file mode 100644 index 0000000..c8332c4 --- /dev/null +++ b/src/themes/tizen/common/jquery.mobile.tizen.progressbar.less @@ -0,0 +1,45 @@ +@import "config.less"; + +@bar-height: 16 * @unit_base; +@bar-margin: 16 * @unit_base; + +@-webkit-keyframes ui-scale-animation { + from { + -webkit-transform: scaleX(0); + } to { + -webkit-transform: scaleX(1); + } +} + +.ui-progressbar-value { + background-image: url(images/00_winset_list_progress_bar.png); + height: 100%; +} + +.ui-progressbar { + position: relative; + background-image: url(images/00_winset_list_progress_bg.png); + margin-left: @bar-margin; + margin-right: @bar-margin; + height: @bar-height; +} + +.ui-progress-bg { + position: relative; + top: 0; + background-image: url(images/00_winset_list_progress_bg.png); + width: 100%; + height: @bar-height; +} + +.ui-progress-bar { + position: relative; + top: -@bar-height; + width: 100%; + height: @bar-height; + + background-image: url(images/00_winset_list_progress_bar.png); + + -webkit-animation: ui-scale-animation 5s infinite linear; + -webkit-transform-origin: 0% 0%; +} diff --git a/src/themes/tizen/common/jquery.mobile.tizen.scrollview.handler.less b/src/themes/tizen/common/jquery.mobile.tizen.scrollview.handler.less new file mode 100755 index 0000000..eb2f793 --- /dev/null +++ b/src/themes/tizen/common/jquery.mobile.tizen.scrollview.handler.less @@ -0,0 +1,52 @@ +@import "config.less"; + +.ui-handler { + position : absolute; + overflow : hidden; +} + +.ui-handler-y { + top : 10 * @unit_base; + right : 10 * @unit_base; + bottom : 10 * @unit_base; + width : 48 * @unit_base; +} + +.ui-handler-x { + right : 10 * @unit_base; + bottom : 10 * @unit_base; + left : 10 * @unit_base; + height : 48 * @unit_base; +} + +.ui-handler-track { + position : relative; + width : 100%; + height : 100%; +} + +.ui-handler-thumb { + position : absolute; + top : 0; + left : 0; + background-color : @color_scrollview_handler_bg; + background-position : center; + background-repeat : no-repeat; + -moz-border-radius : 5 * @unit_base; + -webkit-border-radius : 5 * @unit_base; + border-radius : 5 * @unit_base; +} + +.ui-handler-y .ui-handler-thumb { + width : 48 * @unit_base; + height : 214 * @unit_base; + background-image : url("images/00_scroll_bar_handler.png"); + background-size : 48 * @unit_base 40 * @unit_base; +} + +.ui-handler-x .ui-handler-thumb { + width : 214 * @unit_base; + height : 48 * @unit_base; + background-image : url("images/00_scroll_bar_handler_hor.png"); + background-size : 40 * @unit_base 48 * @unit_base; +} diff --git a/src/themes/tizen/common/jquery.mobile.tizen.scrollview.less b/src/themes/tizen/common/jquery.mobile.tizen.scrollview.less new file mode 100644 index 0000000..7114498 --- /dev/null +++ b/src/themes/tizen/common/jquery.mobile.tizen.scrollview.less @@ -0,0 +1,120 @@ +@import "config.less"; + +.ui-scrollview-clip { + position: relative; +} + +.ui-scrollview-view { +} + +.ui-scrolllistview .ui-li-divider { + z-index: 10; +} + +.ui-scrollbar { + position: absolute; + overflow: hidden; + + opacity: 0; +} + +.ui-scrollbar-visible { + opacity: 1; +} + +.ui-scrollbar-y { + top: 2 * @unit_base; + right: 2 * @unit_base; + bottom: 2 * @unit_base; + width: 10 * @unit_base; +} + +.ui-scrollbar-x { + right: 2 * @unit_base; + bottom: 2 * @unit_base; + left: 2 * @unit_base; + height: 10 * @unit_base; +} + +.ui-scrollbar-track { + position: relative; + width: 100%; + height: 100%; +} + +.ui-scrollbar-thumb { + position: absolute; + top: 0; + left: 0; + background-color: @color_scrollbar; +} + +.ui-scrollbar-y .ui-scrollbar-thumb { + width: 10 * @unit_base; + height: 100%; +} + +.ui-scrollbar-x .ui-scrollbar-thumb { + width: 100%; + height: 10 * @unit_base; +} + +.ui-scroll-jump-top-bg { + position: absolute; + top: 16 * @unit_base; + right: 16 * @unit_base; + width: 76 * @unit_base; + height: 70 * @unit_base; + background: url(images/00_scroll_jump_bg.png) no-repeat; + .LESSbackground-size(76 * @unit_base, 70 * @unit_base); +} + +.ui-scroll-jump-left-bg { + position: absolute; + bottom: 16 * @unit_base; + left: 16 * @unit_base; + width: 76 * @unit_base; + height: 70 * @unit_base; + background: url(images/00_scroll_jump_bg.png) no-repeat; + .LESSbackground-size(76 * @unit_base, 70 * @unit_base); +} + +.ui-scroll-jump-top, +.ui-scroll-jump-left { + position: relative; + top: 14 * @unit_base; + left: 17 * @unit_base; + width: 42 * @unit_base; + height: 42 * @unit_base; + background: url(images/00_scroll_icon_jump.png) no-repeat; + .LESSbackground-size(42 * @unit_base, 42 * @unit_base); +} + +.ui-scroll-jump-left { + background: url(images/00_scroll_icon_jump_left.png) no-repeat; + .LESSbackground-size(42 * @unit_base, 42 * @unit_base); +} + +/* + * the values below are for the group index + */ + +/* + * padding here set to zero - otherwise the list scrolls underneith the top heading and can be seen above it + */ +.ui-content.ui-scrollview-clip { + padding: 0; + padding-bottom: 16 * @unit_base; +} +.ui-content.ui-scrollview-clip > div.ui-scrollview-view { + margin: 0; + padding: 16 * @unit_base; +} + +/* + * this seems to effect how far the top divider is place wrt to the scrollview + * without this, it is placed too high, so it is clipped in half + */ +.ui-content.ui-scrollview-clip > .ui-listview.ui-scrollview-view { + margin: 0; +} diff --git a/src/themes/tizen/common/jquery.mobile.tizen.shortcutscroll.less b/src/themes/tizen/common/jquery.mobile.tizen.shortcutscroll.less new file mode 100644 index 0000000..7e5e375 --- /dev/null +++ b/src/themes/tizen/common/jquery.mobile.tizen.shortcutscroll.less @@ -0,0 +1,67 @@ +@import "config.less"; + +.ui-shortcutscroll { + position: absolute; + right: 0*@unit_base; + background-color: @color_shortcutscroll_rollover_bg; + width: 30*@unit_base; + -webkit-user-select: none; + margin:0; + padding-right: 0.08em; + opacity: 1; + ul { + list-style-type: none; + margin: 0; + padding: 0; + } + li { + cursor: pointer; + color: @color_shortcutscroll_rollover_text; + padding: 2*@unit_base 2*@unit_base 2*@unit_base 2*@unit_base; + text-align: right; + } +} + +.ui-shortcutscroll2 { + position: absolute; + right: 0*@unit_base; + -webkit-user-select: none; + margin:0; + padding-right: 0.08em; + opacity: 1; + ul { + list-style-type: none; + margin: 0; + padding: 0; + } + li { + cursor: pointer; + color: @color_shortcutscroll_rollover_text; + padding: 2*@unit_base 2*@unit_base 2*@unit_base 2*@unit_base; + text-align: right; + } +} + +.ui-shortcutscroll-bg { + position: absolute; + right: 0*@unit_base; + background-color: @color_shortcutscroll_rollover_bg; + width: 30*@unit_base; + z-index: 10; + top: 0; +} + +.ui-shortcutscroll-popup { + position: absolute; + background: @color_shortcutscroll_popup_bg; + color: @color_shortcutscroll_popup_text; + padding:10*@unit_base 30*@unit_base; + -moz-box-shadow: 8*@unit_base 10*@unit_base 0*@unit_base @color_shortcutscroll_popup_shadow; + -webkit-box-shadow: 8*@unit_base 10*@unit_base 0*@unit_base @color_shortcutscroll_popup_shadow; + box-shadow: 8*@unit_base 10*@unit_base 0*@unit_base @color_shortcutscroll_popup_shadow; + text-align: center; + font-size: 75*@unit_base; + font-weight: bold; + display:none; + box-sizing:border-box; +} diff --git a/src/themes/tizen/common/jquery.mobile.tizen.slider.less b/src/themes/tizen/common/jquery.mobile.tizen.slider.less new file mode 100644 index 0000000..cdf7f8e --- /dev/null +++ b/src/themes/tizen/common/jquery.mobile.tizen.slider.less @@ -0,0 +1,147 @@ +@import "config.less"; + +@popup-size: 102 * @unit_base; +@padding-size: 18 * @unit_base; +@img-height: 80 * @unit_base; +@img-width: 80 * @unit_base; + +label.ui-slider { + display: block; +} + +input.ui-slider-input { + display: inline-block; + width: 50 * @unit_base; +} + +select.ui-slider-switch { + display: none; +} + +.ui-slider-bg, +.ui-slider-icon-bg { + position: relative; + margin-left: 32 * @unit_base; + margin-right: 32 * @unit_base; + margin-bottom: 0.2em; + vertical-align: middle; +} + +.ui-slider-icon-bg { + margin-left: 96 * @unit_base; + margin-right: 96 * @unit_base; +} + +.ui-slider-left-volume, +.ui-slider-left-bright { + position: absolute; + top: -0.2em; + left: -96 * @unit_base; + height: @img-height; + width: @img-width; + vertical-align: middle; + background: url(images/00_slider_btn_brightness01.png) no-repeat; + .LESSbackground-size(@img-width, @img-height); +} + +.ui-slider-left-volume { + background: url(images/00_slider_btn_volume01.png) no-repeat; + .LESSbackground-size(@img-width, @img-height); +} + +.ui-slider-right-volume, +.ui-slider-right-bright { + position: absolute; + top: -0.2em; + right: -96 * @unit_base; + height: @img-height; + width: @img-width; + vertical-align: middle; + background: url(images/00_slider_btn_brightness02.png) no-repeat; + .LESSbackground-size(@img-width, @img-height); +} + +.ui-slider-right-volume { + background: url(images/00_slider_btn_volume02.png) no-repeat; + .LESSbackground-size(@img-width, @img-height); +} + +.ui-slider-left-text { + position: absolute; + top: -0.2em; + left: -96 * @unit_base; + height: 80 * @unit_base; + width: 80 * @unit_base; + text-align: center; + color: rgb(100, 100, 100); +} + +.ui-slider-right-text { + position: absolute; + top: -0.2em; + right: -96 * @unit_base; + height: 80 * @unit_base; + width: 80 * @unit_base; + text-align: center; + color: rgb(100, 100, 100); +} + +div.ui-slider { + display: inline-block; + overflow: visible; + height: 16 * @unit_base; + width: 100%; + background-image: url(images/00_winset_list_progress_bg.png); + + .ui-btn { + top: 0.15em !important; + } + .ui-btn-inner { + padding: 0.3em 0 * @unit_base; + } + .ui-btn-text { + color: @color_slider_handle_text; + } +} + +a.ui-slider-handle { + position: relative; + z-index: 10; + top: -21 * @unit_base; + width: 58 * @unit_base; + height: 58 * @unit_base; + margin-top: -29 * @unit_base; + margin-left: -29 * @unit_base; + color: @color_slider_handle_text; + background: url(images/00_slider_handle.png) no-repeat; + .LESSbackground-size(58 * @unit_base, 58 * @unit_base); +} + +.ui-slider-popup { + position: absolute !important; + width: @popup-size; + height: @popup-size; + text-align: center; + padding-top: 0.6em; + z-index: 100; + color: @color_slider_popup_text; + background: url(images/00_slider_popup_bg.png) no-repeat; + .LESSbackground-size(@popup-size, @popup-size); +} + +.ui-slider-bar { + position: absolute; + top: 0.75em; + height: 16 * @unit_base; + width: 0; + background-image: url(images/00_winset_list_progress_bar.png); +} + +.ui-slider-handle-press { + position: absolute; + z-index: 15; + width: 58 * @unit_base; + height: 58 * @unit_base; + background: url(images/00_slider_handle_press.png) no-repeat; + .LESSbackground-size(58 * @unit_base, 58 * @unit_base); +} diff --git a/src/themes/tizen/common/jquery.mobile.tizen.swipelist.less b/src/themes/tizen/common/jquery.mobile.tizen.swipelist.less new file mode 100755 index 0000000..5e133ac --- /dev/null +++ b/src/themes/tizen/common/jquery.mobile.tizen.swipelist.less @@ -0,0 +1,41 @@ +@import "config.less"; + +@list-li-padding-horizontal: 16 * @unit_base; + +.ui-swipelist { + list-style-type: none; +} + +.ui-swipelist-item { + height: 52 * @unit_base; + -webkit-user-select: none; + -user-select: none; + + .ui-btn { + margin-top: -1.5em !important; + } +} + +.ui-swipelist-item-cover { + position: absolute; + border: none; + top: 0%; + left: 0%; + width: 100%; + height: 100%; + z-index: 100; + + .ui-swipelist-item-cover-inner { + position : absolute; + padding-top : 30 * @unit_base; + padding-bottom : 30 * @unit_base; + padding-left : 16 * @unit_base; + + width : 100%; + + .ui-li-text-sub { + position : absolute; + padding-right : 16 * @unit_base; + } + } +} diff --git a/src/themes/tizen/common/jquery.mobile.tizen.toggleswitch.less b/src/themes/tizen/common/jquery.mobile.tizen.toggleswitch.less new file mode 100644 index 0000000..1a4943f --- /dev/null +++ b/src/themes/tizen/common/jquery.mobile.tizen.toggleswitch.less @@ -0,0 +1,102 @@ +@import "config.less"; + +.ui-toggleswitch { + height: 80 * @unit_base; + width: 60 * @unit_base; + overflow: hidden; + .ui-toggleswitch-mover { + position: relative; + font-size : 26 * @unit_base; + line-height : 40 * @unit_base; + display: block; + + .ui-toggleswitch-off { + border-radius: 5 * @unit_base; + color: @color_text_sub; + .LESStoggleswitch_off_style; + height: 80 * @unit_base; + .ui-toggleswitch-img{ + width: 100%; + position: absolute; + padding-top: 7 * @unit_base; + .ui-toggleswitch-sign{ + position: absolute; + width: 4px; + height: 12px; + left: 50%; + margin-left:-2px; + background: url(images/00_switch_button_off.png) no-repeat; + background-size: cover; + -webkit-background-size: cover; + -o-background-size: cover; + -moz-background-size: cover; + } + } + } + + .ui-toggleswitch-on { + display: none; + border-radius: 5 * @unit_base; + .LESStoggleswitch_on_style; + height: 80 * @unit_base; + color: white; + .ui-toggleswitch-img{ + width: 100%; + position: absolute; + padding-top: 6 * @unit_base; + text-align: center; + .ui-toggleswitch-sign{ + position: absolute; + width: 15px; + height: 15px; + left: 50%; + margin-left:-7px; + background: url(images/00_switch_button_on.png) no-repeat; + background-size: cover; + -webkit-background-size: cover; + -o-background-size: cover; + -moz-background-size: cover; + } + } + } + + .ui-toggleswitch-reed { + position: absolute; + border-radius: 5 * @unit_base; + width: 57 * @unit_base; + .LESStoggleswitch_reed_style; + top: 40 * @unit_base; + height: 39 * @unit_base; + left: 1px; + } + + .ui-toggleswitch-text { + width: 100%; + position: absolute; + text-align: center; + text-overflow: ellipsis; + } + } +} + +.ui-toggleswitch-state-checked { + .ui-toggleswitch-mover { + .ui-toggleswitch-reed { + top: 1px; + } + + .ui-toggleswitch-text { + top: 40 * @unit_base; + } + .ui-toggleswitch-img{ + top: 40 * @unit_base; + } + .ui-toggleswitch-on { + display: block; + } + + .ui-toggleswitch-off { + display: none; + } + } +} diff --git a/src/themes/tizen/common/jquery.mobile.tizen.triangle.less b/src/themes/tizen/common/jquery.mobile.tizen.triangle.less new file mode 100755 index 0000000..baa4e5d --- /dev/null +++ b/src/themes/tizen/common/jquery.mobile.tizen.triangle.less @@ -0,0 +1,64 @@ +@triangle-size: 10px; + +.ui-triangle-container { + position: relative; + + .ui-triangle { + position: absolute; + border-style: solid; + border-color: transparent; + border-width: @triangle-size; + } + + .ui-triangle-top { + top: 0px; + border-top-width: 0px; + border-left-color: transparent; + border-right-color: transparent; + margin-left: -@triangle-size; + } + + .ui-triangle-bottom { + bottom: 0px; + border-bottom-width: 0px; + border-left-color: transparent; + border-right-color: transparent; + margin-left: -@triangle-size; + } + + .ui-triangle-left { + left: 0px; + margin-top: -@triangle-size; + border-left-width: 0px; + border-left-color: transparent; + border-right-color: transparent; + } + + .ui-triangle-right { + right: 0px; + margin-top: -@triangle-size; + border-right-width: 0px; + border-left-color: transparent; + border-right-color: transparent; + } +} + +.ui-triangle-container-top { + height: @triangle-size; + top: 0px; + margin-top: -@triangle-size; +} + +.ui-triangle-container-bottom { + height: @triangle-size; + bottom: 0px; + margin-bottom: -@triangle-size; +} + +.ui-triangle-container-left { + width: @triangle-size; +} + +.ui-triangle-container-right { + width: @triangle-size; +} diff --git a/src/themes/tizen/common/jquery.mobile.tizen.virtualgridview.less b/src/themes/tizen/common/jquery.mobile.tizen.virtualgridview.less new file mode 100755 index 0000000..ecfb5f5 --- /dev/null +++ b/src/themes/tizen/common/jquery.mobile.tizen.virtualgridview.less @@ -0,0 +1,37 @@ +/* + * jQuery Mobile Framework + * Copyright (c) jQuery Project + * Dual licensed under the MIT (MIT-LICENSE.txt) or GPL (GPL-LICENSE.txt) + * licenses. + */ + +/*** less definitions ***/ + +@import "config.less"; + +.ui-virtualgrid { + overflow : hidden; + position : absolute; +} + +.ui-virtualgrid-wrapblock { + position : absolute; + left : 0; +} + +.ui-virtualgrid-wrapblock-x { + float : left; + overflow: hidden; +} + +.ui-virtualgrid-content { + background-color : @color_virtualgrid_bg; +} + +.ui-scrollbar-thumb-x { + width : 1.5rem !important; +} + +.ui-scrollbar-thumb-y { + height : 1.5rem !important; +} diff --git a/src/themes/tizen/common/jquery.mobile.tizen.virtuallistview.less b/src/themes/tizen/common/jquery.mobile.tizen.virtuallistview.less new file mode 100755 index 0000000..6a29de3 --- /dev/null +++ b/src/themes/tizen/common/jquery.mobile.tizen.virtuallistview.less @@ -0,0 +1,19 @@ +/* +* jQuery Mobile Framework +* Copyright (c) jQuery Project +* Dual licensed under the MIT (MIT-LICENSE.txt) or GPL (GPL-LICENSE.txt) licenses. +*/ + +/*** less definitions ***/ + +@import "config.less"; +ul.ui-virtual-list-container > li.position_absolute +{ + position : absolute; +} + +ul.ui-virtual-list-container > ul.position_absolute +{ + position : absolute; +} + diff --git a/src/themes/tizen/common/jquery.mobile.transitions.css b/src/themes/tizen/common/jquery.mobile.transitions.css new file mode 100644 index 0000000..417bff7 --- /dev/null +++ b/src/themes/tizen/common/jquery.mobile.transitions.css @@ -0,0 +1,616 @@ +/* Transitions originally inspired by those from jQtouch, nice work, folks */ +.ui-mobile-viewport-transitioning, +.ui-mobile-viewport-transitioning .ui-page { + width: 100%; + height: 100%; + overflow: hidden; +} + +.in { + -webkit-animation-timing-function: ease-out; + -webkit-animation-duration: 350ms; + -moz-animation-timing-function: ease-out; + -moz-animation-duration: 350ms; +} + +.out { + -webkit-animation-timing-function: ease-in; + -webkit-animation-duration: 225ms; + -moz-animation-timing-function: ease-in; + -moz-animation-duration: 225; +} + + +/* fade */ + +@-webkit-keyframes fadein { + from { opacity: 0; } + to { opacity: 1; } +} + +@-moz-keyframes fadein { + from { opacity: 0; } + to { opacity: 1; } +} + +@-webkit-keyframes fadeout { + from { opacity: 1; } + to { opacity: 0; } +} + +@-moz-keyframes fadeout { + from { opacity: 1; } + to { opacity: 0; } +} + +.fade.out { + opacity: 0; + -webkit-animation-duration: 125ms; + -webkit-animation-name: fadeout; + -moz-animation-duration: 125ms; + -moz-animation-name: fadeout; +} + +.fade.in { + opacity: 1; + -webkit-animation-duration: 225ms; + -webkit-animation-name: fadein; + -moz-animation-duration: 225ms; + -moz-animation-name: fadein; +} + + +/* flip */ + +/* The properties in this rule are only necessary for the 'flip' transition. + * We need specify the perspective to create a projection matrix. This will add + * some depth as the element flips. The depth number represents the distance of + * the viewer from the z-plane. According to the CSS3 spec, 1000 is a moderate + * value. + */ + +.viewport-flip { + -webkit-perspective: 1000; + -moz-perspective: 1000; + position: absolute; +} +.flip { + -webkit-backface-visibility:hidden; + -webkit-transform:translate3d(0, 0, 0); /* Needed to work around an iOS 3.1 bug that causes listview thumbs to disappear when -webkit-visibility:hidden is used. */ + -moz-backface-visibility:hidden; + -moz-transform:translate3d(0, 0, 0); +} + +.flip.out { + -webkit-transform: rotateY(-90deg) scale(.9); + -webkit-animation-name: flipouttoleft; + -webkit-animation-duration: 175ms; + -moz-transform: rotateY(-90deg) scale(.9); + -moz-animation-name: flipouttoleft; + -moz-animation-duration: 175ms; +} + +.flip.in { + -webkit-animation-name: flipintoright; + -webkit-animation-duration: 225ms; + -moz-animation-name: flipintoright; + -moz-animation-duration: 225ms; +} + +.flip.out.reverse { + -webkit-transform: rotateY(90deg) scale(.9); + -webkit-animation-name: flipouttoright; + -moz-transform: rotateY(90deg) scale(.9); + -moz-animation-name: flipouttoright; +} + +.flip.in.reverse { + -webkit-animation-name: flipintoleft; + -moz-animation-name: flipintoleft; +} + +@-webkit-keyframes flipouttoleft { + from { -webkit-transform: rotateY(0); } + to { -webkit-transform: rotateY(-90deg) scale(.9); } +} +@-moz-keyframes flipouttoleft { + from { -moz-transform: rotateY(0); } + to { -moz-transform: rotateY(-90deg) scale(.9); } +} +@-webkit-keyframes flipouttoright { + from { -webkit-transform: rotateY(0) ; } + to { -webkit-transform: rotateY(90deg) scale(.9); } +} +@-moz-keyframes flipouttoright { + from { -moz-transform: rotateY(0); } + to { -moz-transform: rotateY(90deg) scale(.9); } +} +@-webkit-keyframes flipintoleft { + from { -webkit-transform: rotateY(-90deg) scale(.9); } + to { -webkit-transform: rotateY(0); } +} +@-moz-keyframes flipintoleft { + from { -moz-transform: rotateY(-90deg) scale(.9); } + to { -moz-transform: rotateY(0); } +} +@-webkit-keyframes flipintoright { + from { -webkit-transform: rotateY(90deg) scale(.9); } + to { -webkit-transform: rotateY(0); } +} +@-moz-keyframes flipintoright { + from { -moz-transform: rotateY(90deg) scale(.9); } + to { -moz-transform: rotateY(0); } +} + + +/* flow transition */ + +.flow { + -webkit-transform-origin: 50% 30%; + -moz-transform-origin: 50% 30%; + -webkit-box-shadow: 0 0 20px rgba(0,0,0,.4); + -moz-box-shadow: 0 0 20px rgba(0,0,0,.4); +} +.ui-dialog.flow { + -webkit-transform-origin: none; + -moz-transform-origin: none; + -webkit-box-shadow: none; + -moz-box-shadow: none; +} +.flow.out { + -webkit-transform: translate3d(-100%, 0, 0) scale(.7); + -webkit-animation-name: flowouttoleft; + -webkit-animation-timing-function: ease; + -webkit-animation-duration: 350ms; + -moz-transform: translate3d(-100%, 0, 0) scale(.7); + -moz-animation-name: flowouttoleft; + -moz-animation-timing-function: ease; + -moz-animation-duration: 350ms; +} + +.flow.in { + -webkit-transform: translate3d(0, 0, 0) scale(1); + -webkit-animation-name: flowinfromright; + -webkit-animation-timing-function: ease; + -webkit-animation-duration: 350ms; + -moz-transform: translate3d(0, 0, 0) scale(1); + -moz-animation-name: flowinfromright; + -moz-animation-timing-function: ease; + -moz-animation-duration: 350ms; +} + +.flow.out.reverse { + -webkit-transform: translate3d(100%, 0, 0); + -webkit-animation-name: flowouttoright; + -moz-transform: translate3d(100%, 0, 0); + -moz-animation-name: flowouttoright; +} + +.flow.in.reverse { + -webkit-animation-name: flowinfromleft; + -moz-animation-name: flowinfromleft; +} + +@-webkit-keyframes flowouttoleft { + 0% { -webkit-transform: translate3d(0, 0, 0) scale(1); } + 60%, 70% { -webkit-transform: translate3d(0, 0, 0) scale(.7); } + 100% { -webkit-transform: translate3d(-100%, 0, 0) scale(.7); } +} +@-moz-keyframes flowouttoleft { + 0% { -moz-transform: translate3d(0, 0, 0) scale(1); } + 60%, 70% { -moz-transform: translate3d(0, 0, 0) scale(.7); } + 100% { -moz-transform: translateX(-100%) scale(.7); } +} + +@-webkit-keyframes flowouttoright { + 0% { -webkit-transform: translate3d(0, 0, 0) scale(1); } + 60%, 70% { -webkit-transform: translate3d(0, 0, 0) scale(.7); } + 100% { -webkit-transform: translate3d(100%, 0, 0) scale(.7); } +} +@-moz-keyframes flowouttoright { + 0% { -moz-transform: translate3d(0, 0, 0) scale(1); } + 60%, 70% { -moz-transform: translate3d(0, 0, 0) scale(.7); } + 100% { -moz-transform: translate3d(100%, 0, 0) scale(.7); } +} + +@-webkit-keyframes flowinfromleft { + 0% { -webkit-transform: translate3d(-100%, 0, 0) scale(.7); } + 30%, 40% { -webkit-transform: translate3d(0, 0, 0) scale(.7); } + 100% { -webkit-transform: translate3d(0, 0, 0) scale(1); } +} +@-moz-keyframes flowinfromleft { + 0% { -moz-transform: translate3d(-100%, 0, 0) scale(.7); } + 30%, 40% { -moz-transform: translate3d(0, 0, 0) scale(.7); } + 100% { -moz-transform: translate3d(0, 0, 0) scale(1); } +} +@-webkit-keyframes flowinfromright { + 0% { -webkit-transform: translate3d(100%, 0, 0) scale(.7); } + 30%, 40% { -webkit-transform: translate3d(0, 0, 0) scale(.7); } + 100% { -webkit-transform: translate3d(0, 0, 0) scale(1); } +} +@-moz-keyframes flowinfromright { + 0% { -moz-transform: translate3d(100%, 0, 0) scale(.7); } + 30%, 40% { -moz-transform: translate3d(0, 0, 0) scale(.7); } + 100% { -moz-transform: translate3d(0, 0, 0) scale(1); } +} + + +/* pop */ + +.pop { + -webkit-transform-origin: 50% 50%; + -moz-transform-origin: 50% 50%; +} + +.pop.in { + -webkit-transform: scale(1); + -moz-transform: scale(1); + opacity: 1; + -webkit-animation-name: popin; + -moz-animation-name: popin; + -webkit-animation-duration: 350ms; + -moz-animation-duration: 350ms; +} + +.pop.out { + -webkit-animation-name: fadeout; + -moz-animation-name: fadeout; + opacity: 0; + -webkit-animation-duration: 100ms; + -moz-animation-duration: 100ms; +} + +.pop.in.reverse { + -webkit-animation-name: fadein; + -moz-animation-name: fadein; +} + +.pop.out.reverse { + -webkit-transform: scale(.8); + -moz-transform: scale(.8); + -webkit-animation-name: popout; + -moz-animation-name: popout; +} + +@-webkit-keyframes popin { + from { + -webkit-transform: scale(.8); + opacity: 0; + } + to { + -webkit-transform: scale(1); + opacity: 1; + } +} + +@-moz-keyframes popin { + from { + -moz-transform: scale(.8); + opacity: 0; + } + to { + -moz-transform: scale(1); + opacity: 1; + } +} + +@-webkit-keyframes popout { + from { + -webkit-transform: scale(1); + opacity: 1; + } + to { + -webkit-transform: scale(.8); + opacity: 0; + } +} + +@-moz-keyframes popout { + from { + -moz-transform: scale(1); + opacity: 1; + } + to { + -moz-transform: scale(.8); + opacity: 0; + } +} + + +/* slide */ + +/* keyframes for slidein from sides */ +@-webkit-keyframes slideinfromright { + from { -webkit-transform: translate3d(100%, 0, 0); } + to { -webkit-transform: translate3d(0, 0, 0); } +} +@-moz-keyframes slideinfromright { + from { -moz-transform: translate3d(100%, 0, 0); } + to { -moz-transform: translate3d(0, 0, 0); } +} + +@-webkit-keyframes slideinfromleft { + from { -webkit-transform: translate3d(-100%, 0, 0); } + to { -webkit-transform: translate3d(0, 0, 0); } +} +@-moz-keyframes slideinfromleft { + from { -moz-transform: translate3d(-100%, 0, 0); } + to { -moz-transform: translate3d(0, 0, 0); } +} + +/* keyframes for slideout to sides */ +@-webkit-keyframes slideouttoleft { + from { -webkit-transform: translate3d(0, 0, 0); } + to { -webkit-transform: translate3d(-100%, 0, 0); } +} +@-moz-keyframes slideouttoleft { + from { -moz-transform: translate3d(0, 0, 0); } + to { -moz-transform: translate3d(-100%, 0, 0); } +} + +@-webkit-keyframes slideouttoright { + from { -webkit-transform: translate3d(0, 0, 0); } + to { -webkit-transform: translate3d(100%, 0, 0); } +} +@-moz-keyframes slideouttoright { + from { -moz-transform: translate3d(0, 0, 0); } + to { -moz-transform: translate3d(100%, 0, 0); } +} + +.slide.out, .slide.in { + -webkit-animation-timing-function: ease-out; + -webkit-animation-duration: 350ms; + -moz-animation-timing-function: ease-out; + -moz-animation-duration: 350ms; +} +.slide.out { + -webkit-transform: translate3d(-100%, 0, 0); + -webkit-animation-name: slideouttoleft; + -moz-transform: translate3d(-100%, 0, 0); + -moz-animation-name: slideouttoleft; +} + +.slide.in { + -webkit-transform: translate3d(0, 0, 0); + -webkit-animation-name: slideinfromright; + -moz-transform: translate3d(0, 0, 0); + -moz-animation-name: slideinfromright; +} + +.slide.out.reverse { + -webkit-transform: translate3d(100%, 0, 0); + -webkit-animation-name: slideouttoright; + -moz-transform: translate3d(100%, 0, 0); + -moz-animation-name: slideouttoright; +} + +.slide.in.reverse { + -webkit-transform: translate3d(0, 0, 0); + -webkit-animation-name: slideinfromleft; + -moz-transform: translate3d(0, 0, 0); + -moz-animation-name: slideinfromleft; +} + +/* slide down */ + +.slidedown.out { + -webkit-animation-name: fadeout; + -moz-animation-name: fadeout; + -webkit-animation-duration: 100ms; + -moz-animation-duration: 100ms; +} + +.slidedown.in { + -webkit-transform: translate3d(0, 0, 0); + -webkit-animation-name: slideinfromtop; + -moz-transform: translate3d(0, 0, 0); + -moz-animation-name: slideinfromtop; + -webkit-animation-duration: 250ms; + -moz-animation-duration: 250ms; +} + +.slidedown.in.reverse { + -webkit-animation-name: fadein; + -moz-animation-name: fadein; + -webkit-animation-duration: 150ms; + -moz-animation-duration: 150ms; +} + +.slidedown.out.reverse { + -webkit-transform: translate3d(0, -100%, 0); + -moz-transform: translate3d(0, -100%, 0); + -webkit-animation-name: slideouttotop; + -moz-animation-name: slideouttotop; + -webkit-animation-duration: 200ms; + -moz-animation-duration: 200ms; +} + +@-webkit-keyframes slideinfromtop { + from { -webkit-transform: translate3d(0, -100%, 0); } + to { -webkit-transform: translate3d(0, 0, 0); } +} +@-moz-keyframes slideinfromtop { + from { -moz-transform: translate3d(0, -100%, 0); } + to { -moz-transform: translate3d(0, 0, 0); } +} + +@-webkit-keyframes slideouttotop { + from { -webkit-transform: translate3d(0, 0, 0); } + to { -webkit-transform: translate3d(0, -100%, 0); } +} +@-moz-keyframes slideouttotop { + from { -moz-transform: translate3d(0, 0, 0); } + to { -moz-transform: translate3d(0, -100%, 0); } +} + +/* slide up */ + +.slideup.out { + -webkit-animation-name: fadeout; + -moz-animation-name: fadeout; + -webkit-animation-duration: 100ms; + -moz-animation-duration: 100ms; +} + +.slideup.in { + -webkit-transform: translate3d(0, 0, 0); + -webkit-animation-name: slideinfrombottom; + -moz-transform: translate3d(0, 0, 0); + -moz-animation-name: slideinfrombottom; + -webkit-animation-duration: 250ms; + -moz-animation-duration: 250ms; +} + +.slideup.in.reverse { + -webkit-animation-name: fadein; + -moz-animation-name: fadein; + -webkit-animation-duration: 150ms; + -moz-animation-duration: 150ms; +} + +.slideup.out.reverse { + -webkit-transform: translate3d(0, 100%, 0); + -moz-transform: translate3d(0, 100%, 0); + -webkit-animation-name: slideouttobottom; + -moz-animation-name: slideouttobottom; + -webkit-animation-duration: 200ms; + -moz-animation-duration: 200ms; +} + +@-webkit-keyframes slideinfrombottom { + from { -webkit-transform: translate3d(0, 100%, 0); } + to { -webkit-transform: translate3d(0, 0, 0); } +} +@-moz-keyframes slideinfrombottom { + from { -moz-transform: translate3d(0, 100%, 0); } + to { -moz-transform: translate3d(0, 0, 0); } +} + +@-webkit-keyframes slideouttobottom { + from { -webkit-transform: translate3d(0, 0, 0); } + to { -webkit-transform: translate3d(0, 100%, 0); } +} +@-moz-keyframes slideouttobottom { + from { -moz-transform: translate3d(0, 0, 0); } + to { -moz-transform: translate3d(0, 100%, 0); } +} + +/* slide fade */ + +.slidefade.out { + -webkit-transform: translate3d(-100%, 0, 0); + -webkit-animation-name: slideouttoleft; + -moz-transform: translate3d(-100%, 0, 0); + -moz-animation-name: slideouttoleft; + -webkit-animation-duration: 225ms; + -moz-animation-duration: 225ms; +} + +.slidefade.in { + -webkit-transform: translate3d(0, 0, 0); + -webkit-animation-name: fadein; + -moz-transform: translate3d(0, 0, 0); + -moz-animation-name: fadein; + -webkit-animation-duration: 200ms; + -moz-animation-duration: 200ms; +} + +.slidefade.out.reverse { + -webkit-transform: translate3d(100%, 0, 0); + -webkit-animation-name: slideouttoright; + -moz-transform: translate3d(100%, 0, 0); + -moz-animation-name: slideouttoright; + -webkit-animation-duration: 200ms; + -moz-animation-duration: 200ms; +} + +.slidefade.in.reverse { + -webkit-transform: translate3d(0, 0, 0); + -webkit-animation-name: fadein; + -moz-transform: translate3d(0, 0, 0); + -moz-animation-name: fadein; + -webkit-animation-duration: 200ms; + -moz-animation-duration: 200ms; +} + +/* The properties in this rule are only necessary for the 'flip' transition. + * We need specify the perspective to create a projection matrix. This will add + * some depth as the element flips. The depth number represents the distance of + * the viewer from the z-plane. According to the CSS3 spec, 1000 is a moderate + * value. + */ + +.viewport-turn { + -webkit-perspective: 1000; + -moz-perspective: 1000; + position: absolute; +} +.turn { + -webkit-backface-visibility:hidden; + -webkit-transform:translate3d(0, 0, 0); /* Needed to work around an iOS 3.1 bug that causes listview thumbs to disappear when -webkit-visibility:hidden is used. */ + -webkit-transform-origin: 0; + -moz-backface-visibility:hidden; + -moz-transform:translate3d(0, 0, 0); /* Needed to work around an iOS 3.1 bug that causes listview thumbs to disappear when -webkit-visibility:hidden is used. */ + -moz-transform-origin: 0; +} + +.turn.out { + -webkit-transform: rotateY(-90deg) scale(.9); + -webkit-animation-name: flipouttoleft; + -moz-transform: rotateY(-90deg) scale(.9); + -moz-animation-name: flipouttoleft; + -webkit-animation-duration: 125ms; + -moz-animation-duration: 125ms; +} + +.turn.in { + -webkit-animation-name: flipintoright; + -moz-animation-name: flipintoright; + -webkit-animation-duration: 250ms; + -moz-animation-duration: 250ms; +} + +.turn.out.reverse { + -webkit-transform: rotateY(90deg) scale(.9); + -webkit-animation-name: flipouttoright; + -moz-transform: rotateY(90deg) scale(.9); + -moz-animation-name: flipouttoright; +} + +.turn.in.reverse { + -webkit-animation-name: flipintoleft; + -moz-animation-name: flipintoleft; +} + +@-webkit-keyframes flipouttoleft { + from { -webkit-transform: rotateY(0); } + to { -webkit-transform: rotateY(-90deg) scale(.9); } +} +@-moz-keyframes flipouttoleft { + from { -moz-transform: rotateY(0); } + to { -moz-transform: rotateY(-90deg) scale(.9); } +} +@-webkit-keyframes flipouttoright { + from { -webkit-transform: rotateY(0) ; } + to { -webkit-transform: rotateY(90deg) scale(.9); } +} +@-moz-keyframes flipouttoright { + from { -moz-transform: rotateY(0); } + to { -moz-transform: rotateY(90deg) scale(.9); } +} +@-webkit-keyframes flipintoleft { + from { -webkit-transform: rotateY(-90deg) scale(.9); } + to { -webkit-transform: rotateY(0); } +} +@-moz-keyframes flipintoleft { + from { -moz-transform: rotateY(-90deg) scale(.9); } + to { -moz-transform: rotateY(0); } +} +@-webkit-keyframes flipintoright { + from { -webkit-transform: rotateY(90deg) scale(.9); } + to { -webkit-transform: rotateY(0); } +} +@-moz-keyframes flipintoright { + from { -moz-transform: rotateY(90deg) scale(.9); } + to { -moz-transform: rotateY(0); } +} diff --git a/src/themes/tizen/images/ajax-loader.png b/src/themes/tizen/images/ajax-loader.png new file mode 100644 index 0000000..811a2cd Binary files /dev/null and b/src/themes/tizen/images/ajax-loader.png differ diff --git a/src/themes/tizen/images/icon-search-black.png b/src/themes/tizen/images/icon-search-black.png new file mode 100644 index 0000000..5721120 Binary files /dev/null and b/src/themes/tizen/images/icon-search-black.png differ diff --git a/src/themes/tizen/images/icons-18-black.png b/src/themes/tizen/images/icons-18-black.png new file mode 100644 index 0000000..1ecfd26 Binary files /dev/null and b/src/themes/tizen/images/icons-18-black.png differ diff --git a/src/themes/tizen/images/icons-18-white.png b/src/themes/tizen/images/icons-18-white.png new file mode 100644 index 0000000..0c70831 Binary files /dev/null and b/src/themes/tizen/images/icons-18-white.png differ diff --git a/src/themes/tizen/images/icons-36-black.png b/src/themes/tizen/images/icons-36-black.png new file mode 100644 index 0000000..4c72adf Binary files /dev/null and b/src/themes/tizen/images/icons-36-black.png differ diff --git a/src/themes/tizen/images/icons-36-white.png b/src/themes/tizen/images/icons-36-white.png new file mode 100644 index 0000000..84ea9fb Binary files /dev/null and b/src/themes/tizen/images/icons-36-white.png differ diff --git a/src/themes/tizen/images/web-ui-fw_noContent.png b/src/themes/tizen/images/web-ui-fw_noContent.png new file mode 100644 index 0000000..4a0c9a4 Binary files /dev/null and b/src/themes/tizen/images/web-ui-fw_noContent.png differ diff --git a/src/themes/tizen/images/web-ui-fw_volume_icon.png b/src/themes/tizen/images/web-ui-fw_volume_icon.png new file mode 100644 index 0000000..913c844 Binary files /dev/null and b/src/themes/tizen/images/web-ui-fw_volume_icon.png differ diff --git a/src/themes/tizen/jquery.mobile.todons.theme.less b/src/themes/tizen/jquery.mobile.todons.theme.less new file mode 100644 index 0000000..e31205e --- /dev/null +++ b/src/themes/tizen/jquery.mobile.todons.theme.less @@ -0,0 +1,1758 @@ +/*! + * jQuery Mobile - Tizen "White" theme + * http://jquerymobile.com/ + * + * Copyright 2010, jQuery Project + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + */ + +/* general border width */ +@borderWidth: 1px; + +/* width of bottom border on header */ +@barBorderWidth: 0px; + +/* the brown used for header bar */ +@brown: #dbc9ae; + +/* the orange used for option header, progress bar foreground etc. */ +@orange: #cf8013; + +@lightOrange: #d9931a; + +/* darker orange used for option header border */ +@darkOrange: #b27815; + +/* A +-----------------------------------------------------------------------------------------------------------*/ + +/* for ui-bar gradients */ +@aBarBgFrom: @brown; +@aBarBgTo: @brown; + +@aBarBorderColor: @orange; +@aBarTextColor: rgb(73,44,7); + +/* for ui-body gradients */ +@aBodyBgFrom: #eeeeee; +@aBodyBgTo: #dddddd; + +@aBodyBorderColor: rgba(255,255,255,0); +@aBodyTextColor: #333333; + +@aLinkColor: #7cc4e7; +@aLinkInheritColor: #ffffff; + +/* for link text which is styled as a button */ +@aBtnLinkInheritColor: #ffffff; +@aBtnDownLinkInheritColor: #ffffff; + +@aBtnUpBorderColor: rgb(148,125,99); /* use Title_time text color */ +@aBtnUpBgFrom: @brown; +@aBtnUpBgTo: @brown; +@aBtnUpTextColor: @aBtnUpBorderColor; /* same as border color */ + +@aBtnHoverBorderColor: @aBtnUpBorderColor; +@aBtnHoverBgFrom: @brown; +@aBtnHoverBgTo: @brown; +@aBtnHoverTextColor: @aBtnUpBorderColor; + +@aBtnDownBorderColor: #c88410; +@aBtnDownBgFrom: @lightOrange; +@aBtnDownBgTo: @lightOrange; +@aBtnDownTextColor: #ffffff; + +.ui-bar-a { + border: @borderWidth solid @aBarBorderColor; + color: @aBarTextColor; + font-weight: bold; + background: @aBarBgTo; + background-image: -webkit-gradient(linear, left top, left bottom, from(@aBarBgFrom), to(@aBarBgTo)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, @aBarBgFrom, @aBarBgTo); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient(top, @aBarBgFrom, @aBarBgTo); /* FF3.6 */ + background-image: -ms-linear-gradient(top, @aBarBgFrom, @aBarBgTo); /* IE10 */ + background-image: -o-linear-gradient(top, @aBarBgFrom, @aBarBgTo); /* Opera 11.10+ */ + background-image: linear-gradient(top, @aBarBgFrom, @aBarBgTo); +} + +.ui-body-a { + border: @borderWidth solid @aBodyBorderColor; + color: @aBodyTextColor; + background: @aBodyBgTo; + background-image: -webkit-gradient(linear, left top, left bottom, from(@aBodyBgFrom), to(@aBodyBgTo)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, @aBodyBgFrom, @aBodyBgTo); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient(top, @aBodyBgFrom, @aBodyBgTo); /* FF3.6 */ + background-image: -ms-linear-gradient(top, @aBodyBgFrom, @aBodyBgTo); /* IE10 */ + background-image: -o-linear-gradient(top, @aBodyBgFrom, @aBodyBgTo); /* Opera 11.10+ */ + background-image: linear-gradient(top, @aBodyBgFrom, @aBodyBgTo); +} + +.ui-bar-a, +.ui-bar-a input, +.ui-bar-a select, +.ui-bar-a textarea, +.ui-bar-a button, +.ui-body-a, +.ui-body-a input, +.ui-body-a select, +.ui-body-a textarea, +.ui-body-a button, +.ui-btn-up-a, +.ui-btn-hover-a, +.ui-btn-down-a { + font-family: Helvetica, Arial, sans-serif; +} + +.ui-body-a .ui-link-inherit { + color: @aLinkInheritColor; +} + +.ui-body-a .ui-link { + color: @aLinkColor; + font-weight: bold; +} + +.ui-btn-up-a { + border: @borderWidth solid @aBtnUpBorderColor; + background: @aBtnUpBgTo; + font-weight: bold; + color: @aBtnUpTextColor; + background-image: -webkit-gradient(linear, left top, left bottom, from(@aBtnUpBgFrom), to(@aBtnUpBgTo)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, @aBtnUpBgFrom, @aBtnUpBgTo); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient(top, @aBtnUpBgFrom, @aBtnUpBgTo); /* FF3.6 */ + background-image: -ms-linear-gradient(top, @aBtnUpBgFrom, @aBtnUpBgTo); /* IE10 */ + background-image: -o-linear-gradient(top, @aBtnUpBgFrom, @aBtnUpBgTo); /* Opera 11.10+ */ + background-image: linear-gradient(top, @aBtnUpBgFrom, @aBtnUpBgTo); +} + +.ui-btn-hover-a { + border: @borderWidth solid @aBtnHoverBorderColor; + background: @aBtnHoverBgTo; + font-weight: bold; + color: @aBtnHoverTextColor; + background-image: -webkit-gradient(linear, left top, left bottom, from(@aBtnHoverBgFrom), to(@aBtnHoverBgTo)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, @aBtnHoverBgFrom, @aBtnHoverBgTo); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient(top, @aBtnHoverBgFrom, @aBtnHoverBgTo); /* FF3.6 */ + background-image: -ms-linear-gradient(top, @aBtnHoverBgFrom, @aBtnHoverBgTo); /* IE10 */ + background-image: -o-linear-gradient(top, @aBtnHoverBgFrom, @aBtnHoverBgTo); /* Opera 11.10+ */ + background-image: linear-gradient(top, @aBtnHoverBgFrom, @aBtnHoverBgTo); +} + +.ui-btn-down-a { + border: @borderWidth solid @aBtnDownBorderColor; + background: @aBtnDownBgTo; + font-weight: bold; + color: @aBtnDownTextColor; + background-image: -webkit-gradient(linear, left top, left bottom, from(@aBtnDownBgFrom), to(@aBtnDownBgTo)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, @aBtnDownBgFrom, @aBtnDownBgTo); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient(top, @aBtnDownBgFrom, @aBtnDownBgTo); /* FF3.6 */ + background-image: -ms-linear-gradient(top, @aBtnDownBgFrom, @aBtnDownBgTo); /* IE10 */ + background-image: -o-linear-gradient(top, @aBtnDownBgFrom, @aBtnDownBgTo); /* Opera 11.10+ */ + background-image: linear-gradient(top, @aBtnDownBgFrom, @aBtnDownBgTo); +} + +.ui-btn-hover-a a.ui-link-inherit, +.ui-btn-up-a a.ui-link-inherit { + color: @aBtnLinkInheritColor; +} + +.ui-btn-down-a a.ui-link-inherit { + color: @aBtnDownLinkInheritColor; +} + +.ui-btn-up-a, +.ui-btn-hover-a, +.ui-btn-down-a { + text-decoration: none; +} + +/* B +-----------------------------------------------------------------------------------------------------------*/ + +/* for ui-bar gradients */ +@bBarBgFrom: #dad8d4; +@bBarBgTo: #dad8d4; + +@bBarBorderColor: #c7c7c7; +@bBarTextColor: rgb(108,108,108); + +/* for ui-body gradients */ +@bBodyBgFrom: @orange; +@bBodyBgTo: @orange; + +@bBodyBorderColor: rgb(199,199,199); +@bBodyTextColor: #333333; + +@bLinkColor: #2489ce; +@bLinkInheritColor: #333333; + +/* for link text which is styled as a button */ +@bBtnLinkInheritColor: #ffffff; +@bBtnDownLinkInheritColor: #ffffff; + +@bBtnUpBorderColor: @darkOrange; +@bBtnUpBgFrom: @orange; +@bBtnUpBgTo: @orange; +@bBtnUpTextColor: #ffffff; + +@bBtnHoverBorderColor: @darkOrange; +@bBtnHoverBgFrom: @orange; +@bBtnHoverBgTo: @orange; +@bBtnHoverTextColor: #ffffff; + +@bBtnDownBorderColor: @orange; +@bBtnDownBgFrom: @lightOrange; +@bBtnDownBgTo: @lightOrange; +@bBtnDownTextColor: #ffffff; + +.ui-bar-b { + border: @borderWidth solid @bBarBorderColor; + color: @bBarTextColor; + font-weight: bold; + background: @bBarBgTo; + background-image: -webkit-gradient(linear, left top, left bottom, from(@bBarBgFrom), to(@bBarBgTo)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, @bBarBgFrom, @bBarBgTo); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient(top, @bBarBgFrom, @bBarBgTo); /* FF3.6 */ + background-image: -ms-linear-gradient(top, @bBarBgFrom, @bBarBgTo); /* IE10 */ + background-image: -o-linear-gradient(top, @bBarBgFrom, @bBarBgTo); /* Opera 11.10+ */ + background-image: linear-gradient(top, @bBarBgFrom, @bBarBgTo); +} + +.ui-body-b { + border: @borderWidth solid @bBodyBorderColor; + color: @bBodyTextColor; + background: @bBodyBgTo; + background-image: -webkit-gradient(linear, left top, left bottom, from(@bBodyBgFrom), to(@bBodyBgTo)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, @bBodyBgFrom, @bBodyBgTo); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient(top, @bBodyBgFrom, @bBodyBgTo); /* FF3.6 */ + background-image: -ms-linear-gradient(top, @bBodyBgFrom, @bBodyBgTo); /* IE10 */ + background-image: -o-linear-gradient(top, @bBodyBgFrom, @bBodyBgTo); /* Opera 11.10+ */ + background-image: linear-gradient(top, @bBodyBgFrom, @bBodyBgTo); +} + +.ui-bar-b, +.ui-bar-b input, +.ui-bar-b select, +.ui-bar-b textarea, +.ui-bar-b button, +.ui-body-b, +.ui-body-b input, +.ui-body-b select, +.ui-body-b textarea, +.ui-body-b button, +.ui-btn-up-b, +.ui-btn-hover-b, +.ui-btn-down-b { + font-family: Helvetica, Arial, sans-serif; +} + +.ui-body-b .ui-link-inherit { + color: @bLinkInheritColor; +} + +.ui-body-b .ui-link { + color: @bLinkColor; + font-weight: bold; +} + +.ui-btn-up-b { + border: @borderWidth solid @bBtnUpBorderColor; + background: @bBtnUpBgTo; + font-weight: bold; + color: @bBtnUpTextColor; + background-image: -webkit-gradient(linear, left top, left bottom, from(@bBtnUpBgFrom), to(@bBtnUpBgTo)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, @bBtnUpBgFrom, @bBtnUpBgTo); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient(top, @bBtnUpBgFrom, @bBtnUpBgTo); /* FF3.6 */ + background-image: -ms-linear-gradient(top, @bBtnUpBgFrom, @bBtnUpBgTo); /* IE10 */ + background-image: -o-linear-gradient(top, @bBtnUpBgFrom, @bBtnUpBgTo); /* Opera 11.10+ */ + background-image: linear-gradient(top, @bBtnUpBgFrom, @bBtnUpBgTo); +} + +.ui-btn-hover-b { + border: @borderWidth solid @bBtnHoverBorderColor; + background: @bBtnHoverBgTo; + font-weight: bold; + color: @bBtnHoverTextColor; + background-image: -webkit-gradient(linear, left top, left bottom, from(@bBtnHoverBgFrom), to(@bBtnHoverBgTo)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, @bBtnHoverBgFrom, @bBtnHoverBgTo); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient(top, @bBtnHoverBgFrom, @bBtnHoverBgTo); /* FF3.6 */ + background-image: -ms-linear-gradient(top, @bBtnHoverBgFrom, @bBtnHoverBgTo); /* IE10 */ + background-image: -o-linear-gradient(top, @bBtnHoverBgFrom, @bBtnHoverBgTo); /* Opera 11.10+ */ + background-image: linear-gradient(top, @bBtnHoverBgFrom, @bBtnHoverBgTo); +} + +.ui-btn-down-b { + border: @borderWidth solid @bBtnDownBorderColor; + background: @bBtnDownBgTo; + font-weight: bold; + color: @bBtnDownTextColor; + background-image: -webkit-gradient(linear, left top, left bottom, from(@bBtnDownBgFrom), to(@bBtnDownBgTo)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, @bBtnDownBgFrom, @bBtnDownBgTo); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient(top, @bBtnDownBgFrom, @bBtnDownBgTo); /* FF3.6 */ + background-image: -ms-linear-gradient(top, @bBtnDownBgFrom, @bBtnDownBgTo); /* IE10 */ + background-image: -o-linear-gradient(top, @bBtnDownBgFrom, @bBtnDownBgTo); /* Opera 11.10+ */ + background-image: linear-gradient(top, @bBtnDownBgFrom, @bBtnDownBgTo); +} + +.ui-btn-hover-b a.ui-link-inherit, +.ui-btn-up-b a.ui-link-inherit { + color: @bBtnLinkInheritColor; +} + +.ui-btn-down-b a.ui-link-inherit { + color: @bBtnDownLinkInheritColor; +} + +.ui-btn-up-b, +.ui-btn-hover-b, +.ui-btn-down-b { + text-decoration: none; +} + +/* C +-----------------------------------------------------------------------------------------------------------*/ + +/* for ui-bar gradients */ +@cBarBgFrom: #f0f0f0; +@cBarBgTo: #e9eaeb; + +@cBarBorderColor: rgba(255,255,255,0); +@cBarTextColor: #3e3e3e; + +/* for ui-body gradients */ +@cBodyBgFrom: rgb(249,249,249); +@cBodyBgTo: rgb(249,249,249); + +@cBodyBorderColor: #b3b3b3; +@cBodyTextColor: #333333; + +@cLinkColor: #2489CE; +@cLinkInheritColor: #333333; + +/* for link text which is styled as a button */ +@cBtnLinkInheritColor: #2F3E46; +@cBtnDownLinkInheritColor: #ffffff; + +@cBtnUpBorderColor: #c7c7c7; +@cBtnUpBgFrom: #f3efe9; +@cBtnUpBgTo: #f3efe9; +@cBtnUpTextColor: rgb(78,73,69); + +@cBtnHoverBorderColor: #c7c7c7; +@cBtnHoverBgFrom: #f3efe9; +@cBtnHoverBgTo: #f3efe9; +@cBtnHoverTextColor: rgb(78,73,69); + +@cBtnDownBorderColor: #c88410; +@cBtnDownBgFrom: @lightOrange; +@cBtnDownBgTo: @lightOrange; +@cBtnDownTextColor: #ffffff; + +.ui-bar-c { + border: @borderWidth solid @cBarBorderColor; + color: @cBarTextColor; + font-weight: bold; + background: @cBarBgTo; + background-image: -webkit-gradient(linear, left top, left bottom, from(@cBarBgFrom), to(@cBarBgTo)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, @cBarBgFrom, @cBarBgTo); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient(top, @cBarBgFrom, @cBarBgTo); /* FF3.6 */ + background-image: -ms-linear-gradient(top, @cBarBgFrom, @cBarBgTo); /* IE10 */ + background-image: -o-linear-gradient(top, @cBarBgFrom, @cBarBgTo); /* Opera 11.10+ */ + background-image: linear-gradient(top, @cBarBgFrom, @cBarBgTo); +} + +.ui-body-c { + border: @borderWidth solid @cBodyBorderColor; + color: @cBodyTextColor; + background: @cBodyBgTo; + background-image: -webkit-gradient(linear, left top, left bottom, from(@cBodyBgFrom), to(@cBodyBgTo)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, @cBodyBgFrom, @cBodyBgTo); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient(top, @cBodyBgFrom, @cBodyBgTo); /* FF3.6 */ + background-image: -ms-linear-gradient(top, @cBodyBgFrom, @cBodyBgTo); /* IE10 */ + background-image: -o-linear-gradient(top, @cBodyBgFrom, @cBodyBgTo); /* Opera 11.10+ */ + background-image: linear-gradient(top, @cBodyBgFrom, @cBodyBgTo); +} + +.ui-bar-c, +.ui-bar-c input, +.ui-bar-c select, +.ui-bar-c textarea, +.ui-bar-c button, +.ui-body-c, +.ui-body-c input, +.ui-body-c select, +.ui-body-c textarea, +.ui-body-c button, +.ui-btn-up-c, +.ui-btn-hover-c, +.ui-btn-down-c { + font-family: Helvetica, Arial, sans-serif; +} + +.ui-body-c .ui-link-inherit { + color: @cLinkInheritColor; +} + +.ui-body-c .ui-link { + color: @cLinkColor; + font-weight: bold; +} + +.ui-btn-up-c { + border: @borderWidth solid @cBtnUpBorderColor; + background: @cBtnUpBgTo; + font-weight: bold; + color: @cBtnUpTextColor; + background-image: -webkit-gradient(linear, left top, left bottom, from(@cBtnUpBgFrom), to(@cBtnUpBgTo)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, @cBtnUpBgFrom, @cBtnUpBgTo); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient(top, @cBtnUpBgFrom, @cBtnUpBgTo); /* FF3.6 */ + background-image: -ms-linear-gradient(top, @cBtnUpBgFrom, @cBtnUpBgTo); /* IE10 */ + background-image: -o-linear-gradient(top, @cBtnUpBgFrom, @cBtnUpBgTo); /* Opera 11.10+ */ + background-image: linear-gradient(top, @cBtnUpBgFrom, @cBtnUpBgTo); +} + +/* override background styling for list items which are styled as buttons */ +li.ui-btn-up-c, +li.ui-btn-hover-c { + background: @cBodyBgTo; + background-image: -webkit-gradient(linear, left top, left bottom, from(@cBodyBgFrom), to(@cBodyBgTo)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, @cBodyBgFrom, @cBodyBgTo); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient(top, @cBodyBgFrom, @cBodyBgTo); /* FF3.6 */ + background-image: -ms-linear-gradient(top, @cBodyBgFrom, @cBodyBgTo); /* IE10 */ + background-image: -o-linear-gradient(top, @cBodyBgFrom, @cBodyBgTo); /* Opera 11.10+ */ + background-image: linear-gradient(top, @cBodyBgFrom, @cBodyBgTo); +} + +.ui-btn-hover-c { + border: @borderWidth solid @cBtnHoverBorderColor; + background: @cBtnHoverBgTo; + font-weight: bold; + color: @cBtnHoverTextColor; + background-image: -webkit-gradient(linear, left top, left bottom, from(@cBtnHoverBgFrom), to(@cBtnHoverBgTo)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, @cBtnHoverBgFrom, @cBtnHoverBgTo); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient(top, @cBtnHoverBgFrom, @cBtnHoverBgTo); /* FF3.6 */ + background-image: -ms-linear-gradient(top, @cBtnHoverBgFrom, @cBtnHoverBgTo); /* IE10 */ + background-image: -o-linear-gradient(top, @cBtnHoverBgFrom, @cBtnHoverBgTo); /* Opera 11.10+ */ + background-image: linear-gradient(top, @cBtnHoverBgFrom, @cBtnHoverBgTo); +} + +/* NB uses !important here to ensure that button presses are highlighted correctly, + regardless of whether they occur on buttons inside or outside listviews */ +.ui-btn-down-c { + border: @borderWidth solid @cBtnDownBorderColor; + background: @cBtnDownBgTo !important; + font-weight: bold; + color: @cBtnDownTextColor; + background-image: -webkit-gradient(linear, left top, left bottom, from(@cBtnDownBgFrom), to(@cBtnDownBgTo)) !important; /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, @cBtnDownBgFrom, @cBtnDownBgTo) !important; /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient(top, @cBtnDownBgFrom, @cBtnDownBgTo) !important; /* FF3.6 */ + background-image: -ms-linear-gradient(top, @cBtnDownBgFrom, @cBtnDownBgTo) !important; /* IE10 */ + background-image: -o-linear-gradient(top, @cBtnDownBgFrom, @cBtnDownBgTo) !important; /* Opera 11.10+ */ + background-image: linear-gradient(top, @cBtnDownBgFrom, @cBtnDownBgTo) !important; +} + +.ui-btn-hover-c a.ui-link-inherit, +.ui-btn-up-c a.ui-link-inherit { + color: @cBtnLinkInheritColor; +} + +.ui-btn-down-c a.ui-link-inherit { + color: @cBtnDownLinkInheritColor; +} + +.ui-btn-up-c, +.ui-btn-hover-c, +.ui-btn-down-c { + text-decoration: none; +} + +/* D +-----------------------------------------------------------------------------------------------------------*/ + +.ui-bar-d { + border: @borderWidth solid #ccc; + background: #bbb; + color: #333; + text-shadow: 0 1px 0 #eee; + background-image: -webkit-gradient(linear, left top, left bottom, from(#ddd), to(#bbb)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, #ddd, #bbb); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient(top, #ddd, #bbb); /* FF3.6 */ + background-image: -ms-linear-gradient(top, #ddd, #bbb); /* IE10 */ + background-image: -o-linear-gradient(top, #ddd, #bbb); /* Opera 11.10+ */ + background-image: linear-gradient(top, #ddd, #bbb); +} +.ui-bar-d, +.ui-bar-d input, +.ui-bar-d select, +.ui-bar-d textarea, +.ui-bar-d button { + font-family: Helvetica, Arial, sans-serif; +} +.ui-bar-d .ui-link-inherit { + color: #333; +} +.ui-bar-d .ui-link { + color: #2489CE; + font-weight: bold; +} +.ui-body-d { + border: @borderWidth solid #ccc; + color: #333333; + text-shadow: 0 1px 0 #fff; + background: #ffffff; +} +.ui-body-d, +.ui-body-d input, +.ui-body-d select, +.ui-body-d textarea, +.ui-body-d button { + font-family: Helvetica, Arial, sans-serif; +} +.ui-body-d .ui-link-inherit { + color: #333333; +} +.ui-body-d .ui-link { + color: #2489CE; + font-weight: bold; +} +.ui-btn-up-d { + border: @borderWidth solid #ccc; + background: #fff; + font-weight: bold; + color: #444; + text-shadow: 0 1px 1px #fff; +} +.ui-btn-up-d a.ui-link-inherit { + color: #333; +} +.ui-btn-hover-d { + border: @borderWidth solid #aaa; + background: #eeeeee; + font-weight: bold; + color: #222; + cursor: pointer; + text-shadow: 0 1px 1px #fff; + background-image: -webkit-gradient(linear, left top, left bottom, from(#fdfdfd), to(#eee)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, #fdfdfd, #eee); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient(top, #fdfdfd, #eee); /* FF3.6 */ + background-image: -ms-linear-gradient(top, #fdfdfd, #eee); /* IE10 */ + background-image: -o-linear-gradient(top, #fdfdfd, #eee); /* Opera 11.10+ */ + background-image: linear-gradient(top, #fdfdfd, #eee); +} +.ui-btn-hover-d a.ui-link-inherit { + color: #222; +} +.ui-btn-down-d { + border: @borderWidth solid #aaaaaa; + background: #ffffff; + font-weight: bold; + color: #111; + text-shadow: 0 1px 1px #ffffff; + background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#fff)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, #eee, #fff); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient(top, #eee, #fff); /* FF3.6 */ + background-image: -ms-linear-gradient(top, #eee, #fff); /* IE10 */ + background-image: -o-linear-gradient(top, #eee, #fff); /* Opera 11.10+ */ + background-image: linear-gradient(top, #eee, #fff); +} +.ui-btn-down-d a.ui-link-inherit { + color: #111; +} +.ui-btn-up-d, +.ui-btn-hover-d, +.ui-btn-down-d { + font-family: Helvetica, Arial, sans-serif; + text-decoration: none; +} + + +/* E +-----------------------------------------------------------------------------------------------------------*/ + +.ui-bar-e { + border: @borderWidth solid #F7C942; + background: #fadb4e; + color: #333; + text-shadow: 0 1px 0 #fff; + background-image: -webkit-gradient(linear, left top, left bottom, from(#fceda7), to(#fadb4e)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, #fceda7, #fadb4e); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient(top, #fceda7, #fadb4e); /* FF3.6 */ + background-image: -ms-linear-gradient(top, #fceda7, #fadb4e); /* IE10 */ + background-image: -o-linear-gradient(top, #fceda7, #fadb4e); /* Opera 11.10+ */ + background-image: linear-gradient(top, #fceda7, #fadb4e); +} +.ui-bar-e, +.ui-bar-e input, +.ui-bar-e select, +.ui-bar-e textarea, +.ui-bar-e button { + font-family: Helvetica, Arial, sans-serif; +} +.ui-bar-e .ui-link-inherit { + color: #333; +} +.ui-bar-e .ui-link { + color: #2489CE; + font-weight: bold; +} +.ui-body-e { + border: @borderWidth solid #F7C942; + color: #333333; + text-shadow: 0 1px 0 #fff; + background: #faeb9e; + background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#faeb9e)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, #fff, #faeb9e); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient(top, #fff, #faeb9e); /* FF3.6 */ + background-image: -ms-linear-gradient(top, #fff, #faeb9e); /* IE10 */ + background-image: -o-linear-gradient(top, #fff, #faeb9e); /* Opera 11.10+ */ + background-image: linear-gradient(top, #fff, #faeb9e); +} +.ui-body-e, +.ui-body-e input, +.ui-body-e select, +.ui-body-e textarea, +.ui-body-e button { + font-family: Helvetica, Arial, sans-serif; +} +.ui-body-e .ui-link-inherit { + color: #333333; +} +.ui-body-e .ui-link { + color: #2489CE; + font-weight: bold; +} +.ui-btn-up-e { + border: @borderWidth solid #F7C942; + background: #fadb4e; + font-weight: bold; + color: #333; + text-shadow: 0 1px 0 #fff; + background-image: -webkit-gradient(linear, left top, left bottom, from(#fceda7), to(#fadb4e)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, #fceda7, #fadb4e); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient(top, #fceda7, #fadb4e); /* FF3.6 */ + background-image: -ms-linear-gradient(top, #fceda7, #fadb4e); /* IE10 */ + background-image: -o-linear-gradient(top, #fceda7, #fadb4e); /* Opera 11.10+ */ + background-image: linear-gradient(top, #fceda7, #fadb4e); +} +.ui-btn-up-e a.ui-link-inherit { + color: #333; +} +.ui-btn-hover-e { + border: @borderWidth solid #e79952; + background: #fbe26f; + font-weight: bold; + color: #111; + text-shadow: 0 1px 1px #fff; + background-image: -webkit-gradient(linear, left top, left bottom, from(#fcf0b5), to(#fbe26f)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, #fcf0b5, #fbe26f); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient(top, #fcf0b5, #fbe26f); /* FF3.6 */ + background-image: -ms-linear-gradient(top, #fcf0b5, #fbe26f); /* IE10 */ + background-image: -o-linear-gradient(top, #fcf0b5, #fbe26f); /* Opera 11.10+ */ + background-image: linear-gradient(top, #fcf0b5, #fbe26f); +} + +.ui-btn-hover-e a.ui-link-inherit { + color: #333; +} +.ui-btn-down-e { + border: @borderWidth solid #F7C942; + background: #fceda7; + font-weight: bold; + color: #111; + text-shadow: 0 1px 1px #ffffff; + background-image: -webkit-gradient(linear, left top, left bottom, from(#fadb4e), to(#fceda7)); /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, #fadb4e, #fceda7); /* Chrome 10+, Saf5.1+ */ + background-image: -moz-linear-gradient(top, #fadb4e, #fceda7); /* FF3.6 */ + background-image: -ms-linear-gradient(top, #fadb4e, #fceda7); /* IE10 */ + background-image: -o-linear-gradient(top, #fadb4e, #fceda7); /* Opera 11.10+ */ + background-image: linear-gradient(top, #fadb4e, #fceda7); +} +.ui-btn-down-e a.ui-link-inherit { + color: #333; +} +.ui-btn-up-e, +.ui-btn-hover-e, +.ui-btn-down-e { + font-family: Helvetica, Arial, sans-serif; + text-decoration: none; +} + + +/* line breaks +-----------------------------------------------------------------------------------------------------------*/ +.ui-br { + border-bottom: rgb(130,130,130); + border-bottom: rgba(130,130,130,.3); + border-bottom-width: 1px; + border-bottom-style: solid; +} + +/* links within "buttons" +-----------------------------------------------------------------------------------------------------------*/ + +a.ui-link-inherit { + text-decoration: none !important; +} + + +/* Active class used as the "on" state across all themes; for now, these match the 'c' swatch +-----------------------------------------------------------------------------------------------------------*/ +@activeBgFrom: @cBtnDownBgFrom; +@activeLinkInheritColor: @cBtnDownLinkInheritColor; + +.ui-btn-active { + .ui-btn-down-c; +} + +.ui-btn-active a.ui-link-inherit { + color: @activeLinkInheritColor; +} + + +/* button inner top highlight +-----------------------------------------------------------------------------------------------------------*/ + +.ui-btn-inner { + border-top: 1px solid #fff; + border-color: rgba(255,255,255,.3); +} + + +/* corner rounding classes +-----------------------------------------------------------------------------------------------------------*/ + +.ui-corner-tl { + -moz-border-radius-topleft: .6em; + -webkit-border-top-left-radius: .6em; + border-top-left-radius: .6em; +} +.ui-corner-tr { + -moz-border-radius-topright: .6em; + -webkit-border-top-right-radius: .6em; + border-top-right-radius: .6em; +} +.ui-corner-bl { + -moz-border-radius-bottomleft: .6em; + -webkit-border-bottom-left-radius: .6em; + border-bottom-left-radius: .6em; +} +.ui-corner-br { + -moz-border-radius-bottomright: .6em; + -webkit-border-bottom-right-radius: .6em; + border-bottom-right-radius: .6em; +} +.ui-corner-top { + -moz-border-radius-topleft: .6em; + -webkit-border-top-left-radius: .6em; + border-top-left-radius: .6em; + -moz-border-radius-topright: .6em; + -webkit-border-top-right-radius: .6em; + border-top-right-radius: .6em; +} +.ui-corner-bottom { + -moz-border-radius-bottomleft: .6em; + -webkit-border-bottom-left-radius: .6em; + border-bottom-left-radius: .6em; + -moz-border-radius-bottomright: .6em; + -webkit-border-bottom-right-radius: .6em; + border-bottom-right-radius: .6em; + } +.ui-corner-right { + -moz-border-radius-topright: .6em; + -webkit-border-top-right-radius: .6em; + border-top-right-radius: .6em; + -moz-border-radius-bottomright: .6em; + -webkit-border-bottom-right-radius: .6em; + border-bottom-right-radius: .6em; +} +.ui-corner-left { + -moz-border-radius-topleft: .6em; + -webkit-border-top-left-radius: .6em; + border-top-left-radius: .6em; + -moz-border-radius-bottomleft: .6em; + -webkit-border-bottom-left-radius: .6em; + border-bottom-left-radius: .6em; +} +.ui-corner-all { + -moz-border-radius: .6em; + -webkit-border-radius: .6em; + border-radius: .6em; +} + + + +/* Interaction cues +-----------------------------------------------------------------------------------------------------------*/ +.ui-disabled { + opacity: .3; +} +.ui-disabled, +.ui-disabled a { + cursor: default; +} + +/* Icons +-----------------------------------------------------------------------------------------------------------*/ + +.ui-icon { + background: #666; + background: rgba(0,0,0,.4); + background-image: url(images/icons-18-white.png); + background-repeat: no-repeat; + -moz-border-radius: 9px; + -webkit-border-radius: 9px; + border-radius: 9px; +} + + +/* Alt icon color +-----------------------------------------------------------------------------------------------------------*/ + +.ui-icon-alt { + background: #fff; + background: rgba(255,255,255,.3); + background-image: url(images/icons-18-black.png); + background-repeat: no-repeat; +} + +/* HD/"retina" sprite +-----------------------------------------------------------------------------------------------------------*/ + +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (min--moz-device-pixel-ratio: 1.5), + only screen and (min-resolution: 240dpi) { + + .ui-icon-plus, .ui-icon-minus, .ui-icon-delete, .ui-icon-arrow-r, + .ui-icon-arrow-l, .ui-icon-arrow-u, .ui-icon-arrow-d, .ui-icon-check, + .ui-icon-gear, .ui-icon-refresh, .ui-icon-forward, .ui-icon-back, + .ui-icon-grid, .ui-icon-star, .ui-icon-alert, .ui-icon-info, .ui-icon-home, .ui-icon-search, + .ui-icon-checkbox-off, .ui-icon-checkbox-on, .ui-icon-radio-off, .ui-icon-radio-on { + background-image: url(images/icons-36-white.png); + -moz-background-size: 776px 18px; + -o-background-size: 776px 18px; + -webkit-background-size: 776px 18px; + background-size: 776px 18px; + } + .ui-icon-alt { + background-image: url(images/icons-36-black.png); + } +} + +/* plus minus */ +.ui-icon-plus { + background-position: -0 50%; +} +.ui-icon-minus { + background-position: -36px 50%; +} + +/* delete/close */ +.ui-icon-delete { + background-position: -72px 50%; +} + +/* arrows */ +.ui-icon-arrow-r { + background-position: -108px 50%; +} +.ui-icon-arrow-l { + background-position: -144px 50%; +} +.ui-icon-arrow-u { + background-position: -180px 50%; +} +.ui-icon-arrow-d { + background-position: -216px 50%; +} + +/* misc */ +.ui-icon-check { + background-position: -252px 50%; +} +.ui-icon-gear { + background-position: -288px 50%; +} +.ui-icon-refresh { + background-position: -324px 50%; +} +.ui-icon-forward { + background-position: -360px 50%; +} +.ui-icon-back { + background-position: -396px 50%; +} +.ui-icon-grid { + background-position: -432px 50%; +} +.ui-icon-star { + background-position: -468px 50%; +} +.ui-icon-alert { + background-position: -504px 50%; +} +.ui-icon-info { + background-position: -540px 50%; +} +.ui-icon-home { + background-position: -576px 50%; +} +.ui-icon-search { + background-position: -612px 50%; +} +.ui-icon-checkbox-off { + background-position: -684px 50%; +} +.ui-icon-checkbox-on { + background-position: -648px 50%; +} +.ui-icon-radio-off { + background-position: -756px 50%; +} +.ui-icon-radio-on { + background-position: -720px 50%; +} + + +/* checks,radios */ +.ui-checkbox .ui-icon { + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; +} +.ui-icon-checkbox-off, +.ui-icon-radio-off { + background-color: transparent; +} +.ui-checkbox-on .ui-icon, +.ui-radio-on .ui-icon { + background-color: @activeBgFrom; +} +.ui-icon-searchfield { + background-image: url(images/icon-search-black.png); + background-size: 16px 16px; +} + +/* loading icon */ +.ui-icon-loading { + background-image: url(images/ajax-loader.png); + width: 40px; + height: 40px; + -moz-border-radius: 20px; + -webkit-border-radius: 20px; + border-radius: 20px; + background-size: 35px 35px; +} + + +/* Button corner classes +-----------------------------------------------------------------------------------------------------------*/ + +.ui-btn-corner-tl { + -moz-border-radius-topleft: 1em; + -webkit-border-top-left-radius: 1em; + border-top-left-radius: 1em; +} +.ui-btn-corner-tr { + -moz-border-radius-topright: 1em; + -webkit-border-top-right-radius: 1em; + border-top-right-radius: 1em; +} +.ui-btn-corner-bl { + -moz-border-radius-bottomleft: 1em; + -webkit-border-bottom-left-radius: 1em; + border-bottom-left-radius: 1em; +} +.ui-btn-corner-br { + -moz-border-radius-bottomright: 1em; + -webkit-border-bottom-right-radius: 1em; + border-bottom-right-radius: 1em; +} +.ui-btn-corner-top { + -moz-border-radius-topleft: 1em; + -webkit-border-top-left-radius: 1em; + border-top-left-radius: 1em; + -moz-border-radius-topright: 1em; + -webkit-border-top-right-radius: 1em; + border-top-right-radius: 1em; +} +.ui-btn-corner-bottom { + -moz-border-radius-bottomleft: 1em; + -webkit-border-bottom-left-radius: 1em; + border-bottom-left-radius: 1em; + -moz-border-radius-bottomright: 1em; + -webkit-border-bottom-right-radius: 1em; + border-bottom-right-radius: 1em; +} +.ui-btn-corner-right { + -moz-border-radius-topright: 1em; + -webkit-border-top-right-radius: 1em; + border-top-right-radius: 1em; + -moz-border-radius-bottomright: 1em; + -webkit-border-bottom-right-radius: 1em; + border-bottom-right-radius: 1em; +} +.ui-btn-corner-left { + -moz-border-radius-topleft: 1em; + -webkit-border-top-left-radius: 1em; + border-top-left-radius: 1em; + -moz-border-radius-bottomleft: 1em; + -webkit-border-bottom-left-radius: 1em; + border-bottom-left-radius: 1em; +} +.ui-btn-corner-all { + -moz-border-radius: 1em; + -webkit-border-radius: 1em; + border-radius: 1em; +} + +/* radius clip workaround for cleaning up corner trapping */ +.ui-corner-tl, +.ui-corner-tr, +.ui-corner-bl, +.ui-corner-br, +.ui-corner-top, +.ui-corner-bottom, +.ui-corner-right, +.ui-corner-left, +.ui-corner-all, +.ui-btn-corner-tl, +.ui-btn-corner-tr, +.ui-btn-corner-bl, +.ui-btn-corner-br, +.ui-btn-corner-top, +.ui-btn-corner-bottom, +.ui-btn-corner-right, +.ui-btn-corner-left, +.ui-btn-corner-all { + -webkit-background-clip: padding-box; + -moz-background-clip: padding; + background-clip: padding-box; +} + +/* Overlay / modal +-----------------------------------------------------------------------------------------------------------*/ + +.ui-overlay { + background: #666; + opacity: .5; + filter: Alpha(Opacity=50); + position: absolute; + width: 100%; + height: 100%; +} +.ui-overlay-shadow { + -moz-box-shadow: 0px 0px 12px rgba(0,0,0,.6); + -webkit-box-shadow: 0px 0px 12px rgba(0,0,0,.6); + box-shadow: 0px 0px 12px rgba(0,0,0,.6); +} +.ui-shadow { + -moz-box-shadow: 0px 1px 4px rgba(0,0,0,.3); + -webkit-box-shadow: 0px 1px 4px rgba(0,0,0,.3); + box-shadow: 0px 1px 4px rgba(0,0,0,.3); +} +.ui-bar-a .ui-shadow, +.ui-bar-b .ui-shadow , +.ui-bar-c .ui-shadow { + -moz-box-shadow: 0px 1px 0 rgba(255,255,255,.3); + -webkit-box-shadow: 0px 1px 0 rgba(255,255,255,.3); + box-shadow: 0px 1px 0 rgba(255,255,255,.3); +} +.ui-shadow-inset { + -moz-box-shadow: inset 0px 1px 4px rgba(0,0,0,.2); + -webkit-box-shadow: inset 0px 1px 4px rgba(0,0,0,.2); + box-shadow: inset 0px 1px 4px rgba(0,0,0,.2); +} +.ui-icon-shadow { + -moz-box-shadow: 0px 1px 0 rgba(255,255,255,.4); + -webkit-box-shadow: 0px 1px 0 rgba(255,255,255,.4); + box-shadow: 0px 1px 0 rgba(255,255,255,.4); +} + +/* turn off shadows for buttons +-----------------------------------------------------------------------------------------------------------*/ +.ui-btn { + -moz-box-shadow: none !important; + -webkit-box-shadow: none !important; + box-shadow: none !important; +} + +/* unset box shadow in browsers that don't do it right +-----------------------------------------------------------------------------------------------------------*/ +.ui-mobile-nosupport-boxshadow * { + -moz-box-shadow: none !important; + -webkit-box-shadow: none !important; + box-shadow: none !important; +} +/* turn off outlines for all ui-focus elements +-----------------------------------------------------------------------------------------------------------*/ +.ui-focus { + outline: none; +} + +/* +* jQuery Mobile Framework +* Copyright (c) jQuery Project +* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. +*/ + +/* some unsets - more probably needed */ +.ui-mobile, .ui-mobile body { height: 100%; } +.ui-mobile fieldset, .ui-page { padding: 0; margin: 0; } +.ui-mobile a img, .ui-mobile fieldset { border: 0; } + +/* responsive page widths */ +.ui-mobile-viewport { margin: 0; overflow-x: hidden; -webkit-text-size-adjust: none; -ms-text-size-adjust:none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } + +/* "page" containers - full-screen views, one should always be in view post-pageload */ +.ui-mobile [data-role=page], .ui-mobile [data-role=dialog], .ui-page { top: 0; left: 0; width: 100%; min-height: 100%; position: absolute; display: none; border: 0; } +.ui-mobile .ui-page-active { display: block; overflow: visible; } + +/*orientations from js are available */ +.portrait, +.portrait .ui-page { min-height: 420px; } +.landscape, +.landscape .ui-page { min-height: 300px; } + +/* loading screen */ +.ui-loading .ui-mobile-viewport { overflow: hidden !important; } +.ui-loading .ui-loader { display: block; } +.ui-loading .ui-page { overflow: hidden; } +.ui-loader { display: none; position: absolute; opacity: .85; z-index: 100; left: 50%; width: 200px; margin-left: -130px; margin-top: -35px; padding: 10px 30px; } +.ui-loader h1 { font-size: 15px; text-align: center; } +.ui-loader .ui-icon { position: static; display: block; opacity: .9; margin: 0 auto; width: 35px; height: 35px; background-color: transparent; } + +/*fouc*/ +.ui-mobile-rendering > * { visibility: hidden; } + +/*headers, content panels*/ +.ui-bar, .ui-body { position: relative; padding: .4em 15px; overflow: hidden; display: block; clear:both; } +.ui-bar { font-size: 16px; margin: 0; } +.ui-bar h1, .ui-bar h2, .ui-bar h3, .ui-bar h4, .ui-bar h5, .ui-bar h6 { margin: 0; padding: 0; font-size: 16px; display: inline-block; } + +.ui-header, .ui-footer { display: block; } +.ui-page .ui-header, .ui-page .ui-footer { position: relative; } +.ui-header .ui-btn-left { position: absolute; left: 10px; top: .4em; } +.ui-header .ui-btn-right { position: absolute; right: 10px; top: .4em; } +.ui-header .ui-title, .ui-footer .ui-title { min-height: 1.1em; text-align: center; font-size: 16px; display: block; margin: .6em 90px .8em; padding: 0; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; outline: 0 !important; } +.ui-header { + border-width: 0 !important; + border-bottom-width: @barBorderWidth !important; +} +.ui-footer { + border-width: 0 !important; +} + +/*content area*/ +.ui-content { border-width: 0; overflow: visible; overflow-x: hidden; padding: 15px; } +.ui-page-fullscreen .ui-content { padding:0; } + +/* icons sizing */ +.ui-icon { width: 18px; height: 18px; } + +/* fullscreen class on ui-content div */ +.ui-fullscreen { } +.ui-fullscreen img { max-width: 100%; } + +/* non-js content hiding */ +.ui-nojs { position: absolute; left: -9999px; } +/* +* jQuery Mobile Framework +* Copyright (c) jQuery Project +* Dual licensed under the MIT (MIT-LICENSE.txt) or GPL (GPL-LICENSE.txt) licenses. +*/ +.spin { + -webkit-transform: rotate(360deg); + -webkit-animation-name: spin; + -webkit-animation-duration: 1s; + -webkit-animation-iteration-count: infinite; + -webkit-animation-timing-function: linear; +} +@-webkit-keyframes spin { + from {-webkit-transform: rotate(0deg);} + to {-webkit-transform: rotate(360deg);} +} + +/* Transitions from jQtouch (with small modifications): http://www.jqtouch.com/ +Built by David Kaneda and maintained by Jonathan Stark. +*/ +.in, .out { + -webkit-animation-timing-function: ease-in-out; + -webkit-animation-duration: 350ms; +} + +.slide.in { + -webkit-transform: translateX(0); + -webkit-animation-name: slideinfromright; +} + +.slide.out { + -webkit-transform: translateX(-100%); + -webkit-animation-name: slideouttoleft; +} + +.slide.in.reverse { + -webkit-transform: translateX(0); + -webkit-animation-name: slideinfromleft; +} + +.slide.out.reverse { + -webkit-transform: translateX(100%); + -webkit-animation-name: slideouttoright; +} + +.slideup.in { + -webkit-transform: translateY(0); + -webkit-animation-name: slideinfrombottom; + z-index: 10; +} + +.slideup.out { + -webkit-animation-name: dontmove; + z-index: 0; +} + +.slideup.out.reverse { + -webkit-transform: translateY(100%); + z-index: 10; + -webkit-animation-name: slideouttobottom; +} + +.slideup.in.reverse { + z-index: 0; + -webkit-animation-name: dontmove; +} +.slidedown.in { + -webkit-transform: translateY(0); + -webkit-animation-name: slideinfromtop; + z-index: 10; +} + +.slidedown.out { + -webkit-animation-name: dontmove; + z-index: 0; +} + +.slidedown.out.reverse { + -webkit-transform: translateY(-100%); + z-index: 10; + -webkit-animation-name: slideouttotop; +} + +.slidedown.in.reverse { + z-index: 0; + -webkit-animation-name: dontmove; +} + +@-webkit-keyframes slideinfromright { + from { -webkit-transform: translateX(100%); } + to { -webkit-transform: translateX(0); } +} + +@-webkit-keyframes slideinfromleft { + from { -webkit-transform: translateX(-100%); } + to { -webkit-transform: translateX(0); } +} + +@-webkit-keyframes slideouttoleft { + from { -webkit-transform: translateX(0); } + to { -webkit-transform: translateX(-100%); } +} + +@-webkit-keyframes slideouttoright { + from { -webkit-transform: translateX(0); } + to { -webkit-transform: translateX(100%); } +} + + +@-webkit-keyframes slideinfromtop { + from { -webkit-transform: translateY(-100%); } + to { -webkit-transform: translateY(0); } +} + +@-webkit-keyframes slideinfrombottom { + from { -webkit-transform: translateY(100%); } + to { -webkit-transform: translateY(0); } +} + +@-webkit-keyframes slideouttobottom { + from { -webkit-transform: translateY(0); } + to { -webkit-transform: translateY(100%); } +} + +@-webkit-keyframes slideouttotop { + from { -webkit-transform: translateY(0); } + to { -webkit-transform: translateY(-100%); } +} +@-webkit-keyframes fadein { + from { opacity: 0; } + to { opacity: 1; } +} + +@-webkit-keyframes fadeout { + from { opacity: 1; } + to { opacity: 0; } +} + +.fade.in { + opacity: 1; + z-index: 10; + -webkit-animation-name: fadein; +} +.fade.out { + z-index: 0; + -webkit-animation-name: fadeout; +} + +/* The properties in this rule are only necessary for the 'flip' transition. + * We need specify the perspective to create a projection matrix. This will add + * some depth as the element flips. The depth number represents the distance of + * the viewer from the z-plane. According to the CSS3 spec, 1000 is a moderate + * value. + */ +.viewport-flip { + -webkit-perspective: 1000; + position: absolute; +} + +.ui-mobile-viewport-transitioning, +.ui-mobile-viewport-transitioning .ui-page { + width: 100%; + height: 100%; + overflow: hidden; +} + +.flip { + -webkit-animation-duration: .65s; + -webkit-backface-visibility:hidden; + -webkit-transform:translateX(0); /* Needed to work around an iOS 3.1 bug that causes listview thumbs to disappear when -webkit-visibility:hidden is used. */ +} + +.flip.in { + -webkit-transform: rotateY(0) scale(1); + -webkit-animation-name: flipinfromleft; +} + +.flip.out { + -webkit-transform: rotateY(-180deg) scale(.8); + -webkit-animation-name: flipouttoleft; +} + +/* Shake it all about */ + +.flip.in.reverse { + -webkit-transform: rotateY(0) scale(1); + -webkit-animation-name: flipinfromright; +} + +.flip.out.reverse { + -webkit-transform: rotateY(180deg) scale(.8); + -webkit-animation-name: flipouttoright; +} + +@-webkit-keyframes flipinfromright { + from { -webkit-transform: rotateY(-180deg) scale(.8); } + to { -webkit-transform: rotateY(0) scale(1); } +} + +@-webkit-keyframes flipinfromleft { + from { -webkit-transform: rotateY(180deg) scale(.8); } + to { -webkit-transform: rotateY(0) scale(1); } +} + +@-webkit-keyframes flipouttoleft { + from { -webkit-transform: rotateY(0) scale(1); } + to { -webkit-transform: rotateY(-180deg) scale(.8); } +} + +@-webkit-keyframes flipouttoright { + from { -webkit-transform: rotateY(0) scale(1); } + to { -webkit-transform: rotateY(180deg) scale(.8); } +} + + +/* Hackish, but reliable. */ + +@-webkit-keyframes dontmove { + from { opacity: 1; } + to { opacity: 1; } +} + +.pop { + -webkit-transform-origin: 50% 50%; +} + +.pop.in { + -webkit-transform: scale(1); + opacity: 1; + -webkit-animation-name: popin; + z-index: 10; +} + +.pop.out.reverse { + -webkit-transform: scale(.2); + opacity: 0; + -webkit-animation-name: popout; + z-index: 10; +} + +.pop.in.reverse { + z-index: 0; + -webkit-animation-name: dontmove; +} + +@-webkit-keyframes popin { + from { + -webkit-transform: scale(.2); + opacity: 0; + } + to { + -webkit-transform: scale(1); + opacity: 1; + } +} + +@-webkit-keyframes popout { + from { + -webkit-transform: scale(1); + opacity: 1; + } + to { + -webkit-transform: scale(.2); + opacity: 0; + } +}/* +* jQuery Mobile Framework +* Copyright (c) jQuery Project +* Dual licensed under the MIT (MIT-LICENSE.txt) or GPL (GPL-LICENSE.txt) licenses. +*/ + +/* content configurations. */ +.ui-grid-a, .ui-grid-b, .ui-grid-c, .ui-grid-d { overflow: hidden; } +.ui-block-a, .ui-block-b, .ui-block-c, .ui-block-d, .ui-block-e { margin: 0; padding: 0; border: 0; float: left; min-height:1px;} + +/* grid solo: 100 - single item fallback */ +.ui-grid-solo .ui-block-a { width: 100%; float: none; } + +/* grid a: 50/50 */ +.ui-grid-a .ui-block-a, .ui-grid-a .ui-block-b { width: 50%; } +.ui-grid-a .ui-block-a { clear: left; } + +/* grid b: 33/33/33 */ +.ui-grid-b .ui-block-a, .ui-grid-b .ui-block-b, .ui-grid-b .ui-block-c { width: 33.333%; } +.ui-grid-b .ui-block-a { clear: left; } + +/* grid c: 25/25/25/25 */ +.ui-grid-c .ui-block-a, .ui-grid-c .ui-block-b, .ui-grid-c .ui-block-c, .ui-grid-c .ui-block-d { width: 25%; } +.ui-grid-c .ui-block-a { clear: left; } + +/* grid d: 20/20/20/20/20 */ +.ui-grid-d .ui-block-a, .ui-grid-d .ui-block-b, .ui-grid-d .ui-block-c, .ui-grid-d .ui-block-d, .ui-grid-d .ui-block-e { width: 20%; } +.ui-grid-d .ui-block-a { clear: left; } +/* +* jQuery Mobile Framework +* Copyright (c) jQuery Project +* Dual licensed under the MIT (MIT-LICENSE.txt) or GPL (GPL-LICENSE.txt) licenses. +*/ +/* fixed page header & footer configuration */ +.ui-header, .ui-footer, .ui-page-fullscreen .ui-header, .ui-page-fullscreen .ui-footer { position: absolute; overflow: hidden; width: 100%; border-left-width: 0; border-right-width: 0; } +.ui-header-fixed, .ui-footer-fixed { + z-index: 1000; + -webkit-transform: translateZ(0); /* Force header/footer rendering to go through the same rendering pipeline as native page scrolling. */ +} +.ui-footer-duplicate, .ui-page-fullscreen .ui-fixed-inline { display: none; } +.ui-page-fullscreen .ui-header, .ui-page-fullscreen .ui-footer { opacity: .9; } +/* +* jQuery Mobile Framework +* Copyright (c) jQuery Project +* Dual licensed under the MIT (MIT-LICENSE.txt) or GPL (GPL-LICENSE.txt) licenses. +*/ +.ui-navbar { overflow: hidden; } +.ui-navbar ul, .ui-navbar-expanded ul { list-style:none; padding: 0; margin: 0; position: relative; display: block; border: 0;} +.ui-navbar-collapsed ul { float: left; width: 75%; margin-right: -2px; } +.ui-navbar-collapsed .ui-navbar-toggle { float: left; width: 25%; } +.ui-navbar li.ui-navbar-truncate { position: absolute; left: -9999px; top: -9999px; } +.ui-navbar li .ui-btn, .ui-navbar .ui-navbar-toggle .ui-btn { display: block; font-size: 12px; text-align: center; margin: 0; border-right-width: 0; } +.ui-navbar li .ui-btn { margin-right: -1px; } +.ui-navbar li .ui-btn:last-child { margin-right: 0; } +.ui-header .ui-navbar li .ui-btn, .ui-header .ui-navbar .ui-navbar-toggle .ui-btn, +.ui-footer .ui-navbar li .ui-btn, .ui-footer .ui-navbar .ui-navbar-toggle .ui-btn { border-top-width: 0; border-bottom-width: 0; } +.ui-navbar .ui-btn-inner { padding-left: 2px; padding-right: 2px; } +.ui-navbar-noicons li .ui-btn .ui-btn-inner, .ui-navbar-noicons .ui-navbar-toggle .ui-btn-inner { padding-top: .8em; padding-bottom: .9em; } +/*expanded page styles*/ +.ui-navbar-expanded .ui-btn { margin: 0; font-size: 14px; } +.ui-navbar-expanded .ui-btn-inner { padding-left: 5px; padding-right: 5px; } +.ui-navbar-expanded .ui-btn-icon-top .ui-btn-inner { padding: 45px 5px 15px; text-align: center; } +.ui-navbar-expanded .ui-btn-icon-top .ui-icon { top: 15px; } +.ui-navbar-expanded .ui-btn-icon-bottom .ui-btn-inner { padding: 15px 5px 45px; text-align: center; } +.ui-navbar-expanded .ui-btn-icon-bottom .ui-icon { bottom: 15px; } +.ui-navbar-expanded li .ui-btn .ui-btn-inner { min-height: 2.5em; } +.ui-navbar-expanded .ui-navbar-noicons .ui-btn .ui-btn-inner { padding-top: 1.8em; padding-bottom: 1.9em; } +/* +* jQuery Mobile Framework +* Copyright (c) jQuery Project +* Dual licensed under the MIT (MIT-LICENSE.txt) or GPL (GPL-LICENSE.txt) licenses. +*/ +.ui-btn { display: block; text-align: center; cursor:pointer; position: relative; margin: .5em 5px; padding: 0; } +.ui-btn:focus, .ui-btn:active { outline: none; } +.ui-header .ui-btn, .ui-footer .ui-btn, .ui-bar .ui-btn { display: inline-block; font-size: 13px; margin: 0; } +.ui-btn-inline { display: inline-block; } +.ui-btn-inner { padding: .6em 25px; display: block; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; position: relative; zoom: 1; } +.ui-header .ui-btn-inner, .ui-footer .ui-btn-inner, .ui-bar .ui-btn-inner { padding: .4em 8px .5em; } +.ui-btn-icon-notext { display: inline-block; width: 20px; height: 20px; padding: 2px 1px 2px 3px; text-indent: -9999px; } +.ui-btn-icon-notext .ui-btn-inner { padding: 0; } +.ui-btn-icon-notext .ui-btn-text { position: absolute; left: -999px; } +.ui-btn-icon-left .ui-btn-inner { padding-left: 33px; } +.ui-header .ui-btn-icon-left .ui-btn-inner, +.ui-footer .ui-btn-icon-left .ui-btn-inner, +.ui-bar .ui-btn-icon-left .ui-btn-inner { padding-left: 27px; } +.ui-btn-icon-right .ui-btn-inner { padding-right: 33px; } +.ui-header .ui-btn-icon-right .ui-btn-inner, +.ui-footer .ui-btn-icon-right .ui-btn-inner, +.ui-bar .ui-btn-icon-right .ui-btn-inner { padding-right: 27px; } +.ui-btn-icon-top .ui-btn-inner { padding-top: 33px; } +.ui-header .ui-btn-icon-top .ui-btn-inner, +.ui-footer .ui-btn-icon-top .ui-btn-inner, +.ui-bar .ui-btn-icon-top .ui-btn-inner { padding-top: 27px; } +.ui-btn-icon-bottom .ui-btn-inner { padding-bottom: 33px; } +.ui-header .ui-btn-icon-bottom .ui-btn-inner, +.ui-footer .ui-btn-icon-bottom .ui-btn-inner, +.ui-bar .ui-btn-icon-bottom .ui-btn-inner { padding-bottom: 27px; } + +/*btn icon positioning*/ +.ui-btn-icon-notext .ui-icon { display: block; } +.ui-btn-icon-left .ui-icon, .ui-btn-icon-right .ui-icon { position: absolute; top: 50%; margin-top: -9px; } +.ui-btn-icon-top .ui-icon, .ui-btn-icon-bottom .ui-icon { position: absolute; left: 50%; margin-left: -9px; } +.ui-btn-icon-left .ui-icon { left: 10px; } +.ui-btn-icon-right .ui-icon {right: 10px; } +.ui-header .ui-btn-icon-left .ui-icon, +.ui-footer .ui-btn-icon-left .ui-icon, +.ui-bar .ui-btn-icon-left .ui-icon { left: 4px; } +.ui-header .ui-btn-icon-right .ui-icon, +.ui-footer .ui-btn-icon-right .ui-icon, +.ui-bar .ui-btn-icon-right .ui-icon { right: 4px; } +.ui-header .ui-btn-icon-top .ui-icon, +.ui-footer .ui-btn-icon-top .ui-icon, +.ui-bar .ui-btn-icon-top .ui-icon { top: 4px; } +.ui-header .ui-btn-icon-bottom .ui-icon, +.ui-footer .ui-btn-icon-bottom .ui-icon, +.ui-bar .ui-btn-icon-bottom .ui-icon { bottom: 4px; } +.ui-btn-icon-top .ui-icon { top: 5px; } +.ui-btn-icon-bottom .ui-icon { bottom: 5px; } +/*hiding native button,inputs */ +.ui-btn-hidden { position: absolute; top: 0; left: 0; width: 100%; height: 100%; -webkit-appearance: button; opacity: 0; cursor: pointer; -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; filter: alpha(opacity=0); background: transparent; } +/* +* jQuery Mobile Framework +* Copyright (c) jQuery Project +* Dual licensed under the MIT (MIT-LICENSE.txt) or GPL (GPL-LICENSE.txt) licenses. +*/ +.ui-collapsible-contain { margin: .5em 0; } +.ui-collapsible-heading { font-size: 16px; display: block; margin: 0 -8px; padding: 0; border-width: 0 0 1px 0; position: relative; } +.ui-collapsible-heading a { text-align: left; margin: 0; } +.ui-collapsible-heading a .ui-btn-inner { padding-left: 40px; } +.ui-collapsible-heading a span.ui-btn { position: absolute; left: 6px; top: 50%; margin: -12px 0 0 0; width: 20px; height: 20px; padding: 1px 0px 1px 2px; text-indent: -9999px; } +.ui-collapsible-heading a span.ui-btn .ui-btn-inner { padding: 10px 0; } +.ui-collapsible-heading a span.ui-btn .ui-icon { left: 0; margin-top: -10px; } +.ui-collapsible-heading-status { position:absolute; left:-9999px; } +.ui-collapsible-content { display: block; padding: 10px 0 10px 8px; } +.ui-collapsible-content-collapsed { display: none; } + +.ui-collapsible-set { margin: .5em 0; } +.ui-collapsible-set .ui-collapsible-contain { margin: -1px 0 0; } +/* +* jQuery Mobile Framework +* Copyright (c) jQuery Project +* Dual licensed under the MIT (MIT-LICENSE.txt) or GPL (GPL-LICENSE.txt) licenses. +*/ +.ui-controlgroup, fieldset.ui-controlgroup { padding: 0; margin: .5em 0 1em; } +.ui-bar .ui-controlgroup { margin: 0 .3em; } +.ui-controlgroup-label { font-size: 16px; line-height: 1.4; font-weight: normal; margin: 0 0 .3em; } +.ui-controlgroup-controls { display: block; width: 95%;} +.ui-controlgroup li { list-style: none; } +.ui-controlgroup-vertical .ui-btn, +.ui-controlgroup-vertical .ui-checkbox, .ui-controlgroup-vertical .ui-radio { margin: 0; border-bottom-width: 0; } +.ui-controlgroup-vertical .ui-controlgroup-last { border-bottom-width: 1px; } +.ui-controlgroup-horizontal { padding: 0; } +.ui-controlgroup-horizontal .ui-btn, +.ui-controlgroup-horizontal .ui-checkbox, .ui-controlgroup-horizontal .ui-radio { display: inline-block; margin: 0 -5px 0 0; } +.ui-controlgroup-horizontal .ui-checkbox, .ui-controlgroup-horizontal .ui-radio { display: inline; } +.ui-controlgroup-horizontal .ui-checkbox .ui-btn, .ui-controlgroup-horizontal .ui-radio .ui-btn, +.ui-controlgroup-horizontal .ui-checkbox:last-child, .ui-controlgroup-horizontal .ui-radio:last-child { margin-right: 0; } +.ui-controlgroup-horizontal .ui-controlgroup-last { margin-right: 0; } +.ui-controlgroup .ui-checkbox label, .ui-controlgroup .ui-radio label { font-size: 16px; } +/* conflicts with listview.. +.ui-controlgroup .ui-btn-icon-notext { width: 30px; height: 30px; text-indent: -9999px; } +.ui-controlgroup .ui-btn-icon-notext .ui-btn-inner { padding: 5px 6px 5px 5px; } +*/ + +@media all and (min-width: 450px){ + .ui-controlgroup-label { vertical-align: top; display: inline-block; width: 20%; margin: 0 2% 0 0; } + .ui-controlgroup-controls { width: 60%; display: inline-block; } +} /* +* jQuery Mobile Framework +* Copyright (c) jQuery Project +* Dual licensed under the MIT (MIT-LICENSE.txt) or GPL (GPL-LICENSE.txt) licenses. +*/ +.ui-dialog { min-height: 480px; } +.ui-dialog .ui-header, .ui-dialog .ui-content, .ui-dialog .ui-footer { margin: 15px; position: relative; } +.ui-dialog .ui-header, .ui-dialog .ui-footer { z-index: 10; width: auto; } +.ui-dialog .ui-content, .ui-dialog .ui-footer { margin-top: -15px; }/* +* jQuery Mobile Framework +* Copyright (c) jQuery Project +* Dual licensed under the MIT (MIT-LICENSE.txt) or GPL (GPL-LICENSE.txt) licenses. +*/ +.ui-checkbox, .ui-radio { position:relative; margin: .2em 0 .5em; z-index: 1; } +.ui-checkbox .ui-btn, .ui-radio .ui-btn { margin: 0; text-align: left; z-index: 2; } +.ui-checkbox .ui-btn-inner, .ui-radio .ui-btn-inner { white-space: normal; } +.ui-checkbox .ui-btn-icon-left .ui-btn-inner,.ui-radio .ui-btn-icon-left .ui-btn-inner { padding-left: 45px; } +.ui-checkbox .ui-btn-icon-right .ui-btn-inner, .ui-radio .ui-btn-icon-right .ui-btn-inner { padding-right: 45px; } +.ui-checkbox .ui-icon, .ui-radio .ui-icon { top: 1.1em; } +.ui-checkbox .ui-btn-icon-left .ui-icon, .ui-radio .ui-btn-icon-left .ui-icon {left: 15px; } +.ui-checkbox .ui-btn-icon-right .ui-icon, .ui-radio .ui-btn-icon-right .ui-icon {right: 15px; } +/* input, label positioning */ +.ui-checkbox input,.ui-radio input { position:absolute; left:20px; top:50%; width: 10px; height: 10px; margin:-5px 0 0 0; outline: 0 !important; z-index: 1; }/* +* jQuery Mobile Framework +* Copyright (c) jQuery Project +* Dual licensed under the MIT (MIT-LICENSE.txt) or GPL (GPL-LICENSE.txt) licenses. +*/ +.ui-field-contain { padding: 1.5em 0; margin: 0; border-bottom-width: 1px; overflow: visible; } +.ui-field-contain:first-child { border-top-width: 0; } +@media all and (min-width: 450px){ + .ui-field-contain { border-width: 0; padding: 0; margin: 1em 0; } +} /* +* jQuery Mobile Framework +* Copyright (c) jQuery Project +* Dual licensed under the MIT (MIT-LICENSE.txt) or GPL (GPL-LICENSE.txt) licenses. +*/ +.ui-select { display: block; position: relative; } +.ui-select select { position: absolute; left: -9999px; top: -9999px; } +.ui-select .ui-btn { overflow: hidden; } +.ui-select .ui-btn select { cursor: pointer; -webkit-appearance: button; left: 0; top:0; width: 100%; height: 100%; opacity: 0; -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; filter: alpha(opacity=0); } +.ui-select .ui-btn select.ui-select-nativeonly { opacity: 1; text-indent: 0; } + +.ui-select .ui-btn-icon-right .ui-btn-inner { padding-right: 45px; } +.ui-select .ui-btn-icon-right .ui-icon { right: 15px; } + +/* labels */ +label.ui-select { font-size: 16px; line-height: 1.4; font-weight: normal; margin: 0 0 .3em; display: block; } + +/*listbox*/ +.ui-select .ui-btn-text, .ui-selectmenu .ui-btn-text { display: block; min-height: 1em; } +.ui-select .ui-btn-text { text-overflow: ellipsis; overflow: hidden;} + +.ui-selectmenu { position: absolute; padding: 0; z-index: 100 !important; width: 80%; max-width: 350px; padding: 6px; } +.ui-selectmenu .ui-listview { margin: 0; } +.ui-selectmenu .ui-btn.ui-li-divider { cursor: default; } +.ui-selectmenu-hidden { top: -9999px; left: -9999px; } +.ui-selectmenu-screen { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 99; } +.ui-screen-hidden, .ui-selectmenu-list .ui-li .ui-icon { display: none; } +.ui-selectmenu-list .ui-li .ui-icon { display: block; } +.ui-li.ui-selectmenu-placeholder { display: none; } +.ui-selectmenu .ui-header .ui-title { margin: 0.6em 46px 0.8em; } + +@media all and (min-width: 450px){ + label.ui-select { display: inline-block; width: 20%; margin: 0 2% 0 0; } + .ui-select { width: 60%; display: inline-block; } +} + +/* when no placeholder is defined in a multiple select, the header height doesn't even extend past the close button. this shim's content in there */ +.ui-selectmenu .ui-header h1:after { content: '.'; visibility: hidden; }/* +* jQuery Mobile Framework +* Copyright (c) jQuery Project +* Dual licensed under the MIT (MIT-LICENSE.txt) or GPL (GPL-LICENSE.txt) licenses. +*/ +label.ui-input-text { font-size: 16px; line-height: 1.4; display: block; font-weight: normal; margin: 0 0 .3em; } +input.ui-input-text, textarea.ui-input-text { background-image: none; padding: .4em; line-height: 1.4; font-size: 16px; display: block; width: 95%; } +input.ui-input-text { -webkit-appearance: none; } +textarea.ui-input-text { height: 50px; -webkit-transition: height 200ms linear; -moz-transition: height 200ms linear; -o-transition: height 200ms linear; transition: height 200ms linear; } +.ui-input-search { padding: 0 30px; width: 77%; background-position: 8px 50%; background-repeat: no-repeat; position: relative; } +.ui-input-search input.ui-input-text { border: none; width: 98%; padding: .4em 0; margin: 0; display: block; background: transparent none; outline: 0 !important; } +.ui-input-search .ui-input-clear { position: absolute; right: 0; top: 50%; margin-top: -14px; } +.ui-input-search .ui-input-clear-hidden { display: none; } + +/* orientation adjustments - incomplete!*/ +@media all and (min-width: 450px){ + label.ui-input-text { vertical-align: top; display: inline-block; width: 20%; margin: 0 2% 0 0 } + input.ui-input-text, + textarea.ui-input-text, + .ui-input-search { width: 60%; display: inline-block; } + .ui-input-search { width: 50%; } + .ui-input-search input.ui-input-text { width: 98%; /*echos rule from above*/ } +}/* +* jQuery Mobile Framework +* Copyright (c) jQuery Project +* Dual licensed under the MIT (MIT-LICENSE.txt) or GPL (GPL-LICENSE.txt) licenses. +*/ +.ui-listview { margin: 0; counter-reset: listnumbering; } +.ui-content .ui-listview { margin: -15px; } +.ui-content .ui-listview-inset { margin: 1em 0; } +.ui-listview, .ui-li { list-style:none; padding:0; } +.ui-li, .ui-li.ui-field-contain { display: block; margin:0; position: relative; overflow: visible; text-align: left; border-width: 0; border-top-width: 1px; } +.ui-li .ui-btn-text a.ui-link-inherit { text-overflow: ellipsis; overflow: hidden; white-space: nowrap; } +.ui-li-divider, .ui-li-static { padding: .5em 15px; font-size: 14px; font-weight: bold; } +.ui-li-divider { counter-reset: listnumbering; } +ol.ui-listview .ui-link-inherit:before, ol.ui-listview .ui-li-static:before, .ui-li-dec { font-size: .8em; display: inline-block; padding-right: .3em; font-weight: normal;counter-increment: listnumbering; content: counter(listnumbering) ". "; } +ol.ui-listview .ui-li-jsnumbering:before { content: "" !important; } /* to avoid chance of duplication */ +.ui-listview-inset .ui-li { border-right-width: 1px; border-left-width: 1px; } +.ui-li:last-child, .ui-li.ui-field-contain:last-child { border-bottom-width: 1px; } +.ui-li>.ui-btn-inner { display: block; position: relative; padding: 0; } +.ui-li .ui-btn-inner a.ui-link-inherit, .ui-li-static.ui-li { padding: .7em 75px .7em 15px; display: block; } +.ui-li-has-thumb .ui-btn-inner a.ui-link-inherit, .ui-li-static.ui-li-has-thumb { min-height: 60px; padding-left: 100px; } +.ui-li-has-icon .ui-btn-inner a.ui-link-inherit, .ui-li-static.ui-li-has-icon { min-height: 20px; padding-left: 40px; } +.ui-li-heading { font-size: 16px; font-weight: bold; display: block; margin: .6em 0; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; } +.ui-li-desc { font-size: 12px; font-weight: normal; display: block; margin: -.5em 0 .6em; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; } +.ui-li-thumb, .ui-li-icon { position: absolute; left: 1px; top: 0; max-height: 80px; max-width: 80px; } +.ui-li-icon { max-height: 40px; max-width: 40px; left: 10px; top: .9em; } +.ui-li-thumb, .ui-li-icon, .ui-li-content { float: left; margin-right: 10px; } + +.ui-li-aside { float: right; width: 50%; text-align: right; margin: .3em 0; } +@media all and (min-width: 480px){ + .ui-li-aside { width: 45%; } +} +.ui-li-divider { cursor: default; } +.ui-li-has-alt .ui-btn-inner a.ui-link-inherit, .ui-li-static.ui-li-has-alt { padding-right: 95px; } +.ui-li-count { position: absolute; font-size: 11px; font-weight: bold; padding: .2em .5em; top: 50%; margin-top: -.9em; right: 38px; } +.ui-li-divider .ui-li-count, .ui-li-static .ui-li-count { right: 10px; } +.ui-li-has-alt .ui-li-count { right: 55px; } +.ui-li-link-alt { position: absolute; width: 40px; height: 100%; border-width: 0; border-left-width: 1px; top: 0; right: 0; margin: 0; padding: 0; } +.ui-li-link-alt .ui-btn { overflow: hidden; position: absolute; right: 8px; top: 50%; margin: -11px 0 0 0; border-bottom-width: 1px; } +.ui-li-link-alt .ui-btn-inner { padding: 0; position: static; } +.ui-li-link-alt .ui-btn .ui-icon { right: 50%; margin-right: -9px; } + +.ui-listview-filter { border-width: 0; overflow: hidden; margin: -15px -15px 15px -15px } +.ui-listview-filter .ui-input-search { margin: 5px; width: auto; display: block; } + +.ui-listview-filter-inset { margin: -15px -5px -15px -5px; background: transparent; } +.ui-li.ui-screen-hidden{display:none;} +/* Odd iPad positioning issue. */ +@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) { + .ui-li .ui-btn-text { overflow: visible; } +}/* +* jQuery Mobile Framework +* Copyright (c) jQuery Project +* Dual licensed under the MIT (MIT-LICENSE.txt) or GPL (GPL-LICENSE.txt) licenses. +*/ +label.ui-slider { display: block; } +input.ui-slider-input { display: inline-block; width: 50px; } +select.ui-slider-switch { display: none; } +div.ui-slider { position: relative; display: inline-block; overflow: visible; height: 15px; padding: 0; margin: 0 2% 0 20px; top: 4px; width: 66%; } +a.ui-slider-handle { position: absolute; z-index: 10; top: 50%; width: 28px; height: 28px; margin-top: -15px; margin-left: -15px; } +a.ui-slider-handle .ui-btn-inner { padding-left: 0; padding-right: 0; } +@media all and (min-width: 480px){ + label.ui-slider { display: inline-block; width: 20%; margin: 0 2% 0 0; } + div.ui-slider { width: 45%; } +} + +div.ui-slider-switch { height: 32px; overflow: hidden; margin-left: 0; } +div.ui-slider-inneroffset { margin-left: 50%; position: absolute; top: 1px; height: 100%; width: 50%; } +div.ui-slider-handle-snapping { -webkit-transition: left 100ms linear; } +div.ui-slider-labelbg { position: absolute; top:0; margin: 0; border-width: 0; } +div.ui-slider-switch div.ui-slider-labelbg-a { width: 60%; height: 100%; left: 0; } +div.ui-slider-switch div.ui-slider-labelbg-b { width: 60%; height: 100%; right: 0; } +.ui-slider-switch-a div.ui-slider-labelbg-a, .ui-slider-switch-b div.ui-slider-labelbg-b { z-index: -1; } +.ui-slider-switch-a div.ui-slider-labelbg-b, .ui-slider-switch-b div.ui-slider-labelbg-a { z-index: 0; } + +div.ui-slider-switch a.ui-slider-handle { z-index: 20; width: 101%; height: 32px; margin-top: -18px; margin-left: -101%; } +span.ui-slider-label { width: 96%; position: absolute;height: 32px; font-size: 16px; text-align: center; line-height: 2; background: none; border-color: transparent;} +span.ui-slider-label-a { left: -100%; margin-right: -1px } +span.ui-slider-label-b { right: -100%; margin-left: -1px } diff --git a/src/themes/tizen/tizen-black/Makefile b/src/themes/tizen/tizen-black/Makefile new file mode 100755 index 0000000..4fb146d --- /dev/null +++ b/src/themes/tizen/tizen-black/Makefile @@ -0,0 +1,84 @@ +THEME_NAME=tizen-black + +THEME_OUTPUT_ROOT ?= . +OUTPUT_DIR = ${THEME_OUTPUT_ROOT}/${THEME_NAME} + +CSS_OUTPUT = ${OUTPUT_DIR}/tizen-web-ui-fw-theme.css + +CSS_SRCS= ../common/jquery.mobile.theme.less.css \ + ../common/jquery.mobile.core.less.css \ + ../common/jquery.mobile.transitions.css \ + ../common/jquery.mobile.grids.css \ + ../common/jquery.mobile.headerfooter.less.css \ + ../common/jquery.mobile.navbar.css \ + ../common/jquery.mobile.button.less.css \ + ../common/jquery.mobile.collapsible.css \ + ../common/jquery.mobile.dialog.less.css \ + ../common/jquery.mobile.forms.checkboxradio.less.css \ + ../common/jquery.mobile.forms.fieldcontain.css \ + ../common/jquery.mobile.forms.select.css \ + ../common/jquery.mobile.forms.textinput.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.hsvpicker.less.css \ + ../common/jquery.mobile.tizen.colorpalette.less.css \ + ../common/jquery.mobile.tizen.colortitle.less.css \ + ../common/jquery.mobile.tizen.datetimepicker.less.css \ + ../common/jquery.mobile.tizen.popupwindow.less.css \ + ../common/jquery.mobile.tizen.ctxpopup.less.css \ + ../common/jquery.mobile.tizen.progressbar.less.css \ + ../common/jquery.mobile.tizen.progress.less.css \ + ../common/jquery.mobile.tizen.slider.less.css \ + ../common/jquery.mobile.tizen.imageslider.less.css \ + ../common/jquery.mobile.tizen.notification.less.css \ + ../common/jquery.mobile.tizen.pagecontrol.less.css \ + ../common/jquery.mobile.tizen.swipelist.less.css \ + ../common/jquery.mobile.tizen.nocontents.less.css \ + ../common/jquery.mobile.tizen.shortcutscroll.less.css \ + ../common/jquery.mobile.tizen.dayselector.less.css \ + ../common/jquery.mobile.tizen.toggleswitch.less.css \ + ../common/jquery.mobile.tizen.huegradient.css \ + ../common/jquery.mobile.tizen.colorpicker.less.css \ + ../common/jquery.mobile.tizen.colorpickerbutton.less.css \ + ../common/jquery.mobile.tizen.triangle.less.css \ + ../common/jquery.mobile.tizen.multibuttonentry.less.css \ + ../common/jquery.mobile.tizen.scrollview.handler.less.css \ + ../common/jquery.mobile.tizen.virtualgridview.less.css \ + ../common/jquery.mobile.tizen.multimediaview.less.css \ + +all: prepare css images js + +prepare: + -mkdir -p ${OUTPUT_DIR} + +less: prepare + # Compiling less to css... + @for f in `find ../common -iname '*.less' | sort`; do \ + if test "config.less" = "$$f" ; then continue; fi; \ + echo " build $$f"; \ + lessc $$f > $$f.css; \ + done; + +css: prepare less + # Creating tizen-black theme... + @rm -f $(CSS_OUTPUT) + @for src in $(CSS_SRCS); do \ + cat $$src >> $(CSS_OUTPUT) ; \ + done + +images: prepare + # Copying tizen-black theme images... + @cp -a images/ ${OUTPUT_DIR}/ + +js: prepare + @cp -a theme.js ${OUTPUT_DIR} + +clean: + # Cleaning tizen-black theme... + -rm -rf $(OUTPUT_DIR) + -rm -f *.less.css + diff --git a/src/themes/tizen/tizen-black/config.less b/src/themes/tizen/tizen-black/config.less new file mode 100755 index 0000000..278e54b --- /dev/null +++ b/src/themes/tizen/tizen-black/config.less @@ -0,0 +1,5 @@ +/**************************** + * Tizen Common Less Header * + ****************************/ +@import "../common/jquery.mobile.tizen.less"; +@import "style.less"; diff --git a/src/themes/tizen/tizen-black/images/00_Nocontents_multimedia.png b/src/themes/tizen/tizen-black/images/00_Nocontents_multimedia.png new file mode 100644 index 0000000..e543f75 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_Nocontents_multimedia.png differ diff --git a/src/themes/tizen/tizen-black/images/00_Nocontents_picture.png b/src/themes/tizen/tizen-black/images/00_Nocontents_picture.png new file mode 100644 index 0000000..a53dda3 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_Nocontents_picture.png differ diff --git a/src/themes/tizen/tizen-black/images/00_Nocontents_text.png b/src/themes/tizen/tizen-black/images/00_Nocontents_text.png new file mode 100644 index 0000000..394e67f Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_Nocontents_text.png differ diff --git a/src/themes/tizen/tizen-black/images/00_Nocontents_unnamed.png b/src/themes/tizen/tizen-black/images/00_Nocontents_unnamed.png new file mode 100644 index 0000000..0bc1a2d Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_Nocontents_unnamed.png differ diff --git a/src/themes/tizen/tizen-black/images/00_button_call.png b/src/themes/tizen/tizen-black/images/00_button_call.png new file mode 100644 index 0000000..9c13b04 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_button_call.png differ diff --git a/src/themes/tizen/tizen-black/images/00_button_call_press.png b/src/themes/tizen/tizen-black/images/00_button_call_press.png new file mode 100644 index 0000000..9c13b04 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_button_call_press.png differ diff --git a/src/themes/tizen/tizen-black/images/00_button_cancel.png b/src/themes/tizen/tizen-black/images/00_button_cancel.png new file mode 100755 index 0000000..f8eaf80 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_button_cancel.png differ diff --git a/src/themes/tizen/tizen-black/images/00_button_cancel_normal.png b/src/themes/tizen/tizen-black/images/00_button_cancel_normal.png new file mode 100644 index 0000000..f8eaf80 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_button_cancel_normal.png differ diff --git a/src/themes/tizen/tizen-black/images/00_button_cancel_press.png b/src/themes/tizen/tizen-black/images/00_button_cancel_press.png new file mode 100644 index 0000000..f8eaf80 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_button_cancel_press.png differ diff --git a/src/themes/tizen/tizen-black/images/00_button_expand_closed.png b/src/themes/tizen/tizen-black/images/00_button_expand_closed.png new file mode 100644 index 0000000..e6c51de Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_button_expand_closed.png differ diff --git a/src/themes/tizen/tizen-black/images/00_button_expand_closed_press.png b/src/themes/tizen/tizen-black/images/00_button_expand_closed_press.png new file mode 100644 index 0000000..b421ad1 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_button_expand_closed_press.png differ diff --git a/src/themes/tizen/tizen-black/images/00_button_expand_opened.png b/src/themes/tizen/tizen-black/images/00_button_expand_opened.png new file mode 100644 index 0000000..1b49c94 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_button_expand_opened.png differ diff --git a/src/themes/tizen/tizen-black/images/00_button_expand_opened_press.png b/src/themes/tizen/tizen-black/images/00_button_expand_opened_press.png new file mode 100644 index 0000000..1b49c94 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_button_expand_opened_press.png differ diff --git a/src/themes/tizen/tizen-black/images/00_button_fullscreen_off.png b/src/themes/tizen/tizen-black/images/00_button_fullscreen_off.png new file mode 100755 index 0000000..cafa0aa Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_button_fullscreen_off.png differ diff --git a/src/themes/tizen/tizen-black/images/00_button_fullscreen_on.png b/src/themes/tizen/tizen-black/images/00_button_fullscreen_on.png new file mode 100755 index 0000000..4bb212b Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_button_fullscreen_on.png differ diff --git a/src/themes/tizen/tizen-black/images/00_button_icon_minus.png b/src/themes/tizen/tizen-black/images/00_button_icon_minus.png new file mode 100755 index 0000000..eadabad Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_button_icon_minus.png differ diff --git a/src/themes/tizen/tizen-black/images/00_button_icon_minus_press.png b/src/themes/tizen/tizen-black/images/00_button_icon_minus_press.png new file mode 100755 index 0000000..eadabad Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_button_icon_minus_press.png differ diff --git a/src/themes/tizen/tizen-black/images/00_button_info.png b/src/themes/tizen/tizen-black/images/00_button_info.png new file mode 100644 index 0000000..4a6e104 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_button_info.png differ diff --git a/src/themes/tizen/tizen-black/images/00_button_info_press.png b/src/themes/tizen/tizen-black/images/00_button_info_press.png new file mode 100644 index 0000000..4a6e104 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_button_info_press.png differ diff --git a/src/themes/tizen/tizen-black/images/00_button_minus_normal.png b/src/themes/tizen/tizen-black/images/00_button_minus_normal.png new file mode 100644 index 0000000..eadabad Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_button_minus_normal.png differ diff --git a/src/themes/tizen/tizen-black/images/00_button_minus_press.png b/src/themes/tizen/tizen-black/images/00_button_minus_press.png new file mode 100644 index 0000000..eadabad Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_button_minus_press.png differ diff --git a/src/themes/tizen/tizen-black/images/00_button_pause.png b/src/themes/tizen/tizen-black/images/00_button_pause.png new file mode 100755 index 0000000..0e0a7fb Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_button_pause.png differ diff --git a/src/themes/tizen/tizen-black/images/00_button_play.png b/src/themes/tizen/tizen-black/images/00_button_play.png new file mode 100755 index 0000000..81e88d3 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_button_play.png differ diff --git a/src/themes/tizen/tizen-black/images/00_button_plus_normal.png b/src/themes/tizen/tizen-black/images/00_button_plus_normal.png new file mode 100644 index 0000000..724d1a8 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_button_plus_normal.png differ diff --git a/src/themes/tizen/tizen-black/images/00_button_plus_press.png b/src/themes/tizen/tizen-black/images/00_button_plus_press.png new file mode 100644 index 0000000..724d1a8 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_button_plus_press.png differ diff --git a/src/themes/tizen/tizen-black/images/00_button_radio_normal1.png b/src/themes/tizen/tizen-black/images/00_button_radio_normal1.png new file mode 100644 index 0000000..f0f8747 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_button_radio_normal1.png differ diff --git a/src/themes/tizen/tizen-black/images/00_button_radio_normal2.png b/src/themes/tizen/tizen-black/images/00_button_radio_normal2.png new file mode 100644 index 0000000..7bca9d2 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_button_radio_normal2.png differ diff --git a/src/themes/tizen/tizen-black/images/00_button_radio_press1.png b/src/themes/tizen/tizen-black/images/00_button_radio_press1.png new file mode 100755 index 0000000..7e5a8a1 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_button_radio_press1.png differ diff --git a/src/themes/tizen/tizen-black/images/00_button_radio_press2.png b/src/themes/tizen/tizen-black/images/00_button_radio_press2.png new file mode 100755 index 0000000..7d3eda3 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_button_radio_press2.png differ diff --git a/src/themes/tizen/tizen-black/images/00_button_rename.png b/src/themes/tizen/tizen-black/images/00_button_rename.png new file mode 100755 index 0000000..39c5de5 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_button_rename.png differ diff --git a/src/themes/tizen/tizen-black/images/00_button_rename_press.png b/src/themes/tizen/tizen-black/images/00_button_rename_press.png new file mode 100755 index 0000000..39c5de5 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_button_rename_press.png differ diff --git a/src/themes/tizen/tizen-black/images/00_button_reveal.png b/src/themes/tizen/tizen-black/images/00_button_reveal.png new file mode 100755 index 0000000..973b0ea Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_button_reveal.png differ diff --git a/src/themes/tizen/tizen-black/images/00_button_reveal_left.png b/src/themes/tizen/tizen-black/images/00_button_reveal_left.png new file mode 100755 index 0000000..5740523 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_button_reveal_left.png differ diff --git a/src/themes/tizen/tizen-black/images/00_button_reveal_left_press.png b/src/themes/tizen/tizen-black/images/00_button_reveal_left_press.png new file mode 100755 index 0000000..c1a99fa Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_button_reveal_left_press.png differ diff --git a/src/themes/tizen/tizen-black/images/00_button_reveal_normal.png b/src/themes/tizen/tizen-black/images/00_button_reveal_normal.png new file mode 100755 index 0000000..973b0ea Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_button_reveal_normal.png differ diff --git a/src/themes/tizen/tizen-black/images/00_button_reveal_press.png b/src/themes/tizen/tizen-black/images/00_button_reveal_press.png new file mode 100755 index 0000000..973b0ea Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_button_reveal_press.png differ diff --git a/src/themes/tizen/tizen-black/images/00_button_send.png b/src/themes/tizen/tizen-black/images/00_button_send.png new file mode 100644 index 0000000..c3bf732 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_button_send.png differ diff --git a/src/themes/tizen/tizen-black/images/00_button_send_press.png b/src/themes/tizen/tizen-black/images/00_button_send_press.png new file mode 100644 index 0000000..c3bf732 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_button_send_press.png differ diff --git a/src/themes/tizen/tizen-black/images/00_button_warning.png b/src/themes/tizen/tizen-black/images/00_button_warning.png new file mode 100755 index 0000000..98a1265 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_button_warning.png differ diff --git a/src/themes/tizen/tizen-black/images/00_button_warning_press.png b/src/themes/tizen/tizen-black/images/00_button_warning_press.png new file mode 100755 index 0000000..98a1265 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_button_warning_press.png differ diff --git a/src/themes/tizen/tizen-black/images/00_check_bg.png b/src/themes/tizen/tizen-black/images/00_check_bg.png new file mode 100644 index 0000000..b47caa5 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_check_bg.png differ diff --git a/src/themes/tizen/tizen-black/images/00_check_bg_press.png b/src/themes/tizen/tizen-black/images/00_check_bg_press.png new file mode 100755 index 0000000..c985364 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_check_bg_press.png differ diff --git a/src/themes/tizen/tizen-black/images/00_check_checking.png b/src/themes/tizen/tizen-black/images/00_check_checking.png new file mode 100755 index 0000000..8f921d7 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_check_checking.png differ diff --git a/src/themes/tizen/tizen-black/images/00_field_btn_Clear.png b/src/themes/tizen/tizen-black/images/00_field_btn_Clear.png new file mode 100755 index 0000000..eb925dc Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_field_btn_Clear.png differ diff --git a/src/themes/tizen/tizen-black/images/00_indexlist_icon_closed.png b/src/themes/tizen/tizen-black/images/00_indexlist_icon_closed.png new file mode 100755 index 0000000..481935c Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_indexlist_icon_closed.png differ diff --git a/src/themes/tizen/tizen-black/images/00_indexlist_icon_opened.png b/src/themes/tizen/tizen-black/images/00_indexlist_icon_opened.png new file mode 100755 index 0000000..27b7bab Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_indexlist_icon_opened.png differ diff --git a/src/themes/tizen/tizen-black/images/00_mainmenu_page_bar_001.png b/src/themes/tizen/tizen-black/images/00_mainmenu_page_bar_001.png new file mode 100755 index 0000000..cf3d69c Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_mainmenu_page_bar_001.png differ diff --git a/src/themes/tizen/tizen-black/images/00_mainmenu_page_bar_002.png b/src/themes/tizen/tizen-black/images/00_mainmenu_page_bar_002.png new file mode 100755 index 0000000..e49b277 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_mainmenu_page_bar_002.png differ diff --git a/src/themes/tizen/tizen-black/images/00_mainmenu_page_bar_01.png b/src/themes/tizen/tizen-black/images/00_mainmenu_page_bar_01.png new file mode 100755 index 0000000..901dac3 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_mainmenu_page_bar_01.png differ diff --git a/src/themes/tizen/tizen-black/images/00_mainmenu_page_bar_02.png b/src/themes/tizen/tizen-black/images/00_mainmenu_page_bar_02.png new file mode 100755 index 0000000..b81cbf8 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_mainmenu_page_bar_02.png differ diff --git a/src/themes/tizen/tizen-black/images/00_mainmenu_page_bar_03.png b/src/themes/tizen/tizen-black/images/00_mainmenu_page_bar_03.png new file mode 100755 index 0000000..f62e65b Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_mainmenu_page_bar_03.png differ diff --git a/src/themes/tizen/tizen-black/images/00_mainmenu_page_bar_04.png b/src/themes/tizen/tizen-black/images/00_mainmenu_page_bar_04.png new file mode 100755 index 0000000..86be281 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_mainmenu_page_bar_04.png differ diff --git a/src/themes/tizen/tizen-black/images/00_mainmenu_page_bar_05.png b/src/themes/tizen/tizen-black/images/00_mainmenu_page_bar_05.png new file mode 100755 index 0000000..9255391 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_mainmenu_page_bar_05.png differ diff --git a/src/themes/tizen/tizen-black/images/00_mainmenu_page_bar_06.png b/src/themes/tizen/tizen-black/images/00_mainmenu_page_bar_06.png new file mode 100755 index 0000000..1635f8a Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_mainmenu_page_bar_06.png differ diff --git a/src/themes/tizen/tizen-black/images/00_mainmenu_page_bar_07.png b/src/themes/tizen/tizen-black/images/00_mainmenu_page_bar_07.png new file mode 100755 index 0000000..cf91725 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_mainmenu_page_bar_07.png differ diff --git a/src/themes/tizen/tizen-black/images/00_mainmenu_page_bar_08.png b/src/themes/tizen/tizen-black/images/00_mainmenu_page_bar_08.png new file mode 100755 index 0000000..df1adb7 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_mainmenu_page_bar_08.png differ diff --git a/src/themes/tizen/tizen-black/images/00_mainmenu_page_bar_09.png b/src/themes/tizen/tizen-black/images/00_mainmenu_page_bar_09.png new file mode 100755 index 0000000..1264428 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_mainmenu_page_bar_09.png differ diff --git a/src/themes/tizen/tizen-black/images/00_mainmenu_page_bar_10.png b/src/themes/tizen/tizen-black/images/00_mainmenu_page_bar_10.png new file mode 100755 index 0000000..e0a87f5 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_mainmenu_page_bar_10.png differ diff --git a/src/themes/tizen/tizen-black/images/00_scroll_bar_handler.png b/src/themes/tizen/tizen-black/images/00_scroll_bar_handler.png new file mode 100755 index 0000000..52ffbef Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_scroll_bar_handler.png differ diff --git a/src/themes/tizen/tizen-black/images/00_scroll_bar_handler_hor.png b/src/themes/tizen/tizen-black/images/00_scroll_bar_handler_hor.png new file mode 100755 index 0000000..76a84a9 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_scroll_bar_handler_hor.png differ diff --git a/src/themes/tizen/tizen-black/images/00_scroll_icon_jump.png b/src/themes/tizen/tizen-black/images/00_scroll_icon_jump.png new file mode 100644 index 0000000..bf3e7d3 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_scroll_icon_jump.png differ diff --git a/src/themes/tizen/tizen-black/images/00_scroll_icon_jump_left.png b/src/themes/tizen/tizen-black/images/00_scroll_icon_jump_left.png new file mode 100644 index 0000000..5188da9 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_scroll_icon_jump_left.png differ diff --git a/src/themes/tizen/tizen-black/images/00_scroll_jump_bg.png b/src/themes/tizen/tizen-black/images/00_scroll_jump_bg.png new file mode 100644 index 0000000..93845de Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_scroll_jump_bg.png differ diff --git a/src/themes/tizen/tizen-black/images/00_search_icon.png b/src/themes/tizen/tizen-black/images/00_search_icon.png new file mode 100755 index 0000000..bc3dc08 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_search_icon.png differ diff --git a/src/themes/tizen/tizen-black/images/00_slider_btn_brightness01.png b/src/themes/tizen/tizen-black/images/00_slider_btn_brightness01.png new file mode 100644 index 0000000..2d340b7 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_slider_btn_brightness01.png differ diff --git a/src/themes/tizen/tizen-black/images/00_slider_btn_brightness02.png b/src/themes/tizen/tizen-black/images/00_slider_btn_brightness02.png new file mode 100644 index 0000000..5cbd9cc Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_slider_btn_brightness02.png differ diff --git a/src/themes/tizen/tizen-black/images/00_slider_btn_volume01.png b/src/themes/tizen/tizen-black/images/00_slider_btn_volume01.png new file mode 100644 index 0000000..3f60b16 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_slider_btn_volume01.png differ diff --git a/src/themes/tizen/tizen-black/images/00_slider_btn_volume02.png b/src/themes/tizen/tizen-black/images/00_slider_btn_volume02.png new file mode 100644 index 0000000..3d7f4f6 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_slider_btn_volume02.png differ diff --git a/src/themes/tizen/tizen-black/images/00_slider_handle.png b/src/themes/tizen/tizen-black/images/00_slider_handle.png new file mode 100644 index 0000000..b58aac1 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_slider_handle.png differ diff --git a/src/themes/tizen/tizen-black/images/00_slider_handle_dim.png b/src/themes/tizen/tizen-black/images/00_slider_handle_dim.png new file mode 100644 index 0000000..fa620b2 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_slider_handle_dim.png differ diff --git a/src/themes/tizen/tizen-black/images/00_slider_handle_press.png b/src/themes/tizen/tizen-black/images/00_slider_handle_press.png new file mode 100644 index 0000000..a7f0a3a Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_slider_handle_press.png differ diff --git a/src/themes/tizen/tizen-black/images/00_slider_popup_bg.png b/src/themes/tizen/tizen-black/images/00_slider_popup_bg.png new file mode 100644 index 0000000..d29b022 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_slider_popup_bg.png differ diff --git a/src/themes/tizen/tizen-black/images/00_winset_Back.png b/src/themes/tizen/tizen-black/images/00_winset_Back.png new file mode 100755 index 0000000..8cdf9d4 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_winset_Back.png differ diff --git a/src/themes/tizen/tizen-black/images/00_winset_control_top_arrow.png b/src/themes/tizen/tizen-black/images/00_winset_control_top_arrow.png new file mode 100755 index 0000000..914bb98 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_winset_control_top_arrow.png differ diff --git a/src/themes/tizen/tizen-black/images/00_winset_icon_favorite_off.png b/src/themes/tizen/tizen-black/images/00_winset_icon_favorite_off.png new file mode 100644 index 0000000..e489855 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_winset_icon_favorite_off.png differ diff --git a/src/themes/tizen/tizen-black/images/00_winset_icon_favorite_on.png b/src/themes/tizen/tizen-black/images/00_winset_icon_favorite_on.png new file mode 100644 index 0000000..184fdab Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_winset_icon_favorite_on.png differ diff --git a/src/themes/tizen/tizen-black/images/00_winset_list_process_01.png b/src/themes/tizen/tizen-black/images/00_winset_list_process_01.png new file mode 100644 index 0000000..8124a7b Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_winset_list_process_01.png differ diff --git a/src/themes/tizen/tizen-black/images/00_winset_list_progress_bar.png b/src/themes/tizen/tizen-black/images/00_winset_list_progress_bar.png new file mode 100644 index 0000000..9d979e2 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_winset_list_progress_bar.png differ diff --git a/src/themes/tizen/tizen-black/images/00_winset_list_progress_bg.png b/src/themes/tizen/tizen-black/images/00_winset_list_progress_bg.png new file mode 100644 index 0000000..0bec791 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_winset_list_progress_bg.png differ diff --git a/src/themes/tizen/tizen-black/images/00_winset_more.png b/src/themes/tizen/tizen-black/images/00_winset_more.png new file mode 100755 index 0000000..473d5aa Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_winset_more.png differ diff --git a/src/themes/tizen/tizen-black/images/00_winset_more_press.png b/src/themes/tizen/tizen-black/images/00_winset_more_press.png new file mode 100755 index 0000000..6d65ea6 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/00_winset_more_press.png differ diff --git a/src/themes/tizen/tizen-black/images/Volume/00_volume_icon.png b/src/themes/tizen/tizen-black/images/Volume/00_volume_icon.png new file mode 100644 index 0000000..d2a4094 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/Volume/00_volume_icon.png differ diff --git a/src/themes/tizen/tizen-black/images/Volume/00_volume_icon_Mute.png b/src/themes/tizen/tizen-black/images/Volume/00_volume_icon_Mute.png new file mode 100644 index 0000000..42c3560 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/Volume/00_volume_icon_Mute.png differ diff --git a/src/themes/tizen/tizen-black/images/ajax-loader.png b/src/themes/tizen/tizen-black/images/ajax-loader.png new file mode 100755 index 0000000..811a2cd Binary files /dev/null and b/src/themes/tizen/tizen-black/images/ajax-loader.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_3Dview.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_3Dview.png new file mode 100755 index 0000000..9769b25 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_3Dview.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_Add_buddy_to_chat.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_Add_buddy_to_chat.png new file mode 100755 index 0000000..65d47e4 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_Add_buddy_to_chat.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_Chat.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_Chat.png new file mode 100755 index 0000000..1608e4f Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_Chat.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_DM.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_DM.png new file mode 100755 index 0000000..2528dd4 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_DM.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_Externalstorage.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_Externalstorage.png new file mode 100755 index 0000000..247fa73 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_Externalstorage.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_MemoryCard.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_MemoryCard.png new file mode 100755 index 0000000..3f10810 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_MemoryCard.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_Play.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_Play.png new file mode 100755 index 0000000..4a0505e Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_Play.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_Ringtone.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_Ringtone.png new file mode 100755 index 0000000..615d4f8 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_Ringtone.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_Save_in_memo.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_Save_in_memo.png new file mode 100755 index 0000000..132f663 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_Save_in_memo.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_Save_the_word.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_Save_the_word.png new file mode 100755 index 0000000..b8660bd Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_Save_the_word.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_TTS.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_TTS.png new file mode 100755 index 0000000..666c821 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_TTS.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_Voice_command.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_Voice_command.png new file mode 100755 index 0000000..05500c1 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_Voice_command.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_account_sign-up.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_account_sign-up.png new file mode 100755 index 0000000..2288758 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_account_sign-up.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_accounts.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_accounts.png new file mode 100755 index 0000000..768d8db Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_accounts.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_add-to-bookmarks.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_add-to-bookmarks.png new file mode 100755 index 0000000..bc2e48b Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_add-to-bookmarks.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_add-to-calendar.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_add-to-calendar.png new file mode 100755 index 0000000..20eae31 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_add-to-calendar.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_add_tag.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_add_tag.png new file mode 100755 index 0000000..4676b81 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_add_tag.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_add_to_contact.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_add_to_contact.png new file mode 100755 index 0000000..65d47e4 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_add_to_contact.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_alarm.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_alarm.png new file mode 100755 index 0000000..50997d5 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_alarm.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_albums.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_albums.png new file mode 100755 index 0000000..03f8404 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_albums.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_area.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_area.png new file mode 100755 index 0000000..8b3889b Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_area.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_artist.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_artist.png new file mode 100755 index 0000000..c7b10a9 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_artist.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_attach.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_attach.png new file mode 100755 index 0000000..4ab53f2 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_attach.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_back.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_back.png new file mode 100755 index 0000000..64dbf1b Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_back.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_backward.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_backward.png new file mode 100755 index 0000000..066f51c Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_backward.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_bluetooth_preview.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_bluetooth_preview.png new file mode 100755 index 0000000..99946bb Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_bluetooth_preview.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_bookmarks.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_bookmarks.png new file mode 100755 index 0000000..586e1f3 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_bookmarks.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_brightness.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_brightness.png new file mode 100755 index 0000000..953dc47 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_brightness.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_calendar.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_calendar.png new file mode 100755 index 0000000..30cea7c Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_calendar.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_call.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_call.png new file mode 100755 index 0000000..b8b7806 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_call.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_camera.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_camera.png new file mode 100755 index 0000000..234a611 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_camera.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_cancel.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_cancel.png new file mode 100755 index 0000000..5cb7824 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_cancel.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_category.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_category.png new file mode 100755 index 0000000..829b21d Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_category.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_change_group.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_change_group.png new file mode 100755 index 0000000..9d1e569 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_change_group.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_chat.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_chat.png new file mode 100755 index 0000000..50d1943 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_chat.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_check.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_check.png new file mode 100755 index 0000000..5be28b7 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_check.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_close.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_close.png new file mode 100755 index 0000000..91b04e5 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_close.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_compose.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_compose.png new file mode 100755 index 0000000..20b71f7 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_compose.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_composer.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_composer.png new file mode 100755 index 0000000..71a9192 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_composer.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_contacts.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_contacts.png new file mode 100755 index 0000000..a376989 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_contacts.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_copy.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_copy.png new file mode 100755 index 0000000..13c40bb Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_copy.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_create.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_create.png new file mode 100755 index 0000000..0dc1144 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_create.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_create_folder.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_create_folder.png new file mode 100755 index 0000000..d74811f Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_create_folder.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_delete.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_delete.png new file mode 100755 index 0000000..faaa0d3 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_delete.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_dialer.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_dialer.png new file mode 100755 index 0000000..1ad19c7 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_dialer.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_done.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_done.png new file mode 100755 index 0000000..46304a4 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_done.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_edit.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_edit.png new file mode 100755 index 0000000..4ddc598 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_edit.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_editor.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_editor.png new file mode 100755 index 0000000..924818f Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_editor.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_eng_eng_result.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_eng_eng_result.png new file mode 100755 index 0000000..466584c Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_eng_eng_result.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_exchangs_register.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_exchangs_register.png new file mode 100755 index 0000000..58c6e27 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_exchangs_register.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_favorite.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_favorite.png new file mode 100755 index 0000000..aa13cf9 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_favorite.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_features.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_features.png new file mode 100755 index 0000000..e05d165 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_features.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_forward.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_forward.png new file mode 100755 index 0000000..a1fca43 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_forward.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_genre.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_genre.png new file mode 100755 index 0000000..bb6336c Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_genre.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_groups.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_groups.png new file mode 100755 index 0000000..e793512 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_groups.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_help.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_help.png new file mode 100755 index 0000000..7345a02 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_help.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_home.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_home.png new file mode 100755 index 0000000..93e3fad Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_home.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_info.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_info.png new file mode 100755 index 0000000..12a5b06 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_info.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_length.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_length.png new file mode 100755 index 0000000..b23f708 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_length.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_list_by.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_list_by.png new file mode 100755 index 0000000..0c17352 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_list_by.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_lock.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_lock.png new file mode 100755 index 0000000..7855a14 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_lock.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_logs.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_logs.png new file mode 100755 index 0000000..384341b Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_logs.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_map.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_map.png new file mode 100755 index 0000000..7300286 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_map.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_memolist.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_memolist.png new file mode 100755 index 0000000..8d92234 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_memolist.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_mention.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_mention.png new file mode 100755 index 0000000..31774da Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_mention.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_menu.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_menu.png new file mode 100755 index 0000000..b5a9a8d Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_menu.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_more.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_more.png new file mode 100755 index 0000000..651c8e1 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_more.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_move.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_move.png new file mode 100755 index 0000000..fdc8c8a Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_move.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_multiview.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_multiview.png new file mode 100755 index 0000000..2d731eb Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_multiview.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_multiview_02.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_multiview_02.png new file mode 100755 index 0000000..32ff645 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_multiview_02.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_multiview_03.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_multiview_03.png new file mode 100755 index 0000000..8d74949 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_multiview_03.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_multiview_04.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_multiview_04.png new file mode 100755 index 0000000..66bc543 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_multiview_04.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_multiview_05.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_multiview_05.png new file mode 100755 index 0000000..f17bba0 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_multiview_05.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_multiview_06.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_multiview_06.png new file mode 100755 index 0000000..dce660a Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_multiview_06.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_multiview_07.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_multiview_07.png new file mode 100755 index 0000000..427f171 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_multiview_07.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_multiview_08.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_multiview_08.png new file mode 100755 index 0000000..8c4467c Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_multiview_08.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_multiview_09.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_multiview_09.png new file mode 100755 index 0000000..5a7719f Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_multiview_09.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_music_albums.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_music_albums.png new file mode 100755 index 0000000..ad20f50 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_music_albums.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_next.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_next.png new file mode 100755 index 0000000..4a0505e Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_next.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_pause.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_pause.png new file mode 100755 index 0000000..4483640 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_pause.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_phone.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_phone.png new file mode 100755 index 0000000..74e9ec6 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_phone.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_playlists.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_playlists.png new file mode 100755 index 0000000..44eabbf Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_playlists.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_previous.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_previous.png new file mode 100755 index 0000000..066f51c Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_previous.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_print.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_print.png new file mode 100755 index 0000000..c0fa5b2 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_print.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_receive.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_receive.png new file mode 100755 index 0000000..06e7946 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_receive.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_reply.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_reply.png new file mode 100755 index 0000000..4bdadbd Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_reply.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_save.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_save.png new file mode 100755 index 0000000..f8a9278 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_save.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_save_to_calender.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_save_to_calender.png new file mode 100755 index 0000000..c604f31 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_save_to_calender.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_scan.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_scan.png new file mode 100755 index 0000000..99748f9 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_scan.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_scrap.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_scrap.png new file mode 100755 index 0000000..b46bd8b Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_scrap.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_search.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_search.png new file mode 100755 index 0000000..ff46fa3 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_search.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_send.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_send.png new file mode 100755 index 0000000..7855940 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_send.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_set_as.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_set_as.png new file mode 100755 index 0000000..b519baf Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_set_as.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_settings.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_settings.png new file mode 100755 index 0000000..bbea504 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_settings.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_setup_wizard_previous.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_setup_wizard_previous.png new file mode 100755 index 0000000..2185437 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_setup_wizard_previous.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_share.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_share.png new file mode 100755 index 0000000..c1a20b5 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_share.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_songs.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_songs.png new file mode 100755 index 0000000..ddf797e Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_songs.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_stop_watch.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_stop_watch.png new file mode 100755 index 0000000..c176aa2 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_stop_watch.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_store.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_store.png new file mode 100755 index 0000000..54c32f5 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_store.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_synchronise_start_sync.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_synchronise_start_sync.png new file mode 100755 index 0000000..e91d2e4 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_synchronise_start_sync.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_synchronise_stop_01.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_synchronise_stop_01.png new file mode 100755 index 0000000..5121229 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_synchronise_stop_01.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_synchronise_stop_02.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_synchronise_stop_02.png new file mode 100755 index 0000000..138bed9 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_synchronise_stop_02.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_synchronise_stop_03.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_synchronise_stop_03.png new file mode 100755 index 0000000..fcc1917 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_synchronise_stop_03.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_synchronise_view_result.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_synchronise_view_result.png new file mode 100755 index 0000000..107f009 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_synchronise_view_result.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_tag.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_tag.png new file mode 100755 index 0000000..9ada15a Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_tag.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_temp.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_temp.png new file mode 100755 index 0000000..0ae4445 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_temp.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_timeline.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_timeline.png new file mode 100755 index 0000000..0495731 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_timeline.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_timer.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_timer.png new file mode 100755 index 0000000..2464103 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_timer.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_today.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_today.png new file mode 100755 index 0000000..c200446 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_today.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_top.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_top.png new file mode 100755 index 0000000..f7e63fa Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_top.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_trim.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_trim.png new file mode 100755 index 0000000..b46bd8b Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_trim.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_unlock.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_unlock.png new file mode 100755 index 0000000..5cf54fd Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_unlock.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_unread_message.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_unread_message.png new file mode 100755 index 0000000..bda2bee Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_unread_message.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_update.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_update.png new file mode 100755 index 0000000..524b7ca Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_update.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_upload_export.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_upload_export.png new file mode 100755 index 0000000..c381158 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_upload_export.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_videocall.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_videocall.png new file mode 100755 index 0000000..53d4b75 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_videocall.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_view_file_histroy.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_view_file_histroy.png new file mode 100755 index 0000000..b33fc16 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_view_file_histroy.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_volume.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_volume.png new file mode 100755 index 0000000..1b676dc Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_volume.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_weight.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_weight.png new file mode 100755 index 0000000..514d155 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_weight.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_world_clock.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_world_clock.png new file mode 100755 index 0000000..e9b7669 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_world_clock.png differ diff --git a/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_year.png b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_year.png new file mode 100755 index 0000000..a4e14d5 Binary files /dev/null and b/src/themes/tizen/tizen-black/images/controlbar/01_controlbar_icon_year.png differ diff --git a/src/themes/tizen/tizen-black/style.less b/src/themes/tizen/tizen-black/style.less new file mode 100755 index 0000000..fdfee78 --- /dev/null +++ b/src/themes/tizen/tizen-black/style.less @@ -0,0 +1,576 @@ +// Basic color set +@color_bg: rgb(0, 0, 0); +@color_bg_sub: rgb(36, 36, 36); // 36 36 36 // TODO: used only in dialog group. Check more. + +@color_border: rgb(42, 42, 42); // 42 42 42 +@color_header: rgb(68, 68, 74); // 68 68 74 + +@color_scrollbar: rgb(63, 63, 63); + +@color_text: rgb(249, 249, 249); +@color_text_dim: rgb(108, 115, 118); // 108 115 118 +@color_text_focus: @color_text; +@color_text_sub: rgb(102, 102, 102); // 102 102 102 +@color_text_setting: rgb(42, 109, 140); // 42 109 140 +@color_text_input: rgb(70, 70, 70); // 70 70 70 +@color_text_cursor: @color_text_setting; +@color_text_segctrl: rgb(158, 195, 213); // 158 195 213 // TODO: used only in segctrl. Check more. + +//Dialogue color set +@color_dialogue_main_text: rgba(249, 249, 249, 1); +@color_dialogue_sub_text: rgb(146,146,146); +@color_list_dialogue_bg : rgba(0, 0, 0, 1); +@color_dialogue_border_right: rgba(68, 68, 68, 1); + +//Dialogue Editor color set +@color_dialogue_editor_default_text: rgb(70, 70, 70); +@color_dialogue_editor_bg: rgb(0, 0, 0); +@color_dialogue_editor_border: rgb(37, 52, 78); +/************************* + Vars/Mixins for Widgets + + NOTE: + * Color variables' name: @color__ + * Color values: Use rgb() or rgba() + *************************/ + + +/*************************************************************************** + List +***************************************************************************/ +@color_list_border_bottom: rgb(68, 68, 68); +@color_list_main_text_read: rgba(158, 158, 158, 1); +@color_list_main_text_unread: rgba(249, 249, 249, 1); +@color_list_main_text_focus: rgba(249, 249, 249, 1); +@color_list_sub_text_default: rgba(100, 100, 100, 1); +@color_list_sub_text_settings: rgba(0, 140, 210, 1); +@color_list_sub_text_focus: rgba(249, 249, 249, 1); +@color_list_flexible_text_main: rgba(249, 249, 249, 1); +@color_list_flexible_text_sub: rgba(149, 149, 149, 1); +@color_list_index_list: rgba(164, 164, 164, 1); +@color_list_editfield_text: rgba(70, 70, 70, 1); +@color_list_editfield_text_cursor: rgba(0, 140, 210, 1); +@color_list_multiline_text: rgba(149, 149, 149, 1); +@color_list_3line_main_text: rgba(249, 249, 249, 1); +@color_list_3line_main_text_read: rgba(249, 249, 249, 1); +@color_list_3line_main_text_focus: rgba(249, 249, 249, 1); +@color_list_3line_main_text2: rgba(104, 137, 152, 1); +@color_list_3line_main_text2_focus: rgba(249, 249, 249, 1); +@color_list_converter_style: rgba(249, 249, 249, 1); +@color_list_converter_style_focus: rgba(249, 249, 249, 1); +@color_list_unread_email: rgba(249, 249, 249, 1); +@color_list_contents_text: rgba(210, 210, 210, 1); +@color_list_name_text: rgba(129, 129, 129, 1); +@color_list_name_text_dim: rgba(0, 140, 210, 1); +@color_list_colorbar: rgba(80, 107, 207, 1); //Temp, not defined +@color_list_bubble_box_shadow: rgb(78, 78, 78); // Not defined in GUI guide. +@color_list_bubble_left_text: rgb(0, 0, 0); +@color_list_bubble_left_bg: rgb(217, 230, 237); // Not defined in GUI guide. Picked from image. +@color_list_bubble_right_text: rgb(96, 96, 96); +@color_list_bubble_right_bg: rgb(217, 217, 217); // Not defined in GUI guide. Picked from image. +@color_list_bubble_sos_text: rgb(211, 0, 0); +@color_list_bubble_date_text: rgb(128, 128, 128); +@color_list_bubble_date_bg: rgba(225, 225, 225, 0); +@color_list_bubble_time_text: rgb(57, 166, 215); +@color_list_bubble_link_text: rgb(34, 129, 157); +@color_list_bubble_failed_text: rgb(211, 0, 0); +@color_list_bubble_name_text: rgb(57, 166, 215); +@color_list_bubble_help_text: rgb(146, 146, 146); +@color_list_divider_bg : -webkit-linear-gradient(top, rgb(73,73,73) 0%,rgb(22,22,22) 100%); +@color_list_divider_text : rgb(142, 174, 193); /* #005ea0 */ +@color_list_divider_expand_div : rgba(0, 0, 0, 0.5); +@color_list_expandable_expanded_bg: rgb(26, 26, 26); +@color_list_press : rgba(60, 100, 155, 1); + +@font_size_list_main_text: 44 * @unit_base; //1.375rem; /* 44 px */ +@font_size_list_sub_text: 32 * @unit_base; //1.0rem; /* 32 px */ +@font_size_list_flexible_text_main: 48 * @unit_base; //1.5rem; /* 48 px */ +@font_size_list_flexible_text_sub: 36 * @unit_base; //1.125rem; /* 36 px */ +@font_size_list_index_list: 32 * @unit_base; //1.0rem; /* 32 px */ +@font_size_list_editfield_text: 44 * @unit_base; //1.375rem; /* 44 px */ +@font_size_list_multiline_text: 32 * @unit_base; //1.0rem; /* 32 px */ +@font_size_list_3line_main_text: 42 * @unit_base; //1.3125rem; /* 42 px */ +@font_size_list_3line_main_text2: 36 * @unit_base; //1.125rem; /* 36 px */ +@font_size_list_converter_style: 40 * @unit_base; //1.3rem; /* 40 px */ +@font_size_list_unread_email: 44 * @unit_base; //1.375rem; /* 44 px */ +@font_size_list_contents_text: 30 * @unit_base; //0.94rem; /* 30 px */ +@font_size_list_name_text: 32 * @unit_base; //1.0rem; /* 32 px */ + +@style_list_li_dialogue_margin_left: 16 * @unit_base; +@style_list_li_dialogue_border_left_width: 10 * @unit_base; +@style_list_bubble_date_height: 40 * @unit_base; +@style_list_bubble_date_text_align: center; +/*************************************************************************** + Shortcut Scroll +***************************************************************************/ +@color_shortcutscroll_rollover_bg: none; +@color_shortcutscroll_rollover_text: rgba(160, 172, 179, 1); +@color_shortcutscroll_popup_bg: rgba(229, 229, 229, 1); // 00_fast_scroll_popup_bg.png +@color_shortcutscroll_popup_shadow: rgba(199, 199, 199, 0.5); +@color_shortcutscroll_popup_text: rgb(42, 137, 194); + + +/*************************************************************************** + Popup +***************************************************************************/ +@color_popup_center_progressbar_title: rgba(153, 153, 153, 1); +@color_popup_text_progress_title: rgba(249, 249, 249, 1); +/* TODO : ninepatch popup title */ +@color_popup_title_bg: rgba(39, 58, 90, 255); /* popup_title_bg.png */ +@color_popup_text_bg: rgba(38, 38, 38, 255); /* popup_bg.png */ +@color_popup_button_bg: rgba(56, 56, 56, 255); /* popup_button_bg.png */ +@color_popup_font: white; +@color_popup_text_font: white; + +@color_popup_buttonbg: rgb(79, 79, 79); +@color_popup_buttonbg_webkit: rgb(79, 79, 79); +@color_popup_buttonbg_moz: rgb(79, 79, 79); +@color_popup_buttontext: rgb(249, 249, 249); +@color_popup_buttonbg_over: rgb(79, 79, 79); /* transparents */ +@color_popup_buttonbg_press: rgb(42, 137, 194); +@color_popup_buttonbg_press_webkit: rgb(42, 137, 194); +@color_popup_buttonbg_press_moz: rgb(42, 137, 194); + +@color_popup_scroller_bg: rgb(0, 0, 0); + +@font_size_popup_info_style: 42 * @unit_base; //1.3125rem; /* 42px */ +@font_size_popup_basic_style_title: 38 * @unit_base; //1.1875rem; /* 38px */ +@font_size_popup_center_progressbar_title: 26 * @unit_base; //0.8125rem; /* 26px */ +@font_size_popup_text_progress_title: 42 * @unit_base; //1.3125rem; /* 42px */ +@font_size_popup_button_text: 32 * @unit_base; //1.0rem; /* 32px */ + +.LESSpopup_button_style{ + background: @color_popup_buttonbg; + background: @color_popup_buttonbg_webkit; + background: @color_popup_buttonbg_moz; + color: @color_popup_buttontext; +} + +.LESSpopup_button_hover_style{ + background: @color_popup_buttonbg_over; +} + +.LESSpopup_button_press_style{ + background: @color_popup_buttonbg_press; + background: @color_popup_buttonbg_press_webkit; + background: @color_popup_buttonbg_press_moz; +} + +.LESSpopup_padding_style{ + padding: 2 * @unit_base 2 * @unit_base; +} + +/*************************************************************************** + Button +***************************************************************************/ + +@color_button_normal: rgb(53, 53, 57); +@color_button_normal_webkit: -webkit-gradient(linear, left top, left bottom, from(rgb(53, 53, 57)), to(rgb(40, 41, 44))); +@color_button_normal_moz: -moz-linear-gradient(top, rgb(53, 53, 57), rgb(40, 41, 44)); + +@color_button_press: rgb(42, 137, 194); + +@color_button_hover: rgb(161, 171, 177); + +@color_button_text_normal: rgb(249, 249, 249); +@color_button_text_white: rgb(249, 249, 249); +@color_button_text_press: rgb(249, 249, 249); + +@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(42, 137, 194); + +@color_button_EditText: rgb(249, 249, 249); +@color_button_EditTextPress: rgb(249, 249, 249); +@color_button_EditBG: rgb(0, 0, 0); +@color_button_EditBGPress: rgb(0, 140, 210); + +@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: rgb(192, 82, 82); +@color_button_edit_webkit: -webkit-gradient(linear, left top, left bottom, from(rgb(192, 82, 82)), to(rgb(162, 40, 40))); +@color_button_edit_moz: -moz_linear-gradient(top, rgb(192, 88, 88), rgb(162, 40, 40)); + +@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)); + +.LESSbutton_up_style{ + background: @color_button_normal; + background: @color_button_normal_webkit; + background: @color_button_normal_moz; + color: @color_button_text_normal; +} + +.LESSbutton_hover_style{ + background: @color_button_hover; + color: @color_button_text_white; +} + +.LESSbutton_down_style{ + background: @color_button_press; + color: @color_button_text_white; +} + +.LESSbutton_text1_style{ + font-family: @font_family; + font-weight: normal; + font-size: 1.0rem; + font-style:normal; + color: @color_button_text_normal; + &:hover {color: @color_button_text_press;} +} + +.LESSbutton_box_style{ + color: @color_button_text_white; + &:hover {color: @color_button_text_white;} +} + +.LESScirclebutton_hover_style{ + border-width: 0px; + background: @color_circlebutton_hover; + background: @color_circlebutton_hover_webkit; + backgronnd: @color_circlebutton_hover_moz; +} + +.LESScirclebutton_press_style{ + border-width: 0px; + background: @color_circlebutton_press; +} + +.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_edit_style{ + background: @color_button_edit; + background: @color_button_edit_webkit; + background: @color_button_edit_moz; + font-weight:bold; + color: rgb(249, 249, 249); +} + +.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; +} + +/*************************************************************************** + Date Time picker color set +***************************************************************************/ +@color_timepicker_selector_color: rgb(42,137,194); + +/*************************************************************************** + Contextual Popup +***************************************************************************/ +@color_ctxpopup_text: rgb(249, 249, 249); +@color_ctxpopup_background: rgb(52, 52, 52); +@color_ctxpopup_border_left: rgb(39, 39, 39); +@color_ctxpopup_border_right: rgb(82, 82, 82); +@color_ctxpopup_border_bottom: rgb(89, 89, 89); +@color_ctxpopup_timepicker_text: rgba( 249, 249, 249, 0.7 ); +@color_ctxpopup_timepicker_text_focus: rgba( 249, 249, 249, 1 ); + +/*************************************************************************** + 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(0, 0, 0, 0.1); /* #000000 */ +@color_dayselector_Btn_normal: -webkit-linear-gradient(top, rgb(48,65,95) 0%,rgb(30,43,62) 100%); +@color_dayselector_Btn_press: -webkit-linear-gradient(top, rgb(71,98,141) 0%,rgb(52,75,112) 100%); + + +/*************************************************************************** + OptionHeader +***************************************************************************/ +@color_optionheader_Background: rgba(55, 76, 111, 1); +@color_optionheader_bt: -webkit-linear-gradient(top, rgb(85,113,160) 0%,rgb(68,95,139) 100%); +@color_optionheader_bt_press: -webkit-linear-gradient(top, rgb(42,137,193) 0%,rgb(27,106,153) 100%); +@color_optionheader_tab_text: rgba(249, 249, 249, 1); /* #f9f9f9 */ + + +/*************************************************************************** + SearchBar(forms.textinput) +***************************************************************************/ +@color_searchbar_bg : rgba(47, 53, 64, 1); +@color_searchbar_default_text : rgba(68, 93, 111, 1); +@color_searchbar_input_field_bg : rgba(0, 0, 0, 1); + + +/*************************************************************************** + SegmentControl +***************************************************************************/ +@color_segmentcontrol_btn_normal : -webkit-linear-gradient(top, rgb(48,65,95) 0%,rgb(30,43,62) 100%); +@color_segmentcontrol_btn_press : -webkit-linear-gradient(top, rgb(71,98,141) 0%,rgb(52,75,112) 100%); +@color_segmentcontrol_Seg_text : rgba(249, 249, 249, 1); /* #F9F9F9*/ +@color_segmentcontrol_Seg_text_pressed : rgba(249, 249, 249, 1); /* #F9F9F9*/ + + +/*************************************************************************** + ControlGroup +***************************************************************************/ +@color_controlgroup_btn_border : rgba(0, 0, 0, 0.1); /* #000000 */ + + +/*************************************************************************** + Header / Footer + NavigationBar / ControlBar +***************************************************************************/ +@color_bar_bg : -webkit-linear-gradient(top, rgb(156,181,179) 0%,rgb(79,116,141) 100%); +@color_bar_back_btn_press : rgba(26, 82, 116, 0.3); /* #1A5274 */ +@color_bar_btn_press : rgba(0, 0, 0, 0.1); +@color_bar_btn_bg : transparent; +@color_bar_back_btn_bg : transparent; + +@color_bar_seg_btn_border : rgba(0, 0, 0, 0.1); +@color_bar_seg_text_press : rgba(249, 249, 249, 1); +@color_bar_seg_text_normal : rgba(249, 249, 249, 1); +@color_bar_seg_btn_press : -webkit-linear-gradient(top, rgb(94,120,160) 0%,rgb(61,88,131) 100%); +@color_bar_seg_btn_normal : -webkit-linear-gradient(top, rgb(56,80,120) 0%,rgb(39,58,88) 100%); + +@color_bar_title_text : rgba(249, 249, 249, 1); /* #F9F9F9 */ +@color_bar_title_bg : -webkit-linear-gradient(top, rgb(68,88,120) 0%,rgb(24,37,56) 100%); +@color_bar_title_btn_border : rgba(0, 0, 0, 0.2); + +@color_bar_footer_bg : -webkit-linear-gradient(top, rgb(43,54,71) 0%,rgb(17,24,35) 100%); +@color_bar_footer_btn_bg : transparent; + +@color_controlbar_btn_border : rgba(0, 0, 0, 0.1); /* #000000 */ +@color_controlbar_tabbbar_bg : -webkit-linear-gradient(top, rgb(43,54,71) 0%,rgb(17,24,35) 100%); +@color_controlbar_toolbbar_bg : -webkit-linear-gradient(top, rgb(43,54,71) 0%,rgb(17,24,35) 100%); +@color_controlbar_bg : -webkit-linear-gradient(top, rgb(43,54,71) 0%,rgb(17,24,35) 100%); +@color_controlbar_btn_text : rgba(249, 249, 249, 1); /* #F9F9F9 */ +@color_controlbar_btn_press : -webkit-linear-gradient(top, rgb(60,81,114) 0%,rgb(42,58,85) 100%); + +@color_border_top : rgba(255, 255, 255, 0.5); +@color_border_bottom : rgba(0, 0, 0, 0.5); + +/*************************************************************************** + Tickernoti +***************************************************************************/ +@color_ticker_bg: rgb(60, 84, 123); +@color_ticker_text1: rgb(249, 249, 249); +@color_ticker_text2: rgb(211, 216, 224); +@color_ticker_btn: rgb(59, 81, 116); + + +/*************************************************************************** + Smallpopup +***************************************************************************/ +@color_smallpopup_bg: rgb(76, 81, 88); +@color_smallpopup_text: rgb(249, 249, 249); + + +/*************************************************************************** + No Contents +***************************************************************************/ +@color_nocontents_text: rgb(102, 102, 102); + + +/*************************************************************************** + Slider +***************************************************************************/ +@color_slider_handle_text: rgb(42, 137, 194); +@color_slider_popup_text: rgb(249, 249, 249); + + +/*************************************************************************** + Progress +***************************************************************************/ +@color_progress_bar0: rgb(178, 178, 178); +@color_progress_bar1: rgb(42, 137, 194); + + +/*************************************************************************** + Handler +***************************************************************************/ +@color_scrollview_handler_bg : rgba(150, 150, 150, 0.5); + +/*************************************************************************** + multimediaview +***************************************************************************/ +@color_multimediaview_bg : rgb(0, 0, 0); +@color_multimediaview_control_bg : rgba(0, 0, 0, 0.5); +@color_multimediaview_button_bg : rgb(36, 36, 36); +@color_multimediaview_timestamp_text : rgb(42, 137, 194); +@color_multimediaview_duration_text : rgb(128, 128, 128); +@color_multimediaview_bar_gray : rgb(178, 178, 178); +@color_multimediaview_bar_active : rgb(42, 137, 194); +@color_multimediaview_bar_handle : rgb(249, 249, 249); + +/*************************************************************************** + Color widgets +***************************************************************************/ +@color_widgets_title_bg: rgb(26, 26, 26); +@color_widgets_basic_border: rgb(32, 32, 32); +@color_widgets_left_border: rgb(45, 51, 74); + +.LESScolortitle_background_style{ + background-color: @color_widgets_title_bg; + border: 1px solid; + border-color: @color_widgets_basic_border; + border-left: 6px solid; + border-left-color: @color_widgets_left_border; +} + +.LESShsvpicker_background_style{ + background-color: @color_widgets_title_bg; + border: 1px solid; + border-color: @color_widgets_basic_border; + border-left: 6px solid; + border-left-color: @color_widgets_left_border; +} + +.LESSpalette_background_style{ + background-color: @color_widgets_title_bg; + border: 1px solid; + border-top: 6px solid; + border-color: @color_widgets_left_border; +} + + +/*************************************************************************** + multibutton entry +***************************************************************************/ +@color_multibuttonentry_bg : rgb(0, 0, 0); +@color_multibuttonentry_block_text : rgb(255, 255, 255); +@color_multibuttonentry_block_bg : rgb(60, 100, 155); +@color_multibuttonentry_block_border : rgb(85, 131, 174); +@color_multibuttonentry_press_bg : rgb(41, 137, 194); +@color_multibuttonentry_press_border : rgb(93, 187, 244); +@color_multibuttonentry_input_text : rgb(255, 255, 255); +@color_multibuttonentry_link_bg : rgb(100, 100, 100); +@color_multibuttonentry_link : rgb(249, 249, 249); + +/*************************************************************************** +***************************************************************************/ + +/*************************************************************************** + virtualgrid +***************************************************************************/ +@color_virtualgrid_bg : rgb(0, 0, 0); + +/*************************************************************************** +**************************************************************************** + Layout ( position, padding, margin etc...) +**************************************************************************** +***************************************************************************/ +@style-title-font-size : 52 * @unit_base; + +@style-corner-radius : .3em; +@style-title-extended-2btn-width : 688 * @unit_base; +@style-title-extended-2btn-radio-width : 343 * @unit_base; +@style-title-extended-3btn-width : 688 * @unit_base; +@style-title-extended-3btn-radio-width : 229 * @unit_base; +@style-title-extended-4btn-width : 688 * @unit_base; +@style-title-extended-4btn-radio-width : 171 * @unit_base; + +@style-back-btn-left : 44 * @unit_base; +@style-back-btn-arrow-top : 5 * @unit_base; + +@style-title-min-height : 62 * @unit_base; +@style-title-extended-margin : -30 * @unit_base; +/*************************************************************************** + Navigation +***************************************************************************/ + +.LESStitle-diff-style { + text-align: left; + margin: 19*@unit_base 135*@unit_base 19*@unit_base 16*@unit_base; +} + +.LESSextended-controlgroup-border { + border-style : solid; + border-width : 1px; + border-bottom-width: 2px; + + border-bottom-color: @color_border_bottom; + border-top-color: @color_border_top; + border-left-color: @color_bar_seg_btn_border; + border-right-color: @color_bar_seg_btn_border; +} + +.LESSback-btn-background { + background : none; +} + +.LESSbtn-back { + width : 144 * @unit_base; + height : 114 * @unit_base; + top : 0 * @unit_base; + right : 0 * @unit_base; +} + +.LESSbtn-back-inner { + width : 144 * @unit_base; + height : 114 * @unit_base; +} + +.LESSbtn-arrow-position { + left : 20 * @unit_base; + top : 30 * @unit_base; +} + +.LESSdialogue-border-style { + border-right-style : solid; + border-right-color : @color_dialogue_border_right; + border-right-width : 1px; +} + +.LESSdialogue-divider { + padding-top : 36 * @unit_base; + padding-bottom : 10 * @unit_base; + padding-left : 10 * @unit_base; + + margin-left : 16 * @unit_base; + margin-right : 16 * @unit_base; + + background : @color_list_dialogue_bg; + font-size : 32 * @unit_base; + font-weight : bold; + color : @color_dialogue_main_text; +} diff --git a/src/themes/tizen/tizen-black/theme.js b/src/themes/tizen/tizen-black/theme.js new file mode 100644 index 0000000..2904c15 --- /dev/null +++ b/src/themes/tizen/tizen-black/theme.js @@ -0,0 +1,26 @@ +(function( $, undefined ) { +//$.mobile.page.prototype.options.backBtnTheme = "s"; + +// Clear default theme for child elements +$.mobile.page.prototype.options.headerTheme = "s"; +$.mobile.page.prototype.options.footerTheme = "s"; +//$.mobile.page.prototype.options.contentTheme = "s"; + +// clear listview +$.mobile.listview.prototype.options.theme = "s"; +$.mobile.listview.prototype.options.countTheme = "s"; +$.mobile.listview.prototype.options.headerTheme = "s"; +$.mobile.listview.prototype.options.dividerTheme = "s"; +$.mobile.listview.prototype.options.splitTheme = "s"; + +//clear button theme +$.mobile.button.prototype.options.theme = "s"; +$.fn.buttonMarkup.defaults.theme = "s"; + +// Default theme swatch +$.mobile.page.prototype.options.theme = "s"; + +// Default font size for this theme +$.tizen.frameworkData.defaultFontSize = 36; + +})(jQuery); diff --git a/src/themes/tizen/tizen-white/Makefile b/src/themes/tizen/tizen-white/Makefile new file mode 100755 index 0000000..afefa51 --- /dev/null +++ b/src/themes/tizen/tizen-white/Makefile @@ -0,0 +1,84 @@ +THEME_NAME=tizen-white + +THEME_OUTPUT_ROOT ?= . +OUTPUT_DIR = ${THEME_OUTPUT_ROOT}/${THEME_NAME} + +CSS_OUTPUT = ${OUTPUT_DIR}/tizen-web-ui-fw-theme.css + +CSS_SRCS= ../common/jquery.mobile.theme.less.css \ + ../common/jquery.mobile.core.less.css \ + ../common/jquery.mobile.transitions.css \ + ../common/jquery.mobile.grids.css \ + ../common/jquery.mobile.headerfooter.less.css \ + ../common/jquery.mobile.navbar.css \ + ../common/jquery.mobile.button.less.css \ + ../common/jquery.mobile.collapsible.css \ + ../common/jquery.mobile.dialog.less.css \ + ../common/jquery.mobile.forms.checkboxradio.less.css \ + ../common/jquery.mobile.forms.fieldcontain.css \ + ../common/jquery.mobile.forms.select.css \ + ../common/jquery.mobile.forms.textinput.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.hsvpicker.less.css \ + ../common/jquery.mobile.tizen.colorpalette.less.css \ + ../common/jquery.mobile.tizen.colortitle.less.css \ + ../common/jquery.mobile.tizen.datetimepicker.less.css \ + ../common/jquery.mobile.tizen.popupwindow.less.css \ + ../common/jquery.mobile.tizen.ctxpopup.less.css \ + ../common/jquery.mobile.tizen.progressbar.less.css \ + ../common/jquery.mobile.tizen.progress.less.css \ + ../common/jquery.mobile.tizen.slider.less.css \ + ../common/jquery.mobile.tizen.imageslider.less.css \ + ../common/jquery.mobile.tizen.notification.less.css \ + ../common/jquery.mobile.tizen.pagecontrol.less.css \ + ../common/jquery.mobile.tizen.swipelist.less.css \ + ../common/jquery.mobile.tizen.nocontents.less.css \ + ../common/jquery.mobile.tizen.shortcutscroll.less.css \ + ../common/jquery.mobile.tizen.dayselector.less.css \ + ../common/jquery.mobile.tizen.toggleswitch.less.css \ + ../common/jquery.mobile.tizen.huegradient.css \ + ../common/jquery.mobile.tizen.colorpicker.less.css \ + ../common/jquery.mobile.tizen.colorpickerbutton.less.css \ + ../common/jquery.mobile.tizen.triangle.less.css \ + ../common/jquery.mobile.tizen.multibuttonentry.less.css \ + ../common/jquery.mobile.tizen.scrollview.handler.less.css \ + ../common/jquery.mobile.tizen.virtualgridview.less.css \ + ../common/jquery.mobile.tizen.multimediaview.less.css \ + +all: prepare css images js + +prepare: + -mkdir -p ${OUTPUT_DIR} + +less: prepare + # Compiling less to css... + @for f in `find ../common -iname '*.less' | sort`; do \ + if test "config.less" = "$$f" ; then continue; fi; \ + echo " build $$f"; \ + lessc $$f > $$f.css; \ + done; + +css: prepare less + # Creating tizen-gray theme... + @rm -f $(CSS_OUTPUT) + @for src in $(CSS_SRCS); do \ + cat $$src >> $(CSS_OUTPUT) ; \ + done + +images: prepare + # Copying tizen-gray theme images... + @cp -a images/ ${OUTPUT_DIR}/ + +js: prepare + @cp -a theme.js ${OUTPUT_DIR} + +clean: + # Cleaning tizen-gray theme... + -rm -rf $(OUTPUT_DIR) + -rm -f *.less.css + diff --git a/src/themes/tizen/tizen-white/config.less b/src/themes/tizen/tizen-white/config.less new file mode 100755 index 0000000..07ba753 --- /dev/null +++ b/src/themes/tizen/tizen-white/config.less @@ -0,0 +1,5 @@ +/**************************** + * Tizen Common Less Header * + ****************************/ +@import "../common/jquery.mobile.tizen.less"; +@import "style.less"; \ No newline at end of file diff --git a/src/themes/tizen/tizen-white/images/00_Nocontents_multimedia.png b/src/themes/tizen/tizen-white/images/00_Nocontents_multimedia.png new file mode 100644 index 0000000..beeae21 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_Nocontents_multimedia.png differ diff --git a/src/themes/tizen/tizen-white/images/00_Nocontents_picture.png b/src/themes/tizen/tizen-white/images/00_Nocontents_picture.png new file mode 100644 index 0000000..789ff99 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_Nocontents_picture.png differ diff --git a/src/themes/tizen/tizen-white/images/00_Nocontents_text.png b/src/themes/tizen/tizen-white/images/00_Nocontents_text.png new file mode 100644 index 0000000..3d68f0a Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_Nocontents_text.png differ diff --git a/src/themes/tizen/tizen-white/images/00_Nocontents_unnamed.png b/src/themes/tizen/tizen-white/images/00_Nocontents_unnamed.png new file mode 100644 index 0000000..aa19386 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_Nocontents_unnamed.png differ diff --git a/src/themes/tizen/tizen-white/images/00_button_call.png b/src/themes/tizen/tizen-white/images/00_button_call.png new file mode 100644 index 0000000..9c13b04 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_button_call.png differ diff --git a/src/themes/tizen/tizen-white/images/00_button_call_press.png b/src/themes/tizen/tizen-white/images/00_button_call_press.png new file mode 100644 index 0000000..9c13b04 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_button_call_press.png differ diff --git a/src/themes/tizen/tizen-white/images/00_button_cancel.png b/src/themes/tizen/tizen-white/images/00_button_cancel.png new file mode 100755 index 0000000..f8eaf80 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_button_cancel.png differ diff --git a/src/themes/tizen/tizen-white/images/00_button_cancel_normal.png b/src/themes/tizen/tizen-white/images/00_button_cancel_normal.png new file mode 100644 index 0000000..f8eaf80 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_button_cancel_normal.png differ diff --git a/src/themes/tizen/tizen-white/images/00_button_cancel_press.png b/src/themes/tizen/tizen-white/images/00_button_cancel_press.png new file mode 100644 index 0000000..f8eaf80 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_button_cancel_press.png differ diff --git a/src/themes/tizen/tizen-white/images/00_button_expand_closed.png b/src/themes/tizen/tizen-white/images/00_button_expand_closed.png new file mode 100644 index 0000000..e6c51de Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_button_expand_closed.png differ diff --git a/src/themes/tizen/tizen-white/images/00_button_expand_closed_press.png b/src/themes/tizen/tizen-white/images/00_button_expand_closed_press.png new file mode 100644 index 0000000..b421ad1 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_button_expand_closed_press.png differ diff --git a/src/themes/tizen/tizen-white/images/00_button_expand_opened.png b/src/themes/tizen/tizen-white/images/00_button_expand_opened.png new file mode 100644 index 0000000..1b49c94 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_button_expand_opened.png differ diff --git a/src/themes/tizen/tizen-white/images/00_button_expand_opened_press.png b/src/themes/tizen/tizen-white/images/00_button_expand_opened_press.png new file mode 100644 index 0000000..1b49c94 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_button_expand_opened_press.png differ diff --git a/src/themes/tizen/tizen-white/images/00_button_fullscreen_off.png b/src/themes/tizen/tizen-white/images/00_button_fullscreen_off.png new file mode 100755 index 0000000..1afb045 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_button_fullscreen_off.png differ diff --git a/src/themes/tizen/tizen-white/images/00_button_fullscreen_on.png b/src/themes/tizen/tizen-white/images/00_button_fullscreen_on.png new file mode 100755 index 0000000..fc1d516 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_button_fullscreen_on.png differ diff --git a/src/themes/tizen/tizen-white/images/00_button_icon_minus.png b/src/themes/tizen/tizen-white/images/00_button_icon_minus.png new file mode 100755 index 0000000..eadabad Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_button_icon_minus.png differ diff --git a/src/themes/tizen/tizen-white/images/00_button_icon_minus_press.png b/src/themes/tizen/tizen-white/images/00_button_icon_minus_press.png new file mode 100755 index 0000000..eadabad Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_button_icon_minus_press.png differ diff --git a/src/themes/tizen/tizen-white/images/00_button_info.png b/src/themes/tizen/tizen-white/images/00_button_info.png new file mode 100644 index 0000000..4a6e104 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_button_info.png differ diff --git a/src/themes/tizen/tizen-white/images/00_button_info_press.png b/src/themes/tizen/tizen-white/images/00_button_info_press.png new file mode 100644 index 0000000..4a6e104 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_button_info_press.png differ diff --git a/src/themes/tizen/tizen-white/images/00_button_minus_normal.png b/src/themes/tizen/tizen-white/images/00_button_minus_normal.png new file mode 100644 index 0000000..eadabad Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_button_minus_normal.png differ diff --git a/src/themes/tizen/tizen-white/images/00_button_minus_press.png b/src/themes/tizen/tizen-white/images/00_button_minus_press.png new file mode 100644 index 0000000..eadabad Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_button_minus_press.png differ diff --git a/src/themes/tizen/tizen-white/images/00_button_pause.png b/src/themes/tizen/tizen-white/images/00_button_pause.png new file mode 100755 index 0000000..e32a1fb Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_button_pause.png differ diff --git a/src/themes/tizen/tizen-white/images/00_button_play.png b/src/themes/tizen/tizen-white/images/00_button_play.png new file mode 100755 index 0000000..be36511 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_button_play.png differ diff --git a/src/themes/tizen/tizen-white/images/00_button_plus_normal.png b/src/themes/tizen/tizen-white/images/00_button_plus_normal.png new file mode 100644 index 0000000..724d1a8 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_button_plus_normal.png differ diff --git a/src/themes/tizen/tizen-white/images/00_button_plus_press.png b/src/themes/tizen/tizen-white/images/00_button_plus_press.png new file mode 100644 index 0000000..724d1a8 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_button_plus_press.png differ diff --git a/src/themes/tizen/tizen-white/images/00_button_radio_normal1.png b/src/themes/tizen/tizen-white/images/00_button_radio_normal1.png new file mode 100644 index 0000000..f0f8747 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_button_radio_normal1.png differ diff --git a/src/themes/tizen/tizen-white/images/00_button_radio_normal2.png b/src/themes/tizen/tizen-white/images/00_button_radio_normal2.png new file mode 100644 index 0000000..7bca9d2 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_button_radio_normal2.png differ diff --git a/src/themes/tizen/tizen-white/images/00_button_radio_press1.png b/src/themes/tizen/tizen-white/images/00_button_radio_press1.png new file mode 100755 index 0000000..7e5a8a1 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_button_radio_press1.png differ diff --git a/src/themes/tizen/tizen-white/images/00_button_radio_press2.png b/src/themes/tizen/tizen-white/images/00_button_radio_press2.png new file mode 100755 index 0000000..7d3eda3 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_button_radio_press2.png differ diff --git a/src/themes/tizen/tizen-white/images/00_button_rename.png b/src/themes/tizen/tizen-white/images/00_button_rename.png new file mode 100755 index 0000000..39c5de5 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_button_rename.png differ diff --git a/src/themes/tizen/tizen-white/images/00_button_rename_press.png b/src/themes/tizen/tizen-white/images/00_button_rename_press.png new file mode 100755 index 0000000..39c5de5 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_button_rename_press.png differ diff --git a/src/themes/tizen/tizen-white/images/00_button_reveal.png b/src/themes/tizen/tizen-white/images/00_button_reveal.png new file mode 100755 index 0000000..973b0ea Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_button_reveal.png differ diff --git a/src/themes/tizen/tizen-white/images/00_button_reveal_left.png b/src/themes/tizen/tizen-white/images/00_button_reveal_left.png new file mode 100755 index 0000000..5740523 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_button_reveal_left.png differ diff --git a/src/themes/tizen/tizen-white/images/00_button_reveal_left_press.png b/src/themes/tizen/tizen-white/images/00_button_reveal_left_press.png new file mode 100755 index 0000000..c1a99fa Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_button_reveal_left_press.png differ diff --git a/src/themes/tizen/tizen-white/images/00_button_reveal_normal.png b/src/themes/tizen/tizen-white/images/00_button_reveal_normal.png new file mode 100755 index 0000000..973b0ea Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_button_reveal_normal.png differ diff --git a/src/themes/tizen/tizen-white/images/00_button_reveal_press.png b/src/themes/tizen/tizen-white/images/00_button_reveal_press.png new file mode 100755 index 0000000..973b0ea Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_button_reveal_press.png differ diff --git a/src/themes/tizen/tizen-white/images/00_button_send.png b/src/themes/tizen/tizen-white/images/00_button_send.png new file mode 100644 index 0000000..c3bf732 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_button_send.png differ diff --git a/src/themes/tizen/tizen-white/images/00_button_send_press.png b/src/themes/tizen/tizen-white/images/00_button_send_press.png new file mode 100644 index 0000000..c3bf732 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_button_send_press.png differ diff --git a/src/themes/tizen/tizen-white/images/00_button_warning.png b/src/themes/tizen/tizen-white/images/00_button_warning.png new file mode 100755 index 0000000..98a1265 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_button_warning.png differ diff --git a/src/themes/tizen/tizen-white/images/00_button_warning_press.png b/src/themes/tizen/tizen-white/images/00_button_warning_press.png new file mode 100755 index 0000000..98a1265 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_button_warning_press.png differ diff --git a/src/themes/tizen/tizen-white/images/00_check_bg.png b/src/themes/tizen/tizen-white/images/00_check_bg.png new file mode 100644 index 0000000..b47caa5 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_check_bg.png differ diff --git a/src/themes/tizen/tizen-white/images/00_check_bg_press.png b/src/themes/tizen/tizen-white/images/00_check_bg_press.png new file mode 100755 index 0000000..c985364 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_check_bg_press.png differ diff --git a/src/themes/tizen/tizen-white/images/00_check_checking.png b/src/themes/tizen/tizen-white/images/00_check_checking.png new file mode 100755 index 0000000..8f921d7 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_check_checking.png differ diff --git a/src/themes/tizen/tizen-white/images/00_field_btn_Clear.png b/src/themes/tizen/tizen-white/images/00_field_btn_Clear.png new file mode 100755 index 0000000..df47d31 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_field_btn_Clear.png differ diff --git a/src/themes/tizen/tizen-white/images/00_indexlist_icon_closed.png b/src/themes/tizen/tizen-white/images/00_indexlist_icon_closed.png new file mode 100755 index 0000000..d2c6124 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_indexlist_icon_closed.png differ diff --git a/src/themes/tizen/tizen-white/images/00_indexlist_icon_opened.png b/src/themes/tizen/tizen-white/images/00_indexlist_icon_opened.png new file mode 100755 index 0000000..4a07f55 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_indexlist_icon_opened.png differ diff --git a/src/themes/tizen/tizen-white/images/00_mainmenu_page_bar_001.png b/src/themes/tizen/tizen-white/images/00_mainmenu_page_bar_001.png new file mode 100755 index 0000000..cf3d69c Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_mainmenu_page_bar_001.png differ diff --git a/src/themes/tizen/tizen-white/images/00_mainmenu_page_bar_002.png b/src/themes/tizen/tizen-white/images/00_mainmenu_page_bar_002.png new file mode 100755 index 0000000..e49b277 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_mainmenu_page_bar_002.png differ diff --git a/src/themes/tizen/tizen-white/images/00_mainmenu_page_bar_01.png b/src/themes/tizen/tizen-white/images/00_mainmenu_page_bar_01.png new file mode 100755 index 0000000..901dac3 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_mainmenu_page_bar_01.png differ diff --git a/src/themes/tizen/tizen-white/images/00_mainmenu_page_bar_02.png b/src/themes/tizen/tizen-white/images/00_mainmenu_page_bar_02.png new file mode 100755 index 0000000..b81cbf8 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_mainmenu_page_bar_02.png differ diff --git a/src/themes/tizen/tizen-white/images/00_mainmenu_page_bar_03.png b/src/themes/tizen/tizen-white/images/00_mainmenu_page_bar_03.png new file mode 100755 index 0000000..f62e65b Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_mainmenu_page_bar_03.png differ diff --git a/src/themes/tizen/tizen-white/images/00_mainmenu_page_bar_04.png b/src/themes/tizen/tizen-white/images/00_mainmenu_page_bar_04.png new file mode 100755 index 0000000..86be281 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_mainmenu_page_bar_04.png differ diff --git a/src/themes/tizen/tizen-white/images/00_mainmenu_page_bar_05.png b/src/themes/tizen/tizen-white/images/00_mainmenu_page_bar_05.png new file mode 100755 index 0000000..9255391 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_mainmenu_page_bar_05.png differ diff --git a/src/themes/tizen/tizen-white/images/00_mainmenu_page_bar_06.png b/src/themes/tizen/tizen-white/images/00_mainmenu_page_bar_06.png new file mode 100755 index 0000000..1635f8a Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_mainmenu_page_bar_06.png differ diff --git a/src/themes/tizen/tizen-white/images/00_mainmenu_page_bar_07.png b/src/themes/tizen/tizen-white/images/00_mainmenu_page_bar_07.png new file mode 100755 index 0000000..cf91725 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_mainmenu_page_bar_07.png differ diff --git a/src/themes/tizen/tizen-white/images/00_mainmenu_page_bar_08.png b/src/themes/tizen/tizen-white/images/00_mainmenu_page_bar_08.png new file mode 100755 index 0000000..df1adb7 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_mainmenu_page_bar_08.png differ diff --git a/src/themes/tizen/tizen-white/images/00_mainmenu_page_bar_09.png b/src/themes/tizen/tizen-white/images/00_mainmenu_page_bar_09.png new file mode 100755 index 0000000..1264428 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_mainmenu_page_bar_09.png differ diff --git a/src/themes/tizen/tizen-white/images/00_mainmenu_page_bar_10.png b/src/themes/tizen/tizen-white/images/00_mainmenu_page_bar_10.png new file mode 100755 index 0000000..e0a87f5 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_mainmenu_page_bar_10.png differ diff --git a/src/themes/tizen/tizen-white/images/00_scroll_bar_handler.png b/src/themes/tizen/tizen-white/images/00_scroll_bar_handler.png new file mode 100755 index 0000000..52ffbef Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_scroll_bar_handler.png differ diff --git a/src/themes/tizen/tizen-white/images/00_scroll_bar_handler_hor.png b/src/themes/tizen/tizen-white/images/00_scroll_bar_handler_hor.png new file mode 100755 index 0000000..76a84a9 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_scroll_bar_handler_hor.png differ diff --git a/src/themes/tizen/tizen-white/images/00_scroll_icon_jump.png b/src/themes/tizen/tizen-white/images/00_scroll_icon_jump.png new file mode 100644 index 0000000..bf3e7d3 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_scroll_icon_jump.png differ diff --git a/src/themes/tizen/tizen-white/images/00_scroll_icon_jump_left.png b/src/themes/tizen/tizen-white/images/00_scroll_icon_jump_left.png new file mode 100644 index 0000000..5188da9 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_scroll_icon_jump_left.png differ diff --git a/src/themes/tizen/tizen-white/images/00_scroll_jump_bg.png b/src/themes/tizen/tizen-white/images/00_scroll_jump_bg.png new file mode 100644 index 0000000..0aa6dfc Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_scroll_jump_bg.png differ diff --git a/src/themes/tizen/tizen-white/images/00_search_icon.png b/src/themes/tizen/tizen-white/images/00_search_icon.png new file mode 100755 index 0000000..2d160be Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_search_icon.png differ diff --git a/src/themes/tizen/tizen-white/images/00_slider_btn_brightness01.png b/src/themes/tizen/tizen-white/images/00_slider_btn_brightness01.png new file mode 100644 index 0000000..0ec6ff8 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_slider_btn_brightness01.png differ diff --git a/src/themes/tizen/tizen-white/images/00_slider_btn_brightness02.png b/src/themes/tizen/tizen-white/images/00_slider_btn_brightness02.png new file mode 100644 index 0000000..2f3a46b Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_slider_btn_brightness02.png differ diff --git a/src/themes/tizen/tizen-white/images/00_slider_btn_volume01.png b/src/themes/tizen/tizen-white/images/00_slider_btn_volume01.png new file mode 100644 index 0000000..2d51b59 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_slider_btn_volume01.png differ diff --git a/src/themes/tizen/tizen-white/images/00_slider_btn_volume02.png b/src/themes/tizen/tizen-white/images/00_slider_btn_volume02.png new file mode 100644 index 0000000..7716deb Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_slider_btn_volume02.png differ diff --git a/src/themes/tizen/tizen-white/images/00_slider_handle.png b/src/themes/tizen/tizen-white/images/00_slider_handle.png new file mode 100644 index 0000000..b58aac1 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_slider_handle.png differ diff --git a/src/themes/tizen/tizen-white/images/00_slider_handle_dim.png b/src/themes/tizen/tizen-white/images/00_slider_handle_dim.png new file mode 100644 index 0000000..0356aa4 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_slider_handle_dim.png differ diff --git a/src/themes/tizen/tizen-white/images/00_slider_handle_press.png b/src/themes/tizen/tizen-white/images/00_slider_handle_press.png new file mode 100644 index 0000000..a7f0a3a Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_slider_handle_press.png differ diff --git a/src/themes/tizen/tizen-white/images/00_slider_popup_bg.png b/src/themes/tizen/tizen-white/images/00_slider_popup_bg.png new file mode 100644 index 0000000..6666740 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_slider_popup_bg.png differ diff --git a/src/themes/tizen/tizen-white/images/00_winset_Back.png b/src/themes/tizen/tizen-white/images/00_winset_Back.png new file mode 100755 index 0000000..8cdf9d4 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_winset_Back.png differ diff --git a/src/themes/tizen/tizen-white/images/00_winset_control_top_arrow.png b/src/themes/tizen/tizen-white/images/00_winset_control_top_arrow.png new file mode 100755 index 0000000..508c2c8 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_winset_control_top_arrow.png differ diff --git a/src/themes/tizen/tizen-white/images/00_winset_icon_favorite_off.png b/src/themes/tizen/tizen-white/images/00_winset_icon_favorite_off.png new file mode 100644 index 0000000..e489855 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_winset_icon_favorite_off.png differ diff --git a/src/themes/tizen/tizen-white/images/00_winset_icon_favorite_on.png b/src/themes/tizen/tizen-white/images/00_winset_icon_favorite_on.png new file mode 100644 index 0000000..184fdab Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_winset_icon_favorite_on.png differ diff --git a/src/themes/tizen/tizen-white/images/00_winset_list_process_01.png b/src/themes/tizen/tizen-white/images/00_winset_list_process_01.png new file mode 100644 index 0000000..5c8fbb4 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_winset_list_process_01.png differ diff --git a/src/themes/tizen/tizen-white/images/00_winset_list_progress_bar.png b/src/themes/tizen/tizen-white/images/00_winset_list_progress_bar.png new file mode 100644 index 0000000..9d979e2 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_winset_list_progress_bar.png differ diff --git a/src/themes/tizen/tizen-white/images/00_winset_list_progress_bg.png b/src/themes/tizen/tizen-white/images/00_winset_list_progress_bg.png new file mode 100644 index 0000000..3cece50 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_winset_list_progress_bg.png differ diff --git a/src/themes/tizen/tizen-white/images/00_winset_more.png b/src/themes/tizen/tizen-white/images/00_winset_more.png new file mode 100755 index 0000000..473d5aa Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_winset_more.png differ diff --git a/src/themes/tizen/tizen-white/images/00_winset_more_press.png b/src/themes/tizen/tizen-white/images/00_winset_more_press.png new file mode 100755 index 0000000..cc82721 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/00_winset_more_press.png differ diff --git a/src/themes/tizen/tizen-white/images/Volume/00_volume_icon.png b/src/themes/tizen/tizen-white/images/Volume/00_volume_icon.png new file mode 100644 index 0000000..d9bdd9b Binary files /dev/null and b/src/themes/tizen/tizen-white/images/Volume/00_volume_icon.png differ diff --git a/src/themes/tizen/tizen-white/images/Volume/00_volume_icon_Mute.png b/src/themes/tizen/tizen-white/images/Volume/00_volume_icon_Mute.png new file mode 100644 index 0000000..bb970b9 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/Volume/00_volume_icon_Mute.png differ diff --git a/src/themes/tizen/tizen-white/images/ajax-loader.png b/src/themes/tizen/tizen-white/images/ajax-loader.png new file mode 100755 index 0000000..811a2cd Binary files /dev/null and b/src/themes/tizen/tizen-white/images/ajax-loader.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_3Dview.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_3Dview.png new file mode 100755 index 0000000..9769b25 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_3Dview.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_Add_buddy_to_chat.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_Add_buddy_to_chat.png new file mode 100755 index 0000000..65d47e4 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_Add_buddy_to_chat.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_Chat.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_Chat.png new file mode 100755 index 0000000..1608e4f Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_Chat.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_DM.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_DM.png new file mode 100755 index 0000000..2528dd4 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_DM.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_Externalstorage.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_Externalstorage.png new file mode 100755 index 0000000..247fa73 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_Externalstorage.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_MemoryCard.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_MemoryCard.png new file mode 100755 index 0000000..3f10810 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_MemoryCard.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_Play.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_Play.png new file mode 100755 index 0000000..4a0505e Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_Play.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_Ringtone.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_Ringtone.png new file mode 100755 index 0000000..615d4f8 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_Ringtone.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_Save_in_memo.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_Save_in_memo.png new file mode 100755 index 0000000..132f663 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_Save_in_memo.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_Save_the_word.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_Save_the_word.png new file mode 100755 index 0000000..b8660bd Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_Save_the_word.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_TTS.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_TTS.png new file mode 100755 index 0000000..666c821 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_TTS.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_Voice_command.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_Voice_command.png new file mode 100755 index 0000000..05500c1 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_Voice_command.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_account_sign-up.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_account_sign-up.png new file mode 100755 index 0000000..2288758 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_account_sign-up.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_accounts.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_accounts.png new file mode 100755 index 0000000..768d8db Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_accounts.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_add-to-bookmarks.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_add-to-bookmarks.png new file mode 100755 index 0000000..bc2e48b Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_add-to-bookmarks.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_add-to-calendar.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_add-to-calendar.png new file mode 100755 index 0000000..20eae31 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_add-to-calendar.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_add_tag.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_add_tag.png new file mode 100755 index 0000000..4676b81 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_add_tag.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_alarm.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_alarm.png new file mode 100755 index 0000000..50997d5 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_alarm.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_albums.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_albums.png new file mode 100755 index 0000000..03f8404 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_albums.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_area.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_area.png new file mode 100755 index 0000000..8b3889b Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_area.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_artist.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_artist.png new file mode 100755 index 0000000..c7b10a9 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_artist.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_attach.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_attach.png new file mode 100755 index 0000000..4ab53f2 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_attach.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_back.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_back.png new file mode 100755 index 0000000..64dbf1b Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_back.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_backward.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_backward.png new file mode 100755 index 0000000..066f51c Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_backward.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_bluetooth_preview.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_bluetooth_preview.png new file mode 100755 index 0000000..99946bb Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_bluetooth_preview.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_bookmarks.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_bookmarks.png new file mode 100755 index 0000000..586e1f3 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_bookmarks.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_brightness.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_brightness.png new file mode 100755 index 0000000..953dc47 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_brightness.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_calendar.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_calendar.png new file mode 100755 index 0000000..30cea7c Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_calendar.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_call.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_call.png new file mode 100755 index 0000000..b8b7806 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_call.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_camera.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_camera.png new file mode 100755 index 0000000..234a611 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_camera.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_cancel.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_cancel.png new file mode 100755 index 0000000..5cb7824 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_cancel.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_category.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_category.png new file mode 100755 index 0000000..829b21d Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_category.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_change_group.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_change_group.png new file mode 100755 index 0000000..9d1e569 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_change_group.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_chat.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_chat.png new file mode 100755 index 0000000..50d1943 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_chat.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_check.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_check.png new file mode 100755 index 0000000..5be28b7 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_check.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_close.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_close.png new file mode 100755 index 0000000..91b04e5 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_close.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_compose.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_compose.png new file mode 100755 index 0000000..20b71f7 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_compose.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_composer.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_composer.png new file mode 100755 index 0000000..71a9192 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_composer.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_contacts.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_contacts.png new file mode 100755 index 0000000..a376989 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_contacts.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_copy.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_copy.png new file mode 100755 index 0000000..13c40bb Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_copy.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_create.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_create.png new file mode 100755 index 0000000..0dc1144 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_create.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_create_folder.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_create_folder.png new file mode 100755 index 0000000..d74811f Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_create_folder.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_delete.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_delete.png new file mode 100755 index 0000000..faaa0d3 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_delete.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_dialer.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_dialer.png new file mode 100755 index 0000000..1ad19c7 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_dialer.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_done.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_done.png new file mode 100755 index 0000000..46304a4 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_done.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_edit.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_edit.png new file mode 100755 index 0000000..4ddc598 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_edit.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_editor.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_editor.png new file mode 100755 index 0000000..924818f Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_editor.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_eng_eng_result.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_eng_eng_result.png new file mode 100755 index 0000000..466584c Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_eng_eng_result.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_exchangs_register.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_exchangs_register.png new file mode 100755 index 0000000..58c6e27 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_exchangs_register.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_favorite.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_favorite.png new file mode 100755 index 0000000..aa13cf9 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_favorite.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_features.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_features.png new file mode 100755 index 0000000..e05d165 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_features.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_forward.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_forward.png new file mode 100755 index 0000000..a1fca43 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_forward.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_genre.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_genre.png new file mode 100755 index 0000000..bb6336c Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_genre.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_groups.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_groups.png new file mode 100755 index 0000000..e793512 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_groups.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_help.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_help.png new file mode 100755 index 0000000..7345a02 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_help.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_home.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_home.png new file mode 100755 index 0000000..93e3fad Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_home.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_info.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_info.png new file mode 100755 index 0000000..12a5b06 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_info.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_length.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_length.png new file mode 100755 index 0000000..b23f708 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_length.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_list_by.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_list_by.png new file mode 100755 index 0000000..0c17352 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_list_by.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_lock.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_lock.png new file mode 100755 index 0000000..7855a14 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_lock.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_logs.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_logs.png new file mode 100755 index 0000000..384341b Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_logs.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_map.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_map.png new file mode 100755 index 0000000..7300286 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_map.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_memolist.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_memolist.png new file mode 100755 index 0000000..8d92234 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_memolist.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_mention.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_mention.png new file mode 100755 index 0000000..31774da Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_mention.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_menu.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_menu.png new file mode 100755 index 0000000..b5a9a8d Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_menu.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_more.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_more.png new file mode 100755 index 0000000..651c8e1 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_more.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_move.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_move.png new file mode 100755 index 0000000..fdc8c8a Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_move.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_multiview.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_multiview.png new file mode 100755 index 0000000..2d731eb Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_multiview.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_multiview_02.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_multiview_02.png new file mode 100755 index 0000000..32ff645 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_multiview_02.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_multiview_03.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_multiview_03.png new file mode 100755 index 0000000..8d74949 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_multiview_03.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_multiview_04.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_multiview_04.png new file mode 100755 index 0000000..66bc543 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_multiview_04.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_multiview_05.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_multiview_05.png new file mode 100755 index 0000000..f17bba0 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_multiview_05.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_multiview_06.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_multiview_06.png new file mode 100755 index 0000000..dce660a Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_multiview_06.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_multiview_07.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_multiview_07.png new file mode 100755 index 0000000..427f171 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_multiview_07.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_multiview_08.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_multiview_08.png new file mode 100755 index 0000000..8c4467c Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_multiview_08.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_multiview_09.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_multiview_09.png new file mode 100755 index 0000000..5a7719f Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_multiview_09.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_music_albums.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_music_albums.png new file mode 100755 index 0000000..ad20f50 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_music_albums.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_next.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_next.png new file mode 100755 index 0000000..4a0505e Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_next.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_pause.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_pause.png new file mode 100755 index 0000000..4483640 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_pause.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_phone.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_phone.png new file mode 100755 index 0000000..74e9ec6 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_phone.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_playlists.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_playlists.png new file mode 100755 index 0000000..44eabbf Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_playlists.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_previous.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_previous.png new file mode 100755 index 0000000..066f51c Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_previous.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_print.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_print.png new file mode 100755 index 0000000..c0fa5b2 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_print.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_receive.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_receive.png new file mode 100755 index 0000000..06e7946 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_receive.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_reply.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_reply.png new file mode 100755 index 0000000..4bdadbd Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_reply.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_save.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_save.png new file mode 100755 index 0000000..f8a9278 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_save.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_save_to_calender.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_save_to_calender.png new file mode 100755 index 0000000..c604f31 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_save_to_calender.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_scan.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_scan.png new file mode 100755 index 0000000..99748f9 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_scan.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_scrap.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_scrap.png new file mode 100755 index 0000000..b46bd8b Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_scrap.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_search.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_search.png new file mode 100755 index 0000000..ff46fa3 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_search.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_send.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_send.png new file mode 100755 index 0000000..7855940 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_send.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_set_as.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_set_as.png new file mode 100755 index 0000000..b519baf Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_set_as.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_settings.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_settings.png new file mode 100755 index 0000000..bbea504 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_settings.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_setup_wizard_previous.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_setup_wizard_previous.png new file mode 100755 index 0000000..2185437 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_setup_wizard_previous.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_share.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_share.png new file mode 100755 index 0000000..c1a20b5 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_share.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_songs.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_songs.png new file mode 100755 index 0000000..ddf797e Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_songs.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_stop_watch.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_stop_watch.png new file mode 100755 index 0000000..c176aa2 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_stop_watch.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_store.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_store.png new file mode 100755 index 0000000..54c32f5 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_store.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_synchronise_start_sync.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_synchronise_start_sync.png new file mode 100755 index 0000000..e91d2e4 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_synchronise_start_sync.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_synchronise_stop_01.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_synchronise_stop_01.png new file mode 100755 index 0000000..5121229 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_synchronise_stop_01.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_synchronise_stop_02.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_synchronise_stop_02.png new file mode 100755 index 0000000..138bed9 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_synchronise_stop_02.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_synchronise_stop_03.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_synchronise_stop_03.png new file mode 100755 index 0000000..fcc1917 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_synchronise_stop_03.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_synchronise_view_result.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_synchronise_view_result.png new file mode 100755 index 0000000..107f009 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_synchronise_view_result.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_tag.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_tag.png new file mode 100755 index 0000000..9ada15a Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_tag.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_temp.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_temp.png new file mode 100755 index 0000000..0ae4445 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_temp.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_timeline.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_timeline.png new file mode 100755 index 0000000..0495731 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_timeline.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_timer.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_timer.png new file mode 100755 index 0000000..2464103 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_timer.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_today.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_today.png new file mode 100755 index 0000000..c200446 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_today.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_top.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_top.png new file mode 100755 index 0000000..f7e63fa Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_top.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_trim.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_trim.png new file mode 100755 index 0000000..b46bd8b Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_trim.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_unlock.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_unlock.png new file mode 100755 index 0000000..5cf54fd Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_unlock.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_unread_message.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_unread_message.png new file mode 100755 index 0000000..bda2bee Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_unread_message.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_update.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_update.png new file mode 100755 index 0000000..524b7ca Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_update.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_upload_export.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_upload_export.png new file mode 100755 index 0000000..c381158 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_upload_export.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_videocall.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_videocall.png new file mode 100755 index 0000000..53d4b75 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_videocall.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_view_file_history.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_view_file_history.png new file mode 100755 index 0000000..b33fc16 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_view_file_history.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_volume.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_volume.png new file mode 100755 index 0000000..1b676dc Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_volume.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_weight.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_weight.png new file mode 100755 index 0000000..514d155 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_weight.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_world_clock.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_world_clock.png new file mode 100755 index 0000000..e9b7669 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_world_clock.png differ diff --git a/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_year.png b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_year.png new file mode 100755 index 0000000..a4e14d5 Binary files /dev/null and b/src/themes/tizen/tizen-white/images/controlbar/01_controlbar_icon_year.png differ diff --git a/src/themes/tizen/tizen-white/style.less b/src/themes/tizen/tizen-white/style.less new file mode 100755 index 0000000..c1c91d8 --- /dev/null +++ b/src/themes/tizen/tizen-white/style.less @@ -0,0 +1,584 @@ +// Basic color set +@color_bg: rgb(249, 249, 249); // 249 249 249 +@color_bg_sub: rgb(36, 36, 36); // 36 36 36 // TODO: used only in dialog group. Check more. + +@color_border: rgb(42, 42, 42); // 42 42 42 +@color_header: rgb(68, 68, 74); // 68 68 74 + +@color_scrollbar: rgb(218, 218, 218); + +@color_text: rgb(0, 0, 0); // 0 0 0 +@color_text_dim: rgb(108, 115, 118); // 108 115 118 +@color_text_focus: @color_text; +@color_text_sub: rgb(102, 102, 102); // 102 102 102 +@color_text_setting: rgb(42, 109, 140); // 42 109 140 +@color_text_input: rgb(70, 70, 70); // 70 70 70 +@color_text_cursor: @color_text_setting; +@color_text_segctrl: rgb(158, 195, 213); // 158 195 213 // TODO: used only in segctrl. Check more. + +//Dialogue color set +@color_dialogue_main_text: rgba(92, 151, 187, 1); +@color_dialogue_sub_text: rgb(146,146,146); +@color_list_dialogue_bg : rgba(236, 240, 242, 1); +@color_dialogue_border_right: rgba(142, 154, 163, 1); + +//Dialogue Editor color set +@color_dialogue_editor_default_text: rgb(70, 70, 70); +@color_dialogue_editor_bg: rgb(0, 0, 0); +@color_dialogue_editor_border: rgb(108, 168, 199); +/************************* + Vars/Mixins for Widgets + + NOTE: + * Color variables' name: @color__ + * Color values: Use rgb() or rgba() + *************************/ + + +/*************************************************************************** + List +***************************************************************************/ +@color_list_border_bottom: rgb(169, 169, 169); +@color_list_main_text_read: rgba(158, 158, 158, 1); +@color_list_main_text_unread: rgba(249, 249, 249, 1); +@color_list_main_text_focus: rgba(249, 249, 249, 1); +@color_list_sub_text_default: rgba(100, 100, 100, 1); +@color_list_sub_text_settings: rgba(0, 140, 210, 1); +@color_list_sub_text_focus: rgba(249, 249, 249, 1); +@color_list_flexible_text_main: rgba(249, 249, 249, 1); +@color_list_flexible_text_sub: rgba(149, 149, 149, 1); +@color_list_index_list: rgba(164, 164, 164, 1); +@color_list_editfield_text: rgba(70, 70, 70, 1); +@color_list_editfield_text_cursor: rgba(0, 140, 210, 1); +@color_list_multiline_text: rgba(149, 149, 149, 1); +@color_list_3line_main_text: rgba(249, 249, 249, 1); +@color_list_3line_main_text_read: rgba(249, 249, 249, 1); +@color_list_3line_main_text_focus: rgba(249, 249, 249, 1); +@color_list_3line_main_text2: rgba(104, 137, 152, 1); +@color_list_3line_main_text2_focus: rgba(249, 249, 249, 1); +@color_list_converter_style: rgba(249, 249, 249, 1); +@color_list_converter_style_focus: rgba(249, 249, 249, 1); +@color_list_unread_email: rgba(249, 249, 249, 1); +@color_list_contents_text: rgba(210, 210, 210, 1); +@color_list_name_text: rgba(129, 129, 129, 1); +@color_list_name_text_dim: rgba(0, 140, 210, 1); +@color_list_colorbar: rgba(80, 107, 207, 1); //Temp, not defined +@color_list_bubble_box_shadow: rgb(78, 78, 78); // Not defined in GUI guide. +@color_list_bubble_left_text: rgb(0, 0, 0); +@color_list_bubble_left_bg: rgb(217, 230, 237); // Not defined in GUI guide. Picked from image. +@color_list_bubble_right_text: rgb(96, 96, 96); +@color_list_bubble_right_bg: rgb(217, 217, 217); // Not defined in GUI guide. Picked from image. +@color_list_bubble_sos_text: rgb(211, 0, 0); +@color_list_bubble_date_text: rgb(128, 128, 128); +@color_list_bubble_date_bg: rgba(225, 225, 225, 0); +@color_list_bubble_time_text: rgb(57, 166, 215); +@color_list_bubble_link_text: rgb(34, 129, 157); +@color_list_bubble_failed_text: rgb(211, 0, 0); +@color_list_bubble_name_text: rgb(57, 166, 215); +@color_list_bubble_help_text: rgb(146, 146, 146); +@color_list_divider_bg : rgb(209, 227, 238); /* #d1e3ee */ +@color_list_divider_text : rgb(29, 100, 149); +@color_list_divider_expand_div : rgba(0, 0, 0, 0.5); +@color_list_expandable_expanded_bg: rgb(215, 225, 232); +@color_list_press : rgba(42, 137, 194, 1); + +@font_size_list_main_text: 44 * @unit_base; //1.375rem; /* 44 px */ +@font_size_list_sub_text: 32 * @unit_base; //1.0rem; /* 32 px */ +@font_size_list_flexible_text_main: 48 * @unit_base; //1.5rem; /* 48 px */ +@font_size_list_flexible_text_sub: 36 * @unit_base; //1.125rem; /* 36 px */ +@font_size_list_index_list: 32 * @unit_base; //1.0rem; /* 32 px */ +@font_size_list_editfield_text: 44 * @unit_base; //1.375rem; /* 44 px */ +@font_size_list_multiline_text: 32 * @unit_base; //1.0rem; /* 32 px */ +@font_size_list_3line_main_text: 42 * @unit_base; //1.3125rem; /* 42 px */ +@font_size_list_3line_main_text2: 36 * @unit_base; //1.125rem; /* 36 px */ +@font_size_list_converter_style: 40 * @unit_base; //1.3rem; /* 40 px */ +@font_size_list_unread_email: 44 * @unit_base; //1.375rem; /* 44 px */ +@font_size_list_contents_text: 30 * @unit_base; //0.94rem; /* 30 px */ +@font_size_list_name_text: 32 * @unit_base; //1.0rem; /* 32 px */ + +@style_list_li_dialogue_margin_left: 16 * @unit_base; +@style_list_li_dialogue_border_left_width: 10 * @unit_base; +@style_list_bubble_date_height: 40 * @unit_base; +@style_list_bubble_date_text_align: center; + +/*************************************************************************** + Shortcut Scroll +***************************************************************************/ +@color_shortcutscroll_rollover_bg: none; +@color_shortcutscroll_rollover_text: rgba(160, 172, 179, 1); +@color_shortcutscroll_popup_bg: rgba(229, 229, 229, 1); // 00_fast_scroll_popup_bg.png +@color_shortcutscroll_popup_shadow: rgba(199, 199, 199, 0.5); +@color_shortcutscroll_popup_text: rgb(42, 137, 194); + + +/*************************************************************************** + Popup +***************************************************************************/ +@color_popup_center_progressbar_title: rgba(153, 153, 153, 1); +@color_popup_text_progress_title: rgba(249, 249, 249, 1); +/* TODO : ninepatch popup title */ +@color_popup_title_bg: rgba(80, 147, 182, 255); /* popup_title_bg.png */ +@color_popup_text_bg: rgba(236, 240, 242, 255); /* popup_bg.png */ +@color_popup_button_bg: rgba(209, 221, 228, 255); /* popup_button_bg.png */ +@color_popup_font: white; +@color_popup_text_font: black; + +@color_popup_buttonbg: rgb(84, 126, 153); +@color_popup_buttonbg_webkit: -webkit-gradient(linear, left top, left bottom, from(rgb(84, 126, 153)), to(rgb(69, 105, 128))); +@color_popup_buttonbg_moz: -moz-linear-gradient(top, rgb(84, 126, 153), rgb(69, 105, 128)); +@color_popup_buttontext: rgb(249, 249, 249); +@color_popup_buttonbg_over: rgb(94, 136, 163); +@color_popup_buttonbg_press: rgb(67, 160, 217); +@color_popup_buttonbg_press_webkit: -webkit-gradient(linear, left top, left bottom, from(rgb(67, 160, 217)), to(rgb(56, 139, 185))); +@color_popup_buttonbg_press_moz: -moz-linear-gradient(top, rgb(67, 160, 217), rgb(56, 139, 185)); + +@color_popup_scroller_bg: rgb(249, 249, 249); + +@font_size_popup_info_style: 42 * @unit_base; //1.3125rem; /* 42px */ +@font_size_popup_basic_style_title: 38 * @unit_base; //1.1875rem; /* 38px */ +@font_size_popup_center_progressbar_title: 26 * @unit_base; //0.8125rem; /* 26px */ +@font_size_popup_text_progress_title: 42 * @unit_base; //1.3125rem; /* 42px */ +@font_size_popup_button_text: 32 * @unit_base; //1.0rem; /* 32px */ + +.LESSpopup_button_style{ + background: @color_popup_buttonbg; + background: @color_popup_buttonbg_webkit; + background: @color_popup_buttonbg_moz; + color: @color_popup_buttontext; +} + +.LESSpopup_button_hover_style{ + background: @color_popup_buttonbg_over; +} + +.LESSpopup_button_press_style{ + background: @color_popup_buttonbg_press; + background: @color_popup_buttonbg_press_webkit; + background: @color_popup_buttonbg_press_moz; +} + +.LESSpopup_padding_style{ +} + +/*************************************************************************** + Button +***************************************************************************/ + +@color_button_normal: rgb(151, 161, 167); +@color_button_normal_webkit: -webkit-gradient(linear, left top, left bottom, from(rgb(151, 161, 167)), to(rgb(122, 132, 141))); +@color_button_normal_moz: -moz-linear-gradient(top, rgb(151, 161, 167), rgb(122, 132, 141)); + +@color_button_press: rgb(67, 160, 217); +@color_button_press_webkit: -webkit-gradient(linear, left top, left bottom, from(rgb(67, 160, 217)), to(rgb(56, 139, 185))); +@color_button_press_moz: -moz-linear-gradient(top, rgb(67, 160, 217), rgb(56, 139, 185)); + +@color_button_hover: rgb(161, 171, 177); + +@color_button_text_normal: rgb(249, 249, 249); +@color_button_text_black: rgb(0, 0, 0); +@color_button_text_white: rgb(249, 249, 249); +@color_button_text_press: rgb(249, 249, 249); + +@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_EditText: rgb(249, 249, 249); +@color_button_EditTextPress: rgb(249, 249, 249); +@color_button_EditBG: rgb(0, 0, 0); +@color_button_EditBGPress: rgb(0, 140, 210); + +@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: rgb(201, 88, 88); +@color_button_edit_webkit: -webkit-gradient(linear, left top, left bottom, from(rgb(201, 88, 88)), to(rgb(161, 40, 40))); +@color_button_edit_moz: -moz_linear-gradient(top, rgb(201, 88, 88), rgb(161, 40, 40)); + +@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)); + +.LESSbutton_up_style{ + background: @color_button_normal; + background: @color_button_normal_webkit; + background: @color_button_normal_moz; +} + +.LESSbutton_hover_style{ + background: @color_button_hover; + color: @color_button_text_white; +} + +.LESSbutton_down_style{ + background: @color_button_press; + background: @color_button_press_webkit; + background: @color_button_press_moz; + color: @color_button_text_white; +} + +.LESSbutton_text1_style{ + font-family: @font_family; + font-weight: normal; + font-size: 1.0rem; + font-style:normal; + color: @color_button_text_black; + &:hover {color: @color_button_text_black;} +} + +.LESSbutton_box_style{ + color: @color_button_text_white; + &:hover {color: @color_button_text_white;} +} + +.LESScirclebutton_hover_style{ + border-width: 0px; + background: @color_circlebutton_hover; + background: @color_circlebutton_hover_webkit; + backgronnd: @color_circlebutton_hover_moz; +} + +.LESScirclebutton_press_style{ + border-width: 0px; + background: @color_circlebutton_press; + background: @color_circlebutton_press_webkit; + background: @color_circlebutton_press_moz; +} + +.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_edit_style{ + background: @color_button_edit; + background: @color_button_edit_webkit; + background: @color_button_edit_moz; + font-weight:bold; + color: rgb(249, 249, 249); +} + +.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; +} + +/*************************************************************************** + Date Time picker color set +***************************************************************************/ +@color_timepicker_selector_color: rgb(42,137,194); + +/*************************************************************************** + Contextual Popup +***************************************************************************/ +@color_ctxpopup_text: rgb(19, 58, 83); +@color_ctxpopup_background: rgb(219, 229, 239); +@color_ctxpopup_border_left: rgb(225, 235, 241); +@color_ctxpopup_border_right: rgb(174, 184, 190); +@color_ctxpopup_border_bottom: rgb(153, 176, 195); +@color_ctxpopup_timepicker_text: rgba( 249, 249, 249, 0.4 ); +@color_ctxpopup_timepicker_text_focus: rgba( 249, 249, 249, 1 ); + +/*************************************************************************** + 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: -webkit-linear-gradient(top, rgb(125,157,178) 0%,rgb(84,121,144) 100%); +@color_dayselector_Btn_press: -webkit-linear-gradient(top, rgb(59,119,150) 0%,rgb(47,91,117) 100%); + + +/*************************************************************************** + 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 */ + + +/*************************************************************************** + SearchBar(forms.textinput) +***************************************************************************/ +@color_searchbar_bg : rgba(215, 225, 232, 1); /* #242424 */ +@color_searchbar_default_text : rgba(121, 131, 138, 1); /* #828282 */ +@color_searchbar_input_field_bg : rgba(249, 249, 249, 1); /* #F9F9F9*/ + + +/*************************************************************************** + SegmentControl +***************************************************************************/ +@color_segmentcontrol_btn_normal : -webkit-linear-gradient(top, rgb(125,157,178) 0%,rgb(84,121,144) 100%); +@color_segmentcontrol_btn_press : -webkit-linear-gradient(top, rgb(59,119,150) 0%,rgb(47,91,117) 100%); +@color_segmentcontrol_Seg_text : rgba(249, 249, 249, 1); /* #F9F9F9*/ +@color_segmentcontrol_Seg_text_pressed : rgba(249, 249, 249, 1); /* #F9F9F9*/ + + +/*************************************************************************** + ControlGroup +***************************************************************************/ +@color_controlgroup_btn_border : rgba(26, 82, 116, 1); /* #252525 */ + + +/*************************************************************************** + Header / Footer + NavigationBar / ControlBar +***************************************************************************/ +@color_bar_bg : -webkit-linear-gradient(top, rgb(156,181,179) 0%,rgb(79,116,141) 100%); +@color_bar_back_btn_press : rgba(26, 82, 116, 0.3); /* #1A5274 */ +@color_bar_btn_press : rgba(0, 0, 0, 0.1); +@color_bar_btn_bg : transparent; +@color_bar_back_btn_bg : transparent; + +@color_bar_seg_btn_border : rgba(0, 0, 0, 0.1); +@color_bar_seg_text_press : rgba(249, 249, 249, 1); +@color_bar_seg_text_normal : rgba(249, 249, 249, 1); +@color_bar_seg_btn_press : -webkit-linear-gradient(top, rgb(61,120,151) 0%,rgb(48,91,118) 100%); +@color_bar_seg_btn_normal : -webkit-linear-gradient(top, rgb(127,159,181) 0%,rgb(70,108,133) 100%); + +@color_bar_title_text : rgba(249, 249, 249, 1); /* #F9F9F9 */ +@color_bar_title_bg : -webkit-linear-gradient(top, rgb(90,153,186) 0%,rgb(32,84,115) 100%); +@color_bar_title_btn_border : rgba(36, 93, 128, 0.4); /* 00_winset_divider_line.png temp value */ + +@color_bar_footer_bg : -webkit-linear-gradient(top, rgb(156,181,179) 0%,rgb(79,116,141) 100%); +@color_bar_footer_btn_bg : transparent; + +@color_controlbar_btn_border : rgba(0, 0, 0, 0.1); /* #000000 */ +@color_controlbar_tabbbar_bg : -webkit-linear-gradient(top, rgb(156,181,179) 0%,rgb(79,116,141) 100%); +@color_controlbar_toolbbar_bg : -webkit-linear-gradient(top, rgb(156,181,179) 0%,rgb(79,116,141) 100%); +@color_controlbar_bg : -webkit-linear-gradient(top, rgb(156,181,179) 0%,rgb(79,116,141) 100%); +@color_controlbar_btn_text : rgba(249, 249, 249, 1); /* #F9F9F9 */ +@color_controlbar_btn_press : -webkit-linear-gradient(top, rgb(61,121,150) 0%,rgb(48,91,118) 100%); + +@color_border_top : rgba(255, 255, 255, 0.5); +@color_border_bottom : rgba(0, 0, 0, 0.5); + +/*************************************************************************** + Tickernoti +***************************************************************************/ +@color_ticker_bg: rgb(13, 60, 89); +@color_ticker_text1: rgb(249, 249, 249); +@color_ticker_text2: rgb(202, 211, 217); +@color_ticker_btn: rgb(22, 76, 110); + + +/*************************************************************************** + Smallpopup +***************************************************************************/ +@color_smallpopup_bg: rgb(215, 225, 232); +@color_smallpopup_text: rgb(77, 77, 77); + + +/*************************************************************************** + No Contents +***************************************************************************/ +@color_nocontents_text: rgb(154, 145, 154); + + +/*************************************************************************** + Slider +***************************************************************************/ +@color_slider_handle_text: rgb(42, 137, 194); +@color_slider_popup_text: rgb(249, 249, 249); + + +/*************************************************************************** + Progress +***************************************************************************/ +@color_progress_bar0: rgb(178, 178, 178); +@color_progress_bar1: rgb(42, 137, 194); + + +/*************************************************************************** + Handler +***************************************************************************/ +@color_scrollview_handler_bg : rgba(150, 150, 150, 0.5); + +/*************************************************************************** + multimediaview +***************************************************************************/ +@color_multimediaview_bg : rgb(249, 249, 249); +@color_multimediaview_control_bg : rgba(249, 249, 249, 0.5); +@color_multimediaview_button_bg : rgb(249, 249, 249); +@color_multimediaview_timestamp_text : rgb(42, 137, 194); +@color_multimediaview_duration_text : rgb(128, 128, 128); +@color_multimediaview_bar_gray : rgb(178, 178, 178); +@color_multimediaview_bar_active : rgb(42, 137, 194); +@color_multimediaview_bar_handle : rgb(249, 249, 249); + +/*************************************************************************** + Color widgets +***************************************************************************/ +@color_widgets_title_bg: rgb(235, 239, 241); +@color_widgets_basic_border: rgb(192, 192, 192); +@color_widgets_left_border: rgb(108, 168, 199); + +.LESScolortitle_background_style{ + background-color: @color_widgets_title_bg; + border: 1px solid; + border-color: @color_widgets_basic_border; + border-left: 6px solid; + border-left-color: @color_widgets_left_border; +} + +.LESShsvpicker_background_style{ + background-color: @color_widgets_title_bg; + border: 1px solid; + border-color: @color_widgets_basic_border; + border-left: 6px solid; + border-left-color: @color_widgets_left_border; +} + +.LESSpalette_background_style{ + background-color: @color_widgets_title_bg; + border: 1px solid; + border-top: 6px solid; + border-color: @color_widgets_basic_border; +} + + +/*************************************************************************** + multibutton entry +***************************************************************************/ +@color_multibuttonentry_bg : rgb(249, 249, 249); +@color_multibuttonentry_block_text : rgb(255, 255, 255); +@color_multibuttonentry_block_bg : rgb(93, 160, 196); +@color_multibuttonentry_block_border : rgb(88, 150, 184); +@color_multibuttonentry_press_bg : rgb(40, 106, 145); +@color_multibuttonentry_press_border : rgb(49, 126, 171); +@color_multibuttonentry_input_text : #222222; +@color_multibuttonentry_link_bg : rgb(178, 178, 178); +@color_multibuttonentry_link : rgb(249, 249, 249); + +/*************************************************************************** +***************************************************************************/ + +/*************************************************************************** + virtualgrid +***************************************************************************/ +@color_virtualgrid_bg : rgb(255, 255, 255); + +/*************************************************************************** +**************************************************************************** + Layout ( position, padding, margin etc...) +**************************************************************************** +***************************************************************************/ +@style-title-font-size : 52 * @unit_base; + +@style-corner-radius : .3em; +@style-title-extended-2btn-width : 688 * @unit_base; +@style-title-extended-2btn-radio-width : 343 * @unit_base; +@style-title-extended-3btn-width : 688 * @unit_base; +@style-title-extended-3btn-radio-width : 229 * @unit_base; +@style-title-extended-4btn-width : 688 * @unit_base; +@style-title-extended-4btn-radio-width : 171 * @unit_base; + +@style-back-btn-left : 44 * @unit_base; +@style-back-btn-arrow-top : 5 * @unit_base; + +@style-title-min-height : 62 * @unit_base; +@style-title-extended-margin : -30 * @unit_base; +/*************************************************************************** + Navigation +***************************************************************************/ + +.LESStitle-diff-style { + text-align: left; + margin: 19*@unit_base 135*@unit_base 19*@unit_base 16*@unit_base; +} + +.LESSextended-controlgroup-border { + border-style : solid; + border-width : 1px; + border-bottom-width: 2px; + + border-bottom-color: @color_border_bottom; + border-top-color: @color_border_top; + border-left-color: @color_bar_seg_btn_border; + border-right-color: @color_bar_seg_btn_border; +} + +.LESSback-btn-background { + background : none; +} + +.LESSbtn-back { + width : 144 * @unit_base; + height : 114 * @unit_base; + top : 0 * @unit_base; + right : 0 * @unit_base; +} + +.LESSbtn-back-inner { + width : 144 * @unit_base; + height : 114 * @unit_base; +} + +.LESSbtn-arrow-position { + left : 20 * @unit_base; + top : 30 * @unit_base; +} + +.LESSdialogue-border-style { + border-right-style : solid; + border-right-color : @color_dialogue_border_right; + border-right-width : 1px; +} + +.LESSdialogue-divider { + padding-top : 36 * @unit_base; + padding-bottom : 10 * @unit_base; + padding-left : 10 * @unit_base; + + margin-left : 16 * @unit_base; + margin-right : 16 * @unit_base; + + background : @color_list_dialogue_bg; + font-size : 32 * @unit_base; + font-weight : bold; + color : @color_dialogue_main_text; +} diff --git a/src/themes/tizen/tizen-white/theme.js b/src/themes/tizen/tizen-white/theme.js new file mode 100755 index 0000000..2904c15 --- /dev/null +++ b/src/themes/tizen/tizen-white/theme.js @@ -0,0 +1,26 @@ +(function( $, undefined ) { +//$.mobile.page.prototype.options.backBtnTheme = "s"; + +// Clear default theme for child elements +$.mobile.page.prototype.options.headerTheme = "s"; +$.mobile.page.prototype.options.footerTheme = "s"; +//$.mobile.page.prototype.options.contentTheme = "s"; + +// clear listview +$.mobile.listview.prototype.options.theme = "s"; +$.mobile.listview.prototype.options.countTheme = "s"; +$.mobile.listview.prototype.options.headerTheme = "s"; +$.mobile.listview.prototype.options.dividerTheme = "s"; +$.mobile.listview.prototype.options.splitTheme = "s"; + +//clear button theme +$.mobile.button.prototype.options.theme = "s"; +$.fn.buttonMarkup.defaults.theme = "s"; + +// Default theme swatch +$.mobile.page.prototype.options.theme = "s"; + +// Default font size for this theme +$.tizen.frameworkData.defaultFontSize = 36; + +})(jQuery); diff --git a/src/widgets/000_widgetex/js/widgetex.js b/src/widgets/000_widgetex/js/widgetex.js new file mode 100755 index 0000000..daf91bd --- /dev/null +++ b/src/widgets/000_widgetex/js/widgetex.js @@ -0,0 +1,348 @@ +/* + * + * This software is licensed under the MIT licence (as defined by the OSI at + * http://www.opensource.org/licenses/mit-license.php) + * + * *************************************************************************** + * Copyright (C) 2011 by Intel Corporation Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software" ), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * *************************************************************************** + */ + +// Base class for widgets that need the following features: +// +// I. HTML prototype loading +// +// This class provides HTML prototype loading for widgets. That is, the widget implementation specifies its HTML portions +// in one continuous HTML snippet, and it optionally provides an object containing selectors into the various parts of the +// HTML snippet. This widget loads the HTML snippet into a jQuery object, and optionally assigns jQuery objects to each of +// the selectors in the optionally provided object. +// +// To use this functionality you can either derive from this class, or you can call its prototype's gtype method. +// +// 1. Widgets deriving from this class should define _htmlProto as part of their prototype declaration. _htmlProto looks like +// this: +// +// _htmlProto: { +// source: string|jQuery object (optional) default: string - The name of the widget +// ui: { +// uiElement1: "#ui-element-1-selector", +// uiElement2: "#ui-element-2-selector", +// ... +// subElement: { +// subElement1: "#sub-element-1-selector", +// subElement2: "#sub-element-2-selector", +// ... +// } +// ... +// } +// } +// +// If neither 'source' nor 'ui' are defined, you must still include an empty _htmlProto key (_htmlProto: {}) to indicate +// that you wish to make use of this feature. This will cause a prototype HTML file named after your widget to be loaded. +// The loaded prototype will be placed into your widget's prototype's _protoHtml.source key. +// +// If 'source' is defined as a string, it is the name of the widget (including namespace). This is the default. If your +// widget's HTML prototype is loaded via AJAX and the name of the AJAX file is different from the name of your widget +// (that is, it is not ".prototype.html", then you should explicitly define 'source' as: +// +// If you wish to load HTML prototypes via AJAX, modify the getProtoPath() function defined below to reflect the directory +// structure holding your widget HTML prototypes. +// +// source: "alternateWidgetName" +// +// If AJAX loading fails, source is set to a jQuery object containing a div with an error message. You can check whether +// loading failed via the jQuery object's jqmData( "tizen.widgetex.ajax.fail" ) data item. If false, then the jQuery object +// is the actual prototype loaded via AJAX or present inline. Otherwise, the jQuery object is the error message div. +// +// If 'source' is defined as a jQuery object, it is considered already loaded. +// +// if 'ui' is defined inside _htmlProto, It is assumed to be an object such that every one of its keys is either a string, +// or another object with the same properties as itself. +// +// When a widget is instantiated, the HTML prototype is loaded if not already present in the prototype. If 'ui' is present +// inside _htmlProto, the prototype is cloned. Then, a new structure is created based on 'ui' with each selector replaced +// by a jQuery object containing the results of performing .find() on the prototype's clone with the filter set to the +// value of the string. In the special case where the selector starts with a '#', the ID is removed from the element after +// it is assigned into the structure being created. This structure is then made accessible from the widget instance via +// the '_ui' key (i.e., this._ui). +// +// 2. Use the loadPrototype method when your widget does not derive from $.tizen.widgetex: +// Add _htmlProto to your widget's prototype as described above. Then, in your widget's _create() method, call +// loadPrototype in the following manner: +// +// $.tizen.widgetex.loadPrototype.call(this, "namespace.widgetName" ); +// +// Thereafter, you may use the HTML prototype from your widget's prototype or, if you have specified a 'ui' key in your +// _htmlProto key, you may use this._ui from your widget instance. +// +// II. realize method +// +// When a widget is created, some of its properties cannot be set immediately, because they depend on the widths/heights +// of its constituent elements. They can only be calculated when the page containing the widget is made visible via the +// "pageshow" event, because widths/heights always evaluate to 0 when retrieved from a widget that is not visible. When +// you inherit from widgetex, you can add a "_realize" function to your prototype. This function will be called once right +// after _create() if the element that anchors your widget is on a visible page. Otherwise, it will be called when the +// page to which the widget belongs emits the "pageshow" event. +// +// NB: If your widget is inside a container which is itself not visible, such as an expandable or a collapsible, your +// widget will remain hidden even though "pageshow" is fired and therefore _realize is called. In this case, widths and +// heights will be unreliable even during _realize. +// +// III. systematic option handling +// +// If a widget has lots of options, the _setOption function can become a long switch for setting each recognized option. +// It is also tempting to allow options to determine the way a widget is created, by basing decisions on various options +// during _create(). Often, the actions based on option values in _create() are the same as those in _setOption. To avoid +// such code duplication, this class calls _setOption once for each option after _create() has completed. +// +// Furthermore, to avoid writing long switches in a widget's _setOption method, this class implements _setOption in such +// a way that, for any given option (e.g. "myOption" ), _setOption looks for a method _setMyOption in the widget's +// implementation, and if found, calls the method with the value of the option. +// +// If your widget does not inherit from widgetex, you can still use widgetex' systematic option handling: +// 1. define the _setOption method for your widget as follows: +// _setOption: $.tizen.widgetex.prototype._setOption +// 2. Call this._setOptions(this.options) from your widget's _create() function. +// 3. As with widgetex-derived widgets, implement a corresponding _setMyOptionName function for each option myOptionName +// you wish to handle. +// +// IV. systematic value handling for input elements +// +// If your widget happens to be constructed from an element, you have to handle the "value" attribute specially, +// and you have to emit the "change" signal whenever it changes, in addition to your widget's normal signals and option +// changes. With widgetex, you can assign one of your widget's "data-*" properties to be synchronized to the "value" +// property whenever your widget is constructed onto an element. To do this, define, in your prototype: +// +// _value: { +// attr: "data-my-attribute", +// signal: "signal-to-emit" +// } +// +// Then, call this._setValue(newValue) whenever you wish to set the value for your widget. This will set the data-* +// attribute, emit the custom signal (if set) with the new value as its parameter, and, if the widget is based on an +// element, it will also set the "value" attribute and emit the "change" signal. +// +// "attr" is required if you choose to define "_value", and identifies the data-attribute to set in addition to "value", +// if your widget's element is an input. +// "signal" is optional, and will be emitted when setting the data-attribute via this._setValue(newValue). +// +// If your widget does not derive from widgetex, you can still define "_value" as described above and call +// $.tizen.widgetex.setValue(widget, newValue). +// +// V. Systematic enabled/disabled handling for input elements +// +// widgetex implements _setDisabled which will disable the input associated with this widget, if any. Thus, if you derive +// from widgetex and you plan on implementing the disabled state, you should chain up to +// $.tizen.widgetex.prototype._setDisabled(value), rather than $.Widget.prototype._setOption( "disabled", value). + +(function ($, undefined) { + +// Framework-specific HTML prototype path for AJAX loads + function getProtoPath() { + var theScriptTag = $( "script[data-framework-version][data-framework-root][data-framework-theme]" ); + + return (theScriptTag.attr( "data-framework-root" ) + "/" + + theScriptTag.attr( "data-framework-version" ) + "/themes/" + + theScriptTag.attr( "data-framework-theme" ) + "/proto-html" ); + } + + $.widget( "tizen.widgetex", $.mobile.widget, { + _createWidget: function () { + $.tizen.widgetex.loadPrototype.call( this, this.namespace + "." + this.widgetName ); + $.mobile.widget.prototype._createWidget.apply( this, arguments ); + }, + + _init: function () { + // TODO THIS IS TEMPORARY PATCH TO AVOID CTXPOPUP PAGE CRASH + if ( this.element === undefined ) { + return; + } + + var page = this.element.closest( ".ui-page" ), + self = this, + myOptions = {}; + + if ( page.is( ":visible" ) ) { + this._realize(); + } else { + page.bind( "pageshow", function () { self._realize(); } ); + } + + $.extend( myOptions, this.options ); + + this.options = {}; + + this._setOptions( myOptions ); + }, + + _getCreateOptions: function () { + // if we're dealing with an element, value takes precedence over corresponding data-* attribute, if a + // mapping has been established via this._value. So, assign the value to the data-* attribute, so that it may + // then be assigned to this.options in the superclass' _getCreateOptions + + if (this.element.is( "input" ) && this._value !== undefined) { + var theValue = + ( ( this.element.attr( "type" ) === "checkbox" || this.element.attr( "type" ) === "radio" ) + ? this.element.is( ":checked" ) + : this.element.is( "[value]" ) + ? this.element.attr( "value" ) + : undefined); + + if ( theValue != undefined ) { + this.element.attr( this._value.attr, theValue ); + } + } + + return $.mobile.widget.prototype._getCreateOptions.apply( this, arguments ); + }, + + _setOption: function ( key, value ) { + var setter = "_set" + key.replace(/^[a-z]/, function (c) { return c.toUpperCase(); } ); + + if ( this[setter] !== undefined ) { + this[setter]( value ); + } else { + $.mobile.widget.prototype._setOption.apply( this, arguments ); + } + }, + + _setDisabled: function ( value ) { + $.Widget.prototype._setOption.call( this, "disabled", value ); + if ( this.element.is( "input" ) ) { + this.element.attr( "disabled", value ); + } + }, + + _setValue: function ( newValue ) { + $.tizen.widgetex.setValue( this, newValue ); + }, + + _realize: function () {} + } ); + + $.tizen.widgetex.setValue = function ( widget, newValue ) { + if ( widget._value !== undefined ) { + var valueString = ( widget._value.makeString ? widget._value.makeString(newValue) : newValue ), + inputType; + + widget.element.attr( widget._value.attr, valueString ); + if ( widget._value.signal !== undefined ) { + widget.element.triggerHandler( widget._value.signal, newValue ); + } + + if ( widget.element.is( "input" ) ) { + inputType = widget.element.attr( "type" ); + + // Special handling for checkboxes and radio buttons, where the presence of the "checked" attribute is really + // the value + if ( inputType === "checkbox" || inputType === "radio" ) { + if ( newValue ) { + widget.element.attr( "checked", true ); + } else { + widget.element.removeAttr( "checked" ); + } + } else { + widget.element.attr( "value", valueString ); + } + + widget.element.trigger( "change" ); + } + } + }; + + $.tizen.widgetex.assignElements = function (proto, obj) { + var ret = {}, + key; + + for ( key in obj ) { + if ( ( typeof obj[key] ) === "string" ) { + ret[key] = proto.find( obj[key] ); + if ( obj[key].match(/^#/) ) { + ret[key].removeAttr( "id" ); + } + } else { + if ( (typeof obj[key]) === "object" ) { + ret[key] = $.tizen.widgetex.assignElements( proto, obj[key] ); + } + } + } + + return ret; + }; + + $.tizen.widgetex.loadPrototype = function ( widget, ui ) { + var ar = widget.split( "." ), + namespace, + widgetName, + htmlProto, + protoPath; + + if ( ar.length == 2 ) { + namespace = ar[0]; + widgetName = ar[1]; + htmlProto = $( "
        " ) + .text( "Failed to load proto for widget " + namespace + "." + widgetName + "!" ) + .css( {background: "red", color: "blue", border: "1px solid black"} ) + .jqmData( "tizen.widgetex.ajax.fail", true ); + + // If htmlProto is defined + if ( $[namespace][widgetName].prototype._htmlProto !== undefined ) { + // If no source is defined, use the widget name + if ( $[namespace][widgetName].prototype._htmlProto.source === undefined ) { + $[namespace][widgetName].prototype._htmlProto.source = widgetName; + } + + // Load the HTML prototype via AJAX if not defined inline + if ( typeof $[namespace][widgetName].prototype._htmlProto.source === "string" ) { + // Establish the path for the proto file + widget = $[namespace][widgetName].prototype._htmlProto.source; + protoPath = getProtoPath(); + + // Make the AJAX call + $.ajax( { + url: protoPath + "/" + widget + ".prototype.html", + async: false, + dataType: "html" + }).success( function (data, textStatus, jqXHR ) { + htmlProto = $( "
        " ).html(data).jqmData( "tizen.widgetex.ajax.fail", false ); + } ); + + // Assign the HTML proto to the widget prototype + $[namespace][widgetName].prototype._htmlProto.source = htmlProto; + } else { // Otherwise, use the inline definition + // AJAX loading has trivially succeeded, since there was no AJAX loading at all + $[namespace][widgetName].prototype._htmlProto.source.jqmData( "tizen.widgetex.ajax.fail", false ); + htmlProto = $[namespace][widgetName].prototype._htmlProto.source; + } + + // If there's a "ui" portion in the HTML proto, copy it over to this instance, and + // replace the selectors with the selected elements from a copy of the HTML prototype + if ( $[namespace][widgetName].prototype._htmlProto.ui !== undefined ) { + // Assign the relevant parts of the proto + $.extend( this, { + _ui: $.tizen.widgetex.assignElements( htmlProto.clone(), $[namespace][widgetName].prototype._htmlProto.ui ) + }); + } + } + } + }; + +}( jQuery ) ); diff --git a/src/widgets/010_colorwidget/js/jquery.mobile.tizen.colorwidget.js b/src/widgets/010_colorwidget/js/jquery.mobile.tizen.colorwidget.js new file mode 100755 index 0000000..abc6b83 --- /dev/null +++ b/src/widgets/010_colorwidget/js/jquery.mobile.tizen.colorwidget.js @@ -0,0 +1,334 @@ +/* + * + * This software is licensed under the MIT licence (as defined by the OSI at + * http://www.opensource.org/licenses/mit-license.php) + * + * *************************************************************************** + * Copyright (C) 2011 by Intel Corporation Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software" ), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * *************************************************************************** + */ + +(function ( $, undefined ) { + + $.widget( "tizen.colorwidget", $.tizen.widgetex, { + options: { + color: "#ff0972" + }, + + _value: { + attr: "data-" + ( $.mobile.ns || "" ) + "color", + signal: "colorchanged" + }, + + _getElementColor: function ( el, cssProp ) { + return el.jqmData( "clr" ); + }, + + _setElementColor: function ( el, hsl, cssProp ) { + var clrlib = $.tizen.colorwidget.clrlib, + clr = clrlib.RGBToHTML( clrlib.HSLToRGB( hsl ) ), + dclr = clrlib.RGBToHTML( clrlib.HSLToGray( hsl ) ); + + el.jqmData( "clr", clr ); + el.jqmData( "dclr", dclr ); + el.jqmData( "cssProp", cssProp ); + el.attr( "data-" + ( $.mobile.ns || "" ) + "has-dclr", true ); + el.css( cssProp, this.options.disabled ? dclr : clr ); + + return { clr: clr, dclr: dclr }; + }, + + _displayDisabledState: function ( toplevel ) { + var self = this, + sel = ":jqmData(has-dclr='true')", + dst = toplevel.is( sel ) ? toplevel : $([]), + el; + + dst.add( toplevel.find( sel ) ) + .each( function () { + el = $( this ); + el.css( el.jqmData( "cssProp" ), el.jqmData( self.options.disabled ? "dclr" : "clr" ) ); + } ); + }, + + _setColor: function ( value ) { + var currentValue = ( this.options.color ); + + value = value.match(/#[0-9A-Fa-f]{6}/) + ? value + : currentValue.match(/#[0-9A-Fa-f]{6}/) + ? currentValue + : $.tizen.colorwidget.prototype.options.color; + + if ( this.options.color !== value ) { + this.options.color = value; + this._setValue( value ); + return true; + } + return false; + } + } ); + + $.tizen.colorwidget.clrlib = { + nearestInt: function ( val ) { + var theFloor = Math.floor( val ); + + return ( ( ( val - theFloor ) > 0.5 ) ? ( theFloor + 1 ) : theFloor ); + }, + + // Converts html color string to rgb array. + // + // Input: string clr_str, where + // clr_str is of the form "#aabbcc" + // + // Returns: [ r, g, b ], where + // r is in [0, 1] + // g is in [0, 1] + // b is in [0, 1] + HTMLToRGB: function ( clr_str ) { + clr_str = ( ( '#' == clr_str.charAt( 0 ) ) ? clr_str.substring( 1 ) : clr_str ); + + return [ parseInt(clr_str.substring(0, 2), 16) / 255.0, + parseInt(clr_str.substring(2, 4), 16) / 255.0, + parseInt(clr_str.substring(4, 6), 16) / 255.0 ]; + }, + + // Converts rgb array to html color string. + // + // Input: [ r, g, b ], where + // r is in [0, 1] + // g is in [0, 1] + // b is in [0, 1] + // + // Returns: string of the form "#aabbcc" + RGBToHTML: function ( rgb ) { + var ret = "#", val, theFloor, + Nix; + for ( Nix in rgb ) { + val = rgb[Nix] * 255; + theFloor = Math.floor( val ); + val = ( ( val - theFloor > 0.5 ) ? ( theFloor + 1 ) : theFloor ); + ret = ret + ( ( ( val < 16 ) ? "0" : "" ) + ( val & 0xff ).toString( 16 ) ); + } + + return ret; + }, + + // Converts hsl to rgb. + // + // From http://130.113.54.154/~monger/hsl-rgb.html + // + // Input: [ h, s, l ], where + // h is in [0, 360] + // s is in [0, 1] + // l is in [0, 1] + // + // Returns: [ r, g, b ], where + // r is in [0, 1] + // g is in [0, 1] + // b is in [0, 1] + HSLToRGB: function ( hsl ) { + var h = hsl[0] / 360.0, s = hsl[1], l = hsl[2], + temp1, + temp2, + temp3, + ret; + + if ( 0 === s ) { + return [ l, l, l ]; + } + + temp2 = ( ( l < 0.5 ) + ? l * ( 1.0 + s ) + : l + s - l * s); + + temp1 = 2.0 * l - temp2; + temp3 = { + r: h + 1.0 / 3.0, + g: h, + b: h - 1.0 / 3.0 + }; + + temp3.r = ( ( temp3.r < 0 ) ? ( temp3.r + 1.0 ) : ( ( temp3.r > 1 ) ? ( temp3.r - 1.0 ) : temp3.r ) ); + temp3.g = ( ( temp3.g < 0 ) ? ( temp3.g + 1.0 ) : ( ( temp3.g > 1 ) ? ( temp3.g - 1.0 ) : temp3.g ) ); + temp3.b = ( ( temp3.b < 0 ) ? ( temp3.b + 1.0 ) : ( ( temp3.b > 1 ) ? ( temp3.b - 1.0 ) : temp3.b ) ); + + ret = [( ( ( 6.0 * temp3.r ) < 1 ) ? ( temp1 + ( temp2 - temp1 ) * 6.0 * temp3.r ) : + ( ( ( 2.0 * temp3.r ) < 1 ) ? temp2 : + ( ( ( 3.0 * temp3.r ) < 2 ) ? ( temp1 + ( temp2 - temp1 ) * ( ( 2.0 / 3.0 ) - temp3.r ) * 6.0 ) : + temp1) ) ), + ( ( ( 6.0 * temp3.g ) < 1) ? ( temp1 + ( temp2 - temp1 ) * 6.0 * temp3.g ) : + ( ( ( 2.0 * temp3.g ) < 1 ) ? temp2 : + ( ( ( 3.0 * temp3.g ) < 2 ) ? ( temp1 + ( temp2 - temp1 ) * ( ( 2.0 / 3.0 ) - temp3.g ) * 6.0 ) : + temp1 ) ) ), + ( ( ( 6.0 * temp3.b ) < 1 ) ? ( temp1 + ( temp2 - temp1 ) * 6.0 * temp3.b ) : + ( ( ( 2.0 * temp3.b ) < 1 ) ? temp2 : + ( ( ( 3.0 * temp3.b ) < 2 ) ? ( temp1 + ( temp2 - temp1 ) * ( ( 2.0 / 3.0 ) - temp3.b ) * 6.0 ) : + temp1 ) ) )]; + + return ret; + }, + + // Converts hsv to rgb. + // + // Input: [ h, s, v ], where + // h is in [0, 360] + // s is in [0, 1] + // v is in [0, 1] + // + // Returns: [ r, g, b ], where + // r is in [0, 1] + // g is in [0, 1] + // b is in [0, 1] + HSVToRGB: function ( hsv ) { + return $.tizen.colorwidget.clrlib.HSLToRGB( $.tizen.colorwidget.clrlib.HSVToHSL( hsv ) ); + }, + + // Converts rgb to hsv. + // + // from http://coecsl.ece.illinois.edu/ge423/spring05/group8/FinalProject/HSV_writeup.pdf + // + // Input: [ r, g, b ], where + // r is in [0, 1] + // g is in [0, 1] + // b is in [0, 1] + // + // Returns: [ h, s, v ], where + // h is in [0, 360] + // s is in [0, 1] + // v is in [0, 1] + RGBToHSV: function ( rgb ) { + var min, max, delta, h, s, v, r = rgb[0], g = rgb[1], b = rgb[2]; + + min = Math.min( r, Math.min( g, b ) ); + max = Math.max( r, Math.max( g, b ) ); + delta = max - min; + + h = 0; + s = 0; + v = max; + + if ( delta > 0.00001 ) { + s = delta / max; + + if ( r === max ) { + h = ( g - b ) / delta; + } else { + if ( g === max ) { + h = 2 + ( b - r ) / delta; + } else { + h = 4 + ( r - g ) / delta; + } + } + h *= 60; + + if ( h < 0 ) { + h += 360; + } + } + + return [h, s, v]; + }, + + // Converts hsv to hsl. + // + // Input: [ h, s, v ], where + // h is in [0, 360] + // s is in [0, 1] + // v is in [0, 1] + // + // Returns: [ h, s, l ], where + // h is in [0, 360] + // s is in [0, 1] + // l is in [0, 1] + HSVToHSL: function ( hsv ) { + var max = hsv[2], + delta = hsv[1] * max, + min = max - delta, + sum = max + min, + half_sum = sum / 2, + s_divisor = ( ( half_sum < 0.5 ) ? sum : ( 2 - max - min ) ); + + return [ hsv[0], ( ( 0 == s_divisor ) ? 0 : ( delta / s_divisor ) ), half_sum ]; + }, + + // Converts rgb to hsl + // + // Input: [ r, g, b ], where + // r is in [0, 1] + // g is in [0, 1] + // b is in [0, 1] + // + // Returns: [ h, s, l ], where + // h is in [0, 360] + // s is in [0, 1] + // l is in [0, 1] + RGBToHSL: function ( rgb ) { + return $.tizen.colorwidget.clrlib.HSVToHSL( $.tizen.colorwidget.clrlib.RGBToHSV( rgb ) ); + }, + + // Converts hsl to grayscale + // Full-saturation magic grayscale values were taken from the Gimp + // + // Input: [ h, s, l ], where + // h is in [0, 360] + // s is in [0, 1] + // l is in [0, 1] + // + // Returns: [ r, g, b ], where + // r is in [0, 1] + // g is in [0, 1] + // b is in [0, 1] + HSLToGray: function ( hsl ) { + var intrinsic_vals = [0.211764706, 0.929411765, 0.71372549, 0.788235294, 0.070588235, 0.28627451, 0.211764706], + idx = Math.floor(hsl[0] / 60), + lowerHalfPercent, + upperHalfPercent, + begVal, + endVal, + val; + + // Find hue interval + begVal = intrinsic_vals[idx]; + endVal = intrinsic_vals[idx + 1]; + + // Adjust for lum + if ( hsl[2] < 0.5 ) { + lowerHalfPercent = hsl[2] * 2; + begVal *= lowerHalfPercent; + endVal *= lowerHalfPercent; + } else { + upperHalfPercent = ( hsl[2] - 0.5 ) * 2; + begVal += ( 1.0 - begVal ) * upperHalfPercent; + endVal += ( 1.0 - endVal ) * upperHalfPercent; + } + + // This is the gray value at full sat, whereas hsl[2] is the gray value at 0 sat. + val = begVal + ( ( endVal - begVal ) * ( hsl[0] - ( idx * 60 ) ) ) / 60; + + // Get value at hsl[1] + val = val + ( hsl[2] - val ) * ( 1.0 - hsl[1] ); + + return [val, val, val]; + } + }; + +}( jQuery )); diff --git a/src/widgets/020_huegradient/css/huegradient.css b/src/widgets/020_huegradient/css/huegradient.css new file mode 100755 index 0000000..2e86f35 --- /dev/null +++ b/src/widgets/020_huegradient/css/huegradient.css @@ -0,0 +1,104 @@ +.tizen-huegradient { + background: none; /* Old browsers */ + background: -webkit-gradient(linear, left top, right top, + color-stop( 0% ,rgba(255, 0, 0,1)), + color-stop( 16.666666667%,rgba(255,255, 0,1)), + color-stop( 33.333333333%,rgba(0 ,255, 0,1)), + color-stop( 50% ,rgba(0 ,255,255,1)), + color-stop( 66.666666667%,rgba(0 , 0,255,1)), + color-stop( 83.333333333%,rgba(255, 0,255,1)), + color-stop(100% ,rgba(255, 0, 0,1))); /* Chrome,Safari4+ */ + background: -moz-linear-gradient(left, + rgba(255, 0, 0,1) 0%, + rgba(255,255, 0,1) 16.666666667%, + rgba( 0,255, 0,1) 33.333333333%, + rgba( 0,255,255,1) 50%, + rgba( 0, 0,255,1) 66.666666667%, + rgba(255, 0,255,1) 83.333333333%, + rgba(255, 0, 0,1) 100%); + background: -webkit-linear-gradient(left, + rgba(255, 0, 0,1) 0%, + rgba(255,255, 0,1) 16.666666667%, + rgba( 0,255, 0,1) 33.333333333%, + rgba( 0,255,255,1) 50%, + rgba( 0, 0,255,1) 66.666666667%, + rgba(255, 0,255,1) 83.333333333%, + rgba(255, 0, 0,1) 100%); + background: -o-linear-gradient(left, + rgba(255, 0, 0,1) 0%, + rgba(255,255, 0,1) 16.666666667%, + rgba( 0,255, 0,1) 33.333333333%, + rgba( 0,255,255,1) 50%, + rgba( 0, 0,255,1) 66.666666667%, + rgba(255, 0,255,1) 83.333333333%, + rgba(255, 0, 0,1) 100%); + background: -ms-linear-gradient(left, + rgba(255, 0, 0,1) 0%, + rgba(255,255, 0,1) 16.666666667%, + rgba( 0,255, 0,1) 33.333333333%, + rgba( 0,255,255,1) 50%, + rgba( 0, 0,255,1) 66.666666667%, + rgba(255, 0,255,1) 83.333333333%, + rgba(255, 0, 0,1) 100%); + background: linear-gradient(left, + rgba(255, 0, 0,1) 0%, + rgba(255,255, 0,1) 16.666666667%, + rgba( 0,255, 0,1) 33.333333333%, + rgba( 0,255,255,1) 50%, + rgba( 0, 0,255,1) 66.666666667%, + rgba(255, 0,255,1) 83.333333333%, + rgba(255, 0, 0,1) 100%); +} + +/* Full-saturation magic grayscale values were taken from the Gimp */ +.tizen-huegradient-disabled { + background: none; /* Old browsers */ + background: -webkit-gradient(linear, left top, right top, + color-stop( 0% ,rgba( 54, 54, 54,1)), + color-stop( 16.666666667%,rgba(237,237,237,1)), + color-stop( 33.333333333%,rgba(182,182,182,1)), + color-stop( 50% ,rgba(201,201,201,1)), + color-stop( 66.666666667%,rgba( 18, 18, 18,1)), + color-stop( 83.333333333%,rgba( 73, 73, 73,1)), + color-stop(100% ,rgba( 54, 54, 54,1))); /* Chrome,Safari4+ */ + background: -moz-linear-gradient(left, + rgba( 54, 54, 54,1) 0%, + rgba(237,237,237,1) 16.666666667%, + rgba(182,182,182,1) 33.333333333%, + rgba(201,201,201,1) 50%, + rgba( 18, 18, 18,1) 66.666666667%, + rgba( 73, 73, 73,1) 83.333333333%, + rgba( 54, 54, 54,1) 100%); + background: -webkit-linear-gradient(left, + rgba( 54, 54, 54,1) 0%, + rgba(237,237,237,1) 16.666666667%, + rgba(182,182,182,1) 33.333333333%, + rgba(201,201,201,1) 50%, + rgba( 18, 18, 18,1) 66.666666667%, + rgba( 73, 73, 73,1) 83.333333333%, + rgba( 54, 54, 54,1) 100%); + background: -o-linear-gradient(left, + rgba( 54, 54, 54,1) 0%, + rgba(237,237,237,1) 16.666666667%, + rgba(182,182,182,1) 33.333333333%, + rgba(201,201,201,1) 50%, + rgba( 18, 18, 18,1) 66.666666667%, + rgba( 73, 73, 73,1) 83.333333333%, + rgba( 54, 54, 54,1) 100%); + background: -ms-linear-gradient(left, + rgba( 54, 54, 54,1) 0%, + rgba(237,237,237,1) 16.666666667%, + rgba(182,182,182,1) 33.333333333%, + rgba(201,201,201,1) 50%, + rgba( 18, 18, 18,1) 66.666666667%, + rgba( 73, 73, 73,1) 83.333333333%, + rgba( 54, 54, 54,1) 100%); + background: linear-gradient(left, + rgba( 54, 54, 54,1) 0%, + rgba(237,237,237,1) 16.666666667%, + rgba(182,182,182,1) 33.333333333%, + rgba(201,201,201,1) 50%, + rgba( 18, 18, 18,1) 66.666666667%, + rgba( 73, 73, 73,1) 83.333333333%, + rgba( 54, 54, 54,1) 100%); +} diff --git a/src/widgets/020_huegradient/js/jquery.mobile.tizen.huegradient.js b/src/widgets/020_huegradient/js/jquery.mobile.tizen.huegradient.js new file mode 100755 index 0000000..cee5c3f --- /dev/null +++ b/src/widgets/020_huegradient/js/jquery.mobile.tizen.huegradient.js @@ -0,0 +1,37 @@ +(function ( $, undefined ) { + + $.widget( "tizen.huegradient", $.tizen.widgetex, { + _create: function () { + this.element.addClass( "tizen-huegradient" ); + }, + + // Crutches for IE: it is incapable of multi-stop gradients, so add multiple divs inside the given div, each with a + // two-point gradient + _IEGradient: function ( div, disabled ) { + var rainbow = disabled + ? ["#363636", "#ededed", "#b6b6b6", "#c9c9c9", "#121212", "#494949", "#363636"] + : ["#ff0000", "#ffff00", "#00ff00", "#00ffff", "#0000ff", "#ff00ff", "#ff0000"], + Nix; + + for (Nix = 0 ; Nix < 6 ; Nix++ ) { + $( "
        " ) + .css( { + position: "absolute", + width: ( 100 / 6 ) + "%", + height: "100%", + left: ( Nix * 100 / 6 ) + "%", + top: "0px", + filter: "progid:DXImageTransform.Microsoft.gradient (startColorstr='" + rainbow[Nix] + "', endColorstr='" + rainbow[Nix + 1] + "', GradientType = 1)" + } ) + .appendTo( div ); + } + }, + + _setDisabled: function ( value ) { + $.Widget.prototype._setOption.call( this, "disabled", value ); + if ( $.mobile.browser.ie ) { + this._IEGradient( this.element.empty(), value ); + } + } + } ); +}( jQuery ) ); diff --git a/src/widgets/a_colorwidget/js/colorwidget.js b/src/widgets/a_colorwidget/js/colorwidget.js new file mode 100755 index 0000000..4838170 --- /dev/null +++ b/src/widgets/a_colorwidget/js/colorwidget.js @@ -0,0 +1,49 @@ +( function ( $, undefined ) { + + $.widget( "todons.colorwidget", $.mobile.widget, { + options: { + color: "#ff0972" + }, + + _create: function () { + $.extend ( this, { + isInput: this.element.is( "input" ) + } ); + + /* "value", if present, takes precedence over "data-color" */ + if ( this.isInput ) { + if ( this.element.attr( "value" ).match(/#[0-9A-Fa-f]{6}/) ) { + this.element.attr( "data-color", this.element.attr( "value" ) ); + } + } + + $.mobile.todons.parseOptions( this, true ); + }, + + _setOption: function ( key, value, unconditional ) { + if ( undefined === unconditional ) { + unconditional = false; + } + + if ( key === "color" ) { + this._setColor(value, unconditional); + } + }, + + _setColor: function ( value, unconditional ) { + if ( value.match(/#[0-9A-Fa-f]{6}/) && ( value != this.options.color || unconditional ) ) { + this.options.color = value; + this.element.attr( "data-color", value ); + + if ( this.isInput ) { + this.element.attr( "value", value ); + } + + this.element.triggerHandler( "colorchanged", value ); + return true; + } + return false; + } + } ); + +}( jQuery ) ); diff --git a/src/widgets/autodividers/js/jquery.mobile.tizen.autodividers.js b/src/widgets/autodividers/js/jquery.mobile.tizen.autodividers.js new file mode 100755 index 0000000..945670e --- /dev/null +++ b/src/widgets/autodividers/js/jquery.mobile.tizen.autodividers.js @@ -0,0 +1,274 @@ +/* + * jQuery Mobile Widget @VERSION - listview autodividers + * + * This software is licensed under the MIT licence (as defined by the OSI at + * http://www.opensource.org/licenses/mit-license.php) + * + * *************************************************************************** + * Copyright (c) 2011 by Intel Corporation Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * *************************************************************************** + * + * Authors: Elliot Smith + */ + +// Applies dividers automatically to a listview, using link text +// (for link lists) or text (for readonly lists) as the basis for the +// divider text. +// +// Apply using autodividers({type: 'X'}) on a
          with +// data-role="listview", or with data-autodividers="true", where X +// is the type of divider to create. The default divider type is 'alpha', +// meaning first characters of list item text, upper-cased. +// +// The element used to derive the text for the auto dividers defaults +// to the first link inside the li; failing that, the text directly inside +// the li element is used. This can be overridden with the +// data-autodividers-selector attribute or via options; the selector +// will use each li element as its context. +// +// Any time a new li element is added to the list, or an li element is +// removed, this extension will update the dividers in the listview +// accordingly. +// +// Note that if a listview already has dividers, applying this +// extension will remove all the existing dividers and replace them +// with new, generated ones. +// +// Also note that this extension doesn't sort the list: it only creates +// dividers based on text inside list items. So if your list isn't +// alphabetically-sorted, you may get duplicate dividers. +// +// So, for example, this markup: +// +//
            +//
          • Barry
          • +//
          • Carrie
          • +//
          • Betty
          • +//
          • Harry
          • +//
          • Carly
          • +//
          • Hetty
          • +//
          +// +// will produce dividers like this: +// +//
            +//
          • B
          • +//
          • Barry
          • +//
          • C
          • +//
          • Carrie
          • +//
          • B
          • +//
          • Betty
          • +//
          • H
          • +//
          • Harry
          • +//
          • C
          • +//
          • Carly
          • +//
          • H
          • +//
          • Hetty
          • +//
          +// +// with each divider occuring twice. +// +// Options: +// +// selector: The jQuery selector to use to find text for the +// generated dividers. Default is to use the first 'a' +// (link) element. If this selector doesn't find any +// text, the widget automatically falls back to the text +// inside the li (for read-only lists). Can be set to a custom +// selector via data-autodividers-selector="..." or the 'selector' +// option. +// +// type: 'alpha' (default) sets the auto divider type to "uppercased +// first character of text selected from each item"; "full" sets +// it to the unmodified text selected from each item. Set via +// the data-autodividers="" attribute on the listview or +// the 'type' option. +// +// Events: +// +// updatelayout: Triggered if the dividers in the list change; +// this happens if list items are added to the listview, +// which causes the autodividers to be regenerated. + +(function ( $, undefined ) { + + var autodividers = function ( options ) { + var list = $( this ), + listview = list.data( 'listview' ), + dividerType, + textSelector, + getDividerText, + mergeDividers, + isNonDividerLi, + liAdded, + liRemoved; + + options = options || {}; + dividerType = options.type || list.jqmData( 'autodividers' ) || 'alpha'; + textSelector = options.selector || list.jqmData( 'autodividers-selector' ) || 'a'; + + getDividerText = function ( elt ) { + // look for some text in the item + var text = elt.find( textSelector ).text() || elt.text() || null; + + if ( !text ) { + return null; + } + + // create the text for the divider + if ( dividerType === 'alpha' ) { + text = text.slice( 0, 1 ).toUpperCase(); + } + + return text; + }; + + mergeDividers = function () { + var dividersChanged = false, + divider, + dividerText, + selector, + nextDividers; + + // any dividers which are following siblings of a divider, where + // there are no dividers with different text inbetween, can be removed + list.find( 'li.ui-li-divider' ).each(function () { + divider = $( this ); + dividerText = divider.text(); + selector = '.ui-li-divider:not(:contains(' + dividerText + '))'; + nextDividers = divider.nextUntil( selector ); + nextDividers = nextDividers.filter( '.ui-li-divider:contains(' + dividerText + ')' ); + + if ( nextDividers.length > 0 ) { + nextDividers.remove(); + dividersChanged = true; + } + } ); + + if ( dividersChanged ) { + list.trigger( 'updatelayout' ); + } + }; + + // check that elt is a non-divider li element + isNonDividerLi = function ( elt ) { + return elt.is('li') && + elt.jqmData( 'role' ) !== 'list-divider'; + }; + + // li element inserted, so check whether it needs a divider + liAdded = function ( li ) { + var dividerText = getDividerText( li ), + existingDividers, + divider; + + if ( !dividerText ) { + listview.refresh(); + return; + } + + // add expected divider for this li if it doesn't exist + existingDividers = li.prevAll( '.ui-li-divider:first:contains(' + dividerText + ')' ); + + if ( existingDividers.length === 0 ) { + divider = $( '
        • ' + dividerText + '
        • ' ); + divider.attr( 'data-' + $.mobile.ns + 'role', 'list-divider' ); + li.before( divider ); + + listview.refresh(); + + mergeDividers(); + } else { + listview.refresh(); + } + }; + + // li element removed, so check whether its divider should go + liRemoved = function ( li ) { + var dividerText = getDividerText( li ), + precedingItems, + nextItems; + + if ( !dividerText ) { + listview.refresh(); + return; + } + + // remove divider for this li if there are no other + // li items for the divider before or after this li item + precedingItems = li.prevUntil( '.ui-li-divider:contains(' + dividerText + ')' ); + nextItems = li.nextUntil( '.ui-li-divider' ); + + if ( precedingItems.length === 0 && nextItems.length === 0 ) { + li.prevAll( '.ui-li-divider:contains(' + dividerText + '):first' ).remove(); + + listview.refresh(); + + mergeDividers(); + } else { + listview.refresh(); + } + }; + + // set up the dividers on first create + list.find( 'li' ).each( function () { + var li = $( this ); + + // remove existing dividers + if ( li.jqmData( 'role' ) === 'list-divider' ) { + li.remove(); + } else { // make new dividers for list items + liAdded( li ); + } + } ); + + // bind to DOM events to keep list up to date + list.bind( 'DOMNodeInserted', function ( e ) { + var elt = $( e.target ); + + if ( !isNonDividerLi( elt ) ) { + return; + } + + liAdded( elt ); + } ); + + list.bind( 'DOMNodeRemoved', function ( e ) { + var elt = $( e.target ); + + if ( !isNonDividerLi( elt ) ) { + return; + } + + liRemoved( elt ); + } ); + }; + + $.fn.autodividers = autodividers; + + $( ":jqmData(role=listview)" ).live( "listviewcreate", function () { + var list = $( this ); + + if ( list.is( ':jqmData(autodividers)' ) ) { + list.autodividers(); + } + } ); +}( jQuery ) ); diff --git a/src/widgets/autodividers/test/test-autodividers.html b/src/widgets/autodividers/test/test-autodividers.html new file mode 100644 index 0000000..7da143d --- /dev/null +++ b/src/widgets/autodividers/test/test-autodividers.html @@ -0,0 +1,147 @@ + + + + + + + Baseline test + + + + + + + + + + + +
          +
          +

          autodividers tests

          +
          + +
          +

          This should get auto-dividers based on link text.

          + +
          + +
          +

          This should get auto-dividers based on link text but + shouldn't produce duplicate dividers on refresh. Should also + add more dividers if new list elements are added.

          + +

          + + + +

          + + +
          + +
          +

          This uses a custom selector to draw text from formatted list + items.

          + +
            +
          • Anne likes to eat sweets
          • +
          • Beth likes to eat treats
          • +
          • Bill likes to eat meats
          • +
          • Carl likes to eat beets
          • +
          +
          + +
          +

          This should get auto-dividers based on text. NB this has + intentionally blank li elements to check they don't get dividers.

          +
            +
          • Barry
          • +
          • Betty
          • +
          • Carrie
          • +
          • Harry
          • +
          • +
          • Hetty
          • +
          • Kitty
          • +
          • Larry
          • +
          • +
          • Laurie
          • +
          • Mary
          • +
          +
          + +
          +

          Non-sorted list will produce duplicate auto-dividers.

          +
            +
          • Barry
          • +
          • Carrie
          • +
          • Betty
          • +
          • Harry
          • +
          • Carly
          • +
          • Hetty
          • +
          +
          + +
          +

          This had dividers already which were replaced.

          + +
          + +
          + + + + + diff --git a/src/widgets/barlayout/js/jquery.mobile.tizen.barlayout.js b/src/widgets/barlayout/js/jquery.mobile.tizen.barlayout.js new file mode 100755 index 0000000..3a9eb52 --- /dev/null +++ b/src/widgets/barlayout/js/jquery.mobile.tizen.barlayout.js @@ -0,0 +1,131 @@ +(function( $, undefined ) { + + $.widget( "mobile.barlayout", $.mobile.widget, { + options: { + addBackBtn: false , + backBtnText: "Back", + + initSelector: ":jqmData(role='header'), :jqmData(role='footer')" + }, + _create: function() { + var self = this; + + /* this call api will be moved to jquery.mobile.page.section.js patch */ + /* call _generateFooter in header(just 1 time in first step) because to calculate another layout width footer/header */ + /* skip below step to attach bind/addclass only 1 time */ + self._generateFooter(); + self._addBackbutton(); + self._disableSelection(); + self._disableContext(); + }, + + /* Make dummy footer + * because minimum fixed bar needs to attach back button + * check footer exist on current page, then check footer-Exist option check */ + _generateFooter: function(){ + var self = this, + $el = self.element, + $elPage = $el.closest( ".ui-page" ), + dummyFooter; + + if ( $elPage.children(":jqmData(role='footer')").length == 0 && $elPage.data().page.options.footerExist != false ) { + dummyFooter = $( "" ) + .insertAfter( $elPage.find( ".ui-content" ) ); + } + }, + + _addBackbutton: function( target, status ) { + // need to add parameter target wherels this requert occurs header/footer + var self = this, + $el = self.element, + $elHeader = $( this.element ).jqmData( "role" )=="header" ? self.element : $el.siblings( ":jqmData(role='header')" ), + $elFooter = $( this.element ).jqmData( "role" )=="footer" ? self.element : $el.siblings( ":jqmData(role='footer')" ), + $elPage = $el.closest( ".ui-page" ), + backBtn, + attachElement = $elFooter, + o = $elPage.data( "page" ).options; + + /* Back button skip case : + * 1. tabbar + * 2. footer does not exit + * 3. user define data-add-Back-Btn = "false" + */ + if ( status != "external" ) { + if ( $elFooter.children( ":jqmData(role='controlbar')" ).jqmData( "style" ) == "tabbar" || $elPage.data().page.options.footerExist == false || $elPage.data().page.options.addBackBtn == "none" ) { + return true; + } + } + + $elPage.data().page.options.addBackBtn == "header"? attachElement = $elHeader : attachElement = $elFooter; + + backBtn = $( "" ) + .buttonMarkup( {icon: "header-back-btn", theme : "s"} ); + + if ( status == "external" ) { + if ( $el.is(".ui-page") ) { + $elHeader = $el.find( ":jqmData(role='header')" ); + $elFooter = $el.find( ":jqmData(role='footer')" ); + target == "header" ? attachElement = $elHeader : attachElement = $elFooter; + } else { + attachElement = $el; + } + if ( attachElement.find(".ui-btn-back").length == 0 ) { + backBtn.prependTo( attachElement ); + } + } + + if ( $elPage.jqmData( "url" ) !== $.mobile.path.stripHash( location.hash ) ) { + if ( attachElement.find(".ui-btn-back").length == 0) { + backBtn.prependTo( attachElement ); + } + } + +/* jQM 1.1.0 do not need this code +* navigation.js control whote back button */ +/* backBtn.bind( "vclick", function( event ) { + window.history.back(); + });*/ + }, + + _disableSelection : function() { + var self = this, + $el = self.element, + $elHeader = $( this.element ).jqmData( "role" )=="header" ? self.element : $el.siblings( ":jqmData(role='header')" ), + $elFooter = $( this.element ).jqmData( "role" )=="footer" ? self.element : $el.siblings( ":jqmData(role='footer')" ); + + $.mobile.tizen.disableSelection( $elHeader ); + $.mobile.tizen.disableSelection( $elFooter ); + }, + + _disableContext : function() { + var self = this, + $el = self.element, + $elHeader = $( this.element ).jqmData( "role" )=="header" ? self.element : $el.siblings( ":jqmData(role='header')" ), + $elFooter = $( this.element ).jqmData( "role" )=="footer" ? self.element : $el.siblings( ":jqmData(role='footer')" ); + + $.mobile.tizen.disableContextMenu( $elHeader ); + $.mobile.tizen.disableContextMenu( $elFooter ); + }, + + addBackBtn : function(target) { + this._addBackbutton( target, "external" ); + }, + + + show: function(){ + var self = $( this.element ); + self.show(); + self.siblings( ".ui-content" ).pagelayout( "updatePageLayout" ); + }, + + hide: function(){ + var self = $( this.element ); + self.hide(); + self.siblings( ".ui-content" ).pagelayout( "updatePageLayout" ); + }, + + }); + $( document ).bind("pagecreate", function( e ){ + $.mobile.barlayout.prototype.enhanceWithin( e.target ); + }); +})( jQuery ); diff --git a/src/widgets/circularview/js/jquery.mobile.tizen.circularview.js b/src/widgets/circularview/js/jquery.mobile.tizen.circularview.js new file mode 100755 index 0000000..b45c513 --- /dev/null +++ b/src/widgets/circularview/js/jquery.mobile.tizen.circularview.js @@ -0,0 +1,509 @@ +/* *************************************************************************** + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software" ), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * *************************************************************************** + */ + +// most of following codes are derived from jquery.mobile.scrollview.js +(function ( $, window, document, undefined ) { + + function circularNum( num, total ) { + var n = num % total; + if ( n < 0 ) { + n = total + n; + } + return n; + } + + function setElementTransform( $ele, x, y ) { + var v = "translate3d( " + x + "," + y + ", 0px)"; + $ele.css({ + "-moz-transform": v, + "-webkit-transform": v, + "transform": v + } ); + } + + function MomentumTracker( options ) { + this.options = $.extend( {}, options ); + this.easing = "easeOutQuad"; + this.reset(); + } + + var tstates = { + scrolling : 0, + done : 1 + }; + + function getCurrentTime() { + return Date.now(); + } + + $.extend( MomentumTracker.prototype, { + start: function ( pos, speed, duration ) { + this.state = ( speed != 0 ) ? tstates.scrolling : tstates.done; + this.pos = pos; + this.speed = speed; + this.duration = duration; + + this.fromPos = 0; + this.toPos = 0; + + this.startTime = getCurrentTime(); + }, + + reset: function () { + this.state = tstates.done; + this.pos = 0; + this.speed = 0; + this.duration = 0; + }, + + update: function () { + var state = this.state, + duration, + elapsed, + dx, + x; + + if ( state == tstates.done ) { + return this.pos; + } + + duration = this.duration; + elapsed = getCurrentTime() - this.startTime; + elapsed = elapsed > duration ? duration : elapsed; + + dx = this.speed * ( 1 - $.easing[this.easing](elapsed / duration, elapsed, 0, 1, duration ) ); + + x = this.pos + dx; + this.pos = x; + + if ( elapsed >= duration ) { + this.state = tstates.done; + } + + return this.pos; + }, + + done: function () { + return this.state == tstates.done; + }, + + getPosition: function () { + return this.pos; + } + } ); + + jQuery.widget( "mobile.circularview", jQuery.mobile.widget, { + options: { + fps: 60, + + scrollDuration: 2000, + + moveThreshold: 10, + moveIntervalThreshold: 150, + + startEventName: "scrollstart", + updateEventName: "scrollupdate", + stopEventName: "scrollstop", + + eventType: $.support.touch ? "touch" : "mouse", + + delayedClickSelector: "a, .ui-btn", + delayedClickEnabled: false + }, + + _makePositioned: function ( $ele ) { + if ( $ele.css( 'position' ) == 'static' ) { + $ele.css( 'position', 'relative' ); + } + }, + + _create: function () { + var self = this; + + this._items = $( this.element ).jqmData('list'); + this._$clip = $( this.element ).addClass( "ui-scrollview-clip" ); + this._$clip.wrapInner( '
          ' ); + this._$view = $('.ui-scrollview-view', this._$clip ); + this._$list = $( 'ul', this._$clip ); + + this._$clip.css( "overflow", "hidden" ); + this._makePositioned( this._$clip ); + + this._$view.css( "overflow", "hidden" ); + this._tracker = new MomentumTracker( this.options ); + + this._timerInterval = 1000 / this.options.fps; + this._timerID = 0; + + this._timerCB = function () { self._handleMomentumScroll(); }; + + this.refresh(); + + this._addBehaviors(); + }, + + reflow: function () { + var xy = this.getScrollPosition(); + this.refresh(); + this.scrollTo( xy.x, xy.y ); + }, + + refresh: function () { + var itemsPerView; + + this._$clip.width( $(window).width() ); + this._clipWidth = this._$clip.width(); + this._$list.empty(); + this._$list.append(this._items[0]); + this._itemWidth = $(this._items[0]).outerWidth(); + $(this._items[0]).detach(); + + itemsPerView = this._clipWidth / this._itemWidth; + itemsPerView = Math.ceil( itemsPerView * 10 ) / 10; + this._itemsPerView = parseInt( itemsPerView, 10 ); + while ( this._itemsPerView + 1 > this._items.length ) { + $.merge( this._items, $(this._items).clone() ); + } + this._rx = -this._itemWidth; + this._sx = -this._itemWidth; + this._setItems(); + }, + + _startMScroll: function ( speedX, speedY ) { + this._stopMScroll(); + + var keepGoing = false, + duration = this.options.scrollDuration, + t = this._tracker, + c = this._clipWidth, + v = this._viewWidth; + + this._$clip.trigger( this.options.startEventName); + + t.start( this._rx, speedX, duration, (v > c ) ? -(v - c) : 0, 0 ); + keepGoing = !t.done(); + + if ( keepGoing ) { + this._timerID = setTimeout( this._timerCB, this._timerInterval ); + } else { + this._stopMScroll(); + } + //console.log( "startmscroll" + this._rx + "," + this._sx ); + }, + + _stopMScroll: function () { + if ( this._timerID ) { + this._$clip.trigger( this.options.stopEventName ); + clearTimeout( this._timerID ); + } + + this._timerID = 0; + + if ( this._tracker ) { + this._tracker.reset(); + } + //console.log( "stopmscroll" + this._rx + "," + this._sx ); + }, + + _handleMomentumScroll: function () { + var keepGoing = false, + v = this._$view, + x = 0, + y = 0, + t = this._tracker; + + if ( t ) { + t.update(); + x = t.getPosition(); + + keepGoing = !t.done(); + + } + + this._setScrollPosition( x, y ); + this._rx = x; + + this._$clip.trigger( this.options.updateEventName, [ { x: x, y: y } ] ); + + if ( keepGoing ) { + this._timerID = setTimeout( this._timerCB, this._timerInterval ); + } else { + this._stopMScroll(); + } + }, + + _setItems: function () { + var i, + $item; + + for ( i = -1; i < this._itemsPerView + 1; i++ ) { + $item = this._items[ circularNum( i, this._items.length ) ]; + this._$list.append( $item ); + } + setElementTransform( this._$view, this._sx + "px", 0 ); + this._$view.width( this._itemWidth * ( this._itemsPerView + 2 ) ); + this._viewWidth = this._$view.width(); + }, + + _setScrollPosition: function ( x, y ) { + var sx = this._sx, + dx = x - sx, + di = parseInt( dx / this._itemWidth, 10 ), + i, + idx, + $item; + + if ( di > 0 ) { + for ( i = 0; i < di; i++ ) { + this._$list.children().last().detach(); + idx = -parseInt( ( sx / this._itemWidth ) + i + 3, 10 ); + $item = this._items[ circularNum( idx, this._items.length ) ]; + this._$list.prepend( $item ); + //console.log( "di > 0 : " + idx ); + } + } else if ( di < 0 ) { + for ( i = 0; i > di; i-- ) { + this._$list.children().first().detach(); + idx = this._itemsPerView - parseInt( ( sx / this._itemWidth ) + i, 10 ); + $item = this._items[ circularNum( idx, this._items.length ) ]; + this._$list.append( $item ); + //console.log( "di < 0 : " + idx ); + } + } + + this._sx += di * this._itemWidth; + + setElementTransform( this._$view, ( x - this._sx - this._itemWidth ) + "px", 0 ); + + //console.log( "rx " + this._rx + "sx " + this._sx ); + }, + + _enableTracking: function () { + $(document).bind( this._dragMoveEvt, this._dragMoveCB ); + $(document).bind( this._dragStopEvt, this._dragStopCB ); + }, + + _disableTracking: function () { + $(document).unbind( this._dragMoveEvt, this._dragMoveCB ); + $(document).unbind( this._dragStopEvt, this._dragStopCB ); + }, + + _getScrollHierarchy: function () { + var svh = [], + d; + this._$clip.parents( '.ui-scrollview-clip' ).each( function () { + d = $( this ).jqmData( 'circulaview' ); + if ( d ) { + svh.unshift( d ); + } + } ); + return svh; + }, + + centerTo: function ( selector, duration ) { + var i, + newX; + + for ( i = 0; i < this._items.length; i++ ) { + if ( $( this._items[i]).is( selector ) ) { + newX = -( i * this._itemWidth - this._clipWidth / 2 + this._itemWidth * 1.5 ); + this.scrollTo( newX + this._clipWidth * 2, 0 ); + this.scrollTo( newX, 0, duration ); + return; + } + } + }, + + scrollTo: function ( x, y, duration ) { + this._stopMScroll(); + if ( !duration ) { + this._setScrollPosition( x, y ); + this._rx = x; + return; + } + + var self = this, + start = getCurrentTime(), + efunc = $.easing.easeOutQuad, + sx = this._rx, + sy = 0, + dx = x - sx, + dy = 0, + tfunc, + elapsed, + ec; + + this._rx = x; + + tfunc = function () { + elapsed = getCurrentTime() - start; + if ( elapsed >= duration ) { + self._timerID = 0; + self._setScrollPosition( x, y ); + } else { + ec = efunc( elapsed / duration, elapsed, 0, 1, duration ); + self._setScrollPosition( sx + ( dx * ec ), sy + ( dy * ec ) ); + self._timerID = setTimeout( tfunc, self._timerInterval ); + } + }; + + this._timerID = setTimeout( tfunc, this._timerInterval ); + }, + + getScrollPosition: function () { + return { x: -this._rx, y: 0 }; + }, + + _handleDragStart: function ( e, ex, ey ) { + $.each( this._getScrollHierarchy(), function ( i, sv ) { + sv._stopMScroll(); + } ); + + this._stopMScroll(); + + if ( this.options.delayedClickEnabled ) { + this._$clickEle = $( e.target ).closest( this.options.delayedClickSelector ); + } + this._lastX = ex; + this._lastY = ey; + this._speedX = 0; + this._speedY = 0; + this._didDrag = false; + + this._lastMove = 0; + this._enableTracking(); + + this._ox = ex; + this._nx = this._rx; + + if ( this.options.eventType == "mouse" || this.options.delayedClickEnabled ) { + e.preventDefault(); + } + //console.log( "scrollstart" + this._rx + "," + this._sx ); + e.stopPropagation(); + }, + + _handleDragMove: function ( e, ex, ey ) { + this._lastMove = getCurrentTime(); + + var dx = ex - this._lastX, + dy = ey - this._lastY; + + this._speedX = dx; + this._speedY = 0; + + this._didDrag = true; + + this._lastX = ex; + this._lastY = ey; + + this._mx = ex - this._ox; + + this._setScrollPosition( this._nx + this._mx, 0 ); + + //console.log( "scrollmove" + this._rx + "," + this._sx ); + return false; + }, + + _handleDragStop: function ( e ) { + var l = this._lastMove, + t = getCurrentTime(), + doScroll = l && ( t - l ) <= this.options.moveIntervalThreshold, + sx = ( this._tracker && this._speedX && doScroll ) ? this._speedX : 0, + sy = 0; + + this._rx = this._mx ? this._nx + this._mx : this._rx; + + if ( sx ) { + this._startMScroll( sx, sy ); + } + + //console.log( "scrollstop" + this._rx + "," + this._sx ); + + this._disableTracking(); + + if ( !this._didDrag && this.options.delayedClickEnabled && this._$clickEle.length ) { + this._$clickEle + .trigger( "mousedown" ) + .trigger( "mouseup" ) + .trigger( "click" ); + } + + if ( this._didDrag ) { + e.preventDefault(); + e.stopPropagation(); + } + + return this._didDrag ? false : undefined; + }, + + _addBehaviors: function () { + var self = this; + + if ( this.options.eventType === "mouse" ) { + this._dragStartEvt = "mousedown"; + this._dragStartCB = function ( e ) { + return self._handleDragStart( e, e.clientX, e.clientY ); + }; + + this._dragMoveEvt = "mousemove"; + this._dragMoveCB = function ( e ) { + return self._handleDragMove( e, e.clientX, e.clientY ); + }; + + this._dragStopEvt = "mouseup"; + this._dragStopCB = function ( e ) { + return self._handleDragStop( e ); + }; + + this._$view.bind( "vclick", function (e) { + return !self._didDrag; + } ); + + } else { //touch + this._dragStartEvt = "touchstart"; + this._dragStartCB = function ( e ) { + var t = e.originalEvent.targetTouches[0]; + return self._handleDragStart(e, t.pageX, t.pageY ); + }; + + this._dragMoveEvt = "touchmove"; + this._dragMoveCB = function ( e ) { + var t = e.originalEvent.targetTouches[0]; + return self._handleDragMove(e, t.pageX, t.pageY ); + }; + + this._dragStopEvt = "touchend"; + this._dragStopCB = function ( e ) { + return self._handleDragStop( e ); + }; + } + this._$view.bind( this._dragStartEvt, this._dragStartCB ); + } + } ); + + $( document ).bind( "pagecreate create", function ( e ) { + $( $.mobile.circularview.prototype.options.initSelector, e.target ).circularview(); + } ); + +}( jQuery, window, document ) ); // End Component diff --git a/src/widgets/colorpalette/js/jquery.mobile.tizen.colorpalette.js b/src/widgets/colorpalette/js/jquery.mobile.tizen.colorpalette.js new file mode 100755 index 0000000..1743910 --- /dev/null +++ b/src/widgets/colorpalette/js/jquery.mobile.tizen.colorpalette.js @@ -0,0 +1,226 @@ +/* TBD */ +/* + * jQuery Mobile Widget @VERSION + * + * This software is licensed under the MIT licence (as defined by the OSI at + * http://www.opensource.org/licenses/mit-license.php) + * + * *************************************************************************** + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. + * Copyright (c) 2011 by Intel Corporation Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to 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: Gabriel Schulhof + */ + +// It displays a grid two rows by five columns of colors. +// +// The colors are automatically computed based on the hue +// of the color set by the color attribute (see below). +// +// One of the displayed colors is the color attribute itself +// and the others are multiples of 360/10 away from that color; +// 10 is the total number of colors displayed (2 rows by 5 columns). +// +// To apply, add the attribute data-role="colorpalette" to a
          +// element inside a page. Alternatively, call colorpalette() on an +// element. +// +// Options: +// +// color: String; initial color can be specified in html +// using the data-color="#ff00ff" attribute or +// when constructed in javascript, eg : +// $("#mycolorpalette").colorpalette({ color: "#ff00ff" }); +// where the html might be : +//
          +// The color can be changed post-construction like this : +// $("#mycolorpalette").colorpalette("option", "color", "#ABCDEF"); +// Default: "#1a8039" + +/* + * Colorpalette displays a grid two rows by five columns of colors. + * + * The colors are automatically computed based on the hue + * of the color set by the color attribute (see below). + * + * One of the displayed colors is the color attribute itself + * and the others are multiples of 360/10 away from that color; + * 10 is the total number of colors displayed (2 rows by 5 columns). + * + * HTML attributes: + * + * To apply, add the attribute data-role="colorpalette" to a
          + * element inside a page. Alternatively, call colorpalette() on an + * element. + * + * data-role: Myst have 'colorpalette'. + * data-color: String; initial color can be specified in html + * using the data-color="#ff00ff" attribute or + * when constructed in javascript, eg : + * $("#mycolorpalette").colorpalette({ color: "#ff00ff" }); + * where the html might be : + *
          + * The color can be changed post-construction like this : + * $("#mycolorpalette").colorpalette("option", "color", "#ABCDEF"); + * Default: "#1a8039" + * + *APIs: + * $('obj').colorpalette() : Make an object to a colorpalette widget. + * + *Events: + * No event. + * + *Examples: + *
          + * + *
          + * + * + */ + +( function ( $, undefined ) { + + $.widget( "tizen.colorpalette", $.tizen.colorwidget, { + options: { + showPreview: false, + initSelector: ":jqmData(role='colorpalette')" + }, + + _htmlProto: { + ui: { + clrpalette: "#colorpalette", + preview: "#colorpalette-preview", + previewContainer: "#colorpalette-preview-container" + } + }, + + _create: function () { + var self = this; + + this.element + .css( "display", "none" ) + .after( this._ui.clrpalette ); + + this._ui.clrpalette.find( "[data-colorpalette-choice]" ).bind( "vclick", function ( e ) { + var clr = $.tizen.colorwidget.prototype._getElementColor.call(this, $(e.target)), + Nix, + nChoices = self._ui.clrpalette.attr( "data-" + ( $.mobile.ns || "" ) + "n-choices" ), + choiceId, + rgbMatches; + + rgbMatches = clr.match(/rgb\(([0-9]*), *([0-9]*), *([0-9]*)\)/); + + if ( rgbMatches && rgbMatches.length > 3 ) { + clr = $.tizen.colorwidget.clrlib.RGBToHTML( [ + parseInt(rgbMatches[1], 10) / 255, + parseInt(rgbMatches[2], 10) / 255, + parseInt(rgbMatches[3], 10) / 255] ); + } + + for ( Nix = 0 ; Nix < nChoices ; Nix++ ) { + self._ui.clrpalette.find( "[data-colorpalette-choice=" + Nix + "]" ).removeClass( "colorpalette-choice-active" ); + } + + $(e.target).addClass( "colorpalette-choice-active" ); + $.tizen.colorwidget.prototype._setColor.call( self, clr ); + $.tizen.colorwidget.prototype._setElementColor.call( self, self._ui.preview, $.tizen.colorwidget.clrlib.RGBToHSL( $.tizen.colorwidget.clrlib.HTMLToRGB( clr ) ), "background" ); + } ); + }, + + _setShowPreview: function ( show ) { + if ( show ) { + this._ui.previewContainer.removeAttr( "style" ); + } else { + this._ui.previewContainer.css( "display", "none" ); + } + + this.element.attr( "data-" + ( $.mobile.ns || "" ) + "show-preview", show ); + this.options.showPreview = show; + }, + + widget: function ( value ) { + return this._ui.clrpalette; + }, + + _setDisabled: function ( value ) { + $.tizen.widgetex.prototype._setDisabled.call( this, value ); + this._ui.clrpalette[value ? "addClass" : "removeClass"]( "ui-disabled" ); + $.tizen.colorwidget.prototype._displayDisabledState.call( this, this._ui.clrpalette ); + }, + + _setColor: function ( clr ) { + if ( $.tizen.colorwidget.prototype._setColor.call( this, clr ) ) { + clr = this.options.color; + + var Nix, + activeIdx = -1, + nChoices = this._ui.clrpalette.attr( "data-" + ( $.mobile.ns || "" ) + "n-choices" ), + hsl = $.tizen.colorwidget.clrlib.RGBToHSL( $.tizen.colorwidget.clrlib.HTMLToRGB( clr ) ), + origHue = hsl[0], + offset = hsl[0] / 36, + theFloor = Math.floor( offset ), + newClr, + currentlyActive; + + $.tizen.colorwidget.prototype._setElementColor.call( this, this._ui.preview, + $.tizen.colorwidget.clrlib.RGBToHSL( $.tizen.colorwidget.clrlib.HTMLToRGB( clr ) ), "background" ); + + offset = ( offset - theFloor < 0.5 ) + ? ( offset - theFloor ) + : ( offset - ( theFloor + 1 ) ); + + offset *= 36; + + for ( Nix = 0 ; Nix < nChoices ; Nix++ ) { + hsl[0] = Nix * 36 + offset; + hsl[0] = ( ( hsl[0] < 0) ? ( hsl[0] + 360 ) : ( ( hsl[0] > 360 ) ? ( hsl[0] - 360 ) : hsl[0] ) ); + + if ( hsl[0] === origHue ) { + activeIdx = Nix; + } + + newClr = $.tizen.colorwidget.clrlib.RGBToHTML( $.tizen.colorwidget.clrlib.HSLToRGB( hsl ) ); + + $.tizen.colorwidget.prototype._setElementColor.call( this, this._ui.clrpalette.find( "[data-colorpalette-choice=" + Nix + "]" ), + $.tizen.colorwidget.clrlib.RGBToHSL( $.tizen.colorwidget.clrlib.HTMLToRGB( newClr ) ), "background" ); + } + + if (activeIdx != -1) { + currentlyActive = parseInt( this._ui.clrpalette.find( ".colorpalette-choice-active" ).attr( "data-" + ($.mobile.ns || "" ) + "colorpalette-choice" ), 10 ); + if ( currentlyActive != activeIdx ) { + this._ui.clrpalette.find( "[data-colorpalette-choice=" + currentlyActive + "]" ).removeClass( "colorpalette-choice-active" ); + this._ui.clrpalette.find( "[data-colorpalette-choice=" + activeIdx + "]" ).addClass( "colorpalette-choice-active" ); + } + } + } + } + }); + + $( document ).bind( "pagecreate create", function ( e ) { + $( $.tizen.colorpalette.prototype.options.initSelector, e.target ) + .not( ":jqmData(role='none'), :jqmData(role='nojs')" ) + .colorpalette(); + }); + +}( jQuery ) ); \ No newline at end of file diff --git a/src/widgets/colorpalette/less/colorpalette.less b/src/widgets/colorpalette/less/colorpalette.less new file mode 100644 index 0000000..0daacb8 --- /dev/null +++ b/src/widgets/colorpalette/less/colorpalette.less @@ -0,0 +1,78 @@ +@import "../../common/less/jquery.mobile.todons.defines.less"; +@colorpalette-choice-total-width: 54px; +@colorpalette-choice-total-height: 54px; +@colorpalette-item-border-width: 4px; +@colorpalette-item-border-color: #c0c0c0; +@colorpalette-preview-total-width: 304px; +@colorpalette-preview-total-height: 109px; + +@colorpalette-choice-actual-width: @colorpalette-choice-total-width - 2 * @colorpalette-item-border-width; +@colorpalette-choice-actual-height: @colorpalette-choice-total-height - 2 * @colorpalette-item-border-width; +@colorpalette-preview-actual-width: @colorpalette-preview-total-width - 2 * @colorpalette-item-border-width; +@colorpalette-preview-actual-height: @colorpalette-preview-total-height - 2 * @colorpalette-item-border-width; + +.todons-colorpalette-disabled { + .colorpalette-table { + .colorpalette-choice-active { + border-color: @todons-selected-color-disabled !important; + } + } +} + +.ui-colorpalette { + display: table; + padding-left: 24px; + padding-right: 24px; + padding-top: 15px; + padding-bottom: 15px; + + .colorpalette-preview-container { + padding-top: 48px; + padding-bottom: 39px; + display: table; + margin: auto; + + .colorpalette-preview { + display: table; + margin: auto; + width: @colorpalette-preview-actual-width; + height: @colorpalette-preview-actual-height; + border: @colorpalette-item-border-color @colorpalette-item-border-width solid; + } + } + + .colorpalette-table { + .colorpalette-bottom-row { + display: table-row; + } + + .colorpalette-normal-row { + .colorpalette-bottom-row; + } + + .colorpalette-choice-container-left { + display: table-cell; + } + + .colorpalette-choice-container-rest { + .colorpalette-choice-container-left; + padding-left: 38px; + } + + .colorpalette-normal-row .colorpalette-choice-container-left { + padding-bottom: 16px; + } + + .colorpalette-choice { + width: @colorpalette-choice-actual-width; + height: @colorpalette-choice-actual-width; + border-width: @colorpalette-item-border-width; + border-style: solid; + border-color: @colorpalette-item-border-color; + } + + .colorpalette-choice-active { + border-color: @todons-selected-color; + } + } +} diff --git a/src/widgets/colorpalette/proto-html/colorpalette.prototype.html b/src/widgets/colorpalette/proto-html/colorpalette.prototype.html new file mode 100644 index 0000000..3013b9f --- /dev/null +++ b/src/widgets/colorpalette/proto-html/colorpalette.prototype.html @@ -0,0 +1,41 @@ +
          +
          +
          +
          +
          +
          +
          +
          +
          +
          +
          +
          +
          +
          +
          +
          +
          +
          +
          +
          +
          +
          +
          +
          +
          +
          +
          +
          +
          +
          +
          +
          +
          +
          +
          +
          +
          +
          +
          +
          +
          diff --git a/src/widgets/colorpicker/css/colorpicker.css b/src/widgets/colorpicker/css/colorpicker.css new file mode 100644 index 0000000..b86a4f4 --- /dev/null +++ b/src/widgets/colorpicker/css/colorpicker.css @@ -0,0 +1,45 @@ +.ui-colorpicker .colorpicker-hs-container .sat-gradient { + background: none; /* Old browsers */ + background: -webkit-gradient(linear, left top, left bottom, + color-stop(0%,rgba(128,128,128,0)), + color-stop(100%,rgba(128,128,128,1))); /* Chrome,Safari4+ */ + background: -moz-linear-gradient(top, + rgba(128,128,128,0) 0%, + rgba(128,128,128,1) 100%); /* FF3.6+ */ + background: -webkit-linear-gradient(top, + rgba(128,128,128,0) 0%, + rgba(128,128,128,1) 100%); /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(top, + rgba(128,128,128,0) 0%, + rgba(128,128,128,1) 100%); /* Opera11.10+ */ + background: -ms-linear-gradient(top, + rgba(128,128,128,0) 0%, + rgba(128,128,128,1) 100%); /* IE10+ */ + background: linear-gradient(top, + rgba(128,128,128,0) 0%, + rgba(128,128,128,1) 100%); /* W3C */ + filter: progid:DXImageTransform.Microsoft.gradient (startColorstr='#00808080', endColorstr="#808080", GradientType = 0); +} + +.ui-colorpicker .colorpicker-l-container .l-gradient { + background: none; /* Old browsers */ + background: -webkit-gradient(linear, left top, left bottom, + color-stop(0%,rgba(0,0,0,1)), + color-stop(100%,rgba(255,255,255,1))); /* Chrome,Safari4+ */ + background: -moz-linear-gradient(top, + rgba(0,0,0,1) 0%, + rgba(255,255,255,1) 100%); /* FF3.6+ */ + background: -webkit-linear-gradient(top, + rgba(0,0,0,1) 0%, + rgba(255,255,255,1) 100%); /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(top, + rgba(0,0,0,1) 0%, + rgba(255,255,255,1) 100%); /* Opera11.10+ */ + background: -ms-linear-gradient(top, + rgba(0,0,0,1) 0%, + rgba(255,255,255,1) 100%); /* IE10+ */ + background: linear-gradient(top, + rgba(0,0,0,1) 0%, + rgba(255,255,255,1) 100%); /* W3C */ + filter: progid:DXImageTransform.Microsoft.gradient (startColorstr='#000000', endColorstr="#ffffff", GradientType = 0); +} diff --git a/src/widgets/colorpicker/js/jquery.mobile.tizen.colorpicker.js b/src/widgets/colorpicker/js/jquery.mobile.tizen.colorpicker.js new file mode 100755 index 0000000..e8f5cfe --- /dev/null +++ b/src/widgets/colorpicker/js/jquery.mobile.tizen.colorpicker.js @@ -0,0 +1,224 @@ +/* + * jQuery Mobile Widget @VERSION + * + * This software is licensed under the MIT licence (as defined by the OSI at + * http://www.opensource.org/licenses/mit-license.php) + * + * *************************************************************************** + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. + * Copyright (c) 2011 by Intel Corporation Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to 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: Gabriel Schulhof + */ + +// Displays a 2D hue/saturation spectrum and a lightness slider. +// +// To apply, add the attribute data-role="colorpicker" to a
          +// element inside a page. Alternatively, call colorpicker() +// on an element (see below). +// +//Options: +// color: String; can be specified in html using the +// data-color="#ff00ff" attribute or when constructed +// $("#mycolorpicker").colorpicker({ color: "#ff00ff" }); +// where the html might be : +//
          + +(function ( $, undefined ) { + + $.widget( "tizen.colorpicker", $.tizen.colorwidget, { + options: { + initSelector: ":jqmData(role='colorpicker')" + }, + + _htmlProto: { + ui: { + clrpicker: "#colorpicker", + hs: { + hueGradient: "#colorpicker-hs-hue-gradient", + gradient: "#colorpicker-hs-sat-gradient", + eventSource: "[data-event-source='hs']", + valMask: "#colorpicker-hs-val-mask", + selector: "#colorpicker-hs-selector" + }, + l: { + gradient: "#colorpicker-l-gradient", + eventSource: "[data-event-source='l']", + selector: "#colorpicker-l-selector" + } + } + }, + + _create: function () { + var self = this; + + this.element + .css( "display", "none" ) + .after( this._ui.clrpicker ); + + this._ui.hs.hueGradient.huegradient(); + + $.extend( self, { + dragging: false, + draggingHS: false, + selectorDraggingOffset: { + x : -1, + y : -1 + }, + dragging_hsl: undefined + } ); + + $( document ) + .bind( "vmousemove", function ( event ) { + if ( self.dragging ) { + event.stopPropagation(); + event.preventDefault(); + } + } ) + .bind( "vmouseup", function ( event ) { + if ( self.dragging ) { + self.dragging = false; + } + } ); + + this._bindElements( "hs" ); + this._bindElements( "l" ); + }, + + _bindElements: function ( which ) { + var self = this, + stopDragging = function ( event ) { + self.dragging = false; + event.stopPropagation(); + event.preventDefault(); + }; + + this._ui[which].eventSource + .bind( "vmousedown mousedown", function ( event ) { self._handleMouseDown( event, which, false ); } ) + .bind( "vmousemove" , function ( event ) { self._handleMouseMove( event, which, false ); } ) + .bind( "vmouseup" , stopDragging ); + + this._ui[which].selector + .bind( "vmousedown mousedown", function ( event ) { self._handleMouseDown( event, which, true); } ) + .bind( "touchmove vmousemove", function ( event ) { self._handleMouseMove( event, which, true); } ) + .bind( "vmouseup" , stopDragging ); + }, + + _handleMouseDown: function ( event, containerStr, isSelector ) { + var coords = $.mobile.tizen.targetRelativeCoordsFromEvent( event ), + widgetStr = isSelector ? "selector" : "eventSource"; + if ( ( coords.x >= 0 && coords.x <= this._ui[containerStr][widgetStr].width() && + coords.y >= 0 && coords.y <= this._ui[containerStr][widgetStr].height() ) || isSelector ) { + this.dragging = true; + this.draggingHS = ( "hs" === containerStr ); + + if ( isSelector ) { + this.selectorDraggingOffset.x = coords.x; + this.selectorDraggingOffset.y = coords.y; + } + + this._handleMouseMove( event, containerStr, isSelector, coords ); + } + }, + + _handleMouseMove: function ( event, containerStr, isSelector, coords ) { + var potential_h, + potential_s, + potential_l; + + if ( this.dragging && + !( ( this.draggingHS && containerStr === "l" ) || + ( !this.draggingHS && containerStr === "hs" ) ) ) { + coords = ( coords || $.mobile.tizen.targetRelativeCoordsFromEvent( event ) ); + + if ( this.draggingHS ) { + potential_h = isSelector + ? this.dragging_hsl[0] / 360 + ( coords.x - this.selectorDraggingOffset.x ) / this._ui[containerStr].eventSource.width() + : coords.x / this._ui[containerStr].eventSource.width(); + potential_s = isSelector + ? this.dragging_hsl[1] + ( coords.y - this.selectorDraggingOffset.y ) / this._ui[containerStr].eventSource.height() + : coords.y / this._ui[containerStr].eventSource.height(); + + this.dragging_hsl[0] = Math.min( 1.0, Math.max( 0.0, potential_h ) ) * 360; + this.dragging_hsl[1] = Math.min( 1.0, Math.max( 0.0, potential_s ) ); + } else { + potential_l = isSelector + ? this.dragging_hsl[2] + ( coords.y - this.selectorDraggingOffset.y ) / this._ui[containerStr].eventSource.height() + : coords.y / this._ui[containerStr].eventSource.height(); + + this.dragging_hsl[2] = Math.min( 1.0, Math.max( 0.0, potential_l ) ); + } + + if ( !isSelector ) { + this.selectorDraggingOffset.x = Math.ceil( this._ui[containerStr].selector.outerWidth() / 2.0 ); + this.selectorDraggingOffset.y = Math.ceil( this._ui[containerStr].selector.outerHeight() / 2.0 ); + } + + this._updateSelectors( this.dragging_hsl ); + event.stopPropagation(); + event.preventDefault(); + } + }, + + _updateSelectors: function ( hsl ) { + var clr = $.tizen.colorwidget.prototype._setElementColor.call( this, this._ui.hs.selector, [hsl[0], 1.0 - hsl[1], hsl[2]], "background" ).clr, + gray = $.tizen.colorwidget.clrlib.RGBToHTML( [hsl[2], hsl[2], hsl[2]] ); + + this._ui.hs.valMask.css((hsl[2] < 0.5) + ? { background : "#000000" , opacity : ( 1.0 - hsl[2] * 2.0 ) } + : { background : "#ffffff" , opacity : ( ( hsl[2] - 0.5 ) * 2.0 ) } ); + this._ui.hs.selector.css( { + left : ( hsl[0] / 360 * this._ui.hs.eventSource.width() ), + top : ( hsl[1] * this._ui.hs.eventSource.height() ) + }); + this._ui.l.selector.css({ + top : ( hsl[2] * this._ui.l.eventSource.height() ), + background : gray + } ); + $.tizen.colorwidget.prototype._setColor.call( this, clr ); + }, + + widget: function () { return this._ui.clrpicker; }, + + _setDisabled: function ( value ) { + $.tizen.widgetex.prototype._setDisabled.call( this, value ); + this._ui.hs.hueGradient.huegradient( "option", "disabled", value ); + this._ui.clrpicker[value ? "addClass" : "removeClass"]( "ui-disabled" ); + $.tizen.colorwidget.prototype._displayDisabledState.call( this, this._ui.clrpicker ); + }, + + _setColor: function ( clr ) { + if ( $.tizen.colorwidget.prototype._setColor.call( this, clr ) ) { + this.dragging_hsl = $.tizen.colorwidget.clrlib.RGBToHSL( $.tizen.colorwidget.clrlib.HTMLToRGB( this.options.color ) ); + this.dragging_hsl[1] = 1.0 - this.dragging_hsl[1]; + this._updateSelectors( this.dragging_hsl ); + } + } + } ); + + $( document ).bind( "pagecreate create", function ( e ) { + $( $.tizen.colorpicker.prototype.options.initSelector, e.target ) + .not( ":jqmData(role='none'), :jqmData(role='nojs')" ) + .colorpicker(); + } ); + +}( jQuery ) ); \ No newline at end of file diff --git a/src/widgets/colorpicker/less/colorpicker.less b/src/widgets/colorpicker/less/colorpicker.less new file mode 100644 index 0000000..ead1bc9 --- /dev/null +++ b/src/widgets/colorpicker/less/colorpicker.less @@ -0,0 +1,74 @@ +/* Own CSS */ + +/* @selector-size should be an odd number, in order to pixel-perfectly center on a given colour */ +@colorpicker-selector-size: 61px; +@colorpicker-selector-border-width: 5px; +@colorpicker-clrchannel-hs-width: 256px; +@colorpicker-clrchannel-hs-height: 256px; +@colorpicker-clrchannel-l-width: 16px; +@colorpicker-clrchannel-l-height: 256px; + +@colorpicker-selector-total-size: @colorpicker-selector-size + 2 * @colorpicker-selector-border-width; +@colorpicker-clrchannel-hs-padding: @colorpicker-selector-total-size / 2; +@colorpicker-clrchannel-l-hpadding: + + ~`Math.max(0, + parseInt("@{colorpicker-selector-total-size}") - + parseInt("@{colorpicker-clrchannel-l-width}")) / 2 + "px"`; +@colorpicker-clrchannel-l-selector-left: + ~`Math.max(0, + parseInt("@{colorpicker-clrchannel-l-width}") - + parseInt("@{colorpicker-selector-total-size}")) / 2 + "px"`; + +.ui-colorpicker { + display: table; + + .colorpicker-hs-container { + position: relative; + display: table-cell; + float: left; + + width: @colorpicker-clrchannel-hs-width; + height: @colorpicker-clrchannel-hs-height; + padding: @colorpicker-clrchannel-hs-padding; + + .colorpicker-hs-mask { + position: absolute; + width: @colorpicker-clrchannel-hs-width; + height: @colorpicker-clrchannel-hs-height; + } + + .colorpicker-hs-selector { + position: absolute; + width: @colorpicker-selector-size; + height: @colorpicker-selector-size; + border: @colorpicker-selector-border-width solid black; + } + } + + .colorpicker-l-container { + position: relative; + float: left; + + width: @colorpicker-clrchannel-l-width; + height: @colorpicker-clrchannel-l-height; + padding-left: @colorpicker-clrchannel-l-hpadding; + padding-right: @colorpicker-clrchannel-l-hpadding; + padding-top: @colorpicker-clrchannel-hs-padding; + padding-bottom: @colorpicker-clrchannel-hs-padding; + + .colorpicker-l-mask { + position: absolute; + width: @colorpicker-clrchannel-l-width; + height: @colorpicker-clrchannel-l-height; + } + + .colorpicker-l-selector { + left: @colorpicker-clrchannel-l-selector-left; + position: absolute; + width: @colorpicker-selector-size; + height: @colorpicker-selector-size; + border: @colorpicker-selector-border-width solid black; + } + } +} diff --git a/src/widgets/colorpicker/proto-html/colorpicker.prototype.html b/src/widgets/colorpicker/proto-html/colorpicker.prototype.html new file mode 100644 index 0000000..df29dd5 --- /dev/null +++ b/src/widgets/colorpicker/proto-html/colorpicker.prototype.html @@ -0,0 +1,13 @@ +
          +
          +
          +
          +
          +
          +
          +
          +
          +
          +
          +
          +
          diff --git a/src/widgets/colorpickerbutton/css/colorpickerbutton.css b/src/widgets/colorpickerbutton/css/colorpickerbutton.css new file mode 100644 index 0000000..9f0bb26 --- /dev/null +++ b/src/widgets/colorpickerbutton/css/colorpickerbutton.css @@ -0,0 +1,9 @@ +/* Need to add !important below, because these classes are added before jqm enhancement */ +.ui-colorpickerbutton-input { + max-width: 70px; + display: inline-block !important; +} + +.ui-colorpickerbutton-input-hidden { + display: none !important; +} diff --git a/src/widgets/colorpickerbutton/js/jquery.mobile.tizen.colorpickerbutton.js b/src/widgets/colorpickerbutton/js/jquery.mobile.tizen.colorpickerbutton.js new file mode 100755 index 0000000..eddaeaf --- /dev/null +++ b/src/widgets/colorpickerbutton/js/jquery.mobile.tizen.colorpickerbutton.js @@ -0,0 +1,176 @@ +/* + * jQuery Mobile Widget @VERSION + * + * This software is licensed under the MIT licence ( as defined by the OSI at + * http://www.opensource.org/licenses/mit-license.php ) + * + * *************************************************************************** + * Copyright ( c ) 2000 - 2011 Samsung Electronics Co., Ltd. + * Copyright ( c ) 2011 by Intel Corporation Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files ( the "Software" ), + * to 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: Gabriel Schulhof + */ + +// Displays a button which, when pressed, opens a popupwindow +// containing hsvpicker. +// +// To apply, add the attribute data-role="colorpickerbutton" to a
          +// element inside a page. Alternatively, call colorpickerbutton() on an +// element. +// +// Options: +// +// color: String; color displayed on the button and the base color +// of the hsvpicker ( see hsvpicker ). +// initial color can be specified in html using the +// data-color="#ff00ff" attribute or when constructed in +// javascript, eg : +// $( "#mycolorpickerbutton" ).colorpickerbutton( { color: "#ff00ff" } ); +// where the html might be : +//
          +// The color can be changed post-construction like this : +// $( "#mycolorpickerbutton" ).colorpickerbutton( "option", "color", "#ABCDEF" ); +// Default: "#1a8039" +// +// buttonMarkup: String; markup to use for the close button on the popupwindow, eg : +// $( "#mycolorpickerbutton" ).colorpickerbutton( "option","buttonMarkup", +// "ignored" ); +// +// closeText: String; the text to display on the close button on the popupwindow. +// The text set in the buttonMarkup will be ignored and this used instead. +// +// Events: +// +// colorchanged: emitted when the color has been changed and the popupwindow is closed. + +( function ( $, undefined ) { + + $.widget( "tizen.colorpickerbutton", $.tizen.colorwidget, { + options: { + buttonMarkup: { + theme: null, + inline: true, + corners: true, + shadow: true + }, + hideInput: true, + closeText: "Close", + initSelector: ":jqmData(type='color'), :jqmData(role='colorpickerbutton')" + }, + + _htmlProto: { + ui: { + button: "#colorpickerbutton-button", + buttonContents: "#colorpickerbutton-button-contents", + popup: "#colorpickerbutton-popup-container", + hsvpicker: "#colorpickerbutton-popup-hsvpicker", + closeButton: "#colorpickerbutton-popup-close-button", + closeButtonText: "#colorpickerbutton-popup-close-button-text" + } + }, + + _create: function () { + var self = this; + + this.element + .css( "display", "none" ) + .after( this._ui.button ); + + /* Tear apart the proto */ + this._ui.popup.insertBefore( this.element ).popupwindow(); + this._ui.hsvpicker.hsvpicker(); + + $.tizen.popupwindow.bindPopupToButton( this._ui.button, this._ui.popup ); + + this._ui.closeButton.bind( "vclick", function ( event ) { + self._setColor( self._ui.hsvpicker.hsvpicker( "option", "color" ) ); + self.close(); + } ); + + this.element.bind( "change keyup blur", function () { + self._setColor( self.element.val() ); + } ); + }, + + _setHideInput: function ( value ) { + this.element[value ? "addClass" : "removeClass"]( "ui-colorpickerbutton-input-hidden" ); + this.element[value ? "removeClass" : "addClass"]( "ui-colorpickerbutton-input" ); + this.element.attr( "data-" + ( $.mobile.ns || "" ) + "hide-input", value ); + }, + + _setColor: function ( clr ) { + if ( $.tizen.colorwidget.prototype._setColor.call( this, clr ) ) { + var clrlib = $.tizen.colorwidget.clrlib; + + this._ui.hsvpicker.hsvpicker( "option", "color", this.options.color ); + $.tizen.colorwidget.prototype._setElementColor.call( this, this._ui.buttonContents, + clrlib.RGBToHSL( clrlib.HTMLToRGB( this.options.color ) ), "color" ); + } + }, + + _setButtonMarkup: function ( value ) { + this._ui.button.buttonMarkup( value ); + this.options.buttonMarkup = value; + value.inline = false; + this._ui.closeButton.buttonMarkup( value ); + }, + + _setCloseText: function ( value ) { + this._ui.closeButtonText.text( value ); + this.options.closeText = value; + this.element.attr( "data-" + ( $.mobile.ns || "" ) + "close-text", value ); + }, + + _setDisabled: function ( value ) { + $.tizen.widgetex.prototype._setDisabled.call( this, value ); + this._ui.popup.popupwindow( "option", "disabled", value ); + this._ui.button[value ? "addClass" : "removeClass"]( "ui-disabled" ); + $.tizen.colorwidget.prototype._displayDisabledState.call( this, this._ui.button ); + }, + + open: function () { + this._ui.popup.popupwindow( "open", + this._ui.button.offset().left + this._ui.button.outerWidth() / 2, + this._ui.button.offset().top + this._ui.button.outerHeight() / 2 ); + }, + + _focusButton : function () { + var self = this; + setTimeout( function () { + self._ui.button.focus(); + }, 40 ); + }, + + close: function () { + this._focusButton(); + this._ui.popup.popupwindow( "close" ); + } + } ); + +//auto self-init widgets + $( document ).bind( "pagecreate create", function ( e ) { + $( $.tizen.colorpickerbutton.prototype.options.initSelector, e.target ) + .not( ":jqmData(role='none'), :jqmData(role='nojs')" ) + .colorpickerbutton(); + } ); + +}( jQuery ) ); diff --git a/src/widgets/colorpickerbutton/proto-html/colorpickerbutton.prototype.html b/src/widgets/colorpickerbutton/proto-html/colorpickerbutton.prototype.html new file mode 100755 index 0000000..85d6ea6 --- /dev/null +++ b/src/widgets/colorpickerbutton/proto-html/colorpickerbutton.prototype.html @@ -0,0 +1,11 @@ + diff --git a/src/widgets/colortitle/js/jquery.mobile.tizen.colortitle.js b/src/widgets/colortitle/js/jquery.mobile.tizen.colortitle.js new file mode 100755 index 0000000..3536ea0 --- /dev/null +++ b/src/widgets/colortitle/js/jquery.mobile.tizen.colortitle.js @@ -0,0 +1,93 @@ +/* + * jQuery Mobile Widget @VERSION + * + * This software is licensed under the MIT licence (as defined by the OSI at + * http://www.opensource.org/licenses/mit-license.php) + * + * *************************************************************************** + * Copyright (C) 2011 by Intel Corporation Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * *************************************************************************** + * + * Authors: Gabriel Schulhof + */ + +// Displays the color in text of the form '#RRGGBB' where +// RR, GG, and BB are in hexadecimal. +// +// Apply a colortitle by adding the attribute data-role="colortitle" +// to a
          element inside a page. Alternatively, call colortitle() +// on an element (see below). +// +// Options: +// +// color: String; the initial color can be specified in html using +// the data-color="#ff00ff" attribute or when constructed +// in javascipt eg +// $("#mycolortitle").colortitle({ color: "#ff00ff" }); +// where the html might be : +//
          +// The color can be changed post-construction : +// $("#mycolortitle").colortitle("option", "color", "#ABCDEF"); +// Default: "#1a8039". + +(function ( $, undefined ) { + + $.widget( "tizen.colortitle", $.tizen.colorwidget, { + options: { + initSelector: ":jqmData(role='colortitle')" + }, + + _htmlProto: { + ui: { + clrtitle: "#colortitle", + header: "#colortitle-string" + } + }, + + _create: function () { + this.element + .css( "display", "none" ) + .after( this._ui.clrtitle ); + + }, + + widget: function () { return this._ui.clrtitle; }, + + _setDisabled: function ( value ) { + $.tizen.widgetex.prototype._setDisabled.call( this, value ); + this._ui.clrtitle[value ? "addClass" : "removeClass"]( "ui-disabled" ); + }, + + _setColor: function ( clr ) { + if ( $.tizen.colorwidget.prototype._setColor.call( this, clr ) ) { + this._ui.header.text( this.options.color ); + $( this._ui.header ).parent().css( "color", this.options.color ); + } + } + } ); + + $( document ).bind( "pagecreate create", function ( e ) { + $( $.tizen.colortitle.prototype.options.initSelector, e.target ) + .not( ":jqmData(role='none'), :jqmData(role='nojs')" ) + .colortitle(); + } ); + +}( jQuery ) ); \ No newline at end of file diff --git a/src/widgets/colortitle/less/colortitle.less b/src/widgets/colortitle/less/colortitle.less new file mode 100644 index 0000000..8963d16 --- /dev/null +++ b/src/widgets/colortitle/less/colortitle.less @@ -0,0 +1,17 @@ +@colortitle-vpadding: 15px; + +.ui-colortitle { + padding-top: @colortitle-vpadding; + padding-bottom: @colortitle-vpadding; + h1 { + display: table; + margin: auto; + color: #54a12d; + } +} + +.todons-colortitle-disabled { + h1 { + color: #888888; + } +} diff --git a/src/widgets/colortitle/proto-html/colortitle.prototype.html b/src/widgets/colortitle/proto-html/colortitle.prototype.html new file mode 100644 index 0000000..7c7291e --- /dev/null +++ b/src/widgets/colortitle/proto-html/colortitle.prototype.html @@ -0,0 +1,3 @@ +
          +

          +
          diff --git a/src/widgets/common/Makefile b/src/widgets/common/Makefile new file mode 100644 index 0000000..832d92d --- /dev/null +++ b/src/widgets/common/Makefile @@ -0,0 +1,58 @@ +OUTPUT = ../../compiled + +JS = jquery.mobile.toolkit.js +JS_THEME = theme.js +CSS_THEME = theme.css + +JSFILES = \ + js/jquery.easing.1.3.js \ + js/jquery.mobile.scrollview.js \ + js/tizen.core.js \ + js/jquery.tmpl.js \ + $(NULL) + +JS_THEME_FILES = \ + $(NULL) + +CSSFILES = \ + $(NULL) + +CSS_THEME_FILES = \ + css/jquery.mobile.scrollview.css \ + $(NULL) + +all: init js js_theme css css_theme + # Done. + +js: init + # Building the Javascript file... +# @@if test "x${JSFILES}x" != "xx"; then + cat ${JSFILES} >> ${OUTPUT}/${JS}; +# fi + +js_theme: init + # Building the Javascript theme file... + @@if test "x${JS_THEME_FILES}x" != "xx"; then \ + cat ${JS_THEME_FILES} >> ${OUTPUT}/${JS_THEME}; \ + fi + +css: init + # Building the CSS file... + @@if test "x${CSSFILES}x" != "xx"; then \ + cat ${CSSFILES} >> ${OUTPUT}/${CSS}; \ + fi + +css_theme: init + # Building the CSS theme file... + @@if test "x${CSS_THEME_FILES}x" != "xx"; then \ + cat ${CSS_THEME_FILES} >> ${OUTPUT}/${CSS_THEME}; \ + fi + +init: + # Initializing... + @@if ! test -d ${OUTPUT}; then \ + mkdir ${OUTPUT}; \ + fi + +clean: + @@true diff --git a/src/widgets/common/css/jquery.mobile.clrlib.css b/src/widgets/common/css/jquery.mobile.clrlib.css new file mode 100644 index 0000000..55242cd --- /dev/null +++ b/src/widgets/common/css/jquery.mobile.clrlib.css @@ -0,0 +1,51 @@ +.jquery-mobile-clrlib-hue-gradient { + background: rgb(255,0,0); /* Old browsers */ + background: -webkit-gradient(linear, left top, right top, + color-stop( 0% ,rgba(255, 0, 0,1)), + color-stop( 16.666666667%,rgba(255,255, 0,1)), + color-stop( 33.333333333%,rgba(0 ,255, 0,1)), + color-stop( 50% ,rgba(0 ,255,255,1)), + color-stop( 66.666666667%,rgba(0 , 0,255,1)), + color-stop( 83.333333333%,rgba(255, 0,255,1)), + color-stop(100% ,rgba(255, 0, 0,1))); /* Chrome,Safari4+ */ + background: -moz-linear-gradient(left, + rgba(255, 0, 0,1) 0%, + rgba(255,255, 0,1) 16.666666667%, + rgba( 0,255, 0,1) 33.333333333%, + rgba( 0,255,255,1) 50%, + rgba( 0, 0,255,1) 66.666666667%, + rgba(255, 0,255,1) 83.333333333%, + rgba(255, 0, 0,1) 100%); + background: -webkit-linear-gradient(left, + rgba(255, 0, 0,1) 0%, + rgba(255,255, 0,1) 16.666666667%, + rgba( 0,255, 0,1) 33.333333333%, + rgba( 0,255,255,1) 50%, + rgba( 0, 0,255,1) 66.666666667%, + rgba(255, 0,255,1) 83.333333333%, + rgba(255, 0, 0,1) 100%); + background: -o-linear-gradient(left, + rgba(255, 0, 0,1) 0%, + rgba(255,255, 0,1) 16.666666667%, + rgba( 0,255, 0,1) 33.333333333%, + rgba( 0,255,255,1) 50%, + rgba( 0, 0,255,1) 66.666666667%, + rgba(255, 0,255,1) 83.333333333%, + rgba(255, 0, 0,1) 100%); + background: -ms-linear-gradient(left, + rgba(255, 0, 0,1) 0%, + rgba(255,255, 0,1) 16.666666667%, + rgba( 0,255, 0,1) 33.333333333%, + rgba( 0,255,255,1) 50%, + rgba( 0, 0,255,1) 66.666666667%, + rgba(255, 0,255,1) 83.333333333%, + rgba(255, 0, 0,1) 100%); + background: linear-gradient(left, + rgba(255, 0, 0,1) 0%, + rgba(255,255, 0,1) 16.666666667%, + rgba( 0,255, 0,1) 33.333333333%, + rgba( 0,255,255,1) 50%, + rgba( 0, 0,255,1) 66.666666667%, + rgba(255, 0,255,1) 83.333333333%, + rgba(255, 0, 0,1) 100%); +} diff --git a/src/widgets/common/css/jquery.mobile.scrollview.css b/src/widgets/common/css/jquery.mobile.scrollview.css new file mode 100644 index 0000000..fd1cb24 --- /dev/null +++ b/src/widgets/common/css/jquery.mobile.scrollview.css @@ -0,0 +1,85 @@ +@charset "utf-8"; + +.ui-scrollview-clip { + position: relative; +} + +.ui-scrollview-view { +} + +.ui-scrolllistview .ui-li-divider { + z-index: 10; +} + +.ui-scrollbar { + position: absolute; + overflow: hidden; + + opacity: 0; + -webkit-transition: opacity 500ms; + -moz-transition: opacity 500ms; + transition: opacity 500ms; +} + +.ui-scrollbar-visible { + opacity: 1; +} + +.ui-scrollbar-y { + top: 2px; + right: 2px; + bottom: 8px; + width: 5px; +} + +.ui-scrollbar-x { + right: 8px; + bottom: 2px; + left: 2px; + height: 5px; +} + +.ui-scrollbar-track { + position: relative; + width: 100%; + height: 100%; +} + +.ui-scrollbar-thumb { + position: absolute; + top: 0; + left: 0; + background-color: rgba(0, 0, 0, 0.3); + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + border-radius: 2px; +} + +.ui-scrollbar-y .ui-scrollbar-thumb { + width: 5px; + height: 100%; +} + +.ui-scrollbar-x .ui-scrollbar-thumb { + width: 100%; + height: 5px; +} + +/* + * the values below are for the group index + */ + +/* + * padding here set to zero - otherwise the list scrolls underneith the top heading and can be seen above it + */ +.ui-content.ui-scrollview-clip { + padding: 0; +} + +/* + * this seems to effect how far the top divider is place wrt to the scrollview + * without this, it is placed too high, so it is clipped in half + */ +.ui-content.ui-scrollview-clip > .ui-listview.ui-scrollview-view { + margin: 0; +} diff --git a/src/widgets/common/js/ensurens.js b/src/widgets/common/js/ensurens.js new file mode 100644 index 0000000..08732d6 --- /dev/null +++ b/src/widgets/common/js/ensurens.js @@ -0,0 +1,40 @@ +/* + * + * This software is licensed under the MIT licence (as defined by the OSI at + * http://www.opensource.org/licenses/mit-license.php) + * + * *************************************************************************** + * Copyright (C) 2011 by Intel Corporation Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * *************************************************************************** + */ + +// Ensure that the given namespace is defined. If not, define it to be an empty object. +// This is kinda like the mkdir -p command. + +function ensureNS(ns) { + var nsAr = ns.split("."), + nsSoFar = ""; + + for (var Nix in nsAr) { + nsSoFar = nsSoFar + (Nix > 0 ? "." : "") + nsAr[Nix]; + eval (nsSoFar + " = " + nsSoFar + " || {};"); + } +} diff --git a/src/widgets/common/js/jquery.mobile.label.js b/src/widgets/common/js/jquery.mobile.label.js new file mode 100644 index 0000000..2199614 --- /dev/null +++ b/src/widgets/common/js/jquery.mobile.label.js @@ -0,0 +1,40 @@ +/* + * + * This software is licensed under the MIT licence (as defined by the OSI at + * http://www.opensource.org/licenses/mit-license.php) + * + * *************************************************************************** + * Copyright (C) 2011 by Intel Corporation Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * *************************************************************************** + */ + +// Add markup for labels + +(function($, undefined) { + +$(document).bind("pagecreate create", function(e) { + $(":jqmData(role='label')", e.target).not(":jqmData(role='none'), :jqmData(role='nojs')").each(function() { + $(this).addClass("jquery-mobile-ui-label") + .html($("", {"class": "jquery-mobile-ui-label-text"}).text($(this).text())); + }); +}); + +})(jQuery); diff --git a/src/widgets/common/js/jquery.mobile.panning-page.js b/src/widgets/common/js/jquery.mobile.panning-page.js new file mode 100644 index 0000000..336ee74 --- /dev/null +++ b/src/widgets/common/js/jquery.mobile.panning-page.js @@ -0,0 +1,46 @@ +/* + * Size pages to the window + * + * This software is licensed under the MIT licence (as defined by the OSI at + * http://www.opensource.org/licenses/mit-license.php) + * + * *************************************************************************** + * Copyright (C) 2011 by Intel Corporation Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * *************************************************************************** + */ + +// Size pages to the window + +(function($, undefined) { + +var _fit_page_to_window_selector = ":jqmData(role='page'):jqmData(fit-page-to-window='true'):visible"; + +$(document).bind("pageshow", function(e) { + if ($(e.target).is(_fit_page_to_window_selector)) + $.mobile.tizen.fillPageWithContentArea($(e.target)); +}); + +$(window).resize(function() { + if ($(_fit_page_to_window_selector)[0] !== undefined) + $.mobile.tizen.fillPageWithContentArea($(_fit_page_to_window_selector)); +}); + +})(jQuery); diff --git a/src/widgets/common/js/jquery.mobile.tizen.clrlib.js b/src/widgets/common/js/jquery.mobile.tizen.clrlib.js new file mode 100644 index 0000000..c243c3b --- /dev/null +++ b/src/widgets/common/js/jquery.mobile.tizen.clrlib.js @@ -0,0 +1,212 @@ +ensureNS("jQuery.mobile.tizen.clrlib"); + +jQuery.extend( jQuery.mobile.tizen.clrlib, +{ + nearestInt: function(val) { + var theFloor = Math.floor(val); + + return (((val - theFloor) > 0.5) ? (theFloor + 1) : theFloor); + }, + + /* + * Converts html color string to rgb array. + * + * Input: string clr_str, where + * clr_str is of the form "#aabbcc" + * + * Returns: [ r, g, b ], where + * r is in [0, 1] + * g is in [0, 1] + * b is in [0, 1] + */ + HTMLToRGB: function(clr_str) { + clr_str = (('#' == clr_str.charAt(0)) ? clr_str.substring(1) : clr_str); + + return ([ + clr_str.substring(0, 2), + clr_str.substring(2, 4), + clr_str.substring(4, 6) + ].map(function(val) { + return parseInt(val, 16) / 255.0; + })); + }, + + /* + * Converts rgb array to html color string. + * + * Input: [ r, g, b ], where + * r is in [0, 1] + * g is in [0, 1] + * b is in [0, 1] + * + * Returns: string of the form "#aabbcc" + */ + RGBToHTML: function(rgb) { + return ("#" + + rgb.map(function(val) { + var ret = val * 255, + theFloor = Math.floor(ret); + + ret = ((ret - theFloor > 0.5) ? (theFloor + 1) : theFloor); + ret = (((ret < 16) ? "0" : "") + (ret & 0xff).toString(16)); + return ret; + }) + .join("")); + }, + + /* + * Converts hsl to rgb. + * + * From http://130.113.54.154/~monger/hsl-rgb.html + * + * Input: [ h, s, l ], where + * h is in [0, 360] + * s is in [0, 1] + * l is in [0, 1] + * + * Returns: [ r, g, b ], where + * r is in [0, 1] + * g is in [0, 1] + * b is in [0, 1] + */ + HSLToRGB: function(hsl) { + var h = hsl[0] / 360.0, s = hsl[1], l = hsl[2]; + + if (0 === s) + return [ l, l, l ]; + + var temp2 = ((l < 0.5) + ? l * (1.0 + s) + : l + s - l * s), + temp1 = 2.0 * l - temp2, + temp3 = { + r: h + 1.0 / 3.0, + g: h, + b: h - 1.0 / 3.0 + }; + + temp3.r = ((temp3.r < 0) ? (temp3.r + 1.0) : ((temp3.r > 1) ? (temp3.r - 1.0) : temp3.r)); + temp3.g = ((temp3.g < 0) ? (temp3.g + 1.0) : ((temp3.g > 1) ? (temp3.g - 1.0) : temp3.g)); + temp3.b = ((temp3.b < 0) ? (temp3.b + 1.0) : ((temp3.b > 1) ? (temp3.b - 1.0) : temp3.b)); + + ret = [ + (((6.0 * temp3.r) < 1) ? (temp1 + (temp2 - temp1) * 6.0 * temp3.r) : + (((2.0 * temp3.r) < 1) ? temp2 : + (((3.0 * temp3.r) < 2) ? (temp1 + (temp2 - temp1) * ((2.0 / 3.0) - temp3.r) * 6.0) : + temp1))), + (((6.0 * temp3.g) < 1) ? (temp1 + (temp2 - temp1) * 6.0 * temp3.g) : + (((2.0 * temp3.g) < 1) ? temp2 : + (((3.0 * temp3.g) < 2) ? (temp1 + (temp2 - temp1) * ((2.0 / 3.0) - temp3.g) * 6.0) : + temp1))), + (((6.0 * temp3.b) < 1) ? (temp1 + (temp2 - temp1) * 6.0 * temp3.b) : + (((2.0 * temp3.b) < 1) ? temp2 : + (((3.0 * temp3.b) < 2) ? (temp1 + (temp2 - temp1) * ((2.0 / 3.0) - temp3.b) * 6.0) : + temp1)))]; + + return ret; + }, + + /* + * Converts hsv to rgb. + * + * Input: [ h, s, v ], where + * h is in [0, 360] + * s is in [0, 1] + * v is in [0, 1] + * + * Returns: [ r, g, b ], where + * r is in [0, 1] + * g is in [0, 1] + * b is in [0, 1] + */ + HSVToRGB: function(hsv) { + return $.mobile.tizen.clrlib.HSLToRGB($.mobile.tizen.clrlib.HSVToHSL(hsv)); + }, + + /* + * Converts rgb to hsv. + * + * from http://coecsl.ece.illinois.edu/ge423/spring05/group8/FinalProject/HSV_writeup.pdf + * + * Input: [ r, g, b ], where + * r is in [0, 1] + * g is in [0, 1] + * b is in [0, 1] + * + * Returns: [ h, s, v ], where + * h is in [0, 360] + * s is in [0, 1] + * v is in [0, 1] + */ + RGBToHSV: function(rgb) { + var min, max, delta, h, s, v, r = rgb[0], g = rgb[1], b = rgb[2]; + + min = Math.min(r, Math.min(g, b)); + max = Math.max(r, Math.max(g, b)); + delta = max - min; + + h = 0; + s = 0; + v = max; + + if (delta > 0.00001) { + s = delta / max; + + if (r === max) + h = (g - b) / delta ; + else + if (g === max) + h = 2 + (b - r) / delta ; + else + h = 4 + (r - g) / delta ; + + h *= 60 ; + + if (h < 0) + h += 360 ; + } + + return [h, s, v]; + }, + + /* + * Converts hsv to hsl. + * + * Input: [ h, s, v ], where + * h is in [0, 360] + * s is in [0, 1] + * v is in [0, 1] + * + * Returns: [ h, s, l ], where + * h is in [0, 360] + * s is in [0, 1] + * l is in [0, 1] + */ + HSVToHSL: function(hsv) { + var max = hsv[2], + delta = hsv[1] * max, + min = max - delta, + sum = max + min, + half_sum = sum / 2, + s_divisor = ((half_sum < 0.5) ? sum : (2 - max - min)); + + return [ hsv[0], ((0 == s_divisor) ? 0 : (delta / s_divisor)), half_sum ]; + }, + + /* + * Converts rgb to hsl + * + * Input: [ r, g, b ], where + * r is in [0, 1] + * g is in [0, 1] + * b is in [0, 1] + * + * Returns: [ h, s, l ], where + * h is in [0, 360] + * s is in [0, 1] + * l is in [0, 1] + */ + RGBToHSL: function(rgb) { + return $.mobile.tizen.clrlib.HSVToHSL($.mobile.tizen.clrlib.RGBToHSV(rgb)); + } +}); diff --git a/src/widgets/common/js/jquery.mobile.tizen.core.js b/src/widgets/common/js/jquery.mobile.tizen.core.js new file mode 100644 index 0000000..c23f701 --- /dev/null +++ b/src/widgets/common/js/jquery.mobile.tizen.core.js @@ -0,0 +1,306 @@ +/* + * jQuery Mobile Widget @VERSION + * + * TODO: remove unnecessary codes.... + * + * This software is licensed under the MIT licence (as defined by the OSI at + * http://www.opensource.org/licenses/mit-license.php) + * + * *************************************************************************** + * Copyright (C) 2011 by Intel Corporation Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * *************************************************************************** + * + * Authors: Kalyan Kondapally + */ + +ensureNS("jQuery.mobile.tizen"); + +(function () { +jQuery.extend(jQuery.mobile.tizen, { + Point: function (x, y) { + var X = isNaN(x) ? 0 : x; + var Y = isNaN(y) ? 0 : y; + + this.add = function (Point) { + this.setX(X + Point.x()); + this.setY(Y + Point.y()); + return this; + } + + this.subtract = function (Point) { + this.setX(X - Point.x()); + this.setY(Y - Point.y()); + return this; + } + + this.multiply = function (Point) { + this.setX(Math.round(X * Point.x())); + this.setY(Math.round(Y * Point.y())); + return this; + } + + this.divide = function (Point) { + this.setX(Math.round(X / Point.x())); + this.setY(Math.round(Y / Point.y())); + return this; + } + + this.isNull = function () { + return (X === 0 && Y === 0); + } + + this.x = function () { + return X; + } + + this.setX = function (val) { + isNaN(val) ? X = 0 : X = val; + } + + this.y = function () { + return Y; + } + + this.setY = function (val) { + isNaN(val) ? Y = 0 : Y = val; + } + + this.setNewPoint = function (point) { + this.setX(point.x()); + this.setY(point.y()); + } + + this.isEqualTo = function (point) { + return (X === point.x() && Y === point.y()); + } + }, + + Rect: function (left,top,width,height) { + var Left = left; + var Top = top; + var Right = Left+width; + var Bottom = Top+height; + + this.setRect = function(varL,varR,varT,varB) { + this.setLeft(varL); + this.setRight(varR); + this.setTop(varT); + this.setBottom(varB); + } + + this.right = function () { + return Right; + } + + this.setRight = function (val) { + Right = val; + } + + this.top = function () { + return Top; + } + + this.setTop = function (val) { + Top = val; + } + + this.bottom = function () { + return Bottom; + } + + this.setBottom = function (val) { + Bottom = val; + } + + this.left = function () { + return Left; + } + + this.setLeft = function (val) { + Left = val; + } + + this.moveTop = function(valY) { + var h = this.height(); + Top = valY; + Bottom = Top + h; + } + + this.isNull = function () { + return Right === Left && Bottom === Top; + } + + this.isValid = function () { + return Left <= Right && Top <= Bottom; + } + + this.isEmpty = function () { + return Left > Right || Top > Bottom; + } + + this.contains = function (valX,valY) { + if (this.containsX(valX) && this.containsY(valY)) + return true; + return false; + } + + this.width = function () { + return Right - Left; + } + + this.height = function () { + return Bottom - Top; + } + + this.containsX = function(val) { + var l = Left, + r = Right; + if (Right val || r < val) + return false; + return true; + } + + this.containsY = function(val) { + var t = Top, + b = Bottom; + if (Bottom val || b < val) + return false; + return true; + } + }, + + disableSelection: function (element) { + var self = this; + return self.enableSelection( element, 'none' ); + }, + + enableSelection: function (element, value) { + return $(element).each( function () { + switch( value ) { + case 'text' : + case 'auto' : + case 'none' : + val = value; + break; + + default : + val = 'auto'; + break; + } + $(this).css( { + 'user-select': val, + '-moz-user-select': val, + '-webkit-user-select': val, + '-o-user-select': val, + '-ms-transform': val + } ); + } ); + }, + + disableContextMenu: function(element) { + $(element).each( function() { + $(this).bind("contextmenu", function( event ) { + return false; + } ); + } ); + }, + + enableContextMenu: function(element) { + $(element).each( function() { + $(this).unbind( "contextmenu" ); + } ); + }, + + // Set the height of the content area to fill the space between a + // page's header and footer + fillPageWithContentArea: function (page) { + var $page = $(page); + var $content = $page.children(".ui-content:first"); + var hh = $page.children(".ui-header").outerHeight(); hh = hh ? hh : 0; + var fh = $page.children(".ui-footer").outerHeight(); fh = fh ? fh : 0; + var pt = parseFloat($content.css("padding-top")); + var pb = parseFloat($content.css("padding-bottom")); + var wh = window.innerHeight; + var height = wh - (hh + fh) - (pt + pb); + $content.height(height); + }, + + // Get document-relative mouse coordinates from a given event + // From: http://www.quirksmode.org/js/events_properties.html#position + documentRelativeCoordsFromEvent: function(ev) { + var e = ev ? ev : window.event, + client = { x: e.clientX, y: e.clientY }, + page = { x: e.pageX, y: e.pageY }, + posx = 0, + posy = 0; + + // Grab useful coordinates from touch events + if (e.type.match(/^touch/)) { + page = { + x: e.originalEvent.targetTouches[0].pageX, + y: e.originalEvent.targetTouches[0].pageY + }; + client = { + x: e.originalEvent.targetTouches[0].clientX, + y: e.originalEvent.targetTouches[0].clientY + }; + } + + if (page.x || page.y) { + posx = page.x; + posy = page.y; + } + else + if (client.x || client.y) { + posx = client.x + document.body.scrollLeft + document.documentElement.scrollLeft; + posy = client.y + document.body.scrollTop + document.documentElement.scrollTop; + } + + return { x: posx, y: posy }; + }, + + // TODO : offsetX, offsetY. touch events don't have offsetX and offsetY. support for touch devices. + // check algorithm... + targetRelativeCoordsFromEvent: function(e) { + var coords = { x: e.offsetX, y: e.offsetY }; + + if (coords.x === undefined || isNaN(coords.x) || + coords.y === undefined || isNaN(coords.y)) { + var offset = $(e.target).offset(); + //coords = documentRelativeCoordsFromEvent(e); // Old code. Must be checked again. + coords = $.mobile.tizen.documentRelativeCoordsFromEvent(e); + coords.x -= offset.left; + coords.y -= offset.top; + } + + return coords; + } +}); + +})(); diff --git a/src/widgets/common/js/jquery.mobile.tizen.jlayoutadaptor.js b/src/widgets/common/js/jquery.mobile.tizen.jlayoutadaptor.js new file mode 100644 index 0000000..4ca6cf1 --- /dev/null +++ b/src/widgets/common/js/jquery.mobile.tizen.jlayoutadaptor.js @@ -0,0 +1,124 @@ +/* + * + * This software is licensed under the MIT licence (as defined by the OSI at + * http://www.opensource.org/licenses/mit-license.php) + * + * *************************************************************************** + * Copyright (C) 2011 by Intel Corporation Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * *************************************************************************** + */ + +// Wrapper round the jLayout functions to enable it to be used +// for creating jQuery Mobile layout extensions. +// +// See the layouthbox and layoutvbox widgets for usage examples. +(function ($, undefined) { + +$.widget("tizen.jlayoutadaptor", $.mobile.widget, { + options: { + hgap: null, + vgap: null, + scrollable: true, + showScrollBars: true, + direction: null + }, + + _create: function () { + var self = this, + options = this.element.data('layout-options'), + page = $(this.element).closest(':jqmData(role="page")'); + + $.extend(this.options, options); + + if (page && !page.is(':visible')) { + this.element.hide(); + + page.bind('pageshow', function () { + self.refresh(); + }); + } + else { + this.refresh(); + } + }, + + refresh: function () { + var container; + var config = $.extend(this.options, this.fixed); + + if (config.scrollable) { + if (!(this.element.children().is('.ui-scrollview-view'))) { + // create the scrollview + this.element.scrollview({direction: config.direction, + showScrollBars: config.showScrollBars}); + } + else if (config.showScrollBars) { + this.element.find('.ui-scrollbar').show(); + } + else { + this.element.find('.ui-scrollbar').hide(); + } + + container = this.element.find('.ui-scrollview-view'); + } + else { + container = this.element; + } + + container.layout(config); + + this.element.show(); + + if (config.scrollable) { + // get the right/bottom edge of the last child after layout + var lastItem = container.children().last(); + + var edge; + + var scrollview = this.element.find('.ui-scrollview-view'); + + if (config.direction === 'x') { + edge = lastItem.position().left + + lastItem.outerWidth(true); + + // set the scrollview's view width to the original width + scrollview.width(edge); + + // set the parent container's height to the height of + // the scrollview + this.element.height(scrollview.height()); + } + else if (config.direction === 'y') { + edge = lastItem.position().top + + lastItem.outerHeight(true); + + // set the scrollview's view height to the original height + scrollview.height(edge); + + // set the parent container's width to the width of the + // scrollview + this.element.width(scrollview.width()); + } + } + } +}); + +})(jQuery); diff --git a/src/widgets/common/js/jquery.mobile.tizen.loadprototype.js b/src/widgets/common/js/jquery.mobile.tizen.loadprototype.js new file mode 100644 index 0000000..e265bd8 --- /dev/null +++ b/src/widgets/common/js/jquery.mobile.tizen.loadprototype.js @@ -0,0 +1,140 @@ +(function($, undefined) { + +ensureNS("jQuery.mobile.tizen"); + +jQuery.extend( jQuery.mobile.tizen, +{ + _widgetPrototypes: {}, + + /* + * load the prototype for a widget. + * + * If @widget is a string, the function looks for @widget.prototype.html in the proto-html/ subdirectory of the + * framework's current theme and loads the file via AJAX into a string. Note that the file will only be loaded via + * AJAX once. If two widget instances based on the same @widget value are to be constructed, the second will be + * constructed from the cached copy of the prototype of the first instance. + * + * If @widget is not a string, it is assumed to be a hash containing at least one key, "proto", the value of which is + * the string to be used for the widget prototype. if another key named "key" is also provided, it will serve as the + * key under which to cache the prototype, so it need not be rendered again in the future. + * + * Given the string for the widget prototype, the following patterns occurring in the string are replaced: + * + * "${FRAMEWORK_ROOT}" - replaced with the path to the root of the framework + * + * The function then creates a jQuery $("
          ") object containing the prototype from the string. + * + * If @ui is not provided, the jQuery object containing the prototype is returned. + * + * If @ui is provided, it is assumed to be a (possibly multi-level) hash containing CSS selectors. For every level of + * the hash and for each string-valued key at that level, the CSS selector specified as the value is sought in the + * prototype jQuery object and, if found, the value of the key is replaced with the jQuery object resulting from the + * search. Additionally, if the CSS selector is of the form "#widgetid", the "id" attribute will be removed from the + * elements contained within the resulting jQuery object. The resulting hash is returned. + * + * Examples: + * + * 1. + * $.mobile.tizen.loadPrototype("mywidget") => Returns a
          containing the structure from the file + * mywidget.prototype.html located in the current theme folder of the current framework. + * + * 2. $.mobile.tizen.loadPrototype("mywidget", ui): + * where ui is a hash that looks like this: + * ui = { + * element1: "", + * element2: "", + * group1: { + * group1element1: "", + * group1element1: "" + * } + * ... + * } + * + * In this case, after loading the prototype as in Example 1, loadPrototype will traverse @ui and replace the CSS + * selector strings with the result of the search for the selector string upon the prototype. If any of the CSS + * selectors are of the form "#elementid" then the "id" attribute will be stripped from the elements selected. This + * means that they will no longer be accessible via the selector used initially. @ui is then returned thus modified. + */ + + loadPrototype: function(widget, ui) { + var ret = undefined, + theScriptTag = $("script[data-framework-version][data-framework-root][data-framework-theme]"), + frameworkRootPath = theScriptTag.attr("data-framework-root") + "/" + + theScriptTag.attr("data-framework-version") + "/"; + + function replaceVariables(s) { + return s.replace(/\$\{FRAMEWORK_ROOT\}/g, frameworkRootPath); + } + + function fillObj(obj, uiProto) { + var selector; + + for (var key in obj) { + if (typeof obj[key] === "string") { + selector = obj[key]; + obj[key] = uiProto.find(obj[key]); + if (selector.substring(0, 1) === "#") + obj[key].removeAttr("id"); + } + else + if (typeof obj[key] === "object") + obj[key] = fillObj(obj[key], uiProto); + } + return obj; + } + + /* If @widget is a string ... */ + if (typeof widget === "string") { + /* ... try to use it as a key into the cached prototype hash ... */ + ret = $.mobile.tizen._widgetPrototypes[widget]; + if (ret === undefined) { + /* ... and if the proto was not found, try to load its definition ... */ + var protoPath = frameworkRootPath + "proto-html" + "/" + + theScriptTag.attr("data-framework-theme"); + $.ajax({ + url: protoPath + "/" + widget + ".prototype.html", + async: false, + dataType: "html" + }) + .success(function(data, textStatus, jqXHR) { + /* ... and if loading succeeds, cache it and use a copy of it ... */ + $.mobile.tizen._widgetPrototypes[widget] = $("
          ").html(replaceVariables(data)); + ret = $.mobile.tizen._widgetPrototypes[widget].clone(); + }); + } + } + /* Otherwise ... */ + else { + /* ... if a key was provided ... */ + if (widget.key !== undefined) + /* ... try to use it as a key into the cached prototype hash ... */ + ret = $.mobile.tizen._widgetPrototypes[widget.key]; + + /* ... and if the proto was not found in the cache ... */ + if (ret === undefined) { + /* ... and a proto definition string was provided ... */ + if (widget.proto !== undefined) { + /* ... create a new proto from the definition ... */ + ret = $("
          ").html(replaceVariables(widget.proto)); + /* ... and if a key was provided ... */ + if (widget.key !== undefined) + /* ... cache a copy of the proto under that key */ + $.mobile.tizen._widgetPrototypes[widget.key] = ret.clone(); + } + } + else + /* otherwise, if the proto /was/ found in the cache, return a copy of it */ + ret = ret.clone(); + } + + /* If the prototype was found/created successfully ... */ + if (ret != undefined) + /* ... and @ui was provided */ + if (ui != undefined) + /* ... return @ui, but replace the CSS selectors it contains with the elements they select */ + ret = fillObj(ui, ret); + + return ret; + } +}); +})(jQuery); diff --git a/src/widgets/common/js/jquery.mobile.tizen.scrollview.js b/src/widgets/common/js/jquery.mobile.tizen.scrollview.js new file mode 100644 index 0000000..08ff149 --- /dev/null +++ b/src/widgets/common/js/jquery.mobile.tizen.scrollview.js @@ -0,0 +1,1090 @@ +/* +* jQuery Mobile Framework : scrollview plugin +* Copyright (c) 2010 Adobe Systems Incorporated - Kin Blas (jblas@adobe.com) +* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. +* Note: Code is in draft form and is subject to change +* Modified by Koeun Choi +* Modified by Minkyu Kang +*/ + +(function ( $, window, document, undefined ) { + + function resizePageContentHeight( page ) { + var $page = $( page ), + $content = $page.children(".ui-content"), + hh = $page.children(".ui-header").outerHeight() || 0, + fh = $page.children(".ui-footer").outerHeight() || 0, + pt = parseFloat( $content.css("padding-top") ), + pb = parseFloat( $content.css("padding-bottom") ), + wh = $( window ).height(); + + $content.height( wh - (hh + fh) - (pt + pb) ); + } + + function MomentumTracker( options ) { + this.options = $.extend( {}, options ); + this.easing = "easeOutQuad"; + this.reset(); + } + + var tstates = { + scrolling: 0, + overshot: 1, + snapback: 2, + done: 3 + }; + + function getCurrentTime() { + return Date.now(); + } + + jQuery.widget( "tizen.scrollview", jQuery.mobile.widget, { + options: { + fps: 60, // Frames per second in msecs. + direction: null, // "x", "y", or null for both. + + scrollDuration: 2000, // Duration of the scrolling animation in msecs. + overshootDuration: 250, // Duration of the overshoot animation in msecs. + snapbackDuration: 500, // Duration of the snapback animation in msecs. + + moveThreshold: 30, // User must move this many pixels in any direction to trigger a scroll. + moveIntervalThreshold: 150, // Time between mousemoves must not exceed this threshold. + + scrollMethod: "translate", // "translate", "position" + startEventName: "scrollstart", + updateEventName: "scrollupdate", + stopEventName: "scrollstop", + + eventType: $.support.touch ? "touch" : "mouse", + + showScrollBars: true, + overshootEnable: false, + scrollJump: false, + }, + + _makePositioned: function ( $ele ) { + if ( $ele.css("position") === "static" ) { + $ele.css( "position", "relative" ); + } + }, + + _create: function () { + var $page = $('.ui-page'), + direction, + self = this; + + this._$clip = $( this.element ).addClass("ui-scrollview-clip"); + this._$view = this._$clip.wrapInner("
          ").children() + .addClass("ui-scrollview-view"); + + if ( this.options.scrollMethod === "translate" ) { + if ( this._$view.css("transform") === undefined ) { + this.options.scrollMethod = "position"; + } + } + + this._$clip.css( "overflow", "hidden" ); + this._makePositioned( this._$clip ); + + this._makePositioned( this._$view ); + this._$view.css( { left: 0, top: 0 } ); + this._view_height = this._$view.height(); + + this._sx = 0; + this._sy = 0; + + direction = this.options.direction; + + this._hTracker = ( direction !== "y" ) ? + new MomentumTracker( this.options ) : null; + this._vTracker = ( direction !== "x" ) ? + new MomentumTracker( this.options ) : null; + + this._timerInterval = 1000 / this.options.fps; + this._timerID = 0; + + this._timerCB = function () { + self._handleMomentumScroll(); + }; + + this._add_event(); + this._add_scrollbar(); + this._add_scroll_jump(); + }, + + _startMScroll: function ( speedX, speedY ) { + var keepGoing = false, + duration = this.options.scrollDuration, + ht = this._hTracker, + vt = this._vTracker, + c, + v; + + this._stopMScroll(); + this._showScrollBars(); + + this._$clip.trigger( this.options.startEventName ); + + if ( ht ) { + c = this._$clip.width(); + v = this._$view.width(); + + ht.start( this._sx, speedX, + duration, (v > c) ? -(v - c) : 0, 0 ); + keepGoing = !ht.done(); + } + + if ( vt ) { + c = this._$clip.height(); + v = this._$view.height() + + parseFloat( this._$view.css("padding-top") ); + + vt.start( this._sy, speedY, + duration, (v > c) ? -(v - c) : 0, 0 ); + keepGoing = keepGoing || !vt.done(); + } + + if ( keepGoing ) { + this._timerID = setTimeout( this._timerCB, this._timerInterval ); + } else { + this._stopMScroll(); + } + }, + + _stopMScroll: function () { + if ( this._timerID ) { + this._$clip.trigger( this.options.stopEventName ); + clearTimeout( this._timerID ); + } + this._timerID = 0; + + if ( this._vTracker ) { + this._vTracker.reset(); + } + + if ( this._hTracker ) { + this._hTracker.reset(); + } + + this._hideScrollBars(); + }, + + _handleMomentumScroll: function () { + var keepGoing = false, + x = 0, + y = 0, + vt = this._vTracker, + ht = this._hTracker; + + if ( this._outerScrolling ) { + return; + } + + if ( vt ) { + vt.update( this.options.overshootEnable ); + y = vt.getPosition(); + keepGoing = !vt.done(); + } + + if ( ht ) { + ht.update( this.options.overshootEnable ); + x = ht.getPosition(); + keepGoing = keepGoing || !ht.done(); + } + + this._setScrollPosition( x, y ); + this._$clip.trigger( this.options.updateEventName, + [ { x: x, y: y } ] ); + + if ( keepGoing ) { + this._timerID = setTimeout( this._timerCB, this._timerInterval ); + } else { + this._stopMScroll(); + } + }, + + _setElementTransform: function ( $ele, x, y, duration ) { + var translate, + transition; + + if ( !duration || duration === undefined ) { + transition = "none"; + } else { + transition = "-webkit-transform " + duration / 1000 + "s"; + } + + if ( $.support.cssTransform3d ) { + translate = "translate3d(" + x + "," + y + ", 0px)"; + } else { + translate = "translate(" + x + "," + y + ")"; + } + + $ele.css({ + "-moz-transform": translate, + "-webkit-transform": translate, + "-ms-transform": translate, + "-o-transform": translate, + "transform": translate, + "-webkit-transition": transition + }); + }, + + _setCalibration: function ( x, y ) { + if ( this.options.overshootEnable ) { + this._sx = x; + this._sy = y; + return; + } + + var $v = this._$view, + $c = this._$clip, + dirLock = this._directionLock, + scroll_height = 0, + scroll_width = 0; + + if ( dirLock !== "y" && this._hTracker ) { + scroll_width = $v.width() - $c.width(); + + if ( x >= 0 ) { + this._sx = 0; + } else if ( x < -scroll_width ) { + this._sx = -scroll_width; + } else { + this._sx = x; + } + + if ( scroll_width < 0 ) { + this._sx = 0; + } + } + + if ( dirLock !== "x" && this._vTracker ) { + scroll_height = $v.height() - $c.height() + + parseFloat( $c.css("padding-top") ) + + parseFloat( $c.css("padding-bottom") ); + + this._outerScroll( y, scroll_height ); + + if ( y >= 0 ) { + this._sy = 0; + } else if ( y < -scroll_height ) { + this._sy = -scroll_height; + } else { + this._sy = y; + } + + if ( scroll_height < 0 ) { + this._sy = 0; + } + } + }, + + _setScrollPosition: function ( x, y, duration ) { + var $v = this._$view, + sm = this.options.scrollMethod, + $vsb = this._$vScrollBar, + $hsb = this._$hScrollBar, + $sbt; + + this._setCalibration( x, y ); + + if ( this._outerScrolling ) { + return; + } + + x = this._sx; + y = this._sy; + + if ( sm === "translate" ) { + this._setElementTransform( $v, x + "px", y + "px", duration ); + } else { + $v.css( {left: x + "px", top: y + "px"} ); + } + + if ( $vsb ) { + $sbt = $vsb.find(".ui-scrollbar-thumb"); + + if ( sm === "translate" ) { + this._setElementTransform( $sbt, "0px", + -y / $v.height() * $sbt.parent().height() + "px", + duration ); + } else { + $sbt.css( "top", -y / $v.height() * 100 + "%" ); + } + } + + if ( $hsb ) { + $sbt = $hsb.find(".ui-scrollbar-thumb"); + + if ( sm === "translate" ) { + this._setElementTransform( $sbt, + -x / $v.width() * $sbt.parent().width() + "px", "0px", + duration); + } else { + $sbt.css("left", -x / $v.width() * 100 + "%"); + } + } + }, + + _outerScroll: function ( y, scroll_height ) { + var self = this, + top = $( window ).scrollTop(), + sy = 0, + duration = this.options.snapbackDuration, + start = getCurrentTime(), + tfunc; + + if ( this._$clip.jqmData("scroll") !== "y" ) { + return; + } + + if ( this._outerScrolling ) { + return; + } + + if ( !this._dragging ) { + return; + } + + if ( scroll_height < 0 ) { + return; + } + + if ( y > 0 ) { + sy = -y; + } else if ( y < -scroll_height ) { + sy = -y - scroll_height; + } else { + return; + } + + sy *= 10; + + tfunc = function () { + var elapsed = getCurrentTime() - start; + + if ( elapsed >= duration ) { + window.scrollTo( 0, top + sy ); + self._outerScrolling = undefined; + } else { + ec = $.easing.easeOutQuad( elapsed / duration, elapsed, 0, 1, duration ); + + window.scrollTo( 0, top + ( sy * ec ) ); + self._outerScrolling = setTimeout( tfunc, self._timerInterval ); + } + }; + this._outerScrolling = setTimeout( tfunc, self._timerInterval ); + + /* skip the srollview dragging */ + this._skip_dragging = true; + }, + + _scrollTo: function ( x, y, duration ) { + var self = this, + start = getCurrentTime(), + efunc = $.easing.easeOutQuad, + sx = this._sx, + sy = this._sy, + dx = x - sx, + dy = y - sy, + tfunc; + + x = -x; + y = -y; + + tfunc = function () { + var elapsed = getCurrentTime() - start, + ec; + + if ( elapsed >= duration ) { + self._timerID = 0; + self._setScrollPosition( x, y ); + } else { + ec = efunc( elapsed / duration, elapsed, 0, 1, duration ); + + self._setScrollPosition( sx + ( dx * ec ), sy + ( dy * ec ) ); + self._timerID = setTimeout( tfunc, self._timerInterval ); + } + }; + + this._timerID = setTimeout( tfunc, this._timerInterval ); + }, + + scrollTo: function ( x, y, duration ) { + this._stopMScroll(); + + if ( !duration || this.options.scrollMethod === "translate" ) { + this._setScrollPosition( x, y, duration ); + } else { + this._scrollTo( x, y, duration ); + } + }, + + getScrollPosition: function () { + return { x: -this._sx, y: -this._sy }; + }, + + _getScrollHierarchy: function () { + var svh = [], + d; + + this._$clip.parents( ".ui-scrollview-clip").each( function () { + d = $( this ).jqmData("scrollview"); + if ( d ) { + svh.unshift( d ); + } + } ); + return svh; + }, + + _getAncestorByDirection: function ( dir ) { + var svh = this._getScrollHierarchy(), + n = svh.length, + sv, + svdir; + + while ( 0 < n-- ) { + sv = svh[n]; + svdir = sv.options.direction; + + if (!svdir || svdir === dir) { + return sv; + } + } + return null; + }, + + _handleDragStart: function ( e, ex, ey ) { + this._stopMScroll(); + + this._didDrag = false; + this._skip_dragging = false; + + var target = $( e.target ), + self = this, + $c = this._$clip, + svdir = this.options.direction; + + /* should prevent the default behavior when click the button */ + this._is_button = target.is( '.ui-btn-text' ) || + target.is( '.ui-btn-inner' ) || + target.is( '.ui-btn-inner .ui-icon' ); + + if ( this._is_button ) { + if ( target.parents('.ui-slider-handle') ) { + this._skip_dragging = true; + return; + } + } + + /* + * We need to prevent the default behavior to + * suppress accidental selection of text, etc. + */ + this._is_inputbox = target.is(':input') || + target.parents(':input').length > 0; + + if ( this._is_inputbox ) { + target.one( "resize.scrollview", function () { + if ( ey > $c.height() ) { + self.scrollTo( -ex, self._sy - ey + $c.height(), + self.options.snapbackDuration ); + } + }); + } + + this._lastX = ex; + this._lastY = ey; + this._startY = ey; + this._doSnapBackX = false; + this._doSnapBackY = false; + this._speedX = 0; + this._speedY = 0; + this._directionLock = ""; + + this._lastMove = 0; + this._enableTracking(); + + this._set_scrollbar_size(); + }, + + _propagateDragMove: function ( sv, e, ex, ey, dir ) { + this._hideScrollBars(); + this._disableTracking(); + sv._handleDragStart( e, ex, ey ); + sv._directionLock = dir; + sv._didDrag = this._didDrag; + }, + + _handleDragMove: function ( e, ex, ey ) { + if ( this._skip_dragging ) { + return; + } + + if ( !this._dragging ) { + return; + } + + if ( !this._is_inputbox && !this._is_button ) { + e.preventDefault(); + } + + var mt = this.options.moveThreshold, + dx = ex - this._lastX, + dy = ey - this._lastY, + svdir = this.options.direction, + dir = null, + x, + y, + sv, + scope, + newX, + newY, + dirLock; + + if ( Math.abs( this._startY - ey ) < mt && !this._didDrag ) { + return; + } + + this._lastMove = getCurrentTime(); + + if ( !this._directionLock ) { + x = Math.abs( dx ); + y = Math.abs( dy ); + + if ( x < mt && y < mt ) { + return false; + } + + if ( x < y && (x / y) < 0.5 ) { + dir = "y"; + } else if ( x > y && (y / x) < 0.5 ) { + dir = "x"; + } + + if ( svdir && dir && svdir !== dir ) { + /* + * This scrollview can't handle the direction the user + * is attempting to scroll. Find an ancestor scrollview + * that can handle the request. + */ + + sv = this._getAncestorByDirection( dir ); + if ( sv ) { + this._propagateDragMove( sv, e, ex, ey, dir ); + return false; + } + } + + this._directionLock = svdir || (dir || "none"); + } + + newX = this._sx; + newY = this._sy; + dirLock = this._directionLock; + + if ( dirLock !== "y" && this._hTracker ) { + x = this._sx; + this._speedX = dx; + newX = x + dx; + + this._doSnapBackX = false; + + scope = ( newX > 0 || newX < this._maxX ); + + if ( scope && dirLock === "x" ) { + sv = this._getAncestorByDirection("x"); + if ( sv ) { + this._setScrollPosition( newX > 0 ? + 0 : this._maxX, newY ); + this._propagateDragMove( sv, e, ex, ey, dir ); + return false; + } + + newX = x + ( dx / 2 ); + this._doSnapBackX = true; + } + } + + if ( dirLock !== "x" && this._vTracker ) { + y = this._sy; + this._speedY = dy; + newY = y + dy; + + this._doSnapBackY = false; + + scope = ( newY > 0 || newY < this._maxY ); + + if ( scope && dirLock === "y" ) { + sv = this._getAncestorByDirection("y"); + if ( sv ) { + this._setScrollPosition( newX, + newY > 0 ? 0 : this._maxY ); + this._propagateDragMove( sv, e, ex, ey, dir ); + return false; + } + + newY = y + ( dy / 2 ); + this._doSnapBackY = true; + } + } + + if ( this.options.overshootEnable === false ) { + this._doSnapBackX = false; + this._doSnapBackY = false; + } + + this._didDrag = true; + this._lastX = ex; + this._lastY = ey; + + this._setScrollPosition( newX, newY ); + + this._showScrollBars(); + }, + + _handleDragStop: function ( e ) { + if ( this._skip_dragging ) { + return; + } + + var l = this._lastMove, + t = getCurrentTime(), + doScroll = (l && (t - l) <= this.options.moveIntervalThreshold), + sx = ( this._hTracker && this._speedX && doScroll ) ? + this._speedX : ( this._doSnapBackX ? 1 : 0 ), + sy = ( this._vTracker && this._speedY && doScroll ) ? + this._speedY : ( this._doSnapBackY ? 1 : 0 ), + svdir = this.options.direction, + x, + y; + + if ( sx || sy ) { + this._startMScroll( sx, sy ); + } else { + this._hideScrollBars(); + } + + this._disableTracking(); + + return !this._didDrag; + }, + + _enableTracking: function () { + this._dragging = true; + }, + + _disableTracking: function () { + this._dragging = false; + }, + + _showScrollBars: function () { + var vclass = "ui-scrollbar-visible"; + + if ( !this.options.showScrollBars ) { + return; + } + if ( this._scrollbar_showed ) { + return; + } + + if ( this._$vScrollBar ) { + this._$vScrollBar.addClass( vclass ); + } + if ( this._$hScrollBar ) { + this._$hScrollBar.addClass( vclass ); + } + + this._scrollbar_showed = true; + }, + + _hideScrollBars: function () { + var vclass = "ui-scrollbar-visible"; + + if ( !this.options.showScrollBars ) { + return; + } + if ( !this._scrollbar_showed ) { + return; + } + + if ( this._$vScrollBar ) { + this._$vScrollBar.removeClass( vclass ); + } + if ( this._$hScrollBar ) { + this._$hScrollBar.removeClass( vclass ); + } + + this._scrollbar_showed = false; + }, + + _add_event: function () { + var self = this, + $c = this._$clip, + $v = this._$view; + + if ( this.options.eventType === "mouse" ) { + this._dragEvt = "mousedown mousemove mouseup click mousewheel"; + + this._dragCB = function ( e ) { + switch ( e.type ) { + case "mousedown": + return self._handleDragStart( e, + e.clientX, e.clientY ); + + case "mousemove": + return self._handleDragMove( e, + e.clientX, e.clientY ); + + case "mouseup": + return self._handleDragStop( e ); + + case "click": + return !self._didDrag; + + case "mousewheel": + var old = self.getScrollPosition(); + self.scrollTo( -old.x, + -(old.y - e.originalEvent.wheelDelta) ); + break; + } + }; + } else { + this._dragEvt = "touchstart touchmove touchend click"; + + this._dragCB = function ( e ) { + var t; + + switch ( e.type ) { + case "touchstart": + t = e.originalEvent.targetTouches[0]; + return self._handleDragStart( e, + t.pageX, t.pageY ); + + case "touchmove": + t = e.originalEvent.targetTouches[0]; + return self._handleDragMove( e, + t.pageX, t.pageY ); + + case "touchend": + return self._handleDragStop( e ); + + case "click": + return !self._didDrag; + } + }; + } + + $v.bind( this._dragEvt, this._dragCB ); + + if ( $c.jqmData("scroll") !== "y" ) { + return; + } + + $c.bind( "updatelayout", function ( e ) { + var $page = $c.parentsUntil("ui-page"), + sy, + vh; + + if ( !$c.height() || !$v.height() ) { + self.scrollTo( 0, 0, 0 ); + return; + } + + sy = $c.height() - $v.height(); + vh = $v.height() - self._view_height; + + self._view_height = $v.height(); + + if ( vh == 0 || vh > $c.height() / 2 ) { + return; + } + + if ( self._sy - sy <= -vh ) { + self.scrollTo( 0, self._sy, + self.options.snapbackDuration ); + } else if ( self._sy - sy <= vh + self.options.moveThreshold ) { + self.scrollTo( 0, sy, + self.options.snapbackDuration ); + } + }); + + $( window ).bind( "resize", function ( e ) { + var $page = $c.parentsUntil("ui-page"), + focused; + + if ( !$c.height() || !$v.height() ) { + return; + } + + focused = $c.find(".ui-focus"); + + if ( focused ) { + focused.trigger("resize.scrollview"); + } + + /* calibration - after triggered throttledresize */ + setTimeout( function () { + if ( self._sy < $c.height() - $v.height() ) { + self.scrollTo( 0, self._sy, + self.options.snapbackDuration ); + } + }, 260 ); + + self._view_height = $v.height(); + }); + }, + + _add_scrollbar: function () { + var $c = this._$clip, + prefix = "
          "; + + if ( !this.options.showScrollBars ) { + return; + } + + if ( this._vTracker ) { + $c.append( prefix + "y" + suffix ); + this._$vScrollBar = $c.children(".ui-scrollbar-y"); + } + if ( this._hTracker ) { + $c.append( prefix + "x" + suffix ); + this._$hScrollBar = $c.children(".ui-scrollbar-x"); + } + + this._scrollbar_showed = false; + }, + + _add_scroll_jump: function () { + var $c = this._$clip, + self = this, + top_btn, + left_btn; + + if ( !this.options.scrollJump ) { + return; + } + + if ( this._vTracker ) { + top_btn = $( '
          ' + + '
          ' ); + $c.append( top_btn ); + + top_btn.bind( "vclick", function () { + self.scrollTo( 0, 0, self.options.overshootDuration ); + } ); + } + + if ( this._hTracker ) { + left_btn = $( '
          ' + + '
          ' ); + $c.append( left_btn ); + + left_btn.bind( "vclick", function () { + self.scrollTo( 0, 0, self.options.overshootDuration ); + } ); + } + }, + + _set_scrollbar_size: function () { + var $c = this._$clip, + $v = this._$view, + cw = 0, + vw = 0, + ch = 0, + vh = 0, + thumb; + + if ( !this.options.showScrollBars ) { + return; + } + + if ( this._hTracker ) { + cw = $c.width(); + vw = $v.width(); + this._maxX = cw - vw; + + if ( this._maxX > 0 ) { + this._maxX = 0; + } + if ( this._$hScrollBar && vw ) { + thumb = this._$hScrollBar.find(".ui-scrollbar-thumb"); + thumb.css( "width", (cw >= vw ? "100%" : + (Math.floor(cw / vw * 100) || 1) + "%") ); + } + } + + if ( this._vTracker ) { + ch = $c.height(); + vh = $v.height(); + this._maxY = ch - vh; + + if ( this._maxY > 0 ) { + this._maxY = 0; + } + if ( this._$vScrollBar && vh ) { + thumb = this._$vScrollBar.find(".ui-scrollbar-thumb"); + thumb.css( "height", (ch >= vh ? "100%" : + (Math.floor(ch / vh * 100) || 1) + "%") ); + } + } + } + }); + + $.extend( MomentumTracker.prototype, { + start: function ( pos, speed, duration, minPos, maxPos ) { + var tstate = ( pos < minPos || pos > maxPos ) ? + tstates.snapback : tstates.scrolling, + pos_temp; + + this.state = ( speed !== 0 ) ? tstate : tstates.done; + this.pos = pos; + this.speed = speed; + this.duration = ( this.state === tstates.snapback ) ? + this.options.snapbackDuration : duration; + this.minPos = minPos; + this.maxPos = maxPos; + + this.fromPos = ( this.state === tstates.snapback ) ? this.pos : 0; + pos_temp = ( this.pos < this.minPos ) ? this.minPos : this.maxPos; + this.toPos = ( this.state === tstates.snapback ) ? pos_temp : 0; + + this.startTime = getCurrentTime(); + }, + + reset: function () { + this.state = tstates.done; + this.pos = 0; + this.speed = 0; + this.minPos = 0; + this.maxPos = 0; + this.duration = 0; + }, + + update: function ( overshootEnable ) { + var state = this.state, + cur_time = getCurrentTime(), + duration = this.duration, + elapsed = cur_time - this.startTime, + dx, + x, + didOverShoot; + + if ( state === tstates.done ) { + return this.pos; + } + + elapsed = elapsed > duration ? duration : elapsed; + + if ( state === tstates.scrolling || state === tstates.overshot ) { + dx = this.speed * + ( 1 - $.easing[this.easing]( elapsed / duration, + elapsed, 0, 1, duration ) ); + + x = this.pos + dx; + + didOverShoot = ( state === tstates.scrolling ) && + ( x < this.minPos || x > this.maxPos ); + + if ( didOverShoot ) { + x = ( x < this.minPos ) ? this.minPos : this.maxPos; + } + + this.pos = x; + + if ( state === tstates.overshot ) { + if ( elapsed >= duration ) { + this.state = tstates.snapback; + this.fromPos = this.pos; + this.toPos = ( x < this.minPos ) ? + this.minPos : this.maxPos; + this.duration = this.options.snapbackDuration; + this.startTime = cur_time; + elapsed = 0; + } + } else if ( state === tstates.scrolling ) { + if ( didOverShoot && overshootEnable ) { + this.state = tstates.overshot; + this.speed = dx / 2; + this.duration = this.options.overshootDuration; + this.startTime = cur_time; + } else if ( elapsed >= duration ) { + this.state = tstates.done; + } + } + } else if ( state === tstates.snapback ) { + if ( elapsed >= duration ) { + this.pos = this.toPos; + this.state = tstates.done; + } else { + this.pos = this.fromPos + (( this.toPos - this.fromPos ) * + $.easing[this.easing]( elapsed / duration, + elapsed, 0, 1, duration )); + } + } + + return this.pos; + }, + + done: function () { + return this.state === tstates.done; + }, + + getPosition: function () { + return this.pos; + } + }); + + $( document ).bind( 'pagecreate create', function ( e ) { + var $page = $( e.target ), + content_scroll = $page.find(".ui-content").jqmData("scroll"); + + /* content scroll */ + if ( $.support.scrollview === undefined ) { + $.support.scrollview = true; + } + + if ( $.support.scrollview === true && content_scroll === undefined ) { + content_scroll = "y"; + } + + if ( content_scroll !== "y" ) { + content_scroll = "none"; + } + + $page.find(".ui-content").attr( "data-scroll", content_scroll ); + + $page.find(":jqmData(scroll):not(.ui-scrollview-clip)").each( function () { + if ( $( this ).hasClass("ui-scrolllistview") ) { + $( this ).scrolllistview(); + } else { + var st = $( this ).jqmData("scroll"), + dir = st && ( st.search(/^[xy]/) !== -1 ) ? st.charAt(0) : null, + opts; + + if ( st === "none" ) { + return; + } + + opts = { + direction: dir || undefined, + scrollMethod: $( this ).jqmData("scroll-method") || undefined, + scrollJump: $( this ).jqmData("scroll-jump") || undefined + }; + + $( this ).scrollview( opts ); + } + }); + }); + + $( document ).bind( 'pageshow', function ( e ) { + var $page = $( e.target ), + scroll = $page.find(".ui-content").jqmData("scroll"); + + if ( scroll === "y" ) { + resizePageContentHeight( e.target ); + } + }); + +}( jQuery, window, document ) ); diff --git a/src/widgets/common/less/jquery.mobile.tizen.defines.less b/src/widgets/common/less/jquery.mobile.tizen.defines.less new file mode 100644 index 0000000..3f6424f --- /dev/null +++ b/src/widgets/common/less/jquery.mobile.tizen.defines.less @@ -0,0 +1,7 @@ +/* + * Defines one can include in one's own .less file for a common look-and-feel + */ + +/* From page 60 */ +@tizen-selected-color: #d9931a; +@tizen-selected-color-disabled: #999999; diff --git a/src/widgets/common/less/jquery.mobile.widget.less b/src/widgets/common/less/jquery.mobile.widget.less new file mode 100644 index 0000000..98882b7 --- /dev/null +++ b/src/widgets/common/less/jquery.mobile.widget.less @@ -0,0 +1,48 @@ +@jquery-mobile-ui-widget-border-color: #c7c7c7; +@jquery-mobile-ui-widget-text-color: #9d9d9d; +@jquery-mobile-ui-widget-body: #fafafa; +@jquery-mobile-ui-widget-left-border-width: 10px; +@jquery-mobile-ui-widget-left-border-style: solid; +@jquery-mobile-ui-widget-border-style: 1px solid; +@jquery-mobile-ui-widget-left-border: @jquery-mobile-ui-widget-left-border-width @jquery-mobile-ui-widget-left-border-style @jquery-mobile-ui-widget-border-color; + +.jquery-mobile-ui-widget { + border-left: @jquery-mobile-ui-widget-left-border; + border-bottom: @jquery-mobile-ui-widget-border-style @jquery-mobile-ui-widget-border-color; + background: @jquery-mobile-ui-widget-body; +} + +.jquery-mobile-ui-widget-top { + border-top: @jquery-mobile-ui-widget-border-style @jquery-mobile-ui-widget-border-color; +} + +.jquery-mobile-ui-label { + position: relative; + border-bottom: @jquery-mobile-ui-widget-border-style @jquery-mobile-ui-widget-border-color; + height: 40px; + .jquery-mobile-ui-label-text { + font-family: sans-serif; + font-size: 120%; + position: absolute; + text-align: left; + vertical-align: bottom; + color: @jquery-mobile-ui-widget-text-color; + bottom: 0px; + left: @jquery-mobile-ui-widget-left-border-width; + } +} + +.rounded-corners (@radius: 5px) { + border-radius: @radius; + -webkit-border-radius: @radius; + -moz-border-radius: @radius; +} + +.reset-rounded-corners { + .rounded-corners (0px); +} + +.reset-border { + border: 0; +} + diff --git a/src/widgets/controlbar/js/jquery.mobile.tizen.controlbar.js b/src/widgets/controlbar/js/jquery.mobile.tizen.controlbar.js new file mode 100755 index 0000000..7c5348c --- /dev/null +++ b/src/widgets/controlbar/js/jquery.mobile.tizen.controlbar.js @@ -0,0 +1,234 @@ +/* *************************************************************************** + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * *************************************************************************** + * + * jQuery Mobile Framework : "controlbar" plugin + * Copyright (c) jQuery Project + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * Authors: Jinhyuk Jun +*/ + +/** + * Controlbar can be created using data-role = "controlbar" inside footer + * Framework determine which controlbar will display with controlbar attribute + * + * Attributes: + * + * data-style : determine which controlbar will use ( tabbar / toolbar ) + * tabbar do not have back button, toolbar has back button + * + * Examples: + * + * HTML markup for creating tabbar: ( 2 ~ 5 li item available ) + * icon can be changed data-icon attribute + *
          + *
          + * + *
          + *
          + * + * HTML markup for creating toolbar: ( 2 ~ 5 li item available ) + * icon can be changed data-icon attribute + *
          + *
          + * + *
          + *
          +*/ + +(function ( $, undefined ) { + + $.widget( "tizen.controlbar", $.mobile.widget, { + options: { + iconpos: "top", + grid: null, + initSelector: ":jqmData(role='controlbar')" + }, + + _create: function () { + + var $controlbar = this.element, + $navbtns = $controlbar.find( "a" ), + iconpos = $navbtns.filter( ":jqmData(icon)" ).length ? + this.options.iconpos : undefined, + theme = $.mobile.listview.prototype.options.theme, /* Get current theme */ + style = $controlbar.attr( "data-style" ), + ww = window.innerWidth || $( window ).width(), + wh = window.innerHeight || $( window ).height(), + isLandscape; + + isLandscape = ww > wh && ( ww - wh ); + + if ( isLandscape ) { + $controlbar.removeClass( "ui-portrait-controlbar" ).addClass( "ui-landscape-controlbar" ); + } else { + $controlbar.removeClass( "ui-landscape-controlbar" ).addClass( "ui-portrait-controlbar" ); + } + + if ( style === "left" || style === "right" ) { + $controlbar + .parents( ".ui-content" ) + .css( 'padding', '0' ); + } else { + $controlbar + .addClass( "ui-navbar" ) + .attr( "role", "navigation" ) + .find( "ul" ) + .grid( { grid: this.options.grid } ); + } + + if ( !iconpos ) { + $controlbar.addClass( "ui-navbar-noicons" ); + } + + $navbtns.buttonMarkup({ + corners: false, + shadow: false, + iconpos: iconpos + }); + + $controlbar.delegate( "a", "vclick", function ( event ) { + $navbtns.not( ".ui-state-persist" ).removeClass( $.mobile.activeBtnClass ); + $( this ).addClass( $.mobile.activeBtnClass ); + }); + + if ( style === "tabbar" || style === "toolbar" ) { + $controlbar + .addClass( "ui-controlbar-" + theme ) + .addClass( "ui-" + style + "-" + theme ); + } else { + $controlbar + .addClass( "ui-controlbar-" + style ) + .end(); + } + + $( document ).bind( "pagebeforeshow", function ( event, ui ) { + var footer_filter = $( event.target ).find( ":jqmData(role='footer')" ), + controlbar_filter = footer_filter.find( ":jqmData(role='controlbar')" ), + style = controlbar_filter.jqmData( "style" ); + + if ( style == "toolbar" || style == "tabbar" ) { + /* Need to add text only style */ + if ( !(controlbar_filter.find(".ui-btn-inner").children().is(".ui-icon")) ) { + controlbar_filter.find( ".ui-btn-inner" ).addClass( "ui-navbar-textonly" ); + } else { + if ( controlbar_filter.find( ".ui-btn-text" ).text() == "" ) { + controlbar_filter.find( ".ui-btn" ).addClass( "ui-ctrlbar-icononly" ); + } + } + footer_filter + .css( "position", "fixed" ) + .css( "bottom", 0 ) + .css( "height", controlbar_filter.height() ); + if ( style == "toolbar" ) { + controlbar_filter + .css( "width", window.innerWidth - controlbar_filter.siblings(".ui-btn").width() - parseInt(controlbar_filter.siblings(".ui-btn").css("right"), 10) * 2 ); + } + } + }); + + $( document ).bind( "pageshow", function ( e, ui ) { + var controlbar_filter = $( ".ui-page-active" ).find( ":jqmData(role='footer')" ).eq( 0 ).find( ":jqmData(role='controlbar')" ), + element_width = 0, + element_count = controlbar_filter.find( 'li' ).length; + + if ( controlbar_filter.find(".ui-btn-active").length == 0 ) { + controlbar_filter.find( "div" ).css( "left", "0px" ); + } else { + controlbar_filter.find( "div" ).css( "left", controlbar_filter.find( ".ui-btn-active" ).parent( "li" ).index() * controlbar_filter.width() / element_count ); + } + + /* Increase Content size with dummy
          because of footer height */ + if ( controlbar_filter.length != 0 && $( ".ui-page-active" ).find( ".dummy-div" ).length == 0 && $( ".ui-page-active" ).find( ":jqmData(role='footer')" ).find( ":jqmData(role='controlbar')" ).length != 0 ) { + $( ".ui-page-active" ).find( ":jqmData(role='content')" ).append( '
          ' ); + $( ".ui-page-active" ).find( ".dummy-div" ) + .css( "width", controlbar_filter.width() ) + .css( "height", controlbar_filter.height() ); + } + + if ( controlbar_filter.length ) { + element_width = Math.floor( controlbar_filter.outerWidth() / element_count ); + controlbar_filter.find("li:last").width( controlbar_filter.outerWidth() - element_width * ( element_count - 1 ) ); + } + }); + + $( window ).bind( "resize", function ( e ) { + var controlbar_filter = $( ".ui-page-active" ).find( ":jqmData(role='footer')" ).eq( 0 ).find( ":jqmData(role='controlbar')" ), + element_width = 0, + element_count = controlbar_filter.find( 'li' ).length; + + if ( controlbar_filter.length ) { + element_width = Math.floor( controlbar_filter.outerWidth() / element_count ); + controlbar_filter.find("li:last").width( controlbar_filter.outerWidth() - element_width * ( element_count - 1 ) ); + } + }); + + this._bindControlbarEvents(); + }, + + _bindControlbarEvents: function () { + var $controlbar = this.element; + + $( window ).bind( "orientationchange", function ( e, ui ) { + ww = window.innerWidth || $( window ).width(); + wh = window.innerHeight || $( window ).height(); + + isLandscape = ww > wh && ( ww - wh ); + + if ( isLandscape ) { + $controlbar.removeClass( "ui-portrait-controlbar" ).addClass( "ui-landscape-controlbar" ); + } else { + $controlbar.removeClass( "ui-landscape-controlbar" ).addClass( "ui-portrait-controlbar" ); + } + }) + + }, + + _setDisabled: function ( value, cnt ) { + this.element.find( "li" ).eq( cnt ).attr( "disabled", value ); + this.element.find( "li" ).eq( cnt ).attr( "aria-disabled", value ); + }, + + disable: function ( cnt ) { + this._setDisabled( true, cnt ); + this.element.find( "li" ).eq( cnt ).addClass( "ui-disabled" ); + }, + + enable: function ( cnt ) { + this._setDisabled( false, cnt ); + this.element.find( "li" ).eq( cnt ).removeClass( "ui-disabled" ); + } + }); + + //auto self-init widgets + $( document ).bind( "pagecreate create", function ( e ) { + $( $.tizen.controlbar.prototype.options.initSelector, e.target ).controlbar(); + }); +}( jQuery ) ); diff --git a/src/widgets/datetimepicker/js/jquery.mobile.tizen.datetimepicker.js b/src/widgets/datetimepicker/js/jquery.mobile.tizen.datetimepicker.js new file mode 100644 index 0000000..f17b2c9 --- /dev/null +++ b/src/widgets/datetimepicker/js/jquery.mobile.tizen.datetimepicker.js @@ -0,0 +1,754 @@ +/*global Globalize:false, range:false, regexp:false*/ +/* + * jQuery Mobile Widget @VERSION + * + * This software is licensed under the MIT licence (as defined by the OSI at + * http://www.opensource.org/licenses/mit-license.php) + * + * *************************************************************************** + * Copyright (C) 2011 by Intel Corporation Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * *************************************************************************** + * + * Authors: Salvatore Iovene + * Daehyon Jung + */ + +/** + * datetimepicker is a widget that lets the user select a date and/or a + * time. If you'd prefer use as auto-initialization of form elements, + * use input elements with type=date/time/datetime within form tag + * as same as other form elements. + * + * HTML Attributes: + * + * data-role: 'datetimepicker' + * data-format: date format string. e.g) "MMM dd yyyy, HH:mm" + * type: 'date', 'datetime', 'time' + * value: pre-set value. only accepts ISO date string. e.g) "2012-05-04", "2012-05-04T01:02:03+09:00" + * data-date: any date/time string "new Date()" accepts. + * + * Options: + * type: 'date', 'datetime', 'time' + * format: see data-format in HTML Attributes. + * value: see value in HTML Attributes. + * date: preset value as JavaScript Date Object representation. + * + * APIs: + * value( datestring ) + * : Set date/time to 'datestring'. + * value() + * : Get current selected date/time as W3C DTF style string. + * getValue() - replaced with 'value()' + * : same as value() + * setValue( datestring ) - replaced with 'value(datestring)' + * : same as value( datestring ) + * changeTypeFormat( type, format ) - deprecated + * : Change Type and Format options. use datetimepicker( "option", "format" ) instead + * + * Events: + * date-changed: Raised when date/time was changed. + * + * Examples: + *
            + *
          • + * + * + * + * + * Date/Time Picker - (select a date first) + * + *
          • + *
          • + * + * + * + * + * Date Picker - (select a date first) + * + *
          • + *
          • + * + * + * + * + * Time Picker - (select a date first) + * + *
          • + *
          + * How to get a return value: + * ========================== + * Bind to the 'date-changed' event, e.g.: + * $("#myDatetimepicker").bind("date-changed", function(e, date) { + * alert("New date: " + date.toString()); + * }); + */ + + +( function ( $, window, undefined ) { + $.widget( "tizen.datetimepicker", $.tizen.widgetex, { + + options: { + type: null, // date, time, datetime applicable + format: null, + date: null, + initSelector: "input[type='date'], input[type='datetime'], input[type='time'], :jqmData(role='datetimepicker')" + }, + + _calendar: function () { + return window.Globalize.culture().calendars.standard; + }, + + _value: { + attr: "data-" + ( $.mobile.ns || "" ) + "date", + signal: "date-changed" + }, + + _daysInMonth: [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ], + + _isLeapYear: function ( year ) { + return year % 4 ? 0 : ( year % 100 ? 1 : ( year % 400 ? 0 : 1 ) ); + }, + + _makeTwoDigits: function ( val ) { + var ret = val.toString(10); + + if ( val < 10 ) { + ret = "0" + ret; + } + return ret; + }, + + _setType: function ( type ) { + //datetime, date, time + switch (type) { + case 'datetime': + case 'date': + case 'time': + this.options.type = type; + break; + default: + this.options.type = 'datetime'; + break; + } + + this.element.attr( "data-" + ( $.mobile.ns ? $.mobile.ns + "-" : "" ) + "type", this.options.type ); + return this.options.type; + }, + + _setFormat: function ( format ) { + if ( this.options.format != format ) { + this.options.format = format; + } else { + return; + } + + this.ui.children().remove(); + + var token = this._parsePattern( format ), + div = document.createElement('div'), + pat, + tpl, + period, + btn, + obj = this; + + while ( token.length > 0 ) { + pat = token.shift(); + tpl = '%2'; + switch ( pat ) { + case 'H': //0 1 2 3 ... 21 22 23 + case 'HH': //00 01 02 ... 21 22 23 + case 'h': //0 1 2 3 ... 11 12 + case 'hh': //00 01 02 ... 11 12 + $(div).append( tpl.replace('%1', 'hour') ); + break; + case 'mm': //00 01 ... 59 + case 'm': //0 1 2 ... 59 + if ( this.options.type == 'date' ) { + $(div).append( tpl.replace('%1', 'month') ); + } else { + $(div).append( tpl.replace('%1', 'min') ); + } + break; + case 'ss': + case 's': + $(div).append( tpl.replace('%1', 'sec') ); + break; + case 'd': // day of month 5 + case 'dd': // day of month(leading zero) 05 + $(div).append( tpl.replace('%1', 'day') ); + break; + case 'M': // Month of year 9 + case 'MM': // Month of year(leading zero) 09 + case 'MMM': + case 'MMMM': + $(div).append( tpl.replace('%1', 'month') ); + break; + case 'yy': // year two digit + case 'yyyy': // year four digit + $(div).append( tpl.replace('%1', 'year') ); + break; + case 't': //AM / PM indicator(first letter) A, P + // add button + case 'tt': //AM / PM indicator AM/PM + // add button + btn = 'period'; + $(div).append( btn ); + break; + case 'g': + case 'gg': + $(div).append( tpl.replace('%1', 'era').replace('%2', this._calendar().eras.name) ); + break; + case '\t': + $(div).append( tpl.replace('%1', 'tab').replace('%2', pat) ); + break; + default : // string or any non-clickable object + $(div).append( tpl.replace('%1', 'seperator').replace('%2', pat) ); + break; + } + } + + this.ui.append( div ); + if ( this.options.date ) { + this._setDate( this.options.date ); + } + + this.ui.find('.ui-datefield-period').buttonMarkup().bind( 'vclick', function ( e ) { + obj._switchAmPm( obj ); + }); + + this.element.attr( "data-" + ( $.mobile.ns ? $.mobile.ns + "-" : "" ) + "format", this.options.format ); + return this.options.format; + }, + + _setDate: function ( newdate ) { + if ( typeof ( newdate ) == "string" ) { + newdate = new Date( newdate ); + } + + var fields = $('span,a', this.ui), + type, + fn, + $field, + btn, + i; + + function getMonth() { + return newdate.getMonth() + 1; + } + + for ( i = 0; i < fields.length; i++ ) { + $field = $(fields[i]); + type = $field.attr("class").match(/ui-datefield-([\w]*)/); + if ( !type ) { + type = ""; + } + switch ( type[1] ) { + case 'hour': + fn = newdate.getHours; + break; + case 'min': + fn = newdate.getMinutes; + break; + case 'sec': + fn = newdate.getSeconds; + break; + case 'year': + fn = newdate.getFullYear; + break; + case 'month': + fn = getMonth; + break; + case 'day': + fn = newdate.getDate; + break; + case 'period': + fn = newdate.getHours() < 12 ? this._calendar().AM[0] : this._calendar().PM[0]; + btn = $field.find( '.ui-btn-text' ); + if ( btn.length == 0 ) { + $field.text(fn); + } else if ( btn.text() != fn ) { + btn.text( fn ); + } + fn = null; + break; + default: + fn = null; + break; + } + if ( fn ) { + this._updateField( $field, fn.call( newdate ) ); + } + } + + this.options.date = newdate; + + this._setValue( this.value() ); + + this.element.attr( "data-" + ( $.mobile.ns ? $.mobile.ns + "-" : "" ) + "date", this.options.date ); + return this.options.date; + }, + + destroy: function () { + if ( this.ui ) { + this.ui.remove(); + } + + if ( this.element ) { + this.element.show(); + } + }, + + value: function ( val ) { + function timeStr( t, obj ) { + return obj._makeTwoDigits( t.getHours() ) + ':' + + obj._makeTwoDigits( t.getMinutes() ) + ':' + + obj._makeTwoDigits( t.getSeconds() ); + } + + function dateStr( d, obj ) { + return ( ( d.getFullYear() % 10000 ) + 10000 ).toString().substr(1) + '-' + + obj._makeTwoDigits( d.getMonth() + 1 ) + '-' + + obj._makeTwoDigits( d.getDate() ); + } + + var rvalue = null; + if ( val ) { + rvalue = this._setDate( val ); + } else { + switch ( this.options.type ) { + case 'time': + rvalue = timeStr( this.options.date, this ); + break; + case 'date': + rvalue = dateStr( this.options.date, this ); + break; + default: + rvalue = dateStr( this.options.date, this ) + 'T' + timeStr( this.options.date, this ); + break; + } + } + return rvalue; + }, + + setValue: function ( newdate ) { + console.warn( "setValue was deprecated. use datetimepicker('option', 'date', value) instead." ); + return this.value( newdate ); + }, + + /** + * return W3C DTF string + */ + getValue: function () { + console.warn("getValue() was deprecated. use datetimepicker('value') instead."); + return this.value(); + }, + + _updateField: function ( target, value ) { + if ( !target || target.length == 0 ) { + return; + } + + if ( value == 0 ) { + value = "0"; + } + + var pat = target.jqmData( 'pat' ), + hour, + text; + switch ( pat ) { + case 'H': + case 'HH': + case 'h': + case 'hh': + hour = value; + if ( pat.charAt(0) == 'h' ) { + if ( hour > 12 ) { + hour -= 12; + } else if ( hour == 0 ) { + hour = 12; + } + } + if ( pat.length == 2 ) { + hour = this._makeTwoDigits( hour ); + } + text = hour; + break; + case 'm': + case 'M': + case 'd': + case 's': + text = value; + break; + case 'mm': + case 'dd': + case 'MM': + case 'ss': + text = this._makeTwoDigits( value ); + break; + case 'MMM': + text = this._calendar().months.namesAbbr[ value - 1]; + break; + case 'MMMM': + text = this._calendar().months.names[ value - 1 ]; + break; + case 'yy': + text = this._makeTwoDigits( value % 100 ); + break; + case 'yyyy': + if ( value < 10 ) { + value = '000' + value; + } else if ( value < 100 ) { + value = '00' + value; + } else if ( value < 1000 ) { + value = '0' + value; + } + text = value; + break; + } + // to avoid reflow where its value isn't out-dated + if ( target.text() != text ) { + target.text( text ); + } + }, + + _switchAmPm: function ( obj ) { + if ( this._calendar().AM != null ) { + var date = new Date( this.options.date ), + text, + change = 1000 * 60 * 60 * 12; + if ( date.getHours() > 11 ) { + change = -change; + } + date.setTime( date.getTime() + change ); + this._setDate( date ); + } + }, + + _parsePattern: function ( pattern ) { + var regex = /\/|\s|dd|d|MMMM|MMM|MM|M|yyyy|yy|y|hh|h|HH|H|mm|m|ss|s|tt|t|f|gg|g|\'[\w\W]*\'$|[\w\W]/g, + matches, + i; + + matches = pattern.match( regex ); + + for ( i = 0; i < matches.length; i++ ) { + if ( matches[i].charAt(0) == "'" ) { + matches[i] = matches[i].substr( 1, matches[i].length - 2 ); + } + } + + return matches; + }, + + changeTypeFormat: function ( type, format ) { + console.warn('changeTypeFormat() was deprecated. use datetimepicker("option", "type"|"format", value) instead'); + if ( type ) { + this._setType( type ); + } + + if ( format ) { + this._setFormat( format ); + } + }, + + _create: function () { + var obj = this; + + if ( this.element.is( "input" ) ) { + ( function ( obj ) { + var type, value, format; + + type = obj.element.attr( "type" ); + obj.options.type = type; + + value = obj.element.attr( "value" ); + if ( value ) { + obj.options.date = new Date( value ); + } + }( this ) ); + } + + if ( !this.options.format ) { + switch ( this.options.type ) { + case 'datetime': + this.options.format = this._calendar().patterns.d + "\t" + this._calendar().patterns.t; + break; + case 'date': + this.options.format = this._calendar().patterns.d; + break; + case 'time': + this.options.format = this._calendar().patterns.t; + break; + } + } + + if ( !this.options.date ) { + this.options.date = new Date(); + } + + this.element.hide(); + this.ui = $('
          '); + $(this.element).after( this.ui ); + + this.ui.bind('vclick', function ( e ) { + obj._showDataSelector( obj, this, e.target ); + }); + }, + + _populateDataSelector: function ( field, pat ) { + var values, + numItems, + current, + data, + range = window.range, + local, + yearlb, + yearhb, + day; + + switch ( field ) { + case 'hour': + if ( pat == 'H' ) { + // twentyfour + values = range( 0, 23 ); + data = range( 0, 23 ); + current = this.options.date.getHours(); + } else { + values = range( 1, 12 ); + current = this.options.date.getHours() - 1;//11 + if ( current >= 11 ) { + current = current - 12; + data = range( 13, 23 ); + data.push( 12 ); // consider 12:00 am as 00:00 + } else { + data = range( 1, 11 ); + data.push( 0 ); + } + if ( current < 0 ) { + current = 11; // 12:00 or 00:00 + } + } + if ( pat.length == 2 ) { + // two digit + values = values.map( this._makeTwoDigits ); + } + numItems = values.length; + break; + case 'min': + case 'sec': + values = range( 0, 59 ); + if ( pat.length == 2 ) { + values = values.map( this._makeTwoDigits ); + } + data = range( 0, 59 ); + current = ( field == 'min' ? this.options.date.getMinutes() : this.options.date.getSeconds() ); + numItems = values.length; + break; + case 'year': + yearlb = 1900; + yearhb = 2100; + data = range( yearlb, yearhb ); + current = this.options.date.getFullYear() - yearlb; + values = range( yearlb, yearhb ); + numItems = values.length; + break; + case 'month': + switch ( pat.length ) { + case 1: + values = range( 1, 12 ); + break; + case 2: + values = range( 1, 12 ).map( this._makeTwoDigits ); + break; + case 3: + values = this._calendar().months.namesAbbr.slice(); + break; + case 4: + values = this._calendar().months.names.slice(); + break; + } + if ( values.length == 13 ) { // @TODO Lunar calendar support + if ( values[12] == "" ) { // to remove lunar calendar reserved space + values.pop(); + } + } + data = range( 1, values.length ); + current = this.options.date.getMonth(); + numItems = values.length; + break; + case 'day': + day = this._daysInMonth[ this.options.date.getMonth() ]; + if ( day == 28 ) { + day += this._isLeapYear( this.options.date.getFullYear() ); + } + values = range( 1, day ); + if ( pat.length == 2 ) { + values = values.map( this._makeTwoDigits ); + } + data = range( 1, day ); + current = this.options.date.getDate() - 1; + numItems = day; + break; + } + + return { + values: values, + data: data, + numItems: numItems, + current: current + }; + + }, + + _showDataSelector: function ( obj, ui, target ) { + target = $(target); + + var attr = target.attr("class"), + field = attr ? attr.match(/ui-datefield-([\w]*)/) : undefined, + pat, + data, + values, + numItems, + current, + valuesData, + html, + datans, + $ul, + $div, + $ctx, + $li, + i, + newLeft = 10; + + if ( !attr ) { + return; + } + if ( !field ) { + return; + } + + target.not('.ui-datefield-seperator').addClass('ui-datefield-selected'); + + pat = target.jqmData('pat'); + data = obj._populateDataSelector.call( obj, field[1], pat ); + + values = data.values; + numItems = data.numItems; + current = data.current; + valuesData = data.data; + + if ( values ) { + datans = "data-" + ($.mobile.ns ? ($.mobile.ns + '-') : "") + 'val="'; + for ( i = 0; i < values.length; i++ ) { + html += '
        • ' + values[i] + '
        • '; + } + + $ul = $("
            "); + $div = $('
            '); + $div.append( $ul ).appendTo( ui ); + $ctx = $div.ctxpopup(); + $ctx.parents('.ui-popupwindow').addClass('ui-datetimepicker'); + $li = $(html); + $( $li[current] ).addClass("current"); + $div.jqmData( "list", $li ); + $div.circularview(); + if ( !obj._reflow ) { + obj._reflow = function () { + $div.circularview("reflow"); + }; + $(window).bind("resize", obj._reflow); + } + // cause ctxpopup forced to subtract 10 + if( $(window).width() / 2 < target.offset().left ) { + newLeft = -10; + } + $ctx.popupwindow( 'open', + target.offset().left + ( target.width() / 2 ) + newLeft - window.pageXOffset , + target.offset().top + target.height() - window.pageYOffset ); + $div.bind('popupafterclose', function ( e ) { + if ( obj._reflow ) { + $(window).unbind("resize", obj._reflow); + obj._reflow = null; + } + $div.unbind( 'popupafterclose' ); + $ul.unbind( 'vclick' ); + $(obj).unbind( 'update' ); + $(ui).find('.ui-datefield-selected').removeClass('ui-datefield-selected'); + $ctx.popupwindow( 'destroy' ); + $div.remove(); + }); + + $(obj).bind( 'update', function ( e, val ) { + $ctx.popupwindow( 'close' ); + var date = new Date( this.options.date ); + switch ( field[1] ) { + case 'min': + date.setMinutes( val ); + break; + case 'hour': + date.setHours( val ); + break; + case 'sec': + date.setSeconds( val ); + break; + case 'year': + date.setFullYear( val ); + break; + case 'month': + date.setMonth( val - 1 ); + + if ( date.getMonth() == val ) { + date.setDate( date.getDate() - 1 ); + } + break; + case 'day': + date.setDate( val ); + break; + } + obj._setDate( date ); + }); + + $ul.bind( 'click', function ( e ) { + if ( $(e.target).is('a') ) { + $ul.find(".current").removeClass("current"); + $(e.target).parent().addClass('current'); + var val = $(e.target).jqmData("val"); + $(obj).trigger( 'update', val ); // close popup, unselect field + } + }); + + $div.circularview( 'centerTo', '.current', 500 ); + } + return ui; + } + + }); + + $(document).bind("pagecreate create", function ( e ) { + $($.tizen.datetimepicker.prototype.options.initSelector, e.target) + .not(":jqmData(role='none'), :jqmData(role='nojs')") + .datetimepicker(); + }); + +} ( jQuery, this ) ); diff --git a/src/widgets/datetimepicker/js/range.js b/src/widgets/datetimepicker/js/range.js new file mode 100644 index 0000000..e8c7420 --- /dev/null +++ b/src/widgets/datetimepicker/js/range.js @@ -0,0 +1,56 @@ +/* + * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL licenses + * http://phpjs.org/functions/range + * original by: Waldo Malqui Silva + * version: 1107.2516 + */ +function range( low, high, step ) { + // Create an array containing the range of integers or characters + // from low to high (inclusive) + // + // version: 1107.2516 + // discuss at: http://phpjs.org/functions/range + // + original by: Waldo Malqui Silva + // * example 1: range ( 0, 12 ); + // * returns 1: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] + // * example 2: range( 0, 100, 10 ); + // * returns 2: [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100] + // * example 3: range( 'a', 'i' ); + // * returns 3: ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i'] + // * example 4: range( 'c', 'a' ); + // * returns 4: ['c', 'b', 'a'] + var matrix = [], + inival, + endval, + plus, + walker = step || 1, + chars = false; + + if (!isNaN(low) && !isNaN(high)) { + inival = low; + endval = high; + } else if (isNaN(low) && isNaN(high)) { + chars = true; + inival = low.charCodeAt(0); + endval = high.charCodeAt(0); + } else { + inival = (isNaN(low) ? 0 : low); + endval = (isNaN(high) ? 0 : high); + } + + plus = ((inival > endval) ? false : true); + if (plus) { + while (inival <= endval) { + matrix.push(((chars) ? String.fromCharCode(inival) : inival)); + inival += walker; + } + } else { + while (inival >= endval) { + matrix.push(((chars) ? String.fromCharCode(inival) : inival)); + inival -= walker; + } + } + + return matrix; +} + diff --git a/src/widgets/dayselector/css/dayselector.css b/src/widgets/dayselector/css/dayselector.css new file mode 100644 index 0000000..45482e7 --- /dev/null +++ b/src/widgets/dayselector/css/dayselector.css @@ -0,0 +1,25 @@ +/* dayselector CSS */ +.ui-dayselector { + display: inline-block; +} + +.ui-dayselector label { + height: 56px; + width: 64px; +} + +.ui-dayselector-label-6 { + color: blue; +} + +.ui-dayselector-label-0 { + color: red; +} + +.todons-dayselector-disabled .ui-dayselector-label-6 { + color: #121212; +} + +.todons-dayselector-disabled .ui-dayselector-label-0 { + color: #363636; +} diff --git a/src/widgets/dayselector/js/jquery.mobile.tizen.dayselector.js b/src/widgets/dayselector/js/jquery.mobile.tizen.dayselector.js new file mode 100755 index 0000000..cf9ebce --- /dev/null +++ b/src/widgets/dayselector/js/jquery.mobile.tizen.dayselector.js @@ -0,0 +1,178 @@ +/* + * jQuery Mobile Widget @VERSION + * + * This software is licensed under the MIT licence (as defined by the OSI at + * http://www.opensource.org/licenses/mit-license.php) + * + * *************************************************************************** + * Copyright (C) 2011 by Intel Corporation Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * *************************************************************************** + * + * Authors: Rijubrata Bhaumik + * Elliot Smith + */ + +// Displays a day selector element: a control group with 7 check +// boxes which can be toggled on and off. +// +// The widget can be invoked on fieldset element with +// $(element).dayselector() or by creating a fieldset element with +// data-role="dayselector". If you try to apply it to an element +// of type other than fieldset, results will be unpredictable. +// +// The default is to display the controlgroup horizontally; you can +// override this by setting data-type="vertical" on the fieldset, +// or by passing a type option to the constructor. The data-type +// attribute has precedence. +// +// If no ID is supplied for the dayselector, one will be generated +// automatically. +// +// Methods: +// +// value: Return the day numbers (0=Sunday, ..., 6=Saturday) of +// the selected checkboxes as an array. +// +// selectAll: Select all 7 days of the week by automatically "ticking" +// all of the checkboxes. +// +// Options: +// +// theme : Override the data-theme of the widget; note that the +// order of preference is: 1) set from data-theme attribute; +// 2) set from option; 3) set from closest parent data-theme; +// 4) default to 'c' +// +// type: 'horizontal' (default) or 'vertical'; specifies the type +// of controlgroup to create around the day check boxes. +// +// days: array of day names, Sunday first; defaults to English day +// names; the first letters are used as text for the checkboxes + +(function ( $, window, undefined ) { + $.widget( "tizen.dayselector", $.mobile.widget, { + options: { + initSelector: 'fieldset:jqmData(role="dayselector")', + theme: null, + type: 'horizontal', + days: ['Sunday', + 'Monday', + 'Tuesday', + 'Wednesday', + 'Thursday', + 'Friday', + 'Saturday'] + }, + + defaultTheme: 's', + + _create: function () { + var days, + parentId, + i, + day, + letter, + id, + labelClass, + checkbox, + label; + + this.element.addClass( 'ui-dayselector' ); + + this.options.type = this.element.jqmData( 'type' ) || this.options.type; + + this.options.theme = this.element.jqmData( 'theme' ) || + this.options.theme || + this.element.closest( ':jqmData(theme)').jqmData('theme' ) || + this.defaultTheme; + + days = this.options.days; + + this.element.attr( 'data-' + $.mobile.ns + 'type', this.options.type ); + + parentId = this.element.attr( 'id' ) || + 'dayselector' + ( new Date() ).getTime(); + + for ( i = 0; i < days.length; i++ ) { + day = days[i]; + letter = day.slice(0, 1); + + if ( window.Globalize ) { + //TODO may some modification required to support + // start week day difference upon cultures. + letter = window.Globalize.culture().calendars.standard.days.namesShort[i]; + } + id = parentId + '_' + i; + labelClass = 'ui-dayselector-label-' + i; + + checkbox = $( '' ) + .attr( 'id', id ) + .attr( 'value', i ); + + label = $( '' ) + .attr( 'for', id ) + .addClass( labelClass ); + + this.element.append( checkbox ); + this.element.append( label ); + } + + this.checkboxes = this.element + .find( ':checkbox' ) + .checkboxradio( { theme: this.options.theme } ); + + this.element.controlgroup( { excludeInvisible: false } ); + }, + + _setOption: function ( key, value ) { + if ( key === "disabled" ) { + this._setDisabled( value ); + } + }, + + _setDisabled: function ( value ) { + $.Widget.prototype._setOption.call(this, "disabled", value); + this.element[value ? "addClass" : "removeClass"]("ui-disabled"); + }, + + value: function () { + var values = this.checkboxes.filter( ':checked' ).map( function () { + return this.value; + } ).get(); + + return values; + }, + + selectAll: function () { + this.checkboxes + .attr( 'checked', 'checked' ) + .checkboxradio( 'refresh' ); + } + + } ); /* End of Widget */ + + // auto self-init widgets + $( document ).bind( "pagebeforecreate", function ( e ) { + var elts = $( $.tizen.dayselector.prototype.options.initSelector, e.target ); + elts.not( ":jqmData(role='none'), :jqmData(role='nojs')" ).dayselector(); + } ); + +}( jQuery, this ) ); diff --git a/src/widgets/expandablelist/js/jquery.mobile.tizen.expandablelist.js b/src/widgets/expandablelist/js/jquery.mobile.tizen.expandablelist.js new file mode 100644 index 0000000..0e57cf3 --- /dev/null +++ b/src/widgets/expandablelist/js/jquery.mobile.tizen.expandablelist.js @@ -0,0 +1,172 @@ +/* *************************************************************************** + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * *************************************************************************** + */ +/** + * Displays vertical multi-level list. + * + * To apply, add the attribute data-expandable="true" and id="parentid" to a
          • element for parent list item + * and add the arrribute data-expanded-by="parentid" to a
          • element for child list item. + * + * HTML Attributes: + * data-expandable: Parent list item must have 'true' value for this attribute + * data-expanded-by: Child list item expanded by parent list item must have 'true' value for this attribute + * data-initial-expansion: If you want expandable list to be expanded initially, set this value as 'true' + * + * Example: + *
          • Parent
          • + *
          • Child
          • + */ + +( function ( $, undefined ) { + + $.widget( "tizen.expandablelist", $.mobile.widget, { + options: { + initSelector: ":jqmData(expandable='true')" + }, + + _hide: function ( e ) { + $( e ).removeClass( 'ui-li-expand-transition-show' ) + .addClass( 'ui-li-expand-transition-hide' ); + }, + _show: function ( e ) { + $( e ).removeClass( 'ui-li-expand-transition-hide' ) + .addClass( 'ui-li-expand-transition-show' ); + }, + _hide_expand_img: function ( e ) { + $( e ).removeClass( 'ui-li-expandable-hidden' ) + .addClass( 'ui-li-expandable-shown' ); + + $( e ).find( ".ui-li-expand-icon" ) + .addClass( "ui-li-expanded-icon" ) + .removeClass( "ui-li-expand-icon" ); + }, + _show_expand_img: function ( e ) { + $( e ).removeClass( 'ui-li-expandable-shown' ) + .addClass( 'ui-li-expandable-hidden' ); + + $( e ).find( ".ui-li-expanded-icon" ) + .addClass( "ui-li-expand-icon" ) + .removeClass( "ui-li-expanded-icon" ); + }, + + _set_expand_arrow: function ( self, e, parent_is_expanded ) { + if ( parent_is_expanded ) { + self._hide_expand_img( e ); + } else { + self._show_expand_img( e ); + } + if ( $( e[0] ).data( "expandable" ) && parent_is_expanded == false ) { + var children = $( e ).nextAll( ":jqmData(expanded-by='" + $( e ).attr( 'id' ) + "')" ); + children.each( function ( idx, child ) { + self._set_expand_arrow( self, child, e.is_expanded ); + } ); + } + }, + + _toggle: function ( self, e, parent_is_expanded ) { + if ( ! parent_is_expanded ) { + self._show( e ); + } else { + self._hide( e ); + if ( $( e ).data( "expandable" ) && e.is_expanded == true ) { + var children = $( e ).nextAll( ":jqmData(expanded-by='" + $( e ).attr( 'id' ) + "')" ); + children.each( function ( idx, child ) { + self._toggle( self, child, e.is_expanded ); + } ); + e.is_expanded = false; + } + } + }, + _is_hidden: function ( e ) { + return ( $( e ).height( ) == 0); + }, + + refresh: function () { + if ( this._handler ) { + this.element.unbind(); + this._handler = null; + } + this._create(); + }, + + _create: function ( ) { + + var children = $( this.element ).nextAll( ":jqmData(expanded-by='" + $( this.element ).attr( 'id' ) + "')" ), + e = this.element, + self = this, + expanded = e.nextAll( ":jqmData(expanded-by='" + e[0].id + "')" ), + initial_expansion = e.data( "initial-expansion" ), + is_expanded = false, + parent_id = null; + + if ( children.length == 0 ) { + return; + } + + if ( initial_expansion == true ) { + parent_id = e.data( "expanded-by" ); + if ( parent_id ) { + if ( $( "#" + parent_id ).is_expanded == true) { + is_expanded = true; + } + } else { + is_expanded = true; + } + } + + e[0].is_expanded = is_expanded; + if ( e[0].is_expanded ) { + self._hide_expand_img( e ); + $(e).append( "
            " ); + } else { + self._show_expand_img( e ); + $(e).append( "
            " ); + } + + if ( e[0].is_expanded ) { + expanded.each( function ( i, e ) { self._show( e ); } ); + } else { + expanded.each( function ( i, e ) { self._hide( e ); } ); + } + + expanded.addClass( "ui-li-expanded" ); + + this._handler = e.bind( 'vclick', function ( ) { + var _is_expanded = e[0].is_expanded; + expanded.each( function ( i, e ) { self._toggle( self, e, _is_expanded ); } ); + e[0].is_expanded = ! e[0].is_expanded; + + self._set_expand_arrow( self, e, e[0].is_expanded ); + }); + } + + + }); // end: $.widget() + + + $( document ).bind( "pagecreate create", function ( e ) { + $( $.tizen.expandablelist.prototype.options.initSelector, e.target ) + .not( ":jqmData(role='none'), :jqmData(role='nojs')" ) + .expandablelist( ); + }); + +} ( jQuery ) ); diff --git a/src/widgets/extendablelist/js/jquery.mobile.tizen.extendablelist.js b/src/widgets/extendablelist/js/jquery.mobile.tizen.extendablelist.js new file mode 100755 index 0000000..047d462 --- /dev/null +++ b/src/widgets/extendablelist/js/jquery.mobile.tizen.extendablelist.js @@ -0,0 +1,620 @@ +/* *************************************************************************** + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * *************************************************************************** + * + * Author: Wongi Lee +*/ + +/** + * Extendable List Widget for unlimited data. + * To support more then 1,000 items, special list widget developed. + * Fast initialize and append some element into the DOM tree repeatedly. + * DB connection and works like DB cursor. + * + * HTML Attributes: + * + * data-role: extendablelist + * data-template : jQuery.template ID that populate into extendable list. A button : a
            element with "data-role : button" should be included on data-template. + * data-dbtable : DB Table name. It used as window[DB NAME]. Loaded data should be converted as window object. + * data-extenditems : Number of elements to extend at once. + * + * ID :
              element that has "data-role=extendablelist" must have ID attribute. + * Class :
                element that has "data-role=extendablelist" should have "vlLoadSuccess" class to guaranty DB loading is completed. + * tmp_load_more : Template ID for "load more" message and button. + * + * + *APIs: + * + * create ( void ) + * : API to call _create method. API for AJAX or DB loading callback. + * + * recreate ( Array ) + * : Update extendable list with new data array. For example, update with search result. + * + *Examples: + * + * + * + * + * + *
                  + *
                + * + */ + + +( function ( $, undefined ) { + + //Keeps track of the number of lists per page UID + //This allows support for multiple nested list in the same page + //https://github.com/jquery/jquery-mobile/issues/1617 + var listCountPerPage = {}, + TOTAL_ITEMS = 0, + last_index = 0; + + $.widget( "tizen.extendablelist", $.mobile.widget, { + options: { + theme: "s", + countTheme: "c", + headerTheme: "b", + dividerTheme: "b", + splitIcon: "arrow-r", + splitTheme: "b", + inset: false, + id: "", /* Extendable list UL elemet's ID */ + extenditems: 50, /* Number of append items */ + childSelector: " li", /* To support swipe list */ + dbtable: "", + template : "", /* Template for each list item */ + loadmore : "tmp_load_more", /* Template for "Load more" message */ + scrollview: false, + initSelector: ":jqmData(role='extendablelist')" + }, + + _stylerMouseUp: function () { + $( this ).addClass( "ui-btn-up-s" ); + $( this ).removeClass( "ui-btn-down-s" ); + }, + + _stylerMouseDown: function () { + $( this ).addClass( "ui-btn-down-s" ); + $( this ).removeClass( "ui-btn-up-s" ); + }, + + _stylerMouseOver: function () { + $( this ).toggleClass( "ui-btn-hover-s" ); + }, + + _stylerMouseOut: function () { + $( this ).toggleClass( "ui-btn-hover-s" ); + $( this ).addClass( "ui-btn-up-s" ); + $( this ).removeClass( "ui-btn-down-s" ); + }, + + _pushData: function ( template, data ) { + var o = this.options, + t = this, + i = 0, + dataTable = data, + myTemplate = $( "#" + template ), + loadMoreItems = ( o.extenditems > data.length - last_index ? data.length - last_index : o.extenditems ), + htmlData; + + for (i = 0; i < loadMoreItems; i++ ) { + htmlData = myTemplate.tmpl( dataTable[ i ] ); + $( o.id ).append( $( htmlData ).attr( 'id', 'li_' + i ) ); + + /* Add style */ + $( o.id + ">" + o.childSelector ) + .addClass( "ui-btn-up-s" ) + .bind( "mouseup", t._stylerMouseUp ) + .bind( "mousedown", t._stylerMouseDown ) + .bind( "mouseover", t._stylerMouseOver ) + .bind( "mouseout", t._stylerMouseOut ); + + last_index++; + } + + /* After push data, re-style extendable list widget */ + $( o.id ).trigger( "create" ); + }, + + _loadmore: function ( event ) { + var t = this, + o = event.data, + i = 0, + dataTable = window[ o.dbtable ], + myTemplate = $( "#" + o.template ), + loadMoreItems = ( o.extenditems > dataTable.length - last_index ? dataTable.length - last_index : o.extenditems ), + htmlData, + more_items_to_load, + num_next_load_items; + + /* Remove load more message */ + $( "#load_more_message" ).remove(); + + /* Append More Items */ + for ( i = 0; i < loadMoreItems; i++ ) { + htmlData = myTemplate.tmpl( dataTable[ last_index ] ); + $( o.id ).append( $( htmlData ).attr( 'id', 'li_' + last_index ) ); + last_index++; + } + + /* Append "Load more" message on the last of list */ + if ( TOTAL_ITEMS > last_index ) { + myTemplate = $( "#" + o.loadmore ); + more_items_to_load = TOTAL_ITEMS - last_index; + 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" ) ); + } + + $( o.id ).trigger( "create" ); + $( o.id ).extendablelist( "refresh" ); + }, + + recreate: function ( newArray ) { + var t = this, + o = this.options, + myTemplate, + more_items_to_load, + num_next_load_items, + htmlData; + + $( o.id ).empty(); + + last_index = 0; + TOTAL_ITEMS = newArray.length; + + t._pushData( ( o.template), newArray ); + + /* Append "Load more" message on the last of list */ + if ( TOTAL_ITEMS > last_index ) { + myTemplate = $( "#" + o.loadmore ); + more_items_to_load = TOTAL_ITEMS - last_index; + 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" ) ); + + $( "#load_more_message" ).live( "click", t.options, t._loadmore ); + } else { + /* No more items to load */ + $( "#load_more_message" ).die(); + $( "#load_more_message" ).remove(); + } + + if ( o.childSelector == " ul" ) { + $( o.id + " ul" ).swipelist(); + } + + $( o.id ).extendablelist(); + + t.refresh( true ); + }, + + _initList: function () { + var t = this, + o = this.options, + myTemplate, + more_items_to_load, + num_next_load_items, + htmlData; + + /* After AJAX loading success */ + o.dbtable = t.element.data( "dbtable" ); + + TOTAL_ITEMS = $( window[ o.dbtable ] ).size(); + + /* Make Gen list by template */ + if ( last_index <= 0 ) { + t._pushData( ( o.template ), window[ o.dbtable ] ); + + /* Append "Load more" message on the last of list */ + if ( TOTAL_ITEMS > last_index ) { + myTemplate = $( "#" + o.loadmore ); + more_items_to_load = TOTAL_ITEMS - last_index; + 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" ) ); + + $( "#load_more_message" ).live( "click", t.options, t._loadmore ); + } else { + /* No more items to load */ + $( "#load_more_message" ).die(); + $( "#load_more_message" ).remove(); + } + } + + if ( o.childSelector == " ul" ) { + $( o.id + " ul" ).swipelist(); + } + + $( o.id ).trigger( "create" ); + + t.refresh( true ); + }, + + create: function () { + var o = this.options; + + /* external API for AJAX callback */ + this._create( "create" ); + }, + + _create: function ( event ) { + var t = this, + o = this.options, + $el = this.element; + + // create listview markup + t.element.addClass( function ( i, orig ) { + return orig + " ui-listview ui-extendable-list-container" + ( t.options.inset ? " ui-listview-inset ui-corner-all ui-shadow " : "" ); + }); + + o.id = "#" + $el.attr( "id" ); + + if ( $el.data( "extenditems" ) ) { + o.extenditems = parseInt( $el.data( "extenditems" ), 10 ); + } + + $( o.id ).bind( "pagehide", function (e) { + $( o.id ).empty(); + }); + + /* Scroll view */ + if ( $( ".ui-scrollview-clip" ).size() > 0) { + o.scrollview = true; + } else { + o.scrollview = false; + } + + /* After DB Load complete, Init Extendable list */ + if ( $( o.id ).hasClass( "elLoadSuccess" ) ) { + if ( !$( o.id ).hasClass( "elInitComplete" ) ) { + if ( $el.data( "template" ) ) { + o.template = $el.data( "template" ); + + /* to support swipe list,
              • or
                  can be main node of extendable list. */ + if ( $el.data( "swipelist" ) == true ) { + o.childSelector = " ul"; + } else { + o.shildSelector = " li"; + } + } + + $( o.id ).addClass( "elInitComplete" ); + } + + t._initList(); + } + }, + + destroy : function () { + var o = this.options; + + $( o.id ).empty(); + + TOTAL_ITEMS = 0; + last_index = 0; + + $( "#load_more_message" ).die(); + }, + + _itemApply: function ( $list, item ) { + var $countli = item.find( ".ui-li-count" ); + + if ( $countli.length ) { + item.addClass( "ui-li-has-count" ); + } + + $countli.addClass( "ui-btn-up-" + ( $list.jqmData( "counttheme" ) || this.options.countTheme ) + " ui-btn-corner-all" ); + + // TODO class has to be defined in markup + item.find( "h1, h2, h3, h4, h5, h6" ).addClass( "ui-li-heading" ).end() + .find( "p, dl" ).addClass( "ui-li-desc" ).end() + .find( ">img:eq(0), .ui-link-inherit>img:eq(0)" ).addClass( "ui-li-thumb" ).each(function () { + item.addClass( $( this ).is( ".ui-li-icon" ) ? "ui-li-has-icon" : "ui-li-has-thumb" ); + }).end() + .find( ".ui-li-aside" ).each(function () { + var $this = $( this ); + $this.prependTo( $this.parent() ); //shift aside to front for css float + }); + }, + + _removeCorners: function ( li, which ) { + var top = "ui-corner-top ui-corner-tr ui-corner-tl", + bot = "ui-corner-bottom ui-corner-br ui-corner-bl"; + + li = li.add( li.find( ".ui-btn-inner, .ui-li-link-alt, .ui-li-thumb" ) ); + + if ( which === "top" ) { + li.removeClass( top ); + } else if ( which === "bottom" ) { + li.removeClass( bot ); + } else { + li.removeClass( top + " " + bot ); + } + }, + + _refreshCorners: function ( create ) { + var $li, + $visibleli, + $topli, + $bottomli; + + if ( this.options.inset ) { + $li = this.element.children( "li" ); + // at create time the li are not visible yet so we need to rely on .ui-screen-hidden + $visibleli = create ? $li.not( ".ui-screen-hidden" ) : $li.filter( ":visible" ); + + this._removeCorners( $li ); + + // Select the first visible li element + $topli = $visibleli.first() + .addClass( "ui-corner-top" ); + + $topli.add( $topli.find( ".ui-btn-inner" ) ) + .find( ".ui-li-link-alt" ) + .addClass( "ui-corner-tr" ) + .end() + .find( ".ui-li-thumb" ) + .not( ".ui-li-icon" ) + .addClass( "ui-corner-tl" ); + + // Select the last visible li element + $bottomli = $visibleli.last() + .addClass( "ui-corner-bottom" ); + + $bottomli.add( $bottomli.find( ".ui-btn-inner" ) ) + .find( ".ui-li-link-alt" ) + .addClass( "ui-corner-br" ) + .end() + .find( ".ui-li-thumb" ) + .not( ".ui-li-icon" ) + .addClass( "ui-corner-bl" ); + } + }, + + refresh: function ( create ) { + this.parentPage = this.element.closest( ".ui-page" ); + this._createSubPages(); + + var o = this.options, + $list = this.element, + self = this, + dividertheme = $list.jqmData( "dividertheme" ) || o.dividerTheme, + listsplittheme = $list.jqmData( "splittheme" ), + listspliticon = $list.jqmData( "spliticon" ), + li = $list.children( "li" ), + counter = $.support.cssPseudoElement || !$.nodeName( $list[ 0 ], "ol" ) ? 0 : 1, + item, + itemClass, + itemTheme, + a, + last, + splittheme, + countParent, + icon, + pos, + numli; + + if ( counter ) { + $list.find( ".ui-li-dec" ).remove(); + } + + for ( pos = 0, numli = li.length; pos < numli; pos++ ) { + item = li.eq( pos ); + itemClass = "ui-li"; + + // If we're creating the element, we update it regardless + if ( create || !item.hasClass( "ui-li" ) ) { + itemTheme = item.jqmData( "theme" ) || o.theme; + a = item.children( "a" ); + + if ( a.length ) { + icon = item.jqmData( "icon" ); + + item.buttonMarkup({ + wrapperEls: "div", + shadow: false, + corners: false, + iconpos: "right", + /* icon: a.length > 1 || icon === false ? false : icon || "arrow-r",*/ + icon: false, /* Remove unnecessary arrow icon */ + theme: itemTheme + }); + + if ( ( icon != false ) && ( a.length == 1 ) ) { + item.addClass( "ui-li-has-arrow" ); + } + + a.first().addClass( "ui-link-inherit" ); + + if ( a.length > 1 ) { + itemClass += " ui-li-has-alt"; + + last = a.last(); + splittheme = listsplittheme || last.jqmData( "theme" ) || o.splitTheme; + + last.appendTo(item) + .attr( "title", last.getEncodedText() ) + .addClass( "ui-li-link-alt" ) + .empty() + .buttonMarkup({ + shadow: false, + corners: false, + theme: itemTheme, + icon: false, + iconpos: false + }) + .find( ".ui-btn-inner" ) + .append( + $( "" ).buttonMarkup( { + shadow : true, + corners : true, + theme : splittheme, + iconpos : "notext", + icon : listspliticon || last.jqmData( "icon" ) || o.splitIcon + }) + ); + } + } else if ( item.jqmData( "role" ) === "list-divider" ) { + + itemClass += " ui-li-divider ui-btn ui-bar-" + dividertheme; + item.attr( "role", "heading" ); + + //reset counter when a divider heading is encountered + if ( counter ) { + counter = 1; + } + + } else { + itemClass += " ui-li-static ui-body-" + itemTheme; + } + } + + if ( counter && itemClass.indexOf( "ui-li-divider" ) < 0 ) { + countParent = item.is( ".ui-li-static:first" ) ? item : item.find( ".ui-link-inherit" ); + + countParent.addClass( "ui-li-jsnumbering" ) + .prepend( "" + (counter++) + ". " ); + } + + item.add( item.children( ".ui-btn-inner" ) ).addClass( itemClass ); + + self._itemApply( $list, item ); + } + + this._refreshCorners( create ); + }, + + //create a string for ID/subpage url creation + _idStringEscape: function ( str ) { + return str.replace(/\W/g , "-"); + + }, + + _createSubPages: function () { + var parentList = this.element, + parentPage = parentList.closest( ".ui-page" ), + parentUrl = parentPage.jqmData( "url" ), + parentId = parentUrl || parentPage[ 0 ][ $.expando ], + parentListId = parentList.attr( "id" ), + o = this.options, + dns = "data-" + $.mobile.ns, + self = this, + persistentFooterID = parentPage.find( ":jqmData(role='footer')" ).jqmData( "id" ), + hasSubPages, + newRemove; + + if ( typeof listCountPerPage[ parentId ] === "undefined" ) { + listCountPerPage[ parentId ] = -1; + } + + parentListId = parentListId || ++listCountPerPage[ parentId ]; + + $( parentList.find( "li>ul, li>ol" ).toArray().reverse() ).each(function ( i ) { + var self = this, + list = $( this ), + listId = list.attr( "id" ) || parentListId + "-" + i, + parent = list.parent(), + nodeEls, + 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, + newPage, + anchor; + + nodeEls = $( list.prevAll().toArray().reverse() ); + nodeEls = nodeEls.length ? nodeEls : $( "" + $.trim(parent.contents()[ 0 ].nodeValue) + "" ); + + //define hasSubPages for use in later removal + hasSubPages = true; + + newPage = list.detach() + .wrap( "
                  " ) + .parent() + .before( "
                  " + title + "
                  " ) + .after( persistentFooterID ? $( "
                  " ) : "" ) + .parent() + .appendTo( $.mobile.pageContainer ); + + newPage.page(); + + anchor = parent.find('a:first'); + + if ( !anchor.length ) { + anchor = $( "" ).html( nodeEls || title ).prependTo( parent.empty() ); + } + + anchor.attr( "href", "#" + id ); + + }).extendablelist(); + + // on pagehide, remove any nested pages along with the parent page, as long as they aren't active + // and aren't embedded + if ( hasSubPages && + parentPage.is( ":jqmData(external-page='true')" ) && + parentPage.data( "page" ).options.domCache === false ) { + + newRemove = function ( e, ui ) { + var nextPage = ui.nextPage, npURL; + + if ( ui.nextPage ) { + npURL = nextPage.jqmData( "url" ); + if ( npURL.indexOf( parentUrl + "&" + $.mobile.subPageUrlKey ) !== 0 ) { + self.childPages().remove(); + parentPage.remove(); + } + } + }; + + // unbind the original page remove and replace with our specialized version + parentPage + .unbind( "pagehide.remove" ) + .bind( "pagehide.remove", newRemove); + } + }, + + // TODO sort out a better way to track sub pages of the extendable listview this is brittle + childPages: function () { + var parentUrl = this.parentPage.jqmData( "url" ); + + return $( ":jqmData(url^='" + parentUrl + "&" + $.mobile.subPageUrlKey + "')" ); + } + }); + + //auto self-init widgets + $( document ).bind( "pagecreate create", function ( e ) { + $( $.tizen.extendablelist.prototype.options.initSelector, e.target ).extendablelist(); + }); + +}( jQuery )); diff --git a/src/widgets/handler/js/jquery.tizen.scrollview.handler.js b/src/widgets/handler/js/jquery.tizen.scrollview.handler.js new file mode 100755 index 0000000..fc93e9a --- /dev/null +++ b/src/widgets/handler/js/jquery.tizen.scrollview.handler.js @@ -0,0 +1,269 @@ +/* *************************************************************************** + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * *************************************************************************** + * + * Authors: Wonseop Kim ( wonseop.kim@samsung.com ) +*/ + +/** + * ‘Handler’ is a widget helping a user to scroll a window or panel. + * It is different from the scrollview feature in that the handler has a fixed size + * and disappears when a scroll size is smaller than a parent window's size. + * If the handler widget is activated, a scroll bar on the screen will be deactivated. + * The handler widget supports scrolling up and down and indicates the position of the scrolled window. + * + * HTML Attributes: + * + * data-handler : This attribute is indicating that whether enable. + * If you want to use, you will set 'true'. + * data-handlertheme : Set the widget theme ( optional ) + * + * APIs: + * + * enableHandler ( boolean ) + * : Get or set the use of Handler. + * If the value is ‘true’, it will be run Handler. + * If the value is ‘false’, it will be not run Handler. + * If no value is specified, will act as a getter. + * + * Events: + * + * Examples: + * + * + */ + +( function ( $, document, undefined ) { + // The options of handler in scrollview + $.tizen.scrollview.prototype.options.handler = false; + $.tizen.scrollview.prototype.options.handlerTheme = "s"; + + $.extend( $.tizen.scrollview.prototype, { + enableHandler : function ( enabled ) { + if ( typeof enabled === 'undefined' ) { + return this.options.handler; + } + + this.options.handler = !!enabled; + + var view = this.element; + if ( this.options.handler ) { + view.find( ".ui-scrollbar" ).hide(); + view.find( ".ui-handler" ).show(); + } else { + view.find( ".ui-handler" ).hide(); + view.find( ".ui-scrollbar" ).show(); + } + }, + _handlerTimer : 0 + }); + + $( document ).delegate( ":jqmData(scroll)", "scrollviewcreate", function () { + if ( $( this ).attr( "data-" + $.mobile.ns + "scroll" ) === "none" ) { + return; + } + + var self = this, + $this = $( this ), + scrollview = $this.data( "scrollview" ), + prefix = "
                  ", + direction = scrollview.options.direction, + isHorizontal = ( scrollview.options.direction === "x" ), + _$view = scrollview._$view, + _$clip = scrollview._$clip, + handler = null, + handlerThumb = null, + viewLength = 0, + clipLength = 0, + handlerHeight = 0, + handlerMargin = 0, + trackLength = 0, + isTouchable = $.support.touch, + dragStartEvt = ( isTouchable ? "touchstart" : "mousedown" ) + ".handler", + dragMoveEvtDefault = ( isTouchable ? "touchmove" : "mousemove" ), + dragMoveEvt = dragMoveEvtDefault + ".handler", + dragStopEvt = ( isTouchable ? "touchend" : "mouseup" ) + ".handler"; + + if ( $this.find( ".ui-handler-thumb" ).length !== 0 || typeof direction !== "string" ) { + return; + } + + $this.append( prefix + direction + suffix ); + handler = $this.find( ".ui-handler" ); + handlerThumb = $this.find( ".ui-handler-thumb" ).hide(); + handlerHeight = ( isHorizontal ? handlerThumb.width() : handlerThumb.height() ); + handlerMargin = ( isHorizontal ? parseInt( handler.css( "right" ), 10 ) : parseInt( handler.css( "bottom" ), 10 ) ); + + scrollview.enableHandler( scrollview.options.handler ); + + $.extend( self, { + moveData : null + }); + + // handler drag + handlerThumb.bind( dragStartEvt, { + e : handlerThumb + }, function ( event ) { + scrollview._stopMScroll(); + + var target = event.data.e, t = ( isTouchable ? event.originalEvent.targetTouches[0] : event ); + + self.moveData = { + target : target, + X : parseInt( target.css( 'left' ), 10 ) || 0, + Y : parseInt( target.css( 'top' ), 10 ) || 0, + pX : t.pageX, + pY : t.pageY + }; + clipLength = ( isHorizontal ? _$clip.width() : _$clip.height() ); + viewLength = ( isHorizontal ? _$view.outerWidth( true ) : _$view.outerHeight( true ) ) - clipLength; + trackLength = clipLength - handlerHeight - handlerMargin; + + _$view.trigger( "scrollstart" ); + event.preventDefault(); + event.stopPropagation(); + + $( document ).bind( dragMoveEvt, function ( event ) { + var moveData = self.moveData, + handlePos = 0, + scrollPos = 0, + t = ( isTouchable ? event.originalEvent.targetTouches[0] : event ); + + handlePos = ( isHorizontal ? moveData.X + t.pageX - moveData.pX : moveData.Y + t.pageY - moveData.pY ); + + if ( handlePos < 0 ) { + handlePos = 0; + } + + if ( handlePos > trackLength ) { + handlePos = trackLength; + } + scrollPos = - Math.round( handlePos / trackLength * viewLength ); + + $this.attr( "display", "none" ); + if ( isHorizontal ) { + scrollview._setScrollPosition( scrollPos, 0 ); + moveData.target.css( { + left : handlePos + }); + } else { + scrollview._setScrollPosition( 0, scrollPos ); + moveData.target.css( { + top : handlePos + }); + } + $this.attr( "display", "inline" ); + + event.preventDefault(); + event.stopPropagation(); + }).bind( dragStopEvt, function ( event ) { + $( document ).unbind( dragMoveEvt ).unbind( dragStopEvt ); + + self.moveData = null; + _$view.trigger( "scrollstop" ); + + event.preventDefault(); + }); + }); + + $( document ).bind( dragMoveEvtDefault, function ( event ) { + var isVisible = false, + vclass = "ui-scrollbar-visible"; + + if ( scrollview._$vScrollBar ) { + isVisible = scrollview._$vScrollBar.hasClass( vclass ); + } else if ( scrollview._$hScrollBar ) { + isVisible = scrollview._$hScrollBar.hasClass( vclass ); + } + + if ( isVisible || self.moveData !== null ) { + if ( handlerThumb.hasClass( "ui-handler-visible" ) ) { + _$view.trigger( "scrollupdate" ); + } else { + _$view.trigger( "scrollstart" ); + } + } + }); + + $this.bind( "scrollstart", function ( event ) { + if ( !scrollview.enableHandler() ) { + return; + } + clipLength = ( isHorizontal ? _$clip.width() : _$clip.height() ); + viewLength = ( isHorizontal ? _$view.outerWidth( true ) : _$view.outerHeight( true ) ) - clipLength; + trackLength = clipLength - handlerHeight - handlerMargin; + + if ( clipLength > viewLength || trackLength < ( handlerHeight * 4 / 3 ) ) { + return; + } + + handlerThumb.addClass( "ui-handler-visible" ); + handlerThumb.stop().fadeIn( 'fast' ); + + event.preventDefault(); + event.stopPropagation(); + }).bind( "scrollupdate", function ( event, data ) { + if ( !scrollview.enableHandler() || clipLength > viewLength || trackLength < ( handlerHeight * 4 / 3 ) ) { + return; + } + + var scrollPos = scrollview.getScrollPosition(), handlerPos = 0; + + handlerThumb.stop( true, true ).hide().css( "opacity", 1.0 ); + + if ( isHorizontal ) { + handlerPos = Math.round( scrollPos.x / viewLength * trackLength ); + handlerThumb.css( "left", handlerPos ); + } else { + handlerPos = Math.round( scrollPos.y / viewLength * trackLength ); + handlerThumb.css( "top", handlerPos ); + } + + handlerThumb.show(); + + event.preventDefault(); + event.stopPropagation(); + }).bind( "scrollstop", function ( event ) { + if ( !scrollview.enableHandler() || clipLength > viewLength ) { + return; + } + + scrollview._handlerTimer = setTimeout( function () { + if ( scrollview._timerID === 0 && self.moveData === null ) { + handlerThumb.removeClass( "ui-handler-visible" ); + handlerThumb.stop( true, true ).fadeOut( 'fast' ); + clearTimeout( scrollview._handlerTimer ); + scrollview._handlerTimer = 0; + } + }, 1000 ); + + event.preventDefault(); + }); + }); +} ( jQuery, document ) ); diff --git a/src/widgets/hsvpicker/css/hsvpicker.css b/src/widgets/hsvpicker/css/hsvpicker.css new file mode 100644 index 0000000..949f565 --- /dev/null +++ b/src/widgets/hsvpicker/css/hsvpicker.css @@ -0,0 +1,45 @@ +.ui-hsvpicker .hsvpicker-clrchannel-container .hsvpicker-clrchannel-masks-container .sat-gradient { + background: rgb(255,0,0); /* Old browsers */ + background: -webkit-gradient(linear, left top, right top, + color-stop( 0%,rgba(255,255,255,1)), + color-stop(100%,rgba(255,255,255,0))); /* Chrome,Safari4+ */ + background: -moz-linear-gradient(left, + rgba(255,255,255,1) 0%, + rgba(255,255,255,0) 100%); + background: -webkit-linear-gradient(left, + rgba(255,255,255,1) 0%, + rgba(255,255,255,0) 100%); + background: -o-linear-gradient(left, + rgba(255,255,255,1) 0%, + rgba(255,255,255,0) 100%); + background: -ms-linear-gradient(left, + rgba(255,255,255,1) 0%, + rgba(255,255,255,0) 100%); + background: linear-gradient(left, + rgba(255,255,255,1) 0%, + rgba(255,255,255,0) 100%); + filter: progid:DXImageTransform.Microsoft.gradient (startColorstr='#ffffff', endColorstr="#00ffffff", GradientType = 1); +} + +.ui-hsvpicker .hsvpicker-clrchannel-container .hsvpicker-clrchannel-masks-container .val-gradient { + background: rgb(255,0,0); /* Old browsers */ + background: -webkit-gradient(linear, left top, right top, + color-stop( 0%,rgba(0,0,0,1)), + color-stop(100%,rgba(0,0,0,0))); /* Chrome,Safari4+ */ + background: -moz-linear-gradient(left, + rgba(0,0,0,1) 0%, + rgba(0,0,0,0) 100%); + background: -webkit-linear-gradient(left, + rgba(0,0,0,1) 0%, + rgba(0,0,0,0) 100%); + background: -o-linear-gradient(left, + rgba(0,0,0,1) 0%, + rgba(0,0,0,0) 100%); + background: -ms-linear-gradient(left, + rgba(0,0,0,1) 0%, + rgba(0,0,0,0) 100%); + background: linear-gradient(left, + rgba(0,0,0,1) 0%, + rgba(0,0,0,0) 100%); + filter: progid:DXImageTransform.Microsoft.gradient (startColorstr='#000000', endColorstr="#00000000", GradientType = 1); +} diff --git a/src/widgets/hsvpicker/js/jquery.mobile.tizen.hsvpicker.js b/src/widgets/hsvpicker/js/jquery.mobile.tizen.hsvpicker.js new file mode 100755 index 0000000..70773ae --- /dev/null +++ b/src/widgets/hsvpicker/js/jquery.mobile.tizen.hsvpicker.js @@ -0,0 +1,241 @@ +/* + * jQuery Mobile Widget @VERSION + * + * This software is licensed under the MIT licence (as defined by the OSI at + * http://www.opensource.org/licenses/mit-license.php) + * + * *************************************************************************** + * Copyright (C) 2011 by Intel Corporation Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software" ), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * *************************************************************************** + * + * Authors: Gabriel Schulhof + */ + +// Displays three sliders that allow the user to select the +// hue, saturation, and value for a color. +// +// To apply, add the attribute data-role="hsvpicker" to a
                  +// element inside a page. Alternatively, call hsvpicker() +// on an element (see below). +// +// Options: +// +// color: String; the initial color can be specified in html using the +// data-color="#ff00ff" attribute or when constructed +// in javascript, eg +// $( "#myhsvpicker" ).hsvpicker({ color: "#ff00ff" }); +// where the html might be : +//
                  +// The color can be changed post-construction like this : +// $( "#myhsvpicker" ).hsvpicker( "option", "color", "#ABCDEF" ); +// Default: "#1a8039" +// +// Events: +// +// colorchanged: Fired when the color is changed. + +(function ( $, undefined ) { + + $.widget( "tizen.hsvpicker", $.tizen.colorwidget, { + options: { + initSelector: ":jqmData(role='hsvpicker')" + }, + + _htmlProto: { + ui: { + container: "#hsvpicker", + hue: { + eventSource: "[data-event-source='hue']", + selector: "#hsvpicker-hue-selector", + hue: "#hsvpicker-hue-hue", + valMask: "#hsvpicker-hue-mask-val" + }, + sat: { + gradient: "#hsvpicker-sat-gradient", + eventSource: "[data-event-source='sat']", + selector: "#hsvpicker-sat-selector", + hue: "#hsvpicker-sat-hue", + valMask: "#hsvpicker-sat-mask-val" + }, + val: { + gradient: "#hsvpicker-val-gradient", + eventSource: "[data-event-source='val']", + selector: "#hsvpicker-val-selector", + hue: "#hsvpicker-val-hue" + } + } + }, + + _create: function () { + var self = this, + chan, + hsvIdx, + max, + step; + + this.element + .css( "display", "none" ) + .after( this._ui.container ); + + this._ui.hue.hue.huegradient(); + + $.extend( this, { + dragging_hsv: [ 0, 0, 0], + selectorDraggingOffset: { + x : -1, + y : -1 + }, + dragging: -1 + } ); + + this._ui.container.find( ".hsvpicker-arrow-btn" ) + .buttonMarkup() + .bind( "vclick", function ( e ) { + chan = $( this).attr( "data-" + ( $.mobile.ns || "" ) + "target" ); + hsvIdx = ( "hue" === chan ) ? 0 : + ( "sat" === chan) ? 1 : 2; + max = ( 0 == hsvIdx ? 360 : 1 ); + step = 0.05 * max; + + self.dragging_hsv[hsvIdx] = self.dragging_hsv[hsvIdx] + step * ( "left" === $( this ).attr( "data-" + ( $.mobile.ns || "" ) + "location" ) ? -1 : 1); + self.dragging_hsv[hsvIdx] = Math.min( max, Math.max( 0.0, self.dragging_hsv[hsvIdx] ) ); + self._updateSelectors( self.dragging_hsv ); + } ); + + $( document ) + .bind( "vmousemove", function ( event ) { + if ( self.dragging != -1 ) { + event.stopPropagation(); + event.preventDefault(); + } + } ) + .bind( "vmouseup", function ( event ) { + self.dragging = -1; + } ); + + this._bindElements( "hue", 0 ); + this._bindElements( "sat", 1 ); + this._bindElements( "val", 2 ); + }, + + _bindElements: function ( chan, idx ) { + var self = this; + this._ui[chan].selector + .bind( "mousedown vmousedown", function ( e ) { self._handleMouseDown( chan, idx, e, true ); } ) + .bind( "vmousemove touchmove", function ( e ) { self._handleMouseMove( chan, idx, e, true ); } ) + .bind( "vmouseup", function ( e ) { self.dragging = -1; } ); + this._ui[chan].eventSource + .bind( "mousedown vmousedown", function ( e ) { self._handleMouseDown( chan, idx, e, false ); } ) + .bind( "vmousemove touchmove", function ( e ) { self._handleMouseMove( chan, idx, e, false ); } ) + .bind( "vmouseup", function ( e ) { self.dragging = -1; } ); + }, + + _handleMouseDown: function ( chan, idx, e, isSelector ) { + var coords = $.mobile.tizen.targetRelativeCoordsFromEvent( e ), + widgetStr = ( isSelector ? "selector" : "eventSource" ); + + if ( coords.x >= 0 && coords.x <= this._ui[chan][widgetStr].outerWidth() && + coords.y >= 0 && coords.y <= this._ui[chan][widgetStr].outerHeight() ) { + + this.dragging = idx; + + if ( isSelector ) { + this.selectorDraggingOffset.x = coords.x; + this.selectorDraggingOffset.y = coords.y; + } + + this._handleMouseMove( chan, idx, e, isSelector, coords ); + } + }, + + _handleMouseMove: function ( chan, idx, e, isSelector, coords ) { + if ( this.dragging === idx ) { + coords = ( coords || $.mobile.tizen.targetRelativeCoordsFromEvent( e ) ); + + var factor = ( ( 0 === idx ) ? 360 : 1 ), + potential = ( isSelector + ? ( ( this.dragging_hsv[idx] / factor) + + ( ( coords.x - this.selectorDraggingOffset.x ) / this._ui[chan].eventSource.width() ) ) + : ( coords.x / this._ui[chan].eventSource.width() ) ); + + this.dragging_hsv[idx] = Math.min( 1.0, Math.max( 0.0, potential ) ) * factor; + + if ( !isSelector ) { + this.selectorDraggingOffset.x = Math.ceil( this._ui[chan].selector.outerWidth() / 2.0 ); + this.selectorDraggingOffset.y = Math.ceil( this._ui[chan].selector.outerHeight() / 2.0 ); + } + + this._updateSelectors( this.dragging_hsv ); + e.stopPropagation(); + e.preventDefault(); + } + }, + + _updateSelectors: function ( hsv ) { + var clrlib = $.tizen.colorwidget.clrlib, + clrwidget = $.tizen.colorwidget.prototype, + clr = clrlib.HSVToHSL( hsv ), + hclr = clrlib.HSVToHSL( [hsv[0], 1.0, 1.0] ), + vclr = clrlib.HSVToHSL( [hsv[0], hsv[1], 1.0] ); + + this._ui.hue.selector.css( { left : this._ui.hue.eventSource.width() * hsv[0] / 360} ); + clrwidget._setElementColor.call( this, this._ui.hue.selector, clr, "background" ); + if ( $.mobile.browser.ie ) { + this._ui.hue.hue.find( "*" ).css( "opacity", hsv[1] ); + } else { + this._ui.hue.hue.css( "opacity", hsv[1] ); + } + + this._ui.hue.valMask.css( "opacity", 1.0 - hsv[2] ); + + this._ui.sat.selector.css( { left : this._ui.sat.eventSource.width() * hsv[1]} ); + clrwidget._setElementColor.call( this, this._ui.sat.selector, clr, "background" ); + clrwidget._setElementColor.call( this, this._ui.sat.hue, hclr, "background" ); + this._ui.sat.valMask.css( "opacity", 1.0 - hsv[2] ); + + this._ui.val.selector.css( { left : this._ui.val.eventSource.width() * hsv[2]} ); + clrwidget._setElementColor.call( this, this._ui.val.selector, clr, "background" ); + clrwidget._setElementColor.call( this, this._ui.val.hue, vclr, "background" ); + clrwidget._setColor.call( this, clrlib.RGBToHTML( clrlib.HSLToRGB(clr) ) ); + }, + + _setDisabled: function ( value ) { + $.tizen.widgetex.prototype._setDisabled.call( this, value ); + this._ui.container[value ? "addClass" : "removeClass"]( "ui-disabled" ); + this._ui.hue.hue.huegradient( "option", "disabled", value ); + $.tizen.colorwidget.prototype._displayDisabledState.call( this, this._ui.container ); + }, + + _setColor: function ( clr ) { + if ( $.tizen.colorwidget.prototype._setColor.call( this, clr ) ) { + this.dragging_hsv = $.tizen.colorwidget.clrlib.RGBToHSV( $.tizen.colorwidget.clrlib.HTMLToRGB( this.options.color ) ); + this._updateSelectors( this.dragging_hsv ); + } + } + } ); + + $( document ).bind( "pagecreate create", function ( e ) { + $( $.tizen.hsvpicker.prototype.options.initSelector, e.target ) + .not( ":jqmData(role='none'), :jqmData(role='nojs')" ) + .hsvpicker(); + } ); + +}( jQuery ) ); \ No newline at end of file diff --git a/src/widgets/hsvpicker/less/hsvpicker.less b/src/widgets/hsvpicker/less/hsvpicker.less new file mode 100644 index 0000000..687f792 --- /dev/null +++ b/src/widgets/hsvpicker/less/hsvpicker.less @@ -0,0 +1,82 @@ +@hsvpicker-clrchannel-masks-width: 300px; +@hsvpicker-clrchannel-masks-height: 38px; +@hsvpicker-clrchannel-selector-width: 10px; +@hsvpicker-clrchannel-selector-height: 50px; +@hsvpicker-clrchannel-selector-border-width: 5px; +@hsvpicker-clrchannel-masks-container-hpadding: 12px; +@hsvpicker-clrchannel-masks-container-vpadding: 16px; + +@hsvpicker-clrchannel-selector-actual-height: @hsvpicker-clrchannel-selector-height - + 2 * @hsvpicker-clrchannel-selector-border-width; + +@hsvpicker-clrchannel-masks-container-actual-hpadding: + @hsvpicker-clrchannel-selector-width / 2 + + @hsvpicker-clrchannel-selector-border-width; +@hsvpicker-clrchannel-masks-container-actual-vpadding: + (@hsvpicker-clrchannel-selector-actual-height - @hsvpicker-clrchannel-masks-height) / 2 + + @hsvpicker-clrchannel-selector-border-width; +@hsvpicker-clrchannel-masks-container-hmargin: + ~`Math.max(0, + (parseInt("@{hsvpicker-clrchannel-masks-container-hpadding}") - + parseInt("@{hsvpicker-clrchannel-masks-container-actual-hpadding}"))) + "px"`; +@hsvpicker-clrchannel-masks-container-vmargin: + ~`Math.max(0, + (parseInt("@{hsvpicker-clrchannel-masks-container-vpadding}") - + parseInt("@{hsvpicker-clrchannel-masks-container-actual-vpadding}"))) + "px"`; + +.ui-hsvpicker { + .hsvpicker-clrchannel-container { + display: table; + padding-left: 27px; + padding-right: 27px; + + .hsvpicker-arrow-btn-container { + display: table-cell; + vertical-align: middle; + } + + .hsvpicker-arrow-btn { + float: left; + } + + .hsvpicker-clrchannel-masks-container { + float: left; + position: relative; + width: @hsvpicker-clrchannel-masks-width; + height: @hsvpicker-clrchannel-masks-height; + + margin-left: @hsvpicker-clrchannel-masks-container-hmargin; + margin-right: @hsvpicker-clrchannel-masks-container-hmargin; + margin-top: @hsvpicker-clrchannel-masks-container-vmargin; + margin-bottom: @hsvpicker-clrchannel-masks-container-vmargin; + + padding-left: @hsvpicker-clrchannel-masks-container-actual-hpadding; + padding-right: @hsvpicker-clrchannel-masks-container-actual-hpadding; + padding-top: @hsvpicker-clrchannel-masks-container-actual-vpadding; + padding-bottom: @hsvpicker-clrchannel-masks-container-actual-vpadding; + + .hsvpicker-clrchannel-mask { + position: absolute; + width: @hsvpicker-clrchannel-masks-width; + height: @hsvpicker-clrchannel-masks-height; + } + + .hsvpicker-clrchannel-mask-black { + background: #000000; + } + + .hsvpicker-clrchannel-mask-white { + background: #ffffff; + } + + .hsvpicker-clrchannel-selector { + position: absolute; + left: 0px; + top: 0px; + width: @hsvpicker-clrchannel-selector-width; + height: @hsvpicker-clrchannel-selector-actual-height; + border: @hsvpicker-clrchannel-selector-border-width solid black; + } + } + } +} diff --git a/src/widgets/hsvpicker/proto-html/hsvpicker.prototype.html b/src/widgets/hsvpicker/proto-html/hsvpicker.prototype.html new file mode 100755 index 0000000..4a527ae --- /dev/null +++ b/src/widgets/hsvpicker/proto-html/hsvpicker.prototype.html @@ -0,0 +1,44 @@ +
                  +
                  +
                  + +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  + +
                  +
                  +
                  +
                  + +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  + +
                  +
                  +
                  +
                  + +
                  +
                  +
                  +
                  +
                  +
                  +
                  +
                  + +
                  +
                  +
                  diff --git a/src/widgets/imageslider/js/jquery.mobile.tizen.imageslider.js b/src/widgets/imageslider/js/jquery.mobile.tizen.imageslider.js new file mode 100755 index 0000000..b35f8ba --- /dev/null +++ b/src/widgets/imageslider/js/jquery.mobile.tizen.imageslider.js @@ -0,0 +1,589 @@ +/* *************************************************************************** + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * *************************************************************************** + * + * Author: Minkyu Kang + */ + +/* + * Imageslider widget + * + * HTML Attributes + * + * data-role: set to 'imageslider' + * data-index: start index + * data-vertical-align: set to top or middle or bottom. + * + * APIs + * + * add(file): add the image (parameter: url of iamge) + * delete(index): delete the image (parameter: index of image) + * refresh(index): refresh the widget, should be called after add or del. (parameter: start index) + * + * Events + * + * N/A + * + * Example + * + *
                  + * + * + * + * + * + *
                  + * + * + * $('#imageslider-add').bind('vmouseup', function ( e ) { + * $('#imageslider').imageslider('add', '9.jpg'); + * $('#imageslider').imageslider('add', '10.jpg'); + * $('#imageslider').imageslider('refresh'); + * }); + * + * $('#imageslider-del').bind('vmouseup', function ( e ) { + * $('#imageslider').imageslider('delete'); + * }); + * + */ + +(function ( $, window, undefined ) { + $.widget( "tizen.imageslider", $.mobile.widget, { + options: { + flicking: false, + duration: 500 + }, + + dragging: false, + moving: false, + max_width: 0, + max_height: 0, + org_x: 0, + org_time: null, + cur_img: null, + prev_img: null, + next_img: null, + images: [], + images_hold: [], + index: 0, + align_type: null, + direction: 1, + container: null, + loader: [], + + _resize: function ( index ) { + var img = this.images[index], + width = this.images[index].width(), + height = this.images[index].height(), + margin = 0, + ratio, + img_max_width = this.max_width - margin, + img_max_height = this.max_height - margin; + + ratio = height / width; + + if ( width > img_max_width ) { + img.width( img_max_width ); + img.height( img_max_width * ratio ); + } + + height = img.height(); + + if ( height > img_max_height ) { + img.height( img_max_height ); + img.width( img_max_height / ratio ); + } + }, + + _align: function ( index, obj ) { + var img = this.images[index], + img_top = 0; + + if ( !obj.length ) { + return; + } + + if ( this.align_type == "middle" ) { + img_top = ( this.max_height - img.height() ) / 2; + } else if ( this.align_type == "bottom" ) { + img_top = this.max_height - img.height(); + } else { + img_top = 0; + } + + obj.css( 'top', img_top + 'px' ); + }, + + _attach: function ( index, obj ) { + var self = this, + processing = function () { + self._resize( index ); + self._align( index, obj ); + }; + + if ( !obj.length ) { + return; + } + if ( index < 0 ) { + return; + } + if ( index >= this.images.length ) { + return; + } + + obj.css( "display", "block" ); + obj.append( this.images[index] ); + + if ( this.images[index].height() ) { + processing(); + } else { + this.loader[index] = setInterval( function () { + if ( !self.images[index].height() ) { + return; + } + + processing(); + clearInterval( self.loader[index] ); + }, 10); + } + }, + + _detach: function ( index, obj ) { + if ( !obj.length ) { + return; + } + if ( index < 0 ) { + return; + } + if ( index >= this.images.length ) { + return; + } + + obj.css( "display", "none" ); + this.images[index].removeAttr("style"); + this.images[index].detach(); + + clearInterval( this.loader[index] ); + }, + + _drag: function ( _x ) { + var delta, + coord_x; + + if ( !this.dragging ) { + return; + } + + if ( this.options.flicking === false ) { + delta = this.org_x - _x; + + // first image + if ( delta < 0 && !this.prev_img.length ) { + return; + } + // last image + if ( delta > 0 && !this.next_img.length ) { + return; + } + } + + coord_x = _x - this.org_x; + + this.cur_img.css( 'left', coord_x + 'px' ); + if ( this.next_img.length ) { + this.next_img.css( 'left', coord_x + this.window_width + 'px' ); + } + if ( this.prev_img.length ) { + this.prev_img.css( 'left', coord_x - this.window_width + 'px' ); + } + }, + + _move: function ( _x ) { + var delta = this.org_x - _x, + flip = 0, + drag_time, + sec, + self; + + if ( delta == 0 ) { + return; + } + + if ( delta > 0 ) { + flip = delta < ( this.max_width * 0.45 ) ? 0 : 1; + } else { + flip = -delta < ( this.max_width * 0.45 ) ? 0 : 1; + } + + if ( !flip ) { + drag_time = Date.now() - this.org_time; + + if ( Math.abs( delta ) / drag_time > 1 ) { + flip = 1; + } + } + + if ( flip ) { + if ( delta > 0 && this.next_img.length ) { + /* next */ + this._detach( this.index - 1, this.prev_img ); + + this.prev_img = this.cur_img; + this.cur_img = this.next_img; + this.next_img = this.next_img.next(); + + this.index++; + + if ( this.next_img.length ) { + this.next_img.css( 'left', this.window_width + 'px' ); + this._attach( this.index + 1, this.next_img ); + } + + this.direction = 1; + + } else if ( delta < 0 && this.prev_img.length ) { + /* prev */ + this._detach( this.index + 1, this.next_img ); + + this.next_img = this.cur_img; + this.cur_img = this.prev_img; + this.prev_img = this.prev_img.prev(); + + this.index--; + + if ( this.prev_img.length ) { + this.prev_img.css( 'left', -this.window_width + 'px' ); + this._attach( this.index - 1, this.prev_img ); + } + + this.direction = -1; + } + } + + sec = this.options.duration; + self = this; + + this.moving = true; + + setTimeout( function () { + self.moving = false; + }, sec - 50 ); + + this.cur_img.animate( { left: 0 }, sec ); + if ( this.next_img.length ) { + this.next_img.animate( { left: this.window_width }, sec ); + } + if ( this.prev_img.length ) { + this.prev_img.animate( { left: -this.window_width }, sec ); + } + }, + + _add_event: function () { + var self = this, + date; + + this.container.bind( 'vmousemove', function ( e ) { + e.preventDefault(); + + if ( self.moving ) { + return; + } + if ( !self.dragging ) { + return; + } + + self._drag( e.pageX ); + } ); + + this.container.bind( 'vmousedown', function ( e ) { + e.preventDefault(); + + if ( self.moving ) { + return; + } + + self.dragging = true; + + self.org_x = e.pageX; + + self.org_time = Date.now(); + } ); + + this.container.bind( 'vmouseup', function ( e ) { + if ( self.moving ) { + return; + } + + self.dragging = false; + + self._move( e.pageX ); + } ); + + this.container.bind( 'vmouseout', function ( e ) { + if ( self.moving ) { + return; + } + if ( !self.dragging ) { + return; + } + + if ( ( e.pageX < 20 ) || + ( e.pageX > ( self.max_width - 20 ) ) ) { + self._move( e.pageX ); + self.dragging = false; + } + } ); + }, + + _del_event: function () { + this.container.unbind( 'vmousemove' ); + this.container.unbind( 'vmousedown' ); + this.container.unbind( 'vmouseup' ); + this.container.unbind( 'vmouseout' ); + }, + + _show: function () { + /* resizing */ + this.window_width = $( window ).width(); + this.max_width = this._get_width(); + this.max_height = this._get_height(); + this.container.css( 'height', this.max_height ); + + this.cur_img = $( 'div' ).find( '.ui-imageslider-bg:eq(' + this.index + ')' ); + this.prev_img = this.cur_img.prev(); + this.next_img = this.cur_img.next(); + + this._attach( this.index - 1, this.prev_img ); + this._attach( this.index, this.cur_img ); + this._attach( this.index + 1, this.next_img ); + + if ( this.prev_img.length ) { + this.prev_img.css( 'left', -this.window_width + 'px' ); + } + + this.cur_img.css( 'left', '0px' ); + + if ( this.next_img.length ) { + this.next_img.css( 'left', this.window_width + 'px' ); + } + }, + + show: function () { + this._show(); + this._add_event(); + }, + + _hide: function () { + this._detach( this.index - 1, this.prev_img ); + this._detach( this.index, this.cur_img ); + this._detach( this.index + 1, this.next_img ); + }, + + hide: function () { + this._hide(); + this._del_event(); + }, + + _get_width: function () { + var $page = $( this.element ).parentsUntil( 'ui-page' ), + $content = $page.children( '.ui-content' ), + padding = parseFloat( $content.css( 'padding-left' ) ) + + parseFloat( $content.css( 'padding-right' ) ), + content_w = $( window ).width() - padding; + + return content_w; + }, + + _get_height: function () { + var $page = $( this.element ).parentsUntil( 'ui-page' ), + $content = $page.children( '.ui-content' ), + header_h = $page.children( '.ui-header' ).outerHeight() || 0, + footer_h = $page.children( '.ui-footer' ).outerHeight() || 0, + padding = parseFloat( $content.css( 'padding-top' ) ) + + parseFloat( $content.css( 'padding-bottom' ) ), + content_h = $( window ).height() - header_h - footer_h - padding; + + return content_h; + }, + + _create: function () { + var temp_img, + self = this, + index, + i = 0; + + $( this.element ).wrapInner( '
                  ' ); + $( this.element ).find( 'img' ).wrap( '
                  ' ); + + this.container = $( this.element ).find('.ui-imageslider'); + + temp_img = $( 'div' ).find( '.ui-imageslider-bg:first' ); + + while ( temp_img.length ) { + this.images[i] = temp_img.find( 'img' ); + temp_img = temp_img.next(); + i++; + } + + for ( i = 0; i < this.images.length; i++ ) { + this.images[i].detach(); + } + + index = parseInt( $( this.element ).jqmData( 'index' ), 10 ); + if ( !index ) { + index = 0; + } + if ( index < 0 ) { + index = 0; + } + if ( index >= this.images.length ) { + index = this.images.length - 1; + } + + this.index = index; + + this.align_type = $( this.element ).jqmData( 'vertical-align' ); + + $( window ).bind( 'resize', function () { + self.refresh(); + }); + }, + + _update: function () { + var image_file, + bg_html, + temp_img; + + while ( this.images_hold.length ) { + image_file = this.images_hold.shift(); + + bg_html = $( '
                  ' ); + temp_img = $( '
                  ' ); + + bg_html.append( temp_img ); + this.container.append( bg_html ); + this.images.push( temp_img ); + } + }, + + refresh: function ( start_index ) { + this._update(); + + this._hide(); + + if ( start_index === undefined ) { + start_index = this.index; + } + if ( start_index < 0 ) { + start_index = 0; + } + if ( start_index >= this.images.length ) { + start_index = this.images.length - 1; + } + + this.index = start_index; + + this._show(); + }, + + add: function ( file ) { + this.images_hold.push( file ); + }, + + delete: function ( index ) { + var temp_img; + + if ( index === undefined ) { + index = this.index; + } + + if ( index < 0 || index >= this.images.length ) { + return; + } + + if ( index == this.index ) { + temp_img = this.cur_img; + + if ( this.index == 0 ) { + this.direction = 1; + } else if ( this.index == this.images.length - 1 ) { + this.direction = -1; + } + + if ( this.direction < 0 ) { + this.cur_img = this.prev_img; + this.prev_img = this.prev_img.prev(); + if ( this.prev_img.length ) { + this.prev_img.css( 'left', -this.window_width ); + this._attach( index - 2, this.prev_img ); + } + this.index--; + } else { + this.cur_img = this.next_img; + this.next_img = this.next_img.next(); + if ( this.next_img.length ) { + this.next_img.css( 'left', this.window_width ); + this._attach( index + 2, this.next_img ); + } + } + + this.cur_img.animate( { left: 0 }, this.options.duration ); + + } else if ( index == this.index - 1 ) { + temp_img = this.prev_img; + this.prev_img = this.prev_img.prev(); + if ( this.prev_img.length ) { + this.prev_img.css( 'left', -this.window_width ); + this._attach( index - 1, this.prev_img ); + } + this.index--; + + } else if ( index == this.index + 1 ) { + temp_img = this.next_img; + this.next_img = this.next_img.next(); + if ( this.next_img.length ) { + this.next_img.css( 'left', this.window_width ); + this._attach( index + 1, this.next_img ); + } + + } else { + temp_img = $( 'div' ).find( '.ui-imageslider-bg:eq(' + index + ')' ); + } + + this.images.splice( index, 1 ); + temp_img.detach(); + } + }); /* End of widget */ + + // auto self-init widgets + $( document ).bind( "pagecreate", function ( e ) { + $( e.target ).find( ":jqmData(role='imageslider')" ).imageslider(); + }); + + $( document ).bind( "pageshow", function ( e ) { + $( e.target ).find( ":jqmData(role='imageslider')" ).imageslider( 'show' ); + }); + + $( document ).bind( "pagebeforehide", function ( e ) { + $( e.target ).find( ":jqmData(role='imageslider')" ).imageslider( 'hide' ); + } ); + +}( jQuery, this ) ); diff --git a/src/widgets/imageslider/less/imageslider.less b/src/widgets/imageslider/less/imageslider.less new file mode 100644 index 0000000..21b24b8 --- /dev/null +++ b/src/widgets/imageslider/less/imageslider.less @@ -0,0 +1,12 @@ +@import "config.less"; + +.ui-imageslider { + position: relative; + width: 100%; +} + +.ui-imageslider-bg { + position: absolute; + text-align: center; + width: 100%; +} diff --git a/src/widgets/layout-box/js/layout-box.js b/src/widgets/layout-box/js/layout-box.js new file mode 100755 index 0000000..5eb6065 --- /dev/null +++ b/src/widgets/layout-box/js/layout-box.js @@ -0,0 +1,149 @@ +/* + * jQuery Mobile Widget @VERSION + * + * This software is licensed under the MIT licence (as defined by the OSI at + * http://www.opensource.org/licenses/mit-license.php) + * + * *************************************************************************** + * Copyright (C) 2011 by Intel Corporation Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * *************************************************************************** + * + * Authors: Elliot Smith + */ + +// Horizontal/vertical box layout extension. +// +// This will arrange the child elements of a container in a horizontal +// or vertical row. This only makes sense if your container is a div +// and contains children which are also divs; the children should +// also have a height and width set in CSS, otherwise the layout +// manager won't know what to do with them. +// +// Apply it by setting data-layout="hbox" or data-layout="vbox" (vertical +// on a container element or calling $(element).layouthbox() or +// $(element).layoutvbox(). +// +// Usually, you would use a div as the container to get the right effect +// (an element with display:block). +// +// Options can be set programmatically: +// +// $(element).layouthbox('option', 'scrollable', false) +// $(element).layoutvbox('option', 'scrollable', false) +// +// or via a data-layout-options attribute on the container: +// +//
                  +//
                  child 1
                  +//
                  child 2
                  +//
                  +// +//
                  +//
                  child 1
                  +//
                  child 2
                  +//
                  +// +// If you change any options after creating the widget, call +// $(element).layout*box('refresh') to have them picked up. +// However, note that it's currently not feasible to turn off scrolling +// once it's on (as calling scrollview('destroy') doesn't remove the +// scrollview custom mouse handlers). +// +// There is one major difference between the horizontal and +// vertical box layouts: if scrollable=false, the horizontal layout +// will clip children which overflow the edge of the parent container; +// by comparison, the vertical container will grow vertically to +// accommodate the height of its children. This mirrors the behaviour +// of jQuery Mobile, where elements only ever expand horizontally +// to fill the width of the window; but will expand vertically forever, +// unless the page height is artificially constrained. +// +// Options: +// +// {Integer} hgap (default=0) +// Horizontal gap (in pixels) between the child elements. Only has +// an effect on hbox. +// +// {Integer} vgap (default=0) +// Vertical gap (in pixels) between the child elements. Only has +// an effect on vbox. +// +// {Boolean} scrollable (default=true; can only be set at create time) +// Set to true to enable a scrollview on the +// container. If false, children will be clipped if +// they fall outside the edges of the container after +// layouting. +// +// {Boolean} showScrollBars (default=true) +// Set to false to hide scrollbars on the container's scrollview. +// Has no effect is scrollable=false + +(function ( $, undefined ) { + + // hbox + $.widget( "tizen.layouthbox", $.tizen.jlayoutadaptor, { + fixed: { + type: 'flexGrid', + rows: 1, + direction: 'x', + initSelector: ':jqmData(layout="hbox")' + }, + + _create: function () { + if ( !this.options.hgap ) { + this.options.hgap = 0; + } + + $.tizen.jlayoutadaptor.prototype._create.apply( this, arguments ); + } + } ); + + $( document ).bind( "pagecreate", function ( e ) { + $( $.tizen.layouthbox.prototype.fixed.initSelector, e.target ) + .not( ":jqmData(role='none'), :jqmData(role='nojs')" ) + .layouthbox(); + } ); + + // vbox + $.widget( "tizen.layoutvbox", $.tizen.jlayoutadaptor, { + fixed: { + type: 'flexGrid', + columns: 1, + direction: 'y', + initSelector: ':jqmData(layout="vbox")' + }, + + _create: function () { + if ( !this.options.vgap ) { + this.options.vgap = 0; + } + + $.tizen.jlayoutadaptor.prototype._create.apply( this, arguments ); + } + } ); + + $( document ).bind( "pagecreate", function ( e ) { + $( $.tizen.layoutvbox.prototype.fixed.initSelector, e.target ) + .not( ":jqmData(role='none'), :jqmData(role='nojs')" ) + .layoutvbox(); + } ); + +}( jQuery ) ); diff --git a/src/widgets/listdivider/js/jquery.mobile.tizen.listdivider.js b/src/widgets/listdivider/js/jquery.mobile.tizen.listdivider.js new file mode 100755 index 0000000..940e29e --- /dev/null +++ b/src/widgets/listdivider/js/jquery.mobile.tizen.listdivider.js @@ -0,0 +1,45 @@ +/* *************************************************************************** + +*/ + +(function ( $, undefined ) { + + $.widget( "tizen.listdivider", $.mobile.widget, { + options: { + initSelector: ":jqmData(role='list-divider')" + }, + + _create: function () { + + var $listdivider = this.element, + openStatus = true, + iconStatus, + expandSrc, + style = $listdivider.attr( "data-style" ); + + if ( style === "expandable" || style === "checkexpandable" ) { + openStatus ? iconStatus = "opened" : iconStatus = "closed"; + expandSrc = ""; + + $( expandSrc ).appendTo( $listdivider ); + } + + $listdivider.children( ".ui-divider-expand-div" ).bind( "vclick", function ( event, ui ) { + if ( openStatus ) { + $( this ).children( "span" ).removeClass( "ui-icon-expandable-divider-opened" ); + $( this ).children( "span" ).addClass( "ui-icon-expandable-divider-closed" ); + openStatus = false; + } else { + $( this ).children( "span" ).removeClass( "ui-icon-expandable-divider-closed" ); + $( this ).children( "span" ).addClass( "ui-icon-expandable-divider-opened" ); + openStatus = true; + } + }); + }, + }); + + //auto self-init widgets + $( document ).bind( "pagecreate create", function ( e ) { + $( $.tizen.listdivider.prototype.options.initSelector, e.target ).listdivider(); + }); +}( jQuery ) ); diff --git a/src/widgets/listviewcontrols/js/listviewcontrols.js b/src/widgets/listviewcontrols/js/listviewcontrols.js new file mode 100755 index 0000000..97e1680 --- /dev/null +++ b/src/widgets/listviewcontrols/js/listviewcontrols.js @@ -0,0 +1,303 @@ +/* + * jQuery Mobile Widget @VERSION - listview controls + * + * This software is licensed under the MIT licence (as defined by the OSI at + * http://www.opensource.org/licenses/mit-license.php) + * + * *************************************************************************** + * Copyright (C) 2011 by Intel Corporation Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * *************************************************************************** + * + * Authors: Elliot Smith + */ + +// This extension supplies API to toggle the "mode" in which a list +// is displayed. The modes available is configurable, but defaults +// to ['edit', 'view']. A list can also have a control panel associated +// with it. The visibility of the control panel is governed by the current +// mode (by default, it is visible in 'edit' mode); elements within +// the listview can also be marked up to be visible in one or more of the +// available modes. +// +// One example use case would be a control panel with a "Select all" checkbox +// which, when clicked, selects all of the checkboxes in the associated +// listview items. +// +// The control panel itself should be defined as a form element. +// By default, the control panel will be hidden when the listview is +// initialised, unless you supply mode="edit" as a +// data-listview-controls option (when using the default modes). If you +// want the control panel to be visible in some mode other than +// the default, use a data-listviewcontrols-show-in="" attribute +// on the control panel element. +// +// Example usage (using the default 'edit' and 'view' modes): +// +// +//
                  +//
                  +// +// +//
                  +//
                  +// +// +//
                    +// +//
                  • +// +// +//
                    +// +// +//
                    +// +// +// Greg +// +//
                  • +// +// ... more li elements marked up the same way ... +// +//
                  +// +// To associate the listview with the control panel, add +// data-listviewcontrols="..selector.." to a listview, where +// selector selects a single element (the control panel +// you defined). You can then call +// listviewcontrols('option', 'mode', '') on the +// listview to set the mode. +// +// Inside the listview's items, add controls to each item +// which are only visible when in one of the modes. To do this, +// add form elements (e.g. checkboxes) to the items as you see fit. Then, +// mark each form element with data-listviewcontrols-show-in="". +// The control's visibility now depends on the mode of the listviewcontrols: +// it is only shown when its setting matches the current mode +// of the listviewcontrols widget. You are responsible for properly +// styling the form elements inside the listview so the listview looks +// correct when they are hidden or visible. +// +// The control panel (by default, visible when in "show" mode) is flexible +// and can contain any valid form elements (or other jqm components). It's +// up to you to define the behaviour associated with interactions on +// the control panel and/or controls inside list items. +// +// Methods: +// +// visibleListItems +// Returns a jQuery object containing all the li elements in the +// listview which are currently visible and not dividers. (This +// is just a convenience to make operating on the list as a whole +// slightly simpler.) +// +// Options (set in options hash passed to constructor, or via the +// option method, or declaratively by attribute described below): +// +// controlPanelSelector {String} +// Selector string for selecting the element representing the +// control panel for the listview. The context for find() is the +// document (to give the most flexibility), so your selector +// should be specific. Set declaratively with +// data-listviewcontrols="...selector...". +// +// modesAvailable {String[]; default=['edit', 'view']} +// An array of the modes available for these controls. +// +// mode {String; default='view'} +// Current mode for the widget, which governs the visibility +// of the listview control panel and any elements marked +// with data-listviewcontrols-show-in="". +// Set declaratively with +// data-listviewcontrols-options='{"mode":""}'. +// +// controlPanelShowIn {String; default=modesAvailable[0]} +// The mode in which the control panel is visible; defaults to the +// first element of modesAvailable. Can be set declaratively +// on the listview controls element with +// data-listviewcontrols-show-in="" + +(function ($) { + + $.widget( "todons.listviewcontrols", $.mobile.widget, { + _defaults: { + controlPanelSelector: null, + modesAvailable: ['edit', 'view'], + mode: 'view', + controlPanelShowIn: null + }, + + _listviewCssClass: 'ui-listviewcontrols-listview', + _controlsCssClass: 'ui-listviewcontrols-panel', + + _create: function () { + var self = this, + o = this.options, + optionsValid = true, + page = this.element.closest( '.ui-page' ), + controlPanelSelectorAttr = 'data-' + $.mobile.ns + 'listviewcontrols', + controlPanelSelector = this.element.attr( controlPanelSelectorAttr ), + dataOptions = this.element.jqmData( 'listviewcontrols-options' ), + controlPanelShowInAttr; + + o.controlPanelSelector = o.controlPanelSelector || controlPanelSelector; + + // precedence for options: defaults < jqmData attribute < options arg + o = $.extend( {}, this._defaults, dataOptions, o ); + + optionsValid = ( this._validOption( 'modesAvailable', o.modesAvailable, o ) && + this._validOption( 'controlPanelSelector', o.controlPanelSelector, o ) && + this._validOption( 'mode', o.mode, o ) ); + + if ( !optionsValid ) { + return false; + } + + // get the controls element + this.controlPanel = $( document ).find( o.controlPanelSelector ).first(); + + if ( this.controlPanel.length === 0 ) { + return false; + } + + // once we have the controls element, we may need to override the + // mode in which controls are shown + controlPanelShowInAttr = this.controlPanel.jqmData( 'listviewcontrols-show-in' ); + if ( controlPanelShowInAttr ) { + o.controlPanelShowIn = controlPanelShowInAttr; + } else if ( !o.controlPanelShowIn ) { + o.controlPanelShowIn = o.modesAvailable[0]; + } + + if ( !this._validOption( 'controlPanelShowIn', o.controlPanelShowIn, o ) ) { + return; + } + + // done setting options + this.options = o; + + // mark the controls and the list with a class + this.element.removeClass(this._listviewCssClass).addClass(this._listviewCssClass); + this.controlPanel.removeClass(this._controlsCssClass).addClass(this._controlsCssClass); + + // show the widget + if ( page && !page.is( ':visible' ) ) { + page.bind( 'pageshow', function () { self.refresh(); } ); + } else { + this.refresh(); + } + }, + + _validOption: function ( varName, value, otherOptions ) { + var ok = false, + i = 0; + + if ( varName === 'mode' ) { + ok = ( $.inArray( value, otherOptions.modesAvailable ) >= 0 ); + } else if ( varName === 'controlPanelSelector' ) { + ok = ( $.type( value ) === 'string' ); + } else if ( varName === 'modesAvailable' ) { + ok = ( $.isArray( value ) && value.length > 1 ); + + if ( ok ) { + for ( i = 0; i < value.length; i++ ) { + if ( value[i] === '' || $.type( value[i] ) !== 'string' ) { + ok = false; + } + } + } + } else if ( varName === 'controlPanelShowIn' ) { + ok = ( $.inArray( value, otherOptions.modesAvailable ) >= 0 ); + } + + return ok; + }, + + _setOption: function ( varName, value ) { + var oldValue = this.options[varName]; + + if ( oldValue !== value && this._validOption( varName, value, this.options ) ) { + this.options[varName] = value; + this.refresh(); + } + }, + + visibleListItems: function () { + return this.element.find( 'li:not(:jqmData(role=list-divider)):visible' ); + }, + + refresh: function () { + var self = this, + triggerUpdateLayout = false, + isVisible = null, + showIn, + modalElements; + + // hide/show the control panel and hide/show controls inside + // list items based on their "show-in" option + isVisible = this.controlPanel.is( ':visible' ); + + if ( this.options.mode === this.options.controlPanelShowIn ) { + this.controlPanel.show(); + } else { + this.controlPanel.hide(); + } + + if ( this.controlPanel.is( ':visible' ) !== isVisible ) { + triggerUpdateLayout = true; + } + + // we only operate on elements inside list items which aren't dividers + modalElements = this.element + .find( 'li:not(:jqmData(role=list-divider))' ) + .find( ':jqmData(listviewcontrols-show-in)' ); + + modalElements.each(function () { + showIn = $( this ).jqmData( 'listviewcontrols-show-in' ); + + isVisible = $( this ).is( ':visible' ); + + if ( showIn === self.options.mode ) { + $( this ).show(); + } else { + $( this ).hide(); + } + + if ( $( this ).is( ':visible' ) !== isVisible ) { + triggerUpdateLayout = true; + } + } ); + + if ( triggerUpdateLayout ) { + this.element.trigger( 'updatelayout' ); + } + } + } ); + + $( 'ul' ).live( 'listviewcreate', function () { + var list = $(this); + + if ( list.is( ':jqmData(listviewcontrols)' ) ) { + list.listviewcontrols(); + } + } ); + +}( jQuery ) ); diff --git a/src/widgets/multibuttonentry/js/jquery.mobile.tizen.multibuttonentry.js b/src/widgets/multibuttonentry/js/jquery.mobile.tizen.multibuttonentry.js new file mode 100755 index 0000000..202f5ac --- /dev/null +++ b/src/widgets/multibuttonentry/js/jquery.mobile.tizen.multibuttonentry.js @@ -0,0 +1,585 @@ +/* *************************************************************************** + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * *************************************************************************** + * + * Author: Kangsik Kim +*/ + +/** + * The MultiButtonEntry widget changes a text item to a button. It can be comprised of a number of button widgets. + * When a user types text and the text gets a specific event to change from a text to a button, + * the input text is changed to a MultiButtonEntry widget. + * A user can add the MultiButtonEntry widget to a contact list, email list, or another list. + * The typical use of this widget is composing a number of contacts or phone numbers in a specific area of the screen. + * + * HTML Attributes: + * + * data-list-id : Represents the page id. + * The page contains data for the user, for example, an address book. + * If the value is null, anchor button doesn't work. (Default : null) + * data-label: Provide a label for a user-guide. (Default : 'To : ') + * data-description : This attribute is managing message format. + * This message is displayed when widget status was changed to 'focusout'. (Default : '+ {0}') + * + * APIs: + * + * inputtext ( [string] ) + * : If argument is not exist, will get a string from inputbox. + * If argument is exist, will set a string to inputbox. + * select ( [number] ) + * : If no argument exists, gets a string of the selected block. + * If any button isn't selected on a multibuttonentry widget, this method returns "null" value. + * When a user call this method with an argument which is a number type, + * this method selects the button which is matched with the argument. + * add ( text, [number] ) + * : If second argument does not exist, will insert to a new button at last position. + * Insert a new button at indexed position. The position is decided by the second argument. + * "index of position" means that the position of inserting a new button is decided by the second argument on "add" method. + * For example, if a user call the method like this "add("Tizen", 2)", + * new button labed "Tizen" will be inserted on the third position. + * remove ( [number] ) + * : If no argument exists, all buttons are removed. + * Remove a button at indexed position. + * The position is decided by the second argument. (index: index of button) + * length ( void ) + * : Get a number of buttons. + * foucsIn ( void ) + * : This method change a status to 'focusin'. + * This status is able to manage a widget. + * focusOut ( void ) + * : Changes the focus status to 'focus out'. + * The status is not able to manage a widget. + * All buttons that contained in the widget are removed and + * summarized message is displayed. + * destroy ( void ) + * : Remove all of the new DOM elements for the current widget that you created. + * + * Events: + * + * create : Occur when create MultiButtonEntry widget. + * select : Occur when a button is selected. + * add : Occur when new button is inserted. + * remove : Occur when a button is removed. + * + * Examples: + * + *
                  + *
                  + * + */ + +( function ( $, window, document, undefined ) { + $.widget( "tizen.multibuttonentry", $.mobile.widget, { + _focusStatus : null, + _items : null, + _viewWidth : 0, + _reservedWidth : 0, + _currentWidth : 0, + _fontSize : 0, + _anchorWidth : 0, + _labelWidth : 0, + _marginWidth : 0, + options : { + label : "To : ", + listId : null, + description : "+ {0}" + }, + + _create : function () { + var self = this, + $view = this.element, + role = $view.jqmData( "role" ), + option = this.options, + className = "ui-multibuttonentry-link", + inputbox = $( document.createElement( "input" ) ), + labeltag = $( document.createElement( "label" ) ), + moreBlock = $( document.createElement( "a" ) ); + + $view.hide().empty().addClass( "ui-" + role ); + + // create a label tag. + $( labeltag ).text( option.label ).addClass( "ui-multibuttonentry-label" ); + $view.append( labeltag ); + + // create a input tag + $( inputbox ).text( option.label ).addClass( "ui-multibuttonentry-input" ); + $view.append( inputbox ); + + // create a anchor tag. + if ( option.listId === null || $.trim(option.listId).length < 1 ) { + className += "-dim"; + } + $( moreBlock ).text( "+" ).attr( "href", $.trim(option.listId)).addClass( "ui-multibuttonentry-link-base" ).addClass( className ); + + // append default htmlelements to main widget. + $view.append( moreBlock ); + + // bind a event + this._bindEvents(); + self._focusStatus = "init"; + // display widget + $view.show(); + $view.attr( "tabindex", -1 ).focusin( function ( e ) { + self.focusIn(); + }); + + // assign global variables + self._viewWidth = $view.innerWidth(); + self._reservedWidth += self._calcBlockWidth( moreBlock ); + self._reservedWidth += self._calcBlockWidth( labeltag ); + self._fontSize = parseInt( $( moreBlock ).css( "font-size" ), 10 ); + self._currentWidth = self._reservedWidth; + }, + + // bind events + _bindEvents : function () { + var self = this, + $view = self.element, + option = self.options, + inputbox = $view.find( ".ui-multibuttonentry-input" ), + moreBlock = $view.find( ".ui-multibuttonentry-link-base" ), + isSeparator = false; + + inputbox.bind( "keyup", function ( event ) { + // 8 : backspace + // 13 : Enter + // 186 : semi-colon + // 188 : comma + var keyValue = event.keyCode, + valueString = $( inputbox ).val(), + valueStrings = [], + index; + + if ( keyValue === 8 ) { + if ( valueString.length === 0 ) { + self._validateTargetBlock(); + } + } else if ( keyValue === 13 || keyValue === 186 || keyValue === 188 ) { + if ( valueString.length !== 0 ) { + // split content by separators(',', ';') + valueStrings = valueString.split ( /[,;]/ ); + for ( index = 0; index < valueStrings.length; index++ ) { + if ( valueStrings[index].length !== 0 && valueStrings[index].replace( /\s/g, "" ).length !== 0 ) { + self._addTextBlock( valueStrings[index] ); + } + } + } + inputbox.val( "" ); + isSeparator = true; + } else { + self._unlockTextBlock(); + } + + return !isSeparator; + }); + + moreBlock.click( function () { + if ( $( moreBlock ).hasClass( "ui-multibuttonentry-link-dim" ) ) { + return ; + } + + $(inputbox).hide(); + + $.mobile.changePage( option.listId, { + transition: "slide", + reverse: false, + changeHash: false + } ); + } ); + + $( document ).bind( "pagechange.mbe", function ( event ) { + if ( $view.innerWidth() === 0 ) { + return ; + } + var inputBox = $view.find( ".ui-multibuttonentry-input" ); + if ( self._labelWidth === 0 ) { + self._labelWidth = $view.find( ".ui-multibuttonentry-label" ).outerWidth( true ); + self._anchorWidth = $view.find( ".ui-multibuttonentry-link-base" ).outerWidth( true ); + self._marginWidth = parseInt( ( $( inputBox ).css( "margin-left" ) ), 10 ); + self._marginWidth += parseInt( ( $( inputBox ).css( "margin-right" ) ), 10 ); + self._viewWidth = $view.innerWidth(); + } + self._modifyInputBoxWidth(); + $(inputbox).show(); + }); + + $view.bind( "click", function ( event ) { + if ( self._focusStatus === "focusOut" ) { + self.focusIn(); + } + }); + }, + + // create a textbutton and append this button to parent layer. + // @param arg1 : string + // @param arg2 : index + _addTextBlock : function ( messages, blockIndex ) { + if ( arguments.length === 0 ) { + return; + } + + if ( ! messages ) { + return ; + } + + var self = this, + $view = self.element, + content = messages, + index = blockIndex, + blocks = null, + dataBlock = null, + displayText = null, + textBlock = null; + + if ( self._viewWidth === 0 ) { + self._viewWidth = $view.innerWidth(); + } + + // save src data + dataBlock = $( document.createElement( 'input' ) ); + dataBlock.attr( "value", content ).addClass( "ui-multibuttonentry-data" ).hide(); + + // Create a new text HTMLDivElement. + textBlock = $( document.createElement( 'div' ) ); + displayText = self._ellipsisTextBlock( content ) ; + textBlock.text( displayText ).addClass( "ui-multibuttonentry-block" ); + textBlock.append( dataBlock ); + + // bind a event to HTMLDivElement. + textBlock.bind( "vclick", function ( event ) { + if ( $( this ).hasClass( "ui-multibuttonentry-sblock" ) ) { + // If block is selected, it will be removed. + self._removeTextBlock(); + } + + var lockBlock = $view.find( "div.ui-multibuttonentry-sblock" ); + if ( typeof lockBlock != "undefined" ) { + lockBlock.removeClass( "ui-multibuttonentry-sblock" ).addClass( "ui-multibuttonentry-block" ); + } + $( this ).removeClass( "ui-multibuttonentry-block" ).addClass( "ui-multibuttonentry-sblock" ); + self._trigger( "select" ); + }); + + blocks = $view.find( "div" ); + if ( index !== null && index <= blocks.length ) { + $( blocks[index] ).before( textBlock ); + } else { + $view.find( ".ui-multibuttonentry-input" ).before( textBlock ); + } + + self._currentWidth += self._calcBlockWidth( textBlock ); + self._modifyInputBoxWidth(); + self._trigger( "add" ); + }, + + _removeTextBlock : function () { + var self = this, + $view = this.element, + targetBlock = null, + lockBlock = $view.find( "div.ui-multibuttonentry-sblock" ); + + if ( lockBlock !== null && lockBlock.length > 0 ) { + self._currentWidth -= self._calcBlockWidth( lockBlock ); + lockBlock.remove(); + self._modifyInputBoxWidth(); + this._trigger( "remove" ); + } else { + $view.find( "div:last" ).removeClass( "ui-multibuttonentry-block" ).addClass( "ui-multibuttonentry-sblock" ); + } + }, + + _calcBlockWidth : function ( block ) { + var blockWidth = 0; + blockWidth = $( block ).outerWidth( true ); + return blockWidth; + }, + + _unlockTextBlock : function () { + var $view = this.element, + lockBlock = $view.find( "div.ui-multibuttonentry-sblock" ); + if ( lockBlock !== null ) { + lockBlock.removeClass( "ui-multibuttonentry-sblock" ).addClass( "ui-multibuttonentry-block" ); + } + }, + + // call when remove text block by backspace key. + _validateTargetBlock : function () { + var self = this, + $view = self.element, + lastBlock = $view.find( "div:last" ), + tmpBlock = null; + + if ( lastBlock.hasClass( "ui-multibuttonentry-sblock" ) ) { + self._removeTextBlock(); + } else { + tmpBlock = $view.find( "div.ui-multibuttonentry-sblock" ); + tmpBlock.removeClass( "ui-multibuttonentry-sblock" ).addClass( "ui-multibuttonentry-block" ); + lastBlock.removeClass( "ui-multibuttonentry-block" ).addClass( "ui-multibuttonentry-sblock" ); + } + }, + + _ellipsisTextBlock : function ( text ) { + var self = this, + str = text, + length = 0, + maxWidth = self._viewWidth, + maxCharCnt = parseInt( ( self._viewWidth / self._fontSize ), 10 ) - 5, + ellipsisStr = null; + if ( str ) { + length = str.length ; + if ( length > maxCharCnt ) { + ellipsisStr = str.substring( 0, maxCharCnt ); + ellipsisStr += "..."; + } else { + ellipsisStr = str; + } + } + return ellipsisStr; + }, + + _modifyInputBoxWidth : function () { + var self = this, + $view = self.element, + labelWidth = self._labelWidth, + anchorWidth = self._anchorWidth, + inputBoxWidth = self._viewWidth - labelWidth - anchorWidth, + blocks = $view.find( "div" ), + blockWidth = 0, + index = 0, + margin = self._marginWidth, + inputBox = $view.find( ".ui-multibuttonentry-input" ); + + if ( $view.width() === 0 ) { + return ; + } + + for ( index = 0; index < blocks.length; index += 1 ) { + blockWidth = self._calcBlockWidth( blocks[index] ); + inputBoxWidth = inputBoxWidth - blockWidth; + if ( inputBoxWidth <= 0 ) { + if ( inputBoxWidth + anchorWidth >= 0 ) { + inputBoxWidth = self._viewWidth - anchorWidth; + } else { + inputBoxWidth = self._viewWidth - blockWidth - anchorWidth; + } + } + } + $( inputBox ).width( inputBoxWidth - margin - 1 ); + }, + + _stringFormat : function ( expression ) { + var pattern = null, + message = expression, + i = 0; + for ( i = 1; i < arguments.length; i += 1 ) { + pattern = "{" + ( i - 1 ) + "}"; + message = message.replace( pattern, arguments[i] ); + } + return message; + }, + + _resizeBlock : function () { + var self = this, + $view = self.element, + dataBlocks = $( ".ui-multibuttonentry-data" ), + blocks = $view.find( "div" ), + srcTexts = [], + index = 0; + + $view.hide(); + for ( index = 0 ; index < dataBlocks.length ; index += 1 ) { + srcTexts[index] = $( dataBlocks[index] ).val(); + self._addTextBlock( srcTexts[index] ); + } + blocks.remove(); + $view.show(); + }, + + //---------------------------------------------------- // + // Public Method // + //----------------------------------------------------// + // + // Focus In Event + // + focusIn : function () { + if ( this._focusStatus === "focusIn" ) { + return; + } + + var $view = this.element; + + $view.find( "label" ).show(); + $view.find( ".ui-multibuttonentry-desclabel" ).remove(); + $view.find( "div.ui-multibuttonentry-sblock" ).removeClass( "ui-multibuttonentry-sblock" ).addClass( "ui-multibuttonentry-block" ); + $view.find( "div" ).show(); + $view.find( ".ui-multibuttonentry-input" ).show(); + $view.find( "a" ).show(); + + // change focus state. + this._modifyInputBoxWidth(); + this._focusStatus = "focusIn"; + $view.removeClass( "ui-multibuttonentry-focusout" ).addClass( "ui-multibuttonentry-focusin" ); + }, + + focusOut : function () { + if ( this._focusStatus === "focusOut" ) { + return; + } + + var self = this, + $view = self.element, + tempBlock = null, + statement = "", + index = 0, + lastIndex = 10, + label = $view.find( "label" ), + more = $view.find( "span" ), + blocks = $view.find( "div" ), + currentWidth = $view.outerWidth( true ) - more.outerWidth( true ) - label.outerWidth( true ), + blockWidth = 0; + + $view.find( ".ui-multibuttonentry-input" ).hide(); + $view.find( "a" ).hide(); + blocks.hide(); + + currentWidth = currentWidth - self._reservedWidth; + + for ( index = 0; index < blocks.length; index++ ) { + blockWidth = $( blocks[index] ).outerWidth( true ); + if ( currentWidth - blockWidth <= 0 ) { + lastIndex = index - 1; + break; + } + + $( blocks[index] ).show(); + currentWidth -= blockWidth; + } + + if ( lastIndex !== blocks.length ) { + statement = self._stringFormat( self.options.description, blocks.length - lastIndex - 1 ); + tempBlock = $( document.createElement( 'label' )); + tempBlock.text( statement ); + tempBlock.addClass( "ui-multibuttonentry-desclabel" ).addClass( "ui-multibuttonentry-desclabel" ); + $( blocks[lastIndex] ).after( tempBlock ); + } + + // update foucs state + this._focusStatus = "focusOut"; + $view.removeClass( "ui-multibuttonentry-focusin" ).addClass( "ui-multibuttonentry-focusout" ); + }, + + inputText : function ( message ) { + var $view = this.element; + + if ( arguments.length === 0 ) { + return $view.find( ".ui-multibuttonentry-input" ).val(); + } + $view.find( ".ui-multibuttonentry-input" ).val( message ); + return message; + }, + + select : function ( index ) { + var $view = this.element, + lockBlock = null, + blocks = null; + + if ( this._focusStatus === "focusOut" ) { + return; + } + + if ( arguments.length === 0 ) { + // return a selected block. + lockBlock = $view.find( "div.ui-multibuttonentry-sblock" ).children( ".ui-multibuttonentry-data" ); + if ( lockBlock) { + return lockBlock.attr( "value" ); + } + return null; + } + // 1. unlock all blocks. + this._unlockTextBlock(); + // 2. select pointed block. + blocks = $view.find( "div" ); + if ( blocks.length > index ) { + $( blocks[index] ).removeClass( "ui-multibuttonentry-block" ).addClass( "ui-multibuttonentry-sblock" ); + this._trigger( "select" ); + } + return null; + }, + + add : function ( message, position ) { + if ( this._focusStatus === "focusOut" ) { + return; + } + + this._addTextBlock( message, position ); + }, + + remove : function ( position ) { + var self = this, + $view = this.element, + blocks = $view.find( "div" ), + index = 0; + if ( this._focusStatus === "focusOut" ) { + return; + } + + if ( arguments.length === 0 ) { + blocks.remove(); + this._trigger( "clear" ); + } else if ( typeof position == "number" ) { + // remove selected button + index = ( ( position < blocks.length ) ? position : ( blocks.length - 1 ) ); + $( blocks[index] ).remove(); + this._trigger( "remove" ); + } + self._modifyInputBoxWidth(); + }, + + length : function () { + return this.element.find( "div" ).length; + }, + + refresh : function () { + var self = this; + self.element.hide(); + self.element.show(); + }, + + destroy : function () { + var $view = this.element; + + $view.find( "label" ).remove(); + $view.find( "div" ).unbind( "vclick" ).remove(); + $view.find( "a" ).remove(); + $view.find( ".ui-multibuttonentry-input" ).unbind( "keyup" ).remove(); + + this._trigger( "destroy" ); + } + }); + + $( document ).bind( "pagecreate create", function () { + $( ":jqmData(role='multibuttonentry')" ).multibuttonentry(); + }); + + $( window ).bind( "resize", function () { + $( ":jqmData(role='multibuttonentry')" ).multibuttonentry( "refresh" ); + }); +} ( jQuery, window, document ) ); diff --git a/src/widgets/multimediaview/js/jquery.mobile.tizen.multimediaview.js b/src/widgets/multimediaview/js/jquery.mobile.tizen.multimediaview.js new file mode 100755 index 0000000..e197dcc --- /dev/null +++ b/src/widgets/multimediaview/js/jquery.mobile.tizen.multimediaview.js @@ -0,0 +1,724 @@ +/* *************************************************************************** + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * *************************************************************************** + * + * Authors: Yonghwi Park + * Wonseop Kim +*/ + +/** + * + * MultiMediaView is a widget that lets the user view and handle multimedia contents. + * Video and audio elements are coded as standard HTML elements and enhanced by the + * MultiMediaview to make them attractive and usable on a mobile device. + * + * HTML Attributes: + * data-theme : Set a theme of widget. + * If this value is not defined, widget will use parent`s theme. (optional) + * data-controls : If this value is 'true', widget will use belonging controller. + * If this value is 'false', widget will use browser`s controller. + * Default value is 'true'. + * data-fullscreen : Set a status that fullscreen when inital start. + * Default value is 'false'. + * + * APIs: + * width( [number] ) + * : Get or set the width of widget. + * The first argument is the width of widget. + * If no first argument is specified, will act as a getter. + * height( [number] ) + * : Get or set the height of widget. + * The first argument is the height of widget. + * If no first argument is specified, will act as a getter. + * size( number, number ) + * : Set a size of widget and resize a widget. + * The first argument is width and second argument is height. + * fullscreen( [boolean] ) + * : Get or Set the status of fullscreen. + * If no first argument is specified, will act as a getter. + * + * Events: + * + * create : triggered when a multimediaview is created. + * + * Examples: + * + * VIDEO : + * + * + * AUDIO : + * + * + */ + +( function ( $, document, window, undefined ) { + $.widget( "tizen.multimediaview", $.mobile.widget, { + options : { + theme : null, + controls : true, + fullscreen : false, + initSelector : "video, audio" + }, + _create : function () { + var self = this, + view = self.element, + viewElement = view[0], + option = self.options, + role = "multimediaview", + control = null; + + $.extend( this, { + role : null, + isControlHide : false, + controlTimer : null, + isVolumeHide : true, + isVertical : true, + backupView : null + }); + + self.role = role; + view.addClass( "ui-multimediaview" ); + control = self._createControl(); + + if ( view[0].nodeName === "AUDIO" ) { + control.addClass( "ui-multimediaview-audio" ); + } + + control.hide(); + view.wrap( "
                  " ).after( control ); + if ( option.controls ) { + if ( view.attr("controls") ) { + view.removeAttr( "controls" ); + } + } + + self._addEvent(); + + $( document ).bind( "pagechange.multimediaview", function ( e ) { + var $page = $( e.target ); + if ( $page.find( view ).length > 0 && viewElement.autoplay ) { + viewElement.play(); + } + + if ( option.controls ) { + control.show(); + self._resize(); + } + }).bind( "pagebeforechange.multimediaview", function ( e ) { + if ( viewElement.played.length !== 0 ) { + viewElement.pause(); + control.hide(); + } + }); + $( window ).bind( "resize.multimediaview orientationchange.multimediaview", function ( e ) { + if ( !option.controls ) { + return; + } + var $page = $( e.target ), + $scrollview = view.parents( ".ui-scrollview-clip" ); + + $scrollview.each( function ( i ) { + if ( $.data( this, "scrollview" ) ) { + $( this ).scrollview( "scrollTo", 0, 0 ); + } + }); + + // for maintaining page layout + if ( !option.fullscreen ) { + $( ".ui-footer:visible" ).show(); + } else { + $( ".ui-footer" ).hide(); + self._fitContentArea( $page ); + } + + self._resize(); + }); + }, + _resize : function () { + var view = this.element, + parent = view.parent(), + control = parent.find( ".ui-multimediaview-control" ), + viewWidth = 0, + viewHeight = 0, + viewOffset = null; + + this._resizeFullscreen( this.options.fullscreen ); + viewWidth = ( ( view[0].nodeName === "VIDEO" ) ? view.width() : parent.width() ); + viewHeight = ( ( view[0].nodeName === "VIDEO" ) ? view.height() : control.height() ); + viewOffset = view.offset(); + + this._resizeControl( viewOffset, viewWidth, viewHeight ); + + this._updateSeekBar(); + this._updateVolumeState(); + }, + _resizeControl : function ( offset, width, height ) { + var self = this, + view = self.element, + viewElement = view[0], + control = view.parent().find( ".ui-multimediaview-control" ), + buttons = control.find( ".ui-button" ), + playpauseButton = control.find( ".ui-playpausebutton" ), + seekBar = control.find( ".ui-seekbar" ), + durationLabel = control.find( ".ui-durationlabel" ), + timestampLabel = control.find( ".ui-timestamplabel" ), + volumeControl = control.find( ".ui-volumecontrol" ), + volumeBar = volumeControl.find( ".ui-volumebar" ), + controlWidth = width, + controlHeight = control.outerHeight( true ), + availableWidth = 0, + controlOffset = null; + + if ( control ) { + if ( view[0].nodeName === "VIDEO" ) { + controlOffset = control.offset(); + controlOffset.left = offset.left; + controlOffset.top = offset.top + height - controlHeight; + control.offset( controlOffset ); + } + + control.width( controlWidth ); + } + + if ( seekBar ) { + availableWidth = control.width() - ( buttons.outerWidth( true ) * buttons.length ); + availableWidth -= ( parseInt( buttons.eq( 0 ).css( "margin-left" ), 10 ) + parseInt( buttons.eq( 0 ).css( "margin-right" ), 10 ) ) * buttons.length; + if ( !self.isVolumeHide ) { + availableWidth -= volumeControl.outerWidth( true ); + } + seekBar.width( availableWidth ); + } + + if ( durationLabel && !isNaN( viewElement.duration ) ) { + durationLabel.find( "p" ).text( self._convertTimeFormat( viewElement.duration ) ); + } + + if ( viewElement.autoplay && viewElement.paused === false ) { + playpauseButton.removeClass( "ui-play-icon" ).addClass( "ui-pause-icon" ); + } + + if ( seekBar.width() < ( volumeBar.width() + timestampLabel.width() + durationLabel.width() ) ) { + durationLabel.hide(); + } else { + durationLabel.show(); + } + }, + _resizeFullscreen : function ( isFullscreen ) { + var self = this, + view = self.element, + parent = view.parent(), + control = view.parent().find( ".ui-multimediaview-control" ), + playpauseButton = control.find( ".ui-playpausebutton" ), + timestampLabel = control.find( ".ui-timestamplabel" ), + seekBar = control.find( ".ui-seekbar" ), + durationBar = seekBar.find( ".ui-duration" ), + currenttimeBar = seekBar.find( ".ui-currenttime" ), + docWidth = 0, + docHeight = 0; + + if ( isFullscreen ) { + if ( !self.backupView ) { + self.backupView = { + width : view[0].style.getPropertyValue( "width" ) || "", + height : view[0].style.getPropertyValue( "height" ) || "", + position : view.css( "position" ), + zindex : view.css( "z-index" ) + }; + } + docWidth = $( "body" )[0].clientWidth; + docHeight = $( "body" )[0].clientHeight; + + view.width( docWidth ).height( docHeight - 1 ); + view.addClass( "ui-" + self.role + "-fullscreen" ); + view.offset( { + top : 0, + left : 0 + }); + } else { + if ( !self.backupView ) { + return; + } + + view.removeClass( "ui-" + self.role + "-fullscreen" ); + view.css( { + "width" : self.backupView.width, + "height" : self.backupView.height, + "position": self.backupView.position, + "z-index": self.backupView.zindex + }); + self.backupView = null; + } + parent.show(); + }, + _addEvent : function () { + var self = this, + view = self.element, + viewElement = view[0], + control = view.parent().find( ".ui-multimediaview-control" ), + playpauseButton = control.find( ".ui-playpausebutton" ), + timestampLabel = control.find( ".ui-timestamplabel" ), + durationLabel = control.find( ".ui-durationlabel" ), + volumeButton = control.find( ".ui-volumebutton" ), + volumeControl = control.find( ".ui-volumecontrol" ), + volumeBar = volumeControl.find( ".ui-volumebar" ), + volumeGuide = volumeControl.find( ".ui-guide" ), + volumeHandle = volumeControl.find( ".ui-handler" ), + fullscreenButton = control.find( ".ui-fullscreenbutton" ), + seekBar = control.find( ".ui-seekbar" ), + durationBar = seekBar.find( ".ui-duration" ), + currenttimeBar = seekBar.find( ".ui-currenttime" ); + + view.bind( "loadedmetadata.multimediaview", function ( e ) { + if ( !isNaN( viewElement.duration ) ) { + durationLabel.find( "p" ).text( self._convertTimeFormat( viewElement.duration ) ); + } + self._resize(); + }).bind( "timeupdate.multimediaview", function ( e ) { + self._updateSeekBar(); + }).bind( "play.multimediaview", function ( e ) { + playpauseButton.removeClass( "ui-play-icon" ).addClass( "ui-pause-icon" ); + }).bind( "pause.multimediaview", function ( e ) { + playpauseButton.removeClass( "ui-pause-icon" ).addClass( "ui-play-icon" ); + }).bind( "ended.multimediaview", function ( e ) { + if ( typeof viewElement.loop == "undefined" || viewElement.loop === "" ) { + self.stop(); + } + }).bind( "volumechange.multimediaview", function ( e ) { + if ( viewElement.volume < 0.1 ) { + viewElement.muted = true; + volumeButton.removeClass( "ui-volume-icon" ).addClass( "ui-mute-icon" ); + } else { + viewElement.muted = false; + volumeButton.removeClass( "ui-mute-icon" ).addClass( "ui-volume-icon" ); + } + + if ( !self.isVolumeHide ) { + self._updateVolumeState(); + } + }).bind( "durationchange.multimediaview", function ( e ) { + if ( !isNaN( viewElement.duration ) ) { + durationLabel.find( "p" ).text( self._convertTimeFormat( viewElement.duration ) ); + } + self._resize(); + }).bind( "error.multimediaview", function ( e ) { + switch ( e.target.error.code ) { + case e.target.error.MEDIA_ERR_ABORTED : + window.alert( 'You aborted the video playback.' ); + break; + case e.target.error.MEDIA_ERR_NETWORK : + window.alert( 'A network error caused the video download to fail part-way.' ); + break; + case e.target.error.MEDIA_ERR_DECODE : + window.alert( 'The video playback was aborted due to a corruption problem or because the video used features your browser did not support.' ); + break; + case e.target.error.MEDIA_ERR_SRC_NOT_SUPPORTED : + window.alert( 'The video could not be loaded, either because the server or network failed or because the format is not supported.' ); + break; + default : + window.alert( 'An unknown error occurred.' ); + break; + } + }).bind( "vclick.multimediaview", function ( e ) { + if ( !self.options.controls ) { + return; + } + + control.fadeToggle( "fast", function () { + var offset = control.offset(); + self.isControlHide = !self.isControlHide; + if ( self.options.mediatype == "video" ) { + self._startTimer(); + } + }); + self._resize(); + }); + + playpauseButton.bind( "vclick.multimediaview", function () { + self._endTimer(); + + if ( viewElement.paused ) { + viewElement.play(); + } else { + viewElement.pause(); + } + + if ( self.options.mediatype == "video" ) { + self._startTimer(); + } + }); + + fullscreenButton.bind( "vclick.multimediaview", function ( e ) { + self.fullscreen( !self.options.fullscreen ); + control.fadeIn( "fast" ); + self._endTimer(); + e.preventDefault(); + e.stopPropagation(); + }); + + seekBar.bind( "vmousedown.multimediaview", function ( e ) { + var x = e.clientX, + duration = viewElement.duration, + durationOffset = durationBar.offset(), + durationWidth = durationBar.width(), + timerate = ( x - durationOffset.left ) / durationWidth, + time = duration * timerate; + + viewElement.currentTime = time; + + self._endTimer(); + + e.preventDefault(); + e.stopPropagation(); + + $( document ).bind( "vmousemove.multimediaview", function ( e ) { + var x = e.clientX, + timerate = ( x - durationOffset.left ) / durationWidth; + + viewElement.currentTime = duration * timerate; + + e.preventDefault(); + e.stopPropagation(); + }).bind( "vmouseup.multimediaview", function () { + $( document ).unbind( "vmousemove.multimediaview vmouseup.multimediaview" ); + if ( viewElement.paused ) { + viewElement.pause(); + } else { + viewElement.play(); + } + }); + }); + + volumeButton.bind( "vclick.multimediaview", function () { + if ( self.isVolumeHide ) { + var view = self.element, + volume = viewElement.volume; + + self.isVolumeHide = false; + self._resize(); + volumeControl.fadeIn( "fast" ); + self._updateVolumeState(); + self._updateSeekBar(); + } else { + self.isVolumeHide = true; + volumeControl.fadeOut( "fast", function () { + self._resize(); + }); + self._updateSeekBar(); + } + }); + + volumeBar.bind( "vmousedown.multimediaview", function ( e ) { + var baseX = e.clientX, + volumeGuideLeft = volumeGuide.offset().left, + volumeGuideWidth = volumeGuide.width(), + volumeBase = volumeGuideLeft + volumeGuideWidth, + handlerOffset = volumeHandle.offset(), + volumerate = ( baseX - volumeGuideLeft ) / volumeGuideWidth, + currentVolume = ( baseX - volumeGuideLeft ) / volumeGuideWidth; + + self._endTimer(); + self._setVolume( currentVolume.toFixed( 2 ) ); + + e.preventDefault(); + e.stopPropagation(); + + $( document ).bind( "vmousemove.multimediaview", function ( e ) { + var currentX = e.clientX, + currentVolume = ( currentX - volumeGuideLeft ) / volumeGuideWidth; + + self._setVolume( currentVolume.toFixed( 2 ) ); + + e.preventDefault(); + e.stopPropagation(); + }).bind( "vmouseup.multimediaview", function () { + $( document ).unbind( "vmousemove.multimediaview vmouseup.multimediaview" ); + + if ( self.options.mediatype == "video" ) { + self._startTimer(); + } + }); + }); + }, + _removeEvent : function () { + var self = this, + view = self.element, + control = view.parent().find( ".ui-multimediaview-control" ), + playpauseButton = control.find( ".ui-playpausebutton" ), + fullscreenButton = control.find( ".ui-fullscreenbutton" ), + seekBar = control.find( ".ui-seekbar" ), + volumeControl = control.find( ".ui-volumecontrol" ), + volumeBar = volumeControl.find( ".ui-volumebar" ), + volumeHandle = volumeControl.find( ".ui-handler" ); + + view.unbind( ".multimediaview" ); + playpauseButton.unbind( ".multimediaview" ); + fullscreenButton.unbind( ".multimediaview" ); + seekBar.unbind( ".multimediaview" ); + volumeBar.unbind( ".multimediaview" ); + volumeHandle.unbind( ".multimediaview" ); + }, + _createControl : function () { + var self = this, + view = self.element, + control = $( "" ), + playpauseButton = $( "" ), + seekBar = $( "" ), + timestampLabel = $( "

                  00:00:00

                  " ), + durationLabel = $( "

                  00:00:00

                  " ), + volumeButton = $( "" ), + volumeControl = $( "" ), + volumeBar = $( "
                  " ), + volumeGuide = $( "" ), + volumeValue = $( "" ), + volumeHandle = $( "" ), + fullscreenButton = $( "" ), + durationBar = $( "" ), + currenttimeBar = $( "" ); + + control.addClass( "ui-" + self.role + "-control" ); + playpauseButton.addClass( "ui-playpausebutton ui-button" ); + seekBar.addClass( "ui-seekbar" ); + timestampLabel.addClass( "ui-timestamplabel" ); + durationLabel.addClass( "ui-durationlabel" ); + volumeButton.addClass( "ui-volumebutton ui-button" ); + fullscreenButton.addClass( "ui-fullscreenbutton ui-button" ); + durationBar.addClass( "ui-duration" ); + currenttimeBar.addClass( "ui-currenttime" ); + volumeControl.addClass( "ui-volumecontrol" ); + volumeBar.addClass( "ui-volumebar" ); + volumeGuide.addClass( "ui-guide" ); + volumeValue.addClass( "ui-value" ); + volumeHandle.addClass( "ui-handler" ); + + seekBar.append( durationBar ).append( currenttimeBar ).append( durationLabel ).append( timestampLabel ); + + playpauseButton.addClass( "ui-play-icon" ); + if ( view[0].muted ) { + $( volumeButton ).addClass( "ui-mute-icon" ); + } else { + $( volumeButton ).addClass( "ui-volume-icon" ); + } + + volumeBar.append( volumeGuide ).append( volumeValue ).append( volumeHandle ); + volumeControl.append( volumeBar ); + + control.append( playpauseButton ).append( seekBar ).append( volumeControl ).append( volumeButton ); + + if ( self.element[0].nodeName === "VIDEO" ) { + $( fullscreenButton ).addClass( "ui-fullscreen-on" ); + control.append( fullscreenButton ); + } + volumeControl.hide(); + + return control; + }, + _startTimer : function ( duration ) { + this._endTimer(); + + if ( !duration ) { + duration = 3000; + } + + var self = this, + view = self.element, + control = view.parent().find( ".ui-multimediaview-control" ), + volumeControl = control.find( ".ui-volumecontrol" ); + + self.controlTimer = setTimeout( function () { + self.isVolumeHide = true; + self.isControlHide = true; + self.controlTimer = null; + volumeControl.hide(); + control.fadeOut( "fast" ); + }, duration ); + }, + _endTimer : function () { + if ( this.controlTimer ) { + clearTimeout( this.controlTimer ); + this.controlTimer = null; + } + }, + _convertTimeFormat : function ( systime ) { + var ss = parseInt( systime % 60, 10 ).toString(), + mm = parseInt( ( systime / 60 ) % 60, 10 ).toString(), + hh = parseInt( systime / 3600, 10 ).toString(), + time = ( ( hh.length < 2 ) ? "0" + hh : hh ) + ":" + + ( ( mm.length < 2 ) ? "0" + mm : mm ) + ":" + + ( ( ss.length < 2 ) ? "0" + ss : ss ); + + return time; + }, + _updateSeekBar : function ( currenttime ) { + var self = this, + view = self.element, + duration = view[0].duration, + control = view.parent().find( ".ui-multimediaview-control" ), + seekBar = control.find( ".ui-seekbar" ), + durationBar = seekBar.find( ".ui-duration" ), + currenttimeBar = seekBar.find( ".ui-currenttime" ), + timestampLabel = control.find( ".ui-timestamplabel" ), + durationOffset = durationBar.offset(), + durationWidth = durationBar.width(), + durationHeight = durationBar.height(), + timebarWidth = 0; + + if ( typeof currenttime == "undefined" ) { + currenttime = view[0].currentTime; + } + timebarWidth = parseInt( currenttime / duration * durationWidth, 10 ); + durationBar.offset( durationOffset ); + currenttimeBar.offset( durationOffset ).width( timebarWidth ); + timestampLabel.find( "p" ).text( self._convertTimeFormat( currenttime ) ); + }, + _updateVolumeState : function () { + var self = this, + view = self.element, + control = view.parent().find( ".ui-multimediaview-control" ), + volumeControl = control.find( ".ui-volumecontrol" ), + volumeButton = control.find( ".ui-volumebutton" ), + volumeBar = volumeControl.find( ".ui-volumebar" ), + volumeGuide = volumeControl.find( ".ui-guide" ), + volumeValue = volumeControl.find( ".ui-value" ), + volumeHandle = volumeControl.find( ".ui-handler" ), + handlerWidth = volumeHandle.width(), + handlerHeight = volumeHandle.height(), + volumeGuideHeight = volumeGuide.height(), + volumeGuideWidth = volumeGuide.width(), + volumeGuideTop = 0, + volumeGuideLeft = 0, + volumeBase = 0, + handlerOffset = null, + volume = view[0].volume; + + volumeGuideTop = parseInt( volumeGuide.offset().top, 10 ); + volumeGuideLeft = parseInt( volumeGuide.offset().left, 10 ); + volumeBase = volumeGuideLeft; + handlerOffset = volumeHandle.offset(); + handlerOffset.top = volumeGuideTop - parseInt( ( handlerHeight - volumeGuideHeight ) / 2, 10 ); + handlerOffset.left = volumeBase + parseInt( volumeGuideWidth * volume, 10 ) - parseInt( handlerWidth / 2, 10 ); + volumeHandle.offset( handlerOffset ); + volumeValue.width( parseInt( volumeGuideWidth * ( volume ), 10 ) ); + }, + _setVolume : function ( value ) { + var viewElement = this.element[0]; + + if ( value < 0.0 || value > 1.0 ) { + return; + } + + viewElement.volume = value; + }, + _fitContentArea: function ( page, parent ) { + if ( typeof parent == "undefined" ) { + parent = window; + } + + var $page = $( page ), + $content = $( ".ui-content:visible:first" ), + hh = $( ".ui-header:visible" ).outerHeight() || 0, + fh = $( ".ui-footer:visible" ).outerHeight() || 0, + pt = parseFloat( $content.css( "padding-top" ) ), + pb = parseFloat( $content.css( "padding-bottom" ) ), + wh = ( ( parent === window ) ? window.innerHeight : $( parent ).height() ), + height = wh - ( hh + fh ) - ( pt + pb ); + + $content.offset( { + top : ( hh + pt ) + }).height( height ); + }, + width : function ( value ) { + var self = this, + args = arguments, + view = self.element; + + if ( args.length === 0 ) { + return view.width(); + } + if ( args.length === 1 ) { + view.width( value ); + self._resize(); + } + }, + height : function ( value ) { + var self = this, + view = self.element, + args = arguments; + + if ( args.length === 0 ) { + return view.height(); + } + if ( args.length === 1 ) { + view.height( value ); + self._resize(); + } + }, + size : function ( width, height ) { + var self = this, + view = self.element; + + view.width( width ).height( height ); + self._resize(); + }, + fullscreen : function ( value ) { + var self = this, + view = self.element, + control = view.parent().find( ".ui-multimediaview-control" ), + fullscreenButton = control.find( ".ui-fullscreenbutton" ), + args = arguments, + option = self.options, + currentPage = $( ".ui-page-active" ); + + if ( args.length === 0 ) { + return option.fullscreen; + } + if ( args.length === 1 ) { + view.parents( ".ui-content" ).scrollview( "scrollTo", 0, 0 ); + + this.options.fullscreen = value; + if ( value ) { + currentPage.children( ".ui-header" ).hide(); + currentPage.children( ".ui-footer" ).hide(); + this._fitContentArea( currentPage ); + fullscreenButton.removeClass( "ui-fullscreen-on" ).addClass( "ui-fullscreen-off" ); + } else { + currentPage.children( ".ui-header" ).show(); + currentPage.children( ".ui-footer" ).show(); + this._fitContentArea( currentPage ); + fullscreenButton.removeClass( "ui-fullscreen-off" ).addClass( "ui-fullscreen-on" ); + } + self._resize(); + } + }, + refresh : function () { + this._resize(); + } + }); + + $( document ).bind( "pagecreate create", function ( e ) { + $.tizen.multimediaview.prototype.enhanceWithin( e.target ); + }); +} ( jQuery, document, window ) ); diff --git a/src/widgets/nocontents/js/jquery.mobile.tizen.nocontents.js b/src/widgets/nocontents/js/jquery.mobile.tizen.nocontents.js new file mode 100644 index 0000000..a0adcf5 --- /dev/null +++ b/src/widgets/nocontents/js/jquery.mobile.tizen.nocontents.js @@ -0,0 +1,163 @@ +/* *************************************************************************** + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * *************************************************************************** + * + * Author: Minkyu Kang + */ + +/* + * nocontents widget + * + * HTML Attributes + * + * data-role: set to 'nocontents'. + * data-type: type of nocontents. You can set text, picture, multimedia and unnamed. + * + * Deprecated in Tizen 2.0 beta : data-text1, data-text2 + * + * APIs + * + * N/A + * + * Events + * + * N/A + * + * Examples + * + * Default + *
                  + *

                  Unnamed Type

                  + *

                  Text

                  + *
                  + * + * + * Text Type + *
                  + * + * Picture Type + *
                  + * + * Multimedia Type + *
                  + * + * Unnamed Type + *
                  + * or + *
                  + * + */ + +(function ( $, window, undefined ) { + $.widget( "tizen.nocontents", $.mobile.widget, { + max_height: 0, + icon_img: null, + text_bg: null, + + _get_height: function () { + var $page = $('.ui-page'), + $content = $page.children('.ui-content'), + $header = $page.children('.ui-header'), + $footer = $page.children('.ui-footer'), + $view = $content.children('.ui-scrollview-view'), + header_h = $header.outerHeight() || 0, + footer_h = $footer.outerHeight() || 0, + padding_t = (parseFloat( $content.css('padding-top') ) || 0) + + (parseFloat( $view.css('padding-top') ) || 0), + padding_b = (parseFloat( $content.css('padding-bottom') ) || 0) + + (parseFloat( $view.css('padding-bottom') ) || 0), + content_h = $( window ).height() - header_h - footer_h - + (padding_t + padding_b); + + return content_h; + }, + + _align: function () { + var content_height = this._get_height(), + icon_height = this.icon_img.height(), + icon_width = this.icon_img.width(), + text_height = 0, + content_gap = 0, + text_top = 0, + icon_top = 0, + i; + + if ( this.text_bg.length ) { + text_height = $( this.text_bg[0] ).height() * this.text_bg.length; + content_gap = $( this.text_bg[0] ).height(); + } + + icon_top = ( content_height - ( icon_height + content_gap + text_height ) ) / 2; + + if ( icon_top < content_gap ) { + icon_top = content_gap; + } + + this.icon_img.css( 'left', + ( $( window ).width() - icon_width ) / 2 ); + this.icon_img.css( 'top', icon_top ); + + text_top = icon_top + icon_height + content_gap; + + for ( i = 0; i < this.text_bg.length; i++ ) { + $( this.text_bg[i] ).css( 'top', text_top ); + text_top += $( this.text_bg[i] ).height(); + } + }, + + _create: function () { + var elem = this.element, + icon_type = $( this.element ).jqmData('type'); + + switch ( icon_type ) { + case "picture": + case "multimedia": + case "text": + break; + default: + icon_type = "unnamed"; + break; + } + + $( elem ).addClass( "ui-nocontents" ); + this.icon_img = $('
                  '); + + this.text_bg = $( elem ).find("p").addClass("ui-nocontents-text"); + + $( elem ).prepend( this.icon_img ); + + this._align(); + + $( window ).bind( 'resize', function () { + $( elem ).nocontents( 'refresh' ); + }); + }, + + refresh: function () { + this._align(); + } + }); + + $( document ).bind( "pagecreate create", function ( e ) { + $( e.target ).find(":jqmData(role='nocontents')").nocontents(); + }); +}( jQuery, this )); diff --git a/src/widgets/notification/js/jquery.mobile.tizen.notification.js b/src/widgets/notification/js/jquery.mobile.tizen.notification.js new file mode 100644 index 0000000..613d9d4 --- /dev/null +++ b/src/widgets/notification/js/jquery.mobile.tizen.notification.js @@ -0,0 +1,298 @@ +/* *************************************************************************** + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * *************************************************************************** + * + * Author: Minkyu Kang + */ + +/* + * Notification widget + * + * HTML Attributes + * + * data-role: set to 'notification'. + * data-type: 'ticker' or 'popup'. + * + * APIs + * + * open(): open the notification. + * close(): close the notification. + * text(text0, text1): set texts or get texts + * icon(src): set the icon (tickernoti only) + * + * Events + * + * N/A + * + * Examples + * + * // tickernoti + *
                  + * + *

                  Hello World

                  + *

                  Denis

                  + *
                  + * + * // smallpopup + *
                  + *

                  Hello World

                  + *
                  + * + */ + +(function ( $, window ) { + $.widget( "tizen.notification", $.mobile.widget, { + btn: null, + text_bg: [], + icon_img: [], + running: false, + + _get_text: function () { + var text = new Array( 2 ); + + if ( this.type === 'ticker' ) { + text[0] = $( this.text_bg[0] ).text(); + text[1] = $( this.text_bg[1] ).text(); + } else { + text[0] = $( this.text_bg[0] ).text(); + } + + return text; + }, + + _set_text: function ( text0, text1 ) { + var _set = function ( elem, text ) { + if ( !text ) { + return; + } + elem.text( text ); + }; + + if ( this.type === 'ticker' ) { + _set( $( this.text_bg[0] ), text0 ); + _set( $( this.text_bg[1] ), text1 ); + } else { + _set( $( this.text_bg[0] ), text0 ); + } + }, + + text: function ( text0, text1 ) { + if ( text0 === undefined && text1 === undefined ) { + return this._get_text(); + } + + this._set_text( text0, text1 ); + }, + + icon: function ( src ) { + if ( src === undefined ) { + return; + } + + this.icon_img.detach(); + this.icon_img = $( "" ); + $( this.element ).find(".ui-ticker").append( this.icon_img ); + }, + + _refresh: function () { + var container = this._get_container(); + + $( container ).addClass("fix") + .removeClass("show") + .removeClass("hide"); + }, + + open: function () { + var container = this._get_container(); + + if ( this.running ) { + this._refresh(); + return; + } + + $( container ).addClass("show") + .removeClass("hide") + .removeClass("fix"); + + this.running = true; + + if ( this.type === 'popup' ) { + this._set_position(); + } + }, + + close: function () { + var container = this._get_container(); + + if ( !this.running ) { + return; + } + + $( container ).addClass("hide") + .removeClass("show") + .removeClass("fix"); + + this.running = false; + }, + + destroy: function () { + var container = this._get_container(); + + $( container ).removeClass("show") + .removeClass("hide") + .removeClass("fix"); + + this._del_event(); + + this.running = false; + }, + + _get_container: function () { + if ( this.type === 'ticker' ) { + return $( this.element ).find(".ui-ticker"); + } + + return $( this.element ).find(".ui-smallpopup"); + }, + + _add_event: function () { + var self = this, + container = this._get_container(); + + if ( this.type === 'ticker' ) { + container.find(".ui-ticker-btn").append( this.btn ); + + this.btn.bind( "vmouseup", function () { + self.close(); + }); + } + + container.bind( 'vmouseup', function () { + self.close(); + }); + }, + + _del_event: function () { + var container = this._get_container(); + + if ( this.type === 'ticker' ) { + this.btn.unbind("vmouseup"); + } + container.unbind('vmouseup'); + }, + + _set_position: function () { + var container = this._get_container(), + container_h = parseFloat( container.height() ), + $page = $('.ui-page'), + $footer = $page.children('.ui-footer'), + footer_h = $footer.outerHeight() || 0, + position = $( window ).height() - container_h - footer_h; + + container.css( 'top', position ); + }, + + _create: function () { + var self = this, + elem = $( this.element ), + i; + + this.btn = $("Close") + .tap( function ( event ) { + event.preventDefault(); + }) + .buttonMarkup({ + inline: true, + corners: true, + shadow: true + }); + + this.type = elem.jqmData('type') || 'popup'; + + if ( this.type === 'ticker' ) { + elem.wrapInner("
                  "); + elem.find(".ui-ticker").append("
                  " + + "
                  "); + this.text_bg = elem.find("p"); + + if ( this.text_bg.length < 2 ) { + elem.find(".ui-ticker").append("

                  "); + this.text_bg = elem.find("p"); + } else if ( this.text_bg.length > 2 ) { + for ( i = 2; i < this.text_bg.length; i++ ) { + $( this.text_bg[i] ).css( "display", "none" ); + } + } + + $( this.text_bg[0] ).addClass("ui-ticker-text1-bg"); + $( this.text_bg[1] ).addClass("ui-ticker-text2-bg"); + + this.icon_img = elem.find("img"); + + if ( this.icon_img.length ) { + $( this.icon_img ).addClass("ui-ticker-icon"); + + for ( i = 1; i < this.icon_img.length; i++ ) { + $( this.icon_img[i] ).css( "display", "none" ); + } + } + } else { + elem.wrapInner("
                  "); + this.text_bg = elem.find("p").addClass("ui-smallpopup-text-bg"); + + if ( this.text_bg.length < 1 ) { + elem.find(".ui-smallpopup") + .append("

                  "); + this.text_bg = elem.find("p"); + } else if ( this.text_bg.length > 1 ) { + for ( i = 1; i < this.text_bg.length; i++ ) { + $( this.text_bg[i] ).css( "display", "none" ); + } + } + + this._set_position(); + } + + this._add_event(); + + $( window ).bind( "resize", function () { + if ( !self.running ) { + return; + } + + self._refresh(); + + if ( self.type === 'popup' ) { + self._set_position(); + } + }); + } + }); // End of widget + + // auto self-init widgets + $( document ).bind( "pagecreate create", function ( e ) { + $( e.target ).find(":jqmData(role='notification')").notification(); + }); + + $( document ).bind( "pagebeforehide", function ( e ) { + $( e.target ).find(":jqmData(role='notification')").notification('destroy'); + }); +}( jQuery, this )); diff --git a/src/widgets/optionheader/css/optionheader.css b/src/widgets/optionheader/css/optionheader.css new file mode 100755 index 0000000..f179682 --- /dev/null +++ b/src/widgets/optionheader/css/optionheader.css @@ -0,0 +1,61 @@ +.ui-option-header { + overflow: hidden; +} + +.ui-option-header-1-row { + height: 65px; + border: none; +} +.ui-option-header-2-row { + height: 124px; + border: none; +} + +.ui-option-header-row-1 { + padding: 5px 5px 5px 5px; +} +.ui-option-header-row-2 { + margin-top: -2px; + padding: 0px 5px 6px 5px; +} + +/* for standard buttons */ +.ui-option-header .ui-btn { + display: block; + margin: 3px 5px 5px 5px; +} +.ui-option-header .ui-btn-text { + line-height: 34px; +} +.ui-option-header .ui-btn-inner { + padding-top: 6px; + padding-bottom: 6px; +} + +/* for segmented control */ +.ui-option-header .ui-controlgroup-horizontal .ui-btn { + display: inline-block !important; + margin: -3px !important; +} +.ui-option-header .ui-controlgroup, +.ui-option-header fieldset.ui-controlgroup { + margin-bottom: 0px !important; +} +.ui-option-header .ui-controlgroup-horizontal .ui-corner-left { + margin-left: 5px !important; +} +.ui-option-header .ui-controlgroup-horizontal .ui-corner-right { + margin-right: 5px !important; +} +<<<<<<< HEAD + +/* for the triangle */ +.ui-option-header-triangle-arrow { + top:-10px; + height:10px; + width:100%; + position:relative; + margin-bottom: -10px; +} +======= +>>>>>>> remotes/intel/master diff --git a/src/widgets/optionheader/js/jquery.mobile.tizen.optionheader.js b/src/widgets/optionheader/js/jquery.mobile.tizen.optionheader.js new file mode 100755 index 0000000..953936c --- /dev/null +++ b/src/widgets/optionheader/js/jquery.mobile.tizen.optionheader.js @@ -0,0 +1,472 @@ +/* + * jQuery Mobile Widget @VERSION + * + * This software is licensed under the MIT licence (as defined by the OSI at + * http://www.opensource.org/licenses/mit-license.php) + * + * *************************************************************************** + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. + * Copyright (c) 2011 by Intel Corporation Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to 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: Elliot Smith + */ + +// optionheader provides a collapsible toolbar for buttons and +// segmented controls directly under the title bar. It +// wraps a jQuery Mobile grid in a collapsible container; clicking +// on the container, or on one of the buttons inside the container, +// will collapse it. +// +// To add an option header to a page, mark up the header with a +// data-role="optionheader" attribute, as shown in this example: +// +//
                  +//

                  Option header - 3 buttons example

                  +//
                  +//
                  +// +// +// +//
                  +//
                  +//
                  +// +// The optionheader can also be used inline (e.g. in a content block or +// a widget). +// +// Alternatively, use $('...').optionheader() to apply programmatically. +// +// The grid inside the optionheader should be marked up as for +// a standard jQuery Mobile grid. (The widget has been tested with one +// or two rows of 2-4 columns each.) +// +// Note that if you use this with fixed headers, you may find that +// expanding the option header increases the page size so that scrollbars +// appear (jQuery Mobile's own collapsible content areas cause the +// same issue). You can alleviate this somewhat by calling the show() method +// on the page toolbars each time the size of the header changes. +// +// The widget is configurable via a data-options attribute on the same +// div as the data-role="optionheader" attribute, e.g. +// +//
                  +//

                  Option header - configured

                  +//
                  +//
                  +// +// +// +//
                  +//
                  +//
                  +// +// Options can also be set with $(...).optionheader('option', 'name', value). +// However, if you do this, you'll need to call $(...).optionheader('refresh') +// afterwards for the new values to take effect (note that optionheader() +// can be applied multiple times to an element without side effects). +// +// See below for the available options. +// +// Theme: by default, gets a 'b' swatch; override with data-theme="X" +// as per usual +// +// Options (can be set with a data-options attribute): +// +// {Boolean} [showIndicator=true] Set to true (the default) to show +// the upward-pointing arrow indicator on top of the title bar. +// {Boolean} [startCollapsed=false] Sets the appearance when the option +// header is first displayed; defaults to false (i.e. show the header +// expanded on first draw). NB setting this option later has no +// effect: use collapse() to collapse a widget which is already +// drawn. +// {Boolean} [expandable=true] Sets whether the header will expand +// in response to clicks; default = true. +// {Float} [duration=0.25] Duration of the expand/collapse animation. +// +// Methods (see below for docs): +// +// toggle(options) +// expand(options) +// collapse(options) +// +// Events: +// +// expand: Triggered when the option header is expanded +// collapse: Triggered when the option header is collapsed +// + + +(function ($, undefined) { + $.widget("tizen.optionheader", $.mobile.widget, { + options: { + initSelector: ":jqmData(role='optionheader')", + showIndicator: true, + theme: 's', + startCollapsed: false, + expandable: true, + duration: 0.25, + collapseOnInit : true, + default_font_size : $('html').css('font-size') + }, + collapsedHeight: '5px', + + _create: function () { + var options, + theme, + self = this, + elementHeight = 106, + parentPage, + dataOptions = this.element.jqmData( 'options' ), + page = this.element.closest( ':jqmData(role="page")' ); + // parse data-options + $.extend( this.options, dataOptions ); + + this.isCollapsed = this.options.collapseOnInit; + this.expandedHeight = null; + + // parse data-theme and reset options.theme if it's present + theme = this.element.jqmData( 'theme' ) || this.options.theme; + this.options.theme = theme; + + this.element.closest( ':jqmData(role="header")' ).addClass( "ui-option-header-resizing" ); + + // set up the click handler; it's done here so it can + // easily be removed, as there should only be one instance + // of the handler function for each class instance + this.clickHandler = function () { + self.toggle(); + }; + + /* Apply REM scaling */ + elementHeight = elementHeight / ( 36 / parseInt( $('html').css('font-size'), 10 ) ); + + if ( this.element.height() < elementHeight ) { + this.element.css( "height", elementHeight ); + } + + // get the element's dimensions + // and to set its initial collapse state; + // either do it now (if the page is visible already) + // or on pageshow + + if ( page.is(":visible") ) { + self.refresh(); + self._realize(); + } else { + self.refresh(); + + page.bind( "pagebeforeshow", function () { + self._setArrowLeft(); + self._realize(); + }); + } + self._setArrowLeft(); + // this.refresh(); + }, + + _realize: function () { + if ( !this.expandedHeight ) { + this.expandedHeight = this.element.height(); + } + + if ( this.isCollapsed ) { + // if (this.options.startCollapsed) { + this.collapse( {duration: 0} ); + } + }, + + _setArrowLeft: function () { + var matchingBtn = $( this.element ).jqmData( "for" ), + arrowCenter = 12, + matchBtn = $( this.element ).parents( ".ui-page" ).find( "#" + matchingBtn ), + siblingBtnCnt = matchBtn.prevAll(".ui-btn-right").length, + scaleFactor = ( 36 / parseInt( $('html').css('font-size'), 10 ) ); + + + if ( $(this.element).parents(".ui-page").find( "#" + matchingBtn ).length != 0 ) { + if ( this.options.expandable ) { + matchBtn.bind( 'vclick', this.clickHandler ); + } else { + matchBtn.unbind( 'vclick', this.clickHandler ); + } + + $( ".ui-triangle-image" ).css( "right", ( matchBtn.width() / 2 + matchBtn.width() * siblingBtnCnt - arrowCenter) / scaleFactor + "px"); + $( ".ui-triangle-image" ).css( "left", "auto" ); + } + }, + // Draw the option header, according to current options + refresh: function () { + var el = this.element, + arrow = $( '
                  ' ), + optionHeaderClass = 'ui-option-header', + gridRowSelector = '.ui-grid-a,.ui-grid-b,.ui-grid-c,.ui-grid-d,.ui-grid-e', + theme = this.options.theme, + numRows, + rowsClass, + themeClass, + klass, + o = $.extend( {grid: null} ), + $kids = el.find( "div" ).eq( 0 ).children().children(), + letter, + gridCols = {solo: 1, a: 2, b: 3, c: 4, d: 5}, + grid = o.grid; + + if ( !grid ) { + if ( $kids.length <= 5 ) { + for ( letter in gridCols ) { + if ( gridCols[ letter ] === $kids.length ) { + grid = letter; + } + } + numRows = $kids.length / gridCols[grid]; + } else { + numRows = 2; + } + } + + // count ui-grid-* elements to get number of rows + // numRows = el.find(gridRowSelector).length; + + // ...at least one row + // numRows = Math.max(1, numRows); + + // add classes to outer div: + // ui-option-header-N-row, where N = options.rows + // ui-bar-X, where X = options.theme (defaults to 'c') + // ui-option-header + rowsClass = 'ui-option-header-' + numRows + '-row'; + themeClass = 'ui-body-' + this.options.theme; + + el.removeClass( rowsClass ).addClass( rowsClass ); + el.removeClass( themeClass ).addClass( themeClass ); + el.removeClass( optionHeaderClass ).addClass( optionHeaderClass ); + + // remove any arrow currently visible + el.prev( '.ui-option-header-triangle-arrow' ).remove(); + // el.prev('.ui-triangle-container').remove(); + + // if there are elements inside the option header + // and this.options.showIndicator, + // insert a triangle arrow as the first element inside the + // optionheader div to show the header has hidden content + if ( this.options.showIndicator ) { + el.before( arrow ); + arrow.append("
                  "); + // arrow.triangle({"color": el.css('background-color'), offset: "50%"}); + } + + // if expandable, bind clicks to the toggle() method + if ( this.options.expandable ) { + // el.unbind('vclick', this.clickHandler).bind('vclick', this.clickHandler); + // arrow.unbind('vclick', this.clickHandler).bind('vclick', this.clickHandler); + el.bind( 'vclick', this.clickHandler ); + arrow.bind( 'vclick', this.clickHandler ); + + } else { + el.unbind( 'vclick', this.clickHandler ); + arrow.unbind( 'vclick', this.clickHandler ); + } + + // for each ui-grid-a element, add a class ui-option-header-row-M + // to it, where M is the xpath position() of the div + /* el.find(gridRowSelector).each(function (index) { + var klass = 'ui-option-header-row-' + (index + 1); + $(this).removeClass(klass).addClass(klass); + });*/ + klass = 'ui-option-header-row-' + ( numRows ); + el.find( "div" ).eq( 0 ).removeClass( klass ).addClass( klass ); + + // redraw the buttons (now that the optionheader has the right + // swatch) + el.find( '.ui-btn' ).each(function () { + $( this ).attr( 'data-' + $.mobile.ns + 'theme', theme ); + + // hack the class of the button to remove the old swatch + var klass = $( this ).attr( 'class' ); + klass = klass.replace(/ui-btn-up-\w{1}\s*/, ''); + klass = klass + ' ui-btn-up-' + theme; + $( this ).attr( 'class', klass ); + }); + }, + + _setHeight: function ( height, isCollapsed, options ) { + var self = this, + elt = this.element.get( 0 ), + duration, + commonCallback, + callback, + handler; + + options = options || {}; + + // set default duration if not specified + duration = options.duration; + if ( typeof duration == 'undefined' ) { + duration = this.options.duration; + } + + // the callback to always call after expanding or collapsing + commonCallback = function () { + self.isCollapsed = isCollapsed; + + if ( isCollapsed ) { + self.element.trigger( 'collapse' ); + } else { + self.element.trigger( 'expand' ); + } + }; + + // combine commonCallback with any user-specified callback + if ( options.callback ) { + callback = function () { + options.callback(); + commonCallback(); + }; + } else { + callback = function () { + commonCallback(); + }; + } + + // apply the animation + if ( duration > 0 && $.support.cssTransitions ) { + // add a handler to invoke a callback when the animation is done + + handler = { + handleEvent: function ( e ) { + elt.removeEventListener( 'webkitTransitionEnd', this ); + self.element.css( '-webkit-transition', null ); + callback(); + } + }; + + elt.addEventListener( 'webkitTransitionEnd', handler, false ); + + // apply the transition + this.element.css( '-webkit-transition', 'height ' + duration + 's ease-out' ); + this.element.css( 'height', height ); + } else { + // make sure the callback gets called even when there's no + // animation + this.element.css( 'height', height ); + callback(); + } + }, + + /** + * Toggle the expanded/collapsed state of the widget. + * {Object} [options] Configuration for the expand/collapse + * {Integer} [options.duration] Duration of the expand/collapse; + * defaults to this.options.duration + * {Function} options.callback Function to call after toggle completes + */ + + toggle: function ( options ) { + var toggle_header = this.element.parents( ":jqmData(role='header')" ), + toggle_content = this.element.parents( ":jqmData(role='page')" ).find( ".ui-content" ), + CollapsedTop = 110, + ExpandedTop = 206, + CalculateTime, + scaleFactor = ( 36 / parseInt( $('html').css('font-size'), 10 ) ); + + if ( toggle_header.children().is( ".input-search-bar" ) ) { + CollapsedTop = 218; + ExpandedTop = 314; + } + + /* Scale Factor */ + CollapsedTop = ( CollapsedTop / scaleFactor ); + ExpandedTop = ( ExpandedTop / scaleFactor ); + + if ( $( window ).scrollTop() <= CollapsedTop ) { +/* toggle_header.css( "position", "relative" ); + toggle_content.css( "top", "0px" ); */ +/* tizen beta request : optionheader remove slide */ + } + + if ( this.isCollapsed ) { + this.expand( options ); + + if ( $( window ).scrollTop() <= ExpandedTop ) { + CalculateTime = setTimeout( function () { +/* toggle_header.css( 'position', 'fixed' ); + toggle_content.css( 'top', ExpandedTop + "px" );*/ +/* tizen beta request : optionheader remove slide */ + }, 500 ); + } else { + // Need to move scroll top + toggle_header.css( 'position', 'fixed' ); + toggle_content.css( 'top', ExpandedTop + "px" ); + } + this.options.collapseOnInit = false; + } else { + this.collapse( options ); + if ( $(window).scrollTop() <= ExpandedTop ) { + CalculateTime = setTimeout( function () { +/* toggle_header.css( 'position', 'fixed' ); + toggle_content.css( 'top', CollapsedTop + "px" );*/ +/* tizen beta request : optionheader remove slide */ + }, 500 ); + } else { + toggle_header.css( 'position', 'fixed' ); + toggle_content.css( 'top', CollapsedTop + "px" ); + } + } + this.options.collapseOnInit = true; + }, + + _setDisabled: function ( value ) { + $.Widget.prototype._setOption.call( this, "disabled", value ); + this.element.add( this.element.prev( ".ui-triangle-container" ) )[value ? "addClass" : "removeClass"]("ui-disabled"); + }, + /** + * Takes the same options as toggle() + */ + collapse: function ( options ) { + var collapsedBarHeight = 10, + scaleFactor = ( 36 / parseInt( $('html').css('font-size'), 10 ) ); + + collapsedBarHeight = collapsedBarHeight / scaleFactor; + + // if (!this.isCollapsed) { + this._setHeight( collapsedBarHeight + "px", true, options ); + // } + }, + + /** + * Takes the same options as toggle() + */ + expand: function ( options ) { + // if (this.isCollapsed) { + this._setHeight( this.expandedHeight, false, options ); + // } + } + }); + + // auto self-init widgets + $(document).bind("pagecreate create", function ( e ) { + $($.tizen.optionheader.prototype.options.initSelector, e.target) + .not(":jqmData(role='none'), :jqmData(role='nojs')") + .optionheader(); + }); + +}(jQuery) ); diff --git a/src/widgets/pagecontrol/js/jquery.mobile.tizen.pagecontrol.js b/src/widgets/pagecontrol/js/jquery.mobile.tizen.pagecontrol.js new file mode 100644 index 0000000..a5c1634 --- /dev/null +++ b/src/widgets/pagecontrol/js/jquery.mobile.tizen.pagecontrol.js @@ -0,0 +1,189 @@ +/* *************************************************************************** + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * *************************************************************************** + * + * Author: Youmin Ha + */ + +/** + * Pagecontrol widget shows number bullets, receives touch event for each bullet, + * and runs your callback for each touch event. + * + * HTML Attributes: + * + * Pagecontrol widget uses
                  element as an element itself. It takes following attributes. + * + * data-role: This widget must have 'pagecontrol' as data-role value. + * data-max: Maximum nimber of pagecontrol bullets. This property must not exceed 10. + * data-value: Initially selected value of the pagecontrol widget. Must between 1 and data-max. If this attribute is not given, initial value is set to 1. + * + * APIs: + * + * setValue( value ) + * : Set current value. Actually triggers 'change' event to the widget with given value. + * @param[in] value A value to be changed. + * + * getValue( ) + * : Get current value. + * @return Current value. + * + * Events: + * + * change: Raised when a value is changed, by setting it by javascript, or by user's touch event. + * + * Examples: + * + *
                  + * ... + * + */ + +(function ($, undefined) { + $.widget( "tizen.pagecontrol", $.mobile.widget, { + options: { + initSelector: ":jqmData(role='pagecontrol')" + }, + + // subroutine: find a child by value + _getBtn: function ( value ) { + return $( this.element ).children( ":jqmData(value='" + value + "')" ); + }, + + // subroutine: change active button by value + _changeActiveBtn: function ( newNum ) { + var oldNum = $( this.element ).data( 'value' ); + + // Check value + if ( newNum < 1 || newNum > $( this.element ).data( "max" ) ) { + return false; + } + + this._getBtn( oldNum ).removeClass( 'page_n_' + oldNum ) + .addClass( 'page_n_dot' ); + this._getBtn( newNum ).removeClass( 'page_n_dot' ) + .addClass( 'page_n_' + newNum ); + }, + + _triggerChange: function ( event ) { + // Trigger change event + $( this ).trigger( 'change', $( this ).data( 'value' ) ); + }, + + _create: function ( ) { + }, + + _init: function ( ) { + var self = this, + e = this.element, + maxVal = e.data( "max" ), + value = e.attr( "data-value" ), + i = 0, + btn = null, + buf = null, + page_margin_class = 'page_n_margin_44'; + + + // Set default values + if ( ! maxVal ) { + maxVal = 1; + } else if ( maxVal > 10 ) { + maxVal = 10; + } + e.data( "max", maxVal ); + + if ( ! value ) { + value = 1; + } + e.data( "value", value ); + + // Set pagecontrol class + e.addClass( 'pagecontrol' ); + + // Set empty callback variable + self.changeCallback = null; + + // Calculate left/right margin + if ( maxVal <= 7 ) { + page_margin_class = 'page_n_margin_44'; + } else if ( maxVal == 8 ) { + page_margin_class = 'page_n_margin_35'; + } else if ( maxVal == 9 ) { + page_margin_class = 'page_n_margin_26'; + } else { + page_margin_class = 'page_n_margin_19'; + } + + + // Add dot icons + for ( i = 1; i <= maxVal; i++ ) { + btn = $( '
                  ' ); + e.append( btn ); + if ( i == value ) { + btn.removeClass( 'page_n_dot' ) + .addClass( 'page_n_' + i ); + } + // bind vclick event to each icon + btn.bind( 'vclick', this._triggerChange ); + } + + // pagecontrol element's change event + e.bind( 'change', function ( event, value ) { + // 1. Change activated button + self._changeActiveBtn( value ); + + // 2. Store new value (DO NOT change this order!) + e.data( 'value', value ); + + }); + }, + + value: function ( val ) { + var pc = $( this.element ); + + if ( val && typeof val == "number" ) { + this._changeActiveBtn( val ); + pc.data( 'value', val ); + } else { + return pc.data( "value" ); + } + } + + }); // end: $.widget() + + + $( document ).bind( "pagecreate create", function ( e ) { + $( $.tizen.pagecontrol.prototype.options.initSelector, e.target ) + .not( ":jqmData(role='none'), :jqmData(role='nojs')" ) + .pagecontrol( ); + }); + +} ( jQuery ) ); + diff --git a/src/widgets/pagelayout/js/jquery.mobile.tizen.pagelayout.js b/src/widgets/pagelayout/js/jquery.mobile.tizen.pagelayout.js new file mode 100755 index 0000000..502554d --- /dev/null +++ b/src/widgets/pagelayout/js/jquery.mobile.tizen.pagelayout.js @@ -0,0 +1,554 @@ +/* *************************************************************************** + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * *************************************************************************** + * + * Author: Jinhyuk Jun + */ + +(function ( $, undefined ) { + + $.widget( "mobile.pagelayout", $.mobile.widget, { + options: { + visibleOnPageShow: true, + disablePageZoom: true, + transition: "slide", //can be none, fade, slide (slide maps to slideup or slidedown) + fullscreen: false, + tapToggle: true, + 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. + // Testing fixed positioning is also pretty obtrusive to page load, requiring injected elements and scrolling the window + // The following function serves to rule out some popular browsers with known fixed-positioning issues + // This is a plugin option like any other, so feel free to improve or overwrite it + supportBlacklist: function () { + var w = window, + ua = navigator.userAgent, + platform = navigator.platform, + // Rendering engine is Webkit, and capture major version + wkmatch = ua.match( /AppleWebKit\/([0-9]+)/ ), + wkversion = !!wkmatch && wkmatch[ 1 ], + ffmatch = ua.match( /Fennec\/([0-9]+)/ ), + ffversion = !!ffmatch && ffmatch[ 1 ], + operammobilematch = ua.match( /Opera Mobi\/([0-9]+)/ ), + omversion = !!operammobilematch && operammobilematch[ 1 ]; + + if ( + // iOS 4.3 and older : Platform is iPhone/Pad/Touch and Webkit version is less than 534 (ios5) + ( ( platform.indexOf( "iPhone" ) > -1 || platform.indexOf( "iPad" ) > -1 || platform.indexOf( "iPod" ) > -1 ) && wkversion && wkversion < 534 ) + || + // Opera Mini + ( w.operamini && ({}).toString.call( w.operamini ) === "[object OperaMini]" ) + || + ( operammobilematch && omversion < 7458 ) + || + //Android lte 2.1: Platform is Android and Webkit version is less than 533 (Android 2.2) + ( ua.indexOf( "Android" ) > -1 && wkversion && wkversion < 533 ) + || + // Firefox Mobile before 6.0 - + ( ffversion && ffversion < 6 ) + || + // WebOS less than 3 + ( "palmGetResource" in window && wkversion && wkversion < 534 ) + || + // MeeGo + ( ua.indexOf( "MeeGo" ) > -1 && ua.indexOf( "NokiaBrowser/8.5.0" ) > -1 ) + ) { + return true; + } + + return false; + }, + initSelector: ":jqmData(role='content')" + }, + + _create: function () { + + var self = this, + o = self.options, + $el = self.element; + + // Feature detecting support for + if ( o.supportBlacklist() ) { + self.destroy(); + return; + } + + self._addFixedClass(); + self._addTransitionClass(); + self._bindPageEvents(); + + // only content + self._bindContentControlEvents(); + }, + + /* add minimum fixed css style to bar(header/footer) and content + * it need to update when core source modified(jquery.mobile.page.section.js) + * modified from core source cuz initSelector different */ + _addFixedClass: function () { + var self = this, + o = self.options, + $el = self.element, + $elHeader = $el.siblings( ":jqmData(role='header')" ), + $elFooter = $el.siblings( ":jqmData(role='footer')" ), + $elPage = $el.closest(".ui-page"); + + $elHeader.addClass( "ui-header-fixed" ); + $elFooter.addClass( "ui-footer-fixed" ); + + // "fullscreen" overlay positioning + if ( o.fullscreen ) { + $elHeader.addClass( "ui-header-fullscreen" ); + $elFooter.addClass( "ui-footer-fullscreen" ); + $elPage + .addClass( "ui-page-header-fullscreen" ) + .addClass( "ui-page-footer-fullscreen" ); + } else { + // If not fullscreen, add class to page to set top or bottom padding + $elPage.addClass( "ui-page-header-fixed" ) + .addClass( "ui-page-footer-fixed" ); + } + }, + + /* original core source(jquery.mobile.fixedToolbar.js) + * never changed */ + _addTransitionClass: function () { + var tclass = this.options.transition; + + if ( tclass && tclass !== "none" ) { + // use appropriate slide for header or footer + if ( tclass === "slide" ) { + tclass = this.element.is( ".ui-header" ) ? "slidedown" : "slideup"; + } + + this.element.addClass( tclass ); + } + }, + + + /* Set default page positon + * 1. add title style to header + * 2. Set default header/footer position */ + setHeaderFooter: function ( event ) { + var $elPage = $( event.target ), + $elHeader = $elPage.find( ":jqmData(role='header')" ).length ? $elPage.find( ":jqmData(role='header')") : $elPage.siblings( ":jqmData(role='header')"), + $elFieldcontain = $elHeader.find( ":jqmData(role='fieldcontain')" ), + $elControlgroup = $elHeader.find( ":jqmData(role='controlgroup')" ), + $elContent = $elPage.find( ".ui-content" ), + next_id, + $elFooter, + $elFooterGroup, + gLength, + footerButton, + tStyle = "normal", + headerBtnNum; + + if ( $elFieldcontain.length != 0 || $elControlgroup.length != 0 ) { + tStyle = "extended"; + } + + if ( $elHeader.jqmData("position") == "fixed" || $.tizen.frameworkData.theme.match(/tizen/) || $elHeader.css("position") == "fixed" ) { + $elHeader + .css( "position", "fixed" ) + .css( "top", "0px" ); + + if ( $elHeader.children().is(".ui-navbar") ) { + $elHeader.addClass( "ui-title-controlbar-height" ); + $( event.target ).find( ".ui-content" ).addClass( "ui-title-content-controlbar-height" ); + } else { + if ( $elHeader.length ) { + $( event.target ).find( ".ui-content" ).addClass( "ui-title-content-" + tStyle + "-height" ); + } else { + $( event.target ).find( ".ui-content" ).addClass( "ui-title-content-no-height" ); + } + } + } + + if ( $elHeader.children().is(".ui-option-header") ) { + $elContent.removeClass( "ui-title-content-" + tStyle + "-height" ); + if ( $.tizen.optionheader.prototype.options.collapseOnInit == true ) { + $elContent.addClass( "ui-title-content-option-header-collapsed-1line-height" ); + } else { + $elContent.addClass( "ui-title-content-option-header-expanded-1line-height" ); + } + } else if ( $elHeader.find("input").attr("type") === "search" || $elHeader.find("input").attr("type") === "tizen-search" || $elHeader.find("input").jqmData("type") == "search" || $elHeader.find("input").jqmData("type") == "tizen-search" ) { + $elContent.removeClass( "ui-title-content-" + tStyle + "-height" ).addClass( "ui-title-content-search" ); + } + + headerBtnNum = $elHeader.children("a").length; + if ( headerBtnNum > 0 || $elHeader.children().find(".ui-radio").length != 0 ) { + if ( tStyle != "normal" ) { + gLength = $elFieldcontain.length ? $elFieldcontain.find( ".ui-radio" ).length : $elControlgroup.find( "a" ).length; + + $elHeader.addClass( "ui-title-extended-height" ); + + $elFieldcontain.length ? $elFieldcontain.find( ".ui-controlgroup" ).addClass( "ui-title-extended-controlgroup" ).addClass( "ui-extended-controlgroup" ) : $elControlgroup.addClass( "ui-title-extended-button-controlgroup" ).addClass( "ui-extended-controlgroup" ); + + $elFieldcontain.length ? $elFieldcontain.addClass( "ui-title-extended-segment-style" ) : $elControlgroup.addClass( "ui-title-extended-segment-style" ); + + if ( gLength == 2 || gLength == 3 || gLength == 4 ) { + $elFieldcontain.length ? $elFieldcontain.addClass( "ui-title-extended-controlgroup-" + gLength + "btn" ) : $elControlgroup.addClass( "ui-title-extended-controlgroup-" + gLength + "btn" ); + } + } + $elContent.addClass( "ui-title-content-" + tStyle + "-height" ); + } + + // divide content mode scrollview and non-scrollview + // recalculate content area when resize callback occur + if ( $.support.scrollview ) { + if ( $elHeader.css( "position" ) != "fixed" ) { + $elHeader.css( "position", "fixed" ); + } + + } else { + if ( $elHeader.css("position") != "fixed" ) { + $elHeader.css( "position", "relative" ); + } + } + + $elFooter = $( document ).find( ":jqmData(role='footer')" ); + + if ( $elFooter.find(".ui-navbar").is(".ui-controlbar-s") ) { + $elFooter + .css( "bottom", 0 ) + .show(); + } + + if ( $elFooter.children().find(".ui-radio").length != 0 ) { + $elFooterGroup = $elFooter.find( ":jqmData(role='fieldcontain')" ); + gLength = $elFooterGroup.find( ".ui-radio" ).length; + + $elFooterGroup.find( ".ui-controlgroup" ) + .addClass( "ui-extended-controlgroup" ) + .addClass( "ui-footer-extended-controlgroup" ) + .css( "display", "inline" ); + + /* Groupcontrol cannot initialize inline property at first page */ + $elFooterGroup.addClass( "ui-footer-extended-controlgroup-" + gLength + "btn" ); + } + + footerButton = $elFooter.children( "a" ); + footerButton.each( function ( i ) { + if ( footerButton.eq( i ).is(".ui-btn") && !footerButton.eq( i ).is(".ui-btn-back") ) { + footerButton.eq( i ) + .removeClass( "ui-btn-left" ) + .addClass( "ui-btn-footer-right" ); + } + }); + + if ( $elFooter.is(".ui-footer-fixed") ) { + $elFooter.css( "bottom", 0 ); + } + + /* Increase Content size with dummy
                  because of footer height */ + if ( $elFooter.length != 0 && $( event.target ).find( ".dummy-div" ).length == 0 ) { + $( event.target ).find( ":jqmData(role='content')" ).append( '
                  ' ); + $( ".dummy-div" ) + .css( "width", $elFooter.width() ) + .css( "height", $elFooter.height() ); + } + + /* Header position fix(remove transition) */ + next_id = $( event.target ).attr( "id" ); + + $( "#" + next_id ).find( ":jqmData(role='header')" ) + .removeClass( "fade in out" ) + .appendTo( $.mobile.pageContainer ); + }, + + _bindPageEvents: function () { + var self = this, + o = self.options, + $el = self.element; + + //page event bindings + // Fixed toolbars require page zoom to be disabled, otherwise usability issues crop up + // This method is meant to disable zoom while a fixed-positioned toolbar page is visible + $el.closest( ".ui-page" ) + .bind( "pagebeforeshow", function ( event ) { + if ( o.disablePageZoom ) { + $.mobile.zoom.disable( true ); + } + if ( !o.visibleOnPageShow ) { + self.hide( true ); + } + self.setHeaderFooter( event ); + } ) + .bind( "webkitAnimationStart animationstart updatelayout", function ( e, data ) { + if ( o.updatePagePadding ) { + self.updatePagePadding(data); // FIXME: unused function. + self.updatePageLayout(data); + } + }) + + .bind( "pageshow", function ( event ) { + self.updatePagePadding(); // FIXME: unused function. + self._updateHeaderArea(); + if ( o.updatePagePadding ) { + $( window ).bind( "throttledresize." + self.widgetName, function () { + self.updatePagePadding(); // FIXME: unused function. + self.layoutPageIME(); // IME/resize reposition + self.updatePageLayout(); + self._updateHeaderArea(); + }); + } + + /* Header position fix(remove transition) */ + $( "body" ).children( ":jqmData(role='header')" ) + .insertBefore( $(event.target).find(":jqmData(role='content')").eq( 0 ) ); +/* new_header */ + }) + + .bind( "pagebeforehide", function ( e, ui ) { + if ( o.disablePageZoom ) { + $.mobile.zoom.enable( true ); + } + 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 ); + }); + } + } + }); + }, + + _bindContentControlEvents: function () { + var self = this, + o = self.options, + $el = self.element; + + $el.closest( ".ui-page" ) + .bind( "pagebeforeshow", function ( event ) { + + }); + }, + + _updateHeaderArea : function() { + var $elPage = $( ".ui-page-active" ), + $elHeader = $elPage.find( ":jqmData(role='header')" ).length ? $elPage.find( ":jqmData(role='header')") : $elPage.siblings( ":jqmData(role='header')"), + headerBtnNum = $elHeader.children("a").length, + headerSrcNum = $elHeader.children("img").length; + + $elHeader.find( "h1" ).css( "width", window.innerWidth - $elHeader.children( "a" ).width() * headerBtnNum - $elHeader.children( "a" ).width() / 4 - $elHeader.children( "img" ).width() * headerSrcNum * 3 ); + /* add half width for default space between text and button, and img tag area is too narrow, so multiply three for img width*/ + }, + + _visible: true, + _IMEShown : false, + _IMEindicatorHeight : window.outerHeight - window.innerHeight, + + layoutPageIME: function () { + if ( $( document.activeElement ).is( "input" ) || $( document.activeElement ).is( "textarea" ) + || $(".ui-page-active .ui-header .input-search-bar").length + || $(".ui-page-active .ui-content").find("input").length + || $(".ui-page-active .ui-content").find("textarea").length) { + /* Check vertical and horizontal ratio. + * If focus on input and two values are different, IME is drawed. */ + + if ( ( window.innerHeight + this._IMEindicatorHeight ) < window.outerHeight && window.innerWidth == window.outerWidth ) { + if ( this._IMEShown === false ) { + $( ".ui-page-active .ui-footer" ).hide(); + this._IMEShown = true; + } + } else if ( ( window.innerHeight + this._IMEindicatorHeight ) >= window.outerHeight ) { + if ( this._IMEShown === true ) { + $( ".ui-page-active .ui-footer" ).show(); + this._IMEShown = false; + } + } + } else { + if ( ( window.innerHeight + this._IMEindicatorHeight ) >= window.outerHeight ) { + if ( this._IMEShown === true ) { + $( ".ui-page-active .ui-footer" ).show(); + this._IMEShown = false; + } + } + } + }, + + // This will set the content element's top or bottom padding equal to the toolbar's height + updatePagePadding: function (data) { + var $el = this.element, + header = $el.is( ".ui-header" ); + + // This behavior only applies to "fixed", not "fullscreen" + if ( this.options.fullscreen ) { return; } + +// $el.closest( ".ui-page" ).css( "padding-" + ( header ? "top" : "bottom" ), $el.outerHeight() ); + }, + + + /* 1. Calculate toolbar width(only controlbar) + * 2. Calculate and update content height */ + updatePageLayout: function ( receiveType ) { + var $elFooter, + $elFooterControlbar, + $elPage = $( document ).find( ".ui-page-active" ), + $elHeader = $elPage.find( ":jqmData(role='header')" ), + $elContent = $elPage.find( ":jqmData(role='content')" ), + resultContentHeight = 0, + resultFooterHeight = 0, + resultHeaderHeight = 0; + + if ( $elPage.length ) { + $elFooter = $( document ).find( ".ui-page-active" ).find( ":jqmData(role='footer')" ); + } else { + $elFooter = $( document ).find( ":jqmData(role='footer')" ).eq( 0 ); + } + $elFooterControlbar = $elFooter.find( ".ui-navbar" ); + + // calculate footer height + resultFooterHeight = ( $elFooter.css( "display" ) == "none" ) ? 0 : $elFooter.height(); + resultHeaderHeight = ( $elHeader.css( "display" ) == "none" ) ? 0 : $elHeader.height(); + + if (resultFooterHeight != 0 ) { + $elFooter.css( "bottom", 0 ); + } + if ( $elFooterControlbar.jqmData("style") == "toolbar" ) { + $elFooterControlbar.css( "width", window.innerWidth - $elFooterControlbar.siblings( ".ui-btn" ).width() - parseInt($elFooterControlbar.siblings(".ui-btn").css("right"), 10 ) * 2 ); + } + + resultContentHeight = window.innerHeight - resultFooterHeight - resultHeaderHeight; + + if ( $.support.scrollview ) { + if ( $elHeader.css("position") != "fixed" ) { + $elHeader.css( "position", "fixed" ); + } + + $elContent.height( resultContentHeight - + parseFloat( $elContent.css("padding-top") ) - + parseFloat( $elContent.css("padding-bottom") ) ); + } else { + if ( $elHeader.css("position") != "fixed" ) { + $elHeader.css( "position", "relative" ); + } else { + $elContent.height( resultContentHeight ); + } + } + + // check this line need + // because another style title will be not supported to updatePageLayout + + // in case title changed + if ( receiveType ) { + $elContent.css( "top", resultHeaderHeight + "px" ); + } + }, + + _useTransition: function ( notransition ) { + var $win = $( window ), + $el = this.element, + scroll = $win.scrollTop(), + elHeight = $el.height(), + pHeight = $el.closest( ".ui-page" ).height(), + viewportHeight = $.mobile.getScreenHeight(), + tbtype = $el.is( ":jqmData(role='header')" ) ? "header" : "footer"; + + return !notransition && + ( this.options.transition && this.options.transition !== "none" && + ( + ( tbtype === "header" && !this.options.fullscreen && scroll > elHeight ) || + ( tbtype === "footer" && !this.options.fullscreen && scroll + viewportHeight < pHeight - elHeight ) + ) || this.options.fullscreen + ); + }, + + show: function ( notransition ) { +/* var hideClass = "ui-fixed-hidden", + $el = this.element; + + if ( this._useTransition( notransition ) ){ + $el + .removeClass( "out " + hideClass ) + .addClass( "in" ); + } + else { + $el.removeClass( hideClass ); + } + this._visible = true;*/ + }, + + hide: function ( notransition ) { +/* var hideClass = "ui-fixed-hidden", + $el = this.element, + // if it's a slide transition, our new transitions need the reverse class as well to slide outward + outclass = "out" + ( this.options.transition === "slide" ? " reverse" : "" ); + + if ( this._useTransition( notransition ) ){ + $el + .addClass( outclass ) + .removeClass( "in" ) + .animationComplete( function () { + $el.addClass( hideClass ).removeClass( outclass ); + }); + } + else { + $el.addClass( hideClass ).removeClass( outclass ); + } + this._visible = false;*/ + }, + + toggle: function () { + this[ this._visible ? "hide" : "show" ](); + }, + + /* support external api for adding backbutton via javascript */ +/* backButton: function ( target, status ){ + this._addBackbutton( target, "external" ); + }, +*/ + destroy: function () { + this.element.removeClass( "ui-header-fixed ui-footer-fixed ui-header-fullscreen ui-footer-fullscreen in out fade slidedown slideup ui-fixed-hidden" ); + this.element.closest( ".ui-page" ).removeClass( "ui-page-header-fixed ui-page-footer-fixed ui-page-header-fullscreen ui-page-footer-fullscreen" ); + } + + }); + + //auto self-init widgets + $( document ) + .bind( "pagecreate create", function ( e ) { + // DEPRECATED in 1.1: support for data-fullscreen=true|false on the page element. + // This line ensures it still works, but we recommend moving the attribute to the toolbars themselves. + if ( $( e.target ).jqmData( "fullscreen" ) ) { + $( $.mobile.pagelayout.prototype.options.initSelector, e.target ).not( ":jqmData(fullscreen)" ).jqmData( "fullscreen", true ); + } + $.mobile.pagelayout.prototype.enhanceWithin( e.target ); + }); + +})( jQuery ); diff --git a/src/widgets/pagelist/css/pagelist.css b/src/widgets/pagelist/css/pagelist.css new file mode 100644 index 0000000..4149d05 --- /dev/null +++ b/src/widgets/pagelist/css/pagelist.css @@ -0,0 +1,3 @@ +.ui-pagelist { + text-align: center; +} diff --git a/src/widgets/pagelist/js/jquery.mobile.tizen.pagelist.js b/src/widgets/pagelist/js/jquery.mobile.tizen.pagelist.js new file mode 100755 index 0000000..dec184a --- /dev/null +++ b/src/widgets/pagelist/js/jquery.mobile.tizen.pagelist.js @@ -0,0 +1,146 @@ +/* + * + * This software is licensed under the MIT licence (as defined by the OSI at + * http://www.opensource.org/licenses/mit-license.php) + * + * *************************************************************************** + * Copyright (c) 2011 by Intel Corporation Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * *************************************************************************** + */ + +// pagelist widget +// +// Given an element, this widget collects all links contained in the descendants of the element and constructs +// a popupwindow widget containing numbered buttons for each encountered link. +// +// You can mark any one element in your document with "data-pagelist='true'" and a pagelist will be created that +// will allow the user to navigate between the pages linked to within the element. +// +// Currently, only one pagelist can exist in a document and, once created, it cannot be modified. + +(function ( $, undefined ) { + + window.ensureNS( "jQuery.mobile.tizen" ); + + $.widget( "tizen.pagelist", $.tizen.widgetex, { + _htmlProto: { + ui: { + pageList: "#pagelist", + button: "#pagelist-button", + rowBreak: "#pagelist-rowbreak" + } + }, + _create: function () { + var self = this, + popPageList = false, + idx = 0; + + this._ui.button.remove(); + this._ui.rowBreak.remove(); + this._ui.pageList + .appendTo( $( "body" ) ) + .popupwindow() + .bind( "vclick", function ( e ) { + $( this ).popupwindow( "close" ); + } ); + + this.element.find( "a[href]" ).each( function ( elemIdx, elem ) { + if ( idx > 0 && ( ( idx % 10 ) != 0 ) ) { + self._ui.pageList.append( self._ui.rowBreak.clone() ); + } + + self._ui.button + .clone() + .attr( "href", $( elem ).attr( "href" ) ) + .text( ++idx ) + .appendTo( self._ui.pageList ) + .buttonMarkup() + .bind( "vclick", function () { self._ui.pageList.popupwindow( "close" ); } ) + .find( ".ui-btn-inner" ) + .css( { padding: 2 } ); + } ); + + $( document ).bind( "keydown", function ( e ) { + popPageList = ( e.keyCode === $.mobile.keyCode.CONTROL ); + } ); + $( document ).bind( "keyup", function ( e ) { + if ( e.keyCode === $.mobile.keyCode.CONTROL && popPageList ) { + var maxDim = { cx: 0, cy: 0 }; + self._ui.pageList.popupwindow( "open", undefined, 0 ); + self._ui.pageList.find( "a" ) + .each( function () { + var btn = $( this ), + dim = { + cx: btn.outerWidth( true ), + cy: btn.outerHeight( true ) + }; + + // Make sure things will be even later, because padding cannot have decimals - apparently :-S + if ( dim.cx % 2 ) { + btn.css( "padding-left", parseInt( btn.css( "padding-left" ), 10 ) + 1 ); + } + if ( dim.cy % 2 ) { + btn.css( "padding-bottom", parseInt( btn.css( "padding-bottom" ), 10 ) + 1 ); + } + + maxDim.cx = Math.max( maxDim.cx, dim.cx ); + maxDim.cy = Math.max( maxDim.cy, dim.cy ); + } ) + .each( function () { + var padding = { + h: Math.max( 0, ( maxDim.cx - $( this ).outerWidth( true ) ) / 2 ), + v: Math.max( 0, ( maxDim.cy - $( this ).outerHeight( true ) ) / 2 ) + }, + btn = $( this ), + inner = btn.find( ".ui-btn-inner" ); + + inner.css( { + "padding-left" : parseInt( inner.css( "padding-left" ), 10 ) + padding.h, + "padding-top" : parseInt( inner.css( "padding-top" ), 10 ) + padding.v, + "padding-right" : parseInt( inner.css( "padding-right" ), 10 ) + padding.h, + "padding-bottom" : parseInt( inner.css( "padding-bottom" ), 10 ) + padding.v + } ); + btn[( ( btn.attr( "href" ) === "#" + $.mobile.activePage.attr( "id" ) ) ? "addClass" : "removeClass" )]( "ui-btn-active" ); + } ); + e.stopPropagation(); + e.preventDefault(); + } + popPageList = false; + } ); + } + } ); + + // Look for an element marked as a pagelist and assign $.mobile.tizen.pagelist with a newly created pagelist. + // If $.mobile.tizen.pagelist is already assigned, ignore any new "data-pagelist='true'" designations. + $( document ).bind( "pagecreate create", function ( e ) { + $( ":jqmData(pagelist='true')", e.target ) + .not( ":jqmData(role='none'), :jqmData(role='nojs')" ) + .each( function () { + if ( $.mobile.tizen.pagelist === undefined ) { + $.extend( $.mobile.tizen, { + pagelist: $( this ).pagelist() + } ); + } + return false; + } ); + } ); + +}( jQuery ) ); diff --git a/src/widgets/pagelist/proto-html/pagelist.prototype.html b/src/widgets/pagelist/proto-html/pagelist.prototype.html new file mode 100644 index 0000000..024388d --- /dev/null +++ b/src/widgets/pagelist/proto-html/pagelist.prototype.html @@ -0,0 +1,4 @@ +
                  + +

                  +
                  diff --git a/src/widgets/popupwindow/js/jquery.mobile.tizen.popupwindow.js b/src/widgets/popupwindow/js/jquery.mobile.tizen.popupwindow.js new file mode 100755 index 0000000..dddd28d --- /dev/null +++ b/src/widgets/popupwindow/js/jquery.mobile.tizen.popupwindow.js @@ -0,0 +1,479 @@ +/* + * jQuery Mobile Widget @VERSION + * + * This software is licensed under the MIT licence (as defined by the OSI at + * http://www.opensource.org/licenses/mit-license.php) + * + * *************************************************************************** + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. + * Copyright (c) 2011 by Intel Corporation Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to 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: Gabriel Schulhof , + * Elliot Smith + */ + +/* + * Shows other elements inside a popup window. + * + * To apply, add the attribute data-role="popupwindow" to a
                  element inside + * a page. Alternatively, call popupwindow() + * on an element, eg : + * + * $("#mypopupwindowContent").popupwindow(); + * where the html might be : + *
                  + * + * To trigger the popupwindow to appear, it is necessary to make a call to its + * 'open()' method. This is typically done by binding a function to an event + * emitted by an input element, such as a the clicked event emitted by a button + * element. The open() method takes two arguments, specifying the x and y + * screen coordinates of the center of the popup window. + + * You can associate a button with a popup window like this: + *
                  + * + * + * + * + * + *
                  Eenie Meenie Mynie Mo
                  Catch-a Tiger By-the Toe
                  If-he Hollers Let-him Go
                  Eenie Meenie Mynie Mo
                  + *
                  + * Show popup + * + * Options: + * + * theme: String; the theme for the popupwindow contents + * Default: null + * + * overlayTheme: String; the theme for the popupwindow + * Default: null + * + * shadow: Boolean; display a shadow around the popupwindow + * Default: true + * + * corners: Boolean; display a shadow around the popupwindow + * Default: true + * + * fade: Boolean; fades the opening and closing of the popupwindow + * + * transition: String; the transition to use when opening or closing + * a popupwindow + * Default: $.mobile.defaultDialogTransition + * + * Events: + * popupbeforeposition: triggered after a popup has completed preparations for opening, but has not yet opened + * popupafteropen: triggered after a popup has completely opened + * popupafterclose triggered when a popup has completely closed +*/ + +(function ( $, undefined ) { + $.widget( "tizen.popupwindow", $.tizen.widgetex, { + options: { + theme: null, + overlayTheme: "s", + style: "custom", + disabled: false, + shadow: true, + corners: true, + fade: false, + opacity: 0.7, + widthRatio: 0.8612, + transition: $.mobile.defaultDialogTransition, + initSelector: ":jqmData(role='popupwindow')" + }, + + _htmlProto: { + ui: { + screen: "#popupwindow-screen", + container: "#popupwindow-container" + } + }, + + _setStyle: function () { + var popup = this.element, + style = popup.attr( 'data-style' ); + + if ( style ) { + this.options.style = style; + } + + popup.addClass( this.options.style ); + popup.find( ":jqmData(role='title')" ) + .wrapAll( "" ); + popup.find( ":jqmData(role='text')" ) + .wrapAll( "" ); + popup.find( ":jqmData(role='button-bg')" ) + .wrapAll( "" ); + popup.find( ":jqmData(role='check-bg')" ) + .wrapAll( "" ); + popup.find( ":jqmData(role='scroller-bg')" ) + .wrapAll( "" ); + popup.find( ":jqmData(role='text-bottom-bg')" ) + .wrapAll( "" ); + popup.find( ":jqmData(role='text-left')" ) + .wrapAll( "" ); + popup.find( ":jqmData(role='text-right')" ) + .wrapAll( "" ); + popup.find( ":jqmData(role='progress-bg')" ) + .wrapAll( "" ); + }, + + _create: function () { + var thisPage = this.element.closest(":jqmData(role='page')"), + self = this; + + if ( thisPage.length === 0 ) { + thisPage = $("body"); + } + + this._ui.placeholder = + $( "
                  " ) + .css("display", "none") + .insertBefore( this.element ); + + thisPage.append( this._ui.screen ); + this._ui.container.insertAfter( this._ui.screen ); + this._ui.container.append( this.element ); + + this._setStyle(); + + this._isOpen = false; + + this._ui.screen.bind( "vclick", function ( e ) { + self.close(); + return false; + } ); + }, + + destroy: function () { + this.element.insertBefore( this._ui.placeholder ); + + this._ui.placeholder.remove(); + this._ui.container.remove(); + this._ui.screen.remove(); + this.element.triggerHandler("destroyed"); + $.Widget.prototype.destroy.call( this ); + }, + + _placementCoords: function ( x, y, cw, ch ) { + var screenHeight = $( window ).height(), + screenWidth = $( window ).width(), + halfheight = ch / 2, + maxwidth = parseFloat( this._ui.container.css( "max-width" ) ), + roomtop = y, + roombot = screenHeight - y, + newtop, + newleft; + + if ( roomtop > ch / 2 && roombot > ch / 2 ) { + newtop = y - halfheight; + } else { + newtop = roomtop > roombot ? screenHeight - ch - 30 : 30; + } + + if ( cw < maxwidth ) { + newleft = ( screenWidth - cw ) / 2; + } else { + newleft = x - cw / 2; + + if ( newleft < 10 ) { + newleft = 10; + } else if ( ( newleft + cw ) > screenWidth ) { + newleft = screenWidth - cw - 10; + } + } + + return { x : newleft, y : newtop }; + }, + + _setPosition: function ( x_where, y_where ) { + var x = ( undefined === x_where ? $( window ).width() / 2 : x_where ), + y = ( undefined === y_where ? $( window ).height() / 2 : y_where ), + coords, + ctxpopup = this.element.data("ctxpopup"), + popupWidth, + menuHeight, + menuWidth, + screenHeight, + screenWidth, + roomtop, + roombot, + halfheight, + maxwidth, + newtop, + newleft; + + if ( !ctxpopup ) { + popupWidth = $( window ).width() * this.options.widthRatio; + this._ui.container.css( "width", popupWidth ); + + if ( this._ui.container.outerWidth() > $( window ).width() ) { + this._ui.container.css( {"max-width" : $( window ).width() - 30} ); + } + } + + coords = this._placementCoords( x, y, + this._ui.container.outerWidth(), + this._ui.container.outerHeight() ); + + menuHeight = this._ui.container.innerHeight(); + menuWidth = this._ui.container.innerWidth(); + screenHeight = $( window ).height(); + screenWidth = $( window ).width(); + roomtop = y; + roombot = screenHeight - y; + halfheight = menuHeight / 2; + maxwidth = parseFloat( this._ui.container.css( "max-width" ) ); + newtop = ( screenHeight - menuHeight ) / 2; + + if ( menuWidth < maxwidth ) { + newleft = ( screenWidth - menuWidth ) / 2; + } else { + newleft = x - menuWidth / 2; + + if ( newleft < 30 ) { + newleft = 30; + } else if ( ( newleft + menuWidth ) > screenWidth ) { + newleft = screenWidth - menuWidth - 30; + } + } + + if ( ctxpopup ) { + newtop = coords.y; + newleft = coords.x; + } + + this._ui.container.css({ + top: newtop, + left: newleft + }); + + this._ui.screen.css( "height", screenHeight ); + }, + + open: function ( x_where, y_where ) { + var self = this, + zIndexMax = 0; + + if ( this._isOpen || this.options.disabled ) { + return; + } + + $( document ).find("*").each( function () { + var el = $( this ), + zIndex = parseInt( el.css("z-index"), 10 ); + + if ( !( el.is( self._ui.container ) || + el.is( self._ui.screen ) || + isNaN( zIndex ))) { + zIndexMax = Math.max( zIndexMax, zIndex ); + } + } ); + + this._ui.screen.css( "height", $( window ).height() ) + .removeClass("ui-screen-hidden"); + + if ( this.options.fade ) { + this._ui.screen.animate( {opacity: this.options.opacity}, "fast" ); + } else { + this._ui.screen.css( {opacity: this.options.opacity} ); + } + + this._setPosition( x_where, y_where ); + + this.element.trigger("popupbeforeposition"); + + this._ui.container + .removeClass("ui-selectmenu-hidden") + .addClass("in") + .animationComplete( function () { + self.element.trigger("popupafteropen"); + } ); + + this._isOpen = true; + + if ( !this._reflow ) { + this._reflow = function () { + if ( !self._isOpen ) { + return; + } + + self._setPosition( x_where, y_where ); + }; + + $( window ).bind( "resize", this._reflow ); + } + }, + + close: function () { + if ( !this._isOpen ) { + return; + } + + if ( this._reflow ) { + $( window ).unbind( "resize", this._reflow ); + this._reflow = null; + } + + var self = this, + hideScreen = function () { + self._ui.screen.addClass("ui-screen-hidden"); + self._isOpen = false; + }; + + this._ui.container.removeClass("in").addClass("reverse out"); + + if ( this.options.transition === "none" ) { + this._ui.container + .addClass("ui-selectmenu-hidden") + .removeAttr("style"); + this.element.trigger("popupafterclose"); + } else { + this._ui.container.animationComplete( function () { + self._ui.container + .removeClass("reverse out") + .addClass("ui-selectmenu-hidden") + .removeAttr("style"); + self.element.trigger("popupafterclose"); + } ); + } + + if ( this.options.fade ) { + this._ui.screen.animate( {opacity: 0}, "fast", hideScreen ); + } else { + hideScreen(); + } + }, + + _realSetTheme: function ( dst, theme ) { + var classes = ( dst.attr("class") || "" ).split(" "), + alreadyAdded = true, + currentTheme = null, + matches; + + while ( classes.length > 0 ) { + currentTheme = classes.pop(); + matches = currentTheme.match(/^ui-body-([a-z])$/); + + if ( matches && matches.length > 1 ) { + currentTheme = matches[1]; + break; + } else { + currentTheme = null; + } + } + + dst.removeClass( "ui-body-" + currentTheme ); + if ( ( theme || "" ).match(/[a-z]/) ) { + dst.addClass( "ui-body-" + theme ); + } + }, + + _setTheme: function ( value ) { + this._realSetTheme( this.element, value ); + this.options.theme = value; + this.element.attr( "data-" + ( $.mobile.ns || "" ) + "theme", value ); + }, + + _setOverlayTheme: function ( value ) { + this._realSetTheme( this._ui.container, value ); + this.options.overlayTheme = value; + this.element.attr( "data-" + ( $.mobile.ns || "" ) + "overlay-theme", value ); + }, + + _setShadow: function ( value ) { + this.options.shadow = value; + this.element.attr( "data-" + ( $.mobile.ns || "" ) + "shadow", value ); + this._ui.container[value ? "addClass" : "removeClass"]("ui-overlay-shadow"); + }, + + _setCorners: function ( value ) { + this.options.corners = value; + this.element.attr( "data-" + ( $.mobile.ns || "" ) + "corners", value ); + this._ui.container[value ? "addClass" : "removeClass"]("ui-corner-all"); + }, + + _setFade: function ( value ) { + this.options.fade = value; + this.element.attr( "data-" + ( $.mobile.ns || "" ) + "fade", value ); + }, + + _setTransition: function ( value ) { + this._ui.container + .removeClass( this.options.transition || "" ) + .addClass( value ); + this.options.transition = value; + this.element.attr( "data-" + ( $.mobile.ns || "" ) + "transition", value ); + }, + + _setDisabled: function ( value ) { + $.Widget.prototype._setOption.call( this, "disabled", value ); + if ( value ) { + this.close(); + } + } + }); + + $.tizen.popupwindow.bindPopupToButton = function ( btn, popup ) { + if ( btn.length === 0 || popup.length === 0 ) { + return; + } + + var btnVClickHandler = function ( e ) { + if ( !popup.jqmData("overlay-theme-set") ) { + popup.popupwindow( "option", "overlayTheme", btn.jqmData("theme") ); + } + + popup.popupwindow( "open", + btn.offset().left + btn.outerWidth() / 2, + btn.offset().top + btn.outerHeight() / 2 ); + + return false; + }; + + if ( ( popup.popupwindow("option", "overlayTheme") || "" ).match(/[a-z]/) ) { + popup.jqmData( "overlay-theme-set", true ); + } + + btn + .attr({ + "aria-haspopup": true, + "aria-owns": btn.attr("href") + }) + .removeAttr("href") + .bind( "vclick", btnVClickHandler ); + + popup.bind( "destroyed", function () { + btn.unbind( "vclick", btnVClickHandler ); + } ); + }; + + $( document ).bind( "pagecreate create", function ( e ) { + $( $.tizen.popupwindow.prototype.options.initSelector, e.target ) + .not(":jqmData(role='none'), :jqmData(role='nojs')") + .popupwindow(); + + $( "a[href^='#']:jqmData(rel='popupwindow')", e.target ).each( function () { + $.tizen.popupwindow.bindPopupToButton( $( this ), $( $( this ).attr("href") ) ); + }); + }); +}( jQuery )); diff --git a/src/widgets/popupwindow/less/popupwindow.less b/src/widgets/popupwindow/less/popupwindow.less new file mode 100644 index 0000000..ebbd635 --- /dev/null +++ b/src/widgets/popupwindow/less/popupwindow.less @@ -0,0 +1,17 @@ +.ui-popupwindow-padding { + padding: 6px; +} + +.ui-popupwindow { + display: inline-block; + position: absolute; + padding: 0; + z-index: 100 !important; +} + +.ui-popupwindow-screen { + background: #000000; + opacity: 0; + box-sizing: border-box; + -moz-box-sizing: border-box; +} diff --git a/src/widgets/popupwindow/proto-html/popupwindow.prototype.html b/src/widgets/popupwindow/proto-html/popupwindow.prototype.html new file mode 100644 index 0000000..580dbaa --- /dev/null +++ b/src/widgets/popupwindow/proto-html/popupwindow.prototype.html @@ -0,0 +1,4 @@ +
                  + + +
                  diff --git a/src/widgets/popupwindow_ctxpopup/css/jquery.mobile.tizen.ctxpopup.css b/src/widgets/popupwindow_ctxpopup/css/jquery.mobile.tizen.ctxpopup.css new file mode 100644 index 0000000..fdc4071 --- /dev/null +++ b/src/widgets/popupwindow_ctxpopup/css/jquery.mobile.tizen.ctxpopup.css @@ -0,0 +1,21 @@ +/* + * 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/js/jquery.mobile.tizen.ctxpopup.js b/src/widgets/popupwindow_ctxpopup/js/jquery.mobile.tizen.ctxpopup.js new file mode 100755 index 0000000..2d358c6 --- /dev/null +++ b/src/widgets/popupwindow_ctxpopup/js/jquery.mobile.tizen.ctxpopup.js @@ -0,0 +1,260 @@ +/* + * jQuery Mobile Widget @VERSION + * + * This software is licensed under the MIT licence (as defined by the OSI at + * http://www.opensource.org/licenses/mit-license.php) + * + * *************************************************************************** + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. + * Copyright (c) 2011 by Intel Corporation Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to 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: Gabriel Schulhof + */ + +// This widget is implemented in an extremely ugly way. It should derive from $.tizen.popupwindow, but it doesn't +// because there's a bug in jquery.ui.widget.js which was fixed in jquery-ui commit +// b9153258b0f0edbff49496ed16d2aa93bec07d95. Once a version of jquery-ui containing that commit is released +// (probably >= 1.9m5), and jQuery Mobile picks up the widget from there, this widget needs to be rewritten properly. +// The problem is that, when a widget inherits from a superclass and declares an object in its prototype identical in key +// to one in the superclass, upon calling $.widget the object is overwritten in both the prototype of the superclass and +// the prototype of the subclass. The prototype of the superclass should remain unchanged. + +(function ( $, undefined ) { + $.widget( "tizen.ctxpopup", $.tizen.widgetex, { + options: $.extend( {}, $.tizen.popupwindow.prototype.options, { + initSelector: ":not(:not(" + $.tizen.popupwindow.prototype.options.initSelector + ")):not(:not(:jqmData(show-arrow='true'), :jqmData(show-arrow)))" + } ), + + _htmlProto: { + ui: { + outer : "#outer", + container : "#container", // the key has to have the name "container" + arrow : { + all : ":jqmData(role='triangle')", + l : "#left", + t : "#top", + r : "#right", + b : "#bottom" + } + } + }, + + _create: function () { + if ( !this.element.data( "popupwindow" ) ) { + this.element.popupwindow(); + } + + this.element.data( "popupwindow" ) + ._ui.container + .removeClass( "ui-popupwindow-padding" ) + .append( this._ui.outer ); + this._ui.outer.trigger( "create" ); // Creates the triangle widgets + this._ui.container + .addClass( "ui-popupwindow-padding" ) + .append( this.element ); + }, + + _setOption: function ( key, value ) { + $.tizen.popupwindow.prototype._setOption.apply( this.element.data( "popupwindow" ), arguments ); + this.options[key] = value; + } + } ); + + var origOpen = $.tizen.popupwindow.prototype.open, + orig_setOption = $.tizen.popupwindow.prototype._setOption, + orig_placementCoords = $.tizen.popupwindow.prototype._placementCoords; + + $.tizen.popupwindow.prototype._setOption = function ( key, value ) { + var ctxpopup = this.element.data( "ctxpopup" ), + needsApplying = true, + origContainer; + if ( ctxpopup ) { + if ( "shadow" === key || "overlayTheme" === key || "corners" === key ) { + origContainer = this._ui.container; + + this._ui.container = ctxpopup._ui.container; + orig_setOption.apply( this, arguments ); + this._ui.container = origContainer; + needsApplying = false; + } + ctxpopup.options[key] = value; + } + + if ( needsApplying ) { + orig_setOption.apply(this, arguments); + } + }; + + $.tizen.popupwindow.prototype._placementCoords = function ( x, y, cx, cy ) { + var ctxpopup = this.element.data( "ctxpopup" ), + self = this, + coords = {}, + minDiff, + minDiffIdx; + + function getCoords( arrow, x_factor, y_factor ) { + // Unhide the arrow we want to test to take it into account + ctxpopup._ui.arrow.all.hide(); + ctxpopup._ui.arrow[arrow].show(); + + var isHorizontal = ( "b" === arrow || "t" === arrow ), + // Names of keys used in calculations depend on whether things are horizontal or not + coord = ( isHorizontal + ? { point: "x", size: "cx", beg: "left", outerSize: "outerWidth", niceSize: "width", triangleSize : "height" } + : { point: "y", size: "cy", beg: "top", outerSize: "outerHeight", niceSize: "height", triangleSize : "width" } ), + size = { + cx : self._ui.container.width(), + cy : self._ui.container.height() + }, + halfSize = { + cx : size.cx / 2, + cy : size.cy / 2 + }, + desired = { + "x" : x + halfSize.cx * x_factor, + "y" : y + halfSize.cy * y_factor + }, + orig = orig_placementCoords.call( self, desired.x, desired.y, size.cx, size.cy ), + + // The triangleOffset must be clamped to the range described below: + // + // +-------... + // | /\ + // | / \ + // ----+--+-,-----... + //lowerDiff -->____| |/ <-- possible rounded corner + //triangle size --> | /| + // ____|/ | + // ^ |\ | <-- lowest possible offset for triangle + // actual range of | | \| + // arrow offset | | | + // values due to | . . Payload table cell looks like + // possible rounded | . . a popup window, and it may have + // corners and arrow | . . arbitrary things like borders, + // triangle size - | | | shadows, and rounded corners. + // our clamp range | | /| + // _v__|/ | + //triangle size --> |\ | <-- highest possible offset for triangle + // ____| \| + //upperDiff --> | |\ <-- possible rounded corner + // ----+--+-'-----... + // | \ / + // | \/ + // +-------... + // + // We calculate lowerDiff and upperDiff by considering the offset and width of the payload (this.element) + // versus the offset and width of the element enclosing the triangle, because the payload is inside + // whatever decorations (such as borders, shadow, rounded corners) and thus can give a reliable indication + // of the thickness of the combined decorations + + arrowBeg = ctxpopup._ui.arrow[arrow].offset()[coord.beg], + arrowSize = ctxpopup._ui.arrow[arrow][coord.outerSize]( true ), + payloadBeg = self.element.offset()[coord.beg], + payloadSize = self.element[coord.outerSize]( true ), + triangleSize = ctxpopup._ui.arrow[arrow][coord.triangleSize](), + triangleOffset = + Math.max( + triangleSize // triangle size + + Math.max( 0, payloadBeg - arrowBeg ), // lowerDiff + Math.min( + arrowSize // bottom + - triangleSize // triangle size + - Math.max( 0, arrowBeg + arrowSize - ( payloadBeg + payloadSize ) ), // upperDiff + arrowSize / 2 // arrow unrestricted offset + + desired[coord.point] + - orig[coord.point] + - halfSize[coord.size] + ) + ), + // Triangle points here + final = { + "x": orig.x + ( isHorizontal ? triangleOffset : 0) + ("r" === arrow ? size.cx : 0), + "y": orig.y + (!isHorizontal ? triangleOffset : 0) + ("b" === arrow ? size.cy : 0) + }, + ret = { + actual : orig, + triangleOffset : triangleOffset, + absDiff : Math.abs( x - final.x ) + Math.abs( y - final.y ) + }; + + // Hide it back + ctxpopup._ui.arrow[arrow].hide(); + + return ret; + } + + if ( ctxpopup ) { + // Returns: + // { + // absDiff: int + // triangleOffset: int + // actual: { x: int, y: int } + // } + + coords = { + l : getCoords( "l", 1, 0 ), + r : getCoords( "r", -1, 0 ), + t : getCoords( "t", 0, 1 ), + b : getCoords( "b", 0, -1 ) + }; + + $.each( coords, function ( key, value ) { + if ( minDiff === undefined || value.absDiff < minDiff ) { + minDiff = value.absDiff; + minDiffIdx = key; + } + } ); + + // Side-effect: show the appropriate arrow and move it to the right offset + ctxpopup._ui.arrow[minDiffIdx] + .show() + .triangle( "option", "offset", coords[minDiffIdx].triangleOffset ); + return coords[minDiffIdx].actual; + } + + return orig_placementCoords.call( this, x, y, cx, cy ); + }; + + $.tizen.popupwindow.prototype.open = function ( x, y ) { + var ctxpopup = this.element.data( "ctxpopup" ); + + if ( ctxpopup ) { + this._setFade( false ); + this._setShadow( false ); + this._setCorners( false ); + this._setOverlayTheme( null ); + this._setOption( "overlayTheme", ctxpopup.options.overlayTheme ); + ctxpopup._ui.arrow.all.triangle( "option", "color", ctxpopup._ui.container.css( "background-color" ) ); + + // temporary + $( '.ui-popupwindow' ).css( 'background', 'none' ); + } + + origOpen.call( this, x, y ); + }; + + //auto self-init widgets + $( document ).bind( "pagecreate create", function ( e ) { + var ctxpopups = $( $.tizen.ctxpopup.prototype.options.initSelector, e.target ); + $.tizen.ctxpopup.prototype.enhanceWithin( e.target ); + } ); +}( jQuery ) ); diff --git a/src/widgets/popupwindow_ctxpopup/less/jquery.mobile.tizen.ctxpopup.less b/src/widgets/popupwindow_ctxpopup/less/jquery.mobile.tizen.ctxpopup.less new file mode 100644 index 0000000..b79df71 --- /dev/null +++ b/src/widgets/popupwindow_ctxpopup/less/jquery.mobile.tizen.ctxpopup.less @@ -0,0 +1,11 @@ +.ui-ctxpopup { + display: table; + + .ui-ctxpopup-row { + display: table-row; + + .ui-ctxpopup-cell { + display: table-cell; + } + } +} diff --git a/src/widgets/popupwindow_ctxpopup/proto-html/ctxpopup.prototype.html b/src/widgets/popupwindow_ctxpopup/proto-html/ctxpopup.prototype.html new file mode 100644 index 0000000..a494376 --- /dev/null +++ b/src/widgets/popupwindow_ctxpopup/proto-html/ctxpopup.prototype.html @@ -0,0 +1,9 @@ +
                  +
                  +
                  +
                  +
                  + +
                  +
                  +
                  diff --git a/src/widgets/progress/js/jquery.mobile.tizen.progress.js b/src/widgets/progress/js/jquery.mobile.tizen.progress.js new file mode 100755 index 0000000..6012165 --- /dev/null +++ b/src/widgets/progress/js/jquery.mobile.tizen.progress.js @@ -0,0 +1,152 @@ +/* *************************************************************************** + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software" ), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * *************************************************************************** + * + * Author: Minkyu Kang + * Author: Koeun Choi + */ + +/* + * Progressing widget + * + * HTML Attributes + * + * data-role: set to 'progressing'. + * data-style: 'circle' or 'pending'. + * + * APIs + * + * show(): show the progressing. + * hide(): hide the progressing. + * running(boolean): start or stop the running. + * + * Events + * + * N/A + * + * Examples + * + *
                • Progress Pending
                • + *
                • + *
                  + *
                • + *
                • Progress ~ing
                • + *
                • + *
                  Loading.. + *
                • + * + * $("#pending").progress( "running", true ); + * $("#progressing").progress( "running", true ); + * + */ + +(function ( $, window, undefined ) { + $.widget( "tizen.progress", $.mobile.widget, { + options: { + style: "circle", + running: false + }, + + show: function () { + $( this.element ).show(); + }, + + hide: function () { + $( this.element ).hide(); + }, + + _start: function () { + if ( !this.init ) { + $( this.element ).append( this.html ); + this.init = true; + } + + this.show(); + + $( this.element ) + .find( ".ui-progress-" + this.options.style ) + .addClass( this.runningClass ); + }, + + _stop: function () { + $( this.element ) + .find( ".ui-progress-" + this.options.style ) + .removeClass( this.runningClass ); + }, + + running: function ( running ) { + if ( running === undefined ) { + return this.options.running; + } + + this._setOption( "running", running ); + }, + + _setOption: function ( key, value ) { + if ( key === "running" ) { + if ( typeof value !== "boolean" ) { + window.alert( "running value MUST be boolean type!" ); + return; + } + + this.options.running = value; + this._refresh(); + } + }, + + _refresh: function () { + if ( this.options.running ) { + this._start(); + } else { + this._stop(); + } + }, + + _create: function () { + var self = this, + element = this.element, + style = element.jqmData( "style" ), + runningClass; + + if ( style ) { + this.options.style = style; + } else { + style = this.options.style; + } + + this.html = $( '
                  ' + + '
                  ' + + '
                  ' ); + + runningClass = "ui-progress-" + style + "-running"; + + $.extend( this, { + init: false, + runningClass: runningClass + } ); + this._refresh(); + } + } ); /* End of widget */ + + $( document ).bind( "pagecreate", function ( e ) { + $( e.target ).find( ":jqmData(role='progressing')" ).progress(); + } ); +}( jQuery, this )); diff --git a/src/widgets/progressbar/css/progressbar.css b/src/widgets/progressbar/css/progressbar.css new file mode 100644 index 0000000..b8a10ce --- /dev/null +++ b/src/widgets/progressbar/css/progressbar.css @@ -0,0 +1,45 @@ +@import "config.less"; + +@bar-height: 16px; +@bar-margin: 16px; + +@-webkit-keyframes ui-scale-animation { + from { + -webkit-transform: scaleX(0); + } to { + -webkit-transform: scaleX(1); + } +} + +.ui-progressbar-value { + background-image: url(images/00_winset_list_progress_bar.png); + height: 100%; +} + +.ui-progressbar { + position: relative; + background-image: url(images/00_winset_list_progress_bg.png); + margin-left: @bar-margin; + margin-right: @bar-margin; + height: @bar-height; +} + +.ui-progress-bg { + position: relative; + top: 0; + background-image: url(images/00_winset_list_progress_bg.png); + width: 100%; + height: @bar-height; +} + +.ui-progress-bar { + position: relative; + top: -@bar-height; + width: 100%; + height: @bar-height; + + background-image: url(images/00_winset_list_progress_bar.png); + + -webkit-animation: ui-scale-animation 5s infinite linear; + -webkit-transform-origin: 0% 0%; +} diff --git a/src/widgets/progressbar/js/jquery.mobile.tizen.progressbar.js b/src/widgets/progressbar/js/jquery.mobile.tizen.progressbar.js new file mode 100755 index 0000000..7ceba83 --- /dev/null +++ b/src/widgets/progressbar/js/jquery.mobile.tizen.progressbar.js @@ -0,0 +1,111 @@ +/* + * jQuery UI Progressbar @VERSION + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Progressbar + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + * Original file: + * jquery.ui.progressbar.js + */ +/* This is from jquery ui plugin - progressbar 11/16/2011 */ + +(function ( $, window, undefined ) { + + $.widget( "tizen.progressbar", $.mobile.widget, { + options: { + value: 0, + max: 100 + }, + + min: 0, + + _create: function () { + this.element + .addClass( "ui-progressbar" ) + .attr( { + role: "progressbar", + "aria-valuemin": this.min, + "aria-valuemax": this.options.max, + "aria-valuenow": this._value() + } ); + + this.valueDiv = $( "
                  " ) + .appendTo( this.element ); + + this.oldValue = this._value(); + this._refreshValue(); + }, + + _destroy: function () { + this.element + .removeClass( "ui-progressbar" ) + .removeAttr( "role" ) + .removeAttr( "aria-valuemin" ) + .removeAttr( "aria-valuemax" ) + .removeAttr( "aria-valuenow" ); + + this.valueDiv.remove(); + }, + + value: function ( newValue ) { + if ( newValue === undefined ) { + return this._value(); + } + + this._setOption( "value", newValue ); + return this; + }, + + _setOption: function ( key, value ) { + if ( key === "value" ) { + this.options.value = value; + this._refreshValue(); + if ( this._value() === this.options.max ) { + this._trigger( "complete" ); + } + } + // jquery.ui.widget.js MUST be updated to new version! + //this._super( "_setOption", key, value ); + }, + + _value: function () { + var val = this.options.value; + // normalize invalid value + if ( typeof val !== "number" ) { + val = 0; + } + return Math.min( this.options.max, Math.max( this.min, val ) ); + }, + + _percentage: function () { + return 100 * this._value() / this.options.max; + }, + + _refreshValue: function () { + var value = this.value(), + percentage = this._percentage(); + + if ( this.oldValue !== value ) { + this.oldValue = value; + this._trigger( "change" ); + } + + this.valueDiv + .toggle( value > this.min ) + .width( percentage.toFixed(0) + "%" ); + this.element.attr( "aria-valuenow", value ); + } + } ); + + // auto self-init widgets + $( document ).bind( "pagecreate", function ( e ) { + $( e.target ).find( ":jqmData(role='progressbar')" ).progressbar(); + } ); + +}( jQuery, this ) ); diff --git a/src/widgets/searchbar/js/jquery.mobile.tizen.searchbar.js b/src/widgets/searchbar/js/jquery.mobile.tizen.searchbar.js new file mode 100755 index 0000000..955fcf1 --- /dev/null +++ b/src/widgets/searchbar/js/jquery.mobile.tizen.searchbar.js @@ -0,0 +1,304 @@ +/* *************************************************************************** + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * *************************************************************************** + */ +/* +* jQuery Mobile Framework : "textinput" plugin for text inputs, textareas +* Copyright (c) jQuery Project +* Dual licensed under the MIT or GPL Version 2 licenses. +* http://jquery.org/license +* Authors: Jinhyuk Jun +* Wongi Lee +*/ + +/** + * Searchbar can be created using element with type=search + * + * + * Searchbar can be inserted 3 cases + * content : seachbar behave same as content element + * header : searchbar placed below title(header), It doesn't move when scrolling page + * inside optionheader : Searchbar placed inside optionheader, searchbar can be seen only expand optionheader + * + * Examples: + * + * HTML markup for creating Searchbar + * + * + * How to make searchbar in content + * + * + * How to make searchbar in title + *
                  + *

                  Searchbar

                  + * + *
                  + * + * How to make searchbar inside optionheader + *
                  + *

                  Searchbar

                  + *
                  + * + *
                  + *
                  +*/ + +(function ( $, undefined ) { + + $.widget( "tizen.searchbar", $.mobile.widget, { + options: { + theme: null, + initSelector: "input[type='search'],:jqmData(type='search'), input[type='tizen-search'],:jqmData(type='tizen-search')" + }, + + _create: function () { + var input = this.element, + o = this.options, + theme = o.theme || $.mobile.getInheritedTheme( this.element, "c" ), + themeclass = " ui-body-" + theme, + focusedEl, + clearbtn, + searchicon, + cancelbtn, + defaultText, + defaultTextClass, + trimedText, + newClassName, + newStyle, + newDiv, + inputedText; + + function toggleClear() { + setTimeout(function () { + clearbtn.toggleClass( "ui-input-clear-hidden", !input.val() ); + }, 0); + } + + function showCancel() { + focusedEl + .addClass( "ui-input-search-default" ) + .removeClass( "ui-input-search-wide" ); + cancelbtn + .addClass( "ui-btn-cancel-show" ) + .removeClass( "ui-btn-cancel-hide" ); + searchicon.hide(); + } + + function hideCancel() { + focusedEl + .addClass( "ui-input-search-wide" ) + .removeClass( "ui-input-search-default" ); + cancelbtn + .addClass( "ui-btn-cancel-hide" ) + .removeClass( "ui-btn-cancel-show" ); + + if ( input.val() == "" ) { + searchicon.show(); + } + + toggleClear(); + } + + $( "label[for='" + input.attr( "id" ) + "']" ).addClass( "ui-input-text" ); + + focusedEl = input.addClass( "ui-input-text ui-body-" + theme ); + + // XXX: Temporary workaround for issue 785 (Apple bug 8910589). + // Turn off autocorrect and autocomplete on non-iOS 5 devices + // since the popup they use can't be dismissed by the user. Note + // that we test for the presence of the feature by looking for + // the autocorrect property on the input element. We currently + // have no test for iOS 5 or newer so we're temporarily using + // the touchOverflow support flag for jQM 1.0. Yes, I feel dirty. - jblas + if ( typeof input[0].autocorrect !== "undefined" && !$.support.touchOverflow ) { + // Set the attribute instead of the property just in case there + // is code that attempts to make modifications via HTML. + input[0].setAttribute( "autocorrect", "off" ); + input[0].setAttribute( "autocomplete", "off" ); + } + + focusedEl = input.wrap( "" ).parent(); + clearbtn = $( "clear text" ) + .bind('click', function ( event ) { + if ( input.attr( "disabled" ) == "disabled" ) { + return false; + } + input + .val( "" ) + .focus() + .trigger( "change" ); + clearbtn.addClass( "ui-input-clear-hidden" ); + event.preventDefault(); + }) + .appendTo( focusedEl ) + .buttonMarkup({ + icon: "deleteSearch", + iconpos: "notext", + corners: true, + shadow: true + }); + + toggleClear(); + + + input.bind( 'paste cut keyup focus change blur', toggleClear ); + + //SLP --start search bar with cancel button + focusedEl.wrapAll( "" ); + + searchicon = $("") + .bind('click', function ( event ) { + if ( input.attr( "disabled" ) == "disabled" ) { + return false; + } + searchicon.hide(); + + input + .blur() + .focus(); + } ) + .appendTo( focusedEl ); + + cancelbtn = $( "Cancel" ) + .bind('click', function ( event ) { + if ( input.attr( "disabled" ) == "disabled" ) { + return false; + } + event.preventDefault(); + event.stopPropagation(); + + input + .val( "" ) + .blur() + .trigger( "change" ); + + hideCancel(); + } ) + .appendTo( focusedEl.parent() ) + .buttonMarkup( { + iconpos: "cancel", + corners: true, + shadow: true + } ); + + // Input Focused + input + .focus( function () { + if ( input.attr( "disabled" ) == "disabled" ) { + return false; + } + showCancel(); + focusedEl.addClass( $.mobile.focusClass ); + }) + .blur(function () { + focusedEl.removeClass( $.mobile.focusClass ); + }); + + // Input Blured + /* When user touch on page, it's same to blur */ + /* FIXME : if there is no problem, please remove this codes.. + $( "div.input-search-bar" ).tap( function ( event ) { + if ( input.attr( "disabled" ) == "disabled" ) { + return false; + } + input.focus(); + event.stopPropagation(); + } ); + + var currentPage = input.closest( ".ui-page" ); + $( currentPage ).bind("tap", function ( e ) { + if ( input.attr( "disabled" ) == "disabled" ) { + return; + } + + if ( $( input ).is( ":focus" ) ) { + focusedEl.removeClass( "ui-focus" ); + hideCancel(); + input.blur(); + } + } );*/ + + // Default Text + defaultText = input.jqmData( "default-text" ); + + if ( ( defaultText != undefined ) && ( defaultText.length > 0 ) ) { + defaultTextClass = "ui-input-default-text"; + trimedText = defaultText.replace(/\s/g, ""); + + /* Make new class for default text string */ + newClassName = defaultTextClass + "-" + trimedText; + newStyle = $( "" ); + $( 'html > head' ).append( newStyle ); + + /* Make new empty
                  for default text */ + newDiv = $( "
                  " ); + + /* Add class and append new div */ + newDiv.addClass( defaultTextClass ); + newDiv.addClass( newClassName ); + newDiv.tap( function ( event ) { + input.blur(); + input.focus(); + } ); + + input.parent().append( newDiv ); + + /* When focus, default text will be hide. */ + input + .focus( function () { + input.parent().find( "div.ui-input-default-text" ).addClass( "ui-input-default-hidden" ); + } ) + .blur( function () { + var inputedText = input.val(); + if ( inputedText.length > 0 ) { + input.parent().find( "div.ui-input-default-text" ).addClass( "ui-input-default-hidden" ); + } else { + input.parent().find( "div.ui-input-default-text" ).removeClass( "ui-input-default-hidden" ); + } + } ); + } + + if ( input.val() ) { + searchicon.hide(); + } + }, + + disable: function () { + this.element.attr( "disabled", true ); + this.element.parent().addClass( "ui-disabled" ); + this.element.parent().parent().find(".ui-input-cancel").addClass( "ui-disabled" ); + $( this.element ).blur(); + }, + + enable: function () { + this.element.attr( "disabled", false ); + this.element.parent().removeClass( "ui-disabled" ); + this.element.parent().parent().find(".ui-input-cancel").removeClass( "ui-disabled" ); + $( this.element ).focus(); + } + } ); + + //auto self-init widgets + $( document ).bind( "pagecreate create", function ( e ) { + $.tizen.searchbar.prototype.enhanceWithin( e.target ); + } ); + +}( jQuery ) ); diff --git a/src/widgets/shortcutscroll/css/shortcutscroll.css b/src/widgets/shortcutscroll/css/shortcutscroll.css new file mode 100644 index 0000000..fcf9eda --- /dev/null +++ b/src/widgets/shortcutscroll/css/shortcutscroll.css @@ -0,0 +1,38 @@ +.ui-shortcutscroll { + position: absolute; + right: 0px; + top: 0px; + background-color: rgba(225, 221, 215,0.5); + max-width: 20px; + min-width: 12px; + -webkit-user-select: none; + margin:0; + padding:0; + opacity: 1; +} +.ui-shortcutscroll ul{ + list-style-type: none; + margin: 0; + padding: 0; +} +.ui-shortcutscroll li { + cursor: pointer; + color:rgba(0,0,0,0.6); + padding: 2px 2px 2px 5px; + text-shadow: none !important; +} + +.ui-shortcutscroll-popup { + position: absolute; + background: rgba(255,255,255,1); + padding:10px 30px; + -moz-box-shadow: 8px 10px 0px rgb(199, 199, 199); + -webkit-box-shadow: 8px 10px 0px rgb(199, 199, 199); + box-shadow: 8px 10px 0px rgb(199, 199, 199); + text-align: center; + font-size: 75px; + font-weight: bold; + display:none; + box-sizing:border-box; + color: black; +} diff --git a/src/widgets/shortcutscroll/js/jquery.mobile.tizen.shortcutscroll.js b/src/widgets/shortcutscroll/js/jquery.mobile.tizen.shortcutscroll.js new file mode 100755 index 0000000..ff214d7 --- /dev/null +++ b/src/widgets/shortcutscroll/js/jquery.mobile.tizen.shortcutscroll.js @@ -0,0 +1,210 @@ +/* + * jQuery Mobile Widget @VERSION + * + * This software is licensed under the MIT licence (as defined by the OSI at + * http://www.opensource.org/licenses/mit-license.php) + * + * *************************************************************************** + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. + * Copyright (c) 2011 by Intel Corporation Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to 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: Elliot Smith + */ + +// shortcutscroll is a scrollview controller, which binds +// a scrollview to a a list of short cuts; the shortcuts are built +// from the text on dividers in the list. Clicking on a shortcut +// instantaneously jumps the scrollview to the selected list divider; +// mouse movements on the shortcut column move the scrollview to the +// list divider matching the text currently under the touch; a popup +// with the text currently under the touch is also displayed. +// +// To apply, add the attribute data-shortcutscroll="true" to a listview +// (a
                    or
                      element inside a page). Alternatively, call +// shortcutscroll() on an element. +// +// The closest element with class ui-scrollview-clip is used as the +// scrollview to be controlled. +// +// If a listview has no dividers or a single divider, the widget won't +// display. + +(function ( $, undefined ) { + + $.widget( "tizen.shortcutscroll", $.mobile.widget, { + options: { + initSelector: ":jqmData(shortcutscroll)" + }, + + _create: function () { + var $el = this.element, + self = this, + $popup, + page = $el.closest( ':jqmData(role="page")' ), + jumpToDivider; + + this.scrollview = $el.closest( '.ui-scrollview-clip' ); + this.shortcutsContainer = $( '
                      ' ); + this.shortcutsList = $( '
                        ' ); + + // popup for the hovering character + this.shortcutsContainer.append($( '
                        ' ) ); + $popup = this.shortcutsContainer.find( '.ui-shortcutscroll-popup' ); + + this.shortcutsContainer.append( this.shortcutsList ); + this.scrollview.append( this.shortcutsContainer ); + + // find the bottom of the last item in the listview + this.lastListItem = $el.children().last(); + + // remove scrollbars from scrollview + this.scrollview.find( '.ui-scrollbar' ).hide(); + + jumpToDivider = function ( divider ) { + // get the vertical position of the divider (so we can scroll to it) + var dividerY = $( divider ).position().top, + // find the bottom of the last list item + bottomOffset = self.lastListItem.outerHeight( true ) + self.lastListItem.position().top, + scrollviewHeight = self.scrollview.height(), + + // check that after the candidate scroll, the bottom of the + // last item will still be at the bottom of the scroll view + // and not some way up the page + maxScroll = bottomOffset - scrollviewHeight, + dstOffset; + + dividerY = ( dividerY > maxScroll ? maxScroll : dividerY ); + + // don't apply a negative scroll, as this means the + // divider should already be visible + dividerY = Math.max( dividerY, 0 ); + + // apply the scroll + self.scrollview.scrollview( 'scrollTo', 0, -dividerY ); + + dstOffset = self.scrollview.offset(); + $popup + .text( $( divider ).text() ) + .offset( { left : dstOffset.left + ( self.scrollview.width() - $popup.width() ) / 2, + top : dstOffset.top + ( self.scrollview.height() - $popup.height() ) / 2 } ) + .show(); + }; + + this.shortcutsList + // bind mouse over so it moves the scroller to the divider + .bind( 'touchstart mousedown vmousedown touchmove vmousemove vmouseover ', function ( e ) { + // Get coords relative to the element + var coords = $.mobile.tizen.targetRelativeCoordsFromEvent( e ), + shortcutsListOffset = self.shortcutsList.offset(); + + // If the element is a list item, get coordinates relative to the shortcuts list + if ( e.target.tagName.toLowerCase() === "li" ) { + coords.x += $( e.target ).offset().left - shortcutsListOffset.left; + coords.y += $( e.target ).offset().top - shortcutsListOffset.top; + } + + // Hit test each list item + self.shortcutsList.find( 'li' ).each( function () { + var listItem = $( this ), + l = listItem.offset().left - shortcutsListOffset.left, + t = listItem.offset().top - shortcutsListOffset.top, + r = l + Math.abs(listItem.outerWidth( true ) ), + b = t + Math.abs(listItem.outerHeight( true ) ); + + if ( coords.x >= l && coords.x <= r && coords.y >= t && coords.y <= b ) { + jumpToDivider( $( listItem.data( 'divider' ) ) ); + return false; + } + return true; + } ); + + e.preventDefault(); + e.stopPropagation(); + } ) + // bind mouseout of the shortcutscroll container to remove popup + .bind( 'touchend mouseup vmouseup vmouseout', function () { + $popup.hide(); + } ); + + if ( page && !( page.is( ':visible' ) ) ) { + page.bind( 'pageshow', function () { self.refresh(); } ); + } else { + this.refresh(); + } + + // refresh the list when dividers are filtered out + $el.bind( 'updatelayout', function () { + self.refresh(); + } ); + }, + + refresh: function () { + var self = this, + shortcutsTop, + minClipHeight, + dividers, + listItems; + + this.shortcutsList.find( 'li' ).remove(); + + // get all the dividers from the list and turn them into shortcuts + dividers = this.element.find( '.ui-li-divider' ); + + // get all the list items + listItems = this.element.find( 'li:not(.ui-li-divider)) '); + + // only use visible dividers + dividers = dividers.filter( ':visible' ); + listItems = listItems.filter( ':visible' ); + + if ( dividers.length < 2 ) { + this.shortcutsList.hide(); + return; + } + + this.shortcutsList.show(); + + this.lastListItem = listItems.last(); + + dividers.each( function ( index, divider ) { + self.shortcutsList + .append( $( '
                      • ' + $( divider ).text() + '
                      • ' ) + .data( 'divider', divider ) ); + } ); + + // position the shortcut flush with the top of the first list divider + shortcutsTop = dividers.first().position().top; + this.shortcutsContainer.css( 'top', shortcutsTop ); + + // make the scrollview clip tall enough to show the whole of the shortcutslist + minClipHeight = shortcutsTop + this.shortcutsContainer.outerHeight() + 'px'; + this.scrollview.css( 'min-height', minClipHeight ); + } + } ); + + $( document ).bind( "pagecreate create", function ( e ) { + $( $.tizen.shortcutscroll.prototype.options.initSelector, e.target ) + .not( ":jqmData(role='none'), :jqmData(role='nojs')" ) + .shortcutscroll(); + } ); + +} ( jQuery ) ); diff --git a/src/widgets/slider/css/slider.css b/src/widgets/slider/css/slider.css new file mode 100644 index 0000000..40bc6f9 --- /dev/null +++ b/src/widgets/slider/css/slider.css @@ -0,0 +1,14 @@ +.ui-slider .ui-btn-inner { + padding: 4px 0 0 0 !important; +} + +.ui-slider-popup { + position: absolute !important; + width: 64px; + height: 64px; + text-align: center; + font-size: 40px; + padding-top: 12px; + z-index: 100; + opacity: 0.8; +} diff --git a/src/widgets/slider/js/jquery.mobile.tizen.slider.js b/src/widgets/slider/js/jquery.mobile.tizen.slider.js new file mode 100755 index 0000000..c022a4d --- /dev/null +++ b/src/widgets/slider/js/jquery.mobile.tizen.slider.js @@ -0,0 +1,316 @@ +/* + * jQuery Mobile Widget @VERSION + * + * This software is licensed under the MIT licence (as defined by the OSI at + * http://www.opensource.org/licenses/mit-license.php) + * + * *************************************************************************** + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. + * Copyright (c) 2011 by Intel Corporation Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to 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: Max Waterman + * Authors: Minkyu Kang + */ + +/** + * tizenslider modifies the JQuery Mobile slider and is created in the same way. + * + * See the JQuery Mobile slider widget for more information : + * http://jquerymobile.com/demos/1.0a4.1/docs/forms/forms-slider.html + * + * The JQuery Mobile slider option: + * theme: specify the theme using the 'data-theme' attribute + * + * Options: + * theme: string; the theme to use if none is specified using the 'data-theme' attribute + * default: 'c' + * popup: boolean; controls whether the popup is displayed or not + * specify if the popup is enabled using the 'data-popup' attribute + * set from javascript using .tizenslider('option','popup',newValue) + * + * Events: + * changed: triggers when the value is changed (rather than when the handle is moved) + * + * Examples: + * + * Enable popup + * Disable popup + *
                        + * + *
                        + *
                        + * + *
                        + * + * // disable popup from javascript + * $('#mySlider').tizenslider('option','popup',false); + * + * // from buttons + * $('#popupEnabler').bind('vclick', function() { + * $('#mySlider').tizenslider('option','popup',true); + * }); + * $('#popupDisabler').bind('vclick', function() { + * $('#mySlider').tizenslider('option','popup',false); + * }); + */ + +(function ($, window, undefined) { + $.widget("tizen.tizenslider", $.mobile.widget, { + options: { + popup: true + }, + + popup: null, + handle: null, + handleText: null, + + _create: function () { + this.currentValue = null; + this.popupVisible = false; + + var self = this, + inputElement = $( this.element ), + slider, + slider_bar, + handle_press, + popupEnabledAttr, + icon; + + // apply jqm slider + inputElement.slider(); + + // hide the slider input element proper + inputElement.hide(); + + self.popup = $('
                        '); + + // set the popup according to the html attribute + popupEnabledAttr = inputElement.jqmData('popup'); + if ( popupEnabledAttr !== undefined ) { + self.options.popup = ( popupEnabledAttr == true ); + } + + // get the actual slider added by jqm + slider = inputElement.next('.ui-slider'); + + icon = inputElement.attr('data-icon'); + + // wrap the background + if ( icon === undefined ) { + slider.wrap('
                        '); + } else { + slider.wrap('
                        '); + } + + // get the handle + self.handle = slider.find('.ui-slider-handle'); + + // remove the rounded corners from the slider and its children + slider.removeClass('ui-btn-corner-all'); + slider.find('*').removeClass('ui-btn-corner-all'); + + // add icon + + switch ( icon ) { + case 'bright': + case 'volume': + slider.before( $('
                        ') ); + slider.after( $('
                        ') ); + break; + + case 'text': + slider.before( $('
                        ' + + '' + + inputElement.attr('data-text-left').substring( 0, 3) + + '
                        ') ); + slider.after( $('
                        ' + + '' + + inputElement.attr('data-text-right').substring( 0, 3) + + '
                        ') ); + break; + } + + // slider bar + slider.append($('
                        ')); + self.slider_bar = slider.find('.ui-slider-bar'); + + // handle press + slider.append($('
                        ')); + self.handle_press = slider.find('.ui-slider-handle-press'); + self.handle_press.css('display', 'none'); + + // add a popup element (hidden initially) + slider.before( self.popup ); + self.popup.hide(); + + // get the element where value can be displayed + self.handleText = slider.find('.ui-btn-text'); + + // set initial value + self.updateSlider(); + + // bind to changes in the slider's value to update handle text + this.element.bind('change', function () { + self.updateSlider(); + }); + + // bind clicks on the handle to show the popup + self.handle.bind('vmousedown', function () { + self.showPopup(); + }); + + // watch events on the document to turn off the slider popup + slider.add( document ).bind('vmouseup', function () { + self.hidePopup(); + }); + }, + + _handle_press_show: function () { + this.handle_press.css('display', ''); + }, + + _handle_press_hide: function () { + this.handle_press.css('display', 'none'); + }, + + // position the popup + positionPopup: function () { + var dstOffset = this.handle.offset(); + + this.popup.offset({ + left: dstOffset.left + ( this.handle.width() - this.popup.width() ) / 2, + top: dstOffset.top - this.popup.outerHeight() + 15 + }); + + this.handle_press.offset({ + left: dstOffset.left, + top: dstOffset.top + }); + }, + + // show value on the handle and in popup + updateSlider: function () { + var font_size, + newValue; + + if ( this.popupVisible ) { + this.positionPopup(); + } + + // remove the title attribute from the handle (which is + // responsible for the annoying tooltip); NB we have + // to do it here as the jqm slider sets it every time + // the slider's value changes :( + this.handle.removeAttr('title'); + + this.slider_bar.width( this.handle.css('left') ); + + newValue = this.element.val(); + + if ( newValue === this.currentValue ) { + return; + } + + if ( newValue > 999 ) { + font_size = '0.7em'; + } else if ( newValue > 99 ) { + font_size = '0.8em'; + } else if ( newValue > 9 ) { + font_size = '0.9em'; + } else { + font_size = '1em'; + } + + if ( font_size != this.handleText.css('font-size') ) { + this.handleText.css( 'font-size', font_size ); + } + + this.currentValue = newValue; + this.handleText.text( newValue ); + this.popup.html( newValue ); + + this.element.trigger( 'update', newValue ); + }, + + // show the popup + showPopup: function () { + if ( !this.options.popup || this.popupVisible ) { + return; + } + + this.popup.show(); + this.popupVisible = true; + this._handle_press_show(); + }, + + // hide the popup + hidePopup: function () { + if ( !this.options.popup || !this.popupVisible ) { + return; + } + + this.popup.hide(); + this.popupVisible = false; + this._handle_press_hide(); + }, + + _setOption: function (key, value) { + var needToChange = ( value !== this.options[key] ); + + if ( !needToChange ) { + return; + } + + switch ( key ) { + case 'popup': + this.options.popup = value; + + if ( this.options.popup) { + this.updateSlider(); + } else { + this.hidePopup(); + } + + break; + } + } + }); + + // stop jqm from initialising sliders + $( document ).bind( "pagebeforecreate", function ( e ) { + if ( $.data( window, "jqmSliderInitSelector" ) === undefined ) { + $.data( window, "jqmSliderInitSelector", + $.mobile.slider.prototype.options.initSelector ); + $.mobile.slider.prototype.options.initSelector = null; + } + }); + + // initialise sliders with our own slider + $( document ).bind( "pagecreate", function ( e ) { + var jqmSliderInitSelector = $.data( window, "jqmSliderInitSelector" ); + $( e.target ).find(jqmSliderInitSelector).not('select').tizenslider(); + $( e.target ).find(jqmSliderInitSelector).filter('select').slider(); + }); + +}( jQuery, this )); diff --git a/src/widgets/swipelist/.empty b/src/widgets/swipelist/.empty new file mode 100644 index 0000000..e69de29 diff --git a/src/widgets/swipelist/css/swipelist.css b/src/widgets/swipelist/css/swipelist.css new file mode 100644 index 0000000..12d0059 --- /dev/null +++ b/src/widgets/swipelist/css/swipelist.css @@ -0,0 +1,26 @@ +.ui-swipelist-item { + -webkit-user-select: none; + -user-select: none; +} + +.ui-swipelist-item * { + -webkit-user-select: none; + -user-select: none; +} + +.ui-swipelist-item-cover { + z-index: 99; + position: absolute; + border: none; + top: 0%; + left: 0%; + width: 100%; + height: 100%; + z-index: 100; +} + +.ui-swipelist-item-cover-inner * { + -moz-user-select: none; + -webkit-user-select: none; + -user-select: none; +} diff --git a/src/widgets/swipelist/js/jquery.mobile.tizen.swipelist.js b/src/widgets/swipelist/js/jquery.mobile.tizen.swipelist.js new file mode 100644 index 0000000..0fab979 --- /dev/null +++ b/src/widgets/swipelist/js/jquery.mobile.tizen.swipelist.js @@ -0,0 +1,268 @@ +/* + * jQuery Mobile Widget @VERSION + * + * This software is licensed under the MIT licence (as defined by the OSI at + * http://www.opensource.org/licenses/mit-license.php) + * + * *************************************************************************** + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. + * Copyright (c) 2011 by Intel Corporation Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to 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: Kalyan Kondapally , + * Elliot Smith + */ + +// Widget which turns a list into a "swipe list": +// i.e. each list item has a sliding "cover" which can be swiped +// to the right (to reveal buttons underneath) or left (to +// cover the buttons again). Clicking on a button under a swipelist +// also moves the cover back to the left. +// +// To create a swipelist, you need markup like this: +// +//
                        +// <ul data-role="swipelist">
                        +// <li>
                        +// <div class="ui-grid-b">
                        +// <div class="ui-block-a">
                        +// <a href="#" data-role="button" data-theme="a">Twitter</a>
                        +// </div>
                        +// <div class="ui-block-b">
                        +// <a href="#" data-role="button" data-theme="b">FaceBook</a>
                        +// </div>
                        +// <div class="ui-block-c">
                        +// <a href="#" data-role="button" data-theme="c">Google+</a>
                        +// </div>
                        +// </div>
                        +// <div data-role="swipelist-item-cover">Nigel</div>
                        +// </li>
                        +// ...
                        +// </ul> +//
                        +// +// In this case, the cover is over a grid of buttons; +// but it is should also be possible to use other types of markup under the +// list items. +// +// Note the use of a separate div, parented by the li element, marked +// up with data-role="swipelist-item-cover". This div will usually +// contain text. If you want other elements in your swipelist covers, +// you may need to style them yourself. Because the covers aren't +// technically list items, you may need to do some work to make them +// look right. +// +// WARNING: This doesn't work well inside a scrollview widget, as +// the touch events currently interfere with each other badly (e.g. +// a swipe will work but cause a scroll as well). +// +// Theme: default is to use the theme on the target element, +// theme passed in options, parent theme, or 'c' if none of the above. +// If list items are themed individually, the cover will pick up the +// theme of the list item which is its parent. +// +// Events: +// +// animationComplete: Triggered by a cover when it finishes sliding +// (to either the right or left). +(function ($) { + + $.widget("tizen.swipelist", $.mobile.widget, { + options: { + theme: null + }, + + _create: function () { + // use the theme set on the element, set in options, + // the parent theme, or 'c' (in that order of preference) + var theme = this.element.jqmData('theme') || + this.options.theme || + this.element.parent().jqmData('theme') || + 'c'; + + this.options.theme = theme; + this.refresh(); + }, + + refresh: function () { + this._cleanupDom(); + + var self = this, + defaultCoverTheme, + covers; + + defaultCoverTheme = 'ui-body-' + this.options.theme; + + // swipelist is a listview + if (!this.element.hasClass('ui-listview')) { + this.element.listview(); + } + + this.element.addClass('ui-swipelist'); + + // get the list item covers + covers = this.element.find(':jqmData(role="swipelist-item-cover")'); + + covers.each(function () { + var cover = $(this), + coverTheme = defaultCoverTheme, + // get the parent li element and add classes + item = cover.closest('li'), + itemHasThemeClass; + + // add swipelist CSS classes + item.addClass('ui-swipelist-item'); + cover.addClass('ui-swipelist-item-cover'); + + // set swatch on cover: if the nearest list item has + // a swatch set on it, that will be used; otherwise, use + // the swatch set for the swipelist + itemHasThemeClass = item.attr('class') + .match(/ui\-body\-[a-z]|ui\-bar\-[a-z]/); + + if (itemHasThemeClass) { + coverTheme = itemHasThemeClass[0]; + } + + cover.addClass(coverTheme); + + // wrap inner HTML (so it can potentially be styled) + if (cover.has('.ui-swipelist-item-cover-inner').length === 0) { + cover.wrapInner($('').addClass('ui-swipelist-item-cover-inner')); + } + + // bind to swipe events on the cover and the item + if (!(cover.data('animateRight') && cover.data('animateLeft'))) { + cover.data('animateRight', function () { + self._animateCover(cover, 100); + }); + + cover.data('animateLeft', function () { + self._animateCover(cover, 0); + }); + } + + // bind to synthetic events + item.bind('swipeleft', cover.data('animateLeft')); + cover.bind('swiperight', cover.data('animateRight')); + + // any clicks on buttons inside the item also trigger + // the cover to slide back to the left + item.find('.ui-btn').bind('vclick', cover.data('animateLeft')); + }); + }, + + _cleanupDom: function () { + + var self = this, + defaultCoverTheme, + covers; + + defaultCoverTheme = 'ui-body-' + this.options.theme; + + this.element.removeClass('ui-swipelist'); + + // get the list item covers + covers = this.element.find(':jqmData(role="swipelist-item-cover")'); + + covers.each(function () { + var cover = $(this), + coverTheme = defaultCoverTheme, + text, + wrapper, + // get the parent li element and add classes + item = cover.closest('li'), + itemClass, + itemHasThemeClass; + + // remove swipelist CSS classes + item.removeClass('ui-swipelist-item'); + cover.removeClass('ui-swipelist-item-cover'); + + // remove swatch from cover: if the nearest list item has + // a swatch set on it, that will be used; otherwise, use + // the swatch set for the swipelist + itemClass = item.attr('class'); + itemHasThemeClass = itemClass && + itemClass.match(/ui\-body\-[a-z]|ui\-bar\-[a-z]/); + + if (itemHasThemeClass) { + coverTheme = itemHasThemeClass[0]; + } + + cover.removeClass(coverTheme); + + // remove wrapper HTML + wrapper = cover.find('.ui-swipelist-item-cover-inner'); + wrapper.children().unwrap(); + text = wrapper.text(); + + if (text) { + cover.append(text); + wrapper.remove(); + } + + // unbind swipe events + if (cover.data('animateRight') && cover.data('animateLeft')) { + cover.unbind('swiperight', cover.data('animateRight')); + item.unbind('swipeleft', cover.data('animateLeft')); + + // unbind clicks on buttons inside the item + item.find('.ui-btn').unbind('vclick', cover.data('animateLeft')); + + cover.data('animateRight', null); + cover.data('animateLeft', null); + } + }); + }, + + // NB I tried to use CSS animations for this, but the performance + // and appearance was terrible on Android 2.2 browser; + // so I reverted to jQuery animations + // + // once the cover animation is done, the cover emits an + // animationComplete event + _animateCover: function (cover, leftPercentage) { + var animationOptions = { + easing: 'linear', + duration: 'fast', + queue: true, + complete: function () { + cover.trigger('animationComplete'); + } + }; + + cover.stop(); + cover.clearQueue(); + cover.animate({left: leftPercentage + '%'}, animationOptions); + }, + + destroy: function () { + this._cleanupDom(); + } + + }); + + $(document).bind("pagecreate", function (e) { + $(e.target).find(":jqmData(role='swipelist')").swipelist(); + }); + +}(jQuery)); diff --git a/src/widgets/swipelist/less/images/00_sweep_list_bg.png b/src/widgets/swipelist/less/images/00_sweep_list_bg.png new file mode 100644 index 0000000..d87592a Binary files /dev/null and b/src/widgets/swipelist/less/images/00_sweep_list_bg.png differ diff --git a/src/widgets/swipelist/less/swipelist.less b/src/widgets/swipelist/less/swipelist.less new file mode 100644 index 0000000..e035d77 --- /dev/null +++ b/src/widgets/swipelist/less/swipelist.less @@ -0,0 +1,90 @@ +@swipelistitem-width:480px; +@swipelistitem-height:80px; +@onelinelist-height:70px; +@border-radius:8px; +@margin:10px; + +.ui-swipelist { + list-style-type: none; +} + +.ui-swipelistitem { + width:@swipelistitem-width; + height:@swipelistitem-height; + background:url(images/00_sweep_list_bg.png); +} + +.ui-swipelistitemcontainer { + overflow:hidden; + position:relative; + width:@swipelistitem-width; + height:@swipelistitem-height; + + .ui-swipelistitemcover { + position: absolute; + top:0; + left:0; + background:url(images/00_sweep_list_bg.png); + width:100%; + height:100%; + text-align: center; + } + + .ui-swipelistitemcontent{ + text-align: center; + position: absolute; + width: 460px; + height: 38px; + margin-bottom: 7px; + margin-left:@margin; + margin-right:@margin; + margin-top:35px; + border:0; + .ui-buttonlayout{ + margin-right:@margin; + border:0px; + height:38px; + width:215px; + text-align: center; + border-radius:@border-radius; + -webkit-border-radius:@border-radius; + } + + .ui-swipebuttonlast{ + width:225px; + margin-right:0px; + } + + .ui-threebuttonlayout{ + width:137px; + .ui-swipebuttonlast{ + width:147px; + } + } + + .ui-centrebutton{ + width:136px; + } + + .ui-fourbuttonlayout{ + width:101px; + margin-right:8px; + .ui-swipebuttonlast{ + width:109px; + } + } + } +} + +.ui-onelinelist { + height:@onelinelist-height; + .ui-swipelistitemcontainer{ + height:@onelinelist-height; + } + .ui-swipelistitemcontent{ + margin-top:28px; + margin-bottom:4px; + } +} + + diff --git a/src/widgets/toggleswitch/js/jquery.mobile.tizen.toggleswitch.js b/src/widgets/toggleswitch/js/jquery.mobile.tizen.toggleswitch.js new file mode 100644 index 0000000..8fd4774 --- /dev/null +++ b/src/widgets/toggleswitch/js/jquery.mobile.tizen.toggleswitch.js @@ -0,0 +1,138 @@ +/* + * jQuery Mobile Widget @VERSION + * + * This software is licensed under the MIT licence (as defined by the OSI at + * http://www.opensource.org/licenses/mit-license.php) + * + * *************************************************************************** + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. + * Copyright (C) 2011 by Intel Corporation Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to 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: Gabriel Schulhof + * Daehyeon Jung + */ + +// Displays a simple two-state switch. +// +// To apply, add the attribute data-role="switch" to a
                        +// element inside a page. Alternatively, call switch() +// on an element, like this : +// +// $("#myswitch").toggleswitch(); +// where the html might be : +//
                        +// +// Options: +// checked: Boolean; the state of the switch.(default: true) +// texton: String; "On"; +// textoff: String; "Off"; +// +// Events: +// changed: Emitted when the switch is changed + +(function ( $, undefined ) { + + $.widget( "tizen.toggleswitch", $.tizen.widgetex, { + options: { + texton : "On", + textoff : "Off", + checked : true, + initSelector : ":jqmData(role='toggleswitch')" + }, + + _htmlProto: { + ui: { + container: "#container", + mover: "#mover", + on: "#on-span", + off: "#off-span" + } + }, + + destroy: function () { + this._ui.container.remove(); + // restore original element + this.element.show(); + }, + + _value: { + attr: "data-" + ($.mobile.ns || "") + "checked", + signal: "changed" + }, + + _setTexton: function ( text ) { + this._ui.on.text( text ); + this.options.texton = text; + this.element.attr( "data-" + ($.mobile.ns || "") + "texton", text ); + }, + + _setTextoff: function ( text ) { + this._ui.off.text( text ); + this.options.textoff = text; + this.element.attr( "data-" + ($.mobile.ns || "") + "textoff", text ); + }, + + _setChecked: function ( checked ) { + if ( checked == this.options.checked ) { + return; + } + + this.options.checked = checked; + this._setValue( checked ); + if ( checked ) { + this._ui.container.addClass("ui-toggleswitch-state-checked"); + } else { + this._ui.container.removeClass("ui-toggleswitch-state-checked"); + } + }, + + _setDisabled: function ( value ) { + $.tizen.widgetex.prototype._setDisabled.call( this, value ); + this._ui.container[value ? "addClass" : "removeClass"]( "ui-disabled" ); + }, + + _create: function () { + var self = this; + this.element.hide().after( this._ui.container ); + if ( this.element.jqmData("icon") ) { + this._ui.container.find(".ui-toggleswitch-text").hide(); + this._ui.container.find(".ui-toggleswitch-img").show(); + } else { + this._ui.container.find(".ui-toggleswitch-img").hide(); + } + + $( this._ui.mover ).bind( "vclick", function () { + self._setChecked( !self.options.checked ); + return false; + }); + }, + + }); + + $( document ).bind( "pagecreate create", function ( e ) { + $( $.tizen.toggleswitch.prototype.options.initSelector, e.target ) + .not( ":jqmData(role='none'), :jqmData(role='nojs')" ) + .toggleswitch(); + }); + + +}( jQuery )); diff --git a/src/widgets/toggleswitch/proto-html/toggleswitch.prototype.html b/src/widgets/toggleswitch/proto-html/toggleswitch.prototype.html new file mode 100644 index 0000000..93f9adb --- /dev/null +++ b/src/widgets/toggleswitch/proto-html/toggleswitch.prototype.html @@ -0,0 +1,14 @@ +
                        +
                        +
                        + Off + +
                        +
                        + On + +
                        +
                        +
                        +
                        +
                        diff --git a/src/widgets/triangle/js/jquery.mobile.tizen.triangle.js b/src/widgets/triangle/js/jquery.mobile.tizen.triangle.js new file mode 100755 index 0000000..fffa206 --- /dev/null +++ b/src/widgets/triangle/js/jquery.mobile.tizen.triangle.js @@ -0,0 +1,104 @@ +/* + * This software is licensed under the MIT licence (as defined by the OSI at + * http://www.opensource.org/licenses/mit-license.php) + * + * *************************************************************************** + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. + * Copyright (c) 2011 by Intel Corporation Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to 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. + * *************************************************************************** + */ + +( function ($, undefined) { + + $.widget( "tizen.triangle", $.tizen.widgetex, { + options: { + extraClass: "", + offset: null, + color: null, + location: "top", + initSelector: ":jqmData(role='triangle')" + }, + + _create: function () { + var triangle = $( "
                        ", {"class" : "ui-triangle"} ); + + $.extend(this, { + _triangle: triangle + }); + + this.element.addClass( "ui-triangle-container" ).append( triangle ); + }, + + _doCSS: function () { + var location = ( this.options.location || "top" ), + offsetCoord = ( ($.inArray(location, ["top", "bottom"]) === -1) ? "top" : "left"), + cssArg = { + "border-bottom-color" : "top" === location ? this.options.color : "transparent", + "border-top-color" : "bottom" === location ? this.options.color : "transparent", + "border-left-color" : "right" === location ? this.options.color : "transparent", + "border-right-color" : "left" === location ? this.options.color : "transparent" + }; + + cssArg[offsetCoord] = this.options.offset; + + this._triangle.removeAttr( "style" ).css( cssArg ); + }, + + _setOffset: function ( value ) { + this.options.offset = value; + this.element.attr( "data-" + ($.mobile.ns || "") + "offset", value ); + this._doCSS(); + }, + + _setExtraClass: function ( value ) { + this._triangle.addClass( value ); + this.options.extraClass = value; + this.element.attr( "data-" + ($.mobile.ns || "") + "extra-class", value ); + }, + + _setColor: function ( value ) { + this.options.color = value; + this.element.attr( "data-" + ($.mobile.ns || "") + "color", value ); + this._doCSS(); + }, + + _setLocation: function ( value ) { + this.element + .removeClass( "ui-triangle-container-" + this.options.location ) + .addClass( "ui-triangle-container-" + value ); + this._triangle + .removeClass( "ui-triangle-" + this.options.location ) + .addClass( "ui-triangle-" + value ); + + this.options.location = value; + this.element.attr( "data-" + ($.mobile.ns || "") + "location", value ); + + this._doCSS(); + } + }); + + $( document ).bind( "pagecreate create", function ( e ) { + $($.tizen.triangle.prototype.options.initSelector, e.target) + .not(":jqmData(role='none'), :jqmData(role='nojs')") + .triangle(); + }); + +}(jQuery) ); diff --git a/src/widgets/triangle/less/jquery.mobile.tizen.triangle.less b/src/widgets/triangle/less/jquery.mobile.tizen.triangle.less new file mode 100755 index 0000000..baa4e5d --- /dev/null +++ b/src/widgets/triangle/less/jquery.mobile.tizen.triangle.less @@ -0,0 +1,64 @@ +@triangle-size: 10px; + +.ui-triangle-container { + position: relative; + + .ui-triangle { + position: absolute; + border-style: solid; + border-color: transparent; + border-width: @triangle-size; + } + + .ui-triangle-top { + top: 0px; + border-top-width: 0px; + border-left-color: transparent; + border-right-color: transparent; + margin-left: -@triangle-size; + } + + .ui-triangle-bottom { + bottom: 0px; + border-bottom-width: 0px; + border-left-color: transparent; + border-right-color: transparent; + margin-left: -@triangle-size; + } + + .ui-triangle-left { + left: 0px; + margin-top: -@triangle-size; + border-left-width: 0px; + border-left-color: transparent; + border-right-color: transparent; + } + + .ui-triangle-right { + right: 0px; + margin-top: -@triangle-size; + border-right-width: 0px; + border-left-color: transparent; + border-right-color: transparent; + } +} + +.ui-triangle-container-top { + height: @triangle-size; + top: 0px; + margin-top: -@triangle-size; +} + +.ui-triangle-container-bottom { + height: @triangle-size; + bottom: 0px; + margin-bottom: -@triangle-size; +} + +.ui-triangle-container-left { + width: @triangle-size; +} + +.ui-triangle-container-right { + width: @triangle-size; +} diff --git a/src/widgets/virtualgrid/js/jquery.mobile.tizen.virtualgrid.js b/src/widgets/virtualgrid/js/jquery.mobile.tizen.virtualgrid.js new file mode 100755 index 0000000..bdcfba4 --- /dev/null +++ b/src/widgets/virtualgrid/js/jquery.mobile.tizen.virtualgrid.js @@ -0,0 +1,1239 @@ +/* *************************************************************************** + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * *************************************************************************** + * + * Author: Kangsik Kim + * Youmin Ha +*/ + +/** + * In the web environment, it is challenging to display a large amount of data in a grid. + * When an application needs to show, for example, image gallery with over 1,000 images, + * the same enormous data must be inserted into a HTML document. + * It takes a long time to display the data and manipulating DOM is complex. + * The virtual grid widget supports storing unlimited data without performance issues + * by reusing a limited number of grid elements. + * The virtual grid widget is based on the jQuery.template plug-in + * For more information, see jQuery.template. + * + * HTML Attributes: + * + * data-role: virtualgrid + * data-template : Has the ID of the jQuery.template element. + * jQuery.template for a virtual grid must be defined. + * Style for template would use rem unit to support scalability. + * data-itemcount : Number of column elements. (Default : 1) + * User can select a numeric type or 'auto'. + * If value of attribute is 'auto', Number of column is dependent on screen size. + * If value of attribute is numeric type, number of column is always fixed. + * data-direction : This option define the direction of the scroll. + * You must choose one of the 'x' and 'y' (Default : y) + * data-rotation : This option defines whether or not the circulation of the data. + * If option is 'true' and scroll is reached the last data, + * Widget will present the first data on the screen. + * If option is ‘false’, Widget will operate like a scrollview. + * + * ID :
                        element that has "data-role=virtualgrid" must have ID attribute. + * + * APIs: + * + * create ( { + * itemData: function ( idx ) { return json_obj; }, + * numItemData: number or function () { return number; }, + * cacheItemData: function ( minIdx, maxIdx ) {} + * } ) + * : Create VirtualGrid widget. At this moment, _create method is called. + * args : A collection of options + * itemData: A function that returns JSON object for given index. Mandatory. + * numItemData: Total number of itemData. Mandatory. + * cacheItemData: Virtuallist will ask itemData between minIdx and maxIdx. + * Developers can implement this function for preparing data. + * Optional. + * + * centerTo ( String ) + * : Find a DOM Element with the given class name. + * This element will be centered on the screen. + * Serveral elements were found, the first element is displayed. + * + * Events: + * scrollstart : : This event triggers when a user begin to move the scroll on VirtualGrid. + * scrollupdate : : This event triggers while a user moves the scroll on VirtualGrid. + * scrollstop : This event triggers when a user stop the scroll on VirtualGrid. + * select : This event triggers when a cell is selected. + * + * Examples: + * + * + *
                        + *
                        + * + */ + +// most of following codes are derived from jquery.mobile.scrollview.js +( function ($, window, document, undefined) { + + function circularNum (num, total) { + var n = num % total; + if (n < 0) { + n = total + n; + } + return n; + } + + function MomentumTracker (options) { + this.options = $.extend({}, options); + this.easing = "easeOutQuad"; + this.reset(); + } + + var tstates = { + scrolling : 0, + done : 1 + }; + + function getCurrentTime () { + return Date.now(); + } + + $.extend (MomentumTracker.prototype, { + start : function (pos, speed, duration) { + this.state = (speed !== 0 ) ? tstates.scrolling : tstates.done; + this.pos = pos; + this.speed = speed; + this.duration = duration; + + this.fromPos = 0; + this.toPos = 0; + + this.startTime = getCurrentTime(); + }, + + reset : function () { + this.state = tstates.done; + this.pos = 0; + this.speed = 0; + this.duration = 0; + }, + + update : function () { + var state = this.state, duration, elapsed, dx, x; + + if (state == tstates.done) { + return this.pos; + } + duration = this.duration; + elapsed = getCurrentTime () - this.startTime; + elapsed = elapsed > duration ? duration : elapsed; + dx = this.speed * (1 - $.easing[this.easing] (elapsed / duration, elapsed, 0, 1, duration) ); + x = this.pos + dx; + this.pos = x; + + if (elapsed >= duration) { + this.state = tstates.done; + } + return this.pos; + }, + + done : function () { + return this.state == tstates.done; + }, + + getPosition : function () { + return this.pos; + } + }); + + jQuery.widget ("mobile.virtualgrid", jQuery.mobile.widget, { + options : { + // virtualgrid option + template : "", + direction : "y", + rotation : false, + itemcount : 1 + }, + + create : function () { + this._create.apply( this, arguments ); + }, + + _create : function ( args ) { + $.extend(this, { + // view + _$view : null, + _$clip : null, + _$rows : null, + _tracker : null, + _viewSize : 0, + _clipSize : 0, + _cellSize : undefined, + _currentItemCount : 0, + _itemCount : 1, + _isAuto : false, + + // timer + _timerInterval : 0, + _timerID : 0, + _timerCB : null, + _lastMove : null, + + // Data + _itemData : function ( idx ) { return null; }, + _numItemData : 0, + _cacheItemData : function ( minIdx, maxIdx ) { }, + _totalRowCnt : 0, + _template : null, + _maxViewSize : 0, + _modifyViewPos : 0, + _maxSize : 0, + + // axis - ( true : x , false : y ) + _direction : false, + _didDrag : true, + _reservedPos : 0, + _scalableSize : 0, + _eventPos : 0, + _nextPos : 0, + _movePos : 0, + _lastY : 0, + _speedY : 0, + _lastX : 0, + _speedX : 0, + _rowsPerView : 0, + + _filterRatio : 0.9 + }); + + var self = this, + $dom = $(self.element), + opts = self.options, + $item = null; + + // itemData + // If mandatory options are not given, Do nothing. + if ( !args ) { + return ; + } + + if ( !self._loadData(args) ) { + return; + } + + // set a scroll direction. + self._direction = opts.direction === 'x' ? true : false; + + // itemcount is assigned 'auto' + if ( typeof opts.itemcount === "string" && opts.itemcount.toUpperCase() == "AUTO" ) { + self._isAuto = true; + } + + // make view layer + 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._$view = $item; + self._$clip.css("overflow", "hidden"); + self._$view.css("overflow", "hidden"); + + // inherit from scrollview widget. + self._scrollView = $.tizen.scrollview.prototype; + self._initScrollView(); + + // create tracker. + self._createTracker(); + 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"); + + // add event handler. + self._addBehaviors(); + + self._currentItemCount = 0; + self._createScrollBar(); + self.refresh(); + }, + + // The argument is checked for compliance with the specified format. + // @param args : Object + // @return boolean + _loadData : function ( args ) { + var self = this; + + if ( args.itemData && typeof args.itemData == 'function' ) { + self._itemData = args.itemData; + } else { + return false; + } + if ( args.numItemData ) { + if ( typeof args.numItemData == 'function' ) { + self._numItemData = args.numItemData( ); + } else if ( typeof args.numItemData == 'number' ) { + self._numItemData = args.numItemData; + } else { + return false; + } + } else { + return false; + } + return true; + }, + + // Make up the first screen. + _initLayout: function () { + var self = this, + opts = self.options, + i, + $row; + + for ( i = -1; i < self._rowsPerView + 1; i += 1 ) { + $row = self._$rows[ circularNum( i, self._$rows.length ) ]; + self._$view.append( $row ); + } + self._setElementTransform( -self._cellSize ); + + self._replaceRow(self._$view.children().first(), self._totalRowCnt - 1); + if ( opts.rotation && self._rowsPerView >= self._totalRowCnt ) { + self._replaceRow(self._$view.children().last(), 0); + } + self._setViewSize(); + }, + + _setViewSize : function () { + var self = this, + height = 0, + width = 0; + + if ( self._direction ) { + width = self._cellSize * ( self._rowsPerView + 2 ); + width = parseInt(width, 10) + 1; + self._$view.width( width ); + self._viewSize = self._$view.width(); + } else { + self._$view.height( self._cellSize * ( self._rowsPerView + 2 ) ); + self._$clip.height( self._clipSize ); + self._viewSize = self._$view.height(); + } + }, + + refresh : function () { + var self = this, + opts = self.options, + width = 0, + height = 0; + + self._template = $( "#" + opts.template ); + if ( !self._template ) { + return ; + } + + width = self._calculateClipWidth(); + height = self._calculateClipHeight(); + self._$view.width(width).height(height); + self._$clip.width(width).height(height); + + self._clipSize = self._calculateClipSize(); + self._calculateColumnSize(); + self._initPageProperty(); + self._setScrollBarSize( ); + }, + + _initPageProperty : function () { + var self = this, + rowsPerView = 0, + $child, + columnCount = 0, + totalRowCnt = 0, + attributeName = self._direction ? "width" : "height"; + + if ( self._isAuto ) { + columnCount = self._calculateColumnCount(); + } else { + columnCount = self.options.itemcount; + } + totalRowCnt = parseInt(self._numItemData / columnCount , 10 ); + self._totalRowCnt = self._numItemData % columnCount === 0 ? totalRowCnt : totalRowCnt + 1; + self._itemCount = columnCount; + + if ( self._cellSize <= 0) { + return ; + } + + rowsPerView = self._clipSize / self._cellSize; + rowsPerView = Math.ceil( rowsPerView ); + self._rowsPerView = parseInt( rowsPerView, 10); + + $child = self._makeRows( rowsPerView + 2 ); + $(self._$view).append($child.children()); + self._$view.children().css(attributeName, self._cellSize + "px"); + self._$rows = self._$view.children().detach(); + + self._reservedPos = -self._cellSize; + self._scalableSize = -self._cellSize; + + self._initLayout(); + + self._blockScroll = self._rowsPerView > self._totalRowCnt; + self._maxSize = ( self._totalRowCnt - self._rowsPerView ) * 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 ); + } + }, + + resize : function ( ) { + var self = this, + rowsPerView = 0, + itemCount = 0, + totalRowCnt = 0, + diffRowCnt = 0, + clipSize = 0, + prevcnt = 0, + clipPosition = 0; + + itemCount = self._calculateColumnCount(); + if ( self._isAuto && itemCount != self._itemCount ) { + totalRowCnt = parseInt(self._numItemData / itemCount , 10 ); + self._totalRowCnt = self._numItemData % itemCount === 0 ? totalRowCnt : totalRowCnt + 1; + prevcnt = self._itemCount; + self._itemCount = itemCount; + clipPosition = self._getClipPosition(); + self._$view.hide(); + + diffRowCnt = self._replaceRows(itemCount, prevcnt, self._totalRowCnt, clipPosition); + self._maxSize = ( self._totalRowCnt - self._rowsPerView ) * self._cellSize; + self._scalableSize += (-diffRowCnt) * self._cellSize; + self._reservedPos += (-diffRowCnt) * self._cellSize; + self._setScrollBarSize(); + self._setScrollBarPosition(diffRowCnt); + + self._$view.show(); + } + + clipSize = self._calculateClipSize(); + if ( clipSize !== self._clipSize ) { + rowsPerView = clipSize / self._cellSize; + rowsPerView = parseInt( Math.ceil( rowsPerView ), 10 ); + + if ( rowsPerView > self._rowsPerView ) { + // increase row. + self._increaseRow( rowsPerView - self._rowsPerView ); + } else if ( rowsPerView < self._rowsPerView ) { + // decrease row. + self._decreaseRow( self._rowsPerView - rowsPerView ); + } + self._rowsPerView = rowsPerView; + self._clipSize = clipSize; + self._blockScroll = self._rowsPerView > self._totalRowCnt; + self._maxSize = ( self._totalRowCnt - self._rowsPerView ) * self._cellSize; + self._maxViewSize = ( self._rowsPerView ) * self._cellSize; + if ( self._clipSize < self._maxViewSize ) { + self._modifyViewPos = (-self._cellSize) + ( self._clipSize - self._maxViewSize ); + } + if ( self._direction ) { + self._$clip.width(self._clipSize); + } else { + self._$clip.height(self._clipSize); + } + self._setScrollBarSize(); + self._setScrollBarPosition(0); + self._setViewSize(); + } + }, + + _initScrollView : function () { + var self = this; + $.extend(self.options, self._scrollView.options); + self.options.moveThreshold = 10; + self.options.showScrollBars = false; + self._getScrollHierarchy = self._scrollView._getScrollHierarchy; + self._makePositioned = self._scrollView._makePositioned; + self._set_scrollbar_size = self._scrollView._set_scrollbar_size; + self._setStyleTransform = self._scrollView._setElementTransform; + }, + + _createTracker : function () { + var self = this; + + self._tracker = new MomentumTracker(self.options); + if ( self._direction ) { + self._hTracker = self._tracker; + self._$clip.width(self._clipSize); + } else { + self._vTracker = self._tracker; + self._$clip.height(self._clipSize); + } + }, + + //----------------------------------------------------// + // Scrollbar // + //----------------------------------------------------// + _createScrollBar : function () { + var self = this, + prefix = "
                        "; + + if ( self.options.rotation ) { + return ; + } + + 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"); + } 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"); + } + }, + + _setScrollBarSize: function () { + var self = this, + scrollBarSize = 0, + currentSize = 0, + $scrollBar, + attrName, + className; + + if ( self.options.rotation ) { + return ; + } + + scrollBarSize = parseInt( self._maxViewSize / self._clipSize , 10); + if ( self._direction ) { + $scrollBar = self._hScrollBar.find(".ui-scrollbar-thumb"); + attrName = "width"; + currentSize = $scrollBar.width(); + className = "ui-scrollbar-thumb-x"; + self._hScrollBar.css("width", self._clipSize); + } else { + $scrollBar = self._vScrollBar.find(".ui-scrollbar-thumb"); + attrName = "height"; + className = "ui-scrollbar-thumb-y"; + currentSize = $scrollBar.height(); + self._vScrollBar.css("height", self._clipSize); + } + + if ( scrollBarSize > currentSize ) { + $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; + }, + + _setScrollBarPosition : function ( di, duration ) { + var self = this, + $sbt = null, + x = "0px", + y = "0px"; + + if ( self.options.rotation ) { + return ; + } + + self._currentItemCount = self._currentItemCount + di; + if ( self._vScrollBar ) { + $sbt = self._vScrollBar .find(".ui-scrollbar-thumb"); + y = ( self._currentItemCount * self._itemScrollSize ) + "px"; + } else { + $sbt = self._hScrollBar .find(".ui-scrollbar-thumb"); + x = ( self._currentItemCount * self._itemScrollSize ) + "px"; + } + self._setStyleTransform( $sbt, x, y, duration ); + }, + + _hideScrollBars : function () { + var self = this, + vclass = "ui-scrollbar-visible"; + + if ( self.options.rotation ) { + return ; + } + + if ( self._vScrollBar ) { + self._vScrollBar.removeClass( vclass ); + } else { + self._hScrollBar.removeClass( vclass ); + } + }, + + _showScrollBars : function () { + var self = this, + vclass = "ui-scrollbar-visible"; + + if ( self.options.rotation ) { + return ; + } + + if ( self._vScrollBar ) { + self._vScrollBar.addClass( vclass ); + } else { + self._hScrollBar.addClass( vclass ); + } + }, + + //----------------------------------------------------// + // scroll process // + //----------------------------------------------------// + centerTo: function ( selector ) { + var self = this, + i, + newX = 0, + newY = 0; + + if ( !self.options.rotation ) { + return; + } + + for ( i = 0; i < self._$rows.length; i++ ) { + if ( $( self._$rows[i]).hasClass( selector ) ) { + if ( self._direction ) { + newX = -( i * self._cellSize - self._clipSize / 2 + self._cellSize * 2 ); + } else { + newY = -( i * self._cellSize - self._clipSize / 2 + self._cellSize * 2 ); + } + self.scrollTo( newX, newY ); + return; + } + } + }, + + scrollTo: function ( x, y, duration ) { + var self = this; + if ( self._direction ) { + self._sx = self._reservedPos; + self._reservedPos = x; + } else { + self._sy = self._reservedPos; + self._reservedPos = y; + } + self._scrollView.scrollTo.apply( this, [ x, y, duration ] ); + }, + + getScrollPosition: function () { + if ( this.direction ) { + return { x: -this._ry, y: 0 }; + } + return { x: 0, y: -this._ry }; + }, + + _setScrollPosition: function ( x, y ) { + var self = this, + sy = self._scalableSize, + distance = self._direction ? x : y, + dy = distance - sy, + di = parseInt( dy / self._cellSize, 10 ), + i = 0, + idx = 0, + $row = null; + + if ( self._blockScroll ) { + return ; + } + + if ( ! self.options.rotation ) { + if ( dy > 0 && distance >= -self._cellSize && self._scalableSize >= -self._cellSize ) { + // top + self._stopMScroll(); + self._scalableSize = -self._cellSize; + self._setElementTransform( -self._cellSize ); + return; + } + if ( (dy < 0 && self._scalableSize <= -(self._maxSize + self._cellSize) )) { + // bottom + self._stopMScroll(); + self._scalableSize = -(self._maxSize + self._cellSize); + self._setElementTransform( self._modifyViewPos ); + return; + } + } + + if ( di > 0 ) { // scroll up + for ( i = 0; i < di; i++ ) { + idx = -parseInt( ( sy / self._cellSize ) + i + 3, 10 ); + $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-- ) { + idx = self._rowsPerView - parseInt( ( sy / self._cellSize ) + i, 10 ); + $row = self._$view.children().first().detach(); + self._replaceRow($row, circularNum( idx, self._totalRowCnt ) ); + self._$view.append( $row ); + self._setScrollBarPosition(1); + } + } + self._scalableSize += di * self._cellSize; + self._setElementTransform( distance - self._scalableSize - self._cellSize ); + }, + + _setElementTransform : function ( value ) { + var self = this, + x = 0, + y = 0; + + if ( self._direction ) { + x = value + "px"; + } else { + y = value + "px"; + } + self._setStyleTransform(self._$view, x, y ); + }, + + //----------------------------------------------------// + // Event handler // + //----------------------------------------------------// + _handleMomentumScroll: function () { + var self = this, + opts = self.options, + keepGoing = false, + v = this._$view, + x = 0, + y = 0, + t = self._tracker; + + if ( t ) { + t.update(); + if ( self._direction ) { + x = t.getPosition(); + } else { + y = t.getPosition(); + } + keepGoing = !t.done(); + } + + self._setScrollPosition( x, y ); + if ( !opts.rotation ) { + keepGoing = !t.done(); + self._reservedPos = self._direction ? x : y; + // bottom + self._reservedPos = self._reservedPos <= (-(self._maxSize - self._modifyViewPos)) ? ( - ( self._maxSize + self._cellSize) ) : self._reservedPos; + // top + self._reservedPos = self._reservedPos > -self._cellSize ? -self._cellSize : self._reservedPos; + } else { + self._reservedPos = self._direction ? x : y; + } + self._$clip.trigger( self.options.updateEventName, [ { x: x, y: y } ] ); + + if ( keepGoing ) { + self._timerID = setTimeout( self._timerCB, self._timerInterval ); + } else { + self._stopMScroll(); + } + }, + + _startMScroll: function ( speedX, speedY ) { + var self = this; + if ( self._direction ) { + self._sx = self._reservedPos; + } else { + self._sy = self._reservedPos; + } + self._scrollView._startMScroll.apply(self, [speedX, speedY]); + }, + + _stopMScroll: function () { + this._scrollView._stopMScroll.apply(this); + }, + + _enableTracking: function () { + $(document).bind( this._dragMoveEvt, this._dragMoveCB ); + $(document).bind( this._dragStopEvt, this._dragStopCB ); + }, + + _disableTracking: function () { + $(document).unbind( this._dragMoveEvt, this._dragMoveCB ); + $(document).unbind( this._dragStopEvt, this._dragStopCB ); + }, + + _handleDragStart: function ( e, ex, ey ) { + var self = this; + self._scrollView._handleDragStart.apply( this, [ e, ex, ey ] ); + self._eventPos = self._direction ? ex : ey; + self._nextPos = self._reservedPos; + }, + + _handleDragMove: function ( e, ex, ey ) { + var self = this, + dx = ex - self._lastX, + dy = ey - self._lastY, + x = 0, + y = 0; + + self._lastMove = getCurrentTime(); + self._speedX = dx; + self._speedY = dy; + + self._didDrag = true; + + self._lastX = ex; + self._lastY = ey; + + if ( self._direction ) { + self._movePos = ex - self._eventPos; + x = self._nextPos + self._movePos; + } else { + self._movePos = ey - self._eventPos; + y = self._nextPos + self._movePos; + } + self._showScrollBars(); + self._setScrollPosition( x, y ); + return false; + }, + + _handleDragStop: function ( e ) { + var self = this; + + self._reservedPos = self._movePos ? self._nextPos + self._movePos : self._reservedPos; + self._scrollView._handleDragStop.apply( this, [ e ] ); + return self._didDrag ? false : undefined; + }, + + _addBehaviors: function () { + var self = this; + + // scroll event handler. + if ( self.options.eventType === "mouse" ) { + self._dragStartEvt = "mousedown"; + self._dragStartCB = function ( e ) { + return self._handleDragStart( e, e.clientX, e.clientY ); + }; + + self._dragMoveEvt = "mousemove"; + self._dragMoveCB = function ( e ) { + return self._handleDragMove( e, e.clientX, e.clientY ); + }; + + self._dragStopEvt = "mouseup"; + self._dragStopCB = function ( e ) { + return self._handleDragStop( e, e.clientX, e.clientY ); + }; + + 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 ); + }; + + self._dragMoveEvt = "touchmove"; + self._dragMoveCB = function ( e ) { + var t = e.originalEvent.targetTouches[0]; + return self._handleDragMove(e, t.pageX, t.pageY ); + }; + + self._dragStopEvt = "touchend"; + self._dragStopCB = function ( e ) { + return self._handleDragStop( e ); + }; + } + self._$view.bind( self._dragStartEvt, self._dragStartCB ); + + // other events. + self._$view.delegate(".virtualgrid-item", "click", function (event) { + var $selectedItem = $(this); + $selectedItem.trigger("select", this); + }); + + $( window ).bind("resize", function ( e ) { + var height = 0, + $virtualgrid = $(".ui-virtualgrid-view"); + if ( $virtualgrid.length !== 0 ) { + if ( self._direction ) { + height = self._calculateClipHeight(); + self._$view.height(height); + self._$clip.height(height); + } else { + height = self._calculateClipWidth(); + self._$view.width(height); + self._$clip.width(height); + } + self.resize( ); + } + }); + + $(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')" ), + footerHeight = $footer ? $footer.height() : 0, + headerHeight = $header ? $header.height() : 0; + + if ( $page && $content ) { + $content.height(window.innerHeight - headerHeight - footerHeight).css("overflow", "hidden"); + $content.addClass("ui-virtualgrid-content"); + } + }); + }, + + //----------------------------------------------------// + // Calculate size about dom element. // + //----------------------------------------------------// + _calculateClipSize : function () { + var self = this, + clipSize = 0; + + if ( self._direction ) { + clipSize = self._calculateClipWidth(); + } else { + clipSize = self._calculateClipHeight(); + } + return clipSize; + }, + + _calculateClipWidth : function () { + var self = this, + view = $(self.element), + $parent = $(self.element).parent(), + paddingValue = 0, + clipSize = $(window).width(); + 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); + } else { + clipSize = view.width(); + } + return clipSize; + }, + + _calculateClipHeight : function () { + var self = this, + view = $(self.element), + $parent = $(self.element).parent(), + header = null, + footer = null, + paddingValue = 0, + clipSize = $(window).height(); + 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"); + + if ( header ) { + if ( header.outerHeight(true) === null ) { + clipSize = clipSize - ( $(".ui-header").outerHeight() || 0 ); + } else { + clipSize = clipSize - header.outerHeight(true); + } + } + if ( footer ) { + clipSize = clipSize - footer.outerHeight(true); + } + } else { + clipSize = view.height(); + } + return clipSize; + }, + + _calculateColumnSize : function () { + var self = this, + $tempBlock, + $cell; + + $tempBlock = self._makeRows( 1 ); + self._$view.append( $tempBlock.children().first() ); + if ( self._direction ) { + // x-axis + self._viewSize = self._$view.width(); + $cell = self._$view.children().first().children().first(); + 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); + } + $tempBlock.remove(); + self._$view.children().remove(); + }, + + _calculateColumnCount : function ( ) { + var self = this, + $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 ) ); + } else { + viewSize = viewSize - ( parseInt( $view.css("padding-left"), 10 ) + parseInt( $view.css("padding-right"), 10 ) ); + } + + itemCount = parseInt( (viewSize / self._cellOtherSize), 10); + return itemCount > 0 ? itemCount : 1 ; + }, + + // Read the position of clip form property ('webkit-transform'). + // @return : number - position of clip. + _getClipPosition : function () { + var self = this, + matrix = null, + contents = null, + result = -self._cellSize, + $scrollview = self._$view.closest(".ui-scrollview-view"); + + if ( $scrollview ) { + matrix = $scrollview.css("-webkit-transform"); + contents = matrix.substr( 7 ); + contents = contents.substr( 0, contents.length - 1 ); + contents = contents.split( ', ' ); + result = Math.abs(contents [5]); + } + return result; + }, + + //----------------------------------------------------// + // DOM Element handle // + //----------------------------------------------------// + _makeRows : function ( count ) { + var self = this, + opts = self.options, + index = 0, + $row = null, + $wrapper = null; + + $wrapper = $(document.createElement("div")); + $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 )); + } + $wrapper.append($row); + } + return $wrapper; + }, + + // make a single row block + _makeRow : function ( myTemplate, rowIndex ) { + var self = this, + opts = self.options, + index = rowIndex * self._itemCount, + htmlData = null, + itemData = null, + colIndex = 0, + attrName = self._direction ? "top" : "left", + blockClassName = self._direction ? "ui-virtualgrid-wrapblock-x" : "ui-virtualgrid-wrapblock-y", + blockAttrName = self._direction ? "top" : "left", + wrapBlock = $( document.createElement( "div" )); + + wrapBlock.addClass( blockClassName ).attr("row-index", rowIndex); + for ( colIndex = 0; colIndex < self._itemCount; colIndex++ ) { + itemData = self._itemData( index ); + if ( itemData ) { + htmlData = self._makeHtmlData( myTemplate, index, colIndex); + wrapBlock.append( htmlData ); + index += 1; + } + } + return wrapBlock; + }, + + _makeHtmlData : function ( myTemplate, dataIndex, colIndex ) { + var self = this, + htmlData = null, + itemData = null, + attrName = self._direction ? "top" : "left"; + + itemData = self._itemData( dataIndex ); + if ( itemData ) { + htmlData = myTemplate.tmpl( itemData ); + $(htmlData).css(attrName, ( colIndex * self._cellOtherSize )).addClass("virtualgrid-item"); + } + return htmlData; + }, + + _increaseRow : function ( num ) { + var self = this, + rotation = self.options.rotation, + $row = null, + headItemIndex = 0, + tailItemIndex = 0, + itemIndex = 0, + 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; + + for ( idx = 1 ; idx <= num ; idx++ ) { + if ( tailItemIndex + idx >= self._totalRowCnt ) { + $row = self._makeRow( self._template, headItemIndex ); + self._$view.prepend($row); + headItemIndex -= 1; + } else { + $row = self._makeRow( self._template, tailItemIndex + idx ); + self._$view.append($row); + } + if ( self._direction ) { + $row.width(self._cellSize); + } else { + $row.height(self._cellSize); + } + } + }, + + _decreaseRow : function ( num ) { + var self = this, + idx = 0; + + for ( idx = 0 ; idx < num ; idx++ ) { + self._$view.children().last().remove(); + } + }, + + _replaceRows : function ( curCnt, prevCnt, maxCnt, clipPosition ) { + var self = this, + $rows = self._$view.children(), + prevRowIndex = 0, + rowIndex = 0, + diffRowCnt = 0, + targetCnt = 1, + filterCondition = ( self._filterRatio * self._cellSize) + self._cellSize, + idx = 0; + + if ( filterCondition < clipPosition ) { + targetCnt += 1; + } + + prevRowIndex = parseInt( $($rows[targetCnt]).attr("row-index"), 10); + if ( prevRowIndex === 0 ) { + // only top. + rowIndex = maxCnt - targetCnt; + } else { + rowIndex = Math.round( (prevRowIndex * prevCnt) / curCnt ); + if ( rowIndex + self._rowsPerView >= maxCnt ) { + // only bottom. + rowIndex = maxCnt - self._rowsPerView; + } + diffRowCnt = prevRowIndex - rowIndex; + rowIndex -= targetCnt; + } + + for ( idx = 0 ; idx < $rows.length ; idx += 1 ) { + self._replaceRow($rows[idx], circularNum( rowIndex, self._totalRowCnt )); + rowIndex++; + } + return -diffRowCnt; + }, + + _replaceRow : function ( block, index ) { + var self = this, + opts = self.options, + $columns = null, + $column = null, + data = null, + htmlData = null, + myTemplate = null, + idx = 0, + dataIdx = 0, + tempBlocks = null; + + $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.remove(); + return ; + } + + dataIdx = index * self._itemCount; + for ( idx = 0; idx < self._itemCount ; idx += 1 ) { + $column = $columns[idx]; + data = self._itemData(dataIdx); + if ( $column && data ) { + myTemplate = self._template; + htmlData = myTemplate.tmpl( data ); + self._replace( $column, htmlData, false ); + htmlData.remove(); // Clear temporary htmlData to free cache + dataIdx ++; + } else if ($column && !data ) { + $($column).remove(); + } + } + }, + + /* Text & image src replace function */ + // @param oldItem : prev HtmlDivElement + // @param newItem : new HtmlDivElement for replace + // @param key : + _replace : function ( oldItem, newItem, key ) { + $( oldItem ).find( ".ui-li-text-main", ".ui-li-text-sub", "ui-btn-text" ).each( function ( index ) { + var oldObj = $( this ), + newText = $( newItem ).find( ".ui-li-text-main", ".ui-li-text-sub", "ui-btn-text" ).eq( index ).text(); + + $( oldObj ).contents().filter( function () { + return ( this.nodeType == 3 ); + }).get( 0 ).data = newText; + }); + + $( oldItem ).find( "img" ).each( function ( imgIndex ) { + var oldObj = $( this ), + newImg = $( newItem ).find( "img" ).eq( imgIndex ).attr( "src" ); + + $( oldObj ).attr( "src", newImg ); + }); + $( oldItem).removeData(); + if ( key ) { + $( oldItem ).data( key, $( newItem ).data( key ) ); + } + } + } ); + + $( document ).bind( "pagecreate create", function ( e ) { + $(":jqmData(role='virtualgrid')").virtualgrid(); + } ); +} (jQuery, window, document) ); diff --git a/src/widgets/virtuallist/js/jquery.mobile.tizen.virtuallistview.js b/src/widgets/virtuallist/js/jquery.mobile.tizen.virtuallistview.js new file mode 100755 index 0000000..1c9ae41 --- /dev/null +++ b/src/widgets/virtuallist/js/jquery.mobile.tizen.virtuallistview.js @@ -0,0 +1,876 @@ +/* *************************************************************************** + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * *************************************************************************** + * + * Author: Wongi Lee + */ + +/** + * Virtual List Widget for unlimited data. + * To support more then 1,000 items, special list widget developed. + * Fast initialize and light DOM tree. + * DB connection and works like DB cursor. + * + * HTML Attributes: + * + * data-role: virtuallistview + * data-template : jQuery.template ID that populate into virtual list + * data-row : Optional. Set number of
                      • elements that are used for data handling. + * + * ID :
                          element that has "data-role=virtuallist" must have ID attribute. + * + * * APIs: + * + * create ( { + * itemData: function ( idx ) { return json_obj; }, + * numItemData: number or function () { return number; }, + * cacheItemData: function ( minIdx, maxIdx ) {} + * } ) + * : Create a virtuallist widget. At this moment, _create method is called. + * args : A collection of options + * itemData: A function that returns JSON object for given index. Mandatory. + * numItemData: Total number of itemData. Mandatory. + * cacheItemData: Virtuallist will ask itemData between minIdx and maxIdx. + * Developers can implement this function for preparing data. + * Optional. + * + * Events: + * + * touchstart : Temporary preventDefault applied on touchstart event to avoid broken screen. + * + * Examples: + * + * + * + *
                            + *
                          + * + */ + + +(function ( $, undefined ) { + + /* Code for Virtual List Demo */ + var listCountPerPage = {}, /* Keeps track of the number of lists per page UID. This allows support for multiple nested list in the same page. https://github.com/jquery/jquery-mobile/issues/1617 */ + _NO_SCROLL = 0, /* ENUM */ + _SCROLL_DOWN = 1, /* ENUM */ + _SCROLL_UP = -1; /* ENUM */ + + $.widget( "tizen.virtuallistview", $.mobile.widget, { + options: { + theme: "s", + countTheme: "c", + headerTheme: "b", + dividerTheme: "b", + splitIcon: "arrow-r", + splitTheme: "b", + inset: false, + id: "", /* Virtual list UL elemet's ID */ + childSelector: " li", /* To support swipe list */ + dbtable: "", + template : "", + dbkey: false, /* Data's unique Key */ + scrollview: false, + row: 100, + page_buf: 50, + initSelector: ":jqmData(role='virtuallistview')" + }, + + _stylerMouseUp: function () { + $( this ).addClass( "ui-btn-up-s" ); + $( this ).removeClass( "ui-btn-down-s" ); + }, + + _stylerMouseDown: function () { + $( this ).addClass( "ui-btn-down-s" ); + $( this ).removeClass( "ui-btn-up-s" ); + }, + + _stylerMouseOver: function () { + $( this ).toggleClass( "ui-btn-hover-s" ); + }, + + _stylerMouseOut: function () { + $( this ).toggleClass( "ui-btn-hover-s" ); + $( this ).addClass( "ui-btn-up-s" ); + $( this ).removeClass( "ui-btn-down-s" ); + }, + + _pushData: function ( template ) { + var o = this.options, + i, + myTemplate = $( "#" + template ), + lastIndex = ( o.row > this._numItemData ? this._numItemData : o.row ), + htmlData; + + for ( i = 0; i < lastIndex; i++ ) { + htmlData = myTemplate.tmpl( this._itemData( i ) ); + $( o.id ).append( $( htmlData ).attr( 'id', 'li_' + i ) ); + } + + /* After push data, re-style virtuallist widget */ + $( o.id ).trigger( "create" ); + }, + + _reposition: function ( event ) { + var o, + t = this, + padding; + + if ( event.data ) { + o = event.data; + } else { + o = event; + } + + if ( $( o.id + o.childSelector ).size() > 0 ) { + t._title_h = $( o.id + o.childSelector + ':first' ).position().top; + t._line_h = $( o.id + o.childSelector + ':first' ).outerHeight(); + + t._container_w = $( o.id ).innerWidth(); + + padding = parseInt( $( o.id + o.childSelector ).css( "padding-left" ), 10 ) + parseInt( $( o.id + o.childSelector ).css( "padding-right" ), 10 ); + + /* Add style */ + $( o.id + ">" + o.childSelector ) + .addClass( "position_absolute" ) + .addClass( "ui-btn-up-s" ) + .bind( "mouseup", t._stylerMouseUp ) + .bind( "mousedown", t._stylerMouseDown ) + .bind( "mouseover", t._stylerMouseOver ) + .bind( "mouseout", t._stylerMouseOut ); + } + + $( o.id + ">" + o.childSelector ).each( function ( index ) { + $( this ).css( "top", t._title_h + t._line_h * index + 'px' ) + .css( "width", t._container_w - padding ); + } ); + + /* Set Max List Height */ + $( o.id ).height( t._numItemData * t._line_h ); + }, + + _resize: function ( event ) { + var o, + t = this, + padding; + + if ( event.data ) { + o = event.data; + } else { + o = event; + } + + t._container_w = $( o.id ).innerWidth(); + + padding = parseInt( $( o.id + o.childSelector ).css( "padding-left" ), 10 ) + parseInt( $( o.id + o.childSelector ).css( "padding-right" ), 10 ); + + $( o.id + o.childSelector ).each( function (index) { + $( this ).css( "width", t._container_w - padding ); + } ); + }, + + _scrollmove: function ( event ) { + var t = event.data, // document + o = t.options, + velocity = 0, + i, + _replace, /* Function */ + _moveTopBottom, /* Function */ + _moveBottomTop, /* Function */ + _matrixToArray, /* Function */ + $el, + transformValue, + curWindowTop, + cur_num_top_items; + + /* Text & image src replace function */ + _replace = function ( oldItem, newItem, key ) { + var oldObj, + newText, + newImg; + + $( oldItem ).find( ".ui-li-text-main", ".ui-li-text-sub", "ui-btn-text" ).each( function ( index ) { + oldObj = $( this ); + newText = $( newItem ).find( ".ui-li-text-main", ".ui-li-text-sub", "ui-btn-text" ).eq( index ).text(); + + $( oldObj).contents().filter( function () { + return ( this.nodeType == 3 ); + } ).get( 0 ).data = newText; + } ); + + $( oldItem ).find( "img" ).each( function ( imgIndex ) { + oldObj = $( this ); + newImg = $( newItem ).find( "img" ).eq( imgIndex ).attr( "src" ); + + $( oldObj ).attr( "src", newImg ); + } ); + + $( oldItem ).removeData( ); // Clear old data + + if (key) { + $( oldItem ).data( key, $( newItem ).data( key ) ); + } + }; + + //Move older item to bottom + _moveTopBottom = function ( v_firstIndex, v_lastIndex, num, key ) { + var myTemplate, + htmlData, + cur_item; + + if (v_firstIndex < 0) { + return; + } + + for ( i = 0; i < num; i++ ) { + if ( v_lastIndex + i > t._numItemData ) { + break; + } + + cur_item = $( '#li_' + ( v_firstIndex + i ) ); + + if ( cur_item ) { + /* Make New
                        • element from template. */ + myTemplate = $( "#" + o.template ); + htmlData = myTemplate.tmpl( t._itemData( v_lastIndex + i ) ); + + /* Copy all data to current item. */ + _replace( cur_item, htmlData, key ); + + // Clear temporary htmlData to free cache + htmlData.remove(); + + /* Set New Position */ + ( cur_item ).css( 'top', t._title_h + t._line_h * ( v_lastIndex + 1 + i ) ).attr( 'id', 'li_' + ( v_lastIndex + 1 + i ) ); + + } else { + break; + } + } + }; + + // Move older item to bottom + _moveBottomTop = function ( v_firstIndex, v_lastIndex, num, key ) { + var myTemplate, + htmlData, + cur_item; + + if ( v_firstIndex < 0 ) { + return; + } + + for ( i = 0; i < num; i++ ) { + cur_item = $( '#li_' + ( v_lastIndex - i ) ); + + if ( cur_item ) { + if ( v_firstIndex - 1 - i < 0 ) { + break; + } + + /* Make New
                        • element from template. */ + myTemplate = $( "#" + o.template ); + htmlData = myTemplate.tmpl( t._itemData( v_firstIndex - 1 - i ) ); + + /* Copy all data to current item. */ + _replace( cur_item, htmlData, key ); + + // Clear temporary htmlData to free cache + htmlData.remove(); + + /* Set New Position */ + $( cur_item ).css( 'top', t._title_h + t._line_h * ( v_firstIndex - 1 - i ) ).attr( 'id', 'li_' + ( v_firstIndex - 1 - i ) ); + + } else { + break; + } + } + }; + + /* Matrix to Array function written by Blender@stackoverflow.nnikishi@emich.edu*/ + _matrixToArray = function ( matrix ) { + var contents = matrix.substr( 7 ); + + contents = contents.substr( 0, contents.length - 1 ); + + return contents.split( ', ' ); + }; + + // Get scroll direction and velocity + /* with Scroll view */ + if ( o.scrollview ) { + $el = $( o.id ).parentsUntil( ".ui-page" ).find( ".ui-scrollview-view" ); + transformValue = _matrixToArray( $el.css( "-webkit-transform" ) ); + curWindowTop = Math.abs( transformValue[ 5 ] ); /* Y vector */ + } else { + curWindowTop = $( window ).scrollTop() - t._line_h; + } + + cur_num_top_items = $( o.id + o.childSelector ).filter( function () { + return (parseInt( $( this ).css( "top" ), 10 ) < curWindowTop ); + } ).size(); + + if ( t._num_top_items < cur_num_top_items ) { + t._direction = _SCROLL_DOWN; + velocity = cur_num_top_items - t._num_top_items; + t._num_top_items = cur_num_top_items; + } else if ( t._num_top_items > cur_num_top_items ) { + t._direction = _SCROLL_UP; + velocity = t._num_top_items - cur_num_top_items; + t._num_top_items = cur_num_top_items; + } + + // Move items + if ( t._direction == _SCROLL_DOWN ) { + if ( cur_num_top_items > o.page_buf ) { + if ( t._last_index + velocity > t._numItemData ) { + velocity = t._numItemData - t._last_index - 1; + } + + /* Prevent scroll touch event while DOM access */ + $(document).bind( "touchstart.virtuallist", function (event) { + event.preventDefault(); + }); + + _moveTopBottom( t._first_index, t._last_index, velocity, o.dbkey ); + + t._first_index += velocity; + t._last_index += velocity; + t._num_top_items -= velocity; + + /* Unset prevent touch event */ + $( document ).unbind( "touchstart.virtuallist" ); + } + } else if ( t._direction == _SCROLL_UP ) { + if ( cur_num_top_items <= o.page_buf ) { + if ( t._first_index < velocity ) { + velocity = t._first_index; + } + + /* Prevent scroll touch event while DOM access */ + $( document ).bind( "touchstart.virtuallist", function ( event ) { + event.preventDefault(); + }); + + _moveBottomTop( t._first_index, t._last_index, velocity, o.dbkey ); + + t._first_index -= velocity; + t._last_index -= velocity; + t._num_top_items += velocity; + + /* Unset prevent touch event */ + $( document ).unbind( "touchstart.virtuallist" ); + } + + if ( t._first_index < o.page_buf ) { + t._num_top_items = t._first_index; + } + } + }, + + _recreate: function ( newArray ) { + var t = this, + o = this.options; + + $( o.id ).empty(); + + t._numItemData = newArray.length; + t._direction = _NO_SCROLL; + t._first_index = 0; + t._last_index = o.row - 1; + + t._pushData( o.template ); + + if (o.childSelector == " ul" ) { + $( o.id + " ul" ).swipelist(); + } + + $( o.id ).virtuallistview(); + + t.refresh( true ); + + t._reposition( o ); + }, + + _initList: function () { + var t = this, + o = this.options; + + /* After AJAX loading success */ + + /* Make Gen list by template */ + t._pushData( o.template ); + + $( o.id ).parentsUntil( ".ui-page" ).parent().one( "pageshow", function () { + setTimeout( function () { + t._reposition( o ); + }, 0); + }); + + /* Scrollview */ + $( document ).bind( "scrollstop.virtuallist", t, t._scrollmove ); + + $( window ).bind( "resize.virtuallist", t._resize ); + + if ( o.childSelector == " ul" ) { + $( o.id + " ul" ).swipelist(); + } + + t.refresh( true ); + }, + + create: function () { + var o = this.options; + + /* external API for AJAX callback */ + this._create.apply( this, arguments ); + + this._reposition( o ); + }, + + _create: function ( args ) { + // Extend required vars + $.extend( this, { + _itemData : function ( idx ) { return null; }, + _numItemData : 0, + _cacheItemData : function ( minIdx, maxIdx ) { }, + _line_h : 0, + _title_h : 0, + _container_w : 0, + _minimum_row : 20, + _direction : _NO_SCROLL, + _first_index : 0, + _last_index : 0, + _num_top_items : 0 // By scroll move, number of hidden elements. + } ); + + var t = this, + o = this.options, + $el = this.element, + shortcutsContainer = $('
                          '), + shortcutsList = $('
                            '), + dividers = $el.find(':jqmData(role="virtuallistview" )'), + lastListItem = null, + shortcutscroll = this, + dbtable_name, + dbtable; + + + // create listview markup + t.element.addClass( function ( i, orig ) { + return orig + " ui-listview ui-virtual-list-container" + ( t.options.inset ? " ui-listview-inset ui-corner-all ui-shadow " : "" ); + }); + + o.id = "#" + $el.attr( "id" ); + + $( o.id ).bind( "pagehide", function ( e ) { + $( o.id ).empty(); + }); + + /* Scroll view */ + if ( $( ".ui-scrollview-clip" ).size() > 0 ) { + o.scrollview = true; + } else { + o.scrollview = false; + } + + /* Init list and page buf */ + if ( $el.data( "row" ) ) { + o.row = $el.data( "row" ); + + if ( o.row < t._minimum_row ) { + o.row = t._minimum_row; + } + + o.page_buf = parseInt( ( o.row / 2 ), 10 ); + } + + // Get arguments + if ( args ) { + if ( args.itemData && typeof args.itemData == 'function' ) { + t._itemData = args.itemData; + } else { + return; + } + if ( args.numItemData ) { + if ( typeof args.numItemData == 'function' ) { + t._numItemData = args.numItemData( ); + } else if ( typeof args.numItemData == 'number' ) { + t._numItemData = args.numItemData; + } else { + return; + } + } else { + return; + } + } else { // No option is given + // Legacy support: dbtable + console.log("WARNING: The data interface of virtuallist is changed. \nOld data interface(data-dbtable) is still supported, but will be removed in next version. \nPlease fix your code soon!"); + + /* After DB Load complete, Init Vritual list */ + if ( $( o.id ).hasClass( "vlLoadSuccess" ) ) { + dbtable_name = $el.jqmData('dbtable'); + dbtable = window[ dbtable_name ]; + + if ( !dbtable ) { + dbtable = { }; + } + + $( o.id ).empty(); + + if ( $el.data( "template" ) ) { + o.template = $el.data( "template" ); + + /* to support swipe list,
                          • or
                              can be main node of virtual list. */ + if ( $el.data( "swipelist" ) == true ) { + o.childSelector = " ul"; + } else { + o.childSelector = " li"; + } + } + + /* Set data's unique key */ + if ( $el.data( "dbkey" ) ) { + o.dbkey = $el.data( "dbkey" ); + } + + t._first_index = 0; //first id of
                            • element. + t._last_index = o.row - 1; //last id of
                            • element. + + t._itemData = function ( idx ) { + return dbtable[ idx ]; + }; + t._numItemData = dbtable.length; + + t._initList(); + } + } + + }, + + destroy : function () { + var o = this.options; + + $( document ).unbind( "scrollstop" ); + + $( window ).unbind( "resize.virtuallist" ); + + $( o.id ).empty(); + }, + + _itemApply: function ( $list, item ) { + var $countli = item.find( ".ui-li-count" ); + + if ( $countli.length ) { + item.addClass( "ui-li-has-count" ); + } + + $countli.addClass( "ui-btn-up-" + ( $list.jqmData( "counttheme" ) || this.options.countTheme ) + " ui-btn-corner-all" ); + + // TODO class has to be defined in markup + item.find( "h1, h2, h3, h4, h5, h6" ).addClass( "ui-li-heading" ).end() + .find( "p, dl" ).addClass( "ui-li-desc" ).end() + .find( ">img:eq(0), .ui-link-inherit>img:eq(0)" ).addClass( "ui-li-thumb" ).each( function () { + item.addClass( $( this ).is( ".ui-li-icon" ) ? "ui-li-has-icon" : "ui-li-has-thumb" ); + }).end() + .find( ".ui-li-aside" ).each(function () { + var $this = $( this ); + $this.prependTo( $this.parent() ); //shift aside to front for css float + } ); + }, + + _removeCorners: function ( li, which ) { + var top = "ui-corner-top ui-corner-tr ui-corner-tl", + bot = "ui-corner-bottom ui-corner-br ui-corner-bl"; + + li = li.add( li.find( ".ui-btn-inner, .ui-li-link-alt, .ui-li-thumb" ) ); + + if ( which === "top" ) { + li.removeClass( top ); + } else if ( which === "bottom" ) { + li.removeClass( bot ); + } else { + li.removeClass( top + " " + bot ); + } + }, + + _refreshCorners: function ( create ) { + var $li, + $visibleli, + $topli, + $bottomli; + + if ( this.options.inset ) { + $li = this.element.children( "li" ); + // at create time the li are not visible yet so we need to rely on .ui-screen-hidden + $visibleli = create ? $li.not( ".ui-screen-hidden" ) : $li.filter( ":visible" ); + + this._removeCorners( $li ); + + // Select the first visible li element + $topli = $visibleli.first() + .addClass( "ui-corner-top" ); + + $topli.add( $topli.find( ".ui-btn-inner" ) ) + .find( ".ui-li-link-alt" ) + .addClass( "ui-corner-tr" ) + .end() + .find( ".ui-li-thumb" ) + .not( ".ui-li-icon" ) + .addClass( "ui-corner-tl" ); + + // Select the last visible li element + $bottomli = $visibleli.last() + .addClass( "ui-corner-bottom" ); + + $bottomli.add( $bottomli.find( ".ui-btn-inner" ) ) + .find( ".ui-li-link-alt" ) + .addClass( "ui-corner-br" ) + .end() + .find( ".ui-li-thumb" ) + .not( ".ui-li-icon" ) + .addClass( "ui-corner-bl" ); + } + }, + + refresh: function ( create ) { + this.parentPage = this.element.closest( ".ui-page" ); + this._createSubPages(); + + var o = this.options, + $list = this.element, + self = this, + dividertheme = $list.jqmData( "dividertheme" ) || o.dividerTheme, + listsplittheme = $list.jqmData( "splittheme" ), + listspliticon = $list.jqmData( "spliticon" ), + li = $list.children( "li" ), + counter = $.support.cssPseudoElement || !$.nodeName( $list[ 0 ], "ol" ) ? 0 : 1, + item, + itemClass, + temTheme, + a, + last, + splittheme, + countParent, + icon, + pos, + numli, + itemTheme; + + if ( counter ) { + $list.find( ".ui-li-dec" ).remove(); + } + + for ( pos = 0, numli = li.length; pos < numli; pos++ ) { + item = li.eq( pos ); + itemClass = "ui-li"; + + // If we're creating the element, we update it regardless + if ( create || !item.hasClass( "ui-li" ) ) { + itemTheme = item.jqmData( "theme" ) || o.theme; + a = item.children( "a" ); + + if ( a.length ) { + icon = item.jqmData( "icon" ); + + item.buttonMarkup({ + wrapperEls: "div", + shadow: false, + corners: false, + iconpos: "right", + /* icon: a.length > 1 || icon === false ? false : icon || "arrow-r",*/ + icon: false, /* Remove unnecessary arrow icon */ + theme: itemTheme + }); + + if ( ( icon != false ) && ( a.length == 1 ) ) { + item.addClass( "ui-li-has-arrow" ); + } + + a.first().addClass( "ui-link-inherit" ); + + if ( a.length > 1 ) { + itemClass += " ui-li-has-alt"; + + last = a.last(); + splittheme = listsplittheme || last.jqmData( "theme" ) || o.splitTheme; + + last.appendTo(item) + .attr( "title", last.getEncodedText() ) + .addClass( "ui-li-link-alt" ) + .empty() + .buttonMarkup({ + shadow: false, + corners: false, + theme: itemTheme, + icon: false, + iconpos: false + }) + .find( ".ui-btn-inner" ) + .append( + $( "" ).buttonMarkup({ + shadow: true, + corners: true, + theme: splittheme, + iconpos: "notext", + icon: listspliticon || last.jqmData( "icon" ) || o.splitIcon + }) + ); + } + } else if ( item.jqmData( "role" ) === "list-divider" ) { + + itemClass += " ui-li-divider ui-btn ui-bar-" + dividertheme; + item.attr( "role", "heading" ); + + //reset counter when a divider heading is encountered + if ( counter ) { + counter = 1; + } + + } else { + itemClass += " ui-li-static ui-body-" + itemTheme; + } + } + + if ( counter && itemClass.indexOf( "ui-li-divider" ) < 0 ) { + countParent = item.is( ".ui-li-static:first" ) ? item : item.find( ".ui-link-inherit" ); + + countParent.addClass( "ui-li-jsnumbering" ) + .prepend( "" + (counter++) + ". " ); + } + + item.add( item.children( ".ui-btn-inner" ) ).addClass( itemClass ); + + self._itemApply( $list, item ); + } + + this._refreshCorners( create ); + }, + + //create a string for ID/subpage url creation + _idStringEscape: function ( str ) { + return str.replace(/\W/g , "-"); + }, + + _createSubPages: function () { + var parentList = this.element, + parentPage = parentList.closest( ".ui-page" ), + parentUrl = parentPage.jqmData( "url" ), + parentId = parentUrl || parentPage[ 0 ][ $.expando ], + parentListId = parentList.attr( "id" ), + o = this.options, + dns = "data-" + $.mobile.ns, + self = this, + persistentFooterID = parentPage.find( ":jqmData(role='footer')" ).jqmData( "id" ), + hasSubPages, + newRemove; + + if ( typeof listCountPerPage[ parentId ] === "undefined" ) { + listCountPerPage[ parentId ] = -1; + } + + parentListId = parentListId || ++listCountPerPage[ parentId ]; + + $( parentList.find( "li>ul, li>ol" ).toArray().reverse() ).each(function ( i ) { + var self = this, + list = $( this ), + listId = list.attr( "id" ) || parentListId + "-" + i, + parent = list.parent(), + nodeEls, + 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, + newPage, + anchor; + + nodeEls = $( list.prevAll().toArray().reverse() ); + nodeEls = nodeEls.length ? nodeEls : $( "" + $.trim( parent.contents()[ 0 ].nodeValue ) + "" ); + + //define hasSubPages for use in later removal + hasSubPages = true; + + newPage = list.detach() + .wrap( "
                              " ) + .parent() + .before( "
                              " + title + "
                              " ) + .after( persistentFooterID ? $( "
                              " ) : "" ) + .parent() + .appendTo( $.mobile.pageContainer ); + + newPage.page(); + + anchor = parent.find('a:first'); + + if ( !anchor.length ) { + anchor = $( "" ).html( nodeEls || title ).prependTo( parent.empty() ); + } + + anchor.attr( "href", "#" + id ); + + }).virtuallistview(); + + // on pagehide, remove any nested pages along with the parent page, as long as they aren't active + // and aren't embedded + if ( hasSubPages && + parentPage.is( ":jqmData(external-page='true')" ) && + parentPage.data( "page" ).options.domCache === false ) { + + newRemove = function ( e, ui ) { + var nextPage = ui.nextPage, npURL; + + if ( ui.nextPage ) { + npURL = nextPage.jqmData( "url" ); + if ( npURL.indexOf( parentUrl + "&" + $.mobile.subPageUrlKey ) !== 0 ) { + self.childPages().remove(); + parentPage.remove(); + } + } + }; + + // unbind the original page remove and replace with our specialized version + parentPage + .unbind( "pagehide.remove" ) + .bind( "pagehide.remove", newRemove ); + } + }, + + // TODO sort out a better way to track sub pages of the virtuallistview this is brittle + childPages: function () { + var parentUrl = this.parentPage.jqmData( "url" ); + + return $( ":jqmData(url^='" + parentUrl + "&" + $.mobile.subPageUrlKey + "')" ); + } + }); + + //auto self-init widgets + $( document ).bind( "pagecreate create", function ( e ) { + $( $.tizen.virtuallistview.prototype.options.initSelector, e.target ).virtuallistview(); + }); + +} ( jQuery ) ); diff --git a/tests/coverage/README b/tests/coverage/README new file mode 100644 index 0000000..36abe18 --- /dev/null +++ b/tests/coverage/README @@ -0,0 +1,14 @@ +Used to produce coverage reports from the automated tests +via jscoverage (http://siliconforks.com/jscoverage/). + +You'll need to install jscoverage first. +You'll also need Google Chrome. + +Then: + +$ cd tests/test-coverage +$ ./instrument.sh + +See the Summary tab for the coverage report. + +This is only tested on Linux. diff --git a/tests/coverage/instrument.sh b/tests/coverage/instrument.sh new file mode 100755 index 0000000..e716eca --- /dev/null +++ b/tests/coverage/instrument.sh @@ -0,0 +1,62 @@ +#!/bin/bash +# Run instrumented unit tests +# +# set CHROME_BIN to the path to/name of your Google Chrome binary +# (default = `which google-chrome`) +# set JS_COVERAGE_BIN to the path to/name of your jscoverage binary +# (default = `which jscoverage`) + +# where are we? +SCRIPT_PATH=`readlink -f $0` + +if [[ "x" == "x$SCRIPT_PATH" ]] ; then + DIR=`dirname $0` +else + DIR=`dirname $SCRIPT_PATH` +fi + +# programs we need to run +if [[ "x" == "x$CHROME_BIN" ]] ; then + CHROME_BIN=`which google-chrome || which chromium-browser` +fi + +if [[ "x$CHROME_BIN" == "x" ]] ; then + echo "*** ERROR: google-chrome not found - please make sure it's installed" + echo "Then either put it on your PATH or set the CHROME_BIN env variable" + exit 1 +fi + +if [[ "x" == "x$JSCOVERAGE_BIN" ]] ; then + JSCOVERAGE_BIN=`which jscoverage` +fi + +if [[ "x$JSCOVERAGE_BIN" == "x" ]] ; then + echo "*** ERROR: jscoverage not found - please make sure it's installed" + echo "Then either put it on your PATH or set the JSCOVERAGE_BIN env variable" + exit 1 +fi + +# directory for instrumented files +if [ -d $DIR/instrumented ] ; then + rm -Rf $DIR/instrumented +fi + +# just instrument the tizen-web-ui-fw file +$JSCOVERAGE_BIN --exclude tizen-web-ui-fw-libs.js --exclude jquery.js \ + $DIR/../../build/tizen-web-ui-fw/latest/js $DIR/instrumented + +# copy all the unit tests to the instrumented directory +cp -a $DIR/../unit-tests/* $DIR/instrumented/ + +# edit links in all index.html test files +for file in `find $DIR/instrumented/ -name index.html` ; do + # refer to the instrumented tizen-web-ui-fw JS file + sed -i -e 's%\.\.\/\.\.\/\.\.\/build\/tizen-web-ui-fw\/latest\/js\/tizen-web-ui-fw\.js%\.\.\/tizen-web-ui-fw\.js%' $file + + # other files are just one directory further up + sed -i -e 's%\.\.\/\.\.\/build%\.\.\/\.\.\/\.\.\/build%' $file + sed -i -e 's%\.\.\/\.\.\/\libs%\.\.\/\.\.\/\.\.\/libs%' $file +done + +# run the top-level test file through jscoverage +$CHROME_BIN --allow-file-access-from-files file://$DIR/instrumented/jscoverage.html?index.html diff --git a/tests/samples/change-page/configure.js b/tests/samples/change-page/configure.js new file mode 100755 index 0000000..6ab2afb --- /dev/null +++ b/tests/samples/change-page/configure.js @@ -0,0 +1,3 @@ +$( document ).bind( "mobileinit", function() { + $.support.scrollview = true; +}); diff --git a/tests/samples/change-page/index.html b/tests/samples/change-page/index.html new file mode 100755 index 0000000..3c57595 --- /dev/null +++ b/tests/samples/change-page/index.html @@ -0,0 +1,36 @@ + + + + + + + + + + + Change Page & Back + + + + + +
                              +
                              +

                              Second Page

                              +
                              + +
                              + + diff --git a/tests/samples/change-page/main.js b/tests/samples/change-page/main.js new file mode 100755 index 0000000..e0107aa --- /dev/null +++ b/tests/samples/change-page/main.js @@ -0,0 +1,11 @@ +$( document ).bind("pagecreate", function () { + $('#change').bind( "vclick", function () { + console.log( "move page.."); + $.mobile.changePage($("#secondPage"), {transition:"none"}); + }); + + $('#back').bind( "vclick", function () { + history.back(); + }); + +}); diff --git a/tests/samples/change-page/tizen-web-ui-fw b/tests/samples/change-page/tizen-web-ui-fw new file mode 120000 index 0000000..f51bed2 --- /dev/null +++ b/tests/samples/change-page/tizen-web-ui-fw @@ -0,0 +1 @@ +../../../build/tizen-web-ui-fw \ No newline at end of file diff --git a/tests/samples/rem-scaling/index.html b/tests/samples/rem-scaling/index.html new file mode 100755 index 0000000..8cf5ff6 --- /dev/null +++ b/tests/samples/rem-scaling/index.html @@ -0,0 +1,30 @@ + + + + + + + + + Tizen UI + + + + + + + + +
                              +
                              +

                              viewport-scale=false

                              +
                              +
                              +

                              content will be shown properly. -- not too small, not too big.

                              + Test button +
                              +
                              + + diff --git a/tests/samples/rem-scaling/tizen-web-ui-fw b/tests/samples/rem-scaling/tizen-web-ui-fw new file mode 120000 index 0000000..f51bed2 --- /dev/null +++ b/tests/samples/rem-scaling/tizen-web-ui-fw @@ -0,0 +1 @@ +../../../build/tizen-web-ui-fw \ No newline at end of file diff --git a/tests/samples/text-selection/index.html b/tests/samples/text-selection/index.html new file mode 100755 index 0000000..298f97b --- /dev/null +++ b/tests/samples/text-selection/index.html @@ -0,0 +1,38 @@ + + + + + + + + + + + Text Selection + + + +
                              +
                              +

                              User select

                              +
                              +
                              +

                              User can select text. User can select text. User can select text. User can select text. User can select text. User can select text. User can select text. User can select text. User can select text. User can select text. User can select text. User can select text. User can select text. User can select text. User can select text. User can select text. User can select text. User can select text.

                              + Go to 'no-select' page +
                              +
                              + +
                              +
                              +

                              User no-select

                              +
                              +
                              +

                              User cannot select text. User cannot select text. User cannot select text. User cannot select text. User cannot select text. User cannot select text. User cannot select text. User cannot select text. User cannot select text. User cannot select text. User cannot select text. User cannot select text. User cannot select text. User cannot select text. User cannot select text.

                              + Back +
                              +
                              + + + diff --git a/tests/samples/text-selection/main.js b/tests/samples/text-selection/main.js new file mode 100755 index 0000000..eb0a0cc --- /dev/null +++ b/tests/samples/text-selection/main.js @@ -0,0 +1,9 @@ +$( document ).bind("pagecreate", function () { + $('#back').bind( "vclick", function () { + history.back(); + }); +}); + +$( "#no-user-select" ).live( "pageshow", function () { + $.mobile.tizen.disableSelection( this ); +}); diff --git a/tests/samples/text-selection/tizen-web-ui-fw b/tests/samples/text-selection/tizen-web-ui-fw new file mode 120000 index 0000000..f51bed2 --- /dev/null +++ b/tests/samples/text-selection/tizen-web-ui-fw @@ -0,0 +1 @@ +../../../build/tizen-web-ui-fw \ No newline at end of file diff --git a/tests/unit-tests/autodividers/autodividers-tests.js b/tests/unit-tests/autodividers/autodividers-tests.js new file mode 100644 index 0000000..4fa15ec --- /dev/null +++ b/tests/unit-tests/autodividers/autodividers-tests.js @@ -0,0 +1,178 @@ +/* + * autodividers unit tests + */ + +(function ($) { + $.mobile.defaultTransition = "none"; + + module( "Autodividers" ); + + asyncTest( "Adds dividers based on first letters of list items.", function() { + $.testHelper.pageSequence([ + function() { + $.testHelper.openPage( '#autodividers-test' ); + }, + + function() { + var $new_page = $( '#autodividers-test' ); + + //ok( $new_page.hasClass( 'ui-page-active' ) ); + ok( $new_page.find( '.ui-li-divider' ).length === 4 ); + + start(); + } + ]); + }); + + asyncTest( "Responds to addition/removal of list elements.", function() { + $.testHelper.pageSequence([ + function() { + $.testHelper.openPage( '#autodividers-test' ); + }, + + function() { + var $new_page = $( '#autodividers-test' ); + //ok($new_page.hasClass( 'ui-page-active' )); + + var $listview = $new_page.find( 'ul' ); + + // should remove all existing dividers + ok( $new_page.find( 'li:contains("SHOULD REMOVE")' ).length === 0 ); + + // add li; should add an "X" divider + $listview.append( '
                            • x is for xanthe
                            • ' ); + ok( $new_page.find( '.ui-li-divider' ).length === 5 ); + ok( $new_page.find( '.ui-li-divider' ).is( ':contains("X")' ) ); + + // adding the same element again should create a valid list + // item but no new divider + ok( $new_page.find( '.ui-li-static' ).length === 5 ); + $listview.append( '
                            • x is for xanthe
                            • ' ); + ok( $new_page.find( '.ui-li-divider' ).length === 5 ); + ok( $new_page.find( '.ui-li-divider:contains("X")' ).length === 1 ); + ok( $new_page.find( '.ui-li-static' ).length === 6 ); + + // should ignore addition of non-li elements to the list + $listview.find( 'li:eq(0)' ).append( 'ignore me' ); + ok( $new_page.find( '.ui-li-divider' ).length === 5 ); + ok( $new_page.find( '.ui-li-static' ).length === 6 ); + + // add li with the same initial letter as another li + // but after the X li item; should add a second "B" divider to the + // end of the list + $listview.append( '
                            • b is for barry
                            • ' ); + ok( $new_page.find( '.ui-li-divider' ).length === 6 ); + ok( $new_page.find( '.ui-li-divider:contains("B")' ).length === 2 ); + + // remove the item with a repeated "b"; should remove the second + // "B" divider + $listview.find( 'li:contains("barry")' ).remove(); + ok( $new_page.find( '.ui-li-divider' ).length === 5 ); + ok( $new_page.find( '.ui-li-divider:contains("B")' ).length === 1 ); + + // remove li; should remove the "A" divider + $listview.find( 'li:contains("aquaman")' ).remove(); + ok( $new_page.find( '.ui-li-divider' ).length === 4 ); + ok( !$new_page.find( '.ui-li-divider' ).is( ':contains("A")' ) ); + + // adding another "B" item after "C" should create two separate + // "B" dividers + $listview.find( 'li:contains("catwoman")' ).after( '
                            • b is for barry
                            • ' ); + ok( $new_page.find( '.ui-li-divider' ).length === 5 ); + ok( $new_page.find( '.ui-li-divider:contains("B")' ).length === 2 ); + + // if two dividers with the same letter have only non-dividers + // between them, they get merged + + // removing catwoman should cause the two "B" dividers to merge + $listview.find( 'li:contains("catwoman")' ).remove(); + ok( $new_page.find( '.ui-li-divider:contains("B")' ).length === 1 ); + + // adding another "D" item before the "D" divider should only + // result in a single "D" divider after merging + $listview.find( 'li:contains("barry")' ).after( '
                            • d is for dan
                            • ' ); + ok( $new_page.find( '.ui-li-divider:contains("D")' ).length === 1 ); + + start(); + } + ]); + }); + + module( "Autodividers Selector" ); + + asyncTest( "Adds divider text from links.", function() { + $.testHelper.pageSequence([ + function() { + $.testHelper.openPage( '#autodividers-selector-test' ); + }, + + function() { + var $new_page = $( '#autodividers-selector-test' ); + //ok($new_page.hasClass( 'ui-page-active' )); + + // check we have the right dividers based on link text + var $list = $( '#autodividers-selector-test-list1' ); + ok( $list.find( '.ui-li-divider' ).length === 4 ); + ok( $list.find( '.ui-li-divider:eq(0):contains(A)' ).length === 1 ); + ok( $list.find( '.ui-li-divider:eq(1):contains(B)' ).length === 1 ); + ok( $list.find( '.ui-li-divider:eq(2):contains(C)' ).length === 1 ); + ok( $list.find( '.ui-li-divider:eq(3):contains(D)' ).length === 1 ); + + // check that adding a new item with link creates the right divider + $list.append( '
                            • e is for ethel
                            • ' ); + ok( $list.find( '.ui-li-divider:eq(4):contains(E)' ).length === 1 ); + + start(); + } + ]); + }); + + asyncTest( "Adds divider text based on custom selector.", function() { + $.testHelper.pageSequence([ + function() { + $.testHelper.openPage( '#autodividers-selector-test' ); + }, + + function() { + var $new_page = $( '#autodividers-selector-test' ); + //ok($new_page.hasClass( 'ui-page-active' )); + + // check we have the right dividers based on custom selector + var $list = $( '#autodividers-selector-test-list2' ); + ok( $list.find( '.ui-li-divider' ).length === 4 ); + ok( $list.find( '.ui-li-divider:eq(0):contains(E)' ).length === 1 ); + ok( $list.find( '.ui-li-divider:eq(1):contains(F)' ).length === 1 ); + ok( $list.find( '.ui-li-divider:eq(2):contains(G)' ).length === 1 ); + ok( $list.find( '.ui-li-divider:eq(3):contains(H)' ).length === 1 ); + + // check that adding a new item creates the right divider + $list.append( '
                            • ' + + 'i is for impy
                            • ' ); + + ok( $list.find( '.ui-li-divider:eq(4):contains(I)' ).length === 1 ); + + start(); + } + ]); + }); + + asyncTest( "Adds divider text based on full text selected by custom selector.", function() { + $.testHelper.pageSequence([ + function() { + $.testHelper.openPage( '#autodividers-selector-test' ); + }, + + function() { + var $new_page = $( '#autodividers-selector-test' ); + //ok($new_page.hasClass( 'ui-page-active' )); + + var $list = $( '#autodividers-selector-test-list3' ); + ok( $list.find( '.ui-li-divider' ).length === 2 ); + ok( $list.find( '.ui-li-divider:eq(0):contains(eddie)' ).length === 1 ); + ok( $list.find( '.ui-li-divider:eq(1):contains(frankie)' ).length === 1 ); + + start(); + } + ]); + }); +})(jQuery); diff --git a/tests/unit-tests/autodividers/index.html b/tests/unit-tests/autodividers/index.html new file mode 100644 index 0000000..f0ee1e0 --- /dev/null +++ b/tests/unit-tests/autodividers/index.html @@ -0,0 +1,72 @@ + + + + + + jQuery Mobile Autodividers Tests + + + + + + + + + + + + + + + +

                              jQuery Mobile Autodividers Tests

                              +

                              +

                              +
                                +
                              + +
                              +
                              +

                              Autodivider Test

                              +
                              +
                              +
                                +
                              • SHOULD REMOVE
                              • +
                              • a is for aquaman
                              • +
                              • b is for batman
                              • +
                              • c is for catwoman
                              • +
                              • d is for darkwing
                              • +
                              +
                              +
                              + +
                              +
                              +

                              Autodivider Selector Test

                              +
                              +
                              + + +
                                +
                              • eddie is for aquaman
                              • +
                              • frankie is for batman
                              • +
                              • georgie is for catwoman
                              • +
                              • henry is for darkwing
                              • +
                              + +
                                +
                              • eddie is smart
                              • +
                              • eddie is tough
                              • +
                              • frankie is scruffy
                              • +
                              • frankie is week
                              • +
                              +
                              +
                              + + + diff --git a/tests/unit-tests/button/button-tests.js b/tests/unit-tests/button/button-tests.js new file mode 100644 index 0000000..d2ec533 --- /dev/null +++ b/tests/unit-tests/button/button-tests.js @@ -0,0 +1,101 @@ +/* + * Unit Test: Button + * + * Hyunjung Kim + * + */ +$( "#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, 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( 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" ); + + + }; + + 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" ); + }); + +}); diff --git a/tests/unit-tests/button/index.html b/tests/unit-tests/button/index.html new file mode 100644 index 0000000..ecfe784 --- /dev/null +++ b/tests/unit-tests/button/index.html @@ -0,0 +1,42 @@ + + + + + + + + + + + + + Button + + + + +

                              Button

                              +

                              +
                              +

                              +
                                + +
                                +
                                +
                                +
                                Text Button
                                +
                                Text Button Inline
                                +
                                Call Icon
                                +
                                Icon Text
                                +
                                +
                                +
                                +
                                +
                                +
                                + + + diff --git a/tests/unit-tests/check/check-tests.js b/tests/unit-tests/check/check-tests.js new file mode 100644 index 0000000..190fec8 --- /dev/null +++ b/tests/unit-tests/check/check-tests.js @@ -0,0 +1,72 @@ +/* + * Unit Test: Checkbox + * + * Hyunjung Kim + */ + +$( "#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" ); + } + }; + + 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" ); + }); + +}); diff --git a/tests/unit-tests/check/index.html b/tests/unit-tests/check/index.html new file mode 100644 index 0000000..00b34fc --- /dev/null +++ b/tests/unit-tests/check/index.html @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + Check + + + + +

                                Check

                                +

                                +
                                +

                                +
                                  + +
                                  +
                                  +
                                  +

                                  Checkbox

                                  +
                                  +
                                  +
                                  + + + + + + + + + + + + + +
                                  +
                                  +
                                  +
                                  + + + diff --git a/tests/unit-tests/collapsible/collapsible-tests.js b/tests/unit-tests/collapsible/collapsible-tests.js new file mode 100755 index 0000000..8b98f1c --- /dev/null +++ b/tests/unit-tests/collapsible/collapsible-tests.js @@ -0,0 +1,33 @@ +/* + * collapse unit tests + */ + +(function ($) { + module( "collapse test" ); + + var unit_collapse = function ( widget ) { + var created_collapse = widget.collapsible(), + obj_collapse = created_collapse.data( "collapsible" ); + + ok( created_collapse, "Create" ); + + /* 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", "Collapsed test -> heading" ); + equal( obj_collapse.options.theme, null, "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/unit-tests/collapsible/index.html b/tests/unit-tests/collapsible/index.html new file mode 100755 index 0000000..3f01020 --- /dev/null +++ b/tests/unit-tests/collapsible/index.html @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + +

                                  jQuery Mobile Collapsible Tests

                                  +

                                  +

                                  +
                                    +
                                  + +
                                  +
                                  +

                                  Collapsible test

                                  +
                                  +
                                  +
                                  +

                                  I'm a header

                                  + test +

                                  Some content would be here

                                  +
                                  +
                                  +
                                  + + diff --git a/tests/unit-tests/color/color-tests.js b/tests/unit-tests/color/color-tests.js new file mode 100644 index 0000000..3a8fb13 --- /dev/null +++ b/tests/unit-tests/color/color-tests.js @@ -0,0 +1,257 @@ +/* + * Unit Test: Color Picker + * + * Hyunjung Kim + * + */ +$( "#colorpage" ).live( "pageinit", function(event){ + + module("Color Picker"); + + var cutHex = function( h ){ return ( h.charAt(0)=="#" ) ? h.substring(1,7):h} + var hexToRgb = function( h ) { + var r = parseInt((cutHex(h)).substring( 0, 2 ),16), g = parseInt((cutHex(h)).substring( 2, 4),16), b = parseInt((cutHex(h)).substring( 4, 6), 16); + return "rgb("+r+", "+g+", "+b+")"; + } + var makeRandomColor = function(){ + var letters = '0123456789ABCDEF'.split(''); + var color = '#'; + for (var i = 0; i < 6; i++ ) { + color += letters[Math.round(Math.random() * 15)]; + } + return color.toLowerCase(); + } + var colorchange = function( widget, colorcode ){ + if( widget.attr("data-color") == colorcode) return true; + else return false; + } + var testHsvpicker = function( widget ) { + var wgSiblings, + hsvpicker, + chan, + hsvIdx, + max, + step, + colorcode; + + widget = $("#hsvpicker"); + widget.hsvpicker(); + wgSiblings = widget.siblings(); + hsvpicker = wgSiblings.last(); + + ok( widget.is(":hidden") && + hsvpicker.hasClass("ui-hsvpicker") && + hsvpicker.children().length == 3 + , "Create - Hue-Saturation-Value"); + + ok( function ( ) { + var i, + varArray, + leftbutton, + rightbutton, + view, + width, + nowvar, + indicator, + result = true, + hue, + sat, + val, + dragging_hsv = [0,0,0]; + + for( i = 0 ; i < hsvpicker.children().length; i++ ){ + varArray = hsvpicker.children(); + nowvar = varArray.eq(i); + leftbutton = nowvar.children().eq(0); + view = nowvar.children().eq(1); + rightbutton = nowvar.children().eq(2); + indicator = nowvar.children().eq(1).children().eq(3); + + while(true) { + chan = leftbutton.find("a").attr( "data-" + ( $.mobile.ns || "" ) + "target" ); + leftbutton.find("a").trigger( "vclick" ); + if( parseInt( indicator.css("left") ) <= 0 ){ + break; + } + } + + hsvIdx = ( "hue" === chan ) ? 0 : + ( "sat" === chan) ? 1 : 2; + dragging_hsv = [ 0, 0, 0]; + + while(true) { + rightbutton.children().first().trigger( "vclick" ); + width = view.first().width(); + max = ( 0 == hsvIdx ? 360 : 1 ); + step = 0.05 * max; + dragging_hsv[hsvIdx] = dragging_hsv[hsvIdx] + step; + dragging_hsv[hsvIdx] = Math.min( max, Math.max( 0.0, dragging_hsv[hsvIdx] ) ); + hue = varArray.eq(0).children().eq(1).children(); + val = varArray.eq(1).children().eq(1).children(); + sat = varArray.eq(2).children().eq(1).children(); + switch(hsvIdx){ + case 0: + if( indicator.css("background-color") != val.last().css("background-color") || + indicator.css("background-color") != sat.last().css("background-color")) + result = false; + break; + case 1: + if( parseFloat( dragging_hsv[1] ).toFixed(2) != parseFloat(hue.eq(1).css("opacity")).toFixed(2) || + indicator.css("background-color") != sat.last().css("background-color")) + result = false; + break; + case 2: + if(parseFloat( 1 - dragging_hsv[2] ).toFixed(2) , parseFloat(hue.eq(2).css("opacity")).toFixed(2) || + parseFloat( 1 - dragging_hsv[2] ).toFixed(2) , parseFloat(val.eq(2).css("opacity")).toFixed(2)) + result = false; + break; + } + if( parseInt( indicator.css("left") ) >= parseInt( width ) || !result){ + break; + } + } + } + return result; + }," Click - Color match, Hue-Saturation-Value " ); + + colorcode = makeRandomColor(); + widget.hsvpicker( { color : colorcode }); + + ok( colorchange(widget, colorcode), + "Option : Color change") + } + + test( "Color Title" , function ( ) { + var wgSiblings, + colorHex, + widget, + colorcode; + + widget = $("#colortitle"); + + wgSiblings = widget.siblings(); + ok( widget.is(":hidden") && + wgSiblings.length == 2 && + wgSiblings.last().is(".ui-colortitle, .jquery-mobile-ui-widget"), + "Create - Color Title" ); + + colorHex = widget.jqmData("color"); + equal( wgSiblings.last().css("color"), hexToRgb(colorHex), "Compare - Color" ); + equal( wgSiblings.last().text().trim(), colorHex, "Compare - Text" ); + + colorcode = makeRandomColor(); + widget.colortitle({ color : colorcode }); + + ok( colorchange( widget, colorcode ), + "Option : Color change"); + }); + + test( "Color palette" , function () { + var widget, + palette, + palettePreview, + wgSiblings, + colorChoice, + i, + colorcode, + palettePrefix = ".colorpalette"; + + widget = $("#colorpalette"); + + wgSiblings = widget.siblings(); + palette = wgSiblings.last(); + ok( widget.is(":hidden") && + wgSiblings.length == 2 && + palette.is(".ui-colorpalette, .jquery-mobile-ui-widget"), + "Create - Color palette" ); + + if( palette.find( palettePrefix + "-preview-container").length ){ + palettePreview = palette.find( palettePrefix +"-preview-container"); + } + colorChoice = palette.find( palettePrefix + "-table").children().find( "div[class^='colorpalette-choice-container-']" ); + equal( colorChoice.length , + palette.jqmData("n-choices") , "Count - Color choice container" ); + + ok( function(){ + var i = 0, + result = true; + for(i = 0 ; i < colorChoice.length; i++ ){ + $(colorChoice[i]).children().trigger("vclick"); + if( palettePreview.children().css("background-color") == $(colorChoice[i]).children().css("background-color") ){ + result = false; + break; + } + } + return result; + }, "Click - Palette Active check" ); + + colorcode = makeRandomColor(); + widget.colorpalette({ color: colorcode }); + + ok( colorchange( widget, colorcode ), + "Option : Color change"); + }); + + test( "Color picker button-noform" , function () { + var widget, + wgSiblings, + colorpickerbutton, + colorcode, + popwindow, + hsvpicker; + + widget = $("#colorpickerbutton-noform"); + widget.colorpickerbutton(); + wgSiblings = widget.siblings(); + colorpickerbutton = wgSiblings.last(); + + ok( widget.is(":hidden") && + wgSiblings.last().jqmData("role") == "button" && + wgSiblings.last().attr("aria-haspopup") == "true", + "Create - Color picker" ); + + widget.colorpickerbutton("open"); + popwindow = $("#colorpage").children().last(); + + ok( parseInt( popwindow.css("top") ) > 0, "Open - Popupwindow"); + hsvpicker = popwindow.children().children().first(); + testHsvpicker(hsvpicker); + + widget.colorpickerbutton("close"); + equal( hexToRgb( hsvpicker.jqmData("color") ), + colorpickerbutton.children().children().children().css("color") ); + + colorcode = makeRandomColor(); + widget.colorpicker({ color: colorcode }); + + ok( colorchange( widget, colorcode ), + "Option : Color change"); + }); + + test( "Hue-Saturation-Value" , function () { + testHsvpicker( "#hsvpicker" ); + }); + + test( "Hue-Saturation-Lightnewss" , function() { + var widget, + wgSiblings, + colorpicker, + colorcode; + + widget = $("#colorpicker"); + widget.colorpicker(); + wgSiblings = widget.siblings(); + colorpicker = wgSiblings.last(); + + ok( widget.is(":hidden") && + colorpicker.hasClass("ui-colorpicker") && + colorpicker.children().length == 3 + , "Create - Hue-Saturation-Lightness"); + + colorcode = makeRandomColor(); + widget.colorpicker({ color: colorcode }); + + ok( colorchange( widget, colorcode ), + "Option : Color change"); + }); +}); \ No newline at end of file diff --git a/tests/unit-tests/color/index.html b/tests/unit-tests/color/index.html new file mode 100644 index 0000000..5c719f3 --- /dev/null +++ b/tests/unit-tests/color/index.html @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + Color Picker + + + + +

                                  Color

                                  +

                                  +
                                  +

                                  +
                                    +
                                    +
                                    +
                                    +
                                    Color title widget
                                    +
                                    +
                                    +
                                    +
                                    Color palette widget
                                    +
                                    +
                                    +
                                    +
                                    Color picker button
                                    +
                                    +
                                    +
                                    +
                                    Hue-Saturation-Value picker widget
                                    +
                                    +
                                    +
                                    +
                                    Hue-Saturation-Lightness picker widget
                                    +
                                    +
                                    +
                                    +
                                    + + + + diff --git a/tests/unit-tests/controlbar/controlbar-tests.js b/tests/unit-tests/controlbar/controlbar-tests.js new file mode 100755 index 0000000..c1107bd --- /dev/null +++ b/tests/unit-tests/controlbar/controlbar-tests.js @@ -0,0 +1,68 @@ +/* + * controlbar unit tests + */ + +(function ($) { + $.mobile.defaultTransition = "none"; + + module( "Controlbar" ); + + var unit_controlbar = function ( widget, type, drayStyle ) { + var controlbar, + controlbar_style, + item_count, + activeIndex, + deactiveReturn, + activeReturn, + created_controlbar = widget.controlbar(); + + /* Create */ + ok( created_controlbar, "Create" ); + + /* Check Parameters */ + equal( type, created_controlbar.jqmData("style"), "Parameter: data-style" ); + + if ( drayStyle ) { + if ( drayStyle == "icon" ) { + equal( created_controlbar.find( "a" ).is(".ui-btn-icon_only" ), true, "Icon only style test"); + } else if ( drayStyle == "text" ) { + equal( created_controlbar.is(".ui-navbar-noicons" ), true, "Text only style test"); + } + } + + /* Check APIs */ + activeIndex = created_controlbar.find(".ui-btn-active").index(); + created_controlbar.controlbar( "disable", activeIndex ); + deactiveReturn = created_controlbar.find("li:eq(" + activeIndex + ")").is(".ui-disabled"); + + equal( deactiveReturn, true, "List Deactive test" ); + + created_controlbar.controlbar("enable", activeIndex); + activeReturn = created_controlbar.find("li:eq(" + activeIndex + ")").is(".ui-disabled"); + equal( activeReturn, false, "List Active test" ); + }; + + test( "controlbar normal style test -> tabbar", function () { + unit_controlbar( $("#controlbar-tabbar-test"), "tabbar" ); + }); + + test( "controlbar icon style test -> tabbar", function () { + unit_controlbar( $("#controlbar-tabbar-test-icon-only"), "tabbar", "icon" ); + }); + + test( "controlbar text style test -> tabbar", function () { + unit_controlbar( $("#controlbar-tabbar-test-text-only"), "tabbar", "text" ); + }); + + test( "controlbar normal style test -> toolbar", function () { + unit_controlbar( $("#controlbar-toolbar-test"), "toolbar" ); + }); + + test( "controlbar icon style test -> toolbar", function () { + unit_controlbar( $("#controlbar-toolbar-test-icon-only"), "toolbar", "icon" ); + }); + + test( "controlbar text style test -> tabbar", function () { + unit_controlbar( $("#controlbar-toolbar-test-text-only"), "toolbar", "text" ); + }); +})(jQuery); diff --git a/tests/unit-tests/controlbar/index.html b/tests/unit-tests/controlbar/index.html new file mode 100755 index 0000000..8e27080 --- /dev/null +++ b/tests/unit-tests/controlbar/index.html @@ -0,0 +1,140 @@ + + + + + + + + + + + + + + + +

                                    jQuery Mobile Controlbar Tests

                                    +

                                    +

                                    +
                                      +
                                    + + +
                                    +
                                    +

                                    Controlbar Test - markup

                                    +
                                    +
                                    +
                                    +
                                    +
                                    + +
                                    +
                                    +
                                    + +
                                    +
                                    +

                                    Controlbar Test - markup

                                    +
                                    +
                                    +
                                    +
                                    +
                                    +
                                      +
                                    • +
                                    • +
                                    • +
                                    • +
                                    • +
                                    +
                                    +
                                    +
                                    + +
                                    +
                                    +

                                    Controlbar Test - markup

                                    +
                                    +
                                    +
                                    +
                                    +
                                    + +
                                    +
                                    +
                                    + +
                                    +
                                    +

                                    Controlbar Test - markup

                                    +
                                    +
                                    +
                                    +
                                    +
                                    + +
                                    +
                                    +
                                    + +
                                    +
                                    +

                                    Controlbar Test - markup

                                    +
                                    +
                                    +
                                    +
                                    +
                                    +
                                      +
                                    • +
                                    • +
                                    • +
                                    • +
                                    • +
                                    +
                                    +
                                    +
                                    + +
                                    +
                                    +

                                    Controlbar Test - markup

                                    +
                                    +
                                    +
                                    +
                                    +
                                    + +
                                    +
                                    +
                                    + + diff --git a/tests/unit-tests/datetimepicker/datetimepicker-tests.js b/tests/unit-tests/datetimepicker/datetimepicker-tests.js new file mode 100644 index 0000000..c35e064 --- /dev/null +++ b/tests/unit-tests/datetimepicker/datetimepicker-tests.js @@ -0,0 +1,147 @@ +$(document).ready( function () { + + module( "Date Time Picker"); + + var datetime = $("#datetime")[0]; + var date = $("#date")[0]; + var time = $("#time")[0]; + var custom = $("#custom")[0]; + + // trigger pagecreate + $( "#page-1" ).page(); + + var objDatetime = $(datetime).data( "datetimepicker" ); + var objDate = $(date).data( "datetimepicker" ); + var objTime = $(time).data( "datetimepicker" ); + var objCustom = $(custom).data( "datetimepicker" ); + + 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 () { + 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" ); + + var updateFieldTest = function ( format, value, expect ) { + var target = $('
                                    '); + objTime._updateField( target, value ); + return target.text(); + }; + + deepEqual( [ + updateFieldTest( "h", 0 ), + updateFieldTest( "hh", 1 ), + updateFieldTest( "H", 13 ), + updateFieldTest( "HH", 9 ), + updateFieldTest( "m", 9 ), + updateFieldTest( "mm", 9 ), + updateFieldTest( "MMM", 3 ), + updateFieldTest( "MMMM", 3 ), + updateFieldTest( "yy", 1995 ), + updateFieldTest( "yyyy", 1995 ) + ], + [ + "12", "01", "13", "09", "9", "09", Globalize.culture().calendar.months.namesAbbr[2], Globalize.culture().calendar.months.names[2], "95", "1995" + ], "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" ); + + var months = Globalize.culture().calendar.months.namesAbbr.slice(); + if ( months.length > 12 ) { + months.length = 12; + } + + deepEqual( [ + { // 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( "hour", "hh", objDatetime ), + objDatetime._populateDataSelector( "hour", "H", objDatetime ), + objDatetime._populateDataSelector( "month", "MMM", objDatetime ) + ], "should populate data selector by given field and pattern" ); + + 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( date, "2012-05-02T18:00:00", "Should invoke event when date changed" ); + start(); + }); + + objDatetime.value( str ); + }); + + +}); diff --git a/tests/unit-tests/datetimepicker/index.html b/tests/unit-tests/datetimepicker/index.html new file mode 100644 index 0000000..41f75ff --- /dev/null +++ b/tests/unit-tests/datetimepicker/index.html @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + Date Time Picker + + + + +

                                    Date Time Picker

                                    +

                                    +
                                    +

                                    +
                                      + +
                                      +
                                      +
                                      +

                                      Dummy

                                      +
                                      +
                                      +
                                      +
                                      +
                                      +
                                      +

                                      Date Time Picker

                                      +
                                      +
                                      +
                                        +
                                      • + + + + DateTimePicker +
                                      • +
                                      • + + + + DatePicker +
                                      • +
                                      • + + + + TimePicker +
                                      • +
                                      • + + + + DateTimePicker +
                                      • +
                                      +
                                      +
                                      + +
                                      + + + + diff --git a/tests/unit-tests/dayselector/dayselector-tests.js b/tests/unit-tests/dayselector/dayselector-tests.js new file mode 100644 index 0000000..853bf13 --- /dev/null +++ b/tests/unit-tests/dayselector/dayselector-tests.js @@ -0,0 +1,158 @@ +/* + * Unit Test: Dayselector + * modified by : Koeun Choi + */ + +(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/unit-tests/dayselector/index.html b/tests/unit-tests/dayselector/index.html new file mode 100644 index 0000000..29059de --- /dev/null +++ b/tests/unit-tests/dayselector/index.html @@ -0,0 +1,48 @@ + + + + jQuery Mobile Day Selector Tests + + + + + + + + + + + + + +

                                      jQuery Mobile Day Selector Tests

                                      +

                                      +

                                      +
                                        +
                                      + +
                                      +
                                      +

                                      Day Selector Tests - configuration

                                      +
                                      +
                                      +
                                      +
                                      +
                                      +
                                      +
                                      + +
                                      +
                                      +

                                      Day Selector Tests - selection

                                      +
                                      +
                                      +
                                      +
                                      +
                                      + + + diff --git a/tests/unit-tests/expandablelist/expandablelist-tests.js b/tests/unit-tests/expandablelist/expandablelist-tests.js new file mode 100644 index 0000000..fdb3381 --- /dev/null +++ b/tests/unit-tests/expandablelist/expandablelist-tests.js @@ -0,0 +1,106 @@ +/** + * Expandablelist test + * + * Youmin Ha + */ +( function ( $ ) { + var DEBUG = true; + + $.mobile.defaultTransition = "none"; + + module( "ExpandableList", { + setup: function ( ) { + var page = $( 'div#expandablelist-main:jqmData(role="page")' ), + initHtml = '
                                      \ +
                                      \ +

                                      expandable list

                                      \ +
                                      \ +
                                      \ +
                                        \ +
                                      • exp1
                                      • \ +
                                      • exp1-1
                                      • \ +
                                      • exp1-1-1
                                      • \ +
                                      • exp2
                                      • \ +
                                      \ +
                                      \ +
                                      ', + obj; + + if( DEBUG ) { + page.show( ); + } + page.append( $( initHtml ) ); + + obj = $( ':jqmData(role="listview")' ); + obj.listview( ); + + obj = $( ':jqmData(expandable="true")' ); + obj.expandablelist( ); + }, + teardown: function ( ) { + var page = $( 'div#expandablelist-main:jqmData(role="page")' ); + page.empty( ); + + if( DEBUG ) { + page.hide( ); + } + } + } ); + + function expandCollapseTest ( ) { + var transitionTimeout = 1000, + elist = $( ":jqmData(expandable='true')" ), + li1, + li1_1, + li1_1_1, + val; + + elist.expandablelist( ); + ok( elist, "expandablelist object creation" ); + + li1 = $( "li#exp1" ); + li1_1 = $( "li#exp1-1" ); + li1_1_1 = $( "li#exp1-1-1" ); + + val = li1_1.height( ); + console.log( "li1_1's height=" + val ); + notEqual( val, 0, "Expanded listitem with expandable parent having data-initial-expansion=true must be visible (height > 0)" ); + + equal( li1_1_1.height(), 0, "Expanded listitem with expandable parent having data-initial-expansion=false must not be visible (height == 0)" ); + + li1_1.trigger( 'vclick' ); + setTimeout( function ( ) { + notEqual( li1_1_1.height( ), 0, "After click, expanded listitem must be visible (height > 0)" ); + + li1.trigger( 'vclick' ); + setTimeout( function ( ) { + // All children must be collapsed when top-level expandable listitem is clicked. + equal( li1_1.height(), 0, "After click, all children must be collapsed. (height == 0)" ); + equal( li1_1_1.height(), 0, "After click, all children must be collapsed. (height == 0)" ); + + start( ); + }, transitionTimeout ); + + }, transitionTimeout ); + } + + asyncTest( "Basic expand-collapse test", 6, function ( ) { + expandCollapseTest( ); + } ); + + asyncTest( "style test - checkbox" , 6, function ( ) { + var li = $( "li#exp1-1" ), + subitem = $( '' ); + + // Prepare + li.append( subitem ); + li.addClass( 'ui-li-1line-check1' ) + .addClass( 'ui-li-dialogue' ); + subitem.checkboxradio( ); + li.trigger( 'refresh' ); + + // Run + expandCollapseTest( ); + } ); + +} ) ( jQuery ); diff --git a/tests/unit-tests/expandablelist/index.html b/tests/unit-tests/expandablelist/index.html new file mode 100644 index 0000000..b02d616 --- /dev/null +++ b/tests/unit-tests/expandablelist/index.html @@ -0,0 +1,30 @@ + + + + + + Expandable list test + + + + + + + + + + + + +
                                      +

                                      Test : Expandable list

                                      +

                                      +

                                      +
                                        +
                                        +
                                        +
                                        + + + diff --git a/tests/unit-tests/extendablelist/extendablelist-tests.js b/tests/unit-tests/extendablelist/extendablelist-tests.js new file mode 100755 index 0000000..17b18f6 --- /dev/null +++ b/tests/unit-tests/extendablelist/extendablelist-tests.js @@ -0,0 +1,117 @@ +/* + * Unit Test: Extendable list + * + * Wongi Lee + */ + +$( document ).ready( function () { + + module( "Extendable List"); + + function startExtendableListTest(){ + var $elContainer = $( "ul#extendable_list_main" ), + $elElements = $( "ul#extendable_list_main li" ), + elOptions = $( "ul#extendable_list_main" ).extendablelist( "option" ); + console.dir( elOptions ); + + test( "Extendable list test", function () { + /* Initialize and create method */ + ok( $elContainer ); + equal( $elElements.length, 51 ); /* 50
                                      1. items + one button. */ + + /* Options */ + equal( elOptions.id, "#extendable_list_main" ); + equal( elOptions.childSelector, " li" ); + equal( elOptions.dbtable, "JSON_DATA" ); + equal( elOptions.template, "tmp-1line" ); + equal( elOptions.extenditems, 50 ); + equal( elOptions.scrollview, true ); + + /* Click Load more button */ + ok ( ( function () { + /* Click Button */ + $( "#load_more_message" ).click(); + + $elElements = $( "ul#extendable_list_main li" ); + console.log( $elElements.length ); + + try { + equal ( $elElements.length, 101 ); + } catch ( exception ) { + console.log( "click load more button : " + exception ); + return false; + } + return true; + }() ), "Click Load More button()" ); + + ok ( ( function () { + var i = 0, + newJSON = new Array(), + 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
                                      2. 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" ); + + startExtendableListTest(); + } else { + console.log ( "Extendable List Init Fail." ); + } +} ); diff --git a/tests/unit-tests/extendablelist/index.html b/tests/unit-tests/extendablelist/index.html new file mode 100755 index 0000000..d5fde3f --- /dev/null +++ b/tests/unit-tests/extendablelist/index.html @@ -0,0 +1,51 @@ + + + + + + + + + + + Extendable + + + +

                                        Extendablelist

                                        +

                                        +
                                        +

                                        +
                                          + +
                                          +
                                          +
                                          +

                                          Dummy

                                          +
                                          +
                                          +
                                          +
                                          +
                                          + + +
                                          +

                                          extendable list

                                          +
                                          +
                                          +
                                            +
                                          +
                                          +
                                          +
                                          + + diff --git a/tests/unit-tests/handler/handler-tests.js b/tests/unit-tests/handler/handler-tests.js new file mode 100755 index 0000000..b4d45c8 --- /dev/null +++ b/tests/unit-tests/handler/handler-tests.js @@ -0,0 +1,29 @@ +/* + * Unit Test: Handler + * + * Wonseop Kim + */ + +(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 () { + unit_handler( $("#handlerY") ); + }); +}( jQuery )); diff --git a/tests/unit-tests/handler/index.html b/tests/unit-tests/handler/index.html new file mode 100755 index 0000000..e7d9da0 --- /dev/null +++ b/tests/unit-tests/handler/index.html @@ -0,0 +1,65 @@ + + + + + + + + + + + + + Handler + + + + +

                                          Handler

                                          +

                                          +
                                          +

                                          +
                                            + + + + + diff --git a/tests/unit-tests/imageslider/imageslider-tests.js b/tests/unit-tests/imageslider/imageslider-tests.js new file mode 100644 index 0000000..ffd5c9f --- /dev/null +++ b/tests/unit-tests/imageslider/imageslider-tests.js @@ -0,0 +1,41 @@ +/* + * Unit Test: Imageslider + * + * Minkyu Kang + */ + +(function ($) { + module("Imageslider"); + + var unit_imageslider = function ( widget, count ) { + var imagesldier, + refresh = function ( widget ) { + widget.imageslider("refresh"); + return widget.find(".ui-imageslider-bg"); + }; + + /* Create */ + widget.imageslider(); + + imageslider = widget.find(".ui-imageslider-bg"); + ok( imageslider, "Create" ); + + /* Initialize */ + equal( imageslider.length, count, "Initialize" ); + + /* API: add */ + widget.imageslider("add", "05.jpg"); + widget.imageslider("add", "06.jpg"); + imageslider = refresh( widget ); + equal( imageslider.length, count + 2, "API: add" ); + + /* API: del */ + widget.imageslider("del"); + imageslider = refresh( widget ); + equal( imageslider.length, count + 1, "API: del" ); + }; + + test( "imageslider", function () { + unit_imageslider( $("#imageslider"), 4 ); + }); +}( jQuery )); diff --git a/tests/unit-tests/imageslider/index.html b/tests/unit-tests/imageslider/index.html new file mode 100755 index 0000000..f675401 --- /dev/null +++ b/tests/unit-tests/imageslider/index.html @@ -0,0 +1,46 @@ + + + + + + + + + + + + + Image Slider + + + + +

                                            Image Slider

                                            +

                                            +
                                            +

                                            +
                                              + +
                                              + +
                                              +
                                              +

                                              Image Slider

                                              +
                                              +
                                              +
                                              + + + + +
                                              +
                                              +
                                              + +
                                              + + + diff --git a/tests/unit-tests/index.html b/tests/unit-tests/index.html new file mode 100644 index 0000000..f38938c --- /dev/null +++ b/tests/unit-tests/index.html @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + diff --git a/tests/unit-tests/listviewcontrols/index.html b/tests/unit-tests/listviewcontrols/index.html new file mode 100644 index 0000000..c854bce --- /dev/null +++ b/tests/unit-tests/listviewcontrols/index.html @@ -0,0 +1,155 @@ + + + + + + jQuery Mobile listviewcontrols tests + + + + + + + + + + + + + + +

                                              jQuery Mobile listviewcontrols tests

                                              +

                                              +

                                              +
                                                +
                                              + +
                                              +
                                              +

                                              listviewcontrols test - validates

                                              +
                                              +
                                              +
                                              +

                                              I am bogus

                                              +
                                              +
                                                +
                                              • Summat
                                              • +
                                              • Summat else
                                              • +
                                              +
                                              +
                                              + +
                                              +
                                              +

                                              listviewcontrols test - defaults

                                              +
                                              +
                                              +
                                              +

                                              I am bogus

                                              +
                                              +
                                                +
                                              • Summat
                                              • +
                                              • Summat else
                                              • +
                                              +
                                              +
                                              + +
                                              +
                                              +

                                              listviewcontrols test - attributes

                                              +
                                              +
                                              +
                                              +

                                              I am bogus

                                              +
                                              +
                                                +
                                              • Summat
                                              • +
                                              • Summat else
                                              • +
                                              +
                                              + +
                                              +

                                              I am bogus

                                              +
                                              +
                                                +
                                              • Summat
                                              • +
                                              • Summat else
                                              • +
                                              +
                                              + +
                                              +
                                              +

                                              listviewcontrols test - show

                                              +
                                              +
                                              +
                                              +

                                              I am bogus

                                              +
                                              + +
                                                +
                                              • + A_a1 + A_e1 + A_v1 + A_e2 + A_v2 + A_e3 + A_v3 + A_a2 +
                                              • +
                                              • + B_a1 + B_e1 + B_e2 + B_v1 + B_v2 +
                                              • +
                                              +
                                              +
                                              + +
                                              +
                                              +

                                              listviewcontrols test - methods

                                              +
                                              +
                                              +
                                              +

                                              I am bogus

                                              +
                                              +
                                                +
                                              • A
                                              • +
                                              • Abraham
                                              • +
                                              • Andy
                                              • +
                                              • B
                                              • +
                                              • Barry
                                              • +
                                              • C
                                              • +
                                              • Carla
                                              • +
                                              • Carrie
                                              • +
                                              +
                                              +
                                              + + + diff --git a/tests/unit-tests/listviewcontrols/listviewcontrols-tests.js b/tests/unit-tests/listviewcontrols/listviewcontrols-tests.js new file mode 100644 index 0000000..85a23d9 --- /dev/null +++ b/tests/unit-tests/listviewcontrols/listviewcontrols-tests.js @@ -0,0 +1,278 @@ +/* + * listviewcontrols unit tests + */ +(function ($) { + $.mobile.defaultTransition = "none"; + + module("listviewcontrols"); + + asyncTest("constructor validates options when applied programmatically", function () { + $.testHelper.pageSequence([ + function () { + var target = $('#listviewcontrols-test-validates-target'); + var controlsSelector = '#listviewcontrols-test-validates-controls'; + var controls = $(controlsSelector); + + var check = function (testNumber, options) { + target.listviewcontrols(options); + var hasClass = target.hasClass('ui-listviewcontrols-listview'); + target.listviewcontrols('destroy'); + equal(hasClass, false, 'test ' + testNumber); + }; + + // no options + check(1); + + // controlPanelSelector is falsy + check(2, {controlPanelSelector: null}); + check(3, {controlPanelSelector: undefined}); + + // modesAvailable is bad + check(4, {controlPanelSelector: controlsSelector, modesAvailable: null}); + check(5, {controlPanelSelector: controlsSelector, modesAvailable: false}); + check(6, {controlPanelSelector: controlsSelector, modesAvailable: 0}); + check(7, {controlPanelSelector: controlsSelector, modesAvailable: ''}); + check(8, {controlPanelSelector: controlsSelector, modesAvailable: {}}); + check(9, {controlPanelSelector: controlsSelector, modesAvailable: []}); + check(10, {controlPanelSelector: controlsSelector, modesAvailable: ['']}); + check(11, {controlPanelSelector: controlsSelector, modesAvailable: ['string']}); + check(12, {controlPanelSelector: controlsSelector, modesAvailable: [null, null]}); + check(13, {controlPanelSelector: controlsSelector, modesAvailable: [0, 0]}); + check(14, {controlPanelSelector: controlsSelector, modesAvailable: ['', '']}); + check(15, {controlPanelSelector: controlsSelector, modesAvailable: ['string', {}]}); + check(16, {controlPanelSelector: controlsSelector, modesAvailable: [{}, 'string']}); + check(17, {controlPanelSelector: controlsSelector, modesAvailable: [0, 'string']}); + check(18, {controlPanelSelector: controlsSelector, modesAvailable: ['string', 0]}); + + // mode is bad + check(19, {controlPanelSelector: controlsSelector, modesAvailable: ['foo', 'bar'], mode: null}); + check(20, {controlPanelSelector: controlsSelector, modesAvailable: ['foo', 'bar'], mode: false}); + check(21, {controlPanelSelector: controlsSelector, modesAvailable: ['foo', 'bar'], mode: ''}); + check(22, {controlPanelSelector: controlsSelector, modesAvailable: ['foo', 'bar'], mode: 'zoink'}); + + // controlPanelSelector references invalid element + check(23, {controlPanelSelector: '', modesAvailable: ['foo', 'bar'], mode: 'foo'}); + check(24, {controlPanelSelector: 'noelement', modesAvailable: ['foo', 'bar'], mode: 'foo'}); + + // controlPanelShowIn is bad + check(25, {controlPanelSelector: controlsSelector, modesAvailable: ['foo', 'bar'], mode: 'foo', controlPanelShowIn: true}); + check(26, {controlPanelSelector: controlsSelector, modesAvailable: ['foo', 'bar'], mode: 'foo', controlPanelShowIn: 'zoink'}); + + // all options valid + target.listviewcontrols({ + controlPanelSelector: controlsSelector, + modesAvailable: ['foo', 'bar'], + mode: 'foo', + controlPanelShowIn: 'foo' + }); + equal(target.hasClass('ui-listviewcontrols-listview'), true); + equal(controls.hasClass('ui-listviewcontrols-panel'), true); + target.listviewcontrols('destroy'); + + start(); + } + ]); + }); + + asyncTest("constructor supplies defaults correctly", function () { + $.testHelper.pageSequence([ + function () { + var target = $('#listviewcontrols-test-defaults-target'); + var controlsSelector = '#listviewcontrols-test-defaults-controls'; + var controls = $(controlsSelector); + + target.listviewcontrols({controlPanelSelector: controlsSelector}); + + deepEqual(target.listviewcontrols('option', 'modesAvailable'), + ['edit', 'view'], + "Should default to 'edit' and 'view' as modesAvailable"); + + equal(target.listviewcontrols('option', 'mode'), + 'view', + "Should default to 'view' as mode"); + + equal(target.listviewcontrols('option', 'controlPanelShowIn'), + 'edit', + "Should default to showing control panel in 'edit' mode"); + + equal(target.hasClass('ui-listviewcontrols-listview'), true); + equal(controls.hasClass('ui-listviewcontrols-panel'), true); + + target.listviewcontrols('destroy'); + + start(); + } + ]); + }); + + asyncTest("constructor uses jqm attributes correctly", function () { + + $.testHelper.pageSequence([ + function () { + $.testHelper.openPage('#listviewcontrols-test-attrs'); + }, + + function () { + var $new_page = $('#listviewcontrols-test-attrs'); + ok($new_page.hasClass('ui-page-active')); + + // everything set through data-listviewcontrols-options + var target = $('#listviewcontrols-test-attrs-target-1'); + var controlsSelector = '#listviewcontrols-test-attrs-controls-1'; + var controls = $(controlsSelector); + + deepEqual(target.listviewcontrols('option', 'modesAvailable'), + ['foo', 'bar'], + "Should set modesAvailable from data-listviewcontrols-options"); + + equal(target.listviewcontrols('option', 'mode'), + 'bar', + "Should set mode from data-listviewcontrols-options"); + + equal(target.listviewcontrols('option', 'controlPanelShowIn'), + 'foo', + "Should set controlPanelShowIn from data-listviewcontrols-options"); + + equal(target.hasClass('ui-listviewcontrols-listview'), true); + equal(controls.hasClass('ui-listviewcontrols-panel'), true); + + // controlPanelShowIn set on the control panel + target = $('#listviewcontrols-test-attrs-target-2'); + controlsSelector = '#listviewcontrols-test-attrs-controls-2'; + controls = $(controlsSelector); + + deepEqual(target.listviewcontrols('option', 'modesAvailable'), + ['fox', 'bat'], + "Should set modesAvailable from data-listviewcontrols-options"); + + equal(target.listviewcontrols('option', 'mode'), + 'bat', + "Should set mode from data-listviewcontrols-options"); + + equal(target.listviewcontrols('option', 'controlPanelShowIn'), + 'bat', + "Should set controlPanelShowIn from data-listviewcontrols-show-in on controls"); + + equal(target.hasClass('ui-listviewcontrols-listview'), true); + equal(controls.hasClass('ui-listviewcontrols-panel'), true); + + start(); + } + ]); + }); + + asyncTest("control panel and list item elements are shown in appropriate mode", function () { + $.testHelper.pageSequence([ + function () { + $.testHelper.openPage('#listviewcontrols-test-show'); + }, + + function () { + var $new_page = $('#listviewcontrols-test-show'); + ok($new_page.hasClass('ui-page-active')); + + var target = $('#listviewcontrols-test-show-target'); + var controlsSelector = '#listviewcontrols-test-show-controls'; + var controls = $(controlsSelector); + + var alwaysVisibleA = 'li:first span.listviewcontrols-test-show-always-visible'; + var alwaysVisibleB = 'li:nth-child(2) span.listviewcontrols-test-show-always-visible'; + var shownInEditA = 'li:first span.listviewcontrols-test-show-visible-in-edit'; + var shownInEditB = 'li:nth-child(2) span.listviewcontrols-test-show-visible-in-edit'; + var shownInViewA = 'li:first span.listviewcontrols-test-show-visible-in-view'; + var shownInViewB = 'li:nth-child(2) span.listviewcontrols-test-show-visible-in-view'; + + var allVisible = function (selector) { + var all = target.find(selector); + var visible = all.filter(':visible'); + equal(visible.length, all.length); + ok(visible.length > 0); + ok(all.length > 0); + }; + + var allHidden = function (selector) { + var all = target.find(selector); + var visible = target.find(selector).filter(':visible'); + equal(visible.length, 0); + ok(all.length > 0); + }; + + // --- initial mode should be view + equal(target.listviewcontrols('option', 'mode'), + 'view', + "Initial mode should be view"); + + // controls should be hidden + ok(!controls.is(':visible')); + + // target should be always visible + ok(target.is(':visible')); + + // show-in="edit" elements should be hidden + allHidden(shownInEditA); + allHidden(shownInEditB); + + // show-in="view" elements should be visible + allVisible(shownInViewA); + allVisible(shownInViewB); + + // other elements should always be visible + allVisible(alwaysVisibleA); + allVisible(alwaysVisibleB); + + // --- switch mode to edit + target.listviewcontrols('option', 'mode', 'edit'); + + // controls should be visible + ok(controls.is(':visible')); + + // target should be always visible + ok(target.is(':visible')); + + // show-in="edit" elements should be visible + allVisible(shownInEditA); + allVisible(shownInEditB); + + // show-in="view" elements should be hidden + allHidden(shownInViewA); + allHidden(shownInViewB); + + // other elements should always be visible + allVisible(alwaysVisibleA); + allVisible(alwaysVisibleB); + + start(); + } + ]); + }); + + asyncTest("visibleListItems() returns correct counts", function () { + $.testHelper.pageSequence([ + function () { + $.testHelper.openPage('#listviewcontrols-test-methods'); + }, + + function () { + var $new_page = $('#listviewcontrols-test-methods'); + ok($new_page.hasClass('ui-page-active')); + + var target = $('#listviewcontrols-test-methods-target'); + + equal(target.listviewcontrols('visibleListItems').length, + 5, + "Should be 5 visible list items (excluding dividers)"); + + // filter the list and count again + $new_page.find('input').val('ca'); + $new_page.find('input').trigger('change'); + + equal(target.listviewcontrols('visibleListItems').length, + 2, + "Should be 2 visible list items (excluding dividers) after filtering"); + + start(); + } + ]); + }); + +})(jQuery); diff --git a/tests/unit-tests/loader/index.html b/tests/unit-tests/loader/index.html new file mode 100644 index 0000000..b3d5825 --- /dev/null +++ b/tests/unit-tests/loader/index.html @@ -0,0 +1,30 @@ + + + + + + loader test + + + + + + + + + + + + + +

                                              Test : loader

                                              +

                                              +

                                              +
                                                + +
                                                + +
                                                + + diff --git a/tests/unit-tests/loader/loader-tests.js b/tests/unit-tests/loader/loader-tests.js new file mode 100644 index 0000000..a2ebd80 --- /dev/null +++ b/tests/unit-tests/loader/loader-tests.js @@ -0,0 +1,54 @@ +/** + * Loader test + * + * Youmin Ha + * + */ +( 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 = $( '' ), + 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/unit-tests/multibuttonentry/index.html b/tests/unit-tests/multibuttonentry/index.html new file mode 100755 index 0000000..33ae7f4 --- /dev/null +++ b/tests/unit-tests/multibuttonentry/index.html @@ -0,0 +1,50 @@ + + + + + + + + + + + + + Multibuttonentry + + + + +

                                                Multibuttonentry

                                                +

                                                +
                                                +

                                                +
                                                  + +
                                                  + +
                                                  +
                                                  +
                                                  +

                                                  Multibuttonentry

                                                  +
                                                  +
                                                  +
                                                  +
                                                  + +
                                                  +
                                                  +
                                                  +

                                                  Multibuttonentry

                                                  +
                                                  +
                                                  +
                                                  +
                                                  + +
                                                  + + + diff --git a/tests/unit-tests/multibuttonentry/multibuttonentry-tests.js b/tests/unit-tests/multibuttonentry/multibuttonentry-tests.js new file mode 100755 index 0000000..e33f222 --- /dev/null +++ b/tests/unit-tests/multibuttonentry/multibuttonentry-tests.js @@ -0,0 +1,65 @@ +/* + * Unit Test: multibuttonentry + * + * Kangsik Kim + */ + +(function ($) { + module("Multibuttonentry"); + + var unit_multibuttonentry = function ( widget, type ) { + var multibuttonentry, + inputText, + outputText, + status; + + /* Create */ + multibuttonentry = widget.multibuttonentry(); + ok(multibuttonentry.length > 0, "Create"); + + /* length */ + equal( multibuttonentry.multibuttonentry("length"), 0, "API : length "); + + /* Add */ + multibuttonentry.multibuttonentry("add", "string1"); + equal(multibuttonentry.multibuttonentry("length"), 1, "API: add('string1') "); + multibuttonentry.multibuttonentry("add", "string2"); + equal(multibuttonentry.multibuttonentry("length"), 2, "API: add('string2') "); + multibuttonentry.multibuttonentry("add", "string3"); + equal(multibuttonentry.multibuttonentry("length"), 3, "API: add('string3') "); + + /* Select */ + multibuttonentry.multibuttonentry("select", 1); + outputText = multibuttonentry.multibuttonentry("select"); + equal( outputText, "string2", "API : select ( 1 )"); + + /* Focus Out */ + multibuttonentry.multibuttonentry("focusOut"); + status = multibuttonentry.hasClass("ui-multibuttonentry-focusout"); + equal( status, true, "API : focusOut "); + + /* Focus In */ + multibuttonentry.multibuttonentry("focusIn"); + status = multibuttonentry.hasClass("ui-multibuttonentry-focusin"); + equal(status, true, "API : focusIn "); + + /* Remove */ + multibuttonentry.multibuttonentry("remove", 0); + equal(multibuttonentry.multibuttonentry("length"), 2 , "API : remove(0)"); + + /* Reamove all */ + multibuttonentry.multibuttonentry("remove"); + equal( multibuttonentry.multibuttonentry("length"), 0, "API : remove"); + + /* input */ + inputText = "multibuttonentry"; + multibuttonentry.multibuttonentry( "inputText", inputText ); + outputText = multibuttonentry.multibuttonentry( "inputText" ); + equal(outputText, inputText, "API : input('" + outputText + "')"); + }; + + test( "Multibuttonentry", function () { + unit_multibuttonentry( $("#multibuttonetnry-test"), "multibuttonetnry" ); + }); + +}( jQuery )); diff --git a/tests/unit-tests/multimediaview/index.html b/tests/unit-tests/multimediaview/index.html new file mode 100755 index 0000000..1656029 --- /dev/null +++ b/tests/unit-tests/multimediaview/index.html @@ -0,0 +1,59 @@ + + + + + + + + + + + + + MultiMediaView + + + + +

                                                  MultiMediaView

                                                  +

                                                  +
                                                  +

                                                  +
                                                    + +
                                                    + +
                                                    +
                                                    +

                                                    MultiMediaView (video)

                                                    +
                                                    +
                                                    + +
                                                    +
                                                    + +
                                                    +
                                                    +

                                                    MultiMediaView (audio)

                                                    +
                                                    +
                                                    + +
                                                    +
                                                    + +
                                                    + + + diff --git a/tests/unit-tests/multimediaview/multimediaview-tests.js b/tests/unit-tests/multimediaview/multimediaview-tests.js new file mode 100755 index 0000000..40e2449 --- /dev/null +++ b/tests/unit-tests/multimediaview/multimediaview-tests.js @@ -0,0 +1,61 @@ +/* + * Unit Test: MultiMediaView + * + * Wonseop Kim + */ + +(function ($) { + module("MultiMediaView"); + + var unit_multimediaview = function ( widget, type ) { + var control, + fullscreenButton, + width, + height, + played, + timeupdated, + ended, + param; + + /* Create */ + widget.multimediaview(); + ok( widget.hasClass( "ui-multimediaview" ) , "Create" ); + + if ( type === "video" ) { + /* width */ + width = 100; + widget.multimediaview( "width", width ); + equal( width, widget.width(), "API: width" ); + + /* height */ + height = 200; + widget.multimediaview( "height", height ); + equal( height, widget.height(), "API: height" ); + + /* size */ + width = 256; + height = 512; + widget.multimediaview( "size", width, height ); + equal( "width : " + widget.width() + ", height : " + widget.height(), + "width : " + width + ", height : " + height, "API: size" ); + + /* fullscreen */ + fullscreenButton = widget.parent().find( ".ui-fullscreenbutton" ); + + widget.multimediaview( "fullscreen", true ); + ok( fullscreenButton.hasClass( "ui-fullscreen-off" ), "API: fullscreen (on)" ); + + widget.multimediaview("fullscreen", false ); + ok( fullscreenButton.hasClass( "ui-fullscreen-on" ), "API: fullscreen (off)" ); + } + }; + + test( "video", function () { + unit_multimediaview( $("#video"), "video" ); + }); + + test( "audio", function () { + unit_multimediaview( $("#audio"), "audio" ); + }); + +}( jQuery )); diff --git a/tests/unit-tests/navigationbar/index.html b/tests/unit-tests/navigationbar/index.html new file mode 100755 index 0000000..25413e4 --- /dev/null +++ b/tests/unit-tests/navigationbar/index.html @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + +

                                                    jQuery Mobile Navigationbar Tests

                                                    +

                                                    +

                                                    +
                                                      +
                                                    + + +
                                                    +
                                                    +

                                                    Navigationbar Test - markup

                                                    +
                                                    +
                                                    +
                                                    +
                                                    +
                                                    +
                                                    + +
                                                    +
                                                    +

                                                    Navigationbar Test - markup

                                                    + Button +
                                                    +
                                                    +
                                                    +
                                                    +
                                                    +
                                                    + +
                                                    +
                                                    + Button +

                                                    Navigationbar Test - markup

                                                    + Button +
                                                    +
                                                    +
                                                    +
                                                    +
                                                    +
                                                    + +
                                                    +
                                                    + Button +

                                                    Navigationbar Test - markup

                                                    + Button2 + Button3 +
                                                    +
                                                    +
                                                    +
                                                    +
                                                    +
                                                    + +
                                                    +
                                                    +

                                                    Extended Title 2 Button

                                                    +
                                                    +
                                                    + + + + +
                                                    +
                                                    +
                                                    +
                                                    +
                                                    +
                                                    + +
                                                    +
                                                    +

                                                    Extended Title 3 Button

                                                    +
                                                    +
                                                    + + + + + + +
                                                    +
                                                    +
                                                    +
                                                    +
                                                    +
                                                    + +
                                                    +
                                                    +

                                                    Extended Title 4 Button

                                                    +
                                                    +
                                                    + + + + + + + + +
                                                    +
                                                    +
                                                    +
                                                    +
                                                    +
                                                    + + + diff --git a/tests/unit-tests/navigationbar/navigationbar-tests.js b/tests/unit-tests/navigationbar/navigationbar-tests.js new file mode 100755 index 0000000..2ad2b09 --- /dev/null +++ b/tests/unit-tests/navigationbar/navigationbar-tests.js @@ -0,0 +1,54 @@ +/* + * navigationbar unit tests +*/ + +(function ($) { + module( "Navigationbar" ); + + var unit_navigationbar = function ( widget, anchorCount, extendedValue ) { + /* Create */ + var created_navigationbar = $( widget ); + + ok( created_navigationbar, "Create" ); + + /* Check Parameters */ + equal( created_navigationbar.jqmData( "nstest-role" ), "header", "Basic test" ); + + + if ( extendedValue ) { + equal( created_navigationbar.find( "input" ).length, anchorCount, "Groupcontrol button test" ); + } else { + equal( created_navigationbar.children( "a" ).length, anchorCount, "button test" ); + } + + /* Check APIs */ + }; + + test( "navigationbar no button test", function () { + unit_navigationbar( $("#normalnavigation1"), 0 ); + }); + + test( "navigationbar one button test", function () { + unit_navigationbar( $("#normalnavigation2"), 1 ); + }); + + test( "navigationbar two button test", function () { + unit_navigationbar( $("#normalnavigation3"), 2 ); + }); + + test( "navigationbar three button test", function () { + unit_navigationbar( $("#normalnavigation4"), 3 ); + }); + + test( "navigationbar extended two button test", function () { + unit_navigationbar( $("#extendedstyle2btn"), 2, true ); + }); + + test( "navigationbar extended three button test", function () { + unit_navigationbar( $("#extendedstyle3btn"), 3, true ); + }); + + test( "navigationbar extended four button test", function () { + unit_navigationbar( $("#extendedstyle4btn"), 4, true ); + }); +})(jQuery); diff --git a/tests/unit-tests/nocontents/index.html b/tests/unit-tests/nocontents/index.html new file mode 100755 index 0000000..25aa56e --- /dev/null +++ b/tests/unit-tests/nocontents/index.html @@ -0,0 +1,80 @@ + + + + + + + + + + + + + No Contents + + + + +

                                                    No Contents

                                                    +

                                                    +
                                                    +

                                                    +
                                                      + +
                                                      + +
                                                      +
                                                      +

                                                      No Contents

                                                      +
                                                      +
                                                      +
                                                      +

                                                      text1

                                                      +

                                                      text2

                                                      +
                                                      +
                                                      +
                                                      + +
                                                      +
                                                      +

                                                      No Contents

                                                      +
                                                      +
                                                      +
                                                      +

                                                      text1

                                                      +

                                                      text2

                                                      +
                                                      +
                                                      +
                                                      + +
                                                      +
                                                      +

                                                      No Contents

                                                      +
                                                      +
                                                      +
                                                      +

                                                      text1

                                                      +

                                                      text2

                                                      +
                                                      +
                                                      +
                                                      + +
                                                      +
                                                      +

                                                      No Contents

                                                      +
                                                      +
                                                      +
                                                      +

                                                      text1

                                                      +

                                                      text2

                                                      +
                                                      +
                                                      +
                                                      + +
                                                      + + + diff --git a/tests/unit-tests/nocontents/nocontents-tests.js b/tests/unit-tests/nocontents/nocontents-tests.js new file mode 100644 index 0000000..8e504cf --- /dev/null +++ b/tests/unit-tests/nocontents/nocontents-tests.js @@ -0,0 +1,47 @@ +/* + * Unit Test: Nocontents + * + * Minkyu Kang + */ + +(function ($) { + module("Nocontents"); + + var unit_nocontents = function ( widget, type ) { + var background, + text, + i; + + /* Create */ + widget.nocontents(); + + ok( widget.hasClass("ui-nocontents"), "Create" ); + + /* Check Background */ + background = widget.children( ".ui-nocontents-icon-" + type ); + ok( background, "Background" ); + + /* Check Texts */ + text = widget.children("p"); + + for ( i = 0; i < text.length; i++ ) { + ok( $( text[i] ).hasClass("ui-nocontents-text"), "Text" + i ); + } + }; + + test( "text type", function () { + unit_nocontents( $("#nocontents_text"), "text" ); + }); + + test( "picture type", function () { + unit_nocontents( $("#nocontents_pic"), "picture" ); + }); + + test( "multimedia type", function () { + unit_nocontents( $("#nocontents_mul"), "multimedia" ); + }); + + test( "unnamed type", function () { + unit_nocontents( $("#nocontents_un"), "unnamed" ); + }); +}( jQuery )); diff --git a/tests/unit-tests/notification/index.html b/tests/unit-tests/notification/index.html new file mode 100755 index 0000000..519c1b9 --- /dev/null +++ b/tests/unit-tests/notification/index.html @@ -0,0 +1,55 @@ + + + + + + + + + + + + + Notification + + + + +

                                                      Notification

                                                      +

                                                      +
                                                      +

                                                      +
                                                        + +
                                                        + +
                                                        +
                                                        +

                                                        text1

                                                        +
                                                        +
                                                        +

                                                        Notification

                                                        +
                                                        +
                                                        +
                                                        +
                                                        + +
                                                        +
                                                        +

                                                        text1

                                                        +

                                                        text2

                                                        +
                                                        +
                                                        +

                                                        Notification

                                                        +
                                                        +
                                                        +
                                                        +
                                                        + +
                                                        + + + diff --git a/tests/unit-tests/notification/notification-tests.js b/tests/unit-tests/notification/notification-tests.js new file mode 100644 index 0000000..ae973b0 --- /dev/null +++ b/tests/unit-tests/notification/notification-tests.js @@ -0,0 +1,59 @@ +/* + * Unit Test: Notification + * + * Minkyu Kang + */ + +(function ($) { + module("Notification"); + + var unit_notification = function ( widget, type ) { + var notification, + elem = ".ui-" + type, + text; + + /* Create */ + widget.notification(); + + notification = widget.children( elem ); + ok( notification, "Create" ); + + /* Show */ + widget.notification("show"); + + notification = widget.children( elem ); + ok( notification.hasClass("show"), "API: show" ); + + /* Hide */ + widget.notification("hide"); + + notification = widget.children( elem ); + ok( notification.hasClass("hide"), "API: hide" ); + + /* hide when click */ + widget.notification("show"); + notification = widget.children( elem ); + notification.trigger("vmouseup"); + + notification = widget.children( elem ); + ok( notification.hasClass("hide"), "Hide when click the notification" ); + + text = notification.children("p"); + console.log(text); + + if ( type === "smallpopup" ) { + ok( $( text[0] ).hasClass( "ui-smallpopup-text-bg" ), "Text" ); + } else { + ok( $( text[0] ).hasClass( "ui-ticker-text1-bg" ), "Top Text" ); + ok( $( text[1] ).hasClass( "ui-ticker-text2-bg" ), "Bottom Text" ); + } + }; + + test( "smallpopup", function () { + unit_notification( $("#smallpopup"), "smallpopup" ); + }); + + test( "tickernoti", function () { + unit_notification( $("#tickernoti"), "ticker" ); + }); +}( jQuery )); diff --git a/tests/unit-tests/optionheader/index.html b/tests/unit-tests/optionheader/index.html new file mode 100755 index 0000000..58cd840 --- /dev/null +++ b/tests/unit-tests/optionheader/index.html @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + +

                                                        jQuery Mobile Option Header Tests

                                                        +

                                                        +

                                                        +
                                                          +
                                                        + +
                                                        +
                                                        + TestBtn +

                                                        Option header - 2 buttons

                                                        + + TestBtn + +
                                                        +
                                                        + + +
                                                        +
                                                        +
                                                        +
                                                        +

                                                        Some content would be here

                                                        +
                                                        +
                                                        + +
                                                        +
                                                        + TestBtn +

                                                        Option header - 2 buttons

                                                        + TestBtn + +
                                                        +
                                                        + + + +
                                                        +
                                                        +
                                                        +
                                                        +

                                                        Some content would be here

                                                        +
                                                        +
                                                        + +
                                                        +
                                                        + TestBtn +

                                                        Option header - 2 buttons

                                                        + + TestBtn + +
                                                        +
                                                        + + + + +
                                                        +
                                                        +
                                                        +
                                                        +

                                                        Some content would be here

                                                        +
                                                        +
                                                        + + diff --git a/tests/unit-tests/optionheader/optionheader-tests.js b/tests/unit-tests/optionheader/optionheader-tests.js new file mode 100755 index 0000000..81f2e1d --- /dev/null +++ b/tests/unit-tests/optionheader/optionheader-tests.js @@ -0,0 +1,73 @@ +/* + * optionheader unit tests + */ + +(function ($) { + module( "Option header" ); + + var unit_optionheader = function ( widget, buttonCount) { + var created_optionheader = widget.optionheader(), + obj_optionheader = created_optionheader.data( "optionheader" ); + + ok( created_optionheader, "Create" ); + + /* Check Option */ + equal( obj_optionheader.options.showIndicator, true, "Option test -> Indicator" ); + equal( obj_optionheader.options.theme, "s", "Option test -> theme" ); + equal( obj_optionheader.options.startCollapsed, false, "Option test -> startCollapsed" ); + equal( obj_optionheader.options.expandable, true, "Option test -> expandable" ); + equal( obj_optionheader.options.duration, 0.25, "Option test -> duration" ); + equal( obj_optionheader.options.collapseOnInit, true, "Option test -> collapseOnInit" ); + + /* parameter check*/ + equal( created_optionheader.find(":jqmData(role='button')").length, buttonCount, "Parameter test -> button length" ); + + if ( created_optionheader.is(":jqmData(for)") ) { + created_optionheader.siblings().each(function ( index ) { + if ( $(this).attr("id") == created_optionheader.jqmData("for") ) { + equal( $(this).jqmData("icon"), "optiontray", "Parameter test -> icon test" ); + } + }); + } + /* Check APIs */ + asyncTest( "option header expand test", function () { + created_optionheader.optionheader( "expand" ); + setTimeout( function () { + equal( created_optionheader.height() > 10 , true, "API test -> expand()" ); + start(); + created_optionheader.optionheader( "collapse" ); + asyncTest( "option header collapse test", function () { + setTimeout( function () { + equal( created_optionheader.height() > 10 , false, "API test -> collapse()" ); + start(); + }, 1000 ); + }); + }, 1000 ); + }); + + obj_optionheader.options = false; + created_optionheader.optionheader( "toggle", true ); + if ( obj_optionheader.options == false ) { + equal( obj_optionheader.isCollapsed , false, "API test -> toggle() collapse" ); + } + + obj_optionheader.options = true; + created_optionheader.optionheader( "toggle", true ); + if ( obj_optionheader.options == true ) { + equal( obj_optionheader.isCollapsed , true, "API test -> toggle() expand" ); + } + /* Check Markup */ + }; + + test( "option header 2btn test", function () { + unit_optionheader( $("#myoptionheader1"), 2 ); + }); + + test( "option header 3btn test", function () { + unit_optionheader( $("#myoptionheader2"), 3 ); + }); + + test( "option header 4btn test", function () { + unit_optionheader( $("#myoptionheader3"), 4 ); + }); +})(jQuery); diff --git a/tests/unit-tests/pagecontrol/index.html b/tests/unit-tests/pagecontrol/index.html new file mode 100644 index 0000000..f919221 --- /dev/null +++ b/tests/unit-tests/pagecontrol/index.html @@ -0,0 +1,30 @@ + + + + + + Pagecontrol test + + + + + + + + + + + + + +

                                                        Test : Pagecontrol

                                                        +

                                                        +

                                                        +
                                                          + +
                                                          + +
                                                          + + diff --git a/tests/unit-tests/pagecontrol/pagecontrol-tests.js b/tests/unit-tests/pagecontrol/pagecontrol-tests.js new file mode 100644 index 0000000..6343a92 --- /dev/null +++ b/tests/unit-tests/pagecontrol/pagecontrol-tests.js @@ -0,0 +1,40 @@ +/** + * pagecontrol test + */ +( function ( $ ) { + $.mobile.defaultTransition = "none"; + + module( "PageControl" ); + + test( "Basic pagecontrol test", function ( ) { + var pc = $( '
                                                          ' ) + .attr( { + 'data-max': 10, + 'data-value': 2 + } ), + nb; + + pc.pagecontrol( ); + + ok( pc, "pagecontrol object creation" ); + nb = pc.children( 'div.page_n' )[1]; // 2nd button + console.dir( nb ); + ok( $(nb).hasClass( 'page_n_2' ), "first button should be activated" ); + equal( $( pc ).pagecontrol( "value" ), 2, "value() method must return 2" ); + + nb = pc.children( 'div.page_n' )[9]; + ok( nb, "last number button should exist" ); + pc.one( "change", function( ev, val ) { + equal( val, 10, "pagecontrol element's value must be set when click event comes." ); + ok( $( nb ).hasClass( 'page_n_10' ), "after click, clicked button should be changed to number type" ); + equal( $( pc ).pagecontrol( "value" ), 10, "value() method must return 10" ); + + $( pc ).pagecontrol( "value", 5 ); + equal( $( pc ).pagecontrol( "value" ), 5, "value() method must return 5 after running .value(5)" ); + + } ); + $(nb).trigger( "click" ); + } ); + +} ) ( jQuery ); + diff --git a/tests/unit-tests/popupwindow/index.html b/tests/unit-tests/popupwindow/index.html new file mode 100755 index 0000000..3b337c9 --- /dev/null +++ b/tests/unit-tests/popupwindow/index.html @@ -0,0 +1,64 @@ + + + + + + + + + + + + + Popup Window + + + + +

                                                          Popup Window

                                                          +

                                                          +
                                                          +

                                                          +
                                                            + +
                                                            + + + +
                                                            + + + diff --git a/tests/unit-tests/popupwindow/popup-tests.js b/tests/unit-tests/popupwindow/popup-tests.js new file mode 100644 index 0000000..2880c77 --- /dev/null +++ b/tests/unit-tests/popupwindow/popup-tests.js @@ -0,0 +1,64 @@ +/* + * Unit Test: Popup window + * + * Minkyu Kang + */ + +(function ($) { + module("Popup Window"); + + var unit_popup = function ( widget, type ) { + var popupwindow = function ( widget ) { + return widget.parent(".ui-popupwindow"); + }, + check_text = function ( widget, selector, type ) { + if ( !widget.find( selector ).length ) { + return; + } + equal( widget.find( selector ).text(), type, type ); + }; + + /* Create */ + widget.popupwindow(); + ok( popupwindow( widget ), "Create" ); + + /* Open */ + widget.popupwindow("open"); + ok( parseInt( popupwindow( widget ).css("top") ) > 0, "API: open" ); + + /* Close */ + widget.popupwindow("close"); + ok( popupwindow( widget ).hasClass("ui-selectmenu-hidden") || + popupwindow( widget ).hasClass("reverse out"), + "API: close" ); + + /* Close the popup by click the screen */ + widget.popupwindow("open"); + $(".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 */ + check_text( widget, ":jqmData(role='text')", "text" ); + check_text( widget, ":jqmData(role='title')", "title" ); + check_text( widget, ".ui-btn", "button" ); + }; + + test( "Center Info", function () { + unit_popup( $("#center_info"), "center_info" ); + }); + + test( "Center Title", function () { + unit_popup( $("#center_title"), "center_title" ); + }); + + test( "Center Basic 1 Button", function () { + unit_popup( $("#center_basic_1btn"), "center_basic_1btn" ); + }); + + test( "Center Title 1 Button", function () { + unit_popup( $("#center_title_1btn"), "center_title_1btn" ); + }); + +}( jQuery )); diff --git a/tests/unit-tests/popupwindow_ctxpopup/ctxpopup-tests.js b/tests/unit-tests/popupwindow_ctxpopup/ctxpopup-tests.js new file mode 100644 index 0000000..8fce173 --- /dev/null +++ b/tests/unit-tests/popupwindow_ctxpopup/ctxpopup-tests.js @@ -0,0 +1,105 @@ +$(document).ready( function () { + + module( "CtxPopup" ); + asyncTest( "Auto-initialization", function () { + $.testHelper.pageSequence( [ + function () { + var plain = $("#pop_plain"), + plainBtn = $("#btn_plain"), + horizontal = $("#pop_horizontal"), + horizontalBtn = $("#btn_horizontal"), + buttons = $("#pop_buttons"), + buttonsBtn = $("#btn_buttons"), + notCtxpopup = $("#pop_not"), + notCtxpopupBtn = $("#btn_not"); + + ok( plain.data( "ctxpopup" ), "should Normal type ctxpopup created" ); + ok( horizontal.data( "ctxpopup" ), "should Horizontal type ctxpopup created" ); + ok( buttons.data( "ctxpopup" ), "should Button type ctxpopup created" ); + ok( !notCtxpopup.data( "ctxpopup" ), "should wihthout arrow ctxpopup not created" ); + }, + + function () { + expect( 4 ); + start(); + } + ]); + }); + + // ctxpopup shares code with popupwindow so only tests ctxpopup specific codes + asyncTest( "Open and Placements", function () { + $.testHelper.pageSequence( [ + function () { + var plain = $("#pop_plain").ctxpopup(), + horizontal = $("#pop_horizontal").ctxpopup(), + buttons = $("#pop_buttons").ctxpopup(); + + function placementsTest( popup ) { + var width = $(window).width(), + height = $(window).height(), + x = 0, + y = 0, + parents = popup.parents(".ui-popupwindow"), + popDim, + popPosX = 0, + popPosY = 0, + segment = 5, + closed = 0, + open = 0; + + popup.bind( "popupafterclose", function () { + // tests event trigger + closed++; + if ( closed == open ) { + equal( closed, open, "should 'popupafterclose' triggered." ); + start(); + } + }); + + while ( y <= height ) { + while ( x <= width ) { + popup.popupwindow( "open", x, y ); + open++; + popPosX = parseInt( parents.css("left") ); + popPosY = parseInt( parents.css("top") ); + popDim = { + width: parents.width(), + height: parents.height() + }; + + if ( popPosX < 0 || popPosY < 0 || popPosX > (width - popDim.width) || popPosY > (height - popDim.height) ) { + throw "Pop up occured at wrong position: (" + popPosX + "," + popPosY + "," + popDim.width + "," + popDim.height + ")"; + } + + popup.popupwindow( "close" ); + x += width / segment; + } + y += height / segment; + x = 0; + } + setTimeout( function() { + if ( closed != open ) + throw " Error, popupafterclose event was not triggering "; + }, 1000 * 10 ); + stop(); + return true; + } + + var testee = [ + { name: "Plain", popup: plain }, + { name: "Horizontal", popup: horizontal }, + { name: "Buttons", popup: buttons } + ]; + + for ( var i = 0; i < testee.length; i++ ) { + ok( placementsTest( testee[i].popup ), "should " + testee[i].name + " pop up within window area" ); + } + }, + + function () { + expect( 6 ); + start(); + } + ]); + }); +}); diff --git a/tests/unit-tests/popupwindow_ctxpopup/index.html b/tests/unit-tests/popupwindow_ctxpopup/index.html new file mode 100644 index 0000000..e655844 --- /dev/null +++ b/tests/unit-tests/popupwindow_ctxpopup/index.html @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + Contextual Popup + + + + +

                                                            Contextual Popup

                                                            +

                                                            +
                                                            +

                                                            +
                                                              + +
                                                              +
                                                              +
                                                              +

                                                              Contextual Popup

                                                              +
                                                              +
                                                              + Pop_1 +
                                                              +
                                                                +
                                                              • + Dummy 1 +
                                                              • +
                                                              • + Dummy 2 +
                                                              • +
                                                              +
                                                              + Pop 2 +
                                                              + +
                                                              + Pop 3 +
                                                              + + + + + + + + + + + +
                                                              + A + + B + + C +
                                                              + D + + E + + F +
                                                              +
                                                              + Pop 4 +
                                                              +
                                                              + Dummy +
                                                              +
                                                              +
                                                              +
                                                              + +
                                                              + + + + diff --git a/tests/unit-tests/progressbar/index.html b/tests/unit-tests/progressbar/index.html new file mode 100755 index 0000000..1a6a32d --- /dev/null +++ b/tests/unit-tests/progressbar/index.html @@ -0,0 +1,45 @@ + + + + + + + + + + + + + Progressbar + + + + +

                                                              Progressbar

                                                              +

                                                              +
                                                              +

                                                              +
                                                                + +
                                                                + +
                                                                +
                                                                +

                                                                Progressbar

                                                                +
                                                                +
                                                                +
                                                                  +
                                                                • +
                                                                • +
                                                                • +
                                                                +
                                                                +
                                                                + +
                                                                + + + diff --git a/tests/unit-tests/progressbar/progressbar-tests.js b/tests/unit-tests/progressbar/progressbar-tests.js new file mode 100644 index 0000000..c9f6832 --- /dev/null +++ b/tests/unit-tests/progressbar/progressbar-tests.js @@ -0,0 +1,67 @@ +/* + * Unit Test: Progressbar + * + * Minkyu Kang + */ + +(function ($) { + module("Progressbar"); + + var unit_progressbar = function ( widget ) { + var progress, + i, + value, + get_width = function ( widget ) { + return widget.progressbar( "option", "value" ); + }; + + widget.progressbar(); + + /* Create */ + equal( widget.hasClass("ui-progressbar"), true, "Create" ); + + /* Value */ + for (i = 0; i < 5; i++) { + value = Math.floor( Math.random() * 100 ); + widget.progressbar( "value", value ); + equal( get_width( widget ), value, "API: value" ); + } + }; + + 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 )); diff --git a/tests/unit-tests/radio/index.html b/tests/unit-tests/radio/index.html new file mode 100644 index 0000000..57452d3 --- /dev/null +++ b/tests/unit-tests/radio/index.html @@ -0,0 +1,68 @@ + + + + + + + + + + + + Radio + + + + +

                                                                Radio

                                                                +

                                                                +
                                                                +

                                                                +
                                                                  + +
                                                                  +
                                                                  +
                                                                  + + + + + + + +
                                                                  + + + + + + + + + + + +
                                                                  + +
                                                                  + + + + + + + + + + + +
                                                                  +
                                                                  +
                                                                  +
                                                                  + + + diff --git a/tests/unit-tests/radio/radio-tests.js b/tests/unit-tests/radio/radio-tests.js new file mode 100644 index 0000000..17cc054 --- /dev/null +++ b/tests/unit-tests/radio/radio-tests.js @@ -0,0 +1,109 @@ +/* + * Unit Test: Radio + * + * Hyunjung Kim + * + */ +$( "#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 */ + var unit_radio_group = function ( fieldset , type ) { + var type, + radios, + label, + labels; + + 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 < raidos.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) continue; + 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" ); + }); +}); diff --git a/tests/unit-tests/runner.js b/tests/unit-tests/runner.js new file mode 100644 index 0000000..7ea8d94 --- /dev/null +++ b/tests/unit-tests/runner.js @@ -0,0 +1,90 @@ +$(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; + }; + + // get the test directories + new Runner().exec(TESTS); +}); diff --git a/tests/unit-tests/searchbar/index.html b/tests/unit-tests/searchbar/index.html new file mode 100755 index 0000000..59cecb2 --- /dev/null +++ b/tests/unit-tests/searchbar/index.html @@ -0,0 +1,87 @@ + + + + + + + + + + Searchbar + + + +

                                                                  Searchbar

                                                                  +

                                                                  +
                                                                  +

                                                                  +
                                                                    + +
                                                                    +
                                                                    +
                                                                    +

                                                                    Dummy

                                                                    +
                                                                    +
                                                                    +
                                                                    +
                                                                    +
                                                                    +
                                                                    +

                                                                    Searchbar

                                                                    + +
                                                                    +
                                                                    +

                                                                    Hairston

                                                                    +

                                                                    Hansbrough

                                                                    +

                                                                    Allred

                                                                    +

                                                                    Hanrahan

                                                                    +

                                                                    Egan

                                                                    +

                                                                    Dare

                                                                    +

                                                                    Edmonson

                                                                    +

                                                                    Calip

                                                                    +

                                                                    Baker

                                                                    +

                                                                    Fazekas

                                                                    +

                                                                    Garrity

                                                                    +

                                                                    Hansen

                                                                    +

                                                                    Feigenbaum

                                                                    +

                                                                    Fillmore

                                                                    +

                                                                    Darden

                                                                    +

                                                                    Davis

                                                                    +

                                                                    Fitzgerald

                                                                    +

                                                                    Carr

                                                                    +

                                                                    Danilovic

                                                                    +

                                                                    Dark

                                                                    +

                                                                    Alexander

                                                                    +

                                                                    Allen

                                                                    +

                                                                    Edwards

                                                                    +

                                                                    Garrett

                                                                    +

                                                                    Gardner

                                                                    +

                                                                    Carroll

                                                                    +

                                                                    Garner

                                                                    +

                                                                    Finn

                                                                    +

                                                                    Edelin

                                                                    +

                                                                    Gay

                                                                    +
                                                                    +
                                                                    +
                                                                    + + + diff --git a/tests/unit-tests/searchbar/searchbar-tests.js b/tests/unit-tests/searchbar/searchbar-tests.js new file mode 100755 index 0000000..27f5752 --- /dev/null +++ b/tests/unit-tests/searchbar/searchbar-tests.js @@ -0,0 +1,78 @@ +/* + * Unit Test: Searchbar list + * + * Wongi Lee + */ + +$( document ).ready( function () { + + module( "Searchbar" ); + + // trigger pagecreate + $( "#searchbar-unit-test" ).page(); + + asyncTest( "Searchbar", function () { + /* Initialize */ + var $divSearchbar = $( "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( $divSearchbar.find( "a.ui-input-cancel" ).hasClass( "ui-btn" ), true ); + equal( $divSearchbar.find( "a.ui-input-cancel" ).hasClass( "ui-btn-icon-cancel" ), true ); + equal( $("#searchbar-content p").filter( function ( index ) { + return $( this ).css( "display" ) != "none"; + } ).length, 30 ); + + /* Public Method */ + /* disable */ + $( "#searchInput" ).searchbar( "disable" ); + equal( $( "div.ui-input-search" ).hasClass( "ui-disabled" ), true, "disable" ); + equal( $( "#searchInput" ).attr( "disabled" ), "disabled" ); + + /* enable */ + $( "#searchInput" ).searchbar( "enable" ); + equal( $( "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" ), "none", "Input and trigger change" ); + + $input.val( "a" ).trigger( "change" ); + + equal( $("#searchbar-content p").filter( function ( index ) { + return $( this ).css( "display" ) != "none"; + } ).length, 24 ); + + $input.val( "ar" ).trigger( "change" ); + equal( $("#searchbar-content p").filter( function ( index ) { + return $( this ).css( "display" ) != "none"; + } ).length, 10 ); + + $input.val( "are" ).trigger( "change" ); + equal( $("#searchbar-content p").filter( function ( index ) { + return $( this ).css( "display" ) != "none"; + } ).length, 1 ); + + /* Clear button preesed. */ + $( "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" ); + equal( $divSearchbar.find( "a.ui-input-cancel" ).hasClass( "ui-btn" ), true ); + equal( $divSearchbar.find( "a.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" ); + + start(); + } ); +} ); diff --git a/tests/unit-tests/segmentcontrol/index.html b/tests/unit-tests/segmentcontrol/index.html new file mode 100755 index 0000000..3f177be --- /dev/null +++ b/tests/unit-tests/segmentcontrol/index.html @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + +

                                                                    jQuery Mobile Controlbar Tests

                                                                    +

                                                                    +

                                                                    +
                                                                      +
                                                                    + + +
                                                                    +
                                                                    +

                                                                    SegmentControl Test - markup

                                                                    +
                                                                    +
                                                                    +
                                                                    +
                                                                    + + + + +
                                                                    +
                                                                    + +
                                                                    +
                                                                    + + + + + + +
                                                                    +
                                                                    + +
                                                                    +
                                                                    + + + + + + + + +
                                                                    +
                                                                    +
                                                                    +
                                                                    +
                                                                    +
                                                                    + + + + diff --git a/tests/unit-tests/segmentcontrol/segmentcontrol-tests.js b/tests/unit-tests/segmentcontrol/segmentcontrol-tests.js new file mode 100755 index 0000000..dfc70ee --- /dev/null +++ b/tests/unit-tests/segmentcontrol/segmentcontrol-tests.js @@ -0,0 +1,33 @@ +/* + * controlbar unit tests + */ + +(function ($) { + module( "SegmentControl" ); + + var unit_segmentcontrol = function ( widget, inputCount ) { + 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" ); + }; + + test( "segmentcontrol 2btn test", function () { + unit_segmentcontrol( $("#segmentcontrol-2btn"), 2 ); + }); + + test( "segmentcontrol 3btn test", function () { + unit_segmentcontrol( $("#segmentcontrol-3btn"), 3 ); + }); + + test( "segmentcontrol 4btn test", function () { + unit_segmentcontrol( $("#segmentcontrol-4btn"), 4 ); + }); + +})(jQuery); diff --git a/tests/unit-tests/shortcutscroll/index.html b/tests/unit-tests/shortcutscroll/index.html new file mode 100755 index 0000000..babeb60 --- /dev/null +++ b/tests/unit-tests/shortcutscroll/index.html @@ -0,0 +1,90 @@ + + + + + + + + + + + + + Shortcut Scroll + + + + +

                                                                    Shortcut Scroll

                                                                    +

                                                                    +
                                                                    +

                                                                    +
                                                                      + +
                                                                      + +
                                                                      +
                                                                      +

                                                                      Shortcut Scroll

                                                                      +
                                                                      +
                                                                      +
                                                                        +
                                                                      • A
                                                                      • +
                                                                      • Anton
                                                                      • +
                                                                      • Arabella
                                                                      • +
                                                                      • Art
                                                                      • +
                                                                      • B
                                                                      • +
                                                                      • Barry
                                                                      • +
                                                                      • Bibi
                                                                      • +
                                                                      • Billy
                                                                      • +
                                                                      • Bob
                                                                      • +
                                                                      • D
                                                                      • +
                                                                      • Daisy
                                                                      • +
                                                                      • Derek
                                                                      • +
                                                                      • Desmond
                                                                      • +
                                                                      • E
                                                                      • +
                                                                      • Eric
                                                                      • +
                                                                      • Ernie
                                                                      • +
                                                                      • Esme
                                                                      • +
                                                                      • F
                                                                      • +
                                                                      • Fay
                                                                      • +
                                                                      • Felicity
                                                                      • +
                                                                      • Francis
                                                                      • +
                                                                      • Frank
                                                                      • +
                                                                      • H
                                                                      • +
                                                                      • Harry
                                                                      • +
                                                                      • Herman
                                                                      • +
                                                                      • Horace
                                                                      • +
                                                                      • J
                                                                      • +
                                                                      • Jack
                                                                      • +
                                                                      • Jane
                                                                      • +
                                                                      • Jill
                                                                      • +
                                                                      • K
                                                                      • +
                                                                      • Katherine
                                                                      • +
                                                                      • Katy
                                                                      • +
                                                                      • Keith
                                                                      • +
                                                                      • L
                                                                      • +
                                                                      • Larry
                                                                      • +
                                                                      • Lee
                                                                      • +
                                                                      • Lola
                                                                      • +
                                                                      • M
                                                                      • +
                                                                      • Mark
                                                                      • +
                                                                      • Milly
                                                                      • +
                                                                      • Mort
                                                                      • +
                                                                      • N
                                                                      • +
                                                                      • Nigel
                                                                      • +
                                                                      • Norman
                                                                      • +
                                                                      • O
                                                                      • +
                                                                      • Organza
                                                                      • +
                                                                      • Orlando
                                                                      • +
                                                                      +
                                                                      +
                                                                      + +
                                                                      + + + diff --git a/tests/unit-tests/shortcutscroll/shortcutscroll-tests.js b/tests/unit-tests/shortcutscroll/shortcutscroll-tests.js new file mode 100644 index 0000000..be36178 --- /dev/null +++ b/tests/unit-tests/shortcutscroll/shortcutscroll-tests.js @@ -0,0 +1,33 @@ +/* + * Unit Test: Shortcut Scroll + * + * Minkyu Kang + */ + +(function ($) { + module("Shortcut Scroll"); + + var unit_shortcutscroll = function ( list ) { + var widget, + shortcut, + divider; + + widget = list.parentsUntil(".ui-content").parent().find(".ui-shortcutscroll"); + + /* Create */ + ok( widget.hasClass("ui-shortcutscroll"), "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_shortcutscroll( $("#shortcut") ); + }); + +}( jQuery )); diff --git a/tests/unit-tests/slider/index.html b/tests/unit-tests/slider/index.html new file mode 100755 index 0000000..720caba --- /dev/null +++ b/tests/unit-tests/slider/index.html @@ -0,0 +1,42 @@ + + + + + + + + + + + + + Slider + + + + +

                                                                      Slider

                                                                      +

                                                                      +
                                                                      +

                                                                      +
                                                                        + +
                                                                        + +
                                                                        +
                                                                        +

                                                                        Slider

                                                                        +
                                                                        +
                                                                        + + +
                                                                        +
                                                                        + +
                                                                        + + + diff --git a/tests/unit-tests/slider/slider-tests.js b/tests/unit-tests/slider/slider-tests.js new file mode 100644 index 0000000..11c59c8 --- /dev/null +++ b/tests/unit-tests/slider/slider-tests.js @@ -0,0 +1,58 @@ +/* + * Unit Test: Slider + * + * Minkyu Kang + */ + +(function ($) { + module("Slider"); + + var unit_slider = function ( widget ) { + var slider, + slider_bg = function ( widget ) { + if ( widget.jqmData("icon") !== undefined ) { + return "ui-slider-icon-bg"; + } + return "ui-slider-bg"; + }, + handle, + handle_left = function ( widget ) { + var left = widget.val() * 100 / + ( widget.attr("max") - widget.attr("min") ); + return left + "%"; + }, + random_move = function ( min, max) { + return Math.floor( (Math.random() * (max - min + 1)) + min ); + }; + + /* 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( handle.css("left"), handle_left(widget), "Handle Location: Default" ); + + /* Check APIs */ + widget.val( random_move(widget.attr("min"), widget.attr("max")) ); + widget.trigger("change"); + equal( handle.css("left"), handle_left(widget), "Handle Location: Moved" ); + }; + + test( "normal slider", function () { + unit_slider( $("#slider0") ); + }); + + test( "icon slider", function () { + unit_slider( $("#slider1") ); + }); +}( jQuery )); diff --git a/tests/unit-tests/swipelist/index.html b/tests/unit-tests/swipelist/index.html new file mode 100644 index 0000000..ea75f56 --- /dev/null +++ b/tests/unit-tests/swipelist/index.html @@ -0,0 +1,82 @@ + + + + + + + + + + + + + Swipelist + + + +

                                                                        Swipelist Tests

                                                                        +

                                                                        +

                                                                        +
                                                                          +
                                                                        + +
                                                                        +
                                                                        +
                                                                          +
                                                                            +
                                                                          • +
                                                                            Twitter
                                                                            +
                                                                            Twitter
                                                                            +
                                                                            Facebook
                                                                            +
                                                                            Facebook
                                                                            +
                                                                            +
                                                                            subtext
                                                                            +
                                                                            2line-leftsub2
                                                                            +
                                                                            +
                                                                          • +
                                                                          • +
                                                                            Twitter
                                                                            +
                                                                            Twitter
                                                                            +
                                                                            Facebook
                                                                            +
                                                                            Facebook
                                                                            +
                                                                            +
                                                                            subtext
                                                                            +
                                                                            1line-leftsub1
                                                                            +
                                                                            +
                                                                          • +
                                                                          +
                                                                        +
                                                                        +
                                                                        +
                                                                          +
                                                                            +
                                                                          • +
                                                                            Twitter
                                                                            +
                                                                            Twitter
                                                                            +
                                                                            Facebook
                                                                            +
                                                                            Facebook
                                                                            +
                                                                            +
                                                                            subtext
                                                                            +
                                                                            2line-leftsub2
                                                                            +
                                                                            +
                                                                          • +
                                                                          • +
                                                                            Twitter
                                                                            +
                                                                            Twitter
                                                                            +
                                                                            Facebook
                                                                            +
                                                                            Facebook
                                                                            +
                                                                            +
                                                                            subtext
                                                                            +
                                                                            1line-leftsub1
                                                                            +
                                                                            +
                                                                          • +
                                                                          +
                                                                        +
                                                                        +
                                                                        + + + diff --git a/tests/unit-tests/swipelist/swipelist-tests.js b/tests/unit-tests/swipelist/swipelist-tests.js new file mode 100644 index 0000000..23ff373 --- /dev/null +++ b/tests/unit-tests/swipelist/swipelist-tests.js @@ -0,0 +1,85 @@ +/* + * swipelist unit tests + * + * Hyunjung Kim + * + */ + +( function ( $ ) { + + module("swipelist"); + + var unit_swipe = function( swipelist, type ) { + var covers, + cover, + coverStart, + item, + slideLeftDone = function () { + ok(true, "Animation Complete - sliding left"); + cover.unbind("animationComplete"); + equal(cover.position().left, coverStart, "Position - Cover"); + start(); + }, + slideRightDone = function () { + ok(true, "Animation Complete - sliding right"); + setTimeout(function () { + cover.unbind("animationComplete"); + cover.bind("animationComplete", slideLeftDone); + item.trigger("swipeleft"); + }, 0); + }; + + $("#swipelistpage").page(); + swipelist.swipelist(); + + ok(swipelist.hasClass("ui-swipelist"),"Create - Swipelist"); + covers = swipelist.find("li *.ui-swipelist-item-cover"); + cover = covers.first(); + coverStart = cover.position().left; + item = swipelist.find("li").first(); + + cover.bind("animationComplete", slideRightDone); + cover.trigger("swiperight"); + stop(); + + equal( swipelist.find("li.ui-swipelist-item").length , 2, "Count - Swipeable li"); + equal( covers.length , 2, "Count - cover"); + + equal(covers.find("span.ui-swipelist-item-cover-inner:contains('1line-leftsub1')").length, + 1, + "Check - Cover string value"); + }; + + var unit_swipe_destroy = function(swipelist, type) { + var covers, + new_page = $("#swipedestorypage"); + + new_page.page(); + swipelist.swipelist(); + ok(swipelist.hasClass("ui-swipelist"),"Create - Swipelist"); + covers = swipelist.find("li *.ui-swipelist-item-cover"); + + equal( swipelist.find("li.ui-swipelist-item").length , 2, "Count - Swipeable li"); + equal( covers.length , 2, "Count - cover"); + + swipelist.swipelist("destroy"); + + equal(new_page.has('.ui-swipelist').length, 0, "Destroy - list"); + equal(new_page.has('.ui-swipelist-item').length, 0 , "Destroy - item" ); + equal(new_page.has('.ui-swipelist-item-cover').length, 0, "Destroy - cover"); + + }; + + asyncTest( " swipelist ", function() { + expect(7); + unit_swipe( $("#swipewidget"), "swipelist" ); + start(); + }); + + asyncTest( " swipelist - destory", function() { + expect(6), + unit_swipe_destroy( $("#swipedestroy"), "swipelistdestroy"), + start() + }); + +} ) ( jQuery ); diff --git a/tests/unit-tests/tests.js b/tests/unit-tests/tests.js new file mode 100644 index 0000000..ec0562b --- /dev/null +++ b/tests/unit-tests/tests.js @@ -0,0 +1,37 @@ +var TESTS = { + "testPages":[ + // Put your test here + "autodividers", + "button", + "check", + "color", + "controlbar", + "datetimepicker", + "dayselector", + "expandablelist", + "extendablelist", + "handler", + "imageslider", + "listviewcontrols", + "multibuttonentry", + "multimediaview", + "navigationbar", + "nocontents", + "notification", + "optionheader", + "pagecontrol", + "popupwindow", + "popupwindow_ctxpopup", + "progressbar", + "radio", + "searchbar", + "segmentcontrol", + "shortcutscroll", + "slider", + "swipelist", + "toggleswitch", + "virtuallist", + "virtualgrid", + "collapsible" + ] +}; diff --git a/tests/unit-tests/toggleswitch/index.html b/tests/unit-tests/toggleswitch/index.html new file mode 100644 index 0000000..a2c99f4 --- /dev/null +++ b/tests/unit-tests/toggleswitch/index.html @@ -0,0 +1,34 @@ + + + + + + + + + + + + + Toggle Switch + + + + +

                                                                        Toggle Switch

                                                                        +

                                                                        +
                                                                        +

                                                                        +
                                                                          + +
                                                                          + +
                                                                          +
                                                                          + +
                                                                          + + diff --git a/tests/unit-tests/toggleswitch/toggleswitch-tests.js b/tests/unit-tests/toggleswitch/toggleswitch-tests.js new file mode 100644 index 0000000..569862c --- /dev/null +++ b/tests/unit-tests/toggleswitch/toggleswitch-tests.js @@ -0,0 +1,51 @@ +$(document).ready( function () { + module( "Toggle Switch" ); + test( "Create", function () { + ok( $("#ts-auto").data("checked"), "should created by auto-intialization" ); + $("#ts-self").toggleswitch(); + ok( $("#ts-self").data("checked"), "should created by call '.toggleswitch()'" ); + }); + + test( "Options", function () { + var ts = $("#ts-self"), + text = [], + on = "Enable", + off = "Disable"; + + $("#ts-self").toggleswitch( { + texton: on, + textoff: off, + checked: false + }); + deepEqual( [ on, off, false ], + [ ts.toggleswitch("option", "texton"), + ts.toggleswitch("option", "textoff"), + ts.toggleswitch("option", "checked") ], + "should set on/off text by option val" ); + + text.push( ts.next().find(".ui-toggleswitch-on .ui-toggleswitch-text").text() ); + text.push( ts.next().find(".ui-toggleswitch-off .ui-toggleswitch-text").text() ); + + deepEqual( text, [ on, off ], "should display on/off text correctly" ); + }); + + test( "Events", function () { + var ts = $("#ts-self").toggleswitch(), + before = ts.toggleswitch( "option", "checked" ); + + ts.bind("changed", function() { + ok( true, "should trigger changed event"); + notEqual( before, ts.toggleswitch( "option", "checked" ), "should change value" ); + }); + + // "click" event or ".click()" is not working due to 'remove 2nd vclick' patch. + ts.next().find(".ui-toggleswitch-mover").trigger( "vclick" ); + expect(2); + + before = ts.toggleswitch( "option", "checked" ); + ts.toggleswitch( "option", "checked", !before ); + + expect(4); + }); + +}); diff --git a/tests/unit-tests/virtualgrid/index.html b/tests/unit-tests/virtualgrid/index.html new file mode 100755 index 0000000..0ae6fd9 --- /dev/null +++ b/tests/unit-tests/virtualgrid/index.html @@ -0,0 +1,51 @@ + + + + + + + + + + Virtualgrid + + + +

                                                                          Virtualgrid

                                                                          +

                                                                          +
                                                                          +

                                                                          +
                                                                            + +
                                                                            +
                                                                            +
                                                                            +

                                                                            Virtualgrid

                                                                            +
                                                                            +
                                                                            + +
                                                                            + +
                                                                            +
                                                                            +
                                                                            + + diff --git a/tests/unit-tests/virtualgrid/virtualgrid-tests.js b/tests/unit-tests/virtualgrid/virtualgrid-tests.js new file mode 100755 index 0000000..1021425 --- /dev/null +++ b/tests/unit-tests/virtualgrid/virtualgrid-tests.js @@ -0,0 +1,64 @@ +/* + * Unit Test: virtual grid + * + * Kangsik Kim + */ + +(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"); + }; + + $(document).bind("dataloaded" , function () { + test( "Virtualgrid", function () { + unit_virtualgrid( $("#virtualgrid-test"), "virtualgrid" ); + }); + }); +}( jQuery )); diff --git a/tests/unit-tests/virtuallist/index.html b/tests/unit-tests/virtuallist/index.html new file mode 100755 index 0000000..b02d226 --- /dev/null +++ b/tests/unit-tests/virtuallist/index.html @@ -0,0 +1,46 @@ + + + + + + + + + + + Virtuallist + + + +

                                                                            Virtuallist

                                                                            +

                                                                            +
                                                                            +

                                                                            +
                                                                              + +
                                                                              +
                                                                              +
                                                                              +

                                                                              Dummy

                                                                              +
                                                                              +
                                                                              +
                                                                              +
                                                                              +
                                                                              +
                                                                              +

                                                                              Virtual List - Normal Style 1line

                                                                              +
                                                                              +
                                                                              + +
                                                                                +
                                                                              +
                                                                              +
                                                                              +
                                                                              + + diff --git a/tests/unit-tests/virtuallist/virtuallist-tests.js b/tests/unit-tests/virtuallist/virtuallist-tests.js new file mode 100755 index 0000000..98d23ae --- /dev/null +++ b/tests/unit-tests/virtuallist/virtuallist-tests.js @@ -0,0 +1,67 @@ +/* + * Unit Test: Virtual list + * + * Wongi Lee + */ + +$( 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 () { + /* Initialize and create method */ + 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()" ); + } ); + } + + /* 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(); + } else { + console.log ( "Virtual List Init Fail." ); + } +} ); diff --git a/tools/inline-protos.sh b/tools/inline-protos.sh new file mode 100755 index 0000000..a51b5b8 --- /dev/null +++ b/tools/inline-protos.sh @@ -0,0 +1,218 @@ +#!/bin/bash + +WIDGET_BASE_DIR="$1" +VERBOSE=$(test "x$2x" != "xx" && echo "1" || echo "0") + +rm_tmpfile() # No args +{ + if test $VERBOSE -eq 1; then + echo "Removing ${TMP_FNAME}" > /dev/stderr + fi + rm -f "${TMP_FNAME}" +} + +trap rm_tmpfile TERM INT + +process_fname() # $1 = file name, n_pass +{ + FNAME="$1" + N_PASS="$2" + cat ${FNAME} | \ + sed -rn '1h;1!H;${;g;s!((\$|jQuery)([\n \t]|/\*.*\*/)*\.([\n \t]|/\*.*\*/)*widget([\n \t]|/\*.*\*/)*\(([\n \t]|/\*.*\*/)*")([^"]*)("[^{]*\{)!\1'$'\1''\7'$'\1''\8!g;p;}' | \ + sed -rn '1h;1!H;${;g;s!(/\*|\*/|//|[{}])!'$'\1''\1'$'\1''!g;p;}' | \ + gawk \ + -v 'nPass='"${N_PASS}" \ + -v 'inComment=0' \ + -v 'inWidgetBody=0' \ + -v 'inHtmlProto=0' \ + -v 'widgetName=' \ + -v 'braceCount=0' \ + -v 'sourceToken=0' \ + -v 'sourceValue=' \ + -v 'seenSource=0' \ + -v 'needAnotherPass=0' \ + -v 'needToAddComma=0' \ + ' + function dumpProto(protoName) { + protoFile = "'"${WIDGET_BASE_DIR}"'/proto-html/" protoName ".prototype.html"; + if (system("test -r " protoFile)) { + print "\033[7minline-protos.sh: Warning: " protoFile " not found\033[0m" > "/dev/stderr"; + printf("\"%s\"", protoName); + } + else { + insideTag = 0; + printf("\n$(\"
                                                                              "); + while (1 == (getline inputLine < protoFile)) { + for (Nix1 = 1 ; Nix1 <= length(inputLine) ; Nix1++) { + theChar = substr(inputLine, Nix1, 1); + if ("<" == theChar) + insideTag = 1; + else + if (">" == theChar) + insideTag = 0; + if (insideTag && "\"" == theChar) + theChar = "'"'"'"; + printf("%s", theChar); + } + printf("\" +\n \""); + } + printf("
                                                                              \")"); + close(protoFile); + } + } + + function establishInliningVariables(widgetName, token) { + if (1 == inWidgetBody) { + if (1 == braceCount) { + if (match(token, /[ \t]([^: \t]*):/, arToken)) + inHtmlProto = ((arToken[1] == "_htmlProto") ? 1 : 0); + printf("%s", token); + } + else { + if (inHtmlProto == 1) { + if (nPass == 1 && seenSource == 0) { + printf("\nsource:\n"); + dumpProto(widgetName); + seenSource = 1; + needToAddComma = 1; + } + if (braceCount == 2) { + sourceTokenHasMatched = 0; + if (match(token, /[ \t]([a-zA-Z0-9_]*)[ \t]*:/, arToken)) { + sourceToken = ((arToken[1] == "source") ? 1 : 0); + sourceTokenHasMatched = 1; + if (needToAddComma == 1) { + printf(","); + needToAddComma = 0; + } + } + + if (sourceToken == 0) { + if (sourceValue != "") { + if (match(sourceValue, /^[\n\t ]*("([^"]*)")/, sourceWidgetAr)) { + sourceWidgetName = sourceWidgetAr[2]; + printf("%s", substr(sourceValue, 1, sourceWidgetAr[1, "start"] - 1)); + dumpProto(sourceWidgetName); + printf("%s", substr(sourceValue, sourceWidgetAr[1, "start"] + sourceWidgetAr[1, "length"])); + } + else + printf("%s", sourceValue); + sourceValue = ""; + } + printf("%s", token); + } + else { + if (sourceTokenHasMatched) { + nArSource = split(token, arSource, ":"); + printf("%s:", arSource[1]); + + for (idxArSource = 2 ; idxArSource <= nArSource ; idxArSource++) { + seenSource = 1; + sourceValue = sourceValue arSource[idxArSource]; + if (idxArSource < nArSource) + sourceValue = sourceValue ":"; + } + } + else { + seenSource = 1; + sourceValue = sourceValue token; + } + } + } + else + printf("%s", token); + } + else + printf("%s", token); + } + } + else + printf("%s", token); + } + { + n = split($0, ar, /\001/); + if (n > 1) { + for (Nix = 1 ; Nix <= n ; Nix++) { + if (ar[Nix] == "/*") { + inComment = 1; + printf("%s", ar[Nix]); + } + else + if (ar[Nix] == "*/") { + inComment = 0; + printf("%s", ar[Nix]); + } + else + if (ar[Nix] == "//") { + for (; Nix <= n ; Nix++) + printf("%s", ar[Nix]); + } + else + if (1 == inComment) + printf("%s", ar[Nix]); + else + if (Nix % 2) { + establishInliningVariables(widgetName, ar[Nix]); + } + else { + /* ar[Nix] is an interesting token not inside comments */ + if ("{" == ar[Nix] || "}" == ar[Nix]) { + if (widgetName != "" && inWidgetBody == 0) { + if ("{" == ar[Nix]) + inWidgetBody = 1; + else + exit(1); + } + if (inWidgetBody == 1) { + if ("{" == ar[Nix]) + braceCount++; + else + if ("}" == ar[Nix]) { + if (inHtmlProto == 1 && braceCount == 2) { + if (seenSource == 0) + needAnotherPass = 1; + seenSource = 0; + } + braceCount--; + } + } + } + else { + split(ar[Nix], arWidget, "."); + widgetName = arWidget[2]; + } + if (widgetName == "") + printf("%s", ar[Nix]); + else + printf("%s", ar[Nix]); + } + } + print(""); + } + else + if (inComment) + print; + else + establishInliningVariables(widgetName, $0 "\n"); + } + END { exit(needAnotherPass); } + ' +} + +if test "x${WIDGET_BASE_DIR}x" = "xx"; then + echo "Usage: $(basename $0) " + 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 +done diff --git a/tools/web-ui-fw-generate-app-tpl.sh b/tools/web-ui-fw-generate-app-tpl.sh new file mode 100755 index 0000000..4ce6a45 --- /dev/null +++ b/tools/web-ui-fw-generate-app-tpl.sh @@ -0,0 +1,180 @@ +#!/bin/bash + +### Prepare: set global variables ### +CWD=`pwd` +SCRIPTDIR="`cd \`dirname $0\`/; pwd`" +PREFIX="/usr" +LIBDIR=/share/tizen-web-ui-fw +DATA_FRAMEWORK_ROOT= + + +# Parse options +# from parseopt.inc +# Parse commandline options, and export option variables +# +# Created by Youmin Ha +# +# Usage: +# - Set option_list array like below: +# option_list=( "--prelink" "--foo=" ) +# - Add this inc by following code: +# . ${TOPDIR}/inc/parseopt.inc +# +# After including parseopt.inc, argc and argv are set, excluding options in option_list. + +function parseopt +{ + argv=( "$@" ) + argc=${#argv[@]} + + if test ! -n "${option_list}"; then + local option_list=( ); # available option list, starting -- + fi + + local idx=0 + unset __changed + while [ "$idx" -lt "$argc" ]; + do + local arg=${argv[${idx}]} + local tmp_idx=0 + + for _valid_option in ${option_list[@]} + do + #echo "...for valid option:$_valid_option" + #echo " ...check arg:${arg:0:${#_valid_option}}" + if [[ "$_valid_option" == "${arg:0:${#_valid_option}}" ]]; then + #echo "...found valid option:$_valid_option" + if [ ${_valid_option:${#_valid_option}-1} == "=" ]; then + eval "export ${arg#--}" + else + eval "export ${arg#--}=1" + fi + + # pull remained options + let "tmp_idx = $idx + 1" + while [ "$tmp_idx" -lt "${#argv[@]}" ] + do + argv[$tmp_idx-1]="${argv[$tmp_idx]}" + let "tmp_idx = $tmp_idx + 1" + done + unset argv[${#argv[@]}-1] + local __changed=1 + break + fi + done + if [ ! -n "$__changed" ]; then + let "idx = $idx + 1" + fi + unset __changed + done + argc=${#argv[@]} +} + +option_list=( "--copylib" "--type=" ) +parseopt $@ + +APP_NAME=${argv[0]} +INSTALL_DIR=${argv[1]} +if [ ! -n "$INSTALL_DIR" ]; then + INSTALL_DIR=. +fi +DESTDIR="$INSTALL_DIR/$APP_NAME" + + +# Print usage and exit # +function usage +{ + local EXITCODE=1 + if [ -n "$1" ]; then local ERRMSG=$1; else local ERRMSG="Invalid arguments"; fi + local NO_USAGE=$2 + + if [ -n "$1" ]; then EXITCODE=1; echo "ERROR: $ERRMSG"; echo ""; fi + + if [ -n "$1" ]; then + echo "Usage: $0 <--copylib> <--type=[w3c|tizen]> " + echo "" + echo " app-name : Your application name. If whitespace is contained, wrap it " + echo " by quote mark." + echo " install-dir : Directory which the template code directory with name of" + echo " app-name is created in." + echo " // directory will be created." + echo " --copylib : When this option is used, all libs and resources will be " + echo " copied into template directory, and all templates will refer" + echo " those copied libs." + echo " --type=[w3c|tizen]" + echo " Set type of application template. If no --type= option is given," + echo " the type is set to tizen by default." + echo "" + fi + + exit $EXITCODE +} + + +### Check argv ### +function check_argv +{ + if [ ! -n "$APP_NAME" ]; then usage "No app-name is given."; fi + if [ ! -d "$INSTALL_DIR" ]; then usage "No install-dir is found; $INSTALL_DIR"; fi + if [ -e "$DESTDIR" ]; then usage "$DESTDIR already exists."; fi +} + + +### Copy template files into installation directory ### +function copy_template +{ + local libpath="${PREFIX}${LIBDIR}" + local tplpath=$libpath/template + + # Check if this script is in src script + if [ -e "${SCRIPTDIR}/../build/tizen-web-ui-fw" ]; then + libpath="${SCRIPTDIR}/../build/tizen-web-ui-fw" + tplpath=${SCRIPTDIR}/../src/template + fi + + echo "Copying template files into $DESTDIR..." + mkdir -p $DESTDIR || usage "ERROR: Failed to create directory: $DESTDIR" + find $tplpath/ -maxdepth 1 -type f | xargs -i cp -a {} $DESTDIR/ || usage "ERROR: Failed to copy templates" ; + if [[ ! -n "$type" ]]; then + type="tizen" + fi + if [[ -n "$type" && -d "$tplpath/$type" ]]; then # Copy type-specific files + cp -a $tplpath/$type/* $DESTDIR/ || usage "ERROR: Failed to copy templates" + fi + + # copy lib if --copylib option is given + if [ -n "$copylib" ]; then + echo "Copying libs into $DESTDIR..." + cp -a ${libpath} ${DESTDIR}/ || usage "ERROR: Failed to copy libs" + DATA_FRAMEWORK_ROOT="data-framework-root=\"tizen-web-ui-fw\"" + LIBDIR="tizen-web-ui-fw/latest/js" # This new value is used by replace_template() + else # otherwise, just set libdir + LIBDIR="file://${PREFIX}${LIBDIR}/template" + fi +} + + +### Replace filename & keywords ### +function replace_template +{ + echo "Replacing contents of template files..." + + local replace_keywords=( "APP_NAME" "LIBDIR" "DATA_FRAMEWORK_ROOT") + + local in_file_path_list=`find $DESTDIR -name '*.in' -type f -print` + for in_file_path in ${in_file_path_list[@]}; do + for keyword in "${replace_keywords[@]}"; do + eval "local val=\$$keyword" + #echo "keyword=$keyword, val=$val" + sed -i -e "s#@$keyword@#$val#g" $in_file_path + done + done + rename 's/\.in//' $DESTDIR/* +} + + +### main ### +check_argv +copy_template +replace_template +