1 |
|
2 | "use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}!function(){function BaseClass(){}var fnTest=/xyz/.test(function(){xyz})?/\b_super\b/:/.*/;BaseClass.extend=function(props){var _super=this.prototype,proto=Object.create(_super);for(var name in props)proto[name]="function"==typeof props[name]&&"function"==typeof _super[name]&&fnTest.test(props[name])?function(name,fn){return function(){var tmp=this._super;this._super=_super[name];var ret=fn.apply(this,arguments);return this._super=tmp,ret}}(name,props[name]):props[name];var newClass="function"==typeof proto.init?proto.hasOwnProperty("init")?proto.init:function(){_super.init.apply(this,arguments)}:function(){};return newClass.prototype=proto,proto.constructor=newClass,newClass.extend=BaseClass.extend,newClass},window.Class=BaseClass}(),function(app){try{app=angular.module("templates-main")}catch(err){app=angular.module("templates-main",[])}app.run(["$templateCache",function($templateCache){$templateCache.put("templates/sliding_menu.tpl",'<div class="onsen-sliding-menu__menu"></div>\n<div class="onsen-sliding-menu__main"></div>\n'),$templateCache.put("templates/split_view.tpl",'<div class="onsen-split-view__secondary full-screen"></div>\n<div class="onsen-split-view__main full-screen"></div>\n')}])}(),function(ons){function waitOnsenUILoad(){var unlockOnsenUI=ons._readyLock.lock();module.run(["$compile","$rootScope",function($compile,$rootScope){if("loading"===document.readyState||"uninitialized"==document.readyState)window.addEventListener("DOMContentLoaded",function(){document.body.appendChild(document.createElement("ons-dummy-for-init"))});else{if(!document.body)throw new Error("Invalid initialization state.");document.body.appendChild(document.createElement("ons-dummy-for-init"))}$rootScope.$on("$ons-ready",unlockOnsenUI)}])}function initAngularModule(){module.value("$onsGlobal",ons),module.run(["$compile","$rootScope","$onsen","$q",function($compile,$rootScope,$onsen,$q){ons._onsenService=$onsen,ons._qService=$q,$rootScope.ons=window.ons,$rootScope.console=window.console,$rootScope.alert=window.alert,ons.$compile=$compile}])}function initTemplateCache(){module.run(["$templateCache",function($templateCache){var tmp=ons._internal.getTemplateHTMLAsync;ons._internal.getTemplateHTMLAsync=function(page){var cache=$templateCache.get(page);return cache?Promise.resolve(cache):tmp(page)}}])}function initOnsenFacade(){ons._onsenService=null,ons.componentBase=window,ons.bootstrap=function(name,deps){angular.isArray(name)&&(deps=name,name=void 0),name||(name="myOnsenApp"),deps=["onsen"].concat(angular.isArray(deps)?deps:[]);var module=angular.module(name,deps),doc=window.document;if("loading"==doc.readyState||"uninitialized"==doc.readyState||"interactive"==doc.readyState)doc.addEventListener("DOMContentLoaded",function(){angular.bootstrap(doc.documentElement,[name])},!1);else{if(!doc.documentElement)throw new Error("Invalid state");angular.bootstrap(doc.documentElement,[name])}return module},ons.findParentComponentUntil=function(name,dom){var element;return dom instanceof HTMLElement?element=angular.element(dom):dom instanceof angular.element?element=dom:dom.target&&(element=angular.element(dom.target)),element.inheritedData(name)},ons.findComponent=function(selector,dom){var target=(dom?dom:document).querySelector(selector);return target?angular.element(target).data(target.nodeName.toLowerCase())||null:null},ons.compile=function(dom){if(!ons.$compile)throw new Error("ons.$compile() is not ready. Wait for initialization with ons.ready().");if(!(dom instanceof HTMLElement))throw new Error("First argument must be an instance of HTMLElement.");var scope=angular.element(dom).scope();if(!scope)throw new Error("AngularJS Scope is null. Argument DOM element must be attached in DOM document.");ons.$compile(dom)(scope)},ons._getOnsenService=function(){if(!this._onsenService)throw new Error("$onsen is not loaded, wait for ons.ready().");return this._onsenService},ons._waitDiretiveInit=function(elementName,lastReady){return function(element,callback){if(angular.element(element).data(elementName))lastReady(element,callback);else{var listen=function listen(){lastReady(element,callback),element.removeEventListener(elementName+":init",listen,!1)};element.addEventListener(elementName+":init",listen,!1)}}},ons.createAlertDialog=function(page,options){return options=options||{},options.link=function(element){options.parentScope?(ons.$compile(angular.element(element))(options.parentScope.$new()),options.parentScope.$evalAsync()):ons.compile(element)},ons._createAlertDialogOriginal(page,options).then(function(alertDialog){return angular.element(alertDialog).data("ons-alert-dialog")})},ons.createDialog=function(page,options){return options=options||{},options.link=function(element){options.parentScope?(ons.$compile(angular.element(element))(options.parentScope.$new()),options.parentScope.$evalAsync()):ons.compile(element)},ons._createDialogOriginal(page,options).then(function(dialog){return angular.element(dialog).data("ons-dialog")})},ons.createPopover=function(page,options){return options=options||{},options.link=function(element){options.parentScope?(ons.$compile(angular.element(element))(options.parentScope.$new()),options.parentScope.$evalAsync()):ons.compile(element)},ons._createPopoverOriginal(page,options).then(function(popover){return angular.element(popover).data("ons-popover")})},ons.resolveLoadingPlaceholder=function(page){return ons._resolveLoadingPlaceholderOriginal(page,function(element,done){ons.compile(element),angular.element(element).scope().$evalAsync(function(){setImmediate(done)})})},ons._setupLoadingPlaceHolders=function(){}}var module=angular.module("onsen",["templates-main"]);angular.module("onsen.directives",["onsen"]),initOnsenFacade(),waitOnsenUILoad(),initAngularModule(),initTemplateCache()}(window.ons=window.ons||{}),function(){var module=angular.module("onsen");module.factory("AlertDialogView",["$onsen",function($onsen){var AlertDialogView=Class.extend({init:function(scope,element,attrs){this._scope=scope,this._element=element,this._attrs=attrs,this._clearDerivingMethods=$onsen.deriveMethods(this,this._element[0],["show","hide"]),this._clearDerivingEvents=$onsen.deriveEvents(this,this._element[0],["preshow","postshow","prehide","posthide","cancel"],function(detail){return detail.alertDialog&&(detail.alertDialog=this),detail}.bind(this)),this._scope.$on("$destroy",this._destroy.bind(this))},_destroy:function(){this.emit("destroy"),this._element.remove(),this._clearDerivingMethods(),this._clearDerivingEvents(),this._scope=this._attrs=this._element=null}});return MicroEvent.mixin(AlertDialogView),$onsen.derivePropertiesFromElement(AlertDialogView,["disabled","cancelable","visible","onDeviceBackButton"]),AlertDialogView}])}(),angular.module("onsen").value("AlertDialogAnimator",ons._internal.AlertDialogAnimator).value("AndroidAlertDialogAnimator",ons._internal.AndroidAlertDialogAnimator).value("IOSAlertDialogAnimator",ons._internal.IOSAlertDialogAnimator),angular.module("onsen").value("AnimationChooser",ons._internal.AnimatorFactory),function(){var module=angular.module("onsen");module.factory("CarouselView",["$onsen",function($onsen){var CarouselView=Class.extend({init:function(scope,element,attrs){this._element=element,this._scope=scope,this._attrs=attrs,this._scope.$on("$destroy",this._destroy.bind(this)),this._clearDerivingMethods=$onsen.deriveMethods(this,element[0],["setActiveIndex","getActiveIndex","next","prev","refresh","first","last"]),this._clearDerivingEvents=$onsen.deriveEvents(this,element[0],["refresh","postchange","overscroll"],function(detail){return detail.carousel&&(detail.carousel=this),detail}.bind(this))},_destroy:function(){this.emit("destroy"),this._clearDerivingEvents(),this._clearDerivingMethods(),this._element=this._scope=this._attrs=null}});return MicroEvent.mixin(CarouselView),$onsen.derivePropertiesFromElement(CarouselView,["centered","overscrollable","disabled","autoScroll","swipeable","autoScrollRatio","itemCount"]),CarouselView}])}(),function(){var module=angular.module("onsen");module.factory("DialogView",["$onsen",function($onsen){var DialogView=Class.extend({init:function(scope,element,attrs){this._scope=scope,this._element=element,this._attrs=attrs,this._clearDerivingMethods=$onsen.deriveMethods(this,this._element[0],["show","hide"]),this._clearDerivingEvents=$onsen.deriveEvents(this,this._element[0],["preshow","postshow","prehide","posthide","cancel"],function(detail){return detail.dialog&&(detail.dialog=this),detail}.bind(this)),this._scope.$on("$destroy",this._destroy.bind(this))},_destroy:function(){this.emit("destroy"),this._element.remove(),this._clearDerivingMethods(),this._clearDerivingEvents(),this._scope=this._attrs=this._element=null}});return DialogView.registerAnimator=function(name,Animator){return window.ons.DialogElement.registerAnimator(name,Animator)},MicroEvent.mixin(DialogView),$onsen.derivePropertiesFromElement(DialogView,["disabled","cancelable","visible","onDeviceBackButton"]),DialogView}])}(),angular.module("onsen").value("DialogAnimator",ons._internal.DialogAnimator).value("IOSDialogAnimator",ons._internal.IOSDialogAnimator).value("AndroidDialogAnimator",ons._internal.AndroidDialogAnimator).value("SlideDialogAnimator",ons._internal.SlideDialogAnimator),function(){var module=angular.module("onsen");module.factory("FabView",["$onsen",function($onsen){var FabView=Class.extend({init:function(scope,element,attrs){this._element=element,this._scope=scope,this._attrs=attrs,this._scope.$on("$destroy",this._destroy.bind(this)),this._clearDerivingMethods=$onsen.deriveMethods(this,element[0],["show","hide","toggle"])},_destroy:function(){this.emit("destroy"),this._clearDerivingMethods(),this._element=this._scope=this._attrs=null}});return $onsen.derivePropertiesFromElement(FabView,["disabled","visible"]),MicroEvent.mixin(FabView),FabView}])}(),function(){angular.module("onsen").factory("GenericView",["$onsen",function($onsen){var GenericView=Class.extend({init:function(scope,element,attrs,options){var self=this;if(options={},this._element=element,this._scope=scope,this._attrs=attrs,options.directiveOnly){if(!options.modifierTemplate)throw new Error("options.modifierTemplate is undefined.");$onsen.addModifierMethods(this,options.modifierTemplate,element)}else $onsen.addModifierMethodsForCustomElements(this,element);$onsen.cleaner.onDestroy(scope,function(){self._events=void 0,$onsen.removeModifierMethods(self),options.onDestroy&&options.onDestroy(self),$onsen.clearComponent({scope:scope,attrs:attrs,element:element}),self=element=self._element=self._scope=scope=self._attrs=attrs=options=null})}});return GenericView.register=function(scope,element,attrs,options){var view=new GenericView(scope,element,attrs,options);if(!options.viewKey)throw new Error("options.viewKey is required.");$onsen.declareVarAttribute(attrs,view),element.data(options.viewKey,view);var destroy=options.onDestroy||angular.noop;return options.onDestroy=function(view){destroy(view),element.data(options.viewKey,null)},view},MicroEvent.mixin(GenericView),GenericView}])}(),function(){var module=angular.module("onsen");module.factory("LazyRepeatView",["AngularLazyRepeatDelegate",function(AngularLazyRepeatDelegate){var LazyRepeatView=Class.extend({init:function(scope,element,attrs,linker){var _this=this;this._element=element,this._scope=scope,this._attrs=attrs,this._linker=linker,ons._util.updateParentPosition(element[0]);var userDelegate=this._scope.$eval(this._attrs.onsLazyRepeat),internalDelegate=new AngularLazyRepeatDelegate(userDelegate,element[0],element.scope());this._provider=new ons._internal.LazyRepeatProvider(element[0].parentNode,internalDelegate),userDelegate.refresh=this._provider.refresh.bind(this._provider),element.remove(),this._scope.$watch(internalDelegate.countItems.bind(internalDelegate),this._provider._onChange.bind(this._provider)),this._scope.$on("$destroy",function(){_this._element=_this._scope=_this._attrs=_this._linker=null})}});return LazyRepeatView}])}();var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_get=function get(object,property,receiver){null===object&&(object=Function.prototype);var desc=Object.getOwnPropertyDescriptor(object,property);if(void 0===desc){var parent=Object.getPrototypeOf(object);return null===parent?void 0:get(parent,property,receiver)}if("value"in desc)return desc.value;var getter=desc.get;if(void 0!==getter)return getter.call(receiver)};!function(){angular.module("onsen").factory("AngularLazyRepeatDelegate",["$compile",function($compile){var directiveAttributes=["ons-lazy-repeat","ons:lazy:repeat","ons_lazy_repeat","data-ons-lazy-repeat","x-ons-lazy-repeat"],AngularLazyRepeatDelegate=function(_ons$_internal$LazyRe){function AngularLazyRepeatDelegate(userDelegate,templateElement,parentScope){_classCallCheck(this,AngularLazyRepeatDelegate);var _this=_possibleConstructorReturn(this,(AngularLazyRepeatDelegate.__proto__||Object.getPrototypeOf(AngularLazyRepeatDelegate)).call(this,userDelegate,templateElement));return _this._parentScope=parentScope,directiveAttributes.forEach(function(attr){return templateElement.removeAttribute(attr)}),_this._linker=$compile(templateElement?templateElement.cloneNode(!0):null),_this}return _inherits(AngularLazyRepeatDelegate,_ons$_internal$LazyRe),_createClass(AngularLazyRepeatDelegate,[{key:"configureItemScope",value:function(item,scope){this._userDelegate.configureItemScope instanceof Function&&this._userDelegate.configureItemScope(item,scope)}},{key:"destroyItemScope",value:function(item,element){this._userDelegate.destroyItemScope instanceof Function&&this._userDelegate.destroyItemScope(item,element)}},{key:"_usingBinding",value:function(){if(this._userDelegate.configureItemScope)return!0;if(this._userDelegate.createItemContent)return!1;throw new Error("`lazy-repeat` delegate object is vague.")}},{key:"loadItemElement",value:function(index,parent,done){this._prepareItemElement(index,function(_ref){var element=_ref.element,scope=_ref.scope;parent.appendChild(element),done({element:element,scope:scope})})}},{key:"_prepareItemElement",value:function(index,done){var _this2=this,scope=this._parentScope.$new();this._addSpecialProperties(index,scope),this._usingBinding()&&this.configureItemScope(index,scope),this._linker(scope,function(cloned){var element=cloned[0];_this2._usingBinding()||(element=_this2._userDelegate.createItemContent(index,element),$compile(element)(scope)),done({element:element,scope:scope})})}},{key:"_addSpecialProperties",value:function(i,scope){var last=this.countItems()-1;angular.extend(scope,{$index:i,$first:0===i,$last:i===last,$middle:0!==i&&i!==last,$even:i%2===0,$odd:i%2===1})}},{key:"updateItem",value:function(index,item){var _this3=this;this._usingBinding()?item.scope.$evalAsync(function(){return _this3.configureItemScope(index,item.scope)}):_get(AngularLazyRepeatDelegate.prototype.__proto__||Object.getPrototypeOf(AngularLazyRepeatDelegate.prototype),"updateItem",this).call(this,index,item)}},{key:"destroyItem",value:function(index,item){this._usingBinding()?this.destroyItemScope(index,item.scope):_get(AngularLazyRepeatDelegate.prototype.__proto__||Object.getPrototypeOf(AngularLazyRepeatDelegate.prototype),"destroyItem",this).call(this,index,item.element),item.scope.$destroy()}},{key:"destroy",value:function(){_get(AngularLazyRepeatDelegate.prototype.__proto__||Object.getPrototypeOf(AngularLazyRepeatDelegate.prototype),"destroy",this).call(this),this._scope=null}}]),AngularLazyRepeatDelegate}(ons._internal.LazyRepeatDelegate);return AngularLazyRepeatDelegate}])}(),function(){var module=angular.module("onsen");module.value("ModalAnimator",ons._internal.ModalAnimator),module.value("FadeModalAnimator",ons._internal.FadeModalAnimator),module.factory("ModalView",["$onsen","$parse",function($onsen,$parse){var ModalView=Class.extend({_element:void 0,_scope:void 0,init:function(scope,element,attrs){this._scope=scope,this._element=element,this._scope.$on("$destroy",this._destroy.bind(this)),element[0]._animatorFactory.setAnimationOptions($parse(attrs.animationOptions)())},show:function(options){return this._element[0].show(options)},hide:function(options){return this._element[0].hide(options)},toggle:function(options){return this._element[0].toggle(options)},_destroy:function(){this.emit("destroy",{page:this}),this._events=this._element=this._scope=null}});return ModalView.registerAnimator=function(name,Animator){return window.ons.ModalElement.registerAnimator(name,Animator)},MicroEvent.mixin(ModalView),$onsen.derivePropertiesFromElement(ModalView,["onDeviceBackButton"]),ModalView}])}(),function(){var module=angular.module("onsen");module.factory("NavigatorView",["$compile","$onsen",function($compile,$onsen){var NavigatorView=Class.extend({_element:void 0,_attrs:void 0,_scope:void 0,init:function(scope,element,attrs){this._element=element||angular.element(window.document.body),this._scope=scope||this._element.scope(),this._attrs=attrs,this._previousPageScope=null,this._boundOnPrepop=this._onPrepop.bind(this),this._boundOnPageDestroy=this._onPageDestroy.bind(this),this._element.on("prepop",this._boundOnPrepop),this._element.on("destroy",this._boundOnPageDestroy),this._scope.$on("$destroy",this._destroy.bind(this)),this._clearDerivingEvents=$onsen.deriveEvents(this,element[0],["prepush","postpush","prepop","postpop","init","show","hide","destroy"],function(detail){return detail.navigator&&(detail.navigator=this),detail}.bind(this)),this._clearDerivingMethods=$onsen.deriveMethods(this,element[0],["insertPage","pushPage","bringPageTop","popPage","replacePage","resetToPage","canPopPage"])},_onPrepop:function(event){var pages=event.detail.navigator.pages;angular.element(pages[pages.length-2]).data("_scope").$evalAsync()},_onPageDestroy:function(event){var page=event.target;if(this._element[0]===page.parentNode){var scope=angular.element(page).data("_scope");scope.$destroy()}},_compileAndLink:function(pageElement,callback){var link=$compile(pageElement),pageScope=this._createPageScope();link(pageScope),angular.element(pageElement).data("_scope",pageScope),pageScope.$evalAsync(function(){callback(pageElement)})},_destroy:function(){this.emit("destroy"),this._clearDerivingEvents(),this._clearDerivingMethods(),this._element.off("prepop",this._boundOnPrepop),this._element.off("destroy",this._boundOnPageDestroy),this._element=this._scope=this._attrs=null},_createPageScope:function(){return this._scope.$new()}});return MicroEvent.mixin(NavigatorView),$onsen.derivePropertiesFromElement(NavigatorView,["pages","topPage"]),NavigatorView}])}(),angular.module("onsen").value("NavigatorTransitionAnimator",ons._internal.NavigatorTransitionAnimator).value("FadeTransitionAnimator",ons._internal.FadeNavigatorTransitionAnimator).value("IOSSlideTransitionAnimator",ons._internal.IOSSlideNavigatorTransitionAnimator).value("LiftTransitionAnimator",ons._internal.LiftNavigatorTransitionAnimator).value("NullTransitionAnimator",ons._internal.NavigatorTransitionAnimator).value("SimpleSlideTransitionAnimator",ons._internal.SimpleSlideNavigatorTransitionAnimator),function(){var module=angular.module("onsen");module.factory("OverlaySlidingMenuAnimator",["SlidingMenuAnimator",function(SlidingMenuAnimator){var OverlaySlidingMenuAnimator=SlidingMenuAnimator.extend({_blackMask:void 0,_isRight:!1,_element:!1,_menuPage:!1,_mainPage:!1,_width:!1,setup:function(element,mainPage,menuPage,options){options=options||{},this._width=options.width||"90%",this._isRight=!!options.isRight,this._element=element,this._mainPage=mainPage,this._menuPage=menuPage,menuPage.css("box-shadow","0px 0 10px 0px rgba(0, 0, 0, 0.2)"),menuPage.css({width:options.width,display:"none",zIndex:2}),menuPage.css("-webkit-transform","translate3d(0px, 0px, 0px)"),mainPage.css({zIndex:1}),this._isRight?menuPage.css({right:"-"+options.width,left:"auto"}):menuPage.css({right:"auto",left:"-"+options.width}),this._blackMask=angular.element("<div></div>").css({backgroundColor:"black",top:"0px",left:"0px",right:"0px",bottom:"0px",position:"absolute",display:"none",zIndex:0}),element.prepend(this._blackMask)},onResized:function(options){if(this._menuPage.css("width",options.width),this._isRight?this._menuPage.css({right:"-"+options.width,left:"auto"}):this._menuPage.css({right:"auto",left:"-"+options.width}),options.isOpened){var max=this._menuPage[0].clientWidth,menuStyle=this._generateMenuPageStyle(max);animit(this._menuPage[0]).queue(menuStyle).play()}},destroy:function(){this._blackMask&&(this._blackMask.remove(),this._blackMask=null),this._mainPage.removeAttr("style"),this._menuPage.removeAttr("style"),this._element=this._mainPage=this._menuPage=null},openMenu:function(callback,instant){var duration=instant===!0?0:this.duration,delay=instant===!0?0:this.delay;this._menuPage.css("display","block"),this._blackMask.css("display","block");var max=this._menuPage[0].clientWidth,menuStyle=this._generateMenuPageStyle(max),mainPageStyle=this._generateMainPageStyle(max);setTimeout(function(){animit(this._mainPage[0]).wait(delay).queue(mainPageStyle,{duration:duration,timing:this.timing}).queue(function(done){callback(),done()}).play(),animit(this._menuPage[0]).wait(delay).queue(menuStyle,{duration:duration,timing:this.timing}).play()}.bind(this),1e3/60)},closeMenu:function(callback,instant){var duration=instant===!0?0:this.duration,delay=instant===!0?0:this.delay;this._blackMask.css({display:"block"});var menuPageStyle=this._generateMenuPageStyle(0),mainPageStyle=this._generateMainPageStyle(0);setTimeout(function(){animit(this._mainPage[0]).wait(delay).queue(mainPageStyle,{duration:duration,timing:this.timing}).queue(function(done){this._menuPage.css("display","none"),callback(),done()}.bind(this)).play(),animit(this._menuPage[0]).wait(delay).queue(menuPageStyle,{duration:duration,timing:this.timing}).play()}.bind(this),1e3/60)},translateMenu:function(options){this._menuPage.css("display","block"),this._blackMask.css({display:"block"});var menuPageStyle=this._generateMenuPageStyle(Math.min(options.maxDistance,options.distance)),mainPageStyle=this._generateMainPageStyle(Math.min(options.maxDistance,options.distance));delete mainPageStyle.opacity,animit(this._menuPage[0]).queue(menuPageStyle).play(),Object.keys(mainPageStyle).length>0&&animit(this._mainPage[0]).queue(mainPageStyle).play()},_generateMenuPageStyle:function(distance){var x=this._isRight?-distance:distance,transform="translate3d("+x+"px, 0, 0)";return{transform:transform,"box-shadow":0===distance?"none":"0px 0 10px 0px rgba(0, 0, 0, 0.2)"}},_generateMainPageStyle:function(distance){var max=this._menuPage[0].clientWidth,opacity=1-.1*distance/max;return{opacity:opacity}},copy:function(){return new OverlaySlidingMenuAnimator}});return OverlaySlidingMenuAnimator}])}(),function(){var module=angular.module("onsen");module.factory("PageView",["$onsen","$parse",function($onsen,$parse){var PageView=Class.extend({init:function(scope,element,attrs){var _this=this;this._scope=scope,this._element=element,this._attrs=attrs,this._clearListener=scope.$on("$destroy",this._destroy.bind(this)),this._clearDerivingEvents=$onsen.deriveEvents(this,element[0],["init","show","hide","destroy"]),Object.defineProperty(this,"onDeviceBackButton",{get:function(){return _this._element[0].onDeviceBackButton},set:function(value){_this._userBackButtonHandler||_this._enableBackButtonHandler(),_this._userBackButtonHandler=value}}),(this._attrs.ngDeviceBackButton||this._attrs.onDeviceBackButton)&&this._enableBackButtonHandler(),this._attrs.ngInfiniteScroll&&(this._element[0].onInfiniteScroll=function(done){$parse(_this._attrs.ngInfiniteScroll)(_this._scope)(done)})},_enableBackButtonHandler:function(){this._userBackButtonHandler=angular.noop,this._element[0].onDeviceBackButton=this._onDeviceBackButton.bind(this)},_onDeviceBackButton:function($event){if(this._userBackButtonHandler($event),this._attrs.ngDeviceBackButton&&$parse(this._attrs.ngDeviceBackButton)(this._scope,{$event:$event}),this._attrs.onDeviceBackButton){var lastEvent=window.$event;window.$event=$event,new Function(this._attrs.onDeviceBackButton)(),window.$event=lastEvent}},_destroy:function(){this._clearDerivingEvents(),this._element=null,this._scope=null,this._clearListener()}});return MicroEvent.mixin(PageView),PageView}])}(),function(){angular.module("onsen").factory("PopoverView",["$onsen",function($onsen){var PopoverView=Class.extend({init:function(scope,element,attrs){this._element=element,this._scope=scope,this._attrs=attrs,this._scope.$on("$destroy",this._destroy.bind(this)),this._clearDerivingMethods=$onsen.deriveMethods(this,this._element[0],["show","hide"]),this._clearDerivingEvents=$onsen.deriveEvents(this,this._element[0],["preshow","postshow","prehide","posthide"],function(detail){return detail.popover&&(detail.popover=this),detail}.bind(this))},_destroy:function(){this.emit("destroy"),this._clearDerivingMethods(),this._clearDerivingEvents(),this._element.remove(),this._element=this._scope=null}});return MicroEvent.mixin(PopoverView),$onsen.derivePropertiesFromElement(PopoverView,["cancelable","disabled","onDeviceBackButton"]),PopoverView}])}(),angular.module("onsen").value("PopoverAnimator",ons._internal.PopoverAnimator).value("FadePopoverAnimator",ons._internal.FadePopoverAnimator),function(){var module=angular.module("onsen");module.factory("PullHookView",["$onsen","$parse",function($onsen,$parse){var PullHookView=Class.extend({init:function(scope,element,attrs){var _this=this;this._element=element,this._scope=scope,this._attrs=attrs,this._clearDerivingEvents=$onsen.deriveEvents(this,this._element[0],["changestate"],function(detail){return detail.pullHook&&(detail.pullHook=_this),detail}),this.on("changestate",function(){return _this._scope.$evalAsync()}),this._element[0].onAction=function(done){_this._attrs.ngAction?_this._scope.$eval(_this._attrs.ngAction,{$done:done}):_this.onAction?_this.onAction(done):done()},this._scope.$on("$destroy",this._destroy.bind(this))},_destroy:function(){this.emit("destroy"),this._clearDerivingEvents(),this._element=this._scope=this._attrs=null}});return MicroEvent.mixin(PullHookView),$onsen.derivePropertiesFromElement(PullHookView,["state","pullDistance","height","thresholdHeight","disabled"]),PullHookView}])}(),function(){var module=angular.module("onsen");module.factory("PushSlidingMenuAnimator",["SlidingMenuAnimator",function(SlidingMenuAnimator){var PushSlidingMenuAnimator=SlidingMenuAnimator.extend({_isRight:!1,_element:void 0,_menuPage:void 0,_mainPage:void 0,_width:void 0,setup:function(element,mainPage,menuPage,options){options=options||{},this._element=element,this._mainPage=mainPage,this._menuPage=menuPage,this._isRight=!!options.isRight,this._width=options.width||"90%",menuPage.css({width:options.width,display:"none"}),this._isRight?menuPage.css({right:"-"+options.width,left:"auto"}):menuPage.css({right:"auto",left:"-"+options.width})},onResized:function(options){if(this._menuPage.css("width",options.width),this._isRight?this._menuPage.css({right:"-"+options.width,left:"auto"}):this._menuPage.css({right:"auto",left:"-"+options.width}),options.isOpened){var max=this._menuPage[0].clientWidth,mainPageTransform=this._generateAbovePageTransform(max),menuPageStyle=this._generateBehindPageStyle(max);animit(this._mainPage[0]).queue({transform:mainPageTransform}).play(),animit(this._menuPage[0]).queue(menuPageStyle).play()}},destroy:function(){this._mainPage.removeAttr("style"),this._menuPage.removeAttr("style"),this._element=this._mainPage=this._menuPage=null},openMenu:function(callback,instant){var duration=instant===!0?0:this.duration,delay=instant===!0?0:this.delay;this._menuPage.css("display","block");var max=this._menuPage[0].clientWidth,aboveTransform=this._generateAbovePageTransform(max),behindStyle=this._generateBehindPageStyle(max);setTimeout(function(){animit(this._mainPage[0]).wait(delay).queue({transform:aboveTransform},{duration:duration,timing:this.timing}).queue(function(done){callback(),done()}).play(),animit(this._menuPage[0]).wait(delay).queue(behindStyle,{duration:duration,timing:this.timing}).play()}.bind(this),1e3/60)},closeMenu:function(callback,instant){var duration=instant===!0?0:this.duration,delay=instant===!0?0:this.delay,aboveTransform=this._generateAbovePageTransform(0),behindStyle=this._generateBehindPageStyle(0);setTimeout(function(){animit(this._mainPage[0]).wait(delay).queue({transform:aboveTransform},{duration:duration,timing:this.timing}).queue({transform:"translate3d(0, 0, 0)"}).queue(function(done){this._menuPage.css("display","none"),callback(),done()}.bind(this)).play(),animit(this._menuPage[0]).wait(delay).queue(behindStyle,{duration:duration,timing:this.timing}).queue(function(done){done()}).play()}.bind(this),1e3/60)},translateMenu:function(options){this._menuPage.css("display","block");var aboveTransform=this._generateAbovePageTransform(Math.min(options.maxDistance,options.distance)),behindStyle=this._generateBehindPageStyle(Math.min(options.maxDistance,options.distance));animit(this._mainPage[0]).queue({transform:aboveTransform}).play(),animit(this._menuPage[0]).queue(behindStyle).play()},_generateAbovePageTransform:function(distance){var x=this._isRight?-distance:distance,aboveTransform="translate3d("+x+"px, 0, 0)";return aboveTransform},_generateBehindPageStyle:function(distance){var behindX=this._isRight?-distance:distance,behindTransform="translate3d("+behindX+"px, 0, 0)";return{transform:behindTransform}},copy:function(){return new PushSlidingMenuAnimator}});return PushSlidingMenuAnimator}])}(),function(){var module=angular.module("onsen");module.factory("RevealSlidingMenuAnimator",["SlidingMenuAnimator",function(SlidingMenuAnimator){var RevealSlidingMenuAnimator=SlidingMenuAnimator.extend({_blackMask:void 0,_isRight:!1,_menuPage:void 0,_element:void 0,_mainPage:void 0,setup:function(element,mainPage,menuPage,options){this._element=element,this._menuPage=menuPage,this._mainPage=mainPage,this._isRight=!!options.isRight,this._width=options.width||"90%",mainPage.css({boxShadow:"0px 0 10px 0px rgba(0, 0, 0, 0.2)"}),menuPage.css({width:options.width,opacity:.9,display:"none"}),this._isRight?menuPage.css({right:"0px",left:"auto"}):menuPage.css({right:"auto",left:"0px"}),this._blackMask=angular.element("<div></div>").css({backgroundColor:"black",top:"0px",left:"0px",right:"0px",bottom:"0px",position:"absolute",display:"none"}),element.prepend(this._blackMask),animit(mainPage[0]).queue({transform:"translate3d(0, 0, 0)"}).play()},onResized:function(options){if(this._width=options.width,this._menuPage.css("width",this._width),options.isOpened){var max=this._menuPage[0].clientWidth,aboveTransform=this._generateAbovePageTransform(max),behindStyle=this._generateBehindPageStyle(max);
|
3 | animit(this._mainPage[0]).queue({transform:aboveTransform}).play(),animit(this._menuPage[0]).queue(behindStyle).play()}},destroy:function(){this._blackMask&&(this._blackMask.remove(),this._blackMask=null),this._mainPage&&this._mainPage.attr("style",""),this._menuPage&&this._menuPage.attr("style",""),this._mainPage=this._menuPage=this._element=void 0},openMenu:function(callback,instant){var duration=instant===!0?0:this.duration,delay=instant===!0?0:this.delay;this._menuPage.css("display","block"),this._blackMask.css("display","block");var max=this._menuPage[0].clientWidth,aboveTransform=this._generateAbovePageTransform(max),behindStyle=this._generateBehindPageStyle(max);setTimeout(function(){animit(this._mainPage[0]).wait(delay).queue({transform:aboveTransform},{duration:duration,timing:this.timing}).queue(function(done){callback(),done()}).play(),animit(this._menuPage[0]).wait(delay).queue(behindStyle,{duration:duration,timing:this.timing}).play()}.bind(this),1e3/60)},closeMenu:function(callback,instant){var duration=instant===!0?0:this.duration,delay=instant===!0?0:this.delay;this._blackMask.css("display","block");var aboveTransform=this._generateAbovePageTransform(0),behindStyle=this._generateBehindPageStyle(0);setTimeout(function(){animit(this._mainPage[0]).wait(delay).queue({transform:aboveTransform},{duration:duration,timing:this.timing}).queue({transform:"translate3d(0, 0, 0)"}).queue(function(done){this._menuPage.css("display","none"),callback(),done()}.bind(this)).play(),animit(this._menuPage[0]).wait(delay).queue(behindStyle,{duration:duration,timing:this.timing}).queue(function(done){done()}).play()}.bind(this),1e3/60)},translateMenu:function(options){this._menuPage.css("display","block"),this._blackMask.css("display","block");var aboveTransform=this._generateAbovePageTransform(Math.min(options.maxDistance,options.distance)),behindStyle=this._generateBehindPageStyle(Math.min(options.maxDistance,options.distance));delete behindStyle.opacity,animit(this._mainPage[0]).queue({transform:aboveTransform}).play(),animit(this._menuPage[0]).queue(behindStyle).play()},_generateAbovePageTransform:function(distance){var x=this._isRight?-distance:distance,aboveTransform="translate3d("+x+"px, 0, 0)";return aboveTransform},_generateBehindPageStyle:function(distance){var max=this._menuPage[0].getBoundingClientRect().width,behindDistance=(distance-max)/max*10;behindDistance=isNaN(behindDistance)?0:Math.max(Math.min(behindDistance,0),-10);var behindX=this._isRight?-behindDistance:behindDistance,behindTransform="translate3d("+behindX+"%, 0, 0)",opacity=1+behindDistance/100;return{transform:behindTransform,opacity:opacity}},copy:function(){return new RevealSlidingMenuAnimator}});return RevealSlidingMenuAnimator}])}(),function(){var module=angular.module("onsen"),SlidingMenuViewModel=Class.extend({_distance:0,_maxDistance:void 0,init:function(options){if(!angular.isNumber(options.maxDistance))throw new Error("options.maxDistance must be number");this.setMaxDistance(options.maxDistance)},setMaxDistance:function(maxDistance){if(maxDistance<=0)throw new Error("maxDistance must be greater then zero.");this.isOpened()&&(this._distance=maxDistance),this._maxDistance=maxDistance},shouldOpen:function(){return!this.isOpened()&&this._distance>=this._maxDistance/2},shouldClose:function(){return!this.isClosed()&&this._distance<this._maxDistance/2},openOrClose:function(options){this.shouldOpen()?this.open(options):this.shouldClose()&&this.close(options)},close:function(options){var callback=options.callback||function(){};this.isClosed()?callback():(this._distance=0,this.emit("close",options))},open:function(options){var callback=options.callback||function(){};this.isOpened()?callback():(this._distance=this._maxDistance,this.emit("open",options))},isClosed:function(){return 0===this._distance},isOpened:function(){return this._distance===this._maxDistance},getX:function(){return this._distance},getMaxDistance:function(){return this._maxDistance},translate:function(x){this._distance=Math.max(1,Math.min(this._maxDistance-1,x));var options={distance:this._distance,maxDistance:this._maxDistance};this.emit("translate",options)},toggle:function(){this.isClosed()?this.open():this.close()}});MicroEvent.mixin(SlidingMenuViewModel),module.factory("SlidingMenuView",["$onsen","$compile","$parse","AnimationChooser","SlidingMenuAnimator","RevealSlidingMenuAnimator","PushSlidingMenuAnimator","OverlaySlidingMenuAnimator",function($onsen,$compile,$parse,AnimationChooser,SlidingMenuAnimator,RevealSlidingMenuAnimator,PushSlidingMenuAnimator,OverlaySlidingMenuAnimator){var SlidingMenuView=Class.extend({_scope:void 0,_attrs:void 0,_element:void 0,_menuPage:void 0,_mainPage:void 0,_doorLock:void 0,_isRightMenu:!1,init:function(scope,element,attrs){this._scope=scope,this._attrs=attrs,this._element=element,this._menuPage=angular.element(element[0].querySelector(".onsen-sliding-menu__menu")),this._mainPage=angular.element(element[0].querySelector(".onsen-sliding-menu__main")),this._doorLock=new ons._DoorLock,this._isRightMenu="right"===attrs.side,this._mainPageGestureDetector=new ons.GestureDetector(this._mainPage[0]),this._boundOnTap=this._onTap.bind(this);var maxDistance=this._normalizeMaxSlideDistanceAttr();this._logic=new SlidingMenuViewModel({maxDistance:Math.max(maxDistance,1)}),this._logic.on("translate",this._translate.bind(this)),this._logic.on("open",function(options){this._open(options)}.bind(this)),this._logic.on("close",function(options){this._close(options)}.bind(this)),attrs.$observe("maxSlideDistance",this._onMaxSlideDistanceChanged.bind(this)),attrs.$observe("swipeable",this._onSwipeableChanged.bind(this)),this._boundOnWindowResize=this._onWindowResize.bind(this),window.addEventListener("resize",this._boundOnWindowResize),this._boundHandleEvent=this._handleEvent.bind(this),this._bindEvents(),attrs.mainPage&&this.setMainPage(attrs.mainPage),attrs.menuPage&&this.setMenuPage(attrs.menuPage),this._deviceBackButtonHandler=ons._deviceBackButtonDispatcher.createHandler(this._element[0],this._onDeviceBackButton.bind(this));var unlock=this._doorLock.lock();window.setTimeout(function(){var maxDistance=this._normalizeMaxSlideDistanceAttr();this._logic.setMaxDistance(maxDistance),this._menuPage.css({opacity:1});var animationChooser=new AnimationChooser({animators:SlidingMenuView._animatorDict,baseClass:SlidingMenuAnimator,baseClassName:"SlidingMenuAnimator",defaultAnimation:attrs.type,defaultAnimationOptions:$parse(attrs.animationOptions)()});this._animator=animationChooser.newAnimator(),this._animator.setup(this._element,this._mainPage,this._menuPage,{isRight:this._isRightMenu,width:this._attrs.maxSlideDistance||"90%"}),unlock()}.bind(this),400),scope.$on("$destroy",this._destroy.bind(this)),this._clearDerivingEvents=$onsen.deriveEvents(this,element[0],["init","show","hide","destroy"]),attrs.swipeable||this.setSwipeable(!0)},getDeviceBackButtonHandler:function(){return this._deviceBackButtonHandler},_onDeviceBackButton:function(event){this.isMenuOpened()?this.closeMenu():event.callParentHandler()},_onTap:function(){this.isMenuOpened()&&this.closeMenu()},_refreshMenuPageWidth:function(){var width="maxSlideDistance"in this._attrs?this._attrs.maxSlideDistance:"90%";this._animator&&this._animator.onResized({isOpened:this._logic.isOpened(),width:width})},_destroy:function(){this.emit("destroy"),this._clearDerivingEvents(),this._deviceBackButtonHandler.destroy(),window.removeEventListener("resize",this._boundOnWindowResize),this._mainPageGestureDetector.off("tap",this._boundOnTap),this._element=this._scope=this._attrs=null},_onSwipeableChanged:function(swipeable){swipeable=""===swipeable||void 0===swipeable||"true"==swipeable,this.setSwipeable(swipeable)},setSwipeable:function(enabled){enabled?this._activateGestureDetector():this._deactivateGestureDetector()},_onWindowResize:function(){this._recalculateMAX(),this._refreshMenuPageWidth()},_onMaxSlideDistanceChanged:function(){this._recalculateMAX(),this._refreshMenuPageWidth()},_normalizeMaxSlideDistanceAttr:function(){var maxDistance=this._attrs.maxSlideDistance;if("maxSlideDistance"in this._attrs){if("string"!=typeof maxDistance)throw new Error("invalid state");maxDistance.indexOf("px",maxDistance.length-2)!==-1?maxDistance=parseInt(maxDistance.replace("px",""),10):maxDistance.indexOf("%",maxDistance.length-1)>0&&(maxDistance=maxDistance.replace("%",""),maxDistance=parseFloat(maxDistance)/100*this._mainPage[0].clientWidth)}else maxDistance=.9*this._mainPage[0].clientWidth;return maxDistance},_recalculateMAX:function(){var maxDistance=this._normalizeMaxSlideDistanceAttr();maxDistance&&this._logic.setMaxDistance(parseInt(maxDistance,10))},_activateGestureDetector:function(){this._gestureDetector.on("touch dragleft dragright swipeleft swiperight release",this._boundHandleEvent)},_deactivateGestureDetector:function(){this._gestureDetector.off("touch dragleft dragright swipeleft swiperight release",this._boundHandleEvent)},_bindEvents:function(){this._gestureDetector=new ons.GestureDetector(this._element[0],{dragMinDistance:1})},_appendMainPage:function(pageUrl,templateHTML){var _this=this,pageScope=this._scope.$new(),pageContent=angular.element(templateHTML),link=$compile(pageContent);this._mainPage.append(pageContent),this._currentPageElement&&(this._currentPageElement.remove(),this._currentPageScope.$destroy()),link(pageScope),this._currentPageElement=pageContent,this._currentPageScope=pageScope,this._currentPageUrl=pageUrl,setImmediate(function(){_this._currentPageElement[0]._show()})},_appendMenuPage:function(templateHTML){var pageScope=this._scope.$new(),pageContent=angular.element(templateHTML),link=$compile(pageContent);this._menuPage.append(pageContent),this._currentMenuPageScope&&(this._currentMenuPageScope.$destroy(),this._currentMenuPageElement.remove()),link(pageScope),this._currentMenuPageElement=pageContent,this._currentMenuPageScope=pageScope},setMenuPage:function(page,options){if(!page)throw new Error("cannot set undefined page");options=options||{},options.callback=options.callback||function(){};var self=this;$onsen.getPageHTMLAsync(page).then(function(html){self._appendMenuPage(angular.element(html)),options.closeMenu&&self.close(),options.callback()},function(){throw new Error("Page is not found: "+page)})},setMainPage:function(pageUrl,options){options=options||{},options.callback=options.callback||function(){};var done=function(){options.closeMenu&&this.close(),options.callback()}.bind(this);if(this._currentPageUrl===pageUrl)return void done();if(!pageUrl)throw new Error("cannot set undefined page");var self=this;$onsen.getPageHTMLAsync(pageUrl).then(function(html){self._appendMainPage(pageUrl,html),done()},function(){throw new Error("Page is not found: "+page)})},_handleEvent:function(event){if(!this._doorLock.isLocked())switch(this._isInsideIgnoredElement(event.target)&&this._deactivateGestureDetector(),event.type){case"dragleft":case"dragright":if(this._logic.isClosed()&&!this._isInsideSwipeTargetArea(event))return;event.gesture.preventDefault();var deltaX=event.gesture.deltaX,deltaDistance=this._isRightMenu?-deltaX:deltaX,startEvent=event.gesture.startEvent;if("isOpened"in startEvent||(startEvent.isOpened=this._logic.isOpened()),deltaDistance<0&&this._logic.isClosed())break;if(deltaDistance>0&&this._logic.isOpened())break;var distance=startEvent.isOpened?deltaDistance+this._logic.getMaxDistance():deltaDistance;this._logic.translate(distance);break;case"swipeleft":if(event.gesture.preventDefault(),this._logic.isClosed()&&!this._isInsideSwipeTargetArea(event))return;this._isRightMenu?this.open():this.close(),event.gesture.stopDetect();break;case"swiperight":if(event.gesture.preventDefault(),this._logic.isClosed()&&!this._isInsideSwipeTargetArea(event))return;this._isRightMenu?this.close():this.open(),event.gesture.stopDetect();break;case"release":this._lastDistance=null,this._logic.shouldOpen()?this.open():this._logic.shouldClose()&&this.close()}},_isInsideIgnoredElement:function(element){do{if(element.getAttribute&&element.getAttribute("sliding-menu-ignore"))return!0;element=element.parentNode}while(element);return!1},_isInsideSwipeTargetArea:function(event){var x=event.gesture.center.pageX;"_swipeTargetWidth"in event.gesture.startEvent||(event.gesture.startEvent._swipeTargetWidth=this._getSwipeTargetWidth());var targetWidth=event.gesture.startEvent._swipeTargetWidth;return this._isRightMenu?this._mainPage[0].clientWidth-x<targetWidth:x<targetWidth},_getSwipeTargetWidth:function(){var targetWidth=this._attrs.swipeTargetWidth;"string"==typeof targetWidth&&(targetWidth=targetWidth.replace("px",""));var width=parseInt(targetWidth,10);return width<0||!targetWidth?this._mainPage[0].clientWidth:width},closeMenu:function(){return this.close.apply(this,arguments)},close:function(options){options=options||{},options="function"==typeof options?{callback:options}:options,this._logic.isClosed()||(this.emit("preclose",{slidingMenu:this}),this._doorLock.waitUnlock(function(){this._logic.close(options)}.bind(this)))},_close:function(options){var callback=options.callback||function(){},unlock=this._doorLock.lock(),instant="none"==options.animation;this._animator.closeMenu(function(){unlock(),this._mainPage.children().css("pointer-events",""),this._mainPageGestureDetector.off("tap",this._boundOnTap),this.emit("postclose",{slidingMenu:this}),callback()}.bind(this),instant)},openMenu:function(){return this.open.apply(this,arguments)},open:function(options){options=options||{},options="function"==typeof options?{callback:options}:options,this.emit("preopen",{slidingMenu:this}),this._doorLock.waitUnlock(function(){this._logic.open(options)}.bind(this))},_open:function(options){var callback=options.callback||function(){},unlock=this._doorLock.lock(),instant="none"==options.animation;this._animator.openMenu(function(){unlock(),this._mainPage.children().css("pointer-events","none"),this._mainPageGestureDetector.on("tap",this._boundOnTap),this.emit("postopen",{slidingMenu:this}),callback()}.bind(this),instant)},toggle:function(options){this._logic.isClosed()?this.open(options):this.close(options)},toggleMenu:function(){return this.toggle.apply(this,arguments)},isMenuOpened:function(){return this._logic.isOpened()},_translate:function(event){this._animator.translateMenu(event)}});return SlidingMenuView._animatorDict={"default":RevealSlidingMenuAnimator,overlay:OverlaySlidingMenuAnimator,reveal:RevealSlidingMenuAnimator,push:PushSlidingMenuAnimator},SlidingMenuView.registerAnimator=function(name,Animator){if(!(Animator.prototype instanceof SlidingMenuAnimator))throw new Error('"Animator" param must inherit SlidingMenuAnimator');this._animatorDict[name]=Animator},MicroEvent.mixin(SlidingMenuView),SlidingMenuView}])}(),function(){var module=angular.module("onsen");module.factory("SlidingMenuAnimator",function(){return Class.extend({delay:0,duration:.4,timing:"cubic-bezier(.1, .7, .1, 1)",init:function(options){options=options||{},this.timing=options.timing||this.timing,this.duration=void 0!==options.duration?options.duration:this.duration,this.delay=void 0!==options.delay?options.delay:this.delay},setup:function(element,mainPage,menuPage,options){},onResized:function(options){},openMenu:function(callback){},closeClose:function(callback){},destroy:function(){},translateMenu:function(mainPage,menuPage,options){},copy:function(){throw new Error("Override copy method.")}})})}(),function(){var module=angular.module("onsen");module.factory("SpeedDialView",["$onsen",function($onsen){var SpeedDialView=Class.extend({init:function(scope,element,attrs){this._element=element,this._scope=scope,this._attrs=attrs,this._scope.$on("$destroy",this._destroy.bind(this)),this._clearDerivingMethods=$onsen.deriveMethods(this,element[0],["show","hide","showItems","hideItems","isOpen","toggle","toggleItems"]),this._clearDerivingEvents=$onsen.deriveEvents(this,element[0],["open","close"]).bind(this)},_destroy:function(){this.emit("destroy"),this._clearDerivingEvents(),this._clearDerivingMethods(),this._element=this._scope=this._attrs=null}});return MicroEvent.mixin(SpeedDialView),$onsen.derivePropertiesFromElement(SpeedDialView,["disabled","visible","inline"]),SpeedDialView}])}(),function(){var module=angular.module("onsen");module.factory("SplitView",["$compile","RevealSlidingMenuAnimator","$onsen","$onsGlobal",function($compile,RevealSlidingMenuAnimator,$onsen,$onsGlobal){function isNumber(n){return!isNaN(parseFloat(n))&&isFinite(n)}var SPLIT_MODE=0,COLLAPSE_MODE=1,MAIN_PAGE_RATIO=.9,SplitView=Class.extend({init:function(scope,element,attrs){element.addClass("onsen-sliding-menu"),this._element=element,this._scope=scope,this._attrs=attrs,this._mainPage=angular.element(element[0].querySelector(".onsen-split-view__main")),this._secondaryPage=angular.element(element[0].querySelector(".onsen-split-view__secondary")),this._max=this._mainPage[0].clientWidth*MAIN_PAGE_RATIO,this._mode=SPLIT_MODE,this._doorLock=new ons._DoorLock,this._doSplit=!1,this._doCollapse=!1,$onsGlobal.orientation.on("change",this._onResize.bind(this)),this._animator=new RevealSlidingMenuAnimator,this._element.css("display","none"),attrs.mainPage&&this.setMainPage(attrs.mainPage),attrs.secondaryPage&&this.setSecondaryPage(attrs.secondaryPage);var unlock=this._doorLock.lock();this._considerChangingCollapse(),this._setSize(),setTimeout(function(){this._element.css("display","block"),unlock()}.bind(this),1e3/60*2),scope.$on("$destroy",this._destroy.bind(this)),this._clearDerivingEvents=$onsen.deriveEvents(this,element[0],["init","show","hide","destroy"])},_appendSecondPage:function(templateHTML){var pageScope=this._scope.$new(),pageContent=$compile(templateHTML)(pageScope);this._secondaryPage.append(pageContent),this._currentSecondaryPageElement&&(this._currentSecondaryPageElement.remove(),this._currentSecondaryPageScope.$destroy()),this._currentSecondaryPageElement=pageContent,this._currentSecondaryPageScope=pageScope},_appendMainPage:function(templateHTML){var _this=this,pageScope=this._scope.$new(),pageContent=$compile(templateHTML)(pageScope);this._mainPage.append(pageContent),this._currentPage&&this._currentPageScope.$destroy(),this._currentPage=pageContent,this._currentPageScope=pageScope,setImmediate(function(){_this._currentPage[0]._show()})},setSecondaryPage:function(page){if(!page)throw new Error("cannot set undefined page");$onsen.getPageHTMLAsync(page).then(function(html){this._appendSecondPage(angular.element(html.trim()))}.bind(this),function(){throw new Error("Page is not found: "+page)})},setMainPage:function(page){if(!page)throw new Error("cannot set undefined page");$onsen.getPageHTMLAsync(page).then(function(html){this._appendMainPage(angular.element(html.trim()))}.bind(this),function(){throw new Error("Page is not found: "+page)})},_onResize:function(){var lastMode=this._mode;this._considerChangingCollapse(),lastMode===COLLAPSE_MODE&&this._mode===COLLAPSE_MODE&&this._animator.onResized({isOpened:!1,width:"90%"}),this._max=this._mainPage[0].clientWidth*MAIN_PAGE_RATIO},_considerChangingCollapse:function(){var should=this._shouldCollapse();should&&this._mode!==COLLAPSE_MODE?(this._fireUpdateEvent(),this._doSplit?this._activateSplitMode():this._activateCollapseMode()):should||this._mode!==COLLAPSE_MODE||(this._fireUpdateEvent(),this._doCollapse?this._activateCollapseMode():this._activateSplitMode()),this._doCollapse=this._doSplit=!1},update:function(){this._fireUpdateEvent();var should=this._shouldCollapse();this._doSplit?this._activateSplitMode():this._doCollapse?this._activateCollapseMode():should?this._activateCollapseMode():should||this._activateSplitMode(),this._doSplit=this._doCollapse=!1},_getOrientation:function(){return $onsGlobal.orientation.isPortrait()?"portrait":"landscape"},getCurrentMode:function(){return this._mode===COLLAPSE_MODE?"collapse":"split"},_shouldCollapse:function(){var c="portrait";if("string"==typeof this._attrs.collapse&&(c=this._attrs.collapse.trim()),"portrait"==c)return $onsGlobal.orientation.isPortrait();if("landscape"==c)return $onsGlobal.orientation.isLandscape();if("width"==c.substr(0,5)){var num=c.split(" ")[1];num.indexOf("px")>=0&&(num=num.substr(0,num.length-2));var width=window.innerWidth;return isNumber(num)&&width<num}var mq=window.matchMedia(c);return mq.matches},_setSize:function(){if(this._mode===SPLIT_MODE){this._attrs.mainPageWidth||(this._attrs.mainPageWidth="70");var secondarySize=100-this._attrs.mainPageWidth.replace("%","");this._secondaryPage.css({width:secondarySize+"%",opacity:1}),this._mainPage.css({width:this._attrs.mainPageWidth+"%"}),this._mainPage.css("left",secondarySize+"%")}},_fireEvent:function(name){this.emit(name,{splitView:this,width:window.innerWidth,orientation:this._getOrientation()})},_fireUpdateEvent:function(){var that=this;this.emit("update",{splitView:this,shouldCollapse:this._shouldCollapse(),currentMode:this.getCurrentMode(),split:function(){that._doSplit=!0,that._doCollapse=!1},collapse:function(){that._doSplit=!1,that._doCollapse=!0},width:window.innerWidth,orientation:this._getOrientation()})},_activateCollapseMode:function(){this._mode!==COLLAPSE_MODE&&(this._fireEvent("precollapse"),this._secondaryPage.attr("style",""),this._mainPage.attr("style",""),this._mode=COLLAPSE_MODE,this._animator.setup(this._element,this._mainPage,this._secondaryPage,{isRight:!1,width:"90%"}),this._fireEvent("postcollapse"))},_activateSplitMode:function(){this._mode!==SPLIT_MODE&&(this._fireEvent("presplit"),this._animator.destroy(),this._secondaryPage.attr("style",""),this._mainPage.attr("style",""),this._mode=SPLIT_MODE,this._setSize(),this._fireEvent("postsplit"))},_destroy:function(){this.emit("destroy"),this._clearDerivingEvents(),this._element=null,this._scope=null}});return MicroEvent.mixin(SplitView),SplitView}])}(),function(){angular.module("onsen").factory("SplitterContent",["$onsen","$compile",function($onsen,$compile){var SplitterContent=Class.extend({init:function(scope,element,attrs){var _this=this;this._element=element,this._scope=scope,this._attrs=attrs,this.load=function(){var _element$;return _this._pageScope&&_this._pageScope.$destroy(),(_element$=_this._element[0]).load.apply(_element$,arguments)},scope.$on("$destroy",this._destroy.bind(this))},_link:function(fragment,done){this._pageScope=this._scope.$new(),$compile(fragment)(this._pageScope),this._pageScope.$evalAsync(function(){return done(fragment)})},_destroy:function(){this.emit("destroy"),this._element=this._scope=this._attrs=this.load=this._pageScope=null}});return MicroEvent.mixin(SplitterContent),$onsen.derivePropertiesFromElement(SplitterContent,["page"]),SplitterContent}])}(),function(){angular.module("onsen").factory("SplitterSide",["$onsen","$compile",function($onsen,$compile){var SplitterSide=Class.extend({init:function(scope,element,attrs){var _this=this;this._element=element,this._scope=scope,this._attrs=attrs,this._clearDerivingMethods=$onsen.deriveMethods(this,this._element[0],["open","close","toggle"]),this.load=function(){var _element$;return _this._pageScope&&_this._pageScope.$destroy(),(_element$=_this._element[0]).load.apply(_element$,arguments)},this._clearDerivingEvents=$onsen.deriveEvents(this,element[0],["modechange","preopen","preclose","postopen","postclose"],function(detail){return detail.side?angular.extend(detail,{side:_this}):detail}),scope.$on("$destroy",this._destroy.bind(this))},_link:function(fragment,done){var link=$compile(fragment);this._pageScope=this._scope.$new(),link(this._pageScope),this._pageScope.$evalAsync(function(){return done(fragment)})},_destroy:function(){this.emit("destroy"),this._clearDerivingMethods(),this._clearDerivingEvents(),this._element=this._scope=this._attrs=this.load=this._pageScope=null}});return MicroEvent.mixin(SplitterSide),$onsen.derivePropertiesFromElement(SplitterSide,["page","mode","isOpen"]),SplitterSide}])}(),function(){angular.module("onsen").factory("Splitter",["$onsen",function($onsen){var Splitter=Class.extend({init:function(scope,element,attrs){this._element=element,this._scope=scope,this._attrs=attrs,scope.$on("$destroy",this._destroy.bind(this))},_destroy:function(){this.emit("destroy"),this._element=this._scope=this._attrs=null}});return MicroEvent.mixin(Splitter),$onsen.derivePropertiesFromElement(Splitter,["onDeviceBackButton"]),["left","right","content","mask"].forEach(function(prop,i){Object.defineProperty(Splitter.prototype,prop,{get:function(){var tagName="ons-splitter-"+(i<2?"side":prop);return angular.element(this._element[0][prop]).data(tagName)}})}),Splitter}])}(),function(){angular.module("onsen").factory("SwitchView",["$parse","$onsen",function($parse,$onsen){var SwitchView=Class.extend({init:function(element,scope,attrs){var _this=this;this._element=element,this._checkbox=angular.element(element[0].querySelector("input[type=checkbox]")),this._scope=scope,this._prepareNgModel(element,scope,attrs),this._scope.$on("$destroy",function(){_this.emit("destroy"),_this._element=_this._checkbox=_this._scope=null})},_prepareNgModel:function(element,scope,attrs){var _this2=this;if(attrs.ngModel){var set=$parse(attrs.ngModel).assign;scope.$parent.$watch(attrs.ngModel,function(value){_this2.checked=!!value}),this._element.on("change",function(e){set(scope.$parent,_this2.checked),attrs.ngChange&&scope.$eval(attrs.ngChange),scope.$parent.$evalAsync()})}}});return MicroEvent.mixin(SwitchView),$onsen.derivePropertiesFromElement(SwitchView,["disabled","checked","checkbox"]),SwitchView}])}(),function(){var module=angular.module("onsen");module.value("TabbarNoneAnimator",ons._internal.TabbarNoneAnimator),module.value("TabbarFadeAnimator",ons._internal.TabbarFadeAnimator),module.value("TabbarSlideAnimator",ons._internal.TabbarSlideAnimator),module.factory("TabbarView",["$onsen","$compile","$parse",function($onsen,$compile,$parse){var TabbarView=Class.extend({init:function(scope,element,attrs){if("ons-tabbar"!==element[0].nodeName.toLowerCase())throw new Error('"element" parameter must be a "ons-tabbar" element.');this._scope=scope,this._element=element,this._attrs=attrs,this._lastPageElement=null,this._lastPageScope=null,this._scope.$on("$destroy",this._destroy.bind(this)),this._clearDerivingEvents=$onsen.deriveEvents(this,element[0],["reactive","postchange","prechange","init","show","hide","destroy"]),this._clearDerivingMethods=$onsen.deriveMethods(this,element[0],["setActiveTab","setTabbarVisibility","getActiveTabIndex","loadPage"])},_compileAndLink:function(pageElement,callback){var link=$compile(pageElement),pageScope=this._scope.$new();link(pageScope),pageScope.$evalAsync(function(){callback(pageElement)})},_destroy:function(){this.emit("destroy"),this._clearDerivingEvents(),this._clearDerivingMethods(),this._element=this._scope=this._attrs=null}});return MicroEvent.mixin(TabbarView),TabbarView.registerAnimator=function(name,Animator){return window.ons.TabbarElement.registerAnimator(name,Animator)},TabbarView}])}(),function(){angular.module("onsen").directive("onsAlertDialog",["$onsen","AlertDialogView",function($onsen,AlertDialogView){return{restrict:"E",replace:!1,scope:!0,transclude:!1,compile:function(element,attrs){return{pre:function(scope,element,attrs){var alertDialog=new AlertDialogView(scope,element,attrs);$onsen.declareVarAttribute(attrs,alertDialog),$onsen.registerEventHandlers(alertDialog,"preshow prehide postshow posthide destroy"),$onsen.addModifierMethodsForCustomElements(alertDialog,element),element.data("ons-alert-dialog",alertDialog),element.data("_scope",scope),scope.$on("$destroy",function(){alertDialog._events=void 0,$onsen.removeModifierMethods(alertDialog),element.data("ons-alert-dialog",void 0),element=null})},post:function(scope,element){$onsen.fireComponentEvent(element[0],"init")}}}}}])}(),function(){var module=angular.module("onsen");module.directive("onsBackButton",["$onsen","$compile","GenericView","ComponentCleaner",function($onsen,$compile,GenericView,ComponentCleaner){return{restrict:"E",replace:!1,compile:function(element,attrs){return{pre:function(scope,element,attrs,controller,transclude){var backButton=GenericView.register(scope,element,attrs,{viewKey:"ons-back-button"});scope.$on("$destroy",function(){backButton._events=void 0,$onsen.removeModifierMethods(backButton),element=null}),ComponentCleaner.onDestroy(scope,function(){ComponentCleaner.destroyScope(scope),ComponentCleaner.destroyAttributes(attrs),element=scope=attrs=null})},post:function(scope,element){$onsen.fireComponentEvent(element[0],"init")}}}}}])}(),function(){angular.module("onsen").directive("onsBottomToolbar",["$onsen","GenericView",function($onsen,GenericView){return{restrict:"E",link:{pre:function(scope,element,attrs){GenericView.register(scope,element,attrs,{viewKey:"ons-bottomToolbar"})},post:function(scope,element,attrs){$onsen.fireComponentEvent(element[0],"init")}}}}])}(),function(){angular.module("onsen").directive("onsButton",["$onsen","GenericView",function($onsen,GenericView){return{restrict:"E",link:function(scope,element,attrs){var button=GenericView.register(scope,element,attrs,{viewKey:"ons-button"});Object.defineProperty(button,"disabled",{get:function(){return this._element[0].disabled},set:function(value){return this._element[0].disabled=value}}),$onsen.fireComponentEvent(element[0],"init")}}}])}(),function(){var module=angular.module("onsen");module.directive("onsCarousel",["$onsen","CarouselView",function($onsen,CarouselView){return{restrict:"E",replace:!1,scope:!1,transclude:!1,compile:function(element,attrs){return function(scope,element,attrs){var carousel=new CarouselView(scope,element,attrs);element.data("ons-carousel",carousel),$onsen.registerEventHandlers(carousel,"postchange refresh overscroll destroy"),$onsen.declareVarAttribute(attrs,carousel),scope.$on("$destroy",function(){carousel._events=void 0,element.data("ons-carousel",void 0),element=null}),$onsen.fireComponentEvent(element[0],"init")}}}}]),module.directive("onsCarouselItem",function(){return{restrict:"E",compile:function(element,attrs){return function(scope,element,attrs){scope.$last&&(element[0].parentElement._setup(),element[0].parentElement._setupInitialIndex(),element[0].parentElement._saveLastState())}}}})}(),function(){angular.module("onsen").directive("onsDialog",["$onsen","DialogView",function($onsen,DialogView){return{restrict:"E",scope:!0,compile:function(element,attrs){return{pre:function(scope,element,attrs){var dialog=new DialogView(scope,element,attrs);$onsen.declareVarAttribute(attrs,dialog),$onsen.registerEventHandlers(dialog,"preshow prehide postshow posthide destroy"),$onsen.addModifierMethodsForCustomElements(dialog,element),element.data("ons-dialog",dialog),scope.$on("$destroy",function(){dialog._events=void 0,$onsen.removeModifierMethods(dialog),element.data("ons-dialog",void 0),element=null})},post:function(scope,element){$onsen.fireComponentEvent(element[0],"init")}}}}}])}(),function(){var module=angular.module("onsen");module.directive("onsDummyForInit",["$rootScope",function($rootScope){var isReady=!1;return{restrict:"E",replace:!1,link:{post:function(scope,element){isReady||(isReady=!0,$rootScope.$broadcast("$ons-ready")),element.remove()}}}}])}(),function(){var module=angular.module("onsen");module.directive("onsFab",["$onsen","FabView",function($onsen,FabView){return{restrict:"E",replace:!1,scope:!1,transclude:!1,compile:function(element,attrs){return function(scope,element,attrs){var fab=new FabView(scope,element,attrs);element.data("ons-fab",fab),$onsen.declareVarAttribute(attrs,fab),scope.$on("$destroy",function(){element.data("ons-fab",void 0),element=null}),$onsen.fireComponentEvent(element[0],"init")}}}}])}(),function(){var EVENTS="drag dragleft dragright dragup dragdown hold release swipe swipeleft swiperight swipeup swipedown tap doubletap touch transform pinch pinchin pinchout rotate".split(/ +/);angular.module("onsen").directive("onsGestureDetector",["$onsen",function($onsen){function titlize(str){
|
4 | return str.charAt(0).toUpperCase()+str.slice(1)}var scopeDef=EVENTS.reduce(function(dict,name){return dict["ng"+titlize(name)]="&",dict},{});return{restrict:"E",scope:scopeDef,replace:!1,transclude:!0,compile:function(element,attrs){return function(scope,element,attrs,_,transclude){transclude(scope.$parent,function(cloned){element.append(cloned)});var gestureDetector,handler=function(event){var attr="ng"+titlize(event.type);attr in scopeDef&&scope[attr]({$event:event})};setImmediate(function(){gestureDetector=element[0]._gestureDetector,gestureDetector.on(EVENTS.join(" "),handler)}),$onsen.cleaner.onDestroy(scope,function(){gestureDetector.off(EVENTS.join(" "),handler),$onsen.clearComponent({scope:scope,element:element,attrs:attrs}),gestureDetector.element=scope=element=attrs=null}),$onsen.fireComponentEvent(element[0],"init")}}}}])}(),function(){angular.module("onsen").directive("onsIcon",["$onsen","GenericView",function($onsen,GenericView){return{restrict:"E",compile:function(element,attrs){return attrs.icon.indexOf("{{")!==-1&&attrs.$observe("icon",function(){setImmediate(function(){return element[0]._update()})}),function(scope,element,attrs){GenericView.register(scope,element,attrs,{viewKey:"ons-icon"})}}}}])}(),function(){var module=angular.module("onsen");module.directive("onsIfOrientation",["$onsen","$onsGlobal",function($onsen,$onsGlobal){return{restrict:"A",replace:!1,transclude:!1,scope:!1,compile:function(element){return element.css("display","none"),function(scope,element,attrs){function update(){var userOrientation=(""+attrs.onsIfOrientation).toLowerCase(),orientation=getLandscapeOrPortrait();"portrait"!==userOrientation&&"landscape"!==userOrientation||(userOrientation===orientation?element.css("display",""):element.css("display","none"))}function getLandscapeOrPortrait(){return $onsGlobal.orientation.isPortrait()?"portrait":"landscape"}attrs.$observe("onsIfOrientation",update),$onsGlobal.orientation.on("change",update),update(),$onsen.cleaner.onDestroy(scope,function(){$onsGlobal.orientation.off("change",update),$onsen.clearComponent({element:element,scope:scope,attrs:attrs}),element=scope=attrs=null})}}}}])}(),function(){var module=angular.module("onsen");module.directive("onsIfPlatform",["$onsen",function($onsen){return{restrict:"A",replace:!1,transclude:!1,scope:!1,compile:function(element){function getPlatformString(){if(navigator.userAgent.match(/Android/i))return"android";if(navigator.userAgent.match(/BlackBerry/i)||navigator.userAgent.match(/RIM Tablet OS/i)||navigator.userAgent.match(/BB10/i))return"blackberry";if(navigator.userAgent.match(/iPhone|iPad|iPod/i))return"ios";if(navigator.userAgent.match(/Windows Phone|IEMobile|WPDesktop/i))return"wp";var isOpera=!!window.opera||navigator.userAgent.indexOf(" OPR/")>=0;if(isOpera)return"opera";var isFirefox="undefined"!=typeof InstallTrigger;if(isFirefox)return"firefox";var isSafari=Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>0;if(isSafari)return"safari";var isEdge=navigator.userAgent.indexOf(" Edge/")>=0;if(isEdge)return"edge";var isChrome=!!window.chrome&&!isOpera&&!isEdge;if(isChrome)return"chrome";var isIE=!!document.documentMode;return isIE?"ie":"unknown"}element.css("display","none");var platform=getPlatformString();return function(scope,element,attrs){function update(){var userPlatforms=attrs.onsIfPlatform.toLowerCase().trim().split(/\s+/);userPlatforms.indexOf(platform.toLowerCase())>=0?element.css("display","block"):element.css("display","none")}attrs.$observe("onsIfPlatform",function(userPlatform){userPlatform&&update()}),update(),$onsen.cleaner.onDestroy(scope,function(){$onsen.clearComponent({element:element,scope:scope,attrs:attrs}),element=scope=attrs=null})}}}}])}(),function(){angular.module("onsen").directive("onsInput",["$parse",function($parse){return{restrict:"E",replace:!1,scope:!1,link:function(scope,element,attrs){var el=element[0],onInput=function(){var set=$parse(attrs.ngModel).assign;el._isTextInput?set(scope,el.value):"radio"===el.type&&el.checked?set(scope,el.value):set(scope,el.checked),attrs.ngChange&&scope.$eval(attrs.ngChange),scope.$parent.$evalAsync()};attrs.ngModel&&(scope.$watch(attrs.ngModel,function(value){el._isTextInput&&"undefined"!=typeof value?el.value=value:"radio"===el.type?el.checked=value===el.value:el.checked=value}),el._isTextInput?element.on("input",onInput):element.on("change",onInput)),scope.$on("$destroy",function(){el._isTextInput?element.off("input",onInput):element.off("change",onInput),scope=element=attrs=el=null})}}}])}(),function(){var module=angular.module("onsen"),compileFunction=function(show,$onsen){return function(element){return function(scope,element,attrs){var dispShow=show?"block":"none",dispHide=show?"none":"block",onShow=function(){element.css("display",dispShow)},onHide=function(){element.css("display",dispHide)},onInit=function(e){e.visible?onShow():onHide()};ons.softwareKeyboard.on("show",onShow),ons.softwareKeyboard.on("hide",onHide),ons.softwareKeyboard.on("init",onInit),ons.softwareKeyboard._visible?onShow():onHide(),$onsen.cleaner.onDestroy(scope,function(){ons.softwareKeyboard.off("show",onShow),ons.softwareKeyboard.off("hide",onHide),ons.softwareKeyboard.off("init",onInit),$onsen.clearComponent({element:element,scope:scope,attrs:attrs}),element=scope=attrs=null})}}};module.directive("onsKeyboardActive",["$onsen",function($onsen){return{restrict:"A",replace:!1,transclude:!1,scope:!1,compile:compileFunction(!0,$onsen)}}]),module.directive("onsKeyboardInactive",["$onsen",function($onsen){return{restrict:"A",replace:!1,transclude:!1,scope:!1,compile:compileFunction(!1,$onsen)}}])}(),function(){var module=angular.module("onsen");module.directive("onsLazyRepeat",["$onsen","LazyRepeatView",function($onsen,LazyRepeatView){return{restrict:"A",replace:!1,priority:1e3,terminal:!0,compile:function(element,attrs){return function(scope,element,attrs){var lazyRepeat=new LazyRepeatView(scope,element,attrs);scope.$on("$destroy",function(){scope=element=attrs=lazyRepeat=null})}}}}])}(),function(){angular.module("onsen").directive("onsList",["$onsen","GenericView",function($onsen,GenericView){return{restrict:"E",link:function(scope,element,attrs){GenericView.register(scope,element,attrs,{viewKey:"ons-list"}),$onsen.fireComponentEvent(element[0],"init")}}}])}(),function(){angular.module("onsen").directive("onsListHeader",["$onsen","GenericView",function($onsen,GenericView){return{restrict:"E",link:function(scope,element,attrs){GenericView.register(scope,element,attrs,{viewKey:"ons-listHeader"}),$onsen.fireComponentEvent(element[0],"init")}}}])}(),function(){angular.module("onsen").directive("onsListItem",["$onsen","GenericView",function($onsen,GenericView){return{restrict:"E",link:function(scope,element,attrs){GenericView.register(scope,element,attrs,{viewKey:"ons-list-item"}),$onsen.fireComponentEvent(element[0],"init")}}}])}(),function(){angular.module("onsen").directive("onsLoadingPlaceholder",function(){return{restrict:"A",link:function(scope,element,attrs){attrs.onsLoadingPlaceholder&&ons._resolveLoadingPlaceholder(element[0],attrs.onsLoadingPlaceholder,function(contentElement,done){ons.compile(contentElement),scope.$evalAsync(function(){setImmediate(done)})})}}})}(),function(){angular.module("onsen").directive("onsModal",["$onsen","ModalView",function($onsen,ModalView){return{restrict:"E",replace:!1,scope:!1,transclude:!1,compile:function(element,attrs){return{pre:function(scope,element,attrs){var modal=new ModalView(scope,element,attrs);$onsen.addModifierMethodsForCustomElements(modal,element),$onsen.declareVarAttribute(attrs,modal),element.data("ons-modal",modal),scope.$on("$destroy",function(){$onsen.removeModifierMethods(modal),element.data("ons-modal",void 0),modal=element=scope=attrs=null})},post:function(scope,element){$onsen.fireComponentEvent(element[0],"init")}}}}}])}(),function(){var lastReady=window.ons.NavigatorElement.rewritables.ready;window.ons.NavigatorElement.rewritables.ready=ons._waitDiretiveInit("ons-navigator",lastReady);var lastLink=window.ons.NavigatorElement.rewritables.link;window.ons.NavigatorElement.rewritables.link=function(navigatorElement,target,options,callback){var view=angular.element(navigatorElement).data("ons-navigator");view._compileAndLink(target,function(target){lastLink(navigatorElement,target,options,callback)})},angular.module("onsen").directive("onsNavigator",["NavigatorView","$onsen",function(NavigatorView,$onsen){return{restrict:"E",transclude:!1,scope:!0,compile:function(element){return{pre:function(scope,element,attrs,controller){var navigator=new NavigatorView(scope,element,attrs);$onsen.declareVarAttribute(attrs,navigator),$onsen.registerEventHandlers(navigator,"prepush prepop postpush postpop init show hide destroy"),element.data("ons-navigator",navigator),scope.$on("$destroy",function(){navigator._events=void 0,element.data("ons-navigator",void 0),element=null})},post:function(scope,element,attrs){$onsen.fireComponentEvent(element[0],"init")}}}}}])}(),function(){var module=angular.module("onsen");module.directive("onsPage",["$onsen","PageView",function($onsen,PageView){function firePageInitEvent(element){var i=0,f=function f(){if(!(i++<15))throw new Error('Fail to fire "pageinit" event. Attach "ons-page" element to the document after initialization.');isAttached(element)?($onsen.fireComponentEvent(element,"init"),fireActualPageInitEvent(element)):i>10?setTimeout(f,1e3/60):setImmediate(f)};f()}function fireActualPageInitEvent(element){var event=document.createEvent("HTMLEvents");event.initEvent("pageinit",!0,!0),element.dispatchEvent(event)}function isAttached(element){return document.documentElement===element||!!element.parentNode&&isAttached(element.parentNode)}return{restrict:"E",transclude:!1,scope:!0,compile:function(element,attrs){return{pre:function(scope,element,attrs){var page=new PageView(scope,element,attrs);$onsen.declareVarAttribute(attrs,page),$onsen.registerEventHandlers(page,"init show hide destroy"),element.data("ons-page",page),$onsen.addModifierMethodsForCustomElements(page,element),element.data("_scope",scope),$onsen.cleaner.onDestroy(scope,function(){page._events=void 0,$onsen.removeModifierMethods(page),element.data("ons-page",void 0),element.data("_scope",void 0),$onsen.clearComponent({element:element,scope:scope,attrs:attrs}),scope=element=attrs=null})},post:function(scope,element,attrs){firePageInitEvent(element[0])}}}}}])}(),function(){var module=angular.module("onsen");module.directive("onsPopover",["$onsen","PopoverView",function($onsen,PopoverView){return{restrict:"E",replace:!1,scope:!0,compile:function(element,attrs){return{pre:function(scope,element,attrs){var popover=new PopoverView(scope,element,attrs);$onsen.declareVarAttribute(attrs,popover),$onsen.registerEventHandlers(popover,"preshow prehide postshow posthide destroy"),$onsen.addModifierMethodsForCustomElements(popover,element),element.data("ons-popover",popover),scope.$on("$destroy",function(){popover._events=void 0,$onsen.removeModifierMethods(popover),element.data("ons-popover",void 0),element=null})},post:function(scope,element){$onsen.fireComponentEvent(element[0],"init")}}}}}])}(),function(){angular.module("onsen").directive("onsPullHook",["$onsen","PullHookView",function($onsen,PullHookView){return{restrict:"E",replace:!1,scope:!0,compile:function(element,attrs){return{pre:function(scope,element,attrs){var pullHook=new PullHookView(scope,element,attrs);$onsen.declareVarAttribute(attrs,pullHook),$onsen.registerEventHandlers(pullHook,"changestate destroy"),element.data("ons-pull-hook",pullHook),scope.$on("$destroy",function(){pullHook._events=void 0,element.data("ons-pull-hook",void 0),scope=element=attrs=null})},post:function(scope,element){$onsen.fireComponentEvent(element[0],"init")}}}}}])}(),function(){angular.module("onsen").directive("onsRange",["$parse",function($parse){return{restrict:"E",replace:!1,scope:!1,link:function(scope,element,attrs){var onInput=function(){var set=$parse(attrs.ngModel).assign;set(scope,element[0].value),attrs.ngChange&&scope.$eval(attrs.ngChange),scope.$parent.$evalAsync()};attrs.ngModel&&(scope.$watch(attrs.ngModel,function(value){element[0].value=value}),element.on("input",onInput)),scope.$on("$destroy",function(){element.off("input",onInput),scope=element=attrs=null})}}}])}(),function(){angular.module("onsen").directive("onsRipple",["$onsen","GenericView",function($onsen,GenericView){return{restrict:"E",link:function(scope,element,attrs){GenericView.register(scope,element,attrs,{viewKey:"ons-ripple"}),$onsen.fireComponentEvent(element[0],"init")}}}])}(),function(){var module=angular.module("onsen");module.directive("onsScope",["$onsen",function($onsen){return{restrict:"A",replace:!1,transclude:!1,scope:!1,link:function(scope,element){element.data("_scope",scope),scope.$on("$destroy",function(){element.data("_scope",void 0)})}}}])}(),function(){var module=angular.module("onsen");module.directive("onsSlidingMenu",["$compile","SlidingMenuView","$onsen",function($compile,SlidingMenuView,$onsen){return{restrict:"E",replace:!1,transclude:!1,scope:!0,compile:function(element,attrs){var main=element[0].querySelector(".main"),menu=element[0].querySelector(".menu");if(main)var mainHtml=angular.element(main).remove().html().trim();if(menu)var menuHtml=angular.element(menu).remove().html().trim();return function(scope,element,attrs){element.append(angular.element("<div></div>").addClass("onsen-sliding-menu__menu")),element.append(angular.element("<div></div>").addClass("onsen-sliding-menu__main"));var slidingMenu=new SlidingMenuView(scope,element,attrs);$onsen.registerEventHandlers(slidingMenu,"preopen preclose postopen postclose init show hide destroy"),mainHtml&&!attrs.mainPage&&slidingMenu._appendMainPage(null,mainHtml),menuHtml&&!attrs.menuPage&&slidingMenu._appendMenuPage(menuHtml),$onsen.declareVarAttribute(attrs,slidingMenu),element.data("ons-sliding-menu",slidingMenu),scope.$on("$destroy",function(){slidingMenu._events=void 0,element.data("ons-sliding-menu",void 0)}),$onsen.fireComponentEvent(element[0],"init")}}}}])}(),function(){var module=angular.module("onsen");module.directive("onsSpeedDial",["$onsen","SpeedDialView",function($onsen,SpeedDialView){return{restrict:"E",replace:!1,scope:!1,transclude:!1,compile:function(element,attrs){return function(scope,element,attrs){var speedDial=new SpeedDialView(scope,element,attrs);element.data("ons-speed-dial",speedDial),$onsen.registerEventHandlers(speedDial,"open close"),$onsen.declareVarAttribute(attrs,speedDial),scope.$on("$destroy",function(){speedDial._events=void 0,element.data("ons-speed-dial",void 0),element=null}),$onsen.fireComponentEvent(element[0],"init")}}}}])}(),function(){var module=angular.module("onsen");module.directive("onsSplitView",["$compile","SplitView","$onsen",function($compile,SplitView,$onsen){return{restrict:"E",replace:!1,transclude:!1,scope:!0,compile:function(element,attrs){var mainPage=element[0].querySelector(".main-page"),secondaryPage=element[0].querySelector(".secondary-page");if(mainPage)var mainHtml=angular.element(mainPage).remove().html().trim();if(secondaryPage)var secondaryHtml=angular.element(secondaryPage).remove().html().trim();return function(scope,element,attrs){element.append(angular.element("<div></div>").addClass("onsen-split-view__secondary full-screen")),element.append(angular.element("<div></div>").addClass("onsen-split-view__main full-screen"));var splitView=new SplitView(scope,element,attrs);mainHtml&&!attrs.mainPage&&splitView._appendMainPage(mainHtml),secondaryHtml&&!attrs.secondaryPage&&splitView._appendSecondPage(secondaryHtml),$onsen.declareVarAttribute(attrs,splitView),$onsen.registerEventHandlers(splitView,"update presplit precollapse postsplit postcollapse init show hide destroy"),element.data("ons-split-view",splitView),scope.$on("$destroy",function(){splitView._events=void 0,element.data("ons-split-view",void 0)}),$onsen.fireComponentEvent(element[0],"init")}}}}])}(),function(){angular.module("onsen").directive("onsSplitter",["$compile","Splitter","$onsen",function($compile,Splitter,$onsen){return{restrict:"E",scope:!0,compile:function(element,attrs){return function(scope,element,attrs){var splitter=new Splitter(scope,element,attrs);$onsen.declareVarAttribute(attrs,splitter),$onsen.registerEventHandlers(splitter,"destroy"),element.data("ons-splitter",splitter),scope.$on("$destroy",function(){splitter._events=void 0,element.data("ons-splitter",void 0)}),$onsen.fireComponentEvent(element[0],"init")}}}}])}(),function(){var lastReady=window.ons.SplitterContentElement.rewritables.ready;window.ons.SplitterContentElement.rewritables.ready=ons._waitDiretiveInit("ons-splitter-content",lastReady);var lastLink=window.ons.SplitterContentElement.rewritables.link;window.ons.SplitterContentElement.rewritables.link=function(element,target,options,callback){var view=angular.element(element).data("ons-splitter-content");lastLink(element,target,options,function(target){view._link(target,callback)})},angular.module("onsen").directive("onsSplitterContent",["$compile","SplitterContent","$onsen",function($compile,SplitterContent,$onsen){return{restrict:"E",compile:function(element,attrs){return function(scope,element,attrs){var view=new SplitterContent(scope,element,attrs);$onsen.declareVarAttribute(attrs,view),$onsen.registerEventHandlers(view,"destroy"),element.data("ons-splitter-content",view),scope.$on("$destroy",function(){view._events=void 0,element.data("ons-splitter-content",void 0)}),$onsen.fireComponentEvent(element[0],"init")}}}}])}(),function(){var lastReady=window.ons.SplitterSideElement.rewritables.ready;window.ons.SplitterSideElement.rewritables.ready=ons._waitDiretiveInit("ons-splitter-side",lastReady);var lastLink=window.ons.SplitterSideElement.rewritables.link;window.ons.SplitterSideElement.rewritables.link=function(element,target,options,callback){var view=angular.element(element).data("ons-splitter-side");lastLink(element,target,options,function(target){view._link(target,callback)})},angular.module("onsen").directive("onsSplitterSide",["$compile","SplitterSide","$onsen",function($compile,SplitterSide,$onsen){return{restrict:"E",compile:function(element,attrs){return function(scope,element,attrs){var view=new SplitterSide(scope,element,attrs);$onsen.declareVarAttribute(attrs,view),$onsen.registerEventHandlers(view,"destroy"),element.data("ons-splitter-side",view),scope.$on("$destroy",function(){view._events=void 0,element.data("ons-splitter-side",void 0)}),$onsen.fireComponentEvent(element[0],"init")}}}}])}(),function(){angular.module("onsen").directive("onsSwitch",["$onsen","SwitchView",function($onsen,SwitchView){return{restrict:"E",replace:!1,scope:!0,link:function(scope,element,attrs){if(attrs.ngController)throw new Error("This element can't accept ng-controller directive.");var switchView=new SwitchView(element,scope,attrs);$onsen.addModifierMethodsForCustomElements(switchView,element),$onsen.declareVarAttribute(attrs,switchView),element.data("ons-switch",switchView),$onsen.cleaner.onDestroy(scope,function(){switchView._events=void 0,$onsen.removeModifierMethods(switchView),element.data("ons-switch",void 0),$onsen.clearComponent({element:element,scope:scope,attrs:attrs}),element=attrs=scope=null}),$onsen.fireComponentEvent(element[0],"init")}}}])}(),function(){function tab($onsen){return{restrict:"E",link:function(scope,element,attrs){$onsen.fireComponentEvent(element[0],"init")}}}tab.$inject=["$onsen"],angular.module("onsen").directive("onsTab",tab).directive("onsTabbarItem",tab)}(),function(){var lastReady=window.ons.TabbarElement.rewritables.ready;window.ons.TabbarElement.rewritables.ready=ons._waitDiretiveInit("ons-tabbar",lastReady);var lastLink=window.ons.TabbarElement.rewritables.link;window.ons.TabbarElement.rewritables.link=function(tabbarElement,target,options,callback){var view=angular.element(tabbarElement).data("ons-tabbar");view._compileAndLink(target,function(target){lastLink(tabbarElement,target,options,callback)})};var lastUnlink=window.ons.TabbarElement.rewritables.unlink;window.ons.TabbarElement.rewritables.unlink=function(tabbarElement,target,callback){angular.element(target).data("_scope").$destroy(),lastUnlink(tabbarElement,target,callback)},angular.module("onsen").directive("onsTabbar",["$onsen","$compile","$parse","TabbarView",function($onsen,$compile,$parse,TabbarView){return{restrict:"E",replace:!1,scope:!0,link:function(scope,element,attrs,controller){scope.$watch(attrs.hideTabs,function(hide){"string"==typeof hide&&(hide="true"===hide),element[0].setTabbarVisibility(!hide)});var tabbarView=new TabbarView(scope,element,attrs);$onsen.addModifierMethodsForCustomElements(tabbarView,element),$onsen.registerEventHandlers(tabbarView,"reactive prechange postchange init show hide destroy"),element.data("ons-tabbar",tabbarView),$onsen.declareVarAttribute(attrs,tabbarView),scope.$on("$destroy",function(){tabbarView._events=void 0,$onsen.removeModifierMethods(tabbarView),element.data("ons-tabbar",void 0)}),$onsen.fireComponentEvent(element[0],"init")}}}])}(),function(){angular.module("onsen").directive("onsTemplate",["$templateCache",function($templateCache){return{restrict:"E",terminal:!0,compile:function(element){var content=element[0].template||element.html();$templateCache.put(element.attr("id"),content)}}}])}(),function(){angular.module("onsen").directive("onsToolbar",["$onsen","GenericView",function($onsen,GenericView){return{restrict:"E",scope:!1,transclude:!1,compile:function(element){return{pre:function(scope,element,attrs){"ons-toolbar"===element[0].nodeName&&GenericView.register(scope,element,attrs,{viewKey:"ons-toolbar"})},post:function(scope,element,attrs){$onsen.fireComponentEvent(element[0],"init")}}}}}])}(),function(){var module=angular.module("onsen");module.directive("onsToolbarButton",["$onsen","GenericView",function($onsen,GenericView){return{restrict:"E",scope:!1,link:{pre:function(scope,element,attrs){var toolbarButton=new GenericView(scope,element,attrs);element.data("ons-toolbar-button",toolbarButton),$onsen.declareVarAttribute(attrs,toolbarButton),$onsen.addModifierMethodsForCustomElements(toolbarButton,element),$onsen.cleaner.onDestroy(scope,function(){toolbarButton._events=void 0,$onsen.removeModifierMethods(toolbarButton),element.data("ons-toolbar-button",void 0),element=null,$onsen.clearComponent({scope:scope,attrs:attrs,element:element}),scope=element=attrs=null})},post:function(scope,element,attrs){$onsen.fireComponentEvent(element[0],"init")}}}}])}(),function(){var module=angular.module("onsen"),ComponentCleaner={decomposeNode:function(element){for(var children=element.remove().children(),i=0;i<children.length;i++)ComponentCleaner.decomposeNode(angular.element(children[i]))},destroyAttributes:function(attrs){attrs.$$element=null,attrs.$$observers=null},destroyElement:function(element){element.remove()},destroyScope:function(scope){scope.$$listeners={},scope.$$watchers=null,scope=null},onDestroy:function(scope,fn){var clear=scope.$on("$destroy",function(){clear(),fn.apply(null,arguments)})}};module.factory("ComponentCleaner",function(){return ComponentCleaner}),function(){var ngEventDirectives={};"click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" ").forEach(function(name){function directiveNormalize(name){return name.replace(/-([a-z])/g,function(matches){return matches[1].toUpperCase()})}var directiveName=directiveNormalize("ng-"+name);ngEventDirectives[directiveName]=["$parse",function($parse){return{compile:function($element,attr){var fn=$parse(attr[directiveName]);return function(scope,element,attr){var listener=function(event){scope.$apply(function(){fn(scope,{$event:event})})};element.on(name,listener),ComponentCleaner.onDestroy(scope,function(){element.off(name,listener),element=null,ComponentCleaner.destroyScope(scope),scope=null,ComponentCleaner.destroyAttributes(attr),attr=null})}}}}]}),module.config(["$provide",function($provide){var shift=function($delegate){return $delegate.shift(),$delegate};Object.keys(ngEventDirectives).forEach(function(directiveName){$provide.decorator(directiveName+"Directive",["$delegate",shift])})}]),Object.keys(ngEventDirectives).forEach(function(directiveName){module.directive(directiveName,ngEventDirectives[directiveName])})}()}(),function(){var module=angular.module("onsen");module.factory("$onsen",["$rootScope","$window","$cacheFactory","$document","$templateCache","$http","$q","$onsGlobal","ComponentCleaner",function($rootScope,$window,$cacheFactory,$document,$templateCache,$http,$q,$onsGlobal,ComponentCleaner){function createOnsenService(){return{DIRECTIVE_TEMPLATE_URL:"templates",cleaner:ComponentCleaner,DeviceBackButtonHandler:$onsGlobal._deviceBackButtonDispatcher,_defaultDeviceBackButtonHandler:$onsGlobal._defaultDeviceBackButtonHandler,getDefaultDeviceBackButtonHandler:function(){return this._defaultDeviceBackButtonHandler},deriveMethods:function(view,element,methodNames){return methodNames.forEach(function(methodName){view[methodName]=function(){return element[methodName].apply(element,arguments)}}),function(){methodNames.forEach(function(methodName){view[methodName]=null}),view=element=null}},derivePropertiesFromElement:function(klass,properties){properties.forEach(function(property){Object.defineProperty(klass.prototype,property,{get:function(){return this._element[0][property]},set:function(value){return this._element[0][property]=value}})})},deriveEvents:function(view,element,eventNames,map){map=map||function(detail){return detail},eventNames=[].concat(eventNames);var listeners=[];return eventNames.forEach(function(eventName){var listener=function(event){view.emit(eventName,map(Object.create(event.detail)))};listeners.push(listener),element.addEventListener(eventName,listener,!1)}),function(){eventNames.forEach(function(eventName,index){element.removeEventListener(eventName,listeners[index],!1)}),view=element=listeners=map=null}},isEnabledAutoStatusBarFill:function(){return!!$onsGlobal._config.autoStatusBarFill},shouldFillStatusBar:$onsGlobal.shouldFillStatusBar,autoStatusBarFill:$onsGlobal.autoStatusBarFill,clearComponent:function(params){params.scope&&ComponentCleaner.destroyScope(params.scope),params.attrs&&ComponentCleaner.destroyAttributes(params.attrs),params.element&&ComponentCleaner.destroyElement(params.element),params.elements&¶ms.elements.forEach(function(element){ComponentCleaner.destroyElement(element)})},findElementeObject:function(element,name){return element.inheritedData(name)},getPageHTMLAsync:function(page){var cache=$templateCache.get(page);if(cache){var deferred=$q.defer(),html="string"==typeof cache?cache:cache[1];return deferred.resolve(this.normalizePageHTML(html)),deferred.promise}return $http({url:page,method:"GET"}).then(function(response){var html=response.data;return this.normalizePageHTML(html)}.bind(this))},normalizePageHTML:function(html){return html=(""+html).trim(),html.match(/^<ons-page/)||(html="<ons-page _muted>"+html+"</ons-page>"),html},generateModifierTemplater:function(attrs,modifiers){var attrModifiers=attrs&&"string"==typeof attrs.modifier?attrs.modifier.trim().split(/ +/):[];return modifiers=angular.isArray(modifiers)?attrModifiers.concat(modifiers):attrModifiers,function(template){return modifiers.map(function(modifier){return template.replace("*",modifier)}).join(" ")}},addModifierMethodsForCustomElements:function(view,element){var methods={hasModifier:function(needle){var tokens=ModifierUtil.split(element.attr("modifier"));return needle="string"==typeof needle?needle.trim():"",ModifierUtil.split(needle).some(function(needle){return tokens.indexOf(needle)!=-1})},removeModifier:function(needle){needle="string"==typeof needle?needle.trim():"";var modifier=ModifierUtil.split(element.attr("modifier")).filter(function(token){return token!==needle}).join(" ");element.attr("modifier",modifier)},addModifier:function(modifier){element.attr("modifier",element.attr("modifier")+" "+modifier)},setModifier:function(modifier){element.attr("modifier",modifier)},toggleModifier:function(modifier){this.hasModifier(modifier)?this.removeModifier(modifier):this.addModifier(modifier)}};for(var method in methods)methods.hasOwnProperty(method)&&(view[method]=methods[method])},addModifierMethods:function(view,template,element){var _tr=function(modifier){return template.replace("*",modifier)},fns={hasModifier:function(modifier){return element.hasClass(_tr(modifier))},removeModifier:function(modifier){element.removeClass(_tr(modifier))},addModifier:function(modifier){element.addClass(_tr(modifier))},setModifier:function(modifier){for(var classes=element.attr("class").split(/\s+/),patt=template.replace("*","."),i=0;i<classes.length;i++){var cls=classes[i];cls.match(patt)&&element.removeClass(cls)}element.addClass(_tr(modifier))},toggleModifier:function(modifier){var cls=_tr(modifier);element.hasClass(cls)?element.removeClass(cls):element.addClass(cls)}},append=function(oldFn,newFn){return"undefined"!=typeof oldFn?function(){return oldFn.apply(null,arguments)||newFn.apply(null,arguments)}:newFn};view.hasModifier=append(view.hasModifier,fns.hasModifier),view.removeModifier=append(view.removeModifier,fns.removeModifier),view.addModifier=append(view.addModifier,fns.addModifier),view.setModifier=append(view.setModifier,fns.setModifier),view.toggleModifier=append(view.toggleModifier,fns.toggleModifier)},removeModifierMethods:function(view){view.hasModifier=view.removeModifier=view.addModifier=view.setModifier=view.toggleModifier=void 0},declareVarAttribute:function(attrs,object){if("string"==typeof attrs["var"]){var varName=attrs["var"];this._defineVar(varName,object)}},_registerEventHandler:function(component,eventName){var capitalizedEventName=eventName.charAt(0).toUpperCase()+eventName.slice(1);component.on(eventName,function(event){$onsen.fireComponentEvent(component._element[0],eventName,event);var handler=component._attrs["ons"+capitalizedEventName];handler&&(component._scope.$eval(handler,{$event:event}),component._scope.$evalAsync())})},registerEventHandlers:function(component,eventNames){eventNames=eventNames.trim().split(/\s+/);for(var i=0,l=eventNames.length;i<l;i++){var eventName=eventNames[i];this._registerEventHandler(component,eventName)}},isAndroid:function(){return!!window.navigator.userAgent.match(/android/i)},isIOS:function(){return!!window.navigator.userAgent.match(/(ipad|iphone|ipod touch)/i)},isWebView:function(){return window.ons.isWebView()},isIOS7above:function(){var ua=window.navigator.userAgent,match=ua.match(/(iPad|iPhone|iPod touch);.*CPU.*OS (\d+)_(\d+)/i),result=!!match&&parseFloat(match[2]+"."+match[3])>=7;return function(){return result}}(),fireComponentEvent:function(dom,eventName,data){data=data||{};var event=document.createEvent("HTMLEvents");for(var key in data)data.hasOwnProperty(key)&&(event[key]=data[key]);event.component=dom?angular.element(dom).data(dom.nodeName.toLowerCase())||null:null,event.initEvent(dom.nodeName.toLowerCase()+":"+eventName,!0,!0),dom.dispatchEvent(event)},_defineVar:function(name,object){function set(container,names,object){for(var name,i=0;i<names.length-1;i++)name=names[i],void 0!==container[name]&&null!==container[name]||(container[name]={}),container=container[name];if(container[names[names.length-1]]=object,container[names[names.length-1]]!==object)throw new Error('Cannot set var="'+object._attrs["var"]+'" because it will overwrite a read-only variable.')}var names=name.split(/\./);ons.componentBase&&set(ons.componentBase,names,object);for(var element=object._element[0];element.parentNode;){if(element.hasAttribute("ons-scope"))return set(angular.element(element).data("_scope"),names,object),void(element=null);element=element.parentNode}element=null,set($rootScope,names,object)}}}var $onsen=createOnsenService(),ModifierUtil=$onsGlobal._internal.ModifierUtil;return $onsen;
|
5 | }])}(),["alert","confirm","prompt"].forEach(function(name){var originalNotification=ons.notification[name];ons.notification[name]=function(message){var options=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"string"==typeof message?options.message=message:options=message;var compile=options.compile,$element=void 0;return options.compile=function(element){return $element=angular.element(compile?compile(element):element),ons.$compile($element)($element.injector().get("$rootScope"))},options.destroy=function(){$element.data("_scope").$destroy(),$element=null},originalNotification(options)}}),window.jQuery&&angular.element===window.jQuery&&console.warn("Onsen UI require jqLite. Load jQuery after loading AngularJS to fix this error. jQuery may break Onsen UI behavior."),function(){angular.module("onsen").run(["$templateCache",function($templateCache){for(var templates=window.document.querySelectorAll('script[type="text/ons-template"]'),i=0;i<templates.length;i++){var template=angular.element(templates[i]),id=template.attr("id");"string"==typeof id&&$templateCache.put(id,template.text())}}])}(); |
\ | No newline at end of file |