Initial Commit

This commit is contained in:
2019-11-21 12:25:31 +01:00
commit f4aabcb9b1
13959 changed files with 787761 additions and 0 deletions

View File

@@ -0,0 +1,58 @@
#rev_addon_snow_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_snow_settings_slideout h3 {
font-size: 20px;
text-align: center;
}
#rev_addon_snow_settings_slideout .featuretext {
margin-top: 10px;
}
#rev_addon_snow_settings_slideout .documentation {
text-align: center;
margin-bottom: 20px;
}
#rev_addon_snow_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_snow_settings_slideout .documentation a:hover {
opacity: 0.75;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

View File

@@ -0,0 +1,84 @@
/**
* @author ThemePunch <info@themepunch.com>
* @link http://www.themepunch.com/
* @copyright 2016 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_snow_settings_slideout');
scrollable = display.children('.rs-sbs-slideout-inner');
win = $(window).on('resize', onResize);
$('body').on(
'click',
'#rs-dash-addons-slide-out-trigger_revslider-snow-addon',
openPanel
).on('click', '#rev_addon_snow_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);

View File

@@ -0,0 +1,164 @@
<?php
/**
* @author ThemePunch <info@themepunch.com>
* @link http://www.themepunch.com/
* @copyright 2016 ThemePunch
*/
if( !defined( 'ABSPATH') ) exit();
require_once(RS_SNOW_PLUGIN_PATH . 'framework/slider.admin.class.php');
class RsSnowSliderAdmin extends RsAddonSnowSliderAdmin {
protected static $_Icon,
$_Title,
$_Markup,
$_JavaScript;
public function __construct($_title) {
static::$_Title = $_title;
parent::init();
}
protected static function _init($_slider) {
$_enabled = RevSliderFunctions::getVal($_slider, 'snow_enabled', false) == 'true' ? ' checked' : '';
$_startSlide = RevSliderFunctions::getVal($_slider, 'snow_start_slide', 'first');
$_endSlide = RevSliderFunctions::getVal($_slider, 'snow_end_slide', 'last');
$_maxFlakes = RevSliderFunctions::getVal($_slider, 'snow_max_num', '400');
$_minSize = RevSliderFunctions::getVal($_slider, 'snow_min_size', '0.2');
$_maxSize = RevSliderFunctions::getVal($_slider, 'snow_max_size', '6');
$_minOpacity = RevSliderFunctions::getVal($_slider, 'snow_min_opacity', '0.3');
$_maxOpacity = RevSliderFunctions::getVal($_slider, 'snow_max_opacity', '1');
$_minSpeed = RevSliderFunctions::getVal($_slider, 'snow_min_speed', '30');
$_maxSpeed = RevSliderFunctions::getVal($_slider, 'snow_max_speed', '100');
$_minSinus = RevSliderFunctions::getVal($_slider, 'snow_min_sinus', '1');
$_maxSinus = RevSliderFunctions::getVal($_slider, 'snow_max_sinus', '100');
$_alias = RevSliderFunctions::getVal($_slider, 'alias', '');
$_showSettings = $_enabled ? 'block' : 'none';
$_textDomain = 'rs_' . static::$_Title;
$_total = 2;
if($_alias) {
$_clas = new RevSlider();
$_rev_sliders = $_clas->getArrSliders();
foreach($_rev_sliders as $_rev_slider) {
if($_alias === $_rev_slider->getAlias()) $_total = $_rev_slider->getNumSlides();
}
}
static::$_Markup =
'<span class="label" id="label_snow_enabled" origtitle="' . __("Enable/Disable Holiday Snow for this Slider", $_textDomain) . '">' . __('Add Holiday Snow', $_textDomain) . '</span>
<input type="checkbox" class="tp-moderncheckbox withlabel" id="snow_enabled" name="snow_enabled"' . $_enabled . '
onchange="document.getElementById(\'snow-settings\').style.display=this.checked ? \'block\' : \'none\'" />
<div id="snow-settings" style="display: ' . $_showSettings . '">
<h4>General Settings</h4>
<span class="label" id="label_snow_start_slide" origtitle="' . __('Start Snowing on Slide Number X', $_textDomain) . '">' . __("Start on Slide", $_textDomain) . '</span>
<select class="withlabel" id="snow_start_slide" name="snow_start_slide" data-default="0">
<option value="first"';
if($_startSlide === 'first') static::$_Markup .= ' selected';
static::$_Markup .= '>First Slide</option>';
for($i = 2; $i < $_total + 1; $i++) {
static::$_Markup .= '<option value="' . $i . '"';
if($_startSlide == $i) static::$_Markup .= ' selected';
static::$_Markup .= '>' . $i . '</option>';
}
static::$_Markup .= '</select>
<br>
<span class="label" id="label_snow_end_slide" origtitle="' . __('End Snowing on Slide Number X', $_textDomain) . '">' . __("End on Slide", $_textDomain) . '</span>
<select class="withlabel" id="snow_end_slide" name="snow_end_slide" data-default="0">
<option value="last"';
if($_endSlide === 'last') static::$_Markup .= ' selected';
static::$_Markup .= '>Last Slide</option>';
for($i = 1; $i < $_total; $i++) {
static::$_Markup .= '<option value="' . $i . '"';
if($_endSlide == $i) static::$_Markup .= ' selected';
static::$_Markup .= '>' . $i . '</option>';
}
static::$_Markup .= '</select>
<br>
<h4>Snowflake Settings</h4>
<span class="label" id="label_snow_max" origtitle="' . __('Maximum Number of Snowflakes', $_textDomain) . '">' . __("Max Snowflakes", $_textDomain) . '</span>
<input type="text" class="text-sidebar withlabel" id="snow_max_num" name="snow_max_num" value="' . $_maxFlakes . '" data-default="400" />
<br>
<span class="label" id="label_snow_min_size" origtitle="' . __('Minimum Snowflake Size in pixels', $_textDomain) . '">' . __("Min Snowflake Size", $_textDomain) . '</span>
<input type="text" class="text-sidebar withlabel" id="snow_min_size" name="snow_min_size" value="' . $_minSize . '" data-default="0.2" />
<span>px</span>
<br>
<span class="label" id="label_snow_max_size" origtitle="' . __('Maximum Snowflake Size in pixels', $_textDomain) . '">' . __("Max Snowflake Size", $_textDomain) . '</span>
<input type="text" class="text-sidebar withlabel" id="snow_max_size" name="snow_max_size" value="' . $_maxSize . '" data-default="6" />
<span>px</span>
<br>
<span class="label" id="label_snow_min_opacity" origtitle="' . __('Minimum Snowflake Transparency (0-1)', $_textDomain) . '">' . __("Min Opacity (0-1)", $_textDomain) . '</span>
<input type="text" class="text-sidebar withlabel" id="snow_min_opacity" name="snow_min_opacity" value="' . $_minOpacity . '" data-default="0.3" />
<br>
<span class="label" id="label_snow_max_opacity" origtitle="' . __('Maximum Snowflake Transparency (0-1)', $_textDomain) . '">' . __("Max Opacity (0-1)", $_textDomain) . '</span>
<input type="text" class="text-sidebar withlabel" id="snow_max_opacity" name="snow_max_opacity" value="' . $_maxOpacity . '" data-default="1" />
<br>
<span class="label" id="label_snow_min_speed" origtitle="' . __('Higher the number, the faster the speed', $_textDomain) . '">' . __("Min Speed", $_textDomain) . '</span>
<input type="text" class="text-sidebar withlabel" id="snow_min_speed" name="snow_min_speed" value="' . $_minSpeed . '" data-default="30" />
<br>
<span class="label" id="label_snow_max_speed" origtitle="' . __('Higher the number, the faster the speed', $_textDomain) . '">' . __("Max Speed", $_textDomain) . '</span>
<input type="text" class="text-sidebar withlabel" id="snow_max_speed" name="snow_max_speed" value="' . $_maxSpeed . '" data-default="100" />
<br>
<span class="label" id="label_snow_min_sinus" origtitle="' . __('Applies additional variation to the falling snow', $_textDomain) . '">' . __("Min Amplitude", $_textDomain) . '</span>
<input type="text" class="text-sidebar withlabel" id="snow_min_sinus" name="snow_min_sinus" value="' . $_minSinus . '" data-default="1" />
<br>
<span class="label" id="label_snow_min_sinus" origtitle="' . __('Applies additional variation to the falling snow', $_textDomain) . '">' . __("Max Amplitude", $_textDomain) . '</span>
<input type="text" class="text-sidebar withlabel" id="snow_max_sinus" name="snow_max_sinus" value="' . $_maxSinus . '" data-default="100" />
<br>
<div class="toggle-custom-navigation-style visible" onclick="resetSnowDefaults()">Reset to Default Values</div>
</div>';
static::$_Icon = 'eg-icon-magic';
static::$_JavaScript = 'function resetSnowDefaults() {
if(window.confirm("Reset Settings to their Defaults?")) {
jQuery("#snow-settings").children("select, input").each(function() {
this[this.type === "text" ? "value" : "selectedIndex"] = this.getAttribute("data-default");
});
}
}';
}
}
?>

