Active
Project:
Htmlarea
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
20 Feb 2004 at 17:22 UTC
Updated:
5 Sep 2005 at 04:52 UTC
Jump to comment: Most recent file
Drupal recognizes the --break-- tag as a separator between teaser and body. It would be nice to if htmlarea.module had a custom button for tag. A reasonable icon for this button might be '--'. Custom buttons are pretty easy with HTMLArea.
| Comment | File | Size | Author |
|---|---|---|---|
| #16 | ed_break.gif | 1.14 KB | robert castelo |
| #5 | htmlarea.module | 17.97 KB | sofiya |
Comments
Comment #1
gordon commentedYes this is on the list, I need to finish some other changes and then I can add this feature.
Comment #2
gordon commentedI have been doing some more thinking about this one, what I am thinking of doing is adding an additional tab that will allow you to write javascript to create such a custom button.
Comment #3
sofiya commentedWhat I did, was put a 'Teaser Breaker' icon in HTMLArea toolbar and the user has just to position the cursor in the body field where he/she wants to end the teaser and press the 'Teaser Breaker' icon. A MARK then appears in the HTMLArea that signifies a 'teaser break'. My teaser marker is "[TEASER BREAK]". I do away with
because HTMLArea.js ignores 'comments' and strip them.
This just requires a two_lin_patch in htmlarea.module. I then replace all occurences of
in node.module to my TEASER MARKer. :)
Comment #4
gordon commentedthis bug that caused comments to be stripped has been fixed.
How did you add the additional break button?
Comment #5
sofiya commentedthis bug that caused comments to be stripped has been fixed.
is this fix came from interactivetools.com or a hacked htmlarea.js to allow comment like
?
This is how I added the customized button in htmlarea.module 4.4.0.
htmlarea_textarea($name), after line 144, i put this line of code:_htmlarea_defaults($field), in line 300, i added in the array the name of my teaser-break,,"my-teaserbreak"i also created a simple icon that indicates that's it's a teasear break. :)
attached is a patched htmlarea.module that has a customised teaser-break button. (sorry i dont have a cvs front-end, i cant diff )
hth.
Comment #6
gordon commentedI knew that the process to do this is extremely simple. This is why I am thinking of adding a custom page that will allow you to enter js code into attacheditor() so that it will appear on the screen. Then you will not have to patch htmlarea to add this code.
Comment #7
Jhef.Vicedo commentedOr would a plugin(htmearea) be good for this? So there will be no patching on htmlarea script.
I already created a plugin but I am wondering if the --break-- comment is already fixed? You mentioned above, it is but on which version? Is it on the cvs or is it included in the 4.5rc version of #drupal?
Comment #8
gordon commentedI have added a new tab to the settings menu called custom js. This will enable the administrator to add additional code the the attacheditor() right before the editor.generate().
This will mean that custom buttons will be able to be created here.
Comment #9
gordon commentedComment #10
kbahey commentedHi
Thanks for this generic function. It will be very useful for sure.
More specially though, can someone paste some js code here that inserts a --break-- comment?
This will truly bring closure to this issue.
Comment #11
kbahey commentedChanging to active so the details of how to get a break key be posted before closure.
Comment #12
gordon commentedIf someone can post an nice Icon for it I was actually add it to the help of the js entry screen. so you can cut and paste it.
Comment #13
gordon commentedI have now changed this to fixed, as the actual code is in commet #5, you just need to change the [TEASER BREAK] to <!--break-->
Comment #14
(not verified) commentedComment #15
robert castelo commentedCould someone please post the javascript that should be copied into the custom js field - exactly as it should be used.
I tried to use the script in comment 5 above, but as I don't know Javascript I couldn't get it to work.
I'll be able to supply a button image for this soon.
Comment #16
robert castelo commentedHere's an icon for the 'break' button.
Now, could someone supply the JavaScript?
Comment #17
wvengen commentedWell, I placed your image in modules/htmlarea/xinha-nightly/images/ and entered the following in the custom javascript textarea:
You need to replace < and > with < and > respectively in the code above.
It adds a teaser break button, but the teaser break is not visible when entered :(
Comment #18
gordon commentedI think that I (or someone else) is going to need to create a plugin for Xinha to allow this.