From 347ca0c77f802943cf3ccdd175945073387cd3b9 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Tue, 11 Sep 2018 07:40:06 +0200 Subject: [PATCH] [enh] add a .gitignore --- .gitignore | 4 ++++ static/js/vue-timeago.min.js | 2 ++ 2 files changed, 6 insertions(+) create mode 100644 .gitignore create mode 100644 static/js/vue-timeago.min.js diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b6bc576 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +ve3 +db.sqlite +__pycache__ +.pythonz diff --git a/static/js/vue-timeago.min.js b/static/js/vue-timeago.min.js new file mode 100644 index 0000000..42b2745 --- /dev/null +++ b/static/js/vue-timeago.min.js @@ -0,0 +1,2 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.VueTimeago={})}(this,function(e){"use strict";var t=function(e){return e instanceof Date},n=36e5,r=6e4,a=2,o=/[T ]/,u=/:/,i=/^(\d{2})$/,s=[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],c=/^(\d{4})/,d=[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],f=/^-(\d{2})$/,l=/^-?(\d{3})$/,h=/^-?(\d{2})-?(\d{2})$/,v=/^-?W(\d{2})$/,p=/^-?W(\d{2})-?(\d{1})$/,m=/^(\d{2}([.,]\d*)?)$/,g=/^(\d{2}):?(\d{2}([.,]\d*)?)$/,M=/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,y=/([Z+-].*)$/,D=/^(Z)$/,T=/^([+-])(\d{2})$/,x=/^([+-])(\d{2}):?(\d{2})$/;function S(e,t,n){t=t||0,n=n||0;var r=new Date(0);r.setUTCFullYear(e,0,4);var a=7*t+n+1-(r.getUTCDay()||7);return r.setUTCDate(r.getUTCDate()+a),r}var b=function(e,b){if(t(e))return new Date(e.getTime());if("string"!=typeof e)return new Date(e);var I=(b||{}).additionalDigits;I=null==I?a:Number(I);var Y=function(e){var t,n={},r=e.split(o);if(u.test(r[0])?(n.date=null,t=r[0]):(n.date=r[0],t=r[1]),t){var a=y.exec(t);a?(n.time=t.replace(a[1],""),n.timezone=a[1]):n.time=t}return n}(e),U=function(e,t){var n,r=s[t],a=d[t];if(n=c.exec(e)||a.exec(e)){var o=n[1];return{year:parseInt(o,10),restDateString:e.slice(o.length)}}if(n=i.exec(e)||r.exec(e)){var u=n[1];return{year:100*parseInt(u,10),restDateString:e.slice(u.length)}}return{year:null}}(Y.date,I),X=U.year,w=function(e,t){if(null===t)return null;var n,r,a,o;if(0===e.length)return(r=new Date(0)).setUTCFullYear(t),r;if(n=f.exec(e))return r=new Date(0),a=parseInt(n[1],10)-1,r.setUTCFullYear(t,a),r;if(n=l.exec(e)){r=new Date(0);var u=parseInt(n[1],10);return r.setUTCFullYear(t,0,u),r}if(n=h.exec(e)){r=new Date(0),a=parseInt(n[1],10)-1;var i=parseInt(n[2],10);return r.setUTCFullYear(t,a,i),r}if(n=v.exec(e))return o=parseInt(n[1],10)-1,S(t,o);if(n=p.exec(e)){o=parseInt(n[1],10)-1;var s=parseInt(n[2],10)-1;return S(t,o,s)}return null}(U.restDateString,X);if(w){var F,$=w.getTime(),W=0;return Y.time&&(W=function(e){var t,a,o;if(t=m.exec(e))return(a=parseFloat(t[1].replace(",",".")))%24*n;if(t=g.exec(e))return a=parseInt(t[1],10),o=parseFloat(t[2].replace(",",".")),a%24*n+o*r;if(t=M.exec(e)){a=parseInt(t[1],10),o=parseInt(t[2],10);var u=parseFloat(t[3].replace(",","."));return a%24*n+o*r+1e3*u}return null}(Y.time)),Y.timezone?(O=Y.timezone,F=(z=D.exec(O))?0:(z=T.exec(O))?(H=60*parseInt(z[2],10),"+"===z[1]?-H:H):(z=x.exec(O))?(H=60*parseInt(z[2],10)+parseInt(z[3],10),"+"===z[1]?-H:H):0):(F=new Date($+W).getTimezoneOffset(),F=new Date($+W+F*r).getTimezoneOffset()),new Date($+W+F*r)}var O,z,H;return new Date(e)};var I=function(e,t){var n=b(e).getTime(),r=b(t).getTime();return n>r?-1:n0?Math.floor(n):Math.ceil(n)};var X=function(e,t){var n=b(e),r=b(t);return 12*(n.getFullYear()-r.getFullYear())+(n.getMonth()-r.getMonth())};var w=function(e,t){var n=b(e).getTime(),r=b(t).getTime();return nr?1:0};var F=function(e,t){var n=b(e),r=b(t),a=w(n,r),o=Math.abs(X(n,r));return n.setMonth(n.getMonth()-a*o),a*(o-(w(n,r)===-a))};var $=["M","MM","Q","D","DD","DDD","DDDD","d","E","W","WW","YY","YYYY","GG","GGGG","H","HH","h","hh","m","mm","s","ss","S","SS","SSS","Z","ZZ","X","x"];var W=function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);var r=$.concat(t).sort().reverse();return new RegExp("(\\[[^\\[]*\\])|(\\\\)?("+r.join("|")+"|.)","g")};var O=function(){var e=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],t=["January","February","March","April","May","June","July","August","September","October","November","December"],n=["Su","Mo","Tu","We","Th","Fr","Sa"],r=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],a=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],o=["AM","PM"],u=["am","pm"],i=["a.m.","p.m."],s={MMM:function(t){return e[t.getMonth()]},MMMM:function(e){return t[e.getMonth()]},dd:function(e){return n[e.getDay()]},ddd:function(e){return r[e.getDay()]},dddd:function(e){return a[e.getDay()]},A:function(e){return e.getHours()/12>=1?o[1]:o[0]},a:function(e){return e.getHours()/12>=1?u[1]:u[0]},aa:function(e){return e.getHours()/12>=1?i[1]:i[0]}};return["M","D","DDD","d","Q","W"].forEach(function(e){s[e+"o"]=function(t,n){return function(e){var t=e%100;if(t>20||t<10)switch(t%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"}(n[e](t))}}),{formatters:s,formattingTokensRegExp:W(s)}},z={distanceInWords:function(){var e={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};return{localize:function(t,n,r){var a;return r=r||{},a="string"==typeof e[t]?e[t]:1===n?e[t].one:e[t].other.replace("{{count}}",n),r.addSuffix?r.comparison>0?"in "+a:a+" ago":a}}}(),format:O()},H=1440,A=2520,C=43200,G=86400;var J=function(e,t,n){var r=n||{},a=I(e,t),o=r.locale,u=z.distanceInWords.localize;o&&o.distanceInWords&&o.distanceInWords.localize&&(u=o.distanceInWords.localize);var i,s,c={addSuffix:Boolean(r.addSuffix),comparison:a};a>0?(i=b(e),s=b(t)):(i=b(t),s=b(e));var d,f=U(s,i),l=s.getTimezoneOffset()-i.getTimezoneOffset(),h=Math.round(f/60)-l;if(h<2)return r.includeSeconds?f<5?u("lessThanXSeconds",5,c):f<10?u("lessThanXSeconds",10,c):f<20?u("lessThanXSeconds",20,c):f<40?u("halfAMinute",null,c):u(f<60?"lessThanXMinutes":"xMinutes",1,c):0===h?u("lessThanXMinutes",1,c):u("xMinutes",h,c);if(h<45)return u("xMinutes",h,c);if(h<90)return u("aboutXHours",1,c);if(h0&&void 0!==arguments[0]?arguments[0]:{},t=e.locales||{};return{name:e.name||"Timeago",props:{datetime:{required:!0},title:{type:[String,Boolean]},locale:{type:String},autoUpdate:{type:[Number,Boolean]},converter:{type:Function},converterOptions:{type:Object}},data:function(){return{timeago:this.getTimeago()}},mounted:function(){this.startUpdater()},beforeDestroy:function(){this.stopUpdater()},render:function(e){return e("time",{attrs:{datetime:new Date(this.datetime),title:"string"==typeof this.title?this.title:!1===this.title?null:this.timeago}},[this.timeago])},methods:{getTimeago:function(n){return(this.converter||e.converter||j)(n||this.datetime,t[this.locale||e.locale],this.converterOptions||{})},convert:function(e){this.timeago=this.getTimeago(e)},startUpdater:function(){var e=this;if(this.autoUpdate){var t=!0===this.autoUpdate?60:this.autoUpdate;this.updater=setInterval(function(){e.convert()},1e3*t)}},stopUpdater:function(){this.updater&&(clearInterval(this.updater),this.updater=null)}},watch:{autoUpdate:function(e){this.stopUpdater(),e&&this.startUpdater()},datetime:function(){this.convert()},locale:function(){this.convert()},converter:function(){this.convert()},converterOptions:{handler:function(){this.convert()},deep:!0}}}},N=function(e,t){var n=E(t);e.component(n.name,n)},B=j;e.createTimeago=E,e.install=N,e.converter=B,e.default=N,Object.defineProperty(e,"__esModule",{value:!0})}); +//# sourceMappingURL=vue-timeago.min.js.map