Skip to content

Commit 2698c1a

Browse files
committed
Some refactoring and version bump
1 parent 82d44d8 commit 2698c1a

File tree

3 files changed

+17
-12
lines changed

3 files changed

+17
-12
lines changed

assets/css/richeditorsnippets.css

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
/**
2-
* Fix icon in October v2.
3-
* TODO: there may be a cleaner way to do this if we figure out a way to hook into the "backend-component-richeditor-document-connector" Vue component.
2+
* "newspaper-o" icon is not in the octo-icon webfont yet, so let's use the legacy one
3+
* for this bogous auto-generated name that will probably not be taken by anyone else.
4+
* If we want to edit this name, in the JS it could be possible to replace the "mapIconName"
5+
* function in the "backend.vuecomponents.richeditordocumentconnector.utils" module that be
6+
* accessed using "$.oc.module.import('...')".
47
*/
58
.octo-icon-icon-newspaper-o::before {
69
content: "\f1ea";

assets/js/froala.snippets.plugin.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@
1717

1818
// The dropdown HTML
1919
html: function() {
20-
if ($.oc.snippets) {
21-
var html = '<ul class="fr-dropdown-list">';
22-
$.each($.oc.snippets, function(i, snippet) {
23-
html += '<li><a class="fr-command" data-cmd="snippets" data-param1="' + snippet.snippet + '" title="' + snippet.name + '">' + snippet.name + '</a></li>';
24-
});
25-
26-
return html + '</ul>';
27-
}
28-
else {
20+
if (!$.oc.snippets) {
2921
return '<div style="padding:10px;">No snippets are currently defined.</div>';
3022
}
23+
24+
var html = '<ul class="fr-dropdown-list">';
25+
26+
$.each($.oc.snippets, function(i, snippet) {
27+
html += '<li><a class="fr-command" data-cmd="snippets" data-param1="' + snippet.snippet + '" title="' + snippet.name + '">' + snippet.name + '</a></li>';
28+
});
29+
30+
return html + '</ul>';
3131
},
3232

3333
// Save the dropdown action into undo stack.
@@ -122,7 +122,7 @@
122122
* that are displayed on page load (i.e. Rainlab Blog).
123123
*/
124124
$(document).ready(function() {
125-
var $editor = $('[data-control="richeditor"]');
125+
var $editor = $('[data-control="richeditor"]:not([data-richeditor-vue])');
126126

127127
if ($.oc.pagesPage && !window.location.pathname.includes('rainlab/pages')) {
128128
$.oc.pagesPage.snippetManager.initSnippets($editor);

updates/version.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@
2222
- Fix error "Trying to access array offset on value of type null" that could happen under unknown circumstances
2323
2.1.6:
2424
- Add composer.json to allow installation on OC2 - Thanks @rubenvanerk for pointing this out
25+
2.1.7:
26+
- Fix compatibility with OC2 when used in plugins other than RainLab.Pages

0 commit comments

Comments
 (0)