Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 736E610775 for ; Mon, 26 Aug 2013 15:34:07 +0000 (UTC) Received: (qmail 11042 invoked by uid 500); 26 Aug 2013 15:33:48 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 10527 invoked by uid 500); 26 Aug 2013 15:33:42 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 9852 invoked by uid 99); 26 Aug 2013 15:33:36 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Aug 2013 15:33:36 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id B7D268C5612; Mon, 26 Aug 2013 15:33:35 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: pplaquette@apache.org To: commits@cordova.apache.org Date: Mon, 26 Aug 2013 15:33:56 -0000 Message-Id: <65fe75ac27fa4c39a9112d34e2cb63c3@git.apache.org> In-Reply-To: <503968c98a874175b74a2c834ae46064@git.apache.org> References: <503968c98a874175b74a2c834ae46064@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [22/52] [abbrv] [cordova-tizen] tizen SDK 2.2 support http://git-wip-us.apache.org/repos/asf/cordova-tizen/blob/e21e0780/templates/CordovaTizenWebUIFrameworkTemplate/project/tizen-web-ui-fw/latest/js/modules/jqm/widgets/fixedToolbar.js ---------------------------------------------------------------------- diff --git a/templates/CordovaTizenWebUIFrameworkTemplate/project/tizen-web-ui-fw/latest/js/modules/jqm/widgets/fixedToolbar.js b/templates/CordovaTizenWebUIFrameworkTemplate/project/tizen-web-ui-fw/latest/js/modules/jqm/widgets/fixedToolbar.js new file mode 100644 index 0000000..880d451 --- /dev/null +++ b/templates/CordovaTizenWebUIFrameworkTemplate/project/tizen-web-ui-fw/latest/js/modules/jqm/widgets/fixedToolbar.js @@ -0,0 +1,280 @@ +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +//>>description: Behavior for "fixed" headers and footers +//>>label: Toolbars: Fixed +//>>group: Widgets +//>>css.structure: ../css/structure/jquery.mobile.fixedToolbar.css +//>>css.theme: ../css/themes/default/jquery.mobile.theme.css + +define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.core", "../jquery.mobile.navigation", "./page", "./page.sections", "../jquery.mobile.zoom" ], function( jQuery ) { +//>>excludeEnd("jqmBuildExclude"); +(function( $, undefined ) { + + + $.widget( "mobile.fixedtoolbar", $.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, button, input, select, textarea, .ui-header-fixed, .ui-footer-fixed, .ui-popup", + 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(position='dummy')" + }, + + _create: function() { + + var self = this, + o = self.options, + $el = self.element, + tbtype = $el.is( ":jqmData(role='header')" ) ? "header" : "footer", + $page = $el.closest( ".ui-page" ); + + // Feature detecting support for + if ( o.supportBlacklist() ) { + self.destroy(); + return; + } + + $el.addClass( "ui-"+ tbtype +"-fixed" ); + + // "fullscreen" overlay positioning + if ( o.fullscreen ) { + $el.addClass( "ui-"+ tbtype +"-fullscreen" ); + $page.addClass( "ui-page-" + tbtype + "-fullscreen" ); + } + // If not fullscreen, add class to page to set top or bottom padding + else{ + $page.addClass( "ui-page-" + tbtype + "-fixed" ); + } + + self._addTransitionClass(); + self._bindPageEvents(); + self._bindToggleHandlers(); + }, + + _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 ); + } + }, + + _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() { + if ( o.disablePageZoom ) { + $.mobile.zoom.disable( true ); + } + if ( !o.visibleOnPageShow ) { + self.hide( true ); + } + } ) + .bind( "webkitAnimationStart animationstart updatelayout", function() { + var thisPage = this; + if ( o.updatePagePadding ) { + self.updatePagePadding( thisPage ); + } + }) + .bind( "pageshow", function() { + var thisPage = this; + self.updatePagePadding( thisPage ); + if ( o.updatePagePadding ) { + $.mobile.$window.bind( "throttledresize." + self.widgetName, function() { + self.updatePagePadding( thisPage ); + }); + } + }) + .bind( "pagebeforehide", function( e, ui ) { + if ( o.disablePageZoom ) { + $.mobile.zoom.enable( true ); + } + if ( o.updatePagePadding ) { + $.mobile.$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 ) || $(); + + if ( nextFooter.length || nextHeader.length ) { + + nextFooter.add( nextHeader ).appendTo( $.mobile.pageContainer ); + + ui.nextPage.one( "pageshow", function() { + nextFooter.add( nextHeader ).appendTo( this ); + }); + } + } + }); + }, + + _visible: true, + + // This will set the content element's top or bottom padding equal to the toolbar's height + updatePagePadding: function( tbPage ) { + var $el = this.element, + header = $el.is( ".ui-header" ); + + // This behavior only applies to "fixed", not "fullscreen" + if ( this.options.fullscreen ) { return; } + + tbPage = tbPage || $el.closest( ".ui-page" ); + $( tbPage ).css( "padding-" + ( header ? "top" : "bottom" ), $el.outerHeight() ); + }, + + _useTransition: function( notransition ) { + var $win = $.mobile.$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" ](); + }, + + _bindToggleHandlers: function() { + var self = this, + o = self.options, + $el = self.element; + + // tap toggle + $el.closest( ".ui-page" ) + .bind( "vclick", function( e ) { + if ( o.tapToggle && !$( e.target ).closest( o.tapToggleBlacklist ).length ) { + self.toggle(); + } + }) + .bind( "focusin focusout", function( e ) { + if ( screen.width < 500 && $( e.target ).is( o.hideDuringFocus ) && !$( e.target ).closest( ".ui-header-fixed, .ui-footer-fixed" ).length ) { + self[ ( e.type === "focusin" && self._visible ) ? "hide" : "show" ](); + } + }); + }, + + 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 + $.mobile.$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.fixedtoolbar.prototype.options.initSelector, e.target ).not( ":jqmData(fullscreen)" ).jqmData( "fullscreen", true ); + } + + $.mobile.fixedtoolbar.prototype.enhanceWithin( e.target ); + }); + +})( jQuery ); +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +}); +//>>excludeEnd("jqmBuildExclude"); http://git-wip-us.apache.org/repos/asf/cordova-tizen/blob/e21e0780/templates/CordovaTizenWebUIFrameworkTemplate/project/tizen-web-ui-fw/latest/js/modules/jqm/widgets/forms/button.js ---------------------------------------------------------------------- diff --git a/templates/CordovaTizenWebUIFrameworkTemplate/project/tizen-web-ui-fw/latest/js/modules/jqm/widgets/forms/button.js b/templates/CordovaTizenWebUIFrameworkTemplate/project/tizen-web-ui-fw/latest/js/modules/jqm/widgets/forms/button.js new file mode 100644 index 0000000..d390071 --- /dev/null +++ b/templates/CordovaTizenWebUIFrameworkTemplate/project/tizen-web-ui-fw/latest/js/modules/jqm/widgets/forms/button.js @@ -0,0 +1,156 @@ +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +//>>description: Custom-styled native input/buttons +//>>label: Buttons: Input or button-based +//>>group: Forms +//>>css.structure: ../css/structure/jquery.mobile.button.css +//>>css.theme: ../css/themes/default/jquery.mobile.theme.css + +define( [ "jquery", "../../jquery.mobile.widget", "../../jquery.mobile.buttonMarkup" ], function( jQuery ) { +//>>excludeEnd("jqmBuildExclude"); +(function( $, undefined ) { + +$.widget( "mobile.button", $.mobile.widget, { + options: { + theme: null, + icon: null, + iconpos: null, + corners: true, + shadow: true, + iconshadow: true, + initSelector: "button, [type='button'], [type='submit'], [type='reset']" + }, + _create: function() { + var $el = this.element, + $button, + o = this.options, + type, + name, + inline = o.inline || $.mobile.getAttrFixed( $el[0], "data-" + $.mobile.ns + "inline" ), + mini = o.mini || $.mobile.getAttrFixed( $el[0], "data-" + $.mobile.ns + "mini" ), + classes = "", + $buttonPlaceholder; + + // if this is a link, check if it's been enhanced and, if not, use the right function + if ( $el[ 0 ].tagName === "A" ) { + if ( !$el.hasClass( "ui-btn" ) ) { + $el.buttonMarkup(); + } + + return; + } + + // get the inherited theme + // TODO centralize for all widgets + if ( !this.options.theme ) { + this.options.theme = $.mobile.getInheritedTheme( this.element, "c" ); + } + + // TODO: Post 1.1--once we have time to test thoroughly--any classes manually applied to the original element should be carried over to the enhanced element, with an `-enhanced` suffix. See https://github.com/jquery/jquery-mobile/issues/3577 + /* if ( $el[0].className.length ) { + classes = $el[0].className; + } */ + if ( !!~$el[0].className.indexOf( "ui-btn-left" ) ) { + classes = "ui-btn-left"; + } + + if ( !!~$el[0].className.indexOf( "ui-btn-right" ) ) { + classes = "ui-btn-right"; + } + + if ( $el.attr( "type" ) === "submit" || $el.attr( "type" ) === "reset" ) { + classes ? classes += " ui-submit" : classes = "ui-submit"; + } + $( "label[for='" + $el.attr( "id" ) + "']" ).addClass( "ui-submit" ); + + // Add ARIA role + this.button = $( "
" ) + [ $el.html() ? "html" : "text" ]( $el.html() || $el.val() ) + .insertBefore( $el ) + .buttonMarkup({ + theme: o.theme, + icon: o.icon, + iconpos: o.iconpos, + inline: inline, + corners: o.corners, + shadow: o.shadow, + iconshadow: o.iconshadow, + mini: mini + }) + .addClass( classes ) + .append( $el.addClass( "ui-btn-hidden" ) ); + + $button = this.button; + type = $el.attr( "type" ); + name = $el.attr( "name" ); + + // Add hidden input during submit if input type="submit" has a name. + if ( type !== "button" && type !== "reset" && name ) { + $el.bind( "vclick", function() { + // Add hidden input if it doesn't already exist. + if ( $buttonPlaceholder === undefined ) { + $buttonPlaceholder = $( "", { + type: "hidden", + name: $el.attr( "name" ), + value: $el.attr( "value" ) + }).insertBefore( $el ); + + // Bind to doc to remove after submit handling + $.mobile.$document.one( "submit", function() { + $buttonPlaceholder.remove(); + + // reset the local var so that the hidden input + // will be re-added on subsequent clicks + $buttonPlaceholder = undefined; + }); + } + }); + } + + $el.bind({ + focus: function() { + $button.addClass( $.mobile.focusClass ); + }, + + blur: function() { + $button.removeClass( $.mobile.focusClass ); + } + }); + + this.refresh(); + }, + + enable: function() { + this.element.attr( "disabled", false ); + this.button.removeClass( "ui-disabled" ).attr( "aria-disabled", false ); + return this._setOption( "disabled", false ); + }, + + disable: function() { + this.element.attr( "disabled", true ); + this.button.addClass( "ui-disabled" ).attr( "aria-disabled", true ); + return this._setOption( "disabled", true ); + }, + + refresh: function() { + var $el = this.element; + + if ( $el.prop("disabled") ) { + this.disable(); + } else { + this.enable(); + } + + // Grab the button's text element from its implementation-independent data item + $( this.button.data( 'buttonElements' ).text )[ $el.html() ? "html" : "text" ]( $el.html() || $el.val() ); + } +}); + +//auto self-init widgets +$.mobile.$document.bind( "pagecreate create", function( e ) { + $.mobile.button.prototype.enhanceWithin( e.target, true ); +}); + +})( jQuery ); +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +}); +//>>excludeEnd("jqmBuildExclude"); http://git-wip-us.apache.org/repos/asf/cordova-tizen/blob/e21e0780/templates/CordovaTizenWebUIFrameworkTemplate/project/tizen-web-ui-fw/latest/js/modules/jqm/widgets/forms/checkboxradio.js ---------------------------------------------------------------------- diff --git a/templates/CordovaTizenWebUIFrameworkTemplate/project/tizen-web-ui-fw/latest/js/modules/jqm/widgets/forms/checkboxradio.js b/templates/CordovaTizenWebUIFrameworkTemplate/project/tizen-web-ui-fw/latest/js/modules/jqm/widgets/forms/checkboxradio.js new file mode 100644 index 0000000..a8f0082 --- /dev/null +++ b/templates/CordovaTizenWebUIFrameworkTemplate/project/tizen-web-ui-fw/latest/js/modules/jqm/widgets/forms/checkboxradio.js @@ -0,0 +1,229 @@ +/* +* "checkboxradio" plugin +*/ + +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +//>>description: Consistent styling for checkboxes/radio buttons. +//>>label: Checkboxes & Radio Buttons +//>>group: Forms +//>>css.structure: ../css/structure/jquery.mobile.forms.checkboxradio.css +//>>css.theme: ../css/themes/default/jquery.mobile.theme.css + +define( [ "jquery", "../../jquery.mobile.core", "../../jquery.mobile.widget", "../../jquery.mobile.buttonMarkup" ], function( jQuery ) { +//>>excludeEnd("jqmBuildExclude"); +(function( $, undefined ) { + +$.widget( "mobile.checkboxradio", $.mobile.widget, { + options: { + theme: null, + initSelector: "input[type='checkbox'],input[type='radio']" + }, + _create: function() { + var self = this, + input = this.element, + inheritAttr = function( input, dataAttr ) { + return input.jqmData( dataAttr ) || input.closest( "form, fieldset" ).jqmData( dataAttr ); + }, + // NOTE: Windows Phone could not find the label through a selector + // filter works though. + parentLabel = $( input ).closest( "label" ), + label = parentLabel.length ? parentLabel : ( input[0].id ? $( input ).closest( "form, fieldset, :jqmData(role='page'), :jqmData(role='dialog')" ).find( "label" ).filter( "[for='" + input[0].id + "']" ) : [ ] ), + inputtype = input[0].type, + mini = inheritAttr( input, "mini" ), + checkedState = inputtype + "-on", + uncheckedState = inputtype + "-off", + icon = input.parents( ":jqmData(type='horizontal')" ).length ? undefined : uncheckedState, + iconpos = inheritAttr( input, "iconpos" ), + activeBtn = icon ? "" : " " + $.mobile.activeBtnClass, + checkedClass = "ui-" + checkedState + activeBtn, + uncheckedClass = "ui-" + uncheckedState, + checkedicon = "ui-icon-" + checkedState, + uncheckedicon = "ui-icon-" + uncheckedState, + ariaCheckedAttr = ""; + + if ( inputtype !== "checkbox" && inputtype !== "radio" ) { + return; + } + + ariaCheckedAttr = ( inputtype === "checkbox" ) ? "aria-checked" : "aria-selected"; + + // Support fake label + if ( label.length == 0 ) { + label = $( "" ); + } + + // Expose for other methods + $.extend( this, { + label: label, + inputtype: inputtype, + checkedClass: checkedClass, + uncheckedClass: uncheckedClass, + checkedicon: checkedicon, + uncheckedicon: uncheckedicon, + ariaCheckedAttr : ariaCheckedAttr + }); + + // If there's no selected theme check the data attr + if ( !this.options.theme ) { + this.options.theme = $.mobile.getInheritedTheme( this.element, "c" ); + } + + label.buttonMarkup({ + theme: this.options.theme, + icon: icon, + shadow: false, + mini: mini, + iconpos: iconpos + }); + + // Wrap the input + label in a div + var wrapper = document.createElement('div'); + wrapper.className = 'ui-' + inputtype; + wrapper.setAttribute( "role", inputtype ); + + if ( input.hasClass( "favorite" ) ) { + wrapper.className += ' favorite'; + } + + input.add( label ).wrapAll( wrapper ); + + label.bind({ + vmouseover: function( event ) { + if ( $( this ).parent().is( ".ui-disabled" ) ) { + event.stopPropagation(); + } + }, + + vclick: function( event ) { + if ( input.is( ":disabled" ) ) { + event.preventDefault(); + return; + } + + self._cacheVals(); + + input.prop( "checked", inputtype === "radio" && true || !input.prop( "checked" ) ); + + // trigger click handler's bound directly to the input as a substitute for + // how label clicks behave normally in the browsers + // TODO: it would be nice to let the browser's handle the clicks and pass them + // through to the associate input. we can swallow that click at the parent + // wrapper element level + input.triggerHandler( 'click' ); + + // Input set for common radio buttons will contain all the radio + // buttons, but will not for checkboxes. clearing the checked status + // of other radios ensures the active button state is applied properly + self._getInputSet().not( input ).prop( "checked", false ); + + self._updateAll(); + return false; + } + }); + + input + .bind({ + vmousedown: function() { + self._cacheVals(); + }, + + vclick: function() { + var $this = $( this ); + + // Adds checked attribute to checked input when keyboard is used + if ( $this.is( ":checked" ) ) { + + $this.prop( "checked", true); + self._getInputSet().not( $this ).prop( "checked", false ); + } else { + + $this.prop( "checked", false ); + } + + self._updateAll(); + }, + + focus: function() { + label.addClass( $.mobile.focusClass ); + }, + + blur: function() { + label.removeClass( $.mobile.focusClass ); + } + }); + + this.refresh(); + }, + + _cacheVals: function() { + this._getInputSet().each(function() { + $( this ).jqmData( "cacheVal", this.checked ); + }); + }, + + //returns either a set of radios with the same name attribute, or a single checkbox + _getInputSet: function() { + if ( this.inputtype === "checkbox" ) { + return this.element; + } + + return this.element.closest( "form, fieldset, :jqmData(role='page'), :jqmData(role='dialog')" ) + .find( "input[name='" + this.element[0].name + "'][type='" + this.inputtype + "']" ); + }, + + _updateAll: function() { + var self = this; + + this._getInputSet().each(function() { + var $this = $( this ); + + if ( this.checked || self.inputtype === "checkbox" ) { + $this.trigger( "change" ); + } + $this.focus(); + }) + .checkboxradio( "refresh" ); + }, + + refresh: function() { + var input = this.element[0], + label = this.label, + wrapper = input.parentNode, + icon = label.find( ".ui-icon" ); + + if ( input.checked ) { + label.addClass( this.checkedClass ).removeClass( this.uncheckedClass ); + icon.addClass( this.checkedicon ).removeClass( this.uncheckedicon ); + wrapper.setAttribute( this.ariaCheckedAttr, true ); + } else { + label.removeClass( this.checkedClass ).addClass( this.uncheckedClass ); + icon.removeClass( this.checkedicon ).addClass( this.uncheckedicon ); + wrapper.setAttribute( this.ariaCheckedAttr, false ); + } + + if ( input.disabled ) { + this.disable(); + } else { + this.enable(); + } + }, + + disable: function() { + this.element.prop( "disabled", true ).parent().addClass( "ui-disabled" ); + }, + + enable: function() { + this.element.prop( "disabled", false ).parent().removeClass( "ui-disabled" ); + } +}); + +//auto self-init widgets +$.mobile.$document.bind( "pagecreate create", function( e ) { + $.mobile.checkboxradio.prototype.enhanceWithin( e.target, true ); +}); + +})( jQuery ); +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +}); +//>>excludeEnd("jqmBuildExclude"); http://git-wip-us.apache.org/repos/asf/cordova-tizen/blob/e21e0780/templates/CordovaTizenWebUIFrameworkTemplate/project/tizen-web-ui-fw/latest/js/modules/jqm/widgets/forms/select.custom.js ---------------------------------------------------------------------- diff --git a/templates/CordovaTizenWebUIFrameworkTemplate/project/tizen-web-ui-fw/latest/js/modules/jqm/widgets/forms/select.custom.js b/templates/CordovaTizenWebUIFrameworkTemplate/project/tizen-web-ui-fw/latest/js/modules/jqm/widgets/forms/select.custom.js new file mode 100644 index 0000000..02ae263 --- /dev/null +++ b/templates/CordovaTizenWebUIFrameworkTemplate/project/tizen-web-ui-fw/latest/js/modules/jqm/widgets/forms/select.custom.js @@ -0,0 +1,524 @@ +/* +* custom "selectmenu" plugin +*/ + +//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); +//>>description: Extension to select menus to support menu styling, placeholder options, and multi-select features. +//>>label: Selects: Custom menus +//>>group: Forms +//>>css.structure: ../css/structure/jquery.mobile.forms.select.css +//>>css.theme: ../css/themes/default/jquery.mobile.theme.css + +define( [ + "jquery", + "../../jquery.mobile.buttonMarkup", + "../../jquery.mobile.core", + "../dialog", + "./select", + "../listview", + "../page", + "../popup", + // NOTE expects ui content in the defined page, see selector for menuPageContent definition + "../page.sections" ], function( jQuery ) { +//>>excludeEnd("jqmBuildExclude"); +(function( $, undefined ) { + var extendSelect = function( widget ) { + + var select = widget.select, + selectID = widget.selectID, + label = widget.label, + thisPage = widget.select.closest( ".ui-page" ), + selectOptions = widget._selectOptions(), + isMultiple = widget.isMultiple = widget.select[ 0 ].multiple, + buttonId = selectID + "-button", + menuId = selectID + "-menu", + menuPage = $( "
" + + "
" + + "
" + label.getEncodedText() + "
"+ + "
"+ + "
"+ + "
" ), + + listbox = $( "
", { "class": "ui-selectmenu" } ).insertAfter( widget.select ).popup( { theme: "a" } ), + + list = $( "