473,379 Members | 1,191 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Javascript for in-browser editor that shows line numbers?

There seem to be plenty of Javascript implemented WYSIWYG editors for
editing rich text in a web browser, but I haven't been able to find one
that shows line numbers. Even if that was the only enhancement over
the standard textarea object it would be great for my needs.

Does anyone know of such a widget?

Thanks,

-Carl Gundel, author of Liberty BASIC
http://www.libertybasic.com

Jan 5 '07 #1
1 3262
ca***@libertybasic.com skrev:
There seem to be plenty of Javascript implemented WYSIWYG editors for
editing rich text in a web browser, but I haven't been able to find one
that shows line numbers. Even if that was the only enhancement over
the standard textarea object it would be great for my needs.

Does anyone know of such a widget?
You could put your WYSIWYG editor in a div-element and use stylesheet
to style the line numbers:

<div class="editor-container">
<!-- Replace paragraphs with WYSIWYG editor -->
<p>text text</p>
<p>text text</p>
</div>

A stylesheet who works in IE, Opera and standards compliant browsers
could look like this:

<style type="text/css">
.editor-container { counter-reset: list-item; list-style-type:
decimal }
.editor-container p { margin: 0 2em; display: list-item }
</style>

A stylesheet who works in Firefox, Opera and standards compliant
browsers could look like this:

<style type="text/css">
.editor-container { list-style-type: decimal; counter-reset: item }
.editor-container p { margin: 0 2em; display: list-item;
list-style-type: none }
.editor-container p:before { content: counter(item) ". ";
counter-increment: item }
</style>

I can't figure out a way to make it work in both firefox and IE. You
might get better css code in a group like
comp.infosystems.www.authoring.stylesheets

In JavaScript you could use regular expression to put the sentenses in
a ordered list, or maybe just a bacground image to show line numbers.
If you have a limit numbers of lines, a background image could be the
easyest way. Then you would not need a widget.

Hope I have given you some clue.

Jan 5 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ronan | last post by:
Hi, I have a problem with a form using the PHP PEAR HTML_QuickForm package & javascript: I want to record the content of my form into a mySQL database then execute a javascript function. ...
30
by: Mason A. Clark | last post by:
If I use javascript on my page, how likely is it that the viewer will not have javascript? Anyone have data? Mason C
22
by: Mason A. Clark | last post by:
I am making a page that will depend on JavaScript. Is this a problem: the viewers' browser not running JavaScript? I did a quick survey of the top of one list of Top 500 web sites in popularity...
4
by: Martin Feuersteiner | last post by:
Dear Group I'm using VB to write an aspnet application. I would like to call a javascript function from within a VB Sub or VB Function, is it possible? My code is something like this: VB...
5
by: ANTISPAM_garycnew_ANTISPAM | last post by:
I am trying to create/update a Php Session with Javascript to confirm if users have Javascript enabled. My first thought was to create a Javascript that writes a script tag referencing a php...
8
by: | last post by:
The problem lies here eval("document.TeeForm.amt.value(S+M)"); S and M suppose to add up and the total suppose to appear on the AMT field but it didn't. Any help? ...
1
by: JumpingOffPlace | last post by:
Hi, I'm hoping that the wealth of knowledge here can stop me from spinning my wheels on this syntax error for hours. :) Below is the code, and the error I am recieving.... Code: <!DOCTYPE...
7
by: Roman | last post by:
I am wondering if anybody can provide statistics what is percentage of visitors with disabled JavaScript. Even more interesting would be statistics of users with disabled JavaScript making a...
3
by: crazystone82 | last post by:
Hi friends, i need to drag a file from desktop and drop into web page.actually i had did a JS for dragging the images around the web page,but i dont know how to drag the file and drop it into...
6
Frinavale
by: Frinavale | last post by:
Apparently I have a lot of questions today regarding JavaScript security. I've implemented a JavaScript Object that intercepts page submits (postbacks) and then displays a UI prompting the user...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.