(function(n){var t=function(t,i){var u=t.location.host,f=t.location.pathname,r;this.cssArr=[];this.mode="matrix";this.urls={matrix:"//"+u,firstNews:null,list:"//"+u+"/list"};r=this;this.init=function(t){function u(n){while(n.length!==0){if(r.cssArr.filter(function(n){return this.hasClass(n)},n).length!==0)return console.log("exit"),!1;n=n.parent()}return!0}n.merge(r.urls,t);f.indexOf("/a/")===0?r.mode="article":f.indexOf("/list")===0&&(r.mode="list");i.$on("swipe.left",function(t,i){var e=n.element(i.Event.target),f;u(e)&&(f=r.getRightUrl(),f&&(window.location.href=f))});i.$on("swipe.right",function(t,i){var e=n.element(i.Event.target),f;u(e)&&(f=r.getLeftUrl(),f&&(window.location.href=f))})};this.getLeftUrl=function(){switch(r.mode){case"article":return r.urls.matrix;case"list":return r.urls.firstNews;default:return null}};this.getRightUrl=function(){switch(r.mode){case"article":return r.urls.list;case"matrix":return r.urls.firstNews;default:return null}};this.getDescription=function(){switch(r.mode){case"article":return"Режим статья";case"matrix":return"Режим матрица";default:return"Режим список"}}};n.module("dp.app.controllers").controller("ModeIndicatorController",["$window","$scope",t])})(angular,jQuery),function(n){var t=function(n,t,i){return{scope:{settings:"=ngBroadcastWaypoint"},link:function(r,u){r.settings&&t(function(){return new n.Waypoint({element:u[0],handler:function(n){i.$broadcast(r.settings.eventname,n)},offset:r.settings.offset||0})})}}},i=n.element("[ng-app]").attr("ng-app")||"dp.app.directives";n.module(i).directive("ngBroadcastWaypoint",["$window","$timeout","$rootScope",t])}(angular)