diff --git a/admin/file-upload-js.php b/admin/file-upload-js.php
index 75df115a..caf5f033 100644
--- a/admin/file-upload-js.php
+++ b/admin/file-upload-js.php
@@ -37,10 +37,10 @@ $(document).ready(function() {
.data('url', data.url)
.data('image', data.isImage)
.html(''
- + '' + data.title + ' ' + data.bytes
- + ' '
- + ' ')
+ + '' + data.title + ' ' + data.bytes
+ + ' '
+ + ' ')
.effect('highlight', 1000);
attachInsertEvent(li);
diff --git a/admin/file-upload.php b/admin/file-upload.php
index a750cd0a..7e1f42f8 100644
--- a/admin/file-upload.php
+++ b/admin/file-upload.php
@@ -13,14 +13,14 @@ if (isset($post) || isset($page)) {
?>
- 将要上传的文件拖放到这里 或者
选择文件上传
+ ', ''); ?>
diff --git a/admin/js/typecho.js b/admin/js/typecho.js
index d27dbd4d..d836b6c0 100644
--- a/admin/js/typecho.js
+++ b/admin/js/typecho.js
@@ -1,6 +1,6 @@
(function (w) {
w.Typecho = {
- insertFileToEditor : function () {}
+ insertFileToEditor : function (url, isImage) {}
};
})(window);
diff --git a/admin/write-js.php b/admin/write-js.php
index 32b4ca94..cd7a4825 100644
--- a/admin/write-js.php
+++ b/admin/write-js.php
@@ -68,7 +68,7 @@ $(document).ready(function() {
preventDuplicates : true,
animateDropdown : false,
hintText : '',
- noResultsText : '此标签不存在, 按回车创建',
+ noResultsText : '',
prePopulate : tagsPre,
onResult : function (result) {
@@ -208,6 +208,22 @@ $(document).ready(function () {
var editor = new Markdown.Editor(converter, '', options);
editor.run();
+
+ var imageButton = $('#wmd-image-button'),
+ linkButton = $('#wmd-image-button');
+
+ Typecho.insertFileToEditor = function (url, isImage) {
+ var button = isImage ? imageButton : linkButton;
+
+ button.trigger('click');
+ var checkDialog = setInterval(function () {
+ if ($('.wmd-prompt-dialog').length > 0) {
+ $('.wmd-prompt-dialog input').val(url).select();
+ clearInterval(checkDialog);
+ checkDialog = null;
+ }
+ }, 10);
+ };
});
diff --git a/admin/write-page.php b/admin/write-page.php
index 12e2cf93..31abb932 100644
--- a/admin/write-page.php
+++ b/admin/write-page.php
@@ -28,13 +28,13 @@ Typecho_Widget::widget('Widget_Contents_Page_Edit')->to($page);
-
content($page); ?>
+
diff --git a/admin/write-post.php b/admin/write-post.php
index 8eed02c9..6c972fbf 100644
--- a/admin/write-post.php
+++ b/admin/write-post.php
@@ -29,13 +29,13 @@ Typecho_Widget::widget('Widget_Contents_Post_Edit')->to($post);
-
content($post); ?>
+