https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292013-09-18T13:51:37ZRedmineRedmine - Feature #14936: Use a stable and modifiable data structure for jsToolbar elementshttps://www.redmine.org/issues/14936?journal_id=518762013-09-18T13:51:37ZFelix Schäfer
<ul></ul><p>(Note: this is related to <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Code highlighting toolbar button (Closed)" href="https://www.redmine.org/issues/14937">#14937</a> but the button submitted in <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Code highlighting toolbar button (Closed)" href="https://www.redmine.org/issues/14937">#14937</a> is not the only use-case we have for this, so fixing <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Code highlighting toolbar button (Closed)" href="https://www.redmine.org/issues/14937">#14937</a> doesn't fix this)</p> Redmine - Feature #14936: Use a stable and modifiable data structure for jsToolbar elementshttps://www.redmine.org/issues/14936?journal_id=521162013-09-29T07:52:00ZToshi MARUYAMA
<ul><li><strong>Related to</strong> <i><a class="issue tracker-2 status-5 priority-4 priority-default closed" href="/issues/14937">Feature #14937</a>: Code highlighting toolbar button</i> added</li></ul> Redmine - Feature #14936: Use a stable and modifiable data structure for jsToolbar elementshttps://www.redmine.org/issues/14936?journal_id=528342013-10-27T03:47:13ZMischa The Evil
<ul></ul><p>Felix Schäfer wrote:</p>
<blockquote>
<p>[...] but find it lacking in that we cannot add a button at a specific position in the toolbar without adding it to core js files [...]</p>
</blockquote>
<p>I agree on that.</p>
<blockquote>
<p>[...] switching the aforementioned <code>jsToolBar.prototype.elements</code> to a data structure with a guaranteed ordering and the ability to add elements at a specified absolute ("at position X") or relative ("after button X") place?</p>
</blockquote>
<p>To me this sounds like a good idea. This will give plugin developers (thinking about custom macros, custom syntax, etc.; like the often used WikiNG plugin) the control they need.</p> Redmine - Feature #14936: Use a stable and modifiable data structure for jsToolbar elementshttps://www.redmine.org/issues/14936?journal_id=528362013-10-27T13:38:50ZYukinari TOYOTA
<ul></ul><p>I have an experience of similar problem.<br />In that case, I want to add a special image button after the original image button.<br />I solved this problem by modifying/replacing `jsToolBar.prototype.elements` at runtime.<br />However, it is not straightforward so new API is welcome.</p>
<p>see: <a class="external" href="https://github.com/t-yuki/clipboard_image_paste/commit/122a9134165ecc3c6a056fdab788efd2d95bfbb3">https://github.com/t-yuki/clipboard_image_paste/commit/122a9134165ecc3c6a056fdab788efd2d95bfbb3</a></p>