[resolved] jQuery problem (lightbox component) (5 posts)

  1. ChowKaiDeng
    Posted 4 years ago #

    I'm not completely sure, but I think that AdRotate is breaking something in my jQuery library calls. This happens after WordPress upgraded to 3.3.1

    This is the problem: among my plugins, I have installed Rich Widget, which is a simple plugin that adds a FCKEditor like box to widgets, so you can edit the content of them in RTF.

    When AdRotate is activated, I can't see no more the lightbox on the RTF editor of Rich Widget, and when deactivated, it shows ok.

    I thought it was something with the jQuery library version called by the updated WordPress, so I de-registered the jquery script and registered a specific version of jquery (older) on my functions file, but nothings happens.

    Is someone around here having a similar problem, maybe with other plugins that use similar lightbox scripts?



  2. Arnan de Gans
    Posted 4 years ago #

    AdRotate doesnt use or load jquery.

  3. ChowKaiDeng
    Posted 4 years ago #

    So, what's this?

    File: adrotate-functions.php (line 848)

    function adrotate_filemanager_admin_scripts() {

    (line 862)

    function adrotate_filemanager_admin_styles() {

    File: adrotate.php (line 675)

    <script language="JavaScript">
    			jQuery(document).ready(function() {
    				jQuery('#adrotate_image_button').click(function() {
    					formfield = jQuery('#adrotate_image').attr('name');
    					tb_show('', 'media-upload.php?type=image&TB_iframe=true');
    					return false;
    				window.send_to_editor = function(html) {
    					imgurl = jQuery('img',html).attr('src');

    That was just a quick search among obvious files, but I haven't check them all properly.

    As I see, the AdRotate thickbox could be interfering with the Rich Widget thickbox. They both use jQuery.

  4. Arnan de Gans
    Posted 4 years ago #

    Oh duh.. forgot about those.
    However, those are WP api's/functions used by many plugins.

  5. ChowKaiDeng
    Posted 4 years ago #

    Yes indeed. After a few minutes I've figured out. The problem was caused by Rich Widget, not AdRotate.
    Rich Widget was doing this ugly thing:

    echo '<link href="' . RB_RICHWIDGET_BASEURL . '/thickbox/thickbox.css" rel="stylesheet" type="text/css" />';
    wp_enqueue_script('thickbox_custom', RB_RICHWIDGET_BASEURL . '/thickbox/thickbox.js');

    Instead of just simply this:


    I guess that Rich Widget was written in a time when thickbox was not part of the core scripts of WP, or something like that.

    I've changed the thing and everything it's ok. I'm gonna post all this stuff on the Rich Widget forum.


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • AdRotate
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic