JSPWiki
  1. JSPWiki
  2. JSPWIKI-734

ShortURLConstructor causes Syntax Error when loading jspwiki-edit.js

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.8.4, 2.9
    • Fix Version/s: 2.9
    • Component/s: Core & storage
    • Labels:
      None
    • Environment:

      FF 13.1 - Windows - Tomcat 7.0.27

      Description

      I tried using jspwiki.urlConstructor = ShortURLConstructor and it took me a quite amount of time to see that this causes a problem:

      The editor toolbar is not working anymore, the quick preview under the editing text area eighter.
      The web console of firefox shows that there is a syntax error in line 13 in jspwiki-edit.js.

      The line highlighted is:

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

      Using the ShortViewURLConstructor or the default "fixes" the problem.

        Activity

        Hide
        brushed added a comment -

        The editor includes 2 javascript resources, by using addResourceRequests call in plain.jsp.
        However, the path's should be encoded properly, depending on the correct url constructor scheme.

        Fix plain.jsp. (also fix FCK.jsp)

        Old code:

           TemplateManager.addResourceRequest( context, TemplateManager.RESOURCE_SCRIPT, "scripts/jspwiki-edit.js" );
           TemplateManager.addResourceRequest( context, TemplateManager.RESOURCE_SCRIPT, "scripts/posteditor.js" );
        

        New code:

           TemplateManager.addResourceRequest( context, TemplateManager.RESOURCE_SCRIPT, 
           		context.getURL( WikiContext.NONE, "scripts/jspwiki-edit.js" ) );
           TemplateManager.addResourceRequest( context, TemplateManager.RESOURCE_SCRIPT, 
           		context.getURL( WikiContext.NONE, "scripts/posteditor.js" ) );
        

        dirk

        Show
        brushed added a comment - The editor includes 2 javascript resources, by using addResourceRequests call in plain.jsp. However, the path's should be encoded properly, depending on the correct url constructor scheme. Fix plain.jsp. (also fix FCK.jsp) Old code: TemplateManager.addResourceRequest( context, TemplateManager.RESOURCE_SCRIPT, "scripts/jspwiki-edit.js" ); TemplateManager.addResourceRequest( context, TemplateManager.RESOURCE_SCRIPT, "scripts/posteditor.js" ); New code: TemplateManager.addResourceRequest( context, TemplateManager.RESOURCE_SCRIPT, context.getURL( WikiContext.NONE, "scripts/jspwiki-edit.js" ) ); TemplateManager.addResourceRequest( context, TemplateManager.RESOURCE_SCRIPT, context.getURL( WikiContext.NONE, "scripts/posteditor.js" ) ); dirk
        Hide
        brushed added a comment -

        fixed in 2.9.0-incubating-5

        Show
        brushed added a comment - fixed in 2.9.0-incubating-5
        Hide
        Florian Holeczek added a comment -

        Closing this, since 2.9 has been released

        Show
        Florian Holeczek added a comment - Closing this, since 2.9 has been released

          People

          • Assignee:
            Unassigned
            Reporter:
            Bertram Nudelbach
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development