Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: history
Fetching contributors…

Cannot retrieve contributors at this time

108 lines (92 sloc) 4.097 kB
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<head><link href="resources/public/css/tryclojure.css" rel="stylesheet" type="text/css" />
<script src="resources/public/javascript/jquery-1.4.2.min.js" type="text/javascript"></script>
<script src="resources/public/javascript/jquery.console.js" type="text/javascript"></script>
<script src="resources/public/javascript/tryclojure.js" type="text/javascript"></script>
<title>TryClojure</title>
<script type="text/javascript">
var DEBUG = 1;
var TRACE = 2;
var INFO = 3;
function logLevel ()
{
var logLevel_ = localStorage.getItem ("logLevel") * 1;
if (!logLevel_)
{
logLevel_ = DEBUG;
}
return logLevel_;
}
function loadHistory (c)
{
if (logLevel () <= INFO)
{
console.info ("[INFO] Load history");
}
for (var i = 0, cnt = localStorage.length; i < cnt; ++i)
{
var line = localStorage.getItem ("history_" + i);
if (line != "" && line != null)
{
if (logLevel () <= DEBUG)
{
console.debug ("[DEBUG] Try to add to console from history: ", line);
}
c.addToHistory (line);
}
}
}
function addToHistory (line)
{
var index = localStorage.getItem ("index") * 1;
var depth = localStorage.getItem ("historyDepth") * 1;
if (index >= depth)
index = 0;
if (logLevel () <= DEBUG)
{
console.debug ("[DEBUG] Add to history: ", line, " with index ", index);
}
localStorage.setItem ("history_" + index, line);
localStorage.setItem ("index", index + 1);
}
function constructHandle (console_)
{
var selection = "";
chrome.extension.onConnect.addListener (function (port)
{
var tab = port.sender.tab;
port.onMessage.addListener (function (info)
{
if (logLevel () <= INFO)
{
console.info ("[INFO] port.onMessage.handler");
}
loadHistory (console_);
console_.historyChangeHandler (addToHistory);
selection = info.selection;
if (logLevel () <= DEBUG)
{
console.log ("[DEBUG] selection: ", selection);
}
if (selection != "")
{
console_.promptText (selection);
console_.commandTrigger ();
}
});
});
chrome.tabs.executeScript (null, { file : "get-selection.js"});
return selection;
}
</script>
</head>
<body><script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-552543-3']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script><div style="text-align: center;"><h1>Try Clojure</h1></div><div id="container"><div class="console" id="console"></div><!--<table border="0" class="bottom"><tr /><td class="bholder"><div class="buttons"><a class="buttons" id="tutorial">tutorial</a><a class="buttons" id="links">links</a><a class="lbutton" id="about">about</a></div></td><tr /><td><div id="changer"><p class="bottom">Welcome to TryClojure. Above, you have a Clojure REPL. You can type expressions and see their results right here in your browser. We also have a brief tutorial to give you a taste of Clojure. Try it out!</p></div></td></table>--><div id="copyleft">&copy; <a href="http://www.try-clojure.org">try-clojure.org</a></div></div></body>
Jump to Line
Something went wrong with that request. Please try again.