Page 16 of 17 FirstFirst ... 614151617 LastLast
Results 151 to 160 of 170
  1. #151
    Join Date
    Jun 2007
    Posts
    474
    Plugin Contributions
    2

    Default Re: CSS JS Loader [Support Thread]

    If you are trying to install this on Zen-Cart 1.5.5f with the template Responsive_Classic (and probably some other responsive templates) and keep getting a white page, the reason is that Responsive_Classic needs to run jscript in the html_header.php file and CSS/JS Loader has moved all JQuery loads (including the base file) to the end of the <body> of the page.

    Therefore when the script in htm_header.php tries to run it fails.

    Specifically this:
    Code:
      <script type="text/javascript">document.documentElement.className = 'no-fouc';</script>
    Therefore, whatever you do below, make sure it is in the html_header.php file above that section of code.

    Here are 3 fixes (don't do all three, just pick one):
    1) Use your programming skills to move the html_header.php script out of the header. Then post how because I'm not skilled enough to do it and suspect it isn't possible without changing the entire template structure.

    2) Since the JQuery Core should probably load on every page, and it is needed for the script in html_header.php, add back to html_header.php the code for loading the JQuery core. That means put this:
    Code:
    <script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript type="text/javascript" src="//code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"%3E%3C/script%3E'));</script><script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript type="text/javascript" src="<?php echo $template->get_template_dir('.js',DIR_WS_TEMPLATE, $current_page_base,'jscript'); ?>/jquery.min.js"%3E%3C/script%3E'));</script>
    somewhere in the file (not inside php tags). It is already minified so no worry that it isn't in the CSS/Loader. In your auto loaders make sure you aren't calling for another JQuery Core to be loaded.

    3) Load all the JS loader/minified files in the header. Take the code that is specified as going in the tpl_main_page.php file (the JS loader code) and instead put it in html_header.php under the other code (the CSS loader code) you already added. Remember to remove it from tpl_main_page.php if you previously added it there.

  2. #152
    Join Date
    Jun 2007
    Posts
    474
    Plugin Contributions
    2

    Default Re: CSS JS Loader [Support Thread]

    After even more testing I found I could only get this to work doing #2.

  3. #153
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,300
    Plugin Contributions
    1

    Default Re: CSS JS Loader [Support Thread]

    I've noticed that the standard install of this mod effectively removes the 'custom category handling for a parent and all its children' as in the use of c_??_??_children.css stylesheets. I can reinstate this by leaving the following code in html_header.php

    Code:
    /**
     *  custom category handling for a parent and all its children ... works for any c_XX_XX_children.css  where XX_XX is any parent category
     */
      $tmp_cats = explode('_', $cPath);
      $value = '';
      foreach($tmp_cats as $val) {
        $value .= $val;
        $perpagefile = $template->get_template_dir('.css', DIR_WS_TEMPLATE, $current_page_base, 'css') . '/c_' . $value . '_children.css';
        if (file_exists($perpagefile)) echo '<link rel="stylesheet" type="text/css" href="' . $perpagefile .'" />'."\n";
        $perpagefile = $template->get_template_dir('.css', DIR_WS_TEMPLATE, $current_page_base, 'css') . '/' . $_SESSION['language'] . '_c_' . $value . '_children.css';
        if (file_exists($perpagefile)) echo '<link rel="stylesheet" type="text/css" href="' . $perpagefile .'" />'."\n";
        $value .= '_';
      }
    This obviously means that the c_XX_XX_children.css is not minimised. I would have expected the above code to have been incorporated in to the /plugins/riCjLoader/RiCjLoaderPlugin.php file - as is the case with the other stylesheets.

    Does anyone have an example of how the RiCjLoaderPlugin.php code should be modified?
    Simon

  4. #154
    Join Date
    Dec 2009
    Location
    Amersfoort, The Netherlands
    Posts
    2,845
    Plugin Contributions
    25

    Default Re: CSS JS Loader [Support Thread]

    Quote Originally Posted by simon1066 View Post
    I've noticed that the standard install of this mod effectively removes the 'custom category handling for a parent and all its children' as in the use of c_??_??_children.css stylesheets. I can reinstate this by leaving the following code in html_header.php

    Code:
    /**
     *  custom category handling for a parent and all its children ... works for any c_XX_XX_children.css  where XX_XX is any parent category
     */
      $tmp_cats = explode('_', $cPath);
      $value = '';
      foreach($tmp_cats as $val) {
        $value .= $val;
        $perpagefile = $template->get_template_dir('.css', DIR_WS_TEMPLATE, $current_page_base, 'css') . '/c_' . $value . '_children.css';
        if (file_exists($perpagefile)) echo '<link rel="stylesheet" type="text/css" href="' . $perpagefile .'" />'."\n";
        $perpagefile = $template->get_template_dir('.css', DIR_WS_TEMPLATE, $current_page_base, 'css') . '/' . $_SESSION['language'] . '_c_' . $value . '_children.css';
        if (file_exists($perpagefile)) echo '<link rel="stylesheet" type="text/css" href="' . $perpagefile .'" />'."\n";
        $value .= '_';
      }
    This obviously means that the c_XX_XX_children.css is not minimised. I would have expected the above code to have been incorporated in to the /plugins/riCjLoader/RiCjLoaderPlugin.php file - as is the case with the other stylesheets.

    Does anyone have an example of how the RiCjLoaderPlugin.php code should be modified?
    I have it somewhere. Let me look it up and I'll come back to you.
    I also reported this bug plus solution to the current maintainer of the module some years ago, but it was never fixed.

  5. #155
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,300
    Plugin Contributions
    1

    Default Re: CSS JS Loader [Support Thread]

    Quote Originally Posted by Design75 View Post
    I have it somewhere. Let me look it up and I'll come back to you.
    I also reported this bug plus solution to the current maintainer of the module some years ago, but it was never fixed.
    Thank you.
    Simon

  6. #156
    Join Date
    Dec 2009
    Location
    Amersfoort, The Netherlands
    Posts
    2,845
    Plugin Contributions
    25

    Default Re: CSS JS Loader [Support Thread]

    Ok, here it is.

    in /plugins/riCjLoader/RiCjLoaderPlugin.php find (around line 421):
    PHP Code:
            /**         * load printer-friendly stylesheets -- named like "print*.css", alphabetically         */        if($this->get('load_print')) {            $directory_array $this->findAssets('.css','css''/^print/');            // TODO: don't output link tags directly from here            foreach ($directory_array as $key => $value) {                echo '<link rel="stylesheet" type="text/css" media="print" href="' . $key . '" />'."\n";            }
            

    and add this BEFORE:
    PHP Code:

        
    /**     *  custom category handling for a parent and all its children ... works for any c_XX_XX_children.css  where XX_XX is any parent category     */    $tmp_cats explode('_'$cPath);    $value '';    foreach ($tmp_cats as $val) {      $value .= $val;      $perpagefile $template->get_template_dir('.css'DIR_WS_TEMPLATE$current_page_base'css') . '/c_' $value '_children.css';      if (file_exists($perpagefile)) {        $this->addAssets(array($perpagefile => $load_order++), 'css');      }      $perpagefile $template->get_template_dir('.css'DIR_WS_TEMPLATE$current_page_base'css') . '/' $_SESSION['language'] . '_c_' $value '_children.css';      if (file_exists($perpagefile)) {        $this->addAssets(array($perpagefile => $load_order++), 'css');      }      $value .= '_';    } 

  7. #157
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,300
    Plugin Contributions
    1

    Default Re: CSS JS Loader [Support Thread]

    CSS/JS Loader v5_2_2

    With ZCv1.57 there are multiple MyDEBUG notices in admin (every page refresh) such as

    Code:
    PHP Notice:  Undefined index: gID in ...\mydomain\myadmin\includes\init_includes\init_css_js_loader_config.php on line 85
    a remedy is, in admin/includes/init_includes/init_css_js_loader_config.php change

    Code:
    // Version Checking
    if ($zencart_com_plugin_id != 0) {
        if ($_GET['gID'] == $configuration_group_id) {
            $new_version_details = plugin_version_check_for_updates($zencart_com_plugin_id, $current_version);
            if ($new_version_details != FALSE) {
                $messageStack->add("Version " . $new_version_details['latest_plugin_version'] . " of " . $new_version_details['title'] . ' is available at <a href="' . $new_version_details['link'] . '" target="_blank">[Details]</a>', 'caution');
            }
        }
    }
    to

    Code:
    // Version Checking
    if ($zencart_com_plugin_id != 0 && isset($_GET['gID']) && $_GET['gID'] == $configuration_group_id) {
            $new_version_details = plugin_version_check_for_updates($zencart_com_plugin_id, $current_version);
            if ($new_version_details != FALSE) {
                $messageStack->add("Version " . $new_version_details['latest_plugin_version'] . " of " . $new_version_details['title'] . ' is available at <a href="' . $new_version_details['link'] . '" target="_blank">[Details]</a>', 'caution');
            }
        }
    Thanks to @mc12345678 for the code in init_dpu_config.php
    Simon

  8. #158
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,300
    Plugin Contributions
    1

    Default Re: CSS JS Loader [Support Thread]

    ZC v1.57b
    PHP v7.3.27
    CSS/JS v5.2.4

    PHP v7.3 breaks the minify function of the CSS/JS Loader plugin. No ZC error logs but plenty going on in the browser's console. The fix is here:

    https://github.com/mrclay/minify/pul...9022ed14b4d594
    Simon

  9. #159
    Join Date
    Jul 2006
    Location
    Johannesburg
    Posts
    447
    Plugin Contributions
    1

    Default Re: CSS JS Loader [Support Thread]

    Good day all,

    Does anybody have a working copy of the CSS/JS loader for version 157 (157c) or could you perhaps suggest an alternative to this? I have my website sorted out well in terms of technical issues but I still have a couple of seconds lost on JS and CSS evaluation and scripting. If I can get this sorted out I will have a very smooth running and fast website.

    Please, any assistance will be appreciated.

  10. #160
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,300
    Plugin Contributions
    1

    Default Re: CSS JS Loader [Support Thread]

    Quote Originally Posted by Louis View Post
    Good day all,

    Does anybody have a working copy of the CSS/JS loader for version 157 (157c) or could you perhaps suggest an alternative to this? I have my website sorted out well in terms of technical issues but I still have a couple of seconds lost on JS and CSS evaluation and scripting. If I can get this sorted out I will have a very smooth running and fast website.

    Please, any assistance will be appreciated.
    Direct from the devs website: https://www.numinix.com/zen-cart-plu.../css-js-loader
    Simon

 

 
Page 16 of 17 FirstFirst ... 614151617 LastLast

Similar Threads

  1. v150 CSS Buttons for Admin [Support Thread]
    By lat9 in forum All Other Contributions/Addons
    Replies: 19
    Last Post: 24 Dec 2015, 09:13 PM
  2. v151 CSS/JS Loader installation question
    By McLovin in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 12 Feb 2014, 06:28 PM
  3. css/js loader !!
    By Miff in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 28 Nov 2011, 01:19 PM
  4. 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
  5. [support thread] Javascript loader
    By yellow1912 in forum All Other Contributions/Addons
    Replies: 7
    Last Post: 7 Nov 2009, 12:11 AM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR