Skip to content

Commit

Permalink
issue #50 styling uploader
Browse files Browse the repository at this point in the history
  • Loading branch information
akate committed Aug 18, 2011
1 parent d1bde35 commit da45d88
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 8 deletions.
6 changes: 3 additions & 3 deletions inc/lang/en/lang.php
Expand Up @@ -129,7 +129,7 @@
$lang['mediausage'] = 'Use the following syntax to reference this file:';
$lang['mediaview'] = 'View original file';
$lang['mediaroot'] = 'root';
$lang['mediaupload'] = 'Upload a file to the current namespace here. To create subnamespaces, prepend them to your "Upload as" filename separated by colons.';
$lang['mediaupload'] = 'Upload a file to the current namespace here. To create subnamespaces, prepend them to your "Upload as" filename separated by colons. Files also can be selected by drag and drop.';
$lang['mediaextchange'] = 'Filextension changed from .%s to .%s!';

$lang['js']['mediatitle'] = 'Link settings';
Expand Down Expand Up @@ -354,8 +354,8 @@
$lang['js']['media_diff_opacity'] = 'Overlay';
$lang['js']['media_diff_portions'] = 'Slider';

$lang['js']['media_select'] = 'Select files...';
$lang['js']['media_upload_btn'] = 'Start uploading';
$lang['js']['media_select'] = 'Select files';
$lang['js']['media_upload_btn'] = 'Upload';
$lang['js']['media_drop'] = 'Drop files here to upload';
$lang['js']['media_cancel'] = 'remove';
$lang['js']['media_overwrt'] = 'Overwrite existing files';
Expand Down
8 changes: 5 additions & 3 deletions inc/media.php
Expand Up @@ -248,6 +248,8 @@ function media_delete($id,$auth){
* @return mixed false on error, id of the new file on success
*/
function media_upload_xhr($ns,$auth){
if(!checkSecurityToken()) return false;

$id = $_GET['qqfile'];
list($ext,$mime,$dl) = mimetype($id);
$input = fopen("php://input", "r");
Expand Down Expand Up @@ -685,7 +687,7 @@ function media_tab_files_options($ns, $sort){
global $lang;

echo '<div class="background-container">';
echo $ns;
echo $ns ? $ns : '['.$lang['mediaroot'].']';

echo '<div id="mediamanager__tabs_list">';

Expand Down Expand Up @@ -753,7 +755,7 @@ function media_tab_upload($ns,$auth=null,$jump='') {
if(is_null($auth)) $auth = auth_quickaclcheck("$ns:*");

echo '<div class="background-container">';
echo sprintf($lang['media_upload'], $ns);
echo sprintf($lang['media_upload'], $ns ? $ns : '['.$lang['mediaroot'].']');
echo '</div>';

echo '<div class="scroll-container">';
Expand All @@ -775,7 +777,7 @@ function media_tab_search($ns,$auth=null) {
if (!$query) $query = '';

echo '<div class="background-container">';
echo sprintf($lang['media_search'], $ns);
echo sprintf($lang['media_search'], $ns ? $ns : '['.$lang['mediaroot'].']');
echo'</div>';

echo '<div class="scroll-container">';
Expand Down
5 changes: 4 additions & 1 deletion lib/scripts/fileuploaderextended.js
Expand Up @@ -56,6 +56,8 @@ qq.extend(qq.FileUploader.prototype, {
this._find(item, 'size').style.display = 'none';

var nameElement = this._find(item, 'nameInput');
fileName = fileName.toLowerCase();
fileName = fileName.replace(/([^a-z0-9_\.\-]+)/g, '_');
nameElement.value = fileName;
nameElement.id = 'mediamanager__upload_item'+id;

Expand All @@ -77,8 +79,9 @@ qq.FileUploaderExtended = function(o){
'<div class="qq-upload-drop-area"><span>' + LANG.media_drop + '</span></div>' +
'<div class="qq-upload-button">' + LANG.media_select + '</div>' +
'<div class="qq-upload-list"></div>' +
'<div><input class="button" type="submit" value="' + LANG.media_upload_btn + '" id="mediamanager__upload_button">' +
'<label class="check" for="dw__ow"><input id="dw__ow" type="checkbox" value="1" name="ow"><span>' + LANG.media_overwrt + '</span></label>' +
'<div><input class="button" type="submit" value="' + LANG.media_upload_btn + '" id="mediamanager__upload_button"></div>' +
'</div>' +
'</div>',

// template for one item in file list
Expand Down
11 changes: 10 additions & 1 deletion lib/tpl/default/_fileuploader.css
Expand Up @@ -87,5 +87,14 @@
}

.qq-uploader #dw__ow {
margin: 10px 0;
margin: 10px 3px -5px 10px;
}

.qq-uploader .check {
line-height: 18px;
}

.qq-uploader #mediamanager__upload_button {
margin-top: -5px;
margin-bottom: 10px;
}

0 comments on commit da45d88

Please sign in to comment.