Attached is a template that can be used in combination with TMCE.

Changes:
  • adds a button to switch between natedit and TMCE
  • fixes actionkeys for indent, undent etc (these were previously set to "1")
  • updates the tooltips of buttons to include their actionkey

Still some things to iron out though:
  • variable t should be set to a random value, instead of being passed along. For example Math.floor(Math.random()*10000000000);
  • the 'save and continue' that is performed before the switch does not seem to work yet

Files can be downloaded here:


Update

Ok, the code of the previous version was far too complicated. I discovered the world of hidden input fields, and reimplemented the switch between TMCE and natedit. I also added new button graphics and put the css inside a template such that it can be installed without changing any existing skins and files.

Description

This template is for use with TinyMCE in combination with NatEditContrib and adds a button to your toolbar which allows you to switch between the TinyMCE editor and plain-text edit. It is based on the Word template, but can easily be adapted to work with any other custom template.

Button graphics are taken from the directory defined by the NATEDIT_THEME setting. If this variable is not defined, they are taken from the directory 'default'. The switch is achieved by setting the hidden input field 'nowysiwyg', and by performing a 'Save and Continue'. Therefore, on each switch between WYSIWYG and plain-text edit, your topic is saved.

Installation

  • put contents of zip-file in your twiki-root
  • add 'wysiwyg.word.natedit' to your skin settings (i.e. Set SKIN = wysiwyg.word.natedit,word.natedit,nat)
  • the new zip-file can be downloaded here:


Update

See Item5181 for an enhancement that gives the user control over whether to start the editor in WYSIWYG mode or plain-text mode, while keeping the possibility to switch between both editors during editing.

ItemTemplate edit

Summary functionality to switch between natedit and TMCE
ReportedBy TWiki:Main.MarkVanHeeswijk
Codebase
SVN Range TWiki-4.3.0, Tue, 18 Dec 2007, build 16029
AppliesTo Extension
Component NatEditPlugin
Priority Enhancement
CurrentState Closed
WaitingFor
Checkins distro:eac03465e57e
TargetRelease n/a
ReleasedIn
I Attachment Action Size Date Who Comment
toggle_wysiwyg_files.zipzip toggle_wysiwyg_files.zip manage 6 K 29 Dec 2007 - 19:32 UnknownUser files implementing wysiwyg switch
toggle_wysiwyg_files_v2.zipzip toggle_wysiwyg_files_v2.zip manage 28 K 29 Dec 2007 - 22:41 UnknownUser wysiwyg toggle v2, including button graphics and readme.txt
Topic revision: r5 - 07 Jan 2009, MichaelDaum
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy