Last active
December 16, 2015 20:50
-
-
Save ozh/5495656 to your computer and use it in GitHub Desktop.
Revisions
-
ozh revised this gist
Dec 28, 2013 . 2 changed files with 28 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,28 @@ // Share on Tumlr var d = document, w = window, enc = encodeURIComponent, share = 'tumblr', e = w.getSelection, k = d.getSelection, x = d.selection, s = (e ? e() : (k) ? k() : (x ? x.createRange().text : 0)), s2 = ((s.toString() == '') ? s : '%20%22' + enc(s) + '%22'), f = 'http://sho.rt/admin/index.php', l = d.location.href, ups = l.match( /^[a-zA-Z0-9\+\.-]+:(\/\/)?/ )[0], ur = l.split(new RegExp(ups))[1], ups = ups.split(/\:/), p = '?up=' + enc(ups[0]+':') + '&us=' + enc(ups[1]) + '&ur='+enc(ur) + '&t=' + enc(d.title) + '&s=' + s2 + '&share=' + share, u = f + p; try { throw ('ozhismygod'); } catch (z) { a = function () { if (!w.open(u,'Share','width=450,height=450,left=430','_blank')) l = u; }; if (/Firefox/.test(navigator.userAgent)) setTimeout(a, 0); else a(); } void(0); File renamed without changes. -
ozh revised this gist
Dec 28, 2013 . 2 changed files with 11 additions and 5 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -4,8 +4,11 @@ var d = document, enc = encodeURIComponent, share = 'facebook', f = 'http://sho.rt/admin/index.php', l=d.location.href, ups=l.match( /^[a-zA-Z0-9\+\.-]+:(\/\/)?/ )[0]; var ur=l.split(new RegExp(ups))[1]; var ups=ups.split(/\:/); p = '?up=' + enc(ups[0]+':') + '&us=' + enc(ups[1]) + '&ur=' + enc(ur) + '&t=' + enc(d.title) + '&share=' + share, u = f + p; try { throw ('ozhismygod'); 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 charactersOriginal file line number Diff line number Diff line change @@ -10,14 +10,17 @@ var d = document, s = (e ? e() : (k) ? k() : (x ? x.createRange().text : 0)), s2 = ((s.toString() == '') ? s : '%20%22' + enc(s) + '%22'), f = 'http://sho.rt/admin/index.php', l = d.location.href, ups = l.match( /^[a-zA-Z0-9\+\.-]+:(\/\/)?/ )[0], ur = l.split(new RegExp(ups))[1], ups = ups.split(/\:/), p = '?up=' + enc(ups[0]+':') + '&us=' + enc(ups[1]) + '&ur='+enc(ur) + '&t=' + enc(d.title) + s2 + '&share=' + share, u = f + p; try { throw ('ozhismygod'); } catch (z) { a = function () { if (!w.open(u,'Share','width=780,height=265,left=100','_blank')) l = u; }; if (/Firefox/.test(navigator.userAgent)) setTimeout(a, 0); else a(); -
ozh revised this gist
Dec 28, 2013 . 1 changed file with 12 additions and 12 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,22 +1,22 @@ // Custom Popup (prompt for a keyword + on-page popup) var d = document, l = d.location.href, k = prompt('Custom URL'), enc = encodeURIComponent, ups = l.match( /^[a-zA-Z0-9\+\.-]+:(\/\/)?/ )[0], ur = l.split(new RegExp(ups))[1], ups = ups.split(/\:/), p = '?up='+enc(ups[0]+':')+'&us='+enc(ups[1])+'&ur='+enc(ur)+'&t='+enc(d.title); sc = d.createElement('script'); if (k != null) { window.yourls_callback = function (r) { if (r.short_url) { prompt(r.message, r.short_url); } else { alert('An error occured: ' + r.message); } }; sc.src = 'http://sho.rt/admin/index.php' + p + '&k=' + k + '&jsonp=yourls'; void(d.body.appendChild(sc)); } -
ozh revised this gist
Dec 28, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ Tips: - http://ozh.org/text/ various text utilities, for instance to unescape a bookmarklet - http://jsbeautifier.org/ to prettify and make readable - http://ted.mielczarek.org/code/mozilla/bookmarklet.html to crunch back into a bookmarklet -
ozh revised this gist
Dec 28, 2013 . 7 changed files with 101 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ var d = document, enc = encodeURIComponent, share = 'facebook', f = 'http://sho.rt/admin/index.php', l = d.location, p = '?u=' + enc(l.href) + '&t=' + enc(d.title) + '&share=' + share, u = f + p; 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 charactersOriginal file line number Diff line number Diff line change @@ -9,7 +9,7 @@ var d = document, x = d.selection, s = (e ? e() : (k) ? k() : (x ? x.createRange().text : 0)), s2 = ((s.toString() == '') ? s : '%20%22' + enc(s) + '%22'), f = 'http://sho.rt/admin/index.php', l = d.location, p = '?u=' + enc(l.href) + '&t=' + enc(d.title) + s2 + '&share=' + share, u = f + p; 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ // Simple Standard (new page) var d = document, w = window, enc = encodeURIComponent, e = w.getSelection, k = d.getSelection, x = d.selection, s = (e ? e() : (k) ? k() : (x ? x.createRange().text : 0)), s2 = ((s.toString() == '') ? s : enc(s)), f = 'http://sho.rt/admin/index.php', l = d.location.href, ups = l.match( /^[a-zA-Z0-9\+\.-]+:(\/\/)?/ )[0], ur = l.split(new RegExp(ups))[1], ups = ups.split(/\:/), p = '?up='+enc(ups[0]+':')+'&us='+enc(ups[1])+'&ur='+enc(ur)+'&t='+enc(d.title)+'&s='+s2, u = f + p; try { throw ('ozhismygod'); } catch (z) { a = function () { if (!w.open(u)) l.href = u; }; if (/Firefox/.test(navigator.userAgent)) setTimeout(a, 0); else a(); } void(0); 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ // Simple Popup (in-page popup dialog) var d = document, w = window, sc = d.createElement('script'), l = d.location.href, enc = encodeURIComponent, ups = l.match( /^[a-zA-Z0-9\+\.-]+:(\/\/)?/ )[0], ur = l.split(new RegExp(ups))[1], ups = ups.split(/\:/), p = '?up='+enc(ups[0]+':')+'&us='+enc(ups[1])+'&ur='+enc(ur)+'&t='+enc(d.title); w.yourls_callback = function (r) { if (r.short_url) { prompt(r.message, r.short_url); } else { alert('An error occured: ' + r.message); } }; sc.src = 'http://sho.rt/admin/index.php' + p + '&jsonp=yourls'; void(d.body.appendChild(sc)); 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,30 @@ // Custom Standard (prompt for a keyword) var d = document, enc = encodeURIComponent, e = window.getSelection, k = d.getSelection, x = d.selection, s = (e ? e() : (k) ? k() : (x ? x.createRange().text : 0)), s2 = ((s.toString() == '') ? s : enc(s)), f = 'http://sho.rt/admin/index.php', l = d.location.href, ups = l.match( /^[a-zA-Z0-9\+\.-]+:(\/\/)?/ )[0], ur = l.split(new RegExp(ups))[1], ups = ups.split(/\:/), k = prompt("Custom URL"), k2 = (k ? '&k=' + k : ""), p = '?up='+enc(ups[0]+':')+'&us='+enc(ups[1])+'&ur='+enc(ur)+'&t='+enc(d.title)+'&s='+s2 + k2, u = f + p; if (k != null) { try { throw ('ozhismygod'); } catch (z) { a = function () { if (!w.open(u)) l = u; }; if (/Firefox/.test(navigator.userAgent)) setTimeout(a, 0); else a(); } void(0) } 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ // Custom Popup (prompt for a keyword + on-page popup) var d = document, l = d.location.href, k = prompt('Custom URL'), enc = encodeURIComponent, ups = l.match( /^[a-zA-Z0-9\+\.-]+:(\/\/)?/ )[0], ur = l.split(new RegExp(ups))[1], ups = ups.split(/\:/), p = '?up='+enc(ups[0]+':')+'&us='+enc(ups[1])+'&ur='+enc(ur)+'&t='+enc(d.title); sc = d.createElement('script'); if (k != null) { window.yourls_callback = function (r) { if (r.short_url) { prompt(r.message, r.short_url); } else { alert('An error occured: ' + r.message); } }; sc.src = 'http://sho.rt/admin/index.php' + p + '&k=' + k + '&jsonp=yourls'; void(d.body.appendChild(sc)); } File renamed without changes. -
ozh created this gist
May 1, 2013 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ // Share on Facebook var d = document, enc = encodeURIComponent, share = 'facebook', f = '<?php echo yourls_admin_url("index.php"); ?>', l = d.location, p = '?u=' + enc(l.href) + '&t=' + enc(d.title) + '&share=' + share, u = f + p; try { throw ('ozhismygod'); } catch (z) { a = function () { if (!window.open(u,'Share','width=500,height=340,left=100','_blank')) l.href = u; }; if (/Firefox/.test(navigator.userAgent)) setTimeout(a, 0); else a(); } void(0); 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ // Share on Twitter var d = document, w = window, enc = encodeURIComponent, share = 'twitter', e = w.getSelection, k = d.getSelection, x = d.selection, s = (e ? e() : (k) ? k() : (x ? x.createRange().text : 0)), s2 = ((s.toString() == '') ? s : '%20%22' + enc(s) + '%22'), f = '<?php echo yourls_admin_url("index.php"); ?>', l = d.location, p = '?u=' + enc(l.href) + '&t=' + enc(d.title) + s2 + '&share=' + share, u = f + p; try { throw ('ozhismygod'); } catch (z) { a = function () { if (!w.open(u,'Share','width=780,height=265,left=100','_blank')) l.href = u; }; if (/Firefox/.test(navigator.userAgent)) setTimeout(a, 0); else a(); } void(0); 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ Tips: - http://streetpc.instanceof.me/text-utilities/ to unescape a bookmarklet - http://jsbeautifier.org/ to prettify and make readable - http://ted.mielczarek.org/code/mozilla/bookmarklet.html to crunch back into a bookmarklet