From 68b0ea7d632ea999a4aff53f89d6acdcdab798e1 Mon Sep 17 00:00:00 2001 From: Nguyen Kim Kha Date: Wed, 15 Apr 2015 08:52:28 +0700 Subject: [PATCH] #11 refactor --- src/scripts/extension.js | 44 +++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/src/scripts/extension.js b/src/scripts/extension.js index cce2f15..1b77936 100644 --- a/src/scripts/extension.js +++ b/src/scripts/extension.js @@ -7,30 +7,28 @@ var allFrames = []; var inputTypes = ["textarea", "text", "search", "tel"]; function AVIMInit(AVIM, isAttach) { - /*if(AVIM.support) { - allFrames = document.getElementsByTagName("iframe"); - for(AVIM.g = 0; AVIM.g < allFrames.length; AVIM.g++) { - if(findIgnore(allFrames[AVIM.g])) { - continue; - } - var iframedit; - try { - AVIM.wi = allFrames[AVIM.g].contentWindow; - iframedit = AVIM.wi.document; - iframedit.wi = AVIM.wi; - if(iframedit && (upperCase(iframedit.designMode) == "ON")) { - iframedit.AVIM = AVIM; - if (isAttach) { - attachEvt(iframedit, "keypress", ifMoz, false); - attachEvt(iframedit, "keydown", keyDownHandler, false); - } else { - attachEvt(iframedit, "keypress", ifMoz, false); - attachEvt(iframedit, "keydown", keyDownHandler, false); - } - } - } catch(e) {} + allFrames = document.getElementsByTagName("iframe"); + for(AVIM.g = 0; AVIM.g < allFrames.length; AVIM.g++) { + if(findIgnore(allFrames[AVIM.g])) { + continue; } - }*/ + var iframedit; + try { + AVIM.wi = allFrames[AVIM.g].contentWindow; + iframedit = AVIM.wi.document; + iframedit.wi = AVIM.wi; + if(iframedit && (upperCase(iframedit.designMode) == "ON")) { + iframedit.AVIM = AVIM; + if (isAttach) { + attachEvt(iframedit, "keypress", ifMoz, false); + attachEvt(iframedit, "keydown", keyDownHandler, false); + } else { + attachEvt(iframedit, "keypress", ifMoz, false); + attachEvt(iframedit, "keydown", keyDownHandler, false); + } + } + } catch(e) {} + }/**/ } function findIgnore(el) {