Advanced HTML Editor 2 Support Product Page

This topic was archived

no more <p> tags

Asked 22 Oct 2004 00:33:03
1
has this question
22 Oct 2004 00:33:03 Dan Berdusco posted:
One thing that I have wanted changed since the release of version 1 is the ability to have a <pre id=code><font face=courier size=2 id=code>&lt;br&gt; </font id=code></pre id=code> inserted when the user presses the "ENTER" key rather than creating a new <pre id=code><font face=courier size=2 id=code> &lt;p&gt;&lt;/p&gt;. </font id=code></pre id=code> I would LOVE IT if you could completely remove the <pre id=code><font face=courier size=2 id=code> &lt;p&gt;&lt;/p&gt;</font id=code></pre id=code> tags altogether as they seem useless to me.

Is there somewhere that I could modify the code slightly to make this change myself?

Thanks.

Replies

Replied 22 Oct 2004 02:04:33
22 Oct 2004 02:04:33 Chris Charlton replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>One thing that I have wanted changed since the release of version 1 is the ability to have a <pre id=code><font face=courier size=2 id=code>&lt;br&gt; </font id=code></pre id=code> inserted when the user presses the "ENTER" key rather than creating a new <pre id=code><font face=courier size=2 id=code> &lt;p&gt;&lt;/p&gt;. </font id=code></pre id=code> I would LOVE IT if you could completely remove the <pre id=code><font face=courier size=2 id=code> &lt;p&gt;&lt;/p&gt;</font id=code></pre id=code> tags altogether as they seem useless to me.

Is there somewhere that I could modify the code slightly to make this change myself?<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

If you really wanted too, you can code a regexp that parses out "empty" tags. But I'd definitely would praise this extension if it added a "clean up empty tags", and XHTML valid code too would be nice.
Replied 22 Oct 2004 04:06:12
22 Oct 2004 04:06:12 Camillah Ringes replied:
Hi Trevor,

When using the editor in Mozilla the 'ENTER' button always results in a BR tag.
In IE the word processor function remains the same, and you have to use "SHIFT" + "ENTER" when trying to avoid the P tag.

--------------------------------------------------
Camillah Ringes
Web Developer at Dynamic Zones
Manager at DMXzone.com
--------------------------------------------------
Replied 22 Oct 2004 04:53:41
22 Oct 2004 04:53:41 Dan Berdusco replied:
Hi Camilla,

Thanks for the reply. I am aware that the "shift" + "enter" creates a simple BR tag, however users of my website are not. 99% of the users will be using IE and will simply hit enter causing a P tag and a double line break. Is there no way this can be changed?

Thanks.
Replied 22 Oct 2004 06:56:12
22 Oct 2004 06:56:12 Camillah Ringes replied:
Hi Trevor,

Yes there is a way to get rid of the P tag.
I noticed you already own version 2.
Version 2 has most of the code already implemented, it's handling the 'keypress event' different from version 1.
You just have to uncomment the mentioned lines in the file I've mailed you.

--------------------------------------------------
Camillah Ringes
Web Developer at Dynamic Zones
Manager at DMXzone.com
--------------------------------------------------
Replied 22 Oct 2004 20:10:18
22 Oct 2004 20:10:18 Dan Berdusco replied:
Thank you so much camillah! That works great.

Now, one more question, I made the changes as you told me, but now, any time i got to a page that uses the HTML editor, and make any modification to the page, it over-writes my modification to the .js file with the original. is there anyway i can stop that from happening?

Thanks again
Replied 22 Oct 2004 21:45:31
22 Oct 2004 21:45:31 Camillah Ringes replied:
Hi Trevor,

Nice to hear it works out.
To overcome the .js file is constantly overwritten by dreamweaver you have to go to your dreamweaver configuration folder and change the .js file that's stored over there.


I don't know on what platform you work, but asume it's windows XP...

