Skip to content

Commit

Permalink
update Bootstrap Tinymce Plugin
Browse files Browse the repository at this point in the history
update Bootstrap 4 styles for select2
  • Loading branch information
twin-elements committed Aug 24, 2022
1 parent 2112c9c commit bda1d36
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 35 deletions.
18 changes: 0 additions & 18 deletions src/Resources/private/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,28 +88,10 @@ $(document).ready(function () {
}
});

// $("#category-tree .open-children").on("click", function () {
// var id = $(this).data("id");
// $("ul#" + id).toggleClass("active");
// });
//
// if ("#active-tree-element") {
// var parentsTree = $("#active-tree-element").parents("ul");
// $.each(parentsTree, function (index, value) {
// $(value).addClass("active");
// });
// }

$(".select2").select2({
theme: "bootstrap4",
});

// $(".images_widget_image").on("click", function () {
// var radioID = $(this).attr("data-id");
// var inputID = "#" + radioID;
// $(inputID).prop("checked", !$(inputID).prop("checked"));
// });

$("body").on("click", ".open-file-manager-btn", function () {
const _self = this;
const _$self = $(_self);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
width: calc(100% + 14px);
height: calc(100% + 14px);
border: 1px dashed #aaa;
pointer-events: none;
}

.breadcrumb .tbp-active:after,
Expand All @@ -23,7 +24,8 @@
/* Template buttons
-------------------------------------------------- */

.row, .col {
.row,
.col {
position: relative;
}

Expand Down Expand Up @@ -57,14 +59,14 @@
pointer-events: none;
}

[class*="col"] > .context-trigger-wrapper .btn {
[class*="col"]>.context-trigger-wrapper .btn {
padding: .0625rem .125rem;
font-size: .4375rem;
line-height: .375;
filter: saturate(25%) brightness(120%);
}

[class*="col"] > .context-trigger-wrapper button span.svg-icon {
[class*="col"]>.context-trigger-wrapper button span.svg-icon {
transform: scale(.75);
}

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions src/Resources/private/js/plugins/bootstrap/langs/fr_FR.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
tinymce.addI18n("fr_FR", {
"lgtest": "mon cul",
const bootstrapUiI18n = {
"Add col after": "Ajouter une colonne après",
"Add col before": "Ajouter une colonne avant",
"Add paragraph after": "Ajouter un paragraphe après",
Expand Down Expand Up @@ -52,4 +51,4 @@ tinymce.addI18n("fr_FR", {
"Snippet": "Snippet",
"Table": "Tableau",
"Template": "Template"
});
};
10 changes: 9 additions & 1 deletion src/Resources/private/js/plugins/bootstrap/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@

var defaultConfig = {
bootstrapColumns: 12,
bootstrapCss: 'https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css',
bootstrapCss: 'https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css',
editorStyleFormats: {
textStyles: true,
blockStyles: true,
Expand Down Expand Up @@ -6017,6 +6017,14 @@
var nodeType = match[1];
var prop_1 = match[2];
var value = match[3];
var range = tinymce.activeEditor.selection.getRng();
var selectedLength = range.endOffset - range.startOffset;
if (selectedLength > 0) {
var ct = tinymce.activeEditor.selection.getContent();
tinymce.activeEditor.selection.setContent(tinymce.activeEditor.dom.createHTML('span', { id: 'tbp-span' }, ct));
tinymce.activeEditor.selection.select(tinymce.activeEditor.dom.select('#tbp-span')[0]);
tinymce.activeEditor.dom.setAttrib('tbp-span', 'id', '');
}
var $node_1 = tinymce.activeEditor.selection.getNode();
if (nodeType === 'block') {
$node_1 = _this.$($node_1).closest(_this.styleFormatConfig.blockSelector);
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/private/js/plugins/bootstrap/plugin.min.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/solid.css">
<style> .small { font-size: 75%; } .snippet-category { border: 1px solid #E8E9EB; } .snippet-name, .snippet-code { position: relative; } .snippet-name:after, .snippet-code:after { position: absolute; right: 5px; bottom: 2px; display: block; color: #99a6b1; opacity: .5; } .snippet-name { border: 1px dashed #6c757d; } .snippet-name:after { content: "Snippet Name"; font-size: .75em; } .snippet-code-wrapper { position:relative; min-height: 150px; } .snippet-code { margin: auto; height: 200px; width: 100%; } .snippet-code:after { content: "Snippet Code"; } .drag-me { cursor: move; } .category-remove, .snippet-remove { cursor: pointer; } a[data-toggle="collapse"] { -webkit-transition: all 200ms ease-in-out; -moz-transition: all 200ms ease-in-out; -ms-transition: all 200ms ease-in-out; -o-transition: all 200ms ease-in-out; transition: all 200ms ease-in-out; } a[data-toggle="collapse"][aria-expanded="true"] { -moz-transform: rotate(90deg); -webkit-transform: rotate(90deg); -o-transform: rotate(90deg); -ms-transform: rotate(90deg); transform: rotate(90deg); } </style>

<title>Bootstrap Plugin for TinyMCE - Snippets Manager</title>
<title>Tinymce Bootstrap Plugin - Bootstrap 4 Snippets Manager</title>
<meta name="description" content="Bootstrap Snippet Manager for Tinymce - Create, organize and store any code snippet here">
<meta name="locations" content="Global">
<meta name="robots" content="index, follow">
Expand All @@ -25,7 +25,7 @@

<body>

<h1 class="h2 text-secondary text-center py-3">Bootstrap Plugin for TinyMCE<br><small>Snippets Manager</small></h1>
<h1 class="h2 text-secondary text-center py-3">Tinymce Bootstrap Plugin<br><small>Bootstrap 4 Snippets Manager</small></h1>
<div class="container">

<details class="mb-4">
Expand All @@ -42,7 +42,7 @@ <h1 class="h2 text-secondary text-center py-3">Bootstrap Plugin for TinyMCE<br><
<li>re-order the categories &amp; snippets</li>
</ul>
<p>The snippets are available in the main plugin <strong>Snippet dialog</strong>. </p>
<p><a href="https://www.tinymce-bootstrap-plugin.com/documentation/index" class="text-light border-bottom text-decoration-none">Bootstrap Plugin for TinyMCE - Documentation</a></p>
<p><a href="https://www.tinymce-bootstrap-plugin.com/documentation/index" class="text-light border-bottom text-decoration-none">Tinymce Bootstrap Plugin - Documentation</a></p>
</div>
<div class="card-body">

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
.small { font-size: 75%; } .template-category { border: 1px solid #E8E9EB; } .template-name, .template-code { position: relative; } .template-name:after, .template-code:after { position: absolute; right: 5px; bottom: 2px; display: block; color: #99a6b1; opacity: .5; } .template-name { border: 1px dashed #6c757d; } .template-name:after { content: "Template Name"; font-size: .75em; } .template-code-wrapper { position:relative; min-height: 150px; } .template-code { margin: auto; height: 200px; width: 100%; } .template-code:after { content: "Template Code"; } .drag-me { cursor: move; } .category-remove, .template-remove { cursor: pointer; } a[data-toggle="collapse"] { -webkit-transition: all 200ms ease-in-out; -moz-transition: all 200ms ease-in-out; -ms-transition: all 200ms ease-in-out; -o-transition: all 200ms ease-in-out; transition: all 200ms ease-in-out; } a[data-toggle="collapse"][aria-expanded="true"] { -moz-transform: rotate(90deg); -webkit-transform: rotate(90deg); -o-transform: rotate(90deg); -ms-transform: rotate(90deg); transform: rotate(90deg); }
</style>

<title>Bootstrap Plugin for TinyMCE - Templates Manager</title>
<title>Tinymce Bootstrap Plugin - Bootstrap 4 Templates Manager</title>
<meta name="description" content="Bootstrap Template Manager for Tinymce - Create and store Bootstrap layouts and templates here">
<meta name="locations" content="Global">
<meta name="robots" content="index, follow">
Expand All @@ -27,7 +27,7 @@

<body>

<h1 class="h2 text-secondary text-center py-3">Bootstrap Plugin for TinyMCE<br><small>Templates Manager</small></h1>
<h1 class="h2 text-secondary text-center py-3">Tinymce Bootstrap Plugin<br><small>Bootstrap 4 Templates Manager</small></h1>
<div class="container">

<details class="mb-4">
Expand All @@ -44,7 +44,7 @@ <h1 class="h2 text-secondary text-center py-3">Bootstrap Plugin for TinyMCE<br><
<li>re-order the categories &amp; templates</li>
</ul>
<p>The templates are available in the main plugin <strong>Template dialog</strong>. </p>
<p><a href="https://www.tinymce-bootstrap-plugin.com/documentation/index" class="text-light border-bottom text-decoration-none">Bootstrap Plugin for TinyMCE - Documentation</a></p>
<p><a href="https://www.tinymce-bootstrap-plugin.com/documentation/index" class="text-light border-bottom text-decoration-none">Tinymce Bootstrap Plugin - Documentation</a></p>
</div>
<div class="card-body">

Expand Down
2 changes: 1 addition & 1 deletion src/Resources/private/js/plugins/bootstrap/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.5
3.5.1
2 changes: 1 addition & 1 deletion src/Resources/private/scss/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ $icomoon-font-path: '../../fonts';
@import "lightbox";

@import "~select2/src/scss/core";
@import "~@ttskch/select2-bootstrap4-theme/src/layout";
@import "~@ttskch/select2-bootstrap4-theme/src/select2-bootstrap4";
@import "~cropper/dist/cropper.min.css";


Expand Down

0 comments on commit bda1d36

Please sign in to comment.