This Question is Answered

1 "correct" answer available (4 pts) 2 "helpful" answers available (2 pts)
5 Replies Last post: Dec 3, 2008 12:51 AM by Circlefusion  
Circlefusion Novice 5 posts since
Oct 9, 2008
Currently Being Moderated

Nov 28, 2008 6:54 PM

Overriding Settings.js for RTE (TinyMCE)

In looking to customize the RTE, I found this file:  /resources/scripts/jive/model/settings.js

That seems to be where customized toolbar properties are defined. I wanted to override this file so I could modify those settings or create a custom set of properies of my own. I saw this thread...

 

http://www.jivesoftware.com/jivespace/message/97095#97095

 

...where someone said they copied the file from source into jiveHome/resources/script.

 

So I made a copy of settings.js and placed it here:jiveHome/resources/script/jive/model/settings.js

The file was not being included and the RTE was failing. I found where this file was being included into clearspace...

template/decorator/default/header-javascript-jive..ftl

So I created a copy of that file within my theme.

/jiveHome/theme_name/template/decorator/default/header-javascript-jive..ftl

 

So I modified the include line to make sure my version of the file was getting included. I tried variations like changing it from a resource include to a script include (skipping the js compression step), but that did not work. I tried placing the file in different locations, and changing the file name. I added alert("test") to the js to test that it was being included when the editor gets loaded. I tried adding my own test.js file with an alert() within it to make sure I was getting the paths right. I was able to properly do an include of my test file within template.ftl, but not within header-javascript-jive.ftl.

 

So, put simply, if anyone could help me figure out how to override settings.js, I would appreciate the help.

 

I realize there are some options within the admin interface to turn off features of the RTE, but I'm looking for more configuration control, such as loading custom settings depending on the user's role.

 

Thanks

 

Brian

Stewart Wachs JiveEmployees 1,327 posts since
Apr 14, 2008
Currently Being Moderated
Dec 1, 2008 8:33 PM in response to: Circlefusion
Re: Overriding Settings.js for RTE (TinyMCE)

Are you looking to add a new button to the RTE, or to just remove buttons?

Stewart Wachs JiveEmployees 1,327 posts since
Apr 14, 2008
Currently Being Moderated
Dec 1, 2008 10:59 PM in response to: Circlefusion
Re: Overriding Settings.js for RTE (TinyMCE)

Most of the Clearspace Javascript files are stripped of whitespace before being packaged into clearspace-x.x.jar. These files have a '-min' appended to their name. For settings.js, the optimized file is called settings-min.js. If you apply your change to that file, and then repackage it into clearspace-x.x.jar, you'll likely see your customization take effect.

More Like This

  • Retrieving data ...