modified: pixi.toml
[GalaxyCodeBases.git] / etc / Chrome / 115 / chrome / js / 115.js
blob5a4c2459113306ce161e4013133a661725debe23
1 // ==UserScript==
2 // @name            115网盘aria2导出工具
3 // @author          acgotaku311
4 // @description 一个方便把115网盘导出到Aria2rpc的脚本。
5 // @encoding           utf-8
6 // @include     http://*.115.com/*
7 // @run-at       document-end
8 // @version 0.1.5
9 // ==/UserScript==
10 var pan_115 = function(cookies) {
11     var version = "0.1.4";
12     var update_date = "2016/02/09";
13     var pan = (function() {
14         //type : inf err war
15         var SetMessage = function(msg, type) {   
16             Core.MinMessage.Show({
17                 text: msg, 
18                 type: type, 
19                 timeout: 2000
20             });
21         };
22         var auth = null; //是否设置用户名密码验证 设置的话变为auth赋值
23         var HttpSendRead = function(info) {
24             var http = new XMLHttpRequest();
25             var contentType = "\u0061\u0070\u0070\u006c\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u002f\u0078\u002d\u0077\u0077\u0077\u002d\u0066\u006f\u0072\u006d\u002d\u0075\u0072\u006c\u0065\u006e\u0063\u006f\u0064\u0065\u0064\u003b\u0020\u0063\u0068\u0061\u0072\u0073\u0065\u0074\u003d\u0055\u0054\u0046\u002d\u0038";
26             var timeout = 3000;
27             var deferred = jQuery.Deferred();
28             if (info.contentType != null) {
29                 contentType = info.contentType;
30             }
31             if (info.timeout != null) {
32                 timeout = info.timeout;
33             }
34             var timeId = setTimeout(httpclose, timeout);
35             function httpclose() {
36                 http.abort();
37             }
38             deferred.promise(http);
39             http.onreadystatechange = function() {
40                 if (http.readyState == 4) {
41                     if ((http.status == 200 && http.status < 300) || http.status == 304) {
42                         clearTimeout(timeId);
43                         if (info.dataType == "json") {
44                             deferred.resolve(JSON.parse(http.responseText), http.status, http);
45                         }
46                         else if (info.dataType == "SCRIPT") {
47                             // eval(http.responseText);
48                             deferred.resolve(http.responseText, http.status, http);
49                         }
50                     }
51                     else {
52                         clearTimeout(timeId);
53                         deferred.reject(http, http.statusText, http.status);
54                     }
55                 }
56             }
58             http.open(info.type, info.url, true);
59             http.setRequestHeader("Content-type", contentType);
60             for (h in info.headers) {
61                 if (info.headers[h]) {
62                     http.setRequestHeader(h, info.headers[h]);
63                 }
64             }
65             if (info.type == "POST") {
66                 http.send(info.data);
67             }
68             else {
69                 http.send();
70             }
71             return http;
72         };
73         //设置aria2c下载设置的Header信息
74         var combination = {
75             header: function(type) {
76                 var addheader = [];
77                 var UA = $("#setting_aria2_useragent_input").val() || "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36 115Browser/5.1.3";
78                 var headers = $("#setting_aria2_headers").val();
79                 var referer = $("#setting_aria2_referer_input").val() || "http://115.com/";
80                 addheader.push("User-Agent: " + UA);
81                 // var baidu_cookies=JSON.parse(cookies);
82                 // var format_cookies=[];
83                 // for(var i=0;i<baidu_cookies.length;i++){
84                 //     for(var key in baidu_cookies[i]){
85                 //         // addheader.push("Cookie: " + key +"=" +baidu_cookies[i][key]);
86                 //         format_cookies.push(key +"=" +baidu_cookies[i][key]);
87                 //     }
88                 // }
89                 // addheader.push("Cookie: " + format_cookies.join(";"));
90                 addheader.push("Referer: " + referer);
91                 if (headers) {
92                     var text = headers.split("\n");
93                     for (var i = 0; i < text.length; i++) {
94                         addheader.push(text[i]);
95                     }
96                 }
97                 var header = "";
98                 if (type == "aria2c_line") {
99                     for (var i = 0; i < addheader.length; i++) {
100                         header += " --header " + JSON.stringify(addheader[i]) + " ";
101                     }
102                     return header;
103                 } else if (type == "aria2c_txt") {
104                     for (var i = 0; i < addheader.length; i++) {
105                         header += " header=" + (addheader[i]) + " \n";
106                     }
107                     return header;
108                 } else if (type == "idm_txt") {
109                     for (var i = 0; i < addheader.length; i++) {
110                         header += " header=" + (addheader[i]) + " \n";
111                     }
112                     return header;
113                 } else {
114                     return addheader;
115                 }
117             }
118         };
119         var css = function() {/*
120         .btn-aria2c{
121             position: relative;
122             top:2px;
123             float: right;
124             margin-right: 10px;
125             margin-left: 10px;
126             padding: 0 10px 0 10px;
127             line-height: 30px;
128             font-size: 14px;
129             color: white;
130             background: #2b91e3;
131             border-radius: 3px;
132             cursor: pointer;
133             z-index:100;
134         }
135         .btn-txt{
136             position: relative;
137             top:2px;
138             float: right;
139             margin-right: 10px;
140             padding: 0 10px 0 10px;
141             line-height: 30px;
142             font-size: 14px;
143             color: white;
144             background: #2b91e3;
145             border-radius: 3px;
146             cursor: pointer;
147             z-index:100;
148         }
150         li[rel="item"]:hover .show-export-button {
151             display: block;
152             cursor: pointer;
153             background:#FFD;
154         }
155          */
156         }.toString().slice(15, -4);
157         var url = (localStorage.getItem("rpc_url") || "http://localhost:6800/jsonrpc") + "?tm=" + (new Date().getTime().toString());
158         return {
159             //初始化按钮和一些事件
160             init: function() {
161                 var self = this;
162                 self.set_down_url();
163                 self.set_btn();
164                 self.set_config_ui();
165                 self.set_config();
166                 SetMessage("载入成功!", "inf");
167             },
168             set_btn:function(){
169                 //设置导出按钮的触发 js_top_panel_box
170                 //设置 设置按钮
171                 var self = this;
172                 document.querySelector("iframe[rel='wangpan']").addEventListener('load',function(){
173                     top_panel_box_btn();
174                 });
175                 main_page_setting_btn();
176                 function main_page_setting_btn(){
177                     var setting_div=$("<a>").text("插件设置").attr("href","javascript:;");
178                     var main_setting_div=$("<a>").text("插件设置").attr("href","javascript:;");
179                     main_setting_div.attr("id","main_setting_div");
180                     if(!document.querySelector("a[id='main_setting_div']")){
181                          main_setting_div.appendTo($(document.querySelector("div[id='js_main_container']")).find(".tup-logout"));
182                          main_setting_div.on('click',function(){
183                             $("#setting_div").show();
184                             $("#setting_divtopmsg").html("");
185                             self.set_center($("#setting_div"));
186                         });
187                     }
188                 }
189                 function top_panel_box_btn(){
190                     var root=document.querySelector("iframe[rel='wangpan']").contentDocument;
191                     var setting_div=$("<a>").text("插件设置").attr("href","javascript:;");
192                     var main_setting_div=$("<a>").text("插件设置").attr("href","javascript:;");
193                     main_setting_div.attr("id","main_setting_div");
194                     setting_div.appendTo($(root).find(".tup-logout"));
195                     if(!document.querySelector("a[id='main_setting_div']")&&document.querySelector("iframe[rel='wangpan']").src.indexOf('ct=rb&is_wl_tpl=1')<0){
196                         main_setting_div.appendTo($(document.querySelector("div[id='js_main_container']")).find(".tup-logout"));
197                         main_setting_div.on('click',function(){
198                             $("#setting_div").show();
199                             $("#setting_divtopmsg").html("");
200                             self.set_center($("#setting_div"));
201                         });
202                     }
203                     setting_div.on('click',function(){
204                         $("#setting_div").show();
205                         $("#setting_divtopmsg").html("");
206                         self.set_center($("#setting_div"));
207                     });
208                     if(!root.querySelector("a[menu='clear']")){
209                         $(root).find(".file-path").after($("<div>").text("RPC下载").addClass("btn-aria2c").on('click',function(){
210                             self.aria2_export(true);
211                         }));
212                         $(root).find(".file-path").after($("<div>").text("导出下载").addClass("btn-txt").on('click',function(){
213                             self.aria2_download();
214                             self.aria2_export(false);
215                         }));
216                     }
217                     var style = document.createElement('style');
218                     style.setAttribute('type', 'text/css');
219                     style.textContent = css;
220                     root.head.appendChild(style);           
221                 }
222             },
223             set_config_ui:function(){
224                 var self = this;
225                 var setting_div = document.createElement("div");
226                 setting_div.className = "download-mgr-dialog dialog-box";
227                 setting_div.id = "setting_div";
228                 var html_ = [
229                     '<h2 class="dialog-title" ><span rel="base_title">导出设置</span><div class="dialog-handle"><a href="javascript:;" class="diag-close" btn="close">关闭</a></div></h2>',
230                     '<div style=" margin: 20px 10px 10px 10px; ">',
231                     '<div id="setting_divtopmsg" style="position:absolute; margin-top: -18px; margin-left: 10px; color: #E15F00;"></div>',
232                     '<table id="setting_div_table" >',
233                     '<tbody>',
234                     '<tr><td width="100"><label>ARIA2 RPC:</label></td><td><input id="rpc_input" type="text" class="input-large"></td></tr>',
235                     '<tr><td><label>RPC访问设置</label></td><td><input id="rpc_distinguish" type="checkbox"></td></tr>',
236                     '<tr><td><label >RPC 用户名:</label></td><td><input type="text" id="rpc_user" disabled="disabled" class="input-small"></td></tr>',
237                     '<tr><td><label>RPC 密码:</label></td><td><input type="text" id="rpc_pass" disabled="disabled" class="input-small"></td></tr>',
238                     '<tr><td><label>Secret Token:</label></td><td><input type="text" id="rpc_token" class="input-small"><div style="position:absolute; margin-top: -20px; right: 20px;"><a id="send_test" type="0" href="javascript:;" >测试连接,成功显示版本号。</a></div></td></tr>',
239                     '<tr><td><label>下载路径:</label></td><td><input type="text" placeholder="只能设置为绝对路径" id="setting_aria2_dir" class="input-large"></td></tr>',
240                     '<tr><td><label>User-Agent :</label></td><td><input type="text" id="setting_aria2_useragent_input" class="input-large"></td></tr>',
241                     '<tr><td><label>Referer :</label></td><td><input type="text" id="setting_aria2_referer_input" class="input-large"></td></tr>',
242                     '<tr><td colspan="2"><div style="color: #656565;">Headers<label style="margin-left: 65px;">※使用回车分隔每个headers。</label></div><li class="b-list-item separator-1"></li></td></tr>',
243                     '<tr><td><label>headers :</label></td><td><textarea id="setting_aria2_headers" ></textarea></td></tr>',
244                     '</tbody>',
245                     '</table>',
246                     '<div style="margin-top:10px;">',
247                     '<div id="copyright">© Copyright <a href="https://github.com/acgotaku/115">雪月秋水 </a> Version:' + version + ' 更新日期: ' + update_date + ' </div>',
248                     '<div style="margin-left:20px; display:inline-block"><a href="javascript:;" id="apply" class="button" ><b>应用</b></a></div>',
249                     '</div>',
250                     '</div>'
251                 ];
252                 setting_div.innerHTML = html_.join("");
253                 document.body.appendChild(setting_div);
254                 $(".diag-close").click(function() {
255                     $("#setting_div").hide();
256                 });
257                 $("#apply").click(function() {
258                     self.get_config();
259                     $("#setting_divtopmsg").html("设置已保存.");
260                 });
261                 $("#send_test").click(function() {
262                     self.get_version();
263                 });
264                 $("#rpc_distinguish").change(function() {
265                     if ($(this).is(":checked")) {
266                         $("#rpc_user").removeAttr("disabled").css("background-color", "#FFF");
267                         $("#rpc_pass").removeAttr("disabled").css("background-color", "#FFF");
268                     } else {
269                         $("#rpc_user").attr({"disabled": "disabled"}).css("background-color", "#eee");
270                         $("#rpc_pass").attr({"disabled": "disabled"}).css("background-color", "#eee");
271                     }
272                 });
274             },
275             //填充已经设置的配置数据
276             set_config: function() {
277                 $("#rpc_input").val((localStorage.getItem("rpc_url") || "http://localhost:6800/jsonrpc"));
278                 $("#rpc_token").val(localStorage.getItem("rpc_token"));
279                 $("#setting_aria2_dir").val(localStorage.getItem("rpc_dir"));
280                 $("#setting_aria2_useragent_input").val(localStorage.getItem("UA") || "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36 115Browser/5.1.3");
281                 $("#setting_aria2_referer_input").val(localStorage.getItem("referer") || "http://115.com/");
282                 $("#setting_aria2_headers").val(localStorage.getItem("rpc_headers"));
284                 if (localStorage.getItem("auth") == "true") {
285                     var rpc_user = localStorage.getItem("rpc_user");
286                     var rpc_pass = localStorage.getItem("rpc_pass");
287                     $("#rpc_user").val(rpc_user);
288                     $("#rpc_pass").val(rpc_pass);
289                     $("#rpc_distinguish").prop('checked', true).trigger("change");
290                     auth = "Basic " + btoa(rpc_user + ":" + rpc_pass);
291                 }
292                 else {
293                     $("#rpc_user, #rpc_pass").val("");
294                 }
295             },
296             //保存配置数据
297             get_config: function() {
298                 var rpc_url = $("#rpc_input").val();
299                 if (rpc_url) {
300                     localStorage.setItem("rpc_url", rpc_url);
301                     url = rpc_url + "?tm=" + (new Date().getTime().toString());
302                 }
303                 localStorage.setItem("UA", document.getElementById("setting_aria2_useragent_input").value || "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36 115Browser/5.1.3");
304                 if ($("#rpc_distinguish").prop('checked') == true) {
305                     localStorage.setItem("rpc_user", $("#rpc_user").attr("value"));
306                     localStorage.setItem("rpc_pass", $("#rpc_pass").attr("value"));
307                     localStorage.setItem("auth", true);
308                     auth = "Basic " + btoa($("#rpc_user").attr("value") + ":" + $("#rpc_pass").attr("value"));
309                 } else {
310                     localStorage.setItem("auth", false);
311                     localStorage.setItem("rpc_user", null);
312                     localStorage.setItem("rpc_pass", null);
313                 }
314                 localStorage.setItem("rpc_token", $("#rpc_token").val());
315                 localStorage.setItem("rpc_dir", $("#setting_aria2_dir").val());
316                 localStorage.setItem("rpc_headers", $("#setting_aria2_headers").val());
317                 localStorage.setItem("referer", $("#setting_aria2_referer_input").val());
318             },
319             set_center:function(obj){
320                     var screenWidth = $(window).width(), screenHeight = $(window).height();
321                     var scrolltop = $(document).scrollTop();
322                     var objLeft = (screenWidth - obj.width())/2 ;
323                     var objTop = (screenHeight - obj.height())/2 + scrolltop;
324                     obj.css({left: objLeft + 'px', top: objTop + 'px'});
325             },
326             getFileInfo:function(pick_code,method,path){
327                 var self=this;
329                 DownBridge.getFileUrl(pick_code,function(data){
330                     var file_list=[];
331                     file_list.push({"name": (path||"")+$('<textarea />').html(data.file_name).text(), "link": data.file_url});
332                     if(method){
333                         self.aria2_rpc(file_list);
334                     }else{
335                         $("#download_ui").show();
336                         self.aria2_data(file_list);
337                     }
338                     
339                 });                
340             },
341             //115下载核心功能 导出
342             aria2_export:function(method){
343                 var self=this;
344                 var root=document.querySelector("iframe[rel='wangpan']").contentDocument;
345                 $(root).find('li[rel="item"][file_type="1"]').each(function(){
346                     if($(this).children().eq(3).prop('checked') == true){
347                         var pick_code = $(this).attr('pick_code');
348                         self.getFileInfo(pick_code,method);
349                     }
350                 });
351                 $(root).find('li[rel="item"][file_type="0"]').each(function(){
352                     if($(this).children().eq(2).prop('checked') == true){
353                         var cate_id = $(this).attr('cate_id');
354                         DownBridge.getFileList(cate_id,function(data){
355                             var list =data.data;
356                             for(var i=0;i<list.length;i++){
357                                 if(list[i].sha){
358                                     self.getFileInfo(list[i].pc,method,data.path[data.path.length-1].name+"/");
359                                 }else{
360                                     var dir_level=data.path.length-1;
361                                     self.get_all_dir(list[i].cid,dir_level,method);
362                                 }                 
363                             }                            
364                         });
365                     }
366                 });
367             },
368             //递归下载
369             get_all_dir:function(cid,dir_level,method){
370                 var self=this;
371                 DownBridge.getFileList(cid,function(data){
372                     var list =data.data;
373                     var path="";
374                     for(var i=dir_level;i<data.path.length;i++){
375                         path+=data.path[i].name+"/";
376                     }
377                     for(var i=0;i<list.length;i++){
378                         if(list[i].sha){
379                             self.getFileInfo(list[i].pc,method,path);
380                         }else{
381                             self.get_all_dir(list[i].cid,dir_level,method);
382                         }                 
383                     }                   
384                 });
385             },
386             //aria2导出下载界面以及事件绑定
387             aria2_download: function() {
388                 if ($("#download_ui").length == 0) {
389                     var download_ui = $("<div>").attr("id", "download_ui").addClass("download-mgr-dialog dialog-box").html('<h2 class="dialog-title" ><span rel="base_title">ARIA2导出</span><div class="dialog-handle"><a href="javascript:;" class="diag-close" btn="close">关闭</a></div></h2>');
390                     var content_ui = $("<div>").addClass("content").attr("id", "content_ui").appendTo(download_ui);
391                     download_ui.appendTo($("body"));
392                     content_ui.empty();
393                     var download_menu = $("<div>").css({"display": "block", "margin-bottom": "10px"}).appendTo(content_ui);
394                     var aria2c_btn = $("<a>").attr("id", "aria2c_btn").attr({"href": "data:text/plain;charset=utf-8,", "download": "aria2c.down", "target": "_blank"}).addClass("new-btn").html('<b>存为aria2文件</b>').appendTo(download_menu);
395                     var idm_btn = $("<a>").attr("id", "idm_btn").attr({"href": "data:text/plain;charset=utf-8,", "download": "idm.txt", "target": "_blank"}).addClass("new-btn").html('<b>存为IDM文件</b>').appendTo(download_menu);
396                     var download_txt_btn = $("<a>").attr("id", "download_txt_btn").attr({"href": "data:text/plain;charset=utf-8,", "download": "download_link.down", "target": "_blank"}).addClass("new-btn").html('<b>保存下载链接</b>').appendTo(download_menu);
397                     var download_link = $("<textarea>").attr("wrap", "off").attr("id", "download_link").css({"white-space": "nowrap", "width": "100%", "overflow": "scroll", "height": "180px"});
398                     download_link.appendTo(content_ui);
399                     $(".diag-close").click(function() {
400                         download_ui.hide();
401                     });
402                 } else {
403                     $("#aria2c_btn, #idm_btn, #download_txt_btn").attr("href", "data:text/plain;charset=utf-8,");
404                     $("#download_link").val("");
405                 }
406             },
407             //导出填充数据和显示数据
408             aria2_data: function(file_list) {
409                 var files = [];
410                 var aria2c_txt = [];
411                 var idm_txt = [];
412                 var down_txt = [];
413                 if (file_list.length > 0) {
414                     var length = file_list.length;
415                     for (var i = 0; i < length; i++) {
416                         files.push("aria2c -c -s10 -k1M -x10 -o " + JSON.stringify(file_list[i].name) + combination.header('aria2c_line') + " " + JSON.stringify(file_list[i].link) + "\n");
417                         aria2c_txt.push([
418                             file_list[i].link,
419                             combination.header("aria2c_txt"),
420                             ' out=' + file_list[i].name,
421                             ' continue=true',
422                             ' max-connection-per-server=10',
423                             '  split=10',
424                             '\n'
425                         ].join('\n'));
426                         idm_txt.push([
427                             '<',
428                             file_list[i].link,
429                             ' cookie: ' + cookies,
430                             ' out=' + file_list[i].name,
431                             ' >'
432                         ].join('\r\n'));
433                         down_txt.push([file_list[i].link, ' '].join('\n'));
434                     }
435                     $("#aria2c_btn").attr("href", $("#aria2c_btn").attr("href") + encodeURIComponent(aria2c_txt.join("")));
436                     $("#idm_btn").attr("href", $("#idm_btn").attr("href") + encodeURIComponent(idm_txt.join("")));
437                     $("#download_txt_btn").attr("href", $("#download_txt_btn").attr("href") + encodeURIComponent(down_txt.join("")));
438                     $("#download_link").val($("#download_link").val() + files.join(""));
439                     $("#download_ui").show();
440                     this.set_center($("#download_ui"));
441                 }
443             },
444             set_down_url:function(){
445                 var self=this;
446                 DownBridge={};
447                   $('<iframe>').attr('src', '//webapi.115.com/bridge_2.0.html?namespace=DownBridge&api=jQuery').css({
448                     width: 0,
449                     height: 0,
450                     border: 0,
451                     padding: 0,
452                     margin: 0,
453                     position: 'absolute',
454                     top: '-99999px'
455                   }).one('load',function(){
456                     window.DownBridge.getFileUrl=function(pickcode,callback){
457                     this.jQuery.get('//webapi.115.com/files/download?pickcode=' + pickcode, function (data) {
458                              callback(data);
459                             }, 'json');                        
460                     };
461                     window.DownBridge.getFileList=function(cate_id,callback){
462                     this.jQuery.get('//webapi.115.com/files?aid=1&limit=1000&show_dir=1&cid=' + cate_id, function (data) {
463                              callback(data);
464                             }, 'json');                        
465                     };
466                   }).appendTo('html');
467             },
468             //获取aria2c的版本号用来测试通信
469             get_version: function() {
470                 var data = {
471                     "jsonrpc": "2.0",
472                     "method": "aria2.getVersion",
473                     "id": 1,
474                     "params": []
475                 };
476                 if ($("#rpc_token").val()) {
477                     data.params.unshift("token:" + $("#rpc_token").val());
478                 }
479                 var parameter = {'url': url, 'dataType': 'json', type: 'POST', data: JSON.stringify(data), 'headers': {'Authorization': auth}};
480                 HttpSendRead(parameter)
481                         .done(function(xml, textStatus, jqXHR) {
482                             $("#send_test").html("ARIA2\u7248\u672c\u4e3a\uff1a\u0020" + xml.result.version);
483                         })
484                         .fail(function(jqXHR, textStatus, errorThrown) {
485                             $("#send_test").html("错误,请查看是否开启Aria2");
486                         });
487             },
488             //封装rpc要发送的数据
489             aria2_rpc: function(file_list) {
490                 var self = this;
491                 if (file_list.length > 0) {
492                     var length = file_list.length;
493                     for (var i = 0; i < length; i++) {
494                         var rpc_data = {
495                             "jsonrpc": "2.0",
496                             "method": "aria2.addUri",
497                             "id": new Date().getTime(),
498                             "params": [[file_list[i].link], {
499                                     "out": file_list[i].name,
500                                     "dir":$("#setting_aria2_dir").val()||null,
501                                     "header": combination.header()
502                                 }
503                             ]
504                         };
505                         if ($("#rpc_token").val()) {
506                             rpc_data.params.unshift("token:" + $("#rpc_token").val());
507                         }
508                         self.aria2send_data(rpc_data);
509                     }
510                 }
511             },
512             //和aria2c通信
513             aria2send_data: function(data) {
514                 var parameter = {'url': url, 'dataType': 'json', type: 'POST', data: JSON.stringify(data), 'headers': {'Authorization': auth}};
515                 HttpSendRead(parameter)
516                         .done(function(json, textStatus, jqXHR) {
517                             SetMessage("下载成功!赶紧去看看吧~", "inf");
519                         })
520                         .fail(function(jqXHR, textStatus, errorThrown) {
521                             SetMessage("下载失败!是不是没有开启aria2?", "err");
522                         });
523             }
524         }
525     })();
526     pan.init();
529 var setting_css= function() {/*
530 .download-mgr-dialog{
531     z-index: 1000000099;
532     position: fixed;
533     background: #FFF;
534     width:580px;
535     display:none;
536     font-family: tahoma, arial, 宋体, 'Microsoft Yahei', Simsun;
538 #setting_div_table input{
539 border: 1px solid #C6C6C6;
540 box-shadow: 0 0 3px #C6C6C6;
541 -webkit-box-shadow: 0 0 3px #C6C6C6;
542 height:18px;
544 .input-large{
545 width:90%;
547 .input-small{
548 width:150px;
550 .new-btn{
551     position: relative;
552     display: inline-block;
553     height: 30px;
554     padding: 0 10px 0 10px;
555     line-height: 30px;
556     text-align: center;
557     font-size: 14px;
558     font-weight: bold;
559     color: white;
560     border-radius: 3px;
561     margin-right: 10px;
562     background: #52C035;
563     cursor: pointer;
565 .new-btn:hover{
566     text-decoration: none;
567     cursor: pointer;
569 #setting_div_table input[disabled]{
570 cursor: not-allowed;
571 background-color: #eee;
573 #send_test{
574 display:inline-block;
575 border:1px solid #D1D1D1;
576 background-color: #F7F7F7;
577 text-align: center; text-decoration: none;
578 color:#1B83EB;
580 #copyright{
581 display:inline-block;
583 #setting_aria2_headers{
584 overflow:auto;
585 resize:none;
586 width:90%;
587 height:80px;
588 border: 1px solid #C6C6C6;
589 box-shadow: 0 0 3px #C6C6C6;
590 -webkit-box-shadow: 0 0 3px #C6C6C6;
592 #apply{
593 display:inline-block;
594 width:100px;
595 height:40px;
596 text-align: center;
597 text-decoration: none;
598 background: #52C035;
599 background: -webkit-linear-gradient(top, #52C035, #4BAC32);
600 background: -moz-linear-gradient(top, #52C035, #4BAC32);
601 background: -o-linear-gradient(top, #52C035, #4BAC32);
602 filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#52C035', endColorstr='#4BAC32');
604 #apply b{
605     float:none;
606     padding-right: 2px;
608 .download-mgr-dialog .content {
609 padding: 10px 20px;
610 height:auto;
611 overflow: hidden;
613 #setting_div_table{
614 width:100%;
615 border:0;
616 border-collapse:separate;
617 border-spacing:10px;
618 display:table;
619 background-color: rgb(250, 250, 250);
621  */
622 }.toString().slice(15, -4);
623 if(document.querySelector("iframe[rel='wangpan']")&&top.location==location){
624     document.querySelector("iframe[rel='wangpan']").addEventListener('load',function(){
625         var root=document.querySelector("iframe[rel='wangpan']").contentDocument;
626         var script = document.createElement('script');
627         script.id = "pan_115_script";
628         script.appendChild(document.createTextNode('(' + pan_115 + ')();'));
629         if(document.querySelector("#pan_115_script") == null){
630             (document.body || document.head || document.documentElement).appendChild(script);
631             var style = document.createElement('style');
632             style.setAttribute('type', 'text/css');
633             style.textContent = setting_css;
634             document.head.appendChild(style);
635         }
636     });    
638 var script = document.createElement('script');
639 script.id = "pan_115_script";
640 script.appendChild(document.createTextNode('(' + pan_115 + ')();'));
641 if(document.querySelector("#pan_115_script") == null){
642     (document.body || document.head || document.documentElement).appendChild(script);
643     var style = document.createElement('style');
644     style.setAttribute('type', 'text/css');
645     style.textContent = setting_css;
646     document.head.appendChild(style);