Skip to content

Commit

Permalink
Update TinyMCE and fix configuration loading
Browse files Browse the repository at this point in the history
  • Loading branch information
dlpierce authored and tamsin johnson committed Sep 14, 2021
1 parent 426575a commit 095a2b5
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 13 deletions.
13 changes: 13 additions & 0 deletions .dassie/config/tinymce.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
default: &default
setup: tinymce_nav_safety # onChange event init
content_block:
<<: *default
menubar: false
toolbar1: styleselect | bold italic | undo redo
toolbar2: table | fullscreen | image
plugins:
- table
- fullscreen
- image
custom:
<<: *default
1 change: 1 addition & 0 deletions app/assets/javascripts/hyrax.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
//= require morris/morris.min

//= require clipboard
//= require tinymce

// This is required for Jasmine tests, specifically to polyfill the Symbol() function
//= require babel/polyfill
Expand Down
10 changes: 0 additions & 10 deletions app/assets/javascripts/hyrax/app.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,12 @@ Hyrax = {
this.collectionTypeEditor();
this.collectionUtilities();
this.adminStatisticsGraphs();
this.tinyMCE();
this.sortAndPerPage();
this.sidebar();
this.batchSelect();
this.internationalizationHelper();
},

// Add WYSIWYG editor functionality to editable content blocks
tinyMCE: function() {
if (typeof tinyMCE === "undefined")
return;
tinyMCE.init({
selector: 'textarea.tinymce'
});
},

// The AdminSet edit page
adminSetEditor: function() {
var AdminSetControls = require('hyrax/admin/admin_set_controls');
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/_head_tag_content.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ signed in %>

<!-- application js -->
<%= javascript_include_tag 'application' %>
<%= tinymce_assets if can? :update, ContentBlock %>
<%= render 'shared/appearance_styles' %>

<!-- Google Analytics -->
Expand Down
5 changes: 3 additions & 2 deletions lib/generators/hyrax/templates/config/tinymce.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ default: &default
content_block:
<<: *default
menubar: false
toolbar1: styleselect | bold italic | link image | undo redo
toolbar2: table | fullscreen | uploadimage
toolbar1: styleselect | bold italic | undo redo
toolbar2: table | fullscreen | image
plugins:
- table
- fullscreen
- image
custom:
<<: *default
1 change: 1 addition & 0 deletions lib/hyrax/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class Engine < ::Rails::Engine
require 'flipflop'
require 'qa'
require 'clipboard/rails'
require 'tinymce-rails'
require 'legato'
require 'pul_uv_rails'

Expand Down

0 comments on commit 095a2b5

Please sign in to comment.