Skip to content

Instantly share code, notes, and snippets.

@clvrobj
Created April 3, 2012 09:19
Show Gist options
  • Save clvrobj/2290615 to your computer and use it in GitHub Desktop.
Save clvrobj/2290615 to your computer and use it in GitHub Desktop.
人人影视yyets.com下载页面添加一个显示选中的下载链接的窗口,方便非ie使用 (dotjs required)
var exposeEd2kCon = $('<input class="button" type="button" value="显示选中链接" style="background-color:#C30604; color:#FFFFFF"/>').click(
function () {
var output = '';
for(var i = 0,array = document.querySelectorAll('.hover.filebox')[0].querySelectorAll('li'); i<array.length-1; i++){
if(array[i].querySelector('input').checked && array[i].querySelector('a').href.length > 0 && array[i].querySelector('a').href.match('-----') === null){
output += array[i].querySelector('a').href + '\n';
}
}
if (!$('#ed2kexpwin').length) {
$('body').append('<div id="ed2kexpwin" style="width:656px;height:168px;left:30px;bottom:0;position:fixed;overflow:scroll;visibility:visible;background-color:#fff;text-align:left;"><textarea rows="8" cols="90"></textarea></div>');
}
$('#ed2kexpwin textarea').val(output).select();
});
$('input[value=复制选中的链接]').after(exposeEd2kCon);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment