| Current Path : /home/juvelize/www/modules/mod_jb_sharebuttons/tmpl/ |
| Current File : /home/juvelize/www/modules/mod_jb_sharebuttons/tmpl/default.php |
<?php
/**
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
* @copyright (c) 2013 JoomBest.Com. All Rights Reserved.
* @author http://www.joombest.com
*/
//echo 100 + (0.1 * (sizeof($list) - 1)); die;
defined('_JEXEC') or die;
$module_class = 'jb_share_buttons_'. $module->id;
ob_start();
?>
@media handheld, only screen and (min-width: 1024px) {
}
<?php
$css = ob_get_contents();
ob_end_clean();
//$document = & JFactory::getDocument();
//$document->addStyleDeclaration($css);
JHtml::stylesheet('modules/'.$module->module.'/lib/css/styles.css');
if( !defined('JB_JQUERY') && $params->get('include_jquery', 0) == "1" ){
JHtml::script('modules/'.$module->module.'/lib/js/jquery-1.8.2.min.js');
JHtml::script('modules/'.$module->module.'/lib/js/jquery.noconflict.js');
define('JB_JQUERY', 1);
}
if( !defined('JB_SHAREBUTTONS') ){
JHtml::script('modules/'.$module->module.'/lib/js/jquery.flexslider-min.js');
JHtml::script('modules/'.$module->module.'/lib/js/css3-mediaqueries.js');
JHtml::script('modules/'.$module->module.'/lib/js/kwiks.js');
define('JB_SHAREBUTTONS', 1);
}
?>
<div id="share-wrapper" class="<?php echo $module_class;?>">
<ul class="share-inner-wrp">
<?php if ($show_facebook): ?>
<!-- Facebook -->
<li class="facebook button-wrap"><a href="#">Facebook</a></li>
<?php endif; ?>
<?php if ($show_twitter): ?>
<!-- Twitter -->
<li class="twitter button-wrap"><a href="#">Tweet</a></li>
<?php endif; ?>
<?php if ($show_digg): ?>
<!-- Digg -->
<li class="digg button-wrap"><a href="#">Digg it</a></li>
<?php endif; ?>
<?php if ($show_stumbleupon): ?>
<!-- Stumbleupon -->
<li class="stumbleupon button-wrap"><a href="#">Stumbleupon</a></li>
<?php endif; ?>
<?php if ($show_delicious): ?>
<!-- Delicious -->
<li class="delicious button-wrap"><a href="#">Delicious</a></li>
<?php endif; ?>
<?php if ($show_google): ?>
<!-- Google -->
<li class="google button-wrap"><a href="#">Plus Share</a></li>
<?php endif; ?>
<?php if ($show_email): ?>
<!-- Email -->
<li class="email button-wrap"><a href="#">Email</a></li>
<?php endif; ?>
</ul>
</div>
<script type="text/javascript">
jQuery(document).ready(function() {
var pageTitle = document.title; //HTML page title
var pageUrl = location.href; //Location of the page
//user hovers on the share button
jQuery('#share-wrapper li').hover(function() {
var hoverEl = jQuery(this); //get element
//browsers with width > 699 get button slide effect
if(jQuery(window).width() > 699) {
if (hoverEl.hasClass('visible')){
hoverEl.animate({"margin-left":"-117px"}, "fast").removeClass('visible');
} else {
hoverEl.animate({"margin-left":"0px"}, "fast").addClass('visible');
}
}
});
//user clicks on a share button
jQuery('.button-wrap').click(function(event) {
var shareName = jQuery(this).attr('class').split(' ')[0]; //get the first class name of clicked element
switch (shareName) //switch to different links based on different social name
{
case 'facebook':
var openLink = 'https://www.facebook.com/sharer/sharer.php?u=' + encodeURIComponent(pageUrl) + '&title=' + encodeURIComponent(pageTitle);
break;
case 'twitter':
var openLink = 'http://twitter.com/home?status=' + encodeURIComponent(pageTitle + ' ' + pageUrl);
break;
case 'digg':
var openLink = 'http://www.digg.com/submit?phase=2&url=' + encodeURIComponent(pageUrl) + '&title=' + encodeURIComponent(pageTitle);
break;
case 'stumbleupon':
var openLink = 'http://www.stumbleupon.com/submit?url=' + encodeURIComponent(pageUrl) + '&title=' + encodeURIComponent(pageTitle);
break;
case 'delicious':
var openLink = 'http://del.icio.us/post?url=' + encodeURIComponent(pageUrl) + '&title=' + encodeURIComponent(pageTitle);
break;
case 'google':
var openLink = 'https://plus.google.com/share?url=' + encodeURIComponent(pageUrl) + '&title=' + encodeURIComponent(pageTitle);
break;
case 'email':
var openLink = 'mailto:?subject=' + pageTitle + '&body=Un lien particulièrement intéressant à voir : ' + pageUrl;
break;
}
//Parameters for the Popup window
winWidth = 650;
winHeight = 450;
winLeft = (jQuery(window).width() - winWidth) / 2,
winTop = (jQuery(window).height() - winHeight) / 2,
winOptions = 'width=' + winWidth + ',height=' + winHeight + ',top=' + winTop + ',left=' + winLeft;
//open Popup window and redirect user to share website.
window.open(openLink,'Share This Link',winOptions);
return false;
});
});
</script>