-
+ 'news-add']) ?>
= $form->field($model, 'link') ?>
= $form->field($model, 'title') ?>
- = Markdowneditor::widget([
- 'model' => $model,
- 'attribute' => 'text',
- ]) ?>
-
+ = $form->field($model, 'text')->textarea() ?>
= Html::submitButton('Submit', ['class' => 'btn btn-primary']) ?>
diff --git a/web/css/prism.css b/web/css/prism.css
new file mode 100644
index 0000000..581c550
--- /dev/null
+++ b/web/css/prism.css
@@ -0,0 +1,115 @@
+code[class*="language-"], pre[class*="language-"] {
+ font-family: Consolas, Menlo, Monaco, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", "Courier New", Courier, monospace;
+ font-size: 12.5px;
+ line-height: 1.375;
+ direction: ltr;
+ text-align: left;
+ white-space: pre;
+ word-spacing: normal;
+ word-break: normal;
+ word-wrap: normal;
+ -moz-tab-size: 4;
+ -o-tab-size: 4;
+ tab-size: 4;
+ -webkit-hyphens: none;
+ -moz-hyphens: none;
+ -ms-hyphens: none;
+ hyphens: none;
+ color: #515253
+}
+
+pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection, code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection {
+ text-shadow: none;
+ background: #dadbdc
+}
+
+pre[class*="language-"]::selection, pre[class*="language-"] ::selection, code[class*="language-"]::selection, code[class*="language-"] ::selection {
+ text-shadow: none;
+ background: #dadbdc
+}
+
+pre[class*="language-"] {
+ padding: 1em;
+ margin: .5em 0;
+ overflow: auto
+}
+
+:not(pre) > code[class*="language-"] {
+ padding: .1em;
+ border-radius: .3em
+}
+
+.token.comment, .token.prolog, .token.doctype, .token.cdata {
+ color: #959697
+}
+
+.token.punctuation {
+ color: #515253
+}
+
+.token.namespace {
+ opacity: .7
+}
+
+.token.operator, .token.boolean, .token.number {
+}
+
+.token.property {
+}
+
+.token.tag {
+ color: #3182bd
+}
+
+.token.string {
+ color: #669966 !important;
+}
+
+.token.selector {
+ color: #756bb1
+}
+
+.token.entity, .token.url, .language-css .token.string, .style .token.string {
+ color: #80b1d3
+}
+
+.token.attr-value, .token.keyword, .token.control, .token.directive, .token.unit {
+}
+
+.token.statement, .token.regex, .token.atrule {
+ color: #80b1d3
+}
+
+.token.placeholder, .token.variable, .token.class {
+ color: #637aab
+}
+
+.token.deleted {
+ text-decoration: line-through
+}
+
+.token.inserted {
+ border-bottom: 1px dotted #0c0d0e;
+ text-decoration: none
+}
+
+.token.italic {
+ font-style: italic
+}
+
+.token.important, .token.bold {
+ font-weight: bold
+}
+
+.token.important {
+ color: #e31a1c
+}
+
+.token.entity {
+ cursor: help
+}
+
+pre > code.highlight {
+ outline: 0.4em solid #e31a1c;
+ outline-offset: .4em
+}
\ No newline at end of file
diff --git a/web/css/site.css b/web/css/site.css
index 5d926df..bc566d0 100644
--- a/web/css/site.css
+++ b/web/css/site.css
@@ -168,4 +168,14 @@ a.desc:after {
.user-view-avatar {
float: left;
margin: 0 15px 15px 0;
+}
+
+/* Markdown Editor */
+
+.CodeMirror-buttonsPanel {
+ margin-bottom: 0.4em;
+}
+
+.CodeMirror-buttonsPanel button {
+ margin-right: 0.4em;
}
\ No newline at end of file
diff --git a/web/index-test.php b/web/index-test.php
deleted file mode 100644
index 32b4ce3..0000000
--- a/web/index-test.php
+++ /dev/null
@@ -1,16 +0,0 @@
-run();
diff --git a/web/js/prism.js b/web/js/prism.js
new file mode 100644
index 0000000..a273833
--- /dev/null
+++ b/web/js/prism.js
@@ -0,0 +1,115 @@
+/* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript+actionscript+aspnet+bash+brainfuck+c+csharp+cpp+coffeescript+css-extras+dart+eiffel+erlang+fsharp+fortran+gherkin+git+go+groovy+haml+handlebars+haskell+http+ini+jade+java+julia+keyman+latex+less+lolcode+makefile+markdown+matlab+nasm+nsis+objectivec+pascal+perl+php+php-extras+powershell+python+r+jsx+rest+rip+ruby+rust+sas+sass+scala+scheme+smalltalk+smarty+sql+stylus+swift+twig+typescript+vhdl+wiki+yaml&plugins=line-numbers */
+var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(){var e=/\blang(?:uage)?-(?!\*)(\w+)\b/i,t=_self.Prism={util:{encode:function(e){return e instanceof n?new n(e.type,t.util.encode(e.content),e.alias):"Array"===t.util.type(e)?e.map(t.util.encode):e.replace(/&/g,"&").replace(/e.length)break e;if(!(d instanceof a)){u.lastIndex=0;var m=u.exec(d);if(m){c&&(f=m[1].length);var y=m.index-1+f,m=m[0].slice(f),v=m.length,k=y+v,b=d.slice(0,y+1),w=d.slice(k+1),N=[p,1];b&&N.push(b);var O=new a(l,g?t.tokenize(m,g):m,h);N.push(O),w&&N.push(w),Array.prototype.splice.apply(r,N)}}}}}return r},hooks:{all:{},add:function(e,n){var a=t.hooks.all;a[e]=a[e]||[],a[e].push(n)},run:function(e,n){var a=t.hooks.all[e];if(a&&a.length)for(var r,i=0;r=a[i++];)r(n)}}},n=t.Token=function(e,t,n){this.type=e,this.content=t,this.alias=n};if(n.stringify=function(e,a,r){if("string"==typeof e)return e;if("Array"===t.util.type(e))return e.map(function(t){return n.stringify(t,a,e)}).join("");var i={type:e.type,content:n.stringify(e.content,a,r),tag:"span",classes:["token",e.type],attributes:{},language:a,parent:r};if("comment"==i.type&&(i.attributes.spellcheck="true"),e.alias){var l="Array"===t.util.type(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(i.classes,l)}t.hooks.run("wrap",i);var o="";for(var s in i.attributes)o+=s+'="'+(i.attributes[s]||"")+'"';return"<"+i.tag+' class="'+i.classes.join(" ")+'" '+o+">"+i.content+""+i.tag+">"},!_self.document)return _self.addEventListener?(_self.addEventListener("message",function(e){var n=JSON.parse(e.data),a=n.language,r=n.code;_self.postMessage(JSON.stringify(t.util.encode(t.tokenize(r,t.languages[a])))),_self.close()},!1),_self.Prism):_self.Prism;var a=document.getElementsByTagName("script");return a=a[a.length-1],a&&(t.filename=a.src,document.addEventListener&&!a.hasAttribute("data-manual")&&document.addEventListener("DOMContentLoaded",t.highlightAll)),_self.Prism}();"undefined"!=typeof module&&module.exports&&(module.exports=Prism);;
+Prism.languages.markup={comment://,prolog:/<\?[\w\W]+?\?>/,doctype://,cdata://i,tag:{pattern:/<\/?[^\s>\/]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/i,inside:{punctuation:/[=>"']/}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/?[\da-z]{1,8};/i},Prism.hooks.add("wrap",function(t){"entity"===t.type&&(t.attributes.title=t.content.replace(/&/,"&"))});;
+Prism.languages.css={comment:/\/\*[\w\W]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^\{\}\s][^\{\};]*?(?=\s*\{)/,string:/("|')(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1/,property:/(\b|\B)[\w-]+(?=\s*:)/i,important:/\B!important\b/i,"function":/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:]/},Prism.languages.css.atrule.inside.rest=Prism.util.clone(Prism.languages.css),Prism.languages.markup&&(Prism.languages.insertBefore("markup","tag",{style:{pattern:/