Skip to content

Instantly share code, notes, and snippets.

@hobbes3
Created July 20, 2015 15:52
Show Gist options
  • Save hobbes3/1ee298800041042c64dc to your computer and use it in GitHub Desktop.
Save hobbes3/1ee298800041042c64dc to your computer and use it in GitHub Desktop.
OpenAir expenses
// ==UserScript==
// @name openair unsuck
// @version 0.1
// @author [email protected] (revised by [email protected])
// @description makes openair interaction better, by filling out "defaults". Tampermonkey chrome plugin script.
// @namespace https://www.openair.com
// @include https://www.openair.com/envelope.pl*action=edit_ticket*
// @require http://code.jquery.com/jquery-latest.js
// ==/UserScript==
var defaultSettings = {
"department": { id: '#custom_59', val: "Sales : Prof Svcs" },
"attendee": { id: 'textarea[name="custom_37"]', val: "Satoshi" },
"notes": { id: 'textarea[name="notes"]', val: "New expense policy" }
}
$(document).ready(function() {
for (setting in defaultSettings) {
$(defaultSettings[setting].id).val(function() {
var v = $(this).val();
return v === "" || v === "__BLANK" ? defaultSettings[setting].val : v;
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment