| Server IP : 20.75.53.88 / Your IP : 216.73.217.72 [ Web Server : Apache System : Linux VMRALP-3 4.4.0-256-generic #290~14.04.1-Ubuntu SMP Thu Jun 20 09:24:50 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 5.5.9-1ubuntu4.29+esm15 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, Domains : 3 Domains MySQL : ON | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/portais/poranga/js/ |
Upload File : |
(function (e) {
e.fn.easyView = function (t, n) {
var r = e(this.selector);
if (typeof r.data("easyView") == "undefined") {
if (typeof t == "string") {
t = {}
}
var i = {
selector: r,
currentRatio: 100,
normalContrast: true,
defaults: {
container: "body",
tags: ["h1", "h2", "h3", "h4", "h5", "h6", "div", "p", "a", "span", "strong", "em", "ul", "ol", "li", "section", "blockquote"],
step: 10,
bootstrap: true,
defaultMarkup: '<a href="#decrease" class="decrease-text">Decrease font size</a><a href="#normal" class="reset-text">Normal font size</a><a href="#increase" class="increase-text">Increase font size</a><a href="#contrast" class="contrast-text">Change contrast</a>',
increaseSelector: ".increase-text",
decreaseSelector: ".decrease-text",
normalSelector: ".reset-text",
contrastSelector: ".contrast-text"
},
options: {},
affectedTags: new Array,
mergeOptions: function (t) {
e.extend(this.options, this.defaults, t)
},
storeDefaults: function () {
e(this.affectedTags.join(",")).each(function () {
var t = e(this);
var n = t.css("font-size");
if (n.indexOf("%") > -1) {
t.data("originalSize", parseInt(n.replace("%", "")));
t.data("originalUnit", "%")
} else {
t.data("originalSize", parseInt(n.replace(n.substr(-2), "")));
t.data("originalUnit", n.substr(-2))
}
t.data("originalBackground", t.css("background-color"));
t.data("originalColor", t.css("color"))
});
e(this.options.container).data("originalBackground", e(this.options.container).css("background-color"));
e(this.options.container).data("originalColor", e(this.options.container).css("color"))
},
createDefaultMarkup: function () {
if (r.html() == "") {
r.html(this.options.defaultMarkup)
}
},
setActions: function () {
var e = this;
r.find(this.options.decreaseSelector).click(function (t) {
t.preventDefault();
e.decreaseFont()
});
r.find(this.options.normalSelector).click(function (t) {
t.preventDefault();
e.resetFont()
});
r.find(this.options.increaseSelector).click(function (t) {
t.preventDefault();
e.increaseFont()
});
r.find(this.options.contrastSelector).click(function (t) {
t.preventDefault();
e.changeContrast()
})
},
fetchTags: function () {
var t = this.affectedTags;
var n = this.options;
e.each(this.options.tags, function (e, r) {
t.push(n.container + " " + r)
})
},
decreaseFont: function () {
if (this.currentRatio - this.options.step >= 10) {
this.currentRatio = this.currentRatio - this.options.step
}
this.changeFontSize()
},
resetFont: function () {
this.currentRatio = 100;
this.changeFontSize()
},
increaseFont: function () {
this.currentRatio = this.currentRatio + this.options.step;
this.changeFontSize()
},
changeFontSize: function (t) {
if (typeof t != "undefined" && parseInt(t) > 10) {
this.currentRatio = t
}
var n = this.currentRatio;
e(this.affectedTags.join(",")).each(function () {
var t = e(this);
t.css("font-size", t.data("originalSize") * (n / 100) + t.data("originalUnit"))
})
},
changeContrast: function () {
e(this.affectedTags).each(function () {
var t = e(this);
t.css("background-color", !this.normalContrast ? t.data("originalBackground") : "#000");
t.css("color", !this.normalContrast ? t.data("originalColor") : "transparent")
});
e(this.options.container).css("background-color", !this.normalContrast ? e(this.options.container).data("originalBackground") : "#000");
e(this.options.container).css("color", !this.normalContrast ? e(this.options.container).data("originalColor") : "#fff");
this.normalContrast = !this.normalContrast
},
startPlugin: function (e) {
this.mergeOptions(e);
this.fetchTags();
this.storeDefaults();
this.createDefaultMarkup();
this.setActions()
},
executeFunction: function (e, t) {
switch (e) {
case"decrease":
this.decreaseFont();
break;
case"reset":
this.resetFont();
break;
case"increase":
this.increaseFont();
break;
case"contrast":
if (typeof t != "undefined") {
if (t) {
this.normalContrast = true
} else {
this.normalContrast = false
}
}
this.changeContrast();
break;
case"setRatio":
this.changeFontSize(ratio);
break;
default:
alert("Called function does not exist!");
break
}
},
destroy: function () {
this.resetFont();
this.normalContrast = false;
this.changeContrast();
r.removeData("easyView")
}
};
i.startPlugin(t);
r.data("easyView", i)
} else {
var i = r.data("easyView");
if (typeof t == "object") {
i.destroy();
i.startPlugin(t)
} else if (typeof t == "string") {
i.executeFunction(t, n)
} else {
alert("Invalid params to start")
}
}
}
})(jQuery)