kopia lustrzana https://github.com/cyoung/stratux
2 wiersze
16 KiB
JavaScript
Executable File
2 wiersze
16 KiB
JavaScript
Executable File
!function(){"use strict";function e(t,i){function r(e,t){return function(){return e.apply(t,arguments)}}var o;if(i=i||{},this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=i.touchBoundary||10,this.layer=t,this.tapDelay=i.tapDelay||200,this.tapTimeout=i.tapTimeout||700,!e.notNeeded(t)){for(var a=["onMouse","onClick","onTouchStart","onTouchMove","onTouchEnd","onTouchCancel"],u=this,c=0,l=a.length;l>c;c++)u[a[c]]=r(u[a[c]],u);n&&(t.addEventListener("mouseover",this.onMouse,!0),t.addEventListener("mousedown",this.onMouse,!0),t.addEventListener("mouseup",this.onMouse,!0)),t.addEventListener("click",this.onClick,!0),t.addEventListener("touchstart",this.onTouchStart,!1),t.addEventListener("touchmove",this.onTouchMove,!1),t.addEventListener("touchend",this.onTouchEnd,!1),t.addEventListener("touchcancel",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(t.removeEventListener=function(e,n,i){var r=Node.prototype.removeEventListener;"click"===e?r.call(t,e,n.hijacked||n,i):r.call(t,e,n,i)},t.addEventListener=function(e,n,i){var r=Node.prototype.addEventListener;"click"===e?r.call(t,e,n.hijacked||(n.hijacked=function(e){e.propagationStopped||n(e)}),i):r.call(t,e,n,i)}),"function"==typeof t.onclick&&(o=t.onclick,t.addEventListener("click",function(e){o(e)},!1),t.onclick=null)}}var t=navigator.userAgent.indexOf("Windows Phone")>=0,n=navigator.userAgent.indexOf("Android")>0&&!t,i=/iP(ad|hone|od)/.test(navigator.userAgent)&&!t,r=i&&/OS 4_\d(_\d)?/.test(navigator.userAgent),o=i&&/OS [6-7]_\d/.test(navigator.userAgent),a=navigator.userAgent.indexOf("BB10")>0;e.prototype.needsClick=function(e){switch(e.nodeName.toLowerCase()){case"button":case"select":case"textarea":if(e.disabled)return!0;break;case"input":if(i&&"file"===e.type||e.disabled)return!0;break;case"label":case"iframe":case"video":return!0}return/\bneedsclick\b/.test(e.className)},e.prototype.needsFocus=function(e){switch(e.nodeName.toLowerCase()){case"textarea":return!0;case"select":return!n;case"input":switch(e.type){case"button":case"checkbox":case"file":case"image":case"radio":case"submit":return!1}return!e.disabled&&!e.readOnly;default:return/\bneedsfocus\b/.test(e.className)}},e.prototype.sendClick=function(e,t){var n,i;document.activeElement&&document.activeElement!==e&&document.activeElement.blur(),i=t.changedTouches[0],n=document.createEvent("MouseEvents"),n.initMouseEvent(this.determineEventType(e),!0,!0,window,1,i.screenX,i.screenY,i.clientX,i.clientY,!1,!1,!1,!1,0,null),n.forwardedTouchEvent=!0,e.dispatchEvent(n)},e.prototype.determineEventType=function(e){return n&&"select"===e.tagName.toLowerCase()?"mousedown":"click"},e.prototype.focus=function(e){var t;i&&e.setSelectionRange&&0!==e.type.indexOf("date")&&"time"!==e.type&&"month"!==e.type?(t=e.value.length,e.setSelectionRange(t,t)):e.focus()},e.prototype.updateScrollParent=function(e){var t,n;if(t=e.fastClickScrollParent,!t||!t.contains(e)){n=e;do{if(n.scrollHeight>n.offsetHeight){t=n,e.fastClickScrollParent=n;break}n=n.parentElement}while(n)}t&&(t.fastClickLastScrollTop=t.scrollTop)},e.prototype.getTargetElementFromEventTarget=function(e){return e.nodeType===Node.TEXT_NODE?e.parentNode:e},e.prototype.onTouchStart=function(e){var t,n,o;if(e.targetTouches.length>1)return!0;if(t=this.getTargetElementFromEventTarget(e.target),n=e.targetTouches[0],i){if(o=window.getSelection(),o.rangeCount&&!o.isCollapsed)return!0;if(!r){if(n.identifier&&n.identifier===this.lastTouchIdentifier)return e.preventDefault(),!1;this.lastTouchIdentifier=n.identifier,this.updateScrollParent(t)}}return this.trackingClick=!0,this.trackingClickStart=e.timeStamp,this.targetElement=t,this.touchStartX=n.pageX,this.touchStartY=n.pageY,e.timeStamp-this.lastClickTime<this.tapDelay&&e.preventDefault(),!0},e.prototype.touchHasMoved=function(e){var t=e.changedTouches[0],n=this.touchBoundary;return Math.abs(t.pageX-this.touchStartX)>n||Math.abs(t.pageY-this.touchStartY)>n?!0:!1},e.prototype.onTouchMove=function(e){return this.trackingClick?((this.targetElement!==this.getTargetElementFromEventTarget(e.target)||this.touchHasMoved(e))&&(this.trackingClick=!1,this.targetElement=null),!0):!0},e.prototype.findControl=function(e){return void 0!==e.control?e.control:e.htmlFor?document.getElementById(e.htmlFor):e.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")},e.prototype.onTouchEnd=function(e){var t,a,u,c,l,s=this.targetElement;if(!this.trackingClick)return!0;if(e.timeStamp-this.lastClickTime<this.tapDelay)return this.cancelNextClick=!0,!0;if(e.timeStamp-this.trackingClickStart>this.tapTimeout)return!0;if(this.cancelNextClick=!1,this.lastClickTime=e.timeStamp,a=this.trackingClickStart,this.trackingClick=!1,this.trackingClickStart=0,o&&(l=e.changedTouches[0],s=document.elementFromPoint(l.pageX-window.pageXOffset,l.pageY-window.pageYOffset)||s,s.fastClickScrollParent=this.targetElement.fastClickScrollParent),u=s.tagName.toLowerCase(),"label"===u){if(t=this.findControl(s)){if(this.focus(s),n)return!1;s=t}}else if(this.needsFocus(s))return e.timeStamp-a>100||i&&window.top!==window&&"input"===u?(this.targetElement=null,!1):(this.focus(s),this.sendClick(s,e),i&&"select"===u||(this.targetElement=null,e.preventDefault()),!1);return i&&!r&&(c=s.fastClickScrollParent,c&&c.fastClickLastScrollTop!==c.scrollTop)?!0:(this.needsClick(s)||(e.preventDefault(),this.sendClick(s,e)),!1)},e.prototype.onTouchCancel=function(){this.trackingClick=!1,this.targetElement=null},e.prototype.onMouse=function(e){return this.targetElement?e.forwardedTouchEvent?!0:e.cancelable&&(!this.needsClick(this.targetElement)||this.cancelNextClick)?(e.stopImmediatePropagation?e.stopImmediatePropagation():e.propagationStopped=!0,e.stopPropagation(),e.preventDefault(),!1):!0:!0},e.prototype.onClick=function(e){var t;return this.trackingClick?(this.targetElement=null,this.trackingClick=!1,!0):"submit"===e.target.type&&0===e.detail?!0:(t=this.onMouse(e),t||(this.targetElement=null),t)},e.prototype.destroy=function(){var e=this.layer;n&&(e.removeEventListener("mouseover",this.onMouse,!0),e.removeEventListener("mousedown",this.onMouse,!0),e.removeEventListener("mouseup",this.onMouse,!0)),e.removeEventListener("click",this.onClick,!0),e.removeEventListener("touchstart",this.onTouchStart,!1),e.removeEventListener("touchmove",this.onTouchMove,!1),e.removeEventListener("touchend",this.onTouchEnd,!1),e.removeEventListener("touchcancel",this.onTouchCancel,!1)},e.notNeeded=function(e){var t,i,r,o;if("undefined"==typeof window.ontouchstart)return!0;if(i=+(/Chrome\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1]){if(!n)return!0;if(t=document.querySelector("meta[name=viewport]")){if(-1!==t.content.indexOf("user-scalable=no"))return!0;if(i>31&&document.documentElement.scrollWidth<=window.outerWidth)return!0}}if(a&&(r=navigator.userAgent.match(/Version\/([0-9]*)\.([0-9]*)/),r[1]>=10&&r[2]>=3&&(t=document.querySelector("meta[name=viewport]")))){if(-1!==t.content.indexOf("user-scalable=no"))return!0;if(document.documentElement.scrollWidth<=window.outerWidth)return!0}return"none"===e.style.msTouchAction||"manipulation"===e.style.touchAction?!0:(o=+(/Firefox\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1],o>=27&&(t=document.querySelector("meta[name=viewport]"),t&&(-1!==t.content.indexOf("user-scalable=no")||document.documentElement.scrollWidth<=window.outerWidth))?!0:"none"===e.style.touchAction||"manipulation"===e.style.touchAction?!0:!1)},e.attach=function(t,n){return new e(t,n)},"function"==typeof define&&"object"==typeof define.amd&&define.amd?define(function(){return e}):"undefined"!=typeof module&&module.exports?(module.exports=e.attach,module.exports.FastClick=e):window.FastClick=e}(),function(){"use strict";angular.module("mobile-angular-ui.core.activeLinks",[]).run(["$rootScope","$window","$document","$location",function(e,t,n,i){var r=function(){var e,r=i.url(),o=r.indexOf("#"),a=r.indexOf("?"),u=t.location.href,c=u.indexOf(r);-1===o&&-1===a?e=u:-1!==o&&o>a?e=u.slice(0,c+o):-1!==a&&a>o&&(e=u.slice(0,c+a));for(var l=n[0].links,s=0;s<l.length;s++){var d=l[s],f=angular.element(d);f.attr("href")&&""!==f.attr("href")&&d.href===e?f.addClass("active"):f.attr("href")&&""!==f.attr("href")&&d.href&&d.href.length&&f.removeClass("active")}};e.$on("$locationChangeSuccess",r),e.$on("$includeContentLoaded",r)}])}(),function(){"use strict";angular.module("mobile-angular-ui.core.capture",[]).run(["Capture","$rootScope",function(e,t){t.$on("$routeChangeSuccess",function(){e.resetAll()})}]).factory("Capture",["$compile",function(e){var t={};return{resetAll:function(){for(var e in t)t.hasOwnProperty(e)&&this.resetYielder(e)},resetYielder:function(e){var n=t[e];this.setContentFor(e,n.defaultContent,n.defaultScope)},putYielder:function(e,n,i,r){var o={};o.name=e,o.element=n,o.defaultContent=r||"",o.defaultScope=i,t[e]=o},getYielder:function(e){return t[e]},removeYielder:function(e){delete t[e]},setContentFor:function(n,i,r){var o=t[n];o&&(o.element.html(i),e(o.element.contents())(r))}}}]).directive("uiContentFor",["Capture",function(e){return{compile:function(t,n){var i=t.html();return(null===n.uiDuplicate||void 0===n.uiDuplicate)&&(t.html(""),t.remove()),function(t,n,r){e.setContentFor(r.uiContentFor,i,t)}}}}]).directive("uiYieldTo",["$compile","Capture",function(e,t){return{link:function(e,n,i){t.putYielder(i.uiYieldTo,n,e,n.html()),n.on("$destroy",function(){t.removeYielder(i.uiYieldTo)}),e.$on("$destroy",function(){t.removeYielder(i.uiYieldTo)})}}}])}(),function(){"use strict";var e=angular.module("mobile-angular-ui.core.fastclick",[]);e.run(["$window",function(e){function t(e,t){return function(){return e.apply(t,arguments)}}var n=FastClick.prototype.onTouchEnd;FastClick.prototype.onTouchEnd=function(e){e.changedTouches||(e.changedTouches=[{}]),(n=t(n,this))(e)},FastClick.attach(e.document.body)}]),angular.forEach(["select","input","textarea"],function(t){e.directive(t,function(){return{restrict:"E",compile:function(e){e.addClass("needsclick")}}})})}(),function(){"use strict";var e=function(e,t){for(var n=e;n.length>0;){if(n[0]===t[0])return n=null,!0;n=n.parent()}return n=null,!1};angular.module("mobile-angular-ui.core.outerClick",[]).factory("bindOuterClick",["$document","$timeout",function(t,n){return function(i,r,o,a){var u=function(t){e(angular.element(t.target),r)||i.$apply(function(){o(i,{$event:t})})},c=angular.noop,l=null;a?c=i.$watch(a,function(e){n.cancel(l),e?l=n(function(){t.on("click tap",u)},0):t.unbind("click tap",u)}):(n.cancel(l),t.on("click tap",u)),i.$on("$destroy",function(){c(),t.unbind("click tap",u)})}}]).directive("uiOuterClick",["bindOuterClick","$parse",function(e,t){return{restrict:"A",compile:function(n,i){var r=t(i.uiOuterClick),o=i.uiOuterClickIf;return function(t,n){e(t,n,r,o)}}}}])}(),function(){"use strict";var e=angular.module("mobile-angular-ui.core.sharedState",[]);e.factory("SharedState",["$rootScope",function(e){var t={},n={},i={},r={};return{initialize:function(o,a,u){u=u||{};var c=void 0===i[o],l=u.defaultValue,s=u.exclusionGroup;i[o.$id]=i[o.$id]||[],i[o.$id].push(a),n[a]?c&&n[a].references++:(n[a]=angular.extend({},u,{references:1}),e.$broadcast("mobile-angular-ui.state.initialized."+a,l),void 0!==l&&this.setOne(a,l),s&&(r[s]=r[s]||{},r[s][a]=!0)),o.$on("$destroy",function(){for(var u=i[o.$id]||[],c=0;c<u.length;c++){var l=n[u[c]];l.exclusionGroup&&(delete r[l.exclusionGroup][u[c]],0===Object.keys(r[l.exclusionGroup]).length&&delete r[l.exclusionGroup]),l.references--,l.references<=0&&(delete n[u[c]],delete t[u[c]],e.$broadcast("mobile-angular-ui.state.destroyed."+a))}delete i[o.$id]})},setOne:function(i,r){if(void 0!==n[i]){var o=t[i];return t[i]=r,o!==r&&e.$broadcast("mobile-angular-ui.state.changed."+i,r,o),r}console&&console.warn("Warning: Attempt to set uninitialized shared state:",i)},setMany:function(e){angular.forEach(e,function(e,t){this.setOne(t,e)},this)},set:function(e,t){angular.isObject(e)&&angular.isUndefined(t)?this.setMany(e):this.setOne(e,t)},turnOn:function(e){var t=n[e]&&n[e].exclusionGroup;if(t)for(var i=Object.keys(r[t]),o=0;o<i.length;o++){var a=i[o];a!==e&&this.turnOff(a)}return this.setOne(e,!0)},turnOff:function(e){return this.setOne(e,!1)},toggle:function(e){return this.get(e)?this.turnOff(e):this.turnOn(e)},get:function(e){return n[e]&&t[e]},isActive:function(e){return!!this.get(e)},active:function(e){return this.isActive(e)},isUndefined:function(e){return void 0===n[e]||void 0===this.get(e)},has:function(e){return void 0!==n[e]},referenceCount:function(e){var t=n[e];return void 0===t?0:t.references},equals:function(e,t){return this.get(e)===t},eq:function(e,t){return this.equals(e,t)},values:function(){return t}}}]);var t=function(e,t,n,i){n=n||"click tap",t.on(n,function(t){e.$apply(function(){i(e,{$event:t})})})};e.directive("uiState",["SharedState",function(e){return{restrict:"EA",priority:601,link:function(t,n,i){var r=i.uiState||i.id,o=i.uiDefault||i["default"],a=o?t.$eval(o):void 0;e.initialize(t,r,{defaultValue:a,exclusionGroup:i.uiExclusionGroup})}}}]),angular.forEach(["toggle","turnOn","turnOff","set"],function(n){var i="ui"+n[0].toUpperCase()+n.slice(1);e.directive(i,["$parse","$interpolate","SharedState",function(e,r,o){var a=o[n];return{restrict:"A",priority:1,compile:function(u,c){var l=c[i],s=l.match(/\{\{/),d=function(t){var i=l;if(s){var o=r(i);i=o(t)}return"set"===n&&(i=e(i)(t)),i};return function(e,n,i){var r=function(){var t=d(e);return a.call(o,t)};t(e,n,i.uiTriggers,r)}}}}])});var n=function(e){if(!e||""===e)return[];for(var t=e?e.trim().split(/ *, */):[],n=[],i=0;i<t.length;i++){var r=t[i].split(/ *as */);if(r.length>2||r.length<1)throw new Error('Error parsing uiScopeContext="'+e+'"');n.push(r)}return n},i=function(e,t,n){for(var i=0;i<t.length;i++){var r=t[i][0],o=t[i][1]||r;e[o]=r.split(".").reduce(function(e,t){return e[t]},n)}},r=function(e,t,r,o,a,u){var c,l=t[e],s=l.match(/\{\{/);c=s?function(e){var t=u(l),n=a(t(r));return n(e)}:a(l);var d=n(t.uiScopeContext);return function(){var e;return d.length?(e=angular.extend({},o.values()),i(e,d,r)):e=o.values(),c(e)}};e.directive("uiIf",["$animate","SharedState","$parse","$interpolate",function(e,t,n,i){function o(e){var t=e[0],n=e[e.length-1],i=[t];do{if(t=t.nextSibling,!t)break;i.push(t)}while(t!==n);return angular.element(i)}return{multiElement:!0,transclude:"element",priority:600,terminal:!0,restrict:"A",$$tlb:!0,link:function(a,u,c,l,s){var d,f,h,m=r("uiIf",c,a,t,n,i);a.$watch(m,function(t){if(t)f||s(function(t,n){f=n,t[t.length++]=document.createComment(" end uiIf: "+c.uiIf+" "),d={clone:t},e.enter(t,u.parent(),u)});else if(h&&(h.remove(),h=null),f&&(f.$destroy(),f=null),d){h=o(d.clone);var n=function(){h=null},i=e.leave(h,n);i&&i.then(n),d=null}})}}}]),e.directive("uiHide",["$animate","SharedState","$parse","$interpolate",function(e,t,n,i){var o="ng-hide",a="ng-hide-animate";return{restrict:"A",multiElement:!0,link:function(u,c,l){var s=r("uiHide",l,u,t,n,i);u.$watch(s,function(t){e[t?"addClass":"removeClass"](c,o,{tempClasses:a})})}}}]),e.directive("uiShow",["$animate","SharedState","$parse","$interpolate",function(e,t,n){var i="ng-hide",o="ng-hide-animate";return{restrict:"A",multiElement:!0,link:function(a,u,c){var l=r("uiShow",c,a,t,n);a.$watch(l,function(t){e[t?"removeClass":"addClass"](u,i,{tempClasses:o})})}}}]),e.directive("uiClass",["SharedState","$parse","$interpolate",function(e,t){return{restrict:"A",link:function(n,i,o){var a=r("uiClass",o,n,e,t);n.$watch(a,function(e){var t="",n="";angular.forEach(e,function(e,r){e?t+=" "+r:n+=" "+r,t=t.trim(),n=n.trim(),t.length&&i.addClass(t),n.length&&i.removeClass(n)})},!0)}}}]),e.run(["$rootScope","SharedState",function(e,t){e.Ui=t}])}(),function(){"use strict";var e=angular.module("mobile-angular-ui.core.touchmoveDefaults",[]);e.directive("uiPreventTouchmoveDefaults",function(){var e=function(e){e.allowTouchmoveDefault!==!0&&e.preventDefault()};return{compile:function(t){"ontouchmove"in document&&t.on("touchmove",e)}}}),e.factory("allowTouchmoveDefault",function(){var e=function(){return!0};return"ontouchmove"in document?function(t,n){n=n||e;var i=function(e){n(e)&&(e.allowTouchmoveDefault=!0)};return t=angular.element(t),t.on("touchmove",i),t.on("$destroy",function(){t.off("touchmove",i),t=null}),function(){t&&t.off("touchmove",i)}}:angular.noop})}(),function(){"use strict";angular.module("mobile-angular-ui.core",["mobile-angular-ui.core.fastclick","mobile-angular-ui.core.activeLinks","mobile-angular-ui.core.capture","mobile-angular-ui.core.outerClick","mobile-angular-ui.core.sharedState","mobile-angular-ui.core.touchmoveDefaults"])}();
|
|
//# sourceMappingURL=mobile-angular-ui.core.min.js.map
|