WordPress.org

Ready to get started?Download WordPress

Forums

Cookie Law Info
[resolved] HTML Tab button in editor disappear with plugin activated (10 posts)

  1. andy_moyle
    Member
    Posted 2 years ago #

    With the plugin activated, the buttons in the tinymce editor HTML tab editor(for editing and adding posts and pages) disappear.
    On deactivation, they reappear

    I've tried it with the top bar opened and closed and logging back in.

    http://wordpress.org/extend/plugins/cookie-law-info/

  2. richardashby
    Member
    Plugin Author

    Posted 2 years ago #

    Hi Andy,

    Thanks for downloading the plugin! Tho sorry it's working on your install :( I've tested the plugin on several themes across 3.3.1 and 3.3.2 but I can't replicate this.

    Could you tell me:
    - Your WP version e.g. 3.3.2
    - Browser name and version
    - Win/Mac/Linux/etc
    - The URL of the page you're on when this happens (as it might be an issue with conflicting libraries in the dashboard)

    Also, what theme are you running? Can you get it working in e.g. TwentyEleven, or is it just your theme?

    Hopefully I'll be able to help you.

    Incidentally the new version is close to being released.

  3. andy_moyle
    Member
    Posted 2 years ago #

    I've got the plugin installed on WordPress version 3.3.2 on 2 different linux server (UK2.net) on 6 different sites and 6 different themes and tried it with Firefox 12.0,IE9.06 and Chrome 19.0. Some of the sites run bespoke themes, some themes from WordPress.org repository. The installs all have different plugins running - the common plugin to all is Clean Contact,Google XML Sitemaps And Akismet

    I've tried Twenty Eleven and still no editor buttons on the HTML tab for adding and editing a page or post in the admin area.
    As soon as I deactivate Cookie law info, the buttons appear again on adding/editing a page or post

    Hope that is enough info!

  4. andy_moyle
    Member
    Posted 2 years ago #

    When trying to add a page, check the console in Firefox - there's a couple of errors in my-colours.js - in my limited experience jquery/javacsript errors kill other bits of js!

    [Break On This Error] line 9
    preferredFormat: "hex"

    Line 9 jQuery("#cookie-cp1, #cookie-cp2, #cookie-cp3, #cookie-cp4, #cookie-cp5, #cookie-cp6").spectrum is not a function

  5. richardashby
    Member
    Plugin Author

    Posted 2 years ago #

    Hi Andy,

    Great thanks for the info, very helpful! That makes me more confident in my suspicion that it's the spectrum jQuery plugin not interacting with your theme (themes load after plugins and can overwrite a lot of settings, causing issues I cant always test for here).

    The script is not strictly speaking needed, as it should degrade to text boxes. You could try commenting out the enqueue_script lines that call spectrum?

    In function cookielawinfo_custom_dashboard_styles( $hook ):

    wp_enqueue_script('spectrum-colorpicker', plugins_url('/cookie-law-info/admin/bgrins-spectrum/spectrum.js'), array('jquery'));
    wp_register_style( 'spectrum-style', plugins_url('/cookie-law-info/admin/bgrins-spectrum/spectrum.css') );
    wp_enqueue_style( 'spectrum-style' );

    In function cookielawinfo_custom_dashboard_styles_my_colours()
    wp_enqueue_script('spectrum-custom', plugins_url('/cookie-law-info/admin/bgrins-spectrum/my-colours.js'));

    In the mean time I'll see if I can add a setting to the admin panel to override the script if required. If you could, let me know if that works.

    Thanks!

  6. richardashby
    Member
    Plugin Author

    Posted 2 years ago #

    --Can I just add a cautionary note that it's always wise to back up your WP db before running updates. Not that this plugin does much with the db, in fact it only uses the WP APIs, but still - good practice.

    :)

  7. andy_moyle
    Member
    Posted 2 years ago #

    Commenting out the wp_enqueue_scripts fixes the issue and downgrades the colour pickers to text boxes.

    If they are just for colour picking - why don't you use farbtastic which ships with wordpress? (There's a link for info at http://codex.wordpress.org/Function_Reference/wp_enqueue_script)

  8. richardashby
    Member
    Plugin Author

    Posted 2 years ago #

    I've yet to find a decent colour picker. I looked at 3 and opted for spectrum. Farbtastic is a bit ugly/cumbersome IMHO but I haven't tried to implement it before. The eyecon.ro plugin UX is weird plus the documentation is a bit sparse.

    The issue is that theme code is called after plugin code which can overwrite scripts. I've seen so many themes do stuff like deregister jquery then register an ancient version instead. Why do they do that?! That really screws things up big time for any plugins, even the core WP install, it's not good practice but quite common.

    Anyway thanks for the info, maybe I'll take another look.

  9. andy_moyle
    Member
    Posted 2 years ago #

    Agreed - I always call the wordpress versions of jquery!

    If you add a switch of color picker js setting, that will solve this issue!

  10. richardashby
    Member
    Plugin Author

    Posted 2 years ago #

    Andy, if you'd like a preview of 0.9 let me know. You can contact me via http://www.cookielawinfo.com

    Cheers

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.