Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
  • 6 commits
  • 16 files changed
  • 0 commit comments
  • 1 contributor
View
3 .gitmodules
@@ -1,3 +0,0 @@
-[submodule "epiceditor/static/epiceditor"]
- path = epiceditor/static/epiceditor
- url = git://github.com/OscarGodson/EpicEditor.git
1 epiceditor/static/epiceditor
@@ -1 +0,0 @@
-Subproject commit a904a50d7932162250af4730567c6163e5a75b08
View
BIN epiceditor/static/epiceditor/.DS_Store
Binary file not shown.
View
BIN epiceditor/static/epiceditor/images/edit.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN epiceditor/static/epiceditor/images/fullscreen.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN epiceditor/static/epiceditor/images/preview.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
2,141 epiceditor/static/epiceditor/js/epiceditor.js
2,141 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
4 epiceditor/static/epiceditor/js/epiceditor.min.js
@@ -0,0 +1,4 @@
+/**
+ * EpicEditor - An Embeddable JavaScript Markdown Editor (https://github.com/OscarGodson/EpicEditor)
+ * Copyright (c) 2011-2012, Oscar Godson. (MIT Licensed)
+ */(function(e,t){function n(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}function r(e,t){for(var n in t)t.hasOwnProperty(n)&&(e.style[n]=t[n])}function i(t,n){var r=t,i=null;return e.getComputedStyle?i=document.defaultView.getComputedStyle(r,null).getPropertyValue(n):r.currentStyle&&(i=r.currentStyle[n]),i}function s(e,t,n){var s={},o;if(t==="save"){for(o in n)n.hasOwnProperty(o)&&(s[o]=i(e,o));r(e,n)}else t==="apply"&&r(e,n);return s}function o(e){var t=parseInt(i(e,"border-left-width"),10)+parseInt(i(e,"border-right-width"),10),n=parseInt(i(e,"padding-left"),10)+parseInt(i(e,"padding-right"),10),r=e.offsetWidth,s;return isNaN(t)&&(t=0),s=t+n+r,s}function u(e){var t=parseInt(i(e,"border-top-width"),10)+parseInt(i(e,"border-bottom-width"),10),n=parseInt(i(e,"padding-top"),10)+parseInt(i(e,"padding-bottom"),10),r=e.offsetHeight,s;return isNaN(t)&&(t=0),s=t+n+r,s}function a(e,t,r){r=r||"";var i=t.getElementsByTagName("head")[0],s=t.createElement("link");n(s,{type:"text/css",id:r,rel:"stylesheet",href:e,name:e,media:"screen"}),i.appendChild(s)}function f(e,t,n){e.className=e.className.replace(t,n)}function l(e){return e.contentDocument||e.contentWindow.document}function c(e){var t;return typeof document.body.innerText=="string"?t=e.innerText:(t=e.innerHTML.replace(/<br>/gi,"\n"),t=t.replace(/<(?:.|\n)*?>/gm,""),t=t.replace(/&lt;/gi,"<"),t=t.replace(/&gt;/gi,">")),t}function h(e,t){return typeof document.body.innerText=="string"?(t=t.replace(/ /g," "),e.innerText=t):(t=t.replace(/</g,"&lt;"),t=t.replace(/>/g,"&gt;"),t=t.replace(/\n/g,"<br>"),t=t.replace(/\s\s/g," &nbsp;"),e.innerHTML=t),!0}function p(){var e=-1,t=navigator.userAgent,n;return navigator.appName=="Microsoft Internet Explorer"&&(n=/MSIE ([0-9]{1,}[\.0-9]{0,})/,n.exec(t)!=null&&(e=parseFloat(RegExp.$1,10))),e}function d(){var t=e.navigator;return t.userAgent.indexOf("Safari")>-1&&t.userAgent.indexOf("Chrome")==-1}function v(e){var t={};return e&&t.toString.call(e)==="[object Function]"}function m(){var e=arguments[0]||{},n=1,r=arguments.length,i=!1,s,o,u,a;typeof e=="boolean"&&(i=e,e=arguments[1]||{},n=2),typeof e!="object"&&!v(e)&&(e={}),r===n&&(e=this,--n);for(;n<r;n++)if((s=arguments[n])!=null)for(o in s)if(s.hasOwnProperty(o)){u=e[o],a=s[o];if(e===a)continue;i&&a&&typeof a=="object"&&!a.nodeType?e[o]=m(i,u||(a.length!=null?[]:{}),a):a!==t&&(e[o]=a)}return e}function g(e){var n=this,r=e||{},i,s,o={container:"epiceditor",basePath:"epiceditor",clientSideStorage:!0,localStorageName:"epiceditor",useNativeFullscreen:!0,file:{name:null,defaultContent:"",autoSave:100},theme:{base:"/themes/base/epiceditor.css",preview:"/themes/preview/github.css",editor:"/themes/editor/epic-dark.css"},focusOnLoad:!1,shortcut:{modifier:18,fullscreen:70,preview:80},parser:typeof marked=="function"?marked:null},u;n.settings=m(!0,o,r);if(typeof n.settings.parser!="function"||typeof n.settings.parser("TEST")!="string")n.settings.parser=function(e){return e};return typeof n.settings.container=="string"?n.element=document.getElementById(n.settings.container):typeof n.settings.container=="object"&&(n.element=n.settings.container),n.settings.file.name||(typeof n.settings.container=="string"?n.settings.file.name=n.settings.container:typeof n.settings.container=="object"&&(n.element.id?n.settings.file.name=n.element.id:(g._data.unnamedEditors||(g._data.unnamedEditors=[]),g._data.unnamedEditors.push(n),n.settings.file.name="__epiceditor-untitled-"+g._data.unnamedEditors.length))),n._instanceId="epiceditor-"+Math.round(Math.random()*1e5),n._storage={},n._canSave=!0,n._defaultFileSchema=function(){return{content:n.settings.file.defaultContent,created:new Date,modified:new Date}},localStorage&&n.settings.clientSideStorage&&(this._storage=localStorage,this._storage[n.settings.localStorageName]&&n.getFiles(n.settings.file.name)===t&&(s=n.getFiles(n.settings.file.name),s=n._defaultFileSchema(),s.content=n.settings.file.defaultContent)),this._storage[n.settings.localStorageName]||(u={},u[n.settings.file.name]=n._defaultFileSchema(),u=JSON.stringify(u),this._storage[n.settings.localStorageName]=u),n._eeState={fullscreen:!1,preview:!1,edit:!1,loaded:!1,unloaded:!1},n.events||(n.events={}),this}g.prototype.load=function(t){function C(t){if(Math.abs(g.y-t.pageY)>=5||Math.abs(g.x-t.pageX)>=5)h.style.display="block",v&&clearTimeout(v),v=e.setTimeout(function(){h.style.display="none"},1e3);g={y:t.pageY,x:t.pageX}}function k(e){e.keyCode==n.settings.shortcut.modifier&&(S=!0),e.keyCode==17&&(x=!0),S===!0&&e.keyCode==n.settings.shortcut.preview&&!n.is("fullscreen")&&(e.preventDefault(),n.is("edit")?n.preview():n.edit()),S===!0&&e.keyCode==n.settings.shortcut.fullscreen&&(e.preventDefault(),n._goFullscreen(E)),S===!0&&e.keyCode!==n.settings.shortcut.modifier&&(S=!1),e.keyCode==27&&n.is("fullscreen")&&n._exitFullscreen(E),x===!0&&e.keyCode==83&&(n.save(),e.preventDefault(),x=!1),e.metaKey&&e.keyCode==83&&(n.save(),e.preventDefault())}function L(e){e.keyCode==n.settings.shortcut.modifier&&(S=!1),e.keyCode==17&&(x=!1)}if(this.is("loaded"))return this;var n=this,o,u,f,c,h,v,m,g={y:-1,x:-1},y,b,w=!1,E,S=!1,x=!1,T,N;n.settings.useNativeFullscreen&&(w=document.body.webkitRequestFullScreen?!0:!1),d()&&(w=!1),!n.is("edit")&&!n.is("preview")&&(n._eeState.edit=!0),t=t||function(){},o={chrome:'<div id="epiceditor-wrapper" class="epiceditor-edit-mode"><iframe frameborder="0" id="epiceditor-editor-frame"></iframe><iframe frameborder="0" id="epiceditor-previewer-frame"></iframe><div id="epiceditor-utilbar"><img width="30" src="'+this.settings.basePath+'/images/preview.png" title="Toggle Preview Mode" class="epiceditor-toggle-btn epiceditor-toggle-preview-btn"> '+'<img width="30" src="'+this.settings.basePath+'/images/edit.png" title="Toggle Edit Mode" class="epiceditor-toggle-btn epiceditor-toggle-edit-btn"> '+'<img width="30" src="'+this.settings.basePath+'/images/fullscreen.png" title="Enter Fullscreen" class="epiceditor-fullscreen-btn">'+"</div>"+"</div>",previewer:'<div id="epiceditor-preview"></div>'},n.element.innerHTML='<iframe scrolling="no" frameborder="0" id= "'+n._instanceId+'"></iframe>',n.element.style.height=n.element.offsetHeight+"px",u=document.getElementById(n._instanceId),n.iframeElement=u,n.iframe=l(u),n.iframe.open(),n.iframe.write(o.chrome),n.editorIframe=n.iframe.getElementById("epiceditor-editor-frame"),n.previewerIframe=n.iframe.getElementById("epiceditor-previewer-frame"),n.editorIframeDocument=l(n.editorIframe),n.editorIframeDocument.open(),n.editorIframeDocument.write(""),n.editorIframeDocument.close(),n.previewerIframeDocument=l(n.previewerIframe),n.previewerIframeDocument.open(),n.previewerIframeDocument.write(o.previewer),f=n.previewerIframeDocument.createElement("base"),f.target="_blank",n.previewerIframeDocument.getElementsByTagName("head")[0].appendChild(f),n.previewerIframeDocument.close(),n.reflow(),a(n.settings.basePath+n.settings.theme.base,n.iframe,"theme"),a(n.settings.basePath+n.settings.theme.editor,n.editorIframeDocument,"theme"),a(n.settings.basePath+n.settings.theme.preview,n.previewerIframeDocument,"theme"),n.iframe.getElementById("epiceditor-wrapper").style.position="relative",n.editor=n.editorIframeDocument.body,n.previewer=n.previewerIframeDocument.getElementById("epiceditor-preview"),n.editor.contentEditable=!0,n.iframe.body.style.height=this.element.offsetHeight+"px",this.previewerIframe.style.display="none",p()>-1&&(this.previewer.style.height=parseInt(i(this.previewer,"height"),10)+2),this.open(n.settings.file.name),n.settings.focusOnLoad&&n.iframe.addEventListener("readystatechange",function(){n.iframe.readyState=="complete"&&n.editorIframeDocument.body.focus()}),c=n.iframe.getElementById("epiceditor-utilbar"),y={},n._goFullscreen=function(t){if(n.is("fullscreen")){n._exitFullscreen(t);return}w&&t.webkitRequestFullScreen(),b=n.is("edit"),n._eeState.fullscreen=!0,n._eeState.edit=!0,n._eeState.preview=!0;var r=e.innerWidth,o=e.innerHeight,u=e.outerWidth,a=e.outerHeight;w||(a=e.innerHeight),y.editorIframe=s(n.editorIframe,"save",{width:u/2+"px",height:a+"px","float":"left",cssFloat:"left",styleFloat:"left",display:"block"}),y.previewerIframe=s(n.previewerIframe,"save",{width:u/2+"px",height:a+"px","float":"right",cssFloat:"right",styleFloat:"right",display:"block"}),y.element=s(n.element,"save",{position:"fixed",top:"0",left:"0",width:"100%","z-index":"9999",zIndex:"9999",border:"none",margin:"0",background:i(n.editor,"background-color"),height:o+"px"}),y.iframeElement=s(n.iframeElement,"save",{width:u+"px",height:o+"px"}),c.style.visibility="hidden",w||(document.body.style.overflow="hidden"),n.preview(),n.editorIframeDocument.body.focus(),n.emit("fullscreenenter")},n._exitFullscreen=function(e){s(n.element,"apply",y.element),s(n.iframeElement,"apply",y.iframeElement),s(n.editorIframe,"apply",y.editorIframe),s(n.previewerIframe,"apply",y.previewerIframe),n.element.style.width=n._eeState.reflowWidth?n._eeState.reflowWidth:"",n.element.style.height=n._eeState.reflowHeight?n._eeState.reflowHeight:"",c.style.visibility="visible",w?document.webkitCancelFullScreen():document.body.style.overflow="auto",n._eeState.fullscreen=!1,b?n.edit():n.preview(),n.reflow(),n.emit("fullscreenexit")},n.editor.addEventListener("keyup",function(){m&&e.clearTimeout(m),m=e.setTimeout(function(){n.is("fullscreen")&&n.preview()},250)}),E=n.iframeElement,c.addEventListener("click",function(e){var t=e.target.className;t.indexOf("epiceditor-toggle-preview-btn")>-1?n.preview():t.indexOf("epiceditor-toggle-edit-btn")>-1?n.edit():t.indexOf("epiceditor-fullscreen-btn")>-1&&n._goFullscreen(E)}),document.body.webkitRequestFullScreen&&E.addEventListener("webkitfullscreenchange",function(){document.webkitIsFullScreen||n._exitFullscreen(E)},!1),h=n.iframe.getElementById("epiceditor-utilbar"),h.style.display="none",h.addEventListener("mouseover",function(){v&&clearTimeout(v)}),T=[n.previewerIframeDocument,n.editorIframeDocument];for(N=0;N<T.length;N++)T[N].addEventListener("mousemove",function(e){C(e)}),T[N].addEventListener("scroll",function(e){C(e)}),T[N].addEventListener("keyup",function(e){L(e)}),T[N].addEventListener("keydown",function(e){k(e)});return n.settings.file.autoSave&&(n.saveInterval=e.setInterval(function(){if(!n._canSave)return;n.save()},n.settings.file.autoSave)),e.addEventListener("resize",function(){!n.iframe.webkitRequestFullScreen&&n.is("fullscreen")?(r(n.iframeElement,{width:e.outerWidth+"px",height:e.innerHeight+"px"}),r(n.element,{height:e.innerHeight+"px"}),r(n.previewerIframe,{width:e.outerWidth/2+"px",height:e.innerHeight+"px"}),r(n.editorIframe,{width:e.outerWidth/2+"px",height:e.innerHeight+"px"})):n.is("fullscreen")||n.reflow()}),n._eeState.loaded=!0,n._eeState.unloaded=!1,n.is("preview")?n.preview():n.edit(),n.iframe.close(),t.call(this),this.emit("load"),this},g.prototype.unload=function(t){if(this.is("unloaded"))throw new Error("Editor isn't loaded");var n=this,r=e.parent.document.getElementById(n._instanceId);return r.parentNode.removeChild(r),n._eeState.loaded=!1,n._eeState.unloaded=!0,t=t||function(){},n.saveInterval&&e.clearInterval(n.saveInterval),t.call(this),n.emit("unload"),n},g.prototype.reflow=function(e){var t=this,n=o(t.element)-t.element.offsetWidth,r=u(t.element)-t.element.offsetHeight,i=[t.iframeElement,t.editorIframe,t.previewerIframe],s,a;for(var f=0;f<i.length;f++){if(!e||e=="width")s=t.element.offsetWidth-n+"px",i[f].style.width=s,t._eeState.reflowWidth=s;if(!e||e=="height")a=t.element.offsetHeight-r+"px",i[f].style.height=a,t._eeState.reflowHeight=a}return t},g.prototype.preview=function(t){var n=this,r,i;t=t||n.settings.basePath+n.settings.theme.preview,f(n.getElement("wrapper"),"epiceditor-edit-mode","epiceditor-preview-mode"),n.previewerIframeDocument.getElementById("theme")?n.previewerIframeDocument.getElementById("theme").name!==t&&(n.previewerIframeDocument.getElementById("theme").href=t):a(t,n.previewerIframeDocument,"theme"),n.previewer.innerHTML=n.exportFile(null,"html"),i=n.previewer.getElementsByTagName("a");for(r in i)i[r].hash&&i[r].hostname==e.location.hostname&&(i[r].target="_self");return n.is("fullscreen")||(n.editorIframe.style.display="none",n.previewerIframe.style.display="block",n._eeState.preview=!0,n._eeState.edit=!1,n.previewerIframe.focus()),n.emit("preview"),n},g.prototype.enterFullscreen=function(){return this.is("fullscreen")?this:(this._goFullscreen(this.iframeElement),this)},g.prototype.exitFullscreen=function(){return this.is("fullscreen")?(this._exitFullscreen(this.iframeElement),this):this},g.prototype.edit=function(){var e=this;return f(e.getElement("wrapper"),"epiceditor-preview-mode","epiceditor-edit-mode"),e._eeState.preview=!1,e._eeState.edit=!0,e.editorIframe.style.display="block",e.previewerIframe.style.display="none",e.editorIframe.focus(),e.emit("edit"),this},g.prototype.getElement=function(e){var t={container:this.element,wrapper:this.iframe.getElementById("epiceditor-wrapper"),wrapperIframe:this.iframeElement,editor:this.editorIframeDocument,editorIframe:this.editorIframe,previewer:this.previewerIframeDocument,previewerIframe:this.previewerIframe};return!t[e]||this.is("unloaded")?null:t[e]},g.prototype.is=function(e){var t=this;switch(e){case"loaded":return t._eeState.loaded;case"unloaded":return t._eeState.unloaded;case"preview":return t._eeState.preview;case"edit":return t._eeState.edit;case"fullscreen":return t._eeState.fullscreen;default:return!1}},g.prototype.open=function(e){var n=this,r=n.settings.file.defaultContent,i;return e=e||n.settings.file.name,n.settings.file.name=e,this._storage[n.settings.localStorageName]&&(i=n.getFiles(),i[e]!==t?(h(n.editor,i[e].content),n.emit("read")):(h(n.editor,r),n.save(),n.emit("create")),n.previewer.innerHTML=n.exportFile(null,"html"),n.emit("open")),this},g.prototype.save=function(){var e=this,n,r=!1,i=e.settings.file.name,s=c(this.editor);return this._canSave=!0,n=JSON.parse(this._storage[e.settings.localStorageName]),n[i]===t?n[i]=e._defaultFileSchema():s!==n[i].content&&(n[i].modified=new Date,r=!0),n[i].content=s,this._storage[e.settings.localStorageName]=JSON.stringify(n),r&&e.emit("update"),this.emit("save"),this},g.prototype.remove=function(e){var t=this,n;return e=e||t.settings.file.name,e==t.settings.file.name&&(t._canSave=!1),n=JSON.parse(this._storage[t.settings.localStorageName]),delete n[e],this._storage[t.settings.localStorageName]=JSON.stringify(n),this.emit("remove"),this},g.prototype.rename=function(e,t){var n=this,r=JSON.parse(this._storage[n.settings.localStorageName]);return r[t]=r[e],delete r[e],this._storage[n.settings.localStorageName]=JSON.stringify(r),n.open(t),this},g.prototype.importFile=function(e,n,r,i){var s=this,o=!1;return e=e||s.settings.file.name,n=n||"",r=r||"md",i=i||{},JSON.parse(this._storage[s.settings.localStorageName])[e]===t&&(o=!0),s.settings.file.name=e,h(s.editor,n),o&&s.emit("create"),s.save(),s.is("fullscreen")&&s.preview(),this},g.prototype.exportFile=function(e,n){var r=this,i,s;e=e||r.settings.file.name,n=n||"text",i=r.getFiles(e);if(i===t)return;s=i.content;switch(n){case"html":return s=s.replace(/\u00a0/g," ").replace(/&nbsp;/g," "),r.settings.parser(s);case"text":return s=s.replace(/\u00a0/g," ").replace(/&nbsp;/g," "),s;default:return s}},g.prototype.getFiles=function(e){var t=JSON.parse(this._storage[this.settings.localStorageName]);return e?t[e]:t},g.prototype.on=function(e,t){var n=this;return this.events[e]||(this.events[e]=[]),this.events[e].push(t),n},g.prototype.emit=function(e,t){function i(e){e.call(n,t)}var n=this,r;t=t||n.getFiles(n.settings.file.name);if(!this.events[e])return;for(r=0;r<n.events[e].length;r++)i(n.events[e][r]);return n},g.prototype.removeListener=function(e,t){var n=this;return t?this.events[e]?(this.events[e].splice(this.events[e].indexOf(t),1),n):n:(this.events[e]=[],n)},g.version="0.2.0",g._data={},e.EpicEditor=g})(window),function(){function n(e,n){return e[0][0]!=="!"?'<a href="'+f(n.href)+'"'+(n.title?' title="'+f(n.title)+'"':"")+">"+t.lexer(e[1])+"</a>":'<img src="'+f(n.href)+'" alt="'+f(e[1])+'"'+(n.title?' title="'+f(n.title)+'"':"")+">"}function s(){return i=r.pop()}function o(){switch(i.type){case"space":return"";case"hr":return"<hr>\n";case"heading":return"<h"+i.depth+">"+t.lexer(i.text)+"</h"+i.depth+">\n";case"code":return v.highlight&&(i.code=v.highlight(i.text,i.lang),i.code!=null&&i.code!==i.text&&(i.escaped=!0,i.text=i.code)),i.escaped||(i.text=f(i.text,!0)),"<pre><code"+(i.lang?' class="lang-'+i.lang+'"':"")+">"+i.text+"</code></pre>\n";case"blockquote_start":var e="";while(s().type!=="blockquote_end")e+=o();return"<blockquote>\n"+e+"</blockquote>\n";case"list_start":var n=i.ordered?"ol":"ul",e="";while(s().type!=="list_end")e+=o();return"<"+n+">\n"+e+"</"+n+">\n";case"list_item_start":var e="";while(s().type!=="list_item_end")e+=i.type==="text"?u():o();return"<li>"+e+"</li>\n";case"loose_item_start":var e="";while(s().type!=="list_item_end")e+=o();return"<li>"+e+"</li>\n";case"html":return v.sanitize?t.lexer(i.text):!i.pre&&!v.pedantic?t.lexer(i.text):i.text;case"paragraph":return"<p>"+t.lexer(i.text)+"</p>\n";case"text":return"<p>"+u()+"</p>\n"}}function u(){var e=i.text,n;while((n=r[r.length-1])&&n.type==="text")e+="\n"+s().text;return t.lexer(e)}function a(e){r=e.reverse();var t="";while(s())t+=o();return r=null,i=null,t}function f(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function l(e){var t="",n=e.length,r=0,i;for(;r<n;r++)i=e.charCodeAt(r),Math.random()>.5&&(i="x"+i.toString(16)),t+="&#"+i+";";return t}function c(){var e="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+";return e}function h(e,t){return e=e.source,t=t||"",function n(r,i){return r?(e=e.replace(r,i.source||i),n):new RegExp(e,t)}}function p(){}function d(t,n){return g(n),a(e.lexer(t))}function g(n){n||(n=m);if(v===n)return;v=n,v.gfm?(e.fences=e.gfm.fences,e.paragraph=e.gfm.paragraph,t.text=t.gfm.text,t.url=t.gfm.url):(e.fences=e.normal.fences,e.paragraph=e.normal.paragraph,t.text=t.normal.text,t.url=t.normal.url),v.pedantic?(t.em=t.pedantic.em,t.strong=t.pedantic.strong):(t.em=t.normal.em,t.strong=t.normal.strong)}var e={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:p,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,lheading:/^([^\n]+)\n *(=|-){3,} *\n*/,blockquote:/^( *>[^\n]+(\n[^\n]+)*\n*)+/,list:/^( *)(bull) [^\0]+?(?:hr|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment|closed|closing) *(?:\n{2,}|\s*$)/,def:/^ *\[([^\]]+)\]: *([^\s]+)(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,paragraph:/^([^\n]+\n?(?!body))+\n*/,text:/^[^\n]+/};e.bullet=/(?:[*+-]|\d+\.)/,e.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,e.item=h(e.item,"gm")(/bull/g,e.bullet)(),e.list=h(e.list)(/bull/g,e.bullet)("hr",/\n+(?=(?: *[-*_]){3,} *(?:\n+|$))/)(),e.html=h(e.html)("comment",/<!--[^\0]*?-->/)("closed",/<(tag)[^\0]+?<\/\1>/)("closing",/<tag(?!:\/|@)\b(?:"[^"]*"|'[^']*'|[^'">])*?>/)(/tag/g,c())(),e.paragraph=function(){var t=e.paragraph.source,n=[];return function r(t){return t=e[t]?e[t].source:t,n.push(t.replace(/(^|[^\[])\^/g,"$1")),r}("hr")("heading")("lheading")("blockquote")("<"+c())("def"),new RegExp(t.replace("body",n.join("|")))}(),e.normal={fences:e.fences,paragraph:e.paragraph},e.gfm={fences:/^ *``` *(\w+)? *\n([^\0]+?)\s*``` *(?:\n+|$)/,paragraph:/^/},e.gfm.paragraph=h(e.paragraph)("(?!","(?!"+e.gfm.fences.source.replace(/(^|[^\[])\^/g,"$1")+"|")(),e.lexer=function(t){var n=[];return n.links={},t=t.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),e.token(t,n,!0)},e.token=function(t,n,r){var t=t.replace(/^ +$/gm,""),i,s,o,u,a,f,l;while(t){if(o=e.newline.exec(t))t=t.substring(o[0].length),o[0].length>1&&n.push({type:"space"});if(o=e.code.exec(t)){t=t.substring(o[0].length),o=o[0].replace(/^ {4}/gm,""),n.push({type:"code",text:v.pedantic?o:o.replace(/\n+$/,"")});continue}if(o=e.fences.exec(t)){t=t.substring(o[0].length),n.push({type:"code",lang:o[1],text:o[2]});continue}if(o=e.heading.exec(t)){t=t.substring(o[0].length),n.push({type:"heading",depth:o[1].length,text:o[2]});continue}if(o=e.lheading.exec(t)){t=t.substring(o[0].length),n.push({type:"heading",depth:o[2]==="="?1:2,text:o[1]});continue}if(o=e.hr.exec(t)){t=t.substring(o[0].length),n.push({type:"hr"});continue}if(o=e.blockquote.exec(t)){t=t.substring(o[0].length),n.push({type:"blockquote_start"}),o=o[0].replace(/^ *> ?/gm,""),e.token(o,n,r),n.push({type:"blockquote_end"});continue}if(o=e.list.exec(t)){t=t.substring(o[0].length),n.push({type:"list_start",ordered:isFinite(o[2])}),o=o[0].match(e.item),i=!1,l=o.length,f=0;for(;f<l;f++)u=o[f],a=u.length,u=u.replace(/^ *([*+-]|\d+\.) +/,""),~u.indexOf("\n ")&&(a-=u.length,u=v.pedantic?u.replace(/^ {1,4}/gm,""):u.replace(new RegExp("^ {1,"+a+"}","gm"),"")),s=i||/\n\n(?!\s*$)/.test(u),f!==l-1&&(i=u[u.length-1]==="\n",s||(s=i)),n.push({type:s?"loose_item_start":"list_item_start"}),e.token(u,n),n.push({type:"list_item_end"});n.push({type:"list_end"});continue}if(o=e.html.exec(t)){t=t.substring(o[0].length),n.push({type:"html",pre:o[1]==="pre",text:o[0]});continue}if(r&&(o=e.def.exec(t))){t=t.substring(o[0].length),n.links[o[1].toLowerCase()]={href:o[2],title:o[3]};continue}if(r&&(o=e.paragraph.exec(t))){t=t.substring(o[0].length),n.push({type:"paragraph",text:o[0]});continue}if(o=e.text.exec(t)){t=t.substring(o[0].length),n.push({type:"text",text:o[0]});continue}}return n};var t={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:p,tag:/^<!--[^\0]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([^\0]+?)__(?!_)|^\*\*([^\0]+?)\*\*(?!\*)/,em:/^\b_((?:__|[^\0])+?)_\b|^\*((?:\*\*|[^\0])+?)\*(?!\*)/,code:/^(`+)([^\0]*?[^`])\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,text:/^[^\0]+?(?=[\\<!\[_*`]| {2,}\n|$)/};t._linkInside=/(?:\[[^\]]*\]|[^\]]|\](?=[^\[]*\]))*/,t._linkHref=/\s*<?([^\s]*?)>?(?:\s+['"]([^\0]*?)['"])?\s*/,t.link=h(t.link)("inside",t._linkInside)("href",t._linkHref)(),t.reflink=h(t.reflink)("inside",t._linkInside)(),t.normal={url:t.url,strong:t.strong,em:t.em,text:t.text},t.pedantic={strong:/^__(?=\S)([^\0]*?\S)__(?!_)|^\*\*(?=\S)([^\0]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([^\0]*?\S)_(?!_)|^\*(?=\S)([^\0]*?\S)\*(?!\*)/},t.gfm={url:/^(https?:\/\/[^\s]+[^.,:;"')\]\s])/,text:/^[^\0]+?(?=[\\<!\[_*`]|https?:\/\/| {2,}\n|$)/},t.lexer=function(e){var i="",s=r.links,o,u,a,c;while(e){if(c=t.escape.exec(e)){e=e.substring(c[0].length),i+=c[1];continue}if(c=t.autolink.exec(e)){e=e.substring(c[0].length),c[2]==="@"?(u=c[1][6]===":"?l(c[1].substring(7)):l(c[1]),a=l("mailto:")+u):(u=f(c[1]),a=u),i+='<a href="'+a+'">'+u+"</a>";continue}if(c=t.url.exec(e)){e=e.substring(c[0].length),u=f(c[1]),a=u,i+='<a href="'+a+'">'+u+"</a>";continue}if(c=t.tag.exec(e)){e=e.substring(c[0].length),i+=v.sanitize?f(c[0]):c[0];continue}if(c=t.link.exec(e)){e=e.substring(c[0].length),i+=n(c,{href:c[2],title:c[3]});continue}if((c=t.reflink.exec(e))||(c=t.nolink.exec(e))){e=e.substring(c[0].length),o=(c[2]||c[1]).replace(/\s+/g," "),o=s[o.toLowerCase()];if(!o||!o.href){i+=c[0][0],e=c[0].substring(1)+e;continue}i+=n(c,o);continue}if(c=t.strong.exec(e)){e=e.substring(c[0].length),i+="<strong>"+t.lexer(c[2]||c[1])+"</strong>";continue}if(c=t.em.exec(e)){e=e.substring(c[0].length),i+="<em>"+t.lexer(c[2]||c[1])+"</em>";continue}if(c=t.code.exec(e)){e=e.substring(c[0].length),i+="<code>"+f(c[2],!0)+"</code>";continue}if(c=t.br.exec(e)){e=e.substring(c[0].length),i+="<br>";continue}if(c=t.text.exec(e)){e=e.substring(c[0].length),i+=f(c[0]);continue}}return i};var r,i;p.exec=p;var v,m;d.options=d.setOptions=function(e){return m=e,g(e),d},d.setOptions({gfm:!0,pedantic:!1,sanitize:!1,highlight:null}),d.parser=function(e,t){return g(t),a(e)},d.lexer=function(t,n){return g(n),e.lexer(t)},d.parse=d,typeof module!="undefined"?module.exports=d:this.marked=d}.call(function(){return this||(typeof window!="undefined"?window:global)}());
View
31 epiceditor/static/epiceditor/themes/base/epiceditor.css
@@ -0,0 +1,31 @@
+html, body, iframe, div { margin:0; padding:0; }
+
+#epiceditor-utilbar {
+ position:fixed;
+ bottom:10px;
+ right:10px;
+ padding:5px;
+}
+
+#epiceditor-utilbar img {
+ display:block;
+ float:left;
+ width: 30px;
+ height: 30px;
+}
+
+#epiceditor-utilbar img:last-child {
+ margin-left: 15px;
+}
+
+#epiceditor-utilbar img:hover {
+ cursor:pointer;
+}
+
+.epiceditor-edit-mode #epiceditor-utilbar img.epiceditor-toggle-edit-btn {
+ display: none;
+}
+
+.epiceditor-preview-mode #epiceditor-utilbar img.epiceditor-toggle-preview-btn {
+ display: none;
+}
View
13 epiceditor/static/epiceditor/themes/editor/epic-dark.css
@@ -0,0 +1,13 @@
+html { padding:10px; }
+
+body {
+ border:0;
+ background:rgb(41,41,41);
+ font-family:monospace;
+ font-size:14px;
+ padding:10px;
+ color:#ddd;
+ line-height:1.35em;
+ margin:0;
+ padding:0;
+}
View
12 epiceditor/static/epiceditor/themes/editor/epic-light.css
@@ -0,0 +1,12 @@
+html { padding:10px; }
+
+body {
+ border:0;
+ background:#fcfcfc;
+ font-family:monospace;
+ font-size:14px;
+ padding:10px;
+ line-height:1.35em;
+ margin:0;
+ padding:0;
+}
View
167 epiceditor/static/epiceditor/themes/preview/bartik.css
@@ -0,0 +1,167 @@
+body {
+ font-family: Georgia, "Times New Roman", Times, serif;
+ line-height: 1.5;
+ font-size: 87.5%;
+ word-wrap: break-word;
+ margin: 2em;
+ padding: 0;
+ border: 0;
+ outline: 0;
+ background: #fff;
+}
+
+h1,
+h2,
+h3,
+h4,
+h5,
+h6 {
+ margin: 1.0em 0 0.5em;
+ font-weight: inherit;
+}
+
+h1 {
+ font-size: 1.357em;
+ color: #000;
+}
+
+h2 {
+ font-size: 1.143em;
+}
+
+p {
+ margin: 0 0 1.2em;
+}
+
+del {
+ text-decoration: line-through;
+}
+
+tr:nth-child(odd) {
+ background-color: #dddddd;
+}
+
+img {
+ outline: 0;
+}
+
+code {
+ background-color: #f2f2f2;
+ background-color: rgba(40, 40, 0, 0.06);
+}
+
+pre {
+ background-color: #f2f2f2;
+ background-color: rgba(40, 40, 0, 0.06);
+ margin: 10px 0;
+ overflow: hidden;
+ padding: 15px;
+ white-space: pre-wrap;
+}
+
+pre code {
+ font-size: 100%;
+ background-color: transparent;
+}
+
+blockquote {
+ background: #f7f7f7;
+ border-left: 1px solid #bbb;
+ font-style: italic;
+ margin: 1.5em 10px;
+ padding: 0.5em 10px;
+}
+
+blockquote:before {
+ color: #bbb;
+ content: "\201C";
+ font-size: 3em;
+ line-height: 0.1em;
+ margin-right: 0.2em;
+ vertical-align: -.4em;
+}
+
+blockquote:after {
+ color: #bbb;
+ content: "\201D";
+ font-size: 3em;
+ line-height: 0.1em;
+ vertical-align: -.45em;
+}
+
+blockquote > p:first-child {
+ display: inline;
+}
+
+table {
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
+ border: 0;
+ border-spacing: 0;
+ font-size: 0.857em;
+ margin: 10px 0;
+ width: 100%;
+}
+
+table table {
+ font-size: 1em;
+}
+
+table tr th {
+ background: #757575;
+ background: rgba(0, 0, 0, 0.51);
+ border-bottom-style: none;
+}
+
+table tr th,
+table tr th a,
+table tr th a:hover {
+ color: #FFF;
+ font-weight: bold;
+}
+
+table tbody tr th {
+ vertical-align: top;
+}
+
+tr td,
+tr th {
+ padding: 4px 9px;
+ border: 1px solid #fff;
+ text-align: left; /* LTR */
+}
+
+tr:nth-child(odd) {
+ background: #e4e4e4;
+ background: rgba(0, 0, 0, 0.105);
+}
+
+tr,
+tr:nth-child(even) {
+ background: #efefef;
+ background: rgba(0, 0, 0, 0.063);
+}
+
+a {
+ color: #0071B3;
+}
+
+a:hover,
+a:focus {
+ color: #018fe2;
+}
+
+a:active {
+ color: #23aeff;
+}
+
+a:link,
+a:visited {
+ text-decoration: none;
+}
+
+a:hover,
+a:active,
+a:focus {
+ text-decoration: underline;
+}
+
View
368 epiceditor/static/epiceditor/themes/preview/github.css
@@ -0,0 +1,368 @@
+html { padding:0 10px; }
+
+body {
+ margin:0;
+ padding:0;
+ background:#fff;
+}
+
+#epiceditor-wrapper{
+ background:white;
+}
+
+#epiceditor-preview{
+ padding-top:10px;
+ padding-bottom:10px;
+ font-family: Helvetica,arial,freesans,clean,sans-serif;
+ font-size:13px;
+ line-height:1.6;
+}
+
+#epiceditor-preview>*:first-child{
+ margin-top:0!important;
+}
+
+#epiceditor-preview>*:last-child{
+ margin-bottom:0!important;
+}
+
+#epiceditor-preview a{
+ color:#4183C4;
+ text-decoration:none;
+}
+
+#epiceditor-preview a:hover{
+ text-decoration:underline;
+}
+
+#epiceditor-preview h1,
+#epiceditor-preview h2,
+#epiceditor-preview h3,
+#epiceditor-preview h4,
+#epiceditor-preview h5,
+#epiceditor-preview h6{
+ margin:20px 0 10px;
+ padding:0;
+ font-weight:bold;
+ -webkit-font-smoothing:antialiased;
+}
+
+#epiceditor-preview h1 tt,
+#epiceditor-preview h1 code,
+#epiceditor-preview h2 tt,
+#epiceditor-preview h2 code,
+#epiceditor-preview h3 tt,
+#epiceditor-preview h3 code,
+#epiceditor-preview h4 tt,
+#epiceditor-preview h4 code,
+#epiceditor-preview h5 tt,
+#epiceditor-preview h5 code,
+#epiceditor-preview h6 tt,
+#epiceditor-preview h6 code{
+ font-size:inherit;
+}
+
+#epiceditor-preview h1{
+ font-size:28px;
+ color:#000;
+}
+
+#epiceditor-preview h2{
+ font-size:24px;
+ border-bottom:1px solid #ccc;
+ color:#000;
+}
+
+#epiceditor-preview h3{
+ font-size:18px;
+}
+
+#epiceditor-preview h4{
+ font-size:16px;
+}
+
+#epiceditor-preview h5{
+ font-size:14px;
+}
+
+#epiceditor-preview h6{
+ color:#777;
+ font-size:14px;
+}
+
+#epiceditor-preview p,
+#epiceditor-preview blockquote,
+#epiceditor-preview ul,
+#epiceditor-preview ol,
+#epiceditor-preview dl,
+#epiceditor-preview li,
+#epiceditor-preview table,
+#epiceditor-preview pre{
+ margin:15px 0;
+}
+
+#epiceditor-preview hr{
+ background:transparent url('../../images/modules/pulls/dirty-shade.png') repeat-x 0 0;
+ border:0 none;
+ color:#ccc;
+ height:4px;
+ padding:0;
+}
+
+#epiceditor-preview>h2:first-child,
+#epiceditor-preview>h1:first-child,
+#epiceditor-preview>h1:first-child+h2,
+#epiceditor-preview>h3:first-child,
+#epiceditor-preview>h4:first-child,
+#epiceditor-preview>h5:first-child,
+#epiceditor-preview>h6:first-child{
+ margin-top:0;
+ padding-top:0;
+}
+
+#epiceditor-preview h1+p,
+#epiceditor-preview h2+p,
+#epiceditor-preview h3+p,
+#epiceditor-preview h4+p,
+#epiceditor-preview h5+p,
+#epiceditor-preview h6+p{
+ margin-top:0;
+}
+
+#epiceditor-preview li p.first{
+ display:inline-block;
+}
+
+#epiceditor-preview ul,
+#epiceditor-preview ol{
+ padding-left:30px;
+}
+
+#epiceditor-preview ul li>:first-child,
+#epiceditor-preview ol li>:first-child{
+ margin-top:0;
+}
+
+#epiceditor-preview ul li>:last-child,
+#epiceditor-preview ol li>:last-child{
+ margin-bottom:0;
+}
+
+#epiceditor-preview dl{
+ padding:0;
+}
+
+#epiceditor-preview dl dt{
+ font-size:14px;
+ font-weight:bold;
+ font-style:italic;
+ padding:0;
+ margin:15px 0 5px;
+}
+
+#epiceditor-preview dl dt:first-child{
+ padding:0;
+}
+
+#epiceditor-preview dl dt>:first-child{
+ margin-top:0;
+}
+
+#epiceditor-preview dl dt>:last-child{
+ margin-bottom:0;
+}
+
+#epiceditor-preview dl dd{
+ margin:0 0 15px;
+ padding:0 15px;
+}
+
+#epiceditor-preview dl dd>:first-child{
+ margin-top:0;
+}
+
+#epiceditor-preview dl dd>:last-child{
+ margin-bottom:0;
+}
+
+#epiceditor-preview blockquote{
+ border-left:4px solid #DDD;
+ padding:0 15px;
+ color:#777;
+}
+
+#epiceditor-preview blockquote>:first-child{
+ margin-top:0;
+}
+
+#epiceditor-preview blockquote>:last-child{
+ margin-bottom:0;
+}
+
+#epiceditor-preview table{
+ padding:0;
+ border-collapse: collapse;
+ border-spacing: 0;
+ font-size: 100%;
+ font: inherit;
+}
+
+#epiceditor-preview table tr{
+ border-top:1px solid #ccc;
+ background-color:#fff;
+ margin:0;
+ padding:0;
+}
+
+#epiceditor-preview table tr:nth-child(2n){
+ background-color:#f8f8f8;
+}
+
+#epiceditor-preview table tr th{
+ font-weight:bold;
+}
+
+#epiceditor-preview table tr th,
+#epiceditor-preview table tr td{
+ border:1px solid #ccc;
+ text-align:left;
+ margin:0;
+ padding:6px 13px;
+}
+
+#epiceditor-preview table tr th>:first-child,
+#epiceditor-preview table tr td>:first-child{
+ margin-top:0;
+}
+
+#epiceditor-preview table tr th>:last-child,
+#epiceditor-preview table tr td>:last-child{
+ margin-bottom:0;
+}
+
+#epiceditor-preview img{
+ max-width:100%;
+}
+
+#epiceditor-preview span.frame{
+ display:block;
+ overflow:hidden;
+}
+
+#epiceditor-preview span.frame>span{
+ border:1px solid #ddd;
+ display:block;
+ float:left;
+ overflow:hidden;
+ margin:13px 0 0;
+ padding:7px;
+ width:auto;
+}
+
+#epiceditor-preview span.frame span img{
+ display:block;
+ float:left;
+}
+
+#epiceditor-preview span.frame span span{
+ clear:both;
+ color:#333;
+ display:block;
+ padding:5px 0 0;
+}
+
+#epiceditor-preview span.align-center{
+ display:block;
+ overflow:hidden;
+ clear:both;
+}
+
+#epiceditor-preview span.align-center>span{
+ display:block;
+ overflow:hidden;
+ margin:13px auto 0;
+ text-align:center;
+}
+
+#epiceditor-preview span.align-center span img{
+ margin:0 auto;
+ text-align:center;
+}
+
+#epiceditor-preview span.align-right{
+ display:block;
+ overflow:hidden;
+ clear:both;
+}
+
+#epiceditor-preview span.align-right>span{
+ display:block;
+ overflow:hidden;
+ margin:13px 0 0;
+ text-align:right;
+}
+
+#epiceditor-preview span.align-right span img{
+ margin:0;
+ text-align:right;
+}
+
+#epiceditor-preview span.float-left{
+ display:block;
+ margin-right:13px;
+ overflow:hidden;
+ float:left;
+}
+
+#epiceditor-preview span.float-left span{
+ margin:13px 0 0;
+}
+
+#epiceditor-preview span.float-right{
+ display:block;
+ margin-left:13px;
+ overflow:hidden;
+ float:right;
+}
+
+#epiceditor-preview span.float-right>span{
+ display:block;
+ overflow:hidden;
+ margin:13px auto 0;
+ text-align:right;
+}
+
+#epiceditor-preview code,
+#epiceditor-preview tt{
+ margin:0 2px;
+ padding:0 5px;
+ white-space:nowrap;
+ border:1px solid #eaeaea;
+ background-color:#f8f8f8;
+ border-radius:3px;
+}
+
+#epiceditor-preview pre>code{
+ margin:0;
+ padding:0;
+ white-space:pre;
+ border:none;
+ background:transparent;
+}
+
+#epiceditor-preview .highlight pre,
+#epiceditor-preview pre{
+ background-color:#f8f8f8;
+ border:1px solid #ccc;
+ font-size:13px;
+ line-height:19px;
+ overflow:auto;
+ padding:6px 10px;
+ border-radius:3px;
+}
+
+#epiceditor-preview pre code,
+#epiceditor-preview pre tt{
+ background-color:transparent;
+ border:none;
+}
View
121 epiceditor/static/epiceditor/themes/preview/preview-dark.css
@@ -0,0 +1,121 @@
+html { padding:0 10px; }
+
+body {
+ margin:0;
+ padding:10px 0;
+ background:#000;
+}
+
+#epiceditor-preview h1,
+#epiceditor-preview h2,
+#epiceditor-preview h3,
+#epiceditor-preview h4,
+#epiceditor-preview h5,
+#epiceditor-preview h6,
+#epiceditor-preview p,
+#epiceditor-preview blockquote {
+ margin: 0;
+ padding: 0;
+}
+#epiceditor-preview {
+ background:#000;
+ font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", Arial, sans-serif;
+ font-size: 13px;
+ line-height: 18px;
+ color: #ccc;
+}
+#epiceditor-preview a {
+ color: #fff;
+}
+#epiceditor-preview a:hover {
+ color: #00ff00;
+ text-decoration: none;
+}
+#epiceditor-preview a img {
+ border: none;
+}
+#epiceditor-preview p {
+ margin-bottom: 9px;
+}
+#epiceditor-preview h1,
+#epiceditor-preview h2,
+#epiceditor-preview h3,
+#epiceditor-preview h4,
+#epiceditor-preview h5,
+#epiceditor-preview h6 {
+ color: #cdcdcd;
+ line-height: 36px;
+}
+#epiceditor-preview h1 {
+ margin-bottom: 18px;
+ font-size: 30px;
+}
+#epiceditor-preview h2 {
+ font-size: 24px;
+}
+#epiceditor-preview h3 {
+ font-size: 18px;
+}
+#epiceditor-preview h4 {
+ font-size: 16px;
+}
+#epiceditor-preview h5 {
+ font-size: 14px;
+}
+#epiceditor-preview h6 {
+ font-size: 13px;
+}
+#epiceditor-preview hr {
+ margin: 0 0 19px;
+ border: 0;
+ border-bottom: 1px solid #ccc;
+}
+#epiceditor-preview blockquote {
+ padding: 13px 13px 21px 15px;
+ margin-bottom: 18px;
+ font-family:georgia,serif;
+ font-style: italic;
+}
+#epiceditor-preview blockquote:before {
+ content:"\201C";
+ font-size:40px;
+ margin-left:-10px;
+ font-family:georgia,serif;
+ color:#eee;
+}
+#epiceditor-preview blockquote p {
+ font-size: 14px;
+ font-weight: 300;
+ line-height: 18px;
+ margin-bottom: 0;
+ font-style: italic;
+}
+#epiceditor-preview code, #epiceditor-preview pre {
+ font-family: Monaco, Andale Mono, Courier New, monospace;
+}
+#epiceditor-preview code {
+ background-color: #000;
+ color: #f92672;
+ padding: 1px 3px;
+ font-size: 12px;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ border-radius: 3px;
+}
+#epiceditor-preview pre {
+ display: block;
+ padding: 14px;
+ color:#66d9ef;
+ margin: 0 0 18px;
+ line-height: 16px;
+ font-size: 11px;
+ border: 1px solid #d9d9d9;
+ white-space: pre-wrap;
+ word-wrap: break-word;
+}
+#epiceditor-preview pre code {
+ background-color: #000;
+ color:#ccc;
+ font-size: 11px;
+ padding: 0;
+}
View
7 epiceditor/widgets.py
@@ -57,11 +57,11 @@ def render(self, name, value, attrs=None):
var editor = new EpicEditor(opts);
// get textarea and hide it
- $textarea = $('#%(id)s');
- $textarea.hide();
+ %(textarea)s = $('#%(id)s');
+ %(textarea)s.hide();
// then be sure to populate the textarea
editor.on('update', function (file) {
- $textarea.val(file.content);
+ %(textarea)s.val(file.content);
});
// Everything is all setup, so load!
@@ -78,6 +78,7 @@ def render(self, name, value, attrs=None):
'attrs': flatatt(final_attrs),
'body': conditional_escape(force_unicode(value)),
'id': attrs['id'],
+ 'textarea': "$textarea_" + attrs['id'].replace('-', '_'),
}
return mark_safe(html)
View
33 setup.py
@@ -1,36 +1,4 @@
-import os
-from os import path
from setuptools import setup
-from subprocess import check_call
-from distutils.command.build import build
-from distutils.dir_util import copy_tree, remove_tree
-from setuptools.command.develop import develop
-
-def get_submodules_and_fix_paths():
- if path.exists('.git'):
- # Get HEAD version
- check_call(['rm', '-rf', 'epiceditor/static/epiceditor'])
- check_call(['git', 'reset', '--hard'])
- # Get submodules
- check_call(['git', 'submodule', 'init'])
- check_call(['git', 'submodule', 'update'])
- # Reset EpicEditor to tag 0.2.0
- check_call(['cd', 'epiceditor/static/epiceditor', '&&', 'git', 'reset', '--hard', '0.2.0'])
- # Move contents of epiceditor and remove .git
- dst = "epiceditor/static/epiceditor/"
- src = "epiceditor/static/epiceditor/epiceditor/"
- copy_tree(src, dst)
- remove_tree(src)
-
-class build_with_submodules(build):
- def run(self):
- get_submodules_and_fix_paths()
- build.run(self)
-
-class develop_with_submodules(develop):
- def run(self):
- get_submodules_and_fix_paths()
- develop.run(self)
setup(
@@ -56,5 +24,4 @@ def run(self):
'Programming Language :: Python',
],
license='LICENSE',
- cmdclass={"build": build_with_submodules, "develop": develop_with_submodules},
)

No commit comments for this range

Something went wrong with that request. Please try again.