PageSourceSearch

https://www.aladin.co.kr/js/music.js

js aladin.co.kr collected 2026-09-24 08:26:58 UTC 8,393 bytes, 281 lines download raw bytes

1// 트랙리스트
2
3
4var playpopup;
5var playpopup_timeObject='';
6
7
8
9var music = {
10
11    //음악플레이
12
13    play : function(isbn){
14        this.doOpenPlayPopup('isbn', isbn);
15    },
16    
17    play_track : function(trackid){
18        this.doOpenPlayPopup('track', trackid);
19    },
20    
21    //음악구입
22    buy : function(isbn){
23        var url = '/music/wmusicbasket.aspx?action=Add&ISBN=' + isbn;
24        window.open(url, 'MusicBasket', 'width=610,height=500,scrollbars=no');
25    },
26    
27    //음악보관함담기
28
29    musicpaper : function(isbn){
30        var url = '/shop/common/wmusicmypaper_popup.aspx?ISBN=' + isbn;
31        window.open(url, 'MusicPaper', 'width=410,height=230,scrollbars=no');
32    },
33    
34    buy_ticket : function(isbn){
35        //var url = '/order/worder_musicstep1.aspx?AddBook='+ isbn;
36        var url = '/order/worder_musicticket_precheck.aspx?ISBN='+ isbn;
37        window.open(url, 'wMusicTicketPay', 'width=720,height=720,scrollbars=auto');
38    },
39    
40    buy_ticketautopay : function(isbn, eventId){
41        var _eventId = (eventId ==null || eventId=='undefined') ? "0" :  eventId;
42        var url = '/order/worder_musicticket_precheck.aspx?ISBN='+ isbn+ '&EventId='+  _eventId;
43        //var url = '/order/worder_musicautopay_agree.aspx?ISBN='+ isbn + '&EventId='+  _eventId;
44        window.open(url, 'wMusicTicketAutoPay', 'width=720,height=720,scrollbars=auto');
45    },
46    
47    is_ie : function(){
48        return navigator.userAgent.toLowerCase().indexOf("msie")!=-1;;
49    },
50    
51    doOpenPlayPopup : function(mode, id){
52        
53        //비ie일때는 예외처리...    
54        if(this.is_ie()==false){
55            window.open('/music/whelp_ie.aspx', 'MusicPlayer', 'width=360,height=556,scrollbars=no');
56            return;
57        }
58        
59        var url = this.makeNotSSLUrl('/music/winstall.aspx');
60        var reOpen = false;
61        
62        if(typeof(playpopup) == 'undefined')
63        {
64            //바닥페이지가 이동되거나 새로고침된경우를 고려하여 기존팝은 재오픈 
65            playpopup = window.open('', 'MusicPlayer', 'width=360,height=556,scrollbars=no');
66            
67            //flagPopupOpen 이'undefined' 이면 처음 창을 여는 경우
68            if(typeof(playpopup.flagPopupOpen) == 'undefined'){reOpen=true;}
69        }
70        
71        //팝업창을 열었다가 다시 닫은경우 
72        if(playpopup.closed){reOpen=true;} 
73        
74        if(reOpen){
75            playpopup = window.open(url, 'MusicPlayer', 'width=360,height=556,scrollbars=no');
76        }
77       
78       
79       //flagPopupOpen 이'undefined' 이면 팝업로딩전이기때문에... 시간을 끈다...
80       if(typeof(playpopup.oMP3Player) == 'undefined'){
81            music.resetTimer(playpopup_timeObject);
82            playpopup_timeObject = setTimeout(function(){music.doOpenPlayPopup(mode, id);}, 600);
83            return;
84       }
85       
86       
87       //플레이 목록 로딩전이기 때문에.. 시간을 끈다...
88       if(playpopup.oMP3Player.initplaylist_finished == false){
89            music.resetTimer(playpopup_timeObject);
90            playpopup_timeObject = setTimeout(function(){music.doOpenPlayPopup(mode, id);}, 600);
91            return;
92       }
93            
94      
95        if(mode=='mymusic'){
96            playpopup.showMyMusic();
97        }else if(mode=='isbn'){
98            playpopup.addisbn(id);
99        }else if(mode=='track'){
100            playpopup.addTrack(id);
101        }
102
103
104        playpopup.focus(); 
105    },
106    
107    resetTimer : function(timeObj){
108        if(timeObj && timeObj!='') clearTimeout(timeObj); 
109    },
110    
111    
112    makeNotSSLUrl : function(url){
113        var preFix='';
114        if(document.location.protocol == "https:"){ //https 페이지 여부 확인
115            preFix='http://' + document.location.host;
116        }
117        return preFix + url;
118    }
119
120}
121
122// mode
123//'one':한곡듣기
124//'all':전체듣기
125//'sel':선택듣기
126//'ran':랜덤듣기
127
128function TrackList(){
129    this.div='';
130   
131}
132
133TrackList.prototype.checkall=function(flag){
134    var objs = this.div.getElementsByTagName("input");
135    for(var i=0;i<objs.length;i++){
136        if(objs[i].type=="checkbox")
137        {
138            objs[i].checked=flag;
139        }
140    }
141}
142
143TrackList.prototype.cartlist=function(){
144    var cart = new Array();
145    var objs = this.div.getElementsByTagName("input");
146    for(var i=0;i<objs.length;i++){
147        if(objs[i].type=="checkbox")
148        {
149            if(objs[i].checked && objs[i].value>0){
150                cart.push(objs[i].value);
151            }
152        }
153    }
154    return cart;
155}
156
157TrackList.prototype.shuffle=function(array){
158    var len = array.length; 
159    for(var i=len ; i>0 ; i--) { 
160        array[len-1] = array.splice(Math.floor(Math.random() * i),1)[0]; 
161    } 
162}
163
164TrackList.prototype.play=function(mode, trackid){
165    var id = '';
166    switch(mode){
167        case 'one':id=trackid;break;
168        case 'sel':id=this.cartlist();break;
169        case 'all':this.checkall(true);id=this.cartlist();break;
170        case 'ran':
171            var array = (this.cartlist() + '').split(',');
172            this.shuffle(array);
173            id=array.join();
174            break;
175    }
176    
177    if(id==''){
178        alert('플레이어에 추가할 음악을 선택해 주세요');
179        return;
180    }
181    music.doOpenPlayPopup('track',id);
182}
183
184TrackList.prototype.resetTimer=function(timeObj){ 
185    if(timeObj && timeObj!='') clearTimeout(timeObj); 
186}
187 
188 
189
190
191//음악보관함 담기
192TrackList.prototype.musicpaper=function(mode, trackid){
193    var id = '';
194    
195    switch(mode){
196        case 'one':id=trackid;break;
197        case 'sel':id=this.cartlist();break;
198        case 'all':this.checkall(true);id=this.cartlist();break;
199    }
200    
201    if(id==''){
202        alert('보관함에 담을 음악을 선택해 주세요');
203        return;
204    }
205   
206    var url = this.makeNotSSLUrl('/shop/common/wmusicmypaper_popup.aspx?trackId=' + id);
207    window.open(url, 'MusicPaper', 'width=410,height=230,scrollbars=no');
208}
209
210//mp3 구매하기
211TrackList.prototype.buy=function(mode, trackid){
212    var id = '';
213    
214    switch(mode){
215        case 'one':id=trackid;break;
216        case 'sel':id=this.cartlist();break;
217        case 'all':this.checkall(true);id=this.cartlist();break;
218    }
219    
220    if(id==''){
221        alert('구매하실 음악을 선택해 주세요');
222        return;
223    }
224    
225    var url = this.makeNotSSLUrl('/music/wmusicbasket.aspx?action=Add&trackId=' + id);
226    window.open(url, 'MusicBasket', 'width=610,height=500,scrollbars=no');
227}
228
229
230
231//mp3 다운로드
232TrackList.prototype.down=function(mode, trackid){
233    var id = '';
234    
235    switch(mode){
236        case 'one':id=trackid;break;
237        case 'sel':id=this.cartlist();break;
238        case 'all':this.checkall(true);id=this.cartlist();break;
239    }
240    
241    if(id==''){
242        alert('다운로드하실 음악을 선택해 주세요');
243        return;
244    }
245 
246    
247    var url =  this.makeNotSSLUrl('/music/wdown.aspx?trackId=' + id);
248    window.open(url, 'MusicDown', 'width=750,height=500,scrollbars=no');
249}
250
251TrackList.prototype.makeNotSSLUrl = function(url){
252    var preFix='';
253    if(document.location.protocol == "https:"){ //https 페이지 여부 확인
254        preFix='http://' + document.location.host;
255    }
256    return preFix + url;
257}
258
259
260TrackList.prototype.lyrics=function(trackid){
261    var url = this.makeNotSSLUrl('/music/wlyrics.aspx?trackId=' +  trackid);
262    window.open(url, 'MusicLyrics', 'width=400,height=500,scrollbars=no');
263}
264
265
266TrackList.prototype.clickCheckAll=function(){
267    if($('chk_track_all').checked){
268        $('img_track_all').src = "http://image.aladdin.co.kr/img/music/musicmp3/bt/nm_bt_choice_1_off.gif";
269        $('img_track_all_down').src = "http://image.aladdin.co.kr/img/music/musicmp3/bt/nm_bt_choice_1_off.gif";
270        $('chk_track_all').checked = false;
271    }else{
272        $('img_track_all').src = "http://image.aladdin.co.kr/img/music/musicmp3/bt/nm_bt_choice_2_off.gif";
273        $('img_track_all_down').src = "http://image.aladdin.co.kr/img/music/musicmp3/bt/nm_bt_choice_2_off.gif";
274        $('chk_track_all').checked = true;
275    }
276    
277    this.checkall($('chk_track_all').checked);
278}
279
280TrackList.prototype.mouseOn=function(img){img.src=img.src.replace('off.gif','on.gif');}
281TrackList.prototype.mouseOff=function(img){img.src=img.src.replace('on.gif','off.gif');}

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.