PageSourceSearch

https://www.aladin.co.kr/shop/common/safebasket_add.js

js aladin.co.kr collected 2026-09-24 08:27:55 UTC 7,119 bytes, 248 lines download raw bytes

1//보관리스트 담기 
2//ISBN 이 0 인경우 frm 에 체크된 항목을 모두 담는다. 
3function AddSafeBasket(ISBN) {
4    //ISBN이 온경우 체크 박스를 체크
5    //if (ISBN.length>0)
6    //	checkitem(ISBN);
7
8    //return AddSafeBasketAll();
9
10    return AddSafeBasket_single(ISBN);
11}
12
13//보관리스트에 한개 상품 담기 
14//ISBN 을 보관리스트에 담는다. 
15function AddSafeBasket_single(ISBN)
16{
17	GA4_Wish(ISBN);
18
19    var url = "/shop/common/wsafebasket_add_popup.aspx?AddSafeBasket=" + ISBN + "&returnUrl=" + encodeURIComponent(location.href);
20    window.open(url,"SafeBasket","width=450,height=284");
21		
22    return false;
23}
24	
25//예약알림신청하기 
26function AddPreOrderAlarm(isbn)
27{
28	var url= "/shop/common/wpreorder_alarm_add_popup.aspx?AddSafeBasket=" + isbn;
29	window.open(url,"SafeBasket","width=450,height=284");
30		
31	return false;
32}
33   
34//보관리스트에 여러개 상품 담기    
35function AddSafeBasketAll() {
36    var frm = document.body;
37
38    //var frm = document.Myform;
39    //document.forms['Myform'];
40    //var oFrm = $(frm.id); 
41
42    try {
43        var selectedItems = getCheckedCheckboxForDiv(frm, ',');
44        if (selectedItems == null || selectedItems == "") {
45            alert('보관함에 담을 상품을 선택해 주세요.');
46            return false;
47        }
48
49        GA4_Wish(selectedItems);
50
51        //var goUrl = "/shop/common/wsafebasket_add_popup.aspx?AddSafeBasketAll=" + selectedItems + "&returnUrl=" + encodeURIComponent(location.href);
52        var goUrl = "/shop/common/wsafebasket_add_popup.aspx?AddSafeBasketAll=" + selectedItems;
53        var MyWin = window.open(goUrl, "SafeBasket", "width=450,height=284");
54
55    } catch (ex) {
56        alert(ex);
57        return false;
58    }
59
60    //폼의 서브밋을 막는다.
61    return false;
62}
63
64function AddSafeBasketAll_From(thisForm) {
65
66    var frm = document.body;
67
68    if (typeof (thisForm) != 'undefined' && thisForm != null) {
69        frm = findForm(thisForm);
70    }
71
72    try {
73        var selectedItems = getCheckedCheckboxForDiv(frm, ',');
74        if (selectedItems == null || selectedItems == "") {
75            alert('보관함에 담을 상품을 선택해 주세요.');
76            return false;
77        }
78
79        GA4_Wish(selectedItems);
80
81        var goUrl = "/shop/common/wsafebasket_add_popup.aspx?AddSafeBasketAll=" + selectedItems;
82        var MyWin = window.open(goUrl, "SafeBasket", "width=450,height=284");
83
84    } catch (ex) {
85        alert(ex);
86        return false;
87    }
88
89    //폼의 서브밋을 막는다.
90    return false;
91}
92	
93		
94//지정된 obj 엘리먼트 하위의 선택된 체크 박스 아이템들을 반환
95//obj : 체크박스를 감싸고 있는 컨테이너 객체
96//delimeter : 다중선택된 경우 지정된 구분자를 넣어 반환, null 일경우 ',' 사용 
97if (typeof getCheckedCheckboxForDiv == 'undefined') {
98
99	var getCheckedCheckboxForDiv = function (obj, delimeter) {
100
101
102	    var selectedItems = "";
103	    var delim = (delimeter == null || typeof delimeter == "undefined") ? "," : delimeter;
104	    this.checked = !this.checked;
105
106
107	    //alert(obj.innerHTML);
108
109	    if (obj.innerHTML == "")
110	        obj = document.body;
111
112	    var inputs = obj.getElementsByTagName('input');
113	    //alert(inputs.length);
114	    for (var i = 0; i < inputs.length; i++) {
115	        var ckb = inputs[i];
116	        if (ckb.type == 'checkbox') {
117	            if (ckb.checked) {
118	                if (ckb.name.indexOf('chkCart') > -1) {
119	                    var startAt = ckb.name.indexOf('.') + 1;
120	                    selectedItems = selectedItems + ckb.name.substring(startAt, ckb.name.length) + delim;
121	                }
122	            }
123	        }
124	    }
125
126	    return selectedItems.substring(0, selectedItems.length - 1);
127	};
128}
129   
130     
131//마이리스트에 여러개 상품 담기    
132function AddMyListAll() {
133	//        var frm = document.body;
134	//        try{
135	//            var selectedItems = getCheckedCheckboxForDiv(frm, ',' );
136	//            if(selectedItems == null || selectedItems == ""){
137	//                 alert('마이리스트에 담을 상품을 선택해 주세요.');
138	//                 return false;
139	//            }
140	//            
141	//            var goUrl = '/blog/mylibrary/pop/wmoveitem_b2.aspx?AddType=ISBN';
142	//            var isbnArray = selectedItems.split(",");
143	//           
144	//            //50개 이상이면 쿼리스트링이 짤려서 다른 함수에서 처리..
145	//            if(isbnArray.length>50){
146	//                AddMyListAllNew();
147	//                return false;
148	//            }
149	//            
150	//            for(var i=0;i<isbnArray.length;i++){
151	//                goUrl += '&ChkCart.' + isbnArray[i] + '=on';    
152	//            }
153	//            var MyWin = window.open(goUrl,"MyList","width=450,height=560"); 
154	//        }catch(ex){
155	//          alert(ex);
156	//          return false;
157	//        }
158
159
160	AddMyListAllNew();
161
162	//폼의 서브밋을 막는다.
163	return false;
164}
165	
166	
167//마이리스트에 여러개 상품 담기   
168//100개 이상상품도 담기게끔 변경... 
169function AddMyListAllNew() {
170	var frm = document.body;
171	try {
172	    var selectedItems = getCheckedCheckboxForDiv(frm, ',');
173	    if (selectedItems == null || selectedItems == "") {
174	        alert('마이리스트에 담을 상품을 선택해 주세요.');
175	        return false;
176	    }
177
178	    var goUrl = '/blog/mylibrary/pop/wmoveitem_b2.aspx?AddType=LIST&Items=' + selectedItems + "&returnUrl=" + encodeURIComponent(location.href);
179	    var MyWin = window.open(goUrl, "MyList", "width=450,height=560");
180	} catch (ex) {
181	    alert(ex);
182	    return false;
183	}
184
185	//폼의 서브밋을 막는다.
186	return false;
187}
188
189
190function AddMyList(ISBN) {
191	try {
192	    var goUrl = '/blog/mylibrary/pop/wmoveitem_b2.aspx?AddType=LIST&Items=' + ISBN + "&returnUrl=" + encodeURIComponent(location.href);
193	    var MyWin = window.open(goUrl, "MyList", "width=450,height=560");
194	} catch (ex) {
195	    return false;
196	}
197
198
199	return false;
200}
201	
202function AddMyList_b2(ISBN) {
203	return AddMyList(ISBN);
204}
205
206function AddMyListAll_Form(thisForm) {    
207    var frm = document.body;
208
209    if (typeof (thisForm) != 'undefined' && thisForm != null) {
210        frm = findForm(thisForm);
211    }
212
213    try {
214        var selectedItems = getCheckedCheckboxForDiv(frm, ',');
215        if (selectedItems == null || selectedItems == "") {
216            alert('마이리스트에 담을 상품을 선택해 주세요.');
217            return false;
218        }
219
220        var goUrl = '/blog/mylibrary/pop/wmoveitem_b2.aspx?AddType=LIST&Items=' + selectedItems;
221        var MyWin = window.open(goUrl, "MyList", "width=450,height=560");
222    } catch (ex) {
223        alert(ex);
224        return false;
225    }
226
227    //폼의 서브밋을 막는다.
228    return false;
229}
230
231function GA4_Basket(isbn, qty) {
232	if (qty == undefined)
233		qty = 1;
234
235	GA4_Run("GA4_add_to_cart", isbn, qty);
236}
237
238function GA4_Wish(isbn) {
239	GA4_Run("GA4_add_to_wishlist", isbn, 1);
240}
241
242function GA4_Run(type, isbn, qty) {
243	var query = '&type=' + type + '&isbn=' + isbn + '&qty=' + qty;
244	var url = "/Product/ItemInfo.aspx?" + query;
245
246	jQuery.getScript(url);
247}
248

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.