Created
April 24, 2015 11:09
-
-
Save brunoais/86433b0cbd19abffa76d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($, window, document, undefined) { // Avoid conflicts with other libraries | |
var xslt = xslt('{{xslt}}'); | |
{% for bbcode in BBCODES} | |
$.sceditor.plugins.bbcode.bbcode.set('{{bbcode.name}}', | |
{ | |
tags: { | |
{% for containerTag in bbcode.containerTags} | |
'{{containerTag}}': { | |
'data-tag-id': "{{bbcode.tagId}}" | |
} | |
{% endfor %} | |
}, | |
// TODO: This needs improvement as it might simply not be true | |
isInline: {% for containerTag in bbcode.containerTags} editor.getElementDefaultDisplay('{{containerTag}}') !== 'block' && {% endfor %}true, | |
{% if bbcode.data.autoCloseOn} | |
excludeClosing: true, | |
{% endif %} | |
{% if (not bbcode.data.useContent is empty and | |
(bbcode.data.autoClose is empty or | |
(bbcode.data.ignoreBBCodeInside is empty and bbcode.data.ignoreTextInside is empty) | |
) | |
) | |
} | |
excludeClosing: true, | |
{% elseif not (bbcode.data.ignoreBBCodeInside is empty) %} | |
allowedChildren: ['#'], | |
{% elseif not (bbcode.data.allowedChildren is empty) %} | |
allowedChildren: [' | |
{%- if bbcode.data.ignoreTextInside -%} | |
{{- "#','"-}} | |
{%- endif -%} | |
{{- bbcode.data.allowedChildren|join("','") -}} | |
'], | |
{% endif %} | |
} | |
{% endfor %} | |
})(jQuery, window, document); // Avoid conflicts with other libraries |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment