Files
Pete Cooper e429b95643 Updating angular.js to 1.2.9 + back fill
Sources: http://code.angularjs.org/*

Added missing versions, fixed some files reporting as min’d but
weren’t, the sneaky varmints.

Addresses https://github.com/cdnjs/cdnjs/issues/1188 - I think. Can be
closed if it does.
2014-01-23 22:01:44 +00:00

1 line
3.2 KiB
JavaScript

function MockBrowser(){var a=this,b={},c=[];this.isMock=true;a.url="http://server";a.pollFns=[];a.xhr=function(i,e,g,h){if(angular.isFunction(g)){h=g;g=null}if(g&&angular.isObject(g)){g=angular.toJson(g)}if(g&&angular.isString(g)){e+="|"+g}var f=b[i]||{};var d=f[e];if(!d){throw {message:"Unexpected request for method '"+i+"' and url '"+e+"'.",name:"Unexpected Request"}}c.push(function(){h(d.code,d.response)})};a.xhr.expectations=b;a.xhr.requests=c;a.xhr.expect=function(g,d,f){if(f&&angular.isObject(f)){f=angular.toJson(f)}if(f&&angular.isString(f)){d+="|"+f}var e=b[g]||(b[g]={});return{respond:function(i,h){if(!angular.isNumber(i)){h=i;i=200}e[d]={code:i,response:h}}}};a.xhr.expectGET=angular.bind(a,a.xhr.expect,"GET");a.xhr.expectPOST=angular.bind(a,a.xhr.expect,"POST");a.xhr.expectDELETE=angular.bind(a,a.xhr.expect,"DELETE");a.xhr.expectPUT=angular.bind(a,a.xhr.expect,"PUT");a.xhr.expectJSON=angular.bind(a,a.xhr.expect,"JSON");a.xhr.flush=function(){while(c.length){c.pop()()}};a.cookieHash={};a.lastCookieHash={}}MockBrowser.prototype={poll:function poll(){angular.foreach(this.pollFns,function(a){a()})},addPollFn:function(a){this.pollFns.push(a);return a},hover:function(a){},getUrl:function(){return this.url},setUrl:function(a){this.url=a},cookies:function(a,b){if(a){if(b==undefined){delete this.cookieHash[a]}else{if(angular.isString(b)&&b.length<=4096){this.cookieHash[a]=b}}}else{if(!angular.equals(this.cookieHash,this.lastCookieHash)){this.lastCookieHash=angular.copy(this.cookieHash);this.cookieHash=angular.copy(this.cookieHash)}return this.cookieHash}}};angular.service("$browser",function(){return new MockBrowser()});function TzDate(e,c){if(angular.isString(c)){var a=c;c=angular.String.toDate(c).getTime();if(isNaN(c)){throw {name:"Illegal Argument",message:"Arg '"+a+"' passed into TzDate constructor is not a valid date string"}}}var d=new Date(c).getTimezoneOffset();this.offsetDiff=d*60*1000-e*1000*60*60;this.date=new Date(c+this.offsetDiff);this.getTime=function(){return this.date.getTime()-this.offsetDiff};this.toLocaleDateString=function(){return this.date.toLocaleDateString()};this.getFullYear=function(){return this.date.getFullYear()};this.getMonth=function(){return this.date.getMonth()};this.getDate=function(){return this.date.getDate()};this.getHours=function(){return this.date.getHours()};this.getMinutes=function(){return this.date.getMinutes()};this.getSeconds=function(){return this.date.getSeconds()};this.getTimezoneOffset=function(){return e*60};var b=["getDay","getMilliseconds","getTime","getUTCDate","getUTCDay","getUTCFullYear","getUTCHours","getUTCMilliseconds","getUTCMinutes","getUTCMonth","getUTCSeconds","getYear","setDate","setFullYear","setHours","setMilliseconds","setMinutes","setMonth","setSeconds","setTime","setUTCDate","setUTCFullYear","setUTCHours","setUTCMilliseconds","setUTCMinutes","setUTCMonth","setUTCSeconds","setYear","toDateString","toJSON","toGMTString","toLocaleFormat","toLocaleString","toLocaleTimeString","toSource","toString","toTimeString","toUTCString","valueOf"];angular.foreach(b,function(f){this[f]=function(){throw {name:"MethodNotImplemented",message:"Method '"+f+"' is not implemented in the TzDate mock"}}})}TzDate.prototype=Date.prototype;