wsc.js 89 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456
  1. /*
  2. Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
  3. For licensing, see LICENSE.html or http://ckeditor.com/license
  4. */
  5. (function() {
  6. function A(a) {
  7. return a && a.domId && a.getInputElement().$
  8. ? a.getInputElement()
  9. : a && a.$
  10. ? a
  11. : !1;
  12. }
  13. function J(a) {
  14. if (!a)
  15. throw "Languages-by-groups list are required for construct selectbox";
  16. var d = [],
  17. c = "",
  18. e;
  19. for (e in a)
  20. for (var f in a[e]) {
  21. var h = a[e][f];
  22. "en_US" == h ? (c = h) : d.push(h);
  23. }
  24. d.sort();
  25. c && d.unshift(c);
  26. return {
  27. getCurrentLangGroup: function(d) {
  28. a: {
  29. for (var c in a)
  30. for (var e in a[c])
  31. if (e.toUpperCase() === d.toUpperCase()) {
  32. d = c;
  33. break a;
  34. }
  35. d = "";
  36. }
  37. return d;
  38. },
  39. setLangList: (function() {
  40. var d = {},
  41. c;
  42. for (c in a) for (var e in a[c]) d[a[c][e]] = e;
  43. return d;
  44. })()
  45. };
  46. }
  47. var g = (function() {
  48. var a = function(a, b, e) {
  49. e = e || {};
  50. var f = e.expires;
  51. if ("number" == typeof f && f) {
  52. var h = new Date();
  53. h.setTime(h.getTime() + 1e3 * f);
  54. f = e.expires = h;
  55. }
  56. f && f.toUTCString && (e.expires = f.toUTCString());
  57. b = encodeURIComponent(b);
  58. a = a + "\x3d" + b;
  59. for (var k in e)
  60. (b = e[k]), (a += "; " + k), !0 !== b && (a += "\x3d" + b);
  61. document.cookie = a;
  62. };
  63. return {
  64. postMessage: {
  65. init: function(a) {
  66. window.addEventListener
  67. ? window.addEventListener("message", a, !1)
  68. : window.attachEvent("onmessage", a);
  69. },
  70. send: function(a) {
  71. var b = Object.prototype.toString,
  72. e = a.fn || null,
  73. f = a.id || "",
  74. h = a.target || window,
  75. k = a.message || { id: f };
  76. a.message &&
  77. "[object Object]" == b.call(a.message) &&
  78. (a.message.id ? a.message.id : (a.message.id = f),
  79. (k = a.message));
  80. a = window.JSON.stringify(k, e);
  81. h.postMessage(a, "*");
  82. },
  83. unbindHandler: function(a) {
  84. window.removeEventListener
  85. ? window.removeEventListener("message", a, !1)
  86. : window.detachEvent("onmessage", a);
  87. }
  88. },
  89. hash: { create: function() {}, parse: function() {} },
  90. cookie: {
  91. set: a,
  92. get: function(a) {
  93. return (a = document.cookie.match(
  94. new RegExp(
  95. "(?:^|; )" +
  96. a.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, "\\$1") +
  97. "\x3d([^;]*)"
  98. )
  99. ))
  100. ? decodeURIComponent(a[1])
  101. : void 0;
  102. },
  103. remove: function(d) {
  104. a(d, "", { expires: -1 });
  105. }
  106. },
  107. misc: {
  108. findFocusable: function(a) {
  109. var b = null;
  110. a &&
  111. (b = a.find(
  112. "a[href], area[href], input, select, textarea, button, *[tabindex], *[contenteditable]"
  113. ));
  114. return b;
  115. },
  116. isVisible: function(a) {
  117. var b;
  118. (b = 0 === a.offsetWidth || 0 == a.offsetHeight) ||
  119. (b =
  120. "none" ===
  121. (document.defaultView && document.defaultView.getComputedStyle
  122. ? document.defaultView.getComputedStyle(a, null).display
  123. : a.currentStyle
  124. ? a.currentStyle.display
  125. : a.style.display));
  126. return !b;
  127. },
  128. hasClass: function(a, b) {
  129. return !(
  130. !a.className ||
  131. !a.className.match(new RegExp("(\\s|^)" + b + "(\\s|$)"))
  132. );
  133. }
  134. }
  135. };
  136. })(),
  137. a = a || {};
  138. a.TextAreaNumber = null;
  139. a.load = !0;
  140. a.cmd = { SpellTab: "spell", Thesaurus: "thes", GrammTab: "grammar" };
  141. a.dialog = null;
  142. a.optionNode = null;
  143. a.selectNode = null;
  144. a.grammerSuggest = null;
  145. a.textNode = {};
  146. a.iframeMain = null;
  147. a.dataTemp = "";
  148. a.div_overlay = null;
  149. a.textNodeInfo = {};
  150. a.selectNode = {};
  151. a.selectNodeResponce = {};
  152. a.langList = null;
  153. a.langSelectbox = null;
  154. a.banner = "";
  155. a.show_grammar = null;
  156. a.div_overlay_no_check = null;
  157. a.targetFromFrame = {};
  158. a.onLoadOverlay = null;
  159. a.LocalizationComing = {};
  160. a.OverlayPlace = null;
  161. a.sessionid = "";
  162. a.LocalizationButton = {
  163. ChangeTo_button: {
  164. instance: null,
  165. text: "Change to",
  166. localizationID: "ChangeTo"
  167. },
  168. ChangeAll: { instance: null, text: "Change All" },
  169. IgnoreWord: { instance: null, text: "Ignore word" },
  170. IgnoreAllWords: { instance: null, text: "Ignore all words" },
  171. Options: {
  172. instance: null,
  173. text: "Options",
  174. optionsDialog: { instance: null }
  175. },
  176. AddWord: { instance: null, text: "Add word" },
  177. FinishChecking_button: {
  178. instance: null,
  179. text: "Finish Checking",
  180. localizationID: "FinishChecking"
  181. },
  182. Option_button: {
  183. instance: null,
  184. text: "Options",
  185. localizationID: "Options"
  186. },
  187. FinishChecking_button_block: {
  188. instance: null,
  189. text: "Finish Checking",
  190. localizationID: "FinishChecking"
  191. }
  192. };
  193. a.LocalizationLabel = {
  194. ChangeTo_label: {
  195. instance: null,
  196. text: "Change to",
  197. localizationID: "ChangeTo"
  198. },
  199. Suggestions: { instance: null, text: "Suggestions" },
  200. Categories: { instance: null, text: "Categories" },
  201. Synonyms: { instance: null, text: "Synonyms" }
  202. };
  203. var K = function(b) {
  204. var d, c, e;
  205. for (e in b) {
  206. if ((d = a.dialog.getContentElement(a.dialog._.currentTabId, e)))
  207. d = d.getElement();
  208. else if (b[e].instance)
  209. d =
  210. b[e].instance.getElement().getFirst() || b[e].instance.getElement();
  211. else continue;
  212. c = b[e].localizationID || e;
  213. d.setText(a.LocalizationComing[c]);
  214. }
  215. },
  216. L = function(b) {
  217. var d, c, e;
  218. for (e in b)
  219. (d = a.dialog.getContentElement(a.dialog._.currentTabId, e)),
  220. d || (d = b[e].instance),
  221. d.setLabel &&
  222. ((c = b[e].localizationID || e),
  223. d.setLabel(a.LocalizationComing[c] + ":"));
  224. },
  225. t,
  226. B;
  227. a.framesetHtml = function(b) {
  228. return (
  229. "\x3ciframe id\x3d" +
  230. a.iframeNumber +
  231. "_" +
  232. b +
  233. ' frameborder\x3d"0" allowtransparency\x3d"1" style\x3d"width:100%;border: 1px solid #AEB3B9;overflow: auto;background:#fff; border-radius: 3px;"\x3e\x3c/iframe\x3e'
  234. );
  235. };
  236. a.setIframe = function(b, d) {
  237. var c;
  238. c = a.framesetHtml(d);
  239. var e = a.iframeNumber + "_" + d;
  240. b.getElement().setHtml(c);
  241. c = document.getElementById(e);
  242. c = c.contentWindow
  243. ? c.contentWindow
  244. : c.contentDocument.document
  245. ? c.contentDocument.document
  246. : c.contentDocument;
  247. c.document.open();
  248. c.document.write(
  249. '\x3c!DOCTYPE html\x3e\x3chtml\x3e\x3chead\x3e\x3cmeta charset\x3d"UTF-8"\x3e\x3ctitle\x3eiframe\x3c/title\x3e\x3cstyle\x3ehtml,body{margin: 0;height: 100%;font: 13px/1.555 "Trebuchet MS", sans-serif;}a{color: #888;font-weight: bold;text-decoration: none;border-bottom: 1px solid #888;}.main-box {color:#252525;padding: 3px 5px;text-align: justify;}.main-box p{margin: 0 0 14px;}.main-box .cerr{color: #f00000;border-bottom-color: #f00000;}\x3c/style\x3e\x3c/head\x3e\x3cbody\x3e\x3cdiv id\x3d"content" class\x3d"main-box"\x3e\x3c/div\x3e\x3ciframe src\x3d"" frameborder\x3d"0" id\x3d"spelltext" name\x3d"spelltext" style\x3d"display:none; width: 100%" \x3e\x3c/iframe\x3e\x3ciframe src\x3d"" frameborder\x3d"0" id\x3d"loadsuggestfirst" name\x3d"loadsuggestfirst" style\x3d"display:none; width: 100%" \x3e\x3c/iframe\x3e\x3ciframe src\x3d"" frameborder\x3d"0" id\x3d"loadspellsuggestall" name\x3d"loadspellsuggestall" style\x3d"display:none; width: 100%" \x3e\x3c/iframe\x3e\x3ciframe src\x3d"" frameborder\x3d"0" id\x3d"loadOptionsForm" name\x3d"loadOptionsForm" style\x3d"display:none; width: 100%" \x3e\x3c/iframe\x3e\x3cscript\x3e(function(window) {var ManagerPostMessage \x3d function() {var _init \x3d function(handler) {if (document.addEventListener) {window.addEventListener("message", handler, false);} else {window.attachEvent("onmessage", handler);};};var _sendCmd \x3d function(o) {var str,type \x3d Object.prototype.toString,fn \x3d o.fn || null,id \x3d o.id || "",target \x3d o.target || window,message \x3d o.message || { "id": id };if (o.message \x26\x26 type.call(o.message) \x3d\x3d "[object Object]") {(o.message["id"]) ? o.message["id"] : o.message["id"] \x3d id;message \x3d o.message;};str \x3d JSON.stringify(message, fn);target.postMessage(str, "*");};return {init: _init,send: _sendCmd};};var manageMessageTmp \x3d new ManagerPostMessage;var appString \x3d (function(){var spell \x3d parent.CKEDITOR.config.wsc.DefaultParams.scriptPath;var serverUrl \x3d parent.CKEDITOR.config.wsc.DefaultParams.serviceHost;return serverUrl + spell;})();function loadScript(src, callback) {var scriptTag \x3d document.createElement("script");scriptTag.type \x3d "text/javascript";callback ? callback : callback \x3d function() {};if(scriptTag.readyState) {scriptTag.onreadystatechange \x3d function() {if (scriptTag.readyState \x3d\x3d "loaded" ||scriptTag.readyState \x3d\x3d "complete") {scriptTag.onreadystatechange \x3d null;setTimeout(function(){scriptTag.parentNode.removeChild(scriptTag)},1);callback();}};}else{scriptTag.onload \x3d function() {setTimeout(function(){scriptTag.parentNode.removeChild(scriptTag)},1);callback();};};scriptTag.src \x3d src;document.getElementsByTagName("head")[0].appendChild(scriptTag);};window.onload \x3d function(){loadScript(appString, function(){manageMessageTmp.send({"id": "iframeOnload","target": window.parent});});}})(this);\x3c/script\x3e\x3c/body\x3e\x3c/html\x3e'
  250. );
  251. c.document.close();
  252. a.div_overlay.setEnable();
  253. };
  254. a.setCurrentIframe = function(b) {
  255. a.setIframe(a.dialog._.contents[b].Content, b);
  256. };
  257. a.setHeightBannerFrame = function() {
  258. var b = a.dialog.getContentElement("SpellTab", "banner").getElement(),
  259. d = a.dialog.getContentElement("GrammTab", "banner").getElement(),
  260. c = a.dialog.getContentElement("Thesaurus", "banner").getElement();
  261. b.setStyle("height", "90px");
  262. d.setStyle("height", "90px");
  263. c.setStyle("height", "90px");
  264. };
  265. a.setHeightFrame = function() {
  266. document.getElementById(
  267. a.iframeNumber + "_" + a.dialog._.currentTabId
  268. ).style.height = "240px";
  269. };
  270. a.sendData = function(b) {
  271. var d = b._.currentTabId,
  272. c = b._.contents[d].Content,
  273. e,
  274. f;
  275. a.previousTab = d;
  276. a.setIframe(c, d);
  277. var h = function(h) {
  278. d = b._.currentTabId;
  279. h = h || window.event;
  280. h.data.getTarget().is("a") &&
  281. d !== a.previousTab &&
  282. ((a.previousTab = d),
  283. (c = b._.contents[d].Content),
  284. (e = a.iframeNumber + "_" + d),
  285. a.div_overlay.setEnable(),
  286. c.getElement().getChildCount()
  287. ? F(a.targetFromFrame[e], a.cmd[d])
  288. : (a.setIframe(c, d),
  289. (f = document.getElementById(e)),
  290. (a.targetFromFrame[e] = f.contentWindow)));
  291. };
  292. b.parts.tabs.removeListener("click", h);
  293. b.parts.tabs.on("click", h);
  294. };
  295. a.buildSelectLang = function(a) {
  296. var d = new CKEDITOR.dom.element("div"),
  297. c = new CKEDITOR.dom.element("select");
  298. a = "wscLang" + a;
  299. d.addClass("cke_dialog_ui_input_select");
  300. d.setAttribute("role", "presentation");
  301. d.setStyles({
  302. height: "auto",
  303. position: "absolute",
  304. right: "0",
  305. top: "-1px",
  306. width: "160px",
  307. "white-space": "normal"
  308. });
  309. c.setAttribute("id", a);
  310. c.addClass("cke_dialog_ui_input_select");
  311. c.setStyles({ width: "160px" });
  312. d.append(c);
  313. return d;
  314. };
  315. a.buildOptionLang = function(b, d) {
  316. var c = document.getElementById("wscLang" + d),
  317. e = document.createDocumentFragment(),
  318. f,
  319. h,
  320. k = [];
  321. if (0 === c.options.length) {
  322. for (f in b) k.push([f, b[f]]);
  323. k.sort();
  324. for (var l = 0; l < k.length; l++)
  325. (f = document.createElement("option")),
  326. f.setAttribute("value", k[l][1]),
  327. (h = document.createTextNode(k[l][0])),
  328. f.appendChild(h),
  329. e.appendChild(f);
  330. c.appendChild(e);
  331. }
  332. for (e = 0; e < c.options.length; e++)
  333. c.options[e].value == a.selectingLang &&
  334. (c.options[e].selected = "selected");
  335. };
  336. a.buildOptionSynonyms = function(b) {
  337. b = a.selectNodeResponce[b];
  338. var d = A(a.selectNode.Synonyms);
  339. a.selectNode.Synonyms.clear();
  340. for (var c = 0; c < b.length; c++) {
  341. var e = document.createElement("option");
  342. e.text = b[c];
  343. e.value = b[c];
  344. d.$.add(e, c);
  345. }
  346. a.selectNode.Synonyms.getInputElement().$.firstChild.selected = !0;
  347. a.textNode.Thesaurus.setValue(
  348. a.selectNode.Synonyms.getInputElement().getValue()
  349. );
  350. };
  351. var C = function(a) {
  352. var d = document,
  353. c = a.target || d.body,
  354. e = a.id || "overlayBlock",
  355. f = a.opacity || "0.9";
  356. a = a.background || "#f1f1f1";
  357. var h = d.getElementById(e),
  358. k = h || d.createElement("div");
  359. k.style.cssText =
  360. "position: absolute;top:30px;bottom:41px;left:1px;right:1px;z-index: 10020;padding:0;margin:0;background:" +
  361. a +
  362. ";opacity: " +
  363. f +
  364. ";filter: alpha(opacity\x3d" +
  365. 100 * f +
  366. ");display: none;";
  367. k.id = e;
  368. h || c.appendChild(k);
  369. return {
  370. setDisable: function() {
  371. k.style.display = "none";
  372. },
  373. setEnable: function() {
  374. k.style.display = "block";
  375. }
  376. };
  377. },
  378. M = function(b, d, c) {
  379. var e = new CKEDITOR.dom.element("div"),
  380. f = new CKEDITOR.dom.element("input"),
  381. h = new CKEDITOR.dom.element("label"),
  382. k = "wscGrammerSuggest" + b + "_" + d;
  383. e.addClass("cke_dialog_ui_input_radio");
  384. e.setAttribute("role", "presentation");
  385. e.setStyles({ width: "97%", padding: "5px", "white-space": "normal" });
  386. f.setAttributes({
  387. type: "radio",
  388. value: d,
  389. name: "wscGrammerSuggest",
  390. id: k
  391. });
  392. f.setStyles({ float: "left" });
  393. f.on("click", function(b) {
  394. a.textNode.GrammTab.setValue(b.sender.getValue());
  395. });
  396. c ? f.setAttribute("checked", !0) : !1;
  397. f.addClass("cke_dialog_ui_radio_input");
  398. h.appendText(b);
  399. h.setAttribute("for", k);
  400. h.setStyles({
  401. display: "block",
  402. "line-height": "16px",
  403. "margin-left": "18px",
  404. "white-space": "normal"
  405. });
  406. e.append(f);
  407. e.append(h);
  408. return e;
  409. },
  410. G = function(a) {
  411. a = a || "true";
  412. null !== a && "false" == a && u();
  413. },
  414. w = function(b) {
  415. var d = new J(b);
  416. b = "wscLang" + a.dialog.getParentEditor().name;
  417. b = document.getElementById(b);
  418. var c,
  419. e = a.iframeNumber + "_" + a.dialog._.currentTabId;
  420. a.buildOptionLang(d.setLangList, a.dialog.getParentEditor().name);
  421. if ((c = d.getCurrentLangGroup(a.selectingLang))) v[c].onShow();
  422. G(a.show_grammar);
  423. b.onchange = function(b) {
  424. b = d.getCurrentLangGroup(this.value);
  425. var c = a.dialog._.currentTabId;
  426. v[b].onShow();
  427. G(a.show_grammar);
  428. a.div_overlay.setEnable();
  429. a.selectingLang = this.value;
  430. c = a.cmd[c];
  431. (b && v[b] && v[b].allowedTabCommands[c]) ||
  432. (c = v[b].defaultTabCommand);
  433. for (var k in a.cmd)
  434. if (a.cmd[k] == c) {
  435. a.previousTab = k;
  436. break;
  437. }
  438. g.postMessage.send({
  439. message: {
  440. changeLang: a.selectingLang,
  441. interfaceLang: a.interfaceLang,
  442. text: a.dataTemp,
  443. cmd: c
  444. },
  445. target: a.targetFromFrame[e],
  446. id: "selectionLang_outer__page"
  447. });
  448. };
  449. },
  450. N = function(b) {
  451. var d,
  452. c = function(b) {
  453. b =
  454. a.dialog.getContentElement(a.dialog._.currentTabId, b) ||
  455. a.LocalizationButton[b].instance;
  456. b.getElement().hasClass("cke_disabled")
  457. ? b.getElement().setStyle("color", "#a0a0a0")
  458. : b.disable();
  459. };
  460. d = function(b) {
  461. b =
  462. a.dialog.getContentElement(a.dialog._.currentTabId, b) ||
  463. a.LocalizationButton[b].instance;
  464. b.enable();
  465. b.getElement().setStyle("color", "#333");
  466. };
  467. "no_any_suggestions" == b
  468. ? ((b = "No suggestions"),
  469. (d =
  470. a.dialog.getContentElement(
  471. a.dialog._.currentTabId,
  472. "ChangeTo_button"
  473. ) || a.LocalizationButton.ChangeTo_button.instance),
  474. d.disable(),
  475. (d =
  476. a.dialog.getContentElement(a.dialog._.currentTabId, "ChangeAll") ||
  477. a.LocalizationButton.ChangeAll.instance),
  478. d.disable(),
  479. c("ChangeTo_button"),
  480. c("ChangeAll"))
  481. : (d("ChangeTo_button"), d("ChangeAll"));
  482. return b;
  483. },
  484. P = {
  485. iframeOnload: function(b) {
  486. b = a.dialog._.currentTabId;
  487. F(a.targetFromFrame[a.iframeNumber + "_" + b], a.cmd[b]);
  488. },
  489. suggestlist: function(b) {
  490. delete b.id;
  491. a.div_overlay_no_check.setDisable();
  492. D();
  493. w(a.langList);
  494. var d = N(b.word),
  495. c = "";
  496. d instanceof Array && (d = b.word[0]);
  497. c = d = d.split(",");
  498. a.textNode.SpellTab.setValue(c[0]);
  499. b = A(B);
  500. B.clear();
  501. for (d = 0; d < c.length; d++) {
  502. var e = document.createElement("option");
  503. e.text = c[d];
  504. e.value = c[d];
  505. b.$.add(e, d);
  506. }
  507. p();
  508. a.div_overlay.setDisable();
  509. },
  510. grammerSuggest: function(b) {
  511. delete b.id;
  512. delete b.mocklangs;
  513. D();
  514. w(a.langList);
  515. var d = b.grammSuggest[0];
  516. a.grammerSuggest.getElement().setHtml("");
  517. a.textNode.GrammTab.reset();
  518. a.textNode.GrammTab.setValue(d);
  519. a.textNodeInfo.GrammTab.getElement().setHtml("");
  520. a.textNodeInfo.GrammTab.getElement().setText(b.info);
  521. b = b.grammSuggest;
  522. for (var d = b.length, c = !0, e = 0; e < d; e++)
  523. a.grammerSuggest.getElement().append(M(b[e], b[e], c)), (c = !1);
  524. p();
  525. a.div_overlay.setDisable();
  526. },
  527. thesaurusSuggest: function(b) {
  528. delete b.id;
  529. delete b.mocklangs;
  530. D();
  531. w(a.langList);
  532. a.selectNodeResponce = b;
  533. a.textNode.Thesaurus.reset();
  534. var d = A(a.selectNode.Categories),
  535. c = 0;
  536. a.selectNode.Categories.clear();
  537. for (var e in b)
  538. (b = document.createElement("option")),
  539. (b.text = e),
  540. (b.value = e),
  541. d.$.add(b, c),
  542. c++;
  543. d = a.selectNode.Categories.getInputElement().getChildren().$[0].value;
  544. a.selectNode.Categories.getInputElement().getChildren().$[0].selected = !0;
  545. a.buildOptionSynonyms(d);
  546. p();
  547. a.div_overlay.setDisable();
  548. },
  549. finish: function(b) {
  550. delete b.id;
  551. O();
  552. b = a.dialog
  553. .getContentElement(a.dialog._.currentTabId, "BlockFinishChecking")
  554. .getElement();
  555. b.removeStyle("display");
  556. b.removeStyle("position");
  557. b.removeStyle("left");
  558. b.show();
  559. a.div_overlay.setDisable();
  560. },
  561. settext: function(b) {
  562. function d() {
  563. try {
  564. c.focus();
  565. } catch (d) {}
  566. c.setData(b.text, function() {
  567. a.dataTemp = "";
  568. c.unlockSelection();
  569. c.fire("saveSnapshot");
  570. a.dialog.hide();
  571. });
  572. }
  573. delete b.id;
  574. a.dialog.getParentEditor().getCommand("checkspell");
  575. var c = a.dialog.getParentEditor(),
  576. e = CKEDITOR.plugins.scayt,
  577. f = c.scayt;
  578. if (e && c.wsc) {
  579. var h = c.wsc.udn,
  580. k = c.wsc.ud,
  581. l,
  582. g;
  583. if (f) {
  584. var x = function() {
  585. if (k)
  586. for (l = k.split(","), g = 0; g < l.length; g += 1)
  587. f.addWordToUserDictionary(l[g]);
  588. else c.wsc.DataStorage.setData("scayt_user_dictionary", []);
  589. d();
  590. };
  591. e.state.scayt[c.name] && f.setMarkupPaused(!1);
  592. h
  593. ? (c.wsc.DataStorage.setData("scayt_user_dictionary_name", h),
  594. f.restoreUserDictionary(h, x, x))
  595. : (c.wsc.DataStorage.setData("scayt_user_dictionary_name", ""),
  596. f.removeUserDictionary(void 0, x, x));
  597. } else
  598. h
  599. ? c.wsc.DataStorage.setData("scayt_user_dictionary_name", h)
  600. : c.wsc.DataStorage.setData("scayt_user_dictionary_name", ""),
  601. k &&
  602. ((l = k.split(",")),
  603. c.wsc.DataStorage.setData("scayt_user_dictionary", l)),
  604. d();
  605. } else d();
  606. },
  607. ReplaceText: function(b) {
  608. delete b.id;
  609. a.div_overlay.setEnable();
  610. a.dataTemp = b.text;
  611. a.selectingLang = b.currentLang;
  612. (b.cmd = "0" !== b.len && b.len)
  613. ? a.div_overlay.setDisable()
  614. : window.setTimeout(function() {
  615. try {
  616. a.div_overlay.setDisable();
  617. } catch (b) {}
  618. }, 500);
  619. K(a.LocalizationButton);
  620. L(a.LocalizationLabel);
  621. },
  622. options_checkbox_send: function(b) {
  623. delete b.id;
  624. b = {
  625. osp: g.cookie.get("osp"),
  626. udn: g.cookie.get("udn"),
  627. cust_dic_ids: a.cust_dic_ids
  628. };
  629. g.postMessage.send({
  630. message: b,
  631. target:
  632. a.targetFromFrame[a.iframeNumber + "_" + a.dialog._.currentTabId],
  633. id: "options_outer__page"
  634. });
  635. },
  636. getOptions: function(b) {
  637. var d = b.DefOptions.udn;
  638. a.LocalizationComing = b.DefOptions.localizationButtonsAndText;
  639. a.show_grammar = b.show_grammar;
  640. a.langList = b.lang;
  641. a.bnr = b.bannerId;
  642. a.sessionid = b.sessionid;
  643. if (b.bannerId) {
  644. a.setHeightBannerFrame();
  645. var c = b.banner;
  646. a.dialog
  647. .getContentElement(a.dialog._.currentTabId, "banner")
  648. .getElement()
  649. .setHtml(c);
  650. } else a.setHeightFrame();
  651. "undefined" == d &&
  652. (a.userDictionaryName
  653. ? ((d = a.userDictionaryName),
  654. (c = {
  655. osp: g.cookie.get("osp"),
  656. udn: a.userDictionaryName,
  657. cust_dic_ids: a.cust_dic_ids,
  658. id: "options_dic_send",
  659. udnCmd: "create"
  660. }),
  661. g.postMessage.send({
  662. message: c,
  663. target: a.targetFromFrame[void 0]
  664. }))
  665. : (d = ""));
  666. g.cookie.set("osp", b.DefOptions.osp);
  667. g.cookie.set("udn", d);
  668. g.cookie.set("cust_dic_ids", b.DefOptions.cust_dic_ids);
  669. g.postMessage.send({ id: "giveOptions" });
  670. },
  671. options_dic_send: function(b) {
  672. b = {
  673. osp: g.cookie.get("osp"),
  674. udn: g.cookie.get("udn"),
  675. cust_dic_ids: a.cust_dic_ids,
  676. id: "options_dic_send",
  677. udnCmd: g.cookie.get("udnCmd")
  678. };
  679. g.postMessage.send({
  680. message: b,
  681. target:
  682. a.targetFromFrame[a.iframeNumber + "_" + a.dialog._.currentTabId]
  683. });
  684. },
  685. data: function(a) {
  686. delete a.id;
  687. },
  688. giveOptions: function() {},
  689. setOptionsConfirmF: function() {},
  690. setOptionsConfirmT: function() {
  691. t.setValue("");
  692. },
  693. clickBusy: function() {
  694. a.div_overlay.setEnable();
  695. },
  696. suggestAllCame: function() {
  697. a.div_overlay.setDisable();
  698. a.div_overlay_no_check.setDisable();
  699. },
  700. TextCorrect: function() {
  701. w(a.langList);
  702. }
  703. },
  704. H = function(a) {
  705. a = a || window.event;
  706. var d;
  707. try {
  708. d = window.JSON.parse(a.data);
  709. } catch (c) {}
  710. if (d && d.id) P[d.id](d);
  711. },
  712. F = function(b, d, c, e) {
  713. d = d || CKEDITOR.config.wsc_cmd;
  714. c = c || a.dataTemp;
  715. g.postMessage.send({
  716. message: {
  717. customerId: a.wsc_customerId,
  718. text: c,
  719. txt_ctrl: a.TextAreaNumber,
  720. cmd: d,
  721. cust_dic_ids: a.cust_dic_ids,
  722. udn: a.userDictionaryName,
  723. slang: a.selectingLang,
  724. interfaceLang: a.interfaceLang,
  725. reset_suggest: e || !1,
  726. sessionid: a.sessionid
  727. },
  728. target: b,
  729. id: "data_outer__page"
  730. });
  731. a.div_overlay.setEnable();
  732. },
  733. v = {
  734. superset: {
  735. onShow: function() {
  736. a.dialog.showPage("Thesaurus");
  737. a.dialog.showPage("GrammTab");
  738. q();
  739. },
  740. allowedTabCommands: { spell: !0, grammar: !0, thes: !0 },
  741. defaultTabCommand: "spell"
  742. },
  743. usual: {
  744. onShow: function() {
  745. y();
  746. u();
  747. q();
  748. },
  749. allowedTabCommands: { spell: !0 },
  750. defaultTabCommand: "spell"
  751. },
  752. rtl: {
  753. onShow: function() {
  754. y();
  755. u();
  756. q();
  757. },
  758. allowedTabCommands: { spell: !0 },
  759. defaultTabCommand: "spell"
  760. },
  761. spellgrammar: {
  762. onShow: function() {
  763. y();
  764. a.dialog.showPage("GrammTab");
  765. q();
  766. },
  767. allowedTabCommands: { spell: !0, grammar: !0 },
  768. defaultTabCommand: "spell"
  769. },
  770. spellthes: {
  771. onShow: function() {
  772. a.dialog.showPage("Thesaurus");
  773. u();
  774. q();
  775. },
  776. allowedTabCommands: { spell: !0, thes: !0 },
  777. defaultTabCommand: "spell"
  778. }
  779. },
  780. I = function(b) {
  781. var d = new function(a) {
  782. var b = {};
  783. return {
  784. getCmdByTab: function(d) {
  785. for (var h in a) b[a[h]] = h;
  786. return b[d];
  787. }
  788. };
  789. }(a.cmd).getCmdByTab(CKEDITOR.config.wsc_cmd);
  790. p();
  791. b.selectPage(d);
  792. a.sendData(b);
  793. },
  794. y = function() {
  795. a.dialog.hidePage("Thesaurus");
  796. },
  797. u = function() {
  798. a.dialog.hidePage("GrammTab");
  799. },
  800. q = function() {
  801. a.dialog.showPage("SpellTab");
  802. },
  803. p = function() {
  804. var b = a.dialog
  805. .getContentElement(a.dialog._.currentTabId, "bottomGroup")
  806. .getElement();
  807. b.removeStyle("display");
  808. b.removeStyle("position");
  809. b.removeStyle("left");
  810. b.show();
  811. },
  812. O = function() {
  813. var b = a.dialog
  814. .getContentElement(a.dialog._.currentTabId, "bottomGroup")
  815. .getElement(),
  816. d = document.activeElement,
  817. c;
  818. b.setStyles({ display: "block", position: "absolute", left: "-9999px" });
  819. setTimeout(function() {
  820. b.removeStyle("display");
  821. b.removeStyle("position");
  822. b.removeStyle("left");
  823. b.hide();
  824. a.dialog._.editor.focusManager.currentActive.focusNext();
  825. c = g.misc.findFocusable(a.dialog.parts.contents);
  826. if (
  827. g.misc.hasClass(d, "cke_dialog_tab") ||
  828. g.misc.hasClass(d, "cke_dialog_contents_body") ||
  829. !g.misc.isVisible(d)
  830. )
  831. for (var e = 0, f; e < c.count(); e++) {
  832. if (((f = c.getItem(e)), g.misc.isVisible(f.$))) {
  833. try {
  834. f.$.focus();
  835. } catch (h) {}
  836. break;
  837. }
  838. }
  839. else
  840. try {
  841. d.focus();
  842. } catch (k) {}
  843. }, 0);
  844. },
  845. D = function() {
  846. var b = a.dialog
  847. .getContentElement(a.dialog._.currentTabId, "BlockFinishChecking")
  848. .getElement(),
  849. d = document.activeElement,
  850. c;
  851. b.setStyles({ display: "block", position: "absolute", left: "-9999px" });
  852. setTimeout(function() {
  853. b.removeStyle("display");
  854. b.removeStyle("position");
  855. b.removeStyle("left");
  856. b.hide();
  857. a.dialog._.editor.focusManager.currentActive.focusNext();
  858. c = g.misc.findFocusable(a.dialog.parts.contents);
  859. if (
  860. g.misc.hasClass(d, "cke_dialog_tab") ||
  861. g.misc.hasClass(d, "cke_dialog_contents_body") ||
  862. !g.misc.isVisible(d)
  863. )
  864. for (var e = 0, f; e < c.count(); e++) {
  865. if (((f = c.getItem(e)), g.misc.isVisible(f.$))) {
  866. try {
  867. f.$.focus();
  868. } catch (h) {}
  869. break;
  870. }
  871. }
  872. else
  873. try {
  874. d.focus();
  875. } catch (k) {}
  876. }, 0);
  877. };
  878. CKEDITOR.dialog.add("checkspell", function(b) {
  879. function d(a) {
  880. var c = parseInt(b.config.wsc_left, 10),
  881. d = parseInt(b.config.wsc_top, 10),
  882. e = parseInt(b.config.wsc_width, 10),
  883. g = parseInt(b.config.wsc_height, 10),
  884. m = CKEDITOR.document.getWindow().getViewPaneSize();
  885. a.getPosition();
  886. var n = a.getSize(),
  887. r = 0;
  888. if (!a._.resized) {
  889. var r =
  890. n.height -
  891. a.parts.contents.getSize(
  892. "height",
  893. !(
  894. CKEDITOR.env.gecko ||
  895. CKEDITOR.env.opera ||
  896. (CKEDITOR.env.ie && CKEDITOR.env.quirks)
  897. )
  898. ),
  899. E = n.width - a.parts.contents.getSize("width", 1);
  900. if (e < f.minWidth || isNaN(e)) e = f.minWidth;
  901. e > m.width - E && (e = m.width - E);
  902. if (g < f.minHeight || isNaN(g)) g = f.minHeight;
  903. g > m.height - r && (g = m.height - r);
  904. n.width = e + E;
  905. n.height = g + r;
  906. a._.fromResizeEvent = !1;
  907. a.resize(e, g);
  908. setTimeout(function() {
  909. a._.fromResizeEvent = !1;
  910. CKEDITOR.dialog.fire("resize", { dialog: a, width: e, height: g }, b);
  911. }, 300);
  912. }
  913. a._.moved ||
  914. ((r = isNaN(c) && isNaN(d) ? 0 : 1),
  915. isNaN(c) && (c = (m.width - n.width) / 2),
  916. 0 > c && (c = 0),
  917. c > m.width - n.width && (c = m.width - n.width),
  918. isNaN(d) && (d = (m.height - n.height) / 2),
  919. 0 > d && (d = 0),
  920. d > m.height - n.height && (d = m.height - n.height),
  921. a.move(c, d, r));
  922. }
  923. function c() {
  924. b.wsc = {};
  925. (function(a) {
  926. var b = {
  927. separator: "\x3c$\x3e",
  928. getDataType: function(a) {
  929. return "undefined" === typeof a
  930. ? "undefined"
  931. : null === a
  932. ? "null"
  933. : Object.prototype.toString.call(a).slice(8, -1);
  934. },
  935. convertDataToString: function(a) {
  936. return this.getDataType(a).toLowerCase() + this.separator + a;
  937. },
  938. restoreDataFromString: function(a) {
  939. var b = a,
  940. c;
  941. a = this.backCompatibility(a);
  942. if ("string" === typeof a)
  943. switch (
  944. ((b = a.indexOf(this.separator)),
  945. (c = a.substring(0, b)),
  946. (b = a.substring(b + this.separator.length)),
  947. c)
  948. ) {
  949. case "boolean":
  950. b = "true" === b;
  951. break;
  952. case "number":
  953. b = parseFloat(b);
  954. break;
  955. case "array":
  956. b = "" === b ? [] : b.split(",");
  957. break;
  958. case "null":
  959. b = null;
  960. break;
  961. case "undefined":
  962. b = void 0;
  963. }
  964. return b;
  965. },
  966. backCompatibility: function(a) {
  967. var b = a,
  968. c;
  969. "string" === typeof a &&
  970. ((c = a.indexOf(this.separator)),
  971. 0 > c &&
  972. ((b = parseFloat(a)),
  973. isNaN(b) &&
  974. ("[" === a[0] && "]" === a[a.length - 1]
  975. ? ((a = a.replace("[", "")),
  976. (a = a.replace("]", "")),
  977. (b = "" === a ? [] : a.split(",")))
  978. : (b = "true" === a || "false" === a ? "true" === a : a)),
  979. (b = this.convertDataToString(b))));
  980. return b;
  981. }
  982. },
  983. c = {
  984. get: function(a) {
  985. return b.restoreDataFromString(window.localStorage.getItem(a));
  986. },
  987. set: function(a, c) {
  988. var d = b.convertDataToString(c);
  989. window.localStorage.setItem(a, d);
  990. },
  991. del: function(a) {
  992. window.localStorage.removeItem(a);
  993. },
  994. clear: function() {
  995. window.localStorage.clear();
  996. }
  997. },
  998. d = {
  999. expiration: 31622400,
  1000. get: function(a) {
  1001. return b.restoreDataFromString(this.getCookie(a));
  1002. },
  1003. set: function(a, c) {
  1004. var d = b.convertDataToString(c);
  1005. this.setCookie(a, d, { expires: this.expiration });
  1006. },
  1007. del: function(a) {
  1008. this.deleteCookie(a);
  1009. },
  1010. getCookie: function(a) {
  1011. return (a = document.cookie.match(
  1012. new RegExp(
  1013. "(?:^|; )" +
  1014. a.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, "\\$1") +
  1015. "\x3d([^;]*)"
  1016. )
  1017. ))
  1018. ? decodeURIComponent(a[1])
  1019. : void 0;
  1020. },
  1021. setCookie: function(a, b, c) {
  1022. c = c || {};
  1023. var d = c.expires;
  1024. if ("number" === typeof d && d) {
  1025. var e = new Date();
  1026. e.setTime(e.getTime() + 1e3 * d);
  1027. d = c.expires = e;
  1028. }
  1029. d && d.toUTCString && (c.expires = d.toUTCString());
  1030. b = encodeURIComponent(b);
  1031. a = a + "\x3d" + b;
  1032. for (var h in c)
  1033. (b = c[h]), (a += "; " + h), !0 !== b && (a += "\x3d" + b);
  1034. document.cookie = a;
  1035. },
  1036. deleteCookie: function(a) {
  1037. this.setCookie(a, null, { expires: -1 });
  1038. },
  1039. clear: function() {
  1040. for (
  1041. var a = document.cookie.split(";"), b = 0;
  1042. b < a.length;
  1043. b++
  1044. ) {
  1045. var c = a[b],
  1046. d = c.indexOf("\x3d"),
  1047. c = -1 < d ? c.substr(0, d) : c;
  1048. this.deleteCookie(c);
  1049. }
  1050. }
  1051. },
  1052. e = window.localStorage ? c : d;
  1053. a.DataStorage = {
  1054. getData: function(a) {
  1055. return e.get(a);
  1056. },
  1057. setData: function(a, b) {
  1058. e.set(a, b);
  1059. },
  1060. deleteData: function(a) {
  1061. e.del(a);
  1062. },
  1063. clear: function() {
  1064. e.clear();
  1065. }
  1066. };
  1067. })(b.wsc);
  1068. b.wsc.operationWithUDN = function(b, c) {
  1069. g.postMessage.send({
  1070. message: { udn: c, id: "operationWithUDN", udnCmd: b },
  1071. target:
  1072. a.targetFromFrame[a.iframeNumber + "_" + a.dialog._.currentTabId]
  1073. });
  1074. };
  1075. b.wsc.getLocalStorageUDN = function() {
  1076. var a = b.wsc.DataStorage.getData("scayt_user_dictionary_name");
  1077. if (a) return a;
  1078. };
  1079. b.wsc.getLocalStorageUD = function() {
  1080. var a = b.wsc.DataStorage.getData("scayt_user_dictionary");
  1081. if (a) return a;
  1082. };
  1083. b.wsc.addWords = function(a, c) {
  1084. var d =
  1085. b.config.wsc.DefaultParams.serviceHost +
  1086. b.config.wsc.DefaultParams.ssrvHost +
  1087. "?cmd\x3ddictionary\x26format\x3djson\x26customerid\x3d1%3AncttD3-fIoSf2-huzwE4-Y5muI2-mD0Tt-kG9Wz-UEDFC-tYu243-1Uq474-d9Z2l3\x26action\x3daddword\x26word\x3d" +
  1088. a +
  1089. "\x26callback\x3dtoString\x26synchronization\x3dtrue",
  1090. e = document.createElement("script");
  1091. e.type = "text/javascript";
  1092. e.src = d;
  1093. document.getElementsByTagName("head")[0].appendChild(e);
  1094. e.onload = c;
  1095. e.onreadystatechange = function() {
  1096. "loaded" === this.readyState && c();
  1097. };
  1098. };
  1099. b.wsc.cgiOrigin = function() {
  1100. var a = b.config.wsc.DefaultParams.serviceHost.split("/");
  1101. return a[0] + "//" + a[2];
  1102. };
  1103. b.wsc.isSsrvSame = !1;
  1104. }
  1105. var e = function(c) {
  1106. this.getElement().focus();
  1107. a.div_overlay.setEnable();
  1108. c = a.dialog._.currentTabId;
  1109. var d = a.iframeNumber + "_" + c,
  1110. e = a.textNode[c].getValue(),
  1111. f = this.getElement().getAttribute("title-cmd");
  1112. g.postMessage.send({
  1113. message: { cmd: f, tabId: c, new_word: e },
  1114. target: a.targetFromFrame[d],
  1115. id: "cmd_outer__page"
  1116. });
  1117. ("ChangeTo" != f && "ChangeAll" != f) || b.fire("saveSnapshot");
  1118. "FinishChecking" == f &&
  1119. b.config.wsc_onFinish.call(CKEDITOR.document.getWindow().getFrame());
  1120. },
  1121. f = { minWidth: 560, minHeight: 444 };
  1122. return {
  1123. title: b.config.wsc_dialogTitle || b.lang.wsc.title,
  1124. minWidth: f.minWidth,
  1125. minHeight: f.minHeight,
  1126. buttons: [CKEDITOR.dialog.cancelButton],
  1127. onLoad: function() {
  1128. a.dialog = this;
  1129. y();
  1130. u();
  1131. q();
  1132. b.plugins.scayt && c();
  1133. },
  1134. onShow: function() {
  1135. a.dialog = this;
  1136. b.lockSelection(b.getSelection());
  1137. a.TextAreaNumber = "cke_textarea_" + b.name;
  1138. g.postMessage.init(H);
  1139. a.dataTemp = b.getData();
  1140. a.OverlayPlace = a.dialog.parts.tabs.getParent().$;
  1141. if (CKEDITOR && CKEDITOR.config) {
  1142. a.wsc_customerId = b.config.wsc_customerId;
  1143. a.cust_dic_ids = b.config.wsc_customDictionaryIds;
  1144. a.userDictionaryName = b.config.wsc_userDictionaryName;
  1145. a.defaultLanguage = CKEDITOR.config.defaultLanguage;
  1146. var c =
  1147. "file:" == document.location.protocol
  1148. ? "http:"
  1149. : document.location.protocol,
  1150. c =
  1151. b.config.wsc_customLoaderScript ||
  1152. c +
  1153. "//www.webspellchecker.net/spellcheck31/lf/22/js/wsc_fck2plugin.js";
  1154. d(this);
  1155. CKEDITOR.scriptLoader.load(c, function(c) {
  1156. CKEDITOR.config &&
  1157. CKEDITOR.config.wsc &&
  1158. CKEDITOR.config.wsc.DefaultParams
  1159. ? ((a.serverLocationHash =
  1160. CKEDITOR.config.wsc.DefaultParams.serviceHost),
  1161. (a.logotype = CKEDITOR.config.wsc.DefaultParams.logoPath),
  1162. (a.loadIcon = CKEDITOR.config.wsc.DefaultParams.iconPath),
  1163. (a.loadIconEmptyEditor =
  1164. CKEDITOR.config.wsc.DefaultParams.iconPathEmptyEditor),
  1165. (a.LangComparer = new CKEDITOR.config.wsc.DefaultParams._SP_FCK_LangCompare()))
  1166. : ((a.serverLocationHash = DefaultParams.serviceHost),
  1167. (a.logotype = DefaultParams.logoPath),
  1168. (a.loadIcon = DefaultParams.iconPath),
  1169. (a.loadIconEmptyEditor = DefaultParams.iconPathEmptyEditor),
  1170. (a.LangComparer = new _SP_FCK_LangCompare()));
  1171. a.pluginPath = CKEDITOR.getUrl(b.plugins.wsc.path);
  1172. a.iframeNumber = a.TextAreaNumber;
  1173. a.templatePath = a.pluginPath + "dialogs/tmp.html";
  1174. a.LangComparer.setDefaulLangCode(a.defaultLanguage);
  1175. a.currentLang =
  1176. b.config.wsc_lang ||
  1177. a.LangComparer.getSPLangCode(b.langCode) ||
  1178. "en_US";
  1179. a.interfaceLang = b.config.wsc_interfaceLang;
  1180. a.selectingLang = a.currentLang;
  1181. a.div_overlay = new C({
  1182. opacity: "1",
  1183. background: "#fff url(" + a.loadIcon + ") no-repeat 50% 50%",
  1184. target: a.OverlayPlace
  1185. });
  1186. var d = a.dialog.parts.tabs.getId(),
  1187. d = CKEDITOR.document.getById(d);
  1188. d.setStyle("width", "97%");
  1189. d.getElementsByTag("DIV").count() ||
  1190. d.append(a.buildSelectLang(a.dialog.getParentEditor().name));
  1191. a.div_overlay_no_check = new C({
  1192. opacity: "1",
  1193. id: "no_check_over",
  1194. background:
  1195. "#fff url(" + a.loadIconEmptyEditor + ") no-repeat 50% 50%",
  1196. target: a.OverlayPlace
  1197. });
  1198. c && (I(a.dialog), a.dialog.setupContent(a.dialog));
  1199. b.plugins.scayt &&
  1200. (b.wsc.isSsrvSame = (function() {
  1201. var a = CKEDITOR.config.wsc.DefaultParams.serviceHost
  1202. .replace("lf/22/js/../../../", "")
  1203. .split("//")[1],
  1204. c = CKEDITOR.config.wsc.DefaultParams.ssrvHost,
  1205. d = b.config.scayt_srcUrl,
  1206. e,
  1207. f,
  1208. h,
  1209. g,
  1210. l;
  1211. window.SCAYT &&
  1212. window.SCAYT.CKSCAYT &&
  1213. ((h = SCAYT.CKSCAYT.prototype.basePath),
  1214. h.split("//"),
  1215. (g = h.split("//")[1].split("/")[0]),
  1216. (l =
  1217. h.split(g + "/")[1].replace("/lf/scayt3/ckscayt/", "") +
  1218. "/script/ssrv.cgi"));
  1219. !d ||
  1220. h ||
  1221. b.config.scayt_servicePath ||
  1222. (d.split("//"),
  1223. (e = d.split("//")[1].split("/")[0]),
  1224. (f =
  1225. d
  1226. .split(e + "/")[1]
  1227. .replace("/lf/scayt3/ckscayt/ckscayt.js", "") +
  1228. "/script/ssrv.cgi"));
  1229. return (
  1230. "//" + a + c ===
  1231. "//" +
  1232. (b.config.scayt_serviceHost || g || e) +
  1233. "/" +
  1234. (b.config.scayt_servicePath || l || f)
  1235. );
  1236. })());
  1237. if (window.SCAYT && b.wsc) {
  1238. var e = b.wsc.cgiOrigin();
  1239. b.wsc.syncIsDone = !1;
  1240. c = function(a) {
  1241. a.origin === e &&
  1242. ((a = JSON.parse(a.data)),
  1243. a.ud && "undefined" !== a.ud
  1244. ? (b.wsc.ud = a.ud)
  1245. : "undefined" === a.ud && (b.wsc.ud = void 0),
  1246. a.udn && "undefined" !== a.udn
  1247. ? (b.wsc.udn = a.udn)
  1248. : "undefined" === a.udn && (b.wsc.udn = void 0),
  1249. b.wsc.syncIsDone || (f(b.wsc.ud), (b.wsc.syncIsDone = !0)));
  1250. };
  1251. var f = function(c) {
  1252. c = b.wsc.getLocalStorageUD();
  1253. var d;
  1254. c instanceof Array && (d = c.toString());
  1255. void 0 !== d &&
  1256. "" !== d &&
  1257. setTimeout(function() {
  1258. b.wsc.addWords(d, function() {
  1259. I(a.dialog);
  1260. a.dialog.setupContent(a.dialog);
  1261. });
  1262. }, 400);
  1263. };
  1264. window.addEventListener
  1265. ? addEventListener("message", c, !1)
  1266. : window.attachEvent("onmessage", c);
  1267. setTimeout(function() {
  1268. var a = b.wsc.getLocalStorageUDN();
  1269. void 0 !== a && b.wsc.operationWithUDN("restore", a);
  1270. }, 500);
  1271. }
  1272. });
  1273. } else a.dialog.hide();
  1274. },
  1275. onHide: function() {
  1276. b.unlockSelection();
  1277. a.dataTemp = "";
  1278. a.sessionid = "";
  1279. g.postMessage.unbindHandler(H);
  1280. },
  1281. contents: [
  1282. {
  1283. id: "SpellTab",
  1284. label: "SpellChecker",
  1285. accessKey: "S",
  1286. elements: [
  1287. {
  1288. type: "html",
  1289. id: "banner",
  1290. label: "banner",
  1291. style: "",
  1292. html: "\x3cdiv\x3e\x3c/div\x3e"
  1293. },
  1294. {
  1295. type: "html",
  1296. id: "Content",
  1297. label: "spellContent",
  1298. html: "",
  1299. setup: function(b) {
  1300. b = a.iframeNumber + "_" + b._.currentTabId;
  1301. var c = document.getElementById(b);
  1302. a.targetFromFrame[b] = c.contentWindow;
  1303. }
  1304. },
  1305. {
  1306. type: "hbox",
  1307. id: "bottomGroup",
  1308. style: "width:560px; margin: 0 auto;",
  1309. widths: ["50%", "50%"],
  1310. className: "wsc-spelltab-bottom",
  1311. children: [
  1312. {
  1313. type: "hbox",
  1314. id: "leftCol",
  1315. align: "left",
  1316. width: "50%",
  1317. children: [
  1318. {
  1319. type: "vbox",
  1320. id: "rightCol1",
  1321. widths: ["50%", "50%"],
  1322. children: [
  1323. {
  1324. type: "text",
  1325. id: "ChangeTo_label",
  1326. label: a.LocalizationLabel.ChangeTo_label.text + ":",
  1327. labelLayout: "horizontal",
  1328. labelStyle: "font: 12px/25px arial, sans-serif;",
  1329. width: "140px",
  1330. default: "",
  1331. onShow: function() {
  1332. a.textNode.SpellTab = this;
  1333. a.LocalizationLabel.ChangeTo_label.instance = this;
  1334. },
  1335. onHide: function() {
  1336. this.reset();
  1337. }
  1338. },
  1339. {
  1340. type: "hbox",
  1341. id: "rightCol",
  1342. align: "right",
  1343. width: "30%",
  1344. children: [
  1345. {
  1346. type: "vbox",
  1347. id: "rightCol_col__left",
  1348. children: [
  1349. {
  1350. type: "text",
  1351. id: "labelSuggestions",
  1352. label:
  1353. a.LocalizationLabel.Suggestions.text + ":",
  1354. onShow: function() {
  1355. a.LocalizationLabel.Suggestions.instance = this;
  1356. this.getInputElement().setStyles({
  1357. display: "none"
  1358. });
  1359. }
  1360. },
  1361. {
  1362. type: "html",
  1363. id: "logo",
  1364. html: "",
  1365. setup: function(b) {
  1366. this.getElement().$.src = a.logotype;
  1367. this.getElement()
  1368. .getParent()
  1369. .setStyles({ "text-align": "left" });
  1370. }
  1371. }
  1372. ]
  1373. },
  1374. {
  1375. type: "select",
  1376. id: "list_of_suggestions",
  1377. labelStyle: "font: 12px/25px arial, sans-serif;",
  1378. size: "6",
  1379. inputStyle: "width: 140px; height: auto;",
  1380. items: [["loading..."]],
  1381. onShow: function() {
  1382. B = this;
  1383. },
  1384. onChange: function() {
  1385. a.textNode.SpellTab.setValue(this.getValue());
  1386. }
  1387. }
  1388. ]
  1389. }
  1390. ]
  1391. }
  1392. ]
  1393. },
  1394. {
  1395. type: "hbox",
  1396. id: "rightCol",
  1397. align: "right",
  1398. width: "50%",
  1399. children: [
  1400. {
  1401. type: "vbox",
  1402. id: "rightCol_col__left",
  1403. widths: ["50%", "50%", "50%", "50%"],
  1404. children: [
  1405. {
  1406. type: "button",
  1407. id: "ChangeTo_button",
  1408. label: a.LocalizationButton.ChangeTo_button.text,
  1409. title: "Change to",
  1410. style: "width: 100%;",
  1411. onLoad: function() {
  1412. this.getElement().setAttribute(
  1413. "title-cmd",
  1414. "ChangeTo"
  1415. );
  1416. a.LocalizationButton.ChangeTo_button.instance = this;
  1417. },
  1418. onClick: e
  1419. },
  1420. {
  1421. type: "button",
  1422. id: "ChangeAll",
  1423. label: a.LocalizationButton.ChangeAll.text,
  1424. title: "Change All",
  1425. style: "width: 100%;",
  1426. onLoad: function() {
  1427. this.getElement().setAttribute(
  1428. "title-cmd",
  1429. this.id
  1430. );
  1431. a.LocalizationButton.ChangeAll.instance = this;
  1432. },
  1433. onClick: e
  1434. },
  1435. {
  1436. type: "button",
  1437. id: "AddWord",
  1438. label: a.LocalizationButton.AddWord.text,
  1439. title: "Add word",
  1440. style: "width: 100%;",
  1441. onLoad: function() {
  1442. this.getElement().setAttribute(
  1443. "title-cmd",
  1444. this.id
  1445. );
  1446. a.LocalizationButton.AddWord.instance = this;
  1447. },
  1448. onClick: e
  1449. },
  1450. {
  1451. type: "button",
  1452. id: "FinishChecking_button",
  1453. label:
  1454. a.LocalizationButton.FinishChecking_button.text,
  1455. title: "Finish Checking",
  1456. style: "width: 100%;margin-top: 9px;",
  1457. onLoad: function() {
  1458. this.getElement().setAttribute(
  1459. "title-cmd",
  1460. "FinishChecking"
  1461. );
  1462. a.LocalizationButton.FinishChecking_button.instance = this;
  1463. },
  1464. onClick: e
  1465. }
  1466. ]
  1467. },
  1468. {
  1469. type: "vbox",
  1470. id: "rightCol_col__right",
  1471. widths: ["50%", "50%", "50%"],
  1472. children: [
  1473. {
  1474. type: "button",
  1475. id: "IgnoreWord",
  1476. label: a.LocalizationButton.IgnoreWord.text,
  1477. title: "Ignore word",
  1478. style: "width: 100%;",
  1479. onLoad: function() {
  1480. this.getElement().setAttribute(
  1481. "title-cmd",
  1482. this.id
  1483. );
  1484. a.LocalizationButton.IgnoreWord.instance = this;
  1485. },
  1486. onClick: e
  1487. },
  1488. {
  1489. type: "button",
  1490. id: "IgnoreAllWords",
  1491. label: a.LocalizationButton.IgnoreAllWords.text,
  1492. title: "Ignore all words",
  1493. style: "width: 100%;",
  1494. onLoad: function() {
  1495. this.getElement().setAttribute(
  1496. "title-cmd",
  1497. this.id
  1498. );
  1499. a.LocalizationButton.IgnoreAllWords.instance = this;
  1500. },
  1501. onClick: e
  1502. },
  1503. {
  1504. type: "button",
  1505. id: "Options",
  1506. label: a.LocalizationButton.Options.text,
  1507. title: "Option",
  1508. style: "width: 100%;",
  1509. onLoad: function() {
  1510. a.LocalizationButton.Options.instance = this;
  1511. "file:" == document.location.protocol &&
  1512. this.disable();
  1513. },
  1514. onClick: function() {
  1515. this.getElement().focus();
  1516. "file:" == document.location.protocol
  1517. ? alert(
  1518. "WSC: Options functionality is disabled when runing from file system"
  1519. )
  1520. : ((z = document.activeElement),
  1521. b.openDialog("options"));
  1522. }
  1523. }
  1524. ]
  1525. }
  1526. ]
  1527. }
  1528. ]
  1529. },
  1530. {
  1531. type: "hbox",
  1532. id: "BlockFinishChecking",
  1533. style: "width:560px; margin: 0 auto;",
  1534. widths: ["70%", "30%"],
  1535. onShow: function() {
  1536. this.getElement().setStyles({
  1537. display: "block",
  1538. position: "absolute",
  1539. left: "-9999px"
  1540. });
  1541. },
  1542. onHide: p,
  1543. children: [
  1544. {
  1545. type: "hbox",
  1546. id: "leftCol",
  1547. align: "left",
  1548. width: "70%",
  1549. children: [
  1550. {
  1551. type: "vbox",
  1552. id: "rightCol1",
  1553. setup: function() {
  1554. this.getChild()[0].getElement().$.src = a.logotype;
  1555. this.getChild()[0]
  1556. .getElement()
  1557. .getParent()
  1558. .setStyles({ "text-align": "center" });
  1559. },
  1560. children: [{ type: "html", id: "logo", html: "" }]
  1561. }
  1562. ]
  1563. },
  1564. {
  1565. type: "hbox",
  1566. id: "rightCol",
  1567. align: "right",
  1568. width: "30%",
  1569. children: [
  1570. {
  1571. type: "vbox",
  1572. id: "rightCol_col__left",
  1573. children: [
  1574. {
  1575. type: "button",
  1576. id: "Option_button",
  1577. label: a.LocalizationButton.Options.text,
  1578. title: "Option",
  1579. style: "width: 100%;",
  1580. onLoad: function() {
  1581. this.getElement().setAttribute(
  1582. "title-cmd",
  1583. this.id
  1584. );
  1585. "file:" == document.location.protocol &&
  1586. this.disable();
  1587. },
  1588. onClick: function() {
  1589. this.getElement().focus();
  1590. "file:" == document.location.protocol
  1591. ? alert(
  1592. "WSC: Options functionality is disabled when runing from file system"
  1593. )
  1594. : ((z = document.activeElement),
  1595. b.openDialog("options"));
  1596. }
  1597. },
  1598. {
  1599. type: "button",
  1600. id: "FinishChecking_button_block",
  1601. label:
  1602. a.LocalizationButton.FinishChecking_button_block
  1603. .text,
  1604. title: "Finish Checking",
  1605. style: "width: 100%;",
  1606. onLoad: function() {
  1607. this.getElement().setAttribute(
  1608. "title-cmd",
  1609. "FinishChecking"
  1610. );
  1611. },
  1612. onClick: e
  1613. }
  1614. ]
  1615. }
  1616. ]
  1617. }
  1618. ]
  1619. }
  1620. ]
  1621. },
  1622. {
  1623. id: "GrammTab",
  1624. label: "Grammar",
  1625. accessKey: "G",
  1626. elements: [
  1627. {
  1628. type: "html",
  1629. id: "banner",
  1630. label: "banner",
  1631. style: "",
  1632. html: "\x3cdiv\x3e\x3c/div\x3e"
  1633. },
  1634. {
  1635. type: "html",
  1636. id: "Content",
  1637. label: "GrammarContent",
  1638. html: "",
  1639. setup: function() {
  1640. var b = a.iframeNumber + "_" + a.dialog._.currentTabId,
  1641. c = document.getElementById(b);
  1642. a.targetFromFrame[b] = c.contentWindow;
  1643. }
  1644. },
  1645. {
  1646. type: "vbox",
  1647. id: "bottomGroup",
  1648. style: "width:560px; margin: 0 auto;",
  1649. children: [
  1650. {
  1651. type: "hbox",
  1652. id: "leftCol",
  1653. widths: ["66%", "34%"],
  1654. children: [
  1655. {
  1656. type: "vbox",
  1657. children: [
  1658. {
  1659. type: "text",
  1660. id: "text",
  1661. label: "Change to:",
  1662. labelLayout: "horizontal",
  1663. labelStyle: "font: 12px/25px arial, sans-serif;",
  1664. inputStyle: "float: right; width: 200px;",
  1665. default: "",
  1666. onShow: function() {
  1667. a.textNode.GrammTab = this;
  1668. },
  1669. onHide: function() {
  1670. this.reset();
  1671. }
  1672. },
  1673. {
  1674. type: "html",
  1675. id: "html_text",
  1676. html:
  1677. "\x3cdiv style\x3d'min-height: 17px; line-height: 17px; padding: 5px; text-align: left;background: #F1F1F1;color: #595959; white-space: normal!important;'\x3e\x3c/div\x3e",
  1678. onShow: function(b) {
  1679. a.textNodeInfo.GrammTab = this;
  1680. }
  1681. },
  1682. {
  1683. type: "html",
  1684. id: "radio",
  1685. html: "",
  1686. onShow: function() {
  1687. a.grammerSuggest = this;
  1688. }
  1689. }
  1690. ]
  1691. },
  1692. {
  1693. type: "vbox",
  1694. children: [
  1695. {
  1696. type: "button",
  1697. id: "ChangeTo_button",
  1698. label: "Change to",
  1699. title: "Change to",
  1700. style: "width: 133px; float: right;",
  1701. onLoad: function() {
  1702. this.getElement().setAttribute(
  1703. "title-cmd",
  1704. "ChangeTo"
  1705. );
  1706. },
  1707. onClick: e
  1708. },
  1709. {
  1710. type: "button",
  1711. id: "IgnoreWord",
  1712. label: "Ignore word",
  1713. title: "Ignore word",
  1714. style: "width: 133px; float: right;",
  1715. onLoad: function() {
  1716. this.getElement().setAttribute(
  1717. "title-cmd",
  1718. this.id
  1719. );
  1720. },
  1721. onClick: e
  1722. },
  1723. {
  1724. type: "button",
  1725. id: "IgnoreAllWords",
  1726. label: "Ignore Problem",
  1727. title: "Ignore Problem",
  1728. style: "width: 133px; float: right;",
  1729. onLoad: function() {
  1730. this.getElement().setAttribute(
  1731. "title-cmd",
  1732. this.id
  1733. );
  1734. },
  1735. onClick: e
  1736. },
  1737. {
  1738. type: "button",
  1739. id: "FinishChecking_button",
  1740. label:
  1741. a.LocalizationButton.FinishChecking_button.text,
  1742. title: "Finish Checking",
  1743. style: "width: 133px; float: right; margin-top: 9px;",
  1744. onLoad: function() {
  1745. this.getElement().setAttribute(
  1746. "title-cmd",
  1747. "FinishChecking"
  1748. );
  1749. },
  1750. onClick: e
  1751. }
  1752. ]
  1753. }
  1754. ]
  1755. }
  1756. ]
  1757. },
  1758. {
  1759. type: "hbox",
  1760. id: "BlockFinishChecking",
  1761. style: "width:560px; margin: 0 auto;",
  1762. widths: ["70%", "30%"],
  1763. onShow: function() {
  1764. this.getElement().setStyles({
  1765. display: "block",
  1766. position: "absolute",
  1767. left: "-9999px"
  1768. });
  1769. },
  1770. onHide: p,
  1771. children: [
  1772. {
  1773. type: "hbox",
  1774. id: "leftCol",
  1775. align: "left",
  1776. width: "70%",
  1777. children: [
  1778. {
  1779. type: "vbox",
  1780. id: "rightCol1",
  1781. children: [
  1782. {
  1783. type: "html",
  1784. id: "logo",
  1785. html: "",
  1786. setup: function() {
  1787. this.getElement().$.src = a.logotype;
  1788. this.getElement()
  1789. .getParent()
  1790. .setStyles({ "text-align": "center" });
  1791. }
  1792. }
  1793. ]
  1794. }
  1795. ]
  1796. },
  1797. {
  1798. type: "hbox",
  1799. id: "rightCol",
  1800. align: "right",
  1801. width: "30%",
  1802. children: [
  1803. {
  1804. type: "vbox",
  1805. id: "rightCol_col__left",
  1806. children: [
  1807. {
  1808. type: "button",
  1809. id: "FinishChecking_button_block",
  1810. label:
  1811. a.LocalizationButton.FinishChecking_button_block
  1812. .text,
  1813. title: "Finish Checking",
  1814. style: "width: 100%;",
  1815. onLoad: function() {
  1816. this.getElement().setAttribute(
  1817. "title-cmd",
  1818. "FinishChecking"
  1819. );
  1820. },
  1821. onClick: e
  1822. }
  1823. ]
  1824. }
  1825. ]
  1826. }
  1827. ]
  1828. }
  1829. ]
  1830. },
  1831. {
  1832. id: "Thesaurus",
  1833. label: "Thesaurus",
  1834. accessKey: "T",
  1835. elements: [
  1836. {
  1837. type: "html",
  1838. id: "banner",
  1839. label: "banner",
  1840. style: "",
  1841. html: "\x3cdiv\x3e\x3c/div\x3e"
  1842. },
  1843. {
  1844. type: "html",
  1845. id: "Content",
  1846. label: "spellContent",
  1847. html: "",
  1848. setup: function() {
  1849. var b = a.iframeNumber + "_" + a.dialog._.currentTabId,
  1850. c = document.getElementById(b);
  1851. a.targetFromFrame[b] = c.contentWindow;
  1852. }
  1853. },
  1854. {
  1855. type: "vbox",
  1856. id: "bottomGroup",
  1857. style: "width:560px; margin: -10px auto; overflow: hidden;",
  1858. children: [
  1859. {
  1860. type: "hbox",
  1861. widths: ["75%", "25%"],
  1862. children: [
  1863. {
  1864. type: "vbox",
  1865. children: [
  1866. {
  1867. type: "hbox",
  1868. widths: ["65%", "35%"],
  1869. children: [
  1870. {
  1871. type: "text",
  1872. id: "ChangeTo_label",
  1873. label:
  1874. a.LocalizationLabel.ChangeTo_label.text + ":",
  1875. labelLayout: "horizontal",
  1876. inputStyle: "width: 160px;",
  1877. labelStyle: "font: 12px/25px arial, sans-serif;",
  1878. default: "",
  1879. onShow: function(b) {
  1880. a.textNode.Thesaurus = this;
  1881. a.LocalizationLabel.ChangeTo_label.instance = this;
  1882. },
  1883. onHide: function() {
  1884. this.reset();
  1885. }
  1886. },
  1887. {
  1888. type: "button",
  1889. id: "ChangeTo_button",
  1890. label: a.LocalizationButton.ChangeTo_button.text,
  1891. title: "Change to",
  1892. style: "width: 121px; margin-top: 1px;",
  1893. onLoad: function() {
  1894. this.getElement().setAttribute(
  1895. "title-cmd",
  1896. "ChangeTo"
  1897. );
  1898. a.LocalizationButton.ChangeTo_button.instance = this;
  1899. },
  1900. onClick: e
  1901. }
  1902. ]
  1903. },
  1904. {
  1905. type: "hbox",
  1906. children: [
  1907. {
  1908. type: "select",
  1909. id: "Categories",
  1910. label: a.LocalizationLabel.Categories.text + ":",
  1911. labelStyle: "font: 12px/25px arial, sans-serif;",
  1912. size: "5",
  1913. inputStyle: "width: 180px; height: auto;",
  1914. items: [],
  1915. onShow: function() {
  1916. a.selectNode.Categories = this;
  1917. a.LocalizationLabel.Categories.instance = this;
  1918. },
  1919. onChange: function() {
  1920. a.buildOptionSynonyms(this.getValue());
  1921. }
  1922. },
  1923. {
  1924. type: "select",
  1925. id: "Synonyms",
  1926. label: a.LocalizationLabel.Synonyms.text + ":",
  1927. labelStyle: "font: 12px/25px arial, sans-serif;",
  1928. size: "5",
  1929. inputStyle: "width: 180px; height: auto;",
  1930. items: [],
  1931. onShow: function() {
  1932. a.selectNode.Synonyms = this;
  1933. a.textNode.Thesaurus.setValue(this.getValue());
  1934. a.LocalizationLabel.Synonyms.instance = this;
  1935. },
  1936. onChange: function(b) {
  1937. a.textNode.Thesaurus.setValue(this.getValue());
  1938. }
  1939. }
  1940. ]
  1941. }
  1942. ]
  1943. },
  1944. {
  1945. type: "vbox",
  1946. width: "120px",
  1947. style: "margin-top:46px;",
  1948. children: [
  1949. {
  1950. type: "html",
  1951. id: "logotype",
  1952. label: "WebSpellChecker.net",
  1953. html: "",
  1954. setup: function() {
  1955. this.getElement().$.src = a.logotype;
  1956. this.getElement()
  1957. .getParent()
  1958. .setStyles({ "text-align": "center" });
  1959. }
  1960. },
  1961. {
  1962. type: "button",
  1963. id: "FinishChecking_button",
  1964. label:
  1965. a.LocalizationButton.FinishChecking_button.text,
  1966. title: "Finish Checking",
  1967. style: "width: 100%; float: right; margin-top: 9px;",
  1968. onLoad: function() {
  1969. this.getElement().setAttribute(
  1970. "title-cmd",
  1971. "FinishChecking"
  1972. );
  1973. },
  1974. onClick: e
  1975. }
  1976. ]
  1977. }
  1978. ]
  1979. }
  1980. ]
  1981. },
  1982. {
  1983. type: "hbox",
  1984. id: "BlockFinishChecking",
  1985. style: "width:560px; margin: 0 auto;",
  1986. widths: ["70%", "30%"],
  1987. onShow: function() {
  1988. this.getElement().setStyles({
  1989. display: "block",
  1990. position: "absolute",
  1991. left: "-9999px"
  1992. });
  1993. },
  1994. children: [
  1995. {
  1996. type: "hbox",
  1997. id: "leftCol",
  1998. align: "left",
  1999. width: "70%",
  2000. children: [
  2001. {
  2002. type: "vbox",
  2003. id: "rightCol1",
  2004. children: [
  2005. {
  2006. type: "html",
  2007. id: "logo",
  2008. html: "",
  2009. setup: function() {
  2010. this.getElement().$.src = a.logotype;
  2011. this.getElement()
  2012. .getParent()
  2013. .setStyles({ "text-align": "center" });
  2014. }
  2015. }
  2016. ]
  2017. }
  2018. ]
  2019. },
  2020. {
  2021. type: "hbox",
  2022. id: "rightCol",
  2023. align: "right",
  2024. width: "30%",
  2025. children: [
  2026. {
  2027. type: "vbox",
  2028. id: "rightCol_col__left",
  2029. children: [
  2030. {
  2031. type: "button",
  2032. id: "FinishChecking_button_block",
  2033. label:
  2034. a.LocalizationButton.FinishChecking_button_block
  2035. .text,
  2036. title: "Finish Checking",
  2037. style: "width: 100%;",
  2038. onLoad: function() {
  2039. this.getElement().setAttribute(
  2040. "title-cmd",
  2041. "FinishChecking"
  2042. );
  2043. },
  2044. onClick: e
  2045. }
  2046. ]
  2047. }
  2048. ]
  2049. }
  2050. ]
  2051. }
  2052. ]
  2053. }
  2054. ]
  2055. };
  2056. });
  2057. var z = null;
  2058. CKEDITOR.dialog.add("options", function(b) {
  2059. var d = null,
  2060. c = {},
  2061. e = {},
  2062. f = null,
  2063. h = null;
  2064. g.cookie.get("udn");
  2065. g.cookie.get("osp");
  2066. b = function(a) {
  2067. h = this.getElement().getAttribute("title-cmd");
  2068. a = [];
  2069. a[0] = e.IgnoreAllCapsWords;
  2070. a[1] = e.IgnoreWordsNumbers;
  2071. a[2] = e.IgnoreMixedCaseWords;
  2072. a[3] = e.IgnoreDomainNames;
  2073. a = a.toString().replace(/,/g, "");
  2074. g.cookie.set("osp", a);
  2075. g.cookie.set("udnCmd", h ? h : "ignore");
  2076. "delete" != h &&
  2077. ((a = ""),
  2078. "" !== t.getValue() && (a = t.getValue()),
  2079. g.cookie.set("udn", a));
  2080. g.postMessage.send({ id: "options_dic_send" });
  2081. };
  2082. var k = function() {
  2083. f.getElement().setHtml(a.LocalizationComing.error);
  2084. f.getElement().show();
  2085. };
  2086. return {
  2087. title: a.LocalizationComing.Options,
  2088. minWidth: 430,
  2089. minHeight: 130,
  2090. resizable: CKEDITOR.DIALOG_RESIZE_NONE,
  2091. contents: [
  2092. {
  2093. id: "OptionsTab",
  2094. label: "Options",
  2095. accessKey: "O",
  2096. elements: [
  2097. {
  2098. type: "hbox",
  2099. id: "options_error",
  2100. children: [
  2101. {
  2102. type: "html",
  2103. style:
  2104. "display: block;text-align: center;white-space: normal!important; font-size: 12px;color:red",
  2105. html: "\x3cdiv\x3e\x3c/div\x3e",
  2106. onShow: function() {
  2107. f = this;
  2108. }
  2109. }
  2110. ]
  2111. },
  2112. {
  2113. type: "vbox",
  2114. id: "Options_content",
  2115. children: [
  2116. {
  2117. type: "hbox",
  2118. id: "Options_manager",
  2119. widths: ["52%", "48%"],
  2120. children: [
  2121. {
  2122. type: "fieldset",
  2123. label: "Spell Checking Options",
  2124. style:
  2125. "border: none;margin-top: 13px;padding: 10px 0 10px 10px",
  2126. onShow: function() {
  2127. this.getInputElement().$.children[0].innerHTML =
  2128. a.LocalizationComing.SpellCheckingOptions;
  2129. },
  2130. children: [
  2131. {
  2132. type: "vbox",
  2133. id: "Options_checkbox",
  2134. children: [
  2135. {
  2136. type: "checkbox",
  2137. id: "IgnoreAllCapsWords",
  2138. label: "Ignore All-Caps Words",
  2139. labelStyle:
  2140. "margin-left: 5px; font: 12px/16px arial, sans-serif;display: inline-block;white-space: normal;",
  2141. style: "float:left; min-height: 16px;",
  2142. default: "",
  2143. onClick: function() {
  2144. e[this.id] = this.getValue() ? 1 : 0;
  2145. }
  2146. },
  2147. {
  2148. type: "checkbox",
  2149. id: "IgnoreWordsNumbers",
  2150. label: "Ignore Words with Numbers",
  2151. labelStyle:
  2152. "margin-left: 5px; font: 12px/16px arial, sans-serif;display: inline-block;white-space: normal;",
  2153. style: "float:left; min-height: 16px;",
  2154. default: "",
  2155. onClick: function() {
  2156. e[this.id] = this.getValue() ? 1 : 0;
  2157. }
  2158. },
  2159. {
  2160. type: "checkbox",
  2161. id: "IgnoreMixedCaseWords",
  2162. label: "Ignore Mixed-Case Words",
  2163. labelStyle:
  2164. "margin-left: 5px; font: 12px/16px arial, sans-serif;display: inline-block;white-space: normal;",
  2165. style: "float:left; min-height: 16px;",
  2166. default: "",
  2167. onClick: function() {
  2168. e[this.id] = this.getValue() ? 1 : 0;
  2169. }
  2170. },
  2171. {
  2172. type: "checkbox",
  2173. id: "IgnoreDomainNames",
  2174. label: "Ignore Domain Names",
  2175. labelStyle:
  2176. "margin-left: 5px; font: 12px/16px arial, sans-serif;display: inline-block;white-space: normal;",
  2177. style: "float:left; min-height: 16px;",
  2178. default: "",
  2179. onClick: function() {
  2180. e[this.id] = this.getValue() ? 1 : 0;
  2181. }
  2182. }
  2183. ]
  2184. }
  2185. ]
  2186. },
  2187. {
  2188. type: "vbox",
  2189. id: "Options_DictionaryName",
  2190. children: [
  2191. {
  2192. type: "text",
  2193. id: "DictionaryName",
  2194. style: "margin-bottom: 10px",
  2195. label: "Dictionary Name:",
  2196. labelLayout: "vertical",
  2197. labelStyle: "font: 12px/25px arial, sans-serif;",
  2198. default: "",
  2199. onLoad: function() {
  2200. t = this;
  2201. var b = a.userDictionaryName
  2202. ? a.userDictionaryName
  2203. : (g.cookie.get("udn"), this.getValue());
  2204. this.setValue(b);
  2205. },
  2206. onShow: function() {
  2207. t = this;
  2208. var b = g.cookie.get("udn")
  2209. ? g.cookie.get("udn")
  2210. : this.getValue();
  2211. this.setValue(b);
  2212. this.setLabel(a.LocalizationComing.DictionaryName);
  2213. },
  2214. onHide: function() {
  2215. this.reset();
  2216. }
  2217. },
  2218. {
  2219. type: "hbox",
  2220. id: "Options_buttons",
  2221. children: [
  2222. {
  2223. type: "vbox",
  2224. id: "Options_leftCol_col",
  2225. widths: ["50%", "50%"],
  2226. children: [
  2227. {
  2228. type: "button",
  2229. id: "create",
  2230. label: "Create",
  2231. title: "Create",
  2232. style: "width: 100%;",
  2233. onLoad: function() {
  2234. this.getElement().setAttribute(
  2235. "title-cmd",
  2236. this.id
  2237. );
  2238. },
  2239. onShow: function() {
  2240. (
  2241. this.getElement().getFirst() ||
  2242. this.getElement()
  2243. ).setText(a.LocalizationComing.Create);
  2244. },
  2245. onClick: b
  2246. },
  2247. {
  2248. type: "button",
  2249. id: "restore",
  2250. label: "Restore",
  2251. title: "Restore",
  2252. style: "width: 100%;",
  2253. onLoad: function() {
  2254. this.getElement().setAttribute(
  2255. "title-cmd",
  2256. this.id
  2257. );
  2258. },
  2259. onShow: function() {
  2260. (
  2261. this.getElement().getFirst() ||
  2262. this.getElement()
  2263. ).setText(a.LocalizationComing.Restore);
  2264. },
  2265. onClick: b
  2266. }
  2267. ]
  2268. },
  2269. {
  2270. type: "vbox",
  2271. id: "Options_rightCol_col",
  2272. widths: ["50%", "50%"],
  2273. children: [
  2274. {
  2275. type: "button",
  2276. id: "rename",
  2277. label: "Rename",
  2278. title: "Rename",
  2279. style: "width: 100%;",
  2280. onLoad: function() {
  2281. this.getElement().setAttribute(
  2282. "title-cmd",
  2283. this.id
  2284. );
  2285. },
  2286. onShow: function() {
  2287. (
  2288. this.getElement().getFirst() ||
  2289. this.getElement()
  2290. ).setText(a.LocalizationComing.Rename);
  2291. },
  2292. onClick: b
  2293. },
  2294. {
  2295. type: "button",
  2296. id: "delete",
  2297. label: "Remove",
  2298. title: "Remove",
  2299. style: "width: 100%;",
  2300. onLoad: function() {
  2301. this.getElement().setAttribute(
  2302. "title-cmd",
  2303. this.id
  2304. );
  2305. },
  2306. onShow: function() {
  2307. (
  2308. this.getElement().getFirst() ||
  2309. this.getElement()
  2310. ).setText(a.LocalizationComing.Remove);
  2311. },
  2312. onClick: b
  2313. }
  2314. ]
  2315. }
  2316. ]
  2317. }
  2318. ]
  2319. }
  2320. ]
  2321. },
  2322. {
  2323. type: "hbox",
  2324. id: "Options_text",
  2325. children: [
  2326. {
  2327. type: "html",
  2328. style:
  2329. "text-align: justify;margin-top: 15px;white-space: normal!important; font-size: 12px;color:#777;",
  2330. html:
  2331. "\x3cdiv\x3e" +
  2332. a.LocalizationComing.OptionsTextIntro +
  2333. "\x3c/div\x3e",
  2334. onShow: function() {
  2335. this.getElement().setText(
  2336. a.LocalizationComing.OptionsTextIntro
  2337. );
  2338. }
  2339. }
  2340. ]
  2341. }
  2342. ]
  2343. }
  2344. ]
  2345. }
  2346. ],
  2347. buttons: [CKEDITOR.dialog.okButton, CKEDITOR.dialog.cancelButton],
  2348. onOk: function() {
  2349. var a = [];
  2350. a[0] = e.IgnoreAllCapsWords;
  2351. a[1] = e.IgnoreWordsNumbers;
  2352. a[2] = e.IgnoreMixedCaseWords;
  2353. a[3] = e.IgnoreDomainNames;
  2354. a = a.toString().replace(/,/g, "");
  2355. g.cookie.set("osp", a);
  2356. g.postMessage.send({ id: "options_checkbox_send" });
  2357. f.getElement().hide();
  2358. f.getElement().setHtml(" ");
  2359. },
  2360. onLoad: function() {
  2361. d = this;
  2362. c.IgnoreAllCapsWords = d.getContentElement(
  2363. "OptionsTab",
  2364. "IgnoreAllCapsWords"
  2365. );
  2366. c.IgnoreWordsNumbers = d.getContentElement(
  2367. "OptionsTab",
  2368. "IgnoreWordsNumbers"
  2369. );
  2370. c.IgnoreMixedCaseWords = d.getContentElement(
  2371. "OptionsTab",
  2372. "IgnoreMixedCaseWords"
  2373. );
  2374. c.IgnoreDomainNames = d.getContentElement(
  2375. "OptionsTab",
  2376. "IgnoreDomainNames"
  2377. );
  2378. },
  2379. onShow: function() {
  2380. g.postMessage.init(k);
  2381. var b = g.cookie.get("osp").split("");
  2382. e.IgnoreAllCapsWords = b[0];
  2383. e.IgnoreWordsNumbers = b[1];
  2384. e.IgnoreMixedCaseWords = b[2];
  2385. e.IgnoreDomainNames = b[3];
  2386. parseInt(e.IgnoreAllCapsWords, 10)
  2387. ? c.IgnoreAllCapsWords.setValue("checked", !1)
  2388. : c.IgnoreAllCapsWords.setValue("", !1);
  2389. parseInt(e.IgnoreWordsNumbers, 10)
  2390. ? c.IgnoreWordsNumbers.setValue("checked", !1)
  2391. : c.IgnoreWordsNumbers.setValue("", !1);
  2392. parseInt(e.IgnoreMixedCaseWords, 10)
  2393. ? c.IgnoreMixedCaseWords.setValue("checked", !1)
  2394. : c.IgnoreMixedCaseWords.setValue("", !1);
  2395. parseInt(e.IgnoreDomainNames, 10)
  2396. ? c.IgnoreDomainNames.setValue("checked", !1)
  2397. : c.IgnoreDomainNames.setValue("", !1);
  2398. e.IgnoreAllCapsWords = c.IgnoreAllCapsWords.getValue() ? 1 : 0;
  2399. e.IgnoreWordsNumbers = c.IgnoreWordsNumbers.getValue() ? 1 : 0;
  2400. e.IgnoreMixedCaseWords = c.IgnoreMixedCaseWords.getValue() ? 1 : 0;
  2401. e.IgnoreDomainNames = c.IgnoreDomainNames.getValue() ? 1 : 0;
  2402. c.IgnoreAllCapsWords.getElement().$.lastChild.innerHTML =
  2403. a.LocalizationComing.IgnoreAllCapsWords;
  2404. c.IgnoreWordsNumbers.getElement().$.lastChild.innerHTML =
  2405. a.LocalizationComing.IgnoreWordsWithNumbers;
  2406. c.IgnoreMixedCaseWords.getElement().$.lastChild.innerHTML =
  2407. a.LocalizationComing.IgnoreMixedCaseWords;
  2408. c.IgnoreDomainNames.getElement().$.lastChild.innerHTML =
  2409. a.LocalizationComing.IgnoreDomainNames;
  2410. },
  2411. onHide: function() {
  2412. g.postMessage.unbindHandler(k);
  2413. if (z)
  2414. try {
  2415. z.focus();
  2416. } catch (a) {}
  2417. }
  2418. };
  2419. });
  2420. CKEDITOR.dialog.on("resize", function(b) {
  2421. b = b.data;
  2422. var d = b.dialog,
  2423. c = CKEDITOR.document.getById(a.iframeNumber + "_" + d._.currentTabId);
  2424. "checkspell" == d._.name &&
  2425. (a.bnr
  2426. ? c && c.setSize("height", b.height - 310)
  2427. : c && c.setSize("height", b.height - 220),
  2428. d._.fromResizeEvent && !d._.resized && (d._.resized = !0),
  2429. (d._.fromResizeEvent = !0));
  2430. });
  2431. CKEDITOR.on("dialogDefinition", function(b) {
  2432. if ("checkspell" === b.data.name) {
  2433. var d = b.data.definition;
  2434. a.onLoadOverlay = new C({
  2435. opacity: "1",
  2436. background: "#fff",
  2437. target: d.dialog.parts.tabs.getParent().$
  2438. });
  2439. a.onLoadOverlay.setEnable();
  2440. d.dialog.on(
  2441. "cancel",
  2442. function(b) {
  2443. d.dialog
  2444. .getParentEditor()
  2445. .config.wsc_onClose.call(this.document.getWindow().getFrame());
  2446. a.div_overlay.setDisable();
  2447. a.onLoadOverlay.setDisable();
  2448. return !1;
  2449. },
  2450. this,
  2451. null,
  2452. -1
  2453. );
  2454. }
  2455. });
  2456. })();