Version Description
Bug fix release for "Target link" not working.
Download this release
Release Info
Developer | Icegram |
Plugin | Popups, Welcome Bar, Optins and Lead Generation Plugin – Icegram |
Version | 1.9.3 |
Comparing to | |
See all releases |
Code changes from version 1.9.2 to 1.9.3
- assets/js/admin.js +1 -1
- assets/js/icegram.js +1 -1
- icegram.php +2 -2
- readme.txt +9 -2
assets/js/admin.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(function(){function e(e){var t=jQuery(e).find(".message_type option:selected").val(),i=jQuery(e).find(".message_row.ig_"+t).find(".message_theme").val(),a=jQuery(e).find(".message_row.ig_"+t).find("#message_form_style").val(),r=jQuery(e).find("#message_theme_ig_"+t).find("."+i).attr("style"),s=jQuery(e).find("#message_form_style").find("."+a).attr("style");jQuery(e).find(".message_row, .location").hide(),jQuery(e).find(".ig_"+t).show(),jQuery(e).find(".message_row.ig_"+t).find(".message_theme").next().find(".chosen-single span").attr("style",r),jQuery(e).find(".message_row.ig_"+t).find(".message_form_style").next().find(".chosen-single span").attr("style",s).text(function(){return jQuery(this).text().substr(0,jQuery(this).text().indexOf(" "))||jQuery(this).text()}),"block"!==jQuery(e).find(".message_body").parent().css("display")?jQuery(e).find(".message_body").parent().next(".wp-editor-wrap").hide():jQuery(e).find(".message_body").parent().next(".wp-editor-wrap").show(),jQuery(e).find(".message_form_layout:checked").is(":visible")||jQuery(e).find(".message_form_layout:visible").first().prop("checked",!0),jQuery(".message_form_layout").change()}function t(e,i,a){var r=Math.floor(Math.random()*(a-i+1))+i;return r==e?t(r,i,a):r}function i(){var e='<span><label class="options_header"><span id="valid-field"> </span></label> <input type="text" class="url_input_field" data-option="local_url" name="campaign_target_rules[local_urls][]" value="'+r+'*"/><span class="delete-url"></span></span>';return e}function a(){0==jQuery(".message-row").length?jQuery(".empty_campaign").show():jQuery(".empty_campaign").hide()}var r=icegram_writepanel_params.home_url;jQuery("#campaign_data").find("h3.hndle").hide(),jQuery(".target_rules_desc").appendTo("#campaign_target_rules h3.hndle span"),jQuery(document).ready(function(){var i=window.send_to_editor;jQuery("#postdivrich").hide(),jQuery(".color-field").wpColorPicker().each(function(e){var t=jQuery(this).data("color-label")||"";""!==t&&jQuery(this).closest(".wp-picker-container").find("a.wp-color-result").attr("title",t)}),jQuery("#campaign_data").on("change",".show_color_options",function(){jQuery(this).closest("p").next(".message_colors_options_container").toggle(!this.checked)}).change(),a(),jQuery(".message_edit:first").trigger("click"),this_data=jQuery(".message_type option:selected").closest(".message-setting-fields");for(var r=0;r<this_data.length;r++)e(this_data[r]);jQuery(".inside").on("change",".message_type",function(t){var i=jQuery(t.target).parents(".message-setting-fields");e(i)}),jQuery("#campaign_data, #message-settings").on("change",".message_theme",function(e){var t=jQuery(e.target).parents(".message-setting-fields"),i=jQuery(t).find(".message_type").val(),a=jQuery(t).find(".message_row.ig_"+i).find(".message_theme").val(),r=jQuery(t).find("#message_theme_ig_"+i).find("."+a).attr("style");jQuery(t).find(".message_row.ig_"+i).find(".message_theme").next().find(".chosen-single span").attr("style",r)}),jQuery("#campaign_data").on("click",".message_image_button",function(e){var t=this;return window.send_to_editor=function(e){imgurl=jQuery("img",e).attr("src"),jQuery(t).parent().find("#upload_image").val(imgurl),tb_remove(),window.send_to_editor=i},!1}),jQuery("#campaign_data ,#message-settings").on("click",".message_headline_button",function(){var e=jQuery(this).prev().attr("data-headline"),i=icegram_writepanel_params.available_headlines.length,a=t(e,0,i),r=icegram_writepanel_params.available_headlines[a];jQuery(this).prev().val(r)}),jQuery(".tips, .help_tip").tipTip({attribute:"data-tip"}),jQuery("span.test_class").hover(function(){jQuery(this).next().show()},function(){jQuery(this).next().hide()}),jQuery("#campaign_data .hndle, #campaign_data .handlediv").unbind("click"),jQuery("#campaign_data .handlediv").hide()}),jQuery("#campaign_data").on("click",".message_delete",function(){jQuery(this).parent().parent().next().remove(),jQuery(this).parent().parent().remove(),a()}),jQuery("#campaign_data").on("click",".message_edit",function(){jQuery(this).parent().parent().next().toggle(),jQuery(this).parent().parent().find(".message-title-text, .message-title-input").toggle()}),jQuery("#campaign_data").on("change",".message-title-input",function(){jQuery(this).prev().text(jQuery(this).val())}),jQuery("select.ajax_chosen_select_messages").ajaxChosen({type:"GET",url:icegram_writepanel_params.ajax_url,dataType:"json",afterTypeDelay:100,data:{action:"icegram_json_search_messages",security:icegram_writepanel_params.search_message_nonce}},function(e){var t={};return jQuery.each(e,function(e,i){t[e]=i}),t}),jQuery("#campaign_data").on("change",".show_form_options",function(e){var t=jQuery(this).closest("p");if(jQuery(t).siblings(".message_form_options").slideToggle(this.checked),this.checked)jQuery(t).siblings(".message_form_options").find(".message_form_layout").change();else{jQuery(t).siblings("p.cta-actions").find("select option").removeAttr("disabled");var i=jQuery(t).siblings(".message_form_options").siblings(".wp-editor-wrap").find(".wp-editor-area"),a=jQuery(i).val().trim().replace("[ig_form]","");jQuery(i).val(a)}}).change(),jQuery("#campaign_data, #message-settings").on("change",".message_form_style",function(e){var t=jQuery(e.target).parents(".message-setting-fields"),i=jQuery(t).find("#message_form_style").val(),a=jQuery(t).find("#message_form_style").find("."+i).attr("style");jQuery(t).find(".message_form_style").next().find(".chosen-single span").attr("style",a).text(function(){return jQuery(this).text().substr(0,jQuery(this).text().indexOf(" "))||jQuery(this).text()})}),jQuery("#campaign_data").on("change",".message_form_layout ",function(){var e=jQuery(this).closest(".message_form_options").siblings(".wp-editor-wrap").find(".wp-editor-area"),t=jQuery(e).val().trim();if(jQuery(this).is(":visible")){var i=this;jQuery(i).closest(".form_radio_group").siblings(".form_inline_shortcode").hide(),jQuery(i).closest(".form_radio_group").siblings(".message_form_color").show().end().siblings(".form_inline_shortcode").hide(),jQuery(i).is(":checked")&&jQuery(i).closest(".message_form_options").prev("p.message_form_options_check").find(".show_form_options").is(":checked")&&("inline"==jQuery(i).val()?(-1==t.indexOf("[ig_form]")&&(t+="[ig_form]"),jQuery(i).closest(".form_radio_group").siblings(".message_form_color, .form_inline_shortcode").toggle()):"inline"!=jQuery(i).val()&&(t=t.replace("[ig_form]","")))}else t=t.replace("[ig_form]","");jQuery(e).val(t)}),jQuery("#campaign_data").on("blur",".message_form_html_original",function(e){var t=this,i=jQuery("<div/>").html(jQuery(t).val()).find("input[type=submit], button, input[type=button]");if(jQuery(a).parent().find("p.cta-actions select option").removeAttr("disabled"),i.length>0){var a=jQuery(t).closest(".message_form_options"),r=jQuery(i[i.length-1]),s=r.is("button")?r.not("br, span, div").text():r.val();jQuery(a).siblings("p").find("#message_label").val(s.trim()),jQuery(a).parent().find("p.cta-actions select").find('option[value="url"], option[value="hide"], option[value="cta_another_message"]').attr("disabled",!0).attr("selected",!1).end().find('option[value="form"]').attr("selected",!0).trigger("change")}}),jQuery(".ajax_chosen_select_messages").chosen(),jQuery("#campaign_data").on("change",".ajax_chosen_select_messages",function(){var t=jQuery("#ig-tabs li.current").attr("variation_id"),i=jQuery.extend({},tinyMCEPreInit.mceInit.content),r=jQuery.extend({},tinyMCEPreInit.qtInit.content),s=jQuery(this).parent().siblings(".campaign_target_rules_panel"),n=jQuery(s).find(".message-row").length,o=jQuery(this).val();return""==o?void jQuery(".ajax_chosen_select_messages").val("").trigger("chosen:updated"):(jQuery(".message-edit-row").hide(),jQuery(".message-title-text").show(),jQuery(".message-title-input").hide(),void jQuery.ajax({type:"POST",url:icegram_writepanel_params.ajax_url,dataType:"json",data:{action:"get_message_action_row",message_id:o,row:n},success:function(o){if(n++,jQuery(s).find(".messages-list .messages_list_table tbody").append(o.main),jQuery(".color-field").wpColorPicker().each(function(e){var t=jQuery(this).data("color-label")||"";""!==t&&jQuery(this).closest(".wp-picker-container").find("a.wp-color-result").attr("title",t)}),jQuery("#campaign_data").on("change",".show_color_options",function(){jQuery(this).closest("p").next(".message_colors_options_container").toggle(!this.checked)}).change(),e(jQuery("#"+o.id)),jQuery(".ajax_chosen_select_messages").val("").trigger("chosen:updated"),jQuery("select.icegram_chosen_page").chosen({disable_search_threshold:10}),a(),jQuery(".message-setting-fields").trigger("change"),jQuery(".tips, .help_tip").tipTip({attribute:"data-tip"}),"undefined"==typeof tinyMCEPreInit.mceInit["edit"+o.id]){for(_prop in i)"string"==typeof i[_prop]&&"content_css"!==_prop&&(i[_prop]=i[_prop].replace(new RegExp("content","g"),"edit"+o.id));tinyMCEPreInit.mceInit["edit"+o.id]=i}if("undefined"==typeof tinyMCEPreInit.qtInit["edit"+o.id]){for(_prop in r)"string"==typeof r[_prop]&&"content_css"!==_prop&&(r[_prop]=r[_prop].replace(new RegExp("content","g"),"edit"+o.id));tinyMCEPreInit.qtInit["edit"+o.id]=r}tinyMCE.init({id:tinyMCEPreInit.mceInit["edit"+o.id]}),quicktags({id:"edit"+o.id}),QTags._buttonsInit(),jQuery("#wp-edit"+o.id+"-wrap").hasClass("tmce-active")?jQuery("#edit"+o.id+"-tmce").click():jQuery("#edit"+o.id+"-html").click(),"undefined"!=typeof t&&jQuery(window).trigger("icegram_tab_selected",[t])}}))}),jQuery("#campaign_target_rules").on("click","#add_local_url_row",function(e){e.preventDefault();var t=i();jQuery(".local_url").find(".url_input_field").length?jQuery(t).insertAfter(jQuery(".local_url").find(".url_input_field").last().parent("span")):jQuery(t).insertBefore(jQuery(".local_url").find("#add_local_url_row_label"))}),jQuery("#campaign_target_rules").on("click",".delete-url",function(e){jQuery(this).parent().remove()}),jQuery("select.ajax_chosen_select_messages").next("div").on("click","div.chosen-drop",function(){jQuery(this).closest("h3.hndle").trigger("click")}),jQuery("#campaign_data").on("click",".campaign_preview",function(e){jQuery(this).closest("h3.hndle").trigger("click"),0!=jQuery(".message-row").length&&(tinyMCE.triggerSave(),params=jQuery("#post").serializeArray(),params.push({name:"action",value:"save_campaign_preview"}),jQuery.ajax({type:"POST",async:!1,url:icegram_writepanel_params.ajax_url,data:params,success:function(e){""!=e&&window.open(e,"preview_window")}}))}),jQuery("select.icegram_chosen_page").chosen({disable_search_threshold:10}),jQuery("input#users_logged_in, input#users_all ,input#users_not_logged_in").on("change",function(){"logged_in"==jQuery(this).val()?(jQuery("select#users_roles").parent("p").show(),jQuery("#users_roles_chosen").find("input").trigger("click")):jQuery("select#users_roles").parent("p").hide()}),jQuery(".schedule_rule").on("change",function(){"when_schedule"==jQuery(this).attr("id")?jQuery("#date_picker").show():jQuery("#date_picker").hide()}),jQuery("input#where_other_page").on("change",function(){jQuery("select#where_page_id").parent("p").slideToggle(),jQuery(this).is(":checked")&&jQuery("#where_page_id_chosen").find("input").trigger("click")}),jQuery("input#where_sitewide").on("change",function(){jQuery("select#exclude_page_id").parent("p").slideToggle(),jQuery(this).is(":checked")&&jQuery("#exclude_page_id_chosen").find("input").trigger("click")}),jQuery("input#where_local_url").on("change",function(){jQuery(".local_url").slideToggle()}),jQuery(".date-picker").datepicker({dateFormat:"yy-mm-dd",defaultDate:0,showOtherMonths:!0,selectOtherMonths:!0,changeMonth:!0,changeYear:!0,showButtonPanel:!0}),jQuery("#campaign_target_rules").on("focusout","input.url_input_field",function(){var e=this;if(jQuery(e).parent().find("span#valid-field").removeClass("error"),"undefine"!==jQuery(e).data("option")&&"local_url"==jQuery(e).data("option")&&"*"!=jQuery(e).val()){var t=e.value;if(t.indexOf(r)<0)return void jQuery(e).val(r+t)}})});
|
1 |
+
jQuery(function(){function e(e){var t=jQuery(e).find(".message_type option:selected").val(),i=jQuery(e).find(".message_row.ig_"+t).find(".message_theme").val(),a=jQuery(e).find(".message_row.ig_"+t).find("#message_form_style").val(),r=jQuery(e).find("#message_theme_ig_"+t).find("."+i).attr("style"),s=jQuery(e).find("#message_form_style").find("."+a).attr("style");jQuery(e).find(".message_row, .location").hide(),jQuery(e).find(".ig_"+t).show(),jQuery(e).find(".message_row.ig_"+t).find(".message_theme").next().find(".chosen-single span").attr("style",r),jQuery(e).find(".message_row.ig_"+t).find(".message_form_style").next().find(".chosen-single span").attr("style",s).text(function(){return jQuery(this).text().substr(0,jQuery(this).text().indexOf(" "))||jQuery(this).text()}),"block"!==jQuery(e).find(".message_body").parent().css("display")?jQuery(e).find(".message_body").parent().next(".wp-editor-wrap").hide():jQuery(e).find(".message_body").parent().next(".wp-editor-wrap").show(),jQuery(e).find(".message_form_layout:checked").is(":visible")||jQuery(e).find(".message_form_layout:visible").first().prop("checked",!0),jQuery(".message_form_layout").change()}function t(e,i,a){var r=Math.floor(Math.random()*(a-i+1))+i;return r==e?t(r,i,a):r}function i(){var e='<span><label class="options_header"><span id="valid-field"> </span></label> <input type="text" class="url_input_field" data-option="local_url" name="campaign_target_rules[local_urls][]" value="'+r+'*"/><span class="delete-url"></span></span>';return e}function a(){0==jQuery(".message-row").length?jQuery(".empty_campaign").show():jQuery(".empty_campaign").hide()}var r=icegram_writepanel_params.home_url;jQuery("#campaign_data").find("h3.hndle").hide(),jQuery(".target_rules_desc").appendTo("#campaign_target_rules h3.hndle span"),jQuery(document).ready(function(){var i=window.send_to_editor;jQuery("#postdivrich").hide(),jQuery(".color-field").wpColorPicker().each(function(e){var t=jQuery(this).data("color-label")||"";""!==t&&jQuery(this).closest(".wp-picker-container").find("a.wp-color-result").attr("title",t)}),jQuery("#campaign_data").on("change",".show_color_options",function(){jQuery(this).closest("p").next(".message_colors_options_container").toggle(!this.checked)}).change(),a(),jQuery(".message_edit:first").trigger("click"),this_data=jQuery(".message_type option:selected").closest(".message-setting-fields");for(var r=0;r<this_data.length;r++)e(this_data[r]);jQuery(".inside").on("change",".message_type",function(t){var i=jQuery(t.target).parents(".message-setting-fields");e(i)}),jQuery("#campaign_data, #message-settings").on("change",".message_theme",function(e){var t=jQuery(e.target).parents(".message-setting-fields"),i=jQuery(t).find(".message_type").val(),a=jQuery(t).find(".message_row.ig_"+i).find(".message_theme").val(),r=jQuery(t).find("#message_theme_ig_"+i).find("."+a).attr("style");jQuery(t).find(".message_row.ig_"+i).find(".message_theme").next().find(".chosen-single span").attr("style",r)}),jQuery("#campaign_data").on("click",".message_image_button",function(e){var t=this;return window.send_to_editor=function(e){imgurl=jQuery("img",e).attr("src"),jQuery(t).parent().find("#upload_image").val(imgurl),tb_remove(),window.send_to_editor=i},!1}),jQuery("#campaign_data ,#message-settings").on("click",".message_headline_button",function(){var e=jQuery(this).prev().attr("data-headline"),i=icegram_writepanel_params.available_headlines.length,a=t(e,0,i),r=icegram_writepanel_params.available_headlines[a];jQuery(this).prev().val(r)}),jQuery(".tips, .help_tip").tipTip({attribute:"data-tip"}),jQuery("span.test_class").hover(function(){jQuery(this).next().show()},function(){jQuery(this).next().hide()}),jQuery("#campaign_data .hndle, #campaign_data .handlediv").unbind("click"),jQuery("#campaign_data .handlediv").hide()}),jQuery("#campaign_data").on("click",".message_delete",function(){jQuery(this).parent().parent().next().remove(),jQuery(this).parent().parent().remove(),a()}),jQuery("#campaign_data").on("click",".message_edit",function(){jQuery(this).parent().parent().next().toggle(),jQuery(this).parent().parent().find(".message-title-text, .message-title-input").toggle()}),jQuery("#campaign_data").on("change",".message-title-input",function(){jQuery(this).prev().text(jQuery(this).val())}),jQuery("select.ajax_chosen_select_messages").ajaxChosen({type:"GET",url:icegram_writepanel_params.ajax_url,dataType:"json",afterTypeDelay:100,data:{action:"icegram_json_search_messages",security:icegram_writepanel_params.search_message_nonce}},function(e){var t={};return jQuery.each(e,function(e,i){t[e]=i}),t}),jQuery("#campaign_data").on("change",".show_form_options",function(e){var t=jQuery(this).closest("p");if(jQuery(t).siblings(".message_form_options").slideToggle(this.checked),this.checked)jQuery(t).siblings(".message_form_options").find(".message_form_layout").change();else{jQuery(t).siblings("p.cta-actions").find("select option").removeAttr("disabled");var i=jQuery(t).siblings(".message_form_options").siblings(".wp-editor-wrap").find(".wp-editor-area"),a=jQuery(i).val().trim().replace("[ig_form]","");jQuery(i).val(a)}}).change(),jQuery("#campaign_data, #message-settings").on("change",".message_form_style",function(e){var t=jQuery(e.target).parents(".message-setting-fields"),i=jQuery(t).find("#message_form_style").val(),a=jQuery(t).find("#message_form_style").find("."+i).attr("style");jQuery(t).find(".message_form_style").next().find(".chosen-single span").attr("style",a).text(function(){return jQuery(this).text().substr(0,jQuery(this).text().indexOf(" "))||jQuery(this).text()})}),jQuery("#campaign_data").on("change",".message_form_layout ",function(){if(jQuery(this).is(":visible")){var e=this,t=jQuery(this).closest(".message_form_options").siblings(".wp-editor-wrap").find(".wp-editor-area"),i=jQuery(t).val().trim();jQuery(e).closest(".form_radio_group").siblings(".form_inline_shortcode").hide(),jQuery(e).closest(".form_radio_group").siblings(".message_form_color").show(),jQuery(e).is(":checked")&&jQuery(e).closest(".message_form_options").prev("p.message_form_options_check").find(".show_form_options").is(":checked")&&("inline"==jQuery(e).val()?(-1==i.indexOf("[ig_form]")&&(i+="[ig_form]"),jQuery(e).closest(".form_radio_group").siblings(".message_form_color, .form_inline_shortcode").toggle()):"inline"!=jQuery(e).val()&&(i=i.replace("[ig_form]",""))),jQuery(t).val(i)}}),jQuery("#campaign_data").on("blur",".message_form_html_original",function(e){var t=this,i=jQuery("<div/>").html(jQuery(t).val()).find("input[type=submit], button, input[type=button]");if(jQuery(a).parent().find("p.cta-actions select option").removeAttr("disabled"),i.length>0){var a=jQuery(t).closest(".message_form_options"),r=jQuery(i[i.length-1]),s=r.is("button")?r.not("br, span, div").text():r.val();jQuery(a).siblings("p").find("#message_label").val(s.trim()),jQuery(a).parent().find("p.cta-actions select").find('option[value="url"], option[value="hide"], option[value="cta_another_message"]').attr("disabled",!0).attr("selected",!1).end().find('option[value="form"]').attr("selected",!0).trigger("change")}}),jQuery(".ajax_chosen_select_messages").chosen(),jQuery("#campaign_data").on("change",".ajax_chosen_select_messages",function(){var t=jQuery("#ig-tabs li.current").attr("variation_id"),i=jQuery.extend({},tinyMCEPreInit.mceInit.content),r=jQuery.extend({},tinyMCEPreInit.qtInit.content),s=jQuery(this).parent().siblings(".campaign_target_rules_panel"),n=jQuery(s).find(".message-row").length,o=jQuery(this).val();return""==o?void jQuery(".ajax_chosen_select_messages").val("").trigger("chosen:updated"):(jQuery(".message-edit-row").hide(),jQuery(".message-title-text").show(),jQuery(".message-title-input").hide(),void jQuery.ajax({type:"POST",url:icegram_writepanel_params.ajax_url,dataType:"json",data:{action:"get_message_action_row",message_id:o,row:n},success:function(o){if(n++,jQuery(s).find(".messages-list .messages_list_table tbody").append(o.main),jQuery(".color-field").wpColorPicker().each(function(e){var t=jQuery(this).data("color-label")||"";""!==t&&jQuery(this).closest(".wp-picker-container").find("a.wp-color-result").attr("title",t)}),jQuery("#campaign_data").on("change",".show_color_options",function(){jQuery(this).closest("p").next(".message_colors_options_container").toggle(!this.checked)}).change(),e(jQuery("#"+o.id)),jQuery(".ajax_chosen_select_messages").val("").trigger("chosen:updated"),jQuery("select.icegram_chosen_page").chosen({disable_search_threshold:10}),a(),jQuery(".message-setting-fields").trigger("change"),jQuery(".tips, .help_tip").tipTip({attribute:"data-tip"}),"undefined"==typeof tinyMCEPreInit.mceInit["edit"+o.id]){for(_prop in i)"string"==typeof i[_prop]&&"content_css"!==_prop&&(i[_prop]=i[_prop].replace(new RegExp("content","g"),"edit"+o.id));tinyMCEPreInit.mceInit["edit"+o.id]=i}if("undefined"==typeof tinyMCEPreInit.qtInit["edit"+o.id]){for(_prop in r)"string"==typeof r[_prop]&&"content_css"!==_prop&&(r[_prop]=r[_prop].replace(new RegExp("content","g"),"edit"+o.id));tinyMCEPreInit.qtInit["edit"+o.id]=r}tinyMCE.init({id:tinyMCEPreInit.mceInit["edit"+o.id]}),quicktags({id:"edit"+o.id}),QTags._buttonsInit(),jQuery("#wp-edit"+o.id+"-wrap").hasClass("tmce-active")?jQuery("#edit"+o.id+"-tmce").click():jQuery("#edit"+o.id+"-html").click(),"undefined"!=typeof t&&jQuery(window).trigger("icegram_tab_selected",[t])}}))}),jQuery("#campaign_target_rules").on("click","#add_local_url_row",function(e){e.preventDefault();var t=i();jQuery(".local_url").find(".url_input_field").length?jQuery(t).insertAfter(jQuery(".local_url").find(".url_input_field").last().parent("span")):jQuery(t).insertBefore(jQuery(".local_url").find("#add_local_url_row_label"))}),jQuery("#campaign_target_rules").on("click",".delete-url",function(e){jQuery(this).parent().remove()}),jQuery("select.ajax_chosen_select_messages").next("div").on("click","div.chosen-drop",function(){jQuery(this).closest("h3.hndle").trigger("click")}),jQuery("#campaign_data").on("click",".campaign_preview",function(e){jQuery(this).closest("h3.hndle").trigger("click"),0!=jQuery(".message-row").length&&(tinyMCE.triggerSave(),params=jQuery("#post").serializeArray(),params.push({name:"action",value:"save_campaign_preview"}),jQuery.ajax({type:"POST",async:!1,url:icegram_writepanel_params.ajax_url,data:params,success:function(e){""!=e&&window.open(e,"preview_window")}}))}),jQuery("select.icegram_chosen_page").chosen({disable_search_threshold:10}),jQuery("input#users_logged_in, input#users_all ,input#users_not_logged_in").on("change",function(){"logged_in"==jQuery(this).val()?(jQuery("select#users_roles").parent("p").show(),jQuery("#users_roles_chosen").find("input").trigger("click")):jQuery("select#users_roles").parent("p").hide()}),jQuery(".schedule_rule").on("change",function(){"when_schedule"==jQuery(this).attr("id")?jQuery("#date_picker").show():jQuery("#date_picker").hide()}),jQuery("input#where_other_page").on("change",function(){jQuery("select#where_page_id").parent("p").slideToggle(),jQuery(this).is(":checked")&&jQuery("#where_page_id_chosen").find("input").trigger("click")}),jQuery("input#where_sitewide").on("change",function(){jQuery("select#exclude_page_id").parent("p").slideToggle(),jQuery(this).is(":checked")&&jQuery("#exclude_page_id_chosen").find("input").trigger("click")}),jQuery("input#where_local_url").on("change",function(){jQuery(".local_url").slideToggle()}),jQuery(".date-picker").datepicker({dateFormat:"yy-mm-dd",defaultDate:0,showOtherMonths:!0,selectOtherMonths:!0,changeMonth:!0,changeYear:!0,showButtonPanel:!0}),jQuery("#campaign_target_rules").on("focusout","input.url_input_field",function(){var e=this;if(jQuery(e).parent().find("span#valid-field").removeClass("error"),"undefine"!==jQuery(e).data("option")&&"local_url"==jQuery(e).data("option")&&"*"!=jQuery(e).val()){var t=e.value;if(t.indexOf(r)<0)return void jQuery(e).val(r+t)}})});
|
assets/js/icegram.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
function Icegram(){}function Icegram_Message_Type(e){var e;this.root_container="#icegram_messages_container",this.data=e,this.type=e.type,this.data.delay_time=parseInt(this.data.delay_time),"string"!=typeof this.data.link||""==this.data.link||/^tel:/i.test(this.data.link)||/^https?:\/\//i.test(this.data.link)||(this.data.link="http://"+this.data.link),this.set_template(this.get_template_default()),this.init()}Icegram.prototype.init=function(e){if(void 0!=e){jQuery(window).trigger("preinit.icegram",[e]),this.data=e,this.defaults=jQuery.extend({},e.defaults),this.message_data=e.messages,this.messages,this.tracking_data=[],this.message_template_cache={},this.map_id_to_index={},this.map_type_to_index={},this.mode=void 0==window.ig_mode?"local":window.ig_mode,this.powered_by={link:"http://www.icegram.com/?utm_source=inapp&utm_campaign=poweredby&utm_medium="},this.powered_by.text=this.defaults.powered_by_text,this.powered_by.logo=this.defaults.powered_by_logo,jQuery("body").append('<div id="icegram_messages_container"></div>');this.messages=[];var t=this;this.message_data.length>0&&jQuery.each(this.message_data,function(e,i){try{if(-1==window.location.href.indexOf("campaign_preview_id")){if("yes"==i.retargeting&&1==jQuery.cookie("icegram_campaign_shown_"+i.id))return;if("yes"==i.retargeting_clicked&&1==jQuery.cookie("icegram_campaign_clicked_"+i.id))return}var a=null,r=i.type.split("-").join(" ").ucwords().split(" ").join("_");a="function"==typeof window["Icegram_Message_Type_"+r]?new window["Icegram_Message_Type_"+r](i):new Icegram_Message_Type(i),t.messages.push(a),t.map_id_to_index["_"+i.id]=e,t.map_type_to_index[i.type]=jQuery.isArray(t.map_type_to_index[i.type])?t.map_type_to_index[i.type]:new Array,t.map_type_to_index[i.type].push(e)}catch(o){}}),jQuery(window).unload(function(){"function"==typeof window.icegram.submit_tracking_data&&window.icegram.submit_tracking_data(!1)}),setInterval(function(){"function"==typeof window.icegram.submit_tracking_data&&window.icegram.submit_tracking_data(!0)},5e3),jQuery(window).trigger("init.icegram",[this])}},Icegram.prototype.timer_tick=function(){},Icegram.prototype.get_template_fn=function(e){return this.message_template_cache[e]},Icegram.prototype.set_template_fn=function(e,t){this.message_template_cache[e]=t},Icegram.prototype.get_message=function(e){return this.messages.length>e?this.messages[e]:void 0},Icegram.prototype.get_message_by_id=function(e){if(this.map_id_to_index.hasOwnProperty("_"+e)){var t=this.map_id_to_index["_"+e];return this.get_message(t)}return void 0},Icegram.prototype.get_messages_by_type=function(e){if(this.map_type_to_index.hasOwnProperty(e)){var t=this.map_type_to_index[e],i=[];if(jQuery.isArray(t)){var a=this;jQuery.each(t,function(e,t){i.push(a.get_message(t))})}return i}return void 0},Icegram.prototype.get_powered_by=function(e){var t=jQuery.extend({},this.powered_by);return t.link=t.link+(e||""),t},Icegram.prototype.track=function(e,t){"object"==typeof t&&t.hasOwnProperty("message_id")&&t.hasOwnProperty("campaign_id")&&(jQuery(window).trigger("track.icegram",[e,t]),this.tracking_data.push({type:e,params:t}))},Icegram.prototype.submit_tracking_data=function(e){if(this.tracking_data.length>0&&-1==window.location.href.indexOf("campaign_preview_id")){var t={type:"POST",url:this.data.ajax_url,async:e||!1,data:{action:"icegram_event_track",event_data:JSON.parse(JSON.stringify(this.tracking_data)),ig_remote_url:"remote"==this.mode?window.location.href:void 0},success:function(e,t,i){},error:function(e,t,i){}};"remote"==this.mode&&(t.xhrFields={withCredentials:!0},t.crossDomain=!0,t.async=!0),jQuery.ajax(t),this.tracking_data=[]}},Icegram_Message_Type.prototype.init=function(){this.render(),this.add_event_handlers()},Icegram_Message_Type.prototype.add_event_handlers=function(){this.el.on("click",{self:this},this.on_click),jQuery(window).on("resize",{self:this},this.on_resize)},Icegram_Message_Type.prototype.render=function(){this.pre_render();var e=this.render_template();try{jQuery(this.root_container).append(e)}catch(t){}this.dom_id="icegram_message_"+this.data.id,this.el=jQuery("#"+this.dom_id),this.set_position();var i=window.icegram.get_powered_by(this.type);if(i.hasOwnProperty("link")&&i.hasOwnProperty("text")&&""!=i.text&&this.add_powered_by(i),(void 0==this.data.headline||""==this.data.headline)&&this.el.find(".ig_headline").hide(),(void 0==this.data.icon||""==this.data.icon)&&this.el.find(".ig_icon").remove(),(void 0==this.data.message||""==this.data.message)&&this.el.find(".ig_message").hide(),(void 0==this.data.label||""==this.data.label)&&this.el.find(".ig_button").hide(),-1===jQuery.inArray(this.data.type,["toast","badge","ribbon","exit-redirect"])){var a=null,r=this.data.form_layout,o=this.data.form_has_label,s=this.data.form_style||"none",n=this.data.label||"Submit";if(s=s.toLowerCase().replace(" ","_"),void 0!=this.data.use_form&&"yes"==this.data.use_form&&(a=this.data.form_html),this.el.find("form.ig_embed_form").length>0){var _=this.el.find("form.ig_embed_form");r="inline",-1===jQuery.inArray(this.data.type,["messenger","tab","sidebar","interstitial","sticky"])&&(_.hasClass("ig_left")?r="left":_.hasClass("ig_right")&&(r="right")),"inline"==r&&this.el.find("form.ig_embed_form").replaceWith('<div class="ig_form_container layout_inline"></div>'),o=_.find(".ig_form_el_group label").length>0?"yes":void 0,0==_.find(".ig_button").length&&0==_.find("button[type=submit]").length&&_.append('<input class="ig_button" type="submit" value="'+n+'">'),a=jQuery("<div/>").append(_).html()}if(null==a)this.el.find(".ig_form_container").remove();else{var d=window.icegram.formProcess(this,a);if(d){var l=void 0!=this.data.form_header&&""!=this.data.form_header?'<div class="ig_form_header">'+this.data.form_header+"</div>":"",c=void 0!=this.data.form_footer&&""!=this.data.form_footer?'<div class="ig_form_footer">'+this.data.form_footer+"</div>":"";this.el.find(".ig_form_container").append(l).append(d).append(c),void 0==o?this.el.find(".ig_el_label").not("span.ig_el_label").remove():(this.el.find("input, textarea").removeAttr("placeholder"),this.el.find("select option.ig_el_placeholder").remove()),this.el.find(".ig_form_container .ig_button").length>0&&(this.el.find(".ig_button").not(".ig_form_container .ig_button").hide(),this.el.find(".ig_button").val(n)),this.el.addClass("ig_form_"+r);var p="";void 0!=this.data.form_bg_color&&""!=this.data.form_bg_color?(this.el.find(".ig_form_container").css("background-color",this.data.form_bg_color),p+=".ig_form_"+r+".ig_form_"+s+" .ig_form_container:before{ background-color:"+this.data.form_bg_color+"; border-color:"+this.data.form_bg_color+";}"):p+=".ig_form_"+r+".ig_form_"+s+" .ig_form_container:before{ display:none;}",void 0!=this.data.form_text_color&&""!=this.data.form_text_color&&this.el.find(".ig_form_container").css("color",this.data.form_text_color),"none"!=s&&this.el.addClass("ig_form_"+s).find(".ig_form_container").prepend('<style type="text/css">'+p+"</style>")}}}if(void 0==this.data.use_theme_defaults||"yes"!=this.data.use_theme_defaults){if(void 0!=this.data.text_color&&""!=this.data.text_color&&(this.el.css("color",this.data.text_color),this.el.find(".ig_container").css("color",this.data.text_color)),void 0!=this.data.bg_color&&""!=this.data.bg_color&&(this.el.css("background-color",this.data.bg_color),this.el.find(".ig_container").css("background-color",this.data.bg_color)),void 0!=this.data.cta_bg_color&&""!=this.data.cta_bg_color){this.el.find('.ig_button, form input[type="submit"]').css("background-color",this.data.cta_bg_color);var g=window.icegram.hexToHsl(this.data.cta_bg_color);this.el.find('.ig_button, form input[type="submit"]').css("border-color","hsl("+g.h+","+(g.s-5)+"%,"+(g.l-8)+"%)")}void 0!=this.data.cta_text_color&&""!=this.data.cta_text_color&&this.el.find('.ig_button, form input[type="submit"]').css("color",this.data.cta_text_color)}"string"==typeof this.data.link&&""!=this.data.link&&this.el.parent().find(".ig_cta, .ig_button").css("cursor","pointer"),this.post_render(),this.hide({},!0),this.set_up_show_trigger()},Icegram.prototype.formProcess=function(e,t){var i=jQuery("<div/>").html(t).find("input, label, select, textarea, button").not("br");if(i.length>0){var a=jQuery('<div class="ig_embed_form_container ig_clear_fix"></div>'),r=jQuery("<div/>").html(t).find("form").removeAttr("class").removeAttr("style").addClass("ig_clear_fix").empty(),o=".",s=0;jQuery.each(i,function(e,t){var i=jQuery(t),r=jQuery('<div class="ig_form_els"></div>');if(i.removeAttr("class").removeAttr("style"),(-1==i.attr("tabindex")||"_mc4wp_required_but_not_really"==i.attr("name"))&&(i.addClass("ig_detected_bot_fields"),s--),"hidden"==i.attr("type")&&(i.addClass("ig_detected_hidden_fields"),s--),i.is("label"))o=i.not("input, select, textarea, button, span, br").text().replace(/\s+/g," ")||".";else if((i.is("input")||i.is("button")||i.is("textarea")||i.is("select"))&&!i.is("input[type=radio]")){if(i.removeAttr("id"),i.is("button")){var n=i.not("br, span, div").text().trim()||"";i.remove(),i=jQuery('<input type="submit" value="'+n+'">')}(i.is("input[type=submit]")||i.is("input[type=button]"))&&i.addClass("ig_button"),label_class="ig_el_label ig_button_label","."!=o&&(label_class="ig_el_label",i.is("select")?jQuery('<option class="ig_el_placeholder">'+o+"</option>").prependTo(i):i.attr("placeholder",o)),jQuery('<label class="'+label_class+'">'+o+"</label>").appendTo(r),o=".",r.append(i),a.append(r),s++}else i.is("input[type=radio]")&&(label_class="ig_el_label ig_button_label","."!=o&&(label_class="ig_el_label"),jQuery('<label><span class="'+label_class+'">'+o+"</span></label>").prepend(i).appendTo(r),o=".",r.addClass("ig_form_el_radio"),a.append(r),s++)});var n=["","ig_full","ig_half","ig_third","ig_quater"];return s=4>s?s:4,a.find(".ig_detected_bot_fields").length<=0&&a.append('<div class="ig_form_els"><input class="ig_detected_bot_fields" type="text" tabindex="-1"></input></div>'),a.addClass(n[s]).find(".ig_detected_bot_fields").parent().css({position:"absolute",left:"-5000px"}).end().end().find(".ig_detected_hidden_fields").parent().css({display:"none"}),r.append(a),jQuery("<div/>").append(r).html()}return null},Icegram_Message_Type.prototype.render_template=function(){return"function"!=typeof window.icegram.get_template_fn(this.type)&&window.icegram.set_template_fn(this.type,new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+this.template.replace(/[\r\t\n]/g," ").split("{{").join(" ").replace(/((^|\}\})[^\t]*)'/g,"$1\r").replace(/\t=(.*?)\}\}/g,"',$1,'").split(" ").join("');").split("}}").join("p.push('").split("\r").join("\\'")+"');}return p.join('');")),window.icegram.get_template_fn(this.type)(this.data)},Icegram_Message_Type.prototype.pre_render=function(){},Icegram_Message_Type.prototype.post_render=function(){},Icegram_Message_Type.prototype.set_up_show_trigger=function(){if(isNaN(this.data.delay_time))this.show();else if(this.data.delay_time>=0){var e=this;this.timer=setTimeout(function(){e.show()},1e3*this.data.delay_time)}},Icegram_Message_Type.prototype.set_template=function(e){this.template=e},Icegram_Message_Type.prototype.get_template_default=function(){return'<div id="icegram_message_{{=id}}" class="icegram"><div class="ig_headline">{{=headline}}</div></div>'},Icegram_Message_Type.prototype.show=function(e,t){this.is_visible()||(this.el.show(e),t!==!0&&this.track("shown"));var i=this;window.icegram.adjustFormContainerHeight(i)},Icegram_Message_Type.prototype.hide=function(e,t){this.is_visible()&&(this.el.hide(e),t!==!0&&this.track("closed"))},Icegram_Message_Type.prototype.set_position=function(){},Icegram_Message_Type.prototype.add_powered_by=function(e){},Icegram_Message_Type.prototype.track=function(e,t){"function"==typeof window.icegram.track&&(t=t||{},jQuery.extend(t,{message_id:this.data.id,campaign_id:this.data.campaign_id,expiry_time:this.data.expiry_time,expiry_time_clicked:this.data.expiry_time_clicked}),window.icegram.track(e,t))},Icegram_Message_Type.prototype.is_visible=function(){return this.el.is(":visible")},Icegram_Message_Type.prototype.toggle=function(e){this.is_visible()?this.hide(e):this.show(e)},Icegram_Message_Type.prototype.on_click=function(e){if(e.data=e.data||{self:this},jQuery(e.target).filter(".ig_close").length)return void e.data.self.hide();var t=jQuery(e.target).closest(".icegram").find("form:visible").first();(jQuery(e.target).filter(".ig_button, .ig_cta ,:submit").length||jQuery(e.target).parents(".ig_button, .ig_cta ").length&&!(t.find("ig_button").length>0||t.find("input[type=button]").length>0||t.find("input[type=submit]").length>0))&&e.data.self.on_cta_click(e)},Icegram_Message_Type.prototype.on_resize=function(e){},Icegram_Message_Type.prototype.on_cta_click=function(e){e.data=e.data||{self:this},e.data.self.track("clicked");var t=jQuery(e.target).closest(".icegram").find("form:visible").first();return""!==jQuery(t).find(".ig_detected_bot_fields").val()?(e.preventDefault(),void e.data.self.hide()):void(jQuery(t).length&&""===jQuery(t).find(".ig_detected_bot_fields").val()?jQuery(t).submit():"string"==typeof e.data.self.data.link&&""!=e.data.self.data.link?window.location.href=e.data.self.data.link:e.data.self.data.hide!==!1&&e.data.self.hide())},String.prototype.ucwords=function(){return this.toLowerCase().replace(/\b[a-z]/g,function(e){return e.toUpperCase()})},Icegram.prototype.adjustFormContainerHeight=function(e){var t="";if(e.el.hasClass("ig_form_left")||e.el.hasClass("ig_form_right")){t=e.el.hasClass("ig_form_left")?"left":"right";var i=e.el.find(".ig_data").outerHeight()>e.el.find(".ig_form_container.layout_"+t).outerHeight()?e.el.find(".ig_data").outerHeight():e.el.find(".ig_form_container.layout_"+t).outerHeight();e.el.find(".ig_form_container").outerHeight(i)}if(e.el.hasClass("ig_form_bottom")||e.el.hasClass("ig_form_inline")){t=e.el.hasClass("ig_form_bottom")?"bottom":"inline";var i=e.el.find(".ig_form_container.layout_"+t+" .ig_button").innerHeight()>e.el.find(".ig_form_container input").first().outerHeight()?e.el.find(".ig_form_container.layout_"+t+" .ig_button").innerHeight():e.el.find(".ig_form_container input").first().outerHeight();e.el.find(".ig_form_container input, .ig_form_container select, .ig_form_container textarea").not(".ig_form_container.layout_"+t+" .ig_button, .ig_form_el_radio input").outerHeight(i)}},Icegram.prototype.hexToRgb=function(e){var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null},Icegram.prototype.rgbToHsl=function(e,t,i){e/=255,t/=255,i/=255;var a,r,o=Math.max(e,t,i),s=Math.min(e,t,i),n=(o+s)/2;if(o==s)a=r=0;else{var _=o-s;switch(r=n>.5?_/(2-o-s):_/(o+s),o){case e:a=(t-i)/_;break;case t:a=(i-e)/_+2;break;case i:a=(e-t)/_+4}n=Math.floor(100*n),r=Math.floor(100*r),a=Math.floor(60*a),0>a&&(a+=360)}return{h:a,s:r,l:n}},Icegram.prototype.hexToHsl=function(e){var t=window.icegram.hexToRgb(e);return window.icegram.rgbToHsl(t.r,t.g,t.b)},"function"!=typeof Object.create&&!function(){var e=function(){};Object.create=function(t){if(arguments.length>1)throw Error("Second argument not supported");if(null===t)throw Error("Cannot set a null [[Prototype]]");if("object"!=typeof t)throw TypeError("Argument must be an object");return e.prototype=t,new e}}(),void 0!==typeof jQuery.cookie&&!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e("object"==typeof exports?require("jquery"):jQuery)}(function(e){function t(e){return n.raw?e:encodeURIComponent(e)}function i(e){return n.raw?e:decodeURIComponent(e)}function a(e){return t(n.json?JSON.stringify(e):String(e))}function r(e){0===e.indexOf('"')&&(e=e.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return e=decodeURIComponent(e.replace(s," ")),n.json?JSON.parse(e):e}catch(t){}}function o(t,i){var a=n.raw?t:r(t);return e.isFunction(i)?i(a):a}var s=/\+/g,n=e.cookie=function(r,s,_){if(void 0!==s&&!e.isFunction(s)){if(_=e.extend({},n.defaults,_),"number"==typeof _.expires){var d=_.expires,l=_.expires=new Date;l.setTime(+l+864e5*d)}return document.cookie=[t(r),"=",a(s),_.expires?"; expires="+_.expires.toUTCString():"",_.path?"; path="+_.path:"",_.domain?"; domain="+_.domain:"",_.secure?"; secure":""].join("")}for(var c=r?void 0:{},p=document.cookie?document.cookie.split("; "):[],g=0,h=p.length;h>g;g++){var f=p[g].split("="),m=i(f.shift()),u=f.join("=");if(r&&r===m){c=o(u,s);break}r||void 0===(u=o(u))||(c[m]=u)}return c};n.defaults={},e.removeCookie=function(t,i){return void 0===e.cookie(t)?!1:(e.cookie(t,"",e.extend({},i,{expires:-1})),!e.cookie(t))}});
|
1 |
+
function Icegram(){}function Icegram_Message_Type(e){var e;this.root_container="#icegram_messages_container",this.data=e,this.type=e.type,this.data.delay_time=parseInt(this.data.delay_time),"string"!=typeof this.data.link||""==this.data.link||/^tel:/i.test(this.data.link)||/^https?:\/\//i.test(this.data.link)||(this.data.link="http://"+this.data.link),this.set_template(this.get_template_default()),this.init()}Icegram.prototype.init=function(e){if(void 0!=e){jQuery(window).trigger("preinit.icegram",[e]),this.data=e,this.defaults=jQuery.extend({},e.defaults),this.message_data=e.messages,this.messages,this.tracking_data=[],this.message_template_cache={},this.map_id_to_index={},this.map_type_to_index={},this.mode=void 0==window.ig_mode?"local":window.ig_mode,this.powered_by={link:"http://www.icegram.com/?utm_source=inapp&utm_campaign=poweredby&utm_medium="},this.powered_by.text=this.defaults.powered_by_text,this.powered_by.logo=this.defaults.powered_by_logo,jQuery("body").append('<div id="icegram_messages_container"></div>');this.messages=[];var t=this;this.message_data.length>0&&jQuery.each(this.message_data,function(e,i){try{if(-1==window.location.href.indexOf("campaign_preview_id")){if("yes"==i.retargeting&&1==jQuery.cookie("icegram_campaign_shown_"+i.id))return;if("yes"==i.retargeting_clicked&&1==jQuery.cookie("icegram_campaign_clicked_"+i.id))return}var a=null,r=i.type.split("-").join(" ").ucwords().split(" ").join("_");a="function"==typeof window["Icegram_Message_Type_"+r]?new window["Icegram_Message_Type_"+r](i):new Icegram_Message_Type(i),t.messages.push(a),t.map_id_to_index["_"+i.id]=e,t.map_type_to_index[i.type]=jQuery.isArray(t.map_type_to_index[i.type])?t.map_type_to_index[i.type]:new Array,t.map_type_to_index[i.type].push(e)}catch(o){}}),jQuery(window).unload(function(){"function"==typeof window.icegram.submit_tracking_data&&window.icegram.submit_tracking_data(!1)}),setInterval(function(){"function"==typeof window.icegram.submit_tracking_data&&window.icegram.submit_tracking_data(!0)},5e3),jQuery(window).trigger("init.icegram",[this])}},Icegram.prototype.timer_tick=function(){},Icegram.prototype.get_template_fn=function(e){return this.message_template_cache[e]},Icegram.prototype.set_template_fn=function(e,t){this.message_template_cache[e]=t},Icegram.prototype.get_message=function(e){return this.messages.length>e?this.messages[e]:void 0},Icegram.prototype.get_message_by_id=function(e){if(this.map_id_to_index.hasOwnProperty("_"+e)){var t=this.map_id_to_index["_"+e];return this.get_message(t)}return void 0},Icegram.prototype.get_messages_by_type=function(e){if(this.map_type_to_index.hasOwnProperty(e)){var t=this.map_type_to_index[e],i=[];if(jQuery.isArray(t)){var a=this;jQuery.each(t,function(e,t){i.push(a.get_message(t))})}return i}return void 0},Icegram.prototype.get_powered_by=function(e){var t=jQuery.extend({},this.powered_by);return t.link=t.link+(e||""),t},Icegram.prototype.track=function(e,t){"object"==typeof t&&t.hasOwnProperty("message_id")&&t.hasOwnProperty("campaign_id")&&(jQuery(window).trigger("track.icegram",[e,t]),this.tracking_data.push({type:e,params:t}))},Icegram.prototype.submit_tracking_data=function(e){if(this.tracking_data.length>0&&-1==window.location.href.indexOf("campaign_preview_id")){var t={type:"POST",url:this.data.ajax_url,async:e||!1,data:{action:"icegram_event_track",event_data:JSON.parse(JSON.stringify(this.tracking_data)),ig_remote_url:"remote"==this.mode?window.location.href:void 0},success:function(e,t,i){},error:function(e,t,i){}};"remote"==this.mode&&(t.xhrFields={withCredentials:!0},t.crossDomain=!0,t.async=!0),jQuery.ajax(t),this.tracking_data=[]}},Icegram_Message_Type.prototype.init=function(){this.render(),this.add_event_handlers()},Icegram_Message_Type.prototype.add_event_handlers=function(){this.el.on("click",{self:this},this.on_click),jQuery(window).on("resize",{self:this},this.on_resize)},Icegram_Message_Type.prototype.render=function(){this.pre_render();var e=this.render_template();try{jQuery(this.root_container).append(e)}catch(t){}this.dom_id="icegram_message_"+this.data.id,this.el=jQuery("#"+this.dom_id),this.set_position();var i=window.icegram.get_powered_by(this.type);if(i.hasOwnProperty("link")&&i.hasOwnProperty("text")&&""!=i.text&&this.add_powered_by(i),(void 0==this.data.headline||""==this.data.headline)&&this.el.find(".ig_headline").hide(),(void 0==this.data.icon||""==this.data.icon)&&this.el.find(".ig_icon").remove(),(void 0==this.data.message||""==this.data.message)&&this.el.find(".ig_message").hide(),(void 0==this.data.label||""==this.data.label)&&this.el.find(".ig_button").hide(),-1===jQuery.inArray(this.data.type,["toast","badge","ribbon","exit-redirect"])){var a=null,r=this.data.form_layout,o=this.data.form_has_label,s=this.data.form_style||"none",n=this.data.label||"Submit";if(s=s.toLowerCase().replace(" ","_"),void 0!=this.data.use_form&&"yes"==this.data.use_form&&(a=this.data.form_html),this.el.find("form.ig_embed_form").length>0){var _=this.el.find("form.ig_embed_form");r="inline",-1===jQuery.inArray(this.data.type,["messenger","tab","sidebar","interstitial","sticky"])&&(_.hasClass("ig_left")?r="left":_.hasClass("ig_right")&&(r="right")),"inline"==r&&this.el.find("form.ig_embed_form").replaceWith('<div class="ig_form_container layout_inline"></div>'),o=_.find(".ig_form_el_group label").length>0?"yes":void 0,0==_.find(".ig_button").length&&0==_.find("button[type=submit]").length&&_.append('<input class="ig_button" type="submit" value="'+n+'">'),a=jQuery("<div/>").append(_).html()}if(null==a)this.el.find(".ig_form_container").remove();else{var d=window.icegram.formProcess(this,a);if(d){var l=void 0!=this.data.form_header&&""!=this.data.form_header?'<div class="ig_form_header">'+this.data.form_header+"</div>":"",c=void 0!=this.data.form_footer&&""!=this.data.form_footer?'<div class="ig_form_footer">'+this.data.form_footer+"</div>":"";this.el.find(".ig_form_container").append(l).append(d).append(c),void 0==o?this.el.find(".ig_el_label").not("span.ig_el_label").remove():(this.el.find("input, textarea").removeAttr("placeholder"),this.el.find("select option.ig_el_placeholder").remove()),this.el.find(".ig_form_container .ig_button").length>0&&(this.el.find(".ig_button").not(".ig_form_container .ig_button").hide(),this.el.find(".ig_button").val(n)),this.el.addClass("ig_form_"+r);var p="";void 0!=this.data.form_bg_color&&""!=this.data.form_bg_color?(this.el.find(".ig_form_container").css("background-color",this.data.form_bg_color),p+=".ig_form_"+r+".ig_form_"+s+" .ig_form_container:before{ background-color:"+this.data.form_bg_color+"; border-color:"+this.data.form_bg_color+";}"):p+=".ig_form_"+r+".ig_form_"+s+" .ig_form_container:before{ display:none;}",void 0!=this.data.form_text_color&&""!=this.data.form_text_color&&this.el.find(".ig_form_container").css("color",this.data.form_text_color),"none"!=s&&this.el.addClass("ig_form_"+s).find(".ig_form_container").prepend('<style type="text/css">'+p+"</style>")}}}if(void 0==this.data.use_theme_defaults||"yes"!=this.data.use_theme_defaults){if(void 0!=this.data.text_color&&""!=this.data.text_color&&(this.el.css("color",this.data.text_color),this.el.find(".ig_container").css("color",this.data.text_color)),void 0!=this.data.bg_color&&""!=this.data.bg_color&&(this.el.css("background-color",this.data.bg_color),this.el.find(".ig_container").css("background-color",this.data.bg_color)),void 0!=this.data.cta_bg_color&&""!=this.data.cta_bg_color){this.el.find('.ig_button, form input[type="submit"]').css("background-color",this.data.cta_bg_color);var g=window.icegram.hexToHsl(this.data.cta_bg_color);this.el.find('.ig_button, form input[type="submit"]').css("border-color","hsl("+g.h+","+(g.s-5)+"%,"+(g.l-8)+"%)")}void 0!=this.data.cta_text_color&&""!=this.data.cta_text_color&&this.el.find('.ig_button, form input[type="submit"]').css("color",this.data.cta_text_color)}"string"==typeof this.data.link&&""!=this.data.link&&this.el.parent().find(".ig_cta, .ig_button").css("cursor","pointer"),this.post_render(),this.hide({},!0),this.set_up_show_trigger()},Icegram.prototype.formProcess=function(e,t){var i=jQuery("<div/>").html(t).find("input, label, select, textarea, button").not("br");if(i.length>0){var a=jQuery('<div class="ig_embed_form_container ig_clear_fix"></div>'),r=jQuery("<div/>").html(t).find("form").removeAttr("class").removeAttr("style").addClass("ig_clear_fix").empty(),o=".",s=0;jQuery.each(i,function(e,t){var i=jQuery(t),r=jQuery('<div class="ig_form_els"></div>');if(i.removeAttr("class").removeAttr("style"),(-1==i.attr("tabindex")||"_mc4wp_required_but_not_really"==i.attr("name"))&&(i.addClass("ig_detected_bot_fields"),s--),"hidden"==i.attr("type")&&(i.addClass("ig_detected_hidden_fields"),s--),i.is("label"))o=i.not("input, select, textarea, button, span, br").text().replace(/\s+/g," ")||".";else if((i.is("input")||i.is("button")||i.is("textarea")||i.is("select"))&&!i.is("input[type=radio]")){if(i.removeAttr("id"),i.is("button")){var n=i.not("br, span, div").text().trim()||"";i.remove(),i=jQuery('<input type="submit" value="'+n+'">')}(i.is("input[type=submit]")||i.is("input[type=button]"))&&i.addClass("ig_button"),label_class="ig_el_label ig_button_label","."!=o&&(label_class="ig_el_label",i.is("select")?jQuery('<option class="ig_el_placeholder">'+o+"</option>").prependTo(i):i.attr("placeholder",o)),jQuery('<label class="'+label_class+'">'+o+"</label>").appendTo(r),o=".",r.append(i),a.append(r),s++}else i.is("input[type=radio]")&&(label_class="ig_el_label ig_button_label","."!=o&&(label_class="ig_el_label"),jQuery('<label><span class="'+label_class+'">'+o+"</span></label>").prepend(i).appendTo(r),o=".",r.addClass("ig_form_el_radio"),a.append(r),s++)});var n=["","ig_full","ig_half","ig_third","ig_quater"];return s=4>s?s:4,a.find(".ig_detected_bot_fields").length<=0&&a.append('<div class="ig_form_els"><input class="ig_detected_bot_fields" type="text" tabindex="-1"></input></div>'),a.addClass(n[s]).find(".ig_detected_bot_fields").parent().css({position:"absolute",left:"-5000px"}).end().end().find(".ig_detected_hidden_fields").parent().css({display:"none"}),r.append(a),jQuery("<div/>").append(r).html()}return null},Icegram_Message_Type.prototype.render_template=function(){return"function"!=typeof window.icegram.get_template_fn(this.type)&&window.icegram.set_template_fn(this.type,new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+this.template.replace(/[\r\t\n]/g," ").split("{{").join(" ").replace(/((^|\}\})[^\t]*)'/g,"$1\r").replace(/\t=(.*?)\}\}/g,"',$1,'").split(" ").join("');").split("}}").join("p.push('").split("\r").join("\\'")+"');}return p.join('');")),window.icegram.get_template_fn(this.type)(this.data)},Icegram_Message_Type.prototype.pre_render=function(){},Icegram_Message_Type.prototype.post_render=function(){},Icegram_Message_Type.prototype.set_up_show_trigger=function(){if(isNaN(this.data.delay_time))this.show();else if(this.data.delay_time>=0){var e=this;this.timer=setTimeout(function(){e.show()},1e3*this.data.delay_time)}},Icegram_Message_Type.prototype.set_template=function(e){this.template=e},Icegram_Message_Type.prototype.get_template_default=function(){return'<div id="icegram_message_{{=id}}" class="icegram"><div class="ig_headline">{{=headline}}</div></div>'},Icegram_Message_Type.prototype.show=function(e,t){this.is_visible()||(this.el.show(e),t!==!0&&this.track("shown"));var i=this;window.icegram.adjustFormContainerHeight(i)},Icegram_Message_Type.prototype.hide=function(e,t){this.is_visible()&&(this.el.hide(e),t!==!0&&this.track("closed"))},Icegram_Message_Type.prototype.set_position=function(){},Icegram_Message_Type.prototype.add_powered_by=function(e){},Icegram_Message_Type.prototype.track=function(e,t){"function"==typeof window.icegram.track&&(t=t||{},jQuery.extend(t,{message_id:this.data.id,campaign_id:this.data.campaign_id,expiry_time:this.data.expiry_time,expiry_time_clicked:this.data.expiry_time_clicked}),window.icegram.track(e,t))},Icegram_Message_Type.prototype.is_visible=function(){return this.el.is(":visible")},Icegram_Message_Type.prototype.toggle=function(e){this.is_visible()?this.hide(e):this.show(e)},Icegram_Message_Type.prototype.on_click=function(e){if(e.data=e.data||{self:this},jQuery(e.target).filter(".ig_close").length)return void e.data.self.hide();var t=jQuery(e.target).closest(".icegram").find("form:visible").first();(jQuery(e.target).filter(".ig_button, .ig_cta ,:submit").length||jQuery(e.target).parents(".ig_button, .ig_cta ").length&&!(t.find("ig_button").length>0||t.find("input[type=button]").length>0||t.find("input[type=submit]").length>0))&&e.data.self.on_cta_click(e)},Icegram_Message_Type.prototype.on_resize=function(e){},Icegram_Message_Type.prototype.on_cta_click=function(e){e.data=e.data||{self:this},e.data.self.track("clicked");var t=jQuery(e.target).closest(".icegram").find("form:visible").first();return jQuery(t).length&&jQuery(t).find(".ig_detected_bot_fields").length&&""!==jQuery(t).find(".ig_detected_bot_fields").val()?(e.preventDefault(),void e.data.self.hide()):void(jQuery(t).length?jQuery(t).submit():"string"==typeof e.data.self.data.link&&""!=e.data.self.data.link?window.location.href=e.data.self.data.link:e.data.self.data.hide!==!1&&e.data.self.hide())},String.prototype.ucwords=function(){return this.toLowerCase().replace(/\b[a-z]/g,function(e){return e.toUpperCase()})},Icegram.prototype.adjustFormContainerHeight=function(e){var t="";if(e.el.hasClass("ig_form_left")||e.el.hasClass("ig_form_right")){t=e.el.hasClass("ig_form_left")?"left":"right";var i=e.el.find(".ig_data").outerHeight()>e.el.find(".ig_form_container.layout_"+t).outerHeight()?e.el.find(".ig_data").outerHeight():e.el.find(".ig_form_container.layout_"+t).outerHeight();e.el.find(".ig_form_container").outerHeight(i)}if(e.el.hasClass("ig_form_bottom")||e.el.hasClass("ig_form_inline")){t=e.el.hasClass("ig_form_bottom")?"bottom":"inline";var i=e.el.find(".ig_form_container.layout_"+t+" .ig_button").innerHeight()>e.el.find(".ig_form_container input").first().outerHeight()?e.el.find(".ig_form_container.layout_"+t+" .ig_button").innerHeight():e.el.find(".ig_form_container input").first().outerHeight();e.el.find(".ig_form_container input, .ig_form_container select, .ig_form_container textarea").not(".ig_form_container.layout_"+t+" .ig_button, .ig_form_el_radio input").outerHeight(i)}},Icegram.prototype.hexToRgb=function(e){var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null},Icegram.prototype.rgbToHsl=function(e,t,i){e/=255,t/=255,i/=255;var a,r,o=Math.max(e,t,i),s=Math.min(e,t,i),n=(o+s)/2;if(o==s)a=r=0;else{var _=o-s;switch(r=n>.5?_/(2-o-s):_/(o+s),o){case e:a=(t-i)/_;break;case t:a=(i-e)/_+2;break;case i:a=(e-t)/_+4}n=Math.floor(100*n),r=Math.floor(100*r),a=Math.floor(60*a),0>a&&(a+=360)}return{h:a,s:r,l:n}},Icegram.prototype.hexToHsl=function(e){var t=window.icegram.hexToRgb(e);return window.icegram.rgbToHsl(t.r,t.g,t.b)},"function"!=typeof Object.create&&!function(){var e=function(){};Object.create=function(t){if(arguments.length>1)throw Error("Second argument not supported");if(null===t)throw Error("Cannot set a null [[Prototype]]");if("object"!=typeof t)throw TypeError("Argument must be an object");return e.prototype=t,new e}}(),void 0!==typeof jQuery.cookie&&!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e("object"==typeof exports?require("jquery"):jQuery)}(function(e){function t(e){return n.raw?e:encodeURIComponent(e)}function i(e){return n.raw?e:decodeURIComponent(e)}function a(e){return t(n.json?JSON.stringify(e):String(e))}function r(e){0===e.indexOf('"')&&(e=e.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return e=decodeURIComponent(e.replace(s," ")),n.json?JSON.parse(e):e}catch(t){}}function o(t,i){var a=n.raw?t:r(t);return e.isFunction(i)?i(a):a}var s=/\+/g,n=e.cookie=function(r,s,_){if(void 0!==s&&!e.isFunction(s)){if(_=e.extend({},n.defaults,_),"number"==typeof _.expires){var d=_.expires,l=_.expires=new Date;l.setTime(+l+864e5*d)}return document.cookie=[t(r),"=",a(s),_.expires?"; expires="+_.expires.toUTCString():"",_.path?"; path="+_.path:"",_.domain?"; domain="+_.domain:"",_.secure?"; secure":""].join("")}for(var c=r?void 0:{},p=document.cookie?document.cookie.split("; "):[],g=0,h=p.length;h>g;g++){var f=p[g].split("="),m=i(f.shift()),u=f.join("=");if(r&&r===m){c=o(u,s);break}r||void 0===(u=o(u))||(c[m]=u)}return c};n.defaults={},e.removeCookie=function(t,i){return void 0===e.cookie(t)?!1:(e.cookie(t,"",e.extend({},i,{expires:-1})),!e.cookie(t))}});
|
icegram.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Icegram
|
4 |
* Plugin URI: http://www.icegram.com/
|
5 |
* Description: All in one solution to inspire, convert and engage your audiences. Action bars, Popup windows, Messengers, Toast notifications and more. Awesome themes and powerful rules.
|
6 |
-
* Version: 1.9.
|
7 |
* Author: icegram
|
8 |
* Author URI: http://www.icegram.com/
|
9 |
*
|
@@ -35,7 +35,7 @@ class Icegram {
|
|
35 |
|
36 |
function __construct() {
|
37 |
|
38 |
-
$this->version = "1.9.
|
39 |
$this->shortcode_instances = array();
|
40 |
$this->mode = 'local';
|
41 |
$this->plugin_url = untrailingslashit( plugins_url( '/', __FILE__ ) );
|
3 |
* Plugin Name: Icegram
|
4 |
* Plugin URI: http://www.icegram.com/
|
5 |
* Description: All in one solution to inspire, convert and engage your audiences. Action bars, Popup windows, Messengers, Toast notifications and more. Awesome themes and powerful rules.
|
6 |
+
* Version: 1.9.3
|
7 |
* Author: icegram
|
8 |
* Author URI: http://www.icegram.com/
|
9 |
*
|
35 |
|
36 |
function __construct() {
|
37 |
|
38 |
+
$this->version = "1.9.3";
|
39 |
$this->shortcode_instances = array();
|
40 |
$this->mode = 'local';
|
41 |
$this->plugin_url = untrailingslashit( plugins_url( '/', __FILE__ ) );
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: icegram, storeapps, niravmehta, putler
|
|
3 |
Donate link: http://www.icegram.com/
|
4 |
Tags: popup, window, hellobar, optin, lead capture, marketing, form, notification, messenger, targeting, monster, ninja ,wordpress lead generation, wordpress lightbox optin, wordpress lightbox optin form, wordpress lightbox optins, wordpress mobile optin forms, wordpress mobile popup, wordpress mobile popups, wordpress optin form, wordpress overlay popup, wordpress popup, wordpress popup form, wordpress popup plugin, wordpress popup solution, wordpress popups , popups, subscribe, wp popups, optin bars, action grabber, constant contact, toast notifications, leads, lists, builder, action bar, floating bar, footer bar, hellobar alternative, pop over, Popup plugin, aweber, campaign monitor, constant contact, email list, exit-intent, getresponse, analytics, Hubspot, icontact, infusionsoft, newsletter, Mailing list pop-up, retargeting, Responsive Popup, split testing, AB testing
|
5 |
Requires at least: 3.9
|
6 |
-
Tested up to: 4.
|
7 |
-
Stable tag: 1.9.
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
@@ -153,6 +153,9 @@ Contact Us, provide as much detail of the problem as you can. We will try to sol
|
|
153 |
3. Editing an Icegram campaign - add multiple messages, edit them, targeting rules, full HTML editor, themes and more
|
154 |
|
155 |
== Upgrade Notice ==
|
|
|
|
|
|
|
156 |
= 1.9.2 =
|
157 |
Shortcode problems solved. New anti-spam mechanism for forms.
|
158 |
|
@@ -227,6 +230,10 @@ Initial Release
|
|
227 |
|
228 |
|
229 |
== Changelog ==
|
|
|
|
|
|
|
|
|
230 |
= 1.9.2 =
|
231 |
* New: Keep spammers away with new automatic anti-spam bot checking mechanism
|
232 |
* Fix: Shortcodes not working in Icegram messages
|
3 |
Donate link: http://www.icegram.com/
|
4 |
Tags: popup, window, hellobar, optin, lead capture, marketing, form, notification, messenger, targeting, monster, ninja ,wordpress lead generation, wordpress lightbox optin, wordpress lightbox optin form, wordpress lightbox optins, wordpress mobile optin forms, wordpress mobile popup, wordpress mobile popups, wordpress optin form, wordpress overlay popup, wordpress popup, wordpress popup form, wordpress popup plugin, wordpress popup solution, wordpress popups , popups, subscribe, wp popups, optin bars, action grabber, constant contact, toast notifications, leads, lists, builder, action bar, floating bar, footer bar, hellobar alternative, pop over, Popup plugin, aweber, campaign monitor, constant contact, email list, exit-intent, getresponse, analytics, Hubspot, icontact, infusionsoft, newsletter, Mailing list pop-up, retargeting, Responsive Popup, split testing, AB testing
|
5 |
Requires at least: 3.9
|
6 |
+
Tested up to: 4.2.2
|
7 |
+
Stable tag: 1.9.3
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
153 |
3. Editing an Icegram campaign - add multiple messages, edit them, targeting rules, full HTML editor, themes and more
|
154 |
|
155 |
== Upgrade Notice ==
|
156 |
+
= 1.9.3 =
|
157 |
+
Bug fix release for "Target link" not working.
|
158 |
+
|
159 |
= 1.9.2 =
|
160 |
Shortcode problems solved. New anti-spam mechanism for forms.
|
161 |
|
230 |
|
231 |
|
232 |
== Changelog ==
|
233 |
+
= 1.9.3 =
|
234 |
+
* Fix: Redirection to "Target Link" was not working in Icegram message
|
235 |
+
* Fix: Inline form shortcode not getting preserved for message types with only inline position
|
236 |
+
|
237 |
= 1.9.2 =
|
238 |
* New: Keep spammers away with new automatic anti-spam bot checking mechanism
|
239 |
* Fix: Shortcodes not working in Icegram messages
|