Home / Forums / DynamiX Support / Jquery Problem with simple:press forum plugin

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts

  • Ruben
    Participant

    Hi there,

    i've just noticed that with Dynamix i have problems with Jquery interactions on the forum. In particular the font resizing is not working (look at the three "A" on the top of the forum). I went to Simple:press Support Forum and they said to me that's because of Dynamix Theme is not loading default wp version of Jquery but old version from googleapis. So how may i solve that?

     

    Thanks in advance,

    Ruben

     

    PS: Here you find my conversation with the simple:press developers, i'm tidusuper91 even there.

    http://simple-press.com/support-forum/sp5-plugin-topics/resize-text-plug-in-er-how-does-it-work/page-4/#p99649

    Here my not working page:

    http://www.tuttingegneri.com/blog/forum


    Rich
    Participant

    You can always get the latest version number by going here http://code.google.com/apis/libraries/devguide.html#jquery

    Then change the version number in functions.php on or around line 34.


    Ruben
    Participant

    Ya made that but Dynamix still continues breaking Javascript interactions of the simple:press forum plugin. On the plugin forum suggested me to load the embedded jquery file of WordPress. It could be a solution? And tring to debugging with Firebug (even if i'm not in JS) it seems missing Jquery.cookie plugin. Can i add it?

    Andy
    Andy
    Keymaster

    Hi Ruben,

    It's not breaking anything – is the plugin supposed to call the jquery cookie plugin? It's a separate entity so should be called by the plugin. You can manually call in the functions in the same way the jQuery is called. 


    Ruben
    Participant

    Ok i'll try and let you know…


    Ruben
    Participant

    Hi Andy,

    i've just discussed with simple:press plugin developers and they're saying that it's proably because of Dynamix is loading jquery from Google CDN that creates conflicts with Simple:press (that uses embeddend WP jquery scripts).

    I tried to edit functions.php in this way:


    <?php if (!is_admin()) if(!session_id()) session_start();
    /***************************************************************/
    /*    Initialise DynamiX and JQUERY Scripts                       */
    /***************************************************************/

    function init_dynscripts() {
        if (!is_admin()) {

            if ( function_exists('bp_is_blog_page')) {
                if (!bp_is_blog_page()) {
                    wp_enqueue_script( 'bp-js', BP_PLUGIN_URL . '/bp-themes/bp-default/_inc/global.js', array( 'jquery' ) );
                }
            }

            wp_register_style('dynamix-style', get_bloginfo('stylesheet_url'),false,null);
            wp_enqueue_style('dynamix-style');
                
            wp_dequeue_style('em-ui-css'); // stop Event Manager jQuery UI CSS interfering.
            
            wp_enqueue_script('jquery');
            wp_enqueue_script('jquery-ui-core');
            wp_enqueue_script('jquery-ui-tabs');
            
            
            
            wp_register_script('jquery-cookie', get_bloginfo('template_directory').'/js/jquery.cookie.js',false,null);
            wp_enqueue_script('jquery-cookie');

            wp_deregister_script( 'dynamix' );    
            wp_register_script( 'dynamix', get_bloginfo('template_directory').'/js/dynamix.min.js',false,null);
            wp_enqueue_script( 'dynamix' );
            
            if(get_option('jwplayer_js')) { // Check jw player javascript file is present
            
            $CWZ_jwplayer_js = get_option('jwplayer_js');
            
            wp_deregister_script( 'jw-player' );    
            wp_register_script( 'jw-player', $CWZ_jwplayer_js );
            wp_enqueue_script( 'jw-player' );        
            }
        
        }
    }    
    add_action('init', 'init_dynscripts',100);


    /***************************************************************/
    /*    Initialise DynamiX and JQUERY Scripts *END*               */
    /***************************************************************/

    but it seems that jquery-ui-core is not loaded (neither jquery-ui-tabs). How can i edit to use wp versions of jquery and UI?


    Ruben
    Participant

    Ok i solved. It was missing jquery.easing plugin, so here's the complete workaround:

    1. Download Jquery.cookie and Jquery.easing plugins
    2. Rename them in jquery.cookie.js and jquery.easing.js
    3. Put them in /wordpressfolder/wp-content/themes/Dynamix/js
    4. Edit functions.php of the theme from


    ***************************************************************/
    /* Initialise DynamiX and JQUERY Scripts */
    /***************************************************************/

    to:


    /***************************************************************/
    /* Initialise DynamiX and JQUERY Scripts *END* */
    /***************************************************************/

     

    pasting this:

     


    /***************************************************************/
    /* Initialise DynamiX and JQUERY Scripts */
    /***************************************************************/

    function init_dynscripts() {
    if (!is_admin()) {

    if ( function_exists('bp_is_blog_page')) {
    if (!bp_is_blog_page()) {
    wp_enqueue_script( 'bp-js', BP_PLUGIN_URL . '/bp-themes/bp-default/_inc/global.js', array( 'jquery' ) );
    }
    }

    wp_register_style('dynamix-style', get_bloginfo('stylesheet_url'),false,null);
    wp_enqueue_style('dynamix-style');

    wp_dequeue_style('em-ui-css'); // stop Event Manager jQuery UI CSS interfering.

    wp_enqueue_script('jquery-ui-core');
    wp_enqueue_script('jquery-ui-tabs');
    wp_enqueue_script('jquery-ui-sortable');
    wp_enqueue_script('jquery-ui-draggable');
    wp_enqueue_script('jquery-ui-droppable');
    wp_enqueue_script('jquery-ui-selectable');
    wp_enqueue_script('jquery-ui-resizable');
    wp_enqueue_script('jquery-ui-dialog');
    wp_enqueue_script('jquery-ui');
    wp_enqueue_script('jquery-ui-core');
    wp_enqueue_script('jquery-ui-datepicker');

    wp_enqueue_script( 'jquery' );

    wp_register_script('jquery-cookie', get_bloginfo('template_directory').'/js/jquery.cookie.js',array('jquery'),null);
    wp_enqueue_script('jquery-cookie');

    wp_register_script('jquery-easing', get_bloginfo('template_directory').'/js/jquery.easing.js',array('jquery'),null);
    wp_enqueue_script('jquery-easing');


    wp_deregister_script( 'dynamix' );
    wp_register_script( 'dynamix', get_bloginfo('template_directory').'/js/dynamix.min.js',false,null);
    wp_enqueue_script( 'dynamix' );

    if(get_option('jwplayer_js')) { // Check jw player javascript file is present

    $CWZ_jwplayer_js = get_option('jwplayer_js');

    wp_deregister_script( 'jw-player' );
    wp_register_script( 'jw-player', $CWZ_jwplayer_js );
    wp_enqueue_script( 'jw-player' );
    }

    }
    }
    add_action('init', 'init_dynscripts',100);


    /***************************************************************/
    /* Initialise DynamiX and JQUERY Scripts *END* */
    /***************************************************************/

    hope it will be useful to others. 😀 Thanks for your support!


    Ruben
    Participant

    A better solution could be to use a Child Theme and write the functions.php as this:

    <?php
    /**
    * DynamiX Child Theme Functions
    * Load languages directory for translation
    */
    // Removing original init_dynscripts replacing with personal one

    /*********************************************
    Replacing the action for embedding JS scripts
    with one more compatible with plugins
    **********************************************/

    function my_init_dynscripts_new_action () {
    remove_action('init','init_dynscripts',100);
    add_action('init','my_init_dynscripts',100);
    }
    function my_init_dynscripts() {
    if (!is_admin()) {

    if ( function_exists('bp_is_blog_page')) {
    if (!bp_is_blog_page()) {
    wp_enqueue_script( 'bp-js', BP_PLUGIN_URL . '/bp-themes/bp-default/_inc/global.js', array( 'jquery' ) );
    }
    }

    wp_register_style('dynamix-style', get_bloginfo('stylesheet_url'),false,null);
    wp_enqueue_style('dynamix-style');

    wp_dequeue_style('em-ui-css'); // stop Event Manager jQuery UI CSS interfering.

    wp_enqueue_script('jquery-ui-core');
    wp_enqueue_script('jquery-ui-tabs');
    wp_enqueue_script('jquery-ui-sortable');
    wp_enqueue_script('jquery-ui-draggable');
    wp_enqueue_script('jquery-ui-droppable');
    wp_enqueue_script('jquery-ui-selectable');
    wp_enqueue_script('jquery-ui-resizable');
    wp_enqueue_script('jquery-ui-dialog');
    wp_enqueue_script('jquery-ui');
    wp_enqueue_script('jquery-ui-core');
    wp_enqueue_script('jquery-ui-datepicker');

    wp_enqueue_script( 'jquery' );

    wp_register_script('jquery-cookie', get_bloginfo('template_directory').'/js/jquery.cookie.js',array('jquery'),null);
    wp_enqueue_script('jquery-cookie');

    wp_register_script('jquery-easing', get_bloginfo('template_directory').'/js/jquery.easing.js',array('jquery'),null);
    wp_enqueue_script('jquery-easing');

    wp_deregister_script( 'dynamix' );
    wp_register_script( 'dynamix', get_bloginfo('template_directory').'/js/dynamix.min.js',false,null);
    wp_enqueue_script( 'dynamix' );

    if(get_option('jwplayer_js')) { // Check jw player javascript file is present

    $CWZ_jwplayer_js = get_option('jwplayer_js');

    wp_deregister_script( 'jw-player' );
    wp_register_script( 'jw-player', $CWZ_jwplayer_js );
    wp_enqueue_script( 'jw-player' );
    }

    }
    }
    add_action('after_setup_theme', 'my_init_dynscripts_new_action');
    ?>

    In this way we’re replacing the action of the parent theme with the one edited without hard coding anything. This will be useful for futhrt upgrades of the theme.

    Andy
    Andy
    Keymaster

    Thanks for documenting this – it's a difficult one on whether to use default WordPress jQuery, I did originally and they were slow to update their versions – though I think this has changed of late.


    Ruben
    Participant

    I don't know but i read that embedded wp versions are written in a way that guarantee no conflicts with other frameworks.

    Andy
    Andy
    Keymaster

    Hi Ruben,

    I'll look into this again – the only reason I changed to google is because I required a newer version of jQuery for a feature which was broke in the version of jQuery WordPress was using.

     With regards to no conflicts, essentially that's what the de-queue does in the standard theme functions. 


    Ruben
    Participant

    I really don't know why but including the right plugins with the wp version it continues to work. I think that using wp libraries is more compliant with WP plugin system. Anyway i'm not expert so sure you'll have more explanations 😀

    Andy
    Andy
    Keymaster

    I've just being testing the last few days and I've resorted to sticking with Google. However I'm going to de-queue all the default plugins. 

    Using WP standard increases load time substantially and reduces the Google page load scores. In the next version hopefully the issues you're having will be resolved. 

Viewing 13 posts - 1 through 13 (of 13 total)

You must be logged in to reply to this topic.