Skip to content

Instantly share code, notes, and snippets.

@chicagoworks
Created December 28, 2010 13:49
Show Gist options
  • Save chicagoworks/757214 to your computer and use it in GitHub Desktop.
Save chicagoworks/757214 to your computer and use it in GitHub Desktop.
Sidebar for firefox to help when developing sites, debugging code etc.
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<meta http-equiv="expires" content="-1"/>
<meta http-equiv="pragma" content="no-cache"/>
<title>Scenario Runner</title>
<link href="/public/stylesheets/jquery-ui-1.8.4.custom.css" rel="stylesheet" type="text/css"/>
<link href="/public/stylesheets/jquery-ui-1.8.4.override.css" rel="stylesheet" type="text/css"/>
<script src="/public/javascripts/jquery-1.4.2.js" type="text/javascript"></script>
<script src="/public/javascripts/jquery-ui-1.8.4.js" type="text/javascript"></script>
<script type="text/javascript">
var main, $$;
$(document).ready(function() {
main = window.open('http://localhost:9000', 'browser');
// main.onload = captureBrowserjQuery; //runs on first load
// $(main).load(captureBrowserjQuery); //runs on reload
// function captureBrowserjQuery() {
// $$ = main.jQuery;
// }
//
// $(main.document).ready(function() {
// setTimeout(function() {
// tee = main.jQuery;
// }, 1000);
// });
$(document).ready(function() {
var actions = $('#actions');
for (var name in tests) {
var item = $('<li>' + name + '</li>').click(
function(){
$$ = ($$)?$$:main.jQuery; //get a handle on the jQuery object in the main window
tests[$(this).text()]();
});
actions.append(item);
}
});
});
//$$ = ($$)?$$:main.jQuery;
function showLoading() {
$$(main.document).trigger('ajaxStart')
}
var tests = {
"Show Loading" : function () {
$$(main.document).trigger('ajaxStart');
},
"Hide Loading" : function () {
$$(main.document).trigger('ajaxStop');
}
};
</script>
<style type="text/css">
#actions li {
text-decoration: underline;
cursor: pointer;
}
</style>
</head>
<body id="template">
<ul id="actions">
</ul>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment