Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

18 bytes less

  • Loading branch information...
commit ab543b336c624e784a9895b0120dad40ae977c36 1 parent 955df3e
@inky authored
Showing with 8 additions and 7 deletions.
  1. +6 −7 bookmarklets/reblog.js
  2. +2 −0  bookmarklets/reblog.z.js
View
13 bookmarklets/reblog.js
@@ -10,18 +10,17 @@
t = d.title,
u = /\/([0-9]+)($|\/)/.exec(l.pathname),
c = 'inkyrblg',
+ h = 'http://',
p, r, s;
- inkyrblg = function(o) {
- p = o.posts[0];
- w.location = 'http://www.tumblr.com/reblog/' + p.id + '/' + p['reblog-key'];
- };
-
if (u && u[1]) {
d.title = '(Loading...)%20' + t;
- w[c] = eval(c);
+ w[c] = function(o) {
+ p = o.posts[0];
+ w.location = h + 'www.tumblr.com/reblog/' + p.id + '/' + p['reblog-key'];
+ };
s = d.createElement('SCRIPT');
- s.src = 'http://' + l.host + '/api/read/json?callback=' + c + '&id=' + u[1];
+ s.src = h + l.host + '/api/read/json?callback=' + c + '&id=' + u[1];
d.getElementsByTagName('HEAD')[0].appendChild(s);
} else {
alert('This will only work on a Tumblr post page.');
View
2  bookmarklets/reblog.z.js
@@ -1 +1,3 @@
+javascript:(function(){var%20w=window,d=document,l=d.location,t=d.title,u=/\/([0-9]+)($|\/)/.exec(l.pathname),c='inkyrblg',h='http://',p,r,s;if(u&&u[1]){d.title='(Loading...)%20'+t;w[c]=function(o){p=o.posts[0];w.location=h+'www.tumblr.com/reblog/'+p.id+'/'+p['reblog-key'];};s=d.createElement('SCRIPT');s.src=h+l.host+'/api/read/json?callback='+c+'&id='+u[1];d.getElementsByTagName('HEAD')[0].appendChild(s);}else{alert('This%20will%20only%20work%20on%20a%20Tumblr%20post%20page.');}}())
+
javascript:(function(){var%20w=window,d=document,l=d.location,t=d.title,u=/\/([0-9]+)($|\/)/.exec(l.pathname),c='inkyrblg',p,r,s;inkyrblg=function(o){p=o.posts[0];w.location='http://www.tumblr.com/reblog/'+p.id+'/'+p['reblog-key'];};if(u&&u[1]){d.title='(Loading...)%20'+t;w[c]=eval(c);s=d.createElement('SCRIPT');s.src='http://'+l.host+'/api/read/json?callback='+c+'&id='+u[1];d.getElementsByTagName('HEAD')[0].appendChild(s);}else{alert('This%20will%20only%20work%20on%20a%20Tumblr%20post%20page.');}}())
Please sign in to comment.
Something went wrong with that request. Please try again.