Page 1 of 12 12311 ... LastLast
Results 1 to 10 of 111
  1. #1
    Join Date
    Jul 2006
    Location
    Montreal, Canada
    Posts
    2,279
    Plugin Contributions
    0

    Default css javascript loader addon problems

    Hello.
    on my zc 139c , I have installed following .. TTP , jqlightbox.
    I also installed slider that will slide images on my index page. this slider needs jquery as well as 3 other jq plugins. my problem is with jqlightbox auto loader . as per author of this plugin , i can modify autoloader to load css jscript pages without duplication . but documents for this script is not written well, so im stuck as how to configure auto loader to load jquery and related script for that slider only on my index page.
    will appreciate anyone that can explain this in painless way ..

    ps : i have not installed CSS Javascript loader , but only jqlightbox and TTP which seems both use this loader anyway.

  2. #2
    Join Date
    Dec 2009
    Posts
    204
    Plugin Contributions
    0

    Default Re: css javascript loader

    I have the same problem, so far i tried modifying the loader.php sample to load some .js files on my home page, but it's not working as expected
    PHP Code:
    <?php

             $loaders
    [] = array('conditions' => array('pages' => array('index_home')),
                                             
    'jscript_files'             => array(
                                                                       
                                                                          
    'jquery/jquery-1.4.2.min.js'  => 10,  
                                                                          
    'fadeslideshow.js'                 => 11                                                                       
                                             
    ));

  3. #3
    Join Date
    Jul 2006
    Location
    Montreal, Canada
    Posts
    2,279
    Plugin Contributions
    0

    Default Re: css javascript loader

    what error(s) are you getting. ?replace 'index_home' with 'index' and try to see if that helps.

  4. #4
    Join Date
    Dec 2009
    Posts
    204
    Plugin Contributions
    0

    Default Re: css javascript loader

    Thanks for that, it worked now to load the jquery library 1.4.2 and the fadeslideshow.js , but the slideshow stopped working. This thread gives explicit directions for the slideshow installation. When i'm trying to use the loader_slideshow.php, i am placing the fadeslideshow.js in my jscript folder, where i also copy the images folder.
    I'm also having doubts about loading the 1.4.2 jquery library because the one from googleapis is 1.3.2 and already minified and has a smaller size than mine loaded with C/J loader, but it's from a different domain. What do you think would be best for load time? keep the smaller size one from googleapis or the bigger one from my own domain? (well that's in case i get the slideshow working )

  5. #5
    Join Date
    Jul 2006
    Location
    Montreal, Canada
    Posts
    2,279
    Plugin Contributions
    0

    Default Re: css javascript loader

    cj loader will minify your jquery file and will cache them on clients computer. i checked one of your site , and slide show seems to be working correctly

  6. #6
    Join Date
    Dec 2009
    Posts
    204
    Plugin Contributions
    0

    Default Re: css javascript loader addon

    Yes it is already working on lemy.co.uk but it's loaded directly from the html_header and is not minified because the files are not loaded from loader_slideshow.php, but instead from pages/index/fadeslideshow.js, exactly like in the thread i gave the link in the previous post. The loader works, it's minifying the 1.4.2 jquery library and the fadeslideshow.js(i can see them in page source), but then it is not displaying it. I suspect is from the Pictures folder needed for this slider, but i'll need to fiddle more with it because i can understand it's hard for someone to give a verdict and help me when they can't see it in action, but the site is live.

  7. #7
    Join Date
    Dec 2009
    Posts
    204
    Plugin Contributions
    0

    Default Re: css javascript loader addon

    Fixed it, in the html_header i needed to keep the images instructions for the slider and i was deleting them before.

  8. #8
    Join Date
    Feb 2004
    Location
    Georgia, USA
    Posts
    1,948
    Plugin Contributions
    0

    Default Re: css javascript loader addon

    I really need help troubleshooting how the CJ Loader actually works. Since upgrading our JQuery Lightbox to version 1.7 which uses the CJ Loader, our site is acting strange.

    Stylesheets and scripts are being loader twice. Here is an example from view source:

    Code:
    <link rel="stylesheet" type="text/css" href="includes/templates/cs_main/css/stylesheet.css" />
    <link rel="stylesheet" type="text/css" href="includes/templates/cs_main/css/index_home.css" />
    <link rel="stylesheet" type="text/css" media="print" href="includes/templates/cs_main/css/print_stylesheet.css" />
    
    <script type="text/javascript" src="includes/templates/cs_main/jscript/jscript_imagehover.js"></script>
    <script type="text/javascript" src="includes/templates/cs_main/jscript/jscript_utils.js"></script>
    <link rel="stylesheet" type="text/css" media="print" href="includes/templates/cs_main/css/print_stylesheet.css" />
    <link rel="stylesheet" type="text/css" href="min/?f=/includes/templates/cs_main/css/stylesheet.css,/includes/templates/cs_main/css/index_home.css&amp;1275511773" />
    <script type="text/javascript" src="min/?f=/includes/templates/cs_main/jscript/jscript_imagehover.js,/includes/templates/cs_main/jscript/jscript_utils.js&amp;1275511773"></script>
    Can someone please direct me to where to start to even troubleshoot this?

    Thanks!

  9. #9
    Join Date
    Feb 2004
    Location
    Georgia, USA
    Posts
    1,948
    Plugin Contributions
    0

    Default Re: css javascript loader addon

    Okay, if I change my html_header.php from:
    PHP Code:
    <?php
    /**
     * Common Template
     *
     * outputs the html header. i,e, everything that comes before the \</head\> tag <br />
     *
     * @package templateSystem
     * @copyright Copyright 2003-2010 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: html_header.php 15761 2010-03-31 19:31:27Z drbyte $
     */
    /**
     * load the module for generating page meta-tags
     */
    require(DIR_WS_MODULES zen_get_module_directory('meta_tags.php'));
    /**
     * output main page HEAD tag and related headers/meta-tags, etc
     */
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" <?php echo HTML_PARAMS?>>
    <head>
    <title><?php echo META_TAG_TITLE?></title>
    <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET?>" />
    <meta name="keywords" content="<?php echo META_TAG_KEYWORDS?>" />
    <meta name="description" content="<?php echo META_TAG_DESCRIPTION?>" />
    <meta http-equiv="imagetoolbar" content="no" />
    <meta name="author" content="Clevershoppers.com" />
    <meta name="generator" content="shopping cart program by Zen Cart&trade;, http://www.zen-cart.com eCommerce" />
    <?php if (defined('ROBOTS_PAGES_TO_SKIP') && in_array($current_page_base,explode(",",constant('ROBOTS_PAGES_TO_SKIP'))) || $current_page_base=='down_for_maintenance' || $robotsNoIndex === true) { ?>
    <meta name="robots" content="noindex, nofollow" />
    <?php ?>
    <?php 
    if (defined('FAVICON')) { ?>
    <link rel="icon" href="<?php echo FAVICON?>" type="image/x-icon" />
    <link rel="shortcut icon" href="<?php echo FAVICON?>" type="image/x-icon" />
    <?php //endif FAVICON ?>

    <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER DIR_WS_HTTPS_CATALOG HTTP_SERVER DIR_WS_CATALOG ); ?>" />
    <?php if (isset($canonicalLink) && $canonicalLink != '') { ?>
    <link rel="canonical" href="<?php echo $canonicalLink?>" />
    <?php ?>

    <?php
    /**
     * load all template-specific stylesheets, named like "style*.css", alphabetically
     */
      
    $directory_array $template->get_template_part($template->get_template_dir('.css',DIR_WS_TEMPLATE$current_page_base,'css'), '/^style/''.css');
      while(list (
    $key$value) = each($directory_array)) {
        echo 
    '<link rel="stylesheet" type="text/css" href="' $template->get_template_dir('.css',DIR_WS_TEMPLATE$current_page_base,'css') . '/' $value '" />'."\n";
      }
    /**
     * load stylesheets on a per-page/per-language/per-product/per-manufacturer/per-category basis. Concept by Juxi Zoza.
     */
      
    $manufacturers_id = (isset($_GET['manufacturers_id'])) ? $_GET['manufacturers_id'] : '';
      
    $tmp_products_id = (isset($_GET['products_id'])) ? (int)$_GET['products_id'] : '';
      
    $tmp_pagename = ($this_is_home_page) ? 'index_home' $current_page_base;
      if (
    $current_page_base == 'page' && isset($ezpage_id)) $tmp_pagename $current_page_base . (int)$ezpage_id;
      
    $sheets_array = array('/' $_SESSION['language'] . '_stylesheet',
                            
    '/' $tmp_pagename,
                            
    '/' $_SESSION['language'] . '_' $tmp_pagename,
                            
    '/c_' $cPath,
                            
    '/' $_SESSION['language'] . '_c_' $cPath,
                            
    '/m_' $manufacturers_id,
                            
    '/' $_SESSION['language'] . '_m_' . (int)$manufacturers_id,
                            
    '/p_' $tmp_products_id,
                            
    '/' $_SESSION['language'] . '_p_' $tmp_products_id
                            
    );
      while(list (
    $key$value) = each($sheets_array)) {
        
    //echo "<!--looking for: $value-->\n";
        
    $perpagefile $template->get_template_dir('.css'DIR_WS_TEMPLATE$current_page_base'css') . $value '.css';
        if (
    file_exists($perpagefile)) echo '<link rel="stylesheet" type="text/css" href="' $perpagefile .'" />'."\n";
      }

    /**
     * load printer-friendly stylesheets -- named like "print*.css", alphabetically
     */
      
    $directory_array $template->get_template_part($template->get_template_dir('.css',DIR_WS_TEMPLATE$current_page_base,'css'), '/^print/''.css');
      
    sort($directory_array);
      while(list (
    $key$value) = each($directory_array)) {
        echo 
    '<link rel="stylesheet" type="text/css" media="print" href="' $template->get_template_dir('.css',DIR_WS_TEMPLATE$current_page_base,'css') . '/' $value '" />'."\n";
      }

    /**
     * load all site-wide jscript_*.js files from includes/templates/YOURTEMPLATE/jscript, alphabetically
     */
      
    $directory_array $template->get_template_part($template->get_template_dir('.js',DIR_WS_TEMPLATE$current_page_base,'jscript'), '/^jscript_/''.js');
      while(list (
    $key$value) = each($directory_array)) {
        echo 
    '<script type="text/javascript" src="' .  $template->get_template_dir('.js',DIR_WS_TEMPLATE$current_page_base,'jscript') . '/' $value '"></script>'."\n";
      }

    /**
     * load all page-specific jscript_*.js files from includes/modules/pages/PAGENAME, alphabetically
     */
      
    $directory_array $template->get_template_part($page_directory'/^jscript_/''.js');
      while(list (
    $key$value) = each($directory_array)) {
        echo 
    '<script type="text/javascript" src="' $page_directory '/' $value '"></script>' "\n";
      }

    /**
     * load all site-wide jscript_*.php files from includes/templates/YOURTEMPLATE/jscript, alphabetically
     */
      
    $directory_array $template->get_template_part($template->get_template_dir('.php',DIR_WS_TEMPLATE$current_page_base,'jscript'), '/^jscript_/''.php');
      while(list (
    $key$value) = each($directory_array)) {
    /**
     * include content from all site-wide jscript_*.php files from includes/templates/YOURTEMPLATE/jscript, alphabetically.
     * These .PHP files can be manipulated by PHP when they're called, and are copied in-full to the browser page
     */
        
    require($template->get_template_dir('.php',DIR_WS_TEMPLATE$current_page_base,'jscript') . '/' $value); echo "\n";
      }
    /**
     * include content from all page-specific jscript_*.php files from includes/modules/pages/PAGENAME, alphabetically.
     */
      
    $directory_array $template->get_template_part($page_directory'/^jscript_/');
      while(list (
    $key$value) = each($directory_array)) {
    /**
     * include content from all page-specific jscript_*.php files from includes/modules/pages/PAGENAME, alphabetically.
     * These .PHP files can be manipulated by PHP when they're called, and are copied in-full to the browser page
     */
        
    require($page_directory '/' $value); echo "\n";
      }

    /**
    * load the loader files
    */

    if($RI_CJLoader->get('status')){
        
    $directory_array $template->get_template_part(DIR_WS_TEMPLATE.'auto_loaders''/^loader_/''.php');
        
        
    $loaders_check $RI_CJLoader->get('loaders');
        if(
    $loaders_check == '*' || count($loaders_check) > 0){
            while(list (
    $key$value) = each($directory_array)) {
            
    /**
            * include content from all site-wide loader_*.php files from includes/templates/YOURTEMPLATE/jscript/auto_loaders, alphabetically.
            */
                
    if($loaders_check == '*' || in_array($value$loaders_check))
                    require(
    DIR_WS_TEMPLATE.'auto_loaders''/' $value);
            }
        }
        
        
    $RI_CJLoader->loadCssJsFiles();
        
    $files $RI_CJLoader->processCssJsFiles();
        foreach(
    $files['css'] as $file)
            if(
    $file['include']) include($file['string']);
            else echo 
    $file['string'];
            
        foreach(
    $files['js'] as $file)
            if(
    $file['include']) include($file['string']);
            else echo 
    $file['string'];
    }
    // DEBUG: echo '<!-- I SEE cat: ' . $current_category_id . ' || vs cpath: ' . $cPath . ' || page: ' . $current_page . ' || template: ' . $current_template . ' || main = ' . ($this_is_home_page ? 'YES' : 'NO') . ' -->';


    ?>
    <?php 
    echo rss_feed_link_alternate(); // RSS Feed ?>
    </head>
    <?php // NOTE: Blank line following is intended: ?>
    to this:
    PHP Code:
    <?php
    /**
     * Common Template
     *
     * outputs the html header. i,e, everything that comes before the \</head\> tag <br />
     *
     * @package templateSystem
     * @copyright Copyright 2003-2010 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: html_header.php 15761 2010-03-31 19:31:27Z drbyte $
     */
    /**
     * load the module for generating page meta-tags
     */
    require(DIR_WS_MODULES zen_get_module_directory('meta_tags.php'));
    /**
     * output main page HEAD tag and related headers/meta-tags, etc
     */
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" <?php echo HTML_PARAMS?>>
    <head>
    <title><?php echo META_TAG_TITLE?></title>
    <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET?>" />
    <meta name="keywords" content="<?php echo META_TAG_KEYWORDS?>" />
    <meta name="description" content="<?php echo META_TAG_DESCRIPTION?>" />
    <meta http-equiv="imagetoolbar" content="no" />
    <meta name="author" content="Clevershoppers.com" />
    <meta name="generator" content="shopping cart program by Zen Cart&trade;, http://www.zen-cart.com eCommerce" />
    <?php if (defined('ROBOTS_PAGES_TO_SKIP') && in_array($current_page_base,explode(",",constant('ROBOTS_PAGES_TO_SKIP'))) || $current_page_base=='down_for_maintenance' || $robotsNoIndex === true) { ?>
    <meta name="robots" content="noindex, nofollow" />
    <?php ?>
    <?php 
    if (defined('FAVICON')) { ?>
    <link rel="icon" href="<?php echo FAVICON?>" type="image/x-icon" />
    <link rel="shortcut icon" href="<?php echo FAVICON?>" type="image/x-icon" />
    <?php //endif FAVICON ?>

    <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER DIR_WS_HTTPS_CATALOG HTTP_SERVER DIR_WS_CATALOG ); ?>" />
    <?php if (isset($canonicalLink) && $canonicalLink != '') { ?>
    <link rel="canonical" href="<?php echo $canonicalLink?>" />
    <?php ?>

    <?php
    /**
    * load the loader files
    */

    if($RI_CJLoader->get('status')){
        
    $directory_array $template->get_template_part(DIR_WS_TEMPLATE.'auto_loaders''/^loader_/''.php');
        
        
    $loaders_check $RI_CJLoader->get('loaders');
        if(
    $loaders_check == '*' || count($loaders_check) > 0){
            while(list (
    $key$value) = each($directory_array)) {
            
    /**
            * include content from all site-wide loader_*.php files from includes/templates/YOURTEMPLATE/jscript/auto_loaders, alphabetically.
            */
                
    if($loaders_check == '*' || in_array($value$loaders_check))
                    require(
    DIR_WS_TEMPLATE.'auto_loaders''/' $value);
            }
        }
        
        
    $RI_CJLoader->loadCssJsFiles();
        
    $files $RI_CJLoader->processCssJsFiles();
        foreach(
    $files['css'] as $file)
            if(
    $file['include']) include($file['string']);
            else echo 
    $file['string'];
            
        foreach(
    $files['js'] as $file)
            if(
    $file['include']) include($file['string']);
            else echo 
    $file['string'];
    }
    // DEBUG: echo '<!-- I SEE cat: ' . $current_category_id . ' || vs cpath: ' . $cPath . ' || page: ' . $current_page . ' || template: ' . $current_template . ' || main = ' . ($this_is_home_page ? 'YES' : 'NO') . ' -->';


    ?>
    <?php 
    echo rss_feed_link_alternate(); // RSS Feed ?>
    </head>
    <?php // NOTE: Blank line following is intended: ?>
    Then the duplicate is gone. Is this the right way to go about this?

  10. #10
    Join Date
    Dec 2009
    Posts
    204
    Plugin Contributions
    0

    Default Re: css javascript loader addon

    Yes that's the right way to do it. I am using it the same on my shops.

 

 
Page 1 of 12 12311 ... LastLast

Similar Threads

  1. Replies: 8
    Last Post: 26 Feb 2016, 12:41 AM
  2. css/js loader !!
    By Miff in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 28 Nov 2011, 01:19 PM
  3. CJ Loader (CSS/Javascript Loader) plugin function is not loaded by zen cart?
    By tripflex in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 11 Jul 2011, 03:55 PM
  4. Yellow1912's css javascript loader breaks Ajax EasySlider
    By dutchy in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 27 Oct 2010, 11:23 AM
  5. [support thread] Javascript loader
    By yellow1912 in forum All Other Contributions/Addons
    Replies: 7
    Last Post: 7 Nov 2009, 12:11 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg