mootools

MooTools (My Object-Oriented Tools) is a lightweight, object-oriented, JavaScript framework. It is released under the free, open-source MIT License. read more at WikiPedia

  • joomla_cms

    I did optimize a bit my Joomla! homepage in the last few days. This has been achieved with

    • Enabling Joomla module caching in all 3rd party module where it was missing/ not implemented at all,
    • Starting to offload some assets (JavaScript) to faster hosting,

    Click read more to apply the same for your internet site.

    Use Joomla Module caching

    Not all 3rd party Joomla modules are using caching. This means that in worst case, some Joomla! modules may create way too much SQL queries. A way to reduce the load is to activate module caching. You’ll have to go through all 3rd party modules and check that they have in their administrator panel a setting to enable/disable cache.

    jooomla.enable.caching

    You’ll see that 90% of all modules (except official Joomla! modules which are able to deal with caching) are NOT supporting caching. We will change that now:

    For every module without cache, open the xml file at /modules/mod_xxxxxxx/mod_xxxxxxx.xml and add between <params> .. </params>

    <param name="cache" type="radio" default="0" label="Enable Cache" 
           description="Select whether to cache the content of this module">
     <option value="0">No</option>
     <option value="1">Yes</option>
    </param>

    Note that if <params> .. </params> do not exist, just add it like below

    <params>
     <param name="cache" type="radio" default="0" label="Enable Cache" 
           description="Select whether to cache the content of this module">
      <option value="0">No</option>
      <option value="1">Yes</option>
     </param>
    </params>

    Visit or reload the admin panel of that module and set the Enable Cache to Yes.Click Save/Apply at least once.

    Now the output of this module will be saved in /cache and only refresh when global Joomla cache timeout (900 seconds as default). Consider also contacting the author of the module so he can patch his code.

    Offload assets

    Offloading assets (JavaScript, static images, static files) can bring tremendous speed gains, at the cost of resolving more DNS name. Using this technique will help your Apache concentrate on php instead of streaming static data.

    Offload JavaScript

    When you look at Joomla! frontend source code, you will see that the JavaScript library mootols.js is 74kb big. Google is offering to host all major AJAX  libraries free of charge at http://code.google.com/apis/ajaxlibs/documentation/ so why not profiting of their datacenter speed/bandwidth/response time?

    Now the dirty part, You can’t tell Joomla! not to include the mootols.js from /media/system/js/mootools.js at rendering time. We will have to patch the code of Joomla!

    open /libraries/joomla/html/html/behavior.php and search for

    if ($debug || $konkcheck) {
      JHTML::script('mootools-uncompressed.js', 'media/system/js/', false);
    } else {
     //JHTML::script('mootools.js', 'media/system/js/', false); // old Joomla code
     JHTML::script('mootools-yui-compressed.js', 'http://ajax.googleapis.com/ajax/libs/mootools/1.11/', false);
    }

    Joomla use mootools.js in version 1.11, don’t use the latest version (1.2.3) as most Joomla! plugin wont work (but your mileage may vary).

    To be continued

  • I am working on a small proof of concept for Joomla! and components that allow visitors to leave comments. At engadget, there is, since the redesign, an interesting widget written in CSS (click on picture to see it running)

    engadgetRecap


    And here is my version, achieved after 2 hours of work. There is still some work to do to make it move pleasant to the eyes, the PHP API is stable even if there is some changes still to be done in JavaScript.

    fancyCommentBox.mootools 

    • Size of bubble is dynamic and depending on number of comments but can be configured to be always of the same size.
    • Y axis label (0 - 128) need to be remove (JavaScript)
    • X label (0 - 100) must be replaced by time (JavaScript)
    • Joomla! 1.5 module
    • Use Mootools 1.2
    • Use MooChart from Johan Nordberg
    • OO code from the beginning, 300 LOC

    Functionalities (ideas)

    • Get the latest X articles of the week and display bubble against number of comments,
    • Get the highest commented articles,

    Release date is unknown, still need to take care of my mother and go first through my forums