Needs review
Project:
Image Caption
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
15 Feb 2013 at 21:53 UTC
Updated:
6 Dec 2016 at 16:32 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Amy Brown commentedReplaced both spans (and their now unnecessary inline styles) with figure and figcaption HTML5 elements. Also reminified JS.
Figure/figcaption W3C: http://www.w3.org/html/wg/drafts/html/master/grouping-content.html#the-f...
Comment #2
themusician commentedThe patch looks good to me. It replaces the spans with figures and figcaptions which Amy Brown points out is more of a valid approach with the adoption of HTML5.
For those testing the patch, one you apply it, do not forget to clear the cache on your site.
Does the patch need to be rerolled without the minified JS?
Comment #3
themusician commentedHere is an updated patch that applies the styles users set in their WYSIWYG to the figure element. The original patch was missing that piece.
For example, if a user chose to float an image to the left, the original patch would insert that style in the class attribute area of the element. This now inserts it into the style attribute.
Comment #4
themusician commentedThere were a few white space errors on the previous patch. This one is good to go.
Comment #5
themusician commentedMy goodness. I was accidentally creating a patch against the non-existent master branch creating odd patch files. Sorry for cluttering up the queue.
Comment #6
Amy Brown commentedtheMusician's final patch seems to do the trick. Figures will float according to how to image floats/if the user assigns it a float in WYSIWYG.
Comment #7
themusician commentedThis version of the patch is compatible with http://drupal.org/node/1188622.
To use figures please apply the current patch in the issue above and then apply this version.
Comment #8
mgiffordI'm in favour of this.
http://html5doctor.com/the-figure-figcaption-elements/
What needs to happen to mark this RTBC with this module?
Needs backward compatibility for IE?
Comment #9
themusician commentedThere hasn't been a release for this module in over two years. I still use on projects as it generally works well. I am not sure if the maintainers monitor this queue anymore. As far as IE compatibility, that would likely be a good piece to add in. Personally, I use variants of HTML shiv to provide the backwards compatibility.
To test the patch, please apply the patch in this issue, http://drupal.org/node/1188622 first and then the patch that is found here.
Comment #10
mgiffordI just updated #2098561: Stable release of Image Caption. Thanks @theMusician for the tip about the other patch.
Comment #11
davidwhthomas commentedWorth noting, though busy with other projects. I do monitor the issue queue here.
This plugin hasn't been updated for a while as it's had no significant bugs and has been in a stable working state.
Regarding the figcaption patch, it's nice if you want to use that method, however we would need an alternative mode for people using browsers that don't support figcaption ( e.g IE 7 & 8 )
regards,
David
Comment #12
themusician commentedThe alternative method being baked into the module does certainly present a challenge.
It seems redundant to include a polyfill solution just for the case of figures and figcaptions. I am curious how many themes ship without a polyfill solution or whether hand coded themes are built without a solution in place.
Thanks for the feedback.
Comment #13
jpamental commentedIt would be great to build a switch into the module so you could use either the current (older) method or the one proposed here (which ironically is the same update that I made on my own several years ago). I don't quite have the chops for it but will see if I can work it out. Seems like it could be an added preference that would call one version of the JS or the other.
Comment #14
jpamental commentedI'm attaching a slightly modified patch. I saw that @theMusician's patch in #7 was almost exactly what I had done, except I needed to get the image wrapped in the figure tag no matter what, and the module by default will only rewrap the image if there actually is a caption. This patch removes the conditional check and will always wrap an image in a figure tag even if there is no caption. I realize this is not for everyone but felt it was a common enough that it was worth posting for others to find.
Comment #15
jpamental commentedThis is a slight update to the patch that eliminates any inline styles from being added to the 'figure' element. Again - maybe not for everyone, but it's getting me nice clean markup and then the added style gives me just what I need for theming.
Comment #16
mgiffordPatch doesn't apply to the beta3 release.
Comment #17
mgiffordJust saw how out of date the release is. It still does apply to the dev version.