MCPcopy Index your code
hub / github.com/prettydiff/prettydiff / areaTabOut

Function areaTabOut

api/prettydiff-webtool.ts:241–322  ·  view source on GitHub ↗
(event:KeyboardEvent)

Source from the content-addressed store, hash-verified

239 }
240 },
241 areaTabOut = function dom_load_areaTabOut(event:KeyboardEvent):void {
242 const node:HTMLElement = <HTMLElement>event.srcElement || <HTMLElement>event.target;
243 let len:number = test.tabesc.length,
244 esc:boolean = false,
245 key:number = 0;
246 key = event.keyCode;
247 if (key === 17 || key === 224) {
248 if (data.tabtrue === false && (test.tabesc[0] === 17 || test.tabesc[0] === 224 || len > 1)) {
249 return;
250 }
251 data.tabtrue = false;
252 }
253 if (node.nodeName.toLowerCase() === "textarea") {
254 if (test.ace === true) {
255 if (node === textarea.codeOut) {
256 esc = true;
257 }
258 }
259 if (node === textarea.codeIn) {
260 esc = true;
261 }
262 }
263 if (esc === true) {
264 esc = false;
265 data.tabtrue = false;
266 if ((len === 1 && test.tabesc[0] !== 16 && key !== test.tabesc[0]) || (len === 2 && key !== test.tabesc[1])) {
267 test.tabesc = [];
268 return;
269 }
270 if (len === 0 && (key === 16 || key === 17 || key === 224)) {
271 test
272 .tabesc
273 .push(key);
274 return;
275 }
276 if (len === 1 && (key === 17 || key === 224)) {
277 if (test.tabesc[0] === 17 || test.tabesc[0] === 224) {
278 esc = true;
279 } else {
280 test
281 .tabesc
282 .push(key);
283 return;
284 }
285 } else if (len === 2 && (key === 17 || key === 224)) {
286 esc = true;
287 } else if (len > 0) {
288 test.tabesc = [];
289 }
290 if (esc === true) {
291 if (len === 2) {
292 //back tab
293 if (node === textarea.codeIn) {
294 id("inputfile").focus();
295 } else if (node === textarea.codeOut) {
296 textarea
297 .codeIn
298 .focus();

Callers 1

loadFunction · 0.85

Calls 1

idFunction · 0.85

Tested by

no test coverage detected