Last active
November 9, 2016 13:52
-
-
Save dnaber-de/8767849 to your computer and use it in GitHub Desktop.
A bookmarklet which brings you directly from a wordpress.org plugin page to the svn repository on plugins.svn.wordpress.org.
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
(function(){var b=document.location.href,a=document.createElement('a'),path=[],protocol='http';a.href=b;path=a.pathname.split('/');if('https:'==a.protocol){protocol='https'}if('wordpress.org'!=a.hostname||'undefined'==typeof path[1]||''==path[1]||'plugins'!=path[1]||'undefined'==typeof path[2]||''==path[2]){alert('It seems you are not facing a wordpress plugin page. The URL must match: worpress.org/plugins/{PLUGIN_NAME}');return}document.location.href=protocol+'://plugins.svn.wordpress.org/'+path[2]+'/trunk/'})(); |
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
( function() { | |
var | |
url = document.location.href, | |
a = document.createElement( 'a' ), | |
path = [], | |
protocol = 'http'; | |
a.href = url; | |
path = a.pathname.split( '/' ); | |
if ( 'https:' == a.protocol ) { | |
protocol = 'https'; | |
} | |
if ( | |
'wordpress.org' != a.hostname | |
|| 'undefined' == typeof path[ 1 ] || '' == path[ 1 ] || 'plugins' != path[ 1 ] | |
|| 'undefined' == typeof path[ 2 ] || '' == path[ 2 ] | |
) { | |
alert( 'It seems you are not facing a wordpress plugin page. The URL must match: worpress.org/plugins/{PLUGIN_NAME}' ); | |
return; | |
} | |
document.location.href = protocol + '://plugins.svn.wordpress.org/' + path[ 2 ] + '/trunk/'; | |
} )(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment