Ignore:
Timestamp:
Aug 18, 2011, 5:19:03 PM (13 years ago)
Author:
plg
Message:

feature 2407 added: display upload limitations before file selection (file
maximum size, maximum dimensions, allowed file types). The maximum dimensions
are calculated for GD only (because Imagick and External ImageMagick are not
using PHP memory as far as I could find on the web).

bug 2408 fixed: change term "old style form" into "browser uploader" and
"multiple file form" into "Flash Uploader" (based on WordPress user interface)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/themes/default/template/photos_add_direct.tpl

    r11962 r11966  
    143143  });
    144144
     145  jQuery("#uploadWarningsSummary a.showInfo").click(function() {
     146    jQuery("#uploadWarningsSummary").hide();
     147    jQuery("#uploadWarnings").show();
     148  });
     149
    145150{/literal}
    146151{if $upload_mode eq 'html'}
     
    187192    'fileExt'        : '*.jpg;*.JPG;*.jpeg;*.JPEG;*.png;*.PNG',
    188193    'sizeLimit'      : sizeLimit,
     194    'onSelect'       : function(event,ID,fileObj) {
     195      jQuery("#fileQueue").show();
     196    },
    189197    'onAllComplete'  : function(event, data) {
    190198      if (data.errors) {
     
    338346  <p id="batchLink"><a href="{$batch_link}">{$batch_label}</a></p>
    339347</fieldset>
    340 <p><a href="{$another_upload_link}">{'Add another set of photos'|@translate}</a></p>
     348<p style="margin:10px"><a href="{$another_upload_link}">{'Add another set of photos'|@translate}</a></p>
    341349{else}
    342350
     
    389397      <legend>{'Select files'|@translate}</legend>
    390398
     399    <p id="uploadWarningsSummary">{$upload_max_filesize_shorthand}B. {$upload_file_types}. {if isset($max_upload_resolution)}{$max_upload_resolution}Mpx{/if} <a class="showInfo" title="{'Learn more'|@translate}">i</a></p>
     400
     401    <p id="uploadWarnings">
     402{'Maximum file size: %sB.'|@translate|@sprintf:$upload_max_filesize_shorthand}
     403{'Allowed file types: %s.'|@translate|@sprintf:$upload_file_types}
     404  {if isset($max_upload_resolution)}
     405{'Approximate maximum resolution: %dM pixels (that\'s %dx%d pixels).'|@translate|@sprintf:$max_upload_resolution:$max_upload_width:$max_upload_height}
     406  {/if}
     407    </p>
     408
    391409{if $upload_mode eq 'html'}
    392     <p><a href="{$switch_url}">{'... or switch to the multiple files form'|@translate}</a></p>
    393 
    394       <p>{'JPEG files or ZIP archives with JPEG files inside please.'|@translate}</p>
    395 
    396410      <div id="uploadBoxes"></div>
    397411      <div id="addUploadBox">
    398412        <a href="javascript:">{'+ Add an upload box'|@translate}</a>
    399413      </div>
     414
     415    <p id="uploadModeInfos">{'You are using the Browser uploader. Try the <a href="%s">Flash uploader</a> instead.'|@translate|@sprintf:$switch_url}</p>
    400416   
    401417    </fieldset>
    402418
    403419    <p>
    404       <input class="submit" type="submit" name="submit_upload" value="{'Upload'|@translate}">
     420      <input class="submit" type="submit" name="submit_upload" value="{'Start Upload'|@translate}">
    405421    </p>
    406422{elseif $upload_mode eq 'multiple'}
     423
    407424    <p>
    408425      <input type="file" name="uploadify" id="uploadify">
    409426    </p>
    410427
    411     <p><a href="{$switch_url}">{'... or switch to the old style form'|@translate}</a></p>
    412 
    413     <div id="fileQueue"></div>
     428    <div id="fileQueue" style="display:none"></div>
     429
     430    <p id="uploadModeInfos">{'You are using the Flash uploader. Problems? Try the <a href="%s">Browser uploader</a> instead.'|@translate|@sprintf:$switch_url}</p>
    414431
    415432    </fieldset>
Note: See TracChangeset for help on using the changeset viewer.