Initial Commit
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* @author ThemePunch <info@themepunch.com>
|
||||
* @link http://www.themepunch.com/
|
||||
* @copyright 2017 ThemePunch
|
||||
*/
|
||||
|
||||
#rev_addon_polyfold_settings_slideout h3 span {
|
||||
|
||||
border-radius: 50%;
|
||||
border: 2px solid #22a2ad;
|
||||
color: #FFF;
|
||||
font-size: 17px;
|
||||
font-weight: 700;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
line-height: 37px;
|
||||
text-align: center;
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
margin-bottom: 10px;
|
||||
background: #22a2ad;
|
||||
|
||||
}
|
||||
|
||||
#rev_addon_polyfold_settings_slideout h3 {
|
||||
|
||||
font-size: 17px;
|
||||
text-align: center;
|
||||
|
||||
}
|
||||
|
||||
#rev_addon_polyfold_settings_slideout .featuretext {
|
||||
|
||||
margin-top: 10px;
|
||||
|
||||
}
|
||||
|
||||
#rev_addon_polyfold_settings_slideout .documentation {
|
||||
|
||||
text-align: center;
|
||||
margin-bottom: 20px;
|
||||
|
||||
}
|
||||
|
||||
#rev_addon_polyfold_settings_slideout .documentation a {
|
||||
|
||||
display: inline-block;
|
||||
background: #22a2ad;
|
||||
color: #FFF;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
padding: 0 20px;
|
||||
border-radius: 4px;
|
||||
text-decoration: none;
|
||||
line-height: 40px;
|
||||
transition: opacity 0.2s ease-out;
|
||||
|
||||
}
|
||||
|
||||
#rev_addon_polyfold_settings_slideout .documentation a:hover {
|
||||
|
||||
opacity: 0.75;
|
||||
|
||||
}
|
||||
|
||||
#rev_addon_polyfold_settings_slideout img {
|
||||
|
||||
box-shadow: 0 0 0 5px #FFF;
|
||||
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 32 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 31 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 32 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 26 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 36 KiB |
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* @author ThemePunch <info@themepunch.com>
|
||||
* @link http://www.themepunch.com/
|
||||
* @copyright 2017 ThemePunch
|
||||
*/
|
||||
|
||||
;(function($) {
|
||||
|
||||
if(!$) {
|
||||
|
||||
console.log('core jQuery library not loading correctly');
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
if(typeof punchgs === 'undefined') {
|
||||
|
||||
console.log('punchgs not available');
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
var win,
|
||||
timer,
|
||||
display,
|
||||
scrollable;
|
||||
|
||||
|
||||
function openPanel() {
|
||||
|
||||
clearTimeout(timer);
|
||||
|
||||
punchgs.TweenLite.to(jQuery('.rs-sbs-slideout-wrapper').not(display), 0.4, {xPercent: '+100%', autoAlpha: 0, display: 'none', overwrite: 'auto', ease: punchgs.Power3.easeInOut});
|
||||
punchgs.TweenLite.to(display, 0.4, {xPercent: '0%', autoAlpha: 1, display: 'block', overwrite: 'auto', ease: punchgs.Power3.easeOut});
|
||||
|
||||
scrollable.css('max-height', win.height() - 300);
|
||||
timer = setTimeout(updateScroll, 400);
|
||||
|
||||
}
|
||||
|
||||
function closePanel() {
|
||||
|
||||
punchgs.TweenLite.to(display, 0.4, {xPercent: '+100%', autoAlpha: 0, display: 'none', overwrite: 'auto', ease: punchgs.Power3.easeInOut});
|
||||
|
||||
}
|
||||
|
||||
function onResize() {
|
||||
|
||||
scrollable.css('max-height', win.height() - 300).perfectScrollbar('update');
|
||||
|
||||
}
|
||||
|
||||
function updateScroll() {
|
||||
|
||||
scrollable.perfectScrollbar('update');
|
||||
|
||||
}
|
||||
|
||||
|
||||
$(function() {
|
||||
|
||||
display = jQuery('#rev_addon_polyfold_settings_slideout');
|
||||
scrollable = display.children('.rs-sbs-slideout-inner');
|
||||
win = $(window).on('resize', onResize);
|
||||
|
||||
$('body').on(
|
||||
|
||||
'click',
|
||||
'#rs-dash-addons-slide-out-trigger_revslider-polyfold-addon',
|
||||
openPanel
|
||||
|
||||
).on('click', '#rev_addon_polyfold_settings_slideout .rs-sbs-close', closePanel);
|
||||
|
||||
punchgs.TweenLite.set(display, {xPercent: '+100%', autoAlpha: 0, display: 'none'});
|
||||
scrollable.perfectScrollbar({wheelPropagation: true, suppressScrollX: true});
|
||||
|
||||
});
|
||||
|
||||
|
||||
})(typeof jQuery !== 'undefined' ? jQuery : false);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,358 @@
|
||||
<?php
|
||||
/*
|
||||
* @author ThemePunch <info@themepunch.com>
|
||||
* @link http://www.themepunch.com/
|
||||
* @copyright 2017 ThemePunch
|
||||
*/
|
||||
|
||||
if( !defined( 'ABSPATH') ) exit();
|
||||
|
||||
require_once(RS_POLYFOLD_PLUGIN_PATH . 'framework/slider.admin.class.php');
|
||||
|
||||
class RsPolyfoldSliderAdmin extends RsAddonPolyfoldSliderAdmin {
|
||||
|
||||
protected static $_Icon,
|
||||
$_Title,
|
||||
$_Markup,
|
||||
$_Version,
|
||||
$_JavaScript;
|
||||
|
||||
public function __construct($_title, $_version) {
|
||||
|
||||
static::$_Title = $_title;
|
||||
static::$_Version = $_version;
|
||||
parent::init();
|
||||
|
||||
}
|
||||
|
||||
// admin view
|
||||
protected static function _init($_slider) {
|
||||
|
||||
$_topEnabled = RevSliderFunctions::getVal($_slider, 'polyfold_top_enabled', false) == 'true' ? ' checked' : '';
|
||||
$_bottomEnabled = RevSliderFunctions::getVal($_slider, 'polyfold_bottom_enabled', false) == 'true' ? ' checked' : '';
|
||||
$_topMobile = RevSliderFunctions::getVal($_slider, 'polyfold_top_hide_mobile', false) == 'true' ? ' checked' : '';
|
||||
$_bottomMobile = RevSliderFunctions::getVal($_slider, 'polyfold_bottom_hide_mobile', false) == 'true' ? ' checked' : '';
|
||||
$_topNegative = RevSliderFunctions::getVal($_slider, 'polyfold_top_negative', false) == 'true' ? ' checked' : '';
|
||||
$_bottomNegative = RevSliderFunctions::getVal($_slider, 'polyfold_bottom_negative', false) == 'true' ? ' checked' : '';
|
||||
$_topAnimated = RevSliderFunctions::getVal($_slider, 'polyfold_top_animated', false) == 'true' ? ' checked' : '';
|
||||
$_bottomAnimated = RevSliderFunctions::getVal($_slider, 'polyfold_bottom_animated', false) == 'true' ? ' checked' : '';
|
||||
$_topInverted = RevSliderFunctions::getVal($_slider, 'polyfold_top_inverted', false) == 'true' ? ' checked' : '';
|
||||
$_bottomInverted = RevSliderFunctions::getVal($_slider, 'polyfold_bottom_inverted', false) == 'true' ? ' checked' : '';
|
||||
$_topResponsive = RevSliderFunctions::getVal($_slider, 'polyfold_top_responsive', true) == 'true' ? ' checked' : '';
|
||||
$_bottomResponsive = RevSliderFunctions::getVal($_slider, 'polyfold_bottom_responsive', true) == 'true' ? ' checked' : '';
|
||||
$_topScroll = RevSliderFunctions::getVal($_slider, 'polyfold_top_scroll', true) == 'true' ? ' checked' : '';
|
||||
$_bottomScroll = RevSliderFunctions::getVal($_slider, 'polyfold_bottom_scroll', true) == 'true' ? ' checked' : '';
|
||||
|
||||
$_topHeight = RevSliderFunctions::getVal($_slider, 'polyfold_top_height', '100');
|
||||
$_bottomHeight = RevSliderFunctions::getVal($_slider, 'polyfold_bottom_height', '100');
|
||||
$_topLeftWidth = RevSliderFunctions::getVal($_slider, 'polyfold_top_left_width', '50');
|
||||
$_bottomLeftWidth = RevSliderFunctions::getVal($_slider, 'polyfold_bottom_left_width', '50');
|
||||
$_topRightWidth = RevSliderFunctions::getVal($_slider, 'polyfold_top_right_width', '50');
|
||||
$_bottomRightWidth = RevSliderFunctions::getVal($_slider, 'polyfold_bottom_right_width', '50');
|
||||
$_topTime = RevSliderFunctions::getVal($_slider, 'polyfold_top_time', '0.3');
|
||||
$_bottomTime = RevSliderFunctions::getVal($_slider, 'polyfold_bottom_time', '0.3');
|
||||
$_topPlacement = RevSliderFunctions::getVal($_slider, 'polyfold_top_placement', '1');
|
||||
$_bottomPlacement = RevSliderFunctions::getVal($_slider, 'polyfold_bottom_placement', '1');
|
||||
|
||||
$_topRange = RevSliderFunctions::getVal($_slider, 'polyfold_top_range', 'slider');
|
||||
$_bottomRange = RevSliderFunctions::getVal($_slider, 'polyfold_bottom_range', 'slider');
|
||||
$_topPoint = RevSliderFunctions::getVal($_slider, 'polyfold_top_point', 'sides');
|
||||
$_bottomPoint = RevSliderFunctions::getVal($_slider, 'polyfold_bottom_point', 'sides');
|
||||
$_topColor = RevSliderFunctions::getVal($_slider, 'polyfold_top_color', '#ffffff');
|
||||
$_bottomColor = RevSliderFunctions::getVal($_slider, 'polyfold_bottom_color', '#ffffff');
|
||||
$_topEase = RevSliderFunctions::getVal($_slider, 'polyfold_top_ease', 'ease-out');
|
||||
$_bottomEase = RevSliderFunctions::getVal($_slider, 'polyfold_bottom_ease', 'ease-out');
|
||||
|
||||
$_topSettings = $_topEnabled ? 'block' : 'none';
|
||||
$_bottomSettings = $_bottomEnabled ? 'block' : 'none';
|
||||
$_topScrollSets = $_topScroll ? 'block' : 'none';
|
||||
$_bottomScrollSets = $_bottomScroll ? 'block' : 'none';
|
||||
$_topAnimatedSets = $_topAnimated ? 'block' : 'none';
|
||||
$_botAnimatedSets = $_bottomAnimated ? 'block' : 'none';
|
||||
|
||||
if(!$_topColor) $_topColor = '#ffffff';
|
||||
if(!$_bottomColor) $_bottomColor = '#ffffff';
|
||||
|
||||
$_textDomain = 'rs_' . static::$_Title;
|
||||
$_points = array('sides', 'center');
|
||||
$_ranges = array('slider', 'window');
|
||||
$_easings = array('ease-out', 'ease-in', 'ease-in-out', 'ease', 'linear');
|
||||
$_placements = array('1' => 'Above Entire Slider', '2' => 'Behind Navigation', '3' => 'Behind Static Layers');
|
||||
|
||||
$_markup = '<style type="text/css">#viewWrapper .polyfold-settings .wp-picker-active .wp-picker-input-wrap {display: block}</style>
|
||||
|
||||
<ul class="main-options-small-tabs" style="display:inline-block">
|
||||
<li id="polyfold_top_edge" data-content="#particles-top-edge" class="selected">Top Edge</li>
|
||||
<li id="polyfold_bottom_edge" data-content="#particles-bottom-edge">Bottom Edge</li>
|
||||
</ul>
|
||||
|
||||
<div id="particles-top-edge">
|
||||
|
||||
<span class="label" id="label_polyfold_top_enabled" origtitle="' . __("Enable/Disable Top Edges for the Polyfold<br>Add-On.<br><br>", $_textDomain) . '">' . __('Enable Top Edges', $_textDomain) . '</span>
|
||||
<input type="checkbox" class="tp-moderncheckbox withlabel" id="polyfold_top_enabled" name="polyfold_top_enabled"' . $_topEnabled . '
|
||||
onchange="document.getElementById(\'polyfold-top-settings\').style.display=this.checked ? \'block\' : \'none\'" />
|
||||
|
||||
<div id="polyfold-top-settings" class="polyfold-settings" style="display: ' . $_topSettings . '; margin-top: 7px">
|
||||
|
||||
<h4>Top Edge Settings</h4>
|
||||
|
||||
<span class="label polyfold-color-label" id="label_polyfold_top_color" origtitle="' . __('The selected color should match your web page\'s background color.<br><br>', $_textDomain) . '">' . __("Page Background Color", $_textDomain) . '</span>
|
||||
<input id="polyfold_top_color" name="polyfold_top_color" type="text" class="rs-layer-input-field tipsy_enabled_top polyfold-color-input" title="Select a Color" value="' . $_topColor . '" />
|
||||
<br>
|
||||
|
||||
<span class="label" id="label_polyfold_top_scroll" origtitle="' . __('Draw the edges as the slider is scrolled into and out of view.<br><br>', $_textDomain) . '">' . __("Draw on-scroll", $_textDomain) . '</span>
|
||||
<input type="checkbox" class="tp-moderncheckbox withlabel" id="polyfold_top_scroll" name="polyfold_top_scroll"' . $_topScroll . '
|
||||
onchange="document.getElementById(\'polyfold-top-scroll\').style.display=this.checked ? \'block\' : \'none\'" />
|
||||
|
||||
<div id="polyfold-top-scroll" class="withsublabels" style="display: ' . $_topScrollSets . '">
|
||||
|
||||
<span class="label" id="label_polyfold_top_range" origtitle="' . __("Calculate angles based on the Slider's position within the window compared to the overall Slider height or the overall Window height<br><br>", $_textDomain) . '">' . __('Drawing Range', $_textDomain) . '</span>
|
||||
<select class="withlabel" id="polyfold_top_range" name="polyfold_top_range">';
|
||||
|
||||
foreach($_ranges as $_range) {
|
||||
|
||||
$_selected = $_range === $_topRange ? ' selected' : '';
|
||||
$_markup .= '<option value="' . $_range . '"' . $_selected . '>' . ucfirst($_range) . ' Height</option>';
|
||||
|
||||
}
|
||||
|
||||
$_markup .= '</select>
|
||||
<br>
|
||||
|
||||
<span class="label" id="label_polyfold_top_animated" origtitle="' . __("Animate the edges as the page is scrolled<br><br>", $_textDomain) . '">' . __('Use Transition', $_textDomain) . '</span>
|
||||
<input type="checkbox" class="tp-moderncheckbox withlabel" id="polyfold_top_animated" name="polyfold_top_animated"' . $_topAnimated . '
|
||||
onchange="document.getElementById(\'polyfold-top-animated\').style.display=this.checked ? \'block\' : \'none\'" />
|
||||
|
||||
<div id="polyfold-top-animated" class="withsublabels" style="display: ' . $_topAnimatedSets . '; padding-left: 20px">
|
||||
|
||||
<span class="label" id="label_polyfold_top_ease" origtitle="' . __("The transition timing equation<br><br>", $_textDomain) . '">' . __('Transition Easing', $_textDomain) . '</span>
|
||||
<select class="withlabel" id="polyfold_top_ease" name="polyfold_top_ease">';
|
||||
|
||||
foreach($_easings as $_ease) {
|
||||
|
||||
$_selected = $_ease !== $_topEase ? '' : ' selected';
|
||||
$_markup .= '<option value="' . $_ease . '"' . $_selected . '>' . $_ease . '</option>';
|
||||
|
||||
}
|
||||
|
||||
$_markup .= '</select>
|
||||
<br>
|
||||
|
||||
<span class="label" id="label_polyfold_top_time" origtitle="' . __("The animation time in seconds (a number between 0.3-1.0 is recommended)<br><br>", $_textDomain) . '">' . __('Transition Time', $_textDomain) . '</span>
|
||||
<input type="text" class="text-sidebar withlabel" id="polyfold_top_time" name="polyfold_top_time" value="' . $_topTime . '" />
|
||||
|
||||
</div>
|
||||
|
||||
<span class="label" id="label_polyfold_top_inverted" origtitle="' . __("Reverse the drawing as the page is scrolled<br><br>", $_textDomain) . '">' . __('Inverted Scroll', $_textDomain) . '</span>
|
||||
<input type="checkbox" class="tp-moderncheckbox withlabel" id="polyfold_top_inverted" name="polyfold_top_inverted"' . $_topInverted . ' />
|
||||
|
||||
</div>
|
||||
|
||||
<span class="label" id="label_polyfold_top_left_width" origtitle="' . __("How long the edge should span across the slider (0-100%).<br><br>", $_textDomain) . '">' . __('Left Edge Width', $_textDomain) . '</span>
|
||||
<input type="text" class="text-sidebar withlabel polyfold-min-max" id="polyfold_top_left_width" name="polyfold_top_left_width" data-min="0" data-max="100" value="' . $_topLeftWidth . '" /> <span>%</span>
|
||||
<br>
|
||||
|
||||
<span class="label" id="label_polyfold_top_right_width" origtitle="' . __("How long the edge should span across the slider (0-100%).<br><br>", $_textDomain) . '">' . __('Right Edge Width', $_textDomain) . '</span>
|
||||
<input type="text" class="text-sidebar withlabel polyfold-min-max" id="polyfold_top_right_width" name="polyfold_top_right_width" data-min="0" data-max="100" value="' . $_topRightWidth . '" /> <span>%</span>
|
||||
<br>
|
||||
|
||||
<span class="label" id="label_polyfold_top_height" origtitle="' . __("The default height in pixels for the edges<br><br>", $_textDomain) . '">' . __('Default Height', $_textDomain) . '</span>
|
||||
<input type="text" class="text-sidebar withlabel" id="polyfold_top_height" name="polyfold_top_height" value="' . $_topHeight . '" /> <span>px</span>
|
||||
<br>
|
||||
|
||||
<span class="label" id="label_polyfold_top_responsive" origtitle="' . __("Dynamically adjust the Polyfold Height as the slider is resized.<br><br>", $_textDomain) . '">' . __('Responsive Height', $_textDomain) . '</span>
|
||||
<input type="checkbox" class="tp-moderncheckbox withlabel" id="polyfold_top_responsive" name="polyfold_top_responsive"' . $_topResponsive . ' />
|
||||
<br>
|
||||
|
||||
<span class="label" id="label_polyfold_top_negative" origtitle="' . __("Draw the edges in the opposite direction<br><br>", $_textDomain) . '">' . __('Inverted Angles', $_textDomain) . '</span>
|
||||
<input type="checkbox" class="tp-moderncheckbox withlabel" id="polyfold_top_negative" name="polyfold_top_negative"' . $_topNegative . ' />
|
||||
<br>
|
||||
|
||||
<span class="label" id="label_polyfold_top_point" origtitle="' . __("The starting point from where the drawing begins<br><br>", $_textDomain) . '">' . __('Draw Edges from', $_textDomain) . '</span>
|
||||
<select class="withlabel" id="polyfold_top_point" name="polyfold_top_point">';
|
||||
|
||||
foreach($_points as $_point) {
|
||||
|
||||
$_selected = $_point !== $_topPoint ? '' : ' selected';
|
||||
$_markup .= '<option value="' . $_point . '"' . $_selected . '>Slider ' . ucfirst($_point) . '</option>';
|
||||
|
||||
}
|
||||
|
||||
$_markup .= '</select>
|
||||
<br>
|
||||
|
||||
<span class="label" id="label_polyfold_top_placement" origtitle="' . __("z-index positioning for what level the edges should be drawn at.<br><br>", $_textDomain) . '">' . __('Draw the Edges', $_textDomain) . '</span>
|
||||
<select class="withlabel" id="polyfold_top_placement" name="polyfold_top_placement">';
|
||||
|
||||
foreach($_placements as $_key => $_value) {
|
||||
|
||||
$_selected = $_key !== $_topPlacement ? '' : ' selected';
|
||||
$_markup .= '<option value="' . $_key . '"' . $_selected . '>' . $_value . '</option>';
|
||||
|
||||
}
|
||||
|
||||
$_markup .= '</select>
|
||||
<br>
|
||||
|
||||
<span class="label" id="label_polyfold_top_hide_mobile" origtitle="' . __("Disable the Polyfold Effect on Mobile Devices<br><br>", $_textDomain) . '">' . __('Disable on Mobile', $_textDomain) . '</span>
|
||||
<input type="checkbox" class="tp-moderncheckbox withlabel" id="polyfold_top_hide_mobile" name="polyfold_top_hide_mobile"' . $_topMobile . ' />
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="particles-bottom-edge" style="display: none">
|
||||
|
||||
<span class="label" id="label_polyfold_bottom_enabled" origtitle="' . __("Enable/Disable Bottom Edges for the Polyfold<br>Add-On.<br><br>", $_textDomain) . '">' . __('Enable Bottom Edges', $_textDomain) . '</span>
|
||||
<input type="checkbox" class="tp-moderncheckbox withlabel" id="polyfold_bottom_enabled" name="polyfold_bottom_enabled"' . $_bottomEnabled . '
|
||||
onchange="document.getElementById(\'polyfold-bottom-settings\').style.display=this.checked ? \'block\' : \'none\'" />
|
||||
|
||||
<div id="polyfold-bottom-settings" class="polyfold-settings" style="display: ' . $_bottomSettings . '; margin-top: 7px">
|
||||
|
||||
<h4>Bottom Edge Settings</h4>
|
||||
|
||||
<span class="label polyfold-color-label" id="label_polyfold_bottom_color" origtitle="' . __('The selected color should match your web page\'s background color.<br><br>', $_textDomain) . '">' . __("Page Background Color", $_textDomain) . '</span>
|
||||
<input id="polyfold_bottom_color" name="polyfold_bottom_color" type="text" class="rs-layer-input-field tipsy_enabled_bottom polyfold-color-input" title="Select a Color" value="' . $_bottomColor . '" />
|
||||
<br>
|
||||
|
||||
<span class="label" id="label_polyfold_bottom_scroll" origtitle="' . __('Draw the edges as the slider is scrolled into and out of view.<br><br>', $_textDomain) . '">' . __("Draw on-scroll", $_textDomain) . '</span>
|
||||
<input type="checkbox" class="tp-moderncheckbox withlabel" id="polyfold_bottom_scroll" name="polyfold_bottom_scroll"' . $_bottomScroll . '
|
||||
onchange="document.getElementById(\'polyfold-bottom-scroll\').style.display=this.checked ? \'block\' : \'none\'" />
|
||||
|
||||
<div id="polyfold-bottom-scroll" class="withsublabels" style="display: ' . $_bottomScrollSets . '">
|
||||
|
||||
<span class="label" id="label_polyfold_bottom_range" origtitle="' . __("Calculate angles based on the Slider's position within the window compared to the overall Slider height or the overall Window height<br><br>", $_textDomain) . '">' . __('Drawing Range', $_textDomain) . '</span>
|
||||
<select class="withlabel" id="polyfold_bottom_range" name="polyfold_bottom_range">';
|
||||
|
||||
foreach($_ranges as $_range) {
|
||||
|
||||
$_selected = $_range === $_bottomRange ? ' selected' : '';
|
||||
$_markup .= '<option value="' . $_range . '"' . $_selected . '>' . ucfirst($_range) . ' Height</option>';
|
||||
|
||||
}
|
||||
|
||||
$_markup .= '</select>
|
||||
<br>
|
||||
|
||||
<span class="label" id="label_polyfold_bottom_animated" origtitle="' . __("Animate the edges as the page is scrolled<br><br>", $_textDomain) . '">' . __('Use Transition', $_textDomain) . '</span>
|
||||
<input type="checkbox" class="tp-moderncheckbox withlabel" id="polyfold_bottom_animated" name="polyfold_bottom_animated"' . $_bottomAnimated . '
|
||||
onchange="document.getElementById(\'polyfold-bottom-animated\').style.display=this.checked ? \'block\' : \'none\'" />
|
||||
|
||||
<div id="polyfold-bottom-animated" class="withsublabels" style="display: ' . $_botAnimatedSets . '; padding-left: 20px">
|
||||
|
||||
<span class="label" id="label_polyfold_bottom_ease" origtitle="' . __("The transition timing equation<br><br>", $_textDomain) . '">' . __('Transition Easing', $_textDomain) . '</span>
|
||||
<select class="withlabel" id="polyfold_bottom_ease" name="polyfold_bottom_ease">';
|
||||
|
||||
foreach($_easings as $_ease) {
|
||||
|
||||
$_selected = $_ease !== $_bottomEase ? '' : ' selected';
|
||||
$_markup .= '<option value="' . $_ease . '"' . $_selected . '>' . $_ease . '</option>';
|
||||
|
||||
}
|
||||
|
||||
$_markup .= '</select>
|
||||
<br>
|
||||
|
||||
<span class="label" id="label_polyfold_bottom_time" origtitle="' . __("The animation time in seconds (a number between 0.3-1.0 is recommended)<br><br>", $_textDomain) . '">' . __('Transition Time', $_textDomain) . '</span>
|
||||
<input type="text" class="text-sidebar withlabel" id="polyfold_bottom_time" name="polyfold_bottom_time" value="' . $_bottomTime . '" />
|
||||
|
||||
</div>
|
||||
|
||||
<span class="label" id="label_polyfold_bottom_inverted" origtitle="' . __("Reverse the drawing as the page is scrolled<br><br>", $_textDomain) . '">' . __('Inverted Scroll', $_textDomain) . '</span>
|
||||
<input type="checkbox" class="tp-moderncheckbox withlabel" id="polyfold_bottom_inverted" name="polyfold_bottom_inverted"' . $_bottomInverted . ' />
|
||||
|
||||
</div>
|
||||
|
||||
<span class="label" id="label_polyfold_bottom_left_width" origtitle="' . __("How long the edge should span across the slider (0-100%).<br><br>", $_textDomain) . '">' . __('Left Edge Width', $_textDomain) . '</span>
|
||||
<input type="text" class="text-sidebar withlabel polyfold-min-max" id="polyfold_bottom_left_width" name="polyfold_bottom_left_width" data-min="0" data-max="100" value="' . $_bottomLeftWidth . '" /> <span>%</span>
|
||||
<br>
|
||||
|
||||
<span class="label" id="label_polyfold_bottom_right_width" origtitle="' . __("How long the edge should span across the slider (0-100%).<br><br>", $_textDomain) . '">' . __('Right Edge Width', $_textDomain) . '</span>
|
||||
<input type="text" class="text-sidebar withlabel polyfold-min-max" id="polyfold_bottom_right_width" name="polyfold_bottom_right_width" data-min="0" data-max="100" value="' . $_bottomRightWidth . '" /> <span>%</span>
|
||||
<br>
|
||||
|
||||
<span class="label" id="label_polyfold_bottom_height" origtitle="' . __("The default height in pixels for the edges<br><br>", $_textDomain) . '">' . __('Default Height', $_textDomain) . '</span>
|
||||
<input type="text" class="text-sidebar withlabel" id="polyfold_bottom_height" name="polyfold_bottom_height" value="' . $_bottomHeight . '" /> <span>px</span>
|
||||
<br>
|
||||
|
||||
<span class="label" id="label_polyfold_bottom_responsive" origtitle="' . __("Dynamically adjust the Polyfold Height as the slider is resized.<br><br>", $_textDomain) . '">' . __('Responsive Height', $_textDomain) . '</span>
|
||||
<input type="checkbox" class="tp-moderncheckbox withlabel" id="polyfold_bottom_responsive" name="polyfold_bottom_responsive"' . $_bottomResponsive . ' />
|
||||
<br>
|
||||
|
||||
<span class="label" id="label_polyfold_bottom_negative" origtitle="' . __("Draw the edges in the opposite direction<br><br>", $_textDomain) . '">' . __('Inverted Angles', $_textDomain) . '</span>
|
||||
<input type="checkbox" class="tp-moderncheckbox withlabel" id="polyfold_bottom_negative" name="polyfold_bottom_negative"' . $_bottomNegative . ' />
|
||||
<br>
|
||||
|
||||
<span class="label" id="label_polyfold_bottom_point" origtitle="' . __("The starting point from where the drawing begins<br><br>", $_textDomain) . '">' . __('Draw Edges from', $_textDomain) . '</span>
|
||||
<select class="withlabel" id="polyfold_bottom_point" name="polyfold_bottom_point">';
|
||||
|
||||
foreach($_points as $_point) {
|
||||
|
||||
$_selected = $_point !== $_bottomPoint ? '' : ' selected';
|
||||
$_markup .= '<option value="' . $_point . '"' . $_selected . '>Slider ' . ucfirst($_point) . '</option>';
|
||||
|
||||
}
|
||||
|
||||
$_markup .= '</select>
|
||||
<br>
|
||||
|
||||
<span class="label" id="label_polyfold_bottom_placement" origtitle="' . __("z-index positioning for what level the edges should be drawn at.<br><br>", $_textDomain) . '">' . __('Draw the Edges', $_textDomain) . '</span>
|
||||
<select class="withlabel" id="polyfold_bottom_placement" name="polyfold_bottom_placement">';
|
||||
|
||||
foreach($_placements as $_key => $_value) {
|
||||
|
||||
$_selected = $_key !== $_bottomPlacement ? '' : ' selected';
|
||||
$_markup .= '<option value="' . $_key . '"' . $_selected . '>' . $_value . '</option>';
|
||||
|
||||
}
|
||||
|
||||
$_markup .= '</select>
|
||||
<br>
|
||||
|
||||
<span class="label" id="label_polyfold_bottom_hide_mobile" origtitle="' . __("Disable the Polyfold Effect on Mobile Devices<br><br>", $_textDomain) . '">' . __('Disable on Mobile', $_textDomain) . '</span>
|
||||
<input type="checkbox" class="tp-moderncheckbox withlabel" id="polyfold_bottom_hide_mobile" name="polyfold_bottom_hide_mobile"' . $_bottomMobile . ' />
|
||||
|
||||
</div>
|
||||
|
||||
</div>';
|
||||
|
||||
static::$_Markup = $_markup;
|
||||
static::$_Icon = 'eg-icon-layers-alt';
|
||||
static::$_JavaScript = '
|
||||
|
||||
jQuery(function() {
|
||||
|
||||
// activate the color picker
|
||||
if(jQuery.fn.tpColorPicker) {
|
||||
|
||||
jQuery(".polyfold-color-input").tpColorPicker({mode: "basic", editing: "Polyfold Edge Color", wrapClasses: "polyfold-cp", init: function() {
|
||||
|
||||
jQuery(".polyfold-cp").css({position: "relative", top: 8});
|
||||
|
||||
}});
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
jQuery(".polyfold-color-input").wpColorPicker({palettes: false, height: 250, border: false, change: function(evt, ui) {
|
||||
this.value = ui.color.toString();
|
||||
}});
|
||||
|
||||
}
|
||||
|
||||
// handle inputs with min/max values
|
||||
jQuery(".polyfold-min-max").on("change", function() {
|
||||
|
||||
this.value = Math.max(parseFloat(this.getAttribute("data-min")),
|
||||
Math.min(parseFloat(this.getAttribute("data-max")), parseFloat(this.value)));
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
';
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,227 @@
|
||||
<?php
|
||||
/**
|
||||
* @author ThemePunch <info@themepunch.com>
|
||||
* @link http://www.themepunch.com/
|
||||
* @copyright 2016 ThemePunch
|
||||
*/
|
||||
|
||||
if( !defined( 'ABSPATH') ) exit();
|
||||
|
||||
class RevAddOnPolyfoldUpdate {
|
||||
private $plugin_url = 'http://codecanyon.net/item/slider-revolution-responsive-wordpress-plugin/2751380';
|
||||
private $remote_url = 'http://updates.themepunch.tools/check_for_updates.php';
|
||||
private $remote_url_info = 'http://updates.themepunch.tools/addons/revslider-polyfold-addon/revslider-polyfold-addon.php';
|
||||
private $plugin_slug = 'revslider-polyfold-addon';
|
||||
private $plugin_path = 'revslider-polyfold-addon/revslider-polyfold-addon.php';
|
||||
private $version;
|
||||
private $plugins;
|
||||
private $option;
|
||||
|
||||
|
||||
public function __construct($version) {
|
||||
$this->option = $this->plugin_slug . '_update_info';
|
||||
$this->version = $version;
|
||||
$this->_retrieve_version_info();
|
||||
}
|
||||
|
||||
public function delete_update_transients() {
|
||||
delete_transient( 'update_themes' );
|
||||
delete_transient( 'update_plugins' );
|
||||
delete_site_transient( 'update_plugins' );
|
||||
delete_site_transient( 'update_themes' );
|
||||
}
|
||||
|
||||
|
||||
public function add_update_checks(){
|
||||
|
||||
add_filter('pre_set_site_transient_update_plugins', array(&$this, 'set_update_transient'));
|
||||
add_filter('plugins_api', array(&$this, 'set_updates_api_results'), 10, 3);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function set_update_transient($transient) {
|
||||
|
||||
$this->_check_updates();
|
||||
|
||||
if(isset($transient) && !isset($transient->response)) {
|
||||
$transient->response = array();
|
||||
}
|
||||
|
||||
if(!empty($this->data->basic) && is_object($this->data->basic)) {
|
||||
if(version_compare($this->version, $this->data->basic->version, '<')) {
|
||||
|
||||
$this->data->basic->new_version = $this->data->basic->version;
|
||||
$transient->response[$this->plugin_path] = $this->data->basic;
|
||||
}
|
||||
}
|
||||
|
||||
return $transient;
|
||||
}
|
||||
|
||||
|
||||
public function set_updates_api_results($result, $action, $args) {
|
||||
|
||||
$this->_check_updates();
|
||||
|
||||
if(isset($args->slug) && $args->slug == $this->plugin_slug && $action == 'plugin_information') {
|
||||
if(is_object($this->data->full) && !empty($this->data->full)) {
|
||||
$result = $this->data->full;
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
protected function _check_updates() {
|
||||
//reset saved options
|
||||
//update_option($this->option, false);
|
||||
|
||||
$force_check = false;
|
||||
|
||||
if( (isset($_GET['checkforupdates']) && $_GET['checkforupdates'] == 'true') || isset($_GET["force-check"])) $force_check = true;
|
||||
|
||||
|
||||
// Get data
|
||||
if(empty($this->data)) {
|
||||
$data = get_option($this->option, false);
|
||||
$data = $data ? $data : new stdClass;
|
||||
|
||||
$this->data = is_object($data) ? $data : maybe_unserialize($data);
|
||||
}
|
||||
|
||||
$last_check = get_option('revslider_polyfold_addon-update-check');
|
||||
|
||||
|
||||
if($last_check == false){ //first time called
|
||||
$last_check = time();
|
||||
update_option('revslider_polyfold_addon-update-check', $last_check);
|
||||
}
|
||||
|
||||
// Check for updates
|
||||
if(time() - $last_check > 172800 || $force_check == true){
|
||||
|
||||
$data = $this->_retrieve_update_info();
|
||||
|
||||
if(isset($data->basic)) {
|
||||
update_option('revslider_polyfold_addon-update-check', time());
|
||||
|
||||
$this->data->checked = time();
|
||||
$this->data->basic = $data->basic;
|
||||
$this->data->full = $data->full;
|
||||
|
||||
//update_option('revslider_polyfold_addon-stable-version', $data->full->stable);
|
||||
update_option('revslider_polyfold_addon-latest-version', $data->full->version);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Save results
|
||||
update_option($this->option, $this->data);
|
||||
}
|
||||
|
||||
|
||||
public function _retrieve_update_info() {
|
||||
|
||||
global $wp_version;
|
||||
$data = new stdClass;
|
||||
|
||||
// Build request
|
||||
|
||||
$validated = get_option('revslider_polyfold_addon-valid', 'false');
|
||||
$purchase = (get_option('revslider-valid', 'false') == 'true') ? get_option('revslider-code', '') : '';
|
||||
$rattr = array(
|
||||
'code' => urlencode($purchase),
|
||||
'version' => urlencode($this->version)
|
||||
);
|
||||
|
||||
$request = wp_remote_post($this->remote_url_info, array(
|
||||
'user-agent' => 'WordPress/'.$wp_version.'; '.get_bloginfo('url'),
|
||||
'body' => $rattr
|
||||
));
|
||||
|
||||
if(!is_wp_error($request)) {
|
||||
if($response = maybe_unserialize($request['body'])) {
|
||||
if(is_object($response)) {
|
||||
$data = $response;
|
||||
|
||||
$data->basic->url = $this->plugin_url;
|
||||
$data->full->url = $this->plugin_url;
|
||||
$data->full->external = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
public function _retrieve_version_info($force_check = false) {
|
||||
global $wp_version;
|
||||
|
||||
$last_check = get_option('revslider-polyfold-addon-update-check-short');
|
||||
if($last_check == false){ //first time called
|
||||
$last_check = time();
|
||||
update_option('revslider-polyfold-addon-update-check-short', $last_check);
|
||||
}
|
||||
|
||||
// Check for updates
|
||||
if(time() - $last_check > 172800 || $force_check == true){
|
||||
|
||||
|
||||
update_option('revslider-polyfold-addon-update-check-short', time());
|
||||
|
||||
$purchase = (get_option('revslider-valid', 'false') == 'true') ? get_option('revslider-code', '') : '';
|
||||
|
||||
|
||||
$response = wp_remote_post($this->remote_url, array(
|
||||
'user-agent' => 'WordPress/'.$wp_version.'; '.get_bloginfo('url'),
|
||||
'body' => array(
|
||||
'item' => urlencode('revslider-polyfold-addon'),
|
||||
'version' => urlencode($this->version),
|
||||
'code' => urlencode($purchase)
|
||||
)
|
||||
));
|
||||
|
||||
$response_code = wp_remote_retrieve_response_code( $response );
|
||||
$version_info = wp_remote_retrieve_body( $response );
|
||||
|
||||
if ( $response_code != 200 || is_wp_error( $version_info ) ) {
|
||||
update_option('revslider_polyfold_addon-connection', false);
|
||||
return false;
|
||||
}else{
|
||||
update_option('revslider_polyfold_addon-connection', true);
|
||||
}
|
||||
|
||||
/*
|
||||
$version_info = json_decode($version_info);
|
||||
if(isset($version_info->version)){
|
||||
update_option('revslider_polyfold_addon-latest-version', $version_info->version);
|
||||
}
|
||||
|
||||
if(isset($version_info->notices)){
|
||||
update_option('revslider_polyfold_addon-notices', $version_info->notices);
|
||||
}
|
||||
|
||||
if(isset($version_info->dashboard)){
|
||||
update_option('revslider_polyfold_addon-dashboard', $version_info->dashboard);
|
||||
}
|
||||
|
||||
if(isset($version_info->deactivated) && $version_info->deactivated === true){
|
||||
if(get_option('revslider_polyfold_addon-valid', 'false') == 'true'){
|
||||
//remove validation, add notice
|
||||
update_option('revslider_polyfold_addon-valid', 'false');
|
||||
update_option('revslider_polyfold_addon-deact-notice', true);
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
if($force_check == true){ //force that the update will be directly searched
|
||||
update_option('revslider-polyfold-addon-update-check', '');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
/*
|
||||
* @author ThemePunch <info@themepunch.com>
|
||||
* @link http://www.themepunch.com/
|
||||
* @copyright 2017 ThemePunch
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
create fake "Add-On" block to test this widget
|
||||
http://pastebin.com/J0wB676U
|
||||
|
||||
*/
|
||||
|
||||
if(!defined('ABSPATH')) exit();
|
||||
|
||||
?>
|
||||
|
||||
<div id="rev_addon_polyfold_settings_slideout" class="rs-sbs-slideout-wrapper" style="display:none">
|
||||
|
||||
<div class="rs-sbs-header">
|
||||
<div class="rs-sbs-step"><i class="eg-icon-cog"></i></div>
|
||||
<div class="rs-sbs-title"><?php _e('How to use the Polyfold Add-On', 'rs_polyfold'); ?></div>
|
||||
<div class="rs-sbs-close"><i class="eg-icon-cancel"></i></div>
|
||||
</div>
|
||||
|
||||
<div class="tp-clearfix"></div>
|
||||
|
||||
<div class="rs-sbs-slideout-inner">
|
||||
|
||||
<h3><span>1</span> <?php _e('"Enable" Polyfold from the <a href="https://cdntphome-themepunchgbr.netdna-ssl.com/wp-content/uploads/2016/12/particles-5.jpg" target="_blank">Slider Settings</a>','rs_polyfold'); ?></h3>
|
||||
<img src="<?php echo RS_POLYFOLD_PLUGIN_URL . "admin/assets/images/tutorial0.jpg"; ?>">
|
||||
|
||||
<h3><span>2</span> <?php _e('"Select" your web page\'s BG color','rs_polyfold'); ?></h3>
|
||||
<img src="<?php echo RS_POLYFOLD_PLUGIN_URL . "admin/assets/images/tutorial1.jpg"; ?>">
|
||||
|
||||
<h3><span>3</span> <?php _e('"Adjust" the Polyfold edge\'s settings','rs_polyfold'); ?></h3>
|
||||
<img src="<?php echo RS_POLYFOLD_PLUGIN_URL . "admin/assets/images/tutorial2.jpg"; ?>">
|
||||
|
||||
<h3><span>4</span> <?php _e('"Save" the Slider','rs_polyfold'); ?></h3>
|
||||
<img src="<?php echo RS_POLYFOLD_PLUGIN_URL . "admin/assets/images/tutorial3.jpg"; ?>">
|
||||
|
||||
<h3><span>5</span> <?php _e('"Preview" the Slider from your web page','rs_polyfold'); ?></h3>
|
||||
<img src="<?php echo RS_POLYFOLD_PLUGIN_URL . "admin/assets/images/tutorial4.jpg"; ?>">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,109 @@
|
||||
<?php
|
||||
/*
|
||||
* @author ThemePunch <info@themepunch.com>
|
||||
* @link http://www.themepunch.com/
|
||||
* @copyright 2017 ThemePunch
|
||||
*/
|
||||
|
||||
if(!defined('ABSPATH')) exit();
|
||||
|
||||
class RsAddOnPolyfoldBase {
|
||||
|
||||
const MINIMUM_VERSION = '5.4.6';
|
||||
|
||||
protected function systemsCheck() {
|
||||
|
||||
if(!class_exists('RevSliderFront')) {
|
||||
|
||||
return 'add_notice_plugin';
|
||||
|
||||
}
|
||||
else if(!version_compare(RevSliderGlobals::SLIDER_REVISION, RsAddOnPolyfoldBase::MINIMUM_VERSION, '>=')) {
|
||||
|
||||
return 'add_notice_version';
|
||||
|
||||
}
|
||||
else if(get_option('revslider-valid', 'false') == 'false') {
|
||||
|
||||
return 'add_notice_activation';
|
||||
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
protected function loadClasses() {
|
||||
|
||||
$isAdmin = is_admin();
|
||||
|
||||
if($isAdmin) {
|
||||
|
||||
//handle update process, this uses the typical ThemePunch server process
|
||||
require_once(static::$_PluginPath . 'admin/includes/update.class.php');
|
||||
$update_admin = new RevAddOnPolyfoldUpdate(static::$_Version);
|
||||
|
||||
add_filter('pre_set_site_transient_update_plugins', array($update_admin, 'set_update_transient'));
|
||||
add_filter('plugins_api', array($update_admin, 'set_updates_api_results'), 10, 3);
|
||||
|
||||
// Add-Ons page
|
||||
add_filter('rev_addon_dash_slideouts', array($this, 'addons_page_content'));
|
||||
|
||||
// admin CSS/JS
|
||||
add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_scripts'));
|
||||
|
||||
require_once(static::$_PluginPath . 'admin/includes/slider.class.php');
|
||||
|
||||
// admin init
|
||||
new RsPolyfoldSliderAdmin(static::$_PluginTitle, static::$_Version);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
frontend scripts always enqueued for admin previews
|
||||
*/
|
||||
require_once(static::$_PluginPath . 'public/includes/slider.class.php');
|
||||
|
||||
new RsPolyfoldSliderFront(static::$_Version, static::$_PluginUrl, static::$_PluginTitle, $isAdmin);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Load the textdomain
|
||||
**/
|
||||
protected function _loadPluginTextDomain(){
|
||||
|
||||
load_plugin_textdomain('rs_' . static::$_PluginTitle, false, static::$_PluginPath . 'languages/');
|
||||
|
||||
}
|
||||
|
||||
// AddOn's page slideout panel
|
||||
public function addons_page_content() {
|
||||
|
||||
include_once(static::$_PluginPath . 'admin/views/admin-display.php');
|
||||
|
||||
}
|
||||
|
||||
// load admin scripts
|
||||
public function enqueue_admin_scripts($hook) {
|
||||
|
||||
if($hook === 'slider-revolution_page_rev_addon') {
|
||||
|
||||
if(!isset($_GET['page'])) return;
|
||||
|
||||
$page = $_GET['page'];
|
||||
if($page !== 'rev_addon') return;
|
||||
|
||||
$_handle = 'rs-' . static::$_PluginTitle . '-admin';
|
||||
$_base = static::$_PluginUrl . 'admin/assets/';
|
||||
|
||||
wp_enqueue_style($_handle, $_base . 'css/' . static::$_PluginTitle . '-dash-admin.css', array(), static::$_Version);
|
||||
wp_enqueue_script($_handle, $_base . 'js/' . static::$_PluginTitle . '-dash-admin.js', array('jquery'), static::$_Version, true);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
/*
|
||||
* @author ThemePunch <info@themepunch.com>
|
||||
* @link http://www.themepunch.com/
|
||||
* @copyright 2017 ThemePunch
|
||||
*/
|
||||
|
||||
if(!defined('ABSPATH')) exit();
|
||||
|
||||
class RsAddOnPolyfoldNotice {
|
||||
|
||||
private $title,
|
||||
$notice,
|
||||
$txtDomain;
|
||||
|
||||
public function __construct($_notice, $_title) {
|
||||
|
||||
$this->notice = $_notice;
|
||||
$this->title = ucfirst($_title);
|
||||
$this->txtDomain = 'rs_' . $_title;
|
||||
|
||||
add_action('admin_notices', array($this, 'add_notice'));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Add notice
|
||||
**/
|
||||
public function add_notice() {
|
||||
|
||||
$_notice = $this->notice;
|
||||
$_title = $this->title;
|
||||
|
||||
switch($_notice) {
|
||||
|
||||
case 'add_notice_activation':
|
||||
|
||||
$_notice = 'The <a href="?page=rev_addon">' . $_title . ' Add-On</a> requires an active ' .
|
||||
'<a href="https://www.themepunch.com/revslider-doc/activate-copy-slider-revolution/" target="_blank">Purchase Code Registration</a>';
|
||||
|
||||
break;
|
||||
|
||||
case 'add_notice_plugin':
|
||||
|
||||
$_notice = '<a href="https://revolution.themepunch.com/" target="_blank">Slider Revolution</a> required to use the ' . $_title . ' Add-On';
|
||||
|
||||
break;
|
||||
|
||||
case 'add_notice_version':
|
||||
|
||||
$_notice = 'The ' . $_title . ' Add-On requires Slider Revolution ' . RsAddOnPolyfoldBase::MINIMUM_VERSION .
|
||||
'+ <a href="https://www.themepunch.com/faq/how-to-update-the-slider/" target="_blank">Update Slider Revolution</a>';
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
<div class="error below-h2 soc-notice-wrap" id="message"><p><?php _e($_notice, $this->txtDomain); ?></p></div>
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/*
|
||||
* @author ThemePunch <info@themepunch.com>
|
||||
* @link http://www.themepunch.com/
|
||||
* @copyright 2017 ThemePunch
|
||||
*/
|
||||
|
||||
if( !defined( 'ABSPATH') ) exit();
|
||||
|
||||
class RsAddonPolyfoldSliderAdmin {
|
||||
|
||||
protected function init() {
|
||||
|
||||
add_filter('revslider_slider_addons', array($this, 'add_addon_settings'), 10, 2);
|
||||
|
||||
}
|
||||
|
||||
public function add_addon_settings($_settings, $_slider){
|
||||
|
||||
static::_init($_slider);
|
||||
|
||||
$_settings[static::$_Title] = array(
|
||||
|
||||
'title' => ucfirst(static::$_Title),
|
||||
'icon' => static::$_Icon,
|
||||
'markup' => static::$_Markup,
|
||||
'javascript' => static::$_JavaScript
|
||||
|
||||
);
|
||||
|
||||
return $_settings;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,175 @@
|
||||
<?php
|
||||
/*
|
||||
* @author ThemePunch <info@themepunch.com>
|
||||
* @link http://www.themepunch.com/
|
||||
* @copyright 2017 ThemePunch
|
||||
*/
|
||||
|
||||
if( !defined( 'ABSPATH') ) exit();
|
||||
|
||||
class RsAddonPolyfoldSliderFront {
|
||||
|
||||
protected function enqueueScripts() {
|
||||
|
||||
// add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts'));
|
||||
add_action('revslider_slide_initByData', array($this, 'enqueue_scripts'), 10, 1);
|
||||
|
||||
}
|
||||
|
||||
protected function enqueuePreview() {
|
||||
|
||||
add_action('revslider_preview_slider_head', array($this, 'enqueue_preview'));
|
||||
|
||||
}
|
||||
|
||||
protected function writeInitScript() {
|
||||
|
||||
add_action('revslider_fe_javascript_output', array($this, 'write_init_script'), 10, 2);
|
||||
|
||||
}
|
||||
|
||||
public function enqueue_scripts($_record) {
|
||||
|
||||
if(empty($_record)) return $_record;
|
||||
|
||||
$_params = RevSliderFunctions::getVal($_record, 'params', false);
|
||||
$_sliderId = RevSliderFunctions::getVal($_record, 'slider_id', false);
|
||||
|
||||
if(empty($_params) || empty($_sliderId)) return $_record;
|
||||
|
||||
$_params = json_decode($_params);
|
||||
if(empty($_params)) return $_record;
|
||||
|
||||
$_slider = new RevSlider();
|
||||
$_slider->initByID($_sliderId);
|
||||
|
||||
if(empty($_slider)) return $_record;
|
||||
|
||||
$_settings = $_slider->getParams();
|
||||
if(empty($_settings)) return $_record;
|
||||
|
||||
$_enabled = RevSliderFunctions::getVal($_settings, static::$_PluginTitle . '_top_enabled', false) == 'true';
|
||||
if(empty($_enabled)) $_enabled = RevSliderFunctions::getVal($_settings, static::$_PluginTitle . '_bottom_enabled', false) == 'true';
|
||||
if(empty($_enabled)) return $_record;
|
||||
|
||||
$_handle = 'rs-' . static::$_PluginTitle . '-front';
|
||||
$_base = static::$_PluginUrl . 'public/assets/';
|
||||
|
||||
wp_enqueue_style(
|
||||
|
||||
$_handle,
|
||||
$_base . 'css/revolution.addon.' . static::$_PluginTitle . '.css',
|
||||
array(),
|
||||
static::$_Version
|
||||
|
||||
);
|
||||
|
||||
wp_enqueue_script(
|
||||
|
||||
$_handle,
|
||||
$_base . 'js/revolution.addon.' . static::$_PluginTitle . '.min.js',
|
||||
array('jquery', 'revmin'),
|
||||
static::$_Version,
|
||||
true
|
||||
|
||||
);
|
||||
|
||||
return $_record;
|
||||
|
||||
}
|
||||
|
||||
public function enqueue_preview() {
|
||||
|
||||
$_base = static::$_PluginUrl . 'public/assets/';
|
||||
|
||||
?>
|
||||
<link type="text/css" rel="stylesheet" href="<?php echo $_base . 'css/revolution.addon.' . static::$_PluginTitle . '.css'; ?>" />
|
||||
<script type="text/javascript" src="<?php echo $_base . 'js/revolution.addon.' . static::$_PluginTitle . '.min.js'; ?>"></script>
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
public function write_init_script($_slider, $_id) {
|
||||
|
||||
$_topEnabled = $_slider->getParam('polyfold_top_enabled', false) == 'true';
|
||||
$_bottomEnabled = $_slider->getParam('polyfold_bottom_enabled', false) == 'true';
|
||||
|
||||
if(wp_is_mobile()) {
|
||||
|
||||
if($_topEnabled) $_topEnabled = $_slider->getParam('polyfold_top_hide_mobile', false) == 'false';
|
||||
if($_bottomEnabled) $_bottomEnabled = $_slider->getParam('polyfold_bottom_hide_mobile', false) == 'false';
|
||||
|
||||
}
|
||||
|
||||
$_title = static::$_PluginTitle;
|
||||
$_id = $_slider->getID();
|
||||
|
||||
for($i = 0; $i < 2; $i++) {
|
||||
|
||||
if($i === 0) {
|
||||
|
||||
if(!$_topEnabled) continue;
|
||||
$alias = 'top';
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
if(!$_bottomEnabled) break;
|
||||
$alias = 'bottom';
|
||||
|
||||
}
|
||||
|
||||
$_scroll = $_slider->getParam('polyfold_' . $alias . '_scroll', true) == 'true' ? 'true' : 'false';
|
||||
$_responsive = $_slider->getParam('polyfold_' . $alias . '_responsive', true) == 'true' ? 'true' : 'false';
|
||||
$_negative = $_slider->getParam('polyfold_' . $alias . '_negative', false) == 'true' ? 'true' : 'false';
|
||||
$_animated = $_slider->getParam('polyfold_' . $alias . '_animated', false) == 'true' ? 'true' : 'false';
|
||||
$_inverted = $_slider->getParam('polyfold_' . $alias . '_inverted', false) == 'true' ? 'true' : 'false';
|
||||
|
||||
$_color = $_slider->getParam('polyfold_' . $alias . '_color', '#ffffff');
|
||||
$_range = $_slider->getParam('polyfold_' . $alias . '_range', 'slider');
|
||||
$_point = $_slider->getParam('polyfold_' . $alias . '_point', 'sides');
|
||||
$_placement = intval($_slider->getParam('polyfold_' . $alias . '_placement', 1));
|
||||
$_height = abs(intval($_slider->getParam('polyfold_' . $alias . '_height', 100)));
|
||||
$_leftWidth = abs(intval($_slider->getParam('polyfold_' . $alias . '_left_width', 50)) * .01);
|
||||
$_rightWidth = abs(intval($_slider->getParam('polyfold_' . $alias . '_right_width', 50)) * .01);
|
||||
|
||||
if(!$_color) $_color = '#ffffff';
|
||||
$_maxWidth = $_point === 'sides' ? 1 : 0.5;
|
||||
|
||||
$_leftWidth = max(min($_leftWidth, $_maxWidth), 0);
|
||||
$_rightWidth = max(min($_rightWidth, $_maxWidth), 0);
|
||||
|
||||
echo ' Rs' . ucfirst($_title) . 'AddOn(tpj, revapi' . $_id . ',{';
|
||||
echo 'position: "' . $alias . '", ';
|
||||
echo 'color: "' . $_color . '", ';
|
||||
echo 'scroll: ' . $_scroll . ', ';
|
||||
echo 'height: ' . $_height . ', ';
|
||||
echo 'range: "' . $_range . '", ';
|
||||
echo 'point: "' . $_point . '", ';
|
||||
echo 'placement: ' . $_placement . ', ';
|
||||
echo 'responsive: ' . $_responsive . ', ';
|
||||
echo 'negative: ' . $_negative . ', ';
|
||||
echo 'leftWidth: ' . $_leftWidth . ', ';
|
||||
echo 'rightWidth: ' . $_rightWidth;
|
||||
|
||||
if($_scroll === 'true') {
|
||||
|
||||
echo ', inverted: ' . $_inverted . ', ';
|
||||
echo 'animated: ' . $_animated;
|
||||
if($_animated === 'true') {
|
||||
|
||||
echo ', ease: "' . $_slider->getParam('polyfold_' . $alias . '_ease', 'ease-out') . '", ';
|
||||
echo 'time: ' . abs(floatval($_slider->getParam('polyfold_' . $alias . '_time', 0.3)));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
echo '});' . "\n";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/*
|
||||
* @author ThemePunch <info@themepunch.com>
|
||||
* @link http://www.themepunch.com/
|
||||
* @copyright 2017 ThemePunch
|
||||
*/
|
||||
|
||||
if(!defined('ABSPATH')) exit();
|
||||
|
||||
require_once(RS_POLYFOLD_PLUGIN_PATH . 'framework/base.class.php');
|
||||
|
||||
class RsPolyfoldBase extends RsAddOnPolyfoldBase {
|
||||
|
||||
protected static $_PluginPath = RS_POLYFOLD_PLUGIN_PATH,
|
||||
$_PluginUrl = RS_POLYFOLD_PLUGIN_URL,
|
||||
$_PluginTitle = 'polyfold',
|
||||
$_FilePath = __FILE__,
|
||||
$_Version = '1.0.2';
|
||||
|
||||
public function __construct() {
|
||||
|
||||
//load the textdomain, if the plugin should be translateable
|
||||
parent::_loadPluginTextDomain();
|
||||
|
||||
// check to make sure all requirements are met
|
||||
$notice = $this->systemsCheck();
|
||||
if($notice) {
|
||||
|
||||
require_once(RS_POLYFOLD_PLUGIN_PATH . 'framework/notices.class.php');
|
||||
|
||||
new RsAddOnPolyfoldNotice($notice, static::$_PluginTitle);
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
parent::loadClasses();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
* @author ThemePunch <info@themepunch.com>
|
||||
* @link http://www.themepunch.com/
|
||||
* @copyright 2017 ThemePunch
|
||||
*/
|
||||
|
||||
.rs-addon-polyfold {
|
||||
|
||||
position: absolute;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
z-index: 1099;
|
||||
pointer-events: none;
|
||||
|
||||
}
|
||||
|
||||
.rs-addon-polyfold div {
|
||||
|
||||
position: absolute;
|
||||
border-style: solid;
|
||||
box-sizing: content-box;
|
||||
|
||||
}
|
||||
|
||||
.rs-addon-poly-nav-level {z-index: 999}
|
||||
.rs-addon-poly-static-level {z-index: 99}
|
||||
|
||||
.rs-addon-polyfold:not(.rs-addon-poly-center) div:first-child {left: 0}
|
||||
.rs-addon-polyfold:not(.rs-addon-poly-center) div:last-child {right: 0}
|
||||
|
||||
.rs-addon-poly-center div:first-child {right: 50%}
|
||||
.rs-addon-poly-center div:last-child {left: 50%}
|
||||
|
||||
.rs-addon-polyfold:not(.rs-addon-poly-top),
|
||||
.rs-addon-polyfold:not(.rs-addon-poly-top) div {bottom: 0}
|
||||
|
||||
.rs-addon-poly-top {top: 0}
|
||||
.rs-addon-poly-top div {top: 0}
|
||||
@@ -0,0 +1,360 @@
|
||||
/**
|
||||
* @author ThemePunch <info@themepunch.com>
|
||||
* @link http://www.themepunch.com/
|
||||
* @copyright 2017 ThemePunch
|
||||
*/
|
||||
|
||||
;(function() {
|
||||
|
||||
'use strict';
|
||||
|
||||
var $,
|
||||
win,
|
||||
baseClass = 'rs-addon-polyfold',
|
||||
topClass = 'rs-addon-poly-top',
|
||||
bottomClass = 'rs-addon-poly-bottom',
|
||||
centerClass = 'rs-addon-poly-center',
|
||||
navLevel = 'rs-addon-poly-nav-level',
|
||||
staticLevel = 'rs-addon-poly-static-level';
|
||||
|
||||
window.RsPolyfoldAddOn = function(_$, slider, options) {
|
||||
|
||||
if(!_$ || !slider) return;
|
||||
|
||||
$ = _$;
|
||||
win = $(window);
|
||||
|
||||
// add hook to listen if the element is removed from the DOM
|
||||
$.event.special.polyfoldDestroyed = {remove: function(evt) {evt.handler();}};
|
||||
|
||||
new RsPolyfold(slider, options);
|
||||
|
||||
};
|
||||
|
||||
function RsPolyfold(slider, options) {
|
||||
|
||||
this.calc = false;
|
||||
this.slider = slider;
|
||||
this.scrolled = false;
|
||||
this.ids = slider[0].id;
|
||||
this.time = options.time;
|
||||
this.ease = options.ease;
|
||||
this.color = options.color;
|
||||
this.point = options.point;
|
||||
this.height = options.height;
|
||||
this.onScroll = options.scroll;
|
||||
this.inverted = options.inverted;
|
||||
this.animated = options.animated;
|
||||
this.negative = options.negative;
|
||||
this.placement = options.placement;
|
||||
this.leftWidth = options.leftWidth;
|
||||
this.rightWidth = options.rightWidth;
|
||||
this.responsive = options.responsive;
|
||||
this.range = options.range === 'slider';
|
||||
this.isTop = options.position === 'top';
|
||||
this.starter = this.calculate.bind(this);
|
||||
|
||||
slider.one('revolution.slide.onloaded', this.init.bind(this));
|
||||
|
||||
}
|
||||
|
||||
RsPolyfold.prototype = {
|
||||
|
||||
init: function() {
|
||||
|
||||
// bounce if the slider has been removed from the DOM before the onloaded event fires
|
||||
if(!document.body.contains(this.slider[0])) {
|
||||
|
||||
this.destroy();
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
var animeClass,
|
||||
cls = baseClass,
|
||||
container = document.createElement('div'),
|
||||
frag = document.createDocumentFragment();
|
||||
|
||||
this.left = document.createElement('div');
|
||||
this.right = document.createElement('div');
|
||||
|
||||
// poly resizing always based on the first level
|
||||
this.gridWidth = this.slider[0].opt.gridwidth;
|
||||
if(Array.isArray(this.gridWidth)) this.gridWidth = this.gridWidth[0];
|
||||
|
||||
if(!this.isTop) {
|
||||
|
||||
animeClass = bottomClass;
|
||||
cls += ' ' + bottomClass;
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
animeClass = topClass;
|
||||
cls += ' ' + topClass;
|
||||
|
||||
}
|
||||
|
||||
// sets the z-index
|
||||
if(this.placement > 1) {
|
||||
|
||||
cls += ' ';
|
||||
|
||||
if(this.placement === 2) {
|
||||
|
||||
cls += navLevel;
|
||||
|
||||
// set arrow z-index to same as bullets/tabs/thumbs
|
||||
this.slider.find('.tparrows').css('z-index', 1000);
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
cls += staticLevel;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// CSS3 transition
|
||||
if(this.animated) {
|
||||
|
||||
var style = document.createElement('style');
|
||||
style.type = 'text/css';
|
||||
style.innerHTML = '#' + this.ids + '_wrapper .' + animeClass + ' div ' +
|
||||
'{transition: border-width ' + this.time + 's ' + this.ease + ';}';
|
||||
|
||||
document.getElementsByTagName('head')[0].appendChild(style);
|
||||
|
||||
}
|
||||
|
||||
// draw from center or sides
|
||||
if(this.point === 'center') cls += ' ' + centerClass;
|
||||
|
||||
frag.appendChild(this.left);
|
||||
frag.appendChild(this.right);
|
||||
|
||||
container.className = cls;
|
||||
container.appendChild(frag);
|
||||
|
||||
// garbage collection from custom event set above
|
||||
this.slider.one('polyfoldDestroyed', this.destroy.bind(this));
|
||||
|
||||
// insert poly div after ".rev_slider"
|
||||
this.slider[0].parentNode.insertBefore(container, this.slider.nextSibling);
|
||||
|
||||
// resize and scroll events
|
||||
win.on('resize.rspolyaddon' + this.ids, this.resize.bind(this));
|
||||
if(this.onScroll) win.on('scroll.rspolyaddon' + this.ids, this.draw.bind(this));
|
||||
|
||||
// set the border colors
|
||||
this.colors();
|
||||
|
||||
// kick it off
|
||||
this.resize(false, true);
|
||||
|
||||
},
|
||||
|
||||
colors: function() {
|
||||
|
||||
var leftColor,
|
||||
rightColor;
|
||||
|
||||
if(!this.negative) {
|
||||
|
||||
if(!this.isTop) {
|
||||
|
||||
leftColor = 'transparent transparent transparent ' + this.color;
|
||||
rightColor = 'transparent transparent ' + this.color + ' transparent';
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
leftColor = this.color + ' transparent transparent transparent';
|
||||
rightColor = 'transparent ' + this.color + ' transparent transparent';
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
if(!this.isTop) {
|
||||
|
||||
leftColor = 'transparent transparent ' + this.color + ' transparent';
|
||||
rightColor = 'transparent transparent transparent ' + this.color;
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
leftColor = "transparent " + this.color + " transparent transparent";
|
||||
rightColor = this.color + " transparent transparent transparent";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
this.left.style.borderColor = leftColor;
|
||||
this.right.style.borderColor = rightColor;
|
||||
|
||||
},
|
||||
|
||||
draw: function(event) {
|
||||
|
||||
var offset,
|
||||
leftWidth,
|
||||
rightWidth;
|
||||
|
||||
if(this.onScroll) {
|
||||
|
||||
if(event) this.scrolled = true;
|
||||
var slideRect = this.slider[0].getBoundingClientRect();
|
||||
|
||||
// if slider is in viewport
|
||||
if(slideRect.top + window.pageYOffset < this.winHeight + window.pageYOffset && slideRect.bottom > 0) {
|
||||
|
||||
if(!this.isTop) {
|
||||
|
||||
if(!this.inverted) {
|
||||
|
||||
offset = this.calc !== false ? slideRect.bottom - this.calc : this.left.getBoundingClientRect().top;
|
||||
this.calc = this.polyHeight * ((this.drawHeight - offset) / this.drawHeight);
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
offset = this.calc !== false ? slideRect.bottom : this.left.getBoundingClientRect().top;
|
||||
this.calc = this.polyHeight - (this.polyHeight * (((this.drawHeight - offset) / this.drawHeight)));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
var dif = this.range ? this.winHeight - this.sliderHeight : 0;
|
||||
if(!this.inverted) {
|
||||
|
||||
offset = this.calc !== false ? slideRect.top + this.calc : this.left.getBoundingClientRect().top;
|
||||
this.calc = this.polyHeight * ((offset - dif) / this.drawHeight);
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
offset = this.calc !== false ? slideRect.top : this.left.getBoundingClientRect().top;
|
||||
this.calc = this.polyHeight - (this.polyHeight * ((offset - dif) / this.drawHeight));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
this.calc = Math.floor(Math.min(Math.max(this.calc, 0), this.polyHeight));
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
return 1;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
// simple fixed draw for no scroll setting
|
||||
else {
|
||||
|
||||
this.calc = this.polyHeight;
|
||||
|
||||
}
|
||||
|
||||
if(!this.negative) {
|
||||
|
||||
if(!this.isTop) {
|
||||
|
||||
leftWidth = this.calc + 'px 0 0 ' + Math.ceil(this.drawWidth * this.leftWidth) + 'px';
|
||||
rightWidth = '0 0 ' + this.calc + 'px ' + Math.ceil(this.drawWidth * this.rightWidth) + 'px';
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
leftWidth = this.calc + 'px ' + Math.ceil(this.drawWidth * this.leftWidth) + 'px 0 0';
|
||||
rightWidth = '0 ' + Math.ceil(this.drawWidth * this.rightWidth) + 'px ' + this.calc + 'px 0';
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
if(!this.isTop) {
|
||||
|
||||
leftWidth = '0 0 ' + this.calc + 'px ' + Math.ceil(this.drawWidth * this.leftWidth) + 'px';
|
||||
rightWidth = this.calc + 'px 0 0 ' + Math.ceil(this.drawWidth * this.rightWidth) + 'px';
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
leftWidth = "0 " + Math.ceil(this.drawWidth * this.leftWidth) + "px " + this.calc + 'px 0';
|
||||
rightWidth = this.calc + 'px ' + Math.ceil(this.drawWidth * this.rightWidth) + 'px 0 0';
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
this.left.style.borderWidth = leftWidth;
|
||||
this.right.style.borderWidth = rightWidth;
|
||||
|
||||
if(this.onScroll) return offset;
|
||||
|
||||
},
|
||||
|
||||
resize: function(event, init) {
|
||||
|
||||
this.winHeight = window.innerHeight;
|
||||
this.drawWidth = this.slider[0].clientWidth;
|
||||
this.sliderHeight = this.slider[0].clientHeight;
|
||||
this.drawHeight = this.range ? this.sliderHeight : this.winHeight;
|
||||
this.polyHeight = this.responsive ? Math.round(this.height * (this.drawWidth / this.gridWidth)) : this.height;
|
||||
|
||||
// always make slider.height the max-height
|
||||
this.polyHeight = Math.min(this.polyHeight, this.sliderHeight);
|
||||
|
||||
if(!init || !this.onScroll) {
|
||||
|
||||
this.draw();
|
||||
|
||||
}
|
||||
// need to draw a few times on document.ready for accuracy
|
||||
else if(this.onScroll) {
|
||||
|
||||
this.oldOffset = 0;
|
||||
this.newOffset = 1;
|
||||
this.calculate();
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
calculate: function() {
|
||||
|
||||
// need to draw a few times on document.ready for accuracy
|
||||
if(!this.scrolled && this.newOffset !== this.oldOffset) {
|
||||
|
||||
this.oldOffset = this.newOffset;
|
||||
this.newOffset = this.draw();
|
||||
window.requestAnimationFrame(this.starter);
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
delete this.starter;
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
destroy: function() {
|
||||
|
||||
win.off('scroll.rspolyaddon' + this.ids + ' resize.rspolyaddon' + this.ids);
|
||||
for(var prop in this) if(this.hasOwnProperty(prop)) delete this[prop];
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
})();
|
||||
16
web/revslider/plugins/revslider-polyfold-addon/public/assets/js/revolution.addon.polyfold.min.js
vendored
Normal file
16
web/revslider/plugins/revslider-polyfold-addon/public/assets/js/revolution.addon.polyfold.min.js
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* @author ThemePunch <info@themepunch.com>
|
||||
* @link http://www.themepunch.com/
|
||||
* @copyright 2017 ThemePunch
|
||||
*/
|
||||
|
||||
;(function(){function g(b,a){this.calc=!1;this.slider=b;this.scrolled=!1;this.ids=b[0].id;this.time=a.time;this.ease=a.ease;this.color=a.color;this.point=a.point;this.height=a.height;this.onScroll=a.scroll;this.inverted=a.inverted;this.animated=a.animated;this.negative=a.negative;this.placement=a.placement;this.leftWidth=a.leftWidth;this.rightWidth=a.rightWidth;this.responsive=a.responsive;this.range="slider"===a.range;this.isTop="top"===a.position;this.starter=this.calculate.bind(this);b.one("revolution.slide.onloaded",
|
||||
this.init.bind(this))}var d,e;window.RsPolyfoldAddOn=function(b,a,c){b&&a&&(d=b,e=d(window),d.event.special.polyfoldDestroyed={remove:function(a){a.handler()}},new g(a,c))};g.prototype={init:function(){if(document.body.contains(this.slider[0])){var b,a="rs-addon-polyfold",c=document.createElement("div"),d=document.createDocumentFragment();this.left=document.createElement("div");this.right=document.createElement("div");this.gridWidth=this.slider[0].opt.gridwidth;Array.isArray(this.gridWidth)&&(this.gridWidth=
|
||||
this.gridWidth[0]);this.isTop?(b="rs-addon-poly-top",a+=" rs-addon-poly-top"):(b="rs-addon-poly-bottom",a+=" rs-addon-poly-bottom");1<this.placement&&(a+=" ",2===this.placement?(a+="rs-addon-poly-nav-level",this.slider.find(".tparrows").css("z-index",1E3)):a+="rs-addon-poly-static-level");if(this.animated){var f=document.createElement("style");f.type="text/css";f.innerHTML="#"+this.ids+"_wrapper ."+b+" div {transition: border-width "+this.time+"s "+this.ease+";}";document.getElementsByTagName("head")[0].appendChild(f)}"center"===
|
||||
this.point&&(a+=" rs-addon-poly-center");d.appendChild(this.left);d.appendChild(this.right);c.className=a;c.appendChild(d);this.slider.one("polyfoldDestroyed",this.destroy.bind(this));this.slider[0].parentNode.insertBefore(c,this.slider.nextSibling);e.on("resize.rspolyaddon"+this.ids,this.resize.bind(this));if(this.onScroll)e.on("scroll.rspolyaddon"+this.ids,this.draw.bind(this));this.colors();this.resize(!1,!0)}else this.destroy()},colors:function(){var b,a;this.negative?this.isTop?(b="transparent "+
|
||||
this.color+" transparent transparent",a=this.color+" transparent transparent transparent"):(b="transparent transparent "+this.color+" transparent",a="transparent transparent transparent "+this.color):this.isTop?(b=this.color+" transparent transparent transparent",a="transparent "+this.color+" transparent transparent"):(b="transparent transparent transparent "+this.color,a="transparent transparent "+this.color+" transparent");this.left.style.borderColor=b;this.right.style.borderColor=a},draw:function(b){var a,
|
||||
c;if(this.onScroll)if(b&&(this.scrolled=!0),a=this.slider[0].getBoundingClientRect(),a.top+window.pageYOffset<this.winHeight+window.pageYOffset&&0<a.bottom)this.isTop?(b=this.range?this.winHeight-this.sliderHeight:0,this.inverted?(a=!1!==this.calc?a.top:this.left.getBoundingClientRect().top,this.calc=this.polyHeight-(a-b)/this.drawHeight*this.polyHeight):(a=!1!==this.calc?a.top+this.calc:this.left.getBoundingClientRect().top,this.calc=(a-b)/this.drawHeight*this.polyHeight)):this.inverted?(a=!1!==
|
||||
this.calc?a.bottom:this.left.getBoundingClientRect().top,this.calc=this.polyHeight-(this.drawHeight-a)/this.drawHeight*this.polyHeight):(a=!1!==this.calc?a.bottom-this.calc:this.left.getBoundingClientRect().top,this.calc=(this.drawHeight-a)/this.drawHeight*this.polyHeight),this.calc=Math.floor(Math.min(Math.max(this.calc,0),this.polyHeight));else return 1;else this.calc=this.polyHeight;this.negative?this.isTop?(b="0 "+Math.ceil(this.drawWidth*this.leftWidth)+"px "+this.calc+"px 0",c=this.calc+"px "+
|
||||
Math.ceil(this.drawWidth*this.rightWidth)+"px 0 0"):(b="0 0 "+this.calc+"px "+Math.ceil(this.drawWidth*this.leftWidth)+"px",c=this.calc+"px 0 0 "+Math.ceil(this.drawWidth*this.rightWidth)+"px"):this.isTop?(b=this.calc+"px "+Math.ceil(this.drawWidth*this.leftWidth)+"px 0 0",c="0 "+Math.ceil(this.drawWidth*this.rightWidth)+"px "+this.calc+"px 0"):(b=this.calc+"px 0 0 "+Math.ceil(this.drawWidth*this.leftWidth)+"px",c="0 0 "+this.calc+"px "+Math.ceil(this.drawWidth*this.rightWidth)+"px");this.left.style.borderWidth=
|
||||
b;this.right.style.borderWidth=c;if(this.onScroll)return a},resize:function(b,a){this.winHeight=window.innerHeight;this.drawWidth=this.slider[0].clientWidth;this.sliderHeight=this.slider[0].clientHeight;this.drawHeight=this.range?this.sliderHeight:this.winHeight;this.polyHeight=this.responsive?Math.round(this.drawWidth/this.gridWidth*this.height):this.height;this.polyHeight=Math.min(this.polyHeight,this.sliderHeight);a&&this.onScroll?this.onScroll&&(this.oldOffset=0,this.newOffset=1,this.calculate()):
|
||||
this.draw()},calculate:function(){this.scrolled||this.newOffset===this.oldOffset?delete this.starter:(this.oldOffset=this.newOffset,this.newOffset=this.draw(),window.requestAnimationFrame(this.starter))},destroy:function(){e.off("scroll.rspolyaddon"+this.ids+" resize.rspolyaddon"+this.ids);for(var b in this)this.hasOwnProperty(b)&&delete this[b]}}})();
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/*
|
||||
* @author ThemePunch <info@themepunch.com>
|
||||
* @link http://www.themepunch.com/
|
||||
* @copyright 2017 ThemePunch
|
||||
*/
|
||||
|
||||
if( !defined( 'ABSPATH') ) exit();
|
||||
|
||||
require_once(RS_POLYFOLD_PLUGIN_PATH . 'framework/slider.front.class.php');
|
||||
|
||||
class RsPolyfoldSliderFront extends RsAddonPolyfoldSliderFront {
|
||||
|
||||
protected static $_Version,
|
||||
$_PluginUrl,
|
||||
$_PluginTitle;
|
||||
|
||||
public function __construct($_version, $_pluginUrl, $_pluginTitle, $_isAdmin = false) {
|
||||
|
||||
static::$_Version = $_version;
|
||||
static::$_PluginUrl = $_pluginUrl;
|
||||
static::$_PluginTitle = $_pluginTitle;
|
||||
|
||||
if(!$_isAdmin) {
|
||||
|
||||
parent::enqueueScripts();
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
parent::enqueuePreview();
|
||||
|
||||
}
|
||||
|
||||
parent::writeInitScript();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,16 @@
|
||||
<div class="slider-revolution-update-list">
|
||||
|
||||
<h3 class="version-number">Version 1.0.2 (18th Sep 2017)</h3>
|
||||
<div class="change"><strong style="font-weight:700">CHANGES</strong></div>
|
||||
<ul>
|
||||
<li>Scripts will only be enqueued now if Add-On is officially enabled from the Slider settings</li>
|
||||
</ul>
|
||||
|
||||
<h3 class="version-number">Version 1.0.1 (22nd February 2017)</h3>
|
||||
|
||||
<div class="change"><strong style="font-weight:700">CHANGES</strong></div>
|
||||
<ul>
|
||||
<li>Updated for compatibility with Slider Revolution v.5.4</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
/*
|
||||
Plugin Name: Slider Revolution Polyfold Scroll Effect
|
||||
Plugin URI: http://www.themepunch.com/
|
||||
Description: Add sharp edges to your sliders as they scroll into and out of view
|
||||
Author: ThemePunch
|
||||
Version: 1.0.2
|
||||
Author URI: http://themepunch.com
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
SCRIPT HANDLES:
|
||||
|
||||
'rs-polyfold-admin'
|
||||
'rs-polyfold-front'
|
||||
|
||||
*/
|
||||
|
||||
// If this file is called directly, abort.
|
||||
if(!defined('WPINC')) die;
|
||||
|
||||
define('RS_POLYFOLD_PLUGIN_PATH', plugin_dir_path(__FILE__));
|
||||
define('RS_POLYFOLD_PLUGIN_URL', str_replace('index.php', '', plugins_url( 'index.php', __FILE__)));
|
||||
|
||||
require_once(RS_POLYFOLD_PLUGIN_PATH . 'includes/base.class.php');
|
||||
|
||||
/**
|
||||
* handle everyting by calling the following function *
|
||||
**/
|
||||
function rs_polyfold_init(){
|
||||
|
||||
new RsPolyfoldBase();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* call all needed functions on plugins loaded *
|
||||
**/
|
||||
add_action('plugins_loaded', 'rs_polyfold_init');
|
||||
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user