View File

@@ -0,0 +1,224 @@
<?php
/**
* @author ThemePunch <info@themepunch.com>
* @link http://www.themepunch.com/
* @copyright 2016 ThemePunch
*/
if( !defined( 'ABSPATH') ) exit();
class rs_snow_update {
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-snow-addon/revslider-snow-addon.php';
private $plugin_slug = 'revslider-snow-addon';
private $plugin_path = 'revslider-snow-addon/revslider-snow-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() {
$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('rs_snow-update-check');
if($last_check == false){ //first time called
$last_check = time();
update_option('rs_snow-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('rs_snow-update-check', time());
$this->data->checked = time();
$this->data->basic = $data->basic;
$this->data->full = $data->full;
//update_option('rs_snow-stable-version', $data->full->stable);
update_option('rs_snow-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('rs_snow-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('rs_snow-update-check-short');
if($last_check == false){ //first time called
$last_check = time();
update_option('rs_snow-update-check-short', $last_check);
}
// Check for updates
if(time() - $last_check > 172800 || $force_check == true){
update_option('rs_snow-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-snow-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('rs_snow-connection', false);
return false;
}else{
update_option('rs_snow-connection', true);
}
/*
$version_info = json_decode($version_info);
if(isset($version_info->version)){
update_option('rs_snow-latest-version', $version_info->version);
}
if(isset($version_info->notices)){
update_option('rs_snow-notices', $version_info->notices);
}
if(isset($version_info->dashboard)){
update_option('rs_snow-dashboard', $version_info->dashboard);
}
if(isset($version_info->deactivated) && $version_info->deactivated === true){
if(get_option('rs_snow-valid', 'false') == 'true'){
//remove validation, add notice
update_option('rs_snow-valid', 'false');
update_option('rs_snow-deact-notice', true);
}
}
*/
}
if($force_check == true){ //force that the update will be directly searched
update_option('rs_snow-update-check', '');
}
}
}
?>

View File

@@ -0,0 +1,41 @@
<?php
/**
* @author ThemePunch <info@themepunch.com>
* @link http://www.themepunch.com/
* @copyright 2016 ThemePunch
*/
/*
create fake "Add-On" block to test this widget
http://pastebin.com/J0wB676U
*/
if(!defined('ABSPATH')) exit();
?>
<div id="rev_addon_snow_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 Snow Add-On', 'rs_snow'); ?></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" the Snow','rs_snow'); ?></h3>
<img src="<?php echo RS_SNOW_PLUGIN_URL . "admin/assets/images/tutorial0.jpg"; ?>">
<h3><span>2</span> <?php _e('"Adjust" the Options','rs_snow'); ?></h3>
<img src="<?php echo RS_SNOW_PLUGIN_URL . "admin/assets/images/tutorial1.jpg"; ?>">
<h3><span>3</span> <?php _e('"Watch it snow!','rs_snow'); ?></h3>
<img src="<?php echo RS_SNOW_PLUGIN_URL . "admin/assets/images/tutorial2.jpg"; ?>">
</div>
</div>