ColdEdge Posted February 15, 2011 Share Posted February 15, 2011 Hey. Ok I am need a bit of help. I am currently using TinyMCE. However I want to make my own basic editor. It doesn't have to update the contence inside of it; ex if you insert the picture the picture is show. I dont need this.What I need is say you click Image icon it uses javascript input to open a alert window, asking for the image url and after you click OK, it adds the image into the texteare as such [*img]....[*/img][*video]......[*/video][color=#313131]....[*/color][*b]..[*/b][*i]..[*/i][*url=http://....]title[*/url]...[code]This is about itP.S. No * for some reason the thing are not displayed properly Link to comment Share on other sites More sharing options...
justsomeguy Posted February 15, 2011 Share Posted February 15, 2011 How far have you gotten? Making a text editor like that is anything but "basic". Link to comment Share on other sites More sharing options...
ColdEdge Posted February 15, 2011 Author Share Posted February 15, 2011 I wana start, ^^ Link to comment Share on other sites More sharing options...
justsomeguy Posted February 15, 2011 Share Posted February 15, 2011 Do you know how to set up a button to open a prompt box? Link to comment Share on other sites More sharing options...
ColdEdge Posted February 15, 2011 Author Share Posted February 15, 2011 Yes, but I am not sure how to add the part to input the stuff into the textarea Link to comment Share on other sites More sharing options...
boen_robot Posted February 15, 2011 Share Posted February 15, 2011 Does the term DOM mean anything to you? If it does, keep reading, and if not, see W3Schools' tutorials on the subject...You can append stuff to the textarea's innerHTML as far as adding contents is concerned. If you want to add stuff around selection, that's a little trickier. See this and this for a taste of the pain.If you want to actually visualize the result in a TinyMCE like fashion (but visulize it along with the textarea, not instead of it), you can add an iframe, and refresh its contents on the onkeyup event, again by taking the current innerHTML of the textarea.(Seriously, this stuff is far from "basic", even on the "basic" level) Link to comment Share on other sites More sharing options...
jeffman Posted February 15, 2011 Share Posted February 15, 2011 I agree that messing around with text ranges is nasty work, not helped in the least by cross-browser differences. Link to comment Share on other sites More sharing options...
ShadowMage Posted February 15, 2011 Share Posted February 15, 2011 I agree that messing around with text ranges is nasty work, not helped in the least by cross-browser differences IE's refusal to conform.That's better. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.