Advanced search  

News:

cpg1.5.30 maintenance release - upgrade recommended
The Coppermine development team is releasing an update for Coppermine in order to fix several minor issues. All fixes are not security critical, so if your gallery is running fine with cpg1.5.28 you don't need to upgrade. If you are running an older version than cpg1.5.28, you must update to this latest version as soon as possible because of the security impact!
[more]

Pages: [1]   Go Down

Author Topic: Add quicktags  (Read 10451 times)

0 Members and 1 Guest are viewing this topic.

dwo

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 143
Add quicktags
« on: July 01, 2008, 11:13:04 PM »

Hello.

I searched a way to add quicktags to the comment field.

I found http://alexking.org/projects/js-quicktags

Download, tweak the .js file to your needs, upload it to root and edti theme.php function

Code: [Select]
// HTML template for the form to add comments
if (!isset($template_add_your_comment)) { //{THEMES}
...

Code: [Select]
<!-- BEGIN input_box_no_smilies -->
                                <td class="tableb_compact">
                                <textarea class="textinput" id="message" name="msg_body" style="width: 550px;" rows="6"></textarea>
  <script class="comment_button" type="text/javascript">edToolbar('message');</script>
<!-- END input_box_no_smilies -->

This adds quicktags.

I think adding them anywhere, eg description is as easy.

Do not forget to pay at least the one dollar 35 ;)

Only formatting the buttons with css didnt work...

regards, Dietmar

Logged

dwo

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 143
Re: Add quicktags
« Reply #1 on: July 02, 2008, 09:31:12 AM »

Of course, you additionally have to call the script in template.html with <script ... command.
Logged

dwo

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 143
Re: Add quicktags
« Reply #2 on: July 02, 2008, 09:54:00 AM »

Just found out:

To format the button, you have to insert code into the .js file.

Code: [Select]
default:
document.write('<input class="comment_button" type="button" id="' + button.id + '_' + which + '" ' + accesskey + ' class="ed_button" onclick="edInsertTag(\'' + which + '\', ' + i + ');" value="' + button.display + '"  />');
break;
Logged
Pages: [1]   Go Up
 

Page created in 0.07 seconds with 19 queries.