Go to your system drive ( normally C: ) and go to your personal directory in the "documents and settings" directory. In my case -&gt;
<pre id=code><font face=courier size=2 id=code>C:\Documents and Settings\camillah\</font id=code></pre id=code>

If you don't see the 'Application Data' directory you have to set your explorersettings to 'show hidden directorys and files'
Then go to -&gt;
<pre id=code><font face=courier size=2 id=code>Application Data\Macromedia\Dreamweaver MX 2004\Configuration\shared\DMXzone\AdvHTMLEdit</font id=code></pre id=code>
(The path is the same for Ultradev and Dreamweaver MX)

In the 'AdvHTMLEdit' directory you will find the .js file. Open the file, uncomment the lines and save it.

If you accidently break the code you have to reinstall the extension. You can use v2.01 for this purpose, I added the same code in this version I send to you earlier.

--------------------------------------------------
Camillah Ringes
Web Developer at Dynamic Zones
Manager at DMXzone.com
--------------------------------------------------
Replied 22 Oct 2004 22:34:54
22 Oct 2004 22:34:54 Paul Kramer replied:
Gee could it be the code I pasted below possibly???

I found it on the htmlarea support forums and from the sounds of Camillah's post it oculd be the same code, I hav enot bought the "upgrade so I do not know for sure but I be t it is based on my prior experience!!"

The support here is suspect, I can get better support by going to the free "htmlarea" sites forums and asking questions there and
since this editor is basically "htmlarea" adapted to DWMX the answers over there normally help to point one in the right direction.


TooTall
----------code pasted below found on the html area 2.0 support forum----------------

I've had similar problems specificaly with
intergrating htmlArea into an exsisting
application.

What helped for me was modifying the function
Function : editor_event
Description : called everytime an editor event occurs
in the editor.js.

Modification
// cancel ENTER key and insert &lt;BR&gt; instead
// if (ord == 13 && editEvent.type == 'keypress') {
// editEvent.returnValue = false;
// editor_insertHTML(objname, "&lt;br&gt;";
// return;
// }

Is remarked as default *change* it to

