Skip to main content
Email Password   helpLost your password?

Sample Image - articlehelp.jpg

Introduction

Here is a utility you may find useful when writing articles for the Code Project[^] offline. It should cut down on your HTML formatting time plus it will give you a preview all on the same page. As far as I know, it only works in Internet Explorer.

How to Use It

There are buttons on the left of the textarea that mimic the HTML insertion on the CP forums pages. I added p (<p></p>), br (<br>), space ( ), sup (<sup></sup>), sub (<sub></sub>), H2 (<H2></H2>) and img (<img src=...>) since articles may need them.

The textarea is where you type the article, of course.

The buttons below the textarea are for normal editing of the textarea except for the preview button. Preview will show you a close approximation of how the page will look in a <div> below the buttons.

Here is some code for the preview:

function ShowPreview()
{
    // replace div innerHTML content

    previewarea.innerHTML = '<table border=1 width=100 
        height=100% cellpadding=0 cellspacing=0><tr>
        <td valign=top align=left>' + Form1.inputarea.value 
        + '</td></tr></table>';
}
...
<button onclick="ShowPreview()" type="button">Preview</button>
...
<div name="previewarea" id="previewarea" style="WIDTH: 100%;
    HEIGHT: 300px; BACKGROUND-COLOR: #ffffff"></div>

Conclusion

This article was created in the Article Helper, so as you can see, it seems to work OK. I hope you find it helpful.

Most of this javascript code was shamelessly stolen from the Code Project's Reply To a Message page. I hope Chris doesn't mind...

Revision History

Version 1.1 Version 1.2 Version 1.3
You must Sign In to use this message board.
 
 
Per page   
 FirstPrevNext
Generalnot Firefox Pin
Michael Sync
0:23 6 Nov '06  
GeneralArticle Helper Earthquakes Pin
Dave Rapp
14:37 13 Dec '04  
GeneralRe: Article Helper Earthquakes Pin
Jason Henderson
17:47 13 Dec '04  
GeneralMissing Functionality Pin
Bassam Abdul-Baki
4:26 29 Jan '04  
GeneralRe: Missing Functionality Pin
Jeffrey Walton
21:19 16 Dec '06  
GeneralQuick question... Pin
BoozeBomb
5:42 4 Aug '03  
GeneralRe: Quick question... Pin
Jason Henderson
6:12 4 Aug '03  
GeneralRe: Quick question... Pin
BoozeBomb
8:19 4 Aug '03  
GeneralXHTML Pin
Thomas Freudenberg
23:23 9 Mar '03  
GeneralRe: XHTML Pin
Jason Henderson
6:04 4 Aug '03  
GeneralRe: XHTML Pin
Thomas Freudenberg
6:20 4 Aug '03  
GeneralRe: XHTML Pin
GilesHinton
22:11 11 May '07  
GeneralVersion 1.2 is not available for DL Pin
kbuchan
5:44 5 Mar '03  
GeneralRe: Version 1.2 is not available for DL Pin
Jason Henderson
5:50 5 Mar '03  
GeneralRe: Version 1.2 is not available for DL Pin
kbuchan
3:35 6 Mar '03  
GeneralRe: Version 1.2 is not available for DL Pin
Jason Henderson
4:00 6 Mar '03  
GeneralRe: Version 1.2 is not available for DL Pin
kbuchan
4:33 6 Mar '03  
GeneralRe: Version 1.2 is not available for DL Pin
Jason Henderson
11:50 11 Mar '03  
GeneralMe again! Pin
Marc Clifton
14:52 27 Feb '03  
GeneralRe: Me again! Pin
Jason Henderson
15:43 27 Feb '03  
GeneralRe: Me again! Pin
Marc Clifton
1:26 28 Feb '03  
GeneralRe: Me again! Pin
Chris Maunder
8:28 28 Feb '03  
GeneralRe: Me again! Pin
Jason Henderson
18:12 1 Mar '03  
GeneralRe: Me again! Pin
Jason Henderson
18:14 1 Mar '03  
GeneralAdded source code coloring Pin
Jonathan de Halleux
2:33 14 Feb '03  


Last Updated 9 Aug 2003 | Advertise | Privacy | Terms of Use | Copyright © CodeProject, 1999-2009