Skip to content

Instantly share code, notes, and snippets.

@rubeniskov
Created July 14, 2015 21:25
Show Gist options
  • Save rubeniskov/ade0680a2741ebe2dc68 to your computer and use it in GitHub Desktop.
Save rubeniskov/ade0680a2741ebe2dc68 to your computer and use it in GitHub Desktop.
svg_sniffer.js
(function(text, input) {
input
.attr('id', 'input_injector')
.appendTo('body')
.val(text)
.css({
'position': 'absolute',
'top': '0',
'left': '0',
'height': '100%',
'width': '100%',
'display': 'block',
'z-index': '999999'
})
.on('click', function() {
var self = this;
self.focus();
self.select();
document.execCommand('Copy', false, null);
setTimeout(function() {
self.remove();
}, 5000)
})
})((function(format) {
return (Array.prototype.slice.call($('.woListItem').map(function() {
return (function(dir, url, name){
return 'mkdir -p ./' + dir +' && ' + 'curl -o ./' + dir + '/' + name + '.svg ' + url;
})(format($(this).attr('data-musclegroup')),$(this).find('img').attr('data-original'), format($(this).find('img').attr('data-wotitle')));
}),0,-1).join(' && '))
})(function(value){
return value.replace(/[\&\,\\/\'\(\)]+/gi,'').replace(/[\s\_\-]+/gi, '_').toLowerCase();
}), $('<textarea>'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment