Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// ==UserScript==
// @name Quicktron
// @namespace Quicktron
// @include https://www.quickbase.com/db/8emtadvk*
// @author Dan Diebolt
// @description Adds a mini search form to the QuickBase Community Forum
// ==/UserScript==
// a function that loads jQuery and calls a callback function when jQuery has finished loading
function addJQuery(callback) {
var script = document.createElement("script");
script.setAttribute("src", "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js");
script.addEventListener('load', function() {
var script = document.createElement("script");
script.textContent = "(" + callback.toString() + ")();";
document.body.appendChild(script);
}, false);
document.body.appendChild(script);
}
function main() {
alert("Quicktron Loaded!")
var markup="";
markup +='<table cellspacing="0"> <tbody>';
markup +='<tr>';
markup +='</tr>';
markup +='<form name="searchMiniForm" onsubmit="SrchSubmit(); return true;" action="8emtadvk" method="get">';
markup +='<input type="hidden" value="QuickSearch" name="act" />';
markup +='<tr>';
markup +='<td>';
markup +='<input id="srchtxt" size="30" name="srchtxt" /></td>';
markup +='<td align="left">';
markup +='<input type="submit" value=" Quick Search " /> </td>';
markup +='</tr>';
markup +='</form></tbody>';
markup +='</table>';
$(".QBbrandRight").html(markup);
alert("all done");
}
// load jQuery and execute the main function
addJQuery(main);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.