From 1cf399bdd5ed1c9091429e875689053310462078 Mon Sep 17 00:00:00 2001 From: Van Date: Sat, 14 Feb 2015 00:00:38 +0800 Subject: [PATCH] #212 --- static/css/base.css | 195 +++++++++++++++++++++++++++++++++++- static/css/playground.css | 67 +++++++++++++ static/css/wide.css | 193 ----------------------------------- static/js/playground.js | 4 +- views/playground/index.html | 55 ++++++++-- 5 files changed, 308 insertions(+), 206 deletions(-) create mode 100644 static/css/playground.css diff --git a/static/css/base.css b/static/css/base.css index 9b7462d..4460793 100644 --- a/static/css/base.css +++ b/static/css/base.css @@ -129,4 +129,197 @@ button { .list li:hover .ft-small { color: #FFF; } -/* end common */ \ No newline at end of file +/* end common */ + +/* start icon */ +@font-face { + font-family: 'icomoon'; + src:url('fonts/icomoon.eot?35cb2z'); + src:url('fonts/icomoon.eot?#iefix35cb2z') format('embedded-opentype'), + url('fonts/icomoon.woff?35cb2z') format('woff'), + url('fonts/icomoon.ttf?35cb2z') format('truetype'), + url('fonts/icomoon.svg?35cb2z#icomoon') format('svg'); + font-weight: normal; + font-style: normal; +} + +.font-ico { + font-family: 'icomoon'; + /* Better Font Rendering =========== */ + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + cursor: pointer; + font-size: 13px; + line-height: 20px; +} + +.ico-book:before { + content: "\e623"; +} + +.ico-price:before { + content: "\e616"; +} + +.ico-start:before { + content: "\e9d7"; +} + +.ico-share:before { + content: "\e61f"; +} + +.ico-github:before { + content: "\f00a"; +} + +.ico-tencent:before { + content: "\e622"; +} + +.ico-weibo:before { + content: "\e621"; +} + +.ico-googleplus:before { + content: "\e61a"; +} + +.ico-twitter:before { + content: "\e61c"; +} + +.ico-email:before { + content: "\e619"; +} + +.ico-facebook:before { + content: "\e61b"; +} + +.ico-moveup:before { + content: "\f148"; +} + +.ico-movedown:before { + content: "\f149"; +} + +.ico-keyboard:before { + content: "\f11c"; +} + +.ico-findfiles:before { + content: "\e603"; +} + +.ico-find:before { + content: "\e602"; +} + +.ico-editor:before { + content: "\e604"; +} + +.ico-tree:before { + content: "\e600"; +} + +.ico-build:before { + content: "\e601"; +} + +.ico-notification:before { + content: "\e607"; +} + +.ico-report:before { + content: "\e605"; +} + +.ico-comment:before { + content: "\e620"; +} + +.ico-goline:before { + content: "\e61e"; +} + +.ico-info:before { + content: "\e61d"; +} + +.ico-signup:before { + content: "\e606"; +} + +.ico-signout:before { + content: "\e618"; +} + +.ico-redo:before { + content: "\e615"; +} + +.ico-undo:before { + content: "\e60e"; +} + +.ico-about:before { + content: "\e60d"; +} + +.ico-import:before { + content: "\f0ee"; +} + +.ico-export:before { + content: "\f0ed"; +} + +.ico-refresh:before { + content: "\f021"; +} + +.ico-remove:before { + content: "\e60b"; +} + +.ico-save:before { + content: "\f0c7"; +} + +.ico-max:before { + content: "\e609"; +} + +.ico-format:before { + content: "\e612"; +} + +.ico-buildrun:before { + content: "\e60c"; +} + +.ico-stop:before { + content: "\e60f"; +} + +.ico-restore:before { + content: "\e613"; +} + +.toolbars .ico-restore:before { + content: "\e60a"; +} + +.ico-min:before { + content: "\e614"; + position: absolute; + right: 5px; +} + +.ico-close:before { + content: "\e611"; +} +/* end ico */ \ No newline at end of file diff --git a/static/css/playground.css b/static/css/playground.css new file mode 100644 index 0000000..5215e46 --- /dev/null +++ b/static/css/playground.css @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2014-2015, b3log.org + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +.font-ico { + font-size: 26px; +} + +.header { + margin: 0; + padding: 10px; +} + +.header .gravatar { + width: 26px; + border-radius: 13px; +} + +.header > .fn-right { + margin-top: 10px; +} + +.header .logo { + height: 36px; + margin-top: -4px; +} + +.share-panel { + position: absolute; + z-index: 20; + width: 258px; + padding: 10px 10px; + right: 0px; + line-height: normal; + top: 57px; +} + +.share-panel .font-ico { + transition: all .2s ease-out 0s; + margin: 0 5px; + width: 24px; +} + +.share-panel .font-ico:hover { + transform:rotate(360deg); +} + +#editorDiv { + width: 60%; + float: left; +} + +#output { + width: 40%; + float: right; +} \ No newline at end of file diff --git a/static/css/wide.css b/static/css/wide.css index 93408ec..95ff504 100644 --- a/static/css/wide.css +++ b/static/css/wide.css @@ -14,199 +14,6 @@ * limitations under the License. */ -/* start icon */ -@font-face { - font-family: 'icomoon'; - src:url('fonts/icomoon.eot?35cb2z'); - src:url('fonts/icomoon.eot?#iefix35cb2z') format('embedded-opentype'), - url('fonts/icomoon.woff?35cb2z') format('woff'), - url('fonts/icomoon.ttf?35cb2z') format('truetype'), - url('fonts/icomoon.svg?35cb2z#icomoon') format('svg'); - font-weight: normal; - font-style: normal; -} - -.font-ico { - font-family: 'icomoon'; - /* Better Font Rendering =========== */ - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - cursor: pointer; - font-size: 13px; - line-height: 20px; -} - -.ico-book:before { - content: "\e623"; -} - -.ico-price:before { - content: "\e616"; -} - -.ico-start:before { - content: "\e9d7"; -} - -.ico-share:before { - content: "\e61f"; -} - -.ico-github:before { - content: "\f00a"; -} - -.ico-tencent:before { - content: "\e622"; -} - -.ico-weibo:before { - content: "\e621"; -} - -.ico-googleplus:before { - content: "\e61a"; -} - -.ico-twitter:before { - content: "\e61c"; -} - -.ico-email:before { - content: "\e619"; -} - -.ico-facebook:before { - content: "\e61b"; -} - -.ico-moveup:before { - content: "\f148"; -} - -.ico-movedown:before { - content: "\f149"; -} - -.ico-keyboard:before { - content: "\f11c"; -} - -.ico-findfiles:before { - content: "\e603"; -} - -.ico-find:before { - content: "\e602"; -} - -.ico-editor:before { - content: "\e604"; -} - -.ico-tree:before { - content: "\e600"; -} - -.ico-build:before { - content: "\e601"; -} - -.ico-notification:before { - content: "\e607"; -} - -.ico-report:before { - content: "\e605"; -} - -.ico-comment:before { - content: "\e620"; -} - -.ico-goline:before { - content: "\e61e"; -} - -.ico-info:before { - content: "\e61d"; -} - -.ico-signup:before { - content: "\e606"; -} - -.ico-signout:before { - content: "\e618"; -} - -.ico-redo:before { - content: "\e615"; -} - -.ico-undo:before { - content: "\e60e"; -} - -.ico-about:before { - content: "\e60d"; -} - -.ico-import:before { - content: "\f0ee"; -} - -.ico-export:before { - content: "\f0ed"; -} - -.ico-refresh:before { - content: "\f021"; -} - -.ico-remove:before { - content: "\e60b"; -} - -.ico-save:before { - content: "\f0c7"; -} - -.ico-max:before { - content: "\e609"; -} - -.ico-format:before { - content: "\e612"; -} - -.ico-buildrun:before { - content: "\e60c"; -} - -.ico-stop:before { - content: "\e60f"; -} - -.ico-restore:before { - content: "\e613"; -} - -.toolbars .ico-restore:before { - content: "\e60a"; -} - -.ico-min:before { - content: "\e614"; - position: absolute; - right: 5px; -} - -.ico-close:before { - content: "\e611"; -} -/* end ico */ - /* start frame */ .frame { position: absolute; diff --git a/static/js/playground.js b/static/js/playground.js index ed6f810..1606211 100644 --- a/static/js/playground.js +++ b/static/js/playground.js @@ -18,7 +18,7 @@ var playground = { editor: undefined, pid: undefined, init: function () { - $("#editorDiv").append(""); + $("#editorDiv").append(""); var textArea = document.getElementById("editor"); textArea.value = code; playground.editor = CodeMirror.fromTextArea(textArea, { @@ -27,7 +27,7 @@ var playground = { autoCloseBrackets: true, matchBrackets: true, highlightSelectionMatches: {showToken: /\w/}, - rulers: [{color: "#ccc", column: 120, lineStyle: "dashed"}], + rulers: [{color: "#ccc", column: 80, lineStyle: "dashed"}], styleActiveLine: true, theme: "wide", tabSize: 4, diff --git a/views/playground/index.html b/views/playground/index.html index 68d3ca9..824d711 100644 --- a/views/playground/index.html +++ b/views/playground/index.html @@ -9,6 +9,9 @@ + + + @@ -16,18 +19,50 @@ -
- - - - -
-
-
+ +
+
+ +
+ +
+ -