|
Hi,
I am building an editor for the web in Javascript. I need to force an action on a selection. This selectin may not have been made though e.g. you can select indent on highlighted code and just that gets highlighted, but if u press indent and no code is highlighted it should still ident the entire line. I need to be able to create a selection of the whole line iof there currently is no selection. i have managed to determine there is no selection, but i dont know how to then go and create a selection of the line we are currently on.
Anyone got any ideas?
Cheers
|
|
|
Well, I`ve done some things like this, and always ran into complicated cross-browser issues..however, I can recommend a source that can give you a lot of advanced code techniques to do what you want. In fact, this free tool may even be the web-editor tool you want to create anyway! I was building a tool for my clients to edit their web pages myself, until I found this sweet tool! It is called HTMLarea (no I have no affiliation whatsoever). Go to the website and check out the demo. I`m using this--there are no components to install. Just one big javascript include and a couple support HTML files.
http://www.interactivetools.com/products/htmlarea/
|
|
|
|
|
Cheers, but funnily enough - its htmlArea3 that i am developing further 
Andy
|
|
|
That`s funny! By the time you work out your code to work the way you want, the darn browser object model will change! ARGH! Well, good luck!
This whole Internet thing is just a phase anyway. I`m going to quit programming and open a taco stand. Who`s with me?! Anyone?! Anyone?!
|
|
|
|
|
|
|
|
|
|