Skip to content
This repository has been archived by the owner on Jan 3, 2020. It is now read-only.

Commit

Permalink
Merge pull request #5 from tleish/develop
Browse files Browse the repository at this point in the history
Adding default attributes to thumbnail markup
  • Loading branch information
tleish committed Jan 22, 2016
2 parents 336d16f + d494a23 commit 66f4794
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
Binary file modified assets/images/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 5 additions & 3 deletions assets/javascripts/redmine_jstoolbar_ext_images.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
return $('<button class="full">[' + jsToolBar.strings['Image'] + ']</button>')
.click(function(){
eval(fn);
}).add(build_thumbnail_button({ label: '', beg: '{{thumbnail(', end: ')}}' }));
}).add(build_thumbnail_button({ label: '', beg: '{{thumbnail(', end: ', size=100, title=Thumbnail)}}' }));
};

var img_button_beg = {
Expand All @@ -139,11 +139,13 @@
var img_thumbnail_button_data = function(filename){
var basename = filename.split('/').pop();
var path = ( decodeURIComponent(basename) === basename ) ? basename : filename;
return { label: basename, beg: '{{thumbnail(' + path + ')}}', end: '' };
return { label: basename, beg: '{{thumbnail(' + path + ', size=100, title=' + path, end: ')}}' };
};

var build_button = function (data) {
return $('<button class="full">' + decodeURIComponent(data.label) + '</button>')
var title = data.label.replace(/"/g, '&quot;');
var text = decodeURIComponent(data.label);
return $('<button class="full" title="' + title + '">' + text + '</button>')
.data(data)
.click( image_button_click);
};
Expand Down
2 changes: 1 addition & 1 deletion assets/stylesheets/redmine_jstoolbar_ext_images.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.jstb_img_submenu { width: 301px; }
.jstb_img_submenu button { margin: 0 }
.jstb_img_submenu button.full { width: 250px; }
.jstb_img_submenu button.full { width: 250px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jstb_img_submenu button.thumbnail { width: 51px; font-size: 10px; }
2 changes: 1 addition & 1 deletion init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
name 'Redmine jsToolbar Images Extension'
author 'Thomas Leishman'
description 'The Redmine JS Toolbar Images Extension add additional buttons to the jsToolbar.'
version '0.3.0'
version '0.3.1'
url 'https://github.com/tleish'
author_url 'https://github.com/tleish'
requires_redmine_plugin :redmine_jstoolbar_ext, :version_or_higher => '0.1.0'
Expand Down

0 comments on commit 66f4794

Please sign in to comment.