diff --git a/admin/common-js.php b/admin/common-js.php index 2fb0aa99..79833280 100644 --- a/admin/common-js.php +++ b/admin/common-js.php @@ -30,7 +30,8 @@ $('a').each(function () { var t = $(this), href = t.attr('href'); - if (/^adminUrl, '/'); ?>.*$/.exec(href) + if ((href.length > 1 && href[0] == '#') + /^adminUrl, '/'); ?>.*$/.exec(href) || /^index), '/'), 0, -1); ?>action\/[_a-zA-Z0-9\/]+.*$/.exec(href)) { return; } diff --git a/admin/css/style.css b/admin/css/style.css index 56e450fa..534623d0 100644 --- a/admin/css/style.css +++ b/admin/css/style.css @@ -1980,7 +1980,6 @@ ul.typecho-list-notable li .loading { .visuallyhidden { border: 0; - clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; diff --git a/admin/file-upload-js.php b/admin/file-upload-js.php index 9ab87669..8eceb6cf 100644 --- a/admin/file-upload-js.php +++ b/admin/file-upload-js.php @@ -50,16 +50,17 @@ $(document).ready(function() { $('.upload-file').fileUpload({ url : 'index('/action/upload' . (isset($fileParentContent) ? '?cid=' . $fileParentContent->cid : '')); ?>', - types : 'allowedAttachmentTypes; - $attachmentTypesCount = count($attachmentTypes); - for ($i = 0; $i < $attachmentTypesCount; $i ++) { - echo '*.' . $attachmentTypes[$i]; - if ($i < $attachmentTypesCount - 1) { - echo ';'; - } + types : allowedattachmenttypes; + $attachmenttypescount = count($attachmenttypes); + $types = array(); + + for ($i = 0; $i < $attachmenttypescount; $i ++) { + $types[] = '.' . $attachmenttypes[$i]; } -?>', + + echo json_encode($types); +?>, typesError : '', onUpload : fileUploadStart, onError : function (id) { @@ -72,16 +73,17 @@ $(document).ready(function() { $('#upload-panel').filedrop({ url : 'index('/action/upload' . (isset($fileParentContent) ? '?cid=' . $fileParentContent->cid : '')); ?>', - allowedfileextensions : [allowedAttachmentTypes; - $attachmentTypesCount = count($attachmentTypes); - for ($i = 0; $i < $attachmentTypesCount; $i ++) { - echo '".' . $attachmentTypes[$i] . '"'; - if ($i < $attachmentTypesCount - 1) { - echo ','; - } + allowedfileextensions : allowedattachmenttypes; + $attachmenttypescount = count($attachmenttypes); + $types = array(); + + for ($i = 0; $i < $attachmenttypescount; $i ++) { + $types[] = '.' . $attachmenttypes[$i]; } -?>], + + echo json_encode($types); +?>, maxfilesize :
- 将要上传的文件拖放到这里 或者 选择文件上传 + 将要上传的文件拖放到这里 或者 选择文件上传
@@ -44,148 +42,144 @@ Typecho_Widget::widget('Widget_Contents_Attachment_Edit')->to($attachment); include 'copyright.php'; include 'common-js.php'; ?> - - + response->setStatus(502); - exit; - } else { - + if (false !== $result) { $struct = array( 'title' => $result['name'], 'slug' => $result['name'], @@ -370,11 +366,7 @@ class Widget_Upload extends Widget_Abstract_Contents implements Widget_Interface $result = self::modifyHandle($this->row, $file); - if (false === $result) { - $this->response->setStatus(502); - exit; - } else { - + if (false !== $result) { $this->update(array( 'text' => serialize($result) ), $this->db->sql()->where('cid = ?', $this->cid));