Item3972: NatEditPlugin: Pressing H1 button should change current line to h1 tag

pencil
Priority: Normal
Current State: Closed
Released In:
Target Release: n/a
Applies To: Extension
Component: NatEditPlugin
Branches:
Reported By: TWiki:Main.PeterThoeny
Waiting For:
Last Change By: MichaelDaum
When I have the cursor on a line of text and press the H1 button I expect that the current line changes to H1. It is a bit surprising to have a new line opened with an H1 and highlighted default text.

-- TWiki:Main/PeterThoeny - 27 Apr 2007

No, this does not work like this. All button actions are configured by a triplet:
  • starting tag, e.g. <div style="text-align:center">
  • default content, e.g. Centered text
  • closing tag, e.g. </div>

When you highlight a part of the text, this selection will be used instead of the default content.

So in your use case, don't just type "some text" and then press h1 to expect it to become ---++ some text. Select the text first and then press h1 will work just perfect.

All buttons work like this: select some text, then press bold to get the selection bold. I'd prefer to leave it like it is.

-- TWiki:Main.MichaelDaum - 27 Apr 2007

Hmm, I find it more consistent to distinguish between operations that happen within a flow of text (bold, italic, monospaced, etc) and those that operate on line(s) of text (heading, bullets, verbatim).

For operations that happen within a flow of text:
  • If text is selected: Enclose text with markup
  • If text is not selected: Add markup with highlighted default text

For operations on line(s) of text:
  • If text is selected: Enclose text with markup
  • If text is not selected: Select current line, then do same action as above

-- TWiki:Main.PeterThoeny - 27 Apr 2007

Hm, I don't get away with this minimal amount of javascripth the current editor is using...

-- MichaelDaum - 27 Apr 2007

Long time fixed.

-- MichaelDaum - 02 Feb 2009

ItemTemplate edit

Summary NatEditPlugin: Pressing H1 button should change current line to h1 tag
ReportedBy TWiki:Main.PeterThoeny
Codebase
SVN Range TWiki-4.1.2, Fri, 27 Apr 2007, build 13539
AppliesTo Extension
Component NatEditPlugin
Priority Normal
CurrentState Closed
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn
Topic revision: r7 - 02 Feb 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