// cancel ENTER key and insert &lt;BR&gt; instead
if (ord == 13 && editEvent.type == 'keypress') {
editEvent.returnValue = false;
editor_insertHTML(objname, "&lt;br&gt;";
return;
}

No more double returns.
Replied 22 Oct 2004 23:50:21
22 Oct 2004 23:50:21 Dan Berdusco replied:
Excellent,

thanks for the help camillah
Replied 23 Oct 2004 00:12:58
23 Oct 2004 00:12:58 Dan Berdusco replied:
I hate to be so picky, but one more thing....

Is it possible to have the bullets and numbering work now? When the P tags are removed, they no longer work. I realize that the bullet and numbering work with P tags but if you look at say... the editor that is used when composing a message with Hotmail, hitting the "ENTER" key only causes a single BR and you can still use the bullets etc.

Thanks
Replied 25 Oct 2004 23:58:33
25 Oct 2004 23:58:33 Camillah Ringes replied:
Hi Trevor,

With this one it's one thing or the other.. You still can use bullets in Internet Explorer when putting in the &lt;p&gt; via the dropdown menu. I checked out the hotmail-way, they use &lt;div&gt; when using bullets. Because the majority of Advanced HTML Editor users don't mind the &lt;p&gt; tag, I don't think we are going to make a work arround for this one.
But I think it's quite interesting to try out some time.
So if (and this is a big if <img src=../images/dmxzone/forum/icon_smile_wink.gif border=0 align=middle> ) I find the time for it, I'll give it a try. If I manage to make it work it would be a nice additional feature. Will keep you informed.


--------------------------------------------------
Camillah Ringes
Web Developer at Dynamic Zones
Manager at DMXzone.com
--------------------------------------------------
Replied 26 Oct 2004 00:11:26
26 Oct 2004 00:11:26 Dan Berdusco replied:
Thanks Camillah,

I look forward to hearing from you!
Replied 29 Oct 2004 08:20:50
29 Oct 2004 08:20:50 Dan Berdusco replied:
Hi Camillah,

With the release of 2.02, this technique no longer works. Is there something you can suggest?
Replied 31 Oct 2004 16:03:05
31 Oct 2004 16:03:05 Camillah Ringes replied:
Hi Trevor it still works,
but you have to change

dmxedit_eventStop(ev)

into

dmx_f12(ev)



--------------------------------------------------
Camillah Ringes
Web Developer at Dynamic Zones
Manager at DMXzone.com
--------------------------------------------------
Replied 06 Dec 2004 17:03:22
06 Dec 2004 17:03:22 Stuart Conroy replied:
Hello,

Please tell me where I can edit these lines.

I would like to stop the code from generating &lt;p&gt; when editing in IE.

Regards

Stuart

Stuart Conroy
Replied 07 Dec 2004 12:42:04
07 Dec 2004 12:42:04 Stuart Conroy replied:
Hello,

These lines to uncomment don't seem to exist in version 2.03.

How can I stop these &lt;p&gt; tags from being generated?

Regards

Stuart

Stuart Conroy
Replied 10 Dec 2004 15:34:50
10 Dec 2004 15:34:50 Camillah Ringes replied:
Hi Stuart,

They are still in there, but they moved to line 919 upto 921.

Regards,
Camillah

--------------------------------------------------
Camillah Ringes
Web Developer at Dynamic Zones
Manager at DMXzone.com
--------------------------------------------------
Replied 11 Dec 2004 22:09:39
11 Dec 2004 22:09:39 Dan Berdusco replied:
Stuart, one thing to remember is that if you replace the P with BR, then your bullets, and numbering will not work.

Just thought I would let you know...
Replied 09 Nov 2005 17:52:25
09 Nov 2005 17:52:25 Boris Boy replied:
Hello,
i cant find the corresponding section.

So here is the code from beginning in line 921. Things changed a bit more than just moving from one line to another....

function dmx_f28(ev,objname){
if(ev){
var config=document.getElementById(objname).config;
var keyEvent=ev.ctrlKey||ev.altKey||ev.shiftKey;
//var ord = is_ie ? ev.keyCode : ev.charCode;
var ord=ev.keyCode?ev.keyCode:ev.which?ev.which:void 0;
//if (ord != null && is_gecko && ord == 0) ord = ev.which;
/* allow P enter tags in IE
if (ord){
if (is_ie && ord == 13){
var sel = editdoc.selection;
var rng = sel.createRange();
var el = rng.parentElement();
// not when we are in bullets mode
if (!(el && (el.tagName == 'LI' || el.tagName == 'UL' || el.tagName == 'DT' || el.tagName == 'DT' || el.tagName == 'DD'))) {
dmxedit_insertHTML(objname,"&lt;br /&gt;";
dmxedit_eventStop(ev);
return;
}
}
}
*/
/* todo transform enter to P tag in Gecko
if (ord != null && is_gecko && ord == 13 && !keyEvent) {
editdoc.execCommand('formatblock', false, '&lt;p&gt;');
dmxedit_insertHTML(objname,"\n&lt;p&gt;&lt;/p&gt;";
// todo move to next line
dmxedit_eventStop(ev);
return;
}
*/
please explain me what to uncomment, because i tried every possible combination but i still get &lt;p&gt; tags instead of the &lt;/br&gt; tag when using ie. btw. i am using the advanced editor version 2.0.4
Thanks for your help. In my opinion the whole topic is worth a faq.

Boris Boy
Replied 19 Jul 2006 15:22:24
19 Jul 2006 15:22:24 Boris Boy replied:
I want to bring this topic up again, because you couldnt offer me a solution. I asked every available email-adress from dmx inclduing sending a mail to george petrov. No response. My only hope is that a user smarter and more active than the supportstaff has found a solution. I'am using the editor with php.

Boris Boy
Replied 27 Jul 2006 12:00:12
27 Jul 2006 12:00:12 Patrick Woldberg replied:
Seeing above code i think you should uncomment like:

<pre id=code><font face=courier size=2 id=code>function dmx_f28(ev,objname){
if(ev){
var config=document.getElementById(objname).config;
var keyEvent=ev.ctrlKey||ev.altKey||ev.shiftKey;
//var ord = is_ie ? ev.keyCode : ev.charCode;
var ord=ev.keyCode?ev.keyCode:ev.which?ev.which:void 0;
//if (ord != null && is_gecko && ord == 0) ord = ev.which;
// allow P enter tags in IE
if (ord){
if (is_ie && ord == 13){
var sel = editdoc.selection;
var rng = sel.createRange();
var el = rng.parentElement();
// not when we are in bullets mode
if (!(el && (el.tagName == 'LI' || el.tagName == 'UL' || el.tagName == 'DT' || el.tagName == 'DT' || el.tagName == 'DD'))) {
dmxedit_insertHTML(objname,"&lt;br /&gt;";
dmxedit_eventStop(ev);
return;
}
}
}
/* todo transform enter to P tag in Gecko
if (ord != null && is_gecko && ord == 13 && !keyEvent) {
editdoc.execCommand('formatblock', false, '&lt;p&gt;');
dmxedit_insertHTML(objname,"\n&lt;p&gt;&lt;/p&gt;";
// todo move to next line
dmxedit_eventStop(ev);
return;
}
*/</font id=code></pre id=code>

The comment removed is for the code below // allow P enter tags in IE

--------------------------------------------------
Patrick Woldberg
Web Developer at Dynamic Zones
Administrator at DMXzone.com, FLzone.net, FWzone.net and DNzone.com
--------------------------------------------------
Replied 07 Aug 2006 21:56:31
07 Aug 2006 21:56:31 Boris Boy replied:
I tried that what you wrote down 100times. I still have the &lt;p&gt; tags when i use a enter.. <img src=../images/dmxzone/forum/icon_smile_sad.gif border=0 align=middle> What Can i send you the files, so you can check if there is something wrong.

Boris Boy
Replied 17 Aug 2006 13:50:07
17 Aug 2006 13:50:07 Boris Boy replied:
WHY CAN NOBODY HELP ME WITH THIS..........
I bought the complete PHP bundle, but if this &lt;p&gt; tag problem is not solved its useless for me. All the money has been a waste. I'am not too dumb, to uncomment a few lines of code. Isn't there someone with knowledge about the application???

Boris Boy
Replied 26 Jan 2008 10:57:44
26 Jan 2008 10:57:44 Andrew Workman replied:
Don't know if this topic is still alive, but I too HATE &lt;p&gt; tags in my code. They do all kinds of unruly things to the layout and after a number of edits by "un-educated" users (the people mostly using this editor, because that's who these CMS's are designed for), there are always 5 or 6 unused &lt;p&gt;&lt;/p&gt; tags in the text.

There has to be an answer or solution to this. Maybe I can do a replace on this before it's entered into the database and remove all &lt;p&gt; or something? If enough people want this functionality, maybe they'll include the option.
Replied 19 Jun 2008 17:33:44
19 Jun 2008 17:33:44 George Petrov replied:
Hi All,

I'm happy to announce that in the latest update of Adv HTMl Editor ver 2.06 - now we have an option for enter handling!
So now you can choose if you want a P tag or a BR tag generated for each enter key.

Greetings,
George

--------------------------------------------------
George Petrov - Founder of the Dynamic Zones
DMXzone.com, FWzone.net, FLzone.net, CFzone.net,
DNzone.com, FlashFiles.nl
--------------------------------------------------
Replied 19 Jun 2008 20:51:41
19 Jun 2008 20:51:41 Dan Berdusco replied:
Great News George! I think this is a fantastic new feature.

Reply to this topic