incubator-jspwiki-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dirk Frederickx" <dirk.frederi...@gmail.com>
Subject Re: Problem with the plain editor on 2.6.1
Date Sun, 09 Mar 2008 09:51:09 GMT
Christophe,

The extra editor functions on the plain editor are indeed 'biased' towards
standard jspwiki markup.

Switching to Creole markup would require changes to the jspwiki-edit.js. All
markup specific stuff is located
in the getWikiSnippet() function. Overwriting that function should be
sufficient.

Those snippets have following format:

    "toc" : {
        snippet:["","[{TableOfContents }]", "\n"],
        tab:['[{TableOfContents }]', '']
    },

The "snippet" field (always 3 parts) shows the markup which is inserted when
pressing the toc button or typing  "toc"+<Tab>. In this case, the snippet
inserts a call to the TableOfContents plugin, followed by a newline.
The "tab" field indicates which text parts to highlight when pressing
subsequent <Tab> keys.


As jspwiki-edit.js is inserted via the plain.jsp; you'd probably also need
to create a 'plain-creole.jsp' or something.
So, copy the plain.jsp and add following line  after the insertion of
jspwiki-edit.js :

   TemplateManager.addResourceRequest( context, "script",  contextPath +
"/scripts/creole-snippets.js" );


The new  "/scripts/creole-snippets.js" would have just your new snippet
definitions, something like:

EditTools.getWikiSnippets = function(){
  return {
    "toc" : {
        snippet:["","<creole markup here>", "\n"],
        tab:[ ... ]
    },
    ...
  }
}


dirk





dirk



On Sun, Mar 9, 2008 at 9:47 AM, Christoph Sauer <sauer@hs-heilbronn.de>
wrote:

> Dirk,
>
> I haven't looked too much into the code right now, but it is at least
> biased
> towards jspwiki markup. When I use the creole filter I would have to adapt
> the javascript, so that the buttons are inserting e.g. creole markup for
> headings. One reason why I didn't switch to 2.6 yet was the "biased"
> default
> editor. That's why I called for a "vitage" editor. How easy is it to
> change
> the markup insertion code in the editor? Could you add a simple switch for
> this as well?
>
> --Christoph
>
> -----Ursprüngliche Nachricht-----
> Von: Dirk Frederickx [mailto:dirk.frederickx@gmail.com]
> Gesendet: Samstag, 8. März 2008 15:06
> An: jspwiki-user@incubator.apache.org
> Betreff: Re: Problem with the plain editor on 2.6.1
>
> Christoph,
>
> May be should make the wiki-link-suggestion-box optional through a extra
> checkbox instead of having it on by default.
> For the rest the plain editor is pretty 'plain', and is run without
> interference of any javascript.
>
>
>
> dirk
>
>
> On Sat, Mar 8, 2008 at 8:28 AM, Christoph Sauer <sauer@hs-heilbronn.de>
> wrote:
>
> > What I would like to see is a really "plain" editor that works without
> > javascript, like the old one in 2.4. That would be a good fallback. I am
> > not
> > sure if you would like to have that in the core, maybe we could call it
> > "vintage" editor?
> >
> > --Christoph
> >
> > -----Ursprüngliche Nachricht-----
> > Von: Steve Dahl [mailto:dahl@goshawk.com]
> > Gesendet: Montag, 25. Februar 2008 20:44
> > An: jspwiki-user@incubator.apache.org
> > Betreff: Re: Problem with the plain editor on 2.6.1
> >
> > Done. Thanks.
> >
> >
> > On Feb 25, 2008, at 2:19 PM, Dirk Frederickx wrote:
> >
> > > Good Point.
> > > I'll check if I can introduce some kind of max-width on the popup.
> > > Can you raise a JIRA issue for this ?
> > >
> > >
> > > dirk
> > >
> > > On Mon, Feb 25, 2008 at 3:03 PM, Steve Dahl <dahl@goshawk.com> wrote:
> > >> For long lists that contain long page names, the popup can grow large
> > >>  enough to clash with the editing area. I'm not sure what the right
> > >>  thing would be if the popup contains names that are too long to fit
> > >>  into the favorites block area, but it is an issue sometimes.
> > >>
> > >>
> >
> >
> >
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message