Elencanto Mag Issue 2 Sample | FlipHTML5londonmagazinesLondon's Fashion and Style MagazineTags: hairelementsanalysisgreytoxicnaturalspecicelencantolevelstoxic elementshair analysismen reshadeelencanto salonelencanto salon spasalon spagrey blendingelencanto magazineclinical research indicatesUnlike"); // } // }, function() { // if (isLiked) { // $likeButton.html(" Liked"); // } // }); var $likeCount = $("#show-info-like-count"); var $likeLoading = $(""); function like () { if (isLiked) { $.ajax({ type: "POST", url: "/center/db/del-favorite-online.php", dataType: "json", data: { userid: fh5.uId, bookid: "6602" }, beforeSend: function() { isLiking = true; $likeButton.addClass("empty").append($likeLoading); }, success: function(data) { isLiking = false; $likeButton.removeClass("empty"); $likeLoading.remove(); if (data.status == "1") { $likeButton.removeClass("red").attr("title", "Add to my favorites"); $likeCount.html(parseInt($likeCount.text()) - 1); isLiked = false; } else { $likeButton.removeClass("empty"); } }, error: function() { isLiking = false; $likeButton.removeClass("empty"); $likeLoading.remove(); } }); } else { $.ajax({ type: "POST", url: "/center/db/add-favorite-online.php", dataType: "json", data: { userid: fh5.uId, bookid: "6602" }, beforeSend: function() { isLiking = true; $likeButton.addClass("empty").append($likeLoading); }, success: function(data) { isLiking = false; $likeButton.removeClass("empty"); $likeLoading.remove(); if (data.status == "1") { $likeButton.addClass("red").attr("title", "Remove from my favorites"); $likeLoading.remove(); $likeCount.html(parseInt($likeCount.text()) + 1); isLiked = true; } }, error: function() { isLiking = false; $likeButton.removeClass("empty"); $likeLoading.remove(); } }); } } // emial share var $emailBtn = $("#show-info-left-email-button"); $emailBtn.on("click", function(){ if (fh5.isLoggedIn) { shareFn(); } else { new SignInPanel({ callback: shareFn }); } }); console.log(customDomain) var shareFn = function() { new EmailPanel({ bookId: bookId, onlineUrl: url, url: customDomain != "" ? "http://" + customDomain + "/books/" + bLink : location.origin + "/" + uLink + "/" + bLink }); }; // end email share // subscribe var $subscribeButton = $("#show-subscribe-button"), $subscribeButtonText = $("#show-subscribe-button-text"), isSubscribed = "", isSubscribing = false; var $followerCount = $("#show-info-follower-count"); $subscribeButton.on("click", function() { if (isSubscribing) { return; } if (fh5.isLoggedIn) { subscribe(); } else { new SignInPanel({ callback: function() { subscribe(); } }); } }); $subscribeButton.hover(function() { if (isSubscribed) { $subscribeButtonText.html("Unfollow"); } }, function() { if (isSubscribed) { $subscribeButtonText.html("Following"); } }); function subscribe () { if (isSubscribed) { $.ajax({ type: "POST", url: "/center/db/del-subscribe-online.php", dataType: "json", data: { userid: fh5.uId, sub_userid: "7534" }, beforeSend: function() { utils.addSpin($subscribeButton); isSubscribing = true; }, success: function(data) { isSubscribing = false; if (data.status == "1") { utils.removeSpin($subscribeButton); $subscribeButton.addClass("button-pure-blue").attr("title", "Follow this publisher"); $subscribeButtonText.html("Follow"); $followerCount.html(parseInt($followerCount.text()) - 1); isSubscribed = false; } else { utils.removeSpin($subscribeButton); } }, error: function() { isSubscribing = false; utils.removeSpin($subscribeButton); } }); } else { $.ajax({ type: "POST", url: "/center/db/add-subscribe-online.php", dataType: "json", data: { userid: fh5.uId, sub_userid: "7534" }, beforeSend: function() { utils.addSpin($subscribeButton); }, success: function(data) { if (data.status == "1") { utils.removeSpin($subscribeButton); $subscribeButton.removeClass("button-pure-blue").attr("title", "Unfollow this publisher"); $subscribeButtonText.html("Following"); $followerCount.html(parseInt($followerCount.text()) + 1); isSubscribed = true; } else { utils.removeSpin($subscribeButton); } }, error: function() { utils.removeSpin($subscribeButton); } }); } } // end subscribe // bind download event var downloading = false; var $downloadBtn = $("#show-download-button"); var $downloadLoading = $(""); var downloadFn = function() { new BookDownloadPanel({ userid: fh5.uId, bookId: bookId, isDownload: isDownload, bookUserId: bookUserId, isReader: true, type: type, }); // $.ajax({ // url: "/download/download-pdf-file.php", // type: "get", // dataType: "json", // data: { // bookid: bookId, // noAutoDownload: "1" // }, // beforeSend: function() { // downloading = true; // $downloadBtn.addClass("empty").append($downloadLoading); // }, // success: function(data) { // downloading = false; // $downloadBtn.removeClass("empty"); // $downloadLoading.remove(); // switch (data.status) { // case "1": // sta.bookDownload(bookId); // if (!location.href.match("localhost")) { // window.open(data.url, "_self"); // if (ga) { // ga('send', 'event', 'pdf-download', this.href, document.location.pathname); // } // } // if (data.isNeedPoints == "1") { // new PDFDownloadingPanel({ // points: data.points // }); // } // break; // case "3": // new DownloadPointPanel({ // isNoPoints: true // }); // break; // default: // utils.launchNote(data.error); // break; // } // }, // error: function(error) { // downloading = false; // $downloadBtn.removeClass("empty"); // $downloadLoading.remove(); // } // }); }; $downloadBtn.on("click", function() { if (fh5.isLoggedIn) { if (fh5.isUnActivate == '1') { window.location.href = "/activate-account/index.php"; //添加注册新账户,邮箱激活 return; } downloadFn(); } else { window.open("/login.php?register", "_blank"); /* new SignUpPanel({ isToDownload: true, callback: downloadFn }); */ } }); // end download //show mobile App box var $mobileButton =$('#show-mobile-button'); var $reportButton =$('#show-report-button'); $mobileButton.on('click',function(){ new MobileAppPanel({bookId:bookId}); }); $reportButton.on('click',function(){ new ReportBookPanel({bookId:bookId,url:url}); }) }); })(window.jQuery);
