Valerii Vasin (valerii) wrote in changelog,
Valerii Vasin
valerii
changelog

[livejournal] r22635: LJSUP-13260: Spellchecker: fix words par...

Committer: vvasin
LJSUP-13260: Spellchecker: fix words parsing in RTE mode. Build.
U   trunk/htdocs/js/ck/ckeditor.js
Modified: trunk/htdocs/js/ck/ckeditor.js
===================================================================
--- trunk/htdocs/js/ck/ckeditor.js	2012-08-14 07:43:29 UTC (rev 22634)
+++ trunk/htdocs/js/ck/ckeditor.js	2012-08-14 08:33:00 UTC (rev 22635)
@@ -148,12 +148,13 @@
 break;case 'lj-repost':x=new a.htmlParser.element('lj-repost');x.attributes.button=w.attributes['lj-button'];x.children=new a.htmlParser.fragment.fromHtml(w.attributes['lj-text']).children;break;case 'lj-template':x=new a.htmlParser.element('lj-template');x.attributes=LiveJournal.JSON.parse(encodeURIComponent(w.attributes['lj-attributes']));x.isOptionalClose=x.isEmpty=true;break;case 'lj-spoiler':y=true;z='title';case 'lj-cut':if(w.attributes['lj-class'].indexOf(A+'-open')+1){var B=w.next,C=0;x=new a.htmlParser.element(A);if(w.attributes.hasOwnProperty('text'))x.attributes[z]=w.attributes.text;while(B){if(B.name=='iframe'){var D=B.attributes['lj-class'];if(D.indexOf(A+'-close')+1){if(y&&C)C--;else{x.next=B;break;}}else if(D.indexOf(A+'-open')+1)if(y)C++;else{x.next=B;break;}}B.parent.children.remove(B);x.add(B);var E=B.next;B.next=null;B=E;}}else x=false;break;default:if(!w.children.length)x=false;}return x;},span:function(w){var x=w.attributes['lj:user'];if(x){var y=new a.htmlParser.element('lj');y.attributes.user=x;try{var z=w.children[1].children[0].children[0].value;}catch(A){return false;}if(z&&z!=x)y.attributes.title=z;y.isOptionalClose=y.isEmpty=true;return y;}else if(w.attributes.style=='display: none;'||!w.children.length)return false;},div:function(w){if(!w.children.length)return false;},'lj:raw':function(w){w.name='lj-raw';},'lj:wishlist':function(w){w.name='lj-wishlist';}},attributes:{'lj-cmd':function(){return false;},contenteditable:function(){return false;}}});},requires:['fakeobjects','domiterator']});})();(function(m,n){var o;function p(v){return v.type==3&&v.getLength()>0&&(!o||!v.isReadOnly());};function q(v){return!(v.type==1&&v.isBlockBoundary(e.extend({},f.$empty,f.$nonEditable)));};var r=function(){var v=this;return{textNode:v.textNode,offset:v.offset,character:v.textNode?v.textNode.getText().charAt(v.offset):null,hitMatchBoundary:v._.matchBoundary};},s,t=function(v,w){s=new a.style(e.extend({attributes:{'data-cke-highlight':1,'data-incorrect':1,'data-id':0},fullMatch:1,ignoreReadonly:1,childRule:function(){return 1;}},{element:'span',styles:{'border-bottom':'1px solid red',cursor:'pointer'}},true));var x=function(J,K){var L=this,M=new d.walker(J);M.guard=K?q:function(N){!q(N)&&(L._.matchBoundary=true);};M.evaluator=p;M.breakOnFalse=1;if(J.startContainer.type==3){this.textNode=J.startContainer;this.offset=J.startOffset-1;}this._={matchWord:K,walker:M,matchBoundary:false};};x.prototype={next:function(){return this.move();},back:function(){return this.move(true);
 },move:function(J){var L=this;var K=L.textNode;if(K===null)return r.call(L);L._.matchBoundary=false;if(K&&J&&L.offset>0){L.offset--;return r.call(L);}else if(K&&L.offset<K.getLength()-1){L.offset++;return r.call(L);}else{K=null;while(!K){K=L._.walker[J?'previous':'next'].call(L._.walker);if(L._.matchWord&&!K||L._.walker._.end)break;}L.textNode=K;if(K)L.offset=J?K.getLength()-1:0;else L.offset=0;}return r.call(L);}};var y=function(J,K){this._={walker:J,cursors:[],rangeLength:K,highlightRange:null,isMatched:0};};y.prototype={toDomRange:function(){var J=new d.range(v.document),K=this._.cursors;if(K.length<1){var L=this._.walker.textNode;if(L)J.setStartAfter(L);else return null;}else{var M=K[0],N=K[K.length-1];J.setStart(M.textNode,M.offset);J.setEnd(N.textNode,N.offset+1);}return J;},updateFromDomRange:function(J){var M=this;var K,L=new x(J);M._.cursors=[];do{K=L.next();if(K.character)M._.cursors.push(K);}while(K.character);M._.rangeLength=M._.cursors.length;},setMatched:function(){this._.isMatched=true;},clearMatched:function(){this._.isMatched=false;},isMatched:function(){return this._.isMatched;},highlight:function(){var M=this;if(M._.cursors.length<1)return;if(M._.highlightRange)M.removeHighlight();var J=M.toDomRange(),K=J.createBookmark();s.applyToRange(J);J.moveToBookmark(K);M._.highlightRange=J;var L=J.startContainer;if(L.type!=1)L=L.getParent();M.updateFromDomRange(J);},highlightx:function(){var L=this;if(L._.cursors.length<1)return;if(L._.highlightRange)L.removeHighlight();var J=L.toDomRange(),K=J.createBookmark();J.moveToBookmark(K);L.updateFromDomRange(J);},removeHighlight:function(J){var L=this;if(!L._.highlightRange)return;var K=L._.highlightRange.createBookmark();s.removeFromRange(J||L._.highlightRange);L._.highlightRange.moveToBookmark(K);L.updateFromDomRange(L._.highlightRange);L._.highlightRange=null;},isReadOnly:function(){if(!this._.highlightRange)return 0;return this._.highlightRange.startContainer.isReadOnly();},moveBack:function(){var L=this;var J=L._.walker.back(),K=L._.cursors;if(J.hitMatchBoundary)L._.cursors=K=[];K.unshift(J);if(K.length>L._.rangeLength)K.pop();return J;},moveNext:function(){var L=this;var J=L._.walker.next(),K=L._.cursors;if(J.hitMatchBoundary)L._.cursors=K=[];K.push(J);if(K.length>L._.rangeLength)K.shift();return J;},getEndCharacter:function(){var J=this._.cursors;if(J.length<1)return null;return J[J.length-1].character;},getNextCharacterRange:function(J){var K,L,M=this._.cursors;if((K=M[M.length-1])&&K.textNode)L=new x(z(K));
 else L=this._.walker;return new y(L,J);},getCursors:function(){return this._.cursors;}};function z(J,K){var L=new d.range();L.setStart(J.textNode,K?J.offset:J.offset+1);L.setEndAt(v.document.getBody(),2);return L;};function A(J){var K=new d.range();K.setStartAt(v.document.getBody(),1);K.setEnd(J.textNode,J.offset);return K;};var B=0,C=1,D=2,E=function(J,K){var L=[-1];if(K)J=J.toLowerCase();for(var M=0;M<J.length;M++){L.push(L[M]+1);while(L[M+1]>0&&J.charAt(M)!=J.charAt(L[M+1]-1))L[M+1]=L[L[M+1]-1]+1;}this._={overlap:L,state:0,ignoreCase:!!K,pattern:J};};E.prototype={feedCharacter:function(J){var K=this;if(K._.ignoreCase)J=J.toLowerCase();for(;;){if(J==K._.pattern.charAt(K._.state)){K._.state++;if(K._.state==K._.pattern.length){K._.state=0;return D;}return C;}else if(!K._.state)return B;else K._.state=K._.overlap[K._.state];}return null;},reset:function(){this._.state=0;}};var F=/[.,"'?!;: \u0085\u00a0\u1680\u280e\u2028\u2029\u202f\u205f\u3000]/,G=function(J){if(!J)return true;var K=J.charCodeAt(0);return K>=9&&K<=13||K>=8192&&K<=8202||F.test(J);},H={searchRange:null,matchRange:null,find:function(J,K,L,M,N,O){var X=this;if(!X.matchRange)X.matchRange=new y(new x(X.searchRange),J.length);else X.matchRange=X.matchRange.getNextCharacterRange(J.length);var P=new E(J,!K),Q=B,R='%';while(R!==null){X.matchRange.moveNext();while(R=X.matchRange.getEndCharacter()){Q=P.feedCharacter(R);if(Q==D)break;if(X.matchRange.moveNext().hitMatchBoundary)P.reset();}if(Q==D){var S=X.matchRange.getCursors(),T=S[S.length-1],U=S[0],V=new x(A(U),true),W=new x(z(T),true);if(!(G(V.back().character)&&G(W.next().character)))continue;X.matchRange.setMatched();if(N!==false)X.matchRange.highlightx();return X.matchRange;}}if(M&&!O){X.searchRange=u(1);X.matchRange=null;return arguments.callee.apply(X,Array.prototype.slice.call(arguments).concat([true]));}return false;}},I=v.lang.findAndReplace;return H;};function u(v,w){var x,y=w.getSelection(),z=w.document.getBody();if(y&&!v){x=y.getRanges()[0].clone();x.collapse(true);}else{x=new d.range();x.setStartAt(z,1);}x.setEndAt(z,2);return x;};j.add('ljspell',{options:{classNames:{wordActive:'active',area:'b-spelling-textarea',skipError:'b-spelling-item-skip',bubbleContainer:'b-spelling-bubble',bubbleNoSuggestions:'b-spelling-item-no'},selectors:{bubbleItem:'.b-spelling-item',fake:'.b-spelling-faketextarea',error:'.b-spelling-error'},tmpl:{spellError:'<span class="b-spelling-word b-spelling-error" data-id="{id}"><span class="b-spelling-inner">{word}</span></span>',wrapper:'<div class="b-spelling"><div class="b-spelling-faketextarea"></div></div>',bubble:'<div class="b-spelling-bubble-container"></div>',bubbleList:'<ul class="b-spelling-items">{items}</ul>',bubbleItem:'<li class="b-spelling-item"><span class="b-spelling-item-word">{word}</span></li>',bubbleItemNoSuggestions:'<li class="b-spelling-item b-spelling-item-no"><span class="b-spelling-item-word">'+LiveJournal.getLocalizedStr('widget.form.no_suggestions')+'</span></li>'},enabled:false},init:function(v){var w=this,x='LJSpell',y;
-y=(function(z){var A,B,C;return{save:function(){A=z.getSelection();B=A.getRanges()[0];C=B.createBookmark(true);z.focusManager.blur();z.focusManager.forceBlur();},restore:function(){A.unlock();B.moveToBookmark(C);z.getSelection().selectRanges([B]);}};})(v);v.on('contentDom',function(){var z=m(this.document.getBody().$),A=m('#cke_ck'),B=w.options,C=m(B.tmpl.bubble);C.bubble({showOn:'click',alwaysShowUnderTarget:true,classNames:{containerAddClass:B.classNames.bubbleContainer}});z.on('click','span[data-incorrect]',function(D){var E=m(this),F=E.data('word'),G=a.ljspell.getSuggestions(F).map(function(I){return B.tmpl.bubbleItem.supplant({word:I});}),H=null;if(G.length===0)G.push(B.tmpl.bubbleItemNoSuggestions);Function.defer(function(){C.html(B.tmpl.bubbleList.supplant({items:G.join('')})).off('click').on('click',B.selectors.bubbleItem,function(){C.bubble('hide');if(m(this).hasClass(B.classNames.bubbleNoSuggestions))return;H=z.find('span[data-id="'+E.data('id')+'"]');H.first().replaceWith(m(this).text());if(H.length>1)H.slice(1).detach();}).bubble('hide').bubble('show',A).bubble('absolute',D.clientX,D.clientY+A.offset().top+60);});D.preventDefault();});a.ljspell.init();});a.ljspell=(function(z,A){var B=false,C=0,D=false,E=t(z),F=LiveJournal.getAjaxUrl('spellcheck'),G={},H=[],I={},J=null,K=null,L=1000,M=null;function N(Y){var Z=[];E.searchRange=u(1,z);E.matchRange=null;while((range=E.find(Y,false,false,false))!==false)Z.push(range);return Z;};function O(Y){D=Y;if(!J)J=m('.cke_button_'+x);J.toggleClass('active',D);};function P(Y){var Z=[],aa=null;Y=Y.trim().toLowerCase();if(Y.trim().length===0)return[];aa=Y.replace(/\&nbsp;/ig,' ').match(/[a-zа-яё]+/gi);if(aa)return aa.reduce(function(ab,ac){if(ab.indexOf(ac)===-1)ab.push(ac);return ab;},[]);else return[];};function Q(){var Y=m(z.document.getBody().$).text(),Z=P(Y);S(Z);return Z;};function R(Y){Y.forEach(function(Z){G[Z]=true;});};function S(Y){H=H.filter(function(Z){return Y.indexOf(Z)!==-1;});Y.forEach(function(Z){if(I.hasOwnProperty(Z)&&H.indexOf(Z)===-1)H.push(Z);});};function T(){var Y=Q();Y=Y.filter(function(Z){return!G[Z];});if(Y.length>0){R(Y);return Y;}else return false;return Y.length>0?Y:false;};function U(){var Y=T();if(!Y)return;m.ajax({url:F,type:'POST',dataType:'json',data:{html:Y.join(' ')},async:false,success:function(Z){var aa=Object.keys(Z.words);if(aa.length){m.extend(I,Z.words);H=H.concat(aa);}}});};function V(Y){var Z=this,aa=null;if(!D)return;setTimeout(function(){A.save();aa=s._.definition.attributes;
-aa['data-word']=Y;N(Y).forEach(function(ab){C+=1;aa['data-id']=C;ab.highlight();});A.restore();},0);};function W(){U();X();H.forEach(V);};function X(){if(C===0)return;A.save();m(z.document.getBody().$).find('span[data-incorrect]').each(function(Y,Z){var aa=m(Z);aa.replaceWith(aa.html());});A.restore();C=0;};M={init:function(){if(!B){O(D);if(D)setTimeout(W,1000);B=true;}},on:function(){O(true);W();},off:function(){O(false);X();},isEnabled:function(){return D;},toggle:function(){O(!D);},highlightWord:V,highlight:W,removeHighlight:X,change:function(){if(K)clearTimeout(K);K=setTimeout(function(){if(D)W();else X();},L);},getSuggestions:function(Y){return I[Y]||[];},getWordRanges:N,debug:function(){LJ.console.log('--- already used words');LJ.console.log(Object.keys(G));LJ.console.log('--- words that are in the editor');LJ.console.log(Q());LJ.console.log('--- new words in the editor');LJ.console.log(T());LJ.console.log('--- current incorrect words');LJ.console.log(H);}};return M;})(v,y);v.dataProcessor.htmlFilter.addRules({elements:{span:function(z){if(z.attributes['data-incorrect']||z.attributes['data-id']){delete z.name;var A=z.children[0];if(A)A.value=A.value.replace(/\&nbsp;/,' ');return z;}}}});v.on('change',a.ljspell.change);v.addCommand(x,{exec:function(z){a.ljspell.toggle();},editorFocus:false});v.ui.addButton(x,{command:x});}});})(jQuery,window);(function(){function m(o){var p=o.getStyle('overflow-y'),q=o.getDocument(),r=h.createFromHtml('<span style="margin:0;padding:0;border:0;clear:both;width:1px;height:1px;display:block;">'+(b.webkit?'&nbsp;':'')+'</span>',q);q[c?'getBody':'getDocumentElement']().append(r);var s=r.getDocumentPosition(q).y+r.$.offsetHeight;r.remove();o.setStyle('overflow-y',p);return s;};var n=function(o){if(!o.window)return;var p=o.document,q=new h(p.getWindow().$.frameElement),r=p.getBody(),s=p.getDocumentElement(),t=o.window.getViewPaneSize().height,u=p.$.compatMode=='BackCompat'?r:s,v=m(u);v+=o.config.autoGrow_bottomSpace||0;var w=o.config.autoGrow_minHeight!=undefined?o.config.autoGrow_minHeight:200,x=o.config.autoGrow_maxHeight||Infinity;v=Math.max(v,w);v=Math.min(v,x);if(v!=t){v=o.fire('autoGrow',{currentHeight:t,newHeight:v}).newHeight;o.resize(o.container.getStyle('width'),v,true);}if(u.$.scrollHeight>u.$.clientHeight&&v<x)u.setStyle('overflow-y','hidden');else u.removeStyle('overflow-y');};j.add('autogrow',{init:function(o){o.addCommand('autogrow',{exec:n,modes:{wysiwyg:1},readOnly:1,canUndo:false,editorFocus:false});var p={contentDom:1,key:1,selectionChange:1,insertElement:1};
-o.config.autoGrow_onStartup&&(p.instanceReady=1);for(var q in p)o.on(q,function(r){var s=o.getCommand('maximize');if(r.editor.mode=='wysiwyg'&&(!s||s.state!=1))setTimeout(function(){n(r.editor);n(r.editor);},100);});}});})();j.add('colorbutton',{requires:['panelbutton','floatpanel','styles'],init:function(m){var n=m.config,o=m.lang.colorButton,p;if(!b.hc){q('TextColor','fore',o.textColorTitle);q('BGColor','back',o.bgColorTitle);}function q(t,u,v){var w=e.getNextId()+'_colorBox';m.ui.add(t,'panelbutton',{label:v,title:v,className:'cke_button_'+t.toLowerCase(),modes:{wysiwyg:1},panel:{css:m.skin.editor.css,attributes:{role:'listbox','aria-label':o.panelTitle}},onBlock:function(x,y){y.autoSize=true;y.element.addClass('cke_colorblock');y.element.setHtml(r(x,u,w));y.element.getDocument().getBody().setStyle('overflow','hidden');k.fire('ready',this);var z=y.keys,A=m.lang.dir=='rtl';z[A?37:39]='next';z[40]='next';z[9]='next';z[A?39:37]='prev';z[38]='prev';z[2228224+9]='prev';z[32]='click';},onOpen:function(){var x=m.getSelection(),y=x&&x.getStartElement(),z=new d.elementPath(y),A;y=z.block||z.blockLimit||m.document.getBody();do A=y&&y.getComputedStyle(u=='back'?'background-color':'color')||'transparent';while(u=='back'&&A=='transparent'&&y&&(y=y.getParent()));if(!A||A=='transparent')A='#ffffff';this._.panel._.iframe.getFrameDocument().getById(w).setStyle('background-color',A);}});};function r(t,u,v){var w=[],x=n.colorButton_colors.split(','),y=x.length+(n.colorButton_enableMore?2:1),z=e.addFunction(function(F,G){if(F=='?'){var H=arguments.callee;function I(K){this.removeListener('ok',I);this.removeListener('cancel',I);K.name=='ok'&&H(this.getContentElement('picker','selectedColor').getValue(),G);};m.openDialog('colordialog',function(){this.on('ok',I);this.on('cancel',I);});return;}m.focus();t.hide(false);m.fire('saveSnapshot');new a.style(n['colorButton_'+G+'Style'],{color:'inherit'}).remove(m.document);if(F){var J=n['colorButton_'+G+'Style'];J.childRule=G=='back'?function(K){return s(K);}:function(K){return!(K.is('a')||K.getElementsByTag('a').count())||s(K);};new a.style(J,{color:F}).apply(m.document);}m.fire('saveSnapshot');});w.push('<a class="cke_colorauto" _cke_focus=1 hidefocus=true title="',o.auto,'" onclick="CKEDITOR.tools.callFunction(',z,",null,'",u,"');return false;\" href=\"javascript:void('",o.auto,'\')" role="option" aria-posinset="1" aria-setsize="',y,'"><table role="presentation" cellspacing=0 cellpadding=0 width="100%"><tr><td><span class="cke_colorbox" id="',v,'"></span></td><td colspan=7 align=center>',o.auto,'</td></tr></table></a><table role="presentation" cellspacing=0 cellpadding=0 width="100%">');
-for(var A=0;A<x.length;A++){if(A%8===0)w.push('</tr><tr>');var B=x[A].split('/'),C=B[0],D=B[1]||C;if(!B[1])C='#'+C.replace(/^(.)(.)(.)$/,'$1$1$2$2$3$3');var E=m.lang.colors[D]||D;w.push('<td><a class="cke_colorbox" _cke_focus=1 hidefocus=true title="',E,'" onclick="CKEDITOR.tools.callFunction(',z,",'",C,"','",u,"'); return false;\" href=\"javascript:void('",E,'\')" role="option" aria-posinset="',A+2,'" aria-setsize="',y,'"><span class="cke_colorbox" style="background-color:#',D,'"></span></a></td>');}if(n.colorButton_enableMore===undefined||n.colorButton_enableMore)w.push('</tr><tr><td colspan=8 align=center><a class="cke_colormore" _cke_focus=1 hidefocus=true title="',o.more,'" onclick="CKEDITOR.tools.callFunction(',z,",'?','",u,"');return false;\" href=\"javascript:void('",o.more,"')\"",' role="option" aria-posinset="',y,'" aria-setsize="',y,'">',o.more,'</a></td>');w.push('</tr></table>');return w.join('');};function s(t){return t.getAttribute('contentEditable')=='false'||t.getAttribute('data-nostyle');};}});i.colorButton_colors='000,800000,8B4513,2F4F4F,008080,000080,4B0082,696969,B22222,A52A2A,DAA520,006400,40E0D0,0000CD,800080,808080,F00,FF8C00,FFD700,008000,0FF,00F,EE82EE,A9A9A9,FFA07A,FFA500,FFFF00,00FF00,AFEEEE,ADD8E6,DDA0DD,D3D3D3,FFF0F5,FAEBD7,FFFFE0,F0FFF0,F0FFFF,F0F8FF,E6E6FA,FFF';i.colorButton_foreStyle={element:'span',styles:{color:'#(color)'},overrides:[{element:'font',attributes:{color:null}}]};i.colorButton_backStyle={element:'span',styles:{'background-color':'#(color)'}};j.colordialog={init:function(m){m.addCommand('colordialog',new a.dialogCommand('colordialog'));a.dialog.add('colordialog',this.path+'dialogs/colordialog.js');}};j.add('colordialog',j.colordialog);j.add('ljcolor',{requires:['styles'],init:function(m){var n=m.config,o=m.lang.colorButton;function p(s,t){m.focus();m.fire('saveSnapshot');new a.style(n['colorButton_'+t+'Style'],{color:'inherit'}).remove(m.document);if(s){var u=n['colorButton_'+t+'Style'];u.childRule=t=='back'?function(v){return r(v);}:function(v){return!(v.is('a')||v.getElementsByTag('a').count())||r(v);};new a.style(u,{color:s}).apply(m.document);}m.fire('saveSnapshot');};LiveJournal.register_hook('selectedColor',function(s){p(s,'fore');});var q='LJColor';m.ui.addButton(q,{label:o.textColorTitle,command:q});m.addCommand(q,{exec:function(s){s.rteButton(q,'color');}});function r(s){return s.getAttribute('contentEditable')=='false'||s.getAttribute('data-nostyle');};}});i.colorButton_foreStyle={element:'span',styles:{color:'#(color)'},overrides:[{element:'font',attributes:{color:null}}]};
-j.add('ljlink',{init:function(m){m.addCommand('link',new a.dialogCommand('link'));m.addCommand('unlink',new a.unlinkCommand());m.on('selectionChange',function(A){if(m.readOnly)return;var B=m.getCommand('unlink'),C=A.data.path.lastElement&&A.data.path.lastElement.getAscendant('a',true);if(C&&C.getName()=='a'&&C.getAttribute('href')&&C.getChildCount())B.setState(2);else B.setState(0);});var n=/^javascript:/,o=/^mailto:([^?]+)(?:\?(.+))?$/,p=/subject=([^;?:@&=$,\/]*)/,q=/body=([^;?:@&=$,\/]*)/,r=/^#(.*)$/,s=/^((?:http|https|ftp|news):\/\/)?(.*)$/,t=/^(_(?:self|top|parent|blank))$/,u=/^javascript:void\(location\.href='mailto:'\+String\.fromCharCode\(([^)]+)\)(?:\+'(.*)')?\)$/,v=/^javascript:([^(]+)\(([^)]+)\)$/,w=/\s*window.open\(\s*this\.href\s*,\s*(?:'([^']*)'|null)\s*,\s*'([^']*)'\s*\)\s*;\s*return\s*false;*\s*/,x=/(?:^|,)([^=]+)=(\d+|yes|no)/gi,y=function(A,B){var C=B&&(B.data('cke-saved-href')||B.getAttribute('href'))||'',D,E,F,G,H={};if(D=C.match(n))if(emailProtection=='encode')C=C.replace(u,function(Z,aa,ab){return 'mailto:'+String.fromCharCode.apply(String,aa.split(','))+(ab&&unescapeSingleQuote(ab));});else if(emailProtection)C.replace(v,function(Z,aa,ab){if(aa==compiledProtectionFunction.name){H.type='email';var ac=H.email={},ad=/[^,\s]+/g,ae=/(^')|('$)/g,af=ab.match(ad),ag=af.length,ah,ai;for(var aj=0;aj<ag;aj++){ai=decodeURIComponent(unescapeSingleQuote(af[aj].replace(ae,'')));ah=compiledProtectionFunction.params[aj].toLowerCase();ac[ah]=ai;}ac.address=[ac.name,ac.domain].join('@');}});if(!H.type)if(F=C.match(r)){H.type='anchor';H.anchor={};H.anchor.name=H.anchor.id=F[1];}else if(E=C.match(o)){var I=C.match(p),J=C.match(q);H.type='email';var K=H.email={};K.address=E[1];I&&(K.subject=decodeURIComponent(I[1]));J&&(K.body=decodeURIComponent(J[1]));}else if(C&&(G=C.match(s))){H.type='url';H.url={};H.url.protocol=G[1];H.url.url=G[2];}else H.type='url';if(B){var L=B.getAttribute('target');H.target={};H.adv={};if(!L){var M=B.data('cke-pa-onclick')||B.getAttribute('onclick'),N=M&&M.match(w);if(N){H.target.type='popup';H.target.name=N[1];var O;while(O=x.exec(N[2])){if((O[2]=='yes'||O[2]=='1')&&!(O[1] in {height:1,width:1,top:1,left:1}))H.target[O[1]]=true;else if(isFinite(O[2]))H.target[O[1]]=O[2];}}}else{var P=L.match(t);if(P)H.target.type=H.target.name=L;else{H.target.type='frame';H.target.name=L;}}var Q=this,R=function(Z,aa){var ab=B.getAttribute(aa);if(ab!==null)H.adv[Z]=ab||'';};R('advId','id');R('advLangDir','dir');R('advAccessKey','accessKey');H.adv.advName=B.data('cke-saved-name')||B.getAttribute('name')||'';
-R('advLangCode','lang');R('advTabIndex','tabindex');R('advTitle','title');R('advContentType','type');j.link.synAnchorSelector?H.adv.advCSSClasses=getLinkClass(B):R('advCSSClasses','class');R('advCharset','charset');R('advStyles','style');R('advRel','rel');}var S=H.anchors=[],T;if(j.link.emptyAnchorFix){var U=A.document.getElementsByTag('a');for(i=0,count=U.count();i<count;i++){T=U.getItem(i);if(T.data('cke-saved-name')||T.hasAttribute('name'))S.push({name:T.data('cke-saved-name')||T.getAttribute('name'),id:T.getAttribute('id')});}}else{var V=new d.nodeList(A.document.$.anchors);for(var W=0,X=V.count();W<X;W++){T=V.getItem(W);S[W]={name:T.getAttribute('name'),id:T.getAttribute('id')};}}if(j.link.fakeAnchor){var Y=A.document.getElementsByTag('img');for(W=0,X=Y.count();W<X;W++){if(T=j.link.tryRestoreFakeAnchor(A,Y.getItem(W)))S.push({name:T.getAttribute('name'),id:T.getAttribute('id')});}}this.selectedElement=B;return H;};LiveJournal.register_hook('link_response',function(A){var J=this;if(A.length===0){m.execCommand('unlink');delete J.selectedElement;return;}if(A.indexOf('http://')===-1)A='http://'+A;var B={};B['data-cke-saved-href']=A;B.href=A;if(!J.selectedElement){var C=m.getSelection(),D=C.getRanges(true);if(D.length==1&&D[0].collapsed){var E=new d.text(B['data-cke-saved-href'],m.document);D[0].insertNode(E);D[0].selectNodeContents(E);C.selectRanges(D);}var F=new a.style({element:'a',attributes:B});F.type=2;F.apply(m.document);}else{var G=J.selectedElement,H=G.data('cke-saved-href'),I=G.getHtml();G.setAttributes(B);delete J.selectedElement;}});LiveJournal.register_hook('link_hide',function(A){if(this.selectedElement)delete this.selectedElement;});var z='LJLink2';m.addCommand(z,{exec:function(A){var B=A.getSelection(),C=null;if((C=j.link.getSelectedLink(A))&&C.hasAttribute('href'))B.selectElement(C);else C=null;var D='';if(C){var E=y(A,C).url;D=(E.protocol||'http://')+E.url;}A.rteButton(z,'link',{defaultText:D,hasSelectedText:C?true:false,editMode:C?true:false});},editorFocus:false});m.ui.addButton(z,{label:m.lang.link.toolbar,command:z});},afterInit:function(m){var n=m.dataProcessor,o=n&&n.dataFilter,p=n&&n.htmlFilter,q=m._.elementsPath&&m._.elementsPath.filters;if(o)o.addRules({elements:{a:function(r){var s=r.attributes;if(!s.name)return null;var t=!r.children.length;if(j.link.synAnchorSelector){var u=t?'cke_anchor_empty':'cke_anchor',v=s['class'];if(s.name&&(!v||v.indexOf(u)<0))s['class']=(v||'')+' '+u;if(t&&j.link.emptyAnchorFix){s.contenteditable='false';
-s['data-cke-editable']=1;}}else if(j.link.fakeAnchor&&t)return m.createFakeParserElement(r,'cke_anchor','anchor');return null;}}});if(j.link.emptyAnchorFix&&p)p.addRules({elements:{a:function(r){delete r.attributes.contenteditable;}}});if(q)q.push(function(r,s){if(s=='a')if(j.link.tryRestoreFakeAnchor(m,r)||r.getAttribute('name')&&(!r.getAttribute('href')||!r.getChildCount()))return 'anchor';});},requires:['fakeobjects']});j.link={getSelectedLink:function(m){try{var n=m.getSelection();if(n.getType()==3){var o=n.getSelectedElement();if(o.is('a'))return o;}var p=n.getRanges(true)[0];p.shrink(2);var q=p.getCommonAncestor();return q.getAscendant('a',true);}catch(r){return null;}},fakeAnchor:b.opera||b.webkit,synAnchorSelector:c,emptyAnchorFix:c&&b.version<8,tryRestoreFakeAnchor:function(m,n){if(n&&n.data('cke-real-element-type')&&n.data('cke-real-element-type')=='anchor'){var o=m.restoreRealElement(n);if(o.data('cke-saved-name'))return o;}}};a.unlinkCommand=function(){};a.unlinkCommand.prototype={exec:function(m){var n=m.getSelection(),o=n.createBookmarks(),p=n.getRanges(),q,r;for(var s=0;s<p.length;s++){q=p[s].getCommonAncestor(true);r=q.getAscendant('a',true);if(!r)continue;p[s].selectNodeContents(r);}n.selectRanges(p);m.document.$.execCommand('unlink',false,null);n.selectBookmarks(o);},startDisabled:true};a.removeAnchorCommand=function(){};a.removeAnchorCommand.prototype={exec:function(m){var n=m.getSelection(),o=n.createBookmarks(),p;if(n&&(p=n.getSelectedElement())&&(j.link.fakeAnchor&&!p.getChildCount()?j.link.tryRestoreFakeAnchor(m,p):p.is('a')))p.remove(1);else if(p=j.link.getSelectedLink(m))if(p.hasAttribute('href')){p.removeAttributes({name:1,'data-cke-saved-name':1});p.removeClass('cke_anchor');}else p.remove(1);n.selectBookmarks(o);}};(function(){function m(p,q,r,s,t,u,v){var w=p.config,x=t.split(';'),y=[],z={};for(var A=0;A<x.length;A++){var B=x[A];if(B){B=B.split('/');var C={},D=x[A]=B[0];C[r]=y[A]=B[1]||D;z[D]=new a.style(v,C);z[D]._.definition.name=D;}else x.splice(A--,1);}p.ui.addRichCombo(q,{label:s.label,title:s.panelTitle,className:'cke_'+(r=='size'?'fontSize':'font'),panel:{css:p.skin.editor.css.concat(w.contentsCss),multiSelect:false,attributes:{'aria-label':s.panelTitle}},init:function(){this.startGroup(s.panelTitle);for(var E=0;E<x.length;E++){var F=x[E];this.add(F,z[F].buildPreview(),F);}},onClick:function(E){p.focus();p.fire('saveSnapshot');var F=z[E];if(this.getValue()==E)F.remove(p.document);else{var G=p.getSelection(),H=parseFloat(z[E]._.definition.styles['font-size']);
-for(var I in z)z[I].remove(p.document);F.apply(p.document);}p.fire('saveSnapshot');},onRender:function(){p.on('selectionChange',function(E){var F=this.getValue(),G=E.data.path,H=G.elements;for(var I=0,J;I<H.length;I++){J=H[I];for(var K in z){if(z[K].checkElementRemovable(J,true)){if(K!=F)this.setValue(K);return;}}}this.setValue('',u);},this);}});};j.add('ljfont',{requires:['richcombo','styles'],init:function(p){var q=p.config;m(p,'ljFontSize','size',p.lang.fontSize,q.fontSize_sizes,q.fontSize_defaultLabel,q.fontSize_style);}});i.font_style={element:'span',styles:{'font-family':'#(family)'},overrides:[{element:'font',attributes:{face:null}}]};var n={tiny:'0.6em',small:'0.8em',normal:'1.0em',large:'1.4em',huge:'1.8em'};i.fontSize_sizes='';for(var o in n)i.fontSize_sizes+=Site.ml_text['talk.font.'+o]+'/'+n[o]+';';i.fontSize_defaultLabel=Site.ml_text['talk.font.normal'];i.fontSize_style={element:'span',styles:{'font-size':'#(size)'},overrides:[{element:'font',attributes:{size:null}}]};})();a.editorConfig=function(m){j.addExternal('ljcolor','plugins/lj/ljcolor/plugin.js');j.addExternal('ljlink','plugins/lj/ljlink/plugin.js');j.addExternal('ljfont','plugins/lj/ljfont/plugin.js');var n=[Site.page.ljpost?'livejournal':'livejournal_old','ljcolor','ljlink'],o=['ajax','basicstyles','bidi','blockquote','button','colorbutton','colordialog','enterkey','entities','format','htmldataprocessor','keystrokes','list','liststyle','pastefromword','specialchar','tab','table','toolbar','undo','wysiwygarea','onchange'];if(Site.page.ljpost){o.push('autogrow');m.autoGrow_minHeight=400;n.push('ljspell','ljfont');}else o.push('dialog','image','link','font');m.language='ru';m.autoParagraph=false;m.autoUpdateElement=false;m.docType='<!DOCTYPE html>';if(Site.page.ljpost){m.contentsCss='/js/ck/contents_new.css?t='+Site.version;m.styleText=Site.statprefix+'/js/ck/contents_new.css?t='+Site.version;}else{m.contentsCss='/js/ck/contents.css?t='+Site.version;m.styleText=Site.statprefix+'/js/ck/contents.css?t='+Site.version;}m.fillEmptyBlocks=false;if(Site.is_dev_server)m.extraPlugins=n.join(',');else Array.prototype.push.apply(o,n);m.plugins=o.join(',');if(jQuery.browser.msie||jQuery.browser.opera)m.plugins+=',contextmenu';m.contentsLangDirection='ltr';m.fillEmptyBlocks=false;m.tabIndex=41;m.tabSpaces=2;m.startupShowBorders=false;m.toolbarCanCollapse=false;m.disableNativeSpellChecker=true;var p=[];function q(r,s){return r?s:undefined;};if(Site.page.ljpost)p=['Bold','Italic','Underline','Strike','ljFontSize','LJColor','-','LJLink2','LJUserLink','-','LJImage',q(Site.media_embed_enabled,'LJEmbedLink'),'LJCut','LJSpoiler','LJMap','LJLike','LJPollLink','NumberedList','BulletedList','LJJustifyLeft','LJJustifyCenter','LJJustifyRight','LJSpell','Undo','Redo'];
-else p=['Bold','Italic','Underline','Strike','TextColor','FontSize','-','LJLink','LJUserLink','image',q(Site.media_embed_enabled,'LJEmbedLink'),'LJPollLink','LJCutLink','LJCut','LJLike','LJSpoiler','-','UnorderedList','OrderedList','NumberedList','BulletedList','-','LJJustifyLeft','LJJustifyCenter','LJJustifyRight','-','Undo','Redo'];m.toolbar_Full=[p.filter(function(r){return r;})];m.enterMode=2;m.shiftEnterMode=1;m.keystrokes=[[2228224+121,'contextMenu'],[1114112+90,'undo'],[1114112+89,'redo'],[1114112+2228224+90,'redo'],[1114112+76,'link'],[1114112+66,'bold'],[1114112+73,'italic'],[1114112+85,'underline']];m.colorButton_colors='000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,808080,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF';m.fontSize_sizes='smaller;larger;xx-small;x-small;small;medium;large;x-large;xx-large';m.disableObjectResizing=true;m.format_tags='p;h1;h2;h3;h4;h5;h6;pre;address';m.removeFormatTags='b,big,code,del,dfn,em,font,i,ins,kbd,q,samp,small,span,strike,strong,sub,sup,tt,u,var';m.removeFormatAttributes='class,style,lang,width,height,align,hspace,valign';m.coreStyles_bold={element:'b',overrides:'strong'};m.coreStyles_italic={element:'i',overrides:'em'};m.indentClasses=[];m.indentOffset=0;m.pasteFromWordRemoveFontStyles=false;m.pasteFromWordRemoveStyles=false;if(!Site.page.ljpost)m.protectedSource.push(/<lj-poll-\d+\s*\/?>/gi);m.protectedSource.push(/<lj-replace name="first_post"\s*\/?>/gi);};a.editorConfig(i);})();
+y=(function(z){var A,B,C;return{save:function(){A=z.getSelection();B=A.getRanges()[0];C=B.createBookmark(true);z.focusManager.blur();z.focusManager.forceBlur();},restore:function(){A.unlock();B.moveToBookmark(C);z.getSelection().selectRanges([B]);}};})(v);v.on('contentDom',function(){var z=m(this.document.getBody().$),A=m('#cke_ck'),B=w.options,C=m(B.tmpl.bubble);C.bubble({showOn:'click',alwaysShowUnderTarget:true,classNames:{containerAddClass:B.classNames.bubbleContainer}});z.on('click','span[data-incorrect]',function(D){var E=m(this),F=E.data('word'),G=a.ljspell.getSuggestions(F).map(function(I){return B.tmpl.bubbleItem.supplant({word:I});}),H=null;if(G.length===0)G.push(B.tmpl.bubbleItemNoSuggestions);Function.defer(function(){C.html(B.tmpl.bubbleList.supplant({items:G.join('')})).off('click').on('click',B.selectors.bubbleItem,function(){var I=this;C.bubble('hide');if(m(this).hasClass(B.classNames.bubbleNoSuggestions))return;H=z.find('span[data-id="'+E.data('id')+'"]');(function(){var J=h.get(H.first().get(0)),K=new d.range(v.document),L=v.getSelection(),M;L.selectElement(J);L.getRanges()[0].collapse();M=L.getRanges()[0].createBookmark(true);K.moveToBookmark(M);H.first().replaceWith(m(I).text());if(H.length)H.slice(1).detach();setTimeout(function(){if(!v.focusManager.hasFocus)v.focus();L.selectRanges([K]);},0);})();}).bubble('hide').bubble('show',A).bubble('absolute',D.clientX,D.clientY+A.offset().top+60);});D.preventDefault();});a.ljspell.init();});a.ljspell=(function(z,A){var B=false,C=0,D=false,E=t(z),F=LiveJournal.getAjaxUrl('spellcheck'),G={},H=[],I={},J=null,K=null,L=1000,M=null;function N(Y){var Z=[];E.searchRange=u(1,z);E.matchRange=null;while((range=E.find(Y,false,false,false))!==false)Z.push(range);return Z;};function O(Y){D=Y;if(!J)J=m('.cke_button_'+x);J.toggleClass('active',D);};function P(Y){var Z=[],aa=null;Y=Y.trim().toLowerCase();if(Y.trim().length===0)return[];aa=Y.replace(/\&nbsp;/ig,' ').match(/[a-zа-яё]+/gi);if(aa)return aa.reduce(function(ab,ac){if(ab.indexOf(ac)===-1)ab.push(ac);return ab;},[]);else return[];};function Q(){var Y=m('<div />',{html:z.getData()}).text(),Z=P(Y);S(Z);return Z;};function R(Y){Y.forEach(function(Z){G[Z]=true;});};function S(Y){H=H.filter(function(Z){return Y.indexOf(Z)!==-1;});Y.forEach(function(Z){if(I.hasOwnProperty(Z)&&H.indexOf(Z)===-1)H.push(Z);});};function T(){var Y=Q();Y=Y.filter(function(Z){return!G[Z];});if(Y.length>0){R(Y);return Y;}else return false;return Y.length>0?Y:false;};function U(){var Y=T();
+if(!Y)return;m.ajax({url:F,type:'POST',dataType:'json',data:{html:Y.join(' ')},async:false,success:function(Z){var aa=Object.keys(Z.words);if(aa.length){m.extend(I,Z.words);H=H.concat(aa);}}});};function V(Y){var Z=this,aa=null;if(!D)return;setTimeout(function(){A.save();aa=s._.definition.attributes;aa['data-word']=Y;N(Y).forEach(function(ab){C+=1;aa['data-id']=C;ab.highlight();});A.restore();},0);};function W(){U();X();H.forEach(V);};function X(){if(C===0)return;A.save();m(z.document.getBody().$).find('span[data-incorrect]').each(function(Y,Z){var aa=m(Z);aa.replaceWith(aa.html());});A.restore();C=0;};M={init:function(){if(!B){O(D);if(D)setTimeout(W,1000);B=true;}},on:function(){O(true);W();},off:function(){O(false);X();},isEnabled:function(){return D;},toggle:function(){O(!D);},highlightWord:V,highlight:W,removeHighlight:X,change:function(){if(K)clearTimeout(K);K=setTimeout(function(){if(D)W();else X();},L);},getSuggestions:function(Y){return I[Y]||[];},getWordRanges:N,debug:function(){LJ.console.log('--- already used words');LJ.console.log(Object.keys(G));LJ.console.log('--- words that are in the editor');LJ.console.log(Q());LJ.console.log('--- new words in the editor');LJ.console.log(T());LJ.console.log('--- current incorrect words');LJ.console.log(H);}};return M;})(v,y);v.dataProcessor.htmlFilter.addRules({elements:{span:function(z){if(z.attributes['data-incorrect']||z.attributes['data-id']){delete z.name;var A=z.children[0];if(A)A.value=A.value.replace(/\&nbsp;/,' ');return z;}}}});v.on('change',a.ljspell.change);v.addCommand(x,{exec:function(z){a.ljspell.toggle();},editorFocus:false});v.ui.addButton(x,{command:x});}});})(jQuery,window);(function(){function m(o){var p=o.getStyle('overflow-y'),q=o.getDocument(),r=h.createFromHtml('<span style="margin:0;padding:0;border:0;clear:both;width:1px;height:1px;display:block;">'+(b.webkit?'&nbsp;':'')+'</span>',q);q[c?'getBody':'getDocumentElement']().append(r);var s=r.getDocumentPosition(q).y+r.$.offsetHeight;r.remove();o.setStyle('overflow-y',p);return s;};var n=function(o){if(!o.window)return;var p=o.document,q=new h(p.getWindow().$.frameElement),r=p.getBody(),s=p.getDocumentElement(),t=o.window.getViewPaneSize().height,u=p.$.compatMode=='BackCompat'?r:s,v=m(u);v+=o.config.autoGrow_bottomSpace||0;var w=o.config.autoGrow_minHeight!=undefined?o.config.autoGrow_minHeight:200,x=o.config.autoGrow_maxHeight||Infinity;v=Math.max(v,w);v=Math.min(v,x);if(v!=t){v=o.fire('autoGrow',{currentHeight:t,newHeight:v}).newHeight;
+o.resize(o.container.getStyle('width'),v,true);}if(u.$.scrollHeight>u.$.clientHeight&&v<x)u.setStyle('overflow-y','hidden');else u.removeStyle('overflow-y');};j.add('autogrow',{init:function(o){o.addCommand('autogrow',{exec:n,modes:{wysiwyg:1},readOnly:1,canUndo:false,editorFocus:false});var p={contentDom:1,key:1,selectionChange:1,insertElement:1};o.config.autoGrow_onStartup&&(p.instanceReady=1);for(var q in p)o.on(q,function(r){var s=o.getCommand('maximize');if(r.editor.mode=='wysiwyg'&&(!s||s.state!=1))setTimeout(function(){n(r.editor);n(r.editor);},100);});}});})();j.add('colorbutton',{requires:['panelbutton','floatpanel','styles'],init:function(m){var n=m.config,o=m.lang.colorButton,p;if(!b.hc){q('TextColor','fore',o.textColorTitle);q('BGColor','back',o.bgColorTitle);}function q(t,u,v){var w=e.getNextId()+'_colorBox';m.ui.add(t,'panelbutton',{label:v,title:v,className:'cke_button_'+t.toLowerCase(),modes:{wysiwyg:1},panel:{css:m.skin.editor.css,attributes:{role:'listbox','aria-label':o.panelTitle}},onBlock:function(x,y){y.autoSize=true;y.element.addClass('cke_colorblock');y.element.setHtml(r(x,u,w));y.element.getDocument().getBody().setStyle('overflow','hidden');k.fire('ready',this);var z=y.keys,A=m.lang.dir=='rtl';z[A?37:39]='next';z[40]='next';z[9]='next';z[A?39:37]='prev';z[38]='prev';z[2228224+9]='prev';z[32]='click';},onOpen:function(){var x=m.getSelection(),y=x&&x.getStartElement(),z=new d.elementPath(y),A;y=z.block||z.blockLimit||m.document.getBody();do A=y&&y.getComputedStyle(u=='back'?'background-color':'color')||'transparent';while(u=='back'&&A=='transparent'&&y&&(y=y.getParent()));if(!A||A=='transparent')A='#ffffff';this._.panel._.iframe.getFrameDocument().getById(w).setStyle('background-color',A);}});};function r(t,u,v){var w=[],x=n.colorButton_colors.split(','),y=x.length+(n.colorButton_enableMore?2:1),z=e.addFunction(function(F,G){if(F=='?'){var H=arguments.callee;function I(K){this.removeListener('ok',I);this.removeListener('cancel',I);K.name=='ok'&&H(this.getContentElement('picker','selectedColor').getValue(),G);};m.openDialog('colordialog',function(){this.on('ok',I);this.on('cancel',I);});return;}m.focus();t.hide(false);m.fire('saveSnapshot');new a.style(n['colorButton_'+G+'Style'],{color:'inherit'}).remove(m.document);if(F){var J=n['colorButton_'+G+'Style'];J.childRule=G=='back'?function(K){return s(K);}:function(K){return!(K.is('a')||K.getElementsByTag('a').count())||s(K);};new a.style(J,{color:F}).apply(m.document);}m.fire('saveSnapshot');
+});w.push('<a class="cke_colorauto" _cke_focus=1 hidefocus=true title="',o.auto,'" onclick="CKEDITOR.tools.callFunction(',z,",null,'",u,"');return false;\" href=\"javascript:void('",o.auto,'\')" role="option" aria-posinset="1" aria-setsize="',y,'"><table role="presentation" cellspacing=0 cellpadding=0 width="100%"><tr><td><span class="cke_colorbox" id="',v,'"></span></td><td colspan=7 align=center>',o.auto,'</td></tr></table></a><table role="presentation" cellspacing=0 cellpadding=0 width="100%">');for(var A=0;A<x.length;A++){if(A%8===0)w.push('</tr><tr>');var B=x[A].split('/'),C=B[0],D=B[1]||C;if(!B[1])C='#'+C.replace(/^(.)(.)(.)$/,'$1$1$2$2$3$3');var E=m.lang.colors[D]||D;w.push('<td><a class="cke_colorbox" _cke_focus=1 hidefocus=true title="',E,'" onclick="CKEDITOR.tools.callFunction(',z,",'",C,"','",u,"'); return false;\" href=\"javascript:void('",E,'\')" role="option" aria-posinset="',A+2,'" aria-setsize="',y,'"><span class="cke_colorbox" style="background-color:#',D,'"></span></a></td>');}if(n.colorButton_enableMore===undefined||n.colorButton_enableMore)w.push('</tr><tr><td colspan=8 align=center><a class="cke_colormore" _cke_focus=1 hidefocus=true title="',o.more,'" onclick="CKEDITOR.tools.callFunction(',z,",'?','",u,"');return false;\" href=\"javascript:void('",o.more,"')\"",' role="option" aria-posinset="',y,'" aria-setsize="',y,'">',o.more,'</a></td>');w.push('</tr></table>');return w.join('');};function s(t){return t.getAttribute('contentEditable')=='false'||t.getAttribute('data-nostyle');};}});i.colorButton_colors='000,800000,8B4513,2F4F4F,008080,000080,4B0082,696969,B22222,A52A2A,DAA520,006400,40E0D0,0000CD,800080,808080,F00,FF8C00,FFD700,008000,0FF,00F,EE82EE,A9A9A9,FFA07A,FFA500,FFFF00,00FF00,AFEEEE,ADD8E6,DDA0DD,D3D3D3,FFF0F5,FAEBD7,FFFFE0,F0FFF0,F0FFFF,F0F8FF,E6E6FA,FFF';i.colorButton_foreStyle={element:'span',styles:{color:'#(color)'},overrides:[{element:'font',attributes:{color:null}}]};i.colorButton_backStyle={element:'span',styles:{'background-color':'#(color)'}};j.colordialog={init:function(m){m.addCommand('colordialog',new a.dialogCommand('colordialog'));a.dialog.add('colordialog',this.path+'dialogs/colordialog.js');}};j.add('colordialog',j.colordialog);j.add('ljcolor',{requires:['styles'],init:function(m){var n=m.config,o=m.lang.colorButton;function p(s,t){m.focus();m.fire('saveSnapshot');new a.style(n['colorButton_'+t+'Style'],{color:'inherit'}).remove(m.document);if(s){var u=n['colorButton_'+t+'Style'];u.childRule=t=='back'?function(v){return r(v);
+}:function(v){return!(v.is('a')||v.getElementsByTag('a').count())||r(v);};new a.style(u,{color:s}).apply(m.document);}m.fire('saveSnapshot');};LiveJournal.register_hook('selectedColor',function(s){p(s,'fore');});var q='LJColor';m.ui.addButton(q,{label:o.textColorTitle,command:q});m.addCommand(q,{exec:function(s){s.rteButton(q,'color');}});function r(s){return s.getAttribute('contentEditable')=='false'||s.getAttribute('data-nostyle');};}});i.colorButton_foreStyle={element:'span',styles:{color:'#(color)'},overrides:[{element:'font',attributes:{color:null}}]};j.add('ljlink',{init:function(m){m.addCommand('link',new a.dialogCommand('link'));m.addCommand('unlink',new a.unlinkCommand());m.on('selectionChange',function(A){if(m.readOnly)return;var B=m.getCommand('unlink'),C=A.data.path.lastElement&&A.data.path.lastElement.getAscendant('a',true);if(C&&C.getName()=='a'&&C.getAttribute('href')&&C.getChildCount())B.setState(2);else B.setState(0);});var n=/^javascript:/,o=/^mailto:([^?]+)(?:\?(.+))?$/,p=/subject=([^;?:@&=$,\/]*)/,q=/body=([^;?:@&=$,\/]*)/,r=/^#(.*)$/,s=/^((?:http|https|ftp|news):\/\/)?(.*)$/,t=/^(_(?:self|top|parent|blank))$/,u=/^javascript:void\(location\.href='mailto:'\+String\.fromCharCode\(([^)]+)\)(?:\+'(.*)')?\)$/,v=/^javascript:([^(]+)\(([^)]+)\)$/,w=/\s*window.open\(\s*this\.href\s*,\s*(?:'([^']*)'|null)\s*,\s*'([^']*)'\s*\)\s*;\s*return\s*false;*\s*/,x=/(?:^|,)([^=]+)=(\d+|yes|no)/gi,y=function(A,B){var C=B&&(B.data('cke-saved-href')||B.getAttribute('href'))||'',D,E,F,G,H={};if(D=C.match(n))if(emailProtection=='encode')C=C.replace(u,function(Z,aa,ab){return 'mailto:'+String.fromCharCode.apply(String,aa.split(','))+(ab&&unescapeSingleQuote(ab));});else if(emailProtection)C.replace(v,function(Z,aa,ab){if(aa==compiledProtectionFunction.name){H.type='email';var ac=H.email={},ad=/[^,\s]+/g,ae=/(^')|('$)/g,af=ab.match(ad),ag=af.length,ah,ai;for(var aj=0;aj<ag;aj++){ai=decodeURIComponent(unescapeSingleQuote(af[aj].replace(ae,'')));ah=compiledProtectionFunction.params[aj].toLowerCase();ac[ah]=ai;}ac.address=[ac.name,ac.domain].join('@');}});if(!H.type)if(F=C.match(r)){H.type='anchor';H.anchor={};H.anchor.name=H.anchor.id=F[1];}else if(E=C.match(o)){var I=C.match(p),J=C.match(q);H.type='email';var K=H.email={};K.address=E[1];I&&(K.subject=decodeURIComponent(I[1]));J&&(K.body=decodeURIComponent(J[1]));}else if(C&&(G=C.match(s))){H.type='url';H.url={};H.url.protocol=G[1];H.url.url=G[2];}else H.type='url';if(B){var L=B.getAttribute('target');H.target={};H.adv={};
+if(!L){var M=B.data('cke-pa-onclick')||B.getAttribute('onclick'),N=M&&M.match(w);if(N){H.target.type='popup';H.target.name=N[1];var O;while(O=x.exec(N[2])){if((O[2]=='yes'||O[2]=='1')&&!(O[1] in {height:1,width:1,top:1,left:1}))H.target[O[1]]=true;else if(isFinite(O[2]))H.target[O[1]]=O[2];}}}else{var P=L.match(t);if(P)H.target.type=H.target.name=L;else{H.target.type='frame';H.target.name=L;}}var Q=this,R=function(Z,aa){var ab=B.getAttribute(aa);if(ab!==null)H.adv[Z]=ab||'';};R('advId','id');R('advLangDir','dir');R('advAccessKey','accessKey');H.adv.advName=B.data('cke-saved-name')||B.getAttribute('name')||'';R('advLangCode','lang');R('advTabIndex','tabindex');R('advTitle','title');R('advContentType','type');j.link.synAnchorSelector?H.adv.advCSSClasses=getLinkClass(B):R('advCSSClasses','class');R('advCharset','charset');R('advStyles','style');R('advRel','rel');}var S=H.anchors=[],T;if(j.link.emptyAnchorFix){var U=A.document.getElementsByTag('a');for(i=0,count=U.count();i<count;i++){T=U.getItem(i);if(T.data('cke-saved-name')||T.hasAttribute('name'))S.push({name:T.data('cke-saved-name')||T.getAttribute('name'),id:T.getAttribute('id')});}}else{var V=new d.nodeList(A.document.$.anchors);for(var W=0,X=V.count();W<X;W++){T=V.getItem(W);S[W]={name:T.getAttribute('name'),id:T.getAttribute('id')};}}if(j.link.fakeAnchor){var Y=A.document.getElementsByTag('img');for(W=0,X=Y.count();W<X;W++){if(T=j.link.tryRestoreFakeAnchor(A,Y.getItem(W)))S.push({name:T.getAttribute('name'),id:T.getAttribute('id')});}}this.selectedElement=B;return H;};LiveJournal.register_hook('link_response',function(A){var J=this;if(A.length===0){m.execCommand('unlink');delete J.selectedElement;return;}if(A.indexOf('http://')===-1)A='http://'+A;var B={};B['data-cke-saved-href']=A;B.href=A;if(!J.selectedElement){var C=m.getSelection(),D=C.getRanges(true);if(D.length==1&&D[0].collapsed){var E=new d.text(B['data-cke-saved-href'],m.document);D[0].insertNode(E);D[0].selectNodeContents(E);C.selectRanges(D);}var F=new a.style({element:'a',attributes:B});F.type=2;F.apply(m.document);}else{var G=J.selectedElement,H=G.data('cke-saved-href'),I=G.getHtml();G.setAttributes(B);delete J.selectedElement;}});LiveJournal.register_hook('link_hide',function(A){if(this.selectedElement)delete this.selectedElement;});var z='LJLink2';m.addCommand(z,{exec:function(A){var B=A.getSelection(),C=null;if((C=j.link.getSelectedLink(A))&&C.hasAttribute('href'))B.selectElement(C);else C=null;var D='';if(C){var E=y(A,C).url;D=(E.protocol||'http://')+E.url;
+}A.rteButton(z,'link',{defaultText:D,hasSelectedText:C?true:false,editMode:C?true:false});},editorFocus:false});m.ui.addButton(z,{label:m.lang.link.toolbar,command:z});},afterInit:function(m){var n=m.dataProcessor,o=n&&n.dataFilter,p=n&&n.htmlFilter,q=m._.elementsPath&&m._.elementsPath.filters;if(o)o.addRules({elements:{a:function(r){var s=r.attributes;if(!s.name)return null;var t=!r.children.length;if(j.link.synAnchorSelector){var u=t?'cke_anchor_empty':'cke_anchor',v=s['class'];if(s.name&&(!v||v.indexOf(u)<0))s['class']=(v||'')+' '+u;if(t&&j.link.emptyAnchorFix){s.contenteditable='false';s['data-cke-editable']=1;}}else if(j.link.fakeAnchor&&t)return m.createFakeParserElement(r,'cke_anchor','anchor');return null;}}});if(j.link.emptyAnchorFix&&p)p.addRules({elements:{a:function(r){delete r.attributes.contenteditable;}}});if(q)q.push(function(r,s){if(s=='a')if(j.link.tryRestoreFakeAnchor(m,r)||r.getAttribute('name')&&(!r.getAttribute('href')||!r.getChildCount()))return 'anchor';});},requires:['fakeobjects']});j.link={getSelectedLink:function(m){try{var n=m.getSelection();if(n.getType()==3){var o=n.getSelectedElement();if(o.is('a'))return o;}var p=n.getRanges(true)[0];p.shrink(2);var q=p.getCommonAncestor();return q.getAscendant('a',true);}catch(r){return null;}},fakeAnchor:b.opera||b.webkit,synAnchorSelector:c,emptyAnchorFix:c&&b.version<8,tryRestoreFakeAnchor:function(m,n){if(n&&n.data('cke-real-element-type')&&n.data('cke-real-element-type')=='anchor'){var o=m.restoreRealElement(n);if(o.data('cke-saved-name'))return o;}}};a.unlinkCommand=function(){};a.unlinkCommand.prototype={exec:function(m){var n=m.getSelection(),o=n.createBookmarks(),p=n.getRanges(),q,r;for(var s=0;s<p.length;s++){q=p[s].getCommonAncestor(true);r=q.getAscendant('a',true);if(!r)continue;p[s].selectNodeContents(r);}n.selectRanges(p);m.document.$.execCommand('unlink',false,null);n.selectBookmarks(o);},startDisabled:true};a.removeAnchorCommand=function(){};a.removeAnchorCommand.prototype={exec:function(m){var n=m.getSelection(),o=n.createBookmarks(),p;if(n&&(p=n.getSelectedElement())&&(j.link.fakeAnchor&&!p.getChildCount()?j.link.tryRestoreFakeAnchor(m,p):p.is('a')))p.remove(1);else if(p=j.link.getSelectedLink(m))if(p.hasAttribute('href')){p.removeAttributes({name:1,'data-cke-saved-name':1});p.removeClass('cke_anchor');}else p.remove(1);n.selectBookmarks(o);}};(function(){function m(p,q,r,s,t,u,v){var w=p.config,x=t.split(';'),y=[],z={};for(var A=0;A<x.length;A++){var B=x[A];if(B){B=B.split('/');
+var C={},D=x[A]=B[0];C[r]=y[A]=B[1]||D;z[D]=new a.style(v,C);z[D]._.definition.name=D;}else x.splice(A--,1);}p.ui.addRichCombo(q,{label:s.label,title:s.panelTitle,className:'cke_'+(r=='size'?'fontSize':'font'),panel:{css:p.skin.editor.css.concat(w.contentsCss),multiSelect:false,attributes:{'aria-label':s.panelTitle}},init:function(){this.startGroup(s.panelTitle);for(var E=0;E<x.length;E++){var F=x[E];this.add(F,z[F].buildPreview(),F);}},onClick:function(E){p.focus();p.fire('saveSnapshot');var F=z[E];if(this.getValue()==E)F.remove(p.document);else{var G=p.getSelection(),H=parseFloat(z[E]._.definition.styles['font-size']);for(var I in z)z[I].remove(p.document);F.apply(p.document);}p.fire('saveSnapshot');},onRender:function(){p.on('selectionChange',function(E){var F=this.getValue(),G=E.data.path,H=G.elements;for(var I=0,J;I<H.length;I++){J=H[I];for(var K in z){if(z[K].checkElementRemovable(J,true)){if(K!=F)this.setValue(K);return;}}}this.setValue('',u);},this);}});};j.add('ljfont',{requires:['richcombo','styles'],init:function(p){var q=p.config;m(p,'ljFontSize','size',p.lang.fontSize,q.fontSize_sizes,q.fontSize_defaultLabel,q.fontSize_style);}});i.font_style={element:'span',styles:{'font-family':'#(family)'},overrides:[{element:'font',attributes:{face:null}}]};var n={tiny:'0.6em',small:'0.8em',normal:'1.0em',large:'1.4em',huge:'1.8em'};i.fontSize_sizes='';for(var o in n)i.fontSize_sizes+=Site.ml_text['talk.font.'+o]+'/'+n[o]+';';i.fontSize_defaultLabel=Site.ml_text['talk.font.normal'];i.fontSize_style={element:'span',styles:{'font-size':'#(size)'},overrides:[{element:'font',attributes:{size:null}}]};})();a.editorConfig=function(m){j.addExternal('ljcolor','plugins/lj/ljcolor/plugin.js');j.addExternal('ljlink','plugins/lj/ljlink/plugin.js');j.addExternal('ljfont','plugins/lj/ljfont/plugin.js');var n=[Site.page.ljpost?'livejournal':'livejournal_old','ljcolor','ljlink'],o=['ajax','basicstyles','bidi','blockquote','button','colorbutton','colordialog','enterkey','entities','format','htmldataprocessor','keystrokes','list','liststyle','pastefromword','specialchar','tab','table','toolbar','undo','wysiwygarea','onchange'];if(Site.page.ljpost){o.push('autogrow');m.autoGrow_minHeight=400;n.push('ljspell','ljfont');}else o.push('dialog','image','link','font');m.language='ru';m.autoParagraph=false;m.autoUpdateElement=false;m.docType='<!DOCTYPE html>';if(Site.page.ljpost){m.contentsCss='/js/ck/contents_new.css?t='+Site.version;m.styleText=Site.statprefix+'/js/ck/contents_new.css?t='+Site.version;
+}else{m.contentsCss='/js/ck/contents.css?t='+Site.version;m.styleText=Site.statprefix+'/js/ck/contents.css?t='+Site.version;}m.fillEmptyBlocks=false;if(Site.is_dev_server)m.extraPlugins=n.join(',');else Array.prototype.push.apply(o,n);m.plugins=o.join(',');if(jQuery.browser.msie||jQuery.browser.opera)m.plugins+=',contextmenu';m.contentsLangDirection='ltr';m.fillEmptyBlocks=false;m.tabIndex=41;m.tabSpaces=2;m.startupShowBorders=false;m.toolbarCanCollapse=false;m.disableNativeSpellChecker=true;var p=[];function q(r,s){return r?s:undefined;};if(Site.page.ljpost)p=['Bold','Italic','Underline','Strike','ljFontSize','LJColor','-','LJLink2','LJUserLink','-','LJImage',q(Site.media_embed_enabled,'LJEmbedLink'),'LJCut','LJSpoiler','LJMap','LJLike','LJPollLink','NumberedList','BulletedList','LJJustifyLeft','LJJustifyCenter','LJJustifyRight','LJSpell','Undo','Redo'];else p=['Bold','Italic','Underline','Strike','TextColor','FontSize','-','LJLink','LJUserLink','image',q(Site.media_embed_enabled,'LJEmbedLink'),'LJPollLink','LJCutLink','LJCut','LJLike','LJSpoiler','-','UnorderedList','OrderedList','NumberedList','BulletedList','-','LJJustifyLeft','LJJustifyCenter','LJJustifyRight','-','Undo','Redo'];m.toolbar_Full=[p.filter(function(r){return r;})];m.enterMode=2;m.shiftEnterMode=1;m.keystrokes=[[2228224+121,'contextMenu'],[1114112+90,'undo'],[1114112+89,'redo'],[1114112+2228224+90,'redo'],[1114112+76,'link'],[1114112+66,'bold'],[1114112+73,'italic'],[1114112+85,'underline']];m.colorButton_colors='000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,808080,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF';m.fontSize_sizes='smaller;larger;xx-small;x-small;small;medium;large;x-large;xx-large';m.disableObjectResizing=true;m.format_tags='p;h1;h2;h3;h4;h5;h6;pre;address';m.removeFormatTags='b,big,code,del,dfn,em,font,i,ins,kbd,q,samp,small,span,strike,strong,sub,sup,tt,u,var';m.removeFormatAttributes='class,style,lang,width,height,align,hspace,valign';m.coreStyles_bold={element:'b',overrides:'strong'};m.coreStyles_italic={element:'i',overrides:'em'};m.indentClasses=[];m.indentOffset=0;m.pasteFromWordRemoveFontStyles=false;m.pasteFromWordRemoveStyles=false;if(!Site.page.ljpost)m.protectedSource.push(/<lj-poll-\d+\s*\/?>/gi);m.protectedSource.push(/<lj-replace name="first_post"\s*\/?>/gi);};a.editorConfig(i);})();
+

Tags: invis89, js, livejournal, vvasin
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments