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:
Link popup with TARGET option


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.

First page Previous page 1 2 3 Next page Last page  View All


Benjamin
Staff


Mar 10, 2003, 6:20 PM

Post #51 of 74 (20766 views)
Shortcut
Re: [rthaller] Latest insert_link.html [In reply to] Can't Post

Hey Robert,

I don't think so... at least, not in the 'realtime' editor window. You could certainly add a little script to parse the outgoing information (in the editor_filterOutput() function) to add in the quotes, though.

The browser automatically removes the quotes. Kind of a pill.
Ben
interactivetools.com


jaygemson
New User

Mar 11, 2003, 3:09 AM

Post #52 of 74 (20752 views)
Shortcut
Re: [Benjamin] Latest insert_link.html [In reply to] Can't Post


In Reply To
> Removes the hyperlink from the document if you press "ok" with a blank URL

Blush I didn't realise the original even did that... nice work.

It didn't! Cool


phase
Novice

Mar 17, 2003, 7:45 AM

Post #53 of 74 (20672 views)
Shortcut
Re: [Benjamin] Href with target menu... [In reply to] Can't Post

hi benjamin,



what about the imagelink-feature? have you got some time for it? i need it sooo much ;-)


Benjamin
Staff


Mar 17, 2003, 1:02 PM

Post #54 of 74 (20664 views)
Shortcut
Re: [phase] Href with target menu... [In reply to] Can't Post

I haven't forgotten, don't worry! Smile

Okay. I will make time this week. Hopefully I can rustle something up by the end of the week, but no promises! :-)
Ben
interactivetools.com


Luis
Veteran

Mar 17, 2003, 6:16 PM

Post #55 of 74 (20654 views)
Shortcut
Re: [phase] Href with target menu... [In reply to] Can't Post

Hi Phase:
I'm repeating a previous posting that might help you, while Benjamin finishes the fix:

The command identifier 'createlink' works with images.
Maybe you can use two buttons, one for inserting link in images ('createlink') and another one to deal with text and targets 'insertlink', although inserting links in images doesn't allow Target attribute. I know it's not the ideal, but I think it's better than nothing, at least it solves part of the problem until everything can be integrated in one single function.
You can see it working at: http://www.webstationone.com/test/htmlarea/


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


phase
Novice

Mar 19, 2003, 4:21 AM

Post #56 of 74 (20607 views)
Shortcut
Re: [Luis] Href with target menu... [In reply to] Can't Post

hi Luis,

thanx for that, but i need the target attribute and i don't want to handle it by regex...
so i think i wait for the fix by Ben.

phase


Benjamin
Staff


Mar 23, 2003, 6:55 PM

Post #57 of 74 (20520 views)
Shortcut
Re: [phase] Href with target menu... [In reply to] Can't Post

Well, Here's an absolute first draft for image-link handling. I'm sure it's rife with bugs, and currently has no re-editing capabilities. I hesitate even putting it here, but I'm hoping that someone will take a look at the code, rip it apart and rewrite it. This might get someone started...

It only works if you actually select the image, not highlight it with surrounding text.

And sorry for the wait for even this much. To be honest, it proved to be a little trickier than I thought.

I figure the fact that it offers at least minimal image-linking support, so that's an improvement... perhaps. [I just know I'm going to regret posting this one... ;-) ]

I WILL make time this week to rewrite the whole thing and fix it all up. The code's getting just plain embarrassing! Blush
Ben
interactivetools.com

(This post was edited by Benjamin on Mar 23, 2003, 6:57 PM)
Attachments: editor.js (48.9 KB)


phase
Novice

Mar 24, 2003, 11:27 PM

Post #58 of 74 (20492 views)
Shortcut
Re: [Benjamin] Href with target menu... [In reply to] Can't Post

hi ben,

great work - its all i ever want.

phase


vinayras
Novice

Apr 1, 2003, 12:15 AM

Post #59 of 74 (20419 views)
Shortcut
Re: [phase] Href with target menu... [In reply to] Can't Post

Hello All:
For HTMLArea 3.0, checkout the hyperlink editing at

http://www.interactivetools.com/iforum/Open_Source_C3/htmlArea_v3.0_-_Alpha_Release_F14/Insert_%26_Edit_Hyperlink_P9160/

HTH

Vinay Yadav (vinayRas)
SANIsoft
Vinay Yadav (vinayRas)
SANIsoft
http://www.vinayras.com/


barry-hunter
Novice

Apr 10, 2003, 7:49 PM

Post #60 of 74 (20333 views)
Shortcut
Re: [vinayras] Href with target menu... [In reply to] Can't Post

I have taken Benjamin's code and i hope inproved it to allow editing of links around images.

For the techical minded: when an image is selected it is a ControlRange, but by converting to a TextRange we can apply a link to it in much the same as text.

This of course means that the HTML for the image is then seen in the Text box inside the Link dialog, which may frighten some users (which is one of the reasons for the htmlarea in the first place: to hide html).
For this reason I removed the textbox for the image, and instead just store its value in the javascript, so a valid link can be created again, but because this inproved version just links whatever is selected the box is now quite pointless, just edit the content in the main window!
(if you dont mind showing the text to the user then just dont bother with my insert_link.html file, its functionally identical to the standard one)

I hope this helps fellow developers, I would love to hear any feedback on the successes/failiers (;-) of getting this code to work (i use IE6)
Attachments: editor-insertlink.js (2.76 KB)
  insert_link.html (4.82 KB)


Benjamin
Staff


Apr 20, 2003, 3:12 PM

Post #61 of 74 (20264 views)
Shortcut
Re: [barry-hunter] Href with target menu... [In reply to] Can't Post

Brilliant, Barry. I plan on spending a happy hour later looking this over.

Am I right in thinking that with your fix, this new link popup now covers all of the original functionality of the built-in link popup window?

If so, I'm celebrating and buying a bottle of wine tonight. :-)
Ben
interactivetools.com


barry-hunter
Novice

Apr 21, 2003, 9:52 AM

Post #62 of 74 (20248 views)
Shortcut
Re: [Benjamin] Href with target menu... [In reply to] Can't Post

Hi Ben,

As far as i can tell it seems to offer the same functionality as the builtin dialog. (in fact if you look closely Microsofts version changes the selection to a TextRange if it is a image, ie a controlRange, in a similer manner)

I have attached an updated version of the javascript that fixs a minor bug when no text is selected. If no text was selected then it would find the still include the html code that surounded the cursor location, even though it didnt need to.

BArry

PS, if anybody is interested i have compleated making a version of htmlArea with a filemanager (using this updated link code) and a imagemanager. Both use the current link button and image button so that there is no need to include extra buttons, and both allow linking to a url or a uploaded file/image. I will upload the code soon (when i have had time to package it nicely)

PPS, save me a glass of wine!
PPPS the file should be attached below (forgot to click Upload Attachment, doh)


(This post was edited by barry-hunter on Apr 21, 2003, 11:28 AM)
Attachments: editor-insertlink-v2.js (2.81 KB)


Benjamin
Staff


Apr 21, 2003, 10:51 AM

Post #63 of 74 (20242 views)
Shortcut
Re: [barry-hunter] Href with target menu... [In reply to] Can't Post

Hey Barry -

Quick Q: did you attach the javascript fix to your original post (3 before this one?) - or did you forget to include it? (Just want to know I'll be looking at the right code).
Ben
interactivetools.com


matte8000
Novice

May 14, 2003, 7:01 PM

Post #64 of 74 (19939 views)
Shortcut
Re: [Quasibobo] Href with target menu... [In reply to] Can't Post

I am also having problems shoving a link into HTML area

I'm tryng this:


Code
     } else if (cmdID.toLowerCase() == 'createlinktotop') { 
var myHTML = "<a href=#top>Back to top</a>";
editor_insertHTML(objname, myHTML);
}



but it wont put just the "#top" in there, it puts in the entire url of the editor.
I dont want to have a pop-up, I just want to add this line to the bottom of the editor.
Is this possible?


Luis
Veteran

May 15, 2003, 12:40 AM

Post #65 of 74 (19933 views)
Shortcut
Re: [matte8000] Href with target menu... [In reply to] Can't Post

