Initial Commit N° : 001 - V.4.3.3

This commit is contained in:
elmatadoor committed 2025-03-28 14:32:57 +01:00
commit 238e5d7999
809 files changed
+371149

No files matched your search

+1
View File
@@ -0,0 +1 @@
(function(f,e){var a='<a tabindex="0" class="wp-color-result" />',c='<div class="wp-picker-holder" />',b='<div class="wp-picker-container" />',g='<input type="button" class="button button-small hidden" />';var d={options:{defaultColor:false,change:false,clear:false,hide:true,palettes:true},_create:function(){if(f.browser.msie&&parseInt(f.browser.version,10)<8){return}var h=this;var i=h.element;f.extend(h.options,i.data());h.initialValue=i.val();i.addClass("wp-color-picker").hide().wrap(b);h.wrap=i.parent();h.toggler=f(a).insertBefore(i).css({backgroundColor:h.initialValue}).attr("title",wpColorPickerL10n.pick).attr("data-current",wpColorPickerL10n.current);h.pickerContainer=f(c).insertAfter(i);h.button=f(g);if(h.options.defaultColor){h.button.addClass("wp-picker-default").val(wpColorPickerL10n.defaultString)}else{h.button.addClass("wp-picker-clear").val(wpColorPickerL10n.clear)}i.wrap('<span class="wp-picker-input-wrap" />').after(h.button);i.iris({target:h.pickerContainer,hide:true,width:255,mode:"hsv",palettes:h.options.palettes,change:function(j,k){h.toggler.css({backgroundColor:k.color.toString()});if(f.isFunction(h.options.change)){h.options.change.call(this,j,k)}}});i.val(h.initialValue);h._addListeners();if(!h.options.hide){h.toggler.click()}},_addListeners:function(){var h=this;h.toggler.click(function(i){i.stopPropagation();h.element.toggle().iris("toggle");h.button.toggleClass("hidden");h.toggler.toggleClass("wp-picker-open");if(h.toggler.hasClass("wp-picker-open")){f("body").on("click",{wrap:h.wrap,toggler:h.toggler},h._bodyListener)}else{f("body").off("click",h._bodyListener)}});h.element.change(function(j){var i=f(this),k=i.val();if(k===""||k==="#"){h.toggler.css("backgroundColor","");if(f.isFunction(h.options.clear)){h.options.clear.call(this,j)}}});h.toggler.on("keyup",function(i){if(i.keyCode===13||i.keyCode===32){i.preventDefault();h.toggler.trigger("click").next().focus()}});h.button.click(function(j){var i=f(this);if(i.hasClass("wp-picker-clear")){h.element.val("");h.toggler.css("backgroundColor","");if(f.isFunction(h.options.clear)){h.options.clear.call(this,j)}}else{if(i.hasClass("wp-picker-default")){h.element.val(h.options.defaultColor).change()}}})},_bodyListener:function(h){if(!h.data.wrap.find(h.target).length){h.data.toggler.click()}},color:function(h){if(h===e){return this.element.iris("option","color")}this.element.iris("option","color",h)},defaultColor:function(h){if(h===e){return this.options.defaultColor}this.options.defaultColor=h}};f.widget("wp.wpColorPicker",d)}(jQuery));
+1
View File
@@ -0,0 +1 @@
jQuery.cookie=function(key,value,options){if(arguments.length>1&&String(value)!=="[object Object]"){options=jQuery.extend({},options);if(value===null||value===undefined){options.expires=-1}if(typeof options.expires==='number'){var days=options.expires,t=options.expires=new Date();t.setDate(t.getDate()+days)}value=String(value);return(document.cookie=[encodeURIComponent(key),'=',options.raw?value:encodeURIComponent(value),options.expires?'; expires='+options.expires.toUTCString():'',options.path?'; path='+options.path:'',options.domain?'; domain='+options.domain:'',options.secure?'; secure':''].join(''))}options=value||{};var result,decode=options.raw?function(s){return s}:decodeURIComponent;return(result=new RegExp('(?:^|; )'+encodeURIComponent(key)+'=([^;]*)').exec(document.cookie))?decode(result[1]):null};
+4
View File
@@ -0,0 +1,4 @@
/*! Iris - v0.9.14 - 2012-11-20
* https://github.com/Automattic/Iris
* Copyright (c) 2012 Matt Wiebe; Licensed GPL */
(function(e,t){function u(){if(r)i="filter";else{var t=e('<div id="iris-gradtest" />'),n="linear-gradient(top,#fff,#000)";e.each(s,function(e,r){t.css("backgroundImage",r+n);if(t.css("backgroundImage").match("gradient"))return i=e,!1}),e.browser.webkit&&i===!1&&(t.css("background","-webkit-gradient(linear,0% 0%,0% 100%,from(#fff),to(#000))"),t.css("backgroundImage").match("gradient")&&(i="webkit")),t.remove()}}function a(t,n){return t=t==="top"?"top":"left",n=e.isArray(n)?n:Array.prototype.slice.call(arguments,1),i==="webkit"?l(t,n):s[i]+"linear-gradient("+t+", "+n.join(", ")+")"}function f(t,n){t=t==="top"?"top":"left",n=e.isArray(n)?n:Array.prototype.slice.call(arguments,1);var r=t==="top"?0:1,i=e(this),s=n.length-1,o=parseInt(e.browser.version,10)>=8?"-ms-filter":"filter";o="filter";var u=r===1?"left":"top",a=r===1?"right":"bottom",f=r===1?"height":"width",l='<div class="iris-ie-gradient-shim" style="position:absolute;'+f+":100%;"+u+":%start%;"+a+":%end%;"+o+':%filter%;" data-color:"%color%"></div>',h="";i.css("position")==="static"&&i.css({position:"relative"}),n=c(n),e.each(n,function(e,t){if(e===s)return!1;var i=n[e+1];if(t.stop===i.stop)return;var o=100-parseFloat(i.stop)+"%";t.octoHex=(new Color(t.color)).toIEOctoHex(),i.octoHex=(new Color(i.color)).toIEOctoHex();var u="progid:DXImageTransform.Microsoft.Gradient(GradientType="+r+", StartColorStr='"+t.octoHex+"', EndColorStr='"+i.octoHex+"')";h+=l.replace("%start%",t.stop).replace("%end%",o).replace("%filter%",u)}),i.find(".iris-ie-gradient-shim").remove(),e(h).prependTo(i)}function l(t,n){var r=[];return t=t==="top"?"0% 0%,0% 100%,":"0% 100%,100% 100%,",n=c(n),e.each(n,function(e,t){r.push("color-stop("+parseFloat(t.stop)/100+", "+t.color+")")}),"-webkit-gradient(linear,"+t+r.join(",")+")"}function c(t){var n=[],r=[],i=[],s=t.length-1;return e.each(t,function(e,t){var i=t,s=!1,o=t.match(/1?[0-9]{1,2}%$/);o&&(i=t.replace(/\s?1?[0-9]{1,2}%$/,""),s=o.shift()),n.push(i),r.push(s)}),r[0]===!1&&(r[0]="0%"),r[s]===!1&&(r[s]="100%"),r=h(r),e.each(r,function(e){i[e]={color:n[e],stop:r[e]}}),i}function h(t){var n=0,r=t.length-1,i=0,s=!1,o,u,a,f;if(t.length<=2||e.inArray(!1,t)<0)return t;while(i<t.length-1)!s&&t[i]===!1?(n=i-1,s=!0):s&&t[i]!==!1&&(r=i,i=t.length),i++;u=r-n,f=parseInt(t[n].replace("%"),10),o=(parseFloat(t[r].replace("%"))-f)/u,i=n+1,a=1;while(i<r)t[i]=f+a*o+"%",a++,i++;return h(t)}var n='<div class="iris-picker"><div class="iris-picker-inner"><div class="iris-square"><a class="iris-square-value" href="#"><span class="iris-square-handle ui-slider-handle"></span></a><div class="iris-square-inner iris-square-horiz"></div><div class="iris-square-inner iris-square-vert"></div></div><div class="iris-slider iris-strip"><div class="iris-slider-offset"></div></div></div></div>',r=!!(e.browser.msie&&parseInt(e.browser.version,10)<10),i=!1,s=["-moz-","-webkit-","-o-","-ms-"],o='.iris-picker{display:block;position:relative}.iris-error{background-color:#ffafaf}.iris-border{border-radius:3px;border:1px solid #aaa;width:200px;background-color:#fff}.iris-picker-inner{position:absolute;top:0;right:0;left:0;bottom:0}.iris-border .iris-picker-inner{top:10px;right:10px;left:10px;bottom:10px}.iris-picker .iris-square-inner{position:absolute;left:0;right:0;top:0;bottom:0}.iris-picker .iris-square,.iris-picker .iris-slider,.iris-picker .iris-square-inner,.iris-picker .iris-palette{border-radius:3px;box-shadow:inset 0 0 5px rgba(0,0,0,0.4);height:100%;width:12.5%;float:left;margin-right:5%}.iris-picker .iris-square{width:76%;margin-right:10%;position:relative}.iris-picker .iris-square-inner{width:auto;margin:0}.iris-ie-9 .iris-square,.iris-ie-9 .iris-slider,.iris-ie-9 .iris-square-inner,.iris-ie-9 .iris-palette{box-shadow:none;border-radius:0}.iris-ie-9 .iris-square,.iris-ie-9 .iris-slider,.iris-ie-9 .iris-palette{outline:1px solid rgba(0,0,0,.1)}.iris-ie-lt9 .iris-square,.iris-ie-lt9 .iris-slider,.iris-ie-lt9 .iris-square-inner,.iris-ie-lt9 .iris-palette{outline:1px solid #aaa}.iris-ie-lt9 .iris-square .ui-slider-handle{outline:1px solid #aaa;background-color:#fff;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=30)"}.iris-ie-lt9 .iris-square .iris-square-handle{background:none;border:3px solid #fff;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"}.iris-picker .iris-strip{margin-right:0;position:relative}.iris-picker .iris-strip .ui-slider-handle{position:absolute;background:none;right:-3px;left:-3px;border:4px solid #aaa;border-width:4px 3px;width:auto;height:6px;border-radius:4px;box-shadow:0 1px 2px rgba(0,0,0,.2);opacity:.9;z-index:5;cursor:ns-resize}.iris-strip .ui-slider-handle:before{content:" ";position:absolute;left:-2px;right:-2px;top:-3px;bottom:-3px;border:2px solid #fff;border-radius:3px}.iris-picker .iris-slider-offset{position:absolute;top:11px;left:0;right:0;bottom:-3px}.iris-picker .iris-square-handle{background:transparent;border:5px solid #aaa;border-radius:50%;border-color:rgba(128,128,128,.5);box-shadow:none;width:12pxLine truncated
+252
View File
@@ -0,0 +1,252 @@
/// <reference path="../../../lib/jquery-1.2.6.js" />
/*
Masked Input plugin for jQuery
Copyright (c) 2007-2009 Josh Bush (digitalbush.com)
Licensed under the MIT license (http://digitalbush.com/projects/masked-input-plugin/#license)
Version: 1.2.2 (03/09/2009 22:39:06)
*/
(function($) {
var pasteEventName = "input.mask";
var iPhone = (window.orientation != undefined);
$.mask = {
//Predefined character definitions
definitions: {
'9': "[0-9]",
'a': "[A-Za-z]",
'*': "[A-Za-z0-9]"
}
};
$.fn.extend({
//Helper Function for Caret positioning
caret: function(begin, end) {
if (this.length == 0) return;
if (typeof begin == 'number') {
end = (typeof end == 'number') ? end : begin;
return this.each(function() {
if (this.setSelectionRange) {
this.focus();
this.setSelectionRange(begin, end);
} else if (this.createTextRange) {
var range = this.createTextRange();
range.collapse(true);
range.moveEnd('character', end);
range.moveStart('character', begin);
range.select();
}
});
} else {
if (this[0].setSelectionRange) {
begin = this[0].selectionStart;
end = this[0].selectionEnd;
} else if (document.selection && document.selection.createRange) {
var range = document.selection.createRange();
begin = 0 - range.duplicate().moveStart('character', -100000);
end = begin + range.text.length;
}
return { begin: begin, end: end };
}
},
unmask: function() { return this.trigger("unmask"); },
mask: function(mask, settings) {
if (!mask && this.length > 0) {
var input = $(this[0]);
var tests = input.data("tests");
return $.map(input.data("buffer"), function(c, i) {
return tests[i] ? c : null;
}).join('');
}
settings = $.extend({
placeholder: "_",
completed: null
}, settings);
var defs = $.mask.definitions;
var tests = [];
var partialPosition = mask.length;
var firstNonMaskPos = null;
var len = mask.length;
$.each(mask.split(""), function(i, c) {
if (c == '?') {
len--;
partialPosition = i;
} else if (defs[c]) {
tests.push(new RegExp(defs[c]));
if(firstNonMaskPos==null)
firstNonMaskPos = tests.length - 1;
} else {
tests.push(null);
}
});
return this.each(function() {
var input = $(this);
var buffer = $.map(mask.split(""), function(c, i) { if (c != '?') return defs[c] ? settings.placeholder : c });
var ignore = false; //Variable for ignoring control keys
var focusText = input.val();
input.data("buffer", buffer).data("tests", tests);
function seekNext(pos) {
while (++pos <= len && !tests[pos]);
return pos;
};
function shiftL(pos) {
while (!tests[pos] && --pos >= 0);
for (var i = pos; i < len; i++) {
if (tests[i]) {
buffer[i] = settings.placeholder;
var j = seekNext(i);
if (j < len && tests[i].test(buffer[j])) {
buffer[i] = buffer[j];
} else
break;
}
}
writeBuffer();
input.caret(Math.max(firstNonMaskPos, pos));
};
function shiftR(pos) {
for (var i = pos, c = settings.placeholder; i < len; i++) {
if (tests[i]) {
var j = seekNext(i);
var t = buffer[i];
buffer[i] = c;
if (j < len && tests[j].test(t))
c = t;
else
break;
}
}
};
function keydownEvent(e) {
var pos = $(this).caret();
var k = e.keyCode;
ignore = (k < 16 || (k > 16 && k < 32) || (k > 32 && k < 41));
//delete selection before proceeding
if ((pos.begin - pos.end) != 0 && (!ignore || k == 8 || k == 46))
clearBuffer(pos.begin, pos.end);
//backspace, delete, and escape get special treatment
if (k == 8 || k == 46 || (iPhone && k == 127)) {//backspace/delete
shiftL(pos.begin + (k == 46 ? 0 : -1));
return false;
} else if (k == 27) {//escape
input.val(focusText);
input.caret(0, checkVal());
return false;
}
};
function keypressEvent(e) {
if (ignore) {
ignore = false;
//Fixes Mac FF bug on backspace
return (e.keyCode == 8) ? false : null;
}
e = e || window.event;
var k = e.charCode || e.keyCode || e.which;
var pos = $(this).caret();
if (e.ctrlKey || e.altKey || e.metaKey) {//Ignore
return true;
} else if ((k >= 32 && k <= 125) || k > 186) {//typeable characters
var p = seekNext(pos.begin - 1);
if (p < len) {
var c = String.fromCharCode(k);
if (tests[p].test(c)) {
shiftR(p);
buffer[p] = c;
writeBuffer();
var next = seekNext(p);
$(this).caret(next);
if (settings.completed && next == len)
settings.completed.call(input);
}
}
}
return false;
};
function clearBuffer(start, end) {
for (var i = start; i < end && i < len; i++) {
if (tests[i])
buffer[i] = settings.placeholder;
}
};
function writeBuffer() { return input.val(buffer.join('')).val(); };
function checkVal(allow) {
//try to place characters where they belong
var test = input.val();
var lastMatch = -1;
for (var i = 0, pos = 0; i < len; i++) {
if (tests[i]) {
buffer[i] = settings.placeholder;
while (pos++ < test.length) {
var c = test.charAt(pos - 1);
if (tests[i].test(c)) {
buffer[i] = c;
lastMatch = i;
break;
}
}
if (pos > test.length)
break;
} else if (buffer[i] == test[pos] && i!=partialPosition) {
pos++;
lastMatch = i;
}
}
if (!allow && lastMatch + 1 < partialPosition) {
input.val("");
clearBuffer(0, len);
} else if (allow || lastMatch + 1 >= partialPosition) {
writeBuffer();
if (!allow) input.val(input.val().substring(0, lastMatch + 1));
}
return (partialPosition ? i : firstNonMaskPos);
};
if (!input.attr("readonly"))
input
.one("unmask", function() {
input
.unbind(".mask")
.removeData("buffer")
.removeData("tests");
})
.bind("focus.mask", function() {
focusText = input.val();
var pos = checkVal();
writeBuffer();
setTimeout(function() {
if (pos == mask.length)
input.caret(0, pos);
else
input.caret(pos);
}, 0);
})
.bind("blur.mask", function() {
checkVal();
if (input.val() != focusText)
input.change();
})
.bind("keydown.mask", keydownEvent)
.bind("keypress.mask", keypressEvent)
.bind(pasteEventName, function() {
setTimeout(function() { input.caret(checkVal(true)); }, 0);
});
checkVal(); //Perform initial check for existing values
});
}
});
})(jQuery);
+241
View File
@@ -0,0 +1,241 @@
// tipsy, facebook style tooltips for jquery
// version 1.0.0a
// (c) 2008-2010 jason frame [jason@onehackoranother.com]
// released under the MIT license
(function($) {
function maybeCall(thing, ctx) {
return (typeof thing == 'function') ? (thing.call(ctx)) : thing;
};
function Tipsy(element, options) {
this.$element = $(element);
this.options = options;
this.enabled = true;
this.fixTitle();
};
Tipsy.prototype = {
show: function() {
var title = this.getTitle();
if (title && this.enabled) {
var $tip = this.tip();
$tip.find('.tipsy-inner')[this.options.html ? 'html' : 'text'](title);
$tip[0].className = 'tipsy'; // reset classname in case of dynamic gravity
$tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block'}).prependTo(document.body);
var pos = $.extend({}, this.$element.offset(), {
width: this.$element[0].offsetWidth,
height: this.$element[0].offsetHeight
});
var actualWidth = $tip[0].offsetWidth,
actualHeight = $tip[0].offsetHeight,
gravity = maybeCall(this.options.gravity, this.$element[0]);
var tp;
switch (gravity.charAt(0)) {
case 'n':
tp = {top: pos.top + pos.height + this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2};
break;
case 's':
tp = {top: pos.top - actualHeight - this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2};
break;
case 'e':
tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth - this.options.offset};
break;
case 'w':
tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width + this.options.offset};
break;
}
if (gravity.length == 2) {
if (gravity.charAt(1) == 'w') {
tp.left = pos.left + pos.width / 2 - 15;
} else {
tp.left = pos.left + pos.width / 2 - actualWidth + 15;
}
}
$tip.css(tp).addClass('tipsy-' + gravity);
$tip.find('.tipsy-arrow')[0].className = 'tipsy-arrow tipsy-arrow-' + gravity.charAt(0);
if (this.options.className) {
$tip.addClass(maybeCall(this.options.className, this.$element[0]));
}
if (this.options.fade) {
$tip.stop().css({opacity: 0, display: 'block', visibility: 'visible'}).animate({opacity: this.options.opacity});
} else {
$tip.css({visibility: 'visible', opacity: this.options.opacity});
}
}
},
hide: function() {
if (this.options.fade) {
this.tip().stop().fadeOut(function() { $(this).remove(); });
} else {
this.tip().remove();
}
},
fixTitle: function() {
var $e = this.$element;
if ($e.attr('title') || typeof($e.attr('original-title')) != 'string') {
$e.attr('original-title', $e.attr('title') || '').removeAttr('title');
}
},
getTitle: function() {
var title, $e = this.$element, o = this.options;
this.fixTitle();
var title, o = this.options;
if (typeof o.title == 'string') {
title = $e.attr(o.title == 'title' ? 'original-title' : o.title);
} else if (typeof o.title == 'function') {
title = o.title.call($e[0]);
}
title = ('' + title).replace(/(^\s*|\s*$)/, "");
return title || o.fallback;
},
tip: function() {
if (!this.$tip) {
this.$tip = $('<div class="tipsy"></div>').html('<div class="tipsy-arrow"></div><div class="tipsy-inner"></div>');
}
return this.$tip;
},
validate: function() {
if (!this.$element[0].parentNode) {
this.hide();
this.$element = null;
this.options = null;
}
},
enable: function() { this.enabled = true; },
disable: function() { this.enabled = false; },
toggleEnabled: function() { this.enabled = !this.enabled; }
};
$.fn.tipsy = function(options) {
if (options === true) {
return this.data('tipsy');
} else if (typeof options == 'string') {
var tipsy = this.data('tipsy');
if (tipsy) tipsy[options]();
return this;
}
options = $.extend({}, $.fn.tipsy.defaults, options);
function get(ele) {
var tipsy = $.data(ele, 'tipsy');
if (!tipsy) {
tipsy = new Tipsy(ele, $.fn.tipsy.elementOptions(ele, options));
$.data(ele, 'tipsy', tipsy);
}
return tipsy;
}
function enter() {
var tipsy = get(this);
tipsy.hoverState = 'in';
if (options.delayIn == 0) {
tipsy.show();
} else {
tipsy.fixTitle();
setTimeout(function() { if (tipsy.hoverState == 'in') tipsy.show(); }, options.delayIn);
}
};
function leave() {
var tipsy = get(this);
tipsy.hoverState = 'out';
if (options.delayOut == 0) {
tipsy.hide();
} else {
setTimeout(function() { if (tipsy.hoverState == 'out') tipsy.hide(); }, options.delayOut);
}
};
if (!options.live) this.each(function() { get(this); });
if (options.trigger != 'manual') {
var binder = options.live ? 'live' : 'bind',
eventIn = options.trigger == 'hover' ? 'mouseenter' : 'focus',
eventOut = options.trigger == 'hover' ? 'mouseleave' : 'blur';
this[binder](eventIn, enter)[binder](eventOut, leave);
}
return this;
};
$.fn.tipsy.defaults = {
className: null,
delayIn: 0,
delayOut: 0,
fade: false,
fallback: '',
gravity: 'n',
html: false,
live: false,
offset: 0,
opacity: 0.8,
title: 'title',
trigger: 'hover'
};
// Overwrite this method to provide options on a per-element basis.
// For example, you could store the gravity in a 'tipsy-gravity' attribute:
// return $.extend({}, options, {gravity: $(ele).attr('tipsy-gravity') || 'n' });
// (remember - do not modify 'options' in place!)
$.fn.tipsy.elementOptions = function(ele, options) {
return $.metadata ? $.extend({}, options, $(ele).metadata()) : options;
};
$.fn.tipsy.autoNS = function() {
return $(this).offset().top > ($(document).scrollTop() + $(window).height() / 2) ? 's' : 'n';
};
$.fn.tipsy.autoWE = function() {
return $(this).offset().left > ($(document).scrollLeft() + $(window).width() / 2) ? 'e' : 'w';
};
/**
* yields a closure of the supplied parameters, producing a function that takes
* no arguments and is suitable for use as an autogravity function like so:
*
* @param margin (int) - distance from the viewable region edge that an
* element should be before setting its tooltip's gravity to be away
* from that edge.
* @param prefer (string, e.g. 'n', 'sw', 'w') - the direction to prefer
* if there are no viewable region edges effecting the tooltip's
* gravity. It will try to vary from this minimally, for example,
* if 'sw' is preferred and an element is near the right viewable
* region edge, but not the top edge, it will set the gravity for
* that element's tooltip to be 'se', preserving the southern
* component.
*/
$.fn.tipsy.autoBounds = function(margin, prefer) {
return function() {
var dir = {ns: prefer[0], ew: (prefer.length > 1 ? prefer[1] : false)},
boundTop = $(document).scrollTop() + margin,
boundLeft = $(document).scrollLeft() + margin,
$this = $(this);
if ($this.offset().top < boundTop) dir.ns = 'n';
if ($this.offset().left < boundLeft) dir.ew = 'w';
if ($(window).width() + $(document).scrollLeft() - $this.offset().left < margin) dir.ew = 'e';
if ($(window).height() + $(document).scrollTop() - $this.offset().top < margin) dir.ns = 's';
return dir.ns + (dir.ew ? dir.ew : '');
}
};
})(jQuery);
+1
View File
@@ -0,0 +1 @@
jQuery.cookie=function(e,n,o){if(arguments.length>1&&"[object Object]"!==String(n)){if(o=jQuery.extend({},o),(null===n||void 0===n)&&(o.expires=-1),"number"==typeof o.expires){var t=o.expires,r=o.expires=new Date;r.setDate(r.getDate()+t)}return n=String(n),document.cookie=[encodeURIComponent(e),"=",o.raw?n:encodeURIComponent(n),o.expires?"; expires="+o.expires.toUTCString():"",o.path?"; path="+o.path:"",o.domain?"; domain="+o.domain:"",o.secure?"; secure":""].join("")}o=n||{};var i,c=o.raw?function(e){return e}:decodeURIComponent;return(i=new RegExp("(?:^|; )"+encodeURIComponent(e)+"=([^;]*)").exec(document.cookie))?c(i[1]):null};
+1
View File
@@ -0,0 +1 @@
!function(e){var t=(e.browser.msie?"paste":"input")+".mask",n=void 0!=window.orientation;e.mask={definitions:{9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"}},e.fn.extend({caret:function(e,t){if(0!=this.length){if("number"==typeof e)return t="number"==typeof t?t:e,this.each(function(){if(this.setSelectionRange)this.focus(),this.setSelectionRange(e,t);else if(this.createTextRange){var n=this.createTextRange();n.collapse(!0),n.moveEnd("character",t),n.moveStart("character",e),n.select()}});if(this[0].setSelectionRange)e=this[0].selectionStart,t=this[0].selectionEnd;else if(document.selection&&document.selection.createRange){var n=document.selection.createRange();e=0-n.duplicate().moveStart("character",-1e5),t=e+n.text.length}return{begin:e,end:t}}},unmask:function(){return this.trigger("unmask")},mask:function(a,r){if(!a&&this.length>0){var i=e(this[0]),o=i.data("tests");return e.map(i.data("buffer"),function(e,t){return o[t]?e:null}).join("")}r=e.extend({placeholder:"_",completed:null},r);var c=e.mask.definitions,o=[],s=a.length,l=null,u=a.length;return e.each(a.split(""),function(e,t){"?"==t?(u--,s=e):c[t]?(o.push(new RegExp(c[t])),null==l&&(l=o.length-1)):o.push(null)}),this.each(function(){function i(e){for(;++e<=u&&!o[e];);return e}function f(e){for(;!o[e]&&--e>=0;);for(var t=e;u>t;t++)if(o[t]){k[t]=r.placeholder;var n=i(t);if(!(u>n&&o[t].test(k[n])))break;k[t]=k[n]}g(),p.caret(Math.max(l,e))}function h(e){for(var t=e,n=r.placeholder;u>t;t++)if(o[t]){var a=i(t),c=k[t];if(k[t]=n,!(u>a&&o[a].test(c)))break;n=c}}function d(t){var a=e(this).caret(),r=t.keyCode;return y=16>r||r>16&&32>r||r>32&&41>r,a.begin-a.end==0||y&&8!=r&&46!=r||m(a.begin,a.end),8==r||46==r||n&&127==r?(f(a.begin+(46==r?0:-1)),!1):27==r?(p.val(w),p.caret(0,b()),!1):void 0}function v(t){if(y)return y=!1,8==t.keyCode?!1:null;t=t||window.event;var n=t.charCode||t.keyCode||t.which,a=e(this).caret();if(t.ctrlKey||t.altKey||t.metaKey)return!0;if(n>=32&&125>=n||n>186){var c=i(a.begin-1);if(u>c){var s=String.fromCharCode(n);if(o[c].test(s)){h(c),k[c]=s,g();var l=i(c);e(this).caret(l),r.completed&&l==u&&r.completed.call(p)}}}return!1}function m(e,t){for(var n=e;t>n&&u>n;n++)o[n]&&(k[n]=r.placeholder)}function g(){return p.val(k.join("")).val()}function b(e){for(var t=p.val(),n=-1,a=0,i=0;u>a;a++)if(o[a]){for(k[a]=r.placeholder;i++<t.length;){var c=t.charAt(i-1);if(o[a].test(c)){k[a]=c,n=a;break}}if(i>t.length)break}else k[a]==t[i]&&a!=s&&(i++,n=a);return!e&&s>n+1?(p.val(""),m(0,u)):(e||n+1>=s)&&(g(),e||p.val(p.val().substring(0,n+1))),s?a:l}var p=e(this),k=e.map(a.split(""),function(e){return"?"!=e?c[e]?r.placeholder:e:void 0}),y=!1,w=p.val();p.data("buffer",k).data("tests",o),p.attr("readonly")||p.one("unmask",function(){p.unbind(".mask").removeData("buffer").removeData("tests")}).bind("focus.mask",function(){w=p.val();var e=b();g(),setTimeout(function(){e==a.length?p.caret(0,e):p.caret(e)},0)}).bind("blur.mask",function(){b(),p.val()!=w&&p.change()}).bind("keydown.mask",d).bind("keypress.mask",v).bind(t,function(){setTimeout(function(){p.caret(b(!0))},0)}),b()})}})}(jQuery);
+1
View File
@@ -0,0 +1 @@
!function(t){function i(t,i){return"function"==typeof t?t.call(i):t}function e(i,e){this.$element=t(i),this.options=e,this.enabled=!0,this.fixTitle()}e.prototype={show:function(){var e=this.getTitle();if(e&&this.enabled){var s=this.tip();s.find(".tipsy-inner")[this.options.html?"html":"text"](e),s[0].className="tipsy",s.remove().css({top:0,left:0,visibility:"hidden",display:"block"}).prependTo(document.body);var n,o=t.extend({},this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight}),l=s[0].offsetWidth,a=s[0].offsetHeight,f=i(this.options.gravity,this.$element[0]);switch(f.charAt(0)){case"n":n={top:o.top+o.height+this.options.offset,left:o.left+o.width/2-l/2};break;case"s":n={top:o.top-a-this.options.offset,left:o.left+o.width/2-l/2};break;case"e":n={top:o.top+o.height/2-a/2,left:o.left-l-this.options.offset};break;case"w":n={top:o.top+o.height/2-a/2,left:o.left+o.width+this.options.offset}}2==f.length&&(n.left="w"==f.charAt(1)?o.left+o.width/2-15:o.left+o.width/2-l+15),s.css(n).addClass("tipsy-"+f),s.find(".tipsy-arrow")[0].className="tipsy-arrow tipsy-arrow-"+f.charAt(0),this.options.className&&s.addClass(i(this.options.className,this.$element[0])),this.options.fade?s.stop().css({opacity:0,display:"block",visibility:"visible"}).animate({opacity:this.options.opacity}):s.css({visibility:"visible",opacity:this.options.opacity})}},hide:function(){this.options.fade?this.tip().stop().fadeOut(function(){t(this).remove()}):this.tip().remove()},fixTitle:function(){var t=this.$element;(t.attr("title")||"string"!=typeof t.attr("original-title"))&&t.attr("original-title",t.attr("title")||"").removeAttr("title")},getTitle:function(){var t,i=this.$element,e=this.options;this.fixTitle();var t,e=this.options;return"string"==typeof e.title?t=i.attr("title"==e.title?"original-title":e.title):"function"==typeof e.title&&(t=e.title.call(i[0])),t=(""+t).replace(/(^\s*|\s*$)/,""),t||e.fallback},tip:function(){return this.$tip||(this.$tip=t('<div class="tipsy"></div>').html('<div class="tipsy-arrow"></div><div class="tipsy-inner"></div>')),this.$tip},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled}},t.fn.tipsy=function(i){function s(s){var n=t.data(s,"tipsy");return n||(n=new e(s,t.fn.tipsy.elementOptions(s,i)),t.data(s,"tipsy",n)),n}function n(){var t=s(this);t.hoverState="in",0==i.delayIn?t.show():(t.fixTitle(),setTimeout(function(){"in"==t.hoverState&&t.show()},i.delayIn))}function o(){var t=s(this);t.hoverState="out",0==i.delayOut?t.hide():setTimeout(function(){"out"==t.hoverState&&t.hide()},i.delayOut)}if(i===!0)return this.data("tipsy");if("string"==typeof i){var l=this.data("tipsy");return l&&l[i](),this}if(i=t.extend({},t.fn.tipsy.defaults,i),i.live||this.each(function(){s(this)}),"manual"!=i.trigger){var a=i.live?"live":"bind",f="hover"==i.trigger?"mouseenter":"focus",h="hover"==i.trigger?"mouseleave":"blur";this[a](f,n)[a](h,o)}return this},t.fn.tipsy.defaults={className:null,delayIn:0,delayOut:0,fade:!1,fallback:"",gravity:"n",html:!1,live:!1,offset:0,opacity:.8,title:"title",trigger:"hover"},t.fn.tipsy.elementOptions=function(i,e){return t.metadata?t.extend({},e,t(i).metadata()):e},t.fn.tipsy.autoNS=function(){return t(this).offset().top>t(document).scrollTop()+t(window).height()/2?"s":"n"},t.fn.tipsy.autoWE=function(){return t(this).offset().left>t(document).scrollLeft()+t(window).width()/2?"e":"w"},t.fn.tipsy.autoBounds=function(i,e){return function(){var s={ns:e[0],ew:e.length>1?e[1]:!1},n=t(document).scrollTop()+i,o=t(document).scrollLeft()+i,l=t(this);return l.offset().top<n&&(s.ns="n"),l.offset().left<o&&(s.ew="w"),t(window).width()+t(document).scrollLeft()-l.offset().left<i&&(s.ew="e"),t(window).height()+t(document).scrollTop()-l.offset().top<i&&(s.ns="s"),s.ns+(s.ew?s.ew:"")}}}(jQuery);
+1
View File
@@ -0,0 +1 @@
jQuery.noConflict(),_msie=!1,_msie_version=0,"undefined"==typeof navigator.userAgentData&&navigator.userAgent.match(/MSIE ([0-9]+)\./)&&(_msie=!0,_msie_version=RegExp.$1);var _disable_save=!1;jQuery(document).ready(function(e){function t(e){return decodeURI((RegExp(e+"=(.+?)(&|$)").exec(location.search)||[,""])[1])}function i(t){var i=t;return this.timer&&clearTimeout(i.timer),this.timer=setTimeout(function(){e(i).parent().prev().find("strong").text(i.value)},100),!0}function o(t,i){var o=e(t).val(),a="style_link_"+i,n=i+"_ggf_previewer";if(o)if(e("."+n).fadeIn(),"none"!==o&&"Select a font"!==o){e("."+a).remove();var s=o.replace(/\s+/g,"+"),r=["Arial","Trebuchet","Times","Tahoma","Helvetica"];-1===r.indexOf(s)&&e("head").append('<link href="https://fonts.googleapis.com/css?family='+s+'" rel="stylesheet" type="text/css" class="'+a+'">'),e("."+n).css("font-family",o+", sans-serif")}else e("."+n).css("font-family",""),e("."+n).fadeOut()}function a(t,i){var o,a=(e(".uploaded-file"),e(this));return t.preventDefault(),o?(o.open(),void 0):(o=wp.media({title:a.data("choose"),button:{text:a.data("update"),close:!1}}),o.on("select",function(){var e=o.state().get("selection").first();o.close(),i.find(".upload").val(e.attributes.url),"image"==e.attributes.type&&i.find(".screenshot").empty().hide().append('<img class="of-option-image" src="'+e.attributes.url+'" />').slideDown("fast"),i.find(".media_upload_button").trigger("off"),i.find(".remove-image").show().removeClass("hide"),i.find(".of-background-properties").slideDown(),s()}),o.open(),void 0)}function n(t){t.find(".remove-image").hide().addClass("hide"),t.find(".upload").val(""),t.find(".of-background-properties").hide(),t.find(".screenshot").slideUp(),t.find(".remove-file").trigger("off"),e(".section-upload .upload-notice").length>0&&e(".media_upload_button").remove(),s()}function s(){e(".remove-image, .remove-file").on("click",function(){n(e(this).parents(".section-upload, .section-media, .slide_body"))}),e(".media_upload_button").off("click").on("click",function(t){a(t,e(this).parents(".section-upload, .section-media, .slide_body"))})}if(e(".fld").on("click",function(){var t=".f_"+this.id;e(t).slideToggle("normal","swing")}),e(".of-color").wpColorPicker(),e("#js-warning").hide(),e(".group").hide(),""!=t("tab")&&e.cookie("of_current_opt","#"+t("tab"),{expires:7,path:"/"}),null===e.cookie("of_current_opt"))e(".group:first-child").fadeIn(200),e("#of-nav li:first-child").addClass("current");else{var r=e("#hooks").html();r=JSON.parse(r),e.each(r,function(t,i){e.cookie("of_current_opt")=="#of-option-"+i&&(e(".group#of-option-"+i).fadeIn(200),e("#of-nav li."+i).addClass("current"))})}e("#of-nav li a").on("click",function(t){t.preventDefault(),e("#of-nav li").removeClass("current"),e(this).parent().addClass("current");var i=e(this).attr("href");return e.cookie("of_current_opt",i,{expires:7,path:"/"}),e(".group").hide(),e(i).fadeIn(200),!1});var d=0;e("#expand_options").on("click",function(){0==d?(d=1,e("#of_container #of-nav").hide(),e("#of_container #content").width("100%"),e("#of_container .group").add("#of_container .group h2").show(),e(this).removeClass("expand"),e(this).addClass("close"),e(this).text("Close")):(d=0,e("#of_container #of-nav").show(),e("#of_container #content").width("75%"),e("#of_container .group").add("#of_container .group h2").hide(),e("#of_container .group:first-child").show(),e("#of_container #of-nav li").removeClass("current"),e("#of_container #of-nav li:first-child").addClass("current"),e(this).removeClass("close"),e(this).addClass("expand"),e(this).text("Expand"),e("#content").removeClass("opt-searching"),e("body").trigger("clear-search-otp"))}),e.fn.center=function(){return this.animate({top:(e(window).height()-this.height()-200)/2+e(window).scrollTop()+"px"},100),this.css("left",e("#of_container").length&&e("#of_container").width()>270?(e("#of_container").width()-270)/2:250),this},e("#of-popup-save").center(),e("#of-popup-reset").center(),e("#of-popup-fail").center(),e(window).on("scroll",function(){e("#of-popup-save").center(),e("#of-popup-reset").center(),e("#of-popup-fail").center()}),e(".of-radio-img-img").on("click",function(){e(this).parent().parent().find(".of-radio-img-img").removeClass("of-radio-img-selected"),e(this).addClass("of-radio-img-selected")}),e(".of-radio-img-label").hide(),e(".of-radio-img-img").show(),e(".of-radio-img-radio").hide(),e(".of-radio-tile-img").on("click",function(){e(this).parent().parent().find(".of-radio-tile-img").removeClass("of-radio-tile-selected"),e(this).addClass("of-radio-tile-selected")}),e(".of-radio-tile-label").hide(),e(".of-radio-tile-img").show(),e(".of-radio-tile-radio").hide(),function(e){styleSelect={init:function(){e(".select_wrapper").each(function(){e(this).prepend("<span>"+e(this).find(".select option:selected").text()+"</span>")}),e("body").on("change",".select",function(){e(this).prev("span").replaceWith("<span>"+e(this).find("option:selected").text()+"</span>")}),e(".select").on(Line truncated
+4
View File
@@ -0,0 +1,4 @@
/* Modernizr 2.6.2 (Custom Build) | MIT & BSD
* Build: http://modernizr.com/download/#-opacity-cssanimations-shiv-testprop-testallprops-prefixes-domprefixes
*/
;window.Modernizr=function(a,b,c){function x(a){i.cssText=a}function y(a,b){return x(l.join(a+";")+(b||""))}function z(a,b){return typeof a===b}function A(a,b){return!!~(""+a).indexOf(b)}function B(a,b){for(var d in a){var e=a[d];if(!A(e,"-")&&i[e]!==c)return b=="pfx"?e:!0}return!1}function C(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:z(f,"function")?f.bind(d||b):f}return!1}function D(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+n.join(d+" ")+d).split(" ");return z(b,"string")||z(b,"undefined")?B(e,b):(e=(a+" "+o.join(d+" ")+d).split(" "),C(e,b,c))}var d="2.6.2",e={},f=b.documentElement,g="modernizr",h=b.createElement(g),i=h.style,j,k={}.toString,l=" -webkit- -moz- -o- -ms- ".split(" "),m="Webkit Moz O ms",n=m.split(" "),o=m.toLowerCase().split(" "),p={},q={},r={},s=[],t=s.slice,u,v={}.hasOwnProperty,w;!z(v,"undefined")&&!z(v.call,"undefined")?w=function(a,b){return v.call(a,b)}:w=function(a,b){return b in a&&z(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=t.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(t.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(t.call(arguments)))};return e}),p.opacity=function(){return y("opacity:.55"),/^0.55$/.test(i.opacity)},p.cssanimations=function(){return D("animationName")};for(var E in p)w(p,E)&&(u=E.toLowerCase(),e[u]=p[E](),s.push((e[u]?"":"no-")+u));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)w(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof enableClasses!="undefined"&&enableClasses&&(f.className+=" "+(b?"":"no-")+a),e[a]=b}return e},x(""),h=j=null,function(a,b){function k(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function l(){var a=r.elements;return typeof a=="string"?a.split(" "):a}function m(a){var b=i[a[g]];return b||(b={},h++,a[g]=h,i[h]=b),b}function n(a,c,f){c||(c=b);if(j)return c.createElement(a);f||(f=m(c));var g;return f.cache[a]?g=f.cache[a].cloneNode():e.test(a)?g=(f.cache[a]=f.createElem(a)).cloneNode():g=f.createElem(a),g.canHaveChildren&&!d.test(a)?f.frag.appendChild(g):g}function o(a,c){a||(a=b);if(j)return a.createDocumentFragment();c=c||m(a);var d=c.frag.cloneNode(),e=0,f=l(),g=f.length;for(;e<g;e++)d.createElement(f[e]);return d}function p(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return r.shivMethods?n(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+l().join().replace(/\w+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(r,b.frag)}function q(a){a||(a=b);var c=m(a);return r.shivCSS&&!f&&!c.hasCSS&&(c.hasCSS=!!k(a,"article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}mark{background:#FF0;color:#000}")),j||p(a,c),a}var c=a.html5||{},d=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,e=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,f,g="_html5shiv",h=0,i={},j;(function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",f="hidden"in a,j=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){f=!0,j=!0}})();var r={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,supportsUnknownElements:j,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:q,createElement:n,createDocumentFragment:o};a.html5=r,q(b)}(this,b),e._version=d,e._prefixes=l,e._domPrefixes=o,e._cssomPrefixes=n,e.testProp=function(a){return B([a])},e.testAllProps=D,e}(this,this.document);
+860
View File
@@ -0,0 +1,860 @@
/**
* Total XML files
* @type Number
*/
var _total = 25;
var _act = 1;
var _run = false;
var _time_out;
var _clear_time_out;
var _installing = false;
var _processing = false;
var _clicking = false;
var _elm_ext = false;
var current_wpb = false;
var current_elm = false;
var _home_wpb = [];
var _home_elm = [];
var _imported_home = 0;
var _count_home = 0;
/**
* Document Ready
*
* @type type
*/
jQuery(document).ready(function ($) {
'use strict';
/**
* INIT Tab WPB - ELM
*
* @returns {undefined}
*/
setTimeout(function() {
if ($('.nasa-tabs-heading').find('.nasa-tab-heading').length) {
var _clicked = false;
$('.nasa-tabs-heading li').each(function() {
if (!_clicked) {
if (!$(this).hasClass('disabled')) {
$(this).find('.nasa-tab-heading').trigger('click');
_clicked = true;
}
}
});
}
if ($('.recommend-plugins').length <= 0) {
$('.main-demo-data').show();
}
if ($('.builder-plugin').length <= 0) {
$('.confirm-selected-plugins').removeClass('nasa-disabled');
} else {
if ($('.builder-plugin').length === 2 && $('.builder-plugin.selected').length <= 0) {
if (!$('.confirm-selected-plugins').hasClass('nasa-disabled')) {
$('.confirm-selected-plugins').addClass('nasa-disabled');
}
} else {
$('.confirm-selected-plugins').removeClass('nasa-disabled');
}
}
}, 100);
/**
* Search Homes
*/
$('body').on('keyup', '#ns-homes-search-input', function() {
var _textsearch = $.trim($(this).val());
_textsearch = _textsearch.replace(/ /g, "-");
if (_textsearch === '') {
$('.demo-homepage-item-wrap').removeClass('ns-hide');
} else {
var patt = new RegExp(_textsearch);
$('.demo-homepage-item-wrap').each(function() {
var _sstext = $(this).find('.demo-homepage-item').attr('data-home');
if (patt.test(_sstext)) {
$(this).removeClass('ns-hide');
} else {
if (!$(this).hasClass('ns-hide')) {
$(this).addClass('ns-hide');
}
}
});
}
});
/**
* Select Home to import
*/
$('body').on('click', '.main-demo-data .demo-homepage-item', function() {
$(this).toggleClass('selected');
setTimeout(function() {
if ($('.main-demo-data .demo-homepage-item.selected').length) {
if (!$('.main-demo-data .nasa-start-import').hasClass('selected')) {
$('.main-demo-data .nasa-start-import').addClass('selected');
}
} else {
$('.main-demo-data .nasa-start-import').removeClass('selected');
}
}, 10);
});
/**
* Recommend Plugins
*/
$('body').on('click', '.recommend-plugin', function() {
var _this = $(this);
if (!$(_this).hasClass('required-plugin') && !$(_this).hasClass('child-plugin')) {
if (!$(_this).hasClass('builder-plugin')) {
$(_this).toggleClass('selected');
} else {
var _slug = $(_this).attr('data-slug');
$('.builder-plugin:not(.plg-' + _slug + ')').removeClass('selected');
$(_this).toggleClass('selected');
}
}
if ($('.child-plugin').length) {
$('.recommend-plugin:not(.child-plugin)').each(function() {
var _root = $(this);
var _slug_root = $(_root).attr('data-slug');
if ($('.child-plugin.parent-plg-' + _slug_root).length) {
if ($(_root).hasClass('selected')) {
if (!$('.child-plugin.parent-plg-' + _slug_root).hasClass('selected')) {
$('.child-plugin.parent-plg-' + _slug_root).addClass('selected');
}
} else {
$('.child-plugin.parent-plg-' + _slug_root).removeClass('selected');
}
}
});
}
if ($('.builder-plugin').length <= 0) {
$('.confirm-selected-plugins').removeClass('nasa-disabled');
} else {
if ($('.builder-plugin').length === 2 && $('.builder-plugin.selected').length <= 0) {
if (!$('.confirm-selected-plugins').hasClass('nasa-disabled')) {
$('.confirm-selected-plugins').addClass('nasa-disabled');
}
} else {
$('.confirm-selected-plugins').removeClass('nasa-disabled');
}
}
});
/**
* Confirm plugins selected
*/
$('body').on('click', '.confirm-selected-plugins', function() {
var _this = $(this);
if (!$(_this).hasClass('nasa-disabled')) {
$('.recommend-plugins').hide();
if ($('.builder-plugin').length) {
$('.builder-plugin').each(function() {
var _slug = $(this).attr('data-slug');
var _selected = $(this).hasClass('selected') ? true : false;
if (!_selected) {
if (!$('.tab-heading-' + _slug).hasClass('disabled')) {
$('.tab-heading-' + _slug).addClass('disabled');
}
if (!$('.tab-content-' + _slug).hasClass('disabled')) {
$('.tab-content-' + _slug).addClass('disabled');
}
}
});
}
$('.main-demo-data').show();
var _clicked = false;
$('.nasa-tabs-heading li').each(function() {
if (!_clicked) {
if (!$(this).hasClass('disabled')) {
$(this).find('.nasa-tab-heading').trigger('click');
_clicked = true;
}
}
});
}
});
/**
* Tabs WPB - ELM
*/
$('body').on('click', '.nasa-tab-heading', function() {
var _this = $(this);
if (!_clicking && !$(_this).hasClass('selected')) {
_clicking = true;
var _target = $(_this).attr('data-target');
$('.nasa-tabs-heading').find('.nasa-tab-heading').removeClass('selected');
$('.nasa-tabs-panel').find('.demo-homepage-item-wrap').removeClass('nasa-active');
$('.nasa-tabs-panel .nasa-tab-content').removeClass('nasa-show');
if ($('.nasa-tabs-panel').find(_target).length) {
$('.nasa-tabs-panel').find(_target).addClass('nasa-show');
$(_this).addClass('selected');
setTimeout(function() {
$('.nasa-tabs-panel').find(_target + ' .demo-homepage-item-wrap').addClass('nasa-active');
_clicking = false;
}, 300);
}
}
});
/**
* Confirm unload window when process runing.
*/
$(window).on('beforeunload', function(){
if (_processing) {
return 'Are you sure you want to leave?';
}
});
$('body').on('click', '.nasa-back-step', function() {
$('.recommend-plugins').show();
$('.main-demo-data').hide();
$('.nasa-tabs-heading li').removeClass('disabled');
$('.nasa-tab-content').removeClass('disabled');
$('.nasa-tab-content .demo-homepage-item, .nasa-start-import').removeClass('selected');
});
$('body').on('click', '.nasa-select-all', function() {
$('.demo-homepages-wrap').each(function() {
var _wrap = $(this);
if (!$(_wrap).hasClass('disabled')) {
$(_wrap).find('.demo-homepage-item').each(function() {
var _home = $(this);
if (!$(_home).hasClass('selected')) {
$(_home).addClass('selected');
}
});
}
});
if (!$('.nasa-start-import').hasClass('selected')) {
$('.nasa-start-import').addClass('selected');
}
});
/**
* Click Demo Data
*/
$('body').on('click', '.nasa-start-import.selected', function() {
if (!$(this).hasClass('processing')) {
_processing = true;
$(this).addClass('processing');
$('.runing-hide').hide();
$('.nasa-select-homepage').hide();
$('.nasa-start-import').hide();
$('.nasa-back-step').hide();
$('.nasa-select-all').hide();
$('.main-demo-data-notice').hide();
$('.ns-homes-search').hide();
$('.processing-demo-data').show();
$('.processing-demo-data').show();
$('.processing-steps li.step-first').addClass('runing');
if ($('.process-bar-loading').length) {
$('.process-bar-loading').addClass('loading');
}
if ($('.recommend-plugin.selected').length) {
$('.recommend-plugin.selected').each(function() {
var _this = $(this);
var _text = '<span class="plg-lbl">' + $(_this).attr('data-name') + '</span>';
var _slug = $(_this).attr('data-slug');
$('.plugins-installed').append('<li class="nasa-label-plg nasa-wait plg-' + _slug + '">' + _text + '</li>');
});
}
if ($('.demo-homepages-wpb .demo-homepage-item.selected').length) {
$('.demo-homepages-wpb .demo-homepage-item.selected').each(function() {
var _slug = $(this).attr('data-home');
_home_wpb.push(_slug);
});
}
if ($('.demo-homepages-elm .demo-homepage-item.selected').length) {
$('.demo-homepages-elm .demo-homepage-item.selected').each(function() {
var _slug = $(this).attr('data-home');
_home_elm.push(_slug);
});
}
_count_home = _home_wpb.length + _home_elm.length;
$('.statistic-homes').html(_imported_home + '/' + _count_home);
// nasa_import_homes($);
_time_out = setInterval(function () {
if (!_run) {
nasa_import_demo_data($);
_run = true;
if ($('.process-bar-finished').length) {
var _total_steps = $('.processing-steps li.step').length;
var _finished = $('.processing-steps li.step.finished').length;
var text_per = Math.round(_finished / _total_steps * 100);
$('.process-bar-finished').css({width: text_per + '%'});
$('.process-bar-finished').html(text_per + '%');
}
}
}, 500);
_clear_time_out = setInterval(function () {
if ($('.processing-steps li.step-end.step.finished').length || $('.processing-steps li.step.step-end.fail').length) {
clearInterval(_time_out);
clearInterval(_clear_time_out);
$('.processing-notice-first').hide();
$('.processing-notice-last').show();
_processing = false;
}
}, 500);
}
});
$('body').on('mouseover', '.addition-demo-data .demo-homepage-item', function() {
var _this = $(this);
if ($(_this).find('.ns-import-btn').length <= 0) {
var _btn = $('#ns-import-btn-tmp').html();
$(_this).append(_btn);
}
});
/**
* Addition Homepage
*/
$('body').on('click', '.addition-demo-data .demo-homepage-item:not(.selected)', function() {
if (confirm('Are you sure you want to add this homepage as the homepage of your website?')) {
var _this = $(this);
var _parents = $(_this).parents('.addition-demo-data');
if (!$(_parents).hasClass('adding')) {
$(_parents).addClass('adding');
var _home = $(_this).attr('data-home');
var _home_type = $(_this).parents('.demo-homepages-elm').length ? 'elm' : 'wpb';
$.ajax({
url: ajax_admin_demo_data,
type: 'post',
dataType: 'json',
cache: false,
data: {
'action': 'nasa_adddition_home',
'home_type': _home_type,
'home': _home
},
beforeSend: function() {
$(_this).addClass('importing');
},
success: function (res) {
if (res.success === '1') {
$(_this).removeClass('importing');
$(_this).addClass('selected');
}
$(_parents).removeClass('adding');
},
error: function() {
$(_parents).removeClass('adding');
$(_this).removeClass('importing');
}
});
}
} else {
return false;
}
});
});
/**
* Step 1
* Install Child Theme
*
* @param {type} $
* @returns {undefined}
*/
function nasa_install_child_theme($) {
$.ajax({
url: ajax_admin_demo_data,
type: 'post',
timeout: 600000,
data: {
action: 'nasa_install_child_theme'
},
success: function (res) {
if (res === '1') {
$('.processing-steps li[data-step="1"]').removeClass('runing');
$('.processing-steps li[data-step="1"]').addClass('finished');
$('.processing-steps li[data-step="2"]').addClass('runing');
} else {
$('.processing-steps li[data-step="1"]').removeClass('runing');
$('.processing-steps li[data-step="1"]').addClass('fail');
$('.processing-steps li[data-step="2"]').addClass('runing');
}
_run = false;
},
error: function() {
$('.processing-steps li[data-step="1"]').removeClass('runing');
$('.processing-steps li[data-step="1"]').addClass('fail');
$('.processing-steps li[data-step="2"]').addClass('runing');
_run = false;
}
});
}
/**
* Step 2
* Install Plugins
*
* @param {type} $
* @returns {undefined}
*/
function nasa_install_plugins($) {
if (!_installing) {
_installing = true;
var _this = $('.recommend-plugin.selected').first();
var _slug = $(_this).attr('data-slug');
if ($('.plugins-installed').find('.plg-' + _slug).length) {
$('.plugins-installed').find('.plg-' + _slug).removeClass('nasa-wait');
$('.plugins-installed').find('.plg-' + _slug).addClass('loading');
}
$.ajax({
url: ajax_admin_demo_data,
type: 'post',
dataType: 'json',
timeout: 300000,
data: {
action: 'nasa_install_plugin',
plg: _slug
},
success: function (res) {
$(_this).remove();
if (typeof res.status !== 'undefined' && res.status === '1') {
if ($('.plugins-installed').find('.plg-' + _slug).length) {
$('.plugins-installed').find('.plg-' + _slug).removeClass('loading');
$('.plugins-installed').find('.plg-' + _slug).addClass('ins-sccess');
}
} else {
if ($('.plugins-installed').find('.plg-' + _slug).length) {
$('.plugins-installed').find('.plg-' + _slug).removeClass('loading');
$('.plugins-installed').find('.plg-' + _slug).addClass('ins-error');
}
}
_installing = false;
_run = false;
},
error: function() {
_installing = false;
_run = false;
}
});
if ($('.recommend-plugin.selected').length <= 0) {
$('.processing-steps li[data-step="2"]').removeClass('runing');
$('.processing-steps li[data-step="2"]').addClass('finished');
$('.processing-steps li[data-step="3"]').addClass('runing');
_installing = false;
_run = false;
}
}
}
/**
* Step 3
* Import Demo data
*
* @param {type} $
* @returns {undefined}
*/
function nasa_import_data($) {
var _file = 'data' + (_act.toString());
$.ajax({
url: ajax_admin_demo_data,
type: 'post',
dataType: 'json',
timeout: 300000,
data: {
'action': 'nasa_import_contents',
'file': _file
},
success: function (res) {
if (_act >= _total) {
$('.processing-steps li[data-step="3"]').removeClass('runing');
$('.processing-steps li[data-step="3"]').addClass('finished');
$('.processing-steps li[data-step="4"]').addClass('runing');
}
if (_act <= _total) {
$('.statistic-data').html(_act.toString() + '/' + _total.toString());
}
_act += 1;
_run = false;
},
error: function () {
_act += 1;
_run = false;
}
});
}
/**
* Step 4
* Import Widgets Sidebar
*
* @param {type} $
* @returns {undefined}
*/
function nasa_import_widgets_sidebar($) {
$.ajax({
url: ajax_admin_demo_data,
type: 'post',
timeout: 300000,
data: {
action: 'nasa_import_widgets_sidebar'
},
success: function (res) {
if (res === '1') {
$('.processing-steps li[data-step="4"]').removeClass('runing');
$('.processing-steps li[data-step="4"]').addClass('finished');
$('.processing-steps li[data-step="5"]').addClass('runing');
} else {
$('.processing-steps li[data-step="4"]').removeClass('runing');
$('.processing-steps li[data-step="4"]').addClass('fail');
$('.processing-steps li[data-step="5"]').addClass('runing');
}
_run = false;
},
error: function() {
$('.processing-steps li[data-step="4"]').removeClass('runing');
$('.processing-steps li[data-step="4"]').addClass('fail');
$('.processing-steps li[data-step="5"]').addClass('runing');
_run = false;
}
});
}
/**
* Step 5
* Import HOME
*
* @param {type} $
* @returns {undefined}
*/
function nasa_import_homes($) {
if (!_elm_ext) {
$.ajax({
url: ajax_admin_demo_data,
type: 'post',
timeout: 300000,
data: {
action: 'nasa_import_elm_ext'
},
success: function (res) {
_elm_ext = true;
_run = false;
},
error: function() {
_elm_ext = true;
_run = false;
}
});
} else {
if (_home_wpb.length > 0) {
current_wpb = _home_wpb[0];
current_elm = false;
_home_wpb.shift();
} else if(_home_elm.length > 0) {
current_elm = _home_elm[0];
current_wpb = false;
_home_elm.shift();
} else {
current_wpb = current_elm = false;
}
if (current_wpb || current_elm) {
$.ajax({
url: ajax_admin_demo_data,
type: 'post',
timeout: 300000,
data: {
action: 'nasa_import_home',
wpb: (current_wpb ? current_wpb : ''),
elm: (current_elm ? current_elm : '')
},
success: function (res) {
if (res === '1') {
_imported_home += 1;
$('.statistic-homes').html(_imported_home + '/' + _count_home);
}
if (_imported_home >= _count_home) {
$('.processing-steps li[data-step="5"]').removeClass('runing');
$('.processing-steps li[data-step="5"]').addClass('finished');
$('.processing-steps li[data-step="6"]').addClass('runing');
}
_run = false;
},
error: function() {
$('.processing-steps li[data-step="5"]').removeClass('runing');
$('.processing-steps li[data-step="5"]').addClass('fail');
$('.processing-steps li[data-step="6"]').addClass('runing');
_run = false;
}
});
} else {
$('.processing-steps li[data-step="5"]').removeClass('runing');
$('.processing-steps li[data-step="5"]').addClass('finished');
$('.processing-steps li[data-step="6"]').addClass('runing');
_run = false;
}
}
}
/**
* Step 6
* Import RevSlider
*
* @param {type} $
* @returns {undefined}
*/
function nasa_import_revslider($) {
var _li = $("li.nasa-item-rev:not(.item-loaded)").first();
/**
* Next step
*/
if ($(_li).length <= 0) {
$('.processing-steps li[data-step="6"]').removeClass('runing');
$('.processing-steps li[data-step="6"]').addClass('finished');
$('.processing-steps li[data-step="7"]').addClass('runing');
setTimeout(function() {
_run = false;
}, 500);
} else {
/**
* Next item to import
*/
var _revslider = $(_li).attr('data-file');
$(_li).addClass('loading');
$.ajax({
url: ajax_admin_demo_data,
type: 'post',
timeout: 300000,
data: {
action: 'nasa_import_revslider',
'revslider': _revslider
},
success: function (res) {
if (res === '1') {
$(_li).removeClass('loading');
$(_li).addClass('item-loaded');
$(_li).addClass('finished');
} else {
$(_li).removeClass('loading');
$(_li).addClass('item-loaded');
$(_li).addClass('fail');
}
_run = false;
},
error: function() {
$(_li).removeClass('loading');
$(_li).addClass('item-loaded');
$(_li).addClass('fail');
_run = false;
}
});
}
}
/* function nasa_import_revsliders($) {
$.ajax({
url: ajax_admin_demo_data,
type: 'post',
timeout: 300000,
data: {
action: 'nasa_import_revsliders'
},
success: function (res) {
if (res === '1') {
$('.processing-steps li[data-step="6"]').removeClass('runing');
$('.processing-steps li[data-step="6"]').addClass('finished');
$('.processing-steps li[data-step="7"]').addClass('runing');
} else {
$('.processing-steps li[data-step="6"]').removeClass('runing');
$('.processing-steps li[data-step="6"]').addClass('fail');
$('.processing-steps li[data-step="7"]').addClass('runing');
}
_run = false;
},
error: function() {
$('.processing-steps li[data-step="6"]').removeClass('runing');
$('.processing-steps li[data-step="6"]').addClass('fail');
$('.processing-steps li[data-step="7"]').addClass('runing');
_run = false;
}
});
} */
/**
* Step 7
* Global Options
*
* @param {type} $
* @returns {undefined}
*/
function nasa_global_options($) {
$.ajax({
url: ajax_admin_demo_data,
type: 'post',
timeout: 300000,
data: {
action: 'nasa_global_options'
},
success: function (res) {
if (res === '1') {
var permalink_url = $('.nasa-start-import.selected').attr('data-permalink-option');
$.ajax({
url: permalink_url,
type: 'get',
cache: false,
data: {},
success: function(res) {
var $html = $.parseHTML(res);
var _back_menu = $('#adminmenu', $html);
if ($('#adminmenu').length) {
$('#adminmenu').replaceWith(_back_menu);
if ($('#menu-settings').length) {
$('#menu-settings').removeClass('wp-menu-open');
$('#menu-settings').removeClass('wp-has-current-submenu');
$('#menu-settings').addClass('wp-not-current-submenu');
$('#menu-settings').find('a.menu-top').removeClass('wp-has-current-submenu').addClass('wp-not-current-submenu');
}
if ($('#menu-appearance').length){
$('#menu-appearance').removeClass('wp-not-current-submenu');
$('#menu-appearance').addClass('wp-has-current-submenu');
$('#menu-appearance').addClass('wp-menu-open');
$('#menu-appearance').find('a.menu-top').removeClass('wp-not-current-submenu').addClass('wp-has-current-submenu');
}
}
$('.processing-steps li[data-step="7"]').removeClass('runing');
$('.processing-steps li[data-step="7"]').addClass('finished');
_run = false;
},
error: function() {
$('.processing-steps li[data-step="7"]').removeClass('runing');
$('.processing-steps li[data-step="7"]').addClass('finished');
_run = false;
}
});
} else {
$('.processing-steps li[data-step="7"]').removeClass('runing');
$('.processing-steps li[data-step="7"]').addClass('fail');
_run = false;
}
},
error: function() {
$('.processing-steps li[data-step="7"]').removeClass('runing');
$('.processing-steps li[data-step="7"]').addClass('fail');
_run = false;
}
});
}
/**
* All Steps
* Step Install Demo Data
*
* @param {type} $
* @returns {undefined}
*/
function nasa_import_demo_data($) {
var _step = $('.processing-steps li.runing').attr('data-step');
if (_step) {
switch (_step) {
case '1':
nasa_install_child_theme($);
break;
case '2':
nasa_install_plugins($);
break;
case '3':
nasa_import_data($);
break;
case '4':
nasa_import_widgets_sidebar($);
break;
case '5':
nasa_import_homes($);
break;
case '6':
nasa_import_revslider($);
break;
case '7':
nasa_global_options($);
break;
default:
break;
}
}
}
+910
View File
@@ -0,0 +1,910 @@
var top_bar_left_df = '';
var content_custom_df = '';
var time_delay = 200;
var time_out_input = null;
var mediaUploader;
jQuery(document).ready(function($) {
"use strict";
// loadListIcons($);
var text_now = $('textarea#topbar_left').val();
$('body').on('click', '.reset_topbar_left', function() {
if ($('textarea#topbar_left').val() !== top_bar_left_df) {
var _confirm = confirm('Are you sure to reset top bar left ?');
if (_confirm) {
$('textarea#topbar_left').val(top_bar_left_df);
}
}
return false;
});
$('body').on('click', '.restore_topbar_left', function() {
if (text_now !== $('textarea#topbar_left').val()) {
var _confirm = confirm('Are you sure to restore top bar left ?');
if (_confirm) {
$('textarea#topbar_left').val(text_now);
}
}
return false;
});
var text_content_now = $('textarea#content_custom').val();
$('body').on('click', '.reset_content_custom', function() {
if ($('textarea#content_custom').val() !== content_custom_df) {
var _confirm = confirm('Are you sure to reset your content custom ?');
if (_confirm) {
$('textarea#content_custom').val(content_custom_df);
}
}
return false;
});
$('body').on('click', '.restore_content_custom', function() {
if (text_content_now !== $('textarea#content_custom').val()) {
var _confirm = confirm('Are you sure to restore your content custom ?');
if (_confirm) {
$('textarea#content_custom').val(text_content_now);
}
}
return false;
});
$('body').on('click', '.toggle-choose-icon-btn', function() {
$(this).parents('.widget-content').find('.toggle-choose-icon').toggleClass('hidden-tag');
});
$('body').on('click', '.nasa-chosen-icon', function() {
var _fill = $(this).attr('data-fill');
if (_fill) {
if ($('.nasa-list-icons-select').length < 1) {
$.ajax({
url: ajaxurl,
type: 'get',
dataType: 'html',
data: {
action: 'nasa_list_fonts_admin',
fill: _fill
},
success: function(res) {
$('body').append(res);
$('body').append('<div class="nasa-tranparent" />');
$('.nasa-list-icons-select').animate({right: 0}, 300);
}
});
} else {
$('body').append('<div class="nasa-tranparent" />');
$('.nasa-list-icons-select').attr('data-fill', _fill);
$('.nasa-list-icons-select').animate({right: 0}, 300);
}
}
return false;
});
$('body').on('click', '.nasa-tranparent', function() {
if ($('.nasa-list-icons-select').length) {
$('.nasa-list-icons-select').animate({right: '-500px'}, 300);
}
$(this).remove();
});
// Search icons
$('body').on('keyup', '.nasa-input-search-icon', function() {
searchIcons($);
});
$('body').on('click', '.nasa-fill-icon', function() {
var _val = $(this).attr('data-val');
var _fill = $(this).parent().attr('data-fill');
if ($('#'+_fill).length) {
$('#'+_fill).val(_val);
}
if ($('input[name="'+_fill+'"]').length) {
$('input[name="'+_fill+'"]').val(_val);
}
if ($('#ico-'+_fill).length) {
$('#ico-'+_fill).html('<i class="' + _val + '"></i><a href="javascript:void(0);" class="nasa-remove-icon" data-id="' + _fill + '"><i class="fa fa-remove"></i></a>');
}
$('.nasa-tranparent').click();
});
$('body').on('click', '.nasa-remove-icon', function() {
var _fill = $(this).attr('data-id');
if ($('#'+_fill).length) {
$('#'+_fill).val('');
}
if ($('input[name="'+_fill+'"]').length) {
$('input[name="'+_fill+'"]').val('');
}
if ($('#ico-'+_fill).length) {
$('#ico-'+_fill).html('');
}
});
loadColorPicker($);
$('.widget-control-save').ajaxComplete(function() {
loadColorPicker($);
});
$(document).ajaxComplete(function() {
if ($('input[name="section_nasa_icon"]').length) {
$('input[name="section_nasa_icon"]').attr('readonly', true);
}
if ($('.vc_ui-panel-window select[name="i_type"]').length) {
var _change = false;
$('.vc_ui-panel-window select[name="i_type"] option').each(function() {
if ('fontawesome' !== $(this).attr('value')) {
$(this).remove();
_change = true;
}
});
if (_change) {
$('.vc_ui-panel-window select[name="i_type"]').val('fontawesome').trigger('change');
}
}
});
$('body').on('change', '.nasa-select-attr', function() {
var _warp = $(this).parents('.widget-content');
if ($(_warp).find('.nasa-vari-type').val() === '1') {
var taxonomy = $(this).val(),
num = $(this).attr('data-num'),
instance = $(_warp).find('.nasa-widget-instance').attr('data-instance');
loadColorDefault($, _warp, taxonomy, num, instance, false);
}
return true;
});
$('body').on('change', '.nasa-vari-type', function() {
var _warp = $(this).parents('.widget-content'),
taxonomy = $(_warp).find('.nasa-select-attr').val(),
num = $(_warp).find('.nasa-select-attr').attr('data-num'),
instance = $(_warp).find('.nasa-widget-instance').attr('data-instance');
if ($(this).val() === '1') {
loadColorDefault($, _warp, taxonomy, num, instance, true);
} else {
unloadColor($, _warp);
}
return true;
});
// Option Breadcrumb
if ($('.nasa-breadcrumb-flag-option input[type="checkbox"]').is(':checked')) {
$('.nasa-breadcrumb-type-option').show();
$('.nasa-breadcrumb-align-option').show();
if ($('.nasa-breadcrumb-type-option').find('select').val() === 'has-background') {
$('.nasa-breadcrumb-bg-option').show();
// $('.nasa-breadcrumb-bg-lax').show();
loadImgOpBreadcrumb($);
}
}
$('body').on('change', '.nasa-breadcrumb-flag-option input[type="checkbox"]', function() {
if ($(this).is(':checked')) {
$('.nasa-breadcrumb-type-option').fadeIn(200);
$('.nasa-breadcrumb-align-option').fadeIn(200);
if ($('.nasa-breadcrumb-type-option').find('select').val() === 'has-background') {
$('.nasa-breadcrumb-bg-option').fadeIn(200);
// $('.nasa-breadcrumb-bg-lax').fadeIn(200);
loadImgOpBreadcrumb($);
}
} else {
$('.nasa-breadcrumb-type-option').fadeOut(200);
$('.nasa-breadcrumb-bg-option').fadeOut(200);
// $('.nasa-breadcrumb-bg-lax').fadeOut(200);
$('.nasa-breadcrumb-align-option').fadeOut(200);
}
});
$('body').on('change', '.nasa-breadcrumb-type-option select', function() {
if ($(this).val() === 'has-background') {
$('.nasa-breadcrumb-bg-option').fadeIn(200);
$('.nasa-breadcrumb-color-option').fadeIn(200);
// $('.nasa-breadcrumb-bg-lax').fadeIn(200);
$('.nasa-breadcrumb-height-option').fadeIn(200);
$('.nasa-breadcrumb-text-option').fadeIn(200);
loadImgOpBreadcrumb($);
} else {
$('.nasa-breadcrumb-bg-option').fadeOut(200);
$('.nasa-breadcrumb-color-option').fadeOut(200);
// $('.nasa-breadcrumb-bg-lax').fadeOut(200);
$('.nasa-breadcrumb-height-option').fadeOut(200);
$('.nasa-breadcrumb-text-option').fadeOut(200);
}
});
/* if ($('.type_promotion select').length) {
var val_promotion = $('.type_promotion select').val();
if (val_promotion === 'custom') {
$('.nasa-custom_content').show();
} else if (val_promotion === 'list-posts') {
$('.nasa-list_post').show();
}
$('body').on('change', '.type_promotion select', function() {
var val_promotion = $(this).val();
if (val_promotion === 'custom') {
$('.nasa-custom_content').fadeIn(200);
$('.nasa-list_post').fadeOut(200);
} else if (val_promotion === 'list-posts') {
$('.nasa-custom_content').fadeOut(200);
$('.nasa-list_post').fadeIn(200);
}
});
} */
/* if ($('.nasa-header-type-select input[type="radio"][name="header-type"]').length > 0) {
var _val_header = $('.nasa-header-type-select input[type="radio"][name="header-type"]:checked').val();
$('.nasa-header-type-select-' + _val_header).slideDown(200);
$('body').on('click', '.nasa-header-type-select img.of-radio-img-img', function() {
var _val_header = $('.nasa-header-type-select input[type="radio"][name="header-type"]:checked').val();
$('.nasa-header-type-select-' + _val_header).slideDown(200);
$('.nasa-header-type-child').each(function() {
if (!$(this).hasClass('nasa-header-type-select-' + _val_header)) {
$(this).slideUp(200);
}
});
});
} */
/* if ($('.nasa-type-font select').length) {
var _val_font = $('.nasa-type-font select').val();
$('.nasa-type-font-' + _val_font).slideDown(200);
$('body').on('change', '.nasa-type-font select', function() {
var _val_font = $(this).val();
$('.nasa-type-font-glb').slideUp(200);
$('.nasa-type-font-' + _val_font).slideDown(200);
});
} */
$('.nasa-theme-option-parent select').each(function() {
var _val = $(this).val();
var _id = $(this).attr('id');
$('.nasa-' + _id + '.nasa-theme-option-child').hide();
$('.nasa-' + _id + '-' + _val + '.nasa-theme-option-child').show();
});
$('body').on('change', '.nasa-theme-option-parent select', function() {
var _val = $(this).val();
var _id = $(this).attr('id');
$('.nasa-' + _id + '.nasa-theme-option-child').slideUp(200);
$('.nasa-' + _id + '-' + _val + '.nasa-theme-option-child').slideDown(200);
});
if ($('.nasa-theme-option-parent input[type="radio"]:checked').length) {
$('.nasa-theme-option-parent input[type="radio"]:checked').each(function() {
var _this = $(this);
var _val = $(_this).val();
var _id = $(_this).attr('name');
$('.nasa-' + _id + '.nasa-theme-option-child').hide();
$('.nasa-' + _id + '-' + _val + '.nasa-theme-option-child').show();
});
}
$('body').on('click', '.nasa-theme-option-parent img.of-radio-img-img', function() {
var _this = $(this);
var _parents = $(_this).parents('.nasa-theme-option-parent');
var _val = $(_parents).find('input[type="radio"]:checked').val();
var _id = $(_parents).find('input[type="radio"]:checked').attr('name');
$('.nasa-' + _id + '.nasa-theme-option-child').slideUp(200);
$('.nasa-' + _id + '-' + _val + '.nasa-theme-option-child').slideDown(200);
});
if ($('.nasa-topbar_toggle input[type="checkbox"]').is(':checked')) {
$('.nasa-topbar_df-show').show();
}
$('body').on('change', '.nasa-topbar_toggle input[type="checkbox"]', function() {
if ($(this).is(':checked')) {
$('.nasa-topbar_df-show').slideDown(200);
} else {
$('.nasa-topbar_df-show').slideUp(200);
}
});
$('body').on('ns_main_child', function () {
if ($('[data-child_of]').length) {
$('[data-child_of]').each(function() {
var _this = $(this);
var _main = $(_this).attr('data-child_of');
if (_main && $('#section-' + _main).length) {
var _vals_str = $(_this).attr('data-target');
var _vals = _vals_str ? _vals_str.split(',') : [];
var _main_val = '';
/**
* For Checkbox
*/
if ($('#section-' + _main).find('input[type="checkbox"]').length) {
if ($('#section-' + _main).find('input[type="checkbox"]').is(':checked')) {
_main_val = $('#section-' + _main).find('input[type="checkbox"]').val();
} else {
_main_val = $('#section-' + _main).find('input[type="hidden"]').val();
}
}
/**
* For Radio
*/
if ($('#section-' + _main).find('input[type="radio"]').length) {
$('#section-' + _main).find('input[type="radio"]').each(function () {
if ($(this).is(':checked')) {
_main_val = $(this).val();
}
});
}
/**
* For Select
*/
if ($('#section-' + _main).find('select').length) {
_main_val = $('#section-' + _main).find('select').val();
}
if (_vals.indexOf(_main_val) !== -1) {
$(_this).removeClass('ns-child-hide');
} else {
if (!$(_this).hasClass('ns-child-hide')) {
$(_this).addClass('ns-child-hide');
}
}
}
});
}
}).trigger('ns_main_child');
$('body').on('change', '.section-switch .checkbox, .section-images .checkbox, .section-select select', function() {
$('body').trigger('ns_main_child');
});
/**
* Ajax field
*
* @param {type} $
* @returns {undefined}
*/
$('body').on('click', '.nasa-init-ajax', function() {
var _wrap = $(this).parents('.nasa-opt-ajax-wrap');
$(_wrap).find('.nasa-info-ajax').hide();
$(_wrap).find('.nasa-do-ajax').show();
});
$('body').on('click', '.nasa-cancel-ajax', function() {
var _wrap = $(this).parents('.nasa-opt-ajax-wrap');
$(_wrap).find('.nasa-info-ajax').show();
$(_wrap).find('.nasa-do-ajax').hide();
});
$('body').on('click', '.nasa-apply-ajax', function() {
if (!_disable_save) {
_disable_save = true;
var _this = $(this);
var _wrap = $(_this).parents('.nasa-opt-ajax-wrap');
var _action = $(_this).attr('data-action');
var _old_val = $(_wrap).find('input.nasa-org-input').val();
var _value = $(_wrap).find('input.nasa-do-ajax-input').val();
if (_value && _value !== _old_val) {
$.ajax({
url: ajaxurl,
type: 'post',
dataType: 'json',
cache: false,
data: {
action: _action,
data_value: _value
},
beforeSend: function() {
$(_wrap).addClass('nasa-loading');
},
success: function(res) {
if (res.success === 'ok') {
$(_wrap).find('.value-show').html(res.result);
$(_wrap).find('input.nasa-do-ajax-input').val(res.result).trigger('change');
$(_wrap).find('input.nasa-org-input').val(res.result).trigger('change');
$(_wrap).find('.nasa-ajax-mess').html(res.mess);
$(_wrap).find('.nasa-ajax-mess').show();
$(_wrap).removeClass('nasa-loading');
$(_wrap).find('.nasa-cancel-ajax').trigger('click');
setTimeout(function() {
_disable_save = false;
}, 100);
setTimeout(function() {
$(_wrap).find('.nasa-ajax-mess').fadeOut(300);
}, 3000);
} else {
$(_wrap).find('.nasa-ajax-mess').html(res.mess);
$(_wrap).find('.nasa-ajax-mess').show();
$(_wrap).removeClass('nasa-loading');
setTimeout(function() {
_disable_save = false;
}, 100);
setTimeout(function() {
$(_wrap).find('.nasa-ajax-mess').fadeOut(300);
}, 3000);
}
},
error: function() {
$(_wrap).removeClass('nasa-loading');
setTimeout(function() {
_disable_save = false;
}, 100);
setTimeout(function() {
$(_wrap).find('.nasa-ajax-mess').fadeOut(300);
}, 3000);
}
});
} else {
_disable_save = false;
}
}
});
$('body').on('change', '#white_lbl', function() {
if ($(this).is(':checked')) {
$('.nasa-online-doc').hide();
} else {
$('.nasa-online-doc').show();
}
});
/**
*
* Toggle Section
*/
$('body').on('click', '.ns-toggle-section', function() {
var _wrap = $(this).parents('.section');
$(this).toggleClass('ns-hide');
$(_wrap).toggleClass('ns-hide');
});
/**
*
* Toggle Sections
*/
$('body').on('click', '.ns-toggle-sections', function() {
var _this = $(this);
var _wrap = $(_this).parents('.section-info');
var _show = $(_this).hasClass('ns-hide') ? true : false;
if (_show) {
$(_this).removeClass('ns-hide');
}
else {
$(_this).addClass('ns-hide');
}
var _next = $(_wrap).next();
ns_toggle_sections($, _next, _show);
});
/* $('body').on('ns_check_ct_categories', function() {
if ($('#enable_nasa_custom_categories').length) {
if ($('#enable_nasa_custom_categories').is(':checked')) {
$('#section-nasa_custom_categories_slug').fadeIn(200);
$('#section-archive_product_nasa_custom_categories').fadeIn(200);
$('#section-max_level_nasa_custom_categories').fadeIn(200);
}
else {
$('#section-nasa_custom_categories_slug').fadeOut(200);
$('#section-archive_product_nasa_custom_categories').fadeOut(200);
$('#section-max_level_nasa_custom_categories').fadeOut(200);
}
}
}).trigger('ns_check_ct_categories');
$('body').on('change', '#enable_nasa_custom_categories', function() {
$('body').trigger('ns_check_ct_categories');
}); */
$('body').on('click', '.ns-show-less', function() {
var _wrap = $(this).parents('.ns-show-less-wrap');
if ($(_wrap).length) {
$(_wrap).toggleClass('show-less');
}
});
if ($('#wpwrap').length && $('.ns-need-update-core-notice').length) {
var _padding = $('.ns-need-update-core-notice').outerHeight();
$('#wpwrap').css({'padding-bottom': _padding});
}
$('body').on('keyup', '#search_otp', function(e) {
var _str = $(this).val();
var _expand_opts = $('body').find('#expand_options');
var _section_info = null;
if (typeof time_out_input !== 'undefined' && time_out_input) {
clearTimeout(time_out_input);
}
time_out_input = setTimeout(function() {
$('body').trigger('clear-search-otp');
if (_str.trim().length >= 3) {
if ($(_expand_opts).hasClass('expand')) {
$(_expand_opts).trigger('click');
}
$("#content .section").each(function() {
var _this = $(this);
var _pa = $(_this).parents('.group');
var _str2 = $(_this).find('h3.heading').text();
$('#content').addClass('opt-searching');
if ($(_this).hasClass('section-info')) {
_section_info = _this;
} else {
if (_str2.toUpperCase().includes(_str.toUpperCase().trim()) && !$(_this).hasClass('ns-child-hide')) {
$(_this).addClass('ns-opt-found');
if (!$(_pa).hasClass('ns-gr-found')) {
$(_pa).addClass('ns-gr-found');
}
if (!$(_section_info).hasClass('section-info-found') && $(_section_info).parents('.group').length) {
$(_section_info).addClass('section-info-found');
_section_info = null;
}
}
}
});
} else {
$('#content').removeClass('opt-searching');
if ($(_expand_opts).hasClass('close')) {
$(_expand_opts).trigger('click');
}
}
},time_delay);
});
$('body').on('clear-search-otp', function() {
$("#content .section").each(function() {
var _this = $(this);
var _pa = $(_this).parents('.group');
if ($(_pa).hasClass('ns-gr-found')) {
$(_pa).removeClass('ns-gr-found');
}
if ($(_this).hasClass('ns-opt-found')) {
$(_this).removeClass('ns-opt-found');
}
if ($(_this).hasClass('section-info-found')) {
$(_this).removeClass('section-info-found');
}
});
});
/**
* Actived theme options menu
*/
$('body').on('ns_check_theme_menu_current', function() {
if ($('.toplevel_page_nasa-theme-options.wp-not-current-submenu .wp-submenu .current').length) {
$('.toplevel_page_nasa-theme-options.wp-not-current-submenu').removeClass('wp-not-current-submenu').addClass('wp-has-current-submenu');
}
}).trigger('ns_check_theme_menu_current');
$('body').on('ns_init_ns_hfe_type_edit', function() {
if ($('.ns-hfe-type select').length) {
$('.ns-hfe-type select').each(function() {
var _this = $(this);
var _wrap = $(_this).parents('.ns-hfe-type');
var _href = $(_wrap).find('.nshfe-edit').length ? $(_wrap).find('.nshfe-edit').attr('data-href') : null;
if (_href) {
var _id = $(_this).val();
if (_id && _id !== '0') {
_href = _href.replace(/ns_hfe_id/g, _id);
$(_wrap).find('.nshfe-edit').attr('href', _href);
$(_wrap).find('.nshfe-edit').attr('target', '_blank');
$(_wrap).find('.nshfe-edit').show();
} else {
$(_wrap).find('.nshfe-edit').removeAttr('target');
$(_wrap).find('.nshfe-edit').attr('href', '#');
$(_wrap).find('.nshfe-edit').hide();
}
}
});
}
}).trigger('ns_init_ns_hfe_type_edit');
$('body').on('change', '.ns-hfe-type select', function() {
$('body').trigger('ns_init_ns_hfe_type_edit');
});
$('body').on('ns_init_ns_wpb_type_edit', function() {
if ($('.ns-wpb-type select').length) {
$('.ns-wpb-type select').each(function() {
var _this = $(this);
var _wrap = $(_this).parents('.ns-wpb-type');
var _href = $(_wrap).find('.nswpb-edit').length ? $(_wrap).find('.nswpb-edit').attr('data-href') : null;
if (_href) {
var _id = $(_this).find('option:selected').attr('data-id');
if (_id && _id !== '0') {
_href = _href.replace(/ns_wpb_id/g, _id);
$(_wrap).find('.nswpb-edit').attr('href', _href);
$(_wrap).find('.nswpb-edit').attr('target', '_blank');
$(_wrap).find('.nswpb-edit').show();
} else {
$(_wrap).find('.nswpb-edit').removeAttr('target');
$(_wrap).find('.nswpb-edit').attr('href', '#');
$(_wrap).find('.nswpb-edit').hide();
}
}
});
}
}).trigger('ns_init_ns_wpb_type_edit');
$('body').on('change', '.ns-wpb-type select', function() {
$('body').trigger('ns_init_ns_wpb_type_edit');
});
$('body').on('ns_init_ns_blk_type_edit', function() {
if ($('.ns-block-type select').length) {
$('.ns-block-type select').each(function() {
var _this = $(this);
var _wrap = $(_this).parents('.ns-block-type');
var _href_stb = $(_wrap).find('.nsblk-edit').length ? $(_wrap).find('.nsblk-edit').attr('data-stb-href') : null;
var _href_ctb = $(_wrap).find('.nsblk-edit').length ? $(_wrap).find('.nsblk-edit').attr('data-ctb-href') : null;
if (_href_stb && _href_ctb) {
var _id = $(_this).find('option:selected').attr('data-id');
var _type = $(_this).find('option:selected').attr('data-type');
if (_id && _id !== '0') {
var _href = _type === 'nshfe' ? _href_ctb : _href_stb;
_href = _href.replace(/ns_blk_id/g, _id);
$(_wrap).find('.nsblk-edit').attr('href', _href);
$(_wrap).find('.nsblk-edit').attr('target', '_blank');
$(_wrap).find('.nsblk-edit').show();
} else {
$(_wrap).find('.nsblk-edit').removeAttr('target');
$(_wrap).find('.nsblk-edit').attr('href', '#');
$(_wrap).find('.nsblk-edit').hide();
}
}
});
}
}).trigger('ns_init_ns_blk_type_edit');
$('body').on('change', '.ns-block-type select', function() {
$('body').trigger('ns_init_ns_blk_type_edit');
});
$('body').on('ns_init_ns_wpcf7_type_edit', function() {
if ($('.ns-wpcf7-type select').length) {
$('.ns-wpcf7-type select').each(function() {
var _this = $(this);
var _wrap = $(_this).parents('.ns-wpcf7-type');
var _href = $(_wrap).find('.nswpcf7-edit').length ? $(_wrap).find('.nswpcf7-edit').attr('data-href') : null;
if (_href) {
var _id = parseInt($(_this).val());
if (_id) {
_href = _href.replace(/ns_wpcf7_id/g, _id);
$(_wrap).find('.nswpcf7-edit').attr('href', _href);
$(_wrap).find('.nswpcf7-edit').attr('target', '_blank');
$(_wrap).find('.nswpcf7-edit').show();
} else {
$(_wrap).find('.nswpcf7-edit').removeAttr('target');
$(_wrap).find('.nswpcf7-edit').attr('href', '#');
$(_wrap).find('.nswpcf7-edit').hide();
}
}
});
}
}).trigger('ns_init_ns_wpcf7_type_edit');
$('body').on('change', '.ns-wpcf7-type select', function() {
$('body').trigger('ns_init_ns_wpcf7_type_edit');
});
$('body').on('click', '.nasa-item-review-thumb .item-review-thumb-remove', function() {
var _this = $(this),
_pa = $(_this).parent('.nasa-item-review-thumb'),
_input_id = $('.nasa-wrap-review-thumb').find('input[name="data-medias-id"]'),
id_remove = $(_this).attr('data-id_media'),
_ids = JSON.parse($(_input_id).val());
_ids = _ids.filter(function(id) {
return id != id_remove;
});
$(_input_id).val(JSON.stringify(_ids));
$(_pa).remove();
});
$('body').on('click', '.nasa-wrap-review-thumb .media_upload_button', function(e) {
e.preventDefault();
var _input_id = $('.nasa-wrap-review-thumb').find('input[name="data-medias-id"]'),
_ids = $(_input_id).val() ? JSON.parse($(_input_id).val()) : [];
if (mediaUploader) {
mediaUploader.open();
return;
}
mediaUploader = wp.media.frames.file_frame = wp.media({
multiple: true
});
mediaUploader.on('select', function() {
var selection = mediaUploader.state().get('selection');
var urls = [];
selection.map(function(attachment) {
var media = '';
attachment = attachment.toJSON();
_ids.push(attachment.id);
if (attachment.mime.startsWith('video/')) {
media = '<video controls autoplay loop><source src="' + attachment.url + '" type="' + attachment.mime + '"></video>';
} else {
media = '<img src="' + attachment.url + '"/>';
}
$('.nasa-wrap-review-thumb').find('.media_upload_button').before('<div class="nasa-item-review-thumb">' + media + '<a href="javascript:void(0);" data-id_media="' + attachment.id + '" class="item-review-thumb-remove button-primary"><svg class="ns-df-cart-svg" width="25" height="25" stroke-width="2" viewBox="0 0 24 24" fill="currentColor"><path d="M12 6V18" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path><path d="M6 12H18" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path></svg></a></div>');
});
$(_input_id).val(JSON.stringify(_ids));
});
// Mở media uploader
mediaUploader.open();
});
/* =============== End document ready !!! ================== */
});
function loadImgOpBreadcrumb($) {
if ($('.nasa-breadcrumb-bg-option .screenshot').length && $('.nasa-breadcrumb-bg-option #breadcrumb_bg_upload').val() !== '') {
if ($('.nasa-breadcrumb-bg-option .screenshot').html() === '') {
$('.nasa-breadcrumb-bg-option .screenshot').html('<img class="of-option-image" src="' + $('.nasa-breadcrumb-bg-option #breadcrumb_bg_upload').val() + '" />');
$('.upload_button_div .remove-image').removeClass('hide').show();
}
}
}
function loadColorDefault($, _warp, _taxonomy, _num, _instance, _check) {
if (_check && $(_warp).find('.nasa_p_color').length) {
var _this = $(_warp).find('.nasa_p_color');
$(_this).find('input').prop('disabled', false);
$(_this).show();
}else{
_instance = _instance.toLocaleString();
$.ajax({
url: ajaxurl,
type: 'post',
dataType: 'html',
data: {
action: 'nasa_list_colors_admin',
taxonomy: _taxonomy,
num: _num,
instance: _instance
},
success: function(res) {
$(_warp).find('.nasa_p_color').remove();
$(_warp).append(res);
loadColorPicker($);
}
});
}
}
function unloadColor($, _warp) {
var _this = $(_warp).find('.nasa_p_color');
$(_this).find('input').prop('disabled', true);
$(_this).hide();
}
function loadColorPicker($) {
$('.nasa-color-field').each(function() {
if ($(this).parents('.wp-picker-container').length < 1) {
$(this).wpColorPicker();
}
});
};
function loadListIcons($) {
if ($('.nasa-list-icons-select').length < 1) {
$.ajax({
url: ajaxurl,
type: 'get',
dataType: 'html',
data: {
action: 'nasa_list_fonts_admin',
fill: ''
},
success: function(res) {
$('body').append(res);
}
});
}
};
function searchIcons($) {
var _textsearch = $.trim($('.nasa-input-search-icon').val());
if (_textsearch === '') {
$('.nasa-font-icons').fadeIn(200);
} else {
var patt = new RegExp(_textsearch);
$('.nasa-font-icons').each(function() {
var _sstext = $(this).attr('data-text');
if (patt.test(_sstext)) {
$(this).fadeIn(200);
} else {
$(this).fadeOut(200);
}
});
}
}
function ns_toggle_sections($, _tag, _show) {
if ($(_tag).length && !$(_tag).hasClass('section-info')) {
if (_show) {
$(_tag).slideDown(200);
} else {
$(_tag).slideUp(200);
}
var _next = $(_tag).next();
ns_toggle_sections($, _next, _show);
}
}
+14
View File
@@ -0,0 +1,14 @@
jQuery(document).ready(function($){
"use strict";
$('body').on('nasa_admin_init_select2', function() {
if ($('select.nasa-ad-select2:not(.nasa-inited)').length) {
$('select.nasa-ad-select2:not(.nasa-inited)').each(function() {
$(this).addClass('nasa-inited');
$(this).select2();
});
}
}).trigger('nasa_admin_init_select2');
/* =============== End document ready !!! ================== */
});
File diff suppressed because it is too large. Load diff
+16
View File
@@ -0,0 +1,16 @@
/*!
* Select2 4.0.3
* https://select2.github.io
*
* Released under the MIT license
* https://github.com/select2/select2/blob/master/LICENSE.md
*/
!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?e(require("jquery")):e(jQuery)}(function(e){var t=function(){if(e&&e.fn&&e.fn.select2&&e.fn.select2.amd)var t=e.fn.select2.amd;var n,i,o,r;return t&&t.requirejs||(t?i=t:t={},function(e){var t,r,s,a,l={},c={},u={},d={},p=Object.prototype.hasOwnProperty,h=[].slice,f=/\.js$/;function g(e,t){return p.call(e,t)}function m(e,t){var n,i,o,r,s,a,l,c,d,p,h,g=t&&t.split("/"),m=u.map,v=m&&m["*"]||{};if(e&&"."===e.charAt(0))if(t){for(s=(e=e.split("/")).length-1,u.nodeIdCompat&&f.test(e[s])&&(e[s]=e[s].replace(f,"")),e=g.slice(0,g.length-1).concat(e),d=0;d<e.length;d+=1)if("."===(h=e[d]))e.splice(d,1),d-=1;else if(".."===h){if(1===d&&(".."===e[2]||".."===e[0]))break;d>0&&(e.splice(d-1,2),d-=2)}e=e.join("/")}else 0===e.indexOf("./")&&(e=e.substring(2));if((g||v)&&m){for(d=(n=e.split("/")).length;d>0;d-=1){if(i=n.slice(0,d).join("/"),g)for(p=g.length;p>0;p-=1)if((o=m[g.slice(0,p).join("/")])&&(o=o[i])){r=o,a=d;break}if(r)break;!l&&v&&v[i]&&(l=v[i],c=d)}!r&&l&&(r=l,a=c),r&&(n.splice(0,a,r),e=n.join("/"))}return e}function v(t,n){return function(){var i=h.call(arguments,0);return"string"!=typeof i[0]&&1===i.length&&i.push(null),r.apply(e,i.concat([t,n]))}}function y(e){return function(t){l[e]=t}}function _(n){if(g(c,n)){var i=c[n];delete c[n],d[n]=!0,t.apply(e,i)}if(!g(l,n)&&!g(d,n))throw new Error("No "+n);return l[n]}function w(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}s=function(e,t){var n,i=w(e),o=i[0];return e=i[1],o&&(n=_(o=m(o,t))),o?e=n&&n.normalize?n.normalize(e,function(e){return function(t){return m(t,e)}}(t)):m(e,t):(o=(i=w(e=m(e,t)))[0],e=i[1],o&&(n=_(o))),{f:o?o+"!"+e:e,n:e,pr:o,p:n}},a={require:function(e){return v(e)},exports:function(e){var t=l[e];return void 0!==t?t:l[e]={}},module:function(e){return{id:e,uri:"",exports:l[e],config:function(e){return function(){return u&&u.config&&u.config[e]||{}}}(e)}}},t=function(t,n,i,o){var r,u,p,h,f,m,w=[],$=typeof i;if(o=o||t,"undefined"===$||"function"===$){for(n=!n.length&&i.length?["require","exports","module"]:n,f=0;f<n.length;f+=1)if("require"===(u=(h=s(n[f],o)).f))w[f]=a.require(t);else if("exports"===u)w[f]=a.exports(t),m=!0;else if("module"===u)r=w[f]=a.module(t);else if(g(l,u)||g(c,u)||g(d,u))w[f]=_(u);else{if(!h.p)throw new Error(t+" missing "+u);h.p.load(h.n,v(o,!0),y(u),{}),w[f]=l[u]}p=i?i.apply(l[t],w):undefined,t&&(r&&r.exports!==e&&r.exports!==l[t]?l[t]=r.exports:p===e&&m||(l[t]=p))}else t&&(l[t]=i)},n=i=r=function(n,i,o,l,c){if("string"==typeof n)return a[n]?a[n](i):_(s(n,i).f);if(!n.splice){if((u=n).deps&&r(u.deps,u.callback),!i)return;i.splice?(n=i,i=o,o=null):n=e}return i=i||function(){},"function"==typeof o&&(o=l,l=c),l?t(e,n,i,o):setTimeout(function(){t(e,n,i,o)},4),r},r.config=function(e){return r(e)},n._defined=l,(o=function(e,t,n){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");t.splice||(n=t,t=[]),g(l,e)||g(c,e)||(c[e]=[e,t,n])}).amd={jQuery:!0}}(),t.requirejs=n,t.require=i,t.define=o),t.define("almond",function(){}),t.define("jquery",[],function(){var t=e||$;return null==t&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),t}),t.define("select2/utils",["jquery"],function(e){var t={};function n(e){var t=e.prototype,n=[];for(var i in t){"function"==typeof t[i]&&("constructor"!==i&&n.push(i))}return n}t.Extend=function(e,t){var n={}.hasOwnProperty;function i(){this.constructor=e}for(var o in t)n.call(t,o)&&(e[o]=t[o]);return i.prototype=t.prototype,e.prototype=new i,e.__super__=t.prototype,e},t.Decorate=function(e,t){var i=n(t),o=n(e);function r(){var n=Array.prototype.unshift,i=t.prototype.constructor.length,o=e.prototype.constructor;i>0&&(n.call(arguments,e.prototype.constructor),o=t.prototype.constructor),o.apply(this,arguments)}t.displayName=e.displayName,r.prototype=new function(){this.constructor=r};for(var s=0;s<o.length;s++){var a=o[s];r.prototype[a]=e.prototype[a]}for(var l=function(e){var n=function(){};e in r.prototype&&(n=r.prototype[e]);var i=t.prototype[e];return function(){return Array.prototype.unshift.call(arguments,n),i.apply(this,arguments)}},c=0;c<i.length;c++){var u=i[c];r.prototype[u]=l(u)}return r};var i=function(){this.listeners={}};return i.prototype.on=function(e,t){this.listeners=this.listeners||{},e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t]},i.prototype.trigger=function(e){var t=Array.prototype.slice,n=t.call(arguments,1);this.listeners=this.listeners||{},null==n&&(n=[]),0===n.length&&n.push({}),n[0]._type=e,e in this.listeners&&this.invoke(this.listeners[e],t.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},i.prototype.invoke=function(e,t){for(var n=0,i=e.length;n<i;n++)e[n].apply(this,t)},t.Observable=i,t.generateChLine truncated
/*!
* jQuery Mousewheel 3.1.13
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license
* http://jquery.org/license
*/
r=function(e){var t,n,i=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],o="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],r=Array.prototype.slice;if(e.event.fixHooks)for(var s=i.length;s;)e.event.fixHooks[i[--s]]=e.event.mouseHooks;var a=e.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var t=o.length;t;)this.addEventListener(o[--t],l,!1);else this.onmousewheel=l;e.data(this,"mousewheel-line-height",a.getLineHeight(this)),e.data(this,"mousewheel-page-height",a.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var t=o.length;t;)this.removeEventListener(o[--t],l,!1);else this.onmousewheel=null;e.removeData(this,"mousewheel-line-height"),e.removeData(this,"mousewheel-page-height")},getLineHeight:function(t){var n=e(t),i=n["offsetParent"in e.fn?"offsetParent":"parent"]();return i.length||(i=e("body")),parseInt(i.css("fontSize"),10)||parseInt(n.css("fontSize"),10)||16},getPageHeight:function(t){return e(t).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};function l(i){var o,s=i||window.event,l=r.call(arguments,1),d=0,p=0,h=0,f=0,g=0;if((i=e.event.fix(s)).type="mousewheel","detail"in s&&(h=-1*s.detail),"wheelDelta"in s&&(h=s.wheelDelta),"wheelDeltaY"in s&&(h=s.wheelDeltaY),"wheelDeltaX"in s&&(p=-1*s.wheelDeltaX),"axis"in s&&s.axis===s.HORIZONTAL_AXIS&&(p=-1*h,h=0),d=0===h?p:h,"deltaY"in s&&(d=h=-1*s.deltaY),"deltaX"in s&&(p=s.deltaX,0===h&&(d=-1*p)),0!==h||0!==p){if(1===s.deltaMode){var m=e.data(this,"mousewheel-line-height");d*=m,h*=m,p*=m}else if(2===s.deltaMode){var v=e.data(this,"mousewheel-page-height");d*=v,h*=v,p*=v}if(o=Math.max(Math.abs(h),Math.abs(p)),(!n||o<n)&&(n=o,u(s,o)&&(n/=40)),u(s,o)&&(d/=40,p/=40,h/=40),d=Math[d>=1?"floor":"ceil"](d/n),p=Math[p>=1?"floor":"ceil"](p/n),h=Math[h>=1?"floor":"ceil"](h/n),a.settings.normalizeOffset&&this.getBoundingClientRect){var y=this.getBoundingClientRect();f=i.clientX-y.left,g=i.clientY-y.top}return i.deltaX=p,i.deltaY=h,i.deltaFactor=n,i.offsetX=f,i.offsetY=g,i.deltaMode=0,l.unshift(i,d,p,h),t&&clearTimeout(t),t=setTimeout(c,200),(e.event.dispatch||e.event.handle).apply(this,l)}}function c(){n=null}function u(e,t){return a.settings.adjustOldDeltas&&"mousewheel"===e.type&&t%120==0}e.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})},"function"==typeof t.define&&t.define.amd?t.define("jquery-mousewheel",["jquery"],r):"object"==typeof exports?module.exports=r:r(e),t.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(e,t,n,i){if(null==e.fn.select2){var o=["open","close","destroy"];e.fn.select2=function(t){if("object"==typeof(t=t||{}))return this.each(function(){var i=e.extend(!0,{},t);new n(e(this),i)}),this;if("string"==typeof t){var i,r=Array.prototype.slice.call(arguments,1);return this.each(function(){var n=e(this).data("select2");null==n&&window.console&&console.error&&console.error("The select2('"+t+"') method was called on an element that is not using Select2."),i=n[t].apply(n,r)}),e.inArray(t,o)>-1?this:i}throw new Error("Invalid arguments for Select2: "+t)}}return null==e.fn.select2.defaults&&(e.fn.select2.defaults=i),n}),{define:t.define,require:t.require}}(),n=t.require("jquery.select2");return e.fn.select2.amd=t,n});
+5725
View File
File diff suppressed because it is too large. Load diff
+8
View File
@@ -0,0 +1,8 @@
/*!
* Select2 4.0.3
* https://select2.github.io
*
* Released under the MIT license
* https://github.com/select2/select2/blob/master/LICENSE.md
*/
!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?e(require("jquery")):e(jQuery)}(function(e){var t=function(){if(e&&e.fn&&e.fn.select2&&e.fn.select2.amd)var t=e.fn.select2.amd;var n,i,r;return t&&t.requirejs||(t?i=t:t={},function(e){var t,s,o,a,l={},c={},u={},d={},p=Object.prototype.hasOwnProperty,h=[].slice,f=/\.js$/;function g(e,t){return p.call(e,t)}function m(e,t){var n,i,r,s,o,a,l,c,d,p,h,g=t&&t.split("/"),m=u.map,v=m&&m["*"]||{};if(e&&"."===e.charAt(0))if(t){for(o=(e=e.split("/")).length-1,u.nodeIdCompat&&f.test(e[o])&&(e[o]=e[o].replace(f,"")),e=g.slice(0,g.length-1).concat(e),d=0;d<e.length;d+=1)if("."===(h=e[d]))e.splice(d,1),d-=1;else if(".."===h){if(1===d&&(".."===e[2]||".."===e[0]))break;d>0&&(e.splice(d-1,2),d-=2)}e=e.join("/")}else 0===e.indexOf("./")&&(e=e.substring(2));if((g||v)&&m){for(d=(n=e.split("/")).length;d>0;d-=1){if(i=n.slice(0,d).join("/"),g)for(p=g.length;p>0;p-=1)if((r=m[g.slice(0,p).join("/")])&&(r=r[i])){s=r,a=d;break}if(s)break;!l&&v&&v[i]&&(l=v[i],c=d)}!s&&l&&(s=l,a=c),s&&(n.splice(0,a,s),e=n.join("/"))}return e}function v(t,n){return function(){var i=h.call(arguments,0);return"string"!=typeof i[0]&&1===i.length&&i.push(null),s.apply(e,i.concat([t,n]))}}function y(e){return function(t){l[e]=t}}function _(n){if(g(c,n)){var i=c[n];delete c[n],d[n]=!0,t.apply(e,i)}if(!g(l,n)&&!g(d,n))throw new Error("No "+n);return l[n]}function $(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}o=function(e,t){var n,i=$(e),r=i[0];return e=i[1],r&&(n=_(r=m(r,t))),r?e=n&&n.normalize?n.normalize(e,function(e){return function(t){return m(t,e)}}(t)):m(e,t):(r=(i=$(e=m(e,t)))[0],e=i[1],r&&(n=_(r))),{f:r?r+"!"+e:e,n:e,pr:r,p:n}},a={require:function(e){return v(e)},exports:function(e){var t=l[e];return void 0!==t?t:l[e]={}},module:function(e){return{id:e,uri:"",exports:l[e],config:function(e){return function(){return u&&u.config&&u.config[e]||{}}}(e)}}},t=function(t,n,i,r){var s,u,p,h,f,m,$=[],w=typeof i;if(r=r||t,"undefined"===w||"function"===w){for(n=!n.length&&i.length?["require","exports","module"]:n,f=0;f<n.length;f+=1)if("require"===(u=(h=o(n[f],r)).f))$[f]=a.require(t);else if("exports"===u)$[f]=a.exports(t),m=!0;else if("module"===u)s=$[f]=a.module(t);else if(g(l,u)||g(c,u)||g(d,u))$[f]=_(u);else{if(!h.p)throw new Error(t+" missing "+u);h.p.load(h.n,v(r,!0),y(u),{}),$[f]=l[u]}p=i?i.apply(l[t],$):undefined,t&&(s&&s.exports!==e&&s.exports!==l[t]?l[t]=s.exports:p===e&&m||(l[t]=p))}else t&&(l[t]=i)},n=i=s=function(n,i,r,l,c){if("string"==typeof n)return a[n]?a[n](i):_(o(n,i).f);if(!n.splice){if((u=n).deps&&s(u.deps,u.callback),!i)return;i.splice?(n=i,i=r,r=null):n=e}return i=i||function(){},"function"==typeof r&&(r=l,l=c),l?t(e,n,i,r):setTimeout(function(){t(e,n,i,r)},4),s},s.config=function(e){return s(e)},n._defined=l,(r=function(e,t,n){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");t.splice||(n=t,t=[]),g(l,e)||g(c,e)||(c[e]=[e,t,n])}).amd={jQuery:!0}}(),t.requirejs=n,t.require=i,t.define=r),t.define("almond",function(){}),t.define("jquery",[],function(){var t=e||$;return null==t&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),t}),t.define("select2/utils",["jquery"],function(e){var t={};function n(e){var t=e.prototype,n=[];for(var i in t){"function"==typeof t[i]&&("constructor"!==i&&n.push(i))}return n}t.Extend=function(e,t){var n={}.hasOwnProperty;function i(){this.constructor=e}for(var r in t)n.call(t,r)&&(e[r]=t[r]);return i.prototype=t.prototype,e.prototype=new i,e.__super__=t.prototype,e},t.Decorate=function(e,t){var i=n(t),r=n(e);function s(){var n=Array.prototype.unshift,i=t.prototype.constructor.length,r=e.prototype.constructor;i>0&&(n.call(arguments,e.prototype.constructor),r=t.prototype.constructor),r.apply(this,arguments)}t.displayName=e.displayName,s.prototype=new function(){this.constructor=s};for(var o=0;o<r.length;o++){var a=r[o];s.prototype[a]=e.prototype[a]}for(var l=function(e){var n=function(){};e in s.prototype&&(n=s.prototype[e]);var i=t.prototype[e];return function(){return Array.prototype.unshift.call(arguments,n),i.apply(this,arguments)}},c=0;c<i.length;c++){var u=i[c];s.prototype[u]=l(u)}return s};var i=function(){this.listeners={}};return i.prototype.on=function(e,t){this.listeners=this.listeners||{},e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t]},i.prototype.trigger=function(e){var t=Array.prototype.slice,n=t.call(arguments,1);this.listeners=this.listeners||{},null==n&&(n=[]),0===n.length&&n.push({}),n[0]._type=e,e in this.listeners&&this.invoke(this.listeners[e],t.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},i.prototype.invoke=function(e,t){for(var n=0,i=e.length;n<i;n++)e[n].apply(this,t)},t.Observable=i,t.generateCharLine truncated
File diff suppressed because it is too large. Load diff
+16
View File
@@ -0,0 +1,16 @@
/*!
* SelectWoo 1.0.10
* https://github.com/woocommerce/selectWoo
*
* Released under the MIT license
* https://github.com/woocommerce/selectWoo/blob/master/LICENSE.md
*/
!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&module.exports?module.exports=function(t,n){return n===undefined&&(n="undefined"!=typeof window?require("jquery"):require("jquery")(t)),e(n),n}:e(jQuery)}(function(e){var t=function(){if(e&&e.fn&&e.fn.select2&&e.fn.select2.amd)var t=e.fn.select2.amd;var n,i,o,r;return t&&t.requirejs||(t?i=t:t={},function(e){var t,r,s,a,l={},c={},u={},d={},p=Object.prototype.hasOwnProperty,h=[].slice,f=/\.js$/;function g(e,t){return p.call(e,t)}function m(e,t){var n,i,o,r,s,a,l,c,d,p,h,g=t&&t.split("/"),m=u.map,v=m&&m["*"]||{};if(e){for(s=(e=e.split("/")).length-1,u.nodeIdCompat&&f.test(e[s])&&(e[s]=e[s].replace(f,"")),"."===e[0].charAt(0)&&g&&(e=g.slice(0,g.length-1).concat(e)),d=0;d<e.length;d++)if("."===(h=e[d]))e.splice(d,1),d-=1;else if(".."===h){if(0===d||1===d&&".."===e[2]||".."===e[d-1])continue;d>0&&(e.splice(d-1,2),d-=2)}e=e.join("/")}if((g||v)&&m){for(d=(n=e.split("/")).length;d>0;d-=1){if(i=n.slice(0,d).join("/"),g)for(p=g.length;p>0;p-=1)if((o=m[g.slice(0,p).join("/")])&&(o=o[i])){r=o,a=d;break}if(r)break;!l&&v&&v[i]&&(l=v[i],c=d)}!r&&l&&(r=l,a=c),r&&(n.splice(0,a,r),e=n.join("/"))}return e}function v(t,n){return function(){var i=h.call(arguments,0);return"string"!=typeof i[0]&&1===i.length&&i.push(null),r.apply(e,i.concat([t,n]))}}function y(e){return function(t){l[e]=t}}function w(n){if(g(c,n)){var i=c[n];delete c[n],d[n]=!0,t.apply(e,i)}if(!g(l,n)&&!g(d,n))throw new Error("No "+n);return l[n]}function _(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function $(e){return e?_(e):[]}s=function(e,t){var n,i,o=_(e),r=o[0],s=t[1];return e=o[1],r&&(n=w(r=m(r,s))),r?e=n&&n.normalize?n.normalize(e,(i=s,function(e){return m(e,i)})):m(e,s):(r=(o=_(e=m(e,s)))[0],e=o[1],r&&(n=w(r))),{f:r?r+"!"+e:e,n:e,pr:r,p:n}},a={require:function(e){return v(e)},exports:function(e){var t=l[e];return void 0!==t?t:l[e]={}},module:function(e){return{id:e,uri:"",exports:l[e],config:function(e){return function(){return u&&u.config&&u.config[e]||{}}}(e)}}},t=function(t,n,i,o){var r,u,p,h,f,m,_,b=[],x=typeof i;if(m=$(o=o||t),"undefined"===x||"function"===x){for(n=!n.length&&i.length?["require","exports","module"]:n,f=0;f<n.length;f+=1)if("require"===(u=(h=s(n[f],m)).f))b[f]=a.require(t);else if("exports"===u)b[f]=a.exports(t),_=!0;else if("module"===u)r=b[f]=a.module(t);else if(g(l,u)||g(c,u)||g(d,u))b[f]=w(u);else{if(!h.p)throw new Error(t+" missing "+u);h.p.load(h.n,v(o,!0),y(u),{}),b[f]=l[u]}p=i?i.apply(l[t],b):undefined,t&&(r&&r.exports!==e&&r.exports!==l[t]?l[t]=r.exports:p===e&&_||(l[t]=p))}else t&&(l[t]=i)},n=i=r=function(n,i,o,l,c){if("string"==typeof n)return a[n]?a[n](i):w(s(n,$(i)).f);if(!n.splice){if((u=n).deps&&r(u.deps,u.callback),!i)return;i.splice?(n=i,i=o,o=null):n=e}return i=i||function(){},"function"==typeof o&&(o=l,l=c),l?t(e,n,i,o):setTimeout(function(){t(e,n,i,o)},4),r},r.config=function(e){return r(e)},n._defined=l,(o=function(e,t,n){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");t.splice||(n=t,t=[]),g(l,e)||g(c,e)||(c[e]=[e,t,n])}).amd={jQuery:!0}}(),t.requirejs=n,t.require=i,t.define=o),t.define("almond",function(){}),t.define("jquery",[],function(){var t=e||$;return null==t&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),t}),t.define("select2/utils",["jquery"],function(e){var t={};function n(e){var t=e.prototype,n=[];for(var i in t){"function"==typeof t[i]&&("constructor"!==i&&n.push(i))}return n}t.Extend=function(e,t){var n={}.hasOwnProperty;function i(){this.constructor=e}for(var o in t)n.call(t,o)&&(e[o]=t[o]);return i.prototype=t.prototype,e.prototype=new i,e.__super__=t.prototype,e},t.Decorate=function(e,t){var i=n(t),o=n(e);function r(){var n=Array.prototype.unshift,i=t.prototype.constructor.length,o=e.prototype.constructor;i>0&&(n.call(arguments,e.prototype.constructor),o=t.prototype.constructor),o.apply(this,arguments)}t.displayName=e.displayName,r.prototype=new function(){this.constructor=r};for(var s=0;s<o.length;s++){var a=o[s];r.prototype[a]=e.prototype[a]}for(var l=function(e){var n=function(){};e in r.prototype&&(n=r.prototype[e]);var i=t.prototype[e];return function(){return Array.prototype.unshift.call(arguments,n),i.apply(this,arguments)}},c=0;c<i.length;c++){var u=i[c];r.prototype[u]=l(u)}return r};var i=function(){this.listeners={}};return i.prototype.on=function(e,t){this.listeners=this.listeners||{},e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t]},i.prototype.trigger=function(e){var t=Array.prototype.slice,n=t.call(arguments,1);this.listeners=this.listeners||{},null==n&&(n=[]),0===n.length&&n.push({}),n[0]._type=e,e in this.listeners&&this.invoke(this.listeners[e],t.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],Line truncated
/*!
* jQuery Mousewheel 3.1.13
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license
* http://jquery.org/license
*/
r=function(e){var t,n,i=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],o="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],r=Array.prototype.slice;if(e.event.fixHooks)for(var s=i.length;s;)e.event.fixHooks[i[--s]]=e.event.mouseHooks;var a=e.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var t=o.length;t;)this.addEventListener(o[--t],l,!1);else this.onmousewheel=l;e.data(this,"mousewheel-line-height",a.getLineHeight(this)),e.data(this,"mousewheel-page-height",a.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var t=o.length;t;)this.removeEventListener(o[--t],l,!1);else this.onmousewheel=null;e.removeData(this,"mousewheel-line-height"),e.removeData(this,"mousewheel-page-height")},getLineHeight:function(t){var n=e(t),i=n["offsetParent"in e.fn?"offsetParent":"parent"]();return i.length||(i=e("body")),parseInt(i.css("fontSize"),10)||parseInt(n.css("fontSize"),10)||16},getPageHeight:function(t){return e(t).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};function l(i){var o,s=i||window.event,l=r.call(arguments,1),d=0,p=0,h=0,f=0,g=0;if((i=e.event.fix(s)).type="mousewheel","detail"in s&&(h=-1*s.detail),"wheelDelta"in s&&(h=s.wheelDelta),"wheelDeltaY"in s&&(h=s.wheelDeltaY),"wheelDeltaX"in s&&(p=-1*s.wheelDeltaX),"axis"in s&&s.axis===s.HORIZONTAL_AXIS&&(p=-1*h,h=0),d=0===h?p:h,"deltaY"in s&&(d=h=-1*s.deltaY),"deltaX"in s&&(p=s.deltaX,0===h&&(d=-1*p)),0!==h||0!==p){if(1===s.deltaMode){var m=e.data(this,"mousewheel-line-height");d*=m,h*=m,p*=m}else if(2===s.deltaMode){var v=e.data(this,"mousewheel-page-height");d*=v,h*=v,p*=v}if(o=Math.max(Math.abs(h),Math.abs(p)),(!n||o<n)&&(n=o,u(s,o)&&(n/=40)),u(s,o)&&(d/=40,p/=40,h/=40),d=Math[d>=1?"floor":"ceil"](d/n),p=Math[p>=1?"floor":"ceil"](p/n),h=Math[h>=1?"floor":"ceil"](h/n),a.settings.normalizeOffset&&this.getBoundingClientRect){var y=this.getBoundingClientRect();f=i.clientX-y.left,g=i.clientY-y.top}return i.deltaX=p,i.deltaY=h,i.deltaFactor=n,i.offsetX=f,i.offsetY=g,i.deltaMode=0,l.unshift(i,d,p,h),t&&clearTimeout(t),t=setTimeout(c,200),(e.event.dispatch||e.event.handle).apply(this,l)}}function c(){n=null}function u(e,t){return a.settings.adjustOldDeltas&&"mousewheel"===e.type&&t%120==0}e.fn.extend({mousewheel:function(e){return e?this.on("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.off("mousewheel",e)}})},"function"==typeof t.define&&t.define.amd?t.define("jquery-mousewheel",["jquery"],r):"object"==typeof exports?module.exports=r:r(e),t.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(e,t,n,i){if(null==e.fn.selectWoo){var o=["open","close","destroy"];e.fn.selectWoo=function(t){if("object"==typeof(t=t||{}))return this.each(function(){var i=e.extend(!0,{},t);new n(e(this),i)}),this;if("string"==typeof t){var i,r=Array.prototype.slice.call(arguments,1);return this.each(function(){var n=e(this).data("select2");null==n&&window.console&&console.error&&console.error("The select2('"+t+"') method was called on an element that is not using Select2."),i=n[t].apply(n,r)}),e.inArray(t,o)>-1?this:i}throw new Error("Invalid arguments for Select2: "+t)}}return null!=e.fn.select2&&null!=e.fn.select2.defaults&&(e.fn.selectWoo.defaults=e.fn.select2.defaults),null==e.fn.selectWoo.defaults&&(e.fn.selectWoo.defaults=i),e.fn.select2=e.fn.select2||e.fn.selectWoo,n}),{define:t.define,require:t.require}}(),n=t.require("jquery.select2");return e.fn.select2.amd=t,e.fn.selectWoo.amd=t,n});
File diff suppressed because it is too large. Load diff
+8
View File
@@ -0,0 +1,8 @@
/*!
* SelectWoo 1.0.10
* https://github.com/woocommerce/selectWoo
*
* Released under the MIT license
* https://github.com/woocommerce/selectWoo/blob/master/LICENSE.md
*/
!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&module.exports?module.exports=function(t,n){return n===undefined&&(n="undefined"!=typeof window?require("jquery"):require("jquery")(t)),e(n),n}:e(jQuery)}(function(e){var t=function(){if(e&&e.fn&&e.fn.select2&&e.fn.select2.amd)var t=e.fn.select2.amd;var n,i,r;return t&&t.requirejs||(t?i=t:t={},function(e){var t,o,s,a,l={},c={},u={},d={},p=Object.prototype.hasOwnProperty,h=[].slice,f=/\.js$/;function g(e,t){return p.call(e,t)}function m(e,t){var n,i,r,o,s,a,l,c,d,p,h,g=t&&t.split("/"),m=u.map,v=m&&m["*"]||{};if(e){for(s=(e=e.split("/")).length-1,u.nodeIdCompat&&f.test(e[s])&&(e[s]=e[s].replace(f,"")),"."===e[0].charAt(0)&&g&&(e=g.slice(0,g.length-1).concat(e)),d=0;d<e.length;d++)if("."===(h=e[d]))e.splice(d,1),d-=1;else if(".."===h){if(0===d||1===d&&".."===e[2]||".."===e[d-1])continue;d>0&&(e.splice(d-1,2),d-=2)}e=e.join("/")}if((g||v)&&m){for(d=(n=e.split("/")).length;d>0;d-=1){if(i=n.slice(0,d).join("/"),g)for(p=g.length;p>0;p-=1)if((r=m[g.slice(0,p).join("/")])&&(r=r[i])){o=r,a=d;break}if(o)break;!l&&v&&v[i]&&(l=v[i],c=d)}!o&&l&&(o=l,a=c),o&&(n.splice(0,a,o),e=n.join("/"))}return e}function v(t,n){return function(){var i=h.call(arguments,0);return"string"!=typeof i[0]&&1===i.length&&i.push(null),o.apply(e,i.concat([t,n]))}}function y(e){return function(t){l[e]=t}}function _(n){if(g(c,n)){var i=c[n];delete c[n],d[n]=!0,t.apply(e,i)}if(!g(l,n)&&!g(d,n))throw new Error("No "+n);return l[n]}function $(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function w(e){return e?$(e):[]}s=function(e,t){var n,i,r=$(e),o=r[0],s=t[1];return e=r[1],o&&(n=_(o=m(o,s))),o?e=n&&n.normalize?n.normalize(e,(i=s,function(e){return m(e,i)})):m(e,s):(o=(r=$(e=m(e,s)))[0],e=r[1],o&&(n=_(o))),{f:o?o+"!"+e:e,n:e,pr:o,p:n}},a={require:function(e){return v(e)},exports:function(e){var t=l[e];return void 0!==t?t:l[e]={}},module:function(e){return{id:e,uri:"",exports:l[e],config:function(e){return function(){return u&&u.config&&u.config[e]||{}}}(e)}}},t=function(t,n,i,r){var o,u,p,h,f,m,$,b=[],A=typeof i;if(m=w(r=r||t),"undefined"===A||"function"===A){for(n=!n.length&&i.length?["require","exports","module"]:n,f=0;f<n.length;f+=1)if("require"===(u=(h=s(n[f],m)).f))b[f]=a.require(t);else if("exports"===u)b[f]=a.exports(t),$=!0;else if("module"===u)o=b[f]=a.module(t);else if(g(l,u)||g(c,u)||g(d,u))b[f]=_(u);else{if(!h.p)throw new Error(t+" missing "+u);h.p.load(h.n,v(r,!0),y(u),{}),b[f]=l[u]}p=i?i.apply(l[t],b):undefined,t&&(o&&o.exports!==e&&o.exports!==l[t]?l[t]=o.exports:p===e&&$||(l[t]=p))}else t&&(l[t]=i)},n=i=o=function(n,i,r,l,c){if("string"==typeof n)return a[n]?a[n](i):_(s(n,w(i)).f);if(!n.splice){if((u=n).deps&&o(u.deps,u.callback),!i)return;i.splice?(n=i,i=r,r=null):n=e}return i=i||function(){},"function"==typeof r&&(r=l,l=c),l?t(e,n,i,r):setTimeout(function(){t(e,n,i,r)},4),o},o.config=function(e){return o(e)},n._defined=l,(r=function(e,t,n){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");t.splice||(n=t,t=[]),g(l,e)||g(c,e)||(c[e]=[e,t,n])}).amd={jQuery:!0}}(),t.requirejs=n,t.require=i,t.define=r),t.define("almond",function(){}),t.define("jquery",[],function(){var t=e||$;return null==t&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),t}),t.define("select2/utils",["jquery"],function(e){var t={};function n(e){var t=e.prototype,n=[];for(var i in t){"function"==typeof t[i]&&("constructor"!==i&&n.push(i))}return n}t.Extend=function(e,t){var n={}.hasOwnProperty;function i(){this.constructor=e}for(var r in t)n.call(t,r)&&(e[r]=t[r]);return i.prototype=t.prototype,e.prototype=new i,e.__super__=t.prototype,e},t.Decorate=function(e,t){var i=n(t),r=n(e);function o(){var n=Array.prototype.unshift,i=t.prototype.constructor.length,r=e.prototype.constructor;i>0&&(n.call(arguments,e.prototype.constructor),r=t.prototype.constructor),r.apply(this,arguments)}t.displayName=e.displayName,o.prototype=new function(){this.constructor=o};for(var s=0;s<r.length;s++){var a=r[s];o.prototype[a]=e.prototype[a]}for(var l=function(e){var n=function(){};e in o.prototype&&(n=o.prototype[e]);var i=t.prototype[e];return function(){return Array.prototype.unshift.call(arguments,n),i.apply(this,arguments)}},c=0;c<i.length;c++){var u=i[c];o.prototype[u]=l(u)}return o};var i=function(){this.listeners={}};return i.prototype.on=function(e,t){this.listeners=this.listeners||{},e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t]},i.prototype.trigger=function(e){var t=Array.prototype.slice,n=t.call(arguments,1);this.listeners=this.listeners||{},null==n&&(n=[]),0===n.length&&n.push({}),n[0]._type=e,e in this.listeners&&this.invoke(this.listeners[e],t.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arLine truncated
+746
View File
@@ -0,0 +1,746 @@
/**
* SMOF js
*
* contains the core functionalities to be used
* inside SMOF
*/
jQuery.noConflict();
_msie = false;
_msie_version = 0;
if (typeof navigator.userAgentData === 'undefined' && navigator.userAgent.match(/MSIE ([0-9]+)\./)) {
_msie = true;
_msie_version = RegExp.$1;
}
var _disable_save = false;
/** Fire up jQuery - let's dance!
*/
jQuery(document).ready(function($) {
//(un)fold options in a checkbox-group
$('.fld').on('click', function () {
var $fold = '.f_' + this.id;
$($fold).slideToggle('normal', "swing");
});
//Color picker
$('.of-color').wpColorPicker();
//hides warning if js is enabled
$('#js-warning').hide();
//Tabify Options
$('.group').hide();
// Get the URL parameter for tab
function getURLParameter(name) {
return decodeURI((RegExp(name + '=' + '(.+?)(&|$)').exec(location.search) || [, ''])[1]);
}
// If the $_GET param of tab is set, use that for the tab that should be open
if (getURLParameter('tab') != "") {
$.cookie('of_current_opt', '#' + getURLParameter('tab'), {expires: 7, path: '/'});
}
// Display last current tab
if ($.cookie("of_current_opt") === null) {
$('.group:first-child').fadeIn(200);
$('#of-nav li:first-child').addClass('current');
} else {
var hooks = $('#hooks').html();
hooks = JSON.parse(hooks);
$.each(hooks, function (key, value) {
if ($.cookie("of_current_opt") == '#of-option-' + value) {
$('.group#of-option-' + value).fadeIn(200);
$('#of-nav li.' + value).addClass('current');
}
});
}
//Current Menu Class
$('#of-nav li a').on('click', function (evt) {
evt.preventDefault();
$('#of-nav li').removeClass('current');
$(this).parent().addClass('current');
var clicked_group = $(this).attr('href');
$.cookie('of_current_opt', clicked_group, {expires: 7, path: '/'});
$('.group').hide();
$(clicked_group).fadeIn(200);
return false;
});
//Expand Options
var flip = 0;
$('#expand_options').on('click', function () {
if (flip == 0) {
flip = 1;
$('#of_container #of-nav').hide();
$('#of_container #content').width('100%');
$('#of_container .group').add('#of_container .group h2').show();
$(this).removeClass('expand');
$(this).addClass('close');
$(this).text('Close');
} else {
flip = 0;
$('#of_container #of-nav').show();
$('#of_container #content').width('75%');
$('#of_container .group').add('#of_container .group h2').hide();
$('#of_container .group:first-child').show();
$('#of_container #of-nav li').removeClass('current');
$('#of_container #of-nav li:first-child').addClass('current');
$(this).removeClass('close');
$(this).addClass('expand');
$(this).text('Expand');
$('#content').removeClass('opt-searching');
$('body').trigger('clear-search-otp');
}
});
//Update Message popup
$.fn.center = function () {
this.animate({"top": ($(window).height() - this.height() - 200) / 2 + $(window).scrollTop() + "px"}, 100);
this.css("left", ($('#of_container').length && $('#of_container').width() > 270) ? (($('#of_container').width() - 270) / 2) : 250);
return this;
};
// $('#of-popup-save').center();
// $('#of-popup-reset').center();
// $('#of-popup-fail').center();
// $(window).on('scroll', function () {
// $('#of-popup-save').center();
// $('#of-popup-reset').center();
// $('#of-popup-fail').center();
// });
//Masked Inputs (images as radio buttons)
/* $('.of-radio-img-img').on('click', function () {
$(this).parent().parent().find('.of-radio-img-img').removeClass('of-radio-img-selected');
$(this).addClass('of-radio-img-selected');
}); */
$('body').on('click', '.ns-radio-img-a', function() {
var _this = $(this);
var _wrap = $(_this).parents('.of-radio-img-wrap');
var _wrap_all = $(_this).parents('.controls');
$(_wrap_all).find('.ns-radio-img-a').removeClass('ns-radio-img-selected');
$(_wrap_all).find('input[type="radio"]').prop('checked', false);
if (!$(_this).hasClass('ns-radio-img-selected')) {
$(_this).addClass('ns-radio-img-selected');
}
$(_wrap).find('input[type="radio"]').prop('checked', true).trigger('change');
if ($(_wrap).find('input[type="radio"]').val() == 'new-3') {
var _target_wrap = $('input[value="accordion"]').parents('.of-radio-img-wrap');
$(_target_wrap).find('.ns-radio-img-a').trigger('click');
}
});
$('.of-radio-img-label').hide();
$('.of-radio-img-img').show();
$('.of-radio-img-radio').hide();
//Masked Inputs (background images as radio buttons)
$('.of-radio-tile-img').on('click', function () {
$(this).parent().parent().find('.of-radio-tile-img').removeClass('of-radio-tile-selected');
$(this).addClass('of-radio-tile-selected');
});
$('.of-radio-tile-label').hide();
$('.of-radio-tile-img').show();
$('.of-radio-tile-radio').hide();
// Style Select
(function ($) {
styleSelect = {
init: function () {
$('.select_wrapper').each(function () {
$(this).prepend('<span>' + $(this).find('.select option:selected').text() + '</span>');
});
$('body').on('change', '.select', function () {
$(this).prev('span').replaceWith('<span>' + $(this).find('option:selected').text() + '</span>');
});
$('.select').on('change', function (event) {
$(this).prev('span').replaceWith('<span>' + $(this).find('option:selected').text() + '</span>');
});
}
};
$(document).ready(function () {
styleSelect.init();
});
})(jQuery);
/** Aquagraphite Slider MOD */
//Hide (Collapse) the toggle containers on load
$(".slide_body").hide();
//Switch the "Open" and "Close" state per click then slide up/down (depending on open/close state)
$('body').on('click', ".slide_edit_button", function () {
/*
//display as an collapses
$(".slide_header").removeClass("active");
$(".slide_body").slideUp("fast");
*/
//toggle for each
$(this).parent().toggleClass("active").next().slideToggle("fast");
return false; //Prevent the browser jump to the link anchor
});
// Update slide title upon typing
function update_slider_title(e) {
var element = e;
if (this.timer) {
clearTimeout(element.timer);
}
this.timer = setTimeout(function () {
$(element).parent().prev().find('strong').text(element.value);
}, 100);
return true;
}
$('body').on('keyup', '.of-slider-title', function () {
update_slider_title(this);
});
//Remove individual slide
$('body').on('click', '.slide_delete_button', function () {
// event.preventDefault();
var agree = confirm("Are you sure you wish to delete this slide?");
if (agree) {
var $trash = $(this).parents('li');
//$trash.slideUp('slow', function(){ $trash.remove(); }); //chrome + confirm bug made slideUp not working...
$trash.animate({
opacity: 0.25,
height: 0
}, 500, function () {
$(this).remove();
});
return false; //Prevent the browser jump to the link anchor
} else {
return false;
}
});
//Add new slide
$('body').on('click', ".slide_add_button", function () {
var slidesContainer = $(this).prev();
var sliderId = slidesContainer.attr('id');
var numArr = $('#' + sliderId + ' li').find('.order').map(function () {
var str = this.id;
str = str.replace(/\D/g, '');
str = parseFloat(str);
return str;
}).get();
var maxNum = Math.max.apply(Math, numArr);
if (maxNum < 1) {
maxNum = 0;
}
var newNum = maxNum + 1;
var newSlide = '<li class="temphide"><div class="slide_header"><strong>Slide ' + newNum + '</strong><input type="hidden" class="slide of-input order" name="' + sliderId + '[' + newNum + '][order]" id="' + sliderId + '_slide_order-' + newNum + '" value="' + newNum + '"><a class="slide_edit_button" href="#">Edit</a></div><div class="slide_body" style="display: none; "><label>Title</label><input class="slide of-input of-slider-title" name="' + sliderId + '[' + newNum + '][title]" id="' + sliderId + '_' + newNum + '_slide_title" value=""><label>Image URL</label><input class="upload slide of-input" name="' + sliderId + '[' + newNum + '][url]" id="' + sliderId + '_' + newNum + '_slide_url" value=""><div class="upload_button_div"><span class="button media_upload_button" id="' + sliderId + '_' + newNum + '">Upload</span><span class="button remove-image hide" id="reset_' + sliderId + '_' + newNum + '" title="' + sliderId + '_' + newNum + '">Remove</span></div><div class="screenshot"></div><label>Link URL (optional)</label><input class="slide of-input" name="' + sliderId + '[' + newNum + '][link]" id="' + sliderId + '_' + newNum + '_slide_link" value=""><label>Description (optional)</label><textarea class="slide of-input" name="' + sliderId + '[' + newNum + '][description]" id="' + sliderId + '_' + newNum + '_slide_description" cols="8" rows="8"></textarea><a class="slide_delete_button" href="#">Delete</a><div class="clear"></div></div></li>';
slidesContainer.append(newSlide);
var nSlide = slidesContainer.find('.temphide');
nSlide.fadeIn('fast', function () {
$(this).removeClass('temphide');
});
optionsframework_file_bindings(); // re-initialise upload image..
return false; //prevent jumps, as always..
});
//Sort slides
$('.slider').find('ul').each(function () {
var id = $(this).attr('id');
$('#' + id).sortable({
placeholder: "placeholder",
opacity: 0.6,
handle: ".slide_header",
cancel: "a"
});
});
/** Sorter (Layout Manager) */
$('.sorter').each(function () {
var id = $(this).attr('id');
$('#' + id).find('ul').sortable({
items: 'li',
placeholder: "placeholder",
connectWith: '.sortlist_' + id,
opacity: 0.6,
update: function () {
$(this).find('.position').each(function () {
var listID = $(this).parent().attr('id');
var parentID = $(this).parent().parent().attr('id');
parentID = parentID.replace(id + '_', '');
var optionID = $(this).parent().parent().parent().attr('id');
$(this).prop("name", optionID + '[' + parentID + '][' + listID + ']');
});
}
});
});
/** Ajax Backup & Restore MOD */
//backup button
$('body').on('click', '#of_backup_button', function () {
var answer = confirm("Click OK to backup your current saved options.")
if (answer) {
var clickedObject = $(this);
var clickedID = $(this).attr('id');
var nonce = $('#security').val();
var data = {
action: 'of_ajax_post_action',
type: 'backup_options',
security: nonce
};
$.post(ajaxurl, data, function (response) {
//check nonce
if (response == -1) { //failed
var fail_popup = $('#of-popup-fail');
fail_popup.addClass('active');
window.setTimeout(function () {
fail_popup.removeClass('active');
}, 2000);
} else {
var success_popup = $('#of-popup-save');
success_popup.addClass('active');
window.setTimeout(function () {
location.reload();
}, 1000);
}
});
}
return false;
});
//restore button
$('body').on('click', '#of_restore_button', function () {
var answer = confirm("'Warning: All of your current options will be replaced with the data from your last backup! Proceed?");
if (answer) {
var clickedObject = $(this);
var clickedID = $(this).attr('id');
var nonce = $('#security').val();
var data = {
action: 'of_ajax_post_action',
type: 'restore_options',
security: nonce
};
$.post(ajaxurl, data, function (response) {
//check nonce
if (response == -1) { //failed
var fail_popup = $('#of-popup-fail');
fail_popup.addClass('active');
window.setTimeout(function () {
fail_popup.removeClass('active');
}, 2000);
} else {
var success_popup = $('#of-popup-save');
success_popup.addClass('active');
window.setTimeout(function () {
location.reload();
}, 1000);
}
});
}
return false;
});
/** Ajax Transfer (Import/Export) Option */
$('body').on('click', '#of_import_button', function () {
var answer = confirm("Click OK to import options.");
if (answer) {
var clickedObject = $(this);
var clickedID = $(this).attr('id');
var nonce = $('#security').val();
var import_data = $('#export_data').val();
var data = {
action: 'of_ajax_post_action',
type: 'import_options',
security: nonce,
data: import_data
};
$.post(ajaxurl, data, function (response) {
var fail_popup = $('#of-popup-fail');
var success_popup = $('#of-popup-save');
//check nonce
if (response == -1) { //failed
fail_popup.addClass('active');
window.setTimeout(function () {
fail_popup.removeClass('active');
}, 2000);
} else {
success_popup.addClass('active');
window.setTimeout(function () {
location.reload();
}, 1000);
}
});
}
return false;
});
/** AJAX Save Options */
$('body').on('click', '.nasa-of_save', function () {
if (!_disable_save) {
_disable_save = true;
var nonce = $('#security').val();
$('.ajax-loading-img').fadeIn();
//get serialized data from all our option fields
var serializedReturn = $('#of_form :input[name][name!="security"][name!="of_reset"]').serialize();
$('#of_form :input[type=checkbox]').each(function () {
if (!this.checked) {
serializedReturn += '&' + this.name + '=0';
}
});
var data = {
type: 'save',
action: 'of_ajax_post_action',
security: nonce,
data: serializedReturn
};
$.post(ajaxurl, data, function (response) {
var success = $('#of-popup-save');
var fail = $('#of-popup-fail');
var loading = $('.ajax-loading-img');
loading.fadeOut();
if (response == 1) {
success.addClass('active');
_disable_save = false;
} else {
fail.addClass('active');
_disable_save = false;
}
window.setTimeout(function () {
success.removeClass('active');
fail.removeClass('active');
}, 2000);
});
}
return false;
});
/* AJAX Options Reset */
$('#of_reset').on('click', function () {
if (!_disable_save) {
_disable_save = true;
//confirm reset
var answer = confirm("Click OK to reset. All settings will be lost and replaced with default settings!");
//ajax reset
if (answer) {
var nonce = $('#security').val();
$('.ajax-reset-loading-img').fadeIn();
var data = {
type: 'reset',
action: 'of_ajax_post_action',
security: nonce
};
$.post(ajaxurl, data, function (response) {
var success = $('#of-popup-reset');
var fail = $('#of-popup-fail');
var loading = $('.ajax-reset-loading-img');
loading.fadeOut();
if (response == 1) {
success.addClass('active');
window.setTimeout(function () {
location.reload();
}, 1000);
} else {
fail.addClass('active');
window.setTimeout(function () {
fail.removeClass('active');
}, 2000);
}
});
} else {
_disable_save = false;
}
}
return false;
});
/** Tipsy @since v1.3 */
/* if ($().tipsy) {
$('.tooltip, .typography-size, .typography-height, .typography-face, .typography-style, .of-typography-color').tipsy({
fade: true,
gravity: 's',
opacity: 0.7
});
} */
/**
* JQuery UI Slider function
* Dependencies : jquery, jquery-ui-slider
* Feature added by : Smartik - http://smartik.ws/
* Date : 03.17.2013
*/
$('.smof_sliderui').each(function () {
var obj = $(this);
var sId = "#" + obj.data('id');
var val = parseInt(obj.data('val'));
var min = parseInt(obj.data('min'));
var max = parseInt(obj.data('max'));
var step = parseInt(obj.data('step'));
//slider init
obj.slider({
value: val,
min: min,
max: max,
step: step,
range: "min",
slide: function (event, ui) {
$(sId).val(ui.value);
}
});
});
/**
* Switch
* Dependencies : jquery
* Feature added by : Smartik - http://smartik.ws/
* Date : 03.17.2013
*/
$(".cb-enable").on('click', function () {
var parent = $(this).parents('.switch-options');
$('.cb-disable', parent).removeClass('selected');
$(this).addClass('selected');
$('.main_checkbox', parent).attr('checked', true);
//fold/unfold related options
var obj = $(this);
var $fold = '.f_' + obj.data('id');
$($fold).slideDown('normal', "swing");
$('.main_checkbox', parent).trigger('change');
});
$(".cb-disable").on('click', function () {
var parent = $(this).parents('.switch-options');
$('.cb-enable', parent).removeClass('selected');
$(this).addClass('selected');
$('.main_checkbox', parent).attr('checked', false);
//fold/unfold related options
var obj = $(this);
var $fold = '.f_' + obj.data('id');
$($fold).slideUp('normal', "swing");
$('.main_checkbox', parent).trigger('change');
});
$('body').on('change', '#section-f_buildin .main_checkbox', function() {
var is_check = $(this).is(':checked');
if (!is_check) {
var _current = $('#section-footer_mode #footer_mode').val();
$('#section-footer_mode #footer_mode option[value="build-in"]').attr('disabled', true);
if (_current === 'build-in') {
if ($('#section-footer_mode #footer_mode option[value="builder"]').length) {
$('#section-footer_mode #footer_mode').val('builder').trigger('change');
} else {
if ($('#section-footer_mode #footer_mode option[value="builder-e"]').length) {
$('#section-footer_mode #footer_mode').val('builder-e').trigger('change');
}
}
}
} else {
$('#section-footer_mode #footer_mode option[value="build-in"]').attr('disabled', false);
}
});
if ($('#section-f_buildin .main_checkbox').length) {
$('#section-f_buildin .main_checkbox').trigger('change');
}
$('body').on('click', '.of-uploaded-image', function() {
var _wrap = $(this).parents('.controls');
if ($(_wrap).length && $(_wrap).find('.media_upload_button').length) {
$(_wrap).find('.media_upload_button').trigger('click');
}
});
/**
* Google Fonts
* Dependencies : google.com, jquery
* Feature added by : Smartik - http://smartik.ws/
* Date : 03.17.2013
*/
function google_font_select(slctr, mainID) {
var _selected = $(slctr).val(); //get current value - selected and saved
var _linkclass = 'style_link_' + mainID;
var _previewer = mainID + '_ggf_previewer';
if (_selected) { //if var exists and isset
$('.' + _previewer).fadeIn();
//Check if selected is not equal with "Select a font" and execute the script.
if (_selected !== 'none' && _selected !== 'Select a font') {
//remove other elements crested in <head>
$('.' + _linkclass).remove();
//replace spaces with "+" sign
var the_font = _selected.replace(/\s+/g, '+'),
font_not = ['Arial', 'Trebuchet', 'Times', 'Tahoma', 'Helvetica'];
if(font_not.indexOf(the_font) === -1) {
//add reference to google font family
$('head').append('<link href="https://fonts.googleapis.com/css?family=' + the_font + '" rel="stylesheet" type="text/css" class="' + _linkclass + '" />');
}
//show in the preview box the font
$('.' + _previewer).css('font-family', _selected + ', sans-serif');
} else {
//if selected is not a font remove style "font-family" at preview box
$('.' + _previewer).css('font-family', '');
$('.' + _previewer).fadeOut();
}
}
}
//init for each element
$('.google_font_select').each(function () {
var mainID = $(this).attr('id');
google_font_select(this, mainID);
});
//init when value is changed
$('.google_font_select').change(function () {
var mainID = $(this).attr('id');
google_font_select(this, mainID);
});
/**
* Media Uploader
* Dependencies : jquery, wp media uploader
* Feature added by : Smartik - http://smartik.ws/
* Date : 05.28.2013
*/
function optionsframework_add_file(event, selector) {
var upload = $(".uploaded-file"), frame;
var $el = $(this);
event.preventDefault();
// If the media frame already exists, reopen it.
if (frame) {
frame.open();
return;
}
// Create the media frame.
frame = wp.media({
// Set the title of the modal.
title: $el.data('choose'),
// Customize the submit button.
button: {
// Set the text of the button.
text: $el.data('update'),
// Tell the button not to close the modal, since we're
// going to refresh the page when the image is selected.
close: false
}
});
// When an image is selected, run a callback.
frame.on('select', function () {
// Grab the selected attachment.
var attachment = frame.state().get('selection').first();
frame.close();
// selector.find('.upload').val(attachment.attributes.id);
selector.find('.upload').val(attachment.attributes.url);
if (attachment.attributes.type == 'image') {
selector.find('.screenshot').empty().hide().append('<img class="of-option-image" src="' + attachment.attributes.url + '" />').slideDown('fast');
}
selector.find('.media_upload_button').trigger('off');
selector.find('.remove-image').show().removeClass('hide');//show "Remove" button
selector.find('.of-background-properties').slideDown();
optionsframework_file_bindings();
});
// Finally, open the modal.
frame.open();
}
function optionsframework_remove_file(selector) {
selector.find('.remove-image').hide().addClass('hide');//hide "Remove" button
selector.find('.upload').val('');
selector.find('.of-background-properties').hide();
selector.find('.screenshot').slideUp();
selector.find('.remove-file').trigger('off');
// We don't display the upload button if .upload-notice is present
// This means the user doesn't have the WordPress 3.5 Media Library Support
if ($('.section-upload .upload-notice').length > 0) {
$('.media_upload_button').remove();
}
optionsframework_file_bindings();
}
function optionsframework_file_bindings() {
$('.remove-image, .remove-file').on('click', function () {
optionsframework_remove_file($(this).parents('.section-upload, .section-media, .slide_body'));
});
$('.media_upload_button').off('click').on('click', function (event) {
optionsframework_add_file(event, $(this).parents('.section-upload, .section-media, .slide_body'));
});
}
optionsframework_file_bindings();
}); //end doc ready
+180
View File
@@ -0,0 +1,180 @@
/*!
* jQuery UI Touch Punch 0.2.3
*
* Copyright 2011–2014, Dave Furfero
* Dual licensed under the MIT or GPL Version 2 licenses.
*
* Depends:
* jquery.ui.widget.js
* jquery.ui.mouse.js
*/
(function ($) {
// Detect touch support
$.support.touch = 'ontouchend' in document;
// Ignore browsers without touch support
if (!$.support.touch) {
return;
}
var mouseProto = $.ui.mouse.prototype,
_mouseInit = mouseProto._mouseInit,
_mouseDestroy = mouseProto._mouseDestroy,
touchHandled;
/**
* Simulate a mouse event based on a corresponding touch event
* @param {Object} event A touch event
* @param {String} simulatedType The corresponding mouse event
*/
function simulateMouseEvent (event, simulatedType) {
// Ignore multi-touch events
if (event.originalEvent.touches.length > 1) {
return;
}
event.preventDefault();
var touch = event.originalEvent.changedTouches[0],
simulatedEvent = document.createEvent('MouseEvents');
// Initialize the simulated mouse event using the touch event's coordinates
simulatedEvent.initMouseEvent(
simulatedType, // type
true, // bubbles
true, // cancelable
window, // view
1, // detail
touch.screenX, // screenX
touch.screenY, // screenY
touch.clientX, // clientX
touch.clientY, // clientY
false, // ctrlKey
false, // altKey
false, // shiftKey
false, // metaKey
0, // button
null // relatedTarget
);
// Dispatch the simulated event to the target element
event.target.dispatchEvent(simulatedEvent);
}
/**
* Handle the jQuery UI widget's touchstart events
* @param {Object} event The widget element's touchstart event
*/
mouseProto._touchStart = function (event) {
var self = this;
// Ignore the event if another widget is already being handled
if (touchHandled || !self._mouseCapture(event.originalEvent.changedTouches[0])) {
return;
}
// Set the flag to prevent other widgets from inheriting the touch event
touchHandled = true;
// Track movement to determine if interaction was a click
self._touchMoved = false;
// Simulate the mouseover event
simulateMouseEvent(event, 'mouseover');
// Simulate the mousemove event
simulateMouseEvent(event, 'mousemove');
// Simulate the mousedown event
simulateMouseEvent(event, 'mousedown');
};
/**
* Handle the jQuery UI widget's touchmove events
* @param {Object} event The document's touchmove event
*/
mouseProto._touchMove = function (event) {
// Ignore event if not handled
if (!touchHandled) {
return;
}
// Interaction was not a click
this._touchMoved = true;
// Simulate the mousemove event
simulateMouseEvent(event, 'mousemove');
};
/**
* Handle the jQuery UI widget's touchend events
* @param {Object} event The document's touchend event
*/
mouseProto._touchEnd = function (event) {
// Ignore event if not handled
if (!touchHandled) {
return;
}
// Simulate the mouseup event
simulateMouseEvent(event, 'mouseup');
// Simulate the mouseout event
simulateMouseEvent(event, 'mouseout');
// If the touch interaction did not move, it should trigger a click
if (!this._touchMoved) {
// Simulate the click event
simulateMouseEvent(event, 'click');
}
// Unset the flag to allow other widgets to inherit the touch event
touchHandled = false;
};
/**
* A duck punch of the $.ui.mouse _mouseInit method to support touch events.
* This method extends the widget with bound touch event handlers that
* translate touch events to mouse events and pass them to the widget's
* original mouse event handling methods.
*/
mouseProto._mouseInit = function () {
var self = this;
// Delegate the touch handlers to the widget's element
self.element.bind({
touchstart: $.proxy(self, '_touchStart'),
touchmove: $.proxy(self, '_touchMove'),
touchend: $.proxy(self, '_touchEnd')
});
// Call the original $.ui.mouse init method
_mouseInit.call(self);
};
/**
* Remove the touch event handlers
*/
mouseProto._mouseDestroy = function () {
var self = this;
// Delegate the touch handlers to the widget's element
self.element.unbind({
touchstart: $.proxy(self, '_touchStart'),
touchmove: $.proxy(self, '_touchMove'),
touchend: $.proxy(self, '_touchEnd')
});
// Call the original $.ui.mouse destroy method
_mouseDestroy.call(self);
};
})(jQuery);
@@ -0,0 +1,11 @@
/*!
* jQuery UI Touch Punch 0.2.3
*
* Copyright 2011–2014, Dave Furfero
* Dual licensed under the MIT or GPL Version 2 licenses.
*
* Depends:
* jquery.ui.widget.js
* jquery.ui.mouse.js
*/
!function(a){function b(a,b){if(!(a.originalEvent.touches.length>1)){a.preventDefault();var c=a.originalEvent.changedTouches[0],d=document.createEvent("MouseEvents");d.initMouseEvent(b,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null),a.target.dispatchEvent(d)}}if(a.support.touch="ontouchend"in document,a.support.touch){var c,d=a.ui.mouse.prototype,e=d._mouseInit,f=d._mouseDestroy;d._touchStart=function(a){var d=this;!c&&d._mouseCapture(a.originalEvent.changedTouches[0])&&(c=!0,d._touchMoved=!1,b(a,"mouseover"),b(a,"mousemove"),b(a,"mousedown"))},d._touchMove=function(a){c&&(this._touchMoved=!0,b(a,"mousemove"))},d._touchEnd=function(a){c&&(b(a,"mouseup"),b(a,"mouseout"),this._touchMoved||b(a,"click"),c=!1)},d._mouseInit=function(){var b=this;b.element.bind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),e.call(b)},d._mouseDestroy=function(){var b=this;b.element.unbind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),f.call(b)}}}(jQuery);
@@ -0,0 +1,64 @@
/* global woocommerce_price_slider_params */
jQuery(function($) {
// woocommerce_price_slider_params is required to continue, ensure the object exists
if (typeof woocommerce_price_slider_params === 'undefined') {
return false;
}
// Get markup ready for slider
$('input#min_price, input#max_price').hide();
$('.price_slider, .price_label').show();
// Price slider uses jquery ui
var min_price = $('.price_slider_amount #min_price').data('min'),
max_price = $('.price_slider_amount #max_price').data('max'),
current_min_price = parseInt(min_price, 10),
current_max_price = parseInt(max_price, 10);
if (woocommerce_price_slider_params.min_price) {
current_min_price = parseInt(woocommerce_price_slider_params.min_price, 10);
}
if (woocommerce_price_slider_params.max_price) {
current_max_price = parseInt(woocommerce_price_slider_params.max_price, 10);
}
$(document.body).bind('price_slider_create price_slider_slide', function(event, min, max) {
if (woocommerce_price_slider_params.currency_pos === 'left') {
$('.price_slider_amount span.from').html(woocommerce_price_slider_params.currency_symbol + min);
$('.price_slider_amount span.to').html(woocommerce_price_slider_params.currency_symbol + max);
} else if (woocommerce_price_slider_params.currency_pos === 'left_space') {
$('.price_slider_amount span.from').html(woocommerce_price_slider_params.currency_symbol + ' ' + min);
$('.price_slider_amount span.to').html(woocommerce_price_slider_params.currency_symbol + ' ' + max);
} else if (woocommerce_price_slider_params.currency_pos === 'right') {
$('.price_slider_amount span.from').html(min + woocommerce_price_slider_params.currency_symbol);
$('.price_slider_amount span.to').html(max + woocommerce_price_slider_params.currency_symbol);
} else if (woocommerce_price_slider_params.currency_pos === 'right_space') {
$('.price_slider_amount span.from').html(min + ' ' + woocommerce_price_slider_params.currency_symbol);
$('.price_slider_amount span.to').html(max + ' ' + woocommerce_price_slider_params.currency_symbol);
}
$(document.body).trigger('price_slider_updated', [min, max]);
});
$('.price_slider').slider({
range: true,
animate: true,
min: min_price,
max: max_price,
values: [current_min_price, current_max_price],
create: function() {
$('.price_slider_amount #min_price').val(current_min_price);
$('.price_slider_amount #max_price').val(current_max_price);
$(document.body).trigger('price_slider_create', [current_min_price, current_max_price]);
},
slide: function(event, ui) {
$('input#min_price').val(ui.values[0]);
$('input#max_price').val(ui.values[1]);
$(document.body).trigger('price_slider_slide', [ui.values[0], ui.values[1]]);
},
change: function(event, ui) {
$(document.body).trigger('price_slider_change', [ui.values[0], ui.values[1]]);
}
});
});
+1
View File
@@ -0,0 +1 @@
jQuery(function(a){if("undefined"==typeof woocommerce_price_slider_params)return!1;a("input#min_price, input#max_price").hide(),a(".price_slider, .price_label").show();var b=a(".price_slider_amount #min_price").data("min"),c=a(".price_slider_amount #max_price").data("max"),d=parseInt(b,10),e=parseInt(c,10);woocommerce_price_slider_params.min_price&&(d=parseInt(woocommerce_price_slider_params.min_price,10)),woocommerce_price_slider_params.max_price&&(e=parseInt(woocommerce_price_slider_params.max_price,10)),a(document.body).bind("price_slider_create price_slider_slide",function(b,c,d){"left"===woocommerce_price_slider_params.currency_pos?(a(".price_slider_amount span.from").html(woocommerce_price_slider_params.currency_symbol+c),a(".price_slider_amount span.to").html(woocommerce_price_slider_params.currency_symbol+d)):"left_space"===woocommerce_price_slider_params.currency_pos?(a(".price_slider_amount span.from").html(woocommerce_price_slider_params.currency_symbol+" "+c),a(".price_slider_amount span.to").html(woocommerce_price_slider_params.currency_symbol+" "+d)):"right"===woocommerce_price_slider_params.currency_pos?(a(".price_slider_amount span.from").html(c+woocommerce_price_slider_params.currency_symbol),a(".price_slider_amount span.to").html(d+woocommerce_price_slider_params.currency_symbol)):"right_space"===woocommerce_price_slider_params.currency_pos&&(a(".price_slider_amount span.from").html(c+" "+woocommerce_price_slider_params.currency_symbol),a(".price_slider_amount span.to").html(d+" "+woocommerce_price_slider_params.currency_symbol)),a(document.body).trigger("price_slider_updated",[c,d])}),a(".price_slider").slider({range:!0,animate:!0,min:b,max:c,values:[d,e],create:function(){a(".price_slider_amount #min_price").val(d),a(".price_slider_amount #max_price").val(e),a(document.body).trigger("price_slider_create",[d,e])},slide:function(b,c){a("input#min_price").val(c.values[0]),a("input#max_price").val(c.values[1]),a(document.body).trigger("price_slider_slide",[c.values[0],c.values[1]])},change:function(b,c){a(document.body).trigger("price_slider_change",[c.values[0],c.values[1]])}})});