text: var app=angular.module("app",["ngTick","ui.router"]);app.config(["$stateProvider","$urlRouterProvider","$locationProvider",function(t,e,i){i.html5Mode({enabled:!0}),t.state("home",{url:"/",templateUrl:"demo-site/view/getting-started.html"}).state("clock",{url:"/directives/clock",controller:"clockCtrl",templateUrl:"demo-site/view/directives/clock.html"}).state("countdown",{url:"/directives/countdown",controller:"countdownCtrl",templateUrl:"demo-site/view/directives/countdown.html"}).state("timer",{url:"/directives/timer",controller:"timerCtrl",templateUrl:"demo-site/view/directives/timer.html"}).state("formatting",{url:"/formatting",templateUrl:"demo-site/view/formatting.html"}).state("factory",{url:"/factory",templateUrl:"demo-site/view/factory.html"})}]),app.controller("clockCtrl",["$scope","$timeout",function(t,e){e(function(){t.myclock.start()}),t.tabs=[{title:"Markup",url:"demo-site/template/clock/markup.html"},{title:"Controller",url:"demo-site/template/clock/controller.html"}]}]),app.controller("countdownCtrl",["$scope",function(t){t.duration={h:1,m:30,s:45,ms:500},t.end=function(){t.mycountdown.end()},t.reset=function(){t.mycountdown.reset()},t.start=function(){t.mycountdown.start()},t.stop=function(){t.mycountdown.stop()},t.tabs=[{title:"Markup",url:"demo-site/template/countdown/markup.html"},{title:"Controller",url:"demo-site/template/countdown/controller.html"}]}]),app.controller("timerCtrl",["$scope",function(t){var e=angular.element(document.getElementById("timer-lap"));t.lap=function(){t.mytimer.lap()},t.reset=function(){t.mytimer.reset()},t.start=function(){t.mytimer.start()},t.stop=function(){t.mytimer.stop()},t.$on("mytimer:lap",function(t,i,d,s){e.children().length<3?e.append('<li>lap <span class="demo-lap">'+d+'</span> ms elapsed <span class="demo-lapped">'+s+"</span></li>"):3===e.children().length&&e.append("<li>you get the idea...</li>")}),t.tabs=[{title:"Markup",url:"demo-site/template/timer/markup.html"},{title:"Controller",url:"demo-site/template/timer/controller.html"}]}]),app.directive("tabs",[function(){return{restrict:"E",templateUrl:"demo-site/template/tabs.html",scope:{tabs:"=",selected:"@"},link:function(t,e,i){t.tabs&&(t.currentTab=t.tabs[t.selected].url,t.onClickTab=function(e){t.currentTab=e.url},t.isActiveTab=function(e){return e===t.currentTab})}}}]),app.directive("prism",[function(){return{restrict:"A",link:function(t,e,i){e.ready(function(){Prism.highlightElement(e[0])})}}}]),app.directive("binaryClock",["engine",function(t){return{restrict:"E",template:'<div id="clock"><div class="field" id="hours"><table border="0" cellspacing="0" cellpadding="0"> <tr><td><div class="blank"></div></td><td><div class="bit" id="hours-eights"></div></td></tr><tr><td><div class="blank" id="hours-forties"></div></td><td><div class="bit" id="hours-fours"></div></td></tr><tr><td><div class="bit" id="hours-twenties"></div></td><td><div class="bit" id="hours-twos"></div></td></tr><tr><td><div class="bit" id="hours-tens"></div></td><td><div class="bit" id="hours-ones"></div></td></tr></table></div><div class="field" id="minutes"><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="blank"></div></td><td><div class="bit" id="minutes-eights"></div></td></tr><tr><td><div class="bit" id="minutes-forties"></div></td><td><div class="bit" id="minutes-fours"></div></td></tr><tr><td><div class="bit" id="minutes-twenties"></div></td><td><div class="bit" id="minutes-twos"></div></td></tr><tr><td><div class="bit" id="minutes-tens"></div></td><td><div class="bit" id="minutes-ones"></div></td></tr></table></div><div class="field" id="seconds"><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="blank"></div></td><td><div id="seconds-eights" class="bit"></div></td></tr><tr><td><div id="seconds-forties" class="bit"></div></td><td><div id="seconds-fours" class="bit"></div></td></tr><tr><td><div id="seconds-twenties" class="bit"></div></td><td><div id="seconds-twos" class="bit"></div></td></tr><tr><td><div id="seconds-tens" class="bit"></div></td><td><div id="seconds-ones" class="bit"></div></td></tr></table></div></div>',link:function(e,i,d){function s(t,e){var i=document.getElementById(t);return i.classList.contains("blank")?!1:void(e?i.setAttribute("class","bit on"):i.setAttribute("class","bit off"))}function r(t,e){s(t+"-forties",e>=40),e>=40&&(e-=40),s(t+"-twenties",e>=20),e>=20&&(e-=20),s(t+"-tens",e>=10),e>=10&&(e-=10),s(t+"-eights",e>=8),e>=8&&(e-=8),s(t+"-fours",e>=4),e>=4&&(e-=4),s(t+"-twos",e>=2),e>=2&&(e-=2),s(t+"-ones",e>=1)}var l=new t;l.start(100).on(function(t){var e=new Date;r("hours",e.getHours()),r("minutes",e.getMinutes()),r("seconds",e.getSeconds())}),e.$on("$destroy",function(){l.stop()})}}}]);