Last active
December 17, 2015 11:49
-
-
Save shtrih/5604907 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Logs link grabber | |
// @namespace https://gist.github.com/shtrih/5604907 | |
// @version 0.3 | |
// @description enter something useful | |
// @match http://old.4otaku.org/logs* | |
// @copyright 2013+, shtrih | |
// ==/UserScript== | |
function scriptBody() { | |
var container = $('<div/>', { | |
css: { | |
'border-radius': '15px', | |
'background': '#fff', | |
'z-index': '102', | |
'border': '4px solid #525252', | |
'box-shadow': '1px 1px 9px #999', | |
'padding': '10px', | |
'width': '50%', | |
'margin-left': '25%', | |
'position': 'absolute', | |
'text-align': 'left', | |
'display': 'none' | |
} | |
}); | |
container.append( | |
'<ol>' | |
+ $('#logs a').map(function () { | |
var href = $(this).attr('href'); | |
return (/http/).test(href) ? '<li><a href="' + href + '" target="_blank">' + href + '</a></li>' : null; | |
}).get().join('') | |
+ '</ol>' | |
); | |
$('.search_logs_button') | |
.after( | |
$('<input/>', { | |
value: 'Ссылки в логах', | |
click: function () { | |
container.fadeToggle('fast'); | |
} | |
}) | |
) | |
.after(container); | |
} | |
var script = document.createElement('script'); | |
script.textContent = '(' + scriptBody.toString() + ')()'; | |
(document.head||document.documentElement).appendChild(script); | |
script.parentNode.removeChild(script); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment