diff --git a/common/lib/capa/capa/templates/editageneinput.html b/common/lib/capa/capa/templates/editageneinput.html index 8dd4fa89d1..8dc9414aed 100644 --- a/common/lib/capa/capa/templates/editageneinput.html +++ b/common/lib/capa/capa/templates/editageneinput.html @@ -1,4 +1,5 @@ -
+
+
% if status == 'unsubmitted': @@ -8,16 +9,11 @@ % elif status == 'incorrect':
% elif status == 'incomplete': -
+
% endif - - - - - - Applet failed to run. No Java plug-in was found. - - + +
+

@@ -37,3 +33,4 @@

% endif
+ diff --git a/common/static/js/capa/edit-a-gene.js b/common/static/js/capa/edit-a-gene.js index 48753e507d..aeb26237c4 100644 --- a/common/static/js/capa/edit-a-gene.js +++ b/common/static/js/capa/edit-a-gene.js @@ -1,27 +1,31 @@ (function () { var timeout = 1000; - function initializeApplet(applet) { - console.log("Initializing " + applet); - waitForApplet(applet); - } + waitForGenex(); - function waitForApplet(applet) { - if (applet.isActive && applet.isActive()) { - console.log("Applet is ready."); - var answerStr = applet.checkAnswer(); - console.log(answerStr); - var input = $('.editageneinput input'); - console.log(input); - input.val(answerStr); - } else if (timeout > 30 * 1000) { - console.error("Applet did not load on time."); - } else { - console.log("Waiting for applet..."); - setTimeout(function() { waitForApplet(applet); }, timeout); + function waitForGenex() { + if (typeof(genex) !== "undefined" && genex) { + genex.onInjectionDone("genex"); + } + else { + setTimeout(function() { waitForGenex(); }, timeout); } } - var applets = $('.editageneinput object'); - applets.each(function(i, el) { initializeApplet(el); }); + //NOTE: + // Genex uses four global functions: + // genexSetDNASequence (exported from GWT) + // genexSetClickEvent (exported from GWT) + // genexSetKeyEvent (exported from GWT) + // It calls genexIsReady with a deferred command when it has finished + // initialization and has drawn itself + genexIsReady = function() { + //Load DNA sequence + var dna_sequence = $('#dna_sequence').val(); + genexSetDNASequence(dna_sequence); + //Now load mouse and keyboard handlers + genexSetClickEvent(); + genexSetKeyEvent(); + }; }).call(this); + diff --git a/common/static/js/capa/genex/1B3B0A256735176413A40727372820E6.cache.html b/common/static/js/capa/genex/1B3B0A256735176413A40727372820E6.cache.html new file mode 100644 index 0000000000..62c5b7a605 --- /dev/null +++ b/common/static/js/capa/genex/1B3B0A256735176413A40727372820E6.cache.html @@ -0,0 +1,633 @@ + + + + \ No newline at end of file diff --git a/common/static/js/capa/genex/3BFB2B59BF73690E64CA963B37E3E6C2.cache.html b/common/static/js/capa/genex/3BFB2B59BF73690E64CA963B37E3E6C2.cache.html new file mode 100644 index 0000000000..f47030bf01 --- /dev/null +++ b/common/static/js/capa/genex/3BFB2B59BF73690E64CA963B37E3E6C2.cache.html @@ -0,0 +1,631 @@ + + + + \ No newline at end of file diff --git a/common/static/js/capa/genex/4EC2E5D94B410DDAB081BBAC4222386F.cache.html b/common/static/js/capa/genex/4EC2E5D94B410DDAB081BBAC4222386F.cache.html new file mode 100644 index 0000000000..090d22b68c --- /dev/null +++ b/common/static/js/capa/genex/4EC2E5D94B410DDAB081BBAC4222386F.cache.html @@ -0,0 +1,618 @@ + + + \ No newline at end of file diff --git a/common/static/js/capa/genex/7504BC625F3CBFF0967F88C441871055.cache.html b/common/static/js/capa/genex/7504BC625F3CBFF0967F88C441871055.cache.html new file mode 100644 index 0000000000..143af1d438 --- /dev/null +++ b/common/static/js/capa/genex/7504BC625F3CBFF0967F88C441871055.cache.html @@ -0,0 +1,631 @@ + + + + \ No newline at end of file diff --git a/common/static/js/capa/genex/88AB039AB796F1D6C3B133DAD892A057.cache.html b/common/static/js/capa/genex/88AB039AB796F1D6C3B133DAD892A057.cache.html new file mode 100644 index 0000000000..a75fd5115e --- /dev/null +++ b/common/static/js/capa/genex/88AB039AB796F1D6C3B133DAD892A057.cache.html @@ -0,0 +1,607 @@ + + + \ No newline at end of file diff --git a/common/static/js/capa/genex/C66BAF3695DBE904ECE0FB5DC56AED92.cache.html b/common/static/js/capa/genex/C66BAF3695DBE904ECE0FB5DC56AED92.cache.html new file mode 100644 index 0000000000..545dcff856 --- /dev/null +++ b/common/static/js/capa/genex/C66BAF3695DBE904ECE0FB5DC56AED92.cache.html @@ -0,0 +1,621 @@ + + + + \ No newline at end of file diff --git a/common/static/js/capa/genex/clear.cache.gif b/common/static/js/capa/genex/clear.cache.gif new file mode 100644 index 0000000000..e565824aaf Binary files /dev/null and b/common/static/js/capa/genex/clear.cache.gif differ diff --git a/common/static/js/capa/genex/genex.css b/common/static/js/capa/genex/genex.css new file mode 100644 index 0000000000..459c854f92 --- /dev/null +++ b/common/static/js/capa/genex/genex.css @@ -0,0 +1,122 @@ +.genex-button { + margin-right: -8px; + height: 40px !important; +} + +.genex-label { + /*font: normal normal normal 10pt/normal 'Open Sans', Verdana, Geneva, sans-serif !important;*/ + /*padding: 4px 0px 0px 10px !important;*/ + font-family: sans-serif !important; + font-size: 13px !important; + font-style: normal !important; + font-variant: normal !important; + font-weight: bold !important; + padding-top: 6px !important; + margin-left: 18px; +} + +.gwt-HTML { + cursor: default; + overflow-x: auto !important; + overflow-y: auto !important; + background-color: rgb(248, 248, 248) !important; +} + +.genex-scrollpanel { + word-wrap: normal !important; + white-space: pre !important; +} + +pre, #dna-strand { + font-family: 'courier new', courier !important; + font-size: 13px !important; + font-style: normal !important; + font-variant: normal !important; + font-weight: normal !important; + border-style: none !important; + background-color: rgb(248, 248, 248) !important; + word-wrap: normal !important; + white-space: pre !important; + overflow-x: visible !important; + overflow-y: visible !important; +} + +.gwt-DialogBox .Caption { + background: #F1F1F1; + padding: 4px 8px 4px 4px; + cursor: default; + font-family: Arial Unicode MS, Arial, sans-serif; + font-weight: bold; + border-bottom: 1px solid #bbbbbb; + border-top: 1px solid #D2D2D2; +} +.gwt-DialogBox .dialogContent { +} +.gwt-DialogBox .dialogMiddleCenter { + padding: 3px; + background: white; +} +.gwt-DialogBox .dialogBottomCenter { + background: url(images/hborder.png) repeat-x 0px -2945px; + -background: url(images/hborder_ie6.png) repeat-x 0px -2144px; +} +.gwt-DialogBox .dialogMiddleLeft { + background: url(images/vborder.png) repeat-y -31px 0px; +} +.gwt-DialogBox .dialogMiddleRight { + background: url(images/vborder.png) repeat-y -32px 0px; + -background: url(images/vborder_ie6.png) repeat-y -32px 0px; +} +.gwt-DialogBox .dialogTopLeftInner { + width: 10px; + height: 8px; + zoom: 1; +} +.gwt-DialogBox .dialogTopRightInner { + width: 12px; + zoom: 1; +} +.gwt-DialogBox .dialogBottomLeftInner { + width: 10px; + height: 12px; + zoom: 1; +} +.gwt-DialogBox .dialogBottomRightInner { + width: 12px; + height: 12px; + zoom: 1; +} +.gwt-DialogBox .dialogTopLeft { + background: url(images/circles.png) no-repeat -20px 0px; + -background: url(images/circles_ie6.png) no-repeat -20px 0px; +} +.gwt-DialogBox .dialogTopRight { + background: url(images/circles.png) no-repeat -28px 0px; + -background: url(images/circles_ie6.png) no-repeat -28px 0px; +} +.gwt-DialogBox .dialogBottomLeft { + background: url(images/circles.png) no-repeat 0px -36px; + -background: url(images/circles_ie6.png) no-repeat 0px -36px; +} +.gwt-DialogBox .dialogBottomRight { + background: url(images/circles.png) no-repeat -8px -36px; + -background: url(images/circles_ie6.png) no-repeat -8px -36px; +} +* html .gwt-DialogBox .dialogTopLeftInner { + width: 10px; + overflow: hidden; +} +* html .gwt-DialogBox .dialogTopRightInner { + width: 12px; + overflow: hidden; +} +* html .gwt-DialogBox .dialogBottomLeftInner { + width: 10px; + height: 12px; + overflow: hidden; +} +* html .gwt-DialogBox .dialogBottomRightInner { + width: 12px; + height: 12px; + overflow: hidden; +} \ No newline at end of file diff --git a/common/static/js/capa/genex/genex.nocache.js b/common/static/js/capa/genex/genex.nocache.js new file mode 100644 index 0000000000..b130ea3689 --- /dev/null +++ b/common/static/js/capa/genex/genex.nocache.js @@ -0,0 +1,18 @@ +function genex(){var P='',xb='" for "gwt:onLoadErrorFn"',vb='" for "gwt:onPropertyErrorFn"',ib='"><\/script>',Z='#',Xb='.cache.html',_='/',lb='//',Qb='1B3B0A256735176413A40727372820E6',Rb='3BFB2B59BF73690E64CA963B37E3E6C2',Sb='4EC2E5D94B410DDAB081BBAC4222386F',Tb='7504BC625F3CBFF0967F88C441871055',Ub='88AB039AB796F1D6C3B133DAD892A057',Wb=':',pb='::',dc=' + +This html file is for Development Mode support. + diff --git a/common/static/js/capa/genex/images/circles.png b/common/static/js/capa/genex/images/circles.png new file mode 100644 index 0000000000..2a84b9c320 Binary files /dev/null and b/common/static/js/capa/genex/images/circles.png differ diff --git a/common/static/js/capa/genex/images/circles_ie6.png b/common/static/js/capa/genex/images/circles_ie6.png new file mode 100644 index 0000000000..3a388fc5d3 Binary files /dev/null and b/common/static/js/capa/genex/images/circles_ie6.png differ diff --git a/common/static/js/capa/genex/images/corner.png b/common/static/js/capa/genex/images/corner.png new file mode 100644 index 0000000000..51aa4582aa Binary files /dev/null and b/common/static/js/capa/genex/images/corner.png differ diff --git a/common/static/js/capa/genex/images/corner_ie6.png b/common/static/js/capa/genex/images/corner_ie6.png new file mode 100644 index 0000000000..5197449254 Binary files /dev/null and b/common/static/js/capa/genex/images/corner_ie6.png differ diff --git a/common/static/js/capa/genex/images/hborder.png b/common/static/js/capa/genex/images/hborder.png new file mode 100644 index 0000000000..ec58ae6126 Binary files /dev/null and b/common/static/js/capa/genex/images/hborder.png differ diff --git a/common/static/js/capa/genex/images/hborder_ie6.png b/common/static/js/capa/genex/images/hborder_ie6.png new file mode 100644 index 0000000000..2268f88a76 Binary files /dev/null and b/common/static/js/capa/genex/images/hborder_ie6.png differ diff --git a/common/static/js/capa/genex/images/thumb_horz.png b/common/static/js/capa/genex/images/thumb_horz.png new file mode 100644 index 0000000000..b43e683e1f Binary files /dev/null and b/common/static/js/capa/genex/images/thumb_horz.png differ diff --git a/common/static/js/capa/genex/images/thumb_vertical.png b/common/static/js/capa/genex/images/thumb_vertical.png new file mode 100644 index 0000000000..bd57f594ac Binary files /dev/null and b/common/static/js/capa/genex/images/thumb_vertical.png differ diff --git a/common/static/js/capa/genex/images/vborder.png b/common/static/js/capa/genex/images/vborder.png new file mode 100644 index 0000000000..6840d11a12 Binary files /dev/null and b/common/static/js/capa/genex/images/vborder.png differ diff --git a/common/static/js/capa/genex/images/vborder_ie6.png b/common/static/js/capa/genex/images/vborder_ie6.png new file mode 100644 index 0000000000..90baeb1f99 Binary files /dev/null and b/common/static/js/capa/genex/images/vborder_ie6.png differ