htmlArea

A directory of browser-based WYSIWYG editors

  MAIN
INDEX
SEARCH
POSTS
WHO'S
ONLINE
LOG
IN

Home: htmlArea 3 (beta): htmlArea 2 & 3 archive (read only): htmlArea v3.0 - Add-Ons:
Asp image manager


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 Next page Last page  View All


frets
Novice

Aug 11, 2004, 7:53 AM

Post #1 of 30 (23565 views)
Shortcut
Asp image manager Can't Post

Have anyone made an image manager in asp?
I have an old one that works for v2.03, but i can't get it to work in v3.0


sdewitti
Novice

Aug 23, 2004, 8:04 AM

Post #2 of 30 (23479 views)
Shortcut
Re: [frets] Asp image manager [In reply to] Can't Post

I am also looking. Any luck yet?


kiwidownunder
New User

Aug 23, 2004, 4:26 PM

Post #3 of 30 (23468 views)
Shortcut
Re: [sdewitti] Asp image manager [In reply to] Can't Post

Hi,

I am also trying to get HTMLAREA 3 to work with some sort of Image Manager under ASP, IIS.

I have a HTMLAREA image manager for version 2 working under ASP/IIS6.0. I have tried to get this image manager which uses image preview using image stored on the hard drive to work with HTMLAREA 3 and have hit a brick wall.

So far I have edited the HTMLAREA.js file and changed the insert image html page to asp page by changing this line. Clicking on image button pops up insert_image.asp window

-------------------------------------------------------------------

