28 lines
349 KiB
JavaScript
28 lines
349 KiB
JavaScript
|
/*
|
||
|
* Copyright (c) 2015 Samsung Electronics Co., Ltd
|
||
|
*
|
||
|
* Licensed under the Flora License, Version 1.1 (the "License");
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://floralicense.org/license/
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*/
|
||
|
|
||
|
!function(a,b,c){"use strict";var d=a.tau=a.tau||{},e=a.tauConfig=a.tauConfig||{};e.rootNamespace="tau",e.fileName="tau",d.version="0.13.46",function(b,d){var e=0,f=+new Date,g=[].slice,h="",i="",j=function(a){var b=new Date;a.unshift("["+h+"]["+b.toLocaleString()+"]")},k=a.ns||a.tau||{},l=a.nsConfig||a.tauConfig||{};k.info=k.info||{profile:"custom"},k.tauPerf=k.tauPerf||{},a.ns=k,a.nsConfig=l,a.tau=k,a.tauConfig=l,h=l.rootNamespace,i=l.fileName,k.getUniqueId=function(){return h+"-"+k.getNumberUniqueId()+"-"+f},k.getNumberUniqueId=function(){return e++},k.log=function(){var a=g.call(arguments);j(a),d&&d.log.apply(d,a)},k.warn=function(){var a=g.call(arguments);j(a),d&&d.warn.apply(d,a)},k.error=function(){var a=g.call(arguments);j(a),d&&d.error.apply(d,a)},k.getConfig=function(a,b){return l[a]===c?b:l[a]},k.setConfig=function(a,b,d){d&&l[a]!==c||(l[a]=b)},k.getFrameworkPath=function(){var a,c,d,e,f=b.getElementsByTagName("script"),g=f.length;for(a=0;g>a;a++)if(c=f[a].src,d=c.split("/"),e=d.length,d[e-1]===i+".js"||d[e-1]===i+".min.js")return d.slice(0,e-1).join("/");return null}}(a.document,a.console),function(a,b){function c(){var c,d=b.createElement("div"),e=b.createElement("body"),f=b.getElementsByTagName("html")[0],g=getComputedStyle(d);return d.classList.add("is-circle-test"),e.appendChild(d),f.insertBefore(e,f.firstChild),c="1px"===g.width,f.removeChild(e),"?circle"===a.location.search&&(c=!0),c}var e=!("undefined"==typeof a.tizen);d.support={cssTransitions:!0,mediaquery:!0,cssPseudoElement:!0,touchOverflow:!0,cssTransform3d:!0,boxShadow:!0,scrollTop:0,dynamicBaseTag:!0,cssPointerEvents:!1,boundingRect:!0,browser:{ie:!1,tizen:e},shape:{circle:e?a.matchMedia("(-tizen-geometric-shape: circle)").matches:c()},gradeA:function(){return!0},isCircleShape:c}}(a,a.document),function(){d.setConfig("autoBuildOnPageChange",!1,!0),d.support.shape.circle?(d.setConfig("pageTransition","pop",!0),d.setConfig("popupTransition","pop",!0),d.setConfig("popupFullSize",!0,!0),d.setConfig("scrollEndEffectArea","screen",!0),d.setConfig("enablePageScroll",!0,!0),d.setConfig("enablePopupScroll",!0,!0)):(d.setConfig("popupTransition","slideup",!0),d.setConfig("enablePageScroll",!1,!0),d.setConfig("enablePopupScroll",!1,!0))}(),function(){d.setConfig("rootDir",d.getFrameworkPath(),!0),d.setConfig("version","",!0),d.setConfig("allowCrossDomainPages",!1,!0),d.setConfig("domCache",!1,!0),d.setConfig("autoBuildOnPageChange",!0,!0),d.setConfig("autoInitializePage",!0,!0),d.setConfig("dynamicBaseEnabled",!0,!0),d.setConfig("pageTransition","none",!0),d.setConfig("popupTransition","none",!0),d.setConfig("popupFullSize",!1,!0),d.setConfig("scrollEndEffectArea","content",!0),d.setConfig("enablePopupScroll",!1,!0),d.setConfig("pageContainer",b.body,!0),d.setConfig("findProfileFile",!1,!0)}(),function(a,b,c){function d(a,b){var c,d=new XMLHttpRequest;return d.open("get",a,!1),b&&d.overrideMimeType(b),d.send(),4===d.readyState&&(c=d.status,200===c||0===c&&d.responseText)?d.responseText:null}function e(a){for(var b,c=l.call(a.querySelectorAll("script[src]")),d=c.length;--d>=0;)b=c[d],b.parentNode.removeChild(b);return c}function f(b){return function(){try{a.eval(b)}catch(d){d.stack?c.error(d.stack):d.name&&d.message?c.error(d.name,d.message):c.error(d)}}}function g(a){var b,c=a.length;for(b=0;c>b;++b)a[b]()}function h(a,c){var d,e,f,g,h=[];for(f=0,g=a.length;g>f;++f)e=j.fetchSync(a[f].src,"text/plain"),e&&(d=b.adoptNode(a[f]),d.setAttribute("data-src",a[f].src),d.removeAttribute("src"),h.push(j.safeEvalWrap(e)),c&&c.appendChild(d));return h}var i=null,j=c.util||{},k=[],l=[].slice,m=!1;j._requestAnimationFrameOnSetTimeout=function(b){i=a.setTimeout(b.bind(b,+new Date),1e3/60)},j._loop=function(){var a=l.call(k),b=a.shift(),c=performance.now();for(k=[];b;)b(),b=performance.now()-c<15?a.shift():null;a.length||k.length?(k.unshift.apply(k,a),j.windowRequestAnimationFrame(j._loop)):m=!1},j._getRequestAnimationFrame=function(){return(a.requestAnimationFrame||a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame||a.msRequestAnimationF
|
||
|
b.addEventListener("touchend",p,!0),b.addEventListener("touchmove",q,!0),b.addEventListener("touchcancel",s,!0)},w.bindMouse=function(){b.addEventListener("mousedown",h,!0),b.addEventListener("mouseup",k,!0),b.addEventListener("mousemove",l,!0),b.addEventListener("mouseover",m,!0),b.addEventListener("mouseout",n,!0)},w.unbindTouch=function(){b.removeEventListener("touchstart",o,!0),b.removeEventListener("touchend",p,!0),b.removeEventListener("touchmove",q,!0),b.removeEventListener("touchcancel",s,!0),b.removeEventListener("click",j,!0)},w.unbindMouse=function(){b.removeEventListener("mousedown",h,!0),b.removeEventListener("mouseup",k,!0),b.removeEventListener("mousemove",l,!0),b.removeEventListener("mouseover",m,!0),b.removeEventListener("mouseout",n,!0),b.removeEventListener("keyup",u,!0),b.removeEventListener("keydown",v,!0),b.removeEventListener("scroll",r,!0),b.removeEventListener("click",j,!0)},d.event.vmouse=w,z?w.bindTouch():w.bindMouse(),w.bindCommonEvents()}(a,a.document,d),function(a,b){function c(a){return o.trigger(b,t,a,!0,!0)}function e(a){var b,d,e,f,g=a.target,h=p.getClosestBySelector(g,l);return!h||1!==a.which||(b=h.getAttribute("href"),f=h.getAttribute("rel"),d="external"===f||h.hasAttribute("target"),d||(e=s.getData(h),e.event=a,f&&!e.rel?e.rel=f:f=e.rel,b&&!e.href&&(e.href=b),"popup"===f&&h&&!e.link&&(e.link=h),n.disableVolatileMode(),c(e)||f&&"back"===f))?!0:(o.preventDefault(a),!1)}function f(a){var d,e=a.state,f=n.activeState,g={},i=!0,j=!1;h.locked?(n.disableVolatileMode(),f&&n.replace(f,f.stateTitle,f.stateUrl)):e&&(d="back"===n.getDirection(e),g=q.merge(g,e,{reverse:d,transition:d?f&&f.transition||"none":e.transition,fromHashChange:!0}),f&&(i=o.trigger(b,u,q.merge(g,{url:r.getLocation(),stateUrl:f.stateUrl}),!0,!0),j=i),e.url=r.getLocation(),n.setActive(e),j||(g.event=a,c(g)))}function g(a){var b=a.newURL;b&&n.activeState.url!==b&&c({href:b,fromHashChange:!0,event:a})}var h=Object.create(null),i="popstate",j="hashchange",k="vclick",l="a,tau-button",m=d.util,n=d.history,o=d.event,p=m.selectors,q=m.object,r=m.path,s=m.DOM,t="historystatechange",u="historyhashchange",v="historyenabled",w="historydisabled",x={STATECHANGE:t,HASHCHANGE:u,ENABLED:v,DISABLED:w};h.events=x,h.enabled=!0,h.locked=!1,h.lock=function(){this.locked=!0},h.unlock=function(){this.locked=!1},h.enable=function(){b.addEventListener(k,e,!1),a.addEventListener(i,f,!1),a.addEventListener(j,g,!1),n.enableVolatileMode(),this.enabled=!0,o.trigger(b,v,this)},h.disable=function(){b.removeEventListener(k,e,!1),a.removeEventListener(i,f,!1),a.removeEventListener(j,g,!1),n.disableVolatileMode(),this.enabled=!1,o.trigger(b,w,this)},d.history.manager=h}(a,a.document),function(){function a(a,b){return b.toLocaleUpperCase()}function b(a,b){return"-"+b.toLowerCase()}function c(b){return b.replace(i,a)}function e(a){return a.replace(j,b)}function f(a){return a.charAt(0).toLocaleUpperCase()+a.substring(1)}function g(a){var b;return a&&-1===(a+"").indexOf("%")?(b=parseInt(a,10),isNaN(b)&&(b=null),b):a}function h(a){var b;return b="string"==typeof a?a.split(","):a||[],k.map(b,g)}var i=/-([a-z])/gi,j=/([A-Z])/g,k=d.util.array;d.util.string={dashesToCamelCase:c,camelCaseToDashes:e,firstToUpperCase:f,parseProperty:h}}(),function(a,c){function d(b,c,d,e){var f,g=a.getComputedStyle(b),h=d;if(g&&(f=g.getPropertyValue(c)))switch(e){case"integer":f=parseInt(f,10),isNaN(f)||(h=f);break;case"float":f=parseFloat(f),isNaN(f)||(h=f);break;default:h=f}return h}function e(a){return(a+"").indexOf(".")>-1?parseFloat(a):parseInt(a,10)}function f(b,c,d,f){var g,h,i,j=a.getComputedStyle(b,d);for(g in c)c.hasOwnProperty(g)&&(h=j.getPropertyValue(g),i=e(h),isNaN(i)&&f||(h=i),c[g]=h)}function g(a,b,c,d,e){var g,h,i,j,k=a.style;return"none"!==k.display?(f(a,b,c,!0),j=a[e]):d&&(g=k.display,h=k.visibility,i=k.position,k.display="block",k.visibility="hidden",k.position="relative",f(a,b,c,!0),j=a[e],k.display=g,k.visibility=h,k.position=i),j}function h(a,b,c,d,f,h){var i,j,k=0,l=b&&"outer"===b||!1,m={height:0,"margin-top":0,"margin-bottom":0,"padding-top":0,"padding-bottom":0,"
|
||
|
h.setNSData(c,"external",!0)),c},m.onHashChange=function(){return null},m._createDataUrl=function(a){return g.convertUrlToDataUrl(a,!0)},m.onOpenFailed=function(){this._setBase(g.parseLocation().hrefNoSearch)},m._getBaseElement=function(){return e||(e=a.querySelector("head")),c||(c=a.querySelector("base"),c||(c=a.createElement("base"),c.href=g.documentBase.hrefNoHash,e.appendChild(c))),c},m._setBase=function(a){var b=this._getBaseElement(),c=b.href;g.isPath(a)&&(a=g.makeUrlAbsolute(a,g.documentBase),g.parseUrl(c).hrefNoSearch!==g.parseUrl(a).hrefNoSearch&&(b.href=a,g.documentBase=g.parseUrl(g.makeUrlAbsolute(a,g.documentUrl.href))))},m.getContainer=function(){return d.router.Router.getInstance().getContainer()},m.getActive=function(){return this.getContainer().getActivePage()},m.getActiveElement=function(){return this.getActive().element},m.getFirstElement=function(){return this.firstPage},m.setFirstElement=function(a){this.firstPage=a},d.router.route.page=m}(a.document),function(a,b,d){d.util.callbacks=function(a){var b,e,f,g,h,i,j,k,l=d.util.object,m=l.copy(a),n=[].slice,o=[],p=!m.once&&[],q={add:function(){var a;return o&&(a=o.length,k(arguments),f?h=o.length:b&&(g=a,j(b))),this},remove:function(){return o&&n.call(arguments).forEach(function(a){for(var b=o.indexOf(a);b>-1;)o.splice(b,1),f&&(h>=b&&h--,i>=b&&i--),b=o.indexOf(a,b)}),this},has:function(a){return a?!!o&&o.indexOf(a)>-1:!(!o||!o.length)},empty:function(){return o=[],h=0,this},disable:function(){return o=p=b=c,this},disabled:function(){return!o},lock:function(){return p=c,b||q.disable(),this},locked:function(){return!p},fireWith:function(a,b){return!o||e&&!p||(b=b||[],b=[a,b.slice?b.slice():b],f?p.push(b):j(b)),this},fire:function(){return q.fireWith(this,arguments),this},fired:function(){return!!e}};return k=function(a){n.call(a).forEach(function(a){var b=typeof a;"function"===b?m.unique&&q.has(a)||o.push(a):a&&a.length&&"string"!==b&&k(a)})},j=function(a){for(b=m.memory&&a,e=!0,i=g||0,g=0,h=o.length,f=!0;o&&h>i;){if(o[i].apply(a[0],a[1])===!1&&m.stopOnFalse){b=!1;break}i++}f=!1,o&&(p?p.length&&j(p.shift()):b?o=[]:q.disable())},q}}(a,a.document,d),function(a,b,c){var d=function(a){var b=c.util.callbacks,e=c.util.object,f=[["resolve","done",b({once:!0,memory:!0}),"resolved"],["reject","fail",b({once:!0,memory:!0}),"rejected"],["notify","progress",b({memory:!0})]],g="pending",h={},i={state:function(){return g},always:function(){return h.done(arguments).fail(arguments),this},then:function(){var a=arguments;return new d(function(b){f.forEach(function(c,d){var e="function"==typeof a[d]&&a[d];h[c[1]](function(){var a=e&&e.apply(this,arguments);a&&"function"==typeof a.promise?a.promise().done(b.resolve).fail(b.reject).progress(b.notify):b[c[0]+"With"](this===i?b.promise():this,e?[a]:arguments)})}),a=null}).promise()},promise:function(a){return a?e.merge(a,i):i}};return i.pipe=i.then,f.forEach(function(a,b){var c=a[2],d=a[3];i[a[1]]=c.add,d&&c.add(function(){g=d},f[1^b][2].disable,f[2][2].lock),h[a[0]]=function(){return h[a[0]+"With"](this===h?i:this,arguments),this},h[a[0]+"With"]=c.fireWith}),i.promise(h),a&&a.call(h,h),h};c.util.deferred=d}(a,a.document,d),function(){function c(a,b,c){var d=a.element,e=d.classList,f=a._ui.overlay,g=a._callbacks.animationEnd;d.removeEventListener("animationend",g,!1),d.removeEventListener("webkitAnimationEnd",g,!1),d.removeEventListener("mozAnimationEnd",g,!1),d.removeEventListener("oAnimationEnd",g,!1),d.removeEventListener("msAnimationEnd",g,!1),b.split(" ").forEach(function(a){a=a.trim(),a.length>0&&(e.remove(a),f&&f.classList.remove(a))}),"pending"===c.state()&&c.resolve()}function e(a,b){var c=new i;return c.then(function(){c===a._callbacks.transitionDeferred&&b()}),a._callbacks.transitionDeferred=c,c}var f=d.widget.BaseWidget,g=d.engine,h=d.util.object,i=d.util.deferred,j=d.util.selectors,k=d.event,l=d.router&&d.router.Router,m="[data-role='popup'], .ui-popup",n=function(){var a=this,b={};a.selectors=s,a.options=h.merge({},n.defaults),a.storedOptions=null,a.state=p.CLOSED,b.overlay=null,b.header=null,b.footer=null,b.conten
|
||
|
arcStart:ca,arcEnd:ca+fa,r:G}):ba&&(V?ba.style.transform="translate("+ca+"px, 0)":ba.style.transform="translate(0, "+ca+"px)")}function q(){var a=I+J;a!==L&&(L=a,ca=O>-a?-a/O*da:da,0>ca&&(ca=0),!ja&&N&&(N.transform=V?"translate("+L+"px, 0)":"translate(0, "+L+"px)"),p(),la(q))}function r(){H=0,I=0,ca=0,J=0,K=0,L=0,M=Date.now()}function s(d,e,g){var i,j;if(ja=g,E=!1,ka=!1,P)c.warn("Scrolling exist on another element, first call disable method");else{for(V="x"===e?1:0,Q=a.createElement("div");d.firstElementChild;)Q.appendChild(d.firstElementChild);d.appendChild(Q),P=d,i=d.getBoundingClientRect(),j=Q.getBoundingClientRect(),O=W(V?j.width-i.width:j.height-i.height),N=Q.style,r(),R=b.getComputedStyle(d).getPropertyValue("overflow"),d.style.overflow="hidden",a.addEventListener("touchstart",f,!1),a.addEventListener("touchmove",h,!1),a.addEventListener("touchend",l,!1),b.addEventListener("rotarydetent",m,!0)}}function t(){x(),a.removeEventListener("touchstart",f,!1),a.removeEventListener("touchmove",h,!1),a.removeEventListener("touchend",l,!1),b.removeEventListener("rotarydetent",m,!0),P&&(P.style.overflow=R),N=null,P=null,Q=null,ga=null}function u(){var a=V?0:90;aa.classList.add(D.circular),ga=C.createSVG(),C.addArc(ga,{arcStart:a-Z/2,arcEnd:a+Z/2,classes:D.path,width:10,r:G,linecap:"round"}),C.addArc(ga,{referenceDegree:a-Z/2,arcStart:0,arcEnd:fa,classes:D.thumb,width:10,r:G,linecap:"round"}),aa.appendChild(ga),P.parentElement.insertBefore(aa,P.nextSibling)}function v(b){var c,d,e,f=0,g=0;aa.classList.add(D.direction+"-"+(V?"x":"y")),ba=a.createElement("div"),e=ba.style,ba.classList.add(D.thumb),c=P.getBoundingClientRect(),d=Q.getBoundingClientRect(),V?(f=c.width-2*_,b.width=f+"px",b.left=c.left+_+"px",e.transform="translate3d("+ca+"px,0,0)",e.width=f/d.width*f+"px"):(g=c.height-2*_,b.height=g+"px",b.top=c.top+_+"px",e.transform="translate3d(0,"+ca+"px,0)",e.height=g/d.height*g+"px"),aa.appendChild(ba),P.parentElement.insertBefore(aa,P.nextSibling),da=V?f-ba.getBoundingClientRect().width:g-ba.getBoundingClientRect().height}function w(){aa=a.createElement("div"),aa.classList.add(D.scrollbar),ea?u():v(aa.style)}function x(){aa&&(aa.parentElement.removeChild(aa),aa=null,ba=null)}function y(a){K=a,ia=!0,B.trigger(P,F.SCROLL_BEFORE_START,{scrollLeft:V?-I:0,scrollTop:V?0:-I,fromAPI:ia}),la(o),q()}function z(){return-I}function A(){return O}var B=c.event,C=c.util.polar,D={circular:"scrolling-circular",direction:"scrolling-direction",scrollbar:"scrolling-scrollbar",path:"scrolling-path",thumb:"scrolling-scrollthumb",fadeIn:"fade-in"},E=!1,F={SCROLL_BEFORE_START:"beforeScrollStart",SCROLL_START:"scrollStart",SCROLL_END:"scrollEnd",SCROLL_FLICK:"flick",SCROLL:"scroll"},G=174,H=0,I=0,J=0,K=0,L=0,M=Date.now(),N=null,O=0,P=null,Q=null,R="",S=Math.abs,T=!1,U=!1,V=0,W=Math.round,X=Math.max,Y=Math.min,Z=60,$=6,_=11,aa=null,ba=null,ca=0,da=0,ea=c.support.shape.circle,fa=$,ga=null,ha=null,ia=!1,ja=!1,ka=null,la=b.requestAnimationFrame||b.webkitRequestAnimationFrame;c.util.scrolling={getScrollPosition:z,enable:s,disable:t,enableScrollBar:w,disableScrollBar:x,scrollTo:y,isElement:function(a){return P===a},setMaxScroll:function(a){var b=P.getBoundingClientRect(),c=V?"width":"height",d=b[c],e=X(a-d,0);e!==O&&(O=e||Number.POSITIVE_INFINITY,aa&&(ea?(fa=X(d/(O+d)*Z,$),da=Z-fa,C.updatePosition(ga,"."+D.thumb,{arcStart:ca,arcEnd:ca+fa,r:G})):(d-=2*_,ba.style[c]=d/(O+d)*d+"px",da=d-ba.getBoundingClientRect()[c])))},getMaxScroll:A,setSnapSize:function(a){ka=a,ka&&(O=ka*W(O/ka))},setBounceBack:function(a){E=a}}}(b,a,d),function(a,b,c){function d(a){"CW"===a.detail.direction?j.scrollTop+=k:j.scrollTop-=k}function e(b,c){j=b,c&&(k=c),a.addEventListener("rotarydetent",d)}function f(){k=40,a.removeEventListener("rotarydetent",d)}function g(){return k}function h(a){k=a}var i={},j=null,k=40;i.enable=e,i.disable=f,i.setScrollStep=h,i.getScrollStep=g,c.util.rotaryScrolling=i}(b,a,d),function(a){var b=/([\-0-9.]*)(ms|s)?/i,c={convertToMiliseconds:function(a){var c,d=a.match(b),e=0;return 3===d.length&&(c=parseFloat(d[1])||0,"ms"===d[2]?e=c:"s"===d[2]&&(e=1e3*c)),e}
|
||
|
}(a.document,d),function(b,d){var e=d.widget.BaseWidget,f=d.engine,g=function(){var a=this;a._activeIndex=null,a.options={}},h={indicator:"ui-page-indicator",indicatorActive:"ui-page-indicator-active",indicatorItem:"ui-page-indicator-item",indicatorDashed:"ui-page-indicator-dashed",linearIndicator:"ui-page-indicator-linear",circularIndicator:"ui-page-indicator-circular"},i={IN_CIRCLE:60,IN_LINEAR:5},j={LINEAR:"linear",CIRCULAR:"circular"},k=8,l=new e;g.classes=h,l._configure=function(){this.options={maxPage:null,numberOfPages:null,layout:"linear",intervalAngle:6,style:"dashed"}},l._build=function(a){var b=this,c=b.options;return b._createIndicator(a),c.layout===j.CIRCULAR&&b._circularPositioning(a),"dashed"===c.style&&a.classList.add(h.indicatorDashed),a},l._createIndicator=function(a){var c,e,f,g,i=this,k=i.options.numberOfPages;if(null===k)return void d.error("build error: numberOfPages is null");for(i.options.layout=i.options.layout.toLowerCase(),i.options.layout===j.CIRCULAR?(a.classList.remove(h.linearIndicator),a.classList.add(h.circularIndicator)):(a.classList.remove(h.circularIndicator),a.classList.add(h.linearIndicator)),f=i._getMaxPage(),e=f>k?k:f,c=0;e>c;c++)g=b.createElement("span"),g.classList.add(h.indicatorItem),a.appendChild(g)},l._circularPositioning=function(a){var b,c,d,e=this,f=a.children,g=f.length,h=e.options.intervalAngle-"0";for(b=a.offsetWidth/2-k,d=0;g>d;d++)c="rotate("+(d*h-90-(g-1)*h*.5)+"deg) translate("+b+"px) ",f[d].style.transform=c},l._getMaxPage=function(){var a,b=this,c=b.options;return a=c.layout===j.CIRCULAR?c.maxPage||i.IN_CIRCLE:c.maxPage||i.IN_LINEAR},l._removeIndicator=function(a){a.textContent=""},l.setActive=function(b){var e,f,g,i=this,j=b,k=i.element.children,l=parseInt(i.options.numberOfPages,10),m=0,n=h.indicatorActive;if(null!==b&&b!==c){if(i._activeIndex=b,e=i._getMaxPage(),f=a.parseInt(e/2,10),l>e)m=l-e;else{if(isNaN(l))return void d.error("setActive error: numberOfPages is not a number");if(0===l)return}g=i.element.querySelector("."+n),g&&g.classList.remove(n),b>f&&f+m>=b?j=f:b>f+m&&(j=b-m),k[j].classList.add(n)}},l._refresh=function(){var a=this,b=a.element;a._removeIndicator(b),a._createIndicator(b),a.options.layout===j.CIRCULAR&&a._circularPositioning(b)},l._destroy=function(){this._removeIndicator(this.element)},g.prototype=l,d.widget.core.PageIndicator=g,f.defineWidget("PageIndicator","[data-role='page-indicator'], .ui-page-indicator",["setActive"],g,"core")}(a.document,d),function(a,b){var c=a.event.gesture;c.utils={getCenter:function(a){var c=[],d=[];return[].forEach.call(a,function(a){c.push(isNaN(a.clientX)?a.pageX:a.clientX),d.push(isNaN(a.clientY)?a.pageY:a.clientY)}),{clientX:(b.min.apply(b,c)+b.max.apply(b,c))/2,clientY:(b.min.apply(b,d)+b.max.apply(b,d))/2}},getVelocity:function(a,c,d){return{x:b.abs(c/a)||0,y:b.abs(d/a)||0}},getAngle:function(a,c){var d=c.clientY-a.clientY,e=c.clientX-a.clientX;return 180*b.atan2(d,e)/b.PI},getDirection:function(a,d){var e=b.abs(a.clientX-d.clientX),f=b.abs(a.clientY-d.clientY);return e>=f?a.clientX-d.clientX>0?c.Direction.LEFT:c.Direction.RIGHT:a.clientY-d.clientY>0?c.Direction.UP:c.Direction.DOWN},getDistance:function(a,c){var d=c.clientX-a.clientX,e=c.clientY-a.clientY;return b.sqrt(d*d+e*e)},getScale:function(a,b){return a.length>=2&&b.length>=2?this.getDistance(b[0],b[1])/this.getDistance(a[0],a[1]):1},getRotation:function(a,b){return a.length>=2&&b.length>=2?this.getAngle(b[1],b[0])-this.getAngle(a[1],a[0]):0},isVertical:function(a){return a===c.Direction.UP||a===c.Direction.DOWN},isHorizontal:function(a){return a===c.Direction.LEFT||a===c.Direction.RIGHT},getOrientation:function(a){return this.isVertical(a)?c.Orientation.VERTICAL:c.Orientation.HORIZONTAL}}}(d,a.Math),function(a){var b=a.event.gesture,c=a.util.object.merge,d=function(a,b){this.sender=b,this.strategy=a.create(),this.name=this.strategy.name,this.index=this.strategy.index||100,this.options=this.strategy.options||{}};d.prototype.detect=function(a){return this.strategy.handler(a,this.sender,this.strategy.options)},d.Sender={sendEvent:function(){}},d.plug
|
||
|
},f=function(){j.scrollTo(0,c.scrollTop,250)},l.addEventListener(u.SHOW,d,!1),m&&m.firstChild.addEventListener("vclick",e,!1),o&&o.firstChild.addEventListener("vclick",f,!1),p.repositionJumps=d,p.jumpTop=e,p.jumpLeft=f),c.addEventListener("scroll",function(){h?a.clearTimeout(h):n.trigger(c,"scrollstart"),h=a.setTimeout(i,100),n.trigger(c,"scrollupdate")},!1),b.addEventListener("vmousedown",function(){q&&(q=null)},!1),j.options.scrollIndicator&&(p.scrollUpdate=j._showScrollIndicator.bind(j),c.addEventListener("scrollupdate",p.scrollUpdate,!1),p.scrollStop=j._hideScrollIndicator.bind(j),c.addEventListener("scrollstop",p.scrollStop,!1)))},v.prototype._destroy=function(){var b=this,c=b.element,d=b._ui,e=d.page,f=this.options.scrollJump,g=d.jumpVerticalButton,h=d.jumpHorizontalButton,i=b._callbacks,j=i.repositionJumps,k=i.jumpTop,l=i.jumpLeft;f&&(e&&j&&e.removeEventListener(u.SHOW,j,!1),g&&k&&g.firstChild.removeEventListener("vclick",k,!1),h&&l&&h.firstChild.removeEventListener("vclick",l,!1)),b.options.scrollIndicator&&c.removeEventListener("scrollupdate",i.scrollUpdate,!1),b._timers.scrollIndicatorHide&&a.clearTimeout(b._timers.scrollIndicatorHide)},c.widget.core.Scrollview=v}(a,a.document,d),function(a,b){var c=b.widget.BaseWidget,d=b.engine,e=b.event,f=function(){},g={},h={TAB_CHANGE:"tabchange"},i=new c;f.prototype=i,f.classes=g,i._setActive=function(a){var b=this.element;e.trigger(b,h.TAB_CHANGE,{active:a})},i.setActive=function(a){this._setActive(a)},i._getActive=function(){return this.options.active},i.getActive=function(){return this._getActive()},b.widget.core.Tab=f,d.defineWidget("Tab","",["setActive","getActive"],f,"tizen")}(a.document,d),function(a,b){var c=b.widget.core.Tab,d=b.engine,e=b.util.object,f=function(){this.tabSize=0,this.width=0},g=c.prototype,h=new c;f.prototype=h,h._init=function(a){var b=this.options;this.width=a.offsetWidth,a.classList.add(b.wrapperClass)},h._configure=function(){e.merge(this.options,{margin:4,triggerEvent:!1,wrapperClass:"ui-tab-indicator",itemClass:"ui-tab-item",activeClass:"ui-tab-active",active:0})},h._createIndicator=function(){var b,c=this.options,d=a.createDocumentFragment(),e=[],f=c.margin,g=0,h=this.tabSize,i=this.width-f*(h-1),j=Math.floor(i/h),k=i%h,l=0;for(g=0;h>g;g++)e[g]=j;for(g=Math.floor((h-k)/2);k>0;g++,k--)e[g]+=1;for(g=0;h>g;g++)b=a.createElement("span"),b.classList.add(c.itemClass),b.style.width=e[g]+"px",b.style.left=l+"px",l+=e[g]+f,g===c.active&&b.classList.add(c.activeClass),d.appendChild(b);this.element.appendChild(d)},h._removeIndicator=function(){this.element.innerHTML=""},h._refresh=function(){this._removeIndicator(),this._createIndicator()},h._setActive=function(a){var b=this.options,c=this.element.children;b.active=a,[].forEach.call(c,function(a){a.classList.remove(b.activeClass)}),a<c.length&&(c[a].classList.add(b.activeClass),g._setActive.call(this,a))},h.setSize=function(a){var b=this.tabSize!==a;this.tabSize=a,b&&this.refresh()},h._destroy=function(){var a=this.options;this._removeIndicator(),this.element.classList.remove(a.wrapperClass)},b.widget.core.TabIndicator=f,d.defineWidget("TabIndicator",".ui-tab",["setActive","getActive","setSize"],f)}(a.document,d),function(a,b){function d(){this.options={}}function e(a,b,d){var e=b.length,f=d!==c?d:e,g=0,h=0;for(f>e&&(f=e),h;f>h;h++)g+=a===i.HORIZONTAL?b[h].offsetWidth:b[h].offsetHeight;return g}function f(a,b,c){var d=e(a,b,c+1),f=b[c];return f&&(d-=a===i.HORIZONTAL?f.offsetWidth/2:f.offsetHeight/2),d}var g=b.widget.core.scroller.Scroller,h=b.event.gesture,i=h.Orientation,j=b.engine,k=b.util.object,l=b.event,m=b.util.object.merge({CHANGE:"sectionchange"},g.EventType),n={uiSectionChanger:"ui-section-changer"};k.inherit(d,g,{_build:function(a){var b,c=this,d=c.options;return c.tabIndicatorElement=null,c.tabIndicator=null,c.sections=null,c.sectionPositions=[],c.activeIndex=0,c.beforeIndex=0,c._super(a),a.classList.add(n.uiSectionChanger),c.scroller.style.position="absolute",b=a.offsetHeight,0===b&&(b=a.parentNode.offsetHeight,a.style.height=b+"px"),c._sectionChangerWidth=a.offsetWidth,c._sectionChanger
|
||
|
c.removeEventListener("mouseup",a,!1))},_detectEventType:function(a){var b=a.type;if(b.match(i))this._blockMouseEvent=!0;else if(this._blockMouseEvent||1!==a.which)return null;return b},handleEvent:function(a){var b=this,c=b._detectEventType(a);switch(c){case"mousedown":case"touchstart":b._start(a);break;case"mousemove":case"touchmove":b._move(a);break;case"mouseup":case"touchend":b._end(a);break;case"touchcancel":b._cancel(a)}},_start:function(a){var b=this,c=a.currentTarget,f={},h=[];b._isReadyDetecting||(b._resetDetecting(),b._bindEvents(),f=b._createDefaultEventData(e.Event.START,a),b.gestureEvents={start:f,last:f},b.velocity={event:f,x:0,y:0},f=g.fastMerge(f,b._createGestureEvent(e.Event.START,a)),b._isReadyDetecting=!0),b.instances.forEach(function(a){a.getElement()===c&&(h=h.concat(a.getGestureDetectors()))},b),h.sort(d),b.gestureDetectors=b.gestureDetectors.concat(h),b._detect(h,f)},_move:function(a){var b,c=this;c._isReadyDetecting&&(b=c._createGestureEvent(e.Event.MOVE,a),c._detect(c.gestureDetectors,b),c.gestureEvents.last=b)},_end:function(a){var b=this,c=g.merge({},b.gestureEvents.last,b._createDefaultEventData(e.Event.END,a));0===c.pointers.length&&(b._detect(b.gestureDetectors,c),b.unregisterBlockList.forEach(function(a){this.unregister(a)},b),b._resetDetecting(),b._blockMouseEvent=!1)},_cancel:function(a){var b=this;a=g.merge({},b.gestureEvents.last,b._createDefaultEventData(e.Event.CANCEL,a)),b._detect(b.gestureDetectors,a),b.unregisterBlockList.forEach(function(a){this.unregister(a)},b),b._resetDetecting(),b._blockMouseEvent=!1},_detect:function(a,b){var c=this,d=[];a.forEach(function(a){var f;c.detectorRequestedBlock||(f=a.detect(b),f&e.Result.RUNNING&&c.runningDetectors.indexOf(a)<0&&c.runningDetectors.push(a),f&e.Result.FINISHED&&d.push(a),f&e.Result.BLOCK&&(c.detectorRequestedBlock=a))}),d.forEach(function(a){var b=c.gestureDetectors.indexOf(a);b>-1&&c.gestureDetectors.splice(b,1),b=c.runningDetectors.indexOf(a),b>-1&&c.runningDetectors.splice(b,1)}),c.detectorRequestedBlock&&(c.runningDetectors.forEach(function(a){var c=g.fastMerge({},b);c.eventType=e.Event.BLOCKED,a.detect(c)}),c.runningDetectors.length=0,c.gestureDetectors.length=0,d.indexOf(c.detectorRequestedBlock)<0&&c.gestureDetectors.push(c.detectorRequestedBlock))},_resetDetecting:function(){var a=this;a._isReadyDetecting=!1,a.gestureDetectors.length=0,a.runningDetectors.length=0,a.detectorRequestedBlock=null,a.gestureEvents={},a.velocity=null,a._unbindEvents()},_createDefaultEventData:function(a,b){var c=b.touches;return c||("mouseup"===b.type?c=[]:(b.identifier=1,c=[b])),{eventType:a,timeStamp:Date.now(),pointer:c[0],pointers:c,srcEvent:b,preventDefault:b.preventDefault.bind(b),stopPropagation:b.stopPropagation.bind(b)}},_createGestureEvent:function(a,b){var c,d=this,h=d._createDefaultEventData(a,b),i=d.gestureEvents.start,j=d.gestureEvents.last,k=d.velocity,l=k.event,m={time:h.timeStamp-i.timeStamp,x:h.pointer.clientX-i.pointer.clientX,y:h.pointer.clientY-i.pointer.clientY},n={x:h.pointer.clientX-j.pointer.clientX,y:h.pointer.clientY-j.pointer.clientY},o=e.defaults.estimatedPointerTimeDifference;return i&&h.pointers.length!==i.pointers.length&&(i.pointers=Array.prototype.slice.call(h.pointers)),h.timeStamp-l.timeStamp>e.defaults.updateVelocityInterval&&(g.fastMerge(k,f.getVelocity(h.timeStamp-l.timeStamp,h.pointer.clientX-l.pointer.clientX,h.pointer.clientY-l.pointer.clientY)),k.event=h),c={x:Math.round(h.pointer.clientX+o*k.x*(n.x<0?-1:1)),y:Math.round(h.pointer.clientY+o*k.y*(n.y<0?-1:1))},(n.x<0&&c.x>j.estimatedX||n.x>0&&c.x<j.estimatedX)&&(c.x=j.estimatedX),(n.y<0&&c.y>j.estimatedY||n.y>0&&c.y<j.estimatedY)&&(c.y=j.estimatedY),g.fastMerge(h,{deltaTime:m.time,deltaX:m.x,deltaY:m.y,velocityX:k.x,velocityY:k.y,estimatedX:c.x,estimatedY:c.y,estimatedDeltaX:c.x-i.pointer.clientX,estimatedDeltaY:c.y-i.pointer.clientY,distance:f.getDistance(i.pointer,h.pointer),angle:f.getAngle(i.pointer,h.pointer),direction:f.getDirection(i.pointer,h.pointer),scale:f.getScale(i.pointers,h.pointers),rotation:f.getRotation(i.pointers,h.pointers),startEvent:
|
||
|
H.forEach(e._items,function(a){var b=A.getChildrenBySelector(a,M.TEXT_INPUT)[0];b&&d.widget.TextInput(b)}),i.arcListviewSelection=e._buildArcListviewSelection(b),a=h(j,k),i.arcListviewCarousel=a,c.parentElement.appendChild(a),e._ui.arcListviewCarousel.addEventListener("vclick",e,!0),i.scroller=c,I.calcFactors(g.ellipsisA,g.ellipsisB),e._setAnimatedItems(),e._scrollAnimationEnd=!0,S=1,e._refresh(),e._scroll(),e._initBouncingEffect())},N.handleEvent=function(a){var b=this,c=b._ui.page;if("pageinit"===a.type)b._onPageInit(a);else if(c&&c.classList.contains("ui-page-active"))switch(a.type){case"touchmove":b._onTouchMove(a);break;case"rotarydetent":b._onRotary(a);break;case"touchstart":b._onTouchStart(a);break;case"touchend":b._onTouchEnd(a);break;case"change":b._onChange(a);break;case"vclick":b._onClick(a)}},N._bindEvents=function(){var a=this,c=a.element,d=a._ui.page;d.addEventListener("touchstart",a,!0),d.addEventListener("touchmove",a,!0),d.addEventListener("touchend",a,!0),d.addEventListener("pageinit",a,!0),a._ui.arcListviewCarousel&&a._ui.arcListviewCarousel.addEventListener("vclick",a,!0),b.addEventListener("rotarydetent",a,!0),c.addEventListener("change",a,!0)},N.enableList=function(){var a=this,c=a._ui.page;c.addEventListener("touchstart",a,!0),c.addEventListener("touchmove",a,!0),c.addEventListener("touchend",a,!0),a._ui.arcListviewCarousel&&a._ui.arcListviewCarousel.addEventListener("vclick",a,!0),b.addEventListener("rotarydetent",a,!0)},N.disableList=function(){var a=this,c=a._ui.page;c.removeEventListener("touchstart",a,!0),c.removeEventListener("touchmove",a,!0),c.removeEventListener("touchend",a,!0),a._ui.arcListviewCarousel.removeEventListener("vclick",a,!0),b.removeEventListener("rotarydetent",a,!0)},N._unbindEvents=function(){var a=this,c=a.element,d=a._ui.page;d.removeEventListener("touchstart",a,!0),d.removeEventListener("touchmove",a,!0),d.removeEventListener("touchend",a,!0),d.removeEventListener("pageinit",a,!0),a._ui.arcListviewCarousel&&a._ui.arcListviewCarousel.removeEventListener("vclick",a,!0),b.removeEventListener("rotarydetent",a,!0),c.removeEventListener("change",a,!0)},N._destroy=function(){var a=this,b=a._ui,c=b.arcListviewSelection,d=b.arcListviewCarousel;a._unbindEvents(),a._items.forEach(function(b){a.element.appendChild(b),b.setAttribute("style","")}),a._items=[],c&&c.parentElement&&c.parentElement.removeChild(c),d&&d.parentElement&&d.parentElement.removeChild(d)},N._initBouncingEffect=function(){var a=this;a._maxScrollY=a.element.getBoundingClientRect().height-x,a._bouncingEffect=new d.widget.core.scroller.effect.Bouncing(a._ui.page,{maxScrollX:0,maxScrollY:a._maxScrollY,orientation:"vertical"})},I.prototype=N,d.widget.wearable.ArcListview=I,I.classes=K,y.defineWidget("ArcListview","."+J,[],I,"wearable")}(a.document,d),function(a,b){var c=b.widget.core.Listview,d=b.widget.wearable.ArcListview,e=b.engine,f=b.support.shape.circle,g=f?d:c,h=function(){g.call(this)},i=new g;h.events=g.events,h.prototype=i,b.widget.wearable.Listview=h,e.defineWidget("Listview",".ui-listview",[],h,"wearable",!0)}(a.document,d),function(a){a.widget.core.indexscrollbar=a.widget.core.indexscrollbar||{}}(d),function(a,b){function c(a,b){return this.element=a,this.options=d.merge(b,this._options,!1),this.container=this.options.container,this.indices={original:this.options.index,merged:[]},this._init(),this}var d=b.util.object,e=b.util.DOM;c.prototype={_options:{container:null,offsetLeft:0,index:[],verticalCenter:!1,moreChar:"*",moreCharLineHeight:9,indexHeight:41,selectedClass:"ui-state-selected",ulClass:null,maxIndexLen:0},_init:function(){this.indices.original=this.options.index,this.indexLookupTable=[],this.indexElements=null,this.selectedIndex=-1,this.visiblity="hidden",this._setMaxIndexLen(),this._makeMergedIndices(),this._drawDOM(),this._appendToContainer(),this.options.verticalCenter&&this._adjustVerticalCenter(),this._setIndexCellInfo()},_clear:function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.indices.merged.length=0,this.indexLookupTable.length=0,this.indexEle
|
||
|
a._selectedIndex=null)}function f(a){return"none"!==a.element.style.display}function g(b){var c=b.querySelector(".ui-content"),d=0;return c&&(d=parseInt(a.getComputedStyle(c).marginTop,10)),-b.firstElementChild.getBoundingClientRect().top+d}function h(a){var b,d,h,i,j=a._ui,k=a._listItems,l=j.scrollableParent,m=l.height||j.page.offsetHeight,n=l.element||j.page,o=g(n)+m/2,p=k.length,q=a._selectedIndex;for(h=0;p>h;h++)if(b=k[h],d=b.coord,f(b)&&d.top<o&&d.top+d.height>=o){i=h;break}i!==q&&i!==c&&(e(a),a._selectTimeout&&clearTimeout(a._selectTimeout),a._selectTimeout=setTimeout(function(){var b=a._listItems&&a._listItems[i].element;b&&(a._selectedIndex=i,b.classList.add(E.SNAP_LISTVIEW_SELECTED),u.trigger(b,z.SELECTED))},300))}function i(a){a._isTouched===!1&&(a._isScrollStarted=!1,u.trigger(a.element,z.SCROLL_END),h(a))}function j(b){var c=b._callbacks,d=c.scrollEnd;b._isScrollStarted||(b._isScrollStarted=!0,u.trigger(b.element,z.SCROLL_START),b._scrollEventCount=0),b._scrollEventCount++,(b._scrollEventCount>2||b._isTouched===!0)&&e(b),b._listItemAnimate(),b._isTouched===!1&&(a.clearTimeout(b._scrollEndTimeoutId),b._scrollEndTimeoutId=a.setTimeout(d,F))}function k(a){a._isTouched=!0}function l(a){a._isTouched=!1,h(a)}function m(a){for(var c;a&&a!==b.body;){if(y.isElement(a))return a;if(c=w.getCSSProperty(a,"overflow-y"),"scroll"===c||"auto"===c&&a.scrollHeight>a.clientHeight)return a;a=a.parentNode}return null}function n(b,c){var d,e,f=b._listItems,g=b._selectedIndex;d=p(c.target,b.element),d&&d.classList.contains(E.SNAP_LISTVIEW_SELECTED)||(e=o(d,f),u.preventDefault(c),u.stopPropagation(c),e>-1&&null!==g&&(g>e?u.trigger(a,"rotarydetent",{direction:"CCW"},!0):e>g&&u.trigger(a,"rotarydetent",{direction:"CW"},!0)))}function o(a,b){var c,d=b.length;for(c=0;d>c;c++)if(b[c].element===a)return c;return-1}function p(a,b){for(var d=a;d.parentNode&&d!==b;){if(d.classList.contains(E.SNAP_LISTVIEW_ITEM))return d;d=d.parentNode}return c}function q(a,b,c,d){return function(a){var c=1-a,e=3*c,f=a*a,g=f*a,h=e*a*c,i=e*f;return h*b+i*d+g}}function r(b,c,d,e,f){var g=q(.25,.46,.45,1),h=0,i=0,j=0,k=0,l=d-c,m=b.scrollTop,n=B.animationTimer;h=a.performance.now(),null!==n&&a.cancelAnimationFrame(n),n=a.requestAnimationFrame(function o(){var c;i=a.performance.now(),j=(i-h)/e,k=g(j),c=l*k,b.scrollTop=m+c,1>=j&&j>=0?n=a.requestAnimationFrame(o):(n=null,f&&"function"==typeof f&&f())})}var s=d.widget.BaseWidget,t=d.engine,u=d.event,v=d.util,w=v.DOM,x=v.selectors,y=v.scrolling,z={SCROLL_START:"scrollstart",SCROLL_END:"scrollend",SELECTED:"selected"},A=d.util.array,B=function(){var a=this;a._ui={page:null,scrollableParent:{element:null,height:0},childItems:{}},a.options={selector:"li:not(.ui-listview-divider)",animate:"none",scale:{from:.67,to:1},opacity:{from:.7,to:1}},a._listItems=[],a._callbacks={},a._scrollEndTimeoutId=null,a._isScrollStarted=!1,a._selectedIndex=null,a._currentIndex=null,a._enabled=!0,a._isTouched=!1,a._scrollEventCount=0},C=new s,D="ui-snap-listview",E={SNAP_CONTAINER:"ui-snap-container",SNAP_DISABLED:"ui-snap-disabled",SNAP_LISTVIEW:D,SNAP_LISTVIEW_SELECTED:D+"-selected",SNAP_LISTVIEW_ITEM:D+"-item"},F=0;B.classes=E,B.animationTimer=null,B.ListItem=function(a,b){var c,d;a.classList.add(E.SNAP_LISTVIEW_ITEM),c=a.offsetTop,d=a.offsetHeight,this.element=a,this.rate=-1,this.coord={top:c,height:d},this.position={begin:c-b,start:c-b+d,stop:c,end:c+d}},B.ListItem.prototype={animate:function(a,b){var c,d=this.element,e=this.position,f=e.begin,g=e.end,h=e.start,i=e.stop;c=a>=h&&i>=a?Math.min(1,Math.abs((a-h)/(i-h))):a>f&&h>a||g>a&&a>i?0:-1,this.rate!==c&&(b(d,c),this.rate=c)}},C._listItemAnimate=function(){var a,b=this,c=b.options.animate,d=b._callbacks[c],e=b._ui.scrollableParent.element||b._ui.page;d&&(a=g(e),A.forEach(b._listItems,function(b){b.animate(a,d)}))},C._initSnapListview=function(a){var c,d,e,f=this,g=f._ui,h=a.firstElementChild.getBoundingClientRect().height;g.page=x.getClosestByClass(a,"ui-page")||b.body,c=m(a),c&&(y.isElement(c)||y.enable(c,"y"),e=a.getBoundingClientRect().top-c.getBoundingClientRect().top-h/2,y.setMaxScr
|
||
|
},z._refreshEditMode=function(){var a,b,c,d,e=this,f=e._ui,g=f.items,h=e.options,i=e._itemsToReorder,j=h.maxItemNumber,l=e._activeLayerIndex,m=(l+1)*j,n=l*j;for(c=0;c<f.items.length;c++)a=parseInt(o.getNSData(g[c],"index"),10),d=c!==a&&!Number.isNaN(a),d&&m>c&&c>=n&&!g[c].classList.contains(u.ITEM_PLACEHOLDER)&&(a>=m&&(b=w.ITEM_START_DEGREE+h.itemDegree*j,k(g[c],b,h.itemRadius,-b,w.ITEM_NORMAL_SCALE)),i.push(c%j))},z._refresh=function(){var a=this,b=a._ui,c=b.items,d=a.options,f=a.element;a._editModeEnabled?(a._removeRemoveIcons(),a._refreshEditMode(),a._setIndexes(),a._addRemoveIcons()):a._setIndexes(),b.layers=e(f,c,d),a._setActiveLayer(a._activeLayerIndex)},z._changeLayer=function(a){var b=this,c=b._ui.layers,e=c[b._activeLayerIndex];return 0>a||a>c.length-1?void d.warn("Please insert index between 0 to layers number"):(b._enabled=!1,b._hideItems(e),void s(function(){b._setActiveLayer(a)}))},z._onLongPress=function(a){var b,c=this,d=c._getPointedElement(a.detail),e=d.classList,f=parseInt(o.getNSData(d,"index"),10);c.options.editable&&c._editModeEnabled===!1&&c._enableEditMode(),c._editModeEnabled&&e.contains(u.ITEM)&&!e.contains(u.PLUS_BUTTON)&&(b=c._ui.items[f],c._cloneMovedItem(f),b.classList.add(u.ITEM_PLACEHOLDER),c._movedElementIndex=f,c._destinationIndex=f,c.element.classList.add(u.REORDER))},z._getPointedElement=function(a){var c=a.estimatedX,d=a.estimatedY;return b.elementFromPoint(c,d)},z._cloneMovedItem=function(a){var b,c,d,e,f,g=this,h=g.element;b=g._ui.items[a],d=b.cloneNode(!0),c=b.getBoundingClientRect(),e=c.left+c.height/2,f=c.top+c.width/2,d.classList.add(u.ITEM_MOVED),d.setAttribute("style","left:"+e+"px; top:"+f+"px"),h.appendChild(d),g._ui.movedItem=h.querySelector("."+u.ITEM_MOVED)},z._onHWKey=function(a){var b=this;"back"===a.keyName&&b.options.editable&&b._editModeEnabled&&b._disableEditMode()},z._siblingLayerExists=function(a){var b=this,c="next"===a,d=b._ui,e=d.layers[b._activeLayerIndex],f=e&&(c?e.nextElementSibling:e.previousElementSibling);return f&&f.classList.contains(c?u.LAYER_NEXT:u.LAYER_PREV)},z._onSwipe=function(a){var b=this;"right"===a.detail.direction&&b._siblingLayerExists("next")?b._setNextLayer():"left"===a.detail.direction&&b._siblingLayerExists("prev")&&b._setPreviousLayer()},z._addPlusButton=function(){var a;a=b.createElement("div"),a.classList.add(u.PLUS_BUTTON),o.setNSData(a,"removable","false"),this.addItem(a)},z._removePlusButton=function(){var a,b=this,c=b._ui.items,d=c.length-1,e=b.options.maxItemNumber,f=b._activeLayerIndex;a=f*e,d===a&&b._changeLayer(f-1),c[d].classList.contains(u.PLUS_BUTTON)&&b.removeItem(d)},z._enableEditMode=function(){var b=this,c=b._ui,d=c.items.length,e=c.items[b._activeItemIndex];b.options.plusButton&&b._addPlusButton(),b._addRemoveIcons(),b.element.classList.add(u.EDIT_MODE),c.indicatorText.textContent="Edit mode",d>0&&(e.classList.remove(u.ITEM_ACTIVE),s(function(){e.style.transform=e.style.transform.replace(w.ITEM_ACTIVE_SCALE,w.ITEM_NORMAL_SCALE)})),q.on(a,"tizenhwkey",b,!0),b._editModeEnabled=!0},z._disableEditMode=function(){var b,c=this,d=c._ui,e=c.element.classList;c.options.plusButton&&c._removePlusButton(),e.remove(u.EDIT_MODE),b=d.items,b.length>0?(b[c._activeItemIndex].classList.add(u.ITEM_ACTIVE),c._removeRemoveIcons(),s(function(){c._setActiveItem(c._activeItemIndex)})):(d.indicatorText.textContent=c.options.emptyStateText,d.indicatorSubText.textContent="",d.indicatorIcon.classList.remove(u.INDICATOR_ICON_ACTIVE,u.INDICATOR_ICON_ACTIVE_WITH_TEXT)),q.off(a,"tizenhwkey",c,!0),c._editModeEnabled=!1},z._changeItem=function(a){this._setActiveItem(a)},z.changeItem=function(a){this._changeItem(a)},z.addItem=function(a,b){var c=this,d=c.element,e=d.querySelectorAll(c.options.itemSelector),g=e.length-1,h=e[g].classList.contains(u.PLUS_BUTTON),i=c._ui,j=h?i.items.length:i.items.length-1;f(c.element,c.options),k(a,w.ITEM_END_DEGREE,c.options.itemRadius,-w.ITEM_END_DEGREE,w.ITEM_NORMAL_SCALE),a.classList.add(u.ITEM),b>=0&&j>b?d.insertBefore(a,e[b]):h?d.insertBefore(a,e[g]):d.appendChild(a),i.items=d.querySelectorAll(c.options.itemSelector)
|
||
|
},r._refresh=function(){var a=this._ui.pointer;this._removeTicksCircle(),this._prepareTicksCircle(this.element),a.parentElement.appendChild(a)},r._destroy=function(){this._removeItems()},o.prototype=r,d.widget.wearable.CircleIndicator=o,l.defineWidget("CircleIndicator","."+q.WIDGET,[],o,"wearable")}(),function(a,b){function c(){var a=this;a.options={min:0,max:12,step:1,disabled:!1,accelerated:0},a._circleIndicator=null,a._spin=null,a._ui={number:null,page:null,container:null,indicator:null,buttonSet:null,label:null,footer:null}}function e(a){d.event.trigger(a.element,"change",{value:a.value()}),history.back()}function f(a,b){var c=parseInt(a.options.step,10),d=Date.now(),e=parseInt(a.options.accelerated,10);a._spin.option("enabled")&&(e&&(d-a._previousRotaryTime<30&&(c*=e),a._previousRotaryTime=d),"CW"===b.detail.direction?a.value(a.value()+c):a.value(a.value()-c))}function g(a,b){b?a._ui.number.classList.contains("enabled")||(a._ui.label.classList.add(p.HIDDEN),a._spin.option("enabled",!0)):a._ui.number.classList.contains("enabled")&&(a._ui.label.classList.remove(p.HIDDEN),a._spin.option("enabled",!1))}function h(a,b){var c=b.target;c&&g(a,j.getClosestByClass(c,m)===a._ui.number)}function i(a,b){var c=b.target;c&&(a.element.value=b.detail.value,a.element.setAttribute("value",b.detail.value))}var j=d.util.selectors,k=new d.widget.BaseWidget,l=d.widget.wearable.Spin,m=l.classes.SPIN,n="ui-number-picker",o="input[type='number']",p={CONTAINER:n+"-container",NUMBER:n+"-number",NUMBER_BLINK:n+"-number-blink",LABEL:n+"-label",LABEL_PRESSED:n+"-label-pressed",BUTTON_SET:n+"-set",DISABLED:n+"-disabled",HIDDEN:"hidden"};c.classes=p,k._extractLabel=function(a){var c="",d=null;return c=a.getAttribute("id"),c&&(d=b.querySelector('*[for="'+c+'"]')),d||(d=j.getClosestByTag(a,"label")),d&&a.parentElement===d&&d.parentElement.replaceChild(a,d),d||(d=b.createElement("label"),a.parentNode.appendChild(d)),d},k._findFooter=function(a){var c=j.getClosestBySelector(a,".ui-page, .ui-popup"),d=null,e=null;return c&&(e=c.querySelector("footer, .ui-footer, .ui-popup-footer"),e||(e=b.createElement("footer"),c.appendChild(e)),d=e.classList,d.add("ui-footer"),d.add("ui-bottom-button"),d.add("ui-fixed")),e},k._createWidgets=function(a){var b=this,c=b._ui,e=b.options;b._circleIndicator=d.widget.CircleIndicator(c.indicator,{text:e.circleType||"none",circleR:e.circleR||0,from:e.from||0,to:e.to||360,indicatorType:"line",indicatorHeight:21,indicatorColor:"rgba(249,123,47,1)",indicatorWidth:6,indicatorR:180,bigTick:e.bigTick||0,bigTickR:e.bigTickR||0,bigTickHeight:e.bigTickHeight||0,bigTickWidth:e.bigTickWidth,smallTick:e.smallTick||0,smallTickR:e.smallTickR||0,smallTickHeight:e.smallTickHeight||0}),a&&(b._spin=d.widget.Spin(c.number,{min:b.options.min,max:b.options.max,loop:"enabled",rollHeight:"custom",itemHeight:38,duration:300,value:a.value}))},k._getOptions=function(a){var b=this.options;a=this.element||a,b.min=parseInt(a.getAttribute("min"),10),b.max=parseInt(a.getAttribute("max"),10),b.step=parseInt(a.getAttribute("step"),10),b.disabled=a.getAttribute("disabled",10)},k._configure=function(a){this._getOptions(a)},k._toggle=function(a){var b=this;b.options.disabled=a,a?b._ui.container.classList.add(p.DISABLED):b._ui.container.classList.remove(p.DISABLED)},k._toggleCircleIndicator=function(a){var b=this;a?b._circleIndicator.element.classList.remove(p.HIDDEN):b._circleIndicator.element.classList.add(p.HIDDEN)},k._refresh=function(){var a=this,b=a.element;a._getOptions(),a._setValue(b.getAttribute("value")),a._toggleCircleIndicator(!1),a._toggle(!!a.options.disabled)},k._updateValue=function(a){this._spin.value(a)},k._getValue=function(){return parseInt(this.element.value,10)},k._setValue=function(a){var b=this,c=b.element,d=b.options;a=parseInt(a,10),a>d.max?a=d.min:a<d.min&&(a=d.max),c.setAttribute("value",a),c.value=a,b._updateValue(a)},k._init=function(){var a=this;a.value(a.element.value),a._toggle(!!a.options.disabled),a._toggleCircleIndicator(!1)},k._build=function(a){var c=this,d=c._ui,e=b.createElement("div"),f=j.getClosestBySelector(a,".ui-pag
|
||
|
rel:c.rel},c.url,c.title)},onHashChange:function(){return null},find:function(){return null}};d.router.route.grid=b}(),function(a){a.addEventListener("beforerouterinit",function(){d.autoInitializePage!==c&&d.setConfig("autoInitializePage",d.autoInitializePage)},!1),a.addEventListener("routerinit",function(b){var e=b.detail,f=d.util.object,g=e.getRoute("page"),h=e.getRoute("popup"),i=d.history,j=i.back.bind(e),k=d.widget.core.Page.classes,l=k.uiPageActive;d.changePage=e.open.bind(e),a.addEventListener("pageshow",function(){d.activePage=a.querySelector("."+l)}),d.firstPage=g.getFirstElement(),d.getActivePage=g.getActiveElement.bind(g),d.back=j,d.initializePage=e.init.bind(e),d.pageContainer=e.container,d.openPopup=function(a,b){var d;d=a&&a.length!==c&&"object"==typeof a?a[0]:a,b=f.merge({},b,{rel:"popup"}),e.open(d,b)},d.closePopup=h.close.bind(h,null)},!1)}(a.document),function(a){var b=a.engine;a.IndexScrollbar=function(c,d){return a.warn("tau.IndexScrollbar is deprecated. you have to use tau.widget.IndexScrollbar."),b.instanceWidget(c,"IndexScrollbar",d)},a.SectionChanger=function(c,d){return a.warn("tau.SectionChanger is deprecated. you have to use tau.widget.SectionChanger."),b.instanceWidget(c,"SectionChanger",d)},a.SwipeList=function(c,d){return a.warn("tau.SwipeList is deprecated. you have to use tau.widget.SwipeList."),b.instanceWidget(c,"SwipeList",d)},a.VirtualListview=function(c,d){return a.warn("tau.VirtualListview is deprecated. you have to use tau.widget.VirtualListview."),b.instanceWidget(c,"VirtualListview",d)}}(d),function(a,b,c){var d=c.event,e=function(a){var b=a.target,c=!1,e={left:!1,right:!1,top:!1,bottom:!1};b.scrollHeight>b.clientHeight&&(0===b.scrollTop?(c=!0,e.top=!0):b.scrollTop===b.scrollHeight-b.clientHeight&&(c=!0,e.bottom=!0)),b.scrollWidth>b.clientWidth&&(0===b.scrollLeft?(c=!0,e.left=!0):b.scrollLeft===b.scrollWidth-b.clientWidth&&(c=!0,e.right=!0)),c&&d.trigger(b,"scrolledtoedge",e)},f={enable:function(){a.addEventListener("scroll",e,!0)},disable:function(){a.removeEventListener("scroll",e,!0)}};c.event.scrolledtoedge=f}(a,a.document,d),function(a,b,c){function d(a){var b="CCW";a.deltaY>0&&(b="CW"),f.trigger(a.target,"rotarydetent",{direction:b})}var e={enabled:!0,bind:function(){b.addEventListener("mousewheel",d,!0)},unbind:function(){b.removeEventListener("mousewheel",d,!0)}},f=c.event;e.bind(),c.event.pinch=e}(a,a.document,d),function(a){var b=a.event.gesture,c=b.Result,d=a.event.gesture.Detector,e={start:"pinchstart",move:"pinchmove",end:"pinchend",cancel:"pinchcancel","in":"pinchin",out:"pinchout"},f=d.plugin.create({name:"pinch",index:300,eventNames:e,defaults:{velocity:.6,timeThreshold:400},isTriggered:!1,handler:function(a,d,f){var g,h=c.PENDING;switch(a.eventType){case b.Event.MOVE:if(1===a.pointers.length&&a.distance>35)h=c.FINISHED;else if(!this.isTriggered&&a.pointers.length>=2)this.isTriggered=!0,d.sendEvent(e.start,a)===!1&&a.preventDefault(),h=c.RUNNING;else if(this.isTriggered){if(a.deltaTime<f.timeThreshold&&(a.velocityX>f.velocity||a.velocityY>f.velocity))return g=a.scale<1?d.sendEvent(e["in"],a):d.sendEvent(e.out,a),g===!1&&a.preventDefault(),this.isTriggered=!1,h=c.FINISHED|c.BLOCK;d.sendEvent(e.move,a)===!1&&a.preventDefault(),h=c.RUNNING}break;case b.Event.BLOCKED:case b.Event.END:this.isTriggered&&(d.sendEvent(e.end,a)===!1&&a.preventDefault(),this.isTriggered=!1,h=c.FINISHED);break;case b.Event.CANCEL:this.isTriggered&&(d.sendEvent(e.cancel,a)===!1&&a.preventDefault(),this.isTriggered=!1,h=c.FINISHED)}return h}});a.event.gesture.Pinch=f}(d),function(){function a(a,b,c){var d,e=c.target,f={};4===e.readyState&&(f.success=200===e.status||0===e.status&&e.responseXML,d=e.responseXML,b.fullDocument||(d=d.body.firstChild),a(f,d))}function b(b,c,d,e){var g,h=c,i=a.bind(null,e,d);d&&(h=f.addSearchParams(c,d)),g=new XMLHttpRequest,g.responseType="document",g.overrideMimeType("text/html"),g.open("GET",h),g.addEventListener("error",i),g.addEventListener("load",i),g.send()}var c=d.template,e=d.util,f=e.path;c.register("html",b)}(),function(a){a.getConfig("autorun",!0)===!0&&a
|