Skip to content

Commit

Permalink
refactored layouts, putting styles & scripts declarations in doc header
Browse files Browse the repository at this point in the history
  • Loading branch information
PapePathe committed Sep 1, 2010
1 parent d3793bc commit f6419e4
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 86 deletions.
2 changes: 1 addition & 1 deletion mod_xws_content/mod_xws_content.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<license>GPL</license>
<authorEmail>pathe.sene@gmail.com</authorEmail>
<authorUrl>www.xarala.sn</authorUrl>
<version>0.6.6</version>
<version>0.6.7</version>
<description>
<![CDATA[
<h2>Xws_Content: displaying joomla content items made stupid simple</h2>
Expand Down
39 changes: 16 additions & 23 deletions mod_xws_content/tmpl/accordion/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,30 @@
* ----------------------------------------------------------------------------- */
defined('_JEXEC') or die('Restricted access');

/* Load jquery ui css assets
* ----------------------------------------------------------------------------- */
modXwsContentHelper::loadJqueryUiStylesheets($params);

/**
* Load javascript assets
* jquery
* jquery-ui & xwsUiHelpers
* ----------------------------------------------------------------------------- */
modXwsContentHelper::loadJquery($params);
modXwsContentHelper::loadJqueryUi($params);

/* Load jquery ui css assets
* ----------------------------------------------------------------------------- */
modXwsContentHelper::loadJqueryUiStylesheets($params);

$this->_doc->addScriptDeclaration("
// <![CDATA[
jQuery.noConflict();
jQuery(document).ready(function(){
jQuery.xwsUiHelpers.enableAccordions();
jQuery.xwsReadmore.buildButtons({
icon: 'ui-icon-arrowstop-1-e',
wrapper: 'p.xwsReadMoreWrapper'
});
});
// ]]>
");
?>

<div id = "xwsAccordionModule<?php echo $module->id; ?>">
<?php foreach ($list as $item) : ?>
<h3><a href="#" rel="nofollow" title="<?php echo $item->title; ?>"><?php echo $item->title; ?></a></h3>
Expand All @@ -43,21 +53,4 @@
</div>
<?php endforeach; ?>
</div>
<?php
/**
* Setup javascript behavior for the layout
*/
?>
<script type="text/javascript" language="javascript" charset="utf-8">
// <![CDATA[
jQuery.noConflict();
jQuery(document).ready(function(){
jQuery.xwsUiHelpers.enableAccordions();
jQuery.xwsReadmore.buildButtons({
icon: 'ui-icon-arrowstop-1-e',
wrapper: 'p.xwsReadMoreWrapper'
});
});
// ]]>
</script>

36 changes: 15 additions & 21 deletions mod_xws_content/tmpl/scrollable-horizontal/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,21 @@
* ----------------------------------------------------------------------------- */
modXwsContentHelper::loadJquery($params);
modXwsContentHelper::loadJqueryTools($params);

$this->_doc->addScriptDeclaration("
// <![CDATA[
jQuery.noConflict();
jQuery(document).ready(function(){
jQuery('#xwsScrollableHoriontal" . $module->id . "').scrollable({
speed: 700,
circular: true
});
jQuery.xwsReadmore.buildButtons({
icon: 'ui-icon-arrowstop-1-e',
wrapper: 'p.xwsReadMoreWrapper'
});
});
// ]]>
");
?>
<?php
/**
Expand All @@ -72,24 +86,4 @@
</div>
</div>
<a class="next browse right"title="<?php echo JText::_('NEXT_SCROLLABLE_ITEM') ?>"></a>
<?php
/**
* Setup javascript behavior for the layout
*/
?>
<script type="text/javascript" language="javascript" charset="utf-8">
// <![CDATA[
jQuery.noConflict();
jQuery(document).ready(function(){
jQuery('#xwsScrollableHoriontal<?php echo $module->id ?>').scrollable({
speed: 700,
circular: true
});
jQuery.xwsReadmore.buildButtons({
icon: 'ui-icon-arrowstop-1-e',
wrapper: 'p.xwsReadMoreWrapper'
});
});
// ]]>
</script>

33 changes: 14 additions & 19 deletions mod_xws_content/tmpl/scrollable-vertical/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,20 @@
* ----------------------------------------------------------------------------- */
modXwsContentHelper::loadJquery($params);
modXwsContentHelper::loadJqueryTools($params);
$this->_doc->addScriptDeclaration("
// <![CDATA[
jQuery.noConflict();
jQuery(document).ready(function(){
jQuery('#xwsScrollableVertical" . $module->id . "').scrollable({
vertical: true
});
jQuery.xwsReadmore.buildButtons({
icon: 'ui-icon-arrowstop-1-e',
wrapper: 'p.xwsReadMoreWrapper'
});
});
// ]]>
");

?>
<?php
Expand Down Expand Up @@ -79,23 +93,4 @@
<?php endforeach; ?>
</div>
</div>
<?php
/**
* Setup javascript behavior for the layout
*/
?>
<script type="text/javascript" language="javascript" charset="utf-8">
// <![CDATA[
jQuery.noConflict();
jQuery(document).ready(function(){
jQuery('#xwsScrollableVertical<?php echo $module->id ?>').scrollable({
vertical: true
});
jQuery.xwsReadmore.buildButtons({
icon: 'ui-icon-arrowstop-1-e',
wrapper: 'p.xwsReadMoreWrapper'
});
});
// ]]>
</script>

39 changes: 17 additions & 22 deletions mod_xws_content/tmpl/tabs/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,30 @@
/* No direct access to joomla filesystem
* ----------------------------------------------------------------------------- */
defined('_JEXEC') or die('Restricted access');

/* Load jquery ui css assets
* ----------------------------------------------------------------------------- */
modXwsContentHelper::loadJqueryUiStylesheets($params);

/**
* Load javascript assets
* jquery
* jquery-ui & xwsUiHelpers
* ----------------------------------------------------------------------------- */
modXwsContentHelper::loadJquery($params);
modXwsContentHelper::loadJqueryUi($params);

/* Load jquery ui css assets
* ----------------------------------------------------------------------------- */
modXwsContentHelper::loadJqueryUiStylesheets($params);

$this->_doc->addScriptDeclaration("
// <![CDATA[
jQuery.noConflict();
jQuery(document).ready(function(){
jQuery.xwsUiHelpers.enableTabs();
jQuery.xwsReadmore.buildButtons({
icon: 'ui-icon-arrowstop-1-e',
wrapper: 'p.xwsReadMoreWrapper'
});
});
// ]]>
");
?>
<div id = "xwsTabs<?php echo $module->id; ?>">
<ul class=" <?php echo $params->get('moduleclass_sfx'); ?>">
Expand All @@ -49,21 +61,4 @@
</div>
<?php endforeach; ?>
</div>
<?php
/**
* Setup javascript behavior for the layout
*/
?>
<script type="text/javascript" language="javascript" charset="utf-8">
// <![CDATA[
jQuery.noConflict();
jQuery(document).ready(function(){
jQuery.xwsUiHelpers.enableTabs();
jQuery.xwsReadmore.buildButtons({
icon: 'ui-icon-arrowstop-1-e',
wrapper: 'p.xwsReadMoreWrapper'
});
});
// ]]>
</script>

0 comments on commit f6419e4

Please sign in to comment.