forked from ionic-team/ionic-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathionic-angular.min.js
15 lines (15 loc) · 34.7 KB
/
ionic-angular.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/*!
* Copyright 2013 Drifty Co.
* http://drifty.com/
*
* Ionic, v0.9.14
* A powerful HTML5 mobile app framework.
* http://ionicframework.com/
*
* By @maxlynch, @helloimben, @adamdbradley <3
*
* Licensed under the MIT license. Please see LICENSE for more information.
*
*/
angular.module("ionic.service",["ionic.service.platform","ionic.service.actionSheet","ionic.service.gesture","ionic.service.loading","ionic.service.modal","ionic.service.popup","ionic.service.templateLoad"]),angular.module("ionic.ui",["ionic.ui.content","ionic.ui.scroll","ionic.ui.tabs","ionic.ui.navRouter","ionic.ui.header","ionic.ui.sideMenu","ionic.ui.slideBox","ionic.ui.list","ionic.ui.checkbox","ionic.ui.toggle","ionic.ui.radio"]),angular.module("ionic",["ionic.service","ionic.ui","ngAnimate","ngRoute","ngTouch","ngSanitize"]),angular.module("ionic.service.actionSheet",["ionic.service.templateLoad","ionic.ui.actionSheet","ngAnimate"]).factory("ActionSheet",["$rootScope","$document","$compile","$animate","$timeout","TemplateLoader",function(a,b,c,d){return{show:function(e){var f=a.$new(!0);angular.extend(f,e);var g=c('<action-sheet buttons="buttons"></action-sheet>')(f),h=angular.element(g[0].querySelector(".action-sheet")),i=function(a){d.leave(h,function(){a&&e.cancel()}),d.removeClass(g,"active",function(){f.$destroy()})};f.cancel=function(){i(!0)},f.buttonClicked=function(a){(e.buttonClicked&&e.buttonClicked(a))===!0&&i(!1)},f.destructiveButtonClicked=function(){(e.destructiveButtonClicked&&e.destructiveButtonClicked())===!0&&i(!1)},b[0].body.appendChild(g[0]);var j=new ionic.views.ActionSheet({el:g[0]});return f.sheet=j,d.addClass(g,"active"),d.enter(h,g,null,function(){}),j}}}]),angular.module("ionic.service.gesture",[]).factory("Gesture",[function(){return{on:function(a,b,c){return window.ionic.onGesture(a,b,c[0])},off:function(a,b,c){return window.ionic.offGesture(a,b,c)}}}]),angular.module("ionic.service.loading",["ionic.ui.loading"]).factory("Loading",["$rootScope","$document","$compile",function(a,b,c){return{show:function(d){var e={content:"",animation:"fade-in",showBackdrop:!0,maxWidth:200,showDelay:2e3};d=angular.extend(e,d);var f=a.$new(!0);angular.extend(f,d);var g=angular.element(b[0].querySelector(".loading-backdrop"));if(g.length&&(f=g.scope(),f.loading))return f.loading.show(),f.loading;var h=c("<loading>"+d.content+"</loading>")(f);b[0].body.appendChild(h[0]);var i=new ionic.views.Loading({el:h[0],maxWidth:d.maxWidth,showDelay:d.showDelay});return i.show(),f.loading=i,i}}}]),angular.module("ionic.service.modal",["ionic.service.templateLoad","ngAnimate"]).factory("Modal",["$rootScope","$document","$compile","$animate","$q","TemplateLoader",function(a,b,c,d,e,f){var g=ionic.views.Modal.inherit({initialize:function(a){ionic.views.Modal.prototype.initialize.call(this,a),this.animation=a.animation||"slide-in-up"},show:function(){var a=this,c=angular.element(this.el);c.parent().length||(angular.element(b[0].body).append(c),ionic.views.Modal.prototype.show.call(a)),d.addClass(c,this.animation,function(){})},hide:function(){var a=angular.element(this.el);d.removeClass(a,this.animation),ionic.views.Modal.prototype.hide.call(this)},remove:function(){angular.element(this.el),d.leave(angular.element(this.el),function(){scope.$destroy()})}}),h=function(b,d){var e=d.scope&&d.scope.$new()||a.$new(!0),f=c(b)(e);d.el=f[0];var h=new g(d);return d.scope||(e.modal=h),h};return{fromTemplate:function(a,b){var c=h(a,b||{});return c},fromTemplateUrl:function(a,b,c){f.load(a).then(function(a){var d=h(a,c||{});b(d)})}}}]),function(){"use strict";angular.module("ionic.service.platform",[]).provider("Platform",function(){var a="web",b=!1;(window.cordova||window.PhoneGap||window.phonegap)&&(a="cordova");var c=function(){return"cordova"==a?window.device||window.Cordova:!0};return setTimeout(function d(){c()?ionic.Platform.detect():setTimeout(d,50)},10),{setPlatform:function(b){a=b},$get:["$q","$timeout",function(a,d){return{onHardwareBackButton:function(a){this.ready(function(){document.addEventListener("backbutton",a,!1)})},offHardwareBackButton:function(a){this.ready(function(){document.removeEventListener("backbutton",a)})},ready:function(e){var f=a.defer();return d(function g(){c()?(b=!0,f.resolve(),e()):d(g,50)},50),f.promise}}}]}})}(ionic),angular.module("ionic.service.popup",["ionic.service.templateLoad"]).factory("Popup",["$rootScope","$document","$compile","TemplateLoader",function(a,b,c){var d=function(){var a=angular.element(b[0].querySelector(".popup"));if(a.length){var c=a.scope();if(c.popup)return c}};return{alert:function(e,f){var g=d();if(g)return g.popup.alert(e);var h={title:e,animation:"fade-in"};opts=angular.extend(h,opts);var i=f&&f.$new()||a.$new(!0);angular.extend(i,opts);var j=c("<popup>"+opts.content+"</popup>")(i);b[0].body.appendChild(j[0]);var k=new ionic.views.Popup({el:j[0]});return k.alert(e),i.popup=k,k},confirm:function(){},prompt:function(){},show:function(){}}}]),angular.module("ionic.service.templateLoad",[]).factory("TemplateLoader",["$q","$http","$templateCache",function(a,b,c){return{load:function(d){var e=a.defer();return b({method:"GET",url:d,cache:c}).success(function(a){e.resolve(a&&a.trim())}).error(function(a){e.reject(a)}),e.promise}}}]),function(){"use strict";angular.module("ionic.ui.actionSheet",[]).directive("actionSheet",["$document",function(a){return{restrict:"E",scope:!0,replace:!0,link:function(b,c){var d=function(a){27==a.which&&(b.cancel(),b.$apply())},e=function(a){a.target==c[0]&&(b.cancel(),b.$apply())};b.$on("$destroy",function(){c.remove(),a.unbind("keyup",d)}),a.bind("keyup",d),c.bind("click",e)},template:'<div class="action-sheet-backdrop"><div class="action-sheet action-sheet-up"><div class="action-sheet-group"><div class="action-sheet-title" ng-if="titleText">{{titleText}}</div><button class="button" ng-click="buttonClicked($index)" ng-repeat="button in buttons">{{button.text}}</button></div><div class="action-sheet-group" ng-if="destructiveText"><button class="button destructive" ng-click="destructiveButtonClicked()">{{destructiveText}}</button></div><div class="action-sheet-group" ng-if="cancelText"><button class="button" ng-click="cancel()">{{cancelText}}</button></div></div></div>'}}])}(),function(a){"use strict";angular.module("ionic.ui.header",["ngAnimate"]).directive("headerBar",function(){return{restrict:"E",replace:!0,transclude:!0,template:'<header class="bar bar-header"> <div class="buttons"> <button ng-repeat="button in leftButtons" class="button" ng-class="button.type" ng-click="button.tap($event, $index)" ng-bind-html="button.content"> </button> </div> <h1 class="title" ng-bind-html="title"></h1> <div class="buttons"> <button ng-repeat="button in rightButtons" class="button" ng-class="button.type" ng-click="button.tap($event, $index)" ng-bind-html="button.content"> </button> </div> </header>',scope:{leftButtons:"=",rightButtons:"=",title:"=",type:"@",alignTitle:"@"},link:function(b,c){var d=new a.views.HeaderBar({el:c[0],alignTitle:b.alignTitle||"center"});c.addClass(b.type),b.headerBarView=d,b.$watch("leftButtons",function(){d.align()}),b.$watch("rightButtons",function(){d.align()}),b.$watch("title",function(){d.align()})}}}).directive("footerBar",function(){return{restrict:"E",replace:!0,transclude:!0,template:'<footer class="bar bar-footer" ng-transclude> </footer>',scope:{type:"@"},link:function(a,b){b.addClass(a.type)}}})}(ionic),function(){"use strict";angular.module("ionic.ui.checkbox",[]).directive("checkbox",function(){return{restrict:"E",replace:!0,require:"?ngModel",scope:{},transclude:!0,template:'<li class="item item-checkbox"> <label class="checkbox"> <input type="checkbox"> </label> <div class="item-content" ng-transclude> </div> </li>',link:function(a,b,c,d){var e;d&&(e=angular.element(b[0].querySelector('input[type="checkbox"]')),e.length&&(e.bind("change",function(b){d.$setViewValue(e[0].checked),a.$apply(function(){b.alreadyHandled=!0})}),d&&(d.$render=function(){e[0].checked=d.$viewValue})))}}})}(),function(){"use strict";angular.module("ionic.ui.content",[]).directive("pane",function(){return{restrict:"E",link:function(a,b){b.addClass("pane")}}}).directive("content",["$parse","$timeout",function(a,b){return{restrict:"E",replace:!0,template:'<div class="scroll-content"></div>',transclude:!0,scope:{onRefresh:"&",onRefreshOpening:"&",onScroll:"&",onScrollComplete:"&",refreshComplete:"=",scroll:"@",hasScrollX:"@",hasScrollY:"@",scrollbarX:"@",scrollbarY:"@",scrollEventInterval:"@"},compile:function(a,c,d){return function(a,e){var f,g,h,i=!1,j=e.eq(0);if("true"==c.hasHeader&&j.addClass("has-header"),"true"==c.hasSubheader&&j.addClass("has-subheader"),"true"==c.hasFooter&&j.addClass("has-footer"),"true"==c.hasTabs&&j.addClass("has-tabs"),"false"===a.scroll)f=d(a.$parent),e.append(f);else if("true"===c.overflowScroll)j.addClass("overflow-scroll"),f=d(a.$parent),e.append(f);else{g=document.createElement("div"),g.className="scroll","true"==c.padding&&(g.className+=" padding",i=!0),e.append(g),f=d(a.$parent),angular.element(e[0].firstElementChild).append(f);var k=e[0].querySelector(".scroll-refresher");k&&k.clientHeight||0,c.refreshComplete&&(a.refreshComplete=function(){a.scrollView&&(k&&k.classList.remove("active"),a.scrollView.finishPullToRefresh(),a.$parent.$broadcast("scroll.onRefreshComplete"))}),b(function(){h=new ionic.views.Scroll({el:e[0],scrollbarX:a.$eval(a.scrollbarX)!==!1,scrollbarY:a.$eval(a.scrollbarY)!==!1,scrollingX:1==a.$eval(a.hasScrollX),scrollingY:a.$eval(a.hasScrollY)!==!1,scrollEventInterval:parseInt(a.scrollEventInterval,10)||20,scrollingComplete:function(){a.onScrollComplete({scrollTop:this.__scrollTop,scrollLeft:this.__scrollLeft})}}),k&&h.activatePullToRefresh(50,function(){k.classList.add("active")},function(){k.classList.remove("refreshing"),k.classList.remove("active")},function(){k.classList.add("refreshing"),a.onRefresh(),a.$parent.$broadcast("scroll.onRefresh")}),e.bind("scroll",function(b){a.onScroll({event:b,scrollTop:b.detail?b.detail.scrollTop:b.originalEvent?b.originalEvent.detail.scrollTop:0,scrollLeft:b.detail?b.detail.scrollLeft:b.originalEvent?b.originalEvent.detail.scrollLeft:0})}),a.$parent.$on("scroll.resize",function(){b(function(){h&&h.resize()})}),a.$parent.$on("scroll.refreshComplete",function(){h&&h.finishPullToRefresh()}),a.$parent.scrollView=h})}"true"!=c.padding||i||j.addClass("padding")}}}}]).directive("refresher",function(){return{restrict:"E",replace:!0,require:["^?content","^?list"],template:'<div class="scroll-refresher"><div class="ionic-refresher-content"><i class="icon ion-arrow-down-c icon-pulling"></i><i class="icon ion-loading-d icon-refreshing"></i></div></div>',scope:!0}}).directive("scrollRefresher",function(){return{restrict:"E",replace:!0,transclude:!0,template:'<div class="scroll-refresher"><div class="scroll-refresher-content" ng-transclude></div></div>'}})}(),function(){"use strict";angular.module("ionic.ui.list",["ngAnimate"]).directive("linkItem",["$timeout",function(a){return{restrict:"E",require:["?^list"],replace:!0,transclude:!0,scope:{item:"=",onSelect:"&",onDelete:"&",canDelete:"@",canReorder:"@",canSwipe:"@",buttons:"=",type:"@",href:"@"},template:'<a href="{{href}}" ng-click="onSelect()" class="item"> <div class="item-edit" ng-if="canDelete && isEditing"> <button class="button button-icon icon" ng-class="deleteIcon" ng-click="onDelete()"></button> </div> <div class="item-content slide-left" ng-transclude> </div> <div class="item-drag" ng-if="canReorder && isEditing"> <button data-ionic-action="reorder" class="button button-icon icon" ng-class="reorderIcon"></button> </div> <div class="item-options" ng-if="canSwipe && !isEditing && showOptions"> <button ng-click="buttonClicked(button)" class="button" ng-class="button.type" ng-repeat="button in buttons">{{button.text}}</button> </div> </a>',link:function(b,c,d,e){e[0]?e=e[0]:e[1]&&(e=e[1]),d.$observe("href",function(a){b.href=a}),c.addClass(d.type||"item-complex"),"item-complex"!==d.type&&(b.canSwipe=!1),b.isEditing=!1,b.deleteIcon=e.scope.deleteIcon,b.reorderIcon=e.scope.reorderIcon,b.showOptions=!0,b.buttonClicked=function(a){a.onButtonClicked&&a.onButtonClicked(b.item,a)};var f=e.scope.$watch("isEditing",function(c){b.isEditing=c,c?b.showOptions=!1:a(function(){b.showOptions=!0},200)});b.$on("$destroy",function(){f()})}}}]).directive("item",["$timeout",function(a){return{restrict:"E",require:["?^list"],replace:!0,transclude:!0,scope:{item:"=",onSelect:"&",onDelete:"&",canDelete:"@",canReorder:"@",canSwipe:"@",buttons:"=",type:"@"},template:'<li ng-click="onSelect()" class="item"> <div class="item-edit" ng-if="canDelete && isEditing"> <button class="button button-icon icon" ng-class="deleteIcon" ng-click="onDelete()"></button> </div> <div class="item-content slide-left" ng-transclude> </div> <div class="item-drag" ng-if="canReorder && isEditing"> <button data-ionic-action="reorder" class="button button-icon"><i ng-class="reorderIcon"></i></button> </div> <div class="item-options" ng-if="canSwipe && !isEditing && showOptions"> <button ng-click="buttonClicked(button)" class="button" ng-class="button.type" ng-repeat="button in buttons">{{button.text}}</button> </div> </li>',link:function(b,c,d,e){e[0]?e=e[0]:e[1]&&(e=e[1]),c.addClass(d.type||"item-complex"),"item-complex"!==d.type&&(b.canSwipe=!1),b.isEditing=!1,b.deleteIcon=e.scope.deleteIcon,b.reorderIcon=e.scope.reorderIcon,b.showOptions=!0,b.buttonClicked=function(a){a.onButtonClicked&&a.onButtonClicked(b.item,a)};var f=e.scope.$watch("isEditing",function(c){b.isEditing=c,c?b.showOptions=!1:a(function(){b.showOptions=!0},200)});b.$on("$destroy",function(){f()})}}}]).directive("list",function(){return{restrict:"E",replace:!0,transclude:!0,scope:{isEditing:"=",deleteIcon:"@",reorderIcon:"@",hasPullToRefresh:"@",onRefresh:"&",onRefreshOpening:"&",onReorder:"&",refreshComplete:"="},controller:function(a){var b=this;this.scope=a,a.$watch("isEditing",function(){b.isEditing=!0})},template:'<ul class="list" ng-class="{\'list-editing\': isEditing}" ng-transclude> </ul>',link:function(a,b,c){var d=new ionic.views.ListView({el:b[0],listEl:b[0].children[0],hasPullToRefresh:"false"!==a.hasPullToRefresh,onRefresh:function(){a.onRefresh(),a.$parent.$broadcast("scroll.onRefresh")},onRefreshOpening:function(b){a.onRefreshOpening({amount:b}),a.$parent.$broadcast("scroll.onRefreshOpening",b)},onReorder:function(b,c,d){console.log("Moved",b,c,d),a.$apply(function(){a.onReorder({el:b,start:c,end:d})})}});a.listView=d,c.refreshComplete&&(a.refreshComplete=function(){d.doneRefreshing(),a.$parent.$broadcast("scroll.onRefreshComplete")}),c.animation&&b.addClass(c.animation)}}})}(),function(){"use strict";angular.module("ionic.ui.loading",[]).directive("loading",function(){return{restrict:"E",replace:!0,transclude:!0,link:function(a,b){b.addClass(a.animation||"")},template:'<div class="loading-backdrop" ng-class="{enabled: showBackdrop}"><div class="loading" ng-transclude></div></div>'}})}(),function(){"use strict";angular.module("ionic.ui.navRouter",["ionic.service.gesture"]).run(["$rootScope",function(a){a.stackCursorPosition=0}]).directive("navRouter",["$rootScope","$timeout","$location","$window","$route",function(a,b,c,d,e){return{restrict:"AC",controller:["$scope","$element",function(a){this.navBar={isVisible:!0},a.navController=this,this.goBack=function(){a.direction="back"}}],link:function(b,f,g,h){if(f.length){b.animation=g.animation,f[0].classList.add("noop-animation");var i=!0,j=!1,k=function(){f[0].classList.remove("noop-animation"),f[0].classList.add(b.animation),f[0].classList.add("reverse")},l=function(){f[0].classList.remove("noop-animation"),f[0].classList.remove("reverse"),f[0].classList.add(b.animation)};b.$on("$routeChangeSuccess",function(){}),b.$on("$routeChangeStart",function(c,e){var f,g=d.history.state;return f="back"==b.direction||!!(g&&g.position<=a.stackCursorPosition),i||e&&e.$$route&&""===e.$$route.originalPath?(i=!1,void 0):((j||a.stackCursorPosition>0)&&(j=!0,f?k():l()),void 0)}),b.$on("$locationChangeSuccess",function(){a.actualLocation=c.path(),i&&"/"!==c.path()&&(i=!1)}),b.$on("navRouter.goBack",function(){h.goBack()}),b.$watch(function(){return c.path()},function(c,f){if(a.actualLocation===c){if(""===f)return;var g,h=d.history.state;g="back"==b.direction||!!(h&&h.position<=a.stackCursorPosition),g?a.stackCursorPosition--:a.stackCursorPosition++,b.direction="forwards"}else{var i=e.current;i&&(d.history.replaceState({position:a.stackCursorPosition}),a.stackCursorPosition++)}})}}}}]).directive("navBar",["$rootScope","$animate","$compile",function(a,b,c){var d=function(a,d,e,f,g){var h,i,j,k=d[0].querySelectorAll(".title"),l=f.title;if(!e||e===l)return g(),void 0;h=angular.element(k[0]),j=c('<h1 class="title ng-leave" ng-bind="oldTitle"></h1>')(a),h.replaceWith(j),i=c('<h1 class="title ng-enter" ng-bind="currentTitle"></h1>')(a);var m=d[0].firstElementChild||null;b.enter(i,d,m&&angular.element(m),function(){g()}),b.leave(angular.element(j),function(){})};return{restrict:"E",require:"^navRouter",replace:!0,scope:{type:"@",backButtonType:"@",backButtonLabel:"@",backButtonIcon:"@",alignTitle:"@"},template:'<header class="bar bar-header nav-bar" ng-class="{invisible: !navController.navBar.isVisible}"><div class="buttons"> <button nav-back class="button" ng-if="enableBackButton && showBackButton" ng-class="backButtonClass" ng-bind-html="backButtonLabel"></button><button ng-click="button.tap($event)" ng-repeat="button in leftButtons" class="button {{button.type}}" ng-bind-html="button.content"></button></div><h1 class="title" ng-bind="currentTitle"></h1><div class="buttons" ng-if="rightButtons.length"> <button ng-click="button.tap($event)" ng-repeat="button in rightButtons" class="button {{button.type}}" ng-bind-html="button.content"></button></div></header>',link:function(b,c,e,f){c.addClass(e.animation),b.enableBackButton=!0,b.backButtonClass=e.backButtonType,e.backButtonIcon&&(b.backButtonClass+=" icon "+e.backButtonIcon),a.$watch("stackCursorPosition",function(a){b.showBackButton=a>0?!0:!1}),b.navController=f;var g=new ionic.views.HeaderBar({el:c[0],alignTitle:b.alignTitle||"center"});b.headerBarView=g,c.addClass(b.type);var h=function(a){var e=b.currentTitle;b.oldTitle=e,"undefined"!=typeof a.title&&(b.currentTitle=a.title),b.leftButtons=a.leftButtons,b.rightButtons=a.rightButtons,"undefined"!=typeof a.hideBackButton&&(b.enableBackButton=a.hideBackButton!==!0),a.animate!==!1&&"undefined"!=typeof a.title?d(b,c,e,a,function(){g.align()}):g.align()};b.$parent.$on("navRouter.pageChanged",function(a,b){h(b)}),b.$parent.$on("navRouter.pageShown",function(a,b){h(b)}),b.$parent.$on("navRouter.titleChanged",function(a,e){var f=b.currentTitle;b.oldTitle=f,"undefined"!=typeof e.title&&(b.currentTitle=e.title),e.animate!==!1&&"undefined"!=typeof e.title?d(b,c,f,e,function(){g.align()}):g.align()}),b.$parent.$on("navRouter.leftButtonsChanged",function(a,c){b.leftButtons=c}),b.$parent.$on("navRouter.rightButtonsChanged",function(a,c){b.rightButtons=c}),b.$on("$destroy",function(){})}}}]).directive("navPage",["$parse",function(a){return{restrict:"E",scope:!0,require:"^navRouter",link:function(b,c,d,e){c.addClass("pane"),b.icon=d.icon,b.iconOn=d.iconOn,b.iconOff=d.iconOff,b.hideBackButton=b.$eval(d.hideBackButton),b.hideNavBar=b.$eval(d.hideNavBar),e.navBar.isVisible=!b.hideNavBar,b.animate=b.$eval(d.animate),b.doesUpdateNavRouter=b.$eval(d.doesUpdateNavRouter)||!0;var f=a(d.leftButtons);b.$watch(f,function(a){b.leftButtons=a,b.doesUpdateNavRouter&&b.$emit("navRouter.leftButtonsChanged",b.leftButtons)});var g=a(d.rightButtons);b.$watch(g,function(a){b.rightButtons=a,b.doesUpdateNavRouter&&b.$emit("navRouter.rightButtonsChanged",b.rightButtons)});var h=a(d.title);b.$watch(h,function(a){b.title=a,b.$emit("navRouter.titleChanged",{title:a,animate:b.animate})})}}}]).directive("navBack",["$window","$rootScope","Gesture",function(a,b){return{restrict:"AC",link:function(c,d){var e=function(d){return b.stackCursorPosition>0&&(a.history.back(),c.$emit("navRouter.goBack")),d.alreadyHandled=!0,!1};d.bind("click",e)}}}])}(),function(){"use strict";angular.module("ionic.ui.radio",[]).directive("radio",function(){return{restrict:"E",replace:!0,require:"?ngModel",scope:{value:"@"},transclude:!0,template:'<label class="item item-radio"> <input type="radio" name="radio-group"> <div class="item-content" ng-transclude> </div> <i class="radio-icon icon ion-checkmark"></i> </label>',link:function(a,b,c,d){var e;d&&(e=b.children().eq(0),e.length&&d&&(e.bind("click",function(b){console.log("RADIO CLICK"),a.$apply(function(){d.$setViewValue(a.$eval(c.ngValue))}),b.alreadyHandled=!0}),d.$render=function(){var b=a.$eval(c.ngValue);b===d.$viewValue?e.attr("checked","checked"):e.removeAttr("checked")}))}}}).directive("radioButtons",function(){return{restrict:"E",replace:!0,require:"?ngModel",scope:{value:"@"},transclude:!0,template:'<div class="button-bar button-bar-inline" ng-transclude></div>',controller:["$scope","$element",function(a,b){this.select=function(a){for(var c,d=b.children(),e=0;e<d.length;e++)c=d[e],c!=a[0]&&c.classList.remove("active")}}],link:function(a,b,c,d){d&&(d.$render=function(){for(var c=b.children(),e=0;e<c.length;e++)c[e].classList.remove("active");a.$parent.$broadcast("radioButton.select",d.$viewValue)})}}}).directive("buttonRadio",function(){return{restrict:"CA",require:["?^ngModel","?^radioButtons"],link:function(a,b,c,d){var e=d[0],f=d[1];if(e&&f){var g=function(){console.log("SET"),b.addClass("active"),e.$setViewValue(a.$eval(c.ngValue)),f.select(b)},h=function(){console.log("CLICK"),g()};a.$on("radioButton.select",function(d,e){e==a.$eval(c.ngValue)&&b.addClass("active")}),b.bind("click",h)}}}})}(window.ionic),function(){"use strict";angular.module("ionic.ui.scroll",[]).directive("scroll",["$parse","$timeout",function(a,b){return{restrict:"E",replace:!0,template:'<div class="scroll-view"></div>',transclude:!0,scope:{direction:"@",onRefresh:"&",onScroll:"&",refreshComplete:"=",scroll:"@",scrollbarX:"@",scrollbarY:"@"},compile:function(a,c,d){return function(a,e){var f,g,h=document.createElement("div");h.className="scroll","true"==c.padding&&(h.className+=" padding",addedPadding=!0),e.append(h),f=d(a.$parent),angular.element(e[0].firstElementChild).append(f);var i=e[0].querySelector(".scroll-refresher"),j=i&&i.clientHeight||0;c.refreshComplete&&(a.refreshComplete=function(){a.scrollView&&(i&&i.classList.remove("active"),a.scrollView.finishPullToRefresh(),a.$parent.$broadcast("scroll.onRefreshComplete"))});var k=a.direction.indexOf("x")>=0,l=a.direction.indexOf("y")>=0;b(function(){g=new ionic.views.Scroll({el:e[0],scrollbarX:a.$eval(a.scrollbarX)!==!1,scrollbarY:a.$eval(a.scrollbarY)!==!1,scrollingX:k,scrollingY:l}),i&&g.activatePullToRefresh(j,function(){i.classList.add("active")},function(){i.classList.remove("refreshing"),i.classList.remove("active")},function(){i.classList.add("refreshing"),a.onRefresh(),a.$parent.$broadcast("scroll.onRefresh")}),e.bind("scroll",function(b){a.onScroll({event:b,scrollTop:b.detail?b.detail.scrollTop:b.originalEvent?b.originalEvent.detail.scrollTop:0,scrollLeft:b.detail?b.detail.scrollLeft:b.originalEvent?b.originalEvent.detail.scrollLeft:0})}),a.$parent.$on("scroll.resize",function(){b(function(){g&&g.resize()})}),a.$parent.$on("scroll.refreshComplete",function(){g&&g.finishPullToRefresh()}),a.$parent.scrollView=g})}}}}])}(),function(){"use strict";angular.module("ionic.ui.sideMenu",["ionic.service.gesture"]).directive("sideMenus",function(){return{restrict:"ECA",controller:["$scope",function(a){angular.extend(this,ionic.controllers.SideMenuController.prototype),ionic.controllers.SideMenuController.call(this,{left:{width:275},right:{width:275}}),a.sideMenuContentTranslateX=0,a.sideMenuController=this}],replace:!0,transclude:!0,template:'<div class="pane" ng-transclude></div>'}}).directive("sideMenuContent",["Gesture",function(a){return{restrict:"AC",require:"^sideMenus",scope:!0,compile:function(){return function(b,c,d,e){c.addClass("menu-content"),b.dragContent=b.$eval(d.dragContent)===!1?!1:!0;var f=!1,g=!1;ionic.on("mousedown",function(a){f=a.defaultPrevented});var h=function(a){if(b.dragContent){if(f)return;g=!0,e._handleDrag(a),a.gesture.srcEvent.preventDefault()}},i=function(a){g&&a.gesture.srcEvent.preventDefault()},j=a.on("dragright",h,c),k=a.on("dragleft",h,c),l=a.on("dragup",i,c),m=a.on("dragdown",i,c),n=function(a){g=!1,f||e._endDrag(a),f=!1},o=a.on("release",n,c);e.setContent({onDrag:function(){},endDrag:function(){},getTranslateX:function(){return b.sideMenuContentTranslateX||0},setTranslateX:function(a){b.sideMenuContentTranslateX=a,c[0].style.webkitTransform="translate3d("+a+"px, 0, 0)"},enableAnimation:function(){b.animationEnabled=!0,c[0].classList.add("menu-animated")},disableAnimation:function(){b.animationEnabled=!1,c[0].classList.remove("menu-animated")}}),b.$on("$destroy",function(){a.off(k,"dragleft",h),a.off(j,"dragright",h),a.off(l,"dragup",h),a.off(m,"dragdown",h),a.off(o,"release",n)})}}}}]).directive("sideMenu",function(){return{restrict:"E",require:"^sideMenus",replace:!0,transclude:!0,scope:!0,template:'<div class="menu menu-{{side}}"></div>',compile:function(a,b,c){return function(a,b,d,e){a.side=d.side,"left"==a.side?(e.left.isEnabled=!0,e.left.pushDown=function(){b[0].style.zIndex=-1},e.left.bringUp=function(){b[0].style.zIndex=0}):"right"==a.side&&(e.right.isEnabled=!0,e.right.pushDown=function(){b[0].style.zIndex=-1},e.right.bringUp=function(){b[0].style.zIndex=0}),b.append(c(a))}}}})}(),function(){"use strict";angular.module("ionic.ui.slideBox",[]).directive("slideBox",["$compile",function(a){return{restrict:"E",replace:!0,transclude:!0,scope:{},controller:["$scope","$element",function(a,b){a.slides=[],this.slideAdded=function(){a.slides.push({})},angular.extend(this,ionic.views.SlideBox.prototype),ionic.views.SlideBox.call(this,{el:b[0],slideChanged:function(b){a.$parent.$broadcast("slideBox.slideChanged",b),a.$apply()}}),a.$parent.slideBox=this}],template:'<div class="slide-box"> <div class="slide-box-slides" ng-transclude> </div> </div>',link:function(b,c,d){if("false"!==d.showPager){var e=b.$new(),f=a("<pager></pager>")(e);c.append(f)}}}}]).directive("slide",function(){return{restrict:"E",replace:!0,require:"^slideBox",transclude:!0,template:'<div class="slide-box-slide" ng-transclude></div>',compile:function(){return function(a,b,c,d){d.slideAdded()}}}}).directive("pager",function(){return{restrict:"E",replace:!0,require:"^slideBox",template:'<div class="slide-box-pager"><span ng-repeat="slide in slides"><i class="icon ion-record"></i></span></div>'}})}(),angular.module("ionic.ui.tabs",["ngAnimate"]).directive("tabs",function(){return{restrict:"E",replace:!0,scope:!0,transclude:!0,controller:["$scope","$element","$animate",function(a){var b=this;angular.extend(this,ionic.controllers.TabBarController.prototype),ionic.controllers.TabBarController.call(this,{controllerChanged:function(b,c,d,e){a.controllerChanged&&a.controllerChanged({oldController:b,oldIndex:c,newController:d,newIndex:e})},tabBar:{tryTabSelect:function(){},setSelectedItem:function(){},addItem:function(){}}}),this.add=function(a){this.addController(a),this.select(0)},this.select=function(c){a.activeAnimation=a.animation,b.selectController(c)},a.controllers=this.controllers,a.tabsController=this}],template:'<div class="view"><tab-controller-bar></tab-controller-bar></div>',compile:function(a,b,c){return function(a,b,d){var e=b[0].querySelector(".tabs");a.tabsType=d.tabsType||"tabs-positive",a.tabsStyle=d.tabsStyle,a.animation=d.animation,a.animateNav=a.$eval(d.animateNav),a.animateNav!==!1&&(a.animateNav=!0),d.$observe("tabsStyle",function(){e&&angular.element(e).addClass(d.tabsStyle)}),d.$observe("tabsType",function(){e&&angular.element(e).addClass(d.tabsType)}),a.$watch("activeAnimation",function(){b.addClass(a.activeAnimation)}),c(a,function(a){b.prepend(a)})}}}}).directive("tab",["$animate","$parse",function(a,b){return{restrict:"E",require:"^tabs",scope:!0,transclude:"element",compile:function(c,d,e){return function(c,d,f,g){var h,i;c.title=f.title,c.icon=f.icon,c.iconOn=f.iconOn,c.iconOff=f.iconOff,c.hideBackButton=c.$eval(f.hideBackButton),c.hideBackButton!==!0&&(c.hideBackButton=!1),c.animate=c.$eval(f.animate),c.doesUpdateNavRouter=c.$eval(f.doesUpdateNavRouter),c.doesUpdateNavRouter!==!1&&(c.doesUpdateNavRouter=!0);var j=b(f.leftButtons);c.$watch(j,function(a){c.leftButtons=a,c.doesUpdateNavRouter&&c.$emit("navRouter.leftButtonsChanged",c.rightButtons)});var k=b(f.rightButtons);c.$watch(k,function(a){c.rightButtons=a}),g.add(c),c.$watch("isVisible",function(b){i&&(a.leave(i),c.$broadcast("tab.hidden"),i=void 0),h&&(h.$destroy(),h=void 0),b&&(h=c.$new(),e(h,function(b){i=b,b.addClass("pane"),a.enter(b,d.parent(),d),c.title&&c.doesUpdateNavRouter&&c.$emit("navRouter.pageShown",{title:c.title,rightButtons:c.rightButtons,leftButtons:c.leftButtons,hideBackButton:c.hideBackButton,animate:c.animateNav}),c.$broadcast("tab.shown")}))})}}}}]).directive("tabControllerBar",function(){return{restrict:"E",require:"^tabs",transclude:!0,replace:!0,scope:!0,template:'<div class="tabs"><tab-controller-item title="{{controller.title}}" icon="{{controller.icon}}" icon-on="{{controller.iconOn}}" icon-off="{{controller.iconOff}}" active="controller.isVisible" index="$index" ng-repeat="controller in controllers"></tab-controller-item></div>',link:function(a,b){b.addClass(a.tabsType),b.addClass(a.tabsStyle)}}}).directive("tabControllerItem",function(){return{restrict:"E",replace:!0,require:"^tabs",scope:{title:"@",icon:"@",iconOn:"@",iconOff:"@",active:"=",tabSelected:"@",index:"="},link:function(a,b,c,d){c.icon&&(a.iconOn=a.iconOff=c.icon),a.selectTab=function(){d.select(a.index)}},template:'<a ng-class="{active:active}" ng-click="selectTab()" class="tab-item"><i class="{{icon}}" ng-if="icon"></i><i class="{{iconOn}}" ng-if="active"></i><i class="{{iconOff}}" ng-if="!active"></i> {{title}}</a>'}}).directive("tabBar",function(){return{restrict:"E",replace:!0,transclude:!0,template:'<div class="tabs tabs-primary" ng-transclude></div>'}}),function(a){"use strict";angular.module("ionic.ui.toggle",[]).directive("toggle",function(){return{restrict:"E",replace:!0,require:"?ngModel",scope:{},template:'<div ng-click="toggleIt($event)" class="toggle" skip-tap-poly><input type="checkbox"><div class="track"><div class="handle"></div></div></div>',link:function(b,c,d,e){var f,g;e&&(f=c.children().eq(0),g=c.children().eq(1),f.length&&g.length&&(b.toggle=new a.views.Toggle({el:c[0],checkbox:f[0],handle:g[0]}),b.toggleIt=function(a){b.toggle.tap(a),e.$setViewValue(f[0].checked)},e.$render=function(){b.toggle.val(e.$viewValue)}))}}})}(window.ionic),function(){"use strict";angular.module("ionic.ui.virtRepeat",[]).directive("virtRepeat",function(){return{require:["?ngModel","^virtualList"],transclude:"element",priority:1e3,terminal:!0,compile:function(){return function(a,b,c,d){var e=d[1];e.listView.renderViewport=function(){}}}}})}(ionic),function(){"use strict";function a(a){var b=a.match(/^\s*([\$\w]+)\s+in\s+(\S*)\s*$/);if(!b)throw new Error("Expected sfVirtualRepeat in form of '_item_ in _collection_' but got '"+a+"'.");return{value:b[1],collection:b[2]}}function b(a){var b={overflow:"auto"},c=window.getComputedStyle?window.getComputedStyle(a[0]):a[0].currentStyle,d=c&&c.getPropertyValue("max-height"),e=c&&c.getPropertyValue("height");d&&"0px"!==d?b.maxHeight=d:b.height=e&&"0px"!==e?e:window.innerHeight,a.css(b)}function c(a){var b={margin:0,padding:0,border:0,"box-sizing":"border-box"};
a.css(b)}function d(a){var b=window.getComputedStyle?window.getComputedStyle(a):a.currentStyle,c=b&&b.getPropertyValue("max-height"),d=b&&b.getPropertyValue("height");if(d&&"0px"!==d&&"auto"!==d)$log.info('Row height is "%s" from css height',d);else if(c&&"0px"!==c&&"none"!==c)d=c,$log.info('Row height is "%s" from css max-height',d);else{if(!a.clientHeight)throw new Error("Unable to compute height of row");d=a.clientHeight+"px",$log.info('Row height is "%s" from client height',d)}return angular.element(a).css("height",d),parseInt(d,10)}angular.module("ionic.ui.virtualRepeat",[]).directive("virtualRepeat",["$log",function(e){return{require:["?ngModel, ^virtualList"],transclude:"element",priority:1e3,terminal:!0,compile:function(f,g){var h=a(g.sfVirtualRepeat);return function(a,f,g,i){function j(a,b,c){var d=c.$new();return d[h.value]=b[a],d.$index=a,d.$first=0===a,d.$last=a===b.length-1,d.$middle=!(d.$first||d.$last),d.$watch(function(){d[h.value]=b[a]}),d}function k(a,b,c,d,e){var f,g,h,i=document.createDocumentFragment(),k=[];for(g=a;g!==b;g++)h=j(g,c,d),f=linker(h,angular.noop),k.push(f),i.appendChild(f[0]);return e.after(i),k}function l(){var a=clip(v.firstActive,v.firstVisible-v.lowWater,v.firstVisible-v.highWater),b=clip(v.firstActive+v.active,v.firstVisible+v.visible+v.lowWater,v.firstVisible+v.visible+v.highWater);v.firstActive=Math.max(0,a),v.active=Math.min(b,v.total)-v.firstActive}function m(b){s&&a.$apply(function(){v.firstVisible=Math.floor(b.target.scrollTop/s),v.visible=Math.ceil(u.viewport[0].clientHeight/s),e.log("scroll to row %o",v.firstVisible),t=b.target.scrollTop+b.target.clientHeight>=b.target.scrollHeight,l(),e.log(" state is now %o",v),e.log(" sticky = %o",t)})}function n(a){var b=a.$eval(h.collection);return b.length!==v.total&&(v.total=b.length,l()),{start:v.firstActive,active:v.active,len:b.length}}function o(a,b){var c,d,e=Array.prototype[a];for(d=0;b>d;d++)c=e.call(r),c.scope().$destroy(),c.remove()}function p(a,b,c){var g,i=b.start+b.active,j=c.$eval(h.collection);if(a===b)e.info("initial listen"),g=k(a.start,i,j,c,f),r=g,r.length&&(s=d(g[0][0]));else{var l=a.start+a.active,m=a.start>=b.start,n=m?a.start-b.start:b.start-a.start,p=l>=i?l-i:i-l,q=n<(m?b.active:a.active);if(e.info("change by %o,%o rows %s",n,p,m?"forward":"backward"),q){if(m?(e.info("need to remove from the top"),o("shift",n)):n&&(e.info("need to add at the top"),g=k(a.start,b.start,j,c,f),r=g.concat(r)),i>l)e.info("need to remove from the bottom"),o("pop",i-l);else if(p){var v=r[r.length-1];e.info("need to add to the bottom"),g=k(i,l,j,c,v),r=r.concat(g)}}else e.info("non-contiguous change"),o("pop",r.length),r=k(a.start,l,j,c,f);!s&&r.length&&(s=d(r[0][0])),u.content.css({"padding-top":a.start*s+"px"})}u.content.css({height:a.len*s+"px"}),t&&(u.viewport[0].scrollTop=u.viewport[0].clientHeight+u.viewport[0].scrollHeight)}var q=i[1],r=[],s=0,t=!1,u=q.element,v="ngModel"in g?a.$eval(g.ngModel):{};v.firstActive=0,v.firstVisible=0,v.visible=0,v.active=0,v.total=0,v.lowWater=v.lowWater||100,v.highWater=v.highWater||300,c(u.content),b(u.viewport),u.bind("momentumScrolled",m),a.$on("$destroy",function(){u.unbind("momentumScrolled",m)}),a.$watch(n,p,!0)}}}}])}(ionic);