htmlArea

A directory of browser-based WYSIWYG editors

  MAIN
INDEX
SEARCH
POSTS
WHO'S
ONLINE
LOG
IN

Home: htmlArea 2: htmlArea 2 & 3 archive (read only): htmlArea v2.0 - Add-Ons:
This was LUIS response...however I need the final touch please


The htmlArea 2 & 3 editors have been discontinued.

We've made these forums available as a read-only reference and knowledge-base for people using or developing editors based on htmlArea 2 or 3.

Anyone who is interested in taking over version 2 or 3 is free to do so. All we ask is that you choose a new name that doesn't have "htmlarea" in it to avoid confusion with this site. We'll even give you a link in the directory to make it easier for people to find you. If you are developing or hosting an htmlArea based-editor under a new name, please submit it to our directory.

 


markulius99
Novice

Apr 8, 2004, 12:09 PM

Post #1 of 3 (3176 views)
Shortcut
This was LUIS response...however I need the final touch please Can't Post

SmileHi LUIS and everyone:
I remember asking Luis for a way to a open a specific file on load.

Part of Luis response was the following:
"..., modify openpage.html, using a hidden field instead of a file box.
<INPUT TYPE="hidden" NAME="filepath" SIZE="30" VALUE="C:\\yourdir\\yourfile.html"><BR>
Notice the slash(es) must be escaped(\\) in the file path.
"


This works perfectly fine, however. How can I invoke a variable which stores a path like VALUE=MYVARIABLE><BR> which can be declared in the HTMLAREA.HTML file? Can I use something like _editor_url variable?
You know hardcoding paths is something that I want to avoid.

I know that the _editor_url variable contains the path where the HTMLAREA files are located however. The scope of that variable is limited to the editor.js file. Of course, the variable doesn't exist in openpage.html

What should I do? I don't think using cookies is the best approach.

Can you help me Luis or anyone? I will kindly appreciate it

MARKULIUS


Luis
Veteran

Apr 8, 2004, 11:31 PM

Post #2 of 3 (3168 views)
Shortcut
Re: [markulius99] This was LUIS response...however I need the final touch please [In reply to] Can't Post

Hi Markulius:

1.- In editor.js, use the word window instead of editdoc as a reference for window.dialogArguments.

else if (cmdID.toLowerCase() == 'openfile') {
window.clipboardData.clearData();
editdoc.execCommand('SelectAll');
editdoc.execCommand('cut');
var myText = showModalDialog(_editor_url + "popups/openpage.html",window,"resizable: yes; help: no; status: no; scroll: no; ");
if (myText) { editor_insertHTML(objname, unescape( myText) );}
else editdoc.execCommand('paste');}


2.- Now, put in the page with your textarea the same hidden field you have in openpage.html. Make sure you give a name to your form (I will use myform in the example):

<INPUT TYPE="hidden" NAME="filepath" SIZE="30" VALUE="C:\\yourdir\\yourfile.html>

3.- In openpage.html, add the lines in red in function OpenFile:

function OpenFile( fileName, fileTypes ) {
opener = window.dialogArguments;
document.myform.filepath.value = opener.myform.filepath.value;
if (!fileName) return;
dots = fileName.split(".")


and in openpage.html too, take the filepath out of the hidden field
<INPUT TYPE="text" NAME="filepath" SIZE="30" VALUE="">

I've not tested it, but it should work.
Greetings.


Don't give up!!
http://webstationone.com/test/htmlarea


markulius99
Novice

Apr 14, 2004, 2:02 PM

Post #3 of 3 (3132 views)
Shortcut
Re: [Luis] This was LUIS response...however I need the final touch please [In reply to] Can't Post

Thanks Luis. It worked fine, I made some other changes:

_editor_url = ""; // URL to htmlarea files
var fileName=window.location.href.substring(window.location.href.lastIndexOf("/")+1,window.location.href.length); //NEW 04/14/04 It will be always htmlarea.html

var pathName=window.location.href.substring(window.location.href.indexOf("
file:///")+8,window.location.href.indexOf(fileName)); //NEW 04/14/04

var testFile="htmltest.html"; //NEW 04/14/04 My test file

_editor_urlTest = pathName + testFile; //NEW 04/14/04

_editor_field = "";

Then I modified the Body OnLoad
<BODY LEFTMARGIN="0" TOPMARGIN="0" MARGINWIDTH="0" onload="document.myform.filepath.value=_editor_urlTest;">

It works regardless where you install HTMLAREA

THANK YOU AGAIN!Smile

 
 
 


Search for (options)