1if(window.Oby) { 2window.Oby.registerAjax(["cart.updated","wishlist.updated"],function(params){ 3 var cart = (params.type == "cart"), 4 p = window.cartNotifyParams, 5 img_url = p.img_url, 6 title = cart ? p.title : p.wishlist_title, 7 text = cart ? p.text : p.wishlist_text, 8 class_name = "info", success = true; 9 if(params.notify === false) 10 return; 11 if(params.resp.ret == 0) { 12 class_name = "warning"; 13 title = cart ? p.err_title : p.err_wishlist_title; 14 text = cart ? p.err_text : p.err_wishlist_text; 15 success = false; 16 if(!cart && params.resp.err_wishlist_guest && p.err_wishlist_guest) { 17 p.redirect_url = p.err_wishlist_guest; 18 success = true; 19 } 20 }else if(params.product_id == 'list' && !params.resp.product_name){ 21 title = cart ? p.list_title : p.list_wishlist_title; 22 text = cart ? p.list_text : p.list_wishlist_text; 23 } 24 if(params.resp.image) 25 img_url = params.resp.image; 26 if(params.resp.product_name) 27 title = params.resp.product_name; 28 if(params.resp.message) 29 text = params.resp.message; 30 else if(params.resp.messages && params.resp.messages[0] && params.resp.messages[0].msg) { 31 text = params.resp.messages[0].msg; 32 } 33 34 var content = ""; 35 if(img_url == null) { 36 content = "<div class=\"notifyjs-metro-lite-base\"><div class=\"text-wrapper\"><div class=\"title\">"+title+"</div><div class=\"text\">"+text+"</div></div></div>"; 37 } else { 38 content = "<div class=\"notifyjs-metro-base\"><div class=\"image\"><img src=\""+img_url+"\" width=\"50\" height=\"50\" alt=\"\"/></div><div class=\"text-wrapper\"><div class=\"title\">"+title+"</div><div class=\"text\">"+text+"</div></div></div>"; 39 } 40 var vex_params = {message: content}, 41 params_key = params.type + (params.resp.ret == 0 ? '_err' : '') + '_params'; 42 if(p[params_key]) { 43 if(Object && Object.assign) 44 vex_params = Object.assign(vex_params, p[params_key]); 45 else 46 vex_params = jQuery.extend(true, vex_params, p[params_key]); 47 } 48 vex.dialog.alert(vex_params); 49 50 if(success && p.redirect_url && (cart || params.resp.err_wishlist_guest && p.err_wishlist_guest)) { 51 if(!p.redirect_delay) 52 p.redirect_delay = 4000; 53 setTimeout(function(){ window.location = p.redirect_url; }, p.redirect_delay); 54 } 55 56 if(p.hide_delay && p.hide_delay > 0) { 57 setTimeout(function(){ if(window.top.vex.closeAll) window.top.vex.closeAll(); }, p.hide_delay); 58 } 59 return true; 60}); 61}
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.