Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var isMobile = {
- Android: function() {
- return navigator["userAgent"]["match"](/Android/i)
- },
- BlackBerry: function() {
- return navigator["userAgent"]["match"](/BlackBerry/i)
- },
- iOS: function() {
- return navigator["userAgent"]["match"](/iPhone|iPad|iPod/i)
- },
- Opera: function() {
- return navigator["userAgent"]["match"](/Opera Mini/i)
- },
- Windows: function() {
- return navigator["userAgent"]["match"](/IEMobile/i)
- },
- any: function() {
- return (isMobile.Android() || isMobile.BlackBerry() || isMobile["iOS"]() || isMobile.Opera() || isMobile.Windows())
- }
- };
- var ini_btnShare = function() {
- var variable_0 = document["querySelector"]("a[shdwsp]");
- var variable_1 = document["querySelector"]("a[data-cpa]");
- var variable_2 = document["querySelector"]("span[shdwsp_counter]");
- var variable_3 = 0;
- var variable_4 = variable_0["getAttribute"]("shared-max");
- var variable_5 = "wexnchdpxix";
- variable_2["innerHTML"] = variable_4;
- variable_1["onclick"] = function() {
- var variable_6 = variable_1["getAttribute"]("data-cpa");
- if (getCookie(variable_5) == "completed") {
- window["location"]["href"] = variable_6
- }
- };
- variable_0["onclick"] = function() {
- if (isMobile["any"]()) {
- var variable_7 = variable_0["getAttribute"]("data-text");
- var variable_8 = variable_0["getAttribute"]("data-link");
- var variable_9 = encodeURIComponent(variable_7) + " - " + encodeURIComponent(variable_8);
- if (variable_4 != 0) {
- var variable_10 = "whatsapp://send?text=" + variable_9;
- window["location"]["href"] = variable_10;
- variable_4--;
- setCookie(variable_5, variable_4, 5);
- variable_2["innerHTML"] = variable_4;
- if (variable_4 <= 0) {
- setCookie(variable_5, "completed", 5);
- variable_1["classList"]["add"]("btnActive")
- }
- }
- } else {
- alert("Please share this article in mobile device")
- }
- }
- };
- function setCookie(variable_11, variable_120, variable_121) {
- var variable_122 = new Date();
- variable_122["setTime"](variable_122["getTime"]() + (variable_121 * 24 * 60 * 60 * 1000));
- var variable_123 = "expires=" + variable_122["toUTCString"]();
- document["cookie"] = variable_11 + "=" + variable_120 + ";" + variable_123 + ";path=/"
- }
- function getCookie(variable_11) {
- var variable_125 = variable_11 + "=";
- var variable_126 = document["cookie"]["split"](";");
- for (var variable_127 = 0; variable_127 < variable_126["length"]; variable_127++) {
- var variable_128 = variable_126[variable_127];
- while (variable_128["charAt"](0) == " ") {
- variable_128 = variable_128["substring"](1)
- };
- if (variable_128["indexOf"](variable_125) == 0) {
- return variable_128["substring"](variable_125["length"], variable_128["length"])
- }
- };
- return ""
- }
- window[addEventListener ? "addEventListener" : "attachEvent"](addEventListener ? "load" : "onload", ini_btnShare)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement