Pier Editor

The enhanced editor is quite nice, however it still uses the plain wiki syntax. The WYSIWYG editor (based on Yahoo! User Interface 2) in the Pier-Wysiwyg add-on is significantly easier to use (left is enhanced, right is WYSIWYG):

Compare wiki editors
For testing, one method is to run:

PRWysiwygEditorExample register

Then goto http://localhost:8080/wysiwygtest - this should open an example editor.

There are several problems with the WYSIWYG editor in pier however:

  • The WYSIWYG editor does not always work well in Internet Explorer - Webpage error details

    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3; .NET4.0C; .NET4.0E)
    Timestamp: Tue, 29 Apr 2014 11:16:35 UTC
    
    
    Message: 'buttons[...].type' is null or not an object
    Line: 67
    Char: 3091
    Code: 0
    URI: http://localhost:8080/files/PRYUIEditorDeploymentLibrary/yuieditor290.js

    It may need to be upgraded to YUI 3, however it has a known issue working on IE8. One work-around for this is to switch the order of the tabs so the wiki editor (non-WYSIWYG) comes up first.

Several problems have been fixed:

  • Pier-Wysiwyg-JohnCBorden.85 - It breaks internal links links that have anchors - for example if there is a link:

    */information@test*

    The editor displays the text correctly, but saves it as:

    */information#test*

    One possible fix for this is to update PRWysiwygFileLibrary>>parseHtmlToPierWikiSyntaxJs by adding the else block:

    	if (url.indexOf("mailto:") == 0) {
    		url = url.substr("mailto:".length); 
    	} else {
    		if (url.substr(0, 4) !== "http") {
    		/* Replace # with @ if it is the last word and if it is a non-external link */
    		url = url.replace("#","@");
    	}

  • Pier-Wysiwyg-JohnCBorden.86 - If a text contains pre-formatted text (like ascii art) with special wiki characters, then the editor would try to escape out the special characters - such as turning:

    = line -- with -- lots -- of -- dashes -- and @@ at @@ signs

    into:

    = line \-\- with \-\- lots \-\- of \-\- dashes \-\- and \@\@ at \@\@ signs

    The same javascript method above contains:

    var preMarkup = function () {
    	return function (node) {
    		var isCode = false;
    		if (node.className && node.className.indexOf("shout") != -1) {
    			isCode = true;
    			escapeText = false;
    		}
    		var markup = isCode ? "==" : "=";

    Removing the class check resolved the issue.

  • If a page has a link like:

    *value:children|link*

    then opening an editor on it yields:

    MessageNotUnderstood: receiver of "write:" is nil
    Your request could not be completed. An exception occurred.

    This was caused by a missing class - Pier-Wysiwyg-JohnCBorden.89 replaces PRWikiWriter with PRPillarWriter.

  • Lines of pre-formatted text is not displayed properly unless there is a space after the equal-sign - the enhanced editor was updated to add this in version 64 (changes in PREditorScripts>>toolbarJs).
  • External links are cut off at the question mark - This appears to have been fixed since 2014-May.
  • Enhanced editor 65 has updates so white space at the end of the line is removed, and text that has tabs that is turned into a table has multiple columns
  • The editor would fail with the error in the web browser:

    MessageNotUnderstood: JQTabs>>onSelect:

    This was resolved in Pier-Wysiwyg-JohnCBorden.90 by replacing #onSelect: with #onActivate:

Posted by John Borden at 14 August 2014, 1:33 am link