Skip to content

Commit

Permalink
restore tinymce option to control image captioning
Browse files Browse the repository at this point in the history
  • Loading branch information
davisagli committed Sep 30, 2016
1 parent 86805df commit d3d11d0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mockup/patterns/tinymce/js/links.js
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ define([
titleText: self.options.text.title,
externalImageText: self.options.text.externalImage,
altText: self.options.text.alt,
captionText: self.options.text.caption,
imageAlignText: self.options.text.imageAlign,
scaleText: self.options.text.scale,
scales: self.options.scales,
Expand All @@ -393,6 +394,7 @@ define([
self.$alt = $('input[name="alt"]', self.modal.$modal);
self.$align = $('select[name="align"]', self.modal.$modal);
self.$scale = $('select[name="scale"]', self.modal.$modal);
self.$caption = $('input[name="caption"]', self.modal.$modal);

/* load up all the link types */
_.each(self.options.linkTypes, function(type) {
Expand Down Expand Up @@ -470,6 +472,7 @@ define([
} else {
self.dom.setAttribs(self.imgElm, data);
}
$(self.imgElm).toggleClass('captioned', self.$caption.prop('checked'));

waitLoad(self.imgElm);
if (self.imgElm.complete) {
Expand Down Expand Up @@ -549,6 +552,7 @@ define([
if (self.imgElm) {
var src = self.dom.getAttrib(self.imgElm, 'src');
self.$alt.val(self.dom.getAttrib(self.imgElm, 'alt'));
self.$caption.prop('checked', $(self.imgElm).hasClass('captioned'));
linkType = self.dom.getAttrib(self.imgElm, 'data-linktype');
if (linkType) {
self.linkType = linkType;
Expand Down
1 change: 1 addition & 0 deletions mockup/patterns/tinymce/pattern.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ define([
imageAlign: _t('Align'),
scale: _t('Size'),
alt: _t('Alternative Text'),
caption: _t('Show Caption'),
externalImage: _t('External Image URI')
},
// URL generation options
Expand Down
6 changes: 6 additions & 0 deletions mockup/patterns/tinymce/templates/image.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@
<label><%- altText %></label>
<input type="text" name="alt" />
</div>
<div class="form-group caption">
<label>
<input type="checkbox" name="caption" />
<%- captionText %>
</label>
</div>
<div class="form-group align">
<label><%- imageAlignText %></label>
<select name="align">
Expand Down

0 comments on commit d3d11d0

Please sign in to comment.