spacevillain (spacevillain) wrote in changelog,
spacevillain
spacevillain
changelog

[livejournal] r23512: LJSUP-14692: Autoformat not works in upd...

Committer: atyurin
LJSUP-14692: Autoformat not works in update.bml
U   trunk/htdocs/js/ck/ckeditor.js
U   trunk/htdocs/js/ck/plugins/livejournal/plugin.js
Modified: trunk/htdocs/js/ck/ckeditor.js
===================================================================
--- trunk/htdocs/js/ck/ckeditor.js	2012-12-28 07:38:10 UTC (rev 23511)
+++ trunk/htdocs/js/ck/ckeditor.js	2012-12-28 13:03:07 UTC (rev 23512)
@@ -133,17 +133,18 @@
 if(Q&&Q.checked||R&&!P.htmlOpt&&(R.indexOf(P.abbr)+1||R.indexOf(P.id)+1)){K.push(P.id);L+=P.html;}if(Q&&n[O]&&Q.checked!=n[O].checked)N=true;}L+='</span>';if(K.length){if(M){o.LJLike.node.setAttribute('buttons',K.join(','));o.LJLike.node.setAttribute('lj-content',encodeURIComponent(L));o.LJLike.node.removeAttribute('defaults');}else{M=new h('iframe',t.document);M.setAttribute('lj-class','lj-like');M.setAttribute('class','lj-like-wrap');M.setAttribute('buttons',K.join(','));M.setAttribute('lj-content',encodeURIComponent(L));M.setAttribute('lj-cmd','LJLike');M.setAttribute('frameBorder',0);M.setAttribute('allowTransparency','true');M.setAttribute('defaults',!N);t.insertElement(M);}}else if(M)o.LJLike.node.remove();F.hide();}}),a.dialog.cancelButton];b.mac&&J.reverse();return{title:m.LJLike_name,width:145,height:Site.remote_is_sup?180:145,resizable:false,contents:[{id:'LJLike_Options',elements:[{type:'html',html:D}]}],onShow:function(){var K=t.getCommand('LJLike'),L=E=0,M=K.state==1,N=o.LJLike.node&&o.LJLike.node.getAttribute('buttons');a.note&&a.note.hide(true);for(;L<C;L++){var O=N?!!(N.indexOf(n[L].abbr)+1||N.indexOf(n[L].id)+1):n[L].checked,P=document.getElementById('like-'+n[L].abbr);if(P){if(O&&!M)E++;P.checked=O;}}if(E>0)F.getButton('LJLike_Ok').getElement().removeClass('btn-disabled');},onLoad:function(){F=this;G=F.parts.contents.getElementsByTag('input');for(var K=0;K<C;K++){var L=G.getItem(K);L&&L.on('click',B);}},buttons:J};});t.addCommand('LJLike',new a.dialogCommand('LJLikeDialog'));t.ui.addButton('LJLike',{label:m.LJLike_name,command:'LJLike'});})();},afterInit:function(t){var u=t.dataProcessor;function v(w,x,y,z){z=z||'text';var A=new a.htmlParser.element('iframe');A.attributes['lj-class']=x+' '+x+'-open';A.attributes['class']=x+'-wrap';A.attributes['lj-cmd']=y;A.attributes.frameBorder=0;A.attributes.allowTransparency='true';if(w.attributes.hasOwnProperty(z))A.attributes.text=w.attributes[z];w.children.unshift(A);var B=new a.htmlParser.element('iframe');B.attributes['lj-class']=x+' '+x+'-close';B.attributes['class']=x+'-wrap';B.attributes.frameBorder=0;B.attributes.allowTransparency='true';w.children.push(B);delete w.name;};u.dataFilter.addRules({elements:{'lj-like':function(w){var x=[],y=new a.htmlParser.element('iframe');y.attributes['lj-class']='lj-like';y.attributes['class']='lj-like-wrap';if(w.attributes.hasOwnProperty('style'))y.attributes['lj-style']=w.attributes.style;y.attributes['lj-cmd']='LJLike';y.attributes['lj-content']='<span class="lj-like-wrapper">';
 y.attributes.frameBorder=0;y.attributes.allowTransparency='true';var z=w.attributes.buttons&&w.attributes.buttons.split(',')||n.defaultButtons,A=w.attributes.buttons?true:false,B=z.length;for(var C=0;C<B;C++){var D=z[C].replace(/^\s*([a-z]{2,})\s*$/i,'$1'),E=n[D];if(E&&(A||E.checked)){y.attributes['lj-content']+=encodeURIComponent(E.html);x.push(D);}}if(!w.attributes.buttons)y.attributes.defaults=true;y.attributes['lj-content']+='</span>';y.attributes.buttons=x.join(',');return y;},lj:(function(){function w(x){var y=t.document.getElementsByTag('lj');for(var z=0,A=y.count();z<A;z++){var B=y.getItem(z);if(B){var C=B.getAttribute('user'),D=B.getAttribute('title');if(x==(D?C+':'+D:C)){var E=new h.createFromHtml(p[x],t.document);E.setAttribute('lj-cmd','LJUserLink');B.insertBeforeMe(E);B.remove();}}}t.removeListener('dataReady',w);};return function(x){var y=x.attributes.user;if(!y||!y.length)return;var z=x.attributes.title,A=z?y+':'+z:y;if(p.hasOwnProperty(A)){var B=new a.htmlParser.fragment.fromHtml(p[A]).children[0];B.attributes['lj-cmd']='LJUserLink';return B;}else{var C={username:y};if(z)C.usertitle=z;HTTPReq.getJSON({data:HTTPReq.formEncoded(C),method:'POST',url:Site.siteroot+'/tools/endpoints/ljuser.bml',onError:function(D){alert(D+' "'+y+'"');},onData:function(D){if(D.error)return alert(D.error+' "'+y+'"');if(!D.success)return;p[A]=D.ljuser;D.ljuser=D.ljuser.replace('<span class="useralias-value">*</span>','');if(t.document)w(A);else t.on('dataReady',function(){w(A);});}});}};})(),'lj-map':function(w){var x=new a.htmlParser.element('iframe'),y='',z='',A=Number(w.attributes.width),B=Number(w.attributes.height);if(!isNaN(A)){y+='width:'+A+'px;';z+='width:'+(A-2)+'px;';}if(!isNaN(B)){y+='height:'+B+'px;';z+='height:'+(B-2)+'px;';}if(y.length){x.attributes.style=y;x.attributes['lj-style']=z;}x.attributes['lj-url']=w.attributes.url?encodeURIComponent(w.attributes.url):'';x.attributes['lj-class']='lj-map';x.attributes['class']='lj-map-wrap';x.attributes['lj-content']='<p class="lj-map">map</p>';x.attributes.frameBorder=0;x.attributes.allowTransparency='true';return x;},'lj-raw':function(w){w.name='lj:raw';},'lj-wishlist':function(w){w.name='lj:wishlist';},'lj-template':function(w){var x=new a.htmlParser.element('iframe');x.attributes['lj-class']='lj-template';x.attributes['class']='lj-template-wrap';x.attributes.frameBorder=0;x.attributes.allowTransparency='true';x.attributes['lj-attributes']=encodeURIComponent(LiveJournal.JSON.stringify(w.attributes));return x;
 },'lj-cut':function(w){v(w,'lj-cut','LJCut');},'lj-spoiler':function(w){v(w,'lj-spoiler','LJSpoiler','title');},iframe:function(w){if(w.attributes['lj-class']&&w.attributes['lj-class'].indexOf('lj-')+1==1)return w;var x=new a.htmlParser.element('iframe'),y='',z='',A=Number(w.attributes.width),B=Number(w.attributes.height);if(w.attributes.src.indexOf('kroogi.com')!==-1&&w.attributes.style){var C=w.attributes.style.match(/width:\s([0-9]+)px;/i),D=w.attributes.style.match(/height:\s([0-9]+)px;/i);if(D.length===2&&C.length===2){A=Number(C.pop());B=Number(D.pop());}}if(!isNaN(A)){y+='width:'+A+'px;';z+='width:'+(A-2)+'px;';}if(!isNaN(B)){y+='height:'+B+'px;';z+='height:'+(B-2)+'px;';}if(y.length){x.attributes.style=y;x.attributes['lj-style']=z;}x.attributes['lj-url']=w.attributes.src?encodeURIComponent(w.attributes.src):'';x.attributes['lj-class']='lj-iframe';x.attributes['class']='lj-iframe-wrap';x.attributes['lj-content']='<p class="lj-iframe">iframe</p>';x.attributes.frameBorder=0;x.attributes.allowTransparency='true';return x;},a:function(w){if(w.parent.attributes&&!w.parent.attributes['lj:user'])w.attributes['lj-cmd']='LJLink';},img:function(w){var x=w.parent&&w.parent.parent;if(!x||!x.attributes||!x.attributes['lj:user'])w.attributes['lj-cmd']='image';},div:function(w){if(w.attributes['class']=='lj-cut')v(w,'lj-cut','LJCut');}}},5);u.htmlFilter.addRules({elements:{iframe:function(w){var x=w,y=false,z='text',A=/lj-[a-z]+/i.exec(w.attributes['lj-class']);if(A)A=A[0];else return w;switch(A){case 'lj-like':x=new a.htmlParser.element('lj-like');if(w.attributes.defaults!='true')x.attributes.buttons=w.attributes.buttons;if(w.attributes.hasOwnProperty('lj-style'))x.attributes.style=w.attributes['lj-style'];x.isEmpty=true;x.isOptionalClose=true;break;case 'lj-embed':x=new a.htmlParser.element('lj-embed');x.attributes.id=w.attributes.id;if(w.attributes.hasOwnProperty('source_user'))x.attributes.source_user=w.attributes.source_user;x.children=new a.htmlParser.fragment.fromHtml(decodeURIComponent(w.attributes['lj-data'])).children;x.isOptionalClose=true;break;case 'lj-map':x=new a.htmlParser.element('lj-map');x.attributes.url=decodeURIComponent(w.attributes['lj-url']);w.attributes.style&&(w.attributes.style+';').replace(/([a-z-]+):(.*?);/gi,function(F,G,H){x.attributes[G.toLowerCase()]=parseInt(H);});x.isOptionalClose=x.isEmpty=true;break;case 'lj-iframe':x=new a.htmlParser.element('iframe');x.attributes.src=decodeURIComponent(w.attributes['lj-url']);w.attributes.style&&(w.attributes.style+';').replace(/([a-z-]+):(.*?);/gi,function(F,G,H){x.attributes[G.toLowerCase()]=parseInt(H);
-});x.attributes.frameBorder=0;break;case 'lj-poll':x=new a.htmlParser.fragment.fromHtml(decodeURIComponent(w.attributes['lj-data'])).children[0];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(){'use strict';a.editor.prototype.lightSetData=function(q){this.document.getBody().setHtml(this.dataProcessor.toHtml(q));this.fire('contentDom');};a.editor.prototype.insertCaret=function(){var t=this;t.focus();var q=t.getSelection(),r=q&&q.getRanges()[0];if(!r||!r.collapsed)return false;var s=new h('span');s.setAttribute('id','__rte_focus');s.setText('|');r.insertNode(s);t.dataWithFocus=t.getData();s.remove();};a.editor.prototype.moveFocus=function(q){var r=this;this.focus();setTimeout(function(){var s=r.getSelection(),t=s&&s.getRanges(),u=t&&t[0].startContainer,v=u&&u.getParents(true);if(!u)return;if(q==='end'){u=v[v.length-2].getFirst();if(!u)return;for(;;){var w=u.getNext();if(w==null)break;u=w;}s.selectElement(u);t=s.getRanges();t[0].collapse(false);s.selectRanges(t);}if(q==='start'){var x=new d.range(r.document);
-x.selectNodeContents(r.document.getBody());x.collapse(true);s.selectRanges([x]);}},100);};a.editor.prototype.isFocusAt=function(q){var r=this.getSelection(),s=r.getRanges()[0],t=this.document.getBody();if(q==='end'&&s.checkEndOfBlock())if(t.equals(s.endContainer)||t.getLast().equals(s.endContainer))return true;if(q==='start')throw new Error('Not implemented');return false;};a.editor.prototype.isSelectionCollapsed=function(){var q=this.getSelection(),r=q&&q.getRanges()[0];if(r)return!!r.collapsed;return false;};var m=a.lang[a.lang.detect()]||{};jQuery.extend(m,LJ.pageVar('rtedata'));window.CKLang=a.CKLang=m;a.lang.en.bold=LJ.ml('talk.insertbold');a.lang.en.italic=LJ.ml('talk.insertitalic');a.lang.en.underline=LJ.ml('talk.insertunderline');a.lang.en.strike=LJ.ml('talk.insertstrikethrough');a.lang.en.bulletedlist=LJ.ml('talk.bulletedlist');a.lang.en.numberedlist=LJ.ml('talk.numberedlist');a.lang.en.undo=LJ.ml('talk.undo');a.lang.en.redo=LJ.ml('talk.redo');if(Site.page.ljpost)a.styleText=Site.statprefix+'/js/ck/contents_new.css?t='+Site.version;else a.styleText=Site.statprefix+'/js/ck/contents.css?t='+Site.version;function n(q,r,s){s=s||{};s&&jQuery.extend(s,{fromDoubleClick:this.execFromEditor});LiveJournal.run_hook('rteButton',r,jQuery('.cke_button_'+q),s);this.execFromEditor=false;};var o={LJPollLink:{html:encodeURIComponent(m.Poll_PollWizardNotice+'<br /><a href="#" lj-cmd="LJPollLink">'+m.Poll_PollWizardNoticeLink+'</a>')},LJLike:{html:encodeURIComponent(m.LJLike_WizardNotice+'<br /><a href="#" lj-cmd="LJLike">'+m.LJLike_WizardNoticeLink+'</a>')},LJLink2:{html:encodeURIComponent(m.LJLink_WizardNotice+'<br /><a href="#" lj-cmd="LJLink2">'+m.LJLink_WizardNoticeLink+'</a>')},LJImage:{html:encodeURIComponent(m.LJImage_WizardNotice+'<br /><a href="#" lj-cmd="LJImage">'+m.LJImage_WizardNoticeLink+'</a>')},LJCut:{html:encodeURIComponent(m.LJCut_WizardNotice+'<br /><a href="#" lj-cmd="LJCut">'+m.LJCut_WizardNoticeLink+'</a>')},LJSpoiler:{html:encodeURIComponent(m.LJSpoiler_WizardNotice+'<br /><a href="#" lj-cmd="LJSpoiler">'+m.LJSpoiler_WizardNoticeLink+'</a>')},LJEmbedLink:{},LJMap:{}},p=f;p.$block['lj-template']=1;p.$block['lj-raw']=1;p.$block['lj-cut']=1;p.$block['lj-spoiler']=1;p.$block['lj-poll']=1;p.$block['lj-repost']=1;p.$block['lj-pq']=1;p.$block['lj-pi']=1;p.$nonEditable['lj-template']=1;p.$empty['lj-random']=1;p['lj-template']={};p['lj-map']={};p['lj-repost']={};p['lj-raw']=p.div;p['lj-poll']={'lj-pq':1};p['lj-pq']={'#':1,'lj-pi':1};p['lj-pi']={'#':1};['a','b','em','i','img','strong','u','lj-user'].forEach(function(q){p['lj-pq'][q]=1;
-p['lj-pi'][q]=1;});p.$block.iframe=p.$inline.iframe;delete p.$inline.iframe;e.extend(p['lj-cut']={},p.$block);e.extend(p['lj-spoiler']={},p.$block);e.extend(p['lj-cut'],p.$inline);e.extend(p['lj-spoiler'],p.$inline);e.extend(p.div,p.$block);e.extend(p.$body,p.$block);delete p['lj-cut']['lj-cut'];f.p.iframe=1;f['lj-cut'].iframe=1;f['lj-spoiler'].iframe=1;j.add('livejournal',{init:function(q){q.rteButton=n;q.ljTagsData=o;function r(y){var z=y.data.element||y.data.getTarget();if(z.type!=1)z=z.getParent();while(z){var A=z.getAttribute('lj-cmd');if(o.hasOwnProperty(A)){var B=q.getCommand(A);if(B.state==1){var C=new d.selection(q.document);o[A].node=z.is('body')?new h.get(z.getWindow().$.frameElement):z;C.selectElement(o[A].node);y.data.dialog='';q.execFromEditor=true;q.execCommand(A,true);break;}}z=z.getParent();}};function s(y){var z=this;if(z.$!=q.document.$){z.$.className=(z.frame.getAttribute('lj-class')||'')+' lj-selected';if(z.getAttribute('lj-cmd')=='LJPollLink')z.frame.setStyle('height',z.getDocument().$.body.scrollHeight+'px');q.focus();new d.selection(q.document).selectElement(z.frame);}y.data.getKey()==1&&y.data.preventDefault();};function t(y){if(y.data.getKey()==46){var z=new d.selection(q.document).getRanges(),A=z.length;while(A--)z[A].deleteContents();}};function u(){var B=this;var y=B.$.contentWindow,z=y.document,A=new h.get(z.body);LiveJournal.run_hook('rte_frame_load',B,A);if(A.on&&!Site.page.disabled_input){A.on('dblclick',r);A.on('click',s);A.on('keyup',t);if(B.getAttribute('lj-cmd')=='LJPollLink'&&B.hasAttribute('style'))z.body.className='lj-poll lj-poll-open';}z=new h.get(z);z.frame=A.frame=B;};function v(y){var z=q.document.getElementsByTag('iframe'),A=z.count(),B,C,D,E,F;q.execFromEditor=false;while(A--){B=z.getItem(A),C=B.getAttribute('lj-cmd'),D=B.$.contentWindow,E=D.document,F=B.getAttribute('lj-style')||'';if(!y&&B.getAttribute('data-update')==='false')continue;if(!y&&E&&E.body&&E.body.getAttribute('data-loaded'))continue;B.removeListener('load',u);B.on('load',u);E.open();E.write('<!DOCTYPE html><html style="width: 99%; height: 99%; overflow: hidden;"><head><link rel="stylesheet" href="'+a.styleText+'" /></head>'+'<body data-loaded="true" scroll="no" class="'+(B.getAttribute('lj-class')||'')+'" style="'+F+'" '+(C?'lj-cmd="'+C+'"':'')+'>'+decodeURIComponent(B.getAttribute('lj-content')||'')+'</body>'+'</html>');E.close();}};q.updateFrames=v;q.on('dataReady',function(){setTimeout(v,100);});function w(y){q.fire('updateSnapshot');if(q.onSwitch===true){delete q.onSwitch;
-return;}var z,A=y.name=='click',B=y.name=='selectionChange'||A,C=y.data.element||y.data.getTarget(),D,E;if(A&&(y.data.getKey()===1||y.data.$.button===0))y.data.preventDefault();if(C.type!=1)C=C.getParent();D=C;if(B){var F=q.document.getElementsByTag('iframe'),G,H;if(A&&D.is('iframe')){H=D.$.contentWindow.document.body;H.className=(D.getAttribute('lj-class')||'')+' lj-selected';if(D.getAttribute('lj-cmd')=='LJPollLink')D.setStyle('height',H.scrollHeight+'px');}for(var I=0,J=F.count();I<J;I++){G=F.getItem(I);if(G.$!=D.$){H=G.$.contentWindow.document.body;H.className=G.getAttribute('lj-class')||'';if(G.getAttribute('lj-cmd')=='LJPollLink'&&H.className.indexOf('lj-poll')!=-1)G.removeAttribute('style');}}}do{var K=D.getAttribute('lj-cmd');if(!K&&D.type==1){var L=D.getParent();if(D.is('img')&&!D.hasAttribute('data-user')&&L.getParent()&&!L.getParent().hasAttribute('data-user')){K='LJImage';D.setAttribute('lj-cmd',K);}else if(D.is('a')&&!D.hasAttribute('data-user')&&!L.hasAttribute('lj:user')){K='LJLink2';D.setAttribute('lj-cmd',K);}}if(K&&o.hasOwnProperty(K)){if(B){o[K].node=D;q.getCommand(K).setState(1);}(z||(z={}))[K]={content:o[K].html,node:D};}}while(D=D.getParent());var M;if(B)for(E in o){if(o.hasOwnProperty(E)&&(!z||!z.hasOwnProperty(E))){delete o[E].node;M=q.getCommand(E);if(M)M.setState(2);}}q.fire('updateSnapshot');};var x=(function(){var y='@focus@',z='<input type="hidden" id="__focus"/>';function A(C,D){return C.replace(/<(.|\n)*?>/g,function(E){var F=E;if(F.indexOf(D)!==-1){F=F.replace(D,'');return F+D;}else return E;});};function B(C,D,E){return[C.slice(0,D),E,C.slice(D)].join('');};q.on('contentDom',function(C){var D=C.editor.document.getById('__focus');if(D){this._domBuilt=true;setTimeout(function(){C.editor.focus();var E=C.editor.getSelection();if(E){var F=new d.range(C.editor.document);F.setEndAfter(D);E.selectRanges([F]);}D.remove();q.fire('updateSnapshot');},this._domBuilt?0:100);}});return function(C){var D=Site.page.__htmlLast;if(typeof D==='number'){if(C.length>0)C=A(B(C,D,y),y).replace(y,z);else C=z;delete Site.page.__htmlLast;}return C;};})();(function(){function y(E){return E.slice(-2)=='/>'?E:E.slice(0,-1)+'/>';};function z(E){var F=new Poll(E),G="<div class='lj-poll-inner lj-rtebox-inner'>"+F.outputHTML()+'</div>';return '<iframe class="lj-poll-wrap lj-rtebox" lj-class="lj-poll" frameborder="0" lj-cmd="LJPollLink" allowTransparency="true" lj-data="'+F.outputLJtags()+'" lj-content="'+G+'"></iframe>';};function A(E,F){var G="<div class='lj-poll-inner lj-rtebox-inner'>Poll id: "+F+'</div>';
-return '<iframe class="lj-poll-wrap lj-poll-wrap-done lj-rtebox" lj-class="lj-poll" frameborder="0" lj-cmd="LJPollLink" allowTransparency="true" lj-data="'+escape(E)+'" lj-content="'+G+'" data-disabledPoll="true"></iframe>';};function B(E,F,G){var H="<div class='lj-embed-inner lj-rtebox-inner'>Embed video</div>";return '<iframe class="lj-embed-wrap lj-rtebox" lj-class="lj-embed" frameborder="0" lj-cmd="LJEmbedLink" allowTransparency="true" lj-data="'+encodeURIComponent(G)+'"'+F+'lj-content="'+H+'"></iframe>';};function C(E,F,G,H){return F+G.replace(/\n/g,'')+H;};function D(E,F,G,H){var I=F||G||m.LJRepost_Value,J=H.replace(/"/g,'&quot;');H=J+('<br /><input type="button" value="'+I+'" />').replace(/"/g,'&quot;');return '<iframe class="lj-repost-wrap" lj-class="lj-repost" frameborder="0" allowTransparency="true" lj-text="'+J+'" lj-button="'+I+'" lj-content="'+H+'"></iframe>';};q.dataProcessor.toHtml=function(E,F){E=x(E);E=E.replace(/<lj [^>]*?>/gi,y).replace(/<lj-map [^>]*?>/gi,y).replace(/<lj-template[^>]*?>/gi,y).replace(/(<lj-cut[^>]*?)\/>/gi,'$1>').replace(/<((?!br)[^\s>]+)([^>]*?)\/>/gi,'<$1$2></$1>').replace(/<lj-poll.*?>[\s\S]*?<\/lj-poll>/gi,z).replace(/<lj-poll-([0-9]+)>/gi,A).replace(/<lj-repost\s*(?:button\s*=\s*(?:"([^"]*?)")|(?:"([^']*?)"))?.*?>([\s\S]*?)<\/lj-repost>/gi,D).replace(/<lj-embed(.*?)>([\s\S]*?)<\/lj-embed>/gi,B).replace(/(<lj-raw.*?>)([\s\S]*?)(<\/lj-raw>)/gi,C).replace(/\n/g,'<br/>');E=E.replace(/>\s+<tr/ig,'><tr').replace(/>\s+<\/tr/ig,'></tr').replace(/>\s+<td/ig,'><td').replace(/>\s+<\/td/ig,'></td').replace(/<\/tr>\s+<\/table>/ig,'</tr></table>').replace(/<tr>\n/ig,'<tr>').replace(/\n<\/tr>/ig,'</tr>').replace(/<td>\n/ig,'<td>').replace(/\n<\/td>/ig,'</td>');E=a.htmlDataProcessor.prototype.toHtml.call(this,E,F);if(c)E='<xml:namespace ns="livejournal" prefix="lj" />'+E;return E;};q.dataProcessor.toDataFormat=function(E,F){E=a.htmlDataProcessor.prototype.toDataFormat.call(this,E,F);E=E.replace(/<br\s*\/>/gi,'\n').replace(/&nbsp;</ig,' <').replace(/\>&nbsp;/ig,'> ').replace(/\>&nbsp;\n/ig,'>\n').replace(/\t/g,' ');return E;};})();q.dataProcessor.writer.indentationChars='';q.dataProcessor.writer.lineBreakChars='';q.on('selectionChange',w);q.on('doubleclick',r);q.on('afterCommandExec',v);q.on('dialogHide',v);(function(){var y=/<br\s*\/?>$/i;q.on('paste',function(z){z.data.html=z.data.html.replace(y,'');});})();q.on('paste',function(){setTimeout(function(){v();},0);});q.on('dataReady',function(){if(c){q.document.getBody().on('dragend',v);
-q.document.getBody().on('paste',function(){setTimeout(v,0);});}if(!Site.page.disabled_input){q.document.on('click',w);q.document.on('mouseover',w);q.document.getBody().on('keyup',t);v();}});(function(){var y='LJMap',z='map';LiveJournal.register_hook('map_response',function(A){var B=new h('iframe',q.document),C=425,D=350,E='',F='';if(!isNaN(C)){E+='width:'+C+'px;';F+='width:'+(C-2)+'px;';}if(!isNaN(D)){E+='height:'+D+'px;';F+='height:'+(D-2)+'px;';}var G=o[y].node;if(G)G.setAttributes({'lj-url':A});else{B.setAttributes({'lj-url':A,'class':'lj-map-wrap lj-rtebox','lj-content':'<div class="lj-map-inner lj-rtebox-inner"><p class="lj-map">map</p></div>','lj-cmd':'LJMap','lj-class':'lj-map',frameborder:0,allowTransparency:'true',style:E,'lj-style':F});q.insertElement(B);}v();});q.addCommand(y,{exec:function(){var A=o[y].node;q.rteButton(y,z,{defaultText:A?A.getAttribute('lj-url'):'',editMode:A?true:false});},editorFocus:false});q.ui.addButton(y,{label:LJ.ml('talk.insertmap'),command:y});})();(function(){function y(F,G){G=G===undefined||G;var H,I=o.LJLike.node;if(I){var J=F.getAttribute('lj-style');H=J?J.replace(/text-align:\s*(left|right|center)/i,'$1'):'left';}else if(G)H=F.getComputedStyle('text-align');else{while(!F.hasAttribute||!(F.hasAttribute('align')||F.getStyle('text-align'))){var K=F.getParent();if(!K)break;F=K;}H=F.getStyle('text-align')||F.getAttribute('align')||'';}H&&(H=H.replace(/-moz-|-webkit-|start|auto/i,''));!H&&G&&(H=F.getComputedStyle('direction')=='rtl'?'right':'left');return H;};function z(F){if(F.editor.readOnly)return;var G=F.editor.getCommand(this.name),H=F.data.element;if((H.type==1&&H.hasAttribute('lj-cmd')&&H.getAttribute('lj-cmd'))=='LJLike')G.state=y(H,q.config.useComputedState)==this.value?1:2;else if(!H||H.type!=1||H.getName()=='body'||H.getName()=='iframe')G.state=2;else G.state=y(H,q.config.useComputedState)==this.value?1:2;G.fire('state');};function A(F,G,H){var J=this;J.name=G;J.value=H;var I=F.config.justifyClasses;if(I){switch(H){case 'left':J.cssClassName=I[0];break;case 'center':J.cssClassName=I[1];break;case 'right':J.cssClassName=I[2];break;}J.cssClassRegex=new RegExp('(?:^|\\s+)(?:'+I.join('|')+')(?=$|\\s)');}};function B(F){var G=F.editor,H=new d.range(G.document);H.setStartBefore(F.data.node);H.setEndAfter(F.data.node);var I=new d.walker(H),J;while(J=I.next()){if(J.type==1){var K='text-align',L=G.config.justifyClasses;if(!J.equals(F.data.node)&&J.getDirection()){H.setStartAfter(J);I=new d.walker(H);continue;}if(L)if(J.hasClass(L[0])){J.removeClass(L[0]);
-J.addClass(L[2]);}else if(J.hasClass(L[2])){J.removeClass(L[2]);J.addClass(L[0]);}switch(J.getStyle(K)){case 'left':J.setStyle(K,'right');break;case 'right':J.setStyle(K,'left');break;}}}};A.prototype={exec:function(F){var T=this;var G=F.getSelection(),H=F.config.enterMode;if(!G)return;var I=G.createBookmarks();if(o.LJLike.node)o.LJLike.node.setAttribute('lj-style','text-align: '+T.value);else{var J=G.getRanges(true),K=T.cssClassName,L,M,N=F.config.useComputedState;N=N===undefined||N;for(var O=J.length-1;O>=0;O--){var P=J[O],Q=P.getEnclosedNode();if(Q&&Q.type===1&&Q.is('iframe'))return;L=P.createIterator();L.enlargeBr=H!=2;while(M=L.getNextParagraph(H==1?'p':'div')){M.removeAttribute('align');M.removeStyle('text-align');var R=K&&(M.$.className=e.ltrim(M.$.className.replace(T.cssClassRegex,''))),S=T.state==2&&(!N||y(M,true)!=T.value);if(K){if(S)M.addClass(K);else if(!R)M.removeAttribute('class');}else if(S)M.setStyle('text-align',T.value);}}}F.focus();F.forceNextSelectionCheck();G.selectBookmarks(I);}};var C=new A(q,'LJJustifyLeft','left'),D=new A(q,'LJJustifyCenter','center'),E=new A(q,'LJJustifyRight','right');q.addCommand('LJJustifyLeft',C);q.addCommand('LJJustifyCenter',D);q.addCommand('LJJustifyRight',E);q.ui.addButton('LJJustifyLeft',{label:LJ.ml('talk.justifyleft'),command:'LJJustifyLeft'});q.ui.addButton('LJJustifyCenter',{label:LJ.ml('talk.justifycenter'),command:'LJJustifyCenter'});q.ui.addButton('LJJustifyRight',{label:LJ.ml('talk.justifyright'),command:'LJJustifyRight'});q.on('selectionChange',e.bind(z,C));q.on('selectionChange',e.bind(z,E));q.on('selectionChange',e.bind(z,D));q.on('dirChanged',B);})();},afterInit:function(q){var r=q.dataProcessor;r.dataFilter.addRules({elements:{'lj-map':function(s){var t=new a.htmlParser.element('iframe'),u='',v='',w=Number(s.attributes.width),x=Number(s.attributes.height);if(!isNaN(w)){u+='width:'+w+'px;';v+='width:'+(w-2)+'px;';}if(!isNaN(x)){u+='height:'+x+'px;';v+='height:'+(x-2)+'px;';}if(u.length){t.attributes.style=u;t.attributes['lj-style']=v;}t.attributes['lj-url']=s.attributes.url?encodeURIComponent(s.attributes.url):'';t.attributes['lj-class']='lj-map';t.attributes['class']='lj-map-wrap lj-rtebox';t.attributes['lj-content']='<div class="lj-map-inner lj-rtebox-inner"><p class="lj-map">map</p></div>';t.attributes.frameBorder=0;t.attributes.allowTransparency='true';return t;},'lj-raw':function(s){s.name='lj:raw';},'lj-wishlist':function(s){s.name='lj:wishlist';},'lj-template':function(s){var t=new a.htmlParser.element('iframe');
-t.attributes['lj-class']='lj-template';t.attributes['class']='lj-template-wrap';t.attributes.frameBorder=0;t.attributes.allowTransparency='true';t.attributes['lj-attributes']=encodeURIComponent(LiveJournal.JSON.stringify(s.attributes));return t;},iframe:function(s){if(s.attributes['data-update']==='false')return s;function t(B){if(!B)return 'auto';return/px|\%/.test(B)?B:B.replace(B,B+'px');};var u=s.attributes.src;if(s.attributes['lj-class']&&s.attributes['lj-class'].indexOf('lj-')+1==1)return s;var v=new a.htmlParser.element('iframe'),w=Number(s.attributes.width),x=Number(s.attributes.height);if(s.attributes.src&&s.attributes.src.indexOf('kroogi.com')!==-1&&s.attributes.style){var y=s.attributes.style.match(/width:\s([0-9]+)px;/i),z=s.attributes.style.match(/height:\s([0-9]+)px;/i);if(z.length===2&&y.length===2){w=Number(y.pop());x=Number(z.pop());}}v.attributes.style=String.prototype.supplant.call('width: {width}; height: {height};',{width:t(s.attributes.width),height:t(s.attributes.height)});v.attributes['lj-style']='width: 99%; height: 99%;';v.attributes['lj-url']=s.attributes.src?encodeURIComponent(s.attributes.src):'';v.attributes['lj-class']='lj-iframe';v.attributes['class']='lj-iframe-wrap lj-rtebox';v.attributes['lj-content']='<div class="lj-rtebox-inner">iframe</div>';v.attributes.frameBorder=0;v.attributes.allowTransparency='true';var A=LiveJournal.parseMedia(decodeURIComponent(s.attributes.src));if(A&&A.embed){v.attributes['lj-cmd']='LJEmbedLink';v.attributes['data-link']=s.attributes['data-link'];}return v;},a:function(s){if(s.attributes['data-user'])return;if(s.parent&&s.parent.attributes&&!s.parent.attributes['lj:user'])s.attributes['lj-cmd']='LJLink2';},img:function(s){if(s.attributes['data-user'])return;var t=s.parent&&s.parent.parent;if(!t||!s.attributes['data-user']||!t.attributes||!t.attributes['data-user'])s.attributes['lj-cmd']='LJImage';}}},5);r.htmlFilter.addRules({elements:{input:function(s){if(s.attributes&&s.attributes.id==='__focus')return false;return s;}}});r.htmlFilter.addRules({elements:{iframe:function(s){var t=s,u=/lj-[a-z]+/i.exec(s.attributes['lj-class']);if(u)u=u[0];else return s;switch(u){case 'lj-like':t=LiveJournal.run_hook('lj-like-output',s);break;case 'lj-embed':t=LiveJournal.run_hook('lj-embed-output',s);break;case 'lj-map':t=new a.htmlParser.element('lj-map');t.attributes.url=decodeURIComponent(s.attributes['lj-url']);s.attributes.style&&(s.attributes.style+';').replace(/([a-z-]+):(.*?);/gi,function(w,x,y){t.attributes[x.toLowerCase()]=parseInt(y);
-});t.isOptionalClose=t.isEmpty=true;break;case 'lj-iframe':t=new a.htmlParser.element('iframe');t.attributes.src=decodeURIComponent(s.attributes['lj-url']);s.attributes.style&&(s.attributes.style+';').replace(/([a-z-]+):(.*?);/gi,function(w,x,y){t.attributes[x.toLowerCase()]=parseInt(y,10)+(y.slice(-1)==='%'?'%':'');});t.attributes.frameBorder=0;if(s.attributes['data-link'])t.attributes['data-link']=s.attributes['data-link'];break;case 'lj-poll':var v=decodeURIComponent(s.attributes['lj-data']);t=new a.htmlParser.fragment.fromHtml(v).children[0];break;case 'lj-repost':t=new a.htmlParser.element('lj-repost');t.attributes.button=s.attributes['lj-button'];t.children=new a.htmlParser.fragment.fromHtml(s.attributes['lj-text']).children;break;case 'lj-template':t=new a.htmlParser.element('lj-template');t.attributes=LiveJournal.JSON.parse(encodeURIComponent(s.attributes['lj-attributes']));t.isOptionalClose=t.isEmpty=true;break;case 'lj-spoiler':t=LiveJournal.run_hook('lj-spoiler-output',s,u);break;case 'lj-cut':t=LiveJournal.run_hook('lj-cut-output',s,u);break;default:if(!s.children.length)t=false;}return t;},div:function(s){if(!s.children.length)return false;},'lj:raw':function(s){s.name='lj-raw';},'lj:wishlist':function(s){s.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">'+LJ.ml('widget.form.no_suggestions')+'</span></li>',bubbleItemSkip:'<li class="b-spelling-item b-spelling-item-skip"><span class="b-spelling-item-word">'+LJ.ml('widget.form.skip_word')+'</span></li>'},enabled:false},init:function(v){var w=this,x='LJSpell',y;
+});x.attributes.frameBorder=0;break;case 'lj-poll':x=new a.htmlParser.fragment.fromHtml(decodeURIComponent(w.attributes['lj-data'])).children[0];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){'use strict';a.processTextarea=true;function n(u,v){var w;if(u.nodeType===1){if(u=u.firstChild)do{w=u.nextSibling;n(u,v);}while(u=w)}else if(u&&u.nodeType===3)if(typeof v==='function')v(u);};var o=(function(){var u={table:1,tbody:1,tr:1,'lj-poll':1,'lj-pq':1,textarea:1,ul:1,ol:1};return function(v){var w=jQuery('<div>'+v+'</div>');n(w.get(0),function(x){if(x.parentNode&&!u[x.parentNode.nodeName.toLowerCase()])m(x).replaceWith(function(){return x.nodeValue.replace(/\n/ig,'<br>');});});return w.html();};})();function p(u){u=u.replace(/&nbsp;</ig,' <').replace(/\>&nbsp;/ig,'> ').replace(/\>&nbsp;\n/ig,'>\n');return u;};a.editor.prototype.lightSetData=function(u){this.document.getBody().setHtml(this.dataProcessor.toHtml(u));this.fire('contentDom');};a.editor.prototype.insertCaret=function(){var x=this;
+x.focus();var u=x.getSelection(),v=u&&u.getRanges()[0];if(!v||!v.collapsed)return false;var w=new h('span');w.setAttribute('id','__rte_focus');w.setText('|');v.insertNode(w);x.dataWithFocus=x.getData();w.remove();};a.editor.prototype.moveFocus=function(u){var v=this;this.focus();setTimeout(function(){var w=v.getSelection(),x=w&&w.getRanges(),y=x&&x[0].startContainer,z=y&&y.getParents(true);if(!y)return;if(u==='end'){y=z[z.length-2].getFirst();if(!y)return;for(;;){var A=y.getNext();if(A==null)break;y=A;}w.selectElement(y);x=w.getRanges();x[0].collapse(false);w.selectRanges(x);}if(u==='start'){var B=new d.range(v.document);B.selectNodeContents(v.document.getBody());B.collapse(true);w.selectRanges([B]);}},100);};a.editor.prototype.isFocusAt=function(u){var v=this.getSelection(),w=v.getRanges()[0],x=this.document.getBody();if(u==='end'&&w.checkEndOfBlock())if(x.equals(w.endContainer)||x.getLast().equals(w.endContainer))return true;if(u==='start')throw new Error('Not implemented');return false;};a.editor.prototype.isSelectionCollapsed=function(){var u=this.getSelection(),v=u&&u.getRanges()[0];if(v)return!!v.collapsed;return false;};var q=a.lang[a.lang.detect()]||{};jQuery.extend(q,LJ.pageVar('rtedata'));window.CKLang=a.CKLang=q;a.lang.en.bold=LJ.ml('talk.insertbold');a.lang.en.italic=LJ.ml('talk.insertitalic');a.lang.en.underline=LJ.ml('talk.insertunderline');a.lang.en.strike=LJ.ml('talk.insertstrikethrough');a.lang.en.bulletedlist=LJ.ml('talk.bulletedlist');a.lang.en.numberedlist=LJ.ml('talk.numberedlist');a.lang.en.undo=LJ.ml('talk.undo');a.lang.en.redo=LJ.ml('talk.redo');a.styleText=Site.statprefix+'/js/ck/contents_new.css?t='+Site.version;function r(u,v,w){w=w||{};w&&jQuery.extend(w,{fromDoubleClick:this.execFromEditor});LiveJournal.run_hook('rteButton',v,jQuery('.cke_button_'+u),w);this.execFromEditor=false;};var s={LJPollLink:{html:encodeURIComponent(q.Poll_PollWizardNotice+'<br /><a href="#" lj-cmd="LJPollLink">'+q.Poll_PollWizardNoticeLink+'</a>')},LJLike:{html:encodeURIComponent(q.LJLike_WizardNotice+'<br /><a href="#" lj-cmd="LJLike">'+q.LJLike_WizardNoticeLink+'</a>')},LJLink2:{html:encodeURIComponent(q.LJLink_WizardNotice+'<br /><a href="#" lj-cmd="LJLink2">'+q.LJLink_WizardNoticeLink+'</a>')},LJImage:{html:encodeURIComponent(q.LJImage_WizardNotice+'<br /><a href="#" lj-cmd="LJImage">'+q.LJImage_WizardNoticeLink+'</a>')},LJCut:{html:encodeURIComponent(q.LJCut_WizardNotice+'<br /><a href="#" lj-cmd="LJCut">'+q.LJCut_WizardNoticeLink+'</a>')},LJSpoiler:{html:encodeURIComponent(q.LJSpoiler_WizardNotice+'<br /><a href="#" lj-cmd="LJSpoiler">'+q.LJSpoiler_WizardNoticeLink+'</a>')},LJEmbedLink:{},LJMap:{}},t=f;
+t.$block['lj-template']=1;t.$block['lj-raw']=1;t.$block['lj-cut']=1;t.$block['lj-spoiler']=1;t.$block['lj-poll']=1;t.$block['lj-repost']=1;t.$block['lj-pq']=1;t.$block['lj-pi']=1;t.$nonEditable['lj-template']=1;t.$empty['lj-random']=1;t['lj-template']={};t['lj-map']={};t['lj-repost']={};t['lj-raw']=t.div;t['lj-poll']={'lj-pq':1};t['lj-pq']={'#':1,'lj-pi':1};t['lj-pi']={'#':1};['a','b','em','i','img','strong','u','lj-user'].forEach(function(u){t['lj-pq'][u]=1;t['lj-pi'][u]=1;});t.$block.iframe=t.$inline.iframe;delete t.$inline.iframe;e.extend(t['lj-cut']={},t.$block);e.extend(t['lj-spoiler']={},t.$block);e.extend(t['lj-cut'],t.$inline);e.extend(t['lj-spoiler'],t.$inline);e.extend(t.div,t.$block);e.extend(t.$body,t.$block);delete t['lj-cut']['lj-cut'];f['lj-cut'].iframe=1;f['lj-spoiler'].iframe=1;j.add('livejournal',{init:function(u){u.rteButton=r;u.ljTagsData=s;function v(C){var D=C.data.element||C.data.getTarget();if(D.type!=1)D=D.getParent();while(D){var E=D.getAttribute('lj-cmd');if(s.hasOwnProperty(E)){var F=u.getCommand(E);if(F.state==1){var G=new d.selection(u.document);s[E].node=D.is('body')?new h.get(D.getWindow().$.frameElement):D;G.selectElement(s[E].node);C.data.dialog='';u.execFromEditor=true;u.execCommand(E,true);break;}}D=D.getParent();}};function w(C){var D=this;if(D.$!=u.document.$){D.$.className=(D.frame.getAttribute('lj-class')||'')+' lj-selected';if(D.getAttribute('lj-cmd')=='LJPollLink')D.frame.setStyle('height',D.getDocument().$.body.scrollHeight+'px');u.focus();new d.selection(u.document).selectElement(D.frame);}C.data.getKey()==1&&C.data.preventDefault();};function x(C){if(C.data.getKey()==46){var D=new d.selection(u.document).getRanges(),E=D.length;while(E--)D[E].deleteContents();}};function y(){var F=this;var C=F.$.contentWindow,D=C.document,E=new h.get(D.body);LiveJournal.run_hook('rte_frame_load',F,E);if(E.on&&!Site.page.disabled_input){E.on('dblclick',v);E.on('click',w);E.on('keyup',x);if(F.getAttribute('lj-cmd')=='LJPollLink'&&F.hasAttribute('style'))D.body.className='lj-poll lj-poll-open';}D=new h.get(D);D.frame=E.frame=F;};function z(C){var D=u.document.getElementsByTag('iframe'),E=D.count(),F,G,H,I,J;u.execFromEditor=false;while(E--){F=D.getItem(E),G=F.getAttribute('lj-cmd'),H=F.$.contentWindow,I=H.document,J=F.getAttribute('lj-style')||'';if(!C&&F.getAttribute('data-update')==='false')continue;if(!C&&I&&I.body&&I.body.getAttribute('data-loaded'))continue;F.removeListener('load',y);F.on('load',y);I.open();I.write('<!DOCTYPE html><html style="width: 99%; height: 99%; overflow: hidden;"><head><link rel="stylesheet" href="'+a.styleText+'" /></head>'+'<body data-loaded="true" scroll="no" class="'+(F.getAttribute('lj-class')||'')+'" style="'+J+'" '+(G?'lj-cmd="'+G+'"':'')+'>'+decodeURIComponent(F.getAttribute('lj-content')||'')+'</body>'+'</html>');
+I.close();}};u.updateFrames=z;u.on('dataReady',function(){setTimeout(z,100);});function A(C){u.fire('updateSnapshot');if(u.onSwitch===true){delete u.onSwitch;return;}var D,E=C.name=='click',F=C.name=='selectionChange'||E,G=C.data.element||C.data.getTarget(),H,I;if(E&&(C.data.getKey()===1||C.data.$.button===0))C.data.preventDefault();if(G.type!=1)G=G.getParent();H=G;if(F){var J=u.document.getElementsByTag('iframe'),K,L;if(E&&H.is('iframe')){L=H.$.contentWindow.document.body;L.className=(H.getAttribute('lj-class')||'')+' lj-selected';if(H.getAttribute('lj-cmd')=='LJPollLink')H.setStyle('height',L.scrollHeight+'px');}for(var M=0,N=J.count();M<N;M++){K=J.getItem(M);if(K.$!=H.$){L=K.$.contentWindow.document.body;L.className=K.getAttribute('lj-class')||'';if(K.getAttribute('lj-cmd')=='LJPollLink'&&L.className.indexOf('lj-poll')!=-1)K.removeAttribute('style');}}}do{var O=H.getAttribute('lj-cmd');if(!O&&H.type==1){var P=H.getParent();if(H.is('img')&&!H.hasAttribute('data-user')&&P.getParent()&&!P.getParent().hasAttribute('data-user')){O='LJImage';H.setAttribute('lj-cmd',O);}else if(H.is('a')&&!H.hasAttribute('data-user')&&!P.hasAttribute('lj:user')){O='LJLink2';H.setAttribute('lj-cmd',O);}}if(O&&s.hasOwnProperty(O)){if(F){s[O].node=H;u.getCommand(O).setState(1);}(D||(D={}))[O]={content:s[O].html,node:H};}}while(H=H.getParent());var Q;if(F)for(I in s){if(s.hasOwnProperty(I)&&(!D||!D.hasOwnProperty(I))){delete s[I].node;Q=u.getCommand(I);if(Q)Q.setState(2);}}u.fire('updateSnapshot');};var B=(function(){var C='@focus@',D='<input type="hidden" id="__focus"/>';function E(G,H){return G.replace(/<(.|\n)*?>/g,function(I){var J=I;if(J.indexOf(H)!==-1){J=J.replace(H,'');return J+H;}else return I;});};function F(G,H,I){return[G.slice(0,H),I,G.slice(H)].join('');};u.on('contentDom',function(G){var H=G.editor.document.getById('__focus');if(H){this._domBuilt=true;setTimeout(function(){G.editor.focus();var I=G.editor.getSelection();if(I){var J=new d.range(G.editor.document);J.setEndAfter(H);I.selectRanges([J]);}H.remove();u.fire('updateSnapshot');},this._domBuilt?0:100);}});return function(G){var H=Site.page.__htmlLast;if(typeof H==='number'){if(G.indexOf('textarea')!==-1)return G;if(G.length>0)G=E(F(G,H,C),C).replace(C,D);else G=D;delete Site.page.__htmlLast;}return G;};})();(function(){function C(I){return I.slice(-2)=='/>'?I:I.slice(0,-1)+'/>';};function D(I){var J=new Poll(I),K="<div class='lj-poll-inner lj-rtebox-inner'>"+J.outputHTML()+'</div>';return '<iframe class="lj-poll-wrap lj-rtebox" lj-class="lj-poll" frameborder="0" lj-cmd="LJPollLink" allowTransparency="true" lj-data="'+J.outputLJtags()+'" lj-content="'+K+'"></iframe>';
+};function E(I,J){var K="<div class='lj-poll-inner lj-rtebox-inner'>Poll id: "+J+'</div>';return '<iframe class="lj-poll-wrap lj-poll-wrap-done lj-rtebox" lj-class="lj-poll" frameborder="0" lj-cmd="LJPollLink" allowTransparency="true" lj-data="'+escape(I)+'" lj-content="'+K+'" data-disabledPoll="true"></iframe>';};function F(I,J,K){var L="<div class='lj-embed-inner lj-rtebox-inner'>Embed video</div>";return '<iframe class="lj-embed-wrap lj-rtebox" lj-class="lj-embed" frameborder="0" lj-cmd="LJEmbedLink" allowTransparency="true" lj-data="'+encodeURIComponent(K)+'"'+J+'lj-content="'+L+'"></iframe>';};function G(I,J,K,L){return J+K.replace(/\n/g,'')+L;};function H(I,J,K,L){var M=J||K||q.LJRepost_Value,N=L.replace(/"/g,'&quot;');L=N+('<br /><input type="button" value="'+M+'" />').replace(/"/g,'&quot;');return '<iframe class="lj-repost-wrap" lj-class="lj-repost" frameborder="0" allowTransparency="true" lj-text="'+N+'" lj-button="'+M+'" lj-content="'+L+'"></iframe>';};u.dataProcessor.toHtml=function(I,J){var K=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi;I=I.replace(K,'<$1></$2>');I=B(I);I=o(I);I=I.replace(/<lj [^>]*?>/gi,C).replace(/<lj-map [^>]*?>/gi,C).replace(/<lj-template[^>]*?>/gi,C).replace(/(<lj-cut[^>]*?)\/>/gi,'$1>').replace(/<((?!br)[^\s>]+)([^>]*?)\/>/gi,'<$1$2></$1>').replace(/<lj-poll.*?>[\s\S]*?<\/lj-poll>/gi,D).replace(/<lj-poll-([0-9]+)>/gi,E).replace(/<lj-repost\s*(?:button\s*=\s*(?:"([^"]*?)")|(?:"([^']*?)"))?.*?>([\s\S]*?)<\/lj-repost>/gi,H).replace(/<lj-embed(.*?)>([\s\S]*?)<\/lj-embed>/gi,F).replace(/(<lj-raw.*?>)([\s\S]*?)(<\/lj-raw>)/gi,G);I=a.htmlDataProcessor.prototype.toHtml.call(this,I,J);if(c)I='<xml:namespace ns="livejournal" prefix="lj" />'+I;return I;};u.dataProcessor.toDataFormat=function(I,J){I=a.htmlDataProcessor.prototype.toDataFormat.call(this,I,J);I=p(I);I=I.replace(/<br\s*\/>/gi,'').replace(/\t/g,' ');var K={html:I};LiveJournal.run_hook('html_output',K);return K.html;};})();u.dataProcessor.writer.indentationChars='';u.dataProcessor.writer.lineBreakChars='\n';['p','span','div','a','table','tbody','iframe','lj','lj-cut','lj-spoiler','h1','h2','h3','h4','h5','h6','lj-poll','lj-pq','lj-pi'].forEach(function(C){u.dataProcessor.writer.setRules(C,{indent:false,breakBeforeOpen:false,breakAfterOpen:false,breakBeforeClose:false,breakAfterClose:false});});['td'].forEach(function(C){u.dataProcessor.writer.setRules(C,{indent:false,breakBeforeOpen:true,breakAfterOpen:false,breakBeforeClose:false,breakAfterClose:true});
+});['tr'].forEach(function(C){u.dataProcessor.writer.setRules(C,{indent:false,breakBeforeOpen:true,breakAfterOpen:true,breakBeforeClose:true,breakAfterClose:true});});u.on('selectionChange',A);u.on('doubleclick',v);u.on('afterCommandExec',z);u.on('dialogHide',z);(function(){var C=/<br\s*\/?>$/i;u.on('paste',function(D){D.data.html=D.data.html.replace(C,'');});})();u.on('paste',function(){setTimeout(function(){z();},0);});u.on('dataReady',function(){if(c){u.document.getBody().on('dragend',z);u.document.getBody().on('paste',function(){setTimeout(z,0);});}if(!Site.page.disabled_input){u.document.on('click',A);u.document.on('mouseover',A);u.document.getBody().on('keyup',x);z();}});(function(){var C='LJMap',D='map';LiveJournal.register_hook('map_response',function(E){var F=new h('iframe',u.document),G=425,H=350,I='',J='';if(!isNaN(G)){I+='width:'+G+'px;';J+='width:'+(G-2)+'px;';}if(!isNaN(H)){I+='height:'+H+'px;';J+='height:'+(H-2)+'px;';}var K=s[C].node;if(K)K.setAttributes({'lj-url':E});else{F.setAttributes({'lj-url':E,'class':'lj-map-wrap lj-rtebox','lj-content':'<div class="lj-map-inner lj-rtebox-inner"><p class="lj-map">map</p></div>','lj-cmd':'LJMap','lj-class':'lj-map',frameborder:0,allowTransparency:'true',style:I,'lj-style':J});u.insertElement(F);}z();});u.addCommand(C,{exec:function(){var E=s[C].node;u.rteButton(C,D,{defaultText:E?E.getAttribute('lj-url'):'',editMode:E?true:false});},editorFocus:false});u.ui.addButton(C,{label:LJ.ml('talk.insertmap'),command:C});})();(function(){function C(J,K){K=K===undefined||K;var L,M=s.LJLike.node;if(M){var N=J.getAttribute('lj-style');L=N?N.replace(/text-align:\s*(left|right|center)/i,'$1'):'left';}else if(K)L=J.getComputedStyle('text-align');else{while(!J.hasAttribute||!(J.hasAttribute('align')||J.getStyle('text-align'))){var O=J.getParent();if(!O)break;J=O;}L=J.getStyle('text-align')||J.getAttribute('align')||'';}L&&(L=L.replace(/-moz-|-webkit-|start|auto/i,''));!L&&K&&(L=J.getComputedStyle('direction')=='rtl'?'right':'left');return L;};function D(J){if(J.editor.readOnly)return;var K=J.editor.getCommand(this.name),L=J.data.element;if((L.type==1&&L.hasAttribute('lj-cmd')&&L.getAttribute('lj-cmd'))=='LJLike')K.state=C(L,u.config.useComputedState)==this.value?1:2;else if(!L||L.type!=1||L.getName()=='body'||L.getName()=='iframe')K.state=2;else K.state=C(L,u.config.useComputedState)==this.value?1:2;K.fire('state');};function E(J,K,L){var N=this;N.name=K;N.value=L;var M=J.config.justifyClasses;if(M){switch(L){case 'left':N.cssClassName=M[0];
+break;case 'center':N.cssClassName=M[1];break;case 'right':N.cssClassName=M[2];break;}N.cssClassRegex=new RegExp('(?:^|\\s+)(?:'+M.join('|')+')(?=$|\\s)');}};function F(J){var K=J.editor,L=new d.range(K.document);L.setStartBefore(J.data.node);L.setEndAfter(J.data.node);var M=new d.walker(L),N;while(N=M.next()){if(N.type==1){var O='text-align',P=K.config.justifyClasses;if(!N.equals(J.data.node)&&N.getDirection()){L.setStartAfter(N);M=new d.walker(L);continue;}if(P)if(N.hasClass(P[0])){N.removeClass(P[0]);N.addClass(P[2]);}else if(N.hasClass(P[2])){N.removeClass(P[2]);N.addClass(P[0]);}switch(N.getStyle(O)){case 'left':N.setStyle(O,'right');break;case 'right':N.setStyle(O,'left');break;}}}};E.prototype={exec:function(J){var X=this;var K=J.getSelection(),L=J.config.enterMode;if(!K)return;var M=K.createBookmarks();if(s.LJLike.node)s.LJLike.node.setAttribute('lj-style','text-align: '+X.value);else{var N=K.getRanges(true),O=X.cssClassName,P,Q,R=J.config.useComputedState;R=R===undefined||R;for(var S=N.length-1;S>=0;S--){var T=N[S],U=T.getEnclosedNode();if(U&&U.type===1&&U.is('iframe'))return;P=T.createIterator();P.enlargeBr=L!=2;while(Q=P.getNextParagraph(L==1?'p':'div')){Q.removeAttribute('align');Q.removeStyle('text-align');var V=O&&(Q.$.className=e.ltrim(Q.$.className.replace(X.cssClassRegex,''))),W=X.state==2&&(!R||C(Q,true)!=X.value);if(O){if(W)Q.addClass(O);else if(!V)Q.removeAttribute('class');}else if(W)Q.setStyle('text-align',X.value);}}}J.focus();J.forceNextSelectionCheck();K.selectBookmarks(M);}};var G=new E(u,'LJJustifyLeft','left'),H=new E(u,'LJJustifyCenter','center'),I=new E(u,'LJJustifyRight','right');u.addCommand('LJJustifyLeft',G);u.addCommand('LJJustifyCenter',H);u.addCommand('LJJustifyRight',I);u.ui.addButton('LJJustifyLeft',{label:LJ.ml('talk.justifyleft'),command:'LJJustifyLeft'});u.ui.addButton('LJJustifyCenter',{label:LJ.ml('talk.justifycenter'),command:'LJJustifyCenter'});u.ui.addButton('LJJustifyRight',{label:LJ.ml('talk.justifyright'),command:'LJJustifyRight'});u.on('selectionChange',e.bind(D,G));u.on('selectionChange',e.bind(D,I));u.on('selectionChange',e.bind(D,H));u.on('dirChanged',F);})();},afterInit:function(u){var v=u.dataProcessor;if(a.processTextarea)(function(){var w=/(<textarea[^>]*>)([\s\S.]*)<\/textarea>/;LiveJournal.register_hook('html_output',function(x){x.html=x.html.replace(w,function(y,z,A){A=A.replace(/<br\/>/ig,'\n').replace(/\&#39;/ig,"'").replace(/\&quot;/ig,'"').replace(/\&amp;/ig,'&').replace(/\&lt;/ig,'<').replace(/\&gt;/ig,'>');
+return z+A+'</textarea>';});});v.dataFilter.addRules({elements:{textarea:function(x){x.children[0].value=unescape(x.children[0].value.replace('&lt;cke:encoded&gt;','').replace('&lt;/cke:encoded&gt;','')).replace(/<br\/>/ig,'\n');return x;}}});})();v.dataFilter.addRules({elements:{'lj-map':function(w){var x=new a.htmlParser.element('iframe'),y='',z='',A=Number(w.attributes.width),B=Number(w.attributes.height);if(!isNaN(A)){y+='width:'+A+'px;';z+='width:'+(A-2)+'px;';}if(!isNaN(B)){y+='height:'+B+'px;';z+='height:'+(B-2)+'px;';}if(y.length){x.attributes.style=y;x.attributes['lj-style']=z;}x.attributes['lj-url']=w.attributes.url?encodeURIComponent(w.attributes.url):'';x.attributes['lj-class']='lj-map';x.attributes['class']='lj-map-wrap lj-rtebox';x.attributes['lj-content']='<div class="lj-map-inner lj-rtebox-inner"><p class="lj-map">map</p></div>';x.attributes.frameBorder=0;x.attributes.allowTransparency='true';return x;},'lj-raw':function(w){w.name='lj:raw';},'lj-wishlist':function(w){w.name='lj:wishlist';},'lj-template':function(w){var x=new a.htmlParser.element('iframe');x.attributes['lj-class']='lj-template';x.attributes['class']='lj-template-wrap';x.attributes.frameBorder=0;x.attributes.allowTransparency='true';x.attributes['lj-attributes']=encodeURIComponent(LiveJournal.JSON.stringify(w.attributes));return x;},iframe:function(w){if(w.attributes['data-update']==='false')return w;function x(F){if(!F)return 'auto';return/px|\%/.test(F)?F:F.replace(F,F+'px');};var y=w.attributes.src;if(w.attributes['lj-class']&&w.attributes['lj-class'].indexOf('lj-')+1==1)return w;var z=new a.htmlParser.element('iframe'),A=Number(w.attributes.width),B=Number(w.attributes.height);if(w.attributes.src&&w.attributes.src.indexOf('kroogi.com')!==-1&&w.attributes.style){var C=w.attributes.style.match(/width:\s([0-9]+)px;/i),D=w.attributes.style.match(/height:\s([0-9]+)px;/i);if(D.length===2&&C.length===2){A=Number(C.pop());B=Number(D.pop());}}z.attributes.style=String.prototype.supplant.call('width: {width}; height: {height};',{width:x(w.attributes.width),height:x(w.attributes.height)});z.attributes['lj-style']='width: 99%; height: 99%;';z.attributes['lj-url']=w.attributes.src?encodeURIComponent(w.attributes.src):'';z.attributes['lj-class']='lj-iframe';z.attributes['class']='lj-iframe-wrap lj-rtebox';z.attributes['lj-content']='<div class="lj-rtebox-inner">iframe</div>';z.attributes.frameBorder=0;z.attributes.allowTransparency='true';var E=LiveJournal.parseMedia(decodeURIComponent(w.attributes.src));
+if(E&&E.embed){z.attributes['lj-cmd']='LJEmbedLink';z.attributes['data-link']=w.attributes['data-link'];}return z;},a:function(w){if(w.attributes['data-user'])return;if(w.parent&&w.parent.attributes&&!w.parent.attributes['lj:user'])w.attributes['lj-cmd']='LJLink2';},img:function(w){if(w.attributes['data-user'])return;var x=w.parent&&w.parent.parent;if(!x||!w.attributes['data-user']||!x.attributes||!x.attributes['data-user'])w.attributes['lj-cmd']='LJImage';}}},5);v.htmlFilter.addRules({elements:{input:function(w){if(w.attributes&&w.attributes.id==='__focus')return false;return w;}}});v.htmlFilter.addRules({elements:{iframe:function(w){var x=w,y=/lj-[a-z]+/i.exec(w.attributes['lj-class']);if(y)y=y[0];else return w;switch(y){case 'lj-like':x=LiveJournal.run_hook('lj-like-output',w);break;case 'lj-embed':x=LiveJournal.run_hook('lj-embed-output',w);break;case 'lj-map':x=new a.htmlParser.element('lj-map');x.attributes.url=decodeURIComponent(w.attributes['lj-url']);w.attributes.style&&(w.attributes.style+';').replace(/([a-z-]+):(.*?);/gi,function(A,B,C){x.attributes[B.toLowerCase()]=parseInt(C);});x.isOptionalClose=x.isEmpty=true;break;case 'lj-iframe':x=new a.htmlParser.element('iframe');x.attributes.src=decodeURIComponent(w.attributes['lj-url']);w.attributes.style&&(w.attributes.style+';').replace(/([a-z-]+):(.*?);/gi,function(A,B,C){x.attributes[B.toLowerCase()]=parseInt(C,10)+(C.slice(-1)==='%'?'%':'');});x.attributes.frameBorder=0;if(w.attributes['data-link'])x.attributes['data-link']=w.attributes['data-link'];break;case 'lj-poll':var z=decodeURIComponent(w.attributes['lj-data']);x=new a.htmlParser.fragment.fromHtml(z).children[0];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':x=LiveJournal.run_hook('lj-spoiler-output',w,y);break;case 'lj-cut':x=LiveJournal.run_hook('lj-cut-...
 (truncated)
Tags: atyurin, js, livejournal, spacevillain
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