Jump to content
Sign in to follow this  
straider

HTMLArea v3.0

Recommended Posts

I finally got it working.

Thanks for the part about "htmlarea.js"!!!.

 

But...(yes there is always a but) it only works for my default language in categories.php.

I work with 3 languages.

I can see and use the editor in all languages.

But when I save the product... only my default language is updated...

 

Does anyone have a clue?

Am I missing something?

Does it only work for the default language?

 

Thanks,

Alex

Share this post


Link to post
Share on other sites

lazylex,

 

I only use one language (Portuguese) so I have not seen that bug. But if everything else is correct, I think it has to do with the onload="HTMLArea.replaceAll()" on the BODY tag. Try using HTMLArea.replace("id") -- pass the id attribute of your textarea, not the name attribute.

 

I remember something about replacing all textarea fields in one page on the official forum for HTMLArea, and when some free time becomes available I'll look into that. In the meantime, try to search for an answer on the official forum.

 

It should work, because if you try this example and then click on submit button you will get both field values.


Contributions:

. Browse by Categories

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

Jos? Carlos Monteiro - DoWeDo-IT

Share this post


Link to post
Share on other sites

Thanks for your post Straider.

 

But I' am not sure what to use for the ID in HTMLArea.replace("id").

Could you give me any suggestions?

 

Thanks,

Alex

Share this post


Link to post
Share on other sites

lazylex,

 

Try to patch the code following this bug report, at http://sourceforge.net/tracker/index.php?f...750&atid=525656

since it may be the cause of the bug you report. I've not tested it yet, and as soon as I can I'll try out the new 3.0-RC1 of HTMLArea.

 

There are several bugs that requiring fix, such as popups under Mozilla and loading PlugIns. The new version doesn't require code changes in htmlarea.js anymore, since variables can be set with the URL for the editor and the default language. It should also include several bug fixes, but I've not tested it yet.

 

Now, answering your question, when you code a textarea field you use

<textarea name="<name>" id="<id>" width="100%" height="200"></textarea>
or 
<textarea name="<name>" id="<id>" rows="12" cols="36"></textarea>

where <name> can be 'description' and <id> can be 'en' or 'sp' or 'de' or 'pt',

and that ID is the one you must use in the HTMLArea.replace function.

 

Hope this helps.


Contributions:

. Browse by Categories

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

Jos? Carlos Monteiro - DoWeDo-IT

Share this post


Link to post
Share on other sites

Straider,

 

This helped a lot.

I made a change in "htmlarea.js" and now....it works.

 

Find in "htmlarea/htmlarea.js"

 

if (textarea.form) {
 // we have a form, on submit get the HTMLArea content and
 // update original textarea.
 textarea.form.onsubmit = function() {
	 editor._textArea.value = editor.getHTML();
 };
}

 

Replace with

 

	if (textarea.form) {
 // we have a form, on submit get the HTMLArea content and
 // update original textarea.
 var fn=textarea.form.onsubmit;
 textarea.form.onsubmit = function() {
	 editor._textArea.value = 
editor.getHTML();
	 if(fn) {
   fn();
	 }
 };
}

 

This did it for me....

Also don't forget to change in htmlarea.js on line 49 to point at the right dir. But that was dicussed before...

 

Thanks again Straider.

Alex

Share this post


Link to post
Share on other sites

Hi Straider,

 

I need a bit of help with syntax. I have header tags controller installed and replaceAll() is putting the editor on all the controller text boxes. I want to just have the editor show on the product description box. Here is the line from the products description box:

<td class="main"><?php echo tep_draw_textarea_field('products_description[' . $languages[$i]['id'] . ']', 'soft', '100%', '20', (isset($products_description[$languages[$i]['id']]) ? $products_description[$languages[$i]['id']] : tep_get_products_description($pInfo->products_id, $languages[$i]['id']))); ?></td>

 

I have tried using this line:

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus(); HTMLArea.replace(products_description[' . $languages[$i]['id'] . '])">

 

with no joy. Tried placing just products_description and some other combinations of surrounding them with '' and " . product_description . " .. etc also with no joy.

Can you give me a heads up on the proper syntax?

 

TIA,

 

Chris

Share this post


Link to post
Share on other sites

Hello!

 

I am trying to get the contrib to work. Everything works fine only I cannot upload files and make folders. i get the error msg "The file/folder xy could not be created".

 

I installed the contrib on my phpdev server and it worked fine, but when i uploaded and configured the thing on my webhosting provider the problem appeared. (i tried chomdding the whole catalog folder to 777 but no success).

 

Do i need any special plugins on the apache server that are included in the phpdev apache install but are not on the Apache linux(apache 2.0.4, php version 4.3.4) version?

 

Which function is used for creating files and folders?

 

Can anyone help?

 

thanks

Share this post


Link to post
Share on other sites

Chris_C,

 

I don't know how tep_draw_textarea_field uses the first argument, but what you need to pass to the HTMLArea.replace function is the ID for the TextArea Field, it doesn't work with the NAME tage of a TextArea Field.

 

I've been trying to avoid onload="...; HTMLArea.replace" functions, but without success so far. I don't have much spare time in my hands to apply thos this contribution, at the moment.

 

Try passing the value 'products_description[' . $languages[$i]['id'] . ']' or just products_description[' . $languages[$i]['id'] . '], because the value you should aim at using is the product description that depends on the language selected by the visitor. There's another piece of code, that for what I understand should be added at the end of HTML source code. Try it out:

<script type="text/javascript" defer="1">
   HTMLArea.replace('<ID_1>');
   HTMLArea.replace('<ID_2>');
...
   HTMLArea.replace('<ID_N>');
</script>

where ID_1, ID_2, ... and ID_N are the TextArea Field IDs that you want to replace indeed.

 

Hope this helps.


Contributions:

. Browse by Categories

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

Jos? Carlos Monteiro - DoWeDo-IT

Share this post


Link to post
Share on other sites

hubert97,

 

I'm not aware of anyone that uses STS and HTMLArea, but I see no reasons that could prevent this module to work under STS. As long as a regular TextArea field works and htmlarea can replace them, everything should work fine.

 

If you can't see the button images, that's a problem that has been reported and fixed on this topic thread. Please review this post .

 

Try out and report back, please.


Contributions:

. Browse by Categories

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

Jos? Carlos Monteiro - DoWeDo-IT

Share this post


Link to post
Share on other sites

djuk,

 

I'm not aware of any file/folder functions that could cause such problem.

 

Please, go through the official HTMLArea Forum and see if someone else has a better understanding of HTMLArea. I just packaged it nicely for osCommerce, that's all.

 

Sorry for not helping much...


Contributions:

. Browse by Categories

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

Jos? Carlos Monteiro - DoWeDo-IT

Share this post


Link to post
Share on other sites

hi i m under a MS1 version

i try to use htmlarea on the contribution article manager ...

