Edgewall Software

Ticket #1682 (reopened enhancement)

Opened 3 years ago

Last modified 4 months ago

wysiwyg wiki editor

Reported by: mlichman@… Owned by: jonas
Priority: normal Milestone: 2.0
Component: wiki system Version: 0.8.1
Severity: normal Keywords: wysiwyg editor
Cc: mjhweb-tractickets@…, dserodio@…, ttingey@…, panagiotis.korros@…, jeffhung@…, philip.tran@…, nick+trac@…, jens@…, daved@…, mbertier@…, sstarr@…, bryan@…, hw@…, felix@…, ellis@…, sromanow@…, rtimon@…

Description

Allow users to switch between wiki markup edit mode and a wysiwyg editor such as fckeditor ala seedwiki (http://www.seedwiki.com/wiki/online_teaching_and_learning_issues/online_teaching_and_learning_issues.cfm?wpid=&edit=yes&editorchoice=3)

Attachments

wikiwyg-0.5.zip (23.9 KB) - added by soloturn 3 years ago.
a first prototype to review the concept. save not implemented, convert to wiki not yet correct, seems not yet working in internet explorer
TraciWyg-0.5-py2.4.egg (39.0 KB) - added by soloturn 3 years ago.
traciwyg (wikiwyg) plugin integration example

Change History

Changed 3 years ago by mgood

This is an interesting idea, though it's a bit complicated since the WYSIWYG editors produce HTML output which would need translated back to Trac's Wiki syntax.

See the mailing list thread about this starting here: http://lists.edgewall.com/archive/trac/2005-June/003465.html

Changed 3 years ago by mgood

  • type changed from defect to enhancement
  • summary changed from switch between wysiwyg and wiki editor to wysiwyg wiki editor

In #2212 the reporter mentioned Wikiwyg which is a Javascript library that handles the WYSIWYG editing and translation of the editor contents to Wiki markup. It looks like it allows overriding of the markup rules for the Wiki syntax.

Wikiwyg is licensed under the LGPL, so some care would need to be taken in how it was integrated since the core of Trac is BSD licensed.

Changed 3 years ago by anonymous

  • cc mjhweb-tractickets@… added

Changed 3 years ago by barry.scott@…

The translation from HTML to Wiki has obviously been solved in the moin moin code.

Changed 3 years ago by dserodio@…

  • cc dserodio@… added

Changed 3 years ago by anonymous

  • cc ttingey@… added

Changed 3 years ago by anonymous

  • cc panagiotis.korros@… added

Changed 3 years ago by anonymous

  • cc jeffhung@… added

Changed 3 years ago by anonymous

  • cc philip.tran@… added

Changed 3 years ago by anonymous

  • cc nick+trac@… added

Changed 3 years ago by soloturn

added WysiWyg page to discuss implementation possibilities.

Changed 3 years ago by soloturn

a first prototype to review the concept. save not implemented, convert to wiki not yet correct, seems not yet working in internet explorer

Changed 3 years ago by soloturn

i added an attachment to show how it could look like. its not a plugin (don't know how to do that). its a svn diff against trunk, revision 3136.

Changed 3 years ago by soloturn

i forgot to mention that the edit-button is not overwritten. the wikiwyg edit only comes up if you double click on a wiki page.

Changed 3 years ago by cboos

  • keywords wysiwyg editor added
  • component changed from general to wiki

The patch you provided is a bit broken, as the added binary files are not in. I'd suggest that instead, you should:

  • provide a link to or attach a well identified wikiwyg release
  • provide a patch against the above if you modify/add something to wikiwyg
  • finally provide a patch against Trac with your 3 templates/*.cs files

Then, when the above is done, you're not far away to the point you could package that in a plugin.

From a superficial look in the .cs, only the addition of the id="wikipage" seems to require core Trac changes. If I understand correctly, this means that there can be only one wikiwyg per page, which seems a bit limitative (think Ticket edition, you have the comment and description textareas...).

That was for the form, then for the content. Well, I'm a bit afraid that the Wiki formatter has grown a bit too complex to be adapted by just filling the markupRules. This will certainly require a lot of work.

Changed 3 years ago by soloturn

the id="wikipage" is just an artificial restriction, because i just tried to extract a div tag which might be useful.

maybe you could take a look into mediawiki.js, functions media_wiki_init and klass.setup_wikiwyg_section? mediawiki has section edit and therefor must have solved this problem by default.

currently i just took trunk from http://svn.wikiwyg.net/code/trunk/wikiwyg/, r23, and flattened the lib,images, and css directories into the wikiwyg directory of the patch. but now that you say i think that was medium brilliant ;)

Changed 3 years ago by mgood

You don't need to add an id to the tag in order to get the DOM node. cssQuery is a convenient way to look up nodes using CSS-style selectors. You should be able to get the wiki editing fields like:

var wiki_editors = cssQuery("textarea.wikitext");

Changed 3 years ago by anonymous

the current approach is to double click on some text, and then you are able to edit it (if you are allowed to). then save, and you are done.

but class "wikitext" is on the textarea, AFTER somebody decided to edit (i.e. after clicking the edit button)?

Changed 3 years ago by anonymous

  • cc jens@… added

Changed 3 years ago by anonymous

  • cc daved@… added

Changed 3 years ago by soloturn

traciwyg (wikiwyg) plugin integration example

Changed 3 years ago by anonymous

thanks to alec i found now where to put the integration stuff. installation:

  1. put the plugin in a trac instance plugin dir
  2. apply the patch to trac-trunk
  3. restart trac

useage: double click on wiki text, e.g. double click into the main page.

i uploaded the integration demo plugin. wikiwyg-0.5.zip should be removed. integration is done via:

$ svk diff //trac-trunk //mirror/trac-trunk
=== templates/wiki.cs
==================================================================
--- templates/wiki.cs   (/trac-trunk)   (revision 53)
+++ templates/wiki.cs   (/mirror/trac-trunk)    (revision 53)
@@ -197,7 +197,7 @@
     if wiki.action == "preview" ?>
      <fieldset id="preview">
       <legend>Preview (<a href="#edit">skip</a>)</legend>
-      <div id="wikipage" class="wikipage"><?cs var:wiki.page_html ?></div>
+      <div class="wikipage"><?cs var:wiki.page_html ?></div>
      </fieldset><?cs
      elif wiki.action =="collision"?>
      <div class="system-message">
@@ -273,7 +273,7 @@
    </form>
   <?cs /if ?>
   <?cs if wiki.action == "view" ?>
-   <div id="wikipage" class="wikipage">
+   <div class="wikipage">
     <div id="searchable"><?cs var:wiki.page_html ?></div>
    </div>
    <?cs if:len(wiki.attachments) ?>

the following things are not solved:

  • save (not at all)
  • html - wiki convert (just partially)
  • image links for the buttons (are broken)

Changed 3 years ago by soloturn

uhm ... sorry. i did the diff in the wrong direction. the id=wikipage is the addition.

Changed 2 years ago by anonymous

  • cc mbertier@… added

Changed 2 years ago by anonymous

  • cc sstarr@… added

Changed 2 years ago by anonymous

  • cc bryan@… added

Changed 22 months ago by Holger Winkelmann <hw@…>

  • cc hw@… added

Changed 22 months ago by anonymous

  • cc felix@… added

Changed 21 months ago by ThurnerRupert

see also th:WikiWygPlugin

Changed 21 months ago by cboos

  • milestone set to 2.0

Leaving this open in order to document what should be improved in the WikiEngine so that interoperability with Trac plugins can be improved.

Changed 21 months ago by anonymous

I wanted to note that there is working plugin called TinyMceWikiPlugin. I managed to get it working on 0.9.3 (pay close attention to the included README, for it includes one critical instruction not found at the above link!), and it is usable. However it does more-or-less permanently mangle the clean wikitext of any page it edits, so may not be workable for some uses.

However my efforts to get TinyMceWikiPlugin working on 0.10.x failed. Apparently a patch is needed, and one has been built, but as documented here, all links to it seem to be empty.

C'est la vie. The WikiWygPlugin approach would be far better (it emits true wiki text), but it's still in the over, and probably won't finish baking for several months at least.

Changed 19 months ago by ellis@…

  • cc ellis@… added

Just wanted to CC myself, adding this comment to avoid spam detection.

Changed 18 months ago by sromanow@…

  • cc sromanow@… added

Changed 13 months ago by ThurnerRupert

  • status changed from new to closed
  • resolution set to fixed

works now nearly flawless with th:TracWysiwygPlugin. thanks to japanese jun66j5 quality :)

Changed 13 months ago by spstarr

  • status changed from closed to reopened
  • resolution fixed deleted

I would rather this not be closed unless this is an official merge into Trac?

Can someone confirm this is part of trac now or it will remain a trac-hack component?

Changed 4 months ago by rtimon@…

  • cc rtimon@… added

Add/Change #1682 (wysiwyg wiki editor)

Author



Change Properties
<Author field>
Action
as reopened
as The resolution will be set. Next status will be 'closed'
to The owner will change from jonas. Next status will be 'new'
 
Note: See TracTickets for help on using tickets.