您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
加入批量复制链接功能,一个一个链接复制太TM蛋碎了。。
当前为
// ==UserScript== // @name 115美剧天堂&lol电影天堂 by 纯洁的韩总 // @namespace http://www.51fxiang.com/ // @version 1.0.1 // @description 加入批量复制链接功能,一个一个链接复制太TM蛋碎了。。 // @author 51fixang.com // @match *://*.115mj.com/* // @match *://*.loldytt.com/* // @require https://code.jquery.com/jquery-latest.js // @require http://greasyfork.icu/scripts/398993-%E5%A4%8D%E5%88%B6%E8%84%9A%E6%9C%AC/code/%E5%A4%8D%E5%88%B6%E8%84%9A%E6%9C%AC.js?version=785875 // @note 2020-03-30 1.0.0 初版发布 // @note 2020-04-01 1.0.1 加入lol电影天堂功能,并修改部分Bug // @grant none // ==/UserScript== var obj_51fxiang={ addcheckbox:function (){ //alert("dddd"); $(".mox").each(function(i){ //添加各项的checkbox $(this).find(".dwww").prepend("<input type='checkbox' class='dwww_"+i+"' /> "); //添加操作按钮 $(this).find("ul").append("<div class='dww' style='margin-top: 5px;margin-bottom: 10px;border-bottom: 1px solid #f2f2f2;'><input type='checkbox' class='dwww_all_"+i+"' name='dwww_"+i+"' />全选 <input type='button' class='dwww_link_"+i+"' hid='dwww_hidden_"+i+"' spanid='dwww_span_"+i+"' name='dwww_"+i+"' value='复制所选链接' /><span id='dwww_span_"+i+"' style='color:red;cursor:pointer;'>等待复制</span><input type='hidden' id='dwww_hidden_"+i+"' name='dwww_"+i+"' value='' /></div>") }); }, selectall:function(){ $("input[class^='dwww_all_']").change(function(){ var dwww_ = "."+$(this).attr("name"); if($(this).is(":checked")) { $(dwww_).prop("checked","checked"); } else { $(dwww_).removeAttr("checked"); } }); }, copylink:function(){ $("input[class^='dwww_link_']").click(function(i){ var dwww_ = "."+$(this).attr("name"); var links = ""; var count = 0; $(dwww_).each(function(){ if($(this).is(":checked")) { links+=$(this).next().attr("href")+"\r\n"; count++; } }); var spanid = "#"+$(this).attr("spanid"); var h_id = "#"+$(this).attr("hid"); $(h_id).val(links); //alert($(h_id).val()); //obj_51fxiang.copy(links); var clipboard = new ClipboardJS("."+$(this).attr("class"), { text: function() { return $(h_id).val(); } }); clipboard.on('success', function(e) { //alert("复制成功"); $(spanid).text("共"+count+"项 复制成功"); e.clearSelection(); }); clipboard.on('error', function(e) { alert("复制失败"+e.action+"|"+e.trigger+"|"+e.text); }); if(links!='') { $(spanid).unbind("click").click(function(){ obj_51fxiang.dialog(links); }); } }); }, dialog:function(msg){ //http://www.hanwq.com/scripts/artdialog/dialog-plus-min.js //var d = dialog({ // title: '粘贴信息', // content: msg //}); //d.showModal(); alert(msg); }, copy:function copyToClipboard(txt) { if (window.clipboardData) { window.clipboardData.clearData(); clipboardData.setData("Text", txt); alert("复制成功!"); } else if (navigator.userAgent.indexOf("Opera") != -1) { window.location = txt; } else if (window.netscape) { try { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); } catch (e) { alert("被浏览器拒绝!\n请在浏览器地址栏输入'about:config'并回车\n然后将 'signed.applets.codebase_principal_support'设置为'true'"); } var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard); if (!clip) return; var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable); if (!trans) return; trans.addDataFlavor("text/unicode"); var str = new Object(); var len = new Object(); str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString); var copytext = txt; str.data = copytext; trans.setTransferData("text/unicode", str, copytext.length * 2); var clipid = Components.interfaces.nsIClipboard; if (!clip) return false; clip.setData(trans, null, clipid.kGlobalClipboard); alert("复制成功!"); } }, addcheckbox_loldytt:function (){ //alert("dddd"); $(".con4").each(function(i){ var index_id = i+1; //添加操作按钮 $(this).find(".ckall p").append("<a href='javascript:void(0);' id='ckall_"+index_id+"' ck='CopyAddr"+index_id+"' hid='ckall_hidden_"+index_id+"' spanid='ckall_span_"+index_id+"' target='_self' style='margin-left:10px;' class='ckall_class_"+index_id+"'>复制选中的文件</a> <span id='ckall_span_"+index_id+"' style='color:red;cursor:pointer;'>等待复制</span><input type='hidden' id='ckall_hidden_"+index_id+"' ck='CopyAddr"+index_id+"' value='' /></div>"); }); }, copylink_loldytt:function(){ $("a[id^='ckall_']").click(function(i){ //debugger; var dwww_ = $(this).attr("ck"); var links = ""; var count = 0; $("input[name='"+dwww_+"']").each(function(){ if($(this).is(":checked")) { links+=$(this).val()+"\r\n"; count++; } }); var spanid = "#"+$(this).attr("spanid"); var h_id = "#"+$(this).attr("hid"); $(h_id).val(links); //alert($(h_id).val()); //obj_51fxiang.copy(links); var clipboard = new ClipboardJS("."+$(this).attr("class"), { text: function() { return $(h_id).val(); } }); clipboard.on('success', function(e) { //alert("复制成功"); $(spanid).text("共"+count+"项 复制成功"); e.clearSelection(); }); clipboard.on('error', function(e) { alert("复制失败"+e.action+"|"+e.trigger+"|"+e.text); }); if(links!='') { $(spanid).unbind("click").click(function(){ obj_51fxiang.dialog(links); }); } }); } }; (function() { 'use strict'; var domain = document.domain; if(domain.indexOf('115mj')>-1) { obj_51fxiang.addcheckbox(); obj_51fxiang.selectall(); obj_51fxiang.copylink(); } if(domain.indexOf('loldytt')>-1) { obj_51fxiang.addcheckbox_loldytt(); obj_51fxiang.copylink_loldytt(); } })();