diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2013-07-05 17:07:05 +0400 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2013-07-05 19:51:40 +0400 |
commit | 9d2495c63f2cf4c3288631c13c618e87e6abdb68 (patch) | |
tree | 597eea6fe98898acb208e18c24ebde761691b29d /apps | |
parent | ba11ab92c7ad07de66fbca078b03b426e0f4daf3 (diff) |
adding tipsy to the upload button showing the max upload and restoring client side upload size validation
Conflicts:
apps/files_sharing/templates/public.php
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_sharing/js/public.js | 2 | ||||
-rw-r--r-- | apps/files_sharing/templates/public.php | 98 |
2 files changed, 53 insertions, 47 deletions
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js index 0244f392a0e..294223aa094 100644 --- a/apps/files_sharing/js/public.js +++ b/apps/files_sharing/js/public.js @@ -11,6 +11,8 @@ var form_data; $(document).ready(function() { + $('#data-upload-form').tipsy({gravity:'ne', fade:true}); + if (typeof FileActions !== 'undefined') { var mimetype = $('#mimetype').val(); // Show file preview if previewer is available, images are already handled by the template diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php index c2c0f259cfb..ef5ad424fb6 100644 --- a/apps/files_sharing/templates/public.php +++ b/apps/files_sharing/templates/public.php @@ -1,5 +1,5 @@ <div id="notification-container"> - <div id="notification" style="display: none;"></div> + <div id="notification" style="display: none;"></div> </div> <?php $defaults = new OCP\Defaults(); // initialize themable default strings and urls ?> @@ -9,59 +9,63 @@ <input type="hidden" name="filename" value="<?php p($_['filename']) ?>" id="filename"> <input type="hidden" name="mimetype" value="<?php p($_['mimetype']) ?>" id="mimetype"> <header><div id="header"> - <a href="<?php print_unescaped(link_to('', 'index.php')); ?>" title="" id="owncloud"><img class="svg" - src="<?php print_unescaped(image_path('', 'logo-wide.svg')); ?>" alt="ownCloud" /></a> - <div id="logo-claim" style="display:none;"><?php p($defaults->getLogoClaim()); ?></div> - <div class="header-right"> - <?php if (isset($_['folder'])): ?> - <span id="details"><?php p($l->t('%s shared the folder %s with you', - array($_['displayName'], $_['fileTarget']))) ?></span> - <?php else: ?> - <span id="details"><?php p($l->t('%s shared the file %s with you', - array($_['displayName'], $_['fileTarget']))) ?></span> - <?php endif; ?> - - - <?php if (!isset($_['folder']) || $_['allowZipDownload']): ?> - <a href="<?php p($_['downloadURL']); ?>" class="button" id="download"><img - class="svg" alt="Download" src="<?php print_unescaped(OCP\image_path("core", "actions/download.svg")); ?>" - /><span><?php p($l->t('Download'))?></span></a> - <?php endif; ?> - - <?php if ($_['allowPublicUploadEnabled']):?> - - - <input type="hidden" id="publicUploadRequestToken" name="requesttoken" value="<?php p($_['requesttoken']) ?>" /> - <input type="hidden" id="dirToken" name="dirToken" value="<?php p($_['dirToken']) ?>" /> - <input type="hidden" id="uploadMaxFilesize" name="uploadMaxFilesize" value="<?php p($_['uploadMaxFilesize']) ?>" /> - <input type="hidden" id="uploadMaxHumanFilesize" name="uploadMaxHumanFilesize" value="<?php p($_['uploadMaxHumanFilesize']) ?>" /> - <input type="hidden" id="directory_path" name="directory_path" value="<?php p($_['directory_path']) ?>" /> - - - <div id="data-upload-form" class="button"> - <input id="file_upload_start" type="file" name="files[]" data-url="<?php print_unescaped(OCP\Util::linkTo('files', 'ajax/upload.php')); ?>" multiple> - <a href="#" id="publicUploadButtonMock" class="svg"> - <span><?php p($l->t('Upload'))?></span> - </a> - </div> + <a href="<?php print_unescaped(link_to('', 'index.php')); ?>" title="" id="owncloud"><img class="svg" + src="<?php print_unescaped(image_path('', 'logo-wide.svg')); ?>" alt="ownCloud" /></a> + <div id="logo-claim" style="display:none;"><?php p($defaults->getLogoClaim()); ?></div> + <div class="header-right"> + <?php if (isset($_['folder'])): ?> + <span id="details"><?php p($l->t('%s shared the folder %s with you', + array($_['displayName'], $_['fileTarget']))) ?></span> + <?php else: ?> + <span id="details"><?php p($l->t('%s shared the file %s with you', + array($_['displayName'], $_['fileTarget']))) ?></span> + <?php endif; ?> + + + <?php if (!isset($_['folder']) || $_['allowZipDownload']): ?> + <a href="<?php p($_['downloadURL']); ?>" class="button" id="download"><img + class="svg" alt="Download" src="<?php print_unescaped(OCP\image_path("core", "actions/download.svg")); ?>" + /><span><?php p($l->t('Download'))?></span></a> + <?php endif; ?> + + <?php if ($_['allowPublicUploadEnabled']):?> + + + <input type="hidden" id="publicUploadRequestToken" name="requesttoken" value="<?php p($_['requesttoken']) ?>" /> + <input type="hidden" id="dirToken" name="dirToken" value="<?php p($_['dirToken']) ?>" /> + <input type="hidden" id="uploadMaxFilesize" name="uploadMaxFilesize" value="<?php p($_['uploadMaxFilesize']) ?>" /> + <input type="hidden" id="uploadMaxHumanFilesize" name="uploadMaxHumanFilesize" value="<?php p($_['uploadMaxHumanFilesize']) ?>" /> + <input type="hidden" id="directory_path" name="directory_path" value="<?php p($_['directory_path']) ?>" /> + <?php if($_['uploadMaxFilesize'] >= 0):?> + <input type="hidden" name="MAX_FILE_SIZE" id="max_upload" + value="<?php p($_['uploadMaxFilesize']) ?>"> + <?php endif;?> + + + <div id="data-upload-form" class="button" title="<?php p($l->t('Upload') . ' max. '.$_['uploadMaxHumanFilesize']) ?>"> + <input id="file_upload_start" type="file" name="files[]" data-url="<?php print_unescaped(OCP\Util::linkTo('files', 'ajax/upload.php')); ?>" multiple> + <a href="#" id="publicUploadButtonMock" class="svg"> + <span><?php p($l->t('Upload'))?></span> + </a> + </div> - </div> + </div> - <div id="additional_controls" style="display:none"> - <div id="uploadprogresswrapper"> - <div id="uploadprogressbar"></div> - <input id="cancel_upload_button" type="button" class="stop" style="display:none" - value="<?php p($l->t('Cancel upload'));?>" - /> - </div> + <div id="additional_controls" style="display:none"> + <div id="uploadprogresswrapper"> + <div id="uploadprogressbar"></div> + <input id="cancel_upload_button" type="button" class="stop" style="display:none" + value="<?php p($l->t('Cancel upload'));?>" + /> + </div> - <?php endif; ?> + <?php endif; ?> - </div> -</div></header> + </div> + </div></header> <div id="content"> <div id="preview"> <?php if (isset($_['folder'])): ?> |