Skip to content

Commit

Permalink
removed applet from HTML and made it dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
benadida committed Mar 12, 2009
1 parent 808a020 commit 6bd9f43
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion helios/templates/base.html
Expand Up @@ -45,6 +45,6 @@ <h2>Elections <span style="border-bottom: 4px solid black;">you</span> can audit

</div>
</div>
<applet codebase="/static" mayscript name="bigint" code="bigint.class" width=1 height=1></applet>
<!-- <applet codebase="/static" mayscript name="bigint" code="bigint.class" width=1 height=1></applet> -->
</body>
</html>
3 changes: 2 additions & 1 deletion helios/templates/booth.html
Expand Up @@ -30,6 +30,7 @@
<br clear="both" />
</div>
</div>
<applet codebase="/static" mayscript name="bigint" code="bigint.class" width=1 height=1></applet>
<div id="applet_div">
</div>
</body>
</html>
12 changes: 6 additions & 6 deletions static/bigint.js
Expand Up @@ -108,20 +108,19 @@ function check_applet() {
alert("Java support required for Helios");
}

// add the applet
if (use_applet) {
$("#applet_div").html('<applet codebase="/static" name="bigint" code="bigint.class" width=1 height=1></applet>');
}

return use_applet;
};

BigInt.use_applet = check_applet();

// Set up the pointer to the applet if necessary, and some
// basic Big Ints that everyone needs (0, 1, 2, and 42)
BigInt.setup = function() {
if(BigInt.use_applet) {
BigInt.APPLET = document.applets["bigint"];
if (BigInt.APPLET == null) {
//setTimeout("BigInt.setup();", 2000);
//return;
}
}

BigInt.ZERO = new BigInt("0",10);
Expand All @@ -133,6 +132,7 @@ BigInt.setup = function() {
// .onload instead of .ready, as I don't think the applet is ready until onload.
// FIXME: something wrong here in the first load
$(document).ready(function() {
BigInt.use_applet = check_applet();
BigInt.setup();
});

Expand Down

0 comments on commit 6bd9f43

Please sign in to comment.