From 682148e9179d52bfc3d85a75f3e6be5bdc3c7c51 Mon Sep 17 00:00:00 2001 From: plegall Date: Wed, 28 May 2014 09:33:17 +0000 Subject: feature 2616, customizations for plupload * bug fixed, remove debug inserts in table "plupload" * display photo title as tooltip on thumbnail * hide useless .plupload_header * hide any other form fieldset until an album is selected git-svn-id: http://piwigo.org/svn/trunk@28552 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/themes/default/js/addAlbum.js | 2 +- .../themes/default/template/photos_add_direct.tpl | 95 ++++------------------ admin/themes/default/theme.css | 5 ++ 3 files changed, 24 insertions(+), 78 deletions(-) (limited to 'admin') diff --git a/admin/themes/default/js/addAlbum.js b/admin/themes/default/js/addAlbum.js index dec06532e..0efdd8c95 100644 --- a/admin/themes/default/js/addAlbum.js +++ b/admin/themes/default/js/addAlbum.js @@ -83,7 +83,7 @@ jQuery.fn.pwgAddAlbum = function(options) { } albumParent.val(''); - jQuery('#albumSelection').show(); + jQuery('#albumSelection, .selectFiles, .showFieldset').show(); }, error: function(XMLHttpRequest, textStatus, errorThrows) { jQuery('#albumCreationLoading').hide(); diff --git a/admin/themes/default/template/photos_add_direct.tpl b/admin/themes/default/template/photos_add_direct.tpl index b5b471fb9..8f7bee6e1 100644 --- a/admin/themes/default/template/photos_add_direct.tpl +++ b/admin/themes/default/template/photos_add_direct.tpl @@ -25,7 +25,7 @@ var categoriesCache = new CategoriesCache({ categoriesCache.selectize(jQuery('[data-selectize=categories]'), { filter: function(categories, options) { if (categories.length > 0) { - jQuery("#albumSelection").show(); + jQuery("#albumSelection, .selectFiles, .showFieldset").show(); options.default = categories[0].id; } @@ -42,70 +42,10 @@ var pwg_token = '{$pwg_token}'; var buttonText = "{'Select files'|@translate}"; var sizeLimit = Math.round({$upload_max_filesize} / 1024); /* in KBytes */ +var noAlbum_message = "{'Select an album'|translate}"; + {literal} jQuery(document).ready(function(){ - function checkUploadStart() { - var nbErrors = 0; - jQuery("#formErrors").hide(); - jQuery("#formErrors li").hide(); - - if (jQuery("select[name=category]").val() == '') { - jQuery("#formErrors #noAlbum").show(); - nbErrors++; - } - - var nbFiles = 0; - if (jQuery("#uploadBoxes").size() == 1) { - jQuery("input[name^=image_upload]").each(function() { - if (jQuery(this).val() != "") { - nbFiles++; - } - }); - } - else { - nbFiles = jQuery(".uploadifyQueueItem").size(); - } - - if (nbFiles == 0) { - jQuery("#formErrors #noPhoto").show(); - nbErrors++; - } - - if (nbErrors != 0) { - jQuery("#formErrors").show(); - return false; - } - else { - return true; - } - - } - - function humanReadableFileSize(bytes) { - var byteSize = Math.round(bytes / 1024 * 100) * .01; - var suffix = 'KB'; - - if (byteSize > 1000) { - byteSize = Math.round(byteSize *.001 * 100) * .01; - suffix = 'MB'; - } - - var sizeParts = byteSize.toString().split('.'); - if (sizeParts.length > 1) { - byteSize = sizeParts[0] + '.' + sizeParts[1].substr(0,2); - } - else { - byteSize = sizeParts[0]; - } - - return byteSize+suffix; - } - - jQuery("#hideErrors").click(function() { - jQuery("#formErrors").hide(); - return false; - }); - jQuery("#uploadWarningsSummary a.showInfo").click(function() { jQuery("#uploadWarningsSummary").hide(); jQuery("#uploadWarnings").show(); @@ -176,10 +116,12 @@ jQuery(document).ready(function(){ jQuery("#uploadedPhotos").parent("fieldset").show(); html = ''; - html += ''; + html += ''; html += ' '; jQuery("#uploadedPhotos").prepend(html); + + up.removeFile(file); } } }); @@ -194,6 +136,14 @@ jQuery(document).ready(function(){
+{* +
+
    +
  • %d photos added..
  • +
+
+*} + {if count($setup_errors) > 0}
    @@ -231,16 +181,7 @@ jQuery(document).ready(function(){

    {'Add another set of photos'|@translate}

    {else} - - - -
    + {if $upload_mode eq 'multiple'} {/if} @@ -255,7 +196,7 @@ jQuery(document).ready(function(){ {'create a new album'|@translate} -

    {'Manage Permissions'|@translate}

    + -
    + diff --git a/admin/themes/default/theme.css b/admin/themes/default/theme.css index 88928807f..65d26f6a2 100644 --- a/admin/themes/default/theme.css +++ b/admin/themes/default/theme.css @@ -983,6 +983,11 @@ LEGEND { #order_filters .order_by_is_custom {display:block;font-weight:normal;font-style:italic;margin-left:20px;} /* Upload Form */ +.plupload_header {display:none;} +#uploadForm .plupload_container {padding:0} +#uploadForm .plupload_scroll .plupload_filelist {height:250px;} +#uploadForm li.plupload_droptext {line-height:230px;font-size:2em;} + #uploadBoxes .file {margin-bottom:5px;text-align:left;} #uploadBoxes {margin-top:20px;} #addUploadBox {margin-bottom:2em;} -- cgit v1.2.3