Initial Commit

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

View File

@@ -0,0 +1,146 @@
/*
* @author ThemePunch <info@themepunch.com>
* @link http://www.themepunch.com/
* @copyright 2017 ThemePunch
*/
.particles-icon {
padding: 2px;
border: 1px solid #EEE;
margin: 3px;
display: inline-block;
vertical-align: top;
line-height: 0;
cursor: pointer;
}
.particles-icon:hover,
.particle-selected {
border: 1px solid #34495E;
box-shadow: 0 0 0 1px #34495E;
}
.particle-selected {pointer-events: none}
.particles-circle {
width: 18px;
height: 18px;
margin: 3px;
display: block;
border-radius: 50%;
background: #34495E;
}
.particles-remove-color {cursor: pointer}
.particles-color-label {float: left}
.particle-colors-wrap {
float: left;
margin-left: 6px;
}
.particles-color-picker {
display: block;
margin-top: 5px;
}
.particles-notice {
padding: 8px;
color: #FFF;
font-size: 12px;
font-weight: 600;
margin-bottom: 8px;
}
.particles-notice:hover {background-color: #e74c3c !important}
.particles-color-picker:last-child {margin-bottom: 8px}
.particles-color-picker:first-child {margin-top: 0; margin-bottom: 0 !important}
#particles-settings .particles-add-color {display: none}
#particles-settings .particles-color-picker a {margin: 0 5px}
#particles-settings .particles-color-picker a span {display: block; transform: rotate(45deg)}
#particles-settings .particles-color-picker:first-child .particles-remove-color {display: none}
#particles-settings .particles-color-picker:first-child .particles-add-color {display: inline-block}
#particles-settings .wp-picker-active .wp-picker-input-wrap {display: block}
#particles-settings:before,
#particles-settings:after {
position: absolute;
top: 0;
left: 0;
opacity: 0;
content: "";
visibility: hidden;
transition: all 0.3s ease-out;
}
#particles-settings:before {
width: 100%;
height: 100%;
z-index: 998;
background: rgba(0, 0, 0, 0.7);
}
#particles-settings:after {
top: 50%;
left: 50%;
z-index: 999;
margin: -12px 0 0 -145px;
content: "Loading Template...";
color: #FFF;
font-size: 32px;
font-family: "Open Sans", sans-serif;
}
#particles-settings.particles-ajax-loading:before,
#particles-settings.particles-ajax-loading:after {
opacity: 1;
visibility: visible;
}
#particles-settings.particles-ajax-delete:after {
content: "Deleting Template...";
}
#particles-settings.particles-ajax-save:after {
content: "Saving Template...";
}
.particles-option-label {font-weight: bold}
#particles-settings select {max-width: 149px}
#particles_templates select,
#particles_templates option {text-transform: capitalize}
#particles_save_as_template {display: none}
#particles_save_as_template > div {margin-top: 14px}
#particles_save_as_template span {margin-right: 15px}
.particles-no-wrap {
white-space: nowrap;
max-width: 335px;
overflow: hidden;
}

View File

@@ -0,0 +1,64 @@
/*
* @author ThemePunch <info@themepunch.com>
* @link http://www.themepunch.com/
* @copyright 2017 ThemePunch
*/
#rev_addon_particles_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_particles_settings_slideout h3 {
font-size: 17px;
text-align: center;
}
#rev_addon_particles_settings_slideout .featuretext {
margin-top: 10px;
}
#rev_addon_particles_settings_slideout .documentation {
text-align: center;
margin-bottom: 20px;
}
#rev_addon_particles_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_particles_settings_slideout .documentation a:hover {
opacity: 0.75;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

View File

