Skip to content

Commit

Permalink
added message about particularly large images
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Cranwell committed Jul 18, 2014
1 parent e9ce324 commit 055233b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ kbd{
/* Help text formatters */

.help-block{
display:inline-block;
float:left;
padding:1em;
margin:1em 0;
clear:both;

p{
margin-top:0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ $(function() {
var $result = $this.find('#result-url');
var $loadingMask = $this.find('.loading-mask')
var $preview = $this.find('img.preview');
var $sizeNote = $('#note-size')

var generatorUrl = $this.data('generatorUrl');

Expand All @@ -35,6 +36,13 @@ $(function() {
filterSpec += '-' + $widthField.val() + 'x' + $heightField.val();
}

// Display note about scaled down images if image is large
if($widthField.val() > $(window).width()){
$sizeNote.show();
}else{
$sizeNote.hide();
}

// Fields with width and height
$.getJSON(generatorUrl.replace('__filterspec__', filterSpec))
.done(function(data) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ <h2 class="icon icon-link">{% trans "URL" %}</h2>
<textarea id="result-url" rows="1"></textarea>

<h2 class="icon icon-view">{% trans "Preview" %}</h2>
<div class="loading-mask inline-block">
<img class="preview" src="" alt="Preview" />
<div>
<div class="loading-mask inline-block">
<img class="preview" src="" alt="Preview" />
</div>
</div>
<p class="help-block help-info">{% trans "Note that images generated larger than the screen will appear smaller when previewed here, so they fit the screen." %}</p>
<p id="note-size" class="help-block help-warning">{% trans "Note that images generated larger than the screen will appear smaller when previewed here, so they fit the screen." %}</p>
</div>
{% endblock %}

Expand Down

0 comments on commit 055233b

Please sign in to comment.