l+s){var h=Math.min(r,(f?u:i)-s);h!=l&&(c.scrollTop=h)}var p=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:o.scroller.scrollLeft,g=_e(e)-(e.options.fixedGutter?o.gutters.offsetWidth:0),m=n-t>g;return m&&(n=t+g),t<10?c.scrollLeft=0:tg+p-3&&(c.scrollLeft=n+(m?0:10)-g),
-c}function Er(e,t,r){null==t&&null==r||Br(e),null!=t&&(e.curOp.scrollLeft=(null==e.curOp.scrollLeft?e.doc.scrollLeft:e.curOp.scrollLeft)+t),null!=r&&(e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+r)}function Fr(e){Br(e);var t=e.getCursor(),r=t,n=t;e.options.lineWrapping||(r=t.ch?Bo(t.line,t.ch-1):t,n=Bo(t.line,t.ch+1)),e.curOp.scrollToPos={from:r,to:n,margin:e.options.cursorScrollMargin,isCursor:!0}}function Br(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=gt(e,t.from),n=gt(e,t.to),i=Ir(e,Math.min(r.left,n.left),Math.min(r.top,n.top)-t.margin,Math.max(r.right,n.right),Math.max(r.bottom,n.bottom)+t.margin);e.scrollTo(i.scrollLeft,i.scrollTop)}}function Rr(e,t,r,n){var i,o=e.doc;null==r&&(r="add"),"smart"==r&&(o.mode.indent?i=Ve(e,t):r="prev");var a=e.options.tabSize,l=Qn(o,t),s=ja(l.text,null,a);l.stateAfter&&(l.stateAfter=null);var c,u=l.text.match(/^\s*/)[0];if(n||/\S/.test(l.text)){if("smart"==r&&(c=o.mode.indent(i,l.text.slice(u.length),l.text),c==Ea||c>150)){if(!n)return;r="prev"}}else c=0,r="not";"prev"==r?c=t>o.first?ja(Qn(o,t-1).text,null,a):0:"add"==r?c=s+e.options.indentUnit:"subtract"==r?c=s-e.options.indentUnit:"number"==typeof r&&(c=s+r),c=Math.max(0,c);var d="",f=0;if(e.options.indentWithTabs)for(var h=Math.floor(c/a);h;--h)f+=a,d+="\t";if(f=0;t--)zr(e.doc,"",n[t].from,n[t].to,"+delete");Fr(e)})}function Kr(e,t,r,n,i){function o(){var t=l+r;return!(t=e.first+e.size)&&(l=t,u=Qn(e,t))}function a(e){var t=(i?ho:po)(u,s,r,!0);if(null==t){if(e||!o())return!1;s=i?(r<0?oo:io)(u):r<0?u.text.length:0}else s=t;return!0}var l=t.line,s=t.ch,c=r,u=Qn(e,l);if("char"==n)a();else if("column"==n)a(!0);else if("word"==n||"group"==n)for(var d=null,f="group"==n,h=e.cm&&e.cm.getHelper(t,"wordChars"),p=!0;!(r<0)||a(!p);p=!1){var g=u.text.charAt(s)||"\n",m=Ri(g,h)?"w":f&&"\n"==g?"n":!f||/\s/.test(g)?null:"p";if(!f||p||m||(m="s"),d&&d!=m){r<0&&(r=1,a());break}if(m&&(d=m),r>0&&!a(!p))break}var v=ze(e,Bo(l,s),t,c,!0);return Ro(t,v)||(v.hitSide=!0),v}function Gr(e,t,r,n){var i,o=e.doc,a=t.left;if("page"==n){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);i=t.top+r*(l-(r<0?1.5:.5)*bt(e.display))}else"line"==n&&(i=r>0?t.bottom+3:t.top-3);for(;;){var s=vt(e,a,i);if(!s.outside)break;if(r<0?i<=0:i>=o.height){s.hitSide=!0;break}i+=5*r}return s}function Ur(t,r,n,i){e.defaults[t]=r,n&&(ra[t]=i?function(e,t,r){r!=na&&n(e,t,r)}:n)}function qr(e){for(var t,r,n,i,o=e.split(/-(?!$)/),e=o[o.length-1],a=0;a0||0==a&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=Ki("span",[o.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(yn(e,t.line,t,r,o)||t.line!=r.line&&yn(e,r.line,t,r,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Fo=!0}o.addToHistory&&ui(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var l,s=t.line,c=e.cm;if(e.iter(s,r.line+1,function(e){c&&o.collapsed&&!c.options.lineWrapping&&bn(e)==c.display.maxLine&&(l=!0),o.collapsed&&s!=t.line&&ti(e,0),rn(e,new Jr(o,s==t.line?t.ch:null,s==r.line?r.ch:null)),++s}),o.collapsed&&e.iter(t.line,r.line+1,function(t){Cn(e,t)&&ti(t,0)}),o.clearOnEnter&&Wa(o,"beforeCursorEnter",function(){o.clear()}),o.readOnly&&(Eo=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++va,o.atomic=!0),c){if(l&&(c.curOp.updateMaxLine=!0),o.collapsed)It(c,t.line,r.line+1);else if(o.className||o.title||o.startStyle||o.endStyle||o.css)for(var u=t.line;u<=r.line;u++)Et(c,u,"text");o.atomic&&Ae(c.doc),Li(c,"markerAdded",c,o)}return o}function Xr(e,t,r,n,i){n=Fi(n),n.shared=!1;var o=[$r(e,t,r,n,i)],a=o[0],l=n.widgetNode;return Yn(e,function(e){l&&(n.widgetNode=l.cloneNode(!0)),o.push($r(e,ge(e,t),ge(e,r),n,i));for(var s=0;s=t:o.to>t);(n||(n=[])).push(new Jr(a,o.from,s?null:o.to))}}return n}function on(e,t,r){if(e)for(var n,i=0;i=t:o.to>t);if(l||o.from==t&&"bookmark"==a.type&&(!r||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from0&&l)for(var d=0;d0)){var u=[s,1],d=Ro(c.from,l.from),f=Ro(c.to,l.to);(d<0||!a.inclusiveLeft&&!d)&&u.push({from:c.from,to:l.from}),(f>0||!a.inclusiveRight&&!f)&&u.push({from:l.to,to:c.to}),i.splice.apply(i,u),s+=u.length-1}}return i}function un(e){var t=e.markedSpans;if(t){for(var r=0;r=0&&d<=0||u<=0&&d>=0)&&(u<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?Ro(c.to,r)>=0:Ro(c.to,r)>0)||u>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?Ro(c.from,n)<=0:Ro(c.from,n)<0)))return!0}}}function bn(e){for(var t;t=mn(e);)e=t.find(-1,!0).line;return e}function wn(e){for(var t,r;t=vn(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function xn(e,t){var r=Qn(e,t),n=bn(r);return r==n?t:ri(n)}function kn(e,t){if(t>e.lastLine())return t;var r,n=Qn(e,t);if(!Cn(e,n))return t;for(;r=vn(n);)n=r.find(1,!0).line;return ri(n)+1}function Cn(e,t){var r=Fo&&t.markedSpans;if(r)for(var n,i=0;ir.start)return a}throw new Error("Mode "+t.name+" failed to advance stream.")}function Dn(e,t,r,n){function i(e){return{start:d.start,end:d.pos,string:d.current(),type:o||null,state:e?ca(a.mode,u):u}}var o,a=e.doc,l=a.mode;t=ge(a,t);var s,c=Qn(a,t.line),u=Ve(e,t.line,r),d=new ma(c.text,e.options.tabSize);for(n&&(s=[]);(n||d.pose.options.maxHighlightLength?(l=!1,a&&En(e,t,n,d.pos),d.pos=t.length,s=null):s=On(zn(r,d,n,f),o),f){var h=f[0].name;h&&(s="m-"+(s?h+" "+s:h))}if(!l||u!=s){for(;ce&&i.splice(s,1,e,i[s+1],n),s+=2,c=Math.min(e,n)}if(t)if(l.opaque)i.splice(r,s-r,e,"cm-overlay "+t),s=r+2;else for(;re.options.maxHighlightLength?ca(e.doc.mode,n):n);t.stateAfter=n,t.styles=i.styles,i.classes?t.styleClasses=i.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.frontier&&e.doc.frontier++}return t.styles}function En(e,t,r,n){var i=e.doc.mode,o=new ma(t,e.options.tabSize);for(o.start=o.pos=n||0,""==t&&Wn(i,r);!o.eol();)zn(i,o,r),o.start=o.pos}function Fn(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?Ca:ka;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function Bn(e,t){var r=Ki("span",null,null,ko?"padding-right: .1px":null),n={pre:Ki("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:(wo||ko)&&e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o,a=i?t.rest[i-1]:t.line;n.pos=0,n.addToken=jn,Ji(e.display.measure)&&(o=oi(a))&&(n.addToken=Kn(n.addToken,o)),n.map=[];var l=t!=e.display.externalMeasured&&ri(a);Un(a,n,In(e,a,l)),a.styleClasses&&(a.styleClasses.bgClass&&(n.bgClass=$i(a.styleClasses.bgClass,n.bgClass||"")),a.styleClasses.textClass&&(n.textClass=$i(a.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild(Qi(e.display.measure))),0==i?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(ko){var s=n.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return Ha(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=$i(n.pre.className,n.textClass||"")),n}function Rn(e){var t=Ki("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function jn(e,t,r,n,i,o,a){if(t){var l=e.splitSpaces?Vn(t,e.trailingSpace):t,s=e.cm.state.specialChars,c=!1;if(s.test(t))for(var u=document.createDocumentFragment(),d=0;;){s.lastIndex=d;var f=s.exec(t),h=f?f.index-d:t.length-d;if(h){var p=document.createTextNode(l.slice(d,d+h));wo&&xo<9?u.appendChild(Ki("span",[p])):u.appendChild(p),e.map.push(e.pos,e.pos+h,p),e.col+=h,e.pos+=h}if(!f)break;if(d+=h+1,"\t"==f[0]){var g=e.cm.options.tabSize,m=g-e.col%g,p=u.appendChild(Ki("span",zi(m),"cm-tab"));p.setAttribute("role","presentation"),p.setAttribute("cm-text","\t"),e.col+=m}else if("\r"==f[0]||"\n"==f[0]){var p=u.appendChild(Ki("span","\r"==f[0]?"␍":"","cm-invalidchar"));p.setAttribute("cm-text",f[0]),e.col+=1}else{var p=e.cm.options.specialCharPlaceholder(f[0]);p.setAttribute("cm-text",f[0]),wo&&xo<9?u.appendChild(Ki("span",[p])):u.appendChild(p),e.col+=1}e.map.push(e.pos,e.pos+1,p),e.pos++}else{e.col+=t.length;var u=document.createTextNode(l);e.map.push(e.pos,e.pos+t.length,u),wo&&xo<9&&(c=!0),e.pos+=t.length}if(e.trailingSpace=32==l.charCodeAt(t.length-1),r||n||i||c||a){var v=r||"";n&&(v+=n),i&&(v+=i);var y=Ki("span",[u],v,a);return o&&(y.title=o),e.content.appendChild(y)}e.content.appendChild(u)}}function Vn(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,n="",i=0;ic&&f.from<=c)break}if(f.to>=u)return e(r,n,i,o,a,l,s);e(r,n.slice(0,f.to-c),i,o,null,l,s),o=null,n=n.slice(f.to-c),c=f.to}}}function Gn(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function Un(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(n)for(var a,l,s,c,u,d,f,h=i.length,p=0,g=1,m="",v=0;;){if(v==p){s=c=u=d=l="",f=null,v=1/0;for(var y,b=[],w=0;wp||k.collapsed&&x.to==p&&x.from==p)?(null!=x.to&&x.to!=p&&v>x.to&&(v=x.to,c=""),k.className&&(s+=" "+k.className),k.css&&(l=(l?l+";":"")+k.css),k.startStyle&&x.from==p&&(u+=" "+k.startStyle),k.endStyle&&x.to==v&&(y||(y=[])).push(k.endStyle,x.to),k.title&&!d&&(d=k.title),k.collapsed&&(!f||pn(f.marker,k)<0)&&(f=x)):x.from>p&&v>x.from&&(v=x.from)}if(y)for(var w=0;w=h)break;for(var C=Math.min(h,v);;){if(m){var S=p+m.length;if(!f){var L=S>C?m.slice(0,C-p):m;t.addToken(t,L,a?a+s:s,u,p+L.length==v?c:"",d,l)}if(S>=C){m=m.slice(C-p),p=C;break}p=S,u=""}m=i.slice(o,o=r[g++]),a=Fn(r[g++],t.cm.options)}}else for(var g=1;g1&&e.remove(l.line+1,p-1),e.insert(l.line+1,g)}Li(e,"change",e,t)}function $n(e){this.lines=e,this.parent=null;for(var t=0,r=0;t=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var i=r.children[n],o=i.chunkSize();if(t1&&!e.done[e.done.length-2].ranges?(e.done.pop(),Di(e.done)):void 0}function ui(e,t,r,n){var i=e.history;i.undone.length=0;var o,a=+new Date;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&i.lastModTime>a-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=ci(i,i.lastOp==n))){var l=Di(o.changes);0==Ro(t.from,t.to)&&0==Ro(t.from,l.to)?l.to=ea(t):o.changes.push(li(e,t))}else{var s=Di(i.done);for(s&&s.ranges||hi(e.sel,i.done),o={changes:[li(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=a,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,l||Ha(e,"historyAdded")}function di(e,t,r,n){var i=t.charAt(0);return"*"==i||"+"==i&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function fi(e,t,r,n){var i=e.history,o=n&&n.origin;r==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||di(e,o,Di(i.done),t))?i.done[i.done.length-1]=t:hi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=r,n&&n.clearRedo!==!1&&si(i.undone)}function hi(e,t){var r=Di(t);r&&r.ranges&&r.equals(e)||t.push(e)}function pi(e,t,r,n){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),function(r){r.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=r.markedSpans),++o})}function gi(e){if(!e)return null;for(var t,r=0;r-1&&(Di(l)[d]=u[d],delete u[d])}}}return i}function yi(e,t,r,n){r0?n.slice():za:n||za}function Li(e,t){function r(e){return function(){e.apply(null,o)}}var n=Si(e,t,!1);if(n.length){var i,o=Array.prototype.slice.call(arguments,2);qo?i=qo.delayedCallbacks:Pa?i=Pa:(i=Pa=[],setTimeout(Ti,0));for(var a=0;a0}function Oi(e){e.prototype.on=function(e,t){Wa(this,e,t)},e.prototype.off=function(e,t){Da(this,e,t)}}function Wi(){this.id=null}function zi(e){for(;Ka.length<=e;)Ka.push(Di(Ka)+" ");return Ka[e]}function Di(e){return e[e.length-1]}function Hi(e,t){for(var r=0;r-1&&_a(e))||t.test(e):_a(e)}function ji(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function Vi(e){return e.charCodeAt(0)>=768&&$a.test(e)}function Ki(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),n&&(i.style.cssText=n),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o0;--t)e.removeChild(e.firstChild);return e}function Ui(e,t){return Gi(e).appendChild(t)}function qi(){for(var e=document.activeElement;e&&e.root&&e.root.activeElement;)e=e.root.activeElement;return e}function _i(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function $i(e,t){for(var r=e.split(" "),n=0;n2&&!(wo&&xo<8))}var r=Ya?Ki("span",""):Ki("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}function Ji(e){if(null!=Za)return Za;var t=Ui(e,document.createTextNode("AخA")),r=Ua(t,0,1).getBoundingClientRect(),n=Ua(t,1,2).getBoundingClientRect();return Gi(e),!(!r||r.left==r.right)&&(Za=n.right-r.right<3)}function eo(e){if(null!=ol)return ol;var t=Ui(e,Ki("span","x")),r=t.getBoundingClientRect(),n=Ua(t,0,1).getBoundingClientRect();return ol=Math.abs(r.left-n.left)>1}function to(e,t,r,n){if(!e)return n(t,r,"ltr");for(var i=!1,o=0;ot||t==r&&a.to==t)&&(n(Math.max(a.from,t),Math.min(a.to,r),1==a.level?"rtl":"ltr"),i=!0)}i||n(t,r,"ltr")}function ro(e){return e.level%2?e.to:e.from}function no(e){return e.level%2?e.from:e.to}function io(e){var t=oi(e);return t?ro(t[0]):0}function oo(e){var t=oi(e);return t?no(Di(t)):e.text.length}function ao(e,t){var r=Qn(e.doc,t),n=bn(r);n!=r&&(t=ri(n));var i=oi(n),o=i?i[0].level%2?oo(n):io(n):0;return Bo(t,o)}function lo(e,t){for(var r,n=Qn(e.doc,t);r=vn(n);)n=r.find(1,!0).line,t=null;var i=oi(n),o=i?i[0].level%2?io(n):oo(n):n.text.length;return Bo(null==t?ri(n):t,o)}function so(e,t){var r=ao(e,t.line),n=Qn(e.doc,r.line),i=oi(n);if(!i||0==i[0].level){var o=Math.max(0,n.text.search(/\S/)),a=t.line==r.line&&t.ch<=o&&t.ch;return Bo(r.line,a?0:o)}return r}function co(e,t,r){var n=e[0].level;return t==n||r!=n&&tt)return n;if(i.from==t||i.to==t){if(null!=r)return co(e,i.level,e[r].level)?(i.from!=i.to&&(ll=r),n):(i.from!=i.to&&(ll=n),r);r=n}}return r}function fo(e,t,r,n){if(!n)return t+r;do t+=r;while(t>0&&Vi(e.text.charAt(t)));return t}function ho(e,t,r,n){var i=oi(e);if(!i)return po(e,t,r,n);for(var o=uo(i,t),a=i[o],l=fo(e,t,a.level%2?-r:r,n);;){if(l>a.from&&l0==a.level%2?a.to:a.from);if(a=i[o+=r],!a)return null;l=r>0==a.level%2?fo(e,a.to,-1,n):fo(e,a.from,1,n)}}function po(e,t,r,n){var i=t+r;if(n)for(;i>0&&Vi(e.text.charAt(i));)i+=r;return i<0||i>e.text.length?null:i}var go=navigator.userAgent,mo=navigator.platform,vo=/gecko\/\d/i.test(go),yo=/MSIE \d/.test(go),bo=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(go),wo=yo||bo,xo=wo&&(yo?document.documentMode||6:bo[1]),ko=/WebKit\//.test(go),Co=ko&&/Qt\/\d+\.\d+/.test(go),So=/Chrome\//.test(go),Lo=/Opera\//.test(go),To=/Apple Computer/.test(navigator.vendor),Mo=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(go),No=/PhantomJS/.test(go),Ao=/AppleWebKit/.test(go)&&/Mobile\/\w+/.test(go),Oo=Ao||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(go),Wo=Ao||/Mac/.test(mo),zo=/\bCrOS\b/.test(go),Do=/win/i.test(mo),Ho=Lo&&go.match(/Version\/(\d*\.\d*)/);Ho&&(Ho=Number(Ho[1])),Ho&&Ho>=15&&(Lo=!1,ko=!0);var Po=Wo&&(Co||Lo&&(null==Ho||Ho<12.11)),Io=vo||wo&&xo>=9,Eo=!1,Fo=!1;g.prototype=Fi({update:function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var i=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=e.scrollWidth-e.clientWidth+o+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==n&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},setScrollLeft:function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz)},setScrollTop:function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert)},zeroWidthHack:function(){var e=Wo&&!Mo?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",
-this.disableHoriz=new Wi,this.disableVert=new Wi},enableZeroWidthBar:function(e,t){function r(){var n=e.getBoundingClientRect(),i=document.elementFromPoint(n.left+1,n.bottom-1);i!=e?e.style.pointerEvents="none":t.set(1e3,r)}e.style.pointerEvents="auto",t.set(1e3,r)},clear:function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)}},g.prototype),m.prototype=Fi({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},m.prototype),e.scrollbarModel={native:g,null:m},L.prototype.signal=function(e,t){Ai(e,t)&&this.events.push(arguments)},L.prototype.finish=function(){for(var e=0;e=9&&r.hasSelection&&(r.hasSelection=null),r.poll()}),Wa(o,"paste",function(e){Mi(n,e)||Q(e,n)||(n.state.pasteIncoming=!0,r.fastPoll())}),Wa(o,"cut",t),Wa(o,"copy",t),Wa(e.scroller,"paste",function(t){qt(e,t)||Mi(n,t)||(n.state.pasteIncoming=!0,r.focus())}),Wa(e.lineSpace,"selectstart",function(t){qt(e,t)||Na(t)}),Wa(o,"compositionstart",function(){var e=n.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:e,range:n.markText(e,n.getCursor("to"),{className:"CodeMirror-composing"})}}),Wa(o,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},prepareSelection:function(){var e=this.cm,t=e.display,r=e.doc,n=Pe(e);if(e.options.moveInputWithCursor){var i=pt(e,r.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return n},showSelection:function(e){var t=this.cm,r=t.display;Ui(r.cursorDiv,e.cursors),Ui(r.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},reset:function(e){if(!this.contextMenuPending){var t,r,n=this.cm,i=n.doc;if(n.somethingSelected()){this.prevInput="";var o=i.sel.primary();t=il&&(o.to().line-o.from().line>100||(r=n.getSelection()).length>1e3);var a=t?"-":r||n.getSelection();this.textarea.value=a,n.state.focused&&Ga(this.textarea),wo&&xo>=9&&(this.hasSelection=a)}else e||(this.prevInput=this.textarea.value="",wo&&xo>=9&&(this.hasSelection=null));this.inaccurateSelection=t}},getField:function(){return this.textarea},supportsTouch:function(){return!1},focus:function(){if("nocursor"!=this.cm.options.readOnly&&(!Oo||qi()!=this.textarea))try{this.textarea.focus()}catch(e){}},blur:function(){this.textarea.blur()},resetPosition:function(){this.wrapper.style.top=this.wrapper.style.left=0},receivedFocus:function(){this.slowPoll()},slowPoll:function(){var e=this;e.pollingFast||e.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},fastPoll:function(){function e(){var n=r.poll();n||t?(r.pollingFast=!1,r.slowPoll()):(t=!0,r.polling.set(60,e))}var t=!1,r=this;r.pollingFast=!0,r.polling.set(20,e)},poll:function(){var e=this.cm,t=this.textarea,r=this.prevInput;if(this.contextMenuPending||!e.state.focused||nl(t)&&!r&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var n=t.value;if(n==r&&!e.somethingSelected())return!1;if(wo&&xo>=9&&this.hasSelection===n||Wo&&/[\uf700-\uf7ff]/.test(n))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var i=n.charCodeAt(0);if(8203!=i||r||(r=""),8666==i)return this.reset(),this.cm.execCommand("undo")}for(var o=0,a=Math.min(r.length,n.length);o1e3||n.indexOf("\n")>-1?t.value=l.prevInput="":l.prevInput=n,l.composing&&(l.composing.range.clear(),l.composing.range=e.markText(l.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ensurePolled:function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},onKeyPress:function(){wo&&xo>=9&&(this.hasSelection=null),this.fastPoll()},onContextMenu:function(e){function t(){if(null!=a.selectionStart){var e=i.somethingSelected(),t=""+(e?a.value:"");a.value="⇚",a.value=t,n.prevInput=e?"":"",a.selectionStart=1,a.selectionEnd=t.length,o.selForContextMenu=i.doc.sel}}function r(){if(n.contextMenuPending=!1,n.wrapper.style.cssText=d,a.style.cssText=u,wo&&xo<9&&o.scrollbars.setScrollTop(o.scroller.scrollTop=s),null!=a.selectionStart){(!wo||wo&&xo<9)&&t();var e=0,r=function(){o.selForContextMenu==i.doc.sel&&0==a.selectionStart&&a.selectionEnd>0&&""==n.prevInput?Wt(i,da.selectAll)(i):e++<10?o.detectingSelectAll=setTimeout(r,500):o.input.reset()};o.detectingSelectAll=setTimeout(r,200)}}var n=this,i=n.cm,o=i.display,a=n.textarea,l=_t(i,e),s=o.scroller.scrollTop;if(l&&!Lo){var c=i.options.resetSelectionOnContextMenu;c&&i.doc.sel.contains(l)==-1&&Wt(i,Te)(i.doc,he(l),Fa);var u=a.style.cssText,d=n.wrapper.style.cssText;n.wrapper.style.cssText="position: absolute";var f=n.wrapper.getBoundingClientRect();if(a.style.cssText="position: absolute; width: 30px; height: 30px; top: "+(e.clientY-f.top-5)+"px; left: "+(e.clientX-f.left-5)+"px; z-index: 1000; background: "+(wo?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",ko)var h=window.scrollY;if(o.input.focus(),ko&&window.scrollTo(null,h),o.input.reset(),i.somethingSelected()||(a.value=n.prevInput=" "),n.contextMenuPending=!0,o.selForContextMenu=i.doc.sel,clearTimeout(o.detectingSelectAll),wo&&xo>=9&&t(),Io){Oa(e);var p=function(){Da(window,"mouseup",p),setTimeout(r,20)};Wa(window,"mouseup",p)}else setTimeout(r,50)}},readOnlyChanged:function(e){e||this.reset()},setUneditable:Ii,needsContentAttribute:!1},re.prototype),ie.prototype=Fi({init:function(e){function t(e){if(!Mi(n,e)){if(n.somethingSelected())jo={lineWise:!1,text:n.getSelections()},"cut"==e.type&&n.replaceSelection("",null,"cut");else{if(!n.options.lineWiseCopyCut)return;var t=ee(n);jo={lineWise:!0,text:t.text},"cut"==e.type&&n.operation(function(){n.setSelections(t.ranges,0,Fa),n.replaceSelection("",null,"cut")})}if(e.clipboardData&&!Ao)e.preventDefault(),e.clipboardData.clearData(),e.clipboardData.setData("text/plain",jo.text.join("\n"));else{var r=ne(),i=r.firstChild;n.display.lineSpace.insertBefore(r,n.display.lineSpace.firstChild),i.value=jo.text.join("\n");var o=document.activeElement;Ga(i),setTimeout(function(){n.display.lineSpace.removeChild(r),o.focus()},50)}}}var r=this,n=r.cm,i=r.div=e.lineDiv;te(i),Wa(i,"paste",function(e){Mi(n,e)||Q(e,n)}),Wa(i,"compositionstart",function(e){var t=e.data;if(r.composing={sel:n.doc.sel,data:t,startData:t},t){var i=n.doc.sel.primary(),o=n.getLine(i.head.line),a=o.indexOf(t,Math.max(0,i.head.ch-t.length));a>-1&&a<=i.head.ch&&(r.composing.sel=he(Bo(i.head.line,a),Bo(i.head.line,a+t.length)))}}),Wa(i,"compositionupdate",function(e){r.composing.data=e.data}),Wa(i,"compositionend",function(e){var t=r.composing;t&&(e.data==t.startData||/\u200b/.test(e.data)||(t.data=e.data),setTimeout(function(){t.handled||r.applyComposition(t),r.composing==t&&(r.composing=null)},50))}),Wa(i,"touchstart",function(){r.forceCompositionEnd()}),Wa(i,"input",function(){r.composing||!n.isReadOnly()&&r.pollContent()||Ot(r.cm,function(){It(n)})}),Wa(i,"copy",t),Wa(i,"cut",t)},prepareSelection:function(){var e=Pe(this.cm,!1);return e.focus=this.cm.state.focused,e},showSelection:function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},showPrimarySelection:function(){var e=window.getSelection(),t=this.cm.doc.sel.primary(),r=le(this.cm,e.anchorNode,e.anchorOffset),n=le(this.cm,e.focusNode,e.focusOffset);if(!r||r.bad||!n||n.bad||0!=Ro(X(r,n),t.from())||0!=Ro($(r,n),t.to())){var i=oe(this.cm,t.from()),o=oe(this.cm,t.to());if(i||o){var a=this.cm.display.view,l=e.rangeCount&&e.getRangeAt(0);if(i){if(!o){var s=a[a.length-1].measure,c=s.maps?s.maps[s.maps.length-1]:s.map;o={node:c[c.length-1],offset:c[c.length-2]-c[c.length-3]}}}else i={node:a[0].measure.map[2],offset:0};try{var u=Ua(i.node,i.offset,o.offset,o.node)}catch(e){}u&&(!vo&&this.cm.state.focused?(e.collapse(i.node,i.offset),u.collapsed||e.addRange(u)):(e.removeAllRanges(),e.addRange(u)),l&&null==e.anchorNode?e.addRange(l):vo&&this.startGracePeriod()),this.rememberSelection()}}},startGracePeriod:function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){e.cm.curOp.selectionChanged=!0})},20)},showMultipleSelections:function(e){Ui(this.cm.display.cursorDiv,e.cursors),Ui(this.cm.display.selectionDiv,e.selection)},rememberSelection:function(){var e=window.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},selectionInEditor:function(){var e=window.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return Xa(this.div,t)},focus:function(){"nocursor"!=this.cm.options.readOnly&&this.div.focus()},blur:function(){this.div.blur()},getField:function(){return this.div},supportsTouch:function(){return!0},receivedFocus:function(){function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))}var t=this;this.selectionInEditor()?this.pollSelection():Ot(this.cm,function(){t.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,e)},selectionChanged:function(){var e=window.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},pollSelection:function(){if(!this.composing&&!this.gracePeriod&&this.selectionChanged()){var e=window.getSelection(),t=this.cm;this.rememberSelection();var r=le(t,e.anchorNode,e.anchorOffset),n=le(t,e.focusNode,e.focusOffset);r&&n&&Ot(t,function(){Te(t.doc,he(r,n),Fa),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)})}},pollContent:function(){var e=this.cm,t=e.display,r=e.doc.sel.primary(),n=r.from(),i=r.to();if(n.linet.viewTo-1)return!1;var o;if(n.line==t.viewFrom||0==(o=Bt(e,n.line)))var a=ri(t.view[0].line),l=t.view[0].node;else var a=ri(t.view[o].line),l=t.view[o-1].node.nextSibling;var s=Bt(e,i.line);if(s==t.view.length-1)var c=t.viewTo-1,u=t.lineDiv.lastChild;else var c=ri(t.view[s+1].line)-1,u=t.view[s+1].node.previousSibling;for(var d=e.doc.splitLines(ce(e,l,u,a,c)),f=Jn(e.doc,Bo(a,0),Bo(c,Qn(e.doc,c).text.length));d.length>1&&f.length>1;)if(Di(d)==Di(f))d.pop(),f.pop(),c--;else{if(d[0]!=f[0])break;d.shift(),f.shift(),a++}for(var h=0,p=0,g=d[0],m=f[0],v=Math.min(g.length,m.length);h1||d[0]||Ro(x,k)?(zr(e.doc,d,x,k,"+input"),!0):void 0},ensurePolled:function(){this.forceCompositionEnd()},reset:function(){this.forceCompositionEnd()},forceCompositionEnd:function(){this.composing&&!this.composing.handled&&(this.applyComposition(this.composing),this.composing.handled=!0,this.div.blur(),this.div.focus())},applyComposition:function(e){this.cm.isReadOnly()?Wt(this.cm,It)(this.cm):e.data&&e.data!=e.startData&&Wt(this.cm,Z)(this.cm,e.data,0,e.sel)},setUneditable:function(e){e.contentEditable="false"},onKeyPress:function(e){e.preventDefault(),this.cm.isReadOnly()||Wt(this.cm,Z)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0)},readOnlyChanged:function(e){this.div.contentEditable=String("nocursor"!=e)},onContextMenu:Ii,resetPosition:Ii,needsContentAttribute:!0},ie.prototype),e.inputStyles={textarea:re,contenteditable:ie},ue.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t=0&&Ro(e,n.to())<=0)return r}return-1}},de.prototype={from:function(){return X(this.anchor,this.head)},to:function(){return $(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var Vo,Ko,Go,Uo={left:0,right:0,top:0,bottom:0},qo=null,_o=0,$o=0,Xo=0,Yo=null;wo?Yo=-.53:vo?Yo=15:So?Yo=-.7:To&&(Yo=-1/3);var Zo=function(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==r&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:null==r&&(r=e.wheelDelta),{x:t,y:r}};e.wheelEventPixels=function(e){var t=Zo(e);return t.x*=Yo,t.y*=Yo,t};var Qo=new Wi,Jo=null,ea=e.changeEnd=function(e){return e.text?Bo(e.from.line+e.text.length-1,Di(e.text).length+(1==e.text.length?e.from.ch:0)):e.to};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,t){var r=this.options,n=r[e];r[e]==t&&"mode"!=e||(r[e]=t,ra.hasOwnProperty(e)&&Wt(this,ra[e])(this,t,n))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](_r(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,r=0;rr&&(Rr(this,i.head.line,e,!0),r=i.head.line,n==this.doc.sel.primIndex&&Fr(this));else{var o=i.from(),a=i.to(),l=Math.max(r,o.line);r=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var s=l;s0&&ke(this.doc,n,new de(o,c[n].to()),Fa)}}}),getTokenAt:function(e,t){return Dn(this,e,t)},getLineTokens:function(e,t){return Dn(this,Bo(e),t,!0)},getTokenTypeAt:function(e){e=ge(this.doc,e);var t,r=In(this,Qn(this.doc,e.line)),n=0,i=(r.length-1)/2,o=e.ch;if(0==o)t=r[2];else for(;;){var a=n+i>>1;if((a?r[2*a-1]:0)>=o)i=a;else{if(!(r[2*a+1]i&&(e=i,n=!0),r=Qn(this.doc,e)}else r=e;return dt(this,r,{top:0,left:0},t||"page").top+(n?this.doc.height-ii(r):0)},defaultTextHeight:function(){return bt(this.display)},defaultCharWidth:function(){return wt(this.display)},setGutterMarker:zt(function(e,t,r){return jr(this.doc,e,"gutter",function(e){var n=e.gutterMarkers||(e.gutterMarkers={});return n[t]=r,!r&&ji(n)&&(e.gutterMarkers=null),!0})}),clearGutter:zt(function(e){var t=this,r=t.doc,n=r.first;r.iter(function(r){r.gutterMarkers&&r.gutterMarkers[e]&&(r.gutterMarkers[e]=null,Et(t,n,"gutter"),ji(r.gutterMarkers)&&(r.gutterMarkers=null)),++n})}),lineInfo:function(e){if("number"==typeof e){if(!ve(this.doc,e))return null;var t=e;if(e=Qn(this.doc,e),!e)return null}else{var t=ri(e);if(null==t)return null}return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,i){var o=this.display;e=pt(this,ge(this.doc,e));var a=e.bottom,l=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==n)a=e.top;else if("above"==n||"near"==n){var s=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>s)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=s&&(a=e.bottom),l+t.offsetWidth>c&&(l=c-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==i?(l=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?l=0:"middle"==i&&(l=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=l+"px"),r&&Pr(this,l,a,l+t.offsetWidth,a+t.offsetHeight)},triggerOnKeyDown:zt(fr),triggerOnKeyPress:zt(gr),triggerOnKeyUp:pr,execCommand:function(e){if(da.hasOwnProperty(e))return da[e].call(null,this)},triggerElectric:zt(function(e){J(this,e)}),findPosH:function(e,t,r,n){var i=1;t<0&&(i=-1,t=-t);for(var o=0,a=ge(this.doc,e);o0&&l(r.charAt(n-1));)--n;for(;i.5)&&a(this),Ha(this,"refresh",this)}),swapDoc:zt(function(e){var t=this.doc;return t.cm=null,Zn(this,e),st(this),this.display.input.reset(),this.scrollTo(e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,Li(this,"swapDoc",this,t),t}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Oi(e);var ta=e.defaults={},ra=e.optionHandlers={},na=e.Init={toString:function(){return"CodeMirror.Init"}};Ur("value","",function(e,t){e.setValue(t)},!0),Ur("mode",null,function(e,t){e.doc.modeOption=t,r(e)},!0),Ur("indentUnit",2,r,!0),Ur("indentWithTabs",!1),Ur("smartIndent",!0),Ur("tabSize",4,function(e){n(e),st(e),It(e)},!0),Ur("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,t){var r=[],n=e.doc.first;e.doc.iter(function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(o==-1)break;i=o+t.length,r.push(Bo(n,o))}n++});for(var i=r.length-1;i>=0;i--)zr(e.doc,t,r[i],Bo(r[i].line,r[i].ch+t.length))}}),Ur("specialChars",/[\u0000-\u001f\u007f\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(t,r,n){t.state.specialChars=new RegExp(r.source+(r.test("\t")?"":"|\t"),"g"),n!=e.Init&&t.refresh()}),Ur("specialCharPlaceholder",Rn,function(e){e.refresh()},!0),Ur("electricChars",!0),Ur("inputStyle",Oo?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),Ur("rtlMoveVisually",!Do),Ur("wholeLineUpdateBefore",!0),Ur("theme","default",function(e){l(e),s(e)},!0),Ur("keyMap","default",function(t,r,n){var i=_r(r),o=n!=e.Init&&_r(n);o&&o.detach&&o.detach(t,i),i.attach&&i.attach(t,o||null)}),Ur("extraKeys",null),Ur("lineWrapping",!1,i,!0),Ur("gutters",[],function(e){h(e.options),s(e)},!0),Ur("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?S(e.display)+"px":"0",e.refresh()},!0),Ur("coverGutterNextToScrollbar",!1,function(e){y(e)},!0),Ur("scrollbarStyle","native",function(e){v(e),y(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),Ur("lineNumbers",!1,function(e){h(e.options),s(e)},!0),Ur("firstLineNumber",1,s,!0),Ur("lineNumberFormatter",function(e){return e},s,!0),Ur("showCursorWhenSelecting",!1,He,!0),Ur("resetSelectionOnContextMenu",!0),Ur("lineWiseCopyCut",!0),Ur("readOnly",!1,function(e,t){"nocursor"==t?(yr(e),e.display.input.blur(),e.display.disabled=!0):e.display.disabled=!1,e.display.input.readOnlyChanged(t)}),Ur("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),Ur("dragDrop",!0,Gt),Ur("allowDropFileTypes",null),Ur("cursorBlinkRate",530),Ur("cursorScrollMargin",0),Ur("cursorHeight",1,He,!0),Ur("singleCursorHeightPerLine",!0,He,!0),Ur("workTime",100),Ur("workDelay",100),Ur("flattenSpans",!0,n,!0),Ur("addModeClass",!1,n,!0),Ur("pollInterval",100),Ur("undoDepth",200,function(e,t){e.doc.history.undoDepth=t}),Ur("historyEventDelay",1250),Ur("viewportMargin",10,function(e){e.refresh()},!0),Ur("maxHighlightLength",1e4,n,!0),Ur("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),Ur("tabindex",null,function(e,t){e.display.input.getField().tabIndex=t||""}),Ur("autofocus",null);var ia=e.modes={},oa=e.mimeModes={};e.defineMode=function(t,r){e.defaults.mode||"null"==t||(e.defaults.mode=t),arguments.length>2&&(r.dependencies=Array.prototype.slice.call(arguments,2)),ia[t]=r},e.defineMIME=function(e,t){oa[e]=t},e.resolveMode=function(t){if("string"==typeof t&&oa.hasOwnProperty(t))t=oa[t];else if(t&&"string"==typeof t.name&&oa.hasOwnProperty(t.name)){var r=oa[t.name];"string"==typeof r&&(r={name:r}),t=Ei(r,t),t.name=r.name}else if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return e.resolveMode("application/xml");return"string"==typeof t?{name:t}:t||{name:"null"}},e.getMode=function(t,r){var r=e.resolveMode(r),n=ia[r.name];if(!n)return e.getMode(t,"text/plain");var i=n(t,r);if(aa.hasOwnProperty(r.name)){var o=aa[r.name];for(var a in o)o.hasOwnProperty(a)&&(i.hasOwnProperty(a)&&(i["_"+a]=i[a]),i[a]=o[a])}if(i.name=r.name,r.helperType&&(i.helperType=r.helperType),r.modeProps)for(var a in r.modeProps)i[a]=r.modeProps[a];return i},e.defineMode("null",function(){return{token:function(e){e.skipToEnd()}}}),e.defineMIME("text/plain","null");var aa=e.modeExtensions={};e.extendMode=function(e,t){var r=aa.hasOwnProperty(e)?aa[e]:aa[e]={};Fi(t,r)},e.defineExtension=function(t,r){e.prototype[t]=r},e.defineDocExtension=function(e,t){La.prototype[e]=t},e.defineOption=Ur;var la=[];e.defineInitHook=function(e){la.push(e)};var sa=e.helpers={};e.registerHelper=function(t,r,n){sa.hasOwnProperty(t)||(sa[t]=e[t]={_global:[]}),sa[t][r]=n},e.registerGlobalHelper=function(t,r,n,i){e.registerHelper(t,r,i),sa[t]._global.push({pred:n,val:i})};var ca=e.copyState=function(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r},ua=e.startState=function(e,t,r){return!e.startState||e.startState(t,r)};e.innerMode=function(e,t){for(;e.innerMode;){var r=e.innerMode(t);if(!r||r.mode==e)break;t=r.state,e=r.mode}return r||{mode:e,state:t}};var da=e.commands={selectAll:function(e){e.setSelection(Bo(e.firstLine(),0),Bo(e.lastLine()),Fa)},singleSelection:function(e){e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Fa)},killLine:function(e){Vr(e,function(t){if(t.empty()){var r=Qn(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line0)i=new Bo(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),Bo(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=Qn(e.doc,i.line-1).text;a&&e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),Bo(i.line-1,a.length-1),Bo(i.line,1),"+transpose");
-}r.push(new de(i,i))}e.setSelections(r)})},newlineAndIndent:function(e){Ot(e,function(){for(var t=e.listSelections().length,r=0;r=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){if(this.post},eatSpace:function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},backUp:function(e){this.pos-=e},column:function(){return this.lastColumnPos0?null:(n&&t!==!1&&(this.pos+=n[0].length),n)}var i=function(e){return r?e.toLowerCase():e},o=this.string.substr(this.pos,e.length);if(i(o)==i(e))return t!==!1&&(this.pos+=e.length),!0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}}};var va=0,ya=e.TextMarker=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++va};Oi(ya),ya.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&xt(e),Ai(this,"clear")){var r=this.find();r&&Li(this,"clear",r.from,r.to)}for(var n=null,i=null,o=0;oe.display.maxLineLength&&(e.display.maxLine=s,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=n&&e&&this.collapsed&&It(e,n,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ae(e.doc)),e&&Li(e,"markerCleared",e,this),t&&Ct(e),this.parent&&this.parent.clear()}},ya.prototype.find=function(e,t){null==e&&"bookmark"==this.type&&(e=1);for(var r,n,i=0;i1||!(this.children[0]instanceof $n))){var l=[];this.collapse(l),this.children=[new $n(l)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var a=i.lines.length%25+25,l=a;l10);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var n=0;n=0;o--)Tr(this,n[o]);l?Le(this,l):this.cm&&Fr(this.cm)}),undo:Dt(function(){Nr(this,"undo")}),redo:Dt(function(){Nr(this,"redo")}),undoSelection:Dt(function(){Nr(this,"undo",!0)}),redoSelection:Dt(function(){Nr(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,r){e=ge(this,e),t=ge(this,t);var n=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var a=o.markedSpans;if(a)for(var l=0;l=s.to||null==s.from&&i!=e.line||null!=s.from&&i==t.line&&s.from>=t.ch||r&&!r(s.marker)||n.push(s.marker.parent||s.marker)}++i}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var n=0;ne?(t=e,!0):(e-=o,void++r)}),ge(this,Bo(r,t))},indexFromPos:function(e){e=ge(this,e);var t=e.ch;if(e.linet&&(t=e.from),null!=e.to&&e.to=t)return a+(t-o);a+=l-o,a+=r-a%r,o=l+1}},Va=e.findColumn=function(e,t,r){for(var n=0,i=0;;){var o=e.indexOf("\t",n);o==-1&&(o=e.length);var a=o-n;if(o==e.length||i+a>=t)return n+Math.min(a,t-i);if(i+=o-n,i+=r-i%r,n=o+1,i>=t)return n}},Ka=[""],Ga=function(e){e.select()};Ao?Ga=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:wo&&(Ga=function(e){try{e.select()}catch(e){}});var Ua,qa=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,_a=e.isWordChar=function(e){return/\w/.test(e)||e>""&&(e.toUpperCase()!=e.toLowerCase()||qa.test(e))},$a=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;Ua=document.createRange?function(e,t,r,n){var i=document.createRange();return i.setEnd(n||e,r),i.setStart(e,t),i}:function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(e){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};var Xa=e.contains=function(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do if(11==t.nodeType&&(t=t.host),t==e)return!0;while(t=t.parentNode)};wo&&xo<11&&(qi=function(){try{return document.activeElement}catch(e){return document.body}});var Ya,Za,Qa=e.rmClass=function(e,t){var r=e.className,n=_i(t).exec(r);if(n){var i=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(i?n[1]+i:"")}},Ja=e.addClass=function(e,t){var r=e.className;_i(t).test(r)||(e.className+=(r?" ":"")+t)},el=!1,tl=function(){if(wo&&xo<9)return!1;var e=Ki("div");return"draggable"in e||"dragDrop"in e}(),rl=e.splitLines=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,r=[],n=e.length;t<=n;){var i=e.indexOf("\n",t);i==-1&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");a!=-1?(r.push(o.slice(0,a)),t+=a+1):(r.push(o),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},nl=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){try{var t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},il=function(){var e=Ki("div");return"oncopy"in e||(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),ol=null,al=e.keyNames={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};!function(){for(var e=0;e<10;e++)al[e+48]=al[e+96]=String(e);for(var e=65;e<=90;e++)al[e]=String.fromCharCode(e);for(var e=1;e<=12;e++)al[e+111]=al[e+63235]="F"+e}();var ll,sl=function(){function e(e){return e<=247?r.charAt(e):1424<=e&&e<=1524?"R":1536<=e&&e<=1773?n.charAt(e-1536):1774<=e&&e<=2220?"r":8192<=e&&e<=8203?"w":8204==e?"b":"L"}function t(e,t,r){this.level=e,this.from=t,this.to=r}var r="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",n="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,a=/[LRr]/,l=/[Lb1n]/,s=/[1n]/,c="L";return function(r){if(!i.test(r))return!1;for(var n,u=r.length,d=[],f=0;f*\/]/.test(r)?n(null,"select-op"):"."==r&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?n("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(r)?n(null,r):"u"==r&&e.match(/rl(-prefix)?\(/)||"d"==r&&e.match("omain(")||"r"==r&&e.match("egexp(")?(e.backUp(1),t.tokenize=a,n("property","word")):/[\w\\\-]/.test(r)?(e.eatWhile(/[\w\\\-]/),n("property","word")):n(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),n("number","unit")):e.match(/^-[\w\\\-]+/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?n("variable-2","variable-definition"):n("variable-2","variable")):e.match(/^\w+-/)?n("meta","meta"):void 0}function o(e){return function(t,r){for(var i,o=!1;null!=(i=t.next());){if(i==e&&!o){")"==e&&t.backUp(1);break}o=!o&&"\\"==i}return(i==e||!o&&")"!=e)&&(r.tokenize=null),n("string","string")}}function a(e,t){return e.next(),e.match(/\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=o(")"),n(null,"(")}function l(e,t,r){this.type=e,this.indent=t,this.prev=r}function s(e,t,r,n){return e.context=new l(r,t.indentation()+(n===!1?0:m),e.context),r}function c(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function u(e,t,r){return O[r.context.type](e,t,r)}function d(e,t,r,n){for(var i=n||1;i>0;i--)r.context=r.context.prev;return u(e,t,r)}function f(e){var t=e.current().toLowerCase();g=M.hasOwnProperty(t)?"atom":T.hasOwnProperty(t)?"keyword":"variable"}var h=r.inline;r.propertyKeywords||(r=e.resolveMode("text/css"));var p,g,m=t.indentUnit,v=r.tokenHooks,y=r.documentTypes||{},b=r.mediaTypes||{},w=r.mediaFeatures||{},x=r.mediaValueKeywords||{},k=r.propertyKeywords||{},C=r.nonStandardPropertyKeywords||{},S=r.fontProperties||{},L=r.counterDescriptors||{},T=r.colorKeywords||{},M=r.valueKeywords||{},N=r.allowNested,A=r.supportsAtComponent===!0,O={};return O.top=function(e,t,r){if("{"==e)return s(r,t,"block");if("}"==e&&r.context.prev)return c(r);if(A&&/@component/.test(e))return s(r,t,"atComponentBlock");if(/^@(-moz-)?document$/.test(e))return s(r,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/.test(e))return s(r,t,"atBlock");if(/^@(font-face|counter-style)/.test(e))return r.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return s(r,t,"at");if("hash"==e)g="builtin";else if("word"==e)g="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return s(r,t,"interpolation");if(":"==e)return"pseudo";if(N&&"("==e)return s(r,t,"parens")}return r.context.type},O.block=function(e,t,r){if("word"==e){var n=t.current().toLowerCase();return k.hasOwnProperty(n)?(g="property","maybeprop"):C.hasOwnProperty(n)?(g="string-2","maybeprop"):N?(g=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(g+=" error","maybeprop")}return"meta"==e?"block":N||"hash"!=e&&"qualifier"!=e?O.top(e,t,r):(g="error","block")},O.maybeprop=function(e,t,r){return":"==e?s(r,t,"prop"):u(e,t,r)},O.prop=function(e,t,r){if(";"==e)return c(r);if("{"==e&&N)return s(r,t,"propBlock");if("}"==e||"{"==e)return d(e,t,r);
-if("("==e)return s(r,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(t.current())){if("word"==e)f(t);else if("interpolation"==e)return s(r,t,"interpolation")}else g+=" error";return"prop"},O.propBlock=function(e,t,r){return"}"==e?c(r):"word"==e?(g="property","maybeprop"):r.context.type},O.parens=function(e,t,r){return"{"==e||"}"==e?d(e,t,r):")"==e?c(r):"("==e?s(r,t,"parens"):"interpolation"==e?s(r,t,"interpolation"):("word"==e&&f(t),"parens")},O.pseudo=function(e,t,r){return"word"==e?(g="variable-3",r.context.type):u(e,t,r)},O.documentTypes=function(e,t,r){return"word"==e&&y.hasOwnProperty(t.current())?(g="tag",r.context.type):O.atBlock(e,t,r)},O.atBlock=function(e,t,r){if("("==e)return s(r,t,"atBlock_parens");if("}"==e||";"==e)return d(e,t,r);if("{"==e)return c(r)&&s(r,t,N?"block":"top");if("interpolation"==e)return s(r,t,"interpolation");if("word"==e){var n=t.current().toLowerCase();g="only"==n||"not"==n||"and"==n||"or"==n?"keyword":b.hasOwnProperty(n)?"attribute":w.hasOwnProperty(n)?"property":x.hasOwnProperty(n)?"keyword":k.hasOwnProperty(n)?"property":C.hasOwnProperty(n)?"string-2":M.hasOwnProperty(n)?"atom":T.hasOwnProperty(n)?"keyword":"error"}return r.context.type},O.atComponentBlock=function(e,t,r){return"}"==e?d(e,t,r):"{"==e?c(r)&&s(r,t,N?"block":"top",!1):("word"==e&&(g="error"),r.context.type)},O.atBlock_parens=function(e,t,r){return")"==e?c(r):"{"==e||"}"==e?d(e,t,r,2):O.atBlock(e,t,r)},O.restricted_atBlock_before=function(e,t,r){return"{"==e?s(r,t,"restricted_atBlock"):"word"==e&&"@counter-style"==r.stateArg?(g="variable","restricted_atBlock_before"):u(e,t,r)},O.restricted_atBlock=function(e,t,r){return"}"==e?(r.stateArg=null,c(r)):"word"==e?(g="@font-face"==r.stateArg&&!S.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==r.stateArg&&!L.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},O.keyframes=function(e,t,r){return"word"==e?(g="variable","keyframes"):"{"==e?s(r,t,"top"):u(e,t,r)},O.at=function(e,t,r){return";"==e?c(r):"{"==e||"}"==e?d(e,t,r):("word"==e?g="tag":"hash"==e&&(g="builtin"),"at")},O.interpolation=function(e,t,r){return"}"==e?c(r):"{"==e||";"==e?d(e,t,r):("word"==e?g="variable":"variable"!=e&&"("!=e&&")"!=e&&(g="error"),"interpolation")},{startState:function(e){return{tokenize:null,state:h?"block":"top",stateArg:null,context:new l(h?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var r=(t.tokenize||i)(e,t);return r&&"object"==typeof r&&(p=r[1],r=r[0]),g=r,t.state=O[t.state](p,e,t),g},indent:function(e,t){var r=e.context,n=t&&t.charAt(0),i=r.indent;return"prop"!=r.type||"}"!=n&&")"!=n||(r=r.prev),r.prev&&("}"!=n||"block"!=r.type&&"top"!=r.type&&"interpolation"!=r.type&&"restricted_atBlock"!=r.type?(")"!=n||"parens"!=r.type&&"atBlock_parens"!=r.type)&&("{"!=n||"at"!=r.type&&"atBlock"!=r.type)||(i=Math.max(0,r.indent-m),r=r.prev):(r=r.prev,i=r.indent)),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",fold:"brace"}});var n=["domain","regexp","url","url-prefix"],i=t(n),o=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],a=t(o),l=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover"],s=t(l),c=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive"],u=t(c),d=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],f=t(d),h=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],p=t(h),g=["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],m=t(g),v=["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"],y=t(v),b=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],w=t(b),x=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],k=t(x),C=n.concat(o).concat(l).concat(c).concat(d).concat(h).concat(b).concat(x);e.registerHelper("hintWords","css",C),e.defineMIME("text/css",{documentTypes:i,mediaTypes:a,mediaFeatures:s,mediaValueKeywords:u,propertyKeywords:f,nonStandardPropertyKeywords:p,fontProperties:m,counterDescriptors:y,colorKeywords:w,valueKeywords:k,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=r,r(e,t))}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:a,mediaFeatures:s,mediaValueKeywords:u,propertyKeywords:f,nonStandardPropertyKeywords:p,colorKeywords:w,valueKeywords:k,fontProperties:m,allowNested:!0,tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=r,r(e,t)):["operator","operator"]},":":function(e){return!!e.match(/\s*\{/)&&[null,"{"]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:a,mediaFeatures:s,mediaValueKeywords:u,propertyKeywords:f,nonStandardPropertyKeywords:p,colorKeywords:w,valueKeywords:k,fontProperties:m,allowNested:!0,tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=r,r(e,t)):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),e.defineMIME("text/x-gss",{documentTypes:i,mediaTypes:a,mediaFeatures:s,propertyKeywords:f,nonStandardPropertyKeywords:p,fontProperties:m,counterDescriptors:y,colorKeywords:w,valueKeywords:k,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=r,r(e,t))}},name:"css",helperType:"gss"})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../xml/xml"),require("../javascript/javascript"),require("../css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,r){var n=e.current(),i=n.search(t);return i>-1?e.backUp(n.length-i):n.match(/<\/?$/)&&(e.backUp(n.length),e.match(t,!1)||e.match(n)),r}function r(e){var t=s[e];return t?t:s[e]=new RegExp("\\s+"+e+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*")}function n(e,t){var n=e.match(r(t));return n?n[2]:""}function i(e,t){return new RegExp((t?"^":"")+"","i")}function o(e,t){for(var r in e)for(var n=t[r]||(t[r]=[]),i=e[r],o=i.length-1;o>=0;o--)n.unshift(i[o])}function a(e,t){for(var r=0;r\s\/]/.test(n.current())&&(l=o.htmlState.tagName&&o.htmlState.tagName.toLowerCase())&&u.hasOwnProperty(l))o.inTag=l+" ";else if(o.inTag&&f&&/>$/.test(n.current())){var h=/^([\S]+) (.*)/.exec(o.inTag);o.inTag=null;var p=">"==n.current()&&a(u[h[1]],h[2]),g=e.getMode(r,p),m=i(h[1],!0),v=i(h[1],!1);o.token=function(e,r){return e.match(m,!1)?(r.token=s,r.localState=r.localMode=null,null):t(e,v,r.localMode.token(e,r.localState))},o.localMode=g,o.localState=e.startState(g,c.indent(o.htmlState,""))}else o.inTag&&(o.inTag+=n.current(),n.eol()&&(o.inTag+=" "));return d}var c=e.getMode(r,{name:"xml",htmlMode:!0,multilineTagIndentFactor:n.multilineTagIndentFactor,multilineTagIndentPastTag:n.multilineTagIndentPastTag}),u={},d=n&&n.tags,f=n&&n.scriptTypes;if(o(l,u),d&&o(d,u),f)for(var h=f.length-1;h>=0;h--)u.script.unshift(["type",f[h].matches,f[h].mode]);return{startState:function(){var t=e.startState(c);return{token:s,inTag:null,localMode:null,localState:null,htmlState:t}},copyState:function(t){var r;return t.localState&&(r=e.copyState(t.localMode,t.localState)),{token:t.token,inTag:t.inTag,localMode:t.localMode,localState:r,htmlState:e.copyState(c,t.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(t,r){return!t.localMode||/^\s*<\//.test(r)?c.indent(t.htmlState,r):t.localMode.indent?t.localMode.indent(t.localState,r):e.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||c}}}},"xml","javascript","css"),e.defineMIME("text/html","htmlmixed")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,r){return/^(?:operator|sof|keyword c|case|new|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(r||0)))}e.defineMode("javascript",function(r,n){function i(e){for(var t,r=!1,n=!1;null!=(t=e.next());){if(!r){if("/"==t&&!n)return;"["==t?n=!0:n&&"]"==t&&(n=!1)}r=!r&&"\\"==t}}function o(e,t,r){return be=e,we=r,t}function a(e,r){var n=e.next();if('"'==n||"'"==n)return r.tokenize=l(n),r.tokenize(e,r);if("."==n&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return o("number","number");if("."==n&&e.match(".."))return o("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return o(n);if("="==n&&e.eat(">"))return o("=>","operator");if("0"==n&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),o("number","number");if("0"==n&&e.eat(/o/i))return e.eatWhile(/[0-7]/i),o("number","number");if("0"==n&&e.eat(/b/i))return e.eatWhile(/[01]/i),o("number","number");if(/\d/.test(n))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),o("number","number");if("/"==n)return e.eat("*")?(r.tokenize=s,s(e,r)):e.eat("/")?(e.skipToEnd(),o("comment","comment")):t(e,r,1)?(i(e),e.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/),o("regexp","string-2")):(e.eatWhile(Ne),o("operator","operator",e.current()));if("`"==n)return r.tokenize=c,c(e,r);if("#"==n)return e.skipToEnd(),o("error","error");if(Ne.test(n))return e.eatWhile(Ne),o("operator","operator",e.current());if(Te.test(n)){e.eatWhile(Te);var a=e.current(),u=Me.propertyIsEnumerable(a)&&Me[a];return u&&"."!=r.lastType?o(u.type,u.style,a):o("variable","variable",a)}}function l(e){return function(t,r){var n,i=!1;if(Ce&&"@"==t.peek()&&t.match(Ae))return r.tokenize=a,o("jsonld-keyword","meta");for(;null!=(n=t.next())&&(n!=e||i);)i=!i&&"\\"==n;return i||(r.tokenize=a),o("string","string")}}function s(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=a;break}n="*"==r}return o("comment","comment")}function c(e,t){for(var r,n=!1;null!=(r=e.next());){if(!n&&("`"==r||"$"==r&&e.eat("{"))){t.tokenize=a;break}n=!n&&"\\"==r}return o("quasi","string-2",e.current())}function u(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var r=e.string.indexOf("=>",e.start);if(!(r<0)){for(var n=0,i=!1,o=r-1;o>=0;--o){var a=e.string.charAt(o),l=Oe.indexOf(a);if(l>=0&&l<3){if(!n){++o;break}if(0==--n)break}else if(l>=3&&l<6)++n;else if(Te.test(a))i=!0;else{if(/["'\/]/.test(a))return;if(i&&!n){++o;break}}}i&&!n&&(t.fatArrowAt=o)}}function d(e,t,r,n,i,o){this.indented=e,this.column=t,this.type=r,this.prev=i,this.info=o,null!=n&&(this.align=n)}function f(e,t){for(var r=e.localVars;r;r=r.next)if(r.name==t)return!0;for(var n=e.context;n;n=n.prev)for(var r=n.vars;r;r=r.next)if(r.name==t)return!0}function h(e,t,r,n,i){var o=e.cc;for(ze.state=e,ze.stream=i,ze.marked=null,ze.cc=o,ze.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){var a=o.length?o.pop():Se?C:k;if(a(r,n)){for(;o.length&&o[o.length-1].lex;)o.pop()();return ze.marked?ze.marked:"variable"==r&&f(e,n)?"variable-2":t}}}function p(){for(var e=arguments.length-1;e>=0;e--)ze.cc.push(arguments[e])}function g(){return p.apply(null,arguments),!0}function m(e){function t(t){for(var r=t;r;r=r.next)if(r.name==e)return!0;return!1}var r=ze.state;if(ze.marked="def",r.context){if(t(r.localVars))return;r.localVars={name:e,next:r.localVars}}else{if(t(r.globalVars))return;n.globalVars&&(r.globalVars={name:e,next:r.globalVars})}}function v(){ze.state.context={prev:ze.state.context,vars:ze.state.localVars},ze.state.localVars=De}function y(){ze.state.localVars=ze.state.context.vars,ze.state.context=ze.state.context.prev}function b(e,t){var r=function(){var r=ze.state,n=r.indented;if("stat"==r.lexical.type)n=r.lexical.indented;else for(var i=r.lexical;i&&")"==i.type&&i.align;i=i.prev)n=i.indented;r.lexical=new d(n,ze.stream.column(),e,null,r.lexical,t)};return r.lex=!0,r}function w(){var e=ze.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function x(e){function t(r){return r==e?g():";"==e?p():g(t)}return t}function k(e,t){return"var"==e?g(b("vardef",t.length),X,x(";"),w):"keyword a"==e?g(b("form"),C,k,w):"keyword b"==e?g(b("form"),k,w):"{"==e?g(b("}"),G,w):";"==e?g():"if"==e?("else"==ze.state.lexical.info&&ze.state.cc[ze.state.cc.length-1]==w&&ze.state.cc.pop()(),g(b("form"),C,k,w,ee)):"function"==e?g(ae):"for"==e?g(b("form"),te,k,w):"variable"==e?g(b("stat"),E):"switch"==e?g(b("form"),C,b("}","switch"),x("{"),G,w,w):"case"==e?g(C,x(":")):"default"==e?g(x(":")):"catch"==e?g(b("form"),v,x("("),le,x(")"),k,w,y):"class"==e?g(b("form"),se,w):"export"==e?g(b("stat"),fe,w):"import"==e?g(b("stat"),he,w):"module"==e?g(b("form"),Y,b("}"),x("{"),G,w,w):"async"==e?g(k):p(b("stat"),C,x(";"),w)}function C(e){return L(e,!1)}function S(e){return L(e,!0)}function L(e,t){if(ze.state.fatArrowAt==ze.stream.start){var r=t?D:z;if("("==e)return g(v,b(")"),V(Y,")"),w,x("=>"),r,y);if("variable"==e)return p(v,Y,x("=>"),r,y)}var n=t?A:N;return We.hasOwnProperty(e)?g(n):"function"==e?g(ae,n):"keyword c"==e||"async"==e?g(t?M:T):"("==e?g(b(")"),T,x(")"),w,n):"operator"==e||"spread"==e?g(t?S:C):"["==e?g(b("]"),ve,w,n):"{"==e?K(B,"}",null,n):"quasi"==e?p(O,n):"new"==e?g(H(t)):g()}function T(e){return e.match(/[;\}\)\],]/)?p():p(C)}function M(e){return e.match(/[;\}\)\],]/)?p():p(S)}function N(e,t){return","==e?g(C):A(e,t,!1)}function A(e,t,r){var n=0==r?N:A,i=0==r?C:S;return"=>"==e?g(v,r?D:z,y):"operator"==e?/\+\+|--/.test(t)?g(n):"?"==t?g(C,x(":"),i):g(i):"quasi"==e?p(O,n):";"!=e?"("==e?K(S,")","call",n):"."==e?g(F,n):"["==e?g(b("]"),T,x("]"),w,n):void 0:void 0}function O(e,t){return"quasi"!=e?p():"${"!=t.slice(t.length-2)?g(O):g(C,W)}function W(e){if("}"==e)return ze.marked="string-2",ze.state.tokenize=c,g(O)}function z(e){return u(ze.stream,ze.state),p("{"==e?k:C)}function D(e){return u(ze.stream,ze.state),p("{"==e?k:S)}function H(e){return function(t){return"."==t?g(e?I:P):p(e?S:C)}}function P(e,t){if("target"==t)return ze.marked="keyword",g(N)}function I(e,t){if("target"==t)return ze.marked="keyword",g(A)}function E(e){return":"==e?g(w,k):p(N,x(";"),w)}function F(e){if("variable"==e)return ze.marked="property",g()}function B(e,t){return"async"==e?g(B):"variable"==e||"keyword"==ze.style?(ze.marked="property",g("get"==t||"set"==t?R:j)):"number"==e||"string"==e?(ze.marked=Ce?"property":ze.style+" property",g(j)):"jsonld-keyword"==e?g(j):"modifier"==e?g(B):"["==e?g(C,x("]"),j):"spread"==e?g(C):void 0}function R(e){return"variable"!=e?p(j):(ze.marked="property",g(ae))}function j(e){return":"==e?g(S):"("==e?p(ae):void 0}function V(e,t){function r(n,i){if(","==n){var o=ze.state.lexical;return"call"==o.info&&(o.pos=(o.pos||0)+1),g(function(r,n){return r==t||n==t?p():p(e)},r)}return n==t||i==t?g():g(x(t))}return function(n,i){return n==t||i==t?g():p(e,r)}}function K(e,t,r){for(var n=3;n"),$):"["==e?g(x("]"),$):void 0}function X(){return p(Y,U,Q,J)}function Y(e,t){return"modifier"==e?g(Y):"variable"==e?(m(t),g()):"spread"==e?g(Y):"["==e?K(Y,"]"):"{"==e?K(Z,"}"):void 0}function Z(e,t){return"variable"!=e||ze.stream.match(/^\s*:/,!1)?("variable"==e&&(ze.marked="property"),"spread"==e?g(Y):"}"==e?p():g(x(":"),Y,Q)):(m(t),g(Q))}function Q(e,t){if("="==t)return g(S)}function J(e){if(","==e)return g(X)}function ee(e,t){if("keyword b"==e&&"else"==t)return g(b("form","else"),k,w)}function te(e){if("("==e)return g(b(")"),re,x(")"),w)}function re(e){return"var"==e?g(X,x(";"),ie):";"==e?g(ie):"variable"==e?g(ne):p(C,x(";"),ie)}function ne(e,t){return"in"==t||"of"==t?(ze.marked="keyword",g(C)):g(N,ie)}function ie(e,t){return";"==e?g(oe):"in"==t||"of"==t?(ze.marked="keyword",g(C)):p(C,x(";"),oe)}function oe(e){")"!=e&&g(C)}function ae(e,t){return"*"==t?(ze.marked="keyword",g(ae)):"variable"==e?(m(t),g(ae)):"("==e?g(v,b(")"),V(le,")"),w,U,k,y):void 0}function le(e){return"spread"==e?g(le):p(Y,U,q)}function se(e,t){if("variable"==e)return m(t),g(ce)}function ce(e,t){return"extends"==t?g(C,ce):"{"==e?g(b("}"),ue,w):void 0}function ue(e,t){return"variable"==e||"keyword"==ze.style?"static"==t?(ze.marked="keyword",g(ue)):(ze.marked="property","get"==t||"set"==t?g(de,ae,ue):g(ae,ue)):"*"==t?(ze.marked="keyword",
-g(ue)):";"==e?g(ue):"}"==e?g():void 0}function de(e){return"variable"!=e?p():(ze.marked="property",g())}function fe(e,t){return"*"==t?(ze.marked="keyword",g(me,x(";"))):"default"==t?(ze.marked="keyword",g(C,x(";"))):p(k)}function he(e){return"string"==e?g():p(pe,me)}function pe(e,t){return"{"==e?K(pe,"}"):("variable"==e&&m(t),"*"==t&&(ze.marked="keyword"),g(ge))}function ge(e,t){if("as"==t)return ze.marked="keyword",g(pe)}function me(e,t){if("from"==t)return ze.marked="keyword",g(C)}function ve(e){return"]"==e?g():p(S,V(S,"]"))}function ye(e,t){return"operator"==e.lastType||","==e.lastType||Ne.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}var be,we,xe=r.indentUnit,ke=n.statementIndent,Ce=n.jsonld,Se=n.json||Ce,Le=n.typescript,Te=n.wordCharacters||/[\w$\xa1-\uffff]/,Me=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),r=e("keyword b"),n=e("keyword c"),i=e("operator"),o={type:"atom",style:"atom"},a={if:e("if"),while:t,with:t,else:r,do:r,try:r,finally:r,return:n,break:n,continue:n,new:e("new"),delete:n,throw:n,debugger:n,var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:i,typeof:i,instanceof:i,true:o,false:o,null:o,undefined:o,NaN:o,Infinity:o,this:e("this"),class:e("class"),super:e("atom"),yield:n,export:e("export"),import:e("import"),extends:n,await:n,async:e("async")};if(Le){var l={type:"variable",style:"variable-3"},s={interface:e("class"),implements:n,namespace:n,module:e("module"),enum:e("module"),public:e("modifier"),private:e("modifier"),protected:e("modifier"),abstract:e("modifier"),as:i,string:l,number:l,boolean:l,any:l};for(var c in s)a[c]=s[c]}return a}(),Ne=/[+\-*&%=<>!?|~^]/,Ae=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,Oe="([{}])",We={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0},ze={state:null,column:null,marked:null,cc:null},De={name:"this",next:{name:"arguments"}};return w.lex=!0,{startState:function(e){var t={tokenize:a,lastType:"sof",cc:[],lexical:new d((e||0)-xe,0,"block",(!1)),localVars:n.localVars,context:n.localVars&&{vars:n.localVars},indented:e||0};return n.globalVars&&"object"==typeof n.globalVars&&(t.globalVars=n.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),u(e,t)),t.tokenize!=s&&e.eatSpace())return null;var r=t.tokenize(e,t);return"comment"==be?r:(t.lastType="operator"!=be||"++"!=we&&"--"!=we?be:"incdec",h(t,r,be,we,e))},indent:function(t,r){if(t.tokenize==s)return e.Pass;if(t.tokenize!=a)return 0;var i=r&&r.charAt(0),o=t.lexical;if(!/^\s*else\b/.test(r))for(var l=t.cc.length-1;l>=0;--l){var c=t.cc[l];if(c==w)o=o.prev;else if(c!=ee)break}"stat"==o.type&&"}"==i&&(o=o.prev),ke&&")"==o.type&&"stat"==o.prev.type&&(o=o.prev);var u=o.type,d=i==u;return"vardef"==u?o.indented+("operator"==t.lastType||","==t.lastType?o.info+1:0):"form"==u&&"{"==i?o.indented:"form"==u?o.indented+xe:"stat"==u?o.indented+(ye(t,r)?ke||xe:0):"switch"!=o.info||d||0==n.doubleIndentSwitch?o.align?o.column+(d?0:1):o.indented+(d?0:xe):o.indented+(/^(?:case|default)\b/.test(r)?xe:2*xe)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:Se?null:"/*",blockCommentEnd:Se?null:"*/",lineComment:Se?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:Se?"json":"javascript",jsonldMode:Ce,jsonMode:Se,expressionAllowed:t,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=C&&t!=S||e.cc.pop()}}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},r={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1};e.defineMode("xml",function(n,i){function o(e,t){function r(r){return t.tokenize=r,r(e,t)}var n=e.next();if("<"==n)return e.eat("!")?e.eat("[")?e.match("CDATA[")?r(s("atom","]]>")):null:e.match("--")?r(s("comment","-->")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),r(c(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=s("meta","?>"),"meta"):(T=e.eat("/")?"closeTag":"openTag",t.tokenize=a,"tag bracket");if("&"==n){var i;return i=e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"),i?"atom":"error"}return e.eatWhile(/[^&<]/),null}function a(e,t){var r=e.next();if(">"==r||"/"==r&&e.eat(">"))return t.tokenize=o,T=">"==r?"endTag":"selfcloseTag","tag bracket";if("="==r)return T="equals",null;if("<"==r){t.tokenize=o,t.state=h,t.tagName=t.tagStart=null;var n=t.tokenize(e,t);return n?n+" tag error":"tag error"}return/[\'\"]/.test(r)?(t.tokenize=l(r),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function l(e){var t=function(t,r){for(;!t.eol();)if(t.next()==e){r.tokenize=a;break}return"string"};return t.isInAttribute=!0,t}function s(e,t){return function(r,n){for(;!r.eol();){if(r.match(t)){n.tokenize=o;break}r.next()}return e}}function c(e){return function(t,r){for(var n;null!=(n=t.next());){if("<"==n)return r.tokenize=c(e+1),r.tokenize(t,r);if(">"==n){if(1==e){r.tokenize=o;break}return r.tokenize=c(e-1),r.tokenize(t,r)}}return"meta"}}function u(e,t,r){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=r,(C.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function d(e){e.context&&(e.context=e.context.prev)}function f(e,t){for(var r;;){if(!e.context)return;if(r=e.context.tagName,!C.contextGrabbers.hasOwnProperty(r)||!C.contextGrabbers[r].hasOwnProperty(t))return;d(e)}}function h(e,t,r){return"openTag"==e?(r.tagStart=t.column(),p):"closeTag"==e?g:h}function p(e,t,r){return"word"==e?(r.tagName=t.current(),M="tag",y):(M="error",p)}function g(e,t,r){if("word"==e){var n=t.current();return r.context&&r.context.tagName!=n&&C.implicitlyClosed.hasOwnProperty(r.context.tagName)&&d(r),r.context&&r.context.tagName==n||C.matchClosing===!1?(M="tag",m):(M="tag error",v)}return M="error",v}function m(e,t,r){return"endTag"!=e?(M="error",m):(d(r),h)}function v(e,t,r){return M="error",m(e,t,r)}function y(e,t,r){if("word"==e)return M="attribute",b;if("endTag"==e||"selfcloseTag"==e){var n=r.tagName,i=r.tagStart;return r.tagName=r.tagStart=null,"selfcloseTag"==e||C.autoSelfClosers.hasOwnProperty(n)?f(r,n):(f(r,n),r.context=new u(r,n,i==r.indented)),h}return M="error",y}function b(e,t,r){return"equals"==e?w:(C.allowMissing||(M="error"),y(e,t,r))}function w(e,t,r){return"string"==e?x:"word"==e&&C.allowUnquoted?(M="string",y):(M="error",y(e,t,r))}function x(e,t,r){return"string"==e?x:y(e,t,r)}var k=n.indentUnit,C={},S=i.htmlMode?t:r;for(var L in S)C[L]=S[L];for(var L in i)C[L]=i[L];var T,M;return o.isInText=!0,{startState:function(e){var t={tokenize:o,state:h,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;T=null;var r=t.tokenize(e,t);return(r||T)&&"comment"!=r&&(M=null,t.state=t.state(T||r,e,t),M&&(r="error"==M?r+" error":M)),r},indent:function(t,r,n){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+k;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=a&&t.tokenize!=o)return n?n.match(/^(\s*)/)[0].length:0;if(t.tagName)return C.multilineTagIndentPastTag!==!1?t.tagStart+t.tagName.length+2:t.tagStart+k*(C.multilineTagIndentFactor||1);if(C.alignCDATA&&/$/,blockCommentStart:"",configuration:C.htmlMode?"html":"xml",helperType:C.htmlMode?"html":"xml",skipAttribute:function(e){e.state==w&&(e.state=y)}}}),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})});
\ No newline at end of file
diff --git a/core/built/assets/ghost.css b/core/built/assets/ghost.css
index cca255a958..e8c6a8d998 100644
--- a/core/built/assets/ghost.css
+++ b/core/built/assets/ghost.css
@@ -2417,25 +2417,6 @@ table td,
background: rgb(242, 246, 233);
}
-/* Schedule notification top
-/* ---------------------------------------------------------- */
-
-.gh-notification-schedule {
- display: inline-block;
- margin: 0;
- padding: 7px 10px;
- width: auto;
- border: #e2edf2 1px solid;
- border-radius: 2px;
- box-shadow: none;
- vertical-align: middle;
- line-height: 1.3em;
-}
-
-.gh-notification-schedule:hover {
- cursor: default;
-}
-
/* Alerts
/* ---------------------------------------------------------- */
@@ -2453,7 +2434,7 @@ table td,
/* Base alert style */
.gh-alert {
- z-index: 9999;
+ z-index: 1000;
-ms-flex-positive: 1;
flex-grow: 1;
display: -ms-flexbox;
@@ -4074,8 +4055,33 @@ body > .ember-view:not(.liquid-target-container) {
margin: 0 15px 10px;
}
-.gh-nav-search .ember-power-select-trigger {
- outline: 0;
+.gh-nav-search .selectize-control {
+ display: -ms-flexbox;
+ display: flex;
+}
+
+.gh-nav-search-input .selectize-input {
+ padding: 4px 8px;
+ padding-right: 30px;
+ height: auto;
+}
+
+.gh-nav-search-input .selectize-input,
+.gh-nav-search-input .selectize-input input,
+.gh-nav-search-input .selectize-dropdown {
+ font-size: 1.3rem;
+}
+
+.gh-nav-search .selectize-input.dropdown-active {
+ border-bottom: #fff 1px solid;
+}
+
+.gh-nav-search .selectize-input.dropdown-active:before {
+ display: none;
+}
+
+.gh-nav-search .selectize-dropdown-content {
+ max-height: calc(100vh - 150px);
}
.gh-nav-search-button {
@@ -5142,11 +5148,6 @@ body > .ember-view:not(.liquid-target-container) {
line-height: 18px;
}
-.content-list .entry-meta .internal-tags-list {
- margin-top: 5px;
- line-height: 22px;
-}
-
.content-list .avatar {
position: relative;
float: left;
@@ -5194,7 +5195,7 @@ body > .ember-view:not(.liquid-target-container) {
}
.content-list .status .scheduled {
- color: #9fbb58;
+ color: #f2a925;
}
.content-list ol {
@@ -6531,18 +6532,6 @@ a.user-list-item {
opacity: 1;
}
-/* Upgrade
-/* ---------------------------------------------------------- */
-
-.gh-upgrade-notification {
- color: #e25440;
-}
-
-.gh-upgrade-notification a {
- color: #e25440;
- text-decoration: underline;
-}
-
/* Copyright Info
/* ---------------------------------------------------------- */
diff --git a/core/built/assets/ghost.js b/core/built/assets/ghost.js
index 9c8afbcd7c..98e315d2fb 100644
--- a/core/built/assets/ghost.js
+++ b/core/built/assets/ghost.js
@@ -6,8 +6,8 @@
/* jshint ignore:end */
-define('ghost-admin/adapters/application', ['exports', 'ghost-admin/adapters/embedded-relation-adapter'], function (exports, _ghostAdminAdaptersEmbeddedRelationAdapter) {
- exports['default'] = _ghostAdminAdaptersEmbeddedRelationAdapter['default'].extend({
+define('ghost/adapters/application', ['exports', 'ghost/adapters/embedded-relation-adapter'], function (exports, _ghostAdaptersEmbeddedRelationAdapter) {
+ exports['default'] = _ghostAdaptersEmbeddedRelationAdapter['default'].extend({
shouldBackgroundReloadRecord: function shouldBackgroundReloadRecord() {
return false;
@@ -15,18 +15,15 @@ define('ghost-admin/adapters/application', ['exports', 'ghost-admin/adapters/emb
});
});
-define('ghost-admin/adapters/base', ['exports', 'ember-service/inject', 'ember-data/adapters/rest', 'ghost-admin/utils/ghost-paths', 'ember-simple-auth/mixins/data-adapter-mixin', 'ghost-admin/config/environment'], function (exports, _emberServiceInject, _emberDataAdaptersRest, _ghostAdminUtilsGhostPaths, _emberSimpleAuthMixinsDataAdapterMixin, _ghostAdminConfigEnvironment) {
+define('ghost/adapters/base', ['exports', 'ember', 'ember-data/adapters/rest', 'ghost/utils/ghost-paths', 'ember-simple-auth/mixins/data-adapter-mixin'], function (exports, _ember, _emberDataAdaptersRest, _ghostUtilsGhostPaths, _emberSimpleAuthMixinsDataAdapterMixin) {
+ var service = _ember['default'].inject.service;
exports['default'] = _emberDataAdaptersRest['default'].extend(_emberSimpleAuthMixinsDataAdapterMixin['default'], {
authorizer: 'authorizer:oauth2',
host: window.location.origin,
- namespace: (0, _ghostAdminUtilsGhostPaths['default'])().apiRoot.slice(1),
+ namespace: (0, _ghostUtilsGhostPaths['default'])().apiRoot.slice(1),
- session: (0, _emberServiceInject['default'])(),
-
- headers: {
- 'X-Ghost-Version': _ghostAdminConfigEnvironment['default'].APP.version
- },
+ session: service(),
shouldBackgroundReloadRecord: function shouldBackgroundReloadRecord() {
return false;
@@ -58,6 +55,7 @@ define('ghost-admin/adapters/base', ['exports', 'ember-service/inject', 'ember-d
if (status === 401) {
if (this.get('session.isAuthenticated')) {
this.get('session').invalidate();
+ return; // prevent error from bubbling because invalidate is async
}
}
@@ -65,9 +63,12 @@ define('ghost-admin/adapters/base', ['exports', 'ember-service/inject', 'ember-d
}
});
});
-define('ghost-admin/adapters/embedded-relation-adapter', ['exports', 'ember-metal/get', 'ember-utils', 'ghost-admin/adapters/base'], function (exports, _emberMetalGet, _emberUtils, _ghostAdminAdaptersBase) {
+define('ghost/adapters/embedded-relation-adapter', ['exports', 'ember', 'ghost/adapters/base'], function (exports, _ember, _ghostAdaptersBase) {
function _typeof(obj) { return obj && obj.constructor === Symbol ? 'symbol' : typeof obj; }
+ var get = _ember['default'].get;
+ var isNone = _ember['default'].isNone;
+
// EmbeddedRelationAdapter will augment the query object in calls made to
// DS.Store#findRecord, findAll, query, and queryRecord with the correct "includes"
// (?include=relatedType) by introspecting on the provided subclass of the DS.Model.
@@ -78,7 +79,7 @@ define('ghost-admin/adapters/embedded-relation-adapter', ['exports', 'ember-meta
// If a model has an embedded hasMany relation, the related type will be included:
// roles: DS.hasMany('role', { embedded: 'always' }) => ?include=roles
- exports['default'] = _ghostAdminAdaptersBase['default'].extend({
+ exports['default'] = _ghostAdaptersBase['default'].extend({
find: function find(store, type, id, snapshot) {
return this.ajax(this.buildIncludeURL(store, type.modelName, id, snapshot, 'find'), 'GET');
},
@@ -115,7 +116,7 @@ define('ghost-admin/adapters/embedded-relation-adapter', ['exports', 'ember-meta
updateRecord: function updateRecord(store, type, snapshot) {
var options = {
method: 'PUT',
- id: (0, _emberMetalGet['default'])(snapshot, 'id')
+ id: get(snapshot, 'id')
};
return this.saveRecord(store, type, snapshot, options, 'updateRecord');
@@ -160,7 +161,7 @@ define('ghost-admin/adapters/embedded-relation-adapter', ['exports', 'ember-meta
query = {};
query.id = options;
query.include = toInclude.join(',');
- } else if ((typeof options === 'undefined' ? 'undefined' : _typeof(options)) === 'object' || (0, _emberUtils.isNone)(options)) {
+ } else if ((typeof options === 'undefined' ? 'undefined' : _typeof(options)) === 'object' || isNone(options)) {
// If this is a find all (no existing query object) build one and attach
// the includes.
// If this is a find with an existing query object then merge the includes
@@ -195,8 +196,8 @@ define('ghost-admin/adapters/embedded-relation-adapter', ['exports', 'ember-meta
}
});
});
-define('ghost-admin/adapters/setting', ['exports', 'ghost-admin/adapters/application'], function (exports, _ghostAdminAdaptersApplication) {
- exports['default'] = _ghostAdminAdaptersApplication['default'].extend({
+define('ghost/adapters/setting', ['exports', 'ghost/adapters/application'], function (exports, _ghostAdaptersApplication) {
+ exports['default'] = _ghostAdaptersApplication['default'].extend({
updateRecord: function updateRecord(store, type, record) {
var data = {};
var serializer = store.serializerFor(type.modelName);
@@ -214,11 +215,11 @@ define('ghost-admin/adapters/setting', ['exports', 'ghost-admin/adapters/applica
}
});
});
-define('ghost-admin/adapters/tag', ['exports', 'ghost-admin/adapters/application', 'ghost-admin/mixins/slug-url'], function (exports, _ghostAdminAdaptersApplication, _ghostAdminMixinsSlugUrl) {
- exports['default'] = _ghostAdminAdaptersApplication['default'].extend(_ghostAdminMixinsSlugUrl['default']);
+define('ghost/adapters/tag', ['exports', 'ghost/adapters/application', 'ghost/mixins/slug-url'], function (exports, _ghostAdaptersApplication, _ghostMixinsSlugUrl) {
+ exports['default'] = _ghostAdaptersApplication['default'].extend(_ghostMixinsSlugUrl['default']);
});
-define('ghost-admin/adapters/user', ['exports', 'ghost-admin/adapters/application', 'ghost-admin/mixins/slug-url'], function (exports, _ghostAdminAdaptersApplication, _ghostAdminMixinsSlugUrl) {
- exports['default'] = _ghostAdminAdaptersApplication['default'].extend(_ghostAdminMixinsSlugUrl['default'], {
+define('ghost/adapters/user', ['exports', 'ghost/adapters/application', 'ghost/mixins/slug-url'], function (exports, _ghostAdaptersApplication, _ghostMixinsSlugUrl) {
+ exports['default'] = _ghostAdaptersApplication['default'].extend(_ghostMixinsSlugUrl['default'], {
find: function find(store, type, id) {
return this.findQuery(store, type, { id: id, status: 'all' });
},
@@ -239,42 +240,33 @@ define('ghost-admin/adapters/user', ['exports', 'ghost-admin/adapters/applicatio
}
});
});
-define('ghost-admin/app', ['exports', 'ember', 'ember-application', 'ghost-admin/resolver', 'ember-load-initializers', 'ghost-admin/utils/route', 'ghost-admin/utils/link-component', 'ghost-admin/utils/text-field', 'ghost-admin/config/environment'], function (exports, _ember, _emberApplication, _ghostAdminResolver, _emberLoadInitializers, _ghostAdminUtilsRoute, _ghostAdminUtilsLinkComponent, _ghostAdminUtilsTextField, _ghostAdminConfigEnvironment) {
+define('ghost/app', ['exports', 'ember', 'ghost/resolver', 'ember-load-initializers', 'ghost/utils/link-component', 'ghost/utils/text-field', 'ghost/config/environment'], function (exports, _ember, _ghostResolver, _emberLoadInitializers, _ghostUtilsLinkComponent, _ghostUtilsTextField, _ghostConfigEnvironment) {
+ var Application = _ember['default'].Application;
_ember['default'].MODEL_FACTORY_INJECTIONS = true;
- var App = _emberApplication['default'].extend({
- Resolver: _ghostAdminResolver['default'],
- modulePrefix: _ghostAdminConfigEnvironment['default'].modulePrefix,
- podModulePrefix: _ghostAdminConfigEnvironment['default'].podModulePrefix
+ var App = Application.extend({
+ Resolver: _ghostResolver['default'],
+ modulePrefix: _ghostConfigEnvironment['default'].modulePrefix,
+ podModulePrefix: _ghostConfigEnvironment['default'].podModulePrefix
});
- (0, _emberLoadInitializers['default'])(App, _ghostAdminConfigEnvironment['default'].modulePrefix);
+ (0, _emberLoadInitializers['default'])(App, _ghostConfigEnvironment['default'].modulePrefix);
exports['default'] = App;
});
-define('ghost-admin/authenticators/oauth2', ['exports', 'ember-computed', 'ember-service/inject', 'ember-simple-auth/authenticators/oauth2-password-grant', 'ember-runloop'], function (exports, _emberComputed, _emberServiceInject, _emberSimpleAuthAuthenticatorsOauth2PasswordGrant, _emberRunloop) {
+define('ghost/authenticators/oauth2', ['exports', 'ember', 'ember-simple-auth/authenticators/oauth2-password-grant'], function (exports, _ember, _emberSimpleAuthAuthenticatorsOauth2PasswordGrant) {
+ var computed = _ember['default'].computed;
+ var service = _ember['default'].inject.service;
exports['default'] = _emberSimpleAuthAuthenticatorsOauth2PasswordGrant['default'].extend({
- session: (0, _emberServiceInject['default'])(),
- config: (0, _emberServiceInject['default'])(),
- ghostPaths: (0, _emberServiceInject['default'])(),
-
- init: function init() {
- var _this = this;
-
- this._super.apply(this, arguments);
-
- var handler = _emberRunloop['default'].bind(this, function () {
- _this.onOnline();
- });
- window.addEventListener('online', handler);
- },
+ config: service(),
+ ghostPaths: service(),
- serverTokenEndpoint: (0, _emberComputed['default'])('ghostPaths.apiRoot', function () {
+ serverTokenEndpoint: computed('ghostPaths.apiRoot', function () {
return this.get('ghostPaths.apiRoot') + '/authentication/token';
}),
- serverTokenRevocationEndpoint: (0, _emberComputed['default'])('ghostPaths.apiRoot', function () {
+ serverTokenRevocationEndpoint: computed('ghostPaths.apiRoot', function () {
return this.get('ghostPaths.apiRoot') + '/authentication/revoke';
}),
@@ -284,39 +276,23 @@ define('ghost-admin/authenticators/oauth2', ['exports', 'ember-computed', 'ember
data.client_secret = this.get('config.clientSecret');
/* jscs:enable requireCamelCaseOrUpperCaseIdentifiers */
return this._super(url, data);
- },
-
- /**
- * Invoked when "navigator.online" event is trigerred.
- * This is a helper function to handle intermittent internet connectivity. Token is refreshed
- * when browser status becomes "online".
- */
- onOnline: function onOnline() {
- if (this.get('session.isAuthenticated')) {
- var autoRefresh = this.get('refreshAccessTokens');
- if (autoRefresh) {
- var expiresIn = this.get('session.data.authenticated.expires_in');
- var token = this.get('session.data.authenticated.refresh_token');
- return this._refreshAccessToken(expiresIn, token);
- }
- }
}
});
});
-define('ghost-admin/authorizers/oauth2', ['exports', 'ember-simple-auth/authorizers/oauth2-bearer'], function (exports, _emberSimpleAuthAuthorizersOauth2Bearer) {
+define('ghost/authorizers/oauth2', ['exports', 'ember-simple-auth/authorizers/oauth2-bearer'], function (exports, _emberSimpleAuthAuthorizersOauth2Bearer) {
exports['default'] = _emberSimpleAuthAuthorizersOauth2Bearer['default'];
});
-define('ghost-admin/components/app-version', ['exports', 'ember-cli-app-version/components/app-version', 'ghost-admin/config/environment'], function (exports, _emberCliAppVersionComponentsAppVersion, _ghostAdminConfigEnvironment) {
+define('ghost/components/app-version', ['exports', 'ember-cli-app-version/components/app-version', 'ghost/config/environment'], function (exports, _emberCliAppVersionComponentsAppVersion, _ghostConfigEnvironment) {
- var name = _ghostAdminConfigEnvironment['default'].APP.name;
- var version = _ghostAdminConfigEnvironment['default'].APP.version;
+ var name = _ghostConfigEnvironment['default'].APP.name;
+ var version = _ghostConfigEnvironment['default'].APP.version;
exports['default'] = _emberCliAppVersionComponentsAppVersion['default'].extend({
version: version,
name: name
});
});
-define('ghost-admin/components/basic-dropdown', ['exports', 'ember-basic-dropdown/components/basic-dropdown'], function (exports, _emberBasicDropdownComponentsBasicDropdown) {
+define('ghost/components/basic-dropdown', ['exports', 'ember-basic-dropdown/components/basic-dropdown'], function (exports, _emberBasicDropdownComponentsBasicDropdown) {
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
@@ -324,18 +300,10 @@ define('ghost-admin/components/basic-dropdown', ['exports', 'ember-basic-dropdow
}
});
});
-define('ghost-admin/components/basic-dropdown/content', ['exports', 'ember-basic-dropdown/components/basic-dropdown/content'], function (exports, _emberBasicDropdownComponentsBasicDropdownContent) {
- Object.defineProperty(exports, 'default', {
- enumerable: true,
- get: function get() {
- return _emberBasicDropdownComponentsBasicDropdownContent['default'];
- }
- });
-});
-define('ghost-admin/components/ember-selectize', ['exports', 'ember-cli-selectize/components/ember-selectize'], function (exports, _emberCliSelectizeComponentsEmberSelectize) {
+define('ghost/components/ember-selectize', ['exports', 'ember-cli-selectize/components/ember-selectize'], function (exports, _emberCliSelectizeComponentsEmberSelectize) {
exports['default'] = _emberCliSelectizeComponentsEmberSelectize['default'];
});
-define('ghost-admin/components/ember-wormhole', ['exports', 'ember-wormhole/components/ember-wormhole'], function (exports, _emberWormholeComponentsEmberWormhole) {
+define('ghost/components/ember-wormhole', ['exports', 'ember-wormhole/components/ember-wormhole'], function (exports, _emberWormholeComponentsEmberWormhole) {
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
@@ -343,8 +311,10 @@ define('ghost-admin/components/ember-wormhole', ['exports', 'ember-wormhole/comp
}
});
});
-define('ghost-admin/components/gh-activating-list-item', ['exports', 'ember-component', 'ember-runloop'], function (exports, _emberComponent, _emberRunloop) {
- exports['default'] = _emberComponent['default'].extend({
+define('ghost/components/gh-activating-list-item', ['exports', 'ember'], function (exports, _ember) {
+ var Component = _ember['default'].Component;
+ var run = _ember['default'].run;
+ exports['default'] = Component.extend({
tagName: 'li',
classNameBindings: ['active'],
active: false,
@@ -356,22 +326,25 @@ define('ghost-admin/components/gh-activating-list-item', ['exports', 'ember-comp
actions: {
setActive: function setActive(value) {
- (0, _emberRunloop.schedule)('afterRender', this, function () {
+ run.schedule('afterRender', this, function () {
this.set('active', value);
});
}
}
});
});
-define('ghost-admin/components/gh-alert', ['exports', 'ember-component', 'ember-computed', 'ember-service/inject'], function (exports, _emberComponent, _emberComputed, _emberServiceInject) {
- exports['default'] = _emberComponent['default'].extend({
+define('ghost/components/gh-alert', ['exports', 'ember'], function (exports, _ember) {
+ var Component = _ember['default'].Component;
+ var computed = _ember['default'].computed;
+ var service = _ember['default'].inject.service;
+ exports['default'] = Component.extend({
tagName: 'article',
classNames: ['gh-alert'],
classNameBindings: ['typeClass'],
- notifications: (0, _emberServiceInject['default'])(),
+ notifications: service(),
- typeClass: (0, _emberComputed['default'])('message.type', function () {
+ typeClass: computed('message.type', function () {
var type = this.get('message.type');
var classes = '';
var typeMapping = undefined;
@@ -397,46 +370,55 @@ define('ghost-admin/components/gh-alert', ['exports', 'ember-component', 'ember-
}
});
});
-define('ghost-admin/components/gh-alerts', ['exports', 'ember-component', 'ember-computed', 'ember-service/inject', 'ember-metal/observer'], function (exports, _emberComponent, _emberComputed, _emberServiceInject, _emberMetalObserver) {
- exports['default'] = _emberComponent['default'].extend({
+define('ghost/components/gh-alerts', ['exports', 'ember'], function (exports, _ember) {
+ var Component = _ember['default'].Component;
+ var computed = _ember['default'].computed;
+ var service = _ember['default'].inject.service;
+ var observer = _ember['default'].observer;
+ var alias = computed.alias;
+ exports['default'] = Component.extend({
tagName: 'aside',
classNames: 'gh-alerts',
- notifications: (0, _emberServiceInject['default'])(),
+ notifications: service(),
- messages: (0, _emberComputed.alias)('notifications.alerts'),
+ messages: alias('notifications.alerts'),
- messageCountObserver: (0, _emberMetalObserver['default'])('messages.[]', function () {
+ messageCountObserver: observer('messages.[]', function () {
this.sendAction('notify', this.get('messages').length);
})
});
});
-define('ghost-admin/components/gh-app', ['exports', 'jquery', 'ember-component', 'ember-metal/observer'], function (exports, _jquery, _emberComponent, _emberMetalObserver) {
- exports['default'] = _emberComponent['default'].extend({
+define('ghost/components/gh-app', ['exports', 'ember'], function (exports, _ember) {
+ var Component = _ember['default'].Component;
+ var observer = _ember['default'].observer;
+ exports['default'] = Component.extend({
classNames: ['gh-app'],
showSettingsMenu: false,
- toggleSettingsMenuBodyClass: (0, _emberMetalObserver['default'])('showSettingsMenu', function () {
+ toggleSettingsMenuBodyClass: observer('showSettingsMenu', function () {
var showSettingsMenu = this.get('showSettingsMenu');
- (0, _jquery['default'])('body').toggleClass('settings-menu-expanded', showSettingsMenu);
+ _ember['default'].$('body').toggleClass('settings-menu-expanded', showSettingsMenu);
})
});
});
-define('ghost-admin/components/gh-blog-url', ['exports', 'ember-component', 'ember-service/inject'], function (exports, _emberComponent, _emberServiceInject) {
- exports['default'] = _emberComponent['default'].extend({
+define('ghost/components/gh-blog-url', ['exports', 'ember'], function (exports, _ember) {
+ var Component = _ember['default'].Component;
+ var service = _ember['default'].inject.service;
+ exports['default'] = Component.extend({
tagName: '',
- config: (0, _emberServiceInject['default'])()
+ config: service()
});
});
-define('ghost-admin/components/gh-cm-editor', ['exports', 'ember-component', 'ember-runloop', 'ember-service/inject', 'ghost-admin/utils/bound-one-way', 'ember-invoke-action'], function (exports, _emberComponent, _emberRunloop, _emberServiceInject, _ghostAdminUtilsBoundOneWay, _emberInvokeAction) {
-
- var CmEditorComponent = _emberComponent['default'].extend(_emberInvokeAction.InvokeActionMixin, {
+define('ghost/components/gh-cm-editor', ['exports', 'ember'], function (exports, _ember) {
+ var Component = _ember['default'].Component;
+ exports['default'] = Component.extend({
classNameBindings: ['isFocused:focused'],
- _value: (0, _ghostAdminUtilsBoundOneWay['default'])('value'), // make sure a value exists
+ value: '', // make sure a value exists
isFocused: false,
// options for the editor
@@ -447,36 +429,22 @@ define('ghost-admin/components/gh-cm-editor', ['exports', 'ember-component', 'em
_editor: null, // reference to CodeMirror editor
- lazyLoader: (0, _emberServiceInject['default'])(),
-
didInsertElement: function didInsertElement() {
var _this = this;
this._super.apply(this, arguments);
- this.get('lazyLoader').loadStyle('codemirror', 'codemirror/codemirror.css');
-
- this.get('lazyLoader').loadScript('codemirror', 'codemirror/codemirror.js').then(function () {
- (0, _emberRunloop.scheduleOnce)('afterRender', _this, function () {
- this._initCodeMirror();
- });
- });
- },
-
- _initCodeMirror: function _initCodeMirror() {
- var _this2 = this;
-
var options = this.getProperties('lineNumbers', 'indentUnit', 'mode', 'theme');
- var editor = new CodeMirror(this.element, options);
+ var editor = new CodeMirror(this.get('element'), options);
- editor.getDoc().setValue(this.get('_value'));
+ editor.getDoc().setValue(this.get('value'));
// events
- editor.on('focus', (0, _emberRunloop.bind)(this, 'set', 'isFocused', true));
- editor.on('blur', (0, _emberRunloop.bind)(this, 'set', 'isFocused', false));
+ editor.on('focus', _ember['default'].run.bind(this, 'set', 'isFocused', true));
+ editor.on('blur', _ember['default'].run.bind(this, 'set', 'isFocused', false));
editor.on('change', function () {
- (0, _emberRunloop['default'])(_this2, function () {
- this.invokeAction('update', editor.getDoc().getValue());
+ _ember['default'].run(_this, function () {
+ this.set('value', editor.getDoc().getValue());
});
});
@@ -491,16 +459,11 @@ define('ghost-admin/components/gh-cm-editor', ['exports', 'ember-component', 'em
this._editor = null;
}
});
-
- CmEditorComponent.reopenClass({
- positionalParams: ['value']
- });
-
- exports['default'] = CmEditorComponent;
});
/* global CodeMirror */
-define('ghost-admin/components/gh-content-cover', ['exports', 'ember-component'], function (exports, _emberComponent) {
- exports['default'] = _emberComponent['default'].extend({
+define('ghost/components/gh-content-cover', ['exports', 'ember'], function (exports, _ember) {
+ var Component = _ember['default'].Component;
+ exports['default'] = Component.extend({
classNames: ['content-cover'],
onClick: null,
@@ -526,8 +489,9 @@ Example:
{{gh-content-cover onClick="closeMenus" onMouseEnter="closeAutoNav"}}
```
**/
-define('ghost-admin/components/gh-content-preview-content', ['exports', 'ember-component'], function (exports, _emberComponent) {
- exports['default'] = _emberComponent['default'].extend({
+define('ghost/components/gh-content-preview-content', ['exports', 'ember'], function (exports, _ember) {
+ var Component = _ember['default'].Component;
+ exports['default'] = Component.extend({
classNames: ['content-preview-content'],
content: null,
@@ -546,52 +510,50 @@ define('ghost-admin/components/gh-content-preview-content', ['exports', 'ember-c
}
});
});
-define('ghost-admin/components/gh-content-view-container', ['exports', 'ember-component', 'ember-computed', 'ember-service/inject'], function (exports, _emberComponent, _emberComputed, _emberServiceInject) {
- exports['default'] = _emberComponent['default'].extend({
+define('ghost/components/gh-content-view-container', ['exports', 'ember'], function (exports, _ember) {
+ var Component = _ember['default'].Component;
+ var computed = _ember['default'].computed;
+ var service = _ember['default'].inject.service;
+ exports['default'] = Component.extend({
tagName: 'section',
classNames: ['gh-view', 'content-view-container'],
- mediaQueries: (0, _emberServiceInject['default'])(),
- previewIsHidden: (0, _emberComputed.reads)('mediaQueries.maxWidth900')
+ mediaQueries: service(),
+ previewIsHidden: computed.reads('mediaQueries.maxWidth900')
});
});
-define('ghost-admin/components/gh-datetime-input', ['exports', 'ember-component', 'rsvp', 'ember-service/inject', 'ghost-admin/utils/bound-one-way', 'ghost-admin/utils/date-formatting', 'ember-invoke-action'], function (exports, _emberComponent, _rsvp, _emberServiceInject, _ghostAdminUtilsBoundOneWay, _ghostAdminUtilsDateFormatting, _emberInvokeAction) {
- exports['default'] = _emberComponent['default'].extend(_emberInvokeAction.InvokeActionMixin, {
+define('ghost/components/gh-datetime-input', ['exports', 'ember', 'ghost/mixins/text-input', 'ghost/utils/bound-one-way', 'ghost/utils/date-formatting', 'ember-invoke-action'], function (exports, _ember, _ghostMixinsTextInput, _ghostUtilsBoundOneWay, _ghostUtilsDateFormatting, _emberInvokeAction) {
+ var Component = _ember['default'].Component;
+ exports['default'] = Component.extend(_ghostMixinsTextInput['default'], {
tagName: 'span',
classNames: 'input-icon icon-calendar',
- datetime: (0, _ghostAdminUtilsBoundOneWay['default'])('value'),
+ datetime: (0, _ghostUtilsBoundOneWay['default'])('value'),
inputClass: null,
inputId: null,
inputName: null,
- timeZone: (0, _emberServiceInject['default'])(),
didReceiveAttrs: function didReceiveAttrs() {
- var _this = this;
-
- var promises = {
- datetime: _rsvp['default'].resolve(this.get('datetime') || moment.utc()),
- blogTimezone: _rsvp['default'].resolve(this.get('timeZone.blogTimezone'))
- };
+ var datetime = this.get('datetime') || moment();
if (!this.get('update')) {
throw new Error('You must provide an `update` action to `{{' + this.templateName + '}}`.');
}
- _rsvp['default'].hash(promises).then(function (hash) {
- _this.set('datetime', (0, _ghostAdminUtilsDateFormatting.formatDate)(hash.datetime || moment.utc(), hash.blogTimezone));
- });
+ this.set('datetime', (0, _ghostUtilsDateFormatting.formatDate)(datetime));
},
focusOut: function focusOut() {
var datetime = this.get('datetime');
- this.invokeAction('update', datetime);
+ (0, _emberInvokeAction.invokeAction)(this, 'update', datetime);
}
});
});
-define('ghost-admin/components/gh-dropdown-button', ['exports', 'ember-component', 'ember-service/inject', 'ghost-admin/mixins/dropdown-mixin'], function (exports, _emberComponent, _emberServiceInject, _ghostAdminMixinsDropdownMixin) {
- exports['default'] = _emberComponent['default'].extend(_ghostAdminMixinsDropdownMixin['default'], {
+define('ghost/components/gh-dropdown-button', ['exports', 'ember', 'ghost/mixins/dropdown-mixin'], function (exports, _ember, _ghostMixinsDropdownMixin) {
+ var Component = _ember['default'].Component;
+ var service = _ember['default'].inject.service;
+ exports['default'] = Component.extend(_ghostMixinsDropdownMixin['default'], {
tagName: 'button',
attributeBindings: 'role',
role: 'button',
@@ -599,7 +561,7 @@ define('ghost-admin/components/gh-dropdown-button', ['exports', 'ember-component
// matches with the dropdown this button toggles
dropdownName: null,
- dropdown: (0, _emberServiceInject['default'])(),
+ dropdown: service(),
// Notify dropdown service this dropdown should be toggled
click: function click(event) {
@@ -608,8 +570,11 @@ define('ghost-admin/components/gh-dropdown-button', ['exports', 'ember-component
}
});
});
-define('ghost-admin/components/gh-dropdown', ['exports', 'ember-component', 'ember-computed', 'ember-service/inject', 'ember-runloop', 'ghost-admin/mixins/dropdown-mixin'], function (exports, _emberComponent, _emberComputed, _emberServiceInject, _emberRunloop, _ghostAdminMixinsDropdownMixin) {
- exports['default'] = _emberComponent['default'].extend(_ghostAdminMixinsDropdownMixin['default'], {
+define('ghost/components/gh-dropdown', ['exports', 'ember', 'ghost/mixins/dropdown-mixin'], function (exports, _ember, _ghostMixinsDropdownMixin) {
+ var Component = _ember['default'].Component;
+ var computed = _ember['default'].computed;
+ var service = _ember['default'].inject.service;
+ exports['default'] = Component.extend(_ghostMixinsDropdownMixin['default'], {
classNames: 'dropdown',
classNameBindings: ['fadeIn:fade-in-scale:fade-out', 'isOpen:open:closed'],
@@ -623,11 +588,11 @@ define('ghost-admin/components/gh-dropdown', ['exports', 'ember-component', 'emb
isOpen: false,
// Managed the toggle between the fade-in and fade-out classes
- fadeIn: (0, _emberComputed['default'])('isOpen', 'closing', function () {
+ fadeIn: computed('isOpen', 'closing', function () {
return this.get('isOpen') && !this.get('closing');
}),
- dropdown: (0, _emberServiceInject['default'])(),
+ dropdown: service(),
open: function open() {
this.set('isOpen', true);
@@ -646,7 +611,7 @@ define('ghost-admin/components/gh-dropdown', ['exports', 'ember-component', 'emb
this.$().on('animationend webkitAnimationEnd oanimationend MSAnimationEnd', function (event) {
if (event.originalEvent.animationName === 'fade-out') {
- (0, _emberRunloop['default'])(_this, function () {
+ _ember['default'].run(_this, function () {
if (this.get('closing')) {
this.set('isOpen', false);
this.set('closing', false);
@@ -702,8 +667,10 @@ define('ghost-admin/components/gh-dropdown', ['exports', 'ember-component', 'emb
}
});
});
-define('ghost-admin/components/gh-ed-editor', ['exports', 'ember-components/text-area', 'ember-runloop', 'ghost-admin/mixins/ed-editor-api', 'ghost-admin/mixins/ed-editor-shortcuts', 'ghost-admin/mixins/ed-editor-scroll', 'ember-invoke-action'], function (exports, _emberComponentsTextArea, _emberRunloop, _ghostAdminMixinsEdEditorApi, _ghostAdminMixinsEdEditorShortcuts, _ghostAdminMixinsEdEditorScroll, _emberInvokeAction) {
- exports['default'] = _emberComponentsTextArea['default'].extend(_ghostAdminMixinsEdEditorApi['default'], _ghostAdminMixinsEdEditorShortcuts['default'], _ghostAdminMixinsEdEditorScroll['default'], _emberInvokeAction.InvokeActionMixin, {
+define('ghost/components/gh-ed-editor', ['exports', 'ember', 'ghost/mixins/ed-editor-api', 'ghost/mixins/ed-editor-shortcuts', 'ghost/mixins/ed-editor-scroll', 'ember-invoke-action'], function (exports, _ember, _ghostMixinsEdEditorApi, _ghostMixinsEdEditorShortcuts, _ghostMixinsEdEditorScroll, _emberInvokeAction) {
+ var TextArea = _ember['default'].TextArea;
+ var run = _ember['default'].run;
+ exports['default'] = TextArea.extend(_ghostMixinsEdEditorApi['default'], _ghostMixinsEdEditorShortcuts['default'], _ghostMixinsEdEditorScroll['default'], {
focus: false,
/**
@@ -730,9 +697,9 @@ define('ghost-admin/components/gh-ed-editor', ['exports', 'ember-components/text
this.setFocus();
- this.invokeAction('setEditor', this);
+ (0, _emberInvokeAction.invokeAction)(this, 'setEditor', this);
- _emberRunloop['default'].scheduleOnce('afterRender', this, this.afterRenderEvent);
+ run.scheduleOnce('afterRender', this, this.afterRenderEvent);
},
afterRenderEvent: function afterRenderEvent() {
@@ -743,24 +710,25 @@ define('ghost-admin/components/gh-ed-editor', ['exports', 'ember-components/text
actions: {
toggleCopyHTMLModal: function toggleCopyHTMLModal(generatedHTML) {
- this.invokeAction('toggleCopyHTMLModal', generatedHTML);
+ (0, _emberInvokeAction.invokeAction)(this, 'toggleCopyHTMLModal', generatedHTML);
}
}
});
});
-define('ghost-admin/components/gh-ed-preview', ['exports', 'ember', 'ember-component', 'ember-object', 'ember-runloop', 'ember-array/utils', 'ghost-admin/helpers/gh-format-markdown'], function (exports, _ember, _emberComponent, _emberObject, _emberRunloop, _emberArrayUtils, _ghostAdminHelpersGhFormatMarkdown) {
+define('ghost/components/gh-ed-preview', ['exports', 'ember', 'ghost/helpers/gh-format-markdown'], function (exports, _ember, _ghostHelpersGhFormatMarkdown) {
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } }
- // ember-cli-shims doesn't export uuid
+ var Component = _ember['default'].Component;
+ var run = _ember['default'].run;
var uuid = _ember['default'].uuid;
- exports['default'] = _emberComponent['default'].extend({
+ exports['default'] = Component.extend({
_scrollWrapper: null,
previewHTML: '',
init: function init() {
this._super.apply(this, arguments);
- this.set('imageUploadComponents', (0, _emberArrayUtils.A)([]));
+ this.set('imageUploadComponents', _ember['default'].A([]));
this.buildPreviewHTML();
},
@@ -782,7 +750,7 @@ define('ghost-admin/components/gh-ed-preview', ['exports', 'ember', 'ember-compo
}
if (attrs.newAttrs.markdown.value !== attrs.oldAttrs.markdown.value) {
- _emberRunloop['default'].throttle(this, this.buildPreviewHTML, 30, false);
+ run.throttle(this, this.buildPreviewHTML, 30, false);
}
},
@@ -798,7 +766,7 @@ define('ghost-admin/components/gh-ed-preview', ['exports', 'ember', 'ember-compo
var _this = this;
var markdown = this.get('markdown');
- var html = (0, _ghostAdminHelpersGhFormatMarkdown.formatMarkdown)([markdown]).string;
+ var html = (0, _ghostHelpersGhFormatMarkdown.formatMarkdown)([markdown]).string;
var template = document.createElement('template');
template.innerHTML = html;
var fragment = template.content;
@@ -806,7 +774,7 @@ define('ghost-admin/components/gh-ed-preview', ['exports', 'ember', 'ember-compo
var components = this.get('imageUploadComponents');
if (dropzones.length !== components.length) {
- components = (0, _emberArrayUtils.A)([]);
+ components = _ember['default'].A([]);
this.set('imageUploadComponents', components);
}
@@ -814,30 +782,22 @@ define('ghost-admin/components/gh-ed-preview', ['exports', 'ember', 'ember-compo
var el = oldEl.cloneNode(true);
var component = components[i];
var uploadTarget = el.querySelector('.js-upload-target');
- var altTextWrapper = oldEl.querySelector('.js-drop-zone .description strong');
var id = uuid();
var destinationElementId = 'image-uploader-' + id;
- var src = undefined,
- altText = undefined;
+ var src = undefined;
if (uploadTarget) {
src = uploadTarget.getAttribute('src');
}
- if (altTextWrapper) {
- altText = altTextWrapper.innerHTML;
- }
-
if (component) {
component.set('destinationElementId', destinationElementId);
component.set('src', src);
- component.set('altText', altText);
} else {
- var imageUpload = _emberObject['default'].create({
+ var imageUpload = _ember['default'].Object.create({
destinationElementId: destinationElementId,
id: id,
src: src,
- altText: altText,
index: i
});
@@ -865,8 +825,10 @@ define('ghost-admin/components/gh-ed-preview', ['exports', 'ember', 'ember-compo
}
});
});
-define('ghost-admin/components/gh-editor-save-button', ['exports', 'ember-component', 'ember-computed'], function (exports, _emberComponent, _emberComputed) {
- exports['default'] = _emberComponent['default'].extend({
+define('ghost/components/gh-editor-save-button', ['exports', 'ember'], function (exports, _ember) {
+ var Component = _ember['default'].Component;
+ var computed = _ember['default'].computed;
+ exports['default'] = Component.extend({
tagName: 'section',
classNames: ['splitbtn', 'js-publish-splitbutton'],
classNameBindings: ['isNew:unsaved'],
@@ -874,85 +836,28 @@ define('ghost-admin/components/gh-editor-save-button', ['exports', 'ember-compon
isNew: null,
isPublished: null,
willPublish: null,
- willSchedule: null,
- timeScheduled: null,
postOrPage: null,
submitting: false,
- statusFreeze: null,
- scheduledWillPublish: false,
// Tracks whether we're going to change the state of the post on save
- isDangerous: (0, _emberComputed['default'])('isPublished', 'willPublish', 'willSchedule', 'isScheduled', 'scheduledWillPublish', 'statusFreeze', function () {
- if (this.get('scheduledWillPublish')) {
- if (this.get('willPublish') !== this.get('willSchedule')) {
- return false;
- } else {
- return true;
- }
- } else {
- if (this.get('isPublished') !== this.get('willPublish')) {
- return true;
- } else if (this.get('isScheduled') !== this.get('willSchedule')) {
- return true;
- } else if (this.get('statusFreeze')) {
- // always show the save button in red, when we're 2 minutes before the scheduled date
- return true;
- } else {
- return false;
- }
- }
- }),
-
- // Text for non-scheduled Posts
- publishText: (0, _emberComputed['default'])('isPublished', 'postOrPage', 'scheduledWillPublish', function () {
- if (this.get('scheduledWillPublish')) {
- return this.get('willPublish') || this.get('willSchedule') ? 'Update ' + this.get('postOrPage') : 'Publish Now';
- } else {
- return this.get('isPublished') ? 'Update ' + this.get('postOrPage') : 'Publish Now';
- }
- }),
-
- draftText: (0, _emberComputed['default'])('isPublished', 'scheduledWillPublish', function () {
- if (this.get('scheduledWillPublish')) {
- return !this.get('willPublish') || !this.get('willSchedule') ? 'Unpublish' : 'Save Draft';
- } else {
- return this.get('isPublished') ? 'Unpublish' : 'Save Draft';
- }
- }),
-
- savePostText: (0, _emberComputed['default'])('willPublish', 'publishText', 'postOrPage', 'draftText', 'scheduledWillPublish', 'willSchedule', function () {
- // we have to show the menu for a published post when a scheduled post gets published while the user is in the
- // editor and didn't refresh yet. To do so, we use the 'scheduledWillPublish' CP helper
- if (this.get('scheduledWillPublish')) {
- if (this.get('willSchedule') || this.get('willPublish')) {
- return 'Update ' + this.get('postOrPage');
- } else {
- return 'Unpublish';
- }
- } else {
- return this.get('willPublish') ? this.get('publishText') : this.get('draftText');
- }
- }),
-
- // Text for scheduled Posts
- scheduleText: (0, _emberComputed['default'])('isScheduled', 'postOrPage', function () {
- return this.get('isScheduled') ? 'Update ' + this.get('postOrPage') : 'Schedule Post';
+ isDangerous: computed('isPublished', 'willPublish', function () {
+ return this.get('isPublished') !== this.get('willPublish');
}),
- unscheduleText: (0, _emberComputed['default'])('isScheduled', function () {
- return this.get('isScheduled') ? 'Unschedule' : 'Save Draft';
+ publishText: computed('isPublished', 'postOrPage', function () {
+ return this.get('isPublished') ? 'Update ' + this.get('postOrPage') : 'Publish Now';
}),
- saveScheduleText: (0, _emberComputed['default'])('willSchedule', 'scheduleText', 'unscheduleText', function () {
- return this.get('willSchedule') ? this.get('scheduleText') : this.get('unscheduleText');
+ draftText: computed('isPublished', function () {
+ return this.get('isPublished') ? 'Unpublish' : 'Save Draft';
}),
- deleteText: (0, _emberComputed['default'])('postOrPage', function () {
+ deleteText: computed('postOrPage', function () {
return 'Delete ' + this.get('postOrPage');
}),
- activeClass: (0, _emberComputed['default'])('willPublish', 'willSchedule', function () {
- return this.get('willPublish') || this.get('willSchedule') ? true : false;
+ saveText: computed('willPublish', 'publishText', 'draftText', function () {
+ return this.get('willPublish') ? this.get('publishText') : this.get('draftText');
}),
actions: {
@@ -970,8 +875,12 @@ define('ghost-admin/components/gh-editor-save-button', ['exports', 'ember-compon
}
});
});
-define('ghost-admin/components/gh-editor', ['exports', 'ember-component', 'ember-computed', 'ember-runloop', 'ghost-admin/mixins/shortcuts', 'ghost-admin/utils/ed-image-manager', 'ghost-admin/utils/editor-shortcuts', 'ember-invoke-action'], function (exports, _emberComponent, _emberComputed, _emberRunloop, _ghostAdminMixinsShortcuts, _ghostAdminUtilsEdImageManager, _ghostAdminUtilsEditorShortcuts, _emberInvokeAction) {
- exports['default'] = _emberComponent['default'].extend(_ghostAdminMixinsShortcuts['default'], {
+define('ghost/components/gh-editor', ['exports', 'ember', 'ghost/mixins/shortcuts', 'ghost/utils/ed-image-manager', 'ghost/utils/editor-shortcuts', 'ember-invoke-action'], function (exports, _ember, _ghostMixinsShortcuts, _ghostUtilsEdImageManager, _ghostUtilsEditorShortcuts, _emberInvokeAction) {
+ var Component = _ember['default'].Component;
+ var computed = _ember['default'].computed;
+ var run = _ember['default'].run;
+ var equal = computed.equal;
+ exports['default'] = Component.extend(_ghostMixinsShortcuts['default'], {
tagName: 'section',
classNames: ['view-container', 'view-editor'],
@@ -984,16 +893,16 @@ define('ghost-admin/components/gh-editor', ['exports', 'ember-component', 'ember
showCopyHTMLModal: false,
copyHTMLModalContent: null,
- shortcuts: _ghostAdminUtilsEditorShortcuts['default'],
+ shortcuts: _ghostUtilsEditorShortcuts['default'],
- markdownActive: (0, _emberComputed.equal)('activeTab', 'markdown'),
- previewActive: (0, _emberComputed.equal)('activeTab', 'preview'),
+ markdownActive: equal('activeTab', 'markdown'),
+ previewActive: equal('activeTab', 'preview'),
// HTML Preview listens to scrollPosition and updates its scrollTop value
// This property receives scrollInfo from the textEditor, and height from the preview pane, and will update the
// scrollPosition value such that when either scrolling or typing-at-the-end of the text editor the preview pane
// stays in sync
- scrollPosition: (0, _emberComputed['default'])('editorScrollInfo', 'height', function () {
+ scrollPosition: computed('editorScrollInfo', 'height', function () {
var scrollInfo = this.get('editorScrollInfo');
var $previewContent = this.$previewContent;
var $previewViewPort = this.$previewViewPort;
@@ -1015,7 +924,7 @@ define('ghost-admin/components/gh-editor', ['exports', 'ember-component', 'ember
didInsertElement: function didInsertElement() {
this._super.apply(this, arguments);
this.registerShortcuts();
- _emberRunloop['default'].scheduleOnce('afterRender', this, this._cacheElements);
+ run.scheduleOnce('afterRender', this, this._cacheElements);
},
willDestroyElement: function willDestroyElement() {
@@ -1069,7 +978,7 @@ define('ghost-admin/components/gh-editor', ['exports', 'ember-component', 'ember
handleImgUpload: function handleImgUpload(imageIndex, newSrc) {
var editor = this.get('editor');
var editorValue = editor.getValue();
- var replacement = _ghostAdminUtilsEdImageManager['default'].getSrcRange(editorValue, imageIndex);
+ var replacement = _ghostUtilsEdImageManager['default'].getSrcRange(editorValue, imageIndex);
var cursorPosition = undefined;
if (replacement) {
@@ -1088,7 +997,10 @@ define('ghost-admin/components/gh-editor', ['exports', 'ember-component', 'ember
}
});
});
-define('ghost-admin/components/gh-error-message', ['exports', 'ember-component', 'ember-computed', 'ember-utils'], function (exports, _emberComponent, _emberComputed, _emberUtils) {
+define('ghost/components/gh-error-message', ['exports', 'ember'], function (exports, _ember) {
+ var Component = _ember['default'].Component;
+ var computed = _ember['default'].computed;
+ var isEmpty = _ember['default'].isEmpty;
/**
* Renders one random error message when passed a DS.Errors object
@@ -1098,22 +1010,22 @@ define('ghost-admin/components/gh-error-message', ['exports', 'ember-component',
* @param {DS.Errors} errors The DS.Errors object
* @param {string} property The property name
*/
- exports['default'] = _emberComponent['default'].extend({
+ exports['default'] = Component.extend({
tagName: 'p',
classNames: ['response'],
errors: null,
property: '',
- isVisible: (0, _emberComputed.notEmpty)('errors'),
+ isVisible: computed.notEmpty('errors'),
- message: (0, _emberComputed['default'])('errors.[]', 'property', function () {
+ message: computed('errors.[]', 'property', function () {
var property = this.get('property');
var errors = this.get('errors');
var messages = [];
var index = undefined;
- if (!(0, _emberUtils.isEmpty)(errors) && errors.get(property)) {
+ if (!isEmpty(errors) && errors.get(property)) {
errors.get(property).forEach(function (error) {
messages.push(error);
});
@@ -1123,15 +1035,18 @@ define('ghost-admin/components/gh-error-message', ['exports', 'ember-component',
})
});
});
-define('ghost-admin/components/gh-feature-flag', ['exports', 'ember-component', 'ember-computed', 'ember-service/inject'], function (exports, _emberComponent, _emberComputed, _emberServiceInject) {
+define('ghost/components/gh-feature-flag', ['exports', 'ember'], function (exports, _ember) {
+ var computed = _ember['default'].computed;
+ var service = _ember['default'].inject.service;
+ var Component = _ember['default'].Component;
- var FeatureFlagComponent = _emberComponent['default'].extend({
+ var FeatureFlagComponent = Component.extend({
tagName: 'label',
classNames: 'checkbox',
attributeBindings: ['for'],
_flagValue: null,
- feature: (0, _emberServiceInject['default'])(),
+ feature: service(),
init: function init() {
this._super.apply(this, arguments);
@@ -1139,7 +1054,7 @@ define('ghost-admin/components/gh-feature-flag', ['exports', 'ember-component',
this.set('_flagValue', this.get('feature.' + this.get('flag')));
},
- value: (0, _emberComputed['default'])('_flagValue', {
+ value: computed('_flagValue', {
get: function get() {
return this.get('_flagValue');
},
@@ -1148,11 +1063,11 @@ define('ghost-admin/components/gh-feature-flag', ['exports', 'ember-component',
}
}),
- 'for': (0, _emberComputed['default'])('flag', function () {
+ 'for': computed('flag', function () {
return 'labs-' + this.get('flag');
}),
- name: (0, _emberComputed['default'])('flag', function () {
+ name: computed('flag', function () {
return 'labs[' + this.get('flag') + ']';
})
});
@@ -1163,19 +1078,9 @@ define('ghost-admin/components/gh-feature-flag', ['exports', 'ember-component',
exports['default'] = FeatureFlagComponent;
});
-define('ghost-admin/components/gh-file-input', ['exports', 'ember', 'emberx-file-input/components/x-file-input'], function (exports, _ember, _emberxFileInputComponentsXFileInput) {
-
- // ember-cli-shims doesn't export Ember.testing
- var testing = _ember['default'].testing;
- exports['default'] = _emberxFileInputComponentsXFileInput['default'].extend({
- change: function change(e) {
- var files = testing ? (e.originalEvent || e).testingFiles : e.target.files;
- this.sendAction('action', files);
- }
- });
-});
-define('ghost-admin/components/gh-file-upload', ['exports', 'ember-component'], function (exports, _emberComponent) {
- exports['default'] = _emberComponent['default'].extend({
+define('ghost/components/gh-file-upload', ['exports', 'ember'], function (exports, _ember) {
+ var Component = _ember['default'].Component;
+ exports['default'] = Component.extend({
_file: null,
uploadButtonText: 'Text',
@@ -1209,8 +1114,15 @@ define('ghost-admin/components/gh-file-upload', ['exports', 'ember-component'],
}
});
});
-define('ghost-admin/components/gh-file-uploader', ['exports', 'ember-component', 'ember-string', 'ember-service/inject', 'ember-computed', 'ember-utils', 'ember-runloop', 'ember-invoke-action', 'ghost-admin/services/ajax'], function (exports, _emberComponent, _emberString, _emberServiceInject, _emberComputed, _emberUtils, _emberRunloop, _emberInvokeAction, _ghostAdminServicesAjax) {
- exports['default'] = _emberComponent['default'].extend({
+define('ghost/components/gh-file-uploader', ['exports', 'ember', 'ember-invoke-action', 'ghost/services/ajax'], function (exports, _ember, _emberInvokeAction, _ghostServicesAjax) {
+ function _instanceof(left, right) { if (right != null && right[Symbol.hasInstance]) { return right[Symbol.hasInstance](left); } else { return left instanceof right; } }
+
+ var Component = _ember['default'].Component;
+ var computed = _ember['default'].computed;
+ var service = _ember['default'].inject.service;
+ var isBlank = _ember['default'].isBlank;
+ var run = _ember['default'].run;
+ exports['default'] = Component.extend({
tagName: 'section',
classNames: ['gh-image-uploader'],
classNameBindings: ['dragClass'],
@@ -1226,10 +1138,9 @@ define('ghost-admin/components/gh-file-uploader', ['exports', 'ember-component',
failureMessage: null,
uploadPercentage: 0,
- ajax: (0, _emberServiceInject['default'])(),
- notifications: (0, _emberServiceInject['default'])(),
+ ajax: service(),
- formData: (0, _emberComputed['default'])('file', function () {
+ formData: computed('file', function () {
var paramName = this.get('paramName');
var file = this.get('file');
var formData = new FormData();
@@ -1239,7 +1150,7 @@ define('ghost-admin/components/gh-file-uploader', ['exports', 'ember-component',
return formData;
}),
- progressStyle: (0, _emberComputed['default'])('uploadPercentage', function () {
+ progressStyle: computed('uploadPercentage', function () {
var percentage = this.get('uploadPercentage');
var width = '';
@@ -1249,7 +1160,7 @@ define('ghost-admin/components/gh-file-uploader', ['exports', 'ember-component',
width = '0';
}
- return (0, _emberString.htmlSafe)('width: ' + width);
+ return _ember['default'].String.htmlSafe('width: ' + width);
}),
dragOver: function dragOver(event) {
@@ -1317,7 +1228,7 @@ define('ghost-admin/components/gh-file-uploader', ['exports', 'ember-component',
var _this2 = this;
if (event.lengthComputable) {
- (0, _emberRunloop['default'])(function () {
+ run(function () {
var percentage = Math.round(event.loaded / event.total * 100);
_this2.set('uploadPercentage', percentage);
});
@@ -1332,15 +1243,11 @@ define('ghost-admin/components/gh-file-uploader', ['exports', 'ember-component',
_uploadFailed: function _uploadFailed(error) {
var message = undefined;
- if ((0, _ghostAdminServicesAjax.isVersionMismatchError)(error)) {
- this.get('notifications').showAPIError(error);
- }
-
- if ((0, _ghostAdminServicesAjax.isUnsupportedMediaTypeError)(error)) {
+ if (_instanceof(error, _ghostServicesAjax.UnsupportedMediaTypeError)) {
message = 'The file type you uploaded is not supported.';
- } else if ((0, _ghostAdminServicesAjax.isRequestEntityTooLargeError)(error)) {
+ } else if (_instanceof(error, _ghostServicesAjax.RequestEntityTooLargeError)) {
message = 'The file you uploaded was larger than the maximum file size your server allows.';
- } else if (error.errors && !(0, _emberUtils.isBlank)(error.errors[0].message)) {
+ } else if (error.errors && !isBlank(error.errors[0].message)) {
message = error.errors[0].message;
} else {
message = 'Something went wrong :(';
@@ -1353,7 +1260,7 @@ define('ghost-admin/components/gh-file-uploader', ['exports', 'ember-component',
actions: {
fileSelected: function fileSelected(fileList) {
this.set('file', fileList[0]);
- _emberRunloop['default'].schedule('actions', this, function () {
+ run.schedule('actions', this, function () {
this.generateRequest();
});
},
@@ -1366,13 +1273,19 @@ define('ghost-admin/components/gh-file-uploader', ['exports', 'ember-component',
}
});
});
-define('ghost-admin/components/gh-form-group', ['exports', 'ghost-admin/components/gh-validation-status-container'], function (exports, _ghostAdminComponentsGhValidationStatusContainer) {
- exports['default'] = _ghostAdminComponentsGhValidationStatusContainer['default'].extend({
+define('ghost/components/gh-form-group', ['exports', 'ghost/components/gh-validation-status-container'], function (exports, _ghostComponentsGhValidationStatusContainer) {
+ exports['default'] = _ghostComponentsGhValidationStatusContainer['default'].extend({
classNames: 'form-group'
});
});
-define('ghost-admin/components/gh-fullscreen-modal', ['exports', 'rsvp', 'ember-service/inject', 'ember-array/utils', 'ember-utils', 'ember-evented/on', 'ember-runloop', 'liquid-tether/components/liquid-tether', 'ember-invoke-action'], function (exports, _rsvp, _emberServiceInject, _emberArrayUtils, _emberUtils, _emberEventedOn, _emberRunloop, _liquidTetherComponentsLiquidTether, _emberInvokeAction) {
- var Promise = _rsvp['default'].Promise;
+define('ghost/components/gh-fullscreen-modal', ['exports', 'ember', 'liquid-tether/components/liquid-tether', 'ember-invoke-action'], function (exports, _ember, _liquidTetherComponentsLiquidTether, _emberInvokeAction) {
+ var Promise = _ember['default'].RSVP.Promise;
+ var service = _ember['default'].inject.service;
+ var isBlank = _ember['default'].isBlank;
+ var on = _ember['default'].on;
+ var run = _ember['default'].run;
+
+ var emberA = _ember['default'].A;
var FullScreenModalComponent = _liquidTetherComponentsLiquidTether['default'].extend({
to: 'fullscreen-modal',
@@ -1384,20 +1297,20 @@ define('ghost-admin/components/gh-fullscreen-modal', ['exports', 'rsvp', 'ember-
overlayClass: 'fullscreen-modal-background',
modalPath: 'unknown',
- dropdown: (0, _emberServiceInject['default'])(),
+ dropdown: service(),
init: function init() {
this._super.apply(this, arguments);
this.modalPath = 'modals/' + this.get('modal');
},
- setTetherClass: (0, _emberEventedOn['default'])('init', function () {
+ setTetherClass: on('init', function () {
var tetherClass = this.get('tetherClass');
var modifiers = (this.get('modifier') || '').split(' ');
- var tetherClasses = (0, _emberArrayUtils.A)([tetherClass]);
+ var tetherClasses = emberA([tetherClass]);
modifiers.forEach(function (modifier) {
- if (!(0, _emberUtils.isBlank)(modifier)) {
+ if (!isBlank(modifier)) {
var className = tetherClass + '-' + modifier;
tetherClasses.push(className);
}
@@ -1406,8 +1319,8 @@ define('ghost-admin/components/gh-fullscreen-modal', ['exports', 'rsvp', 'ember-
this.set('tetherClass', tetherClasses.join(' '));
}),
- closeDropdowns: (0, _emberEventedOn['default'])('didInsertElement', function () {
- _emberRunloop['default'].schedule('afterRender', this, function () {
+ closeDropdowns: on('didInsertElement', function () {
+ run.schedule('afterRender', this, function () {
this.get('dropdown').closeDropdowns();
});
}),
@@ -1447,8 +1360,9 @@ define('ghost-admin/components/gh-fullscreen-modal', ['exports', 'rsvp', 'ember-
exports['default'] = FullScreenModalComponent;
});
-define('ghost-admin/components/gh-image-uploader-with-preview', ['exports', 'ember-component'], function (exports, _emberComponent) {
- exports['default'] = _emberComponent['default'].extend({
+define('ghost/components/gh-image-uploader-with-preview', ['exports', 'ember'], function (exports, _ember) {
+ var Component = _ember['default'].Component;
+ exports['default'] = Component.extend({
actions: {
update: function update() {
if (typeof this.attrs.update === 'function') {
@@ -1492,15 +1406,21 @@ define('ghost-admin/components/gh-image-uploader-with-preview', ['exports', 'emb
}
});
});
-define('ghost-admin/components/gh-image-uploader', ['exports', 'ember-component', 'ember-computed', 'ember-service/inject', 'ember-string', 'ember-utils', 'ember-runloop', 'ember-invoke-action', 'ghost-admin/utils/ghost-paths', 'ghost-admin/services/ajax'], function (exports, _emberComponent, _emberComputed, _emberServiceInject, _emberString, _emberUtils, _emberRunloop, _emberInvokeAction, _ghostAdminUtilsGhostPaths, _ghostAdminServicesAjax) {
- exports['default'] = _emberComponent['default'].extend({
+define('ghost/components/gh-image-uploader', ['exports', 'ember', 'ghost/utils/ghost-paths', 'ghost/services/ajax'], function (exports, _ember, _ghostUtilsGhostPaths, _ghostServicesAjax) {
+ function _instanceof(left, right) { if (right != null && right[Symbol.hasInstance]) { return right[Symbol.hasInstance](left); } else { return left instanceof right; } }
+
+ var Component = _ember['default'].Component;
+ var computed = _ember['default'].computed;
+ var service = _ember['default'].inject.service;
+ var isBlank = _ember['default'].isBlank;
+ var run = _ember['default'].run;
+ exports['default'] = Component.extend({
tagName: 'section',
classNames: ['gh-image-uploader'],
classNameBindings: ['dragClass'],
image: null,
- text: '',
- altText: '',
+ text: 'Upload an image',
saveButton: true,
dragClass: null,
@@ -1510,13 +1430,12 @@ define('ghost-admin/components/gh-image-uploader', ['exports', 'ember-component'
url: null,
uploadPercentage: 0,
- ajax: (0, _emberServiceInject['default'])(),
- config: (0, _emberServiceInject['default'])(),
- notifications: (0, _emberServiceInject['default'])(),
+ ajax: service(),
+ config: service(),
// TODO: this wouldn't be necessary if the server could accept direct
// file uploads
- formData: (0, _emberComputed['default'])('file', function () {
+ formData: computed('file', function () {
var file = this.get('file');
var formData = new FormData();
@@ -1525,13 +1444,7 @@ define('ghost-admin/components/gh-image-uploader', ['exports', 'ember-component'
return formData;
}),
- description: (0, _emberComputed['default'])('text', 'altText', function () {
- var altText = this.get('altText');
-
- return this.get('text') || (altText ? 'Upload image of "' + altText + '"' : 'Upload an image');
- }),
-
- progressStyle: (0, _emberComputed['default'])('uploadPercentage', function () {
+ progressStyle: computed('uploadPercentage', function () {
var percentage = this.get('uploadPercentage');
var width = '';
@@ -1541,14 +1454,14 @@ define('ghost-admin/components/gh-image-uploader', ['exports', 'ember-component'
width = '0';
}
- return (0, _emberString.htmlSafe)('width: ' + width);
+ return _ember['default'].String.htmlSafe('width: ' + width);
}),
- canShowUploadForm: (0, _emberComputed['default'])('config.fileStorage', function () {
+ canShowUploadForm: computed('config.fileStorage', function () {
return this.get('config.fileStorage') !== false;
}),
- showUploadForm: (0, _emberComputed['default'])('formType', function () {
+ showUploadForm: computed('formType', function () {
var canShowUploadForm = this.get('canShowUploadForm');
var formType = this.get('formType');
@@ -1604,51 +1517,49 @@ define('ghost-admin/components/gh-image-uploader', ['exports', 'ember-component'
}
},
- _uploadStarted: function _uploadStarted() {
- (0, _emberInvokeAction.invokeAction)(this, 'uploadStarted');
+ uploadStarted: function uploadStarted() {
+ if (typeof this.attrs.uploadStarted === 'function') {
+ this.attrs.uploadStarted();
+ }
},
- _uploadProgress: function _uploadProgress(event) {
+ uploadProgress: function uploadProgress(event) {
var _this = this;
if (event.lengthComputable) {
- (0, _emberRunloop['default'])(function () {
+ run(function () {
var percentage = Math.round(event.loaded / event.total * 100);
_this.set('uploadPercentage', percentage);
});
}
},
- _uploadFinished: function _uploadFinished() {
- (0, _emberInvokeAction.invokeAction)(this, 'uploadFinished');
+ uploadFinished: function uploadFinished() {
+ if (typeof this.attrs.uploadFinished === 'function') {
+ this.attrs.uploadFinished();
+ }
},
- _uploadSuccess: function _uploadSuccess(response) {
+ uploadSuccess: function uploadSuccess(response) {
this.set('url', response);
this.send('saveUrl');
this.send('reset');
- (0, _emberInvokeAction.invokeAction)(this, 'uploadSuccess', response);
},
- _uploadFailed: function _uploadFailed(error) {
+ uploadFailed: function uploadFailed(error) {
var message = undefined;
- if ((0, _ghostAdminServicesAjax.isVersionMismatchError)(error)) {
- this.get('notifications').showAPIError(error);
- }
-
- if ((0, _ghostAdminServicesAjax.isUnsupportedMediaTypeError)(error)) {
+ if (_instanceof(error, _ghostServicesAjax.UnsupportedMediaTypeError)) {
message = 'The image type you uploaded is not supported. Please use .PNG, .JPG, .GIF, .SVG.';
- } else if ((0, _ghostAdminServicesAjax.isRequestEntityTooLargeError)(error)) {
+ } else if (_instanceof(error, _ghostServicesAjax.RequestEntityTooLargeError)) {
message = 'The image you uploaded was larger than the maximum file size your server allows.';
- } else if (error.errors && !(0, _emberUtils.isBlank)(error.errors[0].message)) {
+ } else if (error.errors && !isBlank(error.errors[0].message)) {
message = error.errors[0].message;
} else {
message = 'Something went wrong :(';
}
this.set('failureMessage', message);
- (0, _emberInvokeAction.invokeAction)(this, 'uploadFailed', error);
},
generateRequest: function generateRequest() {
@@ -1656,9 +1567,9 @@ define('ghost-admin/components/gh-image-uploader', ['exports', 'ember-component'
var ajax = this.get('ajax');
var formData = this.get('formData');
- var url = (0, _ghostAdminUtilsGhostPaths['default'])().apiRoot + '/uploads/';
+ var url = (0, _ghostUtilsGhostPaths['default'])().apiRoot + '/uploads/';
- this._uploadStarted();
+ this.uploadStarted();
ajax.post(url, {
data: formData,
@@ -1669,32 +1580,35 @@ define('ghost-admin/components/gh-image-uploader', ['exports', 'ember-component'
var xhr = new window.XMLHttpRequest();
xhr.upload.addEventListener('progress', function (event) {
- _this2._uploadProgress(event);
+ _this2.uploadProgress(event);
}, false);
return xhr;
}
}).then(function (response) {
var url = JSON.parse(response);
- _this2._uploadSuccess(url);
+ _this2.uploadSuccess(url);
})['catch'](function (error) {
- _this2._uploadFailed(error);
+ _this2.uploadFailed(error);
})['finally'](function () {
- _this2._uploadFinished();
+ _this2.uploadFinished();
});
},
actions: {
fileSelected: function fileSelected(fileList) {
this.set('file', fileList[0]);
- _emberRunloop['default'].schedule('actions', this, function () {
+ run.schedule('actions', this, function () {
this.generateRequest();
});
},
onInput: function onInput(url) {
this.set('url', url);
- (0, _emberInvokeAction.invokeAction)(this, 'onInput', url);
+
+ if (typeof this.attrs.onInput === 'function') {
+ this.attrs.onInput(url);
+ }
},
reset: function reset() {
@@ -1705,20 +1619,23 @@ define('ghost-admin/components/gh-image-uploader', ['exports', 'ember-component'
switchForm: function switchForm(formType) {
this.set('formType', formType);
- _emberRunloop['default'].scheduleOnce('afterRender', this, function () {
- (0, _emberInvokeAction.invokeAction)(this, 'formChanged', formType);
- });
+ if (typeof this.attrs.formChanged === 'function') {
+ run.scheduleOnce('afterRender', this, function () {
+ this.attrs.formChanged(formType);
+ });
+ }
},
saveUrl: function saveUrl() {
var url = this.get('url');
- (0, _emberInvokeAction.invokeAction)(this, 'update', url);
+ this.attrs.update(url);
}
}
});
});
-define('ghost-admin/components/gh-infinite-scroll', ['exports', 'ember-component', 'ghost-admin/mixins/infinite-scroll'], function (exports, _emberComponent, _ghostAdminMixinsInfiniteScroll) {
- exports['default'] = _emberComponent['default'].extend(_ghostAdminMixinsInfiniteScroll['default'], {
+define('ghost/components/gh-infinite-scroll', ['exports', 'ember', 'ghost/mixins/infinite-scroll'], function (exports, _ember, _ghostMixinsInfiniteScroll) {
+ var Component = _ember['default'].Component;
+ exports['default'] = Component.extend(_ghostMixinsInfiniteScroll['default'], {
actions: {
checkScroll: function checkScroll() {
this._checkScroll();
@@ -1726,12 +1643,15 @@ define('ghost-admin/components/gh-infinite-scroll', ['exports', 'ember-component
}
});
});
-define('ghost-admin/components/gh-input', ['exports', 'ember-one-way-controls/components/one-way-input', 'ghost-admin/mixins/text-input'], function (exports, _emberOneWayControlsComponentsOneWayInput, _ghostAdminMixinsTextInput) {
- exports['default'] = _emberOneWayControlsComponentsOneWayInput['default'].extend(_ghostAdminMixinsTextInput['default'], {
+define('ghost/components/gh-input', ['exports', 'ember', 'ghost/mixins/text-input'], function (exports, _ember, _ghostMixinsTextInput) {
+ var TextField = _ember['default'].TextField;
+ exports['default'] = TextField.extend(_ghostMixinsTextInput['default'], {
classNames: 'gh-input'
});
});
-define('ghost-admin/components/gh-light-table', ['exports', 'jquery', 'ember-runloop', 'ember-light-table/components/light-table'], function (exports, _jquery, _emberRunloop, _emberLightTableComponentsLightTable) {
+define('ghost/components/gh-light-table', ['exports', 'ember', 'ember-light-table/components/light-table'], function (exports, _ember, _emberLightTableComponentsLightTable) {
+ var $ = _ember['default'].$;
+ var run = _ember['default'].run;
exports['default'] = _emberLightTableComponentsLightTable['default'].extend({
// HACK: infinite pagination was not triggering when scrolling very fast
@@ -1744,19 +1664,20 @@ define('ghost-admin/components/gh-light-table', ['exports', 'jquery', 'ember-run
// https://github.com/offirgolan/ember-light-table/issues/15
_setupScrollEvents: function _setupScrollEvents() {
- (0, _jquery['default'])(this.get('touchMoveContainer')).on('touchmove.light-table', _emberRunloop['default'].bind(this, this._scrollHandler, '_touchmoveTimer'));
- (0, _jquery['default'])(this.get('scrollContainer')).on('scroll.light-table', _emberRunloop['default'].bind(this, this._scrollHandler, '_scrollTimer'));
- (0, _jquery['default'])(this.get('scrollContainer')).on('scroll.light-table', _emberRunloop['default'].bind(this, this._scrollHandler, '_scrollDebounce'));
+ $(this.get('touchMoveContainer')).on('touchmove.light-table', run.bind(this, this._scrollHandler, '_touchmoveTimer'));
+ $(this.get('scrollContainer')).on('scroll.light-table', run.bind(this, this._scrollHandler, '_scrollTimer'));
+ $(this.get('scrollContainer')).on('scroll.light-table', run.bind(this, this._scrollHandler, '_scrollDebounce'));
},
_scrollHandler: function _scrollHandler(timer) {
- this.set(timer, _emberRunloop['default'].debounce(this, this._onScroll, 100));
- this.set(timer, _emberRunloop['default'].throttle(this, this._onScroll, 100));
+ this.set(timer, run.debounce(this, this._onScroll, 100));
+ this.set(timer, run.throttle(this, this._onScroll, 100));
}
});
});
-define('ghost-admin/components/gh-main', ['exports', 'ember-component'], function (exports, _emberComponent) {
- exports['default'] = _emberComponent['default'].extend({
+define('ghost/components/gh-main', ['exports', 'ember'], function (exports, _ember) {
+ var Component = _ember['default'].Component;
+ exports['default'] = Component.extend({
tagName: 'main',
classNames: ['gh-main'],
ariaRole: 'main',
@@ -1766,7 +1687,10 @@ define('ghost-admin/components/gh-main', ['exports', 'ember-component'], functio
}
});
});
-define('ghost-admin/components/gh-menu-toggle', ['exports', 'ember-component', 'ember-computed', 'ember-service/inject'], function (exports, _emberComponent, _emberComputed, _emberServiceInject) {
+define('ghost/components/gh-menu-toggle', ['exports', 'ember'], function (exports, _ember) {
+ var Component = _ember['default'].Component;
+ var computed = _ember['default'].computed;
+ var service = _ember['default'].inject.service;
/*
This cute little component has two jobs.
@@ -1778,14 +1702,14 @@ define('ghost-admin/components/gh-menu-toggle', ['exports', 'ember-component', '
On mobile, it renders a closing icon, and clicking it
closes the mobile menu
*/
- exports['default'] = _emberComponent['default'].extend({
+ exports['default'] = Component.extend({
classNames: ['gh-menu-toggle'],
- mediaQueries: (0, _emberServiceInject['default'])(),
- isMobile: (0, _emberComputed.reads)('mediaQueries.isMobile'),
+ mediaQueries: service(),
+ isMobile: computed.reads('mediaQueries.isMobile'),
maximise: false,
- iconClass: (0, _emberComputed['default'])('maximise', 'isMobile', function () {
+ iconClass: computed('maximise', 'isMobile', function () {
if (this.get('maximise') && !this.get('isMobile')) {
return 'icon-maximise';
} else {
@@ -1803,24 +1727,27 @@ define('ghost-admin/components/gh-menu-toggle', ['exports', 'ember-component', '
}
});
});
-define('ghost-admin/components/gh-nav-menu', ['exports', 'ember-component', 'ember-string', 'ember-service/inject', 'ember-computed'], function (exports, _emberComponent, _emberString, _emberServiceInject, _emberComputed) {
- exports['default'] = _emberComponent['default'].extend({
+define('ghost/components/gh-nav-menu', ['exports', 'ember'], function (exports, _ember) {
+ var Component = _ember['default'].Component;
+ var service = _ember['default'].inject.service;
+ var computed = _ember['default'].computed;
+ exports['default'] = Component.extend({
tagName: 'nav',
classNames: ['gh-nav'],
classNameBindings: ['open'],
open: false,
- navMenuIcon: (0, _emberComputed['default'])('ghostPaths.subdir', function () {
+ navMenuIcon: computed('ghostPaths.subdir', function () {
var url = this.get('ghostPaths.subdir') + '/ghost/img/ghosticon.jpg';
- return (0, _emberString.htmlSafe)('background-image: url(' + url + ')');
+ return _ember['default'].String.htmlSafe('background-image: url(' + url + ')');
}),
- config: (0, _emberServiceInject['default'])(),
- session: (0, _emberServiceInject['default'])(),
- ghostPaths: (0, _emberServiceInject['default'])(),
- feature: (0, _emberServiceInject['default'])(),
+ config: service(),
+ session: service(),
+ ghostPaths: service(),
+ feature: service(),
mouseEnter: function mouseEnter() {
this.sendAction('onMouseEnter');
@@ -1845,8 +1772,10 @@ define('ghost-admin/components/gh-nav-menu', ['exports', 'ember-component', 'emb
}
});
});
-define('ghost-admin/components/gh-navigation', ['exports', 'ember-component', 'ember-runloop'], function (exports, _emberComponent, _emberRunloop) {
- exports['default'] = _emberComponent['default'].extend({
+define('ghost/components/gh-navigation', ['exports', 'ember'], function (exports, _ember) {
+ var Component = _ember['default'].Component;
+ var run = _ember['default'].run;
+ exports['default'] = Component.extend({
tagName: 'section',
classNames: 'gh-view',
@@ -1863,13 +1792,13 @@ define('ghost-admin/components/gh-navigation', ['exports', 'ember-component', 'e
items: navElements,
start: function start(event, ui) {
- (0, _emberRunloop['default'])(function () {
+ run(function () {
ui.item.data('start-index', ui.item.index());
});
},
update: function update(event, ui) {
- (0, _emberRunloop['default'])(function () {
+ run(function () {
_this.sendAction('moveItem', ui.item.data('start-index'), ui.item.index());
});
}
@@ -1882,7 +1811,10 @@ define('ghost-admin/components/gh-navigation', ['exports', 'ember-component', 'e
}
});
});
-define('ghost-admin/components/gh-navitem-url-input', ['exports', 'ember-components/text-field', 'ember-computed', 'ember-runloop', 'ember-invoke-action'], function (exports, _emberComponentsTextField, _emberComputed, _emberRunloop, _emberInvokeAction) {
+define('ghost/components/gh-navitem-url-input', ['exports', 'ember', 'ember-invoke-action'], function (exports, _ember, _emberInvokeAction) {
+ var TextField = _ember['default'].TextField;
+ var computed = _ember['default'].computed;
+ var run = _ember['default'].run;
var joinUrlParts = function joinUrlParts(url, path) {
if (path[0] !== '/' && url.slice(-1) !== '/') {
@@ -1900,10 +1832,10 @@ define('ghost-admin/components/gh-navitem-url-input', ['exports', 'ember-compone
return !url.match(/\s/) && !validator.isURL(url) && !url.match(/^(\/\/|#|[a-zA-Z0-9\-]+:)/);
};
- exports['default'] = _emberComponentsTextField['default'].extend(_emberInvokeAction.InvokeActionMixin, {
+ exports['default'] = TextField.extend({
classNames: 'gh-input',
- isBaseUrl: (0, _emberComputed['default'])('baseUrl', 'value', function () {
+ isBaseUrl: computed('baseUrl', 'value', function () {
return this.get('baseUrl') === this.get('value');
}),
@@ -1926,7 +1858,7 @@ define('ghost-admin/components/gh-navitem-url-input', ['exports', 'ember-compone
if (this.get('isBaseUrl')) {
// position the cursor at the end of the input
- _emberRunloop['default'].next(function (el) {
+ run.next(function (el) {
var length = el.value.length;
el.setSelectionRange(length, length);
@@ -1949,7 +1881,7 @@ define('ghost-admin/components/gh-navitem-url-input', ['exports', 'ember-compone
},
keyPress: function keyPress(event) {
- this.invokeAction('clearErrors');
+ (0, _emberInvokeAction.invokeAction)(this, 'clearErrors');
// enter key
if (event.keyCode === 13) {
@@ -2025,18 +1957,23 @@ define('ghost-admin/components/gh-navitem-url-input', ['exports', 'ember-compone
}
});
});
-define('ghost-admin/components/gh-navitem', ['exports', 'ember-component', 'ember-computed', 'ember-runloop', 'ghost-admin/mixins/validation-state', 'ember-sortable/mixins/sortable-item'], function (exports, _emberComponent, _emberComputed, _emberRunloop, _ghostAdminMixinsValidationState, _emberSortableMixinsSortableItem) {
- exports['default'] = _emberComponent['default'].extend(_ghostAdminMixinsValidationState['default'], _emberSortableMixinsSortableItem['default'], {
+define('ghost/components/gh-navitem', ['exports', 'ember', 'ghost/mixins/validation-state', 'ember-sortable/mixins/sortable-item'], function (exports, _ember, _ghostMixinsValidationState, _emberSortableMixinsSortableItem) {
+ var Component = _ember['default'].Component;
+ var computed = _ember['default'].computed;
+ var run = _ember['default'].run;
+ var alias = computed.alias;
+ var readOnly = computed.readOnly;
+ exports['default'] = Component.extend(_ghostMixinsValidationState['default'], _emberSortableMixinsSortableItem['default'], {
classNames: 'gh-blognav-item',
classNameBindings: ['errorClass', 'navItem.isNew::gh-blognav-item--sortable'],
'new': false,
handle: '.gh-blognav-grab',
- model: (0, _emberComputed.alias)('navItem'),
- errors: (0, _emberComputed.readOnly)('navItem.errors'),
+ model: alias('navItem'),
+ errors: readOnly('navItem.errors'),
- errorClass: (0, _emberComputed['default'])('hasError', function () {
+ errorClass: computed('hasError', function () {
if (this.get('hasError')) {
return 'gh-blognav-item--error';
}
@@ -2046,7 +1983,7 @@ define('ghost-admin/components/gh-navitem', ['exports', 'ember-component', 'embe
// enter key
if (event.keyCode === 13 && this.get('navItem.isNew')) {
event.preventDefault();
- _emberRunloop['default'].scheduleOnce('actions', this, function () {
+ run.scheduleOnce('actions', this, function () {
this.send('addItem');
});
}
@@ -2075,17 +2012,20 @@ define('ghost-admin/components/gh-navitem', ['exports', 'ember-component', 'embe
}
});
});
-define('ghost-admin/components/gh-notification', ['exports', 'ember-component', 'ember-service/inject', 'ember-computed'], function (exports, _emberComponent, _emberServiceInject, _emberComputed) {
- exports['default'] = _emberComponent['default'].extend({
+define('ghost/components/gh-notification', ['exports', 'ember'], function (exports, _ember) {
+ var Component = _ember['default'].Component;
+ var computed = _ember['default'].computed;
+ var service = _ember['default'].inject.service;
+ exports['default'] = Component.extend({
tagName: 'article',
classNames: ['gh-notification', 'gh-notification-passive'],
classNameBindings: ['typeClass'],
message: null,
- notifications: (0, _emberServiceInject['default'])(),
+ notifications: service(),
- typeClass: (0, _emberComputed['default'])('message.type', function () {
+ typeClass: computed('message.type', function () {
var type = this.get('message.type');
var classes = '';
var typeMapping = undefined;
@@ -2127,24 +2067,29 @@ define('ghost-admin/components/gh-notification', ['exports', 'ember-component',
}
});
});
-define('ghost-admin/components/gh-notifications', ['exports', 'ember-component', 'ember-computed', 'ember-service/inject'], function (exports, _emberComponent, _emberComputed, _emberServiceInject) {
- exports['default'] = _emberComponent['default'].extend({
+define('ghost/components/gh-notifications', ['exports', 'ember'], function (exports, _ember) {
+ var Component = _ember['default'].Component;
+ var computed = _ember['default'].computed;
+ var service = _ember['default'].inject.service;
+ var alias = computed.alias;
+ exports['default'] = Component.extend({
tagName: 'aside',
classNames: 'gh-notifications',
- notifications: (0, _emberServiceInject['default'])(),
+ notifications: service(),
- messages: (0, _emberComputed.alias)('notifications.notifications')
+ messages: alias('notifications.notifications')
});
});
-define('ghost-admin/components/gh-popover-button', ['exports', 'ember-service/inject', 'ghost-admin/components/gh-dropdown-button'], function (exports, _emberServiceInject, _ghostAdminComponentsGhDropdownButton) {
+define('ghost/components/gh-popover-button', ['exports', 'ember', 'ghost/components/gh-dropdown-button'], function (exports, _ember, _ghostComponentsGhDropdownButton) {
+ var service = _ember['default'].inject.service;
function K() {
return this;
}
- exports['default'] = _ghostAdminComponentsGhDropdownButton['default'].extend({
- dropdown: (0, _emberServiceInject['default'])(),
+ exports['default'] = _ghostComponentsGhDropdownButton['default'].extend({
+ dropdown: service(),
click: K,
@@ -2159,51 +2104,43 @@ define('ghost-admin/components/gh-popover-button', ['exports', 'ember-service/in
}
});
});
-define('ghost-admin/components/gh-popover', ['exports', 'ember-service/inject', 'ghost-admin/components/gh-dropdown'], function (exports, _emberServiceInject, _ghostAdminComponentsGhDropdown) {
- exports['default'] = _ghostAdminComponentsGhDropdown['default'].extend({
+define('ghost/components/gh-popover', ['exports', 'ember', 'ghost/components/gh-dropdown'], function (exports, _ember, _ghostComponentsGhDropdown) {
+ var service = _ember['default'].inject.service;
+ exports['default'] = _ghostComponentsGhDropdown['default'].extend({
classNames: 'ghost-popover',
- dropdown: (0, _emberServiceInject['default'])()
+ dropdown: service()
});
});
-define('ghost-admin/components/gh-posts-list-item', ['exports', 'jquery', 'ember', 'ember-component', 'ember-string', 'ember-computed', 'ember-service/inject', 'ghost-admin/mixins/active-link-wrapper', 'ember-invoke-action'], function (exports, _jquery, _ember, _emberComponent, _emberString, _emberComputed, _emberServiceInject, _ghostAdminMixinsActiveLinkWrapper, _emberInvokeAction) {
-
- // ember-cli-shims doesn't export these
- var ObjectProxy = _ember['default'].ObjectProxy;
- var PromiseProxyMixin = _ember['default'].PromiseProxyMixin;
-
- var ObjectPromiseProxy = ObjectProxy.extend(PromiseProxyMixin);
-
- exports['default'] = _emberComponent['default'].extend(_ghostAdminMixinsActiveLinkWrapper['default'], {
+define('ghost/components/gh-posts-list-item', ['exports', 'ember', 'ghost/mixins/active-link-wrapper', 'ember-invoke-action'], function (exports, _ember, _ghostMixinsActiveLinkWrapper, _emberInvokeAction) {
+ var $ = _ember['default'].$;
+ var Component = _ember['default'].Component;
+ var computed = _ember['default'].computed;
+ var service = _ember['default'].inject.service;
+ var alias = computed.alias;
+ var equal = computed.equal;
+ exports['default'] = Component.extend(_ghostMixinsActiveLinkWrapper['default'], {
tagName: 'li',
classNameBindings: ['isFeatured:featured', 'isPage:page'],
post: null,
previewIsHidden: false,
- isFeatured: (0, _emberComputed.alias)('post.featured'),
- isPage: (0, _emberComputed.alias)('post.page'),
- isPublished: (0, _emberComputed.equal)('post.status', 'published'),
- isScheduled: (0, _emberComputed.equal)('post.status', 'scheduled'),
+ isFeatured: alias('post.featured'),
+ isPage: alias('post.page'),
+ isPublished: equal('post.status', 'published'),
- ghostPaths: (0, _emberServiceInject['default'])(),
- timeZone: (0, _emberServiceInject['default'])(),
+ ghostPaths: service(),
- authorName: (0, _emberComputed['default'])('post.author.name', 'post.author.email', function () {
+ authorName: computed('post.author.name', 'post.author.email', function () {
return this.get('post.author.name') || this.get('post.author.email');
}),
- authorAvatar: (0, _emberComputed['default'])('post.author.image', function () {
+ authorAvatar: computed('post.author.image', function () {
return this.get('post.author.image') || this.get('ghostPaths.subdir') + '/ghost/img/user-image.png';
}),
- authorAvatarBackground: (0, _emberComputed['default'])('authorAvatar', function () {
- return (0, _emberString.htmlSafe)('background-image: url(' + this.get('authorAvatar') + ')');
- }),
-
- blogTimezone: (0, _emberComputed['default'])('timeZone.blogTimezone', function () {
- return ObjectPromiseProxy.create({
- promise: this.get('timeZone.blogTimezone')
- });
+ authorAvatarBackground: computed('authorAvatar', function () {
+ return _ember['default'].String.htmlSafe('background-image: url(' + this.get('authorAvatar') + ')');
}),
click: function click() {
@@ -2235,7 +2172,7 @@ define('ghost-admin/components/gh-posts-list-item', ['exports', 'jquery', 'ember
var element = this.$();
var offset = element.offset().top;
var elementHeight = element.height();
- var container = (0, _jquery['default'])('.js-content-scrollbox');
+ var container = $('.js-content-scrollbox');
var containerHeight = container.height();
var currentScroll = container.scrollTop();
var isBelowTop = undefined,
@@ -2257,7 +2194,15 @@ define('ghost-admin/components/gh-posts-list-item', ['exports', 'jquery', 'ember
}
});
});
-define('ghost-admin/components/gh-profile-image', ['exports', 'ember-component', 'ember-computed', 'ember-string', 'ember-service/inject', 'ember-utils', 'ember-runloop', 'ember-ajax/services/ajax', 'ember-ajax/errors'], function (exports, _emberComponent, _emberComputed, _emberString, _emberServiceInject, _emberUtils, _emberRunloop, _emberAjaxServicesAjax, _emberAjaxErrors) {
+define('ghost/components/gh-profile-image', ['exports', 'ember', 'ember-ajax/services/ajax', 'ghost/services/ajax'], function (exports, _ember, _emberAjaxServicesAjax, _ghostServicesAjax) {
+ function _instanceof(left, right) { if (right != null && right[Symbol.hasInstance]) { return right[Symbol.hasInstance](left); } else { return left instanceof right; } }
+
+ var Component = _ember['default'].Component;
+ var computed = _ember['default'].computed;
+ var service = _ember['default'].inject.service;
+ var isBlank = _ember['default'].isBlank;
+ var run = _ember['default'].run;
+ var notEmpty = computed.notEmpty;
/**
* A component to manage a user profile image. By default it just handles picture uploads,
@@ -2273,7 +2218,7 @@ define('ghost-admin/components/gh-profile-image', ['exports', 'ember-component',
* @property {String} defaultImage String containing the background-image css property of the default user profile image
* @property {String} imageBackground String containing the background-image css property with the gravatar url
*/
- exports['default'] = _emberComponent['default'].extend({
+ exports['default'] = Component.extend({
email: '',
size: 90,
debounce: 300,
@@ -2282,11 +2227,10 @@ define('ghost-admin/components/gh-profile-image', ['exports', 'ember-component',
hasUploadedImage: false,
fileStorage: true,
ajax: _emberAjaxServicesAjax['default'].create(),
+ config: service(),
- config: (0, _emberServiceInject['default'])(),
- ghostPaths: (0, _emberServiceInject['default'])(),
-
- displayGravatar: (0, _emberComputed.notEmpty)('validEmail'),
+ ghostPaths: service(),
+ displayGravatar: notEmpty('validEmail'),
init: function init() {
this._super.apply(this, arguments);
@@ -2294,9 +2238,9 @@ define('ghost-admin/components/gh-profile-image', ['exports', 'ember-component',
this.trySetValidEmail();
},
- defaultImage: (0, _emberComputed['default'])('ghostPaths', function () {
+ defaultImage: computed('ghostPaths', function () {
var url = this.get('ghostPaths.subdir') + '/ghost/img/user-image.png';
- return (0, _emberString.htmlSafe)('background-image: url(' + url + ')');
+ return _ember['default'].String.htmlSafe('background-image: url(' + url + ')');
}),
trySetValidEmail: function trySetValidEmail() {
@@ -2309,24 +2253,24 @@ define('ghost-admin/components/gh-profile-image', ['exports', 'ember-component',
didReceiveAttrs: function didReceiveAttrs(attrs) {
this._super.apply(this, arguments);
var timeout = parseInt(attrs.newAttrs.throttle || this.get('debounce'));
- _emberRunloop['default'].debounce(this, 'trySetValidEmail', timeout);
+ run.debounce(this, 'trySetValidEmail', timeout);
},
- imageBackground: (0, _emberComputed['default'])('validEmail', 'size', function () {
+ imageBackground: computed('validEmail', 'size', function () {
var _this = this;
var email = this.get('validEmail');
var size = this.get('size');
var style = '';
- if (!(0, _emberUtils.isBlank)(email)) {
+ if (!isBlank(email)) {
var gravatarUrl = '//www.gravatar.com/avatar/' + window.md5(email) + '?s=' + size + '&d=404';
this.get('ajax').request(gravatarUrl)['catch'](function (error) {
var defaultImageUrl = 'url("' + _this.get('ghostPaths.subdir') + '/ghost/img/user-image.png")';
- if ((0, _emberAjaxErrors.isNotFoundError)(error)) {
- _this.$('.placeholder-img')[0].style.backgroundImage = (0, _emberString.htmlSafe)(defaultImageUrl);
+ if (_instanceof(error, _ghostServicesAjax.NotFoundError)) {
+ _this.$('.placeholder-img')[0].style.backgroundImage = _ember['default'].String.htmlSafe(defaultImageUrl);
} else {
_this.$('.placeholder-img')[0].style.backgroundImage = 'url()';
}
@@ -2334,7 +2278,7 @@ define('ghost-admin/components/gh-profile-image', ['exports', 'ember-component',
style = 'background-image: url(' + gravatarUrl + ')';
}
- return (0, _emberString.htmlSafe)(style);
+ return _ember['default'].String.htmlSafe(style);
}),
didInsertElement: function didInsertElement() {
@@ -2354,7 +2298,7 @@ define('ghost-admin/components/gh-profile-image', ['exports', 'ember-component',
previewCrop: true,
maxNumberOfFiles: 1,
autoUpload: false
- }).on('fileuploadadd', _emberRunloop['default'].bind(this, this.queueFile)).on('fileuploadprocessalways', _emberRunloop['default'].bind(this, this.triggerPreview));
+ }).on('fileuploadadd', run.bind(this, this.queueFile)).on('fileuploadprocessalways', run.bind(this, this.triggerPreview));
},
willDestroyElement: function willDestroyElement() {
@@ -2388,11 +2332,61 @@ define('ghost-admin/components/gh-profile-image', ['exports', 'ember-component',
}
});
});
-define('ghost-admin/components/gh-search-input', ['exports', 'ember-component', 'rsvp', 'ember-computed', 'ember-runloop', 'ember-service/inject', 'ember-utils'], function (exports, _emberComponent, _rsvp, _emberComputed, _emberRunloop, _emberServiceInject, _emberUtils) {
+define('ghost/components/gh-search-input/trigger', ['exports', 'ember', 'ember-invoke-action'], function (exports, _ember, _emberInvokeAction) {
+ var run = _ember['default'].run;
+ var isBlank = _ember['default'].isBlank;
+ var Component = _ember['default'].Component;
+ exports['default'] = Component.extend({
+ open: function open() {
+ this.get('select.actions').open();
+ },
+
+ close: function close() {
+ this.get('select.actions').close();
+ },
+
+ actions: {
+ captureMouseDown: function captureMouseDown(e) {
+ e.stopPropagation();
+ },
+
+ search: function search(term) {
+ if (isBlank(term) === this.get('select.isOpen')) {
+ run.scheduleOnce('afterRender', this, isBlank(term) ? this.close : this.open);
+ }
+
+ (0, _emberInvokeAction.invokeAction)(this, 'select.actions.search', term);
+ },
+
+ focusInput: function focusInput() {
+ this.$('input')[0].focus();
+ },
+
+ resetInput: function resetInput() {
+ this.$('input').val('');
+ },
+
+ handleKeydown: function handleKeydown(e) {
+ var select = this.get('select');
+ if (!select.isOpen) {
+ e.stopPropagation();
+ }
+ }
+ }
+ });
+});
+define('ghost/components/gh-search-input', ['exports', 'ember'], function (exports, _ember) {
exports.computedGroup = computedGroup;
+ var Component = _ember['default'].Component;
+ var RSVP = _ember['default'].RSVP;
+ var computed = _ember['default'].computed;
+ var run = _ember['default'].run;
+ var service = _ember['default'].inject.service;
+ var isBlank = _ember['default'].isBlank;
+ var isEmpty = _ember['default'].isEmpty;
function computedGroup(category) {
- return (0, _emberComputed['default'])('content', 'currentSearch', function () {
+ return computed('content', 'currentSearch', function () {
var _this = this;
if (!this.get('currentSearch') || !this.get('content')) {
@@ -2407,7 +2401,7 @@ define('ghost-admin/components/gh-search-input', ['exports', 'ember-component',
});
}
- exports['default'] = _emberComponent['default'].extend({
+ exports['default'] = Component.extend({
selection: null,
content: [],
@@ -2421,10 +2415,9 @@ define('ghost-admin/components/gh-search-input', ['exports', 'ember-component',
users: computedGroup('Users'),
tags: computedGroup('Tags'),
- _store: (0, _emberServiceInject['default'])('store'),
- _routing: (0, _emberServiceInject['default'])('-routing'),
- ajax: (0, _emberServiceInject['default'])(),
- notifications: (0, _emberServiceInject['default'])(),
+ _store: service('store'),
+ _routing: service('-routing'),
+ ajax: service(),
refreshContent: function refreshContent() {
var _this2 = this;
@@ -2435,7 +2428,7 @@ define('ghost-admin/components/gh-search-input', ['exports', 'ember-component',
var contentExpiresAt = this.get('contentExpiresAt');
if (this.get('isLoading') || contentExpiresAt > now) {
- return _rsvp['default'].resolve();
+ return RSVP.resolve();
}
this.set('isLoading', true);
@@ -2444,28 +2437,28 @@ define('ghost-admin/components/gh-search-input', ['exports', 'ember-component',
promises.pushObject(this._loadUsers());
promises.pushObject(this._loadTags());
- return _rsvp['default'].all(promises).then(function () {})['finally'](function () {
+ return RSVP.all(promises).then(function () {})['finally'](function () {
_this2.set('isLoading', false);
_this2.set('contentExpiresAt', new Date(now.getTime() + contentExpiry));
});
},
- groupedContent: (0, _emberComputed['default'])('posts', 'pages', 'users', 'tags', function () {
+ groupedContent: computed('posts', 'pages', 'users', 'tags', function () {
var groups = [];
- if (!(0, _emberUtils.isEmpty)(this.get('posts'))) {
+ if (!isEmpty(this.get('posts'))) {
groups.pushObject({ groupName: 'Posts', options: this.get('posts') });
}
- if (!(0, _emberUtils.isEmpty)(this.get('pages'))) {
+ if (!isEmpty(this.get('pages'))) {
groups.pushObject({ groupName: 'Pages', options: this.get('pages') });
}
- if (!(0, _emberUtils.isEmpty)(this.get('users'))) {
+ if (!isEmpty(this.get('users'))) {
groups.pushObject({ groupName: 'Users', options: this.get('users') });
}
- if (!(0, _emberUtils.isEmpty)(this.get('tags'))) {
+ if (!isEmpty(this.get('tags'))) {
groups.pushObject({ groupName: 'Tags', options: this.get('tags') });
}
@@ -2473,14 +2466,13 @@ define('ghost-admin/components/gh-search-input', ['exports', 'ember-component',
}),
_loadPosts: function _loadPosts() {
- var _this3 = this;
-
var store = this.get('_store');
var postsUrl = store.adapterFor('post').urlForQuery({}, 'post') + '/';
var postsQuery = { fields: 'id,title,page', limit: 'all', status: 'all', staticPages: 'all' };
var content = this.get('content');
return this.get('ajax').request(postsUrl, { data: postsQuery }).then(function (posts) {
+
content.pushObjects(posts.posts.map(function (post) {
return {
id: 'post.' + post.id,
@@ -2488,14 +2480,10 @@ define('ghost-admin/components/gh-search-input', ['exports', 'ember-component',
category: post.page ? 'Pages' : 'Posts'
};
}));
- })['catch'](function (error) {
- _this3.get('notifications').showAPIError(error, { key: 'search.loadPosts.error' });
});
},
_loadUsers: function _loadUsers() {
- var _this4 = this;
-
var store = this.get('_store');
var usersUrl = store.adapterFor('user').urlForQuery({}, 'user') + '/';
var usersQuery = { fields: 'name,slug', limit: 'all' };
@@ -2509,14 +2497,10 @@ define('ghost-admin/components/gh-search-input', ['exports', 'ember-component',
category: 'Users'
};
}));
- })['catch'](function (error) {
- _this4.get('notifications').showAPIError(error, { key: 'search.loadUsers.error' });
});
},
_loadTags: function _loadTags() {
- var _this5 = this;
-
var store = this.get('_store');
var tagsUrl = store.adapterFor('tag').urlForQuery({}, 'tag') + '/';
var tagsQuery = { fields: 'name,slug', limit: 'all' };
@@ -2530,22 +2514,20 @@ define('ghost-admin/components/gh-search-input', ['exports', 'ember-component',
category: 'Tags'
};
}));
- })['catch'](function (error) {
- _this5.get('notifications').showAPIError(error, { key: 'search.loadTags.error' });
});
},
_performSearch: function _performSearch(term, resolve, reject) {
- var _this6 = this;
+ var _this3 = this;
- if ((0, _emberUtils.isBlank)(term)) {
+ if (isBlank(term)) {
return resolve([]);
}
this.refreshContent().then(function () {
- _this6.set('currentSearch', term);
+ _this3.set('currentSearch', term);
- return resolve(_this6.get('groupedContent'));
+ return resolve(_this3.get('groupedContent'));
})['catch'](reject);
},
@@ -2593,10 +2575,10 @@ define('ghost-admin/components/gh-search-input', ['exports', 'ember-component',
},
search: function search(term) {
- var _this7 = this;
+ var _this4 = this;
- return new _rsvp['default'].Promise(function (resolve, reject) {
- _emberRunloop['default'].debounce(_this7, _this7._performSearch, term, resolve, reject, 200);
+ return new RSVP.Promise(function (resolve, reject) {
+ run.debounce(_this4, _this4._performSearch, term, resolve, reject, 200);
});
}
}
@@ -2605,53 +2587,16 @@ define('ghost-admin/components/gh-search-input', ['exports', 'ember-component',
});
/* global key */
/* jscs:disable requireCamelCaseOrUpperCaseIdentifiers */
-define('ghost-admin/components/gh-search-input/trigger', ['exports', 'ember-runloop', 'ember-utils', 'ember-component', 'ember-invoke-action'], function (exports, _emberRunloop, _emberUtils, _emberComponent, _emberInvokeAction) {
- exports['default'] = _emberComponent['default'].extend({
- open: function open() {
- this.get('select.actions').open();
- },
-
- close: function close() {
- this.get('select.actions').close();
- },
-
- actions: {
- captureMouseDown: function captureMouseDown(e) {
- e.stopPropagation();
- },
-
- search: function search(term) {
- if ((0, _emberUtils.isBlank)(term) === this.get('select.isOpen')) {
- _emberRunloop['default'].scheduleOnce('afterRender', this, (0, _emberUtils.isBlank)(term) ? this.close : this.open);
- }
-
- (0, _emberInvokeAction.invokeAction)(this, 'select.actions.search', term);
- },
-
- focusInput: function focusInput() {
- this.$('input')[0].focus();
- },
-
- resetInput: function resetInput() {
- this.$('input').val('');
- },
-
- handleKeydown: function handleKeydown(e) {
- var select = this.get('select');
- if (!select.isOpen) {
- e.stopPropagation();
- }
- }
- }
- });
-});
-define('ghost-admin/components/gh-select-native', ['exports', 'ember-component', 'ember-computed'], function (exports, _emberComponent, _emberComputed) {
+define('ghost/components/gh-select-native', ['exports', 'ember'], function (exports, _ember) {
+ var Component = _ember['default'].Component;
+ var computed = _ember['default'].computed;
+ var reads = computed.reads;
function K() {
return this;
}
- exports['default'] = _emberComponent['default'].extend({
+ exports['default'] = Component.extend({
content: null,
prompt: null,
optionValuePath: 'id',
@@ -2661,7 +2606,7 @@ define('ghost-admin/components/gh-select-native', ['exports', 'ember-component',
// shadow the passed-in `selection` to avoid
// leaking changes to it via a 2-way binding
- _selection: (0, _emberComputed.reads)('selection'),
+ _selection: reads('selection'),
actions: {
change: function change() {
@@ -2685,13 +2630,21 @@ define('ghost-admin/components/gh-select-native', ['exports', 'ember-component',
}
});
});
-define('ghost-admin/components/gh-selectize', ['exports', 'ember-array/utils', 'ember-computed', 'ember-utils', 'ember-metal/get', 'ember-runloop', 'ember-cli-selectize/components/ember-selectize'], function (exports, _emberArrayUtils, _emberComputed, _emberUtils, _emberMetalGet, _emberRunloop, _emberCliSelectizeComponentsEmberSelectize) {
+define('ghost/components/gh-selectize', ['exports', 'ember', 'ember-cli-selectize/components/ember-selectize'], function (exports, _ember, _emberCliSelectizeComponentsEmberSelectize) {
+ var computed = _ember['default'].computed;
+ var isArray = _ember['default'].isArray;
+ var isBlank = _ember['default'].isBlank;
+ var get = _ember['default'].get;
+ var run = _ember['default'].run;
+
+ var emberA = _ember['default'].A;
+
exports['default'] = _emberCliSelectizeComponentsEmberSelectize['default'].extend({
- selectizeOptions: (0, _emberComputed['default'])(function () {
+ selectizeOptions: computed(function () {
var options = this._super.apply(this, arguments);
- options.onChange = _emberRunloop['default'].bind(this, '_onChange');
+ options.onChange = run.bind(this, '_onChange');
return options;
}),
@@ -2708,7 +2661,7 @@ define('ghost-admin/components/gh-selectize', ['exports', 'ember-array/utils', '
// Send create action
// allow the observers and computed properties to run first
- _emberRunloop['default'].schedule('actions', this, function () {
+ run.schedule('actions', this, function () {
this.sendAction('create-item', input, caret);
});
// We cancel the creation here, so it's up to you to include the created element
@@ -2718,7 +2671,7 @@ define('ghost-admin/components/gh-selectize', ['exports', 'ember-array/utils', '
_addSelection: function _addSelection(obj) {
var _valuePath = this.get('_valuePath');
- var val = (0, _emberMetalGet['default'])(obj, _valuePath);
+ var val = get(obj, _valuePath);
var caret = this._selectize.caretPos;
// caret position is always 1 more than the desired index as this method
@@ -2728,24 +2681,24 @@ define('ghost-admin/components/gh-selectize', ['exports', 'ember-array/utils', '
this.get('selection').insertAt(caret, obj);
- _emberRunloop['default'].schedule('actions', this, function () {
+ run.schedule('actions', this, function () {
this.sendAction('add-item', obj);
this.sendAction('add-value', val);
});
},
_onChange: function _onChange(args) {
- var selection = (0, _emberMetalGet['default'])(this, 'selection');
- var valuePath = (0, _emberMetalGet['default'])(this, '_valuePath');
- var reorderedSelection = (0, _emberArrayUtils.A)([]);
+ var selection = _ember['default'].get(this, 'selection');
+ var valuePath = _ember['default'].get(this, '_valuePath');
+ var reorderedSelection = emberA([]);
- if (!args || !selection || !(0, _emberArrayUtils.isEmberArray)(selection) || args.length !== (0, _emberMetalGet['default'])(selection, 'length')) {
+ if (!args || !selection || !isArray(selection) || args.length !== get(selection, 'length')) {
return;
}
// exit if we're not dealing with the same objects as the selection
var objectsHaveChanged = selection.any(function (obj) {
- return args.indexOf((0, _emberMetalGet['default'])(obj, valuePath)) === -1;
+ return args.indexOf(get(obj, valuePath)) === -1;
});
if (objectsHaveChanged) {
@@ -2754,7 +2707,7 @@ define('ghost-admin/components/gh-selectize', ['exports', 'ember-array/utils', '
// exit if the order is still the same
var orderIsSame = selection.every(function (obj, idx) {
- return (0, _emberMetalGet['default'])(obj, valuePath) === args[idx];
+ return get(obj, valuePath) === args[idx];
});
if (orderIsSame) {
@@ -2764,7 +2717,7 @@ define('ghost-admin/components/gh-selectize', ['exports', 'ember-array/utils', '
// we have a re-order, update the selection
args.forEach(function (value) {
var obj = selection.find(function (item) {
- return '' + (0, _emberMetalGet['default'])(item, valuePath) === value;
+ return '' + get(item, valuePath) === value;
});
if (obj) {
@@ -2779,16 +2732,16 @@ define('ghost-admin/components/gh-selectize', ['exports', 'ember-array/utils', '
var openOnFocus = this.get('openOnFocus');
if (!openOnFocus) {
- _emberRunloop['default'].schedule('afterRender', this, function () {
+ run.schedule('afterRender', this, function () {
var selectize = this._selectize;
if (selectize) {
selectize.on('dropdown_open', function () {
- if ((0, _emberUtils.isBlank)(selectize.$control_input.val())) {
+ if (isBlank(selectize.$control_input.val())) {
selectize.close();
}
});
selectize.on('type', function (filter) {
- if ((0, _emberUtils.isBlank)(filter)) {
+ if (isBlank(filter)) {
selectize.close();
}
});
@@ -2805,8 +2758,10 @@ define('ghost-admin/components/gh-selectize', ['exports', 'ember-array/utils', '
});
});
/* jscs:disable requireCamelCaseOrUpperCaseIdentifiers */
-define('ghost-admin/components/gh-skip-link', ['exports', 'jquery', 'ember-component', 'ember-string'], function (exports, _jquery, _emberComponent, _emberString) {
- exports['default'] = _emberComponent['default'].extend({
+define('ghost/components/gh-skip-link', ['exports', 'ember'], function (exports, _ember) {
+ var $ = _ember['default'].$;
+ var Component = _ember['default'].Component;
+ exports['default'] = Component.extend({
tagName: 'a',
anchor: '',
classNames: ['sr-only', 'sr-only-focusable'],
@@ -2816,34 +2771,36 @@ define('ghost-admin/components/gh-skip-link', ['exports', 'jquery', 'ember-compo
attributeBindings: ['href'],
// Used so that upon clicking on the link
// anchor behaviors or ignored
- href: (0, _emberString.htmlSafe)('javascript:;'),
+ href: _ember['default'].String.htmlSafe('javascript:;'),
click: function click() {
var anchor = this.get('anchor');
- var $el = (0, _jquery['default'])(anchor);
+ var $el = _ember['default'].$(anchor);
if ($el) {
// Scrolls to the top of main content or whatever
// is passed to the anchor attribute
- (0, _jquery['default'])('body').scrollTop($el.offset().top);
+ _ember['default'].$('body').scrollTop($el.offset().top);
// This sets focus on the content which was skipped to
// upon losing focus, the tabindex should be removed
// so that normal keyboard navigation picks up from focused
// element
- (0, _jquery['default'])($el).attr('tabindex', -1).on('blur focusout', function () {
- (0, _jquery['default'])(this).removeAttr('tabindex');
+ _ember['default'].$($el).attr('tabindex', -1).on('blur focusout', function () {
+ $(this).removeAttr('tabindex');
}).focus();
}
}
});
});
/*jshint scripturl:true*/
-define('ghost-admin/components/gh-spin-button', ['exports', 'ember-component', 'ember', 'ember-computed', 'ember-metal/observer', 'ember-runloop'], function (exports, _emberComponent, _ember, _emberComputed, _emberMetalObserver, _emberRunloop) {
-
- // ember-cli-shims doesn't export Ember.Testing
- var testing = _ember['default'].testing;
- exports['default'] = _emberComponent['default'].extend({
+define('ghost/components/gh-spin-button', ['exports', 'ember'], function (exports, _ember) {
+ var Component = _ember['default'].Component;
+ var computed = _ember['default'].computed;
+ var observer = _ember['default'].observer;
+ var run = _ember['default'].run;
+ var equal = computed.equal;
+ exports['default'] = Component.extend({
tagName: 'button',
buttonText: '',
submitting: false,
@@ -2855,7 +2812,7 @@ define('ghost-admin/components/gh-spin-button', ['exports', 'ember-component', '
attributeBindings: ['disabled', 'type', 'tabindex'],
// Must be set on the controller
- disabled: (0, _emberComputed.equal)('showSpinner', true),
+ disabled: equal('showSpinner', true),
click: function click() {
if (this.get('action')) {
@@ -2865,25 +2822,24 @@ define('ghost-admin/components/gh-spin-button', ['exports', 'ember-component', '
return true;
},
- toggleSpinner: (0, _emberMetalObserver['default'])('submitting', function () {
+ toggleSpinner: observer('submitting', function () {
var submitting = this.get('submitting');
var timeout = this.get('showSpinnerTimeout');
- var delay = testing ? 10 : 1000;
if (submitting) {
this.set('showSpinner', true);
- this.set('showSpinnerTimeout', _emberRunloop['default'].later(this, function () {
+ this.set('showSpinnerTimeout', run.later(this, function () {
if (!this.get('submitting')) {
this.set('showSpinner', false);
}
this.set('showSpinnerTimeout', null);
- }, delay));
+ }, 1000));
} else if (!submitting && timeout === null) {
this.set('showSpinner', false);
}
}),
- setSize: (0, _emberMetalObserver['default'])('showSpinner', function () {
+ setSize: observer('showSpinner', function () {
if (this.get('showSpinner') && this.get('autoWidth')) {
this.$().width(this.$().width());
this.$().height(this.$().height());
@@ -2895,12 +2851,12 @@ define('ghost-admin/components/gh-spin-button', ['exports', 'ember-component', '
willDestroy: function willDestroy() {
this._super.apply(this, arguments);
- _emberRunloop['default'].cancel(this.get('showSpinnerTimeout'));
+ run.cancel(this.get('showSpinnerTimeout'));
}
});
});
-define('ghost-admin/components/gh-subscribers-table', ['exports', 'ember-component'], function (exports, _emberComponent) {
- exports['default'] = _emberComponent['default'].extend({
+define('ghost/components/gh-subscribers-table', ['exports', 'ember'], function (exports, _ember) {
+ exports['default'] = _ember['default'].Component.extend({
classNames: ['subscribers-table'],
table: null,
@@ -2916,24 +2872,27 @@ define('ghost-admin/components/gh-subscribers-table', ['exports', 'ember-compone
}
});
});
-define('ghost-admin/components/gh-tab-pane', ['exports', 'ember-component', 'ember-computed'], function (exports, _emberComponent, _emberComputed) {
+define('ghost/components/gh-tab-pane', ['exports', 'ember'], function (exports, _ember) {
+ var Component = _ember['default'].Component;
+ var computed = _ember['default'].computed;
+ var alias = computed.alias;
// See gh-tabs-manager.js for use
- exports['default'] = _emberComponent['default'].extend({
+ exports['default'] = Component.extend({
classNameBindings: ['active'],
- tabsManager: (0, _emberComputed['default'])(function () {
+ tabsManager: computed(function () {
return this.nearestWithProperty('isTabsManager');
}),
- tab: (0, _emberComputed['default'])('tabsManager.tabs.[]', 'tabsManager.tabPanes.[]', function () {
+ tab: computed('tabsManager.tabs.[]', 'tabsManager.tabPanes.[]', function () {
var index = this.get('tabsManager.tabPanes').indexOf(this);
var tabs = this.get('tabsManager.tabs');
return tabs && tabs.objectAt(index);
}),
- active: (0, _emberComputed.alias)('tab.active'),
+ active: alias('tab.active'),
willRender: function willRender() {
this._super.apply(this, arguments);
@@ -2948,19 +2907,21 @@ define('ghost-admin/components/gh-tab-pane', ['exports', 'ember-component', 'emb
}
});
});
-define('ghost-admin/components/gh-tab', ['exports', 'ember-component', 'ember-computed'], function (exports, _emberComponent, _emberComputed) {
+define('ghost/components/gh-tab', ['exports', 'ember'], function (exports, _ember) {
+ var Component = _ember['default'].Component;
+ var computed = _ember['default'].computed;
// See gh-tabs-manager.js for use
- exports['default'] = _emberComponent['default'].extend({
- tabsManager: (0, _emberComputed['default'])(function () {
+ exports['default'] = Component.extend({
+ tabsManager: computed(function () {
return this.nearestWithProperty('isTabsManager');
}),
- active: (0, _emberComputed['default'])('tabsManager.activeTab', function () {
+ active: computed('tabsManager.activeTab', function () {
return this.get('tabsManager.activeTab') === this;
}),
- index: (0, _emberComputed['default'])('tabsManager.tabs.[]', function () {
+ index: computed('tabsManager.tabs.[]', function () {
return this.get('tabsManager.tabs').indexOf(this);
}),
@@ -2982,58 +2943,59 @@ define('ghost-admin/components/gh-tab', ['exports', 'ember-component', 'ember-co
}
});
});
-define('ghost-admin/components/gh-tabs-manager', ['exports', 'ember-component'], function (exports, _emberComponent) {
+define('ghost/components/gh-tabs-manager', ['exports', 'ember'], function (exports, _ember) {
+ var Component = _ember['default'].Component;
/**
- * Heavily inspired by ic-tabs (https://github.com/instructure/ic-tabs)
- *
- * Three components work together for smooth tabbing.
- * 1. tabs-manager (gh-tabs)
- * 2. tab (gh-tab)
- * 3. tab-pane (gh-tab-pane)
- *
- * ## Usage:
- * The tabs-manager must wrap all tab and tab-pane components,
- * but they can be nested at any level.
+ Heavily inspired by ic-tabs (https://github.com/instructure/ic-tabs)
- * A tab and its pane are tied together via their order.
- * So, the second tab within a tab manager will activate
- * the second pane within that manager.
+ Three components work together for smooth tabbing.
+ 1. tabs-manager (gh-tabs)
+ 2. tab (gh-tab)
+ 3. tab-pane (gh-tab-pane)
- * ```hbs
- * {{#gh-tabs-manager}}
- * {{#gh-tab}}
- * First tab
- * {{/gh-tab}}
- * {{#gh-tab}}
- * Second tab
- * {{/gh-tab}}
- *
- * ....
- * {{#gh-tab-pane}}
- * First pane
- * {{/gh-tab-pane}}
- * {{#gh-tab-pane}}
- * Second pane
- * {{/gh-tab-pane}}
- * {{/gh-tabs-manager}}
- * ```
- * ## Options:
- *
- * the tabs-manager will send a "selected" action whenever one of its
- * tabs is clicked.
- * ```hbs
- * {{#gh-tabs-manager selected="myAction"}}
- * ....
- * {{/gh-tabs-manager}}
- * ```
- *
- * ## Styling:
- * Both tab and tab-pane elements have an "active"
- * class applied when they are active.
- *
- */
- exports['default'] = _emberComponent['default'].extend({
+ ## Usage:
+ The tabs-manager must wrap all tab and tab-pane components,
+ but they can be nested at any level.
+
+ A tab and its pane are tied together via their order.
+ So, the second tab within a tab manager will activate
+ the second pane within that manager.
+
+ ```hbs
+ {{#gh-tabs-manager}}
+ {{#gh-tab}}
+ First tab
+ {{/gh-tab}}
+ {{#gh-tab}}
+ Second tab
+ {{/gh-tab}}
+
+ ....
+ {{#gh-tab-pane}}
+ First pane
+ {{/gh-tab-pane}}
+ {{#gh-tab-pane}}
+ Second pane
+ {{/gh-tab-pane}}
+ {{/gh-tabs-manager}}
+ ```
+ ## Options:
+
+ the tabs-manager will send a "selected" action whenever one of its
+ tabs is clicked.
+ ```hbs
+ {{#gh-tabs-manager selected="myAction"}}
+ ....
+ {{/gh-tabs-manager}}
+ ```
+
+ ## Styling:
+ Both tab and tab-pane elements have an "active"
+ class applied when they are active.
+
+ */
+ exports['default'] = Component.extend({
activeTab: null,
tabs: [],
tabPanes: [],
@@ -3066,29 +3028,31 @@ define('ghost-admin/components/gh-tabs-manager', ['exports', 'ember-component'],
}
});
});
-define('ghost-admin/components/gh-tag-settings-form', ['exports', 'ember-component', 'ember', 'ember-computed', 'ember-metal/get', 'ember-service/inject', 'ember-string', 'ghost-admin/utils/bound-one-way', 'ember-invoke-action'], function (exports, _emberComponent, _ember, _emberComputed, _emberMetalGet, _emberServiceInject, _emberString, _ghostAdminUtilsBoundOneWay, _emberInvokeAction) {
-
- // ember-cli-shims doesn't export this
+define('ghost/components/gh-tag-settings-form', ['exports', 'ember', 'ghost/utils/bound-one-way', 'ember-invoke-action'], function (exports, _ember, _ghostUtilsBoundOneWay, _emberInvokeAction) {
+ var Component = _ember['default'].Component;
var Handlebars = _ember['default'].Handlebars;
- exports['default'] = _emberComponent['default'].extend({
+ var computed = _ember['default'].computed;
+ var get = _ember['default'].get;
+ var service = _ember['default'].inject.service;
+ var reads = computed.reads;
+ exports['default'] = Component.extend({
tag: null,
- scratchName: (0, _ghostAdminUtilsBoundOneWay['default'])('tag.name'),
- scratchSlug: (0, _ghostAdminUtilsBoundOneWay['default'])('tag.slug'),
- scratchDescription: (0, _ghostAdminUtilsBoundOneWay['default'])('tag.description'),
- scratchMetaTitle: (0, _ghostAdminUtilsBoundOneWay['default'])('tag.metaTitle'),
- scratchMetaDescription: (0, _ghostAdminUtilsBoundOneWay['default'])('tag.metaDescription'),
+ scratchName: (0, _ghostUtilsBoundOneWay['default'])('tag.name'),
+ scratchSlug: (0, _ghostUtilsBoundOneWay['default'])('tag.slug'),
+ scratchDescription: (0, _ghostUtilsBoundOneWay['default'])('tag.description'),
+ scratchMetaTitle: (0, _ghostUtilsBoundOneWay['default'])('tag.metaTitle'),
+ scratchMetaDescription: (0, _ghostUtilsBoundOneWay['default'])('tag.metaDescription'),
isViewingSubview: false,
- feature: (0, _emberServiceInject['default'])(),
- config: (0, _emberServiceInject['default'])(),
- mediaQueries: (0, _emberServiceInject['default'])(),
+ config: service(),
+ mediaQueries: service(),
- isMobile: (0, _emberComputed.reads)('mediaQueries.maxWidth600'),
+ isMobile: reads('mediaQueries.maxWidth600'),
- title: (0, _emberComputed['default'])('tag.isNew', function () {
+ title: computed('tag.isNew', function () {
if (this.get('tag.isNew')) {
return 'New Tag';
} else {
@@ -3096,7 +3060,7 @@ define('ghost-admin/components/gh-tag-settings-form', ['exports', 'ember-compone
}
}),
- seoTitle: (0, _emberComputed['default'])('scratchName', 'scratchMetaTitle', function () {
+ seoTitle: computed('scratchName', 'scratchMetaTitle', function () {
var metaTitle = this.get('scratchMetaTitle') || '';
metaTitle = metaTitle.length > 0 ? metaTitle : this.get('scratchName');
@@ -3104,13 +3068,13 @@ define('ghost-admin/components/gh-tag-settings-form', ['exports', 'ember-compone
if (metaTitle && metaTitle.length > 70) {
metaTitle = metaTitle.substring(0, 70).trim();
metaTitle = Handlebars.Utils.escapeExpression(metaTitle);
- metaTitle = (0, _emberString.htmlSafe)(metaTitle + '…');
+ metaTitle = _ember['default'].String.htmlSafe(metaTitle + '…');
}
return metaTitle;
}),
- seoURL: (0, _emberComputed['default'])('scratchSlug', function () {
+ seoURL: computed('scratchSlug', function () {
var blogUrl = this.get('config.blogUrl');
var seoSlug = this.get('scratchSlug') || '';
@@ -3123,13 +3087,13 @@ define('ghost-admin/components/gh-tag-settings-form', ['exports', 'ember-compone
if (seoURL.length > 70) {
seoURL = seoURL.substring(0, 70).trim();
- seoURL = (0, _emberString.htmlSafe)(seoURL + '…');
+ seoURL = _ember['default'].String.htmlSafe(seoURL + '…');
}
return seoURL;
}),
- seoDescription: (0, _emberComputed['default'])('scratchDescription', 'scratchMetaDescription', function () {
+ seoDescription: computed('scratchDescription', 'scratchMetaDescription', function () {
var metaDescription = this.get('scratchMetaDescription') || '';
metaDescription = metaDescription.length > 0 ? metaDescription : this.get('scratchDescription');
@@ -3137,7 +3101,7 @@ define('ghost-admin/components/gh-tag-settings-form', ['exports', 'ember-compone
if (metaDescription && metaDescription.length > 156) {
metaDescription = metaDescription.substring(0, 156).trim();
metaDescription = Handlebars.Utils.escapeExpression(metaDescription);
- metaDescription = (0, _emberString.htmlSafe)(metaDescription + '…');
+ metaDescription = _ember['default'].String.htmlSafe(metaDescription + '…');
}
return metaDescription;
@@ -3146,7 +3110,7 @@ define('ghost-admin/components/gh-tag-settings-form', ['exports', 'ember-compone
didReceiveAttrs: function didReceiveAttrs(attrs) {
this._super.apply(this, arguments);
- if ((0, _emberMetalGet['default'])(attrs, 'newAttrs.tag.value.id') !== (0, _emberMetalGet['default'])(attrs, 'oldAttrs.tag.value.id')) {
+ if (get(attrs, 'newAttrs.tag.value.id') !== get(attrs, 'oldAttrs.tag.value.id')) {
this.reset();
}
},
@@ -3172,11 +3136,11 @@ define('ghost-admin/components/gh-tag-settings-form', ['exports', 'ember-compone
},
setCoverImage: function setCoverImage(image) {
- this.send('setProperty', 'image', image);
+ (0, _emberInvokeAction.invokeAction)(this, 'setProperty', 'image', image);
},
clearCoverImage: function clearCoverImage() {
- this.send('setProperty', 'image', '');
+ (0, _emberInvokeAction.invokeAction)(this, 'setProperty', 'image', '');
},
openMeta: function openMeta() {
@@ -3195,10 +3159,8 @@ define('ghost-admin/components/gh-tag-settings-form', ['exports', 'ember-compone
});
});
/* global key */
-define('ghost-admin/components/gh-tag', ['exports', 'ember-component', 'ember-service/inject', 'ember-invoke-action'], function (exports, _emberComponent, _emberServiceInject, _emberInvokeAction) {
- exports['default'] = _emberComponent['default'].extend({
- feature: (0, _emberServiceInject['default'])(),
-
+define('ghost/components/gh-tag', ['exports', 'ember', 'ember-invoke-action'], function (exports, _ember, _emberInvokeAction) {
+ exports['default'] = _ember['default'].Component.extend({
willDestroyElement: function willDestroyElement() {
this._super.apply(this, arguments);
@@ -3208,25 +3170,33 @@ define('ghost-admin/components/gh-tag', ['exports', 'ember-component', 'ember-se
}
});
});
-define('ghost-admin/components/gh-tags-management-container', ['exports', 'ember-component', 'ember-computed', 'ember-service/inject', 'ember-utils', 'ember-metal/observer', 'ember-runloop'], function (exports, _emberComponent, _emberComputed, _emberServiceInject, _emberUtils, _emberMetalObserver, _emberRunloop) {
- exports['default'] = _emberComponent['default'].extend({
+define('ghost/components/gh-tags-management-container', ['exports', 'ember'], function (exports, _ember) {
+ var Component = _ember['default'].Component;
+ var computed = _ember['default'].computed;
+ var service = _ember['default'].inject.service;
+ var isBlank = _ember['default'].isBlank;
+ var observer = _ember['default'].observer;
+ var run = _ember['default'].run;
+ var equal = computed.equal;
+ var reads = computed.reads;
+ exports['default'] = Component.extend({
classNames: ['view-container'],
classNameBindings: ['isMobile'],
- mediaQueries: (0, _emberServiceInject['default'])(),
+ mediaQueries: service(),
tags: null,
selectedTag: null,
- isMobile: (0, _emberComputed.reads)('mediaQueries.maxWidth600'),
- isEmpty: (0, _emberComputed.equal)('tags.length', 0),
+ isMobile: reads('mediaQueries.maxWidth600'),
+ isEmpty: equal('tags.length', 0),
init: function init() {
this._super.apply(this, arguments);
- _emberRunloop['default'].schedule('actions', this, this.fireMobileChangeActions);
+ run.schedule('actions', this, this.fireMobileChangeActions);
},
- displaySettingsPane: (0, _emberComputed['default'])('isEmpty', 'selectedTag', 'isMobile', function () {
+ displaySettingsPane: computed('isEmpty', 'selectedTag', 'isMobile', function () {
var isEmpty = this.get('isEmpty');
var selectedTag = this.get('selectedTag');
var isMobile = this.get('isMobile');
@@ -3237,7 +3207,7 @@ define('ghost-admin/components/gh-tags-management-container', ['exports', 'ember
}
// display list if no tag is selected on mobile
- if (isMobile && (0, _emberUtils.isBlank)(selectedTag)) {
+ if (isMobile && isBlank(selectedTag)) {
return false;
}
@@ -3245,152 +3215,77 @@ define('ghost-admin/components/gh-tags-management-container', ['exports', 'ember
return true;
}),
- fireMobileChangeActions: (0, _emberMetalObserver['default'])('isMobile', function () {
+ fireMobileChangeActions: observer('isMobile', function () {
if (!this.get('isMobile')) {
this.sendAction('leftMobile');
}
})
});
});
-define('ghost-admin/components/gh-textarea', ['exports', 'ember-one-way-controls/components/one-way-textarea', 'ghost-admin/mixins/text-input'], function (exports, _emberOneWayControlsComponentsOneWayTextarea, _ghostAdminMixinsTextInput) {
- exports['default'] = _emberOneWayControlsComponentsOneWayTextarea['default'].extend(_ghostAdminMixinsTextInput['default'], {
+define('ghost/components/gh-textarea', ['exports', 'ember', 'ghost/mixins/text-input'], function (exports, _ember, _ghostMixinsTextInput) {
+ var TextArea = _ember['default'].TextArea;
+ exports['default'] = TextArea.extend(_ghostMixinsTextInput['default'], {
classNames: 'gh-input'
});
});
-define('ghost-admin/components/gh-timezone-select', ['exports', 'ember-component', 'ember-computed', 'ember-service/inject', 'ember-invoke-action'], function (exports, _emberComponent, _emberComputed, _emberServiceInject, _emberInvokeAction) {
- function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } }
-
- exports['default'] = _emberComponent['default'].extend({
- classNames: ['form-group', 'for-select'],
-
- activeTimezone: null,
- availableTimezones: null,
-
- clock: (0, _emberServiceInject['default'])(),
-
- availableTimezoneNames: (0, _emberComputed.mapBy)('availableTimezones', 'name'),
-
- hasTimezoneOverride: (0, _emberComputed['default'])('activeTimezone', 'availableTimezoneNames', function () {
- var activeTimezone = this.get('activeTimezone');
- var availableTimezoneNames = this.get('availableTimezoneNames');
-
- return !availableTimezoneNames.contains(activeTimezone);
- }),
-
- selectedTimezone: (0, _emberComputed['default'])('activeTimezone', 'availableTimezones', 'hasTimezoneOverride', function () {
- var hasTimezoneOverride = this.get('hasTimezoneOverride');
- var activeTimezone = this.get('activeTimezone');
- var availableTimezones = this.get('availableTimezones');
-
- if (hasTimezoneOverride) {
- return { name: '', label: '' };
- }
-
- return availableTimezones.filterBy('name', activeTimezone).get('firstObject');
- }),
-
- selectableTimezones: (0, _emberComputed['default'])('availableTimezones', 'hasTimezoneOverride', function () {
- var hasTimezoneOverride = this.get('hasTimezoneOverride');
- var availableTimezones = this.get('availableTimezones');
-
- if (hasTimezoneOverride) {
- return [{ name: '', label: '' }].concat(_toConsumableArray(availableTimezones));
- }
-
- return availableTimezones;
- }),
-
- localTime: (0, _emberComputed['default'])('hasTimezoneOverride', 'activeTimezone', 'selectedTimezone', 'clock.second', function () {
- var hasTimezoneOverride = this.get('hasTimezoneOverride');
- var timezone = hasTimezoneOverride ? this.get('activeTimezone') : this.get('selectedTimezone.name');
-
- this.get('clock.second');
- return timezone ? moment().tz(timezone).format('HH:mm:ss') : moment().utc().format('HH:mm:ss');
- }),
-
- actions: {
- setTimezone: function setTimezone(timezone) {
- (0, _emberInvokeAction.invokeAction)(this, 'update', timezone);
- }
- }
- });
-});
-define('ghost-admin/components/gh-trim-focus-input', ['exports', 'ember-computed', 'ghost-admin/components/gh-input'], function (exports, _emberComputed, _ghostAdminComponentsGhInput) {
-
- /**
- * This doesn't override the OneWayInput component because
- * we need finer control. It borrows
- * parts from both the OneWayInput component and Ember's default
- * input component
- */
- var TrimFocusInputComponent = _ghostAdminComponentsGhInput['default'].extend({
-
- shouldFocus: true,
-
+define('ghost/components/gh-trim-focus-input', ['exports', 'ember'], function (exports, _ember) {
+ var TextField = _ember['default'].TextField;
+ var computed = _ember['default'].computed;
+ exports['default'] = TextField.extend({
+ focus: true,
+ classNames: 'gh-input',
attributeBindings: ['autofocus'],
- autofocus: (0, _emberComputed['default'])(function () {
- if (this.get('shouldFocus')) {
+ autofocus: computed(function () {
+ if (this.get('focus')) {
return device.ios() ? false : 'autofocus';
}
return false;
}),
- init: function init() {
- this._super.apply(this, arguments);
+ _focusField: function _focusField() {
+ // This fix is required until Mobile Safari has reliable
+ // autofocus, select() or focus() support
+ if (this.get('focus') && !device.ios()) {
+ this.$().val(this.$().val()).focus();
+ }
},
- didInsertElement: function didInsertElement() {
- this._super.apply(this, arguments);
- this._focus();
+ _trimValue: function _trimValue() {
+ var text = this.$().val();
+ this.$().val(text.trim());
},
- sanitizeInput: function sanitizeInput(input) {
- if (input && typeof input.trim === 'function') {
- return input.trim();
- } else {
- return input;
- }
+ didInsertElement: function didInsertElement() {
+ this._super.apply(this, arguments);
+ this._focusField();
},
- _focus: function _focus() {
- // Until mobile safari has better support
- // for focusing, we just ignore it
- if (this.get('shouldFocus') && !device.ios()) {
- this.element.focus();
- }
+ focusOut: function focusOut() {
+ this._super.apply(this, arguments);
+ this._trimValue();
}
});
-
- exports['default'] = TrimFocusInputComponent;
});
/*global device*/
-define('ghost-admin/components/gh-upgrade-notification', ['exports', 'ember-component', 'ember-computed', 'ember-service/inject'], function (exports, _emberComponent, _emberComputed, _emberServiceInject) {
- exports['default'] = _emberComponent['default'].extend({
- tagName: 'section',
-
- classNames: ['gh-upgrade-notification'],
-
- upgradeNotification: (0, _emberServiceInject['default'])('upgrade-notification'),
-
- message: (0, _emberComputed.alias)('upgradeNotification.content')
- });
-});
-define('ghost-admin/components/gh-url-preview', ['exports', 'ember-component', 'ember-computed', 'ember-service/inject'], function (exports, _emberComponent, _emberComputed, _emberServiceInject) {
+define('ghost/components/gh-url-preview', ['exports', 'ember'], function (exports, _ember) {
+ var Component = _ember['default'].Component;
+ var computed = _ember['default'].computed;
+ var service = _ember['default'].inject.service;
/*
Example usage:
{{gh-url-preview prefix="tag" slug=theSlugValue tagName="p" classNames="description"}}
*/
- exports['default'] = _emberComponent['default'].extend({
+ exports['default'] = Component.extend({
classNames: 'ghost-url-preview',
prefix: null,
slug: null,
- config: (0, _emberServiceInject['default'])(),
+ config: service(),
- url: (0, _emberComputed['default'])('slug', function () {
+ url: computed('slug', function () {
// Get the blog URL and strip the scheme
var blogUrl = this.get('config.blogUrl');
// Remove `http[s]://`
@@ -3407,44 +3302,50 @@ define('ghost-admin/components/gh-url-preview', ['exports', 'ember-component', '
})
});
});
-define('ghost-admin/components/gh-user-active', ['exports', 'ember-component', 'ember-computed', 'ember-service/inject', 'ember-string'], function (exports, _emberComponent, _emberComputed, _emberServiceInject, _emberString) {
- exports['default'] = _emberComponent['default'].extend({
+define('ghost/components/gh-user-active', ['exports', 'ember'], function (exports, _ember) {
+ var Component = _ember['default'].Component;
+ var computed = _ember['default'].computed;
+ var service = _ember['default'].inject.service;
+ exports['default'] = Component.extend({
tagName: '',
user: null,
- ghostPaths: (0, _emberServiceInject['default'])(),
+ ghostPaths: service(),
- userDefault: (0, _emberComputed['default'])('ghostPaths', function () {
+ userDefault: computed('ghostPaths', function () {
return this.get('ghostPaths.subdir') + '/ghost/img/user-image.png';
}),
- userImageBackground: (0, _emberComputed['default'])('user.image', 'userDefault', function () {
+ userImageBackground: computed('user.image', 'userDefault', function () {
var url = this.get('user.image') || this.get('userDefault');
- return (0, _emberString.htmlSafe)('background-image: url(' + url + ')');
+ return _ember['default'].String.htmlSafe('background-image: url(' + url + ')');
}),
- lastLoginUTC: (0, _emberComputed['default'])('user.lastLoginUTC', function () {
- var lastLoginUTC = this.get('user.lastLoginUTC');
+ lastLogin: computed('user.lastLogin', function () {
+ var lastLogin = this.get('user.lastLogin');
- return lastLoginUTC ? moment(lastLoginUTC).fromNow() : '(Never)';
+ return lastLogin ? lastLogin.fromNow() : '(Never)';
})
});
});
-define('ghost-admin/components/gh-user-invited', ['exports', 'ember-component', 'ember-computed', 'ember-service/inject'], function (exports, _emberComponent, _emberComputed, _emberServiceInject) {
- exports['default'] = _emberComponent['default'].extend({
+define('ghost/components/gh-user-invited', ['exports', 'ember'], function (exports, _ember) {
+ var Component = _ember['default'].Component;
+ var computed = _ember['default'].computed;
+ var service = _ember['default'].inject.service;
+ exports['default'] = Component.extend({
tagName: '',
user: null,
isSending: false,
- notifications: (0, _emberServiceInject['default'])(),
+ notifications: service(),
- createdAtUTC: (0, _emberComputed['default'])('user.createdAtUTC', function () {
- var createdAtUTC = this.get('user.createdAtUTC');
+ createdAt: computed('user.createdAt', function () {
+ var createdAt = this.get('user.createdAt');
- return createdAtUTC ? moment(createdAtUTC).fromNow() : '';
+ return createdAt ? createdAt.fromNow() : '';
}),
actions: {
@@ -3499,7 +3400,9 @@ define('ghost-admin/components/gh-user-invited', ['exports', 'ember-component',
}
});
});
-define('ghost-admin/components/gh-validation-status-container', ['exports', 'ember-component', 'ember-computed', 'ghost-admin/mixins/validation-state'], function (exports, _emberComponent, _emberComputed, _ghostAdminMixinsValidationState) {
+define('ghost/components/gh-validation-status-container', ['exports', 'ember', 'ghost/mixins/validation-state'], function (exports, _ember, _ghostMixinsValidationState) {
+ var Component = _ember['default'].Component;
+ var computed = _ember['default'].computed;
/**
* Handles the CSS necessary to show a specific property state. When passed a
@@ -3508,10 +3411,10 @@ define('ghost-admin/components/gh-validation-status-container', ['exports', 'emb
* @param {DS.Errors} errors The DS.Errors object
* @param {string} property Name of the property
*/
- exports['default'] = _emberComponent['default'].extend(_ghostAdminMixinsValidationState['default'], {
+ exports['default'] = Component.extend(_ghostMixinsValidationState['default'], {
classNameBindings: ['errorClass'],
- errorClass: (0, _emberComputed['default'])('property', 'hasError', 'hasValidated.[]', function () {
+ errorClass: computed('property', 'hasError', 'hasValidated.[]', function () {
var hasValidated = this.get('hasValidated');
var property = this.get('property');
@@ -3523,8 +3426,9 @@ define('ghost-admin/components/gh-validation-status-container', ['exports', 'emb
})
});
});
-define('ghost-admin/components/gh-view-title', ['exports', 'ember-component'], function (exports, _emberComponent) {
- exports['default'] = _emberComponent['default'].extend({
+define('ghost/components/gh-view-title', ['exports', 'ember'], function (exports, _ember) {
+ var Component = _ember['default'].Component;
+ exports['default'] = Component.extend({
tagName: 'h2',
classNames: ['view-title'],
@@ -3535,31 +3439,34 @@ define('ghost-admin/components/gh-view-title', ['exports', 'ember-component'], f
}
});
});
-define("ghost-admin/components/illiquid-model", ["exports", "liquid-fire/components/illiquid-model"], function (exports, _liquidFireComponentsIlliquidModel) {
- Object.defineProperty(exports, "default", {
- enumerable: true,
- get: function get() {
- return _liquidFireComponentsIlliquidModel["default"];
- }
- });
-});
-define("ghost-admin/components/lf-outlet", ["exports", "liquid-fire/ember-internals"], function (exports, _liquidFireEmberInternals) {
- Object.defineProperty(exports, "default", {
- enumerable: true,
- get: function get() {
- return _liquidFireEmberInternals.StaticOutlet;
- }
- });
-});
-define("ghost-admin/components/lf-overlay", ["exports", "liquid-fire/components/lf-overlay"], function (exports, _liquidFireComponentsLfOverlay) {
- Object.defineProperty(exports, "default", {
- enumerable: true,
- get: function get() {
- return _liquidFireComponentsLfOverlay["default"];
+define("ghost/components/lf-outlet", ["exports", "liquid-fire/ember-internals"], function (exports, _liquidFireEmberInternals) {
+ exports["default"] = _liquidFireEmberInternals.StaticOutlet;
+});
+define('ghost/components/lf-overlay', ['exports', 'ember'], function (exports, _ember) {
+ var COUNTER = '__lf-modal-open-counter';
+
+ exports['default'] = _ember['default'].Component.extend({
+ tagName: 'span',
+ classNames: ['lf-overlay'],
+
+ didInsertElement: function didInsertElement() {
+ var body = _ember['default'].$('body');
+ var counter = body.data(COUNTER) || 0;
+ body.addClass('lf-modal-open');
+ body.data(COUNTER, counter + 1);
+ },
+
+ willDestroy: function willDestroy() {
+ var body = _ember['default'].$('body');
+ var counter = body.data(COUNTER) || 0;
+ body.data(COUNTER, counter - 1);
+ if (counter < 2) {
+ body.removeClass('lf-modal-open lf-modal-closing');
+ }
}
});
});
-define('ghost-admin/components/light-table', ['exports', 'ember-light-table/components/light-table'], function (exports, _emberLightTableComponentsLightTable) {
+define('ghost/components/light-table', ['exports', 'ember-light-table/components/light-table'], function (exports, _emberLightTableComponentsLightTable) {
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
@@ -3567,7 +3474,7 @@ define('ghost-admin/components/light-table', ['exports', 'ember-light-table/comp
}
});
});
-define('ghost-admin/components/liquid-append', ['exports', 'liquid-wormhole/components/liquid-append'], function (exports, _liquidWormholeComponentsLiquidAppend) {
+define('ghost/components/liquid-append', ['exports', 'liquid-wormhole/components/liquid-append'], function (exports, _liquidWormholeComponentsLiquidAppend) {
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
@@ -3575,39 +3482,195 @@ define('ghost-admin/components/liquid-append', ['exports', 'liquid-wormhole/comp
}
});
});
-define("ghost-admin/components/liquid-bind", ["exports", "liquid-fire/components/liquid-bind"], function (exports, _liquidFireComponentsLiquidBind) {
- Object.defineProperty(exports, "default", {
- enumerable: true,
- get: function get() {
- return _liquidFireComponentsLiquidBind["default"];
- }
+define('ghost/components/liquid-bind', ['exports', 'ember'], function (exports, _ember) {
+
+ var LiquidBind = _ember['default'].Component.extend({
+ tagName: '',
+ positionalParams: ['value'] // needed for Ember 1.13.[0-5] and 2.0.0-beta.[1-3] support
+ });
+
+ LiquidBind.reopenClass({
+ positionalParams: ['value']
});
+
+ exports['default'] = LiquidBind;
});
-define("ghost-admin/components/liquid-child", ["exports", "liquid-fire/components/liquid-child"], function (exports, _liquidFireComponentsLiquidChild) {
- Object.defineProperty(exports, "default", {
- enumerable: true,
- get: function get() {
- return _liquidFireComponentsLiquidChild["default"];
+define('ghost/components/liquid-child', ['exports', 'ember'], function (exports, _ember) {
+ exports['default'] = _ember['default'].Component.extend({
+ classNames: ['liquid-child'],
+
+ didInsertElement: function didInsertElement() {
+ var $container = this.$();
+ if ($container) {
+ $container.css('visibility', 'hidden');
+ }
+ this.sendAction('liquidChildDidRender', this);
}
+
});
});
-define("ghost-admin/components/liquid-container", ["exports", "liquid-fire/components/liquid-container"], function (exports, _liquidFireComponentsLiquidContainer) {
- Object.defineProperty(exports, "default", {
- enumerable: true,
- get: function get() {
- return _liquidFireComponentsLiquidContainer["default"];
+define("ghost/components/liquid-container", ["exports", "ember", "liquid-fire/growable", "ghost/components/liquid-measured"], function (exports, _ember, _liquidFireGrowable, _ghostComponentsLiquidMeasured) {
+ exports["default"] = _ember["default"].Component.extend(_liquidFireGrowable["default"], {
+ classNames: ['liquid-container'],
+
+ lockSize: function lockSize(elt, want) {
+ elt.outerWidth(want.width);
+ elt.outerHeight(want.height);
+ },
+
+ unlockSize: function unlockSize() {
+ var _this = this;
+
+ var doUnlock = function doUnlock() {
+ _this.updateAnimatingClass(false);
+ var elt = _this.$();
+ if (elt) {
+ elt.css({ width: '', height: '' });
+ }
+ };
+ if (this._scaling) {
+ this._scaling.then(doUnlock);
+ } else {
+ doUnlock();
+ }
+ },
+
+ // We're doing this manually instead of via classNameBindings
+ // because it depends on upward-data-flow, which generates warnings
+ // under Glimmer.
+ updateAnimatingClass: function updateAnimatingClass(on) {
+ if (this.isDestroyed || !this._wasInserted) {
+ return;
+ }
+ if (arguments.length === 0) {
+ on = this.get('liquidAnimating');
+ } else {
+ this.set('liquidAnimating', on);
+ }
+ if (on) {
+ this.$().addClass('liquid-animating');
+ } else {
+ this.$().removeClass('liquid-animating');
+ }
+ },
+
+ startMonitoringSize: _ember["default"].on('didInsertElement', function () {
+ this._wasInserted = true;
+ this.updateAnimatingClass();
+ }),
+
+ actions: {
+
+ willTransition: function willTransition(versions) {
+ if (!this._wasInserted) {
+ return;
+ }
+
+ // Remember our own size before anything changes
+ var elt = this.$();
+ this._cachedSize = (0, _ghostComponentsLiquidMeasured.measure)(elt);
+
+ // And make any children absolutely positioned with fixed sizes.
+ for (var i = 0; i < versions.length; i++) {
+ goAbsolute(versions[i]);
+ }
+
+ // Apply '.liquid-animating' to liquid-container allowing
+ // any customizable CSS control while an animating is occuring
+ this.updateAnimatingClass(true);
+ },
+
+ afterChildInsertion: function afterChildInsertion(versions) {
+ var elt = this.$();
+ var enableGrowth = this.get('enableGrowth') !== false;
+
+ // Measure children
+ var sizes = [];
+ for (var i = 0; i < versions.length; i++) {
+ if (versions[i].view) {
+ sizes[i] = (0, _ghostComponentsLiquidMeasured.measure)(versions[i].view.$());
+ }
+ }
+
+ // Measure ourself again to see how big the new children make
+ // us.
+ var want = (0, _ghostComponentsLiquidMeasured.measure)(elt);
+ var have = this._cachedSize || want;
+
+ // Make ourself absolute
+ if (enableGrowth) {
+ this.lockSize(elt, have);
+ } else {
+ this.lockSize(elt, {
+ height: Math.max(want.height, have.height),
+ width: Math.max(want.width, have.width)
+ });
+ }
+
+ // Make the children absolute and fixed size.
+ for (i = 0; i < versions.length; i++) {
+ goAbsolute(versions[i], sizes[i]);
+ }
+
+ // Kick off our growth animation
+ if (enableGrowth) {
+ this._scaling = this.animateGrowth(elt, have, want);
+ }
+ },
+
+ afterTransition: function afterTransition(versions) {
+ for (var i = 0; i < versions.length; i++) {
+ goStatic(versions[i]);
+ }
+ this.unlockSize();
+ }
}
});
+
+ function goAbsolute(version, size) {
+ if (!version.view) {
+ return;
+ }
+ var elt = version.view.$();
+ var pos = elt.position();
+ if (!size) {
+ size = (0, _ghostComponentsLiquidMeasured.measure)(elt);
+ }
+ elt.outerWidth(size.width);
+ elt.outerHeight(size.height);
+ elt.css({
+ position: 'absolute',
+ top: pos.top,
+ left: pos.left
+ });
+ }
+
+ function goStatic(version) {
+ if (version.view && !version.view.isDestroyed) {
+ version.view.$().css({ width: '', height: '', position: '' });
+ }
+ }
});
-define("ghost-admin/components/liquid-if", ["exports", "liquid-fire/components/liquid-if"], function (exports, _liquidFireComponentsLiquidIf) {
- Object.defineProperty(exports, "default", {
- enumerable: true,
- get: function get() {
- return _liquidFireComponentsLiquidIf["default"];
+define('ghost/components/liquid-if', ['exports', 'ember', 'liquid-fire/ember-internals'], function (exports, _ember, _liquidFireEmberInternals) {
+
+ var LiquidIf = _ember['default'].Component.extend({
+ positionalParams: ['predicate'], // needed for Ember 1.13.[0-5] and 2.0.0-beta.[1-3] support
+ tagName: '',
+ helperName: 'liquid-if',
+ didReceiveAttrs: function didReceiveAttrs() {
+ this._super();
+ var predicate = (0, _liquidFireEmberInternals.shouldDisplay)(this.getAttr('predicate'));
+ this.set('showFirstBlock', this.inverted ? !predicate : predicate);
}
});
+
+ LiquidIf.reopenClass({
+ positionalParams: ['predicate']
+ });
+
+ exports['default'] = LiquidIf;
});
-define("ghost-admin/components/liquid-measured", ["exports", "liquid-fire/components/liquid-measured"], function (exports, _liquidFireComponentsLiquidMeasured) {
+define("ghost/components/liquid-measured", ["exports", "liquid-fire/components/liquid-measured"], function (exports, _liquidFireComponentsLiquidMeasured) {
Object.defineProperty(exports, "default", {
enumerable: true,
get: function get() {
@@ -3621,23 +3684,125 @@ define("ghost-admin/components/liquid-measured", ["exports", "liquid-fire/compon
}
});
});
-define("ghost-admin/components/liquid-modal", ["exports", "liquid-fire/components/liquid-modal"], function (exports, _liquidFireComponentsLiquidModal) {
- Object.defineProperty(exports, "default", {
- enumerable: true,
- get: function get() {
- return _liquidFireComponentsLiquidModal["default"];
+define('ghost/components/liquid-modal', ['exports', 'ember', 'ember-getowner-polyfill'], function (exports, _ember, _emberGetownerPolyfill) {
+ function _instanceof(left, right) { if (right != null && right[Symbol.hasInstance]) { return right[Symbol.hasInstance](left); } else { return left instanceof right; } }
+
+ exports['default'] = _ember['default'].Component.extend({
+ classNames: ['liquid-modal'],
+ currentContext: _ember['default'].computed('owner.modalContexts.lastObject', function () {
+ var context = this.get('owner.modalContexts.lastObject');
+ if (context) {
+ context.view = this.innerView(context);
+ }
+ return context;
+ }),
+
+ owner: _ember['default'].inject.service('liquid-fire-modals'),
+
+ innerView: function innerView(current) {
+ var self = this,
+ name = current.get('name'),
+ owner = (0, _emberGetownerPolyfill['default'])(this),
+ component = owner.lookup('component-lookup:main').lookupFactory(name);
+ _ember['default'].assert("Tried to render a modal using component '" + name + "', but couldn't find it.", !!component);
+
+ var args = _ember['default'].copy(current.get('params'));
+
+ args.registerMyself = _ember['default'].on('init', function () {
+ self.set('innerViewInstance', this);
+ });
+
+ // set source so we can bind other params to it
+ args._source = _ember['default'].computed(function () {
+ return current.get("source");
+ });
+
+ var otherParams = current.get("options.otherParams");
+ var from, to;
+ for (from in otherParams) {
+ to = otherParams[from];
+ args[to] = _ember['default'].computed.alias("_source." + from);
+ }
+
+ var actions = current.get("options.actions") || {};
+
+ // Override sendAction in the modal component so we can intercept and
+ // dynamically dispatch to the controller as expected
+ args.sendAction = function (name) {
+ var actionName = actions[name];
+ if (!actionName) {
+ this._super.apply(this, Array.prototype.slice.call(arguments));
+ return;
+ }
+
+ var controller = current.get("source");
+ var args = Array.prototype.slice.call(arguments, 1);
+ args.unshift(actionName);
+ controller.send.apply(controller, args);
+ };
+
+ return component.extend(args);
+ },
+
+ actions: {
+ outsideClick: function outsideClick() {
+ if (this.get('currentContext.options.dismissWithOutsideClick')) {
+ this.send('dismiss');
+ } else {
+ proxyToInnerInstance(this, 'outsideClick');
+ }
+ },
+ escape: function escape() {
+ if (this.get('currentContext.options.dismissWithEscape')) {
+ this.send('dismiss');
+ } else {
+ proxyToInnerInstance(this, 'escape');
+ }
+ },
+ dismiss: function dismiss() {
+ _ember['default'].$('body').addClass('lf-modal-closing');
+ var source = this.get('currentContext.source'),
+ proto = source.constructor.proto(),
+ params = this.get('currentContext.options.withParams'),
+ clearThem = {};
+
+ for (var key in params) {
+ if (_instanceof(proto[key], _ember['default'].ComputedProperty)) {
+ clearThem[key] = undefined;
+ } else {
+ clearThem[key] = proto[key];
+ }
+ }
+ source.setProperties(clearThem);
+ }
}
});
+
+ function proxyToInnerInstance(self, message) {
+ var vi = self.get('innerViewInstance');
+ if (vi) {
+ vi.send(message);
+ }
+ }
});
-define("ghost-admin/components/liquid-outlet", ["exports", "liquid-fire/components/liquid-outlet"], function (exports, _liquidFireComponentsLiquidOutlet) {
- Object.defineProperty(exports, "default", {
- enumerable: true,
- get: function get() {
- return _liquidFireComponentsLiquidOutlet["default"];
+define('ghost/components/liquid-outlet', ['exports', 'ember'], function (exports, _ember) {
+
+ var LiquidOutlet = _ember['default'].Component.extend({
+ positionalParams: ['inputOutletName'], // needed for Ember 1.13.[0-5] and 2.0.0-beta.[1-3] support
+ tagName: '',
+ didReceiveAttrs: function didReceiveAttrs() {
+ this._super();
+ this.set('outletName', this.attrs.inputOutletName || 'main');
}
});
+
+ LiquidOutlet.reopenClass({
+ positionalParams: ['inputOutletName']
+ });
+
+ exports['default'] = LiquidOutlet;
});
-define("ghost-admin/components/liquid-spacer", ["exports", "liquid-fire/components/liquid-spacer"], function (exports, _liquidFireComponentsLiquidSpacer) {
+define("ghost/components/liquid-spacer", ["exports", "liquid-fire/components/liquid-spacer"], function (exports, _liquidFireComponentsLiquidSpacer) {
Object.defineProperty(exports, "default", {
enumerable: true,
get: function get() {
@@ -3645,15 +3810,7 @@ define("ghost-admin/components/liquid-spacer", ["exports", "liquid-fire/componen
}
});
});
-define('ghost-admin/components/liquid-sync', ['exports', 'liquid-fire/components/liquid-sync'], function (exports, _liquidFireComponentsLiquidSync) {
- Object.defineProperty(exports, 'default', {
- enumerable: true,
- get: function get() {
- return _liquidFireComponentsLiquidSync['default'];
- }
- });
-});
-define('ghost-admin/components/liquid-target-container', ['exports', 'liquid-wormhole/components/liquid-target-container'], function (exports, _liquidWormholeComponentsLiquidTargetContainer) {
+define('ghost/components/liquid-target-container', ['exports', 'liquid-wormhole/components/liquid-target-container'], function (exports, _liquidWormholeComponentsLiquidTargetContainer) {
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
@@ -3661,7 +3818,7 @@ define('ghost-admin/components/liquid-target-container', ['exports', 'liquid-wor
}
});
});
-define('ghost-admin/components/liquid-target', ['exports', 'liquid-wormhole/components/liquid-target'], function (exports, _liquidWormholeComponentsLiquidTarget) {
+define('ghost/components/liquid-target', ['exports', 'liquid-wormhole/components/liquid-target'], function (exports, _liquidWormholeComponentsLiquidTarget) {
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
@@ -3669,7 +3826,7 @@ define('ghost-admin/components/liquid-target', ['exports', 'liquid-wormhole/comp
}
});
});
-define('ghost-admin/components/liquid-tether', ['exports', 'liquid-tether/components/liquid-tether'], function (exports, _liquidTetherComponentsLiquidTether) {
+define('ghost/components/liquid-tether', ['exports', 'liquid-tether/components/liquid-tether'], function (exports, _liquidTetherComponentsLiquidTether) {
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
@@ -3677,23 +3834,150 @@ define('ghost-admin/components/liquid-tether', ['exports', 'liquid-tether/compon
}
});
});
-define("ghost-admin/components/liquid-unless", ["exports", "liquid-fire/components/liquid-unless"], function (exports, _liquidFireComponentsLiquidUnless) {
- Object.defineProperty(exports, "default", {
- enumerable: true,
- get: function get() {
- return _liquidFireComponentsLiquidUnless["default"];
- }
+define('ghost/components/liquid-unless', ['exports', 'ghost/components/liquid-if'], function (exports, _ghostComponentsLiquidIf) {
+ exports['default'] = _ghostComponentsLiquidIf['default'].extend({
+ helperName: 'liquid-unless',
+ layoutName: 'components/liquid-if',
+ inverted: true
});
});
-define("ghost-admin/components/liquid-versions", ["exports", "liquid-fire/components/liquid-versions"], function (exports, _liquidFireComponentsLiquidVersions) {
- Object.defineProperty(exports, "default", {
- enumerable: true,
- get: function get() {
- return _liquidFireComponentsLiquidVersions["default"];
+define("ghost/components/liquid-versions", ["exports", "ember", "liquid-fire/ember-internals"], function (exports, _ember, _liquidFireEmberInternals) {
+
+ var get = _ember["default"].get;
+ var set = _ember["default"].set;
+
+ exports["default"] = _ember["default"].Component.extend({
+ tagName: "",
+ name: 'liquid-versions',
+
+ transitionMap: _ember["default"].inject.service('liquid-fire-transitions'),
+
+ didReceiveAttrs: function didReceiveAttrs() {
+ this._super();
+ if (!this.versions || this._lastVersion !== this.getAttr('value')) {
+ this.appendVersion();
+ this._lastVersion = this.getAttr('value');
+ }
+ },
+
+ appendVersion: function appendVersion() {
+ var versions = this.versions;
+ var firstTime = false;
+ var newValue = this.getAttr('value');
+ var oldValue;
+
+ if (!versions) {
+ firstTime = true;
+ versions = _ember["default"].A();
+ } else {
+ oldValue = versions[0];
+ }
+
+ // TODO: may need to extend the comparison to do the same kind of
+ // key-based diffing that htmlbars is doing.
+ if (!firstTime && (!oldValue && !newValue || oldValue === newValue)) {
+ return;
+ }
+
+ this.notifyContainer('willTransition', versions);
+ var newVersion = {
+ value: newValue,
+ shouldRender: newValue || get(this, 'renderWhenFalse')
+ };
+ versions.unshiftObject(newVersion);
+
+ this.firstTime = firstTime;
+ if (firstTime) {
+ set(this, 'versions', versions);
+ }
+
+ if (!newVersion.shouldRender && !firstTime) {
+ this._transition();
+ }
+ },
+
+ _transition: function _transition() {
+ var _this = this;
+
+ var versions = get(this, 'versions');
+ var transition;
+ var firstTime = this.firstTime;
+ this.firstTime = false;
+
+ this.notifyContainer('afterChildInsertion', versions);
+
+ transition = get(this, 'transitionMap').transitionFor({
+ versions: versions,
+ parentElement: _ember["default"].$((0, _liquidFireEmberInternals.containingElement)(this)),
+ use: get(this, 'use'),
+ // Using strings instead of booleans here is an
+ // optimization. The constraint system can match them more
+ // efficiently, since it treats boolean constraints as generic
+ // "match anything truthy/falsy" predicates, whereas string
+ // checks are a direct object property lookup.
+ firstTime: firstTime ? 'yes' : 'no',
+ helperName: get(this, 'name'),
+ outletName: get(this, 'outletName')
+ });
+
+ if (this._runningTransition) {
+ this._runningTransition.interrupt();
+ }
+ this._runningTransition = transition;
+
+ transition.run().then(function (wasInterrupted) {
+ // if we were interrupted, we don't handle the cleanup because
+ // another transition has already taken over.
+ if (!wasInterrupted) {
+ _this.finalizeVersions(versions);
+ _this.notifyContainer("afterTransition", versions);
+ }
+ }, function (err) {
+ _this.finalizeVersions(versions);
+ _this.notifyContainer("afterTransition", versions);
+ throw err;
+ });
+ },
+
+ finalizeVersions: function finalizeVersions(versions) {
+ versions.replace(1, versions.length - 1);
+ },
+
+ notifyContainer: function notifyContainer(method, versions) {
+ var target = get(this, 'notify');
+ if (target) {
+ target.send(method, versions);
+ }
+ },
+
+ actions: {
+ childDidRender: function childDidRender(child) {
+ var version = get(child, 'version');
+ set(version, 'view', child);
+ this._transition();
+ }
}
+
+ });
+});
+define('ghost/components/liquid-with', ['exports', 'ember'], function (exports, _ember) {
+
+ var LiquidWith = _ember['default'].Component.extend({
+ name: 'liquid-with',
+ positionalParams: ['value'], // needed for Ember 1.13.[0-5] and 2.0.0-beta.[1-3] support
+ tagName: '',
+ iAmDeprecated: _ember['default'].on('init', function () {
+ _ember['default'].deprecate("liquid-with is deprecated, use liquid-bind instead -- it accepts a block now.");
+ })
});
+
+ LiquidWith.reopenClass({
+ positionalParams: ['value']
+ });
+
+ exports['default'] = LiquidWith;
});
-define('ghost-admin/components/liquid-wormhole', ['exports', 'liquid-wormhole/components/liquid-wormhole'], function (exports, _liquidWormholeComponentsLiquidWormhole) {
+define('ghost/components/liquid-wormhole', ['exports', 'liquid-wormhole/components/liquid-wormhole'], function (exports, _liquidWormholeComponentsLiquidWormhole) {
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
@@ -3701,15 +3985,99 @@ define('ghost-admin/components/liquid-wormhole', ['exports', 'liquid-wormhole/co
}
});
});
-define("ghost-admin/components/lm-container", ["exports", "liquid-fire/components/lm-container"], function (exports, _liquidFireComponentsLmContainer) {
- Object.defineProperty(exports, "default", {
- enumerable: true,
- get: function get() {
- return _liquidFireComponentsLmContainer["default"];
+define("ghost/components/lm-container", ["exports", "ember", "liquid-fire/tabbable", "liquid-fire/is-browser"], function (exports, _ember, _liquidFireTabbable, _liquidFireIsBrowser) {
+
+ /**
+ * If you do something to move focus outside of the browser (like
+ * command+l to go to the address bar) and then tab back into the
+ * window, capture it and focus the first tabbable element in an active
+ * modal.
+ */
+ var lastOpenedModal = null;
+
+ if ((0, _liquidFireIsBrowser["default"])()) {
+ _ember["default"].$(document).on('focusin', handleTabIntoBrowser);
+ }
+
+ function handleTabIntoBrowser() {
+ if (lastOpenedModal) {
+ lastOpenedModal.focus();
+ }
+ }
+
+ exports["default"] = _ember["default"].Component.extend({
+ classNames: ['lm-container'],
+ attributeBindings: ['tabindex'],
+ tabindex: 0,
+
+ keyUp: function keyUp(event) {
+ // Escape key
+ if (event.keyCode === 27) {
+ this.sendAction();
+ }
+ },
+
+ keyDown: function keyDown(event) {
+ // Tab key
+ if (event.keyCode === 9) {
+ this.constrainTabNavigation(event);
+ }
+ },
+
+ didInsertElement: function didInsertElement() {
+ this.focus();
+ lastOpenedModal = this;
+ },
+
+ willDestroy: function willDestroy() {
+ lastOpenedModal = null;
+ },
+
+ focus: function focus() {
+ if (this.get('element').contains(document.activeElement)) {
+ // just let it be if we already contain the activeElement
+ return;
+ }
+ var target = this.$('[autofocus]');
+ if (!target.length) {
+ target = this.$(':tabbable');
+ }
+
+ if (!target.length) {
+ target = this.$();
+ }
+
+ target[0].focus();
+ },
+
+ constrainTabNavigation: function constrainTabNavigation(event) {
+ var tabbable = this.$(':tabbable');
+ var finalTabbable = tabbable[event.shiftKey ? 'first' : 'last']()[0];
+ var leavingFinalTabbable = finalTabbable === document.activeElement ||
+ // handle immediate shift+tab after opening with mouse
+ this.get('element') === document.activeElement;
+ if (!leavingFinalTabbable) {
+ return;
+ }
+ event.preventDefault();
+ tabbable[event.shiftKey ? 'last' : 'first']()[0].focus();
+ },
+
+ click: function click(event) {
+ if (event.target === this.get('element')) {
+ this.sendAction('clickAway');
+ }
}
});
});
-define('ghost-admin/components/lt-body', ['exports', 'ember-light-table/components/lt-body'], function (exports, _emberLightTableComponentsLtBody) {
+/*
+ Parts of this file were adapted from ic-modal
+
+ https://github.com/instructure/ic-modal
+ Released under The MIT License (MIT)
+ Copyright (c) 2014 Instructure, Inc.
+*/
+define('ghost/components/lt-body', ['exports', 'ember-light-table/components/lt-body'], function (exports, _emberLightTableComponentsLtBody) {
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
@@ -3717,7 +4085,7 @@ define('ghost-admin/components/lt-body', ['exports', 'ember-light-table/componen
}
});
});
-define('ghost-admin/components/lt-cell', ['exports', 'ember-light-table/components/lt-cell'], function (exports, _emberLightTableComponentsLtCell) {
+define('ghost/components/lt-cell', ['exports', 'ember-light-table/components/lt-cell'], function (exports, _emberLightTableComponentsLtCell) {
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
@@ -3725,7 +4093,7 @@ define('ghost-admin/components/lt-cell', ['exports', 'ember-light-table/componen
}
});
});
-define('ghost-admin/components/lt-column', ['exports', 'ember-light-table/components/lt-column'], function (exports, _emberLightTableComponentsLtColumn) {
+define('ghost/components/lt-column', ['exports', 'ember-light-table/components/lt-column'], function (exports, _emberLightTableComponentsLtColumn) {
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
@@ -3733,7 +4101,7 @@ define('ghost-admin/components/lt-column', ['exports', 'ember-light-table/compon
}
});
});
-define('ghost-admin/components/lt-foot', ['exports', 'ember-light-table/components/lt-foot'], function (exports, _emberLightTableComponentsLtFoot) {
+define('ghost/components/lt-foot', ['exports', 'ember-light-table/components/lt-foot'], function (exports, _emberLightTableComponentsLtFoot) {
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
@@ -3741,7 +4109,7 @@ define('ghost-admin/components/lt-foot', ['exports', 'ember-light-table/componen
}
});
});
-define('ghost-admin/components/lt-head', ['exports', 'ember-light-table/components/lt-head'], function (exports, _emberLightTableComponentsLtHead) {
+define('ghost/components/lt-head', ['exports', 'ember-light-table/components/lt-head'], function (exports, _emberLightTableComponentsLtHead) {
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
@@ -3749,7 +4117,7 @@ define('ghost-admin/components/lt-head', ['exports', 'ember-light-table/componen
}
});
});
-define('ghost-admin/components/lt-row', ['exports', 'ember-light-table/components/lt-row'], function (exports, _emberLightTableComponentsLtRow) {
+define('ghost/components/lt-row', ['exports', 'ember-light-table/components/lt-row'], function (exports, _emberLightTableComponentsLtRow) {
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
@@ -3757,7 +4125,7 @@ define('ghost-admin/components/lt-row', ['exports', 'ember-light-table/component
}
});
});
-define('ghost-admin/components/lt-spanned-row', ['exports', 'ember-light-table/components/lt-spanned-row'], function (exports, _emberLightTableComponentsLtSpannedRow) {
+define('ghost/components/lt-spanned-row', ['exports', 'ember-light-table/components/lt-spanned-row'], function (exports, _emberLightTableComponentsLtSpannedRow) {
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
@@ -3765,8 +4133,10 @@ define('ghost-admin/components/lt-spanned-row', ['exports', 'ember-light-table/c
}
});
});
-define('ghost-admin/components/modals/base', ['exports', 'ember-component', 'ember-runloop', 'ember-invoke-action'], function (exports, _emberComponent, _emberRunloop, _emberInvokeAction) {
- exports['default'] = _emberComponent['default'].extend({
+define('ghost/components/modals/base', ['exports', 'ember', 'ember-invoke-action'], function (exports, _ember, _emberInvokeAction) {
+ var Component = _ember['default'].Component;
+ var run = _ember['default'].run;
+ exports['default'] = Component.extend({
tagName: 'section',
classNames: 'modal-content',
@@ -3775,7 +4145,7 @@ define('ghost-admin/components/modals/base', ['exports', 'ember-component', 'emb
_setupShortcuts: function _setupShortcuts() {
var _this = this;
- (0, _emberRunloop['default'])(function () {
+ run(function () {
document.activeElement.blur();
});
this._previousKeymasterScope = key.getScope();
@@ -3820,20 +4190,23 @@ define('ghost-admin/components/modals/base', ['exports', 'ember-component', 'emb
});
});
/* global key */
-define('ghost-admin/components/modals/copy-html', ['exports', 'ember-computed', 'ghost-admin/components/modals/base'], function (exports, _emberComputed, _ghostAdminComponentsModalsBase) {
- exports['default'] = _ghostAdminComponentsModalsBase['default'].extend({
- generatedHtml: (0, _emberComputed.alias)('model')
+define('ghost/components/modals/copy-html', ['exports', 'ember', 'ghost/components/modals/base'], function (exports, _ember, _ghostComponentsModalsBase) {
+ var computed = _ember['default'].computed;
+ var alias = computed.alias;
+ exports['default'] = _ghostComponentsModalsBase['default'].extend({
+ generatedHtml: alias('model')
});
});
-define('ghost-admin/components/modals/delete-all', ['exports', 'ember-service/inject', 'ghost-admin/components/modals/base'], function (exports, _emberServiceInject, _ghostAdminComponentsModalsBase) {
- exports['default'] = _ghostAdminComponentsModalsBase['default'].extend({
+define('ghost/components/modals/delete-all', ['exports', 'ember', 'ghost/components/modals/base'], function (exports, _ember, _ghostComponentsModalsBase) {
+ var service = _ember['default'].inject.service;
+ exports['default'] = _ghostComponentsModalsBase['default'].extend({
submitting: false,
- ghostPaths: (0, _emberServiceInject['default'])(),
- notifications: (0, _emberServiceInject['default'])(),
- store: (0, _emberServiceInject['default'])(),
- ajax: (0, _emberServiceInject['default'])(),
+ ghostPaths: service(),
+ notifications: service(),
+ store: service(),
+ ajax: service(),
_deleteAll: function _deleteAll() {
var deleteUrl = this.get('ghostPaths.url').api('db');
@@ -3871,15 +4244,18 @@ define('ghost-admin/components/modals/delete-all', ['exports', 'ember-service/in
}
});
});
-define('ghost-admin/components/modals/delete-post', ['exports', 'ember-computed', 'ember-service/inject', 'ghost-admin/components/modals/base'], function (exports, _emberComputed, _emberServiceInject, _ghostAdminComponentsModalsBase) {
- exports['default'] = _ghostAdminComponentsModalsBase['default'].extend({
+define('ghost/components/modals/delete-post', ['exports', 'ember', 'ghost/components/modals/base'], function (exports, _ember, _ghostComponentsModalsBase) {
+ var computed = _ember['default'].computed;
+ var service = _ember['default'].inject.service;
+ var alias = computed.alias;
+ exports['default'] = _ghostComponentsModalsBase['default'].extend({
submitting: false,
- post: (0, _emberComputed.alias)('model'),
+ post: alias('model'),
- notifications: (0, _emberServiceInject['default'])(),
- routing: (0, _emberServiceInject['default'])('-routing'),
+ notifications: service(),
+ routing: service('-routing'),
_deletePost: function _deletePost() {
var post = this.get('post');
@@ -3899,8 +4275,8 @@ define('ghost-admin/components/modals/delete-post', ['exports', 'ember-computed'
this.get('routing').transitionTo('posts');
},
- _failure: function _failure(error) {
- this.get('notifications').showAPIError(error, { key: 'post.delete.failed' });
+ _failure: function _failure() {
+ this.get('notifications').showAlert('Your post could not be deleted. Please try again.', { type: 'error', key: 'post.delete.failed' });
},
actions: {
@@ -3911,8 +4287,8 @@ define('ghost-admin/components/modals/delete-post', ['exports', 'ember-computed'
this._deletePost().then(function () {
_this._success();
- }, function (error) {
- _this._failure(error);
+ }, function () {
+ _this._failure();
})['finally'](function () {
_this.send('closeModal');
});
@@ -3920,12 +4296,14 @@ define('ghost-admin/components/modals/delete-post', ['exports', 'ember-computed'
}
});
});
-define('ghost-admin/components/modals/delete-subscriber', ['exports', 'ember-computed', 'ghost-admin/components/modals/base', 'ember-invoke-action'], function (exports, _emberComputed, _ghostAdminComponentsModalsBase, _emberInvokeAction) {
- exports['default'] = _ghostAdminComponentsModalsBase['default'].extend({
+define('ghost/components/modals/delete-subscriber', ['exports', 'ember', 'ghost/components/modals/base', 'ember-invoke-action'], function (exports, _ember, _ghostComponentsModalsBase, _emberInvokeAction) {
+ var computed = _ember['default'].computed;
+ var alias = computed.alias;
+ exports['default'] = _ghostComponentsModalsBase['default'].extend({
submitting: false,
- subscriber: (0, _emberComputed.alias)('model'),
+ subscriber: alias('model'),
actions: {
confirm: function confirm() {
@@ -3940,14 +4318,16 @@ define('ghost-admin/components/modals/delete-subscriber', ['exports', 'ember-com
}
});
});
-define('ghost-admin/components/modals/delete-tag', ['exports', 'ember-computed', 'ghost-admin/components/modals/base', 'ember-invoke-action'], function (exports, _emberComputed, _ghostAdminComponentsModalsBase, _emberInvokeAction) {
- exports['default'] = _ghostAdminComponentsModalsBase['default'].extend({
+define('ghost/components/modals/delete-tag', ['exports', 'ember', 'ghost/components/modals/base', 'ember-invoke-action'], function (exports, _ember, _ghostComponentsModalsBase, _emberInvokeAction) {
+ var computed = _ember['default'].computed;
+ var alias = computed.alias;
+ exports['default'] = _ghostComponentsModalsBase['default'].extend({
submitting: false,
- tag: (0, _emberComputed.alias)('model'),
+ tag: alias('model'),
- postInflection: (0, _emberComputed['default'])('tag.count.posts', function () {
+ postInflection: computed('tag.count.posts', function () {
return this.get('tag.count.posts') > 1 ? 'posts' : 'post';
}),
@@ -3964,8 +4344,8 @@ define('ghost-admin/components/modals/delete-tag', ['exports', 'ember-computed',
}
});
});
-define('ghost-admin/components/modals/delete-user', ['exports', 'ghost-admin/components/modals/base', 'ember-invoke-action'], function (exports, _ghostAdminComponentsModalsBase, _emberInvokeAction) {
- exports['default'] = _ghostAdminComponentsModalsBase['default'].extend({
+define('ghost/components/modals/delete-user', ['exports', 'ghost/components/modals/base', 'ember-invoke-action'], function (exports, _ghostComponentsModalsBase, _emberInvokeAction) {
+ exports['default'] = _ghostComponentsModalsBase['default'].extend({
submitting: false,
@@ -3984,15 +4364,16 @@ define('ghost-admin/components/modals/delete-user', ['exports', 'ghost-admin/com
}
});
});
-define('ghost-admin/components/modals/import-subscribers', ['exports', 'ember-computed', 'ember-invoke-action', 'ghost-admin/components/modals/base', 'ghost-admin/utils/ghost-paths'], function (exports, _emberComputed, _emberInvokeAction, _ghostAdminComponentsModalsBase, _ghostAdminUtilsGhostPaths) {
- exports['default'] = _ghostAdminComponentsModalsBase['default'].extend({
+define('ghost/components/modals/import-subscribers', ['exports', 'ember', 'ember-invoke-action', 'ghost/components/modals/base', 'ghost/utils/ghost-paths'], function (exports, _ember, _emberInvokeAction, _ghostComponentsModalsBase, _ghostUtilsGhostPaths) {
+ var computed = _ember['default'].computed;
+ exports['default'] = _ghostComponentsModalsBase['default'].extend({
labelText: 'Select or drag-and-drop a CSV File',
response: null,
closeDisabled: false,
- uploadUrl: (0, _emberComputed['default'])(function () {
- return (0, _ghostAdminUtilsGhostPaths['default'])().apiRoot + '/subscribers/csv/';
+ uploadUrl: computed(function () {
+ return (0, _ghostUtilsGhostPaths['default'])().apiRoot + '/subscribers/csv/';
}),
actions: {
@@ -4022,9 +4403,14 @@ define('ghost-admin/components/modals/import-subscribers', ['exports', 'ember-co
}
});
});
-define('ghost-admin/components/modals/invite-new-user', ['exports', 'rsvp', 'ember-service/inject', 'ember-array/utils', 'ember-runloop', 'ghost-admin/components/modals/base', 'ghost-admin/mixins/validation-engine'], function (exports, _rsvp, _emberServiceInject, _emberArrayUtils, _emberRunloop, _ghostAdminComponentsModalsBase, _ghostAdminMixinsValidationEngine) {
- var Promise = _rsvp['default'].Promise;
- exports['default'] = _ghostAdminComponentsModalsBase['default'].extend(_ghostAdminMixinsValidationEngine['default'], {
+define('ghost/components/modals/invite-new-user', ['exports', 'ember', 'ghost/components/modals/base', 'ghost/mixins/validation-engine'], function (exports, _ember, _ghostComponentsModalsBase, _ghostMixinsValidationEngine) {
+ var Promise = _ember['default'].RSVP.Promise;
+ var service = _ember['default'].inject.service;
+ var run = _ember['default'].run;
+
+ var emberA = _ember['default'].A;
+
+ exports['default'] = _ghostComponentsModalsBase['default'].extend(_ghostMixinsValidationEngine['default'], {
classNames: 'modal-content invite-new-user',
role: null,
@@ -4034,14 +4420,14 @@ define('ghost-admin/components/modals/invite-new-user', ['exports', 'rsvp', 'emb
validationType: 'inviteUser',
- notifications: (0, _emberServiceInject['default'])(),
- store: (0, _emberServiceInject['default'])(),
+ notifications: service(),
+ store: service(),
init: function init() {
this._super.apply(this, arguments);
// populate roles and set initial value for the dropdown
- _emberRunloop['default'].schedule('afterRender', this, function () {
+ run.schedule('afterRender', this, function () {
var _this = this;
this.get('store').query('role', { permissions: 'assign' }).then(function (roles) {
@@ -4062,7 +4448,7 @@ define('ghost-admin/components/modals/invite-new-user', ['exports', 'rsvp', 'emb
// TODO: this should not be needed, ValidationEngine acts as a
// singleton and so it's errors and hasValidated state stick around
this.get('errors').clear();
- this.set('hasValidated', (0, _emberArrayUtils.A)());
+ this.set('hasValidated', emberA());
},
validate: function validate() {
@@ -4134,9 +4520,9 @@ define('ghost-admin/components/modals/invite-new-user', ['exports', 'rsvp', 'emb
} else {
notifications.showNotification(notificationText, { key: 'invite.send.success' });
}
- })['catch'](function (error) {
+ })['catch'](function (errors) {
newUser.deleteRecord();
- notifications.showAPIError(error, { key: 'invite.send' });
+ notifications.showErrors(errors, { key: 'invite.send' });
})['finally'](function () {
_this3.send('closeModal');
});
@@ -4145,8 +4531,8 @@ define('ghost-admin/components/modals/invite-new-user', ['exports', 'rsvp', 'emb
}
});
});
-define('ghost-admin/components/modals/leave-editor', ['exports', 'ghost-admin/components/modals/base', 'ember-invoke-action'], function (exports, _ghostAdminComponentsModalsBase, _emberInvokeAction) {
- exports['default'] = _ghostAdminComponentsModalsBase['default'].extend({
+define('ghost/components/modals/leave-editor', ['exports', 'ghost/components/modals/base', 'ember-invoke-action'], function (exports, _ghostComponentsModalsBase, _emberInvokeAction) {
+ exports['default'] = _ghostComponentsModalsBase['default'].extend({
actions: {
confirm: function confirm() {
var _this = this;
@@ -4158,17 +4544,17 @@ define('ghost-admin/components/modals/leave-editor', ['exports', 'ghost-admin/co
}
});
});
-define('ghost-admin/components/modals/markdown-help', ['exports', 'ghost-admin/components/modals/base'], function (exports, _ghostAdminComponentsModalsBase) {
- exports['default'] = _ghostAdminComponentsModalsBase['default'].extend({});
+define('ghost/components/modals/markdown-help', ['exports', 'ghost/components/modals/base'], function (exports, _ghostComponentsModalsBase) {
+ exports['default'] = _ghostComponentsModalsBase['default'].extend({});
});
-define('ghost-admin/components/modals/new-subscriber', ['exports', 'ember-array/utils', 'ghost-admin/components/modals/base'], function (exports, _emberArrayUtils, _ghostAdminComponentsModalsBase) {
+define('ghost/components/modals/new-subscriber', ['exports', 'ember', 'ghost/components/modals/base'], function (exports, _ember, _ghostComponentsModalsBase) {
var _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i['return']) _i['return'](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError('Invalid attempt to destructure non-iterable instance'); } }; })();
- exports['default'] = _ghostAdminComponentsModalsBase['default'].extend({
+ exports['default'] = _ghostComponentsModalsBase['default'].extend({
actions: {
updateEmail: function updateEmail(newEmail) {
this.set('model.email', newEmail);
- this.set('model.hasValidated', (0, _emberArrayUtils.A)());
+ this.set('model.hasValidated', _ember['default'].A());
this.get('model.errors').clear();
},
@@ -4181,29 +4567,15 @@ define('ghost-admin/components/modals/new-subscriber', ['exports', 'ember-array/
confirmAction().then(function () {
_this.send('closeModal');
- })['catch'](function (error) {
- // TODO: server-side validation errors should be serialized
- // properly so that errors are added to the model's errors
- // property
- if (error && error.isAdapterError) {
- var _error$errors = _slicedToArray(error.errors, 1);
-
- var firstError = _error$errors[0];
- var message = firstError.message;
- var errorType = firstError.errorType;
-
- if (errorType === 'ValidationError') {
- if (message && message.match(/email/i)) {
- _this.get('model.errors').add('email', message);
- _this.get('model.hasValidated').pushObject('email');
- return;
- }
- }
- }
+ })['catch'](function (errors) {
+ var _errors = _slicedToArray(errors, 1);
+
+ var error = _errors[0];
- // this is a route action so it should bubble up to the global
- // error handler
- throw error;
+ if (error && error.match(/email/i)) {
+ _this.get('model.errors').add('email', error);
+ _this.get('model.hasValidated').pushObject('email');
+ }
})['finally'](function () {
if (!_this.get('isDestroying') && !_this.get('isDestroyed')) {
_this.set('submitting', false);
@@ -4213,17 +4585,20 @@ define('ghost-admin/components/modals/new-subscriber', ['exports', 'ember-array/
}
});
});
-define('ghost-admin/components/modals/re-authenticate', ['exports', 'jquery', 'ember-computed', 'ember-service/inject', 'ember-string', 'ghost-admin/components/modals/base', 'ghost-admin/mixins/validation-engine', 'ghost-admin/services/ajax'], function (exports, _jquery, _emberComputed, _emberServiceInject, _emberString, _ghostAdminComponentsModalsBase, _ghostAdminMixinsValidationEngine, _ghostAdminServicesAjax) {
- exports['default'] = _ghostAdminComponentsModalsBase['default'].extend(_ghostAdminMixinsValidationEngine['default'], {
+define('ghost/components/modals/re-authenticate', ['exports', 'ember', 'ghost/components/modals/base', 'ghost/mixins/validation-engine'], function (exports, _ember, _ghostComponentsModalsBase, _ghostMixinsValidationEngine) {
+ var $ = _ember['default'].$;
+ var computed = _ember['default'].computed;
+ var service = _ember['default'].inject.service;
+ exports['default'] = _ghostComponentsModalsBase['default'].extend(_ghostMixinsValidationEngine['default'], {
validationType: 'signin',
submitting: false,
authenticationError: null,
- notifications: (0, _emberServiceInject['default'])(),
- session: (0, _emberServiceInject['default'])(),
+ notifications: service(),
+ session: service(),
- identification: (0, _emberComputed['default'])('session.user.email', function () {
+ identification: computed('session.user.email', function () {
return this.get('session.user.email');
}),
@@ -4251,7 +4626,7 @@ define('ghost-admin/components/modals/re-authenticate', ['exports', 'jquery', 'e
// Manually trigger events for input fields, ensuring legacy compatibility with
// browsers and password managers that don't send proper events on autofill
- (0, _jquery['default'])('#login').find('input').trigger('change');
+ $('#login').find('input').trigger('change');
this.set('authenticationError', null);
@@ -4262,10 +4637,7 @@ define('ghost-admin/components/modals/re-authenticate', ['exports', 'jquery', 'e
})['catch'](function (error) {
if (error && error.errors) {
error.errors.forEach(function (err) {
- if ((0, _ghostAdminServicesAjax.isVersionMismatchError)(err)) {
- return _this2.get('notifications').showAPIError(error);
- }
- err.message = (0, _emberString.htmlSafe)(err.message);
+ err.message = _ember['default'].String.htmlSafe(err.message);
});
_this2.get('errors').add('password', 'Incorrect password');
@@ -4280,8 +4652,8 @@ define('ghost-admin/components/modals/re-authenticate', ['exports', 'jquery', 'e
}
});
});
-define('ghost-admin/components/modals/transfer-owner', ['exports', 'ghost-admin/components/modals/base', 'ember-invoke-action'], function (exports, _ghostAdminComponentsModalsBase, _emberInvokeAction) {
- exports['default'] = _ghostAdminComponentsModalsBase['default'].extend({
+define('ghost/components/modals/transfer-owner', ['exports', 'ghost/components/modals/base', 'ember-invoke-action'], function (exports, _ghostComponentsModalsBase, _emberInvokeAction) {
+ exports['default'] = _ghostComponentsModalsBase['default'].extend({
user: null,
submitting: false,
@@ -4298,18 +4670,21 @@ define('ghost-admin/components/modals/transfer-owner', ['exports', 'ghost-admin/
}
});
});
-define('ghost-admin/components/modals/upload-image', ['exports', 'ember-computed', 'ember-service/inject', 'ember-utils', 'ghost-admin/components/modals/base', 'ghost-admin/utils/caja-sanitizers'], function (exports, _emberComputed, _emberServiceInject, _emberUtils, _ghostAdminComponentsModalsBase, _ghostAdminUtilsCajaSanitizers) {
- exports['default'] = _ghostAdminComponentsModalsBase['default'].extend({
+define('ghost/components/modals/upload-image', ['exports', 'ember', 'ghost/components/modals/base', 'ghost/utils/caja-sanitizers'], function (exports, _ember, _ghostComponentsModalsBase, _ghostUtilsCajaSanitizers) {
+ var computed = _ember['default'].computed;
+ var service = _ember['default'].inject.service;
+ var isEmpty = _ember['default'].isEmpty;
+ exports['default'] = _ghostComponentsModalsBase['default'].extend({
model: null,
submitting: false,
url: '',
newUrl: '',
- config: (0, _emberServiceInject['default'])(),
- notifications: (0, _emberServiceInject['default'])(),
+ config: service(),
+ notifications: service(),
- image: (0, _emberComputed['default'])('model.model', 'model.imageProperty', {
+ image: computed('model.model', 'model.imageProperty', {
get: function get() {
var imageProperty = this.get('model.imageProperty');
@@ -4351,7 +4726,7 @@ define('ghost-admin/components/modals/upload-image', ['exports', 'ember-computed
},
_validateUrl: function _validateUrl(url) {
- if (!(0, _emberUtils.isEmpty)(url) && !_ghostAdminUtilsCajaSanitizers['default'].url(url)) {
+ if (!isEmpty(url) && !_ghostUtilsCajaSanitizers['default'].url(url)) {
this._setErrorState(true);
return { message: 'Image URI is not valid' };
}
@@ -4393,7 +4768,7 @@ define('ghost-admin/components/modals/upload-image', ['exports', 'ember-computed
}
});
});
-define('ghost-admin/components/one-way-checkbox', ['exports', 'ember-one-way-controls/components/one-way-checkbox'], function (exports, _emberOneWayControlsComponentsOneWayCheckbox) {
+define('ghost/components/one-way-checkbox', ['exports', 'ember-one-way-controls/components/one-way-checkbox'], function (exports, _emberOneWayControlsComponentsOneWayCheckbox) {
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
@@ -4401,55 +4776,7 @@ define('ghost-admin/components/one-way-checkbox', ['exports', 'ember-one-way-con
}
});
});
-define('ghost-admin/components/one-way-color', ['exports', 'ember-one-way-controls/components/one-way-color'], function (exports, _emberOneWayControlsComponentsOneWayColor) {
- Object.defineProperty(exports, 'default', {
- enumerable: true,
- get: function get() {
- return _emberOneWayControlsComponentsOneWayColor['default'];
- }
- });
-});
-define('ghost-admin/components/one-way-date', ['exports', 'ember-one-way-controls/components/one-way-date'], function (exports, _emberOneWayControlsComponentsOneWayDate) {
- Object.defineProperty(exports, 'default', {
- enumerable: true,
- get: function get() {
- return _emberOneWayControlsComponentsOneWayDate['default'];
- }
- });
-});
-define('ghost-admin/components/one-way-datetime-local', ['exports', 'ember-one-way-controls/components/one-way-datetime-local'], function (exports, _emberOneWayControlsComponentsOneWayDatetimeLocal) {
- Object.defineProperty(exports, 'default', {
- enumerable: true,
- get: function get() {
- return _emberOneWayControlsComponentsOneWayDatetimeLocal['default'];
- }
- });
-});
-define('ghost-admin/components/one-way-email', ['exports', 'ember-one-way-controls/components/one-way-email'], function (exports, _emberOneWayControlsComponentsOneWayEmail) {
- Object.defineProperty(exports, 'default', {
- enumerable: true,
- get: function get() {
- return _emberOneWayControlsComponentsOneWayEmail['default'];
- }
- });
-});
-define('ghost-admin/components/one-way-file', ['exports', 'ember-one-way-controls/components/one-way-file'], function (exports, _emberOneWayControlsComponentsOneWayFile) {
- Object.defineProperty(exports, 'default', {
- enumerable: true,
- get: function get() {
- return _emberOneWayControlsComponentsOneWayFile['default'];
- }
- });
-});
-define('ghost-admin/components/one-way-hidden', ['exports', 'ember-one-way-controls/components/one-way-hidden'], function (exports, _emberOneWayControlsComponentsOneWayHidden) {
- Object.defineProperty(exports, 'default', {
- enumerable: true,
- get: function get() {
- return _emberOneWayControlsComponentsOneWayHidden['default'];
- }
- });
-});
-define('ghost-admin/components/one-way-input', ['exports', 'ember-one-way-controls/components/one-way-input'], function (exports, _emberOneWayControlsComponentsOneWayInput) {
+define('ghost/components/one-way-input', ['exports', 'ember-one-way-controls/components/one-way-input'], function (exports, _emberOneWayControlsComponentsOneWayInput) {
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
@@ -4457,31 +4784,7 @@ define('ghost-admin/components/one-way-input', ['exports', 'ember-one-way-contro
}
});
});
-define('ghost-admin/components/one-way-month', ['exports', 'ember-one-way-controls/components/one-way-month'], function (exports, _emberOneWayControlsComponentsOneWayMonth) {
- Object.defineProperty(exports, 'default', {
- enumerable: true,
- get: function get() {
- return _emberOneWayControlsComponentsOneWayMonth['default'];
- }
- });
-});
-define('ghost-admin/components/one-way-number', ['exports', 'ember-one-way-controls/components/one-way-number'], function (exports, _emberOneWayControlsComponentsOneWayNumber) {
- Object.defineProperty(exports, 'default', {
- enumerable: true,
- get: function get() {
- return _emberOneWayControlsComponentsOneWayNumber['default'];
- }
- });
-});
-define('ghost-admin/components/one-way-password', ['exports', 'ember-one-way-controls/components/one-way-password'], function (exports, _emberOneWayControlsComponentsOneWayPassword) {
- Object.defineProperty(exports, 'default', {
- enumerable: true,
- get: function get() {
- return _emberOneWayControlsComponentsOneWayPassword['default'];
- }
- });
-});
-define('ghost-admin/components/one-way-radio', ['exports', 'ember-one-way-controls/components/one-way-radio'], function (exports, _emberOneWayControlsComponentsOneWayRadio) {
+define('ghost/components/one-way-radio', ['exports', 'ember-one-way-controls/components/one-way-radio'], function (exports, _emberOneWayControlsComponentsOneWayRadio) {
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
@@ -4489,31 +4792,7 @@ define('ghost-admin/components/one-way-radio', ['exports', 'ember-one-way-contro
}
});
});
-define('ghost-admin/components/one-way-range', ['exports', 'ember-one-way-controls/components/one-way-range'], function (exports, _emberOneWayControlsComponentsOneWayRange) {
- Object.defineProperty(exports, 'default', {
- enumerable: true,
- get: function get() {
- return _emberOneWayControlsComponentsOneWayRange['default'];
- }
- });
-});
-define('ghost-admin/components/one-way-search', ['exports', 'ember-one-way-controls/components/one-way-search'], function (exports, _emberOneWayControlsComponentsOneWaySearch) {
- Object.defineProperty(exports, 'default', {
- enumerable: true,
- get: function get() {
- return _emberOneWayControlsComponentsOneWaySearch['default'];
- }
- });
-});
-define('ghost-admin/components/one-way-select', ['exports', 'ember-one-way-controls/components/one-way-select'], function (exports, _emberOneWayControlsComponentsOneWaySelect) {
- Object.defineProperty(exports, 'default', {
- enumerable: true,
- get: function get() {
- return _emberOneWayControlsComponentsOneWaySelect['default'];
- }
- });
-});
-define('ghost-admin/components/one-way-select/option', ['exports', 'ember-one-way-controls/components/one-way-select/option'], function (exports, _emberOneWayControlsComponentsOneWaySelectOption) {
+define('ghost/components/one-way-select/option', ['exports', 'ember-one-way-controls/components/one-way-select/option'], function (exports, _emberOneWayControlsComponentsOneWaySelectOption) {
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
@@ -4521,23 +4800,15 @@ define('ghost-admin/components/one-way-select/option', ['exports', 'ember-one-wa
}
});
});
-define('ghost-admin/components/one-way-tel', ['exports', 'ember-one-way-controls/components/one-way-tel'], function (exports, _emberOneWayControlsComponentsOneWayTel) {
+define('ghost/components/one-way-select', ['exports', 'ember-one-way-controls/components/one-way-select'], function (exports, _emberOneWayControlsComponentsOneWaySelect) {
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
- return _emberOneWayControlsComponentsOneWayTel['default'];
- }
- });
-});
-define('ghost-admin/components/one-way-text', ['exports', 'ember-one-way-controls/components/one-way-text'], function (exports, _emberOneWayControlsComponentsOneWayText) {
- Object.defineProperty(exports, 'default', {
- enumerable: true,
- get: function get() {
- return _emberOneWayControlsComponentsOneWayText['default'];
+ return _emberOneWayControlsComponentsOneWaySelect['default'];
}
});
});
-define('ghost-admin/components/one-way-textarea', ['exports', 'ember-one-way-controls/components/one-way-textarea'], function (exports, _emberOneWayControlsComponentsOneWayTextarea) {
+define('ghost/components/one-way-textarea', ['exports', 'ember-one-way-controls/components/one-way-textarea'], function (exports, _emberOneWayControlsComponentsOneWayTextarea) {
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
@@ -4545,39 +4816,39 @@ define('ghost-admin/components/one-way-textarea', ['exports', 'ember-one-way-con
}
});
});
-define('ghost-admin/components/one-way-time', ['exports', 'ember-one-way-controls/components/one-way-time'], function (exports, _emberOneWayControlsComponentsOneWayTime) {
+define('ghost/components/power-select/before-options', ['exports', 'ember-power-select/components/power-select/before-options'], function (exports, _emberPowerSelectComponentsPowerSelectBeforeOptions) {
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
- return _emberOneWayControlsComponentsOneWayTime['default'];
+ return _emberPowerSelectComponentsPowerSelectBeforeOptions['default'];
}
});
});
-define('ghost-admin/components/one-way-url', ['exports', 'ember-one-way-controls/components/one-way-url'], function (exports, _emberOneWayControlsComponentsOneWayUrl) {
+define('ghost/components/power-select/options', ['exports', 'ember-power-select/components/power-select/options'], function (exports, _emberPowerSelectComponentsPowerSelectOptions) {
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
- return _emberOneWayControlsComponentsOneWayUrl['default'];
+ return _emberPowerSelectComponentsPowerSelectOptions['default'];
}
});
});
-define('ghost-admin/components/one-way-week', ['exports', 'ember-one-way-controls/components/one-way-week'], function (exports, _emberOneWayControlsComponentsOneWayWeek) {
+define('ghost/components/power-select/trigger', ['exports', 'ember-power-select/components/power-select/trigger'], function (exports, _emberPowerSelectComponentsPowerSelectTrigger) {
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
- return _emberOneWayControlsComponentsOneWayWeek['default'];
+ return _emberPowerSelectComponentsPowerSelectTrigger['default'];
}
});
});
-define('ghost-admin/components/power-select-multiple', ['exports', 'ember-power-select/components/power-select-multiple'], function (exports, _emberPowerSelectComponentsPowerSelectMultiple) {
+define('ghost/components/power-select-multiple/options', ['exports', 'ember-power-select/components/power-select-multiple/options'], function (exports, _emberPowerSelectComponentsPowerSelectMultipleOptions) {
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
- return _emberPowerSelectComponentsPowerSelectMultiple['default'];
+ return _emberPowerSelectComponentsPowerSelectMultipleOptions['default'];
}
});
});
-define('ghost-admin/components/power-select-multiple/trigger', ['exports', 'ember-power-select/components/power-select-multiple/trigger'], function (exports, _emberPowerSelectComponentsPowerSelectMultipleTrigger) {
+define('ghost/components/power-select-multiple/trigger', ['exports', 'ember-power-select/components/power-select-multiple/trigger'], function (exports, _emberPowerSelectComponentsPowerSelectMultipleTrigger) {
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
@@ -4585,45 +4856,29 @@ define('ghost-admin/components/power-select-multiple/trigger', ['exports', 'embe
}
});
});
-define('ghost-admin/components/power-select', ['exports', 'ember-power-select/components/power-select'], function (exports, _emberPowerSelectComponentsPowerSelect) {
- Object.defineProperty(exports, 'default', {
- enumerable: true,
- get: function get() {
- return _emberPowerSelectComponentsPowerSelect['default'];
- }
- });
-});
-define('ghost-admin/components/power-select/before-options', ['exports', 'ember-power-select/components/power-select/before-options'], function (exports, _emberPowerSelectComponentsPowerSelectBeforeOptions) {
+define('ghost/components/power-select-multiple', ['exports', 'ember-power-select/components/power-select-multiple'], function (exports, _emberPowerSelectComponentsPowerSelectMultiple) {
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
- return _emberPowerSelectComponentsPowerSelectBeforeOptions['default'];
- }
- });
-});
-define('ghost-admin/components/power-select/options', ['exports', 'ember-power-select/components/power-select/options'], function (exports, _emberPowerSelectComponentsPowerSelectOptions) {
- Object.defineProperty(exports, 'default', {
- enumerable: true,
- get: function get() {
- return _emberPowerSelectComponentsPowerSelectOptions['default'];
+ return _emberPowerSelectComponentsPowerSelectMultiple['default'];
}
});
});
-define('ghost-admin/components/power-select/trigger', ['exports', 'ember-power-select/components/power-select/trigger'], function (exports, _emberPowerSelectComponentsPowerSelectTrigger) {
+define('ghost/components/power-select', ['exports', 'ember-power-select/components/power-select'], function (exports, _emberPowerSelectComponentsPowerSelect) {
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
- return _emberPowerSelectComponentsPowerSelectTrigger['default'];
+ return _emberPowerSelectComponentsPowerSelect['default'];
}
});
});
-define('ghost-admin/components/sortable-group', ['exports', 'ember-sortable/components/sortable-group'], function (exports, _emberSortableComponentsSortableGroup) {
+define('ghost/components/sortable-group', ['exports', 'ember-sortable/components/sortable-group'], function (exports, _emberSortableComponentsSortableGroup) {
exports['default'] = _emberSortableComponentsSortableGroup['default'];
});
-define('ghost-admin/components/sortable-item', ['exports', 'ember-sortable/components/sortable-item'], function (exports, _emberSortableComponentsSortableItem) {
+define('ghost/components/sortable-item', ['exports', 'ember-sortable/components/sortable-item'], function (exports, _emberSortableComponentsSortableItem) {
exports['default'] = _emberSortableComponentsSortableItem['default'];
});
-define('ghost-admin/components/x-file-input', ['exports', 'emberx-file-input/components/x-file-input'], function (exports, _emberxFileInputComponentsXFileInput) {
+define('ghost/components/x-file-input', ['exports', 'emberx-file-input/components/x-file-input'], function (exports, _emberxFileInputComponentsXFileInput) {
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
@@ -4631,8 +4886,10 @@ define('ghost-admin/components/x-file-input', ['exports', 'emberx-file-input/com
}
});
});
-define('ghost-admin/controllers/about', ['exports', 'ember-controller', 'ember-computed'], function (exports, _emberController, _emberComputed) {
- exports['default'] = _emberController['default'].extend({
+define('ghost/controllers/about', ['exports', 'ember'], function (exports, _ember) {
+ var Controller = _ember['default'].Controller;
+ var computed = _ember['default'].computed;
+ exports['default'] = Controller.extend({
updateNotificationCount: 0,
actions: {
@@ -4641,18 +4898,21 @@ define('ghost-admin/controllers/about', ['exports', 'ember-controller', 'ember-c
}
},
- copyrightYear: (0, _emberComputed['default'])(function () {
+ copyrightYear: computed(function () {
var date = new Date();
return date.getFullYear();
})
});
});
-define('ghost-admin/controllers/application', ['exports', 'ember-controller', 'ember-computed', 'ember-service/inject'], function (exports, _emberController, _emberComputed, _emberServiceInject) {
- exports['default'] = _emberController['default'].extend({
- dropdown: (0, _emberServiceInject['default'])(),
- session: (0, _emberServiceInject['default'])(),
+define('ghost/controllers/application', ['exports', 'ember'], function (exports, _ember) {
+ var Controller = _ember['default'].Controller;
+ var computed = _ember['default'].computed;
+ var service = _ember['default'].inject.service;
+ exports['default'] = Controller.extend({
+ dropdown: service(),
+ session: service(),
- showNavMenu: (0, _emberComputed['default'])('currentPath', 'session.isAuthenticated', function () {
+ showNavMenu: computed('currentPath', 'session.isAuthenticated', function () {
return (this.get('currentPath') !== 'error404' || this.get('session.isAuthenticated')) && !this.get('currentPath').match(/(signin|signup|setup|reset)/);
}),
@@ -4662,7 +4922,7 @@ define('ghost-admin/controllers/application', ['exports', 'ember-controller', 'e
showMarkdownHelpModal: false,
autoNav: false,
- autoNavOpen: (0, _emberComputed['default'])('autoNav', {
+ autoNavOpen: computed('autoNav', {
get: function get() {
return false;
},
@@ -4697,8 +4957,9 @@ define('ghost-admin/controllers/application', ['exports', 'ember-controller', 'e
}
});
});
-define('ghost-admin/controllers/editor/edit', ['exports', 'ember-controller', 'ghost-admin/mixins/editor-base-controller'], function (exports, _emberController, _ghostAdminMixinsEditorBaseController) {
- exports['default'] = _emberController['default'].extend(_ghostAdminMixinsEditorBaseController['default'], {
+define('ghost/controllers/editor/edit', ['exports', 'ember', 'ghost/mixins/editor-base-controller'], function (exports, _ember, _ghostMixinsEditorBaseController) {
+ var Controller = _ember['default'].Controller;
+ exports['default'] = Controller.extend(_ghostMixinsEditorBaseController['default'], {
showDeletePostModal: false,
actions: {
@@ -4708,13 +4969,14 @@ define('ghost-admin/controllers/editor/edit', ['exports', 'ember-controller', 'g
}
});
});
-define('ghost-admin/controllers/editor/new', ['exports', 'ember-controller', 'ghost-admin/mixins/editor-base-controller'], function (exports, _emberController, _ghostAdminMixinsEditorBaseController) {
+define('ghost/controllers/editor/new', ['exports', 'ember', 'ghost/mixins/editor-base-controller'], function (exports, _ember, _ghostMixinsEditorBaseController) {
+ var Controller = _ember['default'].Controller;
function K() {
return this;
}
- exports['default'] = _emberController['default'].extend(_ghostAdminMixinsEditorBaseController['default'], {
+ exports['default'] = Controller.extend(_ghostMixinsEditorBaseController['default'], {
// Overriding autoSave on the base controller, as the new controller shouldn't be autosaving
autoSave: K,
actions: {
@@ -4733,16 +4995,18 @@ define('ghost-admin/controllers/editor/new', ['exports', 'ember-controller', 'gh
}
});
});
-define('ghost-admin/controllers/error', ['exports', 'ember-controller', 'ember-computed'], function (exports, _emberController, _emberComputed) {
- exports['default'] = _emberController['default'].extend({
+define('ghost/controllers/error', ['exports', 'ember'], function (exports, _ember) {
+ var Controller = _ember['default'].Controller;
+ var computed = _ember['default'].computed;
+ exports['default'] = Controller.extend({
stack: false,
- code: (0, _emberComputed['default'])('content.status', function () {
+ code: computed('content.status', function () {
return this.get('content.status') > 200 ? this.get('content.status') : 500;
}),
- message: (0, _emberComputed['default'])('content.statusText', function () {
+ message: computed('content.statusText', function () {
if (this.get('code') === 404) {
return 'Page not found';
}
@@ -4751,24 +5015,35 @@ define('ghost-admin/controllers/error', ['exports', 'ember-controller', 'ember-c
})
});
});
-define('ghost-admin/controllers/post-settings-menu', ['exports', 'jquery', 'ember', 'ember-controller', 'rsvp', 'ember-computed', 'ember-metal/utils', 'ember-service/inject', 'ember-controller/inject', 'ember-string', 'ember-utils', 'ember-metal/observer', 'ember-runloop', 'ghost-admin/utils/date-formatting', 'ghost-admin/mixins/settings-menu-controller', 'ghost-admin/utils/bound-one-way', 'ghost-admin/utils/isNumber', 'ghost-admin/services/ajax'], function (exports, _jquery, _ember, _emberController, _rsvp, _emberComputed, _emberMetalUtils, _emberServiceInject, _emberControllerInject, _emberString, _emberUtils, _emberMetalObserver, _emberRunloop, _ghostAdminUtilsDateFormatting, _ghostAdminMixinsSettingsMenuController, _ghostAdminUtilsBoundOneWay, _ghostAdminUtilsIsNumber, _ghostAdminServicesAjax) {
+define('ghost/controllers/post-settings-menu', ['exports', 'ember', 'ghost/utils/date-formatting', 'ghost/mixins/settings-menu-controller', 'ghost/utils/bound-one-way', 'ghost/utils/isNumber'], function (exports, _ember, _ghostUtilsDateFormatting, _ghostMixinsSettingsMenuController, _ghostUtilsBoundOneWay, _ghostUtilsIsNumber) {
+ var $ = _ember['default'].$;
var ArrayProxy = _ember['default'].ArrayProxy;
+ var Controller = _ember['default'].Controller;
var Handlebars = _ember['default'].Handlebars;
var PromiseProxyMixin = _ember['default'].PromiseProxyMixin;
- exports['default'] = _emberController['default'].extend(_ghostAdminMixinsSettingsMenuController['default'], {
+ var RSVP = _ember['default'].RSVP;
+ var computed = _ember['default'].computed;
+ var guidFor = _ember['default'].guidFor;
+ var _Ember$inject = _ember['default'].inject;
+ var service = _Ember$inject.service;
+ var controller = _Ember$inject.controller;
+ var isArray = _ember['default'].isArray;
+ var isBlank = _ember['default'].isBlank;
+ var observer = _ember['default'].observer;
+ var run = _ember['default'].run;
+ exports['default'] = Controller.extend(_ghostMixinsSettingsMenuController['default'], {
debounceId: null,
lastPromise: null,
selectedAuthor: null,
- application: (0, _emberControllerInject['default'])(),
- config: (0, _emberServiceInject['default'])(),
- ghostPaths: (0, _emberServiceInject['default'])(),
- notifications: (0, _emberServiceInject['default'])(),
- session: (0, _emberServiceInject['default'])(),
- slugGenerator: (0, _emberServiceInject['default'])(),
- timeZone: (0, _emberServiceInject['default'])(),
+ application: controller(),
+ config: service(),
+ ghostPaths: service(),
+ notifications: service(),
+ session: service(),
+ slugGenerator: service(),
- initializeSelectedAuthor: (0, _emberMetalObserver['default'])('model', function () {
+ initializeSelectedAuthor: observer('model', function () {
var _this = this;
return this.get('model.author').then(function (author) {
@@ -4777,7 +5052,7 @@ define('ghost-admin/controllers/post-settings-menu', ['exports', 'jquery', 'embe
});
}),
- authors: (0, _emberComputed['default'])(function () {
+ authors: computed(function () {
// Loaded asynchronously, so must use promise proxies.
var deferred = {};
@@ -4792,7 +5067,7 @@ define('ghost-admin/controllers/post-settings-menu', ['exports', 'jquery', 'embe
return ArrayProxy.extend(PromiseProxyMixin).create(deferred);
}),
- slugValue: (0, _ghostAdminUtilsBoundOneWay['default'])('model.slug'),
+ slugValue: (0, _ghostUtilsBoundOneWay['default'])('model.slug'),
// Requests slug from title
generateAndSetSlug: function generateAndSetSlug(destination) {
@@ -4807,28 +5082,25 @@ define('ghost-admin/controllers/post-settings-menu', ['exports', 'jquery', 'embe
return;
}
- promise = _rsvp['default'].resolve(afterSave).then(function () {
+ promise = RSVP.resolve(afterSave).then(function () {
return _this2.get('slugGenerator').generateSlug('post', title).then(function (slug) {
- if (!(0, _emberUtils.isBlank)(slug)) {
+ if (!isBlank(slug)) {
_this2.set(destination, slug);
}
- })['catch'](function (error) {
+ })['catch'](function () {
// Nothing to do (would be nice to log this somewhere though),
// but a rejected promise needs to be handled here so that a resolved
// promise is returned.
- if ((0, _ghostAdminServicesAjax.isVersionMismatchError)(error)) {
- _this2.get('notifications').showAPIError(error);
- }
});
});
this.set('lastPromise', promise);
},
- metaTitleScratch: (0, _ghostAdminUtilsBoundOneWay['default'])('model.metaTitle'),
- metaDescriptionScratch: (0, _ghostAdminUtilsBoundOneWay['default'])('model.metaDescription'),
+ metaTitleScratch: (0, _ghostUtilsBoundOneWay['default'])('model.metaTitle'),
+ metaDescriptionScratch: (0, _ghostUtilsBoundOneWay['default'])('model.metaDescription'),
- seoTitle: (0, _emberComputed['default'])('model.titleScratch', 'metaTitleScratch', function () {
+ seoTitle: computed('model.titleScratch', 'metaTitleScratch', function () {
var metaTitle = this.get('metaTitleScratch') || '';
metaTitle = metaTitle.length > 0 ? metaTitle : this.get('model.titleScratch');
@@ -4836,13 +5108,13 @@ define('ghost-admin/controllers/post-settings-menu', ['exports', 'jquery', 'embe
if (metaTitle.length > 70) {
metaTitle = metaTitle.substring(0, 70).trim();
metaTitle = Handlebars.Utils.escapeExpression(metaTitle);
- metaTitle = (0, _emberString.htmlSafe)(metaTitle + '…');
+ metaTitle = _ember['default'].String.htmlSafe(metaTitle + '…');
}
return metaTitle;
}),
- seoDescription: (0, _emberComputed['default'])('model.scratch', 'metaDescriptionScratch', function () {
+ seoDescription: computed('model.scratch', 'metaDescriptionScratch', function () {
var metaDescription = this.get('metaDescriptionScratch') || '';
var html = '';
var el = undefined,
@@ -4851,7 +5123,7 @@ define('ghost-admin/controllers/post-settings-menu', ['exports', 'jquery', 'embe
if (metaDescription.length > 0) {
placeholder = metaDescription;
} else {
- el = (0, _jquery['default'])('.rendered-markdown');
+ el = $('.rendered-markdown');
// Get rendered markdown
if (el !== undefined && el.length > 0) {
@@ -4861,7 +5133,7 @@ define('ghost-admin/controllers/post-settings-menu', ['exports', 'jquery', 'embe
}
// Strip HTML
- placeholder = (0, _jquery['default'])('', { html: html }).text();
+ placeholder = $('', { html: html }).text();
// Replace new lines and trim
placeholder = placeholder.replace(/\n+/g, ' ').trim();
}
@@ -4870,13 +5142,13 @@ define('ghost-admin/controllers/post-settings-menu', ['exports', 'jquery', 'embe
// Limit to 156 characters
placeholder = placeholder.substring(0, 156).trim();
placeholder = Handlebars.Utils.escapeExpression(placeholder);
- placeholder = (0, _emberString.htmlSafe)(placeholder + '…');
+ placeholder = _ember['default'].String.htmlSafe(placeholder + '…');
}
return placeholder;
}),
- seoURL: (0, _emberComputed['default'])('model.slug', 'config.blogUrl', function () {
+ seoURL: computed('model.slug', 'config.blogUrl', function () {
var blogUrl = this.get('config.blogUrl');
var seoSlug = this.get('model.slug') ? this.get('model.slug') : '';
var seoURL = blogUrl + '/' + seoSlug;
@@ -4888,7 +5160,7 @@ define('ghost-admin/controllers/post-settings-menu', ['exports', 'jquery', 'embe
if (seoURL.length > 70) {
seoURL = seoURL.substring(0, 70).trim();
- seoURL = (0, _emberString.htmlSafe)(seoURL + '…');
+ seoURL = _ember['default'].String.htmlSafe(seoURL + '…');
}
return seoURL;
@@ -4896,7 +5168,7 @@ define('ghost-admin/controllers/post-settings-menu', ['exports', 'jquery', 'embe
// observe titleScratch, keeping the post's slug in sync
// with it until saved for the first time.
- addTitleObserver: (0, _emberMetalObserver['default'])('model', function () {
+ addTitleObserver: observer('model', function () {
if (this.get('model.isNew') || this.get('model.title') === '(Untitled)') {
this.addObserver('model.titleScratch', this, 'titleObserver');
}
@@ -4909,24 +5181,22 @@ define('ghost-admin/controllers/post-settings-menu', ['exports', 'jquery', 'embe
// generate a slug if a post is new and doesn't have a title yet or
// if the title is still '(Untitled)' and the slug is unaltered.
if (this.get('model.isNew') && !title || title === '(Untitled)') {
- debounceId = _emberRunloop['default'].debounce(this, 'generateAndSetSlug', 'model.slug', 700);
+ debounceId = run.debounce(this, 'generateAndSetSlug', 'model.slug', 700);
}
this.set('debounceId', debounceId);
},
// live-query of all tags for tag input autocomplete
- availableTags: (0, _emberComputed['default'])(function () {
+ availableTags: computed(function () {
return this.get('store').filter('tag', { limit: 'all' }, function () {
return true;
});
}),
- showError: function showError(error) {
- // TODO: remove null check once ValidationEngine has been removed
- if (error) {
- this.get('notifications').showAPIError(error);
- }
+ showErrors: function showErrors(errors) {
+ errors = isArray(errors) ? errors : [errors];
+ this.get('notifications').showErrors(errors);
},
actions: {
@@ -4945,8 +5215,8 @@ define('ghost-admin/controllers/post-settings-menu', ['exports', 'jquery', 'embe
return;
}
- this.get('model').save()['catch'](function (error) {
- _this3.showError(error);
+ this.get('model').save()['catch'](function (errors) {
+ _this3.showErrors(errors);
_this3.get('model').rollbackAttributes();
});
},
@@ -4962,8 +5232,8 @@ define('ghost-admin/controllers/post-settings-menu', ['exports', 'jquery', 'embe
return;
}
- this.get('model').save(this.get('saveOptions'))['catch'](function (error) {
- _this4.showError(error);
+ this.get('model').save(this.get('saveOptions'))['catch'](function (errors) {
+ _this4.showErrors(errors);
_this4.get('model').rollbackAttributes();
});
},
@@ -5006,7 +5276,7 @@ define('ghost-admin/controllers/post-settings-menu', ['exports', 'jquery', 'embe
// if the candidate slug is the same as the existing slug except
// for the incrementor then the existing slug should be used
- if ((0, _ghostAdminUtilsIsNumber['default'])(check) && check > 0) {
+ if ((0, _ghostUtilsIsNumber['default'])(check) && check > 0) {
if (slug === slugTokens.join('-') && serverSlug !== newSlug) {
_this5.set('slugValue', slug);
@@ -5027,8 +5297,8 @@ define('ghost-admin/controllers/post-settings-menu', ['exports', 'jquery', 'embe
}
return _this5.get('model').save();
- })['catch'](function (error) {
- _this5.showError(error);
+ })['catch'](function (errors) {
+ _this5.showErrors(errors);
_this5.get('model').rollbackAttributes();
});
},
@@ -5038,86 +5308,55 @@ define('ghost-admin/controllers/post-settings-menu', ['exports', 'jquery', 'embe
* Action sent by post settings menu view.
* (#1351)
*/
- setPublishedAtUTC: function setPublishedAtUTC(userInput) {
+ setPublishedAt: function setPublishedAt(userInput) {
var _this6 = this;
if (!userInput) {
- // Clear out the publishedAtUTC field for a draft
+ // Clear out the publishedAt field for a draft
if (this.get('model.isDraft')) {
- this.set('model.publishedAtUTC', null);
+ this.set('model.publishedAt', null);
}
+
return;
}
- // The user inputs a date which he expects to be in his timezone. Therefore, from now on
- // we have to work with the timezone offset which we get from the timeZone Service.
- this.get('timeZone.blogTimezone').then(function (blogTimezone) {
- var newPublishedAt = (0, _ghostAdminUtilsDateFormatting.parseDateString)(userInput, blogTimezone);
- var publishedAtUTC = moment.utc(_this6.get('model.publishedAtUTC'));
- var errMessage = '';
- var newPublishedAtUTC = undefined;
-
- // Clear previous errors
- _this6.get('model.errors').remove('post-setting-date');
-
- // Validate new Published date
- if (!newPublishedAt.isValid()) {
- errMessage = 'Published Date must be a valid date with format: ' + 'DD MMM YY @ HH:mm (e.g. 6 Dec 14 @ 15:00)';
- }
+ var newPublishedAt = (0, _ghostUtilsDateFormatting.parseDateString)(userInput);
+ var publishedAt = moment(this.get('model.publishedAt'));
+ var errMessage = '';
- // Date is a valid date, so now make it UTC
- newPublishedAtUTC = moment.utc(newPublishedAt);
+ // Clear previous errors
+ this.get('model.errors').remove('post-setting-date');
- if (newPublishedAtUTC.diff(moment.utc(new Date()), 'hours', true) > 0) {
+ // Validate new Published date
+ if (!newPublishedAt.isValid()) {
+ errMessage = 'Published Date must be a valid date with format: ' + 'DD MMM YY @ HH:mm (e.g. 6 Dec 14 @ 15:00)';
+ } else if (newPublishedAt.diff(new Date(), 'h') > 0) {
+ errMessage = 'Published Date cannot currently be in the future.';
+ }
- // We have to check that the time from now is not shorter than 2 minutes,
- // otherwise we'll have issues with the serverside scheduling procedure
- if (newPublishedAtUTC.diff(moment.utc(new Date()), 'minutes', true) < 2) {
- errMessage = 'Must be at least 2 minutes from now.';
- } else {
- // in case the post is already published and the user sets the date
- // afterwards to a future time, we stop here, and he has to unpublish
- // his post first
- if (_this6.get('model.isPublished')) {
- errMessage = 'Your post is already published.';
- // this is the indicator for the different save button layout
- _this6.set('timeScheduled', false);
- }
- // everything fine, we can start the schedule workflow and change
- // the save buttons according to it
- _this6.set('timeScheduled', true);
- }
- // if the post is already scheduled and the user changes the date back into the
- // past, we'll set the status of the post back to draft, so he can start all over
- // again
- } else if (_this6.get('model.isScheduled')) {
- _this6.set('model.status', 'draft');
- }
+ // If errors, notify and exit.
+ if (errMessage) {
+ this.get('model.errors').add('post-setting-date', errMessage);
+ return;
+ }
- // If errors, notify and exit.
- if (errMessage) {
- _this6.get('model.errors').add('post-setting-date', errMessage);
- return;
- }
+ // Validation complete, update the view
+ this.set('model.publishedAt', newPublishedAt);
- // Do nothing if the user didn't actually change the date
- if (publishedAtUTC && publishedAtUTC.isSame(newPublishedAtUTC)) {
- return;
- }
-
- // Validation complete
- _this6.set('model.publishedAtUTC', newPublishedAtUTC);
+ // Don't save the date if the user didn't actually changed the date
+ if (publishedAt && publishedAt.isSame(newPublishedAt)) {
+ return;
+ }
- // If this is a new post. Don't save the model. Defer the save
- // to the user pressing the save button
- if (_this6.get('model.isNew')) {
- return;
- }
+ // If this is a new post. Don't save the model. Defer the save
+ // to the user pressing the save button
+ if (this.get('model.isNew')) {
+ return;
+ }
- _this6.get('model').save()['catch'](function (error) {
- _this6.showError(error);
- _this6.get('model').rollbackAttributes();
- });
+ this.get('model').save()['catch'](function (errors) {
+ _this6.showErrors(errors);
+ _this6.get('model').rollbackAttributes();
});
},
@@ -5172,8 +5411,8 @@ define('ghost-admin/controllers/post-settings-menu', ['exports', 'jquery', 'embe
return;
}
- this.get('model').save()['catch'](function (error) {
- _this7.showError(error);
+ this.get('model').save()['catch'](function (errors) {
+ _this7.showErrors(errors);
_this7.get('model').rollbackAttributes();
});
},
@@ -5187,14 +5426,14 @@ define('ghost-admin/controllers/post-settings-menu', ['exports', 'jquery', 'embe
return;
}
- this.get('model').save()['catch'](function (error) {
- _this8.showError(error);
+ this.get('model').save()['catch'](function (errors) {
+ _this8.showErrors(errors);
_this8.get('model').rollbackAttributes();
});
},
resetPubDate: function resetPubDate() {
- this.set('publishedAtUTCValue', '');
+ this.set('publishedAtValue', '');
},
closeNavMenu: function closeNavMenu() {
@@ -5219,8 +5458,8 @@ define('ghost-admin/controllers/post-settings-menu', ['exports', 'jquery', 'embe
return;
}
- model.save()['catch'](function (error) {
- _this9.showError(error);
+ model.save()['catch'](function (errors) {
+ _this9.showErrors(errors);
_this9.set('selectedAuthor', author);
model.rollbackAttributes();
});
@@ -5260,7 +5499,7 @@ define('ghost-admin/controllers/post-settings-menu', ['exports', 'jquery', 'embe
// we need to set a UUID so that selectize has a unique value
// it will be ignored when sent to the server
- tagToAdd.set('uuid', (0, _emberMetalUtils.guidFor)(tagToAdd));
+ tagToAdd.set('uuid', guidFor(tagToAdd));
}
// push tag onto post relationship
@@ -5280,19 +5519,87 @@ define('ghost-admin/controllers/post-settings-menu', ['exports', 'jquery', 'embe
}
});
});
-define('ghost-admin/controllers/posts', ['exports', 'ember', 'ember-controller', 'ember-computed', 'ember-service/inject'], function (exports, _ember, _emberController, _emberComputed, _emberServiceInject) {
+define('ghost/controllers/posts', ['exports', 'ember'], function (exports, _ember) {
+ var Controller = _ember['default'].Controller;
var compare = _ember['default'].compare;
- exports['default'] = _emberController['default'].extend({
- feature: (0, _emberServiceInject['default'])(),
+ var computed = _ember['default'].computed;
+ var equal = computed.equal;
+
+ // a custom sort function is needed in order to sort the posts list the same way the server would:
+ // status: ASC
+ // publishedAt: DESC
+ // updatedAt: DESC
+ // id: DESC
+ function comparator(item1, item2) {
+ var updated1 = item1.get('updatedAt');
+ var updated2 = item2.get('updatedAt');
+ var idResult = undefined,
+ publishedAtResult = undefined,
+ statusResult = undefined,
+ updatedAtResult = undefined;
+
+ // when `updatedAt` is undefined, the model is still
+ // being written to with the results from the server
+ if (item1.get('isNew') || !updated1) {
+ return -1;
+ }
+
+ if (item2.get('isNew') || !updated2) {
+ return 1;
+ }
+
+ idResult = compare(parseInt(item1.get('id')), parseInt(item2.get('id')));
+ statusResult = compare(item1.get('status'), item2.get('status'));
+ updatedAtResult = compare(updated1.valueOf(), updated2.valueOf());
+ publishedAtResult = publishedAtCompare(item1, item2);
+
+ if (statusResult === 0) {
+ if (publishedAtResult === 0) {
+ if (updatedAtResult === 0) {
+ // This should be DESC
+ return idResult * -1;
+ }
+ // This should be DESC
+ return updatedAtResult * -1;
+ }
+ // This should be DESC
+ return publishedAtResult * -1;
+ }
+
+ return statusResult;
+ }
+
+ function publishedAtCompare(item1, item2) {
+ var published1 = item1.get('publishedAt');
+ var published2 = item2.get('publishedAt');
+
+ if (!published1 && !published2) {
+ return 0;
+ }
+
+ if (!published1 && published2) {
+ return -1;
+ }
+
+ if (!published2 && published1) {
+ return 1;
+ }
+
+ return compare(published1.valueOf(), published2.valueOf());
+ }
+
+ exports['default'] = Controller.extend({
showDeletePostModal: false,
// See PostsRoute's shortcuts
- postListFocused: (0, _emberComputed.equal)('keyboardFocus', 'postList'),
- postContentFocused: (0, _emberComputed.equal)('keyboardFocus', 'postContent'),
+ postListFocused: equal('keyboardFocus', 'postList'),
+ postContentFocused: equal('keyboardFocus', 'postContent'),
+
+ sortedPosts: computed('model.@each.status', 'model.@each.publishedAt', 'model.@each.isNew', 'model.@each.updatedAt', function () {
+ var postsArray = this.get('model').toArray();
- sortedPosts: (0, _emberComputed['default'])('model.@each.{status,publishedAtUTC,isNew,updatedAtUTC}', function () {
- return this.get('model').toArray().sort(compare);
+ return postsArray.sort(comparator);
}),
actions: {
@@ -5302,8 +5609,11 @@ define('ghost-admin/controllers/posts', ['exports', 'ember', 'ember-controller',
}
});
});
-define('ghost-admin/controllers/reset', ['exports', 'ember-controller', 'ember-computed', 'ember-service/inject', 'ghost-admin/mixins/validation-engine'], function (exports, _emberController, _emberComputed, _emberServiceInject, _ghostAdminMixinsValidationEngine) {
- exports['default'] = _emberController['default'].extend(_ghostAdminMixinsValidationEngine['default'], {
+define('ghost/controllers/reset', ['exports', 'ember', 'ghost/mixins/validation-engine'], function (exports, _ember, _ghostMixinsValidationEngine) {
+ var Controller = _ember['default'].Controller;
+ var computed = _ember['default'].computed;
+ var service = _ember['default'].inject.service;
+ exports['default'] = Controller.extend(_ghostMixinsValidationEngine['default'], {
newPassword: '',
ne2Password: '',
token: '',
@@ -5312,12 +5622,12 @@ define('ghost-admin/controllers/reset', ['exports', 'ember-controller', 'ember-c
validationType: 'reset',
- ghostPaths: (0, _emberServiceInject['default'])(),
- notifications: (0, _emberServiceInject['default'])(),
- session: (0, _emberServiceInject['default'])(),
- ajax: (0, _emberServiceInject['default'])(),
+ ghostPaths: service(),
+ notifications: service(),
+ session: service(),
+ ajax: service(),
- email: (0, _emberComputed['default'])('token', function () {
+ email: computed('token', function () {
// The token base64 encodes the email (and some other stuff),
// each section is divided by a '|'. Email comes second.
return atob(this.get('token')).split('|')[1];
@@ -5372,18 +5682,24 @@ define('ghost-admin/controllers/reset', ['exports', 'ember-controller', 'ember-c
}
});
});
-define('ghost-admin/controllers/settings/apps/index', ['exports', 'ember-controller', 'ember-controller/inject', 'ember-computed'], function (exports, _emberController, _emberControllerInject, _emberComputed) {
- exports['default'] = _emberController['default'].extend({
- appsController: (0, _emberControllerInject['default'])('settings.apps'),
+define('ghost/controllers/settings/apps/index', ['exports', 'ember'], function (exports, _ember) {
+ var computed = _ember['default'].computed;
+ var controller = _ember['default'].inject.controller;
+ var alias = computed.alias;
+ exports['default'] = _ember['default'].Controller.extend({
+ appsController: controller('settings.apps'),
- slack: (0, _emberComputed.alias)('appsController.model.slack.firstObject')
+ slack: alias('appsController.model.slack.firstObject')
});
});
-define('ghost-admin/controllers/settings/apps/slack', ['exports', 'ember-controller', 'ember-computed', 'ember-service/inject', 'ember-invoke-action'], function (exports, _emberController, _emberComputed, _emberServiceInject, _emberInvokeAction) {
- exports['default'] = _emberController['default'].extend({
- ghostPaths: (0, _emberServiceInject['default'])(),
- ajax: (0, _emberServiceInject['default'])(),
- notifications: (0, _emberServiceInject['default'])(),
+define('ghost/controllers/settings/apps/slack', ['exports', 'ember', 'ember-invoke-action'], function (exports, _ember, _emberInvokeAction) {
+ var Controller = _ember['default'].Controller;
+ var empty = _ember['default'].computed.empty;
+ var service = _ember['default'].inject.service;
+ exports['default'] = Controller.extend({
+ ghostPaths: service(),
+ ajax: service(),
+ notifications: service(),
// will be set by route
settings: null,
@@ -5392,7 +5708,7 @@ define('ghost-admin/controllers/settings/apps/slack', ['exports', 'ember-control
savePromise: null,
isSendingTest: false,
- testNotificationDisabled: (0, _emberComputed.empty)('model.url'),
+ testNotificationDisabled: empty('model.url'),
actions: {
sendTestNotification: function sendTestNotification() {
@@ -5412,7 +5728,6 @@ define('ghost-admin/controllers/settings/apps/slack', ['exports', 'ember-control
notifications.showAlert('Check your slack channel test message.', { type: 'info', key: 'slack-test.send.success' });
})['catch'](function (error) {
notifications.showAPIError(error, { key: 'slack-test:send' });
- throw error;
});
})['catch'](function () {
// noop - error already handled in .save
@@ -5442,7 +5757,7 @@ define('ghost-admin/controllers/settings/apps/slack', ['exports', 'ember-control
_this2.set('isSaving', true);
return settings.save()['catch'](function (err) {
- _this2.get('notifications').showAPIError(err);
+ _this2.get('notifications').showErrors(err);
throw err;
})['finally'](function () {
_this2.set('isSaving', false);
@@ -5452,9 +5767,11 @@ define('ghost-admin/controllers/settings/apps/slack', ['exports', 'ember-control
}
});
});
-define('ghost-admin/controllers/settings/code-injection', ['exports', 'ember-controller', 'ember-service/inject', 'ghost-admin/mixins/settings-save'], function (exports, _emberController, _emberServiceInject, _ghostAdminMixinsSettingsSave) {
- exports['default'] = _emberController['default'].extend(_ghostAdminMixinsSettingsSave['default'], {
- notifications: (0, _emberServiceInject['default'])(),
+define('ghost/controllers/settings/code-injection', ['exports', 'ember', 'ghost/mixins/settings-save'], function (exports, _ember, _ghostMixinsSettingsSave) {
+ var Controller = _ember['default'].Controller;
+ var service = _ember['default'].inject.service;
+ exports['default'] = Controller.extend(_ghostMixinsSettingsSave['default'], {
+ notifications: service(),
save: function save() {
var notifications = this.get('notifications');
@@ -5465,22 +5782,25 @@ define('ghost-admin/controllers/settings/code-injection', ['exports', 'ember-con
}
});
});
-define('ghost-admin/controllers/settings/general', ['exports', 'ember-controller', 'ember-computed', 'ember-service/inject', 'ember-metal/observer', 'ember-runloop', 'ghost-admin/mixins/settings-save', 'ghost-admin/utils/random-password'], function (exports, _emberController, _emberComputed, _emberServiceInject, _emberMetalObserver, _emberRunloop, _ghostAdminMixinsSettingsSave, _ghostAdminUtilsRandomPassword) {
+define('ghost/controllers/settings/general', ['exports', 'ember', 'ghost/mixins/settings-save', 'ghost/utils/random-password'], function (exports, _ember, _ghostMixinsSettingsSave, _ghostUtilsRandomPassword) {
var _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i['return']) _i['return'](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError('Invalid attempt to destructure non-iterable instance'); } }; })();
- exports['default'] = _emberController['default'].extend(_ghostAdminMixinsSettingsSave['default'], {
+ var Controller = _ember['default'].Controller;
+ var computed = _ember['default'].computed;
+ var service = _ember['default'].inject.service;
+ var observer = _ember['default'].observer;
+ var run = _ember['default'].run;
+ exports['default'] = Controller.extend(_ghostMixinsSettingsSave['default'], {
showUploadLogoModal: false,
showUploadCoverModal: false,
- availableTimezones: null,
-
- notifications: (0, _emberServiceInject['default'])(),
- config: (0, _emberServiceInject['default'])(),
+ notifications: service(),
+ config: service(),
_scratchFacebook: null,
_scratchTwitter: null,
- selectedTheme: (0, _emberComputed['default'])('model.activeTheme', 'themes', function () {
+ selectedTheme: computed('model.activeTheme', 'themes', function () {
var activeTheme = this.get('model.activeTheme');
var themes = this.get('themes');
var selectedTheme = undefined;
@@ -5494,15 +5814,15 @@ define('ghost-admin/controllers/settings/general', ['exports', 'ember-controller
return selectedTheme;
}),
- logoImageSource: (0, _emberComputed['default'])('model.logo', function () {
+ logoImageSource: computed('model.logo', function () {
return this.get('model.logo') || '';
}),
- coverImageSource: (0, _emberComputed['default'])('model.cover', function () {
+ coverImageSource: computed('model.cover', function () {
return this.get('model.cover') || '';
}),
- isDatedPermalinks: (0, _emberComputed['default'])('model.permalinks', {
+ isDatedPermalinks: computed('model.permalinks', {
set: function set(key, value) {
this.set('model.permalinks', value ? '/:year/:month/:day/:slug/' : '/:slug/');
@@ -5517,7 +5837,7 @@ define('ghost-admin/controllers/settings/general', ['exports', 'ember-controller
}
}),
- themes: (0, _emberComputed['default'])(function () {
+ themes: computed(function () {
return this.get('model.availableThemes').reduce(function (themes, t) {
var theme = {};
@@ -5532,10 +5852,10 @@ define('ghost-admin/controllers/settings/general', ['exports', 'ember-controller
}, []);
}).readOnly(),
- generatePassword: (0, _emberMetalObserver['default'])('model.isPrivate', function () {
+ generatePassword: observer('model.isPrivate', function () {
this.get('model.errors').remove('password');
if (this.get('model.isPrivate') && this.get('model.hasDirtyAttributes')) {
- this.get('model').set('password', (0, _ghostAdminUtilsRandomPassword['default'])());
+ this.get('model').set('password', (0, _ghostUtilsRandomPassword['default'])());
}
}),
@@ -5544,6 +5864,7 @@ define('ghost-admin/controllers/settings/general', ['exports', 'ember-controller
var notifications = this.get('notifications');
var config = this.get('config');
+
return this.get('model').save().then(function (model) {
config.set('blogTitle', model.get('title'));
@@ -5572,9 +5893,7 @@ define('ghost-admin/controllers/settings/general', ['exports', 'ember-controller
setTheme: function setTheme(theme) {
this.set('model.activeTheme', theme.name);
},
- setTimezone: function setTimezone(timezone) {
- this.set('model.activeTimezone', timezone.name);
- },
+
toggleUploadCoverModal: function toggleUploadCoverModal() {
this.toggleProperty('showUploadCoverModal');
},
@@ -5651,7 +5970,7 @@ define('ghost-admin/controllers/settings/general', ['exports', 'ember-controller
// User input is validated
return this.save().then(function () {
_this2.set('model.facebook', '');
- _emberRunloop['default'].schedule('afterRender', _this2, function () {
+ run.schedule('afterRender', _this2, function () {
this.set('model.facebook', newUrl);
});
});
@@ -5723,7 +6042,7 @@ define('ghost-admin/controllers/settings/general', ['exports', 'ember-controller
// User input is validated
return this.save().then(function () {
_this3.set('model.twitter', '');
- _emberRunloop['default'].schedule('afterRender', _this3, function () {
+ run.schedule('afterRender', _this3, function () {
this.set('model.twitter', newUrl);
});
});
@@ -5737,17 +6056,21 @@ define('ghost-admin/controllers/settings/general', ['exports', 'ember-controller
}
});
});
-define('ghost-admin/controllers/settings/labs', ['exports', 'jquery', 'ember-controller', 'ember-service/inject', 'ember-array/utils'], function (exports, _jquery, _emberController, _emberServiceInject, _emberArrayUtils) {
- exports['default'] = _emberController['default'].extend({
+define('ghost/controllers/settings/labs', ['exports', 'ember'], function (exports, _ember) {
+ var $ = _ember['default'].$;
+ var Controller = _ember['default'].Controller;
+ var service = _ember['default'].inject.service;
+ var isArray = _ember['default'].isArray;
+ exports['default'] = Controller.extend({
uploadButtonText: 'Import',
importErrors: '',
submitting: false,
showDeleteAllModal: false,
- ghostPaths: (0, _emberServiceInject['default'])(),
- notifications: (0, _emberServiceInject['default'])(),
- session: (0, _emberServiceInject['default'])(),
- ajax: (0, _emberServiceInject['default'])(),
+ ghostPaths: service(),
+ notifications: service(),
+ session: service(),
+ ajax: service(),
actions: {
onUpload: function onUpload(file) {
@@ -5777,7 +6100,7 @@ define('ghost-admin/controllers/settings/labs', ['exports', 'jquery', 'ember-con
// TODO: keep as notification, add link to view content
notifications.showNotification('Import successful.', { key: 'import.upload.success' });
})['catch'](function (response) {
- if (response && response.errors && (0, _emberArrayUtils.isEmberArray)(response.errors)) {
+ if (response && response.errors && isArray(response.errors)) {
_this.set('importErrors', response.errors);
}
@@ -5791,10 +6114,10 @@ define('ghost-admin/controllers/settings/labs', ['exports', 'jquery', 'ember-con
var dbUrl = this.get('ghostPaths.url').api('db');
var accessToken = this.get('session.data.authenticated.access_token');
var downloadURL = dbUrl + '?access_token=' + accessToken;
- var iframe = (0, _jquery['default'])('#iframeDownload');
+ var iframe = $('#iframeDownload');
if (iframe.length === 0) {
- iframe = (0, _jquery['default'])('