Skip to content

Commit

Permalink
Merge pull request #5 from vincent3569/master
Browse files Browse the repository at this point in the history
Update swipe_gestures.php
  • Loading branch information
acrylian authored Dec 27, 2017
2 parents 3c06c21 + 8119bbe commit d8e210d
Showing 1 changed file with 23 additions and 14 deletions.
37 changes: 23 additions & 14 deletions swipe_gestures.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
$plugin_is_filter = 9|THEME_PLUGIN;
$plugin_description = gettext('A simple plugin that enabled touch screen left and right swiping on the single image page. Based on the jQuery plugin touchSwipe.');
$plugin_author = 'Malte Müller (acrylian)';
$plugin_version = '1.0.5';
$plugin_version = '1.0.6';
$option_interface = 'swipeGestures';
zp_register_filter('theme_head','swipeGestures::swipejs');

Expand All @@ -30,17 +30,25 @@ function __construct() {
function getOptionsSupported() {
$options = array(
gettext('Single image page') => array(
'order' => 0,
'key' => 'swipe_gestures_image',
'type' => OPTION_TYPE_CHECKBOX,
'desc' => gettext('Enables left/right swipe gestures for the previous/next image navigation.')),
gettext('Album pages') => array(
'key' => 'swipe_gestures_album',
'order' => 1,
'key' => 'swipe_gestures_album',
'type' => OPTION_TYPE_CHECKBOX,
'desc' => gettext('Enables left/right swipe gestures for the previous/next album/search page navigation.')),
gettext('News pages') => array(
'key' => 'swipe_gestures_news',
gettext('News loop pages') => array(
'order' => 2,
'key' => 'swipe_gestures_news',
'type' => OPTION_TYPE_CHECKBOX,
'desc' => gettext('Enables left/right swipe gestures for the previous/next news loop page navigation (<em>news on index</em> option not supported).'))
'desc' => gettext('Enables left/right swipe gestures for the previous/next news loop page navigation (<em>news on index</em> option not supported).')),
gettext('Single News pages') => array(
'order' => 3,
'key' => 'swipe_gestures_news_single',
'type' => OPTION_TYPE_CHECKBOX,
'desc' => gettext('Enables left/right swipe gestures for the previous/next single news page navigation.'))
);
return $options;
}
Expand Down Expand Up @@ -74,8 +82,16 @@ static function swipejs() {
}
break;
case 'news.php':
if(getOption('swipe_gestures_news') && getOption('zp_plugin_zenpage')) {
if(is_NewsArticle()) {
if (getOption('zp_plugin_zenpage')) {
if ((getOption('swipe_gestures_news')) && (!is_NewsArticle())) {
if(getPrevNewsPageURL()) {
$prevurl = getPrevNewsPageURL();
}
if(getNextNewsPageURL()) {
$nexturl = getNextNewsPageURL();
}
}
if ((getOption('swipe_gestures_news_single')) && (is_NewsArticle())) {
if(getPrevNewsURL()) {
$prevurl = getPrevNewsURL();
$prevurl = $prevurl['link'];
Expand All @@ -84,13 +100,6 @@ static function swipejs() {
$nexturl = getNextNewsURL();
$nexturl = $nexturl['link'];
}
} else {
if(getPrevNewsPageURL()) {
$prevurl = getPrevNewsPageURL();
}
if(getNextNewsPageURL()) {
$nexturl = getNextNewsPageURL();
}
}
}
break;
Expand Down

0 comments on commit d8e210d

Please sign in to comment.