Hi matte 8000:

Everything is possible. Some things harder than others.

In addition to the function you created, try this out:

this at the end of the script

function cleanHTML(unclean)
{
unclean = unclean.replace(/<A HREF=[^>]*#top\">/gi, '<A HREF=\"#top\">');
return unclean;
}

in function editor_updateOutput(objname)
change this:

// get contents of edit field
var contents;
if (isTextarea) { contents = editor_obj.value; }
else { contents = editdoc.body.innerHTML; }

contents = cleanHTML(contents);

// check if contents has changed since the last time we ran this routine

and then...

// Switch to TEXTEDIT mode
if (mode == "textedit" || editor_obj.tagName.toLowerCase() == 'iframe') {
config.mode = "textedit";
var editdoc = editor_obj.contentWindow.document;
var contents = cleanHTML(editdoc.body.createTextRange().htmlText);
editor_obj.outerHTML = TextEdit;
editor_obj = document.all["_" +objname + "_editor"];
editor_obj.value = contents;
editor_event(objname);


The link will be updated the next time the editor switches to HTML Mode or when you submit the form.

Hope this be of help.

Ps. I will leave a test temporarily in my editor, so you can see the results before doing it. (Insert the link manually. I dont' have room for a button)

http://webstationone.com/test/htmlarea


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


(This post was edited by Luis on May 15, 2003, 12:51 AM)


matte8000
Novice

May 15, 2003, 3:45 AM

Post #66 of 74 (19924 views)
Shortcut
Re: [Luis] Href with target menu... [In reply to] Can't Post

Fantastic! Thats exactly what I wanted.

Thanks Luis!!

Cool


mikeyb101
Novice

Jun 4, 2003, 8:08 AM

Post #67 of 74 (19794 views)
Shortcut
Re: [Benjamin] Href with target menu... [In reply to] Can't Post


In Reply To
Again, here's the link to a demo page:
[link no longer valid...!]



Hi Benjamin, I know this is a blast from the past but: this works fine for me except when I submit the form the old "default" link editor window pops up and I have to cancel that box to get your form to insert into htmlArea otherwise it overides what I entered into your link editor pop-up. Does this make any sense? How can I stop the old pop up form popping up?

I've attached my files so someone can check it out if they're feeling kind Wink

Thanks

Mike


(This post was edited by Benjamin on Sep 18, 2003, 11:04 AM)
Attachments: editor.js (52.7 KB)
  insert_hyperlink.html (5.66 KB)


Tzvook
Novice

Jun 4, 2003, 10:29 AM

Post #68 of 74 (19787 views)
Shortcut
Re: [AtK] Href with target menu... [In reply to] Can't Post

Hi ATK

Didn't you posted (long ago) a modified image browser like html's browser?
I thought I saw it and now can't find it ...

======
Tzvook
======


AtK
User

Jun 5, 2003, 1:03 PM

Post #69 of 74 (19769 views)
Shortcut
Re: [Tzvook] Href with target menu... [In reply to] Can't Post

i didnīt post it becaue mine version was totally modified, i mailed you the "ground version" :-)

greetz
AtK


ebud
Novice

Aug 22, 2003, 12:31 PM

Post #70 of 74 (19299 views)
Shortcut
Re: [barry-hunter] Href with target menu... [In reply to] Can't Post

This is cool but I've got a little glitch I can't figure out...here goes

I'm having problems with the target= . I wanted to default it to _blank so I just moved the selected value to that option and removed the "default" option. Then code inside my insert_Link.html pop up looks like this:

<SELECT onchange="javascript: updateTarget();" name=target>
<OPTION value="_self">Same Page</OPTION>
<OPTION selected value="_blank">New Window</OPTION>
<OPTION value="_parent">Parent Frame</OPTION>
<OPTION value="_top">Top Frame</OPTION>
</SELECT>

The only problem is that the value is ignored if the option is set as "selected" - the traget=_Blank get completely skipped in the resulting HTML.

I had a look and there have been some problems with this, but I not clear that there is a solution?


brando
Novice

Aug 28, 2003, 1:17 PM

Post #71 of 74 (19254 views)
Shortcut
Re: [ebud] Href with target menu... [In reply to] Can't Post

Same issue for me except I would like "same window" to be defaulted, yet allow a change to a different target to occur. Right now all links are stuck as New Window. Any thoughts?
Thanks -
Brando
VtWebDesigners.com


(This post was edited by brando on Aug 28, 2003, 1:19 PM)


mars
New User

Jan 1, 2004, 6:20 AM

Post #72 of 74 (18115 views)
Shortcut
Re: [jaygemson] Latest insert_link.html [In reply to] Can't Post

Hi

I've got a real simple question .... from a real beginner ;-)

This link feature (_blank) .... where do I place the code?

// Mars, Copenhagen


Stanny
New User

Apr 1, 2004, 1:08 PM

Post #73 of 74 (17305 views)
Shortcut
Re: [barry-hunter] Href with target menu... [In reply to] Can't Post

Hi don't know whether this is the right place to post but after reading and downloading all your useful code the last piece of functionality that I needed was for my client to be able to browse the website that they were using the editor to maintain in order to be able to insert a link in the way that you can with, say Dreamweaver. i.e. to "browse" to another window containing their site, use the navigation to choose the internal page that they would like to link to and have the link box populated.

The solution was surprisingly simple (which is probably why nobody has posted it on here Smile)

I added this in the file insert_link.html after the selType drop down

<input type="button" onClick="javascript:openWindow('/cms/browse_for_local_url.html')" value="Browse Local Site" style="left: 18em; top: 1.0647em; width: 10em; height: 2.1294em; ">


openWindow() is a simple window opening function that you will probably all have in some form.

browse_for_local_url.html is a frameset page, the top frame which contains a button that calls a function in the parent frame, whilst the bottom frame src is the root of the site. The client simply browses the site and then presses the button in the top frame or closes the window, firing the onunload event handler, and the relative path is inserted.

Contents of browse_for_local_url.html

<html>
<head>
<TITLE>Close Window to Update URL in Text Box</TITLE>
<script language="JavaScript" type="text/javascript">
function updateURL() {
window.opener.document.getElementById('txtHREF').value = window.main.location.pathname;
window.close();
}
</script>
</head>
<frameset rows="40,*" frameborder="NO" border="0" framespacing="0">
<frame src="/cms/update_url.html" scrolling="NO">
<frame src="/" name="main" scrolling="AUTO">
</frameset>
</html>

Contents of update_url.html

<html>
<body onunload="parent.updateURL()">
<form>
<input type="button" value="Click to insert this page as a link" onclick="parent.updateURL()" style="font-family:arial">
</form>
</body>
</html>



It is as simple as that really!


old_thrashbarg
New User

Nov 25, 2004, 9:18 AM

Post #74 of 74 (15347 views)
Shortcut
Re: [Benjamin] Href with target menu... [In reply to] Can't Post

Hi to Benjamin, Barry and all the others, doing a great job on extending the features of htmlArea.

Based on your code I did a customized version of your "link with target" and had to do a change.
When wrapping <A>-Tag around a formatted text (i.e. <STRONG>MyText</STRONG>),
this worked on first access, but when trying to edit the link again, the fields in the popup stayed empty.

This was because of the code in the modified editor.js used the parentElement of the element on the cursor-position
and did then find the <STRONG>-Tag, not the <A>-Tag being around that one.

So I modified the editor.js like this:

original code (search for this in editor.js):
if (theRange.text != "") highlightedText = theRange.htmlText;
fullElement = theRange.parentElement().outerHTML;

modified to:
if (theRange.text != "") highlightedText = theRange.htmlText;
fullElement = theRange.parentElement();
while ( ( fullElement.tagName != "A" ) && ( fullElement.tagName != "BODY" ) ) {
fullElement = fullElement.parentElement;
}
if ( fullElement.tagName == "A" ) fullElement = fullElement.outerHTML;
else fullElement = "";

Maybe this is useful to someone else ...

With best wishes to all of you
old_thrashbarg

First page Previous page 1 2 3 Next page Last page  View All
 
 


Search for (options)