API15

Difference between revisions of "JHTMLBehavior/mootools"

From Joomla! Documentation

< API15:JHTMLBehavior
m (removing red link to edit, no existant pages)
(2 intermediate revisions by 2 users not shown)
Line 3: Line 3:
  
 
<span class="editsection" style="font-size:76%;">
 
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[Description:JHTMLBehavior/mootools|Edit Descripton]]<nowiki>]</nowiki>
+
<nowiki>[<! removed edit link to red link >]</nowiki>
 
</span>
 
</span>
  
{{Description:JHTMLBehavior/mootools}}
+
<! removed transcluded page call, red link never existed >
  
 
===Syntax===
 
===Syntax===
Line 61: Line 61:
  
 
<span class="editsection" style="font-size:76%;">
 
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[SeeAlso:JHTMLBehavior/mootools|Edit See Also]]<nowiki>]</nowiki>
+
<nowiki>[<! removed edit link to red link >]</nowiki>
 
</span>
 
</span>
{{SeeAlso:JHTMLBehavior/mootools}}
+
<! removed transcluded page call, red link never existed >
  
 
===Examples===
 
===Examples===
<source lang="php">
 
// This example depends on mootools
 
JHTMLBehavior::mootools();
 
 
// Do something after page has loaded
 
$document =& JFactory::getDocument();
 
$document->addScriptDeclaration("window.addEvent('load', function() { doSomething(); })");
 
</source>
 
{{SeeAlso:JDocument/addScriptDeclaration}}
 
 
<CodeExamplesForm />
 
<CodeExamplesForm />
 
<dpl>
 
<dpl>
Line 85: Line 76:
 
  format= ,,,
 
  format= ,,,
 
</dpl>
 
</dpl>
 +
[[Category:Archived pages API15]]

Revision as of 12:22, 12 May 2013

The "API15" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

Description[edit]

Method to load the mootools framework into the document head

[<! removed edit link to red link >]

<! removed transcluded page call, red link never existed >

Syntax[edit]

mootools($debug=null)
Parameter Name Default Value Description
$debug null $debug Is debugging mode on? [optional]

Returns[edit]

void

Defined in[edit]

libraries/joomla/html/html/behavior.php

Importing[edit]

jimport( 'joomla.html.html.behavior' );

Source Body[edit]

function mootools($debug = null)
{
        static $loaded;

        // Only load once
        if ($loaded) {
                return;
        }

        // If no debugging value is set, use the configuration setting
        if ($debug === null) {
                $config = &JFactory::getConfig();
                $debug = $config->getValue('config.debug');
        }

        // TODO NOTE: Here we are checking for Konqueror - If they fix thier issue with compressed, we will need to update this
        $konkcheck = isset($_SERVER['HTTP_USER_AGENT']) ? strpos(strtolower($_SERVER['HTTP_USER_AGENT']), "konqueror") : null;

        if ($debug || $konkcheck) {
                JHTML::script('mootools-uncompressed.js', 'media/system/js/', false);
        } else {
                JHTML::script('mootools.js', 'media/system/js/', false);
        }
        $loaded = true;
        return;
}

[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >

Examples[edit]

<CodeExamplesForm />

A typical example of loading MooTools

// This example depends on mootools
JHTML::_('behavior.mootools');

// Do something after page has loaded
$document =& JFactory::getDocument();
$document->addScriptDeclaration("window.addEvent('load', function() { doSomething(); })");
Chris Davenport 01:07, 22 April 2010 (EDT) Edit comment