Skip to content

Instantly share code, notes, and snippets.

@yahelc
Created August 6, 2012 13:58
Show Gist options
  • Save yahelc/3274628 to your computer and use it in GitHub Desktop.
Save yahelc/3274628 to your computer and use it in GitHub Desktop.
Chosen for OpenAir
// ==UserScript==
// @name Chosen for OpenAir
// @author Yahel Carmon
// @description Uses Chosen for Open Air Client Selector. Might break if they change anything. Must set it such that you display ALL CLIENTS in the settings. Use at your own risk.
// @namespace https://gist.github.com/gists/blahblah
// @match https://www.openair.com/timesheet.pl*
// @include https://www.openair.com/timesheet.pl*
// ==/UserScript==
window.unsafeWindow || (
unsafeWindow = (function() {
var el = document.createElement('p');
el.setAttribute('onclick', 'return window;');
return el.onclick();
}())
);
(function(jQuery){
var $ = jQuery;
$.getScript("//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js", function(){
$ = jQuery = unsafeWindow.jQuery;
$("<link>").attr({
type: 'text/css',
rel: 'stylesheet',
href: "https://www.bluestatedigital.com/page/-/js/analytics/stylesheets/chosen.css"
}).appendTo("head");
$.ajax({
cache: true,
url: 'https://raw.github.com/harvesthq/chosen/master/chosen/chosen.jquery.js',
dataType: "script",
success: function() { $("select[id^='customer_project']").chosen();
}
});
});
}(unsafeWindow.jQuery));
@yahelc
Copy link
Author

yahelc commented Aug 6, 2012

Setting the client dropdown to show all is under Personal Settings: http://cl.ly/image/2l3v0M1J2e1D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment