Best JavaScript code snippet using karma
custom-admin.js
Source:custom-admin.js
1function sfsi_plus_update_index() {2 var s = 1;3 SFSI("ul.plus_icn_listing li.plus_custom").each(function() {4 SFSI(this).children("span.sfsiplus_custom-txt").html("Custom " + s), s++;5 }), cntt = 1, SFSI("div.cm_lnk").each(function() {6 SFSI(this).find("h2.custom").find("span.sfsiCtxt").html("Custom " + cntt + ":"), 7 cntt++;8 }), cntt = 1, SFSI("div.plus_custom_m").find("div.sfsiplus_custom_section").each(function() {9 SFSI(this).find("label").html("Custom " + cntt + ":"), cntt++;10 });11}12function sfsipluscollapse(s)13{14 var i = !0, e = SFSI(s).closest("div.ui-accordion-content").prev("h3.ui-accordion-header"), t = SFSI(s).closest("div.ui-accordion-content").first();15 e.toggleClass("ui-corner-all", i).toggleClass("accordion-header-active ui-state-active ui-corner-top", !i).attr("aria-selected", (!i).toString()), 16 e.children(".ui-icon").toggleClass("ui-icon-triangle-1-e", i).toggleClass("ui-icon-triangle-1-s", !i), 17 t.toggleClass("accordion-content-active", !i), i ? t.slideUp() :t.slideDown();18}19function sfsi_plus_delete_CusIcon(s, i)20{21 sfsiplus_beForeLoad();22 var e = {23 action:"plus_deleteIcons",24 icon_name:i.attr("name")25 };26 SFSI.ajax({27 url:ajax_object.ajax_url,28 type:"post",29 data:e,30 dataType:"json",31 success:function(e) {32 if ("success" == e.res) {33 sfsiplus_showErrorSuc("success", "Saved !", 1);34 var t = e.last_index + 1;35 var attr = i.attr("name");36 attr = attr.replace('plus', '');37 SFSI("#plus_total_cusotm_icons").val(e.total_up), SFSI(s).closest(".plus_custom").remove(), 38 SFSI("li.plus_custom:last-child").addClass("bdr_btm_non"), SFSI(".plus_custom-links").find("div." + attr).remove(), 39 SFSI(".plus_custom_m").find("div." + attr).remove(), SFSI(".plus_share_icon_order").children("li." + attr).remove(), 40 SFSI("ul.plus_sfsi_sample_icons").children("li." + attr).remove();41 var n = e.total_up + 1;42 4 == e.total_up && SFSI(".plus_icn_listing").append('<li id="plus_c' + t + '" class="plus_custom bdr_btm_non"><div class="radio_section tb_4_ck"><span class="checkbox" dynamic_ele="yes" style="background-position: 0px 0px;"></span><input name="plussfsiICON_' + t + '_display" type="checkbox" value="yes" class="styled" style="display:none;" element-type="sfsiplus-cusotm-icon" isNew="yes" /></div> <span class="plus_custom-img"><img src="' + SFSI("#plugin_url").val() + 'images/custom.png" id="plus_CImg_' + t + '" /> </span> <span class="custom sfsiplus_custom-txt">Custom' + n + ' </span> <div class="sfsiplus_right_info"> <p><span>'+object_name1.It_depends+':</span> '+object_name1.Upload_a+'</p><div class="inputWrapper"></div></li>');43 } else sfsiplus_showErrorSuc("error", "Unkown error , please try again", 1);44 return sfsi_plus_update_index(), plus_update_Sec5Iconorder(), sfsi_plus_update_step1(), sfsi_plus_update_step5(), 45 sfsiplus_afterLoad(), "suc";46 }47 });48}49function plus_update_Sec5Iconorder()50{51 SFSI("ul.plus_share_icon_order").children("li").each(function() {52 SFSI(this).attr("data-index", SFSI(this).index() + 1);53 });54}55function sfsi_plus_section_Display(s, i)56{57 "hide" == i ? (SFSI("." + s + " :input").prop("disabled", !0), SFSI("." + s + " :button").prop("disabled", !0), 58 SFSI("." + s).hide()) :(SFSI("." + s + " :input").removeAttr("disabled", !0), SFSI("." + s + " :button").removeAttr("disabled", !0), 59 SFSI("." + s).show());60}61function sfsi_plus_depened_sections()62{63 if ("sfsi" == SFSI("input[name='sfsi_plus_rss_icons']:checked").val()) {64 for (i = 0; 16 > i; i++) {65 var s = i + 1, e = 74 * i;66 SFSI(".sfsiplus_row_" + s + "_2").css("background-position", "-588px -" + e + "px");67 }68 var t = SFSI(".icon_img").attr("src");69 if(t)70 {71 if (t.indexOf("subscribe") !=-1)72 {73 var n = t.replace("subscribe.png", "sf_arow_icn.png");74 }75 else76 {77 var n = t.replace("email.png", "sf_arow_icn.png");78 }79 SFSI(".icon_img").attr("src", n);80 }81 }82 else83 {84 if("email" == SFSI("input[name='sfsi_plus_rss_icons']:checked").val())85 {86 for (SFSI(".sfsiplus_row_1_2").css("background-position", "-58px 0"), i = 0; 16 > i; i++) {87 var s = i + 1, e = 74 * i;88 SFSI(".sfsiplus_row_" + s + "_2").css("background-position", "-58px -" + e + "px");89 }90 var t = SFSI(".icon_img").attr("src");91 if (t) {92 if (t.indexOf("sf_arow_icn") !=-1)93 {94 var n = t.replace("sf_arow_icn.png", "email.png");95 }96 else97 {98 var n = t.replace("subscribe.png", "email.png");99 }100 SFSI(".icon_img").attr("src", n);101 }102 }103 else104 {105 for (SFSI(".sfsiplus_row_1_2").css("background-position", "-649px 0"), i = 0; 16 > i; i++) {106 var s = i + 1, e = 74 * i;107 SFSI(".sfsiplus_row_" + s + "_2").css("background-position", "-649px -" + e + "px");108 }109 var t = SFSI(".icon_img").attr("src");110 if (t) {111 if (t.indexOf("email") !=-1)112 {113 var n = t.replace("email.png", "subscribe.png");114 }115 else116 {117 var n = t.replace("sf_arow_icn.png", "subscribe.png");118 }119 SFSI(".icon_img").attr("src", n);120 }121 }122 }123 SFSI("input[name='sfsi_plus_rss_display']").prop("checked") ? sfsi_plus_section_Display("sfsiplus_rss_section", "show") :sfsi_plus_section_Display("sfsiplus_rss_section", "hide"), 124 SFSI("input[name='sfsi_plus_email_display']").prop("checked") ? sfsi_plus_section_Display("sfsiplus_email_section", "show") :sfsi_plus_section_Display("sfsiplus_email_section", "hide"), 125 SFSI("input[name='sfsi_plus_facebook_display']").prop("checked") ? sfsi_plus_section_Display("sfsiplus_facebook_section", "show") :sfsi_plus_section_Display("sfsiplus_facebook_section", "hide"), 126 SFSI("input[name='sfsi_plus_twitter_display']").prop("checked") ? sfsi_plus_section_Display("sfsiplus_twitter_section", "show") :sfsi_plus_section_Display("sfsiplus_twitter_section", "hide"), 127 SFSI("input[name='sfsi_plus_google_display']").prop("checked") ? sfsi_plus_section_Display("sfsiplus_google_section", "show") :sfsi_plus_section_Display("sfsiplus_google_section", "hide"), 128 SFSI("input[name='sfsi_plus_share_display']").prop("checked") ? sfsi_plus_section_Display("sfsiplus_share_section", "show") :sfsi_plus_section_Display("sfsiplus_share_section", "hide"), 129 SFSI("input[name='sfsi_plus_youtube_display']").prop("checked") ? sfsi_plus_section_Display("sfsiplus_youtube_section", "show") :sfsi_plus_section_Display("sfsiplus_youtube_section", "hide"), 130 SFSI("input[name='sfsi_plus_pinterest_display']").prop("checked") ? sfsi_plus_section_Display("sfsiplus_pinterest_section", "show") :sfsi_plus_section_Display("sfsiplus_pinterest_section", "hide"), 131 SFSI("input[name='sfsi_plus_instagram_display']").prop("checked") ? sfsi_plus_section_Display("sfsiplus_instagram_section", "show") :sfsi_plus_section_Display("sfsiplus_instagram_section", "hide"), 132 SFSI("input[name='sfsi_plus_houzz_display']").prop("checked") ? sfsi_plus_section_Display("sfsiplus_houzz_section", "show") :sfsi_plus_section_Display("sfsiplus_houzz_section", "hide"), 133 SFSI("input[name='sfsi_plus_linkedin_display']").prop("checked") ? sfsi_plus_section_Display("sfsiplus_linkedin_section", "show") :sfsi_plus_section_Display("sfsiplus_linkedin_section", "hide"), 134 SFSI("input[element-type='sfsiplus-cusotm-icon']").prop("checked") ? sfsi_plus_section_Display("sfsiplus_custom_section", "show") :sfsi_plus_section_Display("sfsiplus_custom_section", "hide");135}136function PlusCustomIConSectionsUpdate()137{138 sfsi_plus_section_Display("counter".ele, show);139}140// Upload Custom Skin {Monad}141function plus_sfsi_customskin_upload(s, ref)142{143 var ttl = jQuery(ref).attr("title");144 var i = s, e = {145 action:"plus_UploadSkins",146 custom_imgurl:i147 };148 SFSI.ajax({149 url:ajax_object.ajax_url,150 type:"post",151 data:e,152 success:function(msg) {153 if (msg.res = "success")154 {155 var arr = s.split('=');156 jQuery(ref).prev('.imgskin').attr('src', arr[1]);157 jQuery(ref).prev('.imgskin').css("display","block");158 jQuery(ref).text("Update");159 jQuery(ref).next('.dlt_btn').css("display","block");160 }161 }162 });163}164// Delete Custom Skin {Monad}165function sfsiplus_deleteskin_icon(s)166{167 var iconname = jQuery(s).attr("title");168 var nonce = jQuery(s).attr("data-nonce");169 var i = iconname, e = {170 action:"plus_DeleteSkin",171 iconname:i,172 nonce:nonce173 };174 175 SFSI.ajax({176 url:ajax_object.ajax_url,177 type:"post",178 data:e,179 dataType: "json",180 success:function(msg) {181 if (msg.res === "success")182 {183 SFSI(s).prev("a").text("Upload");184 SFSI(s).prev("a").prev("img").attr("src",'');185 SFSI(s).prev("a").prev("img").css("display","none");186 SFSI(s).css("display","none");187 }188 else189 {190 alert("Whoops! something went wrong.")191 }192 }193 });194}195// Save Custom Skin {Monad}196function SFSI_plus_done()197{198 e = { action:"plus_Iamdone" };199 200 SFSI.ajax({201 url:ajax_object.ajax_url,202 type:"post",203 data:e,204 success:function(msg) {205 jQuery("li.cstomskins_upload").children(".sfsiplus_icns_tab_3").html(msg);206 SFSI("input[name='sfsi_plus_rss_display']").prop("checked") ? sfsi_plus_section_Display("sfsiplus_rss_section", "show") :sfsi_plus_section_Display("sfsiplus_rss_section", "hide"),SFSI("input[name='sfsi_plus_email_display']").prop("checked") ? sfsi_plus_section_Display("sfsiplus_email_section", "show") :sfsi_plus_section_Display("sfsiplus_email_section", "hide"),SFSI("input[name='sfsi_plus_facebook_display']").prop("checked") ? sfsi_plus_section_Display("sfsiplus_facebook_section", "show") :sfsi_plus_section_Display("sfsiplus_facebook_section", "hide"), SFSI("input[name='sfsi_plus_twitter_display']").prop("checked") ? sfsi_plus_section_Display("sfsiplus_twitter_section", "show") :sfsi_plus_section_Display("sfsiplus_twitter_section", "hide"),SFSI("input[name='sfsi_plus_google_display']").prop("checked") ? sfsi_plus_section_Display("sfsiplus_google_section", "show") :sfsi_plus_section_Display("sfsiplus_google_section", "hide"), SFSI("input[name='sfsi_plus_share_display']").prop("checked") ? sfsi_plus_section_Display("sfsiplus_share_section", "show") :sfsi_plus_section_Display("sfsiplus_share_section", "hide"), SFSI("input[name='sfsi_plus_youtube_display']").prop("checked") ? sfsi_plus_section_Display("sfsiplus_youtube_section", "show") :sfsi_plus_section_Display("sfsiplus_youtube_section", "hide"), SFSI("input[name='sfsi_plus_pinterest_display']").prop("checked") ? sfsi_plus_section_Display("sfsiplus_pinterest_section", "show") :sfsi_plus_section_Display("sfsiplus_pinterest_section", "hide"), SFSI("input[name='sfsi_plus_instagram_display']").prop("checked") ? sfsi_plus_section_Display("sfsiplus_instagram_section", "show") :sfsi_plus_section_Display("sfsiplus_instagram_section", "hide"), SFSI("input[name='sfsi_plus_houzz_display']").prop("checked") ? sfsi_plus_section_Display("sfsiplus_houzz_section", "show") :sfsi_plus_section_Display("sfsiplus_houzz_section", "hide"), SFSI("input[name='sfsi_plus_linkedin_display']").prop("checked") ? sfsi_plus_section_Display("sfsiplus_linkedin_section", "show") :sfsi_plus_section_Display("sfsiplus_linkedin_section", "hide"), SFSI("input[element-type='sfsiplus-cusotm-icon']").prop("checked") ? sfsi_plus_section_Display("sfsiplus_custom_section", "show") :sfsi_plus_section_Display("sfsiplus_custom_section", "hide");207 SFSI(".cstmskins-overlay").hide("slow");208 sfsi_plus_update_step3() && sfsipluscollapse(this);209 }210 });211}212// Upload Custom Icons {Monad}213function plus_sfsi_newcustomicon_upload(s)214{215 var i = s, e = {216 action:"plus_UploadIcons",217 custom_imgurl:i218 };219 SFSI.ajax({220 url:ajax_object.ajax_url,221 type:"post",222 data:e,223 dataType:"json",224 async:!0,225 success:function(s) {226 if(s.res == 'success')227 {228 sfsiplus_afterIconSuccess(s);229 }230 else231 {232 SFSI(".upload-overlay").hide("slow");233 SFSI(".uperror").html(s.res);234 sfsiplus_showErrorSuc("Error", "Some Error Occured During Upload Custom Icon", 1)235 }236 }237 });238}239function sfsi_plus_update_step1()240{241 var nonce = SFSI("#sfsi_plus_save1").attr("data-nonce");242 global_error = 0, sfsiplus_beForeLoad(), sfsi_plus_depened_sections();243 var s = !1, i = SFSI("input[name='sfsi_plus_rss_display']:checked").val(), e = SFSI("input[name='sfsi_plus_email_display']:checked").val(), t = SFSI("input[name='sfsi_plus_facebook_display']:checked").val(), n = SFSI("input[name='sfsi_plus_twitter_display']:checked").val(), o = SFSI("input[name='sfsi_plus_google_display']:checked").val(), a = SFSI("input[name='sfsi_plus_share_display']:checked").val(), r = SFSI("input[name='sfsi_plus_youtube_display']:checked").val(), c = SFSI("input[name='sfsi_plus_pinterest_display']:checked").val(), p = SFSI("input[name='sfsi_plus_linkedin_display']:checked").val(), _ = SFSI("input[name='sfsi_plus_instagram_display']:checked").val(), houzz = SFSI("input[name='sfsi_plus_houzz_display']:checked").val(), l = SFSI("input[name='sfsi_custom1_display']:checked").val(), S = SFSI("input[name='sfsi_custom2_display']:checked").val(), u = SFSI("input[name='sfsi_custom3_display']:checked").val(), f = SFSI("input[name='sfsi_custom4_display']:checked").val(), d = SFSI("input[name='sfsi_custom5_display']:checked").val(), I = {244 action:"plus_updateSrcn1",245 sfsi_plus_rss_display:i,246 sfsi_plus_email_display:e,247 sfsi_plus_facebook_display:t,248 sfsi_plus_twitter_display:n,249 sfsi_plus_google_display:o,250 sfsi_plus_share_display:a,251 sfsi_plus_youtube_display:r,252 sfsi_plus_pinterest_display:c,253 sfsi_plus_linkedin_display:p,254 sfsi_plus_instagram_display:_,255 sfsi_plus_houzz_display:houzz,256 sfsi_custom1_display:l,257 sfsi_custom2_display:S,258 sfsi_custom3_display:u,259 sfsi_custom4_display:f,260 sfsi_custom5_display:d,261 nonce:nonce262 };263 SFSI.ajax({264 url:ajax_object.ajax_url,265 type:"post",266 data:I,267 async:!0,268 dataType:"json",269 success:function(i) {270 if(i=="wrong_nonce")271 {272 sfsiplus_showErrorSuc("error", "Unauthorised Request, Try again after refreshing page", 1);273 s = !1;274 sfsiplus_afterLoad();275 }276 else277 {278 "success" == i ? (sfsiplus_showErrorSuc("success", "Saved !", 1), sfsipluscollapse("#sfsi_plus_save1"), 279 sfsi_plus_make_popBox()) :(global_error = 1, sfsiplus_showErrorSuc("error", "Unkown error , please try again", 1), 280 s = !1), sfsiplus_afterLoad();281 }282 }283 });284}285function sfsi_plus_update_step2()286{287 var nonce = SFSI("#sfsi_plus_save2").attr("data-nonce");288 var s = sfsi_plus_validationStep2();289 if (!s) return global_error = 1, !1;290 sfsiplus_beForeLoad();291 var i = 1 == SFSI("input[name='sfsi_plus_rss_url']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_rss_url']").val(), e = 1 == SFSI("input[name='sfsi_plus_rss_icons']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_rss_icons']:checked").val(), t = 1 == SFSI("input[name='sfsi_plus_facebookPage_option']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_facebookPage_option']:checked").val(), n = 1 == SFSI("input[name='sfsi_plus_facebookLike_option']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_facebookLike_option']:checked").val(), o = 1 == SFSI("input[name='sfsi_plus_facebookShare_option']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_facebookShare_option']:checked").val(), a = SFSI("input[name='sfsi_plus_facebookPage_url']").val(), r = 1 == SFSI("input[name='sfsi_plus_twitter_followme']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_twitter_followme']:checked").val(), c = 1 == SFSI("input[name='sfsi_plus_twitter_followUserName']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_twitter_followUserName']").val(), p = 1 == SFSI("input[name='sfsi_plus_twitter_aboutPage']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_twitter_aboutPage']:checked").val(), _ = 1 == SFSI("input[name='sfsi_plus_twitter_page']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_twitter_page']:checked").val(), l = SFSI("input[name='sfsi_plus_twitter_pageURL']").val(), S = SFSI("textarea[name='sfsi_plus_twitter_aboutPageText']").val(), u = 1 == SFSI("input[name='sfsi_plus_google_page']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_google_page']:checked").val(), f = 1 == SFSI("input[name='sfsi_plus_googleLike_option']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_googleLike_option']:checked").val(), d = SFSI("input[name='sfsi_plus_google_pageURL']").val(), I = 1 == SFSI("input[name='sfsi_plus_googleShare_option']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_googleShare_option']:checked").val(), m = 1 == SFSI("input[name='sfsi_plus_youtube_page']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_youtube_page']:checked").val(), F = 1 == SFSI("input[name='sfsi_plus_youtube_pageUrl']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_youtube_pageUrl']").val(), h = 1 == SFSI("input[name='sfsi_plus_youtube_follow']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_youtube_follow']:checked").val(), cls = SFSI("input[name='sfsi_plus_youtubeusernameorid']:checked").val(), v = SFSI("input[name='sfsi_plus_ytube_user']").val(), vchid = SFSI("input[name='sfsi_plus_ytube_chnlid']").val(), g = 1 == SFSI("input[name='sfsi_plus_pinterest_page']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_pinterest_page']:checked").val(), k = 1 == SFSI("input[name='sfsi_plus_pinterest_pageUrl']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_pinterest_pageUrl']").val(), y = 1 == SFSI("input[name='sfsi_plus_pinterest_pingBlog']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_pinterest_pingBlog']:checked").val(), b = 1 == SFSI("input[name='sfsi_plus_instagram_pageUrl']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_instagram_pageUrl']").val(), houzz = 1 == SFSI("input[name='sfsi_plus_houzz_pageUrl']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_houzz_pageUrl']").val(), w = 1 == SFSI("input[name='sfsi_plus_linkedin_page']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_linkedin_page']:checked").val(), x = 1 == SFSI("input[name='sfsi_plus_linkedin_pageURL']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_linkedin_pageURL']").val(), C = 1 == SFSI("input[name='sfsi_plus_linkedin_follow']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_linkedin_follow']:checked").val(), D = SFSI("input[name='sfsi_plus_linkedin_followCompany']").val(), U = 1 == SFSI("input[name='sfsi_plus_linkedin_SharePage']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_linkedin_SharePage']:checked").val(), O = SFSI("input[name='sfsi_plus_linkedin_recommendBusines']:checked").val(), T = SFSI("input[name='sfsi_plus_linkedin_recommendProductId']").val(), j = SFSI("input[name='sfsi_plus_linkedin_recommendCompany']").val(), P = {};292 SFSI("input[name='sfsi_plus_CustomIcon_links[]']").each(function() {293 P[SFSI(this).attr("file-id")] = this.value;294 });295 var M = {296 action:"plus_updateSrcn2",297 sfsi_plus_rss_url:i,298 sfsi_plus_rss_icons:e,299 sfsi_plus_facebookPage_option:t,300 sfsi_plus_facebookLike_option:n,301 sfsi_plus_facebookShare_option:o,302 sfsi_plus_facebookPage_url:a,303 sfsi_plus_twitter_followme:r,304 sfsi_plus_twitter_followUserName:c,305 sfsi_plus_twitter_aboutPage:p,306 sfsi_plus_twitter_page:_,307 sfsi_plus_twitter_pageURL:l,308 sfsi_plus_twitter_aboutPageText:S,309 sfsi_plus_google_page:u,310 sfsi_plus_googleLike_option:f,311 sfsi_plus_google_pageURL:d,312 sfsi_plus_googleShare_option:I,313 sfsi_plus_youtube_page:m,314 sfsi_plus_youtube_pageUrl:F,315 sfsi_plus_youtube_follow:h,316 sfsi_plus_youtubeusernameorid:cls,317 sfsi_plus_ytube_user:v,318 sfsi_plus_ytube_chnlid:vchid,319 sfsi_plus_pinterest_page:g,320 sfsi_plus_pinterest_pageUrl:k,321 sfsi_plus_instagram_pageUrl:b,322 sfsi_plus_houzz_pageUrl:houzz,323 sfsi_plus_pinterest_pingBlog:y,324 sfsi_plus_linkedin_page:w,325 sfsi_plus_linkedin_pageURL:x,326 sfsi_plus_linkedin_follow:C,327 sfsi_plus_linkedin_followCompany:D,328 sfsi_plus_linkedin_SharePage:U,329 sfsi_plus_linkedin_recommendBusines:O,330 sfsi_plus_linkedin_recommendCompany:j,331 sfsi_plus_linkedin_recommendProductId:T,332 sfsi_plus_custom_links:P,333 nonce:nonce334 };335 SFSI.ajax({336 url:ajax_object.ajax_url,337 type:"post",338 data:M,339 async:!0,340 dataType:"json",341 success:function(s) {342 if(s == "wrong_nonce")343 {344 sfsiplus_showErrorSuc("error", "Unauthorised Request, Try again after refreshing page", 2);345 return_value = !1;346 sfsiplus_afterLoad();347 }348 else349 {350 "success" == s ? (sfsiplus_showErrorSuc("success", "Saved !", 2), sfsipluscollapse("#sfsi_plus_save2"), 351 sfsi_plus_depened_sections()) :(global_error = 1, sfsiplus_showErrorSuc("error", "Unkown error , please try again", 2), 352 return_value = !1), sfsiplus_afterLoad();353 }354 }355 });356}357function sfsi_plus_update_step3()358{359 var nonce = SFSI("#sfsi_plus_save3").attr("data-nonce");360 var s = sfsi_plus_validationStep3();361 if (!s) return global_error = 1, !1;362 sfsiplus_beForeLoad();363 var i = SFSI("input[name='sfsi_plus_actvite_theme']:checked").val(), e = SFSI("input[name='sfsi_plus_mouseOver']:checked").val(), t = SFSI("input[name='sfsi_plus_shuffle_icons']:checked").val(), n = SFSI("input[name='sfsi_plus_shuffle_Firstload']:checked").val(), o = SFSI("#sfsi_plus_mouseOver_effect option:selected").val(), a = SFSI("input[name='sfsi_plus_shuffle_interval']:checked").val(), r = SFSI("input[name='sfsi_plus_shuffle_intervalTime']").val(), c = SFSI("input[name='sfsi_plus_specialIcon_animation']:checked").val(), p = SFSI("input[name='sfsi_plus_specialIcon_MouseOver']:checked").val(), _ = SFSI("input[name='sfsi_plus_specialIcon_Firstload']:checked").val(), l = SFSI("#sfsi_plus_specialIcon_Firstload_Icons option:selected").val(), S = SFSI("input[name='sfsi_plus_specialIcon_interval']:checked").val(), u = SFSI("input[name='sfsi_plus_specialIcon_intervalTime']").val(), f = SFSI("#sfsi_plus_specialIcon_intervalIcons option:selected").val(), d = {364 action:"plus_updateSrcn3",365 sfsi_plus_actvite_theme:i,366 sfsi_plus_mouseOver:e,367 sfsi_plus_shuffle_icons:t,368 sfsi_plus_shuffle_Firstload:n,369 sfsi_plus_mouseOver_effect:o,370 sfsi_plus_shuffle_interval:a,371 sfsi_plus_shuffle_intervalTime:r,372 sfsi_plus_specialIcon_animation:c,373 sfsi_plus_specialIcon_MouseOver:p,374 sfsi_plus_specialIcon_Firstload:_,375 sfsi_plus_specialIcon_Firstload_Icons:l,376 sfsi_plus_specialIcon_interval:S,377 sfsi_plus_specialIcon_intervalTime:u,378 sfsi_plus_specialIcon_intervalIcons:f,379 nonce:nonce380 };381 SFSI.ajax({382 url:ajax_object.ajax_url,383 type:"post",384 data:d,385 async:!0,386 dataType:"json",387 success:function(s) {388 if(s == "wrong_nonce")389 {390 sfsiplus_showErrorSuc("error", "Unauthorised Request, Try again after refreshing page", 3);391 return_value = !1;392 sfsiplus_afterLoad();393 }394 else395 {396 "success" == s ? (sfsiplus_showErrorSuc("success", "Saved !", 3), sfsipluscollapse("#sfsi_plus_save3")) :(sfsiplus_showErrorSuc("error", "Unkown error , please try again", 3), 397 return_value = !1), sfsiplus_afterLoad();398 }399 }400 });401}402function sfsi_plus_show_counts()403{404 "yes" == SFSI("input[name='sfsi_plus_display_counts']:checked").val() ? (SFSI(".sfsiplus_count_sections").slideDown(), 405 sfsi_plus_showPreviewCounts()) :(SFSI(".sfsiplus_count_sections").slideUp(), sfsi_plus_showPreviewCounts());406}407function sfsi_plus_showPreviewCounts()408{409 var s = 0;410 1 == SFSI("input[name='sfsi_plus_rss_countsDisplay']").prop("checked") ? (SFSI("#sfsi_plus_rss_countsDisplay").css("opacity", 1), 411 s = 1) :SFSI("#sfsi_plus_rss_countsDisplay").css("opacity", 0), 1 == SFSI("input[name='sfsi_plus_email_countsDisplay']").prop("checked") ? (SFSI("#sfsi_plus_email_countsDisplay").css("opacity", 1), 412 s = 1) :SFSI("#sfsi_plus_email_countsDisplay").css("opacity", 0), 1 == SFSI("input[name='sfsi_plus_facebook_countsDisplay']").prop("checked") ? (SFSI("#sfsi_plus_facebook_countsDisplay").css("opacity", 1), 413 s = 1) :SFSI("#sfsi_plus_facebook_countsDisplay").css("opacity", 0), 1 == SFSI("input[name='sfsi_plus_twitter_countsDisplay']").prop("checked") ? (SFSI("#sfsi_plus_twitter_countsDisplay").css("opacity", 1), 414 s = 1) :SFSI("#sfsi_plus_twitter_countsDisplay").css("opacity", 0), 1 == SFSI("input[name='sfsi_plus_google_countsDisplay']").prop("checked") ? (SFSI("#sfsi_plus_google_countsDisplay").css("opacity", 1), 415 s = 1) :SFSI("#sfsi_plus_google_countsDisplay").css("opacity", 0), 1 == SFSI("input[name='sfsi_plus_linkedIn_countsDisplay']").prop("checked") ? (SFSI("#sfsi_plus_linkedIn_countsDisplay").css("opacity", 1), 416 s = 1) :SFSI("#sfsi_plus_linkedIn_countsDisplay").css("opacity", 0), 1 == SFSI("input[name='sfsi_plus_youtube_countsDisplay']").prop("checked") ? (SFSI("#sfsi_plus_youtube_countsDisplay").css("opacity", 1), 417 s = 1) :SFSI("#sfsi_plus_youtube_countsDisplay").css("opacity", 0), 1 == SFSI("input[name='sfsi_plus_pinterest_countsDisplay']").prop("checked") ? (SFSI("#sfsi_plus_pinterest_countsDisplay").css("opacity", 1), 418 s = 1) :SFSI("#sfsi_plus_pinterest_countsDisplay").css("opacity", 0), 1 == SFSI("input[name='sfsi_plus_shares_countsDisplay']").prop("checked") ? (SFSI("#sfsi_plus_shares_countsDisplay").css("opacity", 1), 419 s = 1) :SFSI("#sfsi_plus_shares_countsDisplay").css("opacity", 0), 1 == SFSI("input[name='sfsi_plus_instagram_countsDisplay']").prop("checked") ? (SFSI("#sfsi_plus_instagram_countsDisplay").css("opacity", 1), 420 s = 1) :SFSI("#sfsi_plus_instagram_countsDisplay").css("opacity", 0), 1 == SFSI("input[name='sfsi_plus_houzz_countsDisplay']").prop("checked") ? (SFSI("#sfsi_plus_houzz_countsDisplay").css("opacity", 1), 421 s = 1) :SFSI("#sfsi_plus_houzz_countsDisplay").css("opacity", 0), 0 == s || "no" == SFSI("input[name='sfsi_plus_display_counts']:checked").val() ? SFSI(".sfsi_Cdisplay").hide() :SFSI(".sfsi_Cdisplay").show();422}423function sfsi_plus_show_OnpostsDisplay()424{425 //"yes" == SFSI("input[name='sfsi_plus_show_Onposts']:checked").val() ? SFSI(".sfsiplus_PostsSettings_section").slideDown() :SFSI(".sfsiplus_PostsSettings_section").slideUp();426}427function sfsi_plus_update_step4()428{429 var nonce = SFSI("#sfsi_plus_save4").attr("data-nonce");430 var s = !1, i = sfsi_plus_validationStep4();431 if (!i) return global_error = 1, !1;432 sfsiplus_beForeLoad();433 var e = SFSI("input[name='sfsi_plus_display_counts']:checked").val(), t = 1 == SFSI("input[name='sfsi_plus_email_countsDisplay']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_email_countsDisplay']:checked").val(), n = 1 == SFSI("input[name='sfsi_plus_email_countsFrom']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_email_countsFrom']:checked").val(), o = SFSI("input[name='sfsi_plus_email_manualCounts']").val(), a = SFSI("input[name='sfsi_plus_google_api_key']").val(), r = 1 == SFSI("input[name='sfsi_plus_rss_countsDisplay']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_rss_countsDisplay']:checked").val(), c = SFSI("input[name='sfsi_plus_rss_manualCounts']").val(), p = 1 == SFSI("input[name='sfsi_plus_facebook_countsDisplay']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_facebook_countsDisplay']:checked").val(), _ = 1 == SFSI("input[name='sfsi_plus_facebook_countsFrom']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_facebook_countsFrom']:checked").val(), mp = SFSI("input[name='sfsi_plus_facebook_mypageCounts']").val(), l = SFSI("input[name='sfsi_plus_facebook_manualCounts']").val(), S = 1 == SFSI("input[name='sfsi_plus_twitter_countsDisplay']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_twitter_countsDisplay']:checked").val(), u = 1 == SFSI("input[name='sfsi_plus_twitter_countsFrom']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_twitter_countsFrom']:checked").val(), f = SFSI("input[name='sfsi_plus_twitter_manualCounts']").val(), d = SFSI("input[name='sfsiplus_tw_consumer_key']").val(), I = SFSI("input[name='sfsiplus_tw_consumer_secret']").val(), m = SFSI("input[name='sfsiplus_tw_oauth_access_token']").val(), F = SFSI("input[name='sfsiplus_tw_oauth_access_token_secret']").val(), h = 1 == SFSI("input[name='sfsi_plus_google_countsDisplay']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_google_countsDisplay']:checked").val(), v = 1 == SFSI("input[name='sfsi_plus_google_countsFrom']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_google_countsFrom']:checked").val(), g = SFSI("input[name='sfsi_plus_google_manualCounts']").val(), k = 1 == SFSI("input[name='sfsi_plus_linkedIn_countsFrom']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_linkedIn_countsFrom']:checked").val(), y = SFSI("input[name='sfsi_plus_linkedIn_manualCounts']").val(), b = SFSI("input[name='sfsi_plus_ln_company']").val(), w = SFSI("input[name='sfsi_plus_ln_api_key']").val(), x = SFSI("input[name='sfsi_plus_ln_secret_key']").val(), C = SFSI("input[name='sfsi_plus_ln_oAuth_user_token']").val(), D = 1 == SFSI("input[name='sfsi_plus_linkedIn_countsDisplay']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_linkedIn_countsDisplay']:checked").val(), k = 1 == SFSI("input[name='sfsi_plus_linkedIn_countsFrom']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_linkedIn_countsFrom']:checked").val(), y = SFSI("input[name='sfsi_plus_linkedIn_manualCounts']").val(), U = 1 == SFSI("input[name='sfsi_plus_youtube_countsDisplay']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_youtube_countsDisplay']:checked").val(), O = 1 == SFSI("input[name='sfsi_plus_youtube_countsFrom']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_youtube_countsFrom']:checked").val(), T = SFSI("input[name='sfsi_plus_youtube_manualCounts']").val(), j = SFSI("input[name='sfsi_plus_youtube_user']").val(), P = 1 == SFSI("input[name='sfsi_plus_pinterest_countsDisplay']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_pinterest_countsDisplay']:checked").val(), M = 1 == SFSI("input[name='sfsi_plus_pinterest_countsFrom']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_pinterest_countsFrom']:checked").val(), L = SFSI("input[name='sfsi_plus_pinterest_manualCounts']").val(), B = SFSI("input[name='sfsi_plus_pinterest_user']").val(), E = SFSI("input[name='sfsi_plus_pinterest_board']").val(), z = 1 == SFSI("input[name='sfsi_plus_instagram_countsDisplay']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_instagram_countsDisplay']:checked").val(), A = 1 == SFSI("input[name='sfsi_plus_instagram_countsFrom']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_instagram_countsFrom']:checked").val(), N = SFSI("input[name='sfsi_plus_instagram_manualCounts']").val(), H = SFSI("input[name='sfsi_plus_instagram_User']").val(), R = 1 == SFSI("input[name='sfsi_plus_shares_countsDisplay']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_shares_countsDisplay']:checked").val(), W = 1 == SFSI("input[name='sfsi_plus_shares_countsFrom']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_shares_countsFrom']:checked").val(), q = SFSI("input[name='sfsi_plus_shares_manualCounts']").val(), houzzDisplay = 1 == SFSI("input[name='sfsi_plus_houzz_countsDisplay']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_houzz_countsDisplay']:checked").val(), houzzFrom = 1 == SFSI("input[name='sfsi_plus_houzz_countsFrom']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_houzz_countsFrom']:checked").val(), houzzCount = SFSI("input[name='sfsi_plus_houzz_manualCounts']").val(), $ = {434 action:"plus_updateSrcn4",435 sfsi_plus_display_counts:e,436 sfsi_plus_email_countsDisplay:t,437 sfsi_plus_email_countsFrom:n,438 sfsi_plus_email_manualCounts:o,439 sfsi_plus_rss_countsDisplay:r,440 sfsi_plus_rss_manualCounts:c,441 sfsi_plus_facebook_countsDisplay:p,442 sfsi_plus_facebook_countsFrom:_,443 sfsi_plus_facebook_mypageCounts:mp,444 sfsi_plus_facebook_manualCounts:l,445 sfsi_plus_twitter_countsDisplay:S,446 sfsi_plus_twitter_countsFrom:u,447 sfsi_plus_twitter_manualCounts:f,448 sfsiplus_tw_consumer_key:d,449 sfsiplus_tw_consumer_secret:I,450 sfsiplus_tw_oauth_access_token:m,451 sfsiplus_tw_oauth_access_token_secret:F,452 sfsi_plus_google_countsDisplay:h,453 sfsi_plus_google_countsFrom:v,454 sfsi_plus_google_manualCounts:g,455 sfsi_plus_google_api_key:a,456 sfsi_plus_linkedIn_countsDisplay:D,457 sfsi_plus_linkedIn_countsFrom:k,458 sfsi_plus_linkedIn_manualCounts:y,459 sfsi_plus_ln_company:b,460 sfsi_plus_ln_api_key:w,461 sfsi_plus_ln_secret_key:x,462 sfsi_plus_ln_oAuth_user_token:C,463 sfsi_plus_youtube_countsDisplay:U,464 sfsi_plus_youtube_countsFrom:O,465 sfsi_plus_youtube_manualCounts:T,466 sfsi_plus_youtube_user:j,467 sfsi_plus_youtube_channelId: SFSI("input[name='sfsi_plus_youtube_channelId']").val(),468 sfsi_plus_pinterest_countsDisplay:P,469 sfsi_plus_pinterest_countsFrom:M,470 sfsi_plus_pinterest_manualCounts:L,471 sfsi_plus_pinterest_user:B,472 sfsi_plus_pinterest_board:E,473 sfsi_plus_instagram_countsDisplay:z,474 sfsi_plus_instagram_countsFrom:A,475 sfsi_plus_instagram_manualCounts:N,476 sfsi_plus_instagram_User:H,477 sfsi_plus_shares_countsDisplay:R,478 sfsi_plus_shares_countsFrom:W,479 sfsi_plus_shares_manualCounts:q,480 sfsi_plus_houzz_countsDisplay:houzzDisplay,481 sfsi_plus_houzz_countsFrom:houzzFrom,482 sfsi_plus_houzz_manualCounts:houzzCount,483 nonce:nonce484 };485 return SFSI.ajax({486 url:ajax_object.ajax_url,487 type:"post",488 data:$,489 dataType:"json",490 async:!0,491 success:function(s) {492 if(s == "wrong_nonce")493 {494 sfsiplus_showErrorSuc("error", "Unauthorised Request, Try again after refreshing page", 4);495 global_error = 1;496 sfsiplus_afterLoad();497 }498 else499 {500 "success" == s.res ? (sfsiplus_showErrorSuc("success", "Saved !", 4), sfsipluscollapse("#sfsi_plus_save4"), 501 sfsi_plus_showPreviewCounts()) :(sfsiplus_showErrorSuc("error", "Unkown error , please try again", 4), 502 global_error = 1), sfsiplus_afterLoad();503 }504 }505 }), s;506}507function sfsi_plus_update_step5()508{509 var nonce = SFSI("#sfsi_plus_save5").attr("data-nonce");510 sfsi_plus_update_step3();511 var s = sfsi_plus_validationStep5();512 if (!s) return global_error = 1, !1;513 sfsiplus_beForeLoad();514 var i = SFSI("input[name='sfsi_plus_icons_size']").val(), e = SFSI("input[name='sfsi_plus_icons_perRow']").val(), t = SFSI("input[name='sfsi_plus_icons_spacing']").val(), n = SFSI("#sfsi_plus_icons_Alignment").val(),515 followicon = SFSI("#sfsi_plus_follow_icons_language").val(),516 facebookicon = SFSI("#sfsi_plus_facebook_icons_language").val(),517 twittericon = SFSI("#sfsi_plus_twitter_icons_language").val(),518 googleicon = SFSI("#sfsi_plus_google_icons_language").val(),519 lang = SFSI("#sfsi_plus_icons_language").val(), o = SFSI("input[name='sfsi_plus_icons_ClickPageOpen']:checked").val(), a = SFSI("input[name='sfsi_plus_icons_float']:checked").val(), dsb = SFSI("input[name='sfsi_plus_disable_floaticons']:checked").val(), dsbv = SFSI("input[name='sfsi_plus_disable_viewport']:checked").val(), r = SFSI("#sfsi_plus_icons_floatPosition").val(), c = SFSI("input[name='sfsi_plus_icons_stick']:checked").val(), p = SFSI("#sfsi_plus_rssIcon_order").attr("data-index"), _ = SFSI("#sfsi_plus_emailIcon_order").attr("data-index"), l = SFSI("#sfsi_plus_googleIcon_order").attr("data-index"), S = SFSI("#sfsi_plus_facebookIcon_order").attr("data-index"), u = SFSI("#sfsi_plus_twitterIcon_order").attr("data-index"), f = SFSI("#sfsi_plus_youtubeIcon_order").attr("data-index"), d = SFSI("#sfsi_plus_pinterestIcon_order").attr("data-index"), I = SFSI("#sfsi_plus_instagramIcon_order").attr("data-index"), m = SFSI("#sfsi_plus_shareIcon_order").attr("data-index"), F = SFSI("#sfsi_plus_linkedinIcon_order").attr("data-index"), houzzOrder = SFSI("#sfsi_plus_houzzIcon_order").attr("data-index"), h = new Array();520 SFSI(".sfsiplus_custom_iconOrder").each(function()521 {522 h.push({523 order:SFSI(this).attr("data-index"),524 ele:SFSI(this).attr("element-id")525 });526 });527 var v = 1 == SFSI("input[name='sfsi_plus_rss_MouseOverText']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_rss_MouseOverText']").val(), g = 1 == SFSI("input[name='sfsi_plus_email_MouseOverText']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_email_MouseOverText']").val(), k = 1 == SFSI("input[name='sfsi_plus_twitter_MouseOverText']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_twitter_MouseOverText']").val(), y = 1 == SFSI("input[name='sfsi_plus_facebook_MouseOverText']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_facebook_MouseOverText']").val(), b = 1 == SFSI("input[name='sfsi_plus_google_MouseOverText']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_google_MouseOverText']").val(), w = 1 == SFSI("input[name='sfsi_plus_linkedIn_MouseOverText']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_linkedIn_MouseOverText']").val(), x = 1 == SFSI("input[name='sfsi_plus_youtube_MouseOverText']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_youtube_MouseOverText']").val(), C = 1 == SFSI("input[name='sfsi_plus_pinterest_MouseOverText']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_pinterest_MouseOverText']").val(), insD = 1 == SFSI("input[name='sfsi_plus_instagram_MouseOverText']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_instagram_MouseOverText']").val(), D = 1 == SFSI("input[name='sfsi_plus_houzz_MouseOverText']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_houzz_MouseOverText']").val(), U = 1 == SFSI("input[name='sfsi_plus_share_MouseOverText']").prop("disabled") ? "" :SFSI("input[name='sfsi_plus_share_MouseOverText']").val(), O = {};528 SFSI("input[name='sfsi_plus_custom_MouseOverTexts[]']").each(function() {529 O[SFSI(this).attr("file-id")] = this.value;530 });531 var T = {532 action:"plus_updateSrcn5",533 sfsi_plus_icons_size:i,534 sfsi_plus_icons_Alignment:n,535 sfsi_plus_icons_perRow:e,536 sfsi_plus_follow_icons_language:followicon,537 sfsi_plus_facebook_icons_language:facebookicon,538 sfsi_plus_twitter_icons_language:twittericon,539 sfsi_plus_google_icons_language:googleicon,540 sfsi_plus_icons_language:lang,541 sfsi_plus_icons_spacing:t,542 sfsi_plus_icons_ClickPageOpen:o,543 sfsi_plus_icons_float:a,544 sfsi_plus_disable_floaticons:dsb,545 sfsi_plus_disable_viewport: dsbv,546 sfsi_plus_icons_floatPosition:r,547 sfsi_plus_icons_stick:c,548 sfsi_plus_rss_MouseOverText:v,549 sfsi_plus_email_MouseOverText:g,550 sfsi_plus_twitter_MouseOverText:k,551 sfsi_plus_facebook_MouseOverText:y,552 sfsi_plus_google_MouseOverText:b,553 sfsi_plus_youtube_MouseOverText:x,554 sfsi_plus_linkedIn_MouseOverText:w,555 sfsi_plus_pinterest_MouseOverText:C,556 sfsi_plus_share_MouseOverText:U,557 sfsi_plus_instagram_MouseOverText:insD,558 sfsi_plus_houzz_MouseOverText:D,559 sfsi_plus_custom_MouseOverTexts:O,560 sfsi_plus_rssIcon_order:p,561 sfsi_plus_emailIcon_order:_,562 sfsi_plus_facebookIcon_order:S,563 sfsi_plus_twitterIcon_order:u,564 sfsi_plus_googleIcon_order:l,565 sfsi_plus_youtubeIcon_order:f,566 sfsi_plus_pinterestIcon_order:d,567 sfsi_plus_shareIcon_order:m,568 sfsi_plus_instagramIcon_order:I,569 sfsi_plus_houzzIcon_order:houzzOrder,570 sfsi_plus_linkedinIcon_order:F,571 sfsi_plus_custom_orders:h,572 nonce:nonce573 };574 SFSI.ajax({575 url:ajax_object.ajax_url,576 type:"post",577 data:T,578 dataType:"json",579 async:!0,580 success:function(s) {581 if(s == "wrong_nonce")582 {583 sfsiplus_showErrorSuc("error", "Unauthorised Request, Try again after refreshing page", 5);584 global_error = 1;585 sfsiplus_afterLoad();586 }587 else588 {589 "success" == s ? (sfsiplus_showErrorSuc("success", "Saved !", 5), sfsipluscollapse("#sfsi_plus_save5")) :(global_error = 1, 590 sfsiplus_showErrorSuc("error", "Unkown error , please try again", 5)), sfsiplus_afterLoad();591 }592 }593 });594}595function sfsi_plus_update_step6()596{597 var nonce = SFSI("#sfsi_plus_save6").attr("data-nonce");598 sfsiplus_beForeLoad();599 var s = SFSI("input[name='sfsi_plus_show_Onposts']:checked").val(), i = SFSI("input[name='sfsi_plus_textBefor_icons']").val(), e = SFSI("#sfsi_plus_icons_alignment").val(), t = SFSI("#sfsi_plus_icons_DisplayCounts").val(), n = {600 action:"plus_updateSrcn6",601 sfsi_plus_show_Onposts:s,602 sfsi_plus_icons_DisplayCounts:t,603 sfsi_plus_icons_alignment:e,604 sfsi_plus_textBefor_icons:i,605 nonce:nonce606 };607 SFSI.ajax({608 url:ajax_object.ajax_url,609 type:"post",610 data:n,611 dataType:"json",612 async:!0,613 success:function(s) {614 if(s == "wrong_nonce")615 {616 sfsiplus_showErrorSuc("error", "Unauthorised Request, Try again after refreshing page", 6);617 global_error = 1;618 sfsiplus_afterLoad();619 }620 else621 {622 "success" == s ? (sfsiplus_showErrorSuc("success", "Saved !", 6), sfsipluscollapse("#sfsi_plus_save6")) :(global_error = 1, 623 sfsiplus_showErrorSuc("error", "Unkown error , please try again", 6)), sfsiplus_afterLoad();624 }625 }626 });627}628function sfsi_plus_update_step7()629{630 var nonce = SFSI("#sfsi_plus_save7").attr("data-nonce");631 var s = sfsi_plus_validationStep7();632 if (!s) return global_error = 1, !1;633 sfsiplus_beForeLoad();634 var i = SFSI("input[name='sfsi_plus_popup_text']").val(), e = SFSI("#sfsi_plus_popup_font option:selected").val(), t = (SFSI("#sfsi_plus_popup_fontStyle option:selected").val(), 635 SFSI("input[name='sfsi_plus_popup_fontColor']").val()), n = SFSI("input[name='sfsi_plus_popup_fontSize']").val(), o = SFSI("input[name='sfsi_plus_popup_background_color']").val(), a = SFSI("input[name='sfsi_plus_popup_border_color']").val(), r = SFSI("input[name='sfsi_plus_popup_border_thickness']").val(), c = SFSI("input[name='sfsi_plus_popup_border_shadow']:checked").val(), p = SFSI("input[name='sfsi_plus_Show_popupOn']:checked").val(), _ = [];636 SFSI("#sfsi_plus_Show_popupOn_PageIDs :selected").each(function(s, i) {637 _[s] = SFSI(i).val();638 });639 var l = SFSI("input[name='sfsi_plus_Shown_pop']:checked").val(), S = SFSI("input[name='sfsi_plus_Shown_popupOnceTime']").val(), u = SFSI("#sfsi_plus_Shown_popuplimitPerUserTime").val(), f = {640 action:"plus_updateSrcn7",641 sfsi_plus_popup_text:i,642 sfsi_plus_popup_font:e,643 sfsi_plus_popup_fontColor:t,644 sfsi_plus_popup_fontSize:n,645 sfsi_plus_popup_background_color:o,646 sfsi_plus_popup_border_color:a,647 sfsi_plus_popup_border_thickness:r,648 sfsi_plus_popup_border_shadow:c,649 sfsi_plus_Show_popupOn:p,650 sfsi_plus_Show_popupOn_PageIDs:_,651 sfsi_plus_Shown_pop:l,652 sfsi_plus_Shown_popupOnceTime:S,653 sfsi_plus_Shown_popuplimitPerUserTime:u,654 nonce:nonce655 };656 SFSI.ajax({657 url:ajax_object.ajax_url,658 type:"post",659 data:f,660 dataType:"json",661 async:!0,662 success:function(s) {663 if(s == "wrong_nonce")664 {665 sfsiplus_showErrorSuc("error", "Unauthorised Request, Try again after refreshing page", 7);666 sfsiplus_afterLoad();667 }668 else669 {670 "success" == s ? (sfsiplus_showErrorSuc("success", "Saved !", 7), sfsipluscollapse("#sfsi_plus_save7")) :sfsiplus_showErrorSuc("error", "Unkown error , please try again", 7), 671 sfsiplus_afterLoad();672 }673 }674 });675}676function sfsi_plus_update_step8()677{678 var nonce = SFSI("#sfsi_plus_save8").attr("data-nonce");679 var s = sfsi_plus_validationStep7();680 s = true;681 if (!s) return global_error = 1, !1;682 sfsiplus_beForeLoad();683 var i = SFSI("input[name='sfsi_plus_show_via_widget']:checked").val(),684 e = SFSI("input[name='sfsi_plus_float_on_page']:checked").val(),685 t = SFSI("input[name='sfsi_plus_float_page_position']:checked").val(),686 n = SFSI("input[name='sfsi_plus_place_item_manually']:checked").val(),687 o = SFSI("input[name='sfsi_plus_show_item_onposts']:checked").val(),688 a = SFSI("input[name='sfsi_plus_display_button_type']:checked").val(),689 r = SFSI("input[name='sfsi_plus_post_icons_size']").val(),690 c = SFSI("input[name='sfsi_plus_post_icons_spacing']").val(),691 p = SFSI("input[name='sfsi_plus_show_Onposts']:checked").val(),692 v = SFSI("input[name='sfsi_plus_textBefor_icons']").val(),693 x = SFSI("#sfsi_plus_icons_alignment").val(),694 z = SFSI("#sfsi_plus_icons_DisplayCounts").val(),695 b = SFSI("input[name='sfsi_plus_display_before_posts']:checked").val(),696 d = SFSI("input[name='sfsi_plus_display_after_posts']:checked").val(),697 /*f = SFSI("input[name='sfsi_plus_display_on_postspage']:checked").val(),698 g = SFSI("input[name='sfsi_plus_display_on_homepage']:checked").val(),*/699 f = SFSI("input[name='sfsi_plus_display_before_blogposts']:checked").val(),700 g = SFSI("input[name='sfsi_plus_display_after_blogposts']:checked").val(),701 rsub = SFSI("input[name='sfsi_plus_rectsub']:checked").val(),702 rfb = SFSI("input[name='sfsi_plus_rectfb']:checked").val(),703 rgp = SFSI("input[name='sfsi_plus_rectgp']:checked").val(),704 rshr = SFSI("input[name='sfsi_plus_rectshr']:checked").val(),705 rtwr = SFSI("input[name='sfsi_plus_recttwtr']:checked").val(),706 rpin = SFSI("input[name='sfsi_plus_rectpinit']:checked").val(),707 rfbshare = SFSI("input[name='sfsi_plus_rectfbshare']:checked").val(),708 _ = [];709 /*SFSI("#sfsi_plus_Show_popupOn_PageIDs :selected").each(function(s, i) {710 _[s] = SFSI(i).val()711 });*/712 var mst = SFSI("input[name='sfsi_plus_icons_floatMargin_top']").val(), msb = SFSI("input[name='sfsi_plus_icons_floatMargin_bottom']").val(), msl = SFSI("input[name='sfsi_plus_icons_floatMargin_left']").val(), msr = SFSI("input[name='sfsi_plus_icons_floatMargin_right']").val();713 714 var f = {715 action: "plus_updateSrcn8",716 sfsi_plus_show_via_widget: i,717 sfsi_plus_float_on_page: e,718 sfsi_plus_float_page_position: t,719 sfsi_plus_icons_floatMargin_top:mst,720 sfsi_plus_icons_floatMargin_bottom:msb,721 sfsi_plus_icons_floatMargin_left:msl,722 sfsi_plus_icons_floatMargin_right:msr,723 sfsi_plus_place_item_manually: n,724 sfsi_plus_show_item_onposts: o,725 sfsi_plus_display_button_type: a,726 sfsi_plus_post_icons_size: r,727 sfsi_plus_post_icons_spacing: c,728 sfsi_plus_show_Onposts: p,729 sfsi_plus_textBefor_icons: v,730 sfsi_plus_icons_alignment: x,731 sfsi_plus_icons_DisplayCounts: z,732 sfsi_plus_display_before_posts: b,733 sfsi_plus_display_after_posts: d,734 /*sfsi_plus_display_on_postspage: f,735 sfsi_plus_display_on_homepage: g*/736 sfsi_plus_display_before_blogposts: f,737 sfsi_plus_display_after_blogposts: g,738 sfsi_plus_rectsub: rsub,739 sfsi_plus_rectfb: rfb,740 sfsi_plus_rectgp: rgp,741 sfsi_plus_rectshr: rshr,742 sfsi_plus_recttwtr: rtwr,743 sfsi_plus_rectpinit: rpin,744 sfsi_plus_rectfbshare: rfbshare,745 nonce:nonce746 };747 SFSI.ajax({748 url: ajax_object.ajax_url,749 type: "post",750 data: f,751 dataType: "json",752 async: !0,753 success: function(s) {754 if(s == "wrong_nonce")755 {756 sfsiplus_showErrorSuc("error", "Unauthorised Request, Try again after refreshing page", 8);757 sfsiplus_afterLoad();758 }759 else760 {761 "success" == s ? (sfsiplus_showErrorSuc("success", "Saved !", 8), sfsipluscollapse("#sfsi_plus_save8")) : sfsiplus_showErrorSuc("error", "Unkown error , please try again", 8), sfsiplus_afterLoad()762 }763 }764 })765}766function sfsi_plus_update_step9()767{768 var nonce = SFSI("#sfsi_plus_save9").attr("data-nonce");769 sfsiplus_beForeLoad();770 var ie = SFSI("input[name='sfsi_plus_form_adjustment']:checked").val(),771 je = SFSI("input[name='sfsi_plus_form_height']").val(),772 ke = SFSI("input[name='sfsi_plus_form_width']").val(),773 le = SFSI("input[name='sfsi_plus_form_border']:checked").val(),774 me = SFSI("input[name='sfsi_plus_form_border_thickness']").val(),775 ne = SFSI("input[name='sfsi_plus_form_border_color']").val(),776 oe = SFSI("input[name='sfsi_plus_form_background']").val(),777 778 ae = SFSI("input[name='sfsi_plus_form_heading_text']").val(),779 be = SFSI("#sfsi_plus_form_heading_font option:selected").val(),780 ce = SFSI("#sfsi_plus_form_heading_fontstyle option:selected").val(),781 de = SFSI("input[name='sfsi_plus_form_heading_fontcolor']").val(),782 ee = SFSI("input[name='sfsi_plus_form_heading_fontsize']").val(),783 fe = SFSI("#sfsi_plus_form_heading_fontalign option:selected").val(),784 785 ue = SFSI("input[name='sfsi_plus_form_field_text']").val(),786 ve = SFSI("#sfsi_plus_form_field_font option:selected").val(),787 we = SFSI("#sfsi_plus_form_field_fontstyle option:selected").val(),788 xe = SFSI("input[name='sfsi_plus_form_field_fontcolor']").val(),789 ye = SFSI("input[name='sfsi_plus_form_field_fontsize']").val(),790 ze = SFSI("#sfsi_plus_form_field_fontalign option:selected").val(),791 792 i = SFSI("input[name='sfsi_plus_form_button_text']").val(),793 j = SFSI("#sfsi_plus_form_button_font option:selected").val(),794 k = SFSI("#sfsi_plus_form_button_fontstyle option:selected").val(),795 l = SFSI("input[name='sfsi_plus_form_button_fontcolor']").val(),796 m = SFSI("input[name='sfsi_plus_form_button_fontsize']").val(),797 n = SFSI("#sfsi_plus_form_button_fontalign option:selected").val(),798 o = SFSI("input[name='sfsi_plus_form_button_background']").val();799 800 var f = {801 action:"plus_updateSrcn9",802 sfsi_plus_form_adjustment:ie,803 sfsi_plus_form_height:je,804 sfsi_plus_form_width:ke,805 sfsi_plus_form_border:le,806 sfsi_plus_form_border_thickness:me,807 sfsi_plus_form_border_color: ne,808 sfsi_plus_form_background: oe,809 810 sfsi_plus_form_heading_text:ae,811 sfsi_plus_form_heading_font:be,812 sfsi_plus_form_heading_fontstyle:ce,813 sfsi_plus_form_heading_fontcolor:de,814 sfsi_plus_form_heading_fontsize:ee,815 sfsi_plus_form_heading_fontalign:fe,816 817 sfsi_plus_form_field_text:ue,818 sfsi_plus_form_field_font:ve,819 sfsi_plus_form_field_fontstyle:we,820 sfsi_plus_form_field_fontcolor:xe,821 sfsi_plus_form_field_fontsize:ye,822 sfsi_plus_form_field_fontalign:ze,823 824 sfsi_plus_form_button_text:i,825 sfsi_plus_form_button_font:j,826 sfsi_plus_form_button_fontstyle:k,827 sfsi_plus_form_button_fontcolor:l,828 sfsi_plus_form_button_fontsize:m,829 sfsi_plus_form_button_fontalign:n,830 sfsi_plus_form_button_background:o,831 832 nonce:nonce833 };834 SFSI.ajax({835 url:ajax_object.ajax_url,836 type:"post",837 data:f,838 dataType:"json",839 async:!0,840 success:function(s) {841 if(s == "wrong_nonce")842 {843 sfsiplus_showErrorSuc("error", "Unauthorised Request, Try again after refreshing page", 9);844 sfsiplus_afterLoad();845 }846 else847 {848 "success" == s ? (sfsiplus_showErrorSuc("success", "Saved !", 9), sfsipluscollapse("#sfsi_plus_save9"), sfsi_plus_create_suscriber_form()) :sfsiplus_showErrorSuc("error", "Unkown error , please try again", 9), 849 sfsiplus_afterLoad();850 }851 }852 });853}854function sfsiplus_afterIconSuccess(s)855{856 if (s.res = "success") {857 var i = s.key + 1, e = s.element, t = e + 1;858 SFSI("#plus_total_cusotm_icons").val(s.element);859 SFSI(".upload-overlay").hide("slow");860 SFSI(".uperror").html("");861 sfsiplus_showErrorSuc("success", "Custom Icon updated successfully", 1);862 d = new Date();863 864 SFSI("li.plus_custom:last-child").removeClass("bdr_btm_non"); 865 SFSI("li.plus_custom:last-child").children("span.plus_custom-img").children("img").attr("src", s.img_path+ "?" + d.getTime());866 SFSI("input[name=plussfsiICON_" + s.key + "]").removeAttr("ele-type"); 867 SFSI("input[name=plussfsiICON_" + s.key + "]").removeAttr("isnew");868 icons_name = SFSI("li.plus_custom:last-child").find("input.styled").attr("name");869 var n = icons_name.split("_");870 s.key = s.key, s.img_path += "?" + d.getTime(), 5 > e && SFSI(".plus_icn_listing").append('<li id="plus_c' + i + '" class="plus_custom bdr_btm_non"><div class="radio_section tb_4_ck"><span class="checkbox" dynamic_ele="yes" style="background-position: 0px 0px;"></span><input name="plussfsiICON_' + i + '" type="checkbox" value="yes" class="styled" style="display:none;" element-type="sfsiplus-cusotm-icon" isNew="yes" /></div> <span class="plus_custom-img"><img src="' + SFSI("#plugin_url").val() + 'images/custom.png" id="plus_CImg_' + i + '" /> </span> <span class="custom sfsiplus_custom-txt">Custom' + t + ' </span> <div class="sfsiplus_right_info"> <p><span>'+object_name1.It_depends+':</span> '+object_name1.Upload_a+'</p><div class="inputWrapper"></div></li>'), 871 SFSI(".sfsiplus_custom_section").show(), SFSI(".plus_custom-links").append(' <div class="row sfsiICON_' + s.key + ' cm_lnk"> <h2 class="custom"> <span class="customstep2-img"> <img src="' + s.img_path + "?" + d.getTime() + '" style="border-radius:48%" /> </span> <span class="sfsiCtxt">Custom ' + e + '</span> </h2> <div class="inr_cont "><p>Where do you want this icon to link to?</p> <p class="radio_section fb_url sfsiplus_custom_section sfsiICON_' + s.key + '" ><label>Link :</label><input file-id="' + s.key + '" name="sfsi_plus_CustomIcon_links[]" type="text" value="" placeholder="http://" class="add" /></p></div></div>');872 var o = SFSI("div.plus_custom_m").find("div.mouseover_field").length;873 SFSI("div.plus_custom_m").append(0 == o % 2 ? '<div class="clear"> </div> <div class="mouseover_field sfsiplus_custom_section sfsiICON_' + s.key + '"><label>Custom ' + e + ':</label><input name="sfsi_plus_custom_MouseOverTexts[]" value="" type="text" file-id="' + s.key + '" /></div>' :'<div class="cHover " ><div class="mouseover_field sfsiplus_custom_section sfsiICON_' + s.key + '"><label>Custom ' + e + ':</label><input name="sfsi_plus_custom_MouseOverTexts[]" value="" type="text" file-id="' + s.key + '" /></div>'), 874 SFSI("ul.plus_share_icon_order").append('<li class="sfsiplus_custom_iconOrder sfsiICON_' + s.key + '" data-index="" element-id="' + s.key + '" id=""><a href="#" title="Custom Icon" ><img src="' + s.img_path + '" alt="Linked In" class="sfcm"/></a></li>'), 875 SFSI("ul.plus_sfsi_sample_icons").append('<li class="sfsiICON_' + s.key + '" element-id="' + s.key + '" ><div><img src="' + s.img_path + '" alt="Linked In" class="sfcm"/><span class="sfsi_Cdisplay">12k</span></div></li>'), 876 sfsi_plus_update_index(), plus_update_Sec5Iconorder(), sfsi_plus_update_step1(), sfsi_plus_update_step2(), 877 sfsi_plus_update_step5(), SFSI(".upload-overlay").css("pointer-events", "auto"), sfsi_plus_showPreviewCounts(), 878 sfsiplus_afterLoad();879 }880}881function sfsiplus_beforeIconSubmit(s)882{883 if (SFSI(".uperror").html("Uploading....."), window.File && window.FileReader && window.FileList && window.Blob) {884 SFSI(s).val() || SFSI(".uperror").html("File is empty");885 var i = s.files[0].size, e = s.files[0].type;886 switch (e) {887 case "image/png":888 case "image/gif":889 case "image/jpeg":890 case "image/pjpeg":891 break;892 default:893 return SFSI(".uperror").html("Unsupported file"), !1;894 }895 return i > 1048576 ? (SFSI(".uperror").html("Image should be less than 1 MB"), !1) :!0;896 }897 return !0;898}899function sfsiplus_bytesToSize(s)900{901 var i = [ "Bytes", "KB", "MB", "GB", "TB" ];902 if (0 == s) return "0 Bytes";903 var e = parseInt(Math.floor(Math.log(s) / Math.log(1024)));904 return Math.round(s / Math.pow(1024, e), 2) + " " + i[e];905}906function sfsiplus_showErrorSuc(s, i, e)907{908 if ("error" == s) var t = "errorMsg"; else var t = "sucMsg";909 return SFSI(".tab" + e + ">." + t).html(i), SFSI(".tab" + e + ">." + t).show(), 910 SFSI(".tab" + e + ">." + t).effect("highlight", {}, 5e3), setTimeout(function() {911 SFSI("." + t).slideUp("slow");912 }, 5e3), !1;913}914function sfsiplus_beForeLoad()915{916 SFSI(".loader-img").show(), SFSI(".save_button >a").html("Saving..."), SFSI(".save_button >a").css("pointer-events","none");917}918function sfsiplus_afterLoad()919{920 SFSI("input").removeClass("inputError"), SFSI(".save_button >a").html(object_name.Sa_ve), 921 SFSI(".tab10>div.save_button >a").html(object_name1.Save_All_Settings), 922 SFSI(".save_button >a").css("pointer-events", "auto"), SFSI(".save_button >a").removeAttr("onclick"), 923 SFSI(".loader-img").hide();924}925function sfsi_plus_make_popBox()926{927 var s = 0;928 SFSI(".plus_sfsi_sample_icons >li").each(function() {929 "none" != SFSI(this).css("display") && (s = 1);930 }), 0 == s ? SFSI(".sfsi_plus_Popinner").hide() :SFSI(".sfsi_plus_Popinner").show(), "" != SFSI('input[name="sfsi_plus_popup_text"]').val() ? (SFSI(".sfsi_plus_Popinner >h2").html(SFSI('input[name="sfsi_plus_popup_text"]').val()), 931 SFSI(".sfsi_plus_Popinner >h2").show()) :SFSI(".sfsi_plus_Popinner >h2").hide(), SFSI(".sfsi_plus_Popinner").css({932 "border-color":SFSI('input[name="sfsi_plus_popup_border_color"]').val(),933 "border-width":SFSI('input[name="sfsi_plus_popup_border_thickness"]').val(),934 "border-style":"solid"935 }), SFSI(".sfsi_plus_Popinner").css("background-color", SFSI('input[name="sfsi_plus_popup_background_color"]').val()), 936 SFSI(".sfsi_plus_Popinner h2").css("font-family", SFSI("#sfsi_plus_popup_font").val()), SFSI(".sfsi_plus_Popinner h2").css("font-style", SFSI("#sfsi_plus_popup_fontStyle").val()), 937 SFSI(".sfsi_plus_Popinner >h2").css("font-size", parseInt(SFSI('input[name="sfsi_plus_popup_fontSize"]').val())), 938 SFSI(".sfsi_plus_Popinner >h2").css("color", SFSI('input[name="sfsi_plus_popup_fontColor"]').val() + " !important"), 939 "yes" == SFSI('input[name="sfsi_plus_popup_border_shadow"]:checked').val() ? SFSI(".sfsi_plus_Popinner").css("box-shadow", "12px 30px 18px #CCCCCC") :SFSI(".sfsi_plus_Popinner").css("box-shadow", "none");940}941function sfsi_plus_stick_widget(s)942{943 0 == sfsiplus_initTop.length && (SFSI(".sfsi_plus_widget").each(function(s) {944 sfsiplus_initTop[s] = SFSI(this).position().top;945 }), console.log(sfsiplus_initTop));946 var i = SFSI(window).scrollTop(), e = [], t = [];947 SFSI(".sfsi_plus_widget").each(function(s) {948 e[s] = SFSI(this).position().top, t[s] = SFSI(this);949 });950 var n = !1;951 for (var o in e) {952 var a = parseInt(o) + 1;953 e[o] < i && e[a] > i && a < e.length ? (SFSI(t[o]).css({954 position:"fixed",955 top:s956 }), SFSI(t[a]).css({957 position:"",958 top:sfsiplus_initTop[a]959 }), n = !0) :SFSI(t[o]).css({960 position:"",961 top:sfsiplus_initTop[o]962 });963 }964 if (!n) {965 var r = e.length - 1, c = -1;966 e.length > 1 && (c = e.length - 2), sfsiplus_initTop[r] < i ? (SFSI(t[r]).css({967 position:"fixed",968 top:s969 }), c >= 0 && SFSI(t[c]).css({970 position:"",971 top:sfsiplus_initTop[c]972 })) :(SFSI(t[r]).css({973 position:"",974 top:sfsiplus_initTop[r]975 }), c >= 0 && e[c] < i);976 }977}978function sfsi_plus_setCookie(s, i, e)979{980 var t = new Date();981 t.setTime(t.getTime() + 1e3 * 60 * 60 * 24 * e);982 var n = "expires=" + t.toGMTString();983 document.cookie = s + "=" + i + "; " + n;984}985function sfsfi_plus_getCookie(s)986{987 for (var i = s + "=", e = document.cookie.split(";"), t = 0; t < e.length; t++) {988 var n = e[t].trim();989 if (0 == n.indexOf(i)) return n.substring(i.length, n.length);990 }991 return "";992}993function sfsi_plus_hideFooter() {}994window.onerror = function() {}, SFSI = jQuery.noConflict(), SFSI(window).load(function() {995 SFSI("#sfpluspageLoad").fadeOut(2e3);996});997//changes done {Monad}998function sfsi_plus_selectText(containerid) {999 if (document.selection) {1000 var range = document.body.createTextRange();1001 range.moveToElementText(document.getElementById(containerid));1002 range.select();1003 } else if (window.getSelection()) {1004 var range = document.createRange();1005 range.selectNode(document.getElementById(containerid));1006 window.getSelection().removeAllRanges();1007 window.getSelection().addRange(range);1008 }1009}1010function sfsi_plus_create_suscriber_form()1011{1012 //Popbox customization1013 "no" == SFSI('input[name="sfsi_plus_form_adjustment"]:checked').val() ? SFSI(".sfsi_plus_subscribe_Popinner").css({"width": parseInt(SFSI('input[name="sfsi_plus_form_width"]').val()),"height":parseInt(SFSI('input[name="sfsi_plus_form_height"]').val())}) : SFSI(".sfsi_plus_subscribe_Popinner").css({"width": '',"height": ''});1014 1015 "yes" == SFSI('input[name="sfsi_plus_form_adjustment"]:checked').val() ? SFSI(".sfsi_plus_html > .sfsi_plus_subscribe_Popinner").css({"width": "100%"}): '';1016 1017 "yes" == SFSI('input[name="sfsi_plus_form_border"]:checked').val() ? SFSI(".sfsi_plus_subscribe_Popinner").css({"border": SFSI('input[name="sfsi_plus_form_border_thickness"]').val()+"px solid "+SFSI('input[name="sfsi_plus_form_border_color"]').val()}) : SFSI(".sfsi_plus_subscribe_Popinner").css("border", "none");1018 1019 SFSI('input[name="sfsi_plus_form_background"]').val() != "" ? (SFSI(".sfsi_plus_subscribe_Popinner").css("background-color", SFSI('input[name="sfsi_plus_form_background"]').val())) : '';1020 1021 //Heading customization1022 SFSI('input[name="sfsi_plus_form_heading_text"]').val() != "" ? (SFSI(".sfsi_plus_subscribe_Popinner > form > h5").html(SFSI('input[name="sfsi_plus_form_heading_text"]').val())) : SFSI(".sfsi_plus_subscribe_Popinner > form > h5").html('');1023 1024 SFSI('#sfsi_plus_form_heading_font').val() != "" ? (SFSI(".sfsi_plus_subscribe_Popinner > form > h5").css("font-family", SFSI("#sfsi_plus_form_heading_font").val())) : '';1025 1026 if(SFSI('#sfsi_plus_form_heading_fontstyle').val() != 'bold')1027 {1028 SFSI('#sfsi_plus_form_heading_fontstyle').val() != "" ? (SFSI(".sfsi_plus_subscribe_Popinner > form > h5").css("font-style", SFSI("#sfsi_plus_form_heading_fontstyle").val())) : '';1029 SFSI(".sfsi_plus_subscribe_Popinner > form > h5").css("font-weight", '');1030 }1031 else1032 {1033 SFSI('#sfsi_plus_form_heading_fontstyle').val() != "" ? (SFSI(".sfsi_plus_subscribe_Popinner > form > h5").css("font-weight","bold")) : '';1034 SFSI(".sfsi_plus_subscribe_Popinner > form > h5").css("font-style", '');1035 }1036 1037 SFSI('input[name="sfsi_plus_form_heading_fontcolor"]').val() != "" ? (SFSI(".sfsi_plus_subscribe_Popinner > form > h5").css("color", SFSI('input[name="sfsi_plus_form_heading_fontcolor"]').val())) : '';1038 1039 SFSI('input[name="sfsi_plus_form_heading_fontsize"]').val() != "" ? (SFSI(".sfsi_plus_subscribe_Popinner > form > h5").css({"font-size": parseInt(SFSI('input[name="sfsi_plus_form_heading_fontsize"]').val())})) : '';1040 1041 SFSI('#sfsi_plus_form_heading_fontalign').val() != "" ? (SFSI(".sfsi_plus_subscribe_Popinner > form > h5").css("text-align", SFSI("#sfsi_plus_form_heading_fontalign").val())) : '';1042 1043 //Field customization1044 SFSI('input[name="sfsi_plus_form_field_text"]').val() != "" ? (SFSI(".sfsi_plus_subscribe_Popinner").find('input[name="data[Widget][email]"]').attr("placeholder", SFSI('input[name="sfsi_plus_form_field_text"]').val())) : SFSI(".sfsi_plus_subscribe_Popinner").find('input[name="data[Widget][email]"]').attr("placeholder", '');1045 1046 SFSI('input[name="sfsi_plus_form_field_text"]').val() != "" ? (SFSI(".sfsi_plus_left_container > .sfsi_plus_subscribe_Popinner").find('input[name="data[Widget][email]"]').val(SFSI('input[name="sfsi_plus_form_field_text"]').val())) : SFSI(".sfsi_plus_left_container > .sfsi_plus_subscribe_Popinner").find('input[name="data[Widget][email]"]').val('');1047 1048 SFSI('input[name="sfsi_plus_form_field_text"]').val() != "" ? (SFSI(".like_pop_box > .sfsi_plus_subscribe_Popinner").find('input[name="data[Widget][email]"]').val(SFSI('input[name="sfsi_plus_form_field_text"]').val())) : SFSI(".like_pop_box > .sfsi_plus_subscribe_Popinner").find('input[name="data[Widget][email]"]').val('');1049 1050 SFSI('#sfsi_plus_form_field_font').val() != "" ? (SFSI(".sfsi_plus_subscribe_Popinner").find('input[name="data[Widget][email]"]').css("font-family", SFSI("#sfsi_plus_form_field_font").val())) : '';1051 1052 if(SFSI('#sfsi_plus_form_field_fontstyle').val() != "bold")1053 {1054 SFSI('#sfsi_plus_form_field_fontstyle').val() != "" ? (SFSI(".sfsi_plus_subscribe_Popinner").find('input[name="data[Widget][email]"]').css("font-style", SFSI("#sfsi_plus_form_field_fontstyle").val())) : '';1055 SFSI(".sfsi_plus_subscribe_Popinner").find('input[name="data[Widget][email]"]').css("font-weight", '');1056 }1057 else1058 {1059 SFSI('#sfsi_plus_form_field_fontstyle').val() != "" ? (SFSI(".sfsi_plus_subscribe_Popinner").find('input[name="data[Widget][email]"]').css("font-weight", 'bold')) : '';1060 SFSI(".sfsi_plus_subscribe_Popinner").find('input[name="data[Widget][email]"]').css("font-style", '');1061 }1062 1063 SFSI('input[name="sfsi_plus_form_field_fontcolor"]').val() != "" ? (SFSI(".sfsi_plus_subscribe_Popinner").find('input[name="data[Widget][email]"]').css("color", SFSI('input[name="sfsi_plus_form_field_fontcolor"]').val())) : '';1064 1065 SFSI('input[name="sfsi_plus_form_field_fontsize"]').val() != "" ? (SFSI(".sfsi_plus_subscribe_Popinner").find('input[name="data[Widget][email]"]').css({"font-size": parseInt(SFSI('input[name="sfsi_plus_form_field_fontsize"]').val())})) : '';1066 1067 SFSI('#sfsi_plus_form_field_fontalign').val() != "" ? (SFSI(".sfsi_plus_subscribe_Popinner").find('input[name="data[Widget][email]"]').css("text-align", SFSI("#sfsi_plus_form_field_fontalign").val())) : '';1068 1069 //Button customization1070 SFSI('input[name="sfsi_plus_form_button_text"]').val() != "" ? (SFSI(".sfsi_plus_subscribe_Popinner").find('input[name="subscribe"]').attr("value", SFSI('input[name="sfsi_plus_form_button_text"]').val())) : '';1071 1072 SFSI('#sfsi_plus_form_button_font').val() != "" ? (SFSI(".sfsi_plus_subscribe_Popinner").find('input[name="subscribe"]').css("font-family", SFSI("#sfsi_plus_form_button_font").val())) : '';1073 1074 if(SFSI('#sfsi_plus_form_button_fontstyle').val() != "bold")1075 {1076 SFSI('#sfsi_plus_form_button_fontstyle').val() != "" ? (SFSI(".sfsi_plus_subscribe_Popinner").find('input[name="subscribe"]').css("font-style", SFSI("#sfsi_plus_form_button_fontstyle").val())) : '';1077 SFSI(".sfsi_plus_subscribe_Popinner").find('input[name="subscribe"]').css("font-weight", '');1078 }1079 else1080 {1081 SFSI('#sfsi_plus_form_button_fontstyle').val() != "" ? (SFSI(".sfsi_plus_subscribe_Popinner").find('input[name="subscribe"]').css("font-weight", 'bold')) : '';1082 SFSI(".sfsi_plus_subscribe_Popinner").find('input[name="subscribe"]').css("font-style", '');1083 }1084 1085 SFSI('input[name="sfsi_plus_form_button_fontcolor"]').val() != "" ? (SFSI(".sfsi_plus_subscribe_Popinner").find('input[name="subscribe"]').css("color", SFSI('input[name="sfsi_plus_form_button_fontcolor"]').val())) : '';1086 1087 SFSI('input[name="sfsi_plus_form_button_fontsize"]').val() != "" ? (SFSI(".sfsi_plus_subscribe_Popinner").find('input[name="subscribe"]').css({"font-size": parseInt(SFSI('input[name="sfsi_plus_form_button_fontsize"]').val())})) : '';1088 1089 SFSI('#sfsi_plus_form_button_fontalign').val() != "" ? (SFSI(".sfsi_plus_subscribe_Popinner").find('input[name="subscribe"]').css("text-align", SFSI("#sfsi_plus_form_button_fontalign").val())) : '';1090 1091 SFSI('input[name="sfsi_plus_form_button_background"]').val() != "" ? (SFSI(".sfsi_plus_subscribe_Popinner").find('input[name="subscribe"]').css("background-color", SFSI('input[name="sfsi_plus_form_button_background"]').val())) : '';1092 1093 var innerHTML = SFSI(".sfsi_plus_html > .sfsi_plus_subscribe_Popinner").html();1094 var styleCss = SFSI(".sfsi_plus_html > .sfsi_plus_subscribe_Popinner").attr("style");1095 innerHTML = '<div style="'+styleCss+'">'+innerHTML+'</div>';1096 SFSI(".sfsi_plus_subscription_html > xmp").html(innerHTML);1097 1098 /*var data = {1099 action:"getForm",1100 heading: SFSI('input[name="sfsi_plus_form_heading_text"]').val(),1101 placeholder:SFSI('input[name="sfsi_plus_form_field_text"]').val(),1102 button:SFSI('input[name="sfsi_plus_form_button_text"]').val()1103 };1104 SFSI.ajax({1105 url:ajax_object.ajax_url,1106 type:"post",1107 data:data,1108 success:function(s) {1109 SFSI(".sfsi_plus_subscription_html").html(s);1110 }1111 });*/1112}1113var global_error = 0;1114SFSI(document).ready(function(s) {1115 //changes done {Monad}1116 1117 SFSI(".lanOnchange").change(function(){1118 var currentDrpdown = SFSI(this).parents(".icons_size");1119 var data = {1120 action:"getIconPreview",1121 iconValue: SFSI(this).val(),1122 iconname: SFSI(this).attr( "data-iconUrl" )1123 };1124 SFSI.ajax({1125 url:ajax_object.ajax_url,1126 type:"post",1127 data:data,1128 success:function(s) {1129 currentDrpdown.children(".social-img-link").html(s);1130 }1131 });1132 });1133 1134 SFSI(".sfsiplus_tab_3_icns").on("click", ".cstomskins_upload", function() {1135 SFSI(".cstmskins-overlay").show("slow", function() {1136 e = 0;1137 });1138 });1139 /*SFSI("#custmskin_clspop").live("click", function() {*/1140 SFSI(document).on("click", '#custmskin_clspop', function () {1141 SFSI_plus_done();1142 SFSI(".cstmskins-overlay").hide("slow");1143 });1144 1145 sfsi_plus_create_suscriber_form();1146 1147 SFSI('input[name="sfsi_plus_form_heading_text"], input[name="sfsi_plus_form_border_thickness"], input[name="sfsi_plus_form_height"], input[name="sfsi_plus_form_width"], input[name="sfsi_plus_form_heading_fontsize"], input[name="sfsi_plus_form_field_text"], input[name="sfsi_plus_form_field_fontsize"], input[name="sfsi_plus_form_button_text"], input[name="sfsi_plus_form_button_fontsize"]').on("keyup", sfsi_plus_create_suscriber_form);1148 1149 SFSI('input[name="sfsi_plus_form_border_color"], input[name="sfsi_plus_form_background"] ,input[name="sfsi_plus_form_heading_fontcolor"], input[name="sfsi_plus_form_field_fontcolor"] ,input[name="sfsi_plus_form_button_fontcolor"],input[name="sfsi_plus_form_button_background"]').on("focus", sfsi_plus_create_suscriber_form);1150 1151 SFSI("#sfsi_plus_form_heading_font, #sfsi_plus_form_heading_fontstyle, #sfsi_plus_form_heading_fontalign, #sfsi_plus_form_field_font, #sfsi_plus_form_field_fontstyle, #sfsi_plus_form_field_fontalign, #sfsi_plus_form_button_font, #sfsi_plus_form_button_fontstyle, #sfsi_plus_form_button_fontalign").on("change", sfsi_plus_create_suscriber_form );1152 1153 /*SFSI(".radio").live("click", function() {*/1154 SFSI(document).on("click", '.radio', function () {1155 var s = SFSI(this).parent().find("input:radio:first");1156 switch(s.attr("name")) {1157 case 'sfsi_plus_form_adjustment':1158 if(s.val() == 'no')1159 s.parents(".row_tab").next(".row_tab").show("fast");1160 else1161 s.parents(".row_tab").next(".row_tab").hide("fast");1162 sfsi_plus_create_suscriber_form() 1163 break;1164 case 'sfsi_plus_form_border':1165 if(s.val() == 'yes')1166 s.parents(".row_tab").next(".row_tab").show("fast");1167 else1168 s.parents(".row_tab").next(".row_tab").hide("fast");1169 sfsi_plus_create_suscriber_form()1170 break;1171 default:1172 } 1173 });1174 1175 //pooja 28-12-20151176 SFSI('#sfsi_plus_form_border_color').wpColorPicker({1177 defaultColor: false,1178 change: function(event, ui){sfsi_plus_create_suscriber_form()},1179 clear: function() {sfsi_plus_create_suscriber_form()},1180 hide: true,1181 palettes: true1182 }),1183 SFSI('#sfsi_plus_form_background').wpColorPicker({1184 defaultColor: false,1185 change: function(event, ui){sfsi_plus_create_suscriber_form()},1186 clear: function() {sfsi_plus_create_suscriber_form()},1187 hide: true,1188 palettes: true1189 }),1190 SFSI('#sfsi_plus_form_heading_fontcolor').wpColorPicker({1191 defaultColor: false,1192 change: function(event, ui){sfsi_plus_create_suscriber_form()},1193 clear: function() {sfsi_plus_create_suscriber_form()},1194 hide: true,1195 palettes: true1196 }),1197 SFSI('#sfsi_plus_form_button_fontcolor').wpColorPicker({1198 defaultColor: false,1199 change: function(event, ui){sfsi_plus_create_suscriber_form()},1200 clear: function() {sfsi_plus_create_suscriber_form()},1201 hide: true,1202 palettes: true1203 }),1204 SFSI('#sfsi_plus_form_button_background').wpColorPicker({1205 defaultColor: false,1206 change: function(event, ui){sfsi_plus_create_suscriber_form()},1207 clear: function() {sfsi_plus_create_suscriber_form()},1208 hide: true,1209 palettes: true1210 });1211 /*SFSI("#sfsiPlusFormBorderColor").ColorPicker({1212 color:"#f80000",1213 onBeforeShow:function() {1214 s(this).ColorPickerSetColor(SFSI("#sfsi_plus_form_border_color").val());1215 },1216 onShow:function(s) {1217 return SFSI(s).fadeIn(500), !1;1218 },1219 onHide:function(s) {1220 return SFSI(s).fadeOut(500), !1;1221 },1222 onChange:function(s, i) {1223 SFSI("#sfsi_plus_form_border_color").val("#" + i), SFSI("#sfsiPlusFormBorderColor").css("background", "#" + i);1224 sfsi_plus_create_suscriber_form();1225 },1226 onClick:function(s, i) {1227 SFSI("#sfsi_plus_popup_background_color").val("#" + i), SFSI("#sfsiPlusFormBorderColor").css("background", "#" + i);1228 sfsi_plus_create_suscriber_form();1229 }1230 }),1231 SFSI("#sfsiPlusFormBackground").ColorPicker({1232 color:"#f80000",1233 onBeforeShow:function() {1234 s(this).ColorPickerSetColor(SFSI("#sfsi_plus_form_background").val());1235 },1236 onShow:function(s) {1237 return SFSI(s).fadeIn(500), !1;1238 },1239 onHide:function(s) {1240 return SFSI(s).fadeOut(500), !1;1241 },1242 onChange:function(s, i) {1243 SFSI("#sfsi_plus_form_background").val("#" + i), SFSI("#sfsiPlusFormBackground").css("background", "#" + i);1244 sfsi_plus_create_suscriber_form();1245 },1246 onClick:function(s, i) {1247 SFSI("#sfsi_plus_form_background").val("#" + i), SFSI("#sfsiPlusFormBackground").css("background", "#" + i);1248 sfsi_plus_create_suscriber_form();1249 }1250 }),1251 SFSI("#sfsiPlusFormHeadingFontcolor").ColorPicker({1252 color:"#f80000",1253 onBeforeShow:function() {1254 s(this).ColorPickerSetColor(SFSI("#sfsi_plus_form_heading_fontcolor").val());1255 },1256 onShow:function(s) {1257 return SFSI(s).fadeIn(500), !1;1258 },1259 onHide:function(s) {1260 return SFSI(s).fadeOut(500), !1;1261 },1262 onChange:function(s, i) {1263 SFSI("#sfsi_plus_form_heading_fontcolor").val("#"+i), SFSI("#sfsiPlusFormHeadingFontcolor").css("background","#"+i);1264 sfsi_plus_create_suscriber_form();1265 },1266 onClick:function(s, i) {1267 SFSI("#sfsi_plus_form_heading_fontcolor").val("#"+i), SFSI("#sfsiPlusFormHeadingFontcolor").css("background","#"+i);1268 sfsi_plus_create_suscriber_form();1269 }1270 }),1271 SFSI("#sfsiPlusFormFieldFontcolor").ColorPicker({1272 color:"#f80000",1273 onBeforeShow:function() {1274 s(this).ColorPickerSetColor(SFSI("#sfsi_plus_form_field_fontcolor").val());1275 },1276 onShow:function(s) {1277 return SFSI(s).fadeIn(500), !1;1278 },1279 onHide:function(s) {1280 return SFSI(s).fadeOut(500), !1;1281 },1282 onChange:function(s, i) {1283 SFSI("#sfsi_plus_form_field_fontcolor").val("#" + i), SFSI("#sfsiPlusFormFieldFontcolor").css("background", "#" +i);1284 sfsi_plus_create_suscriber_form();1285 },1286 onClick:function(s, i) {1287 SFSI("#sfsi_plus_form_field_fontcolor").val("#" + i), SFSI("#sfsiPlusFormFieldFontcolor").css("background", "#" +i);1288 sfsi_plus_create_suscriber_form();1289 }1290 }),1291 SFSI("#sfsiPlusFormButtonFontcolor").ColorPicker({1292 color:"#f80000",1293 onBeforeShow:function() {1294 s(this).ColorPickerSetColor(SFSI("#sfsi_plus_form_button_fontcolor").val());1295 },1296 onShow:function(s) {1297 return SFSI(s).fadeIn(500), !1;1298 },1299 onHide:function(s) {1300 return SFSI(s).fadeOut(500), !1;1301 },1302 onChange:function(s, i) {1303 SFSI("#sfsi_plus_form_button_fontcolor").val("#"+i), SFSI("#sfsiPlusFormButtonFontcolor").css("background", "#"+i);1304 sfsi_plus_create_suscriber_form();1305 },1306 onClick:function(s, i) {1307 SFSI("#sfsi_plus_form_button_fontcolor").val("#"+i), SFSI("#sfsiPlusFormButtonFontcolor").css("background", "#"+i);1308 sfsi_plus_create_suscriber_form();1309 }1310 }),1311 SFSI("#sfsiPlusFormButtonBackground").ColorPicker({1312 color:"#f80000",1313 onBeforeShow:function() {1314 s(this).ColorPickerSetColor(SFSI("#sfsi_plus_form_button_background").val());1315 },1316 onShow:function(s) {1317 return SFSI(s).fadeIn(500), !1;1318 },1319 onHide:function(s) {1320 return SFSI(s).fadeOut(500), !1;1321 },1322 onChange:function(s, i) {1323 SFSI("#sfsi_plus_form_button_background").val("#"+i), SFSI("#sfsiPlusFormButtonBackground").css("background","#"+i);1324 sfsi_plus_create_suscriber_form();1325 },1326 onClick:function(s, i) {1327 SFSI("#sfsi_plus_form_button_background").val("#"+i), SFSI("#sfsiPlusFormButtonBackground").css("background","#"+i);1328 sfsi_plus_create_suscriber_form();1329 }1330 });*/1331 //changes done {Monad}1332 1333 function i() {1334 SFSI(".uperror").html(""), sfsiplus_afterLoad();1335 var s = SFSI('input[name="' + SFSI("#upload_id").val() + '"]');1336 s.removeAttr("checked");1337 var i = SFSI(s).parent().find("span:first");1338 return SFSI(i).css("background-position", "0px 0px"), SFSI(".upload-overlay").hide("slow"), 1339 !1;1340 }1341 SFSI("#accordion").accordion({1342 collapsible:!0,1343 active:!1,1344 heightStyle:"content",1345 event:"click",1346 beforeActivate:function(s, i) {1347 if (i.newHeader[0]) var e = i.newHeader, t = e.next(".ui-accordion-content"); else var e = i.oldHeader, t = e.next(".ui-accordion-content");1348 var n = "true" == e.attr("aria-selected");1349 return e.toggleClass("ui-corner-all", n).toggleClass("accordion-header-active ui-state-active ui-corner-top", !n).attr("aria-selected", (!n).toString()), 1350 e.children(".ui-icon").toggleClass("ui-icon-triangle-1-e", n).toggleClass("ui-icon-triangle-1-s", !n), 1351 t.toggleClass("accordion-content-active", !n), n ? t.slideUp() :t.slideDown(), !1;1352 }1353 }),1354 SFSI("#accordion1").accordion({1355 collapsible:!0,1356 active:!1,1357 heightStyle:"content",1358 event:"click",1359 beforeActivate:function(s, i) {1360 if (i.newHeader[0]) var e = i.newHeader, t = e.next(".ui-accordion-content"); else var e = i.oldHeader, t = e.next(".ui-accordion-content");1361 var n = "true" == e.attr("aria-selected");1362 return e.toggleClass("ui-corner-all", n).toggleClass("accordion-header-active ui-state-active ui-corner-top", !n).attr("aria-selected", (!n).toString()), 1363 e.children(".ui-icon").toggleClass("ui-icon-triangle-1-e", n).toggleClass("ui-icon-triangle-1-s", !n), 1364 t.toggleClass("accordion-content-active", !n), n ? t.slideUp() :t.slideDown(), !1;1365 }1366 }),1367 SFSI(".closeSec").on("click", function() {1368 var s = !0, i = SFSI(this).closest("div.ui-accordion-content").prev("h3.ui-accordion-header").first(), e = SFSI(this).closest("div.ui-accordion-content").first();1369 i.toggleClass("ui-corner-all", s).toggleClass("accordion-header-active ui-state-active ui-corner-top", !s).attr("aria-selected", (!s).toString()), 1370 i.children(".ui-icon").toggleClass("ui-icon-triangle-1-e", s).toggleClass("ui-icon-triangle-1-s", !s), 1371 e.toggleClass("accordion-content-active", !s), s ? e.slideUp() :e.slideDown();1372 }),1373 SFSI(document).click(function(s) {1374 var i = SFSI(".sfsi_plus_FrntInner"), e = SFSI(".sfsi_plus_wDiv"), t = SFSI("#at15s");1375 i.is(s.target) || 0 !== i.has(s.target).length || e.is(s.target) || 0 !== e.has(s.target).length || t.is(s.target) || 0 !== t.has(s.target).length || i.fadeOut();1376 }),1377 SFSI(".sfsi_plus_outr_div").find(".addthis_button").mousemove(function() {1378 var s = SFSI(".sfsi_plus_outr_div").find(".addthis_button").offset().top + 10;1379 SFSI("#at15s").css({1380 top:s + "px",1381 left:SFSI(".sfsi_plus_outr_div").find(".addthis_button").offset().left + "px"1382 });1383 }),1384 1385 //pooja 28-12-20151386 SFSI('#sfsi_plus_popup_background_color').wpColorPicker({1387 defaultColor: false,1388 change: function(event, ui){sfsi_plus_make_popBox()},1389 clear: function() {sfsi_plus_make_popBox()},1390 hide: true,1391 palettes: true1392 }),1393 SFSI('#sfsi_plus_popup_border_color').wpColorPicker({1394 defaultColor: false,1395 change: function(event, ui){sfsi_plus_make_popBox()},1396 clear: function() {sfsi_plus_make_popBox()},1397 hide: true,1398 palettes: true1399 }),1400 SFSI('#sfsi_plus_popup_fontColor').wpColorPicker({1401 defaultColor: false,1402 change: function(event, ui){sfsi_plus_make_popBox()},1403 clear: function() {sfsi_plus_make_popBox()},1404 hide: true,1405 palettes: true1406 }),1407 1408 /*SFSI("#sfsifontCloroPicker").ColorPicker({1409 color:"#f80000",1410 onBeforeShow:function() {1411 s(this).ColorPickerSetColor(SFSI("#sfsi_plus_popup_fontColor").val());1412 },1413 onShow:function(s) {1414 return SFSI(s).fadeIn(500), !1;1415 },1416 onHide:function(s) {1417 return SFSI(s).fadeOut(500), sfsi_plus_make_popBox(), !1;1418 },1419 onChange:function(s, i) {1420 SFSI("#sfsi_plus_popup_fontColor").val("#" + i), SFSI("#sfsifontCloroPicker").css("background", "#" + i), 1421 sfsi_plus_make_popBox();1422 },1423 onClick:function(s, i) {1424 SFSI("#sfsi_plus_popup_fontColor").val("#" + i), SFSI("#sfsifontCloroPicker").css("background", "#" + i), 1425 sfsi_plus_make_popBox();1426 }1427 }),*/1428 SFSI("div#sfsiplusid_linkedin").find(".icon4").find("a").find("img").mouseover(function() {1429 SFSI(this).attr("src", ajax_object.plugin_url + "images/visit_icons/linkedIn_hover.svg");1430 }),1431 SFSI("div#sfsiplusid_linkedin").find(".icon4").find("a").find("img").mouseleave(function() {1432 SFSI(this).attr("src", ajax_object.plugin_url + "images/visit_icons/linkedIn.svg");1433 }),1434 SFSI("div#sfsiplusid_youtube").find(".icon1").find("a").find("img").mouseover(function() {1435 SFSI(this).attr("src", ajax_object.plugin_url + "images/visit_icons/youtube_hover.svg");1436 }),1437 SFSI("div#sfsiplusid_youtube").find(".icon1").find("a").find("img").mouseleave(function() {1438 SFSI(this).attr("src", ajax_object.plugin_url + "images/visit_icons/youtube.svg");1439 }),1440 SFSI("div#sfsiplusid_facebook").find(".icon1").find("a").find("img").mouseover(function() {1441 SFSI(this).css("opacity", "0.9");1442 }),1443 SFSI("div#sfsiplusid_facebook").find(".icon1").find("a").find("img").mouseleave(function() {1444 SFSI(this).css("opacity", "1");1445 /*{Monad}*/1446 }),1447 SFSI("div#sfsiplusid_twitter").find(".cstmicon1").find("a").find("img").mouseover(function() {1448 SFSI(this).css("opacity", "0.9");1449 }),1450 SFSI("div#sfsiplusid_twitter").find(".cstmicon1").find("a").find("img").mouseleave(function() {1451 SFSI(this).css("opacity", "1");1452 }),1453 1454 //pooja 28-12-20151455 1456 /*SFSI("#sfsiBackgroundColorPicker").ColorPicker({1457 color:"#f80000",1458 onBeforeShow:function() {1459 s(this).ColorPickerSetColor(SFSI("#sfsi_plus_popup_background_color").val());1460 },1461 onShow:function(s) {1462 return SFSI(s).fadeIn(500), !1;1463 },1464 onHide:function(s) {1465 return SFSI(s).fadeOut(500), !1;1466 },1467 onChange:function(s, i) {1468 SFSI("#sfsi_plus_popup_background_color").val("#" + i), SFSI("#sfsiBackgroundColorPicker").css("background","#"+i), 1469 sfsi_plus_make_popBox();1470 },1471 onClick:function(s, i) {1472 SFSI("#sfsi_plus_popup_background_color").val("#" + i), SFSI("#sfsiBackgroundColorPicker").css("background","#"+i), 1473 sfsi_plus_make_popBox();1474 }1475 }),1476 SFSI("#sfsiBorderColorPicker").ColorPicker({1477 color:"#f80000",1478 onBeforeShow:function() {1479 s(this).ColorPickerSetColor(SFSI("#sfsi_plus_popup_border_color").val());1480 },1481 onShow:function(s) {1482 return SFSI(s).fadeIn(500), !1;1483 },1484 onHide:function(s) {1485 return SFSI(s).fadeOut(500), !1;1486 },1487 onChange:function(s, i) {1488 SFSI("#sfsi_plus_popup_border_color").val("#" + i), SFSI("#sfsiBorderColorPicker").css("background", "#" + i), 1489 sfsi_plus_make_popBox();1490 },1491 onClick:function(s, i) {1492 SFSI("#sfsi_plus_popup_border_color").val("#" + i), SFSI("#sfsiBorderColorPicker").css("background", "#" + i), 1493 sfsi_plus_make_popBox();1494 }1495 }),*/1496 SFSI("#sfsi_plus_save1").on("click", function() {1497 sfsi_plus_update_step1() && sfsipluscollapse(this);1498 }),1499 SFSI("#sfsi_plus_save2").on("click", function() {1500 sfsi_plus_update_step2() && sfsipluscollapse(this);1501 }),1502 SFSI("#sfsi_plus_save3").on("click", function() {1503 sfsi_plus_update_step3() && sfsipluscollapse(this);1504 }),1505 SFSI("#sfsi_plus_save4").on("click", function() {1506 sfsi_plus_update_step4() && sfsipluscollapse(this);1507 }),1508 SFSI("#sfsi_plus_save5").on("click", function() {1509 sfsi_plus_update_step5() && sfsipluscollapse(this);1510 }),1511 SFSI("#sfsi_plus_save6").on("click", function() {1512 sfsi_plus_update_step6() && sfsipluscollapse(this);1513 }),1514 SFSI("#sfsi_plus_save7").on("click", function() {1515 sfsi_plus_update_step7() && sfsipluscollapse(this);1516 }),1517 SFSI("#sfsi_plus_save8").on("click", function() {1518 sfsi_plus_update_step8() && sfsipluscollapse(this);1519 }),1520 SFSI("#sfsi_plus_save9").on("click", function() {1521 sfsi_plus_update_step9() && sfsipluscollapse(this);1522 }),1523 SFSI("#save_plus_all_settings").on("click", function() {1524 return SFSI("#save_plus_all_settings").text("Saving.."), SFSI(".save_button >a").css("pointer-events", "none"), 1525 sfsi_plus_update_step1(), sfsi_plus_update_step9(), 1 == global_error ? (sfsiplus_showErrorSuc("error", 'Some Selection error in "Which icons do you want to show on your site?" tab.', 8), 1526 global_error = 0, !1) :(sfsi_plus_update_step2(), 1 == global_error ? (sfsiplus_showErrorSuc("error", 'Some Selection error in "What do you want the icons to do?" tab.', 8), 1527 global_error = 0, !1) :(sfsi_plus_update_step3(), 1 == global_error ? (sfsiplus_showErrorSuc("error", 'Some Selection error in "What design & animation do you want to give your icons?" tab.', 8), 1528 global_error = 0, !1) :(sfsi_plus_update_step4(), 1 == global_error ? (sfsiplus_showErrorSuc("error", 'Some Selection error in "Do you want to display "counts" next to your icons?" tab.', 8), 1529 global_error = 0, !1) :(sfsi_plus_update_step5(), 1 == global_error ? (sfsiplus_showErrorSuc("error", 'Some Selection error in "Any other wishes for your main icons?" tab.', 8), 1530 global_error = 0, !1) :(sfsi_plus_update_step6(), 1 == global_error ? (sfsiplus_showErrorSuc("error", 'Some Selection error in "Do you want to display icons at the end of every post?" tab.', 8), 1531 global_error = 0, !1) :(sfsi_plus_update_step7(), 1 == global_error ? (sfsiplus_showErrorSuc("error", 'Some Selection error in "Do you want to display a pop-up, asking people to subscribe?" tab.', 8),1532 global_error = 0, !1) : sfsi_plus_update_step8(), 1 == global_error ? (sfsiplus_showErrorSuc("error", 'Some Selection error in "Where shall they be displayed?" tab.', 8), 1533 /*global_error = 0, !1) :void (0 == global_error && sfsiplus_showErrorSuc("success", 'Saved! Now go to the <a href="widgets.php">widget</a> area and place the widget into your sidebar (if not done already)', 8))))))));*/1534 global_error = 0, !1) :void (0 == global_error && sfsiplus_showErrorSuc("success", '', 8))))))));1535 }),1536 /*SFSI(".fileUPInput").live("change", function() {*/1537 SFSI(document).on("change", '.fileUPInput', function () {1538 sfsiplus_beForeLoad(), sfsiplus_beforeIconSubmit(this) && (SFSI(".upload-overlay").css("pointer-events", "none"), 1539 SFSI("#customIconFrm").ajaxForm({1540 dataType:"json",1541 success:sfsiplus_afterIconSuccess,1542 resetForm:!01543 }).submit());1544 }),1545 SFSI(".pop-up").on("click", function() {1546 ("fbex-s2" == SFSI(this).attr("data-id") || "googlex-s2" == SFSI(this).attr("data-id") || "linkex-s2" == SFSI(this).attr("data-id")) && (SFSI("." + SFSI(this).attr("data-id")).hide(), 1547 SFSI("." + SFSI(this).attr("data-id")).css("opacity", "1"), SFSI("." + SFSI(this).attr("data-id")).css("z-index", "1000")), 1548 SFSI("." + SFSI(this).attr("data-id")).show("slow");1549 }),1550 /*SFSI("#close_popup").live("click", function() {*/1551 SFSI(document).on("click", '#close_popup', function () {1552 SFSI(".read-overlay").hide("slow");1553 });1554 var e = 0;1555 SFSI(".plus_icn_listing").on("click", ".checkbox", function() {1556 if (1 == e) return !1;1557 "yes" == SFSI(this).attr("dynamic_ele") && (s = SFSI(this).parent().find("input:checkbox:first"), 1558 s.is(":checked") ? SFSI(s).attr("checked", !1) :SFSI(s).attr("checked", !0)), s = SFSI(this).parent().find("input:checkbox:first"), 1559 "yes" == SFSI(s).attr("isNew") && ("0px 0px" == SFSI(this).css("background-position") ? (SFSI(s).attr("checked", !0), 1560 SFSI(this).css("background-position", "0px -36px")) :(SFSI(s).removeAttr("checked", !0), 1561 SFSI(this).css("background-position", "0px 0px")));1562 var s = SFSI(this).parent().find("input:checkbox:first");1563 if (s.is(":checked") && "sfsiplus-cusotm-icon" == s.attr("element-type")) SFSI(".fileUPInput").attr("name", "custom_icons[]"), 1564 SFSI(".upload-overlay").show("slow", function() {1565 e = 0;1566 }),1567 SFSI("#upload_id").val(s.attr("name")); else if (!s.is(":checked") && "sfsiplus-cusotm-icon" == s.attr("element-type")) return s.attr("ele-type") ? (SFSI(this).attr("checked", !0), 1568 SFSI(this).css("background-position", "0px -36px"), e = 0, !1) :confirm("Are you sure want to delete this Icon..?? ") ? "suc" == sfsi_plus_delete_CusIcon(this, s) ? (s.attr("checked", !1), 1569 SFSI(this).css("background-position", "0px 0px"), e = 0, !1) :(e = 0, !1) :(s.attr("checked", !0), 1570 SFSI(this).css("background-position", "0px -36px"), e = 0, !1);1571 }),1572 SFSI(".plus_icn_listing").on("click", ".checkbox", function() {1573 checked = SFSI(this).parent().find("input:checkbox:first"), "sfsi_plus_email_display" != checked.attr("name") || checked.is(":checked") || SFSI(".demail-1").show("slow");1574 }),1575 SFSI("#deac_email2").on("click", function() {1576 SFSI(".demail-1").hide("slow"), SFSI(".demail-2").show("slow");1577 }),1578 SFSI("#deac_email3").on("click", function() {1579 SFSI(".demail-2").hide("slow"), SFSI(".demail-3").show("slow");1580 }),1581 SFSI(".hideemailpop").on("click", function() {1582 SFSI('input[name="sfsi_plus_email_display"]').attr("checked", !0),1583 SFSI('input[name="sfsi_plus_email_display"]').parent().find("span:first").css("background-position", "0px -36px"), 1584 SFSI(".demail-1").hide("slow"), SFSI(".demail-2").hide("slow"), SFSI(".demail-3").hide("slow");1585 }),1586 SFSI(".hidePop").on("click", function() {1587 SFSI(".demail-1").hide("slow"), SFSI(".demail-2").hide("slow"), SFSI(".demail-3").hide("slow");1588 }),1589 SFSI(".sfsiplus_activate_footer").on("click", function() {1590 var nonce = SFSI(this).attr("data-nonce");1591 SFSI(this).text("activating....");1592 var s = {1593 action:"plus_activateFooter",1594 nonce:nonce1595 };1596 SFSI.ajax({1597 url:ajax_object.ajax_url,1598 type:"post",1599 data:s,1600 dataType:"json",1601 success:function(s) {1602 if(s.res == "wrong_nonce")1603 {1604 SFSI(".sfsiplus_activate_footer").css("font-size", "18px");1605 SFSI(".sfsiplus_activate_footer").text("Unauthorised Request, Try again after refreshing page");1606 }1607 else1608 {1609 "success" == s.res && (SFSI(".demail-1").hide("slow"), SFSI(".demail-2").hide("slow"), 1610 SFSI(".demail-3").hide("slow"), SFSI(".sfsiplus_activate_footer").text("Ok, activate link"));1611 }1612 }1613 });1614 }),1615 SFSI(".sfsiplus_removeFooter").on("click", function() {1616 var nonce = SFSI(this).attr("data-nonce");1617 SFSI(this).text("working....");1618 var s = {1619 action:"plus_removeFooter",1620 nonce:nonce1621 };1622 SFSI.ajax({1623 url:ajax_object.ajax_url,1624 type:"post",1625 data:s,1626 dataType:"json",1627 success:function(s) {1628 if(s.res == "wrong_nonce")1629 {1630 SFSI(".sfsiplus_removeFooter").text("Unauthorised Request, Try again after refreshing page");1631 }1632 else1633 {1634 "success" == s.res && (SFSI(".sfsiplus_removeFooter").fadeOut("slow"), SFSI(".sfsiplus_footerLnk").fadeOut("slow"));1635 }1636 }1637 });1638 }),1639 /*SFSI(".radio").live("click", function() {*/1640 SFSI(document).on("click", '.radio', function () {1641 var s = SFSI(this).parent().find("input:radio:first");1642 "sfsi_plus_display_counts" == s.attr("name") && sfsi_plus_show_counts();1643 }),1644 SFSI("#close_Uploadpopup").on("click", i), /*SFSI(".radio").live("click", function() {*/SFSI(document).on("click", '.radio', function () {1645 var s = SFSI(this).parent().find("input:radio:first");1646 "sfsi_plus_show_Onposts" == s.attr("name") && sfsi_plus_show_OnpostsDisplay();1647 }),1648 sfsi_plus_show_OnpostsDisplay(),1649 sfsi_plus_depened_sections(),1650 sfsi_plus_show_counts(),1651 sfsi_plus_showPreviewCounts(), 1652 SFSI(".plus_share_icon_order").sortable({1653 update:function() {1654 SFSI(".plus_share_icon_order li").each(function() {1655 SFSI(this).attr("data-index", SFSI(this).index() + 1);1656 });1657 },1658 revert:!01659 }),1660 /*SFSI(".radio").live("click", function() {*/1661 SFSI(document).on("click", '.radio', function () {1662 var s = SFSI(this).parent().find("input:radio:first");1663 "sfsi_plus_email_countsFrom" == s.attr("name") && (SFSI('input[name="sfsi_plus_email_countsDisplay"]').prop("checked", !0), 1664 SFSI('input[name="sfsi_plus_email_countsDisplay"]').parent().find("span.checkbox").attr("style", "background-position:0px -36px;"), 1665 "manual" == SFSI("input[name='sfsi_plus_email_countsFrom']:checked").val() ? SFSI("input[name='sfsi_plus_email_manualCounts']").slideDown() :SFSI("input[name='sfsi_plus_email_manualCounts']").slideUp()), 1666 "sfsi_plus_facebook_countsFrom" == s.attr("name") && (SFSI('input[name="sfsi_plus_facebook_countsDisplay"]').prop("checked", !0), 1667 SFSI('input[name="sfsi_plus_facebook_countsDisplay"]').parent().find("span.checkbox").attr("style", "background-position:0px -36px;"),1668 "mypage" == SFSI("input[name='sfsi_plus_facebook_countsFrom']:checked").val() ? (SFSI("input[name='sfsi_plus_facebook_mypageCounts']").slideDown(),SFSI(".sfsiplus_fbpgidwpr").slideDown()) :(SFSI("input[name='sfsi_plus_facebook_mypageCounts']").slideUp(),SFSI(".sfsiplus_fbpgidwpr").slideUp()), 1669 "manual" == SFSI("input[name='sfsi_plus_facebook_countsFrom']:checked").val() ? SFSI("input[name='sfsi_plus_facebook_manualCounts']").slideDown() :SFSI("input[name='sfsi_plus_facebook_manualCounts']").slideUp()), 1670 "sfsi_plus_twitter_countsFrom" == s.attr("name") && (SFSI('input[name="sfsi_plus_twitter_countsDisplay"]').prop("checked", !0), 1671 SFSI('input[name="sfsi_plus_twitter_countsDisplay"]').parent().find("span.checkbox").attr("style", "background-position:0px -36px;"), 1672 "manual" == SFSI("input[name='sfsi_plus_twitter_countsFrom']:checked").val() ? (SFSI("input[name='sfsi_plus_twitter_manualCounts']").slideDown(), 1673 SFSI(".tw_follow_options").slideUp()) :(SFSI("input[name='sfsi_plus_twitter_manualCounts']").slideUp(), 1674 SFSI(".tw_follow_options").slideDown())), "sfsi_plus_google_countsFrom" == s.attr("name") && (SFSI('input[name="sfsi_plus_google_countsDisplay"]').prop("checked", !0), 1675 SFSI('input[name="sfsi_plus_google_countsDisplay"]').parent().find("span.checkbox").attr("style", "background-position:0px -36px;"), 1676 "manual" == SFSI("input[name='sfsi_plus_google_countsFrom']:checked").val() && (SFSI("input[name='sfsi_plus_google_manualCounts']").slideDown(), 1677 SFSI(".google_option").slideUp()), "likes" == SFSI("input[name='sfsi_plus_google_countsFrom']:checked").val() && (SFSI("input[name='sfsi_plus_google_manualCounts']").slideUp(), 1678 SFSI(".google_option").slideUp()), "follower" == SFSI("input[name='sfsi_plus_google_countsFrom']:checked").val() && (SFSI(".google_option").slideDown(), 1679 SFSI("input[name='sfsi_plus_google_manualCounts']").slideUp())), "sfsi_plus_linkedIn_countsFrom" == s.attr("name") && (SFSI('input[name="sfsi_plus_linkedIn_countsDisplay"]').prop("checked", !0), 1680 SFSI('input[name="sfsi_plus_linkedIn_countsDisplay"]').parent().find("span.checkbox").attr("style", "background-position:0px -36px;"), 1681 "manual" == SFSI("input[name='sfsi_plus_linkedIn_countsFrom']:checked").val() ? (SFSI("input[name='sfsi_plus_linkedIn_manualCounts']").slideDown(), 1682 SFSI(".linkedIn_options").slideUp()) :(SFSI("input[name='sfsi_plus_linkedIn_manualCounts']").slideUp(), 1683 SFSI(".linkedIn_options").slideDown())), "sfsi_plus_youtube_countsFrom" == s.attr("name") && (SFSI('input[name="sfsi_plus_youtube_countsDisplay"]').prop("checked", !0), 1684 SFSI('input[name="sfsi_plus_youtube_countsDisplay"]').parent().find("span.checkbox").attr("style", "background-position:0px -36px;"), 1685 "manual" == SFSI("input[name='sfsi_plus_youtube_countsFrom']:checked").val() ? (SFSI("input[name='sfsi_plus_youtube_manualCounts']").slideDown(), 1686 SFSI(".youtube_options").slideUp()) :(SFSI("input[name='sfsi_plus_youtube_manualCounts']").slideUp(), 1687 SFSI(".youtube_options").slideDown())), "sfsi_plus_pinterest_countsFrom" == s.attr("name") && (SFSI('input[name="sfsi_plus_pinterest_countsDisplay"]').prop("checked", !0), 1688 SFSI('input[name="sfsi_plus_pinterest_countsDisplay"]').parent().find("span.checkbox").attr("style", "background-position:0px -36px;"), 1689 "manual" == SFSI("input[name='sfsi_plus_pinterest_countsFrom']:checked").val() ? (SFSI("input[name='sfsi_plus_pinterest_manualCounts']").slideDown(), 1690 SFSI(".pin_options").slideUp()) :SFSI("input[name='sfsi_plus_pinterest_manualCounts']").slideUp()), 1691 "sfsi_plus_instagram_countsFrom" == s.attr("name") && (SFSI('input[name="sfsi_plus_instagram_countsDisplay"]').prop("checked", !0), 1692 SFSI('input[name="sfsi_plus_instagram_countsDisplay"]').parent().find("span.checkbox").attr("style", "background-position:0px -36px;"), 1693 "manual" == SFSI("input[name='sfsi_plus_instagram_countsFrom']:checked").val() ? (SFSI("input[name='sfsi_plus_instagram_manualCounts']").slideDown(), 1694 SFSI(".instagram_userLi").slideUp()) :(SFSI("input[name='sfsi_plus_instagram_manualCounts']").slideUp(), 1695 SFSI(".instagram_userLi").slideDown())), "sfsi_plus_shares_countsFrom" == s.attr("name") && (SFSI('input[name="sfsi_plus_shares_countsDisplay"]').prop("checked", !0), 1696 SFSI('input[name="sfsi_plus_shares_countsDisplay"]').parent().find("span.checkbox").attr("style", "background-position:0px -36px;"), 1697 "manual" == SFSI("input[name='sfsi_plus_shares_countsFrom']:checked").val() ? SFSI("input[name='sfsi_plus_shares_manualCounts']").slideDown() :SFSI("input[name='sfsi_plus_shares_manualCounts']").slideUp());1698 }), sfsi_plus_make_popBox(), SFSI('input[name="sfsi_plus_popup_text"] ,input[name="sfsi_plus_popup_background_color"],input[name="sfsi_plus_popup_border_color"],input[name="sfsi_plus_popup_border_thickness"],input[name="sfsi_plus_popup_fontSize"],input[name="sfsi_plus_popup_fontColor"]').on("keyup", sfsi_plus_make_popBox), 1699 SFSI('input[name="sfsi_plus_popup_text"] ,input[name="sfsi_plus_popup_background_color"],input[name="sfsi_plus_popup_border_color"],input[name="sfsi_plus_popup_border_thickness"],input[name="sfsi_plus_popup_fontSize"],input[name="sfsi_plus_popup_fontColor"]').on("focus", sfsi_plus_make_popBox), 1700 SFSI("#sfsi_plus_popup_font ,#sfsi_plus_popup_fontStyle").on("change", sfsi_plus_make_popBox), 1701 /*SFSI(".radio").live("click", function() {*/1702 SFSI(document).on("click", '.radio', function () {1703 var s = SFSI(this).parent().find("input:radio:first");1704 "sfsi_plus_popup_border_shadow" == s.attr("name") && sfsi_plus_make_popBox();1705 }), /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ? SFSI("img.sfsi_wicon").on("click", function(s) {1706 s.stopPropagation();1707 var i = SFSI("#sfsi_plus_floater_sec").val();1708 SFSI("div.sfsi_plus_wicons").css("z-index", "0"), SFSI(this).parent().parent().parent().siblings("div.sfsi_plus_wicons").find(".sfsiplus_inerCnt").find("div.sfsi_plus_tool_tip_2").hide(), 1709 SFSI(this).parent().parent().parent().parent().siblings("li").length > 0 && (SFSI(this).parent().parent().parent().parent().siblings("li").find("div.sfsi_plus_tool_tip_2").css("z-index", "0"), 1710 SFSI(this).parent().parent().parent().parent().siblings("li").find("div.sfsi_plus_wicons").find(".sfsiplus_inerCnt").find("div.sfsi_plus_tool_tip_2").hide()), 1711 SFSI(this).parent().parent().parent().css("z-index", "1000000"), SFSI(this).parent().parent().css({1712 "z-index":"999"1713 }), SFSI(this).attr("effect") && "fade_in" == SFSI(this).attr("effect") && (SFSI(this).parentsUntil("div").siblings("div.sfsi_plus_tool_tip_2").css({1714 opacity:1,1715 "z-index":101716 }), SFSI(this).parent().css("opacity", "1")), SFSI(this).attr("effect") && "scale" == SFSI(this).attr("effect") && (SFSI(this).parent().addClass("scale"), 1717 SFSI(this).parentsUntil("div").siblings("div.sfsi_plus_tool_tip_2").css({1718 opacity:1,1719 "z-index":101720 }), SFSI(this).parent().css("opacity", "1")), SFSI(this).attr("effect") && "combo" == SFSI(this).attr("effect") && (SFSI(this).parent().addClass("scale"), 1721 SFSI(this).parent().css("opacity", "1"), SFSI(this).parentsUntil("div").siblings("div.sfsi_plus_tool_tip_2").css({1722 opacity:1,1723 "z-index":101724 })), ("top-left" == i || "top-right" == i) && SFSI(this).parent().parent().parent().parent("#sfsi_plus_floater").length > 0 && "sfsi_plus_floater" == SFSI(this).parent().parent().parent().parent().attr("id") ? (SFSI(this).parentsUntil("div").siblings("div.sfsi_plus_tool_tip_2").addClass("sfsi_plc_btm"), 1725 SFSI(this).parentsUntil("div").siblings("div.sfsi_plus_tool_tip_2").find("span.bot_arow").addClass("top_big_arow"), 1726 SFSI(this).parentsUntil("div").siblings("div.sfsi_plus_tool_tip_2").css({1727 opacity:1,1728 "z-index":101729 }), SFSI(this).parentsUntil("div").siblings("div.sfsi_plus_tool_tip_2").show()) :(SFSI(this).parentsUntil("div").siblings("div.sfsi_plus_tool_tip_2").find("span.bot_arow").removeClass("top_big_arow"), 1730 SFSI(this).parentsUntil("div").siblings("div.sfsi_plus_tool_tip_2").removeClass("sfsi_plc_btm"), 1731 SFSI(this).parentsUntil("div").siblings("div.sfsi_plus_tool_tip_2").css({1732 opacity:1,1733 "z-index":1e31734 }), SFSI(this).parentsUntil("div").siblings("div.sfsi_plus_tool_tip_2").show());1735 }) :SFSI("img.sfsi_wicon").on("mouseenter", function() {1736 var s = SFSI("#sfsi_plus_floater_sec").val();1737 SFSI("div.sfsi_plus_wicons").css("z-index", "0"), SFSI(this).parent().parent().parent().siblings("div.sfsi_plus_wicons").find(".sfsiplus_inerCnt").find("div.sfsi_plus_tool_tip_2").hide(), 1738 SFSI(this).parent().parent().parent().parent().siblings("li").length > 0 && (SFSI(this).parent().parent().parent().parent().siblings("li").find("div.sfsi_plus_tool_tip_2").css("z-index", "0"), 1739 SFSI(this).parent().parent().parent().parent().siblings("li").find("div.sfsi_plus_wicons").find(".sfsiplus_inerCnt").find("div.sfsi_plus_tool_tip_2").hide()), 1740 SFSI(this).parent().parent().parent().css("z-index", "1000000"), SFSI(this).parent().parent().css({1741 "z-index":"999"1742 }), SFSI(this).attr("effect") && "fade_in" == SFSI(this).attr("effect") && (SFSI(this).parentsUntil("div").siblings("div.sfsi_plus_tool_tip_2").css({1743 opacity:1,1744 "z-index":101745 }), SFSI(this).parent().css("opacity", "1")), SFSI(this).attr("effect") && "scale" == SFSI(this).attr("effect") && (SFSI(this).parent().addClass("scale"), 1746 SFSI(this).parentsUntil("div").siblings("div.sfsi_plus_tool_tip_2").css({1747 opacity:1,1748 "z-index":101749 }), SFSI(this).parent().css("opacity", "1")), SFSI(this).attr("effect") && "combo" == SFSI(this).attr("effect") && (SFSI(this).parent().addClass("scale"), 1750 SFSI(this).parent().css("opacity", "1"), SFSI(this).parentsUntil("div").siblings("div.sfsi_plus_tool_tip_2").css({1751 opacity:1,1752 "z-index":101753 })), ("top-left" == s || "top-right" == s) && SFSI(this).parent().parent().parent().parent("#sfsi_plus_floater").length > 0 && "sfsi_plus_floater" == SFSI(this).parent().parent().parent().parent().attr("id") ? (SFSI(this).parentsUntil("div").siblings("div.sfsi_plus_tool_tip_2").addClass("sfsi_plc_btm"), 1754 SFSI(this).parentsUntil("div").siblings("div.sfsi_plus_tool_tip_2").find("span.bot_arow").addClass("top_big_arow"), 1755 SFSI(this).parentsUntil("div").siblings("div.sfsi_plus_tool_tip_2").css({1756 opacity:1,1757 "z-index":101758 }), SFSI(this).parentsUntil("div").siblings("div.sfsi_plus_tool_tip_2").show()) :(SFSI(this).parentsUntil("div").siblings("div.sfsi_plus_tool_tip_2").find("span.bot_arow").removeClass("top_big_arow"), 1759 SFSI(this).parentsUntil("div").siblings("div.sfsi_plus_tool_tip_2").removeClass("sfsi_plc_btm"), 1760 SFSI(this).parentsUntil("div").siblings("div.sfsi_plus_tool_tip_2").css({1761 opacity:1,1762 "z-index":101763 }), SFSI(this).parentsUntil("div").siblings("div.sfsi_plus_tool_tip_2").show());1764 }), SFSI("div.sfsi_plus_wicons").on("mouseleave", function() {1765 SFSI(this).children("div.sfsiplus_inerCnt").children("a.sficn").attr("effect") && "fade_in" == SFSI(this).children("div.sfsiplus_inerCnt").children("a.sficn").attr("effect") && SFSI(this).children("div.sfsiplus_inerCnt").find("a.sficn").css("opacity", "0.6"), 1766 SFSI(this).children("div.sfsiplus_inerCnt").children("a.sficn").attr("effect") && "scale" == SFSI(this).children("div.sfsiplus_inerCnt").children("a.sficn").attr("effect") && SFSI(this).children("div.sfsiplus_inerCnt").find("a.sficn").removeClass("scale"), 1767 SFSI(this).children("div.sfsiplus_inerCnt").children("a.sficn").attr("effect") && "combo" == SFSI(this).children("div.sfsiplus_inerCnt").children("a.sficn").attr("effect") && (SFSI(this).children("div.sfsiplus_inerCnt").find("a.sficn").css("opacity", "0.6"), 1768 SFSI(this).children("div.sfsiplus_inerCnt").find("a.sficn").removeClass("scale")), "google" == SFSI(this).children("div.sfsiplus_inerCnt").find("a.sficn").attr("id") ? SFSI("body").on("click", function() {1769 SFSI(this).children(".sfsiplus_inerCnt").find("div.sfsi_plus_tool_tip_2").hide();1770 }) :(SFSI(this).css({1771 "z-index":"0"1772 }), SFSI(this).children(".sfsiplus_inerCnt").find("div.sfsi_plus_tool_tip_2").hide());1773 }),1774 SFSI("body").on("click", function() {1775 SFSI(".sfsiplus_inerCnt").find("div.sfsi_plus_tool_tip_2").hide();1776 }),1777 SFSI(".adminTooltip >a").on("hover", function() {1778 SFSI(this).offset().top, SFSI(this).parent("div").find("div.sfsi_plus_tool_tip_2_inr").css("opacity", "1"), 1779 SFSI(this).parent("div").find("div.sfsi_plus_tool_tip_2_inr").show();1780 }),1781 SFSI(".adminTooltip").on("mouseleave", function() {1782 "none" != SFSI(".sfsi_plus_gpls_tool_bdr").css("display") && 0 != SFSI(".sfsi_plus_gpls_tool_bdr").css("opacity") ? SFSI(".pop_up_box ").on("click", function() {1783 SFSI(this).parent("div").find("div.sfsi_plus_tool_tip_2_inr").css("opacity", "0"), SFSI(this).parent("div").find("div.sfsi_plus_tool_tip_2_inr").hide();1784 }) :(SFSI(this).parent("div").find("div.sfsi_plus_tool_tip_2_inr").css("opacity", "0"), 1785 SFSI(this).parent("div").find("div.sfsi_plus_tool_tip_2_inr").hide());1786 }),1787 SFSI(".expand-area").on("click", function() {1788 object_name.Re_ad == SFSI(this).text() ? (SFSI(this).siblings("p").children("label").fadeIn("slow"), 1789 SFSI(this).text(object_name1.Coll_apse)) :(SFSI(this).siblings("p").children("label").fadeOut("slow"), 1790 SFSI(this).text(object_name.Re_ad));1791 }),1792 /*SFSI(".radio").live("click", function(){*/1793 SFSI(document).on("click", '.radio', function () {1794 var s = SFSI(this).parent().find("input:radio:first");1795 "sfsi_plus_icons_float" == s.attr("name") && "yes" == s.val() && (SFSI(".float_options").slideDown("slow"), 1796 SFSI('input[name="sfsi_plus_icons_stick"][value="no"]').attr("checked", !0), SFSI('input[name="sfsi_plus_icons_stick"][value="yes"]').removeAttr("checked"), 1797 SFSI('input[name="sfsi_plus_icons_stick"][value="no"]').parent().find("span").attr("style", "background-position:0px -41px;"), 1798 SFSI('input[name="sfsi_plus_icons_stick"][value="yes"]').parent().find("span").attr("style", "background-position:0px -0px;")), 1799 ("sfsi_plus_icons_stick" == s.attr("name") && "yes" == s.val() || "sfsi_plus_icons_float" == s.attr("name") && "no" == s.val()) && (SFSI(".float_options").slideUp("slow"), 1800 SFSI('input[name="sfsi_plus_icons_float"][value="no"]').prop("checked", !0), SFSI('input[name="sfsi_plus_icons_float"][value="yes"]').prop("checked", !1), 1801 SFSI('input[name="sfsi_plus_icons_float"][value="no"]').parent().find("span.radio").attr("style", "background-position:0px -41px;"), 1802 SFSI('input[name="sfsi_plus_icons_float"][value="yes"]').parent().find("span.radio").attr("style", "background-position:0px -0px;"));1803 }),1804 SFSI(".sfsi_plus_wDiv").length > 0 && setTimeout(function() {1805 var s = parseInt(SFSI(".sfsi_plus_wDiv").height()) + 0 + "px";1806 SFSI(".sfsi_plus_holders").each(function() {1807 SFSI(this).css("height", s);1808 });1809 }, 200),1810 /*SFSI(".checkbox").live("click", function() {*/1811 SFSI(document).on("click", '.checkbox', function () {1812 var s = SFSI(this).parent().find("input:checkbox:first");1813 ("sfsi_plus_shuffle_Firstload" == s.attr("name") && "checked" == s.attr("checked") || "sfsi_plus_shuffle_interval" == s.attr("name") && "checked" == s.attr("checked")) && (SFSI('input[name="sfsi_plus_shuffle_icons"]').parent().find("span").css("background-position", "0px -36px"), 1814 SFSI('input[name="sfsi_plus_shuffle_icons"]').attr("checked", "checked")), "sfsi_plus_shuffle_icons" == s.attr("name") && "checked" != s.attr("checked") && (SFSI('input[name="sfsi_plus_shuffle_Firstload"]').removeAttr("checked"), 1815 SFSI('input[name="sfsi_plus_shuffle_Firstload"]').parent().find("span").css("background-position", "0px 0px"), 1816 SFSI('input[name="sfsi_plus_shuffle_interval"]').removeAttr("checked"), SFSI('input[name="sfsi_plus_shuffle_interval"]').parent().find("span").css("background-position", "0px 0px"));1817 });1818 1819 SFSI("body").on("click", "#getMeFullAccess", function(){1820 var email = SFSI(this).parents("form").find("input[type='email']").val();1821 var feedid = SFSI(this).parents("form").find("input[name='feedid']").val();1822 var error = false;1823 var regEx = /^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;1824 1825 if(email === '')1826 {1827 error = true;1828 }1829 1830 if(!regEx.test(email))1831 {1832 error = true;1833 }1834 1835 if(!error)1836 {1837 SFSI(this).parents("form").submit();1838 }1839 else1840 {1841 alert("Error: Please provide your email address.");1842 }1843 });1844 1845 SFSI('form#calimingOptimizationForm').on('keypress', function(e) {1846 var keyCode = e.keyCode || e.which;1847 if (keyCode === 13) { 1848 e.preventDefault();1849 return false;1850 }1851 });1852 1853 /*SFSI(".checkbox").live("click", function()1854 {1855 var s = SFSI(this).parent().find("input:checkbox:first");1856 "sfsi_plus_float_on_page" == s.attr("name") && "yes" == s.val() && ( 1857 SFSI('input[name="sfsi_plus_icons_stick"][value="no"]').attr("checked", !0), SFSI('input[name="sfsi_plus_icons_stick"][value="yes"]').removeAttr("checked"), 1858 SFSI('input[name="sfsi_plus_icons_stick"][value="no"]').parent().find("span").attr("style", "background-position:0px -41px;"), 1859 SFSI('input[name="sfsi_plus_icons_stick"][value="yes"]').parent().find("span").attr("style", "background-position:0px -0px;"));1860 });1861 SFSI(".radio").live("click", function()1862 {1863 var s = SFSI(this).parent().find("input:radio:first");1864 var a = SFSI(".cstmfltonpgstck");1865 ("sfsi_plus_icons_stick" == s.attr("name") && "yes" == s.val()) && (1866 SFSI('input[name="sfsi_plus_float_on_page"][value="no"]').prop("checked", !0), SFSI('input[name="sfsi_plus_float_on_page"][value="yes"]').prop("checked", !1), 1867 SFSI('input[name="sfsi_plus_float_on_page"][value="no"]').parent().find("span.checkbox").attr("style", "background-position:0px -41px;"), 1868 SFSI('input[name="sfsi_plus_float_on_page"][value="yes"]').parent().find("span.checkbox").attr("style", "background-position:0px -0px;"),1869 jQuery(a).children(".checkbox").css("background-position", "0px 0px" ), sfsiplus_toggleflotpage(a));1870 });*/1871});1872//for utube channel name and id1873function showhideutube(ref)1874{1875 var chnlslctn = SFSI(ref).children("input").val();1876 if(chnlslctn == "name")1877 {1878 SFSI(ref).parent(".enough_waffling").next(".cstmutbtxtwpr").children(".cstmutbchnlnmewpr").slideDown();1879 SFSI(ref).parent(".enough_waffling").next(".cstmutbtxtwpr").children(".cstmutbchnlidwpr").slideUp();1880 }1881 else1882 {1883 SFSI(ref).parent(".enough_waffling").next(".cstmutbtxtwpr").children(".cstmutbchnlidwpr").slideDown();1884 SFSI(ref).parent(".enough_waffling").next(".cstmutbtxtwpr").children(".cstmutbchnlnmewpr").slideUp();1885 }1886}1887var sfsiplus_initTop = new Array();1888function sfsiplus_toggleflotpage(ref)1889{1890 var pos = jQuery(ref).children(".checkbox").css("background-position");1891 if(pos == "0px 0px")1892 {1893 jQuery(ref).next(".sfsiplus_right_info").children("p").children(".sfsiplus_sub-subtitle").hide();1894 jQuery(ref).next(".sfsiplus_right_info").children(".sfsiplus_tab_3_icns").hide();1895 }1896 else1897 {1898 jQuery(ref).next(".sfsiplus_right_info").children("p").children(".sfsiplus_sub-subtitle").show();1899 jQuery(ref).next(".sfsiplus_right_info").children(".sfsiplus_tab_3_icns").show();1900 }1901}1902function sfsiplus_togglbtmsection(show, hide, ref)1903{1904 jQuery(ref).parent("ul").children("li.clckbltglcls").each(function(index, element)1905 {1906 jQuery(this).children(".radio").css("background-position", "0px 0px");1907 jQuery(this).children(".styled").attr("checked", "false");1908 });1909 jQuery(ref).children(".radio").css("background-position", "0px -41px");1910 jQuery(ref).children(".styled").attr("checked", "true");1911 1912 jQuery("."+show).show();1913 jQuery("."+show).children(".radiodisplaysection").show();1914 jQuery("."+hide).hide();1915 jQuery("."+hide).children(".radiodisplaysection").hide();1916 /*jQuery(ref).parent("ul").children("li").each(function(index, element)1917 {1918 var pos = jQuery(this).children(".radio").css("background-position");1919 if(pos == "0px 0px")1920 {1921 jQuery(this).children(".radiodisplaysection").hide();1922 }1923 else1924 {1925 jQuery(this).children(".radiodisplaysection").show();1926 }1927 });1928 var pos = jQuery(ref).children(".radio").css("background-position");1929 if(pos != "0px 0px")1930 {1931 jQuery(ref).children(".radiodisplaysection").show();1932 }1933 else1934 {1935 jQuery(ref).children(".radiodisplaysection").hide();1936 }*/1937}1938function checkforinfoslction(ref)1939{1940 var pos = jQuery(ref).children(".checkbox").css("background-position");1941 if(pos == "0px 0px")1942 {1943 jQuery(ref).next(".sfsiplus_right_info").children("p").children("label").hide();1944 }1945 else1946 {1947 jQuery(ref).next(".sfsiplus_right_info").children("p").children("label").show();1948 }...
custom.js
Source:custom.js
...62 }), c >= 0 && e[c] < i);63 }64}65function sfsi_plus_float_widget(s) {66 function iplus()67 {68 rplus = "Microsoft Internet Explorer" === navigator.appName ? aplus - document.documentElement.scrollTop :aplus - window.pageYOffset, 69 Math.abs(rplus) > 0 ? (window.removeEventListener("scroll", iplus), aplus -= rplus * oplus, SFSI("#sfsi_plus_floater").css({70 top:(aplus + t).toString() + "px"71 }), setTimeout(iplus, n)) :window.addEventListener("scroll", iplus, !1);72 73 }74 /*function eplus()75 {76 var documentheight = SFSI("#sfsi_plus_floater").attr("data-top");77 var fltrhght = parseInt(SFSI("#sfsi_plus_floater").height());78 var fltrtp = parseInt(SFSI("#sfsi_plus_floater").css("top"));79 if(parseInt(fltrhght)+parseInt(fltrtp) <=documentheight)80 {81 window.addEventListener("scroll", iplus, !1);82 }83 else84 {85 window.removeEventListener("scroll", iplus);86 SFSI("#sfsi_plus_floater").css("top",documentheight+"px");87 }88 }*/...
rating.js
Source:rating.js
1if (!BXRS)2{3 var BXRS = {};4 var BXRSW = {};5} 6Rating = function(voteId, entityTypeId, entityId, available, userId, localize, template, pathToUserProfile, pathToAjax)7{ 8 this.enabled = true;9 this.voteId = voteId;10 this.entityTypeId = entityTypeId;11 this.entityId = entityId;12 this.available = available == 'Y'? true: false;13 this.userId = userId;14 this.localize = localize; 15 this.template = template;16 this.light = template == 'light'? true: false;17 this.pathToUserProfile = pathToUserProfile;18 this.pathToAjax = typeof(pathToAjax) == "string"? pathToAjax: '/bitrix/components/bitrix/rating.vote/vote.ajax.php';19 20 this.box = template == 'light'? BX('bx-rating-'+voteId): BX('rating-vote-'+voteId);21 if (this.box === null)22 {23 this.enabled = false;24 return false;25 }26 if (!this.light)27 {28 this.buttonPlus = BX('rating-vote-'+voteId+'-plus');29 this.buttonMinus = BX('rating-vote-'+voteId+'-minus');30 this.result = BX('rating-vote-'+voteId+'-result');31 }32 else33 {34 this.buttonPlus = BX.findChild(this.box, {className:'bx-rating-yes'}, true, false);35 this.buttonMinus = BX.findChild(this.box, {className:'bx-rating-no'}, true, false);36 this.buttonPlusCount = BX.findChild(this.buttonPlus, {className:'bx-rating-yes-count'}, true, false);37 this.buttonMinusCount = BX.findChild(this.buttonMinus, {className:'bx-rating-no-count'}, true, false);38 this.buttonPlusText = BX.findChild(this.buttonPlus, {className:'bx-rating-yes-text'}, true, false);39 this.buttonMinusText = BX.findChild(this.buttonMinus, {className:'bx-rating-no-text'}, true, false);40 41 this.popupPlus = null;42 this.popupMinus = null;43 this.popupTimeoutId = null;44 this.popupContentPlus = BX.findChild(BX('bx-rating-popup-cont-'+voteId+'-plus'), {tagName:'span', className:'bx-ilike-popup'}, true, false);45 this.popupContentMinus = BX.findChild(BX('bx-rating-popup-cont-'+voteId+'-minus'), {tagName:'span', className:'bx-ilike-popup'}, true, false);46 this.popupContentPagePlus = 1; 47 this.popupContentPageMinus = 1; 48 this.popupListProcess = false; 49 this.popupTimeout = false; 50 }51 52 this.voteProcess = false;53}54Rating.Set = function(voteId, entityTypeId, entityId, available, userId, localize, template, pathToUserProfile, pathToAjax)55{56 if (template === undefined)57 template = 'standart';58 if (!BXRS[voteId] || BXRS[voteId].tryToSet <= 5)59 {60 var tryToSend = BXRS[voteId] && BXRS[voteId].tryToSet? BXRS[voteId].tryToSet: 1;61 BXRS[voteId] = new Rating(voteId, entityTypeId, entityId, available, userId, localize, template, pathToUserProfile, pathToAjax);62 if (BXRS[voteId].enabled)63 {64 Rating.Init(voteId);65 }66 else67 {68 setTimeout(function(){69 BXRS[voteId].tryToSet = tryToSend+1;70 Rating.Set(voteId, entityTypeId, entityId, available, userId, localize, template, pathToUserProfile, pathToAjax);71 }, 500);72 }73 }74};75Rating.Init = function(voteId)76{77 if (BXRS[voteId].available)78 {79 BX.bind(BXRS[voteId].light? BXRS[voteId].buttonPlusText: BXRS[voteId].buttonPlus, 'click' , function() {80 if (BXRS[voteId].voteProcess)81 return false;82 83 BXRS[voteId].voteProcess = true; 84 BX.addClass(BXRS[voteId].buttonPlus, BXRS[voteId].light? 'bx-rating-load': 'rating-vote-load');85 if (BX.hasClass(BXRS[voteId].buttonPlus, BXRS[voteId].light? 'bx-rating-yes-active': 'rating-vote-plus-active'))86 Rating.Vote(voteId, 'plus', 'cancel');87 else88 Rating.Vote(voteId, 'plus', 'plus');89 return false;90 });91 92 BX.bind(BXRS[voteId].buttonPlus, 'mouseover', function() {BX.addClass(this, BXRS[voteId].light? 'bx-rating-hover': 'rating-vote-hover')});93 BX.bind(BXRS[voteId].buttonPlus, 'mouseout', function() {BX.removeClass(this, BXRS[voteId].light? 'bx-rating-hover': 'rating-vote-hover')});94 95 if (false && BXRS[voteId].light)96 {97 Rating.PopupScroll(voteId, 'plus');98 99 BX.bind(BXRS[voteId].buttonPlus, 'mouseover' , function() {100 clearTimeout(BXRS[voteId].popupTimeoutId);101 BXRS[voteId].popupTimeoutId = setTimeout(function(){102 if (BXRSW['plus'] == voteId)103 return false;104 if (BXRS[voteId].popupContentPagePlus == 1)105 Rating.List(voteId, 1, 'plus');106 BXRS[voteId].popupTimeoutId = setTimeout(function() {107 Rating.OpenWindow(voteId, 'plus');108 }, 1000);109 }, 400);110 });111 BX.bind(BXRS[voteId].buttonPlus, 'mouseout' , function() {112 clearTimeout(BXRS[voteId].popupTimeoutId);113 BXRS[voteId].popupTimeout = setTimeout(function(){114 if (BXRS[voteId].popupPlus !== null)115 {116 BXRS[voteId].popupPlus.close();117 BXRSW['plus'] = null;118 }119 }, 1000);120 });121 BX.bind(BXRS[voteId].buttonPlusCount, 'click' , function() {122 clearTimeout(BXRS[voteId].popupTimeoutId); 123 if (BXRS[voteId].popupContentPagePlus == 1)124 Rating.List(voteId, 1, 'plus');125 Rating.OpenWindow(voteId, 'plus');126 });127 BX.bind(BXRS[voteId].buttonPlusCount, 'mouseover' , function() {128 clearTimeout(BXRS[voteId].popupTimeout);129 });130 BX.bind(BXRS[voteId].buttonPlusText, 'mouseover' , function() {131 clearTimeout(BXRS[voteId].popupTimeout);132 });133 }134 135 BX.bind(BXRS[voteId].light? BXRS[voteId].buttonMinusText: BXRS[voteId].buttonMinus, 'click' , function() {136 if (BXRS[voteId].voteProcess)137 return false;138 139 BXRS[voteId].voteProcess = true;140 BX.addClass(BXRS[voteId].buttonMinus, BXRS[voteId].light? 'bx-rating-load': 'rating-vote-load');141 if (BX.hasClass(BXRS[voteId].buttonMinus, BXRS[voteId].light? 'bx-rating-no-active': 'rating-vote-minus-active'))142 {143 Rating.Vote(voteId, 'minus', 'cancel');144 }145 else146 {147 Rating.Vote(voteId, 'minus', 'minus');148 }149 return false;150 });151 152 BX.bind(BXRS[voteId].buttonMinus, 'mouseover', function() {BX.addClass(this, BXRS[voteId].light? 'bx-rating-hover': 'rating-vote-hover')});153 BX.bind(BXRS[voteId].buttonMinus, 'mouseout', function() {BX.removeClass(this, BXRS[voteId].light? 'bx-rating-hover': 'rating-vote-hover')});154 155 if (false && BXRS[voteId].light)156 {157 Rating.PopupScroll(voteId, 'minus');158 159 BX.bind(BXRS[voteId].buttonMinus, 'mouseover' , function() {160 clearTimeout(BXRS[voteId].popupTimeoutId);161 BXRS[voteId].popupTimeoutId = setTimeout(function(){162 if (BXRSW['minus'] == voteId)163 return false;164 if (BXRS[voteId].popupContentPageMinus == 1)165 Rating.List(voteId, 1, 'minus');166 BXRS[voteId].popupTimeoutId = setTimeout(function() {167 Rating.OpenWindow(voteId, 'minus');168 }, 1000);169 }, 400);170 });171 BX.bind(BXRS[voteId].buttonMinus, 'mouseout' , function() {172 clearTimeout(BXRS[voteId].popupTimeoutId);173 BXRS[voteId].popupTimeout = setTimeout(function(){174 if (BXRS[voteId].popupMinus !== null)175 {176 BXRS[voteId].popupMinus.close();177 BXRSW['minus'] = null;178 }179 }, 1000);180 });181 BX.bind(BXRS[voteId].buttonMinusCount, 'click' , function() {182 clearTimeout(BXRS[voteId].popupTimeoutId); 183 if (BXRS[voteId].popupContentPageMinus == 1)184 Rating.List(voteId, 1, 'minus');185 Rating.OpenWindow(voteId, 'minus');186 });187 BX.bind(BXRS[voteId].buttonMinusCount, 'mouseover' , function() {188 clearTimeout(BXRS[voteId].popupTimeout);189 });190 BX.bind(BXRS[voteId].buttonMinusText, 'mouseover' , function() {191 clearTimeout(BXRS[voteId].popupTimeout);192 });193 }194 }195}196Rating.UpdateStatus = function(voteId, button, action)197{198 BXRS[voteId].buttonPlus.title = (action == 'cancel' || button == 'minus' ? BXRS[voteId].localize['PLUS']: BXRS[voteId].localize['CANCEL']); 199 BXRS[voteId].buttonMinus.title = (action == 'cancel' || button == 'plus' ? BXRS[voteId].localize['MINUS']: BXRS[voteId].localize['CANCEL']); 200 BX.removeClass(BXRS[voteId].buttonPlus, BXRS[voteId].light? (button == 'plus'? 'bx-rating-load': 'bx-rating-yes-active'): (button == 'plus'? 'rating-vote-load': 'rating-vote-plus-active'));201 BX.removeClass(BXRS[voteId].buttonMinus, BXRS[voteId].light? (button == 'plus'? 'bx-rating-no-active': 'bx-rating-load'): (button == 'plus'? 'rating-vote-minus-active': 'rating-vote-load')); 202 if (action == 'cancel')203 BX.removeClass(button == 'plus'? BXRS[voteId].buttonPlus: BXRS[voteId].buttonMinus, BXRS[voteId].light? 'bx-rating-'+(button == 'plus'? 'yes': 'no')+'-active': 'rating-vote-'+button+'-active');204 else205 BX.addClass(button == 'plus'? BXRS[voteId].buttonPlus: BXRS[voteId].buttonMinus, BXRS[voteId].light? 'bx-rating-'+(button == 'plus'? 'yes': 'no')+'-active': 'rating-vote-'+button+'-active');206}207Rating.Vote = function(voteId, button, action)208{209 BX.ajax({210 url: BXRS[voteId].pathToAjax,211 method: 'POST',212 dataType: 'json',213 data: {'RATING_VOTE' : 'Y', 'RATING_RESULT' : 'Y', 'RATING_VOTE_TYPE_ID' : BXRS[voteId].entityTypeId, 'RATING_VOTE_ENTITY_ID' : BXRS[voteId].entityId, 'RATING_VOTE_ACTION' : action, 'sessid': BX.bitrix_sessid()},214 onsuccess: function(data)215 {216 if (BXRS[voteId].light)217 {218 BXRS[voteId].buttonPlusCount.innerHTML = data['resultPositiveVotes'];219 BXRS[voteId].buttonMinusCount.innerHTML = data['resultNegativeVotes']; 220 if (data['action'] == 'cancel')221 BX.removeClass(BXRS[voteId].box, 'bx-rating-active');222 else223 BX.addClass(BXRS[voteId].box, 'bx-rating-active');224 }225 else226 {227 BXRS[voteId].result.title = data['resultTitle'];228 BXRS[voteId].result.innerHTML = data['resultValue'];229 BX.removeClass(BXRS[voteId].result, data['resultStatus'] == 'minus' ? 'rating-vote-result-plus' : 'rating-vote-result-minus');230 BX.addClass(BXRS[voteId].result, data['resultStatus'] == 'minus' ? 'rating-vote-result-minus' : 'rating-vote-result-plus');231 }232 233 Rating.UpdateStatus(voteId, button, action);234 BXRS[voteId].voteProcess = false;235 },236 onfailure: function(data)237 {238 BX.removeClass(button == 'minus' ? BXRS[voteId].buttonMinus : BXRS[voteId].buttonPlus, BXRS[voteId].light? 'bx-rating-load': 'rating-vote-load');239 }240 });241 return false;242}243Rating.OpenWindow = function(voteId, action)244{245 if (parseInt(action == 'plus'? BXRS[voteId].buttonPlusCount.innerHTML: BXRS[voteId].buttonMinusCount.innerHTML) == 0)246 return false;247 248 if ((action == 'plus'? BXRS[voteId].popupPlus: BXRS[voteId].popupMinus) == null) 249 {250 __popup = new BX.PopupWindow('rating-popup-'+voteId+'-'+action, action == 'plus'? BXRS[voteId].buttonPlusCount: BXRS[voteId].buttonMinusCount, { content:BX('bx-rating-popup-cont-'+voteId+(action == 'plus'? '-plus': '-minus')), lightShadow:true, autoHide:true, zIndex: 2500 }); 251 if (action == 'plus')252 BXRS[voteId].popupPlus = __popup;253 else254 BXRS[voteId].popupMinus = __popup;255 256 BX.bind(BX('rating-popup-'+voteId+'-'+action), 'mouseout' , function() {257 clearTimeout(BXRS[voteId].popupTimeout);258 BXRS[voteId].popupTimeout = setTimeout(function(){259 if (action == 'plus')260 BXRS[voteId].popupPlus.close();261 else262 BXRS[voteId].popupMinus.close();263 BXRSW[action] = null;264 }, 1000); 265 });266 267 BX.bind(BX('rating-popup-'+voteId+'-'+action), 'mouseover' , function() {268 clearTimeout(BXRS[voteId].popupTimeout);269 });270 }271 else if(BX('rating-popup-'+voteId+'-'+action).style.display == "block")272 {273 if (action == 'plus')274 BXRS[voteId].popupPlus.close();275 else276 BXRS[voteId].popupMinus.close();277 BXRSW[action] = null;278 return false279 }280 281 if (BXRSW['plus'] != null)282 {283 BXRS[BXRSW['plus']].popupPlus.close();284 BXRSW['plus'] = null;285 }286 if (BXRSW['minus'] != null)287 {288 BXRS[BXRSW['minus']].popupMinus.close();289 BXRSW['minus'] = null;290 }291 292 if (action == 'plus')293 BXRS[voteId].popupPlus.show();294 else295 BXRS[voteId].popupMinus.show();296 297 BXRSW = voteId;298 299 if (action == 'plus')300 BXRS[voteId].popupPlus.setAngle({ position:'bottom' });301 else302 BXRS[voteId].popupMinus.setAngle({ position:'bottom' });303 304 Rating.AdjustWindow(voteId, action);305}306Rating.List = function(voteId, page, action)307{308 if (parseInt(action == 'plus'? BXRS[voteId].buttonPlusCount.innerHTML: BXRS[voteId].buttonMinusCount.innerHTML) == 0)309 return false;310 311 if (page == null)312 page = action == 'plus'? BXRS[voteId].popupContentPagePlus: BXRS[voteId].popupContentPageMinus;313 314 BXRS[voteId].popupListProcess = true;315 BX.ajax({316 url: BXRS[voteId].pathToAjax,317 method: 'POST',318 dataType: 'json',319 data: {'RATING_VOTE_LIST' : 'Y', 'RATING_VOTE_LIST_TYPE' : action, 'RATING_VOTE_TYPE_ID' : BXRS[voteId].entityTypeId, 'RATING_VOTE_ENTITY_ID' : BXRS[voteId].entityId, 'RATING_VOTE_LIST_PAGE' : page, 'PATH_TO_USER_PROFILE' : BXRS[voteId].pathToUserProfile, 'sessid': BX.bitrix_sessid()},320 onsuccess: function(data)321 {322 //BXRS[voteId].buttonPlusCount.innerHTML = data.items_all; 323 324 if ( parseInt(data.items_page) == 0 )325 return false;326 327 if (page == 1)328 {329 spanTag0 = document.createElement("span"); 330 spanTag0.className = "bx-ilike-bottom_scroll";331 if (action == 'plus')332 {333 BXRS[voteId].popupContentPlus.innerHTML = '';334 BXRS[voteId].popupContentPlus.appendChild(spanTag0);335 }336 else337 {338 BXRS[voteId].popupContentMinus.innerHTML = '';339 BXRS[voteId].popupContentMinus.appendChild(spanTag0);340 }341 }342 if (action == 'plus')343 BXRS[voteId].popupContentPagePlus += 1;344 else345 BXRS[voteId].popupContentPageMinus += 1;346 for (var i in data.items) { 347 aTag = document.createElement("a"); 348 aTag.className = "bx-ilike-popup-img";349 aTag.href = data.items[i]['URL'];350 aTag.target = "_blank";351 352 spanTag1 = document.createElement("span"); 353 spanTag1.className = "bx-ilike-popup-avatar";354 spanTag1.innerHTML = data.items[i]['PHOTO'];355 aTag.appendChild(spanTag1);356 357 spanTag2 = document.createElement("span"); 358 spanTag2.className = "bx-ilike-popup-name";359 spanTag2.appendChild(document.createTextNode(BX.util.htmlspecialcharsback(data.items[i]['FULL_NAME'])));360 aTag.appendChild(spanTag2);361 if (action == 'plus') 362 BXRS[voteId].popupContentPlus.appendChild(aTag); 363 else364 BXRS[voteId].popupContentMinus.appendChild(aTag); 365 }366 Rating.AdjustWindow(voteId, action);367 Rating.PopupScroll(voteId, action);368 369 BXRS[voteId].popupListProcess = false;370 }, 371 onfailure: function(data) {} 372 });373 return false;374}375Rating.AdjustWindow = function(voteId, action)376{377 children = BX.findChild(action == 'plus'? BXRS[voteId].popupContentPlus: BXRS[voteId].popupContentMinus, {className:'bx-ilike-popup-img'}, true, true);378 if (children !== null)379 {380 iOffsetHeight = BX.browser.IsIE()? 5: 0;381 for (var i in children) { 382 iOffsetHeight += children[i].offsetHeight;383 }384 }385 else 386 iOffsetHeight = BX.browser.IsIE()? 35: 30;387 if (iOffsetHeight < 121)388 if (action == 'plus') 389 BXRS[voteId].popupContentPlus.style.height = iOffsetHeight+'px';390 else391 BXRS[voteId].popupContentMinus.style.height = iOffsetHeight+'px';392 else393 if (action == 'plus') 394 BXRS[voteId].popupContentPlus.style.height = '121px';395 else396 BXRS[voteId].popupContentMinus.style.height = '121px';397 var offsetTop = 5;398 399 arScroll = BX.GetWindowScrollPos();400 if (action == 'plus')401 iLeft = BXRS[voteId].popupPlus.bindElementPos.left-10;402 else403 iLeft = BXRS[voteId].popupMinus.bindElementPos.left-10;404 405 iLeftAngle = 0;406 if (action == 'plus')407 iWindow = iLeft+BXRS[voteId].popupPlus.popupContainer.offsetWidth;408 else409 iWindow = iLeft+BXRS[voteId].popupMinus.popupContainer.offsetWidth;410 411 iBody = document.body.clientWidth + arScroll.scrollLeft;412 413 if (iWindow>iBody)414 {415 iLeft = iLeft-(iWindow-iBody);416 if (action == 'plus')417 BXRS[voteId].popupPlus.setAngle({ offset : (iWindow-iBody)+iLeftAngle });418 else419 BXRS[voteId].popupMinus.setAngle({ offset : (iWindow-iBody)+iLeftAngle });420 } 421 else if (iLeft<0)422 {423 if (action == 'plus')424 BXRS[voteId].popupPlus.setAngle({ offset : (iLeft)+iLeftAngle });425 else426 BXRS[voteId].popupMinus.setAngle({ offset : (iLeft)+iLeftAngle });427 iLeft = 0;428 }429 if (action == 'plus')430 BX.adjust(BX('rating-popup-'+voteId+'-'+action), {style: { top: BXRS[voteId].popupPlus.bindElementPos.top-(BXRS[voteId].popupPlus.popupContainer.offsetHeight+offsetTop) + "px", left: iLeft+"px" }});431 else432 BX.adjust(BX('rating-popup-'+voteId+'-'+action), {style: { top: BXRS[voteId].popupMinus.bindElementPos.top-(BXRS[voteId].popupMinus.popupContainer.offsetHeight+offsetTop) + "px", left: iLeft+"px" }});433}434Rating.PopupScroll = function(voteId, action)435{436 BX.bind(action == 'plus'? BXRS[voteId].popupContentPlus: BXRS[voteId].popupContentMinus, 'scroll' , function() {437 if (this.scrollTop > (this.scrollHeight - this.offsetHeight) / 1.5)438 {439 Rating.List(voteId, null, action);440 BX.unbindAll(this);441 }442 });...
common.js
Source:common.js
1// ë³ì ì¤ì 23// ê°ì¥ ìµìë¨ ë°ì¤4const $nm_int_right = $("#NM_INT_RIGHT");56// locations7const $sc_my = $nm_int_right.find(".sc_my");8const $content = $nm_int_right.find("#contents");910// ëì ì¼ë¡ html ìì±í(ajax ìì²í) ì¤ì í´ì¤ ë³ìë¤11// tabs (ì림, MY구ë
, ë©ì¼, ì¹´í, ë¸ë¡ê·¸ ...)12const $loginTabs = $sc_my.find("#NM_MY_TAB .tab");13const $loginTabContents = $sc_my.find(".sc_service .service_wrap");14const $shoppingTabs = $nm_int_right.find("#tab_title .tab");15const $shoppingTabContent = $nm_int_right.find("#contents");1617// ë´ê° ì¬ì©í swiper ê°ì²´ë¤18// loing swiper19let loginSwiper = null;20// timesquare swiper (ì´ì, live, ì¦ì, íì¨)21let timesquareSwiper = null;22// shopping swiper (í¸ë ëì¼í ìí)23let shoppingSwiper = null;24// event swiper (ë°ê°ë¤! ì¼íë´ì¤)25let eventSwiper = null;26// plus swipers (ë¼ì´í, í¨ì
, ë·°í°, ëì§í¸ï½¥ë ì )27let plusLifeSwiper = null;28let plusFashionSwiper = null;29let plusBeautyeSwiper = null;30let plusDigitalSwiper = null;3132// loginSwiper ìì±33loginSwiper = new Swiper(".sc_my .loginSwiper", {34 observer: true,35 observeParents: true,36 parallax: true,37 navigation: {38 nextEl: "#NM_MY_TAB_next",39 prevEl: "#NM_MY_TAB_prev",40 },41 watchOverflow: true, // ì¬ë¼ì´ëê° 1ê° ì¼ ë pager, button ì¨ê¹ ì¬ë¶ ì¤ì 42 on: {43 slideChangeTransitionStart: function (swiper) {44 login.initTab($loginTabs, $loginTabContents);45 },46 },47});4849// loginTab click ì´ë²¤í¸ ë¬ê¸°50login.handleClick($loginTabs);5152// timesquareSwiper ìì±53timesquareSwiper = new Swiper("#NM_TS_ROLLING_WRAP .timesquareSwiper", {54 observer: true,55 observeParents: true,56 parallax: true,57 loop: true,58 autoplay: {59 delay: 3000,60 disableOnInteraction: false, // falseë¡ ì¤ì íë©´ ì¤ìì´í í ìë ì¬ìì´ ë¹íì±í ëì§ ìì61 },62 navigation: {63 nextEl: "#timesquare .card_nav .btn_next",64 prevEl: "#timesquare .card_nav .btn_prev",65 },66});6768// shoppingSwiper ìì±69shoppingSwiper = new Swiper("#shopcast .productSwiper", {70 observer: true,71 observeParents: true,72 parallax: true,73 loop: true,74 spaceBetween: 15,75 navigation: {76 nextEl: "#contents_productAd .btn_next",77 prevEl: "#contents_productAd .btn_prev",78 },79 pagination: {80 el: "#contents_productAd .swiper-pagination",81 renderFraction: function (currentClass, totalClass) {82 return `83 <em class="current">84 <span class="blind">íì¬</span><span class="${currentClass}"></span>85 </em>86 <span class="blind">ì ì²´</span>/ <span class="${totalClass}"></span>87 `;88 },89 type: "fraction",90 },91});9293// eventSwiper ìì±94eventSwiper = new Swiper("#contents_productAdBanner .eventSwiper", {95 observer: true,96 observeParents: true,97 parallax: true,98 loop: true,99 navigation: {100 nextEl: "#contents_productAdBanner .btn_next",101 prevEl: "#contents_productAdBanner .btn_prev",102 },103 pagination: {104 el: "#contents_productAdBanner .swiper-pagination",105 renderFraction: function (currentClass, totalClass) {106 return `107 <em class="current">108 <span class="blind">íì¬</span><span class="${currentClass}"></span>109 </em>110 <span class="blind">ì ì²´</span>/ <span class="${totalClass}"></span>111 `;112 },113 type: "fraction",114 },115});116117// plusLifeSwiper ìì±118plusLifeSwiper = new Swiper("#contents_productAdPlus .plusLifeSwiper", {119 observer: true,120 observeParents: true,121 parallax: true,122 loop: true,123 spaceBetween: 10,124 navigation: {125 nextEl: "#contents_productAdPlus .shop_life .btn_next",126 prevEl: "#contents_productAdPlus .shop_life .btn_prev",127 },128 pagination: {129 el: "#contents_productAdPlus .shop_life .swiper-pagination",130 renderFraction: function (currentClass, totalClass) {131 return `132 <em class="current">133 <span class="blind">íì¬</span><span class="${currentClass}"></span>134 </em>135 <span class="blind">ì ì²´</span>/ <span class="${totalClass}"></span>136 `;137 },138 type: "fraction",139 },140 on: {141 slideChange: function (swiper) {142 const index = swiper.activeIndex;143 const total = swiper.slides.length - 2;144145 const $tabs = $("#contents_productAdPlus").find(".category");146 const $tabContent = $("#contents_productAdPlus").find(".shop_contents");147148 let prevSwiperIndex = null;149 let nextFashionSwiper = 1;150 if (plusDigitalSwiper) {151 prevSwiperIndex =152 plusDigitalSwiper.slides.length == 1153 ? 1154 : plusDigitalSwiper.slides.length - 2;155 }156 if (index == 0) {157 // ì´ì í(ëì§í¸ï½¥ë ì )ì¼ë¡ ì´ë158 shopping.changeSwiper(plusDigitalSwiper, $tabs, $tabContent, {159 tabIndex: 3,160 contentIndex: 3,161 swiperIndex: prevSwiperIndex,162 });163 } else if (index > total) {164 // ì´í í(í¨ì
)ì¼ë¡ ì´ë165 shopping.changeSwiper(plusFashionSwiper, $tabs, $tabContent, {166 tabIndex: 1,167 contentIndex: 1,168 swiperIndex: nextFashionSwiper,169 });170 }171 },172 },173});174175// plusFashionSwiper ìì±176plusFashionSwiper = new Swiper("#contents_productAdPlus .plusFashionSwiper", {177 observer: true,178 observeParents: true,179 parallax: true,180 loop: true,181 spaceBetween: 10,182 navigation: {183 nextEl: "#contents_productAdPlus .shop_fashion .btn_next",184 prevEl: "#contents_productAdPlus .shop_fashion .btn_prev",185 },186 pagination: {187 el: "#contents_productAdPlus .shop_fashion .swiper-pagination",188 renderFraction: function (currentClass, totalClass) {189 return `190 <em class="current">191 <span class="blind">íì¬</span><span class="${currentClass}"></span>192 </em>193 <span class="blind">ì ì²´</span>/ <span class="${totalClass}"></span>194 `;195 },196 type: "fraction",197 },198 on: {199 slideChange: function (swiper) {200 const index = swiper.activeIndex;201 const total = swiper.slides.length - 2;202203 const $tabs = $("#contents_productAdPlus").find(".category");204 const $tabContent = $("#contents_productAdPlus").find(".shop_contents");205206 let prevSwiperIndex = null;207 let nextFashionSwiper = 1;208 if (plusLifeSwiper) {209 prevSwiperIndex =210 plusLifeSwiper.slides.length == 1211 ? 1212 : plusLifeSwiper.slides.length - 2;213 }214 if (index == 0) {215 // ì´ì í(ë¼ì´í))ì¼ë¡ ì´ë216 shopping.changeSwiper(plusLifeSwiper, $tabs, $tabContent, {217 tabIndex: 0,218 contentIndex: 0,219 swiperIndex: prevSwiperIndex,220 });221 } else if (index > total) {222 // ì´í í(ë·°í°)ì¼ë¡ ì´ë223 shopping.changeSwiper(plusBeautyeSwiper, $tabs, $tabContent, {224 tabIndex: 2,225 contentIndex: 2,226 swiperIndex: nextFashionSwiper,227 });228 }229 },230 },231});232233// plusBeautyeSwiper ìì±234plusBeautyeSwiper = new Swiper("#contents_productAdPlus .plusBeautyeSwiper", {235 observer: true,236 observeParents: true,237 parallax: true,238 loop: true,239 spaceBetween: 10,240 navigation: {241 nextEl: "#contents_productAdPlus .shop_beauty .btn_next",242 prevEl: "#contents_productAdPlus .shop_beauty .btn_prev",243 },244 pagination: {245 el: "#contents_productAdPlus .shop_beauty .swiper-pagination",246 renderFraction: function (currentClass, totalClass) {247 return `248 <em class="current">249 <span class="blind">íì¬</span><span class="${currentClass}"></span>250 </em>251 <span class="blind">ì ì²´</span>/ <span class="${totalClass}"></span>252 `;253 },254 type: "fraction",255 },256 on: {257 slideChange: function (swiper) {258 const index = swiper.activeIndex;259 const total = swiper.slides.length - 2;260261 const $tabs = $("#contents_productAdPlus").find(".category");262 const $tabContent = $("#contents_productAdPlus").find(".shop_contents");263264 let prevSwiperIndex = null;265 let nextFashionSwiper = 1;266 if (plusFashionSwiper) {267 prevSwiperIndex =268 plusFashionSwiper.slides.length == 1269 ? 1270 : plusFashionSwiper.slides.length - 2;271 }272 if (index == 0) {273 // ì´ì í(í¨ì
)ì¼ë¡ ì´ë274 shopping.changeSwiper(plusFashionSwiper, $tabs, $tabContent, {275 tabIndex: 1,276 contentIndex: 1,277 swiperIndex: prevSwiperIndex,278 });279 } else if (index > total) {280 // ì´í í(ëì§í¸ï½¥ë ì )ì¼ë¡ ì´ë281 shopping.changeSwiper(plusDigitalSwiper, $tabs, $tabContent, {282 tabIndex: 3,283 contentIndex: 3,284 swiperIndex: nextFashionSwiper,285 });286 }287 },288 },289});290291// plusDigitalSwiper ìì±292plusDigitalSwiper = new Swiper("#contents_productAdPlus .plusDigitalSwiper", {293 observer: true,294 observeParents: true,295 parallax: true,296 // loop: true,297 spaceBetween: 10,298 navigation: {299 disabledClass: "none",300 nextEl: "#contents_productAdPlus .shop_digital .btn_next",301 prevEl: "#contents_productAdPlus .shop_digital .btn_prev",302 },303 pagination: {304 el: "#contents_productAdPlus .shop_digital .swiper-pagination",305 renderFraction: function (currentClass, totalClass) {306 return `307 <em class="current">308 <span class="blind">íì¬</span><span class="${currentClass}"></span>309 </em>310 <span class="blind">ì ì²´</span>/ <span class="${totalClass}"></span>311 `;312 },313 type: "fraction",314 },315 // ì¬ì§ì´ 1ì¤ë§ ëì¤ê¸° ë문ì 기존 ë¡ì§ì¼ë¡ íë³ ë¶ê°316 // on: {317 // slideChange: function (swiper) {318 // const real = swiper.realIndex;319 // const index = swiper.activeIndex;320 // const total = swiper.slides.length - 2;321 // if (index == 0) {322 // // $(".category_fashion").click();323 // } else if (index > total) {324 // // $(".category_digital").click();325 // }326 // console.log(real,index, total)327 // },328 // },329});330// ì¬ì§ì´ 1ì¤ë§ ëì¬ ë ìì¸ ì²ë¦¬331// ê°ë¨í ì´ê³³ìì ë°ë¡ ì´ë²¤í¸ ì°ê²°332$(".shop_digital .btn").on("click", function () {333 const $tabs = $("#contents_productAdPlus").find(".category");334 const $tabContent = $("#contents_productAdPlus").find(".shop_contents");335336 let prevSwiperIndex = null;337 let nextFashionSwiper = 1;338 if (plusBeautyeSwiper) {339 prevSwiperIndex =340 plusBeautyeSwiper.slides.length == 1341 ? 1342 : plusBeautyeSwiper.slides.length - 2;343 }344345 const isPrev = $(this).hasClass("btn_prev");346347 if (isPrev) {348 // ì´ì í(ë·°í°)ì¼ë¡ ì´ë349 shopping.changeSwiper(plusBeautyeSwiper, $tabs, $tabContent, {350 tabIndex: 2,351 contentIndex: 2,352 swiperIndex: prevSwiperIndex,353 });354 } else {355 // ì´í í(ë¼ì´í)ì¼ë¡ ì´ë356 shopping.changeSwiper(plusLifeSwiper, $tabs, $tabContent, {357 tabIndex: 0,358 contentIndex: 0,359 swiperIndex: nextFashionSwiper,360 });361 }362});363364// event ë¼ì´í, í¨ì
, ë·°í°, ëì§í¸ï½¥ë ì init365shopping.init($content.find("#contents_productAdPlus .shop_contents"));366367// event ë¼ì´í, í¨ì
, ë·°í°, ëì§í¸ï½¥ë ì tab control368(() => {369 const $tabs = $content.find("#contents_productAdPlus .category");370 const $tabContent = $content.find("#contents_productAdPlus .shop_contents");371 shopping.handleTabClick($tabs, $tabContent, {372 plusLifeSwiper,373 plusFashionSwiper,374 plusBeautyeSwiper,375 plusDigitalSwiper,376 });377})();378379// shopping init ì´ë²¤í¸ ë¬ê¸°380shopping.init($content);381382// shopping click ì´ë²¤í¸ ë¬ê¸°383shopping.handleTabClick($shoppingTabs, $shoppingTabContent, {384 shoppingSwiper,385 eventSwiper,386 plusLifeSwiper,387 plusFashionSwiper,388 plusBeautyeSwiper,389 plusDigitalSwiper,
...
PlusCodes.js
Source:PlusCodes.js
1const { BN, expectRevert } = require('@openzeppelin/test-helpers');2const { expect } = require('chai');3const PlusCodes = artifacts.require('PlusCodesMock');4contract('PlusCodes', function (accounts) {5 beforeEach(async function () {6 this.plusCodes = await PlusCodes.new();7 });8 describe('getParent', async function () {9 async function checkExpectedParent (plusCodes, childCodeASCII, parentCodeASCII) {10 const childCode = new BN(Buffer.from(childCodeASCII).toString('hex'), 16);11 const parentCode = new BN(Buffer.from(parentCodeASCII).toString('hex'), 16);12 expect(await plusCodes.getParent(childCode)).to.bignumber.equal(parentCode);13 }14 it('gets parent of a code length 4 Plus Code', async function () {15 await checkExpectedParent(this.plusCodes, '22220000+', '22000000+');16 });17 it('gets parent of a code length 6 Plus Code', async function () {18 await checkExpectedParent(this.plusCodes, '22222200+', '22220000+');19 });20 it('gets parent of a code length 8 Plus Code', async function () {21 await checkExpectedParent(this.plusCodes, '22222222+', '22222200+');22 });23 it('gets parent of a code length 10 Plus Code', async function () {24 await checkExpectedParent(this.plusCodes, '22222222+22', '22222222+');25 });26 it('gets parent of a code length 11 Plus Code', async function () {27 await checkExpectedParent(this.plusCodes, '22222222+222', '22222222+22');28 });29 it('gets parent of a code length 12 Plus Code', async function () {30 await checkExpectedParent(this.plusCodes, '22222222+2222', '22222222+222');31 });32 it('reverts when trying to get parent of code length 2 Plus Code', async function () {33 const childCodeASCII = '22000000+';34 const childCode = new BN(Buffer.from(childCodeASCII).toString('hex'), 16);35 await expectRevert(this.plusCodes.getParent(childCode), 'Code length 2 Plus Codes do not have parents');36 });37 it('reverts when trying to get parent of invalid Plus Code', async function () {38 const childCodeASCII = '2222BEER+';39 const childCode = new BN(Buffer.from(childCodeASCII).toString('hex'), 16);40 await expectRevert(this.plusCodes.getParent(childCode), 'Not a valid Plus Codes digit');41 });42 });43 describe('getChildTemplate/getNthChildFromTemplate', async function () {44 async function checkValidChild (plusCodes, parentCodeASCII) {45 const parentCode = new BN(Buffer.from(parentCodeASCII).toString('hex'), 16);46 const childTemplate = await plusCodes.getChildTemplate(parentCode);47 const [, childCount] = childTemplate;48 const childIndex = Math.floor(Math.random() * childCount);49 const childCode = await plusCodes.getNthChildFromTemplate(childIndex, childTemplate);50 const roundTripParent = await plusCodes.getParent(childCode);51 expect(roundTripParent).to.bignumber.equal(parentCode);52 }53 it('gets a valid child of a code length 2 Plus Code', async function () {54 await checkValidChild(this.plusCodes, '24000000+');55 });56 it('gets a valid child of a code length 4 Plus Code', async function () {57 await checkValidChild(this.plusCodes, '24550000+');58 });59 it('gets a valid child of a code length 6 Plus Code', async function () {60 await checkValidChild(this.plusCodes, '2455CC00+');61 });62 it('gets a valid child of a code length 8 Plus Code', async function () {63 await checkValidChild(this.plusCodes, '2455CCXX+');64 });65 it('gets a valid child of a code length 10 Plus Code', async function () {66 await checkValidChild(this.plusCodes, '2455CCXX+22');67 });68 it('gets a valid child of a code length 11 Plus Code', async function () {69 await checkValidChild(this.plusCodes, '2455CCXX+223');70 });71 it('reverts when trying to get a child of code length 12 Plus Code', async function () {72 const parentCodeASCII = '22223333+2233';73 const parentCode = new BN(Buffer.from(parentCodeASCII).toString('hex'), 16);74 await expectRevert(this.plusCodes.getChildTemplate(parentCode), 'greater than 12 not supported');75 });76 it('reverts when trying to get child of invalid Plus Code', async function () {77 const parentCodeASCII = '2222BEER+';78 const parentCode = new BN(Buffer.from(parentCodeASCII).toString('hex'), 16);79 await expectRevert(this.plusCodes.getChildTemplate(parentCode), 'Not a valid Plus Codes digit');80 });81 });82 describe('toString, fromString', async function () {83 async function checkToFromString (plusCodes, plusCodeASCII) {84 const plusCode = new BN(Buffer.from(plusCodeASCII).toString('hex'), 16);85 const roundTripString = await plusCodes.methods['toString(uint256)'](plusCode);86 const threeWay = await plusCodes.fromString(roundTripString);87 expect(roundTripString).to.equal(plusCodeASCII);88 expect(threeWay).to.bignumber.equal(plusCode);89 }90 it('converts a code length 2 Plus Code to a string', async function () {91 await checkToFromString(this.plusCodes, '24000000+');92 });93 it('converts a code length 4 Plus Code to a string', async function () {94 await checkToFromString(this.plusCodes, '24330000+');95 });96 it('converts a code length 6 Plus Code to a string', async function () {97 await checkToFromString(this.plusCodes, '23456700+');98 });99 it('converts a code length 8 Plus Code to a string', async function () {100 await checkToFromString(this.plusCodes, '23456789+');101 });102 it('converts a code length 10 Plus Code to a string', async function () {103 await checkToFromString(this.plusCodes, '23456789+CF');104 });105 it('converts a code length 11 Plus Code to a string', async function () {106 await checkToFromString(this.plusCodes, '23456789+CFG');107 });108 it('converts a code length 12 Plus Code to a string', async function () {109 await checkToFromString(this.plusCodes, '23456789+CFGH');110 });111 it('reverts when trying to convert invalid Plus Code', async function () {112 const invalidCodeASCII = '2222BEER+';113 const invalidCode = new BN(Buffer.from(invalidCodeASCII).toString('hex'), 16);114 await expectRevert(this.plusCodes.methods['toString(uint256)'](invalidCode), 'Not a valid Plus Codes digit');115 });116 });117 describe('getNthCodeLength4CodeNotNearPoles', async function () {118 function isAValidCodeLength4PlusCode (plusCodeASCII) {119 // See https://github.com/google/open-location-code120 const regexp = /^[2-9C][[2-9CFGHJMPQRV][2-9CFGHJMPQRVWX]{2}0000\+$/;121 return regexp.test(plusCodeASCII);122 }123 function isNearPoles (plusCodeASCII) {124 // See https://github.com/google/open-location-code125 const regexp = /^[23C]/;126 return regexp.test(plusCodeASCII);127 }128 before(async function () {129 this.allCodeLength4CodeNotNearPoles = [];130 // for (let n = 1; n <= 43200; n++) {131 for (let n = 1; n <= 100; n++) {132 const code = await this.plusCodes.getNthCodeLength4CodeNotNearPoles(n);133 const plusCodeASCII = await this.plusCodes.methods['toString(uint256)'](code);134 this.allCodeLength4CodeNotNearPoles.push(plusCodeASCII);135 }136 for (let n = 43100; n <= 43200; n++) {137 const code = await this.plusCodes.getNthCodeLength4CodeNotNearPoles(n);138 const plusCodeASCII = await this.plusCodes.methods['toString(uint256)'](code);139 this.allCodeLength4CodeNotNearPoles.push(plusCodeASCII);140 }141 });142 it('codes are unique', async function () {143 const uniques = Array.from(new Set(this.allCodeLength4CodeNotNearPoles));144 expect(uniques.length).to.equal(this.allCodeLength4CodeNotNearPoles.length);145 });146 it('codes are alphabetized', async function () {147 for (let i = 1; i < this.allCodeLength4CodeNotNearPoles.length; i++) {148 expect(this.allCodeLength4CodeNotNearPoles[i - 1] < this.allCodeLength4CodeNotNearPoles[i]).to.equal(true);149 }150 });151 it('codes are valid code length 4 Plus Codes', async function () {152 this.allCodeLength4CodeNotNearPoles.forEach(element => {153 expect(isAValidCodeLength4PlusCode(element)).to.equal(true);154 });155 });156 it('codes are not near poles', async function () {157 this.allCodeLength4CodeNotNearPoles.forEach(element => {158 expect(isNearPoles(element)).to.equal(false);159 });160 });161 it('reverts for too-low input', async function () {162 await expectRevert(this.plusCodes.getNthCodeLength4CodeNotNearPoles(0), 'Out of range');163 });164 it('reverts for too-high input', async function () {165 await expectRevert(this.plusCodes.getNthCodeLength4CodeNotNearPoles(43201), 'Out of range');166 });167 });168 describe('getNthCodeLength2CodeNearPoles', async function () {169 function isAValidCodeLength2PlusCode (plusCodeASCII) {170 // See https://github.com/google/open-location-code171 const regexp = /^[2-9C][[2-9CFGHJMPQRV]000000\+$/;172 return regexp.test(plusCodeASCII);173 }174 function isNearPoles (plusCodeASCII) {175 // See https://github.com/google/open-location-code176 const regexp = /^[23C]/;177 return regexp.test(plusCodeASCII);178 }179 before(async function () {180 this.allCodeLength2CodeNearPoles = [];181 for (let n = 1; n <= 54; n++) {182 const code = await this.plusCodes.getNthCodeLength2CodeNearPoles(n);183 const plusCodeASCII = await this.plusCodes.methods['toString(uint256)'](code);184 this.allCodeLength2CodeNearPoles.push(plusCodeASCII);185 }186 });187 it('codes are unique', async function () {188 const uniques = Array.from(new Set(this.allCodeLength2CodeNearPoles));189 expect(uniques.length).to.equal(this.allCodeLength2CodeNearPoles.length);190 });191 it('codes are alphabetized', async function () {192 for (let i = 1; i < this.allCodeLength2CodeNearPoles.length; i++) {193 expect(this.allCodeLength2CodeNearPoles[i - 1] < this.allCodeLength2CodeNearPoles[i]).to.equal(true);194 }195 });196 it('codes are valid code length 2 Plus Codes', async function () {197 this.allCodeLength2CodeNearPoles.forEach(element => {198 expect(isAValidCodeLength2PlusCode(element)).to.equal(true);199 });200 });201 it('codes are near poles', async function () {202 this.allCodeLength2CodeNearPoles.forEach(element => {203 expect(isNearPoles(element)).to.equal(true);204 });205 });206 it('reverts for too-low input', async function () {207 await expectRevert(this.plusCodes.getNthCodeLength2CodeNearPoles(0), 'Out of range');208 });209 it('reverts for too-high input', async function () {210 await expectRevert(this.plusCodes.getNthCodeLength2CodeNearPoles(55), 'Out of range');211 });212 });213 describe('getCodeLength', function () {214 async function checkToCodeLength (plusCodes, plusCodeASCII, length) {215 const plusCode = new BN(Buffer.from(plusCodeASCII).toString('hex'), 16);216 expect(await plusCodes.getCodeLength(plusCode)).to.bignumber.equal(length);217 }218 it('it gets the length of a code length 2 Plus Code', async function () {219 await checkToCodeLength(this.plusCodes, '22000000+', '2');220 });221 it('it gets the length of a code length 4 Plus Code', async function () {222 await checkToCodeLength(this.plusCodes, '22330000+', '4');223 });224 it('it gets the length of a code length 6 Plus Code', async function () {225 await checkToCodeLength(this.plusCodes, '22334400+', '6');226 });227 it('it gets the length of a code length 8 Plus Code', async function () {228 await checkToCodeLength(this.plusCodes, '22334422+', '8');229 });230 it('it gets the length of a code length 10 Plus Code', async function () {231 await checkToCodeLength(this.plusCodes, '22334422+CC', '10');232 });233 it('it gets the length of a code length 11 Plus Code', async function () {234 await checkToCodeLength(this.plusCodes, '22334422+CCR', '11');235 });236 it('it gets the length of a code length 12 Plus Code', async function () {237 await checkToCodeLength(this.plusCodes, '22GHJMPQ+RVWX', '12');238 });239 it('it reverts on a too-long code', async function () {240 const plusCode = new BN(Buffer.from('123456789+').toString('hex'), 16);241 await expectRevert(this.plusCodes.getCodeLength(plusCode), 'Too many characters in Plus Code');242 });243 it('it reverts if past North Pole', async function () {244 const plusCode = new BN(Buffer.from('F2000000+').toString('hex'), 16);245 await expectRevert(this.plusCodes.getCodeLength(plusCode), 'Beyond North Pole');246 });247 it('it reverts if past antimeridian', async function () {248 const plusCode = new BN(Buffer.from('2W000000+').toString('hex'), 16);249 await expectRevert(this.plusCodes.getCodeLength(plusCode), 'Beyond antimeridian');250 });251 it('it reverts if code length 13', async function () {252 const plusCode = new BN(Buffer.from('22GHJMPQ+RVWX2').toString('hex'), 16);253 await expectRevert(this.plusCodes.getCodeLength(plusCode), 'Code lengths greater than 12 are not supported');254 });255 });...
positions-plus-asks-test.js
Source:positions-plus-asks-test.js
1import { describe, it } from 'mocha'2import { assert } from 'chai'3import thunk from 'redux-thunk'4import configureMockStore from 'redux-mock-store'5import BigNumber from 'bignumber.js'6import { ZERO } from 'modules/trade/constants/numbers'7describe('modules/user-open-orders/selectors/positions-plus-asks', () => {8 const middlewares = [thunk]9 const mockStore = configureMockStore(middlewares)10 const test = (t) => {11 it(t.description, () => {12 const store = mockStore(t.state || {})13 t.assertions(store)14 })15 }16 describe('selectAccountPositions', () => {17 const positionsPlusAsks = require('modules/user-open-orders/selectors/positions-plus-asks')18 positionsPlusAsks.__Rewire__('selectPositionsPlusAsks', () => 'selectPositionsPlusAsks')19 test({20 description: `should call the expected methods`,21 assertions: () => {22 const actual = positionsPlusAsks.default()23 const expected = 'selectPositionsPlusAsks'24 assert.strictEqual(actual, expected, `Didn't call the expected method`)25 },26 })27 })28 describe('selectPositionsPlusAsks', () => {29 const positionsPlusAsks = require('modules/user-open-orders/selectors/positions-plus-asks')30 positionsPlusAsks.__Rewire__('selectMarketPositionPlusAsks', () => 'selectMarketPositionPlusAsks')31 test({32 description: `should return the expected value with no positions`,33 state: {34 loginAccount: {},35 },36 assertions: (store) => {37 const actual = positionsPlusAsks.selectPositionsPlusAsks(store.getState())38 const expected = null39 assert.strictEqual(actual, expected, `Didn't return the expected value`)40 },41 })42 test({43 description: `should return the expected value with positions and no market order book`,44 state: {45 loginAccount: {},46 accountPositions: {47 '0xMARKETID': {},48 },49 orderBooks: {},50 },51 assertions: (store) => {52 const actual = positionsPlusAsks.selectPositionsPlusAsks(store.getState())53 const expected = {54 '0xMARKETID': {},55 }56 assert.deepEqual(actual, expected, `Didn't return the expected object`)57 },58 })59 test({60 description: `should return the expected value with positions and market order book`,61 state: {62 loginAccount: {},63 accountPositions: {64 '0xMARKETID': {},65 },66 orderBooks: {67 '0xMARKETID': {68 sell: [69 {},70 ],71 },72 },73 },74 assertions: (store) => {75 const actual = positionsPlusAsks.selectPositionsPlusAsks(store.getState())76 const expected = {77 '0xMARKETID': 'selectMarketPositionPlusAsks',78 }79 assert.deepEqual(actual, expected, `Didn't return the expected object`)80 },81 })82 })83 describe('selectMarketPositionPlusAsks', () => {84 const positionsPlusAsks = require('modules/user-open-orders/selectors/positions-plus-asks')85 positionsPlusAsks.__Rewire__('getOpenAskShares', () => 1)86 test({87 description: `should return the expected value without asks passed in`,88 assertions: () => {89 const actual = positionsPlusAsks.selectMarketPositionPlusAsks()90 const expected = {}91 assert.deepEqual(actual, expected, `Didn't return the expected object`)92 },93 })94 test({95 description: `should return the expected value with asks passed in`,96 assertions: () => {97 const actual = positionsPlusAsks.selectMarketPositionPlusAsks(null, { 1: '1' }, {})98 const expected = {99 1: '2',100 }101 assert.deepEqual(actual, expected, `Didn't return the expected object`)102 },103 })104 })105 describe('getOpenAskShares', () => {106 const positionsPlusAsks = require('modules/user-open-orders/selectors/positions-plus-asks')107 test({108 description: `should return the expected value without account passed`,109 assertions: () => {110 const actual = positionsPlusAsks.getOpenAskShares()111 const expected = ZERO112 assert.deepEqual(actual, expected, `Didn't return the expected value`)113 },114 })115 test({116 description: `should return the expected value without askOrders passed`,117 assertions: () => {118 const actual = positionsPlusAsks.getOpenAskShares('0xUSERADDRESS', 1)119 const expected = ZERO120 assert.deepEqual(actual, expected, `Didn't return the expected value`)121 },122 })123 test({124 description: `should return the expected value`,125 assertions: () => {126 const actual = positionsPlusAsks.getOpenAskShares('0xUSERADDRESS', 1, {127 '0xORDER1': {128 owner: '0xUSERADDRESS',129 outcome: 1,130 amount: '1',131 },132 '0xORDER2': {133 owner: '0xNOTUSERADDRESS',134 outcome: 1,135 amount: '1',136 },137 '0xORDER3': {138 owner: '0xUSERADDRESS',139 outcome: 2,140 amount: '1',141 },142 '0xORDER4': {143 owner: '0xUSERADDRESS',144 outcome: 1,145 amount: '1',146 },147 })148 const expected = new BigNumber('2')149 assert.deepEqual(actual, expected, `Didn't return the expected value`)150 },151 })152 })...
ValuePickerDatePicker.js
Source:ValuePickerDatePicker.js
1define([2 "dojo/_base/declare",3 "dojo/dom-class",4 "dojo/dom-attr",5 "./_DatePickerMixin",6 "./ValuePicker",7 "./ValuePickerSlot"8], function(declare, domClass, domAttr, DatePickerMixin, ValuePicker, ValuePickerSlot){9 // module:10 // dojox/mobile/ValuePickerDatePicker11 return declare("dojox.mobile.ValuePickerDatePicker", [ValuePicker, DatePickerMixin], {12 // summary:13 // A ValuePicker-based date picker widget.14 // description:15 // ValuePickerDatePicker is a date picker widget. It is a subclass of16 // dojox/mobile/ValuePicker. It has 3 slots: day, month and year.17 18 // readOnly: [const] Boolean19 // If true, slot input fields are read-only. Only the plus and20 // minus buttons can be used to change the values.21 // Note that changing the value of the property after the widget 22 // creation has no effect.23 readOnly: false,24 25 // yearPlusBtnLabel: String26 // (Accessibility) Label for year plus button27 yearPlusBtnLabel: "",28 29 // yearPlusBtnLabelRef: String30 // (Accessibility) Reference to a node id containing text label for the year plus button31 yearPlusBtnLabelRef: "",32 33 // yearPlusBtnLabel: String34 // (Accessibility) Label for year minus button35 yearMinusBtnLabel: "",36 37 // yearPlusBtnLabelRef: String38 // (Accessibility) Reference to a node id containing text label for the year minus button39 yearMinusBtnLabelRef: "",40 // monthPlusBtnLabel: String41 // (Accessibility) Label for month plus button42 monthPlusBtnLabel: "",43 44 // monthPlusBtnLabelRef: String45 // (Accessibility) Reference to a node id containing text label for the month plus button46 monthPlusBtnLabelRef: "",47 48 // monthMinusBtnLabel: String49 // (Accessibility) Label for month minus button50 monthMinusBtnLabel: "",51 52 // monthMinusBtnLabelRef: String53 // (Accessibility) Reference to a node id containing text label for the month minus button54 monthMinusBtnLabelRef: "",55 // dayPlusBtnLabel: String56 // (Accessibility) Label for day plus button57 dayPlusBtnLabel: "",58 59 // dayPlusBtnLabelRef: String60 // (Accessibility) Reference to a node id containing text label for the day plus button61 dayPlusBtnLabelRef: "",62 63 // dayMinusBtnLabel: String64 // (Accessibility) Label for day minus button65 dayMinusBtnLabel: "",66 67 // dayMinusBtnLabelRef: String68 // (Accessibility) Reference to a node id containing text label for the day minus button69 dayMinusBtnLabelRef: "",70 slotClasses: [71 ValuePickerSlot,72 ValuePickerSlot,73 ValuePickerSlot74 ],75 slotProps: [76 {labelFrom:1970, labelTo:2038, style:{width:"87px"}},77 {style:{width:"72px"}},78 {style:{width:"72px"}}79 ],80 buildRendering: function(){81 var p = this.slotProps;82 p[0].readOnly = p[1].readOnly = p[2].readOnly = this.readOnly;83 this._setBtnLabels(p);84 this.initSlots();85 this.inherited(arguments);86 domClass.add(this.domNode, "mblValuePickerDatePicker");87 this._conn = [88 this.connect(this.slots[0], "_spinToValue", "_onYearSet"),89 this.connect(this.slots[1], "_spinToValue", "_onMonthSet"),90 this.connect(this.slots[2], "_spinToValue", "_onDaySet")91 ];92 },93 disableValues: function(/*Number*/daysInMonth){94 // summary:95 // Disables the end days of the month to match the specified96 // number of days of the month.97 var items = this.slots[2].items;98 if(this._tail){99 this.slots[2].items = items = items.concat(this._tail);100 }101 this._tail = items.slice(daysInMonth);102 items.splice(daysInMonth);103 },104 105 _setBtnLabels: function(slotProps){106 //summary:107 // Set a11y labels on the plus/minus buttons108 slotProps[0].plusBtnLabel = this.yearPlusBtnLabel;109 slotProps[0].plusBtnLabelRef = this.yearPlusBtnLabelRef;110 slotProps[0].minusBtnLabel = this.yearMinusBtnLabel;111 slotProps[0].minusBtnLabelRef = this.yearMinusBtnLabelRef;112 slotProps[1].plusBtnLabel = this.monthPlusBtnLabel; 113 slotProps[1].plusBtnLabelRef = this.monthPlusBtnLabelRef;114 slotProps[1].minusBtnLabel = this.monthMinusBtnLabel;115 slotProps[1].minusBtnLabelRef = this.monthMinusBtnLabelRef;116 slotProps[2].plusBtnLabel = this.dayPlusBtnLabel;117 slotProps[2].plusBtnLabelRef = this.dayPlusBtnLabelRef;118 slotProps[2].minusBtnLabel = this.dayMinusBtnLabel;119 slotProps[2].minusBtnLabelRef = this.dayMinusBtnLabelRef;120 }121 });...
fuzzaldrin-plus_vx.x.x.js
Source:fuzzaldrin-plus_vx.x.x.js
1// flow-typed signature: d98fb4c8868e0b608d408476eabee9642// flow-typed version: <<STUB>>/fuzzaldrin-plus_v^0.6.0/flow_v0.74.03/**4 * This is an autogenerated libdef stub for:5 *6 * 'fuzzaldrin-plus'7 *8 * Fill this stub out by replacing all the `any` types.9 *10 * Once filled out, we encourage you to share your work with the11 * community by sending a pull request to:12 * https://github.com/flowtype/flow-typed13 */14declare module 'fuzzaldrin-plus' {15 declare module.exports: any;16}17/**18 * We include stubs for each file inside this npm package in case you need to19 * require those files directly. Feel free to delete any files that aren't20 * needed.21 */22declare module 'fuzzaldrin-plus/dist-browser/fuzzaldrin-plus' {23 declare module.exports: any;24}25declare module 'fuzzaldrin-plus/dist-browser/fuzzaldrin-plus.min' {26 declare module.exports: any;27}28declare module 'fuzzaldrin-plus/lib/filter' {29 declare module.exports: any;30}31declare module 'fuzzaldrin-plus/lib/fuzzaldrin' {32 declare module.exports: any;33}34declare module 'fuzzaldrin-plus/lib/matcher' {35 declare module.exports: any;36}37declare module 'fuzzaldrin-plus/lib/pathScorer' {38 declare module.exports: any;39}40declare module 'fuzzaldrin-plus/lib/query' {41 declare module.exports: any;42}43declare module 'fuzzaldrin-plus/lib/scorer' {44 declare module.exports: any;45}46// Filename aliases47declare module 'fuzzaldrin-plus/dist-browser/fuzzaldrin-plus.js' {48 declare module.exports: $Exports<'fuzzaldrin-plus/dist-browser/fuzzaldrin-plus'>;49}50declare module 'fuzzaldrin-plus/dist-browser/fuzzaldrin-plus.min.js' {51 declare module.exports: $Exports<'fuzzaldrin-plus/dist-browser/fuzzaldrin-plus.min'>;52}53declare module 'fuzzaldrin-plus/lib/filter.js' {54 declare module.exports: $Exports<'fuzzaldrin-plus/lib/filter'>;55}56declare module 'fuzzaldrin-plus/lib/fuzzaldrin.js' {57 declare module.exports: $Exports<'fuzzaldrin-plus/lib/fuzzaldrin'>;58}59declare module 'fuzzaldrin-plus/lib/matcher.js' {60 declare module.exports: $Exports<'fuzzaldrin-plus/lib/matcher'>;61}62declare module 'fuzzaldrin-plus/lib/pathScorer.js' {63 declare module.exports: $Exports<'fuzzaldrin-plus/lib/pathScorer'>;64}65declare module 'fuzzaldrin-plus/lib/query.js' {66 declare module.exports: $Exports<'fuzzaldrin-plus/lib/query'>;67}68declare module 'fuzzaldrin-plus/lib/scorer.js' {69 declare module.exports: $Exports<'fuzzaldrin-plus/lib/scorer'>;...
Using AI Code Generation
1var karma = require('karma');2var Server = karma.Server;3var server = new Server({4}, function(exitCode) {5 console.log('Karma has exited with ' + exitCode);6 process.exit(exitCode);7}).start();
Using AI Code Generation
1var calculator = require('./calculator.js');2var assert = require('assert');3describe('Calculator', function() {4 describe('plus()', function() {5 it('should return 2 when 1 plus 1', function() {6 assert.equal(2, calculator.plus(1, 1));7 });8 });9});10module.exports = {11 plus: function(a, b) {12 return a + b;13 }14};15PhantomJS 1.9.8 (Mac OS X) Calculator plus() should return 2 when 1 plus 1 FAILED16PhantomJS 1.9.8 (Mac OS X): Executed 1 of 1 (1 FAILED) (0 secs / 0.015 secs)17module.exports = {18 plus: function(a, b) {19 return a + b;20 }21};22PhantomJS 1.9.8 (Mac OS X) Calculator plus() should return 2 when 1 plus 1 SUCCESS23PhantomJS 1.9.8 (Mac OS X): Executed 1 of 1 SUCCESS (0 secs / 0.015 secs)
Using AI Code Generation
1var assert = require('assert');2var calc = require('../calc.js');3describe('Calc', function() {4 describe('plus()', function() {5 it('should return 2 when 1 + 1', function() {6 assert.equal(calc.plus(1, 1), 2);7 });8 });9});10var calc = {11 plus: function(a, b) {12 return a + b;13 }14};15module.exports = calc;16Chrome 57.0.2987 (Mac OS X 10.12.3): Executed 1 of 1 SUCCESS (0.001 secs / 0.001 secs)
Using AI Code Generation
1var k = new Karma();2k.plus(1);3k.plus(2);4k.plus(3);5var k = new Karma();6k.minus(1);7k.minus(2);8k.minus(3);9var k = new Karma();10var k = new Karma();11k.plus(1);12k.plus(2);13k.plus(3);14k.reset();15var k = new Karma();16var k = new Karma();17k.plus(1);18k.plus(2);19k.plus(3);20var k = new Karma();21k.minus(1);22k.minus(2);23k.minus(3);24var k = new Karma();25k.plus(1);26k.minus(2);27k.minus(3);28var k = new Karma();29k.plus(1);30k.minus(2);31k.plus(3);32var k = new Karma();33k.minus(1);34k.plus(2);35k.minus(3);36var k = new Karma();37k.plus(1);38k.minus(2);39k.plus(3);40k.minus(4);41k.plus(5);42k.minus(6);43k.plus(7);44k.minus(8);45k.plus(9);46k.minus(10);
Using AI Code Generation
1var k = new KarmaTest();2k.plus(1, 2);3var KarmaTest = function() {4};5KarmaTest.prototype = {6 plus: function(a, b) {7 return a + b;8 }9};10module.exports = KarmaTest;11module.exports = function(config) {12 config.set({
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!