diff --git a/gui/app/components/section/wysiwyg/type-editor.js b/gui/app/components/section/wysiwyg/type-editor.js
index 4fd04c42..afff25e8 100644
--- a/gui/app/components/section/wysiwyg/type-editor.js
+++ b/gui/app/components/section/wysiwyg/type-editor.js
@@ -62,7 +62,9 @@ export default Component.extend({
inline: 'i'
}
},
+ codesample_content_css: '//' + window.location.host + '/prism.css',
codesample_languages: [
+ { text: 'ASP.NET (C#)', value: 'aspnet' },
{ text: 'C', value: 'c' },
{ text: 'C#', value: 'csharp' },
{ text: 'C++', value: 'cpp' },
@@ -105,10 +107,8 @@ export default Component.extend({
],
menu: {},
menubar: false,
- toolbar1:
- 'formatselect fontsizeselect | bold italic underline strikethrough superscript subscript | forecolor backcolor link unlink',
- toolbar2:
- 'outdent indent bullist numlist | alignleft aligncenter alignright alignjustify | table uploadimage image media codesample',
+ toolbar1: 'formatselect fontsizeselect | bold italic underline strikethrough superscript subscript | forecolor backcolor link unlink',
+ toolbar2: 'outdent indent bullist numlist | alignleft aligncenter alignright alignjustify | table uploadimage image media codesample',
save_onsavecallback: function () {
Mousetrap.trigger('ctrl+s');
}
diff --git a/gui/app/styles/core/vendor/prismjs.scss b/gui/app/styles/core/vendor/prismjs.scss
index 1a7b1fb8..ebf946ba 100644
--- a/gui/app/styles/core/vendor/prismjs.scss
+++ b/gui/app/styles/core/vendor/prismjs.scss
@@ -1,5 +1,5 @@
-/* PrismJS 1.10.0
-http://prismjs.com/download.html?themes=prism-solarizedlight&languages=markup+css+clike+javascript+c+cpp+csharp+coffeescript+ruby+docker+elixir+erlang+fsharp+git+go+handlebars+haskell+http+java+json+less+makefile+markdown+nginx+objectivec+perl+php+powershell+python+jsx+rust+scss+sql+swift+typescript+yaml&plugins=line-numbers+toolbar+copy-to-clipboard */
+/* PrismJS 1.15.0
+https://prismjs.com/download.html#themes=prism-solarizedlight&languages=markup+css+clike+javascript+c+csharp+cpp+aspnet+coffeescript+ruby+docker+elixir+markup-templating+erlang+fsharp+git+go+less+handlebars+haskell+http+java+json+markdown+makefile+nginx+objectivec+perl+php+sql+powershell+scss+python+jsx+typescript+rust+swift+yaml&plugins=line-numbers+toolbar+highlight-keywords+show-language */
/*
Solarized Color Schemes originally by Ethan Schoonover
http://ethanschoonover.com/solarized
@@ -127,7 +127,8 @@ pre[class*="language-"] {
color: #859900; /* green */
}
-.token.function {
+.token.function,
+.token.class-name {
color: #b58900; /* yellow */
}
@@ -148,15 +149,16 @@ pre[class*="language-"] {
.token.entity {
cursor: help;
}
-pre.line-numbers {
+
+pre[class*="language-"].line-numbers {
position: relative;
padding-left: 3.8em;
counter-reset: linenumber;
}
-pre.line-numbers > code {
+pre[class*="language-"].line-numbers > code {
position: relative;
- white-space: inherit;
+ white-space: inherit;
}
.line-numbers .line-numbers-rows {
@@ -189,11 +191,12 @@ pre.line-numbers > code {
padding-right: 0.8em;
text-align: right;
}
-pre.code-toolbar {
+
+div.code-toolbar {
position: relative;
}
-pre.code-toolbar > .toolbar {
+div.code-toolbar > .toolbar {
position: absolute;
top: .3em;
right: .2em;
@@ -201,19 +204,19 @@ pre.code-toolbar > .toolbar {
opacity: 0;
}
-pre.code-toolbar:hover > .toolbar {
+div.code-toolbar:hover > .toolbar {
opacity: 1;
}
-pre.code-toolbar > .toolbar .toolbar-item {
+div.code-toolbar > .toolbar .toolbar-item {
display: inline-block;
}
-pre.code-toolbar > .toolbar a {
+div.code-toolbar > .toolbar a {
cursor: pointer;
}
-pre.code-toolbar > .toolbar button {
+div.code-toolbar > .toolbar button {
background: none;
border: 0;
color: inherit;
@@ -226,9 +229,9 @@ pre.code-toolbar > .toolbar button {
-ms-user-select: none;
}
-pre.code-toolbar > .toolbar a,
-pre.code-toolbar > .toolbar button,
-pre.code-toolbar > .toolbar span {
+div.code-toolbar > .toolbar a,
+div.code-toolbar > .toolbar button,
+div.code-toolbar > .toolbar span {
color: #bbb;
font-size: .8em;
padding: 0 .5em;
@@ -238,12 +241,12 @@ pre.code-toolbar > .toolbar span {
border-radius: .5em;
}
-pre.code-toolbar > .toolbar a:hover,
-pre.code-toolbar > .toolbar a:focus,
-pre.code-toolbar > .toolbar button:hover,
-pre.code-toolbar > .toolbar button:focus,
-pre.code-toolbar > .toolbar span:hover,
-pre.code-toolbar > .toolbar span:focus {
+div.code-toolbar > .toolbar a:hover,
+div.code-toolbar > .toolbar a:focus,
+div.code-toolbar > .toolbar button:hover,
+div.code-toolbar > .toolbar button:focus,
+div.code-toolbar > .toolbar span:hover,
+div.code-toolbar > .toolbar span:focus {
color: inherit;
text-decoration: none;
}
diff --git a/gui/app/templates/components/section/wysiwyg/type-renderer.hbs b/gui/app/templates/components/section/wysiwyg/type-renderer.hbs
index 4831c672..52729a6c 100644
--- a/gui/app/templates/components/section/wysiwyg/type-renderer.hbs
+++ b/gui/app/templates/components/section/wysiwyg/type-renderer.hbs
@@ -1 +1,2 @@
+
{{{page.body}}}
diff --git a/gui/public/prism/prism.css b/gui/public/prism/prism.css
index e4d9c029..624bca5a 100644
--- a/gui/public/prism/prism.css
+++ b/gui/public/prism/prism.css
@@ -1,8 +1,5 @@
-
-/* START PrismJS */
-
-/* PrismJS 1.10.0
-http://prismjs.com/download.html?themes=prism-solarizedlight&languages=markup+css+clike+javascript+c+cpp+csharp+coffeescript+ruby+docker+elixir+erlang+fsharp+git+go+handlebars+haskell+http+java+json+less+makefile+markdown+nginx+objectivec+perl+php+powershell+python+jsx+rust+scss+sql+swift+typescript+yaml&plugins=line-numbers+toolbar+copy-to-clipboard */
+/* PrismJS 1.15.0
+https://prismjs.com/download.html?#themes=prism-solarizedlight&languages=markup+css+clike+javascript+c+csharp+cpp+coffeescript+ruby+docker+elixir+markup-templating+erlang+fsharp+git+go+less+handlebars+haskell+http+java+json+markdown+makefile+nginx+objectivec+perl+php+sql+powershell+scss+python+jsx+typescript+rust+swift+yaml&plugins=line-numbers */
/*
Solarized Color Schemes originally by Ethan Schoonover
http://ethanschoonover.com/solarized
@@ -130,7 +127,8 @@ pre[class*="language-"] {
color: #859900; /* green */
}
-.token.function {
+.token.function,
+.token.class-name {
color: #b58900; /* yellow */
}
@@ -151,15 +149,16 @@ pre[class*="language-"] {
.token.entity {
cursor: help;
}
-pre.line-numbers {
+
+pre[class*="language-"].line-numbers {
position: relative;
padding-left: 3.8em;
counter-reset: linenumber;
}
-pre.line-numbers > code {
+pre[class*="language-"].line-numbers > code {
position: relative;
- white-space: inherit;
+ white-space: inherit;
}
.line-numbers .line-numbers-rows {
@@ -192,63 +191,4 @@ pre.line-numbers > code {
padding-right: 0.8em;
text-align: right;
}
-pre.code-toolbar {
- position: relative;
-}
-pre.code-toolbar > .toolbar {
- position: absolute;
- top: .3em;
- right: .2em;
- transition: opacity 0.3s ease-in-out;
- opacity: 0;
-}
-
-pre.code-toolbar:hover > .toolbar {
- opacity: 1;
-}
-
-pre.code-toolbar > .toolbar .toolbar-item {
- display: inline-block;
-}
-
-pre.code-toolbar > .toolbar a {
- cursor: pointer;
-}
-
-pre.code-toolbar > .toolbar button {
- background: none;
- border: 0;
- color: inherit;
- font: inherit;
- line-height: normal;
- overflow: visible;
- padding: 0;
- -webkit-user-select: none; /* for button */
- -moz-user-select: none;
- -ms-user-select: none;
-}
-
-pre.code-toolbar > .toolbar a,
-pre.code-toolbar > .toolbar button,
-pre.code-toolbar > .toolbar span {
- color: #bbb;
- font-size: .8em;
- padding: 0 .5em;
- background: #f5f2f0;
- background: rgba(224, 224, 224, 0.2);
- box-shadow: 0 2px 0 0 rgba(0,0,0,0.2);
- border-radius: .5em;
-}
-
-pre.code-toolbar > .toolbar a:hover,
-pre.code-toolbar > .toolbar a:focus,
-pre.code-toolbar > .toolbar button:hover,
-pre.code-toolbar > .toolbar button:focus,
-pre.code-toolbar > .toolbar span:hover,
-pre.code-toolbar > .toolbar span:focus {
- color: inherit;
- text-decoration: none;
-}
-
-/* FINISH PrismJS */
diff --git a/gui/public/prism/prism.js b/gui/public/prism/prism.js
new file mode 100644
index 00000000..444ea39d
--- /dev/null
+++ b/gui/public/prism/prism.js
@@ -0,0 +1,45 @@
+/* PrismJS 1.15.0
+https://prismjs.com/download.html#themes=prism-solarizedlight&languages=markup+css+clike+javascript+c+csharp+cpp+aspnet+coffeescript+ruby+docker+elixir+markup-templating+erlang+fsharp+git+go+less+handlebars+haskell+http+java+json+markdown+makefile+nginx+objectivec+perl+php+sql+powershell+scss+python+jsx+typescript+rust+swift+yaml&plugins=line-numbers+toolbar+highlight-keywords+show-language */
+var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(){var e=/\blang(?:uage)?-([\w-]+)\b/i,t=0,n=_self.Prism={manual:_self.Prism&&_self.Prism.manual,disableWorkerMessageHandler:_self.Prism&&_self.Prism.disableWorkerMessageHandler,util:{encode:function(e){return e instanceof a?new a(e.type,n.util.encode(e.content),e.alias):"Array"===n.util.type(e)?e.map(n.util.encode):e.replace(/&/g,"&").replace(/e.length)return;if(!(w instanceof s)){if(m&&b!=t.length-1){h.lastIndex=k;var _=h.exec(e);if(!_)break;for(var j=_.index+(d?_[1].length:0),P=_.index+_[0].length,A=b,x=k,O=t.length;O>A&&(P>x||!t[A].type&&!t[A-1].greedy);++A)x+=t[A].length,j>=x&&(++b,k=x);if(t[b]instanceof s)continue;I=A-b,w=e.slice(k,x),_.index-=k}else{h.lastIndex=0;var _=h.exec(w),I=1}if(_){d&&(p=_[1]?_[1].length:0);var j=_.index+p,_=_[0].slice(p),P=j+_.length,N=w.slice(0,j),S=w.slice(P),C=[b,I];N&&(++b,k+=N.length,C.push(N));var E=new s(u,f?n.tokenize(_,f):_,y,_,m);if(C.push(E),S&&C.push(S),Array.prototype.splice.apply(t,C),1!=I&&n.matchGrammar(e,t,a,b,k,!0,u),i)break}else if(i)break}}}}},tokenize:function(e,t){var a=[e],r=t.rest;if(r){for(var l in r)t[l]=r[l];delete t.rest}return n.matchGrammar(e,a,t,0,0,!1),a},hooks:{all:{},add:function(e,t){var a=n.hooks.all;a[e]=a[e]||[],a[e].push(t)},run:function(e,t){var a=n.hooks.all[e];if(a&&a.length)for(var r,l=0;r=a[l++];)r(t)}}},a=n.Token=function(e,t,n,a,r){this.type=e,this.content=t,this.alias=n,this.length=0|(a||"").length,this.greedy=!!r};if(a.stringify=function(e,t,r){if("string"==typeof e)return e;if("Array"===n.util.type(e))return e.map(function(n){return a.stringify(n,t,e)}).join("");var l={type:e.type,content:a.stringify(e.content,t,r),tag:"span",classes:["token",e.type],attributes:{},language:t,parent:r};if(e.alias){var i="Array"===n.util.type(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(l.classes,i)}n.hooks.run("wrap",l);var o=Object.keys(l.attributes).map(function(e){return e+'="'+(l.attributes[e]||"").replace(/"/g,""")+'"'}).join(" ");return"<"+l.tag+' class="'+l.classes.join(" ")+'"'+(o?" "+o:"")+">"+l.content+""+l.tag+">"},!_self.document)return _self.addEventListener?(n.disableWorkerMessageHandler||_self.addEventListener("message",function(e){var t=JSON.parse(e.data),a=t.language,r=t.code,l=t.immediateClose;_self.postMessage(n.highlight(r,n.languages[a],a)),l&&_self.close()},!1),_self.Prism):_self.Prism;var r=document.currentScript||[].slice.call(document.getElementsByTagName("script")).pop();return r&&(n.filename=r.src,n.manual||r.hasAttribute("data-manual")||("loading"!==document.readyState?window.requestAnimationFrame?window.requestAnimationFrame(n.highlightAll):window.setTimeout(n.highlightAll,16):document.addEventListener("DOMContentLoaded",n.highlightAll))),_self.Prism}();"undefined"!=typeof module&&module.exports&&(module.exports=Prism),"undefined"!=typeof global&&(global.Prism=Prism);
+Prism.languages.markup={comment://,prolog:/<\?[\s\S]+?\?>/,doctype://i,cdata://i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/i,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+)/i,inside:{punctuation:[/^=/,{pattern:/(^|[^\\])["']/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/?[\da-z]{1,8};/i},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.hooks.add("wrap",function(a){"entity"===a.type&&(a.attributes.title=a.content.replace(/&/,"&"))}),Prism.languages.xml=Prism.languages.markup,Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup;
+Prism.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-]+?[\s\S]*?(?:;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^{}\s][^{};]*?(?=\s*\{)/,string:{pattern:/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},property:/[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*(?=\s*:)/i,important:/!important\b/i,"function":/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:,]/},Prism.languages.css.atrule.inside.rest=Prism.languages.css,Prism.languages.markup&&(Prism.languages.insertBefore("markup","tag",{style:{pattern:/(