From 591ba7e335b867033dfb897eb23e25c8f8e60f34 Mon Sep 17 00:00:00 2001 From: Jared Hancock <jared@osticket.com> Date: Sat, 30 Aug 2014 13:44:06 -0500 Subject: [PATCH] oops: Fixup a few issues for file upload field --- css/filedrop.css | 2 +- include/class.forms.php | 5 +++-- include/staff/ticket-view.inc.php | 11 +++-------- js/filedrop.field.js | 12 +++++++----- scp/css/scp.css | 22 +++++++++++++++++++--- scp/js/scp.js | 15 ++++++--------- 6 files changed, 39 insertions(+), 28 deletions(-) diff --git a/css/filedrop.css b/css/filedrop.css index d6b42fa25..fc2b96d91 100644 --- a/css/filedrop.css +++ b/css/filedrop.css @@ -58,7 +58,7 @@ .redactor_box + .filedrop .dropzone, .redactor_box + div > .filedrop .dropzone, .redactor_box + div > .filedrop .files { - border-top-width: 0; + border-top-width: 1px; border-top-left-radius: 0; border-top-right-radius: 0; } diff --git a/include/class.forms.php b/include/class.forms.php index 3b1cc51b0..4de84b36a 100644 --- a/include/class.forms.php +++ b/include/class.forms.php @@ -1411,8 +1411,9 @@ class FileUploadField extends FormField { foreach ($config['mimetypes'] as $type=>$desc) { foreach ($_types[$type]['types'] as $mime=>$exts) { $mimetypes[$mime] = true; - foreach ($exts as $ext) - $extensions['.'.$ext] = true; + if (is_array($exts)) + foreach ($exts as $ext) + $extensions['.'.$ext] = true; } } } diff --git a/include/staff/ticket-view.inc.php b/include/staff/ticket-view.inc.php index bfdf3deb9..addb9aa3b 100644 --- a/include/staff/ticket-view.inc.php +++ b/include/staff/ticket-view.inc.php @@ -673,23 +673,18 @@ print $response_form->getField('attachments')->render(); <span class="error"> <?php echo $errors['title']; ?></span> </div> <br/> + <div class="error"><?php echo $errors['note']; ?></div> <textarea name="note" id="internal_note" cols="80" placeholder="<?php echo __('Note details'); ?>" rows="9" wrap="soft" data-draft-namespace="ticket.note" data-draft-object-id="<?php echo $ticket->getId(); ?>" class="richtext ifhtml draft draft-delete"><?php echo $info['note']; ?></textarea> - <span class="error"><?php echo $errors['note']; ?></span> - </td> - </tr> - <tr> - <td width="120"> - <label for="attachment"><?php echo __('Attachments');?>:</label> - </td> - <td class="attachments"> + <div class="attachments"> <?php print $note_form->getField('attachments')->render(); ?> + </div> </td> </tr> <tr><td colspan="2"> </td></tr> diff --git a/js/filedrop.field.js b/js/filedrop.field.js index 3bea172b3..6427d0d4a 100644 --- a/js/filedrop.field.js +++ b/js/filedrop.field.js @@ -72,12 +72,10 @@ progressUpdated: function(i, file, value) { this.uploads.some(function(e) { if (e.data('file') == file) { - e.find('.progress').show(); e.find('.progress-bar') - .width(value + '%') .attr({'aria-valuenow': value}) - .removeClass('progress-bar-striped active'); - if (value > 99) + .width(value + '%'); + if (value == 100) e.find('.progress-bar').addClass('progress-bar-striped active'); return true; } @@ -89,8 +87,12 @@ if (e.data('file') == file) { e.data('xhr', xhr); e.find('.cancel').show(); - that.progressUpdated(i, file, 0); that.lockSubmit(1); + that.progressUpdated(i, file, 0); + setTimeout(function() { + e.find('.progress-bar') + .removeClass('progress-bar-striped active'); + }, 50); return true; } }); diff --git a/scp/css/scp.css b/scp/css/scp.css index 30c7dcb42..40f3bd8ee 100644 --- a/scp/css/scp.css +++ b/scp/css/scp.css @@ -1657,15 +1657,31 @@ div.patch { } div.selected-signature { - border-top: 1px dotted #aaa; + border: 1px solid #ddd; + border: 1px solid rgba(0,0,0,0.1); + border-top-style: dotted; padding: 0.3em 10px 5px; - background-color: #f9f9f9; + background: repeating-linear-gradient( + -45deg, + transparent, + transparent 10px, + rgba(255, 255, 255, 0.6) 10px, + rgba(255, 255, 255, 0.6) 20px), + #f9f9f9; height: 2.5em; overflow-y: hidden; - box-shadow: inset 0px -5px 5px -5px rgba(206, 199, 182, 1.0); font-size: 15px; line-height: 1.25rem; } +div.selected-signature::after { + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + content: ''; + box-shadow: rgba(0, 0, 0, 0.2) 0px -15px 15px -19px inset; +} div.selected-signature .inner { opacity: 0.5; } diff --git a/scp/js/scp.js b/scp/js/scp.js index e6e36147e..aa446f00a 100644 --- a/scp/js/scp.js +++ b/scp/js/scp.js @@ -526,7 +526,7 @@ $.toggleOverlay = function (show) { return $.toggleOverlay(!$('#overlay').is(':visible')); } if (show) { - $('#overlay').show().fadeIn(); + $('#overlay').fadeIn(); $('body').css('overflow', 'hidden'); } else { @@ -688,6 +688,9 @@ $(document).on('pjax:start', function() { // Cancel save-changes warning banner $(document).unbind('pjax:beforeSend.changed'); $(window).unbind('beforeunload'); + // Close popups + $('.dialog .body').empty().parent().hide(); + // Close tooltips $('.tip_box').remove(); }); @@ -705,19 +708,13 @@ $(document).on('pjax:send', function(event) { $('#overlay').css('background-color','white').fadeIn(); }); -$(document).on('pjax:beforeReplace', function() { - // Close popups - // Close tooltips - $('.tip_box').remove(); - $('.dialog .body').empty().parent().hide(); -}); - $(document).on('pjax:complete', function() { // right $("#loadingbar").width("101%").delay(200).fadeOut(400, function() { $(this).remove(); }); - $('#overlay').fadeOut(100).removeAttr('style'); + $.toggleOverlay(false); + $('#overlay').removeAttr('style'); }); // Quick note interface -- GitLab