diff --git a/admin/editor-js.php b/admin/editor-js.php
new file mode 100644
index 00000000..9c842862
--- /dev/null
+++ b/admin/editor-js.php
@@ -0,0 +1,140 @@
+markdown && (!$content->have() || $content->isMarkdown)): ?>
+
+
+
+
+
diff --git a/admin/js/markdown.js b/admin/js/markdown.js
index addb2d87..69b07198 100644
--- a/admin/js/markdown.js
+++ b/admin/js/markdown.js
@@ -5340,8 +5340,12 @@ else
if (!this.fullScreenBind) {
util.addEvent(document, adapter.fullScreenChange.substring(2), function () {
if (!isFullScreen()) {
+ buttons.fullscreen.style.display = '';
+ buttons.exitFullscreen.style.display = 'none';
self.hooks.exitFullScreen();
} else {
+ buttons.fullscreen.style.display = 'none';
+ buttons.exitFullscreen.style.display = '';
self.hooks.enterFullScreen();
}
});
@@ -5350,15 +5354,9 @@ else
}
if (!isFullScreen()) {
- buttons.fullscreen.style.display = 'none';
- buttons.exitFullscreen.style.display = '';
-
document.body[adapter.requestFullscreen]('webkitRequestFullScreen' == adapter.requestFullscreen
? Element.ALLOW_KEYBOARD_INPUT : null);
} else {
- buttons.fullscreen.style.display = '';
- buttons.exitFullscreen.style.display = 'none';
-
document[adapter.cancelFullscreen]();
}
};
diff --git a/admin/write-js.php b/admin/write-js.php
index 0fde1715..1bbcb4f7 100644
--- a/admin/write-js.php
+++ b/admin/write-js.php
@@ -33,6 +33,9 @@ $(document).ready(function() {
minute : (new Date()).getMinutes()
});
+ // 聚焦
+ $('#title').select();
+
// text 自动拉伸
Typecho.editorResize('text', 'index('/action/ajax?do=editorResize'); ?>');
@@ -197,139 +200,4 @@ $(document).ready(function() {
});
});
-markdown && (!$content->have() || $content->isMarkdown)): ?>
-
-
-
-
diff --git a/admin/write-page.php b/admin/write-page.php
index 90dfd96b..d036653e 100644
--- a/admin/write-page.php
+++ b/admin/write-page.php
@@ -111,8 +111,13 @@ include 'copyright.php';
include 'common-js.php';
include 'form-js.php';
include 'write-js.php';
-include 'file-upload-js.php';
+Typecho_Plugin::factory('admin/write-page.php')->trigger($plugged)->richEditor($post);
+if (!$plugged) {
+ include 'editor-js.php';
+}
+
+include 'file-upload-js.php';
Typecho_Plugin::factory('admin/write-page.php')->bottom($page);
include 'footer.php';
?>
diff --git a/admin/write-post.php b/admin/write-post.php
index f2bbdcb6..8a14359c 100644
--- a/admin/write-post.php
+++ b/admin/write-post.php
@@ -140,8 +140,13 @@ include 'copyright.php';
include 'common-js.php';
include 'form-js.php';
include 'write-js.php';
-include 'file-upload-js.php';
+Typecho_Plugin::factory('admin/write-post.php')->trigger($plugged)->richEditor($post);
+if (!$plugged) {
+ include 'editor-js.php';
+}
+
+include 'file-upload-js.php';
Typecho_Plugin::factory('admin/write-post.php')->bottom($post);
include 'footer.php';
?>