From 3bc77e9a52fad33c49f8692239fd5ca211aa4701 Mon Sep 17 00:00:00 2001 From: joyqi Date: Thu, 17 Oct 2013 11:39:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E9=A1=B5=E9=9D=A2=E6=90=9E?= =?UTF-8?q?=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/write-js.php | 80 +++++++++++----------- admin/write-page.php | 153 +++++++++++++++++++------------------------ admin/write-post.php | 6 +- 3 files changed, 110 insertions(+), 129 deletions(-) diff --git a/admin/write-js.php b/admin/write-js.php index 4648d999..93d535d9 100644 --- a/admin/write-js.php +++ b/admin/write-js.php @@ -36,51 +36,53 @@ $(document).ready(function() { // tag autocomplete 提示 var tags = $('#tags'), tagsPre = []; - var items = tags.val().split(','), result = []; - for (var i = 0; i < items.length; i ++) { - var tag = items[i]; + if (tags.length > 0) { + var items = tags.val().split(','), result = []; + for (var i = 0; i < items.length; i ++) { + var tag = items[i]; - if (!tag) { - continue; + if (!tag) { + continue; + } + + tagsPre.push({ + id : tag, + tags : tag + }); } - tagsPre.push({ - id : tag, - tags : tag + tags.tokenInput(next()) { + $data[] = array( + 'id' => $tags->name, + 'tags' => $tags->name + ); + } + echo json_encode($data); + ?>, { + propertyToSearch: 'tags', + tokenValue : 'tags', + searchDelay : 0, + preventDuplicates : true, + animateDropdown : false, + hintText : '', + noResultsText : '此标签不存在, 按回车创建', + prePopulate : tagsPre, + + onResult : function (result) { + return result.slice(0, 5); + } + }); + + // tag autocomplete 提示宽度设置 + $('#token-input-tags').focus(function() { + var t = $('.token-input-dropdown'), + offset = t.outerWidth() - t.width(); + t.width($('.token-input-list').outerWidth() - offset); }); } - tags.tokenInput(next()) { - $data[] = array( - 'id' => $tags->name, - 'tags' => $tags->name - ); - } - echo json_encode($data); - ?>, { - propertyToSearch: 'tags', - tokenValue : 'tags', - searchDelay : 0, - preventDuplicates : true, - animateDropdown : false, - hintText : '', - noResultsText : '此标签不存在, 按回车创建', - prePopulate : tagsPre, - - onResult : function (result) { - return result.slice(0, 5); - } - }); - - // tag autocomplete 提示宽度设置 - $('#token-input-tags').focus(function() { - var t = $('.token-input-dropdown'), - offset = t.outerWidth() - t.width(); - t.width($('.token-input-list').outerWidth() - offset); - }); - // 缩略名自适应宽度 var slug = $('#slug'), sw = slug.width(); diff --git a/admin/write-page.php b/admin/write-page.php index b1950695..35973c1c 100644 --- a/admin/write-page.php +++ b/admin/write-page.php @@ -7,43 +7,57 @@ Typecho_Widget::widget('Widget_Contents_Page_Edit')->to($page);
-
+
-
-
-
-
-
    -
  • - -

    - - - , - - @ - - : - -

    -

    -
  • -
  • - -

    -

    -
  • - option($page); ?> + + + advanceOption($page); ?> +
+ have()): ?> modified); ?> -
  • - -

    word()); ?>

    -
  • +
    +

    +

    + %s 创建', + Typecho_Common::url('manage-pages.php?uid=' . $page->author->uid, $options->adminUrl), $page->author->screenName); ?>
    + word()); ?> +

    +
    diff --git a/admin/write-post.php b/admin/write-post.php index e29ed90f..1f9ddd87 100644 --- a/admin/write-post.php +++ b/admin/write-post.php @@ -88,6 +88,8 @@ Typecho_Widget::widget('Widget_Contents_Post_Edit')->to($post);

    + option($post); ?> +
    pass('editor', true)): ?>
    @@ -105,7 +107,6 @@ Typecho_Widget::widget('Widget_Contents_Post_Edit')->to($post);

    - advanceOptionLeft($post); ?>
    @@ -117,13 +118,12 @@ Typecho_Widget::widget('Widget_Contents_Post_Edit')->to($post);
  • allow('feed')): ?>checked="true" />
  • - advanceOptionRight($post); ?>
    + advanceOption($post); ?>
    - option($post); ?> have()): ?> modified); ?>