WEDJavascript é um componente simples com uma view no frontend e uma no backend com algum código que agiliza pequenos testes com javascript. Além disso carrega a biblioteca padrão do Mootools (que no Joomla 1.5 é o Mootools 1.1) No frontend você também irá ver saida JSON gerada por um Array de PHP, útil ao se trabalhar com AJAX e afins.
Abaixo segue parte do código do componente, cuja versão na hora de escrita deste post é 0.3.0.1. Para checar versões mais recentes, veja o link para download no final do post.
defined('_JEXEC') or die('Access Denied');
$document =& JFactory::getDocument(); // do not delete
############################## INSERT J!MOOTOOLS #############################
//Special tags to include Joomla Default Mootools libraries
JHTML::_( 'behavior.mootools' );//Include Mootools
JHTML::_('behavior.modal'); // Behavior Modal
jimport('joomla.html.pane'); // Jpane: JPane class types include 'Tabs' and 'Sliders'.
JHTML::_('behavior.formvalidation'); //Form Validation
############################## INSERT J!MOOTOOLS #############################
################################# CUSTOM PHP ################################
//Add custom php here.
################################# CUSTOM PHP ################################
############################## INLINE JAVASCRIPT #############################
//Tip: Remember that you can also add {$phpvariable} inside
$javascriptinline = <<<JS
<!-- WEDJavascript: inline javascript start -->
<script type="text/javascript">
</script>
<!-- WEDJavascript: inline javascript end -->
JS;
############################## INLINE JAVASCRIPT #############################
################################# INLINE CSS #################################
//Tip: Remember that you can also add {$phpvariable} inside
$cssinline = <<<CSS
<!-- WEDJavascript: inline css start -->
<style type="text/css">
</style>
<!-- WEDJavascript: inline css end -->
CSS;
################################# INLINE CSS #################################
############################# EXTERNAL JAVASCRIPT ############################
//Add one especific javascript file on html <head> tag
//$document->addScript( '/media/system/js/sample.js' ); //example that add /media/system/js/sample.js to <head> tag
############################# EXTERNAL JAVASCRIPT ############################
//Add the $javascriptinline to the page. Do not need change
$document->addCustomTag($javascriptinline);
$document->addCustomTag($cssinline);
?>
<!-- WEDjavascript frontend start -->
<h2>WEDJavascript - Code for help a bit when testing javascript in Joomla frontend :D</h2>
Tip: don't forget to access <a href="/component/wedjavascript/?view=wedjavascript&format=raw" target="_blank">JSON simple output</a>
More info on <a href="http://www.fititnt.org/wedjavascript.html" target="_blank">WEDJavascript page</a>.
<!-- WEDjavascript frontend end -->
WEDJavascript é um componente simples com uma view no frontend e uma no backend com algum código que agiliza pequenos testes com javascript. Além disso carrega a biblioteca padrão do Mootools ( que no Joomla 1.5 é o Mootools 1.1)
No frontend você também irá ver saida JSON gerada por um Array de PHP, útil ao se trabalhar com AJAX e afins.
Download do WEDjavascript
Para obter o componente WEDjavascript, acesse a área de download.
Faça também download de componentes relacionados a Javascript + Joomla
Se você quer saber mais sobre como usar Behavior Modal em Joomla, tem um componente feito já com demonstração de implementação. Faça o download do WEDModal
fititnt.org is not affiliated with or endorsed by the Joomla Project or Open Source Matters. The Joomla logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries