1/** 2 * @package WPBLP_NAME 3 * @version WPBLP_VERSION 4 * 5 * Custom JS Settings Scripts 6 * 7 **/ 8 9 10jQuery(document).ready(function (e) { 11 "use strict"; 12 13 e("#wpblp_live_preview .wpblp_label .wpblp_name").attr("data-orig-val", e("#wpblp_live_preview .wpblp_label .wpblp_name").html()); 14 e("#wpblp_settings_price_currency_input_wrap > .wpblp_button").on("click", function () { 15 e("#wpblp_settings_price_currency_input").val(e(this).attr("data-btn-val")) 16 }); 17 18 var bc = e("#wpblp_settings_barcode_input").is(":checked") ? 1 : 0, 19 bs = e("#wpblp_settings_source_input").is(":checked") ? 1 : 0, 20 blbo = e("#wpblp_settings_blank_between_orders_input").is(":checked") ? 1 : 0, 21 hz = e("#wpblp_settings_horizontal_input").is(":checked") ? 1 : 0, 22 qrl = e("#wpblp_settings_qr_code_link").find(":selected").val(), 23 qrcl = e("#wpblp_settings_crcl_logged_input").is(":checked") ? 1 : 0, 24 qrclra = e("#wpblp_settings_crcl_reask_input").is(":checked") ? 1 : 0, 25 qroul = e("#wpblp_settings_one_use_link_input").is(":checked") ? 1 : 0, 26 t = e("#wpblp_settings_sku_input").is(":checked") ? 1 : 0, 27 p = e("#wpblp_settings_title_input").is(":checked") ? 1 : 0, 28 _ = e("#wpblp_settings_price_input").is(":checked") ? 1 : 0, 29 l = e("#wpblp_settings_sku_addon_input").is(":checked") ? 1 : 0, 30 dc = e("#wpblp_settings_show_dupl_counters_input").is(":checked") ? 1 : 0, 31 acfcs = e("#wpblp_settings_acf_custom_fields_textarea").val(), 32 s = e("#wpblp_settings_posts_per_page_input").val(), 33 lpr = e("#wpblp_settings_labels_per_row_input").val(), 34 i = e("#wpblp_settings_products_status").find(":selected").val(), 35 qrclar = e("#wpblp_settings_select_crcl_allowed_roles :selected").map(function (i, el) { 36 return e(el).val(); 37 }).get(), 38 qrclar = qrclar.join(), 39 sra = e("#wpblp_settings_select_allowed_roles :selected").map(function (i, el) { 40 return e(el).val(); 41 }).get(), 42 sra = sra.join(), 43 srs = e("#wpblp_settings_select_allowed_settings :selected").map(function (i, el) { 44 return e(el).val(); 45 }).get(), 46 srs = srs.join(), 47 n = e("#wpblp_settings_barcode_select_types").find(":selected").val(), 48 pc = e("#wpblp_settings_price_currency_input").val(), 49 pcp = e("#wpblp_settings_barcode_select_price_currency_pos").find(":selected").val(), 50 cw = e("#wpblp_settings_container_width_input").val(), 51 ch = e("#wpblp_settings_container_height_input").val(), 52 a = e("#wpblp_settings_bar_width_input").val(), 53 o = e("#wpblp_settings_bar_height_input").val(), 54 c = e("#wpblp_settings_offsetx_input").val(), 55 b = e("#wpblp_settings_offsety_input").val(), 56 r = e("#wpblp_settings_preview_sku_input").val(), 57 tl = e("#wpblp_settings_title_max_length_input").val(), 58 d = e("#wpblp_settings_title_font_size_input").val(), 59 w = e("#wpblp_settings_code_font_size_input").val(), 60 u = e("#wpblp_settings_price_font_size_input").val(), 61 f = e("#wpblp_settings_preset").val(), 62 g = e("#wpblp_settings_preset_name").val(), 63 lw = e("#wpblp_settings_qr_code_height_input").val(), 64 v = { 65 wpblp_settings_checkbox_barcode: bc, 66 wpblp_settings_checkbox_source: bs, 67 wpblp_settings_checkbox_horizontal: hz, 68 wpblp_settings_checkbox_blank_between_orders: blbo, 69 wpblp_settings_qr_code_link: qrl, 70 wpblp_settings_checkbox_crcl_logged: qrcl, 71 wpblp_settings_checkbox_crcl_reask: qrclra, 72 wpblp_settings_checkbox_one_use_link: qroul, 73 wpblp_settings_checkbox_sku: t, 74 wpblp_settings_checkbox_title: p, 75 wpblp_settings_checkbox_price: _, 76 wpblp_settings_checkbox_sku_addon: l, 77 wpblp_settings_checkbox_show_dupl_counters: dc, 78 wpblp_settings_textarea_field_acf_custom_fields: acfcs, 79 wpblp_settings_input_field_posts_per_page: s, 80 wpblp_settings_input_field_labels_per_row: lpr, 81 wpblp_settings_products_status: i, 82 wpblp_settings_select_crcl_allowed_roles: qrclar, 83 wpblp_settings_select_allowed_roles: sra, 84 wpblp_settings_select_allowed_settings: srs, 85 wpblp_settings_input_field_container_width: cw, 86 wpblp_settings_input_field_container_height: ch, 87 wpblp_settings_input_field_bar_width: a, 88 wpblp_settings_input_field_bar_height: o, 89 wpblp_settings_input_field_offsetx: c, 90 wpblp_settings_input_field_offsety: b, 91 wpblp_settings_input_field_preview_sku: r, 92 wpblp_settings_input_field_title_max_length: tl, 93 wpblp_settings_input_field_title_font_size: d, 94 wpblp_settings_input_field_code_font_size: w, 95 wpblp_settings_input_field_price_font_size: u, 96 wpblp_settings_select_type: n, 97 wpblp_settings_input_field_price_currency: pc, 98 wpblp_settings_select_price_currency_pos: pcp, 99 wpblp_settings_input_field_qr_code_height: lw 100 }; 101 102 function m() { 103 bc = e("#wpblp_settings_barcode_input").is(":checked") ? 1 : 0, 104 bs = e("#wpblp_settings_source_input").is(":checked") ? 1 : 0, 105 hz = e("#wpblp_settings_horizontal_input").is(":checked") ? 1 : 0, 106 blbo = e("#wpblp_settings_blank_between_orders_input").is(":checked") ? 1 : 0, 107 qrl = e("#wpblp_settings_qr_code_link").find(":selected").val(), 108 qrcl = e("#wpblp_settings_crcl_logged_input").is(":checked") ? 1 : 0, 109 qrclra = e("#wpblp_settings_crcl_reask_input").is(":checked") ? 1 : 0, 110 qroul = e("#wpblp_settings_one_use_link_input").is(":checked") ? 1 : 0, 111 t = e("#wpblp_settings_sku_input").is(":checked") ? 1 : 0, 112 p = e("#wpblp_settings_title_input").is(":checked") ? 1 : 0, 113 _ = e("#wpblp_settings_price_input").is(":checked") ? 1 : 0, 114 l = e("#wpblp_settings_sku_addon_input").is(":checked") ? 1 : 0, 115 dc = e("#wpblp_settings_show_dupl_counters_input").is(":checked") ? 1 : 0, 116 acfcs = e("#wpblp_settings_acf_custom_fields_textarea").val(), 117 s = e("#wpblp_settings_posts_per_page_input").val(), 118 lpr = e("#wpblp_settings_labels_per_row_input").val(), 119 i = e("#wpblp_settings_products_status").find(":selected").val(), 120 qrclar = e("#wpblp_settings_select_crcl_allowed_roles :selected").map(function (i, el) { 121 return e(el).val(); 122 }).get(), qrclar = qrclar.join(), 123 sra = e("#wpblp_settings_select_allowed_roles :selected").map(function (i, el) { 124 return e(el).val(); 125 }).get(), sra = sra.join(), 126 srs = e("#wpblp_settings_select_allowed_settings :selected").map(function (i, el) { 127 return e(el).val(); 128 }).get(), srs = srs.join(), 129 n = e("#wpblp_settings_barcode_select_types").find(":selected").val(), 130 pc = e("#wpblp_settings_price_currency_input").val(), 131 pcp = e("#wpblp_settings_barcode_select_price_currency_pos").find(":selected").val(), 132 cw = e("#wpblp_settings_container_width_input").val(), 133 ch = e("#wpblp_settings_container_height_input").val(), 134 a = e("#wpblp_settings_bar_width_input").val(), 135 o = e("#wpblp_settings_bar_height_input").val(), 136 c = e("#wpblp_settings_offsetx_input").val(), 137 b = e("#wpblp_settings_offsety_input").val(), 138 r = e("#wpblp_settings_preview_sku_input").val(), 139 tl = e("#wpblp_settings_title_max_length_input").val(), 140 d = e("#wpblp_settings_title_font_size_input").val(), 141 w = e("#wpblp_settings_code_font_size_input").val(), 142 u = e("#wpblp_settings_price_font_size_input").val(), 143 f = e("#wpblp_settings_preset").val(), 144 g = e("#wpblp_settings_preset_name").val(), 145 lw = e("#wpblp_settings_qr_code_height_input").val(), 146 v = { 147 wpblp_settings_checkbox_barcode: bc, 148 wpblp_settings_checkbox_source: bs, 149 wpblp_settings_checkbox_horizontal: hz, 150 wpblp_settings_checkbox_blank_between_orders: blbo, 151 wpblp_settings_qr_code_link: qrl, 152 wpblp_settings_checkbox_crcl_logged: qrcl, 153 wpblp_settings_checkbox_crcl_reask: qrclra, 154 wpblp_settings_checkbox_one_use_link: qroul, 155 wpblp_settings_checkbox_sku: t, 156 wpblp_settings_checkbox_title: p, 157 wpblp_settings_checkbox_price: _, 158 wpblp_settings_checkbox_sku_addon: l, 159 wpblp_settings_checkbox_show_dupl_counters: dc, 160 wpblp_settings_textarea_field_acf_custom_fields: acfcs, 161 wpblp_settings_input_field_posts_per_page: s, 162 wpblp_settings_input_field_labels_per_row: lpr, 163 wpblp_settings_products_status: i, 164 wpblp_settings_select_crcl_allowed_roles: qrclar, 165 wpblp_settings_select_allowed_roles: sra, 166 wpblp_settings_select_allowed_settings: srs, 167 wpblp_settings_input_field_container_width: cw, 168 wpblp_settings_input_field_container_height: ch, 169 wpblp_settings_input_field_bar_width: a, 170 wpblp_settings_input_field_bar_height: o, 171 wpblp_settings_input_field_offsetx: c, 172 wpblp_settings_input_field_offsety: b, 173 wpblp_settings_input_field_preview_sku: r, 174 wpblp_settings_input_field_title_max_length: tl, 175 wpblp_settings_input_field_title_font_size: d, 176 wpblp_settings_input_field_code_font_size: w, 177 wpblp_settings_input_field_price_font_size: u, 178 wpblp_settings_select_type: n, 179 wpblp_settings_input_field_price_currency: pc, 180 wpblp_settings_select_price_currency_pos: pcp, 181 wpblp_settings_input_field_qr_code_height: lw 182 }; 183 } 184 185 function h() { 186 1 == bc ? e("#wpblp_label_list .wpblp_label .wpblp_label_img .wpblp_label_lines").show() : e("#wpblp_label_list .wpblp_label .wpblp_label_img .wpblp_label_lines").attr('style', 'display:none !important'), 187 1 == bc & "qr-code" == n ? e("#wpblp_label_list .wpblp_label .wpblp_label_img canvas").show() : e("#wpblp_label_list .wpblp_label .wpblp_label_img canvas").attr('style', 'display:none !important'), 188 1 == t ? e("#wpblp_live_preview .wpblp_label .wpblp_label_lines + div").show() : e("#wpblp_live_preview .wpblp_label .wpblp_label_lines + div").hide(), 189 1 == t & "qr-code" == n ? e("#wpblp_live_preview .wpblp_label .wpblp_code").show() : e("#wpblp_live_preview .wpblp_label .wpblp_code").hide(), 190 1 == p ? e("#wpblp_live_preview .wpblp_label .wpblp_name").show() : e("#wpblp_live_preview .wpblp_label .wpblp_name").hide(), 191 1 == _ ? e("#wpblp_live_preview .wpblp_label .wpblp_price").show() : e("#wpblp_live_preview .wpblp_label .wpblp_price").hide() 192 } 193 m(), 194 e("#wpblp_live_preview .wpblp_label").css({ 195 "width": ((cw / 25.4) * 96).toFixed() + "px", 196 "height": ((ch / 25.4) * 96).toFixed() + "px" 197 }), 198 e("#wpblp_live_preview .wpblp_label.wpblp_label_horizontal .wpblp_inner").css({ 199 "height": ((cw / 25.4) * 96).toFixed() + "px", 200 "width": ((ch / 25.4) * 96).toFixed() + "px" 201 }), 202 e("#wpblp_live_preview .wpblp_label .wpblp_name").css({ 203 "font-size": d + "px" 204 }), "qr-code" == n ? e("#wpblp_live_preview .wpblp_label .wpblp_code").css({ 205 "font-size": w + "px" 206 }) : e("#wpblp_live_preview .wpblp_label .wpblp_code").css({ 207 "font-size": w + "px" 208 }), e("#wpblp_live_preview .wpblp_label .wpblp_price").css({ 209 "font-size": u + "px" 210 }), e("#wpblp_live_preview .wpblp_label .wpblp_name")[0] && e("#wpblp_live_preview .wpblp_label .wpblp_name").html(e("#wpblp_live_preview .wpblp_label .wpblp_name").attr("data-orig-val").substring(0, tl)), 211 "qr-code" != n ? e("#wpblp_live_preview .wpblp_label .wpblp_label_img").barcode(r, n, { 212 barWidth: a, 213 barHeight: o, 214 fontSize: w, 215 showCode: 1, 216 CustomPrefix: "" 217 }) : e("#wpblp_live_preview .wpblp_label .wpblp_label_img").empty().qrcode({ 218 width: ((lw / 25.4) * 96).toFixed(), 219 height: ((lw / 25.4) * 96).toFixed(), 220 text: "before" == pcp ? (String(r) + " - " + e("#wpblp_live_preview .wpblp_label").attr("data-label-text") + " - " + String(pc) + e("#wpblp_live_preview .wpblp_label").attr("data-label-price")) : (String(r) + " - " + e("#wpblp_live_preview .wpblp_label").attr("data-label-text") + " - " + e("#wpblp_live_preview .wpblp_label").attr("data-label-price") + String(pc)) 221 }), 222 "qr-code" == n ? (e("#wpblp_settings_form").hasClass("wpblp_settings_form_type_qr") || e("#wpblp_settings_form").addClass("wpblp_settings_form_type_qr"), e("#wpblp_settings_form").removeClass("wpblp_settings_form_type_default")) : (e("#wpblp_settings_form").hasClass("wpblp_settings_form_type_default") || e("#wpblp_settings_form").addClass("wpblp_settings_form_type_default"), e("#wpblp_settings_form").removeClass("wpblp_settings_form_type_qr")), 223 "" != c && e("#wpblp_live_preview .wpblp_label .wpblp_inner").css({ 224 left: c + "px" 225 }), "" != b && e("#wpblp_live_preview .wpblp_label .wpblp_inner").css({ 226 top: b + "px" 227 }), h(), e("#wpblp_settings_form").on("change input click", function () { 228 m(), e("#wpblp_live_preview .wpblp_label").css({ 229 "width": ((cw / 25.4) * 96).toFixed() + "px", 230 "height": ((ch / 25.4) * 96).toFixed() + "px" 231 }), 232 e("#wpblp_live_preview .wpblp_label.wpblp_label_horizontal .wpblp_inner").css({ 233 "height": ((cw / 25.4) * 96).toFixed() + "px", 234 "width": ((ch / 25.4) * 96).toFixed() + "px" 235 }), 236 e("#wpblp_live_preview .wpblp_label .wpblp_name").css({ 237 "font-size": d + "px" 238 }), "qr-code" == n ? e("#wpblp_live_preview .wpblp_label .wpblp_code").css({ 239 "font-size": w + "px" 240 }) : e("#wpblp_live_preview .wpblp_label .wpblp_code").css({ 241 "font-size": w + "px" 242 }), e("#wpblp_live_preview .wpblp_label .wpblp_price").css({ 243 "font-size": u + "px" 244 }), e("#wpblp_live_preview .wpblp_label .wpblp_name")[0] && e("#wpblp_live_preview .wpblp_label .wpblp_name").html(e("#wpblp_live_preview .wpblp_label .wpblp_name").attr("data-orig-val").substring(0, tl)), 245 "qr-code" != n ? e("#wpblp_live_preview .wpblp_label .wpblp_label_img").barcode(r, n, { 246 barWidth: a, 247 barHeight: o, 248 fontSize: w, 249 showCode: 1, 250 CustomPrefix: "" 251 }) : e("#wpblp_live_preview .wpblp_label .wpblp_label_img").empty().qrcode({ 252 width: ((lw / 25.4) * 96).toFixed(), 253 height: ((lw / 25.4) * 96).toFixed(), 254 text: "before" == pcp ? (String(r) + " - " + e("#wpblp_live_preview .wpblp_label").attr("data-label-text") + " - " + String(pc) + e("#wpblp_live_preview .wpblp_label").attr("data-label-price")) : (String(r) + " - " + e("#wpblp_live_preview .wpblp_label").attr("data-label-text") + " - " + e("#wpblp_live_preview .wpblp_label").attr("data-label-price") + String(pc)) 255 }), 256 "qr-code" == n ? (e("#wpblp_settings_form").hasClass("wpblp_settings_form_type_qr") || e("#wpblp_settings_form").addClass("wpblp_settings_form_type_qr"), e("#wpblp_settings_form").removeClass("wpblp_settings_form_type_default")) : (e("#wpblp_settings_form").hasClass("wpblp_settings_form_type_default") || e("#wpblp_settings_form").addClass("wpblp_settings_form_type_default"), e("#wpblp_settings_form").removeClass("wpblp_settings_form_type_qr")), 257 "" != c && e("#wpblp_live_preview .wpblp_label .wpblp_inner").css({ 258 left: c + "px" 259 }), "" != b && e("#wpblp_live_preview .wpblp_label .wpblp_inner").css({ 260 top: b + "px" 261 }), h() 262 }), e("#wpblp_button_save_preset").on("click", function () { 263 m(), jQuery.post(wpblp.ajaxurl, { 264 nonce: wpblp.nonce, 265 action: "presets_action", 266 preset_select: f, 267 preset_name: g, 268 wpblp_preset_value: "save", 269 wpblp_new_settings: v 270 }, function (e) { 271 location.reload() 272 }) 273 }), e("#wpblp_button_load_preset").on("click", function () { 274 m(), jQuery.post(wpblp.ajaxurl, { 275 nonce: wpblp.nonce, 276 action: "presets_action", 277 preset_select: f, 278 preset_name: g, 279 wpblp_preset_value: "load", 280 wpblp_new_settings: v 281 }, function (e) { 282 location.reload() 283 }) 284 }), e("#wpblp_button_reset_preset").on("click", function () { 285 m(), jQuery.post(wpblp.ajaxurl, { 286 nonce: wpblp.nonce, 287 action: "presets_action", 288 preset_select: f, 289 preset_name: g, 290 wpblp_preset_value: "reset", 291 wpblp_new_settings: v 292 }, function (e) { 293 location.reload() 294 }) 295 }) 296});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.