Skip to content

Commit

Permalink
Merge pull request #786 from ahasnawi/layout-repeater
Browse files Browse the repository at this point in the history
hide the link data button in tinymce layouts
  • Loading branch information
bkalaldeh authored Aug 28, 2023
2 parents 3821e89 + 6ece5f1 commit a219381
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion pluginTester/scripts/framework/app.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pluginTester/scripts/framework/web.min.js

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions scripts/tinymce/plugins/bf_layouts/layouts.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"cssUrl": "layouts/bf_mce_layout1.css",
"htmlUrl" : "layouts/template_a.html",
"expressionFields": [
{ "name": "Photo", "defaultValue": "https://d335ljseg2f9ry.cloudfront.net/scripts/tinymce/plugins/bf_layouts/layouts/resources/img1.jpeg", "info": "Use only for photos. Leave empty if you want to manually add a photo inside the WYSIWYG.", "selector": "div.bf_mce_img-container img", "attribute": "src", "type": "img" },
{ "name": "Photo", "defaultValue": "https://pluginserver.buildfire.com/scripts/tinymce/plugins/bf_layouts/layouts/resources/img1.jpeg", "info": "Use only for photos. Leave empty if you want to manually add a photo inside the WYSIWYG.", "selector": "div.bf_mce_img-container img", "attribute": "src", "type": "img" },
{ "name": "Title", "defaultValue": "Title", "info": "Replace the layout title with custom text or an expression", "selector": "div.bf_mce_copy h1" },
{ "name": "Caption", "defaultValue": "Caption", "info": "Replace the layout caption with custom text or an expression", "selector": "p.bf_mce_caption" },
{ "name": "Body", "defaultValue": "Lorem ipsum, dolor sit amet consectetur adipisicing elit. Natus placeat ab, commodi quo, officiis voluptatum earum perferendis doloremque.", "info": "Replace the layout body content with custom text or an expression", "selector": "p.bf_mce_body" },
Expand All @@ -19,7 +19,7 @@
"cssUrl": "layouts/bf_mce_layout2.css",
"htmlUrl" : "layouts/template_a.html",
"expressionFields": [
{ "name": "Photo", "defaultValue": "https://d335ljseg2f9ry.cloudfront.net/scripts/tinymce/plugins/bf_layouts/layouts/resources/img1.jpeg", "info": "Use only for photos. Leave empty if you want to manually add a photo inside the WYSIWYG.", "selector": "div.bf_mce_img-container img", "attribute": "src", "type": "img" },
{ "name": "Photo", "defaultValue": "https://pluginserver.buildfire.com/scripts/tinymce/plugins/bf_layouts/layouts/resources/img1.jpeg", "info": "Use only for photos. Leave empty if you want to manually add a photo inside the WYSIWYG.", "selector": "div.bf_mce_img-container img", "attribute": "src", "type": "img" },
{ "name": "Title", "defaultValue": "Title", "info": "Replace the layout title with custom text or an expression", "selector": "div.bf_mce_copy h1" },
{ "name": "Caption", "defaultValue": "Caption", "info": "Replace the layout caption with custom text or an expression", "selector": "p.bf_mce_caption" },
{ "name": "Body", "defaultValue": "Lorem ipsum, dolor sit amet consectetur adipisicing elit. Natus placeat ab, commodi quo, officiis voluptatum earum perferendis doloremque.", "info": "Replace the layout body content with custom text or an expression", "selector": "p.bf_mce_body" },
Expand All @@ -33,7 +33,7 @@
"cssUrl": "layouts/bf_mce_layout3.css",
"htmlUrl" : "layouts/template_b.html",
"expressionFields": [
{ "name": "Photo", "defaultValue": "https://d335ljseg2f9ry.cloudfront.net/scripts/tinymce/plugins/bf_layouts/layouts/resources/img2.jpeg", "info": "Use only for photos. Leave empty if you want to manually add a photo inside the WYSIWYG.", "selector": "div.bf_mce_img-container img", "attribute": "src", "type": "img" },
{ "name": "Photo", "defaultValue": "https://pluginserver.buildfire.com/scripts/tinymce/plugins/bf_layouts/layouts/resources/img2.jpeg", "info": "Use only for photos. Leave empty if you want to manually add a photo inside the WYSIWYG.", "selector": "div.bf_mce_img-container img", "attribute": "src", "type": "img" },
{ "name": "Title", "defaultValue": "Title", "info": "Replace the layout title with custom text or an expression", "selector": "h1.bf_mce_main-title" },
{ "name": "Caption", "defaultValue": "Caption", "info": "Replace the layout caption with custom text or an expression", "selector": "p.bf_mce_caption" },
{ "name": "Body", "defaultValue": "Lorem ipsum, dolor sit amet consectetur adipisicing elit. Natus placeat ab, commodi quo, officiis voluptatum earum perferendis doloremque.", "info": "Replace the layout body content with custom text or an expression", "selector": "p.bf_mce_body-copy" },
Expand Down Expand Up @@ -65,7 +65,7 @@
"cssUrl": "layouts/bf_mce_layout7.css",
"htmlUrl" : "layouts/template_b.html",
"expressionFields": [
{ "name": "Photo", "defaultValue": "https://d335ljseg2f9ry.cloudfront.net/scripts/tinymce/plugins/bf_layouts/layouts/resources/img2.jpeg", "info": "Use only for photos. Leave empty if you want to manually add a photo inside the WYSIWYG.", "selector": "div.bf_mce_img-container img", "attribute": "src", "type": "img" },
{ "name": "Photo", "defaultValue": "https://pluginserver.buildfire.com/scripts/tinymce/plugins/bf_layouts/layouts/resources/img2.jpeg", "info": "Use only for photos. Leave empty if you want to manually add a photo inside the WYSIWYG.", "selector": "div.bf_mce_img-container img", "attribute": "src", "type": "img" },
{ "name": "Title", "defaultValue": "Title", "info": "Replace the layout title with custom text or an expression", "selector": "h1.bf_mce_main-title" },
{ "name": "Caption", "defaultValue": "Caption", "info": "Replace the layout caption with custom text or an expression", "selector": "p.bf_mce_caption" },
{ "name": "Body", "defaultValue": "Lorem ipsum, dolor sit amet consectetur adipisicing elit. Natus placeat ab, commodi quo, officiis voluptatum earum perferendis doloremque.", "info": "Replace the layout body content with custom text or an expression", "selector": "p.bf_mce_body-copy" },
Expand All @@ -79,7 +79,7 @@
"cssUrl": "layouts/bf_mce_layout8.css",
"htmlUrl" : "layouts/template_a.html",
"expressionFields": [
{ "name": "Photo", "defaultValue": "https://d335ljseg2f9ry.cloudfront.net/scripts/tinymce/plugins/bf_layouts/layouts/resources/img1.jpeg", "info": "Use only for photos. Leave empty if you want to manually add a photo inside the WYSIWYG.", "selector": "div.bf_mce_img-container img", "attribute": "src", "type": "img" },
{ "name": "Photo", "defaultValue": "https://pluginserver.buildfire.com/scripts/tinymce/plugins/bf_layouts/layouts/resources/img1.jpeg", "info": "Use only for photos. Leave empty if you want to manually add a photo inside the WYSIWYG.", "selector": "div.bf_mce_img-container img", "attribute": "src", "type": "img" },
{ "name": "Title", "defaultValue": "Title", "info": "Replace the layout title with custom text or an expression", "selector": "div.bf_mce_copy h1" },
{ "name": "Caption", "defaultValue": "Caption", "info": "Replace the layout caption with custom text or an expression", "selector": "p.bf_mce_caption" },
{ "name": "Body", "defaultValue": "Lorem ipsum, dolor sit amet consectetur adipisicing elit. Natus placeat ab, commodi quo, officiis voluptatum earum perferendis doloremque.", "info": "Replace the layout body content with custom text or an expression", "selector": "p.bf_mce_body" },
Expand All @@ -93,7 +93,7 @@
"cssUrl": "layouts/bf_mce_layout9.css",
"htmlUrl" : "layouts/template_f.html",
"expressionFields": [
{ "name": "Photo", "defaultValue": "https://d335ljseg2f9ry.cloudfront.net/scripts/tinymce/plugins/bf_layouts/layouts/resources/img3.jpeg", "info": "Use only for photos. Leave empty if you want to manually add a photo inside the WYSIWYG.", "selector": "div.bf_mce_img-container img", "attribute": "src", "type": "img" },
{ "name": "Photo", "defaultValue": "https://pluginserver.buildfire.com/scripts/tinymce/plugins/bf_layouts/layouts/resources/img3.jpeg", "info": "Use only for photos. Leave empty if you want to manually add a photo inside the WYSIWYG.", "selector": "div.bf_mce_img-container img", "attribute": "src", "type": "img" },
{ "name": "Label", "defaultValue": "Label", "info": "Replace the layout label with custom text or an expression", "selector": "h2.bf_mce_secondary-title" },
{ "name": "Title", "defaultValue": "Title", "info": "Replace the layout title with custom text or an expression", "selector": "h1.bf_mce_main-title" },
{ "name": "Caption", "defaultValue": "Caption", "info": "Replace the layout caption with custom text or an expression", "selector": "p.bf_mce_caption" },
Expand Down
2 changes: 1 addition & 1 deletion scripts/tinymce/plugins/bf_layouts/layouts/template_a.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- This template should not be changed once is live -->
<div class="bf_mce_img-container">
<img src="https://d335ljseg2f9ry.cloudfront.net/scripts/tinymce/plugins/bf_layouts/layouts/resources/img1.jpeg" data-bf-image="%7B%7D">
<img src="https://pluginserver.buildfire.com/scripts/tinymce/plugins/bf_layouts/layouts/resources/img1.jpeg" data-bf-image="%7B%7D">
</div>
<div class="bf_mce_copy">
<h1>Title</h1>
Expand Down
2 changes: 1 addition & 1 deletion scripts/tinymce/plugins/bf_layouts/layouts/template_b.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- This template should not be changed once is live -->
<div class="bf_mce_img-container">
<img src="https://d335ljseg2f9ry.cloudfront.net/scripts/tinymce/plugins/bf_layouts/layouts/resources/img2.jpeg" data-bf-image="%7B%7D">
<img src="https://pluginserver.buildfire.com/scripts/tinymce/plugins/bf_layouts/layouts/resources/img2.jpeg" data-bf-image="%7B%7D">
<div class="bf_mce_img-copy">
<h1 class="bf_mce_main-title">Title</h1>
<p class="bf_mce_caption">Caption</p>
Expand Down
2 changes: 1 addition & 1 deletion scripts/tinymce/plugins/bf_layouts/layouts/template_f.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- This template should not be changed once is live -->
<div class="bf_mce_img-container">
<img src="https://d335ljseg2f9ry.cloudfront.net/scripts/tinymce/plugins/bf_layouts/layouts/resources/img3.jpeg" data-bf-image="%7B%7D">
<img src="https://pluginserver.buildfire.com/scripts/tinymce/plugins/bf_layouts/layouts/resources/img3.jpeg" data-bf-image="%7B%7D">
</div>
<div class="bf_mce_top-copy">
<h2 class="bf_mce_secondary-title">01</h2>
Expand Down
4 changes: 2 additions & 2 deletions scripts/tinymce/plugins/bf_layouts/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function render(layouts) {
}
if (selectedLayout?.expressionFields) {
let linkDataButton = document.getElementById('linkDataButton');
linkDataButton.style.display = 'flex';
// linkDataButton.style.display = 'flex';
linkDataButton.style.opacity = '1';
}
imageDiv.classList.add('imageDiv');
Expand All @@ -68,7 +68,7 @@ function render(layouts) {
imageDiv.classList.add('active');
selectLayout(item.id);
if (selectedLayout.expressionFields) {
linkDataButton.style.display = 'flex';
// linkDataButton.style.display = 'flex';
setTimeout(() => { linkDataButton.style.opacity = '1'; }, 0);
} else {
linkDataButton.style.opacity = '0';
Expand Down

0 comments on commit a219381

Please sign in to comment.