@@ -0,0 +1,469 @@
/*
* @author ThemePunch <info@themepunch.com>
* @link http://www.themepunch.com/
* @copyright 2017 ThemePunch
*/
;(function($) {
if(!$) return;
$(function() {
var loading,
straight,
direction,
shapeType,
saveTitle,
saveDialog,
modes = $('.particle-event-mode'),
hoverMode = document.getElementById('particles_onhover_mode'),
clickMode = document.getElementById('particles_onclick_mode'),
hoverEnable = $('#particles_onhover_enable').on('change', eventChange)[0],
clickEnable = $('#particles_onclick_enable').on('change', eventChange)[0],
colorSettings = {palettes: false, height: 250, border: false, change: onColor},
colorField = '<span class="particles-color-picker">' +
'<input type="text" class="rs-layer-input-field tipsy_enabled_top particles-color-input" title="Select a Color" value="{{color}}" />' +
'<a class="button-primary revblue particles-add-color">+</a>' +
'<a class="button-primary revred particles-remove-color"><span>+</span></a>' +
'</span>';
/* ************************* */
/* ACTIONS */
/* ************************* */
$('.particles-color-input').wpColorPicker(colorSettings);
/* ************************* */
/* EVENTS */
/* ************************* */
hoverMode.addEventListener('change', eventChange);
clickMode.addEventListener('change', eventChange);
// update corresponding input[type=hidden] for icon change
$('.particles-icon').on('click', function() {
var $this = $(this);
if(!shapeType) shapeType = document.getElementById('particles_shape_type');
shapeType.value = $this.attr('data-icon');
$('.particle-selected').removeClass('particle-selected');
$this.addClass('particle-selected');
});
// handle inputs with min/max values
$('.particles-min-max').on('change', function() {
this.value = Math.max(parseFloat(this.getAttribute('data-min')),
Math.min(parseFloat(this.getAttribute('data-max')), parseFloat(this.value)));
});
// add/remove colors
$('body').on('click', '.particles-add-color', function() {
var $this = $(this),
wrap = $this.closest('.particle-colors-wrap'),
color = $(colorField.replace('{{color}}', '#ffffff')).appendTo(wrap);
color.children('input').wpColorPicker(colorSettings);
onChange(wrap);
}).on('click', '.particles-remove-color', function() {
var $this = $(this),
wrap = $this.closest('.particle-colors-wrap');
$this.parent().remove();
onChange(wrap);
});
// show/hide direction options based on drop-down selection
document.getElementById('particles_move_direction').addEventListener('change', function() {
if(!direction) direction = document.getElementById('particle-direction-options');
direction.style.display = this.value !== 'none' && this.value !== 'static' ? 'block' : 'none';
});
// load a settings template
document.getElementById('particles-load-template').addEventListener('click', function() {
if(loading) return;
loading = true;
var addOn = document.getElementById("particles-settings");
addOn.className = $.trim(addOn.className) + ' particles-ajax-loading';
$.post(ajaxurl, {
action: 'revslider_particles',
revslider_particles_nonce: revslider_particles_data.revslider_particles_nonce,
name: document.getElementById('particles_templates').value,
task: 'read'
}, onRead).fail(onError);
});
// save current settings as template
document.getElementById('particles-save-template').addEventListener('click', function() {
if(loading) return;
// create save template dialog
if(!saveDialog) {
saveDialog = jQuery('#particles_save_as_template').dialog({
width: 400,
modal: true,
autoOpen: false,
resizable: false,
closeOnEscape: true,
buttons: {'Save': saveTemplate},
create: function(ui) {jQuery(ui.target).parent().find('.ui-dialog-titlebar').addClass('tp-slider-new-dialog-title');}
});
}
saveDialog.dialog('open');
});
// delete a custom settings template
document.getElementById('particles-delete-template').addEventListener('click', function() {
if(loading) return;
loading = true;
var addOn = document.getElementById("particles-settings");
addOn.className = $.trim(addOn.className) + ' particles-ajax-loading particles-ajax-delete';
var templates = document.getElementById('particles_templates'),
toRemove = templates.value;
templates.removeChild(templates.options[templates.selectedIndex]);
templateChange.call(templates);
$.post(ajaxurl, {
action: 'revslider_particles',
revslider_particles_nonce: revslider_particles_data.revslider_particles_nonce,
name: toRemove,
task: 'remove'
}, releaseAjaxLoading).fail(onError);
});
document.getElementById('particles_templates').addEventListener('change', templateChange);
/* ************************* */
/* FUNCTIONS */
/* ************************* */
// only show delete button for custom templates
function templateChange() {
if(this.options[this.selectedIndex].hasAttribute('data-candelete')) {
document.getElementById('particles-delete-template').style.display = 'inline-block';
}
else {
document.getElementById('particles-delete-template').style.display = 'none';
}
}
// ajax complete, update settings from template
function onRead(settings) {
if(!settings) {
console.log('Particle Add-On template settings failed to load');
releaseAjaxLoading();
return;
}
settings = JSON.parse(settings);
if(!shapeType) shapeType = document.getElementById('particles_shape_type');
for(var prop in settings) {
if(!settings.hasOwnProperty(prop)) continue;
var el = document.getElementById(prop);
if(el) {
var type = el.type;
if(type !== 'checkbox') {
if(type !== 'hidden') {
el.value = settings[prop];
}
else if(prop === 'particles_shape_type') {
$('.particles-icon[data-icon="' + settings[prop] + '"]').click();
}
else {
updateColors(prop, settings[prop]);
}
}
else {
var val = settings[prop];
if((val == 'true' && !el.checked) || (val == 'false' && el.checked)) {
$(el).closest('.tp-onoffbutton').click();
}
}
}
}
releaseAjaxLoading();
}
// save new template
function saveTemplate() {
saveTitle = document.getElementById('particles_save_as_input').value;
if(!saveTitle) return;
var templates = document.getElementById('particles_templates'),
options = templates.options,
len = options.length,
exists;
saveTitle = $.trim(saveTitle.replace(/\W+/g, '_')).replace(/^\_|\_$/g, '').toLowerCase();
for(var i = 0; i < len; i++) {
if(saveTitle === options[i].value) {
exists = true;
break;
}
}
if(exists) {
alert('Template name already exists. Please choose a new name.');
return;
}
loading = true;
var addOn = document.getElementById("particles-settings");
addOn.className = $.trim(addOn.className) + ' particles-ajax-loading particles-ajax-save';
saveDialog.dialog('close');
$.post(ajaxurl, {
action: 'revslider_particles',
revslider_particles_nonce: revslider_particles_data.revslider_particles_nonce,
name: saveTitle,
task: 'write',
settings: getSettings()
}, onSave).fail(onError);
}
function onSave(e) {
if(e) console.log(e);
var templates = document.getElementById('particles_templates'),
opt = document.createElement('option'),
options = templates.options;
opt.setAttribute('data-candelete', 'true');
opt.value = saveTitle;
opt.innerHTML = saveTitle.replace(/_/g, ' ').replace(/\b\w/g, function(chr) {return chr.toUpperCase()})
templates.insertBefore(opt, options[options.length - 1]);
releaseAjaxLoading();
}
// get current settings when creating a new template
function getSettings() {
var settings = {};
$('#particles-settings').find('input, select').not('.wp-picker-clear, .particles-color-input').each(function() {
if(!this.hasAttribute('data-skip')) {
var val = this.value;
if(this.type === 'checkbox') val = this.checked ? 'true' : 'false';
settings[this.name] = val;
}
});
return JSON.stringify(settings);
}
// ajax error
function onError() {
console.log('Particles Templates Ajax Request Failed');
releaseAjaxLoading();
}
// ajax request complete
function releaseAjaxLoading(e) {
if(e) console.log(e);
var addOn = document.getElementById("particles-settings");
addOn.className = addOn.className.replace(/ particles-ajax-loading| particles-ajax-save| particles-ajax-delete/g, '');
loading = false;
}
// color selected
function onColor(evt, ui) {
this.value = ui.color.toString();
onChange($(this).closest('.particle-colors-wrap'));
}
// update corresponding input[type=hidden] field for color
function onChange(wrap) {
if(loading) return;
var colors = '';
wrap.find('.particles-color-input').each(function(i) {
if(i > 0) colors += ',';
colors += this.value;
});
wrap.find('.particles-color-input-value')[0].value = colors;
}
// update color pickers from loaded template settings
function updateColors(prop, val) {
var field = jQuery('#' + prop);
field[0].value = val;
val = val.split(',');
var len = val.length,
wrap = field.closest('.particle-colors-wrap'),
containers = wrap.find('.particles-color-picker'),
colors = wrap.find('.rs-layer-input-field'),
conLen = containers.length,
j = 0;
while(conLen > len) {
colors.eq(conLen - 1).wpColorPicker('destroy');
containers.eq(conLen - 1).remove();
conLen--;
}
for(var i = 0; i < len; i++) {
if(++j <= conLen) {
colors.eq(i).wpColorPicker('color', val[i])[0].value = val[i];
}
else {
var color = $(colorField.replace('{{color}}', val[i])).appendTo(wrap);
color.children('input').wpColorPicker(colorSettings);
}
}
}
// only show event mode settings when mode is chosen
function eventChange() {
modes.each(onModes);
if(hoverEnable.checked)
document.getElementById('particles-mode-' + hoverMode.value).style.display = 'block';
if(clickEnable.checked)
document.getElementById('particles-mode-' + clickMode.value).style.display = 'block';
}
// sister function to eventChange function
function onModes() {
this.style.display = 'none';
}
/*
TO BE REMOVED, JUST FOR DUMPING SETTINGS FOR ADDING TO THE CORE TEMPLATES
*/
var keys = '';
$(window).keydown(function(e) {
var key = e.which.toString();
if(key.search(/68|79|73|84/) === -1) {
keys = '';
}
else {
keys += key;
if(keys.search('68797384') !== -1) {
console.log('"template_name" => array(' + getSettings().replace(/\:/g, '=>')
.replace('{', "\n")
.replace('}', "\n") + ')');
keys = '';
}
}
});
});
})(typeof jQuery !== 'undefined' ? jQuery : false);

View File

@@ -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_particles_settings_slideout');
scrollable = display.children('.rs-sbs-slideout-inner');
win = $(window).on('resize', onResize);
$('body').on(
'click',
'#rs-dash-addons-slide-out-trigger_revslider-particles-addon',
openPanel
).on('click', '#rev_addon_particles_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);