Support » Fixing WordPress » Custom quicktag button conflict debugging help please

  • I find that various combinations of plugin-added custom quicktag buttons disrupt each other’s functioning.

    For example, with contact-form’s button active, custom buttons before it, like say iimage-browser and ca-cpicker, no longer open their popup windows, or do anything.

    Ditto with photopress and other custom buttons. Perhaps the autors are not implementing their buttons 100% correctly, but how might I investigate myself? I can’t see the custom buttons in quicktags.js, so where should I look?


Viewing 7 replies - 1 through 7 (of 7 total)
  • Mark (podz)


    Support Maven

    If you download the file ‘quicktags.js’ the structure is laid out and explained at the top of that file. That may help you to find a problem ?
    If it’s just popups, could it be your browser ?

    Thanks podz. Yes, I’ve looked at my live quicktags.js but I don’t see code in it specific to some of the custom quicktags, e.g.: ca-cpicker. I don’t know Javascript that well – I assume there’s either a routine in there to check for which buttons to create, OR, there’s another way to interface with quicktags that I’m not aware of. Either way, where would it be looking to know which buttons to create? I figure that’s where I might debug.

    I don’t believe it’s a popup-stopping issue, since I can get all buttons to work as long as their “conflicters” are deactivated.

    Okay, I’m onto something now … my statement “there’s another way to interface with quicktags” is correct. The plugins mentioned each add their button using DOM and amending the quciktags elements. And they each do it in quite different ways. So now I just need to try and figure out why one breaks the other …

    Okay, maybe a coder can help …

    Why does button (B) break button (A)?

    (A) via PHP, as used in ca-cpicker:

    var colorButton = document.createElement(‘input’);
    colorButton.type = ‘button’;
    colorButton.value = ‘<?php echo $caption; ?>’;
    colorButton.onclick = <?php echo $js_onclick; ?>;
    colorButton.className = ‘ed_button’;
    colorButton.title = “<?php echo $title; ?>”; = “<?php echo “ed_{$caption}”; ?>”;

    (B) via JS, as used in photopress:

    <script language=”JavaScript” type=”text/javascript”>
    document.getElementById(“quicktags”).innerHTML += “<input type=\”button\” class=\”ed_button\” id=\”ed_upload\” value=\”Browse\” onclick=\”return pp_browse_popup();\” /><input type=\”button\” class=\”ed_button\” id=\”ed_upload\” value=\”Upload\” onclick=\”return pp_upload_popup();\” />”;

    Thanks for any help.

    Success! My first little wp hack. I just changed (B) above to work in the same way as (A), and now both buttons work. This should work for any quicktags buttons that cause malfunction that were written in the style of (B).

    If anyone wants more detail, speak up!

    Yes, I want more details. Please.

    kaat, out of curiosity, did you try to make b work like a also? B seems a bit sloppy. A is the way Owen’s Edit Button template is made… here’s part…

    function edit_insert_button($caption, $js_onclick, $title = '')
    var theButton = document.createElement('input');
    theButton.type = 'button';
    theButton.value = '<?php echo $caption; ?>';
    theButton.onclick = <?php echo $js_onclick; ?>;
    theButton.className = 'ed_button';
    theButton.title = "<?php echo $title; ?>"; = "<?php echo "ed_{$caption}"; ?>";

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Custom quicktag button conflict debugging help please’ is closed to new replies.