diff --git a/conf/users/admin.json b/conf/users/admin.json index 4818c5d..06afe1e 100644 --- a/conf/users/admin.json +++ b/conf/users/admin.json @@ -12,7 +12,7 @@ "Theme": "default", "Created": 1414080000000000000, "Updated": 1414080000000000000, - "Lived": 1414080000000000000, + "Lived": 1422433217150692000, "Editor": { "FontFamily": "Consolas, 'Courier New', monospace", "FontSize": "13px", diff --git a/static/css/start.css b/static/css/start.css index ac182ad..ffe169e 100644 --- a/static/css/start.css +++ b/static/css/start.css @@ -19,6 +19,7 @@ line-height: 28px; white-space: normal; word-wrap: break-word; + overflow: auto; } #startPage a { @@ -65,7 +66,6 @@ } #startPage .news { - height: 300px; width: 60%; float: right; border-left: 1px solid #f1f1f1; @@ -80,4 +80,6 @@ #startPage .date { color: #bbb; font-size: 13px; + word-wrap: normal; + white-space: nowrap; } \ No newline at end of file diff --git a/static/js/dialog.js b/static/js/dialog.js index 1fb3286..ae1db6e 100644 --- a/static/js/dialog.js +++ b/static/js/dialog.js @@ -135,25 +135,6 @@ $($("#" + id + "Dialog ." + styleClass.main + " div").get(0)).append(cloneObj); $(cloneObj).show(); - // Sets position. - var top = "", left = "", - $dialog = $("#" + id + "Dialog"); - if (settings.position) { - top = settings.position.top; - left = settings.position.left; - } else { - // 20(footer) + 23(header) - top = parseInt((windowH - dialogH - 43) / 2); - if (top < 0) { - top = 0; - } - left = parseInt((windowW - dialogW) / 2); - } - $dialog.css({ - "top": top + "px", - "left": left + "px" - }); - // Bind event. $("#" + id + "Dialog ." + styleClass.closeIcon).bind("click", function () { $.dialog._close(id, settings); @@ -178,7 +159,7 @@ $.dialog._close(id, settings); } }); - + $(window).resize(function () { $(".dialog-background").height($("body").height()); }); @@ -263,9 +244,30 @@ _openDialog: function (target, msg) { var inst = this._getInst(target); var id = inst.id, - settings = inst.settings; + settings = inst.settings, + top = "", left = "", + $dialog = $("#" + id + "Dialog"), + windowH = $(window).height(), + windowW = $(window).width(), + dialogH = settings.height ? settings.height : parseInt(windowH * 0.6), + dialogW = settings.width ? settings.width : parseInt(windowW * 0.6); - $("#" + id + "Dialog").show(); + // Sets position. + if (settings.position) { + top = settings.position.top; + left = settings.position.left; + } else { + // 20(footer) + 23(header) + top = parseInt((windowH - dialogH - 43) / 2); + if (top < 0) { + top = 0; + } + left = parseInt((windowW - dialogW) / 2); + } + $dialog.css({ + "top": top + "px", + "left": left + "px" + }).show(); if (settings.modal) { var styleClass = this._getDefaults($.dialog._defaults, settings, "styleClass"); diff --git a/static/js/editors.js b/static/js/editors.js index 5c55dd4..c132b2c 100644 --- a/static/js/editors.js +++ b/static/js/editors.js @@ -272,6 +272,7 @@ var editors = { + '"> ' + config.label.start_page + '', content: '
', after: function () { + $("#startPage").height($('.side-right').height() - $(".bottom-window-group").children(".tabs").height() - 100); $("#startPage").load(config.context + '/start?sid=' + config.wideSessionId); $.ajax({ url: "https://symphony.b3log.org/apis/articles?tags=wide,golang&p=1&size=30", diff --git a/static/js/wide.js b/static/js/wide.js index ba34bd6..99a9ff3 100644 --- a/static/js/wide.js +++ b/static/js/wide.js @@ -379,6 +379,8 @@ var wide = { } else { $(".side-right > .tabs-panel > div").height($('.side-right').height() - $bottomGroup.children(".tabs").height()); } + + $("#startPage").height($('.side-right').height() - $bottomGroup.children(".tabs").height() - 100); }, _initWS: function () { var outputWS = new ReconnectingWebSocket(config.channel + '/output/ws?sid=' + config.wideSessionId); @@ -420,7 +422,7 @@ var wide = { break; case 'run-done': bottomGroup.fillOutput($('.bottom-window-group .output > div').html().replace(/<\/pre>$/g, data.output + '')); - + wide.curProcessId = undefined; $("#buildRun").removeClass("ico-stop") .addClass("ico-buildrun").attr("title", config.label.build_n_run); @@ -489,10 +491,10 @@ var wide = { // 点击隐藏弹出层 $("body").bind("mouseup", function (event) { - //fix issue#200 右键文件树失效 - if (event.which == 3) { - return false; - } + //fix issue#200 右键文件树失效 + if (event.which === 3) { + return false; + } $(".frame").hide(); if (!($(event.target).closest(".frame").length === 1 || event.target.className === "frame")) { @@ -524,7 +526,6 @@ var wide = { for (var i = 0, ii = editorDatas.length; i < ii; i++) { editorDatas[i].editor.setSize("100%", height); } - }); }, _save: function (path, editor) { diff --git a/static/js/windows.js b/static/js/windows.js index dc365b7..49db5c1 100644 --- a/static/js/windows.js +++ b/static/js/windows.js @@ -170,6 +170,7 @@ var windows = { editorDatas[i].editor.setSize("100%", height); } + $("#startPage").height(height - 100); $it.show(); $(".footer .ico-restore:eq(1)").hide(); }); @@ -225,7 +226,7 @@ var windows = { for (var i = 0, ii = editorDatas.length; i < ii; i++) { editorDatas[i].editor.setSize("100%", height); } - + $("#startPage").height(height - 100); $(".bottom-window-group").css("top", "100%").hide(); $(".footer .ico-restore:eq(1)").show(); },