[ / / / / / / / / / / / / / ] [ dir / random / 93 / biohzrd / hkacade / hkpnd / tct / utd / uy / yebalnia ]

/prog/ - Programming

Programming
Name
Email
Subject
REC
STOP
Comment *
File
Password (Randomized for file and post deletion; you may also set your own.)
Archive
* = required field[▶Show post options & limits]
Confused? See the FAQ.
Options

Allowed file types:jpg, jpeg, gif, png, webp,webm, mp4, mov
Max filesize is16 MB.
Max image dimensions are15000 x15000.
You may upload5 per post.


File: 1451330733539.png (348.7 KB,540x396,15:11,12391045_847259475371410_1….png)

1a6620 No.3775

I need help. I am working on a text editor for mobile and its a hybrid app, so its made with web technology. Everything is fine and all until I want to make a button that bolds future text, kind of like in Word. But I can only find one that makes everytext in the text area bold. This is not what I want. I cant find any help on how to do this in Javascript/Jquery on the internet.

This is what I have with jquery and jquery mobile:

$("#bold").on("tap",function(){

$(".editor").toggleClass("bold");

});

It makes every text in the editor bold. I want to make only future text bold.

Can someone help me?

Thank you

____________________________
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

1a6620 No.3777

>text editor

>bold

well you're off to a bad start.

In order to do this, you can't have a single text area. when the user clicks bold you need to add a new DOM element with a bold style, and you need to handle mouse-clicks, arrow movement, selections, etc., to make your dense list of DOM elements function like a single area. it's a tremendous amount of work for literally no payoff: your users would be just as happy typing [b]blah[/b]

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

1a6620 No.3778

>>3777

Ahh so what your saying is when a user clicks the bold button, I'll need to replace the text area in the background? That sounds like a lot of extra work but nothing too bad to be honest.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.



[Return][Go to top][Catalog][Nerve Center][Random][Post a Reply]
Delete Post [ ]
[]
[ / / / / / / / / / / / / / ] [ dir / random / 93 / biohzrd / hkacade / hkpnd / tct / utd / uy / yebalnia ]