ajax_inplaceeditor_test.html 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  4. <head>
  5. <title>script.aculo.us Unit test file</title>
  6. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  7. <script src="../../lib/prototype.js" type="text/javascript"></script>
  8. <script src="../../src/scriptaculous.js" type="text/javascript"></script>
  9. <script src="../../src/unittest.js" type="text/javascript"></script>
  10. <link rel="stylesheet" href="../test.css" type="text/css" />
  11. </head>
  12. <body>
  13. <h1>script.aculo.us Unit test file</h1>
  14. <p>
  15. Tests for <code>Ajax.InPlaceEditor</code> and <code>Ajax.InPlaceCollectionEditor</code> in controls.js
  16. </p>
  17. <!-- Log output -->
  18. <div id="testlog"> </div>
  19. <h1 id="tobeedited">To be edited</h1>
  20. <a id="tobeeditedEditControl" href="#">edit</a>
  21. <p id="newtbe">New to be edited</p>
  22. <p id="newtbe_external">External control for it</p>
  23. <p id="contains_ampersand">Me & Myself</p>
  24. <div id="tobeeditedMultiLine">First line<br/>
  25. Second line<br/>
  26. Third line</div>
  27. <!-- Tests follow -->
  28. <script type="text/javascript" language="javascript" charset="utf-8">
  29. // <![CDATA[
  30. var IPCE_COLLECTION = [
  31. ['tbe', 'To be edited'],
  32. ['ntbe', 'New to be edited'],
  33. ['ntbe2', 'New to be edited 2'],
  34. ['ntbe3', 'New to be edited 3']
  35. ];
  36. new Test.Unit.Runner({
  37. setup: function() { with(this) {
  38. inPlaceEditor = new Ajax.InPlaceEditor($('tobeedited'), '_ajax_inplaceeditor_result.html', {
  39. externalControl: $('tobeeditedEditControl'),
  40. ajaxOptions: {method: 'get'} //override so we can use a static for the result
  41. });
  42. inPlaceEditorMultiLine = new Ajax.InPlaceEditor($('tobeeditedMultiLine'), '_ajax_inplaceeditor_result.html', {
  43. ajaxOptions: {method: 'get'} //override so we can use a static for the result
  44. });
  45. }},
  46. teardown: function() { with(this) {
  47. inPlaceEditor.dispose();
  48. inPlaceEditorMultiLine.dispose();
  49. }},
  50. // Original-version tests, still pass thx to backward compatibility
  51. // Integration test, tests the entire cycle
  52. testInPlaceEditor: function() { with(this) {
  53. Event.simulateMouse('tobeedited','click');
  54. assertHidden($('tobeedited'));
  55. assertNotNull(document.forms[0]);
  56. assertEqual("cancel", document.forms[0].lastChild.innerHTML);
  57. assertVisible(document.forms[0]);
  58. Event.simulateMouse(document.forms[0].lastChild,'click');
  59. assertNull(document.forms[0]);
  60. assertVisible($('tobeedited'));
  61. assertEqual("transparent", Element.getStyle('tobeedited','background-color'));
  62. Event.simulateMouse('tobeedited','mouseover');
  63. Event.simulateMouse('tobeedited','click');
  64. assertEqual("INPUT", document.forms[0].firstChild.tagName);
  65. assertEqual("To be edited", document.forms[0].firstChild.value);
  66. assertEqual("INPUT", document.forms[0].childNodes[1].tagName);
  67. assertEqual("submit", document.forms[0].childNodes[1].type);
  68. assertEqual("To be edited", document.forms[0].firstChild.value);
  69. assert(Element.hasClassName(document.forms[0], 'inplaceeditor-form'),
  70. "form doesn't have proper class: " + document.forms[0].className);
  71. Event.simulateMouse(document.forms[0].childNodes[1],'click');
  72. assertVisible($('tobeedited'));
  73. assertEqual("Saving...", $('tobeedited').innerHTML);
  74. assertEqual("transparent", Element.getStyle('tobeedited','background-color'));
  75. assert(Element.hasClassName($('tobeedited'), 'inplaceeditor-saving'),
  76. "doesn't have saving class");
  77. wait(1000, function() {
  78. assertEqual("Server received: To be edited", $('tobeedited').innerHTML);
  79. assertNull(document.forms[0]);
  80. assertVisible($('tobeedited'));
  81. assert(!Element.hasClassName($('tobeedited'), 'inplaceeditor-saving'));
  82. });
  83. }},
  84. testHovering: function() { with(this) {
  85. Event.simulateMouse('tobeedited','mouseover');
  86. assertEqual("rgb(255, 255, 153)", Element.getStyle('tobeedited','background-color'));
  87. Event.simulateMouse('tobeedited','mouseout');
  88. wait(1100, function() {
  89. assertEqual("transparent", Element.getStyle('tobeedited','background-color'),
  90. "should be transparent after mouse leaves element");
  91. Event.simulateMouse('tobeedited','click');
  92. })
  93. }},
  94. testLoadsTextFromServer: function() { with(this) {
  95. inPlaceEditor.options.loadTextURL = '_ajax_inplaceeditor_text.html';
  96. inPlaceEditor.enterEditMode();
  97. assertEqual('Loading...', inPlaceEditor._form.value.value);
  98. assert(inPlaceEditor._form.value.disabled);
  99. assert(Element.hasClassName(inPlaceEditor._form, 'inplaceeditor-loading'));
  100. wait(1000, function() {
  101. assertEqual('Text from server', inPlaceEditor._form.value.value);
  102. assert(!inPlaceEditor._form.value.disabled);
  103. });
  104. }},
  105. testDisposesProperly: function() { with(this) {
  106. assertEqual("transparent", Element.getStyle('tobeedited','background-color'));
  107. inPlaceEditor.dispose();
  108. assertEqual("transparent", Element.getStyle('tobeedited','background-color'));
  109. assertVisible($('tobeedited'));
  110. Event.simulateMouse('tobeedited','click');
  111. assertVisible($('tobeedited'));
  112. }},
  113. testUsesTextAreaWhenMoreThanOneRows: function() { with(this) {
  114. inPlaceEditor.options.rows = 5;
  115. inPlaceEditor.enterEditMode();
  116. assertEqual("TEXTAREA", document.forms[0].firstChild.tagName);
  117. assertEqual("BR", document.forms[0].childNodes[1].tagName);
  118. }},
  119. testCanSpecifyAllTextsThroughOptions: function() { with(this) {
  120. // swedish translation ;-)
  121. inPlaceEditor.options.okText = "spara";
  122. inPlaceEditor.options.cancelText = "avbryt";
  123. inPlaceEditor.options.savingText = "Sparar...";
  124. inPlaceEditor.enterEditMode();
  125. assertEqual("spara", document.forms[0].lastChild.previousSibling.value);
  126. assertEqual("avbryt", document.forms[0].lastChild.innerHTML);
  127. inPlaceEditor.showSaving();
  128. assertEqual("Sparar...", $('tobeedited').innerHTML);
  129. }},
  130. testCanSpecifyFormIdThroughOptions: function() { with(this) {
  131. inPlaceEditor.enterEditMode();
  132. // default form id
  133. assertEqual("tobeedited-inplaceeditor", document.forms[0].id);
  134. inPlaceEditor.leaveEditMode();
  135. inPlaceEditor.options.formId = "myFormId";
  136. inPlaceEditor.enterEditMode();
  137. assertEqual("myFormId", document.forms[0].id);
  138. }},
  139. testCantEditWhileSaving: function() { with(this) {
  140. inPlaceEditor.prepareSubmission();
  141. Event.simulateMouse('tobeedited','mouseover');
  142. assertEqual("transparent", Element.getStyle('tobeedited','background-color'));
  143. Event.simulateMouse('tobeedited','click');
  144. assertVisible($('tobeedited'));
  145. }},
  146. testCallbackFunctionGetsCalled: function() { with(this) {
  147. var called = false;
  148. inPlaceEditor.options.callback = function(form) {
  149. called = true;
  150. }
  151. Event.simulateMouse('tobeedited','click');
  152. Event.simulateMouse(document.forms[0].childNodes[1],'click');
  153. assert(called, "callback was not called");
  154. }},
  155. testCanUseExternalElementToGoIntoEditMode: function() { with(this) {
  156. Event.simulateMouse('tobeeditedEditControl','click');
  157. assertNotNull(document.forms[0], "external control didn't work");
  158. // doesn't work if you click it again while in edit mode
  159. Event.simulateMouse('tobeeditedEditControl','click');
  160. assertNull(document.forms[1], "external control created two forms");
  161. assertNotVisible($('tobeeditedEditControl'));
  162. Event.simulateMouse(document.forms[0].childNodes[2],'click');
  163. assertVisible($('tobeeditedEditControl'));
  164. }},
  165. // Rewritten-version tests
  166. testControlOptions: function() {with(this) {
  167. // Default, then explicit default-equivalent, settings
  168. [{}, { okControl: 'button', cancelControl: 'link' }].each(function(opts) {
  169. var ipe = new Ajax.InPlaceEditor('newtbe', '', opts);
  170. Event.simulateMouse('newtbe', 'click');
  171. var submits = $('newtbe-inplaceeditor').getInputs('submit');
  172. assertEqual(1, submits.length, 'Not just one submit');
  173. assertEqual(Ajax.InPlaceEditor.DefaultOptions.okText, submits[0].value, 'Incorrect button label');
  174. assert(submits[0].hasClassName('editor_ok_button'), 'Missing class name on ok button');
  175. var links = $$('#newtbe-inplaceeditor a');
  176. assertEqual(1, links.length, 'Not just one link');
  177. assertEqual(Ajax.InPlaceEditor.DefaultOptions.cancelText, links[0].firstChild.nodeValue, 'Incorrect cancel link text');
  178. assert(links[0].href.endsWith('#'), 'Incorrect cancel link href');
  179. assert(links[0].hasClassName('editor_cancel_link'), 'Missing class name on cancel link');
  180. ipe.dispose();
  181. });
  182. // Reverse: ok link, cancel button
  183. var ipe = new Ajax.InPlaceEditor('newtbe', '', { okControl: 'link', cancelControl: 'button' });
  184. Event.simulateMouse('newtbe', 'click');
  185. var links = $$('#newtbe-inplaceeditor a');
  186. assertEqual(1, links.length, 'Not just one link');
  187. assertEqual(Ajax.InPlaceEditor.DefaultOptions.okText, links[0].firstChild.nodeValue, 'Incorrect ok link text');
  188. assert(links[0].href.endsWith('#'), 'Incorrect ok link href');
  189. assert(links[0].hasClassName('editor_ok_link'), 'Missing class name on ok link');
  190. var submits = $('newtbe-inplaceeditor').getInputs('submit');
  191. assertEqual(1, submits.length, 'Not just one submit');
  192. assertEqual(Ajax.InPlaceEditor.DefaultOptions.cancelText, submits[0].value, 'Incorrect button label');
  193. assert(submits[0].hasClassName('editor_cancel_button'), 'Missing class name on cancel button');
  194. ipe.dispose();
  195. // Full links
  196. ipe = new Ajax.InPlaceEditor('newtbe', '', { okControl: 'link' });
  197. Event.simulateMouse('newtbe', 'click');
  198. var links = $$('#newtbe-inplaceeditor a');
  199. assertEqual(2, links.length, 'There should be two links');
  200. assertEqual(Ajax.InPlaceEditor.DefaultOptions.okText, links[0].firstChild.nodeValue, 'Incorrect ok link text');
  201. assertEqual(Ajax.InPlaceEditor.DefaultOptions.cancelText, links[1].firstChild.nodeValue, 'Incorrect cancel link text');
  202. assert(links[0].href.endsWith('#'), 'Incorrect ok link href');
  203. assert(links[1].href.endsWith('#'), 'Incorrect cancel link href');
  204. assert(links[0].hasClassName('editor_ok_link'), 'Missing class name on ok link');
  205. assert(links[1].hasClassName('editor_cancel_link'), 'Missing class name on cancel link');
  206. var submits = $('newtbe-inplaceeditor').getInputs('submit');
  207. assertEqual(0, submits.length, 'There should be no submit');
  208. ipe.dispose();
  209. // Full buttons
  210. ipe = new Ajax.InPlaceEditor('newtbe', '', { cancelControl: 'button' });
  211. Event.simulateMouse('newtbe', 'click');
  212. var submits = $('newtbe-inplaceeditor').getInputs('submit');
  213. assertEqual(2, submits.length, 'There should be two submits');
  214. assertEqual(Ajax.InPlaceEditor.DefaultOptions.okText, submits[0].value, 'Incorrect ok button text');
  215. assertEqual(Ajax.InPlaceEditor.DefaultOptions.cancelText, submits[1].value, 'Incorrect cancel button text');
  216. assert(submits[0].hasClassName('editor_ok_button'), 'Missing class name on ok button');
  217. assert(submits[1].hasClassName('editor_cancel_button'), 'Missing class name on cancel button');
  218. var links = $$('#newtbe-inplaceeditor a');
  219. assertEqual(0, links.length, 'There should be no link');
  220. ipe.dispose();
  221. // No cancel
  222. ipe = new Ajax.InPlaceEditor('newtbe', '', { cancelControl: false });
  223. Event.simulateMouse('newtbe', 'click');
  224. var submits = $('newtbe-inplaceeditor').getInputs('submit');
  225. assertEqual(1, submits.length, 'Not just one submit');
  226. var links = $$('#newtbe-inplaceeditor a');
  227. assertEqual(0, links.length, 'There should be no link');
  228. ipe.dispose();
  229. // No OK
  230. ipe = new Ajax.InPlaceEditor('newtbe', '', { okControl: false });
  231. Event.simulateMouse('newtbe', 'click');
  232. var submits = $('newtbe-inplaceeditor').getInputs('submit');
  233. assertEqual(0, submits.length, 'There should be no submit');
  234. var links = $$('#newtbe-inplaceeditor a');
  235. assertEqual(1, links.length, 'Not just one link');
  236. ipe.dispose();
  237. // Nothing
  238. ipe = new Ajax.InPlaceEditor('newtbe', '', { okControl: false, cancelControl: false });
  239. Event.simulateMouse('newtbe', 'click');
  240. var submits = $('newtbe-inplaceeditor').getInputs('submit');
  241. assertEqual(0, submits.length, 'There should be no submit');
  242. var links = $$('#newtbe-inplaceeditor a');
  243. assertEqual(0, links.length, 'There should be no link');
  244. ipe.dispose();
  245. // Texts: default mode
  246. ipe = new Ajax.InPlaceEditor('newtbe', '', { okControl: false, cancelControl: false });
  247. Event.simulateMouse('newtbe', 'click');
  248. var submits = $('newtbe-inplaceeditor').getInputs('submit');
  249. assertEqual(0, submits.length, 'There should be no submit');
  250. var links = $$('#newtbe-inplaceeditor a');
  251. assertEqual(0, links.length, 'There should be no link');
  252. ipe.dispose();
  253. // Texts: before w/ controls
  254. ipe = new Ajax.InPlaceEditor('newtbe', '', { textBeforeControls: '[' });
  255. Event.simulateMouse('newtbe', 'click');
  256. var text = $('newtbe-inplaceeditor').childNodes[1];
  257. assertEqual(3, text.nodeType, 'Missing/misplaced initial text');
  258. assertEqual('[', text.nodeValue, 'Incorrect text');
  259. ipe.dispose();
  260. // Texts: after w/ controls
  261. ipe = new Ajax.InPlaceEditor('newtbe', '', { textAfterControls: ']' });
  262. Event.simulateMouse('newtbe', 'click');
  263. var text = $('newtbe-inplaceeditor').childNodes[3];
  264. assertEqual(3, text.nodeType, 'Missing/misplaced final text');
  265. assertEqual(']', text.nodeValue, 'Incorrect text');
  266. ipe.dispose();
  267. // Texts: between w/ controls
  268. ipe = new Ajax.InPlaceEditor('newtbe', '', { textBetweenControls: ' ' });
  269. Event.simulateMouse('newtbe', 'click');
  270. var text = $('newtbe-inplaceeditor').childNodes[2];
  271. assertEqual(3, text.nodeType, 'Missing/misplaced middle text');
  272. assertEqual(' ', text.nodeValue, 'Incorrect text');
  273. ipe.dispose();
  274. // Texts: before w/ no control
  275. ipe = new Ajax.InPlaceEditor('newtbe', '', { textBeforeControls: '[', okControl: false, cancelControl: false });
  276. Event.simulateMouse('newtbe', 'click');
  277. var nodes = $('newtbe-inplaceeditor').childNodes;
  278. assertEqual(1, nodes.length, 'Too many nodes in the form.');
  279. ipe.dispose();
  280. // Texts: after w/ no control
  281. ipe = new Ajax.InPlaceEditor('newtbe', '', { textAfterControls: ']', okControl: false, cancelControl: false });
  282. Event.simulateMouse('newtbe', 'click');
  283. var nodes = $('newtbe-inplaceeditor').childNodes;
  284. assertEqual(1, nodes.length, 'Too many nodes in the form.');
  285. ipe.dispose();
  286. // Texts: between w/ less than two controls
  287. ipe = new Ajax.InPlaceEditor('newtbe', '', { textBetweenControls: ' ', okControl: false });
  288. Event.simulateMouse('newtbe', 'click');
  289. var nodes = $('newtbe-inplaceeditor').childNodes;
  290. assertEqual(2, nodes.length, 'The form should have only two nodes (edit+cancel)');
  291. assertEnumEqual(['input', 'a'], $A(nodes).pluck('tagName').invoke('toLowerCase'), 'Incorrect nodes');
  292. ipe.dispose();
  293. }},
  294. testExternalControlOnly: function() {with(this) {
  295. var ipe = new Ajax.InPlaceEditor('newtbe', '_ajax_inplaceeditor_result2.html', {
  296. externalControl: 'newtbe_external'
  297. });
  298. Event.simulateMouse('newtbe', 'click');
  299. assert(ipe._editing, 'Clicking on the element should turn editable.');
  300. ipe.leaveEditMode();
  301. Event.simulateMouse('newtbe_external', 'click');
  302. assert(ipe._editing, 'Clicking on the external control should turn editable.');
  303. ipe.dispose();
  304. ipe = new Ajax.InPlaceEditor('newtbe', '_ajax_inplaceeditor_result2.html', {
  305. externalControl: 'newtbe_external', externalControlOnly: true
  306. });
  307. Event.simulateMouse('newtbe', 'click');
  308. assert(!ipe._editing, 'Clicking on the element should not turn editable.');
  309. Event.simulateMouse('newtbe_external', 'click');
  310. assert(ipe._editing, 'Clicking on the external control should turn editable.');
  311. ipe.dispose();
  312. }},
  313. testNewCallbacks: function() {with(this) {
  314. var called = [];
  315. var opts = {
  316. onEnterHover: function() { called.push('onEnterHover') },
  317. onEnterEditMode: function() { called.push('onEnterEditMode') },
  318. onLeaveEditMode: function() { called.push('onLeaveEditMode') },
  319. callback: function(form) {
  320. called.push('callback');
  321. return form.serialize();
  322. },
  323. onFailure: function() { called.push('onFailure') },
  324. onComplete: function() { called.push('onComplete') },
  325. onLeaveEditMode: function() { called.push('onLeaveEditMode') }
  326. }
  327. // Proper success
  328. $('newtbe').update('New to be edited');
  329. var ipe = new Ajax.InPlaceEditor('newtbe', '_ajax_inplaceeditor_result2.html', opts);
  330. Event.simulateMouse('newtbe', 'mouseover');
  331. Event.simulateMouse('newtbe', 'click');
  332. Event.simulateKey('newtbe', 'keydown', { keyCode: Event.KEY_RETURN });
  333. var postUpdateHTML;
  334. wait(1000, function() {
  335. assertEnumEqual(['onEnterHover', 'onEnterEditMode', 'callback', 'onLeaveEditMode', 'onComplete'],
  336. called.uniq(), 'Incorrect callback sequence');
  337. postUpdateHTML = $('newtbe').innerHTML.strip();
  338. assertEqual('New to be edited - edited', postUpdateHTML, 'Update trouble');
  339. ipe.dispose();
  340. // Failure
  341. called.clear();
  342. // Any ideas? Requesting file:// URLs on non-existent stuff doesn't trigger A.U's onFailure...
  343. });
  344. }},
  345. testCallbackFunctionReturnTypes: function() { with(this) {
  346. var params = [];
  347. var responder = {
  348. onCreate: function(req) {
  349. params.push(req.options.parameters);
  350. }
  351. };
  352. Ajax.Responders.register(responder);
  353. var ipe = new Ajax.InPlaceEditor('newtbe', '_ajax_inplaceeditor_result2.html', {
  354. callback: function(form) {
  355. return 'foo=bar';
  356. }
  357. });
  358. Event.simulateMouse('newtbe', 'click');
  359. Event.simulateKey('newtbe', 'keydown', { keyCode: Event.KEY_RETURN });
  360. wait(200, function() {
  361. assert(params[0] && params[0].foo == 'bar');
  362. ipe.dispose();
  363. ipe = new Ajax.InPlaceEditor('newtbe', '_ajax_inplaceeditor_result2.html', {
  364. callback: function(form) {
  365. return { bar: '?', 'r&d': 42 };
  366. }
  367. });
  368. Event.simulateMouse('newtbe', 'click');
  369. Event.simulateKey('newtbe', 'keydown', { keyCode: Event.KEY_RETURN });
  370. wait(200, function() {
  371. assert(params[1] && params[1].bar == '?' && params[1]['r&d'] == 42);
  372. ipe.dispose();
  373. Ajax.Responders.unregister(responder);
  374. })
  375. });
  376. }},
  377. testHtmlResponse: function() {with(this) {
  378. // Default (true) -> A.U w/ evalScripts: true
  379. $('newtbe').update('New to be edited');
  380. var ipe = new Ajax.InPlaceEditor('newtbe', '_ajax_inplaceeditor_result2.html');
  381. Event.simulateMouse('newtbe', 'mouseover');
  382. Event.simulateMouse('newtbe', 'click');
  383. Event.simulateKey('newtbe', 'keydown', { keyCode: Event.KEY_RETURN });
  384. var postUpdateHTML;
  385. wait(1000, function() {
  386. postUpdateHTML = $('newtbe').innerHTML.strip();
  387. assertEqual('New to be edited - edited', postUpdateHTML, 'Should have updated contents');
  388. ipe.dispose();
  389. // Explicit htmlResponse: true -> A.U w/ evalScripts: true
  390. $('newtbe').update('New to be edited');
  391. ipe = new Ajax.InPlaceEditor('newtbe', '_ajax_inplaceeditor_result2.html', { htmlResponse: true });
  392. Event.simulateMouse('newtbe', 'mouseover');
  393. Event.simulateMouse('newtbe', 'click');
  394. Event.simulateKey('newtbe', 'keydown', { keyCode: Event.KEY_RETURN });
  395. wait(1000, function() {
  396. postUpdateHTML = $('newtbe').innerHTML.strip();
  397. assertEqual('New to be edited - edited', postUpdateHTML, 'Should have updated contents');
  398. ipe.dispose();
  399. // Explicit htmlResponse: false -> A.R
  400. $('newtbe').update('New to be edited');
  401. ipe = new Ajax.InPlaceEditor('newtbe', '_ajax_inplaceeditor_result2.html', { htmlResponse: false });
  402. Event.simulateMouse('newtbe', 'mouseover');
  403. Event.simulateMouse('newtbe', 'click');
  404. Event.simulateKey('newtbe', 'keydown', { keyCode: Event.KEY_RETURN });
  405. wait(1000, function() {
  406. postUpdateHTML = $('newtbe').innerHTML.strip();
  407. assertEqual(ipe.options.savingText, postUpdateHTML, 'Should not have updated contents');
  408. ipe.dispose();
  409. });
  410. });
  411. });
  412. }},
  413. testSingleOrMultipleRows: function() {with(this) {
  414. // Single-line value, rows <= 1 -> 1
  415. $('newtbe').update('New to be edited');
  416. var ipe = new Ajax.InPlaceEditor('newtbe',
  417. '_ajax_inplaceeditor_result2.html');
  418. Event.simulateMouse('newtbe', 'mouseover');
  419. Event.simulateMouse('newtbe', 'click');
  420. assertEqual('input', ipe._controls.editor.tagName.toLowerCase());
  421. ipe.dispose();
  422. // Single-line value, rows > 1 (2) -> 2
  423. var ipe = new Ajax.InPlaceEditor('newtbe',
  424. '_ajax_inplaceeditor_result2.html', { rows: 2 });
  425. Event.simulateMouse('newtbe', 'mouseover');
  426. Event.simulateMouse('newtbe', 'click');
  427. assertEqual('textarea', ipe._controls.editor.tagName.toLowerCase());
  428. assertEqual(2, ipe._controls.editor.rows);
  429. ipe.dispose();
  430. // Multiple-line value, rows <= 1, autoRows default (3) -> 3
  431. $('newtbe').update('Line 1\nLine 2\nLine 3');
  432. var ipe = new Ajax.InPlaceEditor('newtbe',
  433. '_ajax_inplaceeditor_result2.html');
  434. Event.simulateMouse('newtbe', 'mouseover');
  435. Event.simulateMouse('newtbe', 'click');
  436. assertEqual('textarea', ipe._controls.editor.tagName.toLowerCase());
  437. assertEqual(Ajax.InPlaceEditor.DefaultOptions.autoRows, ipe._controls.editor.rows);
  438. ipe.dispose();
  439. // Multiple-line value, rows <= 1, autoRows custom (5) -> 5
  440. var ipe = new Ajax.InPlaceEditor('newtbe',
  441. '_ajax_inplaceeditor_result2.html', { autoRows: 5 });
  442. Event.simulateMouse('newtbe', 'mouseover');
  443. Event.simulateMouse('newtbe', 'click');
  444. assertEqual('textarea', ipe._controls.editor.tagName.toLowerCase());
  445. assertEqual(5, ipe._controls.editor.rows);
  446. ipe.dispose();
  447. // Multiple-line value, rows > 1 (2), autoRows default (3) -> 2
  448. var ipe = new Ajax.InPlaceEditor('newtbe',
  449. '_ajax_inplaceeditor_result2.html', { rows: 2 });
  450. Event.simulateMouse('newtbe', 'mouseover');
  451. Event.simulateMouse('newtbe', 'click');
  452. assertEqual('textarea', ipe._controls.editor.tagName.toLowerCase());
  453. assertEqual(2, ipe._controls.editor.rows);
  454. ipe.dispose();
  455. // Multiple-line value, rows > 1 (2), autoRows custom (5) -> 2
  456. var ipe = new Ajax.InPlaceEditor('newtbe',
  457. '_ajax_inplaceeditor_result2.html', { rows: 2, autoRows: 5 });
  458. Event.simulateMouse('newtbe', 'mouseover');
  459. Event.simulateMouse('newtbe', 'click');
  460. assertEqual('textarea', ipe._controls.editor.tagName.toLowerCase());
  461. assertEqual(2, ipe._controls.editor.rows);
  462. ipe.dispose();
  463. }},
  464. testFormCustomizationCallback: function() {with(this) {
  465. var ipe = new Ajax.InPlaceEditor('newtbe', '_ajax_inplaceeditor_result2.html', {
  466. onFormCustomization: function(ipe, form) {
  467. form.appendChild(new Element('input', { type: 'text', name: 'test', value: 'foobar' }));
  468. }
  469. });
  470. Event.simulateMouse('newtbe', 'mouseover');
  471. Event.simulateMouse('newtbe', 'click');
  472. assertEqual('foobar', Form.serialize(ipe._form, true).test, 'Custom field not present');
  473. ipe.dispose();
  474. }},
  475. testPostCreationBehavior: function() {with(this) {
  476. var focused = false, activated = false;
  477. function override(name, fx) {
  478. arguments.callee.backups[name] = Field.Methods[name];
  479. Field.Methods[name] = fx;
  480. };
  481. override.backups = {};
  482. function restore() {
  483. $A(arguments).each(function(n) {
  484. Field.Methods[name] = override.backups[name];
  485. });
  486. Element.addMethods();
  487. };
  488. override('activate', function(elt) {
  489. override.backups['activate'](elt);
  490. activated = true;
  491. });
  492. override('focus', function(elt) { focused = true; });
  493. Element.addMethods();
  494. // fieldPostCreation default (activate)
  495. var ipe = new Ajax.InPlaceEditor('newtbe',
  496. '_ajax_inplaceeditor_result2.html');
  497. Event.simulateMouse('newtbe', 'mouseover');
  498. Event.simulateMouse('newtbe', 'click');
  499. assert(focused && activated, "Should be focused and activated (resp. " + focused + " and " + activated + ')');
  500. ipe.dispose();
  501. // fieldPostCreation == 'focus'
  502. focused = activated = false;
  503. ipe = new Ajax.InPlaceEditor('newtbe',
  504. '_ajax_inplaceeditor_result2.html', { fieldPostCreation: 'focus' });
  505. Event.simulateMouse('newtbe', 'mouseover');
  506. Event.simulateMouse('newtbe', 'click');
  507. assert(focused && !activated, "Should be focused, not activated (resp. " + focused + " and " + activated + ')');
  508. ipe.dispose();
  509. // fieldPostCreation == false
  510. focused = activated = false;
  511. ipe = new Ajax.InPlaceEditor('newtbe',
  512. '_ajax_inplaceeditor_result2.html', { fieldPostCreation: false });
  513. Event.simulateMouse('newtbe', 'mouseover');
  514. Event.simulateMouse('newtbe', 'click');
  515. assert(!focused && !activated, "Should be neither focused nor activated (resp. " + focused + " and " + activated + ')');
  516. ipe.dispose();
  517. // fieldPostCreation == non-false yet neither activate nor focus -> default
  518. focused = activated = false;
  519. ipe = new Ajax.InPlaceEditor('newtbe',
  520. '_ajax_inplaceeditor_result2.html', { fieldPostCreation: 'foobar' });
  521. Event.simulateMouse('newtbe', 'mouseover');
  522. Event.simulateMouse('newtbe', 'click');
  523. assert(focused && activated, "Should be focused and activated (resp. " + focused + " and " + activated + ')');
  524. ipe.dispose();
  525. restore('activate', 'focus');
  526. }},
  527. testResponseTagStripping: function() {with(this) {
  528. // stripLoadedTextTags default (false)
  529. var ipe = new Ajax.InPlaceEditor('newtbe',
  530. '_ajax_inplaceeditor_result2.html',
  531. { loadTextURL: '_ajax_inplaceeditor_tagged.html' });
  532. Event.simulateMouse('newtbe', 'mouseover');
  533. Event.simulateMouse('newtbe', 'click');
  534. wait(1000, function() {
  535. assertEqual('<span>New to be edited - edited</span>', ipe._controls.editor.value.strip());
  536. ipe.dispose();
  537. // stripLoadedTextTags == true
  538. ipe = new Ajax.InPlaceEditor('newtbe',
  539. '_ajax_inplaceeditor_result2.html',
  540. { loadTextURL: '_ajax_inplaceeditor_tagged.html',
  541. stripLoadedTextTags: true });
  542. Event.simulateMouse('newtbe', 'mouseover');
  543. Event.simulateMouse('newtbe', 'click');
  544. wait(1000, function() {
  545. assertEqual('New to be edited - edited', ipe._controls.editor.value.strip());
  546. ipe.dispose();
  547. });
  548. });
  549. }},
  550. testSubmitOnBlur: function() {with(this) {
  551. // submitOnBlur default (false)
  552. $('newtbe').update('To be edited');
  553. var ipe = new Ajax.InPlaceEditor('newtbe',
  554. '_ajax_inplaceeditor_result2.html');
  555. Event.simulateMouse('newtbe', 'mouseover');
  556. Event.simulateMouse('newtbe', 'click');
  557. ipe._controls.editor.blur();
  558. wait(1000, function() {
  559. assertEqual('To be edited', ipe._controls.editor ? ipe._controls.editor.value : '');
  560. ipe.dispose();
  561. // submitOnBlur == true
  562. ipe = new Ajax.InPlaceEditor('newtbe',
  563. '_ajax_inplaceeditor_result2.html', { submitOnBlur: true });
  564. Event.simulateMouse('newtbe', 'mouseover');
  565. Event.simulateMouse('newtbe', 'click');
  566. ipe._controls.editor.blur();
  567. wait(1200, function() {
  568. assertEqual('New to be edited - edited', $('newtbe').innerHTML.strip());
  569. ipe.dispose();
  570. });
  571. });
  572. }},
  573. testEscReturnKeys: function() {with(this) {
  574. // No controls, Esc
  575. var ipe = new Ajax.InPlaceEditor('newtbe',
  576. '_ajax_inplaceeditor_result2.html', { okControl: false, cancelControl: false});
  577. Event.simulateMouse('newtbe', 'mouseover');
  578. Event.simulateMouse('newtbe', 'click');
  579. Event.simulateKey('newtbe', 'keydown', { keyCode: Event.KEY_ESC });
  580. assert(!ipe._editing, 'Esc should have disabled IPE');
  581. ipe.dispose();
  582. // Cancel control, Esc
  583. var ipe = new Ajax.InPlaceEditor('newtbe',
  584. '_ajax_inplaceeditor_result2.html', { okControl: false });
  585. Event.simulateMouse('newtbe', 'mouseover');
  586. Event.simulateMouse('newtbe', 'click');
  587. Event.simulateKey('newtbe', 'keydown', { keyCode: Event.KEY_ESC });
  588. assert(!ipe._editing, 'Esc should have disabled IPE');
  589. ipe.dispose();
  590. // OK control, Esc
  591. var ipe = new Ajax.InPlaceEditor('newtbe',
  592. '_ajax_inplaceeditor_result2.html', { cancelControl: false });
  593. Event.simulateMouse('newtbe', 'mouseover');
  594. Event.simulateMouse('newtbe', 'click');
  595. Event.simulateKey('newtbe', 'keydown', { keyCode: Event.KEY_ESC });
  596. assert(!ipe._editing, 'Esc should have disabled IPE');
  597. ipe.dispose();
  598. // Both controls, Esc
  599. ipe = new Ajax.InPlaceEditor('newtbe',
  600. '_ajax_inplaceeditor_result2.html');
  601. Event.simulateMouse('newtbe', 'mouseover');
  602. Event.simulateMouse('newtbe', 'click');
  603. Event.simulateKey('newtbe', 'keydown', { keyCode: Event.KEY_ESC });
  604. assert(!ipe._editing, 'Esc should have disabled IPE');
  605. ipe.dispose();
  606. // No controls, Return
  607. $('newtbe').update('New to be edited');
  608. ipe = new Ajax.InPlaceEditor('newtbe',
  609. '_ajax_inplaceeditor_result2.html', { okControl: false, cancelControl: false });
  610. Event.simulateMouse('newtbe', 'mouseover');
  611. Event.simulateMouse('newtbe', 'click');
  612. Event.simulateKey('newtbe', 'keydown', { keyCode: Event.KEY_RETURN });
  613. wait(1000, function() {
  614. assertEqual('New to be edited - edited', $('newtbe').innerHTML.strip());
  615. ipe.dispose();
  616. // Cancel control, Return
  617. $('newtbe').update('New to be edited');
  618. ipe = new Ajax.InPlaceEditor('newtbe',
  619. '_ajax_inplaceeditor_result2.html', { okControl: false });
  620. Event.simulateMouse('newtbe', 'mouseover');
  621. Event.simulateMouse('newtbe', 'click');
  622. Event.simulateKey('newtbe', 'keydown', { keyCode: Event.KEY_RETURN });
  623. wait(1000, function() {
  624. assertEqual('New to be edited - edited', $('newtbe').innerHTML.strip());
  625. ipe.dispose();
  626. // OK control, Return
  627. $('newtbe').update('New to be edited');
  628. ipe = new Ajax.InPlaceEditor('newtbe',
  629. '_ajax_inplaceeditor_result2.html', { cancelControl: false });
  630. Event.simulateMouse('newtbe', 'mouseover');
  631. Event.simulateMouse('newtbe', 'click');
  632. Event.simulateKey('newtbe', 'keydown', { keyCode: Event.KEY_RETURN });
  633. wait(1000, function() {
  634. assertEqual('New to be edited - edited', $('newtbe').innerHTML.strip());
  635. ipe.dispose();
  636. // Both controls, Return
  637. $('newtbe').update('New to be edited');
  638. ipe = new Ajax.InPlaceEditor('newtbe',
  639. '_ajax_inplaceeditor_result2.html');
  640. Event.simulateMouse('newtbe', 'mouseover');
  641. Event.simulateMouse('newtbe', 'click');
  642. Event.simulateKey('newtbe', 'keydown', { keyCode: Event.KEY_RETURN });
  643. wait(1000, function() {
  644. assertEqual('New to be edited - edited', $('newtbe').innerHTML.strip());
  645. ipe.dispose();
  646. });
  647. });
  648. });
  649. });
  650. }},
  651. testIPCEBasic: function() {with(this) {
  652. // Basic creation, population and choice.
  653. $('newtbe').update('ntbe');
  654. var fieldValue = '';
  655. var ipe = new Ajax.InPlaceCollectionEditor('newtbe',
  656. '_ajax_inplaceeditor_result2.html', { paramName: 'test',
  657. collection: IPCE_COLLECTION, callback: function(f, value) {
  658. fieldValue = value;
  659. }, onComplete: Prototype.emptyFunction
  660. });
  661. Event.simulateMouse('newtbe', 'mouseover');
  662. Event.simulateMouse('newtbe', 'click');
  663. var editor = ipe._controls.editor;
  664. assertEqual('test', editor.name);
  665. assertEqual('select', editor.tagName.toLowerCase());
  666. assertEqual(IPCE_COLLECTION.length, editor.options.length, 'Incorrect amount of options');
  667. for (var index = 0; index < IPCE_COLLECTION.length; ++index) {
  668. var ref = IPCE_COLLECTION[index];
  669. var item = editor.options[index];
  670. assertEqual(ref[0], item.value, 'Incorrect OPTION value');
  671. assertEqual(ref[1], item.text.strip(), 'Incorrect OPTION text');
  672. };
  673. assertEqual(1, editor.selectedIndex, 'Did not properly select item');
  674. editor.selectedIndex = 2;
  675. Event.simulateMouse(ipe._controls.ok, 'click');
  676. assertEqual('ntbe2', fieldValue);
  677. ipe.dispose();
  678. // Test the value option
  679. $('newtbe').update('ntbe');
  680. ipe = new Ajax.InPlaceCollectionEditor('newtbe',
  681. '_ajax_inplaceeditor_result2.html', { paramName: 'test',
  682. collection: IPCE_COLLECTION, onComplete: Prototype.emptyFunction,
  683. value: 'ntbe2'
  684. });
  685. Event.simulateMouse('newtbe', 'mouseover');
  686. Event.simulateMouse('newtbe', 'click');
  687. editor = ipe._controls.editor;
  688. assertEqual(2, editor.selectedIndex, 'Did not properly select item');
  689. ipe.dispose();
  690. }},
  691. testIPCECollectionSyntaxes: function() {with(this) {
  692. // Array of two-item arrays (0 = value, 1 = text)
  693. $('newtbe').update('ntbe');
  694. var ipe = new Ajax.InPlaceCollectionEditor('newtbe',
  695. '_ajax_inplaceeditor_result2.html', { paramName: 'test',
  696. collection: IPCE_COLLECTION, onComplete: Prototype.emptyFunction
  697. });
  698. Event.simulateMouse('newtbe', 'mouseover');
  699. Event.simulateMouse('newtbe', 'click');
  700. var editor = ipe._controls.editor;
  701. assertEqual(1, editor.selectedIndex, 'Did not properly select item');
  702. // (further contents testing already done in Basic)
  703. ipe.dispose();
  704. // Array of one-item arrays
  705. ipe = new Ajax.InPlaceCollectionEditor('newtbe',
  706. '_ajax_inplaceeditor_result2.html', { paramName: 'test',
  707. collection: [['tbe'], ['ntbe'], ['ntbe2'], ['ntbe3']],
  708. onComplete: Prototype.emptyFunction
  709. });
  710. Event.simulateMouse('newtbe', 'mouseover');
  711. Event.simulateMouse('newtbe', 'click');
  712. var editor = ipe._controls.editor;
  713. assertEqual(1, editor.selectedIndex, 'Did not properly select item');
  714. assertEqual('ntbe', $F(editor).strip(), 'Did not properly define text');
  715. ipe.dispose();
  716. // Array of items
  717. ipe = new Ajax.InPlaceCollectionEditor('newtbe',
  718. '_ajax_inplaceeditor_result2.html', { paramName: 'test',
  719. collection: ['tbe', 'ntbe', 'ntbe2', 'ntbe3'],
  720. onComplete: Prototype.emptyFunction
  721. });
  722. Event.simulateMouse('newtbe', 'mouseover');
  723. Event.simulateMouse('newtbe', 'click');
  724. var editor = ipe._controls.editor;
  725. assertEqual(1, editor.selectedIndex, 'Did not properly select item');
  726. assertEqual('ntbe', $F(editor).strip(), 'Did not properly define text');
  727. ipe.dispose();
  728. }},
  729. testIPCEAlternateTextOptions: function() {with(this) {
  730. // loadTextURL (check loading text, verify alternate text eventually)
  731. $('newtbe').update('New to be edited');
  732. var ipe = new Ajax.InPlaceCollectionEditor('newtbe',
  733. '_ajax_inplaceeditor_result2.html', { paramName: 'test',
  734. collection: IPCE_COLLECTION, loadTextURL: '_ajax_inplaceeditor_ipce_alt_text.html',
  735. onComplete: Prototype.emptyFunction
  736. });
  737. Event.simulateMouse('newtbe', 'mouseover');
  738. Event.simulateMouse('newtbe', 'click');
  739. var editor = ipe._controls.editor;
  740. var text = editor.options[editor.selectedIndex].text.strip();
  741. assertEqual(Ajax.InPlaceEditor.DefaultOptions.loadingText, text);
  742. wait(1200, function() {
  743. assertEqual(1, editor.selectedIndex, 'Did not properly select item based on alternate text.');
  744. ipe.dispose();
  745. });
  746. }},
  747. testIPCEDynamicCollectionOptions: function() {with(this) {
  748. // loadCollectionURL, default loadingCollectionText
  749. $('newtbe').update('ntbe');
  750. var ipe = new Ajax.InPlaceCollectionEditor('newtbe',
  751. '_ajax_inplaceeditor_result2.html', { paramName: 'test',
  752. loadCollectionURL: '_ajax_inplaceeditor_ipce_collection.js',
  753. onComplete: Prototype.emptyFunction
  754. });
  755. Event.simulateMouse('newtbe', 'mouseover');
  756. Event.simulateMouse('newtbe', 'click');
  757. var editor = ipe._controls.editor;
  758. var text = editor.options[editor.selectedIndex].text.strip();
  759. assertEqual(Ajax.InPlaceCollectionEditor.DefaultOptions.loadingCollectionText, text);
  760. wait(1000, function() {
  761. assertEqual(5, ipe._collection.length);
  762. assertEqual(2, editor.selectedIndex, 'Did not properly select item');
  763. ipe.dispose();
  764. // loadCollectionURL, custom loadingCollectionText
  765. $('newtbe').update('bar');
  766. ipe = new Ajax.InPlaceCollectionEditor('newtbe',
  767. '_ajax_inplaceeditor_result2.html', { paramName: 'test',
  768. loadCollectionURL: '_ajax_inplaceeditor_ipce_collection.js',
  769. loadingCollectionText: 'There we go...',
  770. onComplete: Prototype.emptyFunction
  771. });
  772. Event.simulateMouse('newtbe', 'mouseover');
  773. Event.simulateMouse('newtbe', 'click');
  774. editor = ipe._controls.editor;
  775. text = editor.options[editor.selectedIndex].text.strip();
  776. assertEqual('There we go...', text);
  777. wait(1000, function() {
  778. assertEqual(1, editor.selectedIndex, 'Did not properly select item');
  779. ipe.dispose();
  780. });
  781. });
  782. }},
  783. testIPCEATPlusDC: function() {with(this) {
  784. // loadCollectionURL, loadTextURL
  785. $('newtbe').update('Like I care');
  786. var ipe = new Ajax.InPlaceCollectionEditor('newtbe',
  787. '_ajax_inplaceeditor_result2.html', { paramName: 'test',
  788. loadCollectionURL: '_ajax_inplaceeditor_ipce_collection.js',
  789. loadingCollectionText: 'There we go...',
  790. loadTextURL: '_ajax_inplaceeditor_ipce_alt_text.html',
  791. loadingText: 'OK, so, the text...',
  792. onComplete: Prototype.emptyFunction
  793. });
  794. ipe._regularCFET = ipe.checkForExternalText;
  795. ipe.checkForExternalText = function() {
  796. assert(5, ipe._collection.length);
  797. ipe._regularCFET();
  798. var editor = ipe._controls.editor;
  799. var text = editor.options[editor.selectedIndex].text.strip();
  800. assertEqual('OK, so, the text...', text);
  801. };
  802. Event.simulateMouse('newtbe', 'mouseover');
  803. Event.simulateMouse('newtbe', 'click');
  804. var editor = ipe._controls.editor;
  805. var text = editor.options[editor.selectedIndex].text.strip();
  806. assertEqual('There we go...', text);
  807. wait(2000, function() {
  808. assertEqual(2, editor.selectedIndex, 'Did not properly select item');
  809. ipe.dispose();
  810. });
  811. }},
  812. testDeprecationLayer: function() {with(this) {
  813. // FIXME: needs to be coded yet, doesn't it?
  814. var ipe = new Ajax.InPlaceCollectionEditor('newtbe',
  815. '_ajax_inplaceeditor_result2.html', { paramName: 'test',
  816. okButton: false, cancelLink: false
  817. });
  818. assertIdentical(false, ipe.options.okControl, 'OK control should be disabled');
  819. assertIdentical(false, ipe.options.cancelControl, 'Cancel control should be disabled');
  820. ipe.dispose();
  821. ipe = new Ajax.InPlaceCollectionEditor('newtbe',
  822. '_ajax_inplaceeditor_result2.html', { paramName: 'test',
  823. okLink: true, cancelButton: true
  824. });
  825. assertEqual('link', ipe.options.okControl, 'OK control should be a link');
  826. assertEqual('button', ipe.options.cancelControl, 'Cancel control should be a button');
  827. ipe.dispose();
  828. ipe = new Ajax.InPlaceCollectionEditor('newtbe',
  829. '_ajax_inplaceeditor_result2.html', { paramName: 'test',
  830. highlightcolor: '#ff0000', highlightendcolor: '#00ff00'
  831. });
  832. assertEqual('#ff0000', ipe.options.highlightColor, 'Highlight color was not migrated');
  833. assertEqual('#00ff00', ipe.options.highlightEndColor, 'Highlight end color was not migrated');
  834. ipe.dispose();
  835. }},
  836. testShouldShowAmpersandsProperly: function() {with(this) {
  837. var ipe = new Ajax.InPlaceEditor('contains_ampersand', '', {});
  838. Event.simulateMouse('contains_ampersand', 'click');
  839. assertEqual("Me & Myself", $$('form#contains_ampersand-inplaceeditor input.editor_field')[0].value);
  840. ipe.dispose();
  841. }}
  842. // FIXME: add AC w/o key conflicts?
  843. // FIXME: doc w/ full details on what's new, what's changed, etc. + deprecation layer info.
  844. });
  845. // ]]>
  846. </script>
  847. </body>
  848. </html>