diff --git a/release/frontpress.js b/release/frontpress.js index 1fdb810..c7ab986 100644 --- a/release/frontpress.js +++ b/release/frontpress.js @@ -5697,7 +5697,8 @@ function AjaxModel($http) { var promise = $http({ url: url, method: method, - params: params + params: params, + cache: true }); return promise; diff --git a/release/frontpress.min.js b/release/frontpress.min.js index b01be16..fdeb8e3 100644 --- a/release/frontpress.min.js +++ b/release/frontpress.min.js @@ -1,3 +1,3 @@ -function FrontPressConfig(e){e.errorOnUnhandledRejections(!1)}function frontpressRun(){function e(){String.prototype.format||(String.prototype.format=function(){var e=arguments;return this.replace(/{(\d+)}/g,function(t,r){return"undefined"!=typeof e[r]?e[r]:t})}),String.prototype.replaceAll||(String.prototype.replaceAll=function(e){var t=this;for(var r in e)t=t.replace(new RegExp(r,"g"),e[r]);return t}),String.prototype.getDateInfo||(String.prototype.getDateInfo=function(){var e={},t=new Date(this);return e.year=t.getFullYear(),e.month=t.getMonth()+1,e.day=("0"+t.getDate()).slice(-2),e})}function t(){Array.prototype.removeDuplicatedObjectsByField||(Array.prototype.removeDuplicatedObjectsByField=function(e){this.sort(function(t,r){return t[e]r[e]?1:0});var t=[];return this.reduce(function(r,n){return r[e]!==n[e]&&t.push(n),n},[]),t}),Array.prototype.getObjectByValue||(Array.prototype.getObjectByValue=function(e,t){return this.find(function(r){return r[e]==t})}),Array.prototype.filterToProperties||(Array.prototype.filterToProperties=function(){for(var e=[],t=0;t",controller:"HomeRouteController as vc"},o={url:r.getRoute("home.pagination"),template:"",controller:"HomeRouteController as vc"};e.state("home",n),e.state("home-pagination",o)}function configPost(e,t){t.configure.loadRoutes();var r={url:t.getRoute("post"),template:"",controller:"PostRouteController as vc"};e.state("post",r)}function AjaxModel(e){function t(t,r,n){r=r||{};var o=e({url:t,method:n,params:r});return o}function r(e,r){return t(e,r,"GET")}function n(e,r){return t(e,r,"POST")}function o(e,r){return t(e,r,"PUT")}return{get:r,post:n,put:o}}function ApiManager(e){function t(t,r){for(var n=t,o=e[r],s=0;s1){var r=e-1;s.setPrevPageNumber(r)}for(var n=1;n<=s.paginationSize;n++){var o=e+n;if(o<=s.lastPageNumber){var a={number:o};t.push(a)}}if(e":s,"":n.slug,"":t.getPath(n,"postTitle")});e.open(a,r+"-share","width=550,height=235")}var n={openShareWindow:r},o={facebook:"https://www.facebook.com/sharer/sharer.php?u=/",twitter:"https://twitter.com/intent/tweet?url=//&text=",gplus:"https://plus.google.com/share?url=//&t=",linkedin:"https://www.linkedin.com/shareArticle?url=/&title="};return n}function SlugsMapModel(e,t,r){function n(e){var t=l.get("slugs");"undefined"==typeof t&&(t=[]);var n=t.concat(e),o=r.postId;n=n.removeDuplicatedObjectsByField(o),l.put("slugs",n)}function o(){var e=l.get("slugs");return e}function s(e){var t=e.filterToProperties(u);i.addToCache(t)}function a(e,r){var n={pageSize:e,pageNumber:r},o=t.getAllPosts(n);o.then(function(e){var t=e.posts.filterToProperties(u);i.addToCache(t)}),o.catch(function(e){console.log(e)})}var i={addToCache:n,load:a,updateFromPosts:s,getCachedSlugs:o},l=e("slugsCache"),u=["slug"];return u.push(r.postId),i}function HomeDirectiveController(e,t,r,n,o,s,a,i){function l(){var e=o.getInformationPromise();e.then(function(e){var t={":siteName":e.name,":siteDescription":e.description};s.parsePageTitle("home",t)});var t=a.absUrl().replace(/\/page\/[0-9]{1,}\/?/,"");s.setPageCanonical(t)}function u(){m.pageNumber++;var e=m.pageNumber?m.pageNumber:f,t={notify:!1},o=p.vm.loadPosts(m);o.then(function(e){"v2"===n.apiVersion&&p.vm.loadExternalFeaturedImages(e)}),l(),c(m.pageNumber),r.go("home-pagination",{pageNumber:e},t)}function c(e){i.generatePaginationFromCurrentPageNumber(e)}var p=this;p.vm=t;var f=2;p.loadMorePostsAndPaginate=u,p.isInfiniteScrollDisabled=!n.infiniteScroll,s.init();var m={pageSize:n.pageSize,pageNumber:e.pageNumber?e.pageNumber:1},d=p.vm.loadPosts(m);d.then(function(e){var r=t.totalPostsNumber/n.pageSize;i.setLastPageNumber(r),c(m.pageNumber),"v2"===n.apiVersion&&p.vm.loadExternalFeaturedImages(e)}),l()}function HomeRouteController(){}function PostDirectiveController(e,t,r,n,o,s,a,i,l){var u=this;u.vm=e;var c,p,f=t.postSlug,m=n.getCachedSlugs(),d=a.postId[0],g=m&&m.getObjectByValue("slug",f)?m.getObjectByValue("slug",f):void 0;t.postId?(p=t.postId,c=e.loadFullPostById(p)):!t.postId&&g?(p=g[d],c=e.loadFullPostById(p)):f?c=e.loadFullPostBySlug(f):console.error("Error: [$FrontPress configuration error: empty id and slug for post route.] You should provide :postSlug or :postId as route parameter.");var v=i.getInformationPromise();r.init();var h=[c,v];l.all(h).then(function(t){var n=t[0],o=t[1],a=s.getPath(n,"postTitle"),i=s.getPath(n,"postDate").getDateInfo(),l={":postTitle":a,":year":i.year,":month":i.month,":day":i.day,":siteName":o.name,":siteDescription":o.description};r.parsePageTitle("post",l),u.disqusId=e.slug}),l.all(h).catch(function(e){console.error(e)})}function PostRouteController(){}function BlogApi(e,t){function r(){return e.get(n)}var n=t.restApiUrl,o={getBlogInformation:r};return o}function CategoriesApi(e,t,r){function n(t){var n=s,o=r.parse(t);return e.get(n,o)}function o(t,r){var n=s+"";return n=n.replace("",t),e.get(n,r)}var s=t.restApiUrl+"/wp/v2/categories/";return{getAllCategories:n,getCategoryById:o}}function MediaApi(e,t,r){function n(t,r){var n=o+"";return n=n.replace("",t),e.get(n,r)}var o=t.restApiUrl+"/wp/v2/media/";return{getMediaById:n}}function PostsApi(e,t,r){function n(t){var n=a+"?_envelope",o=r.parse(t);return e.get(n,o)}function o(t,r){var n=a+'?filter[name]=""';return n=n.replace("",t),e.get(n,r)}function s(t,r){var n=a+"";return n=n.replace("",t),e.get(n,r)}var a=t.restApiUrl+"/wp/v2/posts/";return{getAllPosts:n,getPostBySlug:o,getPostById:s}}function TagsApi(e,t,r){function n(t){var n=s,o=r.parse(t);return e.get(n,o)}function o(t,r){var n=s+"";return n=n.replace("",t),e.get(n,r)}var s=t.restApiUrl+"/wp/v2/tags/";return{getAllTags:n,getTagById:o}}"undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports="ui.router"),function(e,t,r){"use strict";function n(e,t){return _(new(_(function(){},{prototype:e})),t)}function o(e){return B(arguments,function(t){t!==e&&B(t,function(t,r){e.hasOwnProperty(r)||(e[r]=t)})}),e}function s(e,t){var r=[];for(var n in e.path){if(e.path[n]!==t.path[n])break;r.push(e.path[n])}return r}function a(e){if(Object.keys)return Object.keys(e);var t=[];return B(e,function(e,r){t.push(r)}),t}function i(e,t){if(Array.prototype.indexOf)return e.indexOf(t,Number(arguments[2])||0);var r=e.length>>>0,n=Number(arguments[2])||0;for(n=n<0?Math.ceil(n):Math.floor(n),n<0&&(n+=r);n=0||(c.push(o[f]),u[o[f]]=e[o[f]]);return _({},u,t)}function u(e,t,r){if(!r){r=[];for(var n in e)r.push(n)}for(var o=0;o "));if($[r]=n,R(e))v.push(r,[function(){return t.get(e)}],u);else{var o=t.annotate(e);B(o,function(e){e!==r&&l.hasOwnProperty(e)&&m(l[e],e)}),v.push(r,e,o)}h.pop(),$[r]=s}}function d(e){return H(e)&&e.then&&e.$$promises}if(!H(l))throw new Error("'invocables' must be an object");var g=a(l||{}),v=[],h=[],$={};return B(l,m),l=h=$=null,function(n,s,a){function i(){--y||(w||o(P,s.$$values),h.$$values=P,h.$$promises=h.$$promises||!0,delete h.$$inheritedValues,m.resolve(P))}function l(e){h.$$failure=e,m.reject(e)}function u(r,o,s){function u(e){p.reject(e),l(e)}function c(){if(!O(h.$$failure))try{p.resolve(t.invoke(o,a,P)),p.promise.then(function(e){P[r]=e,i()},u)}catch(e){u(e)}}var p=e.defer(),f=0;B(s,function(e){$.hasOwnProperty(e)&&!n.hasOwnProperty(e)&&(f++,$[e].then(function(t){P[e]=t,--f||c()},u))}),f||c(),$[r]=p.promise}if(d(n)&&a===r&&(a=s,s=n,n=null),n){if(!H(n))throw new Error("'locals' must be an object")}else n=c;if(s){if(!d(s))throw new Error("'parent' must be a promise returned by $resolve.resolve()")}else s=p;var m=e.defer(),h=m.promise,$=h.$$promises={},P=_({},n),y=1+v.length/3,w=!1;if(O(s.$$failure))return l(s.$$failure),h;s.$$inheritedValues&&o(P,f(s.$$inheritedValues,g)),_($,s.$$promises),s.$$values?(w=o(P,f(s.$$values,g)),h.$$inheritedValues=f(s.$$values,g),i()):(s.$$inheritedValues&&(h.$$inheritedValues=f(s.$$inheritedValues,g)),s.then(i,l));for(var b=0,C=v.length;b=0));)$=s(h.id,h.type,h.cfg,"path"),p+=a(h.segment,$.type.pattern.source,$.squash,$.isOptional),m.push(h.segment),f=u.lastIndex;P=e.substring(f);var y=P.indexOf("?");if(y>=0){var w=this.sourceSearch=P.substring(y);if(P=P.substring(0,y),this.sourcePath=e.substring(0,f+y),w.length>0)for(f=0;l=c.exec(w);)h=i(l,!0),$=s(h.id,h.type,h.cfg,"search"),f=u.lastIndex}else this.sourcePath=e,this.sourceSearch="";p+=a(P)+(t.strict===!1?"/?":"")+"$",m.push(P),this.regexp=new RegExp(p,t.caseInsensitive?"i":r),this.prefix=m[0],this.$$paramNames=v}function P(e){_(this,e)}function y(){function e(e){return null!=e?e.toString().replace(/(~|\/)/g,function(e){return{"~":"~~","/":"~2F"}[e]}):e}function o(e){return null!=e?e.toString().replace(/(~~|~2F)/g,function(e){return{"~~":"~","~2F":"/"}[e]}):e}function s(){return{strict:g,caseInsensitive:f}}function l(e){return k(e)||V(e)&&k(e[e.length-1])}function u(){for(;b.length;){var e=b.shift();if(e.pattern)throw new Error("You cannot override a type's .pattern at runtime.");t.extend(h[e.name],p.invoke(e.def))}}function c(e){_(this,e||{})}Y=this;var p,f=!1,g=!0,v=!1,h={},w=!0,b=[],C={string:{encode:e,decode:o,is:function(e){return null==e||!O(e)||"string"==typeof e},pattern:/[^\/]*/},int:{encode:e,decode:function(e){return parseInt(e,10)},is:function(e){return O(e)&&this.decode(e.toString())===e},pattern:/\d+/},bool:{encode:function(e){return e?1:0},decode:function(e){return 0!==parseInt(e,10)},is:function(e){return e===!0||e===!1},pattern:/0|1/},date:{encode:function(e){return this.is(e)?[e.getFullYear(),("0"+(e.getMonth()+1)).slice(-2),("0"+e.getDate()).slice(-2)].join("-"):r},decode:function(e){if(this.is(e))return e;var t=this.capture.exec(e);return t?new Date(t[1],t[2]-1,t[3]):r},is:function(e){return e instanceof Date&&!isNaN(e.valueOf())},equals:function(e,t){return this.is(e)&&this.is(t)&&e.toISOString()===t.toISOString()},pattern:/[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,capture:/([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/},json:{encode:t.toJson,decode:t.fromJson,is:t.isObject,equals:t.equals,pattern:/[^\/]*/},any:{encode:t.identity,decode:t.identity,equals:t.equals,pattern:/.*/}};y.$$getDefaultValue=function(e){if(!l(e.value))return e.value;if(!p)throw new Error("Injectable functions cannot be called at configuration time");return p.invoke(e.value)},this.caseInsensitive=function(e){return O(e)&&(f=e),f},this.strictMode=function(e){return O(e)&&(g=e),g},this.defaultSquashPolicy=function(e){if(!O(e))return v;if(e!==!0&&e!==!1&&!R(e))throw new Error("Invalid squash policy: "+e+". Valid policies: false, true, arbitrary-string");return v=e,e},this.compile=function(e,t){return new $(e,_(s(),t))},this.isMatcher=function(e){if(!H(e))return!1;var t=!0;return B($.prototype,function(r,n){k(r)&&(t=t&&O(e[n])&&k(e[n]))}),t},this.type=function(e,t,r){if(!O(t))return h[e];if(h.hasOwnProperty(e))throw new Error("A type named '"+e+"' has already been defined.");return h[e]=new P(_({name:e},t)),r&&(b.push({name:e,def:r}),w||u()),this},B(C,function(e,t){h[t]=new P(_({name:t},e))}),h=n(h,{}),this.$get=["$injector",function(e){return p=e,w=!1,u(),B(C,function(e,t){h[t]||(h[t]=new P(e))}),this}],this.Param=function(e,n,o,s){function u(e){var t=H(e)?a(e):[],r=i(t,"value")===-1&&i(t,"type")===-1&&i(t,"squash")===-1&&i(t,"array")===-1;return r&&(e={value:e}),e.$$fn=l(e.value)?e.value:function(){return e.value},e}function c(r,n,o){if(r.type&&n)throw new Error("Param '"+e+"' has two type configurations.");return n?n:r.type?t.isString(r.type)?h[r.type]:r.type instanceof P?r.type:new P(r.type):"config"===o?h.any:h.string}function f(){var t={array:"search"===s&&"auto"},r=e.match(/\[\]$/)?{array:!0}:{};return _(t,r,o).array}function g(e,t){var r=e.squash;if(!t||r===!1)return!1;if(!O(r)||null==r)return v;if(r===!0||R(r))return r;throw new Error("Invalid squash policy: '"+r+"'. Valid policies: false, true, or arbitrary string")}function $(e,t,n,o){var s,a,l=[{from:"",to:n||t?r:""},{from:null,to:n||t?r:""}];return s=V(e.replace)?e.replace:[],R(o)&&s.push({from:o,to:r}),a=d(s,function(e){return e.from}),m(l,function(e){return i(a,e.from)===-1}).concat(s)}function y(){if(!p)throw new Error("Injectable functions cannot be called at configuration time");var e=p.invoke(o.$$fn);if(null!==e&&e!==r&&!C.type.is(e))throw new Error("Default value ("+e+") for parameter '"+C.id+"' is not an instance of Type ("+C.type.name+")");return e}function w(e){function t(e){return function(t){return t.from===e}}function r(e){var r=d(m(C.replace,t(e)),function(e){return e.to});return r.length?r[0]:e}return e=r(e),O(e)?C.type.$normalize(e):y()}function b(){return"{Param:"+e+" "+n+" squash: '"+j+"' optional: "+S+"}"}var C=this;o=u(o),n=c(o,n,s);var A=f();n=A?n.$asArray(A,"search"===s):n,"string"!==n.name||A||"path"!==s||o.value!==r||(o.value="");var S=o.value!==r,j=g(o,S),D=$(o,A,S,j);_(this,{id:e,type:n,location:s,array:A,squash:j,replace:D,isOptional:S,value:w,dynamic:r,config:o,toString:b})},c.prototype={$$new:function(){return n(this,_(new c,{$$parent:this}))},$$keys:function(){for(var e=[],t=[],r=this,n=a(c.prototype);r;)t.push(r),r=r.$$parent;return t.reverse(),B(t,function(t){B(a(t),function(t){i(e,t)===-1&&i(n,t)===-1&&e.push(t)})}),e},$$values:function(e){var t={},r=this;return B(r.$$keys(),function(n){t[n]=r[n].value(e&&e[n])}),t},$$equals:function(e,t){var r=!0,n=this;return B(n.$$keys(),function(o){var s=e&&e[o],a=t&&t[o];n[o].type.equals(s,a)||(r=!1)}),r},$$validates:function(e){var n,o,s,a,i,l=this.$$keys();for(n=0;nr[e]?1:0});var t=[];return this.reduce(function(r,n){return r[e]!==n[e]&&t.push(n),n},[]),t}),Array.prototype.getObjectByValue||(Array.prototype.getObjectByValue=function(e,t){return this.find(function(r){return r[e]==t})}),Array.prototype.filterToProperties||(Array.prototype.filterToProperties=function(){for(var e=[],t=0;t",controller:"HomeRouteController as vc"},o={url:r.getRoute("home.pagination"),template:"",controller:"HomeRouteController as vc"};e.state("home",n),e.state("home-pagination",o)}function configPost(e,t){t.configure.loadRoutes();var r={url:t.getRoute("post"),template:"",controller:"PostRouteController as vc"};e.state("post",r)}function AjaxModel(e){function t(t,r,n){r=r||{};var o=e({url:t,method:n,params:r,cache:!0});return o}function r(e,r){return t(e,r,"GET")}function n(e,r){return t(e,r,"POST")}function o(e,r){return t(e,r,"PUT")}return{get:r,post:n,put:o}}function ApiManager(e){function t(t,r){for(var n=t,o=e[r],s=0;s1){var r=e-1;s.setPrevPageNumber(r)}for(var n=1;n<=s.paginationSize;n++){var o=e+n;if(o<=s.lastPageNumber){var a={number:o};t.push(a)}}if(e":s,"":n.slug,"":t.getPath(n,"postTitle")});e.open(a,r+"-share","width=550,height=235")}var n={openShareWindow:r},o={facebook:"https://www.facebook.com/sharer/sharer.php?u=/",twitter:"https://twitter.com/intent/tweet?url=//&text=",gplus:"https://plus.google.com/share?url=//&t=",linkedin:"https://www.linkedin.com/shareArticle?url=/&title="};return n}function SlugsMapModel(e,t,r){function n(e){var t=l.get("slugs");"undefined"==typeof t&&(t=[]);var n=t.concat(e),o=r.postId;n=n.removeDuplicatedObjectsByField(o),l.put("slugs",n)}function o(){var e=l.get("slugs");return e}function s(e){var t=e.filterToProperties(u);i.addToCache(t)}function a(e,r){var n={pageSize:e,pageNumber:r},o=t.getAllPosts(n);o.then(function(e){var t=e.posts.filterToProperties(u);i.addToCache(t)}),o.catch(function(e){console.log(e)})}var i={addToCache:n,load:a,updateFromPosts:s,getCachedSlugs:o},l=e("slugsCache"),u=["slug"];return u.push(r.postId),i}function HomeDirectiveController(e,t,r,n,o,s,a,i){function l(){var e=o.getInformationPromise();e.then(function(e){var t={":siteName":e.name,":siteDescription":e.description};s.parsePageTitle("home",t)});var t=a.absUrl().replace(/\/page\/[0-9]{1,}\/?/,"");s.setPageCanonical(t)}function u(){m.pageNumber++;var e=m.pageNumber?m.pageNumber:f,t={notify:!1},o=p.vm.loadPosts(m);o.then(function(e){"v2"===n.apiVersion&&p.vm.loadExternalFeaturedImages(e)}),l(),c(m.pageNumber),r.go("home-pagination",{pageNumber:e},t)}function c(e){i.generatePaginationFromCurrentPageNumber(e)}var p=this;p.vm=t;var f=2;p.loadMorePostsAndPaginate=u,p.isInfiniteScrollDisabled=!n.infiniteScroll,s.init();var m={pageSize:n.pageSize,pageNumber:e.pageNumber?e.pageNumber:1},d=p.vm.loadPosts(m);d.then(function(e){var r=t.totalPostsNumber/n.pageSize;i.setLastPageNumber(r),c(m.pageNumber),"v2"===n.apiVersion&&p.vm.loadExternalFeaturedImages(e)}),l()}function HomeRouteController(){}function PostDirectiveController(e,t,r,n,o,s,a,i,l){var u=this;u.vm=e;var c,p,f=t.postSlug,m=n.getCachedSlugs(),d=a.postId[0],g=m&&m.getObjectByValue("slug",f)?m.getObjectByValue("slug",f):void 0;t.postId?(p=t.postId,c=e.loadFullPostById(p)):!t.postId&&g?(p=g[d],c=e.loadFullPostById(p)):f?c=e.loadFullPostBySlug(f):console.error("Error: [$FrontPress configuration error: empty id and slug for post route.] You should provide :postSlug or :postId as route parameter.");var v=i.getInformationPromise();r.init();var h=[c,v];l.all(h).then(function(t){var n=t[0],o=t[1],a=s.getPath(n,"postTitle"),i=s.getPath(n,"postDate").getDateInfo(),l={":postTitle":a,":year":i.year,":month":i.month,":day":i.day,":siteName":o.name,":siteDescription":o.description};r.parsePageTitle("post",l),u.disqusId=e.slug}),l.all(h).catch(function(e){console.error(e)})}function PostRouteController(){}function BlogApi(e,t){function r(){return e.get(n)}var n=t.restApiUrl,o={getBlogInformation:r};return o}function CategoriesApi(e,t,r){function n(t){var n=s,o=r.parse(t);return e.get(n,o)}function o(t,r){var n=s+"";return n=n.replace("",t),e.get(n,r)}var s=t.restApiUrl+"/wp/v2/categories/";return{getAllCategories:n,getCategoryById:o}}function MediaApi(e,t,r){function n(t,r){var n=o+"";return n=n.replace("",t),e.get(n,r)}var o=t.restApiUrl+"/wp/v2/media/";return{getMediaById:n}}function PostsApi(e,t,r){function n(t){var n=a+"?_envelope",o=r.parse(t);return e.get(n,o)}function o(t,r){var n=a+'?filter[name]=""';return n=n.replace("",t),e.get(n,r)}function s(t,r){var n=a+"";return n=n.replace("",t),e.get(n,r)}var a=t.restApiUrl+"/wp/v2/posts/";return{getAllPosts:n,getPostBySlug:o,getPostById:s}}function TagsApi(e,t,r){function n(t){var n=s,o=r.parse(t);return e.get(n,o)}function o(t,r){var n=s+"";return n=n.replace("",t),e.get(n,r)}var s=t.restApiUrl+"/wp/v2/tags/";return{getAllTags:n,getTagById:o}}"undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports="ui.router"),function(e,t,r){"use strict";function n(e,t){return _(new(_(function(){},{prototype:e})),t)}function o(e){return B(arguments,function(t){t!==e&&B(t,function(t,r){e.hasOwnProperty(r)||(e[r]=t)})}),e}function s(e,t){var r=[];for(var n in e.path){if(e.path[n]!==t.path[n])break;r.push(e.path[n])}return r}function a(e){if(Object.keys)return Object.keys(e);var t=[];return B(e,function(e,r){t.push(r)}),t}function i(e,t){if(Array.prototype.indexOf)return e.indexOf(t,Number(arguments[2])||0);var r=e.length>>>0,n=Number(arguments[2])||0;for(n=n<0?Math.ceil(n):Math.floor(n),n<0&&(n+=r);n=0||(c.push(o[f]),u[o[f]]=e[o[f]]);return _({},u,t)}function u(e,t,r){if(!r){r=[];for(var n in e)r.push(n)}for(var o=0;o "));if($[r]=n,R(e))v.push(r,[function(){return t.get(e)}],u);else{var o=t.annotate(e);B(o,function(e){e!==r&&l.hasOwnProperty(e)&&m(l[e],e)}),v.push(r,e,o)}h.pop(),$[r]=s}}function d(e){return H(e)&&e.then&&e.$$promises}if(!H(l))throw new Error("'invocables' must be an object");var g=a(l||{}),v=[],h=[],$={};return B(l,m),l=h=$=null,function(n,s,a){function i(){--y||(w||o(P,s.$$values),h.$$values=P,h.$$promises=h.$$promises||!0,delete h.$$inheritedValues,m.resolve(P))}function l(e){h.$$failure=e,m.reject(e)}function u(r,o,s){function u(e){p.reject(e),l(e)}function c(){if(!O(h.$$failure))try{p.resolve(t.invoke(o,a,P)),p.promise.then(function(e){P[r]=e,i()},u)}catch(e){u(e)}}var p=e.defer(),f=0;B(s,function(e){$.hasOwnProperty(e)&&!n.hasOwnProperty(e)&&(f++,$[e].then(function(t){P[e]=t,--f||c()},u))}),f||c(),$[r]=p.promise}if(d(n)&&a===r&&(a=s,s=n,n=null),n){if(!H(n))throw new Error("'locals' must be an object")}else n=c;if(s){if(!d(s))throw new Error("'parent' must be a promise returned by $resolve.resolve()")}else s=p;var m=e.defer(),h=m.promise,$=h.$$promises={},P=_({},n),y=1+v.length/3,w=!1;if(O(s.$$failure))return l(s.$$failure),h;s.$$inheritedValues&&o(P,f(s.$$inheritedValues,g)),_($,s.$$promises),s.$$values?(w=o(P,f(s.$$values,g)),h.$$inheritedValues=f(s.$$values,g),i()):(s.$$inheritedValues&&(h.$$inheritedValues=f(s.$$inheritedValues,g)),s.then(i,l));for(var b=0,C=v.length;b=0));)$=s(h.id,h.type,h.cfg,"path"),p+=a(h.segment,$.type.pattern.source,$.squash,$.isOptional),m.push(h.segment),f=u.lastIndex;P=e.substring(f);var y=P.indexOf("?");if(y>=0){var w=this.sourceSearch=P.substring(y);if(P=P.substring(0,y),this.sourcePath=e.substring(0,f+y),w.length>0)for(f=0;l=c.exec(w);)h=i(l,!0),$=s(h.id,h.type,h.cfg,"search"),f=u.lastIndex}else this.sourcePath=e,this.sourceSearch="";p+=a(P)+(t.strict===!1?"/?":"")+"$",m.push(P),this.regexp=new RegExp(p,t.caseInsensitive?"i":r),this.prefix=m[0],this.$$paramNames=v}function P(e){_(this,e)}function y(){function e(e){return null!=e?e.toString().replace(/(~|\/)/g,function(e){return{"~":"~~","/":"~2F"}[e]}):e}function o(e){return null!=e?e.toString().replace(/(~~|~2F)/g,function(e){return{"~~":"~","~2F":"/"}[e]}):e}function s(){return{strict:g,caseInsensitive:f}}function l(e){return k(e)||V(e)&&k(e[e.length-1])}function u(){for(;b.length;){var e=b.shift();if(e.pattern)throw new Error("You cannot override a type's .pattern at runtime.");t.extend(h[e.name],p.invoke(e.def))}}function c(e){_(this,e||{})}Y=this;var p,f=!1,g=!0,v=!1,h={},w=!0,b=[],C={string:{encode:e,decode:o,is:function(e){return null==e||!O(e)||"string"==typeof e},pattern:/[^\/]*/},int:{encode:e,decode:function(e){return parseInt(e,10)},is:function(e){return O(e)&&this.decode(e.toString())===e},pattern:/\d+/},bool:{encode:function(e){return e?1:0},decode:function(e){return 0!==parseInt(e,10)},is:function(e){return e===!0||e===!1},pattern:/0|1/},date:{encode:function(e){return this.is(e)?[e.getFullYear(),("0"+(e.getMonth()+1)).slice(-2),("0"+e.getDate()).slice(-2)].join("-"):r},decode:function(e){if(this.is(e))return e;var t=this.capture.exec(e);return t?new Date(t[1],t[2]-1,t[3]):r},is:function(e){return e instanceof Date&&!isNaN(e.valueOf())},equals:function(e,t){return this.is(e)&&this.is(t)&&e.toISOString()===t.toISOString()},pattern:/[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,capture:/([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/},json:{encode:t.toJson,decode:t.fromJson,is:t.isObject,equals:t.equals,pattern:/[^\/]*/},any:{encode:t.identity,decode:t.identity,equals:t.equals,pattern:/.*/}};y.$$getDefaultValue=function(e){if(!l(e.value))return e.value;if(!p)throw new Error("Injectable functions cannot be called at configuration time");return p.invoke(e.value)},this.caseInsensitive=function(e){return O(e)&&(f=e),f},this.strictMode=function(e){return O(e)&&(g=e),g},this.defaultSquashPolicy=function(e){if(!O(e))return v;if(e!==!0&&e!==!1&&!R(e))throw new Error("Invalid squash policy: "+e+". Valid policies: false, true, arbitrary-string");return v=e,e},this.compile=function(e,t){return new $(e,_(s(),t))},this.isMatcher=function(e){if(!H(e))return!1;var t=!0;return B($.prototype,function(r,n){k(r)&&(t=t&&O(e[n])&&k(e[n]))}),t},this.type=function(e,t,r){if(!O(t))return h[e];if(h.hasOwnProperty(e))throw new Error("A type named '"+e+"' has already been defined.");return h[e]=new P(_({name:e},t)),r&&(b.push({name:e,def:r}),w||u()),this},B(C,function(e,t){h[t]=new P(_({name:t},e))}),h=n(h,{}),this.$get=["$injector",function(e){return p=e,w=!1,u(),B(C,function(e,t){h[t]||(h[t]=new P(e))}),this}],this.Param=function(e,n,o,s){function u(e){var t=H(e)?a(e):[],r=i(t,"value")===-1&&i(t,"type")===-1&&i(t,"squash")===-1&&i(t,"array")===-1;return r&&(e={value:e}),e.$$fn=l(e.value)?e.value:function(){return e.value},e}function c(r,n,o){if(r.type&&n)throw new Error("Param '"+e+"' has two type configurations.");return n?n:r.type?t.isString(r.type)?h[r.type]:r.type instanceof P?r.type:new P(r.type):"config"===o?h.any:h.string}function f(){var t={array:"search"===s&&"auto"},r=e.match(/\[\]$/)?{array:!0}:{};return _(t,r,o).array}function g(e,t){var r=e.squash;if(!t||r===!1)return!1;if(!O(r)||null==r)return v;if(r===!0||R(r))return r;throw new Error("Invalid squash policy: '"+r+"'. Valid policies: false, true, or arbitrary string")}function $(e,t,n,o){var s,a,l=[{from:"",to:n||t?r:""},{from:null,to:n||t?r:""}];return s=V(e.replace)?e.replace:[],R(o)&&s.push({from:o,to:r}),a=d(s,function(e){return e.from}),m(l,function(e){return i(a,e.from)===-1}).concat(s)}function y(){if(!p)throw new Error("Injectable functions cannot be called at configuration time");var e=p.invoke(o.$$fn);if(null!==e&&e!==r&&!C.type.is(e))throw new Error("Default value ("+e+") for parameter '"+C.id+"' is not an instance of Type ("+C.type.name+")");return e}function w(e){function t(e){return function(t){return t.from===e}}function r(e){var r=d(m(C.replace,t(e)),function(e){return e.to});return r.length?r[0]:e}return e=r(e),O(e)?C.type.$normalize(e):y()}function b(){return"{Param:"+e+" "+n+" squash: '"+j+"' optional: "+S+"}"}var C=this;o=u(o),n=c(o,n,s);var A=f();n=A?n.$asArray(A,"search"===s):n,"string"!==n.name||A||"path"!==s||o.value!==r||(o.value="");var S=o.value!==r,j=g(o,S),D=$(o,A,S,j);_(this,{id:e,type:n,location:s,array:A,squash:j,replace:D,isOptional:S,value:w,dynamic:r,config:o,toString:b})},c.prototype={$$new:function(){return n(this,_(new c,{$$parent:this}))},$$keys:function(){for(var e=[],t=[],r=this,n=a(c.prototype);r;)t.push(r),r=r.$$parent;return t.reverse(),B(t,function(t){B(a(t),function(t){i(e,t)===-1&&i(n,t)===-1&&e.push(t)})}),e},$$values:function(e){var t={},r=this;return B(r.$$keys(),function(n){t[n]=r[n].value(e&&e[n])}),t},$$equals:function(e,t){var r=!0,n=this;return B(n.$$keys(),function(o){var s=e&&e[o],a=t&&t[o];n[o].type.equals(s,a)||(r=!1)}),r},$$validates:function(e){var n,o,s,a,i,l=this.$$keys();for(n=0;n=0)throw new Error("State must have a valid name");if(j.hasOwnProperty(r))throw new Error("State '"+r+"' is already defined");var o=r.indexOf(".")!==-1?r.substring(0,r.lastIndexOf(".")):R(t.parent)?t.parent:H(t.parent)&&R(t.parent.name)?t.parent.name:"";if(o&&!j[o])return m(o,t.self);for(var s in T)k(T[s])&&(t[s]=T[s](t,T.$delegates[s]));return j[r]=t,!t[F]&&t.url&&e.when(t.url,["$match","$stateParams",function(e,r){S.$current.navigable==t&&u(e,r)||S.transitionTo(t,e,{inherit:!0,location:!1})}]),v(r),t}function $(e){return e.indexOf("*")>-1}function P(e){for(var t=e.split("."),r=S.$current.name.split("."),n=0,o=t.length;n=j;n--)a=d[n],a.self.onExit&&i.invoke(a.self.onExit,a.self,a.locals.globals),a.locals=null;for(n=j;n2?c.enter(e,null,r).then(n):c.enter(e,null,r,n)},leave:function(e,r){t.version.minor>2?c.leave(e).then(r):c.leave(e,r)}};if(u){var o=u&&u(r,e);return{enter:function(e,t,r){o.enter(e,null,t),r()},leave:function(e,t){o.leave(e),t()}}}return n()}var l=a(),u=l("$animator"),c=l("$animate"),p={restrict:"ECA",terminal:!0,priority:400,transclude:"element",compile:function(r,a,l){return function(r,a,u){function c(){if(f&&(f.remove(),f=null),d&&(d.$destroy(),d=null),m){var e=m.data("$uiViewAnim");$.leave(m,function(){e.$$animLeave.resolve(),f=null}),f=m,m=null}}function p(i){var p,f=D(r,u,a,o),P=f&&e.$current&&e.$current.locals[f];if(i||P!==g){p=r.$new(),g=e.$current.locals[f],p.$emit("$viewContentLoading",f);var y=l(p,function(e){var o=s.defer(),i=s.defer(),l={$animEnter:o.promise,$animLeave:i.promise,$$animLeave:i};e.data("$uiViewAnim",l),$.enter(e,a,function(){o.resolve(),d&&d.$emit("$viewContentAnimationEnded"),(t.isDefined(h)&&!h||r.$eval(h))&&n(e)}),c()});m=y,d=p,d.$emit("$viewContentLoaded",f),d.$eval(v)}}var f,m,d,g,v=u.onload||"",h=u.autoscroll,$=i(u,r);a.inheritedData("$uiView");r.$on("$stateChangeSuccess",function(){p(!1)}),p(!0)}}};return p}function j(e,r,n,o){return{restrict:"ECA",priority:-400,compile:function(s){var a=s.html();return function(s,i,l){var u=n.$current,c=D(s,l,i,o),p=u&&u.locals[c];if(p){i.data("$uiView",{name:c,state:p.$$state}),i.html(p.$template?p.$template:a);var f=t.extend({},p);s[p.$$resolveAs]=f;var m=e(i.contents());if(p.$$controller){p.$scope=s,p.$element=i;var d=r(p.$$controller,p);p.$$controllerAs&&(s[p.$$controllerAs]=d,s[p.$$controllerAs][p.$$resolveAs]=f),k(d.$onInit)&&d.$onInit(),i.data("$ngControllerController",d),i.children().data("$ngControllerController",d)}m(s)}}}}}function D(e,t,r,n){var o=n(t.uiView||t.name||"")(e),s=r.inheritedData("$uiView");return o.indexOf("@")>=0?o:o+"@"+(s?s.state.name:"")}function F(e,t){var r,n=e.match(/^\s*({[^}]*})\s*$/);if(n&&(e=t+"("+n[1]+")"),r=e.replace(/\n/g," ").match(/^([^(]+?)\s*(\((.*)\))?$/),!r||4!==r.length)throw new Error("Invalid state ref '"+e+"'");return{state:r[1],paramExpr:r[3]||null}}function T(e){var t=e.parent().inheritedData("$uiView");if(t&&t.state&&t.state.name)return t.state}function x(e){var t="[object SVGAnimatedString]"===Object.prototype.toString.call(e.prop("href")),r="FORM"===e[0].nodeName;return{attr:r?"action":t?"xlink:href":"href",isAnchor:"A"===e.prop("tagName").toUpperCase(),clickable:!r}}function I(e,t,r,n,o){return function(s){var a=s.which||s.button,i=o();if(!(a>1||s.ctrlKey||s.metaKey||s.shiftKey||e.attr("target"))){var l=r(function(){t.go(i.state,i.params,i.options)});s.preventDefault();var u=n.isAnchor&&!i.href?1:0;s.preventDefault=function(){u--<=0&&r.cancel(l)}}}}function M(e,t){return{relative:T(e)||t.$current,inherit:!0}}function N(e,r){return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(n,o,s,a){var i,l=F(s.uiSref,e.current.name),u={state:l.state,href:null,params:null},c=x(o),p=a[1]||a[0],f=null;u.options=_(M(o,e),s.uiSrefOpts?n.$eval(s.uiSrefOpts):{});var m=function(r){r&&(u.params=t.copy(r)),u.href=e.href(l.state,u.params,u.options),f&&f(),p&&(f=p.$$addStateInfo(l.state,u.params)),null!==u.href&&s.$set(c.attr,u.href)};l.paramExpr&&(n.$watch(l.paramExpr,function(e){e!==u.params&&m(e)},!0),u.params=t.copy(n.$eval(l.paramExpr))),m(),c.clickable&&(i=I(o,e,r,c,function(){return u}),o[o.on?"on":"bind"]("click",i),n.$on("$destroy",function(){o[o.off?"off":"unbind"]("click",i)}))}}}function E(e,t){return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(r,n,o,s){function a(t){f.state=t[0],f.params=t[1],f.options=t[2],f.href=e.href(f.state,f.params,f.options),m&&m(),u&&(m=u.$$addStateInfo(f.state,f.params)),f.href&&o.$set(l.attr,f.href)}var i,l=x(n),u=s[1]||s[0],c=[o.uiState,o.uiStateParams||null,o.uiStateOpts||null],p="["+c.map(function(e){return e||"null"}).join(", ")+"]",f={state:null,params:null,options:null,href:null},m=null;r.$watch(p,a,!0),a(r.$eval(p)),l.clickable&&(i=I(n,e,t,l,function(){return f}),n[n.on?"on":"bind"]("click",i),r.$on("$destroy",function(){n[n.off?"off":"unbind"]("click",i)}))}}}function L(e,t,r){return{restrict:"A",controller:["$scope","$element","$attrs","$timeout",function(t,n,o,s){function a(t,r,o){var s=e.get(t,T(n)),a=i(t,r),l={state:s||{name:t},params:r,hash:a};return g.push(l),v[a]=o,function(){var e=g.indexOf(l);e!==-1&&g.splice(e,1)}}function i(e,r){if(!R(e))throw new Error("state should be a string");return H(r)?e+G(r):(r=t.$eval(r),H(r)?e+G(r):e)}function l(){for(var e=0;e0)){var r=a(e,t,d);return l(),r}},t.$on("$stateChangeSuccess",l),l()}]}}function U(e){var t=function(t,r){return e.is(t,r)};return t.$stateful=!0,t}function q(e){var t=function(t,r,n){return e.includes(t,r,n)};return t.$stateful=!0,t}var O=t.isDefined,k=t.isFunction,R=t.isString,H=t.isObject,V=t.isArray,B=t.forEach,_=t.extend,z=t.copy,G=t.toJson;t.module("ui.router.util",["ng"]),t.module("ui.router.router",["ui.router.util"]),t.module("ui.router.state",["ui.router.router","ui.router.util"]),t.module("ui.router",["ui.router.state"]),t.module("ui.router.compat",["ui.router"]),v.$inject=["$q","$injector"],t.module("ui.router.util").service("$resolve",v),h.$inject=["$http","$templateCache","$injector"],t.module("ui.router.util").service("$templateFactory",h);var Y;$.prototype.concat=function(e,t){var r={caseInsensitive:Y.caseInsensitive(),strict:Y.strictMode(),squash:Y.defaultSquashPolicy()};return new $(this.sourcePath+e+this.sourceSearch,_(r,t),this)},$.prototype.toString=function(){return this.source},$.prototype.exec=function(e,t){function r(e){function t(e){return e.split("").reverse().join("")}function r(e){return e.replace(/\\-/g,"-")}var n=t(e).split(/-(?!\\)/),o=d(n,t);return d(o,r).reverse()}var n=this.regexp.exec(e);if(!n)return null;t=t||{};var o,s,a,i=this.parameters(),l=i.length,u=this.segments.length-1,c={};if(u!==n.length-1)throw new Error("Unbalanced capture group in route '"+this.source+"'");var p,f;for(o=0;o0&&(t.disqus_config=function(){this.page.remote_auth_s3=s.remote_auth_s3,this.page.api_key=s.api_key})}function u(){var r=t.DISQUSWIDGETS;r&&e.isFunction(r.getCount)&&r.getCount()}function c(e,r,n){var s=o();t.DISQUS.reset({reload:!0,config:function(){this.page.identifier=r,this.page.url=e.absUrl(),this.page.title=n,this.page.remote_auth_s3=s.remote_auth_s3,this.page.api_key=s.api_key}})}function p(e){var t=n(),o=r(),l=s(t,e);i(o,l)||o.appendChild(a(l))}var f,m="embed.js",d="count.js";this.setShortname=function(e){f=e},this.$get=["$location",function(r){function o(n,o){if(!e.isDefined(f))throw new Error("No disqus shortname defined");if(!e.isDefined(n))throw new Error("No disqus thread id defined");e.isDefined(t.DISQUS)?c(r,n,o):(l(r,n,o),p(m))}function s(n){t.disqus_sso=n,e.isDefined(t.DISQUS)&&c(r,t.disqus_identifier,t.disqus_title)}function a(e){l(r,e),p(m),p(d),u()}return{commit:o,getShortname:n,setSso:s,loadCount:a}}]}),r.service("disqusService",["$disqus",function(e){return{setSso:function(t){e.setSso(t)}}}]),r.directive("disqus",["$disqus",function(t){return{restrict:"AC",replace:!0,scope:{id:"=disqus",title:"=title"},template:'
',link:function(r){r.$watch("id",function(n){e.isDefined(n)&&t.commit(n,r.title)})}}}]),r.directive("disqusIdentifier",["$disqus",function(e){return{restrict:"A",link:function(t,r,n){e.loadCount(n.disqusIdentifier)}}}])}(angular,this),angular.module("frontpress.template-cache",[]),angular.module("frontpress.template-cache").run(["$templateCache",function(e){e.put("/js/components/featured-image/templates/featured-image.template.html",''),e.put("/js/components/full-post/templates/full-post-categories-list.template.html",'
\n\t

carregando categorias...

\n\t

\n\t\tcategorias:\t\n\t\t\t\t\n\t\t{{category.name}}{{$last ? "" : ", "}}\t\t\n\t\t\t\t\n\t

\n
'),e.put("/js/components/full-post/templates/full-post-content-v1.template.html",'
'),e.put("/js/components/full-post/templates/full-post-content-v2.template.html",'
'),e.put("/js/components/full-post/templates/full-post-tags-list.template.html",'
\n\t

carregando tags...

\n\t

\n\t\ttags:\t\n\t\t\t\t\n\t\t{{tag.name}}{{$last ? "" : ", "}}\t\t\n\t\t\t\t\n\t

\n
'),e.put("/js/components/full-post/templates/full-post-title-v1.template.html",'

'),e.put("/js/components/full-post/templates/full-post-title-v2.template.html",'

'),e.put("/js/components/full-post/templates/full-post.template.html",'
\t\n\t

carregando...

\n\t
\t\t\n\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t \n\t\t\n\t\t \n\t\t \n\t
\n
'),e.put("/js/components/list-posts/templates/list-posts-excerpt-v1.template.html",'

'),e.put("/js/components/list-posts/templates/list-posts-excerpt-v2.template.html",'

'),e.put("/js/components/list-posts/templates/list-posts-title-v1.template.html",'

'),e.put("/js/components/list-posts/templates/list-posts-title-v2.template.html",'

'),e.put("/js/components/list-posts/templates/list-posts.template.html",'
\n\t

Carregando posts

\n\t
\t\n\t\t\t\n\t\t\n\t\t\t\n\t\t\n \n\t
\n
\n'),e.put("/js/components/page-head/templates/page-head.template.html",'\n\n\n\t\n\n\n\n\n\n'),e.put("/js/components/pagination/templates/pagination.template.html",'
\n\t<<\n\t\n\t\t\t\n\n\t>>\n
'),e.put("/js/components/post-date/templates/post-date.template.html","

"),e.put("/js/components/share/templates/share.template.html","
\n Share:\n Twitter\n Facebook\n Google+\n
\n"),e.put("/js/views/home/templates/home.template.html",'
\n\t
\n\t\t\n\t\tCarregando posts novos ...\n\t\t\n\t
\n
'), e.put("/js/views/post/templates/post.template.html","
\n\t\n
")}]),angular.module("frontpress",["frontpress.views","frontpress.apis.blog","frontpress.components.slugs-map","frontpress.components.frontpress-provider","frontpress.template-cache"]);var module=angular.module("frontpress");FrontPressConfig.$inject=["$qProvider"],module.config(FrontPressConfig);var module=angular.module("frontpress");module.run(frontpressRun),angular.module("frontpress.apis.configs-to-params",[]);var module=angular.module("frontpress.apis.configs-to-params");module.factory("ConfigsToParams",ConfigsToParams),angular.module("frontpress.filters",[]),angular.module("frontpress.views",["frontpress.views.home","frontpress.views.post"]),angular.module("frontpress.components.ajax",[]),angular.module("frontpress.components.api-manager",["frontpress.apis.api-manager-map"]),angular.module("frontpress.components.blog",["frontpress.components.frontpress-provider","frontpress.components.api-manager","frontpress.apis.blog"]),angular.module("frontpress.components.featured-image",["frontpress.components.frontpress-provider"]),angular.module("frontpress.components.frontpress-provider",["ngDisqus"]),angular.module("frontpress.components.full-post",["frontpress.filters","frontpress.apis.tags","frontpress.apis.posts","frontpress.apis.categories","frontpress.apis.media","frontpress.components.post-date","frontpress.apis.api-manager-map","frontpress.components.blog","frontpress.components.featured-image","frontpress.components.frontpress-provider"]),angular.module("frontpress.components.list-posts",["frontpress.filters","frontpress.components.slugs-map","frontpress.apis.posts","frontpress.apis.media","frontpress.components.api-manager","frontpress.components.post-date","frontpress.components.featured-image","frontpress.components.frontpress-provider"]),angular.module("frontpress.components.page-head",["frontpress.components.frontpress-provider"]),angular.module("frontpress.components.pagination",["frontpress.components.page-head","frontpress.components.frontpress-provider"]),angular.module("frontpress.components.post-date",["frontpress.components.frontpress-provider"]),angular.module("frontpress.components.share",["frontpress.filters","frontpress.apis.api-manager-map","frontpress.components.frontpress-provider"]),angular.module("frontpress.components.slugs-map",["frontpress.apis.posts","frontpress.apis.api-manager-map"]),angular.module("frontpress.views.home",["ui.router","infinite-scroll","frontpress.components.list-posts","frontpress.components.pagination","frontpress.components.page-head","frontpress.components.api-manager","frontpress.components.blog","frontpress.components.frontpress-provider"]),angular.module("frontpress.views.post",["frontpress.components.full-post","frontpress.components.share","ui.router","frontpress.components.page-head","frontpress.components.blog","ngDisqus","frontpress.components.slugs-map","frontpress.components.api-manager","frontpress.components.frontpress-provider"]),angular.module("frontpress.components.featured-image").directive("featuredImage",FeaturedImageDirective),FeaturedImageDirective.$inject=["$FrontPress"];var module=angular.module("frontpress.components.full-post");module.directive("fullPostCategoriesList",FullPostCategoriesListDirective),FullPostCategoriesListDirective.$inject=["$FrontPress"];var module=angular.module("frontpress.components.full-post");module.directive("fullPostContent",FullPostContentDirective),FullPostContentDirective.$inject=["$FrontPress"];var module=angular.module("frontpress.components.full-post");module.directive("fullPostTagsList",FullPostTagListDirective),FullPostTagListDirective.$inject=["$FrontPress"];var module=angular.module("frontpress.components.full-post");module.directive("fullPostTitle",FullPostTitleDirective),FullPostTitleDirective.$inject=["$FrontPress"],angular.module("frontpress.components.full-post").directive("fullPost",FullPostDirective),FullPostDirective.$inject=["$FrontPress"],angular.module("frontpress.components.list-posts").directive("listPostsExcerpt",ListPostsExcerptDirective),ListPostsExcerptDirective.$inject=["$FrontPress"],angular.module("frontpress.components.list-posts").directive("listPostsTitle",ListPostsTitleDirective),ListPostsTitleDirective.$inject=["$FrontPress"],angular.module("frontpress.components.list-posts").directive("listPosts",ListPostsDirective),ListPostsDirective.$inject=["$FrontPress"];var module=angular.module("frontpress.components.page-head");module.directive("pageHead",pageHead),pageHead.$inject=["$FrontPress"];var module=angular.module("frontpress.components.pagination");module.directive("pagination",pagination),pagination.$inject=["$FrontPress"],angular.module("frontpress.components.post-date").directive("postDate",PostDateDirective),PostDateDirective.$inject=["$FrontPress"],angular.module("frontpress.components.share").directive("share",share),share.$inject=["$FrontPress"],angular.module("frontpress.views.home").directive("homeView",HomeViewDirective),HomeViewDirective.$inject=["$FrontPress"],angular.module("frontpress.views.post").directive("postView",PostViewDirective),PostViewDirective.$inject=["$FrontPress"],angular.module("infinite-scroll").value("THROTTLE_MILLISECONDS",1e3),angular.module("frontpress.filters").filter("trustAsHtml",TrustAsHtml),TrustAsHtml.$inject=["$sce"],angular.module("frontpress.views.home").config(configHome),configHome.$inject=["$stateProvider","$urlRouterProvider","$FrontPressProvider"],angular.module("frontpress.views.post").config(configPost),configPost.$inject=["$stateProvider","$FrontPressProvider"];var module=angular.module("frontpress.components.ajax");AjaxModel.$inject=["$http"],module.factory("AjaxModel",AjaxModel),angular.module("frontpress.components.api-manager").service("ApiManager",ApiManager),ApiManager.$inject=["ApiManagerMap"],angular.module("frontpress.components.blog").factory("BlogModel",BlogModel),BlogModel.$inject=["BlogApi","$q","ApiManager","$FrontPress"];var module=angular.module("frontpress.components.featured-image");module.controller("FeaturedImageDirectiveController",FeaturedImageDirectiveController);var module=angular.module("frontpress.components.frontpress-provider");module.provider("$FrontPress",FrontPressProvider),FrontPressProvider.$inject=["FrontPressConfigurationFile","$disqusProvider"],angular.module("frontpress.components.full-post").controller("FullPostCategoriesListDirectiveController",FullPostCategoriesListDirectiveController),angular.module("frontpress.components.full-post").controller("FullPostDirectiveController",FullPostDirectiveController),FullPostDirectiveController.$inject=["FullPostModel","BlogModel"];var module=angular.module("frontpress.components.full-post");module.controller("FullPostGenericDirectiveController",FullPostGenericDirectiveController);var module=angular.module("frontpress.components.full-post");module.controller("FullPostTagsListDirectiveController",FullPostTagsListDirectiveController);var module=angular.module("frontpress.components.full-post");module.factory("FullPostModel",FullPostModel),FullPostModel.$inject=["PostsApi","TagsApi","CategoriesApi","$q","MediaApi","$FrontPress","ApiManagerMap"],angular.module("frontpress.components.list-posts").controller("ListPostsDirectiveController",ListPostsDirectiveController),ListPostsDirectiveController.$inject=["ListPostsModel"];var module=angular.module("frontpress.components.list-posts");module.controller("ListPostsGenericDirectiveController",ListPostsGenericDirectiveController),angular.module("frontpress.components.list-posts").factory("ListPostsModel",ListPostsModel),ListPostsModel.$inject=["PostsApi","MediaApi","$q","SlugsMapModel","ApiManager"],angular.module("frontpress.components.page-head").controller("PageHeadController",PageHeadController),PageHeadController.$inject=["PageHeadModel"];var module=angular.module("frontpress.components.page-head");module.factory("PageHeadModel",PageHeadModel),PageHeadModel.$inject=["$location","$FrontPress"],angular.module("frontpress.components.pagination").controller("PaginationController",PaginationController),PaginationController.$inject=["PaginationModel"];var module=angular.module("frontpress.components.pagination");module.factory("PaginationModel",PaginationModel),PaginationModel.$inject=["PageHeadModel"];var module=angular.module("frontpress.components.post-date");module.controller("PostDateDirectiveController",PostDateDirectiveController),PostDateDirectiveController.$inject=[];var module=angular.module("frontpress.components.share");module.controller("ShareController",ShareController),ShareController.$inject=["ShareModel"];var module=angular.module("frontpress.components.share");module.factory("ShareModel",ShareModel),ShareModel.$inject=["$window","ApiManager"],angular.module("frontpress.components.slugs-map").factory("SlugsMapModel",SlugsMapModel),SlugsMapModel.$inject=["$cacheFactory","PostsApi","ApiManagerMap"];var module=angular.module("frontpress.views.home");module.controller("HomeDirectiveController",HomeDirectiveController),HomeDirectiveController.$inject=["$stateParams","ListPostsModel","$state","$FrontPress","BlogModel","PageHeadModel","$location","PaginationModel"],angular.module("frontpress.views.home").controller("HomeRouteController",HomeRouteController),HomeRouteController.$inject=[];var module=angular.module("frontpress.views.post");module.controller("PostDirectiveController",PostDirectiveController),PostDirectiveController.$inject=["FullPostModel","$stateParams","PageHeadModel","SlugsMapModel","CategoriesApi","ApiManager","ApiManagerMap","BlogModel","$q"];var module=angular.module("frontpress.views.post");module.controller("PostRouteController",PostRouteController),PostRouteController.$inject=[],angular.module("frontpress.apis.api-manager-map",[]),angular.module("frontpress.apis.blog",["frontpress.components.ajax","frontpress.components.frontpress-provider"]),angular.module("frontpress.apis.categories",["frontpress.components.ajax","frontpress.components.frontpress-provider","frontpress.apis.configs-to-params"]),angular.module("frontpress.apis.media",["frontpress.components.ajax","frontpress.components.frontpress-provider","frontpress.apis.configs-to-params"]),angular.module("frontpress.apis.posts",["frontpress.components.ajax","frontpress.components.frontpress-provider","frontpress.apis.configs-to-params"]),angular.module("frontpress.apis.tags",["frontpress.components.ajax","frontpress.components.frontpress-provider","frontpress.apis.configs-to-params"]),angular.module("frontpress.apis.api-manager-map").constant("ApiManagerMap",{totalPostsNumber:["headers","X-WP-Total"],allPostsPath:["body"],postTitle:["title","rendered"],postId:["id"],postDate:["date"],siteName:["name"],siteDescription:["description"]}),angular.module("frontpress.apis.blog").factory("BlogApi",BlogApi),BlogApi.$inject=["AjaxModel","$FrontPress"],angular.module("frontpress.apis.categories").factory("CategoriesApi",CategoriesApi),CategoriesApi.$inject=["AjaxModel","$FrontPress","ConfigsToParams"];var module=angular.module("frontpress.apis.media");MediaApi.$inject=["AjaxModel","$FrontPress","ConfigsToParams"],module.factory("MediaApi",MediaApi);var module=angular.module("frontpress.apis.posts");PostsApi.$inject=["AjaxModel","$FrontPress","ConfigsToParams"],module.factory("PostsApi",PostsApi);var module=angular.module("frontpress.apis.categories");TagsApi.$inject=["AjaxModel","$FrontPress","ConfigsToParams"],module.factory("TagsApi",TagsApi); \ No newline at end of file diff --git a/release/frontpress.v1.js b/release/frontpress.v1.js index e34d353..79cabb4 100644 --- a/release/frontpress.v1.js +++ b/release/frontpress.v1.js @@ -5697,7 +5697,8 @@ function AjaxModel($http) { var promise = $http({ url: url, method: method, - params: params + params: params, + cache: true }); return promise; diff --git a/release/frontpress.v1.min.js b/release/frontpress.v1.min.js index 642f26a..26acf8f 100644 --- a/release/frontpress.v1.min.js +++ b/release/frontpress.v1.min.js @@ -1,3 +1,3 @@ -function FrontPressConfig(e){e.errorOnUnhandledRejections(!1)}function frontpressRun(){function e(){String.prototype.format||(String.prototype.format=function(){var e=arguments;return this.replace(/{(\d+)}/g,function(t,r){return"undefined"!=typeof e[r]?e[r]:t})}),String.prototype.replaceAll||(String.prototype.replaceAll=function(e){var t=this;for(var r in e)t=t.replace(new RegExp(r,"g"),e[r]);return t}),String.prototype.getDateInfo||(String.prototype.getDateInfo=function(){var e={},t=new Date(this);return e.year=t.getFullYear(),e.month=t.getMonth()+1,e.day=("0"+t.getDate()).slice(-2),e})}function t(){Array.prototype.removeDuplicatedObjectsByField||(Array.prototype.removeDuplicatedObjectsByField=function(e){this.sort(function(t,r){return t[e]r[e]?1:0});var t=[];return this.reduce(function(r,n){return r[e]!==n[e]&&t.push(n),n},[]),t}),Array.prototype.getObjectByValue||(Array.prototype.getObjectByValue=function(e,t){return this.find(function(r){return r[e]==t})}),Array.prototype.filterToProperties||(Array.prototype.filterToProperties=function(){for(var e=[],t=0;t",controller:"HomeRouteController as vc"},o={url:r.getRoute("home.pagination"),template:"",controller:"HomeRouteController as vc"};e.state("home",n),e.state("home-pagination",o)}function configPost(e,t){t.configure.loadRoutes();var r={url:t.getRoute("post"),template:"",controller:"PostRouteController as vc"};e.state("post",r)}function AjaxModel(e){function t(t,r,n){r=r||{};var o=e({url:t,method:n,params:r});return o}function r(e,r){return t(e,r,"GET")}function n(e,r){return t(e,r,"POST")}function o(e,r){return t(e,r,"PUT")}return{get:r,post:n,put:o}}function ApiManager(e){function t(t,r){for(var n=t,o=e[r],s=0;s1){var r=e-1;s.setPrevPageNumber(r)}for(var n=1;n<=s.paginationSize;n++){var o=e+n;if(o<=s.lastPageNumber){var a={number:o};t.push(a)}}if(e":s,"":n.slug,"":t.getPath(n,"postTitle")});e.open(a,r+"-share","width=550,height=235")}var n={openShareWindow:r},o={facebook:"https://www.facebook.com/sharer/sharer.php?u=/",twitter:"https://twitter.com/intent/tweet?url=//&text=",gplus:"https://plus.google.com/share?url=//&t=",linkedin:"https://www.linkedin.com/shareArticle?url=/&title="};return n}function SlugsMapModel(e,t,r){function n(e){var t=l.get("slugs");"undefined"==typeof t&&(t=[]);var n=t.concat(e),o=r.postId;n=n.removeDuplicatedObjectsByField(o),l.put("slugs",n)}function o(){var e=l.get("slugs");return e}function s(e){var t=e.filterToProperties(u);i.addToCache(t)}function a(e,r){var n={pageSize:e,pageNumber:r},o=t.getAllPosts(n);o.then(function(e){var t=e.posts.filterToProperties(u);i.addToCache(t)}),o.catch(function(e){console.log(e)})}var i={addToCache:n,load:a,updateFromPosts:s,getCachedSlugs:o},l=e("slugsCache"),u=["slug"];return u.push(r.postId),i}function HomeDirectiveController(e,t,r,n,o,s,a,i){function l(){var e=o.getInformationPromise();e.then(function(e){var t={":siteName":e.name,":siteDescription":e.description};s.parsePageTitle("home",t)});var t=a.absUrl().replace(/\/page\/[0-9]{1,}\/?/,"");s.setPageCanonical(t)}function u(){m.pageNumber++;var e=m.pageNumber?m.pageNumber:f,t={notify:!1},o=p.vm.loadPosts(m);o.then(function(e){"v2"===n.apiVersion&&p.vm.loadExternalFeaturedImages(e)}),l(),c(m.pageNumber),r.go("home-pagination",{pageNumber:e},t)}function c(e){i.generatePaginationFromCurrentPageNumber(e)}var p=this;p.vm=t;var f=2;p.loadMorePostsAndPaginate=u,p.isInfiniteScrollDisabled=!n.infiniteScroll,s.init();var m={pageSize:n.pageSize,pageNumber:e.pageNumber?e.pageNumber:1},d=p.vm.loadPosts(m);d.then(function(e){var r=t.totalPostsNumber/n.pageSize;i.setLastPageNumber(r),c(m.pageNumber),"v2"===n.apiVersion&&p.vm.loadExternalFeaturedImages(e)}),l()}function HomeRouteController(){}function PostDirectiveController(e,t,r,n,o,s,a,i,l){var u=this;u.vm=e;var c,p,f=t.postSlug,m=n.getCachedSlugs(),d=a.postId[0],g=m&&m.getObjectByValue("slug",f)?m.getObjectByValue("slug",f):void 0;t.postId?(p=t.postId,c=e.loadFullPostById(p)):!t.postId&&g?(p=g[d],c=e.loadFullPostById(p)):f?c=e.loadFullPostBySlug(f):console.error("Error: [$FrontPress configuration error: empty id and slug for post route.] You should provide :postSlug or :postId as route parameter.");var v=i.getInformationPromise();r.init();var h=[c,v];l.all(h).then(function(t){var n=t[0],o=t[1],a=s.getPath(n,"postTitle"),i=s.getPath(n,"postDate").getDateInfo(),l={":postTitle":a,":year":i.year,":month":i.month,":day":i.day,":siteName":o.name,":siteDescription":o.description};r.parsePageTitle("post",l),u.disqusId=e.slug}),l.all(h).catch(function(e){console.error(e)})}function PostRouteController(){}function BlogApi(e,t){function r(){return e.get(n)}var n=t.restApiUrl,o={getBlogInformation:r};return o}function CategoriesApi(e,t,r){function n(t){var n=s,o=r.parse(t);return e.get(n,o)}function o(t,r){var n=s+"?fields=categories";return n=n.replace("",t),e.get(n,r)}var s=t.restApiUrl+"/posts/";return{getAllCategories:n,getCategoriesByPostId:o}}function MediaApi(e,t,r){function n(t,n){var s=o+"?fields=post_thumbnail";s=s.replace("",t);var a=r.parse(n);return e.get(s,a)}var o=(t.restApiUrl+"/media/",t.restApiUrl+"/posts/");return{getPostThumbnailByPostId:n}}function PostsApi(e,t,r){function n(t){var n=a,o=r.parse(t);return e.get(n,o)}function o(t,r){var n=a+"slug:";return n=n.replace("",t),e.get(n,r)}function s(t,r){var n=a+"";return n=n.replace("",t),e.get(n,r)}var a=t.restApiUrl+"/posts/",i={getAllPosts:n,getPostBySlug:o,getPostById:s};return i}function TagsApi(e,t,r){function n(t){var n=s,o=r.parse(t);return e.get(n,o)}function o(t,n){var o=s+"?fields=tags",a=r.parse(n);return o=o.replace("",t),e.get(o,a)}var s=t.restApiUrl+"/posts/",a={getAllTags:n,getTagByPostId:o};return a}"undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports="ui.router"),function(e,t,r){"use strict";function n(e,t){return _(new(_(function(){},{prototype:e})),t)}function o(e){return B(arguments,function(t){t!==e&&B(t,function(t,r){e.hasOwnProperty(r)||(e[r]=t)})}),e}function s(e,t){var r=[];for(var n in e.path){if(e.path[n]!==t.path[n])break;r.push(e.path[n])}return r}function a(e){if(Object.keys)return Object.keys(e);var t=[];return B(e,function(e,r){t.push(r)}),t}function i(e,t){if(Array.prototype.indexOf)return e.indexOf(t,Number(arguments[2])||0);var r=e.length>>>0,n=Number(arguments[2])||0;for(n=n<0?Math.ceil(n):Math.floor(n),n<0&&(n+=r);n=0||(c.push(o[f]),u[o[f]]=e[o[f]]);return _({},u,t)}function u(e,t,r){if(!r){r=[];for(var n in e)r.push(n)}for(var o=0;o "));if($[r]=n,R(e))v.push(r,[function(){return t.get(e)}],u);else{var o=t.annotate(e);B(o,function(e){e!==r&&l.hasOwnProperty(e)&&m(l[e],e)}),v.push(r,e,o)}h.pop(),$[r]=s}}function d(e){return H(e)&&e.then&&e.$$promises}if(!H(l))throw new Error("'invocables' must be an object");var g=a(l||{}),v=[],h=[],$={};return B(l,m),l=h=$=null,function(n,s,a){function i(){--y||(w||o(P,s.$$values),h.$$values=P,h.$$promises=h.$$promises||!0,delete h.$$inheritedValues,m.resolve(P))}function l(e){h.$$failure=e,m.reject(e)}function u(r,o,s){function u(e){p.reject(e),l(e)}function c(){if(!O(h.$$failure))try{p.resolve(t.invoke(o,a,P)),p.promise.then(function(e){P[r]=e,i()},u)}catch(e){u(e)}}var p=e.defer(),f=0;B(s,function(e){$.hasOwnProperty(e)&&!n.hasOwnProperty(e)&&(f++,$[e].then(function(t){P[e]=t,--f||c()},u))}),f||c(),$[r]=p.promise}if(d(n)&&a===r&&(a=s,s=n,n=null),n){if(!H(n))throw new Error("'locals' must be an object")}else n=c;if(s){if(!d(s))throw new Error("'parent' must be a promise returned by $resolve.resolve()")}else s=p;var m=e.defer(),h=m.promise,$=h.$$promises={},P=_({},n),y=1+v.length/3,w=!1;if(O(s.$$failure))return l(s.$$failure),h;s.$$inheritedValues&&o(P,f(s.$$inheritedValues,g)),_($,s.$$promises),s.$$values?(w=o(P,f(s.$$values,g)),h.$$inheritedValues=f(s.$$values,g),i()):(s.$$inheritedValues&&(h.$$inheritedValues=f(s.$$inheritedValues,g)),s.then(i,l));for(var b=0,C=v.length;b=0));)$=s(h.id,h.type,h.cfg,"path"),p+=a(h.segment,$.type.pattern.source,$.squash,$.isOptional),m.push(h.segment),f=u.lastIndex;P=e.substring(f);var y=P.indexOf("?");if(y>=0){var w=this.sourceSearch=P.substring(y);if(P=P.substring(0,y),this.sourcePath=e.substring(0,f+y),w.length>0)for(f=0;l=c.exec(w);)h=i(l,!0),$=s(h.id,h.type,h.cfg,"search"),f=u.lastIndex}else this.sourcePath=e,this.sourceSearch="";p+=a(P)+(t.strict===!1?"/?":"")+"$",m.push(P),this.regexp=new RegExp(p,t.caseInsensitive?"i":r),this.prefix=m[0],this.$$paramNames=v}function P(e){_(this,e)}function y(){function e(e){return null!=e?e.toString().replace(/(~|\/)/g,function(e){return{"~":"~~","/":"~2F"}[e]}):e}function o(e){return null!=e?e.toString().replace(/(~~|~2F)/g,function(e){return{"~~":"~","~2F":"/"}[e]}):e}function s(){return{strict:g,caseInsensitive:f}}function l(e){return k(e)||V(e)&&k(e[e.length-1])}function u(){for(;b.length;){var e=b.shift();if(e.pattern)throw new Error("You cannot override a type's .pattern at runtime.");t.extend(h[e.name],p.invoke(e.def))}}function c(e){_(this,e||{})}Y=this;var p,f=!1,g=!0,v=!1,h={},w=!0,b=[],C={string:{encode:e,decode:o,is:function(e){return null==e||!O(e)||"string"==typeof e},pattern:/[^\/]*/},int:{encode:e,decode:function(e){return parseInt(e,10)},is:function(e){return O(e)&&this.decode(e.toString())===e},pattern:/\d+/},bool:{encode:function(e){return e?1:0},decode:function(e){return 0!==parseInt(e,10)},is:function(e){return e===!0||e===!1},pattern:/0|1/},date:{encode:function(e){return this.is(e)?[e.getFullYear(),("0"+(e.getMonth()+1)).slice(-2),("0"+e.getDate()).slice(-2)].join("-"):r},decode:function(e){if(this.is(e))return e;var t=this.capture.exec(e);return t?new Date(t[1],t[2]-1,t[3]):r},is:function(e){return e instanceof Date&&!isNaN(e.valueOf())},equals:function(e,t){return this.is(e)&&this.is(t)&&e.toISOString()===t.toISOString()},pattern:/[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,capture:/([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/},json:{encode:t.toJson,decode:t.fromJson,is:t.isObject,equals:t.equals,pattern:/[^\/]*/},any:{encode:t.identity,decode:t.identity,equals:t.equals,pattern:/.*/}};y.$$getDefaultValue=function(e){if(!l(e.value))return e.value;if(!p)throw new Error("Injectable functions cannot be called at configuration time");return p.invoke(e.value)},this.caseInsensitive=function(e){return O(e)&&(f=e),f},this.strictMode=function(e){return O(e)&&(g=e),g},this.defaultSquashPolicy=function(e){if(!O(e))return v;if(e!==!0&&e!==!1&&!R(e))throw new Error("Invalid squash policy: "+e+". Valid policies: false, true, arbitrary-string");return v=e,e},this.compile=function(e,t){return new $(e,_(s(),t))},this.isMatcher=function(e){if(!H(e))return!1;var t=!0;return B($.prototype,function(r,n){k(r)&&(t=t&&O(e[n])&&k(e[n]))}),t},this.type=function(e,t,r){if(!O(t))return h[e];if(h.hasOwnProperty(e))throw new Error("A type named '"+e+"' has already been defined.");return h[e]=new P(_({name:e},t)),r&&(b.push({name:e,def:r}),w||u()),this},B(C,function(e,t){h[t]=new P(_({name:t},e))}),h=n(h,{}),this.$get=["$injector",function(e){return p=e,w=!1,u(),B(C,function(e,t){h[t]||(h[t]=new P(e))}),this}],this.Param=function(e,n,o,s){function u(e){var t=H(e)?a(e):[],r=i(t,"value")===-1&&i(t,"type")===-1&&i(t,"squash")===-1&&i(t,"array")===-1;return r&&(e={value:e}),e.$$fn=l(e.value)?e.value:function(){return e.value},e}function c(r,n,o){if(r.type&&n)throw new Error("Param '"+e+"' has two type configurations.");return n?n:r.type?t.isString(r.type)?h[r.type]:r.type instanceof P?r.type:new P(r.type):"config"===o?h.any:h.string}function f(){var t={array:"search"===s&&"auto"},r=e.match(/\[\]$/)?{array:!0}:{};return _(t,r,o).array}function g(e,t){var r=e.squash;if(!t||r===!1)return!1;if(!O(r)||null==r)return v;if(r===!0||R(r))return r;throw new Error("Invalid squash policy: '"+r+"'. Valid policies: false, true, or arbitrary string")}function $(e,t,n,o){var s,a,l=[{from:"",to:n||t?r:""},{from:null,to:n||t?r:""}];return s=V(e.replace)?e.replace:[],R(o)&&s.push({from:o,to:r}),a=d(s,function(e){return e.from}),m(l,function(e){return i(a,e.from)===-1}).concat(s)}function y(){if(!p)throw new Error("Injectable functions cannot be called at configuration time");var e=p.invoke(o.$$fn);if(null!==e&&e!==r&&!C.type.is(e))throw new Error("Default value ("+e+") for parameter '"+C.id+"' is not an instance of Type ("+C.type.name+")");return e}function w(e){function t(e){return function(t){return t.from===e}}function r(e){var r=d(m(C.replace,t(e)),function(e){return e.to});return r.length?r[0]:e}return e=r(e),O(e)?C.type.$normalize(e):y()}function b(){return"{Param:"+e+" "+n+" squash: '"+j+"' optional: "+S+"}"}var C=this;o=u(o),n=c(o,n,s);var A=f();n=A?n.$asArray(A,"search"===s):n,"string"!==n.name||A||"path"!==s||o.value!==r||(o.value="");var S=o.value!==r,j=g(o,S),D=$(o,A,S,j);_(this,{id:e,type:n,location:s,array:A,squash:j,replace:D,isOptional:S,value:w,dynamic:r,config:o,toString:b})},c.prototype={$$new:function(){return n(this,_(new c,{$$parent:this}))},$$keys:function(){for(var e=[],t=[],r=this,n=a(c.prototype);r;)t.push(r),r=r.$$parent;return t.reverse(),B(t,function(t){B(a(t),function(t){i(e,t)===-1&&i(n,t)===-1&&e.push(t)})}),e},$$values:function(e){var t={},r=this;return B(r.$$keys(),function(n){t[n]=r[n].value(e&&e[n])}),t},$$equals:function(e,t){var r=!0,n=this;return B(n.$$keys(),function(o){var s=e&&e[o],a=t&&t[o];n[o].type.equals(s,a)||(r=!1)}),r},$$validates:function(e){var n,o,s,a,i,l=this.$$keys();for(n=0;nr[e]?1:0});var t=[];return this.reduce(function(r,n){return r[e]!==n[e]&&t.push(n),n},[]),t}),Array.prototype.getObjectByValue||(Array.prototype.getObjectByValue=function(e,t){return this.find(function(r){return r[e]==t})}),Array.prototype.filterToProperties||(Array.prototype.filterToProperties=function(){for(var e=[],t=0;t",controller:"HomeRouteController as vc"},o={url:r.getRoute("home.pagination"),template:"",controller:"HomeRouteController as vc"};e.state("home",n),e.state("home-pagination",o)}function configPost(e,t){t.configure.loadRoutes();var r={url:t.getRoute("post"),template:"",controller:"PostRouteController as vc"};e.state("post",r)}function AjaxModel(e){function t(t,r,n){r=r||{};var o=e({url:t,method:n,params:r,cache:!0});return o}function r(e,r){return t(e,r,"GET")}function n(e,r){return t(e,r,"POST")}function o(e,r){return t(e,r,"PUT")}return{get:r,post:n,put:o}}function ApiManager(e){function t(t,r){for(var n=t,o=e[r],s=0;s1){var r=e-1;s.setPrevPageNumber(r)}for(var n=1;n<=s.paginationSize;n++){var o=e+n;if(o<=s.lastPageNumber){var a={number:o};t.push(a)}}if(e":s,"":n.slug,"":t.getPath(n,"postTitle")});e.open(a,r+"-share","width=550,height=235")}var n={openShareWindow:r},o={facebook:"https://www.facebook.com/sharer/sharer.php?u=/",twitter:"https://twitter.com/intent/tweet?url=//&text=",gplus:"https://plus.google.com/share?url=//&t=",linkedin:"https://www.linkedin.com/shareArticle?url=/&title="};return n}function SlugsMapModel(e,t,r){function n(e){var t=l.get("slugs");"undefined"==typeof t&&(t=[]);var n=t.concat(e),o=r.postId;n=n.removeDuplicatedObjectsByField(o),l.put("slugs",n)}function o(){var e=l.get("slugs");return e}function s(e){var t=e.filterToProperties(u);i.addToCache(t)}function a(e,r){var n={pageSize:e,pageNumber:r},o=t.getAllPosts(n);o.then(function(e){var t=e.posts.filterToProperties(u);i.addToCache(t)}),o.catch(function(e){console.log(e)})}var i={addToCache:n,load:a,updateFromPosts:s,getCachedSlugs:o},l=e("slugsCache"),u=["slug"];return u.push(r.postId),i}function HomeDirectiveController(e,t,r,n,o,s,a,i){function l(){var e=o.getInformationPromise();e.then(function(e){var t={":siteName":e.name,":siteDescription":e.description};s.parsePageTitle("home",t)});var t=a.absUrl().replace(/\/page\/[0-9]{1,}\/?/,"");s.setPageCanonical(t)}function u(){m.pageNumber++;var e=m.pageNumber?m.pageNumber:f,t={notify:!1},o=p.vm.loadPosts(m);o.then(function(e){"v2"===n.apiVersion&&p.vm.loadExternalFeaturedImages(e)}),l(),c(m.pageNumber),r.go("home-pagination",{pageNumber:e},t)}function c(e){i.generatePaginationFromCurrentPageNumber(e)}var p=this;p.vm=t;var f=2;p.loadMorePostsAndPaginate=u,p.isInfiniteScrollDisabled=!n.infiniteScroll,s.init();var m={pageSize:n.pageSize,pageNumber:e.pageNumber?e.pageNumber:1},d=p.vm.loadPosts(m);d.then(function(e){var r=t.totalPostsNumber/n.pageSize;i.setLastPageNumber(r),c(m.pageNumber),"v2"===n.apiVersion&&p.vm.loadExternalFeaturedImages(e)}),l()}function HomeRouteController(){}function PostDirectiveController(e,t,r,n,o,s,a,i,l){var u=this;u.vm=e;var c,p,f=t.postSlug,m=n.getCachedSlugs(),d=a.postId[0],g=m&&m.getObjectByValue("slug",f)?m.getObjectByValue("slug",f):void 0;t.postId?(p=t.postId,c=e.loadFullPostById(p)):!t.postId&&g?(p=g[d],c=e.loadFullPostById(p)):f?c=e.loadFullPostBySlug(f):console.error("Error: [$FrontPress configuration error: empty id and slug for post route.] You should provide :postSlug or :postId as route parameter.");var v=i.getInformationPromise();r.init();var h=[c,v];l.all(h).then(function(t){var n=t[0],o=t[1],a=s.getPath(n,"postTitle"),i=s.getPath(n,"postDate").getDateInfo(),l={":postTitle":a,":year":i.year,":month":i.month,":day":i.day,":siteName":o.name,":siteDescription":o.description};r.parsePageTitle("post",l),u.disqusId=e.slug}),l.all(h).catch(function(e){console.error(e)})}function PostRouteController(){}function BlogApi(e,t){function r(){return e.get(n)}var n=t.restApiUrl,o={getBlogInformation:r};return o}function CategoriesApi(e,t,r){function n(t){var n=s,o=r.parse(t);return e.get(n,o)}function o(t,r){var n=s+"?fields=categories";return n=n.replace("",t),e.get(n,r)}var s=t.restApiUrl+"/posts/";return{getAllCategories:n,getCategoriesByPostId:o}}function MediaApi(e,t,r){function n(t,n){var s=o+"?fields=post_thumbnail";s=s.replace("",t);var a=r.parse(n);return e.get(s,a)}var o=(t.restApiUrl+"/media/",t.restApiUrl+"/posts/");return{getPostThumbnailByPostId:n}}function PostsApi(e,t,r){function n(t){var n=a,o=r.parse(t);return e.get(n,o)}function o(t,r){var n=a+"slug:";return n=n.replace("",t),e.get(n,r)}function s(t,r){var n=a+"";return n=n.replace("",t),e.get(n,r)}var a=t.restApiUrl+"/posts/",i={getAllPosts:n,getPostBySlug:o,getPostById:s};return i}function TagsApi(e,t,r){function n(t){var n=s,o=r.parse(t);return e.get(n,o)}function o(t,n){var o=s+"?fields=tags",a=r.parse(n);return o=o.replace("",t),e.get(o,a)}var s=t.restApiUrl+"/posts/",a={getAllTags:n,getTagByPostId:o};return a}"undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports="ui.router"),function(e,t,r){"use strict";function n(e,t){return _(new(_(function(){},{prototype:e})),t)}function o(e){return B(arguments,function(t){t!==e&&B(t,function(t,r){e.hasOwnProperty(r)||(e[r]=t)})}),e}function s(e,t){var r=[];for(var n in e.path){if(e.path[n]!==t.path[n])break;r.push(e.path[n])}return r}function a(e){if(Object.keys)return Object.keys(e);var t=[];return B(e,function(e,r){t.push(r)}),t}function i(e,t){if(Array.prototype.indexOf)return e.indexOf(t,Number(arguments[2])||0);var r=e.length>>>0,n=Number(arguments[2])||0;for(n=n<0?Math.ceil(n):Math.floor(n),n<0&&(n+=r);n=0||(c.push(o[f]),u[o[f]]=e[o[f]]);return _({},u,t)}function u(e,t,r){if(!r){r=[];for(var n in e)r.push(n)}for(var o=0;o "));if($[r]=n,R(e))v.push(r,[function(){return t.get(e)}],u);else{var o=t.annotate(e);B(o,function(e){e!==r&&l.hasOwnProperty(e)&&m(l[e],e)}),v.push(r,e,o)}h.pop(),$[r]=s}}function d(e){return H(e)&&e.then&&e.$$promises}if(!H(l))throw new Error("'invocables' must be an object");var g=a(l||{}),v=[],h=[],$={};return B(l,m),l=h=$=null,function(n,s,a){function i(){--y||(w||o(P,s.$$values),h.$$values=P,h.$$promises=h.$$promises||!0,delete h.$$inheritedValues,m.resolve(P))}function l(e){h.$$failure=e,m.reject(e)}function u(r,o,s){function u(e){p.reject(e),l(e)}function c(){if(!O(h.$$failure))try{p.resolve(t.invoke(o,a,P)),p.promise.then(function(e){P[r]=e,i()},u)}catch(e){u(e)}}var p=e.defer(),f=0;B(s,function(e){$.hasOwnProperty(e)&&!n.hasOwnProperty(e)&&(f++,$[e].then(function(t){P[e]=t,--f||c()},u))}),f||c(),$[r]=p.promise}if(d(n)&&a===r&&(a=s,s=n,n=null),n){if(!H(n))throw new Error("'locals' must be an object")}else n=c;if(s){if(!d(s))throw new Error("'parent' must be a promise returned by $resolve.resolve()")}else s=p;var m=e.defer(),h=m.promise,$=h.$$promises={},P=_({},n),y=1+v.length/3,w=!1;if(O(s.$$failure))return l(s.$$failure),h;s.$$inheritedValues&&o(P,f(s.$$inheritedValues,g)),_($,s.$$promises),s.$$values?(w=o(P,f(s.$$values,g)),h.$$inheritedValues=f(s.$$values,g),i()):(s.$$inheritedValues&&(h.$$inheritedValues=f(s.$$inheritedValues,g)),s.then(i,l));for(var b=0,C=v.length;b=0));)$=s(h.id,h.type,h.cfg,"path"),p+=a(h.segment,$.type.pattern.source,$.squash,$.isOptional),m.push(h.segment),f=u.lastIndex;P=e.substring(f);var y=P.indexOf("?");if(y>=0){var w=this.sourceSearch=P.substring(y);if(P=P.substring(0,y),this.sourcePath=e.substring(0,f+y),w.length>0)for(f=0;l=c.exec(w);)h=i(l,!0),$=s(h.id,h.type,h.cfg,"search"),f=u.lastIndex}else this.sourcePath=e,this.sourceSearch="";p+=a(P)+(t.strict===!1?"/?":"")+"$",m.push(P),this.regexp=new RegExp(p,t.caseInsensitive?"i":r),this.prefix=m[0],this.$$paramNames=v}function P(e){_(this,e)}function y(){function e(e){return null!=e?e.toString().replace(/(~|\/)/g,function(e){return{"~":"~~","/":"~2F"}[e]}):e}function o(e){return null!=e?e.toString().replace(/(~~|~2F)/g,function(e){return{"~~":"~","~2F":"/"}[e]}):e}function s(){return{strict:g,caseInsensitive:f}}function l(e){return k(e)||V(e)&&k(e[e.length-1])}function u(){for(;b.length;){var e=b.shift();if(e.pattern)throw new Error("You cannot override a type's .pattern at runtime.");t.extend(h[e.name],p.invoke(e.def))}}function c(e){_(this,e||{})}Y=this;var p,f=!1,g=!0,v=!1,h={},w=!0,b=[],C={string:{encode:e,decode:o,is:function(e){return null==e||!O(e)||"string"==typeof e},pattern:/[^\/]*/},int:{encode:e,decode:function(e){return parseInt(e,10)},is:function(e){return O(e)&&this.decode(e.toString())===e},pattern:/\d+/},bool:{encode:function(e){return e?1:0},decode:function(e){return 0!==parseInt(e,10)},is:function(e){return e===!0||e===!1},pattern:/0|1/},date:{encode:function(e){return this.is(e)?[e.getFullYear(),("0"+(e.getMonth()+1)).slice(-2),("0"+e.getDate()).slice(-2)].join("-"):r},decode:function(e){if(this.is(e))return e;var t=this.capture.exec(e);return t?new Date(t[1],t[2]-1,t[3]):r},is:function(e){return e instanceof Date&&!isNaN(e.valueOf())},equals:function(e,t){return this.is(e)&&this.is(t)&&e.toISOString()===t.toISOString()},pattern:/[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,capture:/([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/},json:{encode:t.toJson,decode:t.fromJson,is:t.isObject,equals:t.equals,pattern:/[^\/]*/},any:{encode:t.identity,decode:t.identity,equals:t.equals,pattern:/.*/}};y.$$getDefaultValue=function(e){if(!l(e.value))return e.value;if(!p)throw new Error("Injectable functions cannot be called at configuration time");return p.invoke(e.value)},this.caseInsensitive=function(e){return O(e)&&(f=e),f},this.strictMode=function(e){return O(e)&&(g=e),g},this.defaultSquashPolicy=function(e){if(!O(e))return v;if(e!==!0&&e!==!1&&!R(e))throw new Error("Invalid squash policy: "+e+". Valid policies: false, true, arbitrary-string");return v=e,e},this.compile=function(e,t){return new $(e,_(s(),t))},this.isMatcher=function(e){if(!H(e))return!1;var t=!0;return B($.prototype,function(r,n){k(r)&&(t=t&&O(e[n])&&k(e[n]))}),t},this.type=function(e,t,r){if(!O(t))return h[e];if(h.hasOwnProperty(e))throw new Error("A type named '"+e+"' has already been defined.");return h[e]=new P(_({name:e},t)),r&&(b.push({name:e,def:r}),w||u()),this},B(C,function(e,t){h[t]=new P(_({name:t},e))}),h=n(h,{}),this.$get=["$injector",function(e){return p=e,w=!1,u(),B(C,function(e,t){h[t]||(h[t]=new P(e))}),this}],this.Param=function(e,n,o,s){function u(e){var t=H(e)?a(e):[],r=i(t,"value")===-1&&i(t,"type")===-1&&i(t,"squash")===-1&&i(t,"array")===-1;return r&&(e={value:e}),e.$$fn=l(e.value)?e.value:function(){return e.value},e}function c(r,n,o){if(r.type&&n)throw new Error("Param '"+e+"' has two type configurations.");return n?n:r.type?t.isString(r.type)?h[r.type]:r.type instanceof P?r.type:new P(r.type):"config"===o?h.any:h.string}function f(){var t={array:"search"===s&&"auto"},r=e.match(/\[\]$/)?{array:!0}:{};return _(t,r,o).array}function g(e,t){var r=e.squash;if(!t||r===!1)return!1;if(!O(r)||null==r)return v;if(r===!0||R(r))return r;throw new Error("Invalid squash policy: '"+r+"'. Valid policies: false, true, or arbitrary string")}function $(e,t,n,o){var s,a,l=[{from:"",to:n||t?r:""},{from:null,to:n||t?r:""}];return s=V(e.replace)?e.replace:[],R(o)&&s.push({from:o,to:r}),a=d(s,function(e){return e.from}),m(l,function(e){return i(a,e.from)===-1}).concat(s)}function y(){if(!p)throw new Error("Injectable functions cannot be called at configuration time");var e=p.invoke(o.$$fn);if(null!==e&&e!==r&&!C.type.is(e))throw new Error("Default value ("+e+") for parameter '"+C.id+"' is not an instance of Type ("+C.type.name+")");return e}function w(e){function t(e){return function(t){return t.from===e}}function r(e){var r=d(m(C.replace,t(e)),function(e){return e.to});return r.length?r[0]:e}return e=r(e),O(e)?C.type.$normalize(e):y()}function b(){return"{Param:"+e+" "+n+" squash: '"+j+"' optional: "+S+"}"}var C=this;o=u(o),n=c(o,n,s);var A=f();n=A?n.$asArray(A,"search"===s):n,"string"!==n.name||A||"path"!==s||o.value!==r||(o.value="");var S=o.value!==r,j=g(o,S),D=$(o,A,S,j);_(this,{id:e,type:n,location:s,array:A,squash:j,replace:D,isOptional:S,value:w,dynamic:r,config:o,toString:b})},c.prototype={$$new:function(){return n(this,_(new c,{$$parent:this}))},$$keys:function(){for(var e=[],t=[],r=this,n=a(c.prototype);r;)t.push(r),r=r.$$parent;return t.reverse(),B(t,function(t){B(a(t),function(t){i(e,t)===-1&&i(n,t)===-1&&e.push(t)})}),e},$$values:function(e){var t={},r=this;return B(r.$$keys(),function(n){t[n]=r[n].value(e&&e[n])}),t},$$equals:function(e,t){var r=!0,n=this;return B(n.$$keys(),function(o){var s=e&&e[o],a=t&&t[o];n[o].type.equals(s,a)||(r=!1)}),r},$$validates:function(e){var n,o,s,a,i,l=this.$$keys();for(n=0;n=0)throw new Error("State must have a valid name");if(j.hasOwnProperty(r))throw new Error("State '"+r+"' is already defined");var o=r.indexOf(".")!==-1?r.substring(0,r.lastIndexOf(".")):R(t.parent)?t.parent:H(t.parent)&&R(t.parent.name)?t.parent.name:"";if(o&&!j[o])return m(o,t.self);for(var s in T)k(T[s])&&(t[s]=T[s](t,T.$delegates[s]));return j[r]=t,!t[F]&&t.url&&e.when(t.url,["$match","$stateParams",function(e,r){S.$current.navigable==t&&u(e,r)||S.transitionTo(t,e,{inherit:!0,location:!1})}]),v(r),t}function $(e){return e.indexOf("*")>-1}function P(e){for(var t=e.split("."),r=S.$current.name.split("."),n=0,o=t.length;n=j;n--)a=d[n],a.self.onExit&&i.invoke(a.self.onExit,a.self,a.locals.globals),a.locals=null;for(n=j;n2?c.enter(e,null,r).then(n):c.enter(e,null,r,n)},leave:function(e,r){t.version.minor>2?c.leave(e).then(r):c.leave(e,r)}};if(u){var o=u&&u(r,e);return{enter:function(e,t,r){o.enter(e,null,t),r()},leave:function(e,t){o.leave(e),t()}}}return n()}var l=a(),u=l("$animator"),c=l("$animate"),p={restrict:"ECA",terminal:!0,priority:400,transclude:"element",compile:function(r,a,l){return function(r,a,u){function c(){if(f&&(f.remove(),f=null),d&&(d.$destroy(),d=null),m){var e=m.data("$uiViewAnim");$.leave(m,function(){e.$$animLeave.resolve(),f=null}),f=m,m=null}}function p(i){var p,f=D(r,u,a,o),P=f&&e.$current&&e.$current.locals[f];if(i||P!==g){p=r.$new(),g=e.$current.locals[f],p.$emit("$viewContentLoading",f);var y=l(p,function(e){var o=s.defer(),i=s.defer(),l={$animEnter:o.promise,$animLeave:i.promise,$$animLeave:i};e.data("$uiViewAnim",l),$.enter(e,a,function(){o.resolve(),d&&d.$emit("$viewContentAnimationEnded"),(t.isDefined(h)&&!h||r.$eval(h))&&n(e)}),c()});m=y,d=p,d.$emit("$viewContentLoaded",f),d.$eval(v)}}var f,m,d,g,v=u.onload||"",h=u.autoscroll,$=i(u,r);a.inheritedData("$uiView");r.$on("$stateChangeSuccess",function(){p(!1)}),p(!0)}}};return p}function j(e,r,n,o){return{restrict:"ECA",priority:-400,compile:function(s){var a=s.html();return function(s,i,l){var u=n.$current,c=D(s,l,i,o),p=u&&u.locals[c];if(p){i.data("$uiView",{name:c,state:p.$$state}),i.html(p.$template?p.$template:a);var f=t.extend({},p);s[p.$$resolveAs]=f;var m=e(i.contents());if(p.$$controller){p.$scope=s,p.$element=i;var d=r(p.$$controller,p);p.$$controllerAs&&(s[p.$$controllerAs]=d,s[p.$$controllerAs][p.$$resolveAs]=f),k(d.$onInit)&&d.$onInit(),i.data("$ngControllerController",d),i.children().data("$ngControllerController",d)}m(s)}}}}}function D(e,t,r,n){var o=n(t.uiView||t.name||"")(e),s=r.inheritedData("$uiView");return o.indexOf("@")>=0?o:o+"@"+(s?s.state.name:"")}function F(e,t){var r,n=e.match(/^\s*({[^}]*})\s*$/);if(n&&(e=t+"("+n[1]+")"),r=e.replace(/\n/g," ").match(/^([^(]+?)\s*(\((.*)\))?$/),!r||4!==r.length)throw new Error("Invalid state ref '"+e+"'");return{state:r[1],paramExpr:r[3]||null}}function T(e){var t=e.parent().inheritedData("$uiView");if(t&&t.state&&t.state.name)return t.state}function x(e){var t="[object SVGAnimatedString]"===Object.prototype.toString.call(e.prop("href")),r="FORM"===e[0].nodeName;return{attr:r?"action":t?"xlink:href":"href",isAnchor:"A"===e.prop("tagName").toUpperCase(),clickable:!r}}function I(e,t,r,n,o){return function(s){var a=s.which||s.button,i=o();if(!(a>1||s.ctrlKey||s.metaKey||s.shiftKey||e.attr("target"))){var l=r(function(){t.go(i.state,i.params,i.options)});s.preventDefault();var u=n.isAnchor&&!i.href?1:0;s.preventDefault=function(){u--<=0&&r.cancel(l)}}}}function M(e,t){return{relative:T(e)||t.$current,inherit:!0}}function N(e,r){return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(n,o,s,a){var i,l=F(s.uiSref,e.current.name),u={state:l.state,href:null,params:null},c=x(o),p=a[1]||a[0],f=null;u.options=_(M(o,e),s.uiSrefOpts?n.$eval(s.uiSrefOpts):{});var m=function(r){r&&(u.params=t.copy(r)),u.href=e.href(l.state,u.params,u.options),f&&f(),p&&(f=p.$$addStateInfo(l.state,u.params)),null!==u.href&&s.$set(c.attr,u.href)};l.paramExpr&&(n.$watch(l.paramExpr,function(e){e!==u.params&&m(e)},!0),u.params=t.copy(n.$eval(l.paramExpr))),m(),c.clickable&&(i=I(o,e,r,c,function(){return u}),o[o.on?"on":"bind"]("click",i),n.$on("$destroy",function(){o[o.off?"off":"unbind"]("click",i)}))}}}function E(e,t){return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(r,n,o,s){function a(t){f.state=t[0],f.params=t[1],f.options=t[2],f.href=e.href(f.state,f.params,f.options),m&&m(),u&&(m=u.$$addStateInfo(f.state,f.params)),f.href&&o.$set(l.attr,f.href)}var i,l=x(n),u=s[1]||s[0],c=[o.uiState,o.uiStateParams||null,o.uiStateOpts||null],p="["+c.map(function(e){return e||"null"}).join(", ")+"]",f={state:null,params:null,options:null,href:null},m=null;r.$watch(p,a,!0),a(r.$eval(p)),l.clickable&&(i=I(n,e,t,l,function(){return f}),n[n.on?"on":"bind"]("click",i),r.$on("$destroy",function(){n[n.off?"off":"unbind"]("click",i)}))}}}function L(e,t,r){return{restrict:"A",controller:["$scope","$element","$attrs","$timeout",function(t,n,o,s){function a(t,r,o){var s=e.get(t,T(n)),a=i(t,r),l={state:s||{name:t},params:r,hash:a};return g.push(l),v[a]=o,function(){var e=g.indexOf(l);e!==-1&&g.splice(e,1)}}function i(e,r){if(!R(e))throw new Error("state should be a string");return H(r)?e+G(r):(r=t.$eval(r),H(r)?e+G(r):e)}function l(){for(var e=0;e0)){var r=a(e,t,d);return l(),r}},t.$on("$stateChangeSuccess",l),l()}]}}function U(e){var t=function(t,r){return e.is(t,r)};return t.$stateful=!0,t}function q(e){var t=function(t,r,n){return e.includes(t,r,n)};return t.$stateful=!0,t}var O=t.isDefined,k=t.isFunction,R=t.isString,H=t.isObject,V=t.isArray,B=t.forEach,_=t.extend,z=t.copy,G=t.toJson;t.module("ui.router.util",["ng"]),t.module("ui.router.router",["ui.router.util"]),t.module("ui.router.state",["ui.router.router","ui.router.util"]),t.module("ui.router",["ui.router.state"]),t.module("ui.router.compat",["ui.router"]),v.$inject=["$q","$injector"],t.module("ui.router.util").service("$resolve",v),h.$inject=["$http","$templateCache","$injector"],t.module("ui.router.util").service("$templateFactory",h);var Y;$.prototype.concat=function(e,t){var r={caseInsensitive:Y.caseInsensitive(),strict:Y.strictMode(),squash:Y.defaultSquashPolicy()};return new $(this.sourcePath+e+this.sourceSearch,_(r,t),this)},$.prototype.toString=function(){return this.source},$.prototype.exec=function(e,t){function r(e){function t(e){return e.split("").reverse().join("")}function r(e){return e.replace(/\\-/g,"-")}var n=t(e).split(/-(?!\\)/),o=d(n,t);return d(o,r).reverse()}var n=this.regexp.exec(e);if(!n)return null;t=t||{};var o,s,a,i=this.parameters(),l=i.length,u=this.segments.length-1,c={};if(u!==n.length-1)throw new Error("Unbalanced capture group in route '"+this.source+"'");var p,f;for(o=0;o0&&(t.disqus_config=function(){this.page.remote_auth_s3=s.remote_auth_s3,this.page.api_key=s.api_key})}function u(){var r=t.DISQUSWIDGETS;r&&e.isFunction(r.getCount)&&r.getCount()}function c(e,r,n){var s=o();t.DISQUS.reset({reload:!0,config:function(){this.page.identifier=r,this.page.url=e.absUrl(),this.page.title=n,this.page.remote_auth_s3=s.remote_auth_s3,this.page.api_key=s.api_key}})}function p(e){var t=n(),o=r(),l=s(t,e);i(o,l)||o.appendChild(a(l))}var f,m="embed.js",d="count.js";this.setShortname=function(e){f=e},this.$get=["$location",function(r){function o(n,o){if(!e.isDefined(f))throw new Error("No disqus shortname defined");if(!e.isDefined(n))throw new Error("No disqus thread id defined");e.isDefined(t.DISQUS)?c(r,n,o):(l(r,n,o),p(m))}function s(n){t.disqus_sso=n,e.isDefined(t.DISQUS)&&c(r,t.disqus_identifier,t.disqus_title)}function a(e){l(r,e),p(m),p(d),u()}return{commit:o,getShortname:n,setSso:s,loadCount:a}}]}),r.service("disqusService",["$disqus",function(e){return{setSso:function(t){e.setSso(t)}}}]),r.directive("disqus",["$disqus",function(t){return{restrict:"AC",replace:!0,scope:{id:"=disqus",title:"=title"},template:'
',link:function(r){r.$watch("id",function(n){e.isDefined(n)&&t.commit(n,r.title)})}}}]),r.directive("disqusIdentifier",["$disqus",function(e){return{restrict:"A",link:function(t,r,n){e.loadCount(n.disqusIdentifier)}}}])}(angular,this),angular.module("frontpress.template-cache",[]),angular.module("frontpress.template-cache").run(["$templateCache",function(e){e.put("/js/components/featured-image/templates/featured-image.template.html",''),e.put("/js/components/full-post/templates/full-post-categories-list.template.html",'
\n\t

carregando categorias...

\n\t

\n\t\tcategorias:\t\n\t\t\t\t\n\t\t{{category.name}}{{$last ? "" : ", "}}\t\t\n\t\t\t\t\n\t

\n
'),e.put("/js/components/full-post/templates/full-post-content-v1.template.html",'
'),e.put("/js/components/full-post/templates/full-post-content-v2.template.html",'
'),e.put("/js/components/full-post/templates/full-post-tags-list.template.html",'
\n\t

carregando tags...

\n\t

\n\t\ttags:\t\n\t\t\t\t\n\t\t{{tag.name}}{{$last ? "" : ", "}}\t\t\n\t\t\t\t\n\t

\n
'),e.put("/js/components/full-post/templates/full-post-title-v1.template.html",'

'),e.put("/js/components/full-post/templates/full-post-title-v2.template.html",'

'),e.put("/js/components/full-post/templates/full-post.template.html",'
\t\n\t

carregando...

\n\t
\t\t\n\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t \n\t\t\n\t\t \n\t\t \n\t
\n
'),e.put("/js/components/list-posts/templates/list-posts-excerpt-v1.template.html",'

'),e.put("/js/components/list-posts/templates/list-posts-excerpt-v2.template.html",'

'),e.put("/js/components/list-posts/templates/list-posts-title-v1.template.html",'

'),e.put("/js/components/list-posts/templates/list-posts-title-v2.template.html",'

'),e.put("/js/components/list-posts/templates/list-posts.template.html",'
\n\t

Carregando posts

\n\t
\t\n\t\t\t\n\t\t\n\t\t\t\n\t\t\n \n\t
\n
\n'),e.put("/js/components/page-head/templates/page-head.template.html",'\n\n\n\t\n\n\n\n\n\n'),e.put("/js/components/pagination/templates/pagination.template.html",'
\n\t<<\n\t\n\t\t\t\n\n\t>>\n
'),e.put("/js/components/post-date/templates/post-date.template.html","

"),e.put("/js/components/share/templates/share.template.html","
\n Share:\n Twitter\n Facebook\n Google+\n
\n"),e.put("/js/views/home/templates/home.template.html",'
\n\t
\n\t\t\n\t\tCarregando posts novos ...\n\t\t\n\t
\n
'), e.put("/js/views/post/templates/post.template.html","
\n\t\n
")}]),angular.module("frontpress",["frontpress.views","frontpress.apis.blog","frontpress.components.slugs-map","frontpress.components.frontpress-provider","frontpress.template-cache"]);var module=angular.module("frontpress");FrontPressConfig.$inject=["$qProvider"],module.config(FrontPressConfig);var module=angular.module("frontpress");module.run(frontpressRun),angular.module("frontpress.apis.configs-to-params",[]);var module=angular.module("frontpress.apis.configs-to-params");module.factory("ConfigsToParams",ConfigsToParams),angular.module("frontpress.filters",[]),angular.module("frontpress.views",["frontpress.views.home","frontpress.views.post"]),angular.module("frontpress.components.ajax",[]),angular.module("frontpress.components.api-manager",["frontpress.apis.api-manager-map"]),angular.module("frontpress.components.blog",["frontpress.components.frontpress-provider","frontpress.components.api-manager","frontpress.apis.blog"]),angular.module("frontpress.components.featured-image",["frontpress.components.frontpress-provider"]),angular.module("frontpress.components.frontpress-provider",["ngDisqus"]),angular.module("frontpress.components.full-post",["frontpress.filters","frontpress.apis.tags","frontpress.apis.posts","frontpress.apis.categories","frontpress.apis.media","frontpress.components.post-date","frontpress.apis.api-manager-map","frontpress.components.blog","frontpress.components.featured-image","frontpress.components.frontpress-provider"]),angular.module("frontpress.components.list-posts",["frontpress.filters","frontpress.components.slugs-map","frontpress.apis.posts","frontpress.apis.media","frontpress.components.api-manager","frontpress.components.post-date","frontpress.components.featured-image","frontpress.components.frontpress-provider"]),angular.module("frontpress.components.page-head",["frontpress.components.frontpress-provider"]),angular.module("frontpress.components.pagination",["frontpress.components.page-head","frontpress.components.frontpress-provider"]),angular.module("frontpress.components.post-date",["frontpress.components.frontpress-provider"]),angular.module("frontpress.components.share",["frontpress.filters","frontpress.apis.api-manager-map","frontpress.components.frontpress-provider"]),angular.module("frontpress.components.slugs-map",["frontpress.apis.posts","frontpress.apis.api-manager-map"]),angular.module("frontpress.views.home",["ui.router","infinite-scroll","frontpress.components.list-posts","frontpress.components.pagination","frontpress.components.page-head","frontpress.components.api-manager","frontpress.components.blog","frontpress.components.frontpress-provider"]),angular.module("frontpress.views.post",["frontpress.components.full-post","frontpress.components.share","ui.router","frontpress.components.page-head","frontpress.components.blog","ngDisqus","frontpress.components.slugs-map","frontpress.components.api-manager","frontpress.components.frontpress-provider"]),angular.module("frontpress.components.featured-image").directive("featuredImage",FeaturedImageDirective),FeaturedImageDirective.$inject=["$FrontPress"];var module=angular.module("frontpress.components.full-post");module.directive("fullPostCategoriesList",FullPostCategoriesListDirective),FullPostCategoriesListDirective.$inject=["$FrontPress"];var module=angular.module("frontpress.components.full-post");module.directive("fullPostContent",FullPostContentDirective),FullPostContentDirective.$inject=["$FrontPress"];var module=angular.module("frontpress.components.full-post");module.directive("fullPostTagsList",FullPostTagListDirective),FullPostTagListDirective.$inject=["$FrontPress"];var module=angular.module("frontpress.components.full-post");module.directive("fullPostTitle",FullPostTitleDirective),FullPostTitleDirective.$inject=["$FrontPress"],angular.module("frontpress.components.full-post").directive("fullPost",FullPostDirective),FullPostDirective.$inject=["$FrontPress"],angular.module("frontpress.components.list-posts").directive("listPostsExcerpt",ListPostsExcerptDirective),ListPostsExcerptDirective.$inject=["$FrontPress"],angular.module("frontpress.components.list-posts").directive("listPostsTitle",ListPostsTitleDirective),ListPostsTitleDirective.$inject=["$FrontPress"],angular.module("frontpress.components.list-posts").directive("listPosts",ListPostsDirective),ListPostsDirective.$inject=["$FrontPress"];var module=angular.module("frontpress.components.page-head");module.directive("pageHead",pageHead),pageHead.$inject=["$FrontPress"];var module=angular.module("frontpress.components.pagination");module.directive("pagination",pagination),pagination.$inject=["$FrontPress"],angular.module("frontpress.components.post-date").directive("postDate",PostDateDirective),PostDateDirective.$inject=["$FrontPress"],angular.module("frontpress.components.share").directive("share",share),share.$inject=["$FrontPress"],angular.module("frontpress.views.home").directive("homeView",HomeViewDirective),HomeViewDirective.$inject=["$FrontPress"],angular.module("frontpress.views.post").directive("postView",PostViewDirective),PostViewDirective.$inject=["$FrontPress"],angular.module("infinite-scroll").value("THROTTLE_MILLISECONDS",1e3),angular.module("frontpress.filters").filter("trustAsHtml",TrustAsHtml),TrustAsHtml.$inject=["$sce"],angular.module("frontpress.views.home").config(configHome),configHome.$inject=["$stateProvider","$urlRouterProvider","$FrontPressProvider"],angular.module("frontpress.views.post").config(configPost),configPost.$inject=["$stateProvider","$FrontPressProvider"];var module=angular.module("frontpress.components.ajax");AjaxModel.$inject=["$http"],module.factory("AjaxModel",AjaxModel),angular.module("frontpress.components.api-manager").service("ApiManager",ApiManager),ApiManager.$inject=["ApiManagerMap"],angular.module("frontpress.components.blog").factory("BlogModel",BlogModel),BlogModel.$inject=["BlogApi","$q","ApiManager","$FrontPress"];var module=angular.module("frontpress.components.featured-image");module.controller("FeaturedImageDirectiveController",FeaturedImageDirectiveController);var module=angular.module("frontpress.components.frontpress-provider");module.provider("$FrontPress",FrontPressProvider),FrontPressProvider.$inject=["FrontPressConfigurationFile","$disqusProvider"],angular.module("frontpress.components.full-post").controller("FullPostCategoriesListDirectiveController",FullPostCategoriesListDirectiveController),angular.module("frontpress.components.full-post").controller("FullPostDirectiveController",FullPostDirectiveController),FullPostDirectiveController.$inject=["FullPostModel","BlogModel"];var module=angular.module("frontpress.components.full-post");module.controller("FullPostGenericDirectiveController",FullPostGenericDirectiveController);var module=angular.module("frontpress.components.full-post");module.controller("FullPostTagsListDirectiveController",FullPostTagsListDirectiveController);var module=angular.module("frontpress.components.full-post");module.factory("FullPostModel",FullPostModel),FullPostModel.$inject=["PostsApi","TagsApi","CategoriesApi","$q","MediaApi","$FrontPress","ApiManagerMap"],angular.module("frontpress.components.list-posts").controller("ListPostsDirectiveController",ListPostsDirectiveController),ListPostsDirectiveController.$inject=["ListPostsModel"];var module=angular.module("frontpress.components.list-posts");module.controller("ListPostsGenericDirectiveController",ListPostsGenericDirectiveController),angular.module("frontpress.components.list-posts").factory("ListPostsModel",ListPostsModel),ListPostsModel.$inject=["PostsApi","MediaApi","$q","SlugsMapModel","ApiManager"],angular.module("frontpress.components.page-head").controller("PageHeadController",PageHeadController),PageHeadController.$inject=["PageHeadModel"];var module=angular.module("frontpress.components.page-head");module.factory("PageHeadModel",PageHeadModel),PageHeadModel.$inject=["$location","$FrontPress"],angular.module("frontpress.components.pagination").controller("PaginationController",PaginationController),PaginationController.$inject=["PaginationModel"];var module=angular.module("frontpress.components.pagination");module.factory("PaginationModel",PaginationModel),PaginationModel.$inject=["PageHeadModel"];var module=angular.module("frontpress.components.post-date");module.controller("PostDateDirectiveController",PostDateDirectiveController),PostDateDirectiveController.$inject=[];var module=angular.module("frontpress.components.share");module.controller("ShareController",ShareController),ShareController.$inject=["ShareModel"];var module=angular.module("frontpress.components.share");module.factory("ShareModel",ShareModel),ShareModel.$inject=["$window","ApiManager"],angular.module("frontpress.components.slugs-map").factory("SlugsMapModel",SlugsMapModel),SlugsMapModel.$inject=["$cacheFactory","PostsApi","ApiManagerMap"];var module=angular.module("frontpress.views.home");module.controller("HomeDirectiveController",HomeDirectiveController),HomeDirectiveController.$inject=["$stateParams","ListPostsModel","$state","$FrontPress","BlogModel","PageHeadModel","$location","PaginationModel"],angular.module("frontpress.views.home").controller("HomeRouteController",HomeRouteController),HomeRouteController.$inject=[];var module=angular.module("frontpress.views.post");module.controller("PostDirectiveController",PostDirectiveController),PostDirectiveController.$inject=["FullPostModel","$stateParams","PageHeadModel","SlugsMapModel","CategoriesApi","ApiManager","ApiManagerMap","BlogModel","$q"];var module=angular.module("frontpress.views.post");module.controller("PostRouteController",PostRouteController),PostRouteController.$inject=[],angular.module("frontpress.apis.api-manager-map",[]),angular.module("frontpress.apis.blog",["frontpress.components.ajax","frontpress.components.frontpress-provider"]),angular.module("frontpress.apis.categories",["frontpress.components.ajax","frontpress.components.frontpress-provider","frontpress.apis.configs-to-params"]),angular.module("frontpress.apis.media",["frontpress.components.ajax","frontpress.components.frontpress-provider","frontpress.apis.configs-to-params"]),angular.module("frontpress.apis.posts",["frontpress.components.ajax","frontpress.components.frontpress-provider","frontpress.apis.configs-to-params"]),angular.module("frontpress.apis.tags",["frontpress.components.ajax","frontpress.components.frontpress-provider","frontpress.apis.configs-to-params"]),angular.module("frontpress.apis.api-manager-map").constant("ApiManagerMap",{totalPostsNumber:["found"],allPostsPath:["posts"],postTitle:["title"],postId:["ID"],postDate:["date"],siteName:["name"],siteDescription:["description"]}),angular.module("frontpress.apis.blog").factory("BlogApi",BlogApi),BlogApi.$inject=["AjaxModel","$FrontPress"];var module=angular.module("frontpress.apis.categories");CategoriesApi.$inject=["AjaxModel","$FrontPress","ConfigsToParams"],module.factory("CategoriesApi",CategoriesApi);var module=angular.module("frontpress.apis.media");MediaApi.$inject=["AjaxModel","$FrontPress","ConfigsToParams"],module.factory("MediaApi",MediaApi),angular.module("frontpress.apis.posts").factory("PostsApi",PostsApi),PostsApi.$inject=["AjaxModel","$FrontPress","ConfigsToParams"],angular.module("frontpress.apis.categories").factory("TagsApi",TagsApi),TagsApi.$inject=["AjaxModel","$FrontPress","ConfigsToParams"]; \ No newline at end of file