khaihihi
This commit is contained in:
6
wp-content/plugins/revslider/admin/assets/js/modules/admin.min.js
vendored
Normal file
6
wp-content/plugins/revslider/admin/assets/js/modules/admin.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
60
wp-content/plugins/revslider/admin/assets/js/modules/editor.min.js
vendored
Normal file
60
wp-content/plugins/revslider/admin/assets/js/modules/editor.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
6
wp-content/plugins/revslider/admin/assets/js/modules/overview.min.js
vendored
Normal file
6
wp-content/plugins/revslider/admin/assets/js/modules/overview.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
515
wp-content/plugins/revslider/admin/assets/js/modules/tooltip.js
Normal file
515
wp-content/plugins/revslider/admin/assets/js/modules/tooltip.js
Normal file
@@ -0,0 +1,515 @@
|
||||
/*!
|
||||
|
||||
// ****************************
|
||||
// ********** USAGE **********
|
||||
// ****************************
|
||||
RsTooltips(
|
||||
|
||||
true, // initialize the tooltip mode?
|
||||
['add_layer', 'change_slides'] // array of tooltips to show and in what order
|
||||
|
||||
);
|
||||
|
||||
*/
|
||||
|
||||
(function() {
|
||||
|
||||
|
||||
|
||||
var data,
|
||||
shell,
|
||||
bodies,
|
||||
tipList,
|
||||
toolTip,
|
||||
tipText,
|
||||
section,
|
||||
linkButton,
|
||||
totalSteps,
|
||||
currentTip,
|
||||
currentStep,
|
||||
currentData,
|
||||
currentTarget,
|
||||
toolTipWidth,
|
||||
rightToolbar;
|
||||
|
||||
|
||||
var defaults = [
|
||||
|
||||
'back',
|
||||
'slides',
|
||||
'add_slide',
|
||||
'global_layers',
|
||||
'slide_order',
|
||||
'add_layer',
|
||||
'add_layer_text',
|
||||
'add_layer_image',
|
||||
'add_layer_button',
|
||||
'add_layer_shape',
|
||||
'add_layer_video',
|
||||
'add_layer_audio',
|
||||
'add_layer_object',
|
||||
'add_layer_row',
|
||||
'add_layer_group',
|
||||
'add_layer_layerlibrary',
|
||||
'add_layer_importlayer',
|
||||
'edit_layer_name',
|
||||
'duplicate_layer',
|
||||
'copy_layer',
|
||||
'paste_layer',
|
||||
'delete_layer',
|
||||
'lock_layers',
|
||||
'unlock_layers',
|
||||
'hide_highlight_boxes',
|
||||
'show_hide_selected',
|
||||
'set_all_visible',
|
||||
'change_layer_order',
|
||||
'layer_selections',
|
||||
'undo_redo',
|
||||
'device_switcher',
|
||||
'help_mode',
|
||||
'tooltip_button',
|
||||
'quick_style',
|
||||
'slider_settings',
|
||||
'slider_navigation',
|
||||
'slide_settings',
|
||||
'layer_settings',
|
||||
'shortcode',
|
||||
'layout_type',
|
||||
'layout_sizing',
|
||||
'breakpoints',
|
||||
'module_content',
|
||||
'auto_rotate',
|
||||
'lazy_loading',
|
||||
'progress_bar',
|
||||
'navigation_arrows',
|
||||
'navigation_bullets',
|
||||
'navigation_tabs',
|
||||
'navigation_thumbs',
|
||||
'slide_background',
|
||||
'slide_animation',
|
||||
'background_filter',
|
||||
'slide_duration',
|
||||
'slide_link',
|
||||
'edit_text',
|
||||
'font_size',
|
||||
'font_family',
|
||||
'font_color',
|
||||
'layer_position',
|
||||
'layer_animations',
|
||||
'layer_hover',
|
||||
'responsive_behavior',
|
||||
'timeline_preview',
|
||||
'save_module',
|
||||
'preview_module'
|
||||
|
||||
];
|
||||
|
||||
function getData() {
|
||||
|
||||
jQuery('<link rel="stylesheet" type="text/css" href="' + RVS.ENV.plugin_url + 'admin/assets/css/tooltip.css" />').appendTo(jQuery('head'));
|
||||
RVS.F.ajaxRequest('get_tooltips', {}, function(response) {
|
||||
|
||||
if(response.success) {
|
||||
|
||||
try {
|
||||
data = JSON.stringify(response.data);
|
||||
data = JSON.parse(data);
|
||||
}
|
||||
catch(e) {
|
||||
data = false;
|
||||
}
|
||||
|
||||
if(data) init();
|
||||
else console.log('tooltip ajax error');
|
||||
|
||||
}
|
||||
else {
|
||||
console.log('tooltip ajax error');
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function clonePreviewSave() {
|
||||
|
||||
jQuery(this).clone().addClass('tooltip-save-preview').insertAfter(toolTip);
|
||||
|
||||
}
|
||||
|
||||
function openToolTips() {
|
||||
|
||||
jQuery(shell).appendTo(jQuery('#rb_tlw'));
|
||||
jQuery('.rs-tooltip-btn').not('.tooltip-link').on('click.tooltips', btnClick);
|
||||
jQuery('.rs-tooltip-check').on('click.tooltips', cancelTips);
|
||||
jQuery('#rs-tooltip-close').on('click.tooltips', exitTips);
|
||||
|
||||
toolTip = jQuery('#rs-tooltip');
|
||||
tipText = jQuery('.tooltip-text');
|
||||
section = jQuery('.tooltip-section');
|
||||
|
||||
toolTipWidth = toolTip.outerWidth();
|
||||
linkButton = jQuery('.tooltip-link').on('click.tooltips', openLink);
|
||||
|
||||
rightToolbar = jQuery('#the_right_toolbar_inner');
|
||||
tipList = window.RsTooltipList || defaults;
|
||||
totalSteps = tipList.length;
|
||||
currentStep = 0;
|
||||
|
||||
bodies = jQuery('body');
|
||||
RVS.WIN.on('keydown.tooltips', keyShortcut).on('resize.tooltips', runStep);
|
||||
jQuery('.rs-save-preview').each(clonePreviewSave);
|
||||
|
||||
runStep();
|
||||
|
||||
}
|
||||
|
||||
function openLink() {
|
||||
|
||||
window.open(this.dataset.href);
|
||||
|
||||
}
|
||||
|
||||
function closeToolTips() {
|
||||
|
||||
jQuery('.tooltip-hide-target').removeClass('tooltip-hide-target');
|
||||
jQuery('.tip-clone').remove();
|
||||
|
||||
jQuery('.rs-tooltip-btn').off('.tooltips');
|
||||
jQuery('.rs-tooltip-check').off('.tooltips');
|
||||
jQuery('#rs-tooltip-close').off('.tooltips');
|
||||
|
||||
jQuery('#rs-tooltip').remove();
|
||||
jQuery('.tooltip-save-preview').remove();
|
||||
|
||||
jQuery('body').removeClass('rb-tooltips-active');
|
||||
RVS.WIN.off('.tooltips');
|
||||
|
||||
linkButton.off('.tooltips');
|
||||
|
||||
bodies = null;
|
||||
toolTip = null;
|
||||
tipText = null;
|
||||
section = null;
|
||||
currentTip = null;
|
||||
linkButton = null;
|
||||
rightToolbar = null;
|
||||
currentTarget = null;
|
||||
|
||||
}
|
||||
|
||||
function cleanup() {
|
||||
|
||||
cancelAnimationFrame(displayStep);
|
||||
|
||||
}
|
||||
|
||||
function exitTips() {
|
||||
|
||||
cleanup();
|
||||
closeToolTips();
|
||||
|
||||
}
|
||||
|
||||
function cancelTips() {
|
||||
|
||||
RVS.F.ajaxRequest('set_tooltip_preference', false, false, true, true);
|
||||
exitTips();
|
||||
|
||||
}
|
||||
|
||||
function btnClick() {
|
||||
|
||||
if(this.id === 'rs-tooltip-next') {
|
||||
currentStep++;
|
||||
runStep();
|
||||
}
|
||||
else {
|
||||
exitTips();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function nextButton() {
|
||||
|
||||
var btn = jQuery('#rs-tooltip-next');
|
||||
if(!btn.is(':visible')) btn = jQuery('#rs-tooltip-gotit');
|
||||
btn.click();
|
||||
|
||||
}
|
||||
|
||||
function runStep() {
|
||||
|
||||
cleanup();
|
||||
currentTip = currentData.tooltips[tipList[currentStep]];
|
||||
tipText.html(currentTip.text);
|
||||
|
||||
/*
|
||||
if(currentTip.section) section.html(currentTip.section).show();
|
||||
else section.hide();
|
||||
*/
|
||||
|
||||
/*
|
||||
if(currentTip.link) linkButton.attr('data-href', currentTip.link).text(currentTip.linkText).show();
|
||||
else linkButton.hide();
|
||||
*/
|
||||
|
||||
if(currentStep < totalSteps - 1) toolTip.removeClass('tooltip-gotit');
|
||||
else toolTip.addClass('tooltip-gotit');
|
||||
|
||||
if(currentTip.trigger) {
|
||||
|
||||
let triggers = currentTip.trigger,
|
||||
len = triggers.length;
|
||||
|
||||
for(let i = 0; i < len; i++) {
|
||||
|
||||
let trigger = jQuery(triggers[i]);
|
||||
if(trigger.length) {
|
||||
|
||||
jQuery(trigger).first().click();
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
console.log('tooltip trigger does not exist');
|
||||
nextButton();
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
currentTarget = jQuery(currentTip.target).first();
|
||||
if(!currentTarget.length) {
|
||||
|
||||
console.log('tooltip target does not exist');
|
||||
nextButton();
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
rightToolbar.scrollTop(0);
|
||||
if(currentTip.scrollTo) {
|
||||
|
||||
let scrollTo = jQuery(currentTip.scrollTo).filter(':visible');
|
||||
rightToolbar.scrollTop(scrollTo.offset().top - 50);
|
||||
requestAnimationFrame(displayStep);
|
||||
|
||||
}
|
||||
|
||||
requestAnimationFrame(displayStep);
|
||||
|
||||
}
|
||||
|
||||
function displayStep() {
|
||||
|
||||
jQuery('.tooltip-hide-target').removeClass('tooltip-hide-target');
|
||||
jQuery('.tip-clone').remove();
|
||||
|
||||
var offset = currentTarget.offset(),
|
||||
position,
|
||||
placer;
|
||||
|
||||
toolTip.removeClass(function(i, clas) {return (clas.match (/(^|\s)tip-\S+/g) || []).join(' ');});
|
||||
toolTip.addClass('tip-' + currentTip.alignment);
|
||||
|
||||
if(currentTip.margin) toolTip.css('margin', currentTip.margin);
|
||||
else toolTip.css('margin', 0);
|
||||
|
||||
var padding = currentTarget.css('padding'),
|
||||
paddingLeft = Math.round(parseInt(currentTarget.css('padding-left'), 10) * 0.25);
|
||||
cloned = currentTarget.clone();
|
||||
|
||||
cloned.find('input[type="radio"]').each(function() {this.name = this.name + '-tooltip';});
|
||||
cloned.addClass('tip-clone').css({top: offset.top, left: offset.left, padding: padding}).insertBefore(toolTip);
|
||||
|
||||
if(currentTip.cssClass) cloned.addClass(currentTip.cssClass);
|
||||
if(currentTip.elementcss) {
|
||||
|
||||
let css = currentTip.elementcss.split(';'),
|
||||
len = css.length;
|
||||
|
||||
for(let i = 0; i < len; i++) {
|
||||
|
||||
let style = css[i].split(':');
|
||||
cloned.css(jQuery.trim(style[0]), jQuery.trim(style[1]));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(currentTip.placer) {
|
||||
|
||||
placer = jQuery(currentTip.placer).first();
|
||||
if(placer.length) {
|
||||
|
||||
offset = placer.offset();
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
console.log('tooltip placer does not exist');
|
||||
nextButton();
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var noFocus = currentTip.focus === 'none';
|
||||
if(!currentTip.focus || noFocus) {
|
||||
|
||||
if(!noFocus) cloned.addClass('tip-focussed');
|
||||
if(!placer) placer = currentTarget;
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
let clas = currentTip.focusClass || 'tip-focussed';
|
||||
focussed = cloned.find(currentTip.focus).first().addClass(clas);
|
||||
|
||||
if(!focussed.length) {
|
||||
|
||||
console.log('tooltip focus does not exist');
|
||||
nextButton();
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
if(!placer) {
|
||||
placer = focussed;
|
||||
offset = placer.offset();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
position = getPosition(placer, currentTip.alignment);
|
||||
toolTip.css({left: offset.left + position.x - paddingLeft, top: offset.top + position.y});
|
||||
|
||||
currentTarget.addClass('tooltip-hide-target');
|
||||
bodies.addClass('rb-tooltips-active');
|
||||
|
||||
if(!currentTip.hidePrevSave) bodies.removeClass('tooltip-hide-preview-save');
|
||||
else bodies.addClass('tooltip-hide-preview-save');
|
||||
|
||||
}
|
||||
|
||||
function getPosition(target, align) {
|
||||
|
||||
var xx,
|
||||
yy;
|
||||
|
||||
switch(align) {
|
||||
|
||||
case 'top':
|
||||
case 'bottom':
|
||||
xx = (Math.round(target.outerWidth() * 0.5) - Math.round(toolTipWidth * 0.5));
|
||||
break;
|
||||
|
||||
case 'left':
|
||||
case 'right':
|
||||
yy = -(Math.round(toolTip.outerHeight() * 0.5) - Math.round(target.outerHeight() * 0.5));
|
||||
break;
|
||||
|
||||
case 'bottom-left':
|
||||
case 'top-left':
|
||||
case 'right-top':
|
||||
xx = -toolTip.width();
|
||||
break;
|
||||
|
||||
case 'bottom-right':
|
||||
case 'top-right':
|
||||
xx = target.outerWidth();
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
switch(align) {
|
||||
|
||||
case 'top':
|
||||
case 'right-top':
|
||||
yy = -(target.outerHeight() + toolTip.height());
|
||||
break;
|
||||
|
||||
case 'top-left':
|
||||
case 'top-right':
|
||||
yy = 0;
|
||||
break;
|
||||
|
||||
case 'bottom':
|
||||
case 'bottom-left':
|
||||
case 'bottom-right':
|
||||
yy = target.outerHeight();
|
||||
break;
|
||||
|
||||
case 'left':
|
||||
xx = -toolTipWidth;
|
||||
break;
|
||||
|
||||
case 'right':
|
||||
xx = target.outerWidth();
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
return {x: xx, y: yy};
|
||||
|
||||
}
|
||||
|
||||
function keyShortcut(e) {
|
||||
|
||||
if(e.keyCode === 13) nextButton();
|
||||
|
||||
}
|
||||
|
||||
function init() {
|
||||
|
||||
currentData = jQuery.extend(true, {}, data);
|
||||
shell =
|
||||
|
||||
'<div id="rs-tooltip">' +
|
||||
'<div id="rs-tooltip-top">' +
|
||||
'<span class="rs-tooltip-text"><span class="tooltip-section"></span><span class="tooltip-text"></span></span>' +
|
||||
'<span class="rs-tooltip-btn tooltip-link" data-href="tooltip-link"></span><span id="rs-tooltip-next" class="rs-tooltip-btn"><i class="material-icons">redo</i>' + currentData.translations.next_tip + '<span class="rs-tooltip-return-icon"></span></span><span id="rs-tooltip-gotit" class="rs-tooltip-btn"><i class="material-icons">thumb_up</i>' + currentData.translations.got_it +'</span>' +
|
||||
'</div>' +
|
||||
'<div id="rs-tooltip-bottom"><div><span class="rs-tooltip-check"></span>' + currentData.translations.hide_tips + '</div></div>' +
|
||||
'<span id="rs-tooltip-close"><i class="material-icons">close</i></span>' +
|
||||
'</div>';
|
||||
|
||||
var btn = jQuery('.tooltip_wrap'),
|
||||
defs = btn.data('tooltip-definitions');
|
||||
|
||||
if(defs) {
|
||||
|
||||
jQuery.extend(true, currentData.tooltips, defs);
|
||||
btn.removeData('tooltip-definitions');
|
||||
|
||||
}
|
||||
|
||||
jQuery(document).on('start-tooltips', openToolTips);
|
||||
btn.data('scriptready', true);
|
||||
openToolTips();
|
||||
|
||||
}
|
||||
|
||||
getData();
|
||||
|
||||
})();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,189 @@
|
||||
var PennerEasing = {
|
||||
|
||||
linear: {
|
||||
|
||||
easenone: function(t, b, c, d) {
|
||||
|
||||
return c * t / d + b;
|
||||
|
||||
},
|
||||
|
||||
easein: function(t, b, c, d) {
|
||||
|
||||
return c * t / d + b;
|
||||
|
||||
},
|
||||
|
||||
easeout: function(t, b, c, d) {
|
||||
|
||||
return c * t / d + b;
|
||||
|
||||
},
|
||||
|
||||
easeinout: function(t, b, c, d) {
|
||||
|
||||
return c * t / d + b;
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
quint: {
|
||||
|
||||
easeout: function (t, b, c, d) {
|
||||
|
||||
return c * ((t = t / d - 1) * t * t * t * t + 1) + b;
|
||||
|
||||
},
|
||||
|
||||
easein: function(t, b, c, d) {
|
||||
|
||||
return c * (t /= d) * t * t * t * t + b;
|
||||
|
||||
},
|
||||
|
||||
easeinout: function(t, b, c, d) {
|
||||
|
||||
return ((t /= d / 2) < 1) ? c / 2 * t * t * t * t * t + b : c / 2 * ((t -= 2) * t * t * t * t + 2) + b;
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
quad: {
|
||||
|
||||
easein: function (t, b, c, d) {
|
||||
|
||||
return c * (t /= d) * t + b;
|
||||
|
||||
},
|
||||
|
||||
easeout: function (t, b, c, d) {
|
||||
|
||||
return -c * (t /= d) * (t - 2) + b;
|
||||
|
||||
},
|
||||
|
||||
easeinout: function (t, b, c, d) {
|
||||
|
||||
return ((t /= d / 2) < 1) ? c / 2 * t * t + b : -c / 2 * ((--t) * (t - 2) - 1) + b;
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
quart: {
|
||||
|
||||
easein: function(t, b, c, d) {
|
||||
|
||||
return c * (t /= d) * t * t * t + b;
|
||||
|
||||
},
|
||||
|
||||
easeout: function(t, b, c, d) {
|
||||
|
||||
return -c * ((t = t / d - 1) * t * t * t - 1) + b;
|
||||
|
||||
},
|
||||
|
||||
easeinout: function(t, b, c, d) {
|
||||
|
||||
return ((t /= d / 2) < 1) ? c / 2 * t * t * t * t + b : -c / 2 * ((t -= 2) * t * t * t - 2) + b;
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
cubic: {
|
||||
|
||||
easein: function(t, b, c, d) {
|
||||
|
||||
return c * (t /= d) * t * t + b;
|
||||
|
||||
},
|
||||
|
||||
easeout: function(t, b, c, d) {
|
||||
|
||||
return c * ((t = t / d - 1) * t * t + 1) + b;
|
||||
|
||||
},
|
||||
|
||||
easeinout: function(t, b, c, d) {
|
||||
|
||||
return ((t /= d / 2) < 1) ? c / 2 * t * t * t + b : c / 2 * ((t -= 2) * t * t + 2) + b;
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
circ: {
|
||||
|
||||
easein: function(t, b, c, d) {
|
||||
|
||||
return -c * (Math.sqrt(1 - (t /= d) * t) - 1) + b;
|
||||
|
||||
},
|
||||
|
||||
easeout: function(t, b, c, d) {
|
||||
|
||||
return c * Math.sqrt(1 - (t = t / d - 1) * t) + b;
|
||||
|
||||
},
|
||||
|
||||
easeinout: function(t, b, c, d) {
|
||||
|
||||
return ((t /= d / 2) < 1) ? -c / 2 * (Math.sqrt(1 - t * t) - 1) + b : c / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + b;
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
sine: {
|
||||
|
||||
easein: function(t, b, c, d) {
|
||||
|
||||
return -c * Math.cos(t / d * (Math.PI / 2)) + c + b;
|
||||
|
||||
},
|
||||
|
||||
easeout: function(t, b, c, d) {
|
||||
|
||||
return c * Math.sin(t / d * (Math.PI / 2)) + b;
|
||||
|
||||
},
|
||||
|
||||
easeinout: function(t, b, c, d) {
|
||||
|
||||
return -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b;
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
expo: {
|
||||
|
||||
easein: function(t, b, c, d) {
|
||||
|
||||
return (t === 0) ? b : c * Math.pow(2, 10 * (t / d - 1)) + b;
|
||||
|
||||
},
|
||||
|
||||
easeout: function(t, b, c, d) {
|
||||
|
||||
return (t === d) ? b + c : c * (-Math.pow(2, -10 * t / d) + 1) + b;
|
||||
|
||||
},
|
||||
|
||||
easeinout: function(t, b, c, d) {
|
||||
|
||||
if(t === 0) return b;
|
||||
if(t === d) return b + c;
|
||||
if((t /= d / 2) < 1) return c / 2 * Math.pow(2, 10 * (t - 1)) + b;
|
||||
|
||||
return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
19
wp-content/plugins/revslider/admin/assets/js/plugins/utils.min.js
vendored
Normal file
19
wp-content/plugins/revslider/admin/assets/js/plugins/utils.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,580 @@
|
||||
/*!
|
||||
* REVOLUTION 6.1.6
|
||||
* @version: 1.0 (29.11.2019)
|
||||
* @author ThemePunch
|
||||
*/
|
||||
|
||||
/**********************************
|
||||
- GLOBAL VARIABLES -
|
||||
**********************************/
|
||||
;window.RVS = window.RVS === undefined ? {} : window.RVS;
|
||||
RVS.F = RVS.F === undefined ? {} : RVS.F;
|
||||
RVS.ENV = RVS.ENV === undefined ? {} : RVS.ENV;
|
||||
RVS.LIB = RVS.LIB === undefined ? {} : RVS.LIB;
|
||||
RVS.V = RVS.V === undefined ? {} : RVS.V;
|
||||
RVS.S = RVS.S === undefined ? {} : RVS.S;
|
||||
RVS.C = RVS.C === undefined ? {} : RVS.C;
|
||||
RVS.WIN = RVS.WIN === undefined ? jQuery(window) : RVS.WIN;
|
||||
RVS.DOC = RVS.DOC === undefined ? jQuery(document) : RVS.DOC;
|
||||
RVS.OZ = RVS.OZ === undefined ? {} : RVS.OZ;
|
||||
RVS.SC = RVS.SC === undefined ? {} : RVS.SC;
|
||||
|
||||
(function() {
|
||||
RVS.V.sizes = RVS.V.sizes==undefined ? ["d","n","t","m"] : RVS.V.sizes;
|
||||
RVS.V.dirs = RVS.V.dirs==undefined ? ["top","bottom","left","right"] : RVS.V.dirs;
|
||||
RVS.V.dirN = RVS.V.dirN==undefined ? {t:"top",b:"bottom",l:"left",r:"right"} : RVS.V.dirN;
|
||||
/*
|
||||
DEFINE SHORTCODE FUNCTIONS
|
||||
*/
|
||||
RVS.SC = RS_SC_WIZARD = {
|
||||
|
||||
/*
|
||||
INITIALISE SHORTCODE MANAGER
|
||||
*/
|
||||
init : function() {
|
||||
if(typeof QTags !== 'undefined') {
|
||||
var add_rs_button = true;
|
||||
if(typeof edButtons !== 'undefined')
|
||||
for(var key in edButtons) {
|
||||
if(!edButtons.hasOwnProperty(key) || add_rs_button===false) continue;
|
||||
if(edButtons[key].id == 'slider-revolution') add_rs_button = false;
|
||||
}
|
||||
|
||||
if(add_rs_button) QTags.addButton('slider-revolution', 'Slider Revolution', function() {RVS.SC.openTemplateLibrary('qtags');});
|
||||
}
|
||||
|
||||
if(typeof RVS.LIB.OBJ !== 'undefined' && RVS.LIB.OBJ && RVS.LIB.OBJ.items && RVS.LIB.OBJ.items.length) RVS.SC.defaultAlias = RVS.LIB.OBJ.items[0].alias;
|
||||
|
||||
// INIT HOOKS AND GET EDITOR TYPE
|
||||
elementorHooks();
|
||||
vcHooks();
|
||||
shortCodeListener();
|
||||
},
|
||||
|
||||
/*
|
||||
PARSE SHORTCODE
|
||||
*/
|
||||
parseShortCode : function(e){
|
||||
if (e===undefined) return;
|
||||
var t,T,E,a=/(\s+|\W)|(\w+)/g,s="",n="NOT STARTED",r={name:"",attributes:{},content:""},i=(e.match(/\]/g)||[]).length;if(2<i)throw'invalid shortCode: match more then 2 tokens "]". Use only shortcode with this function. Example "[name]teste[/name]" or "[name prop=value]"';for(i=1!==i;null!=(t=a.exec(e))&&(T=t[0],"COMPLETE"!==n);)switch(n){case"NOT STARTED":"["==T&&(n="GETNAME");break;case"GETNAME":/\s/.test(T)?r.name&&(n="PARSING"):/\]/.test(T)?n="GETCONTENT":r.name+=T;break;case"GETCONTENT":/\[/.test(T)?r.name&&(n="COMPLETE"):r.content+=T;break;case"PARSING":if("]"==T)n=1===i?"COMPLETE":"GETCONTENT";else if("="==T){if(!s)throw'invalid token: "'+T+'" encountered at '+t.index;n="GET ATTRIBUTE VALUE"}else/\s/.test(T)?s&&(n="SET ATTRIBUTE"):s+=T;break;case"SET ATTRIBUTE":if(/\s/.test(T))r.attributes[s]=null;else{if("="!=T)throw'invalid token: "'+T+'" encountered at '+t.index;n="GET ATTRIBUTE VALUE"}break;case"GET ATTRIBUTE VALUE":/\s/.test(T)||(n=/["']/.test(T)?(E=T,r.attributes[s]="","GET QUOTED ATTRIBUTE VALUE"):(r.attributes[s]=T,s="","PARSING"));break;case"GET QUOTED ATTRIBUTE VALUE":/\\/.test(T)?n="ESCAPE VALUE":T==E?(n="PARSING",s=""):r.attributes[s]+=T;break;case"ESCAPE VALUE":/\\'"/.test(T)?r.attributes[s]+=T:r.attributes[s]+="\\"+T,n="GET QUOTED ATTRIBUTE VALUE"}return s&&!r.attributes[s]&&(r.attributes[s]=""),r
|
||||
},
|
||||
|
||||
/*
|
||||
RETURN SHORTCODE TO BLOCK OBJECT
|
||||
*/
|
||||
scToBlock : function(sc) {
|
||||
var parsed = RVS.SC.parseShortCode(sc);
|
||||
var atts = parsed===undefined ? {} : parsed.attributes,
|
||||
block = newBlock(atts.alias),
|
||||
a,i,j,v,m;
|
||||
// MANAGE OFFSETS
|
||||
if (atts.offset!==undefined) {
|
||||
a = atts.offset.split(';');
|
||||
for (i in a) {
|
||||
v = a[i].split(":");
|
||||
if (v[0]!=="" && v[1]!==undefined) {
|
||||
m = v[1].split(",");
|
||||
for (j in m) {
|
||||
block.offset[RVS.V.sizes[j]][RVS.V.dirN[v[0]]] = m[j];
|
||||
block.offset[RVS.V.sizes[j]]["use"] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// POP UP CHECK
|
||||
if (atts.usage && atts.usage==="modal") {
|
||||
block.usage = "modal";
|
||||
block.modal = true;
|
||||
if (atts.modal!==undefined) {
|
||||
a = atts.modal.split(";");
|
||||
for (i in a) {
|
||||
v = a[i].split(":");
|
||||
switch(v[0]) {
|
||||
case "t":block.popup.time.use = true;block.popup.time.v = v[1];break;
|
||||
case "s":block.popup.scroll.use = true; block.popup.scroll.type="container"; block.popup.scroll.container = v[1]; break;
|
||||
case "so":block.popup.scroll.use = true; block.popup.scroll.type="offset"; block.popup.scroll.v = v[1]; break;
|
||||
case "e":block.popup.event.use = true; block.popup.event.v = v[1]; break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// MANAGE ZINDEX && LAYOUT
|
||||
if (atts.zindex!==undefined) block.zindex = atts.zindex;
|
||||
if (atts.layout!==undefined) block.layout = atts.layout;
|
||||
if (atts.slidertitle!==undefined) block.slidertitle = atts.slidertitle;
|
||||
else if (atts.sliderTitle!==undefined) block.slidertitle = atts.sliderTitle;
|
||||
else if (atts.title!==undefined) block.slidertitle = atts.title;
|
||||
return block;
|
||||
},
|
||||
|
||||
|
||||
|
||||
updateBlockViews : function(show) {
|
||||
if (show===true) jQuery('.rs_optimizer_button_wrapper').closest('.components-panel__body').addClass("rs_component_panel"); else jQuery('.rs_component_panel').removeClass("rs_component_panel");
|
||||
},
|
||||
|
||||
buildShortCode : function() {
|
||||
RVS.SC.BLOCK.content = '[rev_slider alias="' + RVS.SC.BLOCK.alias + '"';
|
||||
RVS.SC.BLOCK.content += ' slidertitle="'+RVS.SC.BLOCK.slidertitle+'"';
|
||||
if (RVS.ENV.activated!==false) updateInherits(true);
|
||||
var popup = '', usage ='';
|
||||
if (RVS.SC.BLOCK.modal===true) {
|
||||
usage = 'modal';
|
||||
RVS.SC.BLOCK.content += ' usage="'+usage+'"';
|
||||
if (RVS.SC.BLOCK.popup!==undefined && RVS.ENV.activated!==false) {
|
||||
if (RVS.SC.BLOCK.popup.time!==undefined && RVS.SC.BLOCK.popup.time.use) popup += 't:'+RVS.SC.BLOCK.popup.time.v+";";
|
||||
if (RVS.SC.BLOCK.popup.scroll!==undefined && RVS.SC.BLOCK.popup.scroll.use) if(RVS.SC.BLOCK.popup.scroll.type==="offset") popup += 'so:'+RVS.SC.BLOCK.popup.scroll.v+";"; else popup += 's:'+RVS.SC.BLOCK.popup.scroll.container+";";
|
||||
if (RVS.SC.BLOCK.popup.event!==undefined && RVS.SC.BLOCK.popup.event.use) popup += 'e:'+RVS.SC.BLOCK.popup.event.v+";";
|
||||
if (popup!=='') RVS.SC.BLOCK.content +=' modal="'+popup+'"';
|
||||
}
|
||||
} else {
|
||||
if (RVS.ENV.activated!==false) {
|
||||
if (RVS.SC.BLOCK.offsettext!==undefined && RVS.SC.BLOCK.offsettext.length>0) RVS.SC.BLOCK.content +=' offset="'+RVS.SC.BLOCK.offsettext+'"'; else RVS.SC.BLOCK.offsettext="";
|
||||
if (RVS.SC.BLOCK.zindex!==undefined && RVS.SC.BLOCK.zindex!=="" && RVS.SC.BLOCK.zindex!==0) RVS.SC.BLOCK.content += ' zindex="'+RVS.SC.BLOCK.zindex+'"';
|
||||
}
|
||||
}
|
||||
if (RVS.ENV.activated!==false && RVS.SC.BLOCK.layout !== RVS.SC.BLOCK.origlayout) RVS.SC.BLOCK.content += ' layout="'+RVS.SC.BLOCK.layout+'"';
|
||||
|
||||
RVS.SC.BLOCK.content += '][/rev_slider]';
|
||||
delete RVS.SC.BLOCK.text;
|
||||
return {popup:popup, usage:usage};
|
||||
},
|
||||
|
||||
updateShortCode : function() {
|
||||
if (RVS!==undefined && RVS.SC!==undefined && RVS.SC.suppress) return;
|
||||
var SC = RVS.SC.buildShortCode();
|
||||
switch(RVS.SC.type) {
|
||||
case 'wpbackery':
|
||||
var temp = jQuery.extend(true,{},RVS.SC.BLOCK);
|
||||
if (SC.usage==="modal") {
|
||||
temp.usage = SC.usage; temp.modal = SC.popup;delete temp.offset;delete temp.zimdex;
|
||||
} else {
|
||||
if (temp.offsettext!=="") temp.offset = RVS.SC.BLOCK.offsettext; else delete temp.offset;
|
||||
delete temp.usage; delete temp.modal;
|
||||
}
|
||||
|
||||
if (temp.layout===temp.origlayout) delete temp.layout;
|
||||
delete temp.offsettext; delete temp.origlayout; delete temp.content; delete temp.popup;
|
||||
RVS.SC.VC.model.save('params', temp);
|
||||
break;
|
||||
|
||||
case 'tinymce':
|
||||
tinyMCE.activeEditor.selection.setContent(RVS.SC.BLOCK.content);
|
||||
break;
|
||||
|
||||
case 'elementor':
|
||||
RVS.SC.suppress = true;
|
||||
RVS.SC.EL.model.setSetting('revslidertitle', RVS.SC.BLOCK.slidertitle);
|
||||
RVS.SC.EL.model.setSetting('shortcode', RVS.SC.BLOCK.content);
|
||||
RVS.SC.EL.control.find('input[data-setting="shortcode"]').trigger('input');
|
||||
setTimeout(function() {RVS.SC.suppress = false;}, 500);
|
||||
break;
|
||||
case 'qtags':
|
||||
QTags.insertContent(RVS.SC.BLOCK.content);
|
||||
break;
|
||||
case 'gutenberg':
|
||||
var obj = {slidertitle: RVS.SC.BLOCK.slidertitle, alias: RVS.SC.BLOCK.alias, modal: RVS.SC.BLOCK.modal , content: RVS.SC.BLOCK.content , zindex: RVS.SC.BLOCK.zindex};
|
||||
revslider_react.setState(obj);
|
||||
revslider_react.props.setAttributes(obj);
|
||||
revslider_react.forceUpdate();
|
||||
break;
|
||||
default:break;
|
||||
}
|
||||
},
|
||||
|
||||
openTemplateLibrary: function(type) {
|
||||
// 5.0 to 6.0 update patch
|
||||
if(typeof RVS.LIB.OBJ === 'undefined') return;
|
||||
|
||||
RVS.SC.type = type;
|
||||
if(!RVS.SC.libraryInited) {
|
||||
RVS.SC.libraryInited = true;
|
||||
RVS.F.initObjectLibrary(true);
|
||||
RVS.F.initOnOff(jQuery('#obj_addsliderasmodal').css('display', 'inline-block'));
|
||||
|
||||
|
||||
jQuery('body').on('change', '#sel_olibrary_sorting', function() {
|
||||
jQuery('#reset_objsorting').css((this.value === 'datedesc' ? {display: 'none'} : {display: 'inline-block', opacity: '1', visibility: 'visible'} ));
|
||||
if(this.dataset.evt!==undefined) RVS.DOC.trigger(this.dataset.evt, this.dataset.evtparam);
|
||||
}).on('change', '#ol_pagination', function(e) {
|
||||
if(this.dataset.evt!==undefined) RVS.DOC.trigger(this.dataset.evt,[e, this.value, this.dataset.evtparam]);
|
||||
});
|
||||
}
|
||||
|
||||
var successObj = {modules: 'addRevSliderShortcode', event: 'selectRevSliderItem'};
|
||||
jQuery('#obj_addsliderasmodal .tponoffwrap').addClass('off').find('input').removeAttr('checked').prop('checked', false);
|
||||
RVS.F.openObjectLibrary({types: ['modules'], filter: 'all', selected: ['modules'], success: successObj});
|
||||
|
||||
var folder = RVS.F.getCookie('rs6_wizard_folder');
|
||||
if(folder && folder !== -1 && folder !== '-1' && ((RVS.LIB.OBJ !==undefined && RVS.LIB.OBJ.items!==undefined && RVS.LIB.OBJ.items.modules!==undefined))) RVS.F.changeOLIBToFolder(folder);
|
||||
|
||||
},
|
||||
|
||||
openBlockSettings : function(type,sc){
|
||||
if (RVS.ENV.activated!==true) RVS.F.showRegisterSliderInfo();
|
||||
if (sc===undefined && RVS.SC.BLOCK===undefined) return;
|
||||
RVS.SC.BLOCK = sc!==undefined ? RVS.SC.scToBlock(sc) : RVS.SC.BLOCK===undefined || RVS.SC.BLOCK.text===undefined ? RVS.SC.scToBlock(RVS.SC.BLOCK.content) : RVS.SC.scToBlock(RVS.SC.BLOCK.text);
|
||||
|
||||
if (RVS!==undefined && RVS.SC!==undefined && RVS.SC.BLOCK!==undefined && RVS.SC.BLOCK.alias.length>0) {
|
||||
RVS.SC.type = type;
|
||||
//Ajax Call to get the original Layout
|
||||
RVS.F.ajaxRequest('getSliderSizeLayout', { alias : RVS.SC.BLOCK.alias }, function(response) {
|
||||
|
||||
if(response.success) {
|
||||
if (response!==undefined && response.layout!==undefined) {
|
||||
response.layout = response.layout===undefined || response.layout==="" ? "auto" : response.layout;
|
||||
RVS.SC.BLOCK.origlayout = response.layout;
|
||||
RVS.SC.BLOCK.slidertitle = response.slidertitle!==undefined ? response.slidertitle : response.sliderTitle!==undefined ? response.sliderTitle : response.title!==undefined ? response.title : RVS.SC.BLOCK.slidertitle;
|
||||
if(typeof RVS.SC.BLOCK.layout === "undefined" || RVS.SC.BLOCK.layout==="") RVS.SC.BLOCK.layout = RVS.SC.BLOCK.origlayout;
|
||||
}
|
||||
RVS.F.showWaitAMinute({fadeIn:0,text:RVS_LANG.loadingcontent});
|
||||
RVS.F.initOnOff(jQuery('#rbm_blocksettings'));
|
||||
RVS.F.RSDialog.create({modalid:'#rbm_blocksettings', bgopacity:0.5});
|
||||
jQuery('#rbm_blocksettings').RSScroll({wheelPropagation:false, suppressScrollX:true});
|
||||
RVS.F.RSDialog.center();
|
||||
jQuery('#rbm_blocksettings .origlayout').hide();
|
||||
jQuery('#rbm_blocksettings .origlayout.origlayout_'+RVS.SC.BLOCK.origlayout).show();
|
||||
|
||||
if (RVS.SC.type==="wpbackery") {
|
||||
setTimeout(RVS.F.RSDialog.center,19);
|
||||
setTimeout(RVS.F.RSDialog.center,50);
|
||||
}
|
||||
blockSettingsUpdate();
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
openSliderEditor : function(alias) { if (alias!==undefined && alias.length>0) window.open(RVS.ENV.admin_url+"&view=slide&alias="+alias);},
|
||||
openOptimizer : function(alias){ if (alias!==undefined && alias.length>0) RVS.F.openOptimizer({alias:alias});}
|
||||
};
|
||||
|
||||
// INITIALISE PROCESSES
|
||||
jQuery(document).ready(function() { RVS.SC.init(); });
|
||||
|
||||
function updateInherits(novisual) {
|
||||
if (RVS==undefined || RVS.SC.BLOCK==undefined || RVS.SC.BLOCK.offset===undefined) return;
|
||||
var inh = {top:0, bottom:0, left:0, right:0},val,s,d,txt='',com,nxt;
|
||||
for (var j in RVS.V.dirs) {
|
||||
d = RVS.V.dirs[j];
|
||||
com = false;
|
||||
txt += RVS.V.dirs[j][0]+":";
|
||||
for (var i in RVS.V.sizes) {
|
||||
s = RVS.V.sizes[i];
|
||||
nxt = (s=="d" && (RVS.SC.BLOCK.offset.d.use || RVS.SC.BLOCK.offset.n.use || RVS.SC.BLOCK.offset.t.use || RVS.SC.BLOCK.offset.n.use)) || (s=="n" && (RVS.SC.BLOCK.offset.n.use || RVS.SC.BLOCK.offset.t.use || RVS.SC.BLOCK.offset.n.use)) || (s=="t" && (RVS.SC.BLOCK.offset.t.use || RVS.SC.BLOCK.offset.m.use)) || (s=="m" && RVS.SC.BLOCK.offset.m.use);
|
||||
if (com && nxt) txt +=',';
|
||||
com = true;
|
||||
if (novisual!==true) {
|
||||
var inp = jQuery("#rbm_blocksettings .scblockinput[data-r='offset."+s+"."+d+"']");
|
||||
if (inp[0]===undefined) continue;
|
||||
inp[0].dataset.s = s;
|
||||
}
|
||||
if (RVS.SC.BLOCK.offset[s].use) {
|
||||
inh[d] = val = RVS.SC.BLOCK.offset[s][d];
|
||||
if (novisual!==true) inp[0].style.opacity = 1;
|
||||
} else {
|
||||
val = inh[d];
|
||||
if (novisual!==true) inp[0].style.opacity = 0.5;
|
||||
}
|
||||
if (novisual!==true) inp[0].value = val;
|
||||
if (nxt) txt +=val; else com = false;
|
||||
}
|
||||
txt +=';'
|
||||
}
|
||||
if (txt==="t:;b:;l:;r:;") txt="";
|
||||
RVS.SC.BLOCK.offsettext = txt;
|
||||
}
|
||||
|
||||
function newBlock(alias) {
|
||||
alias = alias===undefined ? "" : alias;
|
||||
return new Object({
|
||||
alias:alias,
|
||||
zindex:0,
|
||||
popup: { time : {use:false, v:2000},
|
||||
scroll : {use:false, type:"offset", v:2000,container:""},
|
||||
event : {use:false, v:"popup_"+alias}},
|
||||
offset: { d : {top:"0px", bottom:"0px", left:"0px", right:"0px" ,use:false},
|
||||
n : {top:"0px", bottom:"0px", left:"0px", right:"0px",use:false},
|
||||
t : {top:"0px", bottom:"0px", left:"0px", right:"0px",use:false},
|
||||
m : {top:"0px", bottom:"0px", left:"0px", right:"0px",use:false}},
|
||||
modal: false
|
||||
})
|
||||
}
|
||||
|
||||
function blockSettingsUpdate() {
|
||||
RVS.F.updateEasyInputs({path:'SC.BLOCK.', container:'#rbm_blocksettings', root:RVS});
|
||||
RVS.F.updateAllOnOff();
|
||||
updateInherits();
|
||||
jQuery('.scblockinput').trigger('init');
|
||||
document.getElementById('srbs_scr_evt').innerHTML = RVS.SC.BLOCK.popup.event.v;
|
||||
if (RVS.ENV.activated!==false) jQuery('.rb_not_on_notactive').removeClass("disabled"); else jQuery('.rb_not_on_notactive').addClass("disabled");
|
||||
}
|
||||
|
||||
function blockSettingsReset() {
|
||||
if (RVS.SC.BLOCK!==undefined) {
|
||||
RVS.SC.BLOCK.zindex = 0;
|
||||
RVS.SC.BLOCK.popup = { time : {use:false, v:2000}, scroll : {use:false, type:"offset", v:2000,container:""},event : {use:false, v:"popup_"+RVS.SC.BLOCK.alias}};
|
||||
RVS.SC.BLOCK.offset = { d : {top:"0px", bottom:"0px", left:"0px", right:"0px" ,use:false}, n : {top:"0px", bottom:"0px", left:"0px", right:"0px",use:false}, t : {top:"0px", bottom:"0px", left:"0px", right:"0px",use:false}, m : {top:"0px", bottom:"0px", left:"0px", right:"0px",use:false}};
|
||||
RVS.SC.BLOCK.modal = false;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
ELEMENTOR HOOKS
|
||||
*/
|
||||
function elementorHooks() {
|
||||
|
||||
if (typeof elementor!=="undefined" && elementor.hooks!==undefined) {
|
||||
|
||||
elementor.hooks.addAction( 'panel/open_editor/widget/slider_revolution', function( panel, model, view ) {
|
||||
RVS.SC.type = "elementor";
|
||||
RVS.SC.EL = RVS.SC.EL===undefined ? {} : RVS.SC.EL;
|
||||
RVS.SC.EL.control = panel.$el.find('#elementor-controls');
|
||||
RVS.SC.EL.view = view;
|
||||
RVS.SC.EL.model = model;
|
||||
|
||||
// CHECK ALIAS FOR FROM VERSION 6.1.6 +
|
||||
if (view!==undefined && view.container!==undefined && view.container.settings!==undefined && view.container.settings.attributes!==undefined) {
|
||||
|
||||
if (view.container.settings.attributes.shortcode!==undefined) {
|
||||
RVS.SC.BLOCK = RVS.SC.scToBlock(view.container.settings.attributes.shortcode);
|
||||
// FALLBACK
|
||||
if (view.container.settings.attributes.revslidertitle!==undefined) RVS.SC.BLOCK.slidertitle = view.container.settings.attributes.revslidertitle;
|
||||
if (view.container.settings.attributes.modal!==undefined) RVS.SC.BLOCK.modal = view.container.settings.attributes.modal;
|
||||
|
||||
}
|
||||
}
|
||||
//STYLING ELEMNTOR TO LOOK MORE SLIDER REVOLUTION LIKE
|
||||
jQuery('.elementor-component-tab.elementor-panel-navigation-tab.elementor-tab-control-advanced').hide();
|
||||
RVS.SC.EL.control.addClass("rs-elementor-component-tab");
|
||||
});
|
||||
|
||||
// BASIC LISTENER
|
||||
window.elementorSelectRevSlider = function(e) { if (e) RVS.SC.openTemplateLibrary('elementor'); else jQuery('button[data-event="themepunch.selectslider"]').click();}
|
||||
/*
|
||||
FURTHER LISTNERS
|
||||
*/
|
||||
RVS.DOC.on('click', 'button[data-event="themepunch.selectslider"]', function() {RVS.SC.openTemplateLibrary('elementor');});
|
||||
RVS.DOC.on('click', 'button[data-event="themepunch.settingsslider"]', function() {RVS.SC.openBlockSettings('elementor',(RVS.SC.EL.view!==undefined && RVS.SC.EL.view.container!==undefined && RVS.SC.EL.view.container.settings!==undefined && RVS.SC.EL.view.container.settings.attributes!==undefined && RVS.SC.EL.view.container.settings.attributes.shortcode!==undefined ? RVS.SC.EL.view.container.settings.attributes.shortcode : {}));});
|
||||
RVS.DOC.on('click', 'button[data-event="themepunch.editslider"]', function() {RVS.SC.openSliderEditor(RVS.SC.BLOCK.alias)});
|
||||
RVS.DOC.on('click', 'button[data-event="themepunch.optimizeslider"]', function() {RVS.SC.openOptimizer(RVS.SC.BLOCK.alias)});
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
VISUAL COMPOSER HOOKS
|
||||
*/
|
||||
function vcHooks() {
|
||||
function convertVCParamsToSC(params) {
|
||||
var temp = jQuery.extend(true,{},params),
|
||||
sc = '[rev_slider alias="' + temp.alias + '"';
|
||||
|
||||
if (temp.slidertitle!==undefined) sc+= ' slidertitle="'+temp.slidertitle+'"'; else
|
||||
if (temp.sliderTitle!==undefined) sc+= ' slidertitle="'+temp.sliderTitle+'"'; else
|
||||
if (temp.title!==undefined) sc+= ' slidertitle="'+temp.title+'"';
|
||||
|
||||
if (temp.modal!==undefined) sc+= ' modal="'+temp.modal+'"';
|
||||
if (temp.usage!==undefined) sc+= ' usage="'+temp.usage+'"';
|
||||
if (temp.offset!==undefined) sc+= ' offset="'+temp.offset+'"';
|
||||
if (temp.zindex!==undefined) sc+= ' zindex="'+temp.zindex+'"';
|
||||
if (temp.layout!==undefined) sc+= ' layout="'+temp.layout+'"';
|
||||
sc += '][/rev_slider]';
|
||||
return sc;
|
||||
}
|
||||
|
||||
/*
|
||||
OPEN TEMPLATE LIBRARY FOR VC
|
||||
*/
|
||||
function VCopenTemplateLibrary(params) {
|
||||
jQuery('.wpb-element-edit-modal').hide(); //hide the normal VC window and use own (old vc version)
|
||||
jQuery('#vc_properties-panel').hide(); //hide the normal VC window and use own (new vc version)
|
||||
RVS.SC.BLOCK = RVS.SC.scToBlock(convertVCParamsToSC(params));
|
||||
RVS.SC.openTemplateLibrary('wpbackery');
|
||||
}
|
||||
|
||||
if (typeof vc==="undefined" || vc==undefined) return;
|
||||
window.VcSliderRevolution = vc.shortcode_view.extend({
|
||||
events: {
|
||||
'click > .vc_controls .vc_control_rev_optimizer': 'rs_optim',
|
||||
'click > .vc_controls .vc_control_rev_selector': 'rs_select',
|
||||
'click > .vc_controls .vc_control_rev_settings': 'rs_settings',
|
||||
'click .column_delete,.vc_control-btn-delete': 'deleteShortcode',
|
||||
'click .vc_control-btn-edit': 'editElement',
|
||||
'click .column_clone,.vc_control-btn-clone': 'clone',
|
||||
mousemove: "checkControlsPosition"
|
||||
},
|
||||
initialize: function() {return window.VcSliderRevolution.__super__.initialize.call(this);},
|
||||
render: function () { RVS.SC.VC = this; if(vc.add_element_block_view.$el.is(':visible')) VCopenTemplateLibrary(this.model.get('params'));return window.VcSliderRevolution.__super__.render.call(this);},
|
||||
editElement: function() { RVS.SC.openSliderEditor(this.model.get('params').alias);},
|
||||
rs_select : function() { RVS.SC.VC = this;VCopenTemplateLibrary(this.model.get('params'));},
|
||||
rs_optim : function() { RVS.SC.openOptimizer(this.model.get('params').alias);},
|
||||
rs_settings : function() { RVS.SC.VC = this; RVS.SC.openBlockSettings('wpbackery',convertVCParamsToSC(this.model.get('params')));}
|
||||
});
|
||||
|
||||
if(typeof(window.InlineShortcodeView) !== 'undefined') {
|
||||
var rs_show_frontend_overlay = false;
|
||||
jQuery(window).on('vc_build', function() {
|
||||
vc.add_element_block_view.$el.find('[data-element="rev_slider"]').click(function() {
|
||||
rs_show_frontend_overlay = true;
|
||||
});
|
||||
});
|
||||
window.InlineShortcodeView_rev_slider = window.InlineShortcodeView.extend({
|
||||
events: {
|
||||
'click > .vc_controls .vc_control_rev_optimizer': 'rs_optim',
|
||||
'click > .vc_controls .vc_control_rev_selector': 'rs_select',
|
||||
'click > .vc_controls .vc_control_rev_settings': 'rs_settings',
|
||||
'click .column_delete,.vc_control-btn-delete': 'destroy',
|
||||
'click .vc_control-btn-edit': 'edit',
|
||||
mousemove: "checkControlsPosition"
|
||||
},
|
||||
render: function() {
|
||||
RVS.SC.VC = this;
|
||||
if(rs_show_frontend_overlay) VCopenTemplateLibrary(this.model.get('params'))
|
||||
window.InlineShortcodeView_rev_slider.__super__.render.call(this);
|
||||
var mv = this.$controls.find('.vc_element-move');
|
||||
if (this.$controls[0].getElementsByClassName('vc_control_rev_optimizer').length===0) jQuery('<a class="vc_control-btn vc_control_rev_optimizer" href="#" title="File Size Optimizer"><span class="vc_btn-content"><i class="revslider_vc_material-icons material-icons">flash_on</i></span></a>').insertAfter(mv);
|
||||
if (this.$controls[0].getElementsByClassName('vc_control_rev_settings').length===0) jQuery('<a class="vc_control-btn vc_control_rev_settings" href="#" title="Module Settings"><span class="vc_btn-content"><i class="revslider_vc_material-icons material-icons">tune</i></span></a>').insertAfter(mv);
|
||||
if (this.$controls[0].getElementsByClassName('vc_control_rev_selector').length===0) jQuery('<a class="vc_control-btn vc_control_rev_selector" href="#" title="Select New Slider Revolution 6 Module"><span class="vc_btn-content"><i class="revslider_vc_material-icons material-icons">cached</i></span></a>').insertAfter(mv);
|
||||
if (this.$controls[0].getElementsByClassName('vc_control_rev_edit').length===0) mv.find('.vc_control-btn.vc_control-btn-edit').addClass('vc_control_rev_edit');
|
||||
this.$controls.find('.vc_control-btn-clone').hide();
|
||||
return this;
|
||||
},
|
||||
rs_settings : function() { RVS.SC.VC = this; RVS.SC.openBlockSettings('wpbackery',convertVCParamsToSC(this.model.get('params'))); return false;},
|
||||
rs_optim : function() { RVS.SC.openOptimizer(this.model.get('params').alias);return false;},
|
||||
update: function(model) { rs_show_frontend_overlay = false;window.InlineShortcodeView_rev_slider.__super__.update.call(this, model);return this;},
|
||||
edit: function() { RVS.SC.openSliderEditor(this.model.get('params').alias);return false;},
|
||||
rs_select : function() { RVS.SC.VC = this; VCopenTemplateLibrary(this.model.get('params'));return false; },
|
||||
});
|
||||
};
|
||||
|
||||
/*
|
||||
LISTENERS
|
||||
*/
|
||||
RVS.DOC.on('mouseenter','.wpb_rev_slider.wpb_content_element.wpb_sortable',function() {
|
||||
//CHECK TOOLBAR OF VC
|
||||
var controls = jQuery(this.getElementsByClassName('vc_controls-cc')[0]);
|
||||
if (controls!==undefined) {
|
||||
var mv = controls.find('.vc_element-move');
|
||||
if (this.getElementsByClassName('vc_control_rev_optimizer').length===0) jQuery('<a class="vc_control-btn vc_control_rev_optimizer" href="#" title="File Size Optimizer"><span class="vc_btn-content"><i class="revslider_vc_material-icons material-icons">flash_on</i></span></a>').insertAfter(mv);
|
||||
if (this.getElementsByClassName('vc_control_rev_settings').length===0) jQuery('<a class="vc_control-btn vc_control_rev_settings" href="#" title="Module Settings"><span class="vc_btn-content"><i class="revslider_vc_material-icons material-icons">tune</i></span></a>').insertAfter(mv);
|
||||
if (this.getElementsByClassName('vc_control_rev_selector').length===0) jQuery('<a class="vc_control-btn vc_control_rev_selector" href="#" title="Select New Slider Revolution 6 Module"><span class="vc_btn-content"><i class="revslider_vc_material-icons material-icons">cached</i></span></a>').insertAfter(mv);
|
||||
if (this.getElementsByClassName('vc_control_rev_edit').length===0) mv.find('.vc_control-btn.vc_control-btn-edit').addClass('vc_control_rev_edit');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function shortCodeListener() {
|
||||
if (RVS.S.shortCodeListener!==undefined) return;
|
||||
RVS.S.shortCodeListener = true;
|
||||
|
||||
// COOKIE HANDLING
|
||||
jQuery('body').on('click', '#objectlibrary *[data-folderid]', function() {RVS.F.setCookie("rs6_wizard_folder",this.dataset.folderid,360);});
|
||||
|
||||
//
|
||||
RVS.F.initOnOff(jQuery('#slide_template_row').css('display', 'inline-block'));
|
||||
|
||||
RVS.DOC.on('registrationdone',function() {
|
||||
if (RVS.ENV.activated===false) {
|
||||
jQuery('.rs_wp_plg_act_wrapper').show();
|
||||
jQuery('.rb_not_on_notactive').addClass("disabled");
|
||||
} else {
|
||||
jQuery('.rs_wp_plg_act_wrapper').hide();
|
||||
jQuery('.rb_not_on_notactive').removeClass("disabled");
|
||||
}
|
||||
});
|
||||
|
||||
if (RVS.ENV.activated===false) {
|
||||
jQuery('.rs_wp_plg_act_wrapper').show();
|
||||
RVS.DOC.on('click','.rs_wp_plg_act_wrapper',RVS.F.showRegisterSliderInfo);
|
||||
} else {
|
||||
jQuery('.rs_wp_plg_act_wrapper').hide();
|
||||
}
|
||||
|
||||
/**********************************
|
||||
- PAGE BACKGROUND COLOR -
|
||||
**********************************/
|
||||
// Color Picker
|
||||
jQuery('#rs_page_bg_color').rsColorPicker({
|
||||
init: function(inputWrap, inputElement, cssColor, widgetSettings) {
|
||||
var ghost = jQuery('<input type="text" class="layerinput" value="' + inputElement.val() + '">').appendTo(inputWrap);
|
||||
inputElement.data('ghost', ghost).hide();
|
||||
},
|
||||
change:function(currentInput, cssColor, gradient, globalColors, globalColorActive) {
|
||||
currentInput.data('ghost').val(cssColor);
|
||||
currentInput.val(cssColor);
|
||||
}
|
||||
});
|
||||
|
||||
// Page Template , Color Picker, checkbox check only when RevSlider Blank Template
|
||||
jQuery('body').on('change', '.editor-page-attributes__template select', function() {
|
||||
if(jQuery(this).val() === "../public/views/revslider-page-template.php"){
|
||||
jQuery('#rs_page_bg_color_column').show();
|
||||
jQuery('#rs_blank_template').prop('checked', true);
|
||||
}
|
||||
else {
|
||||
jQuery('#rs_page_bg_color_column').hide();
|
||||
jQuery('#rs_blank_template').prop('checked', false);
|
||||
}
|
||||
});
|
||||
|
||||
// Page Template , checkbox check sync Page Template Selectbox
|
||||
jQuery('body').on('change', '#rs_blank_template', function() {
|
||||
if(jQuery(this).prop('checked')){
|
||||
jQuery('.editor-page-attributes__template select').val("../public/views/revslider-page-template.php").change();
|
||||
jQuery('#rs_page_bg_color_column').show();
|
||||
}
|
||||
else {
|
||||
jQuery('.editor-page-attributes__template select').val("").change();
|
||||
jQuery('#rs_page_bg_color_column').hide();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
/*
|
||||
DEFAULT LISTENERS
|
||||
*/
|
||||
RVS.DOC.on('click','.wp-block.editor-block-list__block[data-type="themepunch/revslider"]',function() {RVS.SC.updateBlockViews(true);});
|
||||
RVS.DOC.on('addRevSliderShortcode', function(e, data) {
|
||||
if(data!==undefined && data.alias !== '-1'){
|
||||
data.size = data.size==="" || data.size===undefined ? "auto" : data.size;
|
||||
var block = newBlock(data.alias);
|
||||
RVS.SC.BLOCK = jQuery.extend(true,block,RVS.SC.BLOCK);
|
||||
RVS.SC.BLOCK.alias = data.alias;
|
||||
RVS.SC.BLOCK.slidertitle = data.slidertitle!==undefined ? data.slidertitle : data.title!==undefined ? data.title : data.alias;
|
||||
RVS.SC.BLOCK.layout = RVS.SC.BLOCK.origlayout = data.size;
|
||||
RVS.SC.updateShortCode();
|
||||
}
|
||||
});
|
||||
|
||||
RVS.DOC.on('selectRevSliderItem', function() {
|
||||
var folder = RVS.F.getCookie('rs6_wizard_folder');
|
||||
if(folder && folder !== -1 && folder !== '-1') RVS.F.changeOLIBToFolder(folder);
|
||||
});
|
||||
|
||||
|
||||
// CLOSE EDITOR
|
||||
RVS.DOC.on('click','#rbm_blocksettings .rbm_close' , function() {
|
||||
RVS.SC.updateShortCode();
|
||||
RVS.F.RSDialog.close();
|
||||
});
|
||||
|
||||
RVS.DOC.on('focus','.scblockinput',function() {
|
||||
this.dataset.focusvalue = this.value;
|
||||
this.style.opacity = 1;
|
||||
});
|
||||
|
||||
RVS.DOC.on('change blur','.scblockinput',function() {
|
||||
if (this.dataset.s!==undefined && this.dataset.focusvalue!==this.value) RVS.SC.BLOCK.offset[this.dataset.s].use = true;
|
||||
blockSettingsUpdate();
|
||||
});
|
||||
|
||||
RVS.DOC.on('updateSRBSSVREVT',function(e,v){
|
||||
if(v!==undefined) {
|
||||
if (v.val==="") RVS.SC.BLOCK.popup.event.v = "popup_"+RVS.SC.BLOCK.alias;
|
||||
document.getElementById('srbs_scr_evt').innerHTML = v.val;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
})();
|
||||
@@ -0,0 +1,23 @@
|
||||
(function() {
|
||||
|
||||
if(typeof tinymce !== 'undefined') {
|
||||
|
||||
tinymce.PluginManager.add('revslider_sc_button', function(editor, url) {
|
||||
|
||||
editor.addButton('revslider_sc_button', {
|
||||
|
||||
title: 'Slider Revolution Shortcode Creator',
|
||||
icon: 'icon dashicons-before dashicons-update',
|
||||
onclick: function() {
|
||||
|
||||
// OPEN THE OBJECT LIBRARY
|
||||
RS_SC_WIZARD.openTemplateLibrary('tinymce');
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
})();
|
||||
Reference in New Issue
Block a user