Skip to content

Instantly share code, notes, and snippets.

View seasick's full-sized avatar
💭
Advertisment space for sale

Clemens seasick

💭
Advertisment space for sale
View GitHub Profile
@seasick
seasick / select2.bookmarklet.js
Last active April 19, 2016 03:52 — forked from hawkrives/select2.bookmarklet.js
Bookmarklet to turn <select>s into <select²>s
javascript:void%20function(){function%20e(e,n){var%20o=document.createElement(%22script%22);o.onload=function(){console.log(e+%22%20loaded%22),n()},o.onerror=function(o){console.log(e+%22%20errored%22,o),n(o)},o.src=e,document.body.appendChild(o)}function%20n(e,n){c.link=document.createElement(%22link%22),c.link.onload=function(){n()},c.link.onerror=function(e){n(e)},c.link.href=e,c.link.rel=%22stylesheet%22,c.link.type=%22text/css%22,document.body.appendChild(c.link)}function%20o(n){return%20window.jquery||window.$%3Fn():void%20e(c.jquery,n)}function%20t(){n(c.css,function(n){return%20n%3Fconsole.log(%22err%20loading%20css%22,n):void%20o(function(n){return%20n%3Fconsole.log(%22err%20loading%20jquery%22,n):void%20e(c.js,function(e){if(e)return%20console.log(%22err%20loading%20select2%20js%22,e);var%20n=[].slice.call(document.querySelectorAll(%22select%22));n.forEach(function(e){jQuery(e).select2({dropdownAutoWidth:!0})})})})})}var%20c={js:%22https://cdn.rawgit.com/select2/select2/3.5.4/select2.min.js%22,css:%