From f4e1f0f9fc01f3f9e29845caed836e9b25d4167c Mon Sep 17 00:00:00 2001 From: Van Date: Thu, 25 Sep 2014 15:56:26 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AA=97=E5=8F=A3=E6=9C=80=E5=A4=A7=E5=8C=96?= =?UTF-8?q?=EF=BC=8C=E6=9C=80=E5=B0=8F=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- conf/wide.json | 6 +-- .../admin/src/mytest/time/1.json | 40 ++++++-------- i18n/zh_CN.json | 5 +- static/css/base.css | 50 ++++++++++------- static/css/fonts/icomoon.eot | Bin 4808 -> 4952 bytes static/css/fonts/icomoon.svg | 4 +- static/css/fonts/icomoon.ttf | Bin 4644 -> 4788 bytes static/css/fonts/icomoon.woff | Bin 4720 -> 4864 bytes static/js/editors.js | 2 +- static/js/wide.js | 51 ++++++++++++++++++ view/index.html | 24 ++++----- 11 files changed, 120 insertions(+), 62 deletions(-) diff --git a/conf/wide.json b/conf/wide.json index bed25cf..107a617 100644 --- a/conf/wide.json +++ b/conf/wide.json @@ -23,12 +23,10 @@ "D:\\go\\src\\pkg" ], "Files": [ - "E:\\Work\\go\\src\\github.com\\b3log\\wide\\data\\user_workspaces\\admin\\src\\mytest\\1123", "E:\\Work\\go\\src\\github.com\\b3log\\wide\\data\\user_workspaces\\admin\\src\\mytest\\time\\main.go", - "E:\\Work\\go\\src\\github.com\\b3log\\wide\\data\\user_workspaces\\admin\\src\\mytest\\hello\\2.json", - "E:\\Work\\go\\src\\github.com\\b3log\\wide\\data\\user_workspaces\\admin\\src\\mytest\\hello\\main.go" + "E:\\Work\\go\\src\\github.com\\b3log\\wide\\data\\user_workspaces\\admin\\src\\mytest\\time\\1.json" ], - "CurrentFile": "E:\\Work\\go\\src\\github.com\\b3log\\wide\\data\\user_workspaces\\admin\\src\\mytest\\hello\\main.go" + "CurrentFile": "E:\\Work\\go\\src\\github.com\\b3log\\wide\\data\\user_workspaces\\admin\\src\\mytest\\time\\1.json" } } ] diff --git a/data/user_workspaces/admin/src/mytest/time/1.json b/data/user_workspaces/admin/src/mytest/time/1.json index 1b0f0d3..5cb2f19 100644 --- a/data/user_workspaces/admin/src/mytest/time/1.json +++ b/data/user_workspaces/admin/src/mytest/time/1.json @@ -1,24 +1,16 @@ -{ - "Server": "{IP}:7070", - "StaticServer": "http://{IP}:7070", - "EditorChannel": "ws://{IP}:7070", - "OutputChannel": "ws://{IP}:7070", - "ShellChannel": "ws://{IP}:7070", - "SessionChannel": "ws://{IP}:7070", - "StaticResourceVersion": "201409032040", - "MaxProcs": 4, - "RuntimeMode": "dev", - "Pwd": "{pwd}", - "Users": [ - { - "Name": "admin", - "Password": "admin", - "Workspace": "{pwd}/data/user_workspaces/admin", - "LatestSessionContent": { - "FileTree": [], - "Files": [], - "CurrentFile": "" - } - } - ] -} \ No newline at end of file +package main + +import ( + "fmt" + "mytest/time/pkg" + "time" +) + +func main() { + for i := 0; i < 50; i++ { + fmt.Println("Hello, 世界", pkg.Now()) + + time.Sleep(time.Second) + } + +} diff --git a/i18n/zh_CN.json b/i18n/zh_CN.json index 1144c86..b6af5f3 100644 --- a/i18n/zh_CN.json +++ b/i18n/zh_CN.json @@ -40,5 +40,8 @@ "stop": "停止", "output": "输出", "search": "搜索", - "notification": "通知" + "notification": "通知", + "min": "最小化", + "max_side": "左侧窗口最大化", + "max_bottom": "底部窗口最大化" } \ No newline at end of file diff --git a/static/css/base.css b/static/css/base.css index f330378..dd575c5 100644 --- a/static/css/base.css +++ b/static/css/base.css @@ -3,6 +3,7 @@ body { font-size: 13px; margin: 0; color: #000; + overflow-x: hidden; } ul { @@ -53,6 +54,14 @@ ul { /* Better Font Rendering =========== */ -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; + color: #666; + cursor: pointer; + font-size: 13px; + line-height: 18px; +} + +.font-ico:hover { + color: #333; } .ico-play:before { @@ -79,17 +88,18 @@ ul { content: "\e608"; } -.ico-close { - color: #666; +.ico-max:before { + content: "\e60c"; } -.ico-close:hover { - color: #333; +.ico-min:before { + content: "\e60d"; + position: absolute; + right: 5px; } .ico-close:before { content: "\e60a"; - cursor: pointer; } /* end reset & function */ @@ -143,7 +153,8 @@ ul { .tabs > div { float: left; - line-height: 19px; + line-height: 18px; + height: 18px; padding: 0 5px; cursor: pointer; background-color: #DDD; @@ -160,6 +171,7 @@ ul { /* start framework */ .content { position: relative; + overflow: hidden; } .side { @@ -168,6 +180,7 @@ ul { position: absolute; border-right: 1px solid #9B9B9B; height: 100%; + z-index: 11; } .side-fullscreen { @@ -194,18 +207,6 @@ ul { padding: 5px; text-decoration: none; } - -.toolbars > span { - color: #666; - cursor: pointer; - font-size: 16px; - line-height: 25px; - margin-right: 5px; -} - -.toolbars > span:hover { - color: #333; -} /* end menu */ /* start editor */ @@ -216,6 +217,7 @@ ul { background-color: #D7D7D7; width: 80%; height: 70%; + overflow: hidden; } .edit-panel .tabs > div { @@ -229,7 +231,13 @@ ul { background-color: #F7F7F7; } -.edit-header .ico { +.toolbars { + position: absolute; + right: 5px; + top: 1px; +} + +.edit-panel .tabs .ico { background-image: url("../images/ico-file.png"); float: left; height: 16px; @@ -252,6 +260,7 @@ ul { width: 80%; height: 30%; top: 70%; + z-index: 11; background-color: #fff; } @@ -295,6 +304,9 @@ ul { .footer { border-top: 1px solid #919191; background-color: #F0F0F0; + padding-left: 5px; + height: 19px; + line-height: 18px; } .notification-count { diff --git a/static/css/fonts/icomoon.eot b/static/css/fonts/icomoon.eot index 8d8a97e8e6755014f9ecd556809e9d58f7b74ab4..a4937550d646c198061782bc03e27ccab4a8463b 100644 GIT binary patch delta 417 zcmXwyKS%;`6vyAY^XDmH-l;#KsJPQ~2x-XFp@JJ~2n-5}+UhVtO7kKIn{+5>3glL4a0+WL##s&e)0)YOL;y zvt6~(8L2HDci#Z;1YodJ$Q#>uJ(L8HmjNJM;0^H|e>n3wj2B9kYUEW2aK7TaS}f;` zvB!uBpm2ml$*7tz3J;tUoYg&}lwTjZ{N$YFKNigLK?Ou-HPCeCAPOvpN9bc87$sl+ z8~>6e3svIo_py(+)~OUjoU~e=Ls!i?qXOU=c)$-KfM7~fqEu6oB$?8vMv2Bn$F^?k zI@YOuj%)TV?l`L3Z5{RJUiew>^|%l6xZqwY$lQm9!bxo^J%`irs1|Wk@Jje5dA*XY zN?w$=oN~+MWGmsziX*IEHaGpV-!LF>AAqOD;>^FYrkp{_9_1{Pm5E_;N$%Y9?hk4E T?IVF$3HIid^ delta 280 zcmcbic0!f)gb)LR%0yOkmRI77j!%9lC^9jmklE_G)Wj1q^|lR6uNfE^I~W-FTryG< zQyAANc``8YpJ8BNFv|c6Fh64a!oVQF0_3Y?>80Dzm=l-^TB~S%9g6m5qU&@jv6q&3){ujErWRw{TRlY~IN0%`9_#k@%~4ew(ih z+)N--7%sSf09pp2Crb#LGYU@*5cHY6L{LeLjfrg;yAlH - + + + diff --git a/static/css/fonts/icomoon.ttf b/static/css/fonts/icomoon.ttf index aceb5d058c53357ea0164910ebd7774901f5fb3f..4d857caaf45be070a83b0be71a31b266217daeef 100644 GIT binary patch delta 415 zcmZ3YvPE@*V!h3E1qKF283qQ1l=Q^n0w65_@H-++9eJcCL`Zb^mG9VQ_le+`fyl9QjDD0fB)Xr>^L%b=5+ zSW&oFfa(4Dheu#Dhe92 z8k;JLDvGiy0x1W^0}lTj92gr!|4m~I{g=&{1)?4P9dKZDxcXY`s>AEoKyw&@cmdEX z1yC3Wi;9RDD;k;EGMcC_sPjmPLwzy;|AoH0QnlZ zi4_G5(hSFd{5e3rLSABSszkWtvUfm%JwQub3-XIg7?^=l3_>gucXTsyPj+EcW_{1U zjo*874r2u?8v{Gzf5wxWU$Ln&GMa4`;HYHT%**S|EOUI3_^Wt+o39MqOd#D17u-Jp yZGq5}O9adrg(t5O@R=m2B*wolz>tO{^#Yas+{j85F=+mf=`lVs0u>YzEMBR}c=DT=uRY zzqkbG-Uk!^OlIVrJb_V}^&|fde&5YI7%N!W{{LtE&vw5lA^O9&q^Q;K0}*`fnOz=)Y{nED-JR z?|=iN!`0VfR~=rz2ATs3vIRi16c_}6=7@@j87mr@*)p1_DJv?mi864qGd^JF#2QSP78t1Hy85 zn1pijlR@eZ0QnjqEOA1{EjO{EKnE!J0w|yW#?lPO@)C1X85jhC4q!6rrk DTCGM> diff --git a/static/js/editors.js b/static/js/editors.js index ea410a5..12591b2 100644 --- a/static/js/editors.js +++ b/static/js/editors.js @@ -283,7 +283,7 @@ var editors = { // TODO: 关闭 tab 的时候要重置 }); - editor.setSize('100%', $(".edit-panel").height() - $(".edit-header").height()); + editor.setSize('100%', $(".edit-panel").height() - $(".edit-panel .tabs").height()); editor.setValue(data.content); editor.setOption("mode", data.mode); diff --git a/static/js/wide.js b/static/js/wide.js index 2db5400..43d96db 100644 --- a/static/js/wide.js +++ b/static/js/wide.js @@ -298,6 +298,33 @@ var wide = { }; }, _initFullscreen: function () { + $(".footer .ico-max:eq(1)").click(function () { + $(".bottom-window-group").animate({ + "top": "70%" + }, function () { + $(".edit-panel").css("height", "70%"); + + var editorDatas = editors.data; + for (var i = 0, ii = editorDatas.length; i < ii; i++) { + editorDatas[i].editor.setSize("100%", $(".edit-panel").height() - $(".edit-panel .tabs").height()); + } + + $(".footer .ico-max:eq(1)").hide(); + }); + }); + + $(".bottom-window-group .ico-min").click(function () { + $(".edit-panel").css("height", "100%"); + + var editorDatas = editors.data; + for (var i = 0, ii = editorDatas.length; i < ii; i++) { + editorDatas[i].editor.setSize("100%", $(".content").height() - $(".edit-panel .tabs").height()); + } + + $(".bottom-window-group").css("top", "100%"); + $(".footer .ico-max:eq(1)").show(); + }); + $(".bottom-window-group .tabs").dblclick(function () { var $it = $(".bottom-window-group"); if ($it.hasClass("bottom-window-group-fullscreen")) { @@ -316,6 +343,30 @@ var wide = { } }); + + $(".footer .ico-max:eq(0)").click(function () { + $(".side").animate({ + "left": "0" + }, function () { + $(".edit-panel, .bottom-window-group").css({ + "left": "20%", + "width": "80%" + }); + + $(".footer .ico-max:eq(0)").hide(); + }); + }); + + $(".side .ico-min").click(function () { + $(".side").css("left", "-20%"); + + $(".edit-panel, .bottom-window-group").css({ + "left": "0", + "width": "100%" + }); + $(".footer .ico-max:eq(0)").show(); + }); + $(".side .tabs").dblclick(function () { var $it = $(".side"); if ($it.hasClass("side-fullscreen")) { diff --git a/view/index.html b/view/index.html index 7d27ac2..8184fd5 100644 --- a/view/index.html +++ b/view/index.html @@ -94,22 +94,16 @@ - -
- - - - -
+
{{.i18n.file}}
-
+
    @@ -133,13 +127,18 @@
    -
    -
    +
    + + + +
    +
    +
    {{.i18n.output}} @@ -165,8 +164,9 @@
    -