123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989 |
-
- Namespace.register("U.D.E");
- U.D.E.setVariable = function (id, cursor) {
- var _cursors = U.D.E.SORange;
- if (id) {
-
- _cursors["OAT"][id] = [{ "OR": new cursor.init(cursor, false), "C": ""}];
- _cursors["OAT"][id].l = 0;
- _cursors["OE"][id] = cursor;
- }
- }
- U.D.E.GetSelectionRange = function (win, el, obj) {
- try {
- var _id = obj["TF"],
- _cursors = U.D.E.SORange,
- _cursor = _cursors["OE"][_id];
-
- if (_id && _cursor) {
-
- _cursor.CreateR();
- }
- else {
- _cursor = new U.D.E.SelectionRange(win, win.document, el, obj).CreateR(true);
-
- U.D.E.setVariable(_id, _cursor);
-
-
- U.D.E.KeyboardBinding(_cursor.PSO, _cursor);
- }
- return _cursor;
- }
- catch (e) { return false; }
- }
- U.D.E.KeyboardBinding = function (el, cursor) {
- $(el).bind({
- "keydown": U.M.apply(cursor, cursor.GetKE),
- "keyup": U.M.apply(cursor, cursor.CLKU),
- "copy": U.M.apply(cursor, cursor.Copy),
- "paste": U.M.apply(cursor, cursor.Paste),
- "cut": U.M.apply(cursor, cursor.Cut),
-
- "click": U.M.apply(cursor, cursor.CLMU)
- });
- }
- U.D.E.SelectionRange = function (UW, UD, UDOD, UDE) {
- this.setVariable(UW, UD, UDOD, UDE);
- }
- U.D.E.SORange = U.D.E.SelectionRange.prototype = {
- OAT: {},
- OE: {},
- setVariable: function (UW, UD, UDOD, UDE) {
- this.CW = UW;
- this.CD = UD;
- this.SO = UDOD || this.Parent();
- this.PSO = $(UDOD).Parent({ "contentEditable": "true" });
- this.CB = UDE["CB"];
- this.TF = UDE["TF"];
- this.TIM = [];
- this.S = null;
- this.R = null;
- this.J = null;
- this.TR = null;
- this.BCB = null;
- this.FCB = null;
- this.Dectect = U.D.E.codeDetect();
- this.CTH = "";
- },
-
- CreateR: function (UTF) {
-
-
- var _b,
- _win = this.CW,
- _doc = this.CD;
-
- try {
- if (_win.getSelection) {
- U.Ut.AddObj(this, { S: _win.getSelection(), TR: _doc.createRange() });
- if (UTF !== false && this.SO) {
- if (this.SO.focus && (!this.S.rangeCount || !U.M.EISE(this.PSO, this.Parent(this.S.getRangeAt(0))))) {
- this.SO.focus();
- this.QX(this.getLen(this.SO), this.getLen(this.SO), this.SO);
- this.S = _win.getSelection();
- }
- }
- this.R = this.S.rangeCount ? this.S.getRangeAt(0) : this.R || _doc.createRange();
- }
- else {
- U.Ut.AddObj(this, {
- S: _doc.selection,
- R: _doc.selection.createRange(),
- TR: document.body.createTextRange()
- });
- if ((_UTF = (UTF !== false && this.SO && !U.M.EISE(this.PSO, this.Parent(this.R)))) || UTF) {
- if (_UTF) {
- this.R = this.QX(this.getLen(this.SO), this.getLen(this.SO), this.SO) || this.R;
- }
- else {
- this.SO.focus();
- this.Replace("");
- }
- this.S = _doc.selection;
- }
- }
- } catch (e) { }
- return this;
- },
-
- init: function (URE, UTF) {
- this.setVariable(URE["CW"], URE["CD"], URE["SO"], { "TF": URE["TF"], "CB": URE["CB"] }, URE["PSO"])
- this.CreateR(UTF);
- },
-
-
- Parent: function (UDR, UTF, NT) {
- if (UDR = UDR || this.R) {
- if (UDR.parentElement || UDR.commonParentElement) {
- return (UDR.parentElement || UDR.commonParentElement)();
- }
- else {
- var _UDOD = UDR.commonAncestorContainer;
- if (NT) {
- return UDR.endContainer.parentElement;
- }
- return ((_UDOD.nodeName == "#text" && UTF) ? _UDOD.parentNode : _UDOD);
- }
- }
- },
-
- Element: function (UDR) {
- if (UDR = UDR || this.R) {
- if (UDR.parentElement || UDR.commonParentElement) {
- return (UDR.parentElement || UDR.commonParentElement)();
- }
- else {
- return UDR.commonAncestorContainer;
- }
- }
- },
-
- IParent: function (UTH, UDR) {
- UTH = U.Ut.isUndefined(UTH) ? this.GetSelectedHtml() : UTH;
- var _UDPD,
- _UDOD = this.Parent(UDR),
- _UDTD = $$("div", { "innerHTML": UTH });
- while (_UDOD && _UDOD.innerText && (_UDTD.innerText == _UDOD.innerText) && (_UDOD != this.PSO) && (_UDPD = _UDOD)) {
- _UDOD = _UDOD.parentNode;
- }
- return _UDPD;
- },
-
-
- Replace: function (UTS, URD, UTF) {
- var i, _userid, _UDOD, _UDCD, _UDTD, _UDSD, _UDE, _UTF, _UST = "",
- _UTH = UTS == null ? UTS : (UTS.outerHTML || UTS);
- URD = URD || this.R;
- if (URD && UTS != null) {
- _UDE = [];
- _UDOD = this.Parent(URD);
- _userid = "R" + Guid.newGuid();
- _UDTD = $$("span", { "id": _userid, "innerHTML": _UTH });
- _UTF = this.GetSelectedText();
- if (_UDOD != document) {
- if (window.getSelection) {
- _UDTD = URD.createContextualFragment(_UTH);
- (_UDOD.innerText == this.GetSelectedText() && _UDOD.innerText) && (URD.selectNodeContents(_UDOD));
- URD.deleteContents();
- this.S.removeAllRanges();
-
-
-
- URD.insertNode(_UDTD);
-
-
-
-
- if (UTF) {
- URD.collapse(false);
- }
- this.S.addRange(URD);
- }
- else {
- if (!_UDTD.innerText && !$("div", _UDTD).length && !$("div", this.PSO).length) {
- this.SL($$("div", {}, this.PSO));
- _UST = _UDTD.innerHTML;
- }
- else {
- _UST = (_UDTD.innerHTML && !UTF) ? _UDTD.outerHTML : _UDTD.innerHTML;
- }
- URD.select();
- URD.pasteHTML("");
- URD.pasteHTML(_UST);
- if (UTF || !_UDTD.innerHTML) { URD.collapse(false); }
- else {
- _UDTD = $("span", this.Parent())[_UDTD.id];
- _UDTD.outerHTML = _UDTD.innerHTML;
- this.R.select();
- }
- }
- this.CreateR();
-
- }
- }
- return this;
- },
-
-
- QX: function (US, UE, UDOD) {
- try {
- var _UOE, _UTE,
- _UD = this.CD;
- UDOD = UDOD || this.Parent();
- if (window.getSelection) {
- this.S = (this.S || this.CW.getSelection());
- (!this.S.rangeCount) && (this.CW.focus(), UDOD.focus(),
- this.R = this.S.getRangeAt(0));
- if (this.R.commonAncestorContainer != document) {
- _UOE = document.createRange();
- _UOE.selectNode((UDOD));
- US = US == null ? _UOE.startOffset : US == -1 ? _UOE.endOffset : US;
- UE = UE == null ? _UOE.endOffset : UE == -1 ? _UOE.endOffset : UE;
- try {
- _UOE.setStart((UDOD || this.R.startContainer), US);
- _UOE.setEnd((UDOD || this.R.endContainer), UE);
- }
- catch (e) {
- _UOE.setStart(this.R.startContainer, US);
- _UOE.setEnd(this.R.endContainer, UE);
- }
- this.S.removeAllRanges();
- this.S.addRange(_UOE);
- }
- }
- else {
- if (U.Ut.isNumber(US)) {
- _UOE = _UD.body.createTextRange();
- _UTE = _UD.body.createTextRange();
- _UOE.moveToElementText(UDOD);
- (U.Ut.isNumber(US)) && (_UOE.moveStart("character", US), _UTE.moveToElementText(UDOD), _UTE.moveStart("character", UE), _UOE.setEndPoint("EndToStart", _UTE));
- (US !== UE) && (_UOE.select());
- }
- else { this.R.select(); }
- }
- return _UOE;
- }
- catch (e) { return false; }
- },
-
- moveRange: function (US) {
- this.CreateR(false);
- if (window.getSelection) {
- try {
- this.TR.setStart(this.R.startContainer, this.R.startOffset + US);
- this.TR.setEnd(this.R.endContainer, this.R.endOffset);
- }
- catch (e) { }
- this.S.removeAllRanges();
- this.S.addRange(this.TR);
- }
- else {
- this.TR.moveToElementText(this.Parent());
- _UOE.moveStart("character", US);
- }
- this.CreateR();
- },
-
- GetSE: function () {
- if (window.getSelection) {
- _USE = this.CW.getSelection();
- _URE = _USE.rangeCount ? _USE.getRangeAt(0) : this.R;
- (UDR) && (_URE.setStart(UDR.endContainer, UDR.endOffset));
- }
- else {
- _USE = document.selection;
- _URE = document.selection.createRange();
- (UDR) && (_URE.setEndPoint("EndToEnd", UDR));
- }
- },
-
- SL: function (UDOD, UDR) {
- UDOD = UDOD || this.SO;
- if (window.getSelection) {
- (!UDR) && (UDR = document.createRange());
- UDR.selectNodeContents(UDOD);
- this.S = this.S || this.CW.getSelection();
- this.S.removeAllRanges();
- this.S.addRange(UDR);
- this.R = UDR;
- }
- else {
- (!UDR) && (UDR = document.body.createTextRange(), UDR.moveToElementText(UDOD));
- UDR.select();
- }
-
- return this;
- },
-
-
-
- GetSelectedHtml: function (UDR) {
- if ((UDR = UDR || this.R)) {
- var i, _UDAD, _UDCD, _URE, UST = "",
- _UIE = 1;
- if (UDR.cloneContents) {
- var _UDOD = $$("div");
- _UDOD.appendChild(UDR.cloneContents());
- UST = _UDOD.innerHTML;
- _UDCD = $($$("div", { "innerHTML": UST })).Nodes();
- UST = "";
- for (i = 0; i < _UDCD.length; i++) {
- UST += _UDCD[i].outerHTML ? _UDCD[i].outerHTML : "<span>" + _UDCD[i].data + "</span>";
- }
- }
- else if (UDR.commonParentElement) {
- UST = UDR.commonParentElement();
- UST = UST.outerHTML || UST.innerHTML || UST.value || "";
- }
- else {
- UST = UDR.htmlText;
- _UDAD = $$("div", { "innerHTML": UDR.htmlText }).childNodes;
- if (_UDAD.length) {
- UST = ""; _URE = UDR.duplicate();
- _URE.moveStart("character", -1);
- _UDCD = $($$("div", { "innerHTML": _URE.htmlText })).Nodes();
- if ((_UDCD.length == _UDAD.length && _UDAD[0].outerHTML == _UDCD[0].outerHTML) || (_UDCD.length != _UDAD.length && _URE.htmlText != UDR.htmlText)) {
- UST = $$("div", { "innerHTML": _UDAD[0].outerHTML || _UDAD[0].nodeValue || _UDAD[0].data || _UDAD[0].text }).innerHTML;
- }
- else {
- UST = ($($$("div", { "innerHTML": _UDAD[0].innerHTML })).Child().length ? _UDAD[0].innerHTML : (_UDAD[0].innerHTML || _UDAD[0].nodeValue || _UDAD[0].data || _UDAD[0].text ? $$("span", { "innerHTML": _UDAD[0].innerHTML || _UDAD[0].nodeValue || _UDAD[0].data || _UDAD[0].text }).outerHTML : ""));
- }
- if (_UDAD.length > 1) {
- for (i = 1; i < _UDAD.length - 1; i++) {
- UST += _UDAD[i].outerHTML || _UDAD[i].nodeValue || _UDAD[i].data || _UDAD[i].text;
- }
- _URE = UDR.duplicate(); _URE.moveEnd("character", 1);
- _UDCD = $($$("div", { "innerHTML": _URE.htmlText })).Child();
- if ((_UDCD.length == _UDAD.length && _UDAD[_UDAD.length - 1].outerHTML == _UDCD[_UDCD.length - 1].outerHTML) || (_UDCD.length != _UDAD.length && _URE.htmlText != UDR.htmlText)) {
- UST += $$("div", { "innerHTML": _UDAD[_UDAD.length - 1].outerHTML || _UDAD[_UDAD.length - 1].nodeValue || _UDAD[_UDAD.length - 1].data || _UDAD[_UDAD.length - 1].text }).innerHTML;
- }
- else {
- UST += ($($$("div", { "innerHTML": _UDAD[_UDAD.length - 1].innerHTML })).Child().length ? _UDAD[_UDAD.length - 1].innerHTML : _UDAD[_UDAD.length - 1].innerHTML || _UDAD[_UDAD.length - 1].nodeValue || _UDAD[_UDAD.length - 1].data || _UDAD[_UDAD.length - 1].text ? $$("span", { "innerHTML": _UDAD[_UDAD.length - 1].innerHTML || _UDAD[_UDAD.length - 1].nodeValue || _UDAD[_UDAD.length - 1].data || _UDAD[_UDAD.length - 1].text }).outerHTML : "");
- }
- }
- }
- }
- return UST;
- }
- },
-
- GetSelectedText: function (UDR) {
- return (UDR = UDR || this.R) == null || UDR.add ? null : UDR.text != undefined ? UDR.text : (this.S.toString());
- },
-
-
-
- GetKE: function (UTF) {
- var i, _UCE, _UDE, _UKE, _UL, _UDSD,
- _UTP = this.TF;
- UTF = UTF && U.Ut.isString(UTF) ? UTF : this.Dectect.getValue();
- switch (UTF) {
- case "redo":
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- break;
- case "undo":
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- break;
- default:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- break;
- }
- if (this.CB && this.CB(U.Ut.isString(UTF) ? UTF : UTF[4], [this.Parent()], this, UTF, window) === 1) {
-
- }
- },
-
- CLKU: function () {
- var _UDPD = this.PSO,
- _UTF = this.Dectect.getValue();
-
-
-
-
-
-
-
- if ((this.CB) && (this.CB("UP", [this.Parent()], this, _UTF, window) == 1)) {
-
- }
-
- },
-
-
- CLMU: function () {
-
- this.CreateR();
- var mb = window.parent.document.getElementsByClassName("UD_SYF_S UD_SYKO")[window.parent.document.getElementsByClassName("UD_SYF_S UD_SYKO").length - 1];
-
- _UTH = this.getBoundingClientRect();
-
-
- mb.children[2].children[0].children[0].children[0].children[7].children[0].value = this.Parent(null, true, true).style.fontSize || "10.5pt";
- },
-
- Cut: function () {
- this.CreateR();
- this.CTH = this.GetSelectedHtml();
- if (this.CB && this.CB("Cut", [this.Parent()], this, "Cut", window) === 1) {
-
- }
- },
-
- Copy: function () {
- this.CreateR();
- this.CTH = this.GetSelectedHtml();
- if (this.CB && this.CB("Copy", [this.Parent()], this, "Cut", window) === 1) {
-
- }
- },
-
- Paste: function (UDOD) {
- this.CreateR();
- if (this.CB && this.CB("Paste", [this.Parent()], this, "Cut", window) === 1) {
-
- }
-
-
-
-
-
-
-
-
- },
-
- SetStyle: function (UTH, UDE) {
- var i, _UDAD, _UTH = "",
- _UDOD = $$("span", { "innerHTML": UTH });
- this.writeStyle(_UDOD, UDE);
- return $("*", _UDOD).length ? _UDOD.innerHTML : _UDOD.outerHTML;
- },
-
- writeStyle: function (UDOD, UDE) {
- var i, j, _UTF,
- _UKE = {},
- _UCE = {},
- _USE = ["textAlign"],
- _UDPD = this.Parent(),
- _UDAD = $(UDOD).Nodes();
- while (_UDPD.tagName == "SPAN") {
- _UDPD = $(_UDPD).Parent();
- }
-
- for (i in UDE) {
- if (UDE.hasOwnProperty(i)) {
- if (_USE.indexOf(U.M.CssTHH(i)) > -1 ? _UCE : _UKE == _UCE) {
- _UCE[i] = UDE[i][0] == _UDPD.style[i] ? UDE[i][1] : UDE[i][0];
- }
- else {
- _UKE[i] = UDE[i][0];
- if (UDOD.style && UDOD.style[i] == UDE[i][0]) {
- _UKE[i] = UDE[i][1];
- }
- else {
-
- for (j = 0; j < _UDAD.length; j++) {
- if (_UDAD[j].style && _UDAD[j].style[i] == UDE[i][0]) {
- _UKE[i] = UDE[i][1]; break;
- }
- }
- }
- }
- }
- }
-
- (_UDPD.style) && ($(_UDPD).addAttrArray({ "style": _UCE }));
-
- $(UDOD).addAttrArray({ "style": _UKE });
- $("*", UDOD).addAttrArray({ "style": _UKE });
- },
-
- GetGBWZ: function (UDOD, UTF) {
- var _USE, _URE, _UDTD;
- if (window.getSelection) {
- _USE = this.CW.getSelection();
- _URE = _USE.rangeCount ? _USE.getRangeAt(0) : this.R;
- return UTF ? _URE.startOffset : _URE.endOffset;
- }
- else {
- try {
- UDOD = UDOD || this.Parent();
- _URE = this.QX(0, 0, UDOD);
- _URE.setEndPoint("EndTo" + (UTF ? "Start" : "End"), this.R);
- return (_UDTD = $$("div", { "innerHTML": _URE.htmlText })).innerText.length + ($("img", _UDTD).length);
- } catch (e) { }
- }
- return 0;
- },
-
- getBoundingClientRect: function () {
- if (window.getSelection) {
- return this.R.getBoundingClientRect();
- }
- else {
- return {
- bottom: this.R.P.boundingBottom,
- height: this.R.P.boundingHeight,
- left: this.R.P.boundingLeft,
- right: this.R.P.boundingRight,
- top: this.R.P.boundingTop,
- width: 1,
- x: this.R.P.boundingLeft,
- y: this.R.P.boundingTop
- };
- }
- },
-
- IsP: function (UDR) {
- if (!UDR) { return true; }
- if (window.getSelection) {
- var _UDE = document.getSelection();
- return (!_UDE.rangeCount || ((_UDE = _UDE.getRangeAt(0)) && UDR.endContaine == _UDE.endContaine && UDR.startContaine == _UDE.startContaine && UDR.endOffset == _UDE.endOffset && UDR.startOffset == _UDE.startOffset));
- }
- else {
- try { return UDR.isEqual(document.selection.createRange()); } catch (e) { }
- }
- return false;
- },
-
- isE: function (UDOD) {
- if (window.getSelection) {
- return this.S.containsNode(UDOD, true);
- }
- else {
- _URE = document.body.createTextRange();
- try {
- _URE.moveToElementText(UDOD);
- return this.R.inRange(_URE);
- }
- catch (e) { return false; }
- }
- },
-
- getLen: function (UDOD) {
- return $("img", UDOD).length + UDOD.innerText.length;
- },
-
-
- ADQJ: function (UDR) {
- clearTimeout(this.TIM[0]);
- this.TIM[0] = setTimeout((this.TIM[1] = U.M.apply(this, [[this.ADQJS, ["", UDR]]])), 500);
- return this.TIM[1];
- },
-
- ADQJS: function (UHT, UDR) {
- clearTimeout(this.TIM[0]);
- this.TIM = [];
- this.JHGB(UHT, UDR, this);
- },
-
- JHGB: function (UHT, UDR, UE) {
- var _UTF = this.TF,
- _UDE = this.OAT[_UTF],
- _UKE = this.IsP(_UDE[_UDE.l]["OR"]["R"]);
- (!_UKE && _UTF) && (this.AddHT(UHT, UDR, UE));
- },
-
- AddHT: function (UHT, UDR, UE) {
- var i, _UTP,
- _UTF = this.TF,
- _UDE = this.OAT[_UTF],
- _UOE = _UDE[_UDE.l];
- _UDE.l++;
- _UDE.splice(_UDE.l, _UDE.length - _UDE.l, (_UTE = { "OR": new this.init(UE, false), "C": (UHT || "") }));
- if (window.getSelection) {
- _UOE["OR"]["R"].setEnd(_UTE["OR"]["R"].startContainer, _UTE["OR"]["R"].startOffset);
- }
- else {
- _UTE = ["boundingWidth", "offsetLeft", "boundingLeft", "boundingTop", "offsetTop", "boundingHeight"];
- _UOE.P = {};
- for (i = 0; i < _UTE.length; i++) {
- _UOE.P[_UTE[i]] = _UOE.OR.R[_UTE[i]];
- }
- }
- },
-
- Brul: function () {
- (this.TIM[1]) && (this.TIM[1]());
- }
-
- }
- U.D.E.SORange.init.prototype = U.D.E.SORange;
- U.D.E.FontSizeType = function (UDOD, USE, UDE, UTF) {
- UDE = UDE || U.D.E.GetSelectionRange(window, UDOD, { "TF": UTF || "QL" });
- var i, _UFT,
- _UST = "",
- _UKE = {},
- _UDPD = UDE.Parent(),
- _UTH = UDE.GetSelectedHtml();
-
- while (!_UDPD.tagName) {
- _UDPD = $(_UDPD).Parent();
- }
-
- for (i in USE) {
- if (USE.hasOwnProperty(i)) {
- USE[i] = typeof USE[i] == "object" ? USE[i] : [USE[i], USE[i]];
- _UKE[i] = USE[i];
- }
- }
-
- if (_UTH) {
- _UST = UDE.SetStyle(_UTH, USE);
- USE = USE;
- }
- else {
- UDE.writeStyle(UDE.Parent(null, true), USE);
- }
- UDE.Replace(_UST, null, _UST ? null : true);
- return UDE;
- }
- U.D.E.codeDetect = (function () {
- var _UKE = { 3: "Enter", 8: "Backspace", 9: "Tab", 13: "Enter", 16: "Shift", 17: "Ctrl", 18: "Alt", 19: "Pause",
- 20: "CapsLock", 27: "Esc", 32: "Space", 33: "PageUp", 34: "PageDown", 35: "End", 36: "Home", 37: "Left",
- 38: "Up", 39: "Right", 40: "Down", 44: "PrintScrn", 45: "Insert", 46: "Delete", 48: "0", 49: "1", 50: "2", 51: "3", 52: "4", 53: "5", 54: "6", 55: "7", 56: "8", 57: "9", 59: ";", 65: "A", 66: "B", 67: "C", 68: "D", 69: "E", 70: "F", 71: "G", 72: "H", 73: "I", 74: "J", 75: "K", 76: "L", 77: "M", 78: "N", 79: "O", 80: "P", 81: "Q", 82: "R", 83: "S", 84: "T", 85: "U", 86: "V", 87: "W", 88: "X", 89: "Y", 90: "Z", 91: "Mod", 92: "Mod", 93: "Mod", 107: "=", 109: "-", 112: "F1", 113: "F2", 114: "F3", 115: "F4", 116: "F5", 117: "F6", 118: "F7", 119: "F8", 120: "F9", 121: "F10", 122: "F11", 123: "F12", 127: "Delete", 186: ";", 187: "=", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\"", 221: "]", 222: "'", 63232: "Up", 63233: "Down", 63234: "Left", 63235: "Right", 63236: "F1", 63237: "F2", 63238: "F3", 63239: "F4", 63240: "F5", 63241: "F6", 63242: "F7", 63243: "F8", 63244: "F9", 63245: "F10", 63246: "F11", 63247: "F12", 63272: "Delete", 63273: "Home", 63275: "End", 63276: "PageUp", 63277: "PageDown", 63302: "Insert"
- },
- _USE = { "alt": [[37, "goLineStart"], [38, "goDocStart"], [39, "goLineEnd"]], "ctrl": [[65, "selectAll"], [8, "delGroupBefore"], [67, "copy"], [86, "paste"], [68, "deleteLine"], [46, "delGroupAfter"], [40, "goDocEnd"], [63275, "goDocEnd"], [70, "find"], [71, "findNext"], [63273, "goDocStart"], [37, "goGroupLeft"], [39, "goGroupRight"], [83, "save"], [89, "redo"], [90, "undo"], [219, "indentLess"], [221, "indentMore"]], "shift-ctrl": [[70, "replace"], [71, "findPrev"], [82, "replaceAll"], [90, "redo"]] },
- _ = function (UDE) { return new _.init(UDE); };
- U.Ut.AddObj(_, _.prototype = {
- init: function (UDE) {
- UDE = UDE || {}; U.Ut.AddObj(this, UDE); (UDE.el) && (this.bind(UDE.el));
- },
- bind: function (UDOD) {
- $(UDOD).bind({ keydown: U.M.apply(this, this.down) });
- },
- down: function () {
- (this.cb) && (this.cb.call(this, this.getValue(), this.el));
- },
- getValue: function () {
- var i, j, _UGE, _UCE, e = event, k = e.keyCode;
- _UGE: for (i in _USE) {
- if (_USE.hasOwnProperty(i)) {
- _UCE = i.split("-"); for (j = 0; j < _UCE.length; j++) { if (!e[_UCE[j] + "Key"]) { continue _UGE; } } for (j = 0; j < _USE[i].length; j++) {
- if ((_UCE = _USE[i][j])[0] == k) {
- return _UCE[1];
- };
- }
- }
- }
- return [k, e.altKey, e.ctrlKey, e.shiftKey, _UKE[k] || ""];
- },
- set: function () {
- }
- });
- _.init.prototype = _; return _;
- })()
|