• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: (WebKit) Encapsulate nodes around selected text
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (WebKit) Encapsulate nodes around selected text


  • Subject: Re: (WebKit) Encapsulate nodes around selected text
  • From: James Housley <email@hidden>
  • Date: Mon, 26 Sep 2005 13:30:40 -0400

Wolfgang Schreurs wrote:
I'm busy creating a WYSIWYG web editor. I want it to be easy for the
end user to use this application, so I'm creating a web editor that
looks/works like a text editor (i.e.: Nisus Writer, Word, etc...).

I have some difficulties in creating a method that encapsulates tags
around selected text. A user must be able to make a selection and
press a 'Bold' or 'Italic' button to transform the style. I figured I
should get a selection and the insert a tag before and after the
selection. I've tried using the DOM from Cocoa and from JavaScript
(with the [webview evaluateWebScript] method), but both without
succes.

The DOM model is quite new to me, so any help is greatly appreciated.

applyStyle: is what you want for this.

[web applyStyle:[web styleDeclarationWithText:@"font-weight: bold;"]];

Will either make a selection bold, or start bold typing if there is no selection.

Jim

--
/"\   ASCII Ribbon Campaign  .
\ / - NO HTML/RTF in e-mail  .
 X  - NO Word docs in e-mail .
/ \ -----------------------------------------------------------------
email@hidden      http://www.FreeBSD.org     The Power to Serve
email@hidden  http://www.TheHousleys.net
---------------------------------------------------------------------
"Eagles may soar, but weasels don't get sucked into jet engines"
    -- Anon

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >(WebKit) Encapsulate nodes around selected text (From: Wolfgang Schreurs <email@hidden>)

  • Prev by Date: updating a data file to a new version
  • Next by Date: Re: updating a data file to a new version
  • Previous by thread: (WebKit) Encapsulate nodes around selected text
  • Next by thread: updating a data file to a new version
  • Index(es):
    • Date
    • Thread