Hi guys,

While working with the module, editing content pages and adding Collapse Text's markup, I came accross a minor additional requirement.
I found that currently the Collapse Text Wysiwyg module only allows adding markup for text that would be collapsed by default:
[collapsed ... ]example[/collapsed].
See plugin.js, line 51 and 52, at 4a2be64:

var openTag = '[collapsed title="' + title + '"' + ((classes!="") ? ' class="' + classes + '"' : "" ) + ']';
var closeTag = '[/collapsed]';

Therefore, I thought a small but useful improvement would be to add a single checkbox to the dialog form to enable users to select whether the markup inserted should be collapsed or expanded by default/initially.

So by default, the checkbox would be unchecked and if it was checked the markup to be inserted would be:
[collapse ... ]example[/collapse] (expanded when the page first loads).
[Watch the difference between collapsed and collapse, just a d at the end]

I would greatly appreciate to have any questions, feedbacks, comments, issues, recommendations, concerns or suggestions on any aspects of this feature request.

Feel free to let me know if you would have any questions, I would surely be glad to provide more information or explain in further details.
Thanks very much to all in advance.

Comments

dydave’s picture

Quick follow up on this feature request.

This feature has been committed at 9d3ed92, as an attempt to provide an initial support for the feature described in the issue summary.
[Followed by a minor commit at c488046 to fix a wrong indent at the start of line]

Added a new checkbox called 'state', labelled Initially expanded (not collapsed), unchecked by default (to try to keep current behavior).
See plugin.js, line 40, 41 and 42, at 9d3ed92:

  type : 'checkbox',
  id : 'state',
  label : 'Initially expanded (not collapsed)'

 
Replaced previously hardcoded collapsed with JS variable called state to insert collapse or collapsed markup.
See plugin.js, line 55, 56 and 57, at 9d3ed92:

  var state = !dialog.getValueOf( 'tab1', 'state' ) ? 'collapsed' : 'collapse';
  var openTag = '[' + state + ' title="' + title + '"' + ((classes!="") ? ' class="' + classes + '"' : "" ) + ']';
  var closeTag = '[/' + state + ']';

Minor cleanup of console.log(S); debug traces.

Lastly, please find attached to this comment a screenshot that should provide a more visual illustration of this feature:
collapse_text_wysiwyg-select-state-collapsible-markup-insert-2000814-1.jpg.

I allowed myself to mark this issue as fixed for now, but feel free to re-open it, or post a new ticket, at any time if you have any further objections with the solution suggested and committed at 429b3e3 and c488046 (we would surely be happy to hear your feedback).

Please let me know if you would have any further comments, feedback, questions, issues, objections, suggestions or concerns on any of the latest commits or this ticket in general, I would be glad to provide more information or explain in more details.

Thanks in advance to everyone for your testing, reviews, reporting and feedbacks for this new feature.
Cheers!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.