diff --git a/amd/build/textareas.min.js b/amd/build/textareas.min.js index f7c2df89..54a4637a 100644 --- a/amd/build/textareas.min.js +++ b/amd/build/textareas.min.js @@ -6,6 +6,6 @@ * @copyright Richard Lobb, 2015, The University of Canterbury * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -define("qtype_coderunner/textareas",["jquery"],(function($){function initTextArea(){$(this).data("clickInProgress",!1),$(this).data("capturingTab",!0),$(this).on("mousedown",(function(){$(this).data("clickInProgress",!0)})),$(this).on("focusin",(function(){$(this).data("capturingTab",$(this).data("clickInProgress"))})),$(this).on("click",(function(){$(this).data("clickInProgress",!1)})),$(this).on("keydown",(function(e){if(!(window.hasOwnProperty("behattesting")&&window.behattesting||void 0!==e.which&&0===e.which))if(9==e.keyCode&&$(this).data("capturingTab"))(e.shiftKey||insertString(this," "))&&e.preventDefault();else if(13===e.keyCode&&void 0!==this.selectionStart){for(var before=this.value.substring(0,this.selectionStart),eol=before.lastIndexOf("\n"),line=before.substring(eol+1),indent="",i=0;i{div.is(":visible")?(div.hide(),hdr.innerText=hdrText.replace("▾","▸")):(div.show(),div.trigger("mousemove"),hdr.innerText=hdrText.replace("▸","▾"))}))}}})); +define("qtype_coderunner/textareas",["jquery"],(function($){function initTextArea(){$(this).data("clickInProgress",!1),$(this).data("capturingTab",!0),$(this).on("mousedown",(function(){$(this).data("clickInProgress",!0)})),$(this).on("focusin",(function(){$(this).data("capturingTab",$(this).data("clickInProgress"))})),$(this).on("click",(function(){$(this).data("clickInProgress",!1)})),$(this).on("keydown",(function(e){if(!(window.hasOwnProperty("behattesting")&&window.behattesting||void 0!==e.which&&0===e.which))if(9==e.keyCode&&$(this).data("capturingTab"))(e.shiftKey||insertString(this," "))&&e.preventDefault();else if(13===e.keyCode&&void 0!==this.selectionStart){for(var before=this.value.substring(0,this.selectionStart),eol=before.lastIndexOf("\n"),line=before.substring(eol+1),indent="",i=0;i{div.is(":visible")?(div.hide(),hdr.innerText=hdrText.replace("▾","▸")):(div.show(),div.trigger("mousemove"),hdr.innerText=hdrText.replace("▸","▾"))}))}}})); //# sourceMappingURL=textareas.min.js.map \ No newline at end of file diff --git a/amd/build/textareas.min.js.map b/amd/build/textareas.min.js.map index 617c95e6..7a618a33 100644 --- a/amd/build/textareas.min.js.map +++ b/amd/build/textareas.min.js.map @@ -1 +1 @@ -{"version":3,"file":"textareas.min.js","sources":["../src/textareas.js"],"sourcesContent":["/**\n * This file is part of Moodle - http:moodle.org/\n *\n * Moodle is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * Moodle is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with Moodle. If not, see .\n */\n\n/**\n * JavaScript for handling textareas and form actions in CodeRunner question\n * editing forms and student question answering forms.\n *\n * @module qtype_coderunner/textareas\n * @copyright Richard Lobb, 2015, The University of Canterbury\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\n\ndefine(['jquery'], function($) {\n\n /**\n * Function to initialise all code-input text-areas in a page.\n * Used by the form editor but can't be used for question text areas as\n * renderer.php is called once for each question in a quiz, and there is\n * no communication between the questions.\n */\n function setupAllTAs() {\n $('textarea.edit_code').each(initTextArea);\n }\n\n /**\n * Initialise a particular text area (TA), given its ID (which may contain\n * colons, so can't use jQuery selector).\n * @param {string} taId The ID of the textarea html element.\n */\n function initQuestionTA(taId) {\n $(document.getElementById(taId)).each(initTextArea);\n }\n\n\n /**\n * Set up to expand or collapse the question author's answer when the user clicks\n * on the show/hide answer button.\n * @param {string} linkId The ID of the link that the user clicks.\n * @param {sting} divId The ID of the div to be shown or hidden.\n */\n function setupShowHideAnswer(linkId, divId) {\n let link = $(document.getElementById(linkId)),\n div = $(document.getElementById(divId)),\n hdr = link.children()[0], // The
element.\n hdrText = hdr.innerText; // Its body.\n link.click(() => {\n if (div.is(\":visible\")) {\n div.hide();\n hdr.innerText = hdrText.replace(\"\\u25BE\", \"\\u25B8\");\n } else {\n div.show();\n div.trigger('mousemove'); // So user sees contents.\n hdr.innerText = hdrText.replace(\"\\u25B8\", \"\\u25BE\");\n }\n });\n }\n\n /**\n * Set up the JavaScript to handle a text area 'this'.\n * It just does rudimentary autoindent on return and replaces tabs with\n * 4 spaces always.\n * For info on key handling browser inconsistencies see\n * http://unixpapa.com/js/key.html\n * If the AceEditor is handling a text area, this code is unused as\n * the actual textarea is hidden by Ace.\n */\n function initTextArea() {\n var TAB = 9,\n ENTER = 13,\n ESC = 27,\n KEY_M = 77;\n\n $(this).data('clickInProgress', false);\n $(this).data('capturingTab', true);\n\n $(this).on('mousedown', function() {\n /*\n * Event order seems to be (\\ is where the mouse button is pressed, / released):\n * Chrome: \\ mousedown, mouseup, focusin / click.\n * Firefox/IE: \\ mousedown, focusin / mouseup, click.\n */\n $(this).data('clickInProgress', true);\n });\n\n $(this).on('focusin', function() {\n /*\n * At first, pressing TAB moves focus.\n */\n $(this).data('capturingTab', $(this).data('clickInProgress'));\n });\n\n $(this).on('click', function() {\n $(this).data('clickInProgress', false);\n });\n\n $(this).on('keydown', function(e) {\n /*\n * Don't autoindent when behat testing in progress.\n */\n if (window.hasOwnProperty('behattesting') && window.behattesting) { return; }\n\n if (e.which === undefined || e.which !== 0) { // Normal keypress?\n if (e.keyCode == TAB && $(this).data('capturingTab')) {\n /*\n * Ignore SHIFT/TAB. Insert 4 spaces on TAB.\n */\n if (e.shiftKey || insertString(this, \" \")) {\n e.preventDefault();\n }\n }\n else if (e.keyCode === ENTER && this.selectionStart !== undefined) {\n /*\n * Handle autoindent only on non-IE.\n */\n var before = this.value.substring(0, this.selectionStart);\n var eol = before.lastIndexOf(\"\\n\");\n var line = before.substring(eol + 1); // Take from eol to end.\n var indent = \"\";\n for (var i = 0; i < line.length && line.charAt(i) === ' '; i++) {\n indent = indent + \" \";\n }\n if (insertString(this, \"\\n\" + indent)) {\n e.preventDefault();\n }\n /*\n * Once the user has started typing, TAB indents.\n */\n $(this).data('capturingTab', true);\n }\n else if (e.keyCode === KEY_M && e.ctrlKey && !e.altKey) {\n /*\n * CTRL + M toggles TAB capturing mode.\n * This is the short-cut recommended by\n * https:www.w3.org/TR/wai-aria-practices/#richtext.\n */\n $(this).data('capturingTab', !$(this).data('capturingTab'));\n e.preventDefault(); // Firefox uses this for mute audio in current browser tab.\n }\n else if (e.keyCode === ESC) {\n /*\n * ESC always stops capturing TAB.\n */\n $(this).data('capturingTab', false);\n }\n else if (!(e.ctrlKey || e.altKey)) {\n /*\n * Once the user has started typing (not modifier keys) TAB indents.\n */\n $(this).data('capturingTab', true);\n }\n }\n });\n }\n\n /**\n * Insert into the given textarea ta the given string sToInsert.\n * @param {html_element} ta The textarea to be updated.\n * @param {string} sToInsert The string to be inserted at the current selection\n * point.\n */\n function insertString(ta, sToInsert) {\n if (ta.selectionStart !== undefined) { // Firefox etc.\n var before = ta.value.substring(0, ta.selectionStart);\n var selSave = ta.selectionEnd;\n var after = ta.value.substring(ta.selectionEnd, ta.value.length);\n\n /**\n * Update the text field.\n */\n var tmp = ta.scrollTop; // Inhibit annoying auto-scroll.\n ta.value = before + sToInsert + after;\n var pos = selSave + sToInsert.length;\n ta.selectionStart = pos;\n ta.selectionEnd = pos;\n ta.scrollTop = tmp;\n return true;\n\n }\n else if (document.selection && document.selection.createRange) { // IE.\n /*\n * TODO: check if this still works. OLD CODE.\n */\n var r = document.selection.createRange();\n var dr = r.duplicate();\n dr.moveToElementText(ta);\n dr.setEndPoint(\"EndToEnd\", r);\n r.text = sToInsert;\n return true;\n }\n /*\n * Other browsers we can't handle.\n */\n else {\n return false;\n }\n }\n\n return {\n setupAllTAs: setupAllTAs,\n initQuestionTA: initQuestionTA,\n setupShowHideAnswer: setupShowHideAnswer,\n };\n});\n"],"names":["define","$","initTextArea","this","data","on","e","window","hasOwnProperty","behattesting","undefined","which","keyCode","shiftKey","insertString","preventDefault","selectionStart","before","value","substring","eol","lastIndexOf","line","indent","i","length","charAt","ctrlKey","altKey","ta","sToInsert","selSave","selectionEnd","after","tmp","scrollTop","pos","document","selection","createRange","r","dr","duplicate","moveToElementText","setEndPoint","text","setupAllTAs","each","initQuestionTA","taId","getElementById","setupShowHideAnswer","linkId","divId","link","div","hdr","children","hdrText","innerText","click","is","hide","replace","show","trigger"],"mappings":";;;;;;;;AA2BAA,oCAAO,CAAC,WAAW,SAASC,YAsDfC,eAMLD,EAAEE,MAAMC,KAAK,mBAAmB,GAChCH,EAAEE,MAAMC,KAAK,gBAAgB,GAE7BH,EAAEE,MAAME,GAAG,aAAa,WAMpBJ,EAAEE,MAAMC,KAAK,mBAAmB,MAGpCH,EAAEE,MAAME,GAAG,WAAW,WAIlBJ,EAAEE,MAAMC,KAAK,eAAgBH,EAAEE,MAAMC,KAAK,uBAG9CH,EAAEE,MAAME,GAAG,SAAS,WAChBJ,EAAEE,MAAMC,KAAK,mBAAmB,MAGpCH,EAAEE,MAAME,GAAG,WAAW,SAASC,QAIvBC,OAAOC,eAAe,iBAAmBD,OAAOE,mBAEpCC,IAAZJ,EAAEK,OAAmC,IAAZL,EAAEK,UAlCzB,GAmCEL,EAAEM,SAAkBX,EAAEE,MAAMC,KAAK,iBAI7BE,EAAEO,UAAYC,aAAaX,KAAM,UACjCG,EAAES,sBAGL,GA1CD,KA0CKT,EAAEM,cAA6CF,IAAxBP,KAAKa,eAA8B,SAI3DC,OAASd,KAAKe,MAAMC,UAAU,EAAGhB,KAAKa,gBACtCI,IAAMH,OAAOI,YAAY,MACzBC,KAAOL,OAAOE,UAAUC,IAAM,GAC9BG,OAAS,GACJC,EAAI,EAAGA,EAAIF,KAAKG,QAA6B,MAAnBH,KAAKI,OAAOF,GAAYA,IACvDD,QAAkB,IAElBT,aAAaX,KAAM,KAAOoB,SAC1BjB,EAAES,iBAKNd,EAAEE,MAAMC,KAAK,gBAAgB,QAzD7B,KA2DKE,EAAEM,SAAqBN,EAAEqB,UAAYrB,EAAEsB,QAM5C3B,EAAEE,MAAMC,KAAK,gBAAiBH,EAAEE,MAAMC,KAAK,iBAC3CE,EAAES,kBAnEJ,KAqEOT,EAAEM,QAIPX,EAAEE,MAAMC,KAAK,gBAAgB,GAEtBE,EAAEqB,SAAWrB,EAAEsB,QAItB3B,EAAEE,MAAMC,KAAK,gBAAgB,eAYpCU,aAAae,GAAIC,mBACIpB,IAAtBmB,GAAGb,eAA8B,KAC7BC,OAASY,GAAGX,MAAMC,UAAU,EAAGU,GAAGb,gBAClCe,QAAUF,GAAGG,aACbC,MAAQJ,GAAGX,MAAMC,UAAUU,GAAGG,aAAcH,GAAGX,MAAMO,QAKrDS,IAAML,GAAGM,UACbN,GAAGX,MAAQD,OAASa,UAAYG,UAC5BG,IAAML,QAAUD,UAAUL,cAC9BI,GAAGb,eAAiBoB,IACpBP,GAAGG,aAAeI,IAClBP,GAAGM,UAAYD,KACR,EAGN,GAAIG,SAASC,WAAaD,SAASC,UAAUC,YAAa,KAIvDC,EAAIH,SAASC,UAAUC,cACvBE,GAAKD,EAAEE,mBACXD,GAAGE,kBAAkBd,IACrBY,GAAGG,YAAY,WAAYJ,GAC3BA,EAAEK,KAAOf,WACF,SAMA,QAIR,CACHgB,uBAjLA7C,EAAE,sBAAsB8C,KAAK7C,eAkL7B8C,wBA1KoBC,MACpBhD,EAAEoC,SAASa,eAAeD,OAAOF,KAAK7C,eA0KtCiD,6BAhKyBC,OAAQC,WAC7BC,KAAOrD,EAAEoC,SAASa,eAAeE,SACjCG,IAAMtD,EAAEoC,SAASa,eAAeG,QAChCG,IAAMF,KAAKG,WAAW,GACtBC,QAAUF,IAAIG,UAClBL,KAAKM,OAAM,KACHL,IAAIM,GAAG,aACPN,IAAIO,OACJN,IAAIG,UAAYD,QAAQK,QAAQ,IAAU,OAE1CR,IAAIS,OACJT,IAAIU,QAAQ,aACZT,IAAIG,UAAYD,QAAQK,QAAQ,IAAU"} \ No newline at end of file +{"version":3,"file":"textareas.min.js","sources":["../src/textareas.js"],"sourcesContent":["/**\n * This file is part of Moodle - http:moodle.org/\n *\n * Moodle is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * Moodle is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with Moodle. If not, see .\n */\n\n/**\n * JavaScript for handling textareas and form actions in CodeRunner question\n * editing forms and student question answering forms.\n *\n * @module qtype_coderunner/textareas\n * @copyright Richard Lobb, 2015, The University of Canterbury\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\n\ndefine(['jquery'], function($) {\n\n /**\n * Function to initialise all code-input text-areas in a page.\n * Used by the form editor but can't be used for question text areas as\n * renderer.php is called once for each question in a quiz, and there is\n * no communication between the questions.\n */\n function setupAllTAs() {\n $('div.edit_code textarea').each(initTextArea);\n }\n\n /**\n * Initialise a particular text area (TA), given its ID (which may contain\n * colons, so can't use jQuery selector).\n * @param {string} taId The ID of the textarea html element.\n */\n function initQuestionTA(taId) {\n $(document.getElementById(taId)).each(initTextArea);\n }\n\n\n /**\n * Set up to expand or collapse the question author's answer when the user clicks\n * on the show/hide answer button.\n * @param {string} linkId The ID of the link that the user clicks.\n * @param {sting} divId The ID of the div to be shown or hidden.\n */\n function setupShowHideAnswer(linkId, divId) {\n let link = $(document.getElementById(linkId)),\n div = $(document.getElementById(divId)),\n hdr = link.children()[0], // The
element.\n hdrText = hdr.innerText; // Its body.\n link.click(() => {\n if (div.is(\":visible\")) {\n div.hide();\n hdr.innerText = hdrText.replace(\"\\u25BE\", \"\\u25B8\");\n } else {\n div.show();\n div.trigger('mousemove'); // So user sees contents.\n hdr.innerText = hdrText.replace(\"\\u25B8\", \"\\u25BE\");\n }\n });\n }\n\n /**\n * Set up the JavaScript to handle a text area 'this'.\n * It just does rudimentary autoindent on return and replaces tabs with\n * 4 spaces always.\n * For info on key handling browser inconsistencies see\n * http://unixpapa.com/js/key.html\n * If the AceEditor is handling a text area, this code is unused as\n * the actual textarea is hidden by Ace.\n */\n function initTextArea() {\n var TAB = 9,\n ENTER = 13,\n ESC = 27,\n KEY_M = 77;\n\n $(this).data('clickInProgress', false);\n $(this).data('capturingTab', true);\n\n $(this).on('mousedown', function() {\n /*\n * Event order seems to be (\\ is where the mouse button is pressed, / released):\n * Chrome: \\ mousedown, mouseup, focusin / click.\n * Firefox/IE: \\ mousedown, focusin / mouseup, click.\n */\n $(this).data('clickInProgress', true);\n });\n\n $(this).on('focusin', function() {\n /*\n * At first, pressing TAB moves focus.\n */\n $(this).data('capturingTab', $(this).data('clickInProgress'));\n });\n\n $(this).on('click', function() {\n $(this).data('clickInProgress', false);\n });\n\n $(this).on('keydown', function(e) {\n /*\n * Don't autoindent when behat testing in progress.\n */\n if (window.hasOwnProperty('behattesting') && window.behattesting) { return; }\n\n if (e.which === undefined || e.which !== 0) { // Normal keypress?\n if (e.keyCode == TAB && $(this).data('capturingTab')) {\n /*\n * Ignore SHIFT/TAB. Insert 4 spaces on TAB.\n */\n if (e.shiftKey || insertString(this, \" \")) {\n e.preventDefault();\n }\n }\n else if (e.keyCode === ENTER && this.selectionStart !== undefined) {\n /*\n * Handle autoindent only on non-IE.\n */\n var before = this.value.substring(0, this.selectionStart);\n var eol = before.lastIndexOf(\"\\n\");\n var line = before.substring(eol + 1); // Take from eol to end.\n var indent = \"\";\n for (var i = 0; i < line.length && line.charAt(i) === ' '; i++) {\n indent = indent + \" \";\n }\n if (insertString(this, \"\\n\" + indent)) {\n e.preventDefault();\n }\n /*\n * Once the user has started typing, TAB indents.\n */\n $(this).data('capturingTab', true);\n }\n else if (e.keyCode === KEY_M && e.ctrlKey && !e.altKey) {\n /*\n * CTRL + M toggles TAB capturing mode.\n * This is the short-cut recommended by\n * https:www.w3.org/TR/wai-aria-practices/#richtext.\n */\n $(this).data('capturingTab', !$(this).data('capturingTab'));\n e.preventDefault(); // Firefox uses this for mute audio in current browser tab.\n }\n else if (e.keyCode === ESC) {\n /*\n * ESC always stops capturing TAB.\n */\n $(this).data('capturingTab', false);\n }\n else if (!(e.ctrlKey || e.altKey)) {\n /*\n * Once the user has started typing (not modifier keys) TAB indents.\n */\n $(this).data('capturingTab', true);\n }\n }\n });\n }\n\n /**\n * Insert into the given textarea ta the given string sToInsert.\n * @param {html_element} ta The textarea to be updated.\n * @param {string} sToInsert The string to be inserted at the current selection\n * point.\n */\n function insertString(ta, sToInsert) {\n if (ta.selectionStart !== undefined) { // Firefox etc.\n var before = ta.value.substring(0, ta.selectionStart);\n var selSave = ta.selectionEnd;\n var after = ta.value.substring(ta.selectionEnd, ta.value.length);\n\n /**\n * Update the text field.\n */\n var tmp = ta.scrollTop; // Inhibit annoying auto-scroll.\n ta.value = before + sToInsert + after;\n var pos = selSave + sToInsert.length;\n ta.selectionStart = pos;\n ta.selectionEnd = pos;\n ta.scrollTop = tmp;\n return true;\n\n }\n else if (document.selection && document.selection.createRange) { // IE.\n /*\n * TODO: check if this still works. OLD CODE.\n */\n var r = document.selection.createRange();\n var dr = r.duplicate();\n dr.moveToElementText(ta);\n dr.setEndPoint(\"EndToEnd\", r);\n r.text = sToInsert;\n return true;\n }\n /*\n * Other browsers we can't handle.\n */\n else {\n return false;\n }\n }\n\n return {\n setupAllTAs: setupAllTAs,\n initQuestionTA: initQuestionTA,\n setupShowHideAnswer: setupShowHideAnswer,\n };\n});\n"],"names":["define","$","initTextArea","this","data","on","e","window","hasOwnProperty","behattesting","undefined","which","keyCode","shiftKey","insertString","preventDefault","selectionStart","before","value","substring","eol","lastIndexOf","line","indent","i","length","charAt","ctrlKey","altKey","ta","sToInsert","selSave","selectionEnd","after","tmp","scrollTop","pos","document","selection","createRange","r","dr","duplicate","moveToElementText","setEndPoint","text","setupAllTAs","each","initQuestionTA","taId","getElementById","setupShowHideAnswer","linkId","divId","link","div","hdr","children","hdrText","innerText","click","is","hide","replace","show","trigger"],"mappings":";;;;;;;;AA2BAA,oCAAO,CAAC,WAAW,SAASC,YAsDfC,eAMLD,EAAEE,MAAMC,KAAK,mBAAmB,GAChCH,EAAEE,MAAMC,KAAK,gBAAgB,GAE7BH,EAAEE,MAAME,GAAG,aAAa,WAMpBJ,EAAEE,MAAMC,KAAK,mBAAmB,MAGpCH,EAAEE,MAAME,GAAG,WAAW,WAIlBJ,EAAEE,MAAMC,KAAK,eAAgBH,EAAEE,MAAMC,KAAK,uBAG9CH,EAAEE,MAAME,GAAG,SAAS,WAChBJ,EAAEE,MAAMC,KAAK,mBAAmB,MAGpCH,EAAEE,MAAME,GAAG,WAAW,SAASC,QAIvBC,OAAOC,eAAe,iBAAmBD,OAAOE,mBAEpCC,IAAZJ,EAAEK,OAAmC,IAAZL,EAAEK,UAlCzB,GAmCEL,EAAEM,SAAkBX,EAAEE,MAAMC,KAAK,iBAI7BE,EAAEO,UAAYC,aAAaX,KAAM,UACjCG,EAAES,sBAGL,GA1CD,KA0CKT,EAAEM,cAA6CF,IAAxBP,KAAKa,eAA8B,SAI3DC,OAASd,KAAKe,MAAMC,UAAU,EAAGhB,KAAKa,gBACtCI,IAAMH,OAAOI,YAAY,MACzBC,KAAOL,OAAOE,UAAUC,IAAM,GAC9BG,OAAS,GACJC,EAAI,EAAGA,EAAIF,KAAKG,QAA6B,MAAnBH,KAAKI,OAAOF,GAAYA,IACvDD,QAAkB,IAElBT,aAAaX,KAAM,KAAOoB,SAC1BjB,EAAES,iBAKNd,EAAEE,MAAMC,KAAK,gBAAgB,QAzD7B,KA2DKE,EAAEM,SAAqBN,EAAEqB,UAAYrB,EAAEsB,QAM5C3B,EAAEE,MAAMC,KAAK,gBAAiBH,EAAEE,MAAMC,KAAK,iBAC3CE,EAAES,kBAnEJ,KAqEOT,EAAEM,QAIPX,EAAEE,MAAMC,KAAK,gBAAgB,GAEtBE,EAAEqB,SAAWrB,EAAEsB,QAItB3B,EAAEE,MAAMC,KAAK,gBAAgB,eAYpCU,aAAae,GAAIC,mBACIpB,IAAtBmB,GAAGb,eAA8B,KAC7BC,OAASY,GAAGX,MAAMC,UAAU,EAAGU,GAAGb,gBAClCe,QAAUF,GAAGG,aACbC,MAAQJ,GAAGX,MAAMC,UAAUU,GAAGG,aAAcH,GAAGX,MAAMO,QAKrDS,IAAML,GAAGM,UACbN,GAAGX,MAAQD,OAASa,UAAYG,UAC5BG,IAAML,QAAUD,UAAUL,cAC9BI,GAAGb,eAAiBoB,IACpBP,GAAGG,aAAeI,IAClBP,GAAGM,UAAYD,KACR,EAGN,GAAIG,SAASC,WAAaD,SAASC,UAAUC,YAAa,KAIvDC,EAAIH,SAASC,UAAUC,cACvBE,GAAKD,EAAEE,mBACXD,GAAGE,kBAAkBd,IACrBY,GAAGG,YAAY,WAAYJ,GAC3BA,EAAEK,KAAOf,WACF,SAMA,QAIR,CACHgB,uBAjLA7C,EAAE,0BAA0B8C,KAAK7C,eAkLjC8C,wBA1KoBC,MACpBhD,EAAEoC,SAASa,eAAeD,OAAOF,KAAK7C,eA0KtCiD,6BAhKyBC,OAAQC,WAC7BC,KAAOrD,EAAEoC,SAASa,eAAeE,SACjCG,IAAMtD,EAAEoC,SAASa,eAAeG,QAChCG,IAAMF,KAAKG,WAAW,GACtBC,QAAUF,IAAIG,UAClBL,KAAKM,OAAM,KACHL,IAAIM,GAAG,aACPN,IAAIO,OACJN,IAAIG,UAAYD,QAAQK,QAAQ,IAAU,OAE1CR,IAAIS,OACJT,IAAIU,QAAQ,aACZT,IAAIG,UAAYD,QAAQK,QAAQ,IAAU"} \ No newline at end of file diff --git a/amd/src/textareas.js b/amd/src/textareas.js index dc052515..b496c16b 100644 --- a/amd/src/textareas.js +++ b/amd/src/textareas.js @@ -34,7 +34,7 @@ define(['jquery'], function($) { * no communication between the questions. */ function setupAllTAs() { - $('textarea.edit_code').each(initTextArea); + $('div.edit_code textarea').each(initTextArea); } /**