Ask a Question related to Macromedia Exchange Dreamweaver Extensions, Design and Development.
-
nicksapoet #1
Get REAL RAW selection in from dreamweaver.
Dreamweaver automatically gives you the whole node if you have part of the
inside of a tag selected. I want exactly what I have highlighted. I want a
result like this if this is what I have highlighted:
="anid">some text</d
NOT:
<div class="anid">some text</div>
The second is what dreaweaver defaults to, but I want to count the exact
number of characters highlighted or the number of characters in the entire
document, not just what is in the root node. In fact I'd like to not use the
DOM at all. Is there a way to just get a raw array of all the characters in
the document.
I'm using this code:
var theDOM = dw.getDocumentDOM();
var theWholeDoc = theDOM.documentElement.outerHTML;
var theSel = dreamweaver.getSelection(); // Extract the selection
var selText = theWholeDoc.substring(theSel[0],theSel[1]);
alert(selText);
Any help is much appreciated, this is very frustrating. In other words I
don't just want to get the selection by whole nodes, I want to get the
selection even if it starts halfway through one tag and ends halfway into
another. I want only what is selected.
Thanks,
Nick.
nicksapoet Guest
-
real player
how can i find the plug in real player for MX 2004 to put video on a page with rpm and smi -
real help needed
If any one can help with this or any help would be welcome This runs on a local server I would like to get it to work on a remote one. The... -
For real?!!
Any gamblers out there need Photoshop CS? http://link removed by forum host] Photoshop CS for $80.00 -
Will a webpage designed in Dreamweaver 4 be compatible with Dreamweaver MX?
Will a web page designed with Dreamweaver 4 and Fireworks 4 be compatible with the MX versions of Dreamwever and Fireworks? We have one PC with... -
Since when UNIX is the "real" system that runs the "real" machines?
*CROSS POSTED TO comp.unix.solaris In article <o3FNa.611731$vU3.43623@news1.central.cox.net>, David Janes <djanes@cox.net> wrote: Yes, Unix... -
nicksapoet #2
Re: Get actual selection from dreamweaver DOM.
Anyone have this problem?
nicksapoet Guest
-
Tom Muck #3
Re: Get REAL RAW selection in from dreamweaver.
Try this:
var dom = dw.getDocumentDOM();
var theSel = dom.source.getSelection();
var startPoint = theSel[0];
var endPoint = theSel[1];
alert(dom.source.getText(startPoint,endPoint));
It's a bit wordy for clarity, but that should get you what you want.
--
Tom Muck, Adobe Community Expert
Dreamweaver Extensions/Articles -- [url]http://www.tom-muck.com/[/url]
Cartweaver Development Team - [url]http://www.cartweaver.com/[/url]
Extending Knowledge Daily - [url]http://www.communitymx.com/[/url]
"nicksapoet" <webforumsuser@macromedia.com> wrote in message
news:f862sc$5li$1@forums.macromedia.com...> Dreamweaver automatically gives you the whole node if you have part of the
> inside of a tag selected. I want exactly what I have highlighted. I want
> a
> result like this if this is what I have highlighted:
>
> ="anid">some text</d
>
> NOT:
>
> <div class="anid">some text</div>
>
> The second is what dreaweaver defaults to, but I want to count the exact
> number of characters highlighted or the number of characters in the entire
> document, not just what is in the root node. In fact I'd like to not use
> the
> DOM at all. Is there a way to just get a raw array of all the characters
> in
> the document.
>
> I'm using this code:
>
> var theDOM = dw.getDocumentDOM();
> var theWholeDoc = theDOM.documentElement.outerHTML;
>
> var theSel = dreamweaver.getSelection(); // Extract the selection
> var selText = theWholeDoc.substring(theSel[0],theSel[1]);
> alert(selText);
>
> Any help is much appreciated, this is very frustrating. In other words I
> don't just want to get the selection by whole nodes, I want to get the
> selection even if it starts halfway through one tag and ends halfway into
> another. I want only what is selected.
>
> Thanks,
> Nick.
>
>
>
>
>
Tom Muck Guest
-
nicksapoet #4
Re: Get actual real selection from dreamweaver DOM.
Wow great Tom Muck, that worked well.
I think dreamweaver should add the source property to the extension help
section under: Objects, properties, and methods of the Dreamweaver DOM
Thanks again.
Nick Juntilla
nicksapoet Guest



Reply With Quote

