Nils Diewald | 19ccee9 | 2014-12-08 11:30:08 +0000 | [diff] [blame] | 1 | function emitKeyboardEvent (element, type, keyCode) { |
| 2 | // event type : keydown, keyup, keypress |
| 3 | // http://stackoverflow.com/questions/596481/simulate-javascript-key-events |
| 4 | // http://stackoverflow.com/questions/961532/firing-a-keyboard-event-in-javascript |
| 5 | var keyboardEvent = document.createEvent("KeyboardEvent"); |
| 6 | var initMethod = typeof keyboardEvent.initKeyboardEvent !== 'undefined' ? |
| 7 | "initKeyboardEvent" : "initKeyEvent"; |
Nils Diewald | 19ccee9 | 2014-12-08 11:30:08 +0000 | [diff] [blame] | 8 | keyboardEvent[initMethod]( |
| 9 | type, |
Akron | 308db38 | 2016-05-30 22:34:07 +0200 | [diff] [blame] | 10 | true, // bubbles |
| 11 | true, // cancelable |
| 12 | window, // viewArg: should be window |
| 13 | false, // ctrlKeyArg |
| 14 | false, // altKeyArg |
| 15 | false, // shiftKeyArg |
| 16 | false, // metaKeyArg |
Nils Diewald | 19ccee9 | 2014-12-08 11:30:08 +0000 | [diff] [blame] | 17 | keyCode, // keyCodeArg : unsigned long the virtual key code, else 0 |
Akron | 308db38 | 2016-05-30 22:34:07 +0200 | [diff] [blame] | 18 | 0 // charCodeArgs : unsigned long the Unicode character |
| 19 | // associated with the depressed key, else 0 |
Nils Diewald | 19ccee9 | 2014-12-08 11:30:08 +0000 | [diff] [blame] | 20 | ); |
Nils Diewald | 19ccee9 | 2014-12-08 11:30:08 +0000 | [diff] [blame] | 21 | element.dispatchEvent(keyboardEvent); |
| 22 | }; |
| 23 | |
| 24 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 25 | define(['hint'], function () { |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 26 | var hintClass = require("hint"); |
| 27 | var inputClass = require("hint/input"); |
| 28 | var contextClass = require("hint/contextanalyzer"); |
| 29 | var menuClass = require("hint/menu"); |
| 30 | var menuItemClass = require("hint/item"); |
Nils Diewald | 5c5a747 | 2015-04-02 22:13:38 +0000 | [diff] [blame] | 31 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 32 | describe('KorAP.InputField', function () { |
| 33 | var input; |
Nils Diewald | 1c54692 | 2015-04-13 01:56:19 +0000 | [diff] [blame] | 34 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 35 | beforeEach(function () { |
| 36 | input = document.createElement("input"); |
| 37 | input.setAttribute('type', "text"); |
| 38 | input.setAttribute("value", "abcdefghijklmno"); |
| 39 | input.style.position = 'absolute'; |
| 40 | document.getElementsByTagName('body')[0].appendChild(input); |
| 41 | input.style.top = "20px"; |
| 42 | input.style.left = "30px"; |
| 43 | input.focus(); |
| 44 | input.selectionStart = 5; |
Nils Diewald | 5c5a747 | 2015-04-02 22:13:38 +0000 | [diff] [blame] | 45 | }); |
| 46 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 47 | afterEach(function () { |
| 48 | document.getElementsByTagName("body")[0].removeChild( |
Akron | 95abaf4 | 2018-04-26 15:33:22 +0200 | [diff] [blame] | 49 | input |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 50 | ); |
| 51 | }); |
Nils Diewald | 5c5a747 | 2015-04-02 22:13:38 +0000 | [diff] [blame] | 52 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 53 | afterAll(function () { |
| 54 | try { |
Akron | 1a5a587 | 2016-09-05 20:17:14 +0200 | [diff] [blame] | 55 | var mirrors = document.querySelectorAll(".hint.mirror"); |
| 56 | for (var i in mirrors) { |
| 57 | mirrors[i].parentNode.removeChild(mirrors[i]) |
| 58 | }; |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 59 | } |
| 60 | catch (e) {}; |
| 61 | }); |
Nils Diewald | 19ccee9 | 2014-12-08 11:30:08 +0000 | [diff] [blame] | 62 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 63 | it('should be initializable', function () { |
| 64 | // Supports: context, searchField |
| 65 | var inputField = inputClass.create(input); |
| 66 | expect(inputField._element).not.toBe(undefined); |
| 67 | }); |
Nils Diewald | 19ccee9 | 2014-12-08 11:30:08 +0000 | [diff] [blame] | 68 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 69 | it('should have text', function () { |
| 70 | expect(input.value).toEqual('abcdefghijklmno'); |
| 71 | var inputField = inputClass.create(input); |
Nils Diewald | 19ccee9 | 2014-12-08 11:30:08 +0000 | [diff] [blame] | 72 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 73 | expect(inputField.value()).toEqual("abcdefghijklmno"); |
Nils Diewald | 19ccee9 | 2014-12-08 11:30:08 +0000 | [diff] [blame] | 74 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 75 | expect(input.selectionStart).toEqual(5); |
| 76 | expect(inputField.element().selectionStart).toEqual(5); |
Nils Diewald | 7148c6f | 2015-05-04 15:07:53 +0000 | [diff] [blame] | 77 | expect(inputField._split()[0]).toEqual("abcde"); |
| 78 | expect(inputField._split()[1]).toEqual("fghijklmno"); |
Nils Diewald | 19ccee9 | 2014-12-08 11:30:08 +0000 | [diff] [blame] | 79 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 80 | inputField.insert("xyz"); |
| 81 | expect(inputField.value()).toEqual('abcdexyzfghijklmno'); |
Nils Diewald | 7148c6f | 2015-05-04 15:07:53 +0000 | [diff] [blame] | 82 | expect(inputField._split()[0]).toEqual("abcdexyz"); |
| 83 | expect(inputField._split()[1]).toEqual("fghijklmno"); |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 84 | }); |
Nils Diewald | 19ccee9 | 2014-12-08 11:30:08 +0000 | [diff] [blame] | 85 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 86 | it('should be correctly positioned', function () { |
| 87 | expect(input.value).toEqual('abcdefghijklmno'); |
| 88 | var inputField = inputClass.create(input); |
| 89 | document.getElementsByTagName("body")[0].appendChild(input); |
| 90 | inputField.reposition(); |
| 91 | expect(input.style.left).toEqual("30px"); |
| 92 | expect(inputField.mirror().style.left.match(/^(\d+)px$/)[1]).toBeGreaterThan(29); |
| 93 | expect(inputField.mirror().style.top.match(/^(\d+)px$/)[1]).toBeGreaterThan(20); |
| 94 | }); |
Nils Diewald | 19ccee9 | 2014-12-08 11:30:08 +0000 | [diff] [blame] | 95 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 96 | it('should have a correct context', function () { |
| 97 | expect(input.value).toEqual('abcdefghijklmno'); |
| 98 | var inputField = inputClass.create(input); |
| 99 | expect(inputField.value()).toEqual("abcdefghijklmno"); |
| 100 | expect(inputField.element().selectionStart).toEqual(5); |
Nils Diewald | 7148c6f | 2015-05-04 15:07:53 +0000 | [diff] [blame] | 101 | expect(inputField._split()[0]).toEqual("abcde"); |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 102 | expect(inputField.context()).toEqual("abcde"); |
| 103 | }); |
Nils Diewald | 19ccee9 | 2014-12-08 11:30:08 +0000 | [diff] [blame] | 104 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 105 | /* |
| 106 | it('should be correctly triggerable', function () { |
| 107 | // https://developer.mozilla.org/samples/domref/dispatchEvent.html |
| 108 | var hint = KorAP.Hint.create({ "inputField" : input }); |
| 109 | emitKeyboardEvent(hint.inputField.element, "keypress", 20); |
| 110 | }); |
| 111 | */ |
Nils Diewald | 19ccee9 | 2014-12-08 11:30:08 +0000 | [diff] [blame] | 112 | }); |
| 113 | |
Nils Diewald | 1c54692 | 2015-04-13 01:56:19 +0000 | [diff] [blame] | 114 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 115 | describe('KorAP.ContextAnalyzer', function () { |
| 116 | it('should be initializable', function () { |
| 117 | var analyzer = contextClass.create(")"); |
| 118 | expect(analyzer).toBe(undefined); |
| 119 | analyzer = contextClass.create(".+?"); |
| 120 | expect(analyzer).not.toBe(undefined); |
| 121 | }); |
Nils Diewald | 19ccee9 | 2014-12-08 11:30:08 +0000 | [diff] [blame] | 122 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 123 | it('should check correctly', function () { |
| 124 | analyzer = contextClass.create(KorAP.context); |
| 125 | expect(analyzer.test("cnx/]cnx/c=")).toEqual("cnx/c="); |
| 126 | expect(analyzer.test("cnx/c=")).toEqual("cnx/c="); |
| 127 | expect(analyzer.test("cnx/c=np mate/m=mood:")).toEqual("mate/m=mood:"); |
| 128 | expect(analyzer.test("impcnx/")).toEqual("impcnx/"); |
| 129 | expect(analyzer.test("cnx/c=npcnx/")).toEqual("npcnx/"); |
| 130 | expect(analyzer.test("mate/m=degree:pos corenlp/ne_dewac_175m_600=")) |
Akron | 1a5a587 | 2016-09-05 20:17:14 +0200 | [diff] [blame] | 131 | .toEqual("corenlp/ne_dewac_175m_600="); |
Akron | 113cc1a | 2016-01-22 21:17:57 +0100 | [diff] [blame] | 132 | expect(analyzer.test("corenlp/")).toEqual("corenlp/"); |
| 133 | expect(analyzer.test("corenlp/c=")).toEqual("corenlp/c="); |
| 134 | expect(analyzer.test("corenlp/c=PP-")).toEqual("corenlp/c=PP-"); |
| 135 | expect(analyzer.test("corenlp/c=XY-")).toEqual("corenlp/c=XY-"); |
Akron | cff9bac | 2016-01-25 21:39:38 +0100 | [diff] [blame] | 136 | expect(analyzer.test("sgbr/l=")).toEqual("sgbr/l="); |
| 137 | expect(analyzer.test("sgbr/lv=")).toEqual("sgbr/lv="); |
| 138 | expect(analyzer.test("sgbr/p=")).toEqual("sgbr/p="); |
Akron | ee9ef4a | 2016-06-03 12:50:08 +0200 | [diff] [blame] | 139 | expect(analyzer.test("")).toEqual(undefined); |
| 140 | expect(analyzer.test("abcdecnx/")).toEqual("abcdecnx/"); |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 141 | }); |
Nils Diewald | 19ccee9 | 2014-12-08 11:30:08 +0000 | [diff] [blame] | 142 | }); |
| 143 | |
Nils Diewald | 19ccee9 | 2014-12-08 11:30:08 +0000 | [diff] [blame] | 144 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 145 | describe('KorAP.Hint', function () { |
Akron | e91da78 | 2017-12-15 17:17:50 +0100 | [diff] [blame] | 146 | KorAP.annotationHelper = { |
Akron | 02360e4 | 2016-06-07 13:41:12 +0200 | [diff] [blame] | 147 | "-" : [ |
Akron | 1a5a587 | 2016-09-05 20:17:14 +0200 | [diff] [blame] | 148 | ["Base Annotation", "base/s=", "Structure"], |
| 149 | ["CoreNLP", "corenlp/", "Constituency, Named Entities, Part-of-Speech"] |
Akron | 02360e4 | 2016-06-07 13:41:12 +0200 | [diff] [blame] | 150 | ], |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 151 | "corenlp/" : [ |
Akron | 1a5a587 | 2016-09-05 20:17:14 +0200 | [diff] [blame] | 152 | ["Named Entity", "ne=" , "Combined"], |
| 153 | ["Named Entity", "ne_dewac_175m_600=" , "ne_dewac_175m_600"], |
| 154 | ["Named Entity", "ne_hgc_175m_600=", "ne_hgc_175m_600"] |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 155 | ] |
| 156 | }; |
Nils Diewald | 19ccee9 | 2014-12-08 11:30:08 +0000 | [diff] [blame] | 157 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 158 | beforeEach(function () { |
| 159 | input = document.createElement("input"); |
| 160 | input.setAttribute("type", "text"); |
| 161 | input.setAttribute("value", "abcdefghijklmno"); |
| 162 | input.style.position = 'absolute'; |
| 163 | input.style.top = "20px"; |
| 164 | input.style.left = "30px"; |
| 165 | input.focus(); |
| 166 | input.selectionStart = 5; |
| 167 | }); |
Nils Diewald | 19ccee9 | 2014-12-08 11:30:08 +0000 | [diff] [blame] | 168 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 169 | it('should be initializable', function () { |
| 170 | // Supports: context, searchField |
| 171 | var hint = hintClass.create({ |
Akron | 1a5a587 | 2016-09-05 20:17:14 +0200 | [diff] [blame] | 172 | inputField : input |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 173 | }); |
Nils Diewald | 19ccee9 | 2014-12-08 11:30:08 +0000 | [diff] [blame] | 174 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 175 | expect(hint).toBeTruthy(); |
| 176 | }); |
Akron | 00cd4d1 | 2016-05-31 21:01:11 +0200 | [diff] [blame] | 177 | |
Akron | 1a5a587 | 2016-09-05 20:17:14 +0200 | [diff] [blame] | 178 | |
Akron | 00cd4d1 | 2016-05-31 21:01:11 +0200 | [diff] [blame] | 179 | it('should alert at char pos', function () { |
| 180 | var hint = hintClass.create({ |
Akron | 1a5a587 | 2016-09-05 20:17:14 +0200 | [diff] [blame] | 181 | inputField : input |
Akron | 00cd4d1 | 2016-05-31 21:01:11 +0200 | [diff] [blame] | 182 | }); |
| 183 | |
| 184 | expect(hint.active()).toBeFalsy(); |
| 185 | |
| 186 | expect(hint.alert(4, 'That does not work!')).toBeTruthy(); |
| 187 | |
| 188 | expect(hint.active()).toBeTruthy(); |
| 189 | |
| 190 | var container = hint.inputField().container(); |
| 191 | expect(container.firstChild.classList.contains('hint')).toBe(true); |
| 192 | expect(container.firstChild.classList.contains('alert')).toBe(true); |
| 193 | expect(container.firstChild.textContent).toEqual('That does not work!'); |
| 194 | expect(hint.inputField().mirrorValue()).toEqual('abcd'); |
| 195 | |
| 196 | expect(hint.alert(4, 'That does not work!')).toBeFalsy(); |
| 197 | |
| 198 | // Update - meaning: hide alert |
| 199 | hint.update(); |
| 200 | |
| 201 | expect(hint.alert().active).toBeFalsy(); |
Akron | 00cd4d1 | 2016-05-31 21:01:11 +0200 | [diff] [blame] | 202 | expect(hint.active()).toBeFalsy(); |
Akron | 1a5a587 | 2016-09-05 20:17:14 +0200 | [diff] [blame] | 203 | |
| 204 | // Show again |
| 205 | expect(hint.alert(5, 'That does not work!')).toBeTruthy(); |
| 206 | expect(hint.inputField().mirrorValue()).toEqual('abcde'); |
| 207 | expect(hint.alert().active).toBeTruthy(); |
| 208 | expect(hint.active()).toBeTruthy(); |
| 209 | |
| 210 | // Show menu, hide alert! |
| 211 | hint.show(false); |
| 212 | expect(hint.active()).toBeTruthy(); |
| 213 | expect(hint.inputField().mirrorValue()).toEqual('abcde'); |
| 214 | expect(hint.alert().active).toBeFalsy(); |
| 215 | |
| 216 | // Show again |
| 217 | expect(hint.alert(5, 'That does not work!')).toBeTruthy(); |
| 218 | expect(hint.inputField().mirrorValue()).toEqual('abcde'); |
| 219 | expect(hint.alert().active).toBeTruthy(); |
| 220 | expect(hint.active()).toBeTruthy(); |
| 221 | |
| 222 | // Show menu, hide alert! |
| 223 | hint.show(false); |
| 224 | expect(hint.active()).toBeTruthy(); |
| 225 | expect(hint.inputField().mirrorValue()).toEqual('abcde'); |
| 226 | expect(hint.alert().active).toBeFalsy(); |
Akron | ee9ef4a | 2016-06-03 12:50:08 +0200 | [diff] [blame] | 227 | }); |
Akron | 00cd4d1 | 2016-05-31 21:01:11 +0200 | [diff] [blame] | 228 | |
Akron | 1a5a587 | 2016-09-05 20:17:14 +0200 | [diff] [blame] | 229 | |
| 230 | |
Akron | ee9ef4a | 2016-06-03 12:50:08 +0200 | [diff] [blame] | 231 | it('should view main menu on default', function () { |
| 232 | var hint = hintClass.create({ |
Akron | 1a5a587 | 2016-09-05 20:17:14 +0200 | [diff] [blame] | 233 | inputField : input |
Akron | ee9ef4a | 2016-06-03 12:50:08 +0200 | [diff] [blame] | 234 | }); |
| 235 | |
| 236 | expect(hint.active()).toBeFalsy(); |
| 237 | |
| 238 | hint.inputField().insert('der Baum corenlp/'); |
Akron | ee9ef4a | 2016-06-03 12:50:08 +0200 | [diff] [blame] | 239 | |
Akron | 8eaeb2e | 2016-08-29 18:26:28 +0200 | [diff] [blame] | 240 | var cont = hint.inputField().container(); |
| 241 | |
| 242 | expect(cont.getElementsByTagName('div').length).toBe(1); |
| 243 | expect(cont.getElementsByTagName('ul').length).toBe(0); |
| 244 | expect(cont.firstChild).toEqual(cont.firstChild); |
| 245 | |
| 246 | // Show menu, if a relevant context exists |
| 247 | // There is a menu for corenlp/ |
Akron | 02360e4 | 2016-06-07 13:41:12 +0200 | [diff] [blame] | 248 | hint.show(false); |
| 249 | |
Akron | 8eaeb2e | 2016-08-29 18:26:28 +0200 | [diff] [blame] | 250 | expect(hint.inputField().container().getElementsByTagName('ul').length).toEqual(1); |
| 251 | expect(hint.inputField().container().getElementsByTagName('li').length).toEqual(3); |
Akron | 65c7435 | 2016-09-02 17:23:39 +0200 | [diff] [blame] | 252 | |
Akron | 8eaeb2e | 2016-08-29 18:26:28 +0200 | [diff] [blame] | 253 | // Hide the menu and focus on the input |
| 254 | hint.unshow(); |
Akron | 65c7435 | 2016-09-02 17:23:39 +0200 | [diff] [blame] | 255 | |
| 256 | expect(hint.inputField().container().getElementsByTagName('div').length).toEqual(1); |
| 257 | expect(hint.inputField().container().getElementsByTagName('li').length).toEqual(0); |
Akron | ee9ef4a | 2016-06-03 12:50:08 +0200 | [diff] [blame] | 258 | |
Akron | 02360e4 | 2016-06-07 13:41:12 +0200 | [diff] [blame] | 259 | hint.unshow(); |
Akron | 65c7435 | 2016-09-02 17:23:39 +0200 | [diff] [blame] | 260 | |
Akron | ee9ef4a | 2016-06-03 12:50:08 +0200 | [diff] [blame] | 261 | hint.inputField().insert(' hhhh'); |
Akron | 65c7435 | 2016-09-02 17:23:39 +0200 | [diff] [blame] | 262 | |
Akron | ee9ef4a | 2016-06-03 12:50:08 +0200 | [diff] [blame] | 263 | // show with context |
Akron | 02360e4 | 2016-06-07 13:41:12 +0200 | [diff] [blame] | 264 | hint.show(false); |
Akron | 65c7435 | 2016-09-02 17:23:39 +0200 | [diff] [blame] | 265 | |
Akron | ee9ef4a | 2016-06-03 12:50:08 +0200 | [diff] [blame] | 266 | expect(hint.inputField().container().getElementsByTagName('div').length).toEqual(4); |
| 267 | expect(hint.inputField().container().getElementsByTagName('ul').length).toEqual(1); |
Akron | 02360e4 | 2016-06-07 13:41:12 +0200 | [diff] [blame] | 268 | expect(hint.inputField().container().getElementsByTagName('li').length).toEqual(2); |
| 269 | |
Akron | ee9ef4a | 2016-06-03 12:50:08 +0200 | [diff] [blame] | 270 | hint.unshow(); |
| 271 | hint.inputField().insert(' aaaa/'); |
| 272 | |
| 273 | // show with context |
| 274 | hint.show(true); |
| 275 | |
Akron | 1a5a587 | 2016-09-05 20:17:14 +0200 | [diff] [blame] | 276 | expect(hint.inputField().container().getElementsByTagName('div').length).toEqual(1); |
| 277 | expect(hint.inputField().container().getElementsByTagName('ul').length).toEqual(0); |
| 278 | }); |
| 279 | |
Akron | 95abaf4 | 2018-04-26 15:33:22 +0200 | [diff] [blame] | 280 | |
| 281 | it('should open menus depending on the context', function () { |
| 282 | var hint = hintClass.create({ |
| 283 | inputField : input |
| 284 | }); |
| 285 | hint.inputField().reset(); |
| 286 | |
| 287 | expect(hint.active()).toBeFalsy(); |
| 288 | |
| 289 | // show with context |
| 290 | hint.show(false); |
| 291 | |
| 292 | expect(hint.active()).toBeTruthy(); |
| 293 | |
| 294 | expect(hint.inputField().container().getElementsByTagName('li')[0].firstChild.innerText).toEqual("Base Annotation"); |
| 295 | |
| 296 | // Type in prefix |
| 297 | hint.active().prefix("cor").show(); |
| 298 | expect(hint.active().prefix()).toEqual("cor"); |
| 299 | |
| 300 | // Click first step |
| 301 | expect(hint.inputField().container().getElementsByTagName('li')[0].firstChild.firstChild.innerText).toEqual("Cor"); |
| 302 | hint.inputField().container().getElementsByTagName('li')[0].click(); |
| 303 | |
| 304 | expect(hint.active()).toBeTruthy(); |
| 305 | |
| 306 | // Click second step |
| 307 | expect(hint.inputField().container().getElementsByTagName('li')[0].firstChild.innerText).toEqual("Named Entity"); |
| 308 | hint.inputField().container().getElementsByTagName('li')[0].click() |
| 309 | |
| 310 | // Invisible menu |
| 311 | expect(hint.inputField().container().getElementsByTagName('li')[0]).toBeUndefined(); |
| 312 | |
| 313 | // Inactive menu |
| 314 | expect(hint.active()).toBeFalsy(); |
| 315 | |
| 316 | // show with context |
| 317 | hint.show(false); |
| 318 | |
| 319 | // No prefix |
| 320 | expect(hint.active().prefix()).toEqual(""); |
| 321 | }); |
| 322 | |
| 323 | |
Akron | 1a5a587 | 2016-09-05 20:17:14 +0200 | [diff] [blame] | 324 | it('should not view main menu if context is mandatory', function () { |
| 325 | var hint = hintClass.create({ |
| 326 | inputField : input |
| 327 | }); |
| 328 | |
| 329 | expect(hint.active()).toBeFalsy(); |
| 330 | |
| 331 | // Fine |
| 332 | hint.inputField().insert('der Baum corenlp/'); |
| 333 | hint.show(true); |
| 334 | expect(hint.active()).toBeTruthy(); |
| 335 | |
| 336 | // Not analyzable |
| 337 | hint.inputField().insert('jhgjughjfhgnhfcvgnhj'); |
| 338 | hint.show(true); |
| 339 | expect(hint.active()).toBeFalsy(); |
| 340 | |
| 341 | // Not available |
| 342 | hint.inputField().insert('jhgjughjfhgnhfcvgnhj/'); |
| 343 | hint.show(true); |
| 344 | expect(hint.active()).toBeFalsy(); |
Akron | 00cd4d1 | 2016-05-31 21:01:11 +0200 | [diff] [blame] | 345 | }); |
Akron | 65c7435 | 2016-09-02 17:23:39 +0200 | [diff] [blame] | 346 | |
Akron | 02360e4 | 2016-06-07 13:41:12 +0200 | [diff] [blame] | 347 | xit('should remove all menus on escape'); |
Nils Diewald | 19ccee9 | 2014-12-08 11:30:08 +0000 | [diff] [blame] | 348 | }); |
| 349 | |
Akron | 65c7435 | 2016-09-02 17:23:39 +0200 | [diff] [blame] | 350 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 351 | describe('KorAP.HintMenuItem', function () { |
| 352 | it('should be initializable', function () { |
| 353 | expect( |
Akron | 1a5a587 | 2016-09-05 20:17:14 +0200 | [diff] [blame] | 354 | function() { menuItemClass.create([]) } |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 355 | ).toThrow(new Error("Missing parameters")); |
Nils Diewald | 19ccee9 | 2014-12-08 11:30:08 +0000 | [diff] [blame] | 356 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 357 | expect( |
Akron | 1a5a587 | 2016-09-05 20:17:14 +0200 | [diff] [blame] | 358 | function() { menuItemClass.create(['CoreNLP']) } |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 359 | ).toThrow(new Error("Missing parameters")); |
Nils Diewald | 19ccee9 | 2014-12-08 11:30:08 +0000 | [diff] [blame] | 360 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 361 | var menuItem = menuItemClass.create(['CoreNLP', 'corenlp/']); |
| 362 | expect(menuItem.name()).toEqual('CoreNLP'); |
| 363 | expect(menuItem.action()).toEqual('corenlp/'); |
| 364 | expect(menuItem.desc()).toBeUndefined(); |
Nils Diewald | 19ccee9 | 2014-12-08 11:30:08 +0000 | [diff] [blame] | 365 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 366 | menuItem = menuItemClass.create( |
Akron | 1a5a587 | 2016-09-05 20:17:14 +0200 | [diff] [blame] | 367 | ['CoreNLP', 'corenlp/', 'It\'s funny'] |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 368 | ); |
| 369 | expect(menuItem.name()).toEqual('CoreNLP'); |
| 370 | expect(menuItem.action()).toEqual('corenlp/'); |
| 371 | expect(menuItem.desc()).not.toBeUndefined(); |
| 372 | expect(menuItem.desc()).toEqual('It\'s funny'); |
| 373 | }); |
Nils Diewald | 19ccee9 | 2014-12-08 11:30:08 +0000 | [diff] [blame] | 374 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 375 | it('should have an element', function () { |
| 376 | var menuItem = menuItemClass.create(['CoreNLP', 'corenlp/']); |
| 377 | expect(menuItem.element()).not.toBe(undefined); |
| 378 | expect(menuItem.element().nodeName).toEqual("LI"); |
Nils Diewald | 19ccee9 | 2014-12-08 11:30:08 +0000 | [diff] [blame] | 379 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 380 | var title = menuItem.element().firstChild; |
| 381 | expect(title.nodeName).toEqual("SPAN"); |
| 382 | expect(title.firstChild.nodeType).toEqual(3); |
| 383 | expect(title.firstChild.nodeValue).toEqual("CoreNLP"); |
| 384 | expect(menuItem.element().childNodes[0]).not.toBe(undefined); |
| 385 | expect(menuItem.element().childNodes[1]).toBe(undefined); |
Nils Diewald | 19ccee9 | 2014-12-08 11:30:08 +0000 | [diff] [blame] | 386 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 387 | menuItem = menuItemClass.create( |
Akron | 1a5a587 | 2016-09-05 20:17:14 +0200 | [diff] [blame] | 388 | ['CoreNLP', 'corenlp/', 'my DescRiption'] |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 389 | ); |
| 390 | expect(menuItem.element()).not.toBe(undefined); |
| 391 | expect(menuItem.element().nodeName).toEqual("LI"); |
Nils Diewald | 19ccee9 | 2014-12-08 11:30:08 +0000 | [diff] [blame] | 392 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 393 | title = menuItem.element().firstChild; |
| 394 | expect(title.nodeName).toEqual("SPAN"); |
| 395 | expect(title.firstChild.nodeType).toEqual(3); // TextNode |
| 396 | expect(title.firstChild.nodeValue).toEqual("CoreNLP"); |
Nils Diewald | 19ccee9 | 2014-12-08 11:30:08 +0000 | [diff] [blame] | 397 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 398 | expect(menuItem.element().childNodes[0]).not.toBe(undefined); |
| 399 | expect(menuItem.element().childNodes[1]).not.toBe(undefined); |
Nils Diewald | 19ccee9 | 2014-12-08 11:30:08 +0000 | [diff] [blame] | 400 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 401 | var desc = menuItem.element().lastChild; |
| 402 | expect(desc.nodeName).toEqual("SPAN"); |
| 403 | expect(desc.firstChild.nodeType).toEqual(3); // TextNode |
| 404 | expect(desc.firstChild.nodeValue).toEqual("my DescRiption"); |
| 405 | }); |
Nils Diewald | 1c54692 | 2015-04-13 01:56:19 +0000 | [diff] [blame] | 406 | |
Nils Diewald | 19ccee9 | 2014-12-08 11:30:08 +0000 | [diff] [blame] | 407 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 408 | it('should be activatable and deactivateable by class', function () { |
| 409 | var menuItem = menuItemClass.create(['CoreNLP', 'corenlp/']); |
| 410 | expect(menuItem.active()).toBe(false); |
| 411 | expect(menuItem.element().getAttribute("class")).toBe(null); |
| 412 | menuItem.active(true); |
| 413 | expect(menuItem.active()).toBe(true); |
| 414 | expect(menuItem.element().getAttribute("class")).toEqual("active"); |
| 415 | menuItem.active(false); // Is active |
| 416 | expect(menuItem.active()).toBe(false); |
| 417 | expect(menuItem.element().getAttribute("class")).toEqual(""); |
| 418 | menuItem.active(true); |
| 419 | expect(menuItem.active()).toBe(true); |
| 420 | expect(menuItem.element().getAttribute("class")).toEqual("active"); |
Nils Diewald | 19ccee9 | 2014-12-08 11:30:08 +0000 | [diff] [blame] | 421 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 422 | menuItem = menuItemClass.create(['CoreNLP', 'corenlp/']); |
| 423 | expect(menuItem.active()).toBe(false); |
| 424 | expect(menuItem.element().getAttribute("class")).toBe(null); |
| 425 | menuItem.active(false); // Is not active |
| 426 | expect(menuItem.active()).toBe(false); |
| 427 | expect(menuItem.element().getAttribute("class")).toBe(null); |
| 428 | }); |
Nils Diewald | 19ccee9 | 2014-12-08 11:30:08 +0000 | [diff] [blame] | 429 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 430 | it('should be set to boundary', function () { |
| 431 | var menuItem = menuItemClass.create(['CoreNLP', 'corenlp/']); |
| 432 | expect(menuItem.active()).toBe(false); |
| 433 | expect(menuItem.element().getAttribute("class")).toBe(null); |
Nils Diewald | 19ccee9 | 2014-12-08 11:30:08 +0000 | [diff] [blame] | 434 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 435 | // Set active |
| 436 | menuItem.active(true); |
| 437 | expect(menuItem.active()).toBe(true); |
| 438 | expect(menuItem.noMore()).toBe(false); |
| 439 | expect(menuItem.element().getAttribute("class")).toEqual("active"); |
Nils Diewald | 19ccee9 | 2014-12-08 11:30:08 +0000 | [diff] [blame] | 440 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 441 | // Set no more |
| 442 | menuItem.noMore(true); |
| 443 | expect(menuItem.active()).toBe(true); |
| 444 | expect(menuItem.noMore()).toBe(true); |
| 445 | expect(menuItem.element().getAttribute("class")).toEqual("active no-more"); |
Nils Diewald | 1c54692 | 2015-04-13 01:56:19 +0000 | [diff] [blame] | 446 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 447 | // No no more |
| 448 | menuItem.noMore(false); |
| 449 | expect(menuItem.active()).toBe(true); |
| 450 | expect(menuItem.noMore()).toBe(false); |
| 451 | expect(menuItem.element().getAttribute("class")).toEqual("active"); |
Nils Diewald | 1c54692 | 2015-04-13 01:56:19 +0000 | [diff] [blame] | 452 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 453 | // Set no more, deactivate |
| 454 | menuItem.noMore(true); |
| 455 | menuItem.active(false); |
| 456 | expect(menuItem.active()).toBe(false); |
| 457 | expect(menuItem.noMore()).toBe(true); |
| 458 | expect(menuItem.element().getAttribute("class")).toEqual("no-more"); |
Nils Diewald | 19ccee9 | 2014-12-08 11:30:08 +0000 | [diff] [blame] | 459 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 460 | // Set active |
| 461 | menuItem.active(true); |
| 462 | expect(menuItem.active()).toBe(true); |
| 463 | expect(menuItem.noMore()).toBe(true); |
| 464 | expect(menuItem.element().getAttribute("class")).toEqual("no-more active"); |
| 465 | }); |
Nils Diewald | 19ccee9 | 2014-12-08 11:30:08 +0000 | [diff] [blame] | 466 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 467 | it('should be highlightable', function () { |
| 468 | // Highlight in the middle |
| 469 | var menuItem = menuItemClass.create(['CoreNLP', 'corenlp/']); |
| 470 | menuItem.highlight("ren"); |
| 471 | expect(menuItem.element().innerHTML).toEqual("<span>Co<mark>reN</mark>LP</span>"); |
Nils Diewald | 19ccee9 | 2014-12-08 11:30:08 +0000 | [diff] [blame] | 472 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 473 | menuItem.lowlight(); |
| 474 | expect(menuItem.element().innerHTML).toEqual("<span>CoreNLP</span>"); |
Nils Diewald | 19ccee9 | 2014-12-08 11:30:08 +0000 | [diff] [blame] | 475 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 476 | // Starting highlight |
| 477 | menuItem = menuItemClass.create(['CoreNLP', 'corenlp/']); |
| 478 | menuItem.highlight("cor"); |
| 479 | expect(menuItem.element().innerHTML).toEqual("<span><mark>Cor</mark>eNLP</span>"); |
Nils Diewald | 19ccee9 | 2014-12-08 11:30:08 +0000 | [diff] [blame] | 480 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 481 | menuItem.lowlight(); |
| 482 | expect(menuItem.element().innerHTML).toEqual("<span>CoreNLP</span>"); |
| 483 | |
| 484 | // Starting highlight - short |
| 485 | menuItem = menuItemClass.create(['CoreNLP', 'corenlp/']); |
| 486 | menuItem.highlight("c"); |
| 487 | expect(menuItem.element().innerHTML).toEqual("<span><mark>C</mark>oreNLP</span>"); |
| 488 | |
| 489 | menuItem.lowlight(); |
| 490 | expect(menuItem.element().innerHTML).toEqual("<span>CoreNLP</span>"); |
| 491 | |
| 492 | // Highlight at the end |
| 493 | menuItem = menuItemClass.create(['CoreNLP', 'corenlp/']); |
| 494 | menuItem.highlight("nlp"); |
| 495 | expect(menuItem.element().innerHTML).toEqual("<span>Core<mark>NLP</mark></span>"); |
| 496 | |
| 497 | menuItem.lowlight(); |
| 498 | expect(menuItem.element().innerHTML).toEqual("<span>CoreNLP</span>"); |
| 499 | |
| 500 | // Highlight at the end - short |
| 501 | menuItem = menuItemClass.create(['CoreNLP', 'corenlp/']); |
| 502 | menuItem.highlight("p"); |
| 503 | expect(menuItem.element().innerHTML).toEqual("<span>CoreNL<mark>P</mark></span>"); |
| 504 | |
| 505 | menuItem.lowlight(); |
| 506 | expect(menuItem.element().innerHTML).toEqual("<span>CoreNLP</span>"); |
| 507 | |
| 508 | // No highlight |
| 509 | menuItem = menuItemClass.create(['CoreNLP', 'corenlp/']); |
| 510 | menuItem.highlight("xp"); |
| 511 | expect(menuItem.element().innerHTML).toEqual("<span>CoreNLP</span>"); |
| 512 | |
| 513 | menuItem.lowlight(); |
| 514 | expect(menuItem.element().innerHTML).toEqual("<span>CoreNLP</span>"); |
| 515 | |
| 516 | // Highlight in the middle - first |
| 517 | menuItem = menuItemClass.create(['CoreNLP', 'corenlp/', 'This is my Example']); |
| 518 | |
| 519 | menuItem.highlight("ren"); |
| 520 | expect(menuItem.element().innerHTML).toEqual("<span>Co<mark>reN</mark>LP</span><span class=\"desc\">This is my Example</span>"); |
| 521 | |
| 522 | menuItem.lowlight(); |
| 523 | expect(menuItem.element().innerHTML).toEqual('<span>CoreNLP</span><span class="desc">This is my Example</span>'); |
| 524 | |
| 525 | // Highlight in the middle - second |
| 526 | menuItem = menuItemClass.create(['CoreNLP', 'corenlp/', 'This is my Example']); |
| 527 | menuItem.highlight("ampl"); |
| 528 | expect(menuItem.element().innerHTML).toEqual('<span>CoreNLP</span><span class="desc">This is my Ex<mark>ampl</mark>e</span>'); |
| 529 | |
| 530 | menuItem.lowlight(); |
| 531 | expect(menuItem.element().innerHTML).toEqual('<span>CoreNLP</span><span class="desc">This is my Example</span>'); |
| 532 | |
| 533 | // Highlight in the middle - both |
| 534 | menuItem = menuItemClass.create(['CoreNLP', 'corenlp/', 'This is my Example']); |
| 535 | |
| 536 | menuItem.highlight("e"); |
| 537 | expect(menuItem.element().innerHTML).toEqual('<span>Cor<mark>e</mark>NLP</span><span class="desc">This is my <mark>E</mark>xampl<mark>e</mark></span>'); |
| 538 | |
| 539 | menuItem.lowlight(); |
| 540 | expect(menuItem.element().innerHTML).toEqual("<span>CoreNLP</span><span class=\"desc\">This is my Example</span>"); |
| 541 | |
| 542 | // Highlight in the end - second |
| 543 | menuItem = menuItemClass.create(['CoreNLP', 'corenlp/', 'This is my Example']); |
| 544 | menuItem.highlight("le"); |
| 545 | expect(menuItem.element().innerHTML).toEqual("<span>CoreNLP</span><span class=\"desc\">This is my Examp<mark>le</mark></span>"); |
| 546 | |
| 547 | menuItem.lowlight(); |
| 548 | expect(menuItem.element().innerHTML).toEqual("<span>CoreNLP</span><span class=\"desc\">This is my Example</span>"); |
| 549 | |
| 550 | // Highlight at the beginning - second |
| 551 | menuItem = menuItemClass.create(['CoreNLP', 'corenlp/', 'This is my Example']); |
| 552 | menuItem.highlight("this"); |
| 553 | expect(menuItem.element().innerHTML).toEqual("<span>CoreNLP</span><span class=\"desc\"><mark>This</mark> is my Example</span>"); |
| 554 | |
| 555 | menuItem.lowlight(); |
| 556 | expect(menuItem.element().innerHTML).toEqual("<span>CoreNLP</span><span class=\"desc\">This is my Example</span>"); |
Akron | 6ed1399 | 2016-05-23 18:06:05 +0200 | [diff] [blame] | 557 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 558 | }); |
Nils Diewald | 19ccee9 | 2014-12-08 11:30:08 +0000 | [diff] [blame] | 559 | }); |
Nils Diewald | 19ccee9 | 2014-12-08 11:30:08 +0000 | [diff] [blame] | 560 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 561 | describe('KorAP.HintMenu', function () { |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 562 | var list = [ |
| 563 | ["Constituency", "c=", "Example 1"], |
| 564 | ["Lemma", "l="], |
| 565 | ["Morphology", "m=", "Example 2"], |
| 566 | ["Part-of-Speech", "p="], |
| 567 | ["Syntax", "syn="] |
| 568 | ]; |
Nils Diewald | 19ccee9 | 2014-12-08 11:30:08 +0000 | [diff] [blame] | 569 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 570 | it('should be initializable', function () { |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 571 | var menu = menuClass.create(null, "cnx/", list); |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 572 | expect(menu.element().nodeName).toEqual('UL'); |
Akron | 65c7435 | 2016-09-02 17:23:39 +0200 | [diff] [blame] | 573 | // expect(menu.element().style.opacity).toEqual("0"); |
Nils Diewald | 19ccee9 | 2014-12-08 11:30:08 +0000 | [diff] [blame] | 574 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 575 | menu.limit(8); |
Nils Diewald | 19ccee9 | 2014-12-08 11:30:08 +0000 | [diff] [blame] | 576 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 577 | // view |
| 578 | menu.show(); |
Akron | 6ed1399 | 2016-05-23 18:06:05 +0200 | [diff] [blame] | 579 | expect(menu.prefix()).toBe(''); |
Nils Diewald | 19ccee9 | 2014-12-08 11:30:08 +0000 | [diff] [blame] | 580 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 581 | // First element in list |
| 582 | expect(menu.item(0).active()).toBe(true); |
| 583 | expect(menu.item(0).noMore()).toBe(true); |
| 584 | |
| 585 | // Middle element in list |
| 586 | expect(menu.item(2).active()).toBe(false); |
| 587 | expect(menu.item(2).noMore()).toBe(false); |
Nils Diewald | 19ccee9 | 2014-12-08 11:30:08 +0000 | [diff] [blame] | 588 | |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 589 | // Last element in list |
| 590 | expect(menu.item(menu.length() - 1).active()).toBe(false); |
| 591 | expect(menu.item(menu.length() - 1).noMore()).toBe(true); |
Akron | 6ed1399 | 2016-05-23 18:06:05 +0200 | [diff] [blame] | 592 | |
| 593 | expect(menu.shownItem(0).active()).toBeTruthy(); |
| 594 | expect(menu.shownItem(0).lcField()).toEqual(' constituency example 1'); |
| 595 | expect(menu.shownItem(1).lcField()).toEqual(' lemma'); |
| 596 | expect(menu.shownItem(2).lcField()).toEqual(' morphology example 2'); |
| 597 | |
| 598 | menu.next(); |
| 599 | expect(menu.shownItem(1).active()).toBeTruthy(); |
| 600 | |
| 601 | menu.next(); |
| 602 | expect(menu.shownItem(2).active()).toBeTruthy(); |
Nils Diewald | 7c8ced2 | 2015-04-15 19:21:00 +0000 | [diff] [blame] | 603 | }); |
Nils Diewald | 19ccee9 | 2014-12-08 11:30:08 +0000 | [diff] [blame] | 604 | }); |
| 605 | }); |