Changeset 28552


Ignore:
Timestamp:
May 28, 2014, 11:33:17 AM (10 years ago)
Author:
plg
Message:

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
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/themes/default/js/addAlbum.js

    r28540 r28552  
    8484
    8585          albumParent.val('');
    86           jQuery('#albumSelection').show();
     86          jQuery('#albumSelection, .selectFiles, .showFieldset').show();
    8787        },
    8888        error: function(XMLHttpRequest, textStatus, errorThrows) {
  • trunk/admin/themes/default/template/photos_add_direct.tpl

    r28545 r28552  
    2626  filter: function(categories, options) {
    2727    if (categories.length > 0) {
    28       jQuery("#albumSelection").show();
     28      jQuery("#albumSelection, .selectFiles, .showFieldset").show();
    2929      options.default = categories[0].id;
    3030    }
     
    4343var sizeLimit = Math.round({$upload_max_filesize} / 1024); /* in KBytes */
    4444
     45var noAlbum_message = "{'Select an album'|translate}";
     46
    4547{literal}
    4648jQuery(document).ready(function(){
    47   function checkUploadStart() {
    48     var nbErrors = 0;
    49     jQuery("#formErrors").hide();
    50     jQuery("#formErrors li").hide();
    51 
    52     if (jQuery("select[name=category]").val() == '') {
    53       jQuery("#formErrors #noAlbum").show();
    54       nbErrors++;
    55     }
    56 
    57     var nbFiles = 0;
    58     if (jQuery("#uploadBoxes").size() == 1) {
    59       jQuery("input[name^=image_upload]").each(function() {
    60         if (jQuery(this).val() != "") {
    61           nbFiles++;
    62         }
    63       });
    64     }
    65     else {
    66       nbFiles = jQuery(".uploadifyQueueItem").size();
    67     }
    68 
    69     if (nbFiles == 0) {
    70       jQuery("#formErrors #noPhoto").show();
    71       nbErrors++;
    72     }
    73 
    74     if (nbErrors != 0) {
    75       jQuery("#formErrors").show();
    76       return false;
    77     }
    78     else {
    79       return true;
    80     }
    81 
    82   }
    83 
    84   function humanReadableFileSize(bytes) {
    85     var byteSize = Math.round(bytes / 1024 * 100) * .01;
    86     var suffix = 'KB';
    87 
    88     if (byteSize > 1000) {
    89       byteSize = Math.round(byteSize *.001 * 100) * .01;
    90       suffix = 'MB';
    91     }
    92 
    93     var sizeParts = byteSize.toString().split('.');
    94     if (sizeParts.length > 1) {
    95       byteSize = sizeParts[0] + '.' + sizeParts[1].substr(0,2);
    96     }
    97     else {
    98       byteSize = sizeParts[0];
    99     }
    100 
    101     return byteSize+suffix;
    102   }
    103 
    104   jQuery("#hideErrors").click(function() {
    105     jQuery("#formErrors").hide();
    106     return false;
    107   });
    108 
    10949  jQuery("#uploadWarningsSummary a.showInfo").click(function() {
    11050    jQuery("#uploadWarningsSummary").hide();
     
    177117     
    178118        html = '<a href="admin.php?page=photo-'+data.result.image_id+'" target="_blank">';
    179         html += '<img src="'+data.result.src+'" class="thumbnail">';
     119        html += '<img src="'+data.result.src+'" class="thumbnail" title="'+data.result.name+'">';
    180120        html += '</a> ';
    181121     
    182122        jQuery("#uploadedPhotos").prepend(html);
     123
     124        up.removeFile(file);
    183125      }
    184126    }
     
    194136
    195137<div id="photosAddContent">
     138
     139{*
     140<div class="infos">
     141  <ul>
     142    <li>%d photos added..</li>
     143  </ul>
     144</div>
     145*}
    196146
    197147{if count($setup_errors) > 0}
     
    232182{else}
    233183
    234 <div id="formErrors" class="errors" style="display:none">
    235   <ul>
    236     <li id="noAlbum">{'Select an album'|@translate}</li>
    237     <li id="noPhoto">{'Select at least one photo'|@translate}</li>
    238   </ul>
    239   <div class="hideButton" style="text-align:center"><a href="#" id="hideErrors">{'Hide'|@translate}</a></div>
    240 </div>
    241 
    242 
    243 <form id="uploadForm" enctype="multipart/form-data" method="post" action="{$form_action}" class="properties">
     184<form id="uploadForm" enctype="multipart/form-data" method="post" action="{$form_action}">
    244185{if $upload_mode eq 'multiple'}
    245186    <input name="upload_id" value="{$upload_id}" type="hidden">
     
    256197    </fieldset>
    257198
    258     <p class="showFieldset"><a id="showPermissions" href="#">{'Manage Permissions'|@translate}</a></p>
     199    <p class="showFieldset" style="display:none"><a id="showPermissions" href="#">{'Manage Permissions'|@translate}</a></p>
    259200
    260201    <fieldset id="permissions" style="display:none">
     
    266207    </fieldset>
    267208
    268     <fieldset>
     209    <fieldset class="selectFiles" style="display:none">
    269210      <legend>{'Select files'|@translate}</legend>
    270211 
     
    283224
    284225        <div id="uploader">
    285                 <p>Your browser doesn't have Flash, Silverlight or HTML5 support.</p>
     226                <p>Your browser doesn't have HTML5 support.</p>
    286227        </div>
    287228
  • trunk/admin/themes/default/theme.css

    r28545 r28552  
    984984
    985985/* Upload Form */
     986.plupload_header {display:none;}
     987#uploadForm .plupload_container {padding:0}
     988#uploadForm .plupload_scroll .plupload_filelist {height:250px;}
     989#uploadForm li.plupload_droptext {line-height:230px;font-size:2em;}
     990
    986991#uploadBoxes .file {margin-bottom:5px;text-align:left;}
    987992#uploadBoxes {margin-top:20px;}
  • trunk/include/ws_functions/pwg.images.php

    r28545 r28552  
    13031303  $chunks = isset($_REQUEST["chunks"]) ? intval($_REQUEST["chunks"]) : 0;
    13041304
    1305   file_put_contents('/tmp/plupload.log', "[".date('c')."] ".__FUNCTION__.', '.$fileName.' '.($chunk+1).'/'.$chunks."\n", FILE_APPEND);
    1306 
    1307   single_insert(
    1308     'plupload',
    1309     array(
    1310       'received_on' => date('c'),
    1311       'filename' => $fileName,
    1312       'chunk' => $chunk+1,
    1313       'chunks' => $chunks,
    1314       )
    1315     );
    1316 
     1305  // file_put_contents('/tmp/plupload.log', "[".date('c')."] ".__FUNCTION__.', '.$fileName.' '.($chunk+1).'/'.$chunks."\n", FILE_APPEND);
    13171306
    13181307  // Open temp file
     
    13701359SELECT
    13711360    id,
     1361    name,
    13721362    path
    13731363  FROM '.IMAGES_TABLE.'
     
    13791369      'image_id' => $image_id,
    13801370      'src' => DerivativeImage::thumb_url($image_infos),
     1371      'name' => $image_infos['name'],
    13811372      );
    13821373  }
Note: See TracChangeset for help on using the changeset viewer.