first commit
This commit is contained in:
762
modules/appagebuilder/views/js/ApImageHotspot.js
Normal file
762
modules/appagebuilder/views/js/ApImageHotspot.js
Normal file
@@ -0,0 +1,762 @@
|
||||
/**
|
||||
* @Website: apollotheme.com - prestashop template provider
|
||||
* @author Apollotheme <apollotheme@gmail.com>
|
||||
* @copyright Apollotheme
|
||||
* @description:
|
||||
*/
|
||||
|
||||
(function(a) {
|
||||
a.fn.LiteTooltip = function(d, c) {
|
||||
return this.each(function() {
|
||||
var f = a.extend({}, a.fn.LiteTooltip.defaultSettings, d || {});
|
||||
var e = a(this);
|
||||
var g = new b(f, e);
|
||||
if (g.settings.title != "") {
|
||||
if (!e.is("input")) {
|
||||
e.css({cursor: "pointer"})
|
||||
}
|
||||
var debug = (g.settings.debug != null ) ? ((g.settings.debug == "true" || g.settings.debug == true) ? true : false) : false;
|
||||
|
||||
if (g.settings.trigger == "hoverable") {
|
||||
this.toggle = false;
|
||||
e.bind("mouseenter", {settings: g.settings, element: e, $plugin: g, $toggle: this.toggle}, g.mouseOverHandler);
|
||||
if(!debug){
|
||||
e.bind("mouseleave", {settings: g.settings, element: e, $plugin: g, $toggle: this.toggle}, g.mouseOutHandler)
|
||||
}
|
||||
} else {
|
||||
if (g.settings.trigger == "hover") {
|
||||
e.bind("mouseenter", {settings: g.settings, element: e, $plugin: g}, g.mouseOverHandler);
|
||||
if(!debug){
|
||||
e.bind("mouseleave", {settings: g.settings, element: e, $plugin: g}, g.mouseOutHandler)
|
||||
}
|
||||
} else {
|
||||
if (g.settings.trigger == "focus") {
|
||||
e.bind("focus", {settings: g.settings, element: e, $plugin: g}, g.mouseOverHandler);
|
||||
e.bind("blur", {settings: g.settings, element: e, $plugin: g}, g.mouseOutHandler)
|
||||
} else {
|
||||
if (g.settings.trigger == "click") {
|
||||
this.toggle = false;
|
||||
e.bind("click", {settings: g.settings, element: e, $plugin: g, $toggle: this.toggle}, g.mouseOverHandler);
|
||||
if (!g.settings.issticky) {
|
||||
if(!debug){
|
||||
e.bind("mouseleave", {settings: g.settings, element: e, $plugin: g, $toggle: this.toggle}, g.mouseOutHandler)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
};
|
||||
function b(d, c) {
|
||||
this.settings = this.getSettings(d, c);
|
||||
this.$element = c;
|
||||
return this
|
||||
}
|
||||
b.prototype = {
|
||||
getSettings: function(f, d) {
|
||||
var e = (d.data("issticky") != null) ? ((d.data("issticky") == "true") ? true : false) : true;
|
||||
var c = a.extend({}, f, {
|
||||
location: d.data("location"),
|
||||
title: d.data("title"),
|
||||
backcolor: d.data("backcolor"),
|
||||
textalign: d.data("textalign"),
|
||||
trigger: d.data("trigger"),
|
||||
textcolor: d.data("textcolor"),
|
||||
opacity: d.data("opacity"),
|
||||
templatename: d.data("templatename"),
|
||||
width: d.data("width"),
|
||||
margin: d.data("margin"),
|
||||
padding: d.data("padding"),
|
||||
delay: d.data("delay"),
|
||||
issticky: e,
|
||||
container: d.data("container"),
|
||||
shadow: d.data("shadow")
|
||||
});
|
||||
return c
|
||||
}, mouseOverHandler: function(n) {
|
||||
if (typeof n.data.settings.onUpdate == "function") {
|
||||
n.data.settings.title = n.data.settings.onUpdate.call(this)
|
||||
}
|
||||
if (n.data.element.is("input")) {
|
||||
if (n.data.element.val() != "") {
|
||||
return false
|
||||
}
|
||||
}
|
||||
if (n.data.settings.trigger == "click") {
|
||||
if (!n.data.$toggle) {
|
||||
n.data.$toggle = true;
|
||||
this.toggle = true;
|
||||
n.data.element.unbind("click");
|
||||
n.data.element.bind("click", {
|
||||
settings: n.data.settings,
|
||||
element: n.data.element,
|
||||
$plugin: n.data.$plugin,
|
||||
$toggle: n.data.$toggle
|
||||
},
|
||||
n.data.$plugin.mouseOutHandler)
|
||||
} else {
|
||||
n.data.$toggle = false;
|
||||
this.toggle = false;
|
||||
return false
|
||||
}
|
||||
}
|
||||
var c = n.data.element;
|
||||
var d = n.data.settings;
|
||||
var R = parseInt(d.margin.toString().replace("px", ""));
|
||||
var T = parseInt(d.padding.toString().replace("px", ""));
|
||||
var Y = parseInt(d.width.toString().replace("px", ""));
|
||||
var Q = d.container == "body" ? d.location : "none";
|
||||
var N = d.backcolor;
|
||||
var X = d.textcolor;
|
||||
var W = d.textalign;
|
||||
var V = d.templatename;
|
||||
var P = d.delay;
|
||||
var K = a(d.template);
|
||||
K.css({opacity: d.opacity});
|
||||
K.css("visibility", "visible");
|
||||
K.find(".tooltip-content").css({"text-align": W}).html(d.title + d.clearfix);
|
||||
K.find(".tooltip-content").css({padding: T + "px"});
|
||||
|
||||
K.find(".tooltip-content p").css({background: N});
|
||||
K.find(".tooltip-content p").css({color: X});
|
||||
// K.find(".tooltip-content").css({background: N});
|
||||
// K.find(".tooltip-content").css({color: X});
|
||||
if (d.shadow == 1) {
|
||||
K.find(".tooltip-content").css({"box-shadow": "1px 1px 3px 0px #888888"})
|
||||
}
|
||||
var M = Q;
|
||||
var L = Q.split("-")[0];
|
||||
var E = M;
|
||||
var D = L;
|
||||
K.removeClass(Q).addClass(M);
|
||||
K.find(".tooltip-arrow").removeClass(Q).addClass(M).css("border-" + L + "-color", N);
|
||||
var l = d.container;
|
||||
if (d.container != "body") {
|
||||
K.addClass("incontainer");
|
||||
l = "#" + d.container;
|
||||
a(l).children().each(function() {
|
||||
a(this).remove()
|
||||
})
|
||||
} else {
|
||||
K.removeClass("incontainer");
|
||||
l = "body"
|
||||
}
|
||||
a(l).append(K);
|
||||
if (n.data.settings.trigger == "click") {
|
||||
var O = a('<div id="tooltip-clickoutside"></div>');
|
||||
O.css({
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
position: "absolute",
|
||||
top: a(document).scrollTop() + "px",
|
||||
left: "0px"
|
||||
});
|
||||
a("body").append(O);
|
||||
O.bind("click", {settings: n.data.settings, element: n.data.element, $plugin: n.data.$plugin, $toggle: n.data.$toggle}, n.data.$plugin.mouseOutHandler);
|
||||
n.data.$toggle = false;
|
||||
this.toggle = false
|
||||
} else {
|
||||
if (n.data.settings.trigger == "hoverable") {
|
||||
n.data.element.unbind("mouseenter")
|
||||
}
|
||||
}
|
||||
if (d.container == "body") {
|
||||
K.offset({top: 0, left: 0});
|
||||
var ab = K.outerWidth();
|
||||
var Z = K.outerHeight();
|
||||
var ae = a(document).width();
|
||||
var G = scrollbarWidth();
|
||||
var ac = a(document).width() - a(window).width();
|
||||
if (ac > 0) {
|
||||
ae = ae - G
|
||||
}
|
||||
if (ae > a(window).width()) {
|
||||
ae = a(window).width() - G
|
||||
}
|
||||
var ad = a(document).height();
|
||||
if (ac > G) {
|
||||
ad = ad - G
|
||||
}
|
||||
if (Y != 0) {
|
||||
if (Y * 2 > ae) {
|
||||
Y = Math.floor((ae / 2) - 30)
|
||||
} else {
|
||||
Y -= 30
|
||||
}
|
||||
if (Y * 1.5 > ae / 2) {
|
||||
Y = Math.floor((ae / 2) - 30)
|
||||
}
|
||||
} else {
|
||||
if (340 * 2 > ae) {
|
||||
Y = Math.floor((ae / 2) - 30)
|
||||
} else {
|
||||
Y = 340
|
||||
}
|
||||
}
|
||||
K.css({"max-width": Y});
|
||||
ab = K.outerWidth();
|
||||
Z = K.outerHeight();
|
||||
var J = c.context;
|
||||
var r = J.offsetWidth;
|
||||
var o = J.offsetHeight;
|
||||
var q = c.offset().top;
|
||||
var p = c.offset().left;
|
||||
if (J.tagName.toLowerCase() == "area") {
|
||||
var g = J.parentElement.getAttribute("name");
|
||||
var h = J.getAttribute("shape").toLowerCase();
|
||||
var x = a("img[usemap='#" + g + "']").offset().top;
|
||||
var w = a("img[usemap='#" + g + "']").offset().left;
|
||||
var j = parseInt(J.getAttribute("coords").split(",")[0]);
|
||||
var k = parseInt(J.getAttribute("coords").split(",")[1]);
|
||||
var i = parseInt(J.getAttribute("coords").split(",")[2]);
|
||||
var f = parseInt(J.getAttribute("coords").split(",")[3] || i);
|
||||
var v = {top: parseInt(x + k), left: parseInt(w + j)};
|
||||
if (h == "circle") {
|
||||
v = {top: parseInt(x + k - i), left: parseInt(w + j - i)};
|
||||
i *= 2;
|
||||
f *= 2
|
||||
}
|
||||
if (h == "rect") {
|
||||
v = {top: parseInt(x + k), left: parseInt(w + j)};
|
||||
i = i - j;
|
||||
f = f - k
|
||||
}
|
||||
if (h == "poly") {
|
||||
var m = new Array();
|
||||
var H = J.getAttribute("coords").split(",");
|
||||
for (var y = 0; y < H.length; ) {
|
||||
m.push({x: parseInt(H[y]), y: parseInt(H[y + 1])});
|
||||
y = y + 2
|
||||
}
|
||||
m.sort(function(e, af) {
|
||||
var ag = e.x, ah = af.x;
|
||||
if (ag == ah) {
|
||||
return 0
|
||||
}
|
||||
return ag < ah ? 1 : -1
|
||||
});
|
||||
var z = m[0].x;
|
||||
m.sort(function(e, af) {
|
||||
var ag = e.y, ah = af.y;
|
||||
if (ag == ah) {
|
||||
return 0
|
||||
}
|
||||
return ag < ah ? 1 : -1
|
||||
});
|
||||
var A = m[0].y;
|
||||
m.sort(function(e, af) {
|
||||
var ag = e.x, ah = af.x;
|
||||
if (ag == ah) {
|
||||
return 0
|
||||
}
|
||||
return ag > ah ? 1 : -1
|
||||
});
|
||||
var B = m[0].x;
|
||||
m.sort(function(e, af) {
|
||||
var ag = e.y, ah = af.y;
|
||||
if (ag == ah) {
|
||||
return 0
|
||||
}
|
||||
return ag > ah ? 1 : -1
|
||||
});
|
||||
var C = m[0].y;
|
||||
v = {top: parseInt(x + C), left: parseInt(w + B)};
|
||||
i = z - B;
|
||||
f = A - C
|
||||
}
|
||||
p = v.left;
|
||||
q = v.top;
|
||||
r = i;
|
||||
o = f
|
||||
}
|
||||
p = Math.round(p);
|
||||
q = Math.round(q);
|
||||
r = Math.round(r);
|
||||
o = Math.round(o);
|
||||
K.offset({top: 0, left: 0});
|
||||
var S;
|
||||
switch (Q) {
|
||||
case "top":
|
||||
S = {top: (q - Z - R), left: p - (ab / 2) + (r / 2)};
|
||||
break;
|
||||
case "top-left":
|
||||
S = {top: (q - Z - R), left: p};
|
||||
break;
|
||||
case "top-right":
|
||||
S = {top: (q - Z - R), left: p - ab + r};
|
||||
break;
|
||||
case "right":
|
||||
S = {top: (q + (o / 2) - (Z / 2)), left: p + r + R};
|
||||
break;
|
||||
case "right-top":
|
||||
S = {top: (q + o - Z + 8), left: p + r + R};
|
||||
break;
|
||||
case "right-bottom":
|
||||
S = {top: q - 8, left: p + r + R};
|
||||
break;
|
||||
case "bottom":
|
||||
S = {top: (q + o + R), left: p - (ab / 2) + (r / 2)};
|
||||
break;
|
||||
case "bottom-left":
|
||||
S = {top: (q + o + R), left: p};
|
||||
break;
|
||||
case "bottom-right":
|
||||
S = {top: (q + o + R), left: p - ab + r};
|
||||
break;
|
||||
case "left":
|
||||
S = {top: (q + (o / 2) - (Z / 2)), left: p - ab - R};
|
||||
break;
|
||||
case "left-top":
|
||||
S = {top: (q + o - Z + 8), left: p - ab - R};
|
||||
break;
|
||||
case "left-bottom":
|
||||
S = {top: q - 8, left: p - ab - R};
|
||||
break
|
||||
}
|
||||
var F = {top: 0, left: 0};
|
||||
F.left = S.left;
|
||||
F.top = S.top;
|
||||
var aa = (((M.match("bottom") != null) || (M == "left") || (M == "right")) ? (((M == "left") || (M == "right")) ? (Z / 2) : (Z)) > (ad - q - o) : false);
|
||||
if ((S.left < 0) || (S.top < 0) || (S.left + ab > ae) || aa) {
|
||||
if (L == "top" || L == "bottom" || L == "left" || L == "right") {
|
||||
var u = false;
|
||||
switch (L) {
|
||||
case "top":
|
||||
S.top = q - Z - R;
|
||||
S.left = p - (ab / 2) + (r / 2);
|
||||
u = true;
|
||||
break;
|
||||
case "bottom":
|
||||
S.top = q - Z - R;
|
||||
S.left = p - (ab / 2) + (r / 2);
|
||||
u = true;
|
||||
break;
|
||||
case "left":
|
||||
var I = M.replace(L + "-", "");
|
||||
if (I == "top") {
|
||||
L = "top";
|
||||
M = "top-left";
|
||||
K.removeClass(E).addClass(M);
|
||||
K.find(".tooltip-arrow").removeClass(E).css("border-" + D + "-color", "").addClass(M).css("border-" + L + "-color", N);
|
||||
D = "top";
|
||||
E = "top-left";
|
||||
K.removeClass(Q).addClass(M);
|
||||
K.find(".tooltip-arrow").removeClass(Q).addClass(M).css("border-" + L + "-color", N);
|
||||
ab = K.outerWidth();
|
||||
Z = K.outerHeight();
|
||||
S.top = q - Z - R;
|
||||
S.left = p - (ab / 2) + (r / 2);
|
||||
F.left = p;
|
||||
F.top = q - Z - R;
|
||||
aa = (((M.match("bottom") != null) || (M == "left") || (M == "right")) ? (((M == "left") || (M == "right")) ? (Z / 2) : (Z)) > (ad - q - o) : false);
|
||||
if ((S.left < 0) || (S.top < 0) || (S.left + ab > ae) || aa) {
|
||||
u = true
|
||||
} else {
|
||||
S.left = F.left;
|
||||
S.top = F.top
|
||||
}
|
||||
} else {
|
||||
if (I == "bottom") {
|
||||
L = "bottom";
|
||||
M = "bottom-left";
|
||||
K.removeClass(E).addClass(M);
|
||||
K.find(".tooltip-arrow").removeClass(E).css("border-" + D + "-color", "").addClass(M).css("border-" + L + "-color", N);
|
||||
D = "bottom";
|
||||
E = "bottom-left";
|
||||
K.removeClass(Q).addClass(M);
|
||||
K.find(".tooltip-arrow").removeClass(Q).addClass(M).css("border-" + L + "-color", N);
|
||||
ab = K.outerWidth();
|
||||
Z = K.outerHeight();
|
||||
S.top = q + o + R;
|
||||
S.left = p - (ab / 2) + (r / 2);
|
||||
F.left = p;
|
||||
F.top = q + o + R;
|
||||
aa = (((M.match("bottom") != null) || (M == "left") || (M == "right")) ? (((M == "left") || (M == "right")) ? (Z / 2) : (Z)) > (ad - q - o) : false);
|
||||
if ((S.left < 0) || (S.top < 0) || (S.left + ab > ae) || aa) {
|
||||
u = true
|
||||
} else {
|
||||
S.left = F.left;
|
||||
S.top = F.top
|
||||
}
|
||||
} else {
|
||||
L = "top";
|
||||
M = "top";
|
||||
K.removeClass(E).addClass(M);
|
||||
K.find(".tooltip-arrow").removeClass(E).css("border-" + D + "-color", "").addClass(M).css("border-" + L + "-color", N);
|
||||
D = "top";
|
||||
E = "top";
|
||||
K.removeClass(Q).addClass(M);
|
||||
K.find(".tooltip-arrow").removeClass(Q).addClass(M).css("border-" + L + "-color", N);
|
||||
ab = K.outerWidth();
|
||||
Z = K.outerHeight();
|
||||
S.top = q - Z - R;
|
||||
S.left = p - (ab / 2) + (r / 2);
|
||||
F.left = S.left;
|
||||
F.top = S.top;
|
||||
aa = (((M.match("bottom") != null) || (M == "left") || (M == "right")) ? (((M == "left") || (M == "right")) ? (Z / 2) : (Z)) > (ad - q - o) : false);
|
||||
if ((S.left < 0) || (S.top < 0) || (S.left + ab > ae) || aa) {
|
||||
u = true
|
||||
} else {
|
||||
S.left = F.left;
|
||||
S.top = F.top
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "right":
|
||||
var I = M.replace(L + "-", "");
|
||||
if (I == "top") {
|
||||
L = "top";
|
||||
M = "top-left";
|
||||
K.removeClass(E).addClass(M);
|
||||
K.find(".tooltip-arrow").removeClass(E).css("border-" + D + "-color", "").addClass(M).css("border-" + L + "-color", N);
|
||||
D = "top";
|
||||
E = "top-left";
|
||||
K.removeClass(Q).addClass(M);
|
||||
K.find(".tooltip-arrow").removeClass(Q).addClass(M).css("border-" + L + "-color", N);
|
||||
ab = K.outerWidth();
|
||||
Z = K.outerHeight();
|
||||
S.top = q - Z - R;
|
||||
S.left = p - (ab / 2) + (r / 2);
|
||||
F.left = p;
|
||||
F.top = q - Z - R;
|
||||
aa = (((M.match("bottom") != null) || (M == "left") || (M == "right")) ? (((M == "left") || (M == "right")) ? (Z / 2) : (Z)) > (ad - q - o) : false);
|
||||
if ((S.left < 0) || (S.top < 0) || (S.left + ab > ae) || aa) {
|
||||
u = true
|
||||
} else {
|
||||
S.left = F.left;
|
||||
S.top = F.top
|
||||
}
|
||||
} else {
|
||||
if (I == "bottom") {
|
||||
L = "bottom";
|
||||
M = "bottom-left";
|
||||
K.removeClass(E).addClass(M);
|
||||
K.find(".tooltip-arrow").removeClass(E).css("border-" + D + "-color", "").addClass(M).css("border-" + L + "-color", N);
|
||||
D = "bottom";
|
||||
E = "bottom-left";
|
||||
K.removeClass(Q).addClass(M);
|
||||
K.find(".tooltip-arrow").removeClass(Q).addClass(M).css("border-" + L + "-color", N);
|
||||
ab = K.outerWidth();
|
||||
Z = K.outerHeight();
|
||||
S.top = q - Z - R;
|
||||
S.left = p - (ab / 2) + (r / 2);
|
||||
F.left = p;
|
||||
F.top = q + o + R;
|
||||
aa = (((M.match("bottom") != null) || (M == "left") || (M == "right")) ? (((M == "left") || (M == "right")) ? (Z / 2) : (Z)) > (ad - q - o) : false);
|
||||
if ((S.left < 0) || (S.top < 0) || (S.left + ab > ae) || aa) {
|
||||
u = true
|
||||
} else {
|
||||
S.left = F.left;
|
||||
S.top = F.top
|
||||
}
|
||||
} else {
|
||||
L = "top";
|
||||
M = "top";
|
||||
K.removeClass(E).addClass(M);
|
||||
K.find(".tooltip-arrow").removeClass(E).css("border-" + D + "-color", "").addClass(M).css("border-" + L + "-color", N);
|
||||
D = "top";
|
||||
E = "top";
|
||||
K.removeClass(Q).addClass(M);
|
||||
K.find(".tooltip-arrow").removeClass(Q).addClass(M).css("border-" + L + "-color", N);
|
||||
ab = K.outerWidth();
|
||||
Z = K.outerHeight();
|
||||
S.top = q - Z - R;
|
||||
S.left = p - (ab / 2) + (r / 2);
|
||||
F.left = S.left;
|
||||
F.top = S.top;
|
||||
aa = (((M.match("bottom") != null) || (M == "left") || (M == "right")) ? (((M == "left") || (M == "right")) ? (Z / 2) : (Z)) > (ad - q - o) : false);
|
||||
if ((S.left < 0) || (S.top < 0) || (S.left + ab > ae) || aa) {
|
||||
u = true
|
||||
} else {
|
||||
S.left = F.left;
|
||||
S.top = F.top
|
||||
}
|
||||
}
|
||||
}
|
||||
break
|
||||
}
|
||||
if (u) {
|
||||
var s = false;
|
||||
var t = false;
|
||||
if (S.top < 0) {
|
||||
L = "bottom";
|
||||
M = "bottom";
|
||||
S.top = q + o + R;
|
||||
t = true;
|
||||
if (S.left < 0) {
|
||||
L = "bottom";
|
||||
M = "bottom-left";
|
||||
S.left = p;
|
||||
s = true
|
||||
}
|
||||
if (S.left + ab > ae) {
|
||||
S.left = p - ab + r;
|
||||
if (S.left < 0) {
|
||||
L = "bottom";
|
||||
M = "bottom";
|
||||
S.left = p - (ab / 2) + (r / 2);
|
||||
s = true
|
||||
} else {
|
||||
L = "bottom";
|
||||
M = "bottom-right";
|
||||
S.left = p - ab + r;
|
||||
s = true
|
||||
}
|
||||
}
|
||||
} else {
|
||||
L = "top";
|
||||
M = "top";
|
||||
S.top = q - Z - R;
|
||||
t = false;
|
||||
if (S.left < 0) {
|
||||
L = "top";
|
||||
M = "top-left";
|
||||
S.left = p;
|
||||
s = true
|
||||
}
|
||||
if (S.left + ab > ae) {
|
||||
S.left = p - ab + r;
|
||||
if (S.left < 0) {
|
||||
L = "top";
|
||||
M = "top";
|
||||
S.left = p - (ab / 2) + (r / 2);
|
||||
s = true
|
||||
} else {
|
||||
L = "top";
|
||||
M = "top-right";
|
||||
S.left = p - ab + r;
|
||||
s = true
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!s) {
|
||||
if (t) {
|
||||
M = E.replace("top", "bottom");
|
||||
L = D.replace("top", "bottom");
|
||||
if (F.left < 0) {
|
||||
if (L == "bottom" || L == "top") {
|
||||
M = M.replace("right", "left");
|
||||
S.left = p
|
||||
}
|
||||
} else {
|
||||
S.left = F.left
|
||||
}
|
||||
} else {
|
||||
M = E.replace("bottom", "top");
|
||||
L = D.replace("bottom", "top");
|
||||
if (F.left < 0) {
|
||||
if (L == "bottom" || L == "top") {
|
||||
M = M.replace("right", "left");
|
||||
S.left = p
|
||||
}
|
||||
} else {
|
||||
S.left = F.left
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
K.removeClass(E).addClass(M);
|
||||
K.find(".tooltip-arrow").removeClass(E).css("border-" + D + "-color", "").addClass(M).css("border-" + L + "-color", N);
|
||||
if (V != "") {
|
||||
if (K.find(".tooltip-content > .template").hasClass("template")) {
|
||||
K.find(".tooltip-content > .template").addClass(V);
|
||||
var U = K.find("." + V).css("background-color");
|
||||
// K.find(".tooltip-arrow").css("border-" + D + "-color", "");
|
||||
// K.find(".tooltip-arrow").css("border-" + L + "-color", U);
|
||||
//K.find(".tooltip-content").css({background: U}) // Fix background-color
|
||||
} else {
|
||||
if (K.find(".tooltip-content > .tooltip-menu").hasClass("tooltip-menu")) {
|
||||
K.find(".tooltip-content > .tooltip-menu").addClass(V);
|
||||
var U = K.find("." + V).css("background-color");
|
||||
K.find(".tooltip-arrow").css("border-" + D + "-color", "");
|
||||
K.find(".tooltip-arrow").css("border-" + L + "-color", U);
|
||||
K.find(".tooltip-content").css({background: U})
|
||||
}
|
||||
}
|
||||
}
|
||||
K.find(".tooltip-content > .video-wrapper").css({width: (K.width() - (T * 2)) + "px"});
|
||||
K.offset(S)
|
||||
}
|
||||
K.hide();
|
||||
c.removeAttr("title");
|
||||
c.removeAttr("alt");
|
||||
if (n.data.settings.trigger == "hoverable" || n.data.settings.trigger == "click") {
|
||||
P = 0
|
||||
}
|
||||
switch (L) {
|
||||
case "top":
|
||||
K.delay(P).css({top: "-=20", opacity: 0, display: "block"}).stop(true, true).animate({top: "+=20", opacity: d.opacity}, 150);
|
||||
break;
|
||||
case "bottom":
|
||||
K.delay(P).css({top: "+=20", opacity: 0, display: "block"}).stop(true, true).animate({top: "-=20", opacity: d.opacity}, 150);
|
||||
break;
|
||||
case "left":
|
||||
K.delay(P).css({left: "-=20", opacity: 0, display: "block"}).stop(true, true).animate({left: "+=20", opacity: d.opacity}, 150);
|
||||
break;
|
||||
case "right":
|
||||
K.delay(P).css({left: "+=20", opacity: 0, display: "block"}).stop(true, true).animate({left: "-=20", opacity: d.opacity}, 150);
|
||||
break;
|
||||
default:
|
||||
K.delay(P).css({opacity: 0, display: "block"}).stop(true, true).animate({opacity: d.opacity}, 150);
|
||||
break
|
||||
}
|
||||
n.data.$plugin.tooltip = K;
|
||||
n.data.$plugin.location = Q;
|
||||
n.data.$plugin.tooltip_arrow_border = L;
|
||||
K = null;
|
||||
return false
|
||||
}, mouseOutHandler: function(d) {
|
||||
var f = d.data.$plugin.tooltip;
|
||||
var g = d.data.$plugin.location;
|
||||
var c = false;
|
||||
if (d.data.settings.trigger != "hoverable") {
|
||||
if (d.data.settings.trigger == "hover") {
|
||||
a(f).delay(d.data.settings.delay);
|
||||
c = true
|
||||
} else {
|
||||
c = true;
|
||||
if (d.data.settings.trigger == "click") {
|
||||
if (!d.data.settings.issticky) {
|
||||
d.data.settings.interval = setInterval(function() {
|
||||
a(f).fadeOut(0, function() {
|
||||
a(d.data.$plugin.tooltip).remove()
|
||||
});
|
||||
clearInterval(d.data.settings.interval);
|
||||
this.toggle = false;
|
||||
d.data.$toggle = false;
|
||||
d.data.element.unbind("click");
|
||||
d.data.element.unbind("mouseleave");
|
||||
d.data.element.bind("click", {settings: d.data.settings, element: d.data.element, $plugin: d.data.$plugin, $toggle: false}, d.data.$plugin.mouseOverHandler);
|
||||
d.data.element.bind("mouseleave", {settings: d.data.settings, element: d.data.element, $plugin: d.data.$plugin, $toggle: false}, d.data.$plugin.mouseOutHandler)
|
||||
}, d.data.settings.delay == 0 ? 2000 : d.data.settings.delay);
|
||||
d.data.element.unbind("mouseleave");
|
||||
a(f).find(".tooltip-content").bind("mouseenter", {settings: d.data.settings, element: d.data.element, $plugin: d.data.$plugin, $toggle: true}, function() {
|
||||
d.data.element.unbind("click");
|
||||
d.data.element.unbind("mouseleave");
|
||||
this.toggle = true;
|
||||
d.data.$toggle = true;
|
||||
clearInterval(d.data.settings.interval)
|
||||
});
|
||||
a(f).find(".tooltip-content").bind("mouseleave", {settings: d.data.settings, element: d.data.element, $plugin: d.data.$plugin, $toggle: d.data.$toggle}, function() {
|
||||
a(f).fadeOut(0, function() {
|
||||
a(d.data.$plugin.tooltip).remove()
|
||||
});
|
||||
this.toggle = false;
|
||||
d.data.$toggle = false;
|
||||
d.data.element.unbind("click");
|
||||
d.data.element.unbind("mouseleave");
|
||||
d.data.element.bind("click", {settings: d.data.settings, element: d.data.element, $plugin: d.data.$plugin, $toggle: false}, d.data.$plugin.mouseOverHandler);
|
||||
d.data.element.bind("mouseleave", {settings: d.data.settings, element: d.data.element, $plugin: d.data.$plugin, $toggle: false}, d.data.$plugin.mouseOutHandler)
|
||||
});
|
||||
c = false
|
||||
} else {
|
||||
c = true
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
d.data.settings.interval = setInterval(function() {
|
||||
a(f).fadeOut(0, function() {
|
||||
a(d.data.$plugin.tooltip).remove()
|
||||
});
|
||||
clearInterval(d.data.settings.interval);
|
||||
d.data.element.unbind("mouseleave");
|
||||
d.data.element.unbind("mouseenter");
|
||||
d.data.element.bind("mouseenter", {settings: d.data.settings, element: d.data.element, $plugin: d.data.$plugin, $toggle: false}, d.data.$plugin.mouseOverHandler);
|
||||
d.data.element.bind("mouseleave", {settings: d.data.settings, element: d.data.element, $plugin: d.data.$plugin, $toggle: false}, d.data.$plugin.mouseOutHandler)
|
||||
}, d.data.settings.delay == 0 ? 2000 : d.data.settings.delay);
|
||||
d.data.element.unbind("mouseleave");
|
||||
a(f).find(".tooltip-content").bind("mouseenter", {settings: d.data.settings, element: d.data.element, $plugin: d.data.$plugin, $toggle: true}, function() {
|
||||
d.data.element.unbind("mouseenter");
|
||||
d.data.element.unbind("mouseleave");
|
||||
this.toggle = true;
|
||||
d.data.$toggle = true;
|
||||
clearInterval(d.data.settings.interval)
|
||||
});
|
||||
a(f).find(".tooltip-content").bind("mouseleave", {settings: d.data.settings, element: d.data.element, $plugin: d.data.$plugin, $toggle: true}, function() {
|
||||
a(f).fadeOut(0, function() {
|
||||
a(d.data.$plugin.tooltip).remove()
|
||||
});
|
||||
this.toggle = false;
|
||||
d.data.$toggle = false;
|
||||
d.data.element.unbind("mouseleave");
|
||||
d.data.element.unbind("mouseenter");
|
||||
d.data.element.bind("mouseenter", {settings: d.data.settings, element: d.data.element, $plugin: d.data.$plugin, $toggle: false}, d.data.$plugin.mouseOverHandler);
|
||||
d.data.element.bind("mouseleave", {settings: d.data.settings, element: d.data.element, $plugin: d.data.$plugin, $toggle: false}, d.data.$plugin.mouseOutHandler)
|
||||
});
|
||||
c = false
|
||||
}
|
||||
if (c) {
|
||||
switch (d.data.$plugin.tooltip_arrow_border) {
|
||||
case "top":
|
||||
a(f).stop(true, true).animate({top: "-=20", opacity: 0}, 150, function() {
|
||||
a(d.data.$plugin.tooltip).remove()
|
||||
});
|
||||
break;
|
||||
case "bottom":
|
||||
a(f).stop(true, true).animate({top: "+=20", opacity: 0}, 150, function() {
|
||||
a(d.data.$plugin.tooltip).remove()
|
||||
});
|
||||
break;
|
||||
case "left":
|
||||
a(f).stop(true, true).animate({left: "-=20", opacity: 0}, 150, function() {
|
||||
a(d.data.$plugin.tooltip).remove()
|
||||
});
|
||||
break;
|
||||
case "right":
|
||||
a(f).stop(true, true).animate({left: "+=20", opacity: 0}, 150, function() {
|
||||
a(d.data.$plugin.tooltip).remove()
|
||||
});
|
||||
break
|
||||
}
|
||||
a(d.data.$plugin.tooltip).remove()
|
||||
}
|
||||
if (d.data.settings.trigger == "click") {
|
||||
if (d.data.$toggle) {
|
||||
a("body").find("#tooltip-clickoutside").remove();
|
||||
this.toggle = false;
|
||||
d.data.$toggle = false;
|
||||
d.data.element.unbind("click");
|
||||
d.data.element.unbind("mouseleave");
|
||||
d.data.element.bind("click", {settings: d.data.settings, element: d.data.element, $plugin: d.data.$plugin, $toggle: d.data.$toggle}, d.data.$plugin.mouseOverHandler);
|
||||
if (!d.data.settings.issticky) {
|
||||
d.data.element.bind("mouseleave", {settings: d.data.settings, element: d.data.element, $plugin: d.data.$plugin, $toggle: d.data.$toggle}, d.data.$plugin.mouseOutHandler)
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
}};
|
||||
scrollbarWidth = function() {
|
||||
var c = a('<div style="width:50px;height:50px;overflow:hidden;position:absolute;top:-200px;left:-200px;"><div style="height:100px;"></div>');
|
||||
a("body").append(c);
|
||||
var d = a("div", c).innerWidth();
|
||||
c.css("overflow", "scroll");
|
||||
var e = a("div", c).innerWidth();
|
||||
a(c).remove();
|
||||
return (d - e)
|
||||
};
|
||||
a.fn.LiteTooltip.defaultSettings = {
|
||||
location: "top",
|
||||
title: "",
|
||||
opacity: 0.89,
|
||||
backcolor: "#000000",
|
||||
textcolor: "#ffffff",
|
||||
template: '<div class="litetooltip-wrapper"><div class="tooltip-arrow"></div><div class="tooltip-content"></div></div>',
|
||||
margin: 5,
|
||||
padding: 10,
|
||||
width: 0,
|
||||
textalign: "center",
|
||||
trigger: "hover",
|
||||
templatename: "",
|
||||
delay: 0,
|
||||
issticky: true,
|
||||
clearfix: '<div class="clear"></div>',
|
||||
container: "body",
|
||||
shadow: 1
|
||||
}
|
||||
})(jQuery);
|
||||
12
modules/appagebuilder/views/js/admin/autoload.js
Normal file
12
modules/appagebuilder/views/js/admin/autoload.js
Normal file
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
* @Website: apollotheme.com - prestashop template provider
|
||||
* @author Apollotheme <apollotheme@gmail.com>
|
||||
* @copyright Apollotheme
|
||||
* @description:
|
||||
*/
|
||||
|
||||
$(document).ready(function() {
|
||||
if (typeof autoload_func_name !== 'undefined') {
|
||||
window[autoload_func_name]();
|
||||
}
|
||||
});
|
||||
570
modules/appagebuilder/views/js/admin/detail.js
Normal file
570
modules/appagebuilder/views/js/admin/detail.js
Normal file
@@ -0,0 +1,570 @@
|
||||
/**
|
||||
* @Website: apollotheme.com - prestashop template provider
|
||||
* @author Apollotheme <apollotheme@gmail.com>
|
||||
* @copyright Apollotheme
|
||||
* @description:
|
||||
*/
|
||||
var windowWidth = $(window).width();
|
||||
var currentId;
|
||||
var currentConfig;
|
||||
$(document).ready(function() {
|
||||
//only for product generate
|
||||
$(".adminappagebuilderdetails #nav-sidebar").trigger("click");
|
||||
|
||||
$('.plist-eedit').click(function(){
|
||||
element = $(this).data('element');
|
||||
$.fancybox.open([{
|
||||
type: 'iframe',
|
||||
href : ($('#appagebuilder_products_form').length?$('#appagebuilder_products_form').attr('action'):$('#appagebuilder_details_form').attr('action')) + '&pelement=' + element,
|
||||
afterLoad:function(){
|
||||
if ($('body',$('.fancybox-iframe').contents()).find("#main").length) {
|
||||
hideSomeElement();
|
||||
$('.fancybox-iframe').load( hideSomeElement );
|
||||
} else {
|
||||
$('body',$('.fancybox-iframe').contents()).find("#psException").html('<div class="alert error">Can not find this element</div>');
|
||||
}
|
||||
},
|
||||
afterClose: function (event, ui) {
|
||||
}
|
||||
}], {
|
||||
padding: 10
|
||||
});
|
||||
});
|
||||
|
||||
$('.element-list .plist-element').draggable({
|
||||
connectToSortable: ".product-container .content",
|
||||
revert: "true",
|
||||
helper: "clone",
|
||||
handle: ".gaction-drag",
|
||||
stop: function() {
|
||||
$( ".product-container .content" ).sortable({
|
||||
revert: false
|
||||
});
|
||||
setProFormAction();
|
||||
setSortAble();
|
||||
}
|
||||
});
|
||||
|
||||
$('.show-postion').click(function(){$("#postion_layout img").show()});
|
||||
$('.postion-img-co').click(function(){$("#postion_layout img").toggle()});
|
||||
|
||||
|
||||
$(document).on("click", ".column-add", function () {
|
||||
createColumn(this);
|
||||
$(currentId).find('.btn-add-column').trigger( "click" );
|
||||
editcolumn();
|
||||
//DONGND:: re-call event for new element
|
||||
setProFormAction();
|
||||
setSortAble();
|
||||
});
|
||||
setProFormAction();
|
||||
setSortAble();
|
||||
|
||||
$('body').on('click', function (e) {
|
||||
$('[data-toggle=popover]').each(function () {
|
||||
// hide any open popovers when the anywhere else in the body is clicked
|
||||
if (!$(this).is(e.target) && $(this).has(e.target).length === 0 && $('.popover').has(e.target).length === 0) {
|
||||
$(this).popover('hide');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
widthselect();
|
||||
setCssClass();
|
||||
saveData();
|
||||
thumbconfig();
|
||||
//DONGND:: add config for zoom
|
||||
zoomconfig();
|
||||
|
||||
$('#appagebuilder_details_form').submit(function() {
|
||||
genreateForm();
|
||||
});
|
||||
|
||||
//DONGND:: setup ui for element
|
||||
$('.ap_proGrid .row, .ap_proGrid .column-row').addClass('ui-widget ui-widget-content ui-helper-clearfix ui-corner-all');
|
||||
$('.ap_proGrid .gaction-drag, .ap_proGrid .caction-drag, .ap_proGrid .waction-drag').addClass('ui-widget-header ui-corner-all');
|
||||
});
|
||||
|
||||
function thumbconfig(){
|
||||
$('.select_thumb').change(function() {
|
||||
if ($(this).val() == 'none')
|
||||
$(this).closest('.formmodal').find('.select_thumb-none').hide();
|
||||
else
|
||||
$(this).closest('.formmodal').find('.select_thumb-none').show();
|
||||
});
|
||||
}
|
||||
|
||||
//DONGND:: add config for zoom
|
||||
function zoomconfig(){
|
||||
$('.select_zoom').change(function() {
|
||||
if ($(this).val() == 'none' || $(this).val() == 'in' || $(this).val() == 'in_scrooll')
|
||||
$(this).closest('.formmodal').find('.select-zoom-none').hide();
|
||||
else
|
||||
$(this).closest('.formmodal').find('.select-zoom-none').show();
|
||||
});
|
||||
}
|
||||
|
||||
function genreateForm(){
|
||||
//generate grid first
|
||||
var ObjectFrom = {};
|
||||
ObjectFrom.gridLeft = returnObjElemnt('.ap_proGrid .gridLeft-block-content');
|
||||
ObjectFrom.class = $("#main_class").val();
|
||||
// console.log(ObjectFrom);
|
||||
$('input[name=params]').val(JSON.stringify(ObjectFrom));
|
||||
}
|
||||
|
||||
function returnObjElemnt(element){
|
||||
var Object = {};
|
||||
// console.log(element);
|
||||
$(element).children().each(function(iElement){
|
||||
var Obj = {};
|
||||
Obj.name = $(this).data('element');
|
||||
if($(this).data("form") == undefined || $(this).data("form") == "" || $(this).data("form") == '\"\"')
|
||||
Obj.form = "";
|
||||
else
|
||||
Obj.form = $(this).data('form');
|
||||
|
||||
if(Obj.name=='product_image_with_thumb'){
|
||||
if (Obj.form.templateview == 'left' || Obj.form.templateview == 'right' || Obj.form.templateview == 'bottom')
|
||||
$("#main_class").val('product-image-thumbs product-thumbs-'+Obj.form.templateview);
|
||||
else $("#main_class").val('product-image-thumbs no-thumbs');
|
||||
}
|
||||
|
||||
if(Obj.name=='product_image_show_all'){
|
||||
$("#main_class").val('product-image-gallery');
|
||||
}
|
||||
|
||||
if($(this).hasClass('functional_buttons')){
|
||||
|
||||
Obj.columns = {};
|
||||
$(this).find('.column-row').each(function(yElement){
|
||||
var ObjectColumn = {};
|
||||
ObjectColumn.form = $(this).data('form');
|
||||
ObjectColumn.element = 'column';
|
||||
ObjectColumn.sub = returnObjElemnt($('.content', $(this)));
|
||||
Obj.columns[yElement] = ObjectColumn;
|
||||
});
|
||||
}
|
||||
if($(this).hasClass('code')){
|
||||
Obj.code = replaceSpecialString($('textarea', $(this)).val());
|
||||
}
|
||||
|
||||
Object[iElement] = Obj;
|
||||
});
|
||||
//console.log($(element).children());
|
||||
//console.log(Object);
|
||||
|
||||
return Object;
|
||||
}
|
||||
function replaceSpecialString(str){
|
||||
return str.replace(/\t/g, "_APTAB_").replace(/\r/g, "_APNEWLINE_").replace(/\n/g, "_APENTER_").replace(/"/g, "_APQUOT_").replace(/'/g, "_APAPOST_");
|
||||
}
|
||||
function saveData(){
|
||||
$(".btn-savewidget").click(function(){
|
||||
// console.log($(".formmodal"));
|
||||
var data = getFormData($(".formmodal"));
|
||||
// console.log(data);
|
||||
$("#modal_form .close").trigger('click');
|
||||
$(currentConfig).data('form', data);
|
||||
});
|
||||
}
|
||||
|
||||
function getFormData($form){
|
||||
var unindexed_array = $form.serializeArray();
|
||||
var indexed_array = {};
|
||||
|
||||
if($(currentConfig).hasClass('column-row'))
|
||||
{
|
||||
$(currentConfig).attr('class', 'column-row plist-element');
|
||||
}
|
||||
|
||||
$.map(unindexed_array, function(n, i){
|
||||
if(n['name']!='hidden_from[]')
|
||||
indexed_array[n['name']] = n['value'];
|
||||
//process class of column
|
||||
if($(currentConfig).hasClass('column-row') && (n['name'] == 'xl' || n['name'] == 'lg' || n['name'] == 'md' || n['name'] == 'sm' || n['name'] == 'xs' || n['name'] == 'sp'))
|
||||
$(currentConfig).addClass('col-'+n['name']+'-'+n['value']);
|
||||
|
||||
});
|
||||
|
||||
return indexed_array;
|
||||
}
|
||||
|
||||
function hideSomeElement(){
|
||||
$('body',$('.fancybox-iframe').contents()).addClass("page-sidebar-closed");
|
||||
}
|
||||
|
||||
function setSortAble(){
|
||||
$( ".product-container .content" ).sortable({
|
||||
connectWith: ".content",
|
||||
});
|
||||
}
|
||||
|
||||
function setCssClass(){
|
||||
if ($(".select-class").length) {
|
||||
$(".select-class").click(function () {
|
||||
if ($(this).is(':checked')) {
|
||||
|
||||
$('.select-class').each(function() {
|
||||
// REMOVE ALL CHECKBOX VALUE IN TEXT
|
||||
var classChk = $(this).data("value");
|
||||
input_text = $(this).closest('.well').find('.element_class').first().val();
|
||||
// trim string
|
||||
var input_text = input_text.replace(classChk, "");
|
||||
input_text = input_text.split(" ").join(" ");
|
||||
input_text = $.trim(input_text);
|
||||
|
||||
$(this).closest('.well').find('.element_class').first().val(input_text);
|
||||
});
|
||||
|
||||
var classChk = $(this).data("value");
|
||||
var elementText = $(this).closest('.well').find('.element_class').first();
|
||||
|
||||
// SET VALUE CHECKBOX TO TEXT
|
||||
if ($(elementText).val().indexOf(classChk) == -1) {
|
||||
if ($(elementText).val() != "") {
|
||||
$(elementText).val($(elementText).val() + " " + classChk);
|
||||
} else {
|
||||
$(elementText).val(classChk);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(".chk-row").click(function () {
|
||||
var classChk = $(this).data("value");
|
||||
var elementText = $(this).closest('.well').find('.element_class').first();
|
||||
if ($(elementText).val().indexOf(classChk) == -1) {
|
||||
// NOT EXIST AND ADD
|
||||
if ($(elementText).val() != "") {
|
||||
$(elementText).val($(elementText).val() + " " + classChk);
|
||||
} else {
|
||||
$(elementText).val(classChk);
|
||||
}
|
||||
}else{
|
||||
// EXIST AND REMOVE
|
||||
var find = classChk;
|
||||
var re = new RegExp(find, 'g');
|
||||
var text = $(elementText).val();
|
||||
text = text.replace(re, '');
|
||||
$(elementText).val(text);
|
||||
}
|
||||
});
|
||||
|
||||
$(".element_class").change(function () {
|
||||
elementChk = $(this).closest('.well').find('input[type=checkbox]');
|
||||
classText = $(this).val();
|
||||
$(elementChk).each(function () {
|
||||
classChk = $(this).data("value");
|
||||
if (classText.indexOf(classChk) != -1) {
|
||||
if (!$(this).is(':checked'))
|
||||
$(this).prop("checked", true);
|
||||
} else {
|
||||
$(this).prop("checked", false);
|
||||
}
|
||||
});
|
||||
});
|
||||
$(".element_class").trigger("change");
|
||||
}
|
||||
}
|
||||
|
||||
//set action when c
|
||||
function setProFormAction(){
|
||||
$('#home_wrapper .plist-code').each(function(){
|
||||
if(!$(this).hasClass('setaction')){
|
||||
$(this).click(function(){
|
||||
textAre = $(this).closest('.plist-element').find('textarea').first();
|
||||
if(textAre.attr('rows') == 20)
|
||||
$(textAre).attr('rows',5);
|
||||
else
|
||||
$(textAre).attr('rows',20);
|
||||
});
|
||||
$(this).addClass('setaction');
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$('#home_wrapper .btn-add-column').each(function(){
|
||||
|
||||
if(!$(this).hasClass('setaction')){
|
||||
$(this).popover({
|
||||
html: true,
|
||||
content: function () {
|
||||
currentId = $(this).closest('.plist-element');
|
||||
return $('#addnew-column-form').html();
|
||||
}
|
||||
});
|
||||
$(this).mousedown(function(){
|
||||
// toggle popover when link is clicked
|
||||
$(this).popover('toggle');
|
||||
});
|
||||
|
||||
$(this).addClass('setaction');
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$('#home_wrapper .plist-eremove').each(function(){
|
||||
if(!$(this).hasClass('setaction')){
|
||||
$(this).click(function(){
|
||||
if(!confirm("Are you sure to remove?")) return false;
|
||||
$(this).closest('.plist-element').remove();
|
||||
$(this).addClass('setaction');
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$('#home_wrapper .btn-edit-group').each(function(){
|
||||
if(!$(this).hasClass('setaction')){
|
||||
$(this).click(function(){
|
||||
currentConfig = $(this).closest('.plist-element');
|
||||
$('#modal_form .modal-footer').show();
|
||||
|
||||
$('#modal_form .modal-body').html('');
|
||||
|
||||
column_config = $("#group_config").clone(true);
|
||||
|
||||
//load config
|
||||
data = $(currentConfig).data('form');
|
||||
column_config = setData(data, column_config);
|
||||
$('#modal_form .modal-body').append('<form class="formmodal"></form>');
|
||||
$('#modal_form .formmodal').append(column_config);
|
||||
|
||||
$('#modal_form').removeClass('modal-new').addClass('modal-edit');
|
||||
$("#modal_form").modal({
|
||||
"backdrop": "static"
|
||||
});
|
||||
});
|
||||
$(this).addClass('setaction');
|
||||
}
|
||||
});
|
||||
|
||||
$('#home_wrapper .element-config').each(function(){
|
||||
if(!$(this).hasClass('setaction')){
|
||||
$(this).click(function(){
|
||||
currentConfig = $(this).closest('.plist-element');
|
||||
$('#modal_form .modal-footer').show();
|
||||
|
||||
$('#modal_form .modal-body').html('');
|
||||
|
||||
dataconfig = $(this).data('config');
|
||||
|
||||
column_config = $("#"+dataconfig).clone(true);
|
||||
//load config
|
||||
|
||||
data = $(currentConfig).data('form');
|
||||
|
||||
column_config = setData(data, column_config);
|
||||
|
||||
if($(column_config).find('.select_thumb').val() == 'none')
|
||||
$(column_config).find('.select_thumb-none').hide();
|
||||
else
|
||||
$(column_config).find('.select_thumb-none').show();
|
||||
|
||||
//DONGND:: add zoom config
|
||||
if($(column_config).find('.select_zoom').val() == 'none' || $(column_config).find('.select_zoom').val() == 'in' || $(column_config).find('.select_zoom').val() == 'in_scrooll')
|
||||
$(column_config).find('.select-zoom-none').hide();
|
||||
else
|
||||
$(column_config).find('.select-zoom-none').show();
|
||||
|
||||
$('#modal_form .modal-body').append('<form class="formmodal"></form>');
|
||||
$('#modal_form .formmodal').append(column_config);
|
||||
|
||||
$('#modal_form').removeClass('modal-new').addClass('modal-edit');
|
||||
$("#modal_form").modal({
|
||||
"backdrop": "static"
|
||||
});
|
||||
});
|
||||
$(this).addClass('setaction');
|
||||
}
|
||||
});
|
||||
|
||||
editcolumn();
|
||||
}
|
||||
function setData(data, column_config){
|
||||
if(!data || data == 'undefined' || data == 'undefined') return column_config;
|
||||
|
||||
Object.keys(data).forEach(function (key) {
|
||||
//$('.' + key).data('form', dataObj[key]);
|
||||
$(column_config).find('input[name='+key+']').val(data[key]);
|
||||
|
||||
$(column_config).find('select[name='+key+']').val(data[key]);
|
||||
|
||||
if(key=="class" && $(column_config).find('.select-class').length)
|
||||
$(column_config).find('.select-class').each(function(){
|
||||
if(data[key].indexOf($(this).data('value'))>-1) $(this).prop("checked", true);
|
||||
});
|
||||
if(key=="xl" || key=="lg" || key=="md" || key=="sm" || key=="xs" || key=="sp"){
|
||||
classcss = 'width-select-'+key+'-'+data[key];
|
||||
classcss = classcss.replace(".", "-");
|
||||
$(column_config).find('.'+classcss).trigger('click');
|
||||
}
|
||||
});
|
||||
|
||||
return column_config;
|
||||
}
|
||||
function editcolumn()
|
||||
{
|
||||
$('#home_wrapper .btn-edit-column').each(function(){
|
||||
if(!$(this).hasClass('setaction')){
|
||||
$(this).click(function(){
|
||||
currentConfig = $(this).closest('.plist-element');
|
||||
|
||||
$('#modal_form .modal-body').html('');
|
||||
|
||||
$('#modal_form .modal-footer').show();
|
||||
|
||||
data = $(currentConfig).data('form');
|
||||
//console.log(data);
|
||||
column_config = $("#column_config").clone(true);
|
||||
column_config = setData(data, column_config);
|
||||
|
||||
$('#modal_form .modal-body').append('<form class="formmodal"></form>');
|
||||
$('#modal_form .formmodal').append(column_config);
|
||||
|
||||
$('#modal_form').removeClass('modal-new').addClass('modal-edit');
|
||||
$("#modal_form").modal({
|
||||
"backdrop": "static"
|
||||
});
|
||||
//widthselect();
|
||||
});
|
||||
$(this).addClass('setaction');
|
||||
}
|
||||
});
|
||||
}
|
||||
function widthselect(){
|
||||
$('.width-select').each(function(){
|
||||
if(!$(this).hasClass('setaction')){
|
||||
$('.width-select').click(function () {
|
||||
btnGroup = $(this).closest('.btn-group');
|
||||
spanObj = $('.width-val', $(this));
|
||||
width = $(spanObj).data('width');
|
||||
$('.col-val', $(btnGroup)).val(width);
|
||||
$('.apbtn-width .width-val', $(btnGroup)).html($(spanObj).html());
|
||||
$('.apbtn-width .width-val', $(btnGroup)).attr('class', $(spanObj).attr('class'));
|
||||
});
|
||||
$(this).addClass('setaction');
|
||||
}
|
||||
});
|
||||
}
|
||||
function createColumn(obj) {
|
||||
var widthCol = $(obj).data('width');
|
||||
var classActive = returnWidthClass();
|
||||
var col = $(obj).data('col');
|
||||
var realValue = widthCol.toString().replace('.', '-');
|
||||
for (var i = 1; i <= col; i++) {
|
||||
wrapper = currentId.find('.group');
|
||||
|
||||
column = $('#default_column').clone();
|
||||
var cls = $(column).attr("class");
|
||||
//column-row col-sp-12 col-xs-12 col-sm-12 col-md-12 col-lg-12 ui-widget ui-widget-content ui-helper-clearfix ui-corner-all
|
||||
cls = cls.replace("col-xl-12", "col-xl-" + realValue);
|
||||
cls = cls.replace("col-lg-12", "col-lg-" + realValue);
|
||||
cls = cls.replace("col-md-12", "col-md-" + realValue);
|
||||
cls = cls.replace("col-sm-12", "col-sm-" + realValue);
|
||||
cls = cls.replace("col-xs-12", "col-xs-" + realValue);
|
||||
cls = cls.replace("col-sp-12", "col-sp-" + realValue);
|
||||
$(column).attr("class", cls);
|
||||
objColumn = {form_id: "form_" + getRandomNumber()};
|
||||
if (classActive == "md" || classActive == "lg" || classActive == "xl") {
|
||||
objColumn.md = widthCol;
|
||||
objColumn.lg = widthCol;
|
||||
objColumn.xl = widthCol;
|
||||
}
|
||||
//DONGND:: set default for sm, xs, sp
|
||||
objColumn.sm = 12;
|
||||
objColumn.xs = 12;
|
||||
objColumn.sp = 12;
|
||||
//jQuery.extend(objColumn, $globalthis.getColDefault());
|
||||
$(column).data("form", objColumn);
|
||||
|
||||
column.removeAttr('id');
|
||||
wrapper.append(column);
|
||||
getNumberColumnInClass(column, classActive);
|
||||
$(".label-tooltip").tooltip();
|
||||
}
|
||||
}
|
||||
|
||||
function getNumberColumnInClass(obj, type) {
|
||||
var cls = $(obj).attr("class").split(" ");
|
||||
var len = cls.length;
|
||||
var result = "";
|
||||
for (var i = 0; i < len; i++) {
|
||||
if (cls[i].search("col-" + type) >= 0) {
|
||||
result = cls[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
var temp = result.replace("col-" + type + "-", "");
|
||||
$(obj).find(".pull-right .btn-group .btn span:first-child").attr("class", "width-val ap-w-" + temp);
|
||||
var group = $(obj).find("ul.dropdown-menu-right");
|
||||
$(group).find("li").removeClass("selected");
|
||||
$(group).find(".col-" + temp).addClass("selected");
|
||||
}
|
||||
|
||||
function getRandomNumber()
|
||||
{
|
||||
return (+new Date() + (Math.random() * 10000000000000000)).toString().replace('.', '');
|
||||
}
|
||||
function returnWidthClass(width) {
|
||||
if (!width)
|
||||
width = windowWidth;
|
||||
|
||||
if (parseInt(width) >= 1200)
|
||||
return 'xl';
|
||||
if (parseInt(width) >= 992)
|
||||
return 'lg';
|
||||
if (parseInt(width) >= 768)
|
||||
return 'md';
|
||||
if (parseInt(width) >= 576)
|
||||
return 'sm';
|
||||
if (parseInt(width) >= 480)
|
||||
return 'xs';
|
||||
if (parseInt(width) < 480)
|
||||
return 'sp';
|
||||
};
|
||||
$(document).on("click", ".btn-fwidth", function () {
|
||||
$('#home_wrapper').css('width', $(this).data('width'));
|
||||
|
||||
btnElement = $(this);
|
||||
$('.btn-fwidth').removeClass('active');
|
||||
$(this).addClass('active');
|
||||
//reset
|
||||
if ($(this).hasClass('width-default')) {
|
||||
windowWidth = $(window).width();
|
||||
$('#home_wrapper').attr('class', 'default');
|
||||
} else {
|
||||
$('#home_wrapper').attr('class', 'col-' + returnWidthClass(parseInt($(this).data('width'))));
|
||||
windowWidth = $(this).data('width');
|
||||
}
|
||||
classVal = returnWidthClass();
|
||||
$(".column-row", $('#home_wrapper')).each(function () {
|
||||
valueFra = $(this).data("form")[classVal];
|
||||
$(".apbtn-width .width-val", $(this)).attr("class", "width-val ap-w-" + valueFra.toString().replace(".", "-"));
|
||||
});
|
||||
initColumnSetting();
|
||||
});
|
||||
|
||||
function initColumnSetting() {
|
||||
var classActive = returnWidthClass();
|
||||
$(".column-row").each(function () {
|
||||
getNumberColumnInClass(this, classActive);
|
||||
});
|
||||
}
|
||||
|
||||
function getNumberColumnInClass(obj, type) {
|
||||
var cls = $(obj).attr("class").split(" ");
|
||||
var len = cls.length;
|
||||
var result = "";
|
||||
for (var i = 0; i < len; i++) {
|
||||
if (cls[i].search("col-" + type) >= 0) {
|
||||
result = cls[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
var temp = result.replace("col-" + type + "-", "");
|
||||
$(obj).find(".pull-right .btn-group .btn span:first-child").attr("class", "width-val ap-w-" + temp);
|
||||
var group = $(obj).find("ul.dropdown-menu-right");
|
||||
$(group).find("li").removeClass("selected");
|
||||
$(group).find(".col-" + temp).addClass("selected");
|
||||
}
|
||||
1046
modules/appagebuilder/views/js/admin/form.js
Normal file
1046
modules/appagebuilder/views/js/admin/form.js
Normal file
File diff suppressed because it is too large
Load Diff
28
modules/appagebuilder/views/js/admin/form_admin_positions.js
Normal file
28
modules/appagebuilder/views/js/admin/form_admin_positions.js
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* @Website: apollotheme.com - prestashop template provider
|
||||
* @author Apollotheme <apollotheme@gmail.com>
|
||||
* @copyright Apollotheme
|
||||
* @description:
|
||||
*/
|
||||
|
||||
$(document).ready(function() {
|
||||
$('.leo_delete_position').each(function(){
|
||||
|
||||
$(this).closest('a').attr('href',"javascript:void(0);");
|
||||
|
||||
$('<input>', {
|
||||
type: 'hidden',
|
||||
id : 'leo_delete_position',
|
||||
name: 'leo_delete_position',
|
||||
value: '0'
|
||||
}).appendTo( $(this).parent() );
|
||||
|
||||
$(this).closest('a').click(function(){
|
||||
if (confirm(leo_confirm_text)){
|
||||
$('#leo_delete_position').val('1');
|
||||
$(this).closest('form').attr('action', leo_form_submit);
|
||||
$(this).closest('form').submit();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
44
modules/appagebuilder/views/js/admin/function.js
Normal file
44
modules/appagebuilder/views/js/admin/function.js
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* @Website: apollotheme.com - prestashop template provider
|
||||
* @author Apollotheme <apollotheme@gmail.com>
|
||||
* @copyright Apollotheme
|
||||
* @description:
|
||||
*/
|
||||
|
||||
function SetButonSaveToHeader() {
|
||||
var html_save_and_stay =
|
||||
'<li>' +
|
||||
'<a id="page-header-desc-appagebuilder_shortcode-SaveAndStay" class="toolbar_btn pointer" href="javascript:void(0);" title="Save and stay" onclick="TopSaveAndStay()">' +
|
||||
'<i class="process-icon-save"></i>' +
|
||||
'<div>Save and stay</div>' +
|
||||
'</a>' +
|
||||
'</li>';
|
||||
$('.toolbarBox .btn-toolbar ul').prepend(html_save_and_stay);
|
||||
|
||||
}
|
||||
|
||||
function TopSave(){
|
||||
if (typeof TopSave_Name !== 'undefined') {
|
||||
$("button[name$='"+TopSave_Name+"']").click();
|
||||
}
|
||||
}
|
||||
|
||||
function TopSaveAndStay(){
|
||||
if (typeof TopSaveAndStay_Name !== 'undefined') {
|
||||
$("button[name$='"+TopSaveAndStay_Name+"']").click();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* review $('.nav-bar').on('click', '.menu-collapse', function() {
|
||||
*/
|
||||
function miniLeftMenu(parameters) {
|
||||
if( !$('body').hasClass('page-sidebar-closed')){
|
||||
$('body').toggleClass('page-sidebar-closed');
|
||||
if ($('body').hasClass('page-sidebar-closed')) {
|
||||
$('nav.nav-bar ul.main-menu > li')
|
||||
.removeClass('ul-open open')
|
||||
.find('a > i.material-icons.sub-tabs-arrow').text('keyboard_arrow_down');
|
||||
}
|
||||
}
|
||||
}
|
||||
2976
modules/appagebuilder/views/js/admin/home.js
Normal file
2976
modules/appagebuilder/views/js/admin/home.js
Normal file
File diff suppressed because it is too large
Load Diff
36
modules/appagebuilder/views/js/admin/index.php
Normal file
36
modules/appagebuilder/views/js/admin/index.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2012 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2012 PrestaShop SA
|
||||
* @version Release: $Revision: 13573 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||
|
||||
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||
header("Pragma: no-cache");
|
||||
|
||||
header("Location: ../");
|
||||
exit;
|
||||
8
modules/appagebuilder/views/js/admin/isotope.pkgd.min.js
vendored
Normal file
8
modules/appagebuilder/views/js/admin/isotope.pkgd.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
94
modules/appagebuilder/views/js/admin/product-list.js
Normal file
94
modules/appagebuilder/views/js/admin/product-list.js
Normal file
@@ -0,0 +1,94 @@
|
||||
/**
|
||||
* @Website: apollotheme.com - prestashop template provider
|
||||
* @author Apollotheme <apollotheme@gmail.com>
|
||||
* @copyright Apollotheme
|
||||
* @description:
|
||||
*/
|
||||
$(document).ready(function() {
|
||||
//only for product generate
|
||||
|
||||
$('.plist-eedit').click(function(){
|
||||
element = $(this).data('element');
|
||||
$.fancybox.open([{
|
||||
type: 'iframe',
|
||||
href : ($('#appagebuilder_products_form').length?$('#appagebuilder_products_form').attr('action'):$('#appagebuilder_details_form').attr('action')) + '&pelement=' + element,
|
||||
afterLoad:function(){
|
||||
if( $('body',$('.fancybox-iframe').contents()).find("#main").length ){
|
||||
hideSomeElement();
|
||||
$('.fancybox-iframe').load( hideSomeElement );
|
||||
}else {
|
||||
$('body',$('.fancybox-iframe').contents()).find("#psException").html('<div class="alert error">Can not find this element</div>');
|
||||
}
|
||||
},
|
||||
afterClose: function (event, ui) {
|
||||
}
|
||||
}], {
|
||||
padding: 10
|
||||
});
|
||||
});
|
||||
|
||||
$('.element-list .plist-element').draggable({
|
||||
connectToSortable: ".product-container .content",
|
||||
revert: "true",
|
||||
helper: "clone",
|
||||
stop: function() {
|
||||
setProFormAction();
|
||||
setSortAble();
|
||||
}
|
||||
});
|
||||
|
||||
$('#appagebuilder_products_form').submit(function() {
|
||||
genreateForm();
|
||||
});
|
||||
|
||||
setProFormAction();
|
||||
setSortAble();
|
||||
});
|
||||
|
||||
function genreateForm(){
|
||||
//generate grid first
|
||||
var ObjectFrom = {};
|
||||
ObjectFrom.gridLeft = returnObjElemnt('.ap_proGrid .gridLeft-block-content');
|
||||
ObjectFrom.gridRight = returnObjElemnt('.ap_proGrid .gridRight-block-content');
|
||||
$('input[name=params]').val(JSON.stringify(ObjectFrom));
|
||||
}
|
||||
|
||||
function returnObjElemnt(element){
|
||||
var Object = {};
|
||||
$(element).children().each(function(iElement){
|
||||
var Obj = {};
|
||||
Obj.name = $(this).data('element');
|
||||
|
||||
if($(this).hasClass('functional_buttons')){
|
||||
Obj.element = returnObjElemnt($('.content', $(this)));
|
||||
}
|
||||
if($(this).hasClass('code')){
|
||||
Obj.code = replaceSpecialString($('textarea', $(this)).val());
|
||||
}
|
||||
Object[iElement] = Obj;
|
||||
});
|
||||
return Object;
|
||||
}
|
||||
|
||||
function hideSomeElement(){
|
||||
$('body',$('.fancybox-iframe').contents()).addClass("page-sidebar-closed");
|
||||
}
|
||||
|
||||
function setSortAble(){
|
||||
$( ".product-container .content" ).sortable({
|
||||
connectWith: ".content",
|
||||
});
|
||||
}
|
||||
function setProFormAction(){
|
||||
$('.plist-code').click(function(){
|
||||
textAre = $(this).closest('.plist-element').find('textarea').first();
|
||||
if(textAre.attr('rows') == 20)
|
||||
$(textAre).attr('rows',5);
|
||||
else
|
||||
$(textAre).attr('rows',20);
|
||||
});
|
||||
|
||||
$('.plist-eremove').click(function(){
|
||||
$(this).closest('.plist-element').remove();
|
||||
});
|
||||
}
|
||||
189
modules/appagebuilder/views/js/admin/setting.js
Normal file
189
modules/appagebuilder/views/js/admin/setting.js
Normal file
@@ -0,0 +1,189 @@
|
||||
/**
|
||||
* @Website: apollotheme.com - prestashop template provider
|
||||
* @author Apollotheme <apollotheme@gmail.com>
|
||||
* @copyright Apollotheme
|
||||
* @description:
|
||||
*/
|
||||
function proccessData(id) {
|
||||
var list = $.trim($(id).val()).split(",");
|
||||
var result = "";
|
||||
var sep = "";
|
||||
for(var i = 0; i < list.length; i++) {
|
||||
if($.trim(list[i])) {
|
||||
result += sep + $.trim(list[i]);
|
||||
sep = ",";
|
||||
}
|
||||
}
|
||||
$(id).val(result);
|
||||
}
|
||||
$(document).ready(function() {
|
||||
if(typeof use_mobile_theme !== 'undefined' && use_mobile_theme == 0){
|
||||
if (window.location.href.indexOf("mobiletheme") > -1) {
|
||||
if(confirm($('.source-profile').data('emobile'))){
|
||||
window.location.href = $("#subtab-AdminApPageBuilderThemeConfiguration a").attr('href');
|
||||
}
|
||||
}
|
||||
}
|
||||
if($("#apcheck_version").hasClass('firt')) {apCheckUpdate()}
|
||||
$("#apcheck_version").click(function() {apCheckUpdate()});
|
||||
|
||||
$('.panel-content-builder').slideUp();
|
||||
$('span.open-content').click(function(){
|
||||
$(this).closest('.panel').find('.panel-content-builder').slideToggle();
|
||||
});
|
||||
|
||||
// SHOW FULL input html
|
||||
$(".ap-html-full").closest( ".col-lg-9.col-lg-offset-3" ).removeClass("col-lg-9 col-lg-offset-3");
|
||||
|
||||
//DONGND:: hide home config with theme of leotheme, redirect to profile page
|
||||
if ($('#psthemecusto').length && (typeof ap_check_theme_name != 'undefined'))
|
||||
{
|
||||
$('#psthemecusto .panel').hide();
|
||||
$('#psthemecusto').append('<div class="panel"><div class="panel-heading">'+ap_profile_txt_redirect+': <a target="_blank" href="'+ap_profile_url+'">'+ap_profile_url+'</a></div></div>');
|
||||
}
|
||||
});
|
||||
function apCheckUpdate() {
|
||||
$.ajax({
|
||||
url: 'ht'+'tps'+'://w'+'ww.leo'+'theme'+'.com/moduleservice.php',
|
||||
type: "POST",
|
||||
data: $("#apcheck_version").data('form'),
|
||||
dataType: 'text',
|
||||
success: function(result) {
|
||||
console.log(result);
|
||||
$('.apmess').removeClass('hidden').html(result);
|
||||
}
|
||||
});
|
||||
}
|
||||
function compareListHooks(oldHooks, newHooks) {
|
||||
//console.log(oldHooks);
|
||||
//console.log(newHooks);
|
||||
isEqual = true;
|
||||
if(oldHooks.length > 0 && newHooks.length > 0) {
|
||||
for(var i = 0; i < oldHooks.length; i++) {
|
||||
var isSubLook = false;
|
||||
for(var j = 0; j < newHooks.length; j++) {
|
||||
if(oldHooks[i] === newHooks[j]) {
|
||||
newHooks.splice(j, 1);
|
||||
//console.log(newHooks);
|
||||
isSubLook = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!isSubLook) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return isEqual;
|
||||
}
|
||||
|
||||
$(function() {
|
||||
|
||||
// SHOW MENU 'Ap Module Configuration' - BEGIN
|
||||
if( (typeof(js_ap_controller) != 'undefined') && (js_ap_controller == 'module_configuration')){
|
||||
$('#subtab-AdminApPageBuilder').addClass('active');
|
||||
$('#subtab-AdminApPageBuilderModule').addClass('active');
|
||||
$('#subtab-AdminParentModulesSf').removeClass('active');
|
||||
}
|
||||
// SHOW MENU 'Ap Module Configuration' - END
|
||||
|
||||
// Hide RESUME at left menu, BO
|
||||
if( (typeof(js_ap_dev) != 'undefined') && (js_ap_dev == 1)){
|
||||
// $('#tab-AdminDashboard').hide();
|
||||
$('.onboarding-navbar').hide();
|
||||
}
|
||||
|
||||
$("#hook_header_old").val($("#HEADER_HOOK").val());
|
||||
$("#hook_content_old").val($("#CONTENT_HOOK").val());
|
||||
$("#hook_footer_old").val($("#FOOTER_HOOK").val());
|
||||
$("#hook_product_old").val($("#PRODUCT_HOOK").val());
|
||||
|
||||
$(".list-all-hooks a").click(function() {
|
||||
var newHook = $.trim($(this).text());
|
||||
var id = $("#position-hook-select").val();
|
||||
id = id ? id : "#HEADER_HOOK";
|
||||
var listHook = $.trim($(id).val());
|
||||
if(listHook.search(newHook) < 0) {
|
||||
listHook += (listHook ? "," : "") + newHook;
|
||||
$(id).val(listHook);
|
||||
} else {
|
||||
alert("This hook is existed");
|
||||
}
|
||||
});
|
||||
$("#HEADER_HOOK, #CONTENT_HOOK, #FOOTER_HOOK, #PRODUCT_HOOK").focus(function() {
|
||||
var id = "#" + $(this).attr("id");
|
||||
$("#position-hook-select").val(id);
|
||||
});
|
||||
|
||||
/**
|
||||
* SAVE MODULE CONFIGUATION
|
||||
*/
|
||||
$("#btn-save-appagebuilder").click(function(e) {
|
||||
$isChange = false;
|
||||
proccessData("#HEADER_HOOK");
|
||||
proccessData("#CONTENT_HOOK");
|
||||
proccessData("#FOOTER_HOOK");
|
||||
proccessData("#PRODUCT_HOOK");
|
||||
// Check change config hooks
|
||||
var oldHook = $.trim($("#hook_header_old").val()).split(",");
|
||||
var currentHook = $.trim($("#HEADER_HOOK").val()).split(",");
|
||||
if(oldHook.length != currentHook.length || !compareListHooks(oldHook, currentHook)) {
|
||||
$isChange = true;
|
||||
}
|
||||
oldHook = $.trim($("#hook_content_old").val()).split(",");
|
||||
currentHook = $.trim($("#CONTENT_HOOK").val()).split(",");
|
||||
if(oldHook.length != currentHook.length || !compareListHooks(oldHook, currentHook)) {
|
||||
$isChange = true;
|
||||
}
|
||||
oldHook = $.trim($("#hook_footer_old").val()).split(",");
|
||||
currentHook = $.trim($("#FOOTER_HOOK").val()).split(",");
|
||||
if(oldHook.length != currentHook.length || !compareListHooks(oldHook, currentHook)) {
|
||||
$isChange = true;
|
||||
}
|
||||
oldHook = $.trim($("#hook_product_old").val()).split(",");
|
||||
currentHook = $.trim($("#PRODUCT_HOOK").val()).split(",");
|
||||
if(oldHook.length != currentHook.length || !compareListHooks(oldHook, currentHook)) {
|
||||
$isChange = true;
|
||||
}
|
||||
if($isChange) {
|
||||
if(!confirm($("#message_confirm").val())) {
|
||||
e.stopPropagation();
|
||||
return false;
|
||||
}
|
||||
$("#is_change").val("is_change");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$("#modal_form").on("click", ".btn-savewidget", function() {
|
||||
// Is form add new module to appagebuilder
|
||||
if($("#modal_form").find(".form_ap_module").length > 0) {
|
||||
// Validate select hook
|
||||
if(!$("#select-hook").val()) {
|
||||
alert($("#select-hook-error").val());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
/* EXPORT + IMPORT - BEGIN */
|
||||
$(".btn_xml_export").click(function(e) {
|
||||
e.preventDefault();
|
||||
if (typeof record_id !== 'undefined') {
|
||||
var url = $(this).closest('a').attr('href');
|
||||
$('input[name="'+record_id+'"]').each(function(i){
|
||||
if( $(this).is(':checked')){
|
||||
url += '&record_id[]=' + $(this).attr('value');
|
||||
}
|
||||
});
|
||||
window.location.href = url;
|
||||
}
|
||||
});
|
||||
|
||||
$(".btn_xml_import").click(function(e) {
|
||||
e.preventDefault();
|
||||
$('#xml_import_form').slideToggle();
|
||||
$(':focus').blur();
|
||||
});
|
||||
/* EXPORT + IMPORT - END */
|
||||
});
|
||||
230
modules/appagebuilder/views/js/admin/themeeditor.js
Normal file
230
modules/appagebuilder/views/js/admin/themeeditor.js
Normal file
@@ -0,0 +1,230 @@
|
||||
/**
|
||||
* @copyright Commercial License By LeoTheme.Com
|
||||
* @email leotheme.com
|
||||
* @visit http://www.leotheme.com
|
||||
*/
|
||||
$(document).ready(function() {
|
||||
$("#leo-customize .btn-show").click(function() {
|
||||
$("body").toggleClass("off-customize");
|
||||
});
|
||||
$('#myCustomTab a').click(function(e) {
|
||||
e.preventDefault();
|
||||
$(this).tab('show');
|
||||
})
|
||||
$('#myCustomTab a:first').tab('show');
|
||||
$("#custom-accordion .accordion-group:first .accordion-body").addClass('in');
|
||||
$(".bg-config").hide();
|
||||
|
||||
setBackGroundAction();
|
||||
setPatternActive();
|
||||
|
||||
$(".clear-bg").click(function() {
|
||||
var $parent = $(this).parent();
|
||||
var $input = $(".input-setting", $parent);
|
||||
if ($input.val('')) {
|
||||
if ($parent.hasClass("background-images")) {
|
||||
$('.bi-wrapper > div', $parent).removeClass('active');
|
||||
$($input.data('selector'), $("#main-preview iframe").contents()).css($input.data('attrs'), 'none');
|
||||
$('ul select', $parent).each(function(){
|
||||
$($input.data('selector'), $("#main-preview iframe").contents()).css($(this).data('attrs'), '');
|
||||
});
|
||||
$('ul select', $parent).val("");
|
||||
$('ul.bg-config', $parent).hide();
|
||||
} else {
|
||||
$input.attr('style', '')
|
||||
}
|
||||
$($input.data('selector'), $("#main-preview iframe").contents()).css($input.data('attrs'), 'inherit');
|
||||
|
||||
}
|
||||
$input.val('');
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* FORM SUBMIT
|
||||
*/
|
||||
$("#form").submit(function() {
|
||||
$('.input-setting').each(function() {
|
||||
if ($(this).data("match")) {
|
||||
var val = $(this).data('selector') + "|" + $(this).data('attrs');
|
||||
$(this).parent().append('<input type="hidden" name="customize_match[' + $(this).data("match") + '][]" value="' + val + '"/>');
|
||||
if($(this).data('attrs') == "background-image"){
|
||||
$("select",$(this).closest(".background-images")).each(function(){
|
||||
// if($(this).val()){
|
||||
val = $(this).data('selector') + "|" + $(this).data('attrs');
|
||||
$(this).closest(".background-images").append('<input type="hidden" name="customize_match[' + $(this).data("match") + '][]" value="' + val + '"/>');
|
||||
//}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
return true;
|
||||
});
|
||||
$("#main-preview iframe").ready(function() {
|
||||
$('.accordion-group input.input-setting').each(function() {
|
||||
var input = this;
|
||||
$(input).attr('readonly', 'readonly');
|
||||
$(input).ColorPicker({
|
||||
onChange: function(hsb, hex, rgb) {
|
||||
$(input).css('backgroundColor', '#' + hex);
|
||||
$(input).val(hex);
|
||||
if ($(input).data('selector')) {
|
||||
$("#main-preview iframe").contents().find($(input).data('selector')).css($(input).data('attrs'), "#" + $(input).val())
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
$('.accordion-group select.input-setting').change(function() {
|
||||
var input = this;
|
||||
if ($(input).data('selector')) {
|
||||
var ex = $(input).data('attrs') == 'font-size' ? 'px' : "";
|
||||
$("#main-preview iframe").contents().find($(input).data('selector')).css($(input).data('attrs'), $(input).val() + ex);
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
$(".show-for-existed").hide();
|
||||
$("#saved-files").change(function() {
|
||||
setPatternActive();
|
||||
if ($(this).val()) {
|
||||
$(".show-for-notexisted").hide();
|
||||
$(".show-for-existed").show();
|
||||
} else {
|
||||
$(".show-for-notexisted").show();
|
||||
$(".show-for-existed").hide();
|
||||
$("#main-preview iframe").contents().find("#customize-theme").remove();
|
||||
return;
|
||||
}
|
||||
var url = customizeFolderURL + $(this).val() + ".json?rand=" + Math.random();
|
||||
|
||||
$.getJSON(url, function(data) {
|
||||
var items = data;
|
||||
if (items) {
|
||||
$('#customize-body .accordion-group').each(function() {
|
||||
var i = 0;
|
||||
$("input, select", this).each(function() {
|
||||
if ($(this).data('match')) {
|
||||
if (items[$(this).data('match')] && items[$(this).data('match')][i]) {
|
||||
var el = items[$(this).data('match')][i];
|
||||
$(this).val(el.val);
|
||||
if (el.val == '') {
|
||||
$(this).css('background', "inherit");
|
||||
}
|
||||
else {
|
||||
if(el.attr == "background-image"){
|
||||
$(this).parent().find("div.pull-left").each(function(){
|
||||
if($(this).data("val") == el.val)
|
||||
$(this).addClass('active');
|
||||
});
|
||||
}else if(el.attr == "background-color"){
|
||||
$(this).css('background', "#" + el.val); // SET BACKGROUND FOR INPUT
|
||||
}else if(el.attr == "color"){
|
||||
$(this).css('background', "#" + el.val); // SET BACKGROUND FOR INPUT
|
||||
}else {
|
||||
$(this).closest("ul").show();
|
||||
}
|
||||
}
|
||||
if(el.attr == "background-color")
|
||||
$(this).ColorPickerSetColor(el.val); // SET BACKGROUND FOR INPUT
|
||||
if(el.attr == "color")
|
||||
$(this).ColorPickerSetColor(el.val); // SET BACKGROUND FOR INPUT
|
||||
}
|
||||
i++;
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$("#main-preview iframe").contents().find("#customize-theme").remove();
|
||||
if ($(this).val()) {
|
||||
var _link = $('<link rel="stylesheet" href="" id="customize-theme">');
|
||||
_link.attr('href', customizeFolderURL + $(this).val() + ".css?rand=" + Math.random());
|
||||
$("#main-preview iframe").contents().find("head").append(_link);
|
||||
}
|
||||
});
|
||||
|
||||
$("#main-preview iframe").load(function() {
|
||||
if ($("#main-preview iframe").contents().find(".paneltool.editortool").length) {
|
||||
$("#main-preview iframe").contents().find(".paneltool.editortool").hide();
|
||||
}
|
||||
});
|
||||
$("#upload_pattern").click(function(e){
|
||||
e.preventDefault();
|
||||
$.fancybox.open([
|
||||
{
|
||||
type: 'iframe',
|
||||
href : $(this).attr("href"),
|
||||
afterLoad:function(){
|
||||
hideSomeElement();
|
||||
},
|
||||
afterClose: function (event, ui) {
|
||||
refressImage();
|
||||
}
|
||||
}
|
||||
], {
|
||||
padding: 10
|
||||
});
|
||||
|
||||
});
|
||||
var hideSomeElement = function(){
|
||||
$('body',$('.fancybox-iframe').contents()).find("#header").hide();
|
||||
$('body',$('.fancybox-iframe').contents()).find("#footer").hide();
|
||||
$('body',$('.fancybox-iframe').contents()).find(".page-head, #nav-sidebar ").hide();
|
||||
//$('body',$('.fancybox-iframe').contents()).find("#content.bootstrap").css( 'padding',0).css('margin',0);
|
||||
};
|
||||
});
|
||||
|
||||
var refressImage = function(){
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: $("#upload_pattern").attr("href")+ '&ajax=1&action=reloadBackground&sortBy=name',
|
||||
data: '',
|
||||
dataType: 'json',
|
||||
cache: false, // @todo see a way to use cache and to add a timestamps parameter to refresh cache each 10 minutes for example
|
||||
success: function(data)
|
||||
{
|
||||
$('.bi-wrapper').html(data);
|
||||
setBackGroundAction();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var setBackGroundAction = function(){
|
||||
/**
|
||||
* BACKGROUND-IMAGE SELECTION
|
||||
*/
|
||||
$(".background-images").each(function() {
|
||||
var $parent = this;
|
||||
var $input = $(".input-setting", $parent);
|
||||
$(".bi-wrapper > div", this).click(function() {
|
||||
$(".bg-config",$parent).show();
|
||||
$input.val($(this).data('val'));
|
||||
$('.bi-wrapper > div', $parent).removeClass('active');
|
||||
$(this).addClass('active');
|
||||
|
||||
if ($input.data('selector')) {
|
||||
$($input.data('selector'), $("#main-preview iframe").contents()).css($input.data('attrs'), 'url(' + $(this).data('image') + ')');
|
||||
}
|
||||
|
||||
});
|
||||
$(".bg-config select", this).change(function(){
|
||||
if ($input.data('selector')) {
|
||||
$($input.data('selector'), $("#main-preview iframe").contents()).css($(this).data('attrs'), $(this).val());
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
var setPatternActive = function()
|
||||
{
|
||||
if( $("#saved-files").val() == $("#saved-files").attr('active') && $("#saved-files").val() != '')
|
||||
{
|
||||
$("input[name=active][value=" + 1 + "]").prop('checked', true);
|
||||
}else if ($('#saved-files option').size() == 1){
|
||||
$("input[name=active][value=" + 1 + "]").prop('checked', true);
|
||||
}else{
|
||||
$("input[name=active][value=" + 0 + "]").prop('checked', true);
|
||||
}
|
||||
}
|
||||
35
modules/appagebuilder/views/js/colorpicker/index.php
Normal file
35
modules/appagebuilder/views/js/colorpicker/index.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2014 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2019 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
484
modules/appagebuilder/views/js/colorpicker/js/colorpicker.js
Normal file
484
modules/appagebuilder/views/js/colorpicker/js/colorpicker.js
Normal file
@@ -0,0 +1,484 @@
|
||||
/**
|
||||
*
|
||||
* Color picker
|
||||
* Author: Stefan Petre www.eyecon.ro
|
||||
*
|
||||
* Dual licensed under the MIT and GPL licenses
|
||||
*
|
||||
*/
|
||||
(function ($) {
|
||||
var ColorPicker = function () {
|
||||
var
|
||||
ids = {},
|
||||
inAction,
|
||||
charMin = 65,
|
||||
visible,
|
||||
tpl = '<div class="colorpicker"><div class="colorpicker_color"><div><div></div></div></div><div class="colorpicker_hue"><div></div></div><div class="colorpicker_new_color"></div><div class="colorpicker_current_color"></div><div class="colorpicker_hex"><input type="text" maxlength="6" size="6" /></div><div class="colorpicker_rgb_r colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_rgb_g colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_rgb_b colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_h colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_s colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_b colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_submit"></div></div>',
|
||||
defaults = {
|
||||
eventName: 'click',
|
||||
onShow: function () {},
|
||||
onBeforeShow: function(){},
|
||||
onHide: function () {},
|
||||
onChange: function () {},
|
||||
onSubmit: function () {},
|
||||
color: 'ff0000',
|
||||
livePreview: true,
|
||||
flat: false
|
||||
},
|
||||
fillRGBFields = function (hsb, cal) {
|
||||
var rgb = HSBToRGB(hsb);
|
||||
$(cal).data('colorpicker').fields
|
||||
.eq(1).val(rgb.r).end()
|
||||
.eq(2).val(rgb.g).end()
|
||||
.eq(3).val(rgb.b).end();
|
||||
},
|
||||
fillHSBFields = function (hsb, cal) {
|
||||
$(cal).data('colorpicker').fields
|
||||
.eq(4).val(hsb.h).end()
|
||||
.eq(5).val(hsb.s).end()
|
||||
.eq(6).val(hsb.b).end();
|
||||
},
|
||||
fillHexFields = function (hsb, cal) {
|
||||
$(cal).data('colorpicker').fields
|
||||
.eq(0).val(HSBToHex(hsb)).end();
|
||||
},
|
||||
setSelector = function (hsb, cal) {
|
||||
$(cal).data('colorpicker').selector.css('backgroundColor', '#' + HSBToHex({h: hsb.h, s: 100, b: 100}));
|
||||
$(cal).data('colorpicker').selectorIndic.css({
|
||||
left: parseInt(150 * hsb.s/100, 10),
|
||||
top: parseInt(150 * (100-hsb.b)/100, 10)
|
||||
});
|
||||
},
|
||||
setHue = function (hsb, cal) {
|
||||
$(cal).data('colorpicker').hue.css('top', parseInt(150 - 150 * hsb.h/360, 10));
|
||||
},
|
||||
setCurrentColor = function (hsb, cal) {
|
||||
$(cal).data('colorpicker').currentColor.css('backgroundColor', '#' + HSBToHex(hsb));
|
||||
},
|
||||
setNewColor = function (hsb, cal) {
|
||||
$(cal).data('colorpicker').newColor.css('backgroundColor', '#' + HSBToHex(hsb));
|
||||
},
|
||||
keyDown = function (ev) {
|
||||
var pressedKey = ev.charCode || ev.keyCode || -1;
|
||||
if ((pressedKey > charMin && pressedKey <= 90) || pressedKey == 32) {
|
||||
return false;
|
||||
}
|
||||
var cal = $(this).parent().parent();
|
||||
if (cal.data('colorpicker').livePreview === true) {
|
||||
change.apply(this);
|
||||
}
|
||||
},
|
||||
change = function (ev) {
|
||||
var cal = $(this).parent().parent(), col;
|
||||
if (this.parentNode.className.indexOf('_hex') > 0) {
|
||||
cal.data('colorpicker').color = col = HexToHSB(fixHex(this.value));
|
||||
} else if (this.parentNode.className.indexOf('_hsb') > 0) {
|
||||
cal.data('colorpicker').color = col = fixHSB({
|
||||
h: parseInt(cal.data('colorpicker').fields.eq(4).val(), 10),
|
||||
s: parseInt(cal.data('colorpicker').fields.eq(5).val(), 10),
|
||||
b: parseInt(cal.data('colorpicker').fields.eq(6).val(), 10)
|
||||
});
|
||||
} else {
|
||||
cal.data('colorpicker').color = col = RGBToHSB(fixRGB({
|
||||
r: parseInt(cal.data('colorpicker').fields.eq(1).val(), 10),
|
||||
g: parseInt(cal.data('colorpicker').fields.eq(2).val(), 10),
|
||||
b: parseInt(cal.data('colorpicker').fields.eq(3).val(), 10)
|
||||
}));
|
||||
}
|
||||
if (ev) {
|
||||
fillRGBFields(col, cal.get(0));
|
||||
fillHexFields(col, cal.get(0));
|
||||
fillHSBFields(col, cal.get(0));
|
||||
}
|
||||
setSelector(col, cal.get(0));
|
||||
setHue(col, cal.get(0));
|
||||
setNewColor(col, cal.get(0));
|
||||
cal.data('colorpicker').onChange.apply(cal, [col, HSBToHex(col), HSBToRGB(col)]);
|
||||
},
|
||||
blur = function (ev) {
|
||||
var cal = $(this).parent().parent();
|
||||
cal.data('colorpicker').fields.parent().removeClass('colorpicker_focus');
|
||||
},
|
||||
focus = function () {
|
||||
charMin = this.parentNode.className.indexOf('_hex') > 0 ? 70 : 65;
|
||||
$(this).parent().parent().data('colorpicker').fields.parent().removeClass('colorpicker_focus');
|
||||
$(this).parent().addClass('colorpicker_focus');
|
||||
},
|
||||
downIncrement = function (ev) {
|
||||
var field = $(this).parent().find('input').focus();
|
||||
var current = {
|
||||
el: $(this).parent().addClass('colorpicker_slider'),
|
||||
max: this.parentNode.className.indexOf('_hsb_h') > 0 ? 360 : (this.parentNode.className.indexOf('_hsb') > 0 ? 100 : 255),
|
||||
y: ev.pageY,
|
||||
field: field,
|
||||
val: parseInt(field.val(), 10),
|
||||
preview: $(this).parent().parent().data('colorpicker').livePreview
|
||||
};
|
||||
$(document).bind('mouseup', current, upIncrement);
|
||||
$(document).bind('mousemove', current, moveIncrement);
|
||||
},
|
||||
moveIncrement = function (ev) {
|
||||
ev.data.field.val(Math.max(0, Math.min(ev.data.max, parseInt(ev.data.val + ev.pageY - ev.data.y, 10))));
|
||||
if (ev.data.preview) {
|
||||
change.apply(ev.data.field.get(0), [true]);
|
||||
}
|
||||
return false;
|
||||
},
|
||||
upIncrement = function (ev) {
|
||||
change.apply(ev.data.field.get(0), [true]);
|
||||
ev.data.el.removeClass('colorpicker_slider').find('input').focus();
|
||||
$(document).unbind('mouseup', upIncrement);
|
||||
$(document).unbind('mousemove', moveIncrement);
|
||||
return false;
|
||||
},
|
||||
downHue = function (ev) {
|
||||
var current = {
|
||||
cal: $(this).parent(),
|
||||
y: $(this).offset().top
|
||||
};
|
||||
current.preview = current.cal.data('colorpicker').livePreview;
|
||||
$(document).bind('mouseup', current, upHue);
|
||||
$(document).bind('mousemove', current, moveHue);
|
||||
},
|
||||
moveHue = function (ev) {
|
||||
change.apply(
|
||||
ev.data.cal.data('colorpicker')
|
||||
.fields
|
||||
.eq(4)
|
||||
.val(parseInt(360*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.y))))/150, 10))
|
||||
.get(0),
|
||||
[ev.data.preview]
|
||||
);
|
||||
return false;
|
||||
},
|
||||
upHue = function (ev) {
|
||||
fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
|
||||
fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
|
||||
$(document).unbind('mouseup', upHue);
|
||||
$(document).unbind('mousemove', moveHue);
|
||||
return false;
|
||||
},
|
||||
downSelector = function (ev) {
|
||||
var current = {
|
||||
cal: $(this).parent(),
|
||||
pos: $(this).offset()
|
||||
};
|
||||
current.preview = current.cal.data('colorpicker').livePreview;
|
||||
$(document).bind('mouseup', current, upSelector);
|
||||
$(document).bind('mousemove', current, moveSelector);
|
||||
},
|
||||
moveSelector = function (ev) {
|
||||
change.apply(
|
||||
ev.data.cal.data('colorpicker')
|
||||
.fields
|
||||
.eq(6)
|
||||
.val(parseInt(100*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.pos.top))))/150, 10))
|
||||
.end()
|
||||
.eq(5)
|
||||
.val(parseInt(100*(Math.max(0,Math.min(150,(ev.pageX - ev.data.pos.left))))/150, 10))
|
||||
.get(0),
|
||||
[ev.data.preview]
|
||||
);
|
||||
return false;
|
||||
},
|
||||
upSelector = function (ev) {
|
||||
fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
|
||||
fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
|
||||
$(document).unbind('mouseup', upSelector);
|
||||
$(document).unbind('mousemove', moveSelector);
|
||||
return false;
|
||||
},
|
||||
enterSubmit = function (ev) {
|
||||
$(this).addClass('colorpicker_focus');
|
||||
},
|
||||
leaveSubmit = function (ev) {
|
||||
$(this).removeClass('colorpicker_focus');
|
||||
},
|
||||
clickSubmit = function (ev) {
|
||||
var cal = $(this).parent();
|
||||
var col = cal.data('colorpicker').color;
|
||||
cal.data('colorpicker').origColor = col;
|
||||
setCurrentColor(col, cal.get(0));
|
||||
cal.data('colorpicker').onSubmit(col, HSBToHex(col), HSBToRGB(col), cal.data('colorpicker').el);
|
||||
},
|
||||
show = function (ev) {
|
||||
var cal = $('#' + $(this).data('colorpickerId'));
|
||||
cal.data('colorpicker').onBeforeShow.apply(this, [cal.get(0)]);
|
||||
var pos = $(this).offset();
|
||||
var viewPort = getViewport();
|
||||
var top = pos.top + this.offsetHeight;
|
||||
var left = pos.left;
|
||||
if (top + 176 > viewPort.t + viewPort.h) {
|
||||
top -= this.offsetHeight + 176;
|
||||
}
|
||||
if (left + 356 > viewPort.l + viewPort.w) {
|
||||
left -= 356;
|
||||
}
|
||||
cal.css({left: left + 'px', top: top + 'px'});
|
||||
if (cal.data('colorpicker').onShow.apply(this, [cal.get(0)]) != false) {
|
||||
cal.show();
|
||||
}
|
||||
$(document).bind('mousedown', {cal: cal}, hide);
|
||||
return false;
|
||||
},
|
||||
hide = function (ev) {
|
||||
if (!isChildOf(ev.data.cal.get(0), ev.target, ev.data.cal.get(0))) {
|
||||
if (ev.data.cal.data('colorpicker').onHide.apply(this, [ev.data.cal.get(0)]) != false) {
|
||||
ev.data.cal.hide();
|
||||
}
|
||||
$(document).unbind('mousedown', hide);
|
||||
}
|
||||
},
|
||||
isChildOf = function(parentEl, el, container) {
|
||||
if (parentEl == el) {
|
||||
return true;
|
||||
}
|
||||
if (parentEl.contains) {
|
||||
return parentEl.contains(el);
|
||||
}
|
||||
if ( parentEl.compareDocumentPosition ) {
|
||||
return !!(parentEl.compareDocumentPosition(el) & 16);
|
||||
}
|
||||
var prEl = el.parentNode;
|
||||
while(prEl && prEl != container) {
|
||||
if (prEl == parentEl)
|
||||
return true;
|
||||
prEl = prEl.parentNode;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
getViewport = function () {
|
||||
var m = document.compatMode == 'CSS1Compat';
|
||||
return {
|
||||
l : window.pageXOffset || (m ? document.documentElement.scrollLeft : document.body.scrollLeft),
|
||||
t : window.pageYOffset || (m ? document.documentElement.scrollTop : document.body.scrollTop),
|
||||
w : window.innerWidth || (m ? document.documentElement.clientWidth : document.body.clientWidth),
|
||||
h : window.innerHeight || (m ? document.documentElement.clientHeight : document.body.clientHeight)
|
||||
};
|
||||
},
|
||||
fixHSB = function (hsb) {
|
||||
return {
|
||||
h: Math.min(360, Math.max(0, hsb.h)),
|
||||
s: Math.min(100, Math.max(0, hsb.s)),
|
||||
b: Math.min(100, Math.max(0, hsb.b))
|
||||
};
|
||||
},
|
||||
fixRGB = function (rgb) {
|
||||
return {
|
||||
r: Math.min(255, Math.max(0, rgb.r)),
|
||||
g: Math.min(255, Math.max(0, rgb.g)),
|
||||
b: Math.min(255, Math.max(0, rgb.b))
|
||||
};
|
||||
},
|
||||
fixHex = function (hex) {
|
||||
var len = 6 - hex.length;
|
||||
if (len > 0) {
|
||||
var o = [];
|
||||
for (var i=0; i<len; i++) {
|
||||
o.push('0');
|
||||
}
|
||||
o.push(hex);
|
||||
hex = o.join('');
|
||||
}
|
||||
return hex;
|
||||
},
|
||||
HexToRGB = function (hex) {
|
||||
var hex = parseInt(((hex.indexOf('#') > -1) ? hex.substring(1) : hex), 16);
|
||||
return {r: hex >> 16, g: (hex & 0x00FF00) >> 8, b: (hex & 0x0000FF)};
|
||||
},
|
||||
HexToHSB = function (hex) {
|
||||
return RGBToHSB(HexToRGB(hex));
|
||||
},
|
||||
RGBToHSB = function (rgb) {
|
||||
var hsb = {
|
||||
h: 0,
|
||||
s: 0,
|
||||
b: 0
|
||||
};
|
||||
var min = Math.min(rgb.r, rgb.g, rgb.b);
|
||||
var max = Math.max(rgb.r, rgb.g, rgb.b);
|
||||
var delta = max - min;
|
||||
hsb.b = max;
|
||||
if (max != 0) {
|
||||
|
||||
}
|
||||
hsb.s = max != 0 ? 255 * delta / max : 0;
|
||||
if (hsb.s != 0) {
|
||||
if (rgb.r == max) {
|
||||
hsb.h = (rgb.g - rgb.b) / delta;
|
||||
} else if (rgb.g == max) {
|
||||
hsb.h = 2 + (rgb.b - rgb.r) / delta;
|
||||
} else {
|
||||
hsb.h = 4 + (rgb.r - rgb.g) / delta;
|
||||
}
|
||||
} else {
|
||||
hsb.h = -1;
|
||||
}
|
||||
hsb.h *= 60;
|
||||
if (hsb.h < 0) {
|
||||
hsb.h += 360;
|
||||
}
|
||||
hsb.s *= 100/255;
|
||||
hsb.b *= 100/255;
|
||||
return hsb;
|
||||
},
|
||||
HSBToRGB = function (hsb) {
|
||||
var rgb = {};
|
||||
var h = Math.round(hsb.h);
|
||||
var s = Math.round(hsb.s*255/100);
|
||||
var v = Math.round(hsb.b*255/100);
|
||||
if(s == 0) {
|
||||
rgb.r = rgb.g = rgb.b = v;
|
||||
} else {
|
||||
var t1 = v;
|
||||
var t2 = (255-s)*v/255;
|
||||
var t3 = (t1-t2)*(h%60)/60;
|
||||
if(h==360) h = 0;
|
||||
if(h<60) {rgb.r=t1; rgb.b=t2; rgb.g=t2+t3}
|
||||
else if(h<120) {rgb.g=t1; rgb.b=t2; rgb.r=t1-t3}
|
||||
else if(h<180) {rgb.g=t1; rgb.r=t2; rgb.b=t2+t3}
|
||||
else if(h<240) {rgb.b=t1; rgb.r=t2; rgb.g=t1-t3}
|
||||
else if(h<300) {rgb.b=t1; rgb.g=t2; rgb.r=t2+t3}
|
||||
else if(h<360) {rgb.r=t1; rgb.g=t2; rgb.b=t1-t3}
|
||||
else {rgb.r=0; rgb.g=0; rgb.b=0}
|
||||
}
|
||||
return {r:Math.round(rgb.r), g:Math.round(rgb.g), b:Math.round(rgb.b)};
|
||||
},
|
||||
RGBToHex = function (rgb) {
|
||||
var hex = [
|
||||
rgb.r.toString(16),
|
||||
rgb.g.toString(16),
|
||||
rgb.b.toString(16)
|
||||
];
|
||||
$.each(hex, function (nr, val) {
|
||||
if (val.length == 1) {
|
||||
hex[nr] = '0' + val;
|
||||
}
|
||||
});
|
||||
return hex.join('');
|
||||
},
|
||||
HSBToHex = function (hsb) {
|
||||
return RGBToHex(HSBToRGB(hsb));
|
||||
},
|
||||
restoreOriginal = function () {
|
||||
var cal = $(this).parent();
|
||||
var col = cal.data('colorpicker').origColor;
|
||||
cal.data('colorpicker').color = col;
|
||||
fillRGBFields(col, cal.get(0));
|
||||
fillHexFields(col, cal.get(0));
|
||||
fillHSBFields(col, cal.get(0));
|
||||
setSelector(col, cal.get(0));
|
||||
setHue(col, cal.get(0));
|
||||
setNewColor(col, cal.get(0));
|
||||
};
|
||||
return {
|
||||
init: function (opt) {
|
||||
opt = $.extend({}, defaults, opt||{});
|
||||
if (typeof opt.color == 'string') {
|
||||
opt.color = HexToHSB(opt.color);
|
||||
} else if (opt.color.r != undefined && opt.color.g != undefined && opt.color.b != undefined) {
|
||||
opt.color = RGBToHSB(opt.color);
|
||||
} else if (opt.color.h != undefined && opt.color.s != undefined && opt.color.b != undefined) {
|
||||
opt.color = fixHSB(opt.color);
|
||||
} else {
|
||||
return this;
|
||||
}
|
||||
return this.each(function () {
|
||||
if (!$(this).data('colorpickerId')) {
|
||||
var options = $.extend({}, opt);
|
||||
options.origColor = opt.color;
|
||||
var id = 'collorpicker_' + parseInt(Math.random() * 1000);
|
||||
$(this).data('colorpickerId', id);
|
||||
var cal = $(tpl).attr('id', id);
|
||||
if (options.flat) {
|
||||
cal.appendTo(this).show();
|
||||
} else {
|
||||
cal.appendTo(document.body);
|
||||
}
|
||||
options.fields = cal
|
||||
.find('input')
|
||||
.bind('keyup', keyDown)
|
||||
.bind('change', change)
|
||||
.bind('blur', blur)
|
||||
.bind('focus', focus);
|
||||
cal
|
||||
.find('span').bind('mousedown', downIncrement).end()
|
||||
.find('>div.colorpicker_current_color').bind('click', restoreOriginal);
|
||||
options.selector = cal.find('div.colorpicker_color').bind('mousedown', downSelector);
|
||||
options.selectorIndic = options.selector.find('div div');
|
||||
options.el = this;
|
||||
options.hue = cal.find('div.colorpicker_hue div');
|
||||
cal.find('div.colorpicker_hue').bind('mousedown', downHue);
|
||||
options.newColor = cal.find('div.colorpicker_new_color');
|
||||
options.currentColor = cal.find('div.colorpicker_current_color');
|
||||
cal.data('colorpicker', options);
|
||||
cal.find('div.colorpicker_submit')
|
||||
.bind('mouseenter', enterSubmit)
|
||||
.bind('mouseleave', leaveSubmit)
|
||||
.bind('click', clickSubmit);
|
||||
fillRGBFields(options.color, cal.get(0));
|
||||
fillHSBFields(options.color, cal.get(0));
|
||||
fillHexFields(options.color, cal.get(0));
|
||||
setHue(options.color, cal.get(0));
|
||||
setSelector(options.color, cal.get(0));
|
||||
setCurrentColor(options.color, cal.get(0));
|
||||
setNewColor(options.color, cal.get(0));
|
||||
if (options.flat) {
|
||||
cal.css({
|
||||
position: 'relative',
|
||||
display: 'block'
|
||||
});
|
||||
} else {
|
||||
$(this).bind(options.eventName, show);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
showPicker: function() {
|
||||
return this.each( function () {
|
||||
if ($(this).data('colorpickerId')) {
|
||||
show.apply(this);
|
||||
}
|
||||
});
|
||||
},
|
||||
hidePicker: function() {
|
||||
return this.each( function () {
|
||||
if ($(this).data('colorpickerId')) {
|
||||
$('#' + $(this).data('colorpickerId')).hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
setColor: function(col) {
|
||||
if (typeof col == 'string') {
|
||||
col = HexToHSB(col);
|
||||
} else if (col.r != undefined && col.g != undefined && col.b != undefined) {
|
||||
col = RGBToHSB(col);
|
||||
} else if (col.h != undefined && col.s != undefined && col.b != undefined) {
|
||||
col = fixHSB(col);
|
||||
} else {
|
||||
return this;
|
||||
}
|
||||
return this.each(function(){
|
||||
if ($(this).data('colorpickerId')) {
|
||||
var cal = $('#' + $(this).data('colorpickerId'));
|
||||
cal.data('colorpicker').color = col;
|
||||
cal.data('colorpicker').origColor = col;
|
||||
fillRGBFields(col, cal.get(0));
|
||||
fillHSBFields(col, cal.get(0));
|
||||
fillHexFields(col, cal.get(0));
|
||||
setHue(col, cal.get(0));
|
||||
setSelector(col, cal.get(0));
|
||||
setCurrentColor(col, cal.get(0));
|
||||
setNewColor(col, cal.get(0));
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
}();
|
||||
$.fn.extend({
|
||||
ColorPicker: ColorPicker.init,
|
||||
ColorPickerHide: ColorPicker.hidePicker,
|
||||
ColorPickerShow: ColorPicker.showPicker,
|
||||
ColorPickerSetColor: ColorPicker.setColor
|
||||
});
|
||||
})(jQuery);
|
||||
33
modules/appagebuilder/views/js/colorpicker/js/eye.js
Normal file
33
modules/appagebuilder/views/js/colorpicker/js/eye.js
Normal file
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* @copyright Commercial License By LeoTheme.Com
|
||||
* @email leotheme.com
|
||||
* @visit http://www.leotheme.com
|
||||
*/
|
||||
(function($){
|
||||
var EYE = window.EYE = function() {
|
||||
var _registered = {
|
||||
init: []
|
||||
};
|
||||
return {
|
||||
init: function() {
|
||||
$.each(_registered.init, function(nr, fn){
|
||||
fn.call();
|
||||
});
|
||||
},
|
||||
extend: function(prop) {
|
||||
for (var i in prop) {
|
||||
if (prop[i] != undefined) {
|
||||
this[i] = prop[i];
|
||||
}
|
||||
}
|
||||
},
|
||||
register: function(fn, type) {
|
||||
if (!_registered[type]) {
|
||||
_registered[type] = [];
|
||||
}
|
||||
_registered[type].push(fn);
|
||||
}
|
||||
};
|
||||
}();
|
||||
$(EYE.init);
|
||||
})(jQuery);
|
||||
35
modules/appagebuilder/views/js/colorpicker/js/index.php
Normal file
35
modules/appagebuilder/views/js/colorpicker/js/index.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2014 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2019 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
72
modules/appagebuilder/views/js/colorpicker/js/layout.js
Normal file
72
modules/appagebuilder/views/js/colorpicker/js/layout.js
Normal file
@@ -0,0 +1,72 @@
|
||||
/**
|
||||
* @copyright Commercial License By LeoTheme.Com
|
||||
* @email leotheme.com
|
||||
* @visit http://www.leotheme.com
|
||||
*/
|
||||
(function($){
|
||||
var initLayout = function() {
|
||||
var hash = window.location.hash.replace('#', '');
|
||||
var currentTab = $('ul.navigationTabs a')
|
||||
.bind('click', showTab)
|
||||
.filter('a[rel=' + hash + ']');
|
||||
if (currentTab.size() == 0) {
|
||||
currentTab = $('ul.navigationTabs a:first');
|
||||
}
|
||||
showTab.apply(currentTab.get(0));
|
||||
$('#colorpickerHolder').ColorPicker({flat: true});
|
||||
$('#colorpickerHolder2').ColorPicker({
|
||||
flat: true,
|
||||
color: '#00ff00',
|
||||
onSubmit: function(hsb, hex, rgb) {
|
||||
$('#colorSelector2 div').css('backgroundColor', '#' + hex);
|
||||
}
|
||||
});
|
||||
$('#colorpickerHolder2>div').css('position', 'absolute');
|
||||
var widt = false;
|
||||
$('#colorSelector2').bind('click', function() {
|
||||
$('#colorpickerHolder2').stop().animate({height: widt ? 0 : 173}, 500);
|
||||
widt = !widt;
|
||||
});
|
||||
$('#colorpickerField1, #colorpickerField2, #colorpickerField3').ColorPicker({
|
||||
onSubmit: function(hsb, hex, rgb, el) {
|
||||
$(el).val(hex);
|
||||
$(el).ColorPickerHide();
|
||||
},
|
||||
onBeforeShow: function () {
|
||||
$(this).ColorPickerSetColor(this.value);
|
||||
}
|
||||
})
|
||||
.bind('keyup', function(){
|
||||
$(this).ColorPickerSetColor(this.value);
|
||||
});
|
||||
$('#colorSelector').ColorPicker({
|
||||
color: '#0000ff',
|
||||
onShow: function (colpkr) {
|
||||
$(colpkr).fadeIn(500);
|
||||
return false;
|
||||
},
|
||||
onHide: function (colpkr) {
|
||||
$(colpkr).fadeOut(500);
|
||||
return false;
|
||||
},
|
||||
onChange: function (hsb, hex, rgb) {
|
||||
$('#colorSelector div').css('backgroundColor', '#' + hex);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var showTab = function(e) {
|
||||
var tabIndex = $('ul.navigationTabs a')
|
||||
.removeClass('active')
|
||||
.index(this);
|
||||
$(this)
|
||||
.addClass('active')
|
||||
.blur();
|
||||
$('div.tab')
|
||||
.hide()
|
||||
.eq(tabIndex)
|
||||
.show();
|
||||
};
|
||||
|
||||
EYE.register(initLayout, 'init');
|
||||
})(jQuery)
|
||||
@@ -0,0 +1,569 @@
|
||||
/*
|
||||
* @Website: apollotheme.com - prestashop template provider
|
||||
* @author Apollotheme <apollotheme@gmail.com>
|
||||
* @copyright Apollotheme
|
||||
* @description:
|
||||
*/
|
||||
/*
|
||||
mColorPicker
|
||||
Version: 1.0 r34
|
||||
|
||||
Copyright (c) 2010 Meta100 LLC.
|
||||
http://www.meta100.com/
|
||||
|
||||
Licensed under the MIT license
|
||||
http://www.opensource.org/licenses/mit-license.php
|
||||
*/
|
||||
|
||||
// After this script loads set:
|
||||
// $.fn.mColorPicker.init.replace = '.myclass'
|
||||
// to have this script apply to input.myclass,
|
||||
// instead of the default input[type=color]
|
||||
// To turn of automatic operation and run manually set:
|
||||
// $.fn.mColorPicker.init.replace = false
|
||||
// To use manually call like any other jQuery plugin
|
||||
// $('input.foo').mColorPicker({options})
|
||||
// options:
|
||||
// imageFolder - Change to move image location.
|
||||
// swatches - Initial colors in the swatch, must an array of 10 colors.
|
||||
// init:
|
||||
// $.fn.mColorPicker.init.enhancedSwatches - Turn of saving and loading of swatch to cookies.
|
||||
// $.fn.mColorPicker.init.allowTransparency - Turn off transperancy as a color option.
|
||||
// $.fn.mColorPicker.init.showLogo - Turn on/off the meta100 logo (You don't really want to turn it off, do you?).
|
||||
|
||||
(function($){
|
||||
|
||||
var $o;
|
||||
|
||||
$.fn.mColorPicker = function(options) {
|
||||
|
||||
$o = $.extend($.fn.mColorPicker.defaults, options);
|
||||
|
||||
if ($o.swatches.length < 10) $o.swatches = $.fn.mColorPicker.defaults.swatches
|
||||
if ($("div#mColorPicker").length < 1) $.fn.mColorPicker.drawPicker();
|
||||
|
||||
if ($('#css_disabled_color_picker').length < 1) $('head').prepend('<style id="css_disabled_color_picker" type="text/css">.mColorPicker[disabled] + span, .mColorPicker[disabled="disabled"] + span, .mColorPicker[disabled="true"] + span {filter:alpha(opacity=50);-moz-opacity:0.5;-webkit-opacity:0.5;-khtml-opacity: 0.5;opacity: 0.5;}</style>');
|
||||
|
||||
$(document).on('keyup', '.mColorPicker', function () {
|
||||
|
||||
try {
|
||||
|
||||
$(this).css({
|
||||
'background-color': $(this).val()
|
||||
}).css({
|
||||
'color': $.fn.mColorPicker.textColor($(this).css('background-color'))
|
||||
}).trigger('change');
|
||||
} catch (r) {}
|
||||
});
|
||||
|
||||
$(document).on('click', '.mColorPickerTrigger', function () {
|
||||
|
||||
$.fn.mColorPicker.colorShow($(this).attr('id').replace('icp_', ''));
|
||||
});
|
||||
|
||||
this.each(function () {
|
||||
|
||||
$.fn.mColorPicker.drawPickerTriggers($(this));
|
||||
});
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
$.fn.mColorPicker.currentColor = false;
|
||||
$.fn.mColorPicker.currentValue = false;
|
||||
$.fn.mColorPicker.color = false;
|
||||
|
||||
$.fn.mColorPicker.init = {
|
||||
replace: '[type=color]',
|
||||
index: 0,
|
||||
enhancedSwatches: true,
|
||||
allowTransparency: false,
|
||||
checkRedraw: 'DOMUpdated', // Change to 'ajaxSuccess' for ajax only or false if not needed
|
||||
liveEvents: false,
|
||||
showLogo: false
|
||||
};
|
||||
|
||||
$.fn.mColorPicker.defaults = {
|
||||
imageFolder: baseDir + 'img/admin/',
|
||||
swatches: [
|
||||
"#ffffff",
|
||||
"#ffff00",
|
||||
"#00ff00",
|
||||
"#00ffff",
|
||||
"#0000ff",
|
||||
"#ff00ff",
|
||||
"#ff0000",
|
||||
"#4c2b11",
|
||||
"#3b3b3b",
|
||||
"#000000"
|
||||
]
|
||||
};
|
||||
|
||||
$.fn.mColorPicker.liveEvents = function() {
|
||||
|
||||
$.fn.mColorPicker.init.liveEvents = true;
|
||||
|
||||
if ($.fn.mColorPicker.init.checkRedraw && $.fn.mColorPicker.init.replace) {
|
||||
|
||||
$(document).bind($.fn.mColorPicker.init.checkRedraw + '.mColorPicker', function () {
|
||||
|
||||
$('input[data-mcolorpicker!="true"]').filter(function() {
|
||||
|
||||
return ($.fn.mColorPicker.init.replace == '[type=color]')? this.getAttribute("type") == 'color': $(this).is($.fn.mColorPicker.init.replace);
|
||||
}).mColorPicker();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.mColorPicker.drawPickerTriggers = function ($t) {
|
||||
|
||||
if ($t[0].nodeName.toLowerCase() != 'input') return false;
|
||||
|
||||
var id = $t.attr('id') || 'color_' + $.fn.mColorPicker.init.index++,
|
||||
hidden = false;
|
||||
|
||||
$t.attr('id', id);
|
||||
|
||||
if ($t.attr('text') == 'hidden' || $t.attr('data-text') == 'hidden') hidden = true;
|
||||
|
||||
var color = $t.val(),
|
||||
width = ($t.width() > 0)? $t.width(): parseInt($t.css('width'), 10),
|
||||
height = ($t.height())? $t.height(): parseInt($t.css('height'), 10),
|
||||
flt = $t.css('float'),
|
||||
image = (color == 'transparent')? "url('" + $o.imageFolder + "/grid.gif')": '',
|
||||
colorPicker = '';
|
||||
|
||||
$('body').append('<span id="color_work_area"></span>');
|
||||
$('span#color_work_area').append($t.clone(true));
|
||||
colorPicker = $('span#color_work_area').html().replace(/type="color"/gi, '').replace(/input /gi, (hidden)? 'input type="hidden"': 'input type="text"');
|
||||
$('span#color_work_area').html('').remove();
|
||||
$t.after(
|
||||
(hidden)? '<span style="cursor:pointer;border:1px solid black;float:' + flt + ';width:' + width + 'px;height:' + height + 'px;" id="icp_' + id + '"> </span>': ''
|
||||
).after(colorPicker).remove();
|
||||
|
||||
if (hidden) {
|
||||
|
||||
$('#icp_' + id).css({
|
||||
'background-color': color,
|
||||
'background-image': image,
|
||||
'display': 'inline-block'
|
||||
}).attr(
|
||||
'class', $('#' + id).attr('class')
|
||||
).addClass(
|
||||
'mColorPickerTrigger'
|
||||
);
|
||||
} else {
|
||||
|
||||
$('#' + id).css({
|
||||
'background-color': color,
|
||||
'background-image': image
|
||||
}).css({
|
||||
'color': $.fn.mColorPicker.textColor($('#' + id).css('background-color'))
|
||||
}).after(
|
||||
'<span style="cursor:pointer;" id="icp_' + id + '" class="mColorPickerTrigger input-group-addon"><img src="' + $o.imageFolder + 'color.png" style="border:0;margin:0 0 0 3px" align="absmiddle"></span>'
|
||||
).addClass('mColorPickerInput');
|
||||
}
|
||||
|
||||
$('#icp_' + id).attr('data-mcolorpicker', 'true');
|
||||
|
||||
$('#' + id).addClass('mColorPicker');
|
||||
|
||||
return $('#' + id);
|
||||
};
|
||||
|
||||
$.fn.mColorPicker.drawPicker = function () {
|
||||
|
||||
$(document.createElement("div")).attr(
|
||||
"id","mColorPicker"
|
||||
).css(
|
||||
'display','none'
|
||||
).html(
|
||||
'<div id="mColorPickerWrapper"><div id="mColorPickerImg" class="mColor"></div><div id="mColorPickerImgGray" class="mColor"></div><div id="mColorPickerSwatches"><div class="mClear"></div></div><div id="mColorPickerFooter"><input type="text" size="8" id="mColorPickerInput"/></div></div>'
|
||||
).appendTo("body");
|
||||
|
||||
$(document.createElement("div")).attr("id","mColorPickerBg").css({
|
||||
'display': 'none'
|
||||
}).appendTo("body");
|
||||
|
||||
for (n = 9; n > -1; n--) {
|
||||
|
||||
$(document.createElement("div")).attr({
|
||||
'id': 'cell' + n,
|
||||
'class': "mPastColor" + ((n > 0)? ' mNoLeftBorder': '')
|
||||
}).html(
|
||||
' '
|
||||
).prependTo("#mColorPickerSwatches");
|
||||
}
|
||||
|
||||
$('#mColorPicker').css({
|
||||
'border':'1px solid #ccc',
|
||||
'color':'#fff',
|
||||
'z-index':999998,
|
||||
'width':'194px',
|
||||
'height':'184px',
|
||||
'font-size':'12px',
|
||||
'font-family':'times'
|
||||
});
|
||||
|
||||
$('.mPastColor').css({
|
||||
'height':'18px',
|
||||
'width':'18px',
|
||||
'border':'1px solid #000',
|
||||
'float':'left'
|
||||
});
|
||||
|
||||
$('#colorPreview').css({
|
||||
'height':'50px'
|
||||
});
|
||||
|
||||
$('.mNoLeftBorder').css({
|
||||
'border-left':0
|
||||
});
|
||||
|
||||
$('.mClear').css({
|
||||
'clear':'both'
|
||||
});
|
||||
|
||||
$('#mColorPickerWrapper').css({
|
||||
'position':'relative',
|
||||
'border':'solid 1px gray',
|
||||
'z-index':999999
|
||||
});
|
||||
|
||||
$('#mColorPickerImg').css({
|
||||
'height':'128px',
|
||||
'width':'192px',
|
||||
'border':0,
|
||||
'cursor':'crosshair',
|
||||
'background-image':"url('" + $o.imageFolder + "colorpicker.png')"
|
||||
});
|
||||
|
||||
$('#mColorPickerImgGray').css({
|
||||
'height':'8px',
|
||||
'width':'192px',
|
||||
'border':0,
|
||||
'cursor':'crosshair',
|
||||
'background-image':"url('" + $o.imageFolder + "graybar.jpg')"
|
||||
});
|
||||
|
||||
$('#mColorPickerInput').css({
|
||||
'border':'solid 1px gray',
|
||||
'font-size':'10pt',
|
||||
'margin':'3px',
|
||||
'width':'80px'
|
||||
});
|
||||
|
||||
$('#mColorPickerImgGrid').css({
|
||||
'border':0,
|
||||
'height':'20px',
|
||||
'width':'20px',
|
||||
'vertical-align':'text-bottom'
|
||||
});
|
||||
|
||||
$('#mColorPickerSwatches').css({
|
||||
'border-right':'1px solid #000'
|
||||
});
|
||||
|
||||
$('#mColorPickerFooter').css({
|
||||
'background-image':"url('" + $o.imageFolder + "grid.gif')",
|
||||
'position': 'relative',
|
||||
'height':'26px'
|
||||
});
|
||||
|
||||
if ($.fn.mColorPicker.init.allowTransparency) $('#mColorPickerFooter').prepend('<span id="mColorPickerTransparent" class="mColor" style="font-size:16px;color:#000;padding-right:30px;padding-top:3px;cursor:pointer;overflow:hidden;float:right;">transparent</span>');
|
||||
if ($.fn.mColorPicker.init.showLogo) $('#mColorPickerFooter').prepend('<a href="http://meta100.com/" title="Meta100 - Designing Fun" alt="Meta100 - Designing Fun" style="float:right;" target="_blank"><img src="' + $o.imageFolder + 'meta100.png" title="Meta100 - Designing Fun" alt="Meta100 - Designing Fun" style="border:0;border-left:1px solid #aaa;right:0;position:absolute;"/></a>');
|
||||
|
||||
$("#mColorPickerBg").click($.fn.mColorPicker.closePicker);
|
||||
|
||||
var swatch = $.fn.mColorPicker.getCookie('swatches'),
|
||||
i = 0;
|
||||
|
||||
if (typeof swatch == 'string') swatch = swatch.split('||');
|
||||
if (swatch == null || $.fn.mColorPicker.init.enhancedSwatches || swatch.length < 10) swatch = $o.swatches;
|
||||
|
||||
$(".mPastColor").each(function() {
|
||||
|
||||
$(this).css('background-color', swatch[i++].toLowerCase());
|
||||
});
|
||||
};
|
||||
|
||||
$.fn.mColorPicker.closePicker = function () {
|
||||
|
||||
$(".mColor, .mPastColor, #mColorPickerInput, #mColorPickerWrapper").unbind();
|
||||
$("#mColorPickerBg").hide();
|
||||
$("#mColorPicker").fadeOut()
|
||||
};
|
||||
|
||||
$.fn.mColorPicker.colorShow = function (id) {
|
||||
|
||||
var $e = $("#icp_" + id);
|
||||
pos = $e.offset(),
|
||||
$i = $("#" + id);
|
||||
hex = $i.attr('data-hex') || $i.attr('hex'),
|
||||
pickerTop = pos.top + $e.outerHeight(),
|
||||
pickerLeft = pos.left,
|
||||
$d = $(document),
|
||||
$m = $("#mColorPicker");
|
||||
|
||||
if ($i.attr('disabled')) return false;
|
||||
|
||||
// KEEP COLOR PICKER IN VIEWPORT
|
||||
if (pickerTop + $m.height() > $d.height()) pickerTop = pos.top - $m.height();
|
||||
if (pickerLeft + $m.width() > $d.width()) pickerLeft = pos.left - $m.width() + $e.outerWidth();
|
||||
|
||||
$m.css({
|
||||
'top':(pickerTop) + "px",
|
||||
'left':(pickerLeft) + "px",
|
||||
'position':'absolute'
|
||||
}).fadeIn("fast");
|
||||
|
||||
$("#mColorPickerBg").css({
|
||||
'z-index':999990,
|
||||
'background':'black',
|
||||
'opacity': .01,
|
||||
'position':'absolute',
|
||||
'top':0,
|
||||
'left':0,
|
||||
'width': parseInt($d.width(), 10) + 'px',
|
||||
'height': parseInt($d.height(), 10) + 'px'
|
||||
}).show();
|
||||
|
||||
var def = $i.val();
|
||||
|
||||
$('#colorPreview span').text(def);
|
||||
$('#colorPreview').css('background', def);
|
||||
$('#color').val(def);
|
||||
|
||||
if ($('#' + id).attr('data-text')) $.fn.mColorPicker.currentColor = $e.css('background-color');
|
||||
else $.fn.mColorPicker.currentColor = $i.css('background-color');
|
||||
|
||||
if (hex == 'true') $.fn.mColorPicker.currentColor = $.fn.mColorPicker.RGBtoHex($.fn.mColorPicker.currentColor);
|
||||
|
||||
$("#mColorPickerInput").val($.fn.mColorPicker.currentColor);
|
||||
|
||||
$('.mColor, .mPastColor').bind('mousemove', function(e) {
|
||||
|
||||
var offset = $(this).offset();
|
||||
|
||||
$.fn.mColorPicker.color = $(this).css("background-color");
|
||||
|
||||
if ($(this).hasClass('mPastColor') && hex == 'true') $.fn.mColorPicker.color = $.fn.mColorPicker.RGBtoHex($.fn.mColorPicker.color);
|
||||
else if ($(this).hasClass('mPastColor') && hex != 'true') $.fn.mColorPicker.color = $.fn.mColorPicker.hexToRGB($.fn.mColorPicker.color);
|
||||
else if ($(this).attr('id') == 'mColorPickerTransparent') $.fn.mColorPicker.color = 'transparent';
|
||||
else if (!$(this).hasClass('mPastColor')) $.fn.mColorPicker.color = $.fn.mColorPicker.whichColor(e.pageX - offset.left, e.pageY - offset.top + (($(this).attr('id') == 'mColorPickerImgGray')? 128: 0), hex);
|
||||
|
||||
$.fn.mColorPicker.setInputColor(id, $.fn.mColorPicker.color);
|
||||
}).click(function() {
|
||||
|
||||
$.fn.mColorPicker.colorPicked(id);
|
||||
});
|
||||
|
||||
$('#mColorPickerInput').bind('keyup', function (e) {
|
||||
|
||||
try {
|
||||
|
||||
$.fn.mColorPicker.color = $('#mColorPickerInput').val();
|
||||
$.fn.mColorPicker.setInputColor(id, $.fn.mColorPicker.color);
|
||||
|
||||
if (e.which == 13) $.fn.mColorPicker.colorPicked(id);
|
||||
} catch (r) {}
|
||||
|
||||
}).bind('blur', function () {
|
||||
|
||||
$.fn.mColorPicker.setInputColor(id, $.fn.mColorPicker.currentColor);
|
||||
});
|
||||
|
||||
$('#mColorPickerWrapper').bind('mouseleave', function () {
|
||||
|
||||
$.fn.mColorPicker.setInputColor(id, $.fn.mColorPicker.currentColor);
|
||||
});
|
||||
};
|
||||
|
||||
$.fn.mColorPicker.setInputColor = function (id, color) {
|
||||
|
||||
var image = (color == 'transparent')? "url('" + $o.imageFolder + "grid.gif')": '',
|
||||
textColor = $.fn.mColorPicker.textColor(color);
|
||||
|
||||
if ($('#' + id).attr('data-text') || $('#' + id).attr('text')) $("#icp_" + id).css({'background-color': color, 'background-image': image});
|
||||
$("#" + id).val(color).css({'background-color': color, 'background-image': image, 'color' : textColor}).trigger('change');
|
||||
$("#mColorPickerInput").val(color);
|
||||
};
|
||||
|
||||
$.fn.mColorPicker.textColor = function (val) {
|
||||
|
||||
if (typeof val == 'undefined' || val == 'transparent') return "black";
|
||||
val = $.fn.mColorPicker.RGBtoHex(val);
|
||||
return (parseInt(val.substr(1, 2), 16) + parseInt(val.substr(3, 2), 16) + parseInt(val.substr(5, 2), 16) < 400)? 'white': 'black';
|
||||
};
|
||||
|
||||
$.fn.mColorPicker.setCookie = function (name, value, days) {
|
||||
|
||||
var cookie_string = name + "=" + escape(value),
|
||||
expires = new Date();
|
||||
expires.setDate(expires.getDate() + days);
|
||||
cookie_string += "; expires=" + expires.toGMTString();
|
||||
|
||||
document.cookie = cookie_string;
|
||||
};
|
||||
|
||||
$.fn.mColorPicker.getCookie = function (name) {
|
||||
|
||||
var results = document.cookie.match ( '(^|;) ?' + name + '=([^;]*)(;|$)' );
|
||||
|
||||
if (results) return (unescape(results[2]));
|
||||
else return null;
|
||||
};
|
||||
|
||||
$.fn.mColorPicker.colorPicked = function (id) {
|
||||
|
||||
$.fn.mColorPicker.closePicker();
|
||||
|
||||
if ($.fn.mColorPicker.init.enhancedSwatches) $.fn.mColorPicker.addToSwatch();
|
||||
|
||||
$("#" + id).trigger('colorpicked');
|
||||
};
|
||||
|
||||
$.fn.mColorPicker.addToSwatch = function (color) {
|
||||
|
||||
var swatch = []
|
||||
i = 0;
|
||||
|
||||
if (typeof color == 'string') $.fn.mColorPicker.color = color.toLowerCase();
|
||||
|
||||
$.fn.mColorPicker.currentValue = $.fn.mColorPicker.currentColor = $.fn.mColorPicker.color;
|
||||
|
||||
if ($.fn.mColorPicker.color != 'transparent') swatch[0] = $.fn.mColorPicker.color.toLowerCase();
|
||||
|
||||
$('.mPastColor').each(function() {
|
||||
|
||||
$.fn.mColorPicker.color = $(this).css('background-color').toLowerCase();
|
||||
|
||||
if ($.fn.mColorPicker.color != swatch[0] && $.fn.mColorPicker.RGBtoHex($.fn.mColorPicker.color) != swatch[0] && $.fn.mColorPicker.hexToRGB($.fn.mColorPicker.color) != swatch[0] && swatch.length < 10) swatch[swatch.length] = $.fn.mColorPicker.color;
|
||||
|
||||
$(this).css('background-color', swatch[i++])
|
||||
});
|
||||
|
||||
if ($.fn.mColorPicker.init.enhancedSwatches) $.fn.mColorPicker.setCookie('swatches', swatch.join('||'), 365);
|
||||
};
|
||||
|
||||
$.fn.mColorPicker.whichColor = function (x, y, hex) {
|
||||
|
||||
var colorR = colorG = colorB = 255;
|
||||
|
||||
if (x < 32) {
|
||||
|
||||
colorG = x * 8;
|
||||
colorB = 0;
|
||||
} else if (x < 64) {
|
||||
|
||||
colorR = 256 - (x - 32 ) * 8;
|
||||
colorB = 0;
|
||||
} else if (x < 96) {
|
||||
|
||||
colorR = 0;
|
||||
colorB = (x - 64) * 8;
|
||||
} else if (x < 128) {
|
||||
|
||||
colorR = 0;
|
||||
colorG = 256 - (x - 96) * 8;
|
||||
} else if (x < 160) {
|
||||
|
||||
colorR = (x - 128) * 8;
|
||||
colorG = 0;
|
||||
} else {
|
||||
|
||||
colorG = 0;
|
||||
colorB = 256 - (x - 160) * 8;
|
||||
}
|
||||
|
||||
if (y < 64) {
|
||||
|
||||
colorR += (256 - colorR) * (64 - y) / 64;
|
||||
colorG += (256 - colorG) * (64 - y) / 64;
|
||||
colorB += (256 - colorB) * (64 - y) / 64;
|
||||
} else if (y <= 128) {
|
||||
|
||||
colorR -= colorR * (y - 64) / 64;
|
||||
colorG -= colorG * (y - 64) / 64;
|
||||
colorB -= colorB * (y - 64) / 64;
|
||||
} else if (y > 128) {
|
||||
|
||||
colorR = colorG = colorB = 256 - ( x / 192 * 256 );
|
||||
}
|
||||
|
||||
colorR = Math.round(Math.min(colorR, 255));
|
||||
colorG = Math.round(Math.min(colorG, 255));
|
||||
colorB = Math.round(Math.min(colorB, 255));
|
||||
|
||||
if (hex == 'true') {
|
||||
|
||||
colorR = colorR.toString(16);
|
||||
colorG = colorG.toString(16);
|
||||
colorB = colorB.toString(16);
|
||||
|
||||
if (colorR.length < 2) colorR = 0 + colorR;
|
||||
if (colorG.length < 2) colorG = 0 + colorG;
|
||||
if (colorB.length < 2) colorB = 0 + colorB;
|
||||
|
||||
return "#" + colorR + colorG + colorB;
|
||||
}
|
||||
|
||||
return "rgb(" + colorR + ', ' + colorG + ', ' + colorB + ')';
|
||||
};
|
||||
|
||||
$.fn.mColorPicker.RGBtoHex = function (color) {
|
||||
|
||||
color = color.toLowerCase();
|
||||
|
||||
if (typeof color == 'undefined') return '';
|
||||
if (color.indexOf('#') > -1 && color.length > 6) return color;
|
||||
if (color.indexOf('rgb') < 0) return color;
|
||||
|
||||
if (color.indexOf('#') > -1) {
|
||||
|
||||
return '#' + color.substr(1, 1) + color.substr(1, 1) + color.substr(2, 1) + color.substr(2, 1) + color.substr(3, 1) + color.substr(3, 1);
|
||||
}
|
||||
|
||||
var hexArray = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"],
|
||||
decToHex = "#",
|
||||
code1 = 0;
|
||||
|
||||
color = color.replace(/[^0-9,]/g, '').split(",");
|
||||
|
||||
for (var n = 0; n < color.length; n++) {
|
||||
|
||||
code1 = Math.floor(color[n] / 16);
|
||||
decToHex += hexArray[code1] + hexArray[color[n] - code1 * 16];
|
||||
}
|
||||
|
||||
return decToHex;
|
||||
};
|
||||
|
||||
$.fn.mColorPicker.hexToRGB = function (color) {
|
||||
|
||||
color = color.toLowerCase();
|
||||
|
||||
if (typeof color == 'undefined') return '';
|
||||
if (color.indexOf('rgb') > -1) return color;
|
||||
if (color.indexOf('#') < 0) return color;
|
||||
|
||||
var c = color.replace('#', '');
|
||||
|
||||
if (c.length < 6) c = c.substr(0, 1) + c.substr(0, 1) + c.substr(1, 1) + c.substr(1, 1) + c.substr(2, 1) + c.substr(2, 1);
|
||||
|
||||
return 'rgb(' + parseInt(c.substr(0, 2), 16) + ', ' + parseInt(c.substr(2, 2), 16) + ', ' + parseInt(c.substr(4, 2), 16) + ')';
|
||||
};
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
if ($.fn.mColorPicker.init.replace) {
|
||||
|
||||
$('input[data-mcolorpicker!="true"]').filter(function() {
|
||||
|
||||
return ($.fn.mColorPicker.init.replace == '[type=color]')? this.getAttribute("type") == 'color': $(this).is($.fn.mColorPicker.init.replace);
|
||||
}).mColorPicker();
|
||||
|
||||
$.fn.mColorPicker.liveEvents();
|
||||
}
|
||||
});
|
||||
})(jQuery);
|
||||
251
modules/appagebuilder/views/js/colorpicker/js/utils.js
Normal file
251
modules/appagebuilder/views/js/colorpicker/js/utils.js
Normal file
@@ -0,0 +1,251 @@
|
||||
/**
|
||||
* @copyright Commercial License By LeoTheme.Com
|
||||
* @email leotheme.com
|
||||
* @visit http://www.leotheme.com
|
||||
*/
|
||||
(function($) {
|
||||
EYE.extend({
|
||||
getPosition : function(e, forceIt)
|
||||
{
|
||||
var x = 0;
|
||||
var y = 0;
|
||||
var es = e.style;
|
||||
var restoreStyles = false;
|
||||
if (forceIt && jQuery.curCSS(e,'display') == 'none') {
|
||||
var oldVisibility = es.visibility;
|
||||
var oldPosition = es.position;
|
||||
restoreStyles = true;
|
||||
es.visibility = 'hidden';
|
||||
es.display = 'block';
|
||||
es.position = 'absolute';
|
||||
}
|
||||
var el = e;
|
||||
if (el.getBoundingClientRect) { // IE
|
||||
var box = el.getBoundingClientRect();
|
||||
x = box.left + Math.max(document.documentElement.scrollLeft, document.body.scrollLeft) - 2;
|
||||
y = box.top + Math.max(document.documentElement.scrollTop, document.body.scrollTop) - 2;
|
||||
} else {
|
||||
x = el.offsetLeft;
|
||||
y = el.offsetTop;
|
||||
el = el.offsetParent;
|
||||
if (e != el) {
|
||||
while (el) {
|
||||
x += el.offsetLeft;
|
||||
y += el.offsetTop;
|
||||
el = el.offsetParent;
|
||||
}
|
||||
}
|
||||
if (jQuery.browser.safari && jQuery.curCSS(e, 'position') == 'absolute' ) {
|
||||
x -= document.body.offsetLeft;
|
||||
y -= document.body.offsetTop;
|
||||
}
|
||||
el = e.parentNode;
|
||||
while (el && el.tagName.toUpperCase() != 'BODY' && el.tagName.toUpperCase() != 'HTML')
|
||||
{
|
||||
if (jQuery.curCSS(el, 'display') != 'inline') {
|
||||
x -= el.scrollLeft;
|
||||
y -= el.scrollTop;
|
||||
}
|
||||
el = el.parentNode;
|
||||
}
|
||||
}
|
||||
if (restoreStyles == true) {
|
||||
es.display = 'none';
|
||||
es.position = oldPosition;
|
||||
es.visibility = oldVisibility;
|
||||
}
|
||||
return {x:x, y:y};
|
||||
},
|
||||
getSize : function(e)
|
||||
{
|
||||
var w = parseInt(jQuery.curCSS(e,'width'), 10);
|
||||
var h = parseInt(jQuery.curCSS(e,'height'), 10);
|
||||
var wb = 0;
|
||||
var hb = 0;
|
||||
if (jQuery.curCSS(e, 'display') != 'none') {
|
||||
wb = e.offsetWidth;
|
||||
hb = e.offsetHeight;
|
||||
} else {
|
||||
var es = e.style;
|
||||
var oldVisibility = es.visibility;
|
||||
var oldPosition = es.position;
|
||||
es.visibility = 'hidden';
|
||||
es.display = 'block';
|
||||
es.position = 'absolute';
|
||||
wb = e.offsetWidth;
|
||||
hb = e.offsetHeight;
|
||||
es.display = 'none';
|
||||
es.position = oldPosition;
|
||||
es.visibility = oldVisibility;
|
||||
}
|
||||
return {w:w, h:h, wb:wb, hb:hb};
|
||||
},
|
||||
getClient : function(e)
|
||||
{
|
||||
var h, w;
|
||||
if (e) {
|
||||
w = e.clientWidth;
|
||||
h = e.clientHeight;
|
||||
} else {
|
||||
var de = document.documentElement;
|
||||
w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
|
||||
h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight;
|
||||
}
|
||||
return {w:w,h:h};
|
||||
},
|
||||
getScroll : function (e)
|
||||
{
|
||||
var t=0, l=0, w=0, h=0, iw=0, ih=0;
|
||||
if (e && e.nodeName.toLowerCase() != 'body') {
|
||||
t = e.scrollTop;
|
||||
l = e.scrollLeft;
|
||||
w = e.scrollWidth;
|
||||
h = e.scrollHeight;
|
||||
} else {
|
||||
if (document.documentElement) {
|
||||
t = document.documentElement.scrollTop;
|
||||
l = document.documentElement.scrollLeft;
|
||||
w = document.documentElement.scrollWidth;
|
||||
h = document.documentElement.scrollHeight;
|
||||
} else if (document.body) {
|
||||
t = document.body.scrollTop;
|
||||
l = document.body.scrollLeft;
|
||||
w = document.body.scrollWidth;
|
||||
h = document.body.scrollHeight;
|
||||
}
|
||||
if (typeof pageYOffset != 'undefined') {
|
||||
t = pageYOffset;
|
||||
l = pageXOffset;
|
||||
}
|
||||
iw = self.innerWidth||document.documentElement.clientWidth||document.body.clientWidth||0;
|
||||
ih = self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0;
|
||||
}
|
||||
return { t: t, l: l, w: w, h: h, iw: iw, ih: ih };
|
||||
},
|
||||
getMargins : function(e, toInteger)
|
||||
{
|
||||
var t = jQuery.curCSS(e,'marginTop') || '';
|
||||
var r = jQuery.curCSS(e,'marginRight') || '';
|
||||
var b = jQuery.curCSS(e,'marginBottom') || '';
|
||||
var l = jQuery.curCSS(e,'marginLeft') || '';
|
||||
if (toInteger)
|
||||
return {
|
||||
t: parseInt(t, 10)||0,
|
||||
r: parseInt(r, 10)||0,
|
||||
b: parseInt(b, 10)||0,
|
||||
l: parseInt(l, 10)
|
||||
};
|
||||
else
|
||||
return {t: t, r: r, b: b, l: l};
|
||||
},
|
||||
getPadding : function(e, toInteger)
|
||||
{
|
||||
var t = jQuery.curCSS(e,'paddingTop') || '';
|
||||
var r = jQuery.curCSS(e,'paddingRight') || '';
|
||||
var b = jQuery.curCSS(e,'paddingBottom') || '';
|
||||
var l = jQuery.curCSS(e,'paddingLeft') || '';
|
||||
if (toInteger)
|
||||
return {
|
||||
t: parseInt(t, 10)||0,
|
||||
r: parseInt(r, 10)||0,
|
||||
b: parseInt(b, 10)||0,
|
||||
l: parseInt(l, 10)
|
||||
};
|
||||
else
|
||||
return {t: t, r: r, b: b, l: l};
|
||||
},
|
||||
getBorder : function(e, toInteger)
|
||||
{
|
||||
var t = jQuery.curCSS(e,'borderTopWidth') || '';
|
||||
var r = jQuery.curCSS(e,'borderRightWidth') || '';
|
||||
var b = jQuery.curCSS(e,'borderBottomWidth') || '';
|
||||
var l = jQuery.curCSS(e,'borderLeftWidth') || '';
|
||||
if (toInteger)
|
||||
return {
|
||||
t: parseInt(t, 10)||0,
|
||||
r: parseInt(r, 10)||0,
|
||||
b: parseInt(b, 10)||0,
|
||||
l: parseInt(l, 10)||0
|
||||
};
|
||||
else
|
||||
return {t: t, r: r, b: b, l: l};
|
||||
},
|
||||
traverseDOM : function(nodeEl, func)
|
||||
{
|
||||
func(nodeEl);
|
||||
nodeEl = nodeEl.firstChild;
|
||||
while(nodeEl){
|
||||
EYE.traverseDOM(nodeEl, func);
|
||||
nodeEl = nodeEl.nextSibling;
|
||||
}
|
||||
},
|
||||
getInnerWidth : function(el, scroll) {
|
||||
var offsetW = el.offsetWidth;
|
||||
return scroll ? Math.max(el.scrollWidth,offsetW) - offsetW + el.clientWidth:el.clientWidth;
|
||||
},
|
||||
getInnerHeight : function(el, scroll) {
|
||||
var offsetH = el.offsetHeight;
|
||||
return scroll ? Math.max(el.scrollHeight,offsetH) - offsetH + el.clientHeight:el.clientHeight;
|
||||
},
|
||||
getExtraWidth : function(el) {
|
||||
if($.boxModel)
|
||||
return (parseInt($.curCSS(el, 'paddingLeft'))||0)
|
||||
+ (parseInt($.curCSS(el, 'paddingRight'))||0)
|
||||
+ (parseInt($.curCSS(el, 'borderLeftWidth'))||0)
|
||||
+ (parseInt($.curCSS(el, 'borderRightWidth'))||0);
|
||||
return 0;
|
||||
},
|
||||
getExtraHeight : function(el) {
|
||||
if($.boxModel)
|
||||
return (parseInt($.curCSS(el, 'paddingTop'))||0)
|
||||
+ (parseInt($.curCSS(el, 'paddingBottom'))||0)
|
||||
+ (parseInt($.curCSS(el, 'borderTopWidth'))||0)
|
||||
+ (parseInt($.curCSS(el, 'borderBottomWidth'))||0);
|
||||
return 0;
|
||||
},
|
||||
isChildOf: function(parentEl, el, container) {
|
||||
if (parentEl == el) {
|
||||
return true;
|
||||
}
|
||||
if (!el || !el.nodeType || el.nodeType != 1) {
|
||||
return false;
|
||||
}
|
||||
if (parentEl.contains && !$.browser.safari) {
|
||||
return parentEl.contains(el);
|
||||
}
|
||||
if ( parentEl.compareDocumentPosition ) {
|
||||
return !!(parentEl.compareDocumentPosition(el) & 16);
|
||||
}
|
||||
var prEl = el.parentNode;
|
||||
while(prEl && prEl != container) {
|
||||
if (prEl == parentEl)
|
||||
return true;
|
||||
prEl = prEl.parentNode;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
centerEl : function(el, axis)
|
||||
{
|
||||
var clientScroll = EYE.getScroll();
|
||||
var size = EYE.getSize(el);
|
||||
if (!axis || axis == 'vertically')
|
||||
$(el).css(
|
||||
{
|
||||
top: clientScroll.t + ((Math.min(clientScroll.h,clientScroll.ih) - size.hb)/2) + 'px'
|
||||
}
|
||||
);
|
||||
if (!axis || axis == 'horizontally')
|
||||
$(el).css(
|
||||
{
|
||||
left: clientScroll.l + ((Math.min(clientScroll.w,clientScroll.iw) - size.wb)/2) + 'px'
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
if (!$.easing.easeout) {
|
||||
$.easing.easeout = function(p, n, firstNum, delta, duration) {
|
||||
return -delta * ((n=n/duration-1)*n*n*n - 1) + firstNum;
|
||||
};
|
||||
}
|
||||
|
||||
})(jQuery);
|
||||
74
modules/appagebuilder/views/js/countdown.js
Normal file
74
modules/appagebuilder/views/js/countdown.js
Normal file
@@ -0,0 +1,74 @@
|
||||
/**
|
||||
* @copyright Commercial License By LeoTheme.Com
|
||||
* @email leotheme.com
|
||||
* @visit http://www.leotheme.com
|
||||
*/
|
||||
|
||||
(function(){
|
||||
$.fn.lofCountDown = function( options ) {
|
||||
return this.each(function() {
|
||||
// get instance of the lofCountDown.
|
||||
new $.lofCountDown( this, options );
|
||||
});
|
||||
}
|
||||
$.lofCountDown = function( obj, options ){
|
||||
|
||||
this.options = $.extend({
|
||||
autoStart : true,
|
||||
LeadingZero:true,
|
||||
DisplayFormat:"<div>%%D%% Days</div><div>%%H%% Hours</div><div>%%M%% Minutes</div><div>%%S%% Seconds</div>",
|
||||
FinishMessage:"Expired",
|
||||
CountActive:true,
|
||||
TargetDate:null
|
||||
}, options || {} );
|
||||
if( this.options.TargetDate == null || this.options.TargetDate == '' ){
|
||||
return ;
|
||||
}
|
||||
this.timer = null;
|
||||
this.element = obj;
|
||||
this.CountStepper = -1;
|
||||
this.CountStepper = Math.ceil(this.CountStepper);
|
||||
this.SetTimeOutPeriod = (Math.abs(this.CountStepper)-1)*1000 + 990;
|
||||
var dthen = new Date(this.options.TargetDate);
|
||||
var dnow = new Date();
|
||||
if( this.CountStepper > 0 ) {
|
||||
ddiff = new Date(dnow-dthen);
|
||||
}
|
||||
else {
|
||||
ddiff = new Date(dthen-dnow);
|
||||
}
|
||||
gsecs = Math.floor(ddiff.valueOf()/1000);
|
||||
this.CountBack(gsecs, this);
|
||||
|
||||
};
|
||||
$.lofCountDown.fn = $.lofCountDown.prototype;
|
||||
$.lofCountDown.fn.extend = $.lofCountDown.extend = $.extend;
|
||||
$.lofCountDown.fn.extend({
|
||||
calculateDate:function( secs, num1, num2 ){
|
||||
var s = ((Math.floor(secs/num1))%num2).toString();
|
||||
if ( this.options.LeadingZero && s.length < 2) {
|
||||
s = "0" + s;
|
||||
}
|
||||
return "<b>" + s + "</b>";
|
||||
},
|
||||
CountBack:function( secs, self ){
|
||||
if (secs < 0) {
|
||||
// self.element.innerHTML = '<div class="lof-labelexpired"> '+self.options.FinishMessage+"</div>";
|
||||
return;
|
||||
}
|
||||
clearInterval(self.timer);
|
||||
DisplayStr = self.options.DisplayFormat.replace(/%%D%%/g, self.calculateDate( secs,86400,100000) );
|
||||
DisplayStr = DisplayStr.replace(/%%H%%/g, self.calculateDate(secs,3600,24));
|
||||
DisplayStr = DisplayStr.replace(/%%M%%/g, self.calculateDate(secs,60,60));
|
||||
DisplayStr = DisplayStr.replace(/%%S%%/g, self.calculateDate(secs,1,60));
|
||||
self.element.innerHTML = DisplayStr;
|
||||
if (self.options.CountActive) {
|
||||
self.timer = null;
|
||||
self.timer = setTimeout( function(){
|
||||
self.CountBack((secs+self.CountStepper),self);
|
||||
},( self.SetTimeOutPeriod ) );
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
})(jQuery)
|
||||
BIN
modules/appagebuilder/views/js/flashmediaelement-cdn.swf
Normal file
BIN
modules/appagebuilder/views/js/flashmediaelement-cdn.swf
Normal file
Binary file not shown.
BIN
modules/appagebuilder/views/js/flashmediaelement.swf
Normal file
BIN
modules/appagebuilder/views/js/flashmediaelement.swf
Normal file
Binary file not shown.
7
modules/appagebuilder/views/js/imagesloaded.pkgd.min.js
vendored
Normal file
7
modules/appagebuilder/views/js/imagesloaded.pkgd.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
36
modules/appagebuilder/views/js/index.php
Normal file
36
modules/appagebuilder/views/js/index.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2012 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2012 PrestaShop SA
|
||||
* @version Release: $Revision: 13573 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||
|
||||
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||
header("Pragma: no-cache");
|
||||
|
||||
header("Location: ../");
|
||||
exit;
|
||||
8
modules/appagebuilder/views/js/instafeed.min.js
vendored
Normal file
8
modules/appagebuilder/views/js/instafeed.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
6
modules/appagebuilder/views/js/jquery-ui-1.10.3.custom.min.js
vendored
Normal file
6
modules/appagebuilder/views/js/jquery-ui-1.10.3.custom.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
79
modules/appagebuilder/views/js/jquery.elevateZoom-3.0.8.min.js
vendored
Normal file
79
modules/appagebuilder/views/js/jquery.elevateZoom-3.0.8.min.js
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* @Website: apollotheme.com - prestashop template provider
|
||||
* @author Apollotheme <apollotheme@gmail.com>
|
||||
* @copyright Apollotheme
|
||||
* @description:
|
||||
*/
|
||||
/* jQuery elevateZoom 3.0.8 - Demo's and documentation: - www.elevateweb.co.uk/image-zoom - Copyright (c) 2013 Andrew Eades - www.elevateweb.co.uk - Dual licensed under the LGPL licenses. - http://en.wikipedia.org/wiki/MIT_License - http://en.wikipedia.org/wiki/GNU_General_Public_License */
|
||||
//DONGND:: fix type scroll to zoom on firefox
|
||||
var check_browser = navigator.userAgent;
|
||||
var leo = 'mousewheel wheel ';
|
||||
if(check_browser.indexOf('Firefox') >= 0) {
|
||||
leo = '';
|
||||
}
|
||||
|
||||
"function"!==typeof Object.create&&(Object.create=function(d){function h(){}h.prototype=d;return new h});
|
||||
(function(d,h,l,m){var k={init:function(b,a){var c=this;c.elem=a;c.$elem=d(a);c.imageSrc=c.$elem.data("zoom-image")?c.$elem.data("zoom-image"):c.$elem.attr("src");c.options=d.extend({},d.fn.elevateZoom.options,b);c.options.tint&&(c.options.lensColour="none",c.options.lensOpacity="1");"inner"==c.options.zoomType&&(c.options.showLens=!1);c.$elem.parent().removeAttr("title").removeAttr("alt");c.zoomImage=c.imageSrc;c.refresh(1);d("#"+c.options.gallery+" a").click(function(a){c.options.galleryActiveClass&&
|
||||
(d("#"+c.options.gallery+" a").removeClass(c.options.galleryActiveClass),d(this).addClass(c.options.galleryActiveClass));a.preventDefault();d(this).data("zoom-image")?c.zoomImagePre=d(this).data("zoom-image"):c.zoomImagePre=d(this).data("image");c.swaptheimage(d(this).data("image"),c.zoomImagePre);return!1})},refresh:function(b){var a=this;setTimeout(function(){a.fetch(a.imageSrc)},b||a.options.refresh)},fetch:function(b){var a=this,c=new Image;c.onload=function(){a.largeWidth=c.width;a.largeHeight=
|
||||
c.height;a.startZoom();a.currentImage=a.imageSrc;a.options.onZoomedImageLoaded(a.$elem)};c.src=b},startZoom:function(){var b=this;b.nzWidth=b.$elem.width();b.nzHeight=b.$elem.height();b.isWindowActive=!1;b.isLensActive=!1;b.isTintActive=!1;b.overWindow=!1;b.options.imageCrossfade&&(b.zoomWrap=b.$elem.wrap('<div style="height:'+b.nzHeight+"px;width:"+b.nzWidth+'px;" class="zoomWrapper" />'),b.$elem.css("position","absolute"));b.zoomLock=1;b.scrollingLock=!1;b.changeBgSize=!1;b.currentZoomLevel=b.options.zoomLevel;
|
||||
b.nzOffset=b.$elem.offset();b.widthRatio=b.largeWidth/b.currentZoomLevel/b.nzWidth;b.heightRatio=b.largeHeight/b.currentZoomLevel/b.nzHeight;"window"==b.options.zoomType&&(b.zoomWindowStyle="overflow: hidden;background-position: 0px 0px;text-align:center;background-color: "+String(b.options.zoomWindowBgColour)+";width: "+String(b.options.zoomWindowWidth)+"px;height: "+String(b.options.zoomWindowHeight)+"px;float: left;background-size: "+b.largeWidth/b.currentZoomLevel+"px "+b.largeHeight/b.currentZoomLevel+
|
||||
"px;display: none;z-index:100;border: "+String(b.options.borderSize)+"px solid "+b.options.borderColour+";background-repeat: no-repeat;position: absolute;");if("inner"==b.options.zoomType){var a=b.$elem.css("border-left-width");b.zoomWindowStyle="overflow: hidden;margin-left: "+String(a)+";margin-top: "+String(a)+";background-position: 0px 0px;width: "+String(b.nzWidth)+"px;height: "+String(b.nzHeight)+"px;float: left;display: none;cursor:"+b.options.cursor+";px solid "+b.options.borderColour+";background-repeat: no-repeat;position: absolute;"}"window"==
|
||||
b.options.zoomType&&(lensHeight=b.nzHeight<b.options.zoomWindowWidth/b.widthRatio?b.nzHeight:String(b.options.zoomWindowHeight/b.heightRatio),lensWidth=b.largeWidth<b.options.zoomWindowWidth?b.nzWidth:b.options.zoomWindowWidth/b.widthRatio,b.lensStyle="background-position: 0px 0px;width: "+String(b.options.zoomWindowWidth/b.widthRatio)+"px;height: "+String(b.options.zoomWindowHeight/b.heightRatio)+"px;float: right;display: none;overflow: hidden;z-index: 999;-webkit-transform: translateZ(0);opacity:"+
|
||||
b.options.lensOpacity+";filter: alpha(opacity = "+100*b.options.lensOpacity+"); zoom:1;width:"+lensWidth+"px;height:"+lensHeight+"px;background-color:"+b.options.lensColour+";cursor:"+b.options.cursor+";border: "+b.options.lensBorderSize+"px solid "+b.options.lensBorderColour+";background-repeat: no-repeat;position: absolute;");b.tintStyle="display: block;position: absolute;background-color: "+b.options.tintColour+";filter:alpha(opacity=0);opacity: 0;width: "+b.nzWidth+"px;height: "+b.nzHeight+"px;";
|
||||
b.lensRound="";"lens"==b.options.zoomType&&(b.lensStyle="background-position: 0px 0px;float: left;display: none;border: "+String(b.options.borderSize)+"px solid "+b.options.borderColour+";width:"+String(b.options.lensSize)+"px;height:"+String(b.options.lensSize)+"px;background-repeat: no-repeat;position: absolute;");"round"==b.options.lensShape&&(b.lensRound="border-top-left-radius: "+String(b.options.lensSize/2+b.options.borderSize)+"px;border-top-right-radius: "+String(b.options.lensSize/2+b.options.borderSize)+
|
||||
"px;border-bottom-left-radius: "+String(b.options.lensSize/2+b.options.borderSize)+"px;border-bottom-right-radius: "+String(b.options.lensSize/2+b.options.borderSize)+"px;");b.zoomContainer=d('<div class="zoomContainer" style="-webkit-transform: translateZ(0);position:absolute;left:'+b.nzOffset.left+"px;top:"+b.nzOffset.top+"px;height:"+b.nzHeight+"px;width:"+b.nzWidth+'px;"></div>');d("body").append(b.zoomContainer);b.options.containLensZoom&&"lens"==b.options.zoomType&&b.zoomContainer.css("overflow",
|
||||
"hidden");"inner"!=b.options.zoomType&&(b.zoomLens=d("<div class='zoomLens' style='"+b.lensStyle+b.lensRound+"'> </div>").appendTo(b.zoomContainer).click(function(){b.$elem.trigger("click")}),b.options.tint&&(b.tintContainer=d("<div/>").addClass("tintContainer"),b.zoomTint=d("<div class='zoomTint' style='"+b.tintStyle+"'></div>"),b.zoomLens.wrap(b.tintContainer),b.zoomTintcss=b.zoomLens.after(b.zoomTint),b.zoomTintImage=d('<img style="position: absolute; left: 0px; top: 0px; max-width: none; width: '+
|
||||
b.nzWidth+"px; height: "+b.nzHeight+'px;" src="'+b.imageSrc+'">').appendTo(b.zoomLens).click(function(){b.$elem.trigger("click")})));isNaN(b.options.zoomWindowPosition)?b.zoomWindow=d("<div style='z-index:999;left:"+b.windowOffsetLeft+"px;top:"+b.windowOffsetTop+"px;"+b.zoomWindowStyle+"' class='zoomWindow'> </div>").appendTo("body").click(function(){b.$elem.trigger("click")}):b.zoomWindow=d("<div style='z-index:999;left:"+b.windowOffsetLeft+"px;top:"+b.windowOffsetTop+"px;"+b.zoomWindowStyle+
|
||||
"' class='zoomWindow'> </div>").appendTo(b.zoomContainer).click(function(){b.$elem.trigger("click")});b.zoomWindowContainer=d("<div/>").addClass("zoomWindowContainer").css("width",b.options.zoomWindowWidth);b.zoomWindow.wrap(b.zoomWindowContainer);"lens"==b.options.zoomType&&b.zoomLens.css({backgroundImage:"url('"+b.imageSrc+"')"});"window"==b.options.zoomType&&b.zoomWindow.css({backgroundImage:"url('"+b.imageSrc+"')"});"inner"==b.options.zoomType&&b.zoomWindow.css({backgroundImage:"url('"+b.imageSrc+
|
||||
"')"});b.$elem.bind("touchmove",function(a){a.preventDefault();b.setPosition(a.originalEvent.touches[0]||a.originalEvent.changedTouches[0])});b.zoomContainer.bind("touchmove",function(a){"inner"==b.options.zoomType&&b.showHideWindow("show");a.preventDefault();b.setPosition(a.originalEvent.touches[0]||a.originalEvent.changedTouches[0])});b.zoomContainer.bind("touchend",function(a){b.showHideWindow("hide");b.options.showLens&&b.showHideLens("hide");b.options.tint&&"inner"!=b.options.zoomType&&b.showHideTint("hide")});
|
||||
b.$elem.bind("touchend",function(a){b.showHideWindow("hide");b.options.showLens&&b.showHideLens("hide");b.options.tint&&"inner"!=b.options.zoomType&&b.showHideTint("hide")});b.options.showLens&&(b.zoomLens.bind("touchmove",function(a){a.preventDefault();b.setPosition(a.originalEvent.touches[0]||a.originalEvent.changedTouches[0])}),b.zoomLens.bind("touchend",function(a){b.showHideWindow("hide");b.options.showLens&&b.showHideLens("hide");b.options.tint&&"inner"!=b.options.zoomType&&b.showHideTint("hide")}));
|
||||
b.$elem.bind("mousemove",function(a){!1==b.overWindow&&b.setElements("show");if(b.lastX!==a.clientX||b.lastY!==a.clientY)b.setPosition(a),b.currentLoc=a;b.lastX=a.clientX;b.lastY=a.clientY});b.zoomContainer.bind("mousemove",function(a){!1==b.overWindow&&b.setElements("show");if(b.lastX!==a.clientX||b.lastY!==a.clientY)b.setPosition(a),b.currentLoc=a;b.lastX=a.clientX;b.lastY=a.clientY});"inner"!=b.options.zoomType&&b.zoomLens.bind("mousemove",function(a){if(b.lastX!==a.clientX||b.lastY!==a.clientY)b.setPosition(a),
|
||||
b.currentLoc=a;b.lastX=a.clientX;b.lastY=a.clientY});b.options.tint&&"inner"!=b.options.zoomType&&b.zoomTint.bind("mousemove",function(a){if(b.lastX!==a.clientX||b.lastY!==a.clientY)b.setPosition(a),b.currentLoc=a;b.lastX=a.clientX;b.lastY=a.clientY});"inner"==b.options.zoomType&&b.zoomWindow.bind("mousemove",function(a){if(b.lastX!==a.clientX||b.lastY!==a.clientY)b.setPosition(a),b.currentLoc=a;b.lastX=a.clientX;b.lastY=a.clientY});b.zoomContainer.add(b.$elem).mouseenter(function(){!1==b.overWindow&&
|
||||
b.setElements("show")}).mouseleave(function(){b.scrollLock||b.setElements("hide")});"inner"!=b.options.zoomType&&b.zoomWindow.mouseenter(function(){b.overWindow=!0;b.setElements("hide")}).mouseleave(function(){b.overWindow=!1});b.minZoomLevel=b.options.minZoomLevel?b.options.minZoomLevel:2*b.options.scrollZoomIncrement;b.options.scrollZoom&&b.zoomContainer.add(b.$elem).bind(leo+"DOMMouseScroll MozMousePixelScroll",function(a){b.scrollLock=!0;clearTimeout(d.data(this,"timer"));d.data(this,"timer",
|
||||
setTimeout(function(){b.scrollLock=!1},250));var e=a.originalEvent.wheelDelta||-1*a.originalEvent.detail;a.stopImmediatePropagation();a.stopPropagation();a.preventDefault();0<e/120?b.currentZoomLevel>=b.minZoomLevel&&b.changeZoomLevel(b.currentZoomLevel-b.options.scrollZoomIncrement):b.options.maxZoomLevel?b.currentZoomLevel<=b.options.maxZoomLevel&&b.changeZoomLevel(parseFloat(b.currentZoomLevel)+b.options.scrollZoomIncrement):b.changeZoomLevel(parseFloat(b.currentZoomLevel)+b.options.scrollZoomIncrement);
|
||||
return!1})},setElements:function(b){if(!this.options.zoomEnabled)return!1;"show"==b&&this.isWindowSet&&("inner"==this.options.zoomType&&this.showHideWindow("show"),"window"==this.options.zoomType&&this.showHideWindow("show"),this.options.showLens&&this.showHideLens("show"),this.options.tint&&"inner"!=this.options.zoomType&&this.showHideTint("show"));"hide"==b&&("window"==this.options.zoomType&&this.showHideWindow("hide"),this.options.tint||this.showHideWindow("hide"),this.options.showLens&&this.showHideLens("hide"),
|
||||
this.options.tint&&this.showHideTint("hide"))},setPosition:function(b){if(!this.options.zoomEnabled)return!1;this.nzHeight=this.$elem.height();this.nzWidth=this.$elem.width();this.nzOffset=this.$elem.offset();this.options.tint&&"inner"!=this.options.zoomType&&(this.zoomTint.css({top:0}),this.zoomTint.css({left:0}));this.options.responsive&&!this.options.scrollZoom&&this.options.showLens&&(lensHeight=this.nzHeight<this.options.zoomWindowWidth/this.widthRatio?this.nzHeight:String(this.options.zoomWindowHeight/
|
||||
this.heightRatio),lensWidth=this.largeWidth<this.options.zoomWindowWidth?this.nzWidth:this.options.zoomWindowWidth/this.widthRatio,this.widthRatio=this.largeWidth/this.nzWidth,this.heightRatio=this.largeHeight/this.nzHeight,"lens"!=this.options.zoomType&&(lensHeight=this.nzHeight<this.options.zoomWindowWidth/this.widthRatio?this.nzHeight:String(this.options.zoomWindowHeight/this.heightRatio),lensWidth=this.options.zoomWindowWidth<this.options.zoomWindowWidth?this.nzWidth:this.options.zoomWindowWidth/
|
||||
this.widthRatio,this.zoomLens.css("width",lensWidth),this.zoomLens.css("height",lensHeight),this.options.tint&&(this.zoomTintImage.css("width",this.nzWidth),this.zoomTintImage.css("height",this.nzHeight))),"lens"==this.options.zoomType&&this.zoomLens.css({width:String(this.options.lensSize)+"px",height:String(this.options.lensSize)+"px"}));this.zoomContainer.css({top:this.nzOffset.top});this.zoomContainer.css({left:this.nzOffset.left});this.mouseLeft=parseInt(b.pageX-this.nzOffset.left);this.mouseTop=
|
||||
parseInt(b.pageY-this.nzOffset.top);"window"==this.options.zoomType&&(this.Etoppos=this.mouseTop<this.zoomLens.height()/2,this.Eboppos=this.mouseTop>this.nzHeight-this.zoomLens.height()/2-2*this.options.lensBorderSize,this.Eloppos=this.mouseLeft<0+this.zoomLens.width()/2,this.Eroppos=this.mouseLeft>this.nzWidth-this.zoomLens.width()/2-2*this.options.lensBorderSize);"inner"==this.options.zoomType&&(this.Etoppos=this.mouseTop<this.nzHeight/2/this.heightRatio,this.Eboppos=this.mouseTop>this.nzHeight-
|
||||
this.nzHeight/2/this.heightRatio,this.Eloppos=this.mouseLeft<0+this.nzWidth/2/this.widthRatio,this.Eroppos=this.mouseLeft>this.nzWidth-this.nzWidth/2/this.widthRatio-2*this.options.lensBorderSize);0>=this.mouseLeft||0>this.mouseTop||this.mouseLeft>this.nzWidth||this.mouseTop>this.nzHeight?this.setElements("hide"):(this.options.showLens&&(this.lensLeftPos=String(this.mouseLeft-this.zoomLens.width()/2),this.lensTopPos=String(this.mouseTop-this.zoomLens.height()/2)),this.Etoppos&&(this.lensTopPos=0),
|
||||
this.Eloppos&&(this.tintpos=this.lensLeftPos=this.windowLeftPos=0),"window"==this.options.zoomType&&(this.Eboppos&&(this.lensTopPos=Math.max(this.nzHeight-this.zoomLens.height()-2*this.options.lensBorderSize,0)),this.Eroppos&&(this.lensLeftPos=this.nzWidth-this.zoomLens.width()-2*this.options.lensBorderSize)),"inner"==this.options.zoomType&&(this.Eboppos&&(this.lensTopPos=Math.max(this.nzHeight-2*this.options.lensBorderSize,0)),this.Eroppos&&(this.lensLeftPos=this.nzWidth-this.nzWidth-2*this.options.lensBorderSize)),
|
||||
"lens"==this.options.zoomType&&(this.windowLeftPos=String(-1*((b.pageX-this.nzOffset.left)*this.widthRatio-this.zoomLens.width()/2)),this.windowTopPos=String(-1*((b.pageY-this.nzOffset.top)*this.heightRatio-this.zoomLens.height()/2)),this.zoomLens.css({backgroundPosition:this.windowLeftPos+"px "+this.windowTopPos+"px"}),this.changeBgSize&&(this.nzHeight>this.nzWidth?("lens"==this.options.zoomType&&this.zoomLens.css({"background-size":this.largeWidth/this.newvalueheight+"px "+this.largeHeight/this.newvalueheight+
|
||||
"px"}),this.zoomWindow.css({"background-size":this.largeWidth/this.newvalueheight+"px "+this.largeHeight/this.newvalueheight+"px"})):("lens"==this.options.zoomType&&this.zoomLens.css({"background-size":this.largeWidth/this.newvaluewidth+"px "+this.largeHeight/this.newvaluewidth+"px"}),this.zoomWindow.css({"background-size":this.largeWidth/this.newvaluewidth+"px "+this.largeHeight/this.newvaluewidth+"px"})),this.changeBgSize=!1),this.setWindowPostition(b)),this.options.tint&&"inner"!=this.options.zoomType&&
|
||||
this.setTintPosition(b),"window"==this.options.zoomType&&this.setWindowPostition(b),"inner"==this.options.zoomType&&this.setWindowPostition(b),this.options.showLens&&(this.fullwidth&&"lens"!=this.options.zoomType&&(this.lensLeftPos=0),this.zoomLens.css({left:this.lensLeftPos+"px",top:this.lensTopPos+"px"})))},showHideWindow:function(b){"show"!=b||this.isWindowActive||(this.options.zoomWindowFadeIn?this.zoomWindow.stop(!0,!0,!1).fadeIn(this.options.zoomWindowFadeIn):this.zoomWindow.show(),this.isWindowActive=
|
||||
!0);"hide"==b&&this.isWindowActive&&(this.options.zoomWindowFadeOut?this.zoomWindow.stop(!0,!0).fadeOut(this.options.zoomWindowFadeOut):this.zoomWindow.hide(),this.isWindowActive=!1)},showHideLens:function(b){"show"!=b||this.isLensActive||(this.options.lensFadeIn?this.zoomLens.stop(!0,!0,!1).fadeIn(this.options.lensFadeIn):this.zoomLens.show(),this.isLensActive=!0);"hide"==b&&this.isLensActive&&(this.options.lensFadeOut?this.zoomLens.stop(!0,!0).fadeOut(this.options.lensFadeOut):this.zoomLens.hide(),
|
||||
this.isLensActive=!1)},showHideTint:function(b){"show"!=b||this.isTintActive||(this.options.zoomTintFadeIn?this.zoomTint.css({opacity:this.options.tintOpacity}).animate().stop(!0,!0).fadeIn("slow"):(this.zoomTint.css({opacity:this.options.tintOpacity}).animate(),this.zoomTint.show()),this.isTintActive=!0);"hide"==b&&this.isTintActive&&(this.options.zoomTintFadeOut?this.zoomTint.stop(!0,!0).fadeOut(this.options.zoomTintFadeOut):this.zoomTint.hide(),this.isTintActive=!1)},setLensPostition:function(b){},
|
||||
setWindowPostition:function(b){var a=this;if(isNaN(a.options.zoomWindowPosition))a.externalContainer=d("#"+a.options.zoomWindowPosition),a.externalContainerWidth=a.externalContainer.width(),a.externalContainerHeight=a.externalContainer.height(),a.externalContainerOffset=a.externalContainer.offset(),a.windowOffsetTop=a.externalContainerOffset.top,a.windowOffsetLeft=a.externalContainerOffset.left;else switch(a.options.zoomWindowPosition){case 1:a.windowOffsetTop=a.options.zoomWindowOffety;a.windowOffsetLeft=
|
||||
+a.nzWidth;break;case 2:a.options.zoomWindowHeight>a.nzHeight&&(a.windowOffsetTop=-1*(a.options.zoomWindowHeight/2-a.nzHeight/2),a.windowOffsetLeft=a.nzWidth);break;case 3:a.windowOffsetTop=a.nzHeight-a.zoomWindow.height()-2*a.options.borderSize;a.windowOffsetLeft=a.nzWidth;break;case 4:a.windowOffsetTop=a.nzHeight;a.windowOffsetLeft=a.nzWidth;break;case 5:a.windowOffsetTop=a.nzHeight;a.windowOffsetLeft=a.nzWidth-a.zoomWindow.width()-2*a.options.borderSize;break;case 6:a.options.zoomWindowHeight>
|
||||
a.nzHeight&&(a.windowOffsetTop=a.nzHeight,a.windowOffsetLeft=-1*(a.options.zoomWindowWidth/2-a.nzWidth/2+2*a.options.borderSize));break;case 7:a.windowOffsetTop=a.nzHeight;a.windowOffsetLeft=0;break;case 8:a.windowOffsetTop=a.nzHeight;a.windowOffsetLeft=-1*(a.zoomWindow.width()+2*a.options.borderSize);break;case 9:a.windowOffsetTop=a.nzHeight-a.zoomWindow.height()-2*a.options.borderSize;a.windowOffsetLeft=-1*(a.zoomWindow.width()+2*a.options.borderSize);break;case 10:a.options.zoomWindowHeight>a.nzHeight&&
|
||||
(a.windowOffsetTop=-1*(a.options.zoomWindowHeight/2-a.nzHeight/2),a.windowOffsetLeft=-1*(a.zoomWindow.width()+2*a.options.borderSize));break;case 11:a.windowOffsetTop=a.options.zoomWindowOffety;a.windowOffsetLeft=-1*(a.zoomWindow.width()+2*a.options.borderSize);break;case 12:a.windowOffsetTop=-1*(a.zoomWindow.height()+2*a.options.borderSize);a.windowOffsetLeft=-1*(a.zoomWindow.width()+2*a.options.borderSize);break;case 13:a.windowOffsetTop=-1*(a.zoomWindow.height()+2*a.options.borderSize);a.windowOffsetLeft=
|
||||
0;break;case 14:a.options.zoomWindowHeight>a.nzHeight&&(a.windowOffsetTop=-1*(a.zoomWindow.height()+2*a.options.borderSize),a.windowOffsetLeft=-1*(a.options.zoomWindowWidth/2-a.nzWidth/2+2*a.options.borderSize));break;case 15:a.windowOffsetTop=-1*(a.zoomWindow.height()+2*a.options.borderSize);a.windowOffsetLeft=a.nzWidth-a.zoomWindow.width()-2*a.options.borderSize;break;case 16:a.windowOffsetTop=-1*(a.zoomWindow.height()+2*a.options.borderSize);a.windowOffsetLeft=a.nzWidth;break;default:a.windowOffsetTop=
|
||||
a.options.zoomWindowOffety,a.windowOffsetLeft=a.nzWidth}a.isWindowSet=!0;a.windowOffsetTop+=a.options.zoomWindowOffety;a.windowOffsetLeft+=a.options.zoomWindowOffetx;a.zoomWindow.css({top:a.windowOffsetTop});a.zoomWindow.css({left:a.windowOffsetLeft});"inner"==a.options.zoomType&&(a.zoomWindow.css({top:0}),a.zoomWindow.css({left:0}));a.windowLeftPos=String(-1*((b.pageX-a.nzOffset.left)*a.widthRatio-a.zoomWindow.width()/2));a.windowTopPos=String(-1*((b.pageY-a.nzOffset.top)*a.heightRatio-a.zoomWindow.height()/
|
||||
2));a.Etoppos&&(a.windowTopPos=0);a.Eloppos&&(a.windowLeftPos=0);a.Eboppos&&(a.windowTopPos=-1*(a.largeHeight/a.currentZoomLevel-a.zoomWindow.height()));a.Eroppos&&(a.windowLeftPos=-1*(a.largeWidth/a.currentZoomLevel-a.zoomWindow.width()));a.fullheight&&(a.windowTopPos=0);a.fullwidth&&(a.windowLeftPos=0);if("window"==a.options.zoomType||"inner"==a.options.zoomType)1==a.zoomLock&&(1>=a.widthRatio&&(a.windowLeftPos=0),1>=a.heightRatio&&(a.windowTopPos=0)),a.largeHeight<a.options.zoomWindowHeight&&(a.windowTopPos=
|
||||
0),a.largeWidth<a.options.zoomWindowWidth&&(a.windowLeftPos=0),a.options.easing?(a.xp||(a.xp=0),a.yp||(a.yp=0),a.loop||(a.loop=setInterval(function(){a.xp+=(a.windowLeftPos-a.xp)/a.options.easingAmount;a.yp+=(a.windowTopPos-a.yp)/a.options.easingAmount;a.scrollingLock?(clearInterval(a.loop),a.xp=a.windowLeftPos,a.yp=a.windowTopPos,a.xp=-1*((b.pageX-a.nzOffset.left)*a.widthRatio-a.zoomWindow.width()/2),a.yp=-1*((b.pageY-a.nzOffset.top)*a.heightRatio-a.zoomWindow.height()/2),a.changeBgSize&&(a.nzHeight>
|
||||
a.nzWidth?("lens"==a.options.zoomType&&a.zoomLens.css({"background-size":a.largeWidth/a.newvalueheight+"px "+a.largeHeight/a.newvalueheight+"px"}),a.zoomWindow.css({"background-size":a.largeWidth/a.newvalueheight+"px "+a.largeHeight/a.newvalueheight+"px"})):("lens"!=a.options.zoomType&&a.zoomLens.css({"background-size":a.largeWidth/a.newvaluewidth+"px "+a.largeHeight/a.newvalueheight+"px"}),a.zoomWindow.css({"background-size":a.largeWidth/a.newvaluewidth+"px "+a.largeHeight/a.newvaluewidth+"px"})),
|
||||
a.changeBgSize=!1),a.zoomWindow.css({backgroundPosition:a.windowLeftPos+"px "+a.windowTopPos+"px"}),a.scrollingLock=!1,a.loop=!1):(a.changeBgSize&&(a.nzHeight>a.nzWidth?("lens"==a.options.zoomType&&a.zoomLens.css({"background-size":a.largeWidth/a.newvalueheight+"px "+a.largeHeight/a.newvalueheight+"px"}),a.zoomWindow.css({"background-size":a.largeWidth/a.newvalueheight+"px "+a.largeHeight/a.newvalueheight+"px"})):("lens"!=a.options.zoomType&&a.zoomLens.css({"background-size":a.largeWidth/a.newvaluewidth+
|
||||
"px "+a.largeHeight/a.newvaluewidth+"px"}),a.zoomWindow.css({"background-size":a.largeWidth/a.newvaluewidth+"px "+a.largeHeight/a.newvaluewidth+"px"})),a.changeBgSize=!1),a.zoomWindow.css({backgroundPosition:a.xp+"px "+a.yp+"px"}))},16))):(a.changeBgSize&&(a.nzHeight>a.nzWidth?("lens"==a.options.zoomType&&a.zoomLens.css({"background-size":a.largeWidth/a.newvalueheight+"px "+a.largeHeight/a.newvalueheight+"px"}),a.zoomWindow.css({"background-size":a.largeWidth/a.newvalueheight+"px "+a.largeHeight/
|
||||
a.newvalueheight+"px"})):("lens"==a.options.zoomType&&a.zoomLens.css({"background-size":a.largeWidth/a.newvaluewidth+"px "+a.largeHeight/a.newvaluewidth+"px"}),a.largeHeight/a.newvaluewidth<a.options.zoomWindowHeight?a.zoomWindow.css({"background-size":a.largeWidth/a.newvaluewidth+"px "+a.largeHeight/a.newvaluewidth+"px"}):a.zoomWindow.css({"background-size":a.largeWidth/a.newvalueheight+"px "+a.largeHeight/a.newvalueheight+"px"})),a.changeBgSize=!1),a.zoomWindow.css({backgroundPosition:a.windowLeftPos+
|
||||
"px "+a.windowTopPos+"px"}))},setTintPosition:function(b){this.nzOffset=this.$elem.offset();this.tintpos=String(-1*(b.pageX-this.nzOffset.left-this.zoomLens.width()/2));this.tintposy=String(-1*(b.pageY-this.nzOffset.top-this.zoomLens.height()/2));this.Etoppos&&(this.tintposy=0);this.Eloppos&&(this.tintpos=0);this.Eboppos&&(this.tintposy=-1*(this.nzHeight-this.zoomLens.height()-2*this.options.lensBorderSize));this.Eroppos&&(this.tintpos=-1*(this.nzWidth-this.zoomLens.width()-2*this.options.lensBorderSize));
|
||||
this.options.tint&&(this.fullheight&&(this.tintposy=0),this.fullwidth&&(this.tintpos=0),this.zoomTintImage.css({left:this.tintpos+"px"}),this.zoomTintImage.css({top:this.tintposy+"px"}))},swaptheimage:function(b,a){var c=this,e=new Image;c.options.loadingIcon&&(c.spinner=d("<div style=\"background: url('"+c.options.loadingIcon+"') no-repeat center;height:"+c.nzHeight+"px;width:"+c.nzWidth+'px;z-index: 2000;position: absolute; background-position: center center;"></div>'),c.$elem.after(c.spinner));
|
||||
c.options.onImageSwap(c.$elem);e.onload=function(){c.largeWidth=e.width;c.largeHeight=e.height;c.zoomImage=a;c.zoomWindow.css({"background-size":c.largeWidth+"px "+c.largeHeight+"px"});c.zoomWindow.css({"background-size":c.largeWidth+"px "+c.largeHeight+"px"});c.swapAction(b,a)};e.src=a},swapAction:function(b,a){var c=this,e=new Image;e.onload=function(){c.nzHeight=e.height;c.nzWidth=e.width;c.options.onImageSwapComplete(c.$elem);c.doneCallback()};e.src=b;c.currentZoomLevel=c.options.zoomLevel;c.options.maxZoomLevel=
|
||||
!1;"lens"==c.options.zoomType&&c.zoomLens.css({backgroundImage:"url('"+a+"')"});"window"==c.options.zoomType&&c.zoomWindow.css({backgroundImage:"url('"+a+"')"});"inner"==c.options.zoomType&&c.zoomWindow.css({backgroundImage:"url('"+a+"')"});c.currentImage=a;if(c.options.imageCrossfade){var f=c.$elem,g=f.clone();c.$elem.attr("src",b);c.$elem.after(g);g.stop(!0).fadeOut(c.options.imageCrossfade,function(){d(this).remove()});c.$elem.width("auto").removeAttr("width");c.$elem.height("auto").removeAttr("height");
|
||||
f.fadeIn(c.options.imageCrossfade);c.options.tint&&"inner"!=c.options.zoomType&&(f=c.zoomTintImage,g=f.clone(),c.zoomTintImage.attr("src",a),c.zoomTintImage.after(g),g.stop(!0).fadeOut(c.options.imageCrossfade,function(){d(this).remove()}),f.fadeIn(c.options.imageCrossfade),c.zoomTint.css({height:c.$elem.height()}),c.zoomTint.css({width:c.$elem.width()}));c.zoomContainer.css("height",c.$elem.height());c.zoomContainer.css("width",c.$elem.width());"inner"!=c.options.zoomType||c.options.constrainType||
|
||||
(c.zoomWrap.parent().css("height",c.$elem.height()),c.zoomWrap.parent().css("width",c.$elem.width()),c.zoomWindow.css("height",c.$elem.height()),c.zoomWindow.css("width",c.$elem.width()))}else c.$elem.attr("src",b),c.options.tint&&(c.zoomTintImage.attr("src",a),c.zoomTintImage.attr("height",c.$elem.height()),c.zoomTintImage.css({height:c.$elem.height()}),c.zoomTint.css({height:c.$elem.height()})),c.zoomContainer.css("height",c.$elem.height()),c.zoomContainer.css("width",c.$elem.width());c.options.imageCrossfade&&
|
||||
(c.zoomWrap.css("height",c.$elem.height()),c.zoomWrap.css("width",c.$elem.width()));c.options.constrainType&&("height"==c.options.constrainType&&(c.zoomContainer.css("height",c.options.constrainSize),c.zoomContainer.css("width","auto"),c.options.imageCrossfade?(c.zoomWrap.css("height",c.options.constrainSize),c.zoomWrap.css("width","auto"),c.constwidth=c.zoomWrap.width()):(c.$elem.css("height",c.options.constrainSize),c.$elem.css("width","auto"),c.constwidth=c.$elem.width()),"inner"==c.options.zoomType&&
|
||||
(c.zoomWrap.parent().css("height",c.options.constrainSize),c.zoomWrap.parent().css("width",c.constwidth),c.zoomWindow.css("height",c.options.constrainSize),c.zoomWindow.css("width",c.constwidth)),c.options.tint&&(c.tintContainer.css("height",c.options.constrainSize),c.tintContainer.css("width",c.constwidth),c.zoomTint.css("height",c.options.constrainSize),c.zoomTint.css("width",c.constwidth),c.zoomTintImage.css("height",c.options.constrainSize),c.zoomTintImage.css("width",c.constwidth))),"width"==
|
||||
c.options.constrainType&&(c.zoomContainer.css("height","auto"),c.zoomContainer.css("width",c.options.constrainSize),c.options.imageCrossfade?(c.zoomWrap.css("height","auto"),c.zoomWrap.css("width",c.options.constrainSize),c.constheight=c.zoomWrap.height()):(c.$elem.css("height","auto"),c.$elem.css("width",c.options.constrainSize),c.constheight=c.$elem.height()),"inner"==c.options.zoomType&&(c.zoomWrap.parent().css("height",c.constheight),c.zoomWrap.parent().css("width",c.options.constrainSize),c.zoomWindow.css("height",
|
||||
c.constheight),c.zoomWindow.css("width",c.options.constrainSize)),c.options.tint&&(c.tintContainer.css("height",c.constheight),c.tintContainer.css("width",c.options.constrainSize),c.zoomTint.css("height",c.constheight),c.zoomTint.css("width",c.options.constrainSize),c.zoomTintImage.css("height",c.constheight),c.zoomTintImage.css("width",c.options.constrainSize))))},doneCallback:function(){this.options.loadingIcon&&this.spinner.hide();this.nzOffset=this.$elem.offset();this.nzWidth=this.$elem.width();
|
||||
this.nzHeight=this.$elem.height();this.currentZoomLevel=this.options.zoomLevel;this.widthRatio=this.largeWidth/this.nzWidth;this.heightRatio=this.largeHeight/this.nzHeight;"window"==this.options.zoomType&&(lensHeight=this.nzHeight<this.options.zoomWindowWidth/this.widthRatio?this.nzHeight:String(this.options.zoomWindowHeight/this.heightRatio),lensWidth=this.options.zoomWindowWidth<this.options.zoomWindowWidth?this.nzWidth:this.options.zoomWindowWidth/this.widthRatio,this.zoomLens&&(this.zoomLens.css("width",
|
||||
lensWidth),this.zoomLens.css("height",lensHeight)))},getCurrentImage:function(){return this.zoomImage},getGalleryList:function(){var b=this;b.gallerylist=[];b.options.gallery?d("#"+b.options.gallery+" a").each(function(){var a="";d(this).data("zoom-image")?a=d(this).data("zoom-image"):d(this).data("image")&&(a=d(this).data("image"));a==b.zoomImage?b.gallerylist.unshift({href:""+a+"",title:d(this).find("img").attr("title")}):b.gallerylist.push({href:""+a+"",title:d(this).find("img").attr("title")})}):
|
||||
b.gallerylist.push({href:""+b.zoomImage+"",title:d(this).find("img").attr("title")});return b.gallerylist},changeZoomLevel:function(b){this.scrollingLock=!0;this.newvalue=parseFloat(b).toFixed(2);newvalue=parseFloat(b).toFixed(2);maxheightnewvalue=this.largeHeight/(this.options.zoomWindowHeight/this.nzHeight*this.nzHeight);maxwidthtnewvalue=this.largeWidth/(this.options.zoomWindowWidth/this.nzWidth*this.nzWidth);"inner"!=this.options.zoomType&&(maxheightnewvalue<=newvalue?(this.heightRatio=this.largeHeight/
|
||||
maxheightnewvalue/this.nzHeight,this.newvalueheight=maxheightnewvalue,this.fullheight=!0):(this.heightRatio=this.largeHeight/newvalue/this.nzHeight,this.newvalueheight=newvalue,this.fullheight=!1),maxwidthtnewvalue<=newvalue?(this.widthRatio=this.largeWidth/maxwidthtnewvalue/this.nzWidth,this.newvaluewidth=maxwidthtnewvalue,this.fullwidth=!0):(this.widthRatio=this.largeWidth/newvalue/this.nzWidth,this.newvaluewidth=newvalue,this.fullwidth=!1),"lens"==this.options.zoomType&&(maxheightnewvalue<=newvalue?
|
||||
(this.fullwidth=!0,this.newvaluewidth=maxheightnewvalue):(this.widthRatio=this.largeWidth/newvalue/this.nzWidth,this.newvaluewidth=newvalue,this.fullwidth=!1)));"inner"==this.options.zoomType&&(maxheightnewvalue=parseFloat(this.largeHeight/this.nzHeight).toFixed(2),maxwidthtnewvalue=parseFloat(this.largeWidth/this.nzWidth).toFixed(2),newvalue>maxheightnewvalue&&(newvalue=maxheightnewvalue),newvalue>maxwidthtnewvalue&&(newvalue=maxwidthtnewvalue),maxheightnewvalue<=newvalue?(this.heightRatio=this.largeHeight/
|
||||
newvalue/this.nzHeight,this.newvalueheight=newvalue>maxheightnewvalue?maxheightnewvalue:newvalue,this.fullheight=!0):(this.heightRatio=this.largeHeight/newvalue/this.nzHeight,this.newvalueheight=newvalue>maxheightnewvalue?maxheightnewvalue:newvalue,this.fullheight=!1),maxwidthtnewvalue<=newvalue?(this.widthRatio=this.largeWidth/newvalue/this.nzWidth,this.newvaluewidth=newvalue>maxwidthtnewvalue?maxwidthtnewvalue:newvalue,this.fullwidth=!0):(this.widthRatio=this.largeWidth/newvalue/this.nzWidth,this.newvaluewidth=
|
||||
newvalue,this.fullwidth=!1));scrcontinue=!1;"inner"==this.options.zoomType&&(this.nzWidth>this.nzHeight&&(this.newvaluewidth<=maxwidthtnewvalue?scrcontinue=!0:(scrcontinue=!1,this.fullwidth=this.fullheight=!0)),this.nzHeight>this.nzWidth&&(this.newvaluewidth<=maxwidthtnewvalue?scrcontinue=!0:(scrcontinue=!1,this.fullwidth=this.fullheight=!0)));"inner"!=this.options.zoomType&&(scrcontinue=!0);scrcontinue&&(this.zoomLock=0,this.changeZoom=!0,this.options.zoomWindowHeight/this.heightRatio<=this.nzHeight&&
|
||||
(this.currentZoomLevel=this.newvalueheight,"lens"!=this.options.zoomType&&"inner"!=this.options.zoomType&&(this.changeBgSize=!0,this.zoomLens.css({height:String(this.options.zoomWindowHeight/this.heightRatio)+"px"})),"lens"==this.options.zoomType||"inner"==this.options.zoomType)&&(this.changeBgSize=!0),this.options.zoomWindowWidth/this.widthRatio<=this.nzWidth&&("inner"!=this.options.zoomType&&this.newvaluewidth>this.newvalueheight&&(this.currentZoomLevel=this.newvaluewidth),"lens"!=this.options.zoomType&&
|
||||
"inner"!=this.options.zoomType&&(this.changeBgSize=!0,this.zoomLens.css({width:String(this.options.zoomWindowWidth/this.widthRatio)+"px"})),"lens"==this.options.zoomType||"inner"==this.options.zoomType)&&(this.changeBgSize=!0),"inner"==this.options.zoomType&&(this.changeBgSize=!0,this.nzWidth>this.nzHeight&&(this.currentZoomLevel=this.newvaluewidth),this.nzHeight>this.nzWidth&&(this.currentZoomLevel=this.newvaluewidth)));this.setPosition(this.currentLoc)},closeAll:function(){self.zoomWindow&&self.zoomWindow.hide();
|
||||
self.zoomLens&&self.zoomLens.hide();self.zoomTint&&self.zoomTint.hide()},changeState:function(b){"enable"==b&&(this.options.zoomEnabled=!0);"disable"==b&&(this.options.zoomEnabled=!1)}};d.fn.elevateZoom=function(b){return this.each(function(){var a=Object.create(k);a.init(b,this);d.data(this,"elevateZoom",a)})};d.fn.elevateZoom.options={zoomActivation:"hover",zoomEnabled:!0,preloading:1,zoomLevel:1,scrollZoom:!1,scrollZoomIncrement:0.1,minZoomLevel:!1,maxZoomLevel:!1,easing:!1,easingAmount:12,lensSize:200,
|
||||
zoomWindowWidth:400,zoomWindowHeight:400,zoomWindowOffetx:0,zoomWindowOffety:0,zoomWindowPosition:1,zoomWindowBgColour:"#fff",lensFadeIn:!1,lensFadeOut:!1,debug:!1,zoomWindowFadeIn:!1,zoomWindowFadeOut:!1,zoomWindowAlwaysShow:!1,zoomTintFadeIn:!1,zoomTintFadeOut:!1,borderSize:4,showLens:!0,borderColour:"#888",lensBorderSize:1,lensBorderColour:"#000",lensShape:"square",zoomType:"window",containLensZoom:!1,lensColour:"white",lensOpacity:0.4,lenszoom:!1,tint:!1,tintColour:"#333",tintOpacity:0.4,gallery:!1,
|
||||
galleryActiveClass:"zoomGalleryActive",imageCrossfade:!1,constrainType:!1,constrainSize:!1,loadingIcon:!1,cursor:"default",responsive:!0,onComplete:d.noop,onZoomedImageLoaded:function(){},onImageSwap:d.noop,onImageSwapComplete:d.noop}})(jQuery,window,document);
|
||||
3159
modules/appagebuilder/views/js/jquery.fullPage.js
Normal file
3159
modules/appagebuilder/views/js/jquery.fullPage.js
Normal file
File diff suppressed because it is too large
Load Diff
40
modules/appagebuilder/views/js/jquery.infinitescroll.min.js
vendored
Normal file
40
modules/appagebuilder/views/js/jquery.infinitescroll.min.js
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* @Website: apollotheme.com - prestashop template provider
|
||||
* @author Apollotheme <apollotheme@gmail.com>
|
||||
* @copyright Apollotheme
|
||||
* @description:
|
||||
*/
|
||||
(function(window,$,undefined){$.infinitescroll=function infscr(options,callback,element){this.element=$(element);this._create(options,callback);};$.infinitescroll.defaults={loading:{finished:undefined,finishedMsg:"<em>Congratulations, you've reached the end of the internet.</em>",img:"http://www.infinite-scroll.com/loading.gif",msg:null,msgText:"<em>Loading the next set of posts...</em>",selector:null,speed:'fast',start:undefined},state:{isDuringAjax:false,isInvalidPage:false,isDestroyed:false,isDone:false,isPaused:false,currPage:1},callback:undefined,debug:false,behavior:undefined,binder:$(window),nextSelector:"div.navigation a:first",navSelector:"div.navigation",contentSelector:null,extraScrollPx:150,itemSelector:"div.post",animate:false,pathParse:undefined,dataType:'html',appendCallback:true,bufferPx:40,errorCallback:function(){},infid:0,pixelsFromNavToBottom:undefined,path:undefined};$.infinitescroll.prototype={_binding:function infscr_binding(binding){var instance=this,opts=instance.options;if(!!opts.behavior&&this['_binding_'+opts.behavior]!==undefined){this['_binding_'+opts.behavior].call(this);return;}
|
||||
if(binding!=='bind'&&binding!=='unbind'){this._debug('Binding value '+binding+' not valid')
|
||||
return false;}
|
||||
if(binding=='unbind'){(this.options.binder).unbind('smartscroll.infscr.'+instance.options.infid);}else{(this.options.binder)[binding]('smartscroll.infscr.'+instance.options.infid,function(){instance.scroll();});};this._debug('Binding',binding);},_create:function infscr_create(options,callback){if(!this._validate(options)){return false;}
|
||||
var opts=this.options=$.extend(true,{},$.infinitescroll.defaults,options),relurl=/(.*?\/\/).*?(\/.*)/,path=$(opts.nextSelector).attr('href');opts.contentSelector=opts.contentSelector||this.element;opts.loading.selector=opts.loading.selector||opts.contentSelector;if(!path){this._debug('Navigation selector not found');return;}
|
||||
opts.path=this._determinepath(path);opts.loading.msg=$('<div id="infscr-loading"><img alt="Loading..." src="'+opts.loading.img+'" /><div>'+opts.loading.msgText+'</div></div>');(new Image()).src=opts.loading.img;opts.pixelsFromNavToBottom=$(document).height()-$(opts.navSelector).offset().top;opts.loading.start=opts.loading.start||function(){$(opts.navSelector).hide();opts.loading.msg.appendTo(opts.loading.selector).show(opts.loading.speed,function(){beginAjax(opts);});};opts.loading.finished=opts.loading.finished||function(){opts.loading.msg.fadeOut('normal');};opts.callback=function(instance,data){if(!!opts.behavior&&instance['_callback_'+opts.behavior]!==undefined){instance['_callback_'+opts.behavior].call($(opts.contentSelector)[0],data);}
|
||||
if(callback){callback.call($(opts.contentSelector)[0],data);}};this._setup();},_debug:function infscr_debug(){if(this.options.debug){return window.console&&console.log.call(console,arguments);}},_determinepath:function infscr_determinepath(path){var opts=this.options;if(!!opts.behavior&&this['_determinepath_'+opts.behavior]!==undefined){this['_determinepath_'+opts.behavior].call(this,path);return;}
|
||||
if(!!opts.pathParse){this._debug('pathParse manual');return opts.pathParse;}else if(path.match(/^(.*?)\b2\b(.*?$)/)){path=path.match(/^(.*?)\b2\b(.*?$)/).slice(1);}else if(path.match(/^(.*?)2(.*?$)/)){if(path.match(/^(.*?page=)2(\/.*|$)/)){path=path.match(/^(.*?page=)2(\/.*|$)/).slice(1);return path;}
|
||||
path=path.match(/^(.*?)2(.*?$)/).slice(1);}else{if(path.match(/^(.*?page=)1(\/.*|$)/)){path=path.match(/^(.*?page=)1(\/.*|$)/).slice(1);return path;}else{this._debug('Sorry, we couldn\'t parse your Next (Previous Posts) URL. Verify your the css selector points to the correct A tag. If you still get this error: yell, scream, and kindly ask for help at infinite-scroll.com.');opts.state.isInvalidPage=true;}}
|
||||
this._debug('determinePath',path);return path;},_error:function infscr_error(xhr){var opts=this.options;if(!!opts.behavior&&this['_error_'+opts.behavior]!==undefined){this['_error_'+opts.behavior].call(this,xhr);return;}
|
||||
if(xhr!=='destroy'&&xhr!=='end'){xhr='unknown';}
|
||||
this._debug('Error',xhr);if(xhr=='end'){this._showdonemsg();}
|
||||
opts.state.isDone=true;opts.state.currPage=1;opts.state.isPaused=false;this._binding('unbind');},_loadcallback:function infscr_loadcallback(box,data){var opts=this.options,callback=this.options.callback,result=(opts.state.isDone)?'done':(!opts.appendCallback)?'no-append':'append',frag;if(!!opts.behavior&&this['_loadcallback_'+opts.behavior]!==undefined){this['_loadcallback_'+opts.behavior].call(this,box,data);return;}
|
||||
switch(result){case'done':this._showdonemsg();return false;break;case'no-append':if(opts.dataType=='html'){data='<div>'+data+'</div>';data=$(data).find(opts.itemSelector);};break;case'append':var children=box.children();if(children.length==0){return this._error('end');}
|
||||
frag=document.createDocumentFragment();while(box[0].firstChild){frag.appendChild(box[0].firstChild);}
|
||||
this._debug('contentSelector',$(opts.contentSelector)[0])
|
||||
$(opts.contentSelector)[0].appendChild(frag);data=children.get();break;}
|
||||
opts.loading.finished.call($(opts.contentSelector)[0],opts)
|
||||
if(opts.animate){var scrollTo=$(window).scrollTop()+$('#infscr-loading').height()+opts.extraScrollPx+'px';$('html,body').animate({scrollTop:scrollTo},800,function(){opts.state.isDuringAjax=false;});}
|
||||
if(!opts.animate)opts.state.isDuringAjax=false;callback(this,data);},_nearbottom:function infscr_nearbottom(){var opts=this.options,pixelsFromWindowBottomToBottom=0+$(document).height()-(opts.binder.scrollTop())-$(window).height();if(!!opts.behavior&&this['_nearbottom_'+opts.behavior]!==undefined){this['_nearbottom_'+opts.behavior].call(this);return;}
|
||||
this._debug('math:',pixelsFromWindowBottomToBottom,opts.pixelsFromNavToBottom);return(pixelsFromWindowBottomToBottom-opts.bufferPx<opts.pixelsFromNavToBottom);},_pausing:function infscr_pausing(pause){var opts=this.options;if(!!opts.behavior&&this['_pausing_'+opts.behavior]!==undefined){this['_pausing_'+opts.behavior].call(this,pause);return;}
|
||||
if(pause!=='pause'&&pause!=='resume'&&pause!==null){this._debug('Invalid argument. Toggling pause value instead');};pause=(pause&&(pause=='pause'||pause=='resume'))?pause:'toggle';switch(pause){case'pause':opts.state.isPaused=true;break;case'resume':opts.state.isPaused=false;break;case'toggle':opts.state.isPaused=!opts.state.isPaused;break;}
|
||||
this._debug('Paused',opts.state.isPaused);return false;},_setup:function infscr_setup(){var opts=this.options;if(!!opts.behavior&&this['_setup_'+opts.behavior]!==undefined){this['_setup_'+opts.behavior].call(this);return;}
|
||||
this._binding('bind');return false;},_showdonemsg:function infscr_showdonemsg(){var opts=this.options;if(!!opts.behavior&&this['_showdonemsg_'+opts.behavior]!==undefined){this['_showdonemsg_'+opts.behavior].call(this);return;}
|
||||
opts.loading.msg.find('img').hide().parent().find('div').html(opts.loading.finishedMsg).animate({opacity:1},2000,function(){$(this).parent().fadeOut('normal');});opts.errorCallback.call($(opts.contentSelector)[0],'done');},_validate:function infscr_validate(opts){for(var key in opts){if(key.indexOf&&key.indexOf('Selector')>-1&&$(opts[key]).length===0){this._debug('Your '+key+' found no elements.');return false;}
|
||||
return true;}},bind:function infscr_bind(){this._binding('bind');},destroy:function infscr_destroy(){this.options.state.isDestroyed=true;return this._error('destroy');},pause:function infscr_pause(){this._pausing('pause');},resume:function infscr_resume(){this._pausing('resume');},retrieve:function infscr_retrieve(pageNum){var instance=this,opts=instance.options,path=opts.path,box,frag,desturl,method,condition,pageNum=pageNum||null,getPage=(!!pageNum)?pageNum:opts.state.currPage;beginAjax=function infscr_ajax(opts){opts.state.currPage++;instance._debug('heading into ajax',path);box=$(opts.contentSelector).is('table')?$('<tbody/>'):$('<div/>');desturl=path.join(opts.state.currPage);method=(opts.dataType=='html'||opts.dataType=='json')?opts.dataType:'html+callback';if(opts.appendCallback&&opts.dataType=='html')method+='+callback'
|
||||
switch(method){case'html+callback':instance._debug('Using HTML via .load() method');box.load(desturl+' '+opts.itemSelector,null,function infscr_ajax_callback(responseText){instance._loadcallback(box,responseText);});break;case'html':case'json':instance._debug('Using '+(method.toUpperCase())+' via $.ajax() method');$.ajax({url:desturl,dataType:opts.dataType,complete:function infscr_ajax_callback(jqXHR,textStatus){condition=(typeof(jqXHR.isResolved)!=='undefined')?(jqXHR.isResolved()):(textStatus==="success"||textStatus==="notmodified");(condition)?instance._loadcallback(box,jqXHR.responseText):instance._error('end');}});break;}};if(!!opts.behavior&&this['retrieve_'+opts.behavior]!==undefined){this['retrieve_'+opts.behavior].call(this,pageNum);return;}
|
||||
if(opts.state.isDestroyed){this._debug('Instance is destroyed');return false;};opts.state.isDuringAjax=true;opts.loading.start.call($(opts.contentSelector)[0],opts);},scroll:function infscr_scroll(){var opts=this.options,state=opts.state;if(!!opts.behavior&&this['scroll_'+opts.behavior]!==undefined){this['scroll_'+opts.behavior].call(this);return;}
|
||||
if(state.isDuringAjax||state.isInvalidPage||state.isDone||state.isDestroyed||state.isPaused)return;if(!this._nearbottom())return;this.retrieve();},toggle:function infscr_toggle(){this._pausing();},unbind:function infscr_unbind(){this._binding('unbind');},update:function infscr_options(key){if($.isPlainObject(key)){this.options=$.extend(true,this.options,key);}}}
|
||||
$.fn.infinitescroll=function infscr_init(options,callback){var thisCall=typeof options;switch(thisCall){case'string':var args=Array.prototype.slice.call(arguments,1);this.each(function(){var instance=$.data(this,'infinitescroll');if(!instance){return false;}
|
||||
if(!$.isFunction(instance[options])||options.charAt(0)==="_"){return false;}
|
||||
instance[options].apply(instance,args);});break;case'object':this.each(function(){var instance=$.data(this,'infinitescroll');if(instance){instance.update(options);}else{$.data(this,'infinitescroll',new $.infinitescroll(options,callback,this));}});break;}
|
||||
return this;};var event=$.event,scrollTimeout;event.special.smartscroll={setup:function(){$(this).bind("scroll",event.special.smartscroll.handler);},teardown:function(){$(this).unbind("scroll",event.special.smartscroll.handler);},handler:function(event,execAsap){var context=this,args=arguments;event.type="smartscroll";if(scrollTimeout){clearTimeout(scrollTimeout);}
|
||||
scrollTimeout=setTimeout(function(){$.event.handle.apply(context,args);},execAsap==="execAsap"?0:100);}};$.fn.smartscroll=function(fn){return fn?this.bind("smartscroll",fn):this.trigger("smartscroll",["execAsap"]);};})(window,jQuery);
|
||||
660
modules/appagebuilder/views/js/jquery.stellar.js
Normal file
660
modules/appagebuilder/views/js/jquery.stellar.js
Normal file
@@ -0,0 +1,660 @@
|
||||
/*!
|
||||
* Stellar.js v0.6.2
|
||||
* http://markdalgleish.com/projects/stellar.js
|
||||
*
|
||||
* Copyright 2014, Mark Dalgleish
|
||||
* This content is released under the MIT license
|
||||
* http://markdalgleish.mit-license.org
|
||||
*/
|
||||
|
||||
;(function($, window, document, undefined) {
|
||||
|
||||
var pluginName = 'stellar',
|
||||
defaults = {
|
||||
scrollProperty: 'scroll',
|
||||
positionProperty: 'position',
|
||||
horizontalScrolling: true,
|
||||
verticalScrolling: true,
|
||||
horizontalOffset: 0,
|
||||
verticalOffset: 0,
|
||||
responsive: false,
|
||||
parallaxBackgrounds: true,
|
||||
parallaxElements: true,
|
||||
hideDistantElements: true,
|
||||
hideElement: function($elem) { $elem.hide(); },
|
||||
showElement: function($elem) { $elem.show(); }
|
||||
},
|
||||
|
||||
scrollProperty = {
|
||||
scroll: {
|
||||
getLeft: function($elem) { return $elem.scrollLeft(); },
|
||||
setLeft: function($elem, val) { $elem.scrollLeft(val); },
|
||||
|
||||
getTop: function($elem) { return $elem.scrollTop(); },
|
||||
setTop: function($elem, val) { $elem.scrollTop(val); }
|
||||
},
|
||||
position: {
|
||||
getLeft: function($elem) { return parseInt($elem.css('left'), 10) * -1; },
|
||||
getTop: function($elem) { return parseInt($elem.css('top'), 10) * -1; }
|
||||
},
|
||||
margin: {
|
||||
getLeft: function($elem) { return parseInt($elem.css('margin-left'), 10) * -1; },
|
||||
getTop: function($elem) { return parseInt($elem.css('margin-top'), 10) * -1; }
|
||||
},
|
||||
transform: {
|
||||
getLeft: function($elem) {
|
||||
var computedTransform = getComputedStyle($elem[0])[prefixedTransform];
|
||||
return (computedTransform !== 'none' ? parseInt(computedTransform.match(/(-?[0-9]+)/g)[4], 10) * -1 : 0);
|
||||
},
|
||||
getTop: function($elem) {
|
||||
var computedTransform = getComputedStyle($elem[0])[prefixedTransform];
|
||||
return (computedTransform !== 'none' ? parseInt(computedTransform.match(/(-?[0-9]+)/g)[5], 10) * -1 : 0);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
positionProperty = {
|
||||
position: {
|
||||
setLeft: function($elem, left) { $elem.css('left', left); },
|
||||
setTop: function($elem, top) { $elem.css('top', top); }
|
||||
},
|
||||
transform: {
|
||||
setPosition: function($elem, left, startingLeft, top, startingTop) {
|
||||
$elem[0].style[prefixedTransform] = 'translate3d(' + (left - startingLeft) + 'px, ' + (top - startingTop) + 'px, 0)';
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// Returns a function which adds a vendor prefix to any CSS property name
|
||||
vendorPrefix = (function() {
|
||||
var prefixes = /^(Moz|Webkit|Khtml|O|ms|Icab)(?=[A-Z])/,
|
||||
style = $('script')[0].style,
|
||||
prefix = '',
|
||||
prop;
|
||||
|
||||
for (prop in style) {
|
||||
if (prefixes.test(prop)) {
|
||||
prefix = prop.match(prefixes)[0];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ('WebkitOpacity' in style) { prefix = 'Webkit'; }
|
||||
if ('KhtmlOpacity' in style) { prefix = 'Khtml'; }
|
||||
|
||||
return function(property) {
|
||||
return prefix + (prefix.length > 0 ? property.charAt(0).toUpperCase() + property.slice(1) : property);
|
||||
};
|
||||
}()),
|
||||
|
||||
prefixedTransform = vendorPrefix('transform'),
|
||||
|
||||
supportsBackgroundPositionXY = $('<div />', { style: 'background:#fff' }).css('background-position-x') !== undefined,
|
||||
|
||||
setBackgroundPosition = (supportsBackgroundPositionXY ?
|
||||
function($elem, x, y) {
|
||||
$elem.css({
|
||||
'background-position-x': x,
|
||||
'background-position-y': y
|
||||
});
|
||||
} :
|
||||
function($elem, x, y) {
|
||||
$elem.css('background-position', x + ' ' + y);
|
||||
}
|
||||
),
|
||||
|
||||
getBackgroundPosition = (supportsBackgroundPositionXY ?
|
||||
function($elem) {
|
||||
return [
|
||||
$elem.css('background-position-x'),
|
||||
$elem.css('background-position-y')
|
||||
];
|
||||
} :
|
||||
function($elem) {
|
||||
return $elem.css('background-position').split(' ');
|
||||
}
|
||||
),
|
||||
|
||||
requestAnimFrame = (
|
||||
window.requestAnimationFrame ||
|
||||
window.webkitRequestAnimationFrame ||
|
||||
window.mozRequestAnimationFrame ||
|
||||
window.oRequestAnimationFrame ||
|
||||
window.msRequestAnimationFrame ||
|
||||
function(callback) {
|
||||
setTimeout(callback, 1000 / 60);
|
||||
}
|
||||
);
|
||||
|
||||
function Plugin(element, options) {
|
||||
this.element = element;
|
||||
this.options = $.extend({}, defaults, options);
|
||||
|
||||
this._defaults = defaults;
|
||||
this._name = pluginName;
|
||||
|
||||
this.init();
|
||||
}
|
||||
|
||||
Plugin.prototype = {
|
||||
init: function() {
|
||||
this.options.name = pluginName + '_' + Math.floor(Math.random() * 1e9);
|
||||
|
||||
this._defineElements();
|
||||
this._defineGetters();
|
||||
this._defineSetters();
|
||||
this._handleWindowLoadAndResize();
|
||||
this._detectViewport();
|
||||
|
||||
this.refresh({ firstLoad: true });
|
||||
|
||||
if (this.options.scrollProperty === 'scroll') {
|
||||
this._handleScrollEvent();
|
||||
} else {
|
||||
this._startAnimationLoop();
|
||||
}
|
||||
},
|
||||
_defineElements: function() {
|
||||
if (this.element === document.body) this.element = window;
|
||||
this.$scrollElement = $(this.element);
|
||||
this.$element = (this.element === window ? $('body') : this.$scrollElement);
|
||||
this.$viewportElement = (this.options.viewportElement !== undefined ? $(this.options.viewportElement) : (this.$scrollElement[0] === window || this.options.scrollProperty === 'scroll' ? this.$scrollElement : this.$scrollElement.parent()) );
|
||||
},
|
||||
_defineGetters: function() {
|
||||
var self = this,
|
||||
scrollPropertyAdapter = scrollProperty[self.options.scrollProperty];
|
||||
|
||||
this._getScrollLeft = function() {
|
||||
return scrollPropertyAdapter.getLeft(self.$scrollElement);
|
||||
};
|
||||
|
||||
this._getScrollTop = function() {
|
||||
return scrollPropertyAdapter.getTop(self.$scrollElement);
|
||||
};
|
||||
},
|
||||
_defineSetters: function() {
|
||||
var self = this,
|
||||
scrollPropertyAdapter = scrollProperty[self.options.scrollProperty],
|
||||
positionPropertyAdapter = positionProperty[self.options.positionProperty],
|
||||
setScrollLeft = scrollPropertyAdapter.setLeft,
|
||||
setScrollTop = scrollPropertyAdapter.setTop;
|
||||
|
||||
this._setScrollLeft = (typeof setScrollLeft === 'function' ? function(val) {
|
||||
setScrollLeft(self.$scrollElement, val);
|
||||
} : $.noop);
|
||||
|
||||
this._setScrollTop = (typeof setScrollTop === 'function' ? function(val) {
|
||||
setScrollTop(self.$scrollElement, val);
|
||||
} : $.noop);
|
||||
|
||||
this._setPosition = positionPropertyAdapter.setPosition ||
|
||||
function($elem, left, startingLeft, top, startingTop) {
|
||||
if (self.options.horizontalScrolling) {
|
||||
positionPropertyAdapter.setLeft($elem, left, startingLeft);
|
||||
}
|
||||
|
||||
if (self.options.verticalScrolling) {
|
||||
positionPropertyAdapter.setTop($elem, top, startingTop);
|
||||
}
|
||||
};
|
||||
},
|
||||
_handleWindowLoadAndResize: function() {
|
||||
var self = this,
|
||||
$window = $(window);
|
||||
|
||||
if (self.options.responsive) {
|
||||
$window.bind('load.' + this.name, function() {
|
||||
self.refresh();
|
||||
});
|
||||
}
|
||||
|
||||
$window.bind('resize.' + this.name, function() {
|
||||
self._detectViewport();
|
||||
|
||||
if (self.options.responsive) {
|
||||
self.refresh();
|
||||
}
|
||||
});
|
||||
},
|
||||
refresh: function(options) {
|
||||
var self = this,
|
||||
oldLeft = self._getScrollLeft(),
|
||||
oldTop = self._getScrollTop();
|
||||
|
||||
if (!options || !options.firstLoad) {
|
||||
this._reset();
|
||||
}
|
||||
|
||||
this._setScrollLeft(0);
|
||||
this._setScrollTop(0);
|
||||
|
||||
this._setOffsets();
|
||||
this._findParticles();
|
||||
this._findBackgrounds();
|
||||
|
||||
// Fix for WebKit background rendering bug
|
||||
if (options && options.firstLoad && /WebKit/.test(navigator.userAgent)) {
|
||||
$(window).load(function() {
|
||||
var oldLeft = self._getScrollLeft(),
|
||||
oldTop = self._getScrollTop();
|
||||
|
||||
self._setScrollLeft(oldLeft + 1);
|
||||
self._setScrollTop(oldTop + 1);
|
||||
|
||||
self._setScrollLeft(oldLeft);
|
||||
self._setScrollTop(oldTop);
|
||||
});
|
||||
}
|
||||
|
||||
this._setScrollLeft(oldLeft);
|
||||
this._setScrollTop(oldTop);
|
||||
},
|
||||
_detectViewport: function() {
|
||||
var viewportOffsets = this.$viewportElement.offset(),
|
||||
hasOffsets = viewportOffsets !== null && viewportOffsets !== undefined;
|
||||
|
||||
this.viewportWidth = this.$viewportElement.width();
|
||||
this.viewportHeight = this.$viewportElement.height();
|
||||
|
||||
this.viewportOffsetTop = (hasOffsets ? viewportOffsets.top : 0);
|
||||
this.viewportOffsetLeft = (hasOffsets ? viewportOffsets.left : 0);
|
||||
},
|
||||
_findParticles: function() {
|
||||
var self = this,
|
||||
scrollLeft = this._getScrollLeft(),
|
||||
scrollTop = this._getScrollTop();
|
||||
|
||||
if (this.particles !== undefined) {
|
||||
for (var i = this.particles.length - 1; i >= 0; i--) {
|
||||
this.particles[i].$element.data('stellar-elementIsActive', undefined);
|
||||
}
|
||||
}
|
||||
|
||||
this.particles = [];
|
||||
|
||||
if (!this.options.parallaxElements) return;
|
||||
|
||||
this.$element.find('[data-stellar-ratio]').each(function(i) {
|
||||
var $this = $(this),
|
||||
horizontalOffset,
|
||||
verticalOffset,
|
||||
positionLeft,
|
||||
positionTop,
|
||||
marginLeft,
|
||||
marginTop,
|
||||
$offsetParent,
|
||||
offsetLeft,
|
||||
offsetTop,
|
||||
parentOffsetLeft = 0,
|
||||
parentOffsetTop = 0,
|
||||
tempParentOffsetLeft = 0,
|
||||
tempParentOffsetTop = 0;
|
||||
|
||||
// Ensure this element isn't already part of another scrolling element
|
||||
if (!$this.data('stellar-elementIsActive')) {
|
||||
$this.data('stellar-elementIsActive', this);
|
||||
} else if ($this.data('stellar-elementIsActive') !== this) {
|
||||
return;
|
||||
}
|
||||
|
||||
self.options.showElement($this);
|
||||
|
||||
// Save/restore the original top and left CSS values in case we refresh the particles or destroy the instance
|
||||
if (!$this.data('stellar-startingLeft')) {
|
||||
$this.data('stellar-startingLeft', $this.css('left'));
|
||||
$this.data('stellar-startingTop', $this.css('top'));
|
||||
} else {
|
||||
$this.css('left', $this.data('stellar-startingLeft'));
|
||||
$this.css('top', $this.data('stellar-startingTop'));
|
||||
}
|
||||
|
||||
positionLeft = $this.position().left;
|
||||
positionTop = $this.position().top;
|
||||
|
||||
// Catch-all for margin top/left properties (these evaluate to 'auto' in IE7 and IE8)
|
||||
marginLeft = ($this.css('margin-left') === 'auto') ? 0 : parseInt($this.css('margin-left'), 10);
|
||||
marginTop = ($this.css('margin-top') === 'auto') ? 0 : parseInt($this.css('margin-top'), 10);
|
||||
|
||||
offsetLeft = $this.offset().left - marginLeft;
|
||||
offsetTop = $this.offset().top - marginTop;
|
||||
|
||||
// Calculate the offset parent
|
||||
$this.parents().each(function() {
|
||||
var $this = $(this);
|
||||
|
||||
if ($this.data('stellar-offset-parent') === true) {
|
||||
parentOffsetLeft = tempParentOffsetLeft;
|
||||
parentOffsetTop = tempParentOffsetTop;
|
||||
$offsetParent = $this;
|
||||
|
||||
return false;
|
||||
} else {
|
||||
tempParentOffsetLeft += $this.position().left;
|
||||
tempParentOffsetTop += $this.position().top;
|
||||
}
|
||||
});
|
||||
|
||||
// Detect the offsets
|
||||
horizontalOffset = ($this.data('stellar-horizontal-offset') !== undefined ? $this.data('stellar-horizontal-offset') : ($offsetParent !== undefined && $offsetParent.data('stellar-horizontal-offset') !== undefined ? $offsetParent.data('stellar-horizontal-offset') : self.horizontalOffset));
|
||||
verticalOffset = ($this.data('stellar-vertical-offset') !== undefined ? $this.data('stellar-vertical-offset') : ($offsetParent !== undefined && $offsetParent.data('stellar-vertical-offset') !== undefined ? $offsetParent.data('stellar-vertical-offset') : self.verticalOffset));
|
||||
|
||||
// Add our object to the particles collection
|
||||
self.particles.push({
|
||||
$element: $this,
|
||||
$offsetParent: $offsetParent,
|
||||
isFixed: $this.css('position') === 'fixed',
|
||||
horizontalOffset: horizontalOffset,
|
||||
verticalOffset: verticalOffset,
|
||||
startingPositionLeft: positionLeft,
|
||||
startingPositionTop: positionTop,
|
||||
startingOffsetLeft: offsetLeft,
|
||||
startingOffsetTop: offsetTop,
|
||||
parentOffsetLeft: parentOffsetLeft,
|
||||
parentOffsetTop: parentOffsetTop,
|
||||
stellarRatio: ($this.data('stellar-ratio') !== undefined ? $this.data('stellar-ratio') : 1),
|
||||
width: $this.outerWidth(true),
|
||||
height: $this.outerHeight(true),
|
||||
isHidden: false
|
||||
});
|
||||
});
|
||||
},
|
||||
_findBackgrounds: function() {
|
||||
var self = this,
|
||||
scrollLeft = this._getScrollLeft(),
|
||||
scrollTop = this._getScrollTop(),
|
||||
$backgroundElements;
|
||||
|
||||
this.backgrounds = [];
|
||||
|
||||
if (!this.options.parallaxBackgrounds) return;
|
||||
|
||||
$backgroundElements = this.$element.find('[data-stellar-background-ratio]');
|
||||
|
||||
if (this.$element.data('stellar-background-ratio')) {
|
||||
$backgroundElements = $backgroundElements.add(this.$element);
|
||||
}
|
||||
|
||||
$backgroundElements.each(function() {
|
||||
var $this = $(this),
|
||||
backgroundPosition = getBackgroundPosition($this),
|
||||
horizontalOffset,
|
||||
verticalOffset,
|
||||
positionLeft,
|
||||
positionTop,
|
||||
marginLeft,
|
||||
marginTop,
|
||||
offsetLeft,
|
||||
offsetTop,
|
||||
$offsetParent,
|
||||
parentOffsetLeft = 0,
|
||||
parentOffsetTop = 0,
|
||||
tempParentOffsetLeft = 0,
|
||||
tempParentOffsetTop = 0;
|
||||
|
||||
// Ensure this element isn't already part of another scrolling element
|
||||
if (!$this.data('stellar-backgroundIsActive')) {
|
||||
$this.data('stellar-backgroundIsActive', this);
|
||||
} else if ($this.data('stellar-backgroundIsActive') !== this) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Save/restore the original top and left CSS values in case we destroy the instance
|
||||
if (!$this.data('stellar-backgroundStartingLeft')) {
|
||||
$this.data('stellar-backgroundStartingLeft', backgroundPosition[0]);
|
||||
$this.data('stellar-backgroundStartingTop', backgroundPosition[1]);
|
||||
} else {
|
||||
setBackgroundPosition($this, $this.data('stellar-backgroundStartingLeft'), $this.data('stellar-backgroundStartingTop'));
|
||||
}
|
||||
|
||||
// Catch-all for margin top/left properties (these evaluate to 'auto' in IE7 and IE8)
|
||||
marginLeft = ($this.css('margin-left') === 'auto') ? 0 : parseInt($this.css('margin-left'), 10);
|
||||
marginTop = ($this.css('margin-top') === 'auto') ? 0 : parseInt($this.css('margin-top'), 10);
|
||||
|
||||
offsetLeft = $this.offset().left - marginLeft - scrollLeft;
|
||||
offsetTop = $this.offset().top - marginTop - scrollTop;
|
||||
|
||||
// Calculate the offset parent
|
||||
$this.parents().each(function() {
|
||||
var $this = $(this);
|
||||
|
||||
if ($this.data('stellar-offset-parent') === true) {
|
||||
parentOffsetLeft = tempParentOffsetLeft;
|
||||
parentOffsetTop = tempParentOffsetTop;
|
||||
$offsetParent = $this;
|
||||
|
||||
return false;
|
||||
} else {
|
||||
tempParentOffsetLeft += $this.position().left;
|
||||
tempParentOffsetTop += $this.position().top;
|
||||
}
|
||||
});
|
||||
|
||||
// Detect the offsets
|
||||
horizontalOffset = ($this.data('stellar-horizontal-offset') !== undefined ? $this.data('stellar-horizontal-offset') : ($offsetParent !== undefined && $offsetParent.data('stellar-horizontal-offset') !== undefined ? $offsetParent.data('stellar-horizontal-offset') : self.horizontalOffset));
|
||||
verticalOffset = ($this.data('stellar-vertical-offset') !== undefined ? $this.data('stellar-vertical-offset') : ($offsetParent !== undefined && $offsetParent.data('stellar-vertical-offset') !== undefined ? $offsetParent.data('stellar-vertical-offset') : self.verticalOffset));
|
||||
|
||||
self.backgrounds.push({
|
||||
$element: $this,
|
||||
$offsetParent: $offsetParent,
|
||||
isFixed: $this.css('background-attachment') === 'fixed',
|
||||
horizontalOffset: horizontalOffset,
|
||||
verticalOffset: verticalOffset,
|
||||
startingValueLeft: backgroundPosition[0],
|
||||
startingValueTop: backgroundPosition[1],
|
||||
startingBackgroundPositionLeft: (isNaN(parseInt(backgroundPosition[0], 10)) ? 0 : parseInt(backgroundPosition[0], 10)),
|
||||
startingBackgroundPositionTop: (isNaN(parseInt(backgroundPosition[1], 10)) ? 0 : parseInt(backgroundPosition[1], 10)),
|
||||
startingPositionLeft: $this.position().left,
|
||||
startingPositionTop: $this.position().top,
|
||||
startingOffsetLeft: offsetLeft,
|
||||
startingOffsetTop: offsetTop,
|
||||
parentOffsetLeft: parentOffsetLeft,
|
||||
parentOffsetTop: parentOffsetTop,
|
||||
stellarRatio: ($this.data('stellar-background-ratio') === undefined ? 1 : $this.data('stellar-background-ratio'))
|
||||
});
|
||||
});
|
||||
},
|
||||
_reset: function() {
|
||||
var particle,
|
||||
startingPositionLeft,
|
||||
startingPositionTop,
|
||||
background,
|
||||
i;
|
||||
|
||||
for (i = this.particles.length - 1; i >= 0; i--) {
|
||||
particle = this.particles[i];
|
||||
startingPositionLeft = particle.$element.data('stellar-startingLeft');
|
||||
startingPositionTop = particle.$element.data('stellar-startingTop');
|
||||
|
||||
this._setPosition(particle.$element, startingPositionLeft, startingPositionLeft, startingPositionTop, startingPositionTop);
|
||||
|
||||
this.options.showElement(particle.$element);
|
||||
|
||||
particle.$element.data('stellar-startingLeft', null).data('stellar-elementIsActive', null).data('stellar-backgroundIsActive', null);
|
||||
}
|
||||
|
||||
for (i = this.backgrounds.length - 1; i >= 0; i--) {
|
||||
background = this.backgrounds[i];
|
||||
|
||||
background.$element.data('stellar-backgroundStartingLeft', null).data('stellar-backgroundStartingTop', null);
|
||||
|
||||
setBackgroundPosition(background.$element, background.startingValueLeft, background.startingValueTop);
|
||||
}
|
||||
},
|
||||
destroy: function() {
|
||||
this._reset();
|
||||
|
||||
this.$scrollElement.unbind('resize.' + this.name).unbind('scroll.' + this.name);
|
||||
this._animationLoop = $.noop;
|
||||
|
||||
$(window).unbind('load.' + this.name).unbind('resize.' + this.name);
|
||||
},
|
||||
_setOffsets: function() {
|
||||
var self = this,
|
||||
$window = $(window);
|
||||
|
||||
$window.unbind('resize.horizontal-' + this.name).unbind('resize.vertical-' + this.name);
|
||||
|
||||
if (typeof this.options.horizontalOffset === 'function') {
|
||||
this.horizontalOffset = this.options.horizontalOffset();
|
||||
$window.bind('resize.horizontal-' + this.name, function() {
|
||||
self.horizontalOffset = self.options.horizontalOffset();
|
||||
});
|
||||
} else {
|
||||
this.horizontalOffset = this.options.horizontalOffset;
|
||||
}
|
||||
|
||||
if (typeof this.options.verticalOffset === 'function') {
|
||||
this.verticalOffset = this.options.verticalOffset();
|
||||
$window.bind('resize.vertical-' + this.name, function() {
|
||||
self.verticalOffset = self.options.verticalOffset();
|
||||
});
|
||||
} else {
|
||||
this.verticalOffset = this.options.verticalOffset;
|
||||
}
|
||||
},
|
||||
_repositionElements: function() {
|
||||
var scrollLeft = this._getScrollLeft(),
|
||||
scrollTop = this._getScrollTop(),
|
||||
horizontalOffset,
|
||||
verticalOffset,
|
||||
particle,
|
||||
fixedRatioOffset,
|
||||
background,
|
||||
bgLeft,
|
||||
bgTop,
|
||||
isVisibleVertical = true,
|
||||
isVisibleHorizontal = true,
|
||||
newPositionLeft,
|
||||
newPositionTop,
|
||||
newOffsetLeft,
|
||||
newOffsetTop,
|
||||
i;
|
||||
|
||||
// First check that the scroll position or container size has changed
|
||||
if (this.currentScrollLeft === scrollLeft && this.currentScrollTop === scrollTop && this.currentWidth === this.viewportWidth && this.currentHeight === this.viewportHeight) {
|
||||
return;
|
||||
} else {
|
||||
this.currentScrollLeft = scrollLeft;
|
||||
this.currentScrollTop = scrollTop;
|
||||
this.currentWidth = this.viewportWidth;
|
||||
this.currentHeight = this.viewportHeight;
|
||||
}
|
||||
|
||||
// Reposition elements
|
||||
for (i = this.particles.length - 1; i >= 0; i--) {
|
||||
particle = this.particles[i];
|
||||
|
||||
fixedRatioOffset = (particle.isFixed ? 1 : 0);
|
||||
|
||||
// Calculate position, then calculate what the particle's new offset will be (for visibility check)
|
||||
if (this.options.horizontalScrolling) {
|
||||
newPositionLeft = (scrollLeft + particle.horizontalOffset + this.viewportOffsetLeft + particle.startingPositionLeft - particle.startingOffsetLeft + particle.parentOffsetLeft) * -(particle.stellarRatio + fixedRatioOffset - 1) + particle.startingPositionLeft;
|
||||
newOffsetLeft = newPositionLeft - particle.startingPositionLeft + particle.startingOffsetLeft;
|
||||
} else {
|
||||
newPositionLeft = particle.startingPositionLeft;
|
||||
newOffsetLeft = particle.startingOffsetLeft;
|
||||
}
|
||||
|
||||
if (this.options.verticalScrolling) {
|
||||
newPositionTop = (scrollTop + particle.verticalOffset + this.viewportOffsetTop + particle.startingPositionTop - particle.startingOffsetTop + particle.parentOffsetTop) * -(particle.stellarRatio + fixedRatioOffset - 1) + particle.startingPositionTop;
|
||||
newOffsetTop = newPositionTop - particle.startingPositionTop + particle.startingOffsetTop;
|
||||
} else {
|
||||
newPositionTop = particle.startingPositionTop;
|
||||
newOffsetTop = particle.startingOffsetTop;
|
||||
}
|
||||
|
||||
// Check visibility
|
||||
if (this.options.hideDistantElements) {
|
||||
isVisibleHorizontal = !this.options.horizontalScrolling || newOffsetLeft + particle.width > (particle.isFixed ? 0 : scrollLeft) && newOffsetLeft < (particle.isFixed ? 0 : scrollLeft) + this.viewportWidth + this.viewportOffsetLeft;
|
||||
isVisibleVertical = !this.options.verticalScrolling || newOffsetTop + particle.height > (particle.isFixed ? 0 : scrollTop) && newOffsetTop < (particle.isFixed ? 0 : scrollTop) + this.viewportHeight + this.viewportOffsetTop;
|
||||
}
|
||||
|
||||
if (isVisibleHorizontal && isVisibleVertical) {
|
||||
if (particle.isHidden) {
|
||||
this.options.showElement(particle.$element);
|
||||
particle.isHidden = false;
|
||||
}
|
||||
|
||||
this._setPosition(particle.$element, newPositionLeft, particle.startingPositionLeft, newPositionTop, particle.startingPositionTop);
|
||||
} else {
|
||||
if (!particle.isHidden) {
|
||||
this.options.hideElement(particle.$element);
|
||||
particle.isHidden = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Reposition backgrounds
|
||||
for (i = this.backgrounds.length - 1; i >= 0; i--) {
|
||||
background = this.backgrounds[i];
|
||||
|
||||
fixedRatioOffset = (background.isFixed ? 0 : 1);
|
||||
bgLeft = (this.options.horizontalScrolling ? (scrollLeft + background.horizontalOffset - this.viewportOffsetLeft - background.startingOffsetLeft + background.parentOffsetLeft - background.startingBackgroundPositionLeft) * (fixedRatioOffset - background.stellarRatio) + 'px' : background.startingValueLeft);
|
||||
bgTop = (this.options.verticalScrolling ? (scrollTop + background.verticalOffset - this.viewportOffsetTop - background.startingOffsetTop + background.parentOffsetTop - background.startingBackgroundPositionTop) * (fixedRatioOffset - background.stellarRatio) + 'px' : background.startingValueTop);
|
||||
|
||||
setBackgroundPosition(background.$element, bgLeft, bgTop);
|
||||
}
|
||||
},
|
||||
_handleScrollEvent: function() {
|
||||
var self = this,
|
||||
ticking = false;
|
||||
|
||||
var update = function() {
|
||||
self._repositionElements();
|
||||
ticking = false;
|
||||
};
|
||||
|
||||
var requestTick = function() {
|
||||
if (!ticking) {
|
||||
requestAnimFrame(update);
|
||||
ticking = true;
|
||||
}
|
||||
};
|
||||
|
||||
this.$scrollElement.bind('scroll.' + this.name, requestTick);
|
||||
requestTick();
|
||||
},
|
||||
_startAnimationLoop: function() {
|
||||
var self = this;
|
||||
|
||||
this._animationLoop = function() {
|
||||
requestAnimFrame(self._animationLoop);
|
||||
self._repositionElements();
|
||||
};
|
||||
this._animationLoop();
|
||||
}
|
||||
};
|
||||
|
||||
$.fn[pluginName] = function (options) {
|
||||
var args = arguments;
|
||||
if (options === undefined || typeof options === 'object') {
|
||||
return this.each(function () {
|
||||
if (!$.data(this, 'plugin_' + pluginName)) {
|
||||
$.data(this, 'plugin_' + pluginName, new Plugin(this, options));
|
||||
}
|
||||
});
|
||||
} else if (typeof options === 'string' && options[0] !== '_' && options !== 'init') {
|
||||
return this.each(function () {
|
||||
var instance = $.data(this, 'plugin_' + pluginName);
|
||||
if (instance instanceof Plugin && typeof instance[options] === 'function') {
|
||||
instance[options].apply(instance, Array.prototype.slice.call(args, 1));
|
||||
}
|
||||
if (options === 'destroy') {
|
||||
$.data(this, 'plugin_' + pluginName, null);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$[pluginName] = function(options) {
|
||||
var $window = $(window);
|
||||
return $window.stellar.apply($window, Array.prototype.slice.call(arguments, 0));
|
||||
};
|
||||
|
||||
// Expose the scroll and position property function hashes so they can be extended
|
||||
$[pluginName].scrollProperty = scrollProperty;
|
||||
$[pluginName].positionProperty = positionProperty;
|
||||
|
||||
// Expose the plugin class so it can be modified
|
||||
window.Stellar = Plugin;
|
||||
}(jQuery, this, document));
|
||||
7
modules/appagebuilder/views/js/lazyload.min.js
vendored
Normal file
7
modules/appagebuilder/views/js/lazyload.min.js
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
/*
|
||||
* @Website: apollotheme.com - prestashop template provider
|
||||
* @author Apollotheme <apollotheme@gmail.com>
|
||||
* @copyright Apollotheme
|
||||
* @description:
|
||||
*/
|
||||
!function(t,e){"use strict";function r(r,a,i,u,l){function f(){L=t.devicePixelRatio>1,i=c(i),a.delay>=0&&setTimeout(function(){s(!0)},a.delay),(a.delay<0||a.combined)&&(u.e=v(a.throttle,function(t){"resize"===t.type&&(w=B=-1),s(t.all)}),u.a=function(t){t=c(t),i.push.apply(i,t)},u.g=function(){return i=n(i).filter(function(){return!n(this).data(a.loadedName)})},u.f=function(t){for(var e=0;e<t.length;e++){var r=i.filter(function(){return this===t[e]});r.length&&s(!1,r)}},s(),n(a.appendScroll).on("scroll."+l+" resize."+l,u.e))}function c(t){var i=a.defaultImage,o=a.placeholder,u=a.imageBase,l=a.srcsetAttribute,f=a.loaderAttribute,c=a._f||{};t=n(t).filter(function(){var t=n(this),r=m(this);return!t.data(a.handledName)&&(t.attr(a.attribute)||t.attr(l)||t.attr(f)||c[r]!==e)}).data("plugin_"+a.name,r);for(var s=0,d=t.length;s<d;s++){var A=n(t[s]),g=m(t[s]),h=A.attr(a.imageBaseAttribute)||u;g===N&&h&&A.attr(l)&&A.attr(l,b(A.attr(l),h)),c[g]===e||A.attr(f)||A.attr(f,c[g]),g===N&&i&&!A.attr(E)?A.attr(E,i):g===N||!o||A.css(O)&&"none"!==A.css(O)||A.css(O,"url('"+o+"')")}return t}function s(t,e){if(!i.length)return void(a.autoDestroy&&r.destroy());for(var o=e||i,u=!1,l=a.imageBase||"",f=a.srcsetAttribute,c=a.handledName,s=0;s<o.length;s++)if(t||e||A(o[s])){var g=n(o[s]),h=m(o[s]),b=g.attr(a.attribute),v=g.attr(a.imageBaseAttribute)||l,p=g.attr(a.loaderAttribute);g.data(c)||a.visibleOnly&&!g.is(":visible")||!((b||g.attr(f))&&(h===N&&(v+b!==g.attr(E)||g.attr(f)!==g.attr(F))||h!==N&&v+b!==g.css(O))||p)||(u=!0,g.data(c,!0),d(g,h,v,p))}u&&(i=n(i).filter(function(){return!n(this).data(c)}))}function d(t,e,r,i){++z;var o=function(){y("onError",t),p(),o=n.noop};y("beforeLoad",t);var u=a.attribute,l=a.srcsetAttribute,f=a.sizesAttribute,c=a.retinaAttribute,s=a.removeAttribute,d=a.loadedName,A=t.attr(c);if(i){var g=function(){s&&t.removeAttr(a.loaderAttribute),t.data(d,!0),y(T,t),setTimeout(p,1),g=n.noop};t.off(I).one(I,o).one(D,g),y(i,t,function(e){e?(t.off(D),g()):(t.off(I),o())})||t.trigger(I)}else{var h=n(new Image);h.one(I,o).one(D,function(){t.hide(),e===N?t.attr(C,h.attr(C)).attr(F,h.attr(F)).attr(E,h.attr(E)):t.css(O,"url('"+h.attr(E)+"')"),t[a.effect](a.effectTime),s&&(t.removeAttr(u+" "+l+" "+c+" "+a.imageBaseAttribute),f!==C&&t.removeAttr(f)),t.data(d,!0),y(T,t),h.remove(),p()});var m=(L&&A?A:t.attr(u))||"";h.attr(C,t.attr(f)).attr(F,t.attr(l)).attr(E,m?r+m:null),h.complete&&h.trigger(D)}}function A(t){var e=t.getBoundingClientRect(),r=a.scrollDirection,n=a.threshold,i=h()+n>e.top&&-n<e.bottom,o=g()+n>e.left&&-n<e.right;return"vertical"===r?i:"horizontal"===r?o:i&&o}function g(){return w>=0?w:w=n(t).width()}function h(){return B>=0?B:B=n(t).height()}function m(t){return t.tagName.toLowerCase()}function b(t,e){if(e){var r=t.split(",");t="";for(var a=0,n=r.length;a<n;a++)t+=e+r[a].trim()+(a!==n-1?",":"")}return t}function v(t,e){var n,i=0;return function(o,u){function l(){i=+new Date,e.call(r,o)}var f=+new Date-i;n&&clearTimeout(n),f>t||!a.enableThrottle||u?l():n=setTimeout(l,t-f)}}function p(){--z,i.length||z||y("onFinishedAll")}function y(t,e,n){return!!(t=a[t])&&(t.apply(r,[].slice.call(arguments,1)),!0)}var z=0,w=-1,B=-1,L=!1,T="afterLoad",D="load",I="error",N="img",E="src",F="srcset",C="sizes",O="background-image";"event"===a.bind||o?f():n(t).on(D+"."+l,f)}function a(a,o){var u=this,l=n.extend({},u.config,o),f={},c=l.name+"-"+ ++i;return u.config=function(t,r){return r===e?l[t]:(l[t]=r,u)},u.addItems=function(t){return f.a&&f.a("string"===n.type(t)?n(t):t),u},u.getItems=function(){return f.g?f.g():{}},u.update=function(t){return f.e&&f.e({},!t),u},u.force=function(t){return f.f&&f.f("string"===n.type(t)?n(t):t),u},u.loadAll=function(){return f.e&&f.e({all:!0},!0),u},u.destroy=function(){return n(l.appendScroll).off("."+c,f.e),n(t).off("."+c),f={},e},r(u,l,a,f,c),l.chainable?a:u}var n=t.jQuery||t.Zepto,i=0,o=!1;n.fn.Lazy=n.fn.lazy=function(t){return new a(this,t)},n.Lazy=n.lazy=function(t,r,i){if(n.isFunction(r)&&(i=r,r=[]),n.isFunction(i)){t=n.isArray(t)?t:[t],r=n.isArray(r)?r:[r];for(var o=a.prototype.config,u=o._f||(o._f={}),l=0,f=t.length;l<f;l++)(o[t[l]]===e||n.isFunction(o[t[l]]))&&(o[t[l]]=i);for(var c=0,s=r.length;c<s;c++)u[r[c]]=t[0]}},a.prototype.config={name:"lazy",chainable:!0,autoDestroy:!0,bind:"load",threshold:500,visibleOnly:!1,appendScroll:t,scrollDirection:"both",imageBase:null,defaultImage:"data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",placeholder:null,delay:-1,combined:!1,attribute:"data-src",srcsetAttribute:"data-srcset",sizesAttribute:"data-sizes",retinaAttribute:"data-retina",loaderAttribute:"data-loader",imageBaseAttribute:"data-imagebase",removeAttribute:!0,handledName:"handled",loadedName:"loaded",effect:"show",effectTime:0,enableThrottle:!0,throttle:250,beforeLoad:e,afterLoad:e,onError:e,onFinishedAll:e},n(t).on("load",function(){o=!0})}(window);
|
||||
27
modules/appagebuilder/views/js/magic360.js
Normal file
27
modules/appagebuilder/views/js/magic360.js
Normal file
File diff suppressed because one or more lines are too long
5743
modules/appagebuilder/views/js/mediaelement-and-player.js
Normal file
5743
modules/appagebuilder/views/js/mediaelement-and-player.js
Normal file
File diff suppressed because it is too large
Load Diff
7
modules/appagebuilder/views/js/numscroller-min-1.0.js
Normal file
7
modules/appagebuilder/views/js/numscroller-min-1.0.js
Normal file
@@ -0,0 +1,7 @@
|
||||
/*
|
||||
* @Website: apollotheme.com - prestashop template provider
|
||||
* @author Apollotheme <apollotheme@gmail.com>
|
||||
* @copyright Apollotheme
|
||||
* @description:
|
||||
*/
|
||||
!function($){function numberRoller(t){var i=$(".roller-title-number-"+t).attr("data-min"),o=$(".roller-title-number-"+t).attr("data-max"),e=$(".roller-title-number-"+t).attr("data-delay");numberRoll(t,i,o,$(".roller-title-number-"+t).attr("data-increment"),1e3*e/(o-i))}function numberRoll(slno,min,max,increment,timeout){min<=max?($(".roller-title-number-"+slno).html(min),min=parseInt(min)+parseInt(increment),setTimeout(function(){numberRoll(eval(slno),eval(min),eval(max),eval(increment),eval(timeout))},timeout)):$(".roller-title-number-"+slno).html(max)}$(window).on("load",function(){$(document).scrollzipInit(),$(document).rollerInit()}),$(window).on("load scroll resize",function(){$(".numscroller").scrollzip({showFunction:function(){numberRoller($(this).attr("data-slno"))},wholeVisible:!1})}),$.fn.scrollzipInit=function(){$("body").prepend("<div style='position:fixed;top:0px;left:0px;width:0;height:0;' id='scrollzipPoint'></div>")},$.fn.rollerInit=function(){var t=0;$(".numscroller").each(function(){t++,$(this).attr("data-slno",t),$(this).addClass("roller-title-number-"+t)})},$.fn.scrollzip=function(t){var i=$.extend({showFunction:null,hideFunction:null,showShift:0,wholeVisible:!1,hideShift:0},t);return this.each(function(t,o){return $(this).addClass("scrollzip"),$.isFunction(i.showFunction)&&!$(this).hasClass("isShown")&&$(window).outerHeight()+$("#scrollzipPoint").offset().top-i.showShift>$(this).offset().top+(i.wholeVisible?$(this).outerHeight():0)&&$("#scrollzipPoint").offset().top+(i.wholeVisible?$(this).outerHeight():0)<$(this).outerHeight()+$(this).offset().top-i.showShift&&($(this).addClass("isShown"),i.showFunction.call(this)),$.isFunction(i.hideFunction)&&$(this).hasClass("isShown")&&($(window).outerHeight()+$("#scrollzipPoint").offset().top-i.hideShift<$(this).offset().top+(i.wholeVisible?$(this).outerHeight():0)||$("#scrollzipPoint").offset().top+(i.wholeVisible?$(this).outerHeight():0)>$(this).outerHeight()+$(this).offset().top-i.hideShift)&&($(this).removeClass("isShown"),i.hideFunction.call(this)),this})}}(jQuery);
|
||||
1540
modules/appagebuilder/views/js/owl.carousel.js
Normal file
1540
modules/appagebuilder/views/js/owl.carousel.js
Normal file
File diff suppressed because it is too large
Load Diff
56
modules/appagebuilder/views/js/owl.carousel.min.js
vendored
Normal file
56
modules/appagebuilder/views/js/owl.carousel.min.js
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
/**
|
||||
* jQuery OwlCarousel v1.3.2
|
||||
*
|
||||
* Copyright (c) 2013 Bartosz Wojciechowski
|
||||
* http://www.owlgraphic.com/owlcarousel/
|
||||
*
|
||||
* Licensed under MIT
|
||||
*
|
||||
*/
|
||||
"function"!==typeof Object.create&&(Object.create=function(f){function g(){}g.prototype=f;return new g});
|
||||
(function(f,g,k){var l={init:function(a,b){this.$elem=f(b);this.options=f.extend({},f.fn.owlCarousel.options,this.$elem.data(),a);this.userOptions=a;this.loadContent()},loadContent:function(){function a(a){var d,e="";if("function"===typeof b.options.jsonSuccess)b.options.jsonSuccess.apply(this,[a]);else{for(d in a.owl)a.owl.hasOwnProperty(d)&&(e+=a.owl[d].item);b.$elem.html(e)}b.logIn()}var b=this,e;"function"===typeof b.options.beforeInit&&b.options.beforeInit.apply(this,[b.$elem]);"string"===typeof b.options.jsonPath?
|
||||
(e=b.options.jsonPath,f.getJSON(e,a)):b.logIn()},logIn:function(){this.$elem.data("owl-originalStyles",this.$elem.attr("style"));this.$elem.data("owl-originalClasses",this.$elem.attr("class"));this.$elem.css({opacity:0});this.orignalItems=this.options.items;this.checkBrowser();this.wrapperWidth=0;this.checkVisible=null;this.setVars()},setVars:function(){if(0===this.$elem.children().length)return!1;this.baseClass();this.eventTypes();this.$userItems=this.$elem.children();this.itemsAmount=this.$userItems.length;
|
||||
this.wrapItems();this.$owlItems=this.$elem.find(".owl-item");this.$owlWrapper=this.$elem.find(".owl-wrapper");this.playDirection="next";this.prevItem=0;this.prevArr=[0];this.currentItem=0;this.customEvents();this.onStartup()},onStartup:function(){this.updateItems();this.calculateAll();this.buildControls();this.updateControls();this.response();this.moveEvents();this.stopOnHover();this.owlStatus();!1!==this.options.transitionStyle&&this.transitionTypes(this.options.transitionStyle);!0===this.options.autoPlay&&
|
||||
(this.options.autoPlay=5E3);this.play();this.$elem.find(".owl-wrapper").css("display","block");this.$elem.is(":visible")?this.$elem.css("opacity",1):this.watchVisibility();this.onstartup=!1;this.eachMoveUpdate();"function"===typeof this.options.afterInit&&this.options.afterInit.apply(this,[this.$elem])},eachMoveUpdate:function(){!0===this.options.lazyLoad&&this.lazyLoad();!0===this.options.autoHeight&&this.autoHeight();this.onVisibleItems();"function"===typeof this.options.afterAction&&this.options.afterAction.apply(this,
|
||||
[this.$elem])},updateVars:function(){"function"===typeof this.options.beforeUpdate&&this.options.beforeUpdate.apply(this,[this.$elem]);this.watchVisibility();this.updateItems();this.calculateAll();this.updatePosition();this.updateControls();this.eachMoveUpdate();"function"===typeof this.options.afterUpdate&&this.options.afterUpdate.apply(this,[this.$elem])},reload:function(){var a=this;g.setTimeout(function(){a.updateVars()},0)},watchVisibility:function(){var a=this;if(!1===a.$elem.is(":visible"))a.$elem.css({opacity:0}),
|
||||
g.clearInterval(a.autoPlayInterval),g.clearInterval(a.checkVisible);else return!1;a.checkVisible=g.setInterval(function(){a.$elem.is(":visible")&&(a.reload(),a.$elem.animate({opacity:1},200),g.clearInterval(a.checkVisible))},500)},wrapItems:function(){this.$userItems.wrapAll('<div class="owl-wrapper">').wrap('<div class="owl-item"></div>');this.$elem.find(".owl-wrapper").wrap('<div class="owl-wrapper-outer">');this.wrapperOuter=this.$elem.find(".owl-wrapper-outer");this.$elem.css("display","block")},
|
||||
baseClass:function(){var a=this.$elem.hasClass(this.options.baseClass),b=this.$elem.hasClass(this.options.theme);a||this.$elem.addClass(this.options.baseClass);b||this.$elem.addClass(this.options.theme)},updateItems:function(){var a,b;if(!1===this.options.responsive)return!1;if(!0===this.options.singleItem)return this.options.items=this.orignalItems=1,this.options.itemsCustom=!1,this.options.itemsDesktop=!1,this.options.itemsDesktopSmall=!1,this.options.itemsTablet=!1,this.options.itemsTabletSmall=
|
||||
!1,this.options.itemsMobile=!1;a=f(this.options.responsiveBaseWidth).width();a>(this.options.itemsDesktop[0]||this.orignalItems)&&(this.options.items=this.orignalItems);if(!1!==this.options.itemsCustom)for(this.options.itemsCustom.sort(function(a,b){return a[0]-b[0]}),b=0;b<this.options.itemsCustom.length;b+=1)this.options.itemsCustom[b][0]<=a&&(this.options.items=this.options.itemsCustom[b][1]);else a<=this.options.itemsDesktop[0]&&!1!==this.options.itemsDesktop&&(this.options.items=this.options.itemsDesktop[1]),
|
||||
a<=this.options.itemsDesktopSmall[0]&&!1!==this.options.itemsDesktopSmall&&(this.options.items=this.options.itemsDesktopSmall[1]),a<=this.options.itemsTablet[0]&&!1!==this.options.itemsTablet&&(this.options.items=this.options.itemsTablet[1]),a<=this.options.itemsTabletSmall[0]&&!1!==this.options.itemsTabletSmall&&(this.options.items=this.options.itemsTabletSmall[1]),a<=this.options.itemsMobile[0]&&!1!==this.options.itemsMobile&&(this.options.items=this.options.itemsMobile[1]);this.options.items>this.itemsAmount&&
|
||||
!0===this.options.itemsScaleUp&&(this.options.items=this.itemsAmount)},response:function(){var a=this,b,e;if(!0!==a.options.responsive)return!1;e=f(g).width();a.resizer=function(){f(g).width()!==e&&(!1!==a.options.autoPlay&&g.clearInterval(a.autoPlayInterval),g.clearTimeout(b),b=g.setTimeout(function(){e=f(g).width();a.updateVars()},a.options.responsiveRefreshRate))};f(g).resize(a.resizer)},updatePosition:function(){this.jumpTo(this.currentItem);!1!==this.options.autoPlay&&this.checkAp()},appendItemsSizes:function(){var a=
|
||||
this,b=0,e=a.itemsAmount-a.options.items;a.$owlItems.each(function(c){var d=f(this);d.css({width:a.itemWidth}).data("owl-item",Number(c));if(0===c%a.options.items||c===e)c>e||(b+=1);d.data("owl-roundPages",b)})},appendWrapperSizes:function(){this.$owlWrapper.css({width:this.$owlItems.length*this.itemWidth*2,left:0});this.appendItemsSizes()},calculateAll:function(){this.calculateWidth();this.appendWrapperSizes();this.loops();this.max()},calculateWidth:function(){this.itemWidth=Math.round(this.$elem.width()/
|
||||
this.options.items)},max:function(){var a=-1*(this.itemsAmount*this.itemWidth-this.options.items*this.itemWidth);this.options.items>this.itemsAmount?this.maximumPixels=a=this.maximumItem=0:(this.maximumItem=this.itemsAmount-this.options.items,this.maximumPixels=a);return a},min:function(){return 0},loops:function(){var a=0,b=0,e,c;this.positionsInArray=[0];this.pagesInArray=[];for(e=0;e<this.itemsAmount;e+=1)b+=this.itemWidth,this.positionsInArray.push(-b),!0===this.options.scrollPerPage&&(c=f(this.$owlItems[e]),
|
||||
c=c.data("owl-roundPages"),c!==a&&(this.pagesInArray[a]=this.positionsInArray[e],a=c))},buildControls:function(){if(!0===this.options.navigation||!0===this.options.pagination)this.owlControls=f('<div class="owl-controls"/>').toggleClass("clickable",!this.browser.isTouch).appendTo(this.$elem);!0===this.options.pagination&&this.buildPagination();!0===this.options.navigation&&this.buildButtons()},buildButtons:function(){var a=this,b=f('<div class="owl-buttons"/>');a.owlControls.append(b);a.buttonPrev=
|
||||
f("<div/>",{"class":"owl-prev",html:a.options.navigationText[0]||""});a.buttonNext=f("<div/>",{"class":"owl-next",html:a.options.navigationText[1]||""});b.append(a.buttonPrev).append(a.buttonNext);b.on("touchstart.owlControls mousedown.owlControls",'div[class^="owl"]',function(a){a.preventDefault()});b.on("touchend.owlControls mouseup.owlControls",'div[class^="owl"]',function(b){b.preventDefault();f(this).hasClass("owl-next")?a.next():a.prev()})},buildPagination:function(){var a=this;a.paginationWrapper=
|
||||
f('<div class="owl-pagination"/>');a.owlControls.append(a.paginationWrapper);a.paginationWrapper.on("touchend.owlControls mouseup.owlControls",".owl-page",function(b){b.preventDefault();Number(f(this).data("owl-page"))!==a.currentItem&&a.goTo(Number(f(this).data("owl-page")),!0)})},updatePagination:function(){var a,b,e,c,d,g;if(!1===this.options.pagination)return!1;this.paginationWrapper.html("");a=0;b=this.itemsAmount-this.itemsAmount%this.options.items;for(c=0;c<this.itemsAmount;c+=1)0===c%this.options.items&&
|
||||
(a+=1,b===c&&(e=this.itemsAmount-this.options.items),d=f("<div/>",{"class":"owl-page"}),g=f("<span></span>",{text:!0===this.options.paginationNumbers?a:"","class":!0===this.options.paginationNumbers?"owl-numbers":""}),d.append(g),d.data("owl-page",b===c?e:c),d.data("owl-roundPages",a),this.paginationWrapper.append(d));this.checkPagination()},checkPagination:function(){var a=this;if(!1===a.options.pagination)return!1;a.paginationWrapper.find(".owl-page").each(function(){f(this).data("owl-roundPages")===
|
||||
f(a.$owlItems[a.currentItem]).data("owl-roundPages")&&(a.paginationWrapper.find(".owl-page").removeClass("active"),f(this).addClass("active"))})},checkNavigation:function(){if(!1===this.options.navigation)return!1;!1===this.options.rewindNav&&(0===this.currentItem&&0===this.maximumItem?(this.buttonPrev.addClass("disabled"),this.buttonNext.addClass("disabled")):0===this.currentItem&&0!==this.maximumItem?(this.buttonPrev.addClass("disabled"),this.buttonNext.removeClass("disabled")):this.currentItem===
|
||||
this.maximumItem?(this.buttonPrev.removeClass("disabled"),this.buttonNext.addClass("disabled")):0!==this.currentItem&&this.currentItem!==this.maximumItem&&(this.buttonPrev.removeClass("disabled"),this.buttonNext.removeClass("disabled")))},updateControls:function(){this.updatePagination();this.checkNavigation();this.owlControls&&(this.options.items>=this.itemsAmount?this.owlControls.hide():this.owlControls.show())},destroyControls:function(){this.owlControls&&this.owlControls.remove()},next:function(a){if(this.isTransition)return!1;
|
||||
this.currentItem+=!0===this.options.scrollPerPage?this.options.items:1;if(this.currentItem>this.maximumItem+(!0===this.options.scrollPerPage?this.options.items-1:0))if(!0===this.options.rewindNav)this.currentItem=0,a="rewind";else return this.currentItem=this.maximumItem,!1;this.goTo(this.currentItem,a)},prev:function(a){if(this.isTransition)return!1;this.currentItem=!0===this.options.scrollPerPage&&0<this.currentItem&&this.currentItem<this.options.items?0:this.currentItem-(!0===this.options.scrollPerPage?
|
||||
this.options.items:1);if(0>this.currentItem)if(!0===this.options.rewindNav)this.currentItem=this.maximumItem,a="rewind";else return this.currentItem=0,!1;this.goTo(this.currentItem,a)},goTo:function(a,b,e){var c=this;if(c.isTransition)return!1;"function"===typeof c.options.beforeMove&&c.options.beforeMove.apply(this,[c.$elem]);a>=c.maximumItem?a=c.maximumItem:0>=a&&(a=0);c.currentItem=c.owl.currentItem=a;if(!1!==c.options.transitionStyle&&"drag"!==e&&1===c.options.items&&!0===c.browser.support3d)return c.swapSpeed(0),
|
||||
!0===c.browser.support3d?c.transition3d(c.positionsInArray[a]):c.css2slide(c.positionsInArray[a],1),c.afterGo(),c.singleItemTransition(),!1;a=c.positionsInArray[a];!0===c.browser.support3d?(c.isCss3Finish=!1,!0===b?(c.swapSpeed("paginationSpeed"),g.setTimeout(function(){c.isCss3Finish=!0},c.options.paginationSpeed)):"rewind"===b?(c.swapSpeed(c.options.rewindSpeed),g.setTimeout(function(){c.isCss3Finish=!0},c.options.rewindSpeed)):(c.swapSpeed("slideSpeed"),g.setTimeout(function(){c.isCss3Finish=!0},
|
||||
c.options.slideSpeed)),c.transition3d(a)):!0===b?c.css2slide(a,c.options.paginationSpeed):"rewind"===b?c.css2slide(a,c.options.rewindSpeed):c.css2slide(a,c.options.slideSpeed);c.afterGo()},jumpTo:function(a){"function"===typeof this.options.beforeMove&&this.options.beforeMove.apply(this,[this.$elem]);a>=this.maximumItem||-1===a?a=this.maximumItem:0>=a&&(a=0);this.swapSpeed(0);!0===this.browser.support3d?this.transition3d(this.positionsInArray[a]):this.css2slide(this.positionsInArray[a],1);this.currentItem=
|
||||
this.owl.currentItem=a;this.afterGo()},afterGo:function(){this.prevArr.push(this.currentItem);this.prevItem=this.owl.prevItem=this.prevArr[this.prevArr.length-2];this.prevArr.shift(0);this.prevItem!==this.currentItem&&(this.checkPagination(),this.checkNavigation(),this.eachMoveUpdate(),!1!==this.options.autoPlay&&this.checkAp());"function"===typeof this.options.afterMove&&this.prevItem!==this.currentItem&&this.options.afterMove.apply(this,[this.$elem])},stop:function(){this.apStatus="stop";g.clearInterval(this.autoPlayInterval)},
|
||||
checkAp:function(){"stop"!==this.apStatus&&this.play()},play:function(){var a=this;a.apStatus="play";if(!1===a.options.autoPlay)return!1;g.clearInterval(a.autoPlayInterval);a.autoPlayInterval=g.setInterval(function(){a.next(!0)},a.options.autoPlay)},swapSpeed:function(a){"slideSpeed"===a?this.$owlWrapper.css(this.addCssSpeed(this.options.slideSpeed)):"paginationSpeed"===a?this.$owlWrapper.css(this.addCssSpeed(this.options.paginationSpeed)):"string"!==typeof a&&this.$owlWrapper.css(this.addCssSpeed(a))},
|
||||
addCssSpeed:function(a){return{"-webkit-transition":"all "+a+"ms ease","-moz-transition":"all "+a+"ms ease","-o-transition":"all "+a+"ms ease",transition:"all "+a+"ms ease"}},removeTransition:function(){return{"-webkit-transition":"","-moz-transition":"","-o-transition":"",transition:""}},doTranslate:function(a){return{"-webkit-transform":"translate3d("+a+"px, 0px, 0px)","-moz-transform":"translate3d("+a+"px, 0px, 0px)","-o-transform":"translate3d("+a+"px, 0px, 0px)","-ms-transform":"translate3d("+
|
||||
a+"px, 0px, 0px)",transform:"translate3d("+a+"px, 0px,0px)"}},transition3d:function(a){this.$owlWrapper.css(this.doTranslate(a))},css2move:function(a){this.$owlWrapper.css({left:a})},css2slide:function(a,b){var e=this;e.isCssFinish=!1;e.$owlWrapper.stop(!0,!0).animate({left:a},{duration:b||e.options.slideSpeed,complete:function(){e.isCssFinish=!0}})},checkBrowser:function(){var a=k.createElement("div");a.style.cssText=" -moz-transform:translate3d(0px, 0px, 0px); -ms-transform:translate3d(0px, 0px, 0px); -o-transform:translate3d(0px, 0px, 0px); -webkit-transform:translate3d(0px, 0px, 0px); transform:translate3d(0px, 0px, 0px)";
|
||||
a=a.style.cssText.match(/translate3d\(0px, 0px, 0px\)/g);this.browser={support3d:null!==a&&1===a.length,isTouch:"ontouchstart"in g||g.navigator.msMaxTouchPoints}},moveEvents:function(){if(!1!==this.options.mouseDrag||!1!==this.options.touchDrag)this.gestures(),this.disabledEvents()},eventTypes:function(){var a=["s","e","x"];this.ev_types={};!0===this.options.mouseDrag&&!0===this.options.touchDrag?a=["touchstart.owl mousedown.owl","touchmove.owl mousemove.owl","touchend.owl touchcancel.owl mouseup.owl"]:
|
||||
!1===this.options.mouseDrag&&!0===this.options.touchDrag?a=["touchstart.owl","touchmove.owl","touchend.owl touchcancel.owl"]:!0===this.options.mouseDrag&&!1===this.options.touchDrag&&(a=["mousedown.owl","mousemove.owl","mouseup.owl"]);this.ev_types.start=a[0];this.ev_types.move=a[1];this.ev_types.end=a[2]},disabledEvents:function(){this.$elem.on("dragstart.owl",function(a){a.preventDefault()});this.$elem.on("mousedown.disableTextSelect",function(a){return f(a.target).is("input, textarea, select, option")})},
|
||||
gestures:function(){function a(a){if(void 0!==a.touches)return{x:a.touches[0].pageX,y:a.touches[0].pageY};if(void 0===a.touches){if(void 0!==a.pageX)return{x:a.pageX,y:a.pageY};if(void 0===a.pageX)return{x:a.clientX,y:a.clientY}}}function b(a){"on"===a?(f(k).on(d.ev_types.move,e),f(k).on(d.ev_types.end,c)):"off"===a&&(f(k).off(d.ev_types.move),f(k).off(d.ev_types.end))}function e(b){b=b.originalEvent||b||g.event;d.newPosX=a(b).x-h.offsetX;d.newPosY=a(b).y-h.offsetY;d.newRelativeX=d.newPosX-h.relativePos;
|
||||
"function"===typeof d.options.startDragging&&!0!==h.dragging&&0!==d.newRelativeX&&(h.dragging=!0,d.options.startDragging.apply(d,[d.$elem]));(8<d.newRelativeX||-8>d.newRelativeX)&&!0===d.browser.isTouch&&(void 0!==b.preventDefault?b.preventDefault():b.returnValue=!1,h.sliding=!0);(10<d.newPosY||-10>d.newPosY)&&!1===h.sliding&&f(k).off("touchmove.owl");d.newPosX=Math.max(Math.min(d.newPosX,d.newRelativeX/5),d.maximumPixels+d.newRelativeX/5);!0===d.browser.support3d?d.transition3d(d.newPosX):d.css2move(d.newPosX)}
|
||||
function c(a){a=a.originalEvent||a||g.event;var c;a.target=a.target||a.srcElement;h.dragging=!1;!0!==d.browser.isTouch&&d.$owlWrapper.removeClass("grabbing");d.dragDirection=0>d.newRelativeX?d.owl.dragDirection="left":d.owl.dragDirection="right";0!==d.newRelativeX&&(c=d.getNewPosition(),d.goTo(c,!1,"drag"),h.targetElement===a.target&&!0!==d.browser.isTouch&&(f(a.target).on("click.disable",function(a){a.stopImmediatePropagation();a.stopPropagation();a.preventDefault();f(a.target).off("click.disable")}),
|
||||
a=f._data(a.target,"events").click,c=a.pop(),a.splice(0,0,c)));b("off")}var d=this,h={offsetX:0,offsetY:0,baseElWidth:0,relativePos:0,position:null,minSwipe:null,maxSwipe:null,sliding:null,dargging:null,targetElement:null};d.isCssFinish=!0;d.$elem.on(d.ev_types.start,".owl-wrapper",function(c){c=c.originalEvent||c||g.event;var e;if(3===c.which)return!1;if(!(d.itemsAmount<=d.options.items)){if(!1===d.isCssFinish&&!d.options.dragBeforeAnimFinish||!1===d.isCss3Finish&&!d.options.dragBeforeAnimFinish)return!1;
|
||||
!1!==d.options.autoPlay&&g.clearInterval(d.autoPlayInterval);!0===d.browser.isTouch||d.$owlWrapper.hasClass("grabbing")||d.$owlWrapper.addClass("grabbing");d.newPosX=0;d.newRelativeX=0;f(this).css(d.removeTransition());e=f(this).position();h.relativePos=e.left;h.offsetX=a(c).x-e.left;h.offsetY=a(c).y-e.top;b("on");h.sliding=!1;h.targetElement=c.target||c.srcElement}})},getNewPosition:function(){var a=this.closestItem();a>this.maximumItem?a=this.currentItem=this.maximumItem:0<=this.newPosX&&(this.currentItem=
|
||||
a=0);return a},closestItem:function(){var a=this,b=!0===a.options.scrollPerPage?a.pagesInArray:a.positionsInArray,e=a.newPosX,c=null;f.each(b,function(d,g){e-a.itemWidth/20>b[d+1]&&e-a.itemWidth/20<g&&"left"===a.moveDirection()?(c=g,a.currentItem=!0===a.options.scrollPerPage?f.inArray(c,a.positionsInArray):d):e+a.itemWidth/20<g&&e+a.itemWidth/20>(b[d+1]||b[d]-a.itemWidth)&&"right"===a.moveDirection()&&(!0===a.options.scrollPerPage?(c=b[d+1]||b[b.length-1],a.currentItem=f.inArray(c,a.positionsInArray)):
|
||||
(c=b[d+1],a.currentItem=d+1))});return a.currentItem},moveDirection:function(){var a;0>this.newRelativeX?(a="right",this.playDirection="next"):(a="left",this.playDirection="prev");return a},customEvents:function(){var a=this;a.$elem.on("owl.next",function(){a.next()});a.$elem.on("owl.prev",function(){a.prev()});a.$elem.on("owl.play",function(b,e){a.options.autoPlay=e;a.play();a.hoverStatus="play"});a.$elem.on("owl.stop",function(){a.stop();a.hoverStatus="stop"});a.$elem.on("owl.goTo",function(b,e){a.goTo(e)});
|
||||
a.$elem.on("owl.jumpTo",function(b,e){a.jumpTo(e)})},stopOnHover:function(){var a=this;!0===a.options.stopOnHover&&!0!==a.browser.isTouch&&!1!==a.options.autoPlay&&(a.$elem.on("mouseover",function(){a.stop()}),a.$elem.on("mouseout",function(){"stop"!==a.hoverStatus&&a.play()}))},lazyLoad:function(){var a,b,e,c,d;if(!1===this.options.lazyLoad)return!1;for(a=0;a<this.itemsAmount;a+=1)b=f(this.$owlItems[a]),"loaded"!==b.data("owl-loaded")&&(e=b.data("owl-item"),c=b.find(".lazyOwl"),"string"!==typeof c.data("src")?
|
||||
b.data("owl-loaded","loaded"):(void 0===b.data("owl-loaded")&&(c.hide(),b.addClass("loading").data("owl-loaded","checked")),(d=!0===this.options.lazyFollow?e>=this.currentItem:!0)&&e<this.currentItem+this.options.items&&c.length&&this.lazyPreload(b,c)))},lazyPreload:function(a,b){function e(){a.data("owl-loaded","loaded").removeClass("loading");b.removeAttr("data-src");"fade"===d.options.lazyEffect?b.fadeIn(400):b.show();"function"===typeof d.options.afterLazyLoad&&d.options.afterLazyLoad.apply(this,
|
||||
[d.$elem])}function c(){f+=1;d.completeImg(b.get(0))||!0===k?e():100>=f?g.setTimeout(c,100):e()}var d=this,f=0,k;"DIV"===b.prop("tagName")?(b.css("background-image","url("+b.data("src")+")"),k=!0):b[0].src=b.data("src");c()},autoHeight:function(){function a(){var a=f(e.$owlItems[e.currentItem]).height();e.wrapperOuter.css("height",a+"px");e.wrapperOuter.hasClass("autoHeight")||g.setTimeout(function(){e.wrapperOuter.addClass("autoHeight")},0)}function b(){d+=1;e.completeImg(c.get(0))?a():100>=d?g.setTimeout(b,
|
||||
100):e.wrapperOuter.css("height","")}var e=this,c=f(e.$owlItems[e.currentItem]).find("img"),d;void 0!==c.get(0)?(d=0,b()):a()},completeImg:function(a){return!a.complete||"undefined"!==typeof a.naturalWidth&&0===a.naturalWidth?!1:!0},onVisibleItems:function(){var a;!0===this.options.addClassActive&&this.$owlItems.removeClass("active");this.visibleItems=[];for(a=this.currentItem;a<this.currentItem+this.options.items;a+=1)this.visibleItems.push(a),!0===this.options.addClassActive&&f(this.$owlItems[a]).addClass("active");
|
||||
this.owl.visibleItems=this.visibleItems},transitionTypes:function(a){this.outClass="owl-"+a+"-out";this.inClass="owl-"+a+"-in"},singleItemTransition:function(){var a=this,b=a.outClass,e=a.inClass,c=a.$owlItems.eq(a.currentItem),d=a.$owlItems.eq(a.prevItem),f=Math.abs(a.positionsInArray[a.currentItem])+a.positionsInArray[a.prevItem],g=Math.abs(a.positionsInArray[a.currentItem])+a.itemWidth/2;a.isTransition=!0;a.$owlWrapper.addClass("owl-origin").css({"-webkit-transform-origin":g+"px","-moz-perspective-origin":g+
|
||||
"px","perspective-origin":g+"px"});d.css({position:"relative",left:f+"px"}).addClass(b).on("webkitAnimationEnd oAnimationEnd MSAnimationEnd animationend",function(){a.endPrev=!0;d.off("webkitAnimationEnd oAnimationEnd MSAnimationEnd animationend");a.clearTransStyle(d,b)});c.addClass(e).on("webkitAnimationEnd oAnimationEnd MSAnimationEnd animationend",function(){a.endCurrent=!0;c.off("webkitAnimationEnd oAnimationEnd MSAnimationEnd animationend");a.clearTransStyle(c,e)})},clearTransStyle:function(a,
|
||||
b){a.css({position:"",left:""}).removeClass(b);this.endPrev&&this.endCurrent&&(this.$owlWrapper.removeClass("owl-origin"),this.isTransition=this.endCurrent=this.endPrev=!1)},owlStatus:function(){this.owl={userOptions:this.userOptions,baseElement:this.$elem,userItems:this.$userItems,owlItems:this.$owlItems,currentItem:this.currentItem,prevItem:this.prevItem,visibleItems:this.visibleItems,isTouch:this.browser.isTouch,browser:this.browser,dragDirection:this.dragDirection}},clearEvents:function(){this.$elem.off(".owl owl mousedown.disableTextSelect");
|
||||
f(k).off(".owl owl");f(g).off("resize",this.resizer)},unWrap:function(){0!==this.$elem.children().length&&(this.$owlWrapper.unwrap(),this.$userItems.unwrap().unwrap(),this.owlControls&&this.owlControls.remove());this.clearEvents();this.$elem.attr("style",this.$elem.data("owl-originalStyles")||"").attr("class",this.$elem.data("owl-originalClasses"))},destroy:function(){this.stop();g.clearInterval(this.checkVisible);this.unWrap();this.$elem.removeData()},reinit:function(a){a=f.extend({},this.userOptions,
|
||||
a);this.unWrap();this.init(a,this.$elem)},addItem:function(a,b){var e;if(!a)return!1;if(0===this.$elem.children().length)return this.$elem.append(a),this.setVars(),!1;this.unWrap();e=void 0===b||-1===b?-1:b;e>=this.$userItems.length||-1===e?this.$userItems.eq(-1).after(a):this.$userItems.eq(e).before(a);this.setVars()},removeItem:function(a){if(0===this.$elem.children().length)return!1;a=void 0===a||-1===a?-1:a;this.unWrap();this.$userItems.eq(a).remove();this.setVars()}};f.fn.owlCarousel=function(a){return this.each(function(){if(!0===
|
||||
f(this).data("owl-init"))return!1;f(this).data("owl-init",!0);var b=Object.create(l);b.init(a,this);f.data(this,"owlCarousel",b)})};f.fn.owlCarousel.options={items:5,itemsCustom:!1,itemsDesktop:[1199,4],itemsDesktopSmall:[979,3],itemsTablet:[768,2],itemsTabletSmall:!1,itemsMobile:[479,1],singleItem:!1,itemsScaleUp:!1,slideSpeed:200,paginationSpeed:800,rewindSpeed:1E3,autoPlay:!1,stopOnHover:!1,navigation:!1,navigationText:["prev","next"],rewindNav:!0,scrollPerPage:!1,pagination:!0,paginationNumbers:!1,
|
||||
responsive:!0,responsiveRefreshRate:200,responsiveBaseWidth:g,baseClass:"owl-carousel",theme:"owl-theme",lazyLoad:!1,lazyFollow:!0,lazyEffect:"fade",autoHeight:!1,jsonPath:!1,jsonSuccess:!1,dragBeforeAnimFinish:!0,mouseDrag:!0,touchDrag:!0,addClassActive:!1,transitionStyle:!1,beforeUpdate:!1,afterUpdate:!1,beforeInit:!1,afterInit:!1,beforeMove:!1,afterMove:!1,afterAction:!1,startDragging:!1,afterLazyLoad:!1}})(jQuery,window,document);
|
||||
231
modules/appagebuilder/views/js/paneltool.js
Normal file
231
modules/appagebuilder/views/js/paneltool.js
Normal file
@@ -0,0 +1,231 @@
|
||||
/**
|
||||
* @copyright Commercial License By LeoTheme.Com
|
||||
* @email leotheme.com
|
||||
* @visit http://www.leotheme.com
|
||||
*/
|
||||
$(document).ready(function(){
|
||||
$('#panelTab a').click(function(e) {
|
||||
e.preventDefault();
|
||||
$(this).tab('show');
|
||||
});
|
||||
var expiresThemConfigDay = 1;
|
||||
$('#panelTab a:first').tab('show');
|
||||
$(".bg-config").hide();
|
||||
var $MAINCONTAINER = $("html");
|
||||
|
||||
/**
|
||||
* BACKGROUND-IMAGE SELECTION
|
||||
*/
|
||||
$(".background-images").each(function() {
|
||||
var $parent = this;
|
||||
var $input = $(".input-setting", $parent);
|
||||
$(".bi-wrapper > div", this).click(function() {
|
||||
$input.val($(this).data('val'));
|
||||
$(".bg-config",$parent).show();
|
||||
$('.bi-wrapper > div', $parent).removeClass('active');
|
||||
$(this).addClass('active');
|
||||
|
||||
if ($input.data('selector')) {
|
||||
$($input.data('selector'), $($MAINCONTAINER)).css($input.data('attrs'), 'url(' + $(this).data('image') + ')');
|
||||
}
|
||||
});
|
||||
$(".bg-config select", this).change(function(){
|
||||
if ($input.data('selector')) {
|
||||
$($input.data('selector'), $($MAINCONTAINER)).css($(this).data('attrs'), $(this).val());
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(".clear-bg").click(function() {
|
||||
var $parent = $(this).parent();
|
||||
var $input = $(".input-setting", $parent);
|
||||
if ($input.val('')) {
|
||||
|
||||
if ($parent.hasClass("background-images")) {
|
||||
$('.bi-wrapper > div', $parent).removeClass('active');
|
||||
$($input.data('selector'), $($MAINCONTAINER)).css($input.data('attrs'), 'none');
|
||||
$('ul select', $parent).each(function(){
|
||||
$($input.data('selector'), $($MAINCONTAINER)).css($(this).data('attrs'), '');
|
||||
});
|
||||
$('ul.bg-config', $parent).hide();
|
||||
$('ul select', $parent).val("");
|
||||
} else {
|
||||
$input.attr('style', '')
|
||||
}
|
||||
$($input.data('selector'), $($MAINCONTAINER)).css($input.data('attrs'), 'inherit');
|
||||
$($input.data('selector'), $($MAINCONTAINER)).css($input.data('attrs'), 'transparent'); // TuanVu fix in IE 11
|
||||
|
||||
}
|
||||
$input.val('');
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.accordion-group input.input-setting').each(function() {
|
||||
var input = this;
|
||||
$(input).attr('readonly', 'readonly');
|
||||
$(input).ColorPicker({
|
||||
onChange: function(hsb, hex, rgb) {
|
||||
$(input).css('backgroundColor', '#' + hex);
|
||||
$(input).val(hex);
|
||||
if ($(input).data('selector')) {
|
||||
$($MAINCONTAINER).find($(input).data('selector')).css($(input).data('attrs'), "#" + $(input).val())
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('.accordion-group select.input-setting').change(function() {
|
||||
var input = this;
|
||||
if ($(input).data('selector')) {
|
||||
var ex = $(input).data('attrs') == 'font-size' ? 'px' : "";
|
||||
$($MAINCONTAINER).find($(input).data('selector')).css($(input).data('attrs'), $(input).val() + ex);
|
||||
}
|
||||
});
|
||||
$(".paneltool .panelbutton").click(function() {
|
||||
$(this).parent().toggleClass("active");
|
||||
});
|
||||
|
||||
/** Panel tool code */
|
||||
$('.leo-dynamic-theme-skin').click(function(){
|
||||
if(!$(this).hasClass('current-theme-skin'))
|
||||
{
|
||||
$('.leo-dynamic-theme-skin').removeClass('current-theme-skin');
|
||||
$(this).addClass('current-theme-skin');
|
||||
|
||||
var selectedSkin = $(this).data('theme-skin-id');
|
||||
//add class to html when selec skin
|
||||
$('.leo-dynamic-theme-skin').each(function(){
|
||||
$('html').removeClass($(this).data('theme-skin-id'));
|
||||
});
|
||||
$('html').addClass(selectedSkin);
|
||||
if(selectedSkin=='default')
|
||||
{
|
||||
$('head #leo-dynamic-skin-css').remove();
|
||||
$('head #leo-dynamic-skin-css-rtl').remove();
|
||||
}else{
|
||||
var skinRTLCss = $(this).data('theme-skin-rtl');
|
||||
var skinFileUrl = $(this).data('theme-skin-css');
|
||||
|
||||
if($('head #leo-dynamic-skin-css').length)
|
||||
{
|
||||
$('head #leo-dynamic-skin-css').attr('href',skinFileUrl+'skin.css');
|
||||
|
||||
}else{
|
||||
$('head').append('<link rel="stylesheet" id="leo-dynamic-skin-css" href="'+skinFileUrl+'skin.css" type="text/css" media="all" />');
|
||||
}
|
||||
|
||||
if($('head #leo-dynamic-skin-css-rtl').length && skinRTLCss)
|
||||
{
|
||||
$('head #leo-dynamic-skin-css-rtl').attr('href',skinFileUrl+'custom-rtl.css');
|
||||
}else if(skinRTLCss)
|
||||
{
|
||||
$('head').append('<link rel="stylesheet" id="leo-dynamic-skin-css-rtl" href="'+skinFileUrl+'custom-rtl.css" type="text/css" media="all" />');
|
||||
}else{
|
||||
$('head #leo-dynamic-skin-css-rtl').remove();
|
||||
}
|
||||
}
|
||||
var configName = $('#leo-paneltool').data('cname')+'_default_skin';
|
||||
$.cookie(configName, selectedSkin, {expires: expiresThemConfigDay, path: '/'});
|
||||
}
|
||||
});
|
||||
|
||||
/* float header */
|
||||
$('.enable_fheader').click(function(){
|
||||
if(!$(this).hasClass('current')){
|
||||
var configName = $('#leo-paneltool').data('cname')+'_enable_fheader';
|
||||
$('.enable_fheader').removeClass('current');
|
||||
$(this).addClass('current');
|
||||
if($(this).data('value')){
|
||||
$('body').addClass('keep-header');
|
||||
$.cookie(configName, 1, {expires: expiresThemConfigDay, path: '/'});
|
||||
if(typeof floatHeader == 'function')
|
||||
floatHeader();
|
||||
}
|
||||
else{
|
||||
$('body').removeClass('keep-header');
|
||||
$.cookie(configName, 0, {expires: expiresThemConfigDay, path: '/'});
|
||||
if(typeof processFloatHeader == 'function')
|
||||
processFloatHeader(0,0);
|
||||
}
|
||||
}
|
||||
});
|
||||
/* header style */
|
||||
var currentHeaderStyle = $('.leo-dynamic-update-header.current-header').data('header-style');
|
||||
$('.leo-dynamic-update-header').click(function(){
|
||||
if(!$(this).hasClass('current-header'))
|
||||
{
|
||||
$('.leo-dynamic-update-header').removeClass('current-header');
|
||||
$(this).addClass('current-header');
|
||||
|
||||
var selectedHeader = $(this).data('header-style');
|
||||
$('body').removeClass(currentHeaderStyle);
|
||||
$('body').addClass(selectedHeader);
|
||||
currentHeaderStyle = selectedHeader;
|
||||
var configName = $('#leo-paneltool').data('cname')+'_header_style';
|
||||
$.cookie(configName, selectedHeader, {expires: expiresThemConfigDay, path: '/'});
|
||||
}
|
||||
});
|
||||
var currentSideBarStyle = $('.leo-dynamic-update-side.current-sidebar').data('sidebar');
|
||||
var sideBarStyleList = [];
|
||||
$('.leo-dynamic-update-side').each(function(i){
|
||||
sideBarStyleList[i] = $(this).data('sidebar');
|
||||
});
|
||||
$('.leo-dynamic-update-side').click(function(){
|
||||
if(!$(this).hasClass('current-sidebar'))
|
||||
{
|
||||
$('.leo-dynamic-update-side').removeClass('current-sidebar');
|
||||
$(this).addClass('current-sidebar');
|
||||
|
||||
var selectedHeader = $(this).data('sidebar');
|
||||
$.each(sideBarStyleList, function( index, value ) {
|
||||
$('body').removeClass(value);
|
||||
});
|
||||
$('body').addClass(selectedHeader);
|
||||
currentSideBarStyle = selectedHeader;
|
||||
getBodyClassByMenu();
|
||||
|
||||
var configName = $('#leo-paneltool').data('cname')+'_sidebarmenu';
|
||||
$.cookie(configName, selectedHeader, {expires: expiresThemConfigDay, path: '/'});
|
||||
}
|
||||
});
|
||||
|
||||
var currentLayoutMode = $('.leo-dynamic-update-layout.current-layout-mod').data('layout-mod');
|
||||
$('.leo-dynamic-update-layout').click(function(){
|
||||
if(!$(this).hasClass('current-layout-mod'))
|
||||
{
|
||||
$('.leo-dynamic-update-layout').removeClass('current-layout-mod');
|
||||
$(this).addClass('current-layout-mod');
|
||||
|
||||
var selectedLayout = $(this).data('layout-mod');
|
||||
$('body').removeClass(currentLayoutMode);
|
||||
$('body').addClass(selectedLayout);
|
||||
currentLayoutMode = selectedLayout;
|
||||
|
||||
getBodyClassByMenu();
|
||||
|
||||
var configName = $('#leo-paneltool').data('cname')+'_layout_mode';
|
||||
$.cookie(configName, selectedLayout, {expires: expiresThemConfigDay, path: '/'});
|
||||
}
|
||||
});
|
||||
|
||||
function getBodyClassByMenu(){
|
||||
if($('body').hasClass('sidebar-hide') || $('body').hasClass('header-hide-topmenu'))
|
||||
$('body').removeClass('double-menu');
|
||||
else
|
||||
if(!$('body').hasClass('double-menu')) $('body').addClass('double-menu');
|
||||
}
|
||||
|
||||
//DONGND:: click out to close paneltool
|
||||
$(document).click(function (e) {
|
||||
e.stopPropagation();
|
||||
var container = $(".paneltool.active");
|
||||
//DONGND:: fix click colorpicker close panel
|
||||
var container_colorpicker = $('.colorpicker');
|
||||
//check if the clicked area is in container or not
|
||||
if (container.length && container.has(e.target).length === 0 && container_colorpicker.length && container_colorpicker.has(e.target).length === 0 && !$(e.target).hasClass('panelbutton') && !$(e.target).hasClass('fa-cog') && !$(e.target).hasClass('fa-times')) {
|
||||
container.toggleClass("active");
|
||||
}
|
||||
|
||||
})
|
||||
});
|
||||
1462
modules/appagebuilder/views/js/script.js
Normal file
1462
modules/appagebuilder/views/js/script.js
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/**
|
||||
* 2007-2017 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2017 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||
|
||||
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||
header("Pragma: no-cache");
|
||||
|
||||
header("Location: ../");
|
||||
exit;
|
||||
48
modules/appagebuilder/views/js/shortcode/appagebuilder/plugin.min.js
vendored
Normal file
48
modules/appagebuilder/views/js/shortcode/appagebuilder/plugin.min.js
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* @Website: apollotheme.com - prestashop template provider
|
||||
* @author Apollotheme <apollotheme@gmail.com>
|
||||
* @copyright Apollotheme
|
||||
* @description:
|
||||
*/
|
||||
tinymce.PluginManager.add("appagebuilder", function(t, url) {
|
||||
t.addButton("appagebuilder", {
|
||||
// text: "My button",
|
||||
icon: "appagebuilder",
|
||||
tooltip: "Ap Shortcode",
|
||||
onclick: function() {
|
||||
t.windowManager.open({
|
||||
title: "Ap Shortcode: Select a shortcode to embed it to the content",
|
||||
// body: [{
|
||||
// type: "textbox",
|
||||
// name: "title",
|
||||
// label: "Title",
|
||||
|
||||
// }],
|
||||
url : appagebuilder_listshortcode_url,
|
||||
inline : 1,
|
||||
width : 900,
|
||||
|
||||
height : 450
|
||||
// onsubmit: function(e) {
|
||||
// t.insertContent("Title: " + e.data.title)
|
||||
// }
|
||||
})
|
||||
}
|
||||
})
|
||||
// t.addMenuItem("appagebuilder", {
|
||||
// text: "Example plugin",
|
||||
// context: "tools",
|
||||
// onclick: function() {
|
||||
// t.windowManager.open({
|
||||
// title: "TinyMCE site",
|
||||
// url: "http://www.tinymce.com",
|
||||
// width: 800,
|
||||
// height: 600,
|
||||
// buttons: [{
|
||||
// text: "Close",
|
||||
// onclick: "close"
|
||||
// }]
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
});
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
36
modules/appagebuilder/views/js/shortcode/backup/index.php
Normal file
36
modules/appagebuilder/views/js/shortcode/backup/index.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2012 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2012 PrestaShop SA
|
||||
* @version Release: $Revision: 13573 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||
|
||||
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||
header("Pragma: no-cache");
|
||||
|
||||
header("Location: ../");
|
||||
exit;
|
||||
113
modules/appagebuilder/views/js/shortcode/backup/tinymce.inc.js
Normal file
113
modules/appagebuilder/views/js/shortcode/backup/tinymce.inc.js
Normal file
@@ -0,0 +1,113 @@
|
||||
/**
|
||||
* Change default icons to marerial icons
|
||||
*/
|
||||
function changeToMaterial() {
|
||||
var materialIconAssoc = {
|
||||
'mce-i-code': '<i class="material-icons">code</i>',
|
||||
'mce-i-none': '<i class="material-icons">format_color_text</i>',
|
||||
'mce-i-bold': '<i class="material-icons">format_bold</i>',
|
||||
'mce-i-italic': '<i class="material-icons">format_italic</i>',
|
||||
'mce-i-underline': '<i class="material-icons">format_underlined</i>',
|
||||
'mce-i-strikethrough': '<i class="material-icons">format_strikethrough</i>',
|
||||
'mce-i-blockquote': '<i class="material-icons">format_quote</i>',
|
||||
'mce-i-link': '<i class="material-icons">link</i>',
|
||||
'mce-i-alignleft': '<i class="material-icons">format_align_left</i>',
|
||||
'mce-i-aligncenter': '<i class="material-icons">format_align_center</i>',
|
||||
'mce-i-alignright': '<i class="material-icons">format_align_right</i>',
|
||||
'mce-i-alignjustify': '<i class="material-icons">format_align_justify</i>',
|
||||
'mce-i-bullist': '<i class="material-icons">format_list_bulleted</i>',
|
||||
'mce-i-numlist': '<i class="material-icons">format_list_numbered</i>',
|
||||
'mce-i-image': '<i class="material-icons">image</i>',
|
||||
'mce-i-table': '<i class="material-icons">grid_on</i>',
|
||||
'mce-i-media': '<i class="material-icons">video_library</i>',
|
||||
'mce-i-browse': '<i class="material-icons">attachment</i>',
|
||||
'mce-i-checkbox': '<i class="mce-ico mce-i-checkbox"></i>'
|
||||
};
|
||||
|
||||
$.each(materialIconAssoc, function(index, value) {
|
||||
$('.' + index).replaceWith(value);
|
||||
});
|
||||
}
|
||||
|
||||
function tinySetup(config) {
|
||||
if (typeof tinyMCE === 'undefined') {
|
||||
setTimeout(function() {
|
||||
tinySetup(config);
|
||||
}, 100);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!config) {
|
||||
config = {};
|
||||
}
|
||||
|
||||
if (typeof config.editor_selector != 'undefined') {
|
||||
config.selector = '.' + config.editor_selector;
|
||||
}
|
||||
|
||||
var default_config = {
|
||||
selector: '.rte',
|
||||
plugins: 'align colorpicker link image filemanager table media placeholder lists advlist code table autoresize',
|
||||
browser_spellcheck: true,
|
||||
toolbar1:
|
||||
'code,colorpicker,bold,italic,underline,strikethrough,blockquote,link,align,bullist,numlist,table,image,media,formatselect',
|
||||
toolbar2: '',
|
||||
external_filemanager_path: baseAdminDir + 'filemanager/',
|
||||
filemanager_title: 'File manager',
|
||||
external_plugins: {
|
||||
filemanager: baseAdminDir + 'filemanager/plugin.min.js'
|
||||
},
|
||||
language: iso_user,
|
||||
content_style: lang_is_rtl === '1' ? 'body {direction:rtl;}' : '',
|
||||
skin: 'prestashop',
|
||||
mobile: {
|
||||
theme: 'mobile',
|
||||
plugins: ['lists', 'align', 'link', 'table', 'placeholder', 'advlist', 'code'],
|
||||
toolbar:
|
||||
'undo code colorpicker bold italic underline strikethrough blockquote link align bullist numlist table formatselect styleselect',
|
||||
},
|
||||
menubar: false,
|
||||
statusbar: false,
|
||||
relative_urls: false,
|
||||
convert_urls: false,
|
||||
entity_encoding: 'raw',
|
||||
extended_valid_elements: 'em[class|name|id],@[role|data-*|aria-*]',
|
||||
valid_children: '+*[*]',
|
||||
valid_elements: '*[*]',
|
||||
init_instance_callback: 'changeToMaterial',
|
||||
rel_list: [{title: 'nofollow', value: 'nofollow'}]
|
||||
};
|
||||
|
||||
if (typeof window.defaultTinyMceConfig !== 'undefined') {
|
||||
Object.assign(default_config, window.defaultTinyMceConfig);
|
||||
}
|
||||
|
||||
$.each(default_config, function(index, el) {
|
||||
if (config[index] === undefined) config[index] = el;
|
||||
});
|
||||
|
||||
var plugins_arr = config['plugins'].split(/[ ,]/);
|
||||
var old_plugins_array = ['iespell', 'inlinepopups', 'style', 'xhtmlxtras', 'safari'];
|
||||
$.each(plugins_arr, function(index, data) {
|
||||
if (data == 'advhr') plugins_arr[index] = 'hr';
|
||||
else if (data == 'advlink') plugins_arr[index] = 'link';
|
||||
else if (data == 'advimage') {
|
||||
plugins_arr[index] = 'image';
|
||||
plugins_arr.push('filemanager');
|
||||
} else if (data == 'emotions') plugins_arr[index] = 'emoticons';
|
||||
else if (old_plugins_array.indexOf(data) >= 0) {
|
||||
plugins_arr.splice(index, 1);
|
||||
}
|
||||
});
|
||||
|
||||
var plugins = plugins_arr.join(',');
|
||||
|
||||
config.plugins = plugins;
|
||||
|
||||
// Change icons in popups
|
||||
$('body').on('click', '.mce-btn, .mce-open, .mce-menu-item', function() {
|
||||
changeToMaterial();
|
||||
});
|
||||
|
||||
tinyMCE.init(config);
|
||||
}
|
||||
176
modules/appagebuilder/views/js/shortcode/category.bundle.js
Normal file
176
modules/appagebuilder/views/js/shortcode/category.bundle.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
36
modules/appagebuilder/views/js/shortcode/index.php
Normal file
36
modules/appagebuilder/views/js/shortcode/index.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2012 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2012 PrestaShop SA
|
||||
* @version Release: $Revision: 13573 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||
|
||||
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||
header("Pragma: no-cache");
|
||||
|
||||
header("Location: ../");
|
||||
exit;
|
||||
96
modules/appagebuilder/views/js/shortcode/tinymce.inc.js
Normal file
96
modules/appagebuilder/views/js/shortcode/tinymce.inc.js
Normal file
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
* @Website: apollotheme.com - prestashop template provider
|
||||
* @author Apollotheme <apollotheme@gmail.com>
|
||||
* @copyright Apollotheme
|
||||
* @description:
|
||||
*/
|
||||
/**
|
||||
* Change default icons to marerial icons
|
||||
*/
|
||||
function changeToMaterial() {
|
||||
var materialIconAssoc = {
|
||||
'mce-i-code': '<i class="material-icons">code</i>',
|
||||
'mce-i-appagebuilder': '<i class="material-icons">settings_ethernet</i>',
|
||||
'mce-i-none': '<i class="material-icons">format_color_text</i>',
|
||||
'mce-i-bold': '<i class="material-icons">format_bold</i>',
|
||||
'mce-i-italic': '<i class="material-icons">format_italic</i>',
|
||||
'mce-i-underline': '<i class="material-icons">format_underlined</i>',
|
||||
'mce-i-strikethrough': '<i class="material-icons">format_strikethrough</i>',
|
||||
'mce-i-blockquote': '<i class="material-icons">format_quote</i>',
|
||||
'mce-i-link': '<i class="material-icons">link</i>',
|
||||
'mce-i-alignleft': '<i class="material-icons">format_align_left</i>',
|
||||
'mce-i-aligncenter': '<i class="material-icons">format_align_center</i>',
|
||||
'mce-i-alignright': '<i class="material-icons">format_align_right</i>',
|
||||
'mce-i-alignjustify': '<i class="material-icons">format_align_justify</i>',
|
||||
'mce-i-bullist': '<i class="material-icons">format_list_bulleted</i>',
|
||||
'mce-i-numlist': '<i class="material-icons">format_list_numbered</i>',
|
||||
'mce-i-image': '<i class="material-icons">image</i>',
|
||||
'mce-i-table': '<i class="material-icons">grid_on</i>',
|
||||
'mce-i-media': '<i class="material-icons">video_library</i>',
|
||||
'mce-i-browse': '<i class="material-icons">attachment</i>',
|
||||
'mce-i-checkbox': '<i class="mce-ico mce-i-checkbox"></i>',
|
||||
};
|
||||
|
||||
$.each(materialIconAssoc, function (index, value) {
|
||||
$('.' + index).replaceWith(value);
|
||||
});
|
||||
}
|
||||
|
||||
function tinySetup(config) {
|
||||
if (typeof tinyMCE === 'undefined') {
|
||||
setTimeout(function() {
|
||||
tinySetup(config);
|
||||
}, 100);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!config) {
|
||||
config = {};
|
||||
}
|
||||
|
||||
if (typeof config.editor_selector != 'undefined') {
|
||||
config.selector = '.' + config.editor_selector;
|
||||
}
|
||||
|
||||
if (typeof lang_is_rtl === 'undefined') {
|
||||
var lang_is_rtl = '0';
|
||||
}
|
||||
|
||||
var default_config = {
|
||||
selector: ".rte",
|
||||
plugins: "align appagebuilder colorpicker link image filemanager table media placeholder advlist code table autoresize",
|
||||
browser_spellcheck: true,
|
||||
toolbar1: "code,colorpicker,bold,italic,underline,strikethrough,blockquote,link,align,bullist,numlist,table,image,media,formatselect",
|
||||
toolbar2: "appagebuilder",
|
||||
external_filemanager_path: baseAdminDir + "filemanager/",
|
||||
filemanager_title: "File manager",
|
||||
external_plugins: {"filemanager": baseAdminDir + "filemanager/plugin.min.js"},
|
||||
language: iso_user,
|
||||
content_style : (lang_is_rtl === '1' ? "body {direction:rtl;}" : ""),
|
||||
skin: "prestashop",
|
||||
menubar: false,
|
||||
statusbar: false,
|
||||
relative_urls: false,
|
||||
convert_urls: false,
|
||||
entity_encoding: "raw",
|
||||
extended_valid_elements: "em[class|name|id],@[role|data-*|aria-*]",
|
||||
valid_children: "+*[*]",
|
||||
valid_elements: "*[*]",
|
||||
init_instance_callback: "changeToMaterial",
|
||||
rel_list:[
|
||||
{ title: 'nofollow', value: 'nofollow' }
|
||||
],
|
||||
};
|
||||
|
||||
$.each(default_config, function (index, el) {
|
||||
if (config[index] === undefined)
|
||||
config[index] = el;
|
||||
});
|
||||
|
||||
// Change icons in popups
|
||||
$('body').on('click', '.mce-btn, .mce-open, .mce-menu-item', function () {
|
||||
changeToMaterial();
|
||||
});
|
||||
|
||||
tinyMCE.init(config);
|
||||
}
|
||||
3025
modules/appagebuilder/views/js/slick.js
Normal file
3025
modules/appagebuilder/views/js/slick.js
Normal file
File diff suppressed because it is too large
Load Diff
13
modules/appagebuilder/views/js/swiper.min.js
vendored
Normal file
13
modules/appagebuilder/views/js/swiper.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
51
modules/appagebuilder/views/js/tabaccordion.js
Normal file
51
modules/appagebuilder/views/js/tabaccordion.js
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* @Website: apollotheme.com - prestashop template provider
|
||||
* @author Apollotheme <apollotheme@gmail.com>
|
||||
* @copyright Apollotheme
|
||||
* @description:
|
||||
*/
|
||||
! function($) {
|
||||
"use strict";
|
||||
var a = {
|
||||
accordionOn: ["xs"]
|
||||
};
|
||||
$.fn.responsiveTabs = function(e) {
|
||||
var t = $.extend({}, a, e),
|
||||
s = "";
|
||||
return $.each(t.accordionOn, function(a, e) {
|
||||
s += " accordion-" + e
|
||||
}), this.each(function() {
|
||||
var a = $(this),
|
||||
e = a.find("> li > a"),
|
||||
t = $(e.first().attr("href")).parent(".tab-content"),
|
||||
i = t.children(".tab-pane");
|
||||
a.add(t).wrapAll('<div class="tabs-accordion-container" />');
|
||||
var n = a.parent(".tabs-accordion-container");
|
||||
n.addClass(s), e.each(function(a) {
|
||||
var t = $(this),
|
||||
s = t.attr("href"),
|
||||
i = "",
|
||||
n = "",
|
||||
r = "";
|
||||
t.parent("li").hasClass("active") && (i = " active"), 0 === a && (n = " first"), a === e.length - 1 && (r = " last"), t.clone(!1).addClass("accordion-link" + i + n + r).insertBefore(s)
|
||||
});
|
||||
var r = t.children(".accordion-link");
|
||||
e.on("click", function(a) {
|
||||
a.preventDefault();
|
||||
var e = $(this),
|
||||
s = e.parent("li"),
|
||||
n = s.siblings("li"),
|
||||
c = e.attr("href"),
|
||||
l = t.children('a[href="' + c + '"]');
|
||||
s.hasClass("active") || (s.addClass("active"), n.removeClass("active"), i.removeClass("active"), $(c).addClass("active"), r.removeClass("active"), l.addClass("active"))
|
||||
}), r.on("click", function(t) {
|
||||
t.preventDefault();
|
||||
var s = $(this),
|
||||
n = s.attr("href"),
|
||||
c = a.find('li > a[href="' + n + '"]').parent("li");
|
||||
s.hasClass("active") || (r.removeClass("active"), s.addClass("active"), i.removeClass("active"), $(n).addClass("active"), e.parent("li").removeClass("active"), c.addClass("active"))
|
||||
})
|
||||
})
|
||||
}
|
||||
}(jQuery);
|
||||
$(document).ready(function(){$('.tabs-accordion').responsiveTabs({accordionOn: ['xs']});});
|
||||
668
modules/appagebuilder/views/js/waypoints.min.js
vendored
Normal file
668
modules/appagebuilder/views/js/waypoints.min.js
vendored
Normal file
@@ -0,0 +1,668 @@
|
||||
/*
|
||||
* @Website: apollotheme.com - prestashop template provider
|
||||
* @author Apollotheme <apollotheme@gmail.com>
|
||||
* @copyright Apollotheme
|
||||
* @description:
|
||||
*/
|
||||
/*!
|
||||
Waypoints - 4.0.1
|
||||
Copyright © Caleb Troughton
|
||||
Licensed under the MIT license.
|
||||
https://github.com/imakewebthings/waypoints/blob/master/licenses.txt
|
||||
*/
|
||||
(function() {
|
||||
'use strict'
|
||||
|
||||
var keyCounter = 0
|
||||
var allWaypoints = {}
|
||||
|
||||
/* http://imakewebthings.com/waypoints/api/waypoint */
|
||||
function Waypoint(options) {
|
||||
if (!options) {
|
||||
throw new Error('No options passed to Waypoint constructor')
|
||||
}
|
||||
if (!options.element) {
|
||||
throw new Error('No element option passed to Waypoint constructor')
|
||||
}
|
||||
if (!options.handler) {
|
||||
throw new Error('No handler option passed to Waypoint constructor')
|
||||
}
|
||||
|
||||
this.key = 'waypoint-' + keyCounter
|
||||
this.options = Waypoint.Adapter.extend({}, Waypoint.defaults, options)
|
||||
this.element = this.options.element
|
||||
this.adapter = new Waypoint.Adapter(this.element)
|
||||
this.callback = options.handler
|
||||
this.axis = this.options.horizontal ? 'horizontal' : 'vertical'
|
||||
this.enabled = this.options.enabled
|
||||
this.triggerPoint = null
|
||||
this.group = Waypoint.Group.findOrCreate({
|
||||
name: this.options.group,
|
||||
axis: this.axis
|
||||
})
|
||||
this.context = Waypoint.Context.findOrCreateByElement(this.options.context)
|
||||
|
||||
if (Waypoint.offsetAliases[this.options.offset]) {
|
||||
this.options.offset = Waypoint.offsetAliases[this.options.offset]
|
||||
}
|
||||
this.group.add(this)
|
||||
this.context.add(this)
|
||||
allWaypoints[this.key] = this
|
||||
keyCounter += 1
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Waypoint.prototype.queueTrigger = function(direction) {
|
||||
this.group.queueTrigger(this, direction)
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Waypoint.prototype.trigger = function(args) {
|
||||
if (!this.enabled) {
|
||||
return
|
||||
}
|
||||
if (this.callback) {
|
||||
this.callback.apply(this, args)
|
||||
}
|
||||
}
|
||||
|
||||
/* Public */
|
||||
/* http://imakewebthings.com/waypoints/api/destroy */
|
||||
Waypoint.prototype.destroy = function() {
|
||||
this.context.remove(this)
|
||||
this.group.remove(this)
|
||||
delete allWaypoints[this.key]
|
||||
}
|
||||
|
||||
/* Public */
|
||||
/* http://imakewebthings.com/waypoints/api/disable */
|
||||
Waypoint.prototype.disable = function() {
|
||||
this.enabled = false
|
||||
return this
|
||||
}
|
||||
|
||||
/* Public */
|
||||
/* http://imakewebthings.com/waypoints/api/enable */
|
||||
Waypoint.prototype.enable = function() {
|
||||
this.context.refresh()
|
||||
this.enabled = true
|
||||
return this
|
||||
}
|
||||
|
||||
/* Public */
|
||||
/* http://imakewebthings.com/waypoints/api/next */
|
||||
Waypoint.prototype.next = function() {
|
||||
return this.group.next(this)
|
||||
}
|
||||
|
||||
/* Public */
|
||||
/* http://imakewebthings.com/waypoints/api/previous */
|
||||
Waypoint.prototype.previous = function() {
|
||||
return this.group.previous(this)
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Waypoint.invokeAll = function(method) {
|
||||
var allWaypointsArray = []
|
||||
for (var waypointKey in allWaypoints) {
|
||||
allWaypointsArray.push(allWaypoints[waypointKey])
|
||||
}
|
||||
for (var i = 0, end = allWaypointsArray.length; i < end; i++) {
|
||||
allWaypointsArray[i][method]()
|
||||
}
|
||||
}
|
||||
|
||||
/* Public */
|
||||
/* http://imakewebthings.com/waypoints/api/destroy-all */
|
||||
Waypoint.destroyAll = function() {
|
||||
Waypoint.invokeAll('destroy')
|
||||
}
|
||||
|
||||
/* Public */
|
||||
/* http://imakewebthings.com/waypoints/api/disable-all */
|
||||
Waypoint.disableAll = function() {
|
||||
Waypoint.invokeAll('disable')
|
||||
}
|
||||
|
||||
/* Public */
|
||||
/* http://imakewebthings.com/waypoints/api/enable-all */
|
||||
Waypoint.enableAll = function() {
|
||||
Waypoint.Context.refreshAll()
|
||||
for (var waypointKey in allWaypoints) {
|
||||
allWaypoints[waypointKey].enabled = true
|
||||
}
|
||||
return this
|
||||
}
|
||||
|
||||
/* Public */
|
||||
/* http://imakewebthings.com/waypoints/api/refresh-all */
|
||||
Waypoint.refreshAll = function() {
|
||||
Waypoint.Context.refreshAll()
|
||||
}
|
||||
|
||||
/* Public */
|
||||
/* http://imakewebthings.com/waypoints/api/viewport-height */
|
||||
Waypoint.viewportHeight = function() {
|
||||
return window.innerHeight || document.documentElement.clientHeight
|
||||
}
|
||||
|
||||
/* Public */
|
||||
/* http://imakewebthings.com/waypoints/api/viewport-width */
|
||||
Waypoint.viewportWidth = function() {
|
||||
return document.documentElement.clientWidth
|
||||
}
|
||||
|
||||
Waypoint.adapters = []
|
||||
|
||||
Waypoint.defaults = {
|
||||
context: window,
|
||||
continuous: true,
|
||||
enabled: true,
|
||||
group: 'default',
|
||||
horizontal: false,
|
||||
offset: 0
|
||||
}
|
||||
|
||||
Waypoint.offsetAliases = {
|
||||
'bottom-in-view': function() {
|
||||
return this.context.innerHeight() - this.adapter.outerHeight()
|
||||
},
|
||||
'right-in-view': function() {
|
||||
return this.context.innerWidth() - this.adapter.outerWidth()
|
||||
}
|
||||
}
|
||||
|
||||
window.Waypoint = Waypoint
|
||||
}())
|
||||
;(function() {
|
||||
'use strict'
|
||||
|
||||
function requestAnimationFrameShim(callback) {
|
||||
window.setTimeout(callback, 1000 / 60)
|
||||
}
|
||||
|
||||
var keyCounter = 0
|
||||
var contexts = {}
|
||||
var Waypoint = window.Waypoint
|
||||
var oldWindowLoad = window.onload
|
||||
|
||||
/* http://imakewebthings.com/waypoints/api/context */
|
||||
function Context(element) {
|
||||
this.element = element
|
||||
this.Adapter = Waypoint.Adapter
|
||||
this.adapter = new this.Adapter(element)
|
||||
this.key = 'waypoint-context-' + keyCounter
|
||||
this.didScroll = false
|
||||
this.didResize = false
|
||||
this.oldScroll = {
|
||||
x: this.adapter.scrollLeft(),
|
||||
y: this.adapter.scrollTop()
|
||||
}
|
||||
this.waypoints = {
|
||||
vertical: {},
|
||||
horizontal: {}
|
||||
}
|
||||
|
||||
element.waypointContextKey = this.key
|
||||
contexts[element.waypointContextKey] = this
|
||||
keyCounter += 1
|
||||
if (!Waypoint.windowContext) {
|
||||
Waypoint.windowContext = true
|
||||
Waypoint.windowContext = new Context(window)
|
||||
}
|
||||
|
||||
this.createThrottledScrollHandler()
|
||||
this.createThrottledResizeHandler()
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Context.prototype.add = function(waypoint) {
|
||||
var axis = waypoint.options.horizontal ? 'horizontal' : 'vertical'
|
||||
this.waypoints[axis][waypoint.key] = waypoint
|
||||
this.refresh()
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Context.prototype.checkEmpty = function() {
|
||||
var horizontalEmpty = this.Adapter.isEmptyObject(this.waypoints.horizontal)
|
||||
var verticalEmpty = this.Adapter.isEmptyObject(this.waypoints.vertical)
|
||||
var isWindow = this.element == this.element.window
|
||||
if (horizontalEmpty && verticalEmpty && !isWindow) {
|
||||
this.adapter.off('.waypoints')
|
||||
delete contexts[this.key]
|
||||
}
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Context.prototype.createThrottledResizeHandler = function() {
|
||||
var self = this
|
||||
|
||||
function resizeHandler() {
|
||||
self.handleResize()
|
||||
self.didResize = false
|
||||
}
|
||||
|
||||
this.adapter.on('resize.waypoints', function() {
|
||||
if (!self.didResize) {
|
||||
self.didResize = true
|
||||
Waypoint.requestAnimationFrame(resizeHandler)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Context.prototype.createThrottledScrollHandler = function() {
|
||||
var self = this
|
||||
function scrollHandler() {
|
||||
self.handleScroll()
|
||||
self.didScroll = false
|
||||
}
|
||||
|
||||
this.adapter.on('scroll.waypoints', function() {
|
||||
if (!self.didScroll || Waypoint.isTouch) {
|
||||
self.didScroll = true
|
||||
Waypoint.requestAnimationFrame(scrollHandler)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Context.prototype.handleResize = function() {
|
||||
Waypoint.Context.refreshAll()
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Context.prototype.handleScroll = function() {
|
||||
var triggeredGroups = {}
|
||||
var axes = {
|
||||
horizontal: {
|
||||
newScroll: this.adapter.scrollLeft(),
|
||||
oldScroll: this.oldScroll.x,
|
||||
forward: 'right',
|
||||
backward: 'left'
|
||||
},
|
||||
vertical: {
|
||||
newScroll: this.adapter.scrollTop(),
|
||||
oldScroll: this.oldScroll.y,
|
||||
forward: 'down',
|
||||
backward: 'up'
|
||||
}
|
||||
}
|
||||
|
||||
for (var axisKey in axes) {
|
||||
var axis = axes[axisKey]
|
||||
var isForward = axis.newScroll > axis.oldScroll
|
||||
var direction = isForward ? axis.forward : axis.backward
|
||||
|
||||
for (var waypointKey in this.waypoints[axisKey]) {
|
||||
var waypoint = this.waypoints[axisKey][waypointKey]
|
||||
if (waypoint.triggerPoint === null) {
|
||||
continue
|
||||
}
|
||||
var wasBeforeTriggerPoint = axis.oldScroll < waypoint.triggerPoint
|
||||
var nowAfterTriggerPoint = axis.newScroll >= waypoint.triggerPoint
|
||||
var crossedForward = wasBeforeTriggerPoint && nowAfterTriggerPoint
|
||||
var crossedBackward = !wasBeforeTriggerPoint && !nowAfterTriggerPoint
|
||||
if (crossedForward || crossedBackward) {
|
||||
waypoint.queueTrigger(direction)
|
||||
triggeredGroups[waypoint.group.id] = waypoint.group
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (var groupKey in triggeredGroups) {
|
||||
triggeredGroups[groupKey].flushTriggers()
|
||||
}
|
||||
|
||||
this.oldScroll = {
|
||||
x: axes.horizontal.newScroll,
|
||||
y: axes.vertical.newScroll
|
||||
}
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Context.prototype.innerHeight = function() {
|
||||
/*eslint-disable eqeqeq */
|
||||
if (this.element == this.element.window) {
|
||||
return Waypoint.viewportHeight()
|
||||
}
|
||||
/*eslint-enable eqeqeq */
|
||||
return this.adapter.innerHeight()
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Context.prototype.remove = function(waypoint) {
|
||||
delete this.waypoints[waypoint.axis][waypoint.key]
|
||||
this.checkEmpty()
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Context.prototype.innerWidth = function() {
|
||||
/*eslint-disable eqeqeq */
|
||||
if (this.element == this.element.window) {
|
||||
return Waypoint.viewportWidth()
|
||||
}
|
||||
/*eslint-enable eqeqeq */
|
||||
return this.adapter.innerWidth()
|
||||
}
|
||||
|
||||
/* Public */
|
||||
/* http://imakewebthings.com/waypoints/api/context-destroy */
|
||||
Context.prototype.destroy = function() {
|
||||
var allWaypoints = []
|
||||
for (var axis in this.waypoints) {
|
||||
for (var waypointKey in this.waypoints[axis]) {
|
||||
allWaypoints.push(this.waypoints[axis][waypointKey])
|
||||
}
|
||||
}
|
||||
for (var i = 0, end = allWaypoints.length; i < end; i++) {
|
||||
allWaypoints[i].destroy()
|
||||
}
|
||||
}
|
||||
|
||||
/* Public */
|
||||
/* http://imakewebthings.com/waypoints/api/context-refresh */
|
||||
Context.prototype.refresh = function() {
|
||||
/*eslint-disable eqeqeq */
|
||||
var isWindow = this.element == this.element.window
|
||||
/*eslint-enable eqeqeq */
|
||||
var contextOffset = isWindow ? undefined : this.adapter.offset()
|
||||
var triggeredGroups = {}
|
||||
var axes
|
||||
|
||||
this.handleScroll()
|
||||
axes = {
|
||||
horizontal: {
|
||||
contextOffset: isWindow ? 0 : contextOffset.left,
|
||||
contextScroll: isWindow ? 0 : this.oldScroll.x,
|
||||
contextDimension: this.innerWidth(),
|
||||
oldScroll: this.oldScroll.x,
|
||||
forward: 'right',
|
||||
backward: 'left',
|
||||
offsetProp: 'left'
|
||||
},
|
||||
vertical: {
|
||||
contextOffset: isWindow ? 0 : contextOffset.top,
|
||||
contextScroll: isWindow ? 0 : this.oldScroll.y,
|
||||
contextDimension: this.innerHeight(),
|
||||
oldScroll: this.oldScroll.y,
|
||||
forward: 'down',
|
||||
backward: 'up',
|
||||
offsetProp: 'top'
|
||||
}
|
||||
}
|
||||
|
||||
for (var axisKey in axes) {
|
||||
var axis = axes[axisKey]
|
||||
for (var waypointKey in this.waypoints[axisKey]) {
|
||||
var waypoint = this.waypoints[axisKey][waypointKey]
|
||||
var adjustment = waypoint.options.offset
|
||||
var oldTriggerPoint = waypoint.triggerPoint
|
||||
var elementOffset = 0
|
||||
var freshWaypoint = oldTriggerPoint == null
|
||||
var contextModifier, wasBeforeScroll, nowAfterScroll
|
||||
var triggeredBackward, triggeredForward
|
||||
|
||||
if (waypoint.element !== waypoint.element.window) {
|
||||
elementOffset = waypoint.adapter.offset()[axis.offsetProp]
|
||||
}
|
||||
|
||||
if (typeof adjustment === 'function') {
|
||||
adjustment = adjustment.apply(waypoint)
|
||||
}
|
||||
else if (typeof adjustment === 'string') {
|
||||
adjustment = parseFloat(adjustment)
|
||||
if (waypoint.options.offset.indexOf('%') > - 1) {
|
||||
adjustment = Math.ceil(axis.contextDimension * adjustment / 100)
|
||||
}
|
||||
}
|
||||
|
||||
contextModifier = axis.contextScroll - axis.contextOffset
|
||||
waypoint.triggerPoint = Math.floor(elementOffset + contextModifier - adjustment)
|
||||
wasBeforeScroll = oldTriggerPoint < axis.oldScroll
|
||||
nowAfterScroll = waypoint.triggerPoint >= axis.oldScroll
|
||||
triggeredBackward = wasBeforeScroll && nowAfterScroll
|
||||
triggeredForward = !wasBeforeScroll && !nowAfterScroll
|
||||
|
||||
if (!freshWaypoint && triggeredBackward) {
|
||||
waypoint.queueTrigger(axis.backward)
|
||||
triggeredGroups[waypoint.group.id] = waypoint.group
|
||||
}
|
||||
else if (!freshWaypoint && triggeredForward) {
|
||||
waypoint.queueTrigger(axis.forward)
|
||||
triggeredGroups[waypoint.group.id] = waypoint.group
|
||||
}
|
||||
else if (freshWaypoint && axis.oldScroll >= waypoint.triggerPoint) {
|
||||
waypoint.queueTrigger(axis.forward)
|
||||
triggeredGroups[waypoint.group.id] = waypoint.group
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Waypoint.requestAnimationFrame(function() {
|
||||
for (var groupKey in triggeredGroups) {
|
||||
triggeredGroups[groupKey].flushTriggers()
|
||||
}
|
||||
})
|
||||
|
||||
return this
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Context.findOrCreateByElement = function(element) {
|
||||
return Context.findByElement(element) || new Context(element)
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Context.refreshAll = function() {
|
||||
for (var contextId in contexts) {
|
||||
contexts[contextId].refresh()
|
||||
}
|
||||
}
|
||||
|
||||
/* Public */
|
||||
/* http://imakewebthings.com/waypoints/api/context-find-by-element */
|
||||
Context.findByElement = function(element) {
|
||||
return contexts[element.waypointContextKey]
|
||||
}
|
||||
|
||||
window.onload = function() {
|
||||
if (oldWindowLoad) {
|
||||
oldWindowLoad()
|
||||
}
|
||||
Context.refreshAll()
|
||||
}
|
||||
|
||||
|
||||
Waypoint.requestAnimationFrame = function(callback) {
|
||||
var requestFn = window.requestAnimationFrame ||
|
||||
window.mozRequestAnimationFrame ||
|
||||
window.webkitRequestAnimationFrame ||
|
||||
requestAnimationFrameShim
|
||||
requestFn.call(window, callback)
|
||||
}
|
||||
Waypoint.Context = Context
|
||||
}())
|
||||
;(function() {
|
||||
'use strict'
|
||||
|
||||
function byTriggerPoint(a, b) {
|
||||
return a.triggerPoint - b.triggerPoint
|
||||
}
|
||||
|
||||
function byReverseTriggerPoint(a, b) {
|
||||
return b.triggerPoint - a.triggerPoint
|
||||
}
|
||||
|
||||
var groups = {
|
||||
vertical: {},
|
||||
horizontal: {}
|
||||
}
|
||||
var Waypoint = window.Waypoint
|
||||
|
||||
/* http://imakewebthings.com/waypoints/api/group */
|
||||
function Group(options) {
|
||||
this.name = options.name
|
||||
this.axis = options.axis
|
||||
this.id = this.name + '-' + this.axis
|
||||
this.waypoints = []
|
||||
this.clearTriggerQueues()
|
||||
groups[this.axis][this.name] = this
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Group.prototype.add = function(waypoint) {
|
||||
this.waypoints.push(waypoint)
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Group.prototype.clearTriggerQueues = function() {
|
||||
this.triggerQueues = {
|
||||
up: [],
|
||||
down: [],
|
||||
left: [],
|
||||
right: []
|
||||
}
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Group.prototype.flushTriggers = function() {
|
||||
for (var direction in this.triggerQueues) {
|
||||
var waypoints = this.triggerQueues[direction]
|
||||
var reverse = direction === 'up' || direction === 'left'
|
||||
waypoints.sort(reverse ? byReverseTriggerPoint : byTriggerPoint)
|
||||
for (var i = 0, end = waypoints.length; i < end; i += 1) {
|
||||
var waypoint = waypoints[i]
|
||||
if (waypoint.options.continuous || i === waypoints.length - 1) {
|
||||
waypoint.trigger([direction])
|
||||
}
|
||||
}
|
||||
}
|
||||
this.clearTriggerQueues()
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Group.prototype.next = function(waypoint) {
|
||||
this.waypoints.sort(byTriggerPoint)
|
||||
var index = Waypoint.Adapter.inArray(waypoint, this.waypoints)
|
||||
var isLast = index === this.waypoints.length - 1
|
||||
return isLast ? null : this.waypoints[index + 1]
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Group.prototype.previous = function(waypoint) {
|
||||
this.waypoints.sort(byTriggerPoint)
|
||||
var index = Waypoint.Adapter.inArray(waypoint, this.waypoints)
|
||||
return index ? this.waypoints[index - 1] : null
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Group.prototype.queueTrigger = function(waypoint, direction) {
|
||||
this.triggerQueues[direction].push(waypoint)
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Group.prototype.remove = function(waypoint) {
|
||||
var index = Waypoint.Adapter.inArray(waypoint, this.waypoints)
|
||||
if (index > -1) {
|
||||
this.waypoints.splice(index, 1)
|
||||
}
|
||||
}
|
||||
|
||||
/* Public */
|
||||
/* http://imakewebthings.com/waypoints/api/first */
|
||||
Group.prototype.first = function() {
|
||||
return this.waypoints[0]
|
||||
}
|
||||
|
||||
/* Public */
|
||||
/* http://imakewebthings.com/waypoints/api/last */
|
||||
Group.prototype.last = function() {
|
||||
return this.waypoints[this.waypoints.length - 1]
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Group.findOrCreate = function(options) {
|
||||
return groups[options.axis][options.name] || new Group(options)
|
||||
}
|
||||
|
||||
Waypoint.Group = Group
|
||||
}())
|
||||
;(function() {
|
||||
'use strict'
|
||||
|
||||
var $ = window.jQuery
|
||||
var Waypoint = window.Waypoint
|
||||
|
||||
function JQueryAdapter(element) {
|
||||
this.$element = $(element)
|
||||
}
|
||||
|
||||
$.each([
|
||||
'innerHeight',
|
||||
'innerWidth',
|
||||
'off',
|
||||
'offset',
|
||||
'on',
|
||||
'outerHeight',
|
||||
'outerWidth',
|
||||
'scrollLeft',
|
||||
'scrollTop'
|
||||
], function(i, method) {
|
||||
JQueryAdapter.prototype[method] = function() {
|
||||
var args = Array.prototype.slice.call(arguments)
|
||||
return this.$element[method].apply(this.$element, args)
|
||||
}
|
||||
})
|
||||
|
||||
$.each([
|
||||
'extend',
|
||||
'inArray',
|
||||
'isEmptyObject'
|
||||
], function(i, method) {
|
||||
JQueryAdapter[method] = $[method]
|
||||
})
|
||||
|
||||
Waypoint.adapters.push({
|
||||
name: 'jquery',
|
||||
Adapter: JQueryAdapter
|
||||
})
|
||||
Waypoint.Adapter = JQueryAdapter
|
||||
}())
|
||||
;(function() {
|
||||
'use strict'
|
||||
|
||||
var Waypoint = window.Waypoint
|
||||
|
||||
function createExtension(framework) {
|
||||
return function() {
|
||||
var waypoints = []
|
||||
var overrides = arguments[0]
|
||||
|
||||
if (framework.isFunction(arguments[0])) {
|
||||
overrides = framework.extend({}, arguments[1])
|
||||
overrides.handler = arguments[0]
|
||||
}
|
||||
|
||||
this.each(function() {
|
||||
var options = framework.extend({}, overrides, {
|
||||
element: this
|
||||
})
|
||||
if (typeof options.context === 'string') {
|
||||
options.context = framework(this).closest(options.context)[0]
|
||||
}
|
||||
waypoints.push(new Waypoint(options))
|
||||
})
|
||||
|
||||
return waypoints
|
||||
}
|
||||
}
|
||||
|
||||
if (window.jQuery) {
|
||||
window.jQuery.fn.waypoint = createExtension(window.jQuery)
|
||||
}
|
||||
if (window.Zepto) {
|
||||
window.Zepto.fn.waypoint = createExtension(window.Zepto)
|
||||
}
|
||||
}())
|
||||
;
|
||||
Reference in New Issue
Block a user