Initial Commit
62
web/revslider/plugins/countdown/revolution.addon.countdown.min.js
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
|
||||
// countdown.js jQuery Engine MADE BY HILIOS
|
||||
// https://github.com/hilios/jQuery.countdown
|
||||
!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(t){"use strict";function e(t){if(t instanceof Date)return t;if(String(t).match(o))return String(t).match(/^[0-9]*$/)&&(t=Number(t)),String(t).match(/\-/)&&(t=String(t).replace(/\-/g,"/")),new Date(t);throw new Error("Couldn't cast `"+t+"` to a date object.")}function s(t){var e=t.toString().replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");return new RegExp(e)}function n(t){return function(e){var n=e.match(/%(-|!)?[A-Z]{1}(:[^;]+;)?/gi);if(n)for(var a=0,o=n.length;o>a;++a){var r=n[a].match(/%(-|!)?([a-zA-Z]{1})(:[^;]+;)?/),l=s(r[0]),c=r[1]||"",u=r[3]||"",f=null;r=r[2],h.hasOwnProperty(r)&&(f=h[r],f=Number(t[f])),null!==f&&("!"===c&&(f=i(u,f)),""===c&&10>f&&(f="0"+f.toString()),e=e.replace(l,f.toString()))}return e=e.replace(/%%/,"%")}}function i(t,e){var s="s",n="";return t&&(t=t.replace(/(:|;|\s)/gi,"").split(/\,/),1===t.length?s=t[0]:(n=t[0],s=t[1])),1===Math.abs(e)?n:s}var a=[],o=[],r={precision:100,elapse:!1};o.push(/^[0-9]*$/.source),o.push(/([0-9]{1,2}\/){2}[0-9]{4}( [0-9]{1,2}(:[0-9]{2}){2})?/.source),o.push(/[0-9]{4}([\/\-][0-9]{1,2}){2}( [0-9]{1,2}(:[0-9]{2}){2})?/.source),o=new RegExp(o.join("|"));var h={Y:"years",m:"months",n:"daysToMonth",w:"weeks",d:"daysToWeek",D:"totalDays",H:"hours",M:"minutes",S:"seconds"},l=function(e,s,n){this.el=e,this.$el=t(e),this.interval=null,this.offset={},this.options=t.extend({},r),this.instanceNumber=a.length,a.push(this),this.$el.data("countdown-instance",this.instanceNumber),n&&("function"==typeof n?(this.$el.on("update.countdown",n),this.$el.on("stoped.countdown",n),this.$el.on("finish.countdown",n)):this.options=t.extend({},r,n)),this.setFinalDate(s),this.start()};t.extend(l.prototype,{start:function(){null!==this.interval&&clearInterval(this.interval);var t=this;this.update(),this.interval=setInterval(function(){t.update.call(t)},this.options.precision)},stop:function(){clearInterval(this.interval),this.interval=null,this.dispatchEvent("stoped")},toggle:function(){this.interval?this.stop():this.start()},pause:function(){this.stop()},resume:function(){this.start()},remove:function(){this.stop.call(this),a[this.instanceNumber]=null,delete this.$el.data().countdownInstance},setFinalDate:function(t){this.finalDate=e(t)},update:function(){if(0===this.$el.closest("html").length)return void this.remove();var e,s=void 0!==t._data(this.el,"events"),n=new Date;e=this.finalDate.getTime()-n.getTime(),e=Math.ceil(e/1e3),e=!this.options.elapse&&0>e?0:Math.abs(e),this.totalSecsLeft!==e&&s&&(this.totalSecsLeft=e,this.elapsed=n>=this.finalDate,this.offset={seconds:this.totalSecsLeft%60,minutes:Math.floor(this.totalSecsLeft/60)%60,hours:Math.floor(this.totalSecsLeft/60/60)%24,days:Math.floor(this.totalSecsLeft/60/60/24)%7,daysToWeek:Math.floor(this.totalSecsLeft/60/60/24)%7,daysToMonth:Math.floor(this.totalSecsLeft/60/60/24%30.4368),totalDays:Math.floor(this.totalSecsLeft/60/60/24),weeks:Math.floor(this.totalSecsLeft/60/60/24/7),months:Math.floor(this.totalSecsLeft/60/60/24/30.4368),years:Math.abs(this.finalDate.getFullYear()-n.getFullYear())},this.options.elapse||0!==this.totalSecsLeft?this.dispatchEvent("update"):(this.stop(),this.dispatchEvent("finish")))},dispatchEvent:function(e){var s=t.Event(e+".countdown");s.finalDate=this.finalDate,s.elapsed=this.elapsed,s.offset=t.extend({},this.offset),s.strftime=n(this.offset),this.$el.trigger(s)}}),t.fn.countdown=function(){var e=Array.prototype.slice.call(arguments,0);return this.each(function(){var s=t(this).data("countdown-instance");if(void 0!==s){var n=a[s],i=e[0];l.prototype.hasOwnProperty(i)?n[i].apply(n,e.slice(1)):null===String(i).match(/^[$A-Z_][0-9A-Z_$]*$/i)?(n.setFinalDate.call(n,i),n.start()):t.error("Method %s does not exist on jQuery.countdown".replace(/\%s/gi,i))}else new l(this,e[0],e[1])})}});
|
||||
|
||||
|
||||
function tp_countdown(api,targetdate,slidechanges) {
|
||||
|
||||
|
||||
var currentd,currenth,currentm,currents;
|
||||
|
||||
function animateAndUpdate(o,nt,ot) {
|
||||
if (ot==undefined) {
|
||||
o.html(nt);
|
||||
} else {
|
||||
if (o.css("opacity")>0) {
|
||||
punchgs.TweenLite.fromTo(o,0.45,
|
||||
{autoAlpha:1,rotationY:0,scale:1},
|
||||
{autoAlpha:0,rotationY:-180,scale:0.5,ease:punchgs.Back.easeIn,onComplete:function() { o.html(nt);} });
|
||||
|
||||
punchgs.TweenLite.fromTo(o,0.45,
|
||||
{autoAlpha:0,rotationY:180,scale:0.5},
|
||||
{autoAlpha:1,rotationY:0,scale:1,ease:punchgs.Back.easeOut,delay:0.5 });
|
||||
} else {
|
||||
o.html(nt);
|
||||
}
|
||||
}
|
||||
return nt;
|
||||
}
|
||||
|
||||
function countprocess(event) {
|
||||
|
||||
var newd = event.strftime('%D'),
|
||||
newh = event.strftime('%H'),
|
||||
newm = event.strftime('%M'),
|
||||
news = event.strftime('%S');
|
||||
if (newd != currentd) currentd = animateAndUpdate(jQuery('#t_days'),newd,currentd);
|
||||
if (newh != currenth) currenth = animateAndUpdate(jQuery('#t_hours'),newh,currenth);
|
||||
if (newm != currentm) currentm = animateAndUpdate(jQuery('#t_minutes'),newm,currentm);
|
||||
if (news != currents) currents = animateAndUpdate(jQuery('#t_seconds'),news,currents);
|
||||
|
||||
jQuery.each(slidechanges,function(i,obj) {
|
||||
var dr = obj.days==undefined || obj.days>=newd,
|
||||
hr = obj.hours==undefined || obj.hours>=newh,
|
||||
mr = obj.minutes==undefined || obj.minutes>=newm,
|
||||
sr = obj.seconds==undefined || obj.seconds>=news;
|
||||
if (dr && hr && mr && sr && !obj.changedown) {
|
||||
api.revshowslide(obj.slide);
|
||||
obj.changedown = true;
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
jQuery('#skipahead').click(function(){
|
||||
|
||||
var quickjump = 15000,
|
||||
smalloffset = new Date().getTime() + quickjump;
|
||||
api.countdown(smalloffset,countprocess);
|
||||
});
|
||||
|
||||
api.countdown(targetdate, countprocess);
|
||||
}
|
||||
10
web/revslider/plugins/index.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>403 Forbidden</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<p>Directory access is forbidden.</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,41 @@
|
||||
/********************************************************
|
||||
|
||||
SLIDER REVOLUTION BACKUP
|
||||
|
||||
* REVOLUTION 5.2.0 EXTENSION - BACKUP ADMIN CSSrs-frame-
|
||||
* @version: 1.0 (16.02.2016)
|
||||
* @author ThemePunch
|
||||
*********************************************************/
|
||||
|
||||
|
||||
#rs-addon-settings-trigger-backup { border-radius:0px; padding:0px; color:transparent; background:url(../images/addon_logo.png); background-size:127px 54px; background-position:top center; width:127px;height:27px;}
|
||||
#rs-addon-settings-trigger-backup.selected,
|
||||
#rs-addon-settings-trigger-backup:hover { background-position: bottom center}
|
||||
|
||||
#rs-addon-settings-trigger-backup-settings { padding:15px 20px;}
|
||||
|
||||
|
||||
.rs-addon-backup-trigger-button { line-height:28px; color:#fff; padding:0px 20px; background: #3498db; cursor: pointer; display:inline-block;}
|
||||
.rs-addon-backup-trigger-button:hover { background: #2980b9}
|
||||
|
||||
#dialog_select_slide_backup { padding:0px;}
|
||||
|
||||
.rs-backup-data-holder { line-height:45px; vertical-align: middle; border-bottom:1px solid #ddd; padding:0px 20px;}
|
||||
.rs-backup-id { display: inline-block;width: 20px;text-align: right;}
|
||||
|
||||
.eg-icon-calendar { margin-left:25px; color:#aaa; margin-right:5px;}
|
||||
.eg-icon-calendar:before { color:#aaa; font-size:16px;}
|
||||
|
||||
.rs-preview-backup { border:1px solid #3498db; font-size:12px; color:#3498db; line-height: 24px; padding:0px 10px; font-weight: 400; cursor: pointer; display: inline-block;margin-top:10px; border-radius: 4px;}
|
||||
|
||||
.rs-load-backup { background:#3498db; font-size:12px; color:#fff; line-height: 26px; padding:0px 10px; font-weight: 400; cursor: pointer; display: inline-block;margin-top:10px;border-radius: 4px; margin-left:5px;}
|
||||
|
||||
.rs-preview-backup:hover { color:#fff;background:#3498db;}
|
||||
.rs-load-backup:hover { background: #2980b9}
|
||||
|
||||
|
||||
.rs-backup-data-holder.rs-temp-backup-holder { background:rgba(255,255,255,0.45); border-radius: 4px; position: absolute; top: 50px; left: 50%; border-bottom:none !important; width:320px; margin-left:-160px; height:40px;line-height: 40px;}
|
||||
|
||||
.rs-temp-backup-holder .rs-load-backup { float:right;margin-top:8px;}
|
||||
|
||||
.nobackups { padding:25px 20px; color:#999; font-size: 14px;}
|
||||
@@ -0,0 +1,31 @@
|
||||
.tp-steps span {
|
||||
-webkit-border-radius: 50%;
|
||||
-moz-border-radius: 50%;
|
||||
border-radius: 50%;
|
||||
border: 2px solid #d50000;
|
||||
color: #d50000;
|
||||
font-size: 17px;
|
||||
font-weight: 700;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
line-height: 37px;
|
||||
text-align: center;
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.tp-steps.wb span {
|
||||
border: 2px solid #22a2ad;
|
||||
color: #fff;
|
||||
background: #22a2ad;
|
||||
}
|
||||
|
||||
h3.tp-steps {
|
||||
font-size: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.wb-featuretext {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 23 KiB |
@@ -0,0 +1,24 @@
|
||||
///////////////////////////////
|
||||
// INIT BACKUP SCRIPTS //
|
||||
///////////////////////////////
|
||||
jQuery("document").ready(function() {
|
||||
|
||||
// CHECK EDITOR MODE
|
||||
var editor_view = jQuery('#form_slider_params').length>0 ? "slider_settings" : "slide_settings";
|
||||
|
||||
if (editor_view==="slide_settings"){
|
||||
rs_backup_slide_init();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
/********************************************************************
|
||||
|
||||
LAYER / SLIDE SETTINGS BACKEND jQUERY EXTENSION
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
var rs_backup_slide_init = function() {
|
||||
if(typeof(rs_backup_loaded) === 'undefined') return false; //WILL BE WRITTEN BY admin/includes/slide.class.php DEPENDING IF BACKUP IS ENABLED/DISABLED
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
(function( $ ) {
|
||||
|
||||
$(function() {
|
||||
|
||||
/*! Main Functionality for Settings SlideOut */
|
||||
jQuery('document').ready(function() {
|
||||
var a = jQuery('#rev_addon_gal_settings_slideout');
|
||||
punchgs.TweenLite.set(a,{xPercent:"+100%", autoAlpha:0, display:"none"});
|
||||
|
||||
jQuery('body').on('click', '#rs-dash-addons-slide-out-trigger_revslider-backup-addon', function() {
|
||||
console.log("clicked");
|
||||
//hide all wrappers
|
||||
jQuery('.rs-sbs-slideout-wrapper').each(function(){
|
||||
punchgs.TweenLite.to(jQuery(this),0.4,{xPercent:"+100%", autoAlpha:0, display:"none",overwrite:"auto",ease:punchgs.Power3.easeInOut});
|
||||
});
|
||||
|
||||
//display slideout
|
||||
var a = jQuery('#rev_addon_backup_settings_slideout'),
|
||||
b = jQuery('.rs-dash-addons');
|
||||
punchgs.TweenLite.to(a,0.4,{xPercent:"0%", autoAlpha:1, display:"block",overwrite:"auto",ease:punchgs.Power3.easeOut});
|
||||
|
||||
//enable Scrollbars
|
||||
jQuery('#rev_addon_backup_settings_slideout .rs-sbs-slideout-inner').css("max-height",$( window ).height()-300);
|
||||
setTimeout(function() {
|
||||
jQuery('#rev_addon_backup_settings_slideout .rs-sbs-slideout-inner').perfectScrollbar("update");
|
||||
},400);
|
||||
});
|
||||
jQuery('body').on('click','#rev_addon_backup_settings_slideout .rs-sbs-close', function() {
|
||||
var a = jQuery('#rev_addon_backup_settings_slideout');
|
||||
punchgs.TweenLite.to(a,0.4,{xPercent:"+100%", autoAlpha:0, display:"none",overwrite:"auto",ease:punchgs.Power3.easeInOut});
|
||||
});
|
||||
|
||||
//call scrollbars
|
||||
jQuery('#rev_addon_backup_settings_slideout .rs-sbs-slideout-inner').perfectScrollbar({wheelPropagation:true, suppressScrollX:true});
|
||||
|
||||
$(window).resize(function(){
|
||||
jQuery('#rev_addon_backup_settings_slideout .rs-sbs-slideout-inner').css("max-height",$( window ).height()-300);
|
||||
jQuery('#rev_addon_backup_settings_slideout .rs-sbs-slideout-inner').perfectScrollbar("update");
|
||||
});
|
||||
|
||||
}); //end document ready
|
||||
|
||||
});
|
||||
|
||||
})( jQuery );
|
||||
@@ -0,0 +1,594 @@
|
||||
<?php
|
||||
/**
|
||||
* @author ThemePunch <info@themepunch.com>
|
||||
* @link http://www.themepunch.com/
|
||||
* @copyright 2016 ThemePunch
|
||||
*/
|
||||
|
||||
if( !defined( 'ABSPATH') ) exit();
|
||||
|
||||
class rs_backup_slide extends RevSliderAdmin {
|
||||
|
||||
public static function init_backup(){
|
||||
|
||||
add_filter('revslider_slide_settings_addons', array('rs_backup_slide', 'add_backup_settings'), 10, 3); //adds interface / menu to the Slide General Settings
|
||||
add_filter('revslider_admin_onAjaxAction_switch', array('rs_backup_slide', 'add_backup_ajax_functions'), 10, 6); //adds new ajax calls to the Slider
|
||||
|
||||
add_action('revslider_slide_updateSlideFromData_post', array('rs_backup_slide', 'check_add_new_backup'), 10, 3); //hooks into the saving process of a Slide
|
||||
add_action('revslider_slide_updateStaticSlideFromData_post', array('rs_backup_slide', 'check_add_new_backup_static'), 10, 3); //hooks into the saving process of a Static Slide
|
||||
|
||||
add_action('revslider_slide_deleteSlide', array('rs_backup_slide', 'delete_backup_full')); //hooks into the deletion process of a Slide
|
||||
add_action('revslider_slider_deleteAllSlides', array('rs_backup_slide', 'delete_backup_full_slider')); //hooks into the deletion process of a Slide
|
||||
|
||||
self::create_tables(); //creates tables needed for this plugin to work
|
||||
|
||||
if(isset($_GET["page"]) && $_GET["page"]=="revslider"){
|
||||
add_action('admin_enqueue_scripts', array('rs_backup_slide', 'wb_enqueue_styles'));
|
||||
add_action('admin_enqueue_scripts', array('rs_backup_slide', 'wb_enqueue_scripts'));
|
||||
}
|
||||
}
|
||||
|
||||
public static function wb_enqueue_styles(){
|
||||
wp_register_style('revslider-backup-plugin-settings', RS_BACKUP_PLUGIN_URL . 'admin/assets/css/backup-admin.css', array(), RS_BACKUP_VERSION);
|
||||
wp_enqueue_style('revslider-backup-plugin-settings');
|
||||
}
|
||||
|
||||
|
||||
public static function wb_enqueue_scripts(){
|
||||
wp_register_script('revslider-backup-plugin-js', RS_BACKUP_PLUGIN_URL . 'admin/assets/js/backup-admin.js', array(), RS_BACKUP_VERSION);
|
||||
wp_enqueue_script('revslider-backup-plugin-js');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* adds interface / menu to the Slide General Settings
|
||||
* @since: 1.0.0
|
||||
*/
|
||||
public static function add_backup_settings($settings, $slide, $slider){
|
||||
|
||||
$slide_id = ($slide->isStaticSlide()) ? 'static_'.$slider->getID() : $slide->getID();
|
||||
|
||||
$markup = '<input type="hidden" id="rs-session-id" value="'. substr(md5(rand()), 0, 7) .'" />';
|
||||
$markup .=
|
||||
'<div class="slide-show-backups-wrapper"><div class="slide-show-backups rs-addon-backup-trigger-button" data-slideid="'.$slide_id.'">'.__("Show available Backups for this Slide",'rs_backup').'</div></div>
|
||||
|
||||
<div id="dialog_select_slide_backup" class="dialog_select_slide_backup" title="'.__('Select Backup', 'rs_backup').'" style="display:none;">
|
||||
<div id="rs-backup-wrapper">
|
||||
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
$settings['backup'] = array(
|
||||
'title' => __('Backup', 'rs_backup'),
|
||||
'markup' => $markup,
|
||||
'javascript'=> "var rs_backup_loaded = true;
|
||||
|
||||
jQuery('body').append('<form id=\"rs-backup-preview-form\" name=\"rs-backup-preview-form\" action=\"".RevSliderBase::$url_ajax_actions."\" target=\"rs-frame-preview\" method=\"post\"><input type=\"hidden\" id=\"rs-backup-client-action\" name=\"client_action\" value=\"\"><input type=\"hidden\" id=\"rs-nonce\" name=\"rs-nonce\" value=\"".wp_create_nonce("revslider_actions")."\"><!-- SPECIFIC FOR SLIDE PREVIEW --><input type=\"hidden\" name=\"data[id]\" value=\"\" id=\"preview-slide-backup-data\"><input type=\"hidden\" name=\"data[slide_id]\" value=\"\" id=\"preview-slide-backup-data-slide_id\"><!-- SPECIFIC FOR SLIDER PREVIEW --></form>');
|
||||
|
||||
jQuery('body').on('click', '.slide-show-backups', function(){
|
||||
var slideID = jQuery(this).data('slideid');
|
||||
|
||||
var data = {'slideID':slideID};
|
||||
UniteAdminRev.ajaxRequest('fetch_slide_backups', data, function(response){
|
||||
jQuery('#rs-backup-wrapper').html('');
|
||||
|
||||
if(response.slides !== undefined && response.slides.length > 0){
|
||||
for(var key in response.slides){
|
||||
jQuery('#rs-backup-wrapper').append('<div class=\"rs-backup-data-holder\" data-backup=\"'+response.slides[key]['id']+'\" data-slide_id=\"'+slideID+'\"><span class=\"rs-backup-time\"><span class=\"rs-backup-id\">'+response.slides[key]['id']+'.</span><i class=\"eg-icon-calendar\"></i>'+response.slides[key]['created']+'</span><span class=\"rs-load-backup\" style=\"float: right;\">".__('Load Backup', 'rs_backup')."</span><span class=\"rs-preview-backup\" style=\"float: right;\">".__('Preview Backup', 'rs_backup')."</span></div>');
|
||||
}
|
||||
}else{
|
||||
jQuery('#rs-backup-wrapper').append('<div class=\"nobackups\">".__('No backups found for the selected Slide', 'rs_backup')."</div>');
|
||||
}
|
||||
|
||||
jQuery('#dialog_select_slide_backup').dialog({
|
||||
modal:true,
|
||||
width: 580,
|
||||
height:480,
|
||||
resizable:false,
|
||||
closeOnEscape:true,
|
||||
create:function(ui) {
|
||||
jQuery(ui.target).parent().find('.ui-dialog-titlebar').addClass('tp-slider-new-dialog-title');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
jQuery('body').on('click', '.rs-close-preview', function(){
|
||||
jQuery('#dialog_preview_slide_backup').hide();
|
||||
var rs_form = jQuery('#rs-backup-preview-form');
|
||||
|
||||
jQuery('#rs-backup-client-action').val('preview_slide_backup');
|
||||
jQuery(\"#preview-slide-backup-data\").val(\"empty_output\");
|
||||
jQuery(\"#preview-slide-backup-data-slide_id\").val(\"empty_output\");
|
||||
|
||||
jQuery('#rs-preview-wrapper').hide();
|
||||
|
||||
jQuery('.rs-temp-backup-holder').remove();
|
||||
|
||||
rs_form.submit();
|
||||
});
|
||||
|
||||
jQuery(document).keyup(function(e){
|
||||
if (e.keyCode == 27) jQuery('.rs-close-backup-preview').click(); // 27 == esc
|
||||
});
|
||||
|
||||
jQuery(window).resize(function() {
|
||||
jQuery('.rs-preview-width').text(jQuery('.rs-frame-preview-wrapper').width());
|
||||
jQuery('.rs-preview-height').text(jQuery('.rs-frame-preview-wrapper').height());
|
||||
});
|
||||
|
||||
|
||||
jQuery('body').on('click', '.rs-load-backup', function(){
|
||||
var dh = jQuery(this).closest('.rs-backup-data-holder');
|
||||
if(confirm('".__('Restore Slide Backup from', 'rs_backup')." '+dh.find('.rs-backup-time').text()+'?')){
|
||||
|
||||
jQuery('.rs-close-preview').click(); //to hide the overlay if it is open
|
||||
|
||||
var backup_id = dh.data('backup');
|
||||
var slide_id = dh.data('slide_id');
|
||||
var session_id = jQuery('#rs-session-id').val();
|
||||
|
||||
|
||||
var data = {'id': backup_id, 'slide_id': slide_id, 'session_id': session_id};
|
||||
|
||||
jQuery('#dialog_select_slide_backup').dialog('close');
|
||||
|
||||
UniteAdminRev.ajaxRequest('restore_slide_backup', data, function(response){
|
||||
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
jQuery('body').on('click', '.rs-preview-backup', function(){
|
||||
var dh = jQuery(this).closest('.rs-backup-data-holder');
|
||||
var backup_id = dh.data('backup');
|
||||
var slide_id = dh.data('slide_id');
|
||||
var backup_time = dh.find('.rs-backup-time').html();
|
||||
|
||||
jQuery('#dialog_select_slide_backup').dialog('close');
|
||||
|
||||
var rs_form = jQuery('#rs-backup-preview-form');
|
||||
|
||||
//set action and data
|
||||
jQuery('#rs-backup-client-action').val('preview_slide_backup');
|
||||
jQuery('#preview-slide-backup-data').val(backup_id);
|
||||
jQuery('#preview-slide-backup-data-slide_id').val(slide_id);
|
||||
|
||||
jQuery('#rs-preview-wrapper').show();
|
||||
|
||||
//add apply button under the form
|
||||
jQuery('#rs-preview-wrapper').append('<div class=\"rs-backup-data-holder rs-temp-backup-holder\" data-backup=\"'+backup_id+'\" data-slide_id=\"'+slide_id+'\"><span class=\"rs-backup-time\">'+backup_time+'</span><span class=\"rs-load-backup\">".__('Load Backup', 'rs_backup')."</span></div>');
|
||||
|
||||
rs_form.submit();
|
||||
|
||||
jQuery(window).trigger('resize');
|
||||
});
|
||||
|
||||
|
||||
var call_wb_saveEditSlide = {
|
||||
callback : function(data) {
|
||||
data.session_id = jQuery('#rs-session-id').val();
|
||||
return data;
|
||||
},
|
||||
environment : 'saveEditSlide',
|
||||
function_position : 'data'
|
||||
|
||||
};
|
||||
|
||||
|
||||
// ADD CALLBACKS
|
||||
UniteLayersRev.addon_callbacks.push(call_wb_saveEditSlide);"
|
||||
);
|
||||
|
||||
return $settings;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* adds ajax functions
|
||||
* @since: 1.0.0
|
||||
*/
|
||||
public static function add_backup_ajax_functions($remove_error, $action, $data, $slider, $slide, $operations){
|
||||
|
||||
switch($action){
|
||||
case 'fetch_slide_backups':
|
||||
$slide_id = $data['slideID'];
|
||||
$slide_data = self::fetch_slide_backups($slide_id, true);
|
||||
|
||||
self::ajaxResponseData(array('slides' => $slide_data));
|
||||
break;
|
||||
case 'restore_slide_backup':
|
||||
$backup_id = intval($data['id']);
|
||||
$slide_id = $data['slide_id'];
|
||||
$session_id = esc_attr($data['session_id']);
|
||||
$response = self::restore_slide_backup($backup_id, $slide_id, $session_id, $slide);
|
||||
|
||||
if($response !== true) RevSliderFunctions::throwError(__("Backup restoration failed...",'rs_backup'));
|
||||
|
||||
$urlRedirect = self::getViewUrl(self::VIEW_SLIDE,"id=$slide_id");
|
||||
$responseText = __("Backup restored, redirecting...",'rs_backup');
|
||||
self::ajaxResponseSuccessRedirect($responseText, $urlRedirect);
|
||||
break;
|
||||
case 'preview_slide_backup':
|
||||
//check if we are static or not
|
||||
|
||||
$operations = new RevSliderOperations();
|
||||
|
||||
ob_start();
|
||||
//first get data
|
||||
$backup_id = intval($data['id']);
|
||||
$slide_id = $data['slide_id'];
|
||||
|
||||
if($backup_id == "empty_output"){
|
||||
echo '<div class="message_loading_preview">'.__("Loading Preview...",'rs_backup').'</div>';
|
||||
exit();
|
||||
}
|
||||
|
||||
$my_data = self::fetch_backup($backup_id);
|
||||
|
||||
$sliderID = $my_data['slider_id'];
|
||||
|
||||
if(strpos($slide_id, 'static_') !== false){
|
||||
$my_data['slideid'] = $slide_id;
|
||||
|
||||
add_filter('revslider_enable_static_layers', array('rs_backup_slide', 'disable_static_slide_for_preview'));
|
||||
|
||||
}else{
|
||||
$my_data['slideid'] = $my_data['slide_id'];
|
||||
}
|
||||
|
||||
$my_data['params'] = (array)json_decode($my_data['params']);
|
||||
$my_data['layers'] = (array)json_decode($my_data['layers']);
|
||||
$my_data['layers'] = RevSliderFunctions::convertStdClassToArray($my_data['layers']);
|
||||
$my_data['settings'] = (array)json_decode($my_data['settings']);
|
||||
|
||||
|
||||
//asort($my_data['layers']);
|
||||
|
||||
$output = new RevSliderOutput();
|
||||
$output->setOneSlideMode($my_data);
|
||||
|
||||
$operations->previewOutput($sliderID,$output);
|
||||
$html = ob_get_contents();
|
||||
|
||||
ob_clean();
|
||||
ob_end_clean();
|
||||
|
||||
//add button to apply the Backup
|
||||
//$html .= '<div >'.__('', 'rs_backup').'</div>';
|
||||
echo $html;
|
||||
exit;
|
||||
//self::ajaxResponseData(array('markup' => $html));
|
||||
break;
|
||||
}
|
||||
|
||||
return $remove_error; // if true, then the script will just exit instead of printing an error
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* disable static layer in preview for static slide
|
||||
* @since: 1.0.0
|
||||
*/
|
||||
public static function disable_static_slide_for_preview($do_static){
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* fetch backup by backup_id
|
||||
* @since: 1.0.0
|
||||
*/
|
||||
public static function fetch_backup($backup_id){
|
||||
global $wpdb;
|
||||
|
||||
$record = $wpdb->get_results($wpdb->prepare("SELECT * FROM ".$wpdb->prefix . 'revslider_backup_slides'." WHERE id = %s", array($backup_id)), ARRAY_A);
|
||||
|
||||
if(!empty($record)) $record = $record[0];
|
||||
|
||||
return $record;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* restore slide backup
|
||||
* @since: 1.0.0
|
||||
*/
|
||||
public static function restore_slide_backup($backup_id, $slide_id, $session_id, $slide = false){
|
||||
global $wpdb;
|
||||
|
||||
$backup = self::fetch_backup($backup_id);
|
||||
|
||||
if($slide == false){
|
||||
$slide = new RevSliderSlide();
|
||||
}
|
||||
|
||||
$current = $slide->getDataByID($slide_id);
|
||||
|
||||
//update the current
|
||||
if(!empty($backup) && !empty($current)){
|
||||
|
||||
//self::add_new_backup($current, $session_id);
|
||||
|
||||
$current['params'] = $backup['params'];
|
||||
$current['layers'] = $backup['layers'];
|
||||
$current['settings'] = $backup['settings'];
|
||||
$update_id = $current['id'];
|
||||
unset($current['id']);
|
||||
|
||||
if(strpos($slide_id, 'static_') !== false){
|
||||
$return = $wpdb->update(RevSliderGlobals::$table_static_slides, $current, array('id' => $update_id));
|
||||
}else{
|
||||
$return = $wpdb->update(RevSliderGlobals::$table_slides, $current, array('id' => $update_id));
|
||||
}
|
||||
//now change the backup date to current date, to set it to the last version
|
||||
$backup['created'] = date('Y-m-d H:i:s');
|
||||
$update_id = $backup['id'];
|
||||
unset($backup['id']);
|
||||
|
||||
$return1 = $wpdb->update($wpdb->prefix . 'revslider_backup_slides', $backup, array('id' => $update_id));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* fetch all slide revisions by slide_id
|
||||
* @since: 1.0.0
|
||||
*/
|
||||
public static function fetch_slide_backups($slide_id, $basic = false){
|
||||
global $wpdb;
|
||||
|
||||
if(strpos($slide_id, 'static_') !== false){
|
||||
$slide = new RevSliderSlide();
|
||||
$slide_id = $slide->getStaticSlideID(str_replace('static_', '', $slide_id));
|
||||
$where = array($slide_id);
|
||||
$where[] = 'true';
|
||||
}else{
|
||||
$where = array($slide_id);
|
||||
$where[] = 'false';
|
||||
}
|
||||
|
||||
if($basic){
|
||||
$record = $wpdb->get_results($wpdb->prepare("SELECT `id`, `slide_id`, `slider_id`, `created` FROM ".$wpdb->prefix . 'revslider_backup_slides'." WHERE slide_id = %s AND static = %s ORDER BY `created` ASC", $where),ARRAY_A);
|
||||
if(!empty($record)){
|
||||
foreach($record as $k => $rec){
|
||||
$record[$k]['created'] = RevSliderFunctionsWP::convertPostDate($rec['created'], true);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
$record = $wpdb->get_results($wpdb->prepare("SELECT * FROM ".$wpdb->prefix . "revslider_backup_slides WHERE slide_id = %s AND static = %s", $where), ARRAY_A);
|
||||
}
|
||||
|
||||
return $record;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* check if a new backup should be created
|
||||
* @since: 1.0.0
|
||||
*/
|
||||
public static function check_add_new_backup($slide_data, $ajax_data, $slide_class){
|
||||
|
||||
global $wpdb;
|
||||
|
||||
$record = $wpdb->get_results($wpdb->prepare("SELECT * FROM ".RevSliderGlobals::$table_slides." WHERE id = %s", array($slide_class->getID())), ARRAY_A);
|
||||
|
||||
if(!empty($record)){
|
||||
self::add_new_backup($record[0], esc_attr($ajax_data['session_id']));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* check if a new backup should be created
|
||||
* @since: 1.0.0
|
||||
*/
|
||||
public static function check_add_new_backup_static($slide_data, $ajax_data, $slide_class){
|
||||
|
||||
global $wpdb;
|
||||
|
||||
$record = $wpdb->get_results($wpdb->prepare("SELECT * FROM ".RevSliderGlobals::$table_static_slides." WHERE id = %s", array($slide_class->getID())), ARRAY_A);
|
||||
|
||||
if(!empty($record)){
|
||||
self::add_new_backup($record[0], esc_attr($ajax_data['session_id']), 'true');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* add new slide backup
|
||||
* @since: 1.0.0
|
||||
*/
|
||||
public static function add_new_backup($slide, $session_id, $static = 'false'){
|
||||
global $wpdb;
|
||||
|
||||
$slide['slide_id'] = $slide['id'];
|
||||
unset($slide['id']);
|
||||
|
||||
$slide['created'] = date('Y-m-d H:i:s');
|
||||
$slide['session'] = $session_id;
|
||||
$slide['static'] = $static;
|
||||
|
||||
//check if session_id exists, if yes then update
|
||||
$row = $wpdb->get_results($wpdb->prepare("SELECT id FROM ".$wpdb->prefix . "revslider_backup_slides WHERE session = %s AND slide_id = %s", array($session_id, $slide['slide_id'])), ARRAY_A);
|
||||
if(!empty($row) && isset($row[0]) && !empty($row[0])){
|
||||
$wpdb->update($wpdb->prefix . "revslider_backup_slides", $slide, array('id' => $row[0]['id']));
|
||||
}else{
|
||||
$wpdb->insert($wpdb->prefix . "revslider_backup_slides", $slide);
|
||||
}
|
||||
|
||||
$cur = self::check_backup_num($slide['slide_id']);
|
||||
|
||||
if($cur > 11){
|
||||
$early = self::get_oldest_backup($slide['slide_id']);
|
||||
|
||||
if($early !== false){
|
||||
self::delete_backup($early['id']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* delete a backup of a slide
|
||||
* @since: 1.0.0
|
||||
*/
|
||||
public static function delete_backup($id){
|
||||
global $wpdb;
|
||||
|
||||
$wpdb->query($wpdb->prepare("DELETE FROM ".$wpdb->prefix . "revslider_backup_slides WHERE id = %s", array($id)));
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* delete all backup of a slide
|
||||
* @since: 1.0.0
|
||||
*/
|
||||
public static function delete_backup_full($id){
|
||||
global $wpdb;
|
||||
|
||||
$wpdb->query($wpdb->prepare("DELETE FROM ".$wpdb->prefix . "revslider_backup_slides WHERE slide_id = %s", array($id)));
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* delete all backup of a slide
|
||||
* @since: 1.0.0
|
||||
*/
|
||||
public static function delete_backup_full_slider($id){
|
||||
global $wpdb;
|
||||
|
||||
$wpdb->query($wpdb->prepare("DELETE FROM ".$wpdb->prefix . "revslider_backup_slides WHERE slider_id = %s", array($id)));
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* get all slide backups by slide ID
|
||||
* @since: 1.0.0
|
||||
**/
|
||||
public static function get_slide_backup($slide_id, $static = 'false'){
|
||||
|
||||
global $wpdb;
|
||||
|
||||
$slides = $wpdb->get_results($wpdb->prepare("SELECT `id`, `slide_id`, `slide_order`, `params`, `layers`, `settings`, `created` FROM ".$wpdb->prefix."revslider_backup_slides WHERE slide_id = %s AND static = %s ORDER BY id ASC", array($slide_id, $static)), ARRAY_A);
|
||||
if(!empty($slides)){
|
||||
return $slides[0];
|
||||
}else{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* get oldest backup of a slide
|
||||
* @since: 1.0.0
|
||||
*/
|
||||
public static function get_oldest_backup($slide_id){
|
||||
global $wpdb;
|
||||
|
||||
$early = $wpdb->get_results($wpdb->prepare("SELECT id FROM ".$wpdb->prefix . "revslider_backup_slides WHERE slide_id = %s ORDER BY `created` ASC LIMIT 0,1", array($slide_id)), ARRAY_A);
|
||||
if(!empty($early)){
|
||||
return $early[0];
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* check for the number of backups for a slide
|
||||
* @since: 1.0.0
|
||||
*/
|
||||
public static function check_backup_num($slide_id){
|
||||
global $wpdb;
|
||||
|
||||
$cur = $wpdb->get_results($wpdb->prepare("SELECT COUNT(*) AS `row` FROM ".$wpdb->prefix . "revslider_backup_slides WHERE slide_id = %s GROUP BY `slide_id`", array($slide_id)), ARRAY_A);
|
||||
|
||||
if(!empty($cur)){
|
||||
return $cur[0]['row'];
|
||||
}else{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create/Update Database Tables
|
||||
*/
|
||||
public static function create_tables($networkwide = false){
|
||||
global $wpdb;
|
||||
|
||||
if(function_exists('is_multisite') && is_multisite() && $networkwide){ //do for each existing site
|
||||
|
||||
$old_blog = $wpdb->blogid;
|
||||
|
||||
// Get all blog ids and create tables
|
||||
$blogids = $wpdb->get_col("SELECT blog_id FROM ".$wpdb->blogs);
|
||||
|
||||
foreach($blogids as $blog_id){
|
||||
switch_to_blog($blog_id);
|
||||
self::_create_tables();
|
||||
}
|
||||
|
||||
switch_to_blog($old_blog); //go back to correct blog
|
||||
|
||||
}else{ //no multisite, do normal installation
|
||||
|
||||
self::_create_tables();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create Tables, edited for multisite
|
||||
* @since 1.5.0
|
||||
*/
|
||||
public static function _create_tables(){
|
||||
|
||||
global $wpdb;
|
||||
|
||||
//Create/Update Grids Database
|
||||
$grid_ver = get_option("revslider_backup_table_version", '0.99');
|
||||
|
||||
if(version_compare($grid_ver, '1', '<')){
|
||||
|
||||
//require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
|
||||
|
||||
$table_name = $wpdb->prefix . 'revslider_backup_slides';
|
||||
$sql = "CREATE TABLE " .$table_name ." (
|
||||
id int(9) NOT NULL AUTO_INCREMENT,
|
||||
slide_id int(9) NOT NULL,
|
||||
slider_id int(9) NOT NULL,
|
||||
slide_order int not NULL,
|
||||
params LONGTEXT NOT NULL,
|
||||
layers LONGTEXT NOT NULL,
|
||||
settings TEXT NOT NULL,
|
||||
created DATETIME NOT NULL,
|
||||
session VARCHAR(100) NOT NULL,
|
||||
static VARCHAR(20) NOT NULL,
|
||||
UNIQUE KEY id (id)
|
||||
);";
|
||||
|
||||
dbDelta($sql);
|
||||
|
||||
update_option('revslider_backup_table_version', '1');
|
||||
|
||||
$grid_ver = '1';
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,225 @@
|
||||
<?php
|
||||
/**
|
||||
* @author ThemePunch <info@themepunch.com>
|
||||
* @link http://www.themepunch.com/
|
||||
* @copyright 2016 ThemePunch
|
||||
*/
|
||||
|
||||
if( !defined( 'ABSPATH') ) exit();
|
||||
|
||||
class rs_backup_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-backup-addon/revslider-backup-addon.php';
|
||||
private $plugin_slug = 'revslider-backup-addon';
|
||||
private $plugin_path = 'revslider-backup-addon/revslider-backup-addon.php';
|
||||
private $version;
|
||||
private $plugins;
|
||||
private $option;
|
||||
|
||||
|
||||
public function __construct($version) {
|
||||
$this->option = $this->plugin_slug . '_update_info';
|
||||
$this->_retrieve_version_info();
|
||||
$this->version = $version;
|
||||
}
|
||||
|
||||
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_backup-update-check');
|
||||
|
||||
|
||||
if($last_check == false){ //first time called
|
||||
$last_check = time();
|
||||
update_option('rs_backup-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_backup-update-check', time());
|
||||
|
||||
$this->data->checked = time();
|
||||
$this->data->basic = $data->basic;
|
||||
$this->data->full = $data->full;
|
||||
|
||||
//update_option('rs_backup-stable-version', $data->full->stable);
|
||||
update_option('rs_backup-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_backup-valid', 'false');
|
||||
$purchase = (get_option('revslider-valid', 'false') == 'true') ? get_option('revslider-code', '') : '';
|
||||
$rattr = array(
|
||||
'code' => urlencode($purchase),
|
||||
'version' => urlencode(RS_BACKUP_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_backup-update-check-short');
|
||||
if($last_check == false){ //first time called
|
||||
$last_check = time();
|
||||
update_option('rs_backup-update-check-short', $last_check);
|
||||
}
|
||||
|
||||
// Check for updates
|
||||
if(time() - $last_check > 172800 || $force_check == true){
|
||||
|
||||
|
||||
update_option('rs_backup-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-backup-addon'),
|
||||
'version' => urlencode(RS_BACKUP_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_backup-connection', false);
|
||||
return false;
|
||||
}else{
|
||||
update_option('rs_backup-connection', true);
|
||||
}
|
||||
|
||||
/*
|
||||
$version_info = json_decode($version_info);
|
||||
if(isset($version_info->version)){
|
||||
update_option('rs_backup-latest-version', $version_info->version);
|
||||
}
|
||||
|
||||
if(isset($version_info->notices)){
|
||||
update_option('rs_backup-notices', $version_info->notices);
|
||||
}
|
||||
|
||||
if(isset($version_info->dashboard)){
|
||||
update_option('rs_backup-dashboard', $version_info->dashboard);
|
||||
}
|
||||
|
||||
if(isset($version_info->deactivated) && $version_info->deactivated === true){
|
||||
if(get_option('rs_backup-valid', 'false') == 'true'){
|
||||
//remove validation, add notice
|
||||
update_option('rs_backup-valid', 'false');
|
||||
update_option('rs_backup-deact-notice', true);
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
if($force_check == true){ //force that the update will be directly searched
|
||||
update_option('rs_backup-update-check', '');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* Provide a admin area view for the plugin
|
||||
*
|
||||
* This file is used to markup the admin-facing aspects of the plugin.
|
||||
*
|
||||
* @link http://www.themepunch.com
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @package Slider Revolution Backup Add-on
|
||||
*/
|
||||
|
||||
if( !defined( 'ABSPATH') ) exit();
|
||||
?>
|
||||
<div id="rev_addon_backup_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 Backups', 'rs_backup'); ?></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">
|
||||
|
||||
<!-- Start Settings -->
|
||||
<h3 class="tp-steps wb"><span>1</span> <?php _e('"Add-ons" Tab','rs_backup'); ?></h3>
|
||||
<img src="<?php echo RS_BACKUP_PLUGIN_URL . "admin/assets/images/tutorial1.png"; ?>">
|
||||
<div class="wb-featuretext"><?php _e('Right after installing the Backup add-on, you are ready for action!','rs_backup'); ?></div>
|
||||
|
||||
<h3 class="tp-steps wb"><span>2</span> <?php _e('Select "Backups"','rs_backup'); ?></h3>
|
||||
<img src="<?php echo RS_BACKUP_PLUGIN_URL . "admin/assets/images/tutorial2.png"; ?>">
|
||||
<div class="wb-featuretext"><?php _e('Click on the Backups button to reveal the "Show available Backups for this Slide" button.','rs_backup'); ?></div>
|
||||
|
||||
<h3 class="tp-steps wb"><span>3</span> <?php _e('Backups List','rs_backup'); ?></h3>
|
||||
<img src="<?php echo RS_BACKUP_PLUGIN_URL . "admin/assets/images/tutorial3.png"; ?>">
|
||||
<div class="wb-featuretext"><?php _e('Preview or load directly the desired backup from a rotating list of 11 backups.','rs_backup'); ?></div>
|
||||
|
||||
<h3 class="tp-steps wb"><span>4</span> <?php _e('Preview Backup','rs_backup'); ?></h3>
|
||||
<img src="<?php echo RS_BACKUP_PLUGIN_URL . "admin/assets/images/tutorial4.png"; ?>">
|
||||
<div class="wb-featuretext"><?php _e('Preview the slide backup with the possibility to load it.','rs_backup'); ?></div>
|
||||
|
||||
<!-- End Settings -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,114 @@
|
||||
<?php
|
||||
/**
|
||||
* @author ThemePunch <info@themepunch.com>
|
||||
* @link http://www.themepunch.com/
|
||||
* @copyright 2016 ThemePunch
|
||||
*/
|
||||
|
||||
if( !defined( 'ABSPATH') ) exit();
|
||||
|
||||
class rs_backup_base {
|
||||
|
||||
public function __construct(){
|
||||
try{
|
||||
if(class_exists('RevSliderFront')){ //check if Slider Revolution is installed
|
||||
if(version_compare(RevSliderGlobals::SLIDER_REVISION, '5.2.0', '>=')){
|
||||
if(get_option('revslider-valid', 'false') == 'true'){
|
||||
|
||||
self::load_plugin_textdomain();
|
||||
|
||||
if(is_admin()){
|
||||
|
||||
require_once(RS_BACKUP_PLUGIN_PATH.'admin/includes/slide.class.php');
|
||||
|
||||
rs_backup_slide::init_backup();
|
||||
|
||||
//Updates
|
||||
require_once(RS_BACKUP_PLUGIN_PATH.'admin/includes/update.class.php');
|
||||
$update_admin = new rs_backup_update(RS_BACKUP_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 );
|
||||
|
||||
//Dashboard Slideout
|
||||
add_filter('rev_addon_dash_slideouts',array('rs_backup_base','display_plugin_admin_page'));
|
||||
add_action('admin_enqueue_scripts', array('rs_backup_base', 'enqueue_dash_scripts'));
|
||||
add_action('admin_enqueue_scripts', array('rs_backup_base', 'enqueue_dash_style'));
|
||||
}
|
||||
}else{
|
||||
add_action('admin_notices', array('rs_backup_base', 'add_notice_activation'));
|
||||
//add notification that slider revolution needs to be activated
|
||||
}
|
||||
}else{
|
||||
add_action('admin_notices', array('rs_backup_base', 'add_notice_version'));
|
||||
//add notification that plugin version of Slider Revolution has to be at least version 5.2.0
|
||||
}
|
||||
}else{
|
||||
add_action('admin_notices', array('rs_backup_base', 'add_notice_plugin'));
|
||||
//add notification that plugin Slider Revolution has to be installed
|
||||
}
|
||||
}catch(Exception $e){
|
||||
$message = $e->getMessage();
|
||||
$trace = $e->getTraceAsString();
|
||||
echo _e("Slider Revolution Backup Add-On:",'rs_backup')." <b>".$message."</b>";
|
||||
}
|
||||
}
|
||||
|
||||
public static function add_notice_plugin(){
|
||||
?>
|
||||
<div class="error below-h2 wb-notice-wrap" id="message"><p><?php _e('To use Slider Revolution Backup Add-on, please install Slider Revolution for WordPress', 'rs_backup'); ?></p></div>
|
||||
<?php
|
||||
}
|
||||
|
||||
|
||||
public static function add_notice_version(){
|
||||
?>
|
||||
<div class="error below-h2 wb-notice-wrap" id="message"><p><?php _e('To use Slider Revolution Backup Add-on, please update Slider Revolution for WordPress to version 5.2.0 or later', 'rs_backup'); ?></p></div>
|
||||
<?php
|
||||
}
|
||||
|
||||
|
||||
public static function add_notice_activation(){
|
||||
?>
|
||||
<div class="error below-h2 wb-notice-wrap" id="message"><p><?php _e('To use Slider Revolution Backup Add-on, please activate Slider Revolution for WordPress', 'rs_backup'); ?></p></div>
|
||||
<?php
|
||||
}
|
||||
|
||||
public static function load_plugin_textdomain(){
|
||||
load_plugin_textdomain('rs_backup', false, RS_BACKUP_PLUGIN_PATH . 'languages/');
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the settings page for this plugin.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public static function display_plugin_admin_page() {
|
||||
include_once( RS_BACKUP_PLUGIN_PATH . 'admin/views/admin-display.php' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the JavaScript for the admin area.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public static function enqueue_dash_scripts() {
|
||||
if(isset($_GET["page"]) && $_GET["page"]=="rev_addon"){
|
||||
wp_enqueue_script( "rs_backup_dash", RS_BACKUP_PLUGIN_URL . 'admin/assets/js/backup_dash-admin.js', array( 'jquery' ), RS_BACKUP_VERSION, false );
|
||||
wp_localize_script( 'rs_backup', 'rs_backup', array(
|
||||
'ajax_url' => admin_url( 'admin-ajax.php' )
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the CSS for the admin area.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public static function enqueue_dash_style() {
|
||||
if(isset($_GET["page"]) && $_GET["page"]=="rev_addon"){
|
||||
wp_enqueue_style( "rs_backup_dash", RS_BACKUP_PLUGIN_URL . 'admin/assets/css/backup-dash-admin.css', array() , RS_BACKUP_VERSION );
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,20 @@
|
||||
<div class="slider-revolution-update-list">
|
||||
<h3 class="version-number">Version 1.0.1 (18th March 2016)</h3>
|
||||
<div class="change"><strong style="font-weight:700">CHANGES</strong></div>
|
||||
<ul>
|
||||
<li>Added transient to the update checks for less server calls</li>
|
||||
</ul>
|
||||
|
||||
<h3 class="version-number">Version 1.0.0 (19th January 2016)</h3>
|
||||
<div class="newfeature"><strong style="font-weight:700">NEW FEATURES</strong></div>
|
||||
<ul>
|
||||
</ul>
|
||||
|
||||
<div class="change"><strong style="font-weight:700">CHANGES</strong></div>
|
||||
<ul>
|
||||
</ul>
|
||||
|
||||
<div class="bugfix"><strong style="font-weight:700">BUGFIXES</strong></div>
|
||||
<ul>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/*
|
||||
Plugin Name: Slider Revolution Backup Add-on
|
||||
Plugin URI: http://www.themepunch.com/
|
||||
Description: Make Backups Revisions for your safety
|
||||
Author: ThemePunch
|
||||
Version: 1.0.1
|
||||
Author URI: http://themepunch.com
|
||||
*/
|
||||
|
||||
// If this file is called directly, abort.
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
define( 'RS_BACKUP_PLUGIN_URL', str_replace('index.php','',plugins_url( 'index.php', __FILE__ )));
|
||||
define( 'RS_BACKUP_PLUGIN_PATH', plugin_dir_path(__FILE__) );
|
||||
define( 'RS_BACKUP_FILE_PATH', __FILE__ );
|
||||
define( 'RS_BACKUP_VERSION', '1.0.1');
|
||||
|
||||
|
||||
require_once(RS_BACKUP_PLUGIN_PATH.'includes/base.class.php');
|
||||
|
||||
add_action('plugins_loaded', 'rs_backup_init');
|
||||
|
||||
function rs_backup_init(){
|
||||
$wb_base = new rs_backup_base();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Register hooks that are fired when the plugin is activated or deactivated.
|
||||
* When the plugin is deleted, the uninstall.php file is loaded.
|
||||
*/
|
||||
register_activation_hook( __FILE__, array('rs_backup_slide', 'create_tables' ));
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
if( !defined( 'ABSPATH') && !defined('WP_UNINSTALL_PLUGIN') )
|
||||
exit();
|
||||
|
||||
delete_option('revslider_backup_table_version');
|
||||
?>
|
||||
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* @author ThemePunch <info@themepunch.com>
|
||||
* @link http://www.themepunch.com/
|
||||
* @copyright 2017 ThemePunch
|
||||
*/
|
||||
|
||||
#rev_addon_beforeafter_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_beforeafter_settings_slideout h3 {
|
||||
|
||||
font-size: 17px;
|
||||
text-align: center;
|
||||
|
||||
}
|
||||
|
||||
#rev_addon_beforeafter_settings_slideout .featuretext {
|
||||
|
||||
margin-top: 10px;
|
||||
|
||||
}
|
||||
|
||||
#rev_addon_beforeafter_settings_slideout .documentation {
|
||||
|
||||
text-align: center;
|
||||
margin-bottom: 20px;
|
||||
|
||||
}
|
||||
|
||||
#rev_addon_beforeafter_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_beforeafter_settings_slideout .documentation a:hover {
|
||||
|
||||
opacity: 0.75;
|
||||
|
||||
}
|
||||
|
||||
#rev_addon_beforeafter_settings_slideout img {
|
||||
|
||||
box-shadow: 0 0 0 5px #FFF;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,567 @@
|
||||
/*
|
||||
* @author ThemePunch <info@themepunch.com>
|
||||
* @link http://www.themepunch.com/
|
||||
* @copyright 2017 ThemePunch
|
||||
*/
|
||||
|
||||
#rs-addon-trigger-beforeafter,
|
||||
#rs-addon-settings-trigger-beforeafter {
|
||||
|
||||
border-radius: 0px;
|
||||
padding: 0px;
|
||||
color: transparent;
|
||||
background: url(../images/addon_beforeafter.png);
|
||||
background-size: 194px 54px;
|
||||
background-position: top center;
|
||||
width: 194px;
|
||||
height: 27px;
|
||||
|
||||
}
|
||||
|
||||
#rs-addon-settings-trigger-beforeafter.selected,
|
||||
#rs-addon-settings-trigger-beforeafter:hover,
|
||||
#rs-addon-trigger-beforeafter.selected,
|
||||
#rs-addon-trigger-beforeafter:hover {
|
||||
|
||||
background-position: bottom center;
|
||||
|
||||
}
|
||||
|
||||
.before-after-enabled li[data-content="#mainbg-sub-source"]:after,
|
||||
.before-after-enabled li[data-content="#mainbg-sub-setting"]:after {
|
||||
|
||||
content: ' "Before"';
|
||||
|
||||
}
|
||||
|
||||
body:not(.before-after-enabled) #rs-addon-trigger-beforeafter:after {
|
||||
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
content: "";
|
||||
z-index: 99;
|
||||
background-color: rgba(255, 255, 255, 0.5);
|
||||
|
||||
}
|
||||
|
||||
#beforeafter-addon-settings-wrap {
|
||||
|
||||
padding: 15px;
|
||||
|
||||
}
|
||||
|
||||
.before-after-enabled #quick-layer-selector-container,
|
||||
.before-after-enabled .current-active-main-toolbar {
|
||||
|
||||
width: auto !important;
|
||||
|
||||
}
|
||||
|
||||
.before-after-enabled #quick-layer-selector-container {
|
||||
|
||||
padding-right: 10px;
|
||||
|
||||
}
|
||||
|
||||
.before-after-enabled #rs-edit-layers-on-btn {
|
||||
|
||||
margin-left: 308px;
|
||||
|
||||
}
|
||||
|
||||
.before-after-enabled #rs-set-style-on-devices {
|
||||
|
||||
margin-left: 445px;
|
||||
|
||||
}
|
||||
|
||||
.before-after-enabled #quick-layers .ps-scrollbar-y-rail {
|
||||
|
||||
left: 0 !important;
|
||||
|
||||
}
|
||||
|
||||
.beforeafter-visibility {
|
||||
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
cursor: pointer;
|
||||
border-radius: 50%;
|
||||
margin: 10px 0 0 15px;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
display: none;
|
||||
|
||||
}
|
||||
|
||||
.before-after-enabled .beforeafter-visibility {
|
||||
|
||||
display: inline-block;
|
||||
|
||||
}
|
||||
|
||||
#beforeafter-visibility-before {
|
||||
|
||||
margin-left: 15px;
|
||||
background-color: #e74c3c;
|
||||
|
||||
}
|
||||
|
||||
#beforeafter-visibility-after {
|
||||
|
||||
margin-left: 7px;
|
||||
background-color: #2ecc71;
|
||||
}
|
||||
|
||||
#beforeafter-visibility-all {
|
||||
|
||||
margin-left: 7px;
|
||||
background-color: #f1c40f;
|
||||
|
||||
}
|
||||
|
||||
#beforeafter-visibility-all.selected {
|
||||
|
||||
border-color: #f1c40f;
|
||||
|
||||
}
|
||||
|
||||
#beforeafter-visibility-before.selected {
|
||||
|
||||
border-color: #e74c3c;
|
||||
|
||||
}
|
||||
|
||||
#beforeafter-visibility-after.selected {
|
||||
|
||||
border-color: #2ecc71;
|
||||
|
||||
}
|
||||
|
||||
.quicksortlayer.beforeafter-after:before {
|
||||
|
||||
background-color: #2ecc71;
|
||||
|
||||
}
|
||||
|
||||
#beforeafter-addon-wrap input[type="text"] {
|
||||
|
||||
width: 55px !important;
|
||||
min-width: 55px;
|
||||
|
||||
}
|
||||
|
||||
#beforeafter-addon-wrap .rs-layer-toolbar-box > span {
|
||||
|
||||
margin-left: 15px;
|
||||
|
||||
}
|
||||
|
||||
#beforeafter-addon-wrap .rs-layer-toolbar-box > span:first-child {
|
||||
|
||||
margin-left: 0;
|
||||
|
||||
}
|
||||
|
||||
.before-after-section {
|
||||
|
||||
min-height: 30px;
|
||||
|
||||
}
|
||||
|
||||
.before-after-row {
|
||||
|
||||
border-top: 1px solid #ddd;
|
||||
|
||||
}
|
||||
|
||||
.before-after-vertical > * {
|
||||
|
||||
position: relative;
|
||||
top: 1px;
|
||||
|
||||
}
|
||||
|
||||
#beforeafter-addon-wrap .rs-layer-toolbar-box {
|
||||
|
||||
vertical-align: top;
|
||||
height: 30px;
|
||||
|
||||
}
|
||||
|
||||
#beforeafter-layer-settings {
|
||||
|
||||
overflow: hidden;
|
||||
|
||||
}
|
||||
|
||||
.beforeafter-device-desktop {
|
||||
|
||||
background-image: url(../images/icon-mode-desktop-dark.png);
|
||||
background-size: 18px 18px;
|
||||
min-width: 18px;
|
||||
|
||||
}
|
||||
|
||||
.beforeafter-device-notebook {
|
||||
|
||||
background-image: url(../images/icon-mode-laptop-dark.png);
|
||||
background-size: 20px 16px;
|
||||
min-width: 18px;
|
||||
|
||||
}
|
||||
|
||||
.beforeafter-device-tablet {
|
||||
|
||||
background-image: url(../images/icon-mode-tablet-dark.png);
|
||||
background-size: 17px 20px;
|
||||
min-width: 17px;
|
||||
|
||||
}
|
||||
|
||||
.beforeafter-device-phone {
|
||||
|
||||
background-image: url(../images/icon-mode-phone-dark.png);
|
||||
background-size: 12px 20px;
|
||||
min-width: 12px;
|
||||
|
||||
}
|
||||
|
||||
#beforeafter-addon-wrap .inp-deep-list {
|
||||
|
||||
width: auto;
|
||||
white-space: nowrap;
|
||||
|
||||
}
|
||||
|
||||
#beforeafter-addon-wrap .fa-icon-arrows {
|
||||
|
||||
font-size: 16px;
|
||||
position: relative;
|
||||
top: 5px;
|
||||
|
||||
}
|
||||
|
||||
#beforeafter-addon-wrap select {
|
||||
|
||||
min-height: 26px;
|
||||
|
||||
}
|
||||
|
||||
.beforeafter-icon {
|
||||
|
||||
margin-right: 6px;
|
||||
font-size: 20px;
|
||||
line-height: 26px;
|
||||
|
||||
}
|
||||
|
||||
.beforeafter {
|
||||
|
||||
position: relative;
|
||||
|
||||
}
|
||||
|
||||
.quicksortlayer.beforeafter:before {
|
||||
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
left: -15px;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
content: "";
|
||||
border-radius: 50%;
|
||||
background-color: #e74c3c;
|
||||
visibility: hidden;
|
||||
|
||||
}
|
||||
|
||||
.quicksortlayer.beforeafter-after:before {
|
||||
|
||||
background-color: #2ecc71;
|
||||
|
||||
}
|
||||
|
||||
.mastertimer-timeline-zindex-row.beforeafter:before {
|
||||
|
||||
position: absolute;
|
||||
top: 1px;
|
||||
left: -5px;
|
||||
width: 0;
|
||||
height: 0;
|
||||
content: "";
|
||||
border-left: 7px solid transparent;
|
||||
border-right: 7px solid transparent;
|
||||
border-bottom: 7px solid #e74c3c;
|
||||
transform: rotate(-45deg);
|
||||
visibility: hidden;
|
||||
|
||||
}
|
||||
|
||||
.mastertimer-timeline-zindex-row.beforeafter-after:before {
|
||||
|
||||
border-bottom-color: #2ecc71;
|
||||
|
||||
}
|
||||
|
||||
.before-after-enabled .mastertimer-timeline-zindex-row.beforeafter:before,
|
||||
.before-after-enabled .quicksortlayer.beforeafter:before {
|
||||
|
||||
visibility: visible;
|
||||
|
||||
}
|
||||
|
||||
body:not(.before-after-enabled) #rs-addon-trigger-beforeafter-settings {
|
||||
|
||||
display: none !important;
|
||||
|
||||
}
|
||||
|
||||
body:not(.before-after-enabled) #rs-addon-trigger-beforeafter {
|
||||
|
||||
background-position: top center !important;
|
||||
pointer-events: none;
|
||||
|
||||
}
|
||||
|
||||
.beforeafter-bgsource-menu {
|
||||
|
||||
display: inline-block !important;
|
||||
|
||||
}
|
||||
|
||||
body:not(.before-after-enabled) .beforeafter-bgsource-menu {
|
||||
|
||||
display: none !important;
|
||||
|
||||
}
|
||||
|
||||
#beforeafter-source-settings.hide-beforeafter-itm {
|
||||
|
||||
display: none !important;
|
||||
|
||||
}
|
||||
|
||||
#mainbg-sub-source-after i {
|
||||
|
||||
margin-right: 10px;
|
||||
|
||||
}
|
||||
|
||||
#button_change_image_beforeafter,
|
||||
#button_change_image_objlib_beforeafter,
|
||||
.before-after-enabled .vidsrcchanger-div a {
|
||||
|
||||
vertical-align: top;
|
||||
|
||||
}
|
||||
|
||||
#tp-bgcolorsrc_beforeafter {
|
||||
|
||||
display: inline-block;
|
||||
margin-left: 20px;
|
||||
line-height: 30px;
|
||||
position: relative;
|
||||
z-index: 3100;
|
||||
|
||||
}
|
||||
|
||||
#tp-bgcolorsrc_beforeafter .rev-colorpickerspan {
|
||||
|
||||
line-height: 30px;
|
||||
vertical-align: middle;
|
||||
|
||||
}
|
||||
|
||||
.beforeafter-bg-preview {
|
||||
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
clip: rect(0, 160px, 84px, 80px);
|
||||
background-position: top left !important;
|
||||
display: block;
|
||||
|
||||
}
|
||||
|
||||
body:not(.before-after-enabled) #beforeafter-bg-preview {
|
||||
|
||||
display: none;
|
||||
|
||||
}
|
||||
|
||||
.before-after-enabled .mini-transparent {
|
||||
|
||||
background-position: top left !important;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
.before-after-preview .slide-media-container {
|
||||
|
||||
clip-path: inset(0% 50% 0% 0%);
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
body:not(.before-after-enabled) .before-after-preview .beforeafter-default-img {
|
||||
|
||||
clip-path: none;
|
||||
|
||||
}
|
||||
|
||||
.beforeafter-bg-preview.beforeafter-image {
|
||||
|
||||
background-size: cover !important;
|
||||
|
||||
}
|
||||
|
||||
.beforeafter-bg-preview.beforeafter-video {
|
||||
|
||||
background: transparent;
|
||||
|
||||
}
|
||||
|
||||
.beforeafter-bg-preview.beforeafter-transparent {
|
||||
|
||||
background: url(../images/trans_tile.png);
|
||||
|
||||
}
|
||||
|
||||
#beforeafter-editor-bg {
|
||||
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 2;
|
||||
display: none;
|
||||
|
||||
}
|
||||
|
||||
#mainbg-sub-source-after,
|
||||
#mainbg-sub-setting-after {
|
||||
|
||||
margin-top: 10px;
|
||||
|
||||
}
|
||||
|
||||
#mainbg-sub-source-after .bg-settings-block,
|
||||
#mainbg-sub-setting-after .bg-settings-block {
|
||||
|
||||
display: block;
|
||||
|
||||
}
|
||||
|
||||
#mainbg-sub-setting-after {
|
||||
|
||||
display: none;
|
||||
|
||||
}
|
||||
|
||||
.bgsrcchanger-div-beforeafter {
|
||||
|
||||
display: none;
|
||||
margin-left: 20px;
|
||||
|
||||
}
|
||||
|
||||
.beforeafter-small-input {
|
||||
|
||||
min-width: 54px !important;
|
||||
width: 60px !important;
|
||||
margin-right: 10px !important;
|
||||
|
||||
}
|
||||
|
||||
.before-after-enabled #ken_burn_example_wrapper:after {
|
||||
|
||||
position: absolute;
|
||||
left: 127px;
|
||||
top: -28px;
|
||||
font-size: 13px;
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
color: #c0392b;
|
||||
white-space: nowrap;
|
||||
content: 'NOTICE: Ken Burns will only be applied to the "Before" source';
|
||||
|
||||
}
|
||||
|
||||
#tp-bghtml5src_beforeafter,
|
||||
#beforeafter-bounce-options,
|
||||
#beforeafter-shift-options {
|
||||
|
||||
margin-left: 20px;
|
||||
|
||||
}
|
||||
|
||||
#tp-bghtml5src_beforeafter label {
|
||||
|
||||
min-width: 180px;
|
||||
|
||||
}
|
||||
|
||||
.button_change_video_beforeafter {
|
||||
|
||||
margin-left: 20px !important;
|
||||
vertical-align: top;
|
||||
|
||||
}
|
||||
|
||||
#mainbg-sub-setting-after .description {
|
||||
|
||||
margin-left: 20px;
|
||||
|
||||
}
|
||||
|
||||
#the_image_source_url_beforeafter {
|
||||
|
||||
line-height: 30px;
|
||||
background: #ddd;
|
||||
padding: 5px 10px;
|
||||
border-radius: 5px;
|
||||
|
||||
}
|
||||
|
||||
.beforeafter-video-param {
|
||||
|
||||
width: 350px !important;
|
||||
|
||||
}
|
||||
|
||||
#viewWrapper #tp-bgyoutubesrc_beforeafter,
|
||||
#viewWrapper #tp-bgvimeosrc_beforeafter {
|
||||
|
||||
-webkit-user-select: text;
|
||||
-khtml-user-select: text;
|
||||
-moz-user-select: text;
|
||||
-ms-user-select: text;
|
||||
user-select: text;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
.before-after-enabled #mainbg-sub-source *:nth-child(n+14) {
|
||||
|
||||
display: none;
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
After Width: | Height: | Size: 46 KiB |
|
After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 79 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 85 B |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 42 KiB |
|
After Width: | Height: | Size: 40 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 57 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 42 KiB |
|
After Width: | Height: | Size: 3.7 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_beforeafter_settings_slideout');
|
||||
scrollable = display.children('.rs-sbs-slideout-inner');
|
||||
win = $(window).on('resize', onResize);
|
||||
|
||||
$('body').on(
|
||||
|
||||
'click',
|
||||
'#rs-dash-addons-slide-out-trigger_revslider-beforeafter-addon',
|
||||
openPanel
|
||||
|
||||
).on('click', '#rev_addon_beforeafter_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);
|
||||
|
||||
|
||||
|
||||
|
||||
32
web/revslider/plugins/revslider-beforeafter-addon/admin/assets/js/beforeafter-slide-admin.min.js
vendored
Normal file
@@ -0,0 +1,134 @@
|
||||
<?php
|
||||
/**
|
||||
* @author ThemePunch <info@themepunch.com>
|
||||
* @link https://www.themepunch.com/
|
||||
* @copyright 2017 ThemePunch
|
||||
*/
|
||||
|
||||
if( !defined( 'ABSPATH') ) exit();
|
||||
|
||||
require_once(RS_BEFOREAFTER_PLUGIN_PATH . 'framework/slide.layers.admin.class.php');
|
||||
|
||||
class RsBeforeAfterSlideLayersAdmin extends RsAddonBeforeAfterSlideLayersAdmin {
|
||||
|
||||
protected static $_Path,
|
||||
$_Title,
|
||||
$_Markup,
|
||||
$_JavaScript;
|
||||
|
||||
public function __construct($_title, $_path) {
|
||||
|
||||
static::$_Title = $_title;
|
||||
static::$_Path = $_path;
|
||||
parent::init();
|
||||
|
||||
}
|
||||
|
||||
protected static function _init($_slider, $_slide) {
|
||||
|
||||
$_def_moveto = $_slider->getParam('beforeafter_def_moveto', '50%|50%|50%|50%');
|
||||
$_moveto = $_slide->getParam('beforeafter_moveto', $_def_moveto);
|
||||
|
||||
$_notebook_view = $_slider->getParam('enable_custom_size_notebook', 'off') === 'on' ? 'inline-block' : 'none';
|
||||
$_tablet_view = $_slider->getParam('enable_custom_size_tablet', 'off') === 'on' ? 'inline-block' : 'none';
|
||||
$_phone_view = $_slider->getParam('enable_custom_size_iphone', 'off') === 'on' ? 'inline-block' : 'none';
|
||||
|
||||
$_viewports = array('Desktop' => 'inline-block', 'Notebook' => $_notebook_view, 'Tablet' => $_tablet_view, 'Phone' => $_phone_view);
|
||||
$_views = array('all', 'before', 'after');
|
||||
$_moves = explode('|', $_moveto);
|
||||
$_textDomain = 'rs_' . static::$_Title;
|
||||
|
||||
$_markup = '<div id="beforeafter-addon-wrap">
|
||||
|
||||
<div id="beforeafter-global-settings" class="before-after-section beforeafter-globals">
|
||||
|
||||
<span class="rs-layer-toolbar-box before-after-vertical" style="border-left: none; min-width:110px">
|
||||
<span>' . __('Global Settings:', $_textDomain) . '</span>
|
||||
</span>
|
||||
|
||||
<span class="rs-layer-toolbar-box before-after-vertical">';
|
||||
|
||||
$_i = 0;
|
||||
foreach($_viewports as $_key => $_val) {
|
||||
|
||||
$_value = isset($_moves[$_i]) ? $_moves[$_i] : '50%';
|
||||
$_markup .= '<span style="display: ' . $_val . '">
|
||||
|
||||
<i class="rs-mini-layer-icon beforeafter-device-' . strtolower($_key) . ' rs-toolbar-icon tipsy_enabled_top" original-title="' . $_key . __(' Reveal Point', $_textDomain) . '"></i>
|
||||
<input
|
||||
|
||||
type="text"
|
||||
id="beforeafter_moveto_' . $_i . '"
|
||||
class="textbox-caption input-deepselects rs-layer-input-field tipsy_enabled_top beforeafter-moveto beforeafter-pos"
|
||||
original-title="' . $_key . __(' Reveal Point', $_textDomain) . '"
|
||||
value="' . $_value . '"
|
||||
data-beforeafter-value="' . $_value . '"
|
||||
data-selects="Custom||25%||50%||75%||100%"
|
||||
data-svalues ="500px||25%||50%||75%||100%"
|
||||
data-icons="wrench||filter||filter||filter||filter"
|
||||
|
||||
/></span>';
|
||||
$_i++;
|
||||
|
||||
}
|
||||
|
||||
$_markup .= '<input id="beforeafter_moveto" type="hidden" name="beforeafter_moveto" data-beforeafter-value="' . $_moveto . '" value="' . $_moveto . '" />
|
||||
</span>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="beforeafter-view-settings" class="before-after-section before-after-row">
|
||||
|
||||
<span class="rs-layer-toolbar-box before-after-vertical" style="border-left: none; min-width:110px">
|
||||
<span>' . __('Admin BG View:', $_textDomain) . '</span>
|
||||
</span>
|
||||
|
||||
<span class="rs-layer-toolbar-box before-after-vertical">
|
||||
|
||||
<i id="beforeafter-view-icon" class="rs-mini-layer-icon fa-icon-adjust rs-toolbar-icon tipsy_enabled_top beforeafter-icon" original-title="' . __('Toggle Before/After Slide BG', $_textDomain) . '"></i>
|
||||
<select value="" id="beforeafter_bg_view" class="rs-layer-input-field tipsy_enabled_top" original-title="' . __('Toggle Before/After Slide BG', $_textDomain) . '">
|
||||
<option value="before"> ' . __('Before', $_textDomain) . '</option>
|
||||
<option value="after"> ' . __('After', $_textDomain) . '</option>
|
||||
</select>
|
||||
|
||||
</span>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="beforeafter-layer-settings" class="before-after-section before-after-row">
|
||||
|
||||
<span class="rs-layer-toolbar-box before-after-vertical" style="border-left: none; min-width:110px">
|
||||
<span>' . __('Layer Settings:', $_textDomain) . '</span>
|
||||
</span>
|
||||
|
||||
<span class="rs-layer-toolbar-box before-after-vertical">
|
||||
|
||||
<i id="beforeafter-icon" class="rs-mini-layer-icon fa-icon-adjust rs-toolbar-icon tipsy_enabled_top beforeafter-icon" original-title="' . __('Before/After Position for the Selected Layer', $_textDomain) . '"></i>
|
||||
<select value="" id="beforeafter_position" name="beforeafter_position" class="rs-layer-input-field tipsy_enabled_top" original-title="' . __('Before/After Position for the Selected Layer', $_textDomain) . '">
|
||||
<option value="before"> ' . __('Before', $_textDomain) . '</option>
|
||||
<option value="after"> ' . __('After', $_textDomain) . '</option>
|
||||
</select>
|
||||
|
||||
</span>
|
||||
|
||||
</div>
|
||||
|
||||
</div>';
|
||||
|
||||
static::$_Markup = $_markup;
|
||||
static::$_JavaScript = '
|
||||
|
||||
var RsAddonBeforeAfter = {
|
||||
|
||||
lang: {
|
||||
"before": "' . __('Show BEFORE Layers', $_textDomain) . '",
|
||||
"after": "' . __('Show AFTER Layers', $_textDomain) . '",
|
||||
"all": "' . __('Show ALL Layers', $_textDomain) . '"
|
||||
},
|
||||
layers: {"position": "before"},
|
||||
globals: {"moveto": "' . $_moveto . '"}
|
||||
|
||||
};';
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,428 @@
|
||||
<?php
|
||||
/**
|
||||
* @author ThemePunch <info@themepunch.com>
|
||||
* @link https://www.themepunch.com/
|
||||
* @copyright 2017 ThemePunch
|
||||
*/
|
||||
|
||||
if( !defined( 'ABSPATH') ) exit();
|
||||
|
||||
require_once(RS_BEFOREAFTER_PLUGIN_PATH . 'framework/slide.settings.admin.class.php');
|
||||
|
||||
class RsBeforeAfterSlideSettingsAdmin extends RsAddonBeforeAfterSlideSettingsAdmin {
|
||||
|
||||
protected static $_Path,
|
||||
$_Title,
|
||||
$_Markup,
|
||||
$_JavaScript;
|
||||
|
||||
public function __construct($_title, $_path) {
|
||||
|
||||
static::$_Title = $_title;
|
||||
static::$_Path = $_path;
|
||||
parent::init();
|
||||
|
||||
}
|
||||
|
||||
protected static function _init($_slider, $_slide) {
|
||||
|
||||
$_def_direction = $_slider->getParam('beforeafter_def_direction', 'horizontal');
|
||||
$_def_delay = $_slider->getParam('beforeafter_def_delay', '500');
|
||||
$_def_time = $_slider->getParam('beforeafter_def_time', '750');
|
||||
$_def_easing = $_slider->getParam('beforeafter_def_easing', 'Power2.easeInOut');
|
||||
$_def_animateout = $_slider->getParam('beforeafter_def_animateout', 'fade');
|
||||
$_def_bouncearrows = $_slider->getParam('beforeafter_def_bouncearrows', 'none');
|
||||
$_def_bouncetype = $_slider->getParam('beforeafter_def_bouncetype', 'repel');
|
||||
$_def_bounceamount = $_slider->getParam('beforeafter_def_bounceamount', '5');
|
||||
$_def_bouncespeed = $_slider->getParam('beforeafter_def_bouncespeed', '1500');
|
||||
$_def_bounceeasing = $_slider->getParam('beforeafter_def_bounceeasing', 'ease-in-out');
|
||||
$_def_bouncedelay = $_slider->getParam('beforeafter_def_bouncedelay', '0');
|
||||
$_def_shiftarrows = $_slider->getParam('beforeafter_def_shiftarrows', false);
|
||||
$_def_shiftoffset = $_slider->getParam('beforeafter_def_shiftoffset', '10');
|
||||
$_def_shifttiming = $_slider->getParam('beforeafter_def_shifttiming', '300');
|
||||
$_def_shifteasing = $_slider->getParam('beforeafter_def_shifteasing', 'ease');
|
||||
$_def_shiftdelay = $_slider->getParam('beforeafter_def_shiftdelay', '0');
|
||||
|
||||
$_enabled = $_slide->getParam('beforeafter_enabled', false) == 'true' ? ' checked' : '';
|
||||
$_direction = $_slide->getParam('beforeafter_direction', $_def_direction);
|
||||
$_delay = $_slide->getParam('beforeafter_delay', $_def_delay);
|
||||
$_time = $_slide->getParam('beforeafter_time', $_def_time);
|
||||
$_easing = $_slide->getParam('beforeafter_easing', $_def_easing);
|
||||
$_animateout = $_slide->getParam('beforeafter_animateout', $_def_animateout);
|
||||
|
||||
$_bounceArrows = $_slide->getParam('beforeafter_bouncearrows', $_def_bouncearrows);
|
||||
$_bounceType = $_slide->getParam('beforeafter_bouncetype', $_def_bouncetype);
|
||||
$_bounceAmount = $_slide->getParam('beforeafter_bounceamount', $_def_bounceamount);
|
||||
$_bounceSpeed = $_slide->getParam('beforeafter_bouncespeed', $_def_bouncespeed);
|
||||
$_bounceEasing = $_slide->getParam('beforeafter_bounceeasing', $_def_bounceeasing);
|
||||
$_bounceDelay = $_slide->getParam('beforeafter_bouncedelay', $_def_bouncedelay);
|
||||
|
||||
$_shiftArrows = $_slide->getParam('beforeafter_shiftarrows', $_def_shiftarrows) == 'true' ? ' checked' : '';
|
||||
$_shiftOffset = $_slide->getParam('beforeafter_shiftoffset', $_def_shiftoffset);
|
||||
$_shiftTiming = $_slide->getParam('beforeafter_shifttiming', $_def_shifttiming);
|
||||
$_shiftEasing = $_slide->getParam('beforeafter_shifteasing', $_def_shifteasing);
|
||||
$_shiftDelay = $_slide->getParam('beforeafter_shiftdelay', $_def_shiftdelay);
|
||||
|
||||
$_bgSource = $_slide->getParam('background_type_beforeafter', 'trans');
|
||||
$_bgColor = $_slide->getParam('bg_color_beforeafter', '#e7e7e7');
|
||||
$_bgImageUrl = $_slide->getParam('image_url_beforeafter', '');
|
||||
$_bgImageID = $_slide->getParam('image_id_beforeafter', '');
|
||||
$_bgExternal = $_slide->getParam('bg_external_beforeafter', '');
|
||||
$_bgYoutube = $_slide->getParam('bg_youtube_beforeafter', '');
|
||||
$_bgVimeo = $_slide->getParam('bg_vimeo_beforeafter', '');
|
||||
$_bgMpeg = $_slide->getParam('bg_mpeg_beforeafter', '');
|
||||
$_bgWebm = $_slide->getParam('bg_webm_beforeafter', '');
|
||||
$_bgOgv = $_slide->getParam('bg_ogv_beforeafter', '');
|
||||
|
||||
$_bgSize = $_slide->getParam('image_source_type_beforeafter', '');
|
||||
$_bgFit = $_slide->getParam('bg_fit_beforeafter', 'cover');
|
||||
$_bgFitX = $_slide->getParam('bg_fit_x_beforeafter', '100');
|
||||
$_bgFitY = $_slide->getParam('bg_fit_y_beforeafter', '100');
|
||||
$_bgPos = $_slide->getParam('bg_position_beforeafter', 'center center');
|
||||
$_bgPosX = $_slide->getParam('bg_position_x_beforeafter', '0');
|
||||
$_bgPosY = $_slide->getParam('bg_position_y_beforeafter', '0');
|
||||
$_bgRepeat = $_slide->getParam('bg_repeat_beforeafter', 'no-repeat');
|
||||
|
||||
$_overlay = $_slide->getParam('video_dotted_overlay_beforeafter', 'none');
|
||||
$_aspect = $_slide->getParam('video_ratio_beforeafter', '16:9');
|
||||
$_startAt = $_slide->getParam('video_start_at_beforeafter', '');
|
||||
$_endAt = $_slide->getParam('video_end_at_beforeafter', '');
|
||||
$_loopVideo = $_slide->getParam('video_loop_beforeafter', 'none');
|
||||
$_videoVolume = $_slide->getParam('video_volume_beforeafter', '');
|
||||
$_videoSpeed = $_slide->getParam('video_speed_beforeafter', '1');
|
||||
$_youtubeParams = $_slide->getParam('video_arguments_beforeafter', 'hd=1&wmode=opaque&showinfo=0&rel=0;');
|
||||
$_vimeoParams = $_slide->getParam('video_arguments_vim_beforeafter', 'title=0&byline=0&portrait=0&api=1');
|
||||
|
||||
$_forceCover = $_slide->getParam('video_force_cover_beforeafter', true) == 'true' ? ' checked' : '';
|
||||
$_rewind = $_slide->getParam('video_force_rewind_beforeafter', true) == 'true' ? ' checked' : '';
|
||||
$_muteVideo = $_slide->getParam('video_mute_beforeafter', true) == 'true' ? ' checked' : '';
|
||||
$_nextSlide = $_slide->getParam('video_nextslide_beforeafter', false) == 'true' ? ' checked' : '';
|
||||
|
||||
$_textDomain = 'rs_' . static::$_Title;
|
||||
$_show_settings = !empty($_enabled) ? 'block' : 'none';
|
||||
$_shiftOptions = !empty($_shiftArrows) ? 'block' : 'none';
|
||||
$_bounceOptions = $_bounceArrows !== 'none' ? 'block' : 'none';
|
||||
|
||||
$_bounces = array('none' => 'None', 'initial' => 'On Initial Reveal', 'infinite' => 'Infinite Loop', 'once' => 'Until First Grab');
|
||||
$_eases = array('linear', 'ease', 'ease-out', 'ease-in', 'ease-in-out');
|
||||
$_directions = array('horizontal', 'vertical');
|
||||
$_bounceTypes = array('repel', 'attract');
|
||||
$_outs = array('fade', 'collapse');
|
||||
$_easings = array(
|
||||
|
||||
'Linear.easeNone',
|
||||
'Power0.easeIn',
|
||||
'Power0.easeInOut',
|
||||
'Power0.easeOut',
|
||||
'Power1.easeIn',
|
||||
'Power1.easeInOut',
|
||||
'Power1.easeOut',
|
||||
'Power2.easeIn',
|
||||
'Power2.easeInOut',
|
||||
'Power2.easeOut',
|
||||
'Power3.easeIn',
|
||||
'Power3.easeInOut',
|
||||
'Power3.easeOut',
|
||||
'Power4.easeIn',
|
||||
'Power4.easeInOut',
|
||||
'Power4.easeOut',
|
||||
'Back.easeIn',
|
||||
'Back.easeInOut',
|
||||
'Back.easeOut',
|
||||
'Bounce.easeIn',
|
||||
'Bounce.easeInOut',
|
||||
'Bounce.easeOut',
|
||||
'Circ.easeIn',
|
||||
'Circ.easeInOut',
|
||||
'Circ.easeOut',
|
||||
'Elastic.easeIn',
|
||||
'Elastic.easeInOut',
|
||||
'Elastic.easeOut',
|
||||
'Expo.easeIn',
|
||||
'Expo.easeInOut',
|
||||
'Expo.easeOut',
|
||||
'Sine.easeIn',
|
||||
'Sine.easeInOut',
|
||||
'Sine.easeOut',
|
||||
'SlowMo.ease'
|
||||
|
||||
);
|
||||
|
||||
$_slides = $_slider->getSlides();
|
||||
$_bgs = array();
|
||||
|
||||
foreach($_slides as $_slide) {
|
||||
|
||||
$_active = $_slide->getParam('beforeafter_enabled', false) == 'true';
|
||||
$_type = $_slide->getParam('background_type_beforeafter', 'trans');
|
||||
$_bg = 'transparent';
|
||||
|
||||
switch($_type) {
|
||||
|
||||
case 'image':
|
||||
|
||||
$_id = $_slide->getParam('image_id_beforeafter', false);
|
||||
if(!empty($_id)) {
|
||||
|
||||
$_bg = wp_get_attachment_image_src($_id);
|
||||
if(!empty($_bg)) $_bg = $_slide->getParam('image_url_beforeafter', '');
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
if(!empty($_bg)) $_bg = $_slide->getParam('image_url_beforeafter', '');
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'solid':
|
||||
|
||||
$_bg = $_slide->getParam('bg_color_beforeafter', 'transparent');
|
||||
|
||||
break;
|
||||
|
||||
case 'trans':
|
||||
|
||||
$_bg = 'transparent';
|
||||
|
||||
break;
|
||||
|
||||
case 'external':
|
||||
|
||||
$_bg = $_slide->getParam('bg_external_beforeafter', '');
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
$_bgs[] = array('active' => $_active, 'type' => $_type, 'source' => $_bg);
|
||||
|
||||
}
|
||||
|
||||
$_markup = '<div id="beforeafter-addon-settings-wrap">
|
||||
|
||||
<p>
|
||||
<label>Enable/Disable:</label>
|
||||
<input type="checkbox" id="beforeafter_enabled" name="beforeafter_enabled" class="tp-moderncheckbox"' . $_enabled . ' onchange="document.getElementById(\'beforeafter-settings\').style.display=this.checked ? \'block\' : \'none\'" />
|
||||
<span class="description" style="margin-left: 20px">' . __('Activate the Before/After Add-On for this Slide', $_textDomain) . '</span>
|
||||
</p>
|
||||
|
||||
<div id="beforeafter-settings" style="display: ' . $_show_settings . '">
|
||||
|
||||
<p>
|
||||
<label>' . __('Reveal Direction:', $_textDomain) . '</label>
|
||||
<select class="rs-layer-input-field" id="beforeafter_direction" name="beforeafter_direction" value="' . $_direction . '">';
|
||||
|
||||
foreach($_directions as $_direct) {
|
||||
|
||||
$_selected = $_direct === $_direction ? ' selected' : '';
|
||||
$_markup .= '<option value="' . $_direct . '"' . $_selected . '>' . __(ucfirst($_direct), $_textDomain) . '</option>';
|
||||
|
||||
}
|
||||
|
||||
$_markup .= '</select>
|
||||
<span class="description">' . __('Reveal content from left to right or top to bottom', $_textDomain) . '</span>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label>' . __('Animation Delay:', $_textDomain) . '</label>
|
||||
<input type="text" class="small-text before-after-input" id="beforeafter_delay" name="beforeafter_delay" value="' . $_delay . '" data-default-value="' . $_delay . '">
|
||||
<span class="description">' . __('Optional delay in milliseconds for the initial reveal', $_textDomain) . '</span>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label>' . __('Animation Duration:', $_textDomain) . '</label>
|
||||
<input type="text" class="small-text before-after-input" id="beforeafter_time" name="beforeafter_time" value="' . $_time . '" data-default-value="' . $_time . '">
|
||||
<span class="description">' . __('The initial reveal\'s animation time', $_textDomain) . '</span>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label>' . __('Animation Easing:', $_textDomain) . '</label>
|
||||
<select value="' . $_easing . '" id="beforeafter_easing" name="beforeafter_easing">';
|
||||
|
||||
foreach($_easings as $_ease) {
|
||||
|
||||
$_selected = $_ease !== $_easing ? '' : ' selected';
|
||||
$_markup .= '<option value="' . $_ease . '"' . $_selected . '>' . $_ease . '</option>';
|
||||
|
||||
}
|
||||
|
||||
$_markup .= '</select>
|
||||
<span class="description">' . __('The initial reveal animation\'s transition type', $_textDomain) . '</span>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label>' . __('Animation Out:', $_textDomain) . '</label>
|
||||
<select value="' . $_animateout . '" id="beforeafter_animateout" name="beforeafter_animateout">';
|
||||
|
||||
foreach($_outs as $_out) {
|
||||
|
||||
$_selected = $_out !== $_animateout ? '' : ' selected';
|
||||
$_markup .= '<option value="' . $_out . '"' . $_selected . '>' . ucfirst($_out) . '</option>';
|
||||
|
||||
}
|
||||
|
||||
$_markup .= '</select>
|
||||
<span class="description">' . __('Choose how the "After" content should animate out when the slide changes', $_textDomain) . '</span>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label>' . __('Arrows Teaser:', $_textDomain) . '</label>
|
||||
<select value="' . $_bounceArrows . '" id="beforeafter_bouncearrows" name="beforeafter_bouncearrows">';
|
||||
|
||||
foreach($_bounces as $_key => $_value) {
|
||||
|
||||
$_selected = $_key !== $_bounceArrows ? '' : ' selected';
|
||||
$_markup .= '<option value="' . $_key . '"' . $_selected . '>' . $_value . '</option>';
|
||||
|
||||
}
|
||||
|
||||
$_markup .= '</select>
|
||||
<span class="description">' . __('Teaser animation for the drag arrows', $_textDomain) . '</span>
|
||||
</p>
|
||||
|
||||
<div id="beforeafter-bounce-options" style="display: ' . $_bounceOptions . '">
|
||||
|
||||
<p>
|
||||
<label>' . __('Bounce Type:', $_textDomain) . '</label>
|
||||
<select value="' . $_bounceType . '" id="beforeafter_bouncetype" name="beforeafter_bouncetype">';
|
||||
|
||||
foreach($_bounceTypes as $_bounce) {
|
||||
|
||||
$_selected = $_bounce !== $_bounceType ? '' : ' selected';
|
||||
$_markup .= '<option value="' . $_bounce . '"' . $_selected . '>' . ucfirst($_bounce) . '</option>';
|
||||
|
||||
}
|
||||
|
||||
$_markup .= '</select>
|
||||
<span class="description">' . __('If arrows should move away or toward each other', $_textDomain) . '</span>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label>' . __('Bounce Amount (px)', $_textDomain) . '</label>
|
||||
<input type="text" class="small-text before-after-input" id="beforeafter_bounceamount" name="beforeafter_bounceamount" value="' . $_bounceAmount . '" data-default-value="' . $_bounceAmount . '">
|
||||
<span class="description">' . __('The distance in pixels the arrows should bounce', $_textDomain) . '</span>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label>' . __('Bounce Speed (ms)', $_textDomain) . '</label>
|
||||
<input type="text" class="small-text before-after-input" id="beforeafter_bouncespeed" name="beforeafter_bouncespeed" value="' . $_bounceSpeed . '" data-default-value="' . $_bounceSpeed . '">
|
||||
<span class="description">' . __('The animation time in milliseconds for each bounce sequence', $_textDomain) . '</span>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label>' . __('Bounce Easing:', $_textDomain) . '</label>
|
||||
<select value="' . $_bounceEasing . '" id="beforeafter_bounceeasing" name="beforeafter_bounceeasing">';
|
||||
|
||||
foreach($_eases as $_ease) {
|
||||
|
||||
$_selected = $_ease !== $_bounceEasing ? '' : ' selected';
|
||||
$_markup .= '<option value="' . $_ease . '"' . $_selected . '>' . $_ease . '</option>';
|
||||
|
||||
}
|
||||
|
||||
$_markup .= '</select>
|
||||
<span class="description">' . __('The bounce animation\'s transition type', $_textDomain) . '</span>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label>' . __('Start Delay', $_textDomain) . '</label>
|
||||
<input type="text" class="small-text before-after-input" id="beforeafter_bouncedelay" name="beforeafter_bouncedelay" value="' . $_bounceDelay . '" data-default-value="' . $_bounceDelay . '">
|
||||
<span class="description">' . __('Optional delay in milliseconds before the arrows start to bounce', $_textDomain) . '</span>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<p>
|
||||
<label>Arrows Transition:</label>
|
||||
<input type="checkbox" id="beforeafter_shiftarrows" name="beforeafter_shiftarrows" class="tp-moderncheckbox"' . $_shiftArrows . ' onchange="document.getElementById(\'beforeafter-shift-options\').style.display=this.checked ? \'block\' : \'none\'" />
|
||||
<span class="description" style="margin-left: 20px">' . __('Animate the arrows into place after the initial reveal', $_textDomain) . '</span>
|
||||
</p>
|
||||
|
||||
<div id="beforeafter-shift-options" style="display: ' . $_shiftOptions . '">
|
||||
|
||||
<p>
|
||||
<label>' . __('Initial Offset (px)', $_textDomain) . '</label>
|
||||
<input type="text" class="small-text before-after-input" id="beforeafter_shiftoffset" name="beforeafter_shiftoffset" value="' . $_shiftOffset . '" data-default-value="' . $_shiftOffset . '">
|
||||
<span class="description">' . __('The initial offset for the arrows', $_textDomain) . '</span>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label>' . __('Speed (ms)', $_textDomain) . '</label>
|
||||
<input type="text" class="small-text before-after-input" id="beforeafter_shifttiming" name="beforeafter_shifttiming" value="' . $_shiftTiming . '" data-default-value="' . $_shiftTiming . '">
|
||||
<span class="description">' . __('The transition time in milliseconds', $_textDomain) . '</span>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label>' . __('Easing:', $_textDomain) . '</label>
|
||||
<select value="' . $_shiftEasing . '" id="beforeafter_shifteasing" name="beforeafter_shifteasing">';
|
||||
|
||||
foreach($_eases as $_ease) {
|
||||
|
||||
$_selected = $_ease !== $_shiftEasing ? '' : ' selected';
|
||||
$_markup .= '<option value="' . $_ease . '"' . $_selected . '>' . $_ease . '</option>';
|
||||
|
||||
}
|
||||
|
||||
$_markup .= '</select>
|
||||
<span class="description">' . __('The animation\'s transition type', $_textDomain) . '</span>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label>' . __('Delay (ms)', $_textDomain) . '</label>
|
||||
<input type="text" class="small-text before-after-input" id="beforeafter_shiftdelay" name="beforeafter_shiftdelay" value="' . $_shiftDelay . '" data-default-value="' . $_shiftDelay . '">
|
||||
<span class="description">' . __('Optional delay in milliseconds for the transition', $_textDomain) . '</span>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<input type="checkbox" class="tp-moderncheckbox beforeafter-settings-onoff" data-placement="beforeafter_video_force_cover" id="video_force_cover_beforeafter" name="video_force_cover_beforeafter"' . $_forceCover . '>
|
||||
<input type="checkbox" class="tp-moderncheckbox beforeafter-settings-onoff" data-placement="beforeafter_video_nextslide" id="video_nextslide_beforeafter" name="video_nextslide_beforeafter"' . $_nextSlide . '>
|
||||
<input type="checkbox" class="tp-moderncheckbox beforeafter-settings-onoff" data-placement="beforeafter_video_force_rewind" id="video_force_rewind_beforeafter" name="video_force_rewind_beforeafter"' . $_rewind . '>
|
||||
<input type="checkbox" class="tp-moderncheckbox beforeafter-settings-onoff" data-placement="beforeafter_video_mute" id="video_mute_beforeafter" name="video_mute_beforeafter"' . $_muteVideo . '>
|
||||
|
||||
</div>
|
||||
|
||||
</div>';
|
||||
|
||||
static::$_Markup = $_markup;
|
||||
static::$_JavaScript = "var RsAddonBeforeAfterBgSources = {
|
||||
|
||||
slideBgs: '" . json_encode($_bgs) . "',
|
||||
bgType: '" . $_bgSource . "',
|
||||
image: '" . $_bgImageUrl . "',
|
||||
id: '" . $_bgImageID . "',
|
||||
color: '" . $_bgColor . "',
|
||||
external: '" . $_bgExternal . "',
|
||||
youtube: '" . $_bgYoutube . "',
|
||||
vimeo: '" . $_bgVimeo . "',
|
||||
mpeg: '" . $_bgMpeg . "',
|
||||
webm: '" . $_bgWebm . "',
|
||||
ogv: '" . $_bgOgv . "',
|
||||
imageSize: '" . $_bgSize . "',
|
||||
bgFit: '" . $_bgFit . "',
|
||||
bgPos: '" . $_bgPos . "',
|
||||
bgfitx: '" . $_bgFitX . "',
|
||||
bgfity: '" . $_bgFitY . "',
|
||||
bgposx: '" . $_bgPosX . "',
|
||||
bgposy: '" . $_bgPosY . "',
|
||||
bgRepeat: '" . $_bgRepeat . "',
|
||||
overlay: '" . $_overlay . "',
|
||||
aspect: '" . $_aspect . "',
|
||||
startat: '" . $_startAt . "',
|
||||
endat: '" . $_endAt . "',
|
||||
loopvideo: '" . $_loopVideo . "',
|
||||
videovolume: '" . $_videoVolume . "',
|
||||
videoSpeed: '" . $_videoSpeed . "',
|
||||
youtubeparams: '" . $_youtubeParams . "',
|
||||
vimeoparams: '" . $_vimeoParams . "',
|
||||
lang: {
|
||||
select_after_image: '" . __('Select "After" Image', $_textDomain) . "',
|
||||
select_after_video: '" . __('Select "After" Video', $_textDomain) . "'
|
||||
}
|
||||
|
||||
}";
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,824 @@
|
||||
<?php
|
||||
/*
|
||||
* @author ThemePunch <info@themepunch.com>
|
||||
* @link https://www.themepunch.com/
|
||||
* @copyright 2017 ThemePunch
|
||||
*/
|
||||
|
||||
if( !defined( 'ABSPATH') ) exit();
|
||||
|
||||
require_once(RS_BEFOREAFTER_PLUGIN_PATH . 'framework/slider.admin.class.php');
|
||||
|
||||
class RsBeforeAfterSliderAdmin extends RsAddonBeforeAfterSliderAdmin {
|
||||
|
||||
protected static $_Icon,
|
||||
$_Title,
|
||||
$_Markup,
|
||||
$_Version,
|
||||
$_JavaScript;
|
||||
|
||||
public function __construct($_title, $_version) {
|
||||
|
||||
static::$_Title = $_title;
|
||||
static::$_Version = $_version;
|
||||
parent::init();
|
||||
|
||||
}
|
||||
|
||||
protected static function _init($_slider) {
|
||||
|
||||
$_enabled = RevSliderFunctions::getVal($_slider, 'beforeafter_enabled', false) == 'true' ? ' checked' : '';
|
||||
$_moveTo = RevSliderFunctions::getVal($_slider, 'beforeafter_def_moveto', '50%|50%|50%|50%');
|
||||
$_direction = RevSliderFunctions::getVal($_slider, 'beforeafter_def_direction', 'horizontal');
|
||||
$_time = RevSliderFunctions::getVal($_slider, 'beforeafter_def_time', '750');
|
||||
$_delay = RevSliderFunctions::getVal($_slider, 'beforeafter_def_delay', '500');
|
||||
$_easing = RevSliderFunctions::getVal($_slider, 'beforeafter_def_easing', 'Power2.easeInOut');
|
||||
$_animateOut = RevSliderFunctions::getVal($_slider, 'beforeafter_def_animateout', 'fade');
|
||||
|
||||
$_arrowLeft = RevSliderFunctions::getVal($_slider, 'beforeafter_left_arrow', 'fa-icon-caret-left');
|
||||
$_arrowRight = RevSliderFunctions::getVal($_slider, 'beforeafter_right_arrow', 'fa-icon-caret-right');
|
||||
$_arrowTop = RevSliderFunctions::getVal($_slider, 'beforeafter_top_arrow', 'fa-icon-caret-up');
|
||||
$_arrowBottom = RevSliderFunctions::getVal($_slider, 'beforeafter_bottom_arrow', 'fa-icon-caret-down');
|
||||
|
||||
$_arrowColor = RevSliderFunctions::getVal($_slider, 'beforeafter_arrow_color', '#ffffff');
|
||||
$_arrowSize = RevSliderFunctions::getVal($_slider, 'beforeafter_arrow_size', '32');
|
||||
$_arrowSpacing = RevSliderFunctions::getVal($_slider, 'beforeafter_arrow_spacing', '5');
|
||||
$_arrowPadding = RevSliderFunctions::getVal($_slider, 'beforeafter_arrow_padding', '0');
|
||||
$_arrowRadius = RevSliderFunctions::getVal($_slider, 'beforeafter_arrow_radius', '0');
|
||||
$_arrowBgColor = RevSliderFunctions::getVal($_slider, 'beforeafter_arrow_bg_color', 'transparent');
|
||||
|
||||
$_arrowShadow = RevSliderFunctions::getVal($_slider, 'beforeafter_arrow_shadow', false) == 'true' ? ' checked' : '';
|
||||
$_arrowShadowBlur = RevSliderFunctions::getVal($_slider, 'beforeafter_arrow_shadow_blur', '10');
|
||||
$_arrowShadowColor = RevSliderFunctions::getVal($_slider, 'beforeafter_arrow_shadow_color', 'rgba(0, 0, 0, 0.35)');
|
||||
|
||||
$_arrowBorder = RevSliderFunctions::getVal($_slider, 'beforeafter_arrow_border', false) == 'true' ? ' checked' : '';
|
||||
$_arrowBorderSize = RevSliderFunctions::getVal($_slider, 'beforeafter_arrow_border_size', '1');
|
||||
$_arrowBorderColor = RevSliderFunctions::getVal($_slider, 'beforeafter_arrow_border_color', '#000000');
|
||||
|
||||
$_boxShadow = RevSliderFunctions::getVal($_slider, 'beforeafter_box_shadow', false) == 'true' ? ' checked' : '';
|
||||
$_boxShadowBlur = RevSliderFunctions::getVal($_slider, 'beforeafter_box_shadow_blur', '10');
|
||||
$_boxShadowStrength = RevSliderFunctions::getVal($_slider, 'beforeafter_box_shadow_strength', '3');
|
||||
$_boxShadowColor = RevSliderFunctions::getVal($_slider, 'beforeafter_box_shadow_color', 'rgba(0, 0, 0, 0.35)');
|
||||
|
||||
$_dividerSize = RevSliderFunctions::getVal($_slider, 'beforeafter_divider_size', '1');
|
||||
$_dividerColor = RevSliderFunctions::getVal($_slider, 'beforeafter_divider_color', '#ffffff');
|
||||
$_dividerShadow = RevSliderFunctions::getVal($_slider, 'beforeafter_divider_shadow', false) == 'true' ? ' checked' : '';
|
||||
$_dividerShadowBlur = RevSliderFunctions::getVal($_slider, 'beforeafter_divider_shadow_blur', '10');
|
||||
$_dividerShadowStrength = RevSliderFunctions::getVal($_slider, 'beforeafter_divider_shadow_strength', '3');
|
||||
$_dividerShadowColor = RevSliderFunctions::getVal($_slider, 'beforeafter_divider_shadow_color', 'rgba(0, 0, 0, 0.35)');
|
||||
|
||||
$_onClick = RevSliderFunctions::getVal($_slider, 'beforeafter_onclick', true) == 'true' ? ' checked' : '';
|
||||
$_clickTime = RevSliderFunctions::getVal($_slider, 'beforeafter_click_time', '500');
|
||||
$_clickEasing = RevSliderFunctions::getVal($_slider, 'beforeafter_click_easing', 'Power2.easeOut');
|
||||
$_cursor = RevSliderFunctions::getVal($_slider, 'beforeafter_cursor', 'pointer');
|
||||
|
||||
$_bounceArrows = RevSliderFunctions::getVal($_slider, 'beforeafter_def_bouncearrows', 'none');
|
||||
$_bounceAmount = RevSliderFunctions::getVal($_slider, 'beforeafter_def_bounceamount', '5');
|
||||
$_bounceSpeed = RevSliderFunctions::getVal($_slider, 'beforeafter_def_bouncespeed', '1500');
|
||||
$_bounceType = RevSliderFunctions::getVal($_slider, 'beforeafter_def_bouncetype', 'repel');
|
||||
$_bounceEasing = RevSliderFunctions::getVal($_slider, 'beforeafter_def_bounceeasing', 'ease-in-out');
|
||||
$_bounceDelay = RevSliderFunctions::getVal($_slider, 'beforeafter_def_bouncedelay', '0');
|
||||
|
||||
$_shiftArrows = RevSliderFunctions::getVal($_slider, 'beforeafter_def_shiftarrows', false) == 'true' ? ' checked' : '';
|
||||
$_shiftOffset = RevSliderFunctions::getVal($_slider, 'beforeafter_def_shiftoffset', '10');
|
||||
$_shiftTiming = RevSliderFunctions::getVal($_slider, 'beforeafter_def_shifttiming', '300');
|
||||
$_shiftEasing = RevSliderFunctions::getVal($_slider, 'beforeafter_def_shifteasing', 'ease');
|
||||
$_shiftDelay = RevSliderFunctions::getVal($_slider, 'beforeafter_def_shiftdelay', '0');
|
||||
|
||||
$_textDomain = 'rs_' . static::$_Title;
|
||||
$_outs = array('fade', 'collapse');
|
||||
$_bounceTypes = array('repel', 'attract');
|
||||
$_viewports = array('Desktop', 'Notebook', 'Tablet', 'Phone');
|
||||
$_eases = array('linear', 'ease', 'ease-out', 'ease-in', 'ease-in-out');
|
||||
$_bounces = array('none' => 'None', 'initial' => 'On Initial Reveal', 'infinite' => 'Infinite Loop', 'once' => 'Until First Grab');
|
||||
$_cursors = array('pointer', 'default', 'none', 'cell', 'crosshair', 'move', 'all-scroll', 'col-resize', 'row-resize', 'ew-resize', 'ns-resize');
|
||||
$_moves = explode('|', $_moveTo);
|
||||
|
||||
$_showSettings = !empty($_enabled) ? 'block' : 'none';
|
||||
$_clickActive = !empty($_onClick) ? 'block' : 'none';
|
||||
$_arrowShadowActive = !empty($_arrowShadow) ? 'block' : 'none';
|
||||
$_dividerShadowActive = !empty($_dividerShadow) ? 'block' : 'none';
|
||||
$_arrowBorderActive = !empty($_arrowBorder) ? 'block' : 'none';
|
||||
$_boxShadowActive = !empty($_boxShadow) ? 'block' : 'none';
|
||||
$_shiftOptions = !empty($_shiftArrows) ? 'block' : 'none';
|
||||
$_bounceOptions = $_bounceArrows !== 'none' ? 'block' : 'none';
|
||||
|
||||
$_icons = array(
|
||||
|
||||
'fa-icon-chevron-left',
|
||||
'fa-icon-chevron-right',
|
||||
'fa-icon-caret-left',
|
||||
'fa-icon-caret-right',
|
||||
'fa-icon-arrow-left',
|
||||
'fa-icon-arrow-right',
|
||||
'fa-icon-backward',
|
||||
'fa-icon-forward',
|
||||
'fa-icon-angle-double-left',
|
||||
'fa-icon-angle-double-right',
|
||||
'fa-icon-angle-double-up',
|
||||
'fa-icon-angle-double-down',
|
||||
'fa-icon-angle-left',
|
||||
'fa-icon-angle-right',
|
||||
'fa-icon-angle-up',
|
||||
'fa-icon-angle-down',
|
||||
'fa-icon-long-arrow-left',
|
||||
'fa-icon-long-arrow-right',
|
||||
'fa-icon-long-arrow-up',
|
||||
'fa-icon-long-arrow-down',
|
||||
'fa-icon-arrow-up',
|
||||
'fa-icon-arrow-down',
|
||||
'fa-icon-caret-up',
|
||||
'fa-icon-caret-down'
|
||||
|
||||
);
|
||||
|
||||
$_easings = array(
|
||||
|
||||
'Linear.easeNone',
|
||||
'Power0.easeIn',
|
||||
'Power0.easeInOut',
|
||||
'Power0.easeOut',
|
||||
'Power1.easeIn',
|
||||
'Power1.easeInOut',
|
||||
'Power1.easeOut',
|
||||
'Power2.easeIn',
|
||||
'Power2.easeInOut',
|
||||
'Power2.easeOut',
|
||||
'Power3.easeIn',
|
||||
'Power3.easeInOut',
|
||||
'Power3.easeOut',
|
||||
'Power4.easeIn',
|
||||
'Power4.easeInOut',
|
||||
'Power4.easeOut',
|
||||
'Back.easeIn',
|
||||
'Back.easeInOut',
|
||||
'Back.easeOut',
|
||||
'Bounce.easeIn',
|
||||
'Bounce.easeInOut',
|
||||
'Bounce.easeOut',
|
||||
'Circ.easeIn',
|
||||
'Circ.easeInOut',
|
||||
'Circ.easeOut',
|
||||
'Elastic.easeIn',
|
||||
'Elastic.easeInOut',
|
||||
'Elastic.easeOut',
|
||||
'Expo.easeIn',
|
||||
'Expo.easeInOut',
|
||||
'Expo.easeOut',
|
||||
'Sine.easeIn',
|
||||
'Sine.easeInOut',
|
||||
'Sine.easeOut',
|
||||
'SlowMo.ease'
|
||||
|
||||
);
|
||||
|
||||
$_markup = '<div id="beforeafter-addon-settings">
|
||||
|
||||
<span class="label" id="label_beforeafter_enabled" origtitle="' . __("Enable/Disable the Before/After Add-On for the Slider.<br><br>", $_textDomain) . '">' . __('Enable Addon for this Slider', $_textDomain) . '</span>
|
||||
<input type="checkbox" class="tp-moderncheckbox withlabel" id="beforeafter_enabled" name="beforeafter_enabled"' . $_enabled . ' onchange="document.getElementById(\'beforeafter-settings\').style.display=this.checked ? \'block\' : \'none\'" />
|
||||
|
||||
<div id="beforeafter-settings" style="display: ' . $_showSettings . '">
|
||||
|
||||
<br>
|
||||
<ul class="main-options-small-tabs" style="display:inline-block">
|
||||
<li id="beforeafter_1" data-content="#beforeafter-arrow-styles" class="selected">Arrows</li>
|
||||
<li id="beforeafter_2" data-content="#beforeafter-drag-container">Drag Container</li>
|
||||
<li id="beforeafter_3" data-content="#beforeafter-line-styles">Divider Line</li>
|
||||
<li id="beforeafter_4" data-content="#beforeafter-defaults">Defaults</li>
|
||||
<li id="beforeafter_5" data-content="#beforeafter-misc">Misc.</li>
|
||||
</ul>
|
||||
|
||||
<div id="beforeafter-arrow-styles">
|
||||
|
||||
<span class="label" id="label_beforeafter_left_arrow" origtitle="' . __("Select arrows for horizontal direction mode<br><br>", $_textDomain) . '">' . __('Horizontal Arrows', $_textDomain) . '</span>
|
||||
<input type="hidden" id="beforeafter_left_arrow" name="beforeafter_left_arrow" value="' . $_arrowLeft . '" />
|
||||
<input type="hidden" id="beforeafter_right_arrow" name="beforeafter_right_arrow" value="' . $_arrowRight . '" />
|
||||
<span class="before-after-icon-option beforeafter-icon" data-arrow="left" data-icon="' . $_arrowLeft . '"><i id="before-after-icon-left" class="' . $_arrowLeft . '"></i></span
|
||||
><span class="before-after-icon-option beforeafter-icon" data-arrow="right" data-icon="' . $_arrowRight . '"><i id="before-after-icon-right" class="' . $_arrowRight . '"></i></span>
|
||||
<br>
|
||||
|
||||
<span class="label" id="label_beforeafter_top_arrow" origtitle="' . __("Select arrows for vertical direction mode<br><br>", $_textDomain) . '">' . __('Vertical Arrows', $_textDomain) . '</span>
|
||||
<input type="hidden" id="beforeafter_top_arrow" name="beforeafter_top_arrow" value="' . $_arrowTop . '" />
|
||||
<input type="hidden" id="beforeafter_bottom_arrow" name="beforeafter_bottom_arrow" value="' . $_arrowBottom . '" />
|
||||
<span class="before-after-icon-option beforeafter-icon" data-arrow="top" data-icon="' . $_arrowTop . '"><i id="before-after-icon-top" class="' . $_arrowTop . '"></i></span
|
||||
><span class="before-after-icon-option beforeafter-icon" data-arrow="bottom" data-icon="' . $_arrowBottom . '"><i id="before-after-icon-bottom" class="' . $_arrowBottom . '"></i></span>
|
||||
<br>
|
||||
|
||||
<span class="label" id="label_beforeafter_arrow_size" origtitle="' . __("The CSS font-size for the arrow icons<br><br>", $_textDomain) . '">' . __('Icon Size', $_textDomain) . '</span>
|
||||
<input type="text" class="text-sidebar withlabel beforeafter-min-max" data-default-value="' . $_arrowSize . '" data-min="0" data-max="128" id="beforeafter_arrow_size" name="beforeafter_arrow_size" value="' . $_arrowSize . '" /> px
|
||||
<br>
|
||||
|
||||
<span class="label" id="label_beforeafter_arrow_spacing" origtitle="' . __("Spacing in pixels between the arrow icons<br><br>", $_textDomain) . '">' . __('Icon Spacing', $_textDomain) . '</span>
|
||||
<input type="text" class="text-sidebar withlabel beforeafter-min-max" data-default-value="' . $_arrowSpacing . '" data-min="-50" data-max="500" id="beforeafter_arrow_spacing" name="beforeafter_arrow_spacing" value="' . $_arrowSpacing . '" /> px
|
||||
<br>
|
||||
|
||||
<span class="label" id="label_beforeafter_arrow_color" origtitle="' . __("Select a color for the arrow icons<br><br>", $_textDomain) . '">' . __('Icon Color', $_textDomain) . '</span>
|
||||
<input type="hidden" name="beforeafter_arrow_color" class="rs-layer-input-field before-after-color" data-editing="Arrows Icon Color" value="' . $_arrowColor . '" />
|
||||
<br>
|
||||
|
||||
<span class="label" id="label_beforeafter_arrow_shadow" origtitle="' . __("Apply a CSS text-shadow to the arrow icons<br><br>", $_textDomain) . '">' . __('Icon Shadow', $_textDomain) . '</span>
|
||||
<input type="checkbox" class="tp-moderncheckbox withlabel" id="beforeafter_arrow_shadow" name="beforeafter_arrow_shadow"' . $_arrowShadow . '
|
||||
onchange="document.getElementById(\'beforeafter-arrow-shadow-settings\').style.display=this.checked ? \'block\' : \'none\'" />
|
||||
<br>
|
||||
|
||||
<div id="beforeafter-arrow-shadow-settings" class="withsublabels" style="display: ' . $_arrowShadowActive . '">
|
||||
|
||||
<span class="label" id="label_beforeafter_arrow_shadow_blur" origtitle="' . __("The blur strength for the CSS text-shadow for the arrow icons.<br><br>", $_textDomain) . '">' . __('Shadow Blur', $_textDomain) . '</span>
|
||||
<input type="text" class="text-sidebar withlabel beforeafter-min-max" data-default-value="' . $_arrowShadowBlur . '" data-min="0" data-max="999" id="beforeafter_arrow_shadow_blur" name="beforeafter_arrow_shadow_blur" value="' . $_arrowShadowBlur . '" /> px
|
||||
<br>
|
||||
|
||||
<span class="label" id="label_beforeafter_arrow_shadow_color" origtitle="' . __("CSS text-shadow color for the arrow icons<br><br>", $_textDomain) . '">' . __('Shadow Color', $_textDomain) . '</span>
|
||||
<input type="hidden" name="beforeafter_arrow_shadow_color" class="rs-layer-input-field before-after-color" data-editing="Icon Shadow Color" value="' . $_arrowShadowColor . '" />
|
||||
<br>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="beforeafter-drag-container" style="display: none">
|
||||
|
||||
<span class="label" id="label_beforeafter_arrow_padding" origtitle="' . __("Padding in pixels for the arrow icons container<br><br>", $_textDomain) . '">' . __('Padding', $_textDomain) . '</span>
|
||||
<input type="text" class="text-sidebar withlabel beforeafter-min-max" data-default-value="' . $_arrowPadding . '" data-min="0" data-max="500" id="beforeafter_arrow_padding" name="beforeafter_arrow_padding" value="' . $_arrowPadding . '" /> px
|
||||
<br>
|
||||
|
||||
<span class="label" id="label_beforeafter_arrow_radius" origtitle="' . __("CSS border-radius for the arrows container. Accepts percetages or pixels.<br><br>", $_textDomain) . '">' . __('Border Radius', $_textDomain) . '</span>
|
||||
<input type="text" class="text-sidebar withlabel" id="beforeafter_arrow_radius" name="beforeafter_arrow_radius" value="' . $_arrowRadius . '" />
|
||||
<br>
|
||||
|
||||
<span class="label" id="label_beforeafter_arrow_bg_color" origtitle="' . __("Background color for the arrow icons container<br><br>", $_textDomain) . '">' . __('BG Color', $_textDomain) . '</span>
|
||||
<input type="hidden" name="beforeafter_arrow_bg_color" class="rs-layer-input-field before-after-color" data-editing="Arrows BG Color" value="' . $_arrowBgColor . '" />
|
||||
<br>
|
||||
|
||||
<span class="label" id="label_beforeafter_arrow_border" origtitle="' . __("Enable a CSS border for the arrow icons container<br><br>", $_textDomain) . '">' . __('Border', $_textDomain) . '</span>
|
||||
<input type="checkbox" class="tp-moderncheckbox withlabel" id="beforeafter_arrow_border" name="beforeafter_arrow_border"' . $_arrowBorder . ' onchange="document.getElementById(\'beforeafter-arrow-border\').style.display=this.checked ? \'block\' : \'none\'" />
|
||||
<br>
|
||||
|
||||
<div id="beforeafter-arrow-border" class="withsublabels" style="display: ' . $_arrowBorderActive . '">
|
||||
|
||||
<span class="label" id="label_beforeafter_arrow_border_size" origtitle="' . __("CSS border-width for the arrows icon container<br><br>", $_textDomain) . '">' . __('Border Size', $_textDomain) . '</span>
|
||||
<input type="text" class="text-sidebar withlabel beforeafter-min-max" data-default-value="' . $_arrowBorderSize . '"data-min="0" data-max="250" id="beforeafter_arrow_border_size" name="beforeafter_arrow_border_size" value="' . $_arrowBorderSize . '" /> px
|
||||
<br>
|
||||
|
||||
<span class="label" id="label_beforeafter_arrow_border_color" origtitle="' . __("border-color for the arrows icon container<br><br>", $_textDomain) . '">' . __('Border Color', $_textDomain) . '</span>
|
||||
<input type="hidden" name="beforeafter_arrow_border_color" class="rs-layer-input-field before-after-color" data-editing="Arrows Border Color" value="' . $_arrowBorderColor . '" />
|
||||
<br>
|
||||
|
||||
</div>
|
||||
|
||||
<span class="label" id="label_beforeafter_box_shadow" origtitle="' . __("Enable a CSS box-shadow for the arrow icons container.<br><br>", $_textDomain) . '">' . __('Box Shadow', $_textDomain) . '</span>
|
||||
<input type="checkbox" class="tp-moderncheckbox withlabel" id="beforeafter_box_shadow" name="beforeafter_box_shadow"' . $_boxShadow . ' onchange="document.getElementById(\'beforeafter-arrow-box-shadow\').style.display=this.checked ? \'block\' : \'none\'" />
|
||||
<br>
|
||||
|
||||
<div id="beforeafter-arrow-box-shadow" class="withsublabels" style="display: ' . $_boxShadowActive . '">
|
||||
|
||||
<span class="label" id="label_beforeafter_box_shadow_blur" origtitle="' . __("The box-shadow blur spread for the arrow icons container.<br><br>", $_textDomain) . '">' . __('Shadow Blur', $_textDomain) . '</span>
|
||||
<input type="text" class="text-sidebar withlabel beforeafter-min-max" data-default-value="' . $_boxShadowBlur . '"data-min="0" data-max="999" id="beforeafter_box_shadow_blur" name="beforeafter_box_shadow_blur" value="' . $_boxShadowBlur . '" /> px
|
||||
<br>
|
||||
|
||||
<span class="label" id="label_beforeafter_box_shadow_strength" origtitle="' . __("The box-shadow blur strength for the arrow icons container.<br><br>", $_textDomain) . '">' . __('Shadow Strength', $_textDomain) . '</span>
|
||||
<input type="text" class="text-sidebar withlabel beforeafter-min-max" data-default-value="' . $_boxShadowStrength . '" data-min="0" data-max="999" id="beforeafter_box_shadow_strength" name="beforeafter_box_shadow_strength" value="' . $_boxShadowStrength . '" /> px
|
||||
<br>
|
||||
|
||||
<span class="label" id="label_beforeafter_box_shadow_color" origtitle="' . __("The box-shadow color for the arrow icons container<br><br>", $_textDomain) . '">' . __('Shadow Color', $_textDomain) . '</span>
|
||||
<input type="hidden" name="beforeafter_box_shadow_color" class="rs-layer-input-field before-after-color" data-editing="Arrows Box Shadow Color" value="' . $_boxShadowColor . '" />
|
||||
<br>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="beforeafter-line-styles" style="display: none">
|
||||
|
||||
<span class="label" id="label_beforeafter_divider_size" origtitle="' . __("The size of the divider line in pixels. For no line enter the number 0.<br><br>", $_textDomain) . '">' . __('Line Size', $_textDomain) . '</span>
|
||||
<input type="text" class="text-sidebar withlabel beforeafter-min-max" data-default-value="' . $_dividerSize . '" data-min="0" data-max="500" id="beforeafter_divider_size" name="beforeafter_divider_size" value="' . $_dividerSize . '" /> px
|
||||
<br>
|
||||
|
||||
<span class="label" id="label_beforeafter_divider_color" origtitle="' . __("The color for the divider line<br><br>", $_textDomain) . '">' . __('Line Color', $_textDomain) . '</span>
|
||||
<input type="hidden" id="beforeafter_divider_color" name="beforeafter_divider_color" class="rs-layer-input-field before-after-color" data-editing="Divider Color" value="' . $_dividerColor . '" />
|
||||
<br>
|
||||
|
||||
<span class="label" id="label_beforeafter_shadow" origtitle="' . __("Enable a CSS box-shadow for the divider line<br><br>", $_textDomain) . '">' . __('Line Shadow', $_textDomain) . '</span>
|
||||
<input type="checkbox" class="tp-moderncheckbox withlabel" id="beforeafter_shadow" name="beforeafter_divider_shadow"' . $_dividerShadow . '
|
||||
onchange="document.getElementById(\'beforeafter-line-shadow-settings\').style.display=this.checked ? \'block\' : \'none\'" />
|
||||
<br>
|
||||
|
||||
<div id="beforeafter-line-shadow-settings" class="withsublabels" style="display: ' . $_dividerShadowActive . '">
|
||||
|
||||
<span class="label" id="label_beforeafter_divider_shadow_blur" origtitle="' . __("The box-shadow blur spread for the divider line<br><br>", $_textDomain) . '">' . __('Shadow Blur', $_textDomain) . '</span>
|
||||
<input type="text" class="text-sidebar withlabel beforeafter-min-max" data-default-value="' . $_dividerShadowBlur . '" data-min="0" data-max="999" id="beforeafter_divider_shadow_blur" name="beforeafter_divider_shadow_blur" value="' . $_dividerShadowBlur . '" /> px
|
||||
<br>
|
||||
|
||||
<span class="label" id="label_beforeafter_divider_shadow_strength" origtitle="' . __("The box-shadow blur strength for the divider line.<br><br>", $_textDomain) . '">' . __('Shadow Strength', $_textDomain) . '</span>
|
||||
<input type="text" class="text-sidebar withlabel beforeafter-min-max" data-default-value="' . $_dividerShadowStrength . '" data-min="0" data-max="999" id="beforeafter_divider_shadow_strength" name="beforeafter_divider_shadow_strength" value="' . $_dividerShadowStrength . '" /> px
|
||||
<br>
|
||||
|
||||
<span class="label" id="label_beforeafter_divider_shadow_color" origtitle="' . __("The box-shadow color for the divider line<br><br>", $_textDomain) . '">' . __('Shadow Color', $_textDomain) . '</span>
|
||||
<input type="hidden" id="beforeafter_divider_shadow_color" name="beforeafter_divider_shadow_color" class="rs-layer-input-field before-after-color" data-editing="Line Shadow Color" value="' . $_dividerShadowColor . '" />
|
||||
<br>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="beforeafter-defaults" style="display: none">
|
||||
|
||||
<span class="label" id="label_beforeafter_def_direction" origtitle="' . __("Select which way the before/after should reveal<br><br>", $_textDomain) . '">' . __('Reveal Direction', $_textDomain) . '</span>
|
||||
<select id="beforeafter_def_direction" class="withlabel" name="beforeafter_def_direction" value="' . $_direction . '">
|
||||
<option value="horizontal">' . __('Horizontal', $_textDomain) . '</option>
|
||||
<option value="vertical">' . __('Vertical', $_textDomain) . '</option>
|
||||
</select>
|
||||
<br>';
|
||||
|
||||
$_i = 0;
|
||||
foreach($_viewports as $_viewport) {
|
||||
|
||||
$_value = isset($_moves[$_i]) ? $_moves[$_i] : '50%';
|
||||
$_markup .= '
|
||||
|
||||
<span class="label" id="label_beforeafter_moveto_' . $_i . '" origtitle="' . __("Accepts both pixels and percentages<br><br>", $_textDomain) . '">' . $_viewport . __(' Reveal Point', $_textDomain) . '</span>
|
||||
<input type="text" class="text-sidebar withlabel beforeafter-def-moveto" id="beforeafter_moveto_' . $_i . '" value="' . $_value . '" />
|
||||
<br>';
|
||||
$_i++;
|
||||
|
||||
}
|
||||
|
||||
$_markup .= '<input id="beforeafter_def_moveto" type="hidden" name="beforeafter_def_moveto" value="' . $_moveTo . '" />
|
||||
|
||||
<span class="label" id="label_beforeafter_def_delay" origtitle="' . __("An optional delay in milliseconds before the reveal occurs.<br><br>", $_textDomain) . '">' . __('Reveal Start Delay', $_textDomain) . '</span>
|
||||
<input type="text" class="text-sidebar withlabel beforeafter-min-max" data-default-value="' . $_delay . '" data-min="0" data-max="10000" id="beforeafter_def_delay" name="beforeafter_def_delay" value="' . $_delay . '" /> ms
|
||||
<br>
|
||||
|
||||
<span class="label" id="label_beforeafter_def_time" origtitle="' . __("The duration of the animation as it occurs (in milliseconds).<br><br>", $_textDomain) . '">' . __('Animation Duration', $_textDomain) . '</span>
|
||||
<input type="text" class="text-sidebar withlabel beforeafter-min-max" data-default-value="' . $_time . '" data-min="100" data-max="10000" id="beforeafter_def_time" name="beforeafter_def_time" value="' . $_time . '" /> ms
|
||||
<br>
|
||||
|
||||
<span class="label" id="label_beforeafter_def_easing" origtitle="' . __("The animation timing equation<br><br>", $_textDomain) . '">' . __('Animation Easing', $_textDomain) . '</span>
|
||||
<select value="' . $_easing . '" id="beforeafter_def_easing" name="beforeafter_def_easing" class="withlabel">';
|
||||
|
||||
foreach($_easings as $_ease) {
|
||||
|
||||
$_selected = $_ease !== $_easing ? '' : ' selected';
|
||||
$_markup .= '<option value="' . $_ease . '"' . $_selected . '>' . $_ease . '</option>';
|
||||
|
||||
}
|
||||
|
||||
$_markup .= '</select>
|
||||
|
||||
<span class="label" id="label_beforeafter_def_animateout" origtitle="' . __('Choose how the current <em>After</em> content should animate out when the slide changes.<br><br>', $_textDomain) . '">' . __('Animate Out', $_textDomain) . '</span>
|
||||
<select value="' . $_animateOut . '" id="beforeafter_def_animateout" name="beforeafter_def_animateout" class="withlabel">';
|
||||
|
||||
foreach($_outs as $_out) {
|
||||
|
||||
$_selected = $_out !== $_animateOut ? '' : ' selected';
|
||||
$_markup .= '<option value="' . $_out . '"' . $_selected . '>' . ucfirst($_out) . '</option>';
|
||||
|
||||
}
|
||||
|
||||
$_markup .= '</select>
|
||||
<br>
|
||||
|
||||
<span class="label" id="label_beforeafter_def_bouncearrows" origtitle="' . __('Teaser animation for the drag arrows<br><br>', $_textDomain) . '">' . __('Arrows Teaser', $_textDomain) . '</span>
|
||||
<select value="' . $_bounceArrows . '" id="beforeafter_def_bouncearrows" name="beforeafter_def_bouncearrows" class="withlabel">';
|
||||
|
||||
foreach($_bounces as $_key => $_value) {
|
||||
|
||||
$_selected = $_key !== $_bounceArrows ? '' : ' selected';
|
||||
$_markup .= '<option value="' . $_key . '"' . $_selected . '>' . $_value . '</option>';
|
||||
|
||||
}
|
||||
|
||||
$_markup .= '</select>
|
||||
|
||||
<div id="beforeafter-bounce-options" class="withsublabels" style="display: ' . $_bounceOptions . '">
|
||||
|
||||
<span class="label" id="label_beforeafter_def_bouncetype" origtitle="' . __("The direction the arrows should bounce toward<br><br>", $_textDomain) . '">' . __('Bounce Type', $_textDomain) . '</span>
|
||||
<select value="' . $_bounceType . '" id="beforeafter_def_bouncetype" name="beforeafter_def_bouncetype" class="withlabel">';
|
||||
|
||||
foreach($_bounceTypes as $_bounce) {
|
||||
|
||||
$_selected = $_bounce !== $_bounceType ? '' : ' selected';
|
||||
$_markup .= '<option value="' . $_bounce . '"' . $_selected . '>' . ucfirst($_bounce) . '</option>';
|
||||
|
||||
}
|
||||
|
||||
$_markup .= '</select>
|
||||
|
||||
<span class="label" id="label_beforeafter_def_bounceamount" origtitle="' . __("The distance in pixels the arrows should bounce.<br><br>", $_textDomain) . '">' . __('Bounce Amount', $_textDomain) . '</span>
|
||||
<input type="text" class="text-sidebar withlabel beforeafter-min-max" data-default-value="' . $_bounceAmount . '" data-min="0" data-max="1000" id="beforeafter_def_bounceamount" name="beforeafter_def_bounceamount" value="' . $_bounceAmount . '" /> px
|
||||
<br>
|
||||
|
||||
<span class="label" id="label_beforeafter_def_bouncespeed" origtitle="' . __("The animation time for each bounce sequence<br><br>", $_textDomain) . '">' . __('Bounce Speed', $_textDomain) . '</span>
|
||||
<input type="text" class="text-sidebar withlabel beforeafter-min-max" data-default-value="' . $_bounceSpeed . '" data-min="100" data-max="5000" id="beforeafter_def_bouncespeed" name="beforeafter_def_bouncespeed" value="' . $_bounceSpeed . '" /> ms
|
||||
<br>
|
||||
|
||||
<span class="label" id="label_beforeafter_def_bounceeasing" origtitle="' . __("The bounce animations transition type<br><br>", $_textDomain) . '">' . __('Bounce Easing', $_textDomain) . '</span>
|
||||
<select value="' . $_bounceEasing . '" id="beforeafter_def_bounceeasing" name="beforeafter_def_bounceeasing" class="withlabel">';
|
||||
|
||||
foreach($_eases as $_ease) {
|
||||
|
||||
$_selected = $_ease !== $_bounceEasing ? '' : ' selected';
|
||||
$_markup .= '<option value="' . $_ease . '"' . $_selected . '>' . $_ease . '</option>';
|
||||
|
||||
}
|
||||
|
||||
$_markup .= '</select>
|
||||
<br>
|
||||
|
||||
<span class="label" id="label_beforeafter_def_bouncedelay" origtitle="' . __("Optional delay in milliseconds before the arrows start to bounce.<br><br>", $_textDomain) . '">' . __('Start Delay', $_textDomain) . '</span>
|
||||
<input type="text" class="text-sidebar withlabel beforeafter-min-max" data-default-value="' . $_bounceDelay . '" data-min="0" data-max="10000" id="beforeafter_def_bouncedelay" name="beforeafter_def_bouncedelay" value="' . $_bounceDelay . '" /> ms
|
||||
<br>
|
||||
|
||||
</div>
|
||||
|
||||
<span class="label" id="label_beforeafter_def_shiftarrows" origtitle="' . __("Animate the arrows into place after the initial reveal.<br><br>", $_textDomain) . '">' . __('Arrows Transition', $_textDomain) . '</span>
|
||||
<input type="checkbox" class="tp-moderncheckbox withlabel" id="beforeafter_def_shiftarrows" name="beforeafter_def_shiftarrows"' . $_shiftArrows . ' onchange="document.getElementById(\'beforeafter-shift-options\').style.display=this.checked ? \'block\' : \'none\'" />
|
||||
|
||||
<div id="beforeafter-shift-options" class="withsublabels" style="display: ' . $_shiftOptions . '">
|
||||
|
||||
<span class="label" id="label_beforeafter_def_shiftoffset" origtitle="' . __("The initial offset for the arrows<br><br>", $_textDomain) . '">' . __('Initial Offset', $_textDomain) . '</span>
|
||||
<input type="text" class="text-sidebar withlabel beforeafter-min-max" data-default-value="' . $_shiftOffset . '" data-min="0" data-max="10000" id="beforeafter_def_shiftoffset" name="beforeafter_def_shiftoffset" value="' . $_shiftOffset . '" /> px
|
||||
<br>
|
||||
|
||||
<span class="label" id="label_beforeafter_def_shifttiming" origtitle="' . __("The transition time in milliseconds<br><br>", $_textDomain) . '">' . __('Speed', $_textDomain) . '</span>
|
||||
<input type="text" class="text-sidebar withlabel beforeafter-min-max" data-default-value="' . $_shiftTiming . '" data-min="0" data-max="5000" id="beforeafter_def_shifttiming" name="beforeafter_def_shifttiming" value="' . $_shiftTiming . '" /> ms
|
||||
<br>
|
||||
|
||||
<span class="label" id="label_beforeafter_def_shifteasing" origtitle="' . __("The transition type for the animation<br><br>", $_textDomain) . '">' . __('Easing', $_textDomain) . '</span>
|
||||
<select value="' . $_shiftEasing . '" id="beforeafter_def_shifteasing" name="beforeafter_def_shifteasing" class="withlabel">';
|
||||
|
||||
foreach($_eases as $_ease) {
|
||||
|
||||
$_selected = $_ease !== $_shiftEasing ? '' : ' selected';
|
||||
$_markup .= '<option value="' . $_ease . '"' . $_selected . '>' . $_ease . '</option>';
|
||||
|
||||
}
|
||||
|
||||
$_markup .= '</select>
|
||||
<br>
|
||||
|
||||
<span class="label" id="label_beforeafter_def_shiftdelay" origtitle="' . __("Optional delay in milliseconds for the transition.<br><br>", $_textDomain) . '">' . __('Delay', $_textDomain) . '</span>
|
||||
<input type="text" class="text-sidebar withlabel beforeafter-min-max" data-default-value="' . $_shiftDelay . '" data-min="0" data-max="10000" id="beforeafter_def_shiftdelay" name="beforeafter_def_shiftdelay" value="' . $_shiftDelay . '" /> ms
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="beforeafter-misc" style="display: none">
|
||||
|
||||
<span class="label" id="label_beforeafter_onclick" origtitle="' . __("Clicking a point on the slider will move the reveal line automatically to that point.<br><br>", $_textDomain) . '">' . __('Animate on Stage Click', $_textDomain) . '</span>
|
||||
<input type="checkbox" class="tp-moderncheckbox withlabel" id="beforeafter_onclick" name="beforeafter_onclick"' . $_onClick . ' onchange="document.getElementById(\'beforeafter-onclick\').style.display=this.checked ? \'block\' : \'none\'" />
|
||||
<br>
|
||||
|
||||
<div id="beforeafter-onclick" class="withsublabels" style="display: ' . $_clickActive . '">
|
||||
|
||||
<span class="label" id="label_beforeafter_click_time" origtitle="' . __("The duration of the animation as it occurs (in milliseconds).<br><br>", $_textDomain) . '">' . __('Duration', $_textDomain) . '</span>
|
||||
<input type="text" class="text-sidebar withlabel beforeafter-min-max" data-default-value="' . $_clickTime . '" data-min="100" data-max="10000" id="beforeafter_click_time" name="beforeafter_click_time" value="' . $_clickTime . '" /> ms
|
||||
<br>
|
||||
|
||||
<span class="label" id="label_beforeafter_click_easing" origtitle="' . __("The animation timing equation<br><br>", $_textDomain) . '">' . __('Easing', $_textDomain) . '</span>
|
||||
<select value="' . $_clickEasing . '" id="beforeafter_click_easing" name="beforeafter_click_easing" class="withlabel">';
|
||||
|
||||
foreach($_easings as $_ease) {
|
||||
|
||||
$_selected = $_ease !== $_clickEasing ? '' : ' selected';
|
||||
$_markup .= '<option value="' . $_ease . '"' . $_selected . '>' . $_ease . '</option>';
|
||||
|
||||
}
|
||||
|
||||
$_markup .= '</select>
|
||||
|
||||
</div>
|
||||
|
||||
<span class="label" id="label_beforeafter_cursor" origtitle="' . __("The CSS mouse cursor to be displayed when the mouse hovers over the arrow icon container.<br><br>", $_textDomain) . '">' . __('Mouse Cursor', $_textDomain) . '</span>
|
||||
<select value="' . $_cursor . '" id="beforeafter_cursor" name="beforeafter_cursor" class="withlabel">';
|
||||
|
||||
foreach($_cursors as $_cur) {
|
||||
|
||||
$_selected = $_cur !== $_cursor ? '' : ' selected';
|
||||
$_markup .= '<option value="' . $_cur . '"' . $_selected . '>' . $_cur . '</option>';
|
||||
|
||||
}
|
||||
|
||||
$_markup .= '</select>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="before-after-icon-selector"><div>';
|
||||
foreach($_icons as $_icon) {
|
||||
|
||||
$_markup .= '<span class="before-after-icon-option before-after-icon-select" data-icon="' . $_icon . '"><i class="' . $_icon . '"></i></span>';
|
||||
|
||||
}
|
||||
|
||||
$_markup .= '</div></div>
|
||||
|
||||
</div>
|
||||
|
||||
<style type="text/css">
|
||||
|
||||
.setting_box .fa-icon-adjust {width: 17px; margin-left: 3px}
|
||||
.setting_box .fa-icon-adjust:before {position: relative; top: 3px}
|
||||
.beforeafter_color_wrap {position: relative; top: 8px}
|
||||
|
||||
#before-after-icon-selector {
|
||||
width: 375px;
|
||||
top: 120px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 120000;
|
||||
display: none;
|
||||
position: absolute;
|
||||
background: #fff;
|
||||
padding: 10px 0;
|
||||
/*border: 10px solid #fff;*/
|
||||
/*box-shadow: 0px 20px 20px rgba(0,0,0,0.15);*/
|
||||
}
|
||||
|
||||
#before-after-icon-selector > div {
|
||||
width: 280px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.before-after-icon-option {
|
||||
margin: 0px 2px 2px 0px;
|
||||
font-size: 14px;
|
||||
border: 1px solid #F1F1F1;
|
||||
cursor: pointer;
|
||||
background: #fff;
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: 31px;
|
||||
height: 31px;
|
||||
line-height: 31px !important;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
#before-after-icon-selector .before-after-icon-option {
|
||||
float: left;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.before-after-icon-option:hover {
|
||||
background: #3498DB;
|
||||
border-color: #3498DB !important;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.before-after-icon-select.selected {
|
||||
border-color: #000 ;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
</div>';
|
||||
|
||||
static::$_Markup = $_markup;
|
||||
static::$_Icon = 'fa-icon-adjust';
|
||||
static::$_JavaScript = '
|
||||
|
||||
jQuery(function() {
|
||||
|
||||
var iconSelector,
|
||||
selectedIcon,
|
||||
arrowDirection;
|
||||
|
||||
function setId() {
|
||||
|
||||
var $this = jQuery(this);
|
||||
$this.attr("id", $this.find(".before-after-color").attr("name"));
|
||||
|
||||
}
|
||||
|
||||
if(jQuery.fn.tpColorPicker) {
|
||||
|
||||
jQuery(".before-after-color").each(function() {
|
||||
|
||||
jQuery(this).tpColorPicker({mode: "single", wrapClasses: "beforeafter_color_wrap withlabel", init: function() {
|
||||
|
||||
jQuery(".beforeafter_color_wrap").each(setId);
|
||||
|
||||
}});
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
jQuery(".before-after-color").wpColorPicker({palettes: false, height: 250, border: false, change: function(evt, ui) {
|
||||
this.value = ui.color.toString();
|
||||
}});
|
||||
|
||||
}
|
||||
|
||||
jQuery(".beforeafter-min-max").on("change", function() {
|
||||
|
||||
var val = this.value;
|
||||
if(val === "") val = 0;
|
||||
|
||||
val = Math.max(parseFloat(this.getAttribute("data-min")),
|
||||
Math.min(parseFloat(this.getAttribute("data-max")), parseFloat(val)));
|
||||
|
||||
if(!isNaN(val)) this.value = val;
|
||||
else this.value = this.getAttribute("data-default-value");
|
||||
|
||||
});
|
||||
|
||||
jQuery("#beforeafter_arrow_radius").on("focusout", function() {
|
||||
|
||||
var val = this.value,
|
||||
perc;
|
||||
|
||||
if(val.search("%") !== -1) {
|
||||
|
||||
perc = "%";
|
||||
val = val.replace("%", "");
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
perc = /[0-9]*\.?[0-9]+(px)?/.test(val) ? "px" : "";
|
||||
|
||||
}
|
||||
|
||||
val = parseInt(val, 10);
|
||||
|
||||
if(isNaN(val)) val = "0";
|
||||
else val = Math.min(Math.max(0, val), 100);
|
||||
|
||||
this.value = val + perc;
|
||||
|
||||
});
|
||||
|
||||
jQuery(".beforeafter-icon").on("click", function() {
|
||||
|
||||
if(!iconSelector) iconSelector = jQuery("#before-after-icon-selector");
|
||||
|
||||
selectedIcon = this;
|
||||
arrowDirection = this.getAttribute("data-arrow");
|
||||
|
||||
iconSelector.find(".selected").removeClass("selected");
|
||||
iconSelector.find(".before-after-icon-select[data-icon=" + this.getAttribute("data-icon") + "]").addClass("selected");
|
||||
iconSelector.show();
|
||||
|
||||
});
|
||||
|
||||
jQuery(".before-after-icon-select").on("click", function() {
|
||||
|
||||
var icon = this.getAttribute("data-icon");
|
||||
selectedIcon.setAttribute("data-icon", icon);
|
||||
|
||||
document.getElementById("beforeafter_" + arrowDirection + "_arrow").value = icon;
|
||||
document.getElementById("before-after-icon-" + arrowDirection).className = icon;
|
||||
|
||||
iconSelector.hide();
|
||||
|
||||
});
|
||||
|
||||
document.getElementById("beforeafter_def_bouncearrows").addEventListener("change", function() {
|
||||
|
||||
var display = this.value !== "none" ? "block" : "none";
|
||||
document.getElementById("beforeafter-bounce-options").style.display = display;
|
||||
|
||||
});
|
||||
|
||||
var speeds,
|
||||
times,
|
||||
timings = jQuery("#beforeafter_def_moveto");
|
||||
|
||||
function timeEach(i) {
|
||||
|
||||
var $this = jQuery(this),
|
||||
val = $this.val(),
|
||||
perc = "";
|
||||
|
||||
if(!val) {
|
||||
|
||||
val = "50%";
|
||||
$this.val("50%");
|
||||
|
||||
}
|
||||
|
||||
if(val.search("%") !== -1) {
|
||||
|
||||
perc = "%";
|
||||
val = val.replace("%", "");
|
||||
|
||||
if(isNaN(val)) val = "50";
|
||||
else val = Math.min(Math.max(0, val), 100);
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
perc = /[0-9]*\.?[0-9]+(px)?/.test(val) ? "px" : "";
|
||||
|
||||
}
|
||||
|
||||
val = parseInt(val, 10);
|
||||
if(isNaN(val)) {
|
||||
|
||||
val = 50;
|
||||
perc = "%";
|
||||
|
||||
}
|
||||
|
||||
val += perc;
|
||||
$this.val(val);
|
||||
|
||||
if(i !== 0) speeds += "|";
|
||||
speeds += val;
|
||||
|
||||
}
|
||||
|
||||
times = jQuery(".beforeafter-def-moveto").on("focusout", function() {
|
||||
|
||||
speeds = "";
|
||||
times.each(timeEach);
|
||||
timings.val(speeds);
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
';
|
||||
|
||||
}
|
||||
|
||||
public function export_slider($_data, $_slides, $_sliderParams, $_useDummy) {
|
||||
|
||||
foreach($_slides as $_slide) {
|
||||
|
||||
// do slide params exist?
|
||||
if(!isset($_slide['params'])) continue;
|
||||
|
||||
// does the slide have before/after data?
|
||||
if(!isset($_slide['params']['background_type_beforeafter'])) continue;
|
||||
|
||||
// is the "after" bg source type an image?
|
||||
$_type = $_slide['params']['background_type_beforeafter'];
|
||||
if($_type !== 'image') continue;
|
||||
|
||||
// is the "after" bg image set?
|
||||
if(!isset($_slide['params']['image_url_beforeafter'])) continue;
|
||||
|
||||
// does the "after" image url exist? If so, add it to the export image list
|
||||
$_image = $_slide['params']['image_url_beforeafter'];
|
||||
if(!empty($_image)) $_data['usedImages'][$_image] = true;
|
||||
|
||||
}
|
||||
|
||||
return $_data;
|
||||
|
||||
}
|
||||
|
||||
public function import_slider($_data, $_slide_type, $_image_path) {
|
||||
|
||||
// do the slide params exist and does the slide have before/after data?
|
||||
if(isset($_data['params'])) {
|
||||
|
||||
if(isset($_data['params']['background_type_beforeafter'])) {
|
||||
|
||||
// reset image id data in case it can't be retrieved upon import
|
||||
$_imageId = '';
|
||||
|
||||
// is the "after" bg source set to "image" and is the image url set?
|
||||
$_type = $_data['params']['background_type_beforeafter'];
|
||||
if($_type === 'image' && isset($_data['params']['image_url_beforeafter'])) {
|
||||
|
||||
// does the image url exist?
|
||||
$_image = $_data['params']['image_url_beforeafter'];
|
||||
if(!empty($_image)) {
|
||||
|
||||
// convert the image url (domain paths get replaced)
|
||||
$_url = RevSliderBase::check_file_in_zip($_image_path, $_image, $_data['sliderParams']['alias'], $_data['alreadyImported']);
|
||||
$_url = RevSliderFunctionsWP::getImageUrlFromPath($_url);
|
||||
|
||||
// if the url converted ok
|
||||
if(!empty($_url)) {
|
||||
|
||||
// update the before/after data with the converted image url
|
||||
$_data['params']['image_url_beforeafter'] = $_url;
|
||||
|
||||
// attempt to get the image's new ID and update the before/after data
|
||||
$_id = RevSliderFunctionsWP::get_image_id_by_url($_url);
|
||||
if(!empty($_id)) $_imageId = $_id;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// set the image ID to the new ID or to an empty string
|
||||
// this will prevent a "faulty" image ID from possibly existing when the frontend output runs
|
||||
$_data['params']['image_id_beforeafter'] = $_imageId;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $_data;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,224 @@
|
||||
<?php
|
||||
/**
|
||||
* @author ThemePunch <info@themepunch.com>
|
||||
* @link https://www.themepunch.com/
|
||||
* @copyright 2017 ThemePunch
|
||||
*/
|
||||
|
||||
if( !defined( 'ABSPATH') ) exit();
|
||||
|
||||
class RevAddOnBeforeAfterUpdate {
|
||||
private $plugin_url = 'https://codecanyon.net/item/slider-revolution-responsive-wordpress-plugin/2751380';
|
||||
private $remote_url = 'https://updates.themepunch.tools/check_for_updates.php';
|
||||
private $remote_url_info = 'https://updates.themepunch.tools/addons/revslider-beforeafter-addon/revslider-beforeafter-addon.php';
|
||||
private $plugin_slug = 'revslider-beforeafter-addon';
|
||||
private $plugin_path = 'revslider-beforeafter-addon/revslider-beforeafter-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_beforeafter_addon-update-check');
|
||||
|
||||
|
||||
if($last_check == false){ //first time called
|
||||
$last_check = time();
|
||||
update_option('revslider_beforeafter_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_beforeafter_addon-update-check', time());
|
||||
|
||||
$this->data->checked = time();
|
||||
$this->data->basic = $data->basic;
|
||||
$this->data->full = $data->full;
|
||||
|
||||
//update_option('revslider_beforeafter_addon-stable-version', $data->full->stable);
|
||||
update_option('revslider_beforeafter_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_beforeafter_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(
|
||||
'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-beforeafter-addon-update-check-short');
|
||||
if($last_check == false){ //first time called
|
||||
$last_check = time();
|
||||
update_option('revslider-beforeafter-addon-update-check-short', $last_check);
|
||||
}
|
||||
|
||||
// Check for updates
|
||||
if(time() - $last_check > 172800 || $force_check == true){
|
||||
|
||||
|
||||
update_option('revslider-beforeafter-addon-update-check-short', time());
|
||||
|
||||
$purchase = (get_option('revslider-valid', 'false') == 'true') ? get_option('revslider-code', '') : '';
|
||||
|
||||
|
||||
$response = wp_remote_post($this->remote_url, array(
|
||||
'body' => array(
|
||||
'item' => urlencode('revslider-beforeafter-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_beforeafter_addon-connection', false);
|
||||
return false;
|
||||
}else{
|
||||
update_option('revslider_beforeafter_addon-connection', true);
|
||||
}
|
||||
|
||||
/*
|
||||
$version_info = json_decode($version_info);
|
||||
if(isset($version_info->version)){
|
||||
update_option('revslider_beforeafter_addon-latest-version', $version_info->version);
|
||||
}
|
||||
|
||||
if(isset($version_info->notices)){
|
||||
update_option('revslider_beforeafter_addon-notices', $version_info->notices);
|
||||
}
|
||||
|
||||
if(isset($version_info->dashboard)){
|
||||
update_option('revslider_beforeafter_addon-dashboard', $version_info->dashboard);
|
||||
}
|
||||
|
||||
if(isset($version_info->deactivated) && $version_info->deactivated === true){
|
||||
if(get_option('revslider_beforeafter_addon-valid', 'false') == 'true'){
|
||||
//remove validation, add notice
|
||||
update_option('revslider_beforeafter_addon-valid', 'false');
|
||||
update_option('revslider_beforeafter_addon-deact-notice', true);
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
if($force_check == true){ //force that the update will be directly searched
|
||||
update_option('revslider-beforeafter-addon-update-check', '');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
/*
|
||||
* @author ThemePunch <info@themepunch.com>
|
||||
* @link https://www.themepunch.com/
|
||||
* @copyright 2017 ThemePunch
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
test widget
|
||||
http://pastebin.com/J0wB676U
|
||||
|
||||
*/
|
||||
|
||||
if(!defined('ABSPATH')) exit();
|
||||
|
||||
?>
|
||||
|
||||
<div id="rev_addon_beforeafter_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('Setting up the BeforeAfter Add-On', 'rs_beforeafter'); ?></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> Enable the Before/After Add-On from the <a href="<?php echo RS_BEFOREAFTER_PLUGIN_URL; ?>admin/assets/images/slider-settings-button.jpg" target="_blank">Slider Settings</a></h3>
|
||||
<img src="<?php echo RS_BEFOREAFTER_PLUGIN_URL; ?>admin/assets/images/tutorial0.jpg" />
|
||||
|
||||
<h3><span>2</span> Enable the Before/After feature for an individual Slide from the <a href="<?php echo RS_BEFOREAFTER_PLUGIN_URL; ?>admin/assets/images/slide_settings.jpg" target="_blank">Slide Settings</a></h3>
|
||||
<a href="<?php echo RS_BEFOREAFTER_PLUGIN_URL; ?>admin/assets/images/slide_settings.jpg" target="_blank">
|
||||
<img src="<?php echo RS_BEFOREAFTER_PLUGIN_URL; ?>admin/assets/images/tutorial1.jpg" />
|
||||
</a>
|
||||
<br><br>
|
||||
<img src="<?php echo RS_BEFOREAFTER_PLUGIN_URL; ?>admin/assets/images/tutorial2.jpg" />
|
||||
|
||||
<h3><span>3</span> Add a background for the "After" view</h3>
|
||||
<img src="<?php echo RS_BEFOREAFTER_PLUGIN_URL; ?>admin/assets/images/tutorial3.jpg" />
|
||||
|
||||
<h3><span>4</span> <a href="<?php echo RS_BEFOREAFTER_PLUGIN_URL; ?>admin/assets/images/add-new-layer-1.jpg" target="_blank">Add a Layer</a> and designate it for the <a href="<?php echo RS_BEFOREAFTER_PLUGIN_URL; ?>admin/assets/images/layer_settings.jpg" target="_blank">"Before" or "After" view</a></h3>
|
||||
<a href="<?php echo RS_BEFOREAFTER_PLUGIN_URL; ?>admin/assets/images/layer_settings.jpg" target="_blank">
|
||||
<img src="<?php echo RS_BEFOREAFTER_PLUGIN_URL; ?>admin/assets/images/tutorial4.jpg" />
|
||||
</a>
|
||||
<br><br>
|
||||
<img src="<?php echo RS_BEFOREAFTER_PLUGIN_URL; ?>admin/assets/images/tutorial5.jpg" />
|
||||
|
||||
<h3><span>5</span> Toggle the Layers visibility between the "Before" & "After" views</h3>
|
||||
<img src="<?php echo RS_BEFOREAFTER_PLUGIN_URL; ?>admin/assets/images/tutorial6.jpg" />
|
||||
|
||||
<h3><span>6</span> Red represents a "Before" Layer, and Green is used for "After" Layers</h3>
|
||||
<img src="<?php echo RS_BEFOREAFTER_PLUGIN_URL; ?>admin/assets/images/tutorial7.jpg" />
|
||||
<br><br>
|
||||
<img src="<?php echo RS_BEFOREAFTER_PLUGIN_URL; ?>admin/assets/images/tutorial8.jpg" />
|
||||
<br><br>
|
||||
|
||||
</div>
|
||||
|
||||
<style type="text/css">
|
||||
|
||||
#rev_addon_beforeafter_settings_slideout a img {transition: opacity 0.2s ease}
|
||||
#rev_addon_beforeafter_settings_slideout a:hover img {opacity: 0.65}
|
||||
|
||||
</style>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,132 @@
|
||||
<?php
|
||||
/*
|
||||
* @author ThemePunch <info@themepunch.com>
|
||||
* @link https://www.themepunch.com/
|
||||
* @copyright 2017 ThemePunch
|
||||
*/
|
||||
|
||||
if(!defined('ABSPATH')) exit();
|
||||
|
||||
class RsAddOnBeforeAfterBase {
|
||||
|
||||
const MINIMUM_VERSION = '5.4.6';
|
||||
|
||||
protected function systemsCheck() {
|
||||
|
||||
if(!class_exists('RevSliderFront')) {
|
||||
|
||||
return 'add_notice_plugin';
|
||||
|
||||
}
|
||||
else if(!version_compare(RevSliderGlobals::SLIDER_REVISION, RsAddOnBeforeAfterBase::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 RevAddOnBeforeAfterUpdate(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');
|
||||
require_once(static::$_PluginPath . 'admin/includes/slide.settings.class.php');
|
||||
require_once(static::$_PluginPath . 'admin/includes/slide.layers.class.php');
|
||||
|
||||
// admin init
|
||||
new RsBeforeAfterSliderAdmin(static::$_PluginTitle, static::$_Version);
|
||||
new RsBeforeAfterSlideSettingsAdmin(static::$_PluginTitle, static::$_PluginPath);
|
||||
new RsBeforeAfterSlideLayersAdmin(static::$_PluginTitle, static::$_PluginPath);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
frontend scripts always enqueued for admin previews
|
||||
*/
|
||||
require_once(static::$_PluginPath . 'public/includes/slider.class.php');
|
||||
require_once(static::$_PluginPath . 'public/includes/slide.class.php');
|
||||
|
||||
new RsBeforeAfterSliderFront(static::$_Version, static::$_PluginUrl, static::$_PluginTitle, $isAdmin);
|
||||
new RsBeforeAfterSlideFront(static::$_PluginTitle);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 === 'toplevel_page_revslider' || $hook === 'slider-revolution_page_rev_addon') {
|
||||
|
||||
if(!isset($_GET['page'])) return;
|
||||
|
||||
$page = $_GET['page'];
|
||||
if($page !== 'revslider' && $page !== 'rev_addon') return;
|
||||
|
||||
$_handle = 'rs-' . static::$_PluginTitle . '-admin';
|
||||
$_base = static::$_PluginUrl . 'admin/assets/';
|
||||
|
||||
switch($page) {
|
||||
|
||||
case 'revslider':
|
||||
|
||||
if(isset($_GET['view']) && $_GET['view'] === 'slide' && isset($_GET['id']) && strpos($_GET['id'], 'static') === false) {
|
||||
|
||||
wp_enqueue_style($_handle, $_base . 'css/' . static::$_PluginTitle . '-slide-admin.css', array(), static::$_Version);
|
||||
wp_enqueue_script($_handle, $_base . 'js/' . static::$_PluginTitle . '-slide-admin.min.js', array('jquery'), static::$_Version, true);
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'rev_addon':
|
||||
|
||||
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);
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
/*
|
||||
* @author ThemePunch <info@themepunch.com>
|
||||
* @link https://www.themepunch.com/
|
||||
* @copyright 2017 ThemePunch
|
||||
*/
|
||||
|
||||
if(!defined('ABSPATH')) exit();
|
||||
|
||||
class RsAddOnBeforeAfterNotice {
|
||||
|
||||
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 ' . RsAddOnBeforeAfterBase::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,46 @@
|
||||
<?php
|
||||
/**
|
||||
* @author ThemePunch <info@themepunch.com>
|
||||
* @link https://www.themepunch.com/
|
||||
* @copyright 2017 ThemePunch
|
||||
*/
|
||||
|
||||
if( !defined( 'ABSPATH') ) exit();
|
||||
|
||||
class RsAddonBeforeAfterSlideLayersAdmin {
|
||||
|
||||
protected function init() {
|
||||
|
||||
add_filter('revslider_slide_addons', array($this, 'add_addon_settings'), 10, 3);
|
||||
|
||||
}
|
||||
|
||||
public function add_addon_settings($_settings, $_slide, $_slider){
|
||||
|
||||
if(isset($_GET['id']) && strpos($_GET['id'], 'static') === false) {
|
||||
|
||||
$_enabled = $_slider->getParam(static::$_Title . '_enabled', false) == 'true';
|
||||
$_enabled = $_enabled ? 'yes' : 'no';
|
||||
|
||||
// only add to slide editor if enabled from slider settings first
|
||||
if($_slider->getParam(static::$_Title . '_enabled', false) == 'true') {
|
||||
|
||||
static::_init($_slider, $_slide);
|
||||
|
||||
$_settings[static::$_Title] = array(
|
||||
|
||||
'title' => 'Before/After',
|
||||
'markup' => static::$_Markup,
|
||||
'javascript' => static::$_JavaScript
|
||||
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $_settings;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/**
|
||||
* @author ThemePunch <info@themepunch.com>
|
||||
* @link https://www.themepunch.com/
|
||||
* @copyright 2017 ThemePunch
|
||||
*/
|
||||
|
||||
if( !defined( 'ABSPATH') ) exit();
|
||||
|
||||
class RsAddonBeforeAfterSlideSettingsAdmin {
|
||||
|
||||
protected function init() {
|
||||
|
||||
add_filter('revslider_slide_settings_addons', array($this, 'add_addon_settings'), 10, 3);
|
||||
|
||||
}
|
||||
|
||||
public function add_addon_settings($_settings, $_slide, $_slider) {
|
||||
|
||||
// only add to slide editor if enabled from slider settings first
|
||||
if($_slider->getParam(static::$_Title . '_enabled', false) == 'true') {
|
||||
|
||||
static::_init($_slider, $_slide);
|
||||
|
||||
$_settings[static::$_Title] = array(
|
||||
|
||||
'title' => 'Before/After',
|
||||
'markup' => static::$_Markup,
|
||||
'javascript' => static::$_JavaScript
|
||||
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
return $_settings;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/*
|
||||
* @author ThemePunch <info@themepunch.com>
|
||||
* @link https://www.themepunch.com/
|
||||
* @copyright 2017 ThemePunch
|
||||
*/
|
||||
|
||||
if( !defined( 'ABSPATH') ) exit();
|
||||
|
||||
class RsAddonBeforeAfterSliderAdmin {
|
||||
|
||||
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' => 'Before/After',
|
||||
'icon' => static::$_Icon,
|
||||
'markup' => static::$_Markup,
|
||||
'javascript' => static::$_JavaScript
|
||||
|
||||
);
|
||||
|
||||
return $_settings;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,223 @@
|
||||
<?php
|
||||
/*
|
||||
* @author ThemePunch <info@themepunch.com>
|
||||
* @link https://www.themepunch.com/
|
||||
* @copyright 2017 ThemePunch
|
||||
*/
|
||||
|
||||
if( !defined( 'ABSPATH') ) exit();
|
||||
|
||||
class RsAddonBeforeAfterSliderFront {
|
||||
|
||||
protected function enqueueScripts() {
|
||||
|
||||
add_action('revslider_slide_initByData', array($this, 'enqueue_scripts'), 10, 1);
|
||||
|
||||
}
|
||||
|
||||
protected function enqueuePreview() {
|
||||
|
||||
add_action('revslider_preview_slider_head', array($this, 'enqueue_preview'));
|
||||
add_action('revslider_preview_slider_footer', array($this, 'enqueue_preview_footer'));
|
||||
|
||||
}
|
||||
|
||||
protected function writeInitScript() {
|
||||
|
||||
add_action('revslider_fe_javascript_output', array($this, 'write_init_script'), 10, 2);
|
||||
|
||||
}
|
||||
|
||||
public function enqueue_scripts() {
|
||||
|
||||
$ops = new RevSliderOperations();
|
||||
$globals = $ops->getGeneralSettingsValues();
|
||||
$_handle = 'rs-' . static::$_PluginTitle . '-front';
|
||||
$_base = static::$_PluginUrl . 'public/assets/';
|
||||
|
||||
wp_enqueue_style(
|
||||
|
||||
'rs-icon-set-fa-icon-', RS_PLUGIN_URL . 'public/assets/fonts/font-awesome/css/font-awesome.css',
|
||||
array(),
|
||||
RevSliderGlobals::SLIDER_REVISION
|
||||
|
||||
);
|
||||
|
||||
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
|
||||
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
public function enqueue_preview() {
|
||||
|
||||
$_base = static::$_PluginUrl . 'public/assets/';
|
||||
?>
|
||||
|
||||
<link type="text/css" rel="stylesheet" href="<?php echo RS_PLUGIN_URL . 'public/assets/fonts/font-awesome/css/font-awesome.css'; ?>" />
|
||||
<link type="text/css" rel="stylesheet" href="<?php echo $_base . 'css/revolution.addon.' . static::$_PluginTitle . '.css'; ?>" />
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
public function enqueue_preview_footer() {
|
||||
|
||||
$_base = static::$_PluginUrl . 'public/assets/';
|
||||
?>
|
||||
|
||||
<script type="text/javascript" src="<?php echo $_base . 'js/revolution.addon.' . static::$_PluginTitle . '.min.js'; ?>"></script>
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
public function write_init_script($_slider, $_id) {
|
||||
|
||||
// enabled from slider settings
|
||||
$_enabled = $_slider->getParam('beforeafter_enabled', false) == 'true';
|
||||
if(empty($_enabled)) return;
|
||||
|
||||
// check to see if at least one individual slide is enabled
|
||||
$_slides = $_slider->getSlides();
|
||||
foreach($_slides as $_slide) {
|
||||
|
||||
$_enabled = $_slide->getParam('beforeafter_enabled', false) == 'true';
|
||||
if(!empty($_enabled)) break;
|
||||
|
||||
}
|
||||
|
||||
if(!empty($_enabled)) {
|
||||
|
||||
$_id = $_slider->getID();
|
||||
$_cursor = $_slider->getParam('beforeafter_cursor', 'pointer');
|
||||
$_arrow_left = $_slider->getParam('beforeafter_left_arrow', 'fa-icon-caret-left');
|
||||
$_arrow_right = $_slider->getParam('beforeafter_right_arrow', 'fa-icon-caret-right');
|
||||
$_arrow_top = $_slider->getParam('beforeafter_top_arrow', 'fa-icon-caret-up');
|
||||
$_arrow_bottom = $_slider->getParam('beforeafter_bottom_arrow', 'fa-icon-caret-down');
|
||||
$_arrow_size = $_slider->getParam('beforeafter_arrow_size', '28');
|
||||
$_arrow_color = $_slider->getParam('beforeafter_arrow_color', '#ffffff');
|
||||
$_arrow_bg = $_slider->getParam('beforeafter_arrow_bg_color', 'transparent');
|
||||
$_arrow_padding = $_slider->getParam('beforeafter_arrow_padding', '0');
|
||||
$_arrow_spacing = $_slider->getParam('beforeafter_arrow_spacing', '3');
|
||||
$_arrow_radius = $_slider->getParam('beforeafter_arrow_radius', '0');
|
||||
$_divider_size = $_slider->getParam('beforeafter_divider_size', '1');
|
||||
$_divider_color = $_slider->getParam('beforeafter_divider_color', '#ffffff');
|
||||
$_arrow_shadow = $_slider->getParam('beforeafter_arrow_shadow', false) == 'true';
|
||||
$_divider_shadow = $_slider->getParam('beforeafter_divider_shadow', false) == 'true';
|
||||
$_arrow_border = $_slider->getParam('beforeafter_arrow_border', false) == 'true';
|
||||
$_box_shadow = $_slider->getParam('beforeafter_box_shadow', false) == 'true';
|
||||
$_onclick = $_slider->getParam('beforeafter_onclick', false) == 'true';
|
||||
$_carousel = $_slider->getParam('slider-type', 'standard') !== 'carousel' ? 'false' : 'true';
|
||||
|
||||
echo "\n";
|
||||
echo ' RevSliderBeforeAfter(tpj, revapi' . $_id . ', {' . "\n";
|
||||
echo ' arrowStyles: {' . "\n";
|
||||
echo ' leftIcon: "' . $_arrow_left . '",' . "\n";
|
||||
echo ' rightIcon: "' . $_arrow_right . '",' . "\n";
|
||||
echo ' topIcon: "' . $_arrow_top . '",' . "\n";
|
||||
echo ' bottomIcon: "' . $_arrow_bottom . '",' . "\n";
|
||||
echo ' size: "' . $_arrow_size . '",' . "\n";
|
||||
echo ' color: "' . $_arrow_color . '",' . "\n";
|
||||
echo ' bgColor: "' . $_arrow_bg . '",' . "\n";
|
||||
echo ' spacing: "' . $_arrow_spacing . '",' . "\n";
|
||||
echo ' padding: "' . $_arrow_padding . '",' . "\n";
|
||||
echo ' borderRadius: "' . $_arrow_radius . '"' . "\n";
|
||||
echo ' },' . "\n";
|
||||
echo ' dividerStyles: {' . "\n";
|
||||
echo ' width: "' . $_divider_size . '",' . "\n";
|
||||
echo ' color: "' . $_divider_color . '"' . "\n";
|
||||
echo ' }';
|
||||
|
||||
if(!empty($_arrow_shadow)) {
|
||||
|
||||
$_color = $_slider->getParam('beforeafter_arrow_shadow_color', 'rgba(0, 0, 0, 0.35)');
|
||||
$_blur = $_slider->getParam('beforeafter_arrow_shadow_blur', '10');
|
||||
|
||||
echo ',' . "\n";
|
||||
echo ' arrowShadow: {' . "\n";
|
||||
echo ' color: "' . $_color . '",' . "\n";
|
||||
echo ' blur: "' . $_blur . '"' . "\n";
|
||||
echo ' }';
|
||||
|
||||
}
|
||||
|
||||
if(!empty($_box_shadow)) {
|
||||
|
||||
$_strength = $_slider->getParam('beforeafter_box_shadow_strength', '3');
|
||||
$_color = $_slider->getParam('beforeafter_box_shadow_color', 'rgba(0, 0, 0, 0.35)');
|
||||
$_blur = $_slider->getParam('beforeafter_box_shadow_blur', '10');
|
||||
|
||||
echo ',' . "\n";
|
||||
echo ' boxShadow: {' . "\n";
|
||||
echo ' strength: "' . $_strength . '",' . "\n";
|
||||
echo ' color: "' . $_color . '",' . "\n";
|
||||
echo ' blur: "' . $_blur . '"' . "\n";
|
||||
echo ' }';
|
||||
|
||||
}
|
||||
|
||||
if(!empty($_arrow_border)) {
|
||||
|
||||
$_size = $_slider->getParam('beforeafter_arrow_border_size', '1');
|
||||
$_color = $_slider->getParam('beforeafter_arrow_border_color', '#000000');
|
||||
|
||||
echo ',' . "\n";
|
||||
echo ' arrowBorder: {' . "\n";
|
||||
echo ' size: "' . $_size . '",' . "\n";
|
||||
echo ' color: "' . $_color . '"' . "\n";
|
||||
echo ' }';
|
||||
|
||||
}
|
||||
|
||||
if(!empty($_divider_shadow)) {
|
||||
|
||||
$_strength = $_slider->getParam('beforeafter_divider_shadow_strength', '3');
|
||||
$_color = $_slider->getParam('beforeafter_divider_shadow_color', 'rgba(0, 0, 0, 0.35)');
|
||||
$_blur = $_slider->getParam('beforeafter_divider_shadow_blur', '10');
|
||||
|
||||
echo ',' . "\n";
|
||||
echo ' dividerShadow: {' . "\n";
|
||||
echo ' strength: "' . $_strength . '",' . "\n";
|
||||
echo ' color: "' . $_color . '",' . "\n";
|
||||
echo ' blur: "' . $_blur . '"' . "\n";
|
||||
echo ' }';
|
||||
|
||||
}
|
||||
|
||||
if(!empty($_onclick)) {
|
||||
|
||||
$_time = $_slider->getParam('beforeafter_click_time', '300');
|
||||
$_easing = $_slider->getParam('beforeafter_click_easing', 'Power2.easeOut');
|
||||
|
||||
echo ',' . "\n";
|
||||
echo ' onClick: {' . "\n";
|
||||
echo ' time: "' . $_time . '",' . "\n";
|
||||
echo ' easing: "' . $_easing . '",' . "\n";
|
||||
echo ' }';
|
||||
|
||||
}
|
||||
|
||||
echo ',' . "\n";
|
||||
echo ' cursor: "' . $_cursor . '",' . "\n";
|
||||
echo ' carousel: ' . $_carousel . "\n";
|
||||
echo ' });'."\n";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/*
|
||||
* @author ThemePunch <info@themepunch.com>
|
||||
* @link https://www.themepunch.com/
|
||||
* @copyright 2017 ThemePunch
|
||||
*/
|
||||
|
||||
if(!defined('ABSPATH')) exit();
|
||||
|
||||
require_once(RS_BEFOREAFTER_PLUGIN_PATH . 'framework/base.class.php');
|
||||
|
||||
class RsBeforeAfterBase extends RsAddOnBeforeAfterBase {
|
||||
|
||||
protected static $_PluginPath = RS_BEFOREAFTER_PLUGIN_PATH,
|
||||
$_PluginUrl = RS_BEFOREAFTER_PLUGIN_URL,
|
||||
$_PluginTitle = 'beforeafter',
|
||||
$_FilePath = __FILE__,
|
||||
$_Version = '1.0.3';
|
||||
|
||||
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_BEFOREAFTER_PLUGIN_PATH . 'framework/notices.class.php');
|
||||
|
||||
new RsAddOnBeforeAfterNotice($notice, static::$_PluginTitle);
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
parent::loadClasses();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,210 @@
|
||||
/*
|
||||
* @author ThemePunch <info@themepunch.com>
|
||||
* @link http://www.themepunch.com/
|
||||
* @copyright 2017 ThemePunch
|
||||
*/
|
||||
|
||||
.rs-before-after-addon {
|
||||
|
||||
overflow: hidden !important;
|
||||
|
||||
}
|
||||
|
||||
.rs-before-after-addon .tparrows {
|
||||
|
||||
z-index: 1000 !important;
|
||||
|
||||
}
|
||||
|
||||
.rs-addon-beforeafter-btn {
|
||||
|
||||
position: absolute;
|
||||
display: table;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
z-index: 102;
|
||||
|
||||
}
|
||||
|
||||
.rs-addon-beforeafter-btn i {
|
||||
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
position: relative;
|
||||
|
||||
}
|
||||
|
||||
.rs-beforeafter-shift-arrows .rs-addon-beforeafter-btn i {
|
||||
|
||||
-webkit-transform: translateX(0) !important;
|
||||
transform: translateX(0) !important;
|
||||
|
||||
}
|
||||
|
||||
.rs-addon-beforeafter-btn-vertical,
|
||||
.rs-addon-beforeafter-btn-vertical i {
|
||||
|
||||
display: block;
|
||||
|
||||
}
|
||||
|
||||
.rs-addon-beforeafter-line {
|
||||
|
||||
display: block;
|
||||
position: absolute;
|
||||
z-index: 102;
|
||||
|
||||
}
|
||||
|
||||
.rs-addon-beforeafter-line.rs-beforeafter-horizontal {
|
||||
|
||||
top: 0;
|
||||
height: 100%;
|
||||
|
||||
}
|
||||
|
||||
.rs-addon-beforeafter-line.rs-beforeafter-vertical {
|
||||
|
||||
left: 0;
|
||||
width: 100%;
|
||||
|
||||
}
|
||||
|
||||
.rs-before-after-element {
|
||||
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
|
||||
}
|
||||
|
||||
.rs-before-after-element,
|
||||
.rs-before-after-element:before {
|
||||
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
user-select: none;
|
||||
|
||||
}
|
||||
|
||||
.rs-addon-beforeafter-bg {
|
||||
|
||||
opacity: 0;
|
||||
z-index: 999;
|
||||
|
||||
}
|
||||
|
||||
.rs-addon-beforeafter-bg,
|
||||
.rs-addon-beforeafter-revealer,
|
||||
.rs-addon-beforeafter-revealer .tp-loop-wrap {
|
||||
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
}
|
||||
|
||||
.rs-addon-beforeafter-bg,
|
||||
.rs-addon-beforeafter-revealer {
|
||||
|
||||
position: absolute;
|
||||
overflow: hidden;
|
||||
|
||||
}
|
||||
|
||||
.rs-addon-beforeafter-before {
|
||||
|
||||
top: 0;
|
||||
left: 0;
|
||||
|
||||
}
|
||||
|
||||
.rs-addon-beforeafter-horizontal .rs-addon-beforeafter-bg,
|
||||
.rs-addon-beforeafter-horizontal .rs-addon-beforeafter-after {
|
||||
|
||||
top: 0;
|
||||
right: 0;
|
||||
|
||||
}
|
||||
|
||||
.rs-addon-beforeafter-vertical .rs-addon-beforeafter-bg,
|
||||
.rs-addon-beforeafter-vertical .rs-addon-beforeafter-after {
|
||||
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
|
||||
}
|
||||
|
||||
.rs-addon-beforeafter-bg,
|
||||
.rs-addon-beforeafter-after {
|
||||
|
||||
opacity: 0;
|
||||
|
||||
}
|
||||
|
||||
.rs-addon-beforeafter-inner,
|
||||
.rs-addon-beforeafter-bg-inner {
|
||||
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
}
|
||||
|
||||
.rs-addon-beforeafter-horizontal .rs-addon-beforeafter-inner,
|
||||
.rs-addon-beforeafter-horizontal .rs-addon-beforeafter-bg-inner {
|
||||
|
||||
right: 0;
|
||||
top: 0;
|
||||
|
||||
}
|
||||
|
||||
.rs-addon-beforeafter-vertical .rs-addon-beforeafter-inner,
|
||||
.rs-addon-beforeafter-vertical .rs-addon-beforeafter-bg-inner {
|
||||
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
|
||||
}
|
||||
|
||||
.rs-video-beforeafter,
|
||||
.rs-video-beforeafter .tp-mask-wrap {
|
||||
|
||||
width: 100% !important;
|
||||
height: 100% !important;
|
||||
|
||||
}
|
||||
|
||||
.rs-before-after-addon:not(.before-after-carousel).dragging,
|
||||
.rs-before-after-addon:not(.before-after-carousel).dragging *,
|
||||
.rs-before-after-addon:not(.before-after-carousel).dragging .rs-addon-beforeafter-btn i:before {
|
||||
|
||||
-webkit-user-select: none !important;
|
||||
-moz-user-select: none !important;
|
||||
user-select: none !important;
|
||||
|
||||
}
|
||||
|
||||
.rs-beforeafter-pointers,
|
||||
.rs-beforeafter-pointers .rs-addon-beforeafter-inner {
|
||||
|
||||
pointer-events: none;
|
||||
|
||||
}
|
||||
|
||||
.rs-beforeafter-pointers *:not(.rs-addon-beforeafter-inner) {
|
||||
|
||||
pointer-events: auto;
|
||||
|
||||
}
|
||||
|
||||
.rs-beforeafter-pointers .rs-video-beforeafter,
|
||||
.rs-beforeafter-pointers .rs-video-beforeafter * {
|
||||
|
||||
pointer-events: none;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,212 @@
|
||||
<?php
|
||||
/**
|
||||
* @author ThemePunch <info@themepunch.com>
|
||||
* @link https://www.themepunch.com/
|
||||
* @copyright 2017 ThemePunch
|
||||
*/
|
||||
|
||||
if( !defined( 'ABSPATH') ) exit();
|
||||
|
||||
class RsBeforeAfterSlideFront {
|
||||
|
||||
private $title;
|
||||
|
||||
public function __construct($_title) {
|
||||
|
||||
$this->title = $_title;
|
||||
add_action('revslider_add_li_data', array($this, 'write_slide_attributes'), 10, 3);
|
||||
add_action('revslider_add_layer_attributes', array($this, 'write_layer_attributes'), 10, 3);
|
||||
|
||||
}
|
||||
|
||||
public function write_layer_attributes($_layer, $_slide, $_slider) {
|
||||
|
||||
// check if enabled from slider
|
||||
$_enabled = $_slider->getParam('beforeafter_enabled', false) == 'true';
|
||||
if(empty($_enabled)) return;
|
||||
|
||||
// check if enabled for slide
|
||||
$_enabled = $_slide->getParam('beforeafter_enabled', false) == 'true';
|
||||
if(!empty($_enabled)) {
|
||||
|
||||
$_position = RevSliderFunctions::getVal($_layer, 'beforeafter', array('position' => 'before'));
|
||||
$_position = RevSliderFunctions::getVal($_position, 'position', 'before');
|
||||
|
||||
echo ' data-beforeafter="' . $_position . '" ' . "\n";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function write_slide_attributes($_slider, $_slide) {
|
||||
|
||||
// check if enabled from slider
|
||||
$_enabled = $_slider->getParam('beforeafter_enabled', false) == 'true';
|
||||
if(empty($_enabled)) return;
|
||||
|
||||
// check if enabled for slide
|
||||
$_enabled = $_slide->getParam('beforeafter_enabled', false) == 'true';
|
||||
if(!empty($_enabled)) {
|
||||
|
||||
$_options = json_decode(stripslashes($_slide->getParam('beforeafter_globals', '')), true);
|
||||
$_bgColor = 'transparent';
|
||||
|
||||
if(class_exists('TPColorpicker')) {
|
||||
|
||||
$_bgColor = $_slide->getParam('bg_color_beforeafter', 'transparent');
|
||||
$_bgColor = TPColorpicker::get($_bgColor);
|
||||
|
||||
}
|
||||
|
||||
$_imageUrl = '';
|
||||
$_bgType = $_slide->getParam('background_type_beforeafter', 'trans');
|
||||
$_bgFit = $_slide->getParam('bg_fit_beforeafter', 'cover');
|
||||
$_bgPos = $_slide->getParam('bg_position_beforeafter', 'center center');
|
||||
$_filter = $_slide->getParam('media-filter-type', 'none');
|
||||
$_bounce = $_slide->getParam('beforeafter_bouncearrows', 'none');
|
||||
$_shift = $_slide->getParam('beforeafter_shiftarrows', false) == 'true' ? true : false;
|
||||
|
||||
if($_bgType === 'image') {
|
||||
|
||||
$_imageUrl = $_slide->getParam('image_url_beforeafter', '');
|
||||
$_imageId = $_slide->getParam('image_id_beforeafter', '');
|
||||
|
||||
if(!empty($_imageId)) {
|
||||
|
||||
$_imageSize = $_slide->getParam('image_source_type_beforeafter', '');
|
||||
if(!empty($_imageSize)) {
|
||||
|
||||
$_img = wp_get_attachment_image_src($_imageId, $_imageSize);
|
||||
if(!empty($_img)) $_imageUrl = $_img[0];
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else if($_bgType === 'external') {
|
||||
|
||||
$_imageUrl = $_slide->getParam('bg_external_beforeafter', '');
|
||||
|
||||
}
|
||||
|
||||
$_settings = array(
|
||||
|
||||
'bgColor' => $_bgColor,
|
||||
'bgType' => $_bgType,
|
||||
'bgImage' => $_imageUrl,
|
||||
'bgFit' => $_bgFit,
|
||||
'bgPos' => $_bgPos,
|
||||
'bgRepeat' => $_slide->getParam('bg_repeat_beforeafter', 'no-repeat'),
|
||||
'direction' => $_slide->getParam('beforeafter_direction', 'horizontal'),
|
||||
'easing' => $_slide->getParam('beforeafter_easing', 'Power2.easeInOut'),
|
||||
'delay' => $_slide->getParam('beforeafter_delay', '500'),
|
||||
'time' => $_slide->getParam('beforeafter_time', '750'),
|
||||
'out' => $_slide->getParam('beforeafter_animateout', 'fade'),
|
||||
'carousel' => $_slider->getParam('slider-type', 'standard') !== 'carousel' ? false : true
|
||||
|
||||
);
|
||||
|
||||
if($_bgFit === 'percentage') {
|
||||
|
||||
$_x = $_slide->getParam('bg_fit_x_beforeafter', '100');
|
||||
$_y = $_slide->getParam('bg_fit_y_beforeafter', '100');
|
||||
$_settings['bgFit'] = $_x . '% ' . $_y . '%';
|
||||
|
||||
}
|
||||
|
||||
if($_bgPos === 'percentage') {
|
||||
|
||||
$_x = $_slide->getParam('bg_position_x_beforeafter', '0');
|
||||
$_y = $_slide->getParam('bg_position_y_beforeafter', '0');
|
||||
$_settings['bgPos'] = $_x . '% ' . $_y . '%';
|
||||
|
||||
}
|
||||
|
||||
if($_filter !== 'none') $_settings['filter'] = $_filter;
|
||||
if($_bounce !== 'none') {
|
||||
|
||||
$_settings['bounceArrows'] = $_bounce;
|
||||
$_settings['bounceType'] = $_slide->getParam('beforeafter_bouncetype', 'repel');
|
||||
$_settings['bounceAmount'] = $_slide->getParam('beforeafter_bounceamount', '10');
|
||||
$_settings['bounceSpeed'] = $_slide->getParam('beforeafter_bouncespeed', '1000');
|
||||
$_settings['bounceEasing'] = $_slide->getParam('beforeafter_bounceeasing', 'ease-in-out');
|
||||
$_settings['bounceDelay'] = $_slide->getParam('beforeafter_bouncedelay', '0');
|
||||
|
||||
}
|
||||
|
||||
if(!empty($_shift)) {
|
||||
|
||||
$_offset = $_slide->getParam('beforeafter_shiftoffset', '10');
|
||||
if(intval($_offset) > 0) {
|
||||
|
||||
$_settings['shiftOffset'] = $_offset;
|
||||
$_settings['shiftTiming'] = $_slide->getParam('beforeafter_shifttiming', '300');
|
||||
$_settings['shiftEasing'] = $_slide->getParam('beforeafter_shifteasing', 'ease');
|
||||
$_settings['shiftDelay'] = $_slide->getParam('beforeafter_shiftdelay', '0');
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(preg_match('/youtube|vimeo|html5/', $_bgType)) {
|
||||
|
||||
$_muteVideo = $_slide->getParam('video_mute_beforeafter', true) == 'true' ? true : false;
|
||||
$_settings['muteVideo'] = $_muteVideo;
|
||||
$_settings['forceCover'] = $_slide->getParam('video_force_cover_beforeafter', true) == 'true' ? true : false;
|
||||
$_settings['rewindOnStart'] = $_slide->getParam('video_force_rewind_beforeafter', true) == 'true' ? true : false;
|
||||
$_settings['nextSlideOnEnd'] = $_slide->getParam('video_nextslide_beforeafter', false) == 'true' ? true : false;
|
||||
$_settings['dottedOverlay'] = $_slide->getParam('video_dotted_overlay_beforeafter', 'none');
|
||||
$_settings['aspectRatio'] = $_slide->getParam('video_ratio_beforeafter', '16:9');
|
||||
$_settings['videoStartAt'] = $_slide->getParam('video_start_at_beforeafter', '');
|
||||
$_settings['videoEndAt'] = $_slide->getParam('video_end_at_beforeafter', '');
|
||||
$_settings['loopVideo'] = $_slide->getParam('video_loop_beforeafter', 'none');
|
||||
|
||||
switch($_bgType) {
|
||||
|
||||
case 'html5':
|
||||
|
||||
$_settings['videoMpeg'] = $_slide->getParam('bg_mpeg_beforeafter', '');
|
||||
$_settings['videoWebm'] = $_slide->getParam('bg_webm_beforeafter', '');
|
||||
$_settings['videoOgv'] = $_slide->getParam('bg_ogv_beforeafter', '');
|
||||
|
||||
break;
|
||||
|
||||
case 'youtube':
|
||||
|
||||
$_videoVolume = $_slide->getParam('video_volume_beforeafter', '');
|
||||
|
||||
$_settings['videoId'] = $_slide->getParam('bg_youtube_beforeafter', '');
|
||||
$_settings['videoSpeed'] = $_slide->getParam('video_speed_beforeafter', '1');
|
||||
$_settings['videoVolume'] = $_videoVolume;
|
||||
|
||||
$_args = $_slide->getParam('video_arguments_beforeafter', 'hd=1&wmode=opaque&showinfo=0&rel=0;');
|
||||
$_baseArgs = 'version=3&enablejsapi=1&html5=1&';
|
||||
if(empty($_muteVideo) && !empty($_videoVolume)) $_baseArgs .= 'volume=' . $_videoVolume . '&';
|
||||
|
||||
$_setBase = is_ssl() ? 'https://' : 'http://';
|
||||
$_origin = ';origin=' . $_setBase . $_SERVER['SERVER_NAME'] . ';';
|
||||
$_settings['youtubeArgs'] = $_baseArgs . $_args . $_origin;
|
||||
|
||||
break;
|
||||
|
||||
case 'vimeo':
|
||||
|
||||
$_settings['videoId'] = $_slide->getParam('bg_vimeo_beforeafter', '');
|
||||
$_settings['videoVolume'] = $_slide->getParam('video_volume_beforeafter', '');
|
||||
$_settings['vimeoArgs'] = $_slide->getParam('video_arguments_vim_beforeafter', 'title=0&byline=0&portrait=0&api=1');
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$_options = array_merge($_options, $_settings);
|
||||
echo " data-beforeafter='" . json_encode($_options) . "'";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/*
|
||||
* @author ThemePunch <info@themepunch.com>
|
||||
* @link https://www.themepunch.com/
|
||||
* @copyright 2017 ThemePunch
|
||||
*/
|
||||
|
||||
if( !defined( 'ABSPATH') ) exit();
|
||||
|
||||
require_once(RS_BEFOREAFTER_PLUGIN_PATH . 'framework/slider.front.class.php');
|
||||
|
||||
class RsBeforeAfterSliderFront extends RsAddonBeforeAfterSliderFront {
|
||||
|
||||
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,17 @@
|
||||
<div class="slider-revolution-update-list">
|
||||
|
||||
<h3 class="version-number">Version 1.0.2 (16th 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 (11th May 2017)</h3>
|
||||
|
||||
<div class="change"><strong style="font-weight:700">CHANGES</strong></div>
|
||||
<ul>
|
||||
<li>Added option to toggle background image views for slide admin</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
/*
|
||||
Plugin Name: Slider Revolution Before/After Add-On
|
||||
Plugin URI: https://www.themepunch.com/
|
||||
Description: Create Before/After content for your Slides
|
||||
Author: ThemePunch
|
||||
Version: 1.0.3
|
||||
Author URI: http://themepunch.com
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
SCRIPT HANDLES:
|
||||
|
||||
'rs-beforeafter-admin'
|
||||
'rs-beforeafter-front'
|
||||
|
||||
*/
|
||||
|
||||
// If this file is called directly, abort.
|
||||
if(!defined('WPINC')) die;
|
||||
|
||||
define('RS_BEFOREAFTER_PLUGIN_PATH', plugin_dir_path(__FILE__));
|
||||
define('RS_BEFOREAFTER_PLUGIN_URL', str_replace('index.php', '', plugins_url( 'index.php', __FILE__)));
|
||||
|
||||
require_once(RS_BEFOREAFTER_PLUGIN_PATH . 'includes/base.class.php');
|
||||
|
||||
if(is_admin()) {
|
||||
|
||||
add_filter('revslider_exportSlider_usedMedia', array('RsBeforeAfterSliderAdmin', 'export_slider'), 10, 4);
|
||||
add_filter('revslider_importSliderFromPost_modify_data', array('RsBeforeAfterSliderAdmin', 'import_slider'), 10, 3);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* handle everyting by calling the following function *
|
||||
**/
|
||||
function rs_beforeafter_init(){
|
||||
|
||||
new RsBeforeAfterBase();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* call all needed functions on plugins loaded *
|
||||
**/
|
||||
add_action('plugins_loaded', 'rs_beforeafter_init');
|
||||
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* @author ThemePunch <info@themepunch.com>
|
||||
* @link http://www.themepunch.com/
|
||||
* @copyright 2017 ThemePunch
|
||||
*/
|
||||
|
||||
#rev_addon_filmstrip_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_filmstrip_settings_slideout h3 {
|
||||
|
||||
font-size: 17px;
|
||||
text-align: center;
|
||||
|
||||
}
|
||||
|
||||
#rev_addon_filmstrip_settings_slideout .featuretext {
|
||||
|
||||
margin-top: 10px;
|
||||
|
||||
}
|
||||
|
||||
#rev_addon_filmstrip_settings_slideout .documentation {
|
||||
|
||||
text-align: center;
|
||||
margin-bottom: 20px;
|
||||
|
||||
}
|
||||
|
||||
#rev_addon_filmstrip_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_filmstrip_settings_slideout .documentation a:hover {
|
||||
|
||||
opacity: 0.75;
|
||||
|
||||
}
|
||||
|
||||
#rev_addon_filmstrip_settings_slideout img {
|
||||
|
||||
box-shadow: 0 0 0 5px #FFF;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,288 @@
|
||||
#rs-addon-settings-trigger-filmstrip {
|
||||
|
||||
border-radius: 0px;
|
||||
padding: 0px;
|
||||
color: transparent;
|
||||
background: url(../images/addon_filmstrip.png);
|
||||
background-size: 126px 54px;
|
||||
background-position: top center;
|
||||
width: 126px;
|
||||
height: 27px;
|
||||
|
||||
}
|
||||
|
||||
#rs-addon-settings-trigger-filmstrip.selected,
|
||||
#rs-addon-settings-trigger-filmstrip:hover {
|
||||
|
||||
background-position: bottom center;
|
||||
|
||||
}
|
||||
|
||||
#filmstrip-addon-enable {min-width: 83px}
|
||||
.filmstrip-item-options {display: none}
|
||||
.filmstrip-item-options:first-child {display: block}
|
||||
|
||||
#filmstrip-addon-wrap label {
|
||||
|
||||
font-size: 13px;
|
||||
min-width: 0;
|
||||
margin-right: 20px;
|
||||
cursor: auto;
|
||||
|
||||
}
|
||||
|
||||
.filmstrip-addon-settings i {
|
||||
|
||||
vertical-align: top;
|
||||
margin-top: 1px;
|
||||
|
||||
}
|
||||
|
||||
#filmstrip-main-settings {
|
||||
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
|
||||
}
|
||||
|
||||
#filmstrip-item-settings {position: relative}
|
||||
#filmstrip-main-settings:after,
|
||||
#filmstrip-item-settings:after {
|
||||
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
content: "";
|
||||
z-index: 99;
|
||||
margin: 1px 0 -2px 0;
|
||||
background-color: rgba(255, 255, 255, 0.5);
|
||||
|
||||
}
|
||||
|
||||
.filmstrip-addon-toggle #filmstrip-main-settings:after,
|
||||
#filmstrip-item-settings.filmstrip-has-item:after {display: none}
|
||||
|
||||
|
||||
.filmstrip-addon-toggle #ken_burn_example_wrapper:after {
|
||||
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: -70px;
|
||||
width: 100%;
|
||||
font-size: 13px;
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
color: #c0392b;
|
||||
content: "Ken Burns is not compatible with FilmStrip Add-On";
|
||||
|
||||
}
|
||||
|
||||
.filmstrip-speed-inputs label {margin-right: 15px}
|
||||
|
||||
.filmstrip-device-icon {
|
||||
|
||||
height: 30px;
|
||||
margin-right: 5px;
|
||||
display: inline-block;
|
||||
background-position: right center;
|
||||
background-repeat: no-repeat;
|
||||
|
||||
}
|
||||
|
||||
.filmstrip-device-desktop {
|
||||
|
||||
background-image: url(../images/icon-mode-desktop-dark.png);
|
||||
background-size: 22px 20px;
|
||||
width: 24px;
|
||||
|
||||
}
|
||||
|
||||
.filmstrip-device-notebook {
|
||||
|
||||
background-image: url(../images/icon-mode-laptop-dark.png);
|
||||
background-size: 24px 16px;
|
||||
width: 26px;
|
||||
|
||||
}
|
||||
|
||||
.filmstrip-device-tablet {
|
||||
|
||||
background-image: url(../images/icon-mode-tablet-dark.png);
|
||||
background-size: 18px 24px;
|
||||
width: 20px;
|
||||
|
||||
}
|
||||
|
||||
.filmstrip-device-mobile {
|
||||
|
||||
background-image: url(../images/icon-mode-phone-dark.png);
|
||||
background-size: 14px 22px;
|
||||
width: 16px;
|
||||
|
||||
}
|
||||
|
||||
#filmstrip-addon-wrap select {
|
||||
|
||||
width: 155px;
|
||||
min-width: 155px;
|
||||
margin-right: 0;
|
||||
|
||||
}
|
||||
|
||||
#filmstrip-addon-wrap .filmstrip-option-custom {margin-left: 10px; margin-right: 0}
|
||||
|
||||
#filmstrip-toggle-settings {
|
||||
|
||||
vertical-align: top;
|
||||
line-height: 30px;
|
||||
padding: 5px 13px 7px;
|
||||
cursor: pointer;
|
||||
|
||||
}
|
||||
|
||||
#filmstrip-toggle-settings i {display: block; height: 30px}
|
||||
#filmstrip-item-settings,
|
||||
#filmstrip_external_image {display: none}
|
||||
#filmstrip_external_url {width: 100%}
|
||||
|
||||
.filmstrip-toggle-active {
|
||||
|
||||
background: #3498db;
|
||||
line-height: 25px !important;
|
||||
|
||||
}
|
||||
|
||||
.filmstrip-toggle-active i {transform: rotate(180deg)}
|
||||
.filmstrip-toggle-active i:before {color: #FFF !important}
|
||||
|
||||
#filmstrip-addon-wrap .filmstrip-speed {
|
||||
|
||||
width: 45px !important;
|
||||
min-width: 45px;
|
||||
margin-right: 15px;
|
||||
|
||||
}
|
||||
|
||||
#filmstrip-addon-wrap .inp-deep-prebutton {
|
||||
|
||||
margin: 0 0 0 -5px;
|
||||
white-space: nowrap;
|
||||
|
||||
}
|
||||
|
||||
#filmstrip-addon-wrap .inp-deep-list {
|
||||
|
||||
width: auto;
|
||||
padding-right: 0;
|
||||
|
||||
}
|
||||
|
||||
#filmstrip-addon-content {
|
||||
|
||||
padding: 15px;
|
||||
|
||||
}
|
||||
|
||||
.filmstrip-divider {
|
||||
|
||||
border-top: 1px solid #ddd;
|
||||
|
||||
}
|
||||
|
||||
.filmstrip-item {cursor: pointer}
|
||||
|
||||
.filmstrip-item,
|
||||
#filmstrip-add-new {
|
||||
|
||||
margin-right: 5px;
|
||||
margin-bottom: 5px;
|
||||
border: 5px solid transparent;
|
||||
position: relative;
|
||||
line-height: 0;
|
||||
float: left;
|
||||
|
||||
}
|
||||
|
||||
.filmstrip-item-selected {
|
||||
|
||||
border: 5px solid #3498db;
|
||||
cursor: auto;
|
||||
|
||||
}
|
||||
|
||||
.filmstrip-item img {
|
||||
|
||||
width: auto;
|
||||
height: 85px;
|
||||
min-width: 50px;
|
||||
background: url(../images/trans_tile.png);
|
||||
|
||||
}
|
||||
|
||||
.filmstrip-item-toolbar {
|
||||
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
display: none;
|
||||
|
||||
}
|
||||
|
||||
.filmstrip-delete-item,
|
||||
.filmstrip-edit-settings {
|
||||
|
||||
padding: 5px 3px;
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
|
||||
}
|
||||
|
||||
.filmstrip-edit-settings {background: #000}
|
||||
.filmstrip-edit-settings:hover {background: #333}
|
||||
.filmstrip-item-selected .filmstrip-item-toolbar,
|
||||
.filmstrip-item:hover .filmstrip-item-toolbar {display: block}
|
||||
.filmstrip-item-toolbar i:before {color: #FFF !important}
|
||||
|
||||
#filmstrip-add-new {
|
||||
|
||||
width: 118px;
|
||||
height: 85px;
|
||||
border: 1px dashed #ddd;
|
||||
padding: 4px;
|
||||
display: table;
|
||||
margin-left: 5px;
|
||||
margin-bottom: 10px;
|
||||
|
||||
}
|
||||
|
||||
#filmstrip-add-new div {
|
||||
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
|
||||
}
|
||||
|
||||
.filmstrip-add-button {display: table-cell}
|
||||
.filmstrip-add-selections {display: none}
|
||||
#filmstrip-add-new:hover .filmstrip-add-button {display: none}
|
||||
#filmstrip-add-new:hover .filmstrip-add-selections {display: table-cell}
|
||||
|
||||
#filmstrip-add-new span {
|
||||
|
||||
margin: 2px;
|
||||
padding: 2px;
|
||||
font-size: 25px;
|
||||
cursor: pointer;
|
||||
|
||||
}
|
||||
|
||||
#filmstrip_addon_wpimage {color: #3498db}
|
||||
#filmstrip_addon_wpimage:hover {color: #2980b9}
|
||||
#filmstrip_addon_objlib {color: #9b59b6}
|
||||
#filmstrip_addon_objlib:hover {color: #8e44ad}
|
||||
#filmstrip-add-new span:hover {opacity: 0.65}
|
||||
#filmstrip-add-new .eg-icon-plus {font-size: 25px}
|
||||
|
After Width: | Height: | Size: 4.0 KiB |
|
After Width: | Height: | Size: 154 B |
|
After Width: | Height: | Size: 131 B |
|
After Width: | Height: | Size: 145 B |
|
After Width: | Height: | Size: 151 B |
|
After Width: | Height: | Size: 85 B |
|
After Width: | Height: | Size: 39 KiB |