From c472bad9de398442c30ec1410d07284f0db8b821 Mon Sep 17 00:00:00 2001 From: Kate Arzamastseva Date: Fri, 19 Aug 2011 20:56:43 +0300 Subject: issue #44 new uploader in the media popup --- lib/exe/ajax.php | 4 +++- lib/scripts/fileuploaderextended.js | 8 +++++++- lib/scripts/media.js | 4 ++-- lib/tpl/default/_fileuploader.css | 32 +++++++++++++++++--------------- lib/tpl/default/media.css | 5 +++++ lib/tpl/default/mediamanager.css | 7 ++++++- 6 files changed, 40 insertions(+), 20 deletions(-) (limited to 'lib') diff --git a/lib/exe/ajax.php b/lib/exe/ajax.php index 52131d864..d8754b875 100644 --- a/lib/exe/ajax.php +++ b/lib/exe/ajax.php @@ -265,9 +265,11 @@ function ajax_mediaupload(){ $res = media_upload_xhr($NS, $AUTH); $id = $_GET['qqfile']; } + $id = cleanID($id, false, true); if ($res) $result = array('success' => true, - 'link' => media_managerURL(array('ns' => getNS($id), 'image' => $id), '&')); + 'link' => media_managerURL(array('ns' => getNS($id), 'image' => $id), '&'), + 'id' => $id); if (!$result) { $error = ''; diff --git a/lib/scripts/fileuploaderextended.js b/lib/scripts/fileuploaderextended.js index 36fc3ec63..f4a3219bb 100644 --- a/lib/scripts/fileuploaderextended.js +++ b/lib/scripts/fileuploaderextended.js @@ -167,7 +167,7 @@ qq.extend(qq.FileUploaderExtended.prototype, { if (result.success){ qq.addClass(item, this._classes.success); - $link = '' + nameInput.value + ''; + $link = '' + nameInput.value + ''; jQuery(fileElement).html($link); } else { @@ -175,6 +175,12 @@ qq.extend(qq.FileUploaderExtended.prototype, { var fail = this._find(item, 'failedText'); if (result.error) qq.setText(fail, result.error); } + + if (document.getElementById('media__content') && !document.getElementById('mediamanager__done_form')) { + var button = '
'; + button += '
' + jQuery('#mediamanager__uploader').append(button); + } } }); diff --git a/lib/scripts/media.js b/lib/scripts/media.js index 36dadf232..997321a65 100644 --- a/lib/scripts/media.js +++ b/lib/scripts/media.js @@ -43,7 +43,8 @@ var dw_mediamanager = { .delegate('a.select', 'click', dw_mediamanager.select) // Attach deletion confirmation dialog to the delete buttons .delegate('#media__content a.btn_media_delete', 'click', - dw_mediamanager.confirmattach); + dw_mediamanager.confirmattach) + .delegate('#mediamanager__done_form', 'submit', dw_mediamanager.list); $tree.dw_tree({toggle_selector: 'img', load_data: function (show_sublist, $clicky) { @@ -670,7 +671,6 @@ var dw_mediamanager = { prepare_content: function ($content) { // hide syntax example $content.find('div.example:visible').hide(); - dw_mediamanager.initFlashUpload(); }, /** diff --git a/lib/tpl/default/_fileuploader.css b/lib/tpl/default/_fileuploader.css index e87ba94db..0e53f8187 100644 --- a/lib/tpl/default/_fileuploader.css +++ b/lib/tpl/default/_fileuploader.css @@ -4,20 +4,18 @@ } .qq-upload-button { - display: block; - width: 115px; - padding: 7px 0; - text-align: center; - background: __background_alt__; + display: inline-block; border: 1px solid __border__; - color: __extern__; - font-weight: bold; + color: __text__; + background-color: __background__; + vertical-align: middle; + text-decoration: none; + font-size: 100%; + cursor: pointer; + margin: 1px; margin-bottom: 5px; -} - -.qq-upload-button-hover { - background: __border__; - color: __background__; + padding: 0.125em 0.4em; + background: __background__ url(images/buttonshadow.png) repeat-x bottom; } .qq-upload-button-focus { @@ -42,11 +40,11 @@ top: 50%; width:100%; margin-top:-8px; - font-size:16px; + font-size: 120%; } .qq-upload-drop-area-active { - background: #DADADA; + background: __background_alt__; } .qq-upload-file, .qq-upload-spinner, .qq-upload-size, .qq-upload-cancel, .qq-upload-failed-text { @@ -62,7 +60,7 @@ } .qq-upload-size,.qq-upload-cancel { - font-size:11px; + font-size: 85%; } .qq-upload-failed-text { @@ -97,4 +95,8 @@ .qq-uploader #mediamanager__upload_button { margin-top: -5px; margin-bottom: 10px; +} + +.qq-uploader div.li { + margin-bottom: 5px; } \ No newline at end of file diff --git a/lib/tpl/default/media.css b/lib/tpl/default/media.css index 7b558a80b..b325a1ef6 100644 --- a/lib/tpl/default/media.css +++ b/lib/tpl/default/media.css @@ -151,6 +151,11 @@ it's dirty, so any "real" fixes are welcome */ border-bottom: solid 1px __border__; padding: 0 0.5em 1em 0.5em; } + +#media__content form#dw__upload { + border-bottom: 0; +} + #media__content form#dw__upload fieldset { padding: 0; margin: 0; diff --git a/lib/tpl/default/mediamanager.css b/lib/tpl/default/mediamanager.css index f6ad721e0..ad371ee3d 100644 --- a/lib/tpl/default/mediamanager.css +++ b/lib/tpl/default/mediamanager.css @@ -289,6 +289,11 @@ padding-bottom: 0.5em; } +#media__content #mediamanager__uploader { + border-bottom: 1px solid #8CACBB; + padding-bottom: 0.5em; +} + /* File preview */ .mediamanager__preview, @@ -318,7 +323,7 @@ form.meta textarea.edit { } #mediamanager__details #page__revisions ul li div.li div { - font-size: 12px; + font-size: 90%; color: __text_neu__; padding-left: 18px; } -- cgit v1.2.3