Skip to content

Commit

Permalink
Merge pull request #772 from ahasnawi/tinymce-valid-elements
Browse files Browse the repository at this point in the history
Extend valid attribute fir elements in the tinymce
  • Loading branch information
bkalaldeh authored Jul 24, 2023
2 parents 25ac3a3 + f25ee48 commit e8d84d3
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pluginTester/scripts/framework/web.min.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions pluginTester/styles/appStyle.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
[ios="true"][view="browser"][is-pwa-or-html5-ios="true"] {
--full-app-height: 100%;
}
[is-pwa-android="true"] {
--full-app-height: -webkit-fill-available;
}
*{
outline:none;
-webkit-box-sizing: border-box;
Expand Down
1 change: 0 additions & 1 deletion pluginTester/styles/input.css
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,6 @@ html[ios='true'][view='app'][storyboard-launch-images='true'] #inputDialog .inpu
background: rgba(0, 0, 0, 0.5);
z-index: 99999999;
}

html[type="pluginTester"] #input-backdrop,
html[type="pluginTester"] #gif-backdrop {
height: 100% !important;
Expand Down
2 changes: 1 addition & 1 deletion scripts/_bundles/buildfire_lightcarousel.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion scripts/_bundles/buildfire_lightcarousel.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion scripts/_bundles/jquery_angular_buildfire_smartcrop.min.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

14 changes: 13 additions & 1 deletion scripts/buildfire.js
Original file line number Diff line number Diff line change
Expand Up @@ -4117,6 +4117,10 @@ var buildfire = {
_injectExpressionNode();
editor.isNotDirty = false;
editor.fire('change');
} else if (dynamicExpressionsEnabled && dynamicExpressionsActivated && editor.getContent().search('data-type="dynamic-expression"') === -1) {
_injectExpressionNode();
editor.isNotDirty = false;
editor.fire('change');
} else if (dynamicExpressionsEnabled && dynamicExpressionsActivated && editor.getContent().search(/\${[^{}]*}/) === -1) {
dynamicExpressionsActivated = false;
_restoreCursorPosition(); // This function works with sync functionality
Expand Down Expand Up @@ -4329,12 +4333,20 @@ var buildfire = {
} else {
options.toolbar = defaultToolbar;
}
let extended_valid_elements = '';
// These are the elements that we want to support all of their attributes in tinymce (custom attributes in addition to the non-custom attribute)
const supportedElement = ['a','article','aside','audio','button','code','details','div','textarea','fieldset','form',
'h1','h2','h3','h4','h5','h6','input','img','li','ol','ul','option','p','section','select','span','table','tr'];
supportedElement.forEach((element, index) => {
extended_valid_elements += `${element}[*]`;
if (index != supportedElement.length - 1) extended_valid_elements += ',';
});
options.extended_valid_elements = extended_valid_elements;
options.toolbar_mode = 'floating';
options.theme = 'silver';
options.skin = 'bf-skin';
options.contextmenu = 'bf_buttonOrLinkContextMenu bf_imageContextMenu bf_actionItemContextMenu bf_customLayouts bf_defaultmenuItems';
options.fontsize_formats= '8px 10px 12px 14px 16px 18px 24px 36px';
options.extended_valid_elements= 'a[href|onclick|class],img[src|data-expr-src|expr-src|style|onerror|onload|height|width|onclick|alt],button[style|class|onclick],p[*],div[*],span[*],tr[*]';
options.height = options.height || 265;
options.custom_elements = 'style';
options.convert_urls = false;
Expand Down
2 changes: 1 addition & 1 deletion scripts/buildfire.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion scripts/buildfire.min.js.map

Large diffs are not rendered by default.

0 comments on commit e8d84d3

Please sign in to comment.