Last active
August 16, 2016 08:35
-
-
Save lattenwald/3a54190f31d6bde3058f to your computer and use it in GitHub Desktop.
user-js buildmail:.dev.mail.ru Press "q" to get dialog with neatly formatted package names
This file contains 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 Builder packet names | |
// @namespace q.alexander.mailru.builder | |
// @version 0.3 | |
// @description enter something useful | |
// @author Alexander Q <qalexx@gmail.com> | |
// @match http://buildmail.dev.mail.ru/* | |
// @grant none | |
// ==/UserScript== | |
function stuff() { | |
var links = jQuery('a[href^="http://pkg.corp.mail.ru/centos/6/"]:visible').toArray(); | |
var hrefs = links.map(function(l){return l.href}); | |
var packages = hrefs.map(function(h){return h.match("([^/]+)$")[1].replace(/\.[^.]+\.[^.]+$/, "").replace(/-(?=[^-]+-[^-]+$)/, " ")}); | |
var str = packages.join("\n"); | |
console.log(str); | |
jQuery("<div>" + str + "</div>").css('white-space', 'pre').dialog(); | |
} | |
jQuery(document).keypress(function(e){ | |
if(e.keyCode == 113) { | |
stuff(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment