mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
6 lines
No EOL
158 KiB
JavaScript
6 lines
No EOL
158 KiB
JavaScript
!function(e,t,i){"function"==typeof define&&define.amd?define(["jquery"],function(n){return i(n,e,t),n.mobile}):i(e.jQuery,e,t)}(this,document,function(e,t,i){!function(e,t,n){"$:nomunge";function s(e){return e=e||location.href,"#"+e.replace(/^[^#]*#?(.*)$/,"$1")}var o,a="hashchange",r=i,l=e.event.special,h=r.documentMode,c="on"+a in t&&(h===n||h>7);e.fn[a]=function(e){return e?this.bind(a,e):this.trigger(a)},e.fn[a].delay=50,l[a]=e.extend(l[a],{setup:function(){return c?!1:void e(o.start)},teardown:function(){return c?!1:void e(o.stop)}}),o=function(){function i(){var n=s(),r=p(h);n!==h?(d(h=n,r),e(t).trigger(a)):r!==h&&(location.href=location.href.replace(/#.*/,"")+r),o=setTimeout(i,e.fn[a].delay)}var o,l={},h=s(),u=function(e){return e},d=u,p=u;return l.start=function(){o||i()},l.stop=function(){o&&clearTimeout(o),o=n},t.attachEvent&&!t.addEventListener&&!c&&function(){var t,n;l.start=function(){t||(n=e.fn[a].src,n=n&&n+s(),t=e('<iframe tabindex="-1" title="empty"/>').hide().one("load",function(){n||d(s()),i()}).attr("src",n||"javascript:0").insertAfter("body")[0].contentWindow,r.onpropertychange=function(){try{"title"===event.propertyName&&(t.document.title=r.title)}catch(e){}})},l.stop=u,p=function(){return s(t.location.href)},d=function(i,n){var s=t.document,o=e.fn[a].domain;i!==n&&(s.title=r.title,s.open(),o&&s.write('<script>document.domain="'+o+'"</script>'),s.close(),t.location.hash=i)}}(),l}()}(e,this),function(e){e.mobile={}}(e),function(e){e.extend(e.mobile,{version:"1.4.5",subPageUrlKey:"ui-page",hideUrlBar:!0,keepNative:":jqmData(role='none'), :jqmData(role='nojs')",activePageClass:"ui-page-active",activeBtnClass:"ui-btn-active",focusClass:"ui-focus",ajaxEnabled:!0,hashListeningEnabled:!0,linkBindingEnabled:!0,defaultPageTransition:"fade",maxTransitionWidth:!1,minScrollBack:0,defaultDialogTransition:"pop",pageLoadErrorMessage:"Error Loading Page",pageLoadErrorMessageTheme:"a",phonegapNavigationEnabled:!1,autoInitializePage:!0,pushStateEnabled:!0,ignoreContentEnabled:!1,buttonMarkup:{hoverDelay:200},dynamicBaseEnabled:!0,pageContainer:e(),allowCrossDomainPages:!1,dialogHashKey:"&ui-state=dialog"})}(e,this),function(e,t,i){var n={},s=e.find,o=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,a=/:jqmData\(([^)]*)\)/g;e.extend(e.mobile,{ns:"",getAttribute:function(t,i){var n;t=t.jquery?t[0]:t,t&&t.getAttribute&&(n=t.getAttribute("data-"+e.mobile.ns+i));try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:o.test(n)?JSON.parse(n):n}catch(s){}return n},nsNormalizeDict:n,nsNormalize:function(t){return n[t]||(n[t]=e.camelCase(e.mobile.ns+t))},closestPageData:function(e){return e.closest(":jqmData(role='page'), :jqmData(role='dialog')").data("mobile-page")}}),e.fn.jqmData=function(t,n){var s;return"undefined"!=typeof t&&(t&&(t=e.mobile.nsNormalize(t)),s=arguments.length<2||n===i?this.data(t):this.data(t,n)),s},e.jqmData=function(t,i,n){var s;return"undefined"!=typeof i&&(s=e.data(t,i?e.mobile.nsNormalize(i):i,n)),s},e.fn.jqmRemoveData=function(t){return this.removeData(e.mobile.nsNormalize(t))},e.jqmRemoveData=function(t,i){return e.removeData(t,e.mobile.nsNormalize(i))},e.find=function(t,i,n,o){return t.indexOf(":jqmData")>-1&&(t=t.replace(a,"[data-"+(e.mobile.ns||"")+"$1]")),s.call(this,t,i,n,o)},e.extend(e.find,s)}(e,this),function(e,t){function n(t,i){var n,o,a,r=t.nodeName.toLowerCase();return"area"===r?(n=t.parentNode,o=n.name,t.href&&o&&"map"===n.nodeName.toLowerCase()?(a=e("img[usemap=#"+o+"]")[0],!!a&&s(a)):!1):(/input|select|textarea|button|object/.test(r)?!t.disabled:"a"===r?t.href||i:i)&&s(t)}function s(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}var o=0,a=/^ui-id-\d+$/;e.ui=e.ui||{},e.extend(e.ui,{version:"c0ab71056b936627e8a7821f03c044aec6280a40",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({focus:function(t){return function(i,n){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),n&&n.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),scrollParent:function(){var t;return t=e.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(e.css(this,"position"))&&/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!t.length?e(this[0].ownerDocument||i):t},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++o)})},removeUniqueId:function(){return this.each(function(){a.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,n){return!!e.data(t,n[3])},focusable:function(t){return n(t,!isNaN(e.attr(t,"tabindex")))},tabbable:function(t){var i=e.attr(t,"tabindex"),s=isNaN(i);return(s||i>=0)&&n(t,!s)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(i,n){function s(t,i,n,s){return e.each(o,function(){i-=parseFloat(e.css(t,"padding"+this))||0,n&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),s&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var o="Width"===n?["Left","Right"]:["Top","Bottom"],a=n.toLowerCase(),r={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+n]=function(i){return i===t?r["inner"+n].call(this):this.each(function(){e(this).css(a,s(this,i)+"px")})},e.fn["outer"+n]=function(t,i){return"number"!=typeof t?r["outer"+n].call(this,t):this.each(function(){e(this).css(a,s(this,t,!0,i)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.support.selectstart="onselectstart"in i.createElement("div"),e.fn.extend({disableSelection:function(){return this.bind((e.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(n){if(n!==t)return this.css("zIndex",n);if(this.length)for(var s,o,a=e(this[0]);a.length&&a[0]!==i;){if(s=a.css("position"),("absolute"===s||"relative"===s||"fixed"===s)&&(o=parseInt(a.css("zIndex"),10),!isNaN(o)&&0!==o))return o;a=a.parent()}return 0}}),e.ui.plugin={add:function(t,i,n){var s,o=e.ui[t].prototype;for(s in n)o.plugins[s]=o.plugins[s]||[],o.plugins[s].push([i,n[s]])},call:function(e,t,i,n){var s,o=e.plugins[t];if(o&&(n||e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType))for(s=0;s<o.length;s++)e.options[o[s][0]]&&o[s][1].apply(e.element,i)}}}(e),function(e,t){var n=function(t,i){var n=t.parent(),s=[],o=function(){var t=e(this),i=e.mobile.toolbar&&t.data("mobile-toolbar")?t.toolbar("option"):{position:t.attr("data-"+e.mobile.ns+"position"),updatePagePadding:t.attr("data-"+e.mobile.ns+"update-page-padding")!==!1};return!("fixed"===i.position&&i.updatePagePadding===!0)},a=n.children(":jqmData(role='header')").filter(o),r=t.children(":jqmData(role='header')"),l=n.children(":jqmData(role='footer')").filter(o),h=t.children(":jqmData(role='footer')");return 0===r.length&&a.length>0&&(s=s.concat(a.toArray())),0===h.length&&l.length>0&&(s=s.concat(l.toArray())),e.each(s,function(t,n){i-=e(n).outerHeight()}),Math.max(0,i)};e.extend(e.mobile,{window:e(t),document:e(i),keyCode:e.ui.keyCode,behaviors:{},silentScroll:function(i){"number"!==e.type(i)&&(i=e.mobile.defaultHomeScroll),e.event.special.scrollstart.enabled=!1,setTimeout(function(){t.scrollTo(0,i),e.mobile.document.trigger("silentscroll",{x:0,y:i})},20),setTimeout(function(){e.event.special.scrollstart.enabled=!0},150)},getClosestBaseUrl:function(t){var i=e(t).closest(".ui-page").jqmData("url"),n=e.mobile.path.documentBase.hrefNoHash;return e.mobile.dynamicBaseEnabled&&i&&e.mobile.path.isPath(i)||(i=n),e.mobile.path.makeUrlAbsolute(i,n)},removeActiveLinkClass:function(t){!e.mobile.activeClickedLink||e.mobile.activeClickedLink.closest("."+e.mobile.activePageClass).length&&!t||e.mobile.activeClickedLink.removeClass(e.mobile.activeBtnClass),e.mobile.activeClickedLink=null},getInheritedTheme:function(e,t){for(var i,n,s=e[0],o="",a=/ui-(bar|body|overlay)-([a-z])\b/;s&&(i=s.className||"",!(i&&(n=a.exec(i))&&(o=n[2])));)s=s.parentNode;return o||t||"a"},enhanceable:function(e){return this.haveParents(e,"enhance")},hijackable:function(e){return this.haveParents(e,"ajax")},haveParents:function(t,i){if(!e.mobile.ignoreContentEnabled)return t;var n,s,o,a,r,l=t.length,h=e();for(a=0;l>a;a++){for(s=t.eq(a),o=!1,n=t[a];n;){if(r=n.getAttribute?n.getAttribute("data-"+e.mobile.ns+i):"","false"===r){o=!0;break}n=n.parentNode}o||(h=h.add(s))}return h},getScreenHeight:function(){return t.innerHeight||e.mobile.window.height()},resetActivePageHeight:function(t){var i=e("."+e.mobile.activePageClass),s=i.height(),o=i.outerHeight(!0);t=n(i,"number"==typeof t?t:e.mobile.getScreenHeight()),i.css("min-height",""),i.height()<t&&i.css("min-height",t-(o-s))},loading:function(){var t=this.loading._widget||e(e.mobile.loader.prototype.defaultHtml).loader(),i=t.loader.apply(t,arguments);return this.loading._widget=t,i}}),e.addDependents=function(t,i){var n=e(t),s=n.jqmData("dependents")||e();n.jqmData("dependents",e(s).add(i))},e.fn.extend({removeWithDependents:function(){e.removeWithDependents(this)},enhanceWithin:function(){var t,i={},n=e.mobile.page.prototype.keepNativeSelector(),s=this;e.mobile.nojs&&e.mobile.nojs(this),e.mobile.links&&e.mobile.links(this),e.mobile.degradeInputsWithin&&e.mobile.degradeInputsWithin(this),e.fn.buttonMarkup&&this.find(e.fn.buttonMarkup.initSelector).not(n).jqmEnhanceable().buttonMarkup(),e.fn.fieldcontain&&this.find(":jqmData(role='fieldcontain')").not(n).jqmEnhanceable().fieldcontain(),e.each(e.mobile.widgets,function(t,o){if(o.initSelector){var a=e.mobile.enhanceable(s.find(o.initSelector));a.length>0&&(a=a.not(n)),a.length>0&&(i[o.prototype.widgetName]=a)}});for(t in i)i[t][t]();return this},addDependents:function(t){e.addDependents(this,t)},getEncodedText:function(){return e("<a>").text(this.text()).html()},jqmEnhanceable:function(){return e.mobile.enhanceable(this)},jqmHijackable:function(){return e.mobile.hijackable(this)}}),e.removeWithDependents=function(t){var i=e(t);(i.jqmData("dependents")||e()).remove(),i.remove()},e.addDependents=function(t,i){var n=e(t),s=n.jqmData("dependents")||e();n.jqmData("dependents",e(s).add(i))},e.find.matches=function(t,i){return e.find(t,null,null,i)},e.find.matchesSelector=function(t,i){return e.find(i,null,null,[t]).length>0}}(e,this),function(e){t.matchMedia=t.matchMedia||function(e){var t,i=e.documentElement,n=i.firstElementChild||i.firstChild,s=e.createElement("body"),o=e.createElement("div");return o.id="mq-test-1",o.style.cssText="position:absolute;top:-100em",s.style.background="none",s.appendChild(o),function(e){return o.innerHTML='­<style media="'+e+'"> #mq-test-1 { width: 42px; }</style>',i.insertBefore(s,n),t=42===o.offsetWidth,i.removeChild(s),{matches:t,media:e}}}(i),e.mobile.media=function(e){return t.matchMedia(e).matches}}(e),function(e){var t={touch:"ontouchend"in i};e.mobile.support=e.mobile.support||{},e.extend(e.support,t),e.extend(e.mobile.support,t)}(e),function(e){e.extend(e.support,{orientation:"orientation"in t&&"onorientationchange"in t})}(e),function(e,n){function s(e){var t,i=e.charAt(0).toUpperCase()+e.substr(1),s=(e+" "+m.join(i+" ")+i).split(" ");for(t in s)if(p[s[t]]!==n)return!0}function o(){var i=t,n=!(!i.document.createElementNS||!i.document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect||i.opera&&-1===navigator.userAgent.indexOf("Chrome")),s=function(t){t&&n||e("html").addClass("ui-nosvg")},o=new i.Image;o.onerror=function(){s(!1)},o.onload=function(){s(1===o.width&&1===o.height)},o.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw=="}function a(){var s,o,a,r="transform-3d",l=e.mobile.media("(-"+m.join("-"+r+"),(-")+"-"+r+"),("+r+")");if(l)return!!l;s=i.createElement("div"),o={MozTransform:"-moz-transform",transform:"transform"},d.append(s);for(a in o)s.style[a]!==n&&(s.style[a]="translate3d( 100px, 1px, 1px )",l=t.getComputedStyle(s).getPropertyValue(o[a]));return!!l&&"none"!==l}function r(){var t,i,n=location.protocol+"//"+location.host+location.pathname+"ui-dir/",s=e("head base"),o=null,a="";return s.length?a=s.attr("href"):s=o=e("<base>",{href:n}).appendTo("head"),t=e("<a href='testurl' />").prependTo(d),i=t[0].href,s[0].href=a||location.pathname,o&&o.remove(),0===i.indexOf(n)}function l(){var e,n=i.createElement("x"),s=i.documentElement,o=t.getComputedStyle;return"pointerEvents"in n.style?(n.style.pointerEvents="auto",n.style.pointerEvents="x",s.appendChild(n),e=o&&"auto"===o(n,"").pointerEvents,s.removeChild(n),!!e):!1}function h(){var e=i.createElement("div");return"undefined"!=typeof e.getBoundingClientRect}function c(){var e=t,i=navigator.userAgent,n=navigator.platform,s=i.match(/AppleWebKit\/([0-9]+)/),o=!!s&&s[1],a=i.match(/Fennec\/([0-9]+)/),r=!!a&&a[1],l=i.match(/Opera Mobi\/([0-9]+)/),h=!!l&&l[1];return(n.indexOf("iPhone")>-1||n.indexOf("iPad")>-1||n.indexOf("iPod")>-1)&&o&&534>o||e.operamini&&"[object OperaMini]"==={}.toString.call(e.operamini)||l&&7458>h||i.indexOf("Android")>-1&&o&&533>o||r&&6>r||"palmGetResource"in t&&o&&534>o||i.indexOf("MeeGo")>-1&&i.indexOf("NokiaBrowser/8.5.0")>-1?!1:!0}var u,d=e("<body>").prependTo("html"),p=d[0].style,m=["Webkit","Moz","O"],f="palmGetResource"in t,g=t.operamini&&"[object OperaMini]"==={}.toString.call(t.operamini),b=t.blackberry&&!s("-webkit-transform");e.extend(e.mobile,{browser:{}}),e.mobile.browser.oldIE=function(){var e=3,t=i.createElement("div"),n=t.all||[];do t.innerHTML="<!--[if gt IE "+ ++e+"]><br><![endif]-->";while(n[0]);return e>4?e:!e}(),e.extend(e.support,{pushState:"pushState"in history&&"replaceState"in history&&!(t.navigator.userAgent.indexOf("Firefox")>=0&&t.top!==t)&&-1===t.navigator.userAgent.search(/CriOS/),mediaquery:e.mobile.media("only all"),cssPseudoElement:!!s("content"),touchOverflow:!!s("overflowScrolling"),cssTransform3d:a(),boxShadow:!!s("boxShadow")&&!b,fixedPosition:c(),scrollTop:("pageXOffset"in t||"scrollTop"in i.documentElement||"scrollTop"in d[0])&&!f&&!g,dynamicBaseTag:r(),cssPointerEvents:l(),boundingRect:h(),inlineSVG:o}),d.remove(),u=function(){var e=t.navigator.userAgent;return e.indexOf("Nokia")>-1&&(e.indexOf("Symbian/3")>-1||e.indexOf("Series60/5")>-1)&&e.indexOf("AppleWebKit")>-1&&e.match(/(BrowserNG|NokiaBrowser)\/7\.[0-3]/)}(),e.mobile.gradeA=function(){return(e.support.mediaquery&&e.support.cssPseudoElement||e.mobile.browser.oldIE&&e.mobile.browser.oldIE>=8)&&(e.support.boundingRect||null!==e.fn.jquery.match(/1\.[0-7+]\.[0-9+]?/))},e.mobile.ajaxBlacklist=t.blackberry&&!t.WebKitPoint||g||u,u&&e(function(){e("head link[rel='stylesheet']").attr("rel","alternate stylesheet").attr("rel","stylesheet")}),e.support.boxShadow||e("html").addClass("ui-noboxshadow")}(e),function(e,t){var i,n=e.mobile.window,s=function(){};e.event.special.beforenavigate={setup:function(){n.on("navigate",s)},teardown:function(){n.off("navigate",s)}},e.event.special.navigate=i={bound:!1,pushStateEnabled:!0,originalEventName:t,isPushStateEnabled:function(){return e.support.pushState&&e.mobile.pushStateEnabled===!0&&this.isHashChangeEnabled()},isHashChangeEnabled:function(){return e.mobile.hashListeningEnabled===!0},popstate:function(t){var i=new e.Event("navigate"),s=new e.Event("beforenavigate"),o=t.originalEvent.state||{};s.originalEvent=t,n.trigger(s),s.isDefaultPrevented()||(t.historyState&&e.extend(o,t.historyState),i.originalEvent=t,setTimeout(function(){n.trigger(i,{state:o})},0))},hashchange:function(t){var i=new e.Event("navigate"),s=new e.Event("beforenavigate");s.originalEvent=t,n.trigger(s),s.isDefaultPrevented()||(i.originalEvent=t,n.trigger(i,{state:t.hashchangeState||{}}))},setup:function(){i.bound||(i.bound=!0,i.isPushStateEnabled()?(i.originalEventName="popstate",n.bind("popstate.navigate",i.popstate)):i.isHashChangeEnabled()&&(i.originalEventName="hashchange",n.bind("hashchange.navigate",i.hashchange)))}}}(e),function(e){e.event.special.throttledresize={setup:function(){e(this).bind("resize",o)},teardown:function(){e(this).unbind("resize",o)}};var t,i,n,s=250,o=function(){i=(new Date).getTime(),n=i-a,n>=s?(a=i,e(this).trigger("throttledresize")):(t&&clearTimeout(t),t=setTimeout(o,s-n))},a=0}(e),function(e,t){function n(){var e=s();e!==o&&(o=e,u.trigger(d))}var s,o,a,r,l,h,c,u=e(t),d="orientationchange",p={0:!0,180:!0};e.support.orientation&&(l=t.innerWidth||u.width(),h=t.innerHeight||u.height(),c=50,a=l>h&&l-h>c,r=p[t.orientation],(a&&r||!a&&!r)&&(p={"-90":!0,90:!0})),e.event.special.orientationchange=e.extend({},e.event.special.orientationchange,{setup:function(){return e.support.orientation&&!e.event.special.orientationchange.disabled?!1:(o=s(),void u.bind("throttledresize",n))},teardown:function(){return e.support.orientation&&!e.event.special.orientationchange.disabled?!1:void u.unbind("throttledresize",n)},add:function(e){var t=e.handler;e.handler=function(e){return e.orientation=s(),t.apply(this,arguments)}}}),e.event.special.orientationchange.orientation=s=function(){var n=!0,s=i.documentElement;return n=e.support.orientation?p[t.orientation]:s&&s.clientWidth/s.clientHeight<1.1,n?"portrait":"landscape"},e.fn[d]=function(e){return e?this.bind(d,e):this.trigger(d)},e.attrFn&&(e.attrFn[d]=!0)}(e,this),function(e,t,i,n){function s(e){for(;e&&"undefined"!=typeof e.originalEvent;)e=e.originalEvent;return e}function o(t,i){var o,a,r,l,h,c,u,d,p,m=t.type;if(t=e.Event(t),t.type=i,o=t.originalEvent,a=e.event.props,m.search(/^(mouse|click)/)>-1&&(a=B),o)for(u=a.length,l;u;)l=a[--u],t[l]=o[l];if(m.search(/mouse(down|up)|click/)>-1&&!t.which&&(t.which=1),-1!==m.search(/^touch/)&&(r=s(o),m=r.touches,h=r.changedTouches,c=m&&m.length?m[0]:h&&h.length?h[0]:n))for(d=0,p=E.length;p>d;d++)l=E[d],t[l]=c[l];return t}function a(t){for(var i,n,s={};t;){i=e.data(t,k);for(n in i)i[n]&&(s[n]=s.hasVirtualBinding=!0);t=t.parentNode}return s}function r(t,i){for(var n;t;){if(n=e.data(t,k),n&&(!i||n[i]))return t;t=t.parentNode}return null}function l(){q=!1}function h(){q=!0}function c(){z=0,H.length=0,F=!1,h()}function u(){l()}function d(){p(),O=setTimeout(function(){O=0,c()},e.vmouse.resetTimerDuration)}function p(){O&&(clearTimeout(O),O=0)}function m(t,i,n){var s;return(n&&n[t]||!n&&r(i.target,t))&&(s=o(i,t),e(i.target).trigger(s)),s}function f(t){var i,n=e.data(t.target,P);F||z&&z===n||(i=m("v"+t.type,t),i&&(i.isDefaultPrevented()&&t.preventDefault(),i.isPropagationStopped()&&t.stopPropagation(),i.isImmediatePropagationStopped()&&t.stopImmediatePropagation()))}function g(t){var i,n,o,r=s(t).touches;r&&1===r.length&&(i=t.target,n=a(i),n.hasVirtualBinding&&(z=M++,e.data(i,P,z),p(),u(),L=!1,o=s(t).touches[0],A=o.pageX,N=o.pageY,m("vmouseover",t,n),m("vmousedown",t,n)))}function b(e){q||(L||m("vmousecancel",e,a(e.target)),L=!0,d())}function v(t){if(!q){var i=s(t).touches[0],n=L,o=e.vmouse.moveDistanceThreshold,r=a(t.target);L=L||Math.abs(i.pageX-A)>o||Math.abs(i.pageY-N)>o,L&&!n&&m("vmousecancel",t,r),m("vmousemove",t,r),d()}}function _(e){if(!q){h();var t,i,n=a(e.target);m("vmouseup",e,n),L||(t=m("vclick",e,n),t&&t.isDefaultPrevented()&&(i=s(e).changedTouches[0],H.push({touchID:z,x:i.clientX,y:i.clientY}),F=!0)),m("vmouseout",e,n),L=!1,d()}}function C(t){var i,n=e.data(t,k);if(n)for(i in n)if(n[i])return!0;return!1}function w(){}function y(t){var i=t.substr(1);return{setup:function(){C(this)||e.data(this,k,{});var n=e.data(this,k);n[t]=!0,I[t]=(I[t]||0)+1,1===I[t]&&U.bind(i,f),e(this).bind(i,w),j&&(I.touchstart=(I.touchstart||0)+1,1===I.touchstart&&U.bind("touchstart",g).bind("touchend",_).bind("touchmove",v).bind("scroll",b))},teardown:function(){--I[t],I[t]||U.unbind(i,f),j&&(--I.touchstart,I.touchstart||U.unbind("touchstart",g).unbind("touchmove",v).unbind("touchend",_).unbind("scroll",b));var n=e(this),s=e.data(this,k);s&&(s[t]=!1),n.unbind(i,w),C(this)||n.removeData(k)}}}var x,T,k="virtualMouseBindings",P="virtualTouchID",D="vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel".split(" "),E="clientX clientY pageX pageY screenX screenY".split(" "),S=e.event.mouseHooks?e.event.mouseHooks.props:[],B=e.event.props.concat(S),I={},O=0,A=0,N=0,L=!1,H=[],F=!1,q=!1,j="addEventListener"in i,U=e(i),M=1,z=0;for(e.vmouse={moveDistanceThreshold:10,clickDistanceThreshold:10,resetTimerDuration:1500},T=0;T<D.length;T++)e.event.special[D[T]]=y(D[T]);j&&i.addEventListener("click",function(t){var i,n,s,o,a,r,l=H.length,h=t.target;if(l)for(i=t.clientX,n=t.clientY,x=e.vmouse.clickDistanceThreshold,s=h;s;){for(o=0;l>o;o++)if(a=H[o],r=0,s===h&&Math.abs(a.x-i)<x&&Math.abs(a.y-n)<x||e.data(s,P)===a.touchID)return t.preventDefault(),void t.stopPropagation();s=s.parentNode}},!0)}(e,t,i),function(e,t,n){function s(t,i,s,o){var a=s.type;s.type=i,o?e.event.trigger(s,n,t):e.event.dispatch.call(t,s),s.type=a}var o=e(i),a=e.mobile.support.touch,r="touchmove scroll",l=a?"touchstart":"mousedown",h=a?"touchend":"mouseup",c=a?"touchmove":"mousemove";e.each("touchstart touchmove touchend tap taphold swipe swipeleft swiperight scrollstart scrollstop".split(" "),function(t,i){e.fn[i]=function(e){return e?this.bind(i,e):this.trigger(i)},e.attrFn&&(e.attrFn[i]=!0)}),e.event.special.scrollstart={enabled:!0,setup:function(){function t(e,t){i=t,s(o,i?"scrollstart":"scrollstop",e)}var i,n,o=this,a=e(o);a.bind(r,function(s){e.event.special.scrollstart.enabled&&(i||t(s,!0),clearTimeout(n),n=setTimeout(function(){t(s,!1)},50))})},teardown:function(){e(this).unbind(r)}},e.event.special.tap={tapholdThreshold:750,emitTapOnTaphold:!0,setup:function(){var t=this,i=e(t),n=!1;i.bind("vmousedown",function(a){function r(){clearTimeout(c)}function l(){r(),i.unbind("vclick",h).unbind("vmouseup",r),o.unbind("vmousecancel",l)}function h(e){l(),n||u!==e.target?n&&e.preventDefault():s(t,"tap",e)}if(n=!1,a.which&&1!==a.which)return!1;var c,u=a.target;i.bind("vmouseup",r).bind("vclick",h),o.bind("vmousecancel",l),c=setTimeout(function(){e.event.special.tap.emitTapOnTaphold||(n=!0),s(t,"taphold",e.Event("taphold",{target:u}))},e.event.special.tap.tapholdThreshold)})},teardown:function(){e(this).unbind("vmousedown").unbind("vclick").unbind("vmouseup"),o.unbind("vmousecancel")}},e.event.special.swipe={scrollSupressionThreshold:30,durationThreshold:1e3,horizontalDistanceThreshold:30,verticalDistanceThreshold:30,getLocation:function(e){var i=t.pageXOffset,n=t.pageYOffset,s=e.clientX,o=e.clientY;return 0===e.pageY&&Math.floor(o)>Math.floor(e.pageY)||0===e.pageX&&Math.floor(s)>Math.floor(e.pageX)?(s-=i,o-=n):(o<e.pageY-n||s<e.pageX-i)&&(s=e.pageX-i,o=e.pageY-n),{x:s,y:o}},start:function(t){var i=t.originalEvent.touches?t.originalEvent.touches[0]:t,n=e.event.special.swipe.getLocation(i);return{time:(new Date).getTime(),coords:[n.x,n.y],origin:e(t.target)}},stop:function(t){var i=t.originalEvent.touches?t.originalEvent.touches[0]:t,n=e.event.special.swipe.getLocation(i);return{time:(new Date).getTime(),coords:[n.x,n.y]}},handleSwipe:function(t,i,n,o){if(i.time-t.time<e.event.special.swipe.durationThreshold&&Math.abs(t.coords[0]-i.coords[0])>e.event.special.swipe.horizontalDistanceThreshold&&Math.abs(t.coords[1]-i.coords[1])<e.event.special.swipe.verticalDistanceThreshold){var a=t.coords[0]>i.coords[0]?"swipeleft":"swiperight";return s(n,"swipe",e.Event("swipe",{target:o,swipestart:t,swipestop:i}),!0),s(n,a,e.Event(a,{target:o,swipestart:t,swipestop:i}),!0),!0}return!1},eventInProgress:!1,setup:function(){var t,i=this,n=e(i),s={};t=e.data(this,"mobile-events"),t||(t={length:0},e.data(this,"mobile-events",t)),t.length++,t.swipe=s,s.start=function(t){if(!e.event.special.swipe.eventInProgress){e.event.special.swipe.eventInProgress=!0;var n,a=e.event.special.swipe.start(t),r=t.target,l=!1;s.move=function(t){a&&!t.isDefaultPrevented()&&(n=e.event.special.swipe.stop(t),l||(l=e.event.special.swipe.handleSwipe(a,n,i,r),l&&(e.event.special.swipe.eventInProgress=!1)),Math.abs(a.coords[0]-n.coords[0])>e.event.special.swipe.scrollSupressionThreshold&&t.preventDefault())},s.stop=function(){l=!0,e.event.special.swipe.eventInProgress=!1,o.off(c,s.move),s.move=null},o.on(c,s.move).one(h,s.stop)}},n.on(l,s.start)},teardown:function(){var t,i;t=e.data(this,"mobile-events"),t&&(i=t.swipe,delete t.swipe,t.length--,0===t.length&&e.removeData(this,"mobile-events")),i&&(i.start&&e(this).off(l,i.start),i.move&&o.off(c,i.move),i.stop&&o.off(h,i.stop))}},e.each({scrollstop:"scrollstart",taphold:"tap",swipeleft:"swipe.left",swiperight:"swipe.right"},function(t,i){e.event.special[t]={setup:function(){e(this).bind(i,e.noop)},teardown:function(){e(this).unbind(i)}}})}(e,this),function(e,t){var n={animation:{},transition:{}},s=i.createElement("a"),o=["","webkit-","moz-","o-"];e.each(["animation","transition"],function(i,a){var r=0===i?a+"-name":a;e.each(o,function(i,o){return s.style[e.camelCase(o+r)]!==t?(n[a].prefix=o,!1):void 0}),n[a].duration=e.camelCase(n[a].prefix+a+"-duration"),n[a].event=e.camelCase(n[a].prefix+a+"-end"),""===n[a].prefix&&(n[a].event=n[a].event.toLowerCase())}),e.support.cssTransitions=n.transition.prefix!==t,e.support.cssAnimations=n.animation.prefix!==t,e(s).remove(),e.fn.animationComplete=function(s,o,a){var r,l,h=this,c=function(){clearTimeout(r),s.apply(this,arguments)},u=o&&"animation"!==o?"transition":"animation";return e.support.cssTransitions&&"transition"===u||e.support.cssAnimations&&"animation"===u?(a===t&&(e(this).context!==i&&(l=3e3*parseFloat(e(this).css(n[u].duration))),(0===l||l===t||isNaN(l))&&(l=e.fn.animationComplete.defaultDuration)),r=setTimeout(function(){e(h).off(n[u].event,c),s.apply(h)},l),e(this).one(n[u].event,c)):(setTimeout(e.proxy(s,this),0),e(this))},e.fn.animationComplete.defaultDuration=1e3}(e),function(e,t){function i(e,t){var i=t?t:[];return i.push("ui-btn"),e.theme&&i.push("ui-btn-"+e.theme),e.icon&&(i=i.concat(["ui-icon-"+e.icon,"ui-btn-icon-"+e.iconpos]),e.iconshadow&&i.push("ui-shadow-icon")),e.inline&&i.push("ui-btn-inline"),e.shadow&&i.push("ui-shadow"),e.corners&&i.push("ui-corner-all"),e.mini&&i.push("ui-mini"),i}function n(e){var i,n,s,a=!1,r=!0,l={icon:"",inline:!1,shadow:!1,corners:!1,iconshadow:!1,mini:!1},h=[];for(e=e.split(" "),i=0;i<e.length;i++)s=!0,n=o[e[i]],n!==t?(s=!1,l[n]=!0):0===e[i].indexOf("ui-btn-icon-")?(s=!1,r=!1,l.iconpos=e[i].substring(12)):0===e[i].indexOf("ui-icon-")?(s=!1,l.icon=e[i].substring(8)):0===e[i].indexOf("ui-btn-")&&8===e[i].length?(s=!1,l.theme=e[i].substring(7)):"ui-btn"===e[i]&&(s=!1,a=!0),s&&h.push(e[i]);return r&&(l.icon=""),{options:l,unknownClasses:h,alreadyEnhanced:a}}function s(e){return"-"+e.toLowerCase()}var o={"ui-shadow":"shadow","ui-corner-all":"corners","ui-btn-inline":"inline","ui-shadow-icon":"iconshadow","ui-mini":"mini"},a=function(){var i=e.mobile.getAttribute.apply(this,arguments);return null==i?t:i},r=/[A-Z]/g;e.fn.buttonMarkup=function(o,l){var h,c,u,d,p,m=e.fn.buttonMarkup.defaults;for(h=0;h<this.length;h++){if(u=this[h],c=l?{alreadyEnhanced:!1,unknownClasses:[]}:n(u.className),d=e.extend({},c.alreadyEnhanced?c.options:{},o),!c.alreadyEnhanced)for(p in m)d[p]===t&&(d[p]=a(u,p.replace(r,s)));u.className=i(e.extend({},m,d),c.unknownClasses).join(" "),"button"!==u.tagName.toLowerCase()&&u.setAttribute("role","button")}return this},e.fn.buttonMarkup.defaults={icon:"",iconpos:"left",theme:null,inline:!1,shadow:!0,corners:!0,iconshadow:!1,mini:!1},e.extend(e.fn.buttonMarkup,{initSelector:"a:jqmData(role='button'), .ui-bar > a, .ui-bar > :jqmData(role='controlgroup') > a, button:not(:jqmData(role='navbar') button)"})}(e),function(e,t){var i=0,n=Array.prototype.slice,s=e.cleanData;e.cleanData=function(t){for(var i,n=0;null!=(i=t[n]);n++)try{e(i).triggerHandler("remove")}catch(o){}s(t)},e.widget=function(t,i,n){var s,o,a,r,l={},h=t.split(".")[0];return t=t.split(".")[1],s=h+"-"+t,n||(n=i,i=e.Widget),e.expr[":"][s.toLowerCase()]=function(t){return!!e.data(t,s)},e[h]=e[h]||{},o=e[h][t],a=e[h][t]=function(e,t){return this._createWidget?void(arguments.length&&this._createWidget(e,t)):new a(e,t)},e.extend(a,o,{version:n.version,_proto:e.extend({},n),_childConstructors:[]}),r=new i,r.options=e.widget.extend({},r.options),e.each(n,function(t,n){return e.isFunction(n)?void(l[t]=function(){var e=function(){return i.prototype[t].apply(this,arguments)},s=function(e){return i.prototype[t].apply(this,e)};return function(){var t,i=this._super,o=this._superApply;return this._super=e,this._superApply=s,t=n.apply(this,arguments),this._super=i,this._superApply=o,t}}()):void(l[t]=n)}),a.prototype=e.widget.extend(r,{widgetEventPrefix:o?r.widgetEventPrefix||t:t},l,{constructor:a,namespace:h,widgetName:t,widgetFullName:s}),o?(e.each(o._childConstructors,function(t,i){var n=i.prototype;e.widget(n.namespace+"."+n.widgetName,a,i._proto)}),delete o._childConstructors):i._childConstructors.push(a),e.widget.bridge(t,a),a},e.widget.extend=function(i){for(var s,o,a=n.call(arguments,1),r=0,l=a.length;l>r;r++)for(s in a[r])o=a[r][s],a[r].hasOwnProperty(s)&&o!==t&&(i[s]=e.isPlainObject(o)?e.isPlainObject(i[s])?e.widget.extend({},i[s],o):e.widget.extend({},o):o);return i},e.widget.bridge=function(i,s){var o=s.prototype.widgetFullName||i;e.fn[i]=function(a){var r="string"==typeof a,l=n.call(arguments,1),h=this;return a=!r&&l.length?e.widget.extend.apply(null,[a].concat(l)):a,this.each(r?function(){var n,s=e.data(this,o);return"instance"===a?(h=s,!1):s?e.isFunction(s[a])&&"_"!==a.charAt(0)?(n=s[a].apply(s,l),n!==s&&n!==t?(h=n&&n.jquery?h.pushStack(n.get()):n,!1):void 0):e.error("no such method '"+a+"' for "+i+" widget instance"):e.error("cannot call methods on "+i+" prior to initialization; attempted to call method '"+a+"'")}:function(){var t=e.data(this,o);t?t.option(a||{})._init():e.data(this,o,new s(a,this))}),h}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,n){n=e(n||this.defaultElement||this)[0],this.element=e(n),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this.bindings=e(),this.hoverable=e(),this.focusable=e(),n!==this&&(e.data(n,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===n&&this.destroy()}}),this.document=e(n.style?n.ownerDocument:n.document||n),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(i,n){var s,o,a,r=i;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof i)if(r={},s=i.split("."),i=s.shift(),s.length){for(o=r[i]=e.widget.extend({},this.options[i]),a=0;a<s.length-1;a++)o[s[a]]=o[s[a]]||{},o=o[s[a]];
|
|
if(i=s.pop(),n===t)return o[i]===t?null:o[i];o[i]=n}else{if(n===t)return this.options[i]===t?null:this.options[i];r[i]=n}return this._setOptions(r),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!t),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(t,i,n){var s,o=this;"boolean"!=typeof t&&(n=i,i=t,t=!1),n?(i=s=e(i),this.bindings=this.bindings.add(i)):(n=i,i=this.element,s=this.widget()),e.each(n,function(n,a){function r(){return t||o.options.disabled!==!0&&!e(this).hasClass("ui-state-disabled")?("string"==typeof a?o[a]:a).apply(o,arguments):void 0}"string"!=typeof a&&(r.guid=a.guid=a.guid||r.guid||e.guid++);var l=n.match(/^(\w+)\s*(.*)$/),h=l[1]+o.eventNamespace,c=l[2];c?s.delegate(c,h,r):i.bind(h,r)})},_off:function(e,t){t=(t||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.unbind(t).undelegate(t)},_delay:function(e,t){function i(){return("string"==typeof e?n[e]:e).apply(n,arguments)}var n=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,i,n){var s,o,a=this.options[t];if(n=n||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(s in o)s in i||(i[s]=o[s]);return this.element.trigger(i,n),!(e.isFunction(a)&&a.apply(this.element[0],[i].concat(n))===!1||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(n,s,o){"string"==typeof s&&(s={effect:s});var a,r=s?s===!0||"number"==typeof s?i:s.effect||i:t;s=s||{},"number"==typeof s&&(s={duration:s}),a=!e.isEmptyObject(s),s.complete=o,s.delay&&n.delay(s.delay),a&&e.effects&&e.effects.effect[r]?n[t](s):r!==t&&n[r]?n[r](s.duration,s.easing,o):n.queue(function(i){e(this)[t](),o&&o.call(n[0]),i()})}})}(e),function(e){var t=/[A-Z]/g,i=function(e){return"-"+e.toLowerCase()};e.extend(e.Widget.prototype,{_getCreateOptions:function(){var n,s,o=this.element[0],a={};if(!e.mobile.getAttribute(o,"defaults"))for(n in this.options)s=e.mobile.getAttribute(o,n.replace(t,i)),null!=s&&(a[n]=s);return a}}),e.mobile.widget=e.Widget}(e),function(e,t){e.mobile.widgets={};var i=e.widget,n=e.mobile.keepNative;e.widget=function(i){return function(){var n=i.apply(this,arguments),s=n.prototype.widgetName;return n.initSelector=n.prototype.initSelector!==t?n.prototype.initSelector:":jqmData(role='"+s+"')",e.mobile.widgets[s]=n,n}}(e.widget),e.extend(e.widget,i),e.mobile.document.on("create",function(t){e(t.target).enhanceWithin()}),e.widget("mobile.page",{options:{theme:"a",domCache:!1,keepNativeDefault:e.mobile.keepNative,contentTheme:null,enhanced:!1},_createWidget:function(){e.Widget.prototype._createWidget.apply(this,arguments),this._trigger("init")},_create:function(){return this._trigger("beforecreate")===!1?!1:(this.options.enhanced||this._enhance(),this._on(this.element,{pagebeforehide:"removeContainerBackground",pagebeforeshow:"_handlePageBeforeShow"}),this.element.enhanceWithin(),void("dialog"===e.mobile.getAttribute(this.element[0],"role")&&e.mobile.dialog&&this.element.dialog()))},_enhance:function(){var i="data-"+e.mobile.ns,n=this;this.options.role&&this.element.attr("data-"+e.mobile.ns+"role",this.options.role),this.element.attr("tabindex","0").addClass("ui-page ui-page-theme-"+this.options.theme),this.element.find("["+i+"role='content']").each(function(){var s=e(this),o=this.getAttribute(i+"theme")||t;n.options.contentTheme=o||n.options.contentTheme||n.options.dialog&&n.options.theme||"dialog"===n.element.jqmData("role")&&n.options.theme,s.addClass("ui-content"),n.options.contentTheme&&s.addClass("ui-body-"+n.options.contentTheme),s.attr("role","main").addClass("ui-content")})},bindRemove:function(t){var i=this.element;!i.data("mobile-page").options.domCache&&i.is(":jqmData(external-page='true')")&&i.bind("pagehide.remove",t||function(t,i){if(!i.samePage){var n=e(this),s=new e.Event("pageremove");n.trigger(s),s.isDefaultPrevented()||n.removeWithDependents()}})},_setOptions:function(i){i.theme!==t&&this.element.removeClass("ui-page-theme-"+this.options.theme).addClass("ui-page-theme-"+i.theme),i.contentTheme!==t&&this.element.find("[data-"+e.mobile.ns+"='content']").removeClass("ui-body-"+this.options.contentTheme).addClass("ui-body-"+i.contentTheme)},_handlePageBeforeShow:function(){this.setContainerBackground()},removeContainerBackground:function(){this.element.closest(":mobile-pagecontainer").pagecontainer({theme:"none"})},setContainerBackground:function(e){this.element.parent().pagecontainer({theme:e||this.options.theme})},keepNativeSelector:function(){var t=this.options,i=e.trim(t.keepNative||""),s=e.trim(e.mobile.keepNative),o=e.trim(t.keepNativeDefault),a=n===s?"":s,r=""===a?o:"";return(i?[i]:[]).concat(a?[a]:[]).concat(r?[r]:[]).join(", ")}})}(e),function(e){e.mobile.degradeInputs={color:!1,date:!1,datetime:!1,"datetime-local":!1,email:!1,month:!1,number:!1,range:"number",search:"text",tel:!1,time:!1,url:!1,week:!1},e.mobile.page.prototype.options.degradeInputs=e.mobile.degradeInputs,e.mobile.degradeInputsWithin=function(t){t=e(t),t.find("input").not(e.mobile.page.prototype.keepNativeSelector()).each(function(){var t,i,n,s,o=e(this),a=this.getAttribute("type"),r=e.mobile.degradeInputs[a]||"text";e.mobile.degradeInputs[a]&&(t=e("<div>").html(o.clone()).html(),i=t.indexOf(" type=")>-1,n=i?/\s+type=["']?\w+['"]?/:/\/?>/,s=' type="'+r+'" data-'+e.mobile.ns+'type="'+a+'"'+(i?"":">"),o.replaceWith(t.replace(n,s)))})}}(e),function(e){e.fn.fieldcontain=function(){return this.addClass("ui-field-contain")}}(e),function(e){e.fn.grid=function(t){return this.each(function(){var i,n,s=e(this),o=e.extend({grid:null},t),a=s.children(),r={solo:1,a:2,b:3,c:4,d:5},l=o.grid;if(!l)if(a.length<=5)for(n in r)r[n]===a.length&&(l=n);else l="a",s.addClass("ui-grid-duo");i=r[l],s.addClass("ui-grid-"+l),a.filter(":nth-child("+i+"n+1)").addClass("ui-block-a"),i>1&&a.filter(":nth-child("+i+"n+2)").addClass("ui-block-b"),i>2&&a.filter(":nth-child("+i+"n+3)").addClass("ui-block-c"),i>3&&a.filter(":nth-child("+i+"n+4)").addClass("ui-block-d"),i>4&&a.filter(":nth-child("+i+"n+5)").addClass("ui-block-e")})}}(e),function(e,i){var n,s,o="&ui-state=dialog";e.mobile.path=n={uiStateKey:"&ui-state",urlParseRE:/^\s*(((([^:\/#\?]+:)?(?:(\/\/)((?:(([^:@\/#\?]+)(?:\:([^:@\/#\?]+))?)@)?(([^:\/#\?\]\[]+|\[[^\/\]@#?]+\])(?:\:([0-9]+))?))?)?)?((\/?(?:[^\/\?#]+\/+)*)([^\?#]*)))?(\?[^#]+)?)(#.*)?/,getLocation:function(e){var t=this.parseUrl(e||location.href),i=e?t:location,n=t.hash;return n="#"===n?"":n,i.protocol+t.doubleSlash+i.host+(""!==i.protocol&&"/"!==i.pathname.substring(0,1)?"/":"")+i.pathname+i.search+n},getDocumentUrl:function(t){return t?e.extend({},n.documentUrl):n.documentUrl.href},parseLocation:function(){return this.parseUrl(this.getLocation())},parseUrl:function(t){if("object"===e.type(t))return t;var i=n.urlParseRE.exec(t||"")||[];return{href:i[0]||"",hrefNoHash:i[1]||"",hrefNoSearch:i[2]||"",domain:i[3]||"",protocol:i[4]||"",doubleSlash:i[5]||"",authority:i[6]||"",username:i[8]||"",password:i[9]||"",host:i[10]||"",hostname:i[11]||"",port:i[12]||"",pathname:i[13]||"",directory:i[14]||"",filename:i[15]||"",search:i[16]||"",hash:i[17]||""}},makePathAbsolute:function(e,t){var i,n,s,o;if(e&&"/"===e.charAt(0))return e;for(e=e||"",t=t?t.replace(/^\/|(\/[^\/]*|[^\/]+)$/g,""):"",i=t?t.split("/"):[],n=e.split("/"),s=0;s<n.length;s++)switch(o=n[s]){case".":break;case"..":i.length&&i.pop();break;default:i.push(o)}return"/"+i.join("/")},isSameDomain:function(e,t){return n.parseUrl(e).domain.toLowerCase()===n.parseUrl(t).domain.toLowerCase()},isRelativeUrl:function(e){return""===n.parseUrl(e).protocol},isAbsoluteUrl:function(e){return""!==n.parseUrl(e).protocol},makeUrlAbsolute:function(e,t){if(!n.isRelativeUrl(e))return e;t===i&&(t=this.documentBase);var s=n.parseUrl(e),o=n.parseUrl(t),a=s.protocol||o.protocol,r=s.protocol?s.doubleSlash:s.doubleSlash||o.doubleSlash,l=s.authority||o.authority,h=""!==s.pathname,c=n.makePathAbsolute(s.pathname||o.filename,o.pathname),u=s.search||!h&&o.search||"",d=s.hash;return a+r+l+c+u+d},addSearchParams:function(t,i){var s=n.parseUrl(t),o="object"==typeof i?e.param(i):i,a=s.search||"?";return s.hrefNoSearch+a+("?"!==a.charAt(a.length-1)?"&":"")+o+(s.hash||"")},convertUrlToDataUrl:function(e){var i=e,s=n.parseUrl(e);return n.isEmbeddedPage(s)?i=s.hash.split(o)[0].replace(/^#/,"").replace(/\?.*$/,""):n.isSameDomain(s,this.documentBase)&&(i=s.hrefNoHash.replace(this.documentBase.domain,"").split(o)[0]),t.decodeURIComponent(i)},get:function(e){return e===i&&(e=n.parseLocation().hash),n.stripHash(e).replace(/[^\/]*\.[^\/*]+$/,"")},set:function(e){location.hash=e},isPath:function(e){return/\//.test(e)},clean:function(e){return e.replace(this.documentBase.domain,"")},stripHash:function(e){return e.replace(/^#/,"")},stripQueryParams:function(e){return e.replace(/\?.*$/,"")},cleanHash:function(e){return n.stripHash(e.replace(/\?.*$/,"").replace(o,""))},isHashValid:function(e){return/^#[^#]+$/.test(e)},isExternal:function(e){var t=n.parseUrl(e);return!(!t.protocol||t.domain.toLowerCase()===this.documentUrl.domain.toLowerCase())},hasProtocol:function(e){return/^(:?\w+:)/.test(e)},isEmbeddedPage:function(e){var t=n.parseUrl(e);return""!==t.protocol?!this.isPath(t.hash)&&t.hash&&(t.hrefNoHash===this.documentUrl.hrefNoHash||this.documentBaseDiffers&&t.hrefNoHash===this.documentBase.hrefNoHash):/^#/.test(t.href)},squash:function(e,t){var i,s,o,a,r,l=this.isPath(e),h=this.parseUrl(e),c=h.hash,u="";return t||(l?t=n.getLocation():(r=n.getDocumentUrl(!0),t=n.isPath(r.hash)?n.squash(r.href):r.href)),s=l?n.stripHash(e):e,s=n.isPath(h.hash)?n.stripHash(h.hash):s,a=s.indexOf(this.uiStateKey),a>-1&&(u=s.slice(a),s=s.slice(0,a)),i=n.makeUrlAbsolute(s,t),o=this.parseUrl(i).search,l?((n.isPath(c)||0===c.replace("#","").indexOf(this.uiStateKey))&&(c=""),u&&-1===c.indexOf(this.uiStateKey)&&(c+=u),-1===c.indexOf("#")&&""!==c&&(c="#"+c),i=n.parseUrl(i),i=i.protocol+i.doubleSlash+i.host+i.pathname+o+c):i+=i.indexOf("#")>-1?u:"#"+u,i},isPreservableHash:function(e){return 0===e.replace("#","").indexOf(this.uiStateKey)},hashToSelector:function(e){var t="#"===e.substring(0,1);return t&&(e=e.substring(1)),(t?"#":"")+e.replace(/([!"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g,"\\$1")},getFilePath:function(e){return e&&e.split(o)[0]},isFirstPageUrl:function(t){var s=n.parseUrl(n.makeUrlAbsolute(t,this.documentBase)),o=s.hrefNoHash===this.documentUrl.hrefNoHash||this.documentBaseDiffers&&s.hrefNoHash===this.documentBase.hrefNoHash,a=e.mobile.firstPage,r=a&&a[0]?a[0].id:i;return o&&(!s.hash||"#"===s.hash||r&&s.hash.replace(/^#/,"")===r)},isPermittedCrossDomainRequest:function(t,i){return e.mobile.allowCrossDomainPages&&("file:"===t.protocol||"content:"===t.protocol)&&-1!==i.search(/^https?:/)}},n.documentUrl=n.parseLocation(),s=e("head").find("base"),n.documentBase=s.length?n.parseUrl(n.makeUrlAbsolute(s.attr("href"),n.documentUrl.href)):n.documentUrl,n.documentBaseDiffers=n.documentUrl.hrefNoHash!==n.documentBase.hrefNoHash,n.getDocumentBase=function(t){return t?e.extend({},n.documentBase):n.documentBase.href},e.extend(e.mobile,{getDocumentUrl:n.getDocumentUrl,getDocumentBase:n.getDocumentBase})}(e),function(e,t){e.mobile.History=function(e,t){this.stack=e||[],this.activeIndex=t||0},e.extend(e.mobile.History.prototype,{getActive:function(){return this.stack[this.activeIndex]},getLast:function(){return this.stack[this.previousIndex]},getNext:function(){return this.stack[this.activeIndex+1]},getPrev:function(){return this.stack[this.activeIndex-1]},add:function(e,t){t=t||{},this.getNext()&&this.clearForward(),t.hash&&-1===t.hash.indexOf("#")&&(t.hash="#"+t.hash),t.url=e,this.stack.push(t),this.activeIndex=this.stack.length-1},clearForward:function(){this.stack=this.stack.slice(0,this.activeIndex+1)},find:function(e,t,i){t=t||this.stack;var n,s,o,a=t.length;for(s=0;a>s;s++)if(n=t[s],(decodeURIComponent(e)===decodeURIComponent(n.url)||decodeURIComponent(e)===decodeURIComponent(n.hash))&&(o=s,i))return o;return o},closest:function(e){var i,n=this.activeIndex;return i=this.find(e,this.stack.slice(0,n)),i===t&&(i=this.find(e,this.stack.slice(n),!0),i=i===t?i:i+n),i},direct:function(i){var n=this.closest(i.url),s=this.activeIndex;n!==t&&(this.activeIndex=n,this.previousIndex=s),s>n?(i.present||i.back||e.noop)(this.getActive(),"back"):n>s?(i.present||i.forward||e.noop)(this.getActive(),"forward"):n===t&&i.missing&&i.missing(this.getActive())}})}(e),function(e){var n=e.mobile.path,s=location.href;e.mobile.Navigator=function(t){this.history=t,this.ignoreInitialHashChange=!0,e.mobile.window.bind({"popstate.history":e.proxy(this.popstate,this),"hashchange.history":e.proxy(this.hashchange,this)})},e.extend(e.mobile.Navigator.prototype,{squash:function(s,o){var a,r,l=n.isPath(s)?n.stripHash(s):s;return r=n.squash(s),a=e.extend({hash:l,url:r},o),t.history.replaceState(a,a.title||i.title,r),a},hash:function(e,t){var i,s,o,a;return i=n.parseUrl(e),s=n.parseLocation(),s.pathname+s.search===i.pathname+i.search?o=i.hash?i.hash:i.pathname+i.search:n.isPath(e)?(a=n.parseUrl(t),o=a.pathname+a.search+(n.isPreservableHash(a.hash)?a.hash.replace("#",""):"")):o=e,o},go:function(s,o,a){var r,l,h,c,u=e.event.special.navigate.isPushStateEnabled();l=n.squash(s),h=this.hash(s,l),a&&h!==n.stripHash(n.parseLocation().hash)&&(this.preventNextHashChange=a),this.preventHashAssignPopState=!0,t.location.hash=h,this.preventHashAssignPopState=!1,r=e.extend({url:l,hash:h,title:i.title},o),u&&(c=new e.Event("popstate"),c.originalEvent={type:"popstate",state:null},this.squash(s,r),a||(this.ignorePopState=!0,e.mobile.window.trigger(c))),this.history.add(r.url,r)},popstate:function(t){var i,o;if(e.event.special.navigate.isPushStateEnabled())return this.preventHashAssignPopState?(this.preventHashAssignPopState=!1,void t.stopImmediatePropagation()):this.ignorePopState?void(this.ignorePopState=!1):!t.originalEvent.state&&1===this.history.stack.length&&this.ignoreInitialHashChange&&(this.ignoreInitialHashChange=!1,location.href===s)?void t.preventDefault():(i=n.parseLocation().hash,!t.originalEvent.state&&i?(o=this.squash(i),this.history.add(o.url,o),void(t.historyState=o)):void this.history.direct({url:(t.originalEvent.state||{}).url||i,present:function(i,n){t.historyState=e.extend({},i),t.historyState.direction=n}}))},hashchange:function(t){var s,o;if(e.event.special.navigate.isHashChangeEnabled()&&!e.event.special.navigate.isPushStateEnabled()){if(this.preventNextHashChange)return this.preventNextHashChange=!1,void t.stopImmediatePropagation();s=this.history,o=n.parseLocation().hash,this.history.direct({url:o,present:function(i,n){t.hashchangeState=e.extend({},i),t.hashchangeState.direction=n},missing:function(){s.add(o,{hash:o,title:i.title})}})}}})}(e),function(e){e.mobile.navigate=function(t,i,n){e.mobile.navigate.navigator.go(t,i,n)},e.mobile.navigate.history=new e.mobile.History,e.mobile.navigate.navigator=new e.mobile.Navigator(e.mobile.navigate.history);var t=e.mobile.path.parseLocation();e.mobile.navigate.history.add(t.href,{hash:t.hash})}(e),function(e){var t=e("head").children("base"),i={element:t.length?t:e("<base>",{href:e.mobile.path.documentBase.hrefNoHash}).prependTo(e("head")),linkSelector:"[src], link[href], a[rel='external'], :jqmData(ajax='false'), a[target]",set:function(t){e.mobile.dynamicBaseEnabled&&e.support.dynamicBaseTag&&i.element.attr("href",e.mobile.path.makeUrlAbsolute(t,e.mobile.path.documentBase))},rewrite:function(t,n){var s=e.mobile.path.get(t);n.find(i.linkSelector).each(function(t,i){var n=e(i).is("[href]")?"href":e(i).is("[src]")?"src":"action",o=e.mobile.path.parseLocation(),a=e(i).attr(n);a=a.replace(o.protocol+o.doubleSlash+o.host+o.pathname,""),/^(\w+:|#|\/)/.test(a)||e(i).attr(n,s+a)})},reset:function(){i.element.attr("href",e.mobile.path.documentBase.hrefNoSearch)}};e.mobile.base=i}(e),function(e,t){e.mobile.Transition=function(){this.init.apply(this,arguments)},e.extend(e.mobile.Transition.prototype,{toPreClass:" ui-page-pre-in",init:function(t,i,n,s){e.extend(this,{name:t,reverse:i,$to:n,$from:s,deferred:new e.Deferred})},cleanFrom:function(){this.$from.removeClass(e.mobile.activePageClass+" out in reverse "+this.name).height("")},beforeDoneIn:function(){},beforeDoneOut:function(){},beforeStartOut:function(){},doneIn:function(){this.beforeDoneIn(),this.$to.removeClass("out in reverse "+this.name).height(""),this.toggleViewportClass(),e.mobile.window.scrollTop()!==this.toScroll&&this.scrollPage(),this.sequential||this.$to.addClass(e.mobile.activePageClass),this.deferred.resolve(this.name,this.reverse,this.$to,this.$from,!0)},doneOut:function(e,t,i,n){this.beforeDoneOut(),this.startIn(e,t,i,n)},hideIn:function(e){this.$to.css("z-index",-10),e.call(this),this.$to.css("z-index","")},scrollPage:function(){e.event.special.scrollstart.enabled=!1,(e.mobile.hideUrlBar||this.toScroll!==e.mobile.defaultHomeScroll)&&t.scrollTo(0,this.toScroll),setTimeout(function(){e.event.special.scrollstart.enabled=!0},150)},startIn:function(t,i,n,s){this.hideIn(function(){this.$to.addClass(e.mobile.activePageClass+this.toPreClass),s||e.mobile.focusPage(this.$to),this.$to.height(t+this.toScroll),n||this.scrollPage()}),this.$to.removeClass(this.toPreClass).addClass(this.name+" in "+i),n?this.doneIn():this.$to.animationComplete(e.proxy(function(){this.doneIn()},this))},startOut:function(t,i,n){this.beforeStartOut(t,i,n),this.$from.height(t+e.mobile.window.scrollTop()).addClass(this.name+" out"+i)},toggleViewportClass:function(){e.mobile.pageContainer.toggleClass("ui-mobile-viewport-transitioning viewport-"+this.name)},slide:function(t){var i=this;i.reverse?(e(i.$from).show().css("left","0").css("right","0"),t.animate(e(i.$from)[0],{left:"100%",right:"-100%"},{easing:"ease-in-out",duration:800,begin:function(){e(i.$to).show().css("left","-100%").css("right","100%"),t.animate(e(i.$to)[0],{left:"0",right:"0"},{complete:function(){e(i.$from).hide(),i.toggleViewportClass(),i.deferred.resolve(i.name,i.reverse,i.$to,i.$from,!0)},easing:"ease-in-out",duration:800})}})):t.animate(e(i.$from)[0],{left:"-100%",right:"100%"},{easing:"ease-in-out",duration:800,begin:function(){e(i.$to).show().css("left","100%"),t.animate(e(i.$to)[0],{left:"0px"},{complete:function(){e(i.$from).hide(),i.toggleViewportClass(),i.deferred.resolve(i.name,i.reverse,i.$to,i.$from,!0)},easing:"ease-in-out",duration:800})}})},slideUp:function(t){var i=this;i.reverse?(e(i.$to).show(),t.animate(e(i.$from)[0],{top:"100%",bottom:"-100%"},{complete:function(){e(i.$from).hide(),i.toggleViewportClass(),i.deferred.resolve(i.name,i.reverse,i.$to,i.$from,!0)},easing:"ease-in-out",duration:800})):(e(i.$to).show().css("top","100%").css("bottom","-100%"),t.animate(e(i.$to)[0],{top:"0px",bottom:0},{complete:function(){e(i.$from).hide(),i.toggleViewportClass(),i.deferred.resolve(i.name,i.reverse,i.$to,i.$from,!0)},easing:"ease-in-out",duration:800}))},transition:function(){var t,i=this.reverse?" reverse":"",n=e.mobile.getScreenHeight(),s=e.mobile.maxTransitionWidth!==!1&&e.mobile.window.width()>e.mobile.maxTransitionWidth;if(this.toScroll=e.mobile.navigate.history.getActive().lastScroll||e.mobile.defaultHomeScroll,t=!e.support.cssTransitions||!e.support.cssAnimations||s||!this.name||"none"===this.name||Math.max(e.mobile.window.scrollTop(),this.toScroll)>e.mobile.getMaxScrollForTransition(),this.toggleViewportClass(),t)this.$from&&!t?this.startOut(n,i,t):this.doneOut(n,i,t,!0);else{var o=this;require(["jquery","velocity"],function(e,t){"slideup"==o.name?o.slideUp(t):o.slide(t)})}return this.deferred.promise()}})}(e,this),function(e){e.mobile.SerialTransition=function(){this.init.apply(this,arguments)},e.extend(e.mobile.SerialTransition.prototype,e.mobile.Transition.prototype,{sequential:!0,beforeDoneOut:function(){this.$from&&this.cleanFrom()},beforeStartOut:function(t,i,n){this.$from.animationComplete(e.proxy(function(){this.doneOut(t,i,n)},this))}})}(e),function(e){e.mobile.ConcurrentTransition=function(){this.init.apply(this,arguments)},e.extend(e.mobile.ConcurrentTransition.prototype,e.mobile.Transition.prototype,{sequential:!1,beforeDoneIn:function(){this.$from&&this.cleanFrom()},beforeStartOut:function(e,t,i){this.doneOut(e,t,i)}})}(e),function(e){var t=function(){return 3*e.mobile.getScreenHeight()};e.mobile.transitionHandlers={sequential:e.mobile.SerialTransition,simultaneous:e.mobile.ConcurrentTransition},e.mobile.defaultTransitionHandler=e.mobile.transitionHandlers.sequential,e.mobile.transitionFallbacks={},e.mobile._maybeDegradeTransition=function(t){return t&&!e.support.cssTransform3d&&e.mobile.transitionFallbacks[t]&&(t=e.mobile.transitionFallbacks[t]),t},e.mobile.getMaxScrollForTransition=e.mobile.getMaxScrollForTransition||t}(e),function(e,n){e.widget("mobile.pagecontainer",{options:{theme:"a"},initSelector:!1,_create:function(){this._trigger("beforecreate"),this.setLastScrollEnabled=!0,this._on(this.window,{navigate:"_disableRecordScroll",scrollstop:"_delayedRecordScroll"}),this._on(this.window,{navigate:"_filterNavigateEvents"}),this._on({pagechange:"_afterContentChange"}),this.window.one("navigate",e.proxy(function(){this.setLastScrollEnabled=!0},this))},_setOptions:function(e){e.theme!==n&&"none"!==e.theme?this.element.removeClass("ui-overlay-"+this.options.theme).addClass("ui-overlay-"+e.theme):e.theme!==n&&this.element.removeClass("ui-overlay-"+this.options.theme),this._super(e)},_disableRecordScroll:function(){this.setLastScrollEnabled=!1},_enableRecordScroll:function(){this.setLastScrollEnabled=!0},_afterContentChange:function(){this.setLastScrollEnabled=!0,this._off(this.window,"scrollstop"),this._on(this.window,{scrollstop:"_delayedRecordScroll"})},_recordScroll:function(){if(this.setLastScrollEnabled){var e,t,i,n=this._getActiveHistory();n&&(e=this._getScroll(),t=this._getMinScroll(),i=this._getDefaultScroll(),n.lastScroll=t>e?i:e)}},_delayedRecordScroll:function(){setTimeout(e.proxy(this,"_recordScroll"),100)},_getScroll:function(){return this.window.scrollTop()},_getMinScroll:function(){return e.mobile.minScrollBack},_getDefaultScroll:function(){return e.mobile.defaultHomeScroll},_filterNavigateEvents:function(t,i){var n;t.originalEvent&&t.originalEvent.isDefaultPrevented()||(n=t.originalEvent.type.indexOf("hashchange")>-1?i.state.hash:i.state.url,n||(n=this._getHash()),n&&"#"!==n&&0!==n.indexOf("#"+e.mobile.path.uiStateKey)||(n=location.href),this._handleNavigate(n,i.state))},_getHash:function(){return e.mobile.path.parseLocation().hash},getActivePage:function(){return this.activePage},_getInitialContent:function(){return e.mobile.firstPage},_getHistory:function(){return e.mobile.navigate.history},_getActiveHistory:function(){return this._getHistory().getActive()},_getDocumentBase:function(){return e.mobile.path.documentBase},back:function(){this.go(-1)},forward:function(){this.go(1)},go:function(i){if(e.mobile.hashListeningEnabled)t.history.go(i);else{var n=e.mobile.navigate.history.activeIndex,s=n+parseInt(i,10),o=e.mobile.navigate.history.stack[s].url,a=i>=1?"forward":"back";e.mobile.navigate.history.activeIndex=s,e.mobile.navigate.history.previousIndex=n,this.change(o,{direction:a,changeHash:!1,fromHashChange:!0})}},_handleDestination:function(t){var i;return"string"===e.type(t)&&(t=e.mobile.path.stripHash(t)),t&&(i=this._getHistory(),t=e.mobile.path.isPath(t)?t:e.mobile.path.makeUrlAbsolute("#"+t,this._getDocumentBase())),t||this._getInitialContent()},_transitionFromHistory:function(e,t){var i=this._getHistory(),n="back"===e?i.getLast():i.getActive();return n&&n.transition||t},_handleDialog:function(t,i){var n,s,o=this.getActivePage();return o&&!o.data("mobile-dialog")?("back"===i.direction?this.back():this.forward(),!1):(n=i.pageUrl,s=this._getActiveHistory(),e.extend(t,{role:s.role,transition:this._transitionFromHistory(i.direction,t.transition),reverse:"back"===i.direction}),n)},_handleNavigate:function(t,i){var n=e.mobile.path.stripHash(t),s=this._getHistory(),o=0===s.stack.length?"none":this._transitionFromHistory(i.direction),a={changeHash:!1,fromHashChange:!0,reverse:"back"===i.direction};e.extend(a,i,{transition:o}),s.activeIndex>0&&n.indexOf(e.mobile.dialogHashKey)>-1&&(n=this._handleDialog(a,i),n===!1)||this._changeContent(this._handleDestination(n),a)},_changeContent:function(t,i){e.mobile.changePage(t,i)},_getBase:function(){return e.mobile.base},_getNs:function(){return e.mobile.ns},_enhance:function(e,t){return e.page({role:t})},_include:function(e,t){e.appendTo(this.element),this._enhance(e,t.role),e.page("bindRemove")},_find:function(t){var i,n=this._createFileUrl(t),s=this._createDataUrl(t),o=this._getInitialContent();return i=this.element.children("[data-"+this._getNs()+"url='"+e.mobile.path.hashToSelector(s)+"']"),0===i.length&&s&&!e.mobile.path.isPath(s)&&(i=this.element.children(e.mobile.path.hashToSelector("#"+s)).attr("data-"+this._getNs()+"url",s).jqmData("url",s)),0===i.length&&e.mobile.path.isFirstPageUrl(n)&&o&&o.parent().length&&(i=e(o)),i},_getLoader:function(){return e.mobile.loading()},_showLoading:function(t,i,n,s){this._loadMsg||(this._loadMsg=setTimeout(e.proxy(function(){this._getLoader().loader("show",i,n,s),this._loadMsg=0},this),t))},_hideLoading:function(){clearTimeout(this._loadMsg),this._loadMsg=0,this._getLoader().loader("hide")},_showError:function(){this._hideLoading(),this._showLoading(0,e.mobile.pageLoadErrorMessageTheme,e.mobile.pageLoadErrorMessage,!0),setTimeout(e.proxy(this,"_hideLoading"),1500)},_parse:function(t,i){var n,s=e("<div></div>");return s.get(0).innerHTML=t,n=s.find(":jqmData(role='page'), :jqmData(role='dialog')").first(),n.length||(n=e("<div data-"+this._getNs()+"role='page'>"+(t.split(/<\/?body[^>]*>/gim)[1]||"")+"</div>")),n.attr("data-"+this._getNs()+"url",this._createDataUrl(i)).attr("data-"+this._getNs()+"external-page",!0),n},_setLoadedTitle:function(t,i){var n=i.match(/<title[^>]*>([^<]*)/)&&RegExp.$1;n&&!t.jqmData("title")&&(n=e("<div>"+n+"</div>").text(),t.jqmData("title",n))},_isRewritableBaseTag:function(){return e.mobile.dynamicBaseEnabled&&!e.support.dynamicBaseTag},_createDataUrl:function(t){return e.mobile.path.convertUrlToDataUrl(t)},_createFileUrl:function(t){return e.mobile.path.getFilePath(t)},_triggerWithDeprecated:function(t,i,n){var s=e.Event("page"+t),o=e.Event(this.widgetName+t);return(n||this.element).trigger(s,i),this._trigger(t,o,i),{deprecatedEvent:s,event:o}},_loadSuccess:function(t,i,s,o){var a=this._createFileUrl(t);return e.proxy(function(r,l,h){var c,u=new RegExp("(<[^>]+\\bdata-"+this._getNs()+"role=[\"']?page[\"']?[^>]*>)"),d=new RegExp("\\bdata-"+this._getNs()+"url=[\"']?([^\"'>]*)[\"']?");u.test(r)&&RegExp.$1&&d.test(RegExp.$1)&&RegExp.$1&&(a=e.mobile.path.getFilePath(e("<div>"+RegExp.$1+"</div>").text()),a=this.window[0].encodeURIComponent(a)),s.prefetch===n&&this._getBase().set(a),c=this._parse(r,a),this._setLoadedTitle(c,r),i.xhr=h,i.textStatus=l,i.page=c,i.content=c,i.toPage=c,this._triggerWithDeprecated("load",i).event.isDefaultPrevented()||(this._isRewritableBaseTag()&&c&&this._getBase().rewrite(a,c),this._include(c,s),s.showLoadMsg&&this._hideLoading(),o.resolve(t,s,c))},this)},_loadDefaults:{type:"get",data:n,reloadPage:!1,reload:!1,role:n,showLoadMsg:!1,loadMsgDelay:50},load:function(t,i){var s,o,a,r,l=i&&i.deferred||e.Deferred(),h=i&&i.reload===n&&i.reloadPage!==n?{reload:i.reloadPage}:{},c=e.extend({},this._loadDefaults,i,h),u=null,d=e.mobile.path.makeUrlAbsolute(t,this._findBaseWithDefault());return c.data&&"get"===c.type&&(d=e.mobile.path.addSearchParams(d,c.data),c.data=n),c.data&&"post"===c.type&&(c.reload=!0),s=this._createFileUrl(d),o=this._createDataUrl(d),u=this._find(d),0===u.length&&e.mobile.path.isEmbeddedPage(s)&&!e.mobile.path.isFirstPageUrl(s)?(l.reject(d,c),l.promise()):(this._getBase().reset(),u.length&&!c.reload?(this._enhance(u,c.role),l.resolve(d,c,u),c.prefetch||this._getBase().set(t),l.promise()):(r={url:t,absUrl:d,toPage:t,prevPage:i?i.fromPage:n,dataUrl:o,deferred:l,options:c},a=this._triggerWithDeprecated("beforeload",r),a.deprecatedEvent.isDefaultPrevented()||a.event.isDefaultPrevented()?l.promise():(c.showLoadMsg&&this._showLoading(c.loadMsgDelay),c.prefetch===n&&this._getBase().reset(),e.mobile.allowCrossDomainPages||e.mobile.path.isSameDomain(e.mobile.path.documentUrl,d)?(e.ajax({url:s,type:c.type,data:c.data,contentType:c.contentType,dataType:"html",success:this._loadSuccess(d,r,c,l),error:this._loadError(d,r,c,l)}),l.promise()):(l.reject(d,c),l.promise()))))},_loadError:function(t,i,n,s){return e.proxy(function(o,a,r){this._getBase().set(e.mobile.path.get()),i.xhr=o,i.textStatus=a,i.errorThrown=r;var l=this._triggerWithDeprecated("loadfailed",i);l.deprecatedEvent.isDefaultPrevented()||l.event.isDefaultPrevented()||(n.showLoadMsg&&this._showError(),s.reject(t,n))},this)},_getTransitionHandler:function(t){return t=e.mobile._maybeDegradeTransition(t),e.mobile.transitionHandlers[t]||e.mobile.defaultTransitionHandler},_triggerCssTransitionEvents:function(t,i,n){var s=!1;n=n||"",i&&(t[0]===i[0]&&(s=!0),this._triggerWithDeprecated(n+"hide",{nextPage:t,toPage:t,prevPage:i,samePage:s},i)),this._triggerWithDeprecated(n+"show",{prevPage:i||e(""),toPage:t},t)},_cssTransition:function(t,i,n){var s,o,a=n.transition,r=n.reverse,l=n.deferred;this._triggerCssTransitionEvents(t,i,"before"),this._hideLoading(),s=this._getTransitionHandler(a),o=new s(a,r,t,i).transition(),o.done(e.proxy(function(){this._triggerCssTransitionEvents(t,i)},this)),o.done(function(){l.resolve.apply(l,arguments)})},_releaseTransitionLock:function(){o=!1,s.length>0&&e.mobile.changePage.apply(null,s.pop())},_removeActiveLinkClass:function(t){e.mobile.removeActiveLinkClass(t)},_loadUrl:function(t,i,n){n.target=t,n.deferred=e.Deferred(),this.load(t,n),n.deferred.done(e.proxy(function(e,t,n){o=!1,t.absUrl=i.absUrl,this.transition(n,i,t)},this)),n.deferred.fail(e.proxy(function(){this._removeActiveLinkClass(!0),this._releaseTransitionLock(),this._triggerWithDeprecated("changefailed",i)},this))},_triggerPageBeforeChange:function(t,i,n){var s;return i.prevPage=this.activePage,e.extend(i,{toPage:t,options:n}),i.absUrl="string"===e.type(t)?e.mobile.path.makeUrlAbsolute(t,this._findBaseWithDefault()):n.absUrl,s=this._triggerWithDeprecated("beforechange",i),s.event.isDefaultPrevented()||s.deprecatedEvent.isDefaultPrevented()?!1:!0},change:function(t,i){if(o)return void s.unshift(arguments);var n=e.extend({},e.mobile.changePage.defaults,i),a={};n.fromPage=n.fromPage||this.activePage,this._triggerPageBeforeChange(t,a,n)&&(t=a.toPage,"string"===e.type(t)?(o=!0,this._loadUrl(t,a,n)):this.transition(t,a,n))},transition:function(t,a,r){var l,h,c,u,d,p,m,f,g,b,v,_,C,w;if(o)return void s.unshift([t,r]);if(this._triggerPageBeforeChange(t,a,r)&&(a.prevPage=r.fromPage,w=this._triggerWithDeprecated("beforetransition",a),!w.deprecatedEvent.isDefaultPrevented()&&!w.event.isDefaultPrevented())){if(o=!0,t[0]!==e.mobile.firstPage[0]||r.dataUrl||(r.dataUrl=e.mobile.path.documentUrl.hrefNoHash),l=r.fromPage,h=r.dataUrl&&e.mobile.path.convertUrlToDataUrl(r.dataUrl)||t.jqmData("url"),c=h,u=e.mobile.path.getFilePath(h),d=e.mobile.navigate.history.getActive(),p=0===e.mobile.navigate.history.activeIndex,m=0,f=i.title,g=("dialog"===r.role||"dialog"===t.jqmData("role"))&&t.jqmData("dialog")!==!0,l&&l[0]===t[0]&&!r.allowSamePageTransition)return o=!1,this._triggerWithDeprecated("transition",a),this._triggerWithDeprecated("change",a),void(r.fromHashChange&&e.mobile.navigate.history.direct({url:h}));
|
|
t.page({role:r.role}),r.fromHashChange&&(m="back"===r.direction?-1:1);try{i.activeElement&&"body"!==i.activeElement.nodeName.toLowerCase()?e(i.activeElement).blur():e("input:focus, textarea:focus, select:focus").blur()}catch(y){}b=!1,g&&d&&(d.url&&d.url.indexOf(e.mobile.dialogHashKey)>-1&&this.activePage&&!this.activePage.hasClass("ui-dialog")&&e.mobile.navigate.history.activeIndex>0&&(r.changeHash=!1,b=!0),h=d.url||"",h+=!b&&h.indexOf("#")>-1?e.mobile.dialogHashKey:"#"+e.mobile.dialogHashKey),v=d?t.jqmData("title")||t.children(":jqmData(role='header')").find(".ui-title").text():f,v&&f===i.title&&(f=v),t.jqmData("title")||t.jqmData("title",f),r.transition=r.transition||(m&&!p?d.transition:n)||(g?e.mobile.defaultDialogTransition:e.mobile.defaultPageTransition),!m&&b&&(e.mobile.navigate.history.getActive().pageUrl=c),h&&!r.fromHashChange&&(!e.mobile.path.isPath(h)&&h.indexOf("#")<0&&(h="#"+h),_={transition:r.transition,title:f,pageUrl:c,role:r.role},r.changeHash!==!1&&e.mobile.hashListeningEnabled?e.mobile.navigate(this.window[0].encodeURI(h),_,!0):t[0]!==e.mobile.firstPage[0]&&e.mobile.navigate.history.add(h,_)),i.title=f,e.mobile.activePage=t,this.activePage=t,r.reverse=r.reverse||0>m,C=e.Deferred(),this._cssTransition(t,l,{transition:r.transition,reverse:r.reverse,deferred:C}),C.done(e.proxy(function(i,n,s,o,l){e.mobile.removeActiveLinkClass(),r.duplicateCachedPage&&r.duplicateCachedPage.remove(),l||e.mobile.focusPage(t),this._releaseTransitionLock(),this._triggerWithDeprecated("transition",a),this._triggerWithDeprecated("change",a)},this))}},_findBaseWithDefault:function(){var t=this.activePage&&e.mobile.getClosestBaseUrl(this.activePage);return t||e.mobile.path.documentBase.hrefNoHash}}),e.mobile.navreadyDeferred=e.Deferred();var s=[],o=!1}(e),function(e,n){function s(e){for(;e&&("string"!=typeof e.nodeName||"a"!==e.nodeName.toLowerCase());)e=e.parentNode;return e}var o=e.Deferred(),a=e.Deferred(),r=function(){a.resolve(),a=null},l=e.mobile.path.documentUrl,h=null;e.mobile.loadPage=function(t,i){var n;return i=i||{},n=i.pageContainer||e.mobile.pageContainer,i.deferred=e.Deferred(),n.pagecontainer("load",t,i),i.deferred.promise()},e.mobile.back=function(){var i=t.navigator;this.phonegapNavigationEnabled&&i&&i.app&&i.app.backHistory?i.app.backHistory():e.mobile.pageContainer.pagecontainer("back")},e.mobile.focusPage=function(e){var t=e.find("[autofocus]"),i=e.find(".ui-title:eq(0)");return t.length?void t.focus():void(i.length?i.focus():e.focus())},e.mobile._maybeDegradeTransition=e.mobile._maybeDegradeTransition||function(e){return e},e.mobile.changePage=function(t,i){e.mobile.pageContainer.pagecontainer("change",t,i)},e.mobile.changePage.defaults={transition:n,reverse:!1,changeHash:!0,fromHashChange:!1,role:n,duplicateCachedPage:n,pageContainer:n,showLoadMsg:!0,dataUrl:n,fromPage:n,allowSamePageTransition:!1},e.mobile._registerInternalEvents=function(){var i=function(t,i){var n,s,o,a,r=!0;return!e.mobile.ajaxEnabled||t.is(":jqmData(ajax='false')")||!t.jqmHijackable().length||t.attr("target")?!1:(n=h&&h.attr("formaction")||t.attr("action"),a=(t.attr("method")||"get").toLowerCase(),n||(n=e.mobile.getClosestBaseUrl(t),"get"===a&&(n=e.mobile.path.parseUrl(n).hrefNoSearch),n===e.mobile.path.documentBase.hrefNoHash&&(n=l.hrefNoSearch)),n=e.mobile.path.makeUrlAbsolute(n,e.mobile.getClosestBaseUrl(t)),e.mobile.path.isExternal(n)&&!e.mobile.path.isPermittedCrossDomainRequest(l,n)?!1:(i||(s=t.serializeArray(),h&&h[0].form===t[0]&&(o=h.attr("name"),o&&(e.each(s,function(e,t){return t.name===o?(o="",!1):void 0}),o&&s.push({name:o,value:h.attr("value")}))),r={url:n,options:{type:a,data:e.param(s),transition:t.jqmData("transition"),reverse:"reverse"===t.jqmData("direction"),reloadPage:!0}}),r))};e.mobile.document.delegate("form","submit",function(t){var n;t.isDefaultPrevented()||(n=i(e(this)),n&&(e.mobile.changePage(n.url,n.options),t.preventDefault()))}),e.mobile.document.bind("vclick",function(t){var n,o,a=t.target,r=!1;if(!(t.which>1)&&e.mobile.linkBindingEnabled){if(h=e(a),e.data(a,"mobile-button")){if(!i(e(a).closest("form"),!0))return;a.parentNode&&(a=a.parentNode)}else{if(a=s(a),!a||"#"===e.mobile.path.parseUrl(a.getAttribute("href")||"#").hash)return;if(!e(a).jqmHijackable().length)return}~a.className.indexOf("ui-link-inherit")?a.parentNode&&(o=e.data(a.parentNode,"buttonElements")):o=e.data(a,"buttonElements"),o?a=o.outer:r=!0,n=e(a),r&&(n=n.closest(".ui-btn")),n.length>0&&!n.hasClass("ui-state-disabled")&&(e.mobile.removeActiveLinkClass(!0),e.mobile.activeClickedLink=n,e.mobile.activeClickedLink.addClass(e.mobile.activeBtnClass))}}),e.mobile.document.bind("click",function(i){if(e.mobile.linkBindingEnabled&&!i.isDefaultPrevented()){var o,a,r,h,c,u,d,p=s(i.target),m=e(p),f=function(){t.setTimeout(function(){e.mobile.removeActiveLinkClass(!0)},200)};if(e.mobile.activeClickedLink&&e.mobile.activeClickedLink[0]===i.target.parentNode&&f(),p&&!(i.which>1)&&m.jqmHijackable().length){if(m.is(":jqmData(rel='back')"))return e.mobile.back(),!1;if(o=e.mobile.getClosestBaseUrl(m),a=e.mobile.path.makeUrlAbsolute(m.attr("href")||"#",o),!e.mobile.ajaxEnabled&&!e.mobile.path.isEmbeddedPage(a))return void f();if(!(-1===a.search("#")||e.mobile.path.isExternal(a)&&e.mobile.path.isAbsoluteUrl(a))){if(a=a.replace(/[^#]*#/,""),!a)return void i.preventDefault();a=e.mobile.path.isPath(a)?e.mobile.path.makeUrlAbsolute(a,o):e.mobile.path.makeUrlAbsolute("#"+a,l.hrefNoHash)}if(r=m.is("[rel='external']")||m.is(":jqmData(ajax='false')")||m.is("[target]"),h=r||e.mobile.path.isExternal(a)&&!e.mobile.path.isPermittedCrossDomainRequest(l,a))return void f();c=m.jqmData("transition"),u="reverse"===m.jqmData("direction")||m.jqmData("back"),d=m.attr("data-"+e.mobile.ns+"rel")||n,e.mobile.changePage(a,{transition:c,reverse:u,role:d,link:m}),i.preventDefault()}}}),e.mobile.document.delegate(".ui-page","pageshow.prefetch",function(){var t=[];e(this).find("a:jqmData(prefetch)").each(function(){var i=e(this),n=i.attr("href");n&&-1===e.inArray(n,t)&&(t.push(n),e.mobile.loadPage(n,{role:i.attr("data-"+e.mobile.ns+"rel"),prefetch:!0}))})}),e.mobile.pageContainer.pagecontainer(),e.mobile.document.bind("pageshow",function(){a?a.done(e.mobile.resetActivePageHeight):e.mobile.resetActivePageHeight()}),e.mobile.window.bind("throttledresize",e.mobile.resetActivePageHeight)},e(function(){o.resolve()}),"complete"===i.readyState?r():e.mobile.window.load(r),e.when(o,e.mobile.navreadyDeferred).done(function(){e.mobile._registerInternalEvents()})}(e),function(e){var t="ui-loader",i=e("html");e.widget("mobile.loader",{options:{theme:"a",textVisible:!1,html:"",text:"loading"},defaultHtml:"<div class='"+t+"'><span class='ui-icon-loading'></span><h1></h1></div>",fakeFixLoader:function(){var t=e("."+e.mobile.activeBtnClass).first();this.element.css({top:e.support.scrollTop&&this.window.scrollTop()+this.window.height()/2||t.length&&t.offset().top||100})},checkLoaderPosition:function(){var t=this.element.offset(),i=this.window.scrollTop(),n=e.mobile.getScreenHeight();(t.top<i||t.top-i>n)&&(this.element.addClass("ui-loader-fakefix"),this.fakeFixLoader(),this.window.unbind("scroll",this.checkLoaderPosition).bind("scroll",e.proxy(this.fakeFixLoader,this)))},resetHtml:function(){this.element.html(e(this.defaultHtml).html())},show:function(n,s,o){var a,r,l;this.resetHtml(),"object"===e.type(n)?(l=e.extend({},this.options,n),n=l.theme):(l=this.options,n=n||l.theme),r=s||(l.text===!1?"":l.text),i.addClass("ui-loading"),a=l.textVisible,this.element.attr("class",t+" ui-corner-all ui-body-"+n+" ui-loader-"+(a||s||n.text?"verbose":"default")+(l.textonly||o?" ui-loader-textonly":"")),l.html?this.element.html(l.html):this.element.find("h1").text(r),this.element.appendTo(e(e.mobile.pagecontainer?":mobile-pagecontainer":"body")),this.checkLoaderPosition(),this.window.bind("scroll",e.proxy(this.checkLoaderPosition,this))},hide:function(){i.removeClass("ui-loading"),this.options.text&&this.element.removeClass("ui-loader-fakefix"),this.window.unbind("scroll",this.fakeFixLoader),this.window.unbind("scroll",this.checkLoaderPosition)}})}(e,this),function(e,t,n){function s(){o.removeClass("ui-mobile-rendering")}var o=e("html"),a=e.mobile.window;e(t.document).trigger("mobileinit"),e.mobile.gradeA()&&(e.mobile.ajaxBlacklist&&(e.mobile.ajaxEnabled=!1),o.addClass("ui-mobile ui-mobile-rendering"),setTimeout(s,5e3),e.extend(e.mobile,{initializePage:function(){var t=e.mobile.path,o=e(":jqmData(role='page'), :jqmData(role='dialog')"),r=t.stripHash(t.stripQueryParams(t.parseLocation().hash)),l=e.mobile.path.parseLocation(),h=r?i.getElementById(r):n;o.length||(o=e("body").wrapInner("<div data-"+e.mobile.ns+"role='page'></div>").children(0)),o.each(function(){var i=e(this);i[0].getAttribute("data-"+e.mobile.ns+"url")||i.attr("data-"+e.mobile.ns+"url",i.attr("id")||t.convertUrlToDataUrl(l.pathname+l.search))}),e.mobile.firstPage=o.first(),e.mobile.pageContainer=e.mobile.firstPage.parent().addClass("ui-mobile-viewport").pagecontainer(),e.mobile.navreadyDeferred.resolve(),a.trigger("pagecontainercreate"),e.mobile.loading("show"),s(),e.mobile.hashListeningEnabled&&e.mobile.path.isHashValid(location.hash)&&(e(h).is(":jqmData(role='page')")||e.mobile.path.isPath(r)||r===e.mobile.dialogHashKey)?e.event.special.navigate.isPushStateEnabled()?(e.mobile.navigate.history.stack=[],e.mobile.navigate(e.mobile.path.isPath(location.hash)?location.hash:location.href)):a.trigger("hashchange",[!0]):(e.event.special.navigate.isPushStateEnabled()&&e.mobile.navigate.navigator.squash(t.parseLocation().href),e.mobile.changePage(e.mobile.firstPage,{transition:"none",reverse:!0,changeHash:!1,fromHashChange:!0}))}}),e(function(){e.support.inlineSVG(),e.mobile.hideUrlBar&&t.scrollTo(0,1),e.mobile.defaultHomeScroll=e.support.scrollTop&&1!==e.mobile.window.scrollTop()?1:0,e.mobile.autoInitializePage&&e.mobile.initializePage(),e.mobile.hideUrlBar&&a.load(e.mobile.silentScroll),e.support.cssPointerEvents||e.mobile.document.delegate(".ui-state-disabled,.ui-disabled","vclick",function(e){e.preventDefault(),e.stopImmediatePropagation()})}))}(e,this),function(e){e.mobile.links=function(t){e(t).find("a").jqmEnhanceable().filter(":jqmData(rel='popup')[href][href!='']").each(function(){var e=this,t=e.getAttribute("href").substring(1);t&&(e.setAttribute("aria-haspopup",!0),e.setAttribute("aria-owns",t),e.setAttribute("aria-expanded",!1))}).end().not(".ui-btn, :jqmData(role='none'), :jqmData(role='nojs')").addClass("ui-link")}}(e),function(e){e.mobile.nojs=function(t){e(":jqmData(role='nojs')",t).addClass("ui-nojs")}}(e),function(e){var t=e("meta[name=viewport]"),i=t.attr("content"),n=i+",maximum-scale=1, user-scalable=no",s=i+",maximum-scale=10, user-scalable=yes",o=/(user-scalable[\s]*=[\s]*no)|(maximum-scale[\s]*=[\s]*1)[$,\s]/.test(i);e.mobile.zoom=e.extend({},{enabled:!o,locked:!1,disable:function(i){o||e.mobile.zoom.locked||(t.attr("content",n),e.mobile.zoom.enabled=!1,e.mobile.zoom.locked=i||!1)},enable:function(i){o||e.mobile.zoom.locked&&i!==!0||(t.attr("content",s),e.mobile.zoom.enabled=!0,e.mobile.zoom.locked=!1)},restore:function(){o||(t.attr("content",i),e.mobile.zoom.enabled=!0)}})}(e),function(e){e.mobile.transitionFallbacks.pop="fade"}(e,this),function(e){e.mobile.transitionHandlers.slide=e.mobile.transitionHandlers.simultaneous,e.mobile.transitionFallbacks.slide="fade"}(e,this),function(e){e.mobile.transitionFallbacks.slidedown="fade"}(e,this),function(e){e.mobile.transitionFallbacks.slideup="fade"}(e,this),function(e){function t(t){var n,s=t.length,o=[];for(n=0;s>n;n++)t[n].className.match(i)||o.push(t[n]);return e(o)}var i=/\bui-screen-hidden\b/;e.mobile.behaviors.addFirstLastClasses={_getVisibles:function(e,i){var n;return i?n=t(e):(n=e.filter(":visible"),0===n.length&&(n=t(e))),n},_addFirstLastClasses:function(e,t,i){e.removeClass("ui-first-child ui-last-child"),t.eq(0).addClass("ui-first-child").end().last().addClass("ui-last-child"),i||this.element.trigger("updatelayout")},_removeFirstLastClasses:function(e){e.removeClass("ui-first-child ui-last-child")}}}(e),function(e,t){var i=/([A-Z])/g,n=function(e){return"ui-btn-icon-"+(null===e?"left":e)};e.widget("mobile.collapsible",{options:{enhanced:!1,expandCueText:null,collapseCueText:null,collapsed:!0,heading:"h1,h2,h3,h4,h5,h6,legend",collapsedIcon:null,expandedIcon:null,iconpos:null,theme:null,contentTheme:null,inset:null,corners:null,mini:null},_create:function(){var t=this.element,i={accordion:t.closest(":jqmData(role='collapsible-set'),:jqmData(role='collapsibleset')"+(e.mobile.collapsibleset?", :mobile-collapsibleset":"")).addClass("ui-collapsible-set")};this._ui=i,this._renderedOptions=this._getOptions(this.options),this.options.enhanced?(i.heading=this.element.children(".ui-collapsible-heading"),i.content=i.heading.next(),i.anchor=i.heading.children(),i.status=i.anchor.children(".ui-collapsible-heading-status")):this._enhance(t,i),this._on(i.heading,{tap:function(){i.heading.find("a").first().addClass(e.mobile.activeBtnClass)},click:function(e){this._handleExpandCollapse(!i.heading.hasClass("ui-collapsible-heading-collapsed")),e.preventDefault(),e.stopPropagation()}})},_getOptions:function(t){var n,s=this._ui.accordion,o=this._ui.accordionWidget;t=e.extend({},t),s.length&&!o&&(this._ui.accordionWidget=o=s.data("mobile-collapsibleset"));for(n in t)t[n]=null!=t[n]?t[n]:o?o.options[n]:s.length?e.mobile.getAttribute(s[0],n.replace(i,"-$1").toLowerCase()):null,null==t[n]&&(t[n]=e.mobile.collapsible.defaults[n]);return t},_themeClassFromOption:function(e,t){return t?"none"===t?"":e+t:""},_enhance:function(t,i){var s,o=this._renderedOptions,a=this._themeClassFromOption("ui-body-",o.contentTheme);return t.addClass("ui-collapsible "+(o.inset?"ui-collapsible-inset ":"")+(o.inset&&o.corners?"ui-corner-all ":"")+(a?"ui-collapsible-themed-content ":"")),i.originalHeading=t.children(this.options.heading).first(),i.content=t.wrapInner("<div class='ui-collapsible-content "+a+"'></div>").children(".ui-collapsible-content"),i.heading=i.originalHeading,i.heading.is("legend")&&(i.heading=e("<div role='heading'>"+i.heading.html()+"</div>"),i.placeholder=e("<div><!-- placeholder for legend --></div>").insertBefore(i.originalHeading),i.originalHeading.remove()),s=o.collapsed?o.collapsedIcon?"ui-icon-"+o.collapsedIcon:"":o.expandedIcon?"ui-icon-"+o.expandedIcon:"",i.status=e("<span class='ui-collapsible-heading-status'></span>"),i.anchor=i.heading.detach().addClass("ui-collapsible-heading").append(i.status).wrapInner("<a href='#' class='ui-collapsible-heading-toggle'></a>").find("a").first().addClass("ui-btn "+(s?s+" ":"")+(s?n(o.iconpos)+" ":"")+this._themeClassFromOption("ui-btn-",o.theme)+" "+(o.mini?"ui-mini ":"")),i.heading.insertBefore(i.content),this._handleExpandCollapse(this.options.collapsed),i},refresh:function(){this._applyOptions(this.options),this._renderedOptions=this._getOptions(this.options)},_applyOptions:function(e){var i,s,o,a,r,l=this.element,h=this._renderedOptions,c=this._ui,u=c.anchor,d=c.status,p=this._getOptions(e);e.collapsed!==t&&this._handleExpandCollapse(e.collapsed),i=l.hasClass("ui-collapsible-collapsed"),i?p.expandCueText!==t&&d.text(p.expandCueText):p.collapseCueText!==t&&d.text(p.collapseCueText),r=p.collapsedIcon!==t?p.collapsedIcon!==!1:h.collapsedIcon!==!1,(p.iconpos!==t||p.collapsedIcon!==t||p.expandedIcon!==t)&&(u.removeClass([n(h.iconpos)].concat(h.expandedIcon?["ui-icon-"+h.expandedIcon]:[]).concat(h.collapsedIcon?["ui-icon-"+h.collapsedIcon]:[]).join(" ")),r&&u.addClass([n(p.iconpos!==t?p.iconpos:h.iconpos)].concat(i?["ui-icon-"+(p.collapsedIcon!==t?p.collapsedIcon:h.collapsedIcon)]:["ui-icon-"+(p.expandedIcon!==t?p.expandedIcon:h.expandedIcon)]).join(" "))),p.theme!==t&&(o=this._themeClassFromOption("ui-btn-",h.theme),s=this._themeClassFromOption("ui-btn-",p.theme),u.removeClass(o).addClass(s)),p.contentTheme!==t&&(o=this._themeClassFromOption("ui-body-",h.contentTheme),s=this._themeClassFromOption("ui-body-",p.contentTheme),c.content.removeClass(o).addClass(s)),p.inset!==t&&(l.toggleClass("ui-collapsible-inset",p.inset),a=!(!p.inset||!p.corners&&!h.corners)),p.corners!==t&&(a=!(!p.corners||!p.inset&&!h.inset)),a!==t&&l.toggleClass("ui-corner-all",a),p.mini!==t&&u.toggleClass("ui-mini",p.mini)},_setOptions:function(e){this._applyOptions(e),this._super(e),this._renderedOptions=this._getOptions(this.options)},_handleExpandCollapse:function(t){var i=this._renderedOptions,n=this._ui;n.status.text(t?i.expandCueText:i.collapseCueText),n.heading.toggleClass("ui-collapsible-heading-collapsed",t).find("a").first().toggleClass("ui-icon-"+i.expandedIcon,!t).toggleClass("ui-icon-"+i.collapsedIcon,t||i.expandedIcon===i.collapsedIcon).removeClass(e.mobile.activeBtnClass),this.element.toggleClass("ui-collapsible-collapsed",t),n.content.toggleClass("ui-collapsible-content-collapsed",t).attr("aria-hidden",t).trigger("updatelayout"),this.options.collapsed=t,this._trigger(t?"collapse":"expand")},expand:function(){this._handleExpandCollapse(!1)},collapse:function(){this._handleExpandCollapse(!0)},_destroy:function(){var e=this._ui,t=this.options;t.enhanced||(e.placeholder?(e.originalHeading.insertBefore(e.placeholder),e.placeholder.remove(),e.heading.remove()):(e.status.remove(),e.heading.removeClass("ui-collapsible-heading ui-collapsible-heading-collapsed").children().contents().unwrap()),e.anchor.contents().unwrap(),e.content.contents().unwrap(),this.element.removeClass("ui-collapsible ui-collapsible-collapsed ui-collapsible-themed-content ui-collapsible-inset ui-corner-all"))}}),e.mobile.collapsible.defaults={expandCueText:" click to expand contents",collapseCueText:" click to collapse contents",collapsedIcon:"plus",contentTheme:"inherit",expandedIcon:"minus",iconpos:"left",inset:!0,corners:!0,theme:"inherit",mini:!1}}(e),function(e,t){e.widget("mobile.controlgroup",e.extend({options:{enhanced:!1,theme:null,shadow:!1,corners:!0,excludeInvisible:!0,type:"vertical",mini:!1},_create:function(){var t=this.element,i=this.options,n=e.mobile.page.prototype.keepNativeSelector();e.fn.buttonMarkup&&this.element.find(e.fn.buttonMarkup.initSelector).not(n).buttonMarkup(),e.each(this._childWidgets,e.proxy(function(t,i){e.mobile[i]&&this.element.find(e.mobile[i].initSelector).not(n)[i]()},this)),e.extend(this,{_ui:null,_initialRefresh:!0}),this._ui=i.enhanced?{groupLegend:t.children(".ui-controlgroup-label").children(),childWrapper:t.children(".ui-controlgroup-controls")}:this._enhance()},_childWidgets:["checkboxradio","selectmenu","button"],_themeClassFromOption:function(e){return e?"none"===e?"":"ui-group-theme-"+e:""},_enhance:function(){var t=this.element,i=this.options,n={groupLegend:t.children("legend"),childWrapper:t.addClass("ui-controlgroup ui-controlgroup-"+("horizontal"===i.type?"horizontal":"vertical")+" "+this._themeClassFromOption(i.theme)+" "+(i.corners?"ui-corner-all ":"")+(i.mini?"ui-mini ":"")).wrapInner("<div class='ui-controlgroup-controls "+(i.shadow===!0?"ui-shadow":"")+"'></div>").children()};return n.groupLegend.length>0&&e("<div role='heading' class='ui-controlgroup-label'></div>").append(n.groupLegend).prependTo(t),n},_init:function(){this.refresh()},_setOptions:function(e){var i,n,s=this.element;return e.type!==t&&(s.removeClass("ui-controlgroup-horizontal ui-controlgroup-vertical").addClass("ui-controlgroup-"+("horizontal"===e.type?"horizontal":"vertical")),i=!0),e.theme!==t&&s.removeClass(this._themeClassFromOption(this.options.theme)).addClass(this._themeClassFromOption(e.theme)),e.corners!==t&&s.toggleClass("ui-corner-all",e.corners),e.mini!==t&&s.toggleClass("ui-mini",e.mini),e.shadow!==t&&this._ui.childWrapper.toggleClass("ui-shadow",e.shadow),e.excludeInvisible!==t&&(this.options.excludeInvisible=e.excludeInvisible,i=!0),n=this._super(e),i&&this.refresh(),n},container:function(){return this._ui.childWrapper},refresh:function(){var t=this.container(),i=t.find(".ui-btn").not(".ui-slider-handle"),n=this._initialRefresh;e.mobile.checkboxradio&&t.find(":mobile-checkboxradio").checkboxradio("refresh"),this._addFirstLastClasses(i,this.options.excludeInvisible?this._getVisibles(i,n):i,n),this._initialRefresh=!1},_destroy:function(){var e,t,i=this.options;return i.enhanced?this:(e=this._ui,t=this.element.removeClass("ui-controlgroup ui-controlgroup-horizontal ui-controlgroup-vertical ui-corner-all ui-mini "+this._themeClassFromOption(i.theme)).find(".ui-btn").not(".ui-slider-handle"),this._removeFirstLastClasses(t),e.groupLegend.unwrap(),void e.childWrapper.children().unwrap())}},e.mobile.behaviors.addFirstLastClasses))}(e),function(e,t,i){e.widget("mobile.dialog",{options:{closeBtn:"left",closeBtnText:"Close",overlayTheme:"a",corners:!0},_handlePageBeforeShow:function(){this._isCloseable=!0,this.options.overlayTheme&&this.element.page("removeContainerBackground").page("setContainerBackground",this.options.overlayTheme)},_handlePageBeforeHide:function(){this._isCloseable=!1},_handleVClickSubmit:function(t){var i,n=e(t.target).closest("vclick"===t.type?"a":"form");n.length&&!n.jqmData("transition")&&(i={},i["data-"+e.mobile.ns+"transition"]=(e.mobile.navigate.history.getActive()||{}).transition||e.mobile.defaultDialogTransition,i["data-"+e.mobile.ns+"direction"]="reverse",n.attr(i))},_create:function(){var t=this.element,i=this.options;t.addClass("ui-dialog").wrapInner(e("<div/>",{role:"dialog","class":"ui-dialog-contain ui-overlay-shadow"+(i.corners?" ui-corner-all":"")})),e.extend(this,{_isCloseable:!1,_inner:t.children(),_headerCloseButton:null}),this._on(t,{vclick:"_handleVClickSubmit",submit:"_handleVClickSubmit",pagebeforeshow:"_handlePageBeforeShow",pagebeforehide:"_handlePageBeforeHide"}),this._setCloseBtn(i.closeBtn)},_setOptions:function(t){var n,s,o=this.options;t.corners!==i&&this._inner.toggleClass("ui-corner-all",!!t.corners),t.overlayTheme!==i&&e.mobile.activePage[0]===this.element[0]&&(o.overlayTheme=t.overlayTheme,this._handlePageBeforeShow()),t.closeBtnText!==i&&(n=o.closeBtn,s=t.closeBtnText),t.closeBtn!==i&&(n=t.closeBtn),n&&this._setCloseBtn(n,s),this._super(t)},_setCloseBtn:function(t,i){var n,s=this._headerCloseButton;t="left"===t?"left":"right"===t?"right":"none","none"===t?s&&(s.remove(),s=null):s?(s.removeClass("ui-btn-left ui-btn-right").addClass("ui-btn-"+t),i&&s.text(i)):(n=this._inner.find(":jqmData(role='header')").first(),s=e("<a></a>",{role:"button",href:"#","class":"ui-btn ui-corner-all ui-icon-delete ui-btn-icon-notext ui-btn-"+t}).text(i||this.options.closeBtnText||"").prependTo(n),this._on(s,{click:"close"})),this._headerCloseButton=s},close:function(){var t=e.mobile.navigate.history;this._isCloseable&&(this._isCloseable=!1,e.mobile.hashListeningEnabled&&t.activeIndex>0?e.mobile.back():e.mobile.pageContainer.pagecontainer("back"))}})}(e,this),function(e,t){e.widget("mobile.textinput",{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]),input[type='file']",options:{theme:null,corners:!0,mini:!1,preventFocusZoom:/iPhone|iPad|iPod/.test(navigator.platform)&&navigator.userAgent.indexOf("AppleWebKit")>-1,wrapperClass:"",enhanced:!1},_create:function(){var t=this.options,i=this.element.is("[type='search'], :jqmData(type='search')"),n="TEXTAREA"===this.element[0].tagName,s=this.element.is("[data-"+(e.mobile.ns||"")+"type='range']"),o=(this.element.is("input")||this.element.is("[data-"+(e.mobile.ns||"")+"type='search']"))&&!s;this.element.prop("disabled")&&(t.disabled=!0),e.extend(this,{classes:this._classesFromOptions(),isSearch:i,isTextarea:n,isRange:s,inputNeedsWrap:o}),this._autoCorrect(),t.enhanced||this._enhance(),this._on({focus:"_handleFocus",blur:"_handleBlur"})},refresh:function(){this.setOptions({disabled:this.element.is(":disabled")})},_enhance:function(){var e=[];this.isTextarea&&e.push("ui-input-text"),(this.isTextarea||this.isRange)&&e.push("ui-shadow-inset"),this.inputNeedsWrap?this.element.wrap(this._wrap()):e=e.concat(this.classes),this.element.addClass(e.join(" "))},widget:function(){return this.inputNeedsWrap?this.element.parent():this.element},_classesFromOptions:function(){var e=this.options,t=[];return t.push("ui-body-"+(null===e.theme?"inherit":e.theme)),e.corners&&t.push("ui-corner-all"),e.mini&&t.push("ui-mini"),e.disabled&&t.push("ui-state-disabled"),e.wrapperClass&&t.push(e.wrapperClass),t},_wrap:function(){return e("<div class='"+(this.isSearch?"ui-input-search ":"ui-input-text ")+this.classes.join(" ")+" ui-shadow-inset'></div>")},_autoCorrect:function(){"undefined"==typeof this.element[0].autocorrect||e.support.touchOverflow||(this.element[0].setAttribute("autocorrect","off"),this.element[0].setAttribute("autocomplete","off"))},_handleBlur:function(){this.widget().removeClass(e.mobile.focusClass),this.options.preventFocusZoom&&e.mobile.zoom.enable(!0)},_handleFocus:function(){this.options.preventFocusZoom&&e.mobile.zoom.disable(!0),this.widget().addClass(e.mobile.focusClass)},_setOptions:function(e){var i=this.widget();this._super(e),(e.disabled!==t||e.mini!==t||e.corners!==t||e.theme!==t||e.wrapperClass!==t)&&(i.removeClass(this.classes.join(" ")),this.classes=this._classesFromOptions(),i.addClass(this.classes.join(" "))),e.disabled!==t&&this.element.prop("disabled",!!e.disabled)},_destroy:function(){this.options.enhanced||(this.inputNeedsWrap&&this.element.unwrap(),this.element.removeClass("ui-input-text "+this.classes.join(" ")))}})}(e),function(e,t){e.widget("mobile.textinput",e.mobile.textinput,{options:{autogrow:!0,keyupTimeoutBuffer:100},_create:function(){this._super(),this.options.autogrow&&this.isTextarea&&this._autogrow()},_autogrow:function(){this.element.addClass("ui-textinput-autogrow"),this._on({keyup:"_timeout",change:"_timeout",input:"_timeout",paste:"_timeout"}),this._on(!0,this.document,{pageshow:"_handleShow",popupbeforeposition:"_handleShow",updatelayout:"_handleShow",panelopen:"_handleShow"})},_handleShow:function(t){e.contains(t.target,this.element[0])&&this.element.is(":visible")&&("popupbeforeposition"!==t.type&&this.element.addClass("ui-textinput-autogrow-resize").animationComplete(e.proxy(function(){this.element.removeClass("ui-textinput-autogrow-resize")},this),"transition"),this._prepareHeightUpdate())},_unbindAutogrow:function(){this.element.removeClass("ui-textinput-autogrow"),this._off(this.element,"keyup change input paste"),this._off(this.document,"pageshow popupbeforeposition updatelayout panelopen")},keyupTimeout:null,_prepareHeightUpdate:function(e){this.keyupTimeout&&clearTimeout(this.keyupTimeout),e===t?this._updateHeight():this.keyupTimeout=this._delay("_updateHeight",e)},_timeout:function(){this._prepareHeightUpdate(this.options.keyupTimeoutBuffer)},_updateHeight:function(){var e,t,i,n,s,o,a,r,l,h=this.window.scrollTop();this.keyupTimeout=0,"onpage"in this.element[0]||this.element.css({height:0,"min-height":0,"max-height":0}),n=this.element[0].scrollHeight,s=this.element[0].clientHeight,o=parseFloat(this.element.css("border-top-width")),a=parseFloat(this.element.css("border-bottom-width")),r=o+a,l=n+r+15,0===s&&(e=parseFloat(this.element.css("padding-top")),t=parseFloat(this.element.css("padding-bottom")),i=e+t,l+=i),this.element.css({height:l,"min-height":"","max-height":""}),this.window.scrollTop(h)},refresh:function(){this.options.autogrow&&this.isTextarea&&this._updateHeight()},_setOptions:function(e){this._super(e),e.autogrow!==t&&this.isTextarea&&(e.autogrow?this._autogrow():this._unbindAutogrow())}})}(e),function(e,t){e.widget("mobile.button",{initSelector:"input[type='button'], input[type='submit'], input[type='reset']",options:{theme:null,icon:null,iconpos:"left",iconshadow:!1,corners:!0,shadow:!0,inline:null,mini:null,wrapperClass:null,enhanced:!1},_create:function(){this.element.is(":disabled")&&(this.options.disabled=!0),this.options.enhanced||this._enhance(),e.extend(this,{wrapper:this.element.parent()}),this._on({focus:function(){this.widget().addClass(e.mobile.focusClass)},blur:function(){this.widget().removeClass(e.mobile.focusClass)}}),this.refresh(!0)},_enhance:function(){this.element.wrap(this._button())},_button:function(){var t=this.options,i=this._getIconClasses(this.options);return e("<div class='ui-btn ui-input-btn"+(t.wrapperClass?" "+t.wrapperClass:"")+(t.theme?" ui-btn-"+t.theme:"")+(t.corners?" ui-corner-all":"")+(t.shadow?" ui-shadow":"")+(t.inline?" ui-btn-inline":"")+(t.mini?" ui-mini":"")+(t.disabled?" ui-state-disabled":"")+(i?" "+i:"")+"' >"+this.element.val()+"</div>")},widget:function(){return this.wrapper},_destroy:function(){this.element.insertBefore(this.wrapper),this.wrapper.remove()},_getIconClasses:function(e){return e.icon?"ui-icon-"+e.icon+(e.iconshadow?" ui-shadow-icon":"")+" ui-btn-icon-"+e.iconpos:""},_setOptions:function(i){var n=this.widget();i.theme!==t&&n.removeClass(this.options.theme).addClass("ui-btn-"+i.theme),i.corners!==t&&n.toggleClass("ui-corner-all",i.corners),i.shadow!==t&&n.toggleClass("ui-shadow",i.shadow),i.inline!==t&&n.toggleClass("ui-btn-inline",i.inline),i.mini!==t&&n.toggleClass("ui-mini",i.mini),i.disabled!==t&&(this.element.prop("disabled",i.disabled),n.toggleClass("ui-state-disabled",i.disabled)),(i.icon!==t||i.iconshadow!==t||i.iconpos!==t)&&n.removeClass(this._getIconClasses(this.options)).addClass(this._getIconClasses(e.extend({},this.options,i))),this._super(i)},refresh:function(t){var i,n=this.element.prop("disabled");this.options.icon&&"notext"===this.options.iconpos&&this.element.attr("title")&&this.element.attr("title",this.element.val()),t||(i=this.element.detach(),e(this.wrapper).text(this.element.val()).append(i)),this.options.disabled!==n&&this._setOptions({disabled:n})}})}(e),function(e){e.mobile.behaviors.formReset={_handleFormReset:function(){this._on(this.element.closest("form"),{reset:function(){this._delay("_reset")}})}}}(e),function(e,t){var i=e.mobile.path.hashToSelector;e.widget("mobile.checkboxradio",e.extend({initSelector:"input:not( :jqmData(role='flipswitch' ) )[type='checkbox'],input[type='radio']:not( :jqmData(role='flipswitch' ))",options:{theme:"inherit",mini:!1,wrapperClass:null,enhanced:!1,iconpos:"left"},_create:function(){var t=this.element,i=this.options,n=function(e,t){return e.jqmData(t)||e.closest("form, fieldset").jqmData(t)},s=this.options.enhanced?{element:this.element.siblings("label"),isParent:!1}:this._findLabel(),o=t[0].type,a="ui-"+o+"-on",r="ui-"+o+"-off";("checkbox"===o||"radio"===o)&&(this.element[0].disabled&&(this.options.disabled=!0),i.iconpos=n(t,"iconpos")||s.element.attr("data-"+e.mobile.ns+"iconpos")||i.iconpos,i.mini=n(t,"mini")||i.mini,e.extend(this,{input:t,label:s.element,labelIsParent:s.isParent,inputtype:o,checkedClass:a,uncheckedClass:r}),this.options.enhanced||this._enhance(),this._on(s.element,{vmouseover:"_handleLabelVMouseOver",vclick:"_handleLabelVClick"}),this._on(t,{vmousedown:"_cacheVals",vclick:"_handleInputVClick",focus:"_handleInputFocus",blur:"_handleInputBlur"}),this._handleFormReset(),this.refresh())},_findLabel:function(){var t,n,s,o=this.element,a=o[0].labels;return a&&a.length>0?(n=e(a[0]),s=e.contains(n[0],o[0])):(t=o.closest("label"),s=t.length>0,n=s?t:e(this.document[0].getElementsByTagName("label")).filter("[for='"+i(o[0].id)+"']").first()),{element:n,isParent:s}},_enhance:function(){this.label.addClass("ui-btn ui-corner-all"),this.labelIsParent?this.input.add(this.label).wrapAll(this._wrapper()):(this.element.wrap(this._wrapper()),this.element.parent().prepend(this.label)),this._setOptions({theme:this.options.theme,iconpos:this.options.iconpos,mini:this.options.mini})},_wrapper:function(){return e("<div class='"+(this.options.wrapperClass?this.options.wrapperClass:"")+" ui-"+this.inputtype+(this.options.disabled?" ui-state-disabled":"")+"' ></div>")},_handleInputFocus:function(){this.label.addClass(e.mobile.focusClass)
|
|
},_handleInputBlur:function(){this.label.removeClass(e.mobile.focusClass)},_handleInputVClick:function(){this.element.prop("checked",this.element.is(":checked")),this._getInputSet().not(this.element).prop("checked",!1),this._updateAll(!0)},_handleLabelVMouseOver:function(e){this.label.parent().hasClass("ui-state-disabled")&&e.stopPropagation()},_handleLabelVClick:function(e){var t=this.element;return t.is(":disabled")?void e.preventDefault():(this._cacheVals(),t.prop("checked","radio"===this.inputtype&&!0||!t.prop("checked")),t.triggerHandler("click"),this._getInputSet().not(t).prop("checked",!1),this._updateAll(),!1)},_cacheVals:function(){this._getInputSet().each(function(){e(this).attr("data-"+e.mobile.ns+"cacheVal",this.checked)})},_getInputSet:function(){var t,n,s=this.element[0],o=s.name,a=s.form,r=this.element.parents().last().get(0),l=this.element;return o&&"radio"===this.inputtype&&r&&(t="input[type='radio'][name='"+i(o)+"']",a?(n=a.getAttribute("id"),n&&(l=e(t+"[form='"+i(n)+"']",r)),l=e(a).find(t).filter(function(){return this.form===a}).add(l)):l=e(t,r).filter(function(){return!this.form})),l},_updateAll:function(t){var i=this;this._getInputSet().each(function(){var n=e(this);!this.checked&&"checkbox"!==i.inputtype||t||n.trigger("change")}).checkboxradio("refresh")},_reset:function(){this.refresh()},_hasIcon:function(){var t,i,n=e.mobile.controlgroup;return n&&(t=this.element.closest(":mobile-controlgroup,"+n.prototype.initSelector),t.length>0)?(i=e.data(t[0],"mobile-controlgroup"),"horizontal"!==(i?i.options.type:t.attr("data-"+e.mobile.ns+"type"))):!0},refresh:function(){var t=this.element[0].checked,i=e.mobile.activeBtnClass,n="ui-btn-icon-"+this.options.iconpos,s=[],o=[];this._hasIcon()?(o.push(i),s.push(n)):(o.push(n),(t?s:o).push(i)),t?(s.push(this.checkedClass),o.push(this.uncheckedClass)):(s.push(this.uncheckedClass),o.push(this.checkedClass)),this.widget().toggleClass("ui-state-disabled",this.element.prop("disabled")),this.label.addClass(s.join(" ")).removeClass(o.join(" "))},widget:function(){return this.label.parent()},_setOptions:function(e){var i=this.label,n=this.options,s=this.widget(),o=this._hasIcon();e.disabled!==t&&(this.input.prop("disabled",!!e.disabled),s.toggleClass("ui-state-disabled",!!e.disabled)),e.mini!==t&&s.toggleClass("ui-mini",!!e.mini),e.theme!==t&&i.removeClass("ui-btn-"+n.theme).addClass("ui-btn-"+e.theme),e.wrapperClass!==t&&s.removeClass(n.wrapperClass).addClass(e.wrapperClass),e.iconpos!==t&&o?i.removeClass("ui-btn-icon-"+n.iconpos).addClass("ui-btn-icon-"+e.iconpos):o||i.removeClass("ui-btn-icon-"+n.iconpos),this._super(e)}},e.mobile.behaviors.formReset))}(e),function(e,t){e.widget("mobile.textinput",e.mobile.textinput,{options:{clearBtn:!1,clearBtnText:"Clear text"},_create:function(){this._super(),this.isSearch&&(this.options.clearBtn=!0),this.options.clearBtn&&this.inputNeedsWrap&&this._addClearBtn()},clearButton:function(){return e("<a href='#' tabindex='-1' aria-hidden='true' class='ui-input-clear ui-btn ui-icon-delete ui-btn-icon-notext ui-corner-all'></a>").attr("title",this.options.clearBtnText).text(this.options.clearBtnText)},_clearBtnClick:function(e){this.element.val("").focus().trigger("change"),this._clearBtn.addClass("ui-input-clear-hidden"),e.preventDefault()},_addClearBtn:function(){this.options.enhanced||this._enhanceClear(),e.extend(this,{_clearBtn:this.widget().find("a.ui-input-clear")}),this._bindClearEvents(),this._toggleClear()},_enhanceClear:function(){this.clearButton().appendTo(this.widget()),this.widget().addClass("ui-input-has-clear")},_bindClearEvents:function(){this._on(this._clearBtn,{click:"_clearBtnClick"}),this._on({keyup:"_toggleClear",change:"_toggleClear",input:"_toggleClear",focus:"_toggleClear",blur:"_toggleClear",cut:"_toggleClear",paste:"_toggleClear"})},_unbindClear:function(){this._off(this._clearBtn,"click"),this._off(this.element,"keyup change input focus blur cut paste")},_setOptions:function(e){this._super(e),e.clearBtn===t||this.element.is("textarea, :jqmData(type='range')")||(e.clearBtn?this._addClearBtn():this._destroyClear()),e.clearBtnText!==t&&this._clearBtn!==t&&this._clearBtn.text(e.clearBtnText).attr("title",e.clearBtnText)},_toggleClear:function(){this._delay("_toggleClearClass",0)},_toggleClearClass:function(){this._clearBtn.toggleClass("ui-input-clear-hidden",!this.element.val())},_destroyClear:function(){this.widget().removeClass("ui-input-has-clear"),this._unbindClear(),this._clearBtn.remove()},_destroy:function(){this._super(),this.options.clearBtn&&this._destroyClear()}})}(e),function(e,t){e.widget("mobile.flipswitch",e.extend({options:{onText:"On",offText:"Off",theme:null,enhanced:!1,wrapperClass:null,corners:!0,mini:!1},_create:function(){this.options.enhanced?e.extend(this,{flipswitch:this.element.parent(),on:this.element.find(".ui-flipswitch-on").eq(0),off:this.element.find(".ui-flipswitch-off").eq(0),type:this.element.get(0).tagName}):this._enhance(),this._handleFormReset(),this._originalTabIndex=this.element.attr("tabindex"),null!=this._originalTabIndex&&this.on.attr("tabindex",this._originalTabIndex),this.element.attr("tabindex","-1"),this._on({focus:"_handleInputFocus"}),this.element.is(":disabled")&&this._setOptions({disabled:!0}),this._on(this.flipswitch,{click:"_toggle",swipeleft:"_left",swiperight:"_right"}),this._on(this.on,{keydown:"_keydown"}),this._on({change:"refresh"})},_handleInputFocus:function(){this.on.focus()},widget:function(){return this.flipswitch},_left:function(){this.flipswitch.removeClass("ui-flipswitch-active"),"SELECT"===this.type?this.element.get(0).selectedIndex=0:this.element.prop("checked",!1),this.element.trigger("change")},_right:function(){this.flipswitch.addClass("ui-flipswitch-active"),"SELECT"===this.type?this.element.get(0).selectedIndex=1:this.element.prop("checked",!0),this.element.trigger("change")},_enhance:function(){var t=e("<div>"),i=this.options,n=this.element,s=i.theme?i.theme:"inherit",o=e("<a></a>",{href:"#"}),a=e("<span></span>"),r=n.get(0).tagName,l="INPUT"===r?i.onText:n.find("option").eq(1).text(),h="INPUT"===r?i.offText:n.find("option").eq(0).text();o.addClass("ui-flipswitch-on ui-btn ui-shadow ui-btn-inherit").text(l),a.addClass("ui-flipswitch-off").text(h),t.addClass("ui-flipswitch ui-shadow-inset ui-bar-"+s+" "+(i.wrapperClass?i.wrapperClass:"")+" "+(n.is(":checked")||n.find("option").eq(1).is(":selected")?"ui-flipswitch-active":"")+(n.is(":disabled")?" ui-state-disabled":"")+(i.corners?" ui-corner-all":"")+(i.mini?" ui-mini":"")).append(o,a),n.addClass("ui-flipswitch-input").after(t).appendTo(t),e.extend(this,{flipswitch:t,on:o,off:a,type:r})},_reset:function(){this.refresh()},refresh:function(){var e,t=this.flipswitch.hasClass("ui-flipswitch-active")?"_right":"_left";e="SELECT"===this.type?this.element.get(0).selectedIndex>0?"_right":"_left":this.element.prop("checked")?"_right":"_left",e!==t&&this[e]()},_toggle:function(){var e=this.flipswitch.hasClass("ui-flipswitch-active")?"_left":"_right";this[e]()},_keydown:function(t){t.which===e.mobile.keyCode.LEFT?this._left():t.which===e.mobile.keyCode.RIGHT?this._right():t.which===e.mobile.keyCode.SPACE&&(this._toggle(),t.preventDefault())},_setOptions:function(e){if(e.theme!==t){var i=e.theme?e.theme:"inherit",n=e.theme?e.theme:"inherit";this.widget().removeClass("ui-bar-"+i).addClass("ui-bar-"+n)}e.onText!==t&&this.on.text(e.onText),e.offText!==t&&this.off.text(e.offText),e.disabled!==t&&this.widget().toggleClass("ui-state-disabled",e.disabled),e.mini!==t&&this.widget().toggleClass("ui-mini",e.mini),e.corners!==t&&this.widget().toggleClass("ui-corner-all",e.corners),this._super(e)},_destroy:function(){this.options.enhanced||(null!=this._originalTabIndex?this.element.attr("tabindex",this._originalTabIndex):this.element.removeAttr("tabindex"),this.on.remove(),this.off.remove(),this.element.unwrap(),this.flipswitch.remove(),this.removeClass("ui-flipswitch-input"))}},e.mobile.behaviors.formReset))}(e),function(e,n){e.widget("mobile.slider",e.extend({initSelector:"input[type='range'], :jqmData(type='range'), :jqmData(role='slider')",widgetEventPrefix:"slide",options:{theme:null,trackTheme:null,corners:!0,mini:!1,highlight:!1},_create:function(){var s,o,a,r,l,h,c,u,d,p,m=this,f=this.element,g=this.options.trackTheme||e.mobile.getAttribute(f[0],"theme"),b=g?" ui-bar-"+g:" ui-bar-inherit",v=this.options.corners||f.jqmData("corners")?" ui-corner-all":"",_=this.options.mini||f.jqmData("mini")?" ui-mini":"",C=f[0].nodeName.toLowerCase(),w="select"===C,y=f.parent().is(":jqmData(role='rangeslider')"),x=w?"ui-slider-switch":"",T=f.attr("id"),k=e("[for='"+T+"']"),P=k.attr("id")||T+"-label",D=w?0:parseFloat(f.attr("min")),E=w?f.find("option").length-1:parseFloat(f.attr("max")),S=t.parseFloat(f.attr("step")||1),B=i.createElement("a"),I=e(B),O=i.createElement("div"),A=e(O),N=this.options.highlight&&!w?function(){var t=i.createElement("div");return t.className="ui-slider-bg "+e.mobile.activeBtnClass,e(t).prependTo(A)}():!1;if(k.attr("id",P),this.isToggleSwitch=w,B.setAttribute("href","#"),O.setAttribute("role","application"),O.className=[this.isToggleSwitch?"ui-slider ui-slider-track ui-shadow-inset ":"ui-slider-track ui-shadow-inset ",x,b,v,_].join(""),B.className="ui-slider-handle",O.appendChild(B),I.attr({role:"slider","aria-valuemin":D,"aria-valuemax":E,"aria-valuenow":this._value(),"aria-valuetext":this._value(),title:this._value(),"aria-labelledby":P}),e.extend(this,{slider:A,handle:I,control:f,type:C,step:S,max:E,min:D,valuebg:N,isRangeslider:y,dragging:!1,beforeStart:null,userModified:!1,mouseMoved:!1}),w){for(c=f.attr("tabindex"),c&&I.attr("tabindex",c),f.attr("tabindex","-1").focus(function(){e(this).blur(),I.focus()}),o=i.createElement("div"),o.className="ui-slider-inneroffset",a=0,r=O.childNodes.length;r>a;a++)o.appendChild(O.childNodes[a]);for(O.appendChild(o),I.addClass("ui-slider-handle-snapping"),s=f.find("option"),l=0,h=s.length;h>l;l++)u=l?"a":"b",d=l?" "+e.mobile.activeBtnClass:"",p=i.createElement("span"),p.className=["ui-slider-label ui-slider-label-",u,d].join(""),p.setAttribute("role","img"),p.appendChild(i.createTextNode(s[l].innerHTML)),e(p).prependTo(A);m._labels=e(".ui-slider-label",A)}f.addClass(w?"ui-slider-switch":"ui-slider-input"),this._on(f,{change:"_controlChange",keyup:"_controlKeyup",blur:"_controlBlur",vmouseup:"_controlVMouseUp"}),A.bind("vmousedown",e.proxy(this._sliderVMouseDown,this)).bind("vclick",!1),this._on(i,{vmousemove:"_preventDocumentDrag"}),this._on(A.add(i),{vmouseup:"_sliderVMouseUp"}),A.insertAfter(f),w||y||(o=this.options.mini?"<div class='ui-slider ui-mini'>":"<div class='ui-slider'>",f.add(A).wrapAll(o)),this._on(this.handle,{vmousedown:"_handleVMouseDown",keydown:"_handleKeydown",keyup:"_handleKeyup"}),this.handle.bind("vclick",!1),this._handleFormReset(),this.refresh(n,n,!0)},_setOptions:function(e){e.theme!==n&&this._setTheme(e.theme),e.trackTheme!==n&&this._setTrackTheme(e.trackTheme),e.corners!==n&&this._setCorners(e.corners),e.mini!==n&&this._setMini(e.mini),e.highlight!==n&&this._setHighlight(e.highlight),e.disabled!==n&&this._setDisabled(e.disabled),this._super(e)},_controlChange:function(e){return this._trigger("controlchange",e)===!1?!1:void(this.mouseMoved||this.refresh(this._value(),!0))},_controlKeyup:function(){this.refresh(this._value(),!0,!0)},_controlBlur:function(){this.refresh(this._value(),!0)},_controlVMouseUp:function(){this._checkedRefresh()},_handleVMouseDown:function(){this.handle.focus()},_handleKeydown:function(t){var i=this._value();if(!this.options.disabled){switch(t.keyCode){case e.mobile.keyCode.HOME:case e.mobile.keyCode.END:case e.mobile.keyCode.PAGE_UP:case e.mobile.keyCode.PAGE_DOWN:case e.mobile.keyCode.UP:case e.mobile.keyCode.RIGHT:case e.mobile.keyCode.DOWN:case e.mobile.keyCode.LEFT:t.preventDefault(),this._keySliding||(this._keySliding=!0,this.handle.addClass("ui-state-active"))}switch(t.keyCode){case e.mobile.keyCode.HOME:this.refresh(this.min);break;case e.mobile.keyCode.END:this.refresh(this.max);break;case e.mobile.keyCode.PAGE_UP:case e.mobile.keyCode.UP:case e.mobile.keyCode.RIGHT:this.refresh(i+this.step);break;case e.mobile.keyCode.PAGE_DOWN:case e.mobile.keyCode.DOWN:case e.mobile.keyCode.LEFT:this.refresh(i-this.step)}}},_handleKeyup:function(){this._keySliding&&(this._keySliding=!1,this.handle.removeClass("ui-state-active"))},_sliderVMouseDown:function(e){return this.options.disabled||1!==e.which&&0!==e.which&&e.which!==n?!1:this._trigger("beforestart",e)===!1?!1:(this.dragging=!0,this.userModified=!1,this.mouseMoved=!1,this.isToggleSwitch&&(this.beforeStart=this.element[0].selectedIndex),this.refresh(e),this._trigger("start"),!1)},_sliderVMouseUp:function(){return this.dragging?(this.dragging=!1,this.isToggleSwitch&&(this.handle.addClass("ui-slider-handle-snapping"),this.refresh(this.mouseMoved?this.userModified?0===this.beforeStart?1:0:this.beforeStart:0===this.beforeStart?1:0)),this.mouseMoved=!1,this._trigger("stop"),!1):void 0},_preventDocumentDrag:function(e){return this._trigger("drag",e)===!1?!1:this.dragging&&!this.options.disabled?(this.mouseMoved=!0,this.isToggleSwitch&&this.handle.removeClass("ui-slider-handle-snapping"),this.refresh(e),this.userModified=this.beforeStart!==this.element[0].selectedIndex,!1):void 0},_checkedRefresh:function(){this.value!==this._value()&&this.refresh(this._value())},_value:function(){return this.isToggleSwitch?this.element[0].selectedIndex:parseFloat(this.element.val())},_reset:function(){this.refresh(n,!1,!0)},refresh:function(t,n,s){var o,a,r,l,h,c,u,d,p,m,f,g,b,v,_,C,w,y,x,T,k=this,P=e.mobile.getAttribute(this.element[0],"theme"),D=this.options.theme||P,E=D?" ui-btn-"+D:"",S=this.options.trackTheme||P,B=S?" ui-bar-"+S:" ui-bar-inherit",I=this.options.corners?" ui-corner-all":"",O=this.options.mini?" ui-mini":"";if(k.slider[0].className=[this.isToggleSwitch?"ui-slider ui-slider-switch ui-slider-track ui-shadow-inset":"ui-slider-track ui-shadow-inset",B,I,O].join(""),(this.options.disabled||this.element.prop("disabled"))&&this.disable(),this.value=this._value(),this.options.highlight&&!this.isToggleSwitch&&0===this.slider.find(".ui-slider-bg").length&&(this.valuebg=function(){var t=i.createElement("div");return t.className="ui-slider-bg "+e.mobile.activeBtnClass,e(t).prependTo(k.slider)}()),this.handle.addClass("ui-btn"+E+" ui-shadow"),u=this.element,d=!this.isToggleSwitch,p=d?[]:u.find("option"),m=d?parseFloat(u.attr("min")):0,f=d?parseFloat(u.attr("max")):p.length-1,g=d&&parseFloat(u.attr("step"))>0?parseFloat(u.attr("step")):1,"object"==typeof t){if(r=t,l=8,o=this.slider.offset().left,a=this.slider.width(),h=a/((f-m)/g),!this.dragging||r.pageX<o-l||r.pageX>o+a+l)return;c=h>1?(r.pageX-o)/a*100:Math.round((r.pageX-o)/a*100)}else null==t&&(t=d?parseFloat(u.val()||0):u[0].selectedIndex),c=(parseFloat(t)-m)/(f-m)*100;if(!isNaN(c)&&(b=c/100*(f-m)+m,v=(b-m)%g,_=b-v,2*Math.abs(v)>=g&&(_+=v>0?g:-g),C=100/((f-m)/g),b=parseFloat(_.toFixed(5)),"undefined"==typeof h&&(h=a/((f-m)/g)),h>1&&d&&(c=(b-m)*C*(1/g)),0>c&&(c=0),c>100&&(c=100),m>b&&(b=m),b>f&&(b=f),this.handle.css("left",c+"%"),this.handle[0].setAttribute("aria-valuenow",d?b:p.eq(b).attr("value")),this.handle[0].setAttribute("aria-valuetext",d?b:p.eq(b).getEncodedText()),this.handle[0].setAttribute("title",d?b:p.eq(b).getEncodedText()),this.valuebg&&this.valuebg.css("width",c+"%"),this._labels&&(w=this.handle.width()/this.slider.width()*100,y=c&&w+(100-w)*c/100,x=100===c?0:Math.min(w+100-y,100),this._labels.each(function(){var t=e(this).hasClass("ui-slider-label-a");e(this).width((t?y:x)+"%")})),!s)){if(T=!1,d?(T=parseFloat(u.val())!==b,u.val(b)):(T=u[0].selectedIndex!==b,u[0].selectedIndex=b),this._trigger("beforechange",t)===!1)return!1;!n&&T&&u.trigger("change")}},_setHighlight:function(e){e=!!e,e?(this.options.highlight=!!e,this.refresh()):this.valuebg&&(this.valuebg.remove(),this.valuebg=!1)},_setTheme:function(e){this.handle.removeClass("ui-btn-"+this.options.theme).addClass("ui-btn-"+e);var t=this.options.theme?this.options.theme:"inherit",i=e?e:"inherit";this.control.removeClass("ui-body-"+t).addClass("ui-body-"+i)},_setTrackTheme:function(e){var t=this.options.trackTheme?this.options.trackTheme:"inherit",i=e?e:"inherit";this.slider.removeClass("ui-body-"+t).addClass("ui-body-"+i)},_setMini:function(e){e=!!e,this.isToggleSwitch||this.isRangeslider||(this.slider.parent().toggleClass("ui-mini",e),this.element.toggleClass("ui-mini",e)),this.slider.toggleClass("ui-mini",e)},_setCorners:function(e){this.slider.toggleClass("ui-corner-all",e),this.isToggleSwitch||this.control.toggleClass("ui-corner-all",e)},_setDisabled:function(e){e=!!e,this.element.prop("disabled",e),this.slider.toggleClass("ui-state-disabled",e).attr("aria-disabled",e),this.element.toggleClass("ui-state-disabled",e)}},e.mobile.behaviors.formReset))}(e),function(e,t){e.widget("mobile.rangeslider",e.extend({options:{theme:null,trackTheme:null,corners:!0,mini:!1,highlight:!0},_create:function(){var t=this.element,i=this.options.mini?"ui-rangeslider ui-mini":"ui-rangeslider",n=t.find("input").first(),s=t.find("input").last(),o=t.find("label").first(),a=e.data(n.get(0),"mobile-slider")||e.data(n.slider().get(0),"mobile-slider"),r=e.data(s.get(0),"mobile-slider")||e.data(s.slider().get(0),"mobile-slider"),l=a.slider,h=r.slider,c=a.handle,u=e("<div class='ui-rangeslider-sliders' />").appendTo(t);n.addClass("ui-rangeslider-first"),s.addClass("ui-rangeslider-last"),t.addClass(i),l.appendTo(u),h.appendTo(u),o.insertBefore(t),c.prependTo(h),e.extend(this,{_inputFirst:n,_inputLast:s,_sliderFirst:l,_sliderLast:h,_label:o,_targetVal:null,_sliderTarget:!1,_sliders:u,_proxy:!1}),this.refresh(),this._on(this.element.find("input.ui-slider-input"),{slidebeforestart:"_slidebeforestart",slidestop:"_slidestop",slidedrag:"_slidedrag",slidebeforechange:"_change",blur:"_change",keyup:"_change"}),this._on({mousedown:"_change"}),this._on(this.element.closest("form"),{reset:"_handleReset"}),this._on(c,{vmousedown:"_dragFirstHandle"})},_handleReset:function(){var e=this;setTimeout(function(){e._updateHighlight()},0)},_dragFirstHandle:function(t){return e.data(this._inputFirst.get(0),"mobile-slider").dragging=!0,e.data(this._inputFirst.get(0),"mobile-slider").refresh(t),e.data(this._inputFirst.get(0),"mobile-slider")._trigger("start"),!1},_slidedrag:function(t){var i=e(t.target).is(this._inputFirst),n=i?this._inputLast:this._inputFirst;return this._sliderTarget=!1,"first"===this._proxy&&i||"last"===this._proxy&&!i?(e.data(n.get(0),"mobile-slider").dragging=!0,e.data(n.get(0),"mobile-slider").refresh(t),!1):void 0},_slidestop:function(t){var i=e(t.target).is(this._inputFirst);this._proxy=!1,this.element.find("input").trigger("vmouseup"),this._sliderFirst.css("z-index",i?1:"")},_slidebeforestart:function(t){this._sliderTarget=!1,e(t.originalEvent.target).hasClass("ui-slider-track")&&(this._sliderTarget=!0,this._targetVal=e(t.target).val())},_setOptions:function(e){e.theme!==t&&this._setTheme(e.theme),e.trackTheme!==t&&this._setTrackTheme(e.trackTheme),e.mini!==t&&this._setMini(e.mini),e.highlight!==t&&this._setHighlight(e.highlight),e.disabled!==t&&this._setDisabled(e.disabled),this._super(e),this.refresh()},refresh:function(){var e=this.element,t=this.options;(this._inputFirst.is(":disabled")||this._inputLast.is(":disabled"))&&(this.options.disabled=!0),e.find("input").slider({theme:t.theme,trackTheme:t.trackTheme,disabled:t.disabled,corners:t.corners,mini:t.mini,highlight:t.highlight}).slider("refresh"),this._updateHighlight()},_change:function(t){if("keyup"===t.type)return this._updateHighlight(),!1;var i=this,n=parseFloat(this._inputFirst.val(),10),s=parseFloat(this._inputLast.val(),10),o=e(t.target).hasClass("ui-rangeslider-first"),a=o?this._inputFirst:this._inputLast,r=o?this._inputLast:this._inputFirst;if(this._inputFirst.val()>this._inputLast.val()&&"mousedown"===t.type&&!e(t.target).hasClass("ui-slider-handle"))a.blur();else if("mousedown"===t.type)return;return n>s&&!this._sliderTarget?(a.val(o?s:n).slider("refresh"),this._trigger("normalize")):n>s&&(a.val(this._targetVal).slider("refresh"),setTimeout(function(){r.val(o?n:s).slider("refresh"),e.data(r.get(0),"mobile-slider").handle.focus(),i._sliderFirst.css("z-index",o?"":1),i._trigger("normalize")},0),this._proxy=o?"first":"last"),n===s?(e.data(a.get(0),"mobile-slider").handle.css("z-index",1),e.data(r.get(0),"mobile-slider").handle.css("z-index",0)):(e.data(r.get(0),"mobile-slider").handle.css("z-index",""),e.data(a.get(0),"mobile-slider").handle.css("z-index","")),this._updateHighlight(),n>=s?!1:void 0},_updateHighlight:function(){var t=parseInt(e.data(this._inputFirst.get(0),"mobile-slider").handle.get(0).style.left,10),i=parseInt(e.data(this._inputLast.get(0),"mobile-slider").handle.get(0).style.left,10),n=i-t;this.element.find(".ui-slider-bg").css({"margin-left":t+"%",width:n+"%"})},_setTheme:function(e){this._inputFirst.slider("option","theme",e),this._inputLast.slider("option","theme",e)},_setTrackTheme:function(e){this._inputFirst.slider("option","trackTheme",e),this._inputLast.slider("option","trackTheme",e)},_setMini:function(e){this._inputFirst.slider("option","mini",e),this._inputLast.slider("option","mini",e),this.element.toggleClass("ui-mini",!!e)},_setHighlight:function(e){this._inputFirst.slider("option","highlight",e),this._inputLast.slider("option","highlight",e)},_setDisabled:function(e){this._inputFirst.prop("disabled",e),this._inputLast.prop("disabled",e)},_destroy:function(){this._label.prependTo(this.element),this.element.removeClass("ui-rangeslider ui-mini"),this._inputFirst.after(this._sliderFirst),this._inputLast.after(this._sliderLast),this._sliders.remove(),this.element.find("input").removeClass("ui-rangeslider-first ui-rangeslider-last").slider("destroy")}},e.mobile.behaviors.formReset))}(e),function(e){e.widget("mobile.selectmenu",e.extend({initSelector:"select:not( :jqmData(role='slider')):not( :jqmData(role='flipswitch') )",options:{theme:null,icon:"carat-d",iconpos:"right",inline:!1,corners:!0,shadow:!0,iconshadow:!1,overlayTheme:null,dividerTheme:null,hidePlaceholderMenuItems:!0,closeText:"Close",nativeMenu:!0,preventFocusZoom:/iPhone|iPad|iPod/.test(navigator.platform)&&navigator.userAgent.indexOf("AppleWebKit")>-1,mini:!1},_button:function(){return e("<div/>")},_setDisabled:function(e){return this.element.attr("disabled",e),this.button.attr("aria-disabled",e),this._setOption("disabled",e)},_focusButton:function(){var e=this;setTimeout(function(){e.button.focus()},40)},_selectOptions:function(){return this.select.find("option")},_preExtension:function(){var t=this.options.inline||this.element.jqmData("inline"),i=this.options.mini||this.element.jqmData("mini"),n="";~this.element[0].className.indexOf("ui-btn-left")&&(n=" ui-btn-left"),~this.element[0].className.indexOf("ui-btn-right")&&(n=" ui-btn-right"),t&&(n+=" ui-btn-inline"),i&&(n+=" ui-mini"),this.select=this.element.removeClass("ui-btn-left ui-btn-right").wrap("<div class='ui-select"+n+"'>"),this.selectId=this.select.attr("id")||"select-"+this.uuid,this.buttonId=this.selectId+"-button",this.label=e("label[for='"+this.selectId+"']"),this.isMultiple=this.select[0].multiple},_destroy:function(){var e=this.element.parents(".ui-select");e.length>0&&(e.is(".ui-btn-left, .ui-btn-right")&&this.element.addClass(e.hasClass("ui-btn-left")?"ui-btn-left":"ui-btn-right"),this.element.insertAfter(e),e.remove())},_create:function(){this._preExtension(),this.button=this._button();var i=this,n=this.options,s=n.icon?n.iconpos||this.select.jqmData("iconpos"):!1,o=this.button.insertBefore(this.select).attr("id",this.buttonId).addClass("ui-btn"+(n.icon?" ui-icon-"+n.icon+" ui-btn-icon-"+s+(n.iconshadow?" ui-shadow-icon":""):"")+(n.theme?" ui-btn-"+n.theme:"")+(n.corners?" ui-corner-all":"")+(n.shadow?" ui-shadow":""));this.setButtonText(),n.nativeMenu&&t.opera&&t.opera.version&&o.addClass("ui-select-nativeonly"),this.isMultiple&&(this.buttonCount=e("<span>").addClass("ui-li-count ui-body-inherit").hide().appendTo(o.addClass("ui-li-has-count"))),(n.disabled||this.element.attr("disabled"))&&this.disable(),this.select.change(function(){i.refresh(),n.nativeMenu&&i._delay(function(){i.select.blur()})}),this._handleFormReset(),this._on(this.button,{keydown:"_handleKeydown"}),this.build()},build:function(){var t=this;this.select.appendTo(t.button).bind("vmousedown",function(){t.button.addClass(e.mobile.activeBtnClass)}).bind("focus",function(){t.button.addClass(e.mobile.focusClass)}).bind("blur",function(){t.button.removeClass(e.mobile.focusClass)}).bind("focus vmouseover",function(){t.button.trigger("vmouseover")}).bind("vmousemove",function(){t.button.removeClass(e.mobile.activeBtnClass)}).bind("change blur vmouseout",function(){t.button.trigger("vmouseout").removeClass(e.mobile.activeBtnClass)}),t.button.bind("vmousedown",function(){t.options.preventFocusZoom&&e.mobile.zoom.disable(!0)}),t.label.bind("click focus",function(){t.options.preventFocusZoom&&e.mobile.zoom.disable(!0)}),t.select.bind("focus",function(){t.options.preventFocusZoom&&e.mobile.zoom.disable(!0)}),t.button.bind("mouseup",function(){t.options.preventFocusZoom&&setTimeout(function(){e.mobile.zoom.enable(!0)},0)}),t.select.bind("blur",function(){t.options.preventFocusZoom&&e.mobile.zoom.enable(!0)})},selected:function(){return this._selectOptions().filter(":selected")},selectedIndices:function(){var e=this;return this.selected().map(function(){return e._selectOptions().index(this)}).get()},setButtonText:function(){var t=this,n=this.selected(),s=this.placeholder,o=e(i.createElement("span"));this.button.children("span").not(".ui-li-count").remove().end().end().prepend(function(){return s=n.length?n.map(function(){return e(this).text()}).get().join(", "):t.placeholder,s?o.text(s):o.html(" "),o.addClass(t.select.attr("class")).addClass(n.attr("class")).removeClass("ui-screen-hidden")}())},setButtonCount:function(){var e=this.selected();this.isMultiple&&this.buttonCount[e.length>1?"show":"hide"]().text(e.length)},_handleKeydown:function(){this._delay("_refreshButton")},_reset:function(){this.refresh()},_refreshButton:function(){this.setButtonText(),this.setButtonCount()},refresh:function(){this._refreshButton()},open:e.noop,close:e.noop,disable:function(){this._setDisabled(!0),this.button.addClass("ui-state-disabled")},enable:function(){this._setDisabled(!1),this.button.removeClass("ui-state-disabled")}},e.mobile.behaviors.formReset))}(e),function(e){function t(){return i||(i=e("<div></div>",{"class":"ui-slider-popup ui-shadow ui-corner-all"})),i.clone()}var i;e.widget("mobile.slider",e.mobile.slider,{options:{popupEnabled:!1,showValue:!1},_create:function(){this._super(),e.extend(this,{_currentValue:null,_popup:null,_popupVisible:!1}),this._setOption("popupEnabled",this.options.popupEnabled),this._on(this.handle,{vmousedown:"_showPopup"}),this._on(this.slider.add(this.document),{vmouseup:"_hidePopup"}),this._refresh()},_positionPopup:function(){var e=this.handle.offset();this._popup.offset({left:e.left+(this.handle.width()-this._popup.width())/2,top:e.top-this._popup.outerHeight()-5})},_setOption:function(e,i){this._super(e,i),"showValue"===e?this.handle.html(i&&!this.options.mini?this._value():""):"popupEnabled"===e&&i&&!this._popup&&(this._popup=t().addClass("ui-body-"+(this.options.theme||"a")).hide().insertBefore(this.element))},refresh:function(){this._super.apply(this,arguments),this._refresh()},_refresh:function(){var e,t=this.options;t.popupEnabled&&this.handle.removeAttr("title"),e=this._value(),e!==this._currentValue&&(this._currentValue=e,t.popupEnabled&&this._popup&&(this._positionPopup(),this._popup.html(e)),t.showValue&&!this.options.mini&&this.handle.html(e))},_showPopup:function(){this.options.popupEnabled&&!this._popupVisible&&(this.handle.html(""),this._popup.show(),this._positionPopup(),this._popupVisible=!0)},_hidePopup:function(){var e=this.options;e.popupEnabled&&this._popupVisible&&(e.showValue&&!e.mini&&this.handle.html(this._value()),this._popup.hide(),this._popupVisible=!1)}})}(e),function(e){var t=e.mobile.getAttribute;e.widget("mobile.listview",e.extend({options:{theme:null,countTheme:null,dividerTheme:null,icon:"carat-r",splitIcon:"carat-r",splitTheme:null,corners:!0,shadow:!0,inset:!1},_create:function(){var e=this,t="";t+=e.options.inset?" ui-listview-inset":"",e.options.inset&&(t+=e.options.corners?" ui-corner-all":"",t+=e.options.shadow?" ui-shadow":""),e.element.addClass(" ui-listview"+t),e.refresh(!0)},_findFirstElementByTagName:function(e,t,i,n){var s={};for(s[i]=s[n]=!0;e;){if(s[e.nodeName])return e;e=e[t]}return null},_addThumbClasses:function(t){var i,n,s=t.length;for(i=0;s>i;i++)n=e(this._findFirstElementByTagName(t[i].firstChild,"nextSibling","img","IMG")),n.length&&e(this._findFirstElementByTagName(n[0].parentNode,"parentNode","li","LI")).addClass(n.hasClass("ui-li-icon")?"ui-li-has-icon":"ui-li-has-thumb")},_getChildrenByTagName:function(t,i,n){var s=[],o={};for(o[i]=o[n]=!0,t=t.firstChild;t;)o[t.nodeName]&&s.push(t),t=t.nextSibling;return e(s)},_beforeListviewRefresh:e.noop,_afterListviewRefresh:e.noop,refresh:function(i){var n,s,o,a,r,l,h,c,u,d,p,m,f,g,b,v,_,C,w,y,x=this.options,T=this.element,k=!!e.nodeName(T[0],"ol"),P=T.attr("start"),D={},E=T.find(".ui-li-count"),S=t(T[0],"counttheme")||this.options.countTheme,B=S?"ui-body-"+S:"ui-body-inherit";for(x.theme&&T.addClass("ui-group-theme-"+x.theme),k&&(P||0===P)&&(p=parseInt(P,10)-1,T.css("counter-reset","listnumbering "+p)),this._beforeListviewRefresh(),y=this._getChildrenByTagName(T[0],"li","LI"),s=0,o=y.length;o>s;s++)a=y.eq(s),r="",(i||a[0].className.search(/\bui-li-static\b|\bui-li-divider\b/)<0)&&(u=this._getChildrenByTagName(a[0],"a","A"),d="list-divider"===t(a[0],"role"),f=a.attr("value"),l=t(a[0],"theme"),u.length&&u[0].className.search(/\bui-btn\b/)<0&&!d?(h=t(a[0],"icon"),c=h===!1?!1:h||x.icon,u.removeClass("ui-link"),n="ui-btn",l&&(n+=" ui-btn-"+l),u.length>1?(r="ui-li-has-alt",g=u.last(),b=t(g[0],"theme")||x.splitTheme||t(a[0],"theme",!0),v=b?" ui-btn-"+b:"",_=t(g[0],"icon")||t(a[0],"icon")||x.splitIcon,C="ui-btn ui-btn-icon-notext ui-icon-"+_+v,g.attr("title",e.trim(g.getEncodedText())).addClass(C).empty(),u=u.first()):c&&(n+=" ui-btn-icon-right ui-icon-"+c),u.addClass(n)):d?(w=t(a[0],"theme")||x.dividerTheme||x.theme,r="ui-li-divider ui-bar-"+(w?w:"inherit"),a.attr("role","heading")):u.length<=0&&(r="ui-li-static ui-body-"+(l?l:"inherit")),k&&f&&(m=parseInt(f,10)-1,a.css("counter-reset","listnumbering "+m))),D[r]||(D[r]=[]),D[r].push(a[0]);for(r in D)e(D[r]).addClass(r);E.each(function(){e(this).closest("li").addClass("ui-li-has-count")}),B&&E.not("[class*='ui-body-']").addClass(B),this._addThumbClasses(y),this._addThumbClasses(y.find(".ui-btn")),this._afterListviewRefresh(),this._addFirstLastClasses(y,this._getVisibles(y,i),i)}},e.mobile.behaviors.addFirstLastClasses))}(e),function(e){function t(t){var i=e.trim(t.text())||null;return i?i=i.slice(0,1).toUpperCase():null}e.widget("mobile.listview",e.mobile.listview,{options:{autodividers:!1,autodividersSelector:t},_beforeListviewRefresh:function(){this.options.autodividers&&(this._replaceDividers(),this._superApply(arguments))},_replaceDividers:function(){var t,n,s,o,a,r=null,l=this.element;for(l.children("li:jqmData(role='list-divider')").remove(),n=l.children("li"),t=0;t<n.length;t++)s=n[t],o=this.options.autodividersSelector(e(s)),o&&r!==o&&(a=i.createElement("li"),a.appendChild(i.createTextNode(o)),a.setAttribute("data-"+e.mobile.ns+"role","list-divider"),s.parentNode.insertBefore(a,s)),r=o}})}(e),function(e){var t=/(^|\s)ui-li-divider($|\s)/,i=/(^|\s)ui-screen-hidden($|\s)/;e.widget("mobile.listview",e.mobile.listview,{options:{hideDividers:!1},_afterListviewRefresh:function(){var e,n,s,o=!0;if(this._superApply(arguments),this.options.hideDividers)for(e=this._getChildrenByTagName(this.element[0],"li","LI"),n=e.length-1;n>-1;n--)s=e[n],s.className.match(t)?(o&&(s.className=s.className+" ui-screen-hidden"),o=!0):s.className.match(i)||(o=!1)
|
|
}})}(e),function(e,t){e.widget("mobile.navbar",{options:{iconpos:"top",grid:null},_create:function(){var n=this.element,s=n.find("a, button"),o=s.filter(":jqmData(icon)").length?this.options.iconpos:t;n.addClass("ui-navbar").attr("role","navigation").find("ul").jqmEnhanceable().grid({grid:this.options.grid}),s.each(function(){var t=e.mobile.getAttribute(this,"icon"),i=e.mobile.getAttribute(this,"theme"),n="ui-btn";i&&(n+=" ui-btn-"+i),t&&(n+=" ui-icon-"+t+" ui-btn-icon-"+o),e(this).addClass(n)}),n.delegate("a","vclick",function(){var t=e(this);t.hasClass("ui-state-disabled")||t.hasClass("ui-disabled")||t.hasClass(e.mobile.activeBtnClass)||(s.removeClass(e.mobile.activeBtnClass),t.addClass(e.mobile.activeBtnClass),e(i).one("pagehide",function(){t.removeClass(e.mobile.activeBtnClass)}))}),n.closest(".ui-page").bind("pagebeforeshow",function(){s.filter(".ui-state-persist").addClass(e.mobile.activeBtnClass)})}})}(e),function(e,t,i){e.widget("mobile.page",e.mobile.page,{options:{closeBtn:"left",closeBtnText:"Close",overlayTheme:"a",corners:!0,dialog:!1},_create:function(){this._super(),this.options.dialog&&(e.extend(this,{_inner:this.element.children(),_headerCloseButton:null}),this.options.enhanced||this._setCloseBtn(this.options.closeBtn))},_enhance:function(){this._super(),this.options.dialog&&this.element.addClass("ui-dialog").wrapInner(e("<div/>",{role:"dialog","class":"ui-dialog-contain ui-overlay-shadow"+(this.options.corners?" ui-corner-all":"")}))},_setOptions:function(t){var n,s,o=this.options;t.corners!==i&&this._inner.toggleClass("ui-corner-all",!!t.corners),t.overlayTheme!==i&&e.mobile.activePage[0]===this.element[0]&&(o.overlayTheme=t.overlayTheme,this._handlePageBeforeShow()),t.closeBtnText!==i&&(n=o.closeBtn,s=t.closeBtnText),t.closeBtn!==i&&(n=t.closeBtn),n&&this._setCloseBtn(n,s),this._super(t)},_handlePageBeforeShow:function(){this.options.overlayTheme&&this.options.dialog?(this.removeContainerBackground(),this.setContainerBackground(this.options.overlayTheme)):this._super()},_setCloseBtn:function(t,i){var n,s=this._headerCloseButton;t="left"===t?"left":"right"===t?"right":"none","none"===t?s&&(s.remove(),s=null):s?(s.removeClass("ui-btn-left ui-btn-right").addClass("ui-btn-"+t),i&&s.text(i)):(n=this._inner.find(":jqmData(role='header')").first(),s=e("<a></a>",{href:"#","class":"ui-btn ui-corner-all ui-icon-delete ui-btn-icon-notext ui-btn-"+t}).attr("data-"+e.mobile.ns+"rel","back").text(i||this.options.closeBtnText||"").prependTo(n)),this._headerCloseButton=s}})}(e,this),function(e,i){e.widget("mobile.panel",{options:{classes:{panel:"ui-panel",panelOpen:"ui-panel-open",panelClosed:"ui-panel-closed",panelFixed:"ui-panel-fixed",panelInner:"ui-panel-inner",modal:"ui-panel-dismiss",modalOpen:"ui-panel-dismiss-open",pageContainer:"ui-panel-page-container",pageWrapper:"ui-panel-wrapper",pageFixedToolbar:"ui-panel-fixed-toolbar",pageContentPrefix:"ui-panel-page-content",animate:"ui-panel-animate"},animate:!0,theme:null,position:"left",dismissible:!0,display:"reveal",swipeClose:!0,positionFixed:!1},_closeLink:null,_parentPage:null,_page:null,_modal:null,_panelInner:null,_wrapper:null,_fixedToolbars:null,_create:function(){var t=this.element,i=t.closest(".ui-page, :jqmData(role='page')");e.extend(this,{_closeLink:t.find(":jqmData(rel='close')"),_parentPage:i.length>0?i:!1,_openedPage:null,_page:this._getPage,_panelInner:this._getPanelInner(),_fixedToolbars:this._getFixedToolbars}),"overlay"!==this.options.display&&this._getWrapper(),this._addPanelClasses(),e.support.cssTransform3d&&this.options.animate&&this.element.addClass(this.options.classes.animate),this._bindUpdateLayout(),this._bindCloseEvents(),this._bindLinkListeners(),this._bindPageEvents(),this.options.dismissible&&this._createModal(),this._bindSwipeEvents()},_getPanelInner:function(){var e=this.element.find("."+this.options.classes.panelInner);return 0===e.length&&(e=this.element.children().wrapAll("<div class='"+this.options.classes.panelInner+"' />").parent()),e},_createModal:function(){var t=this,i=t._parentPage?t._parentPage.parent():t.element.parent();t._modal=e("<div class='"+t.options.classes.modal+"'></div>").on("mousedown",function(){t.close()}).appendTo(i)},_getPage:function(){var t=this._openedPage||this._parentPage||e("."+e.mobile.activePageClass);return t},_getWrapper:function(){var e=this._page().find("."+this.options.classes.pageWrapper);0===e.length&&(e=this._page().children(".ui-header:not(.ui-header-fixed), .ui-content:not(.ui-popup), .ui-footer:not(.ui-footer-fixed)").wrapAll("<div class='"+this.options.classes.pageWrapper+"'></div>").parent()),this._wrapper=e},_getFixedToolbars:function(){var t=e("body").children(".ui-header-fixed, .ui-footer-fixed"),i=this._page().find(".ui-header-fixed, .ui-footer-fixed"),n=t.add(i).addClass(this.options.classes.pageFixedToolbar);return n},_getPosDisplayClasses:function(e){return e+"-position-"+this.options.position+" "+e+"-display-"+this.options.display},_getPanelClasses:function(){var e=this.options.classes.panel+" "+this._getPosDisplayClasses(this.options.classes.panel)+" "+this.options.classes.panelClosed+" ui-body-"+(this.options.theme?this.options.theme:"inherit");return this.options.positionFixed&&(e+=" "+this.options.classes.panelFixed),e},_addPanelClasses:function(){this.element.addClass(this._getPanelClasses())},_handleCloseClick:function(e){e.isDefaultPrevented()||this.close()},_bindCloseEvents:function(){this._on(this._closeLink,{click:"_handleCloseClick"}),this._on({"click a:jqmData(ajax='false')":"_handleCloseClick"})},_positionPanel:function(t){var i=this,n=i._panelInner.outerHeight(),s=n>e.mobile.getScreenHeight();s||!i.options.positionFixed?(s&&(i._unfixPanel(),e.mobile.resetActivePageHeight(n)),t&&this.window[0].scrollTo(0,e.mobile.defaultHomeScroll)):i._fixPanel()},_bindFixListener:function(){this._on(e(t),{throttledresize:"_positionPanel"})},_unbindFixListener:function(){this._off(e(t),"throttledresize")},_unfixPanel:function(){this.options.positionFixed&&e.support.fixedPosition&&this.element.removeClass(this.options.classes.panelFixed)},_fixPanel:function(){this.options.positionFixed&&e.support.fixedPosition&&this.element.addClass(this.options.classes.panelFixed)},_bindUpdateLayout:function(){var e=this;e.element.on("updatelayout",function(){e._open&&e._positionPanel()})},_bindLinkListeners:function(){this._on("body",{"click a":"_handleClick"})},_handleClick:function(t){var n,s=this.element.attr("id");t.currentTarget.href.split("#")[1]===s&&s!==i&&(t.preventDefault(),n=e(t.target),n.hasClass("ui-btn")&&(n.addClass(e.mobile.activeBtnClass),this.element.one("panelopen panelclose",function(){n.removeClass(e.mobile.activeBtnClass)})),this.toggle())},_bindSwipeEvents:function(){var e=this,t=e._modal?e.element.add(e._modal):e.element;e.options.swipeClose&&("left"===e.options.position?t.on("swipeleft.panel",function(){e.close()}):t.on("swiperight.panel",function(){e.close()}))},_bindPageEvents:function(){var e=this;this.document.on("panelbeforeopen",function(t){e._open&&t.target!==e.element[0]&&e.close()}).on("keyup.panel",function(t){27===t.keyCode&&e._open&&e.close()}),this._parentPage||"overlay"===this.options.display||this._on(this.document,{pageshow:function(){this._openedPage=null,this._getWrapper()}}),e._parentPage?this.document.on("pagehide",":jqmData(role='page')",function(){e._open&&e.close(!0)}):this.document.on("pagebeforehide",function(){e._open&&e.close(!0)})},_open:!1,_pageContentOpenClasses:null,_modalOpenClasses:null,open:function(t){if(!this._open){var i=this,n=i.options,s=function(){i._off(i.document,"panelclose"),i._page().jqmData("panel","open"),e.support.cssTransform3d&&n.animate&&"overlay"!==n.display&&(i._wrapper.addClass(n.classes.animate),i._fixedToolbars().addClass(n.classes.animate)),!t&&e.support.cssTransform3d&&n.animate?(i._wrapper||i.element).animationComplete(o,"transition"):setTimeout(o,0),n.theme&&"overlay"!==n.display&&i._page().parent().addClass(n.classes.pageContainer+"-themed "+n.classes.pageContainer+"-"+n.theme),i.element.removeClass(n.classes.panelClosed).addClass(n.classes.panelOpen),i._positionPanel(!0),i._pageContentOpenClasses=i._getPosDisplayClasses(n.classes.pageContentPrefix),"overlay"!==n.display&&(i._page().parent().addClass(n.classes.pageContainer),i._wrapper.addClass(i._pageContentOpenClasses),i._fixedToolbars().addClass(i._pageContentOpenClasses)),i._modalOpenClasses=i._getPosDisplayClasses(n.classes.modal)+" "+n.classes.modalOpen,i._modal&&i._modal.addClass(i._modalOpenClasses).height(Math.max(i._modal.height(),i.document.height()))},o=function(){i._open&&("overlay"!==n.display&&(i._wrapper.addClass(n.classes.pageContentPrefix+"-open"),i._fixedToolbars().addClass(n.classes.pageContentPrefix+"-open")),i._bindFixListener(),i._trigger("open"),i._openedPage=i._page())};i._trigger("beforeopen"),"open"===i._page().jqmData("panel")?i._on(i.document,{panelclose:s}):s(),i._open=!0}},close:function(t){if(this._open){var i=this,n=this.options,s=function(){i.element.removeClass(n.classes.panelOpen),"overlay"!==n.display&&(i._wrapper.removeClass(i._pageContentOpenClasses),i._fixedToolbars().removeClass(i._pageContentOpenClasses)),!t&&e.support.cssTransform3d&&n.animate?(i._wrapper||i.element).animationComplete(o,"transition"):setTimeout(o,0),i._modal&&i._modal.removeClass(i._modalOpenClasses).height("")},o=function(){n.theme&&"overlay"!==n.display&&i._page().parent().removeClass(n.classes.pageContainer+"-themed "+n.classes.pageContainer+"-"+n.theme),i.element.addClass(n.classes.panelClosed),"overlay"!==n.display&&(i._page().parent().removeClass(n.classes.pageContainer),i._wrapper.removeClass(n.classes.pageContentPrefix+"-open"),i._fixedToolbars().removeClass(n.classes.pageContentPrefix+"-open")),e.support.cssTransform3d&&n.animate&&"overlay"!==n.display&&(i._wrapper.removeClass(n.classes.animate),i._fixedToolbars().removeClass(n.classes.animate)),i._fixPanel(),i._unbindFixListener(),e.mobile.resetActivePageHeight(),i._page().jqmRemoveData("panel"),i._trigger("close"),i._openedPage=null};i._trigger("beforeclose"),s(),i._open=!1}},toggle:function(){this[this._open?"close":"open"]()},_destroy:function(){var t,i=this.options,n=e("body > :mobile-panel").length+e.mobile.activePage.find(":mobile-panel").length>1;"overlay"!==i.display&&(t=e("body > :mobile-panel").add(e.mobile.activePage.find(":mobile-panel")),0===t.not(".ui-panel-display-overlay").not(this.element).length&&this._wrapper.children().unwrap(),this._open&&(this._fixedToolbars().removeClass(i.classes.pageContentPrefix+"-open"),e.support.cssTransform3d&&i.animate&&this._fixedToolbars().removeClass(i.classes.animate),this._page().parent().removeClass(i.classes.pageContainer),i.theme&&this._page().parent().removeClass(i.classes.pageContainer+"-themed "+i.classes.pageContainer+"-"+i.theme))),n||this.document.off("panelopen panelclose"),this._open&&this._page().jqmRemoveData("panel"),this._panelInner.children().unwrap(),this.element.removeClass([this._getPanelClasses(),i.classes.panelOpen,i.classes.animate].join(" ")).off("swipeleft.panel swiperight.panel").off("panelbeforeopen").off("panelhide").off("keyup.panel").off("updatelayout"),this._modal&&this._modal.remove()}})}(e),function(e,i){function n(e,t,i,n){var s=n;return s=t>e?i+(e-t)/2:Math.min(Math.max(i,n-t/2),i+e-t)}function s(e){return{x:e.scrollLeft(),y:e.scrollTop(),cx:e[0].innerWidth||e.width(),cy:e[0].innerHeight||e.height()}}e.widget("mobile.popup",{options:{wrapperClass:null,theme:null,overlayTheme:null,shadow:!0,corners:!0,transition:"none",positionTo:"origin",tolerance:null,closeLinkSelector:"a:jqmData(rel='back')",closeLinkEvents:"click.popup",navigateEvents:"navigate.popup",closeEvents:"navigate.popup pagebeforechange.popup",dismissible:!0,enhanced:!1,history:!e.mobile.browser.oldIE},_handleDocumentVmousedown:function(t){this._isOpen&&e.contains(this._ui.container[0],t.target)&&this._ignoreResizeEvents()},_create:function(){var t=this.element,i=t.attr("id"),n=this.options;n.history=n.history&&e.mobile.ajaxEnabled&&e.mobile.hashListeningEnabled,this._on(this.document,{vmousedown:"_handleDocumentVmousedown"}),e.extend(this,{_scrollTop:0,_page:t.closest(".ui-page"),_ui:null,_fallbackTransition:"",_currentTransition:!1,_prerequisites:null,_isOpen:!1,_tolerance:null,_resizeData:null,_ignoreResizeTo:0,_orientationchangeInProgress:!1}),0===this._page.length&&(this._page=e("body")),n.enhanced?this._ui={container:t.parent(),screen:t.parent().prev(),placeholder:e(this.document[0].getElementById(i+"-placeholder"))}:(this._ui=this._enhance(t,i),this._applyTransition(n.transition)),this._setTolerance(n.tolerance)._ui.focusElement=this._ui.container,this._on(this._ui.screen,{vclick:"_eatEventAndClose"}),this._on(this.window,{orientationchange:e.proxy(this,"_handleWindowOrientationchange"),resize:e.proxy(this,"_handleWindowResize"),keyup:e.proxy(this,"_handleWindowKeyUp")}),this._on(this.document,{focusin:"_handleDocumentFocusIn"})},_enhance:function(t,i){var n=this.options,s=n.wrapperClass,o={screen:e("<div class='ui-screen-hidden ui-popup-screen "+this._themeClassFromOption("ui-overlay-",n.overlayTheme)+"'></div>"),placeholder:e("<div style='display: none;'><!-- placeholder --></div>"),container:e("<div class='ui-popup-container ui-popup-hidden ui-popup-truncate"+(s?" "+s:"")+"'></div>")},a=this.document[0].createDocumentFragment();return a.appendChild(o.screen[0]),a.appendChild(o.container[0]),i&&(o.screen.attr("id",i+"-screen"),o.container.attr("id",i+"-popup"),o.placeholder.attr("id",i+"-placeholder").html("<!-- placeholder for "+i+" -->")),this._page[0].appendChild(a),o.placeholder.insertAfter(t),t.detach().addClass("ui-popup "+this._themeClassFromOption("ui-body-",n.theme)+" "+(n.shadow?"ui-overlay-shadow ":"")+(n.corners?"ui-corner-all ":"")).appendTo(o.container),o},_eatEventAndClose:function(e){return e.preventDefault(),e.stopImmediatePropagation(),this.options.dismissible&&this.close(),!1},_resizeScreen:function(){var e=this._ui.screen,t=this._ui.container.outerHeight(!0),i=e.removeAttr("style").height(),n=this.document.height()-1;n>i?e.height(n):t>i&&e.height(t)},_handleWindowKeyUp:function(t){return this._isOpen&&t.keyCode===e.mobile.keyCode.ESCAPE?this._eatEventAndClose(t):void 0},_expectResizeEvent:function(){var e=s(this.window);if(this._resizeData){if(e.x===this._resizeData.windowCoordinates.x&&e.y===this._resizeData.windowCoordinates.y&&e.cx===this._resizeData.windowCoordinates.cx&&e.cy===this._resizeData.windowCoordinates.cy)return!1;clearTimeout(this._resizeData.timeoutId)}return this._resizeData={timeoutId:this._delay("_resizeTimeout",200),windowCoordinates:e},!0},_resizeTimeout:function(){this._isOpen?this._expectResizeEvent()||(this._ui.container.hasClass("ui-popup-hidden")&&(this._ui.container.removeClass("ui-popup-hidden ui-popup-truncate"),this.reposition({positionTo:"window"}),this._ignoreResizeEvents()),this._resizeScreen(),this._resizeData=null,this._orientationchangeInProgress=!1):(this._resizeData=null,this._orientationchangeInProgress=!1)},_stopIgnoringResizeEvents:function(){this._ignoreResizeTo=0},_ignoreResizeEvents:function(){this._ignoreResizeTo&&clearTimeout(this._ignoreResizeTo),this._ignoreResizeTo=this._delay("_stopIgnoringResizeEvents",1e3)},_handleWindowResize:function(){this._isOpen&&0===this._ignoreResizeTo&&(!this._expectResizeEvent()&&!this._orientationchangeInProgress||this._ui.container.hasClass("ui-popup-hidden")||this._ui.container.addClass("ui-popup-hidden ui-popup-truncate").removeAttr("style"))},_handleWindowOrientationchange:function(){!this._orientationchangeInProgress&&this._isOpen&&0===this._ignoreResizeTo&&(this._expectResizeEvent(),this._orientationchangeInProgress=!0)},_handleDocumentFocusIn:function(t){var i,n=t.target,s=this._ui;if(this._isOpen){if(n!==s.container[0]){if(i=e(n),!e.contains(s.container[0],n))return e(this.document[0].activeElement).one("focus",e.proxy(function(){this._safelyBlur(n)},this)),s.focusElement.focus(),t.preventDefault(),t.stopImmediatePropagation(),!1;s.focusElement[0]===s.container[0]&&(s.focusElement=i)}this._ignoreResizeEvents()}},_themeClassFromOption:function(e,t){return t?"none"===t?"":e+t:e+"inherit"},_applyTransition:function(t){return t&&(this._ui.container.removeClass(this._fallbackTransition),"none"!==t&&(this._fallbackTransition=e.mobile._maybeDegradeTransition(t),"none"===this._fallbackTransition&&(this._fallbackTransition=""),this._ui.container.addClass(this._fallbackTransition))),this},_setOptions:function(e){var t=this.options,n=this.element,s=this._ui.screen;return e.wrapperClass!==i&&this._ui.container.removeClass(t.wrapperClass).addClass(e.wrapperClass),e.theme!==i&&n.removeClass(this._themeClassFromOption("ui-body-",t.theme)).addClass(this._themeClassFromOption("ui-body-",e.theme)),e.overlayTheme!==i&&(s.removeClass(this._themeClassFromOption("ui-overlay-",t.overlayTheme)).addClass(this._themeClassFromOption("ui-overlay-",e.overlayTheme)),this._isOpen&&s.addClass("in")),e.shadow!==i&&n.toggleClass("ui-overlay-shadow",e.shadow),e.corners!==i&&n.toggleClass("ui-corner-all",e.corners),e.transition!==i&&(this._currentTransition||this._applyTransition(e.transition)),e.tolerance!==i&&this._setTolerance(e.tolerance),e.disabled!==i&&e.disabled&&this.close(),this._super(e)},_setTolerance:function(t){var n,s={t:30,r:15,b:30,l:15};if(t!==i)switch(n=String(t).split(","),e.each(n,function(e,t){n[e]=parseInt(t,10)}),n.length){case 1:isNaN(n[0])||(s.t=s.r=s.b=s.l=n[0]);break;case 2:isNaN(n[0])||(s.t=s.b=n[0]),isNaN(n[1])||(s.l=s.r=n[1]);break;case 4:isNaN(n[0])||(s.t=n[0]),isNaN(n[1])||(s.r=n[1]),isNaN(n[2])||(s.b=n[2]),isNaN(n[3])||(s.l=n[3])}return this._tolerance=s,this},_clampPopupWidth:function(e){var t,i=s(this.window),n={x:this._tolerance.l,y:i.y+this._tolerance.t,cx:i.cx-this._tolerance.l-this._tolerance.r,cy:i.cy-this._tolerance.t-this._tolerance.b};return e||this._ui.container.css("max-width",n.cx),t={cx:this._ui.container.outerWidth(!0),cy:this._ui.container.outerHeight(!0)},{rc:n,menuSize:t}},_calculateFinalLocation:function(e,t){var i,s=t.rc,o=t.menuSize;return i={left:n(s.cx,o.cx,s.x,e.x),top:n(s.cy,o.cy,s.y,e.y)},i.top=Math.max(0,i.top),i.top-=Math.min(i.top,Math.max(0,i.top+o.cy-this.document.height())),i},_placementCoords:function(e){return this._calculateFinalLocation(e,this._clampPopupWidth())},_createPrerequisites:function(t,i,n){var s,o=this;s={screen:e.Deferred(),container:e.Deferred()},s.screen.then(function(){s===o._prerequisites&&t()}),s.container.then(function(){s===o._prerequisites&&i()}),e.when(s.screen,s.container).done(function(){s===o._prerequisites&&(o._prerequisites=null,n())}),o._prerequisites=s},_animate:function(t){return this._ui.screen.removeClass(t.classToRemove).addClass(t.screenClassToAdd),t.prerequisites.screen.resolve(),t.transition&&"none"!==t.transition&&(t.applyTransition&&this._applyTransition(t.transition),this._fallbackTransition)?void this._ui.container.addClass(t.containerClassToAdd).removeClass(t.classToRemove).animationComplete(e.proxy(t.prerequisites.container,"resolve")):(this._ui.container.removeClass(t.classToRemove),void t.prerequisites.container.resolve())},_desiredCoords:function(t){var i,n=null,o=s(this.window),a=t.x,r=t.y,l=t.positionTo;if(l&&"origin"!==l)if("window"===l)a=o.cx/2+o.x,r=o.cy/2+o.y;else{try{n=e(l)}catch(h){n=null}n&&(n.filter(":visible"),0===n.length&&(n=null))}return n&&(i=n.offset(),a=i.left+n.outerWidth()/2,r=i.top+n.outerHeight()/2),("number"!==e.type(a)||isNaN(a))&&(a=o.cx/2+o.x),("number"!==e.type(r)||isNaN(r))&&(r=o.cy/2+o.y),{x:a,y:r}},_reposition:function(e){e={x:e.x,y:e.y,positionTo:e.positionTo},this._trigger("beforeposition",i,e),this._ui.container.offset(this._placementCoords(this._desiredCoords(e)))},reposition:function(e){this._isOpen&&this._reposition(e)},_safelyBlur:function(t){t!==this.window[0]&&"body"!==t.nodeName.toLowerCase()&&e(t).blur()},_openPrerequisitesComplete:function(){var t=this.element.attr("id"),i=this._ui.container.find(":focusable").first();this._ui.container.addClass("ui-popup-active"),this._isOpen=!0,this._resizeScreen(),e.contains(this._ui.container[0],this.document[0].activeElement)||this._safelyBlur(this.document[0].activeElement),i.length>0&&(this._ui.focusElement=i),this._ignoreResizeEvents(),t&&this.document.find("[aria-haspopup='true'][aria-owns='"+t+"']").attr("aria-expanded",!0),this._trigger("afteropen")},_open:function(t){var i=e.extend({},this.options,t),n=function(){var e=navigator.userAgent,t=e.match(/AppleWebKit\/([0-9\.]+)/),i=!!t&&t[1],n=e.match(/Android (\d+(?:\.\d+))/),s=!!n&&n[1],o=e.indexOf("Chrome")>-1;return null!==n&&"4.0"===s&&i&&i>534.13&&!o?!0:!1}();this._createPrerequisites(e.noop,e.noop,e.proxy(this,"_openPrerequisitesComplete")),this._currentTransition=i.transition,this._applyTransition(i.transition),this._ui.screen.removeClass("ui-screen-hidden"),this._ui.container.removeClass("ui-popup-truncate"),this._reposition(i),this._ui.container.removeClass("ui-popup-hidden"),this.options.overlayTheme&&n&&this.element.closest(".ui-page").addClass("ui-popup-open"),this._animate({additionalCondition:!0,transition:i.transition,classToRemove:"",screenClassToAdd:"in",containerClassToAdd:"in",applyTransition:!1,prerequisites:this._prerequisites})},_closePrerequisiteScreen:function(){this._ui.screen.removeClass("out").addClass("ui-screen-hidden")},_closePrerequisiteContainer:function(){this._ui.container.removeClass("reverse out").addClass("ui-popup-hidden ui-popup-truncate").removeAttr("style")},_closePrerequisitesDone:function(){var t=this._ui.container,n=this.element.attr("id");e.mobile.popup.active=i,e(":focus",t[0]).add(t[0]).blur(),n&&this.document.find("[aria-haspopup='true'][aria-owns='"+n+"']").attr("aria-expanded",!1),this._trigger("afterclose")},_close:function(t){this._ui.container.removeClass("ui-popup-active"),this._page.removeClass("ui-popup-open"),this._isOpen=!1,this._createPrerequisites(e.proxy(this,"_closePrerequisiteScreen"),e.proxy(this,"_closePrerequisiteContainer"),e.proxy(this,"_closePrerequisitesDone")),this._animate({additionalCondition:this._ui.screen.hasClass("in"),transition:t?"none":this._currentTransition,classToRemove:"in",screenClassToAdd:"out",containerClassToAdd:"reverse out",applyTransition:!0,prerequisites:this._prerequisites})},_unenhance:function(){this.options.enhanced||(this._setOptions({theme:e.mobile.popup.prototype.options.theme}),this.element.detach().insertAfter(this._ui.placeholder).removeClass("ui-popup ui-overlay-shadow ui-corner-all ui-body-inherit"),this._ui.screen.remove(),this._ui.container.remove(),this._ui.placeholder.remove())},_destroy:function(){return e.mobile.popup.active===this?(this.element.one("popupafterclose",e.proxy(this,"_unenhance")),this.close()):this._unenhance(),this},_closePopup:function(i,n){var s,o,a=this.options,r=!1;i&&i.isDefaultPrevented()||e.mobile.popup.active!==this||(t.scrollTo(0,this._scrollTop),i&&"pagebeforechange"===i.type&&n&&(s="string"==typeof n.toPage?n.toPage:n.toPage.jqmData("url"),s=e.mobile.path.parseUrl(s),o=s.pathname+s.search+s.hash,this._myUrl!==e.mobile.path.makeUrlAbsolute(o)?r=!0:i.preventDefault()),this.window.off(a.closeEvents),this.element.undelegate(a.closeLinkSelector,a.closeLinkEvents),this._close(r))},_bindContainerClose:function(){this.window.on(this.options.closeEvents,e.proxy(this,"_closePopup"))},widget:function(){return this._ui.container},open:function(t){var i,n,s,o,a,r,l=this,h=this.options;return e.mobile.popup.active||h.disabled?this:(e.mobile.popup.active=this,this._scrollTop=this.window.scrollTop(),h.history?(r=e.mobile.navigate.history,n=e.mobile.dialogHashKey,s=e.mobile.activePage,o=s?s.hasClass("ui-dialog"):!1,this._myUrl=i=r.getActive().url,(a=i.indexOf(n)>-1&&!o&&r.activeIndex>0)?(l._open(t),l._bindContainerClose(),this):(-1!==i.indexOf(n)||o?i=e.mobile.path.parseLocation().hash+n:i+=i.indexOf("#")>-1?n:"#"+n,this.window.one("beforenavigate",function(e){e.preventDefault(),l._open(t),l._bindContainerClose()}),this.urlAltered=!0,e.mobile.navigate(i,{role:"dialog"}),this)):(l._open(t),l._bindContainerClose(),l.element.delegate(h.closeLinkSelector,h.closeLinkEvents,function(e){l.close(),e.preventDefault()}),this))},close:function(){return e.mobile.popup.active!==this?this:(this._scrollTop=this.window.scrollTop(),this.options.history&&this.urlAltered?(e.mobile.back(),this.urlAltered=!1):this._closePopup(),this)}}),e.mobile.popup.handleLink=function(t){var i,n=e.mobile.path,s=e(n.hashToSelector(n.parseUrl(t.attr("href")).hash)).first();s.length>0&&s.data("mobile-popup")&&(i=t.offset(),s.popup("open",{x:i.left+t.outerWidth()/2,y:i.top+t.outerHeight()/2,transition:t.jqmData("transition"),positionTo:t.jqmData("position-to")})),setTimeout(function(){t.removeClass(e.mobile.activeBtnClass)},300)},e.mobile.document.on("pagebeforechange",function(t,i){"popup"===i.options.role&&(e.mobile.popup.handleLink(i.options.link),t.preventDefault())})}(e),function(e,t){function i(){var e=s.clone(),t=e.eq(0),i=e.eq(1),n=i.children();return{arEls:i.add(t),gd:t,ct:i,ar:n}}var n=e.mobile.browser.oldIE&&e.mobile.browser.oldIE<=8,s=e("<div class='ui-popup-arrow-guide'></div><div class='ui-popup-arrow-container"+(n?" ie":"")+"'><div class='ui-popup-arrow'></div></div>");e.widget("mobile.popup",e.mobile.popup,{options:{arrow:""},_create:function(){var e,t=this._super();return this.options.arrow&&(this._ui.arrow=e=this._addArrow()),t},_addArrow:function(){var e,t=this.options,n=i();return e=this._themeClassFromOption("ui-body-",t.theme),n.ar.addClass(e+(t.shadow?" ui-overlay-shadow":"")),n.arEls.hide().appendTo(this.element),n},_unenhance:function(){var e=this._ui.arrow;return e&&e.arEls.remove(),this._super()},_tryAnArrow:function(e,t,i,n,s){var o,a,r,l={},h={};return n.arFull[e.dimKey]>n.guideDims[e.dimKey]?s:(l[e.fst]=i[e.fst]+(n.arHalf[e.oDimKey]+n.menuHalf[e.oDimKey])*e.offsetFactor-n.contentBox[e.fst]+(n.clampInfo.menuSize[e.oDimKey]-n.contentBox[e.oDimKey])*e.arrowOffsetFactor,l[e.snd]=i[e.snd],o=n.result||this._calculateFinalLocation(l,n.clampInfo),a={x:o.left,y:o.top},h[e.fst]=a[e.fst]+n.contentBox[e.fst]+e.tipOffset,h[e.snd]=Math.max(o[e.prop]+n.guideOffset[e.prop]+n.arHalf[e.dimKey],Math.min(o[e.prop]+n.guideOffset[e.prop]+n.guideDims[e.dimKey]-n.arHalf[e.dimKey],i[e.snd])),r=Math.abs(i.x-h.x)+Math.abs(i.y-h.y),(!s||r<s.diff)&&(h[e.snd]-=n.arHalf[e.dimKey]+o[e.prop]+n.contentBox[e.snd],s={dir:t,diff:r,result:o,posProp:e.prop,posVal:h[e.snd]}),s)},_getPlacementState:function(e){var t,i,n=this._ui.arrow,s={clampInfo:this._clampPopupWidth(!e),arFull:{cx:n.ct.width(),cy:n.ct.height()},guideDims:{cx:n.gd.width(),cy:n.gd.height()},guideOffset:n.gd.offset()};return t=this.element.offset(),n.gd.css({left:0,top:0,right:0,bottom:0}),i=n.gd.offset(),s.contentBox={x:i.left-t.left,y:i.top-t.top,cx:n.gd.width(),cy:n.gd.height()},n.gd.removeAttr("style"),s.guideOffset={left:s.guideOffset.left-t.left,top:s.guideOffset.top-t.top},s.arHalf={cx:s.arFull.cx/2,cy:s.arFull.cy/2},s.menuHalf={cx:s.clampInfo.menuSize.cx/2,cy:s.clampInfo.menuSize.cy/2},s},_placementCoords:function(t){var i,s,o,a,r,l=this.options.arrow,h=this._ui.arrow;return h?(h.arEls.show(),r={},i=this._getPlacementState(!0),o={l:{fst:"x",snd:"y",prop:"top",dimKey:"cy",oDimKey:"cx",offsetFactor:1,tipOffset:-i.arHalf.cx,arrowOffsetFactor:0},r:{fst:"x",snd:"y",prop:"top",dimKey:"cy",oDimKey:"cx",offsetFactor:-1,tipOffset:i.arHalf.cx+i.contentBox.cx,arrowOffsetFactor:1},b:{fst:"y",snd:"x",prop:"left",dimKey:"cx",oDimKey:"cy",offsetFactor:-1,tipOffset:i.arHalf.cy+i.contentBox.cy,arrowOffsetFactor:1},t:{fst:"y",snd:"x",prop:"left",dimKey:"cx",oDimKey:"cy",offsetFactor:1,tipOffset:-i.arHalf.cy,arrowOffsetFactor:0}},e.each((l===!0?"l,t,r,b":l).split(","),e.proxy(function(e,n){s=this._tryAnArrow(o[n],n,t,i,s)},this)),s?(h.ct.removeClass("ui-popup-arrow-l ui-popup-arrow-t ui-popup-arrow-r ui-popup-arrow-b").addClass("ui-popup-arrow-"+s.dir).removeAttr("style").css(s.posProp,s.posVal).show(),n||(a=this.element.offset(),r[o[s.dir].fst]=h.ct.offset(),r[o[s.dir].snd]={left:a.left+i.contentBox.x,top:a.top+i.contentBox.y}),s.result):(h.arEls.hide(),this._super(t))):this._super(t)},_setOptions:function(e){var i,n=this.options.theme,s=this._ui.arrow,o=this._super(e);if(e.arrow!==t){if(!s&&e.arrow)return void(this._ui.arrow=this._addArrow());s&&!e.arrow&&(s.arEls.remove(),this._ui.arrow=null)}return s=this._ui.arrow,s&&(e.theme!==t&&(n=this._themeClassFromOption("ui-body-",n),i=this._themeClassFromOption("ui-body-",e.theme),s.ar.removeClass(n).addClass(i)),e.shadow!==t&&s.ar.toggleClass("ui-overlay-shadow",e.shadow)),o},_destroy:function(){var e=this._ui.arrow;return e&&e.arEls.remove(),this._super()}})}(e),function(e,t){e.widget("mobile.table",{options:{classes:{table:"ui-table"},enhanced:!1},_create:function(){this.options.enhanced||this.element.addClass(this.options.classes.table),e.extend(this,{headers:t,allHeaders:t}),this._refresh(!0)},_setHeaders:function(){var e=this.element.find("thead tr");this.headers=this.element.find("tr:eq(0)").children(),this.allHeaders=this.headers.add(e.children())},refresh:function(){this._refresh()},rebuild:e.noop,_refresh:function(){var t=this.element,i=t.find("thead tr");this._setHeaders(),i.each(function(){var n=0;e(this).children().each(function(){var s,o=parseInt(this.getAttribute("colspan"),10),a=":nth-child("+(n+1)+")";if(this.setAttribute("data-"+e.mobile.ns+"colstart",n+1),o)for(s=0;o-1>s;s++)n++,a+=", :nth-child("+(n+1)+")";e(this).jqmData("cells",t.find("tr").not(i.eq(0)).not(this).children(a)),n++})})}})}(e),function(e){e.widget("mobile.table",e.mobile.table,{options:{mode:"columntoggle",columnBtnTheme:null,columnPopupTheme:null,columnBtnText:"Columns...",classes:e.extend(e.mobile.table.prototype.options.classes,{popup:"ui-table-columntoggle-popup",columnBtn:"ui-table-columntoggle-btn",priorityPrefix:"ui-table-priority-",columnToggleTable:"ui-table-columntoggle"})},_create:function(){this._super(),"columntoggle"===this.options.mode&&(e.extend(this,{_menu:null}),this.options.enhanced?(this._menu=e(this.document[0].getElementById(this._id()+"-popup")).children().first(),this._addToggles(this._menu,!0)):(this._menu=this._enhanceColToggle(),this.element.addClass(this.options.classes.columnToggleTable)),this._setupEvents(),this._setToggleState())},_id:function(){return this.element.attr("id")||this.widgetName+this.uuid},_setupEvents:function(){this._on(this.window,{throttledresize:"_setToggleState"}),this._on(this._menu,{"change input":"_menuInputChange"})},_addToggles:function(t,i){var n,s=0,o=this.options,a=t.controlgroup("container");i?n=t.find("input"):a.empty(),this.headers.not("td").each(function(){var t,r,l=e(this),h=e.mobile.getAttribute(this,"priority");h&&(r=l.add(l.jqmData("cells")),r.addClass(o.classes.priorityPrefix+h),t=(i?n.eq(s++):e("<label><input type='checkbox' checked />"+(l.children("abbr").first().attr("title")||l.text())+"</label>").appendTo(a).children(0).checkboxradio({theme:o.columnPopupTheme})).jqmData("header",l).jqmData("cells",r),l.jqmData("input",t))}),i||t.controlgroup("refresh")},_menuInputChange:function(t){var i=e(t.target),n=i[0].checked;i.jqmData("cells").toggleClass("ui-table-cell-hidden",!n).toggleClass("ui-table-cell-visible",n)},_unlockCells:function(e){e.removeClass("ui-table-cell-hidden ui-table-cell-visible")},_enhanceColToggle:function(){var t,i,n,s,o=this.element,a=this.options,r=e.mobile.ns,l=this.document[0].createDocumentFragment();return t=this._id()+"-popup",i=e("<a href='#"+t+"' class='"+a.classes.columnBtn+" ui-btn ui-btn-"+(a.columnBtnTheme||"a")+" ui-corner-all ui-shadow ui-mini' data-"+r+"rel='popup'>"+a.columnBtnText+"</a>"),n=e("<div class='"+a.classes.popup+"' id='"+t+"'></div>"),s=e("<fieldset></fieldset>").controlgroup(),this._addToggles(s,!1),s.appendTo(n),l.appendChild(n[0]),l.appendChild(i[0]),o.before(l),n.popup(),s},rebuild:function(){this._super(),"columntoggle"===this.options.mode&&this._refresh(!1)},_refresh:function(t){var i,n,s;if(this._super(t),!t&&"columntoggle"===this.options.mode)for(i=this.headers,n=[],this._menu.find("input").each(function(){var t=e(this),s=t.jqmData("header"),o=i.index(s[0]);
|
|
o>-1&&!t.prop("checked")&&n.push(o)}),this._unlockCells(this.element.find(".ui-table-cell-hidden, .ui-table-cell-visible")),this._addToggles(this._menu,t),s=n.length-1;s>-1;s--)i.eq(n[s]).jqmData("input").prop("checked",!1).checkboxradio("refresh").trigger("change")},_setToggleState:function(){this._menu.find("input").each(function(){var t=e(this);this.checked="table-cell"===t.jqmData("cells").eq(0).css("display"),t.checkboxradio("refresh")})},_destroy:function(){this._super()}})}(e),function(e){e.widget("mobile.table",e.mobile.table,{options:{mode:"reflow",classes:e.extend(e.mobile.table.prototype.options.classes,{reflowTable:"ui-table-reflow",cellLabels:"ui-table-cell-label"})},_create:function(){this._super(),"reflow"===this.options.mode&&(this.options.enhanced||(this.element.addClass(this.options.classes.reflowTable),this._updateReflow()))},rebuild:function(){this._super(),"reflow"===this.options.mode&&this._refresh(!1)},_refresh:function(e){this._super(e),e||"reflow"!==this.options.mode||this._updateReflow()},_updateReflow:function(){var t=this,i=this.options;e(t.allHeaders.get().reverse()).each(function(){var n,s,o=e(this).jqmData("cells"),a=e.mobile.getAttribute(this,"colstart"),r=o.not(this).filter("thead th").length&&" ui-table-cell-label-top",l=e(this).clone().contents();l.length>0&&(r?(n=parseInt(this.getAttribute("colspan"),10),s="",n&&(s="td:nth-child("+n+"n + "+a+")"),t._addLabels(o.filter(s),i.classes.cellLabels+r,l)):t._addLabels(o,i.classes.cellLabels,l))})},_addLabels:function(t,i,n){1===n.length&&"abbr"===n[0].nodeName.toLowerCase()&&(n=n.eq(0).attr("title")),t.not(":has(b."+i+")").prepend(e("<b class='"+i+"'></b>").append(n))}})}(e)}); |