From c1f08101b7e668babf58e4376655aae73302eacb Mon Sep 17 00:00:00 2001
From: fen
Date: Sun, 24 Nov 2013 20:46:16 +0800
Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=89=A9=E5=B1=95=E5=AD=97?=
=?UTF-8?q?=E6=AE=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
admin/css/style.css | 37 ++++++++++++++++++++----
admin/editor-js.php | 2 +-
admin/scss/_forms.scss | 10 ++++---
admin/scss/components/_editor.scss | 2 +-
admin/scss/style.scss | 39 +++++++++++++++++++++++--
admin/write-js.php | 8 +++++-
admin/write-post.php | 46 ++++++++++++++++++++++++++++++
7 files changed, 129 insertions(+), 15 deletions(-)
diff --git a/admin/css/style.css b/admin/css/style.css
index 73de0ace..e0b0dfb0 100644
--- a/admin/css/style.css
+++ b/admin/css/style.css
@@ -75,10 +75,9 @@ textarea {
input[type="radio"], input[type="checkbox"] {
margin-right: 3px; }
-input.text-s {
+input.text-s, textarea.text-s {
padding: 5px; }
-
-input.text-l {
+input.text-l, textarea.text-l {
padding: 10px;
font-size: 1.14286em; }
@@ -876,14 +875,40 @@ a.operate-reply {
resize: none;
font-size: .92857em; }
-.typecho-post-area #advance-panel-btn {
+#advance-panel-btn {
padding: 0 10px;
height: 26px;
font-size: .92857em; }
-.typecho-post-area #advance-panel {
+#advance-panel {
display: none; }
+#custom-field {
+ margin: 1em 0;
+ padding: 10px 15px;
+ background: #FFF; }
+ #custom-field.fold table, #custom-field.fold .description {
+ display: none; }
+ #custom-field .description {
+ margin: 0;
+ padding: 10px 0 5px;
+ border-top: 1px solid #F0F0EC; }
+ #custom-field .typecho-label {
+ margin: 0;
+ cursor: pointer; }
+ #custom-field .typecho-label:hover {
+ color: #467B96; }
+ #custom-field th, #custom-field td {
+ padding: 10px 5px;
+ text-align: left;
+ font-size: .92857em;
+ font-weight: normal; }
+ #custom-field td {
+ border-top: 1px solid #F0F0EC;
+ vertical-align: top; }
+ #custom-field select {
+ height: 27px; }
+
.typecho-post-area .is-draft {
background: #FFF1A8; }
@@ -1134,7 +1159,7 @@ a.operate-reply {
/* 预览 */
#wmd-preview {
background: #FFF;
- padding: 10px 20px;
+ padding: 5px 15px;
word-wrap: break-word; }
#wmd-preview img {
max-width: 100%; }
diff --git a/admin/editor-js.php b/admin/editor-js.php
index 75cbfaf3..f8b51f08 100644
--- a/admin/editor-js.php
+++ b/admin/editor-js.php
@@ -6,7 +6,7 @@
$(document).ready(function () {
var textarea = $('#text'),
toolbar = $('').insertBefore(textarea.parent())
- preview = $('').insertAfter('.submit');
+ preview = $('').insertBefore('.submit');
var options = {};
diff --git a/admin/scss/_forms.scss b/admin/scss/_forms.scss
index 51725fbd..efdd5249 100644
--- a/admin/scss/_forms.scss
+++ b/admin/scss/_forms.scss
@@ -22,10 +22,12 @@ textarea {
input[type="radio"], input[type="checkbox"] { margin-right: 3px; }
-input.text-s { padding: 5px; }
-input.text-l {
- padding: 10px;
- font-size: 1.14286em;
+input, textarea {
+ &.text-s { padding: 5px; }
+ &.text-l {
+ padding: 10px;
+ font-size: 1.14286em;
+ }
}
.w-10 { width: 10%; }
diff --git a/admin/scss/components/_editor.scss b/admin/scss/components/_editor.scss
index c6a4044d..349349ea 100644
--- a/admin/scss/components/_editor.scss
+++ b/admin/scss/components/_editor.scss
@@ -66,7 +66,7 @@
/* 预览 */
#wmd-preview {
background: #FFF;
- padding: 10px 20px;
+ padding: 5px 15px;
word-wrap: break-word;
img { max-width: 100%; }
code, pre {
diff --git a/admin/scss/style.scss b/admin/scss/style.scss
index 2fb24331..d0c13f32 100644
--- a/admin/scss/style.scss
+++ b/admin/scss/style.scss
@@ -656,16 +656,51 @@ a.operate-reply {
font-size: .92857em;
}
-.typecho-post-area #advance-panel-btn {
+#advance-panel-btn {
padding: 0 10px;
height: 26px;
font-size: .92857em;
}
-.typecho-post-area #advance-panel {
+#advance-panel {
display: none;
}
+#custom-field {
+ margin: 1em 0;
+ padding: 10px 15px;
+ background: #FFF;
+ &.fold {
+ table, .description { display: none; }
+ }
+
+ .description {
+ margin: 0;
+ padding: 10px 0 5px;
+ border-top: 1px solid #F0F0EC;
+ }
+
+ .typecho-label {
+ margin: 0;
+ cursor: pointer;
+ &:hover {
+ color: #467B96;
+ }
+ }
+
+ th, td {
+ padding: 10px 5px;
+ text-align: left;
+ font-size: .92857em;
+ font-weight: normal;
+ }
+ td {
+ border-top: 1px solid #F0F0EC;
+ vertical-align: top;
+ }
+ select { height: 27px; }
+}
+
.typecho-post-area .is-draft {
background: #FFF1A8;
}
diff --git a/admin/write-js.php b/admin/write-js.php
index f5ef41b8..2c115e39 100644
--- a/admin/write-js.php
+++ b/admin/write-js.php
@@ -187,10 +187,16 @@ $(document).ready(function() {
// 高级选项控制
$('#advance-panel-btn').click(function() {
$('#advance-panel').toggle();
- $(this).toggleClass('fold');
+ return false;
+ });
+
+ // 自定义字段
+ $('#custom-field .typecho-label').click(function() {
+ $(this).parent().toggleClass('fold');
return false;
});
+ // 草稿删除确认
$('.edit-draft-notice a').click(function () {
if (confirm('')) {
window.location.href = $(this).attr('href');
diff --git a/admin/write-post.php b/admin/write-post.php
index d24fbbd9..f96232f0 100644
--- a/admin/write-post.php
+++ b/admin/write-post.php
@@ -42,8 +42,54 @@ Typecho_Widget::widget('Widget_Contents_Post_Edit')->to($post);
+
+
+
+
content($post); ?>