this._popupDialog("../../popups/insert_image.asp", function(param) {
if (!param) { // user must have pressed Cancel
return false;

-----------------------------------------------------------------------

The insert_image.asp pop up window enables V2 image manager to do image browsing and i can get it to insert the image back into the HTMLAREA3 text area. BUT - the inserting of an image will only work in Internet Explorer. When I try this in Netscape or Mozilla I get a javascript error when I try to click on the image for previewing. I get the following javascript error for this section of code. It says el.tagName is blank or not an object or something like that.

HTMLArea.isBlockElement = function(el) {
var blockTags = " body form textarea fieldset ul ol dl li div " +
"p h1 h2 h3 h4 h5 h6 quote pre table thead " +
"tbody tfoot tr td iframe address ";
return (blockTags.indexOf(" " + el.tagName.toLowerCase() + " ") != -1);
};

----------------------------------------------------------------------------

After clearing the javascript pop up error window in Netscape I can insert the image into HTMLAREA3 textarea using Netscape but the image is inserted with no borders. In Internet Explorer an image will insert into HTMLAREA3 text area with borders and no javascript errors.

I am not strong in javascript but more an ASP/SQL server programmer and unfortunately cannot program with PHP otherwise I would use Xiang Wei Zhuo excellent version at http://www.zhuo.org/htmlarea/

I believe the problem is something to do with passing all the image parameters back to HTMLAREA3 correctly but I am not sure.

Has anybody tried anything similar in ASP with HTMLAREA3 or able to assist in what is causing the above javascript error in Netscape/Mozilla but not IE.

Michael


richmondgt
New User

Aug 23, 2004, 10:16 PM

Post #4 of 30 (23459 views)
Shortcut
Re: [frets] Asp image manager [In reply to] Can't Post

Download the following http://nukedit.com/content/Download.asp

They use htmlarea v3 and have a file manager linked to it for images.


frets
Novice

Sep 1, 2004, 4:15 PM

Post #5 of 30 (23296 views)
Shortcut
Re: Asp image manager [In reply to] Can't Post

If it can help, I've found out that the image manager I have for v.2.03 can be found here: http://www.interactivetools.com/iforum/Open_Source_C3/htmlArea_v2.0_-_Add-Ons_F19/MOD%3A_Browse_Image_Dialog_V2.0_%28.ASP%29_P5468

Can any one help me to convert it to v3? Or have an other image manager in asp?


gregoryhubbs
Novice

Sep 3, 2004, 2:25 PM

Post #6 of 30 (23233 views)
Shortcut
Re: [frets] Asp image manager [In reply to] Can't Post

My kingdom - or at least as much as this .COM can afford - for a solution for an .ASP interface to the V3 version. I have hit the same issues with Netscape. We already have an image gallery and file upload written in .asp, we just need an interface from the image popup (it looks like a direct call from HTMLAREA.JS might be impossible).

Thanks,

- Greg


gocher
Novice

Sep 22, 2004, 7:44 AM

Post #7 of 30 (22969 views)
Shortcut
Re: [frets] Asp image manager [In reply to] Can't Post

Here it is the ASP Image Manager!


plugins\InsertPicture\insert-picture.js

Code
// Insert Image plugin for HTMLArea 
// Original Author - Udo Schmal
//
// (c) www.Schaffrath-NeueMedien.de 2004
// Distributed under the same terms as HTMLArea itself.
// This notice MUST stay intact for use (see license.txt).

function InsertPicture(editor) {
var i18n = InsertPicture.I18N;
};

InsertPicture._pluginInfo = {
name : "InsertPicture",
version : "1.0",
developer : "Udo Schmal",
developer_url : "http://www.Schaffrath-NeueMedien.de/",
c_owner : "Udo Schmal",
license : "htmlArea"
};

HTMLArea.prototype._insertImage = function(image) {
var editor = this;
var outparam = null;
if (typeof image == "undefined") {
image = this.getParentElement();
if (image && !/^img$/i.test(image.tagName))
image = null;
}
if (image) outparam = {
f_url : HTMLArea.is_ie ? image.src : image.getAttribute("src"),
f_alt : image.alt,
f_border : image.border,
f_align : image.align,
f_vert : image.vspace,
f_horiz : image.hspace,
f_width : image.width,
f_height : image.height
};

var manager = _editor_url + 'plugins/InsertPicture/InsertPicture.asp';

Dialog(manager, function(param) {
if (!param) { // user must have pressed Cancel
return false;
}
var img = image;
if (!img) {
var sel = editor._getSelection();
var range = editor._createRange(sel);
editor._doc.execCommand("insertimage", false, param.f_url);
if (HTMLArea.is_ie) {
img = range.parentElement();
// wonder if this works...
if (img.tagName.toLowerCase() != "img") {
img = img.previousSibling;
}
} else {
img = range.startContainer.previousSibling;
}
} else {
img.src = param.f_url;
}

for (field in param) {
var value = param[field];
switch (field) {
case "f_alt" : img.alt = value; break;
case "f_border" : img.border = parseInt(value || "0"); break;
case "f_align" : img.align = value; break;
case "f_vert" : img.vspace = parseInt(value || "0"); break;
case "f_horiz" : img.hspace = parseInt(value || "0"); break;
case "f_width" : img.width = parseInt(value || "0"); break;
case "f_height" : img.height = parseInt(value || "0"); break;
}
}


}, outparam);
};

plugins\InsertPicture\InsertPicture.asp

Code
<% PicturePath = Request.ServerVariables("SERVER_NAME") & Request.ServerVariables("SCRIPT_NAME") 
PicturePath = "http://" + Replace(PicturePath, "/htmlarea/plugins/InsertPicture/InsertPicture.asp", "/Pictures/")
LocalPicturePath = Request.ServerVariables("APPL_PHYSICAL_PATH") & "Pictures\"
%>
<html>

<head>
<title>Insert Image</title>
<style type="text/css">
@import url(../../../htmlarea.css);
html, body {
background: ButtonFace;
color: ButtonText;
font: 11px Tahoma,Verdana,sans-serif;
margin: 0px;
padding: 0px;
}
body { padding: 5px; }
table {
font: 11px Tahoma,Verdana,sans-serif;
}
form p {
margin-top: 5px;
margin-bottom: 5px;
}
.fl { width: 9em; float: left; padding: 2px 5px; text-align: right; }
.fr { width: 6em; float: left; padding: 2px 5px; text-align: right; }
fieldset { padding: 0px 10px 5px 5px; }
select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
button { width: 70px; }
.space { padding: 2px; }

.title { background: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px;
border-bottom: 1px solid black; letter-spacing: 2px;
}
form { padding: 0px; margin: 0px; }
</style>

<script type="text/javascript" src="../../popups/popup.js"></script>

<script type="text/javascript">

window.resizeTo(400, 100);

function Init() {
__dlg_init();
var param = window.dialogArguments;
if (param) {
document.getElementById("f_url").value = param["f_url"];
document.getElementById("f_alt").value = param["f_alt"];
document.getElementById("f_border").value = param["f_border"];
document.getElementById("f_align").value = param["f_align"];
document.getElementById("f_vert").value = param["f_vert"];
document.getElementById("f_horiz").value = param["f_horiz"];
window.ipreview.location.replace(param.f_url);
}
document.getElementById("f_url").focus();
};

function onOK() {
var required = {
"f_url": "You must enter the URL"
};
for (var i in required) {
var el = document.getElementById(i);
if (!el.value) {
alert(required);
el.focus();
return false;
}
}
// pass data back to the calling window
var fields = ["f_url", "f_alt", "f_align", "f_border",
"f_horiz", "f_vert"];
var param = new Object();
for (var i in fields) {
var id = fields;
var el = document.getElementById(id);
param[id] = el.value;
}
__dlg_close(param);
return false;
};

function onCancel() {
__dlg_close(null);
return false;
};

function onPreview() {
var f_url = document.getElementById("f_url");
var url = f_url.value;
if (!url) {
alert("You have to enter an URL first");
f_url.focus();
return false;
}
window.ipreview.location.replace(url);
return false;
};

function CopyToURL(imgName) {
document.getElementById("f_url").value = imgName;
onPreview();
};

function openFile() {
window.open(document.getElementById("f_url").value,'','');
}
</script>

<%'FileSize
Function GetRealVolume(v)
If v<9000 Then
GetRealVolume = v & "Byte"
ElseIf v<9000000 Then
GetRealVolume = INT (v / 1024)& "kB"
Else
GetRealVolume = INT (v / 1048576)& "MB"
End If
End Function

%>
</head>

<body onload="Init()">

<div class="title">Insert Image</div>
<!--- new stuff --->
<table border="0" width="100%" style="padding: 0px; margin: 0px">
<tbody>
<tr>
<td>Images on the Server:<br>
<select value="" style="width:200" size="10" onClick="CopyToURL(this[this.selectedIndex].value);">

<% Set objFO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFO.GetFolder(LocalPicturePath)
Set objFiles = objFolder.Files
For Each file IN objFiles
Response.Write "<OPTION value=""" &PicturePath & file.Name & """>" & file.Name & " (" & GetRealVolume(file.Size) & sImgSize & ")</OPTION>"
Next%>

</select>

<form method="POST" action="upload.asp" enctype="multipart/form-data">
<input type="HIDDEN" name="Folder" value="<%=LocalPicturePath%>">
<input type="FILE" name="File" size="30"><br>
<input type="SUBMIT" value="Upload file" name="SUBMIT">
</form>

</td>
<td valign="center" width="200" height="230">
Image Preview:
<a href="#" onClick="javascript:openFile();"><img src="img/btn_open.gif" width="18" height="18" border="0" title="Open file in new window" /></a><br />
<iframe name="ipreview" id="ipreview" frameborder="0" style="border : 1px solid gray;" height="200" width="200" src=""></iframe>
</td>
</tr>
</tbody>
</table>

<form action="" method="get">
<table border="0" width="100%" style="padding: 0px; margin: 0px">
<tbody>

<tr>
<td style="width: 7em; text-align: right">Image URL:</td>
<td><input type="text" name="url" id="f_url" style="width:75%"
title="Enter the image URL here" />
<button name="preview" onclick="return onPreview();"
title="Preview the image in a new window">Preview</button>
</td>
</tr>
<tr>
<td style="width: 7em; text-align: right">Alternate text:</td>
<td><input type="text" name="alt" id="f_alt" style="width:100%"
title="For browsers that don't support images" /></td>
</tr>

</tbody>
</table>

<p />

<fieldset style="float: left; margin-left: 5px;">
<legend>Layout</legend>

<div class="space"></div>

<div class="fl">Alignment:</div>
<select size="1" name="align" id="f_align"
title="Positioning of this image">
<option value="" >Not set</option>
<option value="left" >Left</option>
<option value="right" >Right</option>
<option value="texttop" >Texttop</option>
<option value="absmiddle" >Absmiddle</option>
<option value="baseline" selected="1" >Baseline</option>
<option value="absbottom" >Absbottom</option>
<option value="bottom" >Bottom</option>
<option value="middle" >Middle</option>
<option value="top" >Top</option>
</select>

<p />

<div class="fl">Border thickness:</div>
<input type="text" name="border" id="f_border" size="5"
title="Leave empty for no border" />

<div class="space"></div>

</fieldset>

<fieldset style="float:right; margin-right: 5px;">
<legend>Spacing</legend>

<div class="space"></div>

<div class="fr">Horizontal:</div>
<input type="text" name="horiz" id="f_horiz" size="5"
title="Horizontal padding" />

<p />

<div class="fr">Vertical:</div>
<input type="text" name="vert" id="f_vert" size="5"
title="Vertical padding" />

<div class="space"></div>

</fieldset>
<br clear="all" />

<div style="margin-top: 5px; border-top: 1px solid #999; padding: 2px; text-align: right;">
<button type="button" name="ok" onclick="return onOK();">OK</button>
<button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
</div>
</form>
</body>
</html>

plugins\InsertPicture\lang\de.js

Code
// I18N constants 

// LANG: "de", ENCODING: UTF-8 | ISO-8859-1
// Sponsored by http://www.systemconcept.de
// Author: Holger Hees, <hhees@systemconcept.de>
//
// (c) systemconcept.de 2004
// Distributed under the same terms as HTMLArea itself.
// This notice MUST stay intact for use (see license.txt).

InsertPicture.I18N = {
"InsertPictureTooltip" : "Bild einfügen",
"Cancel" : "Abbrechen"
};

plugins\InsertPicture\img\btn_open.gif
create a littel image

plugins\InsertPicture\upload.asp

Code
<%@ Language=VBScript %> 
<!--#INCLUDE FILE="upload.inc"-->
<%
Dim Upload
Set Upload = GetUpload()
folderName = Upload("Folder").Value.String
fileName = Upload("File").filename
if fileName>"" then
Upload("File").Value.SaveAs foldername & filename
End if
Upload = Empty
Response.Redirect Request.ServerVariables("HTTP_REFERER")
%>

plugins\InsertPicture\upload.inc
get from PureASP


axek
New User

Sep 28, 2004, 7:04 PM

Post #8 of 30 (22875 views)
Shortcut
Re: [gocher] Asp image manager [In reply to] Can't Post

Gocher,

Nice work. There's a small bug in your code though.

The line in plugins\InsertPicture\InsertPicture.asp that says

var id = fields;

should be

var id = fields[i];

However, I suspect that it's not your bug but more this forum that's hiding the [i] due to it being the Italic command. (Change your post style to Plain Text Only next time.) There's possibly a few other spots, in your code, where that's happened too.


Cheers,
Axek.


(This post was edited by axek on Sep 29, 2004, 5:36 PM)


sdewitti
Novice

Sep 29, 2004, 12:50 PM

Post #9 of 30 (22840 views)
Shortcut
Re: [axek] Asp image manager [In reply to] Can't Post

Mine blows up on that line but I don't understand you comment about whats wrong. Both the orginal and the one you posted look the same. Help. I am so close.


axek
New User

Sep 29, 2004, 5:37 PM

Post #10 of 30 (22833 views)
Shortcut
Re: [sdewitti] Asp image manager [In reply to] Can't Post

Sorry,

When I edited my post, the Post Style automatically reverted to Markup. I've changed it back again. You should be able to see the difference now.

Regards,
Axek.


sdewitti
Novice

Sep 30, 2004, 7:01 AM

Post #11 of 30 (22820 views)
Shortcut
Re: [axek] Asp image manager [In reply to] Can't Post

That did it. MANY THANKSCoolCoolCool


frets
Novice

Oct 1, 2004, 9:07 AM

Post #12 of 30 (22769 views)
Shortcut
Re: [gocher] Asp image manager [In reply to] Can't Post

Thanks to gocher for making this great asp image manager.

I've edited a bit, so the preview resizes the picture, so it fits the preview window.
Although there is at small bug, that i've haven't found, but maybee some of you can. You have to choose the picture twice, for it to be resized.

And a working example: http://htmlarea.meioselia.dk/examples/test.html


(This post was edited by frets on Oct 1, 2004, 9:25 AM)
Attachments: InsertPicture.zip (6.10 KB)


turnercja
New User

Oct 4, 2004, 2:12 AM

Post #13 of 30 (22695 views)
Shortcut
Re: [frets] Asp image manager [In reply to] Can't Post

Just downloaded the file above but for some reason I keep getting a javascript error on line 52 of the insertpicture.asp file - full error is below...

line 52.
document.getElementById(...) is null or not an object.

Any ideas on correcting the problem would be great. I am using IIS6 with IE6, if that is of any use.


(This post was edited by turnercja on Oct 4, 2004, 2:14 AM)


sdewitti
Novice

Oct 12, 2004, 6:55 AM

Post #14 of 30 (22503 views)
Shortcut
Re: [frets] Asp image manager [In reply to] Can't Post

FRETS,

Your example URL does not seem to work at all for me. I see the editor but no resize no matter what I do. If you had any more luck. I think this would be a great help to this mod.

Shannon


gocher
Novice

Oct 13, 2004, 2:26 AM

Post #15 of 30 (22465 views)
Shortcut
Re: [frets] Asp image manager [In reply to] Can't Post

Hello,

at first You use the IE, on Mozilla my version looks fine!

function onPreview() {...
if (document.all) {
window.ipreview.location.replace('viewpicture.html?'+url);
} else {
window.ipreview.location.replace(url);
}
...

And now Your problem, in that moment the function imgResize() wants to get the Size of the image, the image is not loaded!
The following Code now for the IE.

viewpicture.html:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Preview</title>
<script language="JavaScript" type="text/javascript">
<!--
function imgWait(myImg) {
waiting = window.setInterval("imgIsLoaded(myImg)", 1000)
}
function imgIsLoaded(myImg) {
if(myImg.width > 0) {
window.clearInterval(waiting)
imgShowWidth(myImg)
}
}
function imgShowWidth(myImg) {
var width = myImg.width
var height = myImg.height
if(width > 180) {
var dx = (180 / width);
var dy = (180 / height);
ratio = dx < dy ? dx : dy;
// keep aspect ratio
width = width * ratio;
height = height * ratio;
myImg.width = width
myImg.height = height
}
myImg.style.visibility = 'visible'
}
function showPreview() {
img = document.location.toString().split("?");
var myImg = document.getElementById("myImg")
myImg.src = img[1];
img.onLoad = imgWait(myImg)
}
//-->
</script>
</head>
<body >
<div id="size"></div>
<img id="myImg" src="" Style="visibility:hidden">
<script language="JavaScript" type="text/javascript">
showPreview()
</script>

</body>
</html>
Attachments: viewpicture.html (1.11 KB)


ozinm
User

Oct 13, 2004, 4:57 PM

Post #16 of 30 (22420 views)
Shortcut
Re: [frets] Asp image manager [In reply to] Can't Post

Hi All,

I've downloaded .zip file and got it up and running but I'm having problems with the file upload.

when I hit the upload button I get the following error:
  • Error Type:
    Server object, ASP 0177 (0x800401F3)
    Invalid ProgID. For additional information specific to this message please visit the Microsoft Online Support site located at: http://www.microsoft.com/contentredirect.asp.
    /htmlarea/plugins/InsertPicture/upload.asp, line 2


Could someone give me some pointers on how to fix this?

Is there anything I need to install on the server to do uploads? I noticed in an earlier posting there was something about using scripts from Pure-ASP

In advance - Thanks for any and all help


gocher
Novice

Oct 15, 2004, 4:39 AM

Post #17 of 30 (22375 views)
Shortcut
Re: [ozinm] Asp image manager [In reply to] Can't Post

Hi all,

upload.asp must be changed to Your upload routine!

My original upload.asp looks like

<%@ Language=VBScript %>
<!--#INCLUDE FILE="upload.inc"-->
<%
Dim Upload
Set Upload = GetUpload()
folderName = Upload("Folder").Value.String
fileName = Upload("File").filename
if fileName>"" then
Upload("File").Value.SaveAs foldername & filename
End if
Upload = Empty
Response.Redirect Request.ServerVariables("HTTP_REFERER")
%>

But You can use the FileUpload from Motobit Software.
Download page:
http://www.motobit.com/help/scptutl/upload.asp
Download:
http://www.motobit.com/dlldownload/pASPUpl2.zip

Then Your Upload must looks like:
<%
Option Explicit
'Stores only files with size less than MaxFileSize

Dim DestinationPath
DestinationPath = Server.mapPath("UploadFolder")

'Using Pure-ASP file upload
Dim Form: Set Form = New ASPForm
%>
<!--#INCLUDE FILE="_upload.asp"-->
<%
Server.ScriptTimeout = 2000
Form.SizeLimit = &H100000

If Form.State = 0 Then 'Completted
Form.Files.Save DestinationPath
End If
Upload = Empty
Response.Redirect Request.ServerVariables("HTTP_REFERER")
%>


gocher
Novice

Oct 15, 2004, 5:00 AM

Post #18 of 30 (22373 views)
Shortcut
Re: [gocher] Asp image manager [In reply to] Can't Post

And now the tested corrected code with unique filenames

upload.asp:
<%
Option Explicit
'Stores only files with size less than MaxFileSize

Dim DestinationPath
'DestinationPath = Server.mapPath("UploadFolder")

'Create upload form
Dim Form: Set Form = New ASPForm %><!--#INCLUDE FILE="_upload.asp"--><%

Server.ScriptTimeout = 2000
Form.SizeLimit = &HA00000

If Form.State = 0 Then
DestinationPath = Form("Folder").Value.String
Dim File, DestFileName
For Each File In Form.Files.Items
If Len(File.FileName) > 0 Then
DestFileName = GetUniqueFileName(File.FileName, DestinationPath)
File.SaveAs DestinationPath & "\" & DestFileName
End If
Next
End If
Form = Empty
Response.Redirect Request.ServerVariables("HTTP_REFERER")

Dim gFS
Function GetUniqueFileName(FileName, DestPath)
if isempty(gFS) then Set gFS = CreateObject("Scripting.FileSystemObject")
Dim Counter, FullPath, NewFileName
Counter = 1
NewFileName = FileName

if gFS.FileExists(DestPath & "\" & NewFileName) then
Do
Counter = Counter + 1
NewFileName = Counter & "-" & FileName
Loop while gFS.FileExists(DestPath & "\" & NewFileName)
end if
GetUniqueFileName = NewFileName
End Function
%>
Attachments: upload.asp (1.14 KB)


doronca
New User

Nov 2, 2004, 5:44 AM

Post #19 of 30 (21941 views)
Shortcut
Re: [gocher] Asp image manager [In reply to] Can't Post

Hi all, Would someone be nice enough to pack the whole thing together and attach it to HTMLArea 3.0 for a first timer like me? Thanks. Sly


gocher
Novice

Nov 2, 2004, 7:27 AM

Post #20 of 30 (21926 views)
Shortcut
Re: [doronca] Asp image manager [In reply to] Can't Post

Hello Doronca,

put the files from the ZIP-file in to the folder
"HTMLArea\plugins\InsertPicture"

and insert the following two lines in your main file!

HTMLArea.loadPlugin("InsertPicture");
//...
editor.registerPlugin(InsertPicture);
Attachments: InsertPicture.zip (14.3 KB)


gocher
Novice

Nov 2, 2004, 8:52 AM

Post #21 of 30 (21917 views)
Shortcut
Re: [doronca] Asp image manager [In reply to] Can't Post

Hi doronca,

if you have the actual htmlArea Version it must looks like!

<html>
<head>
<title>Test InsertPicture plugin</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript">
_editor_url = "../";
_editor_lang = "en";
</script>

<!-- load the main HTMLArea files -->
<script type="text/javascript" src="../htmlarea.js"></script>

<script type="text/javascript">
HTMLArea.loadPlugin("InsertPicture");
function initDocument() {
var editor = new HTMLArea("editor");
editor.registerPlugin(InsertPicture);
editor.generate();
}
HTMLArea.onload = initDocument;
</script>

</head>

<body onload="HTMLArea.init();">
<h1>Test InsertPicture plugin</h1>

<textarea id="editor" style="height: 30em; width: 100%;"> </textarea>
</body>
</html>


ASPwiz
Novice

Dec 2, 2004, 10:33 AM

Post #22 of 30 (21110 views)
Shortcut
Re: [frets] Asp image manager [In reply to] Can't Post

Has anyone got a COMPLETE zip which wraps up all this functionality?? I just cannot get this working at all.

Can someone please help, this is so frustrating.


gocher
Novice

Dec 7, 2004, 1:23 AM

Post #23 of 30 (20912 views)
Shortcut
Re: [ASPwiz] Asp image manager [In reply to] Can't Post

Hello ASPwiz,

at Nov 2, 2004, 5:27 AM I send the complete ZIP-File to Doronca in this Forum. Two entries before, take that one!


webguy101au
New User

Dec 14, 2004, 5:01 AM

Post #24 of 30 (20604 views)
Shortcut
Re: [gocher] Asp image manager [In reply to] Can't Post

OK, I have got this working, well, almost...

when I have selected an image from the list and then click the OK button I get a javascript error...



line 76

char 5

object required

any ideas

Cheers

Neil


yeadongroup
New User

Jan 17, 2005, 3:05 AM

Post #25 of 30 (19473 views)
Shortcut
Re: [webguy101au] Asp image manager [In reply to] Can't Post

I am also getting an error from insert-picture.js on line 69. I have tried debugging it and from what I can tell the "img" object is null the first time that you select an image and insert it into the htmlarea.

The error happens on the f_alt switch shown below. This is from the previous post with the zip file containing the complete image upload plugin.

Code
 switch (field) {  
case "f_alt" : img.alt = value;break;
case "f_border" : img.border = parseInt(value || "0"); break;
case "f_align" : img.align = value; break;
case "f_vert" : img.vspace = parseInt(value || "0"); break;
case "f_horiz" : img.hspace = parseInt(value || "0"); break;
case "f_width" : img.width = parseInt(value || "0"); break;
case "f_height" : img.height = parseInt(value || "0"); break;
}





Does anyone know how to prevent this error in IE6?

update: I was able to fix this error by wrapping if (img) {....} around the block of code above. This doesn't seem to have caused any problems with the functionality so I guess that should be all that's needed. although I have a feeling that this code gets triggered when it shouldn't be so there might be a better solution elsewhere in the code.



(This post was edited by yeadongroup on Jan 17, 2005, 3:55 AM)

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


Search for (options)