i can see taht in the article.php , i got htmlarea from a distant server used ( http://www.ewine.ie/2.2/htmlarea/) :

 

my htmlarea folder is palced locally here :

C:\Program Files\EasyPHP\www\rc\admin\htmlarea\

 

here is what i tought i have to do :

 

replace that :

 

<!-- Adding HTMLArea - iPLANIT Change -->
<!-- ---------------------------------------------------------------------- -->
<!-- START : EDITOR HEADER - INCLUDE THIS IN ANY FILES USING EDITOR -->
<script language="Javascript1.2" src="http://www.ewine.ie/2.2/htmlarea/editor.js"></script>
<script>
// set this to the URL of editor direcory (with trailing forward slash)
// NOTE: _editor_url MUST be on the same domain as this page or the popups
// won't work (due to IE cross frame/cross window security restrictions).
// example: http://www.hostname.com/editor/

_editor_url = "http://www.ewine.ie/2.2/htmlarea/";
</script>
<style type="text/css"><!--
 .btn   { BORDER-WIDTH: 1; width: 26px; height: 24px; }
 .btnDN { BORDER-WIDTH: 1; width: 26px; height: 24px; BORDER-STYLE: inset; BACKGROUND-COLOR: buttonhighlight; }
 .btnNA { BORDER-WIDTH: 1; width: 26px; height: 24px; filter: alpha(opacity=25); }
--></style>
<!-- END : EDITOR HEADER -->
<!-- ---------------------------------------------------------------------- -->
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<script language="javascript" src="includes/general.js"></script>

 

with that , but it doesnt load :

 

<!-- Adding HTMLArea - iPLANIT Change -->
<!-- ---------------------------------------------------------------------- -->
<!-- DWD Modify -> Add: HTMLArea v3.0 !-->
   <!-- Load HTMLArea Core Files. !-->
   <script type="text/javascript" src="htmlarea/htmlarea.js"></script>
   <script type="text/javascript" src="htmlarea/dialog.js"></script>
   <script type="text/javascript" src="htmlarea/lang/en.js"></script>

   <!-- Load HTMLArea Plugins. !-->
   <script type="text/javascript">
     HTMLArea.loadPlugin("TableOperations");
     HTMLArea.loadPlugin("SpellChecker");
   </script>

   <!-- Load HTMLArea StyleSheet. !-->
   <style type="text/css">
     @import url(htmlarea/htmlarea.css);
   </style>
   <!-- DWD Modify End. !-->

<!-- ---------------------------------------------------------------------- -->
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<script language="javascript" src="includes/general.js"></script>

 

where is my mistake ?


MS2

Share this post


Link to post
Share on other sites

well after struggling for hours even if it seems easy here are my solution :

 

first u got to no hwhere i placed my htmlarea :

C:\Program Files\EasyPHP\www\rc\admin\htmlarea\

 

second i dit my test for a file taht is used from the admin part , so here are my change :

 

repalced :

<!-- Adding HTMLArea - iPLANIT Change -->
<!-- ---------------------------------------------------------------------- -->
<!-- START : EDITOR HEADER - INCLUDE THIS IN ANY FILES USING EDITOR -->
<script language="Javascript1.2" src="http://www.ewine.ie/2.2/htmlarea/editor.js"></script>
<script>
// set this to the URL of editor direcory (with trailing forward slash)
// NOTE: _editor_url MUST be on the same domain as this page or the popups
// won't work (due to IE cross frame/cross window security restrictions).
// example: http://www.hostname.com/editor/

_editor_url = "http://www.ewine.ie/2.2/htmlarea/";
</script>
<style type="text/css"><!--
.btn   { BORDER-WIDTH: 1; width: 26px; height: 24px; }
.btnDN { BORDER-WIDTH: 1; width: 26px; height: 24px; BORDER-STYLE: inset; BACKGROUND-COLOR: buttonhighlight; }
.btnNA { BORDER-WIDTH: 1; width: 26px; height: 24px; filter: alpha(opacity=25); }
--></style>
<!-- END : EDITOR HEADER -->
<!-- ---------------------------------------------------------------------- -->
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<script language="javascript" src="includes/general.js"></script>

 

by

-- DWD Modify -> Add: HTMLArea v3.0 !-->
   <!-- Load HTMLArea Core Files. !-->
   <script type="text/javascript" src="htmlarea/htmlarea.js"></script>
   <script type="text/javascript" src="htmlarea/dialog.js"></script>
   <script type="text/javascript" src="htmlarea/lang/en.js"></script>

   <!-- Load HTMLArea Plugins. !-->
   <script type="text/javascript">
     HTMLArea.loadPlugin("TableOperations");
     HTMLArea.loadPlugin("SpellChecker");
   </script>

   <!-- Load HTMLArea StyleSheet. !-->
   <style type="text/css">
     @import url(htmlarea/htmlarea.css);
   </style>
   <!-- DWD Modify End. !-->

 

2. changed

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">

 

by

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="HTMLArea.replaceAll()">

 

3. changed :

<?php echo tep_draw_textarea_field('articles_description[' . $languages[$i]['id'] . ']', 'soft', '70', '15', TEXT_DEFAULT_DESCRIPTION ); ?>

 

by

<?php echo tep_draw_textarea_field('articles_description[' . $languages[$i]['id'] . ']', 'soft', '100%', '20', TEXT_DEFAULT_DESCRIPTION ); ?>

 

4.

<?php echo tep_draw_textarea_field('articles_description[' . $languages[$i]['id'] . ']', 'soft', '70', '15', (($articles_description[$languages[$i]['id']]) ? stripslashes($articles_description[$languages[$i]['id']]) : tep_get_articles_description($pInfo->articles_id, $languages[$i]['id']))); ?>

 

by

<?php echo tep_draw_textarea_field('articles_description[' . $languages[$i]['id'] . ']', 'soft', '100%', '20', (($articles_description[$languages[$i]['id']]) ? stripslashes($articles_description[$languages[$i]['id']]) : tep_get_articles_description($pInfo->articles_id, $languages[$i]['id']))); ?>

 

5. edited C:\Program Files\EasyPHP\www\rc\admin\htmlarea\htmlarea.js

this.editorURL = "";

changed by

this.editorURL = "[B]htmlarea/[/B]";

 

as you can see i dint like in the frist post and instruction written the first /

 

i hope it can help u guys , and that it would be same rules for editing a file called by the catalog part like contact_us.php ( if some got same instruction to share)

 

by the way i f i see any bugs i ll try to edit or to tell it here ...


MS2

Share this post


Link to post
Share on other sites

can someone tells me if hge manage to insert an image and some cells ?

thay show when i edit the text , but when i submit , nothing execpet old text is shown, no image and no cells !


MS2

Share this post


Link to post
Share on other sites

by the way looking for instructions i found

HTML WYSIWYG Editor for Product Desc, MS1 2.2

http://www.oscommerce.com/community/contributions,1279

 

it s based on htmlArea v2.02

 

ill maybe try to see how we can upgraded it to version 3 , maybe someone tried already

i now this contribution is now continued but for the MS2 version

 

to be continued .


MS2

Share this post


Link to post
Share on other sites

straider u said :

Bare in mind that I'm still using osCommerce 2.2 MileStone 2, there may be some files that differ from this list in newer milestones.

 

didnt u rather wanted to say osCommerce 2.2 MileStone 1 ?


MS2

Share this post


Link to post
Share on other sites

azer,

 

I don't use Article Manager, so I don't know much about it.

 

What seems to be the problem with the image and cells? I'm thinking it may have to do with the way the value for the textarea is handled by Article Manager, maybe it strips the html tags or something.

 

I appreciate your input about adding the contribution to Article Manager, and I'm sure others find it very useful as well. I expect others to post here their tips and tricks about using HTMLArea 3.0.

 

Thanks.


Contributions:

. Browse by Categories

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

Jos? Carlos Monteiro - DoWeDo-IT

Share this post


Link to post
Share on other sites

This contrib isn't just good - it simply kicks-ass!

 

manymanymany thanks to the guy that posted it here (wouldn't have found it myself somewhere else i think...) and much more to the Mihai Bazon whos responsible for html-area!!!

 

 

GREAT STUFF!

Share this post


Link to post
Share on other sites

I install ALL the contribution "good" but i have ONLT 2 error in the admin area.

 

1 - When you try to add a NEW PRODUCTS the screen put in white or blank.

 

2 - When I click in "Define Mainpage" i have an error page like these http://www.rapicompra.com/catalog/admin/FI...DEFINE_MAINPAGE

 

If you can HELP me with these I appreciate too much!! :-)

 

Best Ragards

Fuad Hazboun

www.rapicompra.com


Peace and Love for all...

Share this post


Link to post
Share on other sites

Hi All, I am running osc 2.2 on linux-fedora-core-1 and Mozilla 1.41. The osc is locate on the webroot doc folder and the htmlarea 3.0 is located is below that ----> var/www/html/htmlarea . I edited the var/www/html/admin/categories.php according to the instruction or maybe I messed it up along the way.

 

The problem I have is the wysiwug tool bar graphic icon is not show seem like it is point to the wrong folder --> http://localhost/admin/images/ed_indent_less.gif

it should point to here --->http://localhost/htmlarea/images/ed_indent_less.gif

How do I change or fix this?

 

Thanks in advance for your help.

Share this post


Link to post
Share on other sites

Tranbo,

 

What are your settings for \htmlarea\htmlarea.js?

Do you have it set as default

this.editorURL = "";

or have you changed it to

this.editorURL = "/htmlarea/";

Hope this helps.


Contributions:

. Browse by Categories

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

Jos? Carlos Monteiro - DoWeDo-IT

Share this post


Link to post
Share on other sites

Thanks Straider, I changed the

this.editorURL = "";

to

this.editorURL = "/htmlarea/";

and it work great. The final code look like this.

// style included in the iframe document
this.pageStyle = "body { background-color: #fff; font-family: verdana,sans-serif; }";
if (typeof _editor_url != "undefined") {
 this.editorURL = _editor_url;
} else {
 this.editorURL = "/htmlarea/";
}

// URL-s
this.imgURL = "images/";
this.popupURL = "popups/";

Thanks a lot Straider.

Share this post


Link to post
Share on other sites

Ay - ay - ay

 

I just added this HTMLArea feature into categories.php meeting lots of enthousiasm.

Anyway I ran into unexpected trouble for wich I cant seem to find a solution :s

 

HTMLArea is well working except for the fact that the product alteration function doesnt handle more than 1 language.

Since my cli?nts site uses 4 languages this is really neccesary.

So in short: when editing everything works, but when I click the preview button I can see only the alterations I made to the first language.

The rest remains as before. This goes for new prod's aswell as editing existing prod...

 

Can anyone please help me on thisone??

Share this post


Link to post
Share on other sites

Hi

 

sorry my english isn`t very good.

 

i have a problem with htmlarea 3.

i had installed htmlarea, works in 2 languages and i see all the buttons, great.

 

but when i will insert a image or table, i become a message.

 

Not Found

The requested

URL /os/catalog/htmlarea/http://www.MYDOMAIN.com/os/catalog/htmlarea/popups/ins

was not found on this server

 

i can see that the URL is wrong. but where I can change this entry.

 

thanks for help

 

greetings

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×