summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2012-12-09 01:25:50 -0800
committerThomas Müller <thomas.mueller@tmit.eu>2012-12-09 01:25:50 -0800
commit9a3a83e16a5a65229ffeebafe739fffd524499bc (patch)
treeebc202e2f0bb6e4b761927f8951b01c11a7707eb /apps
parente3e4dcf77b0abf719fd69fcbbe8cab76b530c138 (diff)
parent787e8b86d929a8d0a7dca2812d75bf4d5e467e7a (diff)
downloadnextcloud-server-9a3a83e16a5a65229ffeebafe739fffd524499bc.tar.gz
nextcloud-server-9a3a83e16a5a65229ffeebafe739fffd524499bc.zip
Merge pull request #282 from butonic/fix_new_and_upload_button_html_css
fix_new_and_upload_button_html_css
Diffstat (limited to 'apps')
-rw-r--r--apps/files/css/files.css81
-rw-r--r--apps/files/js/filelist.js2
-rw-r--r--apps/files/js/files.js28
-rw-r--r--apps/files/templates/index.php27
4 files changed, 75 insertions, 63 deletions
diff --git a/apps/files/css/files.css b/apps/files/css/files.css
index 0b886fc3fa9..9bd92c92580 100644
--- a/apps/files/css/files.css
+++ b/apps/files/css/files.css
@@ -4,40 +4,65 @@
/* FILE MENU */
.actions { padding:.3em; float:left; height:2em; }
-.actions input, .actions button, .actions .button { margin:0; }
-#file_menu { right:0; position:absolute; top:0; }
-#file_menu a { display:block; float:left; background-image:none; text-decoration:none; }
-.file_upload_form, #file_newfolder_form { display:inline; float: left; margin-left:0; }
-#fileSelector, #file_upload_submit, #file_newfolder_submit { display:none; }
-.file_upload_wrapper, #file_newfolder_name { background-repeat:no-repeat; background-position:.5em .5em; padding-left:2em; }
-.file_upload_wrapper { font-weight:bold; display:-moz-inline-box; /* fallback for older firefox versions*/ display:block; float:left; padding-left:0; overflow:hidden; position:relative; margin:0; margin-left:2px; }
-.file_upload_wrapper .file_upload_button_wrapper { position:absolute; top:0; left:0; width:100%; height:100%; cursor:pointer; z-index:1000; }
-#new { background-color:#5bb75b; float:left; margin:0 0 0 1em; border-right:none; z-index:1010; height:1.3em; }
-#new:hover, a.file_upload_button_wrapper:hover + button.file_upload_filename { background-color:#4b964b; }
+.actions input, .actions button, .actions .button { margin:0; float:left; }
+
+#new {
+ height:17px; margin:0 0 0 1em; z-index:1010; float:left;
+ background-color:#5bb75b;
+ border:1px solid; border-color:#51a351 #419341 #387038;
+ -moz-box-shadow:0 1px 1px #f8f8f8, 1px 1px 1px #ada inset;
+ -webkit-box-shadow:0 1px 1px #f8f8f8, 1px 1px 1px #ada inset;
+ box-shadow:0 1px 1px #f8f8f8, 1px 1px 1px #ada inset;
+}
+#new:hover, #upload:hover { background-color:#4b964b; }
#new.active { border-bottom-left-radius:0; border-bottom-right-radius:0; border-bottom:none; }
#new>a { padding:.5em 1.2em .3em; color:#fff; text-shadow:0 1px 0 #51a351; }
-#new>ul { display:none; position:fixed; text-align:left; padding:.5em; background:#f8f8f8; margin-top:0.075em; border:1px solid #ddd; min-width:7em; margin-left:-.5em; z-index:-1; }
-#new>ul>li { margin:.3em; padding-left:2em; background-repeat:no-repeat; cursor:pointer; padding-bottom:0.1em }
+#new>ul {
+ display:none; position:fixed; min-width:7em; z-index:-1;
+ padding:.5em; margin-top:0.075em; margin-left:-.5em;
+ text-align:left;
+ background:#f8f8f8; border:1px solid #ddd;
+}
+#new>ul>li { height:20px; margin:.3em; padding-left:2em; padding-bottom:0.1em;
+ background-repeat:no-repeat; cursor:pointer; }
#new>ul>li>p { cursor:pointer; }
#new>ul>li>input { padding:0.3em; margin:-0.3em; }
-#new, .file_upload_filename { border:1px solid; border-color:#51a351 #419341 #387038; -moz-box-shadow:0 1px 1px #f8f8f8, 1px 1px 1px #ada inset; -webkit-box-shadow:0 1px 1px #f8f8f8, 1px 1px 1px #ada inset; box-shadow:0 1px 1px #f8f8f8, 1px 1px 1px #ada inset; }
#new .popup { border-top-left-radius:0; z-index:10; }
-#file_newfolder_name { background-image:url('%webroot%/core/img/places/folder.svg'); font-weight:normal; width:7em; }
-.file_upload_start, .file_upload_filename { font-size:1em; }
-#file_newfolder_submit, #file_upload_submit { width:3em; }
+#upload {
+ height:27px; padding:0; margin-left:0.2em; overflow:hidden;
+ color:#fff; text-shadow:0 1px 0 #51a351;
+ border-color:#51a351 #419341 #387038;
+ box-shadow:0 1px 1px #f8f8f8, 1px 1px 1px #ada inset;
+ background-color:#5bb75b;
+}
+#upload a {
+ position:relative; display:block; width:100%; height:27px;
+ cursor:pointer; z-index:1000;
+ background-image:url('%webroot%/core/img/actions/upload-white.svg');
+ background-repeat:no-repeat;
+ background-position:7px 6px;
+}
.file_upload_target { display:none; }
+.file_upload_form { display:inline; float:left; margin:0; padding:0; cursor:pointer; overflow:visible; }
+#file_upload_start {
+ left:0; top:0; width:28px; height:27px; padding:0;
+ font-size:1em;
+ -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; filter:alpha(opacity=0); opacity:0;
+ z-index:-1; position:relative; cursor:pointer; overflow:hidden;
+}
-.file_upload_start { -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; filter:alpha(opacity=0); opacity:0; z-index:1; position:absolute; left:0; top:0; width:100%; cursor:pointer;}
-.file_upload_filename { background-color:#5bb75b; z-index:100; cursor:pointer; background-image: url('%webroot%/core/img/actions/upload-white.svg'); background-repeat: no-repeat; background-position: center; height: 2.29em; width: 2.5em; }
-
-#upload { position:absolute; right:13.5em; top:0em; }
-#upload #uploadprogressbar { position:relative; display:inline-block; width:10em; height:1.5em; top:.4em; }
-
-.file_upload_form, .file_upload_wrapper, .file_upload_start, .file_upload_filename, #file_upload_submit { cursor:pointer; }
+#uploadprogresswrapper { position:absolute; right:13.5em; top:0em; }
+#uploadprogresswrapper #uploadprogressbar { position:relative; display:inline-block; width:10em; height:1.5em; top:.4em; }
/* FILE TABLE */
-#emptyfolder { position:absolute; margin:10em 0 0 10em; font-size:1.5em; font-weight:bold; color:#888; text-shadow:#fff 0 1px 0; }
+
+#emptyfolder {
+ position:absolute;
+ margin:10em 0 0 10em;
+ font-size:1.5em; font-weight:bold;
+ color:#888; text-shadow:#fff 0 1px 0;
+}
table { position:relative; top:37px; width:100%; }
tbody tr { background-color:#fff; height:2.5em; }
tbody tr:hover, tbody tr:active, tbody tr.selected { background-color:#f8f8f8; }
@@ -60,13 +85,13 @@ table tr[data-type="dir"] td.filename a.name span.nametext {font-weight:bold; }
table td.filename input.filename { width:100%; cursor:text; }
table td.filename a, table td.login, table td.logout, table td.download, table td.upload, table td.create, table td.delete { padding:.2em .5em .5em 0; }
table td.filename .nametext, .uploadtext, .modified { float:left; padding:.3em 0; }
-// TODO fix usability bug (accidental file/folder selection)
-table td.filename .nametext { width:40em; overflow:hidden; text-overflow:ellipsis; }
+/* TODO fix usability bug (accidental file/folder selection) */
+table td.filename .nametext { overflow:hidden; text-overflow:ellipsis; }
table td.filename .uploadtext { font-weight:normal; margin-left:.5em; }
table td.filename form { font-size:.85em; margin-left:3em; margin-right:3em; }
table thead.fixed tr{ position:fixed; top:6.5em; z-index:49; -moz-box-shadow:0 -3px 7px #ddd; -webkit-box-shadow:0 -3px 7px #ddd; box-shadow:0 -3px 7px #ddd; }
table thead.fixed { height:2em; }
-#fileList tr td.filename>input[type=checkbox]:first-child { -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; filter:alpha(opacity=0); opacity:0; float:left; margin:.7em 0 0 1em; /* bigger clickable area doesn’t work in FF width:2.8em; height:2.4em;*/ -webkit-transition:opacity 200ms; -moz-transition:opacity 200ms; -o-transition:opacity 200ms; transition:opacity 200ms; }
+#fileList tr td.filename>input[type="checkbox"]:first-child { -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; filter:alpha(opacity=0); opacity:0; float:left; margin:.7em 0 0 1em; /* bigger clickable area doesn’t work in FF width:2.8em; height:2.4em;*/ -webkit-transition:opacity 200ms; -moz-transition:opacity 200ms; -o-transition:opacity 200ms; transition:opacity 200ms; }
#fileList tr td.filename>input[type="checkbox"]:hover:first-child { -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=80)"; filter:alpha(opacity=80); opacity:.8; }
#fileList tr td.filename>input[type="checkbox"]:checked:first-child { -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; filter:alpha(opacity=100); opacity:1; }
#fileList tr td.filename { -webkit-transition:background-image 500ms; -moz-transition:background-image 500ms; -o-transition:background-image 500ms; transition:background-image 500ms; position:relative; }
@@ -87,4 +112,4 @@ a.action>img { max-height:16px; max-width:16px; vertical-align:text-bottom; }
#scanning-message{ top:40%; left:40%; position:absolute; display:none; }
-div.crumb a{ padding: 0.9em 0 0.7em 0; }
+div.crumb a{ padding:0.9em 0 0.7em 0; }
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 5674206632b..9f0bafafbdf 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -89,7 +89,6 @@ var FileList={
$('tr').filterAttr('data-file',name).remove();
if($('tr[data-file]').length==0){
$('#emptyfolder').show();
- $('.file_upload_filename').addClass('highlight');
}
},
insertElement:function(name,type,element){
@@ -118,7 +117,6 @@ var FileList={
$('#fileList').append(element);
}
$('#emptyfolder').hide();
- $('.file_upload_filename').removeClass('highlight');
},
loadingDone:function(name, id){
var mime, tr=$('tr').filterAttr('data-file',name);
diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index 886bbfbb18f..ece0b29ae16 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -46,10 +46,6 @@ $(document).ready(function() {
$(this).attr('data-file',decodeURIComponent($(this).attr('data-file')));
});
- if($('tr[data-file]').length==0){
- $('.file_upload_filename').addClass('highlight');
- }
-
$('#file_action_panel').attr('activeAction', false);
//drag/drop of files
@@ -70,8 +66,8 @@ $(document).ready(function() {
}
// Triggers invisible file input
- $('.file_upload_button_wrapper').live('click', function() {
- $(this).parent().children('.file_upload_start').trigger('click');
+ $('#upload a').live('click', function() {
+ $(this).parent().children('#file_upload_start').trigger('click');
return false;
});
@@ -172,12 +168,6 @@ $(document).ready(function() {
procesSelection();
});
- $('#file_newfolder_name').click(function(){
- if($('#file_newfolder_name').val() == 'New Folder'){
- $('#file_newfolder_name').val('');
- }
- });
-
$('.download').click('click',function(event) {
var files=getSelectedFiles('name').join(';');
var dir=$('#dir').val()||'/';
@@ -205,9 +195,9 @@ $(document).ready(function() {
e.preventDefault(); // prevent browser from doing anything, if file isn't dropped in dropZone
});
- if ( document.getElementById("data-upload-form") ) {
+ if ( document.getElementById('data-upload-form') ) {
$(function() {
- $('.file_upload_start').fileupload({
+ $('#file_upload_start').fileupload({
dropZone: $('#content'), // restrict dropZone to content div
add: function(e, data) {
var files = data.files;
@@ -222,7 +212,7 @@ $(document).ready(function() {
totalSize+=files[i].size;
if(FileList.deleteFiles && FileList.deleteFiles.indexOf(files[i].name)!=-1){//finish delete if we are uploading a deleted file
FileList.finishDelete(function(){
- $('.file_upload_start').change();
+ $('#file_upload_start').change();
});
return;
}
@@ -296,7 +286,7 @@ $(document).ready(function() {
var dropTarget = $(e.originalEvent.target).closest('tr');
if(dropTarget && dropTarget.attr('data-type') === 'dir') { // drag&drop upload to folder
var dirName = dropTarget.attr('data-file')
- var jqXHR = $('.file_upload_start').fileupload('send', {files: files[i],
+ var jqXHR = $('#file_upload_start').fileupload('send', {files: files[i],
formData: function(form) {
var formArray = form.serializeArray();
// array index 0 contains the max files size
@@ -357,7 +347,7 @@ $(document).ready(function() {
}
uploadingFiles[dirName][fileName] = jqXHR;
} else {
- var jqXHR = $('.file_upload_start').fileupload('send', {files: files[i]})
+ var jqXHR = $('#file_upload_start').fileupload('send', {files: files[i]})
.success(function(result, textStatus, jqXHR) {
var response;
response=jQuery.parseJSON(result);
@@ -454,7 +444,7 @@ $(document).ready(function() {
//add multiply file upload attribute to all browsers except konqueror (which crashes when it's used)
if(navigator.userAgent.search(/konqueror/i)==-1){
- $('.file_upload_start').attr('multiple','multiple')
+ $('#file_upload_start').attr('multiple','multiple')
}
//if the breadcrumb is to long, start by replacing foldernames with '...' except for the current folder
@@ -482,7 +472,6 @@ $(document).ready(function() {
$(window).click(function(){
$('#new>ul').hide();
$('#new').removeClass('active');
- $('button.file_upload_filename').removeClass('active');
$('#new li').each(function(i,element){
if($(element).children('p').length==0){
$(element).children('input').remove();
@@ -496,7 +485,6 @@ $(document).ready(function() {
$('#new>a').click(function(){
$('#new>ul').toggle();
$('#new').toggleClass('active');
- $('button.file_upload_filename').toggleClass('active');
});
$('#new li').click(function(){
if($(this).children('p').length==0){
diff --git a/apps/files/templates/index.php b/apps/files/templates/index.php
index de440a6f79c..bd34c9a76d9 100644
--- a/apps/files/templates/index.php
+++ b/apps/files/templates/index.php
@@ -3,7 +3,7 @@
<?php echo($_['breadcrumb']); ?>
<?php if ($_['isCreatable']):?>
<div class="actions <?php if (isset($_['files']) and count($_['files'])==0):?>emptyfolder<?php endif; ?>">
- <div id='new' class='button'>
+ <div id="new" class="button">
<a><?php echo $l->t('New');?></a>
<ul class="popup popupTop">
<li style="background-image:url('<?php echo OCP\mimetype_icon('text/plain') ?>')"
@@ -14,7 +14,7 @@
data-type='web'><p><?php echo $l->t('From link');?></p></li>
</ul>
</div>
- <div class="file_upload_wrapper svg">
+ <div id="upload" class="button">
<form data-upload-id='1'
id="data-upload-form"
class="file_upload_form"
@@ -30,19 +30,20 @@
<input type="hidden" class="max_human_file_size"
value="(max <?php echo $_['uploadMaxHumanFilesize']; ?>)">
<input type="hidden" name="dir" value="<?php echo $_['dir'] ?>" id="dir">
- <input class="file_upload_start" type="file" name='files[]'/>
- <a href="#" class="file_upload_button_wrapper" onclick="return false;"
- title="<?php echo $l->t('Upload'); echo ' max. '.$_['uploadMaxHumanFilesize'] ?>"></a>
- <button class="file_upload_filename"></button>
- <iframe name="file_upload_target_1" class='file_upload_target' src=""></iframe>
+ <input type="file" id="file_upload_start" name='files[]'/>
+ <a href="#" class="svg" onclick="return false;"
+ title="<?php echo $l->t('Upload') . ' max. '.$_['uploadMaxHumanFilesize'] ?>"></a>
+
+ <iframe name="file_upload_target_1" class="file_upload_target" src=""></iframe>
</form>
</div>
- <div id="upload">
- <div id="uploadprogressbar"></div>
- <input type="button" class="stop" style="display:none"
- value="<?php echo $l->t('Cancel upload');?>"
- onclick="javascript:Files.cancelUploads();" />
- </div>
+ <div id="uploadprogresswrapper">
+ <div id="uploadprogressbar"></div>
+ <input type="button" class="stop" style="display:none"
+ value="<?php echo $l->t('Cancel upload');?>"
+ onclick="javascript:Files.cancelUploads();"
+ />
+ </div>
</div>
<div id="file_action_panel"></div>