Skip to content

Commit

Permalink
Some refactoring and version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
Fl0Cri committed Jan 10, 2022
1 parent 82d44d8 commit 2698c1a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
7 changes: 5 additions & 2 deletions assets/css/richeditorsnippets.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/**
* Fix icon in October v2.
* 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.
* "newspaper-o" icon is not in the octo-icon webfont yet, so let's use the legacy one
* for this bogous auto-generated name that will probably not be taken by anyone else.
* If we want to edit this name, in the JS it could be possible to replace the "mapIconName"
* function in the "backend.vuecomponents.richeditordocumentconnector.utils" module that be
* accessed using "$.oc.module.import('...')".
*/
.octo-icon-icon-newspaper-o::before {
content: "\f1ea";
Expand Down
20 changes: 10 additions & 10 deletions assets/js/froala.snippets.plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@

// The dropdown HTML
html: function() {
if ($.oc.snippets) {
var html = '<ul class="fr-dropdown-list">';
$.each($.oc.snippets, function(i, snippet) {
html += '<li><a class="fr-command" data-cmd="snippets" data-param1="' + snippet.snippet + '" title="' + snippet.name + '">' + snippet.name + '</a></li>';
});

return html + '</ul>';
}
else {
if (!$.oc.snippets) {
return '<div style="padding:10px;">No snippets are currently defined.</div>';
}

var html = '<ul class="fr-dropdown-list">';

$.each($.oc.snippets, function(i, snippet) {
html += '<li><a class="fr-command" data-cmd="snippets" data-param1="' + snippet.snippet + '" title="' + snippet.name + '">' + snippet.name + '</a></li>';
});

return html + '</ul>';
},

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

if ($.oc.pagesPage && !window.location.pathname.includes('rainlab/pages')) {
$.oc.pagesPage.snippetManager.initSnippets($editor);
Expand Down
2 changes: 2 additions & 0 deletions updates/version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@
- Fix error "Trying to access array offset on value of type null" that could happen under unknown circumstances
2.1.6:
- Add composer.json to allow installation on OC2 - Thanks @rubenvanerk for pointing this out
2.1.7:
- Fix compatibility with OC2 when used in plugins other than RainLab.Pages

0 comments on commit 2698c1a

Please sign in to comment.