OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Feature Request - Extended TinyMCE and character encoding

OCS development discussion, enhancement requests, third-party patches and plug-ins.

Moderators: jmacgreg, michael

Forum rules
Developer Resources:

Documentation: The OJS Technical Reference and the OJS API Reference are both available from the OJS Documentation page. While these are OJS-specific, the OCS codebase is similar enough to OJS they should be of help. There is also an [url=http://pkp.sfu.ca/ocs_documentation[/url]OCS Documentation[/url] page with some more general documentation that might also be of interest.

Git: You can access our public Git Repository here. Comprehensive Git usage instructions are available on the wiki.

Bugzilla: You can access our Bugzilla report tracker here.

Search: You can use our Google Custom Search to search across our main website, the support forum, and Bugzilla.

Questions and discussion are welcome, but if you have a workflow or usability question you should probably post to the OCS Conference Support and Discussion subforum; if you have a technical support question, try the OCS Technical Support subforum.

Feature Request - Extended TinyMCE and character encoding

Postby georgeKapsomenos » Mon Feb 07, 2011 3:25 pm

I would like to request for a more complete version of TinyMCE to be integrated / made available in the text editing areas...right now too few buttons are available...not even the "Undo" - "Redo" button, no font-size or font-type, no anchors, no image editing...

For people like me who are not very in the know about web-building, a more extended version of TinyMCE would be very welcome, because right now I am having great trouble formatting the text...this is important for some areas more so than others...the Conference Home Page is one of them...

In order to apply the formatting I need for such areas, I have to write the text I need in a Joomla article page, copy the HTML code and paste it in the relevant field in the OCS tinymce editor...


The other thing about the implementation of TinyMCE is that it does not render greek characters properly...in the HTML area of TinyMCE in OCS, this is what is being displayed:
ocs-tinymce-code.jpg
ocs-tinymce-code.jpg (159.17 KiB) Viewed 2915 times


Instead, in the Joomla TinyMCE editor, the same article displays as so in the HTML area:
joomla-tinymce-code.jpg
joomla-tinymce-code.jpg (150.66 KiB) Viewed 2915 times


It is practically impossible for me to find my way inside the former html area when I need to make a change directly to the code...So I would greatly appreciate both the addition of a more extended TinyMCE and of -somehow- checking to correct the way TinyMCE handles greek characters in OCS...I believe this is an OCS, not a TinyMCE, related issue, because the described problem above is limited to OCS
Last edited by georgeKapsomenos on Fri Feb 18, 2011 8:15 pm, edited 1 time in total.
georgeKapsomenos
 
Posts: 42
Joined: Wed Jan 19, 2011 3:51 am

Re: Feature Request - Extended TinyMCE and character encoding

Postby asmecher » Mon Feb 07, 2011 4:23 pm

Hi George,

See http://pkp.sfu.ca/bugzilla/show_bug.cgi?id=6080 for a bug entry including a patch that should cause TinyMCE to use proper characters rather than HTML entities. As for the TinyMCE options -- you can customize those fairly easily by editing plugins/generic/tinymce/TinyMCEPlugin.inc.php -- look for the word "javascript" to appear in the source code.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8316
Joined: Wed Aug 10, 2005 12:56 pm

Re: Feature Request - Extended TinyMCE and character encoding

Postby georgeKapsomenos » Mon Feb 07, 2011 6:28 pm

That's great asmecher, thank you very much...knowledge does make things easier...

I went ahead and added raw entity encoding and the html area now is much easier to work with...

I do have a couple of questions, though...
In the "TinyMCEPlugin.inc.php" there are two similar fields
Code: Select all
         $tinymceScript = '
         <script language="javascript" type="text/javascript" src="'.$baseUrl.'/'.TINYMCE_JS_PATH.'/tiny_mce_gzip.js"></script>
         <script language="javascript" type="text/javascript">
            tinyMCE_GZ.init({   
               relative_urls : "false",
               plugins : "paste,fullscreen",
               themes : "advanced",
               languages : "' . join(',', $localeList) . '",
               disk_cache : true
            });

</script>
Code: Select all
         <script language="javascript" type="text/javascript">
            tinyMCE.init({
               plugins : "paste,fullscreen",
               mode : "exact",
               language : "' . String::substr(Locale::getLocale(), 0, 2) . '",
               elements : "' . $enableFields . '",
               relative_urls : false,
               forced_root_block : false,
               paste_auto_cleanup_on_paste : true,
               apply_source_formatting : false,
               theme : "advanced",
               theme_advanced_buttons1 : "cut,copy,paste,|,bold,italic,underline,bullist,numlist,|,link,unlink,help,code,fullscreen",
               theme_advanced_buttons2 : "",
               theme_advanced_buttons3 : ""

Should I add the raw entity encoding to both, or just one of them? Right now I have added it to both...and it does work fine.

I got a little (over)confident, though and went ahead to apply to the above fields some of the settings that are available in the "CustomBlockEditForm.inc.php", the Custom Block Plugin Manager's editor, which I remembered it included many more options...
Code: Select all
      <script language="javascript" type="text/javascript" src="'.Request::getBaseUrl().'/'.TINYMCE_JS_PATH.'/tiny_mce.js"></script>
      <script language="javascript" type="text/javascript">
         tinyMCE.init({
         mode : "textareas",
         plugins : "style,paste",
         theme : "advanced",
         theme_advanced_buttons1 : "formatselect,fontselect,fontsizeselect",
         theme_advanced_buttons2 : "bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright, justifyfull,bullist,numlist,undo,redo,link,unlink",
         theme_advanced_buttons3 : "cut,copy,paste,pastetext,pasteword,|,cleanup,help,code,",
         theme_advanced_toolbar_location : "bottom",
         theme_advanced_toolbar_align : "left",
         content_css : "' . Request::getBaseUrl() . '/styles/common.css",
         relative_urls : false,       
         document_base_url : "'. Request::getBaseUrl() .'/'.$publicFileManager->getConferenceFilesPath($conferenceId) .'/",
         extended_valid_elements : "span[*], div[*]"
         });
      </script>';

From here I copied some of the lines that have to do with the buttons and the plugins...I also added a couple of more plugins (advimage, bbcode) after reading TinyMCE's documentation here

The result was very bad...TinyMCE disappeared entirely, the contents of the text areas displayed like HTML entities...I had cleared cache AND that gzipped file for TinyMCE, but I could bring TinyMCE back only by uploading the previous file for TinyMCE...I don't know where it went wrong...

I have uploaded the TinyMCE file with the above mentioned settings...if it's not too much trouble could you take a quick look to see perhaps what was wrong?
Attachments
edited_TinyMCEPlugin.inc.zip
(3.36 KiB) Downloaded 136 times
georgeKapsomenos
 
Posts: 42
Joined: Wed Jan 19, 2011 3:51 am

Re: Feature Request - Extended TinyMCE and character encoding

Postby asmecher » Mon Feb 07, 2011 10:34 pm

Hi George,

Before I try this -- have you looked at your web browser's error console? Javascript errors will typically be logged there. In Firefox, see Tools > Error Console. With Javascript, unfortunately, a small typo will often cause all scripts to stop working.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8316
Joined: Wed Aug 10, 2005 12:56 pm

Re: Feature Request - Extended TinyMCE and character encoding

Postby georgeKapsomenos » Fri Feb 11, 2011 10:22 am

I have tested extensively once more, could not figure it out...I am sure there were no typographic errors, even tried the exact same configuration as in the "CustomBlockEditForm.inc.php", but if failed

Many errors show up in the error console, even with the default tinyMce settings...

Could another file, tiny_mce_gzip.js, be at fault?
georgeKapsomenos
 
Posts: 42
Joined: Wed Jan 19, 2011 3:51 am


Return to OCS Development

Who is online

Users browsing this forum: No registered users and 1 guest