// ==UserScript== // @name 百度网盘批量离线 // @namespace https://greasyfork.org/users/63665 // @homepage https://greasyfork.org/zh-CN/scripts/23426 // @version 0.9 // @description 批量离线辅助脚本 // @author fenghengzhi // @match http://pan.baidu.com/disk/home* // @match http://yun.baidu.com/disk/home* // @match https://pan.baidu.com/disk/home* // @match https://yun.baidu.com/disk/home* // @grant none // @run-at document-end // @require https://code.jquery.com/jquery-3.1.0.min.js // @note v0.2 好用多了,就是有点难看 v0.5简单美化 v0.9大幅更新界面 // @downloadURL none // ==/UserScript== (function() { var urls; var i; function alertWin(title, msg, w, h) { //背景层 var bgObj = $("
").appendTo('body'); bgObj.css({ "position":"absolute", "left":"0px", "top":"0px", "width":"100%", "height":"100%", "opacity":"0.3", "background-color":"#000000", "z-index":"1000" }); //创建一个弹出层 msgObj=$("#offlinelist-dialog").clone().appendTo('body'); msgObj.attr('id','mul-dialog'); msgObj.css('z-index','1001'); msgObj.find('.dialog-drag').mousedown(function (e) { var left, top, $this; left = e.clientX; top = e.clientY; $this = $(this); if(this.setCapture) { this.setCapture(); this.onmousemove = function (ev) { mouseMove(ev || event); }; this.onmouseup = mouseUp; } else{ $(document).bind("mousemove", mouseMove).bind("mouseup", mouseUp); } function mouseMove(e) { var target = msgObj; var l = e.clientX - left + Number(target.css('margin-left').replace(/px$/, '')) || 0; var t = e.clientY - top + Number(target.css('margin-top').replace(/px$/, '')) || 0; //l = Math.min(l, $(window).width() - target.width() - target.position().left); //t = Math.min(t, $(window).height() - target.height() - target.position().top); left = e.clientX; top = e.clientY; target.css({ 'margin-left': l, 'margin-top': t }); } function mouseUp(e) { var el = $this.get(0); if(el.releaseCapture) { el.releaseCapture(); el.onmousemove = el.onmouseup = null; } else{ $(document).unbind("mousemove", mouseMove).unbind("mouseup", mouseUp); } } }); msgObj.find('.dialog-control').click(function() { bgObj.remove(); msgObj.remove(); }); msgObj.find('.select-text').text(title); msgObj.css('width',w); dialogbody=msgObj.find('.dialog-body'); dialogbody.children().remove(); mullineinputbox=$("").attr("id","multi_urls").appendTo(dialogbody); mullineinputbox.css('width','95%').css('height','100px').css('border-radius','4px').css('border','1px solid rgb(196,196,196)'); $('head').append(""); dialogbody.css('text-align','center'); button1=$(''); button1.css({ 'width':'104px', 'height':'34px', 'border-radius':'4px', 'border-style':'none', 'font':"normal normal normal normal 13px / 32px 'Microsoft YaHei': SimSun", 'outline':'none', 'cursor':'pointer' }); button2=button1.clone(); button1.css('background-color',"rgb(59, 140, 255)").css('color','rgb(255,255,255)').text('确定'); button2.css('border','1px solid rgb(192, 217, 255)').css('background-color',"rgb(255,255,255)").css('color','rgb(59, 140, 255)').text('关闭'); $('head').append(""); mullineinputbox.after(button1); button1.after(button2); mullineinputbox.before('