Skip to content

Commit

Permalink
Added new function for show/hide on landing page. copied from old scr…
Browse files Browse the repository at this point in the history
…ipt used in version 6.
  • Loading branch information
tomfuller2 committed Dec 11, 2012
1 parent dde304c commit 81f5852
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 11 deletions.
11 changes: 10 additions & 1 deletion com_biblestudy/media/js/biblestudy.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,15 @@ function ReverseDisplay() {
}
}


function HideContent(d) {
document.getElementById(d).style.display = "none";
}
function ShowContent(d){
document.getElementById(d).style.display = "block";
}
function ReverseDisplay2(d){
if(document.getElementById(d).style.display == "none"){document.getElementById(d).style.display = "block";}
else {document.getElementById(d).style.display = "none";}
}


5 changes: 3 additions & 2 deletions com_biblestudy/site/views/landingpage/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
$params = $this->params;
JViewLegacy::loadHelper('listing');
?>

<div id="biblestudy_landing" class="noRefTagger"> <!-- This div is the container for the whole page -->
<div id="bsms_header">
<h1 class="componentheading">
Expand Down Expand Up @@ -93,8 +94,8 @@

$showhideall = "<div id='showhide" . $i . "'>";

$buttonlink = "\n\t" . '<a class="showhideheadingbutton" href="javascript:ReverseDisplay(' . "'showhide" . $showIt . "'" . ')">';
$labellink = "\n\t" . '<a class="showhideheadinglabel" href="javascript:ReverseDisplay(' . "'showhide" . $showIt . "'" . ')">';
$buttonlink = "\n\t" . '<a class="showhideheadingbutton" href="javascript:ReverseDisplay2(' . "'showhide" . $showIt . "'" . ')">';
$labellink = "\n\t" . '<a class="showhideheadinglabel" href="javascript:ReverseDisplay2(' . "'showhide" . $showIt . "'" . ')">';

switch ($params->get('landing_hide', 0)) {
case 0: // image only
Expand Down
23 changes: 15 additions & 8 deletions com_biblestudy/site/views/landingpage/view.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
require_once (JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_biblestudy' . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'biblestudy.images.class.php');
require_once (JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_biblestudy' . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'biblestudy.admin.class.php');
JLoader::register('BiblestudyHelper', JPATH_COMPONENT.'/helpers/images.php');
JLoader::register('JBSMHelper', JPATH_ADMINISTRATOR.'/components/com_biblestudy/helpers/helper.php');

/**
* Landing page list view class
Expand Down Expand Up @@ -83,22 +84,28 @@ public function display($tpl = null) {

$document = JFactory::getDocument();
$document->addScript(JURI::base() . 'media' . DIRECTORY_SEPARATOR . 'com_biblestudy' . DIRECTORY_SEPARATOR . 'js' . DIRECTORY_SEPARATOR . 'tooltip.js');
//JViewLegacy::loadHelper('helper');
JViewLegacy::loadHelper('helper');
$images = new jbsImages();
$showhide = $images->getShowhide();
$document->addScriptDeclaration($showhide);
//$document->addScriptDeclaration($showhide);

$css = $params->get('css');

if (BIBLESTUDY_CHECKREL){JHtml::_('jquery.framework');}
//Import Scripts
$document->addScript(JURI::base() . 'media/com_biblestudy/js/jquery.js');
$document->addScript(JURI::base() . 'media/com_biblestudy/js/biblestudy.js');
JHtml::script('media/com_biblestudy/js/biblestudy.js');
JHtml::script('media/com_biblestudy/js/jquery.js');
//$document->addScript(JURI::base() . 'media/com_biblestudy/js/jquery.js');
//$document->addScript(JURI::base() . 'media/com_biblestudy/js/biblestudy.js');

//Import Stylesheets
$document->addStylesheet(JURI::base() . 'media/com_biblestudy/css/general.css');
JHtml::stylesheet('media/com_biblestudy/css/general.css');
//$document->addStylesheet(JURI::base() . 'media/com_biblestudy/css/general.css');
if ($css <= "-1"):
$document->addStyleSheet(JURI::base() . 'media/com_biblestudy/css/biblestudy.css');
JHtml::stylesheet('media/com_biblestudy/css/biblestudy.css');
//$document->addStyleSheet(JURI::base() . 'media/com_biblestudy/css/biblestudy.css');
else:
$document->addStyleSheet(JURI::base() . 'media/com_biblestudy/css/site/' . $css);
JHtml::stylesheet('media/com_biblestudy/css/site/' . $css);
//$document->addStyleSheet(JURI::base() . 'media/com_biblestudy/css/site/' . $css);
endif;

$url = $params->get('stylesheet');
Expand Down

0 comments on commit 81f5852

Please